Chapter 7
63
as mentioned in Chapter 4 the attribute files of the new display modes overlap with
the BASIC environment’s system variables and program listing area. This problem can
be partially overcome by shifting the BASIC program up in memory until it is beyond
the extent of the new attribute files, thereby creating a gap between the system
variables and the BASIC program area. This can be done by adjusting the Spectrum’s
system variables to create a region between the Channel Information area and the
BASIC program area (much in the same way that the ZX Interface 1 inserts its new
system variables after the standard ones). The region could be created upon the first
invocation of the external ROM, or once a new attribute mode has been selected. The
size of the region would need to be large enough for the selected attribute mode, and
could be dynamically adjusted when changing to a different attribute mode. An
alternate approach would be to simply create a region large enough to accommodate
all of the new attribute modes, but this would result in a less efficient use of memory.
Shifting the BASIC program would allow most of the new attribute modes to be
supported, except for all row and single line modes that use double byte colour since
their attribute files overlap the Spectrum’s system variables. The size of the region
required to shift the BASIC program area above the attributes file for each attribute
mode is shown in the following table.
Lowest address of
BASIC area
Row mode, basic colours, single byte
Row mode, basic colours, double byte
Row mode, extra colours, single byte
Row mode, extra colours, double byte
Quad line mode, basic colours, single byte
Quad line mode, basic colours, double byte
Quad line mode, extra colours, single byte
Quad line mode, extra colours, double byte
Dual line mode, basic colours, single byte
Dual line mode, basic colours, double byte
Dual line mode, extra colours, single byte
Dual line mode, extra colours, double byte
Single line mode, basic colours, single byte
Single line mode, basic colours, double byte
Single line mode, extra colours, single byte
Single line mode, extra colours, double byte
Shifted BASIC area required for each attribute mode