The following data structure is for the six-color spaceship made with two attached sprites.
SPRITE0:
DC.W $6D60,$7200 ;VSTART = 65, HSTART = 128
DC.W $0C30,$0000 ;First color descriptor word
DC.W $1818,$0420
DC.W $342C,$0E70
DC.W $1818,$0420
DC.W $0C30,$0000
DC.W $0000,$0000 ;End of sprite 0
SPRITE1:
DC.W $6D60,$7280 ;Same as sprite 0 except attach bit on
DC.W $07E0,$0000 ;First descriptor word for sprite 1
DC.W $0FF0,$0000
DC.W $1FF8,$0000
DC.W $0FF0,$0000
DC.W $07E0,$0000
DC.W $0000,$0000 ;End of sprite 1
MANUAL MODE
It is almost always best to load sprites using the automatic DMA channels. Sometimes,
however, it is useful to load these registers directly from one of the microprocessors.
Sprites may be activated "manually" whenever they are not being used by a DMA channel.
The same sprite that is showing a DMA-controlled icon near the top of the screen can also
be reloaded manually to show a vertical colored bar near the bottom of the screen. Sprites
can be activated manually even when the sprite DMA is turned off.
You display sprites manually by writing to the sprite data registers SPRxDATB and
SPRxDATA, in that order. You write to SPRxDATA last because that address "arms'' the
sprite to be output at the next horizontal comparison. The data written will then be
displayed on every line, at the horizontal position given in the "H" portion of the position
registers SPRxPOS and SPRxCTL. If the data is unchanged, the result will be a vertical
bar. If the data is reloaded for every line, a complex sprite can be produced.
The sprite can be terminated ("disarmed") by writing to the SPRxCTL register. If you write
to the SPRxPOS register, you can manually move the sprite horizontally at any time, even
during normal sprite usage.
- 120 Sprite Hardware -