Commodore 128 Programmer's Reference Manual page 291

Hide thumbs Also See for 128:
Table of Contents

Advertisement

$0FFF
(4095 Decimal)
]— Sprite
$
FC
0
0
]— Sprite 7
$0F80
]— Sprite
$0F40
]— Sprite 5
$0F00
]— Sprite 4
$0EC0
]— Sprite 3
$0E80
]— Sprite
$0E40
]— Sprite
$0E00
(3584 Decimal)
Figure 9 -3 . M em o ry Address Ranges fo r Sprite Storage
Keep in mind that sprites are referred to as 1 through 8 in BASIC, but 0 through 7
in machine language.
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.
Unlike the Commodore 64, the C128 has automatically filled the sprite data
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
2040 ($07F8) through 2047 ($07FF) for sprites 0 and 7 respectively. They are also located
in the address range 8184 ($1FF8) through 8191
cleared with the GRAPHIC 1,1 command. The default contents of these locations are:
Hexadecimal
38
Decimal
56
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
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­
ient for programming, since it eliminates a step (provided the original values of the sprite
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:
Start of Sprite Data / 64 = new contents of sprite pointer
8
6
2
1
39
3A 3B 3C
57
58
59
60
($1FFF), once the bit map screen
3D 3E 3F
61 62 63
SPRITES
281
is

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents