
; Blitter Example 2	A Simple Blit Into A Filled Screen

		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		BlitBob

; Wait for user to press the left mouse button

mouse		btst		#6,CIAAPRA
		bne.s		mouse

0; And exit.

		rts

;		***************************
;		*     Blit Graphic	  *
;		***************************

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

		move.l		#Bob,BLTAPTH(a5)	A address
		move.l		#Screen,BLTDPTH(a5)	D address
		move.w		#0,BLTAMOD(a5)		A modulo
		move.w		#36,BLTDMOD(a5)		D modulo
		move.w		#-1,BLTAFWM(a5)		A first mask
		move.w		#-1,BLTALWM(a5)		A last mask
		move.w		#$09f0,BLTCON0(a5)	Use A & D: D=A
		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		****  Use this for A68K  ****

;		Section		custom,data_C	**** Use this for Devpac ****

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,%10101010	40 bytes by 256 lines

Bob		dc.w		%1111111111111111,%1111111111111111	1
		dc.w		%1000000000000000,%0000000000000001
		dc.w		%0100000000000000,%0000000000000010	3
		dc.w		%0010000000000000,%0000000000000100
		dc.w		%0001000000000000,%0000000000001000	5
		dc.w		%0001000000000000,%0000000000001000
		dc.w		%0010000000000000,%0000000000000100	7
		dc.w		%0100000000000000,%0000000000000010
		dc.w		%1000000000000000,%0000000000000001	9
		dc.w		%1111111111111111,%1111111111111111

		end

		
