Newbie Graphics Color Question
Jaakko
Posts: 6
The method of choosing colors in the graphics object doesn´t appear particulary intuitive for a newcomer,·have I missed some documentation again or is there some simple way to pick colors?
Thank you guys for a great forum,
Jaakko·
Thank you guys for a great forum,
Jaakko·
Comments
Basically, each pixel is one of four colors chosen from a palette. Groups of pixels are arranged in a "tile" which is 16 x 16 2-bit pixels and one 32-bit (4 byte) palette is associated with each tile. To save memory, these palettes are kept in a table that can have up to 64 entries and each tile selects one of these palettes.
This scheme is partially determined by hardware and partially by software. The Hydra book is the best collection of information on video generation with the Propeller, but you can also glean a lot by reading the Propeller Manual's description of the video instruction (WAITVID) and control registers (VCFG and VSCL).
http://www.parallax.com/dl/docs/prod/prop/Hydra-Ch16Sample-v1.0.pdf
That is good for the Parallax Reference Drivers that ship with the Propeller tool.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
http://www.rayslogic.com/propeller/Programming/GraphicsDemo.htm
http://www.rayslogic.com/propeller/Programming/TV_Colors.htm
http://www.rayslogic.com/propeller/Programming/Colors.htm
I think of it this way - There are 16x12 tiles on the screen. Each tile is defined by the screen pointer array. Each screen pointer defines (1) the colors for this tile, and (2) where the contents of the tile are actually stored (the Display).
So, there are a few ways to change the contents of the screen
1 - Change the screen pointer to point to new contents. You could also have several tiles all pointing to the same contents.
2 - Change the contents by writing into the display. The screen pointers are still pointing to the same patch of data, but the data has changed.
To add a bit of confusion, it's very common to double buffer the screen. This means you set another patch of memory aside, casually draw your screen on that, and then flip the screen pointers to your new screen once you're done.
There are probably better ways to explain it, but I hope that helps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
I will read trough the documents you recommended. All I need at this point is 4 colors, I just have to figure out how to control what those 4 colors actually are.
Best regards,
Jaakko