|
|
GenBlit
General guidelines on using blitter at hardware level:
When programming the blitter at the hardware level
with multitasking turned on, you must be sure to
grab the blitter for your own exclusive use so other
programs don't try to use it. Using the library
function call OwnBlitter() you can reserve the
blitter for your own personal use. The function
call DisownBlitter() frees the blitter so other
programs can use it.
Before writing to any of the blitter registers, you
must be sure the blitter isn't currently in
operation, even after a call to OwnBlitter(). To
ensure the blitter's dormancy, you can use the
function call WaitBlit(), or you can read the status
of the BBUSY bit found in the DMACONR register at
$dff002.
Under normal operation conditions, the Amiga's
microprocessor has priority over the blitter when it
comes to accessing chip RAM. Because of the way
memory cycles are allocated, memory conflicts rarely
occur between the blitter and the 68000. However,
if time is a critical factor, you can give the
blitter a higher priority than the 68000 by setting
the BLTPRI bit in the DMACON register ($dff096).
The blitter can perform so many special operations
on a word of data that it's important to know the
order in which these operations take place. Masking
via the BLTAFWM and BLTALWM register takes effect
first (assuming the data was obtained from A and is
either the first or last word of a horizontal
line.); next the data is shifter, if a shift was
specified my the source's shift bits (ASHx or BSHx);
the miniterm operations are performed next; and
finally, the data is filled according to the status
of BLTCON1's EFE, IFE, and FCI bits. Only after all
this does the data reach its destination.
As a general rule, you should always write zeroes to
any unused bits in a blitter register. On future
versions of the Amiga blitter, these bits may be
used to perform new functions - functions that could
freak your program if mistakingly activated!
|