Showing changes from revision #0 to #1:
Added | Removed | Changed
Entry | |
---|---|
R0 | Pointer to empty, word-aligned 1KB buffer to fill with palette → RGB table |
R1 | Pointer to empty 32KB buffer to fill with RGB → palette table |
R2 | Mode / sprite area |
R3 | Palette pointer / sprite |
Exit | |
---|---|
R0 | Pointer to palette → RGB lookup table |
R1 | Pointer to RGB → palette lookup table |
This SWI is an enhanced version of InverseTable_Calculate that allows for the generation of lookup tables for an arbitrary sprite/palette, instead of just the current screen mode.
On entry R0 and R1 must point to empty buffers suitable for storing the generated tables.
On exit R0 and R1 will either point to the buffers that were supplied (with the buffers filled with the requested data), or alternately they may point to a table that was already cached by InverseTable internally. In this case the same rules as for InverseTable_Calculate apply – the returned pointers are only guaranteed to be valid until the next mode/palette/redirection change. If this is an issue for your application you can simply copy the returned table into the buffers which you passed in on entry.
This SWI only works with 256 colour modes/sprites. Any other colour depth will result in a ‘Bad MODE’ error.
R2 and R3 identify a mode + palette or a sprite area + sprite pointer, using the same methods as ColourTrans_ReadPalette. See ColourTrans mode identification for more details. Note that with this SWI it is not possible to specify a sprite using its name.
This call has a higher processing cost than InverseTable_Calculate, as InverseTable does not cache any custom-generated tables internally.