****************************************************************************
**  COPPER LIST EXAMPLE CODE SUPPLIED TO THE READERS OF BEYOND-SANIT-E!   **
**    THIS CODE IS (C) ROMBUST - NERVE AXIS.  HAVE FUN AND GOOD LUCK      **
**     IF YOU ARE A CODER AND WANT TO SWAP SOME SOURCE THEN WRITE TO      **
**        (OR EVEN IF YOU AREN'T A CODER AND STILL WANT TO WRITE)         **
**    STEPHEN SMITH, 39 WASDALE GARDENS, ESTOVER, PLYMOUTH, PL6 8TN.      **
****************************************************************************

_LVOForbid		equ	-132
_LVOPermit		equ	-138
_LVOOpenOldLib		equ	-408
_LVOCloselib		equ	-414

	section prog,code 	; program section,code.
	lea graplib(pc),a1 	; load effective address with graplib
 	move.l 4.w,a6		; 16bit move instruction. - lib base
 	jsr _LOVOpenOldLib(a6)	; jump to subrountine openoldlib subrountine
	move.l d0,A1		; move 32-bits of d0 register to a1
	move.l 38(A1),OLDCOP	; move a1+38 to OLDCOP.
	jsr _LVOCloselib(a6)	; jump to subrountine -414 (Closelib)
	jsr _LVOForbid(a6)	; jump to subrountine -132 forbid call
 	move.l #NC,$dff080	; move new copper address to $dff080
pause	btst #6,$bfe001		; Test a bit until equal and quits. 
	bne pause		; ne stand for not equal opposite to beq.
				; The above two lines test for a left
				; mouse button press.  Pressing the left 
				; button causes the program to continue 
				; It is not contined until pressed.
	jsr _LVOPermit(a6) 	; jump to subrountine -138
 	move.l OLDCOP,$dff080   ; 32-bits from address oc to special copper
 	moveq #0,d0		; move quick - immediate copy of data.
	rts			; return from subrountine.
				; Restore the old copper state.

graplib	dc.b "graphics.library",0 ; define constants directive for lib
	even			; at an even address
OLDCOP	dc.l 0			; constant for oc = 0

	section cp,data_c 	; program data_c section.

NC:	dc.w $100,0
	dc.w $120,0,$122,0,$124,0,$126,0,$128,0,$12a,0,$12c,0,$12e
	dc.w 0,$130,0,$132,0,$134,0,$136,0,$138,0,$13a,0,$13c,0,$13e,0
	dc.w $180,0 


*****************************************************************************
** THIS IS OUR COPPER LIST DATA AND THE SCREEN POSITION DATA, CHANGE IT    **
** AROUND TO GET DIFFERENT COLOURS AND DIFFERENT STARTING SCREEN POSITIONS **
*****************************************************************************

 	
			      ;RGB		; The copper colours	

	dc.w $0001,$FFFE,$180,$F00		;line $F00 - RED
 	dc.w $5001,$FFFE,$180,$FF0		;line $FF0 - YELLOW
 	dc.w $a001,$FFFE,$180,$00F		;line $00F - BLUE
 	dc.w $F001,$FFFE,$180,$0F0		;line $0F0 - GREEN

	DC.w $FFFF,$FFFE ; end



;This source appeared in Grapevine and I hope ROMBUST dosen't mind me using
;it.  I have updated the source and added a lot of comments to help.  If
;you do object to me using the source then write to me.