News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Paulo Garcia

CPCTelera:Why converting firmware colour value into its equivalent hardware one?

Started by Paulo Garcia, 15:55, 27 August 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Paulo Garcia

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

TFM

Because the Gate Array only understands hardware color codes. Or did you mean "How" instead of "Why"?
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Paulo Garcia


TFM

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.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ronaldo

As @TFM 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 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 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. You need to use values from the 2nd column).

Paulo Garcia

That's guys! Now it is all clear in my mind. I have to admit, CPC is amazing :)

Paulo

Octoate

Maybe the following CPCWiki page about the video modes and their colours, which was created by @MacDeath, might also be helpful for you: Video modes - CPCWiki
--

Paulo Garcia

Great link. Learning a lot.


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


Thanks

TFM

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).  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

AMSDOS

Back when I got my 6128, I came across a program called "Multi-Coloured Modes" from AA17, which used the Equivalent Hardware Colour.


* Using the old Amstrad Languages :D * And create my own ;)
* Incorporating the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

freemac

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