EasyManua.ls Logo

Commodore Amiga A2000 - Page 132

Commodore Amiga A2000
380 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
o Writing to the sprite A data register enables the horizontal comparator. This enables
output to the screen when the horizontal position of the video beam equals the horizontal
value in the position register.
o If the comparator is enabled, the sprite data will be sent to the display, with the
leftmost pixel of the sprite data placed at the position defined in the horizontal part of
SPRxPOS.
o As long as the comparator remains enabled, the current contents of the sprite data
register will be output at the selected horizontal position on a video line.
o The data in the sprite data registers does not change. It is either rewritten by the user
or modified under DMA control.
The components described above produce the automatic DMA display as follows: When
the sprites are in DMA mode, the 18-bit sprite pointer register (composed of SPRxPTH and
SPRxPTL) is used to read the first two words from the sprite data structure. These words
contain the starting and stopping position of the sprite. Next, the pointers write these
words into SPRxPOS and SPRxCTL. After this write, the value in the pointers points to the
address of the first data word (low word of data for line 1 of the sprite.)
Writing into the SPRxCTL register disabled the sprite. Now the sprite DMA channel will
wait until the vertical beam counter value is the same as the data in the VSTART (Y value)
part of SPRxPOS. When these values match, the system enables the sprite data access.
The sprite DMA channel examines the contents of VSTOP (from SPRxCTL, which is the
location of the line after the last line of the sprite) and VSTART (from SPRxPOS) to see
how many lines of sprite data are to be fetched. Two words are fetched per line of sprite
height, and these words are written into the sprite data registers. The first word is stored
in SPRxDATA and the second word in SPRxDATB.
The fetch and store for each horizontal scan line occurs during a horizontal blanking
interval, far to the left of the start of the screen display. This arms the sprite horizontal
comparators and allows them to start the output of the sprite data to the screen when the
horizontal beam count value matches the value stored in the HSTART (X value) part of
SPRxPOS.
If the count of VSTOP - VSTART equals zero, no sprite output occurs. The next data word
pair will be fetched, but it will not be stored into the sprite data registers. It will instead
become the next pair of data words for SPRxPOS and SPRxCTL.
When a sprite is used only once within a single display field, the final pair of data words,
which follow the sprite color descriptor words, is loaded automatically as the next contents
of the SPRxPOS and SPRxCTL registers. To stop the sprite after that first data set, the pair
of words should contain all zeros.
Thus, if you have formed a sprite pattern in memory, this same pattern will be produced
as pixels automatically under DMA control one line at a time.
- Sprite Hardware 123 -

Table of Contents

Other manuals for Commodore Amiga A2000

Related product manuals