
Table 6-3: BLTCON1 Code Bits for Octant Line Drawing
BLTCON1 Code Bits Octant #
0 1 1 2
1 1 1 3
1 0 1 4
0 1 0 5
0 0 0 6
1 0 0 7
We initialize BLTCON1 bits 4 through 2 according to the above Table. Now, we introduce
the variables dx and dy, and set them to the absolute values of the difference between
the x coordinates and the y coordinates of the endpoints of the line, respectively.
dx = abs (x2 - x1)
dy = abs (y2 - y1)
Now, we rearrange them if necessary so dx is greater than dy.
if (dx < dy)
{
temp = dx;
dx = dy;
dy = temp;
}
Alternately, set dx and dy as follows:
dx = max(abs(x2 - x1), abs(y2 - y1)) ;
dy = min(abs(x2 - x1), abs(y2 - y1)) ;
These calculations have the effect of "normalizing" our line into octant 0; since we have
already informed the blitter of the real octant to use, it has no difficulty drawing the line.
We initialize the A pointer register to 4 * dy - 2 * dx. If this value is negative, we set the
sign bit (SIGNFLAG in BLTCONl), otherwise we clear it.
We set the A modulo register to 4 * (dy - dx) and the B modulo register to 4 * dy.
The A data register should be preloaded with $8000. Both word masks should be set to $
The A shift value should be set to the x coordinate of the first point (x1) modulo 15.
The B data register should be initialized with the line texture pattern, if any, or $FFFF for a
solid line. The B shift value should be set to the bit number at which to start the line
texture (zero means the last significant bit.)
- Blitter Hardware 185 -
Summary of Contents for Amiga A1000
Page 1: ...AMIGA HARDWARE REFERENCE MANUAL 1992 Commodore Business Machines Amiga 1200 PAL...
Page 20: ...Figure 1 1 Block Diagram for the Amiga Computer Family Introduction 11...
Page 21: ...12 Introduction...
Page 72: ...Figure 3 12 A dual Playfield display Playfield Hardware 63...
Page 87: ...Figure 3 24 Horizontal Scrolling 78 playfield hardware...
Page 101: ...92 Playfield Hardware...
Page 199: ...Figure 6 9 DMA time slot allocation 190 Blitter hardware...
Page 203: ...Figure 6 13 Blitter Block Diagram 194 Blitter Hardware...
Page 229: ...220 System Control Hardware...
Page 246: ...Figure 8 8 Chinon Timing diagram cont Interface Hardware 237...
Page 265: ...256 Interface Hardware...
Page 289: ...280 Appendix A...
Page 297: ...288 Appendix B...
Page 298: ...APPENDIX C CUSTOM CHIP PIN ALLOCATION LIST NOTE Means an active low signal Appendix C 289...
Page 302: ...APPENDIX D SYSTEM MEMORY MAP Appendix D 293...
Page 343: ...334 Appendix F...
Page 351: ...342 Appendix G...
Page 361: ...352 Appendix H...
Page 367: ...358 Appendix I...