.DESIGNING
THE
LF
CONTROL
BYTE
WITH
LOGIC
EQUATIONS
Because it can logically combine
data
bits from separate image sources during a
data
move, the blitter is very efficient
in
performing graphics drawing and animation opera-
tions.
For
example, you could design a rectangular object to combine on-screen with a
pre-existing graphic
Ima~e
(perhaps a car
that
you want to move
in
front of some
buildings).
Producing this effect requires predrawn images of both the car and the buildings.
To
animate the car
(that
is,
to move
it
in
front of the buildings), first save the background
image where the car will be placed. Next, copy the car
in
its first location. Then restore
the old background image and save a new section of the background from the second
location. Again, copy the car, this time to the second location. A continuous sequence
of save, draw, and restore creates the desired effect.
Assume source A is the car image outline (mask), source B is one of the car image's bit
planes, and source 0 is building
data
or background.
The
following operation saves the
background where the car
is
going to be placed (destination on the left, sources on the
right):
T=AO
This equation states
that
the background
(0)
should be saved (copied) to a temporary
destination (T) wherever the car outline mask
(A)
"and"
the background
(0)
exist
together.
Now
the car is placed
in
the background with the following operation:
This equation states
that
the destination is the same as the background source (0), and
background
(0)
should be replaced with car
data
(B)
wherever the car outline mask
(A)
is true,
but
(or) should stay background
(0)
wherever the mask is not true (A).
Now
the
background must be restored (to prepare for car placement in a different location) using
the following operation:
C=AT
This equation states
that
the background
(0)
should be replaced with the saved back-
ground (T) wherever the car outline mask exists (A
"and"
T).
172
Blitter Hardware