Commodore 128 Programmer's Reference Manual page 296

Hide thumbs Also See for 128:
Table of Contents

Advertisement

286
COMMODORE 128
0 ($00)
24 ($18)
29 ($10)
f—
50 ($32)
208 ($00)-
250 (SFA)-
VISIBLE VIEWING AREA
NTSC*
40 COLUMNS
25 ROWS
344 ($158)
8 ($08)
-50 ($32)
,
229 ($E5)
250 ($FA)
488 ($1E8)
24 ($18)
I
I
I
I
I
I
I
I
320 ($140)
344 ($158)
'North American television transmission standards for your home TV.
Figure 9-8. Visible Sprite Coordinates
u
After seeing the sprite coordinate plane, you may have noticed something unusual.
The vertical coordinate positions have a range of 200. The horizontal coordinate
positions have a range of 320 coordinates. Since the C128 is an 8-bit computer, the
highest value any register can represent is 255.
How do you position a sprite past the 255th horizontal screen position? The
answer is, you have to borrow a bit from another register in order to represent a value
greater than 255.
An extra bit is already set aside in the Commodore 128 memory in case you want
to move a sprite past the 255th horizontal coordinate. Location 53264 controls sprite
movement past position 255. Each of the 8 bits in 53264 controls a sprite. Bit 0 controls
sprite 0, bit 1 controls sprite 1 and so on. For example, if bit 7 is set, sprite 7 can move
past the 255th horizontal position.
Each time you want a sprite to move across the entire screen, turn on the borrowed
bit in location 53264 when the sprite reaches horizontal position 255. Once the sprite
moves off the right edge of the screen, turn off the borrowed bit_so the sprite can move
back onto the left edge of the screen. The following commands allow sprite seven to
move past the 255th horizontal position:
u

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents