Screen handling

mode.c provides a very simple screen handling interface:

Colour swapping

R/B colour swapping is implemented in colswap.c. Colour swapping is performed at the sprite level, rather than the screen level; there are three ways in which this occurs:

  1. Palettised sprites have palettes produced in which the R/B channels are swapped
  2. Non-palettised sprites have the R/B channels of each pixel swapped. This is performed at loading time, and again whenever R/B swapping is turned on or off.
  3. Direct use of colour values (for example font and compass needle colours) are also swapped. In the case of the two examples just given, the colour values are applied to sprites which are already in the R/B swapped state. This is to ensure correct operation of the sprite isn't greyscale.

Whenever the user changes the R/B swapping state in the options, all cached sprites held by the game are deleted (or marked for deletion), and all static 16bit sprites have their R/B channels swapped.

TODO:
CODE: DELAYED: DMA support for A9. Need to find a module to use, or code to copy. And someone to test it!
CODE: QUICK: Improve default screen size detection - detect pre-StrongARM and use 320x256 as default resolution. Also, if possible, detect A9, and use Iyonix resolution.
???
Profit!