[[!redirects ColourTrans mode idenfitication]] h6. [[ColourTrans]] h6(. » [[ColourTrans Technical Details|Technical Details]] h6((. » ColourTrans mode identification h2. ColourTrans mode identification Several ColourTrans SWIs allow the user to specify a source/destination mode/palette using a pair of registers (typically R0 & R1) and a flag bit (e.g. bit 0 of R5 in [[ColourTrans_GenerateTable]]). This set of values can either describe a screen mode (with either a specific palette, the current palette, or a default palette), or a sprite (with the sprite's palette). To allow ColourTrans to correctly determine whether your are passing a mode or a sprite, adhere to one of the following argument patterns: h4. For describing a mode * R0 (mode/sprite area pointer) should indicate the mode. This can be either: ** A [[Mode Specifier]] (i.e. a [[Screen Modes|mode number]], [[Sprite Mode Word]], or a pointer to a [[Mode Selector Block]]) ** -1 to use the current mode * R1 (palette/sprite pointer) should contain: ** -1 to use the current palette (Only use if current mode matches the BPP of the indicated mode) ** 0 to use the default palette for the mode ** Else a pointer to a palette * The 'pointer to sprite' flag should be clear If a palette pointer is used, the palette is expected to be 2, 4, 16 or 256 words long for 1bpp, 2bpp, 4bpp or 8bpp respectively. This means that a full 256 entries are expected for old-style 64 colour modes. Palette entries should be in standard &BBGGRR00 format. h4. For describing a sprite by name * R0 (mode/sprite area pointer) should be a pointer to the [[Format Of Sprite Area|sprite area]] * R1 (palette/sprite pointer) should be a pointer to the sprite name * The 'pointer to sprite' flag should be clear h4. For describing a sprite by pointer * R0 (mode/sprite area pointer) should either by a pointer to the [[Format Of Sprite Area|sprite area]], or the special values &8000 or 256. The special values should be used in situations where it is unknown which sprite area the sprite belongs to. * R1 (palette/sprite pointer) should be a pointer to the [[Format Of Sprite|sprite]] * The 'pointer to sprite' flag should be set. h4. See also * [[ColourTrans_GenerateTable]] * [[ColourTrans_SelectTable]] * [[ColourTrans_SelectGCOLTable]] * [[ColourTrans_ReadPalette]]