Figure 4-13 shows the following:
o Writing
to
the sprite control registers
disables
the horizontal comparator circuitry.
This prevents the system from sending any
output
from the
data
registers to the
serial converter or to the screen.
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.
Sprite Hardware
123