
; Blitter Example 10	Clearing Blocks of Memory

		include		hardware.i
		include		HW_Macros.i
		include		HW_Start.i

; First, 'poke' address of bit plane into Copper list

Main		move.l		#Screen,d0		d0=addr of bitplane
		lea		CopPlanes,a0		a0->into Copper list

		move.w		d0,6(a0)		low word of address
		swap		d0
		move.w		d0,2(a0)		high word of address

; Enable bitplane, Copper and Blitter DMA.

		move.w		#SETIT!DMAEN!COPEN!BPLEN!BLTEN,DMACON(a5)

; Now strobe the Copper list.

		move.l		#MyCopper,COP1LCH(a5)	address of list
		move.w		#0,COPJMP1(a5)		strobe Copper

; Call subroutine to blit the graphic to the screen

		bsr		BlitClear

; Wait for user to press the left mouse button

mouse		btst		#6,CIAAPRA
		bne.s		mouse

0; And exit.

		rts

;		***************************
;		*  Clear Block of Memory  *
;		***************************

; To clear a block of memory, use only D channel with no minterm and no
;special modes!

BlitClear	btst		#14,DMACONR(a5)		wait for Blitter
		bne.s		BlitClear

		move.l		#Screen,BLTDPTH(a5)	D address
		move.w		#36,BLTDMOD(a5)		D modulo
		move.w		#$0100,BLTCON0(a5)	Use D: No Minterm 
		move.w		#0,BLTCON1(a5)		no special modes
		move.w		#10<<6!2,BLTSIZE(a5)	2 words by 10 lines

		rts

;		***************************
;		*     CHIP Memory Data    *
;		***************************

;section		data custom,chip
		section		me,DATA_C

MyCopper	CMOVE		DIWSTRT,$2c81		PAL -- 256 lines
		CMOVE		DIWSTOP,$2cc1
		CMOVE		DDFSTRT,$0038		LoRes
		CMOVE		DDFSTOP,$00d0
		CMOVE		BPL1MOD,$0000		No modulos
		CMOVE		BPL2MOD,$0000
		CMOVE		BPLCON0,$1200		1 bitplane & colour
		CMOVE		BPLCON1,$0000		No scrolling
		CMOVE		BPLCON2,$0000		Ignore priority

CopPlanes	CMOVE		BPL1PTH,0		Bit plane pointer
		CMOVE		BPL1PTL,0

		CMOVE		COLOR00,$0000		black background
		CMOVE		COLOR01,$0fff		white foreground

		CEND					end of list

Screen		dcb.b		40*256,$ff	40 bytes wide by 256 lines


		end

		
