[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.