soundstarth:	equ	2
soundstartm:	equ	4
soundstartl:	equ	6
soundendh:	equ	$e
soundendm:	equ	$10
soundendl:	equ	$12
soundmode:	equ	$20
sounddma:	equ	0
*********************************************************
*	Steven's copy program				*
*********************************************************
	include	gemmacro.s
start	move.l	4(a7),a3		base page
	move.l	#mystack,a7
	move.l	$c(a3),d0		text len
	add.l	$14(a3),d0		data len
	add.l	$1c(a3),d0		BSS len
	add.l	#$100,d0		basepage
	move.l	d0,-(sp)
	move.l	a3,-(sp)
	clr.w	-(sp)
	move.w	#$4a,-(sp)
	trap	#1			shrink memory
	lea	12(sp),sp

	appl_init
	move.w	d0,ap_id		store the application id

	graf_handle
	move.w	d0,current_handle	Desktop's VDI handle

* start by opening a virtual workstation
	lea	intin,a0
	moveq	#10-1,d0		-1 for DBF
.fill	move.w	#1,(a0)+		most params are 1
	dbf	d0,.fill
	move.w	#2,(a0)+		use RC system
	v_opnvwk			open it

	bsr	fixrsc
	form_center	#tbackdrop

	wind_get	#0,#4		work area of Desktop
	movem.w	int_out+2,d0-d3
	movem.w	d0-d3,savebounds
	form_dial	#0,#0,#0,#0,#0,d0,d1,d2,d3


	pea     cdma(pc)   	;check that there really is dma sound
        move    #38,-(sp)       ; Supexec
        trap    #14
        addq    #6,sp
	cmpi.w	#1,dma
	bne	nosound

	pea     dintro(pc)	;this starts the intro sound
        move    #38,-(sp)       ; Supexec
        trap    #14
        addq    #6,sp

	pea     waitsound(pc)	;this starts the intro sound
        move    #38,-(sp)       ; Supexec
        trap    #14
        addq    #6,sp


	pea     findsa(pc)   	;check for presence of sound alert
        move    #38,-(sp)       ;and turn it off if so
        trap    #14
        addq    #6,sp
	tst.l	sndalert
	beq	nosound
	bmi	saisoff



saisonn:
	form_alert	#1,#saonalert	;please insert original
	move.w	int_out,d0
	cmpi.w	#2,d0
	beq	leaveasis
	pea     turnsaoff(pc)   	;check for presence of sound alert
        move    #38,-(sp)       ;and turn it off if so
        trap    #14
        addq    #6,sp
	bra	nosound
saisoff:
	form_alert	#2,#saoffalert	;please insert original
	move.w	int_out,d0
	cmpi.w	#2,d0
	beq	leaveasis
	pea     turnsaon(pc)   	;check for presence of sound alert
        move    #38,-(sp)       ;and turn it off if so
        trap    #14
        addq    #6,sp
leaveasis:
nosound:
	bsr	getmemory
mainbit:
*	sample player and stuff at start	*
	bsr	drawmydial
	form_alert	#3,#mainalert
	move.w	int_out,d0		;get the button
	cmpi.w	#3,d0
	beq	exit
	cmpi.w	#2,d0
	beq	formatter
*****************************************************************
*	The copier section. Should be simply a matter of	*
*	getting the bootsector and using that info to format	*
*	the target disk and then do straight sector copies.	*
*****************************************************************
copier:
	form_alert	#1,#copy1	;please insert original
	bsr	readboot		;for secs n stuff
	bsr	trywriteboot		;determine write protect
	lea	bootsec,a0
	move.b	20(a0),d0
	lsl.w	#8,d0
	or.b	19(a0),d0		;get total number of sectors
	move.w	d0,d7

	move.b	25(a0),d0
	lsl.w	#8,d0
	or.b	24(a0),d0		;get secs per track
	move.w	d0,sectrack
	cmpi.w	#11,d0
	blt	oksecs

	form_alert	#1,#copycant	;please insert original
	bra	mainbit

oksecs:
	divu	d0,d7

	move.b	27(a0),d0
	lsl.w	#8,d0
	or.b	26(a0),d0		;get sides
	move.w	d0,sides

	divu	d0,d7		;makes d7=(totalsecs/secpertrack)/sides=tracks

	move.w	d7,trackcount


	moveq	#0,d0
	move.w	memsectors,d0	;number of secs our buffer can hold
	moveq	#0,d1
	move.w	sectrack,d1
	mulu	sides,d1	;total num of secs in a track
	divu	d1,d0		;see how many tracks fit into mem
	move.w	d0,tracksinmem

	moveq	#0,d1
	move.w	sectrack,d1
	mulu	#512,d1		;get mem taken by 1 track
	move.w	d1,meminc
	cmp.w	trackcount,d0
	bge.s	singlepass
	form_alert	#1,#multialert
	bra	docopy
singlepass:
	move.w	trackcount,tracksinmem
docopy:
	form_center	#tcbarform

	move.l	#str24,ted8	;set "Reading...." string
	move.l	#tcbarform,a0
	add.l	#cbar*24,a0
	move.w	#2,20(a0)		;make the bar small

	bsr	drawbardial

bp:	move.w	tracksinmem,d7
	move.w	trackcount,d6
	move.w	d6,d4
	divu	d7,d6
	move.w	d6,d5
	mulu	d7,d5
	sub.w	d5,d4
	subq.w	#1,d4
	move.w	d4,remainder
	subq.w	#1,d6
	move.w	#0,track
	move.w	#0,track2
	move.l	membuffer,a6
	move.l	a6,a5
	move.w	#1,firsttime
gtloop1:
	tst.w	firsttime
	bpl	skipalert
	form_alert	#1,#copy1	;please insert original
skipalert:
	move.w	#-1,firsttime
	bsr	gettracks
	move.w	track,savetrack
	move.w	track2,track
	form_alert	#1,#copy2	;please insert disk to copy to
	bsr	writetracks
*	tst.w	remainder
	move.w	savetrack,track
	move.w	savetrack,track2
	move.l	membuffer,a6
	move.l	a6,a5
	dbf	d6,gtloop1

	move.w	remainder,d7
	tst.w	d7
	bmi	skipextra
	form_alert	#1,#copy1	;please insert original
	bsr	gettracks
	move.w	track,savetrack
	move.w	track2,track
	form_alert	#1,#copy2	;please insert disk to copy to
	bsr	writetracks
skipextra:
	form_alert	#1,#copy3	;please insert original
	bra	mainbit


writetracks:
	move.l	#str25,ted8	;set "Writing...." string
	move.l	#tcbarform,a0
	add.l	#cbar*24,a0
	move.w	#2,20(a0)		;make the bar small
	bsr	drawbardial
	move.w	d7,d5
	subq.w	#1,d5
wtloop:
	move.w	#300,d0
	move.w	track,d1
	addq.w	#1,d1
	mulu	d1,d0
	move.w	trackcount,d1
	divu	d1,d0
	move.l	#tcbarform,a0
	add.l	#cbar*24,a0
	move.w	d0,20(a0)		;make the bar small
	movem.w	savebounds,d0-d3
	objc_draw	#tcbarform,#cbar,#3,d0,d1,d2,d3
	bsr	formattrack
	bsr	writetrack
	addq.w	#1,track
	dbf	d5,wtloop
	rts



gettracks:
	move.l	#str24,ted8	;set "Reading...." string
	bsr	drawbardial

	move.w	d7,d5
	subq.w	#1,d5
gtloop:
	move.w	#300,d0
	move.w	track,d1
	addq.w	#1,d1
	mulu	d1,d0
	move.w	trackcount,d1
	divu	d1,d0
	move.l	#tcbarform,a0
	add.l	#cbar*24,a0
	move.w	d0,20(a0)		;make the bar small
	movem.w	savebounds,d0-d3
	objc_draw	#tcbarform,#cbar,#3,d0,d1,d2,d3
	bsr	readtrack
	addq.w	#1,track
	dbf	d5,gtloop
	rts


	bra	exit
*************************************************
*	Reads an entire track into memory	*
*	track,a6,realsectrack			*
*************************************************
readtrack:
	move.w	sectrack,-(sp)	;number of secs to read
	move.w	#0,-(sp)	;side
	move.w	track,-(sp)	;track
	move.w	#1,-(sp)	;first sector to read
	move.w	drive,-(sp)	;drive
	move.l	#0,-(sp)	;unused
	move.l	a6,-(sp)	;address to put sectors
	move.w	#8,-(sp)	;function number
	trap	#14
	add.l	#20,sp
	tst.w	d0
	bmi	cerror
	add.w	meminc,a6	;advance the memlocation
	cmpi.w	#2,sides
	bne	rtback

	move.w	sectrack,-(sp)
	move.w	#1,-(sp)
	move.w	track,-(sp)
	move.w	#1,-(sp)
	move.w	drive,-(sp)
	move.l	#0,-(sp)
	move.l	a6,-(sp)
	move.w	#8,-(sp)
	trap	#14
	add.l	#20,sp
	tst.w	d0
	bmi	cerror
	add.w	meminc,a6	;advance the memlocation
rtback:
	rts
*************************************************
*	writes an entire track from memory	*
*	track,a6,realsectrack			*
*************************************************
writetrack:
	move.w	sectrack,-(sp)	;number of secs to read
	move.w	#0,-(sp)	;side
	move.w	track,-(sp)	;track
	move.w	#1,-(sp)	;first sector to read
	move.w	drive,-(sp)	;drive
	move.l	#0,-(sp)	;unused
	move.l	a5,-(sp)	;address to put sectors
	move.w	#9,-(sp)	;function number
	trap	#14
	add.l	#20,sp
	tst.w	d0
	bmi	cerror2
	add.w	meminc,a5	;advance the memlocation
	cmpi.w	#2,sides
	bne	wtback

	move.w	sectrack,-(sp)
	move.w	#1,-(sp)
	move.w	track,-(sp)
	move.w	#1,-(sp)
	move.w	drive,-(sp)
	move.l	#0,-(sp)
	move.l	a5,-(sp)
	move.w	#9,-(sp)
	trap	#14
	add.l	#20,sp
	tst.w	d0
	bmi	cerror2
	add.w	meminc,a5	;advance the memlocation
wtback:
	rts

cerror:
	form_alert	#1,#copyerror1	;cant read disk
	move.w	int_out,d0
	cmpi.w	#1,d0
	beq	readtrack
	addq.l	#8,sp		;remove 2 returns
	bra	mainbit
cerror2:
	form_alert	#1,#copyerror2	;cant read disk
	move.w	int_out,d0
	cmpi.w	#1,d0
	beq	writetrack
	addq.l	#8,sp		;remove 2 returns
	bra	mainbit


trywriteboot:
	MOVE #1,-(A7)		number of sectors
	MOVE #0,-(A7)		side 0
	MOVE #0,-(A7)		track 0
	MOVE #1,-(A7)		sector 1
	MOVE #0,-(A7)		drive 0
	MOVE.L #0,-(A7)		not used
	MOVE.L #bootsec,-(A7)		buffer address
	MOVE #9,-(A7)		_FLOPWR
	TRAP #14		write boot sector & directory
	ADDA.L #20,A7		tidy stack
	cmpi.w	#-13,d0
	beq	return
	form_alert	#1,#notwriteprot
	bra	trywriteboot
return:
	rts
drawbardial:
	form_dial	#0,#0,#0,#0,#0,d0,d1,d2,d3
	movem.w	savebounds,d0-d3
	objc_draw	#tcbarform,#0,#3,d0,d1,d2,d3
	rts
readboot:
	MOVE #1,-(A7)		number of sectors
	MOVE #0,-(A7)		side 0
	MOVE #0,-(A7)		track 0
	MOVE #1,-(A7)		sector 1
	MOVE #0,-(A7)		drive 0
	MOVE.L #0,-(A7)		not used
	MOVE.L #bootsec,-(A7)		buffer address
	MOVE #8,-(A7)		_FLOPWR
	TRAP #14		write boot sector & directory
	ADDA.L #20,A7		tidy stack
	rts

bootsec:
	ds.b	512


getmemory:
	move.l	#-1,-(sp)
	move.w	#$48,-(sp)
	trap	#1
	addq.l	#6,sp		;get the amount available

	move.l	d0,d1
	divu	#512,d0		;how many sectors can we get in it
	move.w	d0,memsectors
	mulu	#512,d0
	move.l	d0,-(sp)
	move.w	#$48,-(sp)
	trap	#1
	addq.l	#6,sp
	move.l	d0,membuffer
	rts

*****************************************************************
*	Complete formatting section. Parts of which will	*
*	be used in the copy section.				*
*****************************************************************
formatter:
	form_alert	#3,#format1	;single|double|cancel
	move.w	int_out,d0
	cmpi.w	#3,d0
	beq	mainbit
	cmpi.w	#1,d0
	beq	issingle
	move.w	#2,sides
	move.w	#3,dtype	;80 trk double sided for protobt
	bra	dotype
issingle:
	move.w	#1,sides
	move.w	#2,dtype	;80 trk single sided for protobt
dotype:
	form_alert	#3,#format2	;Standard|EXTENDED
	move.w	int_out,d0
	cmpi.w	#2,d0
	beq	isextended
	move.w	#79,trackcount
	move.w	#9,sectrack
	bra	doformat
isextended:
	move.w	#81,trackcount
	move.w	#10,sectrack
doformat:
	form_alert	#2,#format3	;warning
	move.w	int_out,d0
	cmpi.w	#2,d0
	beq	mainbit		;cancelled out	
	form_alert	#1,#format4	;Please insert

	move.w	#0,drive		;formats only drive A
	form_center	#tfbarform

	move.l	#tfbarform,a0
	add.l	#fbar*24,a0
	move.w	#2,20(a0)		;make the bar small

	form_dial	#0,#0,#0,#0,#0,d0,d1,d2,d3
	movem.w	savebounds,d0-d3
	objc_draw	#tfbarform,#0,#3,d0,d1,d2,d3
	move.w	trackcount,d7
	move.w	#0,track
formatloop:
	move.w	#300,d0
	move.w	track,d1
	addq.w	#1,d1
	mulu	d1,d0
	move.w	trackcount,d1
	addq.w	#1,d1
	divu	d1,d0
	move.l	#tfbarform,a0
	add.l	#fbar*24,a0
	move.w	d0,20(a0)		;make the bar small
	movem.w	savebounds,d0-d3
	objc_draw	#tfbarform,#fbar,#3,d0,d1,d2,d3
	bsr	formattrack
	addq.w	#1,track
	dbf	d7,formatloop

	bsr	produceboot		;create standard boot sector
	lea	fbuffer,a0		;now modify the boot sector
	cmpi.w	#81,trackcount
	bne	standardboot
	move.w	#82*10,d0		;total sectors on disk
	move.w	sides,d1
	mulu	d1,d0
	move.b	d0,d1
	lsr.w	#8,d0
	move.b	d1,19(a0)
	move.b	d0,20(a0)
	move.w	#10,d0			;secs per track
	move.b	d0,d1
	lsr.w	#8,d0
	move.b	d1,24(a0)
	move.b	d0,25(a0)
	bsr	writeboot		;writes the boot sector out
	cmpi.w	#2,sides
	bne	esing
	form_alert	#1,#format5	;Please insert
	bra	mainbit
esing:
	form_alert	#1,#format5b	;Please insert
	bra	mainbit

standardboot:
	bsr	writeboot		;writes the boot sector out
	cmpi.w	#2,sides
	bne	ssing
	form_alert	#1,#format6	;Please insert
	bra	mainbit
ssing:
	form_alert	#1,#format6b	;Please insert
	bra	mainbit


*********************************************************
*	Format a single track, on the floppy disk	*
*	sides.w		must be set			*
*	track.w						*
*	sectrack.w					*
*	drive.w						*
*********************************************************
formattrack:
	movem.l	d0-a6,-(sp)
	move.w	#$0,-(sp)
	move.l	#$87654321,-(sp)
	move.w	#1,-(sp)	;sector interleave factor
	move.w	#0,-(sp)	;side
	move.w	track,-(sp)	;track
	move.w	sectrack,-(sp)	;sectors per track
	move.w	drive,-(sp)	;drive
	clr.l	-(sp)
	move.l	#fbuffer,-(sp)
	move.w	#10,-(sp)
	trap	#14
	add.l	#26,sp
	tst.w	d0
	bmi	ferror
	cmpi.w	#2,sides
	bne	ftrackback
	move.w	#$0,-(sp)
	move.l	#$87654321,-(sp)
	move.w	#1,-(sp)	;sector interleave factor
	move.w	#1,-(sp)	;side
	move.w	track,-(sp)	;track
	move.w	sectrack,-(sp)	;sectors per track
	move.w	drive,-(sp)	;drive
	clr.l	-(sp)
	move.l	#fbuffer,-(sp)
	move.w	#10,-(sp)
	trap	#14
	add.l	#26,sp
	tst.w	d0
	bmi	ferror
ftrackback:
	movem.l	(sp)+,d0-a6
	rts


*********************************************************
*	Produces a boot sector to be modified for	*
*	the type of format done				*
*	dtype.w		must be set			*
*********************************************************
produceboot:
	move.w	#0,-(sp)	;not executable
	move.w	dtype,-(sp)	;80 trks dbl
	move.l	#$01000001,-(sp)
	move.l	#fbuffer,-(sp)	;produce boot sector
	move.w	#18,-(sp)
	trap	#14
	add.l	#14,sp
	rts
*********************************************************
*	Writes out the boot sector			*
*********************************************************
writeboot:
	MOVE #1,-(A7)		number of sectors
	MOVE #0,-(A7)		side 0
	MOVE #0,-(A7)		track 0
	MOVE #1,-(A7)		sector 1
	MOVE drive,-(A7)		drive 0
	MOVE.L #0,-(A7)		not used
	MOVE.L #fbuffer,-(A7)		buffer address
	MOVE #9,-(A7)		_FLOPWR
	TRAP #14		write boot sector & directory
	ADDA.L #20,A7		tidy stack
	rts

ferror:
	form_alert	#2,#format7	;trouble, cancel|retry
	move.w	int_out,d0
	cmpi.w	#1,d0
	bne	isretry
	movem.l	(sp)+,d0-a6	;get all these off the stack
	addq.l	#4,sp		;remove return address
	bra	mainbit
isretry:
	movem.l	(sp)+,d0-a6	;get all these off the stack
	bra	formattrack

*********************************************************
*	Draw the complete dialogue			*
*********************************************************
drawmydial:
	movem.w	savebounds,d0-d3
	objc_draw	#tbackdrop,#backdrop,#3,d0,d1,d2,d3
	rts


exit:
	v_clsvwk			close it
	appl_exit			tell GEM I've finished

	pea     restoresa(pc)   	;check for presence of sound alert
        move    #38,-(sp)       ;and turn it off if so
        trap    #14
        addq    #6,sp


	clr.w	-(a7)			status code
	move.w	#$4c,-(a7)		P_TERM
	trap	#1			and go away

*********************************************************
*	Fixrsc, fixes the included rsc file same	*
*	as rsrc_load normally would.			*
*********************************************************
fixrsc:
	move.w	#num_obs-1,d7
frloop:
	rsrc_obfix	#obj0,d7
	dbf	d7,frloop
	rts


cdma:
	move.l	$5a0,a0		;get pointer to cookie jar
fcloop:
	move.l	(a0)+,d0
	beq.s	fcloopover
	cmpi.l	#'_SND',d0
	beq.s	chkdma
	addq.l	#4,a0
	bra.s	fcloop
chkdma:
	move.l	(a0)+,d0
	btst	#1,d0
	beq	fcloopover	;not dma sound
	move.w	#1,dma
	rts
fcloopover:
	move.w	#-1,dma
	rts

*********************************************************
*	Conducts a search for soundalert's cookie.	*
*	If found saves it's current state and turns	*
*	it off. sndalert=-1 for off 			*
*			 0 for not installed		*
*			 1 for on			*
*********************************************************
findsa:
	move.l	$5a0,a0		;get pointer to cookie jar
fsaloop:
	move.l	(a0)+,d0
	beq.s	fsaloopover
	cmpi.l	#'SMC1',d0
	beq.s	chksa
	addq.l	#4,a0
	bra.s	fsaloop
chksa:
	move.l	(a0),d0
	move.l	a0,savesa
	move.l	d0,sndalert	;save state
*	move.l	#-1,(a0)	;turn it off
	rts
fsaloopover:
	move.l	#0,sndalert
	rts

turnsaoff:
	move.l	savesa,a0
	move.l	#-1,(a0)
	rts
turnsaon:
	move.l	savesa,a0
	move.l	#1,(a0)
	rts




restoresa:
	move.l	savesa,a0
	tst.l	sndalert
	beq	nothere
	move.l	sndalert,(a0)	;restore to previous state
nothere:
	rts


waitsound:
	tst.b	$ff8901
	bne.s	waitsound
	rts


dintro:
	move.l	#samplestart,d0
	move.l	#sampleend,d1
	bsr	dosound
	rts
*****************************************
*	new sound chip stuff		*
*	pass sound start in d0		*
*	and sound end in d1		*
*****************************************
dosound:
	lea	$ff8900,a0	;sound register base address
	move.w	#0,sounddma(a0)
	move.w	d0,soundstartl(a0)
	lsr.l	#8,d0
	move.w	d0,soundstartm(a0)
	lsr.l	#8,d0
	move.w	d0,soundstarth(a0)
	move.w	d1,soundendl(a0)
	lsr.l	#8,d1
	move.w	d1,soundendm(a0)
	lsr.l	#8,d1
	move.w	d1,soundendh(a0)
	move.w	#%0000000010000010,soundmode(a0)
	move.w	#%0000000000000001,sounddma(a0)
	rts



	SECTION	DATA
dma:	dc.w	0
mainalert:
	dc.b	'[2][EASY DISK|What would you like to do?]'
	dc.b	'[COPY|FORMAT|QUIT]',0
format1:
	dc.b	'[2][FORMAT DISK|Do you wish to format a|'
	dc.b	'single or double|sided disk ?][SINGLE|DOUBLE|CANCEL]',0
format2:
	dc.b	'[2][FORMAT DISK|Do you want|STANDARD or EXTENDED format?|'
	dc.b	'STANDARD = Normal Atari disk|'
	dc.b	'EXTENDED = Extra storage space][STANDARD|EXTENDED]',0
format3:
	dc.b	'[3][FORMAT DISK|WARNING.....|Formatting a disk will|'
	dc.b	'erase all information on it.|Do you wish to continue?]'
	dc.b	'[YES|NO]',0
format4:
	dc.b	'[1][FORMAT DISK|Please insert the disk|'
	dc.b	'you wish to format|into drive A][OK]',0
format5:
	dc.b	'[1][FORMAT DISK|Disk was successfully|formatted. It has|'
	dc.b	'828416 bytes available.][MAIN MENU]',0
format5b:
	dc.b	'[1][FORMAT DISK|Disk was successfully|formatted. It has|'
	dc.b	'408576 bytes available.][MAIN MENU]',0
format6:
	dc.b	'[1][FORMAT DISK|Disk was successfully|formatted. It has|'
	dc.b	'726016 bytes available.][MAIN MENU]',0
format6b:
	dc.b	'[1][FORMAT DISK|Disk was successfully|formatted. It has|'
	dc.b	'357376 bytes available.][MAIN MENU]',0
format7:
	dc.b	'[3][FORMAT/COPY DISK|An error has occurred while|'
	dc.b	'writing to the disk. Check|that it is not write protected.|'
	dc.b	'Otherwise disk may be unusable.][CANCEL|RETRY]',0
copy1:
	dc.b	'[1][COPY DISK|Please insert the original,|'
	dc.b	'write-protected disk. This|is the disk you wish to|'
	dc.b	'copy FROM.][OK]',0
copy2:
	dc.b	'[1][COPY DISK|Please insert the disk|'
	dc.b	'you wish to copy TO.][OK]',0
copy3:
	dc.b	'[1][COPY DISK|Disk has been copied.]'
	dc.b	'[MAIN MENU]',0

notwriteprot:
	dc.b	'[3][COPY DISK|Your original disk is|not WRITE-PROTECTED, please|'
	dc.b	'write-protect it now and|try again.][OK]',0
copyerror1:
	dc.b	'[3][COPY DISK|Trouble reading from your|'
	dc.b	'ORIGINAL disk, please|make sure it is in the|'
	dc.b	'drive.][TRY AGAIN|CANCEL]',0
copyerror2:
	dc.b	'[3][COPY DISK|Trouble writing to your|'
	dc.b	'DESTINATION disk, please|make sure it is in the|'
	dc.b	'drive and not write-protected.][TRY AGAIN|CANCEL]',0
multialert:
	dc.b	'[1][COPY DISK - MULTI PASS|You will have to swap disks|'
	dc.b	'more than once, take care|not to mix up your FROM|'
	dc.b	'and TO disks.][I Will]',0

saonalert:
	dc.b	'[1][Sound Alert is installed on|'
	dc.b	'this computer and is|currently ACTIVE. Do you|'
	dc.b	'wish to turn it OFF ?][YES|NO]',0
saoffalert:
	dc.b	'[1][Sound Alert is installed on|'
	dc.b	'this computer and is|currently INACTIVE. Do|'
	dc.b	'wish to turn it ON ?][YES|NO]',0
copycant:
	dc.b	'[3][COPY DISK|Easydisk is unable to|'
	dc.b	'copy 11 sector disks.][SORRY]',0
	even

	SECTION	DATA
* ---------- Source code conversion from COPY1.RSC ----------

* ---------- Equates --------------------

backdrop=	0	; tree
fbarform=	1	; tree
cbarform=	2	; tree
fbar	=	2	; object in  tree
cbar	=	2	; object in fbarform tree

num_tree=	3
num_obs =	16

G_BOX      =  20
G_TEXT     =  21
G_BOXTEXT  =  22
G_IMAGE    =  23
G_PROGDEF  =  24
G_IBOX     =  25
G_BUTTON   =  26
G_BOXCHAR  =  27
G_STRING   =  28
G_FTEXT    =  29
G_FBOXTEXT =  30
G_ICON     =  31
G_TITLE    =  32

NONE       = %000000000
SELECTABLE = %000000001
DEFAULT    = %000000010
EXIT       = %000000100
EDITABLE   = %000001000
RBUTTON    = %000010000
LASTOB     = %000100000
TOUCHEXIT  = %001000000
HIDETREE   = %010000000
INDIRECT   = %100000000

NORMAL     = %000000
SELECTED   = %000001
CROSSED    = %000010
CHECKED    = %000100
DISABLED   = %001000
OUTLINED   = %010000
SHADOWED   = %100000

	even

* ---------- Ted Info Structures --------------------

ted0:
	dc.l	str0,null,null
	dc.w	3,0,2,$1181,0,0,35,1
ted1:
	dc.l	str3,null,null
	dc.w	3,0,2,$381,0,1,22,1
ted2:
	dc.l	str6,null,null
	dc.w	3,0,2,$1281,0,0,21,1
ted3:
	dc.l	str9,null,null
	dc.w	3,0,2,$1181,0,0,57,1
ted4:
	dc.l	str12,null,null
	dc.w	3,0,2,$1181,0,0,47,1
ted5:
	dc.l	str15,null,null
	dc.w	3,0,2,$1281,0,0,29,1
ted6:
	dc.l	str18,null,null
	dc.w	3,0,2,$1181,0,0,47,1
ted7:
	dc.l	str21,null,null
	dc.w	3,0,0,$1181,0,0,15,1
ted8:
	dc.l	str24,null,null
	dc.w	3,0,0,$1181,0,0,13,1

* ---------- Object Trees --------------------

tbackdrop:					; (tree 0)
obj0:
	dc.w	-1,1,7,G_BOX,NONE,OUTLINED
	dc.l	$21181
	dc.w	$402,0,72,$215
obj1:
	dc.w	2,-1,-1,G_TEXT,NONE,NORMAL
	dc.l	ted0
	dc.w	2,20,$444,1
obj2:
	dc.w	3,-1,-1,G_BOXTEXT,NONE,NORMAL
	dc.l	ted1
	dc.w	$401,$400,70,$401
obj3:
	dc.w	4,-1,-1,G_TEXT,NONE,NORMAL
	dc.l	ted2
	dc.w	1,2,$446,1
obj4:
	dc.w	5,-1,-1,G_TEXT,NONE,NORMAL
	dc.l	ted3
	dc.w	1,3,$446,1
obj5:
	dc.w	6,-1,-1,G_TEXT,NONE,NORMAL
	dc.l	ted4
	dc.w	1,4,$446,1
obj6:
	dc.w	7,-1,-1,G_TEXT,NONE,NORMAL
	dc.l	ted5
	dc.w	1,$411,$446,1
obj7:
	dc.w	0,-1,-1,G_TEXT,LASTOB,NORMAL
	dc.l	ted6
	dc.w	1,$412,$446,1
tfbarform:					; (tree 1)
obj8:
	dc.w	-1,1,3,G_BOX,NONE,OUTLINED
	dc.l	$21181
	dc.w	12,6,$42A,5
obj9:
	dc.w	3,2,2,G_BOX,NONE,NORMAL
	dc.l	$11181
	dc.w	2,2,$425,2
obj10:
	dc.w	1,-1,-1,G_BOX,NONE,NORMAL
	dc.l	$111C1
	dc.w	0,0,8,2
obj11:
	dc.w	0,-1,-1,G_TEXT,LASTOB,NORMAL
	dc.l	ted7
	dc.w	2,$400,$41A,$401
tcbarform:					; (tree 2)
obj12:
	dc.w	-1,1,3,G_BOX,NONE,OUTLINED
	dc.l	$21181
	dc.w	$310,$A06,$42A,5
obj13:
	dc.w	3,2,2,G_BOX,NONE,NORMAL
	dc.l	$11181
	dc.w	2,2,$425,2
obj14:
	dc.w	1,-1,-1,G_BOX,NONE,NORMAL
	dc.l	$111C1
	dc.w	0,0,8,2
obj15:
	dc.w	0,-1,-1,G_TEXT,LASTOB,NORMAL
	dc.l	ted8
	dc.w	2,$800,$41A,1

* ---------- Strings --------------------

null:	dc.b	0
str0:	dc.b	"    ½1992 Stephens Music Centre    ",0
str3:	dc.b	"EASY DISK",0
str6:	dc.b	"Stephens Music Centre",0
str9:	dc.b	"3/219 Merrylands Rd, Merrylands NSW 2160, Ph(02)637 3128",0
str12:	dc.b	"2 Moore Rd, Springwood NSW 2777 Ph(047)51 6196",0
str15:	dc.b	"Programming by Moving Pixels",0
str18:	dc.b	"2/39 Frazer St, Leichhardt 2040 Phone/Fax(02)555 7312",0
str21:	dc.b	"Formatting....",0
str24:	dc.b	"Reading.....",0
str25:	dc.b	"Writing.....",0
	even




	SECTION	BSS
drive:		ds.w	1
fbuffer:	ds.b	$2000
dtype:		ds.w	1
trackcount:	ds.w	1
sides:		ds.w	1
sectrack:	ds.w	1
track:		ds.w	1
savesa:	ds.l	1
sndalert:	ds.l	1

ap_id		ds.w 1
messagebuf	ds.b 16
	ds.l	1000			stack space
mystack	ds.w	1			(stacks go backwards)
message:	ds.b	16
mousex:		ds.b	1
mousey:		ds.b	1
savebounds:	ds.w	4
bdaddress:	ds.l	1
fbaddress:	ds.l	1
cbaddress:	ds.l	1
fb2address:	ds.l	1
firsttime:	ds.w	1
tracksinmem:	ds.w	1
serialnumber:	ds.l	1
memsectors:	ds.w	1
membuffer:	ds.l	1
meminc:		ds.w	1
realsectrack:	ds.w	1
remainder:	ds.w	1
savetrack:	ds.w	1
track2:		ds.w	1
* if not linking then include the run-times
	IFEQ	__LK
	include	aeslib.s
	include	vdilib.s
	ENDC
	SECTION	data
samplestart:
	incbin	'sample.spl'
sampleend:
