	SECTION	chipmemory,DATA_C
							;BY BLAINE EVANS
							;1 ERITH WAY
							;PONTYBODKIN
							;NR MOLD
							;CLWYD
							;CH7 4TR
							;TEL O352-771673

	opt	c-,d+

	move.l	4.w,a6			;FIND EXEC BASE
	lea	gfxlib,a1		;LOAD GRAPHICS LIBRARY IN A1
	moveq	#$00,d0			;VERSION 0
	jsr	-552(a6)		;OPEN LIBRARY
	move.l	d0,_gfxbase		;STORE D0 (GFX ADDRESS )
	beq	nolib_exit		;ELSE EXIT
	jsr	-132(a6)		;FORBID
	lea	$dff000,a6
	bsr	Foreground_addresses	;BRANCH TO FOREGROUND ADDRESSES
	bsr	Split_Screen
	bsr	Split_Screen_2
	bsr	Init
	bsr	Sprite_addresses
	bsr	Mt_init
	move.l	_gfxbase,a0		;LOAD ADDRESS OF GRAPHICS LIB IN A0
	move.l	50(a0),oldcop		;STORE CURRENT COPPER,ETC TO RETRIEVE LATER
S
	move.l	#newcop,50(a0)		;POINT TO OUR COPPERLIST

wait					;WAIT LOOP
	move.l	$dff004,d0
	and.l	#%11111111100000000,d0
	lsr.l	#8,d0
	cmp.w	#312,d0
	bne.s	Wait
;	move.w	#$fff,$180(a6)		;REMOVE TO MEASURE RASTER TIME
	bsr	Set_Up_Blit
	bsr	Sprites_00		;MOVE SPRITE
	bsr	Bounce
	bsr	Scroller
	bsr	Bar
 	bsr	Copper_Bars
	bsr	Mt_music
;	move.w	#$000,$180(a6)		;REMOVE TO MEASURE RASTER TIME
	btst 	#$6,$bfe001		;QUIT LEFT MOUSE PRESSED
	bne.s	wait
ended					;ELSE LOOP TO WAIT
	bsr	Mt_end
	move.l	_gfxbase,a0		;LOAD GRAPHICS LIB ADDRESS IN A0
	move.l	oldcop,50(a0)		;RESTORE OLD COPPER TO RETURN TO EDITTER
nomem_exit	
	move.l	4.w,a6			;FIND EXEC BASE
	move.l	_gfxbase,a1		;LOAD GRAPHICS BASE IN A1
	jsr	-414(a6)		;CLOSE LIBRARY
	jsr	-138(a6)		;PERMIT
nolib_exit
	rts				;RETURN TO EDITER
Foreground_addresses			;START OF FOREGROUND DATA
	move.l	#Foreground,d0
	move.w	d0,Bpl0ptl		;LOW WORD IN BIT PLANE 0 LOW
	swap	d0				
	move.w	d0,Bpl0pth		;HIGH WORD IN BIT PLANE 0 HIGH
	swap	d0
	add.l	#100*40,d0
	move.w	d0,Bpl1ptl		;LOW WORD IN BIT PLANE 1 LOW
	swap	d0				
	move.w	d0,Bpl1pth		;HIGH WORD IN BIT PLANE 1 HIGH	
	swap	d0
	add.l	#100*40,d0
	move.w	d0,Bpl2ptl		;LOW WORD IN BIT PLANE 2 LOW
	swap	d0				
	move.w	d0,Bpl2pth		;HIGH WORD IN BIT PLANE 2 HIGH
	swap	d0
	add.l	#100*40,d0
	move.w	d0,Bpl3ptl		;LOW WORD IN BIT PLANE 3 LOW
	swap	d0				
	move.w	d0,Bpl3pth		;HIGH WORD IN BIT PLANE 3 HIGH
	swap	d0
	rts
Split_Screen
	move.l	#Screen,d0
	move.w	d0,Bpl0ptl2		;LOW WORD IN BIT PLANE 0 LOW
	swap	d0				
	move.w	d0,Bpl0pth2		;HIGH WORD IN BIT PLANE 0 HIGH
	swap	d0
	add.l	#132*40,d0
	move.w	d0,Bpl1ptl2		;LOW WORD IN BIT PLANE 1 LOW
	swap	d0				
	move.w	d0,Bpl1pth2		;HIGH WORD IN BIT PLANE 1 HIGH	
	swap	d0
	add.l	#132*40,d0
	move.w	d0,Bpl2ptl2		;LOW WORD IN BIT PLANE 2 LOW
	swap	d0				
	move.w	d0,Bpl2pth2		;HIGH WORD IN BIT PLANE 2 HIGH
	swap	d0
	add.l	#132*40,d0
	move.w	d0,Bpl3ptl2		;LOW WORD IN BIT PLANE 2 LOW
	swap	d0				
	move.w	d0,Bpl3pth2		;HIGH WORD IN BIT PLANE 2 HIGH
	swap	d0
	add.l	#132*40,d0
	move.w	d0,Bpl4ptl2		;LOW WORD IN BIT PLANE 2 LOW
	swap	d0				
	move.w	d0,Bpl4pth2		;HIGH WORD IN BIT PLANE 2 HIGH
	swap	d0
	rts
Split_Screen_2
	move.l	#Screen_2,d0
	move.w	d0,Bpl0ptl3		;LOW WORD IN BIT PLANE 0 LOW
	swap	d0				
	move.w	d0,Bpl0pth3		;HIGH WORD IN BIT PLANE 0 HIGH
	swap	d0
	add.l	#57*80,d0
	move.w	d0,Bpl1ptl3		;LOW WORD IN BIT PLANE 0 LOW
	swap	d0				
	move.w	d0,Bpl1pth3		;HIGH WORD IN BIT PLANE 0 HIGH
	swap	d0
	add.l	#57*80,d0
	move.w	d0,Bpl2ptl3		;LOW WORD IN BIT PLANE 0 LOW
	swap	d0				
	move.w	d0,Bpl2pth3		;HIGH WORD IN BIT PLANE 0 HIGH
	swap	d0
	rts
Sprite_addresses
	move.l	#Sprite0,d0		;LOAD SPRITE ADDRESSS INTO COPPER
	move.w	d0,Spl0ptl
	swap	d0
	move.w	d0,Spl0pth
	swap	d0
	rts
Set_Up_Blit
	move.w	#19,d5			* no of bars-1
Bar_Fill
	;ILLEGAL
	move.l	Shift_Address,a4
	move.l	Value_Address,a2
	move.l	(a4)+,a3
	move.w	(a2)+,d2
	move.w	(a2)+,d0
	move.w	d2,FillorNot		;to test later
	move.l	a4,Shift_Address	;restore positon
	move.l	a2,Value_Address	;"    "
	cmp.w	#$dddd,d0		;at the end ?
	beq	M_Reset
	add.w	d0,a3
	lea	-4(a4),a4		;store value
	move.l	a3,(a4)			;in here
	bsr	Test_Fill
	dbra	d5,Bar_Fill		;loop
	lea	Shift_Values,a4		;restore addresses
	move.l	a4,Shift_Address
	rts
M_Reset
	;ILLEGAL			;reload 
	lea	Shift_Values,a4
	move.l	a4,Shift_Address
	move.l	#Screen,d0
	add.l	#(132*40),d0
	move.l	d0,(a4)				* 1
	move.w	#18,d1
DDD
	add.l	#2,d0
	add.l	#4,a4
	move.l	d0,(a4)	
	dbra	d1,DDD

	lea	Values,a4
	move.l	a4,Value_Address
	rts
Test_Fill				;is it filled with 0s or 1s
	;ILLEGAL
	cmp.w	#1,FillorNot		;1=fill
	beq	Yes_Fill
	lea	Unfill,a0		;unfill
	bsr	Blit_Bars
	rts
Yes_Fill
	lea	Fill,a0			;fill
	bsr	Blit_Bars
	rts
Blit_Bars				;usual blitter routine
	move.l	#0,d0
	move.l	#38,d1
	move.l	#(2*64)+1,d3
	move.w	#$ffff,d6
	move.w	#$ffff,d4
	move.w	#1,d7
	lea	$dff000,a6
	move.l	#$09f00000,d2

Bar_loop
	bsr	Stuff_Bar
	lea	132*40(a3),a3
	dbra	d7,Bar_loop
	rts

	
Stuff_Bar		;LOAD BLITTER WITH VALUES

wfblit_Bar
	btst	#14,2(a6)			;dmaconr(a6)
	bne.s	wfblit_Bar
	move.l	a0,$50(a6)			;bltapt(a6)
	move.l	a3,$54(a6)			;bltdpt(a6)
	move.w	d0,$64(a6)			;bltamod(a6)
	move.w	d1,$66(a6)			;bltdmod(a6)
	move.l	d2,$40(a6)			;bltcon0(a6)
	move.l	#00,$42(a6)			;bltcon1(a6)
	move.w	d6,$46(a6)			;bltalwm(a6)
	move.w	d4,$44(a6)			;bltafwm(a6)
	move.w	d3,$58(a6)			;bltsize(a6)
	rts	

**********
Bar
	lea	BARS,a0			;
	add.w	#6,a0			;skip control words
	lea	8(a0),a1		;2nd in 1st routine
	move.w	(a0),Store		;store value for later
Ba
	move.w	(a1),(a0)		;2nd in 1st 
	add.w	#8,a0
	add.w	#8,a1
	cmp.w	#$0000,(a0)		;is it black
	bne.s	Ba
	sub.w	#8,a0
	move.w	Store,(a0)		;yes 1st color in last
	rts
Find_Colors
	add.w	#1,Color_Count		;a simple test to inplement
	cmp.w	#96,Color_Count		;a colour change
	blt	Blue_C
	cmp.w	#192,Color_Count
	blt	Purple_C
	cmp.w	#288,Color_Count
	blt	Green_C
	cmp.w	#384,Color_Count
	blt	Yellow_C
	cmp.w	#480,Color_Count
	blt	Cyan_C
	cmp.w	#576,Color_Count
	bgt	Color_Re
	lea	Red,a1	
	rts
Blue_C
	lea	Blue,a1
	rts
Purple_C
	lea	Purple,a1
	rts
Green_C
	lea	Green,a1
	rts
Yellow_C
	lea	Yellow,a1
	rts
Cyan_C
	lea	Cyan,a1
	rts
Color_re
	move.w	#0,Color_Count	
	lea	Blue,a1
	rts
Copper_Bars
	 CMPI.W   #95,CFLAG1		;test which way
         BNE.S    COPUP
         CMPI.W   #95,CFLAG2
         BNE.S    COPDOWN
         CLR.W    CFLAG1
         CLR.W    CFLAG2
         RTS

COPUP					
	lea	CopBar,a0
        move.w  #1*29-1,d2    
CUL
	add.b	#2,1(a0)
	add.l	#16,a0
        dbra    d2,CUL
        addi.w  #1,CFLAG1
        rts

COPDOWN
	bsr	Find_Colors
	lea     CopBar,a0		;address
        move.w  #1*29-1,D2    		;no of times
CDL   
	sub.b	#2,1(a0)		;movement
	move.w	(a1)+,6(a0)		;next colour
	add.l	#16,a0
        dbra    D2,CDL
        addi.w  #1,CFLAG2
        rts

Sprites_00				;MOVE SPRITE 0 
	lea	sprites,a0		;CONTROL WORDS
	move.l	#Sprite0,d0		;ADDRESS
	move.w	d0,6(a0)		;AND UPDATE COPPER
	swap	d0
	move.w	d0,2(a0)
	swap	d0	
	move.l	#Sprite0,a0		;A0=SPRITE 0 ADDRESS
	move.w	#34,d7			;NO OF SPRITES-1
Move
	addq.b	#1,1(a0)		;ADD #4 TO HORIZONTAL POSITIONAL BYTE
	addq.b	#2,9(a0)
	addq.b	#3,17(a0)
	add.l	#24,a0			;LOCATE NEXT PAIR OF CO-ORDINATES
	dbf	d7,Move			;DECREMENT AND BRANCH WHEN =0
	rts
Bounce
	move.l	Map_Address,a4
	move.w	(a4)+,d2
	cmp.w	#$ffff,d2
	beq	Reset
	add.w	d2,Bpl0ptl		;TO PLANE 0
	add.w	d2,Bpl1ptl		;TO PLANE 1
	add.w	d2,Bpl2ptl		;TO PLANE 2
	add.w	d2,Bpl3ptl		;TO PLANE 3
	move.l	a4,Map_Address
	rts

Reset
	lea	Map,a4
	move.l	a4,Map_Address
	rts

Init					;initialise some variables
	move.w	#0,CFLAG1
	move.w	#0,CFLAG2
	lea	Map,a4
	move.l	a4,Map_Address
	lea	Text,a3
	move.l	a3,Char_address
	move.l	#Screen_2,d0
	add.l	#24*80,d0
	move.l	d0,Blit_Base
	add.l	#40,d0
	move.l	d0,Blit_Base_2
	clr.b	Count_b
	move.w	#0,Inc
	lea	Text,a3
	move.l	a3,Char_address
	move.w	#$ff,Scroll3
	move.w	#0,Color_Count
	move.w	#0,Logo_Count

	lea	Shift_Values,a2
	move.l	a2,Shift_Address
	move.l	#Screen,d0
	add.l	#(132*40),d0
	move.l	d0,(a2)			* 1
	move.w	#18,d1
DDD1
	add.l	#2,d0
	add.l	#4,a2
	move.l	d0,(a2)	
	dbra	d1,DDD1

	lea	Values,a2
	move.l	a2,Value_Address
	rts
Scroller
	move.w	scroll3,d0		;SCROLL VALUE IN D0
	cmp.w	#$00,d0			;IF 0 THEN RESET
	beq	reset_Sc		;ELSE 
	subi.w	#$11,scroll3		;SUBTRACT 1 FROM VALUE
	rts
reset_Sc				;HAVE NOW SCROLLED 16 PIXELS
	add.w	#2,inc			;ADD #2 TO INCREMENT VALUE
	bsr	Find_Char
	bsr	blitter			;BRANCH TO BLIT BLOCK
	bsr	blitter_2		;"                   "
	lea	scroll3,a0		;LOAD SCROLL TO A0
	move.w	#$FF,(a0)		;MOVE RESETTED VALUE TO COPPERLIST
	add.b	#1,count_b		;ADD 1 TO COUNT
	cmp.b	#20,count_b		;WHEN 20 WORD SCROLLED
	beq	swap_planes		;BRANCH TO RESET PLANES TO START
	addi.w	#2,Bpl0ptl3		;ELSE ADD #2 TO PLANE 0
	addi.w	#2,Bpl1ptl3		;TO PLANE 2
	addi.w	#2,Bpl2ptl3		;TO PLANE 4
	rts
swap_planes				;RESET VALUES IN COPPERLIST
	move.b	#0,count_b		;CLEAR	COUNT
	move.w	#0,inc			;CLEAR INCREMENTAL VALUE
	move.l	#Screen_2,d0		;FOREGROUND ADDRESS
	move.w	d0,Bpl0ptl3		;INSERT ADDRESSES
	swap	d0			;INTO COPPERLIST
	move.w	d0,Bpl0pth3
	swap	d0
	add.l	#57*80,d0
	move.w	d0,Bpl1ptl3
	swap	d0
	move.w	d0,Bpl1pth3
	swap	d0
	add.l	#57*80,d0
	move.w	d0,Bpl2ptl3
	swap	d0
	move.w	d0,Bpl2pth3
	swap	d0
	rts
blitter					;BLIT 200*16 BLOCK 
	move.l	blit_base,a3		;ADDRESS OF DESIGNATION
	add.w	inc,a3			;PLUS INCREMNTAL VALUE.I.E.EVERY TIME 1 WORD
	move.l	Font,a0					;SCROLLED #2 TO ADDRESS
	move.l	#50,d0			;MODULA OF GRAPHICS
	move.l	#78,d1			;MODULA OF DESIGNATION
	move.l	#(16*64)+1,d3		;SIZE OF BLIT(200*1WORD)
	move.w	#$ffff,d6		;NO MASK
	move.w	#$ffff,d4		;NO MASK
	move.w	#2,d7			;NO OF PLANES -1
	lea	$dff000,a6		
	move.l	#$09f00000,d2		;A-D BLIT NO SHIFT

bb_loop
	bsr	stuff_blitter
	lea	16*52(a0),a0		;ADD PLANE SIZE	TO GRAPHICS 
	lea	57*80(a3),a3		;ADD PLANE SIZE TO DESIGNATION 
	dbra	d7,bb_loop		;LOOP TILL 0
	rts



blitter_2				;2ND BLIT IS EXACTLY 40 WORDS FORM 1ST
	move.l	blit_base_2,a3
	add.w	inc,a3		
	move.l	Font,a0
	move.l	#50,d0
	move.l	#78,d1
	move.l	#(16*64)+1,d3
	move.w	#$ffff,d6
	move.w	#$ffff,d4
	move.w	#2,d7
	lea	$dff000,a6
	move.l	#$09f00000,d2

bb_loop_2
	bsr	stuff_blitter
	lea	16*52(a0),a0
	lea	57*80(a3),a3
	dbra	d7,bb_loop_2
	rts

	
stuff_blitter				;LOAD BLITTER WITH VALUES

wfblit
	btst	#14,2(a6)			;dmaconr(a6)
	bne.s	wfblit
	move.l	a0,$50(a6)			;bltapt(a6)
	move.l	a3,$54(a6)			;bltdpt(a6)
	move.w	d0,$64(a6)			;bltamod(a6)
	move.w	d1,$66(a6)			;bltdmod(a6)
	move.l	d2,$40(a6)			;bltcon0(a6)
	move.l	#00,$42(a6)			;bltcon1(a6)
	move.w	d6,$46(a6)			;bltalwm(a6)
	move.w	d4,$44(a6)			;bltafwm(a6)
	move.w	d3,$58(a6)			;bltsize(a6)
	rts
Find_Char
	moveq.l	#0,d0
	move.l	Char_address,a3
	move.b	(a3)+,d0			;get current character
	move.l	a3,Char_address
	cmpi.b	#255,d0				;Is it end of text ?
	bne.s	NotEnd
	
	lea	Text,a3				;Yes, then reload text
	MOVE.B	(A3)+,D0
	move.l	a3,Char_address
NotEnd						
	cmpi.b	#$41,d0				;asc(II) values
	bhs.s	Line_1
	cmpi.b	#$3f,d0
	bls.s	Line_2
	rts
		
	
Line_1	
	lea	Font_Letters,a0
	sub	#65,d0
	mulu	#2,d0
	add.l	d0,a0
	move.l	a0,Font
	rts
	
Line_2	
	lea	Font_Numbers,a0
	sub	#32,d0
	mulu	#2,d0
	add.l	d0,a0
	move.l	a0,Font
	rts
	


* 	Font layout is -

*	A B C D E F G H I J K L M N O P Q R S T	U V W X Y Z
*	OTHER CHARACTERS 0 1 2 3 4 5 6 7 8 9                                
 	
Font_Letters	incbin	source:bitmaps/A-Z.raw_2
Font_Numbers	incbin	source:bitmaps/Odds_raw_2

	even
	
Text
	DC.B	".*.*.5,.4,.3,.2,.1,.HELLO MARK,HOW ARE YOU . THIS IS MY "
	DC.B	"LATEST CREATION.ANY IDEAS HOW "
	DC.B	"TO MAKE THE JUMPING BARS GO IN TIME WITH THE MUSIC .I HAVE "
	DC.B	"USED A CRUDE METHOD OF TRIAL AND ERROR.WELL IT WILL HAVE "
	DC.B	"TO DO UNTIL I GET MY THINKING CAP ON AGAIN,PROBABLY ABOUT "
	DC.B	"THE SAME TIME NEXT YEAR........................... "
	DC.B	"GREETS TO YOURSELF,MICHAEL JOHN,MASTER-BEAT,RAISTLIN "
	DC.B	"AND ALL IN THE CODERS CLUB.FONT BY BE.BLAINE.LOGO BY MASTER-BEAT "
	DC.B	"BYE FOR NOW ....................WRAP..............."
	DC.B	255 
	
	even	
****************************************************************************
* 	  REPLAY ROUTINE V2.4	   *
****************************************************************************

mt_init 
	lea	mt_data,a0
	add.l	#$03b8,a0
	moveq	#$7f,d0
	moveq	#0,d1
mt_init1
	move.l	d1,d2
	subq.w	#1,d0
mt_init2
	move.b	(a0)+,d1
	cmp.b	d2,d1
	bgt.s	mt_init1
	dbf	d0,mt_init2
	addq.b	#1,d2
mt_init3
	lea	mt_data,a0
	lea	mt_sample1(pc),a1
	asl.l	#8,d2
	asl.l	#2,d2
	add.l	#$438,d2
	add.l	a0,d2
	moveq	#$1e,d0
mt_init4
	move.l	d2,(a1)+
	moveq	#0,d1
	move.w	42(a0),d1
	asl.l	#1,d1
	add.l	d1,d2
	add.l	#$1e,a0
	dbf	d0,mt_init4
	lea	mt_sample1(PC),a0
	moveq	#0,d0
mt_clear
	move.l	(a0,d0.w),a1
	clr.l	(a1)
	addq.w	#4,d0
	cmp.w	#$7c,d0
	bne.s	mt_clear
	clr.w	$dff0a8
	clr.w	$dff0b8
	clr.w	$dff0c8
	clr.w	$dff0d8
	clr.l	mt_partnrplay
	clr.l	mt_partnote
	clr.l	mt_partpoint
	move.b	mt_data+$3b6,mt_maxpart+1
	rts
mt_end	clr.w	$dff0a8
	clr.w	$dff0b8
	clr.w	$dff0c8
	clr.w	$dff0d8
	move.w	#$f,$dff096
	rts
mt_music
	addq.w	#1,mt_counter
mt_cool cmp.w	#6,mt_counter
	bne.s	mt_notsix
	clr.w	mt_counter
	bra	mt_rout2
mt_notsix
	lea	mt_aud1temp(PC),a6
	cmpi.w	#0,(a6)
;	beq.s	levm1
;	move.w	#$000E,Ch1	
levm1	tst.b	3(a6)
	beq.s	mt_arp1
	lea	$dff0a0,a5	
	bsr.s	mt_arprout
mt_arp1 lea	mt_aud2temp(PC),a6
	cmpi.w	#0,(a6)
;	beq.s	levm2
;	move.w	#$000C,Ch2	
levm2	tst.b	3(a6)
	beq.s	mt_arp2
	lea	$dff0b0,a5
	bsr.s	mt_arprout
mt_arp2 lea	mt_aud3temp(PC),a6
	cmpi.w	#0,(a6)
;	beq.s	levm3
;	move.w	#$000A,Ch3	
levm3	tst.b	3(a6)
	beq.s	mt_arp3
	lea	$dff0c0,a5
	bsr.s	mt_arprout
mt_arp3 lea	mt_aud4temp(PC),a6
	cmpi.w	#0,(a6)
;	beq.s	levm4
;	move.w	#$0008,Ch4	
levm4	tst.b	3(a6)
	beq.s	mt_arp4
	lea	$dff0d0,a5
	bra.s	mt_arprout
mt_arp4 rts
mt_arprout
	move.b	2(a6),d0
	and.b	#$0f,d0
	tst.b	d0
	beq	mt_arpegrt
	cmp.b	#$01,d0
	beq.s	mt_portup
	cmp.b	#$02,d0
	beq.s	mt_portdwn
	cmp.b	#$0a,d0
	beq.s	mt_volslide
	rts
mt_portup
	moveq	#0,d0
	move.b	3(a6),d0
	sub.w	d0,22(a6)
	cmp.w	#$71,22(a6)
	bpl.s	mt_ok1
	move.w	#$71,22(a6)
mt_ok1	move.w	22(a6),6(a5)
	rts
mt_portdwn
	moveq	#0,d0
	move.b	3(a6),d0
	add.w	d0,22(a6)
	cmp.w	#$538,22(a6)
	bmi.s	mt_ok2
	move.w	#$538,22(a6)
mt_ok2	move.w	22(a6),6(a5)
	rts
mt_volslide
	moveq	#0,d0
	move.b	3(a6),d0
	lsr.b	#4,d0
	tst.b	d0
	beq.s	mt_voldwn
	add.w	d0,18(a6)
	cmp.w	#64,18(a6)
	bmi.s	mt_ok3
	move.w	#64,18(a6)
mt_ok3	move.w	18(a6),8(a5)
	rts
mt_voldwn
	moveq	#0,d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	sub.w	d0,18(a6)
	bpl.s	mt_ok4
	clr.w	18(a6)
mt_ok4	move.w	18(a6),8(a5)
	rts
mt_arpegrt
	move.w	mt_counter(PC),d0
	cmp.w	#1,d0
	beq.s	mt_loop2
	cmp.w	#2,d0
	beq.s	mt_loop3
	cmp.w	#3,d0
	beq.s	mt_loop4
	cmp.w	#4,d0
	beq.s	mt_loop2
	cmp.w	#5,d0
	beq.s	mt_loop3
	rts
mt_loop2
	moveq	#0,d0
	move.b	3(a6),d0
	lsr.b	#4,d0
	bra.s	mt_cont
mt_loop3
	moveq	#$00,d0
	move.b	3(a6),d0
	and.b	#$0f,d0
	bra.s	mt_cont
mt_loop4
	move.w	16(a6),d2
	bra.s	mt_endpart
mt_cont
	add.w	d0,d0
	moveq	#0,d1
	move.w	16(a6),d1
	lea	mt_arpeggio(PC),a0
mt_loop5
	move.w	(a0,d0),d2
	cmp.w	(a0),d1
	beq.s	mt_endpart
	addq.l	#2,a0
	bra.s	mt_loop5
mt_endpart
	move.w	d2,6(a5)
	rts
mt_rout2
	lea	mt_data,a0
	move.l	a0,a3
	add.l	#$0c,a3
	move.l	a0,a2
	add.l	#$3b8,a2
	add.l	#$43c,a0
	move.l	mt_partnrplay(PC),d0
	moveq	#0,d1
	move.b	(a2,d0),d1
	asl.l	#8,d1
	asl.l	#2,d1
	add.l	mt_partnote(PC),d1
	move.l	d1,mt_partpoint
	clr.w	mt_dmacon
	lea	$dff0a0,a5
	lea	mt_aud1temp(PC),a6
	bsr	mt_playit
	lea	$dff0b0,a5
	lea	mt_aud2temp(PC),a6
	bsr	mt_playit
	lea	$dff0c0,a5
	lea	mt_aud3temp(PC),a6
	bsr	mt_playit
	lea	$dff0d0,a5
	lea	mt_aud4temp(PC),a6
	bsr	mt_playit
	move.w	#$01f4,d0
mt_rls	dbf	d0,mt_rls
	move.w	#$8000,d0
	or.w	mt_dmacon,d0
	move.w	d0,$dff096
	lea	mt_aud4temp(PC),a6
	cmp.w	#1,14(a6)
	bne.s	mt_voice3
	move.l	10(a6),$dff0d0
	move.w	#1,$dff0d4
mt_voice3
	lea	mt_aud3temp(PC),a6
	cmp.w	#1,14(a6)
	bne.s	mt_voice2
	move.l	10(a6),$dff0c0
	move.w	#1,$dff0c4
mt_voice2
	lea	mt_aud2temp(PC),a6
	cmp.w	#1,14(a6)
	bne.s	mt_voice1
	move.l	10(a6),$dff0b0
	move.w	#1,$dff0b4
mt_voice1
	lea	mt_aud1temp(PC),a6
	cmp.w	#1,14(a6)
	bne.s	mt_voice0
	move.l	10(a6),$dff0a0
	move.w	#1,$dff0a4
mt_voice0
	move.l	mt_partnote(PC),d0
	add.l	#$10,d0
	move.l	d0,mt_partnote
	cmp.l	#$400,d0
	bne.s	mt_stop
mt_higher
	clr.l	mt_partnote
	addq.l	#1,mt_partnrplay
	moveq	#0,d0
	move.w	mt_maxpart(PC),d0
	move.l	mt_partnrplay(PC),d1
	cmp.l	d0,d1
	bne.s	mt_stop
	clr.l	mt_partnrplay
mt_stop tst.w	mt_status
	beq.s	mt_stop2
	clr.w	mt_status
	bra.s	mt_higher
mt_stop2
	rts
mt_playit
	move.l	(a0,d1.l),(a6)
	addq.l	#4,d1
	moveq	#0,d2
	move.b	2(a6),d2
	and.b	#$f0,d2
	lsr.b	#4,d2
	move.b	(a6),d0
	and.b	#$f0,d0
	or.b	d0,d2
	tst.b	d2
	beq.s	mt_nosamplechange
	moveq	#0,d3
	lea	mt_samples(PC),a1
	move.l	d2,d4
	asl.l	#2,d2
	mulu	#$1e,d4
	move.l	(a1,d2),4(a6)
	move.w	(a3,d4.l),8(a6)
	move.w	2(a3,d4.l),18(a6)
	move.w	4(a3,d4.l),d3
	tst.w	d3
	beq.s	mt_displace
	move.l	4(a6),d2
	add.l	d3,d2
	move.l	d2,4(a6)
	move.l	d2,10(a6)
	move.w	6(a3,d4.l),8(a6)
	move.w	6(a3,d4.l),14(a6)
	move.w	18(a6),8(a5)
	bra.s	mt_nosamplechange
mt_displace
	move.l	4(a6),d2
	add.l	d3,d2
	move.l	d2,10(a6)
	move.w	6(a3,d4.l),14(a6)
	move.w	18(a6),8(a5)
mt_nosamplechange
	tst.w	(a6)
	beq.s	mt_retrout
	move.w	(a6),16(a6)
	move.w	20(a6),$dff096
	move.l	4(a6),(a5)
	move.w	8(a6),4(a5)
	move.w	(a6),6(a5)
	move.w	20(a6),d0
	or.w	d0,mt_dmacon
mt_retrout
	tst.w	(a6)
	beq.s	mt_nonewper
	move.w	(a6),22(a6)
mt_nonewper
	move.b	2(a6),d0
	and.b	#$0f,d0
	cmp.b	#$0b,d0
	beq.s	mt_posjmp
	cmp.b	#$0c,d0
	beq.s	mt_setvol
	cmp.b	#$0d,d0
	beq.s	mt_break
	cmp.b	#$0e,d0
	beq.s	mt_setfil
	cmp.b	#$0f,d0
	beq.s	mt_setspeed
	rts
mt_posjmp
	not.w	mt_status
	moveq	#0,d0
	move.b	3(a6),d0
	subq.b	#1,d0
	move.l	d0,mt_partnrplay
	rts
mt_setvol
	move.b	3(a6),8(a5)
	rts
mt_break
	not.w	mt_status
	rts
mt_setfil
	moveq	#0,d0
	move.b	3(a6),d0
	and.b	#1,d0
	rol.b	#1,d0
	and.b	#$fd,$bfe001
	or.b	d0,$bfe001
	rts
mt_setspeed
	move.b	3(a6),d0
	and.b	#$0f,d0
	beq.s	mt_back
	clr.w	mt_counter
	move.b	d0,mt_cool+3
mt_back rts

mt_aud1temp
	dcb.w	10,0
	dc.w	1
	dcb.w	2,0
mt_aud2temp
	dcb.w	10,0
	dc.w	2
	dcb.w	2,0
mt_aud3temp
	dcb.w	10,0
	dc.w	4
	dcb.w	2,0
mt_aud4temp
	dcb.w	10,0
	dc.w	8
	dcb.w	2,0


mt_partnote	dc.l	0
mt_partnrplay	dc.l	0
mt_counter	dc.w	0
mt_partpoint	dc.l	0
mt_samples	dc.l	0
mt_sample1	dcb.l	31,0
mt_maxpart	dc.w	0
mt_dmacon	dc.w	0
mt_status	dc.w	0

mt_arpeggio
	dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
	dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
	dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
	dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
	dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000

	even

gfxlib	dc.b	"graphics.library",0	
	even
_gfxbase	dc.l	0		;LONG WORD TO STORE GFX ADDRESS
oldcop		dc.l	0		;OLD COPPERLIST ADDRESS
Map_Address	dc.l	0
scrn		dc.l	0
Char_address	dc.l	0
Blit_Base	dc.l	0
Blit_Base_2	dc.l	0
Font		dc.l	0
Color_Address	dc.l	0
Bar_Base	dc.l	0
Shift_Address	dc.l	0
Value_Address	dc.l	0
INC		dc.w	0
Bar_Inc		dc.w	0
Plop		dc.w	0
Store		dc.w	0
Store2		dc.w	0
Store_Logo	dc.w	0
CFLAG1 		dc.w	0
CFLAG2	  	dc.w    0
Color_Count	dc.w	0
Logo_Count	dc.w	0
FillorNot	dc.w	0
Count_b		dc.b	0
Count		dc.b	0

	even
;	SECTION		chipmemory,data_c	

newcop
	dc.w	$0100,%0100001000000000		;4 PLANES 
	dc.w	$0102
scroll0	dc.w	$0000				;SCROLL VALUE
	dc.w	$0104,%0000000000000000		;PRIORITIES
	dc.w	$0108,$0000,$010a,$0000		;MODULAS
	dc.w	$0092,$0038,$0094,$00d0		;200*40 SCREEN
	dc.w	$008e,$3081,$0090,$fec1		;VISIBLE AREA
						
planes						;PLANE CONTROL WORDS
	dc.w	$00e0
Bpl0pth	dc.w	$0000
	dc.w	$00e2
Bpl0ptl	dc.w	$0000		
	dc.w	$00e4
Bpl1pth	dc.w	$0000
	dc.w	$00e6
Bpl1ptl	dc.w	$0000
	dc.w	$00e8
Bpl2pth	dc.w	$0000
	dc.w	$00ea
Bpl2ptl	dc.w	$0000
	dc.w	$00ec
Bpl3pth	dc.w	$0000
	dc.w	$00ee
Bpl3ptl	dc.w	$0000	
	dc.w	$00f0
Bpl4pth	dc.w	$0000
	dc.w	$00f2
Bpl4ptl	dc.w	$0000
	dc.w	$00f4
Bpl5pth	dc.w	$0000
	dc.w	$00f6
Bpl5ptl	dc.w	$0000

sprites						;SPRITES CONTROL WORDS
	dc.w	$0120
Spl0pth	dc.w	$0000,$0122
Spl0ptl	dc.w	$0000,$0124
Spl1pth	dc.w	$0000,$0126
Spl1ptl	dc.w	$0000,$0128
Spl2pth	dc.w	$0000,$012a
Spl2ptl	dc.w	$0000,$012c
Spl3pth	dc.w	$0000,$012e
Spl3ptl	dc.w	$0000,$0130
Spl4pth	dc.w	$0000,$0132
Spl4ptl	dc.w	$0000,$0134
Spl5pth	dc.w	$0000,$0136
Spl5ptl	dc.w	$0000,$0138
Spl6pth	dc.w	$0000,$013a
Spl6ptl	dc.w	$0000,$013c
Spl7pth	dc.w	$0000,$013e
Spl7ptl	dc.w	$0000
Colours1
	dc.w	$0180,$0000,$0182,$0fff,$0184,$0f00,$0186,$0000
	dc.w	$0188,$0fc5,$018a,$0eb4,$018c,$0da3,$018e,$0c92
	dc.w	$0190,$0b81,$0192,$0a70,$0194,$0960,$0196,$0850
	dc.w	$0198,$0740,$019a,$0630,$019c,$0520,$019e,$0410

BARS
	dc.w	$3001,$ff00,$0180,$000f
	dc.w	$3101,$ff00,$0180,$001f
	dc.w	$3201,$ff00,$0180,$002f
	dc.w	$3301,$ff00,$0180,$003f
	dc.w	$3401,$ff00,$0180,$004f
	dc.w	$3501,$ff00,$0180,$005f
	dc.w	$3601,$ff00,$0180,$006f
	dc.w	$3701,$ff00,$0180,$007f
	dc.w	$3801,$ff00,$0180,$008f
	dc.w	$3a01,$ff00,$0180,$009f
	dc.w	$3c01,$ff00,$0180,$009f
	dc.w	$3e01,$ff00,$0180,$008f
	dc.w	$4101,$ff00,$0180,$007f
	dc.w	$4301,$ff00,$0180,$006f
	dc.w	$4501,$ff00,$0180,$005f
	dc.w	$4701,$ff00,$0180,$004f
	dc.w	$4901,$ff00,$0180,$003f
	dc.w	$4b01,$ff00,$0180,$002f
	dc.w	$4d01,$ff00,$0180,$001f
	dc.w	$4f01,$ff00,$0180,$000f
	dc.w	$5001,$ff00,$0180,$000f
	dc.w	$5201,$ff00,$0180,$001f
	dc.w	$5401,$ff00,$0180,$002f
	dc.w	$5601,$ff00,$0180,$003f
	dc.w	$5801,$ff00,$0180,$004f
	dc.w	$5901,$ff00,$0180,$005f
	dc.w	$5a01,$ff00,$0180,$006f
	dc.w	$5b01,$ff00,$0180,$007f
	dc.w	$5c01,$ff00,$0180,$008f
	dc.w	$5d01,$ff00,$0180,$009f
	dc.w	$5e01,$ff00,$0180,$009f
	dc.w	$5f01,$ff00,$0180,$008f
	dc.w	$6001,$ff00,$0180,$007f
	dc.w	$6101,$ff00,$0180,$006f
	dc.w	$6201,$ff00,$0180,$005f
	dc.w	$6301,$ff00,$0180,$004f
	dc.w	$6401,$ff00,$0180,$003f
	dc.w	$6501,$ff00,$0180,$002f
	dc.w	$6601,$ff00,$0180,$001f
	dc.w	$6701,$ff00,$0180,$000f
	dc.w	$6801,$ff00,$0180,$000f
	dc.w	$6901,$ff00,$0180,$001f
	dc.w	$6a01,$ff00,$0180,$002f
	dc.w	$6b01,$ff00,$0180,$003f
	dc.w	$6c01,$ff00,$0180,$004f
	dc.w	$6d01,$ff00,$0180,$005f
	dc.w	$6e01,$ff00,$0180,$006f
	dc.w	$6f01,$ff00,$0180,$007f
	dc.w	$7001,$ff00,$0180,$008f
	dc.w	$7101,$ff00,$0180,$007f
	dc.w	$7201,$ff00,$0180,$006f
	dc.w	$7301,$ff00,$0180,$005f
	dc.w	$7401,$ff00,$0180,$004f
	dc.w	$7501,$ff00,$0180,$003f
	dc.w	$7601,$ff00,$0180,$002f
	dc.w	$7701,$ff00,$0180,$001f
	dc.w	$7801,$ff00,$0180,$000f
	dc.w	$7901,$ff00,$0180,$0000
	
Copper2
	dc.w	$7a31,$ff00
	dc.w	$0100,%0101001000000000		;4 PLANES 
	dc.w	$0102
scroll2	dc.w	$0000			;SCROLL VALUE
	dc.w	$0104,%0000000000000000		;PRIORITIES
	dc.w	$0108,$0000,$010a,$0000		;MODULAS

						
planes2						;PLANE CONTROL WORDS
	dc.w	$00e0
Bpl0pth2	dc.w	$0000
	dc.w	$00e2
Bpl0ptl2	dc.w	$0000		
	dc.w	$00e4
Bpl1pth2	dc.w	$0000
	dc.w	$00e6
Bpl1ptl2	dc.w	$0000
	dc.w	$00e8
Bpl2pth2	dc.w	$0000
	dc.w	$00ea
Bpl2ptl2	dc.w	$0000
	dc.w	$00ec
Bpl3pth2	dc.w	$0000
	dc.w	$00ee
Bpl3ptl2	dc.w	$0000	
	dc.w	$00f0
Bpl4pth2	dc.w	$0000
	dc.w	$00f2
Bpl4ptl2	dc.w	$0000

	dc.w	$0180,$0000

	dc.w	$0184,$0f00,$0186,$0f80
	dc.w	$0188,$0f80,$018a,$0fb0,$018c,$0f90,$018e,$0333
	dc.w	$0190,$0068,$0192,$0e40,$0194,$0fa0,$0196,$0e50
	dc.w	$0198,$0fe0,$019a,$0fd0,$019c,$0fc0,$019e,$0841
	dc.w	$01a0,$0eef,$01a2,$0ddf,$01a4,$0b51,$01a6,$0f50
	dc.w	$01a8,$0f71,$01aa,$0e60,$01ac,$0fe4,$01ae,$0fe7
	dc.w	$01b0,$09ab,$01b2,$0751,$01b4,$0b70,$01b6,$0dc9
	dc.w	$01b8,$0999,$01ba,$0ba8,$01bc,$0ffb,$01be,$0888

Color03
	dc.w	$d431,$fffe,$0186,$040f
	dc.w	$d531,$fffe,$0186,$050f
	dc.w	$d631,$fffe,$0186,$060f
	dc.w	$d731,$fffe,$0186,$070f
	dc.w	$d831,$fffe,$0186,$080f
	dc.w	$d931,$fffe,$0186,$090f
	dc.w	$da31,$fffe,$0186,$0a0f
	dc.w	$db31,$fffe,$0186,$0b0f
	dc.w	$dc31,$fffe,$0186,$0c0f
	dc.w	$dd31,$fffe,$0186,$0d0f
	dc.w	$de31,$fffe,$0186,$0e0f
	dc.w	$df31,$fffe,$0186,$0f0f
	dc.w	$e031,$fffe,$0186,$0f1e
	dc.w	$e131,$fffe,$0186,$0f2d
	dc.w	$e231,$fffe,$0186,$0f3c
	dc.w	$e331,$fffe,$0186,$0f4b
	dc.w	$e431,$fffe,$0186,$0f5a
	dc.w	$e531,$fffe,$0186,$0f69
	dc.w	$e631,$fffe,$0186,$0f78
	dc.w	$e731,$fffe,$0186,$0f87
	dc.w	$e831,$fffe,$0186,$0f96
	dc.w	$e931,$fffe,$0186,$0fa5
	dc.w	$ea31,$fffe,$0186,$0fb4
	dc.w	$eb31,$fffe,$0186,$0fc3
	dc.w	$ec31,$fffe,$0186,$0fd2
	dc.w	$ed31,$fffe,$0186,$0fe1
	dc.w	$ee31,$fffe,$0186,$0ff0
	dc.w	$ef31,$fffe,$0186,$0fe0
	dc.w	$f031,$fffe,$0186,$0fd0
	dc.w	$f131,$fffe,$0186,$0fc0
	dc.w	$f231,$fffe,$0186,$0fb0
	dc.w	$f331,$fffe,$0186,$0fa0
	dc.w	$f431,$fffe,$0186,$0f90
	dc.w	$f531,$fffe,$0186,$0f80
	dc.w	$f631,$fffe,$0186,$0f70
	dc.w	$f731,$fffe,$0186,$0f60
	dc.w	$f831,$fffe,$0186,$0f50
	dc.w	$f931,$fffe,$0186,$0f40
	dc.w	$fa31,$fffe,$0186,$0f30
	dc.w	$fb31,$fffe,$0186,$0f20
	dc.w	$fc31,$fffe,$0186,$0f10
	dc.w	$fd31,$fffe,$0186,$0f00
	dc.w	$fe31,$fffe,$0186,$0000

Copper3
	dc.w	$ff01,$ff00
	dc.w	$0180,$0000
	dc.w	$0100,%0011001000000000		;3 PLANES 
	dc.w	$0102
scroll3	dc.w	$0000				;SCROLL VALUE
	dc.w	$0104,%0000000000000000		;PRIORITIES
	dc.w	$0108,$0024,$010a,$0024		;MODULAS
	dc.w	$008e,$ff81,$0090,$30b1
	dc.w	$0092,$0028	
planes3					;PLANE CONTROL WORDS
	dc.w	$00e0
Bpl0pth3	dc.w	$0000
	dc.w	$00e2
Bpl0ptl3	dc.w	$0000		
	dc.w	$00e4
Bpl1pth3	dc.w	$0000
	dc.w	$00e6
Bpl1ptl3	dc.w	$0000
	dc.w	$00e8
Bpl2pth3	dc.w	$0000
	dc.w	$00ea
Bpl2ptl3	dc.w	$0000
	dc.w	$0180,$0000,$0182,$0fff
	dc.w	$0184,$0f00,$0186,$0f40
	dc.w	$0188,$0f90,$018a,$0f88
	dc.w	$018c,$0f8f,$018e,$0f0f

	dc.w	$0031,$fffe,$0180,$0000
	dc.w	$0131,$fffe,$0180,$0000
	dc.w	$0231,$fffe,$0180,$0000
	dc.w	$0331,$fffe,$0180,$0000
	dc.w	$0431,$fffe,$0180,$0000
	dc.w	$0531,$fffe,$0180,$0000
	dc.w	$0631,$fffe,$0180,$0000
	dc.w	$0731,$fffe,$0180,$0000
	dc.w	$0831,$fffe,$0180,$0000
	dc.w	$0931,$fffe,$0180,$0000
	dc.w	$0a31,$fffe,$0180,$0000
	dc.w	$0b31,$fffe,$0180,$0000
	dc.w	$0c31,$fffe,$0180,$0000
	dc.w	$0d31,$fffe,$0180,$0000
	dc.w	$0e31,$fffe,$0180,$0dce
	dc.w	$0f31,$fffe,$0180,$0000

CopBar				
	dc.w	$1031,$fffe,$0180,$0100,$1109,$fffe,$0180,$0111
	dc.w	$1131,$fffe,$0180,$0200,$1209,$fffe,$0180,$0222	
	dc.w	$1231,$fffe,$0180,$0300,$1309,$fffe,$0180,$0333
	dc.w	$1331,$fffe,$0180,$0400,$1409,$fffe,$0180,$0444
	dc.w	$1431,$fffe,$0180,$0500,$1509,$fffe,$0180,$0555
	dc.w	$1531,$fffe,$0180,$0600,$1609,$fffe,$0180,$0666	
	dc.w	$1631,$fffe,$0180,$0700,$1709,$fffe,$0180,$0777
	dc.w	$1731,$fffe,$0180,$0800,$1809,$fffe,$0180,$0888
	dc.w	$1831,$fffe,$0180,$0900,$1909,$fffe,$0180,$0999
	dc.w	$1931,$fffe,$0180,$0a00,$1a09,$fffe,$0180,$0aaa
	dc.w	$1a31,$fffe,$0180,$0b00,$1b09,$fffe,$0180,$0bbb
	dc.w	$1b31,$fffe,$0180,$0c00,$1c09,$fffe,$0180,$0ccc
	dc.w	$1c31,$fffe,$0180,$0d00,$1d09,$fffe,$0180,$0ddd
	dc.w	$1d31,$fffe,$0180,$0e00,$1e09,$fffe,$0180,$0eee	
	dc.w	$1e31,$fffe,$0180,$0f00,$1f09,$fffe,$0180,$0fff
	dc.w	$1f31,$fffe,$0180,$0e00,$2009,$fffe,$0180,$0eee
	dc.w	$2031,$fffe,$0180,$0d00,$2109,$fffe,$0180,$0ddd
	dc.w	$2131,$fffe,$0180,$0c00,$2209,$fffe,$0180,$0ccc	
	dc.w	$2231,$fffe,$0180,$0b00,$2309,$fffe,$0180,$0bbb	
	dc.w	$2331,$fffe,$0180,$0a00,$2409,$fffe,$0180,$0aaa
	dc.w	$2431,$fffe,$0180,$0900,$2509,$fffe,$0180,$0999	
	dc.w	$2531,$fffe,$0180,$0800,$2609,$fffe,$0180,$0888
	dc.w	$2631,$fffe,$0180,$0700,$2709,$fffe,$0180,$0777
	dc.w	$2731,$fffe,$0180,$0600,$2809,$fffe,$0180,$0666	
	dc.w	$2831,$fffe,$0180,$0500,$2909,$fffe,$0180,$0555
	dc.w	$2931,$fffe,$0180,$0400,$2a09,$fffe,$0180,$0444
	dc.w	$2a31,$fffe,$0180,$0300,$2b09,$fffe,$0180,$0333	
	dc.w	$2b31,$fffe,$0180,$0200,$2c09,$fffe,$0180,$0222
	dc.w	$2c31,$fffe,$0180,$0100,$2d09,$fffe,$0180,$0111
	dc.w	$2d31,$fffe,$0180,$0000,$2e09,$fffe,$0180,$0000

	dc.w	$2f31,$fffe,$0180,$0f80
	dc.w	$ffff,$fffe			;END OF COPPERLIST
		dcb.b	(20*40),$00
Foreground	incbin	source:bitmaps/Blaine.raw
Screen		dcb.b	(132*40)*1,$00
		dcb.b	(132*40)*1,$00
		dcb.b	(132*40)*1,$00
		dcb.b	(132*40)*1,$00
		dcb.b	(132*40)*1,$00
Screen_2
		dcb.b	(57*80)*1,$00
		dcb.b	(57*80)*1,$00
		dcb.b	(57*80)*1,$00


Mt_Data	IncBin "source:Modules/MOD.Popcorn"
	DC.L	0,0

Map
	dc.w	$28,$28,$28,$28,$28,$28
	dc.w	$28,$28,$28,$28,$28,$28
	dc.w	$28,$28,$28,$28,$28,$28
	dc.w	$00,$00,$00,$00,$00,$00
	dc.w	$00,$00,$00,$00,$00,$00
	dc.w	-$28,-$28,-$28,-$28,-$28,-$28
	dc.w	-$28,-$28,-$28,-$28,-$28,-$28
	dc.w	-$28,-$28,-$28,-$28,-$28,-$28
	dc.w	$00,$00,$00,$00,$00,$00
	dc.w	$00,$00,$00,$00,$00,$00

	dc.w	$ffff

Colors_Map
Blue
	DC.W	$0001,$0002,$0003,$0004,$0005,$0006,$0007,$0008
	DC.W	$0009,$000a,$000b,$000c,$000d,$000e,$000f
	DC.W	$000e,$000d,$000c,$000b,$000a,$0009,$0008,$0007
	DC.W	$0006,$0005,$0004,$0003,$0002,$0001,$0000 *Blue
Red
	DC.W	$0100,$0200,$0300,$0400,$0500,$0600,$0700,$0800
	DC.W	$0900,$0a00,$0b00,$0c00,$0d00,$0e00,$0f00
	DC.W	$0e00,$0d00,$0c00,$0b00,$0a00,$0900,$0800,$0700
	DC.W	$0600,$0500,$0400,$0300,$0200,$0100,$0000 *Red
Purple
	DC.W	$0101,$0202,$0303,$0404,$0505,$0606,$0707,$0808
	DC.W	$0909,$0a0a,$0b0b,$0c0c,$0d0d,$0e0e,$0f0f
	DC.W	$0e0e,$0d0d,$0c0c,$0b0b,$0a0a,$0909,$0808,$0707
	DC.W	$0606,$0505,$0404,$0303,$0202,$0101,$0000 *Purple
Green
	dc.w	$0010,$0020,$0030,$0040,$0050,$0060,$0070,$0080
	dc.w	$0090,$00a0,$00b0,$00c0,$00d0,$00e0,$00f0,$00e0
	dc.w	$00d0,$00c0,$00b0,$00a0,$0090,$0080,$0070,$0060
	dc.w	$0050,$0040,$0030,$0020,$0010,$0000 * Green

Yellow
	dc.w	$0110,$0220,$0330,$0440,$0550,$0660,$0770,$0880
	dc.w	$0990,$0aa0,$0bb0,$0cc0,$0dd0,$0ee0,$0ff0,$0ee0
	dc.w	$0dd0,$0cc0,$0bb0,$0aa0,$0990,$0880,$0770,$0660
	dc.w	$0550,$0440,$0330,$0220,$0110,$0000 * Yellow
Cyan
	dc.w	$0011,$0022,$0033,$0044,$0055,$0066,$0077,$0088
	dc.w	$0099,$00aa,$00bb,$00cc,$00dd,$00ee,$00ff,$00ee
	dc.w	$00dd,$00cc,$00bb,$00aa,$0099,$0088,$0077,$0066
	dc.w	$0055,$0044,$0033,$0022,$0011,$0000 * Cyan
Sprite0

	dc.w    $3842,$3900,$1000,$0000,$3A6D,$3B00,$1000,$0000
	dc.w    $3CA2,$3D00,$1000,$0000,$3E9C,$3F00,$1000,$0000
	dc.w    $40DA,$4100,$1000,$0000,$4243,$4300,$1000,$0000
	dc.w    $445A,$4500,$1000,$0000,$4615,$4700,$1000,$0000
	dc.w    $4845,$4900,$1000,$0000,$4A68,$4B00,$1000,$0000
	dc.w    $4CB8,$4D00,$1000,$0000,$4EB4,$4F00,$1000,$0000
	dc.w    $5082,$5100,$1000,$0000,$5292,$5300,$1000,$0000
	dc.w    $54D0,$5500,$1000,$0000,$56D3,$5700,$1000,$0000
	dc.w    $58F0,$5900,$1000,$0000,$5A6A,$5B00,$1000,$0000
	dc.w    $5CA5,$5D00,$1000,$0000,$5E46,$5F00,$1000,$0000
	dc.w    $606A,$6100,$1000,$0000,$62A0,$6300,$1000,$0000
	dc.w    $64D7,$6500,$1000,$0000,$667C,$6700,$1000,$0000
	dc.w    $68C4,$6900,$1000,$0000,$6AC0,$6B00,$1000,$0000
	dc.w    $6C4A,$6D00,$1000,$0000,$6EDA,$6F00,$1000,$0000
	dc.w    $70D7,$7100,$1000,$0000,$7243,$7300,$1000,$0000
	dc.w    $74A2,$7500,$1000,$0000,$7699,$7700,$1000,$0000
	dc.w    $7872,$7900,$1000,$0000,$7A77,$7B00,$1000,$0000
	dc.w    $7CC2,$7D00,$1000,$0000,$7E56,$7F00,$1000,$0000
	dc.w    $805A,$8100,$1000,$0000,$82CC,$8300,$1000,$0000
	dc.w    $848F,$8500,$1000,$0000,$8688,$8700,$1000,$0000
	dc.w    $88B9,$8900,$1000,$0000,$8AAF,$8B00,$1000,$0000
	dc.w    $8C48,$8D00,$1000,$0000,$8E68,$8F00,$1000,$0000
	dc.w    $90DF,$9100,$1000,$0000,$924F,$9300,$1000,$0000
	dc.w    $9424,$9500,$1000,$0000,$96D7,$9700,$1000,$0000
	dc.w    $9859,$9900,$1000,$0000,$9A4F,$9B00,$1000,$0000
	dc.w    $9C4A,$9D00,$1000,$0000,$9E5C,$9F00,$1000,$0000
	dc.w    $A046,$A100,$1000,$0000,$A2A6,$A300,$1000,$0000
	dc.w    $A423,$A500,$1000,$0000,$A6FA,$A700,$1000,$0000
	dc.w    $A86C,$A900,$1000,$0000,$AA44,$AB00,$1000,$0000
	dc.w    $AC88,$AD00,$1000,$0000,$AE9A,$AF00,$1000,$0000
	dc.w    $B06C,$B100,$1000,$0000,$B2D4,$B300,$1000,$0000
	dc.w    $B42A,$B500,$1000,$0000,$B636,$B700,$1000,$0000
	dc.w    $B875,$B900,$1000,$0000,$BA89,$BB00,$1000,$0000
	dc.w    $BC45,$BD00,$1000,$0000,$BE24,$BF00,$1000,$0000
	dc.w    $C0A3,$C100,$1000,$0000,$C29D,$C300,$1000,$0000		
	dc.w    $C43F,$C500,$1000,$0000,$C634,$C700,$1000,$0000		
	dc.w    $C87C,$C900,$1000,$0000,$CA1D,$CB00,$1000,$0000		
	dc.w    $CC6B,$CD00,$1000,$0000,$CEAC,$CF00,$1000,$0000		
	dc.w    $D0CF,$D100,$1000,$0000,$D2FF,$D300,$1000,$0000		
	dc.w    $D4A5,$D500,$1000,$0000,$D6D6,$D700,$1000,$0000		
	dc.w    $D8EF,$D900,$1000,$0000,$DAE1,$DB00,$1000,$0000		
	dc.w    $DCD9,$DD00,$1000,$0000,$DEA6,$DF00,$1000,$0000		
	dc.w    $E055,$E100,$1000,$0000,$E237,$E300,$1000,$0000		
	dc.w    $E47D,$E500,$1000,$0000,$E62E,$E700,$1000,$0000		
	dc.w    $E8AF,$E900,$1000,$0000,$EA46,$EB00,$1000,$0000
	dc.w	$EC65,$ED00,$1000,$0000,$EE87,$EF00,$1000,$0000
	dc.w	$F0D4,$F100,$1000,$0000,$F2F5,$F300,$1000,$0000
	dc.w	$F4FA,$F500,$1000,$0000,$F62C,$F700,$1000,$0000
	dc.w	$F84D,$F900,$1000,$0000,$FAAC,$FB00,$1000,$0000
	dc.w	$FCB2,$FD00,$1000,$0000,$FE9A,$FF00,$1000,$0000
	dc.w	$009A,$0106,$1000,$0000,$02DF,$0306,$1000,$0000
	dc.w	$0446,$0506,$1000,$0000,$0688,$0706,$1000,$0000
	dc.w	$0899,$0906,$1000,$0000,$0ADD,$0B06,$1000,$0000
	dc.w	$0CEE,$0D06,$1000,$0000
Graphics
Fill
	dc.w	$ffff,$ffff,$ffff,$ffff
Unfill
	dc.w	$0000,$0000,$0000,$0000
Shift_Values
	dc.l	$0,$0,$0,$0,$0,$0,$0,$0,$0,$0	;store addresses of bob
	dc.l	$0,$0,$0,$0,$0,$0,$0,$0,$0,$0
*       first value=fill or not 2nd =+ or - to address 20 bobs          ********
*	           1     2     3     4     5     6     7     8     9     10    11    12    13    14    15    16    17    18    19    20
Values  
	dc.w	1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80
	dc.w	1,-80,1,000,1,000,1,000,1,000,1,000,1,-80,1,-80,0,000,1,-80,1,-80,1,000,1,000,1,000,1,000,1,000,1,-80,1,-80,0,000,1,-80
	dc.w	1,-80,1,000,1,-80,1,-80,1,000,1,-80,1,-80,1,-80,0,080,1,-80,1,-80,1,000,1,-80,1,-80,1,000,1,-80,1,-80,1,-80,0,080,1,-80
	dc.w	1,-80,1,-80,1,-80,1,000,1,000,1,000,1,-80,1,-80,0,000,1,-80,1,-80,1,-80,1,-80,1,000,1,000,1,000,1,-80,1,-80,0,000,1,-80
	dc.w	1,-80,1,000,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,0,000,1,-80,1,-80,1,000,1,-80,1,-80,1,-80,1,-80,1,-80,1,-80,0,000,1,-80
	dc.w	1,-80,1,000,1,000,1,-80,1,000,1,-80,1,-80,1,-80,0,000,1,-80,1,-80,1,000,1,000,1,-80,1,000,1,-80,1,-80,1,-80,0,000,1,-80
	dc.w	1,-80,1,-80,1,-80,1,-80,1,000,1,-80,1,-80,1,-80,0,000,1,-80,1,-80,1,-80,1,-80,1,-80,1,000,1,-80,1,-80,1,-80,0,000,1,-80
	dc.w	1,-80,1,-80,1,000,1,-80,1,-80,1,000,1,-80,1,-80,0,000,0,000,1,-80,1,-80,1,000,1,-80,1,-80,1,000,1,-80,1,-80,0,000,1,-80
	dc.w	1,-80,1,-80,1,-80,1,000,1,-80,1,000,1,-80,0,000,0,000,0,000,1,-80,1,-80,1,-80,1,000,1,-80,1,000,1,-80,0,000,0,000,1,-80
	dc.w	1,-80,1,-80,1,-80,0,000,1,000,1,-80,1,-80,0,080,0,000,0,000,1,-80,1,-80,1,-80,0,000,1,000,1,-80,1,-80,0,080,0,000,1,-80
	dc.w	1,-80,1,-80,1,-80,0,080,1,-80,1,-80,1,-80,0,080,0,000,0,000,1,-80,1,-80,1,-80,0,080,1,-80,1,-80,1,-80,0,080,0,000,1,-80
	dc.w	1,-80,1,-80,1,-80,0,080,1,-80,0,000,1,-80,0,080,0,000,0,000,1,-80,1,-80,1,-80,0,080,1,-80,0,000,1,-80,0,080,0,000,1,-80
	dc.w	1,-80,0,000,1,000,1,000,1,-80,0,080,1,-80,0,080,0,000,0,000,1,-80,0,000,1,000,1,000,1,-80,0,080,1,-80,0,080,0,000,1,-80
	dc.w	1,-80,0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,0,000,0,000,1,-80,0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,0,000,1,-80
	dc.w	1,-80,0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,0,000,0,000,1,-80,0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,0,000,1,-80
	dc.w	1,-80,0,000,1,-80,1,-80,1,-80,0,080,1,-80,0,080,0,000,0,000,1,-80,0,000,1,-80,1,-80,1,-80,0,080,1,-80,0,080,0,000,1,-80
	dc.w	1,-80,0,080,0,000,1,-80,1,-80,0,080,1,-80,0,080,0,000,0,000,1,-80,0,080,0,000,1,-80,1,-80,0,080,1,-80,0,080,0,000,1,-80
	dc.w	1,-80,0,000,0,080,1,-80,1,-80,0,080,0,000,0,000,0,000,0,000,1,-80,0,000,0,080,1,-80,1,-80,0,080,0,000,0,000,0,000,1,-80
	dc.w	1,-80,0,080,0,080,1,-80,1,-80,1,000,0,080,0,000,0,000,0,000,1,-80,0,080,0,080,1,-80,1,-80,1,000,0,080,0,000,0,000,1,-80
	dc.w	1,-80,0,080,1,000,1,-80,0,000,1,-80,0,080,0,000,0,000,0,000,1,-80,0,080,1,000,1,-80,0,000,1,-80,0,080,0,000,0,000,0,000
	dc.w	0,000,1,000,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080,0,000,1,000,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080
	dc.w	0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080,0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080
	dc.w	0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080,0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080
	dc.w	0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080,0,080,1,-80,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080
	dc.w	0,080,0,000,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080,0,080,0,000,1,000,1,-80,0,080,1,-80,0,080,1,-80,1,-80,0,080
	dc.w	0,080,0,080,0,000,0,000,0,080,0,000,0,080,1,-80,1,-80,0,080,0,080,0,080,0,000,0,000,0,080,0,000,0,080,1,-80,1,-80,0,080
	dc.w	0,080,0,080,0,080,0,080,0,080,0,080,0,080,0,000,0,000,0,080,0,080,0,080,0,080,0,080,0,080,0,080,0,080,0,000,0,000,0,080
	dc.w	0,080,0,080,0,000,0,080,0,080,0,000,0,080,0,080,0,000,0,080,0,080,0,080,0,000,0,080,0,080,0,000,0,080,0,080,0,000,0,080
	dc.w	0,080,0,080,0,000,0,080,0,080,0,080,0,080,0,080,0,000,0,000,0,080,0,080,0,000,0,080,0,080,0,080,0,080,0,080,0,000,0,080
	dc.w	0,080,0,080,0,000,0,080,0,000,0,080,0,080,0,080,0,000,0,000,0,080,0,080,0,000,0,080,0,000,0,080,0,080,0,080,0,000,0,080
	dc.w	0,080,0,000,0,080,0,080,0,080,0,080,0,080,0,080,0,080,0,000,0,080,0,000,0,080,0,080,0,080,0,080,0,080,0,080,0,080,0,080
	dc.w	0,080,0,000,0,000,0,080,0,080,0,000,0,080,0,080,0,080,0,000,0,080,0,000,0,000,0,080,0,080,0,000,0,080,0,080,0,080,0,080
	dc.w	0,080,0,080,0,000,0,080,0,080,0,000,0,080,0,080,0,080,0,000,0,080,0,080,0,000,0,080,0,080,0,000,0,080,0,080,0,080,0,080
	dc.w	0,080,0,080,0,000,0,080,0,080,0,000,0,080,0,000,0,080,0,000,0,080,0,080,0,000,0,080,0,080,0,000,0,080,0,000,0,080,0,080
	dc.w	0,080,0,000,0,000,0,080,0,080,0,000,0,080,0,000,0,080,0,000,0,080,0,000,0,000,0,080,0,080,0,000,0,080,0,000,0,080,0,080
R	dc.w	0,$dddd

