
; Display Example 7. -- Using Bitplane Modulos -- 

; Display is   320x256x4 ( 40x256x4 bytes )
; Bit Plane is 640x256x4 ( 80x256x4 bytes )

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

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

; First, 'poke' address of bit planes into Copper list. Use a loop to do this

Main		COPBPLC		CopPlanes,bitplane,(640/8)*256,4

; Define address of Copper List

		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	CMOVE		DIWSTRT,$2c81		PAL -- 256 lines
		CMOVE		DIWSTOP,$2cc1
		CMOVE		DDFSTRT,$0038		LoRes
		CMOVE		DDFSTOP,$00d0
		CMOVE		BPL1MOD,40		modulo = 40 bytes
		CMOVE		BPL2MOD,40		modulo = 40 bytes
		CMOVE		BPLCON0,$4200		4 bitplanes & colour
		CMOVE		BPLCON1,$0000		No scrolling
		CMOVE		BPLCON2,$0000		Ignore priority

CopPlanes	CMOVE		BPL1PTH,0		Bit plane pointers
		CMOVE		BPL1PTL,0		filled in by the
		CMOVE		BPL2PTH,0		program!
		CMOVE		BPL2PTL,0
		CMOVE		BPL3PTH,0
		CMOVE		BPL3PTL,0
		CMOVE		BPL4PTH,0
		CMOVE		BPL4PTL,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
		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

bitplane	incbin		'pic4.bm'

		end

		
