Commodore 64 User Manual page 83

Hide thumbs Also See for 64:
Table of Contents

Advertisement

In line 11,
POKE V+21,4
makes sprite 2 appear by placing a 4 in what is called the sprite enable
register (21) to turn on sprite 2. Think of it like this:
SPRITES
21
128
64
32
16
7
0
6
0
5
0
4
0
3
0
Decimal values of each
sprite number
2
1
2
1
1
0
0
0
Sprite Level Number
=4
Put a I For The SPRITE You Want
Each sprite level is represented in section 21 of the sprite memory and
4 happens to be sprite level 2. If you were using level 3 you would put a
1 in sprite 3 which has a value of 8. In fact if you used both sprites 2
and 3 you would put a 1 in both 4 and 8. You would then add the
numbers together just like you did with the DATA on your graph paper.
So, turning on sprites 2 and 3 would be represented as V+21,12.
In line 12;
POKE 2042,13
instructs the computer to get the data for sprite 2 (location 2042) from
the 13th area of memory. You know from making your sprite that it
takes up 63 sections of memory. You may not have realized it, but those
numbers you put across the top of your grid equal what is known as 3
bytes of the computer. In other words each collection of the following
numbers, 128,64,32,16,8,4,2,1 equals 1 byte of computer memory.
Therefore with the 21 rows of your grid times the 3 bytes of each row,
each sprite takes up 63 bytes of memory . I WHOLE SPRITE
20 FOR N = 0 to 62 : READ Q: POKE 832+N , Q: NEXT
This line handles the actual sprite creation. The 63 bytes of data that
represent the sprite you created are READ in through the loop and
POKEd into the 13th block of memory. This starts at location 832.
30 FOR X = 0 TO 200
40 POKE V+41
50 POKE V+S,X
If you remember from school the X coordinate represents an objects
horizontal movement across the screen and the Y coordinate represents
the sprite ' s vertical movement across the screen. Therefore as the values
73

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents