Converts a firmware colour value into its equivalent hardware one.
u8 cpct_getHWColour (u8 firmware_colour)
| (1B BC) firmware_colour | [0-26] Firmware colour value to be converted (Similar to BASIC’s INK value) |
call cpct_getHWColour_asm
| <u8> | [0-31] Hardware colour value corresponding to firmware_colour provided. |
Uses the firmware_colour as index in a conversion table to get its equivalent hardware value. You can find this equivalences in the table 1 of the cpct_setPalette explanation.
BC, HL
40 bytes (13 bytes code, 27 bytes colour conversion table)
Case | Cycles | microSecs (us)
---------------------------------------
Any | 63 | 15.75
---------------------------------------
Asm saving | -32 | -8.00
---------------------------------------