
EXAMPLE: RotateBits
;
; here we rotate bits. This code takes a single raster row of a
; bitplane, and 'rotates' it into an array of 16-bit words, setting
; the specified bit of each word in the array according to the
; corresponding bit in the raster row. We use the line mode in
; conjunction with patterns to do this magic.
;
; Input: d0 contains the number of words in the raster row. d1
; contains the number of the bit to set (0..15). a0 contains a
; pointer to the raster data, and al contains a pointer to the
; array we are filling; the array must be at least (d0)*16 words
; (or (d0)*32 bytes) long.
;
include 'exec/types.i'
include 'hardware/custom.i'
include 'hardware/blit.i'
include 'hardware/dmabits.i'
include 'hardware/hw_examples.i'
xref _custom
;
xdef rotatebits
;
; Our entry point.
;
rotatebits:
lea custom,a2 ; We need to access the custom registers
tst d0 ; if no words, just return
beq gone
lea DMACONR(a2),a3 ; get the address of dmaconr
moveq.l #DMAB BLTDONE-8,d2 ; get the bit number BLTDONE
btst d2,(a3) ; check to see if we're done
waitl:
tst d2,(a3) ; check again.
bne wait1 ; not done? Keep waiting
moveq.l #-30,d3 ; Line mode: aptr = 4Y-2X, Y=0; X15
move.l d3,BLTAPT(a2)
move.w #-60,BLTAMOD(a2) ; amod = 4Y-4X
clr.w BLTBMOD(a2) ; bmod = 4Y
move.w #2,BLTCMOD(a2) ; cmod = width of bitmap (2)
move.w #2,BLTDMOD(a2) ; ditto
ror.w #4,d1 ; grab the four bits of the bit number
and.w #$f000,d1 ; mask them out
or.w #$bca,d1 ; USEA, USEC, USED, F=AB+-AC
move.w d1,BLTCON0(a2) ; stuff it
move.w #$f049,BLTCONl(a2) ; BSH=15, SGN, LINE
move.w #$8000,BLTADAT(a2) ; Initialize A dat for line
move.w #$ffffBLTAFWM(a2) ; Initialize masks
move.w #$ffff,BLTALWM(a2)
move.l a1,BLTCPT(a2) ; Initialize pointer
move.l a1,BLTDPT(a2)
lea BLTBDAT(a2),a4 ; For quick access, we grab these two
lea BLTSIZE(a2),a5 ; addresses
move.w #$402,d1 ; Stuff bltsize; width-2, height 16
move.w (a0)+,d3 ; Get next word
- Blitter Hardware 199 -
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...