start:  clr.l   -(SP)           ;Go into supervisor mode
        move.w  #$20,-(SP)
        trap    #1
        addq.l  #6,SP
        move.l  D0,spv_sp
	move.b	#0,$484

	move.l	#$31415926,$426	;set reset vector valid
	move.l	#myreset,$42a
	move.w	#4,-(sp)
	trap	#14
	addq.l	#2,sp
	move.w	d0,ressave
	move.w	#0,-(sp)	;set to low res
	move.l	#-1,-(sp)
	move.l	#-1,-(sp)
	move.w	#5,-(sp)
	trap	#14
	add.l	#12,sp
*	move.l	#$58000,$436
mx:     equ     $26e0
my:	equ	$26e2
buttondat:	equ     $26e6
bitblt:		equ	$a007
atag:		equ	2
        jsr     mousof
	jsr	joystuff
        jsr     getscrn
	jsr	plotinit
        jsr     linea
        move.w  #10,d0
        jsr     randomseed
	bsr	prestuff
	move.w	#1,pflag
	move.w	#$0f00,pulsecol

	lea	joydir,a0
	jsr	putvbl
	move.l	a1,oldvbl1
	lea	pulsevbl,a0
	jsr	putvbl
	move.l	a1,oldvbl2
veryfirst:
	jsr	darkcolors
	jsr	loadscr
	jsr	copyintoboth
	move.l	#titlepalette,temppal
	jsr	docolors
ftf:
	move.w	#-1,finalflag
	move.l	#10000,emancount
	move.w	#1800,scrolly
	move.w	#3,plusvel
	move.w	#-3,minusvel
	move.w	#-1,firebutton
	move.w	#0,counter
	move.w	#0,drone2c
	move.w	#15,drone1c
	move.w	#30,tailcounter
	move.w	#-1,nomove
	move.w	#207,myx
	move.w	#170,myy
	move.w	#-1,shot1
	move.w	#1,drone1avail
	move.w	#1,drone2avail
	move.w	#0,score
	move.w	#8,ships
	move.w	#1,level
	move.b	#1,numsflag
	move.b	#1,shipsflag
iwait:
	bsr	ramware
*	tst.w	firebutton
*	bmi	iwait
	bsr	cleverclear
	
******************************************
prt1:	
	bsr	clrradar
	move.l	#fileice,fileblocks
	jsr	loadblocks
	bsr	makemap
	move.l	#icepalette,temppal
	jsr	docolors
	move.l	#icedat,levdata
	bsr	putlevstuff
	move.w	#400,scrolly
	move.w	#3,plusvel
	move.w	#-3,minusvel
	move.w	#-1,firebutton
	move.w	#0,counter
	move.w	#0,drone2c
	move.w	#15,drone1c
	move.w	#30,tailcounter
	move.w	#-1,nomove
	move.w	#207,myx
	move.w	#170,myy
	move.w	#-1,shot1
	move.w	#-1,drone1avail
	move.w	#-1,drone2avail
	move.w	#-1,bonus1
	move.w	#-1,bonus2
	move.l	#myat1buffer,masterimage
	move.l	#myat1mask,mastermask
	move.w	#113,xlow
	move.w	#288,xhigh
	move.w	#0,ylow
	move.w	#184,yhigh
	move.w	#-1,mastercount
	move.w	#-1,bat1
	move.w	#-1,bat2
	move.w	#-1,bat3
	move.w	#-1,bat4
	move.w	#-1,bat5
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#200,immortal
	move.w	#-1,onoff
	bsr	atcontrol
	bsr	prepart1
	bra	part1
prt2:
	bsr	cleverclear
	bsr	prechallenge
	bsr	cleverclear
	move.l	#junglepalette,temppal
	jsr	docolors
	bsr	clrradar
	move.l	#jungledat,levdata
	bsr	putlevstuff
	move.l	#filejungle,fileblocks
	jsr	loadblocks
	bsr	makemap
	move.w	#200,scrolly
	move.w	#-1,firebutton
	move.w	#0,counter
	move.w	#-1,nomove
	move.w	#207,myx
	move.w	#170,myy
	move.w	#-1,shot1
	move.w	#-1,bonus1
	move.w	#-1,bonus2
	move.l	#myat1buffer,masterimage
	move.l	#myat1mask,mastermask
	move.w	#113,xlow
	move.w	#288,xhigh
	move.w	#0,ylow
	move.w	#184,yhigh
	move.w	#-1,mastercount
	move.w	#-1,bat1
	move.w	#-1,bat2
	move.w	#-1,bat3
	move.w	#-1,bat4
	move.w	#-1,bat5
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#200,immortal
	move.w	#-1,onoff
	bsr	atcontrol
	bsr	prepart1
	move.l	map,a0
	adda.l	#8640+48,a0
	move.l	a0,ballad
	bra	part2
prt5:
	bsr	cleverclear
	bsr	prechallenge
	bsr	cleverclear
	bsr	clrradar
	move.l	#curvpalette,temppal
	jsr	docolors
	move.l	#aliendat,levdata
	bsr	putlevstuff
	move.l	#filecurv,fileblocks
	jsr	loadblocks
	bsr	makemap
	move.w	#1800,scrolly
	move.w	#-1,firebutton
	move.w	#0,counter
	move.w	#-1,nomove
	move.w	#207,myx
	move.w	#170,myy
	move.w	#-1,shot1
	move.w	#-1,bonus1
	move.w	#-1,bonus2
	move.l	#myat1buffer,masterimage
	move.l	#myat1mask,mastermask
	move.w	#113,xlow
	move.w	#288,xhigh
	move.w	#0,ylow
	move.w	#184,yhigh
	move.w	#-1,mastercount
	move.w	#-1,bat1
	move.w	#-1,bat2
	move.w	#-1,bat3
	move.w	#-1,bat4
	move.w	#-1,bat5
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#200,immortal
	move.w	#-1,onoff
	bsr	atcontrol
	bsr	prepart1
	move.l	map,a0
	adda.l	#7872+40,a0
	move.l	a0,ballad
	bra	part3
prt3:
	bsr	cleverclear
	bsr	prechallenge
	bsr	cleverclear
	bsr	clrradar
	move.l	#doricpalette,temppal
	jsr	docolors
	move.l	#doricdat,levdata
	bsr	putlevstuff
	move.l	#filedoric,fileblocks
	jsr	loadblocks
	bsr	makemap
	move.w	#1800,scrolly
	move.w	#-1,firebutton
	move.w	#0,counter
	move.w	#-1,nomove
	move.w	#207,myx
	move.w	#170,myy
	move.w	#-1,shot1
	move.w	#-1,bonus1
	move.w	#-1,bonus2
	move.l	#myat1buffer,masterimage
	move.l	#myat1mask,mastermask
	move.w	#113,xlow
	move.w	#288,xhigh
	move.w	#0,ylow
	move.w	#184,yhigh
	move.w	#-1,mastercount
	move.w	#-1,bat1
	move.w	#-1,bat2
	move.w	#-1,bat3
	move.w	#-1,bat4
	move.w	#-1,bat5
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#200,immortal
	move.w	#-1,onoff
	bsr	atcontrol
	bsr	prepart1
	move.l	map,a0
	adda.l	#4032+40,a0
	move.l	a0,ballad
	bra	part4

prt6:
	bsr	cleverclear
	bsr	prechallenge
	bsr	cleverclear
	bsr	clrradar
	move.l	#blobspalette,temppal
	jsr	docolors
	move.l	#blobsdat,levdata
	bsr	putlevstuff
	move.l	#fileblobs,fileblocks
	jsr	loadblocks
	bsr	makemap
	move.w	#1800,scrolly
	move.w	#-1,firebutton
	move.w	#0,counter
	move.w	#-1,nomove
	move.w	#207,myx
	move.w	#170,myy
	move.w	#-1,shot1
	move.w	#-1,bonus1
	move.w	#-1,bonus2
	move.l	#myat1buffer,masterimage
	move.l	#myat1mask,mastermask
	move.w	#113,xlow
	move.w	#288,xhigh
	move.w	#0,ylow
	move.w	#184,yhigh
	move.w	#-1,mastercount
	move.w	#-1,bat1
	move.w	#-1,bat2
	move.w	#-1,bat3
	move.w	#-1,bat4
	move.w	#-1,bat5
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#200,immortal
	move.w	#-1,onoff
	bsr	atcontrol
	bsr	prepart1
	move.l	map,a0
	adda.l	#5952+40,a0
	move.l	a0,ballad
	bra	part5

prt4:
	bsr	cleverclear
	bsr	prechallenge
	bsr	cleverclear
	bsr	clrradar
	move.l	#icpalette,temppal
	jsr	docolors
	move.l	#icdat,levdata
	bsr	putlevstuff
	move.l	#fileic,fileblocks
	jsr	loadblocks
	bsr	makemap
	move.w	#1800,scrolly
	move.w	#-1,firebutton
	move.w	#0,counter
	move.w	#-1,nomove
	move.w	#207,myx
	move.w	#170,myy
	move.w	#-1,shot1
	move.w	#-1,bonus1
	move.w	#-1,bonus2
	move.l	#myat1buffer,masterimage
	move.l	#myat1mask,mastermask
	move.w	#113,xlow
	move.w	#288,xhigh
	move.w	#0,ylow
	move.w	#184,yhigh
	move.w	#-1,mastercount
	move.w	#-1,bat1
	move.w	#-1,bat2
	move.w	#-1,bat3
	move.w	#-1,bat4
	move.w	#-1,bat5
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#200,immortal
	move.w	#-1,onoff
	bsr	atcontrol
	bsr	prepart1
	move.l	map,a0
	adda.l	#4704+48,a0
	move.l	a0,ballad
	bra	part6

*********************************
part1:
	jsr	keyboard
	bsr	printscore
	bsr	atcontrol
	bsr	shoothits
	bsr	explosions
	bsr	moveattack
	bsr	movedrones
	bsr	moveme
	bsr	drony
	bsr	shiphits
	bsr	shoot
	jsr	flip_scr
	subq.w	#sspeed,scrolly
	cmpi.w	#0,scrolly
	ble	prepart1end
	tst.w	ships
	beq	veryfirst
	bra	part1

prepart1end:
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#-1,ball1
	move.w	#-1,ball2
	move.w	#-1,ball3
	move.w	#-1,ball4
	move.w	#-1,ball5
	move.w	#127,xlow
	move.w	#274,xhigh
	move.w	#33,ylow
	move.w	#160,appearx
	move.w	#34,appeary
	move.w	#0,counter
	move.l	#myballbuffer,masterimage
	move.l	#myballmask,mastermask
	move.w	#160,barx
	move.w	#24,bary
	move.w	#0,barhits
	move.w	#3920,baroffset
	move.w	#10,mainy
	move.w	#160,mainx
	move.l	map,a0
	adda.l	#192+24,a0
	move.l	a0,ballad

part1end:
	move.w	#0,scrolly
	addq.w	#1,counter
	jsr	keyboard
	bsr	printscore
	bsr	putbars
	bsr	doballs
	bsr	shoothits2
	bsr	ballhits
	bsr	movedrones
	bsr	moveme
	bsr	shoot
	jsr	flip_scr
	tst.w	ships
	beq	veryfirst
	cmpi.w	#80,barhits
	bge	part1boom
	bra	part1end

part1boom:
	add.w	#1000,score
	move.b	#1,numsflag
	bsr	finalboom
	bra	prt2


part2:
	jsr	keyboard
	bsr	printscore
	bsr	atcontrol
	bsr	shoothits
	bsr	explosions
	bsr	moveattack
	bsr	movedrones
	bsr	moveme
	bsr	drony
	bsr	shiphits
	bsr	shoot
	jsr	flip_scr
	subq.w	#sspeed,scrolly
	cmpi.w	#0,scrolly
	ble	prepart2end
	tst.w	ships
	beq	veryfirst
	bra	part2

prepart2end:
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#-1,ball1
	move.w	#-1,ball2
	move.w	#-1,ball3
	move.w	#-1,ball4
	move.w	#-1,ball5
	move.w	#115,xlow
	move.w	#284,xhigh
	move.w	#3,ylow
	move.w	#202,appearx
	move.w	#100,appeary
	move.w	#0,counter
	move.l	#myballbbuffer,masterimage
	move.l	#myballbmask,mastermask
	move.w	#208,barx
	move.w	#107,bary
	move.w	#0,barhits
	move.w	#17224,baroffset
	move.w	#98,mainy
	move.w	#209,mainx
part2end:
	move.w	#0,scrolly
	addq.w	#1,counter
	jsr	keyboard
	bsr	printscore
	bsr	putbars
	bsr	doballs
	bsr	shoothits2
	bsr	ballhits
	bsr	movedrones
	bsr	moveme
	bsr	shoot
	jsr	flip_scr
	tst.w	ships
	beq	veryfirst
	cmpi.w	#80,barhits
	bge	part2boom
	bra	part2end

part2boom:
	add.w	#1000,score
	move.b	#1,numsflag
	bsr	finalboom
	bra	prt3

part3:
	jsr	keyboard
	bsr	printscore
	bsr	atcontrol
	bsr	shoothits
	bsr	explosions
	bsr	moveattack
	bsr	drony
	bsr	movedrones
	bsr	moveme
	bsr	shiphits
	bsr	shoot
	jsr	flip_scr
	subq.w	#sspeed,scrolly
	cmpi.w	#0,scrolly
	ble	prepart3end
	tst.w	ships
	beq	veryfirst
	bra	part3

prepart3end:
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#-1,ball1
	move.w	#-1,ball2
	move.w	#-1,ball3
	move.w	#-1,ball4
	move.w	#-1,ball5
	move.w	#115,xlow
	move.w	#284,xhigh
	move.w	#3,ylow
	move.w	#194,appearx
	move.w	#82,appeary
	move.w	#0,counter
	move.l	#myballbuffer,masterimage
	move.l	#myballmask,mastermask
	move.w	#192,barx
	move.w	#111,bary
	move.w	#0,barhits
	move.w	#17856,baroffset
	move.w	#92,mainy
	move.w	#194,mainx

part3end:
	move.w	#0,scrolly
	addq.w	#1,counter
	jsr	keyboard
	bsr	printscore
	bsr	putbars
	bsr	doballs
	bsr	shoothits2
	bsr	ballhits
	bsr	movedrones
	bsr	moveme
	bsr	shoot
	jsr	flip_scr
	tst.w	ships
	beq	veryfirst
	cmpi.w	#80,barhits
	bge	part3boom
	bra	part3end

part3boom:
	add.w	#1000,score
	move.b	#1,numsflag
	bsr	finalboom
	bra	prt6

part4:
	jsr	keyboard
	bsr	printscore
	bsr	atcontrol
	bsr	shoothits
	bsr	explosions
	bsr	moveattack
	bsr	drony
	bsr	movedrones
	bsr	moveme
	bsr	shiphits
	bsr	shoot
	jsr	flip_scr
	subq.w	#sspeed,scrolly
	cmpi.w	#0,scrolly
	ble	prepart4end
	tst.w	ships
	beq	veryfirst
	bra	part4

prepart4end:
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#-1,ball1
	move.w	#-1,ball2
	move.w	#-1,ball3
	move.w	#-1,ball4
	move.w	#-1,ball5
	move.w	#115,xlow
	move.w	#284,xhigh
	move.w	#75,ylow
	move.w	#184,yhigh
	move.w	#192,appearx
	move.w	#75,appeary
	move.w	#0,counter
	move.l	#myballbuffer,masterimage
	move.l	#myballmask,mastermask
	move.w	#192,barx
	move.w	#66,bary
	move.w	#0,barhits
	move.w	#10656,baroffset
	move.w	#51,mainy
	move.w	#193,mainx

part4end:
	move.w	#0,scrolly
	addq.w	#1,counter
	jsr	keyboard
	bsr	printscore
	bsr	putbars
	bsr	doballs
	bsr	shoothits2
	bsr	ballhits
	bsr	movedrones
	bsr	moveme
	bsr	shoot
	jsr	flip_scr
	tst.w	ships
	beq	veryfirst
	cmpi.w	#80,barhits
	bge	part4boom
	bra	part4end

part4boom:
	add.w	#1000,score
	move.b	#1,numsflag
	bsr	finalboom
	bra	prt4

*************************
part5:
	jsr	keyboard
	bsr	printscore
	bsr	atcontrol
	bsr	shoothits
	bsr	explosions
	bsr	moveattack
	bsr	drony
	bsr	movedrones
	bsr	moveme
	bsr	shiphits
	bsr	shoot
	jsr	flip_scr
	subq.w	#sspeed,scrolly
	cmpi.w	#0,scrolly
	ble	prepart5end
	tst.w	ships
	beq	veryfirst
	bra	part5

prepart5end:
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#-1,ball1
	move.w	#-1,ball2
	move.w	#-1,ball3
	move.w	#-1,ball4
	move.w	#-1,ball5
	move.w	#115,xlow
	move.w	#284,xhigh
	move.w	#7,ylow
	move.w	#184,yhigh
	move.w	#192,appearx
	move.w	#85,appeary
	move.w	#0,counter
	move.l	#myballbuffer,masterimage
	move.l	#myballmask,mastermask
	move.w	#192,barx
	move.w	#85,bary
	move.w	#0,barhits
	move.w	#13696,baroffset
	move.w	#70,mainy
	move.w	#193,mainx

part5end:
	move.w	#0,scrolly
	addq.w	#1,counter
	jsr	keyboard
	bsr	printscore
	bsr	putbars
	bsr	doballs
	bsr	shoothits2
	bsr	ballhits
	bsr	movedrones
	bsr	moveme
	bsr	shoot
	jsr	flip_scr
	cmpi.w	#80,barhits
	bge	part5boom
	tst.w	ships
	beq	veryfirst
	bra	part5end

part5boom:
	add.w	#1000,score
	move.b	#1,numsflag
	bsr	finalboom
	bra	prefinal

*************************
part6:
	jsr	keyboard
	bsr	printscore
	bsr	atcontrol
	bsr	shoothits
	bsr	explosions
	bsr	moveattack
	bsr	drony
	bsr	movedrones
	bsr	moveme
	bsr	shiphits
	bsr	shoot
	jsr	flip_scr
	subq.w	#sspeed,scrolly
	cmpi.w	#0,scrolly
	ble	prepart6end
	tst.w	ships
	beq	veryfirst
	bra	part6

prepart6end:
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#-1,ball1
	move.w	#-1,ball2
	move.w	#-1,ball3
	move.w	#-1,ball4
	move.w	#-1,ball5
	move.w	#115,xlow
	move.w	#284,xhigh
	move.w	#7,ylow
	move.w	#184,yhigh
	move.w	#208,appearx
	move.w	#51,appeary
	move.w	#0,counter
	move.l	#myballbbuffer,masterimage
	move.l	#myballbmask,mastermask
	move.w	#208,barx
	move.w	#73,bary
	move.w	#0,barhits
	move.w	#11784,baroffset
	move.w	#57,mainy
	move.w	#208,mainx

part6end:
	move.w	#0,scrolly
	addq.w	#1,counter
	jsr	keyboard
	bsr	printscore
	bsr	putbars
	bsr	doballs
	bsr	shoothits2
	bsr	ballhits
	bsr	movedrones
	bsr	moveme
	bsr	shoot
	jsr	flip_scr
	cmpi.w	#80,barhits
	bge	part6boom
	tst.w	ships
	beq	veryfirst
	bra	part6end

part6boom:
	add.w	#1000,score
	move.b	#1,numsflag
	bsr	finalboom
	bra	prt5

counter:	blk.w	1,0
*******************************************
prefinal:
	move.w	#1,finalflag
	bsr	cleverclear
	move.l	#finalpalette,temppal
	move.l	#blankdat,levdata
	bsr	putlevstuff
	bsr	docolors
	bsr	loadfinal
	bsr	printfinal
	bsr	flip3
	bsr	flip3
	move.w	#113,xlow
	move.w	#289,xhigh
	move.w	#0,ylow
	move.w	#184,yhigh
	move.w	#148,endx1
	move.w	#73,endy1
	move.w	#267,endx2
	move.w	#73,endy2
	move.w	#201,barx
	move.w	#60,bary
	move.w	#201,mainx
	move.w	#60,mainy
	move.w	#0,barhits
	bsr	lightsound
finalloop:
	bsr	printscore
	bsr	shoothits2
	bsr	lighthits
	bsr	shoot
	bsr	movedrones
	bsr	moveme
	bsr	light
	bsr	keyboard
	bsr	flip3
	cmpi.w	#180,barhits
	bgt	finalend
	bra	finalloop

finalend:
	move.w	#-1,finalflag
	bsr	finalboom2
	bsr	endstory
	bra	veryfirst

************************************************
lighthits:
	tst.w	immortal
	bpl	lhback
	move.w	myx,d0
	move.w	myy,d1
lh1:
	cmp.w	endx1,d0
	blt	lh2
	bra	lhagain
lh2:
	cmp.w	endy1,d1
	blt	lh3
	bra	lhagain
lh3:
	add.w	#16,d0
	add.w	#16,d1
	cmp.w	endx1,d0
	bgt	lh4
	bra	lhagain
lh4:
	cmp.w	endy1,d1
	bgt	lh1b
	bra	lhagain
lh1b:
	bra	meexplode
	rts

lhagain:
	move.w	myx,d0
	move.w	myy,d1

	cmp.w	endx2,d0
	blt	lh2b
	rts
lh2b:
	cmp.w	endy2,d1
	blt	lh3b
	rts
lh3b:
	add.w	#16,d0
	add.w	#16,d1
	cmp.w	endx2,d0
	bgt	lh4b
	rts
lh4b:
	cmp.w	endy2,d1
	bgt	lh1bb
	rts
lh1bb:
	bra	meexplode
lhback:
	rts


printfinal:
	bsr	flip3
	move.l	#finalmess,-(sp)
	move.w	#9,-(sp)
	trap	#1
	addq.l	#6,sp
	bsr	flip3
	move.w	#40,d1
	bsr	cdel
	rts	


finalmess:
	dc.b	27,89,32+13,32+16,'THE FINAL CHALLENGE',0
	dc.b	27,89,32+7,32+19,'CHALLENGE',0
even
*******************************************
sspeed:	equ	1

myreset:
	rts
**********************************************
sboomsound1:
	move.w	#20,sounddelay
	move.l	#sboomdata1,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
	rts
lightsound:
	move.l	#lightdata,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
	rts
sboomsound2:
	move.w	#20,sounddelay
	move.l	#sboomdata2,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
	rts
bonussound:
	move.w	#30,sounddelay
	move.l	#bonusdata,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
	rts
shootsound:
	tst.w	finalflag
	bpl	ssback
	tst.w	sounddelay
	bpl	ssback
	move.l	#shootdata,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
	move.w	#-1,sounddelay
ssback:
	rts
bboomsound:
	tst.w	finalflag
	bpl	sba
	move.l	#bboomdata,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
sba:	rts

lboomsound:
	move.l	#lboomdata,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
	rts
appearsound:
	move.l	#appeardata,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
	rts
chalsound:
	move.l	#chaldata,-(sp)
	move.w	#32,-(sp)
	trap	#14
	addq.l	#6,sp
	rts
sounddelay:
	blk.w	1,0
*******************************
pulsevbl:
	tst.w	pdelay
	bpl	pvblback
	move.w	#3,pdelay
	tst.w	pflag
	bmi	pdown
	add.w	#$0010,pulsecol
	cmpi.w	#$0770,pulsecol
	blt	pvblback
	move.w	#$0770,pulsecol
	move.w	#-1,pflag
	bra	pvblback

pdown:
	sub.w	#$0010,pulsecol
	cmpi.w	#$0700,pulsecol
	bge	pvblback
	move.w	#$0700,pulsecol
	move.w	#1,pflag
	bra	pvblback
	
pvblback:
	subq.w	#1,pdelay
	move.w	pulsecol,$ff825e
	rts

pflag:	blk.w	1,0
pdelay:	blk.w	1,0
levdata:	
	blk.l	1,0

******************************************
putlevstuff:
	move.l	levdata,a0	;get ad of pic data
	move.l	hiden,a1
	add.l	#19208,a1
	move.w	#29,d7
pls1:
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	adda.l	#120,a1		;move to next line
	dbf	d7,pls1

	move.l	levdata,a0	;get ad of pic data
	move.l	seen,a1
	add.l	#19208,a1
	move.w	#29,d7
pls2:
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	adda.l	#120,a1		;move to next line
	dbf	d7,pls2
	rts
***************************************************
prechallenge:
*	move.w	#207,myx
*	move.w	#170,myy
	move.w	#-50000,at1count
	move.w	#-50000,at2count
	move.w	#-50000,at3count
	move.w	#-50000,at4count
	move.w	#-50000,at5count
	move.w	#113,xlow
	move.w	#289,xhigh
	move.w	#0,ylow
	move.w	#184,yhigh
	move.w	#202,appearx
	move.w	#100,appeary
	move.w	#-1,mastercount
	move.l	#myballbbuffer,masterimage
	move.l	#myballbmask,mastermask
	move.w	#120,delaycount
	move.b	#1,numsflag
	move.w	#0,killed
	bsr	randstars
	bsr	atcontrol2
	bsr	printchallenge
	bsr	flip2
	bsr	flip2
	move.w	#0,counter

challenge:
	bsr	clearscroll
	bsr	stars
	bsr	printscore
	bsr	shoothits
	bsr	atcontrol2
	bsr	explosions
	bsr	shoot
	bsr	moveattack2
	bsr	movedrones
	bsr	moveme
	bsr	keyboard
	bsr	flip2
	cmpi.w	#6,counter
	bge	chalback
	bra	challenge
chalback:
	bsr	printstats
	rts
delaycount:
	blk.w	1,0
******************************************
numstars:	equ	20

randstars:
	move.w	#numstars,d7
	subq.w	#1,d7
	lea	x,a3
	lea	y,a4
	lea	speed,a5
fff:
	bsr	mkpoint
	addq.w	#2,a3
	addq.w	#2,a4
	addq.w	#2,a5
	dbf	d7,fff
	rts
********************************
stars:
	move.w	#numstars,d7
	subq.w	#1,d7
	lea	x,a3
	lea	speed,a5
	lea	y,a4
movestars:
	move.w	(a5),d0
	add.w	d0,(a4)
	cmpi.w	#199,(a4)
	ble	ms
	bsr	mkpoint2
ms:	move.w	(a3)+,pixelx
	move.w	(a4)+,pixely
	move.w	(a5)+,d0
	moveq	#4,d1
	sub	d0,d1
	move.w	d1,pixelcolor
	bsr	myplot2
	dbf	d7,movestars
	rts

*************************************
*	expects
*	add of x in a3
*	add of y in a4
*	add of z in a5
**********************************
mkpoint:
	move.w	#191,d0
	bsr	randomplus
	add.w	#112,d0
	move.w	d0,(a3)
	move.w	#200,d0
	bsr	randomplus
	move.w	d0,(a4)
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,(a5)
	rts

mkpoint2:
	move.w	#191,d0
	bsr	randomplus
	add.w	#112,d0
	move.w	d0,(a3)
	move.w	#0,(a4)
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,(a5)
	rts

x:	blk.w	numstars+1,0
y:	blk.w	numstars+1,0
speed:	blk.w	numstars+1,0
******************************************
printchallenge:
	bsr	chalsound
	move.w	#100,d6
pcl:
	bsr	clearscroll
	move.l	#chalmess,-(sp)
	move.w	#9,-(sp)
	trap	#1
	addq.l	#6,sp
	bsr	stars
	bsr	flip2
	dbf	d6,pcl
	rts

cdel:
*	move.w	#15,d1
cda:	
	move.w	#50000,d0
chaldelay:	
	dbf	d0,chaldelay
	dbf	d1,cda
	rts
*******************************************
printstats:
	bsr	chalsound
	move.l	#stat1,-(sp)
	move.w	#9,-(sp)
	trap	#1
	addq.l	#6,sp
	move.l	#stat2,-(sp)
	move.w	#9,-(sp)
	trap	#1
	addq.l	#6,sp
	move.w	killed,number
	bsr	prtnum2
	bsr	flip2
	move.l	#stat1,-(sp)
	move.w	#9,-(sp)
	trap	#1
	addq.l	#6,sp
	move.l	#stat2,-(sp)
	move.w	#9,-(sp)
	trap	#1
	addq.l	#6,sp
	move.w	killed,number
	bsr	prtnum2
*	bsr	flip2

cdel2:	move.w	#65,d1
cda2:	
	move.w	#50000,d0
chaldelay2:	
	dbf	d0,chaldelay2
	dbf	d1,cda2
	rts


stat1:	dc.b	27,89,32+5,32+21,'ATTACKERS'
	dc.b	27,89,32+7,32+19,'RELEASED = 25',0
stat2:	dc.b	27,89,32+11,32+21,'ATTACKERS'
	dc.b	27,89,32+13,32+19,'DESTROYED = ',0


chalmess:
	dc.b	27,98,15,27,99,'0',27,89,42,50,'CHALLENGE STAGE',0
even
killed:	blk.w	1,0
******************************************
clearscroll:
	move.l	hiden,a0
	adda.l	#56,a0
	move.w	#199,d7
	move.l	#0,d0
csloop:
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	move.l	d0,(a0)+
	adda.l	#64,a0
	dbf	d7,csloop
	rts
*********************************
cleverclear:
	move.w	#15,d6
csloopa:
	move.l	seen,a0
	adda.l	#56,a0
	move.w	#199,d7
csloopb:
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+
	lsl.w	(a0)+

	adda.l	#64,a0
	dbf	d7,csloopb
	move.l	#10000,d0
ccl:
	dbf	d0,ccl

	dbf	d6,csloopa
	bsr	clearscroll
	rts

****************************************
prepart1:
	bsr	appearsound
	move.w	#0,scrolly
pp1loop:
	cmpi.w	#1800,scrolly
	bge	pp1back
	add.w	#20,scrolly
	bsr	flip_scr
	bra	pp1loop
pp1back:
	bsr	clrradar
	move.w	#1800,scrolly
	rts
*******************************
putbars:
	cmpi.w	#40,barhits
	bge	pback
	move.l	hiden,a0
	add.w	baroffset,a0
	lea	bars,a1
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
	adda.l	#160,a0
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
	adda.l	#160,a0
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
	adda.l	#160,a0
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
	adda.l	#160,a0
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
	adda.l	#160,a0
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
	adda.l	#160,a0
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
	adda.l	#160,a0
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
	adda.l	#160,a0
	move.l	(a1)+,(a0)
	move.l	(a1)+,4(a0)
pback:	rts

baroffset:
	blk.w	1,0
********************************
finalboom:
	bsr	lboomsound
	move.w	barx,d0
	move.w	bary,d1
	addq.w	#8,d0
	move.w	d0,bat1x
	move.w	d1,bat1y
	move.w	barx,d0
	move.w	bary,d1
	add.w	#30,d0
	sub.w	#30,d1
	move.w	d0,bat2x
	move.w	d1,bat2y
	move.w	barx,d0
	move.w	bary,d1
	add.w	#30,d0
	add.w	#30,d1
	move.w	d0,bat3x
	move.w	d1,bat3y
	move.w	barx,d0
	move.w	bary,d1
	add.w	#30,d1
	sub.w	#30,d0
	move.w	d0,bat4x
	move.w	d1,bat4y
	move.w	barx,d0
	move.w	bary,d1
	sub.w	#30,d0
	sub.w	#30,d1
	move.w	d0,bat5x
	move.w	d1,bat5y
	move.w	#120,bat1
	move.w	#120,bat2
	move.w	#120,bat3
	move.w	#120,bat4
	move.w	#120,bat5
	move.w	#55,counter

fboomloop:
	bsr	explosions2
	bsr	flip_scr
	subq.w	#1,counter
	bmi	fback
	bra	fboomloop
fback:
	rts
*******************************
finalboom2:
	bsr	lboomsound
	move.w	barx,d0
	move.w	bary,d1
	addq.w	#8,d0
	move.w	d0,bat1x
	move.w	d1,bat1y
	move.w	barx,d0
	move.w	bary,d1
	add.w	#30,d0
	sub.w	#30,d1
	move.w	d0,bat2x
	move.w	d1,bat2y
	move.w	barx,d0
	move.w	bary,d1
	add.w	#30,d0
	add.w	#30,d1
	move.w	d0,bat3x
	move.w	d1,bat3y
	move.w	barx,d0
	move.w	bary,d1
	add.w	#30,d1
	sub.w	#30,d0
	move.w	d0,bat4x
	move.w	d1,bat4y
	move.w	barx,d0
	move.w	bary,d1
	sub.w	#30,d0
	sub.w	#30,d1
	move.w	d0,bat5x
	move.w	d1,bat5y
	move.w	#120,bat1
	move.w	#120,bat2
	move.w	#120,bat3
	move.w	#120,bat4
	move.w	#120,bat5
	move.w	#55,counter
*	move.l	sytable,a0
*	move.l	ytable,sytable
*	move.l	a0,ytable
fboomloop2:
	bsr	explosions2
	bsr	flip3
	subq.w	#1,counter
	bmi	fback2
	move.w	#10000,d0
fbl2:	dbf	d0,fbl2	
	bra	fboomloop2

fback2:
*	move.l	sytable,a0
*	move.l	ytable,sytable
*	move.l	a0,ytable
	rts


*******************************
doballs:
	tst.w	ball1
	bpl	moveb1
	cmpi.w	#5,counter
	bne	mb2
	move.w	#1,ball1
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,ball1xvel
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,ball1yvel
	move.w	appearx,ball1x
	move.w	appeary,ball1y
moveb1:
	move.w	ball1y,d1
	move.w	ball1x,d0
	cmp.w	xlow,d0
	bge	m1test1
	neg	ball1xvel
	bra	m1test2
m1test1:
	cmp.w	xhigh,d0
	ble	m1test2
	neg	ball1xvel
m1test2:
	cmp.w	ylow,d1
	bge	m1test3
	neg	ball1yvel
	bra	putb1
m1test3:
	cmpi.w	#185,d1
	ble	putb1
	neg	ball1yvel
putb1:
	move.w	ball1xvel,d0
	move.w	ball1yvel,d1
	add.w	d0,ball1x
	add.w	d1,ball1y
	move.w	ball1y,d1
	move.w	ball1x,d0
	bsr	putballs
mb2:
	tst.w	ball2
	bpl	moveb2
	cmpi.w	#100,counter
	bne	mb3
	move.w	#1,ball2
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,ball2xvel
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,ball2yvel
	move.w	appearx,ball2x
	move.w	appeary,ball2y
moveb2:
	move.w	ball2y,d1
	move.w	ball2x,d0
	cmp.w	xlow,d0
	bge	m2test1
	neg	ball2xvel
	bra	m2test2
m2test1:
	cmp.w	xhigh,d0
	ble	m2test2
	neg	ball2xvel
m2test2:
	cmp.w	ylow,d1
	bge	m2test3
	neg	ball2yvel
	bra	putb2
m2test3:
	cmpi.w	#185,d1
	ble	putb2
	neg	ball2yvel
putb2:
	move.w	ball2xvel,d0
	move.w	ball2yvel,d1
	add.w	d0,ball2x
	add.w	d1,ball2y
	move.w	ball2y,d1
	move.w	ball2x,d0
	bsr	putballs
mb3:
	tst.w	ball3
	bpl	moveb3
	cmpi.w	#300,counter
	bne	mb4
	move.w	#1,ball3
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,ball3xvel
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,ball3yvel
	move.w	appearx,ball3x
	move.w	appeary,ball3y
moveb3:
	move.w	ball3y,d1
	move.w	ball3x,d0
	cmp.w	xlow,d0
	bge	m3test1
	neg	ball3xvel
	bra	m3test2
m3test1:
	cmp.w	xhigh,d0
	ble	m3test2
	neg	ball3xvel
m3test2:
	cmp.w	ylow,d1
	bge	m3test3
	neg	ball3yvel
	bra	putb3
m3test3:
	cmpi.w	#185,d1
	ble	putb3
	neg	ball3yvel
putb3:
	move.w	ball3xvel,d0
	move.w	ball3yvel,d1
	add.w	d0,ball3x
	add.w	d1,ball3y
	move.w	ball3y,d1
	move.w	ball3x,d0
	bsr	putballs

mb4:
	tst.w	ball4
	bpl	moveb4
	cmpi.w	#600,counter
	bne	mb5
	move.w	#1,ball4
	move.w	#3,d0
	bsr	randomplus
	neg.w	d0
	subq.w	#1,d0
	move.w	d0,ball4xvel
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,ball4yvel
	move.w	appearx,ball4x
	move.w	appeary,ball4y
moveb4:
	move.w	ball4y,d1
	move.w	ball4x,d0
	cmp.w	xlow,d0
	bge	m4test1
	neg	ball4xvel
	bra	m4test2
m4test1:
	cmp.w	xhigh,d0
	ble	m4test2
	neg	ball4xvel
m4test2:
	cmp.w	ylow,d1
	bge	m4test3
	neg	ball4yvel
	bra	putb4
m4test3:
	cmpi.w	#185,d1
	ble	putb4
	neg	ball4yvel
putb4:
	move.w	ball4xvel,d0
	move.w	ball4yvel,d1
	add.w	d0,ball4x
	add.w	d1,ball4y
	move.w	ball4y,d1
	move.w	ball4x,d0
	bsr	putballs


mb5:	tst.w	ball5
	bpl	moveb5
	cmpi.w	#900,counter
	bne	mb6
	move.w	#1,ball5
	move.w	#3,d0
	bsr	randomplus
	neg.w	d0
	subq.w	#1,d0
	move.w	d0,ball5xvel
	move.w	#3,d0
	bsr	randomplus
	addq.w	#1,d0
	move.w	d0,ball5yvel
	move.w	appearx,ball5x
	move.w	appeary,ball5y
moveb5:
	move.w	ball5y,d1
	move.w	ball5x,d0
	cmp.w	xlow,d0
	bge	m5test1
	neg	ball5xvel
	bra	m5test2
m5test1:
	cmp.w	xhigh,d0
	ble	m5test2
	neg	ball5xvel
m5test2:
	cmp.w	ylow,d1
	bge	m5test3
	neg	ball5yvel
	bra	putb5
m5test3:
	cmpi.w	#185,d1
	ble	putb5
	neg	ball5yvel
putb5:
	move.w	ball5xvel,d0
	move.w	ball5yvel,d1
	add.w	d0,ball5x
	add.w	d1,ball5y
	move.w	ball5y,d1
	move.w	ball5x,d0
	bsr	putballs

mb6:	rts


putballs:

	move.l	masterimage,a0
	move.w	d0,d2		;get copy of x
	and.w	#15,d0		;last 4 bits is offset
	move.w	d0,d3
	mulu	#240,d0
	adda.w	d0,a0		;now pointing at correct image
	move.l	a0,imageptr
	move.l	mastermask,a0
	asr.w	#1,d0
	adda.w	d0,a0
	move.l	a0,maskptr
	move.l	hiden,a0
	lsl.w	#5,d1		;mult y by 128
	adda.w	d1,a0		;add it to screen address
	lsl.w	#2,d1		;mult by 32 makes mult by 160
	add.w	d1,a0
	and.w	#$fff0,d2	;mask off last 4 bits gives word across
	lsr.w	#1,d2
	adda.w	d2,a0
	move.l	a0,screenloc
	move.w	#1,width
	move.w	#15,height
	bsr	pdrawimage
	rts

ball1:	blk.w	1,0
ball1x:	blk.w	1,0
ball1y:	blk.w	1,0
ball1xvel:
	blk.w	1,0
ball1yvel:
	blk.w	1,0
ball2:	blk.w	1,0
ball2x:	blk.w	1,0
ball2y:	blk.w	1,0
ball2xvel:
	blk.w	1,0
ball2yvel:
	blk.w	1,0
ball3:	blk.w	1,0
ball3x:	blk.w	1,0
ball3y:	blk.w	1,0
ball3xvel:
	blk.w	1,0
ball3yvel:
	blk.w	1,0
ball4:	blk.w	1,0
ball4x:	blk.w	1,0
ball4y:	blk.w	1,0
ball4xvel:
	blk.w	1,0
ball4yvel:
	blk.w	1,0
ball5:	blk.w	1,0
ball5x:	blk.w	1,0
ball5y:	blk.w	1,0
ball5xvel:
	blk.w	1,0
ball5yvel:
	blk.w	1,0
appearx:	
	blk.w	1,0
appeary:
	blk.w	1,0
**********************************************

*******************************
explosions:
	move.w	#1,pixelcolor
	tst.w	bat1
	bmi	exp2
	move.w	#60,d0
	sub.w	bat1,d0
	subq.w	#4,bat1
	move.w	bat1x,d6
	move.w	bat1y,d7
	bsr	explogen

exp2:
	tst.w	bat2
	bmi	exp3
	move.w	#60,d0
	sub.w	bat2,d0
	subq.w	#4,bat2
	move.w	bat2x,d6
	move.w	bat2y,d7
	bsr	explogen
exp3:
	tst.w	bat3
	bmi	exp4
	move.w	#60,d0
	sub.w	bat3,d0
	subq.w	#4,bat3
	move.w	bat3x,d6
	move.w	bat3y,d7
	bsr	explogen
exp4:
	tst.w	bat4
	bmi	exp5
	move.w	#60,d0
	sub.w	bat4,d0
	subq.w	#4,bat4
	move.w	bat4x,d6
	move.w	bat4y,d7
	bsr	explogen
exp5:
	tst.w	bat5
	bmi	exp6
	move.w	#60,d0
	sub.w	bat5,d0
	subq.w	#4,bat5
	move.w	bat5x,d6
	move.w	bat5y,d7
	bsr	explogen

exp6:
	rts

explogen:
	move.w	d6,d1
	move.w	d7,d2
	sub.w	d0,d2
	move.w	d1,pixelx
	move.w	d2,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot

	move.w	d6,d1
	move.w	d7,d2
	sub.w	d0,d2
	add.w	d0,d1
	move.w	d1,pixelx
	move.w	d2,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot

	move.w	d6,d1
	move.w	d7,d2
	add.w	d0,d1
	move.w	d1,pixelx
	move.w	d2,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot

	move.w	d6,d1
	move.w	d7,d2
	add.w	d0,d2
	add.w	d0,d1
	move.w	d1,pixelx
	move.w	d2,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot

	move.w	d6,d1
	move.w	d7,d2
	add.w	d0,d2
	move.w	d1,pixelx
	move.w	d2,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot

	move.w	d6,d1
	move.w	d7,d2
	sub.w	d0,d1
	add.w	d0,d2
	move.w	d1,pixelx
	move.w	d2,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot

	move.w	d6,d1
	move.w	d7,d2
	sub.w	d0,d1
	move.w	d1,pixelx
	move.w	d2,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot

	move.w	d6,d1
	move.w	d7,d2
	sub.w	d0,d2
	sub.w	d0,d1
	move.w	d1,pixelx
	move.w	d2,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot
	rts

explosions2:
	move.w	#1,pixelcolor
	tst.w	bat1
	bmi	bexp2
	move.w	#120,d0
	sub.w	bat1,d0
	move.w	bat1x,d6
	move.w	bat1y,d7
	bsr	explogen
	subq.w	#2,bat1
	bpl	bexp2
	move.w	#120,bat1
bexp2:
	tst.w	bat2
	bmi	bexp3
	move.w	#120,d0
	sub.w	bat2,d0
	move.w	bat2x,d6
	move.w	bat2y,d7
	bsr	explogen
	subq.w	#2,bat2
	bpl	bexp3
	move.w	#120,bat2

bexp3:
	tst.w	bat3
	bmi	bexp4
	move.w	#120,d0
	sub.w	bat3,d0
	move.w	bat3x,d6
	move.w	bat3y,d7
	bsr	explogen
	subq.w	#2,bat3
	bpl	bexp4
	move.w	#120,bat3

bexp4:
	tst.w	bat4
	bmi	bexp5
	move.w	#120,d0
	sub.w	bat4,d0
	move.w	bat4x,d6
	move.w	bat4y,d7
	bsr	explogen
	subq.w	#2,bat4
	bpl	bexp5
	move.w	#120,bat4

bexp5:
	tst.w	bat5
	bmi	bexp6
	move.w	#120,d0
	sub.w	bat5,d0
	move.w	bat5x,d6
	move.w	bat5y,d7
	bsr	explogen
	subq.w	#2,bat5
	bpl	bexp6
	move.w	#120,bat5

bexp6:
	rts

*******************************
atcontrol:
	tst.w	mastercount
	bpl	atcback
	move.w	#4,d0
	bsr	randomplus
	asl.w	#2,d0
	lea	imlist,a0
	move.l	(a0,d0.w),masterimage
	lea	malist,a0
	move.l	(a0,d0.w),mastermask
	move.w	#5,d0
	bsr	randomplus
	move.w	d0,d7
	asl.w	#2,d0
	lea	spatlist,a0
	move.l	(a0,d0.w),a0
	lea	numlist,a1
	asl.w	#1,d7
	move.w	(a1,d7.w),d7

	move.l	a0,at1pat
	move.w	#-1,at1count
	move.w	d7,at1maxcount

	move.l	a0,at2pat
	move.w	#-1,at2count
	move.w	d7,at2maxcount

	move.l	a0,at3pat
	move.w	#-1,at3count
	move.w	d7,at3maxcount

	move.l	a0,at4pat
	move.w	#-1,at4count
	move.w	d7,at4maxcount

	move.l	a0,at5pat
	move.w	#-1,at5count
	move.w	d7,at5maxcount
	move.w	#4,mastercount
	rts
	

atcback:
	rts

spatlist:
	dc.l	spat1,spat3,spat4
	dc.l	spat5,spat6
numlist:
	dc.w	53,34,103,118,89

imlist:
	dc.l	myat1buffer
	dc.l	myat2buffer
	dc.l	myat3buffer
	dc.l	myat4buffer
malist:
	dc.l	myat1mask
	dc.l	myat2mask
	dc.l	myat3mask
	dc.l	myat4mask
mastercount:
	blk.w	1,0

at1count:	blk.w	1,0
at1maxcount:	blk.w	1,0
at1pat:		blk.l	1,0
at1x:		blk.w	1,0
at1y:		blk.w	1,0
aat1x:		blk.w	1,0
aat1y:		blk.w	1,0
at2count:	blk.w	1,0
at2maxcount:	blk.w	1,0
at2pat:		blk.l	1,0
at2x:		blk.w	1,0
at2y:		blk.w	1,0
aat2x:		blk.w	1,0
aat2y:		blk.w	1,0
at3count:	blk.w	1,0
at3maxcount:	blk.w	1,0
at3pat:		blk.l	1,0
at3x:		blk.w	1,0
at3y:		blk.w	1,0
aat3x:		blk.w	1,0
aat3y:		blk.w	1,0
at4count:	blk.w	1,0
at4maxcount:	blk.w	1,0
at4pat:		blk.l	1,0
at4x:		blk.w	1,0
at4y:		blk.w	1,0
aat4x:		blk.w	1,0
aat4y:		blk.w	1,0
at5count:	blk.w	1,0
at5maxcount:	blk.w	1,0
at5pat:		blk.l	1,0
at5x:		blk.w	1,0
at5y:		blk.w	1,0
aat5x:		blk.w	1,0
aat5y:		blk.w	1,0
atdelay:	blk.w	1,0
*********************************************
atcontrol2:
	subq.w	#1,delaycount
	tst.w	delaycount
	bpl	atcback2
	move.w	#-1,delaycount
	tst.w	mastercount
	bpl	atcback2
	move.w	#100,delaycount
	move.w	#4,d0
	bsr	randomplus
	asl.w	#2,d0
	lea	imlist,a0
	move.l	(a0,d0.w),masterimage
	lea	malist,a0
	move.l	(a0,d0.w),mastermask
	move.w	#6,d0
	bsr	randomplus
	move.w	d0,d7
	asl.w	#2,d0
	lea	bonuslist,a0
	move.l	(a0,d0.w),a0
	lea	bnumlist,a1
	asl.w	#1,d7
	move.w	(a1,d7.w),d7

	move.l	a0,at1pat
	move.w	#0,at1count
	move.w	d7,at1maxcount

	move.l	a0,at2pat
	move.w	#-10,at2count
	move.w	d7,at2maxcount

	move.l	a0,at3pat
	move.w	#-20,at3count
	move.w	d7,at3maxcount

	move.l	a0,at4pat
	move.w	#-30,at4count
	move.w	d7,at4maxcount

	move.l	a0,at5pat
	move.w	#-40,at5count
	move.w	d7,at5maxcount

	move.w	#4,mastercount
	addq.w	#1,counter
	rts

atcback2:

	rts
bonuslist:
	dc.l	bonuspat1,bonuspat2,bonuspat3
	dc.l	bonuspat4,bonuspat5,bonuspat6
bnumlist:
	dc.w	92,87,101,99,103,88
	
******************************
moveattack:
	tst.w	at1count
	bpl	ma1
	move.w	#100,d0
	bsr	randomplus
	cmpi.w	#atag,d0
	bge	mat2
	move.w	#191,d0
	bsr	randomplus
	add.w	#113,d0
	move.w	d0,at1x
	move.w	#0,at1y
ma1:
	move.l	at1pat,a0
	addq.w	#1,at1count
	move.w	at1count,d7
	cmp.w	at1maxcount,d7
	blt	mma1
	move.w	#0,at1count
	move.w	at1count,d7
mma1:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	sub.w	#163,d0
	sub.w	#50,d1
	addq.w	#1,at1y
	add.w	at1x,d0
	add.w	at1y,d1
	move.w	d0,aat1x
	move.w	d1,aat1y
	cmpi.w	#113,d0
	blt	mat2
	cmpi.w	#293,d0
	bgt	mat2
	tst.w	d1
	bmi	mat2
	cmpi.w	#188,d1
	bge	ma1a
	bsr	putattacker
	bra	mat2
ma1a:	move.w	#-30000,at1count
	subq.w	#1,mastercount
	move.w	#0,at1y
mat2:
	tst.w	at2count
	bpl	ma2
	move.w	#100,d0
	bsr	randomplus
	cmpi.w	#atag,d0
	bge	mat3
	move.w	#191,d0
	bsr	randomplus
	add.w	#113,d0
	move.w	d0,at2x
	move.w	#0,at2y

ma2:
	move.l	at2pat,a0
	addq.w	#1,at2count
	move.w	at2count,d7
	cmp.w	at2maxcount,d7
	blt	mma2
	move.w	#0,at2count
	move.w	at2count,d7
mma2:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	sub.w	#163,d0
	sub.w	#50,d1
	addq.w	#1,at2y
	add.w	at2x,d0
	add.w	at2y,d1
	move.w	d0,aat2x
	move.w	d1,aat2y
	cmpi.w	#113,d0
	blt	mat3
	cmpi.w	#293,d0
	bgt	mat3
	tst.w	d1
	bmi	mat3
	cmpi.w	#188,d1
	bge	ma2a
	bsr	putattacker
	bra	mat3
ma2a:	move.w	#-30000,at2count
	subq.w	#1,mastercount
	move.w	#0,at2y

mat3:
	tst.w	at3count
	bpl	ma3
	move.w	#100,d0
	bsr	randomplus
	cmpi.w	#atag,d0
	bge	mat4
	move.w	#191,d0
	bsr	randomplus
	add.w	#113,d0
	move.w	d0,at3x
	move.w	#0,at3y
ma3:
	move.l	at3pat,a0
	addq.w	#1,at3count
	move.w	at3count,d7
	cmp.w	at3maxcount,d7
	blt	mma3
	move.w	#0,at3count
	move.w	at3count,d7
mma3:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	sub.w	#163,d0
	sub.w	#50,d1
	addq.w	#1,at3y
	add.w	at3x,d0
	add.w	at3y,d1
	move.w	d0,aat3x
	move.w	d1,aat3y
	cmpi.w	#113,d0
	blt	mat4
	cmpi.w	#293,d0
	bgt	mat4
	tst.w	d1
	bmi	mat4
	cmpi.w	#188,d1
	bge	ma3a
	bsr	putattacker
	bra	mat4
ma3a:	move.w	#-30000,at3count
	subq.w	#1,mastercount
	move.w	#0,at3y


mat4:
	tst.w	at4count
	bpl	ma4
	move.w	#100,d0
	bsr	randomplus
	cmpi.w	#atag,d0
	bge	mat5
	move.w	#191,d0
	bsr	randomplus
	add.w	#113,d0
	move.w	d0,at4x
	move.w	#0,at4y
ma4:
	move.l	at4pat,a0
	addq.w	#1,at4count
	move.w	at4count,d7
	cmp.w	at4maxcount,d7
	blt	mma4
	move.w	#0,at4count
	move.w	at4count,d7
mma4:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	sub.w	#163,d0
	sub.w	#50,d1
	addq.w	#1,at4y
	add.w	at4x,d0
	add.w	at4y,d1
	move.w	d0,aat4x
	move.w	d1,aat4y
	cmpi.w	#113,d0
	blt	mat5
	cmpi.w	#293,d0
	bgt	mat5
	tst.w	d1
	bmi	mat5
	cmpi.w	#188,d1
	bge	ma4a
	bsr	putattacker
	bra	mat5
ma4a:	move.w	#-30000,at4count
	subq.w	#1,mastercount
	move.w	#0,at4y

mat5:
	tst.w	at5count
	bpl	ma5
	move.w	#100,d0
	bsr	randomplus
	cmpi.w	#atag,d0
	bge	mat6
	move.w	#191,d0
	bsr	randomplus
	add.w	#113,d0
	move.w	d0,at5x
	move.w	#0,at5y
ma5:
	move.l	at5pat,a0
	addq.w	#1,at5count
	move.w	at5count,d7
	cmp.w	at5maxcount,d7
	blt	mma5
	move.w	#0,at5count
	move.w	at5count,d7
mma5:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	sub.w	#163,d0
	sub.w	#50,d1
	addq.w	#1,at5y
	add.w	at5x,d0
	add.w	at5y,d1
	move.w	d0,aat5x
	move.w	d1,aat5y
	cmpi.w	#113,d0
	blt	mat6
	cmpi.w	#293,d0
	bgt	mat6
	tst.w	d1
	bmi	mat6
	cmpi.w	#188,d1
	bge	ma5a
	bsr	putattacker
	bra	mat6
ma5a:	move.w	#-30000,at5count
	subq.w	#1,mastercount
	move.w	#0,at5y

mat6:
	rts


*	y in d1
*	x in d0

putattacker:
	move.l	#0,d3
	move.l	masterimage,a0
	move.w	d0,d2		;get copy of x
	and.w	#15,d0		;last 4 bits is offset
	move.w	d0,d3
	mulu	#176,d0
	adda.w	d0,a0		;now pointing at correct image
	move.l	a0,imageptr
	move.l	mastermask,a0
	asr.w	#1,d0
	adda.w	d0,a0
	move.l	a0,maskptr
	move.l	hiden,a0
	lsl.w	#5,d1		;mult y by 128
	adda.w	d1,a0		;add it to screen address
	lsl.w	#2,d1		;mult by 32 makes mult by 160
	add.w	d1,a0
	and.w	#$fff0,d2	;mask off last 4 bits gives word across
	lsr.w	#1,d2
	adda.w	d2,a0
	move.l	a0,screenloc
	move.w	#1,width
	move.w	#11,height
	bsr	pdrawimage
	rts

masterimage:
	blk.l	1,0
mastermask:
	blk.l	1,0
tempx:	blk.w	1,0
tempy:	blk.w	1,0
**********************************************
moveattack2:
	tst.w	delaycount
	bpl	xmat6
	tst.w	at1count
	bpl	xma1
	addq.w	#1,at1count
	bra	xmat2
xma1:
	move.l	at1pat,a0
	addq.w	#1,at1count
	move.w	at1count,d7
	cmp.w	at1maxcount,d7
	blt	xmma1
	subq.w	#1,mastercount
	move.w	#-10000,at1count
xmma1:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	move.w	d0,at1x
	move.w	d1,at1y
	move.w	d0,aat1x
	move.w	d1,aat1y
	bsr	putattacker

xmat2:	tst.w	at2count
	bpl	xma2
	addq.w	#1,at2count
	bra	xmat3
xma2:
	move.l	at2pat,a0
	addq.w	#1,at2count
	move.w	at2count,d7
	cmp.w	at2maxcount,d7
	blt	xmma2
	subq.w	#1,mastercount
	move.w	#-10000,at2count
xmma2:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	move.w	d0,at2x
	move.w	d1,at2y
	move.w	d0,aat2x
	move.w	d1,aat2y
	bsr	putattacker

xmat3:	tst.w	at3count
	bpl	xma3
	addq.w	#1,at3count
	bra	xmat4
xma3:
	move.l	at3pat,a0
	addq.w	#1,at3count
	move.w	at3count,d7
	cmp.w	at3maxcount,d7
	blt	xmma3
	subq.w	#1,mastercount
	move.w	#-10000,at3count
xmma3:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	move.w	d0,at3x
	move.w	d1,at3y
	move.w	d0,aat3x
	move.w	d1,aat3y
	bsr	putattacker

xmat4:	tst.w	at4count
	bpl	xma4
	addq.w	#1,at4count
	bra	xmat5
xma4:
	move.l	at4pat,a0
	addq.w	#1,at4count
	move.w	at4count,d7
	cmp.w	at4maxcount,d7
	blt	xmma4
	subq.w	#1,mastercount
	move.w	#-10000,at4count
xmma4:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	move.w	d0,at4x
	move.w	d1,at4y
	move.w	d0,aat4x
	move.w	d1,aat4y
	bsr	putattacker

xmat5:	tst.w	at5count
	bpl	xma5
	addq.w	#1,at5count
	bra	xmat6
xma5:
	move.l	at5pat,a0
	addq.w	#1,at5count
	move.w	at5count,d7
	cmp.w	at5maxcount,d7
	blt	xmma5
	subq.w	#1,mastercount
	move.w	#-10000,at5count
xmma5:
	move.l	#0,d0
	move.l	#0,d1
	asl.w	#2,d7
	move.w	(a0,d7.w),d0
	move.w	2(a0,d7.w),d1
	move.w	d0,at5x
	move.w	d1,at5y
	move.w	d0,aat5x
	move.w	d1,aat5y
	bsr	putattacker
xmat6:
	rts

******************************
drony:
	tst.w	drone1avail
	bpl	drony2
	tst.w	bonus1
	bpl	bonusmove
	move.w	#1000,d0
	jsr	randomplus
	cmpi.w	#3,d0
	bge	bm3
	move.w	#1,bonus1
	move.w	#0,bonus1y
	move.w	#177,d0
	jsr	randomplus
	addi.w	#112,d0
	move.w	d0,bonus1x
	bra	bonusmove

drony2:
	tst.w	drone2avail
	bpl	bm3
	tst.w	bonus2
	bpl	bonusmove2
	move.w	#1000,d0
	jsr	randomplus
	cmpi.w	#2,d0
	bge	bm3
	move.w	#1,bonus2
	move.w	#0,bonus2y
	move.w	#177,d0
	jsr	randomplus
	addi.w	#112,d0
	move.w	d0,bonus2x
	bra	bonusmove2

bonusmove:
	move.w	myx,d0
	move.w	myy,d1
	sub.w	#11,d0
	sub.w	#11,d1
	cmp.w	bonus1x,d0
	bgt	bma
	cmp.w	bonus1y,d1
	bgt	bma
	add.w	#26,d0
	add.w	#26,d1
	cmp.w	bonus1x,d0
	blt	bma
	cmp.w	bonus1y,d1
	blt	bma
	bsr	bonussound
	move.w	#-1,nomove
	move.w	#-1,bonus1
	move.w	#1,drone1avail
	move.w	tailcounter,d0
	subi.w	#15,d0
	tst.w	d0
	bmi	bmab
	move.w	d0,drone1c
	bra	bma
bmab:	add.w	#60,d0
	move.w	d0,drone1c
bma:
	move.l  #0,d0
	move.l  #0,d1
	addq.w	#2,bonus1y
	move.w	bonus1x,d0
	move.w	bonus1y,d1
	cmpi.w	#187,d1
	ble	dobm1
	move.w	#-1,bonus1
dobm1:	bsr	putbonus
	rts


bonusmove2:
	move.w	myx,d0
	move.w	myy,d1
	sub.w	#11,d0
	sub.w	#11,d1
	cmp.w	bonus2x,d0
	bgt	bmb
	cmp.w	bonus2y,d1
	bgt	bmb
	add.w	#26,d0
	add.w	#26,d1
	cmp.w	bonus2x,d0
	blt	bmb
	cmp.w	bonus2y,d1
	blt	bmb
	bsr	bonussound
	move.w	#-1,nomove
	move.w	#-1,bonus2
	move.w	#1,drone2avail
	move.w	drone1c,d0
	subi.w	#15,d0
	tst.w	d0
	bmi	bmbb
	move.w	d0,drone2c
	bra	bmb
bmbb:	add.w	#60,d0
	move.w	d0,drone2c
bmb:
	move.l  #0,d0
	move.l  #0,d1
	addq.w	#2,bonus2y
	move.w	bonus2x,d0
	move.w	bonus2y,d1
	cmpi.w	#187,d1
	ble	dobm2
	move.w	#-1,bonus2
dobm2:	bsr	putbonus
bm3:
	rts

putbonus:
	move.l	#mybonusbuffer,a0
	move.w	d0,d2		;get copy of x
	and.w	#15,d0		;last 4 bits is offset
	move.w	d0,d3
	mulu	#176,d0
	adda.w	d0,a0		;now pointing at correct image
	move.l	a0,imageptr
	move.l	#mybonusmask,a0
	asr.w	#1,d0
	adda.w	d0,a0
	move.l	a0,maskptr
	move.l	hiden,a0
	lsl.w	#5,d1		;mult y by 128
	adda.w	d1,a0		;add it to screen address
	lsl.w	#2,d1		;mult by 32 makes mult by 160
	adda.w	d1,a0
	and.w	#$fff0,d2	;mask off last 4 bits gives word across
	lsr.w	#1,d2
	adda.w	d2,a0
	move.l	a0,screenloc
	move.w	#1,width
	move.w	#11,height
	bsr	pdrawimage
	rts

bonus1:	blk.w	1,0
bonus1x:
	blk.w	1,0
bonus1y:
	blk.w	1,0
bonus2:	blk.w	1,0
bonus2x:
	blk.w	1,0
bonus2y:
	blk.w	1,0

********************************
shoothits:
	tst.w	shot1
	bmi	shits2
	move.w	shot1x,d0
	move.w	shot1y,d1
	bsr	athits
	tst.w	wasahit
	bpl	s1hit	
	move.l	ptsin,a0
	move.w	shot1x,(a0)
	move.w	shot1y,2(a0)
	dc.w	getpix
	tst.w	d0
	beq	shits2
	cmpi.w	#3,d0
	ble	s1hit
	cmpi.w	#7,d0
	blt	shits2
	cmpi.w	#12,d0
	bgt	shits2
s1hit:
	move.w	#-1,shot1

shits2:
	tst.w	shot2
	bmi	shits3
	move.w	shot2x,d0
	move.w	shot2y,d1
	bsr	athits
	tst.w	wasahit
	bpl	s2hit	
	move.l	ptsin,a0
	move.w	shot2x,(a0)
	move.w	shot2y,2(a0)
	dc.w	getpix
	tst.w	d0
	beq	shits3
	cmpi.w	#3,d0
	ble	s2hit
	cmpi.w	#7,d0
	blt	shits3
	cmpi.w	#12,d0
	bgt	shits3
s2hit:
	move.w	#-1,shot2

shits3:
	tst.w	shot3
	bmi	shits4
	move.w	shot2x,d0
	move.w	shot2y,d1
	bsr	athits
	tst.w	wasahit
	bpl	s3hit	
	move.l	ptsin,a0
	move.w	shot3x,(a0)
	move.w	shot3y,2(a0)
	dc.w	getpix
	tst.w	d0
	beq	shits4
	cmpi.w	#3,d0
	ble	s3hit
	cmpi.w	#7,d0
	blt	shits4
	cmpi.w	#12,d0
	bgt	shits4
s3hit:
	move.w	#-1,shot3

shits4:
	rts
****************************************************
athits:
	tst.w	at1count
	bmi	ath2
	move.w	aat1x,d2
	move.w	aat1y,d3
	cmp.w	d2,d0
	blt	ath2
	cmp.w	d3,d1
	blt	ath2
	add.w	#11,d2
	add.w	#11,d3
	cmp.w	d2,d0
	bgt	ath2
	cmp.w	d3,d1
	bgt	ath2
	move.w	#1,wasahit
tbp:	move.w	#-30000,at1count
	subq.w	#1,mastercount
	move.w	aat1x,bat1x
	move.w	aat1y,bat1y
	move.w	#0,aat1x
	move.w	#0,aat1y
	move.w	#60,bat1
	move.b	#1,numsflag
	add.w	#150,score
	addq.w	#1,killed
	bsr	sboomsound1
	rts

ath2:
	tst.w	at2count
	bmi	ath3
	move.w	aat2x,d2
	move.w	aat2y,d3
	cmp.w	d2,d0
	blt	ath3
	cmp.w	d3,d1
	blt	ath3
	add.w	#11,d2
	add.w	#11,d3
	cmp.w	d2,d0
	bgt	ath3
	cmp.w	d3,d1
	bgt	ath3
	move.w	#1,wasahit
	move.w	#-30000,at2count
	subq.w	#1,mastercount
	move.w	aat2x,bat2x
	move.w	aat2y,bat2y
	move.w	#0,aat2x
	move.w	#0,aat2y
	move.w	#60,bat2
	move.b	#1,numsflag
	add.w	#150,score
	addq.w	#1,killed
	bsr	sboomsound2
	rts
ath3:
	tst.w	at3count
	bmi	ath4
	move.w	aat3x,d2
	move.w	aat3y,d3
	cmp.w	d2,d0
	blt	ath4
	cmp.w	d3,d1
	blt	ath4
	add.w	#11,d2
	add.w	#11,d3
	cmp.w	d2,d0
	bgt	ath4
	cmp.w	d3,d1
	bgt	ath4
	move.w	#1,wasahit
	move.w	#-30000,at3count
	subq.w	#1,mastercount
	move.w	aat3x,bat3x
	move.w	aat3y,bat3y
	move.w	#0,aat3x
	move.w	#0,aat3y
	move.w	#60,bat3
	move.b	#1,numsflag
	add.w	#150,score
	addq.w	#1,killed
	bsr	sboomsound1
	rts
ath4:
	tst.w	at4count
	bmi	ath5
	move.w	aat4x,d2
	move.w	aat4y,d3
	cmp.w	d2,d0
	blt	ath5
	cmp.w	d3,d1
	blt	ath5
	add.w	#11,d2
	add.w	#11,d3
	cmp.w	d2,d0
	bgt	ath5
	cmp.w	d3,d1
	bgt	ath5
	move.w	#1,wasahit
	move.w	#-30000,at4count
	subq.w	#1,mastercount
	move.w	aat4x,bat4x
	move.w	aat4y,bat4y
	move.w	#0,aat4x
	move.w	#0,aat4y
	move.w	#60,bat4
	move.b	#1,numsflag
	add.w	#150,score
	addq.w	#1,killed
	bsr	sboomsound2
	rts
ath5:
	tst.w	at5count
	bmi	ath6
	move.w	aat5x,d2
	move.w	aat5y,d3
	cmp.w	d2,d0
	blt	ath6
	cmp.w	d3,d1
	blt	ath6
	add.w	#11,d2
	add.w	#11,d3
	cmp.w	d2,d0
	bgt	ath6
	cmp.w	d3,d1
	bgt	ath6
	move.w	#1,wasahit
	move.w	#-30000,at5count
	subq.w	#1,mastercount
	move.w	aat5x,bat5x
	move.w	aat5y,bat5y
	move.w	#0,aat5x
	move.w	#0,aat5y
	move.w	#60,bat5
	move.b	#1,numsflag
	add.w	#150,score
	addq.w	#1,killed
	bsr	sboomsound2
	rts
ath6:
	move.w	#-1,wasahit
	rts	
wasahit:
	blk.w	1,0
bat1x:	blk.w	1,0
bat1y:	blk.w	1,0
bat1:	blk.w	1,0
bat2x:	blk.w	1,0
bat2y:	blk.w	1,0
bat2:	blk.w	1,0
bat3x:	blk.w	1,0
bat3y:	blk.w	1,0
bat3:	blk.w	1,0
bat4x:	blk.w	1,0
bat4y:	blk.w	1,0
bat4:	blk.w	1,0
bat5x:	blk.w	1,0
bat5y:	blk.w	1,0
bat5:	blk.w	1,0
ballad:	blk.l	1,0

shoothits2:
	tst.w	shot1
	bmi	bshits2
	move.w	shot1x,d0
	move.w	shot1y,d1
	bsr	hitbars
	tst.w	wasahit
	bpl	bs1hit
	move.l	ptsin,a0
	move.w	shot1x,(a0)
	move.w	shot1y,2(a0)
	dc.w	getpix
	tst.w	d0
	beq	bshits2
	cmpi.w	#3,d0
	ble	bs1hit
	cmpi.w	#7,d0
	blt	bshits2
	cmpi.w	#12,d0
	bgt	bshits2
bs1hit:
	move.w	#-1,shot1

bshits2:
	tst.w	shot2
	bmi	bshits3
	move.w	shot2x,d0
	move.w	shot2y,d1
	bsr	hitbars
	tst.w	wasahit
	bpl	bs2hit	
	move.l	ptsin,a0
	move.w	shot2x,(a0)
	move.w	shot2y,2(a0)
	dc.w	getpix
	tst.w	d0
	beq	bshits3
	cmpi.w	#3,d0
	ble	bs2hit
	cmpi.w	#7,d0
	blt	bshits3
	cmpi.w	#12,d0
	bgt	bshits3
bs2hit:
	move.w	#-1,shot2

bshits3:
	tst.w	shot3
	bmi	bshits4
	move.w	shot3x,d0
	move.w	shot3y,d1
	bsr	hitbars
	tst.w	wasahit
	bpl	bs3hit	
	move.l	ptsin,a0
	move.w	shot3x,(a0)
	move.w	shot3y,2(a0)
	dc.w	getpix
	tst.w	d0
	beq	bshits4
	cmpi.w	#3,d0
	ble	bs3hit
	cmpi.w	#7,d0
	blt	bshits4
	cmpi.w	#12,d0
	bgt	bshits4
bs3hit:
	move.w	#-1,shot3

bshits4:
	rts
************************************
hitbars:
	move.w	barx,d2
	move.w	bary,d3
	cmp.w	d0,d2
	bgt	hbback
	cmp.w	d1,d3
	bgt	hbback
	add.w	#15,d2
	add.w	#9,d3
	cmp.w	d0,d2
	blt	hbback
	cmp.w	d1,d3
	blt	hbback
	addq.w	#1,barhits
	move.w	#1,wasahit
	add.w	#10,score
	move.b	#1,numsflag
	cmpi.w	#40,barhits
	ble	dhitb
	move.w	mainx,barx
	move.w	mainy,bary	
	tst.w	finalflag
	bpl	dhitb
*	move.l	ballad,a0
*	move.w	#16,d0
*	bsr	randomplus
*	mulu	#96,d0
*	adda.w	d0,a0
*	move.w	#32767,d0
*	bsr	random
*	or.w	d0,(a0)+
*	or.w	d0,(a0)+
*	or.w	d0,(a0)+
*	or.w	d0,(a0)+

dhitb:
*	tst.w	finalflag
*	bpl	hbspecial
	rts
hbback:
	move.w	#-1,wasahit
	rts

********************************
hbspecial:
	move.l	blocks,a0
	adda.l	#576+40,a0		;move to start of brain
	move.w	#2,d0
	bsr	randomplus
	tst.w	d0
	beq	specskip
	adda.l	#8,a0
specskip:
	move.w	#34,d0
	bsr	randomplus
	mulu	#96,d0
	add.w	d0,a0
	move.w	#32767,d0
	bsr	random
	or.w	d0,(a0)+
	or.w	d0,(a0)+
	or.w	d0,(a0)+
	or.w	d0,(a0)+
	rts
	



finalflag:	blk.w	1,0
barx:	blk.w	1,0
bary:	blk.w	1,0
barhits:
	blk.w	1,0
mainx:	blk.w	1,0
mainy:	blk.w	1,0

****************************************
shoot:
	subq.w	#1,sounddelay
	tst.w	firebutton
	bmi	shootmove
	tst.w	shot1
	bpl	sh2
	bsr	shootsound
	move.w	myx,d0
	move.w	myy,d1
	addq.w	#7,d0
	move.w	d0,shot1x
	move.w	d1,shot1y
	move.w	#1,shot1
	move.w	#-1,firebutton
	bra	shootmove

sh2:	tst.w	drone1avail
	bmi	sh3
	tst.w	shot2
	bpl	sh3
	bsr	shootsound
	move.w	drone1x,d0
	move.w	drone1y,d1
	addq.w	#7,d0
	move.w	d0,shot2x
	move.w	d1,shot2y
	move.w	#1,shot2
	move.w	#-1,firebutton
	bra	shootmove

sh3:
	tst.w	drone2avail
	bmi	sh4
	tst.w	shot3
	bpl	sh4
	bsr	shootsound
	move.w	drone2x,d0
	move.w	drone2y,d1
	addq.w	#7,d0
	move.w	d0,shot3x
	move.w	d1,shot3y
	move.w	#1,shot3
	move.w	#-1,firebutton
	bra	shootmove

sh4:
shootmove:
	tst.w	shot1
	bmi	msh2
	subq.w	#8,shot1y
	tst.w	shot1y
	bpl	sm1
	move.w	#-1,shot1
	move.w	#-1,firebutton
	bra	msh2
sm1:
	move.w	shot1x,pixelx
	move.w	shot1y,pixely
	move.w	#15,pixelcolor
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot


msh2:	tst.w	shot2
	bmi	msh3
	subq.w	#8,shot2y
	tst.w	shot2y
	bpl	sm2
	move.w	#-1,shot2
	move.w	#-1,firebutton
	bra	msh3
sm2:
	move.w	shot2x,pixelx
	move.w	shot2y,pixely
	move.w	#15,pixelcolor
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot


msh3:
	tst.w	shot3
	bmi	msh4
	subq.w	#8,shot3y
	tst.w	shot3y
	bpl	sm3
	move.w	#-1,shot3
	move.w	#-1,firebutton
	bra	msh4
sm3:
	move.w	shot3x,pixelx
	move.w	shot3y,pixely
	move.w	#15,pixelcolor
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot
	addq.w	#1,pixely
	jsr	myplot

msh4:
shootback:
	rts

shot1:	blk.w	1,-1
shot1x:	blk.w	1,0
shot1y:	blk.w	1,0
shot2:	blk.w	1,-1
shot2x:	blk.w	1,0
shot2y:	blk.w	1,0
shot3:	blk.w	1,-1
shot3x:	blk.w	1,0
shot3y:	blk.w	1,0
drone1avail:
	blk.w	1,-1
drone2avail:
	blk.w	1,-1
****************************************
clrradar:
	move.l	linepar,a0
	move.w	#0,24(a0)
	move.w	#0,26(a0)
	move.w	#0,28(a0)
	move.w	#0,30(a0)
	move.w	#$ffff,34(a0)
	move.w	#0,36(a0)
	move.w	#-1,32(a0)
	move.w	#308,38(a0)
	move.w	#10,40(a0)
	move.w	#308,42(a0)
	move.w	#190,44(a0)
	dc.w	$a003
	move.w	#6,d7
cra:
	move.l	linepar,a0
	addq.w	#1,38(a0)
	move.w	#10,40(a0)
	addq.w	#1,42(a0)
	move.w	#190,44(a0)
	dc.w	$a003
	dbf	d7,cra


	jsr	flip_scr
	move.l	linepar,a0
	move.w	#0,24(a0)
	move.w	#0,26(a0)
	move.w	#0,28(a0)
	move.w	#0,30(a0)
	move.w	#$ffff,34(a0)
	move.w	#0,36(a0)
	move.w	#-1,32(a0)
	move.w	#308,38(a0)
	move.w	#10,40(a0)
	move.w	#308,42(a0)
	move.w	#190,44(a0)
	dc.w	$a003
	move.w	#6,d7
crab:
	move.l	linepar,a0
	addq.w	#1,38(a0)
	move.w	#10,40(a0)
	addq.w	#1,42(a0)
	move.w	#190,44(a0)
	dc.w	$a003
	dbf	d7,crab
	rts


****************************************
makemap:
	move.w	#36,d7
	move.l	map,a6
	adda.l	#14400,a6
mmap:
	move.w	#5,d0
	jsr	randomplus
	lea	mlist,a0
	move.w	last,d1
	cmp.w	d0,d1
	beq	mmap
	move.w	d0,last
	asl	#2,d0
	move.l	(a0,d0.w),a0
	add.l	blocks,a0
	move.l	a6,a1
	bsr	putmapblocks
	adda.l	#4800,a6
	dbf	d7,mmap
putend:
	move.l	map,a1
	move.l	blocks,a0
	move.w	#199,d0
pend:
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+

	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	dbf	d0,pend
	rts

mlist:
	dc.l	14400
	dc.l	19200
	dc.l	24000
	dc.l	28800
	dc.l	33600
	
last:	blk.w	1,0
**********************************
*	a0 contains ad of data	*
*	a1 add of map		*
**********************************
putmapblocks:
*	move.l	map,a0
	move.w	#49,d0
pmb:
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+

	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	dbf	d0,pmb
	rts
************************************************
scrollerf:
	move.l	hiden,a1
	adda.l	#56,a1
	move.w	#199,d7
	move.l	blocks,a0
	bra	copys
	rts			;just in case
*********************************
scroller:
	move.l	#0,d1
	move.l	#0,d0
	move.w	scrolly,d0
	divu	#10,d0
	add.w	#10,d0
	move.w	d0,d1
	move.l	ytable,a0
	lsl.w	#2,d1
	move.l	(a0,d1.w),a0
	add.l	#152,a0
	move.w	#$0ff0,d1
ptline:
	or.w	d1,(a0)+
	or.w	d1,(a0)+
	or.w	d1,(a0)+
	or.w	d1,(a0)+

	move.l	map,a0
	moveq	#0,d0
	move.w	scrolly,d0
	mulu	#48,d0
	asl.l	#1,d0
	adda.l	d0,a0
	move.l	hiden,a1
	adda.l	#56,a1
	move.w	#199,d7

copys:

	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+

	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	move.l	(a0)+,(a1)+
	adda.l	#64,a1
	dbf	d7,copys
	rts
oldline:	blk.l	1,0

*******************************************
blitter:
	lea	mypb,a6
	move.w	#320,(a6)	;width in pixels
	move.w	#30,2(a6)	;height in pixels
	move.w	#4,4(a6)	;number of planes
	move.w	#1,6(a6)	;?
	move.w	#1,8(a6)	;?
	move.b	num1,10(a6)	;logic ops
	move.b	#3,11(a6)
	move.b	#3,12(a6)
	move.b	num2,13(a6)
*	move.w	scrollx,14(a6)	;minimum source x
	move.w	#60,16(a6)	;minimum source y
	move.l	map,18(a6)	;source base ad
	move.w	#8,22(a6)	;words in line
	move.w	#960,24(a6)	;lines in plane ???
	move.w	#2,26(a6)	;always 2 ???
	move.w	#0,28(a6)	;min destination x
	move.w	#81,30(a6)	;min destination y
	move.l	hiden,32(a6)	;destination base ad
	move.w	#8,36(a6)	;words in line
	move.w	#160,38(a6)	;lines in plane as above
	move.w	#2,40(a6)	;always 2
	move.w	#0,42(a6)	;ad of pattern buffer 0=none
*	move.l	#mypb,a6
	dc.w	bitblt		;blit section of map into hiden
	rts


mypb:	blk.w	100,0
scrolly:	blk.w	1,0
num1:	blk.b	1,0
num2:	blk.b	1,0
**********************************
shiphits:
	tst.w	immortal
	bpl	shiph6
	move.w	myx,d6
	move.w	myy,d7
	tst.w	at1count
	bmi	shiph2
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#11,d0
	subi.w	#11,d1
	cmp.w	aat1x,d0
	bgt	shiph2
	cmp.w	aat1y,d1
	bgt	shiph2
	add.w	#26,d0
	add.w	#26,d1
	cmp.w	aat1x,d0
	blt	shiph2
	cmp.w	aat1y,d1
	blt	shiph2
	bra	meexplode

shiph2:	tst.w	at2count
	bmi	shiph3
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#11,d0
	subi.w	#11,d1
	cmp.w	aat2x,d0
	bgt	shiph3
	cmp.w	aat2y,d1
	bgt	shiph3
	add.w	#26,d0
	add.w	#26,d1
	cmp.w	aat2x,d0
	blt	shiph3
	cmp.w	aat2y,d1
	blt	shiph3
	bra	meexplode
shiph3:	tst.w	at3count
	bmi	shiph4
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#11,d0
	subi.w	#11,d1
	cmp.w	aat3x,d0
	bgt	shiph4
	cmp.w	aat3y,d1
	bgt	shiph4
	add.w	#26,d0
	add.w	#26,d1
	cmp.w	aat3x,d0
	blt	shiph4
	cmp.w	aat3y,d1
	blt	shiph4
	bra	meexplode
shiph4:	tst.w	at4count
	bmi	shiph5
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#11,d0
	subi.w	#11,d1
	cmp.w	aat4x,d0
	bgt	shiph5
	cmp.w	aat4y,d1
	bgt	shiph5
	add.w	#26,d0
	add.w	#26,d1
	cmp.w	aat4x,d0
	blt	shiph5
	cmp.w	aat4y,d1
	blt	shiph5
	bra	meexplode
shiph5:	tst.w	at5count
	bmi	shiph6
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#11,d0
	subi.w	#11,d1
	cmp.w	aat5x,d0
	bgt	shiph6
	cmp.w	aat5y,d1
	bgt	shiph6
	add.w	#26,d0
	add.w	#26,d1
	cmp.w	aat5x,d0
	blt	shiph6
	cmp.w	aat5y,d1
	blt	shiph6
	bra	meexplode
shiph6:
	rts
**********************************
ballhits:
	tst.w	immortal
	bpl	ballh6
	move.w	myx,d6
	move.w	myy,d7
	tst.w	ball1
	bmi	ballh2
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#15,d0
	subi.w	#15,d1
	cmp.w	ball1x,d0
	bgt	ballh2
	cmp.w	ball1y,d1
	bgt	ballh2
	add.w	#30,d0
	add.w	#30,d1
	cmp.w	ball1x,d0
	blt	ballh2
	cmp.w	ball1y,d1
	blt	ballh2
	bra	meexplode

ballh2:
	move.w	myx,d6
	move.w	myy,d7
	tst.w	ball2
	bmi	ballh3
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#15,d0
	subi.w	#15,d1
	cmp.w	ball2x,d0
	bgt	ballh3
	cmp.w	ball2y,d1
	bgt	ballh3
	add.w	#30,d0
	add.w	#30,d1
	cmp.w	ball2x,d0
	blt	ballh3
	cmp.w	ball2y,d1
	blt	ballh3
	bra	meexplode
ballh3:
	move.w	myx,d6
	move.w	myy,d7
	tst.w	ball3
	bmi	ballh4
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#15,d0
	subi.w	#15,d1
	cmp.w	ball3x,d0
	bgt	ballh4
	cmp.w	ball3y,d1
	bgt	ballh4
	add.w	#30,d0
	add.w	#30,d1
	cmp.w	ball3x,d0
	blt	ballh4
	cmp.w	ball3y,d1
	blt	ballh4
	bra	meexplode

ballh4:
	move.w	myx,d6
	move.w	myy,d7
	tst.w	ball4
	bmi	ballh5
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#15,d0
	subi.w	#15,d1
	cmp.w	ball4x,d0
	bgt	ballh5
	cmp.w	ball4y,d1
	bgt	ballh5
	add.w	#30,d0
	add.w	#30,d1
	cmp.w	ball4x,d0
	blt	ballh5
	cmp.w	ball4y,d1
	blt	ballh5
	bra	meexplode
ballh5:
	move.w	myx,d6
	move.w	myy,d7
	tst.w	ball5
	bmi	ballh6
	move.w	d6,d0
	move.w	d7,d1
	subi.w	#15,d0
	subi.w	#15,d1
	cmp.w	ball5x,d0
	bgt	ballh6
	cmp.w	ball5y,d1
	bgt	ballh6
	add.w	#30,d0
	add.w	#30,d1
	cmp.w	ball5x,d0
	blt	ballh6
	cmp.w	ball5y,d1
	blt	ballh6
	bra	meexplode
ballh6:
	rts
*********************************************
moveme:
	subq.w	#1,immortal
	move.w  myxvel,d0
	add.w	d0,myx
        move.w  myyvel,d0
	add.w	d0,myy

	move.w	xlow,d0
	move.w	xhigh,d1
	move.w	ylow,d2
	move.w	yhigh,d3


	cmp.w	myx,d0
	ble	mme2
	move.w	d0,myx
	bra	mme3
mme2:
	cmp.w	myx,d1
	bge	mme3
	move.w	d1,myx
mme3:	cmp.w	myy,d2
	ble	mme4
	move.w	d2,myy
	bra	me
mme4:
	cmp.w	myy,d3
	bge	me
	move.w	d3,myy
me:
	tst.w	immortal
	bpl	pme
	move.w	#-1,immortal
	move.l	ptsin,a0
	move.w	myx,(a0)
	addq.w	#8,(a0)
	move.w	myy,2(a0)
	dc.w	$a002
	cmpi.w	#7,d0
	blt	pme
	cmpi.w	#12,d0
	bgt	pme
	bra	meexplode
pme:
	subq.w	#1,immortal
	tst.w	myxvel
	bne	okme
	tst.w	myyvel
	bne	okme
	move.w	#1,nomove
	bra	dome
okme:
	move.w	#-1,nomove
	lea	tailstruct,a0
	move.l	#0,d0
	move.w	tailcounter,d0
	asl.w	#2,d0
	move.w	myx,(a0,d0.w)
	move.w	myy,2(a0,d0.w)
	addq.w	#1,tailcounter
	cmpi.w	#60,tailcounter
	ble	dome
	move.w	#0,tailcounter

dome:
	tst.w	immortal
	bmi	adme
	tst.w	onoff
	bmi	domeback
	move.w	#-1,onoff
adme:	move.w	myx,d0
	move.w	myy,d1
	move.l	#myshipbuffer,a0
	move.w	d0,d2		;get copy of x
	and.w	#15,d0		;last 4 bits is offset
	move.w	d0,d3
	mulu	#240,d0
	adda.w	d0,a0		;now pointing at correct image
	move.l	a0,imageptr
	move.l	#myshipmask,a0
	asr.w	#1,d0
	adda.w	d0,a0
	move.l	a0,maskptr
	move.l	hiden,a0
	lsl.w	#5,d1		;mult y by 128
	adda.w	d1,a0		;add it to screen address
	lsl.w	#2,d1		;mult by 32 makes mult by 160
	adda.w	d1,a0
	and.w	#$fff0,d2	;mask off last 4 bits gives word across
	lsr.w	#1,d2
	adda.w	d2,a0
	move.l	a0,screenloc
	move.w	#1,width
	move.w	#15,height
*	bsr	shadow
	bsr	pdrawimage
	rts
domeback:
	move.w	#1,onoff
	rts




immortal:	blk.w	1,-1
onoff:	blk.w	1,0
xlow:	blk.w	1,0
xhigh:	blk.w	1,0
ylow:	blk.w	1,0
yhigh:	blk.w	1,0

movedrones:
	tst.w	drone1avail
	bmi	dr2
	tst.w	nomove
	bpl	dod1
	lea	tailstruct,a0
	move.l	#0,d0
	move.w	drone1c,d0
	asl.w	#2,d0
	move.w	(a0,d0.w),drone1x
	move.w	2(a0,d0.w),drone1y
	addq.w	#1,drone1c
	cmpi.w	#60,drone1c
	ble	dod1
	move.w	#0,drone1c
dod1:
	move.w	drone1x,d0
	move.w	drone1y,d1
	addq.w	#4,d0
	move.l	#mydronebuffer,a0
	move.w	d0,d2		;get copy of x
	and.w	#15,d0		;last 4 bits is offset
	move.w	d0,d3
	mulu	#144,d0
	adda.w	d0,a0		;now pointing at correct image
	move.l	a0,imageptr
	move.l	#mydronemask,a0
	asr.w	#1,d0
	adda.w	d0,a0
	move.l	a0,maskptr
	move.l	hiden,a0
	lsl.w	#5,d1		;mult y by 128
	adda.w	d1,a0		;add it to screen address
	lsl.w	#2,d1		;mult by 32 makes mult by 160
	adda.w	d1,a0
	and.w	#$fff0,d2	;mask off last 4 bits gives word across
	lsr.w	#1,d2
	adda.w	d2,a0
	move.l	a0,screenloc
	move.w	#1,width
	move.w	#9,height
	bsr	pdrawimage

dr2:
	tst.w	drone2avail
	bmi	drb
	tst.w	nomove
	bpl	dod2
	lea	tailstruct,a0
	move.l	#0,d0
	move.w	drone2c,d0
	asl.w	#2,d0
	move.w	(a0,d0.w),drone2x
	move.w	2(a0,d0.w),drone2y
	addq.w	#1,drone2c
	cmpi.w	#60,drone2c
	ble	dod2
	move.w	#0,drone2c
dod2:
	move.w	drone2x,d0
	move.w	drone2y,d1
	addq.w	#4,d0
	move.l	#mydronebuffer,a0
	move.w	d0,d2		;get copy of x
	and.w	#15,d0		;last 4 bits is offset
	move.w	d0,d3
	mulu	#144,d0
	adda.w	d0,a0		;now pointing at correct image
	move.l	a0,imageptr
	move.l	#mydronemask,a0
	asr.w	#1,d0
	adda.w	d0,a0
	move.l	a0,maskptr
	move.l	hiden,a0
	lsl.w	#5,d1		;mult y by 128
	adda.w	d1,a0		;add it to screen address
	lsl.w	#2,d1		;mult by 32 makes mult by 160
	adda.w	d1,a0
	and.w	#$fff0,d2	;mask off last 4 bits gives word across
	lsr.w	#1,d2
	adda.w	d2,a0
	move.l	a0,screenloc
	move.w	#1,width
	move.w	#9,height
	bsr	pdrawimage
drb:	rts


meexplode:
	bsr	bboomsound
	lea	exploblock,a0
	move.w	myx,d0
	move.w	myy,d1
	addq.w	#4,d0
	addq.w	#4,d1

	move.w	d0,(a0)
	move.w	d1,2(a0)
	move.w	#0,4(a0)
	move.w	#-3,6(a0)

	move.w	d0,8(a0)
	move.w	d1,10(a0)
	move.w	#2,12(a0)
	move.w	#-2,14(a0)

	move.w	d0,16(a0)
	move.w	d1,18(a0)
	move.w	#3,20(a0)
	move.w	#0,22(a0)

	move.w	d0,24(a0)
	move.w	d1,26(a0)
	move.w	#2,28(a0)
	move.w	#2,30(a0)

	move.w	d0,32(a0)
	move.w	d1,34(a0)
	move.w	#0,36(a0)
	move.w	#3,38(a0)

	move.w	d0,40(a0)
	move.w	d1,42(a0)
	move.w	#-2,44(a0)
	move.w	#2,46(a0)

	move.w	d0,48(a0)
	move.w	d1,50(a0)
	move.w	#-3,52(a0)
	move.w	#0,54(a0)

	move.w	d0,56(a0)
	move.w	d1,58(a0)
	move.w	#-2,60(a0)
	move.w	#-2,62(a0)

	move.w	#30,d0
exploloop:
	move.l	d0,-(sp)
exbp:	lea	exploblock,a0
	move.l  #0,d0
	move.l  #0,d1
	move.w	(a0)+,d0
	move.w	(a0)+,d1
	add.w	(a0)+,d0
	add.w	(a0)+,d1
	move.w	d0,-8(a0)
	move.w	d1,-6(a0)
	bsr	fitboom
	cmpi.w	#100,-4(a0)
	beq	bp2
	cmpi.w	#100,-2(a0)
	beq	bp2
	move.l	a0,-(sp)
bp1b:	bsr	putboom
	move.l	(sp)+,a0

bp2:	move.l  #0,d0
	move.l  #0,d1
	move.w	(a0)+,d0
	move.w	(a0)+,d1
	add.w	(a0)+,d0
	add.w	(a0)+,d1
	move.w	d0,-8(a0)
	move.w	d1,-6(a0)
	bsr	fitboom
	cmpi.w	#100,-4(a0)
	beq	bp3
	cmpi.w	#100,-2(a0)
	beq	bp3
	move.l	a0,-(sp)
bp2b:	bsr	putboom
	move.l	(sp)+,a0

bp3:	move.l  #0,d0
	move.l  #0,d1
	move.w	(a0)+,d0
	move.w	(a0)+,d1
	add.w	(a0)+,d0
	add.w	(a0)+,d1
	move.w	d0,-8(a0)
	move.w	d1,-6(a0)
	bsr	fitboom
	cmpi.w	#100,-4(a0)
	beq	bp4
	cmpi.w	#100,-2(a0)
	beq	bp4
	move.l	a0,-(sp)
bp3b:	bsr	putboom
	move.l	(sp)+,a0

bp4:	move.l  #0,d0
	move.l  #0,d1
	move.w	(a0)+,d0
	move.w	(a0)+,d1
	add.w	(a0)+,d0
	add.w	(a0)+,d1
	move.w	d0,-8(a0)
	move.w	d1,-6(a0)
	bsr	fitboom
	cmpi.w	#100,-4(a0)
	beq	bp5
	cmpi.w	#100,-2(a0)
	beq	bp5
	move.l	a0,-(sp)
bp4b:	bsr	putboom
	move.l	(sp)+,a0

bp5:	move.l  #0,d0
	move.l  #0,d1
	move.w	(a0)+,d0
	move.w	(a0)+,d1
	add.w	(a0)+,d0
	add.w	(a0)+,d1
	move.w	d0,-8(a0)
	move.w	d1,-6(a0)
	bsr	fitboom
	cmpi.w	#100,-4(a0)
	beq	bp6
	cmpi.w	#100,-2(a0)
	beq	bp6
	move.l	a0,-(sp)
bp5b:	bsr	putboom
	move.l	(sp)+,a0

bp6:	move.l  #0,d0
	move.l  #0,d1
	move.w	(a0)+,d0
	move.w	(a0)+,d1
	add.w	(a0)+,d0
	add.w	(a0)+,d1
	move.w	d0,-8(a0)
	move.w	d1,-6(a0)
	bsr	fitboom
	cmpi.w	#100,-4(a0)
	beq	bp7
	cmpi.w	#100,-2(a0)
	beq	bp7
	move.l	a0,-(sp)
bp6b:	bsr	putboom
	move.l	(sp)+,a0

bp7:	move.l  #0,d0
	move.l  #0,d1
	move.w	(a0)+,d0
	move.w	(a0)+,d1
	add.w	(a0)+,d0
	add.w	(a0)+,d1
	move.w	d0,-8(a0)
	move.w	d1,-6(a0)
	bsr	fitboom
	cmpi.w	#100,-4(a0)
	beq	bp8
	cmpi.w	#100,-2(a0)
	beq	bp8
	move.l	a0,-(sp)
bp7b:	bsr	putboom
	move.l	(sp)+,a0

bp8:	move.l  #0,d0
	move.l  #0,d1
	move.w	(a0)+,d0
	move.w	(a0)+,d1
	add.w	(a0)+,d0
	add.w	(a0)+,d1
	move.w	d0,-8(a0)
	move.w	d1,-6(a0)
	bsr	fitboom
	cmpi.w	#100,-4(a0)
	beq	bp9
	cmpi.w	#100,-2(a0)
	beq	bp9
	move.l	a0,-(sp)
bp8b:	bsr	putboom
	move.l	(sp)+,a0

bp9:	move.l	#1000,d0
ddd:	dbf	d0,ddd

	jsr	flip_scr
	move.l	(sp)+,d0
	dbf	d0,exploloop
	move.w	#1800,scrolly
	move.w	#207,myx
	move.w	#170,myy
	move.l	#50000,d0
ddd1:
	move.l	#15,d1
ddd2:	dbf	d1,ddd2
	dbf	d0,ddd1
	bsr	clrradar
	move.w	#-1,bonus1
	move.w	#-1,bonus2
	move.w	#-1,drone1avail
	move.w	#-1,drone2avail
	move.w	#-1,shot1
	move.w	#-1,shot2
	move.w	#-1,shot3
	move.w	#-1,at1count
	move.w	#-1,at2count
	move.w	#-1,at3count
	move.w	#-1,at4count
	move.w	#-1,at5count
	move.w	#-1,bat1
	move.w	#-1,bat2
	move.w	#-1,bat3
	move.w	#-1,bat4
	move.w	#-1,bat5
	move.w	#-1,ball1
	move.w	#-1,ball2
	move.w	#-1,ball3
	move.w	#-1,ball4
	move.w	#-1,ball5
	move.w	#0,counter
	subq.w	#1,ships
	move.b	#1,shipsflag
	move.w	#200,immortal
	move.w	#-1,mastercount
	rts


fitboom:
	cmpi.w	#112,d0
	bge	fb2
	move.w	#100,-4(a0)
	bra	fb3
fb2:
	cmpi.w	#303-10,d0
	ble	fb3
	move.w	#100,-4(a0)
fb3:
	tst.w	d1
	bge	fb4
	move.w	#100,-2(a0)
	rts
fb4:
	cmpi.w	#199-10,d1
	ble	fb5
	move.w	#100,-2(a0)
fb5:	rts	


*put x in d0
*	y in d1
putboom:
	addq.w	#4,d0
        divu    #16,d0          ;divide by 16 leaves word boundry in d0
	addq.w	#4,d1
        mulu    #160,d1         ;gives offset in words of line
        move.w  d0,d3
        asl.w	#3,d3
        adda.w	d3,d1           ;gives word to poke sprite
        move.l  hiden,a0    ;put screen address in d2
        adda.w  d1,a0           ;gives actual screen address for sprite
        move.l  a0,screenloc
        asr.l   #8,d0
        asr.l   #8,d0           ;leaves x offset in d0          
	move.l	d0,d1
	mulu	#64,d0
	lea	myboombuffer,a0
	adda.l	d0,a0
	move.l	a0,imageptr
	mulu	#32,d1
	lea	myboommask,a0
	adda.l	d1,a0
	move.l	a0,maskptr
	move.w	#1,width
	move.w	#4,height
	jsr	pdrawimage
	rts



exploblock:	blk.w	70,0
tailstruct:	blk.w	150,0
tailcounter:	blk.w	1,0
drone1c:	blk.w	1,0
drone2c:	blk.w	1,0
drone1x:	blk.w	1,0
drone1y:	blk.w	1,0
drone2x:	blk.w	1,0
drone2y:	blk.w	1,0
nomove:		blk.w	1,-1
****************************************
ramware:
*	move.l	#titlepalette,temppal
*	bsr	docolors
*	bsr	loadscr
*	bsr	copyintoboth
	move.l	oldvbl2,a0
	move.l	#0,(a0)		;turn off color vbl
	move.w	#0,let1c
	move.w	#326,let2c
	move.w	#308,let3c
	move.w	#290,let4c
	move.w	#272,let5c
	move.w	#254,let6c
	move.w	#236,let7c
	move.w	#1000,counter

rw2:
	bsr	clearsmall
	bsr	doletters
	bsr	keyboard
	bsr	flip2
*	subq.w	#1,counter
*	bmi	pstory
	tst.w	firebutton
	bmi	rw2
*	lea	pulsevbl,a0
*	bsr	putvbl
*	move.l	a1,oldvbl2
*	rts

pstory:
*	bsr	story
*	move.w	#1000,counter
*	bra	ramware

story:
	bsr	cleverclear
	move.l	#storypalette,temppal
	bsr	docolors
	bsr	clearmap
	move.l	#storydat,a0	;the words
	bsr	writestory
	move.w	#0,scrolly
	move.w	#2,adcount
*	move.w	#5,d1
*	bsr	cdel
	move.w	#-1,firebutton

storyscroll:
	bsr	keyboard
	bsr	flip_scr
	bsr	addscroll
	cmpi.w	#1730,scrolly
	bge	stsover
	tst.w	firebutton
	bmi	storyscroll	
*	lea	pulsevbl,a0
*	bsr	putvbl
*	move.l	a1,oldvbl2

stsover:
*	move.w	#100,adcount
*	move.w	#0,scrolly
	lea	pulsevbl,a0
	bsr	putvbl
	move.l	a1,oldvbl2
	rts

addscroll:
	subq.w	#1,adcount
	bpl	adb
	addq.w	#1,scrolly
	move.w	#2,adcount
adb:
	rts
adcount:
	blk.w	1,0

writestory:
	move.l	map,a6		;address to put data
*	move.l	#storydat,a0	;the words
	move.l	#letters,a5	;the font data
wloop:	
	move.l	#templet,a4
	moveq	#0,d0		;letter counter
	bsr	readloop
	cmpi.w	#255,d1
	beq	storydone
	bsr	printline
	bra	wloop
storydone:
	rts

printline:
	move.l	a6,d6		;save
	move.l	#templet,a4
	move.w	d0,d7		;copy of number of letters
	subq.w	#1,d7		;for dbf purposes
*	asr.w	#1,d0		;div number of letters in line by 2
*	move.w	#6,d1
*	sub.w	d0,d1		;gives first letter pos
*	asl.w	#3,d1		;mul by 8
*	add.w	d1,a6		;add to map add
pploop:
	move.w	(a4)+,d0
	asl.w	#7,d0		;mul by 128
	move.l	a5,a1		;copy add of font
	add.w	d0,a1		;gives start add of letter data
	bsr	putletter
	addq.l	#8,a6
	dbf	d7,pploop
	move.l	d6,a6		;restore a6
	adda.l	#2016,a6	;move down 14 scan lines
	rts

putletter:
	move.w	#15,d0		;height of letter
	move.l	a6,a2		;save a6
putletloop:
	move.w	(a1)+,(a6)+
	move.w	(a1)+,(a6)+
	move.w	(a1)+,(a6)+
	move.w	(a1)+,(a6)+
	adda.l	#88,a6		;move to next line
	dbf	d0,putletloop
	move.l	a2,a6		;restore a6
	rts

readloop:
	moveq	#0,d1
	move.b	(a0)+,d1
	beq	rloopover	;last letter?
	cmpi.w	#255,d1
	beq	rloopover
	sub.w	#65,d1
	move.w	d1,(a4)+	;convert to word and proper offset
	addq.w	#1,d0
	bra	readloop
rloopover:
	rts




endstory:
	move.b	#1,numsflag
	move.l	oldvbl2,a0
	move.l	#0,(a0)		;turn off color vbl
	move.w	#-1,firebutton
	bsr	cleverclear
	move.l	#storypalette,temppal
	bsr	docolors
	bsr	clearmap
	move.l	#storydat2,a0	;the words
	bsr	writestory
	move.w	#0,scrolly
	move.w	#2,adcount

storyscroll2:
	move.w	#-1,finalflag
	bsr	printscore
	bsr	flip_scr
	bsr	addscroll
	cmpi.w	#1800,scrolly
	bge	stsover2
*	tst.w	firebutton
	bra	storyscroll2	
stsover2:
	move.w	#100,adcount
	move.w	#0,scrolly
	lea	pulsevbl,a0
	bsr	putvbl
	move.l	a1,oldvbl2
	rts



templet:	blk.w	12,0
storydat2:
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'YOU[HAVE',0
	dc.b	'DESTROYED',0
	dc.b	'THE[BRAIN',0
	dc.b	'AND[THE',0
	dc.b	'MECHANICS',0
	dc.b	'OF[THE',0
	dc.b	'TYRANICAL',0
	dc.b	'SYSTEMS',0
	dc.b	'GOVERNMENT\',0
	dc.b	'[',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'YOU[SHOULD',0
	dc.b	'BE[PROUD',0
	dc.b	'REBEL\\\\',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'PROGRAMMING',0
	dc.b	'GRAPHICS',0
	dc.b	'AND',0
	dc.b	'SOUNDS',0
	dc.b	'T\BARKER',0
	dc.b	'[',0
	dc.b	'MANY[THANKS',0
	dc.b	'TO[AMANDA',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'HI[TO[ALL',0
	dc.b	'IN[LONDON\',0
	dc.b	'[',0
	dc.b	'SPECIAL',0
	dc.b	'THANKS[TO',0
	dc.b	'JANKO\',0
	dc.b	'[',0
	dc.b	'A[WHOLLY',0
	dc.b	'AUSTRALIAN',0
	dc.b	'WRITTEN',0
	dc.b	'PROGRAM\',0
	dc.b	'[',0
	dc.b	'COPYRIGHT',0
	dc.b	'T\BARKER',0
	dc.b	'NINETEEN',0
	dc.b	'HUNDRED',0
	dc.b	'AND',0
	dc.b	'EIGHTY[EIGHT',0
	dc.b	'[',0
	dc.b	'THE',0
	dc.b	'BICENTENNIAL',0
	dc.b	'YEAR',0
	dc.b	'[',0
	dc.b	'HAPPY',0
	dc.b	'BIRTHDAY',0
	dc.b	'TO[THE',0
	dc.b	'LAND[OF[OZ',0
	dc.b	'\\\\\\\\\\\\',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	255
storydat:
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'[[[[ATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'IN[THE',0
	dc.b	'DARKEST',0
	dc.b	'YEARS[OF',0
	dc.b	'THE',0
	dc.b	'OPPRESSIVE',0
	dc.b	'SYSTEMS',0
	dc.b	'GOVERNMENT',0
	dc.b	'ONLY[ONE',0
	dc.b	'MAN[DARED',0
	dc.b	'OPPOSE[THE',0
	dc.b	'SYSTEM\',0
	dc.b	'[[[',0
	dc.b	'HIS[WEAPON[]',0
	dc.b	'A[SMALL',0
	dc.b	'ATTACK[CRAFT',0
	dc.b	'CALLED',0
	dc.b	'ATAX\',0
	dc.b	'[',0
	dc.b	'WITH[LOW',0
	dc.b	'GROUND',0
	dc.b	'SKIMMING',0
	dc.b	'ADVANCES',0
	dc.b	'ON[THE',0
	dc.b	'OUTER[WORLDS',0
	dc.b	'OF[THE',0
	dc.b	'GOVERNMENTS',0
	dc.b	'INFLUENCE',0
	dc.b	'HE[BUILT[UP',0
	dc.b	'A[FOLLOWING',0
	dc.b	'AMONGST',0
	dc.b	'THE',0
	dc.b	'OPPRESSED',0
	dc.b	'TO[BECOME\\\',0
	dc.b	'[',0
	dc.b	'THE',0
	dc.b	'REBEL',0
	dc.b	'LEADER\',0
	dc.b	'[',0
	dc.b	'COULD[YOU',0
	dc.b	'BE[THAT',0
	dc.b	'LEADER[]',0
	dc.b	'[',0
	dc.b	'[',0
	dc.b	'PROGRAMMING',0
	dc.b	'GRAPHICS',0
	dc.b	'AND',0
	dc.b	'SOUNDS',0
	dc.b	'T\BARKER',0
	dc.b	'[',0
	dc.b	'ADDITIONAL',0
	dc.b	'IDEAS',0
	dc.b	'A\MEEK',0
	dc.b	'[',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'^^^^^^^^^^^^',0
	dc.b	'ATAXATAXATAX',0
	dc.b	'ATAXATAXATAX',0
	dc.b	255		;tells end
even

clearmap:
	move.l	map,a0
	move.l	#95999,d0
cmaploop:
	move.w	#0,(a0)+
	subq.l	#1,d0
	bpl	cmaploop
	rts

clearsmall:
	move.l	hiden,a0
	add.l	#56,a0
	move.w	#36,d7
clsm:
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	move.l	#0,(a0)+
	add.w	#64,a0
	dbf	d7,clsm
	rts

doletters:
	move.l	#rampat,a0
	move.w	let1c,d0
	cmpi.w	#344,d0
	blt	dl1
	move.w	#0,let1c
dl1:
	asl.w	#2,d0		;mul by 4
	move.w	(a0,d0.w),d2	;thats x
	move.w	2(a0,d0.w),d1	;thats y
	move.l	#rsprite,spblock+8
	bsr	doit		;put the sucker up
	addq.w	#1,let1c
*	rts

	move.l	#rampat,a0
	move.w	let2c,d0
	cmpi.w	#344,d0
	blt	dl2
	move.w	#0,let2c
dl2:
	asl.w	#2,d0		;mul by 4
	move.w	(a0,d0.w),d2	;thats x
	move.w	2(a0,d0.w),d1	;thats y
	move.l	#asprite,spblock+8
	bsr	doit		;put the sucker up
	addq.w	#1,let2c

	move.l	#rampat,a0
	move.w	let3c,d0
	cmpi.w	#344,d0
	blt	dl3
	move.w	#0,let3c
dl3:
	asl.w	#2,d0		;mul by 4
	move.w	(a0,d0.w),d2	;thats x
	move.w	2(a0,d0.w),d1	;thats y
	move.l	#msprite,spblock+8
	bsr	doit		;put the sucker up
	addq.w	#1,let3c

	move.l	#rampat,a0
	move.w	let4c,d0
	cmpi.w	#344,d0
	blt	dl4
	move.w	#0,let4c
dl4:
	asl.w	#2,d0		;mul by 4
	move.w	(a0,d0.w),d2	;thats x
	move.w	2(a0,d0.w),d1	;thats y
	move.l	#wsprite,spblock+8
	bsr	doit		;put the sucker up
	addq.w	#1,let4c

	move.l	#rampat,a0
	move.w	let5c,d0
	cmpi.w	#344,d0
	blt	dl5
	move.w	#0,let5c
dl5:
	asl.w	#2,d0		;mul by 4
	move.w	(a0,d0.w),d2	;thats x
	move.w	2(a0,d0.w),d1	;thats y
	move.l	#asprite,spblock+8
	bsr	doit		;put the sucker up
	addq.w	#1,let5c

	move.l	#rampat,a0
	move.w	let6c,d0
	cmpi.w	#344,d0
	blt	dl6
	move.w	#0,let6c
dl6:
	asl.w	#2,d0		;mul by 4
	move.w	(a0,d0.w),d2	;thats x
	move.w	2(a0,d0.w),d1	;thats y
	move.l	#rsprite,spblock+8
	bsr	doit		;put the sucker up
	addq.w	#1,let6c

	move.l	#rampat,a0
	move.w	let7c,d0
	cmpi.w	#344,d0
	blt	dl7
	move.w	#0,let7c
dl7:
	asl.w	#2,d0		;mul by 4
	move.w	(a0,d0.w),d2	;thats x
	move.w	2(a0,d0.w),d1	;thats y
	move.l	#esprite,spblock+8
	bsr	doit		;put the sucker up
	addq.w	#1,let7c
	rts


doit:
	move.w  d2,spblock
        move.w  d1,spblock+2
        move.w  #14,spblock+4
        move.w  #1,spblock+6
        move.l  #gtemp,spblock+12
        move.w  #1,spblock+26
        move.l  #gmask,spblock+38
*	move.l	,spblock+8
*	movem.l	d2-d7/a0/a6,-(sp)
	jsr	putsprite
*	movem.l	(sp)+,d2-d7/a0-a6
	rts

spblock:
	blk.w	50,0
let1c:	blk.w	1,0
let2c:	blk.w	1,0
let3c:	blk.w	1,0
let4c:	blk.w	1,0
let5c:	blk.w	1,0
let6c:	blk.w	1,0
let7c:	blk.w	1,0

********************************
joydir:
	tst.b	joyport1
	beq	jdback
	move.b	joyport1,d0
	btst	#7,d0
	beq	northa
	move.w	#1,firebutton
	bclr	#7,d0
	bra	north
northa:	move.w	#-1,firebutton
north:	cmpi.b	#1,d0
	bne	neast
	move.w	minusvel,myyvel
	move.w	#0,myxvel
	rts
neast:	cmpi.b	#9,d0
	bne	east
	move.w	minusvel,myyvel
	move.w	plusvel,myxvel
	rts
	
east:	cmpi.b	#8,d0
	bne	seast
	move.w	#0,myyvel
	move.w	plusvel,myxvel
	rts
seast:	cmpi.b	#10,d0
	bne	south
	move.w	plusvel,myyvel
	move.w	plusvel,myxvel
	rts

south:	cmpi.b	#2,d0
	bne	swest
	move.w	plusvel,myyvel
	move.w	#0,myxvel
	rts
swest:	cmpi.b	#6,d0
	bne	west
	move.w	plusvel,myyvel
	move.w	minusvel,myxvel
	rts

west:	cmpi.b	#4,d0
	bne	nwest
	move.w	#0,myyvel
	move.w	minusvel,myxvel
	rts

nwest:	cmpi.b	#5,d0
	bne	jdback
	move.w	minusvel,myyvel
	move.w	minusvel,myxvel
	rts
jdback:
	move.w	#0,myyvel
	move.w	#0,myxvel
	rts

minusvel:	blk.w	1,0
plusvel:	blk.w	1,0
myx:	blk.w	1,0
myy:	blk.w	1,0
myxvel:	blk.w	1,0
myyvel:	blk.w	1,0
firebutton:	blk.w	1,-1
*******************************
oxyani:
	move.l	#0,d0
	move.w	oani,d0
	mulu	#4,d0
	lea	oxylist,a0
	move.l	(a0,d0.w),spblock+8
	addq.w	#1,oani
	cmpi.w	#7,oani
	blt	oan
	move.w	#0,oani
oan:
	rts

oani:	blk.w	1,0
spy:	blk.w	1,0
oxylist:
*	dc.l	oxy1,oxy2,oxy3
*	dc.l	oxy4,oxy5,oxy6
*	dc.l	oxy7,oxy8
curoxy:	blk.l	1,0
gtemp:	blk.w	1000,0
gmask:	blk.w	1000,0
*****************************************
*	set up joystick handler		*
*****************************************
joystuff:
init_joy:
	move.w	#$14,-(sp)
	move.w	#4,-(sp)
	move.w	#3,-(sp)
	trap	#13
	addq.l	#6,sp

	move.w	#34,-(sp)
	trap	#14
	addq.l	#2,sp
	move.l	d0,a0
	adda.l	#24,a0
	move.l	(a0),old_packh		;save the old handler
	move.l	#joy_packet,(a0)	;put in mine
	rts
*****************************************	
*	this is the joy pak handler	*
*****************************************
joy_packet:
	movem.l	a0/a1,-(sp)
	lea	joyport0,a1
	move.b	1(a0),(a1)
	move.b	2(a0),1(a1)
	movem.l	(sp)+,a0/a1
	rts

joyport0:	blk.b	1,0
joyport1:	blk.b	1,0
	even

res_mouse:
	move.w	#34,-(sp)
	trap	#14
	addq.l	#2,sp
	move.l	d0,a0
	adda.l	#24,a0
	move.l	old_packh,(a0)

	move.w	#128,-(sp)
	move.w	#4,-(sp)
	move.w	#3,-(sp)
	trap	#13
	addq.l	#6,sp

	move.w	#1,-(sp)
	move.w	#4,-(sp)
	move.w	#3,-(sp)
	trap	#13
	addq.l	#6,sp
	rts

old_packh:	blk.l	1,0
*************************************************
prestuff:
	move.w	#0,d7
	move.l	#myship,origptr
	move.l	#myshipbuffer,imageptr
	move.w	#0,offset
ps1:
	move.w	#1,width
	move.w	#15,height
	jsr	pshiftimage	
	addq.w	#1,offset
	add.l	#240,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps1

	move.w	#0,d7
	move.l	#myshipmask,maskptr
	move.l	#myshipbuffer,imageptr
	move.w	#0,offset
psm1:
	move.w	#1,width
	move.w	#15,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#240,imageptr
	add.l	#120,maskptr
	cmpi.w	#15,offset
	ble	psm1


dronestuff:
	move.w	#0,d7
	move.l	#drone,origptr
	move.l	#mydronebuffer,imageptr
	move.w	#0,offset
ps2:
	move.w	#1,width
	move.w	#9,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#144,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps2

	move.w	#0,d7
	move.l	#mydronemask,maskptr
	move.l	#mydronebuffer,imageptr
	move.w	#0,offset
psm2:
	move.w	#1,width
	move.w	#15,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#144,imageptr
	add.l	#72,maskptr
	cmpi.w	#15,offset
	ble	psm2

boomstuff:
	move.w	#0,d7
	move.l	#boom,origptr
	move.l	#myboombuffer,imageptr
	move.w	#0,offset
ps3:
	move.w	#1,width
	move.w	#4,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#64,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps3

	move.w	#0,d7
	move.l	#myboommask,maskptr
	move.l	#myboombuffer,imageptr
	move.w	#0,offset
psm3:
	move.w	#1,width
	move.w	#4,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#64,imageptr
	add.l	#32,maskptr
	cmpi.w	#15,offset
	ble	psm3

at1stuff:
	move.w	#0,d7
	move.l	#attacker1,origptr
	move.l	#myat1buffer,imageptr
	move.w	#0,offset
ps4:
	move.w	#1,width
	move.w	#11,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#176,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps4

	move.w	#0,d7
	move.l	#myat1mask,maskptr
	move.l	#myat1buffer,imageptr
	move.w	#0,offset
psm4:
	move.w	#1,width
	move.w	#11,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#176,imageptr
	add.l	#88,maskptr
	cmpi.w	#15,offset
	ble	psm4

at2stuff:
	move.w	#0,d7
	move.l	#attacker2,origptr
	move.l	#myat2buffer,imageptr
	move.w	#0,offset
ps5:
	move.w	#1,width
	move.w	#11,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#176,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps5

	move.w	#0,d7
	move.l	#myat2mask,maskptr
	move.l	#myat2buffer,imageptr
	move.w	#0,offset
psm5:
	move.w	#1,width
	move.w	#11,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#176,imageptr
	add.l	#88,maskptr
	cmpi.w	#15,offset
	ble	psm5

at3stuff:
	move.w	#0,d7
	move.l	#attacker3,origptr
	move.l	#myat3buffer,imageptr
	move.w	#0,offset
ps6:
	move.w	#1,width
	move.w	#11,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#176,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps6

	move.w	#0,d7
	move.l	#myat3mask,maskptr
	move.l	#myat3buffer,imageptr
	move.w	#0,offset
psm6:
	move.w	#1,width
	move.w	#11,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#176,imageptr
	add.l	#88,maskptr
	cmpi.w	#15,offset
	ble	psm6

at4stuff:
	move.w	#0,d7
	move.l	#attacker4,origptr
	move.l	#myat4buffer,imageptr
	move.w	#0,offset
ps7:
	move.w	#1,width
	move.w	#11,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#176,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps7

	move.w	#0,d7
	move.l	#myat4mask,maskptr
	move.l	#myat4buffer,imageptr
	move.w	#0,offset
psm7:
	move.w	#1,width
	move.w	#11,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#176,imageptr
	add.l	#88,maskptr
	cmpi.w	#15,offset
	ble	psm7


bonusstuff:
	move.w	#0,d7
	move.l	#bonus,origptr
	move.l	#mybonusbuffer,imageptr
	move.w	#0,offset
ps8:
	move.w	#1,width
	move.w	#11,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#176,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps8

	move.w	#0,d7
	move.l	#mybonusmask,maskptr
	move.l	#mybonusbuffer,imageptr
	move.w	#0,offset
psm8:
	move.w	#1,width
	move.w	#11,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#176,imageptr
	add.l	#88,maskptr
	cmpi.w	#15,offset
	ble	psm8

ballstuff:
	move.w	#0,d7
	move.l	#ball,origptr
	move.l	#myballbuffer,imageptr
	move.w	#0,offset
ps9:
	move.w	#1,width
	move.w	#15,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#240,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps9

	move.w	#0,d7
	move.l	#myballmask,maskptr
	move.l	#myballbuffer,imageptr
	move.w	#0,offset
psm9:
	move.w	#1,width
	move.w	#15,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#240,imageptr
	add.l	#120,maskptr
	cmpi.w	#15,offset
	ble	psm9

ballbstuff:
	move.w	#0,d7
	move.l	#ballb,origptr
	move.l	#myballbbuffer,imageptr
	move.w	#0,offset
ps10:
	move.w	#1,width
	move.w	#15,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#240,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps10

	move.w	#0,d7
	move.l	#myballbmask,maskptr
	move.l	#myballbbuffer,imageptr
	move.w	#0,offset
psm10:
	move.w	#1,width
	move.w	#15,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#240,imageptr
	add.l	#120,maskptr
	cmpi.w	#15,offset
	ble	psm10


meteorstuff:
	move.w	#0,d7
	move.l	#meteor,origptr
	move.l	#mymeteorbuffer,imageptr
	move.w	#0,offset
ps11:
	move.w	#1,width
	move.w	#15,height
	bsr	pshiftimage	
	addq.w	#1,offset
	add.l	#240,imageptr
	addq.w	#1,d7
	cmpi.w	#15,offset
	ble	ps11

	move.w	#0,d7
	move.l	#mymeteormask,maskptr
	move.l	#mymeteorbuffer,imageptr
	move.w	#0,offset
psm11:
	move.w	#1,width
	move.w	#15,height
	bsr	pmakemask	
	addq.w	#1,offset
	add.l	#240,imageptr
	add.l	#120,maskptr
	cmpi.w	#15,offset
	ble	psm11
	rts

*****************************************
*	height- height			*
*	width				*
*	offset				*
*	origptr				*
*	imageptr			*
*****************************************

pshiftimage:
        move.w  height,d1        ;height in d1
        move.w  offset,d2       ;offset to d2
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        subq.w  #1,width        ;width - 1 = width if count starts at zero
        move.l  origptr,a0      ;object pointer to a0
        move.l  imageptr,a1     ;image pointer to a1
psi1:   move.w  width,d0		;width in d0
        clr.l   (a1)            ;for each line, the first word of the
        clr.l   4(a1)           ;image must be cleared
psi0:    clr.l   d4              ;make sure that the top halves of these
        clr.l   d5              ;registers are zeroed out
        clr.l   d6
        clr.l   d7
        move.w  (a0)+,d4        ;load in one word (four planes)
        move.w  (a0)+,d5        ;to be rotated
        move.w  (a0)+,d6
        move.w  (a0)+,d7
        ror.l   d2,d4           ;rotate all planes by the offset(d2)
        ror.l   d2,d5
        ror.l   d2,d6
        ror.l   d2,d7
        or.w    d4,(a1)+        ;add low order bits to the high order bits
        or.w    d5,(a1)+        ;stored by move instructions farther
        or.w    d6,(a1)+        ;down in this routine
        or.w    d7,(a1)+
        swap    d4              ;move high order bits into lower halves
        swap    d5              ;of the registers
        swap    d6
        swap    d7
        move.w  d4,(a1)         ;save the high orders bits to be ORed
        move.w  d5,2(a1)        ;in the loop (do not increment a1 because
        move.w  d6,4(a1)        ;the ORs in the loop must function on
        move.w  d7,6(a1)        ;the same addresses as these moves.
        dbf     d0,psi0          ;repeat width times
        addq.l  #8,a1           ;new line, move to next word( * 4 planes = 8)
        dbf     d1,psi1          ;repeat height times
        rts                     ;done

pmakemask:
        move.w  height,d1        ;height in d1
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        move.l  imageptr,a0        ;image pointer to a0
        move.l  maskptr,a1       ;mask pointer to a1
pmm1:    move.w  width,d0        ;width in d0
pmm0:    move.w  (a0)+,d2        ;load first plane of bit image in d2
        or.w    (a0)+,d2        ;OR it with the 3 other planes
        or.w    (a0)+,d2
        or.w    (a0)+,d2
        move.w  d2,d3           ;store inverse mask in d3 (temporary)
        swap    d2              ;move inverse mask to top half of register
        move.w  d3,d2           ;and also in bottom half
        eor.l   #-1,d2          ;mask no longer inverse
        move.l  d2,(a1)+        ;store mask in buffer
        dbf     d0,pmm0          ;repeat 'width' times
        dbf     d1,pmm1          ;repeat 'height' times
        rts                     ;done
**************************************************
*	routine to draw image of prerotated
*	sprite
*	must load width,height,screenloc,imageptr,maskptr
pdrawimage:
        move.w  height,d1        ;height to d1
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        move.l  imageptr,a1       ;image pointer to a1
        move.l  maskptr,a2       ;mask pointer to a2
        move.l  screenloc,a3       ;screen buffer pointer to a3
pdi1:    move.w  width,d0        ;width to d0
        move.l  screenloc,a0        ;absolute screen address to a0
pdi0:    move.l  (a2)+,d3        ;load mask data into d3
        move.l  (a1)+,d6        ;load screen image into d6 and d7
        move.l  (a1)+,d7        ;2 words each covers all 4 planes
        move.l  (a3)+,d4        ;do the same for the background
        move.l  (a3)+,d5        ;in d4 and d5 (from buffer, not screen)
        and.l   d3,d4           ;mask background
        and.l   d3,d5
        or.l    d6,d4           ;copy image onto background
        or.l    d7,d5           ;giving final image on top of background
        move.l  d4,(a0)+        ;copy final image into screen memory
        move.l  d5,(a0)+
        dbf     d0,pdi0          ;repeat for 'width' times
        add.l   #160,screenloc      ;move to next screen line
	add.l	#144,a3
        dbf     d1,pdi1          ;repeat 'height' times
        rts                     ;done

shadow:
	tst.w	shad
	bmi	sback
	move.w	height,d1
	subq.w	#1,d1
	move.l	screenloc,a0
	move.l	maskptr,a1
	add.l	#1592,a0
sd:
	move.l	(a1)+,d0
	and.l	d0,(a0)+
	and.l	d0,(a0)+
	move.l	(a1)+,d0
	and.l	d0,(a0)+
	and.l	d0,(a0)+
	add.l	#144,a0
	dbf	d1,sd
	move.w	#-1,shad
	rts
sback:	
	move.w	#1,shad
	rts

shad:	blk.w	1,0
height:	blk.w	1,0
width:	blk.w	1,0
screenloc:	blk.l	1,0
imageptr:	blk.l	1,0
maskptr:	blk.l	1,0

****************************************
*************************
keyboard:
        move.w  #$ff,-(sp)
        move.w  #6,-(sp)
        trap    #1
        addq.l  #4,sp
        tst.l   d0
        beq     keyback
        swap    d0
quit:   cmpi.w  #$10,d0
        bne     space
        bra     gem
space:
	cmpi.w	#$39,d0
	bne	keyback
	bra	pause
info:
	cmpi.w	#$17,d0
	bne	keyback
	bra	story
keyback:rts
*****************************
pause:  
        move.w  #$ff,-(sp)
        move.w  #6,-(sp)
        trap    #1
        addq.l  #4,sp
        tst.l   d0
        beq     pause
        swap    d0
        cmpi.w  #$1e,d0
        bne     keyback 
        bsr     gkey
        cmpi.w  #$32,d0
        bne     keyback
        bsr     gkey
        cmpi.w  #$1e,d0
        bne     keyback
        bsr     gkey
        cmpi.w  #$31,d0
        bne     keyback
        bsr     gkey
        cmpi.w  #$20,d0
        bne     keyback
        bsr     gkey
        cmpi.w  #$1e,d0
        bne     keyback
        bra     prefinal

gkey:
        move.w  #$ff,-(sp)
        move.w  #6,-(sp)
        trap    #1
        addq.l  #4,sp
        tst.l   d0
        beq     gkey
        swap    d0
        rts

************code to determine  x offset *****************
*               and absolute screen address             *
*               parameters to pass on stack as follows  *
*               1-      x of sprite                     *
*               2-      y of sprite                     *
*               3-      screen address                  *
*       paremeters returned are x offset in d0          *
*       absolute screen address in d2                   *
*********************************************************
*	note use of a6					*
*********************************************************
putsprite:
	lea	spblock,a6
        move.l  hiden,16(a6)
	move.l  #0,d0
        move.w  (a6),d0       ;put x value in d0
        divu    #16,d0          ;divide by 16 leaves word boundry in d0
        move.w  2(a6),d1     ;put y value in d1
        mulu    #160,d1         ;gives offset in words of line
        move.w  d0,d3
        asl.w	#3,d3
        add.w	d3,d1           ;gives word to poke sprite
        move.l  hiden,d2    ;put screen address in d2
        add     d1,d2           ;gives actual screen address for sprite
        move.l  d2,20(a6)
        asr.l   #8,d0
        asr.l   #8,d0           ;leaves x offset in d0          
        move.w  d0,24(a6)

*************CODE TO ROTATE A SPRITE IMAGE***********************
*****************************************************************
shiftimages:
        move.w  4(a6),d1        ;height in d1
        move.w  24(a6),d2       ;offset to d2
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        subq.w  #1,6(a6)        ;width - 1 = width if count starts at zero
        move.l  8(a6),a0        ;object pointer to a0
        move.l  12(a6),a1       ;image pointer to a1
ssi1:	move.w  6(a6),d0        ;width in d0
        clr.l   (a1)            ;for each line, the first word of the
        clr.l   4(a1)           ;image must be cleared
ssi0:	clr.l   d4              ;make sure that the top halves of these
        clr.l   d5              ;registers are zeroed out
        clr.l   d6
        clr.l   d7
        move.w  (a0)+,d4        ;load in one word (four planes)
        move.w  (a0)+,d5        ;to be rotated
        move.w  (a0)+,d6
        move.w  (a0)+,d7
        ror.l   d2,d4           ;rotate all planes by the offset(d2)
        ror.l   d2,d5
        ror.l   d2,d6
        ror.l   d2,d7
        or.w    d4,(a1)+        ;add low order bits to the high order bits
        or.w    d5,(a1)+        ;stored by move instructions farther
        or.w    d6,(a1)+        ;down in this routine
        or.w    d7,(a1)+
        swap    d4              ;move high order bits into lower halves
        swap    d5              ;of the registers
        swap    d6
        swap    d7
        move.w  d4,(a1)         ;save the high orders bits to be ORed
        move.w  d5,2(a1)        ;in the loop (do not increment a1 because
        move.w  d6,4(a1)        ;the ORs in the loop must function on
        move.w  d7,6(a1)        ;the same addresses as these moves.
        dbf     d0,ssi0          ;repeat width times
        addq.l  #8,a1           ;new line, move to next word( * 4 planes = 8)
        dbf     d1,ssi1          ;repeat height times
        addq.w  #1,6(a6)
smake_mask:
        move.w  4(a6),d1        ;height in d1
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        move.l  12(a6),a0        ;image pointer to a0
        move.l  38(a6),a1       ;mask pointer to a1
smm1:	move.w  6(a6),d0        ;width in d0
smm0:	move.w  (a0)+,d2        ;load first plane of bit image in d2
        or.w    (a0)+,d2        ;OR it with the 3 other planes
        or.w    (a0)+,d2
        or.w    (a0)+,d2
        move.w  d2,d3           ;store inverse mask in d3 (temporary)
        swap    d2              ;move inverse mask to top half of register
        move.w  d3,d2           ;and also in bottom half
        eor.l   #-1,d2          ;mask no longer inverse
        move.l  d2,(a1)+        ;store mask in buffer
        dbf     d0,smm0          ;repeat 'width' times
        dbf     d1,smm1          ;repeat 'height' times

*********code to put sprite on screen********************
*********parameters to be passed on the stack are********
*********1-     shifted sprite address (tempsp) *********
*********2-     absolute screen address to put image*****
*********3-     height in pixels                *********
*********4-     width in words -1               *********
sdraw:
        move.w  4(a6),d1     ;height to d1
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        move.l  12(a6),a1    ;image pointer to a1
        move.l  38(a6),a2    ;mask pointer to a2
        move.l  20(a6),a3    ;screen buffer pointer to a3
sdi1:	move.w  6(a6),d0     ;width to d0
        move.l  20(a6),a0    ;absolute screen address to a0
sdi0:	move.l  (a2)+,d3        ;load mask data into d3
        move.l  (a1)+,d6        ;load screen image into d6 and d7
        move.l  (a1)+,d7        ;2 words each covers all 4 planes
        move.l  (a3)+,d4        ;do the same for the background
        move.l  (a3)+,d5        ;in d4 and d5 (from buffer, not screen)
        and.l   d3,d4           ;mask background
        and.l   d3,d5
        or.l    d6,d4           ;copy image onto background
        or.l    d7,d5           ;giving final image on top of background
        move.l  d4,(a0)+        ;copy final image into screen memory
        move.l  d5,(a0)+
        dbf     d0,sdi0          ;repeat for 'width' times
        addi.l	#160,20(a6)  ;move to next screen line
        addi.l  #144,a3
        dbf     d1,sdi1          ;repeat 'height' times
	rts
************code to determine  x offset *****************
*               and absolute screen address             *
*               parameters to pass on stack as follows  *
*               1-      x of sprite                     *
*               2-      y of sprite                     *
*               3-      screen address                  *
*       paremeters returned are x offset in d0          *
*       absolute screen address in d2                   *
*********************************************************
shipsp:

calc:
        clr.l   d0
        move.w  pblock,d0       ;put x value in d0
        divu    #16,d0          ;divide by 16 leaves word boundry in d0
        move.w  pblock+2,d1     ;put y value in d1
        mulu    #160,d1         ;gives offset in words of line
        move.w  d0,d3
        mulu    #8,d3
        add     d3,d1           ;gives word to poke sprite
        move.l  pblock+16,d2    ;put screen address in d2
        add     d1,d2           ;gives actual screen address for sprite
        move.l  d2,pblock+20
        asr.l   #8,d0
        asr.l   #8,d0           ;leaves x offset in d0          
        move.w  d0,pblock+24


*************CODE TO ROTATE A SPRITE IMAGE***********************
*       parameters to be passed on the stack in order are       *       
*       1-      x offset from start of word                     *
*       2-      address of place to put shifted image(tempsp)   *
*       3-      address of sprite data                          *
*       4-      height of object in pixels                      *
*       5-      width of object in words - 1                    *
*****************************************************************
shiftimage:
        move.w  pblock+4,d1        ;height in d1
        move.w  pblock+24,d2       ;offset to d2
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        subq.w  #1,pblock+6        ;width - 1 = width if count starts at zero
        move.l  pblock+8,a0        ;object pointer to a0
        move.l  pblock+12,a1       ;image pointer to a1
si1:    move.w  pblock+6,d0        ;width in d0
        clr.l   (a1)            ;for each line, the first word of the
        clr.l   4(a1)           ;image must be cleared
si0:    clr.l   d4              ;make sure that the top halves of these
        clr.l   d5              ;registers are zeroed out
        clr.l   d6
        clr.l   d7
        move.w  (a0)+,d4        ;load in one word (four planes)
        move.w  (a0)+,d5        ;to be rotated
        move.w  (a0)+,d6
        move.w  (a0)+,d7
        ror.l   d2,d4           ;rotate all planes by the offset(d2)
        ror.l   d2,d5
        ror.l   d2,d6
        ror.l   d2,d7
        or.w    d4,(a1)+        ;add low order bits to the high order bits
        or.w    d5,(a1)+        ;stored by move instructions farther
        or.w    d6,(a1)+        ;down in this routine
        or.w    d7,(a1)+
        swap    d4              ;move high order bits into lower halves
        swap    d5              ;of the registers
        swap    d6
        swap    d7
        move.w  d4,(a1)         ;save the high orders bits to be ORed
        move.w  d5,2(a1)        ;in the loop (do not increment a1 because
        move.w  d6,4(a1)        ;the ORs in the loop must function on
        move.w  d7,6(a1)        ;the same addresses as these moves.
        dbf     d0,si0          ;repeat width times
        addq.l  #8,a1           ;new line, move to next word( * 4 planes = 8)
        dbf     d1,si1          ;repeat height times
        addi.w  #1,pblock+6
make_mask:
        move.w  pblock+4,d1        ;height in d1
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        move.l  pblock+12,a0        ;image pointer to a0
        move.l  pblock+38,a1       ;mask pointer to a1
mm1:	move.w  pblock+6,d0        ;width in d0
mm0:	move.w  (a0)+,d2        ;load first plane of bit image in d2
        or.w    (a0)+,d2        ;OR it with the 3 other planes
        or.w    (a0)+,d2
        or.w    (a0)+,d2
        move.w  d2,d3           ;store inverse mask in d3 (temporary)
        swap    d2              ;move inverse mask to top half of register
        move.w  d3,d2           ;and also in bottom half
        eor.l   #-1,d2          ;mask no longer inverse
        move.l  d2,(a1)+        ;store mask in buffer
        dbf     d0,mm0          ;repeat 'width' times
        dbf     d1,mm1          ;repeat 'height' times

draw:
        move.w  pblock+4,d1     ;height to d1
        subq.w  #1,d1           ;height - 1 = height if count starts at zero
        move.l  pblock+12,a1    ;image pointer to a1
        move.l  pblock+38,a2    ;mask pointer to a2
        move.l  pblock+20,a3    ;screen buffer pointer to a3
di1:	move.w  pblock+6,d0     ;width to d0
        move.l  pblock+20,a0    ;absolute screen address to a0
di0:	move.l  (a2)+,d3        ;load mask data into d3
        move.l  (a1)+,d6        ;load screen image into d6 and d7
        move.l  (a1)+,d7        ;2 words each covers all 4 planes
        move.l  (a3)+,d4        ;do the same for the background
        move.l  (a3)+,d5        ;in d4 and d5 (from buffer, not screen)
        and.l   d3,d4           ;mask background
        and.l   d3,d5
        or.l    d6,d4           ;copy image onto background
        or.l    d7,d5           ;giving final image on top of background
        move.l  d4,(a0)+        ;copy final image into screen memory
        move.l  d5,(a0)+
        dbf     d0,di0          ;repeat for 'width' times
        add.l   #160,pblock+20  ;move to next screen line
        add.w   pblock+46,a3
        dbf     d1,di1          ;repeat 'height' times
	rts
*********************************************
otchar:    MOVE.B    D0,buffer           ;move the character to the output buffer
otchar1:   MOVE.L    #buffer,-(SP)       ;character address
          MOVE.L    #1,-(SP)            ;only 1 character
          MOVE.W    #1,-(SP)    ;write to current output device
          MOVE.W    #$40,-(SP)          ;(write)
          TRAP      #1                  ;GEMDOS
          LEA       12(SP),SP
          RTS                           ; -no, return

;  segment name : WTDECL - write a long decimal # to the screen
;    IN:  D1.L = number to convert and display
;    OUT: D1.W = number of characters sent to the screen
;
WTDECL:    MOVEM.L   D2-D3/A2,-(SP) ;save the registers
          MOVEQ     #0,D2          ;clear the offset
          CLR.L     -(SP)          ;clear the count & flag -- (SP)
          LEA       BIGNUMTBL(PC),A2    ;get the big number table

WTDECL1:   MOVE.L    0(A2,D2.W),D3  ;are we at the end of the table?
          BEQ.S     WTDECL5        ; yes, go to WTDEC
          MOVEQ     #'0',D0        ; no, set the number to ASCII zero

WTDECL2:   CMP.L     D3,D1          ;is the # bigger than the next big #?
          BCS.S     WTDECL3        ; yes (BLO)
          SUB.L     D3,D1          ; no, subtract off this number
          ADDQ.W    #1,D0          ;increment the number
          SNE     3(SP)          ;set the flag (always done)
          BRA.S     WTDECL2        ; loop for more

WTDECL3:   TST.B     3(SP)          ;is the flag set?
          BEQ.S     WTDECL4        ; no, don't put the digit
          BSR       otchar         ; yes, put the digit
          ADDQ.W    #1,(SP)        ;increment the count

WTDECL4:   ADDQ.W    #4,D2          ;increment the pointer
          BRA.S     WTDECL1        ;loop for more

WTDECL5:   MOVEQ     #2,D2          ;skip the 10,000s
          BRA.S     WTDEC0

BIGNUMTBL: DC.L      1000000000
          DC.L      100000000
          DC.L      10000000
          DC.L      1000000
          DC.L      100000
          DC.L      10000
          DC.L      0

;
; segment name: WTDEC2D
;   output 2 decimal digits with no zero suppression
;
WTDEC2D:   MOVEM.L   D2-D3/A2,-(SP)
          MOVE.L    #$000000FF,-(SP)
          MOVEQ     #6,D2
          BRA       WTDEC0

;
; segment name: WTDEC
;  display a word value as a decimal number, up to 650,000
;
;  same conventions as in WTDECL, above
;
WTDEC:    MOVEM.L   D2-D3/A2,-(SP) ;save registers
          CLR.L     -(SP)          ;clear the flag/count on the stack
          MOVEQ     #0,D2          ;clear the offset

WTDEC0:    LEA       LITNUMTBL(PC),A2    ;get the little number table

WTDEC1:    MOVEQ     #'0',D0        ;set the number to ASCII zero
          MOVE.W    0(A2,D2.W),D3  ;are we at the end of the table?
          BEQ.S     WTDEC5         ; yes, end

WTDEC2:    CMP.W     D3,D1          ;is the # bigger than the next big #?
          BCS.S     WTDEC3         ; yes (BLO)
          SUB.W     D3,D1          ; no, subtract off this number
          ADDQ.W    #1,D0          ;increment the count
          SNE     3(SP)          ;set the flag (always done)
          BRA.S     WTDEC2         ;loop for more

WTDEC3:    TST.B     3(SP)          ;is the flag set?
          BEQ.S     WTDEC4         ; no, don't put the digit
          BSR       otchar         ; yes, put the digit
          ADDQ.W    #1,(SP)        ;increment the count

WTDEC4:    ADDQ.W    #2,D2          ;increment the pointer
          BRA.S     WTDEC1         ;loop for more

WTDEC5:    TST.B     3(SP)          ;did we put anything out?
          BNE.S     WTDEC6         ; yes
          JSR       otchar         ; no, output a single '0'
          ADDQ.W    #1,(SP)        ;count the character

WTDEC6:    MOVE.W    (SP)+,D1       ;get the count
          ADDQ.L    #2,SP          ;clear the flag
          MOVEM.L   (SP)+,D2-D3/A2 ;restore the registers
          RTS
          
LITNUMTBL: DC.W      10000
          DC.W      1000
          DC.W      100
          DC.W      10
          DC.W      1
          DC.W      0

buffer:	blk.w	100,0
***********************************
printscore:
	move.l	emancount,d0
	moveq	#0,d1
	move.w	score,d1
	cmp.l	d1,d0
	bgt	np2
	add.l	#10000,emancount
	addq.w	#1,ships
	move.b	#1,shipsflag

np2:	tst.b	numsflag
	bmi	noput
	move.w	#8976,numwhere
	move.w	score,number
	bsr	prtnum
	subq.b	#1,numsflag
	rts
noput:
	move.b	#-1,numsflag
printships:
	tst.b	shipsflag
	bmi	noputs
	move.w	#14104,numwhere
	move.w	ships,number
	bsr	prtnum
	subq.b	#1,shipsflag
	rts
noputs:
	move.b	#-1,numsflag
	rts

emancount:	blk.l	1,0
numwhere:	blk.w	1,0
numsflag:	blk.b	1,0
shipsflag:	blk.b	1,0
levelflag:	blk.b	1,0
even
**************************************************************************

*               RETURN TO GEM

gem:
	move.w	#0,$452
	move.l	oldvbl1,a0
	move.l	#0,(a0)
	move.l	oldvbl2,a0
	move.l	#0,(a0)
	move.w	#1,$452

	jsr	res_mouse
        move.b  #7,$484

        move.w  ressave,-(sp)
        move.l  screen1,-(sp)
        move.l  screen1,-(sp)
        move.w  #5,-(sp)
        trap    #14
        addi.l  #12,sp
        

        move.l  spv_sp,-(SP)    ;Back to user mode
        move.w  #$20,-(SP)
        trap    #1
        addq.l  #6,(SP)

illegal
        CLR.W   -(SP)           ;RETURN TO GEM
   
        TRAP    #1

spv_sp: blk.l   1               ;supervisor SP store
ressave:	blk.w	1,0
oldvbl3:	blk.l	1,0
***************************************************************************

*               FLIP SCREEN

*       Flip displayed screen.

copyscr:
        move.l  screen3,a0      ;first copy from third to hiden
        move.l  #199,d0
        move.l  hiden,a1
copyit:
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+

        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+

        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+

        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+

        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+

        dbf     d0,copyit
	rts

beamer:
	move.l	#$ff8205,a0
	move.l	#0,d0
	move.b	(a0),d0
	asl.l	#8,d0
	adda.w	#2,a0
	move.b	(a0),d0
	asl.l	#8,d0
	adda.w	#2,a0
	move.b	(a0),d0
	rts



flip_scr:
	tst.w	finalflag
	bpl	flip3
	move.l	seen,d1
	move.l	d1,d2
	add.l	#160,d1
	add.l	#20000,d2
skloop:
	bsr	beamer
	cmp.l	d1,d0
	blt	skloop
	cmp.l	d2,d0
	bgt	skloop

        move.l  seen,A6
        move.l  hiden,seen
        move.l  A6,hiden
	jsr	scroller
        move.l  sytable,A6
        move.l  ytable,sytable
        move.l  A6,ytable
*       rts
df:     move.w  #-1,-(sp)
        move.l  seen,-(sp)
        move.l  hiden,-(sp)
        move.w  #5,-(sp)
        trap    #14
        addi.l  #12,sp  
        rts
****************************************
flip3:
	move.l	seen,d1
	move.l	d1,d2
	add.l	#160,d1
	add.l	#20000,d2
skloop2:
	bsr	beamer
	cmp.l	d1,d0
	blt	skloop2
	cmp.l	d2,d0
	bgt	skloop2

        move.l  seen,A6
        move.l  hiden,seen
        move.l  A6,hiden
	jsr	scrollerf
        move.l  sytable,A6
        move.l  ytable,sytable
        move.l  A6,ytable
*       rts
df2:    move.w  #-1,-(sp)
        move.l  seen,-(sp)
        move.l  hiden,-(sp)
        move.w  #5,-(sp)
        trap    #14
        addi.l  #12,sp  
        rts

************************************************************
flip2:
        move.l  seen,A6
        move.l  hiden,seen
        move.l  A6,hiden
        move.l  sytable,A6
        move.l  ytable,sytable
        move.l  A6,ytable
*       rts
df3:     move.w  #-1,-(sp)
        move.l  seen,-(sp)
        move.l  hiden,-(sp)
        move.w  #5,-(sp)
        trap    #14
        addi.l  #12,sp  
	move.w	#37,-(sp)
	trap	#14
	addq.l	#2,sp
        rts
************************************************
startx1:	equ	148
starty1:	equ	73
startx2:	equ	267
starty2:	equ	73
endx1:		blk.w	1,0
endy1:		blk.w	1,0
endx2:		blk.w	1,0
endy2:		blk.w	1,0
lcount:	blk.w	1,0
lightcount:	blk.w	1,0

light:
	subq.w	#1,lightcount
	bpl	le5b
	move.w	#1,lightcount
	move.w	endx1,d0
	move.w	endy1,d1
	move.w	myx,d2
	move.w	myy,d3
	addq.w	#8,d2
	addq.w	#8,d3
	cmp.w	d2,d0
	bgt	le2
	addq.w	#1,endx1
	bra	le3
le2:
	subq.w	#1,endx1
le3:
	cmp.w	d3,d1
	bgt	le4
	addq.w	#1,endy1
	bra	le5
le4:
	subq.w	#1,endy1
le5:
	move.w	endx2,d0
	move.w	endy2,d1
	cmp.w	d2,d0
	bgt	le2b
	addq.w	#1,endx2
	bra	le3b
le2b:
	subq.w	#1,endx2
le3b:
	cmp.w	d3,d1
	bgt	le4b
	addq.w	#1,endy2
	bra	le5b
le4b:
	subq.w	#1,endy2
le5b:

	move.w	#15,linecolor
	moveq	#0,d4
	moveq	#0,d5
	moveq	#0,d6
	moveq	#0,d7
	move.w	#startx1,d4
	move.w	#starty1,d5
	move.w	endx1,d6
	move.w	endy1,d7
	sub.w	d4,d6		;d6 has amount to add to x
	sub.w	d5,d7		;d7 likewise for y
	asr.w	#2,d6		;div by 4 gives 4 sections
	asr.w	#2,d7		;div by 4
	move.w	#startx1,x2
	move.w	#starty1,y2
	add.w	d6,x2
	add.w	d7,y2
	move.w	#10,d0
	bsr	random
	add.w	d0,x2
	move.w	#10,d0
	bsr	random
	add.w	d0,y2
	move.w	#startx1,x1
	move.w	#starty1,y1
	bsr	clipit
	bsr	ploop
	move.w	x2sav,x1
	move.w	y2sav,y1
	move.w	endx1,x2
	move.w	endy1,y2
	bsr	clipit

	move.w	#15,linecolor
	moveq	#0,d4
	moveq	#0,d5
	moveq	#0,d6
	moveq	#0,d7
	move.w	#startx2,d4
	move.w	#starty2,d5
	move.w	endx2,d6
	move.w	endy2,d7
	sub.w	d4,d6		;d6 has amount to add to x
	sub.w	d5,d7		;d7 likewise for y
	asr.w	#2,d6		;div by 4 gives 4 sections
	asr.w	#2,d7		;div by 4
	move.w	#startx2,x2
	move.w	#starty2,y2
	add.w	d6,x2
	add.w	d7,y2
	move.w	#10,d0
	bsr	random
	add.w	d0,x2
	move.w	#10,d0
	bsr	random
	add.w	d0,y2
	move.w	#startx2,x1
	move.w	#starty2,y1
	bsr	clipit
	bsr	ploop
	move.w	x2sav,x1
	move.w	y2sav,y1
	move.w	endx2,x2
	move.w	endy2,y2
	bsr	clipit
	rts

ploop:
	move.w	#1,lcount

lightloop:
	move.w	x2sav,x1
	move.w	y2sav,y1
	move.w	x2sav,x2
	move.w	y2sav,y2
	move.w	#10,d0
	bsr	random
	add.w	d0,x2
	move.w	#10,d0
	bsr	random
	add.w	d0,y2
	add.w	d6,x2
	add.w	d7,y2
	bsr	clipit
	subq.w	#1,lcount
	bpl	lightloop
	rts



************************************************
cxmin:		equ	112
cxmax:		equ	302
cymin:		equ	1
cymax:		equ	199
cbits:	blk.w	1,0
cbits2:	blk.w	1,0
xsav:	blk.w	1,0
ysav:	blk.w	1,0
clipit:
	cmpi.w	#112,x1
	bge	clipit2
	move.w	#112,x1
	bra	clipit3
clipit2:
	cmpi.w	#302,x1
	ble	clipit3
	move.w	#302,x1
clipit3:
	cmpi.w	#1,y1
	bge	clipit4
	move.w	#1,y1
	bra	clipit5
clipit4:
	cmpi.w	#199,y1
	ble	clipit5
	move.w	#199,y1

clipit5:
	cmpi.w	#112,x2
	bge	clipit2b
	move.w	#112,x2
	bra	clipit3b
clipit2b:
	cmpi.w	#302,x2
	ble	clipit3b
	move.w	#302,x2
clipit3b:
	cmpi.w	#1,y2
	bge	clipit4b
	move.w	#1,y2
	bra	clipit5b
clipit4b:
	cmpi.w	#199,y2
	ble	clipit5b
	move.w	#199,y2
clipit5b:

	move.w	x2,x2sav
	move.w	y2,y2sav
	bra	myline

x2sav:	blk.w	1,0
y2sav:	blk.w	1,0

*********************************************************
linecolor:
	blk.w	1,0
***********************************************
*	lets plot a fucking line
*	but lets do it fast
*	first some conventions
*	draws line on hiden screen
*	between x1,y1,x2,y2 
***********************************************
myline:
	movem.l	d4-d7/a0,-(sp)
calcdx:
	move.w	x2,d0
	sub.w	x1,d0	;x2-x1
	move.w	d0,dx	;d0 is dx
	bpl	calcdy
	neg	d0
calcdy:
	move.w	y2,d1
	sub.w	y1,d1	;y2-y1	
	move.w	d1,dy	;d6 is dy
	bpl	cmparedxdy
	neg	d1
cmparedxdy:
	cmp.w	d0,d1
	bgt	ymajor	;if dy is greater then ymajor
xmajor:
*	tst.w	dy
*	beq	horizontal	;special case
	tst.w	dx
	bpl	noswapx
	move.w	x2,d0
	move.w	x1,x2
	move.w	d0,x1
	move.w	y2,d0
	move.w	y1,y2
	move.w	d0,y1
	neg	dx
	neg	dy
noswapx:
	move.l	#0,d0
	move.w	dx,d0
	divs	dy,d0
	bmi	xpositive

xnegative:
	move.l	hiden,a0	;screen ad
	move.w	dx,d0
	move.w	d0,d7	;counter is d7
	subq.w	#1,d7
bp:	asr.w	#1,d0	;div by 2
	move.w	d0,d6	;dump is d6
	move.w	x1,d0	;will hold bitpattern
	move.w	d0,d2
	move.w	y1,d1
	lsl.w	#5,d1	;mult y by 128
	adda.w	d1,a0	;add it to screen address
	lsl.w	#2,d1	;mult by 32 makes mult by 160
	add.w	d1,a0	;a0 now has start screen address
	and.w	#$fff0,d0	;mask off last 4 bits gives word across
	lsr.w	#1,d0
	add.w	d0,a0
	moveq	#0,d4
	tst.w	d7
	bmi	specxneg
xmnloop:
	addq.w	#1,d2
	move.w	d2,d3
	and.w	#15,d3
	bne	xmnla
	bsr	putlinein
	moveq	#0,d4
	addq.l	#8,a0
xmnla:	sub.w	#15,d3
	neg	d3
	bset	d3,d4
	sub.w	dy,d6	;sub dy from dump
	bpl	xmn
	add.w	dx,d6
	bsr	putlinein
	adda.l	#160,a0		;moveit to next line
	moveq	#0,d4
xmn:
	dbf	d7,xmnloop
specxneg:
	move.w	d2,d3
	and.w	#15,d3
	sub.w	#15,d3
	neg	d3
	bset	d3,d4
	bsr	putlinein
	movem.l	(sp)+,d4-d7/a0
	rts

putlinein:
	move.w	d4,d5
	eor.w	#$ffff,d5
	and.w	d5,(a0)		;clearout old pixels
	and.w	d5,2(a0)
	and.w	d5,4(a0)
	and.w	d5,6(a0)
	move.w	linecolor,d5
plane1:
	btst	#0,d5
	beq	plane2
	or.w	d4,(a0)
plane2:
	btst	#1,d5
	beq	plane3
	or.w	d4,2(a0)
plane3:
	btst	#2,d5
	beq	plane4
	or.w	d4,4(a0)
plane4:
	btst	#3,d5
	beq	plane5
	or.w	d4,6(a0)
plane5:
	rts



xpositive:
	move.l	hiden,a0	;screen ad
	move.w	dx,d0
	move.w	d0,d7	;counter is d7
	subq.w	#1,d7
	asr.w	#1,d0	;div by 2
	move.w	d0,d6	;dump is d6
	move.w	x1,d0	;will hold bitpattern
	move.w	d0,d2
	move.w	y1,d1
	lsl.w	#5,d1	;mult y by 128
	adda.w	d1,a0	;add it to screen address
	lsl.w	#2,d1	;mult by 32 makes mult by 160
	add.w	d1,a0	;a0 now has start screen address
	and.w	#$fff0,d0	;mask off last 4 bits gives word across
	lsr.w	#1,d0
	add.w	d0,a0
	moveq	#0,d4
xmploop:
	addq.w	#1,d2
	move.w	d2,d3
	and.w	#15,d3
	bne	xmpla
	bsr	putlinein
	moveq	#0,d4
	addq.l	#8,a0
xmpla:	sub.w	#15,d3
	neg	d3
	bset	d3,d4
	add.w	dy,d6	;sub dy from dump
	bpl	xmp
	add.w	dx,d6
	bsr	putlinein
	moveq	#0,d4
	suba.l	#160,a0		;moveit to next line
xmp:
	dbf	d7,xmploop
	move.w	d2,d3
	and.w	#15,d3
	sub.w	#15,d3
	neg	d3
	bset	d3,d4
	bsr	putlinein
	movem.l	(sp)+,d4-d7/a0
	rts

ymajor:
	tst.w	dy
	bpl	noswapy
	move.w	x2,d0
	move.w	x1,x2
	move.w	d0,x1
	move.w	y2,d0
	move.w	y1,y2
	move.w	d0,y1
	neg	dx
	neg	dy
noswapy:
	move.l	#0,d0
	move.w	dy,d0
	divs	dx,d0
	bmi	ypositive
ynegative:
	tst.w	dx
	beq	straightup1	;special case vertical line
	move.l	hiden,a0	;screen ad
	move.w	dy,d0
	move.w	d0,d7	;counter is d7
*	subq.w	#1,d7
	asr.w	#1,d0	;div by 2
	move.w	d0,d6	;dump is d6
	move.w	x1,d0	;will hold bitpattern
	move.w	d0,d3
	move.w	y1,d1
	move.w	d1,d2
	lsl.w	#5,d1	;mult y by 128
	adda.w	d1,a0	;add it to screen address
	lsl.w	#2,d1	;mult by 32 makes mult by 160
	add.w	d1,a0	;a0 now has start screen address
	and.w	#$fff0,d0	;mask off last 4 bits gives word across
	lsr.w	#1,d0
	add.w	d0,a0
	move.w	d3,d0	;x
	moveq	#0,d4
	move.w	d0,d3
	and.w	#15,d3
	move.w	#$8000,d4
	lsr.w	d3,d4
ymnloop:
	bsr	putlinein
	add.w	#160,a0	;y+1
	sub.w	dx,d6	;sub dy from dump
	bpl	ymn
	add.w	dy,d6
	addq.w	#1,d0	;x+1
	move.w	d0,d3
	and.w	#15,d3
	bne	ymnla
	addq.l	#8,a0
ymnla:	move.w	#$8000,d4
	lsr.w	d3,d4
ymn:
	dbf	d7,ymnloop
	movem.l	(sp)+,d4-d7/a0
	rts

ypositive:
	tst.w	dx
	beq	straightup	;special case vertical line
	move.l	hiden,a0	;screen ad
	move.w	dy,d0
	move.w	d0,d7	;counter is d7
	subq.w	#1,d7
	asr.w	#1,d0	;div by 2
	move.w	d0,d6	;dump is d6
	move.w	x1,d0	;will hold bitpattern
	move.w	d0,d3
	move.w	y1,d1
	move.w	d1,d2
	lsl.w	#5,d1	;mult y by 128
	adda.w	d1,a0	;add it to screen address
	lsl.w	#2,d1	;mult by 32 makes mult by 160
	add.w	d1,a0	;a0 now has start screen address
	and.w	#$fff0,d0	;mask off last 4 bits gives word across
	lsr.w	#1,d0
	add.w	d0,a0
	move.w	d3,d0	;x
	moveq	#0,d4
*	move.w	d0,d3
	and.w	#15,d3
	move.w	#$8000,d4
	lsr.w	d3,d4

ymploop:
	bsr	putlinein
	add.w	#160,a0	;y+1
	add.w	dx,d6	;sub dy from dump
	bpl	ymp
	add.w	dy,d6
	subq.w	#1,d0	;x+1
	move.w	d0,d3
	and.w	#15,d3
	cmpi.w	#15,d3
	bne	ympla
	subq.l	#8,a0
ympla:	move.w	#$8000,d4
	lsr.w	d3,d4
ymp:
	dbf	d7,ymploop
	movem.l	(sp)+,d4-d7/a0
	rts

straightup:
	move.l	hiden,a0	;screen ad
	move.w	dy,d7
	move.w	x1,d0	;will hold bitpattern
	move.w	d0,d3
	move.w	y1,d1
	lsl.w	#5,d1	;mult y by 128
	adda.w	d1,a0	;add it to screen address
	lsl.w	#2,d1	;mult by 32 makes mult by 160
	add.w	d1,a0	;a0 now has start screen address
	and.w	#$fff0,d0	;mask off last 4 bits gives word across
	lsr.w	#1,d0
	add.w	d0,a0	;now a0 is ready
	moveq	#0,d4
	and.w	#15,d3
	move.w	#$8000,d4
	lsr.w	d3,d4	;d4 has proper bit pattern
	add.l	#160,a0
stuploop:
	bsr	putlinein
	add.l	#160,a0
	dbf	d7,stuploop
	movem.l	(sp)+,d4-d7/a0
	rts	

straightup1:
	move.l	hiden,a0	;screen ad
	move.w	dy,d7
	move.w	x1,d0	;will hold bitpattern
	move.w	d0,d3
	move.w	y1,d1
	lsl.w	#5,d1	;mult y by 128
	adda.w	d1,a0	;add it to screen address
	lsl.w	#2,d1	;mult by 32 makes mult by 160
	add.w	d1,a0	;a0 now has start screen address
	and.w	#$fff0,d0	;mask off last 4 bits gives word across
	lsr.w	#1,d0
	add.w	d0,a0	;now a0 is ready
	moveq	#0,d4
	and.w	#15,d3
	move.w	#$8000,d4
	lsr.w	d3,d4	;d4 has proper bit pattern
	add.l	#160,a0

stuploop1:
	bsr	putlinein
	sub.l	#160,a0
	dbf	d7,stuploop
	movem.l	(sp)+,d4-d7/a0
	rts	


dump:	blk.w	1,0
gradient:	blk.w	1,0
x1:	blk.w	1,0
x2:	blk.w	1,0
y1:	blk.w	1,0
y2:	blk.w	1,0
dx:	blk.w	1,0
dy:	blk.w	1,0


********************************************
* Atari ST hi-speed plotting subroutine    *
********************************************
* For Low-resolution mode only		   *
********************************************
**************************************
* INITIALIZE THE PLOTTING ROUTINE:   *
* BUILDS PLOT ADDRESS TABLE (YTABLE) *
* FOR FAST PLOTTING.                 *
*                                    *
* CALL WITH:                         *
* pinit(SCREENADDRESS)               *
**************************************
plotinit:
move.l seen,a0    ;screen addr in A0
move.b #200,d1     ;200 Y positions
move.l #ytable1,a1 ;y table address in A1

iloop:
move.l a0,(a1)+    ;move address to table
adda.w #160,a0     ;increment address
subq.b #1,d1       ;1 less y position
bne iloop          ;loop if there's more!

move.l hiden,a0    ;screen addr in A0
move.b #200,d1     ;200 Y positions
move.l #ytable2,a1 ;y table address in A1

iloop2:
move.l a0,(a1)+    ;move address to table
adda.w #160,a0     ;increment address
subq.b #1,d1       ;1 less y position
bne iloop2         ;loop if there's more!
*move.l	#ytable2,ytable
rts

pixelx:	blk.w	1,0
pixely:	blk.w	1,0
pixelcolor:
	blk.w	1,0
ytable1:	blk.l	200,0
ytable2:	blk.l	200,0
ytable:		blk.l	1,0
sytable:		blk.l	1,0


myplot2:
movem.l	d0-d5/a0-a1,-(sp)
move.w pixelx,d0      ;x coordinate in D0
move.w d0,d3         ;duplicate in D3
andi.w #15,d3        ;mask off lower 4 bits
move.w pixely,d1      ;get y coordinate,
lsl.w #2,d1          ;mult by 4 for index
move.w pixelcolor,d2      ;get color number

lsr.w 	#1,d0             ;x coord / 2
and.w #$00f8,d0      ;strip lower 3 bits
move.w d0,a0        ;move x offset to A0
move.l ytable,a1   ;get y table addr
adda.l 0(a1,d1.w),a0 ;got final pixel addr!
move.w #$8000,d4     ;set ON pixel mask
lsr.w d3,d4          ;shift right D3 times
move.l #$80008000,d5 ;set OFF pixel mask
lsr.l d3,d5          ;shift right D3 times
eor.l #$ffffffff,d5  ;toggle all bits in D5
bra	myphere

**************************************
* PLOT A PIXEL WITH MY ROUTINE       *
*                                    *
* CALL WITH:                         *
* myplot(X,Y,COLOR)                  *
**************************************
myplot:
movem.l	d0-d5/a0-a1,-(sp)
move.w pixelx,d0      ;x coordinate in D0
cmp.w #302,d0
bcc pltxit
cmpi.w	#113,d0
blt	pltxit
move.w d0,d3         ;duplicate in D3
andi.w #15,d3        ;mask off lower 4 bits
move.w pixely,d1      ;get y coordinate,
cmp.w #199,d1
bcc pltxit
lsl.w #2,d1          ;mult by 4 for index
move.w pixelcolor,d2      ;get color number

lsr.w 	#1,d0             ;x coord / 2
and.w #$00f8,d0      ;strip lower 3 bits
move.w d0,a0        ;move x offset to A0
move.l ytable,a1   ;get y table addr
adda.l 0(a1,d1.w),a0 ;got final pixel addr!
cmpi.w	#15,d3
beq	singlepix
move.w #$c000,d4     ;set ON pixel mask
lsr.w d3,d4          ;shift right D3 times
move.l #$c000c000,d5 ;set OFF pixel mask
lsr.l d3,d5          ;shift right D3 times
eor.l #$ffffffff,d5  ;toggle all bits in D5
bra	myphere

singlepix:
move.w #$8000,d4     ;set ON pixel mask
lsr.w d3,d4          ;shift right D3 times
move.l #$80008000,d5 ;set OFF pixel mask
lsr.l d3,d5          ;shift right D3 times
eor.l #$ffffffff,d5  ;toggle all bits in D5
and.l d5,(a0)        ;turn off old pixel
and.l d5,4(a0)       ;(both longwords)

******************************
* Now turn on the new pixel! *
******************************

* BIT 1 *

btst #0,d2           ;set the bit?
beq bbit2             ;no!
or.w d4,(a0)         ;turn it on!

* BIT 2 *

bbit2:
btst #1,d2           ;set it?
beq bbit4             ;no!
or.w d4,2(a0)        ;turn it on!

* BIT 4 *

bbit4:
btst #2,d2           ;set bit?
beq bbit8             ;no!
or.w d4,4(a0)        ;turn it on!

* BIT 8 *

bbit8:
btst #3,d2           ;set bit?
beq mysec           ;no, exit.
or.w d4,6(a0)        ;turn it on!

mysec:
adda.l	#8,a0
move.w #$8000,d4     ;set ON pixel mask
*lsr.w d3,d4          ;shift right D3 times
move.l #$80008000,d5 ;set OFF pixel mask
*lsr.l d3,d5          ;shift right D3 times
eor.l #$ffffffff,d5  ;toggle all bits in D5
and.l d5,(a0)        ;turn off old pixel
and.l d5,4(a0)       ;(both longwords)

******************************
*    Turn off old pixel!     *
******************************
myphere:

and.l d5,(a0)        ;turn off old pixel
and.l d5,4(a0)       ;(both longwords)

******************************
* Now turn on the new pixel! *
******************************

* BIT 1 *

btst #0,d2           ;set the bit?
beq bit2             ;no!
or.w d4,(a0)         ;turn it on!

* BIT 2 *

bit2:
btst #1,d2           ;set it?
beq bit4             ;no!
or.w d4,2(a0)        ;turn it on!

* BIT 4 *

bit4:
btst #2,d2           ;set bit?
beq bit8             ;no!
or.w d4,4(a0)        ;turn it on!

* BIT 8 *

bit8:
btst #3,d2           ;set bit?
beq pltxit           ;no, exit.
or.w d4,6(a0)        ;turn it on!

pltxit:
movem.l	(sp)+,d0-d5/a0-a1
	rts                  ;bye!

**********************
* get low-rez pixel  *
* get0(scrnbase,x,y) *
**********************
*gets pixel in hiden screen

mygetpix:
move.l hiden,a1
clr.w d0		;zero result register
move.w pixely,d3	;get Y coordinate
and.l #$0000ffff,d3	;mask off for multiply
mulu #160,d3		;multiply by 160 (# of bytes per scan line)
adda.l d3,a1		;add to screen base address
move.w pixelx,d1	;get X coordinate
move.w d1,d2		;duplicate it in D2
lsr.w #1,d1		;divide it by 2
and.w #$00f8,d1		;turn off lower 3 bits
adda.w d1,a1		;add to screen address register

move.w (a1),d3		;grab screen word
and.l #15,d2		;mask X to 0-15
move.w #$8000,d1	;set up bit mask
lsr.w d2,d1		;shift bit mask 0-15 bits
and.w d1,d3		;mask off bit 0
beq bit0b		;bit's off, go get next color bit
move.w #1,d0		;turn on bit 0 in result

bit0b:
move.w 2(a1),d3		;get screen word for bit 1 of color
and.w d1,d3		;get bit 1
beq bit0c		;it's off, try bit 2
or.w #2,d0		;turn on bit 1 in result

bit0c:
move.w 4(a1),d3		;get screen word for bit 2
and.w d1,d3		;get bit 2
beq bit0d		;it's off, try bit 3
or.w #4,d0		;turn on bit 2 in result

bit0d:
move.w 6(a1),d3		;get word for bit 3
and.w d1,d3		;get bit 3
beq getx0		;it's off!
or.w #8,d0		;turn on bit 3 in result

getx0:
rts
*************************************************
linea:  dc.w    $a000
        move.l  a0,linepar
        move.l  8(a0),intin
        move.l  12(a0),ptsin
        rts

*************************************************

***********************fancy clear screen****************
clearsc:move.l  #99,d0
        move.l  screen,a0
cl1:    move.w  #159,d1
cl2:    move.w  #0,(a0)+
        dbf     d1,cl2
        addi.l  #160,a0
        dbf     d0,cl1
        move.w  #99,d0
        move.l  screen,a0
        addi.l  #160,a0
cl3:    move.w  #159,d1
cl4:    move.w  #0,(a0)+
        dbf     d1,cl4
        addi.l  #160,a0
        dbf     d0,cl3
        rts


cldel:  move.w  #3000,d2
cdel1:  nop
        dbf     d2,cdel1
        rts
********************************
copyintoboth:
        move.l  hiden,a0
        move.l  seen,a1
        move.w  #4000,d0
cib3:
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        dbf     d0,cib3
*now clear the title stuff out
*	bsr	clita
	rts

        move.l  screen3,a0
        move.l  screen1,a1
        move.w  #4000,d0
cib:
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        dbf     d0,cib
        move.l  screen3,a0
        move.l  screen2,a1
        move.w  #4000,d0
cib2:
        move.l  (a0)+,(a1)+
        move.l  (a0)+,(a1)+
        dbf     d0,cib2


        rts


clita:
        move.l  screen3,a1      ;first copy from third to hiden
        move.l  #149,d0
        add.l   #4000,a1
clit:
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+

        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+

        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+

        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+

        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+

        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+

        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
        move.w  #0,(a1)+
*        adda    #48,a0
        adda    #48,a1
        dbf     d0,clit
	rts
********************fancy copy screen*************
copysc: move.w  #99,d0
        move.l  screen,a0
        move.l  screen2,a1
cop1:   move.w  #159,d1
cop2:   move.w  (a1)+,(a0)+
        dbf     d1,cop2
        addi.l  #160,a0
        addi.l  #160,a1
        dbf     d0,cop1
        move.w  #99,d0
        move.l  screen,a0
        addi.l  #160,a0
        move.l  screen2,a1
        addi.l  #160,a1
cop3:   move.w  #159,d1
cop4:   move.w  (a1)+,(a0)+
        dbf     d1,cop4
        addi.l  #160,a0
        addi.l  #160,a1
        dbf     d0,cop3
        rts
**********************routine to print a dec nuber*************
prtnum: 
	move.w	#0,times
        move.l  #0,d7
        move.w  number,d7
        andi.l  #$ffff,d7
        move.l  #line,a5

dodec:  move.l  d7,d6
        divu    #10,d6
        move.w  d6,d7
        swap    d6
*        addi.w  #16,d6
        move.b  d6,(a5)+
        cmpi.w  #0,d7
        bne     dodec
	
out:    cmpa.l  #line,a5
        beq     decback
        move.b  -(a5),d7
        andi.w  #$ff,d7
	lea	numbers,a0
	mulu	#40,d7
	add.w	d7,a0
	move.w	#9,d0
	move.l	hiden,a1
	adda.w	numwhere,a1
oloop:
	move.b	(a0)+,(a1)
	move.b	(a0)+,2(a1)
	move.b	(a0)+,4(a1)
	move.b	(a0)+,6(a1)
	add.l	#160,a1
	dbf	d0,oloop
	addq.w	#1,times
	cmpi.w	#2,times
	blt	oh
	move.w	#0,times
	addq.w	#6,numwhere
oh:	addq.w	#1,numwhere
	
	bra	out
	rts        
decback:
	rts
times:	blk.w	1,0

prtnum2: 
        move.l  #0,d7
        move.w  number,d7
        andi.l  #$ffff,d7
        move.l  #line,a5

dodec2:  move.l  d7,d6
        divu    #10,d6
        move.w  d6,d7
        swap    d6
        addi.w  #48,d6
        move.b  d6,(a5)+
        cmpi.w  #0,d7
        bne     dodec2
	
out2:
	cmpa.l  #line,a5
        beq     decback2
        move.b  -(a5),d7
        andi.w  #$ff,d7
        move.w  d7,-(sp)
        move.w  #2,-(sp)
        trap    #1
        addq.l  #4,sp
        bra     out2

decback2:
	rts
*************puts my mouse interupt in***************** 

mmin:	blk.w	1,0
mmax:	blk.w	1,0
************get screen address***************
getscrn:move.w  #2,-(sp)
        trap    #14
        addq.l  #2,sp
        move.l  d0,screen
        move.l  d0,screen1
        move.l  d0,screen2
        subi.l  #$8000,screen2
        move.l  screen2,map
        subi.l  #192000,map
	move.l	map,blocks
	subi.l	#38400,blocks
        move.l  screen1,seen
        move.l  screen2,hiden
	move.l	#ytable2,ytable
	move.l	#ytable1,sytable
        rts

map:	blk.l	1,0
************change colors****************
docolors:
	move.l temppal,-(sp)
        move.w #6,-(sp)
        trap #14
        addq.l #6,sp
        rts
************change colors****************

darkcolors:
        move.l #palette2,-(sp)
        move.w #6,-(sp)
        trap #14
        addq.l #6,sp
        rts

*****************wait for a key*********************
wait:   move.w  $26e6,d0
        cmpi.w  #2,d0
        beq     wback
        bra     wait
wback:  rts
***************turn mouse off***********************
mousof: dc.w    $a00a   
        rts

*******************************************************************
; SYSNOPSIS
;    RandomSeed( SeedValue )
;                   D0

randomseed:     ADD.L   D0,D1           ;user seed in d0 (d1 too)
                MOVEM.L D0/D1,RND

; drops through to the main random function (not user callable)

LongRnd:        MOVEM.L D2-D3,-(SP)     
                MOVEM.L RND,D0/D1       ;D0=LSB's, D1=MSB's of random number
                ANDI.B  #$0E,D0         ;ensure upper 59 bits are an...
                ORI.B   #$20,D0         ;...odd binary number
                MOVE.L  D0,D2
                MOVE.L  D1,D3
                ADD.L   D2,D2           ;accounts for 1 of 17 left shifts
                ADDX.L  D3,D3           ;[D2/D3] = RND*2
                ADD.L   D2,D0
                ADDX.L  D3,D1           ;[D0/D1] = RND*3
                SWAP    D3              ;shift [D2/D3] additional 16 times
                SWAP    D2
                MOVE.W  D2,D3
                CLR.W   D2
                ADD.L   D2,D0           ;add to [D0/D1]
                ADDX.L  D3,D1
                MOVEM.L D0/D1,RND       ;save for next time through
                MOVE.L  D1,D0           ;most random part to D0
                MOVEM.L (SP)+,D2-D3
                RTS

; SYSNOPSIS
;    RndNum = Random( UpperLimit )
;      D0                 D0

random:         MOVE.W  D2,-(SP)
                MOVE.W  D0,D2           ;save upper limit
                BEQ.S   r1              ;range of 0 returns 0 always
                BSR.S   LongRnd         ;get a longword random number
                CLR.W   D0              ;use upper word (it's most random)
                SWAP    D0
                ext.l   d0
                DIVs    D2,D0           ;divide by range...
                CLR.W   D0              ;...and use remainder for the value
                SWAP    D0              ;result in D0.W
r1:             MOVE.W  (SP)+,D2
                RTS

randomplus:     MOVE.W  D2,-(SP)
                MOVE.W  D0,D2           ;save upper limit
                BEQ.S   r2              ;range of 0 returns 0 always
                BSR.S   LongRnd         ;get a longword random number
                CLR.W   D0              ;use upper word (it's most random)
                SWAP    D0
                DIVu    D2,D0           ;divide by range...
                CLR.W   D0              ;...and use remainder for the value
                SWAP    D0              ;result in D0.W
r2:             MOVE.W  (SP)+,D2
                RTS





*********************************************************
*       a brilliant routine courtesy of janko to        *
*       insert the vbi addresses in the jump table      *
*       lea address of routine in a0 do a jsr           *
*       putvbl and thats it!!!                          *
*********************************************************


putvbl: lea     $452,a1
        move.w  #1,(a1)
        moveq   #7,d1
        lea     $456,a1
        move.l  (a1),a1
vbl3:   subq.b  #1,d1
        cmpi.b  #0,d1
        beq.s   vbl4
        move.l  (a1)+,d0
        cmpi.l  #0,d0
        bne.S   vbl3
        suba.l  #4,a1
        move.l  a0,(a1)
vbl4:   rts


oldvbl1:	
	blk.l	1,0
oldvbl2:
	blk.l	1,0

*********************************************************
*       my routines for loading in the screens          *
*       note i use degas format even though I           *
*       hate the package,due to it's simple format      *
*       ie: 32l for pallette and straight 32k screen    *
*       dump                                            *
*********************************************************

loadscr:move    #0,-(SP)        ;Open file
        move.l  #filename,-(SP) ;Address of filename
        move    #$3D,-(SP)
        trap    #1              ;Get handle number in D0
        addq.l  #8,SP
                
        move    D0,-(SP)        ;Save handle

        move.l  #dummy,-(SP)    ;load pallette into safe area
        move.l  #128,-(SP)       ;length to read in
        move    D0,-(SP)        ;Handle
        move    #$3F,-(SP)      ;bios number
        trap    #1              ;Read file in
        addi.l   #12,SP
        move    (sp),d0        
               
        move.l  hiden,-(SP)    ;load it straight onto screen
        move.l  #32000,-(SP)    ;length to read in
        move    D0,-(SP)        ;Handle
        move    #$3F,-(SP)      ;bios number
        trap    #1              ;Read file in
        addi.l   #12,SP
                
        move    #$3E,-(SP)      ;Handle already on stack
        trap    #1              ;Close file
        addq.l  #4,SP
        rts

*********************************************************
loadblocks:
	move    #0,-(SP)        ;Open file
        move.l  fileblocks,-(SP) ;Address of filename
        move    #$3D,-(SP)
        trap    #1              ;Get handle number in D0
        addq.l  #8,SP
                
        move    D0,-(SP)        ;Save handle

        move    (sp),d0        
               
        move.l  blocks,-(SP)    ;load it straight onto screen
        move.l  #38400,-(SP)    ;length to read in
        move    D0,-(SP)        ;Handle
        move    #$3F,-(SP)      ;bios number
        trap    #1              ;Read file in
        addi.l   #12,SP
                
        move    #$3E,-(SP)      ;Handle already on stack
        trap    #1              ;Close file
        addq.l  #4,SP
        rts
*********************************************************
loadfinal:
	move    #0,-(SP)        ;Open file
        move.l  #filefinal,-(SP) ;Address of filename
        move    #$3D,-(SP)
        trap    #1              ;Get handle number in D0
        addq.l  #8,SP
                
        move    D0,-(SP)        ;Save handle

        move    (sp),d0        
               
        move.l  blocks,-(SP)    ;load it straight onto screen
        move.l  #19200,-(SP)    ;length to read in
        move    D0,-(SP)        ;Handle
        move    #$3F,-(SP)      ;bios number
        trap    #1              ;Read file in
        addi.l   #12,SP
                
        move    #$3E,-(SP)      ;Handle already on stack
        trap    #1              ;Close file
        addq.l  #4,SP
        rts

fileblocks:
	blk.l	1,0
fileice:
	dc.b	'ice.dat',0
filejungle:
	dc.b	'jungle.dat',0
filecurv:
	dc.b	'curv.dat',0
filedoric:
	dc.b	'doric.dat',0
fileblobs:
	dc.b	'blobs.dat',0
fileic:
	dc.b	'ic.dat',0
filefinal:
	dc.b	'final.dat',0
	even
******************************
*******************blocks for rotated sprites*************
myshipbuffer:
	blk.w	1920,0

myshipmask:
	blk.w	960,0
myballbuffer:
	blk.w	1920,0
myballmask:
	blk.w	960,0
myballbbuffer:
	blk.w	1920,0
myballbmask:
	blk.w	960,0
mymeteorbuffer:
	blk.w	1920,0
mymeteormask:
	blk.w	960,0
mydronebuffer:
	blk.w	1152,0
mydronemask:
	blk.w	576,0
myboombuffer:
	blk.w	1024,0
myboommask:
	blk.w	512,0
myat1buffer:
	blk.w	1408,0
myat1mask:
	blk.w	704,0
myat2buffer:
	blk.w	1408,0
myat2mask:
	blk.w	704,0
myat3buffer:
	blk.w	1408,0
myat3mask:
	blk.w	704,0
myat4buffer:
	blk.w	1408,0
myat4mask:
	blk.w	704,0
mybonusbuffer:
	blk.w	1408,0
mybonusmask:
	blk.w	704,0
offset:	blk.w	1,0
origptr:	blk.l	1,0
screen3:blk.l   1,0
pblock: blk.l   50
screen: blk.l   1
screen2:blk.l   1
screen1:blk.l   1
dummy:  blk.l   32
filename:       dc.b    'atax.neo',0  
even
line:   blk.b   10
number: blk.w   1
even
ships:	blk.w	1,0
intin:  blk.l   1
ptsin:  blk.l   1
putpix: equ     $a001
getpix: equ     $a002
seen:   blk.l   1
hiden:  blk.l   1
palette2:
        dc.w    $0000,$0000,$0000
        dc.w    $0000,$0000,$0000
        dc.w    $0000,$0000,$0000
        dc.w    $0000,$0000,$0000
        dc.w    $0000,$0000,$0000
        dc.w    $0000
rnd:            blk.l   2,0
score:          blk.w   1,0
level:          blk.w   1,0
linepar:        blk.l   1,0
pulsecol:	blk.w	1,0

titlepalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0477
	dc.w	$0366,$0244,$0570,$0460,$0340,$0700,$0600,$0700
icepalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0077
	dc.w	$0066,$0055,$0044,$0033,$0022,$0250,$0130,$0700
junglepalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0460
	dc.w	$0450,$0340,$0230,$0640,$0420,$0607,$0404,$0700
curvpalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0563
	dc.w	$0553,$0442,$0342,$0331,$0221,$0077,$0033,$0700
doricpalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0777
	dc.w	$0666,$0555,$0444,$0333,$0222,$0770,$0440,$0700
blobspalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0745
	dc.w	$0644,$0534,$0433,$0423,$0322,$0070,$0030,$0700
icpalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0777
	dc.w	$0555,$0222,$0111,$0507,$0304,$0740,$0530,$0700
finalpalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0750
	dc.w	$0640,$0530,$0420,$0077,$0055,$0033,$0070,$0700
storypalette:
	dc.w	$0000,$0777,$0555,$0333,$0007,$0005,$0004,$0447
	dc.w	$0557,$0667,$0777,$0310,$0420,$0531,$0642,$0754

blocks:	blk.l	1,0

temppal:
	blk.l	1,0
numbers:
	 dc.b	$7F,$FF,$00,$00,$81,$01,$7E,$00
	 dc.b	$9D,$21,$42,$00,$A5,$39,$42,$00
	 dc.b	$A5,$39,$42,$00,$A5,$39,$42,$00
	 dc.b	$A5,$39,$42,$00,$B9,$3D,$42,$00
	 dc.b	$81,$01,$7E,$00,$FE,$01,$00,$00
	 dc.b	$18,$FF,$00,$00,$28,$CF,$10,$00
	 dc.b	$28,$CF,$10,$00,$28,$CF,$10,$00
	 dc.b	$28,$CF,$10,$00,$28,$CF,$10,$00
	 dc.b	$28,$CF,$10,$00,$28,$CF,$10,$00
	 dc.b	$28,$CF,$10,$00,$30,$CF,$00,$00
	 dc.b	$7F,$FF,$00,$00,$81,$01,$7E,$00
	 dc.b	$FD,$01,$02,$00,$79,$FD,$02,$00
	 dc.b	$81,$01,$7E,$00,$9E,$21,$40,$00
	 dc.b	$A0,$3F,$40,$00,$BF,$3F,$40,$00
	 dc.b	$81,$01,$7E,$00,$FE,$01,$00,$00
	 dc.b	$7F,$FF,$00,$00,$81,$01,$7E,$00
	 dc.b	$FD,$01,$02,$00,$39,$FD,$02,$00
	 dc.b	$41,$81,$3E,$00,$7D,$81,$02,$00
	 dc.b	$05,$F9,$02,$00,$79,$FD,$02,$00
	 dc.b	$81,$01,$7E,$00,$FE,$01,$00,$00
	 dc.b	$63,$FF,$00,$00,$A5,$39,$42,$00
	 dc.b	$A5,$39,$42,$00,$B9,$3D,$42,$00
	 dc.b	$81,$01,$7E,$00,$FD,$01,$02,$00
	 dc.b	$05,$F9,$02,$00,$05,$F9,$02,$00
	 dc.b	$05,$F9,$02,$00,$06,$F9,$00,$00
	 dc.b	$7F,$FF,$00,$00,$81,$01,$7E,$00
	 dc.b	$BE,$01,$40,$00,$BF,$3F,$40,$00
	 dc.b	$81,$01,$7E,$00,$F9,$05,$02,$00
	 dc.b	$05,$FD,$02,$00,$7D,$FD,$02,$00
	 dc.b	$81,$01,$7E,$00,$FE,$01,$00,$00
	 dc.b	$7F,$FF,$00,$00,$81,$01,$7E,$00
	 dc.b	$BE,$01,$40,$00,$BF,$3F,$40,$00
	 dc.b	$81,$01,$7E,$00,$9D,$21,$42,$00
	 dc.b	$A5,$39,$42,$00,$B9,$3D,$42,$00
	 dc.b	$81,$01,$7E,$00,$FE,$01,$00,$00
	 dc.b	$7F,$FF,$00,$00,$81,$01,$7E,$00
	 dc.b	$FD,$01,$02,$00,$05,$F9,$02,$00
	 dc.b	$05,$F9,$02,$00,$05,$F9,$02,$00
	 dc.b	$05,$F9,$02,$00,$05,$F9,$02,$00
	 dc.b	$05,$F9,$02,$00,$06,$F9,$00,$00
	 dc.b	$7F,$FF,$00,$00,$81,$01,$7E,$00
	 dc.b	$9D,$21,$42,$00,$B9,$3D,$42,$00
	 dc.b	$81,$01,$7E,$00,$9D,$21,$42,$00
	 dc.b	$A5,$39,$42,$00,$B9,$3D,$42,$00
	 dc.b	$81,$01,$7E,$00,$FE,$01,$00,$00
	 dc.b	$7F,$FF,$00,$00,$81,$01,$7E,$00
	 dc.b	$9D,$21,$42,$00,$B9,$3D,$42,$00
	 dc.b	$81,$01,$7E,$00,$FD,$01,$02,$00
	 dc.b	$05,$F9,$02,$00,$05,$F9,$02,$00
	 dc.b	$05,$F9,$02,$00,$06,$F9,$00,$00

bars:	dc.w	$FFFF,$0000,$FFFF,$FFFF,$FEBF,$FF7F,$0000,$0000
	dc.w	$0001,$FFFE,$FFFF,$FFFF,$FFFF,$0000,$FFFF,$FFFF
	dc.w	$FAFF,$FDFF,$0000,$0000,$0001,$FFFE,$FFFF,$FFFF
	dc.w	$FFFF,$0000,$FFFF,$FFFF,$FFEB,$FFF7,$0000,$0000
	dc.w	$0001,$FFFE,$FFFF,$FFFF

ballb:
	dc.w	$0000,$0000,$0000,$07C0,$1440,$0440,$0000,$1FF0
	dc.w	$3C70,$1C70,$0000,$3FF8,$0C68,$4C68,$2000,$7FFC
	dc.w	$04D8,$44D8,$3080,$7F7C,$01FC,$81FC,$79C0,$FE3E
	dc.w	$33E0,$C360,$0360,$FC1E,$31C0,$C1C0,$01C0,$FE3E
	dc.w	$3080,$C080,$0080,$FF7E,$003C,$803C,$7800,$FFFE
	dc.w	$0818,$4018,$3440,$7FFC,$038C,$5008,$2C60,$7FFC
	dc.w	$0388,$2000,$1C70,$3FF8,$0000,$1BB0,$0440,$1FF0
	dc.w	$0000,$07C0,$0000,$07C0
myship:
 dc.w 256,0,0,0
 dc.w 256,0,0,0
 dc.w 640,768,0,0
 dc.w 640,768,0,0
 dc.w 4752,768,0,0
 dc.w 5840,768,1088,0
 dc.w 13400,8960,1728,0
 dc.w 14392,12128,640,0
 dc.w 12568,11872,896,0
 dc.w 26924,30320,896,0
 dc.w 54614,57888,16376,0
 dc.w 35106,63472,24844,256
 dc.w 43690,63216,17028,640
 dc.w 60142,63216,640,640
 dc.w 31868,31856,3168,3168

*    pixels/scanline    = $0007 (bytes/scanline: $0008)
*  # scanlines (height) = $0009

drone:
	dc.w	$3000,$3000,$3000,$3000,$4800,$7800,$7800,$4800
	dc.w	$2000,$4000,$7800,$0000,$9400,$C400,$EC00,$8400
	dc.w	$2000,$C400,$FC00,$0000,$B400,$CC00,$FC00,$8400
	dc.w	$0000,$7800,$7800,$0000,$4800,$7800,$7800,$4800
	dc.w	$3000,$3000,$3000,$3000

boom:	dc.w	$6000,$6000,$6000,$6000,$B000,$D000,$D000,$D000
	dc.w	$9000,$F000,$F000,$F000,$6000,$6000,$6000,$6000

ball:	dc.w	$03C0,$03C0,$0400,$07C0,$0C10,$0FF0,$1000,$1FF0
	dc.w	$13F0,$1C08,$2000,$3FF8,$141C,$1804,$6000,$7FFC
	dc.w	$29C8,$31C4,$41C0,$7E3C,$2BEA,$33A6,$C3A0,$FC1E
	dc.w	$2BEA,$33A6,$C3A0,$FC1E,$2BEA,$33E6,$C3E0,$FC1E
	dc.w	$29CA,$31C6,$C1C0,$FE3E,$1414,$180C,$E002,$FFFE
	dc.w	$13E4,$1C1C,$6000,$7FFC,$0C18,$0FF8,$7004,$7FFC
	dc.w	$03E0,$03E0,$3C18,$3FF8,$0000,$0000,$1FF0,$1FF0
	dc.w	$0000,$0000,$07C0,$07C0

attacker1:
	dc.w	$1F00,$0000,$0000,$0000,$0E80,$2E00,$0000,$0000
	dc.w	$0E40,$4E00,$0000,$0000,$1F20,$9100,$0000,$0000
	dc.w	$3380,$3880,$0C00,$0000,$3180,$3080,$0E00,$0000
	dc.w	$3980,$3A80,$0600,$0000,$9F00,$9F20,$0000,$0000
	dc.w	$4E00,$4E40,$0000,$0000,$2E00,$2080,$0000,$0000
	dc.w	$1F00,$1F00,$0000,$0000

attacker2:
	dc.w	$1F00,$0000,$0000,$0000,$0080,$2000,$0000,$0000
	dc.w	$0E40,$4000,$0000,$0000,$8120,$9E00,$0000,$0000
	dc.w	$A4A0,$BF00,$0400,$0400,$AEA0,$BF00,$0E00,$0E00
	dc.w	$A4A0,$BF00,$0400,$0400,$9020,$9F00,$0000,$0000
	dc.w	$4E00,$4E40,$0000,$0000,$2000,$2080,$0000,$0000
	dc.w	$1F00,$1F00,$0000,$0000

bonus:	dc.w	$1F00,$0000,$0000,$0000,$3F80,$1F00,$3F00,$3F00
	dc.w	$7FC0,$3180,$7180,$7180,$7FE0,$E0C0,$FEC0,$FEC0
	dc.w	$5FE0,$E040,$FF40,$FF40,$5FE0,$E040,$FF40,$FF40
	dc.w	$5FE0,$E040,$FF40,$FF40,$6FE0,$F0C0,$FFC0,$FFC0
	dc.w	$31C0,$7F80,$7FC0,$7FC0,$1F80,$3F00,$3F80,$3F80
	dc.w	$0000,$1F00,$1F00,$1F00

attacker3:
	dc.w	$0E00,$0000,$0E00,$0E00,$0E80,$2000,$0E00,$0E00
	dc.w	$0EC0,$6000,$0E00,$0E00,$0000,$0E00,$0000,$0000
	dc.w	$00E0,$FF00,$E0E0,$E0E0,$00E0,$FF00,$E0E0,$E0E0
	dc.w	$00E0,$FF00,$E0E0,$E0E0,$0000,$0E00,$0000,$0000
	dc.w	$6000,$6EC0,$0E00,$0E00,$2000,$2E80,$0E00,$0E00
	dc.w	$0000,$0E00,$0E00,$0E00

attacker4:
	dc.w	$0400,$0400,$0400,$0400,$0400,$0400,$0400,$0400
	dc.w	$0E80,$2400,$0400,$0400,$0100,$1000,$0E00,$0000
	dc.w	$2E80,$3000,$1F00,$0000,$EEE0,$F0E0,$FFE0,$E0E0
	dc.w	$2E80,$3000,$1F00,$0000,$1000,$1F00,$0E00,$0000
	dc.w	$2E00,$2E80,$0400,$0400,$0400,$0400,$0400,$0400
	dc.w	$0400,$0400,$0400,$0400

meteor:
	dc.w	$0000,$0000,$0600,$0000,$0200,$0400,$0980,$0000
	dc.w	$0A00,$0D80,$1040,$0000,$1B40,$1C80,$2030,$0000
	dc.w	$1430,$1BE0,$2008,$0000,$1290,$3DE0,$4008,$0000
	dc.w	$0A70,$7DF0,$8008,$0000,$3540,$3EA0,$4010,$0000
	dc.w	$1700,$1BC0,$2020,$0000,$1780,$1BC0,$2020,$0000
	dc.w	$0800,$0E00,$11C0,$0000,$0400,$0600,$0900,$0000
	dc.w	$0000,$0000,$0600,$0000




*	spat1:056
spat1:
 dc.w 165,000
 dc.w 163,000
 dc.w 160,000
 dc.w 157,000
 dc.w 154,000
 dc.w 151,000
 dc.w 148,000
 dc.w 145,000
 dc.w 141,001
 dc.w 138,003
 dc.w 134,005
 dc.w 131,007
 dc.w 128,010
 dc.w 126,012
 dc.w 125,015
 dc.w 124,018
 dc.w 123,021
 dc.w 123,025
 dc.w 123,029
 dc.w 123,032
 dc.w 125,035
 dc.w 129,037
 dc.w 133,041
 dc.w 137,044
 dc.w 142,047
 dc.w 146,050
 dc.w 149,050
 dc.w 153,050
 dc.w 157,050
 dc.w 161,050
 dc.w 166,050
 dc.w 170,050
 dc.w 175,049
 dc.w 179,048
 dc.w 185,048
 dc.w 190,047
 dc.w 195,046
 dc.w 199,044
 dc.w 203,041
 dc.w 206,038
 dc.w 208,034
 dc.w 209,029
 dc.w 210,025
 dc.w 209,021
 dc.w 207,017
 dc.w 204,013
 dc.w 201,010
 dc.w 197,007
 dc.w 194,003
 dc.w 189,000
 dc.w 184,000
 dc.w 180,000
 dc.w 175,000
 dc.w 170,000
 dc.w 168,000
 dc.w 166,000
 dc.w 193,006

*	spat3:034
spat3:
 dc.w 159,000
 dc.w 156,000
 dc.w 151,000
 dc.w 145,000
 dc.w 138,000
 dc.w 131,000
 dc.w 124,000
 dc.w 117,000
 dc.w 113,000
 dc.w 115,000
 dc.w 118,000
 dc.w 124,000
 dc.w 131,000
 dc.w 139,000
 dc.w 149,000
 dc.w 160,000
 dc.w 173,000
 dc.w 184,000
 dc.w 193,000
 dc.w 202,000
 dc.w 210,000
 dc.w 213,000
 dc.w 210,000
 dc.w 207,000
 dc.w 202,000
 dc.w 196,000
 dc.w 188,000
 dc.w 181,000
 dc.w 175,000
 dc.w 169,000
 dc.w 163,000
 dc.w 161,000
 dc.w 160,000
 dc.w 159,000
 dc.w 201,000

*103
spat4:
 dc.w 149,000
 dc.w 148,000
 dc.w 147,000
 dc.w 147,001
 dc.w 146,001
 dc.w 146,002
 dc.w 145,003
 dc.w 144,004
 dc.w 143,005
 dc.w 141,007
 dc.w 139,009
 dc.w 137,011
 dc.w 135,012
 dc.w 133,013
 dc.w 132,015
 dc.w 130,016
 dc.w 128,017
 dc.w 126,018
 dc.w 124,019
 dc.w 123,020
 dc.w 122,021
 dc.w 121,021
 dc.w 120,021
 dc.w 119,021
 dc.w 119,022
 dc.w 118,022
 dc.w 117,023
 dc.w 116,023
 dc.w 115,024
 dc.w 115,025
 dc.w 116,026
 dc.w 119,028
 dc.w 121,031
 dc.w 125,033
 dc.w 127,035
 dc.w 130,037
 dc.w 132,039
 dc.w 133,040
 dc.w 135,041
 dc.w 136,043
 dc.w 138,044
 dc.w 139,045
 dc.w 140,046
 dc.w 141,048
 dc.w 143,049
 dc.w 146,050
 dc.w 148,050
 dc.w 150,050
 dc.w 152,050
 dc.w 154,050
 dc.w 155,050
 dc.w 156,050
 dc.w 156,049
 dc.w 157,047
 dc.w 159,046
 dc.w 161,045
 dc.w 162,043
 dc.w 164,043
 dc.w 165,042
 dc.w 166,041
 dc.w 168,039
 dc.w 170,038
 dc.w 172,037
 dc.w 175,036
 dc.w 178,035
 dc.w 180,034
 dc.w 182,032
 dc.w 183,031
 dc.w 185,030
 dc.w 186,030
 dc.w 187,029
 dc.w 189,028
 dc.w 191,027
 dc.w 193,026
 dc.w 194,025
 dc.w 196,025
 dc.w 197,024
 dc.w 197,023
 dc.w 196,023
 dc.w 193,021
 dc.w 189,019
 dc.w 186,018
 dc.w 184,016
 dc.w 182,015
 dc.w 180,013
 dc.w 179,011
 dc.w 177,010
 dc.w 175,009
 dc.w 173,008
 dc.w 170,007
 dc.w 168,006
 dc.w 165,005
 dc.w 162,003
 dc.w 160,001
 dc.w 159,000
 dc.w 158,000
 dc.w 157,000
 dc.w 156,000
 dc.w 155,000
 dc.w 154,000
 dc.w 153,000
 dc.w 151,000
 dc.w 150,000
 dc.w 129,047

*118
spat5:
 dc.w 113,001
 dc.w 114,003
 dc.w 115,003
 dc.w 115,004
 dc.w 116,004
 dc.w 116,005
 dc.w 117,005
 dc.w 118,006
 dc.w 119,007
 dc.w 120,009
 dc.w 121,010
 dc.w 122,011
 dc.w 123,013
 dc.w 125,015
 dc.w 127,016
 dc.w 128,018
 dc.w 129,019
 dc.w 131,021
 dc.w 133,023
 dc.w 134,025
 dc.w 135,027
 dc.w 137,029
 dc.w 138,031
 dc.w 140,033
 dc.w 141,035
 dc.w 143,037
 dc.w 145,038
 dc.w 146,041
 dc.w 148,043
 dc.w 150,045
 dc.w 151,048
 dc.w 153,050
 dc.w 154,050
 dc.w 156,050
 dc.w 157,050
 dc.w 158,050
 dc.w 159,050
 dc.w 160,050
 dc.w 161,050
 dc.w 162,049
 dc.w 162,048
 dc.w 164,047
 dc.w 165,045
 dc.w 166,044
 dc.w 167,042
 dc.w 169,041
 dc.w 170,039
 dc.w 171,037
 dc.w 172,037
 dc.w 173,035
 dc.w 174,035
 dc.w 176,033
 dc.w 177,032
 dc.w 179,029
 dc.w 181,027
 dc.w 183,025
 dc.w 185,023
 dc.w 187,021
 dc.w 189,020
 dc.w 191,019
 dc.w 192,017
 dc.w 194,015
 dc.w 195,014
 dc.w 197,013
 dc.w 199,012
 dc.w 200,010
 dc.w 202,009
 dc.w 204,008
 dc.w 205,006
 dc.w 208,005
 dc.w 210,004
 dc.w 212,003
 dc.w 213,001
 dc.w 213,000
 dc.w 211,000
 dc.w 209,000
 dc.w 208,000
 dc.w 206,000
 dc.w 204,000
 dc.w 202,000
 dc.w 200,000
 dc.w 197,000
 dc.w 194,000
 dc.w 192,000
 dc.w 190,000
 dc.w 188,000
 dc.w 186,000
 dc.w 184,000
 dc.w 182,000
 dc.w 179,000
 dc.w 175,000
 dc.w 172,000
 dc.w 168,000
 dc.w 165,000
 dc.w 162,000
 dc.w 159,000
 dc.w 156,000
 dc.w 152,000
 dc.w 148,000
 dc.w 145,000
 dc.w 142,000
 dc.w 139,000
 dc.w 137,000
 dc.w 134,000
 dc.w 132,000
 dc.w 131,000
 dc.w 129,000
 dc.w 128,000
 dc.w 126,000
 dc.w 124,000
 dc.w 123,000
 dc.w 122,000
 dc.w 120,000
 dc.w 119,000
 dc.w 118,000
 dc.w 116,000
 dc.w 114,000
 dc.w 113,000
 dc.w 134,032

*089
spat6:
 dc.w 167,036
 dc.w 166,037
 dc.w 165,038
 dc.w 163,039
 dc.w 161,040
 dc.w 160,041
 dc.w 158,042
 dc.w 156,042
 dc.w 154,043
 dc.w 152,044
 dc.w 150,044
 dc.w 148,044
 dc.w 146,044
 dc.w 143,045
 dc.w 140,045
 dc.w 137,045
 dc.w 134,045
 dc.w 132,044
 dc.w 130,043
 dc.w 129,041
 dc.w 129,040
 dc.w 128,039
 dc.w 127,037
 dc.w 127,035
 dc.w 127,033
 dc.w 127,030
 dc.w 127,028
 dc.w 128,025
 dc.w 128,024
 dc.w 129,023
 dc.w 131,021
 dc.w 132,021
 dc.w 134,020
 dc.w 135,020
 dc.w 137,019
 dc.w 139,019
 dc.w 141,019
 dc.w 143,019
 dc.w 144,019
 dc.w 145,019
 dc.w 147,019
 dc.w 149,020
 dc.w 152,022
 dc.w 154,025
 dc.w 156,028
 dc.w 158,030
 dc.w 159,032
 dc.w 161,035
 dc.w 162,037
 dc.w 164,039
 dc.w 166,042
 dc.w 168,044
 dc.w 171,046
 dc.w 173,047
 dc.w 176,048
 dc.w 179,050
 dc.w 183,050
 dc.w 186,050
 dc.w 190,050
 dc.w 193,050
 dc.w 197,050
 dc.w 201,050
 dc.w 204,049
 dc.w 207,048
 dc.w 209,046
 dc.w 210,043
 dc.w 211,040
 dc.w 211,037
 dc.w 211,033
 dc.w 210,031
 dc.w 209,028
 dc.w 207,027
 dc.w 205,025
 dc.w 202,025
 dc.w 200,024
 dc.w 197,024
 dc.w 194,024
 dc.w 191,024
 dc.w 188,024
 dc.w 186,025
 dc.w 183,026
 dc.w 180,027
 dc.w 178,029
 dc.w 175,030
 dc.w 173,031
 dc.w 172,033
 dc.w 170,034
 dc.w 170,036
 dc.w 169,036
 dc.w 201,005


*bonuspat093
bonuspat1:
 dc.w 113,002
 dc.w 113,003
 dc.w 113,004
 dc.w 113,006
 dc.w 113,008
 dc.w 114,010
 dc.w 115,012
 dc.w 115,015
 dc.w 116,018
 dc.w 118,022
 dc.w 119,025
 dc.w 120,029
 dc.w 121,031
 dc.w 122,034
 dc.w 123,036
 dc.w 125,040
 dc.w 127,044
 dc.w 129,049
 dc.w 132,054
 dc.w 134,058
 dc.w 138,062
 dc.w 142,067
 dc.w 147,072
 dc.w 152,076
 dc.w 157,080
 dc.w 163,084
 dc.w 168,087
 dc.w 175,091
 dc.w 182,094
 dc.w 188,097
 dc.w 193,100
 dc.w 198,101
 dc.w 204,102
 dc.w 208,102
 dc.w 212,101
 dc.w 216,099
 dc.w 220,095
 dc.w 223,091
 dc.w 225,087
 dc.w 226,083
 dc.w 226,079
 dc.w 226,075
 dc.w 225,071
 dc.w 224,067
 dc.w 222,064
 dc.w 220,061
 dc.w 218,059
 dc.w 216,058
 dc.w 213,057
 dc.w 211,055
 dc.w 208,055
 dc.w 206,054
 dc.w 203,053
 dc.w 201,053
 dc.w 198,053
 dc.w 195,053
 dc.w 193,053
 dc.w 191,054
 dc.w 189,056
 dc.w 188,058
 dc.w 186,060
 dc.w 185,062
 dc.w 184,065
 dc.w 183,068
 dc.w 183,072
 dc.w 183,075
 dc.w 183,079
 dc.w 183,083
 dc.w 184,088
 dc.w 185,091
 dc.w 186,096
 dc.w 190,100
 dc.w 193,104
 dc.w 196,107
 dc.w 200,110
 dc.w 203,113
 dc.w 209,117
 dc.w 213,120
 dc.w 217,123
 dc.w 221,126
 dc.w 225,129
 dc.w 232,134
 dc.w 239,137
 dc.w 244,140
 dc.w 250,144
 dc.w 257,150
 dc.w 263,156
 dc.w 268,161
 dc.w 273,167
 dc.w 278,172
 dc.w 283,178
 dc.w 288,182
 dc.w 289,184
 dc.w 113,161

*bpat2 088
bonuspat2:
 dc.w 288,001
 dc.w 287,003
 dc.w 287,004
 dc.w 286,007
 dc.w 284,009
 dc.w 283,013
 dc.w 281,016
 dc.w 279,020
 dc.w 276,025
 dc.w 273,029
 dc.w 270,033
 dc.w 266,037
 dc.w 262,042
 dc.w 258,047
 dc.w 254,053
 dc.w 249,057
 dc.w 244,063
 dc.w 239,068
 dc.w 233,075
 dc.w 227,079
 dc.w 221,084
 dc.w 215,089
 dc.w 209,093
 dc.w 200,098
 dc.w 192,101
 dc.w 185,104
 dc.w 178,105
 dc.w 171,107
 dc.w 164,107
 dc.w 158,107
 dc.w 153,107
 dc.w 149,106
 dc.w 147,103
 dc.w 146,100
 dc.w 145,097
 dc.w 145,094
 dc.w 145,090
 dc.w 146,086
 dc.w 148,083
 dc.w 150,079
 dc.w 153,076
 dc.w 156,072
 dc.w 159,069
 dc.w 164,066
 dc.w 169,063
 dc.w 174,060
 dc.w 179,058
 dc.w 184,055
 dc.w 190,053
 dc.w 195,051
 dc.w 199,050
 dc.w 203,049
 dc.w 208,049
 dc.w 211,049
 dc.w 213,050
 dc.w 214,051
 dc.w 215,054
 dc.w 216,056
 dc.w 217,059
 dc.w 218,062
 dc.w 218,066
 dc.w 219,070
 dc.w 219,074
 dc.w 220,079
 dc.w 220,083
 dc.w 220,087
 dc.w 219,092
 dc.w 217,096
 dc.w 215,101
 dc.w 213,106
 dc.w 211,111
 dc.w 207,116
 dc.w 204,120
 dc.w 200,125
 dc.w 197,129
 dc.w 193,133
 dc.w 189,139
 dc.w 185,143
 dc.w 180,147
 dc.w 174,151
 dc.w 168,156
 dc.w 159,161
 dc.w 151,165
 dc.w 143,170
 dc.w 135,174
 dc.w 128,179
 dc.w 119,184
 dc.w 113,184
 dc.w 113,184

*102
bonuspat3:
 dc.w 115,000
 dc.w 116,002
 dc.w 119,003
 dc.w 121,004
 dc.w 124,005
 dc.w 126,006
 dc.w 128,008
 dc.w 131,009
 dc.w 134,010
 dc.w 137,012
 dc.w 140,013
 dc.w 145,015
 dc.w 149,017
 dc.w 153,020
 dc.w 158,022
 dc.w 161,025
 dc.w 166,028
 dc.w 170,030
 dc.w 174,033
 dc.w 178,035
 dc.w 181,038
 dc.w 187,041
 dc.w 191,044
 dc.w 196,048
 dc.w 200,051
 dc.w 206,056
 dc.w 210,060
 dc.w 214,063
 dc.w 218,066
 dc.w 221,069
 dc.w 225,073
 dc.w 227,076
 dc.w 228,079
 dc.w 229,082
 dc.w 230,086
 dc.w 231,090
 dc.w 232,094
 dc.w 232,099
 dc.w 232,102
 dc.w 232,106
 dc.w 232,108
 dc.w 232,112
 dc.w 231,115
 dc.w 229,118
 dc.w 227,121
 dc.w 225,124
 dc.w 223,128
 dc.w 221,131
 dc.w 218,134
 dc.w 214,136
 dc.w 209,138
 dc.w 205,139
 dc.w 201,140
 dc.w 197,140
 dc.w 194,140
 dc.w 191,140
 dc.w 188,139
 dc.w 184,138
 dc.w 180,136
 dc.w 176,133
 dc.w 171,130
 dc.w 166,126
 dc.w 163,121
 dc.w 160,118
 dc.w 158,113
 dc.w 155,109
 dc.w 153,104
 dc.w 151,098
 dc.w 150,095
 dc.w 150,090
 dc.w 151,087
 dc.w 152,083
 dc.w 155,078
 dc.w 157,074
 dc.w 161,071
 dc.w 164,068
 dc.w 168,065
 dc.w 172,061
 dc.w 176,058
 dc.w 180,055
 dc.w 184,052
 dc.w 189,049
 dc.w 194,045
 dc.w 199,042
 dc.w 204,039
 dc.w 210,037
 dc.w 216,034
 dc.w 223,031
 dc.w 228,029
 dc.w 233,026
 dc.w 238,023
 dc.w 243,019
 dc.w 250,016
 dc.w 254,013
 dc.w 259,011
 dc.w 265,009
 dc.w 270,006
 dc.w 275,003
 dc.w 280,001
 dc.w 283,000
 dc.w 287,000
 dc.w 289,000
 dc.w 192,000

*100
bonuspat4:
 dc.w 114,000
 dc.w 115,000
 dc.w 116,000
 dc.w 117,001
 dc.w 118,001
 dc.w 119,001
 dc.w 120,002
 dc.w 122,002
 dc.w 124,002
 dc.w 126,003
 dc.w 129,004
 dc.w 132,004
 dc.w 135,005
 dc.w 138,006
 dc.w 142,006
 dc.w 146,007
 dc.w 150,008
 dc.w 155,009
 dc.w 162,010
 dc.w 169,011
 dc.w 177,012
 dc.w 185,014
 dc.w 194,015
 dc.w 203,016
 dc.w 210,018
 dc.w 217,019
 dc.w 224,021
 dc.w 229,023
 dc.w 235,026
 dc.w 239,028
 dc.w 242,030
 dc.w 243,034
 dc.w 244,036
 dc.w 244,038
 dc.w 244,042
 dc.w 244,045
 dc.w 242,048
 dc.w 240,051
 dc.w 237,053
 dc.w 233,054
 dc.w 229,056
 dc.w 224,057
 dc.w 219,058
 dc.w 212,060
 dc.w 206,062
 dc.w 200,062
 dc.w 194,064
 dc.w 187,065
 dc.w 180,067
 dc.w 175,068
 dc.w 171,070
 dc.w 167,073
 dc.w 163,074
 dc.w 159,076
 dc.w 157,079
 dc.w 155,082
 dc.w 154,084
 dc.w 154,088
 dc.w 155,090
 dc.w 157,093
 dc.w 160,096
 dc.w 164,099
 dc.w 168,102
 dc.w 174,104
 dc.w 181,106
 dc.w 188,107
 dc.w 195,108
 dc.w 203,110
 dc.w 212,111
 dc.w 219,113
 dc.w 226,115
 dc.w 231,118
 dc.w 236,121
 dc.w 240,124
 dc.w 242,127
 dc.w 245,130
 dc.w 246,133
 dc.w 246,136
 dc.w 246,139
 dc.w 244,142
 dc.w 241,144
 dc.w 238,147
 dc.w 233,150
 dc.w 228,152
 dc.w 221,156
 dc.w 215,158
 dc.w 208,160
 dc.w 202,162
 dc.w 197,164
 dc.w 192,167
 dc.w 189,170
 dc.w 187,172
 dc.w 186,173
 dc.w 185,174
 dc.w 185,175
 dc.w 184,176
 dc.w 184,178
 dc.w 183,179
 dc.w 183,180
 dc.w 183,181
 dc.w 221,184

*104
bonuspat5:
 dc.w 114,001
 dc.w 115,002
 dc.w 116,004
 dc.w 117,005
 dc.w 118,007
 dc.w 119,009
 dc.w 120,011
 dc.w 122,013
 dc.w 123,015
 dc.w 124,019
 dc.w 125,022
 dc.w 127,026
 dc.w 129,029
 dc.w 131,033
 dc.w 132,037
 dc.w 134,040
 dc.w 137,043
 dc.w 139,047
 dc.w 140,051
 dc.w 143,053
 dc.w 145,057
 dc.w 148,060
 dc.w 151,063
 dc.w 155,067
 dc.w 157,071
 dc.w 161,073
 dc.w 164,076
 dc.w 167,079
 dc.w 170,082
 dc.w 173,085
 dc.w 177,088
 dc.w 180,091
 dc.w 185,095
 dc.w 189,097
 dc.w 192,100
 dc.w 196,103
 dc.w 200,105
 dc.w 204,106
 dc.w 209,107
 dc.w 215,109
 dc.w 220,109
 dc.w 226,109
 dc.w 232,110
 dc.w 237,110
 dc.w 244,110
 dc.w 248,108
 dc.w 253,106
 dc.w 257,103
 dc.w 261,099
 dc.w 264,094
 dc.w 265,089
 dc.w 266,085
 dc.w 266,080
 dc.w 266,075
 dc.w 266,071
 dc.w 265,068
 dc.w 263,065
 dc.w 260,061
 dc.w 256,058
 dc.w 251,056
 dc.w 247,054
 dc.w 244,052
 dc.w 239,051
 dc.w 235,050
 dc.w 232,050
 dc.w 228,050
 dc.w 224,050
 dc.w 221,052
 dc.w 216,053
 dc.w 210,055
 dc.w 206,058
 dc.w 202,061
 dc.w 197,064
 dc.w 193,067
 dc.w 189,071
 dc.w 186,074
 dc.w 183,078
 dc.w 179,082
 dc.w 175,085
 dc.w 171,090
 dc.w 169,094
 dc.w 165,099
 dc.w 161,104
 dc.w 156,110
 dc.w 149,117
 dc.w 144,121
 dc.w 140,126
 dc.w 136,130
 dc.w 133,135
 dc.w 129,140
 dc.w 127,144
 dc.w 125,148
 dc.w 124,152
 dc.w 122,157
 dc.w 120,161
 dc.w 117,165
 dc.w 115,168
 dc.w 113,172
 dc.w 113,174
 dc.w 113,177
 dc.w 113,179
 dc.w 113,181
 dc.w 113,183
 dc.w 113,184
 dc.w 129,153

*089
bonuspat6:
 dc.w 289,002
 dc.w 288,004
 dc.w 287,006
 dc.w 285,009
 dc.w 284,013
 dc.w 282,016
 dc.w 281,021
 dc.w 279,025
 dc.w 277,029
 dc.w 274,033
 dc.w 271,039
 dc.w 268,043
 dc.w 266,048
 dc.w 263,053
 dc.w 259,058
 dc.w 256,063
 dc.w 253,068
 dc.w 250,073
 dc.w 247,079
 dc.w 242,085
 dc.w 238,090
 dc.w 234,095
 dc.w 230,101
 dc.w 226,105
 dc.w 221,111
 dc.w 216,116
 dc.w 210,120
 dc.w 205,124
 dc.w 198,128
 dc.w 190,131
 dc.w 184,133
 dc.w 179,134
 dc.w 174,135
 dc.w 169,135
 dc.w 165,135
 dc.w 162,134
 dc.w 159,132
 dc.w 158,128
 dc.w 156,126
 dc.w 155,122
 dc.w 154,118
 dc.w 154,113
 dc.w 154,108
 dc.w 154,104
 dc.w 154,099
 dc.w 154,094
 dc.w 155,090
 dc.w 157,086
 dc.w 159,081
 dc.w 162,078
 dc.w 165,074
 dc.w 167,071
 dc.w 170,068
 dc.w 173,066
 dc.w 176,065
 dc.w 178,064
 dc.w 180,064
 dc.w 182,064
 dc.w 185,064
 dc.w 187,064
 dc.w 189,065
 dc.w 190,066
 dc.w 192,067
 dc.w 194,069
 dc.w 197,070
 dc.w 199,072
 dc.w 202,075
 dc.w 205,077
 dc.w 208,080
 dc.w 211,083
 dc.w 215,087
 dc.w 219,091
 dc.w 224,095
 dc.w 229,101
 dc.w 233,105
 dc.w 236,110
 dc.w 240,116
 dc.w 245,122
 dc.w 250,129
 dc.w 254,135
 dc.w 258,141
 dc.w 262,147
 dc.w 266,155
 dc.w 270,161
 dc.w 274,167
 dc.w 278,172
 dc.w 282,178
 dc.w 287,184
 dc.w 289,184
 dc.w 289,183

shootdata:
	dc.b	0,$0,1,$f,2,$0,3,$0,4,$0,5,$0,6,$0
	dc.b	7,$3d
	dc.b	8,$0
	dc.b	9,$10,10,$0,11,$0,12,$10,13,$9
	dc.b	$80,$01
	dc.b	$81,$2,$10,$0
	dc.b	$82,0

bboomdata:
	dc.b	0,$0,1,$0,2,$0,3,$0,4,$0,5,$0,6,$0,7,$7
	dc.b	8,$10,9,$10,10,$10,11,$0,12,$78,13,$9
	dc.b	$80,$0
	dc.b	$81,$6,$fd,$00
	dc.b	$82,0
lboomdata:
	dc.b	0,$ff,1,$f,2,$0,3,$0,4,$0,5,$0,6,$1f,7,$24
	dc.b	8,$10,9,$10,10,$0,11,$0,12,$80,13,$9
	dc.b	$80,$8d
	dc.b	$81,$2,$d0,$f0
	dc.b	$82,0
appeardata:
	dc.b	0,$0,1,$0,2,$0,3,$0,4,$0,5,$0,6,$1f,7,$3e
	dc.b	8,$10,9,$0,10,$0,11,$0,12,$ff,13,$9
	dc.b	$80,$ff
	dc.b	$81,$0,$20,$0
	dc.b	$82,0
sboomdata1:
	dc.b	0,$80,1,$0,2,$0,3,$0,4,$0,5,$0,6,$1f,7,$2e
	dc.b	8,$10,9,$10,10,$0,11,$0,12,$40,13,$9
	dc.b	$80,$ae
	dc.b	$81,$0,$52,$1
	dc.b	$82,0
sboomdata2:
	dc.b	0,$38,1,$0,2,$0,3,$0,4,$0,5,$0,6,$1f,7,$36
	dc.b	8,$10,9,$0,10,$0,11,$0,12,$40,13,$9
	dc.b	$80,$ae
	dc.b	$81,$01,$52,$1
	dc.b	$82,0

chaldata:
	dc.b	0,$0,1,$0,2,$0,3,$0,4,$0,5,$0,6,$1f,7,$3e
	dc.b	8,$10,9,$0,10,$0,11,$0,12,$7f,13,$9
	dc.b	$80,$31
	dc.b	$81,$01,$43,$0
	dc.b	$82,0

immortaldata:
	dc.b	0,$14,1,$0,2,$0,3,$0,4,$0,5,$0,6,$1f,7,$3e
	dc.b	8,$10,9,$0,10,$0,11,$3f,12,$0,13,$a
	dc.b	$80,$a9
	dc.b	$81,$1,$80,$0
	dc.b	$82,0
bonusdata:
	dc.b	0,$0,1,$0,2,$0,3,$0,4,$0,5,$0,6,$0,7,$3e
	dc.b	8,$10,9,$0,10,$0,11,$0,12,$1c,13,$9
	dc.b	$80,$80
	dc.b	$81,$0,$49,$80
	dc.b	$82,0
lightdata:
	dc.b	0,$4,1,$f,2,$0,3,$f,4,$10,5,$f,6,$1f,7,$38
	dc.b	8,$0f,9,$0f,10,$0f,11,$0,12,$0,13,$f
	dc.b	$82,0
even

rsprite:
	 dc.w	$0000,$0000,$FFF0,$0000,$0000,$0008,$9040,$0000
	 dc.w	$0000,$0000,$9024,$0000,$0000,$0000,$9024,$0000
	 dc.w	$0000,$0000,$9024,$0000,$0000,$0000,$9058,$0000
	 dc.w	$4000,$0000,$9FE0,$4000,$6600,$0000,$9900,$6600
	 dc.w	$6300,$0000,$9480,$6300,$0000,$0000,$9240,$6180
	 dc.w	$0000,$0000,$9120,$60C0,$6060,$6060,$F0F0,$0000
	 dc.w	$6030,$6030,$F078,$0000,$0000,$0000,$F03C,$0000

asprite:
	 dc.w	$0000,$0010,$3FE0,$0000,$0008,$0000,$4840,$0000
	 dc.w	$0000,$0000,$9024,$0000,$0000,$0000,$9024,$0000
	 dc.w	$0000,$0000,$9024,$0000,$0000,$0000,$9024,$0000
	 dc.w	$4008,$0000,$9024,$4008,$6018,$0000,$9FE4,$6018
	 dc.w	$6018,$0000,$9024,$6018,$0000,$0000,$9024,$6018
	 dc.w	$0000,$0000,$9024,$6018,$6018,$6018,$F03C,$0000
	 dc.w	$6018,$6018,$F03C,$0000,$0000,$0000,$F03C,$0000

msprite:
	 dc.w	$2000,$4000,$8007,$0000,$0000,$0000,$9009,$0000
	 dc.w	$0000,$0000,$8811,$0000,$0000,$0000,$8421,$0000
	 dc.w	$0000,$0000,$9249,$0000,$0000,$0000,$9999,$0000
	 dc.w	$4242,$0000,$9429,$4242,$6186,$0000,$9249,$6186
	 dc.w	$6006,$0000,$9189,$6006,$0000,$0000,$9009,$6006
	 dc.w	$0000,$0000,$9009,$6006,$6006,$6006,$F00F,$0000
	 dc.w	$6006,$6006,$F00F,$0000,$0000,$0000,$F00F,$0000

wsprite:
	 dc.w	$0041,$0002,$F38C,$0000,$0000,$0001,$9248,$0000
	 dc.w	$0000,$0000,$9249,$0000,$0000,$0000,$9249,$0000
	 dc.w	$0002,$0000,$9249,$0002,$0086,$0000,$9249,$0086
	 dc.w	$4186,$0000,$9249,$4186,$6180,$0000,$9249,$6186
	 dc.w	$6000,$0000,$9249,$6186,$0006,$0006,$924F,$6180
	 dc.w	$0186,$0186,$93CF,$6000,$6184,$6184,$F3CF,$0000
	 dc.w	$6000,$6000,$F7DE,$0000,$0000,$0000,$FEF8,$0000

esprite:
	 dc.w	$0004,$0008,$FFF0,$0000,$0000,$0000,$9000,$0000
	 dc.w	$0000,$0000,$9000,$0000,$0000,$0000,$9000,$0000
	 dc.w	$0000,$0000,$9000,$0000,$0000,$0000,$9000,$0000
	 dc.w	$2010,$0020,$9FC0,$2000,$6000,$0000,$9000,$6000
	 dc.w	$6000,$0000,$9000,$6000,$0000,$0000,$9000,$6000
	 dc.w	$0000,$0000,$9000,$6000,$6000,$6000,$F000,$0000
	 dc.w	$6000,$6000,$F000,$0000,$0000,$0000,$FFFC,$0000

even
*350
rampat:
 dc.w 161,022
 dc.w 160,022
 dc.w 159,022
 dc.w 158,022
 dc.w 157,022
 dc.w 156,022
 dc.w 154,022
 dc.w 152,022
 dc.w 150,022
 dc.w 149,022
 dc.w 147,022
 dc.w 146,022
 dc.w 144,022
 dc.w 142,022
 dc.w 140,022
 dc.w 139,022
 dc.w 137,022
 dc.w 136,022
 dc.w 134,022
 dc.w 132,022
 dc.w 131,021
 dc.w 129,020
 dc.w 127,020
 dc.w 126,019
 dc.w 124,018
 dc.w 122,017
 dc.w 121,016
 dc.w 119,015
 dc.w 118,014
 dc.w 117,013
 dc.w 116,012
 dc.w 116,011
 dc.w 116,010
 dc.w 116,009
 dc.w 116,008
 dc.w 117,007
 dc.w 118,006
 dc.w 118,005
 dc.w 120,004
 dc.w 121,003
 dc.w 122,002
 dc.w 123,001
 dc.w 125,001
 dc.w 126,000
 dc.w 127,000
 dc.w 128,000
 dc.w 129,000
 dc.w 130,000
 dc.w 131,000
 dc.w 132,000
 dc.w 133,000
 dc.w 134,000
 dc.w 135,001
 dc.w 135,002
 dc.w 136,003
 dc.w 137,004
 dc.w 138,005
 dc.w 138,007
 dc.w 138,009
 dc.w 138,010
 dc.w 138,011
 dc.w 138,012
 dc.w 138,013
 dc.w 138,014
 dc.w 137,015
 dc.w 135,016
 dc.w 133,017
 dc.w 132,017
 dc.w 131,017
 dc.w 129,017
 dc.w 127,017
 dc.w 126,017
 dc.w 124,017
 dc.w 123,017
 dc.w 122,017
 dc.w 121,017
 dc.w 121,016
 dc.w 120,016
 dc.w 120,014
 dc.w 120,013
 dc.w 120,011
 dc.w 120,010
 dc.w 120,008
 dc.w 121,007
 dc.w 122,006
 dc.w 123,005
 dc.w 124,004
 dc.w 126,003
 dc.w 127,002
 dc.w 129,001
 dc.w 131,000
 dc.w 133,000
 dc.w 135,000
 dc.w 138,000
 dc.w 140,000
 dc.w 142,000
 dc.w 144,000
 dc.w 146,000
 dc.w 148,000
 dc.w 150,000
 dc.w 151,000
 dc.w 154,000
 dc.w 156,000
 dc.w 159,000
 dc.w 161,000
 dc.w 164,000
 dc.w 166,000
 dc.w 168,000
 dc.w 171,000
 dc.w 173,000
 dc.w 175,000
 dc.w 178,000
 dc.w 180,000
 dc.w 183,000
 dc.w 186,000
 dc.w 188,000
 dc.w 190,000
 dc.w 192,000
 dc.w 194,000
 dc.w 197,000
 dc.w 200,000
 dc.w 202,000
 dc.w 204,000
 dc.w 207,000
 dc.w 210,000
 dc.w 212,000
 dc.w 215,000
 dc.w 217,000
 dc.w 219,000
 dc.w 221,000
 dc.w 223,000
 dc.w 225,000
 dc.w 226,000
 dc.w 228,000
 dc.w 230,000
 dc.w 231,000
 dc.w 234,000
 dc.w 236,000
 dc.w 238,000
 dc.w 240,000
 dc.w 242,000
 dc.w 243,000
 dc.w 245,000
 dc.w 246,000
 dc.w 248,000
 dc.w 250,000
 dc.w 251,000
 dc.w 253,000
 dc.w 254,000
 dc.w 256,000
 dc.w 258,000
 dc.w 259,000
 dc.w 261,000
 dc.w 263,000
 dc.w 265,000
 dc.w 266,000
 dc.w 268,000
 dc.w 270,001
 dc.w 272,001
 dc.w 273,001
 dc.w 274,001
 dc.w 276,002
 dc.w 277,002
 dc.w 278,003
 dc.w 279,003
 dc.w 280,004
 dc.w 280,005
 dc.w 280,006
 dc.w 281,007
 dc.w 281,008
 dc.w 282,009
 dc.w 282,011
 dc.w 282,012
 dc.w 282,013
 dc.w 282,015
 dc.w 282,016
 dc.w 282,017
 dc.w 282,018
 dc.w 281,019
 dc.w 281,020
 dc.w 280,021
 dc.w 279,022
 dc.w 278,022
 dc.w 276,022
 dc.w 274,022
 dc.w 272,022
 dc.w 270,022
 dc.w 268,022
 dc.w 267,022
 dc.w 265,022
 dc.w 263,022
 dc.w 262,022
 dc.w 261,020
 dc.w 260,019
 dc.w 259,018
 dc.w 259,016
 dc.w 259,015
 dc.w 259,014
 dc.w 259,012
 dc.w 259,011
 dc.w 259,010
 dc.w 259,009
 dc.w 260,008
 dc.w 261,007
 dc.w 262,006
 dc.w 263,005
 dc.w 264,004
 dc.w 265,003
 dc.w 266,003
 dc.w 267,002
 dc.w 268,002
 dc.w 269,002
 dc.w 270,002
 dc.w 272,002
 dc.w 274,002
 dc.w 275,002
 dc.w 276,002
 dc.w 277,003
 dc.w 278,003
 dc.w 278,004
 dc.w 279,005
 dc.w 279,007
 dc.w 280,007
 dc.w 280,009
 dc.w 280,011
 dc.w 280,012
 dc.w 280,013
 dc.w 280,014
 dc.w 279,015
 dc.w 279,016
 dc.w 279,017
 dc.w 278,018
 dc.w 277,019
 dc.w 275,020
 dc.w 274,021
 dc.w 273,022
 dc.w 272,022
 dc.w 271,022
 dc.w 270,022
 dc.w 269,022
 dc.w 267,022
 dc.w 266,022
 dc.w 265,022
 dc.w 263,022
 dc.w 262,022
 dc.w 261,022
 dc.w 259,022
 dc.w 258,022
 dc.w 257,022
 dc.w 256,022
 dc.w 255,022
 dc.w 254,022
 dc.w 253,022
 dc.w 252,022
 dc.w 251,022
 dc.w 250,022
 dc.w 249,022
 dc.w 248,022
 dc.w 247,022
 dc.w 246,022
 dc.w 245,022
 dc.w 244,022
 dc.w 243,022
 dc.w 242,022
 dc.w 241,022
 dc.w 240,022
 dc.w 239,022
 dc.w 238,022
 dc.w 237,022
 dc.w 236,022
 dc.w 235,022
 dc.w 234,022
 dc.w 233,022
 dc.w 232,022
 dc.w 231,022
 dc.w 230,022
 dc.w 229,022
 dc.w 228,022
 dc.w 227,022
 dc.w 226,022
 dc.w 225,022
 dc.w 224,022
 dc.w 223,022
 dc.w 222,022
 dc.w 221,022
 dc.w 220,022
 dc.w 219,022
 dc.w 218,022
 dc.w 217,022
 dc.w 216,022
 dc.w 215,022
 dc.w 214,022
 dc.w 213,022
 dc.w 212,022
 dc.w 211,022
 dc.w 210,022
 dc.w 209,022
 dc.w 208,022
 dc.w 207,022
 dc.w 206,022
 dc.w 205,022
 dc.w 204,022
 dc.w 203,022
 dc.w 202,022
 dc.w 201,022
 dc.w 200,022
 dc.w 199,022
 dc.w 198,022
 dc.w 197,022
 dc.w 196,022
 dc.w 195,022
 dc.w 194,022
 dc.w 193,022
 dc.w 192,022
 dc.w 191,022
 dc.w 190,022
 dc.w 189,022
 dc.w 188,022
 dc.w 187,022
 dc.w 186,022
 dc.w 185,022
 dc.w 184,022
 dc.w 183,022
 dc.w 182,022
 dc.w 181,022
 dc.w 180,022
 dc.w 179,022
 dc.w 178,022
 dc.w 177,022
 dc.w 176,022
 dc.w 175,022
 dc.w 174,022
 dc.w 173,022
 dc.w 172,022
 dc.w 171,022
 dc.w 170,022
 dc.w 169,022
 dc.w 168,022
 dc.w 167,022
 dc.w 166,022
 dc.w 165,022
 dc.w 164,022
 dc.w 163,022
 dc.w 162,022
 dc.w 161,022
 dc.w 160,022
 dc.w 159,022
 dc.w 158,022
 dc.w 157,022
 dc.w 156,022
 dc.w 175,022
blankdat:
	 dc.w	$7FFF,$8000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFE,$FFFF,$0000,$0000

icedat:	 dc.w	$7FFF,$8000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$8070,$FFFF,$0030,$0040
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8070,$FFFF,$0030,$0040,$01C0,$FFFF,$01C0,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$01FC,$FFFF,$01FC,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$80F8,$FFFF,$0038,$00C0
	 dc.w	$03FF,$FFFF,$03FF,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$7FF8,$FFFF,$7FF8,$8000,$0001,$FFFE,$0000,$0000
	 dc.w	$83F8,$FFFF,$0038,$00C0,$01FF,$FFFF,$01FF,$0200
	 dc.w	$F000,$FFFF,$F000,$0000,$3FE0,$FFFF,$3FE0,$C000
	 dc.w	$0001,$FFFE,$0000,$0000,$83FC,$FFFF,$003C,$01C0
	 dc.w	$0C7F,$FFFF,$007F,$0380,$F800,$FFFF,$F800,$0000
	 dc.w	$1FE0,$FFFF,$1F80,$E000,$0001,$FFFE,$0000,$0000
	 dc.w	$87FC,$FFFF,$003C,$01C0,$1C1F,$FFFF,$001F,$03E0
	 dc.w	$FC07,$FFFF,$FC00,$0000,$1FC0,$FFFF,$1F00,$E000
	 dc.w	$0001,$FFFE,$0000,$0000,$87FE,$FFFF,$001E,$01E0
	 dc.w	$180F,$FFFF,$000F,$07F0,$FF06,$FFFF,$FF00,$0001
	 dc.w	$0F00,$FFFF,$0C00,$F000,$0001,$FFFE,$0000,$0000
	 dc.w	$8FFE,$FFFF,$001E,$00E0,$1807,$FFFF,$0007,$07F8
	 dc.w	$FF86,$FFFF,$FF80,$0001,$0C00,$FFFF,$0000,$F000
	 dc.w	$0001,$FFFE,$0000,$0000,$8FFE,$FFFF,$001E,$00E0
	 dc.w	$1807,$FFFF,$0000,$07F8,$EFC6,$FFFF,$0FC0,$0001
	 dc.w	$0800,$FFFF,$0000,$F000,$0001,$FFFE,$0000,$0000
	 dc.w	$8FFE,$FFFF,$001E,$00E0,$380F,$FFFF,$0000,$07F0
	 dc.w	$F80E,$FFFF,$0000,$0001,$0000,$FFFF,$0000,$F000
	 dc.w	$0001,$FFFE,$0000,$0000,$87FE,$FFFF,$001E,$00E0
	 dc.w	$381F,$FFFF,$0000,$07E0,$FC0E,$FFFF,$0000,$0001
	 dc.w	$0000,$FFFF,$0000,$E000,$0001,$FFFE,$0000,$0000
	 dc.w	$87FE,$FFFF,$001E,$00E0,$3800,$FFFF,$0000,$07C0
	 dc.w	$7E0E,$FFFF,$0000,$0001,$0000,$FFFF,$0000,$E000
	 dc.w	$0001,$FFFE,$0000,$0000,$87FE,$FFFF,$001E,$0060
	 dc.w	$30C0,$FFFF,$0000,$0FC0,$000E,$FFFF,$0000,$0001
	 dc.w	$8000,$DFFF,$0000,$E000,$0001,$FFFE,$0000,$0000
	 dc.w	$87FE,$FFFF,$001E,$0060,$31C0,$FFFF,$0000,$0FC0
	 dc.w	$000D,$FFFF,$0000,$0003,$8000,$8001,$0000,$FFFE
	 dc.w	$0001,$FFFE,$0000,$0000,$87FE,$FFFF,$001E,$0060
	 dc.w	$33C0,$FFFF,$0000,$0FC0,$000D,$FFFF,$0000,$0003
	 dc.w	$C000,$C007,$0000,$FFF8,$0001,$FFFE,$0000,$0000
	 dc.w	$83FE,$FFFF,$001E,$0060,$67C0,$FFFF,$0000,$1FC0
	 dc.w	$000D,$FFFF,$0000,$0003,$C000,$C03F,$0000,$FFC0
	 dc.w	$0001,$FFFE,$0000,$0000,$83FC,$FFFF,$001C,$0060
	 dc.w	$6FC0,$FFFF,$0000,$1FC0,$001D,$FFFF,$0000,$0003
	 dc.w	$E0F0,$E0FF,$1000,$FF00,$0001,$FFFE,$0000,$0000
	 dc.w	$83FC,$FFFF,$001C,$0020,$7FE0,$FFE7,$0000,$0FF8
	 dc.w	$001D,$FFFF,$0000,$0003,$E0C0,$E0FF,$1C00,$FF00
	 dc.w	$0001,$FFFE,$0000,$0000,$83FC,$FFFF,$000C,$0030
	 dc.w	$FFE0,$FFE0,$0000,$0FFF,$001D,$1FFF,$0000,$E003
	 dc.w	$E000,$E01F,$1F00,$FFE0,$0001,$FFFE,$0000,$0000
	 dc.w	$83FC,$FFFF,$000C,$0030,$FFE0,$FFE0,$0000,$07FF
	 dc.w	$001B,$03FF,$0000,$FC07,$E000,$E007,$1FF8,$FFF8
	 dc.w	$0001,$FFFE,$0000,$0000,$81FC,$FFFF,$000C,$0030
	 dc.w	$7FE0,$FFE0,$0000,$07FF,$001B,$0FFF,$0000,$F007
	 dc.w	$C000,$C001,$3FFE,$FFFE,$0001,$FFFE,$0000,$0000
	 dc.w	$81FC,$FFFF,$000C,$0030,$7FE0,$FFE0,$0000,$03FF
	 dc.w	$001A,$FFFE,$0001,$0007,$0000,$00FF,$FF00,$FF00
	 dc.w	$0001,$FFFE,$0000,$0000,$81FC,$FFFF,$000C,$0010
	 dc.w	$3FE7,$FFE7,$0000,$03F8,$E039,$FFFF,$0000,$0006
	 dc.w	$FFC0,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$81FC,$FFFF,$000C,$0010,$3FFF,$FFFF,$0000,$0000
	 dc.w	$803F,$FFFF,$0000,$0000,$FFF0,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$81FC,$FFFF,$000C,$0010
	 dc.w	$1FF8,$FFFF,$0000,$0000,$003F,$FFFF,$0000,$0000
	 dc.w	$F800,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$80E0,$FFFF,$0000,$0000,$1FC0,$FFFF,$0000,$0000
	 dc.w	$0030,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$80E0,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$80E0,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFE,$FFFF,$0000,$0000
jungledat:
	 dc.w	$7FFF,$8000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0600,$F8FF,$0000,$0700,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0800,$F3FF,$0000,$0C00
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8100,$FE3F,$0000,$01C0
	 dc.w	$1800,$F3FF,$0000,$0C00,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8180,$FE1F,$0000,$01E0,$3000,$FBFF,$0000,$0400
	 dc.w	$0000,$FFFF,$0000,$0000,$0008,$FFFB,$0008,$0004
	 dc.w	$0001,$FFFE,$0000,$0000,$8740,$FE1F,$0000,$01E0
	 dc.w	$3778,$F801,$0000,$07FE,$0000,$FFFF,$0000,$0000
	 dc.w	$0064,$FFE3,$0060,$001C,$0001,$FFFE,$0000,$0000
	 dc.w	$87C0,$FE1F,$0000,$01E0,$11C4,$FE31,$0000,$01CE
	 dc.w	$0000,$FFFF,$0000,$0000,$0034,$FFF3,$0030,$000C
	 dc.w	$0001,$FFFE,$0000,$0000,$87E0,$FF9F,$0000,$0060
	 dc.w	$1FFA,$FFF8,$0000,$0007,$0008,$FFFB,$0008,$0004
	 dc.w	$01F4,$FFF3,$0010,$000C,$0001,$FFFE,$0000,$0000
	 dc.w	$87A9,$FFC8,$0008,$0037,$073A,$FFFC,$0000,$0003
	 dc.w	$0014,$FFF3,$0010,$000C,$00E8,$FFE7,$0020,$0018
	 dc.w	$0001,$FFFE,$0000,$0000,$818D,$FFFC,$000C,$0003
	 dc.w	$659E,$E38E,$6186,$1C71,$5A3C,$39FC,$183C,$C603
	 dc.w	$7050,$0FCF,$0040,$FC30,$1981,$F87E,$1800,$0780
	 dc.w	$80FD,$FFFC,$0004,$0003,$0C8F,$C3BF,$0083,$3C70
	 dc.w	$3571,$0CFF,$0401,$F300,$60A0,$3F9F,$2080,$C060
	 dc.w	$2881,$E7BE,$2080,$1840,$803D,$FFFC,$0004,$0003
	 dc.w	$FFFF,$F3CF,$1041,$0C30,$BAFD,$9E7C,$8204,$6183
	 dc.w	$E140,$EF3F,$2100,$10C0,$71C1,$F03E,$7000,$0FE0
	 dc.w	$801D,$FFFC,$0004,$0003,$EBDF,$E7CF,$2041,$1830
	 dc.w	$5E8B,$3E79,$0208,$C186,$9180,$F47F,$1000,$0B80
	 dc.w	$2301,$1FFE,$0000,$E000,$8019,$FFF8,$0000,$0007
	 dc.w	$5197,$CF8F,$4001,$3070,$8F94,$7E73,$0210,$C18C
	 dc.w	$D701,$F6FF,$1200,$0980,$7F81,$1FFE,$0000,$E000
	 dc.w	$801E,$FFFD,$0004,$0003,$A1B6,$9F8E,$0000,$7071
	 dc.w	$CF34,$3EF3,$0210,$C18C,$6E83,$EE7F,$2200,$1180
	 dc.w	$C001,$BFFE,$8000,$6000,$801C,$FFFD,$0004,$0003
	 dc.w	$E9F7,$E7CF,$60C1,$1830,$4EFA,$3E79,$0208,$C186
	 dc.w	$2F43,$9F3F,$0100,$60C0,$D041,$CFDE,$4040,$3020
	 dc.w	$801D,$FFFE,$0004,$0003,$F587,$F39F,$3181,$0C70
	 dc.w	$4D75,$3CFC,$0404,$C303,$8EA2,$BF9E,$8082,$4061
	 dc.w	$A881,$E7BE,$2080,$1840,$801D,$FFF8,$0000,$0007
	 dc.w	$F9D7,$F8CF,$1841,$0730,$4D39,$3CFF,$0401,$C300
	 dc.w	$2767,$1FE1,$0060,$E01E,$D981,$F87E,$1800,$0780
	 dc.w	$8019,$FFF8,$0000,$0007,$F7C7,$FFFF,$0000,$0000
	 dc.w	$1C1F,$FFFF,$0000,$0000,$2B8C,$E7FF,$2000,$1800
	 dc.w	$E301,$FFFE,$0000,$0000,$801E,$FFFD,$0004,$0003
	 dc.w	$7DC7,$FFFF,$0000,$0000,$1C06,$FFFE,$0002,$0001
	 dc.w	$95F8,$F3FF,$1000,$0C00,$7E01,$FFFE,$0000,$0000
	 dc.w	$801D,$FFFC,$0004,$0003,$0000,$FFFF,$0000,$0000
	 dc.w	$0004,$FFFD,$0004,$0002,$E800,$E7FF,$2000,$1800
	 dc.w	$0001,$FFFE,$0000,$0000,$801A,$FFF9,$0008,$0006
	 dc.w	$0000,$FFFF,$0000,$0000,$000D,$FFFC,$0004,$0003
	 dc.w	$5000,$CFFF,$4000,$3000,$0001,$FFFE,$0000,$0000
	 dc.w	$8018,$FFFB,$0008,$0004,$0000,$FFFF,$0000,$0000
	 dc.w	$001C,$FFFC,$000C,$0003,$C000,$3FFF,$0000,$E000
	 dc.w	$0001,$FFFE,$0000,$0000,$8038,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$001D,$FFFF,$0000,$0000
	 dc.w	$C000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8030,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$003F,$FFFF,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFE,$FFFF,$0000,$0000
doricdat:
	 dc.w	$7FFF,$8000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8030,$FFEF,$0020,$0010
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8020,$FFEF,$0020,$0018,$0054,$FFCF,$0040,$003C
	 dc.w	$0800,$FBFF,$0800,$0600,$0802,$FBFE,$0802,$0601
	 dc.w	$A001,$7FFE,$0000,$E000,$8020,$FFEF,$0020,$0018
	 dc.w	$0088,$FFBB,$0088,$0066,$0A00,$F9FF,$0800,$0700
	 dc.w	$0804,$FBFD,$0804,$0603,$4001,$DFFE,$4000,$3000
	 dc.w	$80E8,$FFE7,$0020,$001C,$0202,$FEFE,$0202,$0181
	 dc.w	$0D40,$FCFF,$0C00,$83C0,$0810,$FBF7,$0810,$060C
	 dc.w	$1801,$F7FE,$1000,$0800,$80EA,$FFE7,$0020,$001E
	 dc.w	$0272,$FEFE,$0202,$0181,$3880,$FBBF,$0880,$8660
	 dc.w	$3813,$FBF7,$0810,$060C,$9001,$F7FE,$1000,$0C00
	 dc.w	$80EA,$FFE7,$0020,$001E,$04B9,$FDFF,$0401,$0300
	 dc.w	$3840,$7BDF,$0840,$C630,$3825,$FBEF,$0820,$0618
	 dc.w	$CC01,$FBFE,$0800,$0400,$80F5,$FFF3,$0030,$000F
	 dc.w	$0C0F,$FDFF,$0401,$0300,$3910,$7BF7,$0810,$C60C
	 dc.w	$3860,$FBEF,$0820,$0618,$6C01,$FBFE,$0800,$0400
	 dc.w	$80F4,$FFF3,$0030,$000F,$880E,$FBFF,$0800,$8600
	 dc.w	$9988,$BBFB,$8808,$6606,$3840,$FBDF,$0840,$0630
	 dc.w	$7001,$FFFE,$0000,$0000,$80E2,$FFEE,$0022,$0019
	 dc.w	$1807,$FBFF,$0800,$8600,$99C4,$BBFD,$8804,$6603
	 dc.w	$38C0,$FBDF,$0840,$0630,$3001,$FFFE,$0000,$0000
	 dc.w	$80E6,$FFEE,$0022,$0019,$9807,$7BFF,$0800,$C600
	 dc.w	$9872,$BBFE,$8802,$6601,$38C0,$FBDF,$0840,$8630
	 dc.w	$3001,$FFFE,$0000,$0000,$80E7,$FFEF,$0021,$0018
	 dc.w	$5803,$3BFF,$0800,$E600,$9839,$BBFF,$8801,$6600
	 dc.w	$59C0,$3BDF,$0840,$E630,$0001,$FFFE,$0000,$0000
	 dc.w	$80E6,$FFEF,$0020,$0018,$9803,$BBFF,$8800,$6600
	 dc.w	$981D,$BBFC,$8804,$6603,$39C0,$FBDF,$0840,$8630
	 dc.w	$0001,$FFFE,$0000,$0000,$80E7,$FFEF,$0020,$0018
	 dc.w	$D203,$CFFF,$C000,$3E00,$9814,$BBF3,$8810,$660E
	 dc.w	$39A0,$FB9F,$0880,$0670,$0001,$FFFE,$0000,$0000
	 dc.w	$80E7,$FFEF,$0021,$0018,$5803,$3BFF,$0800,$E600
	 dc.w	$9CCF,$BC3F,$8C00,$63FC,$B9C0,$FBDF,$0840,$0630
	 dc.w	$0001,$FFFE,$0000,$0000,$80E3,$FFEF,$0021,$0018
	 dc.w	$3803,$7BFF,$0800,$C600,$9A98,$B9FB,$8808,$6786
	 dc.w	$39C0,$FBDF,$0840,$0630,$0001,$FFFE,$0000,$0000
	 dc.w	$80E2,$FFEE,$0022,$0019,$7803,$FBFF,$0800,$8600
	 dc.w	$9878,$BBFB,$8808,$6606,$39C0,$FBDF,$0840,$0630
	 dc.w	$0001,$FFFE,$0000,$0000,$80F5,$FFF3,$0030,$000F
	 dc.w	$BC03,$FDFF,$0401,$0300,$39F8,$7BFB,$0808,$C606
	 dc.w	$39E0,$FBEF,$0820,$0618,$0001,$FFFE,$0000,$0000
	 dc.w	$80EB,$FFE7,$0020,$001E,$3C03,$FDFF,$0401,$0300
	 dc.w	$383C,$7BFD,$0804,$C603,$39E0,$FBEF,$0820,$0618
	 dc.w	$0C01,$FBFE,$0800,$0400,$80EA,$FFE7,$0020,$001C
	 dc.w	$3A02,$FEFE,$0202,$0181,$383A,$FBFE,$0802,$8601
	 dc.w	$39D0,$FBF7,$0810,$860C,$1001,$F7FE,$1000,$0C00
	 dc.w	$80E4,$FFEF,$0020,$0018,$1E06,$FEFE,$0202,$0181
	 dc.w	$383A,$FBFE,$0802,$8601,$38F0,$FBF7,$0810,$860C
	 dc.w	$1001,$F7FE,$1000,$0C00,$80E0,$FFEF,$0020,$0018
	 dc.w	$1D04,$FF7D,$0104,$00C3,$381E,$FBFE,$0802,$0601
	 dc.w	$38E8,$FBFB,$0808,$8606,$2001,$EFFE,$2000,$1800
	 dc.w	$80F0,$FFFF,$0000,$0000,$0E56,$FFCF,$0040,$003C
	 dc.w	$380F,$FBFF,$0801,$0600,$3872,$7BFE,$0802,$C601
	 dc.w	$B001,$7FFE,$0000,$E000,$80E0,$FFFF,$0000,$0000
	 dc.w	$0E0E,$FFFF,$0000,$0000,$380E,$FFFF,$0000,$0000
	 dc.w	$3870,$FFFF,$0000,$0000,$7001,$FFFE,$0000,$0000
	 dc.w	$80E0,$FFFF,$0000,$0000,$071C,$FFFF,$0000,$0000
	 dc.w	$380E,$FFFF,$0000,$0000,$3838,$FFFF,$0000,$0000
	 dc.w	$E001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$01F0,$FFFF,$0000,$0000,$3807,$FFFF,$0000,$0000
	 dc.w	$380F,$FFFF,$0000,$0000,$8001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFE,$FFFF,$0000,$0000
icdat:
	 dc.w	$7FFF,$8000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$E003,$1FFC,$0000
	 dc.w	$0000,$8D00,$72FF,$0000,$0000,$1C00,$E3FF,$0000
	 dc.w	$0000,$6FE3,$901C,$0000,$0001,$1000,$EFFE,$0000
	 dc.w	$8000,$EFFB,$1004,$0000,$0000,$8DFF,$7200,$0000
	 dc.w	$0000,$DDFF,$2200,$0000,$0000,$6FE3,$901C,$0000
	 dc.w	$0001,$13FE,$EC00,$0000,$8000,$E80B,$17F4,$0000
	 dc.w	$0000,$AD00,$52FF,$0000,$0000,$5D01,$A2FE,$0000
	 dc.w	$0000,$6FEB,$9014,$0000,$0001,$5080,$AF7E,$0000
	 dc.w	$8000,$EBEB,$1414,$0000,$0000,$AD7F,$5280,$0000
	 dc.w	$0000,$5D7D,$A282,$0000,$0000,$6FEB,$9014,$0000
	 dc.w	$0001,$5EB8,$A146,$0000,$8000,$EBEB,$1414,$0000
	 dc.w	$0000,$AD7F,$5280,$0000,$0000,$5D7D,$A282,$0000
	 dc.w	$0000,$63EB,$9C14,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$EBC7,$1438,$0000,$0000,$AD3F,$52C0,$0000
	 dc.w	$0000,$5D78,$A287,$0000,$0000,$E3EB,$1C14,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$EBC7,$1438,$0000
	 dc.w	$0000,$AD3F,$52C0,$0000,$0000,$5D78,$A287,$0000
	 dc.w	$0000,$E3EB,$1C14,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$EBFF,$1400,$0000,$0000,$ADFF,$5200,$0000
	 dc.w	$0000,$5D7F,$A280,$0000,$0000,$EBEB,$1414,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$EBFF,$1400,$0000
	 dc.w	$0000,$ADFF,$5200,$0000,$0000,$5D7F,$A280,$0000
	 dc.w	$0000,$EBEB,$1414,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$EBFF,$1400,$0000,$0000,$AD00,$52FF,$0000
	 dc.w	$0000,$1D7F,$E280,$0000,$0000,$EBEB,$1414,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$EBFF,$1400,$0000
	 dc.w	$0000,$ADFF,$5200,$0000,$0000,$7D7F,$8280,$0000
	 dc.w	$0000,$EBEB,$1414,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$EBFF,$1400,$0000,$0000,$AD00,$52FF,$0000
	 dc.w	$0000,$7D7F,$8280,$0000,$0000,$EBFB,$1404,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$EBFF,$1400,$0000
	 dc.w	$0000,$AD7D,$5282,$0000,$0000,$FD7F,$0280,$0000
	 dc.w	$0000,$EBFB,$1404,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$EBFF,$1400,$0000,$0000,$AD7D,$5282,$0000
	 dc.w	$0000,$FD7F,$0280,$0000,$0000,$EBFB,$1404,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$EBFF,$1400,$0000
	 dc.w	$0000,$AD7E,$5281,$0000,$0000,$FD7F,$0280,$0000
	 dc.w	$0000,$EBEB,$1414,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$E9FF,$1600,$0000,$0000,$AD7E,$5281,$0000
	 dc.w	$0000,$FC7F,$0380,$0000,$0000,$EBEB,$1414,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$E9FF,$1600,$0000
	 dc.w	$0000,$AD7F,$5280,$0000,$0000,$7C7F,$8380,$0000
	 dc.w	$0000,$EBEB,$1414,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$EFFF,$1000,$0000,$0000,$AD7F,$5280,$0000
	 dc.w	$0000,$7DFF,$8200,$0000,$0000,$EBEB,$1414,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$EFFF,$1000,$0000
	 dc.w	$0000,$AD7F,$5280,$0000,$0000,$BDFF,$4200,$0000
	 dc.w	$0000,$EBEB,$1414,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$EFC3,$103C,$0000,$0000,$AD7F,$5280,$0000
	 dc.w	$0000,$BDF8,$4207,$0000,$0000,$6BEB,$9414,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$EFCB,$1034,$0000
	 dc.w	$0000,$AD7F,$5280,$0000,$0000,$DDF9,$2206,$0000
	 dc.w	$0000,$6BEB,$9414,$0000,$0001,$5EBE,$A140,$0000
	 dc.w	$8000,$E9FB,$1604,$0000,$0000,$ADFF,$5200,$0000
	 dc.w	$0000,$DD3F,$22C0,$0000,$0000,$6BEB,$9414,$0000
	 dc.w	$0001,$5EBE,$A140,$0000,$8000,$E81B,$17E4,$0000
	 dc.w	$0000,$BDFF,$4200,$0000,$0000,$ED03,$12FC,$0000
	 dc.w	$0000,$6BEB,$9414,$0000,$0001,$7FBE,$8040,$0000
	 dc.w	$8000,$EFFB,$1004,$0000,$0000,$9CFF,$6300,$0000
	 dc.w	$0000,$CDFF,$3200,$0000,$0000,$680B,$97F4,$0000
	 dc.w	$0001,$3E3E,$C1C0,$0000,$8000,$E003,$1FFC,$0000
	 dc.w	$0000,$9CFF,$6300,$0000,$0000,$CC00,$33FF,$0000
	 dc.w	$0000,$6003,$9FFC,$0000,$0001,$3E3E,$C1C0,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFE,$FFFF,$0000,$0000
blobsdat:
	 dc.w	$7FFF,$8000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FF80,$007F,$007F,$0000,$FE1F,$01E0,$01E0
	 dc.w	$0000,$FFFE,$0001,$0001,$0000,$1FFF,$E000,$E000
	 dc.w	$0001,$FFFE,$0000,$0000,$803F,$FF3F,$00C0,$00FF
	 dc.w	$00E0,$7CEF,$8310,$83F0,$0000,$FFFC,$0003,$0003
	 dc.w	$E000,$EFFF,$1000,$F000,$0001,$FFFE,$0000,$0000
	 dc.w	$8040,$FE7F,$0180,$01FF,$8110,$B9F7,$4608,$C7F8
	 dc.w	$0001,$FFF9,$0006,$0007,$1000,$FFFF,$0000,$F000
	 dc.w	$0001,$FFFE,$0000,$0000,$825F,$FE60,$0180,$01FE
	 dc.w	$0950,$D9B7,$2608,$E7F8,$0009,$C0F9,$3F06,$3F07
	 dc.w	$5000,$B7FC,$0803,$F803,$0001,$07FE,$F800,$F800
	 dc.w	$8650,$FE6F,$0180,$01FF,$9950,$59B7,$2608,$67F8
	 dc.w	$1F19,$1F39,$E0C6,$FFC7,$6C01,$9DF9,$0206,$FE07
	 dc.w	$F801,$FBFE,$0400,$FC00,$8E56,$FE6F,$0180,$01FB
	 dc.w	$9910,$59B7,$2608,$E7F8,$20B9,$3FB9,$C046,$FFC7
	 dc.w	$5202,$8EF3,$010C,$FF0F,$0401,$FDFE,$0200,$FE00
	 dc.w	$8E56,$FE6F,$0180,$01FF,$9910,$59B6,$2609,$E7F9
	 dc.w	$5F59,$60D9,$8026,$FFE7,$4D05,$8366,$0098,$FB9F
	 dc.w	$F401,$0DFE,$0200,$FE00,$8E51,$FE6E,$0180,$01FF
	 dc.w	$3956,$B9F6,$4649,$C7B9,$5359,$60D9,$8026,$FDE7
	 dc.w	$7D22,$9363,$009C,$FB9F,$B401,$0DFE,$0200,$DE00
	 dc.w	$8E56,$FE61,$0180,$01FB,$B956,$B9F6,$4649,$C7B9
	 dc.w	$5559,$64D9,$8426,$FBE7,$5562,$BB63,$009C,$FF9F
	 dc.w	$A801,$1BFE,$0400,$FC00,$8E51,$FE6E,$0180,$01FF
	 dc.w	$3956,$B9F6,$4649,$C7B9,$5559,$64D9,$8426,$FBE7
	 dc.w	$5562,$BB63,$009C,$FF9F,$B401,$2DFE,$2200,$DE00
	 dc.w	$8E56,$FE6F,$0180,$01FB,$9916,$59B6,$2609,$E7F9
	 dc.w	$5559,$64D9,$8426,$FBE7,$5565,$BB66,$0098,$FF9F
	 dc.w	$3401,$2DFE,$2200,$DE00,$8E56,$FE6F,$0180,$01FF
	 dc.w	$9916,$59B6,$2609,$E7F9,$5559,$64D9,$8426,$FBE7
	 dc.w	$5572,$BB73,$008C,$FF8F,$D401,$4DFE,$4200,$BE00
	 dc.w	$8E50,$FE6F,$0180,$01FF,$9956,$59B6,$2609,$E7F9
	 dc.w	$5159,$60D9,$8026,$FFE7,$7D65,$9366,$0098,$FF9F
	 dc.w	$1401,$0DFE,$0200,$FE00,$8E5F,$FE60,$0180,$01FF
	 dc.w	$1956,$D9B6,$2609,$E7F9,$5F59,$60D9,$8026,$FFE7
	 dc.w	$7D65,$8366,$0098,$FF9F,$F401,$0DFE,$0200,$FE00
	 dc.w	$8E40,$FE7F,$0180,$01FF,$B917,$B9F7,$4608,$C7F8
	 dc.w	$20B9,$3FB9,$C046,$FFC7,$0264,$FEE7,$0118,$FF1F
	 dc.w	$0801,$FBFE,$0400,$FC00,$8F3F,$FF3F,$00C0,$00FF
	 dc.w	$3CEF,$7CEF,$8310,$83F0,$1F3C,$1F3C,$E0C3,$FFC3
	 dc.w	$FCF3,$FDF3,$020C,$FE0F,$F001,$F7FE,$0800,$F800
	 dc.w	$8F80,$FF80,$007F,$007F,$3E0F,$FE1F,$01E0,$01E0
	 dc.w	$C03E,$C0FE,$3F01,$3F01,$00F8,$03F8,$FC07,$FC07
	 dc.w	$0001,$0FFE,$F000,$F000,$8FFE,$FFFF,$0000,$0000
	 dc.w	$3FC7,$FFFF,$0000,$0000,$FE3F,$FFFF,$0000,$0000
	 dc.w	$F8FF,$FFFF,$0000,$0000,$E001,$FFFE,$0000,$0000
	 dc.w	$87FC,$FFFF,$0000,$0000,$1F87,$FFFF,$0000,$0000
	 dc.w	$FE1F,$FFFF,$0000,$0000,$F07F,$FFFF,$0000,$0000
	 dc.w	$C001,$FFFE,$0000,$0000,$83F8,$FFFF,$0000,$0000
	 dc.w	$0F01,$FFFF,$0000,$0000,$F80F,$FFFF,$0000,$0000
	 dc.w	$E03F,$FFFF,$0000,$0000,$8001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFE,$FFFF,$0000,$0000
aliendat:
	 dc.w	$7FFF,$8000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000,$0000
	 dc.w	$FFFF,$0000,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$3000,$EFFF,$2000,$1000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0002,$FFFE,$0002,$0001
	 dc.w	$3020,$1FEF,$0020,$F010,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFF,$0001,$0000,$2040,$1FDF,$0040,$F020
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$000F,$FFFF,$0000,$0000
	 dc.w	$C180,$DFBF,$C180,$3040,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8018,$FFFB,$0018,$0007
	 dc.w	$0007,$FFFF,$0001,$0000,$2180,$1FFF,$0000,$E000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8005,$FFFC,$0004,$0003,$0002,$FFFE,$0002,$8001
	 dc.w	$07C0,$FFBF,$0380,$C070,$6B2F,$E7E3,$6020,$1F1F
	 dc.w	$5001,$CFFE,$4000,$3800,$807E,$FFFE,$0002,$0001
	 dc.w	$8005,$7FFC,$0004,$E003,$81A1,$FF9F,$0181,$0070
	 dc.w	$831B,$BF78,$8318,$6087,$5001,$F7FE,$1000,$CE00
	 dc.w	$801E,$FFFE,$0006,$0001,$900B,$7FF9,$0008,$F006
	 dc.w	$0FC3,$FFDF,$0043,$0030,$98FB,$87F8,$8008,$7FC7
	 dc.w	$6801,$F9FE,$0800,$8700,$800B,$FFFB,$0008,$0004
	 dc.w	$9010,$8FF7,$8010,$780C,$07D5,$FFCC,$0044,$0033
	 dc.w	$8E78,$7FFB,$0008,$8007,$7801,$F9FE,$0800,$0700
	 dc.w	$807F,$FFEF,$0061,$0010,$9430,$8FF7,$8010,$7C0C
	 dc.w	$01DD,$FFCC,$0044,$0033,$FF38,$7FFB,$0008,$8007
	 dc.w	$3901,$F8FE,$0800,$0700,$8092,$FF8E,$0082,$0071
	 dc.w	$F474,$F3F3,$1010,$0E0C,$01DC,$FFCD,$0044,$0033
	 dc.w	$0038,$FFFB,$0008,$8007,$3801,$F9FE,$0800,$0700
	 dc.w	$8197,$FF8F,$0180,$007C,$FA7A,$F9F9,$0808,$0706
	 dc.w	$01CE,$FFDE,$0042,$0031,$00F8,$7FBB,$0088,$C047
	 dc.w	$3901,$F8FE,$0800,$0700,$8394,$FF8F,$0180,$007C
	 dc.w	$7A7A,$F9F9,$0808,$0706,$01CE,$FFDE,$0042,$0031
	 dc.w	$00F8,$7FBB,$0088,$C047,$3901,$F8FE,$0800,$0700
	 dc.w	$8760,$FF1F,$0100,$00F0,$3F3C,$FEFD,$0604,$01C3
	 dc.w	$09CF,$FBDF,$0841,$0430,$A338,$9F7B,$8308,$6087
	 dc.w	$3601,$F1FE,$1000,$0E00,$87F0,$FF7F,$0100,$0080
	 dc.w	$3EDB,$FE3F,$0203,$01E0,$29CF,$1FDF,$0040,$F830
	 dc.w	$6B3B,$E7F8,$6008,$1F07,$3601,$F1FE,$1000,$0E00
	 dc.w	$87C0,$FFFF,$0000,$0000,$1F1C,$FFFF,$0000,$0000
	 dc.w	$31C7,$FFFF,$0000,$0000,$8E3C,$FFFF,$0000,$0000
	 dc.w	$7801,$FFFE,$0000,$0000,$8600,$FFFF,$0000,$0000
	 dc.w	$0F8F,$FFFF,$0000,$0000,$E1C1,$FFFF,$0000,$0000
	 dc.w	$FC3C,$FFFF,$0000,$0000,$7801,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$8000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0001,$FFFE,$0000,$0000
	 dc.w	$8000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0000,$FFFF,$0000,$0000,$0000,$FFFF,$0000,$0000
	 dc.w	$0001,$FFFE,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFF,$FFFF,$0000,$0000
	 dc.w	$FFFF,$FFFF,$0000,$0000,$FFFE,$FFFF,$0000,$0000

letters:
	 dc.w	$0000,$3FFC,$0000,$3FFC,$7FFE,$3FFC,$3FFC,$4000
	 dc.w	$FFFF,$FFFE,$FFFE,$0000,$83E0,$83E1,$8200,$7FFF
	 dc.w	$8020,$8221,$8000,$7E3F,$FC3F,$8223,$8001,$7E3F
	 dc.w	$C027,$FE3F,$0001,$FE3F,$E03F,$FFFF,$0021,$FFFF
	 dc.w	$FFFF,$FFFF,$0001,$FFFF,$C001,$C001,$3FFF,$FFFF
	 dc.w	$83E1,$81E1,$7E1F,$FFFF,$BE2F,$8221,$7E1F,$FE3F
	 dc.w	$C231,$BE2F,$7E1F,$FE3F,$8221,$FE3F,$7E1F,$FE3F
	 dc.w	$BE2F,$FE3F,$7E1F,$FE3F,$FE3F,$FC3E,$0201,$FE3F
	 dc.w	$8000,$7FFC,$0000,$FFFC,$FFFE,$FFFC,$FFFC,$0000
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$83E0,$83E1,$8200,$7FFF
	 dc.w	$8010,$8211,$8000,$7E1F,$FC1E,$8211,$8000,$7E1F
	 dc.w	$C020,$FFFF,$0020,$FFFF,$E006,$FFFE,$0000,$FFFE
	 dc.w	$FFFE,$FFFE,$0002,$FFFE,$C3F1,$C1F1,$3E0F,$FFFF
	 dc.w	$8211,$8211,$7E0F,$FE1F,$BE17,$8211,$7E0F,$FE1F
	 dc.w	$C3F3,$BFCD,$7FFF,$FFFF,$8003,$FFFD,$7FFF,$FFFF
	 dc.w	$BFFA,$FFFC,$7FFE,$FFFE,$FFFC,$FFFC,$0000,$FFFC
	 dc.w	$0000,$3FFC,$0000,$3FFC,$3FFE,$3FFC,$3FFC,$4000
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$81E0,$81E1,$8000,$7FFF
	 dc.w	$8010,$8211,$8000,$7E1F,$FC1E,$8211,$8000,$7E1F
	 dc.w	$801F,$FE1F,$0001,$FE1F,$CE00,$FE00,$0200,$FE00
	 dc.w	$FE00,$FE00,$0200,$FE00,$C21F,$C20F,$3E1F,$FE1F
	 dc.w	$8211,$8211,$7E0F,$FE1F,$BE1F,$8211,$7E0F,$FE1F
	 dc.w	$C3E1,$BDFF,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$5FFE,$7FFC,$3FFE,$7FFE,$3FFC,$3FFC,$0000,$3FFC
	 dc.w	$8000,$7FF8,$0000,$FFF8,$FFF8,$FFFC,$FFF8,$0004
	 dc.w	$FFFE,$FFFC,$FFFC,$0000,$83E0,$81E1,$8000,$7FFF
	 dc.w	$8011,$8210,$8000,$7E1E,$FC0E,$8209,$0000,$FE0F
	 dc.w	$C00A,$FE0F,$0000,$FE0F,$E40E,$FE0F,$0000,$FE0F
	 dc.w	$FC0E,$FE0F,$0000,$FE0F,$C00C,$C20D,$3C02,$FE0F
	 dc.w	$8010,$8211,$7C0E,$FE1F,$BC0E,$83E1,$7C1E,$FFFF
	 dc.w	$C000,$BFFF,$7FFE,$FFFF,$8002,$FFFC,$7FFE,$FFFE
	 dc.w	$BFFC,$FFFC,$7FF8,$FFFC,$FFF8,$FFF8,$0000,$FFF8
	 dc.w	$8001,$7FFE,$0000,$FFFE,$FFFE,$FFFF,$FFFE,$0001
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$C000,$C001,$C000,$3FFF
	 dc.w	$83FF,$81FE,$0000,$FFFF,$FC00,$C200,$0000,$FE00
	 dc.w	$C004,$FFF8,$0000,$FFF8,$F7F8,$FFFC,$0000,$FFFC
	 dc.w	$FE00,$FE04,$01F8,$FFFC,$C3FC,$C1F8,$3E00,$FFFC
	 dc.w	$8200,$8200,$7E00,$FE00,$BFFF,$83FE,$7FFE,$FFFE
	 dc.w	$C003,$BFFD,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$BFFD,$FFFF,$7FFF,$FFFF,$FFFF,$FFFE,$0001,$FFFF
	 dc.w	$8000,$7FFF,$0000,$FFFF,$FFFE,$FFFF,$FFFE,$0001
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$8000,$8001,$8000,$7FFF
	 dc.w	$83FF,$81FF,$8001,$7FFF,$FC00,$8200,$8000,$7E00
	 dc.w	$8000,$FE00,$0000,$FE00,$C3FC,$FFF8,$03F8,$FFF8
	 dc.w	$FFFC,$FFFC,$0004,$FFFC,$C00C,$C00C,$3FF4,$FFFC
	 dc.w	$83FC,$81F8,$7E04,$FFFC,$BE00,$8200,$7E00,$FE00
	 dc.w	$C200,$BE00,$7E00,$FE00,$8200,$FE00,$7E00,$FE00
	 dc.w	$BA00,$FE00,$7E00,$FE00,$FE00,$FC00,$0200,$FE00
	 dc.w	$0000,$3FFC,$0000,$3FFC,$7FFC,$3FFE,$3FFC,$4002
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$81E0,$81E1,$8000,$7FFF
	 dc.w	$821F,$801F,$8201,$7E1F,$FE00,$8200,$8200,$7E00
	 dc.w	$8600,$FE00,$0200,$FE00,$CE7E,$FE3C,$027C,$FE7C
	 dc.w	$FE7F,$FE7E,$0200,$FE7E,$C241,$C241,$3E3F,$FE7F
	 dc.w	$8271,$8271,$7E0F,$FE7F,$BE1F,$8211,$7E0F,$FE1F
	 dc.w	$C3E1,$BDDF,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$5FFE,$7FFC,$3FFE,$7FFE,$3FFC,$3FFC,$0000,$3FFC
	 dc.w	$8210,$7C0F,$0000,$FC1F,$7C1E,$7E1F,$7C1E,$8201
	 dc.w	$7C1E,$7E1F,$7C1E,$8201,$0010,$0211,$0010,$FE0F
	 dc.w	$0010,$0211,$0010,$FE0F,$FE1E,$81E1,$0000,$FDFF
	 dc.w	$C001,$FFFF,$0001,$FFFF,$F0F3,$FFFF,$0001,$FFFF
	 dc.w	$FFFF,$FFFF,$0001,$FFFF,$C3F1,$C1F1,$3E0F,$FFFF
	 dc.w	$8211,$8211,$7E0F,$FE1F,$BE1F,$8211,$7E0F,$FE1F
	 dc.w	$C211,$BE1F,$7E0F,$FE1F,$8211,$FE1F,$7E0F,$FE1F
	 dc.w	$BE1F,$FE1F,$7E0F,$FE1F,$FE1F,$FC1E,$0201,$FE1F
	 dc.w	$0200,$01F0,$0000,$03F0,$03E0,$03F0,$03E0,$0010
	 dc.w	$03E0,$03F0,$03E0,$0010,$0200,$0210,$0200,$01F0
	 dc.w	$0200,$0210,$0200,$01F0,$03E0,$0210,$0000,$03F0
	 dc.w	$0210,$03F0,$0010,$03F0,$0330,$03F0,$0010,$03F0
	 dc.w	$03F0,$03F0,$0010,$03F0,$0230,$0230,$01D0,$03F0
	 dc.w	$0210,$0210,$01F0,$03F0,$03D0,$0210,$01F0,$03F0
	 dc.w	$0230,$03D0,$01F0,$03F0,$0230,$03D0,$01F0,$03F0
	 dc.w	$03D0,$03F0,$01F0,$03F0,$03F0,$03E0,$0010,$03F0
	 dc.w	$0021,$001E,$0000,$003E,$003E,$003F,$003E,$0001
	 dc.w	$003E,$003F,$003E,$0001,$0020,$0021,$0020,$001F
	 dc.w	$0020,$0021,$0020,$001F,$003E,$0021,$0000,$003F
	 dc.w	$0030,$003F,$0000,$003F,$FC3C,$7C3F,$FC00,$FC3F
	 dc.w	$FC3F,$FC3F,$0401,$FC3F,$8421,$8421,$7C1F,$FC3F
	 dc.w	$8421,$8421,$7C1F,$FC3F,$FFFF,$83C1,$7FFF,$FFFF
	 dc.w	$8001,$FFFF,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$7FFE,$7FFC,$3FFE,$7FFE,$3FFC,$3FFC,$0000,$3FFC
	 dc.w	$8200,$7C00,$0000,$FC00,$FC00,$FE00,$FC00,$0200
	 dc.w	$FC00,$FE00,$FC00,$0200,$8004,$8278,$8000,$7E78
	 dc.w	$8080,$8284,$8080,$7E7C,$FFF8,$8108,$8108,$7EF8
	 dc.w	$8030,$FFF0,$0010,$FFF0,$CFE0,$FFE0,$0020,$FFE0
	 dc.w	$FFC0,$FFC0,$0040,$FFC0,$C0C0,$C0C0,$3F40,$FFC0
	 dc.w	$8060,$8060,$7FA0,$FFE0,$BFD0,$8010,$7FF0,$FFF0
	 dc.w	$C318,$BFE8,$7EF8,$FFF8,$8284,$FEFC,$7E7C,$FEFC
	 dc.w	$BE7A,$FE7E,$7E3E,$FE7E,$FE3F,$FC3E,$0201,$FC3F
	 dc.w	$8000,$7E00,$0000,$FE00,$FC00,$FE00,$FC00,$0200
	 dc.w	$FC00,$FE00,$FC00,$0200,$8000,$8200,$8000,$7E00
	 dc.w	$8000,$8200,$8000,$7E00,$FC00,$8200,$0000,$FE00
	 dc.w	$C200,$FE00,$0200,$FE00,$F600,$FE00,$0200,$FE00
	 dc.w	$FE00,$FE00,$0200,$FE00,$C200,$C200,$3E00,$FE00
	 dc.w	$83FF,$83FF,$7FFF,$FFFF,$BFFF,$8001,$7FFF,$FFFF
	 dc.w	$C001,$BFFF,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$BFFF,$FFFF,$7FFF,$FFFF,$FFFF,$FFFE,$0001,$FFFF
	 dc.w	$8211,$7C0E,$0000,$FC1E,$FF3E,$FE3F,$FE3E,$0001
	 dc.w	$FF7E,$FFFF,$FF7E,$0081,$8000,$8001,$8000,$7FFF
	 dc.w	$8000,$8001,$8000,$7FFF,$FFFE,$8001,$0000,$FFFF
	 dc.w	$C211,$FDFF,$0201,$FFFF,$E733,$FFFF,$0201,$FFFF
	 dc.w	$FEDF,$FEDF,$0201,$FEDF,$C219,$C219,$3E07,$FE1F
	 dc.w	$8211,$8211,$7E0F,$FE1F,$BE17,$8211,$7E0F,$FE1F
	 dc.w	$C219,$BE17,$7E0F,$FE1F,$8211,$FE1F,$7E0F,$FE1F
	 dc.w	$BE17,$FE1F,$7E0F,$FE1F,$FE1F,$FC1E,$0201,$FE1F
	 dc.w	$8221,$7C1E,$0000,$FC3E,$FE3E,$FF3F,$FE3E,$0101
	 dc.w	$FF3E,$FFBF,$FF3E,$0081,$8020,$8041,$8000,$7FFF
	 dc.w	$8000,$8001,$8000,$7FFF,$FFFF,$8001,$0001,$FFFF
	 dc.w	$C003,$FFFF,$0001,$FFFF,$E7F7,$FFFF,$0001,$FFFF
	 dc.w	$FFFF,$FFFF,$0001,$FFFF,$C003,$C003,$3FFD,$FFFF
	 dc.w	$8001,$8001,$7FFF,$FFFF,$BFFD,$8001,$7FFF,$FFFF
	 dc.w	$C303,$BDFD,$7EFF,$FFFF,$8281,$FEFF,$7E7F,$FEFF
	 dc.w	$BE7D,$FE7F,$7E3F,$FE7F,$FE3F,$FC3E,$0201,$FE3F
	 dc.w	$0000,$3FFC,$0000,$3FFC,$7FFC,$3FFE,$3FFC,$4002
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$8000,$8001,$8000,$7FFF
	 dc.w	$83E0,$83E1,$8200,$7FFF,$FC3E,$8221,$0000,$FE3F
	 dc.w	$C021,$FE3F,$0001,$FE3F,$E433,$FE3F,$0001,$FE3F
	 dc.w	$FC3F,$FE3F,$0001,$FE3F,$8021,$8221,$7C1F,$FE3F
	 dc.w	$8021,$8221,$7C1F,$FE3F,$FE3F,$81E1,$7C3F,$FDFF
	 dc.w	$8001,$FFFF,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$7FFE,$7FFC,$3FFE,$7FFE,$3FFC,$3FFC,$0000,$3FFC
	 dc.w	$8000,$7FFC,$0000,$FFFC,$FFFC,$FFFE,$FFFC,$0002
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$83F0,$83F1,$8200,$7FFF
	 dc.w	$8008,$8209,$0000,$FE0F,$FC0E,$8209,$0000,$FE0F
	 dc.w	$C003,$FFFF,$0001,$FFFF,$FE07,$FFFF,$0001,$FFFF
	 dc.w	$FFFE,$FFFC,$0002,$FFFE,$83FC,$81FC,$7E00,$FFFC
	 dc.w	$8200,$8200,$7E00,$FE00,$FE00,$8200,$7E00,$FE00
	 dc.w	$8200,$FE00,$7E00,$FE00,$8200,$FE00,$7E00,$FE00
	 dc.w	$FE00,$FE00,$7E00,$FE00,$FE00,$FC00,$0200,$FE00
	 dc.w	$0000,$3FFC,$0000,$3FFC,$7FFC,$3FFE,$3FFC,$4002
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$8000,$8001,$8000,$7FFF
	 dc.w	$83E0,$83E1,$8200,$7FFF,$FC3E,$8221,$8000,$7E3F
	 dc.w	$8421,$FE3F,$8001,$7E3F,$8C33,$FE3F,$0001,$FE3F
	 dc.w	$FC3F,$FE3F,$0001,$FE3F,$8021,$8221,$7C1F,$FE3F
	 dc.w	$8021,$8221,$7C1F,$FE3F,$FC1F,$83D1,$7C0F,$FFDF
	 dc.w	$8029,$FFEF,$7FE7,$FFEF,$8015,$FFF7,$7FF3,$FFF7
	 dc.w	$7FFB,$7FFA,$3FF9,$7FFB,$3FFC,$3FFC,$0000,$3FFC
	 dc.w	$8000,$7FFC,$0000,$FFFC,$FFFC,$FFFE,$FFFC,$0002
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$83F0,$83F1,$8200,$7FFF
	 dc.w	$8008,$8209,$8000,$7E0F,$FC0F,$8209,$0001,$FE0F
	 dc.w	$C003,$FFFF,$0001,$FFFF,$FF9F,$FFFF,$0001,$FFFF
	 dc.w	$FFFE,$FFFC,$0002,$FFFE,$820C,$800C,$7FF0,$FFFC
	 dc.w	$8308,$8308,$7EF8,$FFF8,$FE84,$8284,$7E7C,$FEFC
	 dc.w	$827E,$FE42,$7E3E,$FE7E,$823F,$FE21,$7E1F,$FE3F
	 dc.w	$FE1F,$FE1F,$7E0F,$FE1F,$FE1F,$FC1E,$0201,$FE1F
	 dc.w	$0000,$3FFE,$0000,$3FFE,$7FFE,$3FFF,$3FFE,$4001
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$8000,$8001,$8000,$7FFF
	 dc.w	$83FE,$83FE,$8000,$7FFE,$FC00,$83FE,$0000,$FFFE
	 dc.w	$C000,$FFFF,$0000,$FFFF,$E7C3,$FFFF,$0001,$FFFF
	 dc.w	$FFFF,$FFFF,$0001,$FFFF,$7FE3,$7FE3,$001D,$7FFF
	 dc.w	$0001,$7FE1,$001F,$7FFF,$FFFD,$8001,$7FFF,$FFFF
	 dc.w	$8003,$FFFD,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$FFFE,$FFFC,$7FFE,$FFFE,$7FFC,$7FFC,$0000,$7FFC
	 dc.w	$8000,$7FFF,$0000,$FFFF,$FFFE,$FFFF,$FFFE,$0001
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$8000,$8001,$8000,$7FFF
	 dc.w	$FE3F,$FE3F,$FE21,$01FF,$03E0,$0220,$0220,$01E0
	 dc.w	$0260,$03E0,$0020,$03E0,$02E0,$03E0,$0020,$03E0
	 dc.w	$03E0,$03E0,$0020,$03E0,$0220,$0220,$01E0,$03E0
	 dc.w	$0220,$0220,$01E0,$03E0,$03E0,$0220,$01E0,$03E0
	 dc.w	$0220,$03E0,$01E0,$03E0,$0220,$03E0,$01E0,$03E0
	 dc.w	$03E0,$03E0,$01E0,$03E0,$03E0,$03C0,$0020,$03E0
	 dc.w	$8020,$7E1F,$0000,$FE3F,$FC3E,$FE3F,$FC3E,$0201
	 dc.w	$FC3E,$FE3F,$FC3E,$0201,$8020,$8221,$8020,$7E1F
	 dc.w	$8020,$8221,$8020,$7E1F,$FE3E,$8221,$8200,$7E3F
	 dc.w	$8631,$FE3F,$8201,$7E3F,$8E3B,$FE3F,$0201,$FE3F
	 dc.w	$FE3F,$FE3F,$0201,$FE3F,$8221,$8221,$7E1F,$FE3F
	 dc.w	$8221,$8221,$7E1F,$FE3F,$FFFF,$83C1,$7FFF,$FFFF
	 dc.w	$8001,$FFFF,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$7FFE,$7FFC,$3FFE,$7FFE,$3FFC,$3FFC,$0000,$3FFC
	 dc.w	$8020,$7E1F,$0000,$FE3F,$FC3E,$FE3F,$FC3E,$0201
	 dc.w	$FC3E,$FE3F,$FC3E,$0201,$8020,$8221,$8020,$7E1F
	 dc.w	$8020,$8221,$0020,$FE1F,$FC3E,$C221,$0020,$FE1F
	 dc.w	$E021,$FE3F,$0001,$FE3F,$F833,$FE3F,$0001,$FE3F
	 dc.w	$FE3F,$FE3F,$0201,$FE3F,$83E1,$83C1,$7FFF,$FFFF
	 dc.w	$8001,$8001,$7FFF,$FFFF,$FFFF,$8001,$7FFF,$FFFF
	 dc.w	$4002,$7FFC,$3FFE,$7FFE,$2004,$3FF8,$1FFC,$3FFC
	 dc.w	$1FF8,$1FF0,$0FF8,$1FF8,$0FF0,$0FF0,$0000,$0FF0
	 dc.w	$8010,$7E0F,$0000,$FE1F,$FC1E,$FE1F,$FC1E,$0201
	 dc.w	$FC1E,$FE1F,$FC1E,$0201,$8010,$8211,$8010,$7E0F
	 dc.w	$8010,$8211,$8010,$7E0F,$FC1E,$8211,$0010,$FE0F
	 dc.w	$C210,$FE1F,$0200,$FE1F,$E6D8,$FEDF,$0240,$FEDF
	 dc.w	$FFFF,$FFFF,$0221,$FFFF,$8211,$8001,$7FFF,$FFFF
	 dc.w	$8001,$8001,$7FFF,$FFFF,$FFFF,$8001,$7FFF,$FFFF
	 dc.w	$8001,$FFFF,$7FFF,$FFFF,$80C1,$FF7F,$7FBF,$FFFF
	 dc.w	$FF3F,$FE3F,$7F1F,$FF3F,$FE1F,$FE1E,$0001,$FE1F
	 dc.w	$8000,$7E3F,$0000,$FE3F,$FE7E,$FF7F,$FE7E,$0101
	 dc.w	$FFFE,$FF7F,$FF7E,$0081,$8000,$8001,$8000,$7FFF
	 dc.w	$8001,$8000,$8000,$7FFF,$7FFE,$4000,$0000,$7FFE
	 dc.w	$3C04,$3FF8,$0000,$3FFC,$1FC8,$1FF8,$0008,$1FF8
	 dc.w	$0FF0,$0FF0,$0010,$0FF0,$1008,$1008,$0FF8,$1FF8
	 dc.w	$2004,$2004,$1FFC,$3FFC,$7FFE,$4002,$3FFE,$7FFE
	 dc.w	$8001,$FFFF,$7FFF,$FFFF,$8081,$FF7F,$7FFF,$FFFF
	 dc.w	$FF7F,$FF7F,$7F3F,$FF7F,$FE3F,$FC3E,$0201,$FE3F
	 dc.w	$8000,$7E3F,$0000,$FE3F,$FE7E,$FF7F,$FE7E,$0101
	 dc.w	$FFFE,$FF7F,$FF7E,$0081,$8000,$8001,$8000,$7FFF
	 dc.w	$8001,$8001,$8001,$7FFF,$7FFE,$4002,$4002,$3FFE
	 dc.w	$203C,$3FFC,$2004,$1FFC,$1DF8,$1FF8,$0008,$1FF8
	 dc.w	$0F90,$0F90,$0070,$0FF0,$0410,$0410,$03F0,$07F0
	 dc.w	$0410,$0410,$03F0,$07F0,$07F0,$0410,$03F0,$07F0
	 dc.w	$0410,$07F0,$03F0,$07F0,$0410,$07F0,$03F0,$07F0
	 dc.w	$07F0,$07F0,$03F0,$07F0,$07F0,$07E0,$0010,$07F0
	 dc.w	$8000,$7FFF,$0000,$FFFF,$FFFE,$FFFF,$FFFE,$0001
	 dc.w	$FFFE,$FFFF,$FFFE,$0001,$8000,$8001,$8000,$7FFF
	 dc.w	$8000,$8001,$8000,$7FFF,$FFFE,$FC01,$FC00,$03FF
	 dc.w	$0406,$07FC,$0000,$07FE,$0E3C,$0FF8,$0004,$0FFC
	 dc.w	$1FC8,$1FC0,$0038,$1FF8,$3010,$3000,$0FF0,$3FF0
	 dc.w	$401F,$401F,$3FFF,$7FFF,$BFFF,$8001,$7FFF,$FFFF
	 dc.w	$C001,$BFFF,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$BFFF,$FFFF,$7FFF,$FFFF,$FFFE,$FFFF,$0001,$FFFF
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
	 dc.w	$0200,$03C0,$0200,$01C0,$0380,$0240,$0000,$03C0
	 dc.w	$0380,$03C0,$0000,$03C0,$03C0,$0380,$0040,$03C0
	 dc.w	$0000,$0FF0,$0000,$0FF0,$1FF0,$1FF8,$1FF0,$0008
	 dc.w	$27C0,$27C4,$2400,$1FFC,$3838,$2424,$2000,$1C3C
	 dc.w	$2020,$3C3C,$2000,$1C3C,$3830,$383C,$0000,$383C
	 dc.w	$00FC,$00FC,$0004,$00FC,$0108,$0108,$00F8,$01F8
	 dc.w	$07F0,$0630,$01F0,$07F0,$0FC0,$08C0,$07C0,$0FC0
	 dc.w	$0900,$0F00,$0700,$0F00,$0F00,$0E00,$0100,$0F00
	 dc.w	$0000,$0000,$0000,$0000,$0800,$0700,$0000,$0F00
	 dc.w	$0E00,$0900,$0000,$0F00,$0F00,$0E00,$0100,$0F00
	 dc.w	$8005,$7FFA,$0000,$FFFA,$FFFE,$FFFF,$FFFE,$0001
	 dc.w	$FFFF,$FFFE,$FFFE,$0000,$E002,$E003,$E002,$1FFD
	 dc.w	$C000,$C001,$C000,$3FFF,$BFFC,$8001,$8000,$7FFF
	 dc.w	$C7E0,$B81F,$0000,$FFFF,$CFF0,$FFFF,$0810,$F7EF
	 dc.w	$FFFC,$FFFF,$0004,$FFFF,$C002,$C003,$3FFE,$FFFF
	 dc.w	$8001,$8001,$7FFF,$FFFF,$BFFD,$8001,$7FFF,$FFFF
	 dc.w	$C003,$BFFD,$7FFF,$FFFF,$8001,$FFFF,$7FFF,$FFFF
	 dc.w	$BFFD,$FFFF,$7FFF,$FFFF,$FFFF,$FFFE,$0001,$FFFF
