1111
11
11
11
11
11
11
11
1111
Figure
6-5:
Blitter Masking Example
In a similar way, the blitter's last-word mask (BLTALWM) masks the rightmost word of
the source A data. Thus,
it
is
possible to extract rectangular
data
from a source whose
right and left edges are between word boundaries.
If the window is only one word wide (as illustrated above), the first and last word masks
will overlap, and source-A bits will
be
passed only where both masks are true. This
example assumed the last word mask was loaded with all
Is
($FFFF) as all masks should
be when they are not needed.
Zero
Detection
A blitter zero
flag
is
provided
that
can be tested to determine if the logic operation
selected has resulted in a null (empty
= all zeros) logic operation result.
The
zero
flag
(BZERO)
in
bit
13
of DMACONR will stay true
if
the result
is
all zeros.
This feature
is
usually used to assist collision detection by "and"ing two images together
to test for overlap. The operation D
=
AB
is
performed
(D
can actually be disabled),
and
if
images A and B do not overlap, the zero
flag
will stay true.
When the purpose of a blit
is
only to do zero detection and not to generate a D destina-
tion image, the USED bit (bit 8 of BLTCONO) can be turned
off
to save time and bus
cycles.
Blitter Hardware
179