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

InverseTable_SpriteTable

InverseTable
» SWI Calls
» InverseTable_SpriteTable

InverseTable_SpriteTable

(SWI &4BF41)
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

Use

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.

Notes

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.

See also

  • InverseTable_Calculate
  • ColourTrans mode identification
Created on May 23, 2014 14:09:09 by Jeffrey Lee (213) (195.72.173.131)
Edit | Views: Print | Source | Linked from: InverseTable_Calculate, InverseTable SWI Calls

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.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
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