ZX Spectrum graphic modes
Encyclopedia
The ZX Spectrum
ZX Spectrum
The ZX Spectrum is an 8-bit personal home computer released in the United Kingdom in 1982 by Sinclair Research Ltd...

 is generally considered to have limited graphical capabilities in comparison to other home computer
Home computer
Home computers were a class of microcomputers entering the market in 1977, and becoming increasingly common during the 1980s. They were marketed to consumers as affordable and accessible computers that, for the first time, were intended for the use of a single nontechnical user...

s of the same era such as the Commodore 64
Commodore 64
The Commodore 64 is an 8-bit home computer introduced by Commodore International in January 1982.Volume production started in the spring of 1982, with machines being released on to the market in August at a price of US$595...

, largely due to its lack of a dedicated graphics chip. Nevertheless, throughout its commercial life and later activity on the demoscene
Demoscene
The demoscene is a computer art subculture that specializes in producing demos, which are non-interactive audio-visual presentations that run in real-time on a computer...

, various techniques have been developed to provide (or emulate) improvements to the Spectrum's graphical output.

Color palette

The ZX Spectrum (and compatibles)
ZX Spectrum
The ZX Spectrum is an 8-bit personal home computer released in the United Kingdom in 1982 by Sinclair Research Ltd...

 computers uses a variation of the 4-bit RGBI palette philosophy. This results in each of the colors 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 R/G/B color components that a color uses. The basic half of the palette is displayed by simply reducing these voltages.

Unlike most RGBI palettes, the ZX Spectrum swaps the color components around a bit: Blue has a binary weight of 1, Red has a weight of 2, while 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 color, 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 colors:
  • BORDER n, the color for surrounding area outside the main bitmap.
  • PAPER n, the background (pixel bit value of 0) color for the color cell to be altered.
  • INK n, the foreground (pixel bit value of 1) color for the color cell to be altered.


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-color palette. Settings of "0" and "1" turn bright mode off and on (respectively). Since only one bit within a color attribute byte is used to select the brightness for both foreground and background colors in a color cell, it is not possible to select both bright and basic color modes in the same color cell. The BORDER command does not use a bright flag, thus only the eight basic colors are supported.

Counting from least to most significant bit, an attribute byte dedicates three bits for the foreground color, three bits for the background color, one bit for the bright flag, and one bit for the flashing effect (which causes the video display to alternate foreground and background colors periodically).
Color number Binary value BRIGHT 0 (RGB) BRIGHT 1 (RGB) Color name
0 000 #000000 #000000 black
1 001 #0000CD #0000FF blue
2 010 #CD0000 #FF0000 red
3 011 #CD00CD #FF00FF magenta
4 100 #00CD00 #00FF00 green
5 101 #00CDCD #00FFFF cyan
6 110 #CDCD00 #FFFF00 yellow
7 111 #CDCDCD #FFFFFF white

Standard mode

The original ZX Spectrum has a screen resolution of 256×192 pixels. Colour information is overlaid onto this as a grid of 8x8 pixel regions known as attribute blocks; within each attribute block, only two colours may be used out of a palette of 8 (black, blue, red, magenta, green, cyan, yellow and white). Additionally, the entire attribute block may be designated as 'bright', resulting in a total of 15 possible colours (because both bright and dark black is the same color #000000). In many programs this limitation was evident as attribute clash
Attribute clash
Attribute clash was a display artifact caused by limits in the graphics circuitry of a number of early color 8-bit home computers, most notably the Sinclair Research ZX Spectrum, where it meant that only two colors could be used in any area of 8×8 pixels...

.
Details:
Pixels: 256 x 192
Attributes: 32 x 24
Colors: 15


Hicolour

Several third-party Spectrum clones, including the Timex Sinclair
Timex Sinclair
Timex Sinclair was a joint venture between the British company Sinclair Research and Timex Corporation in an effort to gain an entry into the rapidly-growing early-1980s home computer market in the United States...

 machines and the Pentagon
Pentagon (computer)
The Pentagon home computer was a clone of the British-made Sinclair ZX Spectrum 128. It was manufactured by amateurs in the former Soviet Union. Its PCB was copied all over the USSR, which made it the most widespread Soviet ZX Spectrum clone...

, support a screen mode in which attribute blocks are 8x1 pixels in size rather than the usual 8x8. A screen in this mode takes 12 KB RAM. In the case of the Timex, this mode is activated through the command OUT 255,2. In addition, this screen mode can be generated through the use of the MB-02 disk system's DMA
Direct memory access
Direct memory access is a feature of modern computers that allows certain hardware subsystems within the computer to access system memory independently of the central processing unit ....

 hardware (where the technique is known as Multitech), and is also available as Mode 2 on the SAM Coupé
SAM Coupé
The SAM Coupé is an 8-bit British home computer that was first released in late 1989. It is commonly considered a clone of the Sinclair ZX Spectrum computer, since it features a compatible screen mode and emulated compatibility, and it was marketed as a logical upgrade from the Spectrum...

.

"8x1" attributes

On other Spectrum models, this effect can be replicated by exploiting the fact that the ULA
Gate array
A gate array or uncommitted logic array is an approach to the design and manufacture of application-specific integrated circuits...

 re-reads the attribute information on every pixel row when generating the video output; it is possible to write a new value to the relevant memory location in between successive lines, and thus cause a different pair of colours to be shown. However, the Spectrum's processor is not fast enough to write to an entire row of attribute bytes in one scanline, so 8x1 attributes can only be achieved over 18 columns. This technique is variously known as Hicolour, Multicolour, FLI or Rainbow Processor mode.
Details:
Pixels: 256 x 192
Attributes: 32 x 192
Colors: 15

"8x2" attributes

A variation on this method is to change the complete row of attributes over the course of two scanlines, resulting in 8x2 pixel attribute blocks over the full width of the screen. In this situation the 128K Spectrum's shadow screen (see below) is commonly used as a back-buffer to ensure that the colour change happens simultaneously across all the attribute bytes.
Details:
Pixels: 256 x 192
Attributes: 32 x 96
Colors: 15

"4x1" attributes

A special case of the Hicolour mode involves alternating between the two available colours per attribute cell for 4 pixels each, allowing each 4x1 region to be treated as an independently colourable 'pixel' (although the limitation of one brightness level per 8x1 cell is still in effect).
Details:
Pixels: 64 x 192
Attributes: 64 x 192
Colors: 15


Multitech monochrome

By reducing the colour settings of the TV or monitor, it is possible to take advantage of the differences in intensity over the Spectrum's colour range to generate a 15-shade grayscale image at 256x192 resolution.

This technique is most commonly associated with the MB-02's Multitech capabilities, although it would work equally well with any other hicolour method as described above.
Details:
Pixels: 256 x 192
Attributes: 32 x 192
Colors: 15 grayscale


512×192, Highres monochrome

This mode was mainly used to display 64×24 or 80×24 columns text screen and only SAM COUPE mode 3 four colour version of this mode(24KB- 2bits per pixel) Timex Sinclair
Timex Sinclair
Timex Sinclair was a joint venture between the British company Sinclair Research and Timex Corporation in an effort to gain an entry into the rapidly-growing early-1980s home computer market in the United States...

 computers and some Russian clones can display it. There are two graphics editors for this mode and it is supported by BASIC64 and some CP/M
CP/M
CP/M was a mass-market operating system created for Intel 8080/85 based microcomputers by Gary Kildall of Digital Research, Inc...

 implementations. It also takes 12 kB (12 KiB
Kibibyte
The kibibyte is a multiple of the unit byte for quantities of digital information. The binary prefix kibi means 1024; therefore, 1 kibibyte is . The unit symbol for the kibibyte is KiB. The unit was established by the International Electrotechnical Commission in 1999 and has been accepted for use...

) RAM.
Details:
Pixels: 512 x 192
Attributes: none
Colors: 2 - SAM 4 from 128 possibly 16 per line if anyone figures out HMPR bits 5&6 or line interrupt CLUT alterations - DMA?


Interlace

By alternating between two screens on every frame interrupt (50 Hz), it is possible to simulate a doubling of the vertical display resolution from 192 to 384 lines. The Timex clones and ZX Spectrum 128K implement a 'shadow' screen area which can be switched into place through the use of a single OUT command, and this is often utilised to rapidly switch between two images for this purpose (although this can also be achieved with a standard block copy, albeit not over the entire screen). When viewed on a television screen, the flicker is less noticeable than on a monitor. The image is linked to here (warning: the linked image flickers very rapidly, which could potentially cause seizures in people with photosensitive epilepsy
Photosensitive epilepsy
Photosensitive epilepsy is a form of epilepsy in which seizures are triggered by visual stimuli that form patterns in time or space, such as flashing lights, bold, regular patterns, or regular moving patterns.-Symptoms:...

).

The technique does not in fact achieve a true interlaced display, as the Spectrum lacks the ability to synchronise with the display hardware at such a low level. Rather, the effect is more akin to anti-aliasing
Anti-aliasing
In digital signal processing, spatial anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution image at a lower resolution...

, with certain pixels appearing at half intensity.
Details:
Pixels: 256 x 384
Attributes: 32 x 24
Colors: 15


GigaScreen

Two specially prepared images are displayed on the screen rapidly after each other. The palette is increased to approximately 102 colors due to the color-mixing effects of the rapid flipping between images.

For Pentagon machines, a hardware modification is available which directly combines the two alternate screen areas into the video signal, thus eliminating the flicker
Flicker (screen)
Flicker is a visible fading between cycles displayed on video displays, especially the refresh interval on cathode ray tube based computer screens. Flicker occurs on CRTs when they are driven at a low refresh rate, allowing the brightness to drop for time intervals sufficiently long to be noticed...

 associated with this method. Furthermore, the gigascreen and hicolour techniques may be employed together to produce even richer-coloured images; this format has been named DithVIDE and BZither, both names referring to the dithering methods employed when converting true-colour images to the format.
Details:
Pixels: 256 x 192
Attributes: 32 x 24
Colors: 102


3colour / Multichrome / RGB-3 / Interchrome

Three separate images, comprising a red, green and blue layer, are displayed on the screen rapidly, one after the other, relying on persistence of vision
Persistence of vision
Persistence of vision is the phenomenon of the eye by which an afterimage is thought to persist for approximately one twenty-fifth of a second on the retina....

 effects to merge the three layers into a single coloured image. The result is an 8-colour image where each pixel may be coloured independently.

This effect is simulated in another image linked to here (warning: the linked image flashes colors very rapidly, which could potentially cause seizures in people with photosensitive epilepsy
Photosensitive epilepsy
Photosensitive epilepsy is a form of epilepsy in which seizures are triggered by visual stimuli that form patterns in time or space, such as flashing lights, bold, regular patterns, or regular moving patterns.-Symptoms:...

); the flashing is less noticeable when viewed on a television screen.
Details:
Pixels: 256 x 192
Attributes: 256 x 192
Colors: 8


256×192, 256 colors, "256 Colour Mode", no attributes

The SPEC256 and EmuZWin emulator
Emulator
In computing, an emulator is hardware or software or both that duplicates the functions of a first computer system in a different second computer system, so that the behavior of the second system closely resembles the behavior of the first system...

s have a screen mode 256×192 pixels where each pixel can be in one of 256 colors. This is achieved by extending the word size of the emulated Z80
Zilog Z80
The Zilog Z80 is an 8-bit microprocessor designed by Zilog and sold from July 1976 onwards. It was widely used both in desktop and embedded computer designs as well as for military purposes...

 from 8 bits to 64, making eight bits of data available for each pixel; the screen thus takes 48 kB of memory. This mode only exists on the emulator and software graphics must be modified to use it.
Details:
Pixels: 256 x 192
Attributes: 256 x 192
Colors: 256


128×192, 64 colors, "TV blur", 32×24 attributes

Due to the limitations of displaying a computer image on a regular TV, adjacent pixels were in fact blurred out horizontally. This effect was used to increase the number of displayed colours on screen by almost all of the graphic designers, by use of dithering techniques. Some emulators provide some sort of "blur" image processing trying to simulate this effect.
Details:
Pixels: 128 x 192
Attributes: 16 x 24
Colors: 64


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK