HAM256

From Sinclair Wiki
Jump to navigation Jump to search

HAM256.png

HAM256 is a software display mode for ULAplus equipped Spectrums. A standard ULAplus screen can contain a maximum of 64 colours from a palette of 256, but a HAM256 screen can contain all 256 colours. This is achieved by changing the palette entries while the screen is being drawn.

Because this is quite CPU intensive it is only possible to change the entire palette every 16 screen lines. To avoid updating palette entries that are still being drawn the mode restricts you to using 32 colours per row. This is done by using alternate CLUTs. The first row uses CLUT 0 and 1, the next row uses 2 and 3, the next row uses 0 and 1 and so on.

To ensure the border remains a consistent colour, it is necessary for the 8th palette register to always have the same value (usually zero). This colour will be used when BORDER is set to 0.

The Timex variant of this mode uses the hardware 8×1 mode. The palette cannot be updated much faster so the restriction of 32 colours per row remains.

The extension to the SCR format is as follows:

  • HAM256 Spectrum screen: 6144 bytes bitmap, 768 bytes attributes, 768 bytes palette
  • HAM256 Timex screen: 6144 bytes bitmap, 6144 bytes attributes, 768 bytes palette