Home »

Zx spectrum graphic modes

The meaning of «zx spectrum graphic modes»

The ZX Spectrum is generally considered to have limited graphical capabilities in comparison to some other home computers of the same era such as the Commodore 64, largely due to its lack of a dedicated graphics chip. Nevertheless, throughout its commercial life and later activity on the demoscene, various techniques have been developed to provide (or emulate) improvements to the Spectrum's graphical output.

The ZX Spectrum (and compatibles) computers uses a variation of the 4-bit RGBI palette philosophy (also used on CGA, Thomson MO5, Sharp MZ-800, Mattel Aquarius, etc.).

This results in each of the colours of the 3-bit palette having a basic and bright variant, with the exception of black. The bright half of the palette is generated using the video display's maximum voltage levels for each of the three Red, Green and Blue (RGB) components that a colour uses. The basic half of the palette is displayed by simply reducing these voltages.[1]

In the ZX Spectrum encoding the colour components are in GRB (Green, Red and Blue) order (from most to least significant bit) rather than the more common RGB order. The GRB order has the advantage that the colour numbers become ordered by increasing luminance, so if viewed on black-and-white display the ordered sequence 0 to 7 would form a gradient from black to white. Specifically, blue has a binary weight of 1, red has a weight of 2, and green has a weight of 4. As with any binary number, these weights add up to produce a single decimal number that matches the displayed colour, the effect of which can be seen in the table below (pay special attention to the "binary value" column).

For any value of n from 0 to 7, the following commands can be used to set or alter the screen's colours:

Furthermore, the BRIGHT command can be used to change the setting of the PAPER and INK commands' "bright" flag (the I in RGBI), giving them access to the entire 15-colour palette. Settings of "0" and "1" turn bright mode off and on (respectively). Since only one bit within a colour attribute byte is used to select the brightness for both foreground and background colours in a colour cell, it is not possible to select both bright and basic colour modes in the same colour cell. The BORDER command does not use a bright flag, thus only the eight basic colours are supported.

Counting from least to most significant bit, an attribute byte dedicates three bits for the foreground colour, three bits for the background colour, one bit for the bright flag, and one bit for the flashing effect (which causes the video display to alternate foreground and background colours periodically).

This quite short colour palette has urged the graphic artists (e.g. at ZX-Art) to resort to various dithering techniques; the simplest of which employs ordered patterns, as shown exhaustively in the opposite chart. Dithering also works very well with the original Composite video connection to an analog PAL TV, generating colour mixing along horizontal pixel lines.

contact us full version