RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

ColourTrans mode identification

ColourTrans
» Technical Details
» ColourTrans mode identification

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:

For describing a mode

  • R0 (mode/sprite area pointer) should indicate the mode. This can be either:
    • A Mode Specifier (i.e. a 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.

For describing a sprite by name

  • R0 (mode/sprite area pointer) should be a pointer to the sprite area
  • R1 (palette/sprite pointer) should be a pointer to the sprite name
  • The ‘pointer to sprite’ flag should be clear

For describing a sprite by pointer

  • R0 (mode/sprite area pointer) should either by a pointer to the 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 sprite
  • The ‘pointer to sprite’ flag should be set.

See also

  • ColourTrans_GenerateTable
  • ColourTrans_SelectTable
  • ColourTrans_SelectGCOLTable
  • ColourTrans_ReadPalette
Revised on November 26, 2013 13:34:41 by Jeffrey Lee (213)

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys