Displaying A Sprite - Commodore Amiga A1000 Hardware Reference Manual

Table of Contents

Advertisement

hardware in the same manner as the original words that were first loaded into the control
registers. If the VSTART value contained in these words is lower than the current beam
position, this sprite will not be reused in this display field. For consistency, the value 0
should be used for both words when ending the usage of a sprite. Sprite reuse is
discussed later.
The following data structure is for the spaceship sprite. It will be located at V = 65 and H
= 128 on the normally visible part of the screen.
SPRITE:
DC.W
$6D60, $7200
DC.W
$0990, $07E0
DC.W
$13C8, $0FF0
DC.W
$23C4, $1FF8
DC.W
$13C8, $0FF0
DC.W
$0990, $07E0
DC.W
$0000, $0000

DISPLAYING A SPRITE

After building the data structure, you need to tell the system to display it. This section
describes the display of sprites in "automatic" mode. In this mode, once the sprite DMA
channel begins to retrieve and display the data, the display continues until the VSTOP
position is reached. Manual mode is described later on in this chapter.
The following steps are used in displaying the sprite:
1. Decide which of the eight sprite DMA channels to use (making certain that the chosen
channel is available).
2. Set the sprite pointers to tell the system where to find the sprite data.
3. Turn on sprite direct memory access if it is not already on.
4. For each subsequent display field, during the vertical blanking interval, rewrite the
sprite pointers.
CAUTION
If sprite DMA is turned off while a sprite is being displayed (that is, after VSTART but
before VSTOP), the system will continue to display the line of sprite data that was most
recently fetched. This causes a vertical bar to appear on the screen. It is recommended
that sprite DMA be turned off only during vertical blanking or during some portion of the
display where you are sure that no sprite is being displayed.
;VSTART, HSTART, VSTOP
;First pair of descriptor words
;End of sprite data
- 106 Sprite hardware -

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Amiga a500Amiga a2000

Table of Contents