80 BANK 5 POKE %x,%@00100010
90 NEXT %x
100 LAYER 0
then execute the program. The two LAYER statements first enable HiRes mode and then disable it. The two BANK 5 ERASE statements make sure there are no left over data in the DISP_FILE areas by filling them with 0s. You will see first the DISP_FILE1 area filling up and once the entire height of the screen is ran through, the DISP_FILE2 area doing the same. If you want to see this in a more dramatic way, convert line 10 to read LAYER 1,1 and then insert a line:
65 LAYER 1,2
This will illustrate even more vividly how the display is changed to handle odd and even horizontal coordinates from different areas of the memory.
So far, we learned that bits can have two states; 0 and 1; we are ready therefore to make the logical jump and assign two colour states for the image we just created. With 0 being black and 1 being white, we just defined a monochrome picture. But what about more colours?
We saw that we can display at least two colours on screen using a single bit. To display more (and store this information somewhere) we need to store more bits of information, with this information dealing exclusively with colour. In the beginning of this chapter we discussed how the ZX Spectrum Next generates and stores colour in 9 bits. The immediately obvious way to do that, would be to expand on the model displayed on Fig. 18 by adding bits in the order the ZX Spectrum Next stores them and have a linear map of 9 bits per pixel. This is a good idea but unfortunately incorrect, and the reason for that goes back to our initial discussion of the ZX Spectrum Next being an 8-bit computer making accessing 9 bits of information at a time, extremely slow and therefore impractical in terms of design, both from software and hardware standpoints.
Instead the ZX Spectrum Next uses three systems of storing and displaying colour information additionally to the HiRes mode (Layer 1,2) which we just demonstrated as the latter is monochrome so no additional colour information is needed. These are:
This system dates from the early ZX Spectrum models and was mainly conceived to both display colour and save on memory which at the time came at a premium. The graphic display is separated in 2 areas. The first which we already showed in the previous section (DISPLAY_FILE) only holds the actual 1-bit graphic data. Size-wise and for the standard resolution of Layer 0 and Layer 1,1, this works out to: 256 x 192 = 49152 pixels – or – bits which divided by 8 gives us 6144 bytes which in turn divided by 1024 gives the 6 Kbytes figure). The second area, to which we shall introduce you now, is a smaller-sized memory block, known as COLOUR_FILE (or, alternatively, COL_FILE1) which resides immediately after DISPLAY_FILE in memory. It is 768 bytes long, and breaks down the colour information in blocks of 8 by 8 pixels (therefore dividing the screen in 32 x 24 blocks) or attribute cells where every cell can have two possible colours out of a total of 8 simultaneously. This colour information is stored in two consecutive GRB blocks of three bits each, preambled
ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.