EasyManuals Logo

Sinclair ZX Spectrum User Manual

Sinclair ZX Spectrum
82 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #41 background imageLoading...
Page #41 background image
Chapter 4
39
for the display mode register since then the I/O read would not have been suspended
while the ULA performs a memory read. Instead of a value of $FF being read (the state
of an idle data bus), the value returned would have been the display byte being
fetched by the ULA. It would only have proved possible to reliably read the display
mode register by waiting until an interrupt had occurred since this happens prior to the
top border being generated. Using a non-contending I/O port would have made the
process of reading the display mode register slower and more involved.
Display mode control from BASIC
The majority of the new attribute modes can only practically be accessed using
machine code, but those that are row based and use single byte colour can be
controlled directly from BASIC. In addition, the enhanced border and multiple screen
facilities may also be controlled from BASIC. However, it is possible to add support for
other attribute modes by extending BASIC using the ROM facilities provided by the
SPECTRA interface and this is explored in Chapter 7.
The new display modes that can be directly controlled using standard BASIC are:
Full cell, row, extra colours, single byte colour mode (8x8 SE).
Half cell, row, basic colours, single byte colour mode (4x8 SB).
Half cell, row, extra colours, single byte colour mode (4x8 SE).
Enhanced border (when in 8x8 SB, 8x8 SE, 4x8 SB or 4x8 SE).
Multiple screen mechanism (when in 8x8 SB, 8x8 SE, 4x8 SB or 4x8 SE).
The following program demonstrates full cell, row, extra colours, single byte colour
mode (8x8 SE) by displaying all colour combinations available:
10 OUT 32735,4
20 DEF FN p(c)=INT (c/8):
DEF FN i(c)=c-8*FN p(c)
30 FOR f=0 TO 1
40 FOR p=0 TO 1
50 FOR n=0 TO 1
60 FOR i=0 TO 63
70 PRINT FLASH f; INVERSE n; BRIGHT p;
PAPER FN p(i); INK FN i(i);"a";
80 NEXT i
90 NEXT n
100 NEXT p
110 NEXT f
The ink pixels can be set to any of 64 colours and the paper pixels can be set to black
and white only. The program sets the ink pixel colour through the combined use of
BASIC commands INK and PAPER, with DEF FN statements being used to simplify
the process of translating the 64 palette colour into values to pass to the INK and
PAPER commands. The paper pixel colour is set through the use of the BASIC
command BRIGHT. The BASIC commands FLASH and INVERSE operate as usual.

Table of Contents

Other manuals for Sinclair ZX Spectrum

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair ZX Spectrum and is the answer not in the manual?

Sinclair ZX Spectrum Specifications

General IconGeneral
ProcessorZilog Z80A
Clock Speed3.5 MHz
RAM16KB or 48KB
ROM16KB
Graphics256 x 192 resolution
Sound1-channel beeper
StorageCassette tape
InputKeyboard
Power9V DC
Release Year1982
DisplayTV via RF modulator
PortsExpansion, RF
Colors15 (8 colours with two levels of brightness each, plus black)

Related product manuals