Commodore 64 User Manual page 79

Hide thumbs Also See for 64:
Table of Contents

Advertisement

In addition to accessing many of the picture making locations we will
also be using some of the Commodore 64's main memory to store infor-
mation (data) that defines the sprites. Finally, eight memory locations
directly after the screen memory will be used to tell the computer exactly
which memory area each sprite will get its data from.
As we go through some examples, the process will be very
straightforward, and you'll get the hang of it.
So let's get on with creating some sprite graphics. A sprite object is 24
dots wide by 21 dots long. Up to eight sprites can be controlled at a
time. Sprites are displayed in a special independent 320 dot wide by
200 dot high area. However, you can use your sprite with any mode,
high-resolution, low-resolution, text etc.
Say you want to create a balloon and have it float around the sky.
The balloon could be designed as in the 24 by 21 grid on page 70.
The next step is to convert the graphic design into data the computer
can use. Get a piece of notebook or graph paper and set up a sample
grid that is 21 spaces down and 24 spaces across. Across the top write
128,64,32,16,8,4,2,1, three times (as shown) for each of the 24
squares. Number down the left side of the grid 1-21 for each row. Write
the word DATA at the end of each row. Now fill in the grid with any
design or use the balloon that we have. It's easiest to outline the shape
first and then go back and fill in the grid.
Now if you think of all the squares you filled in as "on" then substitute
a 1 for each filled square. For the one's that aren't filled in, they're "off"
so put a zero.
Starting on the first row, you need to convert the dots into three sepa-
rate pieces of data the computer can read. Each set of 8 squares is
equal to one piece of data called a byte in our balloon. Working from
the left, the first 8 squares are blank, or 0, so the value for that series of
numbers is 0.
The middle series looks like this (again a 1 indicates a dot, 0 is a
space):
128
64
32
16
8
4
2
1
0
1
1
1
1
1
1
1
T T T T T T T T
0 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 127
The third series on the first row also contains blanks, so it, too, equals
zero. Thus, the data for the first line is:
DATA 0, 127, 0
69

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore 64

Table of Contents