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

* Segment 3, kind $0000

         MX    %00
	 REL

	 USE   MAIN1.X.S
	 
	 use	4/Ctl.Macs
	 use	4/Desk.Macs
	 use	4/Dialog.Macs
	 use 	4/Event.Macs
	 use	4/Font.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/Scrap.Macs
	 use	4/Sound.Macs
	 use	4/Std.Macs
	 use	4/Util.Macs
	 use	4/Window.Macs
	 
*

L030000  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$0090
         TCS
         LDA   L0500D4
         BEQ   L030029
         LDAL  L022952+2
         TAX
         LDAL  L022952
         PHX
         PHA
         JSL   L031C9A
         PLY
         PLY
         TAY
         BNE   L030029
         LDA   #$0000
         BRA   L03002C
L030029  LDA   #$0001
L03002C  SEP   #$20
         STA   L05007F
         REP   #$20
         LDA   L05007F
         AND   #$00FF
         BNE   L03003E
         BRL   L030128
L03003E  JSL   L01184E
         TAY
         BNE   L030048
         BRL   L0300DF
L030048  PEA   $0001
         JSL   L0118DD
         PLY
         LDA   L05001A
         BNE   L03005E
         LDA   L05007B
         PHA
         JSL   L011828
         PLY
L03005E  PEA   ^L05007B
         PEA   L05007B
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         JSL   L011815
         PLY
         PLY
         PLY
         PLY
         LDA   L05007B
         CMP   #$0001
         BEQ   L0300C7
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         JSL   L030171
         PLY
         PLY
         LDA   L05005F
         BNE   L0300B2
         STZ   L05001A
         SEP   #$20
         STZ   L05007F
         REP   #$20
         SEP   #$20
         STZ   L050083
         REP   #$20
         SEP   #$20
         STZ   L050080
         REP   #$20
         LDA   #$FFFF
         STA   L0500A2
         BRL   L030128
L0300B2  LDA   #$0000
         SEP   #$20
         STAL  L022C14
         REP   #$20
         SEP   #$20
         STAL  L022C13
         REP   #$20
         BRA   L0300D3
L0300C7  PEA   $0231
         PEA   $0000
         JSL   L030C6B
         PLY
         PLY
L0300D3  LDA   #$0001
         STA   L05005F
         LDA   #$0001
         STA   L05001A
L0300DF  STZ   L050069
         STZ   L050032
         LDA   L050084
         AND   #$00FF
         BEQ   L030128
         LDA   L0500C8
         BEQ   L030128
         PEA   $0100
         PEA   $0004
         JSL   L01662A
         PLY
         PLY
         JSL   L017CEC
         LDAL  L022C13
         AND   #$00FF
         BNE   L030114
         LDAL  L022C14
         AND   #$00FF
         BEQ   L030128
L030114  LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         PHA
         PEA   $0004
         JSL   L016E1F
         PLY
         PLY
L030128  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L030132  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EA
         TCS
         PEA   $0064
         LDAL  L02295A+2
         TAX
         LDAL  L02295A
         PHX
         PHA
         PEI   $FB
         PEI   $F9
         JSL   L03A429
         PLY
         PLY
         PLY
         PLY
         PLY
         STA   $EC
         JSL   L01184E
         TAY
         BEQ   L030165
         JSL   L0117DC
L030165  LDA   $EC
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L030171  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$004C
         TCS
         JSL   L01574B
         LDA   #$0001
         STA   L05008A
         STZ   L05005F
         PEI   $FF
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$00A2
         PHA
         JSL   L030132
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L0301A4
         BRL   L030302
L0301A4  JSL   L032568
         PEA   $0020
         PEA   $0000
         TDC
         CLC
         ADC   #$00A2
         PHA
         JSL   L01A61D
         PLY
         PLY
         PLY
         STA   $50
         CMP   #$FFFF
         BNE   L0301E1
         PEA   $0000
         TDC
         CLC
         ADC   #$00A2
         PHA
         LDAL  L022936+2
         TAX
         LDAL  L022936
         PHX
         PHA
         JSL   L031C2E
         PLY
         PLY
         PLY
         PLY
         BRL   L030306
L0301E1  PEI   $50
         JSL   L01716A
         PLY
         TAY
         BEQ   L0301EE
         BRL   L030254
L0301EE  JSL   L0155F1
         LDAL  L02293E+2
         TAX
         LDAL  L02293E
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0052
         PHA
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$00A2
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0052
         PHA
         JSL   L019E68
         PLY
         PLY
         PLY
         PLY
         LDAL  L022942+2
         TAX
         LDAL  L022942
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0052
         PHA
         JSL   L031C2E
         PLY
         PLY
         PLY
         PLY
         PEI   $50
         JSL   L019217
         PLY
         JSL   L0151A2
         BRL   L030306
         BRA   L030257
L030254  STZ   L050069
L030257  PEI   $50
         JSL   L019217
         PLY
         LDA   L0500BE
         STA   $4E
         BRA   L03026C
L030265  PEI   $4E
         JSL   L0110DB
         PLY
L03026C  LDA   $4E
         DEC   $4E
         TAY
         BNE   L030265
         JSL   L032568
         JSL   L01561C
         JSL   L017FBA
         STA   L05008C
         LDA   #$0001
         STA   L05006D
         PEA   $0000
         TDC
         CLC
         ADC   #$00A2
         PHA
         PEA   ^L0226C4
         PEA   L0226C4
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         LDA   #$0001
         SEP   #$20
         STA   L050087
         REP   #$20
         PEA   $0000
         JSL   L0173D8
         PLY
         LDA   L050084
         AND   #$00FF
         BEQ   L0302F4
         LDA   L0500C8
         BEQ   L0302F4
         PEA   $0100
         PEA   $0004
         JSL   L01662A
         PLY
         PLY
         JSL   L017CEC
         LDAL  L022C13
         AND   #$00FF
         BNE   L0302E0
         LDAL  L022C14
         AND   #$00FF
         BEQ   L0302F4
L0302E0  LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         PHA
         PEA   $0004
         JSL   L016E1F
         PLY
         PLY
L0302F4  LDA   #$0001
         STA   L050063
         LDA   #$0001
         STA   L05005F
         BRA   L030306
L030302  JSL   L0151A2
L030306  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L030310  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00A2
         TCS
         PEA   ^L0226C4
         PEA   L0226C4
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         JSL   L01574B
         LDA   #$0001
         STA   L05008A
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         JSL   L0189DA
         PLY
         PLY
         TAY
         BNE   L030351
         BRL   L03046B
L030351  JSL   L032568
         PEA   $0321
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         JSL   L01A61D
         PLY
         PLY
         PLY
         STA   $F4
         CMP   #$FFFF
         BNE   L03039C
         JSL   L0155F1
         JSL   L032C10
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         LDAL  L022936+2
         TAX
         LDAL  L022936
         PHX
         PHA
         JSL   L031C65
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         BRL   L03046F
L03039C  PEA   $0002
         PEA   $0000
         TDC
         CLC
         ADC   #$00F4
         PHA
         PEI   $F4
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         CMP   #$0002
         BEQ   L0303E0
         JSL   L032C10
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         LDAL  L022936+2
         TAX
         LDAL  L022936
         PHX
         PHA
         JSL   L031C65
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         BRL   L03046F
L0303E0  PEA   $0000
         PEA   $0000
         PEA   $0000
         PEI   $F4
         JSL   L03ADA5
         PLY
         PLY
         PLY
         PLY
         PEI   $F4
         JSL   L017078
         PLY
         TAY
         BNE   L030434
         JSL   L032C10
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         LDAL  L02293A+2
         TAX
         LDAL  L02293A
         PHX
         PHA
         JSL   L031C65
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PEI   $F4
         JSL   L019217
         PLY
         JSL   L0155F1
         JSL   L0151A2
         BRA   L03046F
L030434  PEI   $F4
         JSL   L019217
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         PEA   ^L0226C4
         PEA   L0226C4
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         PEA   $0064
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         JSL   L01803C
         PLY
         PLY
         PLY
         JSL   L0155F1
         BRA   L03046F
L03046B  JSL   L0151A2
L03046F  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L030479  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00A2
         TCS
         PEA   ^L022714
         PEA   L022714
         PEA   $0000
         TDC
         CLC
         ADC   #$00A6
         PHA
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         LDA   #$0001
         STA   L05008A
         STZ   L0500CC
         JSL   L01574B
         JSL   L01561C
         PEA   $0000
         TDC
         CLC
         ADC   #$00A6
         PHA
         JSL   L0189DA
         PLY
         PLY
         TAY
         BNE   L0304C1
         BRL   L030585
L0304C1  JSL   L032568
         PEA   $0000
         TDC
         CLC
         ADC   #$00A6
         PHA
         JSL   L03AD82
         PLY
         PLY
         STA   $A4
         CMP   #$FFFF
         BNE   L03050C
         JSL   L0155F1
         JSL   L032C10
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00A6
         PHA
         LDAL  L022936+2
         TAX
         LDAL  L022936
         PHX
         PHA
         JSL   L031C65
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         JSL   L0151A2
         BRL   L030589
L03050C  PEA   $0002
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         PEI   $A4
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         CMP   #$0002
         BEQ   L03054F
         JSL   L032C10
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00A6
         PHA
         LDAL  L022936+2
         TAX
         LDAL  L022936
         PHX
         PHA
         JSL   L031C65
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         BRA   L030589
L03054F  PEA   $0000
         PEA   $0000
         PEA   $0000
         PEI   $A4
         JSL   L03ADA5
         PLY
         PLY
         PLY
         PLY
         PEI   $A4
         JSL   L017A02
         PLY
         STZ   L050071
         PEA   $0000
         TDC
         CLC
         ADC   #$00A6
         PHA
         PEA   ^L022714
         PEA   L022714
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         BRA   L030589
L030585  JSL   L0151A2
L030589  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L030593  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L03A769
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   ^L024160
         PEA   L024160
         PEA   ^L02415F
         PEA   L02415F
         PEA   ^L02415E
         PEA   L02415E
         LDAL  L022986+2
         TAX
         LDAL  L022986
         PHX
         PHA
         JSL   L0180AF
         TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         LDAL  L022982+2
         TAX
         LDAL  L022982
         PHX
         PHA
         PEA   $0002
         JSL   L018B9D
         PLY
         PLY
         PLY
         LDA   #$0001
         STA   L0500CA
         STZ   L050071
         LDA   #$0001
         STA   L05006F
         PEA   $0004
         JSL   L017A02
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03060E  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         STZ   $F4
         JSL   L01574B
         JSL   L01184E
         TAY
         BEQ   L030629
         STZ   L0500D4
L030629  LDA   L0500D4
         BNE   L030631
         BRL   L0306A4
L030631  PEA   $0001
         PEA   ^L024170
         PEA   L024170
         PEA   ^L02416F
         PEA   L02416F
         LDAL  L022956+2
         TAX
         LDAL  L022956
         PHX
         PHA
         PEA   ^L02416E
         PEA   L02416E
         PEA   ^L02416D
         PEA   L02416D
         PEA   ^L024168
         PEA   L024168
         PEA   ^L024165
         PEA   L024165
         PEA   ^L024161
         PEA   L024161
         JSL   L018897
         TAY
         TSC
         CLC
         ADC   #$0022
         TCS
         TYA
         JSL   L01848A
         STA   $F2
         JSL   L01842F
         LDA   $F2
         CMP   #$0002
         BNE   L03068A
         JSL   L030310
L03068A  LDA   $F2
         CMP   #$0001
         BNE   L030694
         BRL   L0306F8
L030694  LDA   $F2
         CMP   #$0000
         BNE   L0306A2
         LDA   #$0001
         STA   $F4
         BRA   L0306A4
L0306A2  BRA   L030629
L0306A4  LDA   $F4
         BNE   L0306C6
         LDAL  L022956+2
         TAX
         LDAL  L022956
         PHX
         PHA
         JSL   L031CD5
         PLY
         PLY
         TAY
         BEQ   L0306C1
         LDA   #$0000
         BRA   L0306C4
L0306C1  LDA   #$0001
L0306C4  STA   $F4
L0306C6  LDA   $F4
         BEQ   L0306EB
         LDA   L050084
         AND   #$00FF
         BEQ   L0306E3
         LDA   L0500C8
         BEQ   L0306E3
         PEA   $0100
         PEA   $0004
         JSL   L01662A
         PLY
         PLY
L0306E3  JSL   L031AD7
         JSL   L01A6E0
L0306EB  JSL   L01184E
         TAY
         BEQ   L0306F8
         LDA   #$0001
         STA   L0500D4
L0306F8  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L030702  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050082
         AND   #$00FF
         BEQ   L03072F
         PEA   $021D
         JSL   L014A79
         PLY
         PEA   $024D
         JSL   L014A54
         PLY
         PEA   $021F
         JSL   L014A54
         PLY
         BRA   L030743
L03072F  PEA   $021D
         JSL   L014AA1
         PLY
         PEA   $021F
         JSL   L014A2F
         PLY
         JSL   L031546
L030743  JSL   L0308F1
         JSL   L031413
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030753  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   L050082
         AND   #$00FF
         BEQ   L03076B
         LDA   #$0000
         BRA   L03076E
L03076B  LDA   #$0001
L03076E  SEP   #$20
         STA   L050082
         REP   #$20
         STZ   L050069
         STZ   L050032
         LDA   L050082
         AND   #$00FF
         BNE   L03078D
         LDA   #$0001
         SEP   #$20
         STA   L050083
         REP   #$20
L03078D  JSL   L030702
         LDA   L0500BE
         STA   $F4
         BRA   L0307D5
L030798  LDA   L050082
         AND   #$00FF
         BEQ   L0307A9
         PEI   $F4
         JSL   L010F6F
         PLY
         BRA   L0307D5
L0307A9  LDA   $F4
         CMP   L0500A2
         BNE   L0307CE
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BNE   L0307D5
L0307CE  PEI   $F4
         JSL   L0110DB
         PLY
L0307D5  LDA   $F4
         DEC   $F4
         TAY
         BNE   L030798
         LDA   L050082
         AND   #$00FF
         BEQ   L0307EA
         STZ   L050077
         BRL   L030897
L0307EA  LDA   L0500BE
         PHA
         LDA   L050077
         SEC
         JSL   L019DD9
         PLA
         STA   L050077
         LDA   L050077
         BNE   L030802
         BRL   L030897
L030802  LDAL  L022C13
         AND   #$00FF
         BNE   L030814
         LDAL  L022C14
         AND   #$00FF
         BEQ   L030853
L030814  LDA   #$0001
         SEP   #$20
         STA   L050083
         REP   #$20
         LDAL  L022C13
         AND   #$00FF
         BEQ   L03082C
         LDA   #$0000
         BRA   L03082F
L03082C  LDA   #$0001
L03082F  SEP   #$20
         STAL  L022C13
         REP   #$20
         LDAL  L022C14
         AND   #$00FF
         BEQ   L030845
         LDA   #$0000
         BRA   L030848
L030845  LDA   #$0001
L030848  SEP   #$20
         STAL  L022C14
         REP   #$20
         BRL   L030897
L030853  STZ   $F4
         BRA   L030861
L030857  PEA   $0065
         JSL   L016EAD
         PLY
         INC   $F4
L030861  LDA   $F4
         SEC
         SBC   L050077
         BVS   L03086C
         EOR   #$8000
L03086C  BPL   L030857
         LDA   L0500A2
         PHA
         JSL   L010D91
         PLY
         STZ   $F4
         BRA   L030881
L03087B  JSL   L033E09
         INC   $F4
L030881  LDA   $F4
         SEC
         SBC   L050077
         BVS   L03088C
         EOR   #$8000
L03088C  BPL   L03087B
         LDA   L0500A2
         PHA
         JSL   L010E7F
         PLY
L030897  PEA   $007F
         JSL   L016EAD
         PLY
         LDA   L050082
         AND   #$00FF
         BEQ   L0308C2
         LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L0308B3
         EOR   #$8000
L0308B3  BPL   L0308C2
         LDA   #$0038
         CLC
         ADC   L0500A2
         PHA
         JSL   L016EAD
         PLY
L0308C2  LDA   L050082
         AND   #$00FF
         BEQ   L0308DE
         LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L0308D6
         EOR   #$8000
L0308D6  BMI   L0308DE
         LDA   #$0001
         STA   L050067
L0308DE  LDA   L050082
         AND   #$00FF
         BNE   L0308E9
         STZ   L050067
L0308E9  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0308F1  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         LDAL  L022C13
         AND   #$00FF
         BNE   L03091F
         LDAL  L022C14
         AND   #$00FF
         BNE   L03091F
         LDA   L050082
         AND   #$00FF
         BNE   L030929
         JSL   L017FD7
         CMP   #$FFFF
         BNE   L030929
L03091F  PEA   $021E
         JSL   L014A2F
         PLY
         BRA   L030931
L030929  PEA   $021E
         JSL   L014A54
         PLY
L030931  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030939  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         STZ   L050069
         LDA   L050082
         AND   #$00FF
         BEQ   L030955
         INC   L050077
         BRL   L0309B0
L030955  LDAL  L022C13
         AND   #$00FF
         STA   $F4
         LDAL  L022C14
         SEP   #$20
         STAL  L022C13
         REP   #$20
         LDA   $F4
         SEP   #$20
         STAL  L022C14
         REP   #$20
         LDAL  L022C13
         AND   #$00FF
         BNE   L0309A6
         LDAL  L022C14
         AND   #$00FF
         BNE   L0309A6
         LDA   L0500A2
         PHA
         JSL   L010D91
         PLY
         JSL   L033E09
         LDA   L0500A2
         PHA
         JSL   L010E7F
         PLY
         PEA   $0065
         JSL   L016EAD
         PLY
         BRA   L0309B0
L0309A6  LDA   #$0001
         SEP   #$20
         STA   L050083
         REP   #$20
L0309B0  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0309B8  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         STZ   L050069
         LDA   #$0001
         STA   L050073
         LDA   #$0001
         STA   L0500D0
         LDA   L050032
         BEQ   L030A1C
         LDA   L050030
         LDX   #$0000
         PHX
         PHA
         LDA   #L0240FA
         LDX   #^L0240FA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L030A19
         LDA   L050030
         LDX   #$0000
         PHX
         PHA
         LDA   #L0240FA
         LDX   #^L0240FA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         DEC
         SEP   #$20
         STA   [$F6]
         REP   #$20
         PLA
L030A19  STZ   L050032
L030A1C  JSL   L032568
         JSL   L01561C
         LDAL  L022C13
         AND   #$00FF
         BNE   L030A36
         LDAL  L022C14
         AND   #$00FF
         BEQ   L030A3B
L030A36  LDA   #$0002
         BRA   L030A3E
L030A3B  LDA   #$0001
L030A3E  PHA
         JSL   L0173D8
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030A4C  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FD
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024180
         LDX   #^L024180
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         BEQ   L030A78
         LDA   #$0000
         BRA   L030A7B
L030A78  LDA   #$0001
L030A7B  PHA
         LDA   $FD
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024180
         LDX   #^L024180
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
         LDA   $FD
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024180
         LDX   #^L024180
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         BEQ   L030ABC
         PEI   $FF
         JSL   L014A79
         PLY
         BRA   L030AC3
L030ABC  PEI   $FF
         JSL   L014AA1
         PLY
L030AC3  LDA   $FD
         PHA
         LDA   #$0011
         SEC
         JSL   L019895
         LDA   L050062
         AND   #$00FF
         PLX
         STX   $F6
         EOR   $F6
         SEP   #$20
         STA   L050062
         REP   #$20
         LDA   #$0001
         SEP   #$20
         STA   L050083
         REP   #$20
         STZ   L050071
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L030AF5  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0220
         PEA   $0000
         JSL   L030A4C
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030B14  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0221
         PEA   $0001
         JSL   L030A4C
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030B33  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0222
         PEA   $0002
         JSL   L030A4C
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030B52  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0223
         PEA   $0003
         JSL   L030A4C
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030B71  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEA   $0231
         JSL   L014AA1
         PLY
         PEA   $0232
         JSL   L014AA1
         PLY
         PEA   $0233
         JSL   L014AA1
         PLY
         PEA   $0234
         JSL   L014AA1
         PLY
         PEA   $0222
         JSL   L014A54
         PLY
         PEA   $0223
         JSL   L014A54
         PLY
         JSL   L01184E
         TAY
         BNE   L030BBB
         PEA   $021E
         JSL   L014A2F
         PLY
L030BBB  PEA   $0001
         JSL   L0314B8
         PLY
         PEA   $0000
         JSL   L03106F
         PLY
         LDA   $FF
         BRL   L030C13
L030BD0  PEA   $0231
         JSL   L014A79
         PLY
         PEA   $0001
         JSL   L03106F
         PLY
         BRL   L030C24
L030BE3  PEA   $0232
         JSL   L014A79
         PLY
         BRL   L030C24
L030BEE  PEA   $0233
         JSL   L014A79
         PLY
         BRL   L030C24
L030BF9  PEA   $0234
         JSL   L014A79
         PLY
         BRL   L030C24
L030C04  BRL   L030C24
L030C07  DA    L030BF9
         DA    L030BEE
         DA    L030BD0
         DA    L030BE3
         DA    L030BD0
         DA    L030C04
L030C13  SEC
         SBC   #$007A
         CMP   #$0005
         BCC   L030C1F
         LDA   #$0005
L030C1F  ASL
         TAX
         JMP   (L030C07,X)

L030C24  LDA   $FF
         BRL   L030C52
L030C29  PEA   $0223
         JSL   L014A2F
         PLY
L030C31  PEA   $0222
         JSL   L014A2F
         PLY
         PEA   $021E
         JSL   L014A54
         PLY
         PEA   $0000
         JSL   L0314B8
         PLY
L030C49  BRL   L030C63
L030C4C  DA    L030C29
         DA    L030C31
         DA    L030C49
L030C52  SEC
         SBC   #$007A
         CMP   #$0002
         BCC   L030C5E
         LDA   #$0002
L030C5E  ASL
         TAX
         JMP   (L030C4C,X)

L030C63  TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L030C6B  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         LDA   L0500BE
         STA   $F0
         LDA   L0500BE
         CMP   #$0002
         BEQ   L030CA6
         LDA   L0500D4
         BEQ   L030CA6
         JSL   L01184E
         TAY
         BNE   L030CA6
         LDAL  L022962+2
         TAX
         LDAL  L022962
         PHX
         PHA
         JSL   L031C9A
         PLY
         PLY
         TAY
         BNE   L030CA6
         BRL   L030D98
L030CA6  LDA   $FD
         CMP   #$0000
         BNE   L030CB7
         PEA   $007E
         JSL   L030B71
         PLY
         BRA   L030CBF
L030CB7  PEA   $007D
         JSL   L030B71
         PLY
L030CBF  LDA   L0500BE
         CMP   #$0002
         BNE   L030CCA
         BRL   L030D46
L030CCA  STZ   L050069
         LDA   L050084
         AND   #$00FF
         BEQ   L030CE5
         PEA   $0100
         PEA   $0004
         JSL   L01662A
         PLY
         PLY
         JSL   L017CEC
L030CE5  LDA   L050084
         AND   #$00FF
         BEQ   L030D08
         LDA   $FD
         CMP   #$0000
         BNE   L030D08
         LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         PHA
         PEA   $0004
         JSL   L016E1F
         PLY
         PLY
L030D08  SEP   #$20
         STZ   L050082
         REP   #$20
         PEA   $0002
         JSL   L03903A
         PLY
         LDAL  L0240FA
         AND   #$00FF
         BNE   L030D3B
         LDAL  L0240FB
         AND   #$00FF
         BNE   L030D3B
         LDAL  L0240FC
         AND   #$00FF
         BNE   L030D3B
         LDAL  L0240FD
         AND   #$00FF
         BEQ   L030D3F
L030D3B  JSL   L031173
L030D3F  SEP   #$20
         STZ   L050082
         REP   #$20
L030D46  LDA   $FD
         BEQ   L030D4F
         LDA   #$0000
         BRA   L030D52
L030D4F  LDA   #$0001
L030D52  SEP   #$20
         STAL  L022C14
         REP   #$20
         LDA   #$0000
         SEP   #$20
         STAL  L022C13
         REP   #$20
         LDA   #$0001
         SEP   #$20
         STA   L050083
         REP   #$20
         LDA   $F0
         CMP   #$0002
         BNE   L030D98
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C13
         LDX   #^L022C13
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BNE   L030D98
         STZ   L050071
L030D98  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L030DA2  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         JSL   L01184E
         TAY
         BEQ   L030DCA
         LDAL  L022952+2
         TAX
         LDAL  L022952
         PHX
         PHA
         JSL   L031C9A
         PLY
         PLY
         TAY
         BNE   L030DCA
         BRA   L030E12
L030DCA  LDA   $FD
         STA   L05007B
         PEI   $FD
         JSL   L011828
         PLY
         LDA   $FD
         CMP   #$0001
         BEQ   L030DE4
         LDA   $FD
         CMP   #$0002
         BNE   L030DF5
L030DE4  PEI   $FF
         LDA   $FD
         SEC
         SBC   #$0001
         PHA
         JSL   L030C6B
         PLY
         PLY
         BRA   L030E04
L030DF5  PEI   $FF
         LDA   $FD
         SEC
         SBC   #$0001
         PHA
         JSL   L030E5A
         PLY
         PLY
L030E04  JSL   L01184E
         TAY
         BEQ   L030E12
         STZ   L0500D4
         JSL   L030000
L030E12  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L030E1C  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0231
         PEA   $0001
         JSL   L030DA2
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030E3B  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0232
         PEA   $0002
         JSL   L030DA2
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030E5A  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FD
         CLC
         ADC   #$0001
         CMP   L0500BE
         BEQ   L030E90
         LDA   L0500D4
         BEQ   L030E93
         JSL   L01184E
         TAY
         BNE   L030E93
         LDAL  L022962+2
         TAX
         LDAL  L022962
         PHX
         PHA
         JSL   L031C9A
         PLY
         PLY
         TAY
         BNE   L030E93
L030E90  BRL   L030F1C
L030E93  LDA   $FD
         CMP   #$0002
         BNE   L030EA4
         PEA   $007B
         JSL   L030B71
         PLY
         BRA   L030EAC
L030EA4  PEA   $007A
         JSL   L030B71
         PLY
L030EAC  LDA   #$0002
         STA   L0500DA
         LDA   #$0000
         SEP   #$20
         STAL  L022C14
         REP   #$20
         SEP   #$20
         STAL  L022C13
         REP   #$20
         SEP   #$20
         STZ   L050082
         REP   #$20
         LDA   L050084
         AND   #$00FF
         BEQ   L030EE8
         PEA   $0100
         PEA   $0004
         JSL   L01662A
         PLY
         PLY
         JSL   L017CEC
         JSL   L017D19
L030EE8  LDA   $FD
         CLC
         ADC   #$0001
         PHA
         JSL   L03903A
         PLY
         LDAL  L0240FA
         AND   #$00FF
         BNE   L030F18
         LDAL  L0240FB
         AND   #$00FF
         BNE   L030F18
         LDAL  L0240FC
         AND   #$00FF
         BNE   L030F18
         LDAL  L0240FD
         AND   #$00FF
         BEQ   L030F1C
L030F18  JSL   L031173
L030F1C  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L030F26  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0233
         PEA   $0003
         JSL   L030DA2
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030F45  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0234
         PEA   $0004
         JSL   L030DA2
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030F64  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0235
         JSL   L014AA1
         PLY
         PEA   $0236
         JSL   L014AA1
         PLY
         PEA   $0237
         JSL   L014AA1
         PLY
         PEA   $0238
         JSL   L014AA1
         PLY
         PEA   $0239
         JSL   L014AA1
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L030F9F  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         JSL   L030F64
         LDA   $FF
         BRL   L030FF9
L030FB3  PEA   $0235
         JSL   L014A79
         PLY
         BRL   L03100A
L030FBE  PEA   $0236
         JSL   L014A79
         PLY
         BRL   L03100A
L030FC9  PEA   $0237
         JSL   L014A79
         PLY
         BRL   L03100A
L030FD4  PEA   $0238
         JSL   L014A79
         PLY
         BRL   L03100A
L030FDF  PEA   $0239
         JSL   L014A79
         PLY
         BRL   L03100A
L030FEA  BRL   L03100A
L030FED  DA    L030FB3
         DA    L030FBE
         DA    L030FC9
         DA    L030FD4
         DA    L030FDF
         DA    L030FEA
L030FF9  SEC
         SBC   #$0004
         CMP   #$0005
         BCC   L031005
         LDA   #$0005
L031005  ASL
         TAX
         JMP   (L030FED,X)

L03100A  TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L031012  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   L050061
         AND   #$00FF
         CMP   $FD
         BNE   L031029
         BRA   L031065
L031029  JSL   L030F64
         PEI   $FF
         JSL   L014A79
         PLY
         LDA   $FD
         SEP   #$20
         STA   L050061
         REP   #$20
         LDA   L050084
         AND   #$00FF
         BEQ   L031065
         PEA   $0100
         PEA   $0004
         JSL   L01662A
         PLY
         PLY
         LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         PHA
         PEA   $0004
         JSL   L016E1F
         PLY
         PLY
L031065  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L03106F  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         BEQ   L0310A8
         PEA   $0235
         JSL   L014A2F
         PLY
         PEA   $0236
         JSL   L014A2F
         PLY
         PEA   $0237
         JSL   L014A2F
         PLY
         PEA   $0238
         JSL   L014A2F
         PLY
         PEA   $0239
         JSL   L014A2F
         PLY
         BRA   L0310D0
L0310A8  PEA   $0235
         JSL   L014A54
         PLY
         PEA   $0236
         JSL   L014A54
         PLY
         PEA   $0237
         JSL   L014A54
         PLY
         PEA   $0238
         JSL   L014A54
         PLY
         PEA   $0239
         JSL   L014A54
         PLY
L0310D0  TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L0310D8  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0235
         PEA   $0004
         JSL   L031012
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0310F7  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0236
         PEA   $0005
         JSL   L031012
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031116  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0237
         PEA   $0006
         JSL   L031012
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031135  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0238
         PEA   $0007
         JSL   L031012
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031154  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0239
         PEA   $0008
         JSL   L031012
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031173  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDAL  L0240FA
         AND   #$00FF
         BNE   L0311A2
         LDAL  L0240FB
         AND   #$00FF
         BNE   L0311A2
         LDAL  L0240FC
         AND   #$00FF
         BNE   L0311A2
         LDAL  L0240FD
         AND   #$00FF
         BEQ   L0311E6
L0311A2  JSL   L01184E
         TAY
         BNE   L0311E6
         LDAL  L022966+2
         TAX
         LDAL  L022966
         PHX
         PHA
         JSL   L031C9A
         PLY
         PLY
         TAY
         BEQ   L0311E6
         LDA   #$0000
         SEP   #$20
         STAL  L0240FD
         REP   #$20
         SEP   #$20
         STAL  L0240FC
         REP   #$20
         SEP   #$20
         STAL  L0240FB
         REP   #$20
         SEP   #$20
         STAL  L0240FA
         REP   #$20
         AND   #$00FF
         STA   L050032
L0311E6  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0311EE  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$0084
         TCS
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L0240FA
         LDX   #^L0240FA
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L03121F
         DEX
L03121F  STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L0229BC
         LDX   #^L0229BC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         PHX
         PHA
         PEA   ^L024171
         PEA   L024171
         PEA   $0000
         TDC
         CLC
         ADC   #$0090
         PHA
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEA   $0000
         TDC
         CLC
         ADC   #$0086
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0088
         PHA
         JSL   L0185B3
         PLY
         PLY
         PLY
         PLY
         LDA   $FF
         PHA
         LDA   #$0014
         SEC
         JSL   L019EFD
         LDA   #$0014
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $8C
         LDA   #$0002
         PHA
         JSL   L01801A
         SEC
         JSL   L019DD9
         PLY
         SEC
         SBC   #$0032
         STA   $8A
         LDA   $FF
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $8E
         PEA   $000F
         PEI   $8E
         PEI   $8E
         PEI   $8E
         PEA   $0000
         LDA   $88
         CLC
         ADC   $8C
         SEC
         SBC   #$0005
         PHA
         LDA   $86
         CLC
         ADC   $8A
         SEC
         SBC   #$0005
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEI   $8C
         LDA   $8A
         CLC
         ADC   #$000F
         PHA
         JSL   L015A12
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$0090
         PHA
         JSL   L015A39
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L031304  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L03A750
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $0006
         PEA   $0000
         PEA   ^L02417F
         PEA   L02417F
         PEA   ^L02417E
         PEA   L02417E
         PEA   ^L02417D
         PEA   L02417D
         PEA   ^L02417A
         PEA   L02417A
         JSL   L0180AF
         TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PEA   $0000
         JSL   L0311EE
         PLY
         PEA   $0001
         JSL   L0311EE
         PLY
         LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L03136E
         BVS   L031364
         EOR   #$8000
L031364  BPL   L03136E
         PEA   $0002
         JSL   L0311EE
         PLY
L03136E  LDA   L0500BE
         SEC
         SBC   #$0003
         BEQ   L031386
         BVS   L03137C
         EOR   #$8000
L03137C  BPL   L031386
         PEA   $0003
         JSL   L0311EE
         PLY
L031386  JSL   L01848A
         JSL   L01842F
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031396  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050084
         AND   #$00FF
         BEQ   L0313B4
         LDA   L0500DC
         BEQ   L0313B4
         JSL   L017CEC
         BRA   L0313D3
L0313B4  LDA   L050084
         AND   #$00FF
         BNE   L0313D3
         LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         PHA
         PEA   $0004
         JSL   L016E1F
         PLY
         PLY
         STZ   L0500DC
L0313D3  LDA   L050084
         AND   #$00FF
         BEQ   L0313E0
         LDA   #$0000
         BRA   L0313E3
L0313E0  LDA   #$0001
L0313E3  SEP   #$20
         STA   L050084
         REP   #$20
         SEP   #$20
         STZ   L050085
         REP   #$20
         LDA   L050084
         AND   #$00FF
         BEQ   L031403
         PEA   $0247
         JSL   L014A79
         PLY
         BRA   L03140B
L031403  PEA   $0247
         JSL   L014AA1
         PLY
L03140B  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031413  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L017FBA
         CMP   #$FFFF
         BEQ   L031431
         PEA   $0248
         JSL   L014A2F
         PLY
         BRA   L031439
L031431  PEA   $0248
         JSL   L014A54
         PLY
L031439  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031441  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         STZ   L050071
         JSL   L017FBA
         STA   L05008C
         LDA   #$0001
         STA   L05006D
         LDA   #$0001
         SEP   #$20
         STA   L050087
         REP   #$20
         JSL   L032568
         JSL   L01561C
         PEA   $0000
         JSL   L0173D8
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03147E  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050045
         BEQ   L031493
         LDA   #$0000
         BRA   L031496
L031493  LDA   #$0001
L031496  STA   L050045
         LDA   L050045
         BEQ   L0314A8
         PEA   $0249
         JSL   L014AA1
         PLY
         BRA   L0314B0
L0314A8  PEA   $0249
         JSL   L014A79
         PLY
L0314B0  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0314B8  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         BEQ   L0314E9
         PEA   $024D
         JSL   L014A2F
         PLY
         PEA   $024A
         JSL   L014A2F
         PLY
         PEA   $024B
         JSL   L014A2F
         PLY
         PEA   $024C
         JSL   L014A2F
         PLY
         BRA   L031509
L0314E9  PEA   $024D
         JSL   L014A54
         PLY
         PEA   $024A
         JSL   L014A54
         PLY
         PEA   $024B
         JSL   L014A54
         PLY
         PEA   $024C
         JSL   L014A54
         PLY
L031509  TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L031511  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEA   $024A
         JSL   L014AA1
         PLY
         PEA   $024B
         JSL   L014AA1
         PLY
         PEA   $024C
         JSL   L014AA1
         PLY
         PEI   $FF
         JSL   L014A79
         PLY
         STZ   L050069
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L031546  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050082
         AND   #$00FF
         BEQ   L031563
         PEA   $024D
         JSL   L014A54
         PLY
         BRA   L031593
L031563  LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L031573
         BVS   L031571
         EOR   #$8000
L031571  BMI   L03158B
L031573  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L03157F
         EOR   #$8000
L03157F  BPL   L03158B
         PEA   $024D
         JSL   L014A2F
         PLY
         BRA   L031593
L03158B  PEA   $024D
         JSL   L014A54
         PLY
L031593  JSL   L031413
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03159F  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L05007D
         CMP   #$0002
         BNE   L0315B4
         BRA   L0315C2
L0315B4  LDA   #$0002
         STA   L05007D
         PEA   $024A
         JSL   L031511
         PLY
L0315C2  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L0315CC  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L05007D
         CMP   #$0003
         BNE   L0315E1
         BRA   L0315EF
L0315E1  LDA   #$0003
         STA   L05007D
         PEA   $024B
         JSL   L031511
         PLY
L0315EF  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L0315F9  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L05007D
         CMP   #$0004
         BNE   L03160E
         BRA   L03161C
L03160E  LDA   #$0004
         STA   L05007D
         PEA   $024C
         JSL   L031511
         PLY
L03161C  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L031626  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L05007D
         LDX   #$0000
         TAY
         BPL   L03163B
         DEX
L03163B  PHX
         PHA
         LDA   #L02002E
         LDX   #^L02002E
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   L050026
         LDA   L05007D
         LDX   #$0000
         TAY
         BPL   L03165F
         DEX
L03165F  PHX
         PHA
         LDA   #L020033
         LDX   #^L020033
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   L050028
         LDA   L05007D
         LDX   #$0000
         TAY
         BPL   L031683
         DEX
L031683  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L020038
         LDX   #^L020038
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         STA   L05002A
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C13
         LDX   #^L022C13
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0001
         SEP   #$20
         STA   [$F6]
         REP   #$20
         AND   #$00FF
         STA   L05008E
         LDA   #$0001
         STA   L05006B
         JSL   L011973
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C13
         LDX   #^L022C13
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         AND   #$00FF
         STA   L05008E
         JSL   L0155F1
         PEA   $0001
         JSL   L0173D8
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03170D  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L0500A2
         CMP   #$0000
         BNE   L03172A
         PEA   $000E
         JSL   L015438
         PLY
         BRA   L031751
L03172A  LDA   L0500A2
         SEC
         SBC   #$0000
         BEQ   L03174D
         BVS   L031738
         EOR   #$8000
L031738  BPL   L03174D
         LDA   L0500A2
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         JSL   L015438
         PLY
         BRA   L031751
L03174D  JSL   L01574B
L031751  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031759  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         STZ   L05006B
         STZ   L05006D
         LDA   #$0001
         STA   L050071
         STZ   L050073
         SEP   #$20
         STZ   L050083
         REP   #$20
         STZ   L0500C6
         JSL   L0308F1
         JSL   L031546
         LDA   #$0001
         STA   $EC
         LDA   L050079
         BEQ   L031793
         JSL   L0151A2
L031793  STZ   L050079
         LDA   L050063
         BEQ   L0317B8
         LDA   L050082
         AND   #$00FF
         BEQ   L0317B8
         LDA   L0500BE
         STA   $EE
         BRA   L0317B1
L0317AA  PEI   $EE
         JSL   L010F6F
         PLY
L0317B1  LDA   $EE
         DEC   $EE
         TAY
         BNE   L0317AA
L0317B8  STZ   L050063
         STZ   L05006F
         STZ   L050065
         LDA   L050088
         BEQ   L0317D3
         LDA   L05008A
         BNE   L0317D3
         PEA   $0004
         JSL   L0371DE
         PLY
L0317D3  STZ   L050088
         STZ   L05008A
L0317D9  LDA   L050075
         BEQ   L0317E9
         PEA   $0000
         JSL   L015054
         PLY
         STZ   L050075
L0317E9  JSL   L01184E
         TAY
         BEQ   L031812
         LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L0317FC
         EOR   #$8000
L0317FC  BMI   L031812
         LDA   L05001A
         BEQ   L031812
         STZ   L0500D4
         JSL   L030000
         LDA   L05005F
         BEQ   L031812
         BRL   L0318E7
L031812  JSL   L014CAA
         TAY
         BNE   L03181D
         JSL   L03170D
L03181D  JSL   L0160EC
         STZ   $EC
         JSL   L01561C
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00F4
         PHA
         JSL   L014E35
         PLY
         PLY
         PLY
         PLY
         STA   $F0
         BRL   L0318AB
L031846  LDA   $F4
         CMP   #$0043
         BEQ   L031854
         LDA   $F4
         CMP   #$0063
         BNE   L03185D
L031854  LDA   #$0001
         STA   L050065
         STZ   L0500C6
L03185D  BRL   L0318B9
L031860  PEI   $F4
         JSL   L031B25
         PLY
         LDA   #$0001
         STA   $EC
         LDA   #$0001
         STA   L050075
         JSL   L01184E
         TAY
         BEQ   L031884
         PEA   $0000
         JSL   L015054
         PLY
         STZ   L050075
L031884  BRL   L0318B9
L031887  LDA   $F4
         STA   L0500C2
         LDA   $F2
         STA   L0500C4
         LDA   #$0001
         STA   L0500C6
         LDA   #$0001
         STA   L050088
         BRL   L0318B9
L0318A0  BRL   L0318B9
L0318A3  DA    L031860
         DA    L031846
         DA    L031887
         DA    L0318A0
L0318AB  DEC
         CMP   #$0003
         BCC   L0318B4
         LDA   #$0003
L0318B4  ASL
         TAX
         JMP   (L0318A3,X)

L0318B9  LDA   $F0
         CMP   #$0003
         BNE   L0318C7
         JSL   L01184E
         TAY
         BEQ   L0318E7
L0318C7  LDA   L05007F
         AND   #$00FF
         BNE   L0318E7
         LDA   L050080
         AND   #$00FF
         BNE   L0318E7
         LDA   L050083
         AND   #$00FF
         BNE   L0318E7
         LDA   L050065
         BNE   L0318E7
         BRL   L0317D9
L0318E7  LDA   L050080
         AND   #$00FF
         PHA
         LDA   L05007F
         AND   #$00FF
         PLX
         STX   $FA
         ORA   $FA
         SEP   #$20
         STA   L05007F
         REP   #$20
         LDA   L05007F
         AND   #$00FF
         BEQ   L031928
         SEP   #$20
         STZ   L050082
         REP   #$20
         JSL   L030702
         LDA   L0500BE
         STA   $EE
         BRA   L031921
L03191A  PEI   $EE
         JSL   L0110DB
         PLY
L031921  LDA   $EE
         DEC   $EE
         TAY
         BNE   L03191A
L031928  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031930  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0001
         STA   $F4
         BRL   L0319F5
L031943  PEI   $F4
         PEA   $000E
         PHA
         PEA   $0000
         PEA   $000E
         _GetColorEntry
         _SetColorEntry
         PEI   $F4
         PEA   $0002
         PHA
         PEA   $0000
         PEA   $0002
         _GetColorEntry
         _SetColorEntry
         PEI   $F4
         PEA   $0004
         PHA
         PEA   $0000
         PEA   $0004
         _GetColorEntry
         _SetColorEntry
         PEI   $F4
         PEA   $0008
         PHA
         PEA   $0000
         PEA   $0008
         _GetColorEntry
         _SetColorEntry
         INC   $F4
L0319F5  LDA   $F4
         SEC
         SBC   #$000F
         BNE   L031A00
         BRL   L031943
L031A00  BVS   L031A05
         EOR   #$8000
L031A05  BMI   L031A0A
         BRL   L031943
L031A0A  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031A12  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0000
         PEA   ^L0225BE
         PEA   L0225BE
         _SetColorTable
         JSL   L031930
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031A42  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0000
         PEA   ^L02259E
         PEA   L02259E
         _SetColorTable
         JSL   L031930
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031A72  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
	 
         JSL   L0326D0
         TAY
         BNE   L031A88
         JSL   L01A6E0
	 
L031A88  JSL   L037AD9
         TAY
         BNE   L031A93

         JSL   L01A6E0

* AV 201601 - Simplify the loading of tools

L031A93  JSL   L033B7D		; Load and start tools
         JSL   L038593		; Do something!
         JSL   L01530B
         JSL   L031AF6

         PEA   $007E
         JSL   L030B71
         PLY
         PEA   $024A
         JSL   L014A79
         PLY
         JSL   L031A12
         _CompactMem
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031AD7  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L0155F1
         JSL   L016038
         JSL   L0336CE
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031AF6  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L01492C
         JSL   L014B34
         JSL   L014AC9
         PEA   $0235
         JSL   L014A79
         PLY
         PEA   $0231
         JSL   L014A79
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L031B25  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   $FF
         STA   L05009A
         STZ   $F2
         BRA   L031B3B
L031B39  INC   $F2
L031B3B  LDA   $F2
         PHA
         LDA   #$0006
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0225DE
         LDX   #^L0225DE
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         CMP   $FF
         BNE   L031B39
         LDA   $F2
         PHA
         LDA   #$0006
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0225DE
         LDX   #^L0225DE
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0004
         LDA   [$F4],Y
         TAX
         LDY   #$0002
         LDA   [$F4],Y
         STA   $F4
         STX   $F6
         LDA   $F4
         LDX   $F6
         JSL   L01A615
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   ^L0226C3
         PEA   L0226C3
         PEA   ^L0226AB
         PEA   L0226AB
         LDA   L05009A
         PHA
         JSL   L03A37E
         PLY
         PHX
         PHA
         PEA   ^L0226AA
         PEA   L0226AA
         JSL   L018845
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

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

         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         JSL   L01574B
         PEA   ^L022A11
         PEA   L022A11
         PEA   ^L022A10
         PEA   L022A10
         PEI   $FF
         PEI   $FD
         PEA   ^L022A0F
         PEA   L022A0F
         JSL   L018845
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L031C2E  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         JSL   L01574B
         PEA   ^L022A13
         PEA   L022A13
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEA   ^L022A12
         PEA   L022A12
         JSL   L018845
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L031C65  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00E8
         TCS
         JSL   L01574B
         PEI   $FF
         PEI   $FD
         PEA   ^L022A14
         PEA   L022A14
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEI   $F5
         JSL   L018845
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         TDC
         CLC
         ADC   #$00EF
         TCS
         PLD
         RTL

L031C9A  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         JSL   L01574B
         PEA   ^L022A17
         PEA   L022A17
         PEA   ^L022A16
         PEA   L022A16
         PEI   $FF
         PEI   $FD
         PEA   ^L022A15
         PEA   L022A15
         JSL   L03A782
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L031CD5  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         JSL   L01574B
         PEA   ^L022A1A
         PEA   L022A1A
         PEA   ^L022A19
         PEA   L022A19
         PEI   $FF
         PEI   $FD
         PEA   ^L022A18
         PEA   L022A18
         JSL   L03A54A
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L031D10  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         LDA   #$000F
         STA   $F0
         LDA   $FD
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         JSL   L0332C2
         PLY
         STA   $EE
         LDA   $EE
         CMP   #$0004
         BNE   L031D3E
         LDA   #$0005
         STA   $EE
L031D3E  LDA   $FF
         BNE   L031D4B
         LDA   $EE
         STA   $F0
         LDA   #$000F
         STA   $EE
L031D4B  PEI   $F0
         _SetSolidPenPat
         PEI   $EE
         _SetSolidBackPat
         PEI   $F0
         _SetForeColor
         PEI   $EE
         _SetBackColor
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L031D9B  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EA
         TCS
         PEA   $0000
         _SetFontFlags
         LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L031DD0
         BVS   L031DC7
         EOR   #$8000
L031DC7  BPL   L031DD0
         LDA   $FF
         AND   #$0002
         BRA   L031DD2
L031DD0  LDA   $FF
L031DD2  TAY
         BEQ   L031DDA
         LDA   #$0000
         BRA   L031DDD
L031DDA  LDA   #$0105
L031DDD  STA   $EE
         LDA   L0500BE
         CMP   #$0002
         BEQ   L031DFA
         LDA   $FF
         CMP   #$0001
         BEQ   L031DF5
         LDA   $FF
         CMP   #$0002
         BNE   L031DFA
L031DF5  LDA   #$00B2
         BRA   L031DFD
L031DFA  LDA   #$0012
L031DFD  STA   $EC
         LDA   $EE
         LDY   #$0002
         STA   [$FB],Y
         PHA
         LDAL  L02296A+2
         TAX
         LDAL  L02296A
         PHX
         PHA
         _CStringWidth
         LDA   $EE
         PLX
         STX   $F4
         CLC
         ADC   $F4
         CLC
         ADC   #$0004
         LDY   #$0006
         STA   [$FB],Y
         LDA   $EC
         STA   [$FB]
         LDA   $EC
         CLC
         ADC   #$000F
         LDY   #$0004
         STA   [$FB],Y
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L031E4A  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         PEI   $FD
         PEI   $FB
         JSL   L031D9B
         PLY
         PLY
         PLY
         LDY   #$0002
         LDA   [$FB],Y
         CLC
         ADC   #$0002
         LDY   #$0002
         STA   [$FB],Y
         LDA   [$FB]
         CLC
         ADC   #$0002
         STA   [$FB]
         LDY   #$0006
         LDA   [$FB],Y
         SEC
         SBC   #$0002
         LDY   #$0006
         STA   [$FB],Y
         LDY   #$0004
         LDA   [$FB],Y
         SEC
         SBC   #$0002
         LDY   #$0004
         STA   [$FB],Y
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L031E9C  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L031D10
         PLY
         PLY
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         JSL   L031D9B
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         _EraseRect
         LDA   $FF
         BEQ   L031EF9
         PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         _FrameRect
L031EF9  PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         JSL   L031E4A
         PLY
         PLY
         PLY
         PEI   $EC
         LDA   $EE
         SEC
         SBC   #$0002
         PHA
         _MoveTo
         LDAL  L02296A+2
         TAX
         LDAL  L02296A
         PHX
         PHA
         _DrawCString
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L031F47  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEA   $0001
         PEI   $FF
         JSL   L031E9C
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L031F65  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EA
         TCS
         PEA   $0000
         PEI   $FF
         JSL   L031D10
         PLY
         PLY
         PEI   $FF
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L031E4A
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         _EraseRect
         PEI   $EE
         LDA   $F0
         SEC
         SBC   #$0002
         PHA
         _MoveTo
         LDAL  L02296A+2
         TAX
         LDAL  L02296A
         PHX
         PHA
         _DrawCString
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L031FE2  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EA
         TCS
         PEI   $FF
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L031D9B
         PLY
         PLY
         PLY
         PEA   $0000
         _SetSolidBackPat
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         _EraseRect
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L032033  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E6
         TCS
         LDA   L050065
         BEQ   L032052
         LDA   $FF
         CMP   L0500A2
         BNE   L032052
         STZ   L050065
         LDA   #$0001
         BRA   L0320B6
L032052  PEI   $FF
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L031E4A
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$00E8
         PHA
         LDA   L0500C2
         PHA
         LDA   L0500C4
         PHA
         _SetPt
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00E8
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         _PtInRect
         PLA
         TAY
         BEQ   L0320B3
         LDA   #$0001
         BRA   L0320B6
         BRA   L0320B6
L0320B3  LDA   #$0000
L0320B6  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L0320C0  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00CC
         TCS
         PHA
         PEA   ^L022A1B
         PEA   L022A1B
         _CStringWidth
         PLA
         STA   $E0
         LDA   #$000B
         STA   $DE
         LDA   L050090
         BEQ   L0320F2
         BRL   L032168
L0320F2  LDA   #$0001
         STA   L050090
         PHX
         PHA
         _GetPort
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $EE
         LDX   $F0
         PHX
         PHA
         PEA   ^L022B16
         PEA   L022B16
         PEA   $00AA
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         LDA   $DE
         PHA
         LDA   $E0
         SEC
         JSL   L019EFD
         JSL   L0198FB
         PLY
         PHA
         TXA
         STAL  L022B1A
         PLA
         STAL  L022B18
         LDA   $E0
         STAL  L022B1C
         PEA   ^L022B1E
         PEA   L022B1E
         PEA   $0000
         PEA   $0000
         PEI   $E0
         PEI   $DE
         _SetRect
L032168  PHX
         PHA
         _GetPort
         PLA
         PLX
         STX   $EC
         STA   $EA
         PEA   ^L022B16
         PEA   L022B16
         _SetPort
         PEA   ^L022B1E
         PEA   L022B1E
         _EraseRect
         PEA   $000F
         _SetForeColor
         PEA   $0000
         _SetBackColor
         LDA   #$0002
         PHA
         PHA
         PEI   $FF
         PEI   $FD
         _CStringWidth
         LDA   $E0
         PLX
         STX   $F2
         SEC
         SBC   $F2
         SEC
         JSL   L019DD9
         PLY
         PHA
         PEA   $000A
         _MoveTo
         PEI   $FF
         PEI   $FD
         _DrawCString
         PEI   $EC
         PEI   $EA
         _SetPort
         LDA   #L022B1E
         LDX   #^L022B1E
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00E2
         PHA
         PEA   $0008
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         LDA   #L022B16
         LDX   #^L022B16
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00CE
         PHA
         PEA   $0010
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         PEA   $0000
         TDC
         CLC
         ADC   #$00CE
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00E2
         PHA
         PEI   $F9
         LDA   $FB
         SEC
         SBC   #$000A
         PHA
         PEA   $0000
         _PPToPort
         TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L0322F6  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         _SetSolidPenPat
         PEI   $FB
         PEI   $FD
         _MoveTo
         PEA   $0000
         PEA   $0000
         _Line
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L032345  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E2
         TCS
         PEI   $FF
         _SetSolidPenPat
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         PEI   $F9
         PEI   $F7
         PEI   $FD
         PEI   $FB
         _SetRect
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         _FrameRect
         TDC
         CLC
         ADC   #$00F1
         TCS
         PLD
         RTL

L0323A4  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEI   $FF
         JSL   L0332C2
         PLY
         PHA
         _SetSolidPenPat
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L0323CF  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00DE
         TCS
         LDA   $FB
         CLC
         ADC   L050098
         STA   $EE
         LDA   $FD
         CLC
         ADC   L05009C
         CLC
         ADC   #$0002
         STA   $EC
         LDA   #$0002
         PHA
         LDA   $EE
         CLC
         ADC   $FB
         SEC
         JSL   L019DD9
         PLY
         STA   $EA
         LDA   #$0002
         PHA
         LDA   $EC
         CLC
         ADC   $FD
         SEC
         JSL   L019DD9
         PLY
         STA   $E8
         LDA   $FF
         BNE   L032478
         PEA   $0000
         TDC
         CLC
         ADC   #$00E0
         PHA
         LDA   $FB
         SEC
         SBC   #$0001
         PHA
         LDA   $FD
         SEC
         SBC   #$0001
         PHA
         LDA   $EE
         CLC
         ADC   #$0001
         PHA
         LDA   $EC
         CLC
         ADC   #$0001
         PHA
         _SetRect
         PEA   $0000
         _SetSolidBackPat
         PEA   $0000
         TDC
         CLC
         ADC   #$00E0
         PHA
         _EraseRect
         BRL   L03255E
L032478  PEI   $FF
         JSL   L0332C2
         PLY
         PHA
         PEI   $EE
         PEI   $EC
         PEI   $FB
         PEI   $FD
         JSL   L032345
         PLY
         PLY
         PLY
         PLY
         PLY
         PEI   $FF
         JSL   L03326D
         PLY
         PHA
         LDA   $EE
         CLC
         ADC   #$0001
         PHA
         LDA   $EC
         CLC
         ADC   #$0001
         PHA
         LDA   $FB
         SEC
         SBC   #$0001
         PHA
         LDA   $FD
         SEC
         SBC   #$0001
         PHA
         JSL   L032345
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   L0500BE
         CMP   #$0002
         BNE   L0324C9
         BRL   L03255E
L0324C9  PEI   $FF
         JSL   L0323A4
         PLY
         PEI   $EA
         LDA   $FD
         SEC
         SBC   #$0064
         BVS   L0324DD
         EOR   #$8000
L0324DD  BMI   L0324E3
         LDA   $FD
         BRA   L0324E5
L0324E3  LDA   $E8
L0324E5  PHA
         _MoveTo
         PEA   $0000
         LDA   #$0002
         PHA
         LDA   L05009C
         SEC
         JSL   L019DD9
         PLY
         PHA
         _Line
         LDA   $FB
         SEC
         SBC   #$0064
         BVS   L032522
         EOR   #$8000
L032522  BMI   L032528
         LDA   $EA
         BRA   L03252A
L032528  LDA   $FB
L03252A  PHA
         PEI   $E8
         _MoveTo
         LDA   #$0002
         PHA
         LDA   L050098
         SEC
         JSL   L019DD9
         PLY
         PHA
         PEA   $0000
         _Line
L03255E  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L032568  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L016161
         LDA   #$0001
         STA   L050079
         JSL   L015727
         JSL   L01561C
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03258D  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FD
         SEC
         SBC   $FF
         BVS   L0325A2
         EOR   #$8000
L0325A2  BMI   L0325AA
         LDA   $FF
         BRA   L0325AC
         BRA   L0325AC
L0325AA  LDA   $FD
L0325AC  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L0325B6  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   #$0000
         STAL  L022BC0
         PEA   ^L0336B1
         PEA   L0336B1
         _SetHeartBeat
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0325E6  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   ^L0336B1
         PEA   L0336B1
         _DelHeartBeat
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03260F  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         JSL   L01920F
         STA   $F4
         LDAL  L022BC0
         BNE   L03264A
         LDX   #$00E0
         LDA   #$C025
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         AND   #$0002
         TAY
         BEQ   L03264A
         LDA   #$0001
         STAL  L022BC0
         PEA   $0007
         JSL   L0371DE
         PLY
L03264A  PEI   $F4
         JSL   L01988F
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L032659  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDAL  L022BC0
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L032672  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022AB1
         LDX   #^L022AB1
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0004
         LDA   [$F4],Y
         PHA
         LDA   $FF
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022AB1
         LDX   #^L022AB1
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0006
         LDA   [$F4],Y
         PLX
         STX   $F8
         SEC
         SBC   $F8
         CLC
         ADC   #$0001
         TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L0326D0  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EC
         TCS
L0326DB  PEA   $0020
         PEA   ^L022AD1
         PEA   L022AD1
         JSL   L01A61D
         PLY
         PLY
         PLY
         STA   $F0
         CMP   #$FFFF
         BNE   L032707
         PEA   ^L022ADA
         PEA   L022ADA
         JSL   L01621F
         PLY
         PLY
         TAY
         BEQ   L032707
         LDA   #$0000
         BRL   L032795
L032707  LDA   $F0
         CMP   #$FFFF
         BEQ   L0326DB
         PEA   $0002
         PEA   $0000
         TDC
         CLC
         ADC   #$00F4
         PHA
         PEI   $F0
         JSL   L01A1C2
         PLY
         PLY
         PLY
         PLY
         PEA   $0002
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         PEI   $F0
         JSL   L01A1C2
         PLY
         PLY
         PLY
         PLY
         LDA   $F2
         SEC
         SBC   $F4
         CLC
         ADC   #$0001
         STA   $EE
         PEA   $0001
         PEA   $0000
         PEA   $0020
         PEI   $F0
         JSL   L03ADA5
         PLY
         PLY
         PLY
         PLY
         LDA   $EE
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         JSL   L0198FB
         PLY
         STX   L0500A0
         STA   L05009E
         LDA   $EE
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         LDX   L0500A0
         LDA   L05009E
         PHX
         PHA
         PEI   $F0
         JSL   L01A1C2
         PLY
         PLY
         PLY
         PLY
         PEI   $F0
         JSL   L019217
         PLY
         LDA   #$0001
L032795  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L03279F  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00DE
         TCS
         PEI   $FB
         JSL   L032672
         PLY
         STA   $E0
         LDA   #$0002
         PHA
         LDA   $FB
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022AB1
         LDX   #^L022AB1
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         SEC
         JSL   L019DD9
         PLY
         LDX   #$0000
         TAY
         BPL   L0327E0
         DEX
L0327E0  PHX
         PHA
         LDA   $FB
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022AB1
         LDX   #^L022AB1
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         PLA
         LDX   #$0000
         TAY
         BPL   L032812
         DEX
L032812  PHX
         PHA
         LDX   L0500A0
         LDA   L05009E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STX   $EE
         STA   $EC
         LDA   #$0002
         PHA
         LDA   $FD
         SEC
         JSL   L019DD9
         PLY
         LDX   #$0000
         TAY
         BPL   L03283D
         DEX
L03283D  PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         PLA
         LDX   #$0000
         TAY
         BPL   L032852
         DEX
L032852  PHX
         PHA
         LDX   #$00E1
         LDA   #$2000
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STX   $EA
         STA   $E8
         LDA   #$0002
         PHA
         LDA   $FB
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022AB1
         LDX   #^L022AB1
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         SEC
         JSL   L019DD9
         PLY
         PHA
         LDA   #$0002
         PHA
         LDA   $FB
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022AB1
         LDX   #^L022AB1
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         SEC
         JSL   L019DD9
         PLY
         PLX
         STX   $F4
         SEC
         SBC   $F4
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L0328CB
         DEX
L0328CB  STX   $E6
         STA   $E4
         STZ   $E2
         BRA   L032919
L0328D3  PEI   $EE
         PEI   $EC
         PEI   $EA
         PEI   $E8
         PEI   $E6
         PEI   $E4
         _BlockMove
         LDA   $E2
         INC   $E2
         LDX   $EE
         LDA   $EC
         CLC
         ADC   #$00A0
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $EE
         STA   $EC
         LDX   $EA
         LDA   $E8
         CLC
         ADC   #$00A0
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $EA
         STA   $E8
L032919  LDA   $E2
         SEC
         SBC   $E0
         BVS   L032923
         EOR   #$8000
L032923  BPL   L0328D3
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L03292D  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FF
         PEI   $FD
         PEA   $0000
         JSL   L03279F
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L03294E  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FF
         PEI   $FD
         PEA   $0001
         JSL   L03279F
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L03296F  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FF
         PEI   $FD
         PEA   $0002
         JSL   L03279F
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L032990  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FF
         PEI   $FD
         PEA   $0003
         JSL   L03279F
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L0329B1  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L01184E
         TAY
         BEQ   L0329CD
         PEA   $0001
         JSL   L01188C
         PLY
         BRA   L0329D1
L0329CD  JSL   L0329D9
L0329D1  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0329D9  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $0009
         PEA   $0000
         PEA   ^L022AE8
         PEA   L022AE8
         PEA   ^L022AE7
         PEA   L022AE7
         PEA   ^L022AE6
         PEA   L022AE6
         PEA   ^L022AE3
         PEA   L022AE3
         JSL   L0180AF
         TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00F4
         PHA
         JSL   L0185B3
         PLY
         PLY
         PLY
         PLY
         LDAL  L022946+2
         TAX
         LDAL  L022946
         PHX
         PHA
         PEA   $0000
         JSL   L018B9D
         PLY
         PLY
         PLY
         LDAL  L02294A+2
         TAX
         LDAL  L02294A
         PHX
         PHA
         PEA   $0001
         JSL   L018B9D
         PLY
         PLY
         PLY
         LDAL  L02294E+2
         TAX
         LDAL  L02294E
         PHX
         PHA
         PEA   $0002
         JSL   L018B9D
         PLY
         PLY
         PLY
         LDA   #$0031
         STA   $F0
         LDA   $F4
         CLC
         ADC   $F0
         PHA
         LDA   $F2
         CLC
         ADC   #$000A
         PHA
         JSL   L03296F
         PLY
         PLY
         LDA   $F0
         CLC
         ADC   #$000F
         PHA
         PEA   $0036
         JSL   L015A12
         PLY
         PLY
         LDAL  L02299A+2
         TAX
         LDAL  L02299A
         PHX
         PHA
         JSL   L015A39
         PLY
         PLY
         PEA   $0002
         JSL   L032672
         PLY
         CLC
         ADC   #$0006
         PHA
         LDA   $F0
         PLX
         STX   $FA
         CLC
         ADC   $FA
         STA   $F0
         LDA   $F0
         CLC
         ADC   $F4
         PHA
         LDA   $F2
         CLC
         ADC   #$000A
         PHA
         JSL   L03292D
         PLY
         PLY
         LDA   $F0
         CLC
         ADC   #$000A
         PHA
         PEA   $0036
         JSL   L015A12
         PLY
         PLY
         LDAL  L02298E+2
         TAX
         LDAL  L02298E
         PHX
         PHA
         JSL   L015A39
         PLY
         PLY
         LDA   $F0
         CLC
         ADC   #$0014
         PHA
         PEA   $0036
         JSL   L015A12
         PLY
         PLY
         LDAL  L022992+2
         TAX
         LDAL  L022992
         PHX
         PHA
         JSL   L015A39
         PLY
         PLY
         PEA   $0000
         JSL   L032672
         PLY
         CLC
         ADC   #$0006
         PHA
         LDA   $F0
         PLX
         STX   $FA
         CLC
         ADC   $FA
         STA   $F0
         LDA   $F4
         CLC
         ADC   $F0
         PHA
         LDA   $F2
         CLC
         ADC   #$000A
         PHA
         JSL   L03294E
         PLY
         PLY
         LDA   $F0
         CLC
         ADC   #$0016
         PHA
         PEA   $0036
         JSL   L015A12
         PLY
         PLY
         LDAL  L022996+2
         TAX
         LDAL  L022996
         PHX
         PHA
         JSL   L015A39
         PLY
         PLY
         LDA   $F4
         CLC
         ADC   $F0
         CLC
         ADC   #$000F
         PHA
         PHA
         LDAL  L022996+2
         TAX
         LDAL  L022996
         PHX
         PHA
         _CStringWidth
         LDA   $F2
         CLC
         ADC   #$0036
         PLX
         STX   $FA
         CLC
         ADC   $FA
         CLC
         ADC   #$0001
         PHA
         JSL   L032990
         PLY
         PLY
         LDA   $F0
         CLC
         ADC   #$0016
         PHA
         LDA   #L022AC9
         LDX   #^L022AC9
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         PHA
         PHA
         LDAL  L022996+2
         TAX
         LDAL  L022996
         PHX
         PHA
         _CStringWidth
         LDA   #$0036
         PLX
         STX   $FA
         CLC
         ADC   $FA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         SEC
         SBCL  L022AC9
         CLC
         ADC   #$0004
         PHA
         JSL   L015A12
         PLY
         PLY
         LDAL  L02299E+2
         TAX
         LDAL  L02299E
         PHX
         PHA
         JSL   L015A39
         PLY
         PLY
         JSL   L01848A
         JSL   L01842F
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L032C10  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L05017C
         BRL   L032C3D
L032C21  LDA   #L022AE9
         LDX   #^L022AE9
         BRL   L032C4F
L032C2A  LDA   #L022AFE
         LDX   #^L022AFE
         BRL   L032C4F
L032C33  LDA   #L022B15
         LDX   #^L022B15
         BRA   L032C4F
         BRA   L032C4F
L032C3D  CMP   #$0009
         BEQ   L032C21
         CMP   #$001C
         BEQ   L032C2A
         CMP   #$001E
         BEQ   L032C21
         JMP   L032C33

L032C4F  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

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

L032C71  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00DF
         TCS
         LDY   #$0002
         LDA   [$FD],Y
         TAX
         LDA   [$FD]
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $F0
         LDY   #$0002
         LDA   [$FD],Y
         TAX
         LDA   [$FD]
         STA   $F2
         STX   $F4
         LDY   #$0001
         LDA   [$F2],Y
         AND   #$00FF
         CLC
         ADC   #$0001
         STA   $EE
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0006
         LDA   [$FD],Y
         TAX
         LDY   #$0004
         LDA   [$FD],Y
         JSL   L01A847
         BNE   L032D0A
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   $F0
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   #$0002
         LDX   #$0000
         TAY
         BPL   L032CDA
         DEX
L032CDA  PHX
         PHA
         LDA   appID
         PHA
         PEA   $0200
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         LDY   #$0006
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0004
         STA   [$FD],Y
         BRA   L032D27
L032D0A  LDY   #$0006
         LDA   [$FD],Y
         TAX
         LDY   #$0004
         LDA   [$FD],Y
         PHX
         PHA
         _RestoreHandle
L032D27  LDA   L050002
         BEQ   L032D3C
         PEA   ^L0255C7
         PEA   L0255C7
         JSL   L0164D1
         PLY
         PLY
         JSL   L031AD7
L032D3C  LDY   #$0006
         LDA   [$FD],Y
         TAX
         LDY   #$0004
         LDA   [$FD],Y
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STX   $E3
         STA   $E1
         LDA   $F0
         SEP   #$20
         STA   [$E1]
         REP   #$20
         LDA   $EE
         SEP   #$20
         LDY   #$0001
         STA   [$E1],Y
         REP   #$20
         LDX   $E3
         LDA   $E1
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E3
         STA   $E1
         LDY   #$0002
         LDA   [$FD],Y
         TAX
         LDA   [$FD]
         STA   $F2
         STX   $F4
         LDX   $F4
         LDA   #$0002
         CLC
         ADC   $F2
         BCC   L032D94
         INX
L032D94  STX   $E7
         STA   $E5
         LDA   #$0001
         STA   $EC
         BRA   L032E1B
L032D9F  SEP   #$20
         STZ   $E9
         REP   #$20
         LDA   #$0001
         STA   $EA
         BRA   L032DF4
L032DAC  LDA   #$0004
         PHA
         LDA   [$E5]
         AND   #$00FF
         SEC
         JSL   L0198D7
         LDA   $E9
         AND   #$00FF
         ASL
         ASL
         ASL
         ASL
         PLX
         STX   $F6
         ORA   $F6
         SEP   #$20
         STA   [$E1]
         REP   #$20
         LDA   [$E5]
         AND   #$00FF
         AND   #$000F
         SEP   #$20
         STA   $E9
         REP   #$20
         LDA   $EA
         INC   $EA
         LDX   $E7
         LDA   $E5
         INC   $E5
         BNE   L032DEA
         INC   $E7
L032DEA  LDX   $E3
         LDA   $E1
         INC   $E1
         BNE   L032DF4
         INC   $E3
L032DF4  LDA   $EE
         SEC
         SBC   #$0001
         SEC
         SBC   $EA
         BVS   L032E02
         EOR   #$8000
L032E02  BMI   L032DAC
         LDA   $E9
         AND   #$00FF
         ASL
         ASL
         ASL
         ASL
         SEP   #$20
         STA   [$E1]
         REP   #$20
         INC   $E1
         BNE   L032E19
         INC   $E3
L032E19  INC   $EC
L032E1B  LDA   $EC
         SEC
         SBC   $F0
         BNE   L032E25
         BRL   L032D9F
L032E25  BVS   L032E2A
         EOR   #$8000
L032E2A  BMI   L032E2F
         BRL   L032D9F
L032E2F  TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L032E37  PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00E4
         TCS
         LDA   [$FD]
         AND   #$00FF
         PHA
         LDY   #$0001
         LDA   [$FD],Y
         AND   #$00FF
         ASL
         ASL
         ASL
         ASL
         PHA
         LDY   #$0002
         LDA   [$FD],Y
         AND   #$00FF
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   #$000C
         PHA
         LDY   #$0003
         LDA   [$FD],Y
         AND   #$00FF
         SEC
         JSL   L019895
         PLA
         PLX
         STX   $EE
         ORA   $EE
         PLX
         STX   $EE
         ORA   $EE
         PLX
         STX   $EE
         ORA   $EE
         LDX   #$0000
         TAY
         BPL   L032E8E
         DEX
L032E8E  STX   $E8
         STA   $E6
         LDA   $F5
         AND   #$0001
         TAY
         BNE   L032E9D
         BRL   L032F88
L032E9D  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0006
         LDA   [$F9],Y
         TAX
         LDY   #$0004
         LDA   [$F9],Y
         JSL   L01A847
         BEQ   L032EDB
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0006
         LDA   [$F9],Y
         TAX
         LDY   #$0004
         LDA   [$F9],Y
         STA   $EA
         STX   $EC
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         JSL   L01A847
         BNE   L032EE5
L032EDB  PEI   $FB
         PEI   $F9
         JSL   L032C71
         PLY
         PLY
L032EE5  PEI   $E8
         PEI   $E6
         LDY   #$0006
         LDA   [$F9],Y
         TAX
         LDY   #$0004
         LDA   [$F9],Y
         STA   $EA
         STX   $EC
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         LDA   #$0002
         PHA
         LDA   $F5
         CLC
         JSL   L019DD9
         PLY
         PHA
         LDA   $F7
         PHA
         LDA   #$00A0
         CLC
         JSL   L019EFD
         LDA   #$2000
         PLX
         STX   $EE
         CLC
         ADC   $EE
         PLX
         STX   $EE
         CLC
         ADC   $EE
         PHA
         LDY   #$0006
         LDA   [$F9],Y
         TAX
         LDY   #$0004
         LDA   [$F9],Y
         STA   $EA
         STX   $EC
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         STA   $EA
         STX   $EC
         LDY   #$0001
         LDA   [$EA],Y
         AND   #$00FF
         PHA
         LDY   #$0006
         LDA   [$F9],Y
         TAX
         LDY   #$0004
         LDA   [$F9],Y
         STA   $EA
         STX   $EC
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         PHA
         JSL   L033539
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         BRA   L033000
L032F88  PEI   $E8
         PEI   $E6
         LDY   #$0002
         LDA   [$F9],Y
         TAX
         LDA   [$F9]
         STA   $EA
         STX   $EC
         LDA   $EA
         LDX   $EC
         CLC
         ADC   #$0002
         BCC   L032FA3
         INX
L032FA3  PHX
         PHA
         LDA   #$0002
         PHA
         LDA   $F5
         CLC
         JSL   L019DD9
         PLY
         PHA
         LDA   $F7
         PHA
         LDA   #$00A0
         CLC
         JSL   L019EFD
         LDA   #$2000
         PLX
         STX   $EE
         CLC
         ADC   $EE
         PLX
         STX   $EE
         CLC
         ADC   $EE
         PHA
         LDY   #$0002
         LDA   [$F9],Y
         TAX
         LDA   [$F9]
         STA   $EA
         STX   $EC
         LDY   #$0001
         LDA   [$EA],Y
         AND   #$00FF
         PHA
         LDY   #$0002
         LDA   [$F9],Y
         TAX
         LDA   [$F9]
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         PHA
         JSL   L033539
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L033000  TDC
         CLC
         ADC   #$00EF
         TCS
         PLD
         RTL

L033008  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E6
         TCS
         LDA   $FF
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   $FF
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   #$000C
         PHA
         LDA   $FF
         CLC
         JSL   L019895
         PLA
         PLX
         STX   $F0
         ORA   $F0
         PLX
         STX   $F0
         ORA   $F0
         ORA   $FF
         LDX   #$0000
         STX   $EA
         STA   $E8
         LDA   $F7
         AND   #$0001
         TAY
         BNE   L03304F
         BRL   L03313A
L03304F  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0006
         LDA   [$FB],Y
         TAX
         LDY   #$0004
         LDA   [$FB],Y
         JSL   L01A847
         BEQ   L03308D
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0006
         LDA   [$FB],Y
         TAX
         LDY   #$0004
         LDA   [$FB],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         JSL   L01A847
         BNE   L033097
L03308D  PEI   $FD
         PEI   $FB
         JSL   L032C71
         PLY
         PLY
L033097  PEI   $EA
         PEI   $E8
         LDY   #$0006
         LDA   [$FB],Y
         TAX
         LDY   #$0004
         LDA   [$FB],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         LDA   #$0002
         PHA
         LDA   $F7
         CLC
         JSL   L019DD9
         PLY
         PHA
         LDA   $F9
         PHA
         LDA   #$00A0
         CLC
         JSL   L019EFD
         LDA   #$2000
         PLX
         STX   $F0
         CLC
         ADC   $F0
         PLX
         STX   $F0
         CLC
         ADC   $F0
         PHA
         LDY   #$0006
         LDA   [$FB],Y
         TAX
         LDY   #$0004
         LDA   [$FB],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDY   #$0001
         LDA   [$EC],Y
         AND   #$00FF
         PHA
         LDY   #$0006
         LDA   [$FB],Y
         TAX
         LDY   #$0004
         LDA   [$FB],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         PHA
         JSL   L033635
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         BRA   L0331B2
L03313A  PEI   $EA
         PEI   $E8
         LDY   #$0002
         LDA   [$FB],Y
         TAX
         LDA   [$FB]
         STA   $EC
         STX   $EE
         LDA   $EC
         LDX   $EE
         CLC
         ADC   #$0002
         BCC   L033155
         INX
L033155  PHX
         PHA
         LDA   #$0002
         PHA
         LDA   $F7
         CLC
         JSL   L019DD9
         PLY
         PHA
         LDA   $F9
         PHA
         LDA   #$00A0
         CLC
         JSL   L019EFD
         LDA   #$2000
         PLX
         STX   $F0
         CLC
         ADC   $F0
         PLX
         STX   $F0
         CLC
         ADC   $F0
         PHA
         LDY   #$0002
         LDA   [$FB],Y
         TAX
         LDA   [$FB]
         STA   $EC
         STX   $EE
         LDY   #$0001
         LDA   [$EC],Y
         AND   #$00FF
         PHA
         LDY   #$0002
         LDA   [$FB],Y
         TAX
         LDA   [$FB]
         STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         PHA
         JSL   L033635
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L0331B2  TDC
         CLC
         ADC   #$00F1
         TCS
         PLD
         RTL

L0331BA  ENT
         PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$00E2
         TCS
         LDA   $F7
         SEP   #$20
         STA   $E4
         REP   #$20
         LDA   $F9
         SEP   #$20
         STA   $E5
         REP   #$20
         LDA   $FD
         SEP   #$20
         STA   $E6
         REP   #$20
         PEI   $F9
         JSL   L03326D
         PLY
         SEP   #$20
         STA   $E7
         REP   #$20
         LDA   $F9
         CMP   #$0001
         BNE   L03320A
         LDA   #$000E
         SEP   #$20
         STA   $E5
         REP   #$20
         LDA   $FD
         CMP   #$0001
         BNE   L03320A
         LDA   #$000E
         SEP   #$20
         STA   $E6
         REP   #$20
L03320A  PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         PEA   ^L025687
         PEA   L025687
         LDA   $F5
         SEC
         SBC   #$0008
         PHA
         LDA   $F3
         SEC
         SBC   #$0009
         PHA
         JSL   L032E37
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TDC
         CLC
         ADC   #$00ED
         TCS
         PLD
         RTL

L03323B  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         PEA   ^L025687
         PEA   L025687
         LDA   $FD
         SEC
         SBC   #$0008
         PHA
         LDA   $FB
         SEC
         SBC   #$0009
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L03326D  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         BRL   L0332AA
L03327D  LDA   #$0007
         BRL   L0332B8
L033283  LDA   #$000B
         BRL   L0332B8
L033289  LDA   #$0005
         BRL   L0332B8
L03328F  LDA   #$000D
         BRL   L0332B8
L033295  BRL   L0332B8
L033298  DA    L03327D
         DA    L033283
         DA    L033295
         DA    L033289
         DA    L033295
         DA    L033295
         DA    L033295
         DA    L03328F
         DA    L033295
L0332AA  DEC
         CMP   #$0008
         BCC   L0332B3
         LDA   #$0008
L0332B3  ASL
         TAX
         JMP   (L033298,X)

L0332B8  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L0332C2  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         CMP   #$0001
         BNE   L0332D9
         LDA   #$000E
         BRA   L0332FC
L0332D9  LDA   $FF
         CMP   #$0007
         BEQ   L0332F5
         LDA   $FF
         CMP   #$000B
         BEQ   L0332F5
         LDA   $FF
         CMP   #$000D
         BEQ   L0332F5
         LDA   $FF
         CMP   #$000E
         BNE   L0332FA
L0332F5  LDA   #$0001
         BRA   L0332FC
L0332FA  LDA   $FF
L0332FC  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L033306  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         JSL   L0332C2
         PLY
         PHA
         PEA   ^L0257D6
         PEA   L0257D6
         LDA   $FD
         SEC
         SBC   #$000C
         PHA
         LDA   $FB
         SEC
         SBC   #$000C
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L03333E  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         JSL   L0332C2
         PLY
         PHA
         PEA   ^L025925
         PEA   L025925
         LDA   $FD
         SEC
         SBC   #$000C
         PHA
         LDA   $FB
         SEC
         SBC   #$000C
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L033376  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         BRL   L033407
L033386  PEI   $FD
         PEA   ^L025952
         PEA   L025952
         PEI   $FB
         LDA   $F9
         SEC
         SBC   #$000D
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L033414
L0333A3  PEI   $FD
         PEA   ^L02595A
         PEA   L02595A
         PEI   $FB
         LDA   $F9
         SEC
         SBC   #$000D
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L033414
L0333C0  PEI   $FD
         PEA   ^L025962
         PEA   L025962
         PEI   $FB
         LDA   $F9
         SEC
         SBC   #$000D
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L033414
L0333DD  PEI   $FD
         PEA   ^L02596A
         PEA   L02596A
         PEI   $FB
         LDA   $F9
         SEC
         SBC   #$000D
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L033414
L0333FA  BRL   L033414
L0333FD  DA    L033386
         DA    L0333A3
         DA    L0333C0
         DA    L0333DD
         DA    L0333FA
L033407  CMP   #$0004
         BCC   L03340F
         LDA   #$0004
L03340F  ASL
         TAX
         JMP   (L0333FD,X)

L033414  TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L03341C  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         BRL   L03349D
L03342C  PEI   $FD
         PEA   ^L0259F8
         PEA   L0259F8
         LDA   $FB
         SEC
         SBC   #$000A
         PHA
         LDA   $F9
         SEC
         SBC   #$0007
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L0334AA
L03344E  PEI   $FD
         PEA   ^L0259F0
         PEA   L0259F0
         LDA   $FB
         SEC
         SBC   #$000A
         PHA
         LDA   $F9
         SEC
         SBC   #$0007
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L0334AA
L033470  PEI   $FD
         PEA   ^L025A00
         PEA   L025A00
         LDA   $FB
         SEC
         SBC   #$000A
         PHA
         LDA   $F9
         SEC
         SBC   #$0007
         PHA
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L0334AA
L033492  BRL   L0334AA
L033495  DA    L03342C
         DA    L03344E
         DA    L033470
         DA    L033492
L03349D  CMP   #$0003
         BCC   L0334A5
         LDA   #$0003
L0334A5  ASL
         TAX
         JMP   (L033495,X)

L0334AA  TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L0334B2  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         BRL   L033524
L0334C2  PEI   $FD
         PEA   ^L025A86
         PEA   L025A86
         LDA   $FB
         SEC
         SBC   #$000A
         PHA
         PEI   $F9
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L033531
L0334DF  PEI   $FD
         PEA   ^L025A8E
         PEA   L025A8E
         LDA   $FB
         SEC
         SBC   #$000A
         PHA
         PEI   $F9
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L033531
L0334FC  PEI   $FD
         PEA   ^L025A96
         PEA   L025A96
         LDA   $FB
         SEC
         SBC   #$000A
         PHA
         PEI   $F9
         JSL   L033008
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L033531
L033519  BRL   L033531
L03351C  DA    L0334DF
         DA    L0334C2
         DA    L0334FC
         DA    L033519
L033524  CMP   #$0003
         BCC   L03352C
         LDA   #$0003
L03352C  ASL
         TAX
         JMP   (L03351C,X)

L033531  TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L033539  PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$00DA
         TCS
         PHB
         LDA   #$00E1
         SEP   #$20
         PHA
         REP   #$20
         PLB
         LDA   $FD
         TAY
         BRL   L033625
L033554  LDA   $F7
         STA   $DC
         LDX   $F5
         BRL   L033615
L03355D  SEP   #$20
         LDA   [$F9]
         BNE   L033566
         BRL   L033608
L033566  AND   #$F0
         BEQ   L0335B3
         LSR
         LSR
         LSR
         LSR
         REP   #$20
         CMP   #$0001
         BEQ   L0335A6
         CMP   #$0002
         BEQ   L03359C
         CMP   #$0003
         BEQ   L03358E
         TYA
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         BRA   L0335AA
L03358E  TYA
         AND   #$0F00
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         BRA   L0335AA
L03359C  TYA
         AND   #$00F0
         LSR
         LSR
         LSR
         LSR
         BRA   L0335AA
L0335A6  TYA
         AND   #$000F
L0335AA  NOP
         SEP   #$20
         ASL
         ASL
         ASL
         ASL
         BRA   L0335B7
L0335B3  LDA   ($DC)
         AND   #$F0
L0335B7  PHA
         LDA   [$F9]
         AND   #$0F
         BEQ   L0335FF
         REP   #$20
         CMP   #$0001
         BEQ   L0335F6
         CMP   #$0002
         BEQ   L0335EC
         CMP   #$0003
         BEQ   L0335DE
         TYA
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         BRA   L0335FA
L0335DE  TYA
         AND   #$0F00
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         BRA   L0335FA
L0335EC  TYA
         AND   #$00F0
         LSR
         LSR
         LSR
         LSR
         BRA   L0335FA
L0335F6  TYA
         AND   #$000F
L0335FA  NOP
         SEP   #$20
         BRA   L033603
L0335FF  LDA   ($DC)
         AND   #$0F
L033603  ORA   $01,S
         STA   ($DC)
         PLA
L033608  REP   #$20
         DEX
         INC   $DC
         LDA   $F9
         INC   $F9
         BNE   L033615
         INC   $FB
L033615  TXA
         BEQ   L03361B
         BRL   L03355D
L03361B  DEC   $F3
         LDA   $F7
         CLC
         ADC   #$00A0
         STA   $F7
L033625  LDA   $F3
         BEQ   L03362C
         BRL   L033554
L03362C  PLB
         TDC
         CLC
         ADC   #$00ED
         TCS
         PLD
         RTL

L033635  PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$00DA
         TCS
         PHB
         LDA   #$00E1
         SEP   #$20
         PHA
         REP   #$20
         PLB
         LDA   $FD
         TAY
         BRL   L0336A1
L033650  LDA   $F7
         STA   $DC
         LDX   $F5
         BRL   L033691
L033659  SEP   #$20
         LDA   [$F9]
         BNE   L033662
         BRL   L033684
L033662  AND   #$F0
         BEQ   L03366B
         TYA
         AND   #$F0
         BRA   L03366F
L03366B  LDA   ($DC)
         AND   #$F0
L03366F  PHA
         LDA   [$F9]
         AND   #$0F
         BEQ   L03367B
         TYA
         AND   #$0F
         BRA   L03367F
L03367B  LDA   ($DC)
         AND   #$0F
L03367F  ORA   $01,S
         STA   ($DC)
         PLA
L033684  REP   #$20
         DEX
         INC   $DC
         LDA   $F9
         INC   $F9
         BNE   L033691
         INC   $FB
L033691  TXA
         BEQ   L033697
         BRL   L033659
L033697  DEC   $F3
         LDA   $F7
         CLC
         ADC   #$00A0
         STA   $F7
L0336A1  LDA   $F3
         BEQ   L0336A8
         BRL   L033650
L0336A8  PLB
         TDC
         CLC
         ADC   #$00ED
         TCS
         PLD
         RTL

         MX    %11
L0336B1  ADRL  $00000000
L0336B5  DW    $0006
         DW    $A55A
*         REP   #$20
         
         rep   #$30

         PHK
         PLB
         LDA   #$0006
         STA   L0336B5
*         SEP   #$20
*         REP   #$30
         JSL   L03260F
         SEP   #$30
         RTL

         MX    %00

L0336CE  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS

         PEA   ^L018815
         PEA   L018815
         _DelHeartBeat

*--- Shut down tools

	PushWord	#25	; Load NoteSynthesize
	_UnloadOneTool
	_SoundShutDown

	PushWord #0		; Reference is by pointer
	lda	SStopREC+2
	pha
	lda	SStopREC
	pha
	_ShutDownTools

* AV 201601 - Dispose our handles & quit safely

	LDA	appID
	PHA
	_DisposeAll

	lda	mainID
	pha
	_DisposeAll
	
	_TLShutDown
	
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0339C2  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         LDA   L050002
         STA   $F0
         TAY
         BEQ   L0339E7
         PEI   $FF
         PEI   $FD
         JSL   L0164D1
         PLY
         PLY
         JSL   L0336CE
         JSL   L01A6E0
L0339E7  TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

* The desktop refresh routine

L033A37  RTL			; AV 201601 This is sufficient

* AV 201601 - Start tools

L033B7D  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EC
         TCS

*--- All tools the modern way

	pha
	pha
	PushWord mainID
	PushWord #0		; Reference is by pointer
	PushLong #StartStop
	_StartUpTools
	pla
	sta	SStopREC
	pla
	sta	SStopREC+2

	PushWord #0
	PushWord #%11111111_11111111
	PushWord #0
	_FlushEvents
	pla

	PushLong #0
	PushWord #5	; SetDeskPat
	PushWord #$4000
	PushWord #$000F
	_Desktop
	pla
	pla

*--- Sound Tool Set

            PEA   $0000
            PEA   $0000
            PEA   $0000
            PEA   $0100		; was $500
            LDA   mainID
            PHA
            PEA   $C005
            PEA   $0000
            PEA   $0000
            _NewHandle
	phd
	tsc
	tcd
	lda   [3]
	pld
	plx
	plx
	pha
            _SoundStartUp

	PushWord	#25	; Load NoteSynthesizer
	PushWord	#0
	_LoadOneTool

*---------- Back to the previous world

         PEA   ^L025B2A
         PEA   L025B2A
         JSL   L0339C2
         PLY
         PLY
         JSL   L037B6A
         JSL   L037951

         PEA   $0780
         PEA   $0000
         PEA   $00E1
         PEA   $2000
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
         PHA
         PEA   $0000
         PEA   $000F
         _GetColorEntry
         PLA
         STA   $EE

         PEA   $0000
         PEA   $000F
         PEA   $0000
         _SetColorEntry

         PEA   $0780
         PEA   $0000
         PEA   $00E1
         PEA   $2000
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         PEA   $000F
         PEI   $EE
         _SetColorEntry

         PEA   $0000		; AV was PEI $F0
         _SetAllSCBs

         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

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

SStopREC	ds	4

StartStop	DW	$0000	; flags
	DW	$0000	; videoMode
	DW	$0000	; resFileID
	ADRL	$00000000	; dPageHandle

	DW	$0012	; number of	tools
	DW	$0003	; misc tool	set
	DW	$0300
	DW	$0004	; quickdraw	II
	DW	$0301
	DW	$0005	; desk manager
	DW	$0302
	DW	$0006	; event manager
	DW	$0300
	DW	$000B	; int math tool set
	DW	$0200
	DW	$000E	; window manager
	DW	$0301
	DW	$000F	; menu manager
	DW	$0301
	DW	$0010	; control manager
	DW	$0301
	DW	$0012	; quickdraw	II aux
	DW	$0301
	DW	$0013	; print manager
	DW	$0300
	DW	$0014	; lineedit tool set
	DW	$0301
	DW	$0015	; dialog manager
	DW	$0301
	DW	$0016	; scrap manager
	DW	$0300
	DW	$0017	; std file tool set
	DW	$0301
	DW	$001B	; font manager
	DW	$0301
	DW	$001C	; list manager
	DW	$0301
	DW	$001E	; resource manager
	DW	$0100
	DW	$0022	; text edit tool set
	DW	$0101

*----------

L033DBD  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         SEC
         SBC   #$0001
         SEP   #$20
         STA   [$F6]
         REP   #$20
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L033E09  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         LDA   L0500A2
         STA   $F4
         LDA   #$0001
         STA   $F2
         LDA   L0500BE
         PHA
         LDA   L0500A2
         CLC
         ADC   #$0001
         SEC
         JSL   L019DD9
         PLA
         STA   L0500A2
L033E32  LDA   L0500A2
         CMP   $F4
         BNE   L033E3C
         BRL   L033EF8
L033E3C  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         SEC
         SBC   #$0000
         BEQ   L033E7D
         BVS   L033E74
         EOR   #$8000
L033E74  BPL   L033E7D
         JSL   L033F0F
         TAY
         BNE   L033EB7
L033E7D  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         SEC
         SBC   #$0000
         BEQ   L033EBD
         BVS   L033EB5
         EOR   #$8000
L033EB5  BPL   L033EBD
L033EB7  LDA   L0500A2
         BRL   L033F05
L033EBD  LDA   $F2
         BEQ   L033EDA
         LDA   L0500E0
         STA   $F0
         LDA   #$0001
         STA   L0500E0
         STZ   $F2
         JSL   L034198
         LDA   $F0
         STA   L0500E0
         BRL   L033E3C
L033EDA  PEA   $0064
         JSL   L016EAD
         PLY
         INC   L0500A2
         LDA   L0500BE
         PHA
         LDA   L0500A2
         SEC
         JSL   L019DD9
         PLA
         STA   L0500A2
         BRL   L033E32
L033EF8  LDA   $F4
         EOR   #$FFFF
         INC
         SEC
         SBC   #$0001
         STA   L0500A2
L033F05  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L033F0F  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         LDA   L0500BE
         SEC
         SBC   #$0004
         BVS   L033F26
         EOR   #$8000
L033F26  BMI   L033F2D
         LDA   #$0001
         BRA   L033F5E
L033F2D  LDA   #$0009
         STA   $F4
         BRA   L033F54
L033F34  LDA   #$0009
         STA   $F2
         BRA   L033F4D
L033F3B  PEI   $F2
         PEI   $F4
         JSL   L036AD6
         PLY
         PLY
         TAY
         BEQ   L033F4D
         LDA   #$0001
         BRA   L033F5E
L033F4D  LDA   $F2
         DEC   $F2
         TAY
         BNE   L033F3B
L033F54  LDA   $F4
         DEC   $F4
         TAY
         BNE   L033F34
         LDA   #$0000
L033F5E  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L033F68  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EC
         TCS
         STZ   L0500A2
         STZ   L050032
         STZ   $F4
         BRL   L03402F
L033F7E  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$000E
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CA7
         LDX   #^L022CA7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   L0500BE
         STA   $F2
         BRA   L034026
L033FE5  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
L034026  LDA   $F2
         DEC   $F2
         TAY
         BNE   L033FE5
         INC   $F4
L03402F  LDA   $F4
         SEC
         SBC   L0500BE
         BVS   L03403A
         EOR   #$8000
L03403A  BMI   L03403F
         BRL   L033F7E
L03403F  STZ   $F2
         BRL   L0340E8
L034044  STZ   $F0
         BRL   L0340D6
L034049  LDA   L05003C
         BEQ   L034085
         LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022FE7
         LDX   #^L022FE7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0009
         SEP   #$20
         STA   [$F6]
         REP   #$20
L034085  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0008
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $F0
L0340D6  LDA   $F0
         SEC
         SBC   #$0009
         BVS   L0340E1
         EOR   #$8000
L0340E1  BMI   L0340E6
         BRL   L034049
L0340E6  INC   $F2
L0340E8  LDA   $F2
         SEC
         SBC   #$0009
         BVS   L0340F3
         EOR   #$8000
L0340F3  BMI   L0340F8
         BRL   L034044
L0340F8  STZ   L05003C
         SEP   #$20
         STZ   L050082
         REP   #$20
         LDA   L050080
         AND   #$00FF
         BEQ   L03410D
         BRL   L034190
L03410D  LDA   L0500DE
         AND   #$00FF
         BEQ   L034118
         BRL   L034190
L034118  JSL   L017053
         LDA   L050061
         AND   #$00FF
         PHA
         LDA   #$006C
         PLX
         STX   $FA
         CLC
         ADC   $FA
         PHA
         JSL   L016EAD
         PLY
         LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L034142
         BVS   L034140
         EOR   #$8000
L034140  BMI   L03414B
L034142  LDAL  L022C14
         AND   #$00FF
         BEQ   L03415A
L03414B  LDA   #$007E
         SEC
         SBC   L0500BE
         PHA
         JSL   L016EAD
         PLY
         BRA   L034162
L03415A  PEA   $007D
         JSL   L016EAD
         PLY
L034162  LDAL  L022C13
         AND   #$00FF
         BNE   L034174
         LDAL  L022C14
         AND   #$00FF
         BEQ   L03417F
L034174  LDA   #$0001
         SEP   #$20
         STAL  L022C14
         REP   #$20
L03417F  LDA   #$0000
         SEP   #$20
         STAL  L022C13
         REP   #$20
         LDA   #$0001
         STA   L05002C
L034190  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L034198  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00DE
         TCS
         LDA   L050081
         AND   #$00FF
         BEQ   L0341B3
         LDA   L050087
         AND   #$00FF
         BEQ   L0341BB
L0341B3  LDA   L050080
         AND   #$00FF
         BEQ   L0341CA
L0341BB  LDA   L0500E0
         BNE   L0341CA
         JSL   L01184E
         TAY
         BNE   L0341CA
         BRL   L034494
L0341CA  STZ   $E0
         BRA   L034200
L0341CE  LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $E0
L034200  LDA   $E0
         SEC
         SBC   L0500BE
         BVS   L03420B
         EOR   #$8000
L03420B  BPL   L0341CE
         LDA   L0500A4
         CMP   #$0000
         BNE   L034229
         PEA   $0051
         PEA   $0000
         PEA   ^L023038
         PEA   L023038
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
L034229  LDA   #$0002
         STA   $E6
         BRL   L03434D
L034231  LDA   $E6
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDX   $F8
         LDA   #$0006
         CLC
         ADC   $F6
         BCC   L034275
         INX
L034275  STX   $F4
         STA   $F2
         LDA   #$0007
         STA   $E8
         BRL   L034341
L034281  LDA   [$F2]
         AND   #$00FF
         STA   $E2
         SEC
         SBC   L0500BE
         BVS   L034291
         EOR   #$8000
L034291  BPL   L034296
         BRL   L034339
L034296  LDX   $F4
         LDA   $F2
         SEC
         SBC   #$0012
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         STX   $F0
         STA   $EE
         LDX   $F4
         LDA   $F2
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $EC
         STA   $EA
         LDA   #$0002
         STA   $E4
         BRA   L03432A
L0342C3  LDA   $E8
         CLC
         ADC   $E4
         SEC
         SBC   #$0008
         BEQ   L0342D5
         BVS   L0342D3
         EOR   #$8000
L0342D3  BMI   L0342E1
L0342D5  LDA   $E6
         SEC
         SBC   $E4
         BVS   L0342DF
         EOR   #$8000
L0342DF  BMI   L0342E3
L0342E1  BRA   L034309
L0342E3  LDA   [$EE]
         AND   #$00FF
         CMP   $E2
         BEQ   L0342EE
         BRA   L034309
L0342EE  LDA   [$EA]
         AND   #$00FF
         CMP   $E2
         BEQ   L0342F9
         BRA   L034309
L0342F9  PEI   $E2
         PEI   $E4
         PEI   $E6
         PEI   $E8
         JSL   L03449E
         PLY
         PLY
         PLY
         PLY
L034309  LDA   $E4
         INC   $E4
         LDX   $F0
         LDA   $EE
         SEC
         SBC   #$0009
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         STX   $F0
         STA   $EE
         LDX   $EC
         LDA   $EA
         INC   $EA
         BNE   L03432A
         INC   $EC
L03432A  LDA   $E4
         SEC
         SBC   #$0006
         BEQ   L0342C3
         BVS   L034337
         EOR   #$8000
L034337  BPL   L0342C3
L034339  LDA   $F2
         BNE   L03433F
         DEC   $F4
L03433F  DEC   $F2
L034341  LDA   $E8
         DEC   $E8
         TAY
         BEQ   L03434B
         BRL   L034281
L03434B  INC   $E6
L03434D  LDA   $E6
         SEC
         SBC   #$0008
         BNE   L034358
         BRL   L034231
L034358  BVS   L03435D
         EOR   #$8000
L03435D  BMI   L034362
         BRL   L034231
L034362  LDA   #$0007
         STA   $E6
         BRL   L03448A
L03436A  LDA   $E6
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDX   $F8
         LDA   #$0006
         CLC
         ADC   $F6
         BCC   L0343AE
         INX
L0343AE  STX   $F4
         STA   $F2
         LDA   #$0007
         STA   $E8
         BRL   L034480
L0343BA  LDA   [$F2]
         AND   #$00FF
         STA   $E2
         SEC
         SBC   L0500BE
         BVS   L0343CA
         EOR   #$8000
L0343CA  BPL   L0343CF
         BRL   L034478
L0343CF  LDX   $F4
         LDA   $F2
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $F0
         STA   $EE
         LDX   $F0
         LDA   $EE
         CLC
         ADC   #$0012
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $EC
         STA   $EA
         LDA   #$0002
         STA   $E4
         BRA   L034469
L0343FC  LDA   $E8
         CLC
         ADC   $E4
         SEC
         SBC   #$0008
         BEQ   L03440E
         BVS   L03440C
         EOR   #$8000
L03440C  BMI   L034420
L03440E  LDA   $E6
         CLC
         ADC   $E4
         SEC
         SBC   #$0008
         BEQ   L034422
         BVS   L03441E
         EOR   #$8000
L03441E  BPL   L034422
L034420  BRA   L034448
L034422  LDA   [$EE]
         AND   #$00FF
         CMP   $E2
         BEQ   L03442D
         BRA   L034448
L03442D  LDA   [$EA]
         AND   #$00FF
         CMP   $E2
         BEQ   L034438
         BRA   L034448
L034438  PEI   $E2
         PEI   $E4
         PEI   $E6
         PEI   $E8
         JSL   L034727
         PLY
         PLY
         PLY
         PLY
L034448  LDA   $E4
         INC   $E4
         LDX   $F0
         LDA   $EE
         INC   $EE
         BNE   L034456
         INC   $F0
L034456  LDX   $EC
         LDA   $EA
         CLC
         ADC   #$000A
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $EC
         STA   $EA
L034469  LDA   $E4
         SEC
         SBC   #$0006
         BEQ   L0343FC
         BVS   L034476
         EOR   #$8000
L034476  BPL   L0343FC
L034478  LDA   $F2
         BNE   L03447E
         DEC   $F4
L03447E  DEC   $F2
L034480  LDA   $E8
         DEC   $E8
         TAY
         BEQ   L03448A
         BRL   L0343BA
L03448A  LDA   $E6
         DEC   $E6
         TAY
         BEQ   L034494
         BRL   L03436A
L034494  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L03449E  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00D2
         TCS
         STZ   $E0
         LDA   #$0001
         STA   $E8
         LDA   $F9
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $FB
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STX   $DA
         STA   $D8
         LDA   #$0001
         STA   $EC
         BRA   L03455E
L034501  LDX   $DA
         LDA   $D8
         STX   $D6
         STA   $D4
         LDA   $EC
         CLC
         ADC   #$0001
         STA   $EA
         BRA   L034549
L034513  LDA   [$D4]
         AND   #$00FF
         STA   $E6
         LDA   $E6
         CMP   $FF
         BNE   L034524
         INC   $E0
         BRA   L034536
L034524  LDA   $E6
         SEC
         SBC   L0500BE
         BVS   L03452F
         EOR   #$8000
L03452F  BMI   L034536
         LDA   #$0010
         STA   $E8
L034536  LDX   $D6
         LDA   $D4
         SEC
         SBC   #$000A
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         STX   $D6
         STA   $D4
L034549  LDA   $EA
         DEC   $EA
         TAY
         BNE   L034513
         LDA   $EC
         INC   $EC
         LDX   $DA
         LDA   $D8
         INC   $D8
         BNE   L03455E
         INC   $DA
L03455E  LDA   $EC
         SEC
         SBC   $FD
         BEQ   L034501
         BVS   L03456A
         EOR   #$8000
L03456A  BPL   L034501
         LDA   L0500A4
         CMP   #$0000
         BEQ   L034577
         BRL   L0345EA
L034577  LDA   $FF
         PHA
         LDA   $E8
         SEC
         JSL   L019895
         PLA
         STA   $E2
         LDA   $FD
         CLC
         ADC   #$0001
         STA   $EC
         BRA   L0345E3
L03458E  LDA   $EC
         CLC
         ADC   #$0001
         STA   $EA
         BRA   L0345DC
L034598  LDA   $F9
         CLC
         ADC   $EA
         LDX   #$0000
         PHX
         PHA
         LDA   $FB
         SEC
         SBC   $EC
         CLC
         ADC   $EA
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L023038
         LDX   #^L023038
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         ORA   $E2
         SEP   #$20
         STA   [$EE]
         REP   #$20
L0345DC  LDA   $EA
         DEC   $EA
         TAY
         BNE   L034598
L0345E3  LDA   $EC
         DEC   $EC
         TAY
         BNE   L03458E
L0345EA  LDA   $E8
         CMP   #$0001
         BNE   L0345F4
         BRL   L03471D
L0345F4  LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         INC
         SEP   #$20
         STA   [$EE]
         REP   #$20
         PLA
         AND   #$00FF
         STA   $E4
         LDA   $E4
         SEC
         SBC   #$0020
         BVS   L034636
         EOR   #$8000
L034636  BPL   L03464C
         PEA   ^L020058
         PEA   L020058
         JSL   L018845
         PLY
         PLY
         PEA   $0001
         JSL   L01A6E0
         PLY
L03464C  LDA   $F9
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $FB
         PHA
         LDA   $E4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STX   $DE
         STA   $DC
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $F9
         CLC
         ADC   $FD
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $FB
         PHA
         INC   $DC
         BNE   L0346C8
         INC   $DE
L0346C8  LDX   $DE
         LDA   $DC
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $FB
         SEC
         SBC   $FD
         PHA
         LDA   $F9
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $F2
         CLC
         ADC   $F2
         PHA
         INC   $DC
         BNE   L0346F6
         INC   $DE
L0346F6  LDX   $DE
         LDA   $DC
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $E0
         PHA
         INC   $DC
         BNE   L03470E
         INC   $DE
L03470E  LDX   $DE
         LDA   $DC
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
L03471D  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L034727  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00D2
         TCS
         STZ   $E0
         LDA   #$0001
         STA   $E8
         LDA   $F9
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $FB
         CLC
         ADC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STX   $DA
         STA   $D8
         LDA   #$0001
         STA   $EC
         BRA   L0347F4
L03478E  LDX   $DA
         LDA   $D8
         STX   $D6
         STA   $D4
         LDA   $EC
         CLC
         ADC   #$0001
         STA   $EA
         BRA   L0347D6
L0347A0  LDA   [$D4]
         AND   #$00FF
         STA   $E6
         LDA   $E6
         CMP   $FF
         BNE   L0347B1
         INC   $E0
         BRA   L0347C3
L0347B1  LDA   $E6
         SEC
         SBC   L0500BE
         BVS   L0347BC
         EOR   #$8000
L0347BC  BMI   L0347C3
         LDA   #$0010
         STA   $E8
L0347C3  LDX   $D6
         LDA   $D4
         SEC
         SBC   #$0009
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         STX   $D6
         STA   $D4
L0347D6  LDA   $EA
         DEC   $EA
         TAY
         BNE   L0347A0
         LDA   $EC
         INC   $EC
         LDX   $DA
         LDA   $D8
         CLC
         ADC   #$000A
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $DA
         STA   $D8
L0347F4  LDA   $EC
         SEC
         SBC   $FD
         BEQ   L03478E
         BVS   L034800
         EOR   #$8000
L034800  BPL   L03478E
         LDA   L0500A4
         CMP   #$0000
         BEQ   L03480D
         BRL   L03487D
L03480D  LDA   $FF
         PHA
         LDA   $E8
         SEC
         JSL   L019895
         PLA
         STA   $E2
         LDA   $FD
         CLC
         ADC   #$0001
         STA   $EC
         BRA   L034876
L034824  LDA   $EC
         CLC
         ADC   #$0001
         STA   $EA
         BRA   L03486F
L03482E  LDA   $F9
         CLC
         ADC   $EC
         LDX   #$0000
         PHX
         PHA
         LDA   $FB
         CLC
         ADC   $EA
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L023038
         LDX   #^L023038
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         ORA   $E2
         SEP   #$20
         STA   [$EE]
         REP   #$20
L03486F  LDA   $EA
         DEC   $EA
         TAY
         BNE   L03482E
L034876  LDA   $EC
         DEC   $EC
         TAY
         BNE   L034824
L03487D  LDA   $E8
         CMP   #$0001
         BNE   L034887
         BRL   L0349B3
L034887  LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         INC
         SEP   #$20
         STA   [$EE]
         REP   #$20
         PLA
         AND   #$00FF
         STA   $E4
         LDA   $E4
         SEC
         SBC   #$0020
         BVS   L0348C9
         EOR   #$8000
L0348C9  BPL   L0348DF
         PEA   ^L02006B
         PEA   L02006B
         JSL   L018845
         PLY
         PLY
         PEA   $0001
         JSL   L01A6E0
         PLY
L0348DF  LDA   $F9
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $FB
         PHA
         LDA   $E4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STX   $DE
         STA   $DC
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $F9
         CLC
         ADC   $FD
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $FB
         PHA
         INC   $DC
         BNE   L03495B
         INC   $DE
L03495B  LDX   $DE
         LDA   $DC
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $FB
         CLC
         ADC   $FD
         PHA
         LDA   $F9
         CLC
         ADC   $FD
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $F2
         CLC
         ADC   $F2
         PHA
         INC   $DC
         BNE   L03498C
         INC   $DE
L03498C  LDX   $DE
         LDA   $DC
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $E0
         PHA
         INC   $DC
         BNE   L0349A4
         INC   $DE
L0349A4  LDX   $DE
         LDA   $DC
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
L0349B3  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L0349BD  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00C5
         TCS
         LDA   L0500A4
         SEC
         SBC   #$0000
         BEQ   L0349D8
         BVS   L0349D6
         EOR   #$8000
L0349D6  BMI   L0349F0
L0349D8  LDA   L050081
         AND   #$00FF
         BEQ   L0349E8
         LDA   L050087
         AND   #$00FF
         BEQ   L0349F0
L0349E8  LDA   L050080
         AND   #$00FF
         BEQ   L0349FF
L0349F0  LDA   L0500E0
         BNE   L0349FF
         JSL   L01184E
         TAY
         BNE   L0349FF
         BRL   L0354FE
L0349FF  JSL   L0155F1
         STZ   $F0
         BRL   L0354C2
L034A08  STZ   $EE
         BRL   L0354B0
L034A0D  STZ   $E8
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L034A4A
         BRL   L0354AE
L034A4A  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022FE7
         LDX   #^L022FE7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEP   #$20
         STA   $DF
         REP   #$20
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEP   #$20
         STA   $DE
         REP   #$20
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022FE7
         LDX   #^L022FE7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L023089
         LDX   #^L023089
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEP   #$20
         STA   $DD
         REP   #$20
         LDA   L050062
         AND   #$00FF
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L023038
         LDX   #^L023038
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         SEP   #$20
         STA   $DC
         REP   #$20
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L023089
         LDX   #^L023089
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $DD
         AND   #$00FF
         PHA
         LDA   $DC
         AND   #$00FF
         PLX
         STX   $F6
         CMP   $F6
         BNE   L034BCC
         LDA   #$0000
         BRA   L034BCF
L034BCC  LDA   #$0001
L034BCF  STA   $F4
         LDA   $DF
         AND   #$00FF
         PHA
         LDA   $DE
         AND   #$00FF
         PLX
         STX   $F6
         CMP   $F6
         BNE   L034BE8
         LDA   #$0000
         BRA   L034BEB
L034BE8  LDA   #$0001
L034BEB  STA   $F2
         LDA   $F4
         BNE   L034BF8
         LDA   $F2
         BNE   L034BF8
         BRL   L0354AE
L034BF8  LDA   $EE
         PHA
         LDA   #$000D
         SEC
         JSL   L019EFD
         LDA   $F0
         PHA
         LDA   #$001A
         SEC
         JSL   L019EFD
         LDA   L0500A6
         PLX
         STX   $FA
         CLC
         ADC   $FA
         PLX
         STX   $FA
         SEC
         SBC   $FA
         STA   $EC
         LDA   $EE
         PHA
         LDA   #$0013
         SEC
         JSL   L019EFD
         LDA   L0500A8
         PLX
         STX   $FA
         CLC
         ADC   $FA
         STA   $EA
         LDA   $F2
         BEQ   L034C60
         LDA   $DE
         AND   #$00FF
         CMP   #$0008
         BNE   L034C60
         LDA   $DF
         AND   #$00FF
         CMP   #$0009
         BEQ   L034C60
         PEA   $0000
         PEI   $EA
         PEI   $EC
         JSL   L03323B
         PLY
         PLY
         PLY
         LDA   #$0001
         STA   $F4
L034C60  LDA   $F4
         BNE   L034C71
         LDA   $DF
         AND   #$00FF
         CMP   #$0009
         BEQ   L034C71
         BRL   L035471
L034C71  LDA   #$0004
         PHA
         LDA   $DC
         AND   #$00FF
         SEC
         JSL   L0198D7
         PLA
         STA   $E4
         LDA   $DC
         AND   #$00FF
         AND   #$000F
         ORA   $E4
         STA   $E6
         LDA   $EC
         AND   #$0001
         CLC
         ADC   #$0002
         SEP   #$20
         STA   L05003E
         REP   #$20
         LDA   $DC
         AND   #$00FF
         AND   #$00F0
         PHA
         LDA   $DD
         AND   #$00FF
         AND   #$00F0
         PLX
         STX   $F6
         CMP   $F6
         BNE   L034CDA
         LDA   $F2
         BEQ   L034CD5
         LDA   $DE
         AND   #$00FF
         CMP   #$0008
         BNE   L034CD5
         LDA   $DF
         AND   #$00FF
         CMP   #$0009
         BEQ   L034CD5
         LDA   $E4
         CMP   #$0000
         BNE   L034CDA
L034CD5  LDA   #$0000
         BRA   L034CDD
L034CDA  LDA   #$0001
L034CDD  STA   $E8
         LDA   $E8
         BEQ   L034CF3
         LDA   $E6
         CMP   $E4
         BNE   L034CEE
         LDA   #$0000
         BRA   L034CF1
L034CEE  LDA   #$0001
L034CF1  BRA   L034D39
L034CF3  LDA   #$0004
         PHA
         LDA   $DD
         AND   #$00FF
         SEC
         JSL   L0198D7
         LDA   $DD
         AND   #$00FF
         AND   #$000F
         PLX
         STX   $FA
         ORA   $FA
         PHA
         LDA   #$0004
         PHA
         LDA   $DC
         AND   #$00FF
         SEC
         JSL   L0198D7
         LDA   $DC
         AND   #$00FF
         AND   #$000F
         PLX
         STX   $FA
         ORA   $FA
         PLX
         STX   $F6
         CMP   $F6
         BNE   L034D36
         LDA   #$0000
         BRA   L034D39
L034D36  LDA   #$0001
L034D39  SEP   #$20
         STA   $DB
         REP   #$20
         LDA   $E8
         BEQ   L034D83
         LDA   L05003A
         BNE   L034D56
         LDA   $E4
         CMP   #$0000
         BEQ   L034D60
         LDA   $DB
         AND   #$00FF
         BNE   L034D60
L034D56  PEA   $0002
         JSL   L0371DE
         PLY
         BRA   L034D76
L034D60  LDA   $E4
         CMP   #$0000
         BNE   L034D76
         LDA   $DB
         AND   #$00FF
         BNE   L034D76
         PEA   $0003
         JSL   L0371DE
         PLY
L034D76  PEI   $E4
         PEI   $EA
         PEI   $EC
         JSL   L03333E
         PLY
         PLY
         PLY
L034D83  LDA   $DB
         AND   #$00FF
         BEQ   L034DA4
         LDA   L05003A
         BNE   L034DA4
         PEA   $0003
         JSL   L0371DE
         PLY
         PEI   $E6
         PEI   $EA
         PEI   $EC
         JSL   L033306
         PLY
         PLY
         PLY
L034DA4  LDA   $F0
         CMP   #$0000
         BEQ   L034DB7
         LDA   $EE
         CMP   #$0000
         BEQ   L034DB7
         LDA   #$0000
         BRA   L034DBA
L034DB7  LDA   #$0001
L034DBA  STA   $CB
         LDA   $F0
         CMP   #$0008
         BEQ   L034DCF
         LDA   $EE
         CMP   #$0008
         BEQ   L034DCF
         LDA   #$0000
         BRA   L034DD2
L034DCF  LDA   #$0001
L034DD2  STA   $C9
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $D9
         LDA   $F0
         CMP   #$0008
         BNE   L034E15
         LDA   #$0000
         BRA   L034E4C
L034E15  LDA   $F0
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
L034E4C  STA   $D7
         LDA   $F0
         CMP   #$0000
         BNE   L034E5A
         LDA   #$0000
         BRA   L034E91
L034E5A  LDA   $F0
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
L034E91  STA   $D5
         LDA   $CB
         BEQ   L034E9C
         LDA   #$0000
         BRA   L034ED7
L034E9C  LDA   $F0
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         SEC
         SBC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
L034ED7  STA   $D1
         LDA   $EE
         CMP   #$0000
         BNE   L034EE5
         LDA   #$0000
         BRA   L034F1C
L034EE5  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         SEC
         SBC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
L034F1C  STA   $D3
         LDA   $EE
         CMP   #$0008
         BNE   L034F2A
         LDA   #$0000
         BRA   L034F61
L034F2A  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         CLC
         ADC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
L034F61  STA   $CD
         LDA   $C9
         BEQ   L034F6C
         LDA   #$0000
         BRA   L034FA7
L034F6C  LDA   $F0
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         CLC
         ADC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
L034FA7  STA   $CF
         LDA   $E4
         CMP   #$000F
         BNE   L034FB5
         LDA   #$0000
         BRA   L034FB8
L034FB5  LDA   #$000F
L034FB8  STA   $E8
         LDA   $D9
         SEC
         SBC   #$0001
         BEQ   L035018
         BVS   L034FC7
         EOR   #$8000
L034FC7  BPL   L035018
         LDA   $D7
         SEC
         SBC   #$0001
         BEQ   L035018
         BVS   L034FD6
         EOR   #$8000
L034FD6  BPL   L035018
         PEA   $0001
         PEI   $E8
         PEI   $EA
         LDA   $EC
         CLC
         ADC   #$000D
         PHA
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
         PEA   $0001
         PEI   $E8
         LDA   $EE
         BEQ   L034FFF
         LDA   $EA
         CLC
         ADC   #$0002
         BRA   L035005
L034FFF  LDA   $EA
         SEC
         SBC   #$0002
L035005  PHA
         LDA   $EC
         CLC
         ADC   #$000D
         PHA
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
         BRL   L0350BE
L035018  LDA   $D7
         CMP   #$0000
         BNE   L035022
         BRL   L0350BE
L035022  LDA   $E8
         CMP   #$0000
         BNE   L035050
         LDA   $EE
         AND   #$0001
         TAY
         BEQ   L035036
         LDA   #$0003
         BRA   L035039
L035036  LDA   #$0001
L035039  PHA
         PEI   $E8
         PEI   $EA
         LDA   $EC
         CLC
         ADC   #$000D
         PHA
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
         BRL   L0350BE
L035050  LDA   #$0004
         PHA
         LDA   L050062
         AND   #$00FF
         PHA
         LDA   $F0
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L023038
         LDX   #^L023038
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         SEC
         JSL   L0198D7
         PLA
         CMP   #$000F
         BNE   L0350A7
         LDA   #$0002
         BRA   L0350AA
L0350A7  LDA   #$0001
L0350AA  PHA
         PEI   $E8
         PEI   $EA
         LDA   $EC
         CLC
         ADC   #$000D
         PHA
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
L0350BE  LDA   $D9
         SEC
         SBC   #$0001
         BEQ   L035112
         BVS   L0350CB
         EOR   #$8000
L0350CB  BPL   L035112
         LDA   $D5
         SEC
         SBC   #$0001
         BEQ   L035112
         BVS   L0350DA
         EOR   #$8000
L0350DA  BPL   L035112
         PEA   $0001
         PEI   $E8
         PEI   $EA
         PEI   $EC
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
         PEA   $0001
         PEI   $E8
         LDA   $EE
         BEQ   L0350FE
         LDA   $EA
         CLC
         ADC   #$0002
         BRA   L035104
L0350FE  LDA   $EA
         SEC
         SBC   #$0002
L035104  PHA
         PEI   $EC
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
         BRL   L0351AD
L035112  LDA   $D5
         CMP   #$0000
         BNE   L03511C
         BRL   L0351AD
L03511C  LDA   $E8
         CMP   #$0000
         BNE   L035137
         PEA   $0001
         PEI   $E8
         PEI   $EA
         PEI   $EC
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
         BRL   L0351AD
L035137  LDA   #$0004
         PHA
         LDA   L050062
         AND   #$00FF
         PHA
         LDA   $F0
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L023038
         LDX   #^L023038
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         SEC
         JSL   L0198D7
         PLA
         CMP   #$000F
         BNE   L03519C
         PEA   $0000
         PEI   $E8
         PEI   $EA
         PEI   $EC
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
         BRA   L0351AD
L03519C  PEA   $0001
         PEI   $E8
         PEI   $EA
         PEI   $EC
         JSL   L033376
         PLY
         PLY
         PLY
         PLY
L0351AD  LDA   $CF
         CMP   #$0000
         BEQ   L03522C
         LDA   $D9
         SEC
         SBC   #$0001
         BEQ   L035211
         BVS   L0351C1
         EOR   #$8000
L0351C1  BPL   L035211
         LDA   $CF
         SEC
         SBC   #$0001
         BEQ   L035211
         BVS   L0351D0
         EOR   #$8000
L0351D0  BPL   L035211
         LDA   $CD
         CMP   #$0000
         BEQ   L0351F6
         PEA   $0001
         PEI   $E8
         LDA   $EA
         CLC
         ADC   #$000B
         PHA
         LDA   $EC
         CLC
         ADC   #$0009
         PHA
         JSL   L03341C
         PLY
         PLY
         PLY
         PLY
         BRA   L035211
L0351F6  PEA   $0001
         PEI   $E8
         LDA   $EA
         CLC
         ADC   #$000B
         PHA
         LDA   $EC
         CLC
         ADC   #$0005
         PHA
         JSL   L03341C
         PLY
         PLY
         PLY
         PLY
L035211  PEA   $0002
         PEI   $E8
         LDA   $EA
         CLC
         ADC   #$000B
         PHA
         LDA   $EC
         CLC
         ADC   #$0007
         PHA
         JSL   L03341C
         PLY
         PLY
         PLY
         PLY
L03522C  LDA   $CD
         CMP   #$0000
         BNE   L035236
         BRL   L03532B
L035236  LDA   $D9
         SEC
         SBC   #$0001
         BEQ   L035293
         BVS   L035243
         EOR   #$8000
L035243  BPL   L035293
         LDA   $CD
         SEC
         SBC   #$0001
         BEQ   L035293
         BVS   L035252
         EOR   #$8000
L035252  BPL   L035293
         LDA   $CF
         CMP   #$0000
         BEQ   L035278
         PEA   $0001
         PEI   $E8
         LDA   $EA
         CLC
         ADC   #$000B
         PHA
         LDA   $EC
         SEC
         SBC   #$0009
         PHA
         JSL   L0334B2
         PLY
         PLY
         PLY
         PLY
         BRA   L035293
L035278  PEA   $0001
         PEI   $E8
         LDA   $EA
         CLC
         ADC   #$000B
         PHA
         LDA   $EC
         SEC
         SBC   #$0005
         PHA
         JSL   L0334B2
         PLY
         PLY
         PLY
         PLY
L035293  LDA   $E8
         CMP   #$0000
         BNE   L0352B8
         PEA   $0002
         PEI   $E8
         LDA   $EA
         CLC
         ADC   #$000B
         PHA
         LDA   $EC
         SEC
         SBC   #$0007
         PHA
         JSL   L0334B2
         PLY
         PLY
         PLY
         PLY
         BRL   L03532B
L0352B8  LDA   #$0004
         PHA
         LDA   L050062
         AND   #$00FF
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         CLC
         ADC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L023038
         LDX   #^L023038
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         SEC
         JSL   L0198D7
         PLA
         CMP   #$000F
         BNE   L03530F
         LDA   #$0002
         BRA   L035312
L03530F  LDA   #$0001
L035312  PHA
         PEI   $E8
         LDA   $EA
         CLC
         ADC   #$000B
         PHA
         LDA   $EC
         SEC
         SBC   #$0007
         PHA
         JSL   L0334B2
         PLY
         PLY
         PLY
         PLY
L03532B  LDA   $D1
         CMP   #$0000
         BNE   L035335
         BRL   L0353CE
L035335  LDA   $D9
         SEC
         SBC   #$0001
         BNE   L035340
         BRL   L0353BD
L035340  BVS   L035345
         EOR   #$8000
L035345  BPL   L0353BD
         LDA   $D1
         SEC
         SBC   #$0001
         BEQ   L0353BD
         BVS   L035354
         EOR   #$8000
L035354  BPL   L0353BD
         LDA   $CD
         CMP   #$0000
         BEQ   L03538E
         PEA   $0000
         PEI   $E8
         PEI   $EA
         LDA   $EC
         CLC
         ADC   #$0002
         PHA
         JSL   L03341C
         PLY
         PLY
         PLY
         PLY
         LDA   $CF
         CMP   #$0000
         BEQ   L03538C
         PEI   $E8
         PEI   $EA
         LDA   $EC
         CLC
         ADC   #$0002
         PHA
         JSL   L0322F6
         PLY
         PLY
         PLY
L03538C  BRA   L0353BD
L03538E  PEA   $0000
         PEI   $E8
         PEI   $EA
         LDA   $EC
         SEC
         SBC   #$0002
         PHA
         JSL   L03341C
         PLY
         PLY
         PLY
         PLY
         LDA   $CF
         CMP   #$0000
         BEQ   L0353BD
         PEI   $E8
         PEI   $EA
         LDA   $EC
         SEC
         SBC   #$0002
         PHA
         JSL   L0322F6
         PLY
         PLY
         PLY
L0353BD  PEA   $0000
         PEI   $E8
         PEI   $EA
         PEI   $EC
         JSL   L03341C
         PLY
         PLY
         PLY
         PLY
L0353CE  LDA   $D3
         CMP   #$0000
         BNE   L0353D8
         BRL   L035471
L0353D8  LDA   $D9
         SEC
         SBC   #$0001
         BNE   L0353E3
         BRL   L035460
L0353E3  BVS   L0353E8
         EOR   #$8000
L0353E8  BPL   L035460
         LDA   $D3
         SEC
         SBC   #$0001
         BEQ   L035460
         BVS   L0353F7
         EOR   #$8000
L0353F7  BPL   L035460
         LDA   $CF
         CMP   #$0000
         BEQ   L035431
         PEA   $0000
         PEI   $E8
         PEI   $EA
         LDA   $EC
         SEC
         SBC   #$0002
         PHA
         JSL   L0334B2
         PLY
         PLY
         PLY
         PLY
         LDA   $CD
         CMP   #$0000
         BEQ   L03542F
         PEI   $E8
         PEI   $EA
         LDA   $EC
         SEC
         SBC   #$0002
         PHA
         JSL   L0322F6
         PLY
         PLY
         PLY
L03542F  BRA   L035460
L035431  PEA   $0000
         PEI   $E8
         PEI   $EA
         LDA   $EC
         CLC
         ADC   #$0002
         PHA
         JSL   L0334B2
         PLY
         PLY
         PLY
         PLY
         LDA   $CD
         CMP   #$0000
         BEQ   L035460
         PEI   $E8
         PEI   $EA
         LDA   $EC
         CLC
         ADC   #$0002
         PHA
         JSL   L0322F6
         PLY
         PLY
         PLY
L035460  PEA   $0000
         PEI   $E8
         PEI   $EA
         PEI   $EC
         JSL   L0334B2
         PLY
         PLY
         PLY
         PLY
L035471  LDA   $DE
         AND   #$00FF
         SEC
         SBC   #$0008
         BVS   L03547F
         EOR   #$8000
L03547F  BMI   L0354AE
         LDA   $DE
         AND   #$00FF
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $E8
         PEA   $000F
         PEI   $E8
         PEI   $E8
         PEI   $E8
         PEA   $0000
         PEI   $EA
         PEI   $EC
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L0354AE  INC   $EE
L0354B0  LDA   $EE
         SEC
         SBC   #$0009
         BVS   L0354BB
         EOR   #$8000
L0354BB  BMI   L0354C0
         BRL   L034A0D
L0354C0  INC   $F0
L0354C2  LDA   $F0
         SEC
         SBC   #$0009
         BVS   L0354CD
         EOR   #$8000
L0354CD  BMI   L0354D2
         BRL   L034A08
L0354D2  LDA   L050043
         BEQ   L0354E9
         LDA   L0500BE
         CMP   #$0002
         BNE   L0354E5
         JSL   L031A12
         BRA   L0354E9
L0354E5  JSL   L031A42
L0354E9  LDA   L0500BE
         CMP   #$0002
         BNE   L0354F7
         JSL   L039230
         BRA   L0354FB
L0354F7  JSL   L039B22
L0354FB  STZ   L050043
L0354FE  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L035508  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E2
         TCS
         STZ   $E4
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $EE
         LDA   L0500C4
         PHA
         LDA   L0500C2
         PHA
         JSL   L036EFD
         PLY
         PLY
         LDA   $FF
         BEQ   L035599
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $EC
         BRA   L0355B5
L035599  JSL   L0370AE
         STA   $EC
         LDA   L05003F
         SEC
         SBC   #$000C
         BEQ   L0355B5
         BVS   L0355AD
         EOR   #$8000
L0355AD  BPL   L0355B5
         LDA   #$FFFF
         BRL   L035778
L0355B5  LDA   #$0004
         PHA
         LDA   $EC
         SEC
         JSL   L0198D7
         PLA
         STA   $EA
         LDA   $EC
         AND   #$000F
         STA   $E8
         LDA   $EA
         LDX   #$0000
         PHX
         PHA
         LDA   $E8
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $E6
         LDA   $E6
         CMP   L0500A2
         BEQ   L035624
         LDA   #$FFFF
         BRL   L035778
L035624  STZ   $F0
         BRL   L035740
L035629  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   $EC
         BNE   L03567E
         BRL   L035728
L03567E  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0001
         LDA   [$F4],Y
         AND   #$00FF
         CMP   $EC
         BEQ   L035728
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         AND   #$00FF
         CMP   $EC
         BNE   L03573E
L035728  LDA   $EA
         STA   L0500B2
         LDA   $E8
         STA   L0500B4
         LDA   $EC
         STA   L0500AC
         LDA   $F0
         STA   L050041
         INC   $E4
L03573E  INC   $F0
L035740  LDA   $F0
         SEC
         SBC   $EE
         BVS   L03574A
         EOR   #$8000
L03574A  BMI   L03574F
         BRL   L035629
L03574F  LDA   $E4
         BEQ   L035775
         LDA   L0500A2
         PHA
         PEI   $E8
         PEI   $EA
         JSL   L0360CE
         PLY
         PLY
         PLY
         LDA   $E4
         CMP   #$0001
         BEQ   L03576E
         LDA   #$0000
         BRA   L035771
L03576E  LDA   #$0001
L035771  BRA   L035778
         BRA   L035778
L035775  LDA   #$FFFF
L035778  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L035782  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E2
         TCS
         STZ   $E4
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $EE
         LDA   $FF
         BNE   L0357C5
         BRL   L035873
L0357C5  LDA   L050041
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $EC
         LDA   $EC
         CMP   L0500AC
         BNE   L035871
         LDA   L050041
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0001
         LDA   [$F4],Y
         AND   #$00FF
         STA   $EC
L035871  BRA   L03589D
L035873  LDA   L0500C4
         PHA
         LDA   L0500C2
         PHA
         JSL   L036EFD
         PLY
         PLY
         JSL   L0370AE
         STA   $EC
         LDA   L05003F
         SEC
         SBC   #$000C
         BEQ   L03589D
         BVS   L035895
         EOR   #$8000
L035895  BPL   L03589D
         LDA   #$FFFF
         BRL   L035B70
L03589D  LDA   $EC
         CMP   L0500AC
         BNE   L0358AA
         LDA   #$FFFF
         BRL   L035B70
L0358AA  LDA   #$0004
         PHA
         LDA   $EC
         SEC
         JSL   L0198D7
         PLA
         STA   $EA
         LDA   $EC
         AND   #$000F
         STA   $E8
         LDA   $EA
         LDX   #$0000
         PHX
         PHA
         LDA   $E8
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $E6
         LDA   $E6
         CMP   L0500A2
         BEQ   L035919
         LDA   #$FFFF
         BRL   L035B70
L035919  STZ   $F0
         BRL   L035B3A
L03591E  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   L0500AC
         BNE   L035974
         BRL   L035A23
L035974  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0001
         LDA   [$F4],Y
         AND   #$00FF
         CMP   L0500AC
         BEQ   L035A23
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         AND   #$00FF
         CMP   L0500AC
         BEQ   L035A23
         BRL   L035B38
L035A23  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   $EC
         BNE   L035A78
         BRL   L035B22
L035A78  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0001
         LDA   [$F4],Y
         AND   #$00FF
         CMP   $EC
         BEQ   L035B22
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         AND   #$00FF
         CMP   $EC
         BNE   L035B38
L035B22  LDA   $EA
         STA   L0500B6
         LDA   $E8
         STA   L0500B8
         LDA   $EC
         STA   L0500AE
         LDA   $F0
         STA   L050041
         INC   $E4
L035B38  INC   $F0
L035B3A  LDA   $F0
         SEC
         SBC   $EE
         BVS   L035B44
         EOR   #$8000
L035B44  BMI   L035B49
         BRL   L03591E
L035B49  LDA   $E4
         BEQ   L035B6D
         LDA   L0500A2
         PHA
         PEI   $E8
         PEI   $EA
         JSL   L0360CE
         PLY
         PLY
         PLY
         LDA   $E4
         CMP   #$0001
         BEQ   L035B68
         LDA   #$0000
         BRA   L035B6B
L035B68  LDA   #$0001
L035B6B  BRA   L035B70
L035B6D  LDA   #$FFFF
L035B70  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L035B7A  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E4
         TCS
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $EE
         LDA   $FF
         BNE   L035BBB
         BRL   L035CD2
L035BBB  LDA   L050041
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $EC
         LDA   $EC
         CMP   L0500AC
         BEQ   L035C1A
         LDA   $EC
         CMP   L0500AE
         BNE   L035C6E
L035C1A  LDA   L050041
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0001
         LDA   [$F4],Y
         AND   #$00FF
         STA   $EC
L035C6E  LDA   $EC
         CMP   L0500AC
         BEQ   L035C7C
         LDA   $EC
         CMP   L0500AE
         BNE   L035CD0
L035C7C  LDA   L050041
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         AND   #$00FF
         STA   $EC
L035CD0  BRA   L035CFC
L035CD2  LDA   L0500C4
         PHA
         LDA   L0500C2
         PHA
         JSL   L036EFD
         PLY
         PLY
         JSL   L0370AE
         STA   $EC
         LDA   L05003F
         SEC
         SBC   #$000C
         BEQ   L035CFC
         BVS   L035CF4
         EOR   #$8000
L035CF4  BPL   L035CFC
         LDA   #$FFFF
         BRL   L0360C4
L035CFC  LDA   $EC
         CMP   L0500AC
         BEQ   L035D0A
         LDA   $EC
         CMP   L0500AE
         BNE   L035D10
L035D0A  LDA   #$FFFF
         BRL   L0360C4
L035D10  LDA   #$0004
         PHA
         LDA   $EC
         SEC
         JSL   L0198D7
         PLA
         STA   $EA
         LDA   $EC
         AND   #$000F
         STA   $E8
         LDA   $EA
         LDX   #$0000
         PHX
         PHA
         LDA   $E8
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $E6
         LDA   $E6
         CMP   L0500A2
         BEQ   L035D7F
         LDA   #$FFFF
         BRL   L0360C4
L035D7F  STZ   $F0
         BRL   L0360B2
L035D84  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   L0500AC
         BNE   L035DDA
         BRL   L035E89
L035DDA  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0001
         LDA   [$F4],Y
         AND   #$00FF
         CMP   L0500AC
         BEQ   L035E89
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         AND   #$00FF
         CMP   L0500AC
         BEQ   L035E89
         BRL   L0360B0
L035E89  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   L0500AE
         BNE   L035EDF
         BRL   L035F8E
L035EDF  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0001
         LDA   [$F4],Y
         AND   #$00FF
         CMP   L0500AE
         BEQ   L035F8E
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         AND   #$00FF
         CMP   L0500AE
         BEQ   L035F8E
         BRL   L0360B0
L035F8E  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   $EC
         BNE   L035FE3
         BRL   L03608D
L035FE3  LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0001
         LDA   [$F4],Y
         AND   #$00FF
         CMP   $EC
         BEQ   L03608D
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         PHA
         LDA   #$0080
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         AND   #$00FF
         CMP   $EC
         BNE   L0360B0
L03608D  LDA   $EA
         STA   L0500BA
         LDA   $E8
         STA   L0500BC
         LDA   $EC
         STA   L0500B0
         LDA   L0500A2
         PHA
         PEI   $E8
         PEI   $EA
         JSL   L0360CE
         PLY
         PLY
         PLY
         LDA   #$0001
         BRA   L0360C4
L0360B0  INC   $F0
L0360B2  LDA   $F0
         SEC
         SBC   $EE
         BVS   L0360BC
         EOR   #$8000
L0360BC  BMI   L0360C1
         BRL   L035D84
L0360C1  LDA   #$FFFF
L0360C4  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L0360CE  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E8
         TCS
         LDA   L050081
         AND   #$00FF
         BEQ   L0360E9
         LDA   L050087
         AND   #$00FF
         BEQ   L0360F1
L0360E9  LDA   L050080
         AND   #$00FF
         BEQ   L0360FF
L0360F1  LDA   L0500E0
         BNE   L0360FF
         JSL   L01184E
         TAY
         BNE   L0360FF
         BRA   L03616B
L0360FF  LDA   $FF
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $EE
         LDA   $FD
         PHA
         LDA   #$000D
         SEC
         JSL   L019EFD
         LDA   $FB
         PHA
         LDA   #$001A
         SEC
         JSL   L019EFD
         LDA   L0500A6
         PLX
         STX   $F4
         CLC
         ADC   $F4
         PLX
         STX   $F4
         SEC
         SBC   $F4
         STA   $EC
         LDA   $FD
         PHA
         LDA   #$0013
         SEC
         JSL   L019EFD
         LDA   L0500A8
         PLX
         STX   $F4
         CLC
         ADC   $F4
         STA   $EA
         JSL   L0155F1
         PEA   $000F
         PEA   $000F
         PEI   $EE
         PEI   $EE
         PEA   $0000
         PEI   $EA
         PEI   $EC
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L03616B  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L036175  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E8
         TCS
         LDA   L050081
         AND   #$00FF
         BEQ   L036190
         LDA   L050087
         AND   #$00FF
         BEQ   L036198
L036190  LDA   L050080
         AND   #$00FF
         BEQ   L0361A6
L036198  LDA   L0500E0
         BNE   L0361A6
         JSL   L01184E
         TAY
         BNE   L0361A6
         BRA   L03620D
L0361A6  LDA   $FF
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $EE
         LDA   $FD
         PHA
         LDA   #$000D
         SEC
         JSL   L019EFD
         LDA   $FB
         PHA
         LDA   #$001A
         SEC
         JSL   L019EFD
         LDA   L0500A6
         PLX
         STX   $F4
         CLC
         ADC   $F4
         PLX
         STX   $F4
         SEC
         SBC   $F4
         STA   $EC
         LDA   $FD
         PHA
         LDA   #$0013
         SEC
         JSL   L019EFD
         LDA   L0500A8
         PLX
         STX   $F4
         CLC
         ADC   $F4
         STA   $EA
         PEA   $000F
         PEI   $EE
         PEI   $EE
         PEI   $EE
         PEA   $0000
         PEI   $EA
         PEI   $EC
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L03620D  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L036217  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E6
         TCS
         LDA   #$0001
         STA   L05003A
         LDA   L0500AC
         SEC
         SBC   L0500AE
         BEQ   L036248
         BVS   L036236
         EOR   #$8000
L036236  BPL   L036248
         LDA   L0500AC
         STA   $F0
         LDA   L0500AE
         STA   L0500AC
         LDA   $F0
         STA   L0500AE
L036248  LDA   L0500AC
         SEC
         SBC   L0500B0
         BEQ   L036268
         BVS   L036256
         EOR   #$8000
L036256  BPL   L036268
         LDA   L0500AC
         STA   $F0
         LDA   L0500B0
         STA   L0500AC
         LDA   $F0
         STA   L0500B0
L036268  LDA   L0500AE
         SEC
         SBC   L0500B0
         BEQ   L036288
         BVS   L036276
         EOR   #$8000
L036276  BPL   L036288
         LDA   L0500AE
         STA   $F0
         LDA   L0500B0
         STA   L0500AE
         LDA   $F0
         STA   L0500B0
L036288  LDA   #$0004
         PHA
         LDA   L0500AC
         SEC
         JSL   L0198D7
         PLA
         STA   L0500B2
         LDA   L0500AC
         AND   #$000F
         STA   L0500B4
         LDA   #$0004
         PHA
         LDA   L0500AE
         SEC
         JSL   L0198D7
         PLA
         STA   L0500B6
         LDA   L0500AE
         AND   #$000F
         STA   L0500B8
         LDA   #$0004
         PHA
         LDA   L0500B0
         SEC
         JSL   L0198D7
         PLA
         STA   L0500BA
         LDA   L0500B0
         AND   #$000F
         STA   L0500BC
         LDA   L0500B2
         CMP   L0500B6
         BEQ   L0362DE
         BRL   L0363D0
L0362DE  LDA   L0500B8
         SEC
         SBC   L0500B4
         STA   $EA
         LDA   #$0001
         STA   $F4
L0362EC  LDA   $EA
         SEC
         SBC   #$0000
         BNE   L0362F7
         BRL   L036394
L0362F7  BVS   L0362FC
         EOR   #$8000
L0362FC  BMI   L036301
         BRL   L036394
L036301  LDA   $F4
         STA   $F2
         BRL   L03637B
L036308  LDA   L0500BC
         SEC
         SBC   $F2
         STA   $EC
         LDA   L0500BA
         SEC
         SBC   $EA
         STA   $EE
         LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDA   $EC
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $E8
         LDA   $E8
         CMP   #$0008
         BEQ   L036379
         PEI   $EC
         PEI   $EE
         PEI   $E8
         JSL   L0364CA
         PLY
         PLY
         PLY
L036379  INC   $F2
L03637B  LDA   $EA
         SEC
         SBC   $F4
         SEC
         SBC   $F2
         BVS   L036388
         EOR   #$8000
L036388  BPL   L03638D
         BRL   L036308
L03638D  STZ   $F4
         DEC   $EA
         BRL   L0362EC
L036394  LDA   L0500B4
         PHA
         LDA   L0500B2
         PHA
         LDA   L0500A2
         PHA
         JSL   L0364CA
         PLY
         PLY
         PLY
         LDA   L0500B8
         PHA
         LDA   L0500B6
         PHA
         LDA   L0500A2
         PHA
         JSL   L0364CA
         PLY
         PLY
         PLY
         LDA   L0500BC
         PHA
         LDA   L0500BA
         PHA
         LDA   L0500A2
         PHA
         JSL   L0364CA
         PLY
         PLY
         PLY
         BRL   L0364BF
L0363D0  LDA   L0500B6
         SEC
         SBC   L0500B2
         STA   $EA
         LDA   #$0001
         STA   $F4
L0363DE  LDA   $EA
         SEC
         SBC   #$0000
         BNE   L0363E9
         BRL   L036486
L0363E9  BVS   L0363EE
         EOR   #$8000
L0363EE  BMI   L0363F3
         BRL   L036486
L0363F3  LDA   $F4
         STA   $F2
         BRL   L03646D
L0363FA  LDA   L0500B4
         CLC
         ADC   $F2
         STA   $EC
         LDA   L0500B2
         CLC
         ADC   $EA
         STA   $EE
         LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDA   $EC
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $E8
         LDA   $E8
         CMP   #$0008
         BEQ   L03646B
         PEI   $EC
         PEI   $EE
         PEI   $E8
         JSL   L0364CA
         PLY
         PLY
         PLY
L03646B  INC   $F2
L03646D  LDA   $EA
         SEC
         SBC   $F4
         SEC
         SBC   $F2
         BVS   L03647A
         EOR   #$8000
L03647A  BPL   L03647F
         BRL   L0363FA
L03647F  STZ   $F4
         DEC   $EA
         BRL   L0363DE
L036486  LDA   L0500B4
         PHA
         LDA   L0500B2
         PHA
         LDA   L0500A2
         PHA
         JSL   L0364CA
         PLY
         PLY
         PLY
         LDA   L0500B8
         PHA
         LDA   L0500B6
         PHA
         LDA   L0500A2
         PHA
         JSL   L0364CA
         PLY
         PLY
         PLY
         LDA   L0500BC
         PHA
         LDA   L0500BA
         PHA
         LDA   L0500A2
         PHA
         JSL   L0364CA
         PLY
         PLY
         PLY
L0364BF  STZ   L05003A
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0364CA  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E6
         TCS
         LDA   L0500A4
         CMP   #$0000
         BNE   L0364E0
         BRL   L0365B1
L0364E0  LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0008
         SEP   #$20
         STA   [$F0]
         REP   #$20
         LDA   $FB
         CMP   L0500A2
         BNE   L03656A
         LDA   $FB
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         INC
         SEP   #$20
         STA   [$F0]
         REP   #$20
         PLA
         BRA   L0365AE
L03656A  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   $FB
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         INC
         SEP   #$20
         STA   [$F0]
         REP   #$20
         PLA
L0365AE  BRL   L036833
L0365B1  PEI   $FB
         PEI   $FF
         PEI   $FD
         JSL   L0360CE
         PLY
         PLY
         PLY
         LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0008
         SEP   #$20
         STA   [$F0]
         REP   #$20
         JSL   L0349BD
         LDA   $FF
         PHA
         LDA   #$000D
         SEC
         JSL   L019EFD
         LDA   $FD
         PHA
         LDA   #$001A
         SEC
         JSL   L019EFD
         LDA   L0500A6
         PLX
         STX   $F4
         CLC
         ADC   $F4
         PLX
         STX   $F4
         SEC
         SBC   $F4
         STA   $EE
         LDA   $FF
         PHA
         LDA   #$0013
         SEC
         JSL   L019EFD
         LDA   L0500A8
         PLX
         STX   $F4
         CLC
         ADC   $F4
         STA   $EC
         LDA   $FB
         CMP   L0500A2
         BEQ   L036658
         BRL   L036714
L036658  LDA   $FB
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         INC
         SEP   #$20
         STA   [$F0]
         REP   #$20
         PLA
         LDA   $FB
         LDX   #$0000
         TAY
         BPL   L036693
         DEX
L036693  STX   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         STA   $EA
         LDA   $FB
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00FF
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $FB
         LDX   #$0000
         TAY
         BPL   L0366EE
         DEX
L0366EE  STX   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PLX
         STX   $F4
         SEC
         SBC   $F4
         STA   $E8
         BRL   L03682F
L036714  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   $FB
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         INC
         SEP   #$20
         STA   [$F0]
         REP   #$20
         PLA
         LDA   L0500A2
         LDX   #$0000
         TAY
         BPL   L036762
         DEX
L036762  STX   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   $FB
         LDX   #$0000
         TAY
         BPL   L036774
         DEX
L036774  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L02412E
         LDX   #^L02412E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         STA   $EA
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   $FB
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00FF
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   L0500A2
         LDX   #$0000
         TAY
         BPL   L0367EE
         DEX
L0367EE  STX   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   $FB
         LDX   #$0000
         TAY
         BPL   L036800
         DEX
L036800  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L02410E
         LDX   #^L02410E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PLX
         STX   $F4
         SEC
         SBC   $F4
         STA   $E8
L03682F  JSL   L0349BD
L036833  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L03683D  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         LDA   L0500C4
         PHA
         LDA   L0500C2
         PHA
         JSL   L036EFD
         PLY
         PLY
         STZ   $EE
         JSL   L0370AE
         STA   $F4
         LDA   $F4
         AND   #$000F
         STA   $F0
         LDA   #$0004
         PHA
         LDA   $F4
         SEC
         JSL   L0198D7
         PLA
         STA   $F2
         LDA   L050082
         AND   #$00FF
         BNE   L03687E
         BRL   L0369D5
L03687E  LDA   L05003F
         SEC
         SBC   #$000C
         BEQ   L036891
         BVS   L03688C
         EOR   #$8000
L03688C  BPL   L036891
         BRL   L0369D5
L036891  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0008
         BNE   L0368CC
         BRL   L0369D5
L0368CC  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $F4
         LDA   L0500A2
         CMP   $F4
         BEQ   L03693F
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         INC
         SEP   #$20
         STA   [$F6]
         REP   #$20
         PLA
         AND   #$00FF
         BRA   L036965
L03693F  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         INC
         SEP   #$20
         STA   [$F6]
         REP   #$20
         PLA
         AND   #$00FF
L036965  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0008
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F0
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $F2
         LDX   #$0000
         TAY
         BPL   L0369B2
         DEX
L0369B2  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         JSL   L016EAD
         PLY
         LDA   #$FFFF
         BRL   L036ACC
L0369D5  PEI   $F0
         PEI   $F2
         JSL   L036AD6
         PLY
         PLY
         TAY
         BEQ   L0369F2
         LDA   L05003F
         SEC
         SBC   #$000C
         BEQ   L0369F8
         BVS   L0369F0
         EOR   #$8000
L0369F0  BPL   L0369F8
L0369F2  LDA   #$0000
         BRL   L036ACC
L0369F8  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L036A68
         LDA   L0500A2
         PHA
         LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
L036A68  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L036A9F
         PEA   $0001
         JSL   L0371DE
         PLY
L036A9F  LDA   $F0
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $F2
         LDX   #$0000
         TAY
         BPL   L036AB5
         DEX
L036AB5  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
L036ACC  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L036AD6  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
         STZ   $EA
         LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0000
         BNE   L036B21
         LDA   #$0000
         BRL   L036EF3
L036B21  LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0008
         BEQ   L036B77
         LDA   #$0000
         BRL   L036EF3
L036B77  LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $F0
         SEC
         SBC   #$0001
         BNE   L036BB5
         BRL   L036EF0
L036BB5  BVS   L036BBA
         EOR   #$8000
L036BBA  BMI   L036BBF
         BRL   L036EF0
L036BBF  STZ   $EE
         BRL   L036C80
L036BC4  STZ   $EC
         BRL   L036C6E
L036BC9  LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDA   $EC
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         SEC
         SBC   #$0001
         BEQ   L036C59
         BVS   L036C07
         EOR   #$8000
L036C07  BPL   L036C59
         LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDA   $EC
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   L0500A2
         BEQ   L036C5E
L036C59  LDA   #$0000
         BRA   L036C61
L036C5E  LDA   #$0001
L036C61  PHA
         LDA   $EA
         PLX
         STX   $F6
         CLC
         ADC   $F6
         STA   $EA
         INC   $EC
L036C6E  LDA   $EC
         SEC
         SBC   #$0009
         BVS   L036C79
         EOR   #$8000
L036C79  BMI   L036C7E
         BRL   L036BC9
L036C7E  INC   $EE
L036C80  LDA   $EE
         SEC
         SBC   #$0009
         BVS   L036C8B
         EOR   #$8000
L036C8B  BMI   L036C90
         BRL   L036BC4
L036C90  LDA   $EA
         CMP   #$0006
         BNE   L036C9D
         LDA   #$0000
         BRL   L036EF3
L036C9D  LDA   $F0
         AND   #$0002
         TAY
         BEQ   L036CFF
         LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         SEC
         SBC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   L0500A2
         BNE   L036CFF
         LDA   #$0000
         BRL   L036EF3
L036CFF  LDA   $F0
         AND   #$0004
         TAY
         BEQ   L036D61
         LDA   $FD
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   L0500A2
         BNE   L036D61
         LDA   #$0000
         BRL   L036EF3
L036D61  LDA   $F0
         AND   #$0008
         TAY
         BEQ   L036DC7
         LDA   $FD
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         CLC
         ADC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   L0500A2
         BNE   L036DC7
         LDA   #$0000
         BRL   L036EF3
L036DC7  LDA   $F0
         AND   #$0010
         TAY
         BEQ   L036E29
         LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         CLC
         ADC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   L0500A2
         BNE   L036E29
         LDA   #$0000
         BRL   L036EF3
L036E29  LDA   $F0
         AND   #$0020
         TAY
         BEQ   L036E8B
         LDA   $FD
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   L0500A2
         BNE   L036E8B
         LDA   #$0000
         BRL   L036EF3
L036E8B  LDA   $F0
         AND   #$0040
         TAY
         BEQ   L036EF0
         LDA   $FD
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         SEC
         SBC   #$0001
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   L0500A2
         BNE   L036EF0
         LDA   #$0000
         BRA   L036EF3
L036EF0  LDA   #$0001
L036EF3  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L036EFD  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E0
         TCS
         STZ   $F0
         BRL   L037091
L036F0D  STZ   $EE
         BRL   L03707A
L036F12  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022BC2
         LDX   #^L022BC2
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0000
         BNE   L036F81
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0012
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0200A4
         LDX   #^L0200A4
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$7C09
         STA   [$F2]
         BRL   L037078
L036F81  LDA   #$0004
         PHA
         LDA   $EE
         PHA
         LDA   #$000D
         SEC
         JSL   L019EFD
         LDA   $F0
         PHA
         LDA   #$001A
         SEC
         JSL   L019EFD
         LDA   L0500A6
         PLX
         STX   $F6
         CLC
         ADC   $F6
         PLX
         STX   $F6
         SEC
         SBC   $F6
         SEC
         SBC   $FD
         SEC
         JSL   L019DD9
         PLY
         STA   $EC
         LDA   #$0004
         PHA
         LDA   $EE
         PHA
         LDA   #$0013
         SEC
         JSL   L019EFD
         LDA   L0500A8
         PLX
         STX   $F6
         CLC
         ADC   $F6
         SEC
         SBC   $FF
         SEC
         JSL   L019DD9
         PLY
         STA   $EA
         LDA   $EC
         SEC
         SBC   #$0000
         BVS   L036FE3
         EOR   #$8000
L036FE3  BMI   L036FED
         LDA   $EC
         EOR   #$FFFF
         INC
         STA   $EC
L036FED  LDA   $EA
         SEC
         SBC   #$0000
         BVS   L036FF8
         EOR   #$8000
L036FF8  BMI   L037002
         LDA   $EA
         EOR   #$FFFF
         INC
         STA   $EA
L037002  LDA   $EC
         SEC
         SBC   #$007E
         BEQ   L037016
         BVS   L03700F
         EOR   #$8000
L03700F  BPL   L037016
         LDA   #$007E
         STA   $EC
L037016  LDA   $EA
         SEC
         SBC   #$007E
         BEQ   L03702A
         BVS   L037023
         EOR   #$8000
L037023  BPL   L03702A
         LDA   #$007E
         STA   $EA
L03702A  LDA   $EA
         PHA
         LDA   $EA
         SEC
         JSL   L019EFD
         LDA   $EC
         PHA
         LDA   $EC
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $F6
         CLC
         ADC   $F6
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0012
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0200A4
         LDX   #^L0200A4
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
L037078  INC   $EE
L03707A  LDA   $EE
         SEC
         SBC   #$0008
         BNE   L037085
         BRL   L036F12
L037085  BVS   L03708A
         EOR   #$8000
L03708A  BMI   L03708F
         BRL   L036F12
L03708F  INC   $F0
L037091  LDA   $F0
         SEC
         SBC   #$0008
         BNE   L03709C
         BRL   L036F0D
L03709C  BVS   L0370A1
         EOR   #$8000
L0370A1  BMI   L0370A6
         BRL   L036F0D
L0370A6  TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L0370AE  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         LDA   #$7C09
         STA   L05003F
         STZ   $F4
         BRL   L03715A
L0370C4  STZ   $F2
         BRL   L037143
L0370C9  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $F2
         PHA
         LDA   #$0012
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0200A4
         LDX   #^L0200A4
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEC
         SBC   L05003F
         BVS   L037103
         EOR   #$8000
L037103  BMI   L037141
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $F2
         PHA
         LDA   #$0012
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0200A4
         LDX   #^L0200A4
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         STA   L05003F
         LDA   $F4
         STA   $EE
         LDA   $F2
         STA   $EC
L037141  INC   $F2
L037143  LDA   $F2
         SEC
         SBC   #$0008
         BNE   L03714E
         BRL   L0370C9
L03714E  BVS   L037153
         EOR   #$8000
L037153  BMI   L037158
         BRL   L0370C9
L037158  INC   $F4
L03715A  LDA   $F4
         SEC
         SBC   #$0008
         BNE   L037165
         BRL   L0370C4
L037165  BVS   L03716A
         EOR   #$8000
L03716A  BMI   L03716F
         BRL   L0370C4
L03716F  LDA   L05003F
         SEC
         SBC   #$7C09
         BVS   L03717B
         EOR   #$8000
L03717B  BPL   L037191
         PEA   ^L020086
         PEA   L020086
         JSL   L018845
         PLY
         PLY
         PEA   $0001
         JSL   L01A6E0
         PLY
L037191  LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $EC
         PHA
         LDA   #$0012
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0200A4
         LDX   #^L0200A4
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$7C09
         STA   [$F6]
         LDA   $EE
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $EC
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L0371DE  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0001
         STA   L05008A
         LDA   L050045
         BNE   L0371F7
         BRL   L037258
L0371F7  LDA   $FF
         BRL   L03724B
L0371FC  JSL   L037FF2
         BRL   L037258
L037203  JSL   L037E04
         BRL   L037258
L03720A  JSL   L037BAC
         BRL   L037258
L037211  JSL   L037C2A
         BRL   L037258
L037218  JSL   L03805A
         BRL   L037258
L03721F  JSL   L03816E
         BRL   L037258
L037226  JSL   L038282
         BRL   L037258
L03722D  JSL   L038437
         BRL   L037258
L037234  BRL   L037258
L037237  DA    L0371FC
         DA    L037203
         DA    L03720A
         DA    L037211
         DA    L037218
         DA    L037234
         DA    L037226
         DA    L03722D
         DA    L03721F
         DA    L037234
L03724B  CMP   #$0009
         BCC   L037253
         LDA   #$0009
L037253  ASL
         TAX
         JMP   (L037237,X)

L037258  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L037262  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050045
         BEQ   L037276
         JSL   L037CA8
L037276  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03727E  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050045
         BEQ   L0372A3
         JSL   L037A15
L037292  LDAL  L02034A
         SEC
         SBC   #$0178
         BVS   L03729F
         EOR   #$8000
L03729F  BMI   L0372A3
         BRA   L037292
L0372A3  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0372AB  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
L0372B6  PEA   ^L020146
         PEA   L020146
         PEI   $FF
         PEI   $FD
         JSL   L03AE0F
         PLY
         PLY
         PLY
         PLY
         STX   $F0
         STA   $EE
         LDA   $EE
         CMP   #$0000
         BNE   L0372EB
         LDA   $F0
         CMP   #$0000
         BNE   L0372EB
         PEI   $FF
         PEI   $FD
         JSL   L01621F
         PLY
         PLY
         TAY
         BEQ   L0372EB
         JSL   L01A6E0
L0372EB  SEC
         LDA   $EE
         SBC   #$0000
         BNE   L0372FA
         LDA   $F0
         SBC   #$0000
         BRA   L037301
L0372FA  LDA   $F0
         SBC   #$0000
         REP   #$02
L037301  BEQ   L0372B6
         PHX
         PHA
         PEA   $0000
         PEA   $4700
         LDA   appID
         PHA
         PEA   $8008
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         STX   $EC
         STA   $EA
         PEI   $F0
         PEI   $EE
         PEA   $4700
         PEA   $0001
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         PHX
         PHA
         JSL   L03ABC9
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PEI   $F0
         PEI   $EE
         JSL   L01DD14
         PLY
         PLY
         SEI
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         PHX
         PHA
         PEA   $0000
         PEA   $4700
         _WriteRamBlock
         CLI
         PEI   $EC
         PEI   $EA
         _DisposeHandle
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L037396  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E8
         TCS
         LDAL  L020350
         BNE   L0373AA
         BRL   L0375F9
L0373AA  LDAL  L02034E
         PHA
         LDAL  L02034C
         SEC
         JSL   L019DD9
         PLA
         CMP   #$0000
         BEQ   L0373C1
         BRL   L0375ED
L0373C1  STZ   $F4
         BRL   L03751A
L0373C6  LDAL  L02034A
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         PHA
         LDA   #$0212
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L020360
         LDX   #^L020360
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         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   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEC
         SBC   #$0080
         BVS   L03743E
         EOR   #$8000
L03743E  BPL   L037443
         BRL   L037518
L037443  PHA
         PEA   $0000
         PEA   $0032
         _AllocGen
         PLA
         AND   #$00FF
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020340
         LDX   #^L020340
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020340
         LDX   #^L020340
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020354
         LDX   #^L020354
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020336
         LDX   #^L020336
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02031A
         LDX   #^L02031A
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         PHX
         PHA
         _NoteOn
L037518  INC   $F4
L03751A  LDA   $F4
         SEC
         SBC   #$0005
         BVS   L037525
         EOR   #$8000
L037525  BMI   L03752A
         BRL   L0373C6
L03752A  STZ   $F4
         BRA   L03759F
L03752E  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEC
         SBC   #$0080
         BVS   L037553
         EOR   #$8000
L037553  BMI   L03759D
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020340
         LDX   #^L020340
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         _NoteOff
L03759D  INC   $F4
L03759F  LDA   $F4
         SEC
         SBC   #$0005
         BVS   L0375AA
         EOR   #$8000
L0375AA  BPL   L03752E
         LDAL  L02035E
         PHA
         LDAL  L02034A
         CLC
         ADC   #$0001
         SEC
         JSL   L019DD9
         PLA
         STAL  L02034A
         LDAL  L02158A
         CMP   #$0001
         BNE   L0375DC
         LDAL  L02034A
         CMP   #$0000
         BNE   L0375DC
         LDA   #$0000
         STAL  L020350
L0375DC  LDAL  L02034A
         CMP   #$0000
         BNE   L0375ED
         LDAL  L020352
         STAL  L02034A
L0375ED  LDAL  L02034C
         CLC
         ADC   #$0001
         STAL  L02034C
L0375F9  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037601  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E2
         TCS
L03760C  PEA   ^L020149
         PEA   L020149
         PEI   $FF
         PEI   $FD
         JSL   L03AE0F
         PLY
         PLY
         PLY
         PLY
         STX   $E6
         STA   $E4
         LDA   $E4
         CMP   #$0000
         BNE   L037641
         LDA   $E6
         CMP   #$0000
         BNE   L037641
         PEI   $FF
         PEI   $FD
         JSL   L01621F
         PLY
         PLY
         TAY
         BEQ   L037641
         JSL   L01A6E0
L037641  SEC
         LDA   $E4
         SBC   #$0000
         BNE   L037650
         LDA   $E6
         SBC   #$0000
         BRA   L037657
L037650  LDA   $E6
         SBC   #$0000
         REP   #$02
L037657  BEQ   L03760C
         PEI   $E6
         PEI   $E4
         PEA   $07D0
         PEA   $0001
         PEA   ^L020DBA
         PEA   L020DBA
         JSL   L03ABC9
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PEI   $E6
         PEI   $E4
         JSL   L01DD14
         PLY
         PLY
         STZ   $EC
         STZ   $EE
         BRL   L0377EA
L037686  STZ   $E8
         STZ   $F0
         BRL   L0377A5
L03768D  LDA   $F0
         PHA
         LDA   #$0002
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $EC
         LDX   #$0000
         PHX
         PHA
         LDA   #L020DBA
         LDX   #^L020DBA
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0080
         BNE   L0376BE
         BRL   L0377A3
L0376BE  LDA   $F0
         PHA
         LDA   #$0002
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $EC
         LDX   #$0000
         PHX
         PHA
         LDA   #L020DBA
         LDX   #^L020DBA
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   $E8
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0212
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L020360
         LDX   #^L020360
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         SEP   #$20
         STA   [$F2]
         REP   #$20
         LDA   $E8
         CLC
         ADC   #$0001
         STA   $E8
         LDA   #$0001
         STA   $EA
         BRA   L03776A
L037729  LDA   $E8
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0212
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L020360
         LDX   #^L020360
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$0080
         SEP   #$20
         STA   [$F2]
         REP   #$20
         LDA   $E8
         CLC
         ADC   #$0001
         STA   $E8
         INC   $EA
L03776A  LDA   $F0
         PHA
         LDA   #$0002
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $EC
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   #L020DBA
         LDX   #^L020DBA
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         SEC
         SBC   $EA
         BEQ   L0377A3
         BVS   L0377A1
         EOR   #$8000
L0377A1  BMI   L037729
L0377A3  INC   $F0
L0377A5  LDA   $F0
         PHA
         LDA   #$0002
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $EC
         LDX   #$0000
         PHX
         PHA
         LDA   #L020DBA
         LDX   #^L020DBA
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0081
         BEQ   L0377D6
         BRL   L03768D
L0377D6  LDA   $F0
         ASL
         PHA
         LDA   $EC
         PLX
         STX   $F6
         CLC
         ADC   $F6
         CLC
         ADC   #$0001
         STA   $EC
         INC   $EE
L0377EA  LDA   $EE
         SEC
         SBC   #$0005
         BVS   L0377F5
         EOR   #$8000
L0377F5  BMI   L0377FA
         BRL   L037686
L0377FA  TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L037802  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
L03780D  PEA   ^L02014C
         PEA   L02014C
         PEI   $FF
         PEI   $FD
         JSL   L03AE0F
         PLY
         PLY
         PLY
         PLY
         STX   $F0
         STA   $EE
         LDA   $EE
         CMP   #$0000
         BNE   L037842
         LDA   $F0
         CMP   #$0000
         BNE   L037842
         PEI   $FF
         PEI   $FD
         JSL   L01621F
         PLY
         PLY
         TAY
         BEQ   L037842
         JSL   L01A6E0
L037842  SEC
         LDA   $EE
         SBC   #$0000
         BNE   L037851
         LDA   $F0
         SBC   #$0000
         BRA   L037858
L037851  LDA   $F0
         SBC   #$0000
         REP   #$02
L037858  BEQ   L03780D
         PEI   $F0
         PEI   $EE
         PEA   $0007
         PEA   $002C
         LDAL  L02031C
         TAX
         LDAL  L02031A
         PHX
         PHA
         JSL   L03ABC9
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PEI   $F0
         PEI   $EE
         JSL   L01DD14
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0003
         STAL  L02034E
         LDA   #$0000
         STAL  L02034A
         LDA   #$0000
         STAL  L02034C
         LDA   #$00F1
         STAL  L02035E
         LDA   #$0000
         STAL  L020352
         LDA   #$0001
         STAL  L02158A
         STZ   $F4
         BRL   L037935
L0378C7  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02014F
         LDX   #^L02014F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020354
         LDX   #^L020354
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020159
         LDX   #^L020159
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020336
         LDX   #^L020336
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         INC   $F4
L037935  LDA   $F4
         SEC
         SBC   #$0005
         BVS   L037940
         EOR   #$8000
L037940  BPL   L0378C7
         LDA   #$0001
         STAL  L020350
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037951  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0003
         STAL  L02034E
         LDA   #$0100
         STAL  L02034A
         LDA   #$0000
         STAL  L02034C
         LDA   #$0200
         STAL  L02035E
         LDA   #$0080
         STAL  L020352
         LDA   #$0000
         STAL  L02158A
         STZ   $F4
         BRL   L0379F9
L03798B  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020163
         LDX   #^L020163
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020354
         LDX   #^L020354
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02016D
         LDX   #^L02016D
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020336
         LDX   #^L020336
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         INC   $F4
L0379F9  LDA   $F4
         SEC
         SBC   #$0005
         BVS   L037A04
         EOR   #$8000
L037A04  BPL   L03798B
         LDA   #$0001
         STAL  L020350
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037A15  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0003
         STAL  L02034E
         LDA   #$0160
         STAL  L02034A
         LDA   #$0000
         STAL  L02034C
         LDA   #$0196
         STAL  L02035E
         LDA   #$0000
         STAL  L020352
         LDA   #$0001
         STAL  L02158A
         STZ   $F4
         BRL   L037ABD
L037A4F  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020177
         LDX   #^L020177
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020354
         LDX   #^L020354
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020181
         LDX   #^L020181
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020336
         LDX   #^L020336
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         INC   $F4
L037ABD  LDA   $F4
         SEC
         SBC   #$0005
         BVS   L037AC8
         EOR   #$8000
L037AC8  BPL   L037A4F
         LDA   #$0001
         STAL  L020350
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037AD9  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         STZ   $F4
         BRA   L037B2A
L037AE8  LDA   $F4
         PHA
         LDA   #$002C
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201E6
         LDX   #^L0201E6
         JSL   L0198A5
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02031A
         LDX   #^L02031A
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
         INC   $F4
L037B2A  LDA   $F4
         SEC
         SBC   #$0007
         BVS   L037B35
         EOR   #$8000
L037B35  BPL   L037AE8
         LDA   #$0000
         STAL  L020350
         PEA   ^L02018B
         PEA   L02018B
         JSL   L0372AB
         PLY
         PLY
         PEA   ^L020194
         PEA   L020194
         JSL   L037802
         PLY
         PLY
         PEA   ^L02019E
         PEA   L02019E
         JSL   L037601
         PLY
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037B6A  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         CLI
         PEA   $007D
         PEA   ^L037396
         PEA   L037396
         _NSStartUp
         LDA   L050002
         BEQ   L037BA4
         PEA   ^L0201A8
         PEA   L0201A8
         JSL   L0164D1
         PLY
         PLY
         JSL   L01A6E0
L037BA4  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037BAC  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         STA   $F4
         LDA   #$0008
         PHA
         JSL   L01A5C3
         SEC
         JSL   L019DD9
         LDA   #$0071
         PLX
         STX   $FA
         CLC
         ADC   $FA
         STA   $F2
         PEI   $F4
         PEI   $F2
         PEA   $005B
         LDAL  L020320
         TAX
         LDAL  L02031E
         PHX
         PHA
         _NoteOn
         PEI   $F4
         PEI   $F2
         _NoteOff
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037C2A  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         STA   $F4
         LDA   #$0008
         PHA
         JSL   L01A5C3
         SEC
         JSL   L019DD9
         LDA   #$0070
         PLX
         STX   $FA
         CLC
         ADC   $FA
         STA   $F2
         PEI   $F4
         PEI   $F2
         PEA   $005A
         LDAL  L02032C
         TAX
         LDAL  L02032A
         PHX
         PHA
         _NoteOn
         PEI   $F4
         PEI   $F2
         _NoteOff
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037CA8  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EC
         TCS
         STZ   $EE
         BRL   L037D91
L037CB8  PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         PHA
         LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F0
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F0
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201B2
         LDX   #^L0201B2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201B8
         LDX   #^L0201B8
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201BE
         LDX   #^L0201BE
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02031A
         LDX   #^L02031A
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         PHX
         PHA
         _NoteOn
         INC   $EE
L037D91  LDA   $EE
         SEC
         SBC   #$0003
         BVS   L037D9C
         EOR   #$8000
L037D9C  BMI   L037DA1
         BRL   L037CB8
L037DA1  STZ   $EE
         BRA   L037DEF
L037DA5  LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F0
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201B2
         LDX   #^L0201B2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         _NoteOff
         INC   $EE
L037DEF  LDA   $EE
         SEC
         SBC   #$0003
         BVS   L037DFA
         EOR   #$8000
L037DFA  BPL   L037DA5
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037E04  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E2
         TCS
         PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         STA   $EE
         LDA   #$0004
         PHA
         JSL   L01A5C3
         SEC
         JSL   L019DD9
         LDAL  L0201C4
         PLX
         STX   $FA
         CLC
         ADC   $FA
         STA   $E6
         PEI   $EE
         PEI   $E6
         PEA   $0054
         LDAL  L02032C
         TAX
         LDAL  L02032A
         PHX
         PHA
         _NoteOn
         LDA   #$0001
         STA   $E4
         BRL   L037F3A
L037E6F  PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         PHA
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EE
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201C4
         LDX   #^L0201C4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00E6
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EE
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00E6
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         PEA   $0057
         LDAL  L020324
         TAX
         LDAL  L020322
         PHX
         PHA
         _NoteOn
         INC   $E4
L037F3A  LDA   $E4
         SEC
         SBC   #$0003
         BVS   L037F45
         EOR   #$8000
L037F45  BMI   L037F4A
         BRL   L037E6F
L037F4A  PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         STA   $F4
         LDAL  L0201CA
         STA   $EC
         PEI   $F4
         PEI   $EC
         PEA   $0062
         LDAL  L02031C
         TAX
         LDAL  L02031A
         PHX
         PHA
         _NoteOn
         STZ   $E4
         BRA   L037FDD
L037F93  LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EE
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201C4
         LDX   #^L0201C4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         _NoteOff
         INC   $E4
L037FDD  LDA   $E4
         SEC
         SBC   #$0004
         BVS   L037FE8
         EOR   #$8000
L037FE8  BPL   L037F93
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L037FF2  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         STA   $F4
         PEI   $F4
         PEA   $0036
         PEA   $006E
         LDAL  L020328
         TAX
         LDAL  L020326
         PHX
         PHA
         _NoteOn
         PEI   $F4
         PEA   $0036
         _NoteOff
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03805A  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         STZ   $F0
         BRL   L0380FB
L03806A  PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201CC
         LDX   #^L0201CC
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         PEA   $0061
         LDAL  L020324
         TAX
         LDAL  L020322
         PHX
         PHA
         _NoteOn
         INC   $F0
L0380FB  LDA   $F0
         SEC
         SBC   #$0002
         BVS   L038106
         EOR   #$8000
L038106  BMI   L03810B
         BRL   L03806A
L03810B  STZ   $F0
         BRA   L038159
L03810F  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201CC
         LDX   #^L0201CC
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         _NoteOff
         INC   $F0
L038159  LDA   $F0
         SEC
         SBC   #$0002
         BVS   L038164
         EOR   #$8000
L038164  BPL   L03810F
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03816E  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         STZ   $F0
         BRL   L03820F
L03817E  PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201D0
         LDX   #^L0201D0
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         PEA   $0061
         LDAL  L020324
         TAX
         LDAL  L020322
         PHX
         PHA
         _NoteOn
         INC   $F0
L03820F  LDA   $F0
         SEC
         SBC   #$0002
         BVS   L03821A
         EOR   #$8000
L03821A  BMI   L03821F
         BRL   L03817E
L03821F  STZ   $F0
         BRA   L03826D
L038223  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201D0
         LDX   #^L0201D0
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         _NoteOff
         INC   $F0
L03826D  LDA   $F0
         SEC
         SBC   #$0002
         BVS   L038278
         EOR   #$8000
L038278  BPL   L038223
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L038282  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E6
         TCS
         LDA   #$0000
         STAL  L0201D4
         LDA   #$0000
         STA   $EA
         PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         STA   $F0
         LDA   #$0004
         PHA
         JSL   L01A5C3
         SEC
         JSL   L019DD9
         LDAL  L0201D4
         PLX
         STX   $FA
         CLC
         ADC   $FA
         STA   $EA
         PEI   $F0
         PEI   $EA
         PEA   $0057
         LDAL  L02032C
         TAX
         LDAL  L02032A
         PHX
         PHA
         _NoteOn
         LDA   #$0001
         STA   $E8
         BRL   L0383C4
L0382F9  PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         PHA
         LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F0
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201D4
         LDX   #^L0201D4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F0
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         PEA   $0055
         LDAL  L020324
         TAX
         LDAL  L020322
         PHX
         PHA
         _NoteOn
         INC   $E8
L0383C4  LDA   $E8
         SEC
         SBC   #$0003
         BVS   L0383CF
         EOR   #$8000
L0383CF  BMI   L0383D4
         BRL   L0382F9
L0383D4  STZ   $E8
         BRA   L038422
L0383D8  LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F0
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201D4
         LDX   #^L0201D4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         _NoteOff
         INC   $E8
L038422  LDA   $E8
         SEC
         SBC   #$0003
         BVS   L03842D
         EOR   #$8000
L03842D  BPL   L0383D8
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L038437  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         STZ   $F0
         BRL   L038520
L038447  PHA
         PEA   $0000
         PEA   $0040
         _AllocGen
         PLA
         AND   #$00FF
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201DA
         LDX   #^L0201DA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201DE
         LDX   #^L0201DE
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201E2
         LDX   #^L0201E2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02031A
         LDX   #^L02031A
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         PHX
         PHA
         _NoteOn
         INC   $F0
L038520  LDA   $F0
         SEC
         SBC   #$0002
         BVS   L03852B
         EOR   #$8000
L03852B  BMI   L038530
         BRL   L038447
L038530  STZ   $F0
         BRA   L03857E
L038534  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00F2
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0201DA
         LDX   #^L0201DA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         _NoteOff
         INC   $F0
L03857E  LDA   $F0
         SEC
         SBC   #$0002
         BVS   L038589
         EOR   #$8000
L038589  BPL   L038534
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L038593  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$FF96
         TCS
         LDA   L050055
         BNE   L0385A6
         BRL   L039030
L0385A6  STZ   L050055
         LDA   #$0001
         STA   L050059
         LDA   #$FE0C
         LDX   #$FF98
         STA   $00,X
         LDX   #$FF9A
         STA   $00,X
         LDA   #$0001
         STA   L05005D
         LDA   #$000A
         PHA
         LDA   L05005D
         SEC
         JSL   L019DD9
         PLY
         STA   L05005B
         PEA   $0001
         LDA   L05005B
         PHA
         JSL   L03258D
         PLY
         PLY
         STA   L05005B
         LDX   #$0000
         LDA   #$046C
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L03ADF1
         PLY
         LDA   #$0000
         SEP   #$20
         LDX   #$FF9C
         STA   $00,X
         REP   #$20
         STZ   $F4
         BRA   L038628
L038604  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFD4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $F4
L038628  LDA   $F4
         SEC
         SBC   #$0090
         BVS   L038633
         EOR   #$8000
L038633  BPL   L038604
         STZ   $F2
         BRL   L03879E
L03863A  STZ   $F0
         BRL   L03878C
L03863F  LDA   $F0
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $F2
         STA   $E4
         LDA   $E4
         LDX   #$0000
         PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $EE
         TAY
         BNE   L0386AB
         BRL   L03878A
L0386AB  LDA   $F2
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $F0
         STA   $EC
         LDA   $EE
         PHA
         LDA   $EC
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFD4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $EC
         PHA
         LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FF9C
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F2
         PHA
         LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$009C
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F0
         PHA
         LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$0064
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $EE
         PHA
         LDA   $E4
         LDX   #$0000
         PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $E4
         PHA
         LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDA   #L021667
         LDX   #^L021667
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
L03878A  INC   $F0
L03878C  LDA   $F0
         SEC
         SBC   #$0009
         BVS   L038797
         EOR   #$8000
L038797  BMI   L03879C
         BRL   L03863F
L03879C  INC   $F2
L03879E  LDA   $F2
         SEC
         SBC   #$0009
         BVS   L0387A9
         EOR   #$8000
L0387A9  BMI   L0387AE
         BRL   L03863A
L0387AE  LDA   #$0000
         SEP   #$20
         STAL  L0221DF
         REP   #$20
         LDA   #$0000
         SEP   #$20
         STAL  L022268
         REP   #$20
         LDA   #$0000
         SEP   #$20
         STAL  L0222F1
         REP   #$20
         LDA   #$0000
         STAL  L02237A
         LDA   #$0001
         STA   L050053
         LDA   #$0002
         STA   $EA
         BRL   L038AF9
L0387E4  STZ   $E0
         BRL   L038AE2
L0387E9  STZ   $F0
         BRL   L038ACB
L0387EE  LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L038829
         BRL   L038AC9
L038829  LDA   $E0
         CLC
         ADC   $EA
         STA   $DE
         LDA   $DE
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L03886B
         BRL   L038AC9
L03886B  LDA   $F0
         CLC
         ADC   $EA
         STA   $DC
         LDA   $DE
         LDX   #$0000
         PHX
         PHA
         LDA   $DC
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L0388AD
         BRL   L038AC9
L0388AD  LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L050053
         LDX   #$0000
         PHX
         PHA
         LDA   #L0221DF
         LDX   #^L0221DF
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $DE
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L050053
         LDX   #$0000
         PHX
         PHA
         LDA   #L022268
         LDX   #^L022268
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $DE
         LDX   #$0000
         PHX
         PHA
         LDA   $DC
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L050053
         LDX   #$0000
         PHX
         PHA
         LDA   #L0222F1
         LDX   #^L0222F1
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $EA
         SEC
         SBC   #$0002
         PHA
         LDA   #$006C
         SEC
         JSL   L019EFD
         LDA   L050053
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02248C
         LDX   #^L02248C
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   L050053
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02237A
         LDX   #^L02237A
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   L05004F
         STA   [$F6]
         LDA   $EA
         STA   $D8
         BRL   L038A8D
L0389ED  LDA   $D8
         STA   $D6
         BRL   L038A7B
L0389F4  LDA   $D8
         CMP   $EA
         BNE   L038A03
         LDA   $D6
         CMP   $EA
         BNE   L038A03
         BRL   L038A79
L038A03  LDA   $D8
         CMP   $EA
         BNE   L038A13
         LDA   $D6
         CMP   #$0000
         BNE   L038A13
         BRL   L038A79
L038A13  LDA   $E0
         CLC
         ADC   $D8
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         CLC
         ADC   $D6
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $E2
         LDA   $E2
         PHA
         LDA   L05004F
         PHA
         INC
         STA   L05004F
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   L05004B
L038A79  DEC   $D6
L038A7B  LDA   $D6
         SEC
         SBC   #$0000
         BVS   L038A86
         EOR   #$8000
L038A86  BPL   L038A8B
         BRL   L0389F4
L038A8B  DEC   $D8
L038A8D  LDA   $D8
         SEC
         SBC   #$0000
         BEQ   L038A9F
         BVS   L038A9A
         EOR   #$8000
L038A9A  BPL   L038A9F
         BRL   L0389ED
L038A9F  LDA   L05004F
         PHA
         INC
         STA   L05004F
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   L050053
L038AC9  INC   $F0
L038ACB  LDA   #$0009
         SEC
         SBC   $EA
         SEC
         SBC   $F0
         BEQ   L038AE0
         BVS   L038ADB
         EOR   #$8000
L038ADB  BPL   L038AE0
         BRL   L0387EE
L038AE0  INC   $E0
L038AE2  LDA   #$0009
         SEC
         SBC   $EA
         SEC
         SBC   $E0
         BEQ   L038AF7
         BVS   L038AF2
         EOR   #$8000
L038AF2  BPL   L038AF7
         BRL   L0387E9
L038AF7  INC   $EA
L038AF9  LDA   $EA
         SEC
         SBC   #$0007
         BVS   L038B04
         EOR   #$8000
L038B04  BMI   L038B09
         BRL   L0387E4
L038B09  LDA   #$0002
         STA   $EA
         BRL   L038E25
L038B11  STZ   $E0
         BRL   L038E0E
L038B16  LDA   $EA
         STA   $F0
         BRL   L038DFC
L038B1D  LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L038B58
         BRL   L038DFA
L038B58  LDA   $E0
         CLC
         ADC   $EA
         STA   $DE
         LDA   $DE
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L038B9A
         BRL   L038DFA
L038B9A  LDA   $F0
         SEC
         SBC   $EA
         STA   $DA
         LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   $DA
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L038BDC
         BRL   L038DFA
L038BDC  LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L050053
         LDX   #$0000
         PHX
         PHA
         LDA   #L0221DF
         LDX   #^L0221DF
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $DE
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L050053
         LDX   #$0000
         PHX
         PHA
         LDA   #L022268
         LDX   #^L022268
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   $DA
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L050053
         LDX   #$0000
         PHX
         PHA
         LDA   #L0222F1
         LDX   #^L0222F1
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $EA
         SEC
         SBC   #$0002
         PHA
         LDA   #$006C
         SEC
         JSL   L019EFD
         LDA   L050053
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02248C
         LDX   #^L02248C
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         STA   [$F6]
         LDA   L050053
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02237A
         LDX   #^L02237A
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   L05004F
         STA   [$F6]
         LDA   $EA
         STA   $D8
         BRL   L038DBE
L038D1C  STZ   $D6
         BRL   L038DA8
L038D21  LDA   $D8
         CMP   $EA
         BNE   L038D31
         LDA   $D6
         CMP   #$0000
         BNE   L038D31
         BRL   L038DA6
L038D31  LDA   $D8
         CMP   $EA
         BNE   L038D40
         LDA   $D6
         CMP   $D8
         BNE   L038D40
         BRL   L038DA6
L038D40  LDA   $DE
         SEC
         SBC   $D8
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         SEC
         SBC   $D6
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02158C
         LDX   #^L02158C
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $E2
         LDA   $E2
         PHA
         LDA   L05004F
         PHA
         INC
         STA   L05004F
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   L05004B
L038DA6  INC   $D6
L038DA8  LDA   $D6
         SEC
         SBC   $D8
         BNE   L038DB2
         BRL   L038D21
L038DB2  BVS   L038DB7
         EOR   #$8000
L038DB7  BMI   L038DBC
         BRL   L038D21
L038DBC  DEC   $D8
L038DBE  LDA   $D8
         SEC
         SBC   #$0000
         BEQ   L038DD0
         BVS   L038DCB
         EOR   #$8000
L038DCB  BPL   L038DD0
         BRL   L038D1C
L038DD0  LDA   L05004F
         PHA
         INC
         STA   L05004F
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   L050053
L038DFA  INC   $F0
L038DFC  LDA   $F0
         SEC
         SBC   #$0009
         BVS   L038E07
         EOR   #$8000
L038E07  BMI   L038E0C
         BRL   L038B1D
L038E0C  INC   $E0
L038E0E  LDA   #$0009
         SEC
         SBC   $EA
         SEC
         SBC   $E0
         BEQ   L038E23
         BVS   L038E1E
         EOR   #$8000
L038E1E  BPL   L038E23
         BRL   L038B16
L038E23  INC   $EA
L038E25  LDA   $EA
         SEC
         SBC   #$0007
         BVS   L038E30
         EOR   #$8000
L038E30  BMI   L038E35
         BRL   L038B11
L038E35  LDA   #$0000
         STAL  L02216F
         LDA   #$0001
         STA   $E2
         BRL   L038F16
L038E44  LDA   $E2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02216F
         LDX   #^L02216F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   L05004F
         STA   [$F6]
         LDA   #$0001
         STA   $E8
         BRL   L038EDD
L038E69  LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02237A
         LDX   #^L02237A
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         STA   $E6
L038E85  LDA   $E6
         INC   $E6
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $D4
         TAY
         BEQ   L038EDB
         LDA   $D4
         CMP   $E2
         BNE   L038ED9
         LDA   $E8
         PHA
         LDA   L05004F
         PHA
         INC
         STA   L05004F
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   L05004D
L038ED9  BRA   L038E85
L038EDB  INC   $E8
L038EDD  LDA   $E8
         SEC
         SBC   #$0089
         BVS   L038EE8
         EOR   #$8000
L038EE8  BMI   L038EED
         BRL   L038E69
L038EED  LDA   L05004F
         PHA
         INC
         STA   L05004F
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $E2
L038F16  LDA   $E2
         SEC
         SBC   #$0038
         BVS   L038F21
         EOR   #$8000
L038F21  BMI   L038F26
         BRL   L038E44
L038F26  LDA   #$0000
         STAL  L0220FF
         LDA   #$0001
         STA   $E2
         BRL   L039020
L038F35  LDA   $E2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0220FF
         LDX   #^L0220FF
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   L05004F
         STA   [$F6]
         LDA   #$0001
         STA   $E8
         BRL   L038FE7
L038F5A  LDA   $E8
         LDX   #$0000
         PHX
         PHA
         LDA   #L0221DF
         LDX   #^L0221DF
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   $E2
         BEQ   L038FBA
         LDA   $E8
         LDX   #$0000
         PHX
         PHA
         LDA   #L022268
         LDX   #^L022268
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   $E2
         BEQ   L038FBA
         LDA   $E8
         LDX   #$0000
         PHX
         PHA
         LDA   #L0222F1
         LDX   #^L0222F1
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   $E2
         BNE   L038FE5
L038FBA  LDA   $E8
         PHA
         LDA   L05004F
         PHA
         INC
         STA   L05004F
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   L050051
L038FE5  INC   $E8
L038FE7  LDA   $E8
         SEC
         SBC   #$0089
         BVS   L038FF2
         EOR   #$8000
L038FF2  BMI   L038FF7
         BRL   L038F5A
L038FF7  LDA   L05004F
         PHA
         INC
         STA   L05004F
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $E2
L039020  LDA   $E2
         SEC
         SBC   #$0038
         BVS   L03902B
         EOR   #$8000
L03902B  BMI   L039030
         BRL   L038F35
L039030  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L03903A  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         LDA   $FF
         CMP   L0500BE
         BNE   L03904F
         BRL   L039226
L03904F  LDA   L0500BE
         STA   $F2
         BRL   L0390D6
L039057  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0000
         SEP   #$20
         STA   [$F4]
         REP   #$20
         LDA   L0500BE
         STA   $F0
         BRA   L0390CF
L03908E  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F2
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0000
         SEP   #$20
         STA   [$F4]
         REP   #$20
L0390CF  LDA   $F0
         DEC   $F0
         TAY
         BNE   L03908E
L0390D6  LDA   $F2
         DEC   $F2
         TAY
         BEQ   L0390E0
         BRL   L039057
L0390E0  LDA   L0500BE
         STA   $F2
         BRA   L0390EE
L0390E7  PEI   $F2
         JSL   L0110DB
         PLY
L0390EE  LDA   $F2
         DEC   $F2
         TAY
         BNE   L0390E7
         JSL   L0349BD
         PEA   $0000
         JSL   L010A55
         PLY
         LDA   $FF
         STA   L0500BE
         SEP   #$20
         STZ   L050082
         REP   #$20
         JSL   L030702
         LDA   L0500BE
         CMP   #$0002
         BEQ   L03911C
         BRL   L03918B
L03911C  PEA   $0004
         PEA   ^L022C2B
         PEA   L022C2B
         PEA   ^L0240FE
         PEA   L0240FE
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0004
         PEA   ^L022C2F
         PEA   L022C2F
         PEA   ^L024106
         PEA   L024106
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDAL  L022C33
         STAL  L024110
         LDAL  L022C35
         STAL  L024116
         LDAL  L022C27
         STAL  L024130
         LDAL  L022C29
         STAL  L024136
         LDAL  L022C25
         STAL  L022C21
         LDAL  L022C1D
         STAL  L022C19
         LDA   L0500AA
         STA   L0500C0
         LDA   L050092
         STA   L05009C
         BRL   L039204
L03918B  PEA   $0008
         PEA   ^L022C37
         PEA   L022C37
         PEA   ^L0240FE
         PEA   L0240FE
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0008
         PEA   ^L022C3F
         PEA   L022C3F
         PEA   ^L024106
         PEA   L024106
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0020
         PEA   ^L022C47
         PEA   L022C47
         PEA   ^L02410E
         PEA   L02410E
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0020
         PEA   ^L022C67
         PEA   L022C67
         PEA   ^L02412E
         PEA   L02412E
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDAL  L022C1F
         STAL  L022C21
         LDAL  L022C17
         STAL  L022C19
         STZ   L0500C0
         LDA   L050094
         STA   L05009C
L039204  PEA   $0001
         JSL   L010A55
         PLY
         JSL   L033F68
         JSL   L034198
         LDA   #$0001
         STA   L050043
         JSL   L0349BD
         PEA   $0000
         JSL   L010E7F
         PLY
L039226  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L039230  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E8
         TCS
         STZ   $F4
         BRL   L039B0A
L039240  LDA   $F4
         BEQ   L039249
         LDA   #$0000
         BRA   L03924C
L039249  LDA   #$0001
L03924C  STA   $F0
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $EE
         BRL   L0392D6
L03926F  PEA   $0000
         LDA   $EE
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039286
         DEX
L039286  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L0392B1
         DEX
L0392B1  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L03323B
         PLY
         PLY
         PLY
         DEC   $EE
L0392D6  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         SEC
         SBC   $EE
         BVS   L03930A
         EOR   #$8000
L03930A  BMI   L03930F
         BRL   L03926F
L03930F  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $F6
         SEC
         SBC   $F6
         BVS   L039363
         EOR   #$8000
L039363  BPL   L039368
         BRL   L039448
L039368  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BNE   L039399
         BRL   L039448
L039399  LDA   $F4
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $F2
         LDA   $F2
         STA   $EC
         PEA   $000F
         PEI   $EC
         PEI   $F2
         PEI   $F2
         PEA   $0000
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L0393F5
         DEX
L0393F5  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039420
         DEX
L039420  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L039448  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4F
         LDX   #^L022D4F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $EE
         BRL   L03951B
L039478  PEA   $0000
         LDA   $EE
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L03948F
         DEX
L03948F  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L0394A1
         DEX
L0394A1  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02410E
         LDX   #^L02410E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L0394D8
         DEX
L0394D8  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L0394EA
         DEX
L0394EA  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02412E
         LDX   #^L02412E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L03323B
         PLY
         PLY
         PLY
         DEC   $EE
L03951B  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         SEC
         SBC   $EE
         BVS   L039560
         EOR   #$8000
L039560  BMI   L039565
         BRL   L039478
L039565  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4F
         LDX   #^L022D4F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $F6
         SEC
         SBC   $F6
         BVS   L0395D9
         EOR   #$8000
L0395D9  BPL   L0395DE
         BRL   L03971C
L0395DE  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BNE   L039620
         BRL   L03971C
L039620  LDA   $F4
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $F2
         LDA   $F2
         STA   $EC
         PEA   $000F
         PEI   $EC
         PEI   $F2
         PEI   $F2
         PEA   $0000
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L03968D
         DEX
L03968D  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L03969F
         DEX
L03969F  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02410E
         LDX   #^L02410E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L0396D6
         DEX
L0396D6  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L0396E8
         DEX
L0396E8  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02412E
         LDX   #^L02412E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L03971C  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $F6
         SEC
         SBC   $F6
         BVS   L039770
         EOR   #$8000
L039770  BPL   L039775
         BRL   L039894
L039775  PEA   $0001
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         JSL   L03258D
         PLY
         PLY
         STA   $EA
         STA   $EE
         BRL   L03985B
L0397A2  LDA   $F4
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $F2
         LDA   $F2
         STA   $EC
         LDA   $EE
         CMP   $EA
         BEQ   L0397E6
         LDA   L05003A
         AND   #$00FF
         BEQ   L0397DE
         LDA   L0500A2
         PHA
         LDA   #$0011
         SEC
         JSL   L019895
         LDA   L050062
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         CMP   #$0000
         BNE   L0397E6
L0397DE  PEA   $0006
         JSL   L0371DE
         PLY
L0397E6  PEA   $000F
         PEI   $EC
         PEI   $F2
         PEI   $F2
         PEA   $0000
         LDA   $EE
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039806
         DEX
L039806  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039831
         DEX
L039831  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         INC   $EE
L03985B  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         SEC
         SBC   $EE
         BVS   L03988F
         EOR   #$8000
L03988F  BPL   L039894
         BRL   L0397A2
L039894  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4F
         LDX   #^L022D4F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CLC
         ADC   #$0001
         STA   $EE
         BRL   L0399B7
L0398C8  LDA   $F4
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $F2
         LDA   $F2
         STA   $EC
         LDA   L05003A
         AND   #$00FF
         BEQ   L0398FE
         LDA   L0500A2
         PHA
         LDA   #$0011
         SEC
         JSL   L019895
         LDA   L050062
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         CMP   #$0000
         BNE   L039906
L0398FE  PEA   $0006
         JSL   L0371DE
         PLY
L039906  PEA   $000F
         PEI   $EC
         PEI   $F2
         PEI   $F2
         PEA   $0000
         LDA   $EE
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L039926
         DEX
L039926  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039938
         DEX
L039938  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02410E
         LDX   #^L02410E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L03996F
         DEX
L03996F  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039981
         DEX
L039981  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02412E
         LDX   #^L02412E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         INC   $EE
L0399B7  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         SEC
         SBC   $EE
         BVS   L0399FC
         EOR   #$8000
L0399FC  BPL   L039A01
         BRL   L0398C8
L039A01  LDA   L0500BE
         STA   $F2
         BRL   L039A71
L039A09  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4F
         LDX   #^L022D4F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
L039A71  LDA   $F2
         DEC   $F2
         TAY
         BNE   L039A09
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CA7
         LDX   #^L022CA7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4B
         LDX   #^L022D4B
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $F4
L039B0A  LDA   $F4
         SEC
         SBC   #$0002
         BVS   L039B15
         EOR   #$8000
L039B15  BMI   L039B1A
         BRL   L039240
L039B1A  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L039B22  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E9
         TCS
         STZ   $F4
         BRL   L03A302
L039B32  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $F6
         CMP   $F6
         BNE   L039B85
         BRL   L039DD3
L039B85  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $F6
         SEC
         SBC   $F6
         BVS   L039BD9
         EOR   #$8000
L039BD9  BMI   L039C07
         LDA   L05003A
         AND   #$00FF
         BEQ   L039BFF
         LDA   L0500A2
         PHA
         LDA   #$0011
         SEC
         JSL   L019895
         LDA   L050062
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         CMP   #$0000
         BNE   L039C07
L039BFF  PEA   $0006
         JSL   L0371DE
         PLY
L039C07  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BNE   L039C89
         PEA   $0000
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039C41
         DEX
L039C41  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039C66
         DEX
L039C66  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L03323B
         PLY
         PLY
         PLY
L039C89  PEA   $0000
         TDC
         CLC
         ADC   #$00EB
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         JSL   L03A31A
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$00EB
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039CD8
         DEX
L039CD8  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         CLC
         ADC   #$0012
         PHA
         LDA   $F4
         SEC
         SBC   #$0002
         BVS   L039D03
         EOR   #$8000
L039D03  BMI   L039D0A
         LDA   #$0008
         BRA   L039D0D
L039D0A  LDA   #$0008
L039D0D  PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039D17
         DEX
L039D17  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         JSL   L0320C0
         PLY
         PLY
         PLY
         PLY
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BNE   L039DD3
         LDA   $F4
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $F2
         LDA   $F2
         STA   $EE
         PEA   $000F
         PEI   $EE
         PEI   $F2
         PEI   $F2
         PEA   $0000
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039D86
         DEX
L039D86  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039DAB
         DEX
L039DAB  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L039DD3  LDA   L0500BE
         STA   $F0
         BRL   L03A1EF
L039DDB  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4F
         LDX   #^L022D4F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $F6
         CMP   $F6
         BNE   L039E4E
         BRL   L03A1EF
L039E4E  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4F
         LDX   #^L022D4F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PLX
         STX   $F6
         SEC
         SBC   $F6
         BVS   L039EC2
         EOR   #$8000
L039EC2  BMI   L039EF0
         LDA   L05003A
         AND   #$00FF
         BEQ   L039EE8
         LDA   L0500A2
         PHA
         LDA   #$0011
         SEC
         JSL   L019895
         LDA   L050062
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         CMP   #$0000
         BNE   L039EF0
L039EE8  PEA   $0006
         JSL   L0371DE
         PLY
L039EF0  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L039F32
         BRL   L039FC2
L039F32  PEA   $0000
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L039F3E
         DEX
L039F3E  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039F50
         DEX
L039F50  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02410E
         LDX   #^L02410E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L039F81
         DEX
L039F81  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L039F93
         DEX
L039F93  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02412E
         LDX   #^L02412E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L03323B
         PLY
         PLY
         PLY
L039FC2  PEA   $0000
         TDC
         CLC
         ADC   #$00EB
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         JSL   L03A31A
         PLY
         PLY
         PLY
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BNE   L03A058
         LDA   #$0020
         SEP   #$20
         STA   $EB
         REP   #$20
L03A058  PEA   $0000
         TDC
         CLC
         ADC   #$00EB
         PHA
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L03A06A
         DEX
L03A06A  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L03A07C
         DEX
L03A07C  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02410E
         LDX   #^L02410E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         CLC
         ADC   #$0012
         PHA
         LDA   $F4
         SEC
         SBC   #$0002
         BVS   L03A0B3
         EOR   #$8000
L03A0B3  BMI   L03A0BA
         LDA   #$0008
         BRA   L03A0BD
L03A0BA  LDA   #$0008
L03A0BD  PHA
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L03A0C7
         DEX
L03A0C7  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L03A0D9
         DEX
L03A0D9  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02412E
         LDX   #^L02412E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         JSL   L0320C0
         PLY
         PLY
         PLY
         PLY
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4F
         LDX   #^L022D4F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L03A13F
         BRL   L03A1EF
L03A13F  LDA   $F4
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $F2
         LDA   $F2
         STA   $EE
         PEA   $000F
         PEI   $EE
         PEI   $F2
         PEI   $F2
         PEA   $0000
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L03A166
         DEX
L03A166  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L03A178
         DEX
L03A178  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02410E
         LDX   #^L02410E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L03A1A9
         DEX
L03A1A9  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L03A1BB
         DEX
L03A1BB  STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L02412E
         LDX   #^L02412E
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L03A1EF  LDA   $F0
         DEC   $F0
         TAY
         BEQ   L03A1F9
         BRL   L039DDB
L03A1F9  LDA   L0500BE
         STA   $F2
         BRL   L03A269
L03A201  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4F
         LDX   #^L022D4F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
L03A269  LDA   $F2
         DEC   $F2
         TAY
         BNE   L03A201
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D47
         LDX   #^L022D47
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CA7
         LDX   #^L022CA7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D4B
         LDX   #^L022D4B
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $F4
L03A302  LDA   $F4
         SEC
         SBC   L0500BE
         BVS   L03A30D
         EOR   #$8000
L03A30D  BMI   L03A312
         BRL   L039B32
L03A312  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03A31A  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDA   $FB
         SEC
         SBC   #$0009
         BEQ   L03A35E
         BVS   L03A332
         EOR   #$8000
L03A332  BPL   L03A35E
         LDA   #$0031
         SEP   #$20
         STA   [$FD]
         REP   #$20
         LDA   #$0030
         CLC
         ADC   $FB
         SEC
         SBC   #$000A
         SEP   #$20
         LDY   #$0001
         STA   [$FD],Y
         REP   #$20
         LDA   #$0000
         SEP   #$20
         LDY   #$0002
         STA   [$FD],Y
         REP   #$20
         BRA   L03A376
L03A35E  LDA   #$0030
         CLC
         ADC   $FB
         SEP   #$20
         STA   [$FD]
         REP   #$20
         LDA   #$0000
         SEP   #$20
         LDY   #$0001
         STA   [$FD],Y
         REP   #$20
L03A376  TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L03A37E  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         LDX   L05015A
         LDA   L050158
         STX   $F2
         STA   $F0
L03A393  STZ   $EE
         BRA   L03A3F8
L03A397  LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         CLC
         ADC   #$0002
         LDX   $F2
         BCC   L03A3B3
         INX
L03A3B3  JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         CMP   $FF
         BNE   L03A3F6
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         CLC
         ADC   #$0002
         LDX   $F2
         BCC   L03A3DF
         INX
L03A3DF  JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0004
         LDA   [$F4],Y
         TAX
         LDY   #$0002
         LDA   [$F4],Y
         BRA   L03A41F
L03A3F6  INC   $EE
L03A3F8  LDY   #$00B6
         LDA   [$F0],Y
         SEC
         SBC   $EE
         BVS   L03A405
         EOR   #$8000
L03A405  BMI   L03A397
         LDY   #$00BA
         LDA   [$F0],Y
         TAX
         LDY   #$00B8
         LDA   [$F0],Y
         STX   $F2
         STA   $F0
         BRL   L03A393
         LDX   #$0000
         LDA   #$0000
L03A41F  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L03A429  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$FF7E
         TCS
         JSL   L01561C
         JSL   L018B20
         TAY
         BEQ   L03A445
         LDA   #$0000
         BRL   L03A540
L03A445
*  JSL   L018CFC
         PEA   $010C
         PEA   $00A8
         PEA   $0017
         PEA   $002D
         JSL   L015BBB
         PLY
         PLY
         PLY
         PLY
         TXY
         LDX   #$FF80
         STY   $02,X
         STA   $00,X
         TYX
         LDA   #$0001
         SEP   #$20
         STA   $9A
         REP   #$20
         LDA   $FF
         SEP   #$20
         STA   $9B
         REP   #$20
         SEC
         LDA   $FB
         SBC   #$0000
         BNE   L03A486
         LDA   $FD
         SBC   #$0000
         BRA   L03A48D
L03A486  LDA   $FD
         SBC   #$0000
         REP   #$02
L03A48D  BEQ   L03A4A6
         PEI   $FD
         PEI   $FB
         PEA   $0000
         TDC
         CLC
         ADC   #$009C
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         BRA   L03A4BD
L03A4A6  PEA   ^L02E753
         PEA   L02E753
         PEA   $0000
         TDC
         CLC
         ADC   #$009C
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
L03A4BD  PEA   $001C
         PEA   $0032
         PEA   $0000
         TDC
         CLC
         ADC   #$009C
         PHA
         PEA   $0000
         PEA   $0000
         LDA   $FF
         CMP   #$FFFF
         BEQ   L03A4E3
         LDX   #$0000
         TDC
         CLC
         ADC   #$009A
         BRA   L03A4E9
L03A4E3  LDX   #$0000
         LDA   #$0000
L03A4E9  PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$FF84
         PHA
         _SFGetFile
         LDX   #$FF84
         LDA   $00,X
         BEQ   L03A520
         PEA   $0000
         TDC
         CLC
         ADC   #$FF8A
         PHA
         PEI   $F9
         PEI   $F7
         JSL   L015AC4
         PLY
         PLY
         PLY
         PLY
L03A520  LDX   #$FF82
         LDA   $00,X
         TAX
         PHX
         LDX   #$FF80
         LDA   $00,X
         PHA
         JSL   L015DAF
         PLY
         PLY
         JSL   L0151A2
*         JSL   L018C8B
         LDX   #$FF84
         LDA   $00,X
L03A540  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L03A54A  PHD
         TSC
         SEC
         SBC   #$00EB
         TCD
         ADC   #$00E2
         TCS
         PEA   $0001
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEI   $F5
         PEI   $F3
         PEI   $F1
         PEA   ^L02E520
         PEA   L02E520
         PEA   ^L02E51F
         PEA   L02E51F
         PEA   ^L02E51C
         PEA   L02E51C
         PEA   ^L02E518
         PEA   L02E518
         JSL   L018897
         TAY
         TSC
         CLC
         ADC   #$0022
         TCS
         TYA
         JSL   L01848A
         STA   $E4
         JSL   L01842F
         LDA   $E4
         CMP   #$0001
         BEQ   L03A5A2
         LDA   #$0000
         BRA   L03A5A5
L03A5A2  LDA   #$0001
L03A5A5  TAY
         TDC
         CLC
         ADC   #$00EB
         TCS
         TYA
         PLD
         RTL

L03A5AF  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00A8
         TCS
         STZ   $AA
         BRA   L03A5C0
L03A5BE  INC   $AA
L03A5C0  LDA   $AA
         LDX   #$0000
         TAY
         BPL   L03A5C9
         DEX
L03A5C9  PEA   $0000
         PEA   $0007
         CLC
         JSL   L01CA3F
         LDX   $FD
         LDA   $FB
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         CMP   #$FFFF
         BNE   L03A5BE
         PHA
         PHX
         PHA
         _TickCount
         _LoWord
         JSL   L03ADF1
         PLY
         LDA   $AA
         PHA
         JSL   L01A5C3
         SEC
         JSL   L019DD9
         PLA
         STA   $EA
         STZ   $EC
L03A622  LDA   $EA
         LDX   #$0000
         TAY
         BPL   L03A62B
         DEX
L03A62B  PEA   $0000
         PEA   $0007
         CLC
         JSL   L01CA3F
         LDX   $FD
         LDA   $FB
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0006
         LDA   [$F0],Y
         AND   #$00FF
         PHA
         JSL   L03AD47
         PLY
         PHA
         LDA   $FF
         BEQ   L03A683
         LDA   $EA
         LDX   #$0000
         TAY
         BPL   L03A660
         DEX
L03A660  PEA   $0000
         PEA   $0007
         CLC
         JSL   L01CA3F
         LDX   $FD
         LDA   $FB
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0006
         LDA   [$F0],Y
         AND   #$00FF
         BRA   L03A686
L03A683  LDA   #$FFFF
L03A686  PHA
         LDA   $EA
         LDX   #$0000
         TAY
         BPL   L03A690
         DEX
L03A690  PEA   $0000
         PEA   $0007
         CLC
         JSL   L01CA3F
         LDX   $FD
         LDA   $FB
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         LDA   $EA
         LDX   #$0000
         TAY
         BPL   L03A6B5
         DEX
L03A6B5  PEA   $0000
         PEA   $0007
         CLC
         JSL   L01CA3F
         LDX   $FD
         LDA   $FB
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         PHA
         LDA   $EA
         LDX   #$0000
         TAY
         BPL   L03A6DD
         DEX
L03A6DD  PEA   $0000
         PEA   $0007
         CLC
         JSL   L01CA3F
         LDX   $FD
         LDA   $FB
         JSL   L0198A5
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         PHA
         JSL   L03A7E7
         PLY
         PLY
         PLY
         PLY
         PLX
         STX   $F0
         CMP   $F0
         BNE   L03A711
         LDA   #$0001
         BRL   L03A746
L03A711  INC   $EC
         LDA   $EC
         CMP   #$0002
         BNE   L03A71C
         BRA   L03A743
L03A71C  PEA   ^L02E594
         PEA   L02E594
         PEA   ^L02E57B
         PEA   L02E57B
         PEA   ^L02E569
         PEA   L02E569
         PEA   ^L02E568
         PEA   L02E568
         JSL   L018845
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         BRL   L03A622
L03A743  LDA   #$0000
L03A746  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L03A750  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   #$0001
         STA   L050130
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03A769  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   #$0001
         STA   L050132
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L03A782  PHD
         TSC
         SEC
         SBC   #$00EB
         TCD
         ADC   #$00E2
         TCS
         PEA   $0000
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEI   $F5
         PEI   $F3
         PEI   $F1
         PEA   ^L02E517
         PEA   L02E517
         PEA   ^L02E516
         PEA   L02E516
         PEA   ^L02E513
         PEA   L02E513
         PEA   ^L02E50F
         PEA   L02E50F
         JSL   L018897
         TAY
         TSC
         CLC
         ADC   #$0022
         TCS
         TYA
         JSL   L01848A
         STA   $E4
         JSL   L01842F
         LDA   $E4
         CMP   #$0000
         BEQ   L03A7DA
         LDA   #$0000
         BRA   L03A7DD
L03A7DA  LDA   #$0001
L03A7DD  TAY
         TDC
         CLC
         ADC   #$00EB
         TCS
         TYA
         PLD
         RTL

L03A7E7  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$FFBD
         TCS
         LDA   $F9
         BRL   L03A86D
L03A7F7  PEA   ^L02E521
         PEA   L02E521
         PEA   $0000
         TDC
         CLC
         ADC   #$0089
         PHA
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         BRL   L03A87B
L03A811  PEA   ^L02E525
         PEA   L02E525
         PEA   $0000
         TDC
         CLC
         ADC   #$0089
         PHA
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         BRL   L03A87B
L03A82B  PEA   ^L02E529
         PEA   L02E529
         PEA   $0000
         TDC
         CLC
         ADC   #$0089
         PHA
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         BRL   L03A87B
L03A845  PEI   $F9
         PEA   ^L02E52D
         PEA   L02E52D
         PEA   $0000
         TDC
         CLC
         ADC   #$0089
         PHA
         JSL   L019101
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L03A87B
         BRL   L03A87B
L03A865  DA    L03A7F7
         DA    L03A811
         DA    L03A82B
         DA    L03A845
L03A86D  DEC
         CMP   #$0003
         BCC   L03A876
         LDA   #$0003
L03A876  ASL
         TAX
         JMP   (L03A865,X)

L03A87B  PEA   $0000
         TDC
         CLC
         ADC   #$0089
         PHA
         PEA   ^L02E532
         PEA   L02E532
         PEA   $0000
         TDC
         CLC
         ADC   #$FFC1
         PHA
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PEI   $FD
         PEI   $FB
         PEA   ^L02E548
         PEA   L02E548
         PEA   $0000
         TDC
         CLC
         ADC   #$0025
         PHA
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $0000
         PEA   ^L02E565
         PEA   L02E565
         PEA   ^L02E564
         PEA   L02E564
         PEA   ^L02E563
         PEA   L02E563
         PEA   ^L02E560
         PEA   L02E560
         JSL   L0180AF
         TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PEA   $0087
         PEA   $00A5
         JSL   L015781
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$FFC1
         PHA
         PEA   $0001
         JSL   L018B9D
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$0025
         PHA
         PEA   $0002
         JSL   L018B9D
         PLY
         PLY
         PLY
         LDA   $FF
         CMP   #$FFFF
         BEQ   L03A967
         LDA   $FF
         SEP   #$20
         LDX   #$FFBF
         STA   $00,X
         REP   #$20
         LDA   #$0000
         SEP   #$20
         LDX   #$FFC0
         STA   $00,X
         REP   #$20
         PEA   $0001
         PEA   $0000
         TDC
         CLC
         ADC   #$FFBF
         PHA
         PEA   ^L02E566
         PEA   L02E566
         PEA   $FFFF
         PEA   $0003
         JSL   L03AA53
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         BRA   L03A988
L03A967  PEA   $0001
         PEA   $0000
         PEA   $0000
         PEA   ^L02E567
         PEA   L02E567
         PEA   $FFFF
         PEA   $0003
         JSL   L03AA53
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L03A988  JSL   L01848A
         PEA   $0000
         TDC
         CLC
         ADC   #$FFBF
         PHA
         JSL   L03AA07
         PLY
         PLY
         LDX   #$FFBF
         LDA   $00,X
         SEP   #$20
         STA   $ED
         REP   #$20
         LDA   $ED
         AND   #$00FF
         SEC
         SBC   #$0041
         BVS   L03A9B4
         EOR   #$8000
L03A9B4  BPL   L03A9C8
         LDA   $ED
         AND   #$00FF
         SEC
         SBC   #$005A
         BEQ   L03A9EA
         BVS   L03A9C6
         EOR   #$8000
L03A9C6  BPL   L03A9EA
L03A9C8  LDA   $ED
         AND   #$00FF
         SEC
         SBC   #$0061
         BVS   L03A9D6
         EOR   #$8000
L03A9D6  BPL   L03A9EC
         LDA   $ED
         AND   #$00FF
         SEC
         SBC   #$007A
         BEQ   L03A9EA
         BVS   L03A9E8
         EOR   #$8000
L03A9E8  BMI   L03A9EC
L03A9EA  BRA   L03A9EE
L03A9EC  BRA   L03A988
L03A9EE  JSL   L01842F
         LDA   $ED
         AND   #$00FF
         PHA
         JSL   L03AD47
         PLY
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L03AA07  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00A0
         TCS
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         PEA   $00C8
         PEA   $0000
         TDC
         CLC
         ADC   #$00A2
         PHA
         _GetIText
         PEA   $0000
         TDC
         CLC
         ADC   #$00A2
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L015AC4
         PLY
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L03AA53  PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$0086
         TCS
         PEA   $0002
         _SetFontFlags
         SEC
         LDA   $FB
         SBC   #$0000
         BNE   L03AA80
         LDA   $FD
         SBC   #$0000
         BRA   L03AA87
L03AA80  LDA   $FD
         SBC   #$0000
         REP   #$02
L03AA87  BEQ   L03AAAC
         PEI   $FD
         PEI   $FB
         PEA   $0000
         TDC
         CLC
         ADC   #$008C
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         LDX   #$0000
         TDC
         CLC
         ADC   #$008C
         STX   $8A
         STA   $88
         BRA   L03AAB0
L03AAAC  STZ   $88
         STZ   $8A
L03AAB0  LDA   $FF
         ASL
         ASL
         ASL
         CLC
         ADC   #$000F
         STA   $DE
         LDA   $F5
         CMP   #$FFFF
         BNE   L03AAF9
         LDA   #$0002
         PHA
         PHA
         PEI   $F9
         PEI   $F7
         _CStringWidth
         LDAL  L02E59B
         SEC
         SBCL  L02E597
         CLC
         ADC   #$0001
         PLX
         STX   $EC
         SEC
         SBC   $EC
         SEC
         SBC   $DE
         SEC
         JSL   L019DD9
         PLY
         STA   $F5
L03AAF9  PEI   $F5
         PEI   $F3
         JSL   L0187D7
         PLY
         PHA
         _MoveTo
         PEI   $F9
         PEI   $F7
         _DrawCString
         PHA
         PEI   $F9
         PEI   $F7
         _CStringWidth
         LDA   $F5
         PLX
         STX   $EC
         CLC
         ADC   $EC
         CLC
         ADC   #$0003
         STA   $DC
         PEA   $0000
         TDC
         CLC
         ADC   #$00E0
         PHA
         PEI   $DC
         PEI   $F3
         JSL   L0187D7
         PLY
         SEC
         SBC   #$0009
         SEC
         SBC   #$0001
         PHA
         LDA   $DC
         CLC
         ADC   $DE
         SEC
         SBC   #$0003
         PHA
         PEI   $F3
         JSL   L0187D7
         PLY
         CLC
         ADC   #$0003
         PHA
         _SetRect
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         PEA   $00C8
         PEA   $0000
         TDC
         CLC
         ADC   #$00E0
         PHA
         PEA   $8011
         PEI   $8A
         PEI   $88
         PEI   $FF
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _NewDItem
         TDC
         CLC
         ADC   #$00ED
         TCS
         PLD
         RTL

L03ABC9  PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00E4
         TCS
         LDA   $F9
         SEC
         SBC   #$0000
         BEQ   L03ABF2
         BVS   L03ABE1
         EOR   #$8000
L03ABE1  BPL   L03ABF2
         LDA   $FB
         SEC
         SBC   #$0000
         BEQ   L03ABF2
         BVS   L03ABF0
         EOR   #$8000
L03ABF0  BMI   L03ABF8
L03ABF2  LDA   #$0000
         BRL   L03AD3D
L03ABF8  LDA   $F9
         PHA
         LDA   $FB
         SEC
         JSL   L019EFD
         PLA
         STA   $E8
L03AC05  LDA   [$FD]
         SEC
         SBC   #$0000
         BEQ   L03AC14
         BVS   L03AC12
         EOR   #$8000
L03AC12  BMI   L03AC6D
L03AC14  PEI   $FF
         PEI   $FD
         JSL   L03B042
         PLY
         PLY
         CMP   #$FFFF
         BNE   L03AC41
         LDA   $F9
         PHA
         LDA   $E8
         CLC
         ADC   $F9
         SEC
         SBC   #$0001
         CLC
         JSL   L019DD9
         PLY
         PHA
         LDA   $FB
         PLX
         STX   $EE
         SEC
         SBC   $EE
         BRL   L03AD3D
L03AC41  LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHX
         PHA
         SEC
         SBC   #$0001
         LDY   #$0002
         STA   [$FD],Y
         LDY   #$0004
         LDA   [$FD],Y
         SBC   #$0000
         LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         LDA   [$FD]
         PHA
         INC
         STA   [$FD]
         PLA
L03AC6D  LDA   [$FD]
         CMP   $E8
         BEQ   L03AC79
         BCC   L03AC79
         LDA   $E8
         BRA   L03AC7B
L03AC79  LDA   [$FD]
L03AC7B  STA   $E6
         LDA   $E6
         LDX   #$0000
         TAY
         BPL   L03AC86
         DEX
L03AC86  PHX
         PHA
         PEI   $E6
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHX
         PHA
         PEI   $F7
         PEI   $F5
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         JSL   L0198A5
         PLA
         PLX
         STX   $F7
         STA   $F5
         LDA   [$FD]
         SEC
         SBC   $E6
         STA   [$FD]
         LDA   $E6
         LDX   #$0000
         TAY
         BPL   L03ACBE
         DEX
L03ACBE  PHX
         PHA
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         JSL   L0198A5
         PLA
         PLX
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHX
         PHA
         LDY   #$000C
         LDA   [$FD],Y
         TAX
         LDY   #$000A
         LDA   [$FD],Y
         JSL   L019EF2
         PLA
         PLX
         PHA
         LDA   [$FD]
         SEC
         SBC   #$0000
         BVS   L03AD08
         EOR   #$8000
L03AD08  BMI   L03AD0F
         LDA   #$0000
         BRA   L03AD11
L03AD0F  LDA   [$FD]
L03AD11  PLX
         STX   $EA
         SEC
         SBC   $EA
         BEQ   L03AD2A
         BVS   L03AD1E
         EOR   #$8000
L03AD1E  BPL   L03AD2A
         PEI   $FF
         PEI   $FD
         JSL   L01DBBE
         PLY
         PLY
L03AD2A  LDA   $E8
         SEC
         SBC   $E6
         STA   $E8
         CMP   #$0000
         BNE   L03AD3A
         LDA   $FB
         BRA   L03AD3D
L03AD3A  BRL   L03AC05
L03AD3D  TAY
         TDC
         CLC
         ADC   #$00EF
         TCS
         TYA
         PLD
         RTL

L03AD47  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         SEC
         SBC   #$0061
         BVS   L03AD5D
         EOR   #$8000
L03AD5D  BPL   L03AD76
         LDA   $FF
         SEC
         SBC   #$007A
         BEQ   L03AD6E
         BVS   L03AD6C
         EOR   #$8000
L03AD6C  BMI   L03AD76
L03AD6E  LDA   $FF
         CLC
         ADC   #$FFE0
         STA   $FF
L03AD76  LDA   $FF
         TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

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

L03ADA5  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E4
         TCS
         LDA   $FF
         STA   $E8
         LDX   $FD
         LDA   $FB
         STX   $EC
         STA   $EA
         PEA   $0000
         TDC
         CLC
         ADC   #$00E8
         PHA
         PEA   $6600
         PEI   $F9
         JSL   L01E4EA
         PLY
         PLY
         PLY
         PLY
         STA   $E6
         LDA   $E6
         CMP   #$0000
         BNE   L03ADE1
         LDX   $EC
         LDA   $EA
         BRA   L03ADE7
L03ADE1  LDX   #$FFFF
         LDA   #$FFFF
L03ADE7  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L03ADF1  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         LDX   #$0000
         STX   L05018A
         STA   L050188
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L03AE0F  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         JSL   L03AFDF
         PHX
         PHA
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         JSL   L03AE3E
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L03AE3E  PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00E0
         TCS
         LDA   $FD
         CMP   #$0000
         BNE   L03AE66
         LDA   $FF
         CMP   #$0000
         BNE   L03AE66
         LDA   #$0017
         STA   L05017C
         LDX   #$0000
         LDA   #$0000
         BRL   L03AFD5
L03AE66  SEC
         LDA   $F5
         SBC   #$0000
         BNE   L03AE75
         LDA   $F7
         SBC   #$0000
         BRA   L03AE7C
L03AE75  LDA   $F7
         SBC   #$0000
         REP   #$02
L03AE7C  BEQ   L03AE88
         LDA   [$F5]
         AND   #$00FF
         CMP   #$0000
         BNE   L03AE97
L03AE88  LDA   #$0016
         STA   L05017C
         LDX   #$0000
         LDA   #$0000
         BRL   L03AFD5
L03AE97  LDY   #$0001
         LDA   [$F9],Y
         AND   #$00FF
         CMP   #$002B
         BEQ   L03AEB6
         LDY   #$0002
         LDA   [$F9],Y
         AND   #$00FF
         CMP   #$002B
         BEQ   L03AEB6
         LDA   #$0000
         BRA   L03AEB9
L03AEB6  LDA   #$0001
L03AEB9  STA   $E8
         LDY   #$0001
         LDA   [$F9],Y
         AND   #$00FF
         CMP   #$0062
         BEQ   L03AEDA
         LDY   #$0002
         LDA   [$F9],Y
         AND   #$00FF
         CMP   #$0062
         BEQ   L03AEDA
         LDA   #$0000
         BRA   L03AEDD
L03AEDA  LDA   #$0001
L03AEDD  STA   $E6
         LDA   [$F9]
         AND   #$00FF
         BRL   L03AF31
L03AEE7  LDA   $E8
         BEQ   L03AEF0
         LDA   #$0002
         BRA   L03AEF3
L03AEF0  LDA   #$0001
L03AEF3  ORA   #$0200
         ORA   #$0100
         STA   $E4
         BRL   L03AF43
L03AEFE  LDA   $E8
         BEQ   L03AF07
         LDA   #$0002
         BRA   L03AF0A
L03AF07  LDA   #$0001
L03AF0A  ORA   #$0008
         ORA   #$0100
         STA   $E4
         BRL   L03AF43
L03AF15  LDA   $E8
         BEQ   L03AF1E
         LDA   #$0002
         BRA   L03AF21
L03AF1E  LDA   #$0000
L03AF21  STA   $E4
         BRL   L03AF43
L03AF26  LDX   #$0000
         LDA   #$0000
         BRL   L03AFD5
         BRA   L03AF43
L03AF31  CMP   #$0061
         BEQ   L03AEFE
         CMP   #$0072
         BEQ   L03AF15
         CMP   #$0077
         BEQ   L03AEE7
         JMP   L03AF26

L03AF43  LDA   $E6
         BEQ   L03AF4E
         LDA   $E4
         ORA   #$0020
         STA   $E4
L03AF4E  PEI   $E4
         PEI   $F7
         PEI   $F5
         JSL   L01A61D
         PLY
         PLY
         PLY
         STA   $E2
         SEC
         SBC   #$0000
         BVS   L03AF66
         EOR   #$8000
L03AF66  BMI   L03AF70
         LDX   #$0000
         LDA   #$0000
         BRA   L03AFD5
L03AF70  LDA   #$0000
         STA   [$FD]
         LDA   $E2
         LDY   #$0012
         STA   [$FD],Y
         LDA   $E8
         BEQ   L03AF85
         LDA   #$0080
         BRA   L03AF97
L03AF85  LDA   [$F9]
         AND   #$00FF
         CMP   #$0072
         BNE   L03AF94
         LDA   #$0001
         BRA   L03AF97
L03AF94  LDA   #$0002
L03AF97  LDY   #$0010
         STA   [$FD],Y
         LDX   #$0000
         LDA   #$0000
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         LDY   #$000C
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$000A
         STA   [$FD],Y
         LDY   #$0008
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0006
         STA   [$FD],Y
         LDA   #$0000
         LDY   #$000E
         STA   [$FD],Y
         LDX   $FF
         LDA   $FD
L03AFD5  TAY
         TDC
         CLC
         ADC   #$00EF
         TCS
         TYA
         PLD
         RTL

L03AFDF  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         LDA   #L02EC44
         LDX   #^L02EC44
         STX   $F4
         STA   $F2
         BRA   L03B015
L03AFF6  LDY   #$0010
         LDA   [$F2],Y
         AND   #$0083
         CMP   #$0000
         BNE   L03B009
         LDX   $F4
         LDA   $F2
         BRA   L03B038
L03B009  LDA   $F2
         CLC
         ADC   #$0014
         STA   $F2
         BCC   L03B015
         INC   $F4
L03B015  SEC
         LDA   $F2
         SBC   L05017E
         BNE   L03B024
         LDA   $F4
         SBC   L05017E+2
         BRA   L03B02B
L03B024  LDA   $F4
         SBC   L05017E+2
         REP   #$02
L03B02B  BVS   L03B030
         EOR   #$8000
L03B030  BPL   L03AFF6
         LDX   #$0000
         LDA   #$0000
L03B038  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L03B042  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0081
         CMP   #$0000
         BNE   L03B060
         LDA   #$FFFF
         BRL   L03B1C7
L03B060  LDY   #$0010
         LDA   [$FD],Y
         ORA   #$0001
         LDY   #$0010
         STA   [$FD],Y
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0010
         TAY
         BEQ   L03B07E
         LDA   #$FFFF
         BRL   L03B1C7
L03B07E  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         JSL   L01A847
         BNE   L03B0A1
         PEI   $FF
         PEI   $FD
         JSL   L01D613
         PLY
         PLY
L03B0A1  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0100
         TAY
         BNE   L03B0AF
         BRL   L03B0F9
L03B0AF  LDA   #L02EC44
         LDX   #^L02EC44
         STX   $F0
         STA   $EE
         BRA   L03B0DC
L03B0BB  LDY   #$0010
         LDA   [$EE],Y
         AND   #$0102
         TAY
         BEQ   L03B0D0
         PEI   $F0
         PEI   $EE
         JSL   L01DDF8
         PLY
         PLY
L03B0D0  LDA   $EE
         CLC
         ADC   #$0014
         STA   $EE
         BCC   L03B0DC
         INC   $F0
L03B0DC  SEC
         LDA   $EE
         SBC   L05017E
         BNE   L03B0EB
         LDA   $F0
         SBC   L05017E+2
         BRA   L03B0F2
L03B0EB  LDA   $F0
         SBC   L05017E+2
         REP   #$02
L03B0F2  BVS   L03B0F7
         EOR   #$8000
L03B0F7  BPL   L03B0BB
L03B0F9  LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0004
         TAY
         BEQ   L03B121
         LDA   #$0001
         BRA   L03B126
L03B121  LDY   #$000E
         LDA   [$FD],Y
L03B126  PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         PHX
         PHA
         LDY   #$0012
         LDA   [$FD],Y
         PHA
         JSL   L01A1C2
         PLY
         PLY
         PLY
         PLY
         STA   [$FD]
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L03B152
         EOR   #$8000
L03B152  BPL   L03B184
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHX
         PHA
         CLC
         ADC   #$0001
         LDY   #$0002
         STA   [$FD],Y
         LDY   #$0004
         LDA   [$FD],Y
         BCC   L03B172
         INC
L03B172  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BRA   L03B1C7
L03B184  LDA   [$FD]
         CMP   #$FFFF
         BNE   L03B1B2
         LDY   #$0010
         LDA   [$FD],Y
         ORA   #$0010
         LDY   #$0010
         STA   [$FD],Y
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0080
         TAY
         BEQ   L03B1B0
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$FFFE
         LDY   #$0010
         STA   [$FD],Y
L03B1B0  BRA   L03B1BF
L03B1B2  LDY   #$0010
         LDA   [$FD],Y
         ORA   #$0020
         LDY   #$0010
         STA   [$FD],Y
L03B1BF  LDA   #$0000
         STA   [$FD]
         LDA   #$FFFF
L03B1C7  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

