Hi,
keep in mind this is a question from who never programmed on CPC before :)
If there is a supporting documentation to point me to I would appreciate.
Thanks
Paulo
Because the Gate Array only understands hardware color codes. Or did you mean "How" instead of "Why"?
Hey TFM,
no, I really meant "Why".
Thanks!
Paulo
Well, the hardware knows 32 colors, and to select one of them you send a value from &40 to &5F to port &7Fxx. (Values from 0 to 16 do select border, paper, pen 1-15 as target for the color value).
Since 5 of the 32 colors are equal, there are 27 different colors left. To make it more easy, the firmware renumbered them from 0 to 26. The order is according to the brightness on green/monochrome monitor. :)
As @TFM (http://www.cpcwiki.eu/forum/index.php?action=profile;u=179) correclty says, Gate Array only understands color codes that are known as "hardware values". However, there is a great deal of people used to "firmware values" which are the values used from BASIC (normally, using INK). CPCtelera (http://lronaldo.github.io/cpctelera) includes functions for converting firmware values to hardware values just for some users to be comfortable, and to make clear in the examples that hardware values are the valid ones.
First versions of CPCtelera (http://lronaldo.github.io/cpctelera) generated confusion among testers that tried to send firmware values to cpct_setPalette. Then I decided to create these conversion functions and put them in the examples. That stopped confusion. However, you don't actually need them: it's much better if you provide cpct_setPalette / cpct_setPALColour with hardware color values directly (You have a table in the documentation with the concrete values (http://lronaldo.github.io/cpctelera/files/video/cpct_setPalette-s.html). You need to use values from the 2nd column).
That's guys! Now it is all clear in my mind. I have to admit, CPC is amazing :)
Paulo
Maybe the following CPCWiki page about the video modes and their colours, which was created by @MacDeath (http://www.cpcwiki.eu/forum/index.php?action=profile;u=221), might also be helpful for you: Video modes - CPCWiki (http://cpcwiki.eu/index.php/Video_modes)
Great link. Learning a lot.
At some point I will need to import a CPC 464 8)
Thanks
Quote from: Paulo Garcia on 21:47, 28 August 15
At some point I will need to import a CPC 464 8)
Get a 6128 - seriously! (Not by accident it's his 30st birthday today). :)
Back when I got my 6128, I came across a program called "Multi-Coloured Modes" from AA17 (http://www.cpcwiki.eu/index.php/Amstrad_Action_February_1987_Type-Ins), which used the Equivalent Hardware Colour.
(http://www.cpcwiki.eu/imgs/3/34/AA017_Screenshot_007.gif)
As pastel colors, each Amstrad color has a certain name.
It is about 3 levels : 0.0 0.5 and 1.0, on each wires : R G B.
But as a mod 3 value is hard to code in binary... they map it manually in order to gain space :)
That gives this so cool Amstrad color set ;)