Commodore 128 Programmer's Reference Manual page 291

Hide thumbs Also See for 128:
Table of Contents

Advertisement

/
;
\
SPRITES
281
$OFFF (4095 Decimal)
]—Sprite 8
R
$0FC0
| I
]-Sprite7
$0F80
^
]—Sprite 6
j i
$0F40
i \
]—Sprites
$0F00
<-^
]—Sprite 4
!
$0EC0
[
]—Sprite 3
$0E80
P
]—Sprite 2
j !
$0E40
]—Sprite 1
_
$0£00
(3584 Decimal)
' '
Figure 9-3. Memory Address Ranges for Sprite Storage
i |
Keep in mind that sprites are referred to as 1 through 8 in BASIC, but 0 through 7
! •
in machine language.
q
SPRITE POINTERS
The VIC chip needs to know where to look for the bit patterns (data) that make up the
sprite image in memory. The sprite pointers are used explicitly for this purpose.
R
Unlike the Commodore 64, the C128 has automatically filled the sprite data
f 1
pointers with values that direct the VIC chip to point to the data stored in the sprite data
range 3584 ($0E00) through 4095 ($0FFF). These sprite data pointers are located at
r->
2040 ($07F8) through 2047 ($07FF) for sprites 0 and 7 respectively. They are also located
j I
in the address range 8184 ($1FF8) through 8191 ($1FFF), once the bit map screen is
cleared with the GRAPHIC 1,1 command. The default contents of these locations are:
r-s
Hexadecimal
38
39
3A
3B
3C
3D
3E
3F
| i
Decimal
56
57
58
59
60
61
62
63
To find the actual location where the sprite data pointers are looking for data in
^
memory, multiply the contents of the sprite data pointer by 64 (decimal). By multiplying
| j
these values, you'll see that the pointers look for data in the default sprite storage
• ; !
locations in Figure 9-3. See Figure 9-4 for an illustration.
The way the Commodore 128 automatically points to the correct sprite data is conven-
f""J
ient for programming, since it eliminates a step (provided the original values of the sprite
j I
pointers have not been modified). If you want to store sprite data somewhere else in
memory, however, you'll have to change the original value of the sprite pointer (from
location 2040 through 2047, or 6184 through 8191) to a value that is equal to:
1 (
Start of Sprite Data / 64 = new contents of sprite pointer

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents