Commodore 128 Programmer's Reference Manual page 248

Hide thumbs Also See for 128:
Table of Contents

Advertisement

238
COMMODORE 128
CHA
RANGE
0-63
64-127
128-191
192-255
RACTER
BIT 7
0
0
1
1
CODE
BIT 6
0
1
0
1
BACKGROUND
COLOR
REGISTER
NUMBER
0
1
2
3
ADDRESS
53281 ($D021)
53282 ($D022)
53283 ($D023)
53284 ($D024)
Figure 8-23. Extended Background Color Registers
For example, POKE the screen code for the letter A (1) into screen location 1024.
Now POKE the screen value 65 into screen location 1025. You might expect the
character to be a reverse A, the second character of the second screen code character set.
u
u
HOW TO INTERPRET SCREEN DATA
The data in screen memory is interpreted as screen codes, which are actually the indexes
r j
into the character ROM. Instead of representing the data as ASCII characters, the screen
I]
codes represent the index into the character ROM which provide the ASCII codes. The
first character in character ROM is the at sign (@); therefore the first screen code, 0, is the
code for the at sign.
I j
Remember, since extended background color mode only uses five bits to deter-
U
mine the screen code value, only the first 64 screen code characters (0-63) are available.
COLOR DATA
LI
The color assignments for the three colors on the screen stem from three sources. Just as
in standard character mode, the foreground color is assigned by COLOR RAM, in the
I
range 55296 ($D800) through 563295 ($DFE7). As described in the standard character
U
mode section, each color RAM location has a direct one-to-one correspondence with the
screen memory locations. See the Standard Character Mode section for screen and color
j j
memory maps and an explanation of how the two sections of memory correspond to one
U
another.
The screen background color is assigned by background color register zero (location
\ \
53281 ($D021)). This is the color of the entire screen, on which the foreground and an
M
additional 8 by 8 character matrix background is placed.
The additional 8 by 8 character matrix background colors are determined by the
value of bits 6 and 7 of the screen code character value. Depending on the value of these
I
bits, the extended background color (the color within the 8 by 8 character matrix for
LJ
each character), comes from one of the four background color registers. Since there are
four choices for the extended background color, the computer needs two bits to
represent the four color choices. Figure 8-23 shows the four-bit combinations and the
corresponding background color registers associated with them.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents