
"mask" that contains bits set wherever the car image is not transparent. This mask can be
visualized as the shadow of the car from a light source at the same position as the viewer.
NOTE
The mask for the car need only be a single bitplane regardless of the depth of the
background bitplane. This mask can be used in turn on each of the background bitplanes.
To animate the car, first save the background image where the car will be placed. Next
copy the car to its first location with another blit. Your image is now ready for display. To
create the next image, restore the old background, save the next portion of the
background where the car will be, and redraw the car, using three separate blits. (This
technique works best with beam-synchronized blits or double buffering.)
To temporarily save the background, copy a rectangle of the background (from the A
channel, for instance) to some backup buffer (using the D channel). In this case, the
function we would use is "A", the standard copy function. From Table 6-1, we note that
the corresponding LF code has a value of $F0.
To draw the car, we might use the A DMA channel to fetch the car mask, the B DMA
channel to fetch the actual car data, the C DMA channel to fetch the background, and the
D DMA channel to write out the new image.
NOTE
We must fetch the destination background before we write it, as only a portion of a
destination word might need to be modified, and there is no way to do a write to only a
portion of a word.
When blitting the car to the background we would want to use a function that, whenever
the car mask (fetched with DMA channel A) had a bit set, we would pass through the car
data from B, and whenever A did not have a bit set, we would pass through the original
background from C. The corresponding function, commonly referred to as the cookie-cut
function,
_
is AB+AC,
which works out to an LF code value of $CA.
To restore the background and prepare for the next frame, we would copy the information
saved in the first step back, with the standard copy function ($F0).
If you shift the data and the mask to a new location and repeat the above three steps
over and over, the car will appear to move across the background (the buildings).
NOTE
This may not be the most effective method of animation, depending on the application,
but the cookie-cut function will appear often.
Table 6-1 lists some of the most common functions and their values, for easy reference.
- 170 Blitter Hardware -
Содержание Amiga A1000
Страница 1: ...AMIGA HARDWARE REFERENCE MANUAL 1992 Commodore Business Machines Amiga 1200 PAL...
Страница 20: ...Figure 1 1 Block Diagram for the Amiga Computer Family Introduction 11...
Страница 21: ...12 Introduction...
Страница 72: ...Figure 3 12 A dual Playfield display Playfield Hardware 63...
Страница 87: ...Figure 3 24 Horizontal Scrolling 78 playfield hardware...
Страница 101: ...92 Playfield Hardware...
Страница 199: ...Figure 6 9 DMA time slot allocation 190 Blitter hardware...
Страница 203: ...Figure 6 13 Blitter Block Diagram 194 Blitter Hardware...
Страница 229: ...220 System Control Hardware...
Страница 246: ...Figure 8 8 Chinon Timing diagram cont Interface Hardware 237...
Страница 265: ...256 Interface Hardware...
Страница 289: ...280 Appendix A...
Страница 297: ...288 Appendix B...
Страница 298: ...APPENDIX C CUSTOM CHIP PIN ALLOCATION LIST NOTE Means an active low signal Appendix C 289...
Страница 302: ...APPENDIX D SYSTEM MEMORY MAP Appendix D 293...
Страница 343: ...334 Appendix F...
Страница 351: ...342 Appendix G...
Страница 361: ...352 Appendix H...
Страница 367: ...358 Appendix I...