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 posi-
tion 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.
Sprite
Hardware
Details
Sprites are produced by the circuitry shown
in
figure 4-13. This figure shows
in
block
form how a pair of
data
words becomes a set of pixels displayed on the screen.
The
circuitry elements for sprite display are explained below.
o Sprite
data
registers.
The
registers SPRxDATA and SPRxDATB hold the bit pat-
terns
that
describe one horizontal line of a sprite for each of the eight sprites. A line
is
16
pixels wide, and each line is defined by two words to provide selection of three
colors and transparent.
o Parallel-to-serial converters. Each of the
16
bits of the sprite
data
bit pattern
is
individually sent to the color select circuitry
at
the time
that
the pixel associated
with
that
bit
is
being displayed on-screen.
Immediately after the
data
is transferred from the sprite
data
registers, each
parallel-to-serial converter begins shifting the bits
out
of the converter, most
significant (leftmost) bit first. The shift occurs once during each low-resolution pixel
time and continues until all
16
bits have been transferred to the display circuitry.
The
shifting and
data
output
does not begin again until the next time this converter
is loaded from the
data
registers.
Because the video image
is
produced by an electron beam
that
is
being swept from
left
to
right on the screen, the bit-image of the
data
corresponds exactly to the
image
that
actually appears on the screen (most significant
data
on the left).
o Sprite serial video data. Sprite
data
goes to the priority circuit to establish the
priority between sprites and playfields.
120 Sprite Hardware