
		ttl	stripes

;	Program:	$VER: stripes 1.00 (3-Mar-93)
;	Author:		Mike Chapman, Updated by Toby Simpson.

		incdir	"inc:"
		include	"hardware/custom.i"
		include	"exec/funcdef.i"	; (May not be needed)
		include	"exec/exec_lib.i"

_CUSTOM:	equ	$dff000
_EXECBASE:	equ	$04

SYS:		macro
		move.l	_EXECBASE,a6
		jsr	_LVO\1(a6)
		endm

		section	stripes_program,code_c

		lea	_CUSTOM,a5
;
; ---- Initialise our display ....
		lea	My_BitPlane,a0
		move.l	a0,d0
		lea	Copper_List,a1
		move.w	d0,6(a1)
		swap	d0
		move.w	d0,2(a1)		; Pointer to bitplane.
		lea	Copper_List,a0
		move.l	a0,cop1lc(a5)
;
; ---- Set up display registers ....
		move.w	#$0000,copjmp1(a5)	; Trigger copper list.
		move.w	#$1200,bplcon0(a5)	; 1 bitplane, colour.
		move.w	#$0000,bplcon1(a5)	; No fine scroll.
		move.w	#$0024,bplcon2(a5)	; Sprites/Playfield priority
		move.w	#$0000,bpl1mod(a5)
		move.w	#$0000,bpl2mod(a5)	; Clear modulos
;
		move.w	#$2c81,diwstrt(a5)
		move.w	#$f4c1,diwstop(a5)	; 320 x 200 display
		move.w	#$0038,ddfstrt(a5)	; Display Fetch start
		move.w	#$00d0,ddfstop(a5)	; Display Fetch stop
;
; ---- Set up our bitplane memory then start display ....
		lea	My_BitPlane,a0
		move.w	#7999,d0
Write_Stripes:	move.b	#$02,(a0)+
		dbra	d0,Write_Stripes	; Draw stripes.
;
;
; ---- Wait for a click ....
Wait_Click:	btst	#$06,$bfe001
		bne.s	Wait_Click		; Wait for mouse click.
;
; ---- Exit ....
		lea	GraName,a1
		moveq	#$00,d0
		SYS	OpenLibrary		; graphics library
		move.l	d0,a1
		move.l	38(a1),cop1lc(a5)
		move.w	#$00,copjmp1(a5)	; Boot-Start copper.
		SYS	CloseLibrary
		rts
;
		section	misc_data,data
;
GraName:	dc.b	"graphics.library",0
;
		section	chip_data,data_c
;
My_BitPlane:	ds.b	8000			; 1 320x200 bitplane.
;
Copper_List:	dc.l	$00e00000,$00e20000
		dc.l	$01820f0f		; palette for stripes
		dc.l	$600ffffe,$01800f00	; RED
		dc.l	$a00ffffe,$018000f0	; GREEN
		dc.l	$f00ffffe,$0180000f	; BLUE
;
		dc.l	$fffffffe
;
		end
