
EXAMPLE: SimpleLine
;
; This example uses the line draw mode of the blitter
; to draw a line. The line is drawn with no pattern
; and a simple 'or' blit into a single bitplane.
;
; Input: d0=x1 dl=y1 d2=x2 d3=y2 d4=width a0=aptr
;
include 'exec/types.i'
include 'hardware/custom.i'
include 'hardware/blit.i'
include 'hardware/dmabits.i'
include 'hardware/hw_examples.i'
;
xref _custom
;
xdef simpleline
;
; Our entry point.
;
simpleline:
lea custom,a1 ; snarf up the custom address register
sub.w d0,d2 ; calculate dx
bmi xneg ; if negative, octant is one of [3,4,5,6]
sub.w d1,d3 ; calculate dy octant is one of [1,2,7,8]
bmi yneg ; if negative, octant is one of [7,8]
cmp.w d3,d2 ; cmp |dx|,|dy|octant is one of [1,2]
bmi ygtx ; if y>x, octant is 2
moveq.l #LINEMODE,d5 ; otherwise octant is 1
bra lineagain ; go to the common section
ygtx:
exg d2,d3 ; X must be greater than Y
moveq.l #LINEMODE,d5 ; we are in octant 2
bra lineagain ; and common again.
yneg:
neg.w d3 ; calculate abs(dy)
cmp.w d3,d2 ; cmp |dx|,|dy|, octant is [7,8]
bmi ynygtx ; if y>x, octant is 7
moveq.l #LINEMODE,d5 ; otherwise octant is 8
bra lineagain
ynygtx:
exg d2,d3 ; X must be greater than Y
moveq.l #LINEMODE,d5 ; we are in octant 7
bra lineagain
xneg:
neg.w d2 ; dx was negative! octant is [3,4,5,6]
sub.w d1,d3 ; we calculate dy
bmi xyneg ; if negative, octant is one of [5,6]
cmp.w d3,d2 ; otherwise it's one of [3,4]
bmi xnygtx ; if y>x, octant is 3
moveq.l #LINEMODE,d5 ; otherwise it's 4
bra lineagain
xnygtx:
exg d2,d3 ; X must be greater than Y
moveq.l #LINEMODE,d5 ; we are in octant 3
bra lineagain
- Blitter Hardware 197 -
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...