CPCWiki forum

General Category => Programming => Topic started by: Paulo Garcia on 15:55, 27 August 15

Title: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: Paulo Garcia on 15:55, 27 August 15
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
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: TFM on 16:21, 27 August 15
Because the Gate Array only understands hardware color codes. Or did you mean "How" instead of "Why"?
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: Paulo Garcia on 18:34, 27 August 15
Hey TFM,


no, I really meant "Why".


Thanks!


Paulo
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: TFM on 18:48, 27 August 15
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.  :)
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: ronaldo on 19:41, 27 August 15
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).
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: Paulo Garcia on 20:02, 27 August 15
That's guys! Now it is all clear in my mind. I have to admit, CPC is amazing :)

Paulo
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: Octoate on 20:08, 27 August 15
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)
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: Paulo Garcia on 21:47, 28 August 15
Great link. Learning a lot.


At some point I will need to import a CPC 464  8)


Thanks
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: TFM on 21:48, 28 August 15
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).  :)
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: AMSDOS on 12:07, 24 September 15
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)
Title: Re: CPCTelera:Why converting firmware colour value into its equivalent hardware one?
Post by: freemac on 16:53, 24 September 15
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  ;)
Powered by SMFPacks Menu Editor Mod