HGFX is a new hardware expansion that adds a "planar" graphics to the ZX Spectrum graphics screen. It uses a normal ZX-screen bitmap of size 6144 bytes (from address 16384), but enables to colour each individual point (pixel) as you like. You can keep original ZX-pixels and put an additional colour graphics to them, of course. You might know a planar system from some game systems and home computers. In the case of our ZX Spectrum, this new graphics did not needlessly occupy a small and mostly fully used memory space of 48 to 128 KB. There is no need to write or move large sections of memory with the HGFX planar system. While so-called "chunky" colour graphic routines operate a whole one byte by a 256coloured pixel, orders for HGFX operations are dealing with one bit only. HGFX has been carefully developed with regard to a standard ZX Spectrum (graphics and memory) compatibility, e.g. - the HGFX videoram address can be put at the ZX-screen - the videoram can be operated simultaneously with the ZX-screen, which is displayed in place of the transparent HGFX colour - conversion of programs and games for HGFX does not require changing the memory arrangement, videoram still has only has 6144 bytes of memory - all new HGFX features can be used even with standard (non-linearly stored) ZX-screen format Briefly about the HGFX system ----------------------------- HGFX manages eight sections of internal memory, so-called "bitplanes", each with a size of 6144 bytes. They are stored one behind the other, but for a better clarity, let's imagine them stacked on top of each other (see ascii-picture). The more bitplanes you plug into a system, the greater "depth" of colours you will achieve. One bitplane allows two colours, so pixels can only turn on or off (black or white). Two bitplanes provide 4 colours. 4 bitplanes 16 colours etc. The fact that the entire pixel is not stored in one place, paradoxically provides a number of advantages when working with an extended graphics especially on a small ZX Spectrum. HGFX Planar Graphics -------------------------------------- / / / /-- Bitplane / / / Colours / / /-- / / / / 2 no.0 -------------------------------------- / /-- / / / / 4 no.1 -------------------------------------- / /-- / / / / 8 no.2 -------------------------------------- / /-- / / / / 16 no.3 -------------------------------------- / /-- / / / / 32 no.4 -------------------------------------- / /-- / / / / 64 no.5 -------------------------------------- / / / / / 128 no.6 -------------------------------------- / / / 256 no.7 -------------------------------------- Each pixel has 1 bit reserved in individual bitplanes. This is similar to POKE 16384,1 on the ZX Spectrum, which draws a single point on the screen. The difference is that the HGFX does not work with "monochromatic" graphics of one bitplane only, but ensures that a request for a colour pixel - or another effect - is rewritten to all bitplanes. It happens very quickly and a colour character print is as fast as a printing on the original zx-screen. Technical in short, with one write to a given pixel position, HGFX will set all of 8 bitplanes. Now you might be wondering how the colour value of the pixel is overwritten in bitplanes? Let's illustrate a specific colour scheme pixel value in one byte, in a binary form, and - for bitplane purposes - let's put it upright, so we can better understand how it is written by the HGFX system, i.e. "overwritten" across bitplanes. HGFX Pixel Colour Value decimal: 25 binary: 00011001 bits order: 0 0 0 1 1 0 0 1 <-- The lowest bit goes bitplane: 7 6 5 4 3 2 1 0 <-- to the 1st (top) bitplane. / / / / / /-- / 1 / / / no.0 -------------------------------------- / /-- / 0 / / / no.1 -------------------------------------- / /-- / 0 / / / no.2 -------------------------------------- / /-- / 1 / / / no.3 -------------------------------------- / /-- / 1 / / / no.4 -------------------------------------- / /-- / 0 / / / no.5 -------------------------------------- / / / 0 / / no.6 -------------------------------------- / / 0 / no.7 -------------------------------------- The most upper bit of the colour value goes to the lowest (last) bitplane.