home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 157
/
157.d81
/
t.infra
< prev
next >
Wrap
Text File
|
2022-08-26
|
6KB
|
215 lines
THE MIGHTY LOADSTAR
C-64 INFRASTRUCTURE GUIDE
According to Knees Calhoon
Hex Dec Page
---------------------------------
$0000 0 0
This area is filled with registers
you can POKE or PEEK. The best list
is found in Sheldon Leemon's MAPPING
THE C-64. The Programmer's Reference
Guide has a concise list on pages
310-320.
---------------------------------
$0400 1024 4
These 1000 bytes are the default
screen if you are in bank 0, the
default bank. 1024 is the top, left
cell of the screen and 2047 is the
bottom right cell. You can POKE these
locations and characters will appear
on the screen but for compatibility
with old, old C-64s, you should also
POKE the corresponding color map at
$D800. I do this by making C = 54272
then for every POKExxxx to the screen
I do a POKExxxx+C. You may also PEEK
these bytes to find out what's in a
cell. In general, PRINTing to the
screen is better than POKEing to the
screen.
---------------------------------
$07F8 2040 7
These eight bytes are the sprite
pointers. They tell the VIC chip
where the sprite definition data for
each sprite is found. Since each
sprite uses 64 bytes (technically,
63) there's room in bank 0 for 256
sprite definitions. Safe locations
are 11, 13-15, 32-63 (if BASIC has
been raised to at least page 64), and
128-255. See SPRITE SEMINAR on THE
COMPLEAT PROGRAMMER for details on
using sprites.
---------------------------------
$0800 2048 8
(POKE this with 0 if you get a
"syntax error" when using normal
immediate mode BASIC commands)
$0801 2049 8
This is the start of your BASIC
program text. If you want to have a
custom font and your program is
larger than 30 or so blocks, then a
good place to put the 2048 bytes of
font data is from $0800 to $1000. To
do this you must use a boot program
that does this: POKE44,16:CLR then
loads and runs your BASIC program
(which will then be at $1000.)
$1000 4096 16
These 4096 bytes are where the VIC
chip keeps an "image" of the font
data for bank 0. This means that you
can use this area for BASIC text or
ML routines but you CAN'T use it for
sprite or font data. Because of this,
$1000 is a great place for putting ML
routines or toolboxes. Just POKE44
with a page number right above where
your ML toolbox ends. If the toolbox
is 16 blocks long and starts at
$1000, then POKE44,32 in your boot
program and your BASIC program will
start above the toolbox at $2000.
$1800 6144 24
The rest of the bank 0 BASIC text
area. If you move the start of the
BASIC text to $4000 (with POKE44,64
in a boot program) then this area can
be used for sprite or font data. If
your program is less than 20 or so
blocks you can use this area for
sprites or fonts WITHOUT moving the
start of BASIC in a boot. Just lower
the top of BASIC with POKE56,page:CLR
at the beginning of your program.
POKE56,32 will allow you to use pages
32-64 ($2000-$4000) for sprite or
font data, while restricting your
BASIC program (and variables) to
pages 8-31.
$4000 16384 64
This is bank 1 and one fourth of
bank 2. It's for BASIC text and
variables (unless you change the
range of this area by POKEing 44 or
56 as described above). Unless you
change banks, you can't put sprite or
font data here. However, if you use a
ML memory copy routine (COPYMEM) you
can store lots of data here (after
POKEing 56) and copy it down into
bank 0 as needed.
--------------------------------
$9000 40960 160
This is where the C-64's BASIC ROM
is seen. Ordinarily you can't use
this area for anything but many ML
routines (especially toolboxes) allow
you to store any kind of data here.
This is the recommended place for
screen data because it doesn't take
away any BASIC text area and can't be
used for anything other than data. ML
routines generally won't work here.
--------------------------------
$C000 49152 192
The famous "C-thousand area". You
can put any kind of data or ML
routines here. Since it's the
location of so many ML routines, many
programmers don't use it for their
routines, saving it for routines that
other people wrote and MUST be here.
--------------------------------
$D000 53248 208
The Input/Output area, in one sense.
You can't put ML routines here if
there's going to be any normal disk
access. In another sense, this is
where the CPU sees the VIC chip, so
here is where all the sprite
registers are (from $D000 to $D02E).
The best way to handle sprites in
your program is to make V=53248 and
then POKEV+x where x is a number from
0 to 46. See PRG pages 321-323 for a
list of the registers. You POKE these
to change sprite colors, locations,
size, etc.
$D400 54272 212
This is the SID chip. You POKE these
to make sounds, although it's better
to let RACKETMEISTER or SFX GENERATOR
do the POKEing for you. There's only
28 registers but don't use the rest
of this area for anything by maybe
stored screens.
$D800 55296 216
The first 1000 bytes are the COLOR
RAM map. It corresponds with the 1000
bytes of the screen down at $0400.
You can POKE or PEEK these bytes but
you should AND the value with 15
since the upper nybble of each cell
is either not used, or used for
something else. For instance, use
PEEK(1024+C)AND15 to find the color
of the top, left cell (if C is
defined as 54272).
$DC00 56320 220
This is the CIA area. It has lots of
important registers you can POKE or
PEEK if you know what they do. The
PRG has a list on pages 328-334 but
MAPPING explains them all in detail.
-------------------------------
$E000 57344 224
This is the Kernal ROM, full of
handy routines that were designed to
be called from ML but can be called
from BASIC if you know how. The PRG
has a quick listing on pages 272-273
with more detailed explanations on
pages 274-306. MAPPING is packed with
details on using these canned
routines.
--------------------------------