Commodore Amiga 1000 — Commodore Amiga 1000 Hardware Reference Manual PDF Download

SELECTING A DMA CHANNEL AND SETTING THE POINTERS In deciding which DMA channel to use, you should take into consideration the colors assigned to the sprite and the sprite's video priority. The sprite DMA channel uses two pointers to read in sprite data and control words. During the vertical blanking interval before the first display of the sprite, you need to write the sprite's memory address into these pointers. The pointers for each sprite are called SPRxPTH and SPRxPTL, where "x" is the number of the sprite DMA channel. SPRxPTH contains the high three bits of the memory address of the first word in ,the sprite and SPRxPTL contains the low sixteen bits.

The least significant bit of SPRxPTL is ignored, as sprite data must be word aligned. Thus, only fifteen bits of SPRxPTL are used. As usual, you can write a long word into SPRxPTH. In the following example the processor initializes the data pointers for sprite 0. Normally, this is done by the Copper. The sprite is at address $20000. MOVE.L #$20000,SPR0PTH+CUSTOM ;Write S20000 to sprite 0 pointer... These pointers are dynamic; they are incremented by the sprite DMA channel to point first to the control words, then to the data words, and finally to the end-of-data words.

After reading in the sprite control information and storing it in other registers, they proceed to read in the color descriptor words. The color descriptor words are stored in sprite data registers, which are used by the sprite DMA channel to display the data on screen. For more information about how the sprite DMA channels handle the display, see the "Hardware Details" section below. RESETTING THE ADDRESS POINTERS For one single display field, the system will automatically read the data structure and produce the sprite on-screen in the colors that are specified in the sprite's color registers.

If you want the sprite to be displayed in subsequent display fields, you must rewrite the contents of the sprite pointers during each vertical blanking interval. This is necessary because during the display field, the pointers are incremented to point to the data which is being fetched as the screen display progresses. The rewrite becomes part of the vertical blanking routine, which can be handled by instructions in the Copper lists. - Sprite Hardware 107 -