The following example displays the spaceship sprite and then redisplays it as a different object. Only the sprite data list is affected, so only the data list is shown here. However, the sprite looks best with the color registers set as shown in the xample. LEA CUSTOM,a0 MOVE.W #$0F00,COLOR17(a0) ; Color 17 red MOVE.W #$0FF0,COLOR18(a0) ; Color 18 yellow MOVE.W #$0FFF,COLORl9(a0) ; Color 19 white 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 $8080,$8D00 ; VSTART, HSTART, VSTOP for new sprite DC.W $1818,$0000 DC.W $7E7E,$0000 DC.W $7FFE,$0000 DC.W $FFFF,$2000 DC.W $FFFF,$2000 DC.W $FFFF,$3000 DC.W $FFFF,$3000 DC.W $7FFE,$1800 DC.W $7FFE,$0C00 DC.W $3FFC,$0000 DC.W $0FF0,$0000 DC.W $03C0,$0000 DC.W $0180,$я0000 DC.W $0000,$0000 ; End of sprite data OVERLAPPED SPRITES For more complex or larger moving objects, you can overlap sprites. Overlapping simply mean that the sprites have the same or relatively close screen positions. A relatively close screen position can result in an object that is wider than 16 pixels.
The built-in sprite video priority ensures that one sprite appears to be behind the other when sprites are overlapped. The priority circuitry gives the lowest-numbered sprite the highest priority and the highest numbered sprite the lowest priority. Therefore, when designing displays with overlapped sprites, make sure the "foreground" sprite has a lower number than the "background" sprite. In Figure 4-11, for example, the cage should be generated by a lower-numbered sprite DMA channel than the monkey. - Sprite Hardware 115 -