
*---------------------------------------------------------*
*     Disassembled with The Flaming Bird Disassembler     *
*    (c) Phoenix corp. 1992,93  -  All rights reserved    *
*---------------------------------------------------------*

         REL
	 mx	%00

	 use	SOUNDSEG.X.S
	 use	SOUNDSEG.E.S

	 use	4/Int.Macs
	 use	4/Mem.Macs
	 use	4/Misc.Macs
	 use	4/NoteSyn.Macs
	 use	4/Sound.Macs
	 use	4/Text.Macs
	 use	4/Util.Macs
	 
*-------------------------------


*---------------------------------------------------------*
*     Disassembled with The Flaming Bird Disassembler     *
*    (c) Phoenix corp. 1992,93  -  All rights reserved    *
*---------------------------------------------------------*

	REL

L290000	DA	L29071F
	DA	L2906BD
	DA	L290033
	DA	L29003E
	DA	L2900D1
	DA	L290484
	DA	L29053B
	DA	L29056E
	DA	L29056E
	DA	L290580
L290014	PHP
	SEP	#$20
	LDX	$6C
	PHX
	LDX	$74
	PHX
	LDX	$6C
	STX	$6C
	STX	L02756C
	LDX	$74
	STX	$74
	JSR	(L290000,X)
	PLX
	STX	$74
	PLX
	STX	$6C
	PLP
	RTL

L290033	JSR	L29056E
	_AllNotesOff
	RTS

L29003E	PHP
	REP	#$20
	LDX	L02756C
	STX	$60
	LDY	#$0008
	LDA	($60),Y
	STA	$70
	LDA	($70)
	STA	$6C
	LDY	#$0002
	LDA	($70),Y
	STA	$6E
	LDY	#$0010
	LDA	#$0001
	STA	($60),Y
	SEP	#$20
	LDA	[$6C]
	CMP	#$00
	REP	#$20
	BEQ	L290076
	LDY	#$0010
	LDA	#$0003
	STA	($60),Y
	STA	$5C
	PLP
	RTS

L290076	LDY	#$0016
	LDA	#$0000
	STA	($60),Y
	LDY	#$000C
	LDA	#$0022
	STA	($60),Y
	INC	$6C
	LDA	$6C
	CLC
	ADC	#$0020
	STA	$6C
	STZ	$64
	LDA	$74
	CMP	#$0012
	BEQ	L2900A0
	LDY	#$0018
	LDA	($60),Y
	STA	$64
L2900A0	JSR	L290459
	JSR	L2906C4
	STZ	L027556
	LDA	#$0002
	STA	L027558
	STZ	L027570
	STZ	L027566
	STZ	L027568
	LDA	#$0014
	STA	L027564
	STZ	L027572
	STZ	L027574
	LDA	#$0022
	STA	L02756A
	LDA	#$0001
	STA	$5C
	PLP
	RTS

L2900D1	PHP
	REP	#$20
	LDA	$5C
	PHA
	LDA	$64
	PHA
	LDA	$60
	PHA
	LDA	$70
	PHA
	LDA	$6C
	PHA
	LDA	$6E
	PHA
	LDA	$74
	PHA
	LDA	L02756C
	STA	$60
	LDY	#$0008
	LDA	($60),Y
	STA	$70
	LDA	($70)
	STA	$6C
	LDY	#$0002
	LDA	($70),Y
	STA	$6E
	LDA	L027556
	BEQ	L290138
	LDA	L027570
	BNE	L29011D
	STZ	L027556
	LDY	#$000C
	LDA	($60),Y
	CLC
	ADC	$6C
	STA	$6C
	STA	L02756E
	JMP	L2901DA

L29011D	LDA	$74
	CMP	#$0012
	BNE	L29012A
	STZ	L027556
	JMP	L290135

L29012A	DEC	L027556
	LDA	L027566
	BEQ	L290135
	JSR	L2904BD
L290135	JMP	L290282

L290138	LDY	#$000C
	LDA	($60),Y
	CLC
	ADC	$6C
	STA	$6C
	STA	L02756E
L290145	LDA	L027558
	CMP	#$0001
	BEQ	L290150
	JMP	L2901DA

L290150	SEP	#$20
	LDA	[$6C]
	STA	L02755E
	LDX	$6C
	INX
	STX	$6C
	CMP	#$FC
	BNE	L290166
	JSR	L290299
	JMP	L290282

L290166	CMP	#$F8
	REP	#$20
	BNE	L29018D
	LDA	#$00F0
	STA	L027556
	LDA	#$0001
	STA	L027558
	LDA	L027570
	CMP	#$0001
	BNE	L29018A
	LDA	$74
	CMP	#$0012
	BEQ	L290145
	JMP	L29026B
L29018A	JMP	L290145

L29018D	LDA	#$0002
	STA	L027558
	LDA	L02755E
	AND	#$00FF
	CLC
	ADC	L027556
	STA	L027556
	LDA	L027570
	BNE	L2901AB
	STZ	L027556
	JMP	L2901DA

L2901AB	LDA	$74
	CMP	#$0012
	BNE	L2901BE
	STZ	L027556
	LDA	#$0002
	STA	L027558
	JMP	L29026B

L2901BE	LDA	L027556
	CMP	#$0001
	BCC	L2901DA
	DEC	L027556
	LDA	#$0002
	STA	L027558
	LDA	L027566
	BEQ	L2901D7
	JSR	L2904BD
L2901D7	JMP	L29026B

L2901DA	LDA	#$0002
	STA	L027558
	SEP	#$20
	LDA	[$6C]
	STA	L02755E
	BIT	#$80
	BNE	L2901FE
	LDA	L02755A
	STA	$5D
	LDA	L02755C
	STA	$5C
	LDA	L02755E
	STA	L027560
	JMP	L29021C

L2901FE	LDA	L02755E
	AND	#$F0
	STA	$5D
	STA	L02755A
	LDA	L02755E
	AND	#$0F
	STA	L02755C
	STA	$5C
	LDX	$6C
	INX
	STX	$6C
	LDA	[$6C]
	STA	L027560
L29021C	LDA	$5D
	CMP	#$B0
	BNE	L290225
	JMP	L2905DD

L290225	CMP	#$F0
	BNE	L29022C
	JMP	L290656

L29022C	CMP	#$C0
	BNE	L290233
	JMP	L290674

L290233	CMP	#$E0
	BNE	L29023A
	JMP	L2903F3

L29023A	CMP	#$D0
	BNE	L290241
	JMP	L2906B6

L290241	REP	#$20
	LDA	$74
	CMP	#$0012
	BEQ	L29025C
	SEP	#$20
	LDA	$5D
	CMP	#$90
	BNE	L290255
	JMP	L2902DD

L290255	CMP	#$80
	BNE	L29025C
	JMP	L2903A1

L29025C	REP	#$20
	INC	$6C
	INC	$6C
L290262	LDA	#$0001
	STA	L027558
	JMP	L290145

L29026B	LDA	$6C
	SEC
	SBC	L02756E
	STA	$6C
	LDA	L02756C
	STA	$60
	LDY	#$000C
	LDA	($60),Y
	CLC
	ADC	$6C
	STA	($60),Y
L290282	PLX
	STX	$74
	PLX
	STX	$6E
	PLX
	STX	$6C
	PLX
	STX	$70
	PLX
	STX	$60
	PLX
	STX	$64
	PLX
	STX	$5C
	PLP
	RTS

L290299	PHP
	REP	#$20
	LDA	L02756C
	STA	$60
	LDY	#$0016
	LDA	#$FFFF
	STA	($60),Y
	LDA	L02756A
	STA	$5C
	LDY	#$000C
	STA	($60),Y
	STZ	L027556
	LDA	#$0002
	STA	L027558
	STZ	L027572
	STZ	L027574
	LDA	L027570
	BNE	L2902CD
	INC	L027570
	JMP	L2902D8

L2902CD	LDA	L02756A
	CMP	#$0022
	BNE	L2902D8
	DEC	L027570
L2902D8	JSR	L2904B5
	PLP
	RTS

L2902DD	REP	#$20
	LDX	$5C
	PHX
	LDX	$60
	PHX
	LDX	$64
	PHX
	LDX	$68
	PHX
	LDX	$70
	PHX
	LDA	L02755C
	ASL
	ASL
	TAX
	LDA	L02757A,X
	STA	$64
	LDA	L02757A+2,X
	STA	$66
	LDA	#$0001
	STA	L027570
	INC	$6C
	LDA	[$6C]
	INC	$6C
	AND	#$00FF
	STA	L027562
	BNE	L290317
	JSR	L2903B5
	BRA	L290363
L290317	LDA	L02756C
	STA	$60
	LDY	#$0018
	LDA	($60),Y
	STA	$68
	BEQ	L290363
	PEA	$0000
	PEA	$0040
	_AllocGen
	LDA	$01,S
	ASL
	TAY
	LDA	L027560
	STA	[$64],Y
	LDA	L027560
	PHA
	LDA	L02755C
	ASL
	TAX
	TAY
	LDAL	L0277BA,X
	ASL
	TAX
	LDA	L0277DA,X
	PHA
	TYA
	ASL
	TAX
	LDAL	L2805A8+2,X
	PHA
	LDAL	L2805A8,X
	PHA
	_NoteOn
L290363	PLX
	STX	$70
	PLX
	STX	$68
	PLX
	STX	$64
	PLX
	STX	$60
	PLX
	STX	$5C
	JMP	L290262

	PHP
	REP	#$20
	LDA	$64
	PHA
	LDA	L027572
	AND	#$00FF
	STA	$64
	LDA	L027574
	CMP	#$0001
	BCC	L290395
	LDA	$60
	CLC
	ADC	$64
	STA	$60
	JMP	L29039C

L290395	LDA	$60
	SEC
	SBC	$64
	STA	$60
L29039C	PLA
	STA	$64
	PLP
	RTS

L2903A1	REP	#$20
	INC	$6C
	LDA	[$6C]
	AND	#$00FF
	STA	L027562
	INC	$6C
	JSR	L2903B5
	JMP	L290262

L2903B5	PHP
	REP	#$20
	LDX	$64
	PHX
	LDA	L02755C
	ASL
	ASL
	TAX
	LDA	L02757A,X
	STA	$64
	LDA	L02757A+2,X
	STA	$66
	LDY	#$001C
L2903CE	LDA	[$64],Y
	CMP	L027560
	BEQ	L2903DB
	DEY
	DEY
	BPL	L2903CE
	BRA	L2903EE
L2903DB	TYA
	LSR
	PHA
	LDA	L027560
	PHA
	LDA	#$FFFF
	STA	[$64],Y
	_NoteOff
L2903EE	PLA
	STA	$64
	PLP
	RTS

L2903F3	REP	#$20
	LDX	$5C
	PHX
	LDX	$60
	PHX
	LDX	$64
	PHX
	LDX	$68
	PHX
	INC	$6C
	LDA	[$6C]
	AND	#$00FF
	STA	L027562
	INC	$6C
	PLX
	STX	$68
	PLX
	STX	$64
	PLX
	STX	$60
	PLX
	STX	$5C
	JMP	L290262

L29041C	PHP
	REP	#$20
	LDA	$5C
	PHA
	LDA	$60
	PHA
	INC	$6C
	LDA	L027560
	AND	#$00FF
	STA	$5C
	LDA	L02756C
	STA	$60
	LDY	#$0016
	LDA	$5C
	STA	($60),Y
	CMP	#$007F
	BNE	L290451
	LDA	$6C
	SEC
	SBC	L02756E
	LDY	#$000C
	CLC
	ADC	($60),Y
	DEC
	DEC
	STA	L02756A
L290451	PLX
	STX	$60
	PLX
	STX	$5C
	PLP
	RTS

L290459	PHP
	REP	#$20
	LDA	$64
	ASL
	ASL
	ASL
	ASL
	STA	$60
	PHA
	LDA	#$00FF
	PHA
	_GetSoundVolume
	PLA
	AND	#$000F
	ORA	$60
	PHA
	LDA	#$00FF
	PHA
	_SetSoundVolume
	PLP
	RTS

L290484	PHP
	REP	#$20
	LDA	L027566
	BNE	L2904B3
	LDA	$60
	PHA
	LDA	$64
	PHA
	LDA	L02756C
	STA	$60
	LDY	#$0018
	LDA	($60),Y
	STA	$64
	PHA
	JSR	L290459
	LDA	#$001E
	PHA
	_WriteBParam
	PLA
	STA	$64
	PLA
	STA	$60
L2904B3	PLP
	RTS

L2904B5	_AllNotesOff
	RTS

L2904BD	PHP
	REP	#$20
	LDA	$60
	PHA
	LDA	$64
	PHA
	DEC	L027564
	BNE	L290533
	DEC	L027566
	LDA	L027566
	STA	$64
	JSR	L290459
	LDA	L027566
	BNE	L29051F
	LDA	L02756C
	STA	$60
	LDY	#$000A
	LDA	#$0000
	STA	($60),Y
	JSR	L290299
	PHA
	LDA	#$001E
	PHA
	_ReadBParam
	PLA
	ASL
	ASL
	ASL
	ASL
	PHA
	PHA
	LDA	#$00FF
	PHA
	_GetSoundVolume
	PLA
	AND	#$000F
	ORA	$01,S
	PHA
	LDA	#$00FF
	PHA
	_SetSoundVolume
	PLA
	JMP	L290533

L29051F	LDA	#$0014
	CLC
	ADC	L027568
	STA	L027564
	LDA	L027568
	CLC
	ADC	#$0002
	STA	L027568
L290533	PLA
	STA	$64
	PLA
	STA	$60
	PLP
	RTS

L29053B	PHP
	REP	#$20
	LDA	$60
	PHA
	LDA	$64
	PHA
	LDA	L027566
	BNE	L290566
	LDA	L02756C
	STA	$60
	LDY	#$0018
	LDA	($60),Y
	STA	L027566
	BNE	L290566
	LDY	#$000A
	LDA	#$0000
	STA	($60),Y
	JSR	L29056E
	JSR	L290299
L290566	PLA
	STA	$64
	PLA
	STA	$60
	PLP
	RTS

L29056E	PHP
	REP	#$20
	JSR	L2904B5
	LDA	$74
	CMP	#$000E
	BNE	L29057E
	JSR	L290299
L29057E	PLP
	RTS

L290580	PHP
	REP	#$20
	SEI
	LDX	$64
	PHX
	LDA	L02756C
	STA	$60
	LDY	#$000C
	LDA	($60),Y
	STA	$64
	LDA	$6C
	PHA
	JSR	L29003E
	PLA
	STA	$6C
	LDA	$5C
	CMP	#$0001
	BNE	L2905CB
L2905A3	LDA	$6C
	PHA
	JSR	L2900D1
	PLA
	STA	$6C
	LDA	L02756C
	STA	$60
	LDY	#$0016
	LDA	($60),Y
	CMP	#$FFFF
	BNE	L2905C2
	LDY	#$000C
	LDA	($60),Y
	STA	$64
L2905C2	LDY	#$000C
	LDA	($60),Y
	CMP	$64
	BCC	L2905A3
L2905CB	LDY	#$0018
	LDA	($60),Y
	BEQ	L2905D7
	STA	$64
	JSR	L290459
L2905D7	PLA
	STA	$64
	CLI
	PLP
	RTS

L2905DD	REP	#$20
	LDX	$64
	PHX
	LDA	L027560
	CMP	#$0007
	BNE	L29064C
	INC	$6C
	LDA	[$6C]
	INC	$6C
	AND	#$00FF
	STA	L027578
	LDA	L02755C
	ASL
	ASL
	TAX
	LDA	L02757A,X
	STA	$64
	LDA	L02757A+2,X
	STA	$66
	TXA
	LSR
	TAX
	LDA	L027578
	CLC
	ADCL	L280588,X
	BPL	L290619
	LDA	#$0000
	JMP	L290621

L290619	CMP	#$0080
	BCC	L290621
	LDA	#$007F
L290621	STA	L027578
	STAL	L0277BA,X
	LDY	#$001C
L29062B	LDA	[$64],Y
	CMP	#$FFFF
	BEQ	L290645
	LDA	L027578
	ASL
	TAX
	LDA	L0277DA,X
	PHA
	TYA
	LSR
	PHA
	_SetSoundVolume
L290645	DEY
	DEY
	BPL	L29062B
	JMP	L290650

L29064C	INC	$6C
	INC	$6C
L290650	PLX
	STX	$64
	JMP	L290262

L290656	SEP	#$20
	LDA	$5C
	CMP	#$0C
	BNE	L290664
	JSR	L290299
	JMP	L290282

L290664	LDA	[$6C]
	LDX	$6C
	INX
	STX	$6C
	CMP	#$F7
	BNE	L290664
	REP	#$20
	JMP	L290145

	MX	%10
L290674	LDA	$5C
	CMP	#$0F
	REP	#$20
	BNE	L290682
	JSR	L29041C
	JMP	L290262

L290682	LDA	L027560
	INC	$6C
	ASL
	ASL
	TAX
	LDAL	L28064C+2,X
	PHA
	LDAL	L28064C,X
	PHA
	TXA
	LSR
	TAX
	LDAL	L2805E8,X
	PHA
	LDA	L02755C
	ASL
	TAX
	PLA
	STAL	L280588,X
	TXA
	ASL
	TAX
	PLA
	STAL	L2805A8,X
	PLA
	STAL	L2805A8+2,X
	JMP	L290262

L2906B6	REP	#$20
	INC	$6C
	JMP	L290262

L2906BD	PHP
	REP	#$20
	STZ	$5C
	PLP
	RTS

L2906C4	PHP
	REP	#$20
	STZ	L027556
	STZ	L02755C
	LDA	#$0001
	STA	L027558
	LDA	#$0090
	STA	L02755A
	LDX	#L0277BA
	TXY
	INY
	INY
	LDA	#$007F
	STA	L0277BA
	LDA	#$001D
	PHB
	MVN	L0277BA,L0277BA
	PLB
	LDX	#L280588
	TXY
	INY
	INY
	LDA	#$0000
	STAL	L280588
	LDA	#$001D
	PHB
	MVN	L280588,L280588
	PLB
	LDA	#$0000
	STAL	L28059A
	LDX	#L0275BA
	LDY	#L0275BC
	LDA	#$FFFF
	STA	L0275BA
	LDA	#$01FD
	PHB
	MVN	L0275BA,L0275BA
	PLB
	PLP
	RTS
L29071F	RTS

L290720	PHP
	REP	#$20
	LDA	#L027545
	STA	$6C
	LDA	#^L027545
	STA	$6E
	LDA	#$0000
	STA	$70
	JSL	L29073E
	LDA	#$0001
	STA	L0242E9
	PLP
	RTL

L29073E	PHP
	REP	#$20
	LDA	$60
	PHA
	LDA	$64
	PHA
	PEA	$0000
	PEA	$0000
	PEA	$0000
	PEA	$2000
	LDA	L020000
	PHA
	PEA	$0000
	PEA	$0000
	PEA	$0000
	_NewHandle
	BCC	L290795
	BRA	L290786
L29076B	STR	'Alocating 8K ram for sound'
L290786	PEA	^L29076B
	PEA	L29076B
	_WriteLine
	BRK	$F0
L290795	PLA
	PLX
	STA	$60
	STX	$62
	STA	$64
	STX	$66
	LDY	#$0004
	LDA	[$64],Y
	ORA	#$8000
	STA	[$64],Y
	DEY
	DEY
	LDA	[$64],Y
	STA	L0278E8
	LDA	[$64]
	STA	L0278E6
	PEA	$0000
	_NSStatus
	PLA
	BEQ	L2907C9
	_NSShutDown
L2907C9	LDA	$6C
	STA	L0278DC
	LDA	$6E
	STA	L0278DE
	LDA	#$2000
	STA	L0278EA
L2907D9	JSL	GSOS
	DW	$0010	;	Open
	ADRL	L0278DA
	BCC	L29081F
	TAX
	LDA	L024288
	BEQ	L290814
	PHX
	LDA	$6E
	PHA
	LDA	$6C
	PHA
	_SysFailMgr
	STR	' Could not open wave file '
L290814	JSL	L0F028F
	JSL	L0F01F9
	JMP	L2907D9

L29081F	LDA	L0278DA
	STA	L0278E4
	STA	L0278F2
	LDY	#$0008
	LDX	$70
L29082D	JSL	GSOS
	DW	$0012	;	Read
	ADRL	L0278E4
	BCC	L29086F
	PHA
	CMP	#$004C
	BNE	L290848
	PLA
	LDA	L0278EE
	BEQ	L29087F
	JMP	L29086F

L290848	PEA	^L290855
	PEA	L290855
	_SysFailMgr
L290855	STR	' Error reading wave file '
L29086F	PHX
	PHY
	JSL	L2908DA
	PLY
	PLA
	CLC
	ADC	L0278EE
	TAX
	DEY
	BNE	L29082D
L29087F	JSL	GSOS
	DW	$0014	;	Close
	ADRL	L0278F2
	LDA	$60
	LDX	$62
	PHX
	PHA
	_DisposeHandle
	PEA	$0096
	PEA	$0000
	PEA	$0000
	_NSStartUp
	BCC	L2908D1
	PHA
	PEA	^L2908B6
	PEA	L2908B6
	_SysFailMgr
L2908B6	STR	' Note synth startup error '
L2908D1	CLI
	PLA
	STA	$64
	PLA
	STA	$60
	PLP
	RTL

L2908DA	SEI
	LDA	L0278E8
	PHA
	LDA	L0278E6
	PHA
	PHX
	LDA	L0278EE
	PHA
	_WriteRamBlock
	BCC	L290911
	BRA	L290902
L2908F3	STR	' writing wave '
L290902	PEA	^L2908F3
	PEA	L2908F3
	_WriteLine
	BRK	$F0
L290911	CLI
	RTL

	PHP
	STA	$64
	BRA	L29092E
L290918	STR	'The error code was:  '
L29092E	PEA	^L290918
	PEA	L290918
	_WriteLine
	LDA	$64
	JSL	L290947
	JSL	L0F01C6
	PLP
	RTL

L290947	PEA	$0000
	PEA	$0000
	PHA
	_HexIt
	PLA
	STA	L02035D
	PLA
	STA	L02035F
	PEA	^L02035D
	PEA	L02035D
	_WriteCString
	RTL

L29096B	ENT
	PHP
	REP	#$20
	LDA	#$0001
	STA	L027AFC
	LDA	#$0001
	STA	L027AE0
	PHA
	LDA	#$001E
	PHA
	_ReadBParam
	PLA
	STA	L02792C
	LDA	#$0002
	STA	$74
	JSL	L290014
	LDA	$5C
	CMP	#$FFFF
	BNE	L2909A3
	STZ	L027AD4
	STZ	L027AD2
	JMP	L2909FB

L2909A3	PEA	$0000
	PEA	$0000
	PEA	$0000
	PEA	$4E20
	LDA	L020000
	PHA
	PEA	$C010
	PEA	$0000
	PEA	$0000
	_NewHandle
	BCC	L2909D6
	PLA
	PLA
	STZ	L027AD4
	STZ	L027ADE
	STZ	L027ADC
	STZ	L027ADA
	JMP	L2909FB

L2909D6	PLA
	STA	$68
	STA	L027930
	PLA
	STA	$6A
	STA	L027932
	LDA	[$68]
	INC
	INC
	STA	L027ADA
	LDY	#$0002
	LDA	[$68],Y
	STA	L027ADC
	LDA	#$0001
	STA	L027ADE
	JSL	L290D5F
L2909FB	PLP
	RTL

L2909FD	ENT
	PHP
	REP	#$20
	LDA	L027AE0
	CMP	#$0001
	BEQ	L290A0B
	JMP	L290B21

L290A0B	LDA	L0242E9
	BNE	L290A14
	JSL	L290720
L290A14	LDA	$5D
	AND	#$00FF
	STA	L02791E
	PHA
	LDA	#$001E
	PHA
	_ReadBParam
	PLA
	STA	L02792C
	LDA	$5C
	AND	#$00FF
	CMP	#$0009
	BNE	L290A4A
	LDA	L027AD2
	BEQ	L290A4A
	LDA	#L027AD6
	STA	L02791C
	LDA	L027AD2
	STA	L027AD4
	JMP	L290B05

L290A4A	LDA	L027ADE
	CMP	#$0001
	BEQ	L290A58
	STZ	L027AD4
	JMP	L290B21

L290A58	LDA	$5C
	AND	#$00FF
	DEC
	ASL
	ASL
	TAX
	LDA	L027938,X
	STA	L027AE4
	INX
	INX
	LDA	L027938,X
	STA	L027AE6
L290A6F	JSL	GSOS
	DW	$0010	;	Open
	ADRL	L027AE2
	BCC	L290ABB
	TAX
	LDA	L024288
	BEQ	L290AAA
	PHX
	PEA	^L290A8F
	PEA	L290A8F
	_SysFailMgr
L290A8F	STR	' Could not open song file '
L290AAA	JSL	L0F028F
	JSL	L0F01F9
	JMP	L290A6F

	STZ	L027AD4
	JMP	L290B21

	MX	%00
L290ABB	LDA	#$8C9F
	STA	L027AF2
	LDA	L027AE2
	STA	L027AEC
	STA	L027AFA
	LDA	L027ADA
	DEC
	DEC
	STA	L027AEE
	LDA	L027ADC
	STA	L027AF0
	JSL	GSOS
	DW	$0012	;	Read
	ADRL	L027AEC
	BCC	L290AEF
	CMP	#$004C
	BEQ	L290AEF
	STZ	L027AD4
	JMP	L290AF5

L290AEF	LDA	#$0001
	STA	L027AD4
L290AF5	JSL	GSOS
	DW	$0014	;	Close
	ADRL	L027AFA
	LDA	#L027ADA
	STA	L02791C
L290B05	LDA	L027AD4
	BEQ	L290B21
	LDA	#L027914
	STA	$6C
	LDA	#$0006
	STA	$74
	STA	L027AFC
	JSL	L290014
	STZ	L027AFC
	STZ	L02790E
L290B21	LDA	L0242D9
	BEQ	$0B29
	STZ	L02792C
	PLP
	RTL

L290B2B	ENT
	PHP
	REP	#$20
	LDA	L027AD4
	BEQ	L290B7B
	LDA	L02791E
	BEQ	L290B53
	LDA	L02792A
	CMP	#$FFFF
	BNE	L290B53
	STZ	L02790E
	LDA	L02791E
	CMP	#$00FF
	BEQ	L290B50
	DEC	L02791E
	BEQ	L290B53
L290B50	STZ	L02792A
L290B53	LDA	L02792A
	CMP	#$FFFF
	BNE	L290B61
	STZ	L02790E
	JMP	L290B7B

L290B61	LDA	$6C
	PHA
	LDA	$74
	PHA
	LDA	#L027914
	STA	$6C
	LDA	#$0008
	STA	$74
	JSL	L290014
	PLA
	STA	$74
	PLA
	STA	$6C
L290B7B	PLP
	RTL

	PHP
	REP	#$20
	LDA	L027AD4
	BEQ	L290B9F
	LDA	#L027914
	STA	$6C
	LDA	#$000E
	STA	$74
	STA	L027AFC
	STZ	L027AD4
	JSL	L290014
	STZ	L027AFC
	STZ	L02790E
L290B9F	PLP
	RTL

	PHP
	REP	#$20
	LDA	L027AD4
	BEQ	L290BCC
	STA	L027912
	LDA	L02790E
	STA	L027910
	LDA	#L027914
	STA	$6C
	LDA	#$0010
	STA	$74
	STA	L027AFC
	STZ	L027AD4
	JSL	L290014
	STZ	L027AFC
	STZ	L02790E
L290BCC	PLP
	RTL

	PHP
	REP	#$20
	LDA	L027910
	STA	L02790E
	LDA	L027912
	BEQ	L290BDF
	STA	L027AD4
L290BDF	PLP
	RTL

L290BE1	ENT
	PHP
	REP	#$20
	LDA	L027AE0
	CMP	#$0001
	BNE	L290C19
	LDA	L027AD4
	BEQ	L290C19
	LDA	L0242D9
	EOR	#$0001
	STA	L0242D9
	BEQ	L290C02
	STZ	L02792C
	JMP	L290C19

L290C02	PHA
	LDA	#$00FF
	PHA
	_GetSoundVolume
	PLA
	AND	#$00FF
	LSR
	LSR
	LSR
	LSR
	STA	L02792C
L290C19	PLP
	RTL

L290C1B	ENT
	PHP
	REP	#$20
	LDA	L027AE0
	CMP	#$0001
	BNE	L290C4A
	LDA	L02790E
	BNE	L290C4A
	LDA	L027AD4
	BEQ	L290C4A
	LDA	#$0001
	STA	L02790E
	LDA	#L027914
	STA	$6C
	LDA	#$000C
	STA	L027AFC
	STA	$74
	JSL	L290014
	STZ	L027AFC
L290C4A	PLP
	RTL

L290C4C	ENT
	PHP
	REP	#$20
	LDA	L0242D5
	BEQ	L290C6B
	LDA	L027AD4
	BEQ	L290C6B
	JSL	L290C1B
L290C5D	LDA	L02792A
	CMP	#$FFFF
	BNE	L290C5D
	STZ	L0242D5
	STZ	L027AD4
L290C6B	PLP
	RTL

L290C6D	PHP
	REP	#$20
	LDA	L027AE0
	CMP	#$0001
	BNE	L290CA1
	LDA	L0242D9
	CMP	#$0001
	BEQ	L290CA1
	LDA	L0242D9
	CMP	#$0001
	BEQ	L290CA1
	LDA	$5C
	STA	L02792C
	LDA	#L027914
	STA	$6C
	LDA	#$000A
	STA	L027AFC
	STA	$74
	JSL	L290014
	STZ	L027AFC
L290CA1	PLP
	RTL

L290CA3	ENT
	PHP
	REP	#$20
	LDA	L027AE0
	CMP	#$0001
	BNE	L290CDD
	LDA	L0242D9
	CMP	#$0001
	BEQ	L290CDD
	PHA
	LDA	#$00FF
	PHA
	_GetSoundVolume
	LDA	$01,S
	AND	#$00F0
	CMP	#$00F0
	BCS	L290CDC
	LDA	$01,S
	CLC
	ADC	#$0010
	LSR
	LSR
	LSR
	LSR
	STA	$5C
	JSL	L290C6D
L290CDC	PLA
L290CDD	PLP
	RTL

L290CDF	ENT
	PHP
	REP	#$20
	LDA	L027AE0
	CMP	#$0001
	BNE	L290D19
	LDA	L0242D9
	CMP	#$0001
	BEQ	L290D19
	PHA
	LDA	#$00FF
	PHA
	_GetSoundVolume
	LDA	$01,S
	AND	#$00F0
	CMP	#$0010
	BCC	L290D18
	LDA	$01,S
	SEC
	SBC	#$0010
	LSR
	LSR
	LSR
	LSR
	STA	$5C
	JSL	L290C6D
L290D18	PLA
L290D19	PLP
	RTL

L290D1B	ENT
	PHP
	REP	#$20
	LDA	L027AE0
	CMP	#$0001
	BNE	L290D5D
	LDA	#$0004
	STA	$74
	JSL	L290014
	LDA	L027AD6
	ORA	L027AD8
	BEQ	L290D46
	LDA	L027934
	LDX	L027936
	PHX
	PHA
	_DisposeHandle
L290D46	LDA	L027ADA
	ORA	L027ADC
	BEQ	L290D5D
	LDA	L027930
	LDX	L027932
	PHX
	PHA
	_DisposeHandle
L290D5D	PLP
	RTL

L290D5F	PHP
	REP	#$20
	LDA	L0242F7
	BNE	L290D8B
	PEA	$0000
	PEA	$0000
	PEA	$0000
	PEA	$1D4C
	LDA	L020000
	PHA
	PEA	$C010
	PEA	$0000
	PEA	$0000
	_NewHandle
	BCC	L290D97
	PLA
	PLA
L290D8B	STZ	L027AD2
	STZ	L027AD6
	STZ	L027AD8
	JMP	L290E4E

L290D97	PLA
	STA	$68
	STA	L027934
	PLA
	STA	$6A
	STA	L027936
	LDA	[$68]
	INC
	INC
	STA	L027AD6
	LDY	#$0002
	LDA	[$68],Y
	STA	L027AD8
	LDA	#L027A10
	STA	L027AE4
	LDA	#^L027A10
	STA	L027AE6
L290DBE	JSL	GSOS
	DW	$0010	;	Open
	ADRL	L027AE2
	BCC	L290E0A
	TAX
	LDA	L024288
	BEQ	L290DF9
	PHX
	PEA	^L290DDE
	PEA	L290DDE
	_SysFailMgr
L290DDE	STR	' Could not open song9'09'file'
L290DF9	JSL	L0F028F
	JSL	L0F01F9
	JMP	L290DBE

	STZ	L027AD2
	JMP	L290E4E

	MX	%00
L290E0A	LDA	#$1D4C
	STA	L027AF2
	LDA	L027AE2
	STA	L027AEC
	STA	L027AFA
	LDA	L027AD6
	DEC
	DEC
	STA	L027AEE
	LDA	L027AD8
	STA	L027AF0
	JSL	GSOS
	DW	$0012	;	Read
	ADRL	L027AEC
	BCC	L290E3E
	CMP	#$004C
	BEQ	L290E3E
	STZ	L027AD2
	JMP	L290E44

L290E3E	LDA	#$0001
	STA	L027AD2
L290E44	JSL	GSOS
	DW	$0014	;	Close
	ADRL	L027AFA
L290E4E	PLP
	RTL

L290E50	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290E7D
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCC	L290E6A
	JMP	L290F03

L290E6A	PEA	$0032
	PEA	$007F
	PEA	^L2A0000
	PEA	L2A0000
	_NoteOn
L290E7D	PLP
	RTL

L290E7F	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290EA9
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCS	L290F03
	PEA	$003C
	PEA	$007F
	PEA	^L2A0000
	PEA	L2A0000
	_NoteOn
L290EA9	PLP
	RTL

L290EAB	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290ED5
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCS	L290F03
	PEA	$0032
	PEA	$007F
	PEA	^L2A002C
	PEA	L2A002C
	_NoteOn
L290ED5	PLP
	RTL

L290ED7	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290F01
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCS	L290F03
	PEA	$0032
	PEA	$007F
	PEA	^L2A002C
	PEA	L2A002C
	_NoteOn
L290F01	PLP
	RTL

L290F03	PLA
	PLP
	RTL

L290F06	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290F30
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCS	L290F03
	PEA	$0043
	PEA	$007F
	PEA	^L2A00DC
	PEA	L2A00DC
	_NoteOn
L290F30	PLP
	RTL

L290F32	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290F5C
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCS	L290F03
	PEA	$0032
	PEA	$007F
	PEA	^L2A00DC
	PEA	L2A00DC
	_NoteOn
L290F5C	PLP
	RTL

L290F5E	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290F88
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCS	L290F03
	PEA	$0032
	PEA	$007F
	PEA	^L2A0058
	PEA	L2A0058
	_NoteOn
L290F88	PLP
	RTL

L290F8A	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290FB7
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCC	L290FA4
	JMP	L290F03

L290FA4	PEA	$0028
	PEA	$007F
	PEA	^L2A0084
	PEA	L2A0084
	_NoteOn
L290FB7	PLP
	RTL

L290FB9	ENT
	PHP
	REP	#$20
	LDA	#L027A88
	STA	$6C
	LDA	#^L027A88
	STA	$6E
	LDA	#$0000
	STA	$70
	JSL	L29073E
	STZ	L0242E9
L290FD2	PLP
	RTL

L290FD4	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L290FD2
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCC	L290FEE
	JMP	L290F03

L290FEE	PEA	$001C
	PEA	$007F
	PEA	^L2A00B0
	PEA	L2A00B0
	_NoteOn
	PLP
	RTL

L291003	ENT
	PHP
	REP	#$20
	LDA	#L027A96
	STA	$6C
	LDA	#^L027A96
	STA	$6E
	LDA	#$0000
	STA	$70
	JSL	L29073E
	STZ	L0242E9
	PLP
	RTL

L29101E	ENT
	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L29104B
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCC	L291038
	JMP	L290F03

L291038	PEA	$002C
	PEA	$007F
	PEA	^L2A0108
	PEA	L2A0108
	_NoteOn
L29104B	PLP
	RTL

	PHP
	REP	#$20
	LDA	#L027AA3
	STA	$6C
	LDA	#^L027AA3
	STA	$6E
	LDA	#$0000
	STA	$70
	JSL	L29073E
	STZ	L0242E9
	PLP
	RTL

	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L291095
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCC	L291082
	JMP	L290F03

L291082	PEA	$002C
	PEA	$007F
	PEA	^L2A0108
	PEA	L2A0108
	_NoteOn
L291095	PLP
	RTL

	PHP
	REP	#$20
	LDA	#L027AB1
	STA	$6C
	LDA	#^L027AB1
	STA	$6E
	LDA	#$0000
	STA	$70
	JSL	L29073E
	STZ	L0242E9
	PLP
	RTL

	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L2910DF
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCC	L2910CC
	JMP	L290F03

L2910CC	PEA	$001F
	PEA	$007F
	PEA	^L2A0134
	PEA	L2A0134
	_NoteOn
L2910DF	PLP
	RTL

	PHP
	REP	#$20
	LDA	#L027ABF
	STA	$6C
	LDA	#^L027ABF
	STA	$6E
	LDA	#$8000
	STA	$70
	JSL	L29073E
	STZ	L0242E9
	PLP
	RTL

	PHP
	REP	#$20
	LDA	L0242D7
	BNE	L291129
	PEA	$0000
	PEA	$001E
	_AllocGen
	BCC	L291116
	JMP	L290F03

L291116	PEA	$001F
	PEA	$007F
	PEA	^L2A0160
	PEA	L2A0160
	_NoteOn
L291129	PLP
	RTL

