
; Display Example 15. -- Dual Playfield Example -- 

; Display is     320x256   ( 40x256x6 bytes ) in dual playfield mode.
; Playfield 1 is 320x512x3 ( 40x512x3 bytes )
; Playfield 2 is 640x256x3 ( 80x256x3 bytes )

; Bitplane Modulos = bit plane width - Display width - 2 = 80-40-2 = 38 bytes

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

; First, 'poke' address of playfield 1's bit planes into Copper list.

Main		COPBPLC		CopPlanes,pf1,(320/8)*512,3

; Now 'poke' address of playfield 2's bit planes into Copper list.

		COPBPL		CopPlanes2,pf2,(640/8)*256,3
		
; Set colours for second playfield manually

		lea		pf2+80*256*3,a0		a0->colour data
		moveq.l		#8-1,d0			num colours - 1
		lea		CopColours2,a1		a1->into Copper list
colr_loop1	move.w		(a0)+,2(a1)		copy colour
		addq.l		#4,a1			next register
		dbra		d0,colr_loop1

		STARTCOP	#MyCopper

; Enable bitplane and Copper DMA.

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

; 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
		Section		Fish,DATA_C

MyCopper	CWAIT		0,38			wait for line 40

		CMOVE		DIWSTRT,$2c81		PAL -- 256 lines
		CMOVE		DIWSTOP,$2cc1
		CMOVE		DDFSTRT,$0030		LoRes + scroll
		CMOVE		DDFSTOP,$00d0
		CMOVE		BPL1MOD,-2		modulo = -2 bytes
		CMOVE		BPL2MOD,38		modulo = 38 bytes
		CMOVE		BPLCON0,$6600		6 bitplanes, DBPLF
CopScroll	CMOVE		BPLCON1,$000f		Scroll values
		CMOVE		BPLCON2,$0000		Ignore priority

CopPlanes	CMOVE		BPL1PTH,0		Bit plane pointers
		CMOVE		BPL1PTL,0		filled in by the
		CMOVE		BPL3PTH,0
		CMOVE		BPL3PTL,0
		CMOVE		BPL5PTH,0
		CMOVE		BPL5PTL,0

CopColours	CMOVE		COLOR00,$0000		The colours will be
		CMOVE		COLOR01,$0000		filled in by the
		CMOVE		COLOR02,$0000		program!
		CMOVE		COLOR03,$0000
		CMOVE		COLOR04,$0000
		CMOVE		COLOR05,$0000
		CMOVE		COLOR06,$0000
		CMOVE		COLOR07,$0000


CopPlanes2	CMOVE		BPL2PTH,0		Bit plane pointers
		CMOVE		BPL2PTL,0		filled in by the
		CMOVE		BPL4PTH,0		program!
		CMOVE		BPL4PTL,0
		CMOVE		BPL6PTH,0
		CMOVE		BPL6PTL,0

CopColours2	CMOVE		COLOR08,$0000
		CMOVE		COLOR09,$0000
		CMOVE		COLOR10,$0000
		CMOVE		COLOR11,$0000
		CMOVE		COLOR12,$0000
		CMOVE		COLOR13,$0000
		CMOVE		COLOR14,$0000
		CMOVE		COLOR15,$0000

		CEND					end of list

pf1		incbin		'pic5.bm'
pf2		incbin		'pic6.bm'

		end

		
