The C and D pointer registers should be initialized to the word containing the first pixel of
the line; the C and D modulo registers should be set to the width of the bitplane in bytes.
The SRCA, SRCC, and DEST bits of BLTCON0 should be set to one, and the SRCB flag
should be set to zero. The OVFLAG should be cleared. If only a single bit per horizontal
row is desired, the ONEDOT bit of BLTCON1 should be set; otherwise it should be cleared.
The logic function remains. The C DMA channel represents the original source, the A
channel the bit to set in the line, and the B channel the pattern to draw. Thus, to draw a
line, the function AB+AC is the most common. To draw the line using exclusive-or mode,
so it can be easily erased by drawing it again, the function ABC+AC can be used.
We set the blit height to the length of the line, which is dx + 1. The width must be set to
two for all line drawing. (Of course, the BLTSIZE register should not be written until the
very end, when all other registers have been filled.)
REGISTER SUMMARY FOR LINE MODE
Preliminary setup:
The line goes from (x1 ,y1) to (x2,y2).
dx = max (abs (x2 - x1), abs (y2 - y1) )
dy = min (abs (x2 - x1), abs (y2 - y1) )
Register setup:
BLTADAT = $8000
BLTBDAT = line texture pattern ($FFFF for a solid line)
BLTAFWM = $FFFF
BLTALWM = $FFFF
BLTAMOD = 4 * (dy-dx)
BLTBMOD = 4 * dy
BLTCMOD = width of the bitplane in bytes
BLTDMOD = width of the bitplane in bytes
BLTAPT = (4 * dy) - (2 * dx)
BLTBPT = unused
BLTCPT = word containing the first pixel of the line
BLTDPT = word containing the first pixel of the line
- 186 Blitter Hardware -