This document explains how to use one of the the extra colour modes (64-ink / 2-paper) provided by SPECTRA directly from BASIC without any firmware modifications or machine code.
SPECTRA contains a lot of new graphics facilities including 11 new rendering modes. Most of these rendering modes (at present) can only be exploited in machine code. However using one of the new colour modes is available from unmodiifed BASIC which provides you with 64 unique INK colours and 2 PAPER colours (black and white).
To avoid confusion, we will refer to the 64-ink colours as FOREGROUND colours and the 2-paper colours as BACKGROUND colours, but in essence, FOREGROUND is the INK and BACKGROUND is PAPER, but we don't necessarily use those BASIC statements to set them.
You can switch the SPECTRA Extra Colours Mode on using the following statement:
OUT 32735,4
You can switch Extra Colours Mode off again at any time using the statement:
OUT 32735,0
Note that the existing screen will change immediately - as soon as the OUT instruction is executed.
Foreground colour is set using a combination of the INK and PAPER statements, providing you with a palette of 64 different colours to choose from. They can be used both as statements on their own (setting the perminant ink colour) or as part of a PRINT statement (setting the temporary ink colour). Both INK and PAPER can be set to a value between 0 and 7 (setting them to 8 or 9 will not be useful unless you know exactly what you are doing). Also, typically, you will want to set use both INK and PAPER commands together every time you wish to set a new FOREGROUND colour.
To choose a colour, locate it in the table below (third column) and then use the PAPER and INK colours in the last column to set it. The first two columns show what the same statements do on the classic Spectrum screen mode.
As an example, BROWN can be chosen by selecting PAPER 3 (magenta) and INK 0 (black)
10 OUT 32735, 4 20 PAPER 5: INK 4: REM Sets FOREGROUND colour to Gold 30 PRINT "Gold Text" 40 PRINT PAPER 3;INK 0;"Brown Text" 30 PRINT "More Gold Text"
The background colour (what is traditionally called PAPER) will be BLACK by default but you can set it to WHITE by using BRIGHT 1. For example:
10 OUT 32735, 4 20 PAPER 3: INK 4: REM Sets FOREGROUND colour to Dark Orange 30 PRINT "Dark Orange on Black Background" 40 BRIGHT 1 30 PRINT "Dark Orange on White Background" 50 BRIGHT 0 60 PRINT "Dark Orange on Black Background again" 30 PRINT "Dark Orange on ";BRIGHT 1;"White and ";BRIGHT 0;"Black Background"
You can return to a BLACK BACKGROUND by using the BRIGHT 0 statement.
In summary
| Classic | SPECTRA | Set using... |
|
| PAPER | INK | G R B | |
| 0 0 0 | PAPER 0: INK 0 | ||
| 0 0 1 | PAPER 0: INK 1 | ||
| 0 0 2 | PAPER 0: INK 2 | ||
| 0 0 3 | PAPER 0: INK 3 | ||
| 0 1 0 | PAPER 0: INK 4 | ||
| 0 1 1 | PAPER 0: INK 5 | ||
| 0 1 2 | PAPER 0: INK 6 | ||
| 0 1 3 | PAPER 0: INK 7 | ||
| 0 2 0 | PAPER 1: INK 0 | ||
| 0 2 1 | PAPER 1: INK 1 | ||
| 0 2 2 | PAPER 1: INK 2 | ||
| 0 2 3 | PAPER 1: INK 3 | ||
| 0 3 0 | PAPER 1: INK 4 | ||
| 0 3 1 | PAPER 1: INK 5 | ||
| 0 3 2 | PAPER 1: INK 6 | ||
| 0 3 3 | PAPER 1: INK 7 | ||
| 1 0 0 | PAPER 2: INK 0 | ||
| 1 0 1 | PAPER 2: INK 1 | ||
| 1 0 2 | PAPER 2: INK 2 | ||
| 1 0 3 | PAPER 2: INK 3 | ||
| 1 1 0 | PAPER 2: INK 4 | ||
| 1 1 1 | PAPER 2: INK 5 | ||
| 1 1 2 | PAPER 2: INK 6 | ||
| 1 1 3 | PAPER 2: INK 7 | ||
| 1 2 0 | PAPER 3: INK 0 | ||
| 1 2 1 | PAPER 3: INK 1 | ||
| 1 2 2 | PAPER 3: INK 2 | ||
| 1 2 3 | PAPER 3: INK 3 | ||
| 1 3 0 | PAPER 3: INK 4 | ||
| 1 3 1 | PAPER 3: INK 5 | ||
| 1 3 2 | PAPER 3: INK 6 | ||
| 1 3 3 | PAPER 3: INK 7 | ||
| 2 0 0 | PAPER 4: INK 0 | ||
| 2 0 1 | PAPER 4: INK 1 | ||
| 2 0 2 | PAPER 4: INK 2 | ||
| 2 0 3 | PAPER 4: INK 3 | ||
| 2 1 0 | PAPER 4: INK 4 | ||
| 2 1 1 | PAPER 4: INK 5 | ||
| 2 1 2 | PAPER 4: INK 6 | ||
| 2 1 3 | PAPER 4: INK 7 | ||
| 2 2 0 | PAPER 5: INK 0 | ||
| 2 2 1 | PAPER 5: INK 1 | ||
| 2 2 2 | PAPER 5: INK 2 | ||
| 2 2 3 | PAPER 5: INK 3 | ||
| 2 3 0 | PAPER 5: INK 4 | ||
| 2 3 1 | PAPER 5: INK 5 | ||
| 2 3 2 | PAPER 5: INK 6 | ||
| 2 3 3 | PAPER 5: INK 7 | ||
| 3 0 0 | PAPER 6: INK 0 | ||
| 3 0 1 | PAPER 6: INK 1 | ||
| 3 0 2 | PAPER 6: INK 2 | ||
| 3 0 3 | PAPER 6: INK 3 | ||
| 3 1 0 | PAPER 6: INK 4 | ||
| 3 1 1 | PAPER 6: INK 5 | ||
| 3 1 2 | PAPER 6: INK 6 | ||
| 3 1 3 | PAPER 6: INK 7 | ||
| 3 2 0 | PAPER 7: INK 0 | ||
| 3 2 1 | PAPER 7: INK 1 | ||
| 3 2 2 | PAPER 7: INK 2 | ||
| 3 2 3 | PAPER 7: INK 3 | ||
| 3 3 0 | PAPER 7: INK 4 | ||
| 3 3 1 | PAPER 7: INK 5 | ||
| 3 3 2 | PAPER 7: INK 6 | ||
| 3 3 3 | PAPER 7: INK 7 | ||