Chapter 7
64
These figures assume that the 58 bytes required for the ZX Interface 1 system
variables are also created. Note that the creation of Microdrive Maps and additional
Channel Information entries would further shift the BASIC program up in memory. This
would result in some wasted space but could only be avoided by further patching of
the ZX Interface 1 ROM.
The new BASIC commands required to operate the different display modes could
make use of the streams and channels mechanism built into the Spectrum by
introducing a new channel type, e.g. ‘D’. A stream could then be opened to this
channel using the OPEN keyword, e.g. OPEN #4;"D". Once opened, characters could
be sent to the stream using standard PRINT commands, e.g. PRINT #4;"SPECTRA". It
would be necessary to provide a way to select the active display mode and so a
command such as FORMAT "D";
n
could be used (where n would specify the mode
number). An enhanced version of the INPUT statement could be implemented to
operate with the active display mode, e.g. INPUT #4;"Enter your name";N$. Other
commands that operate on the screen could be implemented using syntax similar to
that introduced by the ZX Interface 1, i.e. by following a command keyword with a
symbol. The use of a symbol ensures that the statement fails the Spectrum’s standard
command parser, and so allows the Shadow ROM a chance to handle it. The
commands introduced by the ZX Interface 1 ROM use an asterisk for this purpose.
This works fine when used with commands SAVE, LOAD, VERIFY and MERGE, but if
used for new commands that expect a numeric parameter then the symbol could
appear to be a multiplication sign and might lead to confusion. Therefore, an alternate
symbol such as the percentage sign would a better choice. The new display modes
could then be controlled using a range of commands such as BORDER %, PAPER %,
INK %, FLASH %, CLS %, DRAW %, PLOT %, CIRCLE %, COPY %, etc.
Should the active display mode be set to the Spectrum’s standard screen format then
the new BASIC commands could simply delegate to the existing routines in the BASIC
ROM. New system variables might be required by the commands and so additional
entries could be inserted after the ZX Interface 1 system variables.