Chapter 4
40
The following program demonstrates half cell, row, basic colours, single byte colour
mode (4x8 SB) by displaying all colour combinations available:
10 OUT 32735,128
20 FOR n=0 TO 1
30 FOR p=0 TO 7
40 FOR f=0 TO 1
50 FOR b=0 TO 1
60 FOR i=0 TO 7
70 PRINT FLASH f; BRIGHT b; INVERSE n;
PAPER p; INK i;"a";
80 NEXT i
90 NEXT b
100 NEXT f
110 NEXT p
120 NEXT n
The ink pixels of the left and right halves of each cell can be set to any of the basic 8
colours, with the paper pixels always being set to black. The program sets the ink pixel
colour through the combined use of BASIC commands INK and PAPER, with the
BASIC commands FLASH, BRIGHT and INVERSE operating as usual.
The following program demonstrates half cell, row, extra colours, single byte colour
mode (4x8 SE) by displaying all colour combinations available:
10 OUT 32735,128+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; BRIGHT p; INVERSE n;
PAPER FN p(i); INK FN i(i);"a";
80 NEXT i
90 NEXT n
100 NEXT p
110 NEXT f
The ink pixels of the right half of each cell can be set to any of 64 colours but the ink
pixels of the left half of each cell can only be set to black or white. The paper pixels
are always set to black. 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.
This mode is probably of limited use due to the left half of each cell only supporting
ink colours of black or white.
The enhanced border functionality can be controlled when in any of the row based
attribute modes that use single byte colour, i.e. 8x8 SB, 8x8 SE, 4x8 SB and 4x8 SE.
The following program demonstrates access to the 64 colour palette when in extra
colours mode (8x8 SE).