*
* Mancala
* (c) California Dreams
* (k) Brutal Deluxe Software
*

* Segment 4, kind $0000

	mx	%00
	rel

IRQ_MOUSE	=	$E10034
	 
	use	MAIN1.X.S

	use	4/Ctl.Macs
	use	4/Desk.Macs
	use	4/Dialog.Macs
	use 	4/Event.Macs
	use	4/Int.Macs
	use	4/Line.Macs
	use	4/Locator.Macs
	use	4/Mem.Macs
	use	4/Menu.Macs
	use	4/Misc.Macs
	use	4/NoteSyn.Macs
	use	4/Qd.Macs
	use	4/SANE.Macs
	use	4/Scrap.Macs
	use	4/Sound.Macs
	use	4/Std.Macs
	use 	4/Text.Macs
	use	4/Util.Macs
	use	4/Window.Macs

*-----------------------

L040000     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            STZ   $F4
            BRA   L04004A
L04000F     LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L020286
            LDX   #^L020286
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            LDX   #$0000
            PHX
            PHA
            LDA   #L050000
            LDX   #^L050000
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            SEP   #$20
            STA   [$F6]
            REP   #$20
            INC   $F4
L04004A     LDA   $F4
            SEC
            SBC   #$000C
            BVS   L040055
            EOR   #$8000
L040055     BPL   L04000F
            LDA   L06002B
            CMP   #$0001
            BNE   L040066
            LDA   #$0000
            STA   $F4
            BRA   L04006B
L040066     LDA   #$0001
            STA   $F4
L04006B     LDA   $F4
            SEP   #$20
            STAL  L05000C
            REP   #$20
            LDAL  L0202A0
            SEP   #$20
            STAL  L05000D
            REP   #$20
            LDAL  L02029E
            SEP   #$20
            STAL  L05000E
            REP   #$20
            LDA   L060031
            SEC
            SBC   #$0001
            SEP   #$20
            STAL  L05000F
            REP   #$20
            LDA   L060035
            SEP   #$20
            STAL  L050010
            REP   #$20
            LDA   L06002D
            SEP   #$20
            STAL  L050011
            REP   #$20
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0400BA     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            PEA   $0100
            JSL   L04071C
            PLY
            SEC
            SBC   #$0001
            STA   $F4
            LDA   $F4
            SEP   #$20
            STAL  L050013
            REP   #$20
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0400E5     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            JSL   L040000
            JSL   L0500CA
            LDAL  L050012
            AND   #$00FF
            STA   $F4
            LDA   $F4
            TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L04010D     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00F0
            TCS
            LDA   $FD
            SEC
            SBC   #$0010
            BVS   L040123
            EOR   #$8000
L040123     BMI   L040128
            BRL   L04021E
L040128     LDA   $FF
            SEC
            SBC   #$0022
            BVS   L040133
            EOR   #$8000
L040133     BMI   L040138
            BRL   L04021E
L040138     LDA   $FD
            SEC
            SBC   #$012C
            BEQ   L04014A
            BVS   L040145
            EOR   #$8000
L040145     BPL   L04014A
            BRL   L04021E
L04014A     LDA   $FF
            SEC
            SBC   #$00B2
            BEQ   L04015C
            BVS   L040157
            EOR   #$8000
L040157     BPL   L04015C
            BRL   L04021E
L04015C     LDA   $FF
            SEC
            SBC   #$0052
            BVS   L040167
            EOR   #$8000
L040167     BMI   L040185
            LDA   #$0030
            PHA
            LDA   $FD
            SEC
            SBC   #$0010
            PHA
            JSL   L016EE6
            PLY
            SEC
            JSL   L017037
            PLY
            BRL   L040221
            BRL   L04021C
L040185     LDA   $FF
            SEC
            SBC   #$0085
            BVS   L040190
            EOR   #$8000
L040190     BPL   L040195
            BRL   L0401FA
L040195     LDA   $FD
            SEC
            SBC   #$0093
            BVS   L0401A0
            EOR   #$8000
L0401A0     BMI   L0401AA
            LDA   #$000C
            BRL   L040221
            BRA   L0401F8
L0401AA     LDA   $FD
            SEC
            SBC   #$00AA
            BVS   L0401B5
            EOR   #$8000
L0401B5     BMI   L0401F3
            LDA   L06002D
            BEQ   L0401EC
            LDA   $FF
            SEC
            SBC   #$0061
            BVS   L0401C7
            EOR   #$8000
L0401C7     BMI   L0401D1
            LDA   #$000F
            BRL   L040221
            BRA   L0401EA
L0401D1     LDA   $FF
            SEC
            SBC   #$0074
            BVS   L0401DC
            EOR   #$8000
L0401DC     BMI   L0401E5
            LDA   #$000E
            BRA   L040221
            BRA   L0401EA
L0401E5     LDA   #$0010
            BRA   L040221
L0401EA     BRA   L0401F1
L0401EC     LDA   #$000E
            BRA   L040221
L0401F1     BRA   L0401F8
L0401F3     LDA   #$000D
            BRA   L040221
L0401F8     BRA   L04021C
L0401FA     LDA   #$0030
            PHA
            LDA   $FD
            SEC
            SBC   #$0010
            PHA
            JSL   L016EE6
            PLY
            SEC
            JSL   L017037
            PLY
            PHA
            LDA   #$000B
            PLX
            STX   $F6
            SEC
            SBC   $F6
            BRA   L040221
L04021C     BRA   L040221
L04021E     LDA   #$0014
L040221     TAY
            TDC
            CLC
            ADC   #$00F7
            TCS
            TYA
            PLD
            RTL

L04022B     ENT
            PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00F2
            TCS
            LDA   $FF
            STA   L060087
            STZ   L060089
            TDC
            CLC
            ADC   #$00F9
            TCS
            PLD
            RTL

L040246     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            LDA   #$0063
            STA   L060087
            LDA   #$0001
            STA   L060089
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L040265     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00EC
            TCS
            JSL   L011843
            STA   $EE
            PEI   $FF
            PEI   $FD
            JSL   L04010D
            PLY
            PLY
            STA   $F0
            LDA   L060031
            CMP   #$0001
            BEQ   L04028D
            BRL   L040309
L04028D     LDA   $EE
            BNE   L04029D
            LDA   L060089
            BNE   L0402D8
            LDA   $F0
            CMP   L060087
            BNE   L0402D8
L04029D     LDA   $F0
            SEC
            SBC   #$0005
            BEQ   L0402AC
            BVS   L0402AA
            EOR   #$8000
L0402AA     BMI   L0402D8
L0402AC     LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L020286
            LDX   #^L020286
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            CMP   #$0000
            BEQ   L0402D8
            PEI   $F0
            JSL   L012AE3
            PLY
            JSL   L040246
            BRA   L040306
L0402D8     LDA   $EE
            BNE   L0402FE
            LDA   $F0
            SEC
            SBC   #$000B
            BEQ   L0402EB
            BVS   L0402E9
            EOR   #$8000
L0402E9     BMI   L0402FE
L0402EB     PEI   $F0
            JSL   L012BC6
            PLY
            LDA   $F0
            STA   L060087
            LDA   $EE
            STA   L060089
            BRA   L040306
L0402FE     JSL   L040246
            JSL   L043938
L040306     BRL   L04038F
L040309     LDA   $EE
            BNE   L040319
            LDA   L060089
            BNE   L040361
            LDA   $F0
            CMP   L060087
            BNE   L040361
L040319     LDA   $F0
            SEC
            SBC   #$0006
            BVS   L040324
            EOR   #$8000
L040324     BPL   L040361
            LDA   $F0
            SEC
            SBC   #$000B
            BEQ   L040335
            BVS   L040333
            EOR   #$8000
L040333     BMI   L040361
L040335     LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L020286
            LDX   #^L020286
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            CMP   #$0000
            BEQ   L040361
            PEI   $F0
            JSL   L012AE3
            PLY
            JSL   L040246
            BRA   L04038F
L040361     LDA   $EE
            BNE   L040387
            LDA   $F0
            SEC
            SBC   #$000B
            BEQ   L040374
            BVS   L040372
            EOR   #$8000
L040372     BMI   L040387
L040374     PEI   $F0
            JSL   L012BC6
            PLY
            LDA   $F0
            STA   L060087
            LDA   $EE
            STA   L060089
            BRA   L04038F
L040387     JSL   L040246
            JSL   L043938
L04038F     TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L040397     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00EE
            TCS
            LDA   #$0063
            STA   L060087
            LDA   #$0001
            STA   L060089
            PEI   $FF
            PEI   $FD
            JSL   L04010D
            PLY
            PLY
            STA   $F0
            LDA   $F0
            CMP   #$0014
            BNE   L0403C4
            BRL   L04045E
L0403C4     LDA   $F0
            CMP   #$000E
            BNE   L0403D6
            JSL   L012DCE
            JSL   doSHOWCURSOR
            BRL   L04045C
L0403D6     LDA   $F0
            CMP   #$000F
            BEQ   L0403E4
            LDA   $F0
            CMP   #$0010
            BNE   L0403EB
L0403E4     JSL   L012E2D
            BRL   L04045C
L0403EB     LDA   L060037
            CMP   #$0000
            BNE   L04042E
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L020286
            LDX   #^L020286
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            CMP   #$0000
            BEQ   L04042E
            LDA   $F0
            STA   L06008B
            LDA   #$0001
            STA   L060037
            JSL   doHIDECURSOR
            PEI   $F0
            JSL   L01606B
            PLY
            JSL   doSHOWCURSOR
            BRA   L04045C
L04042E     LDA   L060037
            CMP   #$0001
            BNE   L040458
            JSL   doHIDECURSOR
            PEI   $F0
            LDA   L06008B
            PHA
            JSL   L012CB0
            PLY
            PLY
            LDA   L06008B
            PHA
            JSL   L0160BF
            PLY
            JSL   doSHOWCURSOR
            STZ   L060037
            BRA   L04045C
L040458     JSL   L043938
L04045C     BRA   L040462
L04045E     JSL   L043938
L040462     JSL   L0405CF
            TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L040481     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
L04048C     JSL   L0405FA
            TAY
            BNE   L04049E
            LDAL  L029616
            CMP   #$0000
            BEQ   L04049E
            BRA   L04048C
L04049E     TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0404A6     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            JSL   L011C13
            JSL   doSHOWCURSOR
            PHA
            PEA   $FFFF
            PEA   $0000
            _FlushEvents
            PLA
L0404D1     LDA   #$0001
            BNE   L0404D9
            BRL   L0405C7
L0404D9     LDA   L060039
            BNE   L0404E4
            JSL   L01245D
            BRA   L0404E8
L0404E4     JSL   L016368
L0404E8     LDA   L06002F
            CMP   #$0002
            BEQ   L04050B
            LDA   L06002F
            CMP   #$0001
            BNE   L040500
            LDA   L060031
            CMP   #$0002
            BEQ   L04050B
L040500     LDA   L060039
            CMP   #$0001
            BEQ   L04050B
            BRL   L04058C
L04050B     PEA   $0000
            TDC
            CLC
            ADC   #$00F0
            PHA
            PEA   $0000
            TDC
            CLC
            ADC   #$00F2
            PHA
            JSL   L011979
            PLY
            PLY
            PLY
            PLY
            BRL   L04057C
L040528     LDA   L060053
            BEQ   L040531
            JSL   L012C0E
L040531     LDA   L060039
            CMP   #$0000
            BNE   L040545
            PEI   $F0
            PEI   $F2
            JSL   L040265
            PLY
            PLY
            BRA   L04054F
L040545     PEI   $F0
            PEI   $F2
            JSL   L040397
            PLY
            PLY
L04054F     BRL   L040589
L040552     LDA   L060053
            BEQ   L04055B
            JSL   L012C0E
L04055B     PEI   $F2
            JSL   L011D94
            PLY
            JSL   L011BE5
            BRL   L040589
L040569     BRL   L040589
L04056C     BRL   L040589
L04056F     BRL   L040589
L040572     DA    L04056C
            DA    L040552
            DA    L040569
            DA    L040528
            DA    L04056F
L04057C     CMP   #$0004
            BCC   L040584
            LDA   #$0004
L040584     ASL
            TAX
            JMP   (L040572,X)

L040589     BRL   L0405C4
L04058C     JSL   L012961
            LDA   L06002F
            CMP   #$0000
            BEQ   L04059B
            BRL   L0405C4
L04059B     JSL   L011B46
            BRL   L0405B5
L0405A2     JSL   L012C46
            BRL   L0405C4
L0405A9     BRL   L0405C4
            BRL   L0405C4
L0405AF     DA    L0405A2
            DA    L0405A2
            DA    L0405A9
L0405B5     DEC
            DEC
            CMP   #$0002
            BCC   L0405BF
            LDA   #$0002
L0405BF     ASL
            TAX
            JMP   (L0405AF,X)

L0405C4     BRL   L0404D1
L0405C7     TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0405CF     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            PHA
            PEA   $FFFF
            PEA   $0000
            _FlushEvents
            PLA
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0405FA     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00E2
            TCS
            PHA
            PEA   $000A
            PEA   $0000
            TDC
            CLC
            ADC   #$00E6
            PHA
            _GetNextEvent
            PLA
            LDA   $E6
            BRL   L040676
L040628     LDA   #$0000
            STAL  L029616
            LDA   #$0001
            BRL   L040687
            BRL   L040684
L040638     PEI   $EA
            PEI   $E8
            JSL   L0443D7
            PLY
            PLY
            STA   $E4
            LDA   $E4
            CMP   #$004F
            BEQ   L040652
            LDA   $E4
            CMP   #$004D
            BNE   L040658
L040652     JSL   L0406E4
            BRA   L040665
L040658     LDA   #$0000
            STAL  L029616
            LDA   #$0001
            BRL   L040687
L040665     BRL   L040684
L040668     BRL   L040684
            BRL   L040684
L04066E     DA    L040628
            DA    L040668
            DA    L040638
            DA    L040668
L040676     DEC
            CMP   #$0003
            BCC   L04067F
            LDA   #$0003
L04067F     ASL
            TAX
            JMP   (L04066E,X)

L040684     LDA   #$0000
L040687     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L040691     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            PHA
            PEA   $000F
            _GetSoundVolume
            PLA
            STA   L06008D
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0406BC     ENT
            PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00F2
            TCS
            PEI   $FF
            PEA   $000F
            _SetSoundVolume
            TDC
            CLC
            ADC   #$00F9
            TCS
            PLD
            RTL

L0406E4     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            LDA   L0600A7
            BEQ   L040705
            JSL   L040691
            PEA   $0000
            JSL   L0406BC
            PLY
            STZ   L0600A7
            BRA   L040714
L040705     LDA   L06008D
            PHA
            JSL   L0406BC
            PLY
            LDA   #$0001
            STA   L0600A7
L040714     TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04071C     ENT
            PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00F2
            TCS
            LDA   $FF
            PHA
            JSL   L044535
            SEC
            JSL   L017037
            PLA
            CLC
            ADC   #$0001
            TAY
            TDC
            CLC
            ADC   #$00F9
            TCS
            TYA
            PLD
            RTL

L040742     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            PHX
            PHA
            _GetTick
            PLA
            PLX
            PHA
            JSL   L044435
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04076F     ENT
            PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00E8
            TCS
            LDA   L06008F
            BEQ   L040782
            BRL   L0407EA
L040782     JSL   L040742
            LDA   #$0001
            STA   L06008F
            LDA   #$0009
            STA   $EA
            STZ   $F0
            BRA   L0407DD
L040795     PEA   $0005
            JSL   L04071C
            PLY
            PHA
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L028CC6
            LDX   #^L028CC6
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            PLA
            STA   [$F2]
            CMP   $EA
            BNE   L0407BF
            BRA   L040795
L0407BF     LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L028CC6
            LDX   #^L028CC6
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            STA   $EA
            INC   $F0
L0407DD     LDA   $F0
            SEC
            SBC   #$000C
            BVS   L0407E8
            EOR   #$8000
L0407E8     BPL   L040795
L0407EA     LDA   $FD
            CMP   #$0000
            BNE   L0407F9
            LDA   #$0001
            STA   $EE
            BRL   L040863
L0407F9     LDA   $FD
            SEC
            SBC   #$0010
            BVS   L040804
            EOR   #$8000
L040804     BMI   L040824
            LDA   $FF
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L028CC6
            LDX   #^L028CC6
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            STA   $EE
            BRA   L040863
L040824     LDA   #$0005
            PHA
            LDA   $FD
            SEC
            SBC   #$000F
            PHA
            LDA   $FF
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L028CC6
            LDX   #^L028CC6
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            PLX
            STX   $F6
            CLC
            ADC   $F6
            SEC
            JSL   L017037
            PLA
            STA   $EE
            LDA   $EE
            CMP   #$0000
            BNE   L040863
            LDA   #$0005
            STA   $EE
L040863     LDA   $EE
            TAY
            TDC
            CLC
            ADC   #$00F7
            TCS
            TYA
            PLD
            RTL

L04086F     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00C8
            TCS
            PEI   $FF
            PEI   $FD
            PEA   $0000
            TDC
            CLC
            ADC   #$00CA
            PHA
            JSL   L013A8B
            PLY
            PLY
            PLY
            PLY
            _GrafOff
            PHA
            PEA   $0000
            TDC
            CLC
            ADC   #$00CA
            PHA
            PEA   ^L028B6F
            PEA   L028B6F
            PEA   ^L028B62
            PEA   L028B62
            PEA   ^L028B6F
            PEA   L028B6F
            _TLTextMountVolume
            PLA
            _GrafOn
            PEA   $000B
            JSL   L010EE1
            PLY
            JSL   L0174C7
            TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L0408F0     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            PEA   ^L028B71
            PEA   L028B71
            JSL   L04086F
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04090F     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            PEA   ^L028B89
            PEA   L028B89
            JSL   L04086F
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04092E     ENT
            PHD
            TSC
            SEC
            SBC   #$00F1
            TCD
            ADC   #$0096
            TCS
L040939     PEA   $0020
            PEI   $F9
            PEI   $F7
            JSL   L01A4E0
            PLY
            PLY
            PLY
            STA   $EA
            CMP   #$FFFF
            BEQ   L040951
            BRL   L0409E9
L040951     LDA   L0600AD
            CMP   #$0006
            BNE   L040975
            JSL   L010CC7
            CMP   #$0001
            BNE   L040966
            BRA   L040939
            BRA   L040972
L040966     PEA   $000B
            JSL   L010EE1
            PLY
            JSL   L0174C7
L040972     BRL   L0409E9
L040975     LDA   L06001C
            BEQ   L040981
            JSL   L04090F
            BRL   L0409E9
L040981     JSL   L011C4F
            PEA   $0000
            LDA   L020266
            PHA
            _SetColorTable
            LDA   L0600AD
            PHA
            PEA   ^L028B98
            PEA   L028B98
            PEA   $0000
            TDC
            CLC
            ADC   #$0098
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$0098
            PHA
            PEI   $F9
            PEI   $F7
            PEA   ^L028BAA
            PEA   L028BAA
            PEA   ^L028BA9
            PEA   L028BA9
            JSL   L014885
            TAY
            TSC
            CLC
            ADC   #$0010
            TCS
            TYA
            PEA   $000B
            JSL   L010EE1
            PLY
            JSL   L0174C7
L0409E9     PEI   $FF
            PEI   $FD
            PEI   $FB
            PEI   $EA
            JSL   L044453
            PLY
            PLY
            PLY
            PLY
            CMP   $FF
            BNE   L040A00
            BRL   L040A5C
L040A00     LDA   L06001C
            BEQ   L040A0C
            JSL   L0408F0
            BRL   L040A5C
L040A0C     JSL   L011C4F
            PEA   $0000
            LDA   L020266
            PHA
            _SetColorTable
            PEA   ^L028BCA
            PEA   L028BCA
            PEI   $F9
            PEI   $F7
            PEA   ^L028BB6
            PEA   L028BB6
            PEA   ^L028BB5
            PEA   L028BB5
            JSL   L014885
            TAY
            TSC
            CLC
            ADC   #$0010
            TCS
            TYA
            PEI   $EA
            JSL   L01A0B6
            PLY
            PEA   $000B
            JSL   L010EE1
            PLY
            JSL   L0174C7
L040A5C     PEI   $EA
            JSL   L01A0B6
            PLY
            TDC
            CLC
            ADC   #$00F1
            TCS
            PLD
            RTL

L040A6B     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            PEA   $7D00
            PEA   ^L0303BC
            PEA   L0303BC
            PEA   ^L028BCB
            PEA   L028BCB
            JSL   L04092E
            PLY
            PLY
            PLY
            PLY
            PLY
            PEA   $7D00
            PEA   ^L0380BC
            PEA   L0380BC
            PEA   ^L028BCF
            PEA   L028BCF
            JSL   L04092E
            PLY
            PLY
            PLY
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L040AAE     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            LDA   #$0053
            STA   $F4
            BRA   L040AD7
L040AC0     PEI   $F4
            PEA   $0000
            _SetSCB
            INC   $F4
L040AD7     LDA   $F4
            SEC
            SBC   #$005E
            BVS   L040AE2
            EOR   #$8000
L040AE2     BPL   L040AC0
            LDA   #$0077
            STA   $F4
            BRA   L040B02
L040AEB     PEI   $F4
            PEA   $0000
            _SetSCB
            INC   $F4
L040B02     LDA   $F4
            SEC
            SBC   #$0082
            BVS   L040B0D
            EOR   #$8000
L040B0D     BPL   L040AEB
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L040B17     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            JSL   L016456
            JSL   L040AAE
            JSL   L0104AC
            JSL   L011411
            JSL   L0174C7
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L040B3E     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F0
            TCS
            LDX   #$00E0
            LDA   #$C034
            STX   $F4
            STA   $F2
            LDA   [$F2]
            AND   #$00FF
            AND   #$000F
            TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L040B65     ENT
            PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00ED
            TCS
            LDX   #$00E0
            LDA   #$C034
            STX   $F2
            STA   $F0
            LDA   [$F0]
            AND   #$00FF
            AND   #$00F0
            ORA   $FF
            SEP   #$20
            STA   $EF
            REP   #$20
            LDA   $EF
            SEP   #$20
            STA   [$F0]
            REP   #$20
            PEI   $FF
            PEA   $001C
            _WriteBParam
            TDC
            CLC
            ADC   #$00F9
            TCS
            PLD
            RTL

            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L040BC2     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            PEA   $0000
            LDA   L020266
            PHA
            _GetColorTable
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L040F1C     ENT
            PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00F0
            TCS
            SEI
            PEI   $FD
            PEI   $FF
            _PosMouse
            JSL   L0443CE
            CLI
            TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L040F49     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00EE
            TCS
            STZ   $F0
            BRA   L040F7C
L040F58     LDA   $F0
            LDX   #$0000
            TAY
            BPL   L040F61
            DEX
L040F61     PHX
            PHA
            LDX   $FF
            LDA   $FD
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   #$0000
            SEP   #$20
            STA   [$F2]
            REP   #$20
            INC   $F0
L040F7C     LDA   $F0
            SEC
            SBC   #$0050
            BVS   L040F87
            EOR   #$8000
L040F87     BPL   L040F58
            TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L040F91     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$FFEE
            TCS
            LDA   #$0001
            LDX   #$FFF0
            STA   $00,X
            LDX   #$0000
            TDC
            CLC
            ADC   #$0042
            STX   $EA
            STA   $E8
            LDA   #$0001
            STA   $E2
            BRA   L041027
L040FB7     PEA   $0000
            TDC
            CLC
            ADC   #$0042
            PHA
            JSL   L040F49
            PLY
            PLY
            PEI   $E2
            PEA   ^L028CDE
            PEA   L028CDE
            PEA   $0000
            TDC
            CLC
            ADC   #$0092
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$0092
            PHA
            PEA   $0000
            TDC
            CLC
            ADC   #$FFF2
            PHA
            JSL   L013A8B
            PLY
            PLY
            PLY
            PLY
            LDX   #$0000
            TDC
            CLC
            ADC   #$FFF2
            STX   $E6
            STA   $E4
            PEA   $0008
            PEA   $0000
            TDC
            CLC
            ADC   #$00E4
            PHA
            JSL   L017481
            LDA   $42
            AND   #$00FF
            CMP   #$0000
            BEQ   L041025
            LDX   #$FFF0
            STZ   $00,X
L041025     INC   $E2
L041027     LDA   $E2
            SEC
            SBC   #$000E
            BVS   L041032
            EOR   #$8000
L041032     BPL   L040FB7
            LDX   #$FFF0
            LDA   $00,X
            TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L041043     PHD
            TSC
            SEC
            SBC   #$00F5
            TCD
            ADC   #$0084
            TCS
            PEI   $FD
            PEI   $FB
            PEA   $0000
            TDC
            CLC
            ADC   #$00A0
            PHA
            JSL   L013A8B
            PLY
            PLY
            PLY
            PLY
            LDX   #$0000
            TDC
            CLC
            ADC   #$00A0
            STX   $88
            STA   $86
            PEA   $0006
            PEA   $0000
            TDC
            CLC
            ADC   #$0086
            PHA
            JSL   L017481
            LDA   $FF
            STA   $8C
            PEA   $0005
            PEA   $0000
            TDC
            CLC
            ADC   #$0086
            PHA
            JSL   L017481
            TDC
            CLC
            ADC   #$00F5
            TCS
            PLD
            RTL

L04109B     PHD
            TSC
            SEC
            SBC   #$00EF
            TCD
            ADC   #$FF82
            TCS
            SEC
            LDA   $F9
            SBC   #$0000
            BNE   L0410B5
            LDA   $FB
            SBC   #$0000
            BRA   L0410BC
L0410B5     LDA   $FB
            SBC   #$0000
            REP   #$02
L0410BC     BEQ   L0410D5
            PEI   $FB
            PEI   $F9
            PEA   $0000
            TDC
            CLC
            ADC   #$009A
            PHA
            JSL   L013A8B
            PLY
            PLY
            PLY
            PLY
            BRA   L0410EC
L0410D5     PEA   ^L028CE3
            PEA   L028CE3
            PEA   $0000
            TDC
            CLC
            ADC   #$009A
            PHA
            JSL   L013A8B
            PLY
            PLY
            PLY
            PLY
L0410EC     JSL   L040F91
            TAY
            BEQ   L041112
            JSL   L013B82
            PEA   ^L028CF2
            PEA   L028CF2
            PEA   $0002
            JSL   L01382D
            PLY
            PLY
            PLY
            TAY
            BNE   L041110
            LDA   #$0000
            BRL   L041179
L041110     BRA   L0410EC
L041112     JSL   L011C4F
            JSL   doSHOWCURSOR
            PEA   $001E
            PEA   $0032
            PEA   $0000
            TDC
            CLC
            ADC   #$009A
            PHA
            PEA   $0000
            PEA   $0000
            PEI   $FF
            PEI   $FD
            PEA   $0000
            TDC
            CLC
            ADC   #$FF84
            PHA
            _SFGetFile
            LDX   #$FF84
            LDA   $00,X
            BEQ   L041168
            PEA   $0000
            TDC
            CLC
            ADC   #$FF8A
            PHA
            PEI   $F7
            PEI   $F5
            JSL   L013AF1
            PLY
            PLY
            PLY
            PLY
L041168     JSL   doHIDECURSOR
            JSL   L011C13
            JSL   L0165CA
            LDX   #$FF84
            LDA   $00,X
L041179     TAY
            TDC
            CLC
            ADC   #$00EF
            TCS
            TYA
            PLD
            RTL

L041183     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$FF44
            TCS
            PEI   $FF
            PEI   $FD
            PEA   $0000
            TDC
            CLC
            ADC   #$005C
            PHA
            JSL   L013A8B
            PLY
            PLY
            PLY
            PLY
L0411A3     JSL   L040F91
            TAY
            BEQ   L0411C9
            JSL   L013B82
            PEA   ^L028CF3
            PEA   L028CF3
            PEA   $0002
            JSL   L01382D
            PLY
            PLY
            PLY
            TAY
            BNE   L0411C7
            LDA   #$0000
            BRL   L04122F
L0411C7     BRA   L0411A3
L0411C9     JSL   L011C4F
            JSL   doSHOWCURSOR
            PEA   $0019
            PEA   $002B
            PEA   ^L028CF4
            PEA   L028CF4
            PEA   $0000
            TDC
            CLC
            ADC   #$005C
            PHA
            PEA   $000F
            PEA   $0000
            TDC
            CLC
            ADC   #$FF46
            PHA
            _SFPutFile
            LDX   #$FF46
            LDA   $00,X
            BEQ   L04121E
            PEA   $0000
            TDC
            CLC
            ADC   #$FF4C
            PHA
            PEI   $FF
            PEI   $FD
            JSL   L013AF1
            PLY
            PLY
            PLY
            PLY
L04121E     JSL   doHIDECURSOR
            JSL   L011C13
            JSL   L0165CA
            LDX   #$FF46
            LDA   $00,X
L04122F     TAY
            TDC
            CLC
            ADC   #$00F7
            TCS
            TYA
            PLD
            RTL

L041239     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            LDA   L0600AD
            CMP   #$001E
            BEQ   L04125F
            LDA   L0600AD
            CMP   #$001C
            BEQ   L04125F
            LDA   L0600AD
            CMP   #$0009
            BEQ   L04125F
            BRL   L04129C
L04125F     LDA   L0600AD
            CMP   #$001C
            BNE   L041279
            PEA   ^L028D02
            PEA   L028D02
            PEA   $0014
            JSL   L01382D
            PLY
            PLY
            PLY
            BRA   L041289
L041279     PEA   ^L028D03
            PEA   L028D03
            PEA   $0013
            JSL   L01382D
            PLY
            PLY
            PLY
L041289     JSL   L011C13
            JSL   L011D20
            JSL   doSHOWCURSOR
            LDA   #$0001
            BRA   L04129F
            BRA   L04129F
L04129C     LDA   #$0000
L04129F     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L0412A9     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A2
            TCS
            JSL   L01658D
            LDA   L060091
            CMP   #$0000
            BNE   L0412D4
            PEA   ^L028D04
            PEA   L028D04
            PEA   ^L028D53
            PEA   L028D53
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
L0412D4     LDA   #$0001
            STA   L060091
            PEA   ^L028D53
            PEA   L028D53
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041183
            PLY
            PLY
            TAY
            BNE   L04130D
            JSL   doSHOWCURSOR
            LDA   #$0000
            BRL   L0413B4
L04130D     JSL   L011C88
            JSL   doSHOWCURSOR
            PEA   $0321
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L01A4E0
            PLY
            PLY
            PLY
            STA   $A4
            SEC
            SBC   #$0000
            BVS   L041333
            EOR   #$8000
L041333     BMI   L041361
            JSL   L041239
            TAY
            BNE   L04135B
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            PEA   $0004
            JSL   L01382D
            PLY
            PLY
            PLY
            JSL   L011C13
            JSL   L011D20
            JSL   doSHOWCURSOR
L04135B     LDA   #$0000
            BRL   L0413B4
L041361     PEI   $A4
            JSL   L0413BE
            PLY
            TAY
            BNE   L04139E
            PEI   $A4
            JSL   L01A0B6
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            PEA   ^L028D53
            PEA   L028D53
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
            PEA   $0064
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041043
            PLY
            PLY
            PLY
            BRA   L0413A5
L04139E     PEI   $A4
            JSL   L01A0B6
            PLY
L0413A5     JSL   L011C13
            JSL   L011D20
            JSL   doSHOWCURSOR
            LDA   #$0001
L0413B4     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L0413BE     PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00D0
            TCS
            PEA   $000A
            PEA   ^L028D10
            PEA   L028D10
            PEI   $FF
            JSL   L0193A0
            PLY
            PLY
            PLY
            PLY
            CMP   #$000A
            BEQ   L0413FE
            JSL   L041239
            TAY
            BNE   L0413F8
            PEA   ^L028D1A
            PEA   L028D1A
            PEA   $0001
            JSL   L01382D
            PLY
            PLY
            PLY
L0413F8     LDA   #$FFFF
            BRL   L04151E
L0413FE     LDA   L060029
            STA   $D2
            LDA   L06002B
            STA   $D4
            LDA   L06002D
            STA   $D6
            LDA   L06002F
            STA   $D8
            LDA   L060031
            STA   $DA
            LDA   L060033
            STA   $DC
            LDA   L060035
            STA   $DE
            LDA   L060039
            STA   $E0
            LDA   L060037
            STA   $E2
            LDA   L06008B
            STA   $E4
            LDA   L06003B
            STA   $E6
            LDA   L06003D
            STA   $E8
            LDA   L060097
            STA   $EA
            LDA   L060099
            STA   $EC
            PEA   $001C
            PEA   $0000
            TDC
            CLC
            ADC   #$00D2
            PHA
            PEI   $FF
            JSL   L0193A0
            PLY
            PLY
            PLY
            PLY
            CMP   #$001C
            BEQ   L04147C
            JSL   L041239
            TAY
            BNE   L041476
            PEA   ^L028D1B
            PEA   L028D1B
            PEA   $0001
            JSL   L01382D
            PLY
            PLY
            PLY
L041476     LDA   #$FFFF
            BRL   L04151E
L04147C     PEA   $001C
            PEA   ^L020286
            PEA   L020286
            PEI   $FF
            JSL   L0193A0
            PLY
            PLY
            PLY
            PLY
            CMP   #$001C
            BEQ   L0414B1
            JSL   L041239
            TAY
            BNE   L0414AB
            PEA   ^L028D1C
            PEA   L028D1C
            PEA   $0001
            JSL   L01382D
            PLY
            PLY
            PLY
L0414AB     LDA   #$FFFF
            BRL   L04151E
L0414B1     PEA   $0022
            PEA   ^L0284AE
            PEA   L0284AE
            PEI   $FF
            JSL   L0193A0
            PLY
            PLY
            PLY
            PLY
            CMP   #$0022
            BEQ   L0414E6
            JSL   L041239
            TAY
            BNE   L0414E0
            PEA   ^L028D1D
            PEA   L028D1D
            PEA   $0001
            JSL   L01382D
            PLY
            PLY
            PLY
L0414E0     LDA   #$FFFF
            BRL   L04151E
L0414E6     LDA   L060097
            PHA
            PEA   ^L029134
            PEA   L029134
            PEI   $FF
            JSL   L0193A0
            PLY
            PLY
            PLY
            PLY
            CMP   L060097
            BEQ   L04151B
            JSL   L041239
            TAY
            BNE   L041516
            PEA   ^L028D1E
            PEA   L028D1E
            PEA   $0001
            JSL   L01382D
            PLY
            PLY
            PLY
L041516     LDA   #$FFFF
            BRA   L04151E
L04151B     LDA   #$0000
L04151E     TAY
            TDC
            CLC
            ADC   #$00F9
            TCS
            TYA
            PLD
            RTL

L041528     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A0
            TCS
            JSL   L01658D
            LDA   L060091
            CMP   #$0000
            BNE   L041553
            PEA   ^L028D21
            PEA   L028D21
            PEA   ^L028D53
            PEA   L028D53
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
L041553     LDA   #$0001
            STA   L060091
            PEA   ^L028D53
            PEA   L028D53
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
            PEA   ^L028D1F
            PEA   L028D1F
            PEA   ^L028D2D
            PEA   L028D2D
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L04109B
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
            TAY
            BNE   L04159F
            JSL   L0165CA
            JSL   doSHOWCURSOR
            BRL   L04162F
L04159F     PEA   $0020
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L01A4E0
            PLY
            PLY
            PLY
            STA   $A4
            SEC
            SBC   #$0000
            BVS   L0415BD
            EOR   #$8000
L0415BD     BMI   L0415DD
            JSL   L0165CA
            JSL   doSHOWCURSOR
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            PEA   $0003
            JSL   L01382D
            PLY
            PLY
            PLY
            BRL   L04162F
L0415DD     JSL   L011C88
            JSL   doSHOWCURSOR
            PEI   $A4
            JSL   L041722
            PLY
            TAY
            BNE   L041618
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            PEA   ^L028D53
            PEA   L028D53
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
            JSL   doHIDECURSOR
            PEA   $0001
            JSL   L015162
            PLY
            JSL   doSHOWCURSOR
            BRA   L04161C
L041618     JSL   L0165CA
L04161C     PEI   $A4
            JSL   L01A0B6
            PLY
            JSL   L011C13
            JSL   L011D20
            JSL   doSHOWCURSOR
L04162F     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L041639     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00F0
            TCS
            PEA   $0001
            LDA   [$FD]
            PHA
            LDA   L060029
            PHA
            JSL   L012236
            PLY
            PLY
            PLY
            LDY   #$0002
            LDA   [$FD],Y
            STA   L06002B
            LDY   #$0004
            LDA   [$FD],Y
            CMP   L06002D
            BEQ   L041677
            PEA   $013A
            JSL   L0117FE
            PLY
            LDY   #$0004
            LDA   [$FD],Y
            STA   L06002D
L041677     LDY   #$0006
            LDA   [$FD],Y
            PHA
            LDA   L06002F
            PHA
            JSL   L012386
            PLY
            PLY
            LDY   #$0008
            LDA   [$FD],Y
            STA   L060031
            LDY   #$000A
            LDA   [$FD],Y
            CMP   L060033
            BEQ   L04169D
            JSL   L01216E
L04169D     LDY   #$000C
            LDA   [$FD],Y
            PHA
            LDA   L060035
            PHA
            JSL   L0122F2
            PLY
            PLY
            LDA   L060039
            BEQ   L0416C3
            LDA   L060037
            CMP   #$0001
            BNE   L0416C3
            LDA   L06008B
            PHA
            JSL   L0160BF
            PLY
L0416C3     STZ   L060037
            STZ   L06008B
            LDY   #$000E
            LDA   [$FD],Y
            CMP   L060039
            BEQ   L0416FA
            PEA   $0132
            JSL   L0117FE
            PLY
            LDY   #$000E
            LDA   [$FD],Y
            STA   L060039
            LDA   L060039
            BEQ   L0416F2
            PEA   $0135
            JSL   L0117D9
            PLY
            BRA   L0416FA
L0416F2     PEA   $0135
            JSL   L0117B4
            PLY
L0416FA     LDY   #$0014
            LDA   [$FD],Y
            STA   L06003B
            LDY   #$0016
            LDA   [$FD],Y
            STA   L06003D
            LDY   #$0018
            LDA   [$FD],Y
            STA   L060097
            LDY   #$001A
            LDA   [$FD],Y
            STA   L060099
            TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L041722     PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00C4
            TCS
            PEA   $000A
            PEA   $0000
            TDC
            CLC
            ADC   #$00EA
            PHA
            PEI   $FF
            JSL   L044453
            PLY
            PLY
            PLY
            PLY
            CMP   #$000A
            BEQ   L041762
            JSL   L0165CA
            PEA   ^L028D41
            PEA   L028D41
            PEA   $0000
            JSL   L01382D
            PLY
            PLY
            PLY
            LDA   #$FFFF
            BRL   L04190F
L041762     PEA   $0000
            TDC
            CLC
            ADC   #$00EA
            PHA
            PEA   ^L028D10
            PEA   L028D10
            JSL   L0171A1
            PLY
            PLY
            PLY
            PLY
            TAY
            BEQ   L041796
            JSL   L0165CA
            PEA   ^L028D42
            PEA   L028D42
            PEA   $0009
            JSL   L01382D
            PLY
            PLY
            PLY
            LDA   #$FFFF
            BRL   L04190F
L041796     PEA   $001C
            PEA   $0000
            TDC
            CLC
            ADC   #$00C6
            PHA
            PEI   $FF
            JSL   L044453
            PLY
            PLY
            PLY
            PLY
            CMP   #$001C
            BEQ   L0417CB
            JSL   L0165CA
            PEA   ^L028D43
            PEA   L028D43
            PEA   $0000
            JSL   L01382D
            PLY
            PLY
            PLY
            LDA   #$FFFF
            BRL   L04190F
L0417CB     PEA   $0000
            TDC
            CLC
            ADC   #$00C6
            PHA
            JSL   L041639
            PLY
            PLY
            PEA   $001C
            PEA   $0000
            TDC
            CLC
            ADC   #$00C6
            PHA
            PEI   $FF
            JSL   L044453
            PLY
            PLY
            PLY
            PLY
            CMP   #$001C
            BEQ   L04180F
            JSL   L0165CA
            PEA   ^L028D44
            PEA   L028D44
            PEA   $0000
            JSL   L01382D
            PLY
            PLY
            PLY
            LDA   #$FFFF
            BRL   L04190F
L04180F     STZ   $E8
            BRA   L04184D
L041813     LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00C6
            JSL   L016FC0
            PLA
            PLX
            STA   $F4
            STX   $F6
            LDA   [$F4]
            PHA
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L020286
            LDX   #^L020286
            JSL   L016FC0
            PLA
            PLX
            STA   $F4
            STX   $F6
            PLA
            STA   [$F4]
            INC   $E8
L04184D     LDA   $E8
            SEC
            SBC   #$000E
            BVS   L041858
            EOR   #$8000
L041858     BPL   L041813
            PEA   $0022
            PEA   $0000
            TDC
            CLC
            ADC   #$00C6
            PHA
            PEI   $FF
            JSL   L044453
            PLY
            PLY
            PLY
            PLY
            CMP   #$0022
            BEQ   L04188F
            JSL   L0165CA
            PEA   ^L028D45
            PEA   L028D45
            PEA   $0000
            JSL   L01382D
            PLY
            PLY
            PLY
            LDA   #$FFFF
            BRL   L04190F
L04188F     STZ   $E8
            BRA   L0418CD
L041893     LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00C6
            JSL   L016FC0
            PLA
            PLX
            STA   $F4
            STX   $F6
            LDA   [$F4]
            PHA
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0284AE
            LDX   #^L0284AE
            JSL   L016FC0
            PLA
            PLX
            STA   $F4
            STX   $F6
            PLA
            STA   [$F4]
            INC   $E8
L0418CD     LDA   $E8
            SEC
            SBC   #$0011
            BVS   L0418D8
            EOR   #$8000
L0418D8     BPL   L041893
            LDA   L060097
            PHA
            PEA   ^L029134
            PEA   L029134
            PEI   $FF
            JSL   L044453
            PLY
            PLY
            PLY
            PLY
            CMP   L060097
            BEQ   L04190C
            JSL   L0165CA
            PEA   ^L028D46
            PEA   L028D46
            PEA   $0000
            JSL   L01382D
            PLY
            PLY
            PLY
            LDA   #$FFFF
            BRA   L04190F
L04190C     LDA   #$0000
L04190F     TAY
            TDC
            CLC
            ADC   #$00F9
            TCS
            TYA
            PLD
            RTL

L041919     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A2
            TCS
            LDA   L060051
            BNE   L04192D
            JSL   L01658D
L04192D     LDA   L060093
            CMP   #$0000
            BNE   L041949
            PEA   ^L028D47
            PEA   L028D47
            PEA   ^L028DA3
            PEA   L028DA3
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
L041949     LDA   #$0001
            STA   L060093
            PEA   ^L028DA3
            PEA   L028DA3
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041183
            PLY
            PLY
            TAY
            BNE   L041981
            STZ   L060051
            LDA   #$0000
            BRL   L041A07
L041981     PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L044412
            PLY
            PLY
            STA   L060095
            SEC
            SBC   #$0000
            BVS   L04199C
            EOR   #$8000
L04199C     BMI   L0419C1
            JSL   L041239
            TAY
            BNE   L0419B8
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            PEA   $0004
            JSL   L01382D
            PLY
            PLY
            PLY
L0419B8     STZ   L060051
            LDA   #$0001
            BRL   L041A07
L0419C1     JSL   L011C88
            JSL   doSHOWCURSOR
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0428F8
            PLY
            PLY
            STA   $A4
            LDA   L060095
            PHA
            JSL   L01A0B6
            PLY
            JSL   L011C13
            JSL   L011D20
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            PEA   ^L028DA3
            PEA   L028DA3
            JSL   L018FE4
            PLY
            PLY
            PLY
            PLY
            STZ   L060051
            LDA   $A4
L041A07     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L041A11     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00EC
            TCS
            PEI   $FF
            PEI   $FD
            PEA   ^L028DF3
            PEA   L028DF3
            LDX   L06009B+2
            LDA   L06009B
            PHX
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
            JSL   L041B89
            STA   $EE
            LDA   #L029329
            LDX   #^L029329
            STX   L06009B+2
            STA   L06009B
            STZ   $F0
            BRA   L041A72
L041A50     LDA   $F0
            LDX   #$0000
            PHX
            PHA
            LDA   #L029329
            LDX   #^L029329
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   #$0000
            SEP   #$20
            STA   [$F2]
            REP   #$20
            INC   $F0
L041A72     LDA   $F0
            SEC
            SBC   #$0050
            BVS   L041A7D
            EOR   #$8000
L041A7D     BPL   L041A50
            LDA   $EE
            TAY
            TDC
            CLC
            ADC   #$00F7
            TCS
            TYA
            PLD
            RTL

L041A8B     PHD
            TSC
            SEC
            SBC   #$00F5
            TCD
            ADC   #$00EE
            TCS
            PEI   $FD
            PEI   $FB
            PEA   ^L028DF6
            PEA   L028DF6
            LDX   L06009B+2
            LDA   L06009B
            PHX
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
            LDA   $FF
            LDX   #$0000
            TAY
            BPL   L041ABD
            DEX
L041ABD     PHX
            PHA
            LDX   L06009B+2
            LDA   L06009B
            JSL   L016FC0
            PLA
            PLX
            STX   L06009B+2
            STA   L06009B
            TDC
            CLC
            ADC   #$00F5
            TCS
            PLD
            RTL

L041AD9     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00F0
            TCS
            LDA   $FF
            CMP   #$0001
            BNE   L041B0E
            PEI   $FD
            PEA   ^L028DF9
            PEA   L028DF9
            LDX   L06009B+2
            LDA   L06009B
            PHX
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PLY
            INC   L06009B
            BNE   L041B0C
            INC   L06009B+2
L041B0C     BRA   L041B3E
L041B0E     PEI   $FD
            PEA   ^L028DFD
            PEA   L028DFD
            LDX   L06009B+2
            LDA   L06009B
            PHX
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PLY
            LDX   L06009B+2
            LDA   L06009B
            CLC
            ADC   #$0002
            PHA
            TXA
            ADC   #$0000
            TAX
            PLA
            STX   L06009B+2
            STA   L06009B
L041B3E     TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L041B46     PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00F2
            TCS
            PEI   $FF
            PEA   ^L028E01
            PEA   L028E01
            LDX   L06009B+2
            LDA   L06009B
            PHX
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PLY
            LDX   L06009B+2
            LDA   L06009B
            CLC
            ADC   #$0003
            PHA
            TXA
            ADC   #$0000
            TAX
            PLA
            STX   L06009B+2
            STA   L06009B
            TDC
            CLC
            ADC   #$00F9
            TCS
            PLD
            RTL

L041B89     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            LDA   #L029329
            LDX   #^L029329
            STX   L06009B+2
            STA   L06009B
            STZ   $F4
L041BA2     LDX   L06009B+2
            LDA   L06009B
            PHX
            PHA
            CLC
            ADC   #$0001
            STA   L06009B
            LDA   L06009B+2
            BCC   L041BB7
            INC
L041BB7     STA   L06009B+2
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            BEQ   L041BCB
            INC   $F4
            BRA   L041BA2
L041BCB     LDA   $F4
            INC   $F4
            LDX   #$0000
            PHX
            PHA
            LDA   #L029329
            LDX   #^L029329
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   #$000D
            SEP   #$20
            STA   [$F6]
            REP   #$20
            LDA   $F4
            INC   $F4
            LDX   #$0000
            PHX
            PHA
            LDA   #L029329
            LDX   #^L029329
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   #$0000
            SEP   #$20
            STA   [$F6]
            REP   #$20
            PEA   ^L029329
            PEA   L029329
            JSL   L018F92
            PLY
            PLY
            PHA
            PEA   ^L029329
            PEA   L029329
            LDA   L060095
            PHA
            JSL   L0193A0
            PLY
            PLY
            PLY
            PLY
            PHA
            PEA   ^L029329
            PEA   L029329
            JSL   L018F92
            PLY
            PLY
            PLX
            STX   $F6
            CMP   $F6
            BEQ   L041C5E
            JSL   L041239
            TAY
            BNE   L041C59
            PEA   ^L028E05
            PEA   L028E05
            PEA   $0001
            JSL   L01382D
            PLY
            PLY
            PLY
L041C59     LDA   #$FFFF
            BRA   L041C61
L041C5E     LDA   #$0000
L041C61     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L041C6B     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A0
            TCS
            LDA   L06009F
            BEQ   L041C7E
            BRL   L041CF4
L041C7E     LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            AND   #$000F
            SEC
            SBC   #$0006
            BVS   L041CA7
            EOR   #$8000
L041CA7     BMI   L041CC2
            PEA   ^L028E06
            PEA   L028E06
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            BRA   L041CD9
L041CC2     PEA   ^L028E35
            PEA   L028E35
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
L041CD9     PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L041A11
            PLY
            PLY
            LDA   #$0001
            STA   L06009F
            LDA   #$0001
            STA   L0600A5
L041CF4     LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            SEC
            SBC   #$0080
            BVS   L041D1A
            EOR   #$8000
L041D1A     BMI   L041D1F
            BRL   L041D79
L041D1F     LDA   L0600A3
            PHA
            INC
            STA   L0600A3
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            SEC
            SBC   #$0080
            PHA
            LDA   #$000C
            PLX
            STX   $FA
            SEC
            SBC   $FA
            STA   $F4
            LDA   L0600A3
            PHA
            INC
            STA   L0600A3
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            STA   $F2
            BRA   L041DAA
L041D79     LDA   L0600A3
            PHA
            INC
            STA   L0600A3
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   #$000C
            PLX
            STX   $FA
            SEC
            SBC   $FA
            STA   $F4
            STZ   $F2
L041DAA     LDA   L0600A5
            BEQ   L041DCC
            LDA   L0600A1
            PHA
            INC
            STA   L0600A1
            JSL   L041B46
            PLY
            PEA   $0005
            PEA   ^L028E64
            PEA   L028E64
            JSL   L041A8B
            PLY
            PLY
            PLY
L041DCC     PEA   $0002
            PEI   $F4
            JSL   L041AD9
            PLY
            PLY
            PEA   $0007
            PEA   ^L028E6A
            PEA   L028E6A
            JSL   L041A8B
            PLY
            PLY
            PLY
            LDA   $F2
            BEQ   L041E08
            PEA   $0002
            PEI   $F2
            JSL   L041AD9
            PLY
            PLY
            PEA   $000E
            PEA   ^L028E72
            PEA   L028E72
            JSL   L041A8B
            PLY
            PLY
            PLY
            BRA   L041E18
L041E08     PEA   $0010
            PEA   ^L028E81
            PEA   L028E81
            JSL   L041A8B
            PLY
            PLY
            PLY
L041E18     LDA   L0600A5
            BEQ   L041E22
            STZ   L0600A5
            BRA   L041E34
L041E22     PEA   ^L028E92
            PEA   L028E92
            JSL   L041A11
            PLY
            PLY
            LDA   #$0001
            STA   L0600A5
L041E34     TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L041E3C     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00D4
            TCS
            LDA   L0600A5
            BNE   L041E5E
            PEA   ^L028E93
            PEA   L028E93
            JSL   L041A11
            PLY
            PLY
            LDA   #$0001
            STA   L0600A5
L041E5E     LDA   L0600A3
            PHA
            INC
            STA   L0600A3
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            SEC
            SBC   #$0010
            STA   $F4
            PEA   ^L028E94
            PEA   L028E94
            JSL   L041A11
            PLY
            PLY
            LDA   $F4
            BEQ   L041EB0
            PEA   ^L028E95
            PEA   L028E95
            PEA   $0000
            TDC
            CLC
            ADC   #$00D6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            BRA   L041EC7
L041EB0     PEA   ^L028EA6
            PEA   L028EA6
            PEA   $0000
            TDC
            CLC
            ADC   #$00D6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
L041EC7     PEA   $0000
            TDC
            CLC
            ADC   #$00D6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028EB8
            PEA   L028EB8
            JSL   L041A11
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L041EEA     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A2
            TCS
            STZ   L06009F
            INC   L0600A3
            PEA   ^L028EB9
            PEA   L028EB9
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028EC6
            PEA   L028EC6
            JSL   L041A11
            PLY
            PLY
            LDA   #$000C
            STA   $A4
            BRA   L041F8A
L041F34     LDA   L0600A3
            PHA
            INC
            STA   L0600A3
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            PEI   $A4
            PEA   ^L028EC7
            PEA   L028EC7
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
            PEA   $0007
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A8B
            PLY
            PLY
            PLY
            DEC   $A4
L041F8A     LDA   $A4
            SEC
            SBC   #$0007
            BVS   L041F95
            EOR   #$8000
L041F95     BMI   L041F34
            PEA   ^L028ED1
            PEA   L028ED1
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028ED2
            PEA   L028ED2
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028ED3
            PEA   L028ED3
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028EE4
            PEA   L028EE4
            JSL   L041A11
            PLY
            PLY
            LDA   #$0001
            STA   $A4
            BRA   L04203F
L041FE8     LDA   L0600A3
            CLC
            ADC   #$0006
            SEC
            SBC   $A4
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            PEI   $A4
            PEA   ^L028EE5
            PEA   L028EE5
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
            PEA   $0007
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A8B
            PLY
            PLY
            PLY
            INC   $A4
L04203F     LDA   $A4
            SEC
            SBC   #$0006
            BEQ   L041FE8
            BVS   L04204C
            EOR   #$8000
L04204C     BPL   L041FE8
            LDA   L0600A3
            CLC
            ADC   #$0006
            STA   L0600A3
            PEA   ^L028EEF
            PEA   L028EEF
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028EF0
            PEA   L028EF0
            JSL   L041A11
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L042078     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A4
            TCS
            LDA   L0600A3
            CLC
            ADC   #$0001
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            PEA   ^L028EF1
            PEA   L028EF1
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            LDA   L0600A3
            CLC
            ADC   #$0002
            STA   L0600A3
            PEA   ^L028F15
            PEA   L028F15
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028F16
            PEA   L028F16
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028F4A
            PEA   L028F4A
            JSL   L041A11
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04213D     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A4
            TCS
            LDA   L0600A5
            BNE   L04215F
            PEA   ^L028F4B
            PEA   L028F4B
            JSL   L041A11
            PLY
            PLY
            LDA   #$0001
            STA   L0600A5
L04215F     PEA   ^L028F4C
            PEA   L028F4C
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028F4D
            PEA   L028F4D
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028F81
            PEA   L028F81
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028F82
            PEA   L028F82
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028FAA
            PEA   L028FAA
            JSL   L041A11
            PLY
            PLY
            JSL   L041EEA
            JSL   L042078
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0421DF     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A4
            TCS
            PEA   ^L028FAB
            PEA   L028FAB
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028FAC
            PEA   L028FAC
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028FD4
            PEA   L028FD4
            JSL   L041A11
            PLY
            PLY
            JSL   L041EEA
            LDA   L0600A3
            CLC
            ADC   #$0002
            STA   L0600A3
            PEA   ^L028FD5
            PEA   L028FD5
            JSL   L041A11
            PLY
            PLY
            PEA   ^L028FD6
            PEA   L028FD6
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L02900A
            PEA   L02900A
            JSL   L041A11
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04227C     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$009C
            TCS
            PEA   ^L02900B
            PEA   L02900B
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L041A11
            PLY
            PLY
            TAY
            BEQ   L0422B6
            LDA   #$FFFF
            BRL   L0423C6
L0422B6     PEA   ^L02903F
            PEA   L02903F
            JSL   L041A11
            PLY
            PLY
            PEA   ^L029040
            PEA   L029040
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L029061
            PEA   L029061
            JSL   L041A11
            PLY
            PLY
            PEA   ^L029062
            PEA   L029062
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L029096
            PEA   L029096
            JSL   L041A11
            PLY
            PLY
            PEI   $FF
            PEI   $FD
            JSL   L018F92
            PLY
            PLY
            STA   $9E
            STZ   $A0
            BRA   L04237D
L042336     LDA   $A0
            LDX   #$0000
            TAY
            BPL   L04233F
            DEX
L04233F     PHX
            PHA
            LDX   $FF
            LDA   $FD
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            AND   #$00FF
            PHA
            JSL   L0443D7
            PLY
            PHA
            LDA   $A0
            LDX   #$0000
            TAY
            BPL   L042364
            DEX
L042364     PHX
            PHA
            LDX   $FF
            LDA   $FD
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            PLA
            SEP   #$20
            STA   [$F2]
            REP   #$20
            INC   $A0
L04237D     LDA   $A0
            SEC
            SBC   $9E
            BVS   L042387
            EOR   #$8000
L042387     BPL   L042336
            PEI   $FF
            PEI   $FD
            PEA   ^L029097
            PEA   L029097
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
            PEA   $0000
            TDC
            CLC
            ADC   #$00A2
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L0290A1
            PEA   L0290A1
            JSL   L041A11
            PLY
            PLY
            LDA   #$0000
L0423C6     TAY
            TDC
            CLC
            ADC   #$00F7
            TCS
            TYA
            PLD
            RTL

L0423D0     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00A4
            TCS
            PEA   ^L0290A2
            PEA   L0290A2
            JSL   L041A11
            PLY
            PLY
            PEA   ^L0290A3
            PEA   L0290A3
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            PLY
            PLY
            PLY
            PLY
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            PEA   ^L0290D7
            PEA   L0290D7
            JSL   L041A11
            PLY
            PLY
            PEA   ^L0290D8
            PEA   L0290D8
            JSL   L041A11
            PLY
            PLY
            INC   L0600A3
            LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   L0600A3
            CLC
            ADC   #$0001
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PLX
            STX   $F6
            SEC
            SBC   $F6
            BVS   L042472
            EOR   #$8000
L042472     BPL   L042477
            BRL   L0424D2
L042477     LDA   L0600A3
            CLC
            ADC   #$0001
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            PEA   ^L0290D9
            PEA   L0290D9
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
L0424D2     LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   L0600A3
            CLC
            ADC   #$0001
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PLX
            STX   $F6
            SEC
            SBC   $F6
            BNE   L04251C
            BRL   L042581
L04251C     BVS   L042521
            EOR   #$8000
L042521     BMI   L042526
            BRL   L042581
L042526     LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   L0600A3
            CLC
            ADC   #$0001
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            PEA   ^L0290F5
            PEA   L0290F5
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
L042581     LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   L0600A3
            CLC
            ADC   #$0001
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PLX
            STX   $F6
            CMP   $F6
            BEQ   L0425CA
            BRL   L042625
L0425CA     LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   L0600A3
            CLC
            ADC   #$0001
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            PEA   ^L029114
            PEA   L029114
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L0169EA
            TAY
            TSC
            CLC
            ADC   #$000C
            TCS
            TYA
L042625     LDA   L0600A3
            CLC
            ADC   #$0002
            STA   L0600A3
            PEA   $0000
            TDC
            CLC
            ADC   #$00A6
            PHA
            JSL   L041A11
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L042646     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
L042651     LDA   #$0001
            BEQ   L042680
            JSL   L013001
            LDA   #$0001
            STA   L060063
            PEA   $0012
            JSL   L01382D
            PLY
            TAY
            BNE   L04267C
            LDA   #$0001
            STA   L060051
            JSL   L041919
            TAY
            BNE   L04267A
            BRA   L042680
L04267A     BRA   L04267E
L04267C     BRA   L042680
L04267E     BRA   L042651
L042680     JSL   L0429BA
            LDA   #$0001
            STA   L060099
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L042692     ENT
            PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00F0
            TCS
            LDA   L060097
            SEC
            SBC   #$01F2
            BVS   L0426A9
            EOR   #$8000
L0426A9     BPL   L0426AF
            JSL   L042646
L0426AF     LDA   $FF
            BNE   L0426B6
            BRL   L04270F
L0426B6     LDA   $FD
            ORA   #$0080
            STA   $FD
            LDA   $FD
            PHA
            LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            PLA
            SEP   #$20
            STA   [$F2]
            REP   #$20
            LDA   $FF
            PHA
            LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            PLA
            SEP   #$20
            STA   [$F2]
            REP   #$20
            BRA   L042737
L04270F     LDA   $FD
            PHA
            LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            PLA
            SEP   #$20
            STA   [$F2]
            REP   #$20
L042737     TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L04273F     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            LDA   L060097
            CMP   #$01F4
            BNE   L042756
            JSL   L042646
L042756     LDA   L06002D
            BEQ   L042787
            LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   #$0011
            SEP   #$20
            STA   [$F6]
            REP   #$20
            AND   #$00FF
            BRA   L0427B1
L042787     LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   #$0010
            SEP   #$20
            STA   [$F6]
            REP   #$20
            AND   #$00FF
L0427B1     TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0427B9     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            LDA   L060097
            SEC
            SBC   #$01E5
            BVS   L0427D0
            EOR   #$8000
L0427D0     BPL   L0427D6
            JSL   L042646
L0427D6     LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   #$0020
            SEP   #$20
            STA   [$F6]
            REP   #$20
            STZ   $F4
            BRA   L042843
L042801     LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L020286
            LDX   #^L020286
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            SEP   #$20
            STA   [$F6]
            REP   #$20
            INC   $F4
L042843     LDA   $F4
            SEC
            SBC   #$000E
            BVS   L04284E
            EOR   #$8000
L04284E     BPL   L042801
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L042858     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            LDA   L060097
            SEC
            SBC   #$01F1
            BVS   L04286F
            EOR   #$8000
L04286F     BPL   L042875
            JSL   L042646
L042875     LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   #$0040
            SEP   #$20
            STA   [$F6]
            REP   #$20
            LDAL  L0202A0
            PHA
            LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            SEP   #$20
            STA   [$F6]
            REP   #$20
            LDAL  L02029E
            PHA
            LDA   L060097
            PHA
            INC
            STA   L060097
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            SEP   #$20
            STA   [$F6]
            REP   #$20
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0428F8     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00EE
            TCS
            PEI   $FF
            PEI   $FD
            JSL   L04227C
            PLY
            PLY
            TAY
            BEQ   L042916
            LDA   #$0001
            BRL   L0429B0
L042916     STZ   L06009F
            STZ   L0600A3
            LDA   L060099
            BNE   L04292D
            LDA   #$0001
            STA   L0600A1
            JSL   L0421DF
            BRA   L042931
L04292D     JSL   L04213D
L042931     BRL   L042988
L042934     LDA   L0600A3
            LDX   #$0000
            PHX
            PHA
            LDA   #L029134
            LDX   #^L029134
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            AND   #$00FF
            BRL   L042971
L042954     JSL   L041E3C
            BRL   L042988
L04295B     JSL   L04213D
            BRL   L042988
L042962     JSL   L0423D0
            BRL   L042988
L042969     JSL   L041C6B
            BRA   L042988
            BRA   L042988
L042971     CMP   #$0010
            BEQ   L042954
            CMP   #$0011
            BEQ   L042954
            CMP   #$0020
            BEQ   L04295B
            CMP   #$0040
            BEQ   L042962
            JMP   L042969

L042988     LDA   L0600A3
            SEC
            SBC   L060097
            BVS   L042994
            EOR   #$8000
L042994     BPL   L042934
            LDA   L0600A5
            BNE   L0429AD
            PEA   ^L029133
            PEA   L029133
            JSL   L041A11
            PLY
            PLY
            LDA   #$0001
            STA   L0600A5
L0429AD     LDA   #$0000
L0429B0     TAY
            TDC
            CLC
            ADC   #$00F7
            TCS
            TYA
            PLD
            RTL

L0429BA     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            STZ   L060097
            JSL   L0427B9
            JSL   L04273F
            STZ   L060099
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0429DB     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00F0
            TCS
            PEA   $4200
            PEA   ^L0202A2
            PEA   L0202A2
            PEI   $FF
            PEI   $FD
            JSL   L04092E
            PLY
            PLY
            PLY
            PLY
            PLY
            SEI
            PEA   ^L0202A2
            PEA   L0202A2
            PEA   $0000
            PEA   $4200
            _WriteRamBlock
            CLI
            TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L042A22     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00E8
            TCS
            LDAL  L029616
            BNE   L042A36
            BRL   L042C85
L042A36     LDAL  L029614
            PHA
            LDAL  L029612
            SEC
            JSL   L017037
            PLA
            CMP   #$0000
            BEQ   L042A4D
            BRL   L042C79
L042A4D     STZ   $F4
            BRL   L042BA6
L042A52     LDAL  L029610
            LDX   #$0000
            PHX
            PHA
            LDA   $F4
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029626
            LDX   #^L029626
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            SEC
            SBC   #$0080
            BVS   L042ACA
            EOR   #$8000
L042ACA     BPL   L042ACF
            BRL   L042BA4
L042ACF     PHA
            PEA   $0000
            PEA   $0032
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029606
            LDX   #^L029606
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029606
            LDX   #^L029606
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02961A
            LDX   #^L02961A
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295FC
            LDX   #^L0295FC
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            ASL
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295E4
            LDX   #^L0295E4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDY   #$0002
            LDA   [$F6],Y
            TAX
            LDA   [$F6]
            PHX
            PHA
            _NoteOn
L042BA4     INC   $F4
L042BA6     LDA   $F4
            SEC
            SBC   #$0005
            BVS   L042BB1
            EOR   #$8000
L042BB1     BMI   L042BB6
            BRL   L042A52
L042BB6     STZ   $F4
            BRA   L042C2B
L042BBA     LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            SEC
            SBC   #$0080
            BVS   L042BDF
            EOR   #$8000
L042BDF     BMI   L042C29
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029606
            LDX   #^L029606
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
L042C29     INC   $F4
L042C2B     LDA   $F4
            SEC
            SBC   #$0005
            BVS   L042C36
            EOR   #$8000
L042C36     BPL   L042BBA
            LDAL  L029624
            PHA
            LDAL  L029610
            CLC
            ADC   #$0001
            SEC
            JSL   L017037
            PLA
            STAL  L029610
            LDAL  L029379
            CMP   #$0001
            BNE   L042C68
            LDAL  L029610
            CMP   #$0000
            BNE   L042C68
            LDA   #$0000
            STAL  L029616
L042C68     LDAL  L029610
            CMP   #$0000
            BNE   L042C79
            LDAL  L029618
            STAL  L029610
L042C79     LDAL  L029612
            CLC
            ADC   #$0001
            STAL  L029612
L042C85     TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L042C8D     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            STZ   $EE
            BRL   L042E42
L042C9D     STZ   $F0
            STZ   $F4
            BRL   L042DFB
L042CA4     LDA   $F4
            PHA
            LDA   #$0002
            SEC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   $EE
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L02ACB4
            LDX   #^L02ACB4
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            CMP   #$0080
            BNE   L042CE9
            BRL   L042DF9
L042CE9     LDA   $F4
            PHA
            LDA   #$0002
            SEC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   $EE
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L02ACB4
            LDX   #^L02ACB4
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F0
            LDX   #$0000
            PHX
            PHA
            LDA   $EE
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029626
            LDX   #^L029626
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            SEP   #$20
            STA   [$F6]
            REP   #$20
            LDA   $F0
            CLC
            ADC   #$0001
            STA   $F0
            LDA   #$0001
            STA   $F2
            BRA   L042DA9
L042D68     LDA   $F0
            LDX   #$0000
            PHX
            PHA
            LDA   $EE
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L029626
            LDX   #^L029626
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   #$0080
            SEP   #$20
            STA   [$F6]
            REP   #$20
            LDA   $F0
            CLC
            ADC   #$0001
            STA   $F0
            INC   $F2
L042DA9     LDA   $F4
            PHA
            LDA   #$0002
            SEC
            JSL   L01715C
            PLA
            CLC
            ADC   #$0001
            LDX   #$0000
            PHX
            PHA
            LDA   $EE
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L02ACB4
            LDX   #^L02ACB4
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            SEC
            SBC   $F2
            BEQ   L042DF9
            BVS   L042DF4
            EOR   #$8000
L042DF4     BPL   L042DF9
            BRL   L042D68
L042DF9     INC   $F4
L042DFB     LDA   $F4
            PHA
            LDA   #$0002
            SEC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   $EE
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L02ACB4
            LDX   #^L02ACB4
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            AND   #$00FF
            CMP   #$0081
            BEQ   L042E40
            BRL   L042CA4
L042E40     INC   $EE
L042E42     LDA   $EE
            SEC
            SBC   #$0005
            BVS   L042E4D
            EOR   #$8000
L042E4D     BMI   L042E52
            BRL   L042C9D
L042E52     LDA   $F0
            STAL  L029624
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L042E60     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00EA
            TCS
            PEA   $07E8
            PEA   ^L02A4CC
            PEA   L02A4CC
            PEI   $FF
            PEI   $FD
            JSL   L04092E
            PLY
            PLY
            PLY
            PLY
            PLY
            STZ   $EC
            STZ   $EE
            BRL   L042F63
L042E88     STZ   $F0
            BRA   L042EE0
L042E8C     LDA   $EC
            CLC
            ADC   $F0
            LDX   #$0000
            PHX
            PHA
            LDA   #L02A4CC
            LDX   #^L02A4CC
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            PHA
            LDA   $F0
            LDX   #$0000
            PHX
            PHA
            LDA   $EE
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L02ACB4
            LDX   #^L02ACB4
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            PLA
            SEP   #$20
            STA   [$F2]
            REP   #$20
            INC   $F0
L042EE0     LDA   $F0
            CLC
            ADC   $EC
            LDX   #$0000
            PHX
            PHA
            LDA   #L02A4CC
            LDX   #^L02A4CC
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            AND   #$00FF
            CMP   #$0081
            BNE   L042E8C
            LDA   $EC
            CLC
            ADC   $F0
            LDX   #$0000
            PHX
            PHA
            LDA   #L02A4CC
            LDX   #^L02A4CC
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            LDA   [$F2]
            PHA
            LDA   $F0
            LDX   #$0000
            PHX
            PHA
            LDA   $EE
            PHA
            LDA   #$02EE
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L02ACB4
            LDX   #^L02ACB4
            JSL   L016FC0
            PLA
            PLX
            JSL   L016FC0
            PLA
            PLX
            STA   $F2
            STX   $F4
            PLA
            SEP   #$20
            STA   [$F2]
            REP   #$20
            LDA   $EC
            CLC
            ADC   $F0
            CLC
            ADC   #$0001
            STA   $EC
            INC   $EE
L042F63     LDA   $EE
            SEC
            SBC   #$0005
            BVS   L042F6E
            EOR   #$8000
L042F6E     BMI   L042F73
            BRL   L042E88
L042F73     JSL   L042C8D
            TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L042F7F     PHD
            TSC
            SEC
            SBC   #$00F7
            TCD
            ADC   #$00F0
            TCS
            PEA   $0108
            LDAL  L0295E6
            TAX
            LDAL  L0295E4
            PHX
            PHA
            PEI   $FF
            PEI   $FD
            JSL   L04092E
            PLY
            PLY
            PLY
            PLY
            PLY
            TDC
            CLC
            ADC   #$00F7
            TCS
            PLD
            RTL

L042FAD     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            LDA   #$0004
            STAL  L029614
            LDA   #$0000
            STAL  L029610
            LDA   #$0000
            STAL  L029612
            LDA   #$02C0
            STAL  L029624
            LDA   #$0038
            STAL  L029618
            STZ   $F4
            BRL   L04304E
L042FE0     LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02937B
            LDX   #^L02937B
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02961A
            LDX   #^L02961A
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029385
            LDX   #^L029385
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295FC
            LDX   #^L0295FC
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            INC   $F4
L04304E     LDA   $F4
            SEC
            SBC   #$0005
            BVS   L043059
            EOR   #$8000
L043059     BPL   L042FE0
            LDA   #$0001
            STAL  L029616
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04306A     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            STZ   $F4
            BRA   L0430BB
L043079     LDA   $F4
            PHA
            LDA   #$002C
            CLC
            JSL   L01715C
            PLA
            LDX   #$0000
            PHX
            PHA
            LDA   #L0294DC
            LDX   #^L0294DC
            JSL   L016FC0
            LDA   $F4
            ASL
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295E4
            LDX   #^L0295E4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            PLX
            LDY   #$0002
            PHA
            TXA
            STA   [$F6],Y
            PLA
            STA   [$F6]
            INC   $F4
L0430BB     LDA   $F4
            SEC
            SBC   #$0006
            BVS   L0430C6
            EOR   #$8000
L0430C6     BPL   L043079
            LDA   #$0000
            STAL  L029616
            LDA   #$0000
            STAL  L029612
            LDA   #$0004
            STAL  L029614
            PEA   ^L02938F
            PEA   L02938F
            JSL   L0429DB
            PLY
            PLY
            PEA   ^L029393
            PEA   L029393
            JSL   L042F7F
            PLY
            PLY
            PEA   ^L029397
            PEA   L029397
            JSL   L042E60
            PLY
            PLY
            CLI
            PEA   $007D
            PEA   ^L042A22
            PEA   L042A22
            _NSStartUp
            PEA   ^L02939B
            PEA   L02939B
            JSL   L011045
            PLY
            PLY
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04312F     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00E6
            TCS
            LDA   L0600A7
            BNE   L043142
            BRL   L0432C0
L043142     STZ   $E8
            BRL   L043253
L043147     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   #$0006
            PHA
            JSL   L044535
            SEC
            JSL   L017037
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293AC
            LDX   #^L0293AC
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PLX
            STX   $FA
            CLC
            ADC   $FA
            PHA
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293AC
            LDX   #^L0293AC
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            PEA   $0064
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293B2
            LDX   #^L0293B2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            ASL
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295E4
            LDX   #^L0295E4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDY   #$0002
            LDA   [$F6],Y
            TAX
            LDA   [$F6]
            PHX
            PHA
            _NoteOn
            INC   $E8
L043253     LDA   $E8
            SEC
            SBC   #$0003
            BVS   L04325E
            EOR   #$8000
L04325E     BMI   L043263
            BRL   L043147
L043263     STZ   $E8
            BRA   L0432B3
L043267     LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $E8
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $E8
L0432B3     LDA   $E8
            SEC
            SBC   #$0003
            BVS   L0432BE
            EOR   #$8000
L0432BE     BPL   L043267
L0432C0     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            LDA   L0600A7
            BNE   L0432DD
            BRL   L043426
L0432DD     STZ   $EE
            BRL   L0433BB
L0432E2     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293B8
            LDX   #^L0293B8
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293BE
            LDX   #^L0293BE
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293C4
            LDX   #^L0293C4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            ASL
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295E4
            LDX   #^L0295E4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDY   #$0002
            LDA   [$F6],Y
            TAX
            LDA   [$F6]
            PHX
            PHA
            _NoteOn
            INC   $EE
L0433BB     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L0433C6
            EOR   #$8000
L0433C6     BMI   L0433CB
            BRL   L0432E2
L0433CB     STZ   $EE
            BRA   L043419
L0433CF     LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293B8
            LDX   #^L0293B8
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EE
L043419     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L043424
            EOR   #$8000
L043424     BPL   L0433CF
L043426     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L043430     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EA
            TCS
            LDA   L0600A7
            BNE   L043443
            BRL   L04358C
L043443     STZ   $EC
            BRL   L043521
L043448     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EE
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EE
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293CA
            LDX   #^L0293CA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293D2
            LDX   #^L0293D2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293DA
            LDX   #^L0293DA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            ASL
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295E4
            LDX   #^L0295E4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDY   #$0002
            LDA   [$F6],Y
            TAX
            LDA   [$F6]
            PHX
            PHA
            _NoteOn
            INC   $EC
L043521     LDA   $EC
            SEC
            SBC   #$0004
            BVS   L04352C
            EOR   #$8000
L04352C     BMI   L043531
            BRL   L043448
L043531     STZ   $EC
            BRA   L04357F
L043535     LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EE
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293CA
            LDX   #^L0293CA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EC
L04357F     LDA   $EC
            SEC
            SBC   #$0004
            BVS   L04358A
            EOR   #$8000
L04358A     BPL   L043535
L04358C     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L043596     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            LDA   L0600A7
            BNE   L0435A9
            BRL   L0436F2
L0435A9     STZ   $EE
            BRL   L043687
L0435AE     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293E2
            LDX   #^L0293E2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293E8
            LDX   #^L0293E8
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293EE
            LDX   #^L0293EE
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            ASL
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295E4
            LDX   #^L0295E4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDY   #$0002
            LDA   [$F6],Y
            TAX
            LDA   [$F6]
            PHX
            PHA
            _NoteOn
            INC   $EE
L043687     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L043692
            EOR   #$8000
L043692     BMI   L043697
            BRL   L0435AE
L043697     STZ   $EE
            BRA   L0436E5
L04369B     LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293E2
            LDX   #^L0293E2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EE
L0436E5     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L0436F0
            EOR   #$8000
L0436F0     BPL   L04369B
L0436F2     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L0436FC     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            LDA   L0600A7
            BNE   L04370F
            BRL   L043810
L04370F     STZ   $EE
            BRL   L0437A5
L043714     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293F4
            LDX   #^L0293F4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            PEA   $006A
            LDAL  L0295E6
            TAX
            LDAL  L0295E4
            PHX
            PHA
            _NoteOn
            INC   $EE
L0437A5     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L0437B0
            EOR   #$8000
L0437B0     BMI   L0437B5
            BRL   L043714
L0437B5     STZ   $EE
            BRA   L043803
L0437B9     LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293F4
            LDX   #^L0293F4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EE
L043803     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L04380E
            EOR   #$8000
L04380E     BPL   L0437B9
L043810     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L04381A     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            LDA   L0600A7
            BNE   L04382D
            BRL   L04392E
L04382D     STZ   $EE
            BRL   L0438C3
L043832     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293FA
            LDX   #^L0293FA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            PEA   $006A
            LDAL  L0295E6
            TAX
            LDAL  L0295E4
            PHX
            PHA
            _NoteOn
            INC   $EE
L0438C3     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L0438CE
            EOR   #$8000
L0438CE     BMI   L0438D3
            BRL   L043832
L0438D3     STZ   $EE
            BRA   L043921
L0438D7     LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0293FA
            LDX   #^L0293FA
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EE
L043921     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L04392C
            EOR   #$8000
L04392C     BPL   L0438D7
L04392E     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L043938     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EE
            TCS
            LDA   L0600A7
            BNE   L04394B
            BRL   L043A4C
L04394B     STZ   $F0
            BRL   L0439E1
L043950     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029400
            LDX   #^L029400
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            PEA   $0062
            LDAL  L0295EE
            TAX
            LDAL  L0295EC
            PHX
            PHA
            _NoteOn
            INC   $F0
L0439E1     LDA   $F0
            SEC
            SBC   #$0002
            BVS   L0439EC
            EOR   #$8000
L0439EC     BMI   L0439F1
            BRL   L043950
L0439F1     STZ   $F0
            BRA   L043A3F
L0439F5     LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029400
            LDX   #^L029400
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $F0
L043A3F     LDA   $F0
            SEC
            SBC   #$0002
            BVS   L043A4A
            EOR   #$8000
L043A4A     BPL   L0439F5
L043A4C     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            LDA   L0600A7
            BNE   L043A69
            BRL   L043B6A
L043A69     STZ   $EE
            BRL   L043AFF
L043A6E     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029404
            LDX   #^L029404
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            PEA   $006B
            LDAL  L0295EE
            TAX
            LDAL  L0295EC
            PHX
            PHA
            _NoteOn
            INC   $EE
L043AFF     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L043B0A
            EOR   #$8000
L043B0A     BMI   L043B0F
            BRL   L043A6E
L043B0F     STZ   $EE
            BRA   L043B5D
L043B13     LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029404
            LDX   #^L029404
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EE
L043B5D     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L043B68
            EOR   #$8000
L043B68     BPL   L043B13
L043B6A     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L043B74     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EA
            TCS
            LDA   L0600A7
            BNE   L043B87
            BRL   L043CD0
L043B87     STZ   $EC
            BRL   L043C65
L043B8C     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EE
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EE
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02940A
            LDX   #^L02940A
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029412
            LDX   #^L029412
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02941A
            LDX   #^L02941A
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            ASL
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295E4
            LDX   #^L0295E4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDY   #$0002
            LDA   [$F6],Y
            TAX
            LDA   [$F6]
            PHX
            PHA
            _NoteOn
            INC   $EC
L043C65     LDA   $EC
            SEC
            SBC   #$0004
            BVS   L043C70
            EOR   #$8000
L043C70     BMI   L043C75
            BRL   L043B8C
L043C75     STZ   $EC
            BRA   L043CC3
L043C79     LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00EE
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EC
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02940A
            LDX   #^L02940A
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EC
L043CC3     LDA   $EC
            SEC
            SBC   #$0004
            BVS   L043CCE
            EOR   #$8000
L043CCE     BPL   L043C79
L043CD0     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L043CDA     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            LDA   L0600A7
            BNE   L043CED
            BRL   L043DCC
L043CED     LDA   #$0003
            STAL  L029614
            LDA   #$0040
            STAL  L029610
            LDA   #$0000
            STAL  L029612
            LDA   #$00B1
            STAL  L029624
            LDA   #$0038
            STAL  L029618
            LDA   #$0001
            STAL  L029379
            STZ   $F4
            BRL   L043D8A
L043D1C     LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029422
            LDX   #^L029422
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02961A
            LDX   #^L02961A
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02942C
            LDX   #^L02942C
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F4
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295FC
            LDX   #^L0295FC
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            INC   $F4
L043D8A     LDA   $F4
            SEC
            SBC   #$0005
            BVS   L043D95
            EOR   #$8000
L043D95     BPL   L043D1C
            LDA   #$0001
            STAL  L029616
L043D9E     LDAL  L029610
            SEC
            SBC   #$0060
            BVS   L043DAB
            EOR   #$8000
L043DAB     BMI   L043DAF
            BRA   L043D9E
L043DAF     LDA   #$00A0
            STAL  L029610
            LDA   L060085
            BEQ   L043DCC
L043DBB     LDAL  L029610
            SEC
            SBC   #$00B0
            BVS   L043DC8
            EOR   #$8000
L043DC8     BMI   L043DCC
            BRA   L043DBB
L043DCC     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L043DD6     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            LDA   L0600A7
            BNE   L043DE9
            BRL   L043F32
L043DE9     STZ   $EE
            BRL   L043EC7
L043DEE     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029436
            LDX   #^L029436
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L02943C
            LDX   #^L02943C
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029442
            LDX   #^L029442
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            ASL
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L0295E4
            LDX   #^L0295E4
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDY   #$0002
            LDA   [$F6],Y
            TAX
            LDA   [$F6]
            PHX
            PHA
            _NoteOn
            INC   $EE
L043EC7     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L043ED2
            EOR   #$8000
L043ED2     BMI   L043ED7
            BRL   L043DEE
L043ED7     STZ   $EE
            BRA   L043F25
L043EDB     LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029436
            LDX   #^L029436
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EE
L043F25     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L043F30
            EOR   #$8000
L043F30     BPL   L043EDB
L043F32     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L043F3C     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            PEA   $0019
            PEA   $0000
            _LoadOneTool
            LDA   L060021
            CLC
            ADC   #$0800
            PHA
            _SoundStartUp
            PEA   ^L029474
            PEA   L029474
            JSL   L011045
            PLY
            PLY
            STZ   $F4
            BRA   L043FE3
L043F85     LDA   $F4
            ASL
            PHA
            LDA   #$0001
            PLX
            STX   $FA
            CLC
            ADC   $FA
            PHA
            LDA   $F4
            LDX   #$0000
            PHX
            PHA
            LDA   #L02BB5A
            LDX   #^L02BB5A
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            SEP   #$20
            STA   [$F6]
            REP   #$20
            LDA   $F4
            ASL
            PHA
            LDA   #$00FF
            PLX
            STX   $FA
            SEC
            SBC   $FA
            PHA
            LDA   $F4
            CLC
            ADC   #$0080
            LDX   #$0000
            PHX
            PHA
            LDA   #L02BB5A
            LDX   #^L02BB5A
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            SEP   #$20
            STA   [$F6]
            REP   #$20
            INC   $F4
L043FE3     LDA   $F4
            SEC
            SBC   #$0080
            BVS   L043FEE
            EOR   #$8000
L043FEE     BPL   L043F85
            SEI
            PEA   ^L02BB5A
            PEA   L02BB5A
            PEA   $0000
            PEA   $0100
            _WriteRamBlock
            CLI
            LDA   #L029448
            LDX   #^L029448
            STX   L0600AB
            STA   L0600A9
            PEA   $006E
            PEA   $0000
            PEA   $0000
            _NSStartUp
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04403B     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            _NSShutDown
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04405E     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            STA   $F4
            PEI   $F4
            PEA   $007A
            PEA   $0062
            LDX   L0600AB
            LDA   L0600A9
            PHX
            PHA
            _NoteOn
            PEI   $F4
            PEA   $007A
            _NoteOff
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L0440C3     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            STA   $F4
            PEI   $F4
            PEA   $007C
            PEA   $0062
            LDX   L0600AB
            LDA   L0600A9
            PHX
            PHA
            _NoteOn
            PEI   $F4
            PEA   $007C
            _NoteOff
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L044128     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F2
            TCS
            PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            STA   $F4
            PEI   $F4
            PEA   $0078
            PEA   $0062
            LDX   L0600AB
            LDA   L0600A9
            PHX
            PHA
            _NoteOn
            PEI   $F4
            PEA   $0078
            _NoteOff
            TDC
            CLC
            ADC   #$00FB
            TCS
            PLD
            RTL

L04418D     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EE
            TCS
            LDA   L0600A7
            BEQ   L0441A2
            LDA   L06003F
            BEQ   L0441A5
L0441A2     BRL   L0442A6
L0441A5     STZ   $F0
            BRL   L04423B
L0441AA     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029482
            LDX   #^L029482
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            PEA   $007B
            LDAL  L0295FA
            TAX
            LDAL  L0295F8
            PHX
            PHA
            _NoteOn
            INC   $F0
L04423B     LDA   $F0
            SEC
            SBC   #$0002
            BVS   L044246
            EOR   #$8000
L044246     BMI   L04424B
            BRL   L0441AA
L04424B     STZ   $F0
            BRA   L044299
L04424F     LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F2
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $F0
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029482
            LDX   #^L029482
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $F0
L044299     LDA   $F0
            SEC
            SBC   #$0003
            BVS   L0442A4
            EOR   #$8000
L0442A4     BPL   L04424F
L0442A6     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L0442B0     ENT
            PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00EC
            TCS
            LDA   L0600A7
            BNE   L0442C3
            BRL   L0443C4
L0442C3     STZ   $EE
            BRL   L044359
L0442C8     PHA
            PEA   $0000
            PEA   $0040
            _AllocGen
            PLA
            AND   #$00FF
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            PLA
            STA   [$F6]
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029486
            LDX   #^L029486
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            PEA   $0074
            LDAL  L0295F2
            TAX
            LDAL  L0295F0
            PHX
            PHA
            _NoteOn
            INC   $EE
L044359     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L044364
            EOR   #$8000
L044364     BMI   L044369
            BRL   L0442C8
L044369     STZ   $EE
            BRA   L0443B7
L04436D     LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDX   #$0000
            TDC
            CLC
            ADC   #$00F0
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            LDA   $EE
            ASL
            LDX   #$0000
            PHX
            PHA
            LDA   #L029486
            LDX   #^L029486
            JSL   L016FC0
            PLA
            PLX
            STA   $F6
            STX   $F8
            LDA   [$F6]
            PHA
            _NoteOff
            INC   $EE
L0443B7     LDA   $EE
            SEC
            SBC   #$0003
            BVS   L0443C2
            EOR   #$8000
L0443C2     BPL   L04436D
L0443C4     TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL

L0443CE     PHP
            PHD
            JSL   IRQ_MOUSE
            PLD
            PLP
            RTL

L0443D7     PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00F2
            TCS
            LDA   $FF
            SEC
            SBC   #$0061
            BVS   L0443ED
            EOR   #$8000
L0443ED     BPL   L044406
            LDA   $FF
            SEC
            SBC   #$007A
            BEQ   L0443FE
            BVS   L0443FC
            EOR   #$8000
L0443FC     BMI   L044406
L0443FE     LDA   $FF
            CLC
            ADC   #$FFE0
            STA   $FF
L044406     LDA   $FF
            TAY
            TDC
            CLC
            ADC   #$00F9
            TCS
            TYA
            PLD
            RTL

L044412     PHD
            TSC
            SEC
            SBC   #$00F5
            TCD
            ADC   #$00EE
            TCS
            PEA   $0301
            PEI   $FD
            PEI   $FB
            JSL   L01A4E0
            PLY
            PLY
            PLY
            TAY
            TDC
            CLC
            ADC   #$00F5
            TCS
            TYA
            PLD
            RTL

L044435     PHD
            TSC
            SEC
            SBC   #$00F9
            TCD
            ADC   #$00F2
            TCS
            LDA   $FF
            LDX   #$0000
            STX   L0600D1
            STA   L0600CF
            TDC
            CLC
            ADC   #$00F9
            TCS
            PLD
            RTL

L044453     PHD
            TSC
            SEC
            SBC   #$00F3
            TCD
            ADC   #$00E6
            TCS
            LDA   $F9
            SEC
            SBC   #$0000
            BVS   L044469
            EOR   #$8000
L044469     BMI   L04447D
            PEA   $0000
            PEA   $0016
            JSL   L019D72
            PLY
            PLY
            LDA   #$FFFF
            BRL   L04452B
L04447D     PEA   $0000
            TDC
            CLC
            ADC   #$00F9
            PHA
            JSL   L019B4F
            PLY
            PLY
            STX   $EC
            STA   $EA
            LDA   $EA
            CMP   #$0000
            BNE   L0444A4
            LDA   $EC
            CMP   #$0000
            BNE   L0444A4
            LDA   #$FFFF
            BRL   L04452B
L0444A4     LDA   [$EA]
            AND   #$0001
            TAY
            BNE   L0444BD
            PEA   $0000
            PEA   $0009
            JSL   L019D72
            PLY
            PLY
            LDA   #$FFFF
            BRA   L04452B
L0444BD     LDA   $FF
            LDY   #$000C
            STA   [$EA],Y
            LDX   $FD
            LDA   $FB
            LDY   #$0010
            PHA
            TXA
            STA   [$EA],Y
            PLA
            LDY   #$000E
            STA   [$EA],Y
            PEI   $EC
            PEI   $EA
            LDY   #$0006
            LDA   [$EA],Y
            TAX
            LDY   #$0004
            LDA   [$EA],Y
            STA   $EE
            STX   $F0
            LDY   #$000E
            LDA   [$EE],Y
            TAX
            LDY   #$000C
            LDA   [$EE],Y
            STA   $EE
            STX   $F0
            LDA   $EE
            LDX   $F0
            JSL   L0174BF
            PLY
            PLY
            STA   $E8
            LDA   $E8
            CMP   #$0000
            BEQ   L04451D
            LDY   #$0002
            LDA   [$EA],Y
            PHA
            PEI   $E8
            JSL   L019D72
            PLY
            PLY
            LDA   #$FFFF
            BRA   L04452B
L04451D     LDY   #$000C
            LDA   [$EA],Y
            PHA
            LDA   $FF
            PLX
            STX   $F2
            SEC
            SBC   $F2
L04452B     TAY
            TDC
            CLC
            ADC   #$00F3
            TCS
            TYA
            PLD
            RTL

L044535     PHD
            TSC
            SEC
            SBC   #$00FB
            TCD
            ADC   #$00F4
            TCS
            LDX   #$0000
            LDA   #$0010
            PHX
            PHA
            LDX   L0600D1
            LDA   L0600CF
            PEA   $41C6
            PEA   $4E6D
            CLC
            JSL   L01A459
            PLA
            PLX
            CLC
            ADC   #$3039
            PHA
            TXA
            ADC   #$0000
            TAX
            PLA
            STX   L0600D1
            STA   L0600CF
            SEC
            JSL   L018B09
            PLA
            PLX
            AND   #$7FFF
            PHA
            TXA
            AND   #$0000
            TAX
            PLA
            TAY
            TDC
            CLC
            ADC   #$00FB
            TCS
            TYA
            PLD
            RTL


