Chapter
6:
Graphics 209
programming technique. Using custom characters, you set up the character
memory and change the display by altering screen memory. In high-
resolution displays, screen memory usually stays constant, but character
memory changes.
To understand high-resolution graphics, let's review our discussion
of
character memory, but with a different perspective. From a text display
point of view,
we
think of screen memory as containing characters to be
displayed, with character memory holding the dot patterns
that
represent
the characters. In high-resolution terms, character memory becomes a
dot-by-dot representation of the display, and screen memory
is
simply a set
of
pointers to remind the VIC chip
of
where it
is
on the screen.
In
both cases,
the VIC chip
is
doing exactly the same thing: taking characters from screen
memory and using them to look up dot patterns in character memory. Only
the description of the process
is
different. Recall how
we
built one player
from several custom characters in the last section. You can think of high-
resolution graphics
as
using the entire screen as a single "super-player."
High-resolution graphics have one serious drawback: They use a large
amount of memory. In fact, to completely map the screen in high-resolution
mode would take
4048
bytes of character memory. Since there are only
about 3500 bytes free on an unexpanded VIC, this does not leave much
room for your program.
It
is
possible, however, to experiment with high
resolution without expanding memory: Simply use only a small portion
of
the screen. The techniques
we
used for defining a custom character set can
also
be
used to set up a
64
X
64
dot area for high-resolution experimentation.
The steps in preparing this high-resolution work area are similar
to
those for establishing a custom character set. The Setup program listed
below may seem familiar, because it was written by making some editing
changes to the program
we
used to set up our custom character work area.
11313
REM
HIGH
RESOLUTION
"SETUP"
PROGRAM
1113
REM
PROTECT
CHARACTER
MEMORY
1213
POKE
52,24:POKE
56,24:CLR
1313
POKE
36869,254
140
REM
COP''''
UNREVERSED
CHARACTERS
1513
FOR
1=6144
TO
7167
:
POKE
I,PEEK(26624+I)
NEXT
1613
REM
CLEAR
CHARACTER
MEMORY
170
FOR
1=7168
TO
7679
:
POKE
1,O
:
NEXT
1813
REM
PREPARE
SCREEN
MEMORY
190
PRINT
1O:'lIl!HPX
(138"
200
PRINT
IO:flIQY!)19
1O
2113
PRINT
"mlJRZ";
CHR$(34);
CHR$(34)
,:
CHR$(20);
"!lE2:
"