
; Display Example 2. -- Low Resolution Display --

; Drawing in a bit plane.

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

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

Main		move.l		#bitplane,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 and Copper DMA.

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

; Now strobe the Copper list.

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

; Draw the first 'A' into the bit plane.

		lea		bitplane,a0		a0->bitplane
		lea		letter_a,a1		a1->character data

		move.b		(a1)+,(a0)
		move.b		(a1)+,40(a0)		40 bytes/line
		move.b		(a1)+,80(a0)
		move.b		(a1)+,120(a0)
		move.b		(a1)+,160(a0)

; Draw the first 'C' into the bit plane.

		addq.l		#1,a0			a0->into bitplane
		lea		letter_c,a1		a1->character data

		move.b		(a1)+,(a0)
		move.b		(a1)+,40(a0)		40 bytes/line
		move.b		(a1)+,80(a0)
		move.b		(a1)+,120(a0)
		move.b		(a1)+,160(a0)

; Draw the second 'C' into the bit plane.

		addq.l		#1,a0			a0->into bitplane
		lea		letter_c,a1		a1->character data

		move.b		(a1)+,(a0)
		move.b		(a1)+,40(a0)		40 bytes/line
		move.b		(a1)+,80(a0)
		move.b		(a1)+,120(a0)
		move.b		(a1)+,160(a0)

; Wait for user to press the left mouse button

mouse		btst		#6,CIAAPRA
		bne.s		mouse

; And exit.

		rts

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

section		data custom,chip

; The copper list used by the program to define the display

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

; Graphics data for two characters that will be displayed.

letter_a	dc.b		%00011000
		dc.b		%00100100
		dc.b		%00111100
		dc.b		%00100100
		dc.b		%00100100

letter_c	dc.b		%00011100
		dc.b		%00100000
		dc.b		%00100000
		dc.b		%00100000
		dc.b		%00011100

; Bit plane memory

bitplane	ds.b		40*256		40 bytes wide by 256 lines


		end

		
