The ZX Spectrum Reverse Engineering and Clone Desgin Blog

Harlequin

A site dedicated to the reverse engineering of the ZX Spectrum and related projects.

< 5 of 68 >

Video Design Concepts

Mar 02, 2007

We need to have the attribute byte and the screen byte available at the same time, a moment before we need to shift the display bits into the video output generator. Since we cannot read two locations from the video memory simultaneously, we read one byte and store it in a register so that it is available when we read the second byte.

The screen byte needs to be stored in a shift register so that it's 'pixels' can be clocked into the video output circuit. The attribute byte needs to be available to the video output circuit as soon as the first bit of the screen byte is shifted, so it can output the appropriate ink or paper colour. This suggests that we should read and store the attribute byte prior to reading the screen byte. The screen byte could be loaded straight into the shift register.

The shift register needs to be loaded with the new screen byte as soon as bit0 of the current byte has been shifted out (remember that the display scans left to right, so bit7 will be the first out of the shift register, being the leftmost pixel of the screen byte). The timing of this byte load will be critical if we're to avoid missing bits.