COLOR
Format: COLOR (Y, Z, X)
Supported by: Pecom 32 BASIC, Pecom 64 BASIC 1.0 and 4.0
Similar commands:
COMX BASIC V1.00: COLOR
Floating Point BASIC 2.2: COLOR
Telmac SBASIC v 24.3: COLOR
The Pecom 64 BASIC 1.0 and 4.0 characters are in 2 different colour sets, selectable by the highest bit (PCB) of the character number itself. So characters 0 to 127 are the same as characters 128 to 255 in different colours.
The COLOR command is in the format, COLOR (Y, Z, X), where X is a numeric expression which determines the color combination to be used for the 2 characters sets. The colour combinations for different values of X are given in table 1 below. Y and Z specify the character range to be changed.
Now, try the command
COLOR (65, 66, 9)
followed by pressing CR, and note that characters A and B have turned blue. Try some other commands with the "9" replaced by any number from 0 to 11 inclusive. Observe the colour changes and compare them with table 1 below. Note that COLOR (0) corresponds to the default character colours.
X |
CHARACTER < 128 |
CHARACTER >= 128 |
||
0 |
BLACK |
|
GREEN |
|
1 |
RED |
|
YELLOW |
|
2 |
BLUE |
|
CYAN |
|
3 |
MAGENTA |
|
WHITE |
|
4 |
BLACK |
|
BLUE |
|
5 |
RED |
|
MAGENTA |
|
6 |
GREEN |
|
CYAN |
|
7 |
YELLOW |
|
WHITE |
|
8 |
BLACK |
|
RED |
|
9 |
BLUE |
|
MAGENTA |
|
10 |
GREEN |
|
YELLOW |
|
11 |
CYAN |
|
WHITE |
|
Table 1: Colour Schemes for COLOR (Y, Z, X)
NOTE: For this to work only values X: 0 to 3, 4 to 7 or 8 to 11 should be mixed. This as these ranges actually use different values of COLB0/COLB1 and as such change the colour set used for all characters. For example COLOR (65, 65, 9) will change character A to blue but after COLOR (66, 66, 6) B will indeed be green but also A will change to red (X = 5).
The COLOR command is performing the following logic: The X value is actually mapped to CCB0/CCB1 (by writing character RAM, i.e. 'shaping' all specified characters) and COLB1/COLB0 (OUT 3, bit 5/6) of the CDP1870. See also the Video Interface System page and table 2 below.
C0LB1 |
COLBO |
RED |
BLUE |
GREEN |
X |
0 |
0 |
CCBO |
CCB1 |
PCB |
0 to 3 |
0 |
1 |
CCBO |
PCB |
CCB1 |
4 to 7 |
1 |
0 |
PCB |
CCBO |
CCB1 |
8 to 11 |
1 |
1 |
PCB |
CCBO |
CCB1 |
|
Table 2: COLB1/COLB0 to X mapping