Technically speaking, Layer 1,1 is the same as Layer 0 with extra colour capabilities however NextBASIC treats them differently to maintain a consistent way of addressing the extra capabilities of the ZX Spectrum Next's EnhancedULA. The legacy coordinate system we discussed above applies only on Layer 0, whereas Layers 1 and 2 use the new system.

There are three major differences between Layer 0 and Layers 1 and 2 as far as character positioning goes. There are more differences but we will examine these in turn in the special graphics Chapters 15 – 17. These are:

  1. Layer 0 is organised in a strict 32 columns by 24 rows matrix while the rest can both position characters on a similar matrix (according to character size), or, if so desired, anywhere along the y and x axes.
  2. The user cannot –normally– position characters on the two bottom rows of the Layer 0 screen while this is possible in the other layers.
  3. Layer 0 pixel coordinates begin at the bottom left corner and extend up and to the right while for the rest of the layers, pixel coordinates begin at the top left corner and extend down and to the right. This particular difference is not important for character placement on Layer 0 but it is for the rest of the layers and definitely, as we are going to see further down this manual, extremely important for positioning graphics.

Changing the size of characters

With the exception of Layer 0, which has, as we mentioned, a rigid organisation of character positions on screen in a 32 x 24 character matrix, all other layers have the ability to position characters either rigidly as above (ie. in a rows x columns matrix) or freely according to pixel position of each character matrix's top left corner.

Character size can be modified horizontally with the following sequence:

PRINT CHR$ 30; CHR$ n;

where n can be a number from 3 to 8, which sets the width of all characters displayed on screen from a minimum of 3 to a maximum of 8 pixels wide. Character size is modified vertically by issuing:

PRINT CHR$ 29; CHR$ n;

where n can be a number from 0 to 3, which sets the height of all characters displayed on screen to the following predetermined heights in pixels:

Value of n Size (pixels) Description
0 8 Normal Size
1 16 Double Size
2 6 Reduced Size
3 12 Double Reduced Size

These sequences which are more appropriately called control codes, are character size shortcuts for text windows. These can also be used on Layer 0 but you would need to open a window first when in that mode. The rest of the layers have predefined and pre-opened full-screen text windows and therefore these control codes work there by default. We will discuss text windows at length in Chapter 20 – Channels, Streams and Windows so for now keep these two control codes in mind as only working outside Layer 0. They are extremely important to know, as they modify the behaviour of the AT and TAB modifiers we will examine below.

Using AT to print to a certain location

You have already seen PRINT used quite a lot, so you will have a rough idea of how it is used. Expressions whose values are printed are called PRINT items, and they are separated by commas, semicolons and apostrophes, which are called PRINT separators. A PRINT item can also be nothing at all, which is a way of explaining what happens when you


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.