Chapter 4
25
For the technique to work, the generated picture must be in perfect synchronisation
with the standard TV picture to ensure that the SPECTRA interface only reads from its
display RAM at the same moments that the ULA reads from the Spectrum’s internal
display memory. This then avoids the need for the SPECTRA interface to handle
contention conditions with the CPU since the ULA will already be performing this task.
To achieve synchronisation, the SPECTRA interface aligns its display generation with
the interrupt (/INT) and luminance (/Y) signals exposed on the Spectrum’s expansion
bus, which allow the start of each TV frame and the start of each scan line within a
frame to be determined. If the luminance signal is not active on the expansion bus
then the SPECTRA interface cannot synchronise with the standard TV picture and so
will not attempt to generate a display (resulting in a blank screen). This condition is
detected and reported to the user using the video signal absent indicator LED, as
described in Chapter 3.
The SPECTRA interface controls the operation of fetching raw display bytes from its
RAM and processing them to generate the TV picture. However, it does not have to
interpret the bytes in the same manner that the Spectrum interprets those from its
display RAM. Further, since a complete copy of the lower 16K RAM bank is available,
the SPECTRA interface may interpret as much of this RAM as it wishes when
constructing the TV display. This forms the basis of how the new display modes are
achieved.
A consequence of the shadowing approach used by the SPECTRA interface is that it
limits the memory available for the new display modes to 16K, and is because only
this amount is contended with the ULA. Of the 16K, the display file always occupies 6K
and so the maximum size available for the attributes file is 10K. This is why the
SPECTRA interface cannot support an attributes file of resolution of 32 x 192 when
using 64 ink and 64 paper colours, or an attributes file of resolution 64 x 192 when
using 8 ink and 8 paper colours. Although it is theoretically possible to use more of the
16K to create a higher pixel resolution display (albeit at the expense of reducing the
available range of colours and the colour resolution), it was decided to only target the
colour deficiencies of the Spectrum in this version of the SPECTRA interface.
Note that there is actually 32K of RAM onboard the SPECTRA interface, which is
divided into two banks of 16K. Only one of these banks is ever shadowing the
Spectrum’s lower 16K RAM bank, as explained later in this chapter.
The SPECTRA interface generates its TV picture using a similar process to that used
by the Spectrum’s ULA, although it includes additional logic to implement the extra
display modes. For a comprehensive description of how the Spectrum generates its TV
picture, refer to The ZX Spectrum ULA book [1].
The majority of the new attribute modes can only practically be accessed using
machine code but a few can be controlled directly from BASIC and these are
described later in this chapter. The ROM paging mechanism provided by the
SPECTRA interface opens up the possibility to extend Spectrum BASIC with support for
most of new attribute modes, and this is explored further in Chapter 7.