EasyManua.ls Logo

Commodore Plus 4 - Page 213

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Graphics
Programming
in
BASIC
Copying
the
Standard
Set
If
you
want
to
add
your
own
special
characters
to
the
built-in
characters
and
still
use
some
of
the
standard
characters,
you
need
to
copy
the
patterns
stored
in
the
character
ROM
to
an
area
of
user
memory.
This
situation
is
somewhat
complicated
in
BASIC.
The
PEEK
function
automatically
reads
RAM.
This
means
that
if
you
PEEK
the
area
of
memory
containing
the
character
ROM,
you
do
not
get
the
ROM
patterns
at
all,
but
the
contents
of
the
RAM
"underneath"
the
ROM.
(See
the
banking
section
in
Chapter
5.)
You
can
defeat the
BASIC
switch
to
RAM
with
the
following
POKE:
POKE
1177,62
You
can
then
copy
the
upper
case/graphic
ROM
patterns
to
your
RAM
area
(at
characters)
with
FOR
I
=
0
TO
1023:P0KE
c2iaracters+I,PEEK(53248+I):NEXT
I
or
copy
the
upper/lower
case
ROM
patterns
with
FOR
I
=
0
TO
1023:P0KE
ciiaracters+I,PEEK(54272+I):]SrEXT
I
You
must
then
restore
BASIC'S
subroutine
with
POKE
1177,
63
Because
using
this
method
actually
changes
the
operation
of
BASIC
while
its
subroutine
is
altered,
restore
the
switch
to
RAM
before
you
perform
any
other
operations.
High-Resolution
Characters
You
can
create
custom
character
patterns
in
RAM
and
use
them
instead
of
the
ROM
characters
in
your
program.
First,
you
need
to
define
your
new
characters.
For
each
custom
character
use
an
8
*
8
grid
similar
to
the
one
shown
in
the
beginning
of
this
section.
The
top
row
of
the
grid
represents
the
top
row
of
your
character.
Add
up
the
bit
values
for
the
dots
you
want
on
in
this
row.
This
sum
is
the
first
of
eight
data
values
for
your
character.
Do
the
same
for
each
of
the
remaining
rows.
Since
your
custom
characters
must
appear
in
RAM,
you
must
switch
the
graphics
chip
to
look
at
RAM.
This
is
accomplished
by
clearing
bit
2
of
65298
($FF12),
that
is,
ANDing
its
current
value
with
251.
P0KE65298,PEEK(65298)AND251
To
reselect
ROM,
you
must
set
this
bit,
that
is,
OR
its
current
value
with
4.
P0KE65298,PEEK(65298)0R4

Other manuals for Commodore Plus 4

Related product manuals