[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

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

   bltcon0  bits 15-12 = x1 modulo 15
   bltcon0  bits srca, srcc, and srcd = 1
   bltcon0  bit  srcb = 0
            If exclusive-or line mode:                  _   _
                     then BLTCON0  lf control byte  = abc + ac
                                                           _
                     else BLTCON0  lf control byte  = ab + ac

   bltcon1  bit  linemode  = 1
   bltcon1  bit  ovflag  = 0
   bltcon1  bits 4-2 =  octant number  from table
   bltcon1  bits 15-12 = start bit for line texture (0 = last significant
            If (((4 * dy) - (2 * dx)) < 0):                bit)
                     then  bltcon1  bit  signflag  = 1
                     else  bltcon1  bit  signflag  = 0
            If one pixel/row:
                     then  bltcon1  bit  onedot  = 1
                     else  bltcon1  bit  onedot  = 0

   bltsize  bits 15-6 = dx + 1
   bltsize  bits  5-0 = 2

   Warning:
   --------
   You must set the  bltsize  register last as it starts the blit.