CLOOP: MOVE.L (a2),(a1)+ ; Move a word CMPI.L #$FFFFFFFE,(a2)+ ; Check for last longword of Copper list BNE CLOOP ; Loop until entire copper list i9 moved ; ; Point Copper at Copper list ; MOVE.L #$20000,COP1LCH(a0) ; Write to Copper location register MOVE.W COPJMP1(a0),d0 ; Force copper to $20000 ; ; Start DMA ; MOVE.W #(DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),DMACON(a0) ; Enable bit-plane and Copper DMA BRA .... ; Go do next task ; ; This is the data for the Copper list. ; COPPERL:
DC.W BPL1PTH,$0002 ; Move $0002 to address $0E0 (BPL1PTH) DC.W BPL1PTL,$1000 ; Move $1000 to address $0E2 (BPL1PTL) DC.W $FFFF,$FFFE ; End of Copper list The second example sets up a high-resolution, interlaced display with one bitplane. This example also relies on the include file "hw_examples.i", which is found in Appendix J.
LEA CUSTOM,a0 ; Address of custom chips MOVE.W #$9204,BPLCON0(a0) ; Hires, one bit-plane, interlaced MOVE.W #0,BPLCON1(a0) ; Horizontal scroll value 0 MOVE.W #80,BPL1MOD(a0) ; Modulo = 80 for odd bit-planes MOVE.W #80,BPL2MOD(a0) ; Ditto for even bit-planes MOVE.W #$003C,DDFSTRT(a0) ; Set data-fetch start for hires MOVE.W #$00D4,DDFSTOP(a0) ; Set data-fetch stop MOVE.W #$2C81,DIWSTRT(a0) ; Set display window start MOVE.W #$F4C1,DIWSTOP(a0) ; Set display window stop ; ; Set up color registers ; MOVE.W #$000F,COLOR00(a0) ; Background color = blue MOVE.W #$0FFF,COLOR01(a0) ; Foreground color = white ;Set up bit-plane at S20000 LEA $20000,a1 ; Point a1 at bit-plane LEA CHARLIST(pc),a2 ; a2 points at character data MOVE.W #400,d1 ; Write 400 lines of data MOVE.W #20,d0 ; Write 20 long words per line L1:
MOVE.L (a2),(a1)+ ; Write a long word DBRA d0,L1 ; Decrement counter and loop until full MOVE.W #20,d0 ; Reset long word counter ADDQ.L #4,a2 ; Point at next word in char list CMPI.L #$FFFFFFFF,(a2) ; End of char list? BNE L2 LEA CHARLIST(pc),a2 ; Yes, reset a2 to beginning of list L2: DBRA d1,L1 ; Decrement line counter and loop until ; done ;