There's More
To This Than
Meets the Eye
Let's
take a
closer look
at
this program:
PMODE
#
Pages
Used
4
4
3
4
2 2
1 2
1
Line
10,
COSCREENPAGES
-4,
sets
the
number of
Screen Pages
(4)
needed
for PMODE 4. This
is
the
only
variable
in
the
program. You
can
change
the number
of
pages for
other
PMODEs (you don't
have
to
though; if you
leave
it at
4,
you'll
just
save memory). As
resolution
gets
lower,
so
do the number of memory pages
needed
for that
resolution. For example,
for PMODE
3,
you
still
need four
pages; for PMODE 2 and
1,
you need two pages;
and
for
PMODE
0,
you
need
one
page.
•
Line
20,
C1
STARTPAGE
=
1
,
sets
the starting
page.
•
Line
30,
C2PAGELENGTH
=
1
.5*1
024,
sets
the length of
each
page
(a
constant).
•
Line
40,
C3STARTSCREEN
=
(C1
PAGESTART-1
)
*C2PAGELENGTH + &H600,
tells the Color Computer
where to start
saving
the graphic display
in
memory.
•
Line
50,
C4ENDSCREEN
=
COSCREENPAGES
*C2PAGELENGTH +
C3SCREENSTART,
tells
the
Computer where to stop saving the
display
in memory.
•
Line
180,
IF
Sol
5
THEN
230,
sets the upper-left and
upper-right corners
of
the margin
(S
-
15)
for
CSAVEM.
•
Line
190,
SCREEN
(
0:CLS, sets Screen from Graphics
to
Text.
•
Line
200,
INPUT "STORAGE
FILENAME";V1
SCREENFILE$, prompts for the name of
the file
that
you want saved.
•
Line
210,
CSAVEM
V1 SCREENFILE$,C3STARTSCREEN,
C4ENDSCREEN,0, sets
the parameters
for saving.
•
Line
220,
SCREEN
1
,
1
,
sets Screen back
to Graphics and
Color Set
1.
•
Line
230,
IF
S<>1
1 THEN
280,
sets the
center
ofthe top
margin (S
=
1
1)
for
CLOADM.
•
Line
240,
SCREEN
0,0:CLS, sets
Screen
from Graphics
to
Text.
•
Line
250,
INPUT'LOAD
FILENAME"
;V1SCREENFILE$"
prompts
for
the
name of
the file that
you
want
loaded.
•
Line
260,
SCREEN
1
,
1
,
sets
Screen back
to
Graphics and
Color Set
1.
•
Line
270,
CLOADM
V1
SCREENFILE$,
loads the
file into
memory.
Chapter 11
Checkpoint
1.
(True/False) The command
CSAVEM loads
a
machine-language file
into the
Color Computer's
memory.
2.
When saving a graphic display, the
number of Screen
Pages depends on:
a.
how
long the program is.
b.
Color Set.
c.
PMODE (resolution).
d. PCLS.
e. page
length.
3.
(True/False) When
you
want to load a
file, rewind the
cassette to
the position
where
you
began
saving the
file.
37