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

* Segment 1, kind $0000

         MX    %00
	 REL

	 USE   MAIN.X.S

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

IRQ_MOUSE EQU $E10034
GSOS EQU $E100A8
	 
*

         PHA
         SEP   #$20
         LDA   #^appID
         PHA
         PLB
         REP   #$20
         PLA
*         STA   appID
         STX   L050014
         STY   L050012
	 
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS

	_TLStartUp

	PHA
	_MMStartUp
	PLA
	sta	mainID
	ora	#$0100
	sta	appID

         PHX
         PHA
         PEA   $0000
         PEA   $0100
         LDA   appID
         PHA
         PEA   $C011
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         STX   L050018
         STA   L050016
         STX   $F6
         ORA   $F6
         BNE   L01007C

         PEA   ^L020000
         PEA   L020000
         _WriteCString
         BRL   L01014A

L01007C  LDX   L050018
         LDA   L050016
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STA   $F4
         PEI   $F4
         _SANEStartUp
         LDX   L050014
         LDA   L050012
         PHX
         PHA
         JSL   L0192C0
         PLY
         PLY
         PEA   $0000
         JSL   L01A01A
         PLY
         LDA   #L040000
         LDX   #^L040000
         STX   $F2
         STA   $F0
         PEA   ^L020020
         PEA   L020020
         JSL   L019ED5		; DP stack
         PLY
         PLY
         TAY
         BNE   L0100E1

         LDX   L05000A
         LDA   L050008
         PHX
         PHA
         LDA   L050006
         PHA
         JSL   L010154
         PLY
         PLY
         PLY
         PHA
         JSL   L01A2A4
         PLY

L0100E1  LDA   appID
         ORA   #$0F00
         PHA
         _DisposeAll
         SEC
         LDA   L05000E
         SBC   #$0000
         BNE   L010109
         LDA   L050010
         SBC   #$0000
         BRA   L010111
L010109  LDA   L050010
         SBC   #$0000
         REP   #$02
L010111  BEQ   L010121
         LDX   L050010
         LDA   L05000E
         PHX
         PHA
         JSL   L019823
         PLY
         PLY
L010121  LDX   L050010
         LDA   L05000E
         PHA
         TXA
         STAL  L02002A
         PLA
         STAL  L020028
         LDA   L050000
         STAL  L02002C
         LDA   L05000C
         PHA
         PEA   ^L020028
         PEA   L020028
         JSL   L01AB12
         PLY
         PLY
         PLY
L01014A  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L010154  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00D9
         TCS
         STZ   L050045

         JSL   L01184E
         TAY
         BEQ   L01016D

         JSL   L011802
	 
L01016D  JSL   L031A72		; Load all tools

         LDA   #$0000
         SEP   #$20
         STAL  L0240FB
*         REP   #$20
*         SEP   #$20
         STAL  L0240FA
         REP   #$20
         PEA   $0002
         JSL   L03903A
         PLY
         PEA   $0001
         JSL   L010A55
         PLY
	 
* PROTECTION: JSL -> LDAL
*         JSL   L0322A5
	 
         JSL   L01574B
         JSL   L0151A2
         JSL   L01184E
         TAY
         BEQ   L0101B7

         PEA   $0000
         JSL   L01188C
         PLY
         PEA   $0000
         JSL   L0118DD
         PLY
L0101B7  LDA   #$0000
         STAL  L020350
         LDA   #$0001
         STA   L050045
         PEA   ^L037262
         PEA   L037262
         JSL   L018AA3
         PLY
         PLY
         PEA   ^L03170D
         PEA   L03170D
         JSL   L014C61
         PLY
         PLY
L0101DC  JSL   L033F68
         JSL   L01184E
         TAY
         BEQ   L01020C
         LDAL  L022C13
         AND   #$00FF
         BNE   L0101F9
         LDAL  L022C14
         AND   #$00FF
         BEQ   L01020C
L0101F9  LDA   #$0001
         SEP   #$20
         STAL  L022C14
         REP   #$20
         SEP   #$20
         STAL  L022C13
         REP   #$20
L01020C  LDA   #$0001
         STA   L0500E0
         JSL   L034198
         STZ   L0500E0
         JSL   L0349BD
L01021D  JSL   L01184E
         TAY
         BEQ   L010241
         JSL   L011866
         TAY
         BEQ   L010241
         LDA   #$FFFF
         STA   L0500A2
         SEP   #$20
         STZ   L050080
         REP   #$20
         STZ   L05001A
         LDA   #$0001
         STA   L0500D4
L010241  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L01024D
         EOR   #$8000
L01024D  BPL   L010258
         LDA   L0500A2
         PHA
         JSL   L010E7F
         PLY
L010258  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L010264
         EOR   #$8000
L010264  BPL   L0102A9
         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   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         SEC
         SBC   #$0000
         BEQ   L0102A9
         BVS   L01029E
         EOR   #$8000
L01029E  BPL   L0102A9
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
L0102A9  LDA   L050082
         AND   #$00FF
         BNE   L0102DE
         LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L0102BD
         EOR   #$8000
L0102BD  BPL   L0102DE
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C13
         LDX   #^L022C13
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BNE   L0102E9
L0102DE  LDA   L050080
         AND   #$00FF
         BNE   L0102E9
         BRL   L010375
L0102E9  LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         LDX   #$0000
         PHX
         PHA
         LDA   #L02002E
         LDX   #^L02002E
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   L050026
         LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         LDX   #$0000
         PHX
         PHA
         LDA   #L020033
         LDX   #^L020033
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   L050028
         LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020038
         LDX   #^L020038
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         STA   L05002A
         LDA   L050080
         AND   #$00FF
         STA   $E2
         JSL   L011973
         TAY
         BNE   L010372
         JSL   L0349BD
         BRL   L010A36
L010372  BRL   L010936
L010375  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L010381
         EOR   #$8000
L010381  BMI   L010386
         BRL   L0103F6
L010386  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   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BEQ   L0103BC
         JSL   L033F0F
         TAY
         BNE   L0103F6
L0103BC  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   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BNE   L0103F6
         LDA   L050082
         AND   #$00FF
         BNE   L0103F6
         BRL   L010936
L0103F6  STZ   $EC
L0103F8  LDA   $EC
         BEQ   L0103FF
         BRL   L010936
L0103FF  JSL   L031759
         LDA   L050065
         BEQ   L010449
         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   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BEQ   L01043F
         LDA   L050082
         AND   #$00FF
         BEQ   L010449
L01043F  PEA   $0004
         JSL   L0371DE
         PLY
         BRA   L0103F8
L010449  LDA   L05007F
         AND   #$00FF
         BNE   L010459
         LDA   L050083
         AND   #$00FF
         BEQ   L01045C
L010459  BRL   L010936
L01045C  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L010468
         EOR   #$8000
L010468  BMI   L01046D
         BRL   L01085C
L01046D  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   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BNE   L01049F
         BRL   L01085C
L01049F  LDA   L0500A2
         PHA
         JSL   L032033
         PLY
         TAY
         BNE   L0104AE
         BRL   L01085C
L0104AE  PEA   $0008
         JSL   L0371DE
         PLY
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         LDA   L0500A2
         PHA
         JSL   L011006
         PLY
         LDA   L0500A2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024156
         LDX   #^L024156
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$0000
         STA   [$F2]
         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   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0001
         BEQ   L01051D
         LDA   #$0000
         BRA   L010520
L01051D  LDA   #$0001
L010520  SEP   #$20
         STA   $DF
         REP   #$20
         LDA   $DF
         AND   #$00FF
         BNE   L01054A
         JSL   L01175C
         LDA   L0500C6
         BNE   L01054A
         PEA   $0008
         JSL   L0371DE
         PLY
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         BRL   L0103F8
L01054A  LDA   $DF
         AND   #$00FF
         PHA
         JSL   L035508
         PLY
         STA   $E8
         CMP   #$FFFF
         BNE   L010583
         PEA   $0000
         JSL   L0371DE
         PLY
         JSL   L01175C
         LDA   L0500C6
         BNE   L010581
         PEA   $0008
         JSL   L0371DE
         PLY
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         BRL   L0103FF
L010581  BRA   L01054A
L010583  LDA   $DF
         AND   #$00FF
         BNE   L010592
         PEA   $0008
         JSL   L0371DE
         PLY
L010592  LDA   $DF
         AND   #$00FF
         ORA   $E8
         SEP   #$20
         STA   $DF
         REP   #$20
         LDA   $DF
         AND   #$00FF
         BNE   L0105E5
         JSL   L01175C
         LDA   L0500C6
         BNE   L0105E5
         PEA   $0008
         JSL   L0371DE
         PLY
         JSL   L0155F1
         LDA   L0500A2
         PHA
         LDA   L0500AC
         AND   #$000F
         PHA
         LDA   #$0004
         PHA
         LDA   L0500AC
         SEC
         JSL   L0198D7
         JSL   L036175
         PLY
         PLY
         PLY
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         BRL   L0103F8
L0105E5  LDA   $DF
         AND   #$00FF
         PHA
         JSL   L035782
         PLY
         STA   $E8
         CMP   #$FFFF
         BEQ   L0105FA
         BRL   L010643
L0105FA  PEA   $0000
         JSL   L0371DE
         PLY
         JSL   L01175C
         LDA   L0500C6
         BNE   L010641
         PEA   $0008
         JSL   L0371DE
         PLY
         JSL   L0155F1
         LDA   L0500A2
         PHA
         LDA   L0500AC
         AND   #$000F
         PHA
         LDA   #$0004
         PHA
         LDA   L0500AC
         SEC
         JSL   L0198D7
         JSL   L036175
         PLY
         PLY
         PLY
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         BRL   L0103FF
L010641  BRA   L0105E5
L010643  LDA   $DF
         AND   #$00FF
         BNE   L010652
         PEA   $0008
         JSL   L0371DE
         PLY
L010652  LDA   $DF
         AND   #$00FF
         ORA   $E8
         SEP   #$20
         STA   $DF
         REP   #$20
         LDA   $DF
         AND   #$00FF
         BEQ   L010669
         BRL   L0106C9
L010669  JSL   L01175C
         LDA   L0500C6
         BEQ   L010675
         BRL   L0106C9
L010675  PEA   $0008
         JSL   L0371DE
         PLY
         JSL   L0155F1
         LDA   L0500A2
         PHA
         LDA   L0500AE
         AND   #$000F
         PHA
         LDA   #$0004
         PHA
         LDA   L0500AE
         SEC
         JSL   L0198D7
         JSL   L036175
         PLY
         PLY
         PLY
         LDA   L0500A2
         PHA
         LDA   L0500AC
         AND   #$000F
         PHA
         LDA   #$0004
         PHA
         LDA   L0500AC
         SEC
         JSL   L0198D7
         JSL   L036175
         PLY
         PLY
         PLY
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         BRL   L0103F8
L0106C9  LDA   $DF
         AND   #$00FF
         PHA
         JSL   L035B7A
         PLY
         CMP   #$FFFF
         BEQ   L0106DC
         BRL   L010746
L0106DC  PEA   $0000
         JSL   L0371DE
         PLY
         JSL   L01175C
         LDA   L0500C6
         BEQ   L0106F0
         BRL   L010744
L0106F0  PEA   $0008
         JSL   L0371DE
         PLY
         JSL   L0155F1
         LDA   L0500A2
         PHA
         LDA   L0500AE
         AND   #$000F
         PHA
         LDA   #$0004
         PHA
         LDA   L0500AE
         SEC
         JSL   L0198D7
         JSL   L036175
         PLY
         PLY
         PLY
         LDA   L0500A2
         PHA
         LDA   L0500AC
         AND   #$000F
         PHA
         LDA   #$0004
         PHA
         LDA   L0500AC
         SEC
         JSL   L0198D7
         JSL   L036175
         PLY
         PLY
         PLY
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         BRL   L0103FF
L010744  BRA   L0106C9
L010746  LDA   $DF
         AND   #$00FF
         BNE   L010755
         PEA   $0008
         JSL   L0371DE
         PLY
L010755  JSL   L036217
         LDA   L050082
         AND   #$00FF
         BEQ   L01076A
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
L01076A  LDA   #$0004
         PHA
         LDA   L0500AC
         SEC
         JSL   L0198D7
         LDA   L0500AC
         AND   #$000F
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $F6
         CLC
         ADC   $F6
         LDX   #$0000
         TAY
         BPL   L010793
         DEX
L010793  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $E8
         LDA   #$0004
         PHA
         LDA   L0500AE
         SEC
         JSL   L0198D7
         LDA   L0500AE
         AND   #$000F
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $F6
         CLC
         ADC   $F6
         LDX   #$0000
         TAY
         BPL   L0107D5
         DEX
L0107D5  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $E6
         LDA   #$0004
         PHA
         LDA   L0500B0
         SEC
         JSL   L0198D7
         LDA   L0500B0
         AND   #$000F
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $F6
         CLC
         ADC   $F6
         LDX   #$0000
         TAY
         BPL   L010817
         DEX
L010817  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $E4
         LDA   $E8
         EOR   #$FFFF
         INC
         PHA
         JSL   L016EAD
         PLY
         LDA   $E6
         EOR   #$FFFF
         INC
         PHA
         JSL   L016EAD
         PLY
         LDA   $E4
         EOR   #$FFFF
         INC
         PHA
         JSL   L016EAD
         PLY
         LDA   #$0001
         STA   $EC
         BRL   L010933
L01085C  LDA   L050082
         AND   #$00FF
         BEQ   L01086D
         LDA   L0500C6
         BNE   L01086D
         STZ   $E8
         BRA   L010886
L01086D  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L010879
         EOR   #$8000
L010879  BPL   L010881
         JSL   L03683D
         BRA   L010884
L010881  LDA   #$0000
L010884  STA   $E8
L010886  LDA   $E8
         CMP   #$FFFF
         BNE   L010890
         BRL   L010936
L010890  LDA   $E8
         BEQ   L0108B6
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BEQ   L0108B6
         BRL   L01091F
L0108B6  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L0108C2
         EOR   #$8000
L0108C2  BPL   L0108DC
         LDA   L05003F
         SEC
         SBC   #$000F
         BVS   L0108D0
         EOR   #$8000
L0108D0  BMI   L0108DC
         PEA   $0000
         JSL   L0371DE
         PLY
         BRA   L010908
L0108DC  LDA   L050082
         AND   #$00FF
         BEQ   L010908
         JSL   L011163
         TAY
         BEQ   L010908
         JSL   L0349BD
         LDA   L050020
         CMP   #$FFFF
         BEQ   L010900
         LDA   L050020
         PHA
         JSL   L010F6F
         PLY
L010900  LDA   #$FFFF
         STA   L050020
         BRA   L010936
L010908  LDA   L05007F
         AND   #$00FF
         BNE   L010918
         LDA   L050083
         AND   #$00FF
         BEQ   L01091C
L010918  BRA   L010936
         BRA   L01091F
L01091C  BRL   L0103F8
L01091F  JSL   L033DBD
         LDA   #$0001
         STA   $EC
         PEI   $E8
         JSL   L016EAD
         PLY
         JSL   L0349BD
L010933  BRL   L0103F8
L010936  LDA   L05006B
         BNE   L010943
         LDA   L050071
         BEQ   L010943
         STZ   L050069
L010943  LDA   L05007F
         AND   #$00FF
         BNE   L01094E
         BRL   L01099E
L01094E  JSL   L01184E
         TAY
         BEQ   L01095C
         SEP   #$20
         STZ   L050083
         REP   #$20
L01095C  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L010968
         EOR   #$8000
L010968  BPL   L01099B
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BEQ   L010992
         LDA   L0500A2
         PHA
         JSL   L010D91
         PLY
L010992  LDA   L0500A2
         PHA
         JSL   L0110DB
         PLY
L01099B  BRL   L010A3E
L01099E  JSL   L034198
         JSL   L0349BD
         LDA   L050083
         AND   #$00FF
         BNE   L0109B6
         LDA   L050082
         AND   #$00FF
         BEQ   L0109C0
L0109B6  SEP   #$20
         STZ   L050083
         REP   #$20
         BRL   L010A36
L0109C0  LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L0109F8
         BVS   L0109CE
         EOR   #$8000
L0109CE  BPL   L0109F8
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         BEQ   L0109F8
         LDA   L0500A2
         PHA
         JSL   L010D91
         PLY
L0109F8  LDA   L0500A2
         PHA
         JSL   L0110DB
         PLY
         JSL   L033E09
         STA   $F0
         LDA   $E2
         BEQ   L010A19
         LDA   L050080
         AND   #$00FF
         BNE   L010A19
         STZ   $E2
         JSL   L0124D1
L010A19  LDA   $F0
         SEC
         SBC   #$0000
         BVS   L010A24
         EOR   #$8000
L010A24  BMI   L010A36
         LDA   $F0
         EOR   #$FFFF
         INC
         SEC
         SBC   #$0001
         PHA
         JSL   L011517
         PLY
L010A36  LDA   #$0001
         BEQ   L010A3E
         BRL   L01021D
L010A3E  SEP   #$20
         STZ   L05007F
         REP   #$20
         LDA   #$0001
         BEQ   L010A4D
         BRL   L0101DC
L010A4D  TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L010A55  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   L0500BE
         STA   $F2
         BRL   L010ACF
L010A68  LDA   $FF
         BEQ   L010A7A
         LDA   $F2
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         BRA   L010A7D
L010A7A  LDA   #$0000
L010A7D  PHA
         LDA   $F2
         LDX   #$0000
         TAY
         BPL   L010A87
         DEX
L010A87  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L0240FE
         LDX   #^L0240FE
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         LDA   $F2
         LDX   #$0000
         TAY
         BPL   L010AAC
         DEX
L010AAC  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L022C17
         LDX   #^L022C17
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         JSL   L0323CF
         PLY
         PLY
         PLY
L010ACF  LDA   $F2
         DEC   $F2
         TAY
         BNE   L010A68
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L010ADE  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         LDA   L050082
         AND   #$00FF
         BEQ   L010B0D
         LDA   $FF
         SEC
         SBC   #$0053
         BEQ   L010B00
         BVS   L010AFE
         EOR   #$8000
L010AFE  BMI   L010B0D
L010B00  LDA   $FF
         SEC
         SBC   #$0038
         BVS   L010B0B
         EOR   #$8000
L010B0B  BMI   L010B2E
L010B0D  LDAL  L022976+2
         TAX
         LDAL  L022976
         PHX
         PHA
         LDAL  L02296E+2
         TAX
         LDAL  L02296E
         PHX
         PHA
         JSL   L031C2E
         PLY
         PLY
         PLY
         PLY
         BRL   L010D87
L010B2E  LDA   $FF
         SEC
         SBC   #$003C
         BVS   L010B39
         EOR   #$8000
L010B39  BPL   L010B3E
         BRL   L010B87
L010B3E  LDA   $FF
         AND   #$0003
         STA   $FF
         LDA   L0500BE
         STA   $F2
         BRA   L010B59
L010B4C  LDA   $F2
         CMP   $FF
         BEQ   L010B59
         PEI   $F2
         JSL   L010D91
         PLY
L010B59  LDA   $F2
         DEC   $F2
         TAY
         BNE   L010B4C
         LDA   L0500A2
         CMP   $FF
         BEQ   L010B7F
         LDA   L050080
         AND   #$00FF
         BNE   L010B7F
         LDA   L050081
         AND   #$00FF
         BNE   L010B7F
         PEA   $0008
         JSL   L0371DE
         PLY
L010B7F  LDA   $FF
         STA   L0500A2
         BRL   L010D87
L010B87  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L010B93
         EOR   #$8000
L010B93  BMI   L010B98
         BRL   L010D87
L010B98  LDA   $FF
         SEC
         SBC   #$0050
         BVS   L010BA3
         EOR   #$8000
L010BA3  BPL   L010BA8
         BRL   L010CF1
L010BA8  LDA   #$0002
         PHA
         LDA   $FF
         CLC
         ADC   #$0004
         AND   #$000C
         SEC
         JSL   L0198D7
         PLA
         STA   $F0
         LDA   $FF
         AND   #$0003
         STA   $EE
         LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BNE   L010BF4
         BRL   L010CEE
L010BF4  LDA   $EE
         CMP   L0500A2
         BEQ   L010C05
         LDA   $F0
         CMP   L0500A2
         BEQ   L010C05
         BRL   L010C73
L010C05  LDA   L050080
         AND   #$00FF
         BNE   L010C1D
         LDA   L050081
         AND   #$00FF
         BNE   L010C1D
         PEA   $0008
         JSL   L0371DE
         PLY
L010C1D  LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         DEC
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PLA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         INC
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PLA
         BRL   L010CEE
L010C73  LDA   L050080
         AND   #$00FF
         BNE   L010C8B
         LDA   L050081
         AND   #$00FF
         BNE   L010C8B
         PEA   $0008
         JSL   L0371DE
         PLY
L010C8B  LDA   $EE
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         DEC
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PLA
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         INC
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PLA
L010CEE  BRL   L010D87
L010CF1  LDA   $FF
         AND   #$0003
         STA   $F0
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BNE   L010D1A
         BRL   L010D87
L010D1A  LDA   L050080
         AND   #$00FF
         BNE   L010D32
         LDA   L050081
         AND   #$00FF
         BNE   L010D32
         PEA   $0008
         JSL   L0371DE
         PLY
L010D32  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         DEC
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PLA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A2
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         INC
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PLA
L010D87  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L010D91  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   L050081
         AND   #$00FF
         BEQ   L010DBB
         LDA   L050087
         BEQ   L010DB1
         LDA   L050080
         AND   #$00FF
         BEQ   L010DBB
L010DB1  JSL   L01184E
         TAY
         BNE   L010DBB
         BRL   L010E77
L010DBB  LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BNE   L010DDC
         BRL   L010E77
L010DDC  LDA   $FF
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $F2
         PEA   $000F
         PEI   $F2
         PEI   $F2
         PEI   $F2
         PEA   $0000
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L010E24
         DEX
L010E24  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PLX
         STX   $F8
         SEC
         SBC   $F8
         PHA
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L010E4F
         DEX
L010E4F  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L010E77  TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L010E7F  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   L050081
         AND   #$00FF
         BEQ   L010EA9
         LDA   L050087
         BEQ   L010E9F
         LDA   L050080
         AND   #$00FF
         BEQ   L010EA9
L010E9F  JSL   L01184E
         TAY
         BNE   L010EA9
         BRL   L010F67
L010EA9  LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BNE   L010ECA
         BRL   L010F67
L010ECA  LDA   $FF
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $F2
         PEA   $000F
         PEA   $000F
         PEA   $000F
         PEI   $F2
         PEA   $0000
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L010F14
         DEX
L010F14  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L024106
         LDX   #^L024106
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PLX
         STX   $F8
         SEC
         SBC   $F8
         PHA
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L010F3F
         DEX
L010F3F  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L010F67  TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L010F6F  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   L0500E0
         BNE   L010F9E
         LDA   L050081
         AND   #$00FF
         BEQ   L010F9E
         LDA   L050087
         BEQ   L010F94
         LDA   L050080
         AND   #$00FF
         BEQ   L010F9E
L010F94  JSL   L01184E
         TAY
         BNE   L010F9E
         BRL   L010FFE
L010F9E  LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024156
         LDX   #^L024156
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0001
         STA   [$F4]
         STZ   L050038
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020042
         LDX   #^L020042
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         BNE   L010FE1
         PEI   $FF
         JSL   L031F47
         PLY
L010FE1  LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020042
         LDX   #^L020042
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0001
         STA   [$F4]
L010FFE  TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L011006  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   L0500E0
         BNE   L01102B
         LDA   L050081
         AND   #$00FF
         BEQ   L01102B
         LDA   L050087
         BEQ   L011030
         LDA   L050080
         AND   #$00FF
         BNE   L011030
L01102B  LDA   L050038
         BEQ   L01103A
L011030  JSL   L01184E
         TAY
         BNE   L01103A
         BRL   L0110D1
L01103A  LDA   L050082
         AND   #$00FF
         BNE   L011045
         BRL   L0110A1
L011045  LDA   $FF
         CMP   L0500A2
         BNE   L011075
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L011070
         LDA   #$0000
         BRA   L011073
L011070  LDA   #$0001
L011073  BRA   L01109C
L011075  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L011099
         LDA   #$0000
         BRA   L01109C
L011099  LDA   #$0001
L01109C  TAY
         BEQ   L0110A1
         BRA   L0110D1
L0110A1  LDA   #$0001
         STA   L05002E
         STA   L050038
         PEI   $FF
         JSL   L031F65
         PLY
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020042
         LDX   #^L020042
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0000
         STA   [$F4]
         STZ   L05002E
L0110D1  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L0110DB  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   L0500E0
         BNE   L011107
         LDA   L050081
         AND   #$00FF
         BEQ   L011107
         LDA   L050087
         BEQ   L011100
         LDA   L050080
         AND   #$00FF
         BEQ   L011107
L011100  JSL   L01184E
         TAY
         BEQ   L011159
L011107  LDA   L050082
         AND   #$00FF
         BEQ   L011118
         PEI   $FF
         JSL   L010F6F
         PLY
         BRA   L011159
L011118  LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024156
         LDX   #^L024156
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0000
         STA   [$F4]
         PEI   $FF
         JSL   L031FE2
         PLY
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L020042
         LDX   #^L020042
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0000
         STA   [$F4]
L011159  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L011163  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         LDA   L0500C4
         BNE   L011179
         LDA   #$0000
         BRL   L01150D
L011179  LDA   L0500BE
         STA   $F4
         BRL   L011500
L011181  PEI   $F4
         JSL   L032033
         PLY
         TAY
         BNE   L01118E
         BRL   L0111ED
L01118E  LDA   $F4
         CMP   L0500A2
         BNE   L01119B
         LDA   #$0000
         BRL   L01150D
L01119B  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L0111C3
         LDA   #$0000
         BRL   L01150D
L0111C3  LDA   $F4
         STA   L050020
         PEI   $F4
         JSL   L011006
         PLY
         LDA   #$0050
         CLC
         ADC   $F4
         PHA
         JSL   L016EAD
         PLY
         LDA   #$0050
         CLC
         ADC   $F4
         PHA
         JSL   L010ADE
         PLY
         LDA   #$0001
         BRL   L01150D
L0111ED  LDA   $F4
         LDX   #$0000
         TAY
         BPL   L0111F6
         DEX
L0111F6  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L0500C2
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         JSL   L0197F7
         PLY
         SEC
         SBC   #$000C
         BVS   L01122A
         EOR   #$8000
L01122A  BPL   L01122F
         BRL   L011310
L01122F  LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L011244
         BVS   L01123D
         EOR   #$8000
L01123D  BPL   L011244
         LDA   #$0017
         BRA   L011247
L011244  LDA   #$0006
L011247  PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L011251
         DEX
L011251  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
         CLC
         ADC   $FA
         SEC
         SBC   L0500C4
         BNE   L01127B
         BRL   L011310
L01127B  BVS   L011280
         EOR   #$8000
L011280  BMI   L011285
         BRL   L011310
L011285  LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L01129A
         BVS   L011293
         EOR   #$8000
L011293  BPL   L01129A
         LDA   #$000C
         BRA   L01129D
L01129A  LDA   #$0006
L01129D  PHA
         LDA   L0500C0
         PHA
         LDA   #$000E
         SEC
         JSL   L019EFD
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L0112B3
         DEX
L0112B3  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
         PLX
         STX   $FA
         SEC
         SBC   $FA
         SEC
         SBC   L0500C4
         BVS   L0112E3
         EOR   #$8000
L0112E3  BMI   L011310
         LDA   $F4
         CMP   L0500A2
         BNE   L0112F2
         LDA   #$0000
         BRL   L01150D
L0112F2  LDA   #$0038
         CLC
         ADC   $F4
         PHA
         JSL   L016EAD
         PLY
         LDA   #$0038
         CLC
         ADC   $F4
         PHA
         JSL   L010ADE
         PLY
         LDA   #$0001
         BRL   L01150D
L011310  LDA   L0500BE
         STA   $F2
         BRL   L0114F6
L011318  LDA   $F2
         LDX   #$0000
         TAY
         BPL   L011321
         DEX
L011321  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L011333
         DEX
L011333  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
         LDA   L0500C2
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         JSL   L0197F7
         PLY
         SEC
         SBC   #$000C
         BVS   L011373
         EOR   #$8000
L011373  BPL   L011378
         BRL   L0114F6
L011378  LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L01138D
         BVS   L011386
         EOR   #$8000
L011386  BPL   L01138D
         LDA   #$0017
         BRA   L011390
L01138D  LDA   #$0006
L011390  PHA
         LDA   $F2
         LDX   #$0000
         TAY
         BPL   L01139A
         DEX
L01139A  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L0113AC
         DEX
L0113AC  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
         CLC
         ADC   $FA
         SEC
         SBC   L0500C4
         BNE   L0113E2
         BRL   L0114F6
L0113E2  BVS   L0113E7
         EOR   #$8000
L0113E7  BMI   L0113EC
         BRL   L0114F6
L0113EC  LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L011401
         BVS   L0113FA
         EOR   #$8000
L0113FA  BPL   L011401
         LDA   #$000C
         BRA   L011404
L011401  LDA   #$0006
L011404  PHA
         LDA   L0500C0
         PHA
         LDA   #$000E
         SEC
         JSL   L019EFD
         LDA   $F2
         LDX   #$0000
         TAY
         BPL   L01141A
         DEX
L01141A  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   $F4
         LDX   #$0000
         TAY
         BPL   L01142C
         DEX
L01142C  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
         PLX
         STX   $FA
         SEC
         SBC   $FA
         SEC
         SBC   L0500C4
         BVS   L011468
         EOR   #$8000
L011468  BPL   L01146D
         BRL   L0114F6
L01146D  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]
         AND   #$00FF
         SEC
         SBC   #$0000
         BEQ   L0114F6
         BVS   L0114B5
         EOR   #$8000
L0114B5  BPL   L0114F6
         LDA   $F4
         PHA
         LDA   #$0004
         SEC
         JSL   L019EFD
         LDA   #$003C
         PLX
         STX   $FA
         CLC
         ADC   $FA
         CLC
         ADC   $F2
         PHA
         JSL   L016EAD
         PLY
         LDA   $F4
         PHA
         LDA   #$0004
         SEC
         JSL   L019EFD
         LDA   #$003C
         PLX
         STX   $FA
         CLC
         ADC   $FA
         CLC
         ADC   $F2
         PHA
         JSL   L010ADE
         PLY
         LDA   #$0001
         BRA   L01150D
L0114F6  LDA   $F2
         DEC   $F2
         TAY
         BEQ   L011500
         BRL   L011318
L011500  LDA   $F4
         DEC   $F4
         TAY
         BEQ   L01150A
         BRL   L011181
L01150A  LDA   #$0000
L01150D  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L011517  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   L050081
         AND   #$00FF
         BEQ   L01153E
         LDA   L0500D8
         BNE   L01153E
         LDA   L050087
         BEQ   L01153E
         LDA   L0500D4
         BNE   L01153E
         LDA   #$0000
         BRA   L011541
L01153E  LDA   #$0001
L011541  STA   L050032
         LDA   L050032
         BEQ   L011553
         LDA   L0500D8
         BEQ   L011553
         LDA   L0500D4
         BEQ   L011556
L011553  STZ   L0500D8
L011556  LDA   $FF
         STA   L050030
         LDA   L050080
         AND   #$00FF
         BEQ   L011579
         JSL   L01184E
         TAY
         BNE   L011579
         LDA   L0500D6
         BEQ   L011576
         PEI   $FF
         JSL   L017C48
         PLY
L011576  BRL   L011622
L011579  PEI   $FF
         JSL   L017C48
         PLY
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L0240FA
         LDX   #^L0240FA
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         SEC
         SBC   #$00FF
         BVS   L0115A5
         EOR   #$8000
L0115A5  BMI   L0115C9
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L0240FA
         LDX   #^L0240FA
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         INC
         SEP   #$20
         STA   [$F4]
         REP   #$20
         BRA   L0115CC
L0115C9  STZ   L050032
L0115CC  PEA   $0000
         JSL   L016EAD
         PLY
         PEA   $0000
         PEA   $0000
         JSL   L018AA3
         PLY
         PLY
         JSL   L03727E
         JSL   L01184E
         TAY
         BEQ   L01160F
         SEP   #$20
         STZ   L050080
         REP   #$20
         JSL   L011879
         PEI   $FF
         JSL   L01162C
         PLY
         JSL   L0117DC
         JSL   L011879
         JSL   L031304
         JSL   L0117DC
         BRA   L011616
L01160F  PEI   $FF
         JSL   L01162C
         PLY
L011616  PEA   ^L037262
         PEA   L037262
         JSL   L018AA3
         PLY
         PLY
L011622  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L01162C  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$0098
         TCS
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L011640
         DEX
L011640  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   ^L02004A
         PEA   L02004A
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $0000
         PEA   ^L020057
         PEA   L020057
         PEA   ^L020056
         PEA   L020056
         PEA   ^L020055
         PEA   L020055
         PEA   ^L020052
         PEA   L020052
         JSL   L0180AF
         TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PEA   $0000
         TDC
         CLC
         ADC   #$009A
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$009C
         PHA
         JSL   L0185B3
         PLY
         PLY
         PLY
         PLY
         PEA   $0001
         JSL   L0187D7
         PLY
         STA   $A2
         LDA   #$0002
         PHA
         JSL   L01801A
         SEC
         JSL   L019DD9
         PLY
         SEC
         SBC   #$0032
         STA   $A0
         LDA   $FF
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $9E
         PEA   $000F
         PEI   $9E
         PEI   $9E
         PEI   $9E
         PEA   $0000
         LDA   $9C
         CLC
         ADC   $A2
         SEC
         SBC   #$0005
         PHA
         LDA   $9A
         CLC
         ADC   $A0
         SEC
         SBC   #$0005
         PHA
         JSL   L0331BA
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEI   $A2
         LDA   $A0
         CLC
         ADC   #$000F
         PHA
         JSL   L015A12
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         JSL   L015A39
         PLY
         PLY
         JSL   L01574B
         JSL   L01561C
         JSL   L01848A
         JSL   L01842F
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L01175C  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         JSL   L01561C
         JSL   L016161
         STZ   L0500C6
L011772  PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00F4
         PHA
         JSL   L015089
         PLY
         PLY
         PLY
         PLY
         BRL   L0117BD
L01178F  LDA   $F4
         STA   L0500C2
         LDA   $F2
         STA   L0500C4
         LDA   L0500A2
         PHA
         JSL   L032033
         PLY
         TAY
         BEQ   L0117A8
         BRL   L0117D2
L0117A8  LDA   #$0001
         STA   L0500C6
         BRL   L0117D2
L0117B1  BRL   L0117D2
L0117B4  BRL   L0117CD
L0117B7  DA    L01178F
         DA    L0117B1
         DA    L0117B4
L0117BD  DEC
         DEC
         DEC
         CMP   #$0002
         BCC   L0117C8
         LDA   #$0002
L0117C8  ASL
         TAX
         JMP   (L0117B7,X)

L0117CD  LDA   #$0001
         BNE   L011772
L0117D2  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

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

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

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

L011815  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L011828  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

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

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

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

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

L01188C  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         BNE   L0118B2
         JSL   L011879
L0118B2  JSL   L01848A
         LDA   $FF
         BNE   L0118BE
         JSL   L0117DC
L0118BE  JSL   L01842F
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L0118DD  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L0118F0  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L0500E6
         BNE   L01190D
         JSL   L032659
         TAY
         BEQ   L01190D
         LDA   #$0001
         STA   L0500E6
L01190D  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L011915  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L011929
         DEX
L011929  PHX
         PHA
         LDA   #L021667
         LDX   #^L021667
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $FF
         LDA   #$0009
         PHA
         LDA   $FF
         SEC
         JSL   L019DD9
         PLY
         PHA
         LDA   #$0009
         PHA
         LDA   $FF
         SEC
         JSL   L019DD9
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $F8
         CLC
         ADC   $F8
         TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L011973  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00CA
         TCS
         LDA   L0500DA
         SEC
         SBC   #$0004
         BVS   L01198A
         EOR   #$8000
L01198A  BMI   L011992
         LDA   #$0001
         STA   L05002C
L011992  LDA   L05002C
         BEQ   L0119BD
         LDA   L050080
         AND   #$00FF
         BNE   L0119BD
         JSL   L0176AD
         STA   $E6
         TAY
         BEQ   L0119BA
         JSL   L01184E
         TAY
         BNE   L0119BA
         PEI   $E6
         JSL   L011915
         PLY
         STA   $E6
         BRA   L0119BD
L0119BA  STZ   L05002C
L0119BD  LDA   L05002C
         BEQ   L0119CD
         LDA   L050080
         AND   #$00FF
         BNE   L0119CD
         BRL   L011C3B
L0119CD  LDA   L050080
         AND   #$00FF
         BEQ   L0119D8
         BRL   L011A84
L0119D8  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
         CMP   #$0001
         BNE   L011A42
         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
         BNE   L011A42
         LDA   #$00C8
         STA   L0500F0
         BRL   L011A7C
L011A42  LDA   L0500A2
         STA   L0500E8
         LDA   L050069
         BEQ   L011A52
         LDA   L05006B
         BNE   L011A7C
L011A52  LDA   L0500A2
         PHA
         JSL   L032568
         PLY
         STZ   L0500F2
         STZ   L0500E6
         JSL   L0325B6
         PEA   $3C8C
         JSL   L012587
         PLY
         JSL   L0325E6
         LDA   L05006B
         BEQ   L011A7C
         LDA   #$0001
         STA   L050069
L011A7C  LDA   L0500F0
         STA   $E6
         BRL   L011C3B
L011A84  STZ   L05002C
L011A87  LDA   #$0001
         BNE   L011A8F
         BRL   L011C3B
L011A8F  LDA   L050080
         AND   #$00FF
         BNE   L011AB5
         LDA   #$0000
         STA   L0500D6
         SEP   #$20
         STA   L050087
         REP   #$20
         SEP   #$20
         STA   L050081
         REP   #$20
         JSL   L0124D1
         LDA   #$0000
         BRL   L0124C7
L011AB5  JSL   L0178A9
         STA   $E6
         LDA   $E6
         SEC
         SBC   #$007A
         BVS   L011AC6
         EOR   #$8000
L011AC6  BPL   L011ADE
         LDA   $E6
         SEC
         SBC   #$007E
         BEQ   L011AD7
         BVS   L011AD5
         EOR   #$8000
L011AD5  BMI   L011ADE
L011AD7  PEI   $E6
         JSL   L030B71
         PLY
L011ADE  LDA   $E6
         BRL   L011BF1
L011AE3  BRA   L011A87
L011AE5  LDA   L050082
         AND   #$00FF
         BEQ   L011AF2
         LDA   #$0000
         BRA   L011AF5
L011AF2  LDA   #$0001
L011AF5  SEP   #$20
         STA   L050082
         REP   #$20
         JSL   L030702
         STZ   L050032
         LDA   #$0001
         STA   L0500E0
         JSL   L034198
         STZ   L0500E0
         LDA   L050082
         AND   #$00FF
         BEQ   L011B1B
         BRL   L011B83
L011B1B  LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BNE   L011B83
         LDA   L0500A2
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L011B60
         JSL   L033F0F
         TAY
         BNE   L011B83
L011B60  JSL   L033E09
         STA   $DE
         LDA   $DE
         SEC
         SBC   #$0000
         BVS   L011B71
         EOR   #$8000
L011B71  BMI   L011B83
         LDA   $DE
         EOR   #$FFFF
         INC
         SEC
         SBC   #$0001
         PHA
         JSL   L011517
         PLY
L011B83  BRL   L011A87
L011B86  LDA   $E6
         SEC
         SBC   #$006C
         SEP   #$20
         STA   L050061
         REP   #$20
         LDA   L050061
         AND   #$00FF
         PHA
         JSL   L030F9F
         PLY
L011B9F  BRL   L011A87
L011BA2  JSL   L033E09
         BRL   L011A87
L011BA9  LDA   $E6
         SEC
         SBC   #$0037
         BEQ   L011BCF
         BVS   L011BB6
         EOR   #$8000
L011BB6  BPL   L011BCF
         LDA   $E6
         SEC
         SBC   #$0054
         BVS   L011BC3
         EOR   #$8000
L011BC3  BMI   L011BCF
         PEI   $E6
         JSL   L010ADE
         PLY
         BRL   L011A87
L011BCF  LDA   $E6
         SEC
         SBC   #$0000
         BVS   L011BDA
         EOR   #$8000
L011BDA  BMI   L011BE6
         LDA   #$00C8
         SEC
         SBC   $E6
         STA   $E6
         BRA   L011BEF
L011BE6  PEI   $E6
         JSL   L011915
         PLY
         STA   $E6
L011BEF  BRA   L011C36
L011BF1  CMP   #$0000
         BNE   L011BF9
         BRL   L011AE3
L011BF9  CMP   #$0064
         BEQ   L011B9F
         CMP   #$0065
         BEQ   L011BA2
         CMP   #$0070
         BNE   L011C0B
         BRL   L011B86
L011C0B  CMP   #$0071
         BNE   L011C13
         BRL   L011B86
L011C13  CMP   #$0072
         BNE   L011C1B
         BRL   L011B86
L011C1B  CMP   #$0073
         BNE   L011C23
         BRL   L011B86
L011C23  CMP   #$0074
         BNE   L011C2B
         BRL   L011B86
L011C2B  CMP   #$007F
         BNE   L011C33
         BRL   L011AE5
L011C33  JMP   L011BA9

L011C36  BRA   L011C3B
         BRL   L011A87
L011C3B  LDA   $E6
         SEC
         SBC   #$00C8
         BVS   L011C46
         EOR   #$8000
L011C46  BPL   L011C4B
         BRL   L012109
L011C4B  LDA   L050087
         AND   #$00FF
         BEQ   L011C5F
         LDA   L0500D2
         SEC
         SBC   #$0001
         CMP   L05008C
         BEQ   L011C64
L011C5F  LDA   #$0000
         BRA   L011C67
L011C64  LDA   #$0001
L011C67  STA   L0500E0
         JSL   L034198
         LDA   #$0010
         PHA
         LDA   $E6
         SEC
         JSL   L019DD9
         PLY
         STA   $F0
         LDA   #$0010
         PHA
         LDA   $E6
         SEC
         JSL   L019DD9
         PLA
         STA   $EE
         LDA   $EE
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $F0
         LDX   #$0000
         TAY
         BPL   L011CA0
         DEX
L011CA0  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $EC
         PEI   $EC
         JSL   L016EAD
         PLY
         LDA   L0500A2
         LDX   #$0000
         TAY
         BPL   L011CCA
         DEX
L011CCA  STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDA   #L022C1F
         LDX   #^L022C1F
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         STA   $E2
         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
         PHA
         LDA   L0500C0
         SEC
         JSL   L019EFD
         LDA   L0500A2
         LDX   #$0000
         TAY
         BPL   L011D27
         DEX
L011D27  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
         STA   $E0
         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]
         AND   #$00FF
         CMP   #$0008
         BEQ   L011D9D
         BRL   L011F5F
L011D9D  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
         BNE   L011DCF
         BRL   L011F5C
L011DCF  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]
         PHA
         DEC
         SEP   #$20
         STA   [$F6]
         REP   #$20
         PLA
         JSL   L0349BD
         LDA   L0500A2
         PHA
         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
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   L050080
         AND   #$00FF
         BNE   L011E6F
         LDA   L050081
         AND   #$00FF
         BEQ   L011E7E
         LDA   L050087
         AND   #$00FF
         BNE   L011E7E
L011E6F  LDA   L0500E0
         BNE   L011E7E
         JSL   L01184E
         TAY
         BNE   L011E7E
         BRL   L011F5C
L011E7E  JSL   L034198
         LDA   #$0003
         STA   $F4
         BRL   L011F52
L011E8A  JSL   L0349BD
         LDA   #$0014
         STA   $D6
L011E93  LDA   $D6
         DEC   $D6
         TAY
         BNE   L011E93
         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   #$0008
         SEP   #$20
         STA   [$F6]
         REP   #$20
         JSL   L0349BD
         LDA   #$000A
         STA   $D4
L011EF2  LDA   $D4
         DEC   $D4
         TAY
         BNE   L011EF2
         LDA   L0500A2
         PHA
         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
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         PEA   $0001
         JSL   L0371DE
         PLY
L011F52  LDA   $F4
         DEC   $F4
         TAY
         BEQ   L011F5C
         BRL   L011E8A
L011F5C  BRL   L0120FF
L011F5F  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         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   L050080
         AND   #$00FF
         BNE   L011FAC
         LDA   L050081
         AND   #$00FF
         BEQ   L011FBB
         LDA   L050087
         AND   #$00FF
         BNE   L011FBB
L011FAC  LDA   L0500E0
         BNE   L011FBB
         JSL   L01184E
         TAY
         BNE   L011FBB
         BRL   L012064
L011FBB  LDA   #$0003
         STA   $DC
         BRL   L01205A
L011FC3  JSL   L0349BD
         LDA   #$0014
         STA   $D2
L011FCC  LDA   $D2
         DEC   $D2
         TAY
         BNE   L011FCC
         LDA   $F4
         PHA
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         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
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         JSL   L0349BD
         PEA   $0001
         JSL   L0371DE
         PLY
         LDA   #$000A
         STA   $D0
L01201C  LDA   $D0
         DEC   $D0
         TAY
         BNE   L01201C
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         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
L01205A  LDA   $DC
         DEC   $DC
         TAY
         BEQ   L012064
         BRL   L011FC3
L012064  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         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   L0500A2
         CMP   $F4
         BEQ   L0120D9
         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   L0120FF
L0120D9  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
L0120FF  STZ   L0500E0
         JSL   L0349BD
         BRL   L012494
L012109  LDA   $E6
         SEC
         SBC   #$00C8
         STA   $F2
         LDA   L050080
         AND   #$00FF
         BEQ   L01211C
         BRL   L012277
L01211C  LDA   $F2
         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   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   L0500AC
         LDA   L0500A2
         PHA
         LDA   L0500AC
         AND   #$000F
         PHA
         LDA   #$0010
         PHA
         LDA   L0500AC
         SEC
         JSL   L019DD9
         PLY
         PHA
         JSL   L0360CE
         PLY
         PLY
         PLY
         LDA   $F2
         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   $F6
         STX   $F8
         LDY   #$0001
         LDA   [$F6],Y
         AND   #$00FF
         STA   L0500AE
         LDA   L0500A2
         PHA
         LDA   L0500AE
         AND   #$000F
         PHA
         LDA   #$0010
         PHA
         LDA   L0500AE
         SEC
         JSL   L019DD9
         PLY
         PHA
         JSL   L0360CE
         PLY
         PLY
         PLY
         LDA   $F2
         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   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         AND   #$00FF
         STA   L0500B0
         LDA   L0500A2
         PHA
         LDA   L0500B0
         AND   #$000F
         PHA
         LDA   #$0010
         PHA
         LDA   L0500B0
         SEC
         JSL   L019DD9
         PLY
         PHA
         JSL   L0360CE
         PLY
         PLY
         PLY
         BRA   L0122A3
L012277  PEI   $F2
         JSL   L011915
         PLY
         STA   L0500AC
         JSL   L0178A9
         EOR   #$FFFF
         INC
         PHA
         JSL   L011915
         PLY
         STA   L0500AE
         JSL   L0178A9
         EOR   #$FFFF
         INC
         PHA
         JSL   L011915
         PLY
         STA   L0500B0
L0122A3  LDA   #$0010
         PHA
         LDA   L0500AC
         SEC
         JSL   L019DD9
         PLY
         PHA
         LDA   L0500AC
         AND   #$000F
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         LDX   #$0000
         TAY
         BPL   L0122CE
         DEX
L0122CE  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $EC
         LDA   #$0010
         PHA
         LDA   L0500AE
         SEC
         JSL   L019DD9
         PLY
         PHA
         LDA   L0500AE
         AND   #$000F
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         LDX   #$0000
         TAY
         BPL   L012312
         DEX
L012312  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $EA
         LDA   #$0010
         PHA
         LDA   L0500B0
         SEC
         JSL   L019DD9
         PLY
         PHA
         LDA   L0500B0
         AND   #$000F
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         LDX   #$0000
         TAY
         BPL   L012356
         DEX
L012356  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         STA   $E8
         LDA   $EC
         EOR   #$FFFF
         INC
         PHA
         JSL   L016EAD
         PLY
         LDA   $EA
         EOR   #$FFFF
         INC
         PHA
         JSL   L016EAD
         PLY
         LDA   $E8
         EOR   #$FFFF
         INC
         PHA
         JSL   L016EAD
         PLY
         LDA   L050087
         AND   #$00FF
         BEQ   L0123A7
         LDA   L0500D2
         SEC
         SBC   #$0001
         CMP   L05008C
         BEQ   L0123AC
L0123A7  LDA   #$0000
         BRA   L0123AF
L0123AC  LDA   #$0001
L0123AF  STA   L0500E0
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         JSL   L034198
         JSL   L0349BD
         LDA   L05006B
         BNE   L0123D0
         LDA   L05006D
         BNE   L0123D0
         BRL   L01241A
L0123D0  JSL   L01184E
         TAY
         BEQ   L0123DF
         PEA   $0008
         JSL   L0371DE
         PLY
L0123DF  LDA   #$1388
         STA   $F4
         LDA   #$0003
         STA   $DC
         BRA   L012413
L0123EB  LDA   L0500A2
         PHA
         JSL   L011006
         PLY
         LDA   $F4
         STA   $CE
L0123F8  LDA   $CE
         DEC   $CE
         TAY
         BNE   L0123F8
         LDA   L0500A2
         PHA
         JSL   L010F6F
         PLY
         LDA   $F4
         STA   $CC
L01240C  LDA   $CC
         DEC   $CC
         TAY
         BNE   L01240C
L012413  LDA   $DC
         DEC   $DC
         TAY
         BNE   L0123EB
L01241A  LDA   L0500A2
         PHA
         JSL   L011006
         PLY
         LDA   L0500A2
         PHA
         LDA   L0500AC
         AND   #$000F
         PHA
         LDA   #$0010
         PHA
         LDA   L0500AC
         SEC
         JSL   L019DD9
         PLY
         PHA
         JSL   L0360CE
         PLY
         PLY
         PLY
         LDA   L0500A2
         PHA
         LDA   L0500AE
         AND   #$000F
         PHA
         LDA   #$0010
         PHA
         LDA   L0500AE
         SEC
         JSL   L019DD9
         PLY
         PHA
         JSL   L0360CE
         PLY
         PLY
         PLY
         LDA   L0500A2
         PHA
         LDA   L0500B0
         AND   #$000F
         PHA
         LDA   #$0010
         PHA
         LDA   L0500B0
         SEC
         JSL   L019DD9
         PLY
         PHA
         JSL   L0360CE
         PLY
         PLY
         PLY
         JSL   L036217
         LDA   #$0001
         STA   L0500E0
         JSL   L034198
         STZ   L0500E0
L012494  LDA   L050080
         AND   #$00FF
         BNE   L0124C4
         LDA   L050081
         AND   #$00FF
         BEQ   L0124B0
         LDA   L050082
         AND   #$00FF
         BEQ   L0124B0
         JSL   L0124D1
L0124B0  LDA   #$0000
         STA   L0500D6
         SEP   #$20
         STA   L050087
         REP   #$20
         SEP   #$20
         STA   L050081
         REP   #$20
L0124C4  LDA   #$0001
L0124C7  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L0124D1  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         JSL   L034198
         JSL   L0349BD
         LDA   L0500BE
         STA   $F4
         BRL   L012575
L0124EC  LDA   $F4
         CMP   L0500A2
         BEQ   L012522
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L012518
         PEI   $F4
         JSL   L010D91
         PLY
L012518  PEI   $F4
         JSL   L0110DB
         PLY
         BRL   L012575
L012522  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L012547
         PEI   $F4
         JSL   L010E7F
         PLY
L012547  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         BEQ   L01256E
         PEI   $F4
         JSL   L010F6F
         PLY
         BRA   L012575
L01256E  PEI   $F4
         JSL   L0110DB
         PLY
L012575  LDA   $F4
         DEC   $F4
         TAY
         BEQ   L01257F
         BRL   L0124EC
L01257F  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L012587  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$FEB1
         TCS
         LDA   L0500A2
         BEQ   L01259C
         LDA   #$0000
         BRA   L01259F
L01259C  LDA   #$0001
L01259F  STA   $4E
         LDA   L0500F2
         BNE   L0125B0
         JSL   L0118F0
         LDA   L0500E6
         STA   L0500F2
L0125B0  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   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BNE   L012623
         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
         BNE   L012623
         LDA   #$3E80
         STA   L0500EA
         LDA   #$3E80
         STA   L0500EC
         STZ   L0500EE
         STZ   L0500F0
         BRL   L014736
L012623  LDA   #$C054
         STA   $86
         LDA   #$C054
         STA   $60
         STZ   L0500EE
         STZ   $84
         PEA   $0038
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$FFAC
         PHA
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
         PEA   $0089
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$FF23
         PHA
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
         PEA   $0051
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PEA   ^L0241CC
         PEA   L0241CC
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         STZ   $9A
         BRL   L012793
L012693  LDA   $9A
         LDX   #$0000
         PHX
         PHA
         LDA   #L0241CC
         LDX   #^L0241CC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B9
         REP   #$20
         AND   #$00FF
         CMP   #$0008
         BNE   L0126BD
         BRL   L012791
L0126BD  LDA   $9A
         LDX   #$0000
         TAY
         BPL   L0126C6
         DEX
L0126C6  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $BE
         LDA   $B9
         AND   #$00FF
         CMP   L0500A2
         BNE   L0126EE
         LDA   #$0002
         BRA   L0126F1
L0126EE  LDA   #$0008
L0126F1  STA   $98
         PHA
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         LDA   $BE
         LDX   #$0000
         TAY
         BPL   L01271D
         DEX
L01271D  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L02216F
         LDX   #^L02216F
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         LDX   #$0000
         TAY
         BPL   L01273F
         DEX
L01273F  PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STX   $A9
         STA   $A7
L012751  LDX   $A9
         LDA   $A7
         INC   $A7
         BNE   L01275B
         INC   $A9
L01275B  STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $74
         TAY
         BEQ   L012791
         LDA   $74
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FF23
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         ORA   $98
         SEP   #$20
         STA   [$F4]
         REP   #$20
         BRA   L012751
L012791  INC   $9A
L012793  LDA   $9A
         SEC
         SBC   #$0051
         BVS   L01279E
         EOR   #$8000
L01279E  BMI   L0127A3
         BRL   L012693
L0127A3  LDA   #$0018
         STA   $BE
         LDA   #$0000
         STA   $52
         STA   $54
         BRA   L01281F
L0127B1  LDA   $BE
         LDX   #$0000
         TAY
         BPL   L0127BA
         DEX
L0127BA  PHX
         PHA
         LDA   #L0215DD
         LDX   #^L0215DD
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L01281F
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   #$0002
         BNE   L0127FA
         INC   $54
         BRA   L01281F
L0127FA  LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   #$0008
         BNE   L01281F
         INC   $52
L01281F  LDA   $BE
         DEC   $BE
         TAY
         BNE   L0127B1
         LDA   #$0018
         STA   $BE
         BRL   L012ACB
L01282E  LDA   $BE
         LDX   #$0000
         TAY
         BPL   L012837
         DEX
L012837  PHX
         PHA
         LDA   #L0215DD
         LDX   #^L0215DD
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L012870
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L012873
L012870  BRL   L012ACB
L012873  LDA   $52
         SEC
         SBC   #$0006
         BVS   L01287E
         EOR   #$8000
L01287E  BPL   L012883
         BRL   L012922
L012883  LDA   $BE
         SEC
         SBC   #$0001
         LDX   #$0000
         TAY
         BPL   L012890
         DEX
L012890  PHX
         PHA
         LDA   #L0215DD
         LDX   #^L0215DD
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L0128D0
         LDA   $BE
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   #$0008
         BEQ   L012922
L0128D0  LDA   $BE
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L0128DD
         DEX
L0128DD  PHX
         PHA
         LDA   #L0215DD
         LDX   #^L0215DD
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L01291D
         LDA   $BE
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   #$0008
         BEQ   L012922
L01291D  LDA   #$0000
         BRA   L012925
L012922  LDA   #$0001
L012925  SEP   #$20
         STA   $AD
         REP   #$20
         LDA   $54
         SEC
         SBC   #$0006
         BVS   L012936
         EOR   #$8000
L012936  BPL   L01293B
         BRL   L0129D5
L01293B  LDA   $BE
         SEC
         SBC   #$0001
         LDX   #$0000
         TAY
         BPL   L012948
         DEX
L012948  PHX
         PHA
         LDA   #L0215DD
         LDX   #^L0215DD
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L012988
         LDA   $BE
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   #$0002
         BEQ   L0129D5
L012988  LDA   $BE
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L012995
         DEX
L012995  PHX
         PHA
         LDA   #L0215DD
         LDX   #^L0215DD
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L0129DA
         LDA   $BE
         CLC
         ADC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   #$0002
         BNE   L0129DA
L0129D5  LDA   #$0004
         BRA   L0129DD
L0129DA  LDA   #$0000
L0129DD  SEP   #$20
         STA   $AC
         REP   #$20
         LDA   $AC
         AND   #$00FF
         PHA
         LDA   $AD
         AND   #$00FF
         PLX
         STX   $F8
         CLC
         ADC   $F8
         SEP   #$20
         STA   $AB
         REP   #$20
         LDA   $AB
         AND   #$00FF
         BNE   L012A04
         BRL   L012ACB
L012A04  LDA   $AB
         AND   #$00FF
         CMP   #$0005
         BNE   L012A17
         LDA   #$0010
         SEP   #$20
         STA   $AB
         REP   #$20
L012A17  LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   $AB
         SEP   #$20
         STA   [$F4]
         REP   #$20
         LDA   $AB
         AND   #$00FF
         CMP   #$0010
         BNE   L012A45
         BRL   L012ACB
L012A45  LDA   $BE
         LDX   #$0000
         TAY
         BPL   L012A4E
         DEX
L012A4E  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L02216F
         LDX   #^L02216F
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         LDX   #$0000
         TAY
         BPL   L012A70
         DEX
L012A70  PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STX   $A9
         STA   $A7
L012A82  LDX   $A9
         LDA   $A7
         INC   $A7
         BNE   L012A8C
         INC   $A9
L012A8C  STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $74
         TAY
         BEQ   L012ACB
         LDA   $AB
         AND   #$00FF
         PHA
         LDA   $74
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FF23
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PLX
         STX   $F8
         ORA   $F8
         SEP   #$20
         STA   [$F4]
         REP   #$20
         BRA   L012A82
L012ACB  LDA   $BE
         DEC   $BE
         TAY
         BEQ   L012AD5
         BRL   L01282E
L012AD5  PEA   $0038
         PEA   $0000
         PEA   ^L024255
         PEA   L024255
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
         PEA   $0038
         PEA   $0000
         PEA   ^L02421D
         PEA   L02421D
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
         LDA   #L0221DF
         LDX   #^L0221DF
         STX   $F2
         STA   $F0
         INC   $F0
         BNE   L012B0D
         INC   $F2
L012B0D  LDA   #L022268
         LDX   #^L022268
         STX   $EE
         STA   $EC
         INC   $EC
         BNE   L012B1D
         INC   $EE
L012B1D  LDA   #L0222F1
         LDX   #^L0222F1
         STX   $EA
         STA   $E8
         INC   $E8
         BNE   L012B2D
         INC   $EA
L012B2D  LDA   #L02237A
         LDX   #^L02237A
         STX   $DE
         STA   $DC
         LDA   $DC
         CLC
         ADC   #$0002
         STA   $DC
         BCC   L012B43
         INC   $DE
L012B43  LDX   #$0000
         TDC
         CLC
         ADC   #$FF23
         STX   $E2
         STA   $E0
         INC   $E0
         BNE   L012B55
         INC   $E2
L012B55  LDA   #$0001
         STA   $BC
         BRL   L012EC6
L012B5D  LDA   [$F0]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B8
         REP   #$20
         AND   #$00FF
         CMP   #$0010
         BNE   L012B8C
         BRL   L012E85
L012B8C  LDA   [$EC]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B7
         REP   #$20
         AND   #$00FF
         CMP   #$0010
         BNE   L012BBB
         BRL   L012E85
L012BBB  LDA   [$E8]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B6
         REP   #$20
         AND   #$00FF
         CMP   #$0010
         BNE   L012BEA
         BRL   L012E85
L012BEA  LDA   $B6
         AND   #$00FF
         PHA
         LDA   $B7
         AND   #$00FF
         PHA
         LDA   $B8
         AND   #$00FF
         PLX
         STX   $F8
         ORA   $F8
         PLX
         STX   $F8
         ORA   $F8
         SEP   #$20
         STA   $B5
         REP   #$20
         LDA   $B5
         AND   #$00FF
         BNE   L012C15
         BRL   L012E85
L012C15  LDA   $B5
         AND   #$00FF
         AND   #$0003
         SEP   #$20
         STA   $B4
         REP   #$20
         LDA   $B5
         AND   #$00FF
         AND   #$000C
         SEP   #$20
         STA   $B3
         REP   #$20
         LDA   $B4
         AND   #$00FF
         BEQ   L012C42
         LDA   $B3
         AND   #$00FF
         BEQ   L012C42
         BRL   L012E85
L012C42  SEP   #$20
         STZ   $B0
         REP   #$20
         LDA   $B8
         AND   #$00FF
         AND   #$000A
         TAY
         BEQ   L012C59
         SEP   #$20
         INC   $B0
         REP   #$20
L012C59  LDA   $B7
         AND   #$00FF
         AND   #$000A
         TAY
         BEQ   L012C6A
         SEP   #$20
         INC   $B0
         REP   #$20
L012C6A  LDA   $B6
         AND   #$00FF
         AND   #$000A
         TAY
         BEQ   L012C7B
         SEP   #$20
         INC   $B0
         REP   #$20
L012C7B  LDA   $B0
         AND   #$00FF
         BNE   L012C85
         BRL   L012E85
L012C85  LDA   [$DC]
         LDX   #$0000
         TAY
         BPL   L012C8E
         DEX
L012C8E  PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STX   $A9
         STA   $A7
         LDA   $B4
         AND   #$00FF
         BNE   L012CAA
         BRL   L012D99
L012CAA  LDX   $A9
         LDA   $A7
         INC   $A7
         BNE   L012CB4
         INC   $A9
L012CB4  STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $BE
         TAY
         BEQ   L012D14
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $B0
         AND   #$00FF
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BEQ   L012D12
         BVS   L012CF1
         EOR   #$8000
L012CF1  BPL   L012D12
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   $B0
         SEP   #$20
         STA   [$F4]
         REP   #$20
L012D12  BRA   L012CAA
L012D14  LDA   $B0
         AND   #$00FF
         CMP   #$0003
         BEQ   L012D21
         BRL   L012D96
L012D21  LDA   [$E0]
         AND   #$00FF
         AND   #$0008
         TAY
         BNE   L012D2F
         BRL   L012D96
L012D2F  LDA   [$E8]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0003
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PHA
         LDA   [$EC]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PHA
         LDA   [$F0]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
L012D96  BRL   L012E85
L012D99  LDX   $A9
         LDA   $A7
         INC   $A7
         BNE   L012DA3
         INC   $A9
L012DA3  STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $BE
         TAY
         BEQ   L012E03
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $B0
         AND   #$00FF
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BEQ   L012E01
         BVS   L012DE0
         EOR   #$8000
L012DE0  BPL   L012E01
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   $B0
         SEP   #$20
         STA   [$F4]
         REP   #$20
L012E01  BRA   L012D99
L012E03  LDA   $B0
         AND   #$00FF
         CMP   #$0003
         BEQ   L012E10
         BRL   L012E85
L012E10  LDA   [$E0]
         AND   #$00FF
         AND   #$0002
         TAY
         BNE   L012E1E
         BRL   L012E85
L012E1E  LDA   [$E8]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0003
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PHA
         LDA   [$EC]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PHA
         LDA   [$F0]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
L012E85  LDA   $BC
         INC   $BC
         LDX   $F2
         LDA   $F0
         INC   $F0
         BNE   L012E93
         INC   $F2
L012E93  LDX   $EE
         LDA   $EC
         INC   $EC
         BNE   L012E9D
         INC   $EE
L012E9D  LDX   $EA
         LDA   $E8
         INC   $E8
         BNE   L012EA7
         INC   $EA
L012EA7  LDX   $DE
         LDA   $DC
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $DC
         LDA   $DE
         BCC   L012EB8
         INC
L012EB8  STA   $DE
         PLA
         PLX
         LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L012EC6
         INC   $E2
L012EC6  LDA   $BC
         SEC
         SBC   #$0089
         BVS   L012ED1
         EOR   #$8000
L012ED1  BMI   L012ED6
         BRL   L012B5D
L012ED6  STZ   $BA
         LDA   #L0221DF
         LDX   #^L0221DF
         STX   $F2
         STA   $F0
         INC   $F0
         BNE   L012EE8
         INC   $F2
L012EE8  LDA   #L022268
         LDX   #^L022268
         STX   $EE
         STA   $EC
         INC   $EC
         BNE   L012EF8
         INC   $EE
L012EF8  LDA   #L0222F1
         LDX   #^L0222F1
         STX   $EA
         STA   $E8
         INC   $E8
         BNE   L012F08
         INC   $EA
L012F08  LDX   #$0000
         TDC
         CLC
         ADC   #$FF23
         STX   $E2
         STA   $E0
         INC   $E0
         BNE   L012F1A
         INC   $E2
L012F1A  LDA   $4E
         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   [$F4]
         SEP   #$20
         STA   $C3
         REP   #$20
         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   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $C2
         REP   #$20
         LDA   #$0001
         STA   $BC
         BRL   L0135A9
L012F81  LDA   [$E0]
         AND   #$00FF
         STA   $8E
         LDA   #$0000
         SEP   #$20
         STA   [$E0]
         REP   #$20
         LDA   [$F0]
         AND   #$00FF
         STA   $94
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B8
         REP   #$20
         AND   #$00FF
         CMP   #$0010
         BNE   L012FC2
         BRL   L01357D
L012FC2  LDA   [$EC]
         AND   #$00FF
         STA   $92
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B7
         REP   #$20
         AND   #$00FF
         CMP   #$0010
         BNE   L012FF3
         BRL   L01357D
L012FF3  LDA   [$E8]
         AND   #$00FF
         STA   $90
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B6
         REP   #$20
         AND   #$00FF
         CMP   #$0010
         BNE   L013024
         BRL   L01357D
L013024  LDA   $B6
         AND   #$00FF
         AND   #$0003
         PHA
         LDA   $B7
         AND   #$00FF
         AND   #$0003
         ASL
         ASL
         PHA
         LDA   $B8
         AND   #$00FF
         AND   #$0003
         ASL
         ASL
         ASL
         ASL
         PLX
         STX   $F8
         CLC
         ADC   $F8
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $8C
         LDA   $B7
         AND   #$00FF
         AND   #$000C
         PHA
         LDA   #$0002
         PHA
         LDA   $B6
         AND   #$00FF
         AND   #$000C
         SEC
         JSL   L0198D7
         LDA   $B8
         AND   #$00FF
         AND   #$000C
         ASL
         ASL
         PLX
         STX   $F8
         CLC
         ADC   $F8
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $8A
         LDA   $8C
         BEQ   L01308D
         LDA   #$0000
         BRA   L013090
L01308D  LDA   #$0001
L013090  PHA
         LDA   $8A
         BEQ   L01309A
         LDA   #$0000
         BRA   L01309D
L01309A  LDA   #$0001
L01309D  PLX
         STX   $F4
         CMP   $F4
         BEQ   L0130A7
         BRL   L01312B
L0130A7  LDA   $8C
         BEQ   L0130AE
         BRL   L013128
L0130AE  LDA   $8A
         BEQ   L0130B5
         BRL   L013128
L0130B5  LDA   $8E
         AND   #$000A
         TAY
         BNE   L0130C0
         BRL   L013128
L0130C0  LDA   $94
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BNE   L01311A
         LDA   $92
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BNE   L01311A
         LDA   $90
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         BEQ   L01311F
L01311A  LDA   #$0081
         BRA   L013122
L01311F  LDA   #$0080
L013122  SEP   #$20
         STA   [$E0]
         REP   #$20
L013128  BRL   L01357D
L01312B  LDA   $8C
         BNE   L013132
         BRL   L0133D3
L013132  LDA   $94
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B2
         REP   #$20
         LDA   $92
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B9
         REP   #$20
         AND   #$00FF
         PHA
         LDA   $B2
         AND   #$00FF
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BVS   L013184
         EOR   #$8000
L013184  BMI   L01318E
         LDA   $B9
         SEP   #$20
         STA   $B2
         REP   #$20
L01318E  LDA   $90
         LDX   #$0000
         PHX
         PHA
         LDA   #L024255
         LDX   #^L024255
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B9
         REP   #$20
         AND   #$00FF
         PHA
         LDA   $B2
         AND   #$00FF
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BVS   L0131C1
         EOR   #$8000
L0131C1  BMI   L0131CB
         LDA   $B9
         SEP   #$20
         STA   $B2
         REP   #$20
L0131CB  SEP   #$20
         STZ   $AF
         REP   #$20
         LDA   $B8
         AND   #$00FF
         CMP   #$0002
         BNE   L0131E1
         SEP   #$20
         INC   $AF
         REP   #$20
L0131E1  LDA   $B7
         AND   #$00FF
         CMP   #$0002
         BNE   L0131F1
         SEP   #$20
         INC   $AF
         REP   #$20
L0131F1  LDA   $B6
         AND   #$00FF
         CMP   #$0002
         BNE   L013201
         SEP   #$20
         INC   $AF
         REP   #$20
L013201  LDA   $C2
         AND   #$00FF
         PHA
         LDA   $AF
         AND   #$00FF
         PLX
         STX   $F8
         CLC
         ADC   $F8
         SEC
         SBC   #$0003
         BVS   L01321B
         EOR   #$8000
L01321B  BMI   L013220
         BRL   L0133D0
L013220  LDA   $B2
         AND   #$00FF
         PHA
         LDA   $C3
         AND   #$00FF
         SEC
         SBC   #$0006
         BEQ   L013251
         BVS   L013236
         EOR   #$8000
L013236  BPL   L013251
         LDA   $C2
         AND   #$00FF
         SEC
         SBC   #$0006
         BEQ   L013251
         BVS   L013248
         EOR   #$8000
L013248  BPL   L013251
         LDA   $AF
         AND   #$00FF
         BRA   L013254
L013251  LDA   #$0002
L013254  PLX
         STX   $F4
         SEC
         SBC   $F4
         BVS   L01325F
         EOR   #$8000
L01325F  BMI   L013266
         LDA   #$0036
         BRA   L013269
L013266  LDA   #$0000
L013269  STA   $5C
         LDA   #$0002
         PHA
         LDA   $8E
         SEC
         JSL   L0198D7
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0241C8
         LDX   #^L0241C8
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CLC
         ADC   #$0001
         SEP   #$20
         STA   $B1
         REP   #$20
         LDA   $8C
         LDX   #$0000
         PHX
         PHA
         LDA   #L024188
         LDX   #^L024188
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $8C
         LDA   $AF
         AND   #$00FF
         CMP   #$0002
         BEQ   L0132C6
         BRL   L01337F
L0132C6  LDA   $5C
         BNE   L0132CD
         BRL   L01337F
L0132CD  LDA   $B1
         AND   #$00FF
         CMP   #$0001
         BEQ   L0132DA
         BRL   L01337F
L0132DA  LDA   $BC
         LDX   #$0000
         TAY
         BPL   L0132E3
         DEX
L0132E3  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L02237A
         LDX   #^L02237A
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         LDX   #$0000
         TAY
         BPL   L013305
         DEX
L013305  PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STX   $A9
         STA   $A7
L013317  LDX   $A9
         LDA   $A7
         INC   $A7
         BNE   L013321
         INC   $A9
L013321  STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $BE
         TAY
         BEQ   L01337F
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   #$0008
         BNE   L01337D
         LDA   $BE
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         SEC
         SBC   #$0003
         BVS   L013377
         EOR   #$8000
L013377  BMI   L01337D
         INC   $BA
         BRA   L01337F
L01337D  BRA   L013317
L01337F  LDA   $54
         BRL   L0133A8
L013384  LDA   $8C
         CMP   #$0003
         BEQ   L013392
         LDA   $8C
         CMP   #$0007
         BNE   L013395
L013392  BRL   L01357D
L013395  LDA   $8C
         CMP   #$0006
         BNE   L01339F
         BRL   L01357D
L01339F  BRL   L0133B9
L0133A2  DA    L013395
         DA    L013384
         DA    L01339F
L0133A8  SEC
         SBC   #$0004
         CMP   #$0002
         BCC   L0133B4
         LDA   #$0002
L0133B4  ASL
         TAX
         JMP   (L0133A2,X)

L0133B9  LDA   $B1
         AND   #$00FF
         PHA
         LDA   $8C
         PLX
         STX   $F8
         CLC
         ADC   $F8
         CLC
         ADC   $5C
         SEP   #$20
         STA   [$E0]
         REP   #$20
L0133D0  BRL   L01357D
L0133D3  LDA   $94
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B2
         REP   #$20
         LDA   $92
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B9
         REP   #$20
         AND   #$00FF
         PHA
         LDA   $B2
         AND   #$00FF
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BVS   L013425
         EOR   #$8000
L013425  BMI   L01342F
         LDA   $B9
         SEP   #$20
         STA   $B2
         REP   #$20
L01342F  LDA   $90
         LDX   #$0000
         PHX
         PHA
         LDA   #L02421D
         LDX   #^L02421D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $B9
         REP   #$20
         AND   #$00FF
         PHA
         LDA   $B2
         AND   #$00FF
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BVS   L013462
         EOR   #$8000
L013462  BMI   L01346C
         LDA   $B9
         SEP   #$20
         STA   $B2
         REP   #$20
L01346C  SEP   #$20
         STZ   $AF
         REP   #$20
         LDA   $B8
         AND   #$00FF
         CMP   #$0008
         BNE   L013482
         SEP   #$20
         INC   $AF
         REP   #$20
L013482  LDA   $B7
         AND   #$00FF
         CMP   #$0008
         BNE   L013492
         SEP   #$20
         INC   $AF
         REP   #$20
L013492  LDA   $B6
         AND   #$00FF
         CMP   #$0008
         BNE   L0134A2
         SEP   #$20
         INC   $AF
         REP   #$20
L0134A2  LDA   $C3
         AND   #$00FF
         PHA
         LDA   $AF
         AND   #$00FF
         PLX
         STX   $F8
         CLC
         ADC   $F8
         SEC
         SBC   #$0003
         BVS   L0134BC
         EOR   #$8000
L0134BC  BMI   L0134C1
         BRL   L01357D
L0134C1  LDA   $B2
         AND   #$00FF
         PHA
         LDA   $AF
         AND   #$00FF
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BEQ   L0134DB
         BVS   L0134D9
         EOR   #$8000
L0134D9  BMI   L0134E0
L0134DB  LDA   #$0036
         BRA   L0134E3
L0134E0  LDA   #$0000
L0134E3  STA   $5C
         LDA   $8E
         AND   #$0003
         LDX   #$0000
         PHX
         PHA
         LDA   #L0241C8
         LDX   #^L0241C8
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CLC
         ADC   #$001C
         SEP   #$20
         STA   $B1
         REP   #$20
         LDA   $8A
         LDX   #$0000
         PHX
         PHA
         LDA   #L024188
         LDX   #^L024188
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $8A
         LDA   $52
         BRL   L013555
L013531  LDA   $8A
         CMP   #$0003
         BEQ   L01353F
         LDA   $8A
         CMP   #$0007
         BNE   L013542
L01353F  BRL   L01357D
L013542  LDA   $8A
         CMP   #$0006
         BNE   L01354C
         BRL   L01357D
L01354C  BRL   L013566
L01354F  DA    L013542
         DA    L013531
         DA    L01354C
L013555  SEC
         SBC   #$0004
         CMP   #$0002
         BCC   L013561
         LDA   #$0002
L013561  ASL
         TAX
         JMP   (L01354F,X)

L013566  LDA   $B1
         AND   #$00FF
         PHA
         LDA   $8A
         PLX
         STX   $F8
         CLC
         ADC   $F8
         CLC
         ADC   $5C
         SEP   #$20
         STA   [$E0]
         REP   #$20
L01357D  LDA   $BC
         INC   $BC
         LDX   $F2
         LDA   $F0
         INC   $F0
         BNE   L01358B
         INC   $F2
L01358B  LDX   $EE
         LDA   $EC
         INC   $EC
         BNE   L013595
         INC   $EE
L013595  LDX   $EA
         LDA   $E8
         INC   $E8
         BNE   L01359F
         INC   $EA
L01359F  LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L0135A9
         INC   $E2
L0135A9  LDA   $BC
         SEC
         SBC   #$0089
         BVS   L0135B4
         EOR   #$8000
L0135B4  BMI   L0135B9
         BRL   L012F81
L0135B9  LDA   L0500A4
         SEC
         SBC   #$0007
         BVS   L0135C5
         EOR   #$8000
L0135C5  BMI   L0135F3
         LDA   L0500A4
         SEC
         SBC   #$0007
         BVS   L0135D3
         EOR   #$8000
L0135D3  BMI   L0135F3
         LDA   L0500A4
         SEC
         SBC   L050028
         BVS   L0135E1
         EOR   #$8000
L0135E1  BMI   L0135F3
         LDA   L0500F2
         BNE   L0135EB
         BRL   L013B55
L0135EB  LDA   L0500A4
         BNE   L0135F3
         BRL   L013B55
L0135F3  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   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $C3
         REP   #$20
         LDA   $4E
         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   [$F4]
         SEP   #$20
         STA   $C2
         REP   #$20
         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]
         SEP   #$20
         STA   $C1
         REP   #$20
         LDA   $4E
         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]
         SEP   #$20
         STA   $C0
         REP   #$20
         LDA   $BA
         PHA
         LDA   #$0082
         SEC
         JSL   L019EFD
         PLA
         STA   $7E
         LDA   $C1
         AND   #$00FF
         BEQ   L0136E0
         LDA   $C0
         AND   #$00FF
         BEQ   L0136E0
         LDA   L0500A4
         SEC
         SBC   #$0007
         BVS   L0136D9
         EOR   #$8000
L0136D9  BMI   L0136E0
         LDA   L0500F2
         BEQ   L0136E5
L0136E0  LDA   #$0000
         BRA   L0136E8
L0136E5  LDA   #$0001
L0136E8  STA   $72
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         STX   $F2
         STA   $F0
         INC   $F0
         BNE   L0136FC
         INC   $F2
L0136FC  LDA   #L02421D
         LDX   #^L02421D
         STX   $EE
         STA   $EC
         INC   $EC
         BNE   L01370C
         INC   $EE
L01370C  LDA   #L024255
         LDX   #^L024255
         STX   $EA
         STA   $E8
         INC   $E8
         BNE   L01371C
         INC   $EA
L01371C  LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         STX   $F2
         STA   $F0
         INC   $F0
         BNE   L01372E
         INC   $F2
L01372E  LDA   #L02421D
         LDX   #^L02421D
         STX   $EE
         STA   $EC
         INC   $EC
         BNE   L01373E
         INC   $EE
L01373E  LDA   #L024255
         LDX   #^L024255
         STX   $EA
         STA   $E8
         INC   $E8
         BNE   L01374E
         INC   $EA
L01374E  LDA   #$0001
         STA   $BE
         BRL   L01381C
L013756  LDA   $72
         BEQ   L01377C
         LDA   [$F0]
         AND   #$00FF
         AND   #$000A
         TAY
         BEQ   L01377C
         LDA   [$EC]
         AND   #$00FF
         CMP   #$0003
         BNE   L01377C
         LDA   [$EC]
         AND   #$00FF
         CMP   #$0003
         BNE   L01377C
         BRL   L013B55
L01377C  LDA   [$F0]
         AND   #$00FF
         AND   #$0008
         TAY
         BEQ   L0137A9
         LDA   [$EC]
         AND   #$00FF
         CMP   #$0002
         BNE   L0137A9
         LDA   [$E8]
         AND   #$00FF
         SEC
         SBC   #$0002
         BVS   L01379F
         EOR   #$8000
L01379F  BMI   L0137A9
         LDA   $7E
         CLC
         ADC   #$003C
         STA   $7E
L0137A9  LDA   [$F0]
         AND   #$00FF
         AND   #$0002
         TAY
         BEQ   L0137D6
         LDA   [$E8]
         AND   #$00FF
         CMP   #$0002
         BNE   L0137D6
         LDA   [$E8]
         AND   #$00FF
         SEC
         SBC   #$0002
         BVS   L0137CC
         EOR   #$8000
L0137CC  BMI   L0137D6
         LDA   $7E
         SEC
         SBC   #$003C
         STA   $7E
L0137D6  LDA   [$EC]
         AND   #$00FF
         CMP   #$0003
         BNE   L0137E8
         LDA   $7E
         CLC
         ADC   #$000A
         STA   $7E
L0137E8  LDA   [$E8]
         AND   #$00FF
         CMP   #$0003
         BNE   L0137FA
         LDA   $7E
         SEC
         SBC   #$000A
         STA   $7E
L0137FA  LDA   $BE
         INC   $BE
         LDX   $F2
         LDA   $F0
         INC   $F0
         BNE   L013808
         INC   $F2
L013808  LDX   $EE
         LDA   $EC
         INC   $EC
         BNE   L013812
         INC   $EE
L013812  LDX   $EA
         LDA   $E8
         INC   $E8
         BNE   L01381C
         INC   $EA
L01381C  LDA   $BE
         SEC
         SBC   #$0038
         BVS   L013827
         EOR   #$8000
L013827  BMI   L01382C
         BRL   L013756
L01382C  LDA   #$FFFF
         STA   $72
         LDA   $C1
         AND   #$00FF
         STA   $80
         BRL   L01389E
L01383B  LDA   $80
         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   #$0003
         LDA   [$F4],Y
         AND   #$00FF
         STA   $BC
         LDA   $72
         SEC
         SBC   $BC
         BVS   L013898
         EOR   #$8000
L013898  BMI   L01389E
         LDA   $BC
         STA   $72
L01389E  LDA   $80
         DEC   $80
         TAY
         BNE   L01383B
         LDA   $72
         CLC
         ADC   #$0001
         PHA
         LDA   #$028A
         SEC
         JSL   L019EFD
         LDA   $7E
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $7E
         LDA   $C0
         AND   #$00FF
         BNE   L013900
         LDA   $C2
         AND   #$00FF
         PHA
         LDA   $72
         CMP   #$FFFF
         BEQ   L0138DA
         LDA   $72
         CLC
         ADC   #$0002
         BRA   L0138DD
L0138DA  LDA   #$0000
L0138DD  PHA
         LDA   $C3
         AND   #$00FF
         PLX
         STX   $F8
         CLC
         ADC   $F8
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BEQ   L013900
         BVS   L0138F6
         EOR   #$8000
L0138F6  BPL   L013900
         LDA   $7E
         CLC
         ADC   #$03E8
         STA   $7E
L013900  LDA   #$FFFF
         STA   $72
         LDA   $C0
         AND   #$00FF
         STA   $80
         BRA   L013970
L01390E  LDA   $80
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $4E
         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   #$0003
         LDA   [$F4],Y
         AND   #$00FF
         STA   $BC
         LDA   $72
         SEC
         SBC   $BC
         BVS   L01396A
         EOR   #$8000
L01396A  BMI   L013970
         LDA   $BC
         STA   $72
L013970  LDA   $80
         DEC   $80
         TAY
         BNE   L01390E
         LDA   $72
         CLC
         ADC   #$0001
         PHA
         LDA   #$028A
         SEC
         JSL   L019EFD
         LDA   $7E
         PLX
         STX   $F8
         SEC
         SBC   $F8
         STA   $7E
         LDA   $C1
         AND   #$00FF
         BNE   L0139D2
         LDA   $72
         CMP   #$FFFF
         BEQ   L0139A6
         LDA   $72
         CLC
         ADC   #$0002
         BRA   L0139A9
L0139A6  LDA   #$0000
L0139A9  PHA
         LDA   $C2
         AND   #$00FF
         PLX
         STX   $F8
         CLC
         ADC   $F8
         PHA
         LDA   $C3
         AND   #$00FF
         PLX
         STX   $F4
         SEC
         SBC   $F4
         BEQ   L0139CA
         BVS   L0139C8
         EOR   #$8000
L0139C8  BMI   L0139D2
L0139CA  LDA   $7E
         SEC
         SBC   #$03E8
         STA   $7E
L0139D2  LDA   #$0000
         STA   $56
         STA   $58
         LDX   #$0000
         TDC
         CLC
         ADC   #$FF23
         STX   $F2
         STA   $F0
         INC   $F0
         BNE   L0139EB
         INC   $F2
L0139EB  LDA   #$0001
         STA   $BC
         BRL   L013ABB
L0139F3  LDA   [$F0]
         AND   #$00FF
         STA   $72
         TAY
         BNE   L013A00
         BRL   L013AAD
L013A00  LDA   $72
         SEC
         SBC   #$0080
         BVS   L013A0B
         EOR   #$8000
L013A0B  BMI   L013A69
         LDA   $BC
         LDX   #$0000
         TAY
         BPL   L013A16
         DEX
L013A16  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L02248C
         LDX   #^L02248C
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         LDA   $72
         PLX
         STX   $F8
         CLC
         ADC   $F8
         LDX   #$0000
         TAY
         BPL   L013A41
         DEX
L013A41  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L024EFF
         LDX   #^L024EFF
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         LDA   $7E
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $7E
         BRA   L013A78
L013A69  LDA   $72
         CMP   #$0080
         BNE   L013A78
         LDA   $7E
         CLC
         ADC   #$0003
         STA   $7E
L013A78  LDA   $72
         SEC
         SBC   #$0007
         BVS   L013A83
         EOR   #$8000
L013A83  BMI   L013A8C
         LDA   #$03E8
         STA   $58
         BRA   L013AAD
L013A8C  LDA   $72
         SEC
         SBC   #$0036
         BEQ   L013AAD
         BVS   L013A99
         EOR   #$8000
L013A99  BPL   L013AAD
         LDA   $72
         SEC
         SBC   #$003D
         BVS   L013AA6
         EOR   #$8000
L013AA6  BMI   L013AAD
         LDA   #$03E8
         STA   $56
L013AAD  LDA   $BC
         INC   $BC
         LDX   $F2
         LDA   $F0
         INC   $F0
         BNE   L013ABB
         INC   $F2
L013ABB  LDA   $BC
         SEC
         SBC   #$0089
         BVS   L013AC6
         EOR   #$8000
L013AC6  BMI   L013ACB
         BRL   L0139F3
L013ACB  LDA   $C3
         AND   #$00FF
         SEC
         SBC   #$0006
         BVS   L013AD9
         EOR   #$8000
L013AD9  BPL   L013AEB
         LDA   $C2
         AND   #$00FF
         SEC
         SBC   #$0006
         BVS   L013AE9
         EOR   #$8000
L013AE9  BMI   L013AFB
L013AEB  LDA   $58
         SEC
         SBC   $56
         PHA
         LDA   $7E
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $7E
L013AFB  LDA   $C2
         AND   #$00FF
         PHA
         LDA   $C3
         AND   #$00FF
         PLX
         STX   $F8
         SEC
         SBC   $F8
         PHA
         LDA   #$028A
         SEC
         JSL   L019EFD
         LDA   $7E
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $7E
         LDA   $7E
         SEC
         SBC   #$0000
         BEQ   L013B2E
         BVS   L013B2C
         EOR   #$8000
L013B2C  BMI   L013B33
L013B2E  LDA   #$0000
         BRA   L013B36
L013B33  LDA   #$0001
L013B36  CMP   L0500A2
         BEQ   L013B40
         LDA   #$0000
         BRA   L013B43
L013B40  LDA   #$0001
L013B43  STA   L0500F4
         STZ   L0500F0
         LDA   $7E
         EOR   #$FFFF
         INC
         STA   L0500EA
         BRL   L014736
L013B55  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   $82
         TAY
         BNE   L013B8A
         BRL   L013D02
L013B8A  STZ   $80
         BRL   L013CF3
L013B8F  LDA   $80
         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   L0500AC
         LDA   $80
         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   L0500AE
         LDA   $80
         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   L0500B0
         INC   L0500A4
         JSL   L014740
         JSL   L036217
         JSL   L034198
         LDA   $4E
         STA   L0500A2
         INC   L050028
         LDA   $86
         EOR   #$FFFF
         INC
         PHA
         JSL   L012587
         PLY
         DEC   L050028
         LDA   L0500EA
         STA   $7A
         LDA   L0500A2
         BEQ   L013CBD
         LDA   #$0000
         BRA   L013CC0
L013CBD  LDA   #$0001
L013CC0  STA   L0500A2
         DEC   L0500A4
         LDA   $7A
         SEC
         SBC   $86
         BEQ   L013CE0
         BVS   L013CD2
         EOR   #$8000
L013CD2  BPL   L013CE0
         LDA   $7A
         STA   $86
         LDA   $80
         CLC
         ADC   #$00C8
         STA   $78
L013CE0  LDA   $86
         SEC
         SBC   $FF
         BEQ   L013CF1
         BVS   L013CEC
         EOR   #$8000
L013CEC  BPL   L013CF1
         BRL   L0146F3
L013CF1  INC   $80
L013CF3  LDA   $80
         SEC
         SBC   $82
         BVS   L013CFD
         EOR   #$8000
L013CFD  BMI   L013D02
         BRL   L013B8F
L013D02  LDA   $82
         SEC
         SBC   L050026
         BVS   L013D0D
         EOR   #$8000
L013D0D  BMI   L013D5B
         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   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         SEC
         SBC   #$0000
         BEQ   L013D5B
         BVS   L013D47
         EOR   #$8000
L013D47  BPL   L013D5B
         LDA   L0500A4
         SEC
         SBC   L050028
         BVS   L013D55
         EOR   #$8000
L013D55  BPL   L013D5E
         LDA   $82
         BEQ   L013D5E
L013D5B  BRL   L0146F3
L013D5E  LDA   L050026
         SEC
         SBC   $82
         STA   $70
         LDA   #$0000
         STA   $50
         STA   $6E
         LDA   #$C180
         STA   $6C
         LDX   #$0000
         TDC
         CLC
         ADC   #$0026
         STX   $DE
         STA   $DC
         LDX   #$0000
         TDC
         CLC
         ADC   #$003A
         STX   $DA
         STA   $D8
         STZ   $9C
         BRA   L013DC6
L013D8E  LDA   #$C180
         STA   [$DC]
         LDA   #$0000
         STA   [$D8]
         LDA   $9C
         INC   $9C
         LDX   $DE
         LDA   $DC
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $DC
         LDA   $DE
         BCC   L013DAD
         INC
L013DAD  STA   $DE
         PLA
         PLX
         LDX   $DA
         LDA   $D8
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $D8
         LDA   $DA
         BCC   L013DC2
         INC
L013DC2  STA   $DA
         PLA
         PLX
L013DC6  LDA   $9C
         SEC
         SBC   $70
         BVS   L013DD0
         EOR   #$8000
L013DD0  BPL   L013D8E
         PEA   $0070
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$FEB3
         PHA
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFAC
         STX   $F2
         STA   $F0
         INC   $F0
         BNE   L013DFB
         INC   $F2
L013DFB  LDX   #$0000
         TDC
         CLC
         ADC   #$FEB3
         STX   $DE
         STA   $DC
         LDA   $DC
         CLC
         ADC   #$0002
         STA   $DC
         BCC   L013E13
         INC   $DE
L013E13  LDA   #L0215DD
         LDX   #^L0215DD
         STX   $EE
         STA   $EC
         INC   $EC
         BNE   L013E23
         INC   $EE
L013E23  LDA   #L02216F
         LDX   #^L02216F
         STX   $D6
         STA   $D4
         LDA   $D4
         CLC
         ADC   #$0002
         STA   $D4
         BCC   L013E39
         INC   $D6
L013E39  LDX   #$0000
         TDC
         CLC
         ADC   #$FFE4
         STX   $E6
         STA   $E4
         INC   $E4
         BNE   L013E4B
         INC   $E6
L013E4B  LDA   #L0220FF
         LDX   #^L0220FF
         STX   $DA
         STA   $D8
         LDA   $D8
         CLC
         ADC   #$0002
         STA   $D8
         BCC   L013E61
         INC   $DA
L013E61  LDA   $4E
         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   [$F4]
         SEP   #$20
         STA   $C3
         REP   #$20
         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]
         SEP   #$20
         STA   $C2
         REP   #$20
         LDA   $4E
         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]
         SEP   #$20
         STA   $C1
         REP   #$20
         LDA   #$0001
         STA   $BE
         BRL   L014320
L013EF7  LDA   [$F0]
         SEP   #$20
         STA   $AD
         REP   #$20
         AND   #$00FF
         SEC
         SBC   #$0001
         BEQ   L013F17
         BVS   L013F0D
         EOR   #$8000
L013F0D  BPL   L013F17
         LDA   #$C054
         STA   [$DC]
         BRL   L0142BF
L013F17  STZ   $6A
         LDA   [$D8]
         LDX   #$0000
         TAY
         BPL   L013F22
         DEX
L013F22  PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STX   $A9
         STA   $A7
L013F34  LDX   $A9
         LDA   $A7
         INC   $A7
         BNE   L013F3E
         INC   $A9
L013F3E  STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $BC
         TAY
         BNE   L013F4F
         BRL   L014151
L013F4F  LDA   $BC
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FF23
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $AE
         REP   #$20
         LDA   $AE
         AND   #$00FF
         CMP   #$0000
         BNE   L013F7C
         BRA   L013F34
L013F7C  LDA   $AD
         AND   #$00FF
         BEQ   L013F86
         BRL   L01410A
L013F86  LDA   $AE
         AND   #$00FF
         CMP   #$0080
         BNE   L013FBA
         LDA   [$EC]
         AND   #$00FF
         BEQ   L013FB7
         LDA   $BE
         AND   #$0001
         TAY
         BEQ   L013FB7
         LDA   $C3
         AND   #$00FF
         SEC
         SBC   #$0008
         BVS   L013FAD
         EOR   #$8000
L013FAD  BMI   L013FB7
         LDA   $6A
         CLC
         ADC   #$0032
         STA   $6A
L013FB7  BRL   L013F34
L013FBA  LDA   $AE
         AND   #$00FF
         CMP   #$0081
         BNE   L013FDE
         LDA   [$EC]
         AND   #$00FF
         BEQ   L013FDB
         LDA   $BE
         AND   #$0001
         TAY
         BEQ   L013FDB
         LDA   $6A
         CLC
         ADC   #$0003
         STA   $6A
L013FDB  BRL   L013F34
L013FDE  LDA   $AE
         AND   #$00FF
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L025413
         LDX   #^L025413
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $7E
         LDA   $C2
         AND   #$00FF
         BEQ   L014036
         LDA   #$0036
         PHA
         LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$0001
         SEC
         JSL   L019DD9
         PLA
         SEC
         SBC   #$001B
         BVS   L014026
         EOR   #$8000
L014026  BMI   L014036
         LDA   #$0008
         PHA
         LDA   $7E
         SEC
         JSL   L019DD9
         PLY
         STA   $7E
L014036  LDA   $C1
         AND   #$00FF
         BEQ   L01406B
         LDA   #$0036
         PHA
         LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$0001
         SEC
         JSL   L019DD9
         PLA
         SEC
         SBC   #$001A
         BEQ   L01406B
         BVS   L01405B
         EOR   #$8000
L01405B  BPL   L01406B
         LDA   #$0008
         PHA
         LDA   $7E
         SEC
         JSL   L019DD9
         PLY
         STA   $7E
L01406B  LDA   $AE
         AND   #$00FF
         PHA
         LDA   L0500F4
         CMP   L0500A2
         BNE   L01407E
         LDA   #$0054
         BRA   L014081
L01407E  LDA   #$0039
L014081  PLX
         STX   $F4
         CMP   $F4
         BNE   L01408F
         LDA   $6A
         CLC
         ADC   $7E
         STA   $6A
L01408F  LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$0052
         BEQ   L014108
         BVS   L01409F
         EOR   #$8000
L01409F  BPL   L014108
         LDA   #$0003
         PHA
         LDA   #$0009
         PHA
         LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$0001
         SEC
         JSL   L019DD9
         PLA
         SEC
         JSL   L019DD9
         PLY
         SEP   #$20
         STA   $AF
         REP   #$20
         LDA   $AF
         AND   #$00FF
         SEC
         SBC   #$0002
         BVS   L0140D2
         EOR   #$8000
L0140D2  BMI   L014108
         LDA   $AF
         AND   #$00FF
         PHA
         LDA   #$0003
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   #$0002
         SEP   #$20
         STA   $AF
         REP   #$20
         LDA   [$D4]
         LDX   #$0000
         TAY
         BPL   L0140F6
         DEX
L0140F6  PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STX   $A5
         STA   $A3
L014108  BRA   L014147
L01410A  LDA   $AE
         AND   #$00FF
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L025339
         LDX   #^L025339
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $7E
         LDA   $AE
         AND   #$00FF
         CMP   #$0038
         BNE   L014147
         LDA   L0500F4
         CMP   $4E
         BNE   L014147
         LDA   $6A
         CLC
         ADC   $7E
         STA   $6A
L014147  LDA   $6A
         CLC
         ADC   $7E
         STA   $6A
         BRL   L013F34
L014151  LDA   [$EC]
         AND   #$00FF
         BEQ   L014160
         LDA   $6A
         SEC
         SBC   #$0001
         STA   $6A
L014160  LDA   [$D4]
         LDX   #$0000
         TAY
         BPL   L014169
         DEX
L014169  PHX
         PHA
         LDA   #L02169F
         LDX   #^L02169F
         JSL   L0198A5
         PLA
         PLX
         STX   $A9
         STA   $A7
         SEP   #$20
         STZ   $A2
         REP   #$20
L014181  LDX   $A9
         LDA   $A7
         INC   $A7
         BNE   L01418B
         INC   $A9
L01418B  STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $BC
         TAY
         BNE   L01419C
         BRL   L0142B0
L01419C  LDA   $BC
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FF23
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEP   #$20
         STA   $AE
         REP   #$20
         AND   #$00FF
         SEC
         SBC   #$007F
         BEQ   L0141CF
         BVS   L0141CB
         EOR   #$8000
L0141CB  BPL   L0141CF
         BRA   L014181
L0141CF  LDA   $AE
         AND   #$00FF
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L0254ED
         LDX   #^L0254ED
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $74
         LDA   $74
         SEC
         SBC   #$FFE7
         BVS   L0141FF
         EOR   #$8000
L0141FF  BPL   L014206
         LDA   #$0000
         BRA   L014209
L014206  LDA   #$0001
L014209  PHA
         LDA   $A2
         AND   #$00FF
         PLX
         STX   $F8
         ORA   $F8
         SEP   #$20
         STA   $A2
         REP   #$20
         LDA   $6A
         CLC
         ADC   $74
         STA   $6A
         LDA   L0500F4
         CMP   L0500A2
         BNE   L014276
         LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$0037
         BVS   L014237
         EOR   #$8000
L014237  BMI   L01424B
         LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$001B
         BEQ   L01424B
         BVS   L014249
         EOR   #$8000
L014249  BMI   L01426D
L01424B  LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$006D
         BVS   L014259
         EOR   #$8000
L014259  BMI   L014274
         LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$0051
         BEQ   L014274
         BVS   L01426B
         EOR   #$8000
L01426B  BPL   L014274
L01426D  LDA   $6A
         CLC
         ADC   $74
         STA   $6A
L014274  BRA   L0142AD
L014276  LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$0009
         BEQ   L0142AD
         BVS   L014286
         EOR   #$8000
L014286  BPL   L0142AD
         LDA   $AE
         AND   #$00FF
         SEC
         SBC   #$0018
         BVS   L014296
         EOR   #$8000
L014296  BMI   L0142AD
         LDA   $74
         PHA
         LDA   #$0008
         SEC
         JSL   L019EFD
         LDA   $6A
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $6A
L0142AD  BRL   L014181
L0142B0  LDA   [$DC]
         CLC
         ADC   $6A
         STA   [$DC]
         LDA   $A2
         SEP   #$20
         STA   [$E4]
         REP   #$20
L0142BF  LDA   $BE
         INC   $BE
         LDX   $F2
         LDA   $F0
         INC   $F0
         BNE   L0142CD
         INC   $F2
L0142CD  LDX   $DE
         LDA   $DC
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $DC
         LDA   $DE
         BCC   L0142DE
         INC
L0142DE  STA   $DE
         PLA
         PLX
         LDX   $EE
         LDA   $EC
         INC   $EC
         BNE   L0142EC
         INC   $EE
L0142EC  LDX   $D6
         LDA   $D4
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $D4
         LDA   $D6
         BCC   L0142FD
         INC
L0142FD  STA   $D6
         PLA
         PLX
         LDX   $E6
         LDA   $E4
         INC   $E4
         BNE   L01430B
         INC   $E6
L01430B  LDX   $DA
         LDA   $D8
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $D8
         LDA   $DA
         BCC   L01431C
         INC
L01431C  STA   $DA
         PLA
         PLX
L014320  LDA   $BE
         SEC
         SBC   #$0038
         BVS   L01432B
         EOR   #$8000
L01432B  BMI   L014330
         BRL   L013EF7
L014330  LDX   #$0000
         TDC
         CLC
         ADC   #$FEB3
         STX   $C6
         STA   $C4
         LDA   $C4
         CLC
         ADC   #$0002
         STA   $C4
         BCC   L014348
         INC   $C6
L014348  LDX   #$0000
         TDC
         CLC
         ADC   #$FFE4
         STX   $F2
         STA   $F0
         INC   $F0
         BNE   L01435A
         INC   $F2
L01435A  LDA   $70
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$0026
         JSL   L0198A5
         PLA
         PLX
         STX   $CE
         STA   $CC
         LDA   $D8
         SEC
         SBC   #$0002
         STA   $D8
         BCS   L014380
         DEC   $DA
L014380  LDA   $70
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$003A
         JSL   L0198A5
         PLA
         PLX
         STX   $CA
         STA   $C8
         LDA   $D0
         SEC
         SBC   #$0002
         STA   $D0
         BCS   L0143A6
         DEC   $D2
L0143A6  LDA   $70
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$001C
         JSL   L0198A5
         PLA
         PLX
         STX   $EE
         STA   $EC
         LDA   $E4
         BNE   L0143C5
         DEC   $E6
L0143C5  DEC   $E4
         LDA   #$0001
         STA   $BE
         BRL   L0144F5
L0143CF  LDA   [$C4]
         STA   $6A
         LDX   $CE
         LDA   $CC
         STX   $DA
         STA   $D8
         STX   $DE
         STA   $DC
         LDA   $D8
         SEC
         SBC   #$0002
         STA   $D8
         BCS   L0143EB
         DEC   $DA
L0143EB  LDX   $CA
         LDA   $C8
         STX   $D2
         STA   $D0
         STX   $D6
         STA   $D4
         LDA   $D0
         SEC
         SBC   #$0002
         STA   $D0
         BCS   L014403
         DEC   $D2
L014403  LDX   $EE
         LDA   $EC
         STX   $E6
         STA   $E4
         STX   $EA
         STA   $E8
         LDA   $E4
         BNE   L014415
         DEC   $E6
L014415  DEC   $E4
         LDA   $70
         STA   $9C
         BRA   L014499
L01441D  LDA   [$D8]
         STA   [$DC]
         LDA   [$D0]
         STA   [$D4]
         LDA   [$E4]
         SEP   #$20
         STA   [$E8]
         REP   #$20
         LDX   $DE
         LDA   $DC
         PHX
         PHA
         SEC
         SBC   #$0002
         STA   $DC
         LDA   $DE
         SBC   #$0000
         STA   $DE
         PLA
         PLX
         LDX   $DA
         LDA   $D8
         PHX
         PHA
         SEC
         SBC   #$0002
         STA   $D8
         LDA   $DA
         SBC   #$0000
         STA   $DA
         PLA
         PLX
         LDX   $D6
         LDA   $D4
         PHX
         PHA
         SEC
         SBC   #$0002
         STA   $D4
         LDA   $D6
         SBC   #$0000
         STA   $D6
         PLA
         PLX
         LDX   $D2
         LDA   $D0
         PHX
         PHA
         SEC
         SBC   #$0002
         STA   $D0
         LDA   $D2
         SBC   #$0000
         STA   $D2
         PLA
         PLX
         LDX   $EA
         LDA   $E8
         LDA   $E8
         BNE   L01448B
         DEC   $EA
L01448B  DEC   $E8
         LDX   $E6
         LDA   $E4
         LDA   $E4
         BNE   L014497
         DEC   $E6
L014497  DEC   $E4
L014499  LDA   $9C
         DEC   $9C
         TAY
         BEQ   L0144AF
         LDA   [$D8]
         SEC
         SBC   $6A
         BVS   L0144AA
         EOR   #$8000
L0144AA  BMI   L0144AF
         BRL   L01441D
L0144AF  INC   $9C
         LDA   $9C
         SEC
         SBC   $70
         BVS   L0144BB
         EOR   #$8000
L0144BB  BMI   L0144D2
         LDA   #$0001
         STA   $50
         LDA   $BE
         STA   [$D4]
         LDA   $6A
         STA   [$DC]
         LDA   [$F0]
         SEP   #$20
         STA   [$E8]
         REP   #$20
L0144D2  LDA   $BE
         INC   $BE
         LDX   $C6
         LDA   $C4
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $C4
         LDA   $C6
         BCC   L0144E7
         INC
L0144E7  STA   $C6
         PLA
         PLX
         LDX   $F2
         LDA   $F0
         INC   $F0
         BNE   L0144F5
         INC   $F2
L0144F5  LDA   $BE
         SEC
         SBC   #$0038
         BVS   L014500
         EOR   #$8000
L014500  BMI   L014505
         BRL   L0143CF
L014505  LDX   #$0000
         TDC
         CLC
         ADC   #$001C
         STX   $F2
         STA   $F0
         LDX   #$0000
         TDC
         CLC
         ADC   #$003A
         STX   $DE
         STA   $DC
         STZ   $9C
         BRL   L0146E4
L014522  LDA   $86
         SEC
         SBC   $FF
         BEQ   L014533
         BVS   L01452E
         EOR   #$8000
L01452E  BPL   L014533
         BRL   L0146F3
L014533  LDA   [$DC]
         STA   $BE
         LDA   $BE
         CMP   #$0000
         BNE   L014541
         BRL   L0146F3
L014541  LDA   $BE
         LDX   #$0000
         TAY
         BPL   L01454A
         DEX
L01454A  PHX
         PHA
         LDA   #L021667
         LDX   #^L021667
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $96
         LDA   #$0009
         PHA
         LDA   $96
         SEC
         JSL   L019DD9
         PLA
         STA   $A0
         LDA   #$0009
         PHA
         LDA   $96
         SEC
         JSL   L019DD9
         PLY
         STA   $9E
         INC   L0500A4
         JSL   L014740
         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   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         DEC
         SEP   #$20
         STA   [$F4]
         REP   #$20
         PLA
         LDA   L0500A2
         PHA
         LDA   $A0
         LDX   #$0000
         PHX
         PHA
         LDA   $9E
         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
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         JSL   L034198
         LDA   $4E
         STA   L0500A2
         LDA   [$F0]
         AND   #$00FF
         BEQ   L01461D
         INC   L050028
L01461D  LDA   L050026
         SEC
         SBC   #$0001
         BEQ   L014641
         BVS   L01462B
         EOR   #$8000
L01462B  BPL   L014641
         DEC   L050026
         LDA   $86
         EOR   #$FFFF
         INC
         PHA
         JSL   L012587
         PLY
         INC   L050026
         BRA   L01464D
L014641  LDA   $86
         EOR   #$FFFF
         INC
         PHA
         JSL   L012587
         PLY
L01464D  LDA   [$F0]
         AND   #$00FF
         BEQ   L014657
         DEC   L050028
L014657  LDA   L0500A2
         BEQ   L014661
         LDA   #$0000
         BRA   L014664
L014661  LDA   #$0001
L014664  STA   L0500A2
         DEC   L0500A4
         LDA   L0500EA
         SEC
         SBC   $86
         BEQ   L0146AF
         BVS   L014677
         EOR   #$8000
L014677  BPL   L0146AF
         JSL   L01A5C3
         AND   #$003F
         PHA
         LDA   L0500EA
         PLX
         STX   $F8
         CLC
         ADC   $F8
         SEC
         SBC   #$0020
         STA   $7A
         LDA   $9C
         STA   $5E
         LDA   $86
         STA   $60
         LDA   $7A
         STA   $86
         LDA   $A0
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $9E
         STA   $78
         BRA   L0146C1
L0146AF  LDA   $7A
         SEC
         SBC   $60
         BEQ   L0146C1
         BVS   L0146BB
         EOR   #$8000
L0146BB  BPL   L0146C1
         LDA   $7A
         STA   $60
L0146C1  LDA   $9C
         INC   $9C
         LDX   $F2
         LDA   $F0
         INC   $F0
         BNE   L0146CF
         INC   $F2
L0146CF  LDX   $DE
         LDA   $DC
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $DC
         LDA   $DE
         BCC   L0146E0
         INC
L0146E0  STA   $DE
         PLA
         PLX
L0146E4  LDA   $9C
         SEC
         SBC   $70
         BVS   L0146EE
         EOR   #$8000
L0146EE  BMI   L0146F3
         BRL   L014522
L0146F3  LDA   $60
         EOR   #$FFFF
         INC
         STA   L0500EC
         LDA   $5E
         STA   L0500EE
         LDA   $86
         SEC
         SBC   #$0000
         BEQ   L014710
         BVS   L01470E
         EOR   #$8000
L01470E  BMI   L014715
L014710  LDA   #$0000
         BRA   L014718
L014715  LDA   #$0001
L014718  CMP   L0500A2
         BEQ   L014722
         LDA   #$0000
         BRA   L014725
L014722  LDA   #$0001
L014725  STA   L0500F4
         LDA   $86
         EOR   #$FFFF
         INC
         STA   L0500EA
         LDA   $78
         STA   L0500F0
L014736  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L014740  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         STZ   $F4
         BRL   L014864
L014750  LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         SEC
         SBC   #$0001
         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   L0500A4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022C87
         LDX   #^L022C87
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         PEA   $0008
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         SEC
         SBC   #$0001
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L022CC7
         LDX   #^L022CC7
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         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
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $F4
         LDX   #$0000
         PHX
         PHA
         LDA   L0500A4
         SEC
         SBC   #$0001
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230DA
         LDX   #^L0230DA
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   $F4
         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
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $F4
L014864  LDA   $F4
         SEC
         SBC   #$0002
         BVS   L01486F
         EOR   #$8000
L01486F  BMI   L014874
         BRL   L014750
L014874  PEA   $0051
         LDA   L0500A4
         SEC
         SBC   #$0001
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         LDA   L0500A4
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   L0500E4
         PHA
         LDA   L0500A4
         SEC
         SBC   #$0001
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         LDA   L0500A4
         PHA
         LDA   #$0200
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0230FA
         LDX   #^L0230FA
         JSL   L0198A5
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

	 MX    %11
         ADRL  $00000000
L014913  DW    $000A
         DW    $A55A
         REP   #$20
         PHK
         PLB
         LDA   #$000A
         STA   L014913
         SEP   #$20
         REP   #$30
         JSL   L0117EF
         SEP   #$30
         RTL

         MX    %00
L01492C  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PHX
         PHA
         LDX   L050110+2
         LDA   L050110
         PHX
         PHA
         _NewMenu
         PEA   $0000
         _InsertMenu
         PHX
         PHA
         LDX   L05010C+2
         LDA   L05010C
         PHX
         PHA
         _NewMenu
         PEA   $0000
         _InsertMenu
         PHX
         PHA
         LDX   L050108+2
         LDA   L050108
         PHX
         PHA
         _NewMenu
         PEA   $0000
         _InsertMenu
         PHX
         PHA
         LDX   L050104+2
         LDA   L050104
         PHX
         PHA
         _NewMenu
         PEA   $0000
         _InsertMenu

         PHX
         PHA
         JSL   L01184E
         TAY
         BEQ   L0149FC
         LDX   L050100+2	; Demo
         LDA   L050100
         BRA   L014A02
L0149FC  LDX   L0500FC+2	; About
         LDA   L0500FC
L014A02  PHX
         PHA
         _NewMenu
         PEA   $0000
         _InsertMenu
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L014A2F  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEI   $FF
         _EnableMItem
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L014A54  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEI   $FF
         _DisableMItem
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L014A79  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEA   $0001
         PEI   $FF
         _CheckMItem
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L014AA1  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEA   $0000
         PEI   $FF
         _CheckMItem
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L014AC9  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
*         PEA   $01F4
*         _FixAppleMenu
*         PEA   $000A
*         _SetMTitleStart
         PHA
         _FixMenuBar
         PLA
         _InitPalette
         _DrawMenuBar
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L014B34  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EC
         TCS
         PHX
         PHA
         _GetBarColors
         PLA
         PLX
         STX   $F4
         STA   $F2
         LDA   #$0010
         PHA
         LDA   #$0100
         PHA
         PHA
         PEI   $F4
         PEI   $F2
         _LoWord
         PLA
         CLC
         JSL   L019DD9
         PLA
         CLC
         JSL   L019DD9
         PLA
         STA   $F0
         LDA   #$0010
         PHA
         LDA   #$0100
         PHA
         PHA
         PEI   $F4
         PEI   $F2
         _LoWord
         PLA
         CLC
         JSL   L019DD9
         PLA
         CLC
         JSL   L019DD9
         PLY
         STA   $EE
         LDA   $F0
         PHA
         LDA   #$0010
         CLC
         JSL   L019EFD
         PLA
         CLC
         ADC   $EE
         PHA
         LDA   #$0100
         PHA
         PHA
         PEI   $F4
         PEI   $F2
         _LoWord
         PLA
         CLC
         JSL   L019DD9
         PLY
         PHA
         LDA   $EE
         PHA
         LDA   #$0010
         CLC
         JSL   L019EFD
         _SetBarColors
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         STA   L0500FA
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         LDA   $FD
         LDX   #$0000
         STX   $F0
         STA   $EE
         LDX   #$0000
         LDA   #$0010
         PHX
         PHA
         LDX   $F0
         LDA   $EE
         SEC
         JSL   L0198B0
         PLA
         PLX
         STX   $F0
         STA   $EE
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDX   $F0
         LDA   $EE
         JSL   L019E5E
         PLA
         PLX
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L014C61  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDX   $FF
         LDA   $FD
         STX   L050116
         STA   L050114
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L014C7E  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FF
         SEC
         SBC   #$000C
         BEQ   L014C9D
         BVS   L014C96
         EOR   #$8000
L014C96  BPL   L014C9D
         LDA   #$0000
         BRA   L014CA0
L014C9D  LDA   #$0001
L014CA0  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L014CAA  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         _GetMouse
         ADC   #$00F2
         PHA
         _LocalToGlobal
         PLY
         PLY
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L014CFB  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L014CAA	; Get mouse position
         TAY
         BEQ   L014D18
         LDA   L0500FA
         PHA
         JSL   L0153DB
         PLY
         BRA   L014D45
L014D18  SEC
         LDA   L050114
         SBC   #$0000
         BNE   L014D29
         LDA   L050116
         SBC   #$0000
         BRA   L014D31
L014D29  LDA   L050116
         SBC   #$0000
         REP   #$02
L014D31  BEQ   L014D45
         LDX   L050116
         LDA   L050114
         STA   $F6
         STX   $F8
         LDA   $F6
         LDX   $F8
         JSL   L01A615
L014D45  JSL   L01561C
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L014D51  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         SEC
         SBC   #$0000
         BEQ   L014D6F
         BVS   L014D69
         EOR   #$8000
L014D69  BPL   L014D6F
         LDA   $FF
         BRA   L014D75
L014D6F  LDA   #$0000
         SEC
         SBC   $FF
L014D75  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L014D7F  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         JSL   L0151DC
         LDA   L05011A
         BNE   L014D96
         BRL   L014DD1
L014D96  LDAL  L025EF9
         BNE   L014D9F
         BRL   L014DD1
L014D9F  STZ   L05011A
         LDA   #$0000
         STAL  L025EF9
         SEC
         LDAL  L025EE7
         SBCL  L025EFF
         BNE   L014DBE
         LDAL  L025EE9
         SBCL  L025F01
         BRA   L014DC8
L014DBE  LDAL  L025EE9
         SBCL  L025F01
         REP   #$02
L014DC8  BCS   L014DD1
         LDA   #$0000
         STAL  L025EE1
L014DD1  JSL   L015202
         LDAL  L025EE1
         BEQ   L014DFC
         LDA   L05011A
         BNE   L014DFC
         LDA   #L025EE1
         LDX   #^L025EE1
         PHX
         PHA
         LDA   $FF
         PHA
         LDA   $FD
         PHA
         PEA   $0018
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         BRA   L014E15

L014DFC  PHA
         PEA   $ffff	; 0408	; deskAccs + keyDown - AV 202307
         PEI   $FF
         PEI   $FD
         _GetNextEvent
         PLA
L014E15  PHA
         PEA   $0004
         PEA   $0002
         _FlushEvents
         PLA
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L014E35  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00CC
         TCS
         LDA   L050118
         BEQ   L014E50
         LDA   #$0000
         STAL  L025EF9
         STAL  L025EE1
L014E50  STZ   L050118
         PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         _GetMouse
         PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         _LocalToGlobal
         LDA   $EC
         STA   [$F9]
         LDA   $EA
         STA   [$FD]
         JSL   L014CFB
         PEA   $0000
         TDC
         CLC
         ADC   #$00D2
         PHA
         JSL   L014D7F
         PLY
         PLY
         LDA   $D2
         BRL   L014FF7
L014EA5  LDA   $E0
         STA   $CE
         LDA   $E0
         ORA   #$0100
         STA   $E0
         PEA   $0000
         TDC
         CLC
         ADC   #$00D2
         PHA
         PEA   $0000
         PEA   $0000
         _MenuKey
         PHA
         PEI   $E4
         PEI   $E2
         _LoWord
         PLA
         CMP   #$0000
         BEQ   L014EED
         BRL   L01500F
L014EED  LDA   $CE
         STA   $E0
         PHA
         PEI   $D6
         PEI   $D4
         _LoWord
         PLA
         AND   #$00FF
         STA   [$F9]
         JSL   L0151A2
         LDA   #$0002
         BRL   L01504A
L014F16  PEI   $DC
         PEI   $DE
         JSL   L014C7E
         PLY
         PLY
         TAY
         BEQ   L014F75
         STZ   L05011C
         PEA   $0000
         TDC
         CLC
         ADC   #$00D2
         PHA
         PEA   $0000
         PEA   $0000
         _MenuSelect
         JSL   L0155F1
         PHA
         PEI   $E4
         PEI   $E2
         _LoWord
         PLA
         CMP   #$0000
         BNE   L014F72
         JSL   L014CFB
         JSL   L0151A2
         LDA   #$0000
         BRL   L01504A
L014F72  BRL   L01500F
L014F75  LDA   #$0001
         STA   L05011A
         JSL   L0151A2
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D2
         PHX
         PHA
         PEA   ^L025F11
         PEA   L025F11
         PEA   $0018
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         LDA   #$0001
         STA   L05011C
         LDA   [$F9]
         SEC
         SBCL  L025F1D
         PHA
         JSL   L014D51
         PLY
         SEC
         SBC   #$0014
         BEQ   L014FBB
         BVS   L014FB9
         EOR   #$8000
L014FB9  BMI   L014FE7
L014FBB  LDA   [$FD]
         SEC
         SBCL  L025F1B
         PHA
         JSL   L014D51
         PLY
         SEC
         SBC   #$0014
         BEQ   L014FD5
         BVS   L014FD3
         EOR   #$8000
L014FD3  BMI   L014FE7
L014FD5  LDAL  L025F1D
         STA   [$F9]
         LDAL  L025F1B
         STA   [$FD]
         LDA   #$0003
         BRL   L01504A
L014FE7  LDA   #$0000
         BRL   L01504A
L014FED  BRL   L01500F
L014FF0  LDA   #$0000
         BRA   L01504A
         BRA   L01500F
L014FF7  CMP   #$0001
         BNE   L014FFF
         BRL   L014F16
L014FFF  CMP   #$0003
         BNE   L015007
         BRL   L014EA5
L015007  CMP   #$0011
         BEQ   L014FED
         JMP   L014FF0

L01500F  PHA
         PEI   $E4
         PEI   $E2
         _HiWord
         PLA
         STA   L050120
         PHA
         PEI   $E4
         PEI   $E2
         _LoWord
         PLA
         STA   [$F9]
         JSL   L0151A2
         STZ   L05011E
         LDA   #$0001
L01504A  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L015054  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   L05011E
         BNE   L015081
         PEA   $0000
         LDA   L050120
         PHA
         _HiliteMenu
         LDA   #$0001
         STA   L05011E
L015081  TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L015089  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00CE
         TCS
         PHA
         PEA   $0004
         PEA   $0002
         _FlushEvents
         PLA
L0150AC  PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         _GetMouse
         PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         _LocalToGlobal
         PHA
         PEA   $0400	; deskAccs
         PEA   $0000
         TDC
         CLC
         ADC   #$00D0
         PHA
         _GetNextEvent
         PLA
         PEA   $0000
         TDC
         CLC
         ADC   #$00D0
         PHA
         JSL   L014D7F
         PLY
         PLY
         LDA   $D0
         BRL   L015170
L015110  LDA   $DC
         STA   [$F9]
         LDA   $DA
         STA   [$FD]
         LDA   #$0001
         STA   L05011A
         JSL   L0151A2
         LDA   #$0003
         BRL   L015198
L015128  PHA
         PEI   $D4
         PEI   $D2
         _LoWord
         PLA
         AND   #$00FF
         STA   $E8
         JSL   L0151A2
         LDA   $E8
         CMP   #$001B
         BEQ   L01515C
         LDA   $E8
         CMP   #$0063
         BEQ   L01515C
         LDA   $E8
         CMP   #$0043
         BNE   L015162
L01515C  LDA   #$0004
         BRL   L015198
L015162  BRL   L01517E
L015165  BRL   L01517E
L015168  DA    L015110
         DA    L015165
         DA    L015128
         DA    L015165
L015170  DEC
         CMP   #$0003
         BCC   L015179
         LDA   #$0003
L015179  ASL
         TAX
         JMP   (L015168,X)

L01517E  LDA   [$F9]
         CMP   $EC
         BNE   L01518D
         LDA   [$FD]
         CMP   $EA
         BNE   L01518D
         BRL   L0150AC
L01518D  LDA   $EC
         STA   [$F9]
         LDA   $EA
         STA   [$FD]
         LDA   #$0000
L015198  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L0151A2  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PHA
         PEA   $000E
         PEA   $0000
         _FlushEvents
         PLA
         JSL   L0151DC
         LDA   #$0000
         STAL  L025EE1
         JSL   L015202
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

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

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

L015228  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDAL  L025EE1
         BEQ   L01523C
         BRL   L015295
L01523C  LDA   #$0000
         STAL  L025EF9
         LDA   #$0001
         STAL  L025EE1
         PEA   ^L025EEB
         PEA   L025EEB
         _GetMouse
         PEA   ^L025EEB
         PEA   L025EEB
         _LocalToGlobal
         PHX
         PHA
         _GetTick
         PLA
         PLX
         PHA
         TXA
         STAL  L025EE9
         PLA
         STAL  L025EE7
L015295  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L01529D  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDAL  L025EF9
         BEQ   L0152B1
         BRL   L015303
L0152B1  LDA   #$0002
         STAL  L025EF9
         PEA   ^L025F03
         PEA   L025F03
         _GetMouse
         PEA   ^L025F03
         PEA   L025F03
         _LocalToGlobal
         PHX
         PHA
         _GetTick
         PLA
         PLX
         PHA
         TXA
         STAL  L025F01
         PLA
         STAL  L025EFF
L015303  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L01530B  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #L0261F9
         LDX   #^L0261F9
         PHA
         TXA
         STAL  L0265D3
         PLA
         STAL  L0265D1
         LDA   #L025F41
         LDX   #^L025F41
         PHA
         TXA
         STAL  L0265DB
         PLA
         STAL  L0265D9
         LDA   #L026089
         LDX   #^L026089
         PHA
         TXA
         STAL  L0265DF
         PLA
         STAL  L0265DD
         LDA   #L0262B1
         LDX   #^L0262B1
         PHA
         TXA
         STAL  L0265D7
         PLA
         STAL  L0265D5
         LDX   #$0000
         LDA   #$0000
         PHA
         TXA
         STAL  L0265E3
         PLA
         STAL  L0265E1
         STZ   L050124
         LDA   #$FFFF
         STA   L050126
         LDA   #$FFFF
         STA   L05012A
         LDA   #$FFFF
         STA   L050128
         LDAL  L0262B3
         PHA
         LDAL  L0262B1
         SEC
         JSL   L019EFD
         PLA
         ASL
         ASL
         CLC
         ADC   #$0008
         STA   $F4
         PEI   $F4
         JSL   L0198FB
         PLY
         STX   L05012E
         STA   L05012C
         PEI   $F4
         PEA   ^L0262B1
         PEA   L0262B1
         LDX   L05012E
         LDA   L05012C
         PHX
         PHA
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   ^L018815
         PEA   L018815
         _SetHeartBeat
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0153DB  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         CMP   #$0001
         BEQ   L0153F1
         JSL   L015932
L0153F1  LDA   L050126
         CMP   $FF
         BEQ   L01542B
         LDA   $FF
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0265D1
         LDX   #^L0265D1
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         PHX
         PHA
         _SetCursor
L01542B  LDA   $FF
         STA   L050126
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L015438  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00DF
         TCS
         LDA   $FF
         AND   #$000F
         PHA
         LDA   #$000F
         PLX
         STX   $F8
         SEC
         SBC   $F8
         STA   $FF
         LDA   L050128
         CMP   $FF
         BNE   L01545E
         BRL   L0155E1
L01545E  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDAL  L0265E3
         TAX
         LDAL  L0265E1
         STX   $E6
         STA   $E4
         JSL   L01A847
         BEQ   L01547C
         BRL   L0154C2
L01547C  LDAL  L0261FB
         PHA
         LDAL  L0261F9
         SEC
         JSL   L019EFD
         PLA
         ASL
         ASL
         CLC
         ADC   #$0008
         STA   $F2
         PEI   $F2
         JSL   L0198FB
         PLY
         STX   $E6
         STA   $E4
         PEI   $F2
         PEA   ^L0261F9
         PEA   L0261F9
         PEI   $E6
         PEI   $E4
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDX   $E6
         LDA   $E4
         PHA
         TXA
         STAL  L0265E3
         PLA
         STAL  L0265E1
L0154C2  LDX   $E6
         LDA   $E4
         CLC
         ADC   #$0004
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E6
         STA   $E4
         LDA   #L026255
         LDX   #^L026255
         STX   $EE
         STA   $EC
         LDA   #L0261FD
         LDX   #^L0261FD
         STX   $EA
         STA   $E8
         LDA   #$0001
         STA   $F2
         BRL   L0155B9
L0154F1  LDA   [$EC]
         SEP   #$20
         STA   $E2
         REP   #$20
         LDA   [$E8]
         SEP   #$20
         STA   $E1
         REP   #$20
         SEP   #$20
         STA   $E3
         REP   #$20
         LDA   $E1
         AND   #$00FF
         AND   #$00F0
         TAY
         BEQ   L01552C
         LDA   $FF
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   $E1
         AND   #$00FF
         AND   #$000F
         PLX
         STX   $F8
         ORA   $F8
         SEP   #$20
         STA   $E3
         REP   #$20
L01552C  LDA   $E1
         AND   #$00FF
         AND   #$000F
         TAY
         BEQ   L015547
         LDA   $E3
         AND   #$00FF
         AND   #$00F0
         ORA   $FF
         SEP   #$20
         STA   $E3
         REP   #$20
L015547  LDA   $E1
         AND   #$00FF
         AND   #$00F0
         TAY
         BNE   L01556B
         LDA   $E2
         AND   #$00FF
         AND   #$00F0
         TAY
         BEQ   L01556B
         LDA   $E3
         AND   #$00FF
         ORA   #$00F0
         SEP   #$20
         STA   $E3
         REP   #$20
L01556B  LDA   $E1
         AND   #$00FF
         AND   #$000F
         TAY
         BNE   L01558F
         LDA   $E2
         AND   #$00FF
         AND   #$000F
         TAY
         BEQ   L01558F
         LDA   $E3
         AND   #$00FF
         ORA   #$000F
         SEP   #$20
         STA   $E3
         REP   #$20
L01558F  LDA   $E3
         SEP   #$20
         STA   [$E4]
         REP   #$20
         LDA   $F2
         INC   $F2
         LDX   $EE
         LDA   $EC
         INC   $EC
         BNE   L0155A5
         INC   $EE
L0155A5  LDX   $EA
         LDA   $E8
         INC   $E8
         BNE   L0155AF
         INC   $EA
L0155AF  LDX   $E6
         LDA   $E4
         INC   $E4
         BNE   L0155B9
         INC   $E6
L0155B9  LDAL  L0261FB
         PHA
         LDAL  L0261F9
         SEC
         JSL   L019EFD
         PLA
         ASL
         SEC
         SBC   $F2
         BVS   L0155D1
         EOR   #$8000
L0155D1  BPL   L0155D6
         BRL   L0154F1
L0155D6  LDA   #$FFFF
         STA   L050126
         LDA   $FF
         STA   L050128
L0155E1  PEA   $0004
         JSL   L0153DB
         PLY
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L0155F1  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050124
         BEQ   L015611
         _HideCursor
L015611  STZ   L050124
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L01561C  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050124
         BNE   L01563C
         _ShowCursor
L01563C  LDA   #$0001
         STA   L050124
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L01564A  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         INC   L05012A
         LDA   L05012A
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L026621
         LDX   #^L026621
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   L050124
         STA   [$F6]
         LDA   L05012A
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L026621
         LDX   #^L026621
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   L050126
         LDY   #$0002
         STA   [$F6],Y
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0156A1  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         BEQ   L0156CE
         LDA   L05012A
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L026621
         LDX   #^L026621
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $FF
L0156CE  LDA   $FF
         BEQ   L0156D8
         JSL   L01561C
         BRA   L0156DC
L0156D8  JSL   L0155F1
L0156DC  LDA   L05012A
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L026621
         LDX   #^L026621
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         PHA
         JSL   L0153DB
         PLY
         DEC   L05012A
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

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

L015727  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050122
         BNE   L015743
         JSL   L0157AE
         PEA   $0001
         JSL   L0153DB
         PLY
L015743  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

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

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

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

L0157AE  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   ^L017FFD
         PEA   L017FFD
         _SetHeartBeat
         PEA   ^L018815
         PEA   L018815
         _DelHeartBeat
         LDA   #$0001
         STA   L050122
         LDA   #$000F
         STAL  L026671
         LDA   #$0000
         STAL  L026673
         LDA   #$0001
         STA   L050122
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L015807  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$009E
         TCS
         JSL   L01920F
         STA   $F4
         LDAL  L026671
         DEC
         STAL  L026671
         TAY
         BEQ   L015827
         BRL   L015923
L015827  LDA   #$000F
         STAL  L026671
         LDAL  L026673
         PHA
         INC
         STAL  L026673
         PLA
         LDAL  L026673
         CMP   #$0008
         BNE   L015849
         LDA   #$0000
         STAL  L026673
L015849  LDAL  L026673
         BRL   L0158CD
L015850  LDA   #L0262B5
         LDX   #^L0262B5
         STX   $A2
         STA   $A0
         BRL   L0158DA
L01585D  LDA   #L026369
         LDX   #^L026369
         STX   $A2
         STA   $A0
         BRL   L0158DA
L01586A  LDA   #L0263C1
         LDX   #^L0263C1
         STX   $A2
         STA   $A0
         BRL   L0158DA
L015877  LDA   #L026419
         LDX   #^L026419
         STX   $A2
         STA   $A0
         BRL   L0158DA
L015884  LDA   #L026471
         LDX   #^L026471
         STX   $A2
         STA   $A0
         BRL   L0158DA
L015891  LDA   #L0264C9
         LDX   #^L0264C9
         STX   $A2
         STA   $A0
         BRL   L0158DA
L01589E  LDA   #L026521
         LDX   #^L026521
         STX   $A2
         STA   $A0
         BRL   L0158DA
L0158AB  LDA   #L026579
         LDX   #^L026579
         STX   $A2
         STA   $A0
         BRL   L0158DA
L0158B8  BRL   L0158DA
L0158BB  DA    L015850
         DA    L01585D
         DA    L01586A
         DA    L015877
         DA    L015884
         DA    L015891
         DA    L01589E
         DA    L0158AB
         DA    L0158B8
L0158CD  CMP   #$0008
         BCC   L0158D5
         LDA   #$0008
L0158D5  ASL
         TAX
         JMP   (L0158BB,X)

L0158DA  LDAL  L0262B3
         PHA
         LDAL  L0262B1
         SEC
         JSL   L019EFD
         PLA
         ASL
         PHA
         PEI   $A2
         PEI   $A0
         LDX   L05012E
         LDA   L05012C
         CLC
         ADC   #$0004
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDX   L05012E
         LDA   L05012C
         PHX
         PHA
         _SetCursor
L015923  PEI   $F4
         JSL   L01988F
         PLY
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L015932  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050122
         BEQ   L015971
         PEA   ^L017FFD
         PEA   L017FFD
         _DelHeartBeat
         PEA   ^L018815
         PEA   L018815
         _SetHeartBeat
         STZ   L050122
L015971  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L015A12  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FD
         PEI   $FF
         _MoveTo
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L015A39  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FF
         PEI   $FD
         _DrawCString
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EC
         TCS
         PEA   $0000
         TDC
         CLC
         ADC   #$00EE
         PHA
         PEA   $0000
         PEA   $000D
         PEA   $013F
         PEA   $00C7
         _SetRect
         PEA   $0000
         _SetSolidPenPat
         PEA   $0000
         TDC
         CLC
         ADC   #$00EE
         PHA
         _PaintRect
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L015AC4  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EA
         TCS
         LDA   #$0001
         STA   $EC
         BRA   L015B18
L015AD6  LDA   $EC
         LDX   #$0000
         TAY
         BPL   L015ADF
         DEX
L015ADF  PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDA   $EC
         SEC
         SBC   #$0001
         LDX   #$0000
         TAY
         BPL   L015AFF
         DEX
L015AFF  PHX
         PHA
         LDX   $FB
         LDA   $F9
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         INC   $EC
L015B18  LDA   [$FD]
         AND   #$00FF
         SEC
         SBC   $EC
         BVS   L015B25
         EOR   #$8000
L015B25  BMI   L015AD6
         LDA   $EC
         SEC
         SBC   #$0001
         LDX   #$0000
         TAY
         BPL   L015B34
         DEX
L015B34  PHX
         PHA
         LDX   $FB
         LDA   $F9
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   #$0000
         SEP   #$20
         STA   [$EE]
         REP   #$20
         TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L015B55  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EA
         TCS
         STZ   $EC
         BRA   L015B66
L015B64  INC   $EC
L015B66  LDA   $EC
         LDX   #$0000
         TAY
         BPL   L015B6F
         DEX
L015B6F  PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDA   $EC
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L015B8F
         DEX
L015B8F  PHX
         PHA
         LDX   $FB
         LDA   $F9
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         AND   #$00FF
         BNE   L015B64
         LDA   $EC
         SEP   #$20
         STA   [$F9]
         REP   #$20
         TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L015BBB  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00CA
         TCS
         STZ   $DA
         STZ   $DC
         JSL   L01564A
         JSL   L0155F1
         LDX   #$0000
         LDA   #$0000
         STX   $E4
         STA   $E2
         STX   $E8
         STA   $E6
L015BE0  LDA   $FD
         SEC
         SBC   $F9
         CLC
         ADC   #$0001
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   #$000C
         STA   $D0
         LDA   $D0
         LDX   #$0000
         LDX   #$0000
         PHX
         PHA
         PHX
         PHA
         _MaxBlock
         PLA
         PLX
         JSL   L01A847
         BCS   L015C24
         LDA   $D0
         LDX   #$0000
         BRA   L015C43
L015C24  PHX
         PHA
         _MaxBlock
         PLA
         PLX
         SEC
         SBC   #$000A
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
L015C43  STA   $CE
         LDA   #$00A0
         PHA
         LDA   $CE
         CLC
         ADC   #$0001
         SEC
         SBC   #$000C
         SEC
         JSL   L019DD9
         PLY
         PHA
         LDA   $F9
         PLX
         STX   $F2
         CLC
         ADC   $F2
         SEC
         SBC   #$0001
         STA   $CC
         PEI   $CE
         JSL   L0198FB
         PLY
         STX   $D8
         STA   $D6
         STX   $E0
         STA   $DE
         LDX   $D8
         LDA   $D6
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $D6
         LDA   $D8
         BCC   L015C88
         INC
L015C88  STA   $D8
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $F9
         STA   [$EE]
         LDX   $D8
         LDA   $D6
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $D6
         LDA   $D8
         BCC   L015CA5
         INC
L015CA5  STA   $D8
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $FB
         STA   [$EE]
         LDX   $D8
         LDA   $D6
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $D6
         LDA   $D8
         BCC   L015CC2
         INC
L015CC2  STA   $D8
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $CC
         STA   [$EE]
         LDX   $D8
         LDA   $D6
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $D6
         LDA   $D8
         BCC   L015CDF
         INC
L015CDF  STA   $D8
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $FF
         STA   [$EE]
         PEA   $0004
         PEA   $0000
         TDC
         CLC
         ADC   #$00E6
         PHA
         PEI   $D8
         PEI   $D6
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDX   $E0
         LDA   $DE
         STX   $E8
         STA   $E6
         LDA   $D6
         CLC
         ADC   #$0002
         STA   $D6
         BCC   L015D18
         INC   $D8
L015D18  LDA   $D6
         CLC
         ADC   #$0002
         STA   $D6
         BCC   L015D24
         INC   $D8
L015D24  LDA   $F9
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         PLA
         LDX   #$0000
         TAY
         BPL   L015D37
         DEX
L015D37  PHX
         PHA
         LDX   #$00E1
         LDA   #$2000
         JSL   L0198A5
         PLA
         PLX
         STX   $EC
         STA   $EA
         PEI   $EC
         PEI   $EA
         PEI   $D8
         PEI   $D6
         LDA   $CC
         SEC
         SBC   $F9
         CLC
         ADC   #$0001
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         PLA
         LDX   #$0000
         TAY
         BPL   L015D6B
         DEX
L015D6B  PHX
         PHA
         _BlockMove
         LDA   $CC
         CLC
         ADC   #$0001
         STA   $F9
         LDA   $F9
         SEC
         SBC   $FD
         BNE   L015D8F
         BRL   L015BE0
L015D8F  BVS   L015D94
         EOR   #$8000
L015D94  BMI   L015D99
         BRL   L015BE0
L015D99  PEA   $0001
         JSL   L0156A1
         PLY
         LDX   $E0
         LDA   $DE
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L015DAF  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00D8
         TCS
         JSL   L01564A
         JSL   L0155F1
         LDX   $FF
         LDA   $FD
         STX   $E4
         STA   $E2
L015DCA  LDX   $E4
         LDA   $E2
         STX   $E8
         STA   $E6
         LDX   $E4
         LDA   $E2
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $E2
         LDA   $E4
         BCC   L015DE3
         INC
L015DE3  STA   $E4
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         STA   $F0
         LDX   $E4
         LDA   $E2
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $E2
         LDA   $E4
         BCC   L015E00
         INC
L015E00  STA   $E4
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         STA   $EE
         LDX   $E4
         LDA   $E2
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $E2
         LDA   $E4
         BCC   L015E1D
         INC
L015E1D  STA   $E4
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         STA   $EC
         LDX   $E4
         LDA   $E2
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $E2
         LDA   $E4
         BCC   L015E3A
         INC
L015E3A  STA   $E4
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         STA   $EA
         PEA   $0004
         PEI   $E4
         PEI   $E2
         PEA   $0000
         TDC
         CLC
         ADC   #$00DA
         PHA
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $E2
         CLC
         ADC   #$0002
         STA   $E2
         BCC   L015E6B
         INC   $E4
L015E6B  LDA   $E2
         CLC
         ADC   #$0002
         STA   $E2
         BCC   L015E77
         INC   $E4
L015E77  LDA   $F0
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         PLA
         LDX   #$0000
         TAY
         BPL   L015E8A
         DEX
L015E8A  PHX
         PHA
         LDX   #$00E1
         LDA   #$2000
         JSL   L0198A5
         PLA
         PLX
         STX   $E0
         STA   $DE
         PEI   $E4
         PEI   $E2
         PEI   $E0
         PEI   $DE
         LDA   $EC
         SEC
         SBC   $F0
         CLC
         ADC   #$0001
         PHA
         LDA   #$00A0
         SEC
         JSL   L019EFD
         PLA
         LDX   #$0000
         TAY
         BPL   L015EBE
         DEX
L015EBE  PHX
         PHA
         _BlockMove
         PEI   $E8
         PEI   $E6
         JSL   L01A393+1
         PLY
         PLY
         LDX   $DC
         LDA   $DA
         STX   $E4
         STA   $E2
         LDA   $E2
         CMP   #$0000
         BEQ   L015EEC
         BRL   L015DCA
L015EEC  LDA   $E4
         CMP   #$0000
         BEQ   L015EF6
         BRL   L015DCA
L015EF6  PEA   $0001
         JSL   L0156A1
         PLY
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L015F06  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$008E
         TCS
         PEA   ^L026675
         PEA   L026675
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         JSL   L0189DA
         PLY
         PLY
         TAY
         BEQ   L015F80
         JSL   L0155F1
         PEA   $0321
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         JSL   L01A61D
         PLY
         PLY
         PLY
         STA   $90
         PEA   $8000
         PEA   $00E1
         PEA   $2000
         PEI   $90
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         PEI   $90
         JSL   L019217
         PLY
         PEA   $00C1
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         JSL   L01803C
         PLY
         PLY
         PLY
L015F80  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L015F88  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E8
         TCS
         LDA   $FF
         ASL
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         TAY
         BPL   L015FA1
         DEX
L015FA1  PHX
         PHA
         LDX   #$00E1
         LDA   #$9E00
         JSL   L0198A5
         PLA
         PLX
         STX   $F2
         STA   $F0
         STZ   $EA
         STZ   $EE
         BRA   L01601F
L015FB9  STZ   $EC
         LDA   [$F0]
         AND   #$000F
         TAY
         BEQ   L015FC8
         LDA   #$0001
         STA   $EC
L015FC8  LDA   [$F0]
         AND   #$00F0
         TAY
         BEQ   L015FD7
         LDA   $EC
         ORA   #$0010
         STA   $EC
L015FD7  LDA   [$F0]
         AND   #$0F00
         TAY
         BEQ   L015FE6
         LDA   $EC
         ORA   #$0100
         STA   $EC
L015FE6  LDA   [$F0]
         SEC
         SBC   $EC
         STA   [$F0]
         LDA   $EC
         CMP   #$0000
         BNE   L015FF9
         LDA   #$0000
         BRA   L015FFC
L015FF9  LDA   #$0001
L015FFC  PHA
         LDA   $EA
         PLX
         STX   $F8
         ORA   $F8
         STA   $EA
         LDA   $EE
         INC   $EE
         LDX   $F2
         LDA   $F0
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $F0
         LDA   $F2
         BCC   L01601B
         INC
L01601B  STA   $F2
         PLA
         PLX
L01601F  LDA   $EE
         SEC
         SBC   #$0010
         BVS   L01602A
         EOR   #$8000
L01602A  BPL   L015FB9
         LDA   $EA
         TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L016038  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
L016043  LDA   #$0001
         STA   $F2
         STZ   $F4
         BRA   L01605A
L01604C  PEI   $F4
         JSL   L015F88
         PLY
         TAY
         BEQ   L016058
         STZ   $F2
L016058  INC   $F4
L01605A  LDA   $F4
         SEC
         SBC   #$0008
         BVS   L016065
         EOR   #$8000
L016065  BPL   L01604C
         LDA   $F2
         BEQ   L016043
         JSL   L018094
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         _GetMouse
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         _LocalToGlobal
         PEA   $0000
         PEA   $0140
         PEA   $0000
         PEA   $00C8
         _ClampMouse
         PEI   $F4
         PEI   $F2
         _PosMouse
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L0160EC  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         _GetMouse
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         _LocalToGlobal
         PEA   $0000
         PEA   $013B
         PEA   $0000
         PEA   $00C3
         _ClampMouse
         PEI   $F4
         PEI   $F2
         _PosMouse
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L016161  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         _GetMouse
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         _LocalToGlobal
         PEA   $0000
         PEA   $013B
         PEA   $000D
         PEA   $00C3
         _ClampMouse
         PEI   $F4
         PEI   $F2
         _PosMouse
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$008A
         TCS
         LDA   #$0001
         STA   $8C
         LDX   #$0000
         TDC
         CLC
         ADC   #$0092
         STX   $90
         STA   $8E
         PEA   $000A
         PEA   $0000
         TDC
         CLC
         ADC   #$008C
         PHA
         JSL   L01A356
         LDA   #$0000
         STA   $8C
         PEA   $0009
         PEA   $0000
         TDC
         CLC
         ADC   #$008C
         PHA
         JSL   L01A356
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L01621F  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$001E
         TCS
         PEI   $FF
         PEI   $FD
         PEA   ^L0266C0
         PEA   L0266C0
         JSL   L019F94
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BNE   L016246
         LDA   #$0000
         BRA   L016249
L016246  LDA   #$0001
L016249  STA   $20
         PEI   $FF
         PEI   $FD
         PEA   ^L0266C0
         PEA   L0266C0
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         LDA   #$0001
         STA   $EC
         LDX   #$0000
         TDC
         CLC
         ADC   #$0086
         STX   $F0
         STA   $EE
         PEA   $000A
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L01A356
         PEA   $0000
         TDC
         CLC
         ADC   #$0086
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0022
         PHA
         JSL   L015AC4
         PLY
         PLY
         PLY
         PLY
         LDA   $20
         BNE   L0162B1
         PEI   $FF
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$0022
         PHA
         JSL   L019E68
         PLY
         PLY
         PLY
         PLY
L0162B1  PEA   $0000
         TDC
         CLC
         ADC   #$0022
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0086
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         PHA
         LDA   $20
         BEQ   L0162D8
         LDA   #L026692
         LDX   #^L026692
         BRA   L0162DE
L0162D8  LDA   #L026680
         LDX   #^L026680
L0162DE  PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0086
         PHA
         PEA   ^L0266A6
         PEA   L0266A6
         PEA   ^L0266B3
         PEA   L0266B3
         _TLTextMountVolume
         PLA
         STA   $EA
*         LDA   $EA
         CMP   #$0002
         BNE   L01631F
         _GrafOff
L01631F  STZ   $20
         LDA   $EA
         CMP   #$0002
         BEQ   L01632D
         LDA   #$0000
         BRA   L016330
L01632D  LDA   #$0001
L016330  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01633A  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E4
         TCS
         LDA   [$FB]
         STA   $EE
         STZ   $EC
         LDA   $EE
         AND   #$000F
         PHA
         LDA   $FF
         AND   #$000F
         PLX
         STX   $F0
         CMP   $F0
         BEQ   L016362
         LDA   #$0001
         STA   $EC
L016362  LDA   $EE
         AND   #$00F0
         PHA
         LDA   $FF
         AND   #$00F0
         PLX
         STX   $F0
         CMP   $F0
         BEQ   L01637B
         LDA   $EC
         ORA   #$0010
         STA   $EC
L01637B  LDA   $EE
         AND   #$0F00
         PHA
         LDA   $FF
         AND   #$0F00
         PLX
         STX   $F0
         CMP   $F0
         BEQ   L016394
         LDA   $EC
         ORA   #$0100
         STA   $EC
L016394  LDA   [$FB]
         CLC
         ADC   $EC
         STA   [$FB]
         STZ   $E6
         BRA   L0163A1
L01639F  INC   $E6
L0163A1  LDA   $E6
         SEC
         SBC   #$0032
         BVS   L0163AC
         EOR   #$8000
L0163AC  BPL   L01639F
         LDA   $EC
         CMP   #$0000
         BNE   L0163BA
         LDA   #$0000
         BRA   L0163BD
L0163BA  LDA   #$0001
L0163BD  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00DE
         TCS
         LDA   $FB
         ASL
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         TAY
         BPL   L0163E0
         DEX
L0163E0  PHX
         PHA
         LDX   #$00E1
         LDA   #$9E00
         JSL   L0198A5
         PLA
         PLX
         STX   $EE
         STA   $EC
         STZ   $E6
         STZ   $EA
         BRA   L01643C
L0163F8  LDA   [$FD]
         PHA
         PEI   $EE
         PEI   $EC
         JSL   L01633A
         PLY
         PLY
         PLY
         TAY
         BEQ   L01640E
         LDA   #$0001
         STA   $E6
L01640E  LDA   $EA
         INC   $EA
         LDX   $EE
         LDA   $EC
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $EC
         LDA   $EE
         BCC   L016423
         INC
L016423  STA   $EE
         PLA
         PLX
         LDX   $FF
         LDA   $FD
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $FD
         LDA   $FF
         BCC   L016438
         INC
L016438  STA   $FF
         PLA
         PLX
L01643C  LDA   $EA
         SEC
         SBC   #$0010
         BVS   L016447
         EOR   #$8000
L016447  BPL   L0163F8
         LDA   $E6
         TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$0024
         TCS
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$008A
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         PEI   $FF
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$0026
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$008A
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0026
         PHA
         PEA   ^L0266DE
         PEA   L0266DE
         PEA   ^L0266EB
         PEA   L0266EB
         _TLTextMountVolume
         PLA
         CMP   #$0001
         BEQ   L0164C4
         LDA   #$0000
         BRA   L0164C7
L0164C4  LDA   #$0001
L0164C7  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L0164D1  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$0028
         TCS
         PEI   $FF
         PEI   $FD
         PEA   ^L0266F8
         PEA   L0266F8
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         LDA   L050002
         PHA
         PEA   ^L026706
         PEA   L026706
         PEA   $0000
         TDC
         CLC
         ADC   #$002A
         PHA
         JSL   L019101
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$002A
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L016549
         PLY
         PLY
         PLY
         PLY
         _GrafOff
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L016549  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$0024
         TCS
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$008A
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         PEI   $FF
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$0026
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$008A
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0026
         PHA
         PEA   ^L026715
         PEA   L026715
         PEA   ^L02671E
         PEA   L02671E
         _TLTextMountVolume
         PLA
         TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L0165B6  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDA   $FB
         CMP   #$0004
         BNE   L0165DA
         PEI   $FF
         PEI   $FD
         JSL   L01890C
         PLY
         PLY
         LDA   #$0001
         STA   L0500C8
         BRA   L01661D
L0165DA  LDA   L0500CC
         BEQ   L0165E4
         LDA   #$0001
         BRA   L016620
L0165E4  LDA   $FB
         BEQ   L01661D
         PEI   $FF
         PEI   $FD
         JSL   L019F42
         PLY
         PLY
         PHA
         PEI   $FF
         PEI   $FD
         PEI   $FB
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L019F42
         PLY
         PLY
         PLX
         STX   $F0
         CMP   $F0
         BEQ   L016618
         LDA   #$0000
         BRA   L01661B
L016618  LDA   #$0001
L01661B  BRA   L016620
L01661D  LDA   #$0001
L016620  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L01662A  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         LDA   $FD
         CMP   #$0004
         BNE   L016657
         LDA   L050084
         AND   #$00FF
         BEQ   L016650
         LDA   L05006F
         BNE   L016650
         LDA   #$0002
         STA   $F0
         BRA   L016655
L016650  LDA   #$0001
         STA   $F0
L016655  BRA   L016659
L016657  STZ   $F0
L016659  LDA   #$000A
         SEP   #$20
         STAL  L024EE6
         REP   #$20
         SEP   #$20
         STAL  L024E95
         REP   #$20
         SEP   #$20
         STAL  L024E44
         REP   #$20
         LDA   L050082
         AND   #$00FF
         BEQ   L016686
         LDA   $FF
         CMP   #$007F
         BEQ   L016686
         BRL   L016D02
L016686  LDA   L0500CE
         BEQ   L016692
         LDA   #$FFFF
         STAL  L0242C7
L016692  STZ   L0500CE
         LDA   L0500D0
         BEQ   L0166A1
         LDA   #$FFFF
         STAL  L0242C9
L0166A1  STZ   L0500D0
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242C5
         LDX   #^L0242C5
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         CMP   #$FFFF
         BNE   L0166EC
         PEA   $0050
         PEA   $0020
         LDA   $F0
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L024DF4
         LDX   #^L024DF4
         JSL   L0198A5
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
L0166EC  LDA   $FF
         CMP   #$0100
         BNE   L0166F6
         BRL   L016769
L0166F6  LDA   $FF
         CMP   #$007F
         BEQ   L016769
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EF9
         LDX   #^L024EF9
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         SEC
         SBC   L0500A2
         BVS   L016720
         EOR   #$8000
L016720  BMI   L016725
         BRL   L016947
L016725  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EE7
         LDX   #^L024EE7
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         BEQ   L016744
         BRL   L016947
L016744  LDA   $FF
         SEC
         SBC   #$FFC8
         BNE   L01674F
         BRL   L016947
L01674F  BVS   L016754
         EOR   #$8000
L016754  BMI   L016759
         BRL   L016947
L016759  LDA   $FF
         SEC
         SBC   #$0038
         BVS   L016764
         EOR   #$8000
L016764  BPL   L016769
         BRL   L016947
L016769  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242C5
         LDX   #^L0242C5
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         SEC
         SBC   #$0004
         BNE   L01678C
         BRL   L016947
L01678C  BVS   L016791
         EOR   #$8000
L016791  BMI   L016796
         BRL   L016947
L016796  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242C5
         LDX   #^L0242C5
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EF9
         LDX   #^L024EF9
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   #$0014
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $F6
         CLC
         ADC   $F6
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L024DF4
         LDX   #^L024DF4
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$000A
         SEP   #$20
         STA   [$F2]
         REP   #$20
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242C5
         LDX   #^L0242C5
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EF9
         LDX   #^L024EF9
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   #$0014
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   #$0001
         PLX
         STX   $F6
         CLC
         ADC   $F6
         PHA
         LDA   $F0
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L024DF4
         LDX   #^L024DF4
         JSL   L0198A5
         PEI   $FD
         JSL   L016D0C
         PLY
         PLY
         PLY
         PLY
         CMP   #$FFFF
         BEQ   L016887
         BRL   L016901
L016887  LDA   L0500D6
         BNE   L01688F
         BRL   L0168FE
L01688F  LDA   #$0001
         STA   L0500CC
         JSL   L032C10
         PHX
         PHA
         PEA   ^L022714
         PEA   L022714
         LDAL  L02293A+2
         TAX
         LDAL  L02293A
         PHX
         PHA
         JSL   L031C65
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242C5
         LDX   #^L0242C5
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$FFFF
         STA   [$F2]
         PEA   $0050
         PEA   $0020
         LDA   $F0
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L024DF4
         LDX   #^L024DF4
         JSL   L0198A5
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
L0168FE  BRL   L016D02
L016901  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242C5
         LDX   #^L0242C5
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$FFFF
         STA   [$F2]
         PEA   $0050
         PEA   $0020
         LDA   $F0
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L024DF4
         LDX   #^L024DF4
         JSL   L0198A5
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
L016947  LDA   L050082
         AND   #$00FF
         BNE   L016986
         LDA   $FF
         CMP   #$007F
         BNE   L016986
         PEI   $FD
         JSL   L017A6B
         PLY
         PEA   $0050
         PEA   $0020
         LDA   $F0
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L024DF4
         LDX   #^L024DF4
         JSL   L0198A5
         JSL   L019D39
         PLY
         PLY
         PLY
         PLY
L016986  LDA   L0500A2
         SEC
         SBC   #$0000
         BVS   L016992
         EOR   #$8000
L016992  BMI   L016997
         BRL   L016D02
L016997  LDA   L050073
         BEQ   L0169B1
         LDA   L0500BE
         SEC
         SBC   #$0001
         CMP   L0500A2
         BNE   L0169B1
         LDA   #$FFFF
         STA   L0500D0
         BRL   L016D02
L0169B1  LDA   $FF
         SEC
         SBC   #$0000
         BNE   L0169BC
         BRL   L016AA8
L0169BC  BVS   L0169C1
         EOR   #$8000
L0169C1  BMI   L0169C6
         BRL   L016AA8
L0169C6  LDA   $FF
         SEC
         SBC   #$0038
         BVS   L0169D1
         EOR   #$8000
L0169D1  BPL   L0169D6
         BRL   L016AA5
L0169D6  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EF9
         LDX   #^L024EF9
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   L0500A2
         STA   [$F2]
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L02428D
         LDX   #^L02428D
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         PHA
         LDA   L0500A2
         LDX   #$0000
         TAY
         BPL   L016A1A
         DEX
L016A1A  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDA   #L0229BC
         LDX   #^L0229BC
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         PHX
         PHA
         PEA   ^L0242CB
         PEA   L0242CB
         LDA   L0500A2
         PHA
         LDA   #$0014
         SEC
         JSL   L019EFD
         PLA
         LDX   #$0000
         TAY
         BPL   L016A5A
         DEX
L016A5A  PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L024DF4
         LDX   #^L024DF4
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242C5
         LDX   #^L0242C5
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
L016AA5  BRL   L016D02
L016AA8  LDA   $FF
         SEC
         SBC   #$0000
         BVS   L016AB3
         EOR   #$8000
L016AB3  BPL   L016AB8
         BRL   L016D02
L016AB8  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EE7
         LDX   #^L024EE7
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         BNE   L016B16
         LDA   $FF
         EOR   #$FFFF
         INC
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EE7
         LDX   #^L024EE7
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EF9
         LDX   #^L024EF9
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   L0500A2
         STA   [$F2]
         BRL   L016D02
L016B16  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EED
         LDX   #^L024EED
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         BNE   L016B57
         LDA   $FF
         EOR   #$FFFF
         INC
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EED
         LDX   #^L024EED
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
         BRL   L016D02
L016B57  LDA   $FF
         EOR   #$FFFF
         INC
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EF3
         LDX   #^L024EF3
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EF3
         LDX   #^L024EF3
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         LDX   #$0000
         PHX
         PHA
         LDA   #L02428D
         LDX   #^L02428D
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EED
         LDX   #^L024EED
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         LDX   #$0000
         PHX
         PHA
         LDA   #L02428D
         LDX   #^L02428D
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EE7
         LDX   #^L024EE7
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         LDX   #$0000
         PHX
         PHA
         LDA   #L02428D
         LDX   #^L02428D
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         PHA
         LDA   L0500A2
         LDX   #$0000
         TAY
         BPL   L016C22
         DEX
L016C22  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDA   #L0229BC
         LDX   #^L0229BC
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         PHX
         PHA
         PEA   ^L0242D2
         PEA   L0242D2
         LDA   L0500A2
         PHA
         LDA   #$0014
         SEC
         JSL   L019EFD
         PLA
         LDX   #$0000
         TAY
         BPL   L016C62
         DEX
L016C62  PHX
         PHA
         LDA   $F0
         PHA
         LDA   #$0051
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L024DF4
         LDX   #^L024DF4
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242C5
         LDX   #^L0242C5
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EF3
         LDX   #^L024EF3
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$0000
         STA   [$F2]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EED
         LDX   #^L024EED
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
         PHA
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024EE7
         LDX   #^L024EE7
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         STA   [$F2]
L016D02  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L016D0C  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$0020
         TCS
         LDA   L050073
         BEQ   L016D21
         LDA   $FF
         BRL   L016E15
L016D21  STZ   $24
         BRA   L016D8E
L016D25  LDA   $24
         LDX   #$0000
         TAY
         BPL   L016D2E
         DEX
L016D2E  PHX
         PHA
         LDX   $FD
         LDA   $FB
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         CMP   #$0000
         BNE   L016D4D
         LDA   #$0020
         BRA   L016D6B
L016D4D  LDA   $24
         LDX   #$0000
         TAY
         BPL   L016D56
         DEX
L016D56  PHX
         PHA
         LDX   $FD
         LDA   $FB
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
L016D6B  PHA
         LDA   $24
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$0026
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         INC   $24
L016D8E  LDA   $24
         SEC
         SBC   $FF
         BVS   L016D98
         EOR   #$8000
L016D98  BPL   L016D25
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$0026
         JSL   L0198A5
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   #$0000
         SEP   #$20
         STA   [$EE]
         REP   #$20
         PEA   $0000
         TDC
         CLC
         ADC   #$0026
         PHA
         PEI   $F9
         JSL   L0165B6
         PLY
         PLY
         PLY
         STA   $22
         LDA   $F9
         CMP   #$0004
         BNE   L016E0A
         LDA   L0500CA
         BEQ   L016E0A
         JSL   L01848A
         CMP   #$00FF
         BEQ   L016E0A
         JSL   L017CEC
         STZ   L0500D6
         JSL   L01842F
         JSL   L0151A2
         STZ   L0500CA
         JSL   L015727
         JSL   L01561C
         LDA   #$0001
         STA   L0500CE
         LDA   #$FFFF
         BRA   L016E15
L016E0A  LDA   $22
         BEQ   L016E12
         LDA   $FF
         BRA   L016E15
L016E12  LDA   #$FFFF
L016E15  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L016E1F  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00C7
         TCS
         LDAL  L022C13
         AND   #$00FF
         BNE   L016E3C
         LDAL  L022C14
         AND   #$00FF
         BEQ   L016EA5
L016E3C  LDA   $FF
         LDX   #$0000
         TAY
         BPL   L016E45
         DEX
L016E45  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDA   #L0229FB
         LDX   #^L0229FB
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         PHX
         PHA
         PEA   ^L0242DF
         PEA   L0242DF
         PEA   $0000
         TDC
         CLC
         ADC   #$00CA
         PHA
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         SEP   #$20
         STA   $C9
         REP   #$20
         LDA   $C9
         AND   #$00FF
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00CA
         PHA
         PEI   $FD
         JSL   L016D0C
         PLY
         PLY
         PLY
         PLY
L016EA5  TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L016EAD  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   L050073
         BEQ   L016EC8
         PEI   $FF
         PEA   $0004
         JSL   L01662A
         PLY
         PLY
L016EC8  LDA   L050081
         AND   #$00FF
         BEQ   L016ED3
         BRL   L017049
L016ED3  LDA   L0500DA
         CMP   #$0400
         BNE   L016EF9
         LDAL  L02298A+2
         TAX
         LDAL  L02298A
         PHX
         PHA
         LDAL  L02296E+2
         TAX
         LDAL  L02296E
         PHX
         PHA
         JSL   L031C2E
         PLY
         PLY
         PLY
         PLY
L016EF9  LDA   $FF
         CMP   #$007F
         BNE   L016F2A
         LDA   L0500DA
         SEC
         SBC   #$0001
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         CMP   #$007F
         BNE   L016F2A
         DEC   L0500DA
         BRL   L017049
L016F2A  LDA   L050082
         AND   #$00FF
         BEQ   L016F35
         BRL   L016FCC
L016F35  LDA   L050067
         BEQ   L016F3D
         BRL   L016FCC
L016F3D  LDA   $FF
         CMP   #$007F
         BEQ   L016F47
         BRL   L016FCC
L016F47  LDA   L0500DA
         SEC
         SBC   #$0001
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0038
         BVS   L016F6F
         EOR   #$8000
L016F6F  BPL   L016FCC
         LDA   L0500DA
         SEC
         SBC   #$0001
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$003C
         BVS   L016F99
         EOR   #$8000
L016F99  BMI   L016FCC
         LDA   L0500DA
         SEC
         SBC   #$0002
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         CMP   #$007F
         BNE   L016FCC
         LDA   L0500DA
         SEC
         SBC   #$0002
         STA   L0500DA
         BRL   L017049
L016FCC  LDA   L0500DA
         PHA
         INC
         STA   L0500DA
         PLA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   $FF
         STA   [$F4]
         LDA   $FF
         SEC
         SBC   #$0065
         BVS   L016FFA
         EOR   #$8000
L016FFA  BPL   L017001
         LDA   #$0000
         BRA   L017004
L017001  LDA   #$0001
L017004  PHA
         LDA   L0500D4
         PLX
         STX   $F8
         ORA   $F8
         STA   L0500D4
         LDA   $FF
         SEC
         SBC   #$0065
         BVS   L01701B
         EOR   #$8000
L01701B  BPL   L017022
         LDA   #$0000
         BRA   L017025
L017022  LDA   #$0001
L017025  PHA
         LDA   L0500DC
         PLX
         STX   $F8
         ORA   $F8
         STA   L0500DC
         LDA   L050084
         AND   #$00FF
         BEQ   L017049
         LDA   L05008E
         BNE   L017049
         PEI   $FF
         PEA   $0004
         JSL   L01662A
         PLY
         PLY
L017049  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L017053  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L050082
         AND   #$00FF
         BEQ   L017068
         BRA   L01706E
L017068  STZ   L0500DA
         STZ   L0500D4
L01706E  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L017078  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E8
         TCS
         LDA   L050061
         AND   #$00FF
         CLC
         ADC   #$006C
         STAL  L0245F4
         LDA   L0500BE
         SEC
         SBC   #$0002
         BEQ   L0170AA
         BVS   L01709F
         EOR   #$8000
L01709F  BPL   L0170AA
         LDA   #$007E
         SEC
         SBC   L0500BE
         BRA   L0170C9
L0170AA  LDAL  L022C14
         AND   #$00FF
         BEQ   L0170B8
         LDA   #$007C
         BRA   L0170C9
L0170B8  LDAL  L022C13
         AND   #$00FF
         BEQ   L0170C6
         LDA   #$007E
         BRA   L0170C9
L0170C6  LDA   #$007D
L0170C9  STAL  L0245F6
         STZ   $EA
         BRA   L01710D
L0170D1  LDA   $EA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0240FA
         LDX   #^L0240FA
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $EA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EC
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         STA   [$F4]
         INC   $EA
L01710D  LDA   $EA
         SEC
         SBC   #$0004
         BVS   L017118
         EOR   #$8000
L017118  BPL   L0170D1
         LDA   L0500DA
         ASL
         PHA
         PEA   ^L0245F4
         PEA   L0245F4
         PEI   $FF
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         CMP   #$FFFF
         BEQ   L01714F
         PEA   $0008
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         PEI   $FF
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         CMP   #$FFFF
         BNE   L017154
L01714F  LDA   #$0000
         BRA   L017160
L017154  STZ   L0500D4
         LDA   #$0001
         STA   L0500D8
         LDA   #$0001
L017160  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L01716A  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E6
         TCS
         STZ   $EE
         LDA   #$0002
         PHA
         PEA   $0800
         PEA   ^L0245F4
         PEA   L0245F4
         PEI   $FF
         JSL   L01A1C2
         PLY
         PLY
         PLY
         PLY
         SEC
         JSL   L019DD9
         PLY
         STA   L0500DA
         LDA   L0500DA
         CMP   #$FFFF
         BNE   L0171A5
         LDA   #$0000
         BRL   L0173CE
L0171A5  LDA   L0500DA
         SEC
         SBC   #$0002
         BVS   L0171B1
         EOR   #$8000
L0171B1  BPL   L0171F3
         LDAL  L0245F4
         SEC
         SBC   #$0070
         BVS   L0171C0
         EOR   #$8000
L0171C0  BPL   L0171F3
         LDAL  L0245F4
         SEC
         SBC   #$0074
         BEQ   L0171D3
         BVS   L0171D1
         EOR   #$8000
L0171D1  BMI   L0171F3
L0171D3  LDAL  L0245F6
         SEC
         SBC   #$007A
         BVS   L0171E0
         EOR   #$8000
L0171E0  BPL   L0171F3
         LDAL  L0245F6
         SEC
         SBC   #$007E
         BEQ   L0171F8
         BVS   L0171F1
         EOR   #$8000
L0171F1  BPL   L0171F8
L0171F3  LDA   #$0001
         STA   $EE
L0171F8  STZ   $F2
         BRL   L0172A5
L0171FD  LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$FFC9
         BVS   L017220
         EOR   #$8000
L017220  BMI   L017227
         LDA   #$0001
         STA   $EE
L017227  LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BVS   L01724A
         EOR   #$8000
L01724A  BMI   L0172A3
         INC   $F2
         LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BEQ   L017275
         BVS   L017273
         EOR   #$8000
L017273  BMI   L01729E
L017275  INC   $F2
         LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BEQ   L0172A3
         BVS   L01729C
         EOR   #$8000
L01729C  BPL   L0172A3
L01729E  LDA   #$0001
         STA   $EE
L0172A3  INC   $F2
L0172A5  LDA   L0500DA
         SEC
         SBC   #$0004
         SEC
         SBC   $F2
         BEQ   L0172BF
         BVS   L0172B6
         EOR   #$8000
L0172B6  BPL   L0172BF
         LDA   $EE
         BNE   L0172BF
         BRL   L0171FD
L0172BF  STZ   L0500D4
         LDA   $EE
         BEQ   L0172D6
         LDA   #$0001
         SEP   #$20
         STA   L05007F
         REP   #$20
         LDA   #$0000
         BRL   L0173CE
L0172D6  LDA   #$0001
         SEP   #$20
         STA   L0500DE
         REP   #$20
         STZ   $E8
         LDA   #$0001
         STA   L0500D8
         LDA   #$0004
         STA   $F2
         LDA   L0500DA
         STA   $F0
         BRA   L017339
L0172F4  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   #L0240FA
         LDX   #^L0240FA
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         DEC   $F0
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PLX
         STX   $F4
         CMP   $F4
         BEQ   L017339
         LDA   #$0001
         STA   $E8
L017339  LDA   $F2
         DEC   $F2
         TAY
         BNE   L0172F4
         JSL   L01184E
         TAY
         BEQ   L01734C
         STZ   L0500D8
         BRA   L01736A
L01734C  LDA   $E8
         BEQ   L01736A
         LDAL  L02295E+2
         TAX
         LDAL  L02295E
         PHX
         PHA
         JSL   L031C9A
         PLY
         PLY
         STA   $E8
         LDA   $E8
         BNE   L01736A
         STZ   L0500D8
L01736A  JSL   L032568
         LDA   L0500D8
         BEQ   L0173C1
         LDA   #$0004
         STA   $F2
         BRA   L0173B8
L01737A  LDA   L0500DA
         DEC
         STA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   #L0240FA
         LDX   #^L0240FA
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
L0173B8  LDA   $F2
         DEC   $F2
         TAY
         BNE   L01737A
         BRA   L0173CB
L0173C1  LDA   L0500DA
         SEC
         SBC   #$0004
         STA   L0500DA
L0173CB  LDA   #$0001
L0173CE  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L0173D8  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EF
         TCS
         LDA   #$0000
         SEP   #$20
         STA   L050082
         REP   #$20
         AND   #$00FF
         PHA
         LDA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         STA   [$F4]
         JSL   L030702
         LDA   L0500DE
         AND   #$00FF
         BNE   L01741C
         BRL   L0174F7
L01741C  LDAL  L0245F4
         SEC
         SBC   #$006C
         SEP   #$20
         STA   L050061
         REP   #$20
         LDAL  L0245F6
         BRL   L0174C9
L017432  LDA   #$0001
         SEP   #$20
         STAL  L022C13
         REP   #$20
         LDA   #$0000
         SEP   #$20
         STAL  L022C14
         REP   #$20
         LDA   L0500BE
         CMP   #$0002
         BEQ   L017458
         PEA   $0002
         JSL   L03903A
         PLY
L017458  BRL   L0174DA
L01745B  LDA   #$0000
         SEP   #$20
         STAL  L022C13
         REP   #$20
         LDA   #$007D
         SEC
         SBCL  L0245F6
         SEP   #$20
         STAL  L022C14
         REP   #$20
         LDA   L0500BE
         CMP   #$0002
         BEQ   L017486
         PEA   $0002
         JSL   L03903A
         PLY
L017486  BRL   L0174DA
L017489  LDA   #$0000
         SEP   #$20
         STAL  L022C13
         REP   #$20
         SEP   #$20
         STAL  L022C14
         REP   #$20
         LDA   #$007E
         SEC
         SBCL  L0245F6
         CMP   L0500BE
         BEQ   L0174B7
         LDA   #$007E
         SEC
         SBCL  L0245F6
         PHA
         JSL   L03903A
         PLY
L0174B7  BRL   L0174DA
L0174BA  BRL   L0174DA
L0174BD  DA    L017489
         DA    L017489
         DA    L01745B
         DA    L01745B
         DA    L017432
         DA    L0174BA
L0174C9  SEC
         SBC   #$007A
         CMP   #$0005
         BCC   L0174D5
         LDA   #$0005
L0174D5  ASL
         TAX
         JMP   (L0174BD,X)

L0174DA  SEP   #$20
         STZ   L0500DE
         REP   #$20
         LDA   L050061
         AND   #$00FF
         PHA
         JSL   L030F9F
         PLY
         LDAL  L0245F6
         PHA
         JSL   L030B71
         PLY
L0174F7  LDA   $FF
         BNE   L0174FE
         BRL   L01768E
L0174FE  LDA   L0500DA
         SEC
         SBC   #$0002
         BNE   L01750A
         BRL   L017654
L01750A  BVS   L01750F
         EOR   #$8000
L01750F  BMI   L017514
         BRL   L017654
L017514  LDA   L0500DA
         DEC
         STA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BVS   L01753C
         EOR   #$8000
L01753C  BPL   L017541
         BRL   L0175CA
L017541  LDA   L0500DA
         DEC
         STA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BEQ   L01756D
         BVS   L01756B
         EOR   #$8000
L01756B  BMI   L017599
L01756D  LDA   L0500DA
         DEC
         STA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BEQ   L0175C7
         BVS   L017597
         EOR   #$8000
L017597  BPL   L0175C7
L017599  PEA   ^L0242F5
         PEA   L0242F5
         LDAL  L022972+2
         TAX
         LDAL  L022972
         PHX
         PHA
         LDAL  L02296E+2
         TAX
         LDAL  L02296E
         PHX
         PHA
         PEA   ^L0242F4
         PEA   L0242F4
         JSL   L018845
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
L0175C7  BRL   L017654
L0175CA  LDA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         CMP   #$007F
         BNE   L01760E
         LDA   L050082
         AND   #$00FF
         BEQ   L0175F7
         LDA   #$0000
         BRA   L0175FA
L0175F7  LDA   #$0001
L0175FA  SEP   #$20
         STA   L050082
         REP   #$20
         LDA   L050082
         AND   #$00FF
         BNE   L01760C
         BRL   L01768E
L01760C  BRA   L017654
L01760E  LDA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         BEQ   L017651
         LDA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0064
         BVS   L01764F
         EOR   #$8000
L01764F  BPL   L017654
L017651  BRL   L0174F7
L017654  LDA   L0500DA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         BEQ   L017679
         LDA   L050082
         AND   #$00FF
         BEQ   L017689
L017679  LDA   L0500DA
         SEC
         SBC   #$0002
         BEQ   L017689
         BVS   L017687
         EOR   #$8000
L017687  BMI   L01768B
L017689  DEC   $FF
L01768B  BRL   L0174F7
L01768E  LDA   #$0001
         SEP   #$20
         STA   L050080
         REP   #$20
         SEP   #$20
         STA   L050081
         REP   #$20
         LDA   #$0002
         STA   L0500D2
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L0176AD  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E4
         TCS
         LDA   L0500DA
         SEC
         SBC   #$000C
         BEQ   L0176CE
         BVS   L0176C6
         EOR   #$8000
L0176C6  BPL   L0176CE
         LDA   #$0000
         BRL   L01789F
L0176CE  PEA   ^L024455
         PEA   L024455
         JSL   L017D46
         PLY
         PLY
         SEP   #$20
         STA   L0500DF
         REP   #$20
         LDA   #$0002
         STA   $EA
         LDA   #$0000
         STA   $E6
         BRL   L017760
L0176EE  LDA   $EA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEC
         SBC   #$0038
         BVS   L017711
         EOR   #$8000
L017711  BMI   L01775E
         LDA   $EA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L0500DF
         AND   #$00FF
         PHA
         JSL   L017EAC
         PLY
         PLY
         PHA
         LDA   $E6
         INC   $E6
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EC
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
L01775E  INC   $EA
L017760  LDA   $EA
         SEC
         SBC   L0500DA
         BVS   L01776B
         EOR   #$8000
L01776B  BPL   L0176EE
         LDA   #$0000
         STA   $E8
         STA   $EA
         BRA   L0177B4
L017776  PEI   $E6
         LDA   $EA
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024455
         LDX   #^L024455
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L019167
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L0177B2
         INC   $E8
L0177B2  INC   $EA
L0177B4  LDA   $EA
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024455
         LDX   #^L024455
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STX   $F6
         ORA   $F6
         BEQ   L0177E8
         LDA   $E8
         SEC
         SBC   #$0004
         BVS   L0177E6
         EOR   #$8000
L0177E6  BPL   L017776
L0177E8  LDA   $E8
         BNE   L0177F2
         LDA   #$0000
         BRL   L01789F
L0177F2  LDA   $E8
         PHA
         JSL   L01A5C3
         SEC
         JSL   L019DD9
         PLA
         STA   $E8
         STZ   $EA
L017803  PEI   $E6
         LDA   $EA
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024455
         LDX   #^L024455
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L019167
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L01789A
         LDA   $E8
         BEQ   L017845
         DEC   $E8
         BRA   L01789A
L017845  LDA   $E6
         LDX   #$0000
         TAY
         BPL   L01784E
         DEX
L01784E  PHX
         PHA
         LDA   $EA
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L024455
         LDX   #^L024455
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         PHA
         LDA   L0500DF
         AND   #$00FF
         PHA
         LDA   #$0006
         PLX
         STX   $FA
         SEC
         SBC   $FA
         PHA
         JSL   L017EAC
         PLY
         PLY
         BRA   L01789F
L01789A  INC   $EA
         BRL   L017803
L01789F  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L0178A9  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L0500D2
         SEC
         SBC   L0500DA
         BVS   L0178C0
         EOR   #$8000
L0178C0  BPL   L0178C5
         BRL   L017961
L0178C5  LDA   L0500D6
         BNE   L0178CD
         BRL   L017961
L0178CD  LDA   L0500D2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         CMP   #$007F
         BNE   L017904
         LDA   L050082
         AND   #$00FF
         BEQ   L0178FA
         LDA   #$0000
         BRA   L0178FD
L0178FA  LDA   #$0001
L0178FD  SEP   #$20
         STA   L050082
         REP   #$20
L017904  LDA   L0500D2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDA   L0500D6
         PHA
         JSL   L01662A
         PLY
         PLY
         LDA   L0500D2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         CMP   #$007F
         BNE   L017961
         LDA   L050082
         AND   #$00FF
         BEQ   L017957
         LDA   #$0000
         BRA   L01795A
L017957  LDA   #$0001
L01795A  SEP   #$20
         STA   L050082
         REP   #$20
L017961  LDA   L0500DA
         SEC
         SBC   #$0001
         SEC
         SBC   L0500D2
         BEQ   L017978
         BVS   L017973
         EOR   #$8000
L017973  BPL   L017978
         BRL   L0179CA
L017978  LDA   L0500D6
         BEQ   L01799B
         PEA   $0100
         LDA   L0500D6
         PHA
         JSL   L01662A
         PLY
         PLY
         PEA   ^L024525
         PEA   L024525
         LDA   L0500D6
         PHA
         JSL   L0165B6
         PLY
         PLY
         PLY
L01799B  LDA   L0500D6
         CMP   #$0004
         BNE   L0179B5
         JSL   L017D19
         LDA   L0500CA
         BEQ   L0179B3
         JSL   L01842F
         STZ   L0500CA
L0179B3  BRA   L0179C3
L0179B5  LDA   L0500D6
         BEQ   L0179C3
         LDA   L0500D6
         PHA
         JSL   L019217
         PLY
L0179C3  SEP   #$20
         STZ   L050080
         REP   #$20
L0179CA  LDA   L0500D2
         CMP   L0500DA
         BNE   L0179D7
         LDA   #$0000
         BRA   L0179F8
L0179D7  LDA   L0500D2
         PHA
         INC
         STA   L0500D2
         PLA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
L0179F8  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L017A02  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEA   ^L02454E
         PEA   L02454E
         PEI   $FF
         JSL   L0165B6
         PLY
         PLY
         PLY
         PEA   $0003
         PEA   ^L024567
         PEA   L024567
         PEI   $FF
         JSL   L0165B6
         PLY
         PLY
         PLY
         PLY
         LDA   $FF
         STA   L0500D6
         LDAL  L022C13
         AND   #$00FF
         BNE   L017A46
         LDAL  L022C14
         AND   #$00FF
         BEQ   L017A5B
L017A46  LDA   L050061
         AND   #$00FF
         SEC
         SBC   #$0004
         PHA
         LDA   L0500D6
         PHA
         JSL   L016E1F
         PLY
         PLY
L017A5B  PEA   $0000
         JSL   L0173D8
         PLY
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L017A6B  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$0098
         TCS
         PEA   ^L02456A
         PEA   L02456A
         PEI   $FF
         JSL   L0165B6
         PLY
         PLY
         PLY
         STZ   $F2
         BRL   L017C1D
L017A8A  LDA   $F2
         LDX   #$0000
         TAY
         BPL   L017A93
         DEX
L017A93  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   ^L024594
         PEA   L024594
         PEA   $0000
         TDC
         CLC
         ADC   #$009A
         PHA
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         STA   $EC
         STA   $EA
         STZ   $F0
         BRL   L017BB9
L017ADD  STZ   $EE
         BRL   L017BA7
L017AE2  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDA   $EE
         PHA
         LDA   #$0009
         CLC
         JSL   L019EFD
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L022D5F
         LDX   #^L022D5F
         JSL   L0198A5
         PLA
         PLX
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   $F2
         BEQ   L017B1C
         BRL   L017BA5
L017B1C  LDA   $EE
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         CLC
         ADC   $F0
         LDX   #$0000
         TAY
         BPL   L017B32
         DEX
L017B32  PHX
         PHA
         LDA   #L021616
         LDX   #^L021616
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L02428D
         LDX   #^L02428D
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $EC
         CMP   $EA
         BEQ   L017B72
         LDA   #L024599
         LDX   #^L024599
         BRA   L017B78
L017B72  LDA   #L02459E
         LDX   #^L02459E
L017B78  PHX
         PHA
         LDA   $EC
         LDX   #$0000
         TAY
         BPL   L017B83
         DEX
L017B83  PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$009A
         JSL   L0198A5
         JSL   L019101
         PLY
         PLY
         PLY
         PLY
         PLY
         PHA
         LDA   $EC
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $EC
L017BA5  INC   $EE
L017BA7  LDA   $EE
         SEC
         SBC   #$0009
         BVS   L017BB2
         EOR   #$8000
L017BB2  BMI   L017BB7
         BRL   L017AE2
L017BB7  INC   $F0
L017BB9  LDA   $F0
         SEC
         SBC   #$0009
         BVS   L017BC4
         EOR   #$8000
L017BC4  BMI   L017BC9
         BRL   L017ADD
L017BC9  PEI   $EC
         PEA   $0000
         TDC
         CLC
         ADC   #$009A
         PHA
         PEI   $FF
         JSL   L0165B6
         PLY
         PLY
         PLY
         PLY
         PEA   $0001
         PEA   ^L0245A2
         PEA   L0245A2
         PEI   $FF
         JSL   L0165B6
         PLY
         PLY
         PLY
         PLY
         LDA   $EA
         SEC
         SBC   #$0001
         PHA
         PEA   ^L0245A4
         PEA   L0245A4
         PEI   $FF
         JSL   L0165B6
         PLY
         PLY
         PLY
         PLY
         PEA   $0002
         PEA   ^L0245BB
         PEA   L0245BB
         PEI   $FF
         JSL   L0165B6
         PLY
         PLY
         PLY
         PLY
         INC   $F2
L017C1D  LDA   $F2
         SEC
         SBC   L0500BE
         BVS   L017C28
         EOR   #$8000
L017C28  BMI   L017C2D
         BRL   L017A8A
L017C2D  PEA   $0001
         PEA   ^L0245BE
         PEA   L0245BE
         PEI   $FF
         JSL   L0165B6
         PLY
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L017C48  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$009E
         TCS
         LDA   L0500D6
         BNE   L017C63
         LDA   L050084
         AND   #$00FF
         BNE   L017C63
         BRL   L017CE2
L017C63  LDA   L0500D6
         BEQ   L017C6D
         LDA   L0500D6
         BRA   L017C70
L017C6D  LDA   #$0004
L017C70  STA   $A2
         PEA   $0100
         PEI   $A2
         JSL   L01662A
         PLY
         PLY
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L017C86
         DEX
L017C86  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   ^L0245C0
         PEA   L0245C0
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         JSL   L019101
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         STA   $A0
         PEI   $A0
         PEA   $0000
         TDC
         CLC
         ADC   #$00A4
         PHA
         PEI   $A2
         JSL   L0165B6
         PLY
         PLY
         PLY
         PLY
         JSL   L017CEC
L017CE2  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L017CEC  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L0500D6
         BEQ   L017D01
         LDA   L05006F
         BEQ   L017D11
L017D01  PEA   ^L0245C9
         PEA   L0245C9
         PEA   $0004
         JSL   L0165B6
         PLY
         PLY
         PLY
L017D11  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L017D19  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L0500D6
         BEQ   L017D2E
         LDA   L05006F
         BEQ   L017D3E
L017D2E  PEA   ^L0245F2
         PEA   L0245F2
         PEA   $0004
         JSL   L0165B6
         PLY
         PLY
         PLY
L017D3E  TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L017D46  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EB
         TCS
         STZ   $EE
         LDA   #$0002
         STA   $F0
         BRA   L017D5C
L017D5A  INC   $F0
L017D5C  LDA   $F0
         SEC
         SBC   L0500DA
         BVS   L017D67
         EOR   #$8000
L017D67  BMI   L017D90
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         SEC
         SBC   #$0037
         BEQ   L017D90
         BVS   L017D8E
         EOR   #$8000
L017D8E  BMI   L017D5A
L017D90  LDA   $F0
         SEC
         SBC   L0500DA
         BVS   L017D9B
         EOR   #$8000
L017D9B  BMI   L017DBF
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         SEP   #$20
         STA   $ED
         REP   #$20
         BRA   L017DD0
L017DBF  LDA   #$0006
         PHA
         JSL   L01A5C3
         SEC
         JSL   L019DD9
         PLA
         BRL   L017EA2
L017DD0  LDA   $EE
         SEC
         SBC   #$0006
         BVS   L017DDB
         EOR   #$8000
L017DDB  BPL   L017DE0
         BRL   L017E84
L017DE0  STZ   $F0
         BRA   L017E2C
L017DE4  LDA   $F0
         LDX   #$0000
         TAY
         BPL   L017DED
         DEX
L017DED  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         PHA
         LDA   $ED
         AND   #$00FF
         PLX
         STX   $F2
         CMP   $F2
         BNE   L017E2A
         LDA   $EE
         BRL   L017EA2
L017E2A  INC   $F0
L017E2C  LDA   $F0
         LDX   #$0000
         TAY
         BPL   L017E35
         DEX
L017E35  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STX   $F2
         ORA   $F2
         BNE   L017DE4
         LDA   $ED
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242F6
         LDX   #^L0242F6
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         SEP   #$20
         STA   $ED
         REP   #$20
         INC   $EE
         BRL   L017DD0
L017E84  LDAL  L02297A+2
         TAX
         LDAL  L02297A
         PHX
         PHA
         LDAL  L02296E+2
         TAX
         LDAL  L02296E
         PHX
         PHA
         JSL   L031C2E
         PLY
         PLY
         PLY
         PLY
L017EA2  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L017EAC  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FF
         BEQ   L017ED7
         LDA   $FD
         SEC
         SBC   #$0001
         BVS   L017EC6
         EOR   #$8000
L017EC6  BPL   L017ED7
         LDA   $FD
         SEC
         SBC   #$0005
         BEQ   L017EDB
         BVS   L017ED5
         EOR   #$8000
L017ED5  BPL   L017EDB
L017ED7  LDA   $FF
         BRA   L017F04
L017EDB  LDA   $FD
         DEC   $FD
         TAY
         BEQ   L017F02
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L0242F6
         LDX   #^L0242F6
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $FF
         BRA   L017EDB
L017F02  LDA   $FF
L017F04  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L017F0E  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   L0500DA
         SEC
         SBC   #$0001
         STA   $F2
         BRL   L017F9D
L017F25  LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BVS   L017F48
         EOR   #$8000
L017F48  BPL   L017F97
         LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BEQ   L017F9B
         BVS   L017F6F
         EOR   #$8000
L017F6F  BPL   L017F9B
         LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0245F4
         LDX   #^L0245F4
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   $FF
         BEQ   L017F97
         BVS   L017F95
         EOR   #$8000
L017F95  BMI   L017F9B
L017F97  LDA   $F2
         BRA   L017FB0
L017F9B  DEC   $F2
L017F9D  LDA   $F2
         SEC
         SBC   #$0002
         BVS   L017FA8
         EOR   #$8000
L017FA8  BPL   L017FAD
         BRL   L017F25
L017FAD  LDA   #$FFFF
L017FB0  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L017FBA  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0037
         JSL   L017F0E
         PLY
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L017FD7  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $003B
         JSL   L017F0E
         PLY
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L017FF4  PHP
         PHD
         JSL   IRQ_MOUSE
         PLD
         PLP
         RTL

         MX    %11
L017FFD  ADRL  $00000000
L018001  DW    $001E
         DW    $A55A
         REP   #$20
         PHK
         PLB
         LDA   #$001E
         STA   L018001
         SEP   #$20
         REP   #$30
         JSL   L015807
         SEP   #$30
         RTL

         MX    %00
L01801A  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDAL  L02E59B
         SEC
         SBCL  L02E597
         CLC
         ADC   #$0001
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

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

L018094  ENT
         PHP
         PHB
         SEP   #$20
         LDA   #$E1
         PHA
         REP   #$20
         PLB
         LDX   #$9FFE
         LDY   #$4000
L0180A4  STZ   |$0000,X
         DEX
         DEX
         DEY
         BNE   L0180A4
         PLB
         PLP
         RTL

L0180AF  ENT
         PHD
         TSC
         SEC
         SBC   #$00E1
         TCD
         ADC   #$00B0
         TCS
         LDA   $F9
         CMP   #$FFFF
         BNE   L0180C6
         LDA   #$0004
         STA   $F9
L0180C6  LDA   #$0019
         STA   $B2
         LDA   $F9
         SEC
         SBC   #$0000
         BEQ   L01810A
         BVS   L0180D8
         EOR   #$8000
L0180D8  BPL   L01810A
         LDA   $F9
         SEC
         SBC   #$0001
         PHA
         LDA   #$0005
         SEC
         JSL   L019EFD
         LDA   $F9
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $E0
         CLC
         ADC   $E0
         CLC
         ADC   #$000A
         PHA
         LDA   $B2
         PLX
         STX   $E0
         CLC
         ADC   $E0
         STA   $B2
L01810A  LDA   $FB
         CMP   #$FFFF
         BNE   L018116
         LDA   #$00E6
         STA   $FB
L018116  LDA   $FD
         CMP   #$FFFF
         BNE   L01812F
         LDA   #$0002
         PHA
         LDA   #$00C8
         SEC
         SBC   $B2
         SEC
         JSL   L019DD9
         PLY
         STA   $FD
L01812F  LDA   $FF
         CMP   #$FFFF
         BNE   L018148
         LDA   #$0002
         PHA
         LDA   #$0140
         SEC
         SBC   $FB
         SEC
         JSL   L019DD9
         PLY
         STA   $FF
L018148  LDA   $F7
         STA   L050138
         PEA   ^L02E595
         PEA   L02E595
         PEI   $FF
         PEI   $FD
         LDA   $FF
         CLC
         ADC   $FB
         PHA
         LDA   $FD
         CLC
         ADC   $B2
         PHA
         _SetRect
         LDAL  L02E59B
         CLC
         ADC   #$0005
         PHA
         LDAL  L02E599
         CLC
         ADC   #$0005
         PHA
         LDAL  L02E597
         SEC
         SBC   #$0005
         PHA
         LDAL  L02E595
         SEC
         SBC   #$0005
         PHA
         JSL   L015BBB
         PLY
         PLY
         PLY
         PLY
         STX   L050148
         STA   L050146
         LDA   L050132
         CMP   #$0001
         BNE   L0181EA
         PHX
         PHA
         PEA   ^L02E595
         PEA   L02E595
         PEA   $0000
         PEA   $0000
         PEA   $FFFF
         PEA   $FFFF
         PEA   $2000
         PEA   $0000
         PEA   $0000
         PEA   ^L02E595
         PEA   L02E595
         _NewModelessDialog
         PLA
         PLX
         STX   L05013C
         STA   L05013A
         BRA   L018213
L0181EA  PHX
         PHA
         PEA   ^L02E595
         PEA   L02E595
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _NewModalDialog
         PLA
         PLX
         STX   L05013C
         STA   L05013A
L018213  LDA   #$0001
         STA   $DA
         LDA   [$E7]
         AND   #$00FF
         BEQ   L018221
         INC   $DA
L018221  LDA   [$EB]
         AND   #$00FF
         BEQ   L01822A
         INC   $DA
L01822A  LDA   [$EF]
         AND   #$00FF
         BEQ   L018233
         INC   $DA
L018233  LDA   [$F3]
         AND   #$00FF
         BEQ   L01823C
         INC   $DA
L01823C  LDAL  L02E59B
         SEC
         SBCL  L02E597
         CLC
         ADC   #$0001
         STA   $D8
         LDA   $DA
         PHA
         LDA   $DA
         SEC
         SBC   #$0001
         ASL
         PHA
         LDA   #$0007
         SEC
         JSL   L019EFD
         PEI   $F5
         PEI   $F3
         JSL   L018AC0
         PLY
         PLY
         PHA
         PEI   $F1
         PEI   $EF
         JSL   L018AC0
         PLY
         PLY
         PHA
         PEI   $ED
         PEI   $EB
         JSL   L018AC0
         PLY
         PLY
         PHA
         PEI   $E9
         PEI   $E7
         JSL   L018AC0
         PLY
         PLY
         PHA
         LDA   $D8
         PLX
         STX   $E0
         SEC
         SBC   $E0
         PLX
         STX   $E0
         SEC
         SBC   $E0
         PLX
         STX   $E0
         SEC
         SBC   $E0
         PLX
         STX   $E0
         SEC
         SBC   $E0
         PLX
         STX   $E0
         SEC
         SBC   $E0
         SEC
         JSL   L019DD9
         PLY
         STA   L050144
         LDA   L050144
         STA   L050142
         PEA   $000A
         PEI   $E9
         PEI   $E7
         PEA   ^L02E5AD
         PEA   L02E5AD
         PEA   $0000
         TDC
         CLC
         ADC   #$00CC
         PHA
         JSL   L0185D2
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEA   $000B
         PEI   $ED
         PEI   $EB
         PEA   ^L02E5FD
         PEA   L02E5FD
         PEA   $0000
         TDC
         CLC
         ADC   #$00C4
         PHA
         JSL   L0185D2
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEA   $000C
         PEI   $F1
         PEI   $EF
         PEA   ^L02E64D
         PEA   L02E64D
         PEA   $0000
         TDC
         CLC
         ADC   #$00BC
         PHA
         JSL   L0185D2
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEA   $000D
         PEI   $F5
         PEI   $F3
         PEA   ^L02E69D
         PEA   L02E69D
         PEA   $0000
         TDC
         CLC
         ADC   #$00B4
         PHA
         JSL   L0185D2
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDA   #$000A
         CLC
         ADC   $F7
         PHA
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         _GetDItemBox
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         _ShowWindow
         LDA   L050132
         CMP   #$0001
         BNE   L018398
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         _DrawControls
L018398  PHX
         PHA
         _GetPort
         PLA
         PLX
         STX   L050140
         STA   L05013E
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         _SetPort
         LDA   L050130
         CMP   #$0001
         BNE   L0183E7
         PEA   $0002
         _SetFontFlags
         BRA   L0183FA
L0183E7  PEA   $0000
         _SetFontFlags
L0183FA  SEC
         LDA   L050134
         SBC   #$0000
         BNE   L01840B
         LDA   L050136
         SBC   #$0000
         BRA   L018413
L01840B  LDA   L050136
         SBC   #$0000
         REP   #$02
L018413  BEQ   L018427
         LDX   L050136
         LDA   L050134
         STA   $DC
         STX   $DE
         LDA   $DC
         LDX   $DE
         JSL   L01A615
L018427  TDC
         CLC
         ADC   #$00E1
         TCS
         PLD
         RTL

L01842F  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         STZ   L050132
         STZ   L050130
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         _CloseDialog
         LDX   L050148
         LDA   L050146
         PHX
         PHA
         JSL   L015DAF
         PLY
         PLY
         LDX   L050140
         LDA   L05013E
         PHX
         PHA
         _SetPort
         JSL   L0151A2
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L01848A  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L01561C
         LDA   L050132
         CMP   #$0001
         BNE   L0184A9
         JSL   L0184EC
         BRA   L0184AD
         BRA   L0184AD
L0184A9  JSL   L0184B7
L0184AD  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L0184B7  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         PHA
         PEA   $0000
         PEA   $0000
         _ModalDialog
         PLA
         STA   $F4
         LDA   $F4
         SEC
         SBC   #$000A
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L0184EC  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00BE
         TCS
         PHA
         PEA   $0002	; mouseDown
         PEA   $0000
         TDC
         CLC
         ADC   #$00DE
         PHA
         _GetNextEvent
         PLA
         TAY
         BNE   L01851E
         LDA   #$00FF
         BRL   L0185A9

L01851E  PHA
         PEA   $0004	; keyDown
         PEA   $0000
         TDC
         CLC
         ADC   #$00C6
         PHA
         _GetNextEvent
         PLA
         TAY
         BEQ   L01851E
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00DE
         PHA
         _IsDialogEvent
         PLA
         TAY
         BNE   L018562
         LDA   #$00FF
         BRA   L0185A9
L018562  PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00DE
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00C2
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00C0
         PHA
         _DialogSelect
         PLA
         TAY
         BNE   L018597
         LDA   #$00FF
         BRA   L0185A9
L018597  LDA   $C0
         CMP   #$0001
         BNE   L0185A3
         LDA   L050138
         BRA   L0185A9
L0185A3  LDA   $C0
         SEC
         SBC   #$000A
L0185A9  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L0185B3  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDAL  L02E595
         STA   [$F9]
         LDAL  L02E597
         STA   [$FD]
         TDC
         CLC
         ADC   #$00F3
         TCS
         PLD
         RTL

L0185D2  PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$00E6
         TCS
         PEA   ^L02E503
         PEA   L02E503
         PEI   $FD
         PEI   $FB
         JSL   L019F94
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BEQ   L01860E
         PEA   ^L02E505
         PEA   L02E505
         PEI   $FD
         PEI   $FB
         JSL   L019F94
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BEQ   L01860E
         BRL   L018718
L01860E  PEI   $F5
         PEI   $F3
         LDA   L050142
         PHA
         LDAL  L02E599
         SEC
         SBCL  L02E595
         SEC
         SBC   #$0014
         PHA
         LDA   L050142
         CLC
         ADC   #$0010
         CLC
         ADC   #$000E
         PHA
         LDAL  L02E599
         SEC
         SBCL  L02E595
         SEC
         SBC   #$0005
         PHA
         _SetRect
         PEA   ^L02E507
         PEA   L02E507
         PEI   $FD
         PEI   $FB
         JSL   L019F94
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BNE   L0186B2
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         PEI   $FF
         PEI   $F5
         PEI   $F3
         PEA   $0014
         PEA   ^L018C0F
         PEA   L018C0F
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _NewDItem
         LDA   $F3
         LDX   $F5
         PHX
         PHA
         PEA   ^L02E59D
         PEA   L02E59D
         PEA   $0008
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         BRA   L0186FD
L0186B2  LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         PEI   $FF
         PEI   $F5
         PEI   $F3
         PEA   $0014
         PEA   ^L018C4D
         PEA   L018C4D
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _NewDItem
         LDA   $F3
         LDX   $F5
         PHX
         PHA
         PEA   ^L02E5A5
         PEA   L02E5A5
         PEA   $0008
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
L0186FD  LDA   #$0010
         CLC
         ADC   L050144
         CLC
         ADC   #$000E
         PHA
         LDA   L050142
         PLX
         STX   $EC
         CLC
         ADC   $EC
         STA   L050142
         BRL   L0187CF
L018718  LDA   [$FB]
         AND   #$00FF
         BNE   L018722
         BRL   L0187CF
L018722  PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         PEI   $F5
         PEI   $F3
         LDA   L050142
         PHA
         LDAL  L02E599
         SEC
         SBCL  L02E595
         SEC
         SBC   #$0014
         PHA
         PEI   $FD
         PEI   $FB
         JSL   L018AC0
         PLY
         PLY
         PHA
         LDA   L050142
         PLX
         STX   $EC
         CLC
         ADC   $EC
         CLC
         ADC   #$000E
         PHA
         LDAL  L02E599
         SEC
         SBCL  L02E595
         SEC
         SBC   #$0005
         PHA
         _SetRect
         LDX   L05013C
         LDA   L05013A
         PHX
         PHA
         PEI   $FF
         PEI   $F5
         PEI   $F3
         PEA   $000A
         PEI   $F9
         PEI   $F7
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _NewDItem
         PEI   $FD
         PEI   $FB
         JSL   L018AC0
         PLY
         PLY
         CLC
         ADC   L050144
         CLC
         ADC   #$000E
         PHA
         LDA   L050142
         PLX
         STX   $EC
         CLC
         ADC   $EC
         STA   L050142
L0187CF  TDC
         CLC
         ADC   #$00ED
         TCS
         PLD
         RTL

L0187D7  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         PHA
         LDA   #$0005
         SEC
         JSL   L019EFD
         LDA   $FF
         CLC
         ADC   #$0001
         PHA
         LDA   #$0009
         SEC
         JSL   L019EFD
         LDA   #$0005
         PLX
         STX   $F8
         CLC
         ADC   $F8
         PLX
         STX   $F8
         CLC
         ADC   $F8
         TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

	 MX    %11
L018815  ENT
         ADRL  $00000000
L018819  DW    $0001
         DW    $A55A
	 REP   #$20
         PHK
	 PLB
         LDA   #$0001
         STA   L018819
         SEP   #$30
         LDA   #$E0
         PHA
         PLB
         LDA   $077C
         AND   #$80
         BEQ   L01883C
         REP   #$30
         JSL   L015228
         BRA   L018842
L01883C  REP   #$30
         JSL   L01529D
L018842  SEP   #$30
         RTL

         MX    %00
L018845  ENT
         PHD
         TSC
         SEC
         SBC   #$00EB
         TCD
         ADC   #$00E4
         TCS
         PEA   $0000
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEI   $F5
         PEI   $F3
         PEI   $F1
         PEA   ^L02E50E
         PEA   L02E50E
         PEA   ^L02E50D
         PEA   L02E50D
         PEA   ^L02E50C
         PEA   L02E50C
         PEA   ^L02E509
         PEA   L02E509
         JSL   L018897
         TAY
         TSC
         CLC
         ADC   #$0022
         TCS
         TYA
         JSL   L01848A
         JSL   L01842F
         TDC
         CLC
         ADC   #$00EB
         TCS
         PLD
         RTL

L018897  ENT
         PHD
         TSC
         SEC
         SBC   #$00D9
         TCD
         ADC   #$00D2
         TCS
         PEA   $FFFF
         PEA   $FFFF
         PEA   $FFFF
         PEA   $0004
         PEI   $FF
         PEI   $ED
         PEI   $EB
         PEI   $E9
         PEI   $E7
         PEI   $E5
         PEI   $E3
         PEI   $E1
         PEI   $DF
         JSL   L0180AF
         TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PEI   $F1
         PEI   $EF
         PEA   $0000
         JSL   L018B9D
         PLY
         PLY
         PLY
         PEI   $F5
         PEI   $F3
         PEA   $0001
         JSL   L018B9D
         PLY
         PLY
         PLY
         PEI   $F9
         PEI   $F7
         PEA   $0002
         JSL   L018B9D
         PLY
         PLY
         PLY
         PEI   $FD
         PEI   $FB
         PEA   $0003
         JSL   L018B9D
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00D9
         TCS
         PLD
         RTL

L01890C  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   L05014A
         CMP   #$0000
         BNE   L018923
         JSL   L018E15
L018923  LDA   L05014C
         BEQ   L018934
         PEI   $FF
         PEI   $FD
         JSL   L01896D
         PLY
         PLY
         BRA   L01893E
L018934  PEI   $FF
         PEI   $FD
         JSL   L018946
         PLY
         PLY
L01893E  TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L018946  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         PEI   $FD
         _WriteCString
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L01896D  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         STZ   $F0
         BRA   L0189AF
L01897C  SEI
         LDA   $F0
         LDX   #$0000
         TAY
         BPL   L018986
         DEX
L018986  PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         PHA
         _WriteChar
         CLI
         INC   $F0
L0189AF  LDA   $F0
         LDX   #$0000
         TAY
         BPL   L0189B8
         DEX
L0189B8  PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0000
         BNE   L01897C
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L0189DA  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$FF40
         TCS
         JSL   L01561C
         JSL   L018B20
         TAY
         BEQ   L0189F6
         LDA   #$0000
         BRL   L018A99
L0189F6
*  JSL   L018CFC
         PEA   $0120
         PEA   $00BE
         PEA   $0017
         PEA   $002D
         JSL   L015BBB
         PLY
         PLY
         PLY
         PLY
         TXY
         LDX   #$FF42
         STY   $02,X
         STA   $00,X
         TYX
         PEI   $FF
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$005C
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         PEA   $001C
         PEA   $0032
         PEA   ^L02E762
         PEA   L02E762
         PEA   $0000
         TDC
         CLC
         ADC   #$005C
         PHA
         PEA   $000F
         PEA   $0000
         TDC
         CLC
         ADC   #$FF46
         PHA
         _SFPutFile
         LDX   #$FF46
         LDA   $00,X
         BEQ   L018A79
         PEA   $0000
         TDC
         CLC
         ADC   #$FF4C
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L015AC4
         PLY
         PLY
         PLY
         PLY
L018A79  LDX   #$FF44
         LDA   $00,X
         TAX
         PHX
         LDX   #$FF42
         LDA   $00,X
         PHA
         JSL   L015DAF
         PLY
         PLY
         JSL   L0151A2
*         JSL   L018C8B
         LDX   #$FF46
         LDA   $00,X
L018A99  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L018AA3  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDX   $FF
         LDA   $FD
         STX   L050136
         STA   L050134
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L018AC0  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEA   ^L02E4FF
         PEA   L02E4FF
         PEI   $FF
         PEI   $FD
         JSL   L019F94
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BEQ   L018AF9
         PEA   ^L02E501
         PEA   L02E501
         PEI   $FF
         PEI   $FD
         JSL   L019F94
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BNE   L018B00
L018AF9  LDA   #$0010
         BRA   L018B16
         BRA   L018B16
L018B00  PHA
         PEI   $FF
         PEI   $FD
         _CStringWidth
         PLA
L018B16  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L018B20  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
L018B2B  JSL   L018EBC
         STA   $F4
         TAY
         BNE   L018B37
         BRL   L018B8C
L018B37  PEA   $0000
         PEA   ^L02E752
         PEA   L02E752
         PEA   ^L02E751
         PEA   L02E751
         PEA   ^L02E743
         PEA   L02E743
         PEA   ^L02E742
         PEA   L02E742
         PEA   ^L02E741
         PEA   L02E741
         PEA   ^L02E740
         PEA   L02E740
         PEA   ^L02E739
         PEA   L02E739
         PEA   ^L02E736
         PEA   L02E736
         JSL   L018897
         TAY
         TSC
         CLC
         ADC   #$0022
         TCS
         TYA
         JSL   L01848A
         STA   $F2
         JSL   L01842F
         LDA   $F2
         CMP   #$0001
         BNE   L018B8C
         LDA   #$0001
         BRA   L018B93
L018B8C  LDA   $F4
         BNE   L018B2B
         LDA   #$0000
L018B93  TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L018B9D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDA   #$0002
         PHA
         PHA
         PEI   $FF
         PEI   $FD
         _CStringWidth
         LDAL  L02E59B
         SEC
         SBCL  L02E597
         CLC
         ADC   #$0001
         PLX
         STX   $F4
         SEC
         SBC   $F4
         SEC
         JSL   L019DD9
         PLY
         PHA
         PEI   $FB
         JSL   L0187D7
         PLY
         PHA
         _MoveTo
         PEI   $FF
         PEI   $FD
         _DrawCString
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         RTL

L018C0F  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EC
         TCS
         JSL   L01920F
         STA   $EE
         PEA   $0000
         JSL   L018FB6
         PLY
         PEI   $EE
         JSL   L01988F
         PLY
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         SEP   #$20
         LDA   $03,S
         STA   $09,S
         LDA   $02,S
         STA   $08,S
         LDA   $01,S
         STA   $07,S
         REP   #$20
         TSC
         CLC
         ADC   #$0006
         TCS
         RTL

L018C4D  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EC
         TCS
         JSL   L01920F
         STA   $EE
         PEA   $0001
         JSL   L018FB6
         PLY
         PEI   $EE
         JSL   L01988F
         PLY
         TDC
         CLC
         ADC   #$00F5
         TCS
         PLD
         SEP   #$20
         LDA   $03,S
         STA   $09,S
         LDA   $02,S
         STA   $08,S
         LDA   $01,S
         STA   $07,S
         REP   #$20
         TSC
         CLC
         ADC   #$0006
         TCS
         RTL

L018E15  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         LDX   #$0000
         LDA   #$0001
         STX   $F4
         STA   $F2
         STZ   $F0
         _TextReset
         PEA   $007F
         PEA   $0000
         _SetOutGlobals
         PEI   $F0
         PEI   $F4
         PEI   $F2
         _SetOutputDevice
         PEA   $0001
         _InitTextDev
         JSL   L018E8D
         LDA   #$0001
         STA   L05014A
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L018E8D  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0021
         STA   $F4
         PHA
         PEI   $F4
         _ReadBParam
         PLA
         STA   L05014C
         TDC
         CLC
         ADC   #$00FB
         TCS
         PLD
         RTL

L018EBC  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$FFEE
         TCS
         LDA   #$0001
         LDX   #$FFF0
         STA   $00,X
         LDX   #$0000
         TDC
         CLC
         ADC   #$0042
         STX   $EA
         STA   $E8
         LDA   #$0001
         STA   $E2
         BRA   L018F52
L018EE2  PEA   $0000
         TDC
         CLC
         ADC   #$0042
         PHA
         JSL   L018F6E
         PLY
         PLY
         PEI   $E2
         PEA   ^L02E731
         PEA   L02E731
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         JSL   L019101
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFF2
         PHA
         JSL   L015B55
         PLY
         PLY
         PLY
         PLY
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFF2
         STX   $E6
         STA   $E4
         PEA   $0008
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         JSL   L01A356
         LDA   $42
         AND   #$00FF
         CMP   #$0000
         BEQ   L018F50
         LDX   #$FFF0
         STZ   $00,X
L018F50  INC   $E2
L018F52  LDA   $E2
         SEC
         SBC   #$000E
         BVS   L018F5D
         EOR   #$8000
L018F5D  BPL   L018EE2
         LDX   #$FFF0
         LDA   $00,X
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L018F6E  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         STZ   $F0
         BRA   L018FA1
L018F7D  LDA   $F0
         LDX   #$0000
         TAY
         BPL   L018F86
         DEX
L018F86  PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$0000
         SEP   #$20
         STA   [$F2]
         REP   #$20
         INC   $F0
L018FA1  LDA   $F0
         SEC
         SBC   #$0050
         BVS   L018FAC
         EOR   #$8000
L018FAC  BPL   L018F7D
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L018FB6  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00D2
         TCS
         LDA   #$0000
         STA   $D4
         LDA   $FF
         CMP   #$0000
         BNE   L018FF6
         LDA   #L02E48F
         LDX   #^L02E48F
         STX   $D8
         STA   $D6
         LDA   #L02E59D
         LDX   #^L02E59D
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         PEA   $0008
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         BRA   L01901D
L018FF6  LDA   #L02E41F
         LDX   #^L02E41F
         STX   $D8
         STA   $D6
         LDA   #L02E5A5
         LDX   #^L02E5A5
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         PEA   $0008
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
L01901D  LDA   #$0008
         STA   $DA
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         PEA   $0000
         PEA   $0000
         PEA   $0010
         PEA   $000D
         _SetRect
         LDX   #$0000
         TDC
         CLC
         ADC   #$00EC
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00DC
         PHA
         PEA   $0008
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         PEA   $0000
         TDC
         CLC
         ADC   #$00D4
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         LDA   $E6
         CLC
         ADC   #$0007
         PHA
         LDAL  L02E599
         SEC
         SBCL  L02E595
         SEC
         SBC   #$0014
         PHA
         PEA   $0000
         _PPToPort
         PEA   $0000
         _SetSolidPenPat
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         PEA   $000A
         PEA   $000A
         _FrameRRect
         LDA   $E6
         DEC   $E6
         LDA   $EA
         INC   $EA
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         PEA   $000A
         PEA   $000A
         _FrameRRect
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L019101  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00D0
         TCS
         LDA   #$7FFF
         STA   $D6
         LDX   $F9
         LDA   $F7
         STX   $DA
         STA   $D8
         STX   $DE
         STA   $DC
         LDA   #$0002
         STA   $E6
         LDA   #$0014
         STA   $E8
         LDX   #$0000
         TDC
         CLC
         ADC   #$00FF
         STX   $D4
         STA   $D2
         PEA   $0000
         TDC
         CLC
         ADC   #$00D6
         PHA
         PEI   $D4
         PEI   $D2
         PEI   $FD
         PEI   $FB
         JSL   L01AB2B
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         STA   $EA
         LDA   #$0000
         SEP   #$20
         STA   [$D8]
         REP   #$20
         LDA   $EA
         TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L019167  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         LDA   $F7
         CMP   $FB
         BNE   L019184
         LDA   $F9
         CMP   $FD
         BNE   L019184
         LDA   #$0000
         BRL   L019205
L019184  DEC   $FF
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L019191
         EOR   #$8000
L019191  BPL   L0191D2
         LDA   [$F7]
         AND   #$00FF
         PHA
         LDX   $FD
         LDA   $FB
         INC   $FB
         BNE   L0191A3
         INC   $FD
L0191A3  STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         PLX
         STX   $EC
         CMP   $EC
         BNE   L0191D2
         LDX   $F9
         LDA   $F7
         INC   $F7
         BNE   L0191BD
         INC   $F9
L0191BD  STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         CMP   #$0000
         BNE   L0191D0
         LDA   #$0000
         BRA   L019205
L0191D0  BRA   L019184
L0191D2  LDA   $FF
         SEC
         SBC   #$0000
         BVS   L0191DD
         EOR   #$8000
L0191DD  BMI   L0191E4
         LDA   #$0000
         BRA   L019205
L0191E4  LDA   $FB
         BNE   L0191EA
         DEC   $FD
L0191EA  DEC   $FB
         LDX   $FD
         LDA   $FB
         STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         PHA
         LDA   [$F7]
         AND   #$00FF
         PLX
         STX   $F0
         SEC
         SBC   $F0
L019205  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L01920F  ENT
         PHB
         LDA   #^L05018E
         PHA
         PLB
         PLA
         RTL

L019217  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L01922D
         EOR   #$8000
L01922D  BMI   L019240
         PEA   $0000
         PEA   $0016
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRA   L0192B6
L019240  PEA   $0000
         TDC
         CLC
         ADC   #$00FF
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $F2
         STA   $F0
         LDA   $F0
         CMP   #$0000
         BNE   L019266
         LDA   $F2
         CMP   #$0000
         BNE   L019266
         LDA   #$FFFF
         BRA   L0192B6
L019266  PEI   $F2
         PEI   $F0
         LDY   #$0006
         LDA   [$F0],Y
         TAX
         LDY   #$0004
         LDA   [$F0],Y
         STA   $F4
         STX   $F6
         LDY   #$000A
         LDA   [$F4],Y
         TAX
         LDY   #$0008
         LDA   [$F4],Y
         STA   $F4
         STX   $F6
         LDA   $F4
         LDX   $F6
         JSL   L01A615
         PLY
         PLY
         STA   $EE
         LDA   #$0000
         STA   [$F0]
         LDA   $EE
         CMP   #$0000
         BEQ   L0192B3
         LDY   #$0002
         LDA   [$F0],Y
         PHA
         PEI   $EE
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRA   L0192B6
L0192B3  LDA   #$0000
L0192B6  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L0192C0  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00DF
         TCS
         STZ   $EF
         STZ   L050006
         LDA   $FD
         CMP   #$0000
         BNE   L0192E7
         LDA   $FF
         CMP   #$0000
         BNE   L0192E7
         LDA   #$0001
         STA   L05018F
         BRL   L01970B

L0192E7  LDX   $FF
         LDA   $FD
         CLC
         ADC   #$0008
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E9
         STA   $E7
         LDA   [$E7]
         SEP   #$20
         STA   $F1
*         REP   #$20
         LDA   #$0000
*         SEP   #$20
         STA   [$E7]
         REP   #$20
         PEA   $0001
         PEA   ^L02EAB0
         PEA   L02EAB0
         PEI   $FF
         PEI   $FD
         JSL   L01A755
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L019335
         LDA   #$0001
         STA   L05018F
         LDA   $F1
         SEP   #$20
         STA   [$E7]
         REP   #$20
         BRL   L01970B
L019335  STZ   L05018F
         LDA   $F1
         SEP   #$20
         STA   [$E7]
         REP   #$20
         PHX
         PHA
         PEA   $0000
         PEA   $0100
         LDA   appID
         ORA   #$0F00
         PHA
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         STX   $ED
         STA   $EB
         LDA   L050002
         BEQ   L01937B
         PEA   $FFFF
         JSL   L01A6E0
         PLY
L01937B  LDA   #$0100
         STA   $E1
L019380  LDA   [$E7]
         AND   #$00FF
         CMP   #$0000
         BNE   L01938D
         BRL   L0195EB
L01938D  INC   L050006
         LDA   [$E7]
         AND   #$00FF
         CMP   #$0022
         BEQ   L01939D
         BRL   L0194C4
L01939D  INC   $E7
         BNE   L0193A3
         INC   $E9
L0193A3  LDA   [$E7]
         AND   #$00FF
         CMP   #$0000
         BNE   L0193B0
         BRL   L0194C1
L0193B0  LDA   [$E7]
         AND   #$00FF
         CMP   #$0022
         BEQ   L0193BD
         BRL   L019449
L0193BD  INC   $E7
         BNE   L0193C3
         INC   $E9
L0193C3  LDA   [$E7]
         AND   #$00FF
         CMP   #$0022
         BNE   L019444
         LDA   $EF
         CMP   $E1
         BNE   L01940B
         LDA   $E1
         CLC
         ADC   #$0100
         LDX   #$0000
         TAY
         BPL   L0193E0
         DEX
L0193E0  PHX
         PHA
         PEI   $ED
         PEI   $EB
         _SetHandleSize
         LDA   L050002
         BEQ   L019403
         PEA   $FFFF
         JSL   L01A6E0
         PLY
L019403  LDA   $E1
         CLC
         ADC   #$0100
         STA   $E1
L01940B  LDX   $E9
         LDA   $E7
         INC   $E7
         BNE   L019415
         INC   $E9
L019415  STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   $EF
         INC   $EF
         LDX   #$0000
         TAY
         BPL   L019427
         DEX
L019427  PHX
         PHA
         LDY   #$0002
         LDA   [$EB],Y
         TAX
         LDA   [$EB]
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         SEP   #$20
         STA   [$F2]
         REP   #$20
         BRA   L019447
L019444  BRL   L0194C1
L019447  BRA   L0194BE
L019449  LDA   $EF
         CMP   $E1
         BNE   L019487
         LDA   $E1
         CLC
         ADC   #$0100
         LDX   #$0000
         TAY
         BPL   L01945C
         DEX
L01945C  PHX
         PHA
         PEI   $ED
         PEI   $EB
         _SetHandleSize
         LDA   L050002
         BEQ   L01947F
         PEA   $FFFF
         JSL   L01A6E0
         PLY
L01947F  LDA   $E1
         CLC
         ADC   #$0100
         STA   $E1
L019487  LDX   $E9
         LDA   $E7
         INC   $E7
         BNE   L019491
         INC   $E9
L019491  STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   $EF
         INC   $EF
         LDX   #$0000
         TAY
         BPL   L0194A3
         DEX
L0194A3  PHX
         PHA
         LDY   #$0002
         LDA   [$EB],Y
         TAX
         LDA   [$EB]
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         SEP   #$20
         STA   [$F2]
         REP   #$20
L0194BE  BRL   L0193A3
L0194C1  BRL   L019566
L0194C4  LDA   [$E7]
         SEP   #$20
         STA   $F1
         REP   #$20
         AND   #$00FF
         CMP   #$0020
         BNE   L0194D7
         BRL   L019566
L0194D7  LDA   $F1
         AND   #$00FF
         CMP   #$0000
         BNE   L0194E4
         BRL   L019566
L0194E4  LDA   $F1
         AND   #$00FF
         CMP   #$0009
         BEQ   L019566
         LDA   $EF
         CMP   $E1
         BNE   L01952C
         LDA   $E1
         CLC
         ADC   #$0100
         LDX   #$0000
         TAY
         BPL   L019501
         DEX
L019501  PHX
         PHA
         PEI   $ED
         PEI   $EB
         _SetHandleSize
         LDA   L050002
         BEQ   L019524
         PEA   $FFFF
         JSL   L01A6E0
         PLY
L019524  LDA   $E1
         CLC
         ADC   #$0100
         STA   $E1
L01952C  LDX   $E9
         LDA   $E7
         INC   $E7
         BNE   L019536
         INC   $E9
L019536  STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   $EF
         INC   $EF
         LDX   #$0000
         TAY
         BPL   L019548
         DEX
L019548  PHX
         PHA
         LDY   #$0002
         LDA   [$EB],Y
         TAX
         LDA   [$EB]
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         SEP   #$20
         STA   [$F2]
         REP   #$20
         BRL   L0194C4
L019566  LDA   $EF
         CMP   $E1
         BNE   L0195A4
         LDA   $E1
         CLC
         ADC   #$0100
         LDX   #$0000
         TAY
         BPL   L019579
         DEX
L019579  PHX
         PHA
         PEI   $ED
         PEI   $EB
         _SetHandleSize
         LDA   L050002
         BEQ   L01959C
         PEA   $FFFF
         JSL   L01A6E0
         PLY
L01959C  LDA   $E1
         CLC
         ADC   #$0100
         STA   $E1
L0195A4  LDA   $EF
         INC   $EF
         LDX   #$0000
         TAY
         BPL   L0195AF
         DEX
L0195AF  PHX
         PHA
         LDY   #$0002
         LDA   [$EB],Y
         TAX
         LDA   [$EB]
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$0000
         SEP   #$20
         STA   [$F2]
         REP   #$20
L0195CC  LDA   [$E7]
         AND   #$00FF
         CMP   #$0020
         BEQ   L0195E0
         LDA   [$E7]
         AND   #$00FF
         CMP   #$0009
         BNE   L0195E8
L0195E0  INC   $E7
         BNE   L0195E6
         INC   $E9
L0195E6  BRA   L0195CC
L0195E8  BRL   L019380
L0195EB  LDA   $EF
         LDX   #$0000
         TAY
         BPL   L0195F4
         DEX
L0195F4  PHX
         PHA
         PEI   $ED
         PEI   $EB
         _SetHandleSize
         PEI   $ED
         PEI   $EB
         _HLock
         LDA   L050006
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L01962C
         DEX
L01962C  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         JSL   L01A6FE		; New handle
         PLY
         PLY
         STX   L05000A
         STA   L050008

         LDY   #$0002
         LDA   [$EB],Y
         TAX
         LDA   [$EB]
         PHX
         PHA
         LDX   L05000A
         LDA   L050008
         STA   $F2
         STX   $F4
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F2],Y
         PLA
         STA   [$F2]
         LDA   #$0001
         STA   $EF
         LDY   #$0002
         LDA   [$EB],Y
         TAX
         LDA   [$EB]
         STX   $E5
         STA   $E3
         BRA   L0196C8
L019677  LDA   [$E3]
         AND   #$00FF
         BNE   L0196C2
         LDX   $E5
         LDA   $E3
         CLC
         ADC   #$0001
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         LDA   $EF
         INC   $EF
         LDX   #$0000
         TAY
         BPL   L01969A
         DEX
L01969A  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L05000A
         LDA   L050008
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F2],Y
         PLA
         STA   [$F2]
L0196C2  INC   $E3
         BNE   L0196C8
         INC   $E5
L0196C8  LDA   $EF
         SEC
         SBC   L050006
         BVS   L0196D3
         EOR   #$8000
L0196D3  BPL   L019677
         LDA   L050006
         LDX   #$0000
         TAY
         BPL   L0196DF
         DEX
L0196DF  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L05000A
         LDA   L050008
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDX   #$0000
         LDA   #$0000
         LDY   #$0002
         PHA
         TXA
         STA   [$F2],Y
         PLA
         STA   [$F2]
L01970B  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L019715  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E6
         TCS
         LDA   $F9
         SEC
         SBC   #$0000
         BVS   L01972B
         EOR   #$8000
L01972B  BMI   L01973F
         PEA   $0000
         PEA   $0016
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRL   L0197ED
L01973F  PEA   $0000
         TDC
         CLC
         ADC   #$00F9
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $EC
         STA   $EA
         LDA   $EA
         CMP   #$0000
         BNE   L019766
         LDA   $EC
         CMP   #$0000
         BNE   L019766
         LDA   #$FFFF
         BRL   L0197ED
L019766  LDA   [$EA]
         AND   #$0002
         TAY
         BNE   L01977F
         PEA   $0000
         PEA   $0009
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRA   L0197ED
L01977F  LDA   $FF
         LDY   #$000C
         STA   [$EA],Y
         LDX   $FD
         LDA   $FB
         LDY   #$0010
         PHA
         TXA
         STA   [$EA],Y
         PLA
         LDY   #$000E
         STA   [$EA],Y
         PEI   $EC
         PEI   $EA
         LDY   #$0006
         LDA   [$EA],Y
         TAX
         LDY   #$0004
         LDA   [$EA],Y
         STA   $EE
         STX   $F0
         LDY   #$0012
         LDA   [$EE],Y
         TAX
         LDY   #$0010
         LDA   [$EE],Y
         STA   $EE
         STX   $F0
         LDA   $EE
         LDX   $F0
         JSL   L01A615
         PLY
         PLY
         STA   $E8
         LDA   $E8
         CMP   #$0000
         BEQ   L0197DF
         LDY   #$0002
         LDA   [$EA],Y
         PHA
         PEI   $E8
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRA   L0197ED
L0197DF  LDY   #$000C
         LDA   [$EA],Y
         PHA
         LDA   $FF
         PLX
         STX   $F2
         SEC
         SBC   $F2
L0197ED  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L0197F7  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L01980D
         EOR   #$8000
L01980D  BPL   L019813
         LDA   $FF
         BRA   L019819
L019813  LDA   $FF
         EOR   #$FFFF
         INC
L019819  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L019823  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E6
         TCS
         LDX   $FF
         LDA   $FD
         STX   $EA
         STA   $E8
         LDX   $FF
         LDA   $FD
         STX   $F2
         ORA   $F2
         BEQ   L019881
L019840  LDA   [$FD]
         AND   #$00FF
         STA   $EC
         LDA   $EE
         PHA
         LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L019854
         INC   $FF
L019854  STA   $F2
         STX   $F4
         PLA
         SEP   #$20
         STA   [$F2]
         REP   #$20
         LDA   $EC
         STA   $EE
         LDA   $EC
         BNE   L019840
         LDX   $EA
         LDA   $E8
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L019EF2
         PLA
         PLX
         SEC
         SBC   #$0001
         SEP   #$20
         STA   [$E8]
         REP   #$20
L019881  LDX   $EA
         LDA   $E8
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01988F  ENT
         LDA   $04,S
         PHA
         PLB
         PLB
         RTL

L019895  ENT
         TAY
         LDA   $04,S
         TAX
         BEQ   L0198A1
         TYA
L01989C  ASL
         DEX
         BNE   L01989C
         TAY
L0198A1  TYA
         STA   $04,S
         RTL

L0198A5  ENT
         CLC
         ADC   $04,S
         STA   $04,S
         TXA
         ADC   $06,S
         STA   $06,S
         RTL

L0198B0  PHD
         PHX
         PHA
         TSC
         TCD
         LDX   $0A
         LDA   $0C
         BEQ   L0198BE
         LDX   #$0021
L0198BE  TXY
         BEQ   L0198CB
         LDA   $01
L0198C3  ASL
         ROL   $03
         DEX
         BNE   L0198C3
         STA   $01
L0198CB  LDA   $01
         STA   $0A
         LDA   $03
         STA   $0C
         PLY
         PLY
         PLD
         RTL

L0198D7  ENT
         BCC   L0198EB
         TAY
         LDA   $04,S
         TAX
         BEQ   L0198F7
         TYA
         BEQ   L0198F8
         BPL   L0198F2
L0198E4  SEC
         ROR
         DEX
         BNE   L0198E4
         BRA   L0198F8
L0198EB  TAY
         LDA   $04,S
         TAX
         BEQ   L0198F7
         TYA
L0198F2  LSR
         DEX
         BNE   L0198F2
         TAY
L0198F7  TYA
L0198F8  STA   $04,S
         RTL

L0198FB  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EA
         TCS
         STZ   $F2
         LDA   $FF
         CMP   #$0008
         BCS   L019914
         LDA   #$0008
         STA   $FF
L019914  LDA   $FF
         CMP   #$FFFC
         BEQ   L019926
         BCC   L019926
         LDX   #$0000
         LDA   #$0000
         BRL   L019A9A
L019926  LDA   $FF
         CLC
         ADC   #$0003
         AND   #$FFFC
         STA   $FF
         LDA   $FF
         SEC
         SBC   #$0001
         LSR
         LSR
         STA   $F0
L01993B  LDA   $F0
         LSR
         STA   $F0
         CMP   #$0000
         BEQ   L019949
         INC   $F2
         BRA   L01993B
L019949  LDA   $F2
         SEC
         SBC   #$0008
         BEQ   L019958
         BVS   L019956
         EOR   #$8000
L019956  BMI   L019987
L019958  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDA   $F2
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         JSL   L01A847
         BNE   L0199AF
L019987  PEI   $FF
         PEI   $F2
         JSL   L019AA4
         PLY
         PLY
         STX   $EE
         STA   $EC
         LDA   $EC
         CMP   #$0000
         BNE   L0199AC
         LDA   $EE
         CMP   #$0000
         BNE   L0199AC
         LDX   #$0000
         LDA   #$0000
         BRL   L019A9A
L0199AC  BRL   L019A41
L0199AF  LDA   $F2
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STX   $EE
         STA   $EC
         LDA   $F2
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         PHX
         PHA
         LDA   $F2
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F4],Y
         PLA
         STA   [$F4]
         LDY   #$0004
         LDA   [$EC],Y
         SEP   #$20
         STA   [$EC]
         REP   #$20
         LDY   #$0005
         LDA   [$EC],Y
         SEP   #$20
         LDY   #$0001
         STA   [$EC],Y
         REP   #$20
L019A41  LDA   [$EC]
         AND   #$00FF
         CMP   #$005A
         BEQ   L019A55
         LDA   [$EC]
         AND   #$00FF
         CMP   #$0055
         BNE   L019A77
L019A55  LDY   #$0001
         LDA   [$EC],Y
         AND   #$00FF
         SEC
         SBC   #$0008
         BEQ   L019A8B
         BVS   L019A68
         EOR   #$8000
L019A68  BPL   L019A8B
         LDY   #$0001
         LDA   [$EC],Y
         AND   #$00FF
         CMP   #$00FF
         BEQ   L019A8B
L019A77  PEA   ^L02E770
         PEA   L02E770
         JSL   L01C1A3
         PLY
         PLY
         LDX   #$0000
         LDA   #$0000
         BRA   L019A9A
L019A8B  LDX   $EE
         LDA   $EC
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
L019A9A  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L019AA4  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
         LDA   $FD
         SEC
         SBC   #$0008
         BEQ   L019B06
         BVS   L019ABC
         EOR   #$8000
L019ABC  BPL   L019B06
         LDA   $FF
         CLC
         ADC   #$0002
         LDX   #$0000
         PHX
         PHA
         JSL   L01A6FE
         PLY
         PLY
         STX   $F0
         STA   $EE
         LDA   $EE
         CMP   #$0000
         BNE   L019AEA
         LDA   $F0
         CMP   #$0000
         BNE   L019AEA
         LDX   #$0000
         LDA   #$0000
         BRL   L019D2F
L019AEA  LDA   #$005A
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   #$00FF
         SEP   #$20
         LDY   #$0001
         STA   [$EE],Y
         REP   #$20
         LDX   $F0
         LDA   $EE
         BRL   L019D2F
L019B06  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDA   $FD
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L01A847
         BEQ   L019B4A
         PEA   ^L02E7A5
         PEA   L02E7A5
         JSL   L01C1A3
         PLY
         PLY
         LDX   #$0000
         LDA   #$0000
         BRL   L019D2F
L019B4A  LDA   $FD
         SEC
         SBC   #$0008
         BEQ   L019B59
         BVS   L019B57
         EOR   #$8000
L019B57  BMI   L019B5E
L019B59  LDA   #$0008
         BRA   L019B60
L019B5E  LDA   $FD
L019B60  CLC
         ADC   #$0003
         STA   $EC
         LDA   $FD
         CLC
         ADC   #$0003
         PHA
         LDA   $EC
         PLX
         STX   $F6
         SEC
         SBC   $F6
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         STA   $EA
L019B81  LDA   $EA
         ASL
         PHA
         LDA   $EC
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         PLX
         STX   $F6
         CLC
         ADC   $F6
         STA   $FF
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         JSL   L01A6FE
         PLY
         PLY
         STX   $F0
         STA   $EE
         SEC
         LDA   $EE
         SBC   #$0000
         BNE   L019BB9
         LDA   $F0
         SBC   #$0000
         BRA   L019BC0
L019BB9  LDA   $F0
         SBC   #$0000
         REP   #$02
L019BC0  BEQ   L019BC4
         BRA   L019BF0
L019BC4  LDA   $EA
         CMP   #$0001
         BNE   L019BD4
         LDX   #$0000
         LDA   #$0000
         BRL   L019D2F
L019BD4  LDA   $FD
         CLC
         ADC   #$0003
         STA   $EC
         LDA   #$0001
         STA   $EA
         LDA   $EA
         SEC
         SBC   #$0000
         BEQ   L019BF0
         BVS   L019BEE
         EOR   #$8000
L019BEE  BMI   L019B81
L019BF0  LDA   $EA
         CMP   #$0000
         BNE   L019C00
         LDX   #$0000
         LDA   #$0000
         BRL   L019D2F
L019C00  LDA   $FD
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDX   $F0
         LDA   $EE
         LDY   #$0002
         PHA
         TXA
         STA   [$F2],Y
         PLA
         STA   [$F2]
         LDA   $FD
         CLC
         ADC   #$0003
         PHA
         LDA   #$0001
         SEC
         JSL   L019895
         PLA
         CLC
         ADC   #$0002
         STA   $FF
L019C3D  DEC   $EA
         LDA   $EA
         SEC
         SBC   #$0000
         BEQ   L019C8E
         BVS   L019C4C
         EOR   #$8000
L019C4C  BPL   L019C8E
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDX   $F0
         LDA   $EE
         JSL   L0198A5
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$EE],Y
         PLA
         STA   [$EE]
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         STX   $F0
         STA   $EE
         LDA   #$0055
         SEP   #$20
         LDY   #$0004
         STA   [$EE],Y
         REP   #$20
         LDA   $FD
         SEP   #$20
         LDY   #$0005
         STA   [$EE],Y
         REP   #$20
         BRA   L019C3D
L019C8E  LDX   #$0000
         LDA   #$0000
         LDY   #$0002
         PHA
         TXA
         STA   [$EE],Y
         PLA
         STA   [$EE]
         LDA   $FD
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STX   $F0
         STA   $EE
         LDA   $FD
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         PHX
         PHA
         LDA   $FD
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F2],Y
         PLA
         STA   [$F2]
         LDA   #$005A
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $FD
         SEP   #$20
         LDY   #$0001
         STA   [$EE],Y
         REP   #$20
         LDX   $F0
         LDA   $EE
L019D2F  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L019D39  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E8
         TCS
         LDX   $FB
         LDA   $F9
         STX   $EC
         STA   $EA
L019D4C  DEC   $FF
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L019D59
         EOR   #$8000
L019D59  BPL   L019D73
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L019D65
         INC   $FB
L019D65  STA   $EE
         STX   $F0
         LDA   $FD
         SEP   #$20
         STA   [$EE]
         REP   #$20
         BRA   L019D4C
L019D73  LDX   $EC
         LDA   $EA
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L019D81  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E6
         TCS
         LDX   $F9
         LDA   $F7
         STX   $EA
         STA   $E8
L019D94  DEC   $FF
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L019DA1
         EOR   #$8000
L019DA1  BPL   L019DCB
         LDX   $FD
         LDA   $FB
         INC   $FB
         BNE   L019DAD
         INC   $FD
L019DAD  STA   $EC
         STX   $EE
         LDA   [$EC]
         PHA
         LDX   $F9
         LDA   $F7
         INC   $F7
         BNE   L019DBE
         INC   $F9
L019DBE  STA   $EC
         STX   $EE
         PLA
         SEP   #$20
         STA   [$EC]
         REP   #$20
         BRA   L019D94
L019DCB  LDX   $EA
         LDA   $E8
         TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L019DD9  ENT
         PHD
         PHA
         PEA   $0001
         TSC
         TCD
         LDA   $0A
         BEQ   L019E4E
         LDX   #$0000
         BCC   L019E04
         BIT   #$8000
         BEQ   L019DF5
         EOR   #$FFFF
         INC
         STA   $0A
         INX
L019DF5  LDA   $03
         BIT   #$8000
         BEQ   L019E04
         EOR   #$FFFF
         INC
         STA   $03
         INX
         INX
L019E04  LDY   #$0000
         BRA   L019E0B
L019E09  ASL   $01
L019E0B  ASL   $0A
         BCC   L019E09
         ROR   $0A
L019E11  LDA   $03
         CMP   $0A
         BCC   L019E22
         LDA   $03
         SEC
         SBC   $0A
         STA   $03
         TYA
         ORA   $01
         TAY
L019E22  LSR   $0A
         LSR   $01
         BCC   L019E11
         LDA   $03
         STA   $0A
         TYA
         CPX   #$0000
         BEQ   L019E4A
         CPX   #$0003
         BEQ   L019E40
         EOR   #$FFFF
         INC
         CPX   #$0001
         BEQ   L019E4A
L019E40  TAY
         LDA   $0A
         EOR   #$FFFF
         INC
         STA   $0A
         TYA
L019E4A  PLY
         PLY
         PLD
         RTL

L019E4E  PEA   $0004
         PEA   $0000
         PEA   $0000
         _SysFailMgr
L019E5E  ORA   $04,S
         STA   $04,S
         TXA
         ORA   $06,S
         STA   $06,S
         RTL

L019E68  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E8
         TCS
         LDX   $FB
         LDA   $F9
         STX   $EC
         STA   $EA
L019E7B  LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L019E85
         INC   $FB
L019E85  STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         BEQ   L019E92
         BRA   L019E7B
L019E92  LDA   $F9
         BNE   L019E98
         DEC   $FB
L019E98  DEC   $F9
L019E9A  LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L019EA4
         INC   $FF
L019EA4  STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L019EB5
         INC   $FB
L019EB5  STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         AND   #$00FF
         BEQ   L019EC7
         BRA   L019E9A
L019EC7  LDX   $EC
         LDA   $EA
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L019ED5  PHD
         TSC
         TCD
         STA   [$06]
         LDA   $01,S
         LDY   #$0002
         STA   [$06],Y
         LDA   $02,S
         INY
         INY
         STA   [$06],Y
         LDA   $04,S
         INY
         INY
         STA   [$06],Y
         PLD
         LDA   #$0000
         RTL

L019EF2  ENT
         SEC
         SBC   $04,S
         STA   $04,S
         TXA
         SBC   $06,S
         STA   $06,S
         RTL

L019EFD  ENT
         PHD
         PHA
         TSC
         TCD
         LDX   #$0000
         BCC   L019F22
         LDA   $08
         BIT   #$8000
         BEQ   L019F14
         EOR   #$FFFF
         INC
         STA   $08
         INX
L019F14  LDA   $01
         BIT   #$8000
         BEQ   L019F22
         EOR   #$FFFF
         INC
         STA   $01
         DEX
L019F22  LDA   #$0000
         BRA   L019F30
L019F27  LSR   $01
         BCC   L019F2E
         CLC
         ADC   $08
L019F2E  ASL   $08
L019F30  LDY   $01
         BNE   L019F27
         CPX   #$0000
         BEQ   L019F3D
         EOR   #$FFFF
         INC
L019F3D  STA   $08
         PLY
         PLD
         RTL

L019F42  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         LDX   $FF
         LDA   $FD
         CLC
         ADC   #$0001
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $F0
         STA   $EE
L019F60  LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L019F6A
         INC   $FF
L019F6A  STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0000
         BEQ   L019F7A
         BRA   L019F60
L019F7A  LDX   $F0
         LDA   $EE
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L019EF2
         PLA
         PLX
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L019F94  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDA   $F9
         CMP   $FD
         BNE   L019FB0
         LDA   $FB
         CMP   $FF
         BNE   L019FB0
         LDA   #$0000
         BRA   L01A010
L019FB0  LDA   [$F9]
         AND   #$00FF
         PHA
         LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L019FC0
         INC   $FF
L019FC0  STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         PLX
         STX   $EE
         CMP   $EE
         BNE   L019FEF
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L019FDA
         INC   $FB
L019FDA  STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         CMP   #$0000
         BNE   L019FED
         LDA   #$0000
         BRA   L01A010
L019FED  BRA   L019FB0
L019FEF  LDA   $FD
         BNE   L019FF5
         DEC   $FF
L019FF5  DEC   $FD
         LDX   $FF
         LDA   $FD
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         PHA
         LDA   [$F9]
         AND   #$00FF
         PLX
         STX   $F2
         SEC
         SBC   $F2
L01A010  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L01A01A  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$FFEA
         TCS
         LDA   #L01AAEF
         LDX   #^L01AAEF
         PHX
         PHA
         LDAL  L02EA92+2
         TAX
         LDAL  L02EA92
         STA   $F4
         STX   $F6
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F4],Y
         PLA
         STA   [$F4]
         LDA   L05018F
         BNE   L01A04E
         BRL   L01A1A0
L01A04E  LDX   #$0000
         TDC
         CLC
         ADC   #$FFEC
         PHA
         TXA
         STAL  L02EAFF
         PLA
         STAL  L02EAFD
         PEA   $0027
         PEA   ^L02EAFD
         PEA   L02EAFD
         JSL   L01A356
         LDAL  L02EAFF
         TAX
         LDAL  L02EAFD
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $F0
         STA   $EE
L01A084  LDA   $F0
         LDX   #$0000
         TAY
         BPL   L01A08D
         DEX
L01A08D  PHX
         PHA
         LDAL  L02EAFF
         TAX
         LDAL  L02EAFD
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         CMP   #$002F
         BEQ   L01A0BF
         LDA   $F0
         SEC
         SBC   #$0000
         BEQ   L01A0BF
         BVS   L01A0B9
         EOR   #$8000
L01A0B9  BPL   L01A0BF
         DEC   $F0
         BRA   L01A084
L01A0BF  LDA   $EE
         SEC
         SBC   $F0
         STA   $EC
         SEP   #$20
         STAL  L02EAED
         REP   #$20
         BRA   L01A122
L01A0D0  LDA   $EE
         DEC   $EE
         LDX   #$0000
         TAY
         BPL   L01A0DB
         DEX
L01A0DB  PHX
         PHA
         LDAL  L02EAFF
         TAX
         LDAL  L02EAFD
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PHA
         LDA   $EC
         LDX   #$0000
         TAY
         BPL   L01A0FC
         DEX
L01A0FC  PHX
         PHA
         LDA   #L02EAEE
         LDX   #^L02EAEE
         JSL   L0198A5
         PLA
         PLX
         SEC
         SBC   #$0001
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         DEC   $EC
L01A122  LDA   $EC
         SEC
         SBC   #$0000
         BEQ   L01A131
         BVS   L01A12F
         EOR   #$8000
L01A12F  BMI   L01A0D0
L01A131  LDA   #L02EAED
         LDX   #^L02EAED
         PHX
         PHA
         LDAL  L02EA84+2
         TAX
         LDAL  L02EA84
         STA   $F4
         STX   $F6
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F4],Y
         PLA
         STA   [$F4]
         LDA   $FF
         BNE   L01A173
         LDAL  L02EA84+2
         TAX
         LDAL  L02EA84
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         PHX
         PHA
         JSL   L01C3DE
         PLY
         PLY
L01A173  LDA   #$0001
         STA   L050006
         LDAL  L02EA84+2
         TAX
         LDAL  L02EA84
         STX   L05000A
         STA   L050008
         PEA   $007F
         PEA   $0000
         _SetInGlobals
         BRA   L01A1B8
L01A1A0  LDA   L050006
         STAL  L02EA82
         LDX   L05000A
         LDA   L050008
         PHA
         TXA
         STAL  L02EA84+2
         PLA
         STAL  L02EA84
L01A1B8  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L01A1C2  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E6
         TCS
         LDA   $F9
         SEC
         SBC   #$0000
         BVS   L01A1D8
         EOR   #$8000
L01A1D8  BMI   L01A1EC
         PEA   $0000
         PEA   $0016
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRL   L01A29A
L01A1EC  PEA   $0000
         TDC
         CLC
         ADC   #$00F9
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $EC
         STA   $EA
         LDA   $EA
         CMP   #$0000
         BNE   L01A213
         LDA   $EC
         CMP   #$0000
         BNE   L01A213
         LDA   #$FFFF
         BRL   L01A29A
L01A213  LDA   [$EA]
         AND   #$0001
         TAY
         BNE   L01A22C
         PEA   $0000
         PEA   $0009
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRA   L01A29A
L01A22C  LDA   $FF
         LDY   #$000C
         STA   [$EA],Y
         LDX   $FD
         LDA   $FB
         LDY   #$0010
         PHA
         TXA
         STA   [$EA],Y
         PLA
         LDY   #$000E
         STA   [$EA],Y
         PEI   $EC
         PEI   $EA
         LDY   #$0006
         LDA   [$EA],Y
         TAX
         LDY   #$0004
         LDA   [$EA],Y
         STA   $EE
         STX   $F0
         LDY   #$000E
         LDA   [$EE],Y
         TAX
         LDY   #$000C
         LDA   [$EE],Y
         STA   $EE
         STX   $F0
         LDA   $EE
         LDX   $F0
         JSL   L01A615
         PLY
         PLY
         STA   $E8
         LDA   $E8
         CMP   #$0000
         BEQ   L01A28C
         LDY   #$0002
         LDA   [$EA],Y
         PHA
         PEI   $E8
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRA   L01A29A
L01A28C  LDY   #$000C
         LDA   [$EA],Y
         PHA
         LDA   $FF
         PLX
         STX   $F2
         SEC
         SBC   $F2
L01A29A  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L01A2A4  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         LDAL  L02EA92+2
         TAX
         LDAL  L02EA92
         STA   $F4
         STX   $F6
         LDX   $F6
         LDA   #$0024
         CLC
         ADC   $F4
         BCC   L01A2C7
         INX
L01A2C7  STX   $F2
         STA   $F0
         BRA   L01A306
L01A2CD  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         JSL   L01A847
         BEQ   L01A2FA
         PEI   $FF
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         STA   $F4
         STX   $F6
         LDA   $F4
         LDX   $F6
         JSL   L01A615
         PLY
L01A2FA  LDA   $F0
         SEC
         SBC   #$0004
         STA   $F0
         BCS   L01A306
         DEC   $F2
L01A306  SEC
         LDA   $F0
         SBCL  L02EA92
         BNE   L01A317
         LDA   $F2
         SBCL  L02EA92+2
         BRA   L01A31F
L01A317  LDA   $F2
         SBCL  L02EA92+2
         REP   #$02
L01A31F  BEQ   L01A328
         BVS   L01A326
         EOR   #$8000
L01A326  BMI   L01A2CD
L01A328  LDA   $FF
         STA   L05000C
         LDAL  L02EA92+2
         TAX
         LDAL  L02EA92
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STA   $F4
         STX   $F6
         LDA   $F4
         LDX   $F6
         JSL   L01A615
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L01A356  PHB
         PLA
         XBA
         STAL  L01A391
         PLA
         STAL  L01A391+1
         PLA
         STAL  L01A377
         PLA
         STAL  L01A377+2
         PLA
         STAL  L01A375
         JSL   GSOS
L01A375  DW    $0000
L01A377  ADRL  $00000000

         LDAL  L01A391+1
         PHA
         PHB
         LDAL  L01A391
         STA   $01,S
         RTL

L01A391  BRK   $00
L01A393  BRK   $0B
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E6
         TCS
         LDA   $FD
         CMP   #$0000
         BNE   L01A3BC
         LDA   $FF
         CMP   #$0000
         BNE   L01A3BC
         PEA   ^L02E7D1
         PEA   L02E7D1
         JSL   L01C1A3
         PLY
         PLY
         BRL   L01A56B
L01A3BC  LDX   $FF
         LDA   $FD
         SEC
         SBC   #$0002
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         STX   $EE
         STA   $EC
         LDA   [$EC]
         AND   #$00FF
         CMP   #$005A
         BEQ   L01A3E3
         LDA   [$EC]
         AND   #$00FF
         CMP   #$0055
         BNE   L01A405
L01A3E3  LDY   #$0001
         LDA   [$EC],Y
         AND   #$00FF
         SEC
         SBC   #$0008
         BEQ   L01A414
         BVS   L01A3F6
         EOR   #$8000
L01A3F6  BPL   L01A414
         LDY   #$0001
         LDA   [$EC],Y
         AND   #$00FF
         CMP   #$00FF
         BEQ   L01A414
L01A405  PEA   ^L02E7ED
         PEA   L02E7ED
         JSL   L01C1A3
         PLY
         PLY
         BRL   L01A56B
L01A414  LDY   #$0001
         LDA   [$EC],Y
         AND   #$00FF
         STA   $F0
         LDA   $F0
         CMP   #$00FF
         BNE   L01A463
         LDA   #$0051
         SEP   #$20
         STA   [$EC]
         REP   #$20
         LDA   #$0009
         SEP   #$20
         LDY   #$0001
         STA   [$EC],Y
         REP   #$20
         PHX
         PHA
         PEI   $EE
         PEI   $EC
         _FindHandle
         _DisposeHandle
         BRL   L01A56B
L01A463  LDA   [$EC]
         SEP   #$20
         LDY   #$0004
         STA   [$EC],Y
         REP   #$20
         LDY   #$0001
         LDA   [$EC],Y
         SEP   #$20
         LDY   #$0005
         STA   [$EC],Y
         REP   #$20
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STX   $EA
         STA   $E8
         SEC
         LDA   $E8
         SBC   #$0000
         BNE   L01A4B0
         LDA   $EA
         SBC   #$0000
         BRA   L01A4B7
L01A4B0  LDA   $EA
         SBC   #$0000
         REP   #$02
L01A4B7  BEQ   L01A4D5
         SEC
         LDA   $E8
         SBC   $EC
         BNE   L01A4C6
         LDA   $EA
         SBC   $EE
         BRA   L01A4CC
L01A4C6  LDA   $EA
         SBC   $EE
         REP   #$02
L01A4CC  BEQ   L01A50C
         BVS   L01A4D3
         EOR   #$8000
L01A4D3  BPL   L01A50C
L01A4D5  LDX   $EA
         LDA   $E8
         LDY   #$0002
         PHA
         TXA
         STA   [$EC],Y
         PLA
         STA   [$EC]
         LDA   $F0
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L02E857
         LDX   #^L02E857
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDX   $EE
         LDA   $EC
         LDY   #$0002
         PHA
         TXA
         STA   [$F2],Y
         PLA
         STA   [$F2]
         BRA   L01A56B
L01A50C  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0002
         LDA   [$E8],Y
         TAX
         LDA   [$E8]
         JSL   L01A847
         BEQ   L01A54B
         LDX   $EE
         LDA   $EC
         PHX
         PHA
         LDY   #$0002
         LDA   [$E8],Y
         TAX
         LDA   [$E8]
         JSL   L01A847
         BEQ   L01A54B
         BVS   L01A53B
         EOR   #$8000
L01A53B  BPL   L01A54B
         LDY   #$0002
         LDA   [$E8],Y
         TAX
         LDA   [$E8]
         STX   $EA
         STA   $E8
         BRA   L01A50C
L01A54B  LDY   #$0002
         LDA   [$E8],Y
         TAX
         LDA   [$E8]
         LDY   #$0002
         PHA
         TXA
         STA   [$EC],Y
         PLA
         STA   [$EC]
         LDX   $EE
         LDA   $EC
         LDY   #$0002
         PHA
         TXA
         STA   [$E8],Y
         PLA
         STA   [$E8]
L01A56B  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01A575  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E8
         TCS
         LDX   $FB
         LDA   $F9
         STX   $EC
         STA   $EA
L01A588  LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L01A592
         INC   $FF
L01A592  STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L01A5A3
         INC   $FB
L01A5A3  STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         AND   #$00FF
         BEQ   L01A5B5
         BRA   L01A588
L01A5B5  LDX   $EC
         LDA   $EA
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L01A5C3  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDX   #$0000
         LDA   #$0010
         PHX
         PHA
         LDX   L05018A
         LDA   L050188
         PEA   $41C6
         PEA   $4E6D
         CLC
         JSL   L01CA3F
         PLA
         PLX
         CLC
         ADC   #$3039
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   L05018A
         STA   L050188
         SEC
         JSL   L01C4A0
         PLA
         PLX
         AND   #$7FFF
         PHA
         TXA
         AND   #$0000
         TAX
         PLA
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L01A615  ENT
         SEP   #$10
         PHX
         REP   #$10
         DEC
         PHA
         RTL

L01A61D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E2
         TCS
         LDA   #$FFFF
         STA   $E6
         PEA   $0000
         TDC
         CLC
         ADC   #$00E6
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $EA
         STA   $E8
         LDA   $E8
         CMP   #$0000
         BNE   L01A654
         LDA   $EA
         CMP   #$0000
         BNE   L01A654
         LDA   #$FFFF
         BRL   L01A6D6
L01A654  LDA   $FF
         CLC
         ADC   #$0001
         STA   [$E8]
         LDA   #$0000
         LDY   #$0002
         STA   [$E8],Y
         LDX   #$0000
         LDA   #$0000
         LDY   #$0006
         PHA
         TXA
         STA   [$E8],Y
         PLA
         LDY   #$0004
         STA   [$E8],Y
         PEI   $EA
         PEI   $E8
         PEA   $6400
         PEI   $FD
         PEI   $FB
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L01C1C8
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         STA   $E4
         LDA   $E4
         CMP   #$0000
         BEQ   L01A6AA
         LDA   #$0000
         STA   [$E8]
         LDA   #$FFFF
         BRA   L01A6D6
L01A6AA  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0006
         LDA   [$E8],Y
         TAX
         LDY   #$0004
         LDA   [$E8],Y
         JSL   L01A847
         BNE   L01A6D4
         LDX   $EE
         LDA   $EC
         LDY   #$0006
         PHA
         TXA
         STA   [$E8],Y
         PLA
         LDY   #$0004
         STA   [$E8],Y
L01A6D4  LDA   $E6
L01A6D6  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L01A6E0  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         AND   #$FFFF
         PHA
         JSL   L01A2A4
         PLY
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L01A6FE  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         PHX
         PHA
         PEI   $FF
         PEI   $FD
         LDA   appID
         ORA   #$0F00
         PHA
         PEA   $8300
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         STX   $F0
         STA   $EE
         STX   $F2
         ORA   $F2
         BEQ   L01A745
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         BRA   L01A74B
L01A745  LDX   #$0000
         LDA   #$0000
L01A74B  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01A755  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         BRL   L01A826
L01A763  LDA   [$F7]
         AND   #$00FF
         PHA
         LDA   [$FB]
         AND   #$00FF
         PLX
         STX   $EC
         CMP   $EC
         BNE   L01A77B
         LDA   #$0001
         BRL   L01A800
L01A77B  LDA   $FF
         BEQ   L01A784
         LDA   #$0000
         BRA   L01A800
L01A784  LDA   [$F7]
         AND   #$00FF
         SEC
         SBC   #$0061
         BVS   L01A792
         EOR   #$8000
L01A792  BPL   L01A7A6
         LDA   [$F7]
         AND   #$00FF
         SEC
         SBC   #$007A
         BEQ   L01A7AD
         BVS   L01A7A4
         EOR   #$8000
L01A7A4  BPL   L01A7AD
L01A7A6  LDA   [$F7]
         AND   #$00FF
         BRA   L01A7BA
L01A7AD  LDA   [$F7]
         AND   #$00FF
         CLC
         ADC   #$0041
         SEC
         SBC   #$0061
L01A7BA  PHA
         LDA   [$FB]
         AND   #$00FF
         SEC
         SBC   #$0061
         BVS   L01A7C9
         EOR   #$8000
L01A7C9  BPL   L01A7DD
         LDA   [$FB]
         AND   #$00FF
         SEC
         SBC   #$007A
         BEQ   L01A7E4
         BVS   L01A7DB
         EOR   #$8000
L01A7DB  BPL   L01A7E4
L01A7DD  LDA   [$FB]
         AND   #$00FF
         BRA   L01A7F1
L01A7E4  LDA   [$FB]
         AND   #$00FF
         CLC
         ADC   #$0041
         SEC
         SBC   #$0061
L01A7F1  PLX
         STX   $EC
         CMP   $EC
         BEQ   L01A7FD
         LDA   #$0000
         BRA   L01A800
L01A7FD  LDA   #$0001
L01A800  TAY
         BNE   L01A808
         LDA   #$0000
         BRA   L01A83D
L01A808  LDX   $F9
         LDA   $F7
         INC   $F7
         BNE   L01A812
         INC   $F9
L01A812  STA   $EC
         STX   $EE
         LDX   $FD
         LDA   $FB
         INC   $FB
         BNE   L01A820
         INC   $FD
L01A820  STA   $EC
         STX   $EE
         LDA   [$EC]
L01A826  LDA   [$F7]
         AND   #$00FF
         BEQ   L01A830
         BRL   L01A763
L01A830  LDA   [$FB]
         AND   #$00FF
         BEQ   L01A83A
         BRL   L01A763
L01A83A  LDA   #$0001
L01A83D  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L01A847  ENT
         PHX
         PHA
         LDA   $08,S
         TAX
         LDA   $0A,S
         TAY
         LDA   $06,S
         STA   $0A,S
         LDA   $04,S
         STA   $08,S
         TXA
         SEC
         SBC   $01,S
         BNE   L01A862
         TYA
         SBC   $03,S
         BRA   L01A867
L01A862  TYA
         SBC   $03,S
         REP   #$02
L01A867  PHP
         LDA   $00,S
         STA   $08,S
         PLY
         PLY
         PLY
         PLY
         PLP
         RTL

L01A872  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E6
         TCS
         LDX   $FB
         LDA   $F9
         STX   $EA
         STA   $E8
L01A885  LDA   $F7
         CMP   #$0001
         BEQ   L01A8B0
         BCC   L01A8B0
         LDA   [$FD]
         STA   [$F9]
         LDA   $F9
         CLC
         ADC   #$0002
         STA   $F9
         BCC   L01A89E
         INC   $FB
L01A89E  LDA   $FD
         CLC
         ADC   #$0002
         STA   $FD
         BCC   L01A8AA
         INC   $FF
L01A8AA  DEC   $F7
         DEC   $F7
         BRA   L01A885
L01A8B0  LDA   $F7
         BEQ   L01A8BC
         SEP   #$20
         LDA   [$FD]
         STA   [$F9]
         REP   #$20
L01A8BC  LDX   $EA
         LDA   $E8
         STX   $FF
         STA   $FD
         TDC
         CLC
         ADC   #$00F1
         TCS
         PLD
         RTL

L01A8CC  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E6
         TCS
         LDAL  L02EA96
         CMP   #$0000
         BNE   L01A8E4
         JSL   L01BE65
L01A8E4  LDA   #$0012
         PHA
         LDAL  L02EA96
         SEC
         JSL   L019DD9
         PLY
         SEC
         SBC   #$0001
         STA   $F0
         LDA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01A903
         EOR   #$8000
L01A903  BPL   L01A909
         LDA   [$FD]
         BRA   L01A915
L01A909  LDA   [$FD]
         PHA
         LDA   #$FFFF
         PLX
         STX   $F6
         SEC
         SBC   $F6
L01A915  SEC
         SBC   $F0
         BEQ   L01A936
         BVS   L01A91F
         EOR   #$8000
L01A91F  BPL   L01A936
         PEA   $0000
         PEA   $0016
         JSL   L01BE3B
         PLY
         PLY
         LDX   #$0000
         LDA   #$0000
         BRL   L01AAE5
L01A936  LDA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01A941
         EOR   #$8000
L01A941  BPL   L01A984
         LDA   [$FD]
         LDX   #$0000
         TAY
         BPL   L01A94C
         DEX
L01A94C  PEA   $0000
         PEA   $0012
         CLC
         JSL   L01CA3F
         LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         JSL   L0198A5
         PLA
         PLX
         STX   $EE
         STA   $EC
         LDA   [$EC]
         CMP   #$0000
         BNE   L01A981
         PEA   $0000
         PEA   $0009
         JSL   L01BE3B
         PLY
         PLY
         STZ   $EC
         STZ   $EE
L01A981  BRL   L01AAE1
L01A984  LDA   [$FD]
         PHA
         LDA   #$FFFF
         PLX
         STX   $F6
         SEC
         SBC   $F6
         LDX   #$0000
         TAY
         BPL   L01A997
         DEX
L01A997  PEA   $0000
         PEA   $0012
         CLC
         JSL   L01CA3F
         LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         JSL   L0198A5
         PLA
         PLX
         STX   $EE
         STA   $EC
         BRA   L01A9CC
L01A9B7  LDA   [$EC]
         CMP   #$0000
         BNE   L01A9C0
         BRA   L01A9FC
L01A9C0  LDA   $EC
         CLC
         ADC   #$0012
         STA   $EC
         BCC   L01A9CC
         INC   $EE
L01A9CC  LDA   $F0
         LDX   #$0000
         TAY
         BPL   L01A9D5
         DEX
L01A9D5  PEA   $0000
         PEA   $0012
         CLC
         JSL   L01CA3F
         LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         JSL   L0198A5
         LDX   $EE
         LDA   $EC
         JSL   L01A847
         BVS   L01A9FA
         EOR   #$8000
L01A9FA  BMI   L01A9B7
L01A9FC  LDA   $F0
         LDX   #$0000
         TAY
         BPL   L01AA05
         DEX
L01AA05  PEA   $0000
         PEA   $0012
         CLC
         JSL   L01CA3F
         LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         JSL   L0198A5
         LDX   $EE
         LDA   $EC
         JSL   L01A847
         BVS   L01AA2A
         EOR   #$8000
L01AA2A  BPL   L01AA2F
         BRL   L01AABB
L01AA2F  LDAL  L02EA96
         CLC
         ADC   #$00B4
         LDX   #$0000
         TAY
         BPL   L01AA3E
         DEX
L01AA3E  PHX
         PHA
         LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         PHX
         PHA
         JSL   L01CB36
         PLY
         PLY
         PLY
         PLY
         STX   $EA
         STA   $E8
         LDA   $E8
         CMP   #$0000
         BNE   L01AA7A
         LDA   $EA
         CMP   #$0000
         BNE   L01AA7A
         PEA   $0000
         PEA   $0018
         JSL   L01BE3B
         PLY
         PLY
         LDX   #$0000
         LDA   #$0000
         BRL   L01AAE5
L01AA7A  LDA   $F0
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L01AA87
         DEX
L01AA87  PEA   $0000
         PEA   $0012
         CLC
         JSL   L01CA3F
         LDX   $EA
         LDA   $E8
         JSL   L0198A5
         PLA
         PLX
         STX   $EE
         STA   $EC
         LDAL  L02EA96
         CLC
         ADC   #$00B4
         STAL  L02EA96
         LDX   $EA
         LDA   $E8
         PHA
         TXA
         STAL  L02EA9A
         PLA
         STAL  L02EA98
L01AABB  LDX   #$0000
         LDA   #$0012
         PHX
         PHA
         LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         PHX
         PHA
         LDX   $EE
         LDA   $EC
         JSL   L019EF2
         PLA
         PLX
         SEC
         JSL   L01C67E
         PLY
         PLY
         STA   [$FD]
L01AAE1  LDX   $EE
         LDA   $EC
L01AAE5  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01AAEF  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEA   $0001
         PEA   ^L020020
         PEA   L020020
         JSL   L01BE08
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F9
         TCS
         PLD
         RTL

L01AB12  LDA   $04,S
         STAL  L01AB26
         LDA   $06,S
         STAL  L01AB26+2
         LDA   $08,S
         JSL   GSOS
         DW    $0029
L01AB26  ADRL  $00000000
         RTL

L01AB2B  PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$004A
         TCS
         STZ   $E8
L01AB38  LDX   $F7
         LDA   $F5
         STX   $E6
         STA   $E4
         BRA   L01AB48
L01AB42  INC   $F5
         BNE   L01AB48
         INC   $F7
L01AB48  LDA   [$F5]
         AND   #$00FF
         STA   $DA
         CMP   #$0000
         BEQ   L01AB5B
         LDA   $DA
         CMP   #$0025
         BNE   L01AB42
L01AB5B  LDX   $E6
         LDA   $E4
         PHX
         PHA
         LDX   $F7
         LDA   $F5
         JSL   L019EF2
         PLA
         PLX
         STA   $50
         TAY
         BNE   L01AB73
         BRL   L01AC3B
L01AB73  LDA   $E8
         CLC
         ADC   $50
         STA   $E8
         LDA   $50
         CMP   #$0001
         BNE   L01ABDC
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01AB8F
         EOR   #$8000
L01AB8F  BPL   L01ABC9
         LDA   [$E4]
         PHA
         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   L01ABB2
         INC
L01ABB2  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         AND   #$00FF
         BRA   L01ABDA
L01ABC9  PEI   $FF
         PEI   $FD
         LDA   [$E4]
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01ABDA  BRA   L01AC3B
L01ABDC  LDY   #$0012
         LDA   [$FD],Y
         CMP   #$0014
         BNE   L01AC22
         LDA   $50
         LDX   #$0000
         TAY
         BPL   L01ABEF
         DEX
L01ABEF  PHX
         PHA
         PEI   $50
         PEI   $E6
         PEI   $E4
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHX
         PHA
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         JSL   L0198A5
         PLA
         PLX
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         BRA   L01AC3B
L01AC22  PEI   $FF
         PEI   $FD
         PEI   $50
         PEA   $0001
         PEI   $E6
         PEI   $E4
         JSL   L01C76F
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
L01AC3B  LDA   $DA
         CMP   #$0000
         BNE   L01AC57
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0020
         TAY
         BEQ   L01AC52
         LDA   #$FFFF
         BRA   L01AC54
L01AC52  LDA   $E8
L01AC54  BRL   L01BDFE
L01AC57  LDA   #$0000
         STA   $CA
         STA   $CC
         STA   $CE
         STA   $D0
         STA   $D2
L01AC64  INC   $F5
         BNE   L01AC6A
         INC   $F7
L01AC6A  LDX   $F7
         LDA   $F5
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         STA   $DA
         BRL   L01AC91
L01AC7C  INC   $D2
         BRL   L01ACA7
L01AC81  INC   $D0
         BRL   L01ACA7
L01AC86  INC   $CE
         BRL   L01ACA7
L01AC8B  INC   $CC
         BRA   L01ACA7
         BRA   L01ACA5
L01AC91  CMP   #$0020
         BEQ   L01AC86
         CMP   #$0023
         BEQ   L01AC8B
         CMP   #$002B
         BEQ   L01AC7C
         CMP   #$002D
         BEQ   L01AC81
L01ACA5  BRA   L01ACA9
L01ACA7  BRA   L01AC64
L01ACA9  LDA   $DA
         CMP   #$002A
         BNE   L01ACF5
         LDX   $FB
         LDA   $F9
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFFE
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDA   [$EA]
         STA   $DE
         LDA   $DE
         SEC
         SBC   #$0000
         BVS   L01ACE1
         EOR   #$8000
L01ACE1  BMI   L01ACED
         LDA   $DE
         EOR   #$FFFF
         INC
         STA   $DE
         INC   $D0
L01ACED  INC   $F5
         BNE   L01ACF3
         INC   $F7
L01ACF3  BRA   L01AD4E
L01ACF5  LDA   $DA
         CMP   #$0030
         BNE   L01ACFE
         INC   $CA
L01ACFE  STZ   $DE
         BRA   L01AD23
L01AD02  LDA   $DA
         SEC
         SBC   #$0030
         PHA
         LDA   $DE
         PHA
         LDA   #$000A
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $EE
         CLC
         ADC   $EE
         STA   $DE
         INC   $F5
         BNE   L01AD23
         INC   $F7
L01AD23  LDA   [$F5]
         AND   #$00FF
         STA   $DA
         LDX   #$0000
         TAY
         BPL   L01AD31
         DEX
L01AD31  PHX
         PHA
         LDA   #L02EB44
         LDX   #^L02EB44
         JSL   L0198A5
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         AND   #$0004
         TAY
         BNE   L01AD02
L01AD4E  LDA   [$F5]
         AND   #$00FF
         CMP   #$002E
         BEQ   L01AD60
         LDA   #$FFFF
         STA   $DC
         BRL   L01ADF6
L01AD60  INC   $F5
         BNE   L01AD66
         INC   $F7
L01AD66  LDX   $F7
         LDA   $F5
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         CMP   #$002A
         BNE   L01ADA6
         LDX   $FB
         LDA   $F9
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFFE
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDA   [$EA]
         STA   $DC
         INC   $F5
         BNE   L01ADA4
         INC   $F7
L01ADA4  BRA   L01ADF6
L01ADA6  STZ   $DC
         BRA   L01ADCB
L01ADAA  LDA   $DA
         SEC
         SBC   #$0030
         PHA
         LDA   $DC
         PHA
         LDA   #$000A
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $EE
         CLC
         ADC   $EE
         STA   $DC
         INC   $F5
         BNE   L01ADCB
         INC   $F7
L01ADCB  LDA   [$F5]
         AND   #$00FF
         STA   $DA
         LDX   #$0000
         TAY
         BPL   L01ADD9
         DEX
L01ADD9  PHX
         PHA
         LDA   #L02EB44
         LDX   #^L02EB44
         JSL   L0198A5
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         AND   #$0004
         TAY
         BNE   L01ADAA
L01ADF6  STZ   $D4
         LDA   [$F5]
         AND   #$00FF
         BRL   L01AE17
L01AE00  INC   $D4
L01AE02  INC   $F5
         BNE   L01AE08
         INC   $F7
L01AE08  BRL   L01AE28
L01AE0B  DA    L01AE02
         DA    L01AE08
         DA    L01AE08
         DA    L01AE08
         DA    L01AE00
         DA    L01AE08
L01AE17  SEC
         SBC   #$0068
         CMP   #$0005
         BCC   L01AE23
         LDA   #$0005
L01AE23  ASL
         TAX
         JMP   (L01AE0B,X)

L01AE28  LDA   #L02E8F3
         LDX   #^L02E8F3
         STX   $77
         STA   $75
         LDA   #$0000
         SEP   #$20
         STA   $70
         REP   #$20
         LDX   #$0000
         TDC
         CLC
         ADC   #$0070
         STX   $73
         STA   $71
         LDA   #$0000
         STA   $D6
         STA   $D8
         LDX   $F7
         LDA   $F5
         INC   $F5
         BNE   L01AE58
         INC   $F7
L01AE58  STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         STA   $DA
         BRL   L01B9BF
L01AE66  LDA   #$0005
         STA   $4E
         BRL   L01AE7B
L01AE6E  LDA   #$0004
         STA   $4E
         BRL   L01AE7B
L01AE76  LDA   #$0008
         STA   $4E
L01AE7B  LDA   $DC
         SEC
         SBC   #$0000
         BVS   L01AE86
         EOR   #$8000
L01AE86  BMI   L01AEA6
         LDA   $CA
         BEQ   L01AEA1
         LDA   $DE
         SEC
         SBC   #$0000
         BEQ   L01AEA1
         BVS   L01AE99
         EOR   #$8000
L01AE99  BPL   L01AEA1
         LDA   $DE
         STA   $DC
         BRA   L01AEA6
L01AEA1  LDA   #$0001
         STA   $DC
L01AEA6  LDA   $D4
         BEQ   L01AEDA
         LDX   $FB
         LDA   $F9
         CLC
         ADC   #$0004
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFFC
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         STX   $68
         STA   $66
         BRA   L01AF3D
L01AEDA  LDA   $DA
         CMP   #$0064
         BNE   L01AF12
         LDX   $FB
         LDA   $F9
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFFE
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDA   [$EA]
         LDX   #$0000
         TAY
         BPL   L01AF0C
         DEX
L01AF0C  STX   $68
         STA   $66
         BRA   L01AF3D
L01AF12  LDX   $FB
         LDA   $F9
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFFE
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDA   [$EA]
         LDX   #$0000
         STX   $68
         STA   $66
L01AF3D  LDA   $DA
         CMP   #$0064
         BEQ   L01AF47
         BRL   L01AFB2
L01AF47  SEC
         LDA   $66
         SBC   #$0000
         BNE   L01AF56
         LDA   $68
         SBC   #$0000
         BRA   L01AF5D
L01AF56  LDA   $68
         SBC   #$0000
         REP   #$02
L01AF5D  BVS   L01AF62
         EOR   #$8000
L01AF62  BMI   L01AF94
         LDA   #L02E8F4
         LDX   #^L02E8F4
         STX   $77
         STA   $75
         SEC
         LDA   $66
         SBC   #$0000
         BNE   L01AF7D
         LDA   $68
         SBC   #$8000
         BRA   L01AF84
L01AF7D  LDA   $68
         SBC   #$8000
         REP   #$02
L01AF84  BEQ   L01AF92
         LDX   $68
         LDA   $66
         JSL   L01C4E9
         STX   $68
         STA   $66
L01AF92  BRA   L01AFB2
L01AF94  LDA   $D2
         BEQ   L01AFA4
         LDA   #L02E8F6
         LDX   #^L02E8F6
         STX   $77
         STA   $75
         BRA   L01AFB2
L01AFA4  LDA   $CE
         BEQ   L01AFB2
         LDA   #L02E8F8
         LDX   #^L02E8F8
         STX   $77
         STA   $75
L01AFB2  LDA   $DA
         CMP   #$0058
         BNE   L01AFC1
         LDA   #L02E8FA
         LDX   #^L02E8FA
         BRA   L01AFC7
L01AFC1  LDA   #L02E90B
         LDX   #^L02E90B
L01AFC7  STX   $56
         STA   $54
         LDX   #$0000
         TDC
         CLC
         ADC   #$0084
         STX   $E6
         STA   $E4
         STX   $E2
         STA   $E0
L01AFDB  SEC
         LDA   $66
         SBC   #$0000
         BNE   L01AFEA
         LDA   $68
         SBC   #$0000
         BRA   L01AFF1
L01AFEA  LDA   $68
         SBC   #$0000
         REP   #$02
L01AFF1  BNE   L01AFF6
         BRL   L01B098
L01AFF6  LDX   $68
         LDA   $66
         AND   #$0001
         PHA
         TXA
         AND   #$0000
         TAX
         PLA
         STA   $4C
         LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDX   $68
         LDA   $66
         SEC
         JSL   L01C4A0
         PLA
         PLX
         AND   #$FFFF
         PHA
         TXA
         AND   #$7FFF
         TAX
         PLA
         STX   $68
         STA   $66
         LDA   $4C
         LDX   #$0000
         TAY
         BPL   L01B030
         DEX
L01B030  PHX
         PHA
         LDA   $4E
         LDX   #$0000
         TAY
         BPL   L01B03B
         DEX
L01B03B  PHX
         PHA
         LDX   $68
         LDA   $66
         SEC
         JSL   L01C67E
         PLA
         PLX
         STX   $EE
         ASL
         ROL   $EE
         LDX   $EE
         JSL   L0198A5
         LDX   $56
         LDA   $54
         JSL   L0198A5
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   [$EA]
         PHA
         LDA   $E4
         BNE   L01B06A
         DEC   $E6
L01B06A  DEC   $E4
         LDX   $E6
         LDA   $E4
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         LDA   $4E
         LDX   #$0000
         TAY
         BPL   L01B084
         DEX
L01B084  PHX
         PHA
         LDX   $68
         LDA   $66
         SEC
         JSL   L01C67E
         PLY
         PLY
         STX   $68
         STA   $66
         BRL   L01AFDB
L01B098  LDX   $E2
         LDA   $E0
         PHX
         PHA
         LDX   $E6
         LDA   $E4
         JSL   L019EF2
         PLA
         PLX
         CLC
         ADC   $DC
         STA   $D8
         LDA   $CC
         BNE   L01B0B4
         BRL   L01B110
L01B0B4  SEC
         LDA   $E4
         SBC   $E0
         BNE   L01B0C1
         LDA   $E6
         SBC   $E2
         BRA   L01B0C7
L01B0C1  LDA   $E6
         SBC   $E2
         REP   #$02
L01B0C7  BNE   L01B0CC
         BRL   L01B110
L01B0CC  LDA   $DA
         BRL   L01B101
L01B0D1  LDA   $D8
         SEC
         SBC   #$0001
         BVS   L01B0DC
         EOR   #$8000
L01B0DC  BMI   L01B0E3
         LDA   #$0001
         STA   $D8
L01B0E3  BRL   L01B110
L01B0E6  LDA   #L02E91C
         LDX   #^L02E91C
         STX   $77
         STA   $75
         BRL   L01B110
L01B0F3  LDA   #L02E91F
         LDX   #^L02E91F
         STX   $77
         STA   $75
         BRA   L01B110
         BRA   L01B110
L01B101  CMP   #$0058
         BEQ   L01B0F3
         CMP   #$006F
         BEQ   L01B0D1
         CMP   #$0078
         BEQ   L01B0E6
L01B110  BRL   L01B9D2
L01B113  LDA   $DC
         SEC
         SBC   #$0000
         BVS   L01B11E
         EOR   #$8000
L01B11E  BMI   L01B125
         LDA   #$0006
         STA   $DC
L01B125  LDX   $FB
         LDA   $F9
         CLC
         ADC   #$000A
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFF6
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDY   #$0008
         LDA   [$EA],Y
         PHA
         LDY   #$0006
         LDA   [$EA],Y
         PHA
         LDY   #$0004
         LDA   [$EA],Y
         PHA
         LDY   #$0002
         LDA   [$EA],Y
         PHA
         LDA   [$EA]
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$005C
         PHA
         JSL   L01C17F
         PLY
         PLY
         PLY
         PLY
         PLY
L01B174  PEA   $0000
         TDC
         CLC
         ADC   #$0058
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$005A
         PHA
         LDA   $DC
         CLC
         ADC   #$0001
         SEC
         SBC   #$0013
         BVS   L01B195
         EOR   #$8000
L01B195  BMI   L01B19F
         LDA   $DC
         CLC
         ADC   #$0001
         BRA   L01B1A2
L01B19F  LDA   #$0013
L01B1A2  PHA
         PEI   $64
         PEI   $62
         PEI   $60
         PEI   $5E
         PEI   $5C
         JSL   L01CAC6
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         STX   $E6
         STA   $E4
L01B1BD  LDA   $58
         BEQ   L01B1CD
         LDA   #L02E922
         LDX   #^L02E922
         STX   $77
         STA   $75
         BRA   L01B1EB
L01B1CD  LDA   $D2
         BEQ   L01B1DD
         LDA   #L02E924
         LDX   #^L02E924
         STX   $77
         STA   $75
         BRA   L01B1EB
L01B1DD  LDA   $CE
         BEQ   L01B1EB
         LDA   #L02E926
         LDX   #^L02E926
         STX   $77
         STA   $75
L01B1EB  LDX   #$0000
         TDC
         CLC
         ADC   #$0079
         STX   $E2
         STA   $E0
         LDA   [$E4]
         AND   #$00FF
         CMP   #$0049
         BEQ   L01B20B
         LDA   [$E4]
         AND   #$00FF
         CMP   #$004E
         BNE   L01B20E
L01B20B  BRL   L01B3B1
L01B20E  LDA   [$E4]
         AND   #$00FF
         CMP   #$0000
         BEQ   L01B22D
         LDX   $E6
         LDA   $E4
         INC   $E4
         BNE   L01B222
         INC   $E6
L01B222  STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         BRA   L01B230
L01B22D  LDA   #$0030
L01B230  PHA
         LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L01B23B
         INC   $E2
L01B23B  STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         LDA   $DC
         CMP   #$0000
         BNE   L01B251
         LDA   $CC
         BEQ   L01B268
L01B251  LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L01B25B
         INC   $E2
L01B25B  STA   $EA
         STX   $EC
         LDA   #$002E
         SEP   #$20
         STA   [$EA]
         REP   #$20
L01B268  LDA   $DC
         STA   $D6
         BRA   L01B296
L01B26E  LDX   $E6
         LDA   $E4
         INC   $E4
         BNE   L01B278
         INC   $E6
L01B278  STA   $EA
         STX   $EC
         LDA   [$EA]
         PHA
         LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L01B289
         INC   $E2
L01B289  STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         DEC   $D6
L01B296  LDA   $D6
         SEC
         SBC   #$0000
         BEQ   L01B2AF
         BVS   L01B2A3
         EOR   #$8000
L01B2A3  BPL   L01B2AF
         LDA   [$E4]
         AND   #$00FF
         CMP   #$0000
         BNE   L01B26E
L01B2AF  LDX   #$0000
         TDC
         CLC
         ADC   #$0079
         STX   $E6
         STA   $E4
         LDA   $5A
         SEC
         SBC   #$0001
         STA   $50
         LDA   $50
         SEC
         SBC   #$0000
         BVS   L01B2CE
         EOR   #$8000
L01B2CE  BMI   L01B2D8
         LDA   $50
         EOR   #$FFFF
         INC
         STA   $50
L01B2D8  LDA   #$000A
         PHA
         LDA   $50
         SEC
         JSL   L019DD9
         PLA
         CLC
         ADC   #$0030
         PHA
         LDA   $71
         BNE   L01B2EF
         DEC   $73
L01B2EF  DEC   $71
         LDX   $73
         LDA   $71
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         LDA   #$000A
         PHA
         LDA   $50
         SEC
         JSL   L019DD9
         PLY
         STA   $50
         LDA   $50
         CMP   #$0000
         BNE   L01B2D8
         LDX   #$0000
         TDC
         CLC
         ADC   #$0070
         SEC
         SBC   #$0002
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         PHX
         PHA
         LDX   $73
         LDA   $71
         JSL   L01A847
         BVS   L01B337
         EOR   #$8000
L01B337  BPL   L01B2D8
         LDA   $5A
         SEC
         SBC   #$0000
         BEQ   L01B34D
         BVS   L01B346
         EOR   #$8000
L01B346  BPL   L01B34D
         LDA   #$002B
         BRA   L01B350
L01B34D  LDA   #$002D
L01B350  PHA
         LDA   $71
         BNE   L01B357
         DEC   $73
L01B357  DEC   $71
         LDX   $73
         LDA   $71
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         LDA   $DA
         LDX   #$0000
         TAY
         BPL   L01B371
         DEX
L01B371  PHX
         PHA
         LDA   #L02EB44
         LDX   #^L02EB44
         JSL   L0198A5
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         AND   #$0001
         TAY
         BEQ   L01B393
         LDA   #$0045
         BRA   L01B396
L01B393  LDA   #$0065
L01B396  PHA
         LDA   $71
         BNE   L01B39D
         DEC   $73
L01B39D  DEC   $71
         LDX   $73
         LDA   $71
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         BRL   L01B9D2
L01B3B1  LDA   [$E4]
         AND   #$00FF
         CMP   #$0049
         BNE   L01B3D0
         PEA   ^L02E928
         PEA   L02E928
         PEI   $E2
         PEI   $E0
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         BRL   L01B466
L01B3D0  PEA   ^L02E92C
         PEA   L02E92C
         PEI   $E2
         PEI   $E0
         JSL   L01A575
         PLY
         PLY
         PLY
         PLY
         LDY   #$0004
         LDA   [$E4],Y
         AND   #$00FF
         PHA
         JSL   L01C60D
         PLY
         PHA
         LDY   #$0003
         LDA   [$E4],Y
         AND   #$00FF
         PHA
         JSL   L01C60D
         PLY
         PHA
         LDA   #$0010
         SEC
         JSL   L019EFD
         PLA
         PLX
         STX   $EE
         CLC
         ADC   $EE
         STA   $50
         LDA   #$0006
         STA   $52
         BRA   L01B459
L01B418  LDA   #$000A
         PHA
         LDA   $50
         SEC
         JSL   L019DD9
         PLA
         CLC
         ADC   #$0030
         PHA
         LDA   $52
         DEC   $52
         LDX   #$0000
         TAY
         BPL   L01B434
         DEX
L01B434  PHX
         PHA
         LDX   $E2
         LDA   $E0
         JSL   L0198A5
         PLA
         PLX
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         LDA   #$000A
         PHA
         LDA   $50
         SEC
         JSL   L019DD9
         PLY
         STA   $50
L01B459  LDA   $52
         SEC
         SBC   #$0004
         BVS   L01B464
         EOR   #$8000
L01B464  BMI   L01B418
L01B466  LDX   $E2
         LDA   $E0
         STX   $E6
         STA   $E4
         PEI   $E6
         PEI   $E4
         JSL   L019F42
         PLY
         PLY
         LDX   #$0000
         TAY
         BPL   L01B47F
         DEX
L01B47F  PHX
         PHA
         LDX   $E6
         LDA   $E4
         JSL   L0198A5
         PLA
         PLX
         STX   $E2
         STA   $E0
         BRL   L01B9D2
L01B492  LDA   $DC
         SEC
         SBC   #$0000
         BVS   L01B49D
         EOR   #$8000
L01B49D  BMI   L01B4A4
         LDA   #$0006
         STA   $DC
L01B4A4  LDX   $FB
         LDA   $F9
         CLC
         ADC   #$000A
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFF6
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDY   #$0008
         LDA   [$EA],Y
         PHA
         LDY   #$0006
         LDA   [$EA],Y
         PHA
         LDY   #$0004
         LDA   [$EA],Y
         PHA
         LDY   #$0002
         LDA   [$EA],Y
         PHA
         LDA   [$EA]
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$005C
         PHA
         JSL   L01C17F
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$0058
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$005A
         PHA
         PEI   $DC
         PEI   $64
         PEI   $62
         PEI   $60
         PEI   $5E
         PEI   $5C
         JSL   L01CAFE
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         STX   $E6
         STA   $E4
L01B521  LDA   $58
         BEQ   L01B531
         LDA   #L02E935
         LDX   #^L02E935
         STX   $77
         STA   $75
         BRA   L01B54F
L01B531  LDA   $D2
         BEQ   L01B541
         LDA   #L02E937
         LDX   #^L02E937
         STX   $77
         STA   $75
         BRA   L01B54F
L01B541  LDA   $CE
         BEQ   L01B54F
         LDA   #L02E939
         LDX   #^L02E939
         STX   $77
         STA   $75
L01B54F  LDX   #$0000
         TDC
         CLC
         ADC   #$0079
         STX   $E2
         STA   $E0
         LDA   [$E4]
         AND   #$00FF
         CMP   #$0049
         BEQ   L01B56F
         LDA   [$E4]
         AND   #$00FF
         CMP   #$004E
         BNE   L01B572
L01B56F  BRL   L01B3B1
L01B572  LDA   $DC
         SEC
         SBC   #$0000
         BEQ   L01B581
         BVS   L01B57F
         EOR   #$8000
L01B57F  BMI   L01B585
L01B581  LDA   $CC
         BEQ   L01B58D
L01B585  LDA   #$0001
         CLC
         ADC   $DC
         BRA   L01B590
L01B58D  LDA   #$0000
L01B590  PHA
         LDA   [$75]
         AND   #$00FF
         CMP   #$0000
         BNE   L01B5A0
         LDA   #$0000
         BRA   L01B5A3
L01B5A0  LDA   #$0001
L01B5A3  CLC
         ADC   $5A
         PLX
         STX   $EE
         CLC
         ADC   $EE
         SEC
         SBC   #$0050
         BEQ   L01B5C1
         BVS   L01B5B7
         EOR   #$8000
L01B5B7  BPL   L01B5C1
         LDA   #$0012
         STA   $DC
         BRL   L01B174
L01B5C1  LDA   $5A
         STA   $50
L01B5C5  LDA   $50
         SEC
         SBC   #$0000
         BEQ   L01B5DE
         BVS   L01B5D2
         EOR   #$8000
L01B5D2  BPL   L01B5DE
         LDA   [$E4]
         AND   #$00FF
         CMP   #$0000
         BNE   L01B5E3
L01B5DE  LDA   #$0030
         BRA   L01B5F6
L01B5E3  LDX   $E6
         LDA   $E4
         INC   $E4
         BNE   L01B5ED
         INC   $E6
L01B5ED  STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
L01B5F6  PHA
         LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L01B601
         INC   $E2
L01B601  STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         DEC   $50
         LDA   $50
         SEC
         SBC   #$0000
         BEQ   L01B61D
         BVS   L01B61B
         EOR   #$8000
L01B61B  BMI   L01B5C5
L01B61D  LDA   $CC
         BNE   L01B630
         LDA   $DC
         SEC
         SBC   #$0000
         BEQ   L01B647
         BVS   L01B62E
         EOR   #$8000
L01B62E  BPL   L01B647
L01B630  LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L01B63A
         INC   $E2
L01B63A  STA   $EA
         STX   $EC
         LDA   #$002E
         SEP   #$20
         STA   [$EA]
         REP   #$20
L01B647  LDA   $DC
         STA   $50
L01B64B  DEC   $50
         LDA   $50
         SEC
         SBC   #$0000
         BVS   L01B658
         EOR   #$8000
L01B658  BPL   L01B6A5
         INC   $5A
         LDA   $5A
         SEC
         SBC   #$0000
         BEQ   L01B675
         BVS   L01B669
         EOR   #$8000
L01B669  BPL   L01B675
         LDA   [$E4]
         AND   #$00FF
         CMP   #$0000
         BNE   L01B67A
L01B675  LDA   #$0030
         BRA   L01B68D
L01B67A  LDX   $E6
         LDA   $E4
         INC   $E4
         BNE   L01B684
         INC   $E6
L01B684  STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
L01B68D  PHA
         LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L01B698
         INC   $E2
L01B698  STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         BRA   L01B64B
L01B6A5  LDX   #$0000
         TDC
         CLC
         ADC   #$0079
         STX   $E6
         STA   $E4
         BRL   L01B9D2
L01B6B4  LDA   $DC
         SEC
         SBC   #$0000
         BVS   L01B6BF
         EOR   #$8000
L01B6BF  BMI   L01B6C8
         LDA   #$0006
         STA   $DC
         BRA   L01B6D4
L01B6C8  LDA   $DC
         CMP   #$0000
         BNE   L01B6D4
         LDA   #$0001
         STA   $DC
L01B6D4  LDX   $FB
         LDA   $F9
         CLC
         ADC   #$000A
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFF6
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDY   #$0008
         LDA   [$EA],Y
         PHA
         LDY   #$0006
         LDA   [$EA],Y
         PHA
         LDY   #$0004
         LDA   [$EA],Y
         PHA
         LDY   #$0002
         LDA   [$EA],Y
         PHA
         LDA   [$EA]
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$005C
         PHA
         JSL   L01C17F
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$0058
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$005A
         PHA
         LDA   $DC
         SEC
         SBC   #$0013
         BVS   L01B740
         EOR   #$8000
L01B740  BMI   L01B746
         LDA   $DC
         BRA   L01B749
L01B746  LDA   #$0013
L01B749  PHA
         PEI   $64
         PEI   $62
         PEI   $60
         PEI   $5E
         PEI   $5C
         JSL   L01CAC6
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         STX   $E6
         STA   $E4
         LDA   $DC
         STA   $52
         LDA   $CC
         BNE   L01B7C0
         PEI   $E6
         PEI   $E4
         JSL   L019F42
         PLY
         PLY
         STA   $50
         LDA   $50
         SEC
         SBC   $52
         BVS   L01B782
         EOR   #$8000
L01B782  BMI   L01B788
         LDA   $50
         STA   $52
L01B788  LDA   $52
         SEC
         SBC   #$0001
         BVS   L01B793
         EOR   #$8000
L01B793  BPL   L01B7C0
         LDA   $52
         SEC
         SBC   #$0001
         LDX   #$0000
         TAY
         BPL   L01B7A2
         DEX
L01B7A2  PHX
         PHA
         LDX   $E6
         LDA   $E4
         JSL   L0198A5
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         CMP   #$0030
         BNE   L01B7C0
         DEC   $52
         BRA   L01B788
L01B7C0  LDA   $5A
         SEC
         SBC   #$FFFD
         BVS   L01B7CB
         EOR   #$8000
L01B7CB  BPL   L01B7DB
         LDA   $5A
         SEC
         SBC   $DC
         BEQ   L01B7E6
         BVS   L01B7D9
         EOR   #$8000
L01B7D9  BPL   L01B7E6
L01B7DB  LDA   $52
         SEC
         SBC   #$0001
         STA   $DC
         BRL   L01B1BD
L01B7E6  LDA   $52
         SEC
         SBC   $5A
         STA   $DC
         BRL   L01B521
L01B7F0  LDA   $DA
         SEP   #$20
         STA   $79
         REP   #$20
         BRL   L01B825
L01B7FB  LDX   $FB
         LDA   $F9
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFFE
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDA   [$EA]
         SEP   #$20
         STA   $79
         REP   #$20
L01B825  LDX   #$0000
         TDC
         CLC
         ADC   #$0079
         STX   $E6
         STA   $E4
         CLC
         ADC   #$0001
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E2
         STA   $E0
         BRL   L01B9D2
L01B843  LDX   $FB
         LDA   $F9
         CLC
         ADC   #$0004
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFFC
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         STX   $E6
         STA   $E4
         STX   $E2
         STA   $E0
         LDA   $DC
         SEC
         SBC   #$0000
         BVS   L01B880
         EOR   #$8000
L01B880  BMI   L01B8A5
         PEI   $E6
         PEI   $E4
         JSL   L019F42
         PLY
         PLY
         LDX   #$0000
         TAY
         BPL   L01B893
         DEX
L01B893  PHX
         PHA
         LDX   $E2
         LDA   $E0
         JSL   L0198A5
         PLA
         PLX
         STX   $E2
         STA   $E0
         BRA   L01B8D6
L01B8A5  LDX   $E2
         LDA   $E0
         INC   $E0
         BNE   L01B8AF
         INC   $E2
L01B8AF  STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         CMP   #$0000
         BEQ   L01B8CE
         DEC   $DC
         LDA   $DC
         SEC
         SBC   #$0000
         BVS   L01B8CA
         EOR   #$8000
L01B8CA  BPL   L01B8CE
         BRA   L01B8A5
L01B8CE  LDA   $E0
         BNE   L01B8D4
         DEC   $E2
L01B8D4  DEC   $E0
L01B8D6  BRL   L01B9D2
L01B8D9  LDX   $FB
         LDA   $F9
         CLC
         ADC   #$0004
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $FB
         STA   $F9
         CLC
         ADC   #$FFFC
         PHA
         TXA
         ADC   #$FFFF
         TAX
         PLA
         STA   $EA
         STX   $EC
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         STX   $E6
         STA   $E4
         STX   $E2
         STA   $E0
         LDA   $DC
         SEC
         SBC   #$0000
         BVS   L01B916
         EOR   #$8000
L01B916  BPL   L01B927
         LDA   [$E4]
         AND   #$00FF
         SEC
         SBC   $DC
         BVS   L01B925
         EOR   #$8000
L01B925  BMI   L01B949
L01B927  LDA   [$E4]
         AND   #$00FF
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L01B937
         DEX
L01B937  PHX
         PHA
         LDX   $E2
         LDA   $E0
         JSL   L0198A5
         PLA
         PLX
         STX   $E2
         STA   $E0
         BRA   L01B966
L01B949  LDA   $DC
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L01B956
         DEX
L01B956  PHX
         PHA
         LDX   $E2
         LDA   $E0
         JSL   L0198A5
         PLA
         PLX
         STX   $E2
         STA   $E0
L01B966  LDX   $E6
         LDA   $E4
         CLC
         ADC   #$0001
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E6
         STA   $E4
         BRL   L01B9D2
L01B97C  LDA   #$FFFF
         BRL   L01BDFE
         BRL   L01B9D2
L01B985  DA    L01B97C
         DA    L01B113
         DA    L01B6B4
         DA    L01AE76
         DA    L01B7FB
         DA    L01AE66
         DA    L01B113
         DA    L01B492
         DA    L01B6B4
         DA    L01AE6E
         DA    L01B8D9
         DA    L01B843
         DA    L01AE66
         DA    L01AE76
         DA    L01B7F0
L01B9A3  DW    $0000
         DW    $0045
         DW    $0047
         DW    $0058
         DW    $0063
         DW    $0064
         DW    $0065
         DW    $0066
         DW    $0067
         DW    $006F
         DW    $0070
         DW    $0073
         DW    $0075
         DW    $0078
L01B9BF  TAX
         PEA   ^L01B9A3
         PEA   L01B9A3
         LDA   #$001A
         JSL   L01C45A
         PLA
         PLA
         JMP   (L01B985,X)

L01B9D2  LDA   $D8
         SEC
         SBC   #$0000
         BVS   L01B9DD
         EOR   #$8000
L01B9DD  BMI   L01B9E1
         STZ   $D8
L01B9E1  LDA   $D6
         SEC
         SBC   #$0000
         BVS   L01B9EC
         EOR   #$8000
L01B9EC  BMI   L01B9F0
         STZ   $D6
L01B9F0  LDX   $73
         LDA   $71
         PHX
         PHA
         LDA   [$75]
         AND   #$00FF
         CMP   #$0000
         BNE   L01BA05
         LDA   #$0000
         BRA   L01BA1A
L01BA05  LDY   #$0001
         LDA   [$75],Y
         AND   #$00FF
         CMP   #$0000
         BNE   L01BA17
         LDA   #$0001
         BRA   L01BA1A
L01BA17  LDA   #$0002
L01BA1A  PHA
         LDX   $E6
         LDA   $E4
         PHX
         PHA
         LDX   $E2
         LDA   $E0
         JSL   L019EF2
         PLA
         PLX
         STA   $50
         CLC
         ADC   $D8
         CLC
         ADC   $D6
         PLX
         STX   $EE
         CLC
         ADC   $EE
         LDX   #$0000
         TAY
         BPL   L01BA40
         DEX
L01BA40  PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$0070
         JSL   L0198A5
         PLA
         PLX
         JSL   L019EF2
         PLA
         PLX
         STA   $52
         LDA   $DE
         SEC
         SBC   $52
         BEQ   L01BA6A
         BVS   L01BA64
         EOR   #$8000
L01BA64  BPL   L01BA6A
         LDA   $DE
         BRA   L01BA6C
L01BA6A  LDA   $52
L01BA6C  PHA
         LDA   $E8
         PLX
         STX   $EE
         CLC
         ADC   $EE
         STA   $E8
         LDA   $D0
         BNE   L01BAE4
L01BA7B  DEC   $DE
         LDA   $DE
         SEC
         SBC   $52
         BVS   L01BA87
         EOR   #$8000
L01BA87  BPL   L01BAE4
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01BA97
         EOR   #$8000
L01BA97  BPL   L01BAD0
         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   L01BAB7
         INC
L01BAB7  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   #$0020
         SEP   #$20
         STA   [$EA]
         REP   #$20
         AND   #$00FF
         BRA   L01BAE2
L01BAD0  PEI   $FF
         PEI   $FD
         LDA   #$0020
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01BAE2  BRA   L01BA7B
L01BAE4  LDA   [$75]
         AND   #$00FF
         CMP   #$0000
         BEQ   L01BB66
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01BAFC
         EOR   #$8000
L01BAFC  BPL   L01BB44
         LDX   $77
         LDA   $75
         INC   $75
         BNE   L01BB08
         INC   $77
L01BB08  STA   $EA
         STX   $EC
         LDA   [$EA]
         PHA
         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   L01BB2D
         INC
L01BB2D  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         AND   #$00FF
         BRA   L01BB63
L01BB44  PEI   $FF
         PEI   $FD
         LDX   $77
         LDA   $75
         INC   $75
         BNE   L01BB52
         INC   $77
L01BB52  STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01BB63  BRL   L01BAE4
L01BB66  DEC   $D8
         LDA   $D8
         SEC
         SBC   #$0000
         BVS   L01BB73
         EOR   #$8000
L01BB73  BPL   L01BBD0
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01BB83
         EOR   #$8000
L01BB83  BPL   L01BBBC
         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   L01BBA3
         INC
L01BBA3  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   #$0030
         SEP   #$20
         STA   [$EA]
         REP   #$20
         AND   #$00FF
         BRA   L01BBCE
L01BBBC  PEI   $FF
         PEI   $FD
         LDA   #$0030
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01BBCE  BRA   L01BB66
L01BBD0  LDA   $50
         SEC
         SBC   #$0000
         BNE   L01BBDB
         BRL   L01BCA6
L01BBDB  BVS   L01BBE0
         EOR   #$8000
L01BBE0  BMI   L01BBE5
         BRL   L01BCA6
L01BBE5  LDA   $50
         CMP   #$0001
         BNE   L01BC47
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01BBFA
         EOR   #$8000
L01BBFA  BPL   L01BC34
         LDA   [$E4]
         PHA
         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   L01BC1D
         INC
L01BC1D  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         AND   #$00FF
         BRA   L01BC45
L01BC34  PEI   $FF
         PEI   $FD
         LDA   [$E4]
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01BC45  BRA   L01BCA6
L01BC47  LDY   #$0012
         LDA   [$FD],Y
         CMP   #$0014
         BNE   L01BC8D
         LDA   $50
         LDX   #$0000
         TAY
         BPL   L01BC5A
         DEX
L01BC5A  PHX
         PHA
         PEI   $50
         PEI   $E6
         PEI   $E4
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHX
         PHA
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         JSL   L0198A5
         PLA
         PLX
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         BRA   L01BCA6
L01BC8D  PEI   $FF
         PEI   $FD
         PEI   $50
         PEA   $0001
         PEI   $E6
         PEI   $E4
         JSL   L01C76F
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
L01BCA6  DEC   $D6
         LDA   $D6
         SEC
         SBC   #$0000
         BVS   L01BCB3
         EOR   #$8000
L01BCB3  BPL   L01BD10
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01BCC3
         EOR   #$8000
L01BCC3  BPL   L01BCFC
         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   L01BCE3
         INC
L01BCE3  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   #$0030
         SEP   #$20
         STA   [$EA]
         REP   #$20
         AND   #$00FF
         BRA   L01BD0E
L01BCFC  PEI   $FF
         PEI   $FD
         LDA   #$0030
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01BD0E  BRA   L01BCA6
L01BD10  LDA   [$71]
         AND   #$00FF
         CMP   #$0000
         BEQ   L01BD92
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01BD28
         EOR   #$8000
L01BD28  BPL   L01BD70
         LDX   $73
         LDA   $71
         INC   $71
         BNE   L01BD34
         INC   $73
L01BD34  STA   $EA
         STX   $EC
         LDA   [$EA]
         PHA
         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   L01BD59
         INC
L01BD59  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $EA
         STX   $EC
         PLA
         SEP   #$20
         STA   [$EA]
         REP   #$20
         AND   #$00FF
         BRA   L01BD8F
L01BD70  PEI   $FF
         PEI   $FD
         LDX   $73
         LDA   $71
         INC   $71
         BNE   L01BD7E
         INC   $73
L01BD7E  STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01BD8F  BRL   L01BD10
L01BD92  DEC   $DE
         LDA   $DE
         SEC
         SBC   $52
         BVS   L01BD9E
         EOR   #$8000
L01BD9E  BPL   L01BDFB
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01BDAE
         EOR   #$8000
L01BDAE  BPL   L01BDE7
         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   L01BDCE
         INC
L01BDCE  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   #$0020
         SEP   #$20
         STA   [$EA]
         REP   #$20
         AND   #$00FF
         BRA   L01BDF9
L01BDE7  PEI   $FF
         PEI   $FD
         LDA   #$0020
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01BDF9  BRA   L01BD92
L01BDFB  BRL   L01AB38
L01BDFE  TAY
         TDC
         CLC
         ADC   #$00EF
         TCS
         TYA
         PLD
         RTL

L01BE08  TSC
         TCD
         LDA   [$04]
         TAX
         LDA   $04,S
         TAY
         LDA   $06,S
         TCD
         LDA   $08,S
         TXS
         PHA
         PHA
         PHD
         PHY
         TSC
         TCD
         LDY   #$0002
         LDA   [$01],Y
         TAX
         INY
         INY
         LDA   [$01],Y
         STA   $08,S
         INY
         INY
         LDA   [$01],Y
         STA   $0A,S
         PLA
         PLA
         PLA
         PLY
         CMP   #$0000
         BNE   L01BE38
         INC
L01BE38  PHX
         PLD
         RTL

L01BE3B  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FF
         CMP   #$0000
         BNE   L01BE51
         LDA   $FD
         BRA   L01BE58
L01BE51  PEI   $FF
         JSL   L01C4F8
         PLY
L01BE58  STA   L05017C
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01BE65  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         LDA   #$00B4
         STAL  L02EA96
         PEA   $0000
         PEA   $00B4
         PEA   $0000
         PEA   $0000
         JSL   L01CB36
         PLY
         PLY
         PLY
         PLY
         PHA
         TXA
         STAL  L02EA9A
         PLA
         STAL  L02EA98
         SEC
         LDAL  L02EAA0
         SBC   #$0000
         BNE   L01BEA9
         LDAL  L02EAA2
         SBC   #$0000
         BRA   L01BEB2
L01BEA9  LDAL  L02EAA2
         SBC   #$0000
         REP   #$02
L01BEB2  BNE   L01BEB7
         BRL   L01BF74
L01BEB7  LDAL  L02EAA2
         TAX
         LDAL  L02EAA0
         STA   $F6
         STX   $F8
         LDY   #$001A
         LDA   [$F6],Y
         TAX
         LDY   #$0018
         LDA   [$F6],Y
         PHX
         PHA
         LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         PHX
         PHA
         PEA   $0000
         PEA   $0036
         _BlockMove
         LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         STX   $F4
         STA   $F2
         BRA   L01BF48
L01BF01  LDA   [$F2]
         CMP   #$0000
         BEQ   L01BF3C
         PEA   $0000
         PEA   $6601
         PEI   $F4
         PEI   $F2
         LDY   #$0006
         LDA   [$F2],Y
         TAX
         LDY   #$0004
         LDA   [$F2],Y
         STA   $F6
         STX   $F8
         LDY   #$0016
         LDA   [$F6],Y
         TAX
         LDY   #$0014
         LDA   [$F6],Y
         STA   $F6
         STX   $F8
         LDA   $F6
         LDX   $F8
         JSL   L01A615
         PLY
         PLY
         PLY
         PLY
L01BF3C  LDA   $F2
         CLC
         ADC   #$0012
         STA   $F2
         BCC   L01BF48
         INC   $F4
L01BF48  LDAL  L02EA9A
         TAX
         LDAL  L02EA98
         STA   $F6
         STX   $F8
         LDX   $F8
         LDA   #$0024
         CLC
         ADC   $F6
         BCC   L01BF60
         INX
L01BF60  PHX
         PHA
         LDX   $F4
         LDA   $F2
         JSL   L01A847
         BVS   L01BF6F
         EOR   #$8000
L01BF6F  BMI   L01BF01
         BRL   L01C151
L01BF74  PEA   $0000
         PEA   ^L02E93B
         PEA   L02E93B
         JSL   L01A61D
         PLY
         PLY
         PLY
         STA   $F0
         PEA   $0000
         TDC
         CLC
         ADC   #$00F0
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $F4
         STA   $F2
         PHX
         PHA
         PEA   $0000
         PEA   $0004
         LDA   appID
         ORA   #$0F00
         PHA
         PEA   $8300
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         LDY   #$000A
         PHA
         TXA
         STA   [$F2],Y
         PLA
         LDY   #$0008
         STA   [$F2],Y
         LDY   #$000A
         LDA   [$F2],Y
         TAX
         LDY   #$0008
         LDA   [$F2],Y
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STA   $F6
         STX   $F8
         LDA   #$0000
         STA   [$F6]
         LDY   #$000A
         LDA   [$F2],Y
         TAX
         LDY   #$0008
         LDA   [$F2],Y
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STA   $F6
         STX   $F8
         LDA   #$0000
         LDY   #$0002
         STA   [$F6],Y
         PEA   $0001
         PEA   ^L02E944
         PEA   L02E944
         JSL   L01A61D
         PLY
         PLY
         PLY
         STA   $F0
         PEA   $0000
         TDC
         CLC
         ADC   #$00F0
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $F4
         STA   $F2
         PHX
         PHA
         PEA   $0000
         PEA   $0004
         LDA   appID
         ORA   #$0F00
         PHA
         PEA   $8300
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         LDY   #$000A
         PHA
         TXA
         STA   [$F2],Y
         PLA
         LDY   #$0008
         STA   [$F2],Y
         LDY   #$000A
         LDA   [$F2],Y
         TAX
         LDY   #$0008
         LDA   [$F2],Y
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STA   $F6
         STX   $F8
         LDA   #$0000
         STA   [$F6]
         LDY   #$000A
         LDA   [$F2],Y
         TAX
         LDY   #$0008
         LDA   [$F2],Y
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STA   $F6
         STX   $F8
         LDA   #$0001
         LDY   #$0002
         STA   [$F6],Y
         PEA   $0001
         PEA   ^L02E94D
         PEA   L02E94D
         JSL   L01A61D
         PLY
         PLY
         PLY
         STA   $F0
         PEA   $0000
         TDC
         CLC
         ADC   #$00F0
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $F4
         STA   $F2
         PHX
         PHA
         PEA   $0000
         PEA   $0004
         LDA   appID
         ORA   #$0F00
         PHA
         PEA   $8300
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         LDY   #$000A
         PHA
         TXA
         STA   [$F2],Y
         PLA
         LDY   #$0008
         STA   [$F2],Y
         LDY   #$000A
         LDA   [$F2],Y
         TAX
         LDY   #$0008
         LDA   [$F2],Y
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STA   $F6
         STX   $F8
         LDA   #$0000
         STA   [$F6]
         LDY   #$000A
         LDA   [$F2],Y
         TAX
         LDY   #$0008
         LDA   [$F2],Y
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STA   $F6
         STX   $F8
         LDA   #$0002
         LDY   #$0002
         STA   [$F6],Y
L01C151  LDA   #L01C39A
         LDX   #^L01C39A
         PHX
         PHA
         LDAL  L02EA92+2
         TAX
         LDAL  L02EA92
         STA   $F6
         STX   $F8
         PLA
         PLX
         LDY   #$000A
         PHA
         TXA
         STA   [$F6],Y
         PLA
         LDY   #$0008
         STA   [$F6],Y
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L01C17F  TSC
         CLC
         ADC   #$0008
         PEA   $0000
         PHA
         LDA   $0A,S
         PHA
         LDA   $0A,S
         PHA
         PEA   $0010
         _SANEFP816
         LDA   $02,S
         STA   $06,S
         LDA   $00,S
         STA   $04,S
         PLY
         PLY
         RTL

L01C1A3  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FF
         PEI   $FD
         PEA   ^L02E853
         PEA   L02E853
         JSL   L01C9E6
         PLY
         PLY
         PLY
         PLY
         TDC
         CLC
         ADC   #$00F7
         TCS
         PLD
         RTL

L01C1C8  PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$00DE
         TCS
         LDA   [$F7]
         AND   #$00FF
         CMP   #$0000
         BEQ   L01C1E2
         LDA   #$0000
         BRA   L01C1E5
L01C1E2  LDA   #$0001
L01C1E5  PHA
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDX   $F9
         LDA   $F7
         JSL   L01A847
         BEQ   L01C1FD
         LDA   #$0000
         BRA   L01C200
L01C1FD  LDA   #$0001
L01C200  PLX
         STX   $EC
         ORA   $EC
         TAY
         BEQ   L01C21A
         PEA   $0000
         PEA   $0016
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRL   L01C390
L01C21A  LDAL  L02EA9C
         CMP   #$0000
         BNE   L01C23D
         LDAL  L02EA9E
         CMP   #$0000
         BNE   L01C23D
         LDA   #L02E87B
         LDX   #^L02E87B
         PHA
         TXA
         STAL  L02EA9E
         PLA
         STAL  L02EA9C
L01C23D  LDAL  L02EA9E
         TAX
         LDAL  L02EA9C
         STX   $E2
         STA   $E0
         BRA   L01C273
L01C24C  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0006
         LDA   [$E0],Y
         TAX
         LDY   #$0004
         LDA   [$E0],Y
         JSL   L01A847
         BNE   L01C267
         BRA   L01C29E
L01C267  LDA   $E0
         CLC
         ADC   #$0018
         STA   $E0
         BCC   L01C273
         INC   $E2
L01C273  LDAL  L02EA9E
         TAX
         LDAL  L02EA9C
         STA   $E8
         STX   $EA
         LDX   $EA
         LDA   #$0078
         CLC
         ADC   $E8
         BCC   L01C28B
         INX
L01C28B  PHX
         PHA
         LDX   $E2
         LDA   $E0
         JSL   L01A847
         BEQ   L01C29E
         BVS   L01C29C
         EOR   #$8000
L01C29C  BMI   L01C24C
L01C29E  LDA   #$4006
         STA   $E6
L01C2A3  LDAL  L02EA9E
         TAX
         LDAL  L02EA9C
         PHX
         PHA
         LDX   $E2
         LDA   $E0
         SEC
         SBC   #$0018
         STA   $E0
         PHA
         LDA   $E2
         SBC   #$0000
         TAX
         STA   $E2
         PLA
         JSL   L01A847
         BEQ   L01C2CF
         BVS   L01C2CD
         EOR   #$8000
L01C2CD  BMI   L01C308
L01C2CF  PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         LDY   #$0006
         LDA   [$E0],Y
         TAX
         LDY   #$0004
         LDA   [$E0],Y
         STA   $E8
         STX   $EA
         LDA   $E8
         LDX   $EA
         JSL   L01A615
         PLY
         PLY
         PLY
         PLY
         PLY
         STA   $E6
         LDA   $E6
         SEC
         SBC   #$0000
         BVS   L01C302
         EOR   #$8000
L01C302  BPL   L01C306
         BRA   L01C308
L01C306  BRA   L01C2A3
L01C308  SEC
         LDA   $F3
         SBC   #$0000
         BNE   L01C317
         LDA   $F5
         SBC   #$0000
         BRA   L01C31E
L01C317  LDA   $F5
         SBC   #$0000
         REP   #$02
L01C31E  BEQ   L01C34E
         SEC
         LDA   $E0
         SBCL  L02EA9C
         BNE   L01C331
         LDA   $E2
         SBCL  L02EA9E
         BRA   L01C339
L01C331  LDA   $E2
         SBCL  L02EA9E
         REP   #$02
L01C339  BVS   L01C33E
         EOR   #$8000
L01C33E  BPL   L01C34E
         LDX   $E2
         LDA   $E0
         LDY   #$0002
         PHA
         TXA
         STA   [$F3],Y
         PLA
         STA   [$F3]
L01C34E  LDA   $E6
         AND   #$4000
         CMP   #$0000
         BNE   L01C35C
         LDA   $E6
         BRA   L01C390
L01C35C  LDA   $E6
         STA   $E4
         LDA   $E4
         AND   #$8000
         TAY
         BEQ   L01C37A
         LDA   $E4
         AND   #$BFFF
         STA   $E4
         LDA   $E4
         AND   #$7FFF
         STA   $E4
         STZ   $E6
         BRA   L01C383
L01C37A  LDA   $E6
         AND   #$BFFF
         STA   $E6
         STZ   $E4
L01C383  PEI   $E4
         PEI   $E6
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
L01C390  TAY
         TDC
         CLC
         ADC   #$00ED
         TCS
         TYA
         PLD
         RTL

L01C39A  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         LDA   #$0012
         PHA
         LDAL  L02EA96
         SEC
         JSL   L019DD9
         PLY
         SEC
         SBC   #$0001
         STA   $F0
         STZ   $F2
         BRA   L01C3C6
L01C3BD  PEI   $F2
         JSL   L019217
         PLY
         INC   $F2
L01C3C6  LDA   $F2
         SEC
         SBC   $F0
         BEQ   L01C3BD
         BVS   L01C3D2
         EOR   #$8000
L01C3D2  BPL   L01C3BD
         TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L01C3DE  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E6
         TCS
         LDX   $FF
         LDA   $FD
         STX   $EA
         STA   $E8
         LDX   $FF
         LDA   $FD
         STX   $F2
         ORA   $F2
         BEQ   L01C44C
         LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L01C405
         INC   $FF
L01C405  STX   $EE
         STA   $EC
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $F0
         BRA   L01C43C
L01C416  LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L01C420
         INC   $FF
L01C420  STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDX   $EE
         LDA   $EC
         INC   $EC
         BNE   L01C431
         INC   $EE
L01C431  STA   $F2
         STX   $F4
         PLA
         SEP   #$20
         STA   [$F2]
         REP   #$20
L01C43C  LDA   $F0
         DEC   $F0
         TAY
         BNE   L01C416
         LDA   #$0000
         SEP   #$20
         STA   [$EC]
         REP   #$20
L01C44C  LDX   $EA
         LDA   $E8
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01C45A  TAY
         PHB
         LDA   $06,S
         PHA
         PLB
         PLB
         PHY
         PHY
         PEA   $0000
         TXA
         CMP   ($0B,S),Y
         BEQ   L01C49A
         LDY   #$0000
         CMP   ($0B,S),Y
         BEQ   L01C49A
         BRA   L01C477
L01C474  TYA
         STA   $03,S
L01C477  LDA   $03,S
         CMP   $01,S
         BEQ   L01C495
         CLC
         ADC   $01,S
         LSR
         AND   #$00FE
         CMP   $01,S
         BEQ   L01C495
         TAY
         TXA
         CMP   ($0B,S),Y
         BEQ   L01C49A
         BCC   L01C474
         TYA
         STA   $01,S
         BRA   L01C477
L01C495  LDA   $05,S
         INC
         INC
         TAY
L01C49A  TYX
         PLA
         PLA
         PLA
         PLB
         RTL

L01C4A0  BCC   L01C4C2
         PHD
         PHX
         PHA
         TSC
         TCD
         LDX   $0A
         LDA   $0C
         BEQ   L01C4B0
         LDX   #$0021
L01C4B0  TXY
         BEQ   L01C4DD
         LDA   $03
         BPL   L01C4D3
L01C4B7  SEC
         ROR
         ROR   $01
         DEX
         BNE   L01C4B7
         STA   $03
         BRA   L01C4DD
L01C4C2  PHD
         PHX
         PHA
         TSC
         TCD
         LDX   $0A
         LDA   $0C
         BEQ   L01C4D0
         LDX   #$0021
L01C4D0  TXY
         BEQ   L01C4DD
L01C4D3  LDA   $03
L01C4D5  LSR
         ROR   $01
         DEX
         BNE   L01C4D5
         STA   $03
L01C4DD  LDA   $03
         STA   $0C
         LDA   $01
         STA   $0A
         PLY
         PLY
         PLD
         RTL

L01C4E9  PHA
         TXA
         EOR   #$FFFF
         TAX
         PLA
         EOR   #$FFFF
         INC
         BNE   L01C4F7
         INX
L01C4F7  RTL

L01C4F8  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         STZ   $F2
         LDA   $FF
         BRL   L01C5EE
L01C50A  BRL   L01C601
L01C50D  LDA   #$0014
         STA   $F2
         BRL   L01C601
L01C515  LDA   #$000E
         STA   $F2
         BRL   L01C601
L01C51D  LDA   #$001C
         STA   $F2
         BRL   L01C601
L01C525  LDA   #$0011
         STA   $F2
         BRL   L01C601
L01C52D  LDA   #$0006
         STA   $F2
         BRL   L01C601
L01C535  LDA   #$0006
         STA   $F2
         BRL   L01C601
L01C53D  LDA   #$0010
         STA   $F2
         BRL   L01C601
L01C545  LDA   #$0002
         STA   $F2
         BRL   L01C601
L01C54D  LDA   #$0009
         STA   $F2
         BRL   L01C601
L01C555  LDA   #$0005
         STA   $F2
         BRL   L01C601
L01C55D  LDA   #$0017
         STA   $F2
         BRL   L01C601
L01C565  LDA   #$000C
         STA   $F2
         BRL   L01C601
L01C56D  LDA   #$001A
         STA   $F2
         BRL   L01C601
L01C575  LDA   #$0016
         STA   $F2
         BRL   L01C601
L01C57D  LDA   #$000D
         STA   $F2
         BRL   L01C601
L01C585  LDA   #$001E
         STA   $F2
         BRL   L01C601
         BRL   L01C601
L01C590  DA    L01C50A
         DA    L01C555
         DA    L01C585
         DA    L01C515
         DA    L01C55D
         DA    L01C54D
         DA    L01C545
         DA    L01C535
         DA    L01C545
         DA    L01C525
         DA    L01C51D
         DA    L01C51D
         DA    L01C50D
         DA    L01C52D
         DA    L01C535
         DA    L01C57D
         DA    L01C56D
         DA    L01C50D
         DA    L01C575
         DA    L01C565
         DA    L01C53D
         DA    L01C535
         DA    L01C535
         DA    L01C50A
L01C5C0  DW    $0000
         DW    $0027
         DW    $002B
         DW    $0040
         DW    $0042
         DW    $0043
         DW    $0044
         DW    $0045
         DW    $0046
         DW    $0047
         DW    $0048
         DW    $0049
         DW    $004B
         DW    $004C
         DW    $004D
         DW    $004E
         DW    $0050
         DW    $0052
         DW    $0053
         DW    $0054
         DW    $0057
         DW    $0058
         DW    $005A
L01C5EE  TAX
         PEA   ^L01C5C0
         PEA   L01C5C0
         LDA   #$002C
         JSL   L01C45A
         PLA
         PLA
         JMP   (L01C590,X)

L01C601  LDA   $F2
         TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L01C60D  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L02EB44
         LDX   #^L02EB44
         JSL   L0198A5
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         AND   #$0080
         TAY
         BEQ   L01C671
         LDA   $FF
         AND   #$00FF
         SEC
         SBC   #$0039
         BEQ   L01C64F
         BVS   L01C64D
         EOR   #$8000
L01C64D  BMI   L01C65A
L01C64F  LDA   $FF
         AND   #$00FF
         SEC
         SBC   #$0030
         BRA   L01C66D
L01C65A  LDA   $FF
         AND   #$00FF
         PHA
         JSL   L01CFF6
         PLY
         SEC
         SBC   #$0061
         CLC
         ADC   #$000A
L01C66D  BRA   L01C674
         BRA   L01C674
L01C671  LDA   #$FFFF
L01C674  TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

L01C67E  PHD
         PHX
         PHA
         PEA   $0000
         PEA   $0001
         PEA   $0000
         PEA   $0000
         TSC
         TCD
         LDA   $12
         ORA   $14
         BNE   L01C69B
         LDX   #$0000
         BRL   L01C75F
L01C69B  LDX   #$0000
         BCC   L01C6D3
         LDA   $14
         BIT   #$8000
         BEQ   L01C6B9
         EOR   #$FFFF
         STA   $14
         LDA   $12
         EOR   #$FFFF
         INC
         BNE   L01C6B6
         INC   $14
L01C6B6  STA   $12
         INX
L01C6B9  LDA   $0B
         BIT   #$8000
         BEQ   L01C6D3
         EOR   #$FFFF
         STA   $0B
         LDA   $09
         EOR   #$FFFF
         INC
         BNE   L01C6CF
         INC   $0B
L01C6CF  STA   $09
         INX
         INX
L01C6D3  BRA   L01C6D9
L01C6D5  ASL   $05
         ROL   $07
L01C6D9  ASL   $12
         ROL   $14
         BCC   L01C6D5
         ROR   $14
         ROR   $12
L01C6E3  LDA   $0B
         CMP   $14
         BEQ   L01C6ED
         BCC   L01C70C
         BRA   L01C6F3
L01C6ED  LDA   $09
         CMP   $12
         BCC   L01C70C
L01C6F3  LDA   $09
         SEC
         SBC   $12
         STA   $09
         LDA   $0B
         SBC   $14
         STA   $0B
         LDA   $01
         ORA   $05
         STA   $01
         LDA   $03
         ORA   $07
         STA   $03
L01C70C  LSR   $14
         ROR   $12
         LSR   $07
         ROR   $05
         BCC   L01C6E3
         CPX   #$0000
         BEQ   L01C74B
         CPX   #$0003
         BEQ   L01C738
         LDA   $01
         EOR   #$FFFF
         STA   $01
         LDA   $03
         EOR   #$FFFF
         INC   $01
         BNE   L01C731
         INC
L01C731  STA   $03
         CPX   #$0001
         BEQ   L01C74B
L01C738  LDA   $09
         EOR   #$FFFF
         STA   $09
         LDA   $0B
         EOR   #$FFFF
         INC   $09
         BNE   L01C749
         INC
L01C749  STA   $0B
L01C74B  LDA   $09
         STA   $12
         LDA   $0B
         STA   $14
         LDA   $01
         LDX   $03
         PLY
         PLY
         PLY
         PLY
         PLY
         PLY
         PLD
         RTL

L01C75F  PEA   $0004
         PEA   $0000
         PEA   $0000
         _SysFailMgr
L01C76F  PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00DC
         TCS
         LDA   $F9
         SEC
         SBC   #$0000
         BNE   L01C785
         BRL   L01C803
L01C785  BVS   L01C78A
         EOR   #$8000
L01C78A  BPL   L01C803
         LDA   $FB
         SEC
         SBC   #$0000
         BEQ   L01C803
         BVS   L01C799
         EOR   #$8000
L01C799  BPL   L01C803
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0012
         CMP   #$0002
         BNE   L01C7F1
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         JSL   L01A847
         BEQ   L01C7F1
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         PHX
         PHA
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         JSL   L01A847
         BNE   L01C7FD
         LDA   [$FD]
         CMP   #$0000
         BNE   L01C7FD
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0044
         TAY
         BNE   L01C7FD
L01C7F1  PEI   $FF
         PEI   $FD
         JSL   L01CF11
         PLY
         PLY
         BRA   L01C800
L01C7FD  LDA   #$0000
L01C800  TAY
         BEQ   L01C809
L01C803  LDA   #$0000
         BRL   L01C9DC
L01C809  LDA   $F9
         PHA
         LDA   $FB
         SEC
         JSL   L019EFD
         PLA
         STA   $E8
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0044
         TAY
         BNE   L01C824
         BRL   L01C8A9
L01C824  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0004
         TAY
         BEQ   L01C847
         PEI   $E8
         PEI   $F7
         PEI   $F5
         LDY   #$0012
         LDA   [$FD],Y
         PHA
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         STA   $E6
         BRA   L01C879
L01C847  STZ   $E6
         BRA   L01C873
L01C84B  PEI   $FF
         PEI   $FD
         LDX   $F7
         LDA   $F5
         INC   $F5
         BNE   L01C859
         INC   $F7
L01C859  STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
         CMP   #$FFFF
         BNE   L01C871
         BRA   L01C879
L01C871  INC   $E6
L01C873  LDA   $E6
         CMP   $E8
         BCC   L01C84B
L01C879  LDA   $E6
         SEC
         SBC   #$0000
         BVS   L01C884
         EOR   #$8000
L01C884  BMI   L01C88E
         LDA   #$0000
         BRL   L01C9DC
         BRA   L01C8A9
L01C88E  LDA   $E6
         CMP   $E8
         BNE   L01C89B
         LDA   $FB
         BRL   L01C9DC
         BRA   L01C8A9
L01C89B  LDA   $F9
         PHA
         LDA   $E6
         SEC
         JSL   L019DD9
         PLY
         BRL   L01C9DC
L01C8A9  LDY   #$000C
         LDA   [$FD],Y
         TAX
         LDY   #$000A
         LDA   [$FD],Y
         STX   $E0
         STA   $DE
L01C8B8  LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         STX   $E4
         STA   $E2
         PHX
         PHA
         LDX   $E0
         LDA   $DE
         JSL   L019EF2
         PLA
         PLX
         STA   $E6
         SEC
         SBC   #$0000
         BEQ   L01C8E2
         BVS   L01C8E0
         EOR   #$8000
L01C8E0  BMI   L01C911
L01C8E2  PEI   $FF
         PEI   $FD
         JSL   L01DC2A
         PLY
         PLY
         CMP   #$FFFF
         BNE   L01C90F
         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   L01C9DC
L01C90F  BRA   L01C8B8
L01C911  LDA   $E6
         CMP   $E8
         BEQ   L01C91D
         BCC   L01C91D
         LDA   $E8
         BRA   L01C91F
L01C91D  LDA   $E6
L01C91F  STA   $E6
         PEI   $E6
         PEI   $F7
         PEI   $F5
         PEI   $E4
         PEI   $E2
         JSL   L019D81
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   [$FD]
         SEC
         SBC   $E6
         STA   [$FD]
         LDA   $E6
         LDX   #$0000
         TAY
         BPL   L01C944
         DEX
L01C944  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   L01C98E
         EOR   #$8000
L01C98E  BMI   L01C995
         LDA   #$0000
         BRA   L01C997
L01C995  LDA   [$FD]
L01C997  PLX
         STX   $EA
         SEC
         SBC   $EA
         BEQ   L01C9B0
         BVS   L01C9A4
         EOR   #$8000
L01C9A4  BPL   L01C9B0
         PEI   $FF
         PEI   $FD
         JSL   L01DBBE
         PLY
         PLY
L01C9B0  LDA   $E8
         SEC
         SBC   $E6
         STA   $E8
         CMP   #$0000
         BNE   L01C9C0
         LDA   $FB
         BRA   L01C9DC
L01C9C0  LDA   $E6
         LDX   #$0000
         TAY
         BPL   L01C9C9
         DEX
L01C9C9  PHX
         PHA
         LDX   $F7
         LDA   $F5
         JSL   L0198A5
         PLA
         PLX
         STX   $F7
         STA   $F5
         BRL   L01C8B8
L01C9DC  TAY
         TDC
         CLC
         ADC   #$00EF
         TCS
         TYA
         PLD
         RTL

L01C9E6  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E8
         TCS
         LDX   #$0000
         TDC
         CLC
         ADC   #$00FF
         STX   $EC
         STA   $EA
         PEA   ^L02EC58
         PEA   L02EC58
         PEI   $EC
         PEI   $EA
         PEI   $FD
         PEI   $FB
         JSL   L01AB2B
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         STA   $EE
         LDA   #L02EC58
         LDX   #^L02EC58
         STA   $F0
         STX   $F2
         LDY   #$0010
         LDA   [$F0],Y
         AND   #$0020
         TAY
         BEQ   L01CA33
         LDA   #$FFFF
         BRA   L01CA35
L01CA33  LDA   $EE
L01CA35  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L01CA3F  ENT
         PHD
         PHX
         PHA
         PEA   $0000
         PEA   $0000
         TSC
         TCD
         LDX   #$0000
         BCC   L01CA81
         LDA   $10
         BIT   #$8000
         BEQ   L01CA68
         EOR   #$FFFF
         STA   $10
         LDA   $0E
         EOR   #$FFFF
         INC
         BNE   L01CA65
         INC   $10
L01CA65  STA   $0E
         INX
L01CA68  LDA   $07
         BIT   #$8000
         BEQ   L01CA81
         EOR   #$FFFF
         STA   $07
         LDA   $05
         EOR   #$FFFF
         INC
         BNE   L01CA7E
         INC   $07
L01CA7E  STA   $05
         DEX
L01CA81  BRA   L01CA9A
L01CA83  LSR   $07
         ROR   $05
         BCC   L01CA96
         LDA   $01
         CLC
         ADC   $0E
         STA   $01
         LDA   $03
         ADC   $10
         STA   $03
L01CA96  ASL   $0E
         ROL   $10
L01CA9A  LDA   $05
         ORA   $07
         BNE   L01CA83
         CPX   #$0000
         BEQ   L01CAB8
         LDA   $01
         EOR   #$FFFF
         STA   $01
         LDA   $03
         EOR   #$FFFF
         INC   $01
         BNE   L01CAB6
         INC
L01CAB6  STA   $03
L01CAB8  LDA   $01
         STA   $0E
         LDA   $03
         STA   $10
         PLY
         PLY
         PLY
         PLY
         PLD
         RTL

L01CAC6  PHD
         TSC
         SEC
         SBC   #$00E7
         TCD
         ADC   #$00E0
         TCS
         PEA   $0000
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEI   $F5
         PEI   $F3
         PEI   $F1
         PEI   $EF
         PEI   $ED
         JSL   L01DAA1
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         TAY
         TDC
         CLC
         ADC   #$00E7
         TCS
         TYA
         PLD
         RTL

L01CAFE  PHD
         TSC
         SEC
         SBC   #$00E7
         TCD
         ADC   #$00E0
         TCS
         PEA   $0001
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEI   $F5
         PEI   $F3
         PEI   $F1
         PEI   $EF
         PEI   $ED
         JSL   L01DAA1
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         TAY
         TDC
         CLC
         ADC   #$00E7
         TCS
         TYA
         PLD
         RTL

L01CB36  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00DC
         TCS
         STZ   $EA
         STZ   $EC
         STZ   $E6
         STZ   $E8
         SEC
         LDA   $F9
         SBC   #$0000
         BNE   L01CB58
         LDA   $FB
         SBC   #$0000
         BRA   L01CB5F
L01CB58  LDA   $FB
         SBC   #$0000
         REP   #$02
L01CB5F  BNE   L01CB64
         BRL   L01CBF7
L01CB64  PHX
         PHA
         PEI   $FB
         PEI   $F9
         _FindHandle
         PLA
         PLX
         STX   $EC
         STA   $EA
         PHX
         PHA
         PEI   $EC
         PEI   $EA
         _GetHandleSize
         PLA
         PLX
         STX   $E8
         STA   $E6
         SEC
         LDA   $FD
         SBC   $E6
         BNE   L01CBA9
         LDA   $FF
         SBC   $E8
         BRA   L01CBAF
L01CBA9  LDA   $FF
         SBC   $E8
         REP   #$02
L01CBAF  BVS   L01CBB4
         EOR   #$8000
L01CBB4  BMI   L01CBE3
         PEI   $EC
         PEI   $EA
         PEI   $FF
         PEI   $FD
         _SetHandleSize
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         AND   #$FFFF
         PHA
         TXA
         AND   #$00FF
         TAX
         PLA
         BRL   L01CD29
L01CBE3  PEI   $EC
         PEI   $EA
         _HUnlock
L01CBF7  PHX
         PHA
         PEI   $FF
         PEI   $FD
         LDA   appID
         ORA   #$0F00
         PHA
         PEA   $8300
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         STX   $E4
         STA   $E2
         LDA   L050002
         BEQ   L01CC5D
         SEC
         LDA   $EA
         SBC   #$0000
         BNE   L01CC37
         LDA   $EC
         SBC   #$0000
         BRA   L01CC3E
L01CC37  LDA   $EC
         SBC   #$0000
         REP   #$02
L01CC3E  BEQ   L01CC54
         PEI   $EC
         PEI   $EA
         _HLock
L01CC54  LDX   #$0000
         LDA   #$0000
         BRL   L01CD29
L01CC5D  PEI   $E4
         PEI   $E2
         _HLock
         SEC
         LDA   $F9
         SBC   #$0000
         BNE   L01CC80
         LDA   $FB
         SBC   #$0000
         BRA   L01CC87
L01CC80  LDA   $FB
         SBC   #$0000
         REP   #$02
L01CC87  BEQ   L01CCC5
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         PHX
         PHA
         LDY   #$0002
         LDA   [$E2],Y
         TAX
         LDA   [$E2]
         PHX
         PHA
         PEI   $E8
         PEI   $E6
         _BlockMove
         PEI   $EC
         PEI   $EA
         _DisposeHandle
L01CCC5  LDY   #$0002
         LDA   [$E2],Y
         TAX
         LDA   [$E2]
         CLC
         ADC   $E6
         PHA
         TXA
         ADC   $E8
         TAX
         PLA
         STX   $E0
         STA   $DE
L01CCDA  LDY   #$0002
         LDA   [$E2],Y
         TAX
         LDA   [$E2]
         CLC
         ADC   $FD
         PHA
         TXA
         ADC   $FF
         TAX
         PLA
         PHX
         PHA
         LDX   $E0
         LDA   $DE
         JSL   L01A847
         BEQ   L01CD17
         BVS   L01CCFC
         EOR   #$8000
L01CCFC  BPL   L01CD17
         LDX   $E0
         LDA   $DE
         INC   $DE
         BNE   L01CD08
         INC   $E0
L01CD08  STA   $EE
         STX   $F0
         LDA   #$0000
         SEP   #$20
         STA   [$EE]
         REP   #$20
         BRA   L01CCDA
L01CD17  LDY   #$0002
         LDA   [$E2],Y
         TAX
         LDA   [$E2]
         AND   #$FFFF
         PHA
         TXA
         AND   #$00FF
         TAX
         PLA
L01CD29  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L01CD33  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00ED
         TCS
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0052
         CMP   #$0042
         BEQ   L01CD4E
         BRL   L01CDD3
L01CD4E  LDY   #$000C
         LDA   [$FD],Y
         TAX
         LDY   #$000A
         LDA   [$FD],Y
         PHX
         PHA
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         JSL   L01A847
         BEQ   L01CD73
         BVS   L01CD71
         EOR   #$8000
L01CD71  BMI   L01CD76
L01CD73  BRL   L01CE22
L01CD76  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   L01CD94
         INC
L01CD94  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   $FB
         SEP   #$20
         STA   [$F0]
         REP   #$20
         AND   #$00FF
         CMP   #$000A
         BEQ   L01CDB7
         LDA   $FB
         AND   #$00FF
         BRL   L01CF07
L01CDB7  PEI   $FF
         PEI   $FD
         JSL   L01DC2A
         PLY
         PLY
         CMP   #$FFFF
         BNE   L01CDCB
         LDA   #$FFFF
         BRA   L01CDD0
L01CDCB  LDA   $FB
         AND   #$00FF
L01CDD0  BRL   L01CF07
L01CDD3  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0016
         CMP   #$0006
         BNE   L01CE22
         LDA   $FB
         SEP   #$20
         STA   $EF
         REP   #$20
         PEA   $0001
         PEA   $0000
         TDC
         CLC
         ADC   #$00EF
         PHA
         LDY   #$0012
         LDA   [$FD],Y
         PHA
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         CMP   #$0001
         BNE   L01CE0F
         LDA   $FB
         AND   #$00FF
         BRL   L01CF07
L01CE0F  LDY   #$0010
         LDA   [$FD],Y
         ORA   #$0020
         LDY   #$0010
         STA   [$FD],Y
         LDA   #$FFFF
         BRL   L01CF07
L01CE22  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0012
         CMP   #$0002
         BNE   L01CE78
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         JSL   L01A847
         BEQ   L01CE78
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         PHX
         PHA
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         JSL   L01A847
         BNE   L01CE84
         LDA   [$FD]
         CMP   #$0000
         BNE   L01CE84
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0044
         TAY
         BNE   L01CE84
L01CE78  PEI   $FF
         PEI   $FD
         JSL   L01CF11
         PLY
         PLY
         BRA   L01CE87
L01CE84  LDA   #$0000
L01CE87  TAY
         BEQ   L01CE8F
         LDA   #$FFFF
         BRA   L01CF07
L01CE8F  PEI   $FF
         PEI   $FD
         JSL   L01DC2A
         PLY
         PLY
         LDA   [$FD]
         DEC
         STA   [$FD]
         SEC
         SBC   #$0000
         BVS   L01CEA7
         EOR   #$8000
L01CEA7  BPL   L01CEE1
         LDA   $FB
         PHA
         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   L01CECA
         INC
L01CECA  LDY   #$0004
         STA   [$FD],Y
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         SEP   #$20
         STA   [$F0]
         REP   #$20
         AND   #$00FF
         BRA   L01CEF2
L01CEE1  PEI   $FF
         PEI   $FD
         LDA   $FB
         AND   #$00FF
         PHA
         JSL   L01CD33
         PLY
         PLY
         PLY
L01CEF2  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0020
         TAY
         BEQ   L01CF02
         LDA   #$FFFF
         BRA   L01CF07
L01CF02  LDA   $FB
         AND   #$00FF
L01CF07  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L01CF11  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0012
         CMP   #$0002
         BEQ   L01CF4A
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0082
         TAY
         BNE   L01CF3A
         LDA   #$FFFF
         BRL   L01CFEC
L01CF3A  LDY   #$0010
         LDA   [$FD],Y
         AND   #$FFEF
         ORA   #$0002
         LDY   #$0010
         STA   [$FD],Y
L01CF4A  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         JSL   L01A847
         BNE   L01CF6D
         PEI   $FF
         PEI   $FD
         JSL   L01D613
         PLY
         PLY
L01CF6D  LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         PHX
         PHA
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         JSL   L01A847
         BNE   L01CFE9
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0044
         TAY
         BNE   L01CFE9
         LDY   #$000E
         LDA   [$FD],Y
         STA   [$FD]
         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   L01CFC7
         EOR   #$8000
L01CFC7  BMI   L01CFCE
         LDA   #$0000
         BRA   L01CFD0
L01CFCE  LDA   [$FD]
L01CFD0  PLX
         STX   $F2
         SEC
         SBC   $F2
         BEQ   L01CFE9
         BVS   L01CFDD
         EOR   #$8000
L01CFDD  BPL   L01CFE9
         PEI   $FF
         PEI   $FD
         JSL   L01DBBE
         PLY
         PLY
L01CFE9  LDA   #$0000
L01CFEC  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01CFF6  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         SEC
         SBC   #$0041
         BVS   L01D00C
         EOR   #$8000
L01D00C  BPL   L01D025
         LDA   $FF
         SEC
         SBC   #$005A
         BEQ   L01D01D
         BVS   L01D01B
         EOR   #$8000
L01D01B  BMI   L01D025
L01D01D  LDA   $FF
         SEC
         SBC   #$FFE0
         STA   $FF
L01D025  LDA   $FF
         TAY
         TDC
         CLC
         ADC   #$00F9
         TCS
         TYA
         PLD
         RTL

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

L01D049  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         LDA   #$0000
         TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L01D061  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         LDY   #$000A
         LDA   [$FD],Y
         TAX
         LDY   #$0008
         LDA   [$FD],Y
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDA   [$F2]
         DEC
         STA   [$F2]
         SEC
         SBC   #$0000
         BEQ   L01D09C
         BVS   L01D097
         EOR   #$8000
L01D097  BPL   L01D09C
         BRL   L01D104
L01D09C  LDY   #$000A
         LDA   [$FD],Y
         TAX
         LDY   #$0008
         LDA   [$FD],Y
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         STAL  L02EB29
         PEA   $0014
         PEA   ^L02EB29
         PEA   L02EB29
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01D0DD
         LDA   L050002
         LDY   #$0002
         STA   [$FD],Y
L01D0DD  LDA   L050002
         STA   $F0
         LDY   #$000A
         LDA   [$FD],Y
         TAX
         LDY   #$0008
         LDA   [$FD],Y
         PHX
         PHA
         _DisposeHandle
         LDA   $F0
         STA   L050002
L01D104  LDA   L050002
         CMP   #$0000
         BNE   L01D111
         LDA   #$0000
         BRA   L01D114
L01D111  LDA   #$0009
L01D114  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01D11E  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E6
         TCS
         LDA   $FB
         BRL   L01D48B
L01D12E  LDA   #$0000
         LDY   #$0002
         STA   [$F7],Y
         LDA   #$0016
         BRL   L01D4BC
L01D13C  LDY   #$000A
         LDA   [$F7],Y
         TAX
         LDY   #$0008
         LDA   [$F7],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         STA   $EA
         LDA   $EA
         STAL  L02EB3D
         PEA   $0019
         PEA   ^L02EB3D
         PEA   L02EB3D
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01D17F
         LDA   #$001D
         BRL   L01D4BC
L01D17F  LDA   $EA
         STAL  L02EB37
         LDA   [$FD]
         BRL   L01D228
L01D18A  LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHA
         TXA
         STAL  L02EB3B
         PLA
         STAL  L02EB39
         BRL   L01D235
L01D1A3  PEA   $0017
         PEA   ^L02EB37
         PEA   L02EB37
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01D1BB
         BRL   L01D235
L01D1BB  LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHX
         PHA
         LDAL  L02EB3B
         TAX
         LDAL  L02EB39
         JSL   L0198A5
         PLA
         PLX
         PHA
         TXA
         STAL  L02EB3B
         PLA
         STAL  L02EB39
         BRL   L01D235
L01D1E5  LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         PHX
         PHA
         LDAL  L02EB41
         TAX
         LDAL  L02EB3F
         JSL   L0198A5
         PLA
         PLX
         PHA
         TXA
         STAL  L02EB3B
         PLA
         STAL  L02EB39
         BRL   L01D235
L01D20F  LDA   #$0000
         LDY   #$0002
         STA   [$F7],Y
         LDA   #$0016
         BRL   L01D4BC
         BRL   L01D235
L01D220  DA    L01D18A
         DA    L01D1A3
         DA    L01D1E5
         DA    L01D20F
L01D228  CMP   #$0003
         BCC   L01D230
         LDA   #$0003
L01D230  ASL
         TAX
         JMP   (L01D220,X)

L01D235  LDA   L050002
         CMP   #$0000
         BEQ   L01D247
         LDA   [$FD]
         CMP   #$0000
         BEQ   L01D247
         BRL   L01D2D9
L01D247  SEC
         LDAL  L02EB39
         SBCL  L02EB3F
         BNE   L01D25C
         LDAL  L02EB3B
         SBCL  L02EB41
         BRA   L01D266
L01D25C  LDAL  L02EB3B
         SBCL  L02EB41
         REP   #$02
L01D266  BNE   L01D26B
         BRL   L01D2CC
L01D26B  BVS   L01D270
         EOR   #$8000
L01D270  BMI   L01D275
         BRL   L01D2CC
L01D275  LDA   [$FD]
         CMP   #$0002
         BEQ   L01D29D
         LDA   $EA
         STAL  L02EB3D
         PEA   $0019
         PEA   ^L02EB3D
         PEA   L02EB3D
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01D29D
         LDA   #$001D
         BRL   L01D4BC
L01D29D  LDAL  L02EB3B
         TAX
         LDAL  L02EB39
         PHA
         TXA
         STAL  L02EB41
         PLA
         STAL  L02EB3F
         PEA   $0018
         PEA   ^L02EB3D
         PEA   L02EB3D
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01D2CC
         LDA   #$001D
         BRL   L01D4BC
L01D2CC  PEA   $0016
         PEA   ^L02EB37
         PEA   L02EB37
         JSL   L01A356
L01D2D9  LDA   L050002
         CMP   #$0000
         BEQ   L01D2EF
         LDA   L050002
         LDY   #$0002
         STA   [$F7],Y
         LDA   #$001D
         BRL   L01D4BC
L01D2EF  LDAL  L02EB3B
         TAX
         LDAL  L02EB39
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         BRL   L01D49C
L01D308  LDY   #$000A
         LDA   [$F7],Y
         TAX
         LDY   #$0008
         LDA   [$F7],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDA   [$EC]
         INC
         STA   [$EC]
         BRL   L01D49C
L01D32B  LDA   #$0000
         LDY   #$0002
         STA   [$F7],Y
         LDA   #$0016
         BRL   L01D4BC
L01D339  LDY   #$000A
         LDA   [$F7],Y
         TAX
         LDY   #$0008
         LDA   [$F7],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         STA   [$FD]
         BRL   L01D49C
L01D35E  LDY   #$000A
         LDA   [$F7],Y
         TAX
         LDY   #$0008
         LDA   [$F7],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         STAL  L02EB3D
         PEA   $0019
         PEA   ^L02EB3D
         PEA   L02EB3D
         JSL   L01A356
         LDAL  L02EB41
         TAX
         LDAL  L02EB3F
         LDY   #$0002
         PHA
         TXA
         STA   [$FD],Y
         PLA
         STA   [$FD]
         BRL   L01D49C
L01D3A5  LDY   #$000A
         LDA   [$F7],Y
         TAX
         LDY   #$0008
         LDA   [$F7],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         STAL  L02EB3D
         LDX   $FF
         LDA   $FD
         PHA
         TXA
         STAL  L02EB41
         PLA
         STAL  L02EB3F
         PEA   $0018
         PEA   ^L02EB3D
         PEA   L02EB3D
         JSL   L01A356
         BRL   L01D49C
L01D3E8  LDY   #$000A
         LDA   [$F7],Y
         TAX
         LDY   #$0008
         LDA   [$F7],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         STAL  L02EB37
         PEA   $0017
         PEA   ^L02EB37
         PEA   L02EB37
         JSL   L01A356
         LDAL  L02EB3B
         TAX
         LDAL  L02EB39
         LDY   #$0002
         PHA
         TXA
         STA   [$FD],Y
         PLA
         STA   [$FD]
         BRL   L01D49C
L01D42F  LDY   #$000A
         LDA   [$F7],Y
         TAX
         LDY   #$0008
         LDA   [$F7],Y
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         TAX
         LDA   [$EC]
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         STAL  L02EB37
         LDX   $FF
         LDA   $FD
         PHA
         TXA
         STAL  L02EB3B
         PLA
         STAL  L02EB39
         PEA   $0016
         PEA   ^L02EB37
         PEA   L02EB37
         JSL   L01A356
         BRL   L01D49C
         BRL   L01D49C
L01D475  DA    L01D13C
         DA    L01D308
         DA    L01D12E
         DA    L01D32B
         DA    L01D12E
         DA    L01D339
         DA    L01D3A5
         DA    L01D35E
         DA    L01D42F
         DA    L01D3E8
         DA    L01D12E
L01D48B  SEC
         SBC   #$6600
         CMP   #$000A
         BCC   L01D497
         LDA   #$000A
L01D497  ASL
         TAX
         JMP   (L01D475,X)

L01D49C  LDA   L050002
         CMP   #$0000
         BEQ   L01D4AC
         LDA   L050002
         LDY   #$0002
         STA   [$F7],Y
L01D4AC  LDA   L050002
         CMP   #$0000
         BNE   L01D4B9
         LDA   #$0000
         BRA   L01D4BC
L01D4B9  LDA   #$0016
L01D4BC  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L01D4C6  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDY   #$000A
         LDA   [$FD],Y
         TAX
         LDY   #$0008
         LDA   [$FD],Y
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         CMP   #$0002
         BNE   L01D567
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         PHX
         PHA
         PEA   $0000
         LDY   #$000C
         LDA   [$FD],Y
         PHA
         _ErrWriteBlock
         LDY   #$000C
         LDA   [$FD],Y
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$000A
         BNE   L01D565
         PEA   ^L02E97C
         PEA   L02E97C
         PEA   $0000
         PEA   $0001
         _ErrWriteBlock
L01D565  BRA   L01D5D6
L01D567  LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         PHX
         PHA
         PEA   $0000
         LDY   #$000C
         LDA   [$FD],Y
         PHA
         _TextWriteBlock
         LDY   #$000C
         LDA   [$FD],Y
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         JSL   L0198A5
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$000A
         BNE   L01D5D6
         PEA   ^L02E97E
         PEA   L02E97E
         PEA   $0000
         PEA   $0001
         _TextWriteBlock
L01D5D6  LDY   #$000C
         LDA   [$FD],Y
         LDX   #$0000
         PHX
         PHA
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         JSL   L0198A5
         PLA
         PLX
         LDY   #$0010
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$000E
         STA   [$FD],Y
         LDA   #$0000
         LDY   #$000C
         STA   [$FD],Y
         LDA   #$0000
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01D613  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EA
         TCS
         LDA   L05017C
         STA   $F0
         LDA   L050002
         STA   $EE
         LDA   L05018C
         BEQ   L01D63C
         STZ   L05018C
         PEA   ^L01DA4D
         PEA   L01DA4D
         JSL   L01DE93
         PLY
         PLY
L01D63C  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0004
         TAY
         BEQ   L01D665
         LDA   #$0000
         LDY   #$000E
         STA   [$FD],Y
         LDX   #$0000
         LDA   #$0000
         LDY   #$0008
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0006
         STA   [$FD],Y
         BRL   L01D796
L01D665  LDY   #$000E
         LDA   [$FD],Y
         CMP   #$0000
         BNE   L01D6CD
         LDX   #$0000
         LDA   #$0000
         LDY   #$0008
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0006
         STA   [$FD],Y
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0040
         TAY
         BEQ   L01D697
         LDA   #$0064
         LDY   #$000E
         STA   [$FD],Y
         BRA   L01D6CD
L01D697  PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         PEA   $6603
         LDY   #$0012
         LDA   [$FD],Y
         PHA
         JSL   L01E4EA
         PLY
         PLY
         PLY
         PLY
         SEC
         SBC   #$0000
         BVS   L01D6BA
         EOR   #$8000
L01D6BA  BPL   L01D6C5
         LDA   $EC
         LDY   #$000E
         STA   [$FD],Y
         BRA   L01D6CD
L01D6C5  LDA   #$0400
         LDY   #$000E
         STA   [$FD],Y
L01D6CD  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         JSL   L01A847
         BEQ   L01D6E9
         BRL   L01D796
L01D6E9  LDY   #$000E
         LDA   [$FD],Y
         LDX   #$0000
         PHX
         PHA
         JSL   L01A6FE
         PLY
         PLY
         LDY   #$0008
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0006
         STA   [$FD],Y
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         JSL   L01A847
         BNE   L01D761
         LDY   #$000E
         LDA   [$FD],Y
         CMP   #$0064
         BEQ   L01D761
         BCC   L01D761
         LDY   #$000E
         LDA   [$FD],Y
         CMP   #$0400
         BEQ   L01D73C
         BCC   L01D73C
         LDA   #$0400
         BRA   L01D73F
L01D73C  LDA   #$0064
L01D73F  LDY   #$000E
         STA   [$FD],Y
         LDY   #$000E
         LDA   [$FD],Y
         LDX   #$0000
         PHX
         PHA
         JSL   L01A6FE
         PLY
         PLY
         LDY   #$0008
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0006
         STA   [$FD],Y
L01D761  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         JSL   L01A847
         BEQ   L01D789
         LDY   #$0010
         LDA   [$FD],Y
         ORA   #$0008
         LDY   #$0010
         STA   [$FD],Y
         BRA   L01D796
L01D789  LDY   #$0010
         LDA   [$FD],Y
         ORA   #$0004
         LDY   #$0010
         STA   [$FD],Y
L01D796  LDY   #$000E
         LDA   [$FD],Y
         LDX   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         JSL   L0198A5
         PLA
         PLX
         LDY   #$000C
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$000A
         STA   [$FD],Y
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         PEA   $0000
         PEA   $6602
         LDY   #$0012
         LDA   [$FD],Y
         PHA
         JSL   L01E4EA
         PLY
         PLY
         PLY
         SEC
         SBC   #$0000
         BVS   L01D7F2
         EOR   #$8000
L01D7F2  BPL   L01D801
         LDY   #$0010
         LDA   [$FD],Y
         ORA   #$0100
         LDY   #$0010
         STA   [$FD],Y
L01D801  LDA   $F0
         STA   L05017C
         LDA   $EE
         STA   L050002
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01D815  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   #$0000
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01D82D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EA
         TCS
         LDA   [$FD]
         AND   #$0008
         TAY
         BNE   L01D843
         BRL   L01D8DA
L01D843  LDY   #$000A
         LDA   [$FD],Y
         TAX
         LDY   #$0008
         LDA   [$FD],Y
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         STAL  L02EB3D
         PEA   $0019
         PEA   ^L02EB3D
         PEA   L02EB3D
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01D87F
         BRL   L01D8DA
L01D87F  LDY   #$000A
         LDA   [$FD],Y
         TAX
         LDY   #$0008
         LDA   [$FD],Y
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         STAL  L02EB37
         LDAL  L02EB41
         TAX
         LDAL  L02EB3F
         PHA
         TXA
         STAL  L02EB3B
         PLA
         STAL  L02EB39
         PEA   $0016
         PEA   ^L02EB37
         PEA   L02EB37
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01D8DA
         LDA   L050002
         LDY   #$0002
         STA   [$FD],Y
         LDA   #$001D
         BRL   L01D9E5
L01D8DA  LDA   [$FD]
         AND   #$0020
         TAY
         BNE   L01D92A
         LDY   #$000C
         LDA   [$FD],Y
         STA   $F0
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         STX   $EE
         STA   $EC
         BRA   L01D91B
L01D8FA  LDA   [$EC]
         AND   #$00FF
         CMP   #$000A
         BNE   L01D90D
         LDA   #$000D
         SEP   #$20
         STA   [$EC]
         REP   #$20
L01D90D  LDA   $F0
         DEC   $F0
         LDX   $EE
         LDA   $EC
         INC   $EC
         BNE   L01D91B
         INC   $EE
L01D91B  LDA   $F0
         SEC
         SBC   #$0000
         BEQ   L01D92A
         BVS   L01D928
         EOR   #$8000
L01D928  BMI   L01D8FA
L01D92A  LDY   #$000A
         LDA   [$FD],Y
         TAX
         LDY   #$0008
         LDA   [$FD],Y
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         STAL  L02EB29
         LDY   #$000C
         LDA   [$FD],Y
         LDX   #$0000
         PHA
         TXA
         STAL  L02EB31
         PLA
         STAL  L02EB2F
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         PHA
         TXA
         STAL  L02EB2D
         PLA
         STAL  L02EB2B
         PEA   $0013
         PEA   ^L02EB29
         PEA   L02EB29
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BNE   L01D9CD
         LDY   #$000C
         LDA   [$FD],Y
         LDX   #$0000
         SEC
         SBCL  L02EB33
         PHA
         TXA
         SBCL  L02EB35
         TAX
         PLA
         LDY   #$000C
         STA   [$FD],Y
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         CLC
         ADCL  L02EB33
         PHA
         TXA
         ADCL  L02EB35
         TAX
         PLA
         LDY   #$0010
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$000E
         STA   [$FD],Y
         BRA   L01D9D5
L01D9CD  LDA   L050002
         LDY   #$0002
         STA   [$FD],Y
L01D9D5  LDA   L050002
         CMP   #$0000
         BNE   L01D9E2
         LDA   #$0000
         BRA   L01D9E5
L01D9E2  LDA   #$0005
L01D9E5  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01D9EF  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         LDA   $FB
         BRL   L01DA32
L01D9FF  LDA   #$0000
         STA   [$FD]
         LDX   #$0000
         LDA   #$0000
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         LDA   #$0000
         BRL   L01DA43
L01DA1D  LDA   #$0000
         BRL   L01DA43
L01DA23  LDA   #$0016
         BRL   L01DA43
         BRL   L01DA43
L01DA2C  DA    L01D9FF
         DA    L01DA1D
         DA    L01DA23
L01DA32  SEC
         SBC   #$6600
         CMP   #$0002
         BCC   L01DA3E
         LDA   #$0002
L01DA3E  ASL
         TAX
         JMP   (L01DA2C,X)

L01DA43  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L01DA4D  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         LDA   #L02EC44
         LDX   #^L02EC44
         STX   $F4
         STA   $F2
         BRA   L01DA7A
L01DA64  PEI   $F4
         PEI   $F2
         JSL   L01DD14
         PLY
         PLY
         LDA   $F2
         CLC
         ADC   #$0014
         STA   $F2
         BCC   L01DA7A
         INC   $F4
L01DA7A  SEC
         LDA   $F2
         SBC   L05017E
         BNE   L01DA89
         LDA   $F4
         SBC   L05017E+2
         BRA   L01DA90
L01DA89  LDA   $F4
         SBC   L05017E+2
         REP   #$02
L01DA90  BVS   L01DA95
         EOR   #$8000
L01DA95  BPL   L01DA64
         TAY
         TDC
         CLC
         ADC   #$00FB
         TCS
         TYA
         PLD
         RTL

L01DAA1  PHD
         TSC
         SEC
         SBC   #$00E5
         TCD
         ADC   #$00DA
         TCS
         LDA   $FF
         STA   $DC
         LDA   $F5
         STA   $DE
         PEA   ^L02EDD4
         PEA   L02EDD4
         PEI   $F3
         PEI   $F1
         PEI   $EF
         PEI   $ED
         PEI   $EB
         PEA   $0000
         TDC
         CLC
         ADC   #$00DC
         PHA
         JSL   L01E015
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         LDAL  L02EDD9
         AND   #$00FF
         BRL   L01DB24
L01DAE3  BRL   L01DB3B
L01DAE6  PEA   $0000
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEA   $0013
         PEI   $F3
         PEI   $F1
         PEI   $EF
         PEI   $ED
         PEI   $EB
         JSL   L01DAA1
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         BRL   L01DB6C
L01DB0D  LDA   #$0000
         STAL  L02EDD6
L01DB14  LDAL  L02EDD8
         AND   #$00FF
         CLC
         ADCL  L02EDD6
         STA   [$F7]
         BRA   L01DB3B
L01DB24  CMP   #$0030
         BEQ   L01DB0D
         CMP   #$003F
         BEQ   L01DAE6
         CMP   #$0049
         BEQ   L01DAE3
         CMP   #$004E
         BEQ   L01DAE3
         JMP   L01DB14

L01DB3B  LDAL  L02EDD4
         STA   [$FB]
         LDAL  L02EDD8
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L02EDD9
         LDX   #^L02EDD9
         JSL   L0198A5
         PLA
         PLX
         STA   $E0
         STX   $E2
         LDA   #$0000
         SEP   #$20
         STA   [$E0]
         REP   #$20
         LDA   #L02EDD9
         LDX   #^L02EDD9
L01DB6C  TAY
         TDC
         CLC
         ADC   #$00E5
         TCS
         TYA
         PLD
         RTL

L01DB76  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDY   #$000C
         LDA   [$FD],Y
         LDX   #$0000
         PHX
         PHA
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         JSL   L0198A5
         PLA
         PLX
         LDY   #$0010
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$000E
         STA   [$FD],Y
         LDA   #$0000
         LDY   #$000C
         STA   [$FD],Y
         LDA   #$0000
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01DBBE  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         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
         STA   $F0
         SEC
         SBC   #$0000
         BVS   L01DBF2
         EOR   #$8000
L01DBF2  BMI   L01DC0E
         LDY   #$000C
         LDA   [$FD],Y
         TAX
         LDY   #$000A
         LDA   [$FD],Y
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         BRA   L01DC20
L01DC0E  LDA   [$FD]
         SEC
         SBC   $F0
         BEQ   L01DC20
         BVS   L01DC1A
         EOR   #$8000
L01DC1A  BPL   L01DC20
         LDA   $F0
         STA   [$FD]
L01DC20  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01DC2A  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EA
         TCS
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         STX   $F0
         STA   $EE
         PHX
         PHA
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         JSL   L019EF2
         PLA
         PLX
         STA   $EC
         LDX   $F0
         LDA   $EE
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0044
         TAY
         BEQ   L01DC7A
         LDA   #$0000
         BRA   L01DC7F
L01DC7A  LDY   #$000E
         LDA   [$FD],Y
L01DC7F  STA   [$FD]
         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   L01DCAB
         EOR   #$8000
L01DCAB  BMI   L01DCB2
         LDA   #$0000
         BRA   L01DCB4
L01DCB2  LDA   [$FD]
L01DCB4  PLX
         STX   $F2
         SEC
         SBC   $F2
         BEQ   L01DCCD
         BVS   L01DCC1
         EOR   #$8000
L01DCC1  BPL   L01DCCD
         PEI   $FF
         PEI   $FD
         JSL   L01DBBE
         PLY
         PLY
L01DCCD  LDA   $EC
         SEC
         SBC   #$0000
         BEQ   L01DD07
         BVS   L01DCDA
         EOR   #$8000
L01DCDA  BPL   L01DD07
         LDA   $EC
         PHA
         PEI   $F0
         PEI   $EE
         LDY   #$0012
         LDA   [$FD],Y
         PHA
         JSL   L019715
         PLY
         PLY
         PLY
         PLY
         CMP   $EC
         BEQ   L01DD07
         LDY   #$0010
         LDA   [$FD],Y
         ORA   #$0020
         LDY   #$0010
         STA   [$FD],Y
         LDA   #$FFFF
         BRA   L01DD0A
L01DD07  LDA   #$0000
L01DD0A  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01DD14  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         LDA   #$FFFF
         STA   $F0
         LDA   $FD
         CMP   #$0000
         BNE   L01DD38
         LDA   $FF
         CMP   #$0000
         BNE   L01DD38
         LDA   #$FFFF
         BRL   L01DDEE
L01DD38  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0083
         TAY
         BEQ   L01DD7A
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0004
         TAY
         BEQ   L01DD53
         LDA   #$0000
         BRA   L01DD5D
L01DD53  PEI   $FF
         PEI   $FD
         JSL   L01DDF8
         PLY
         PLY
L01DD5D  STA   $F0
         LDY   #$0012
         LDA   [$FD],Y
         PHA
         JSL   L019217
         PLY
         SEC
         SBC   #$0000
         BVS   L01DD73
         EOR   #$8000
L01DD73  BMI   L01DD7A
         LDA   #$FFFF
         STA   $F0
L01DD7A  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0008
         TAY
         BEQ   L01DDC7
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         PHX
         PHA
         _FindHandle
         _DisposeHandle
         LDX   #$0000
         LDA   #$0000
         LDY   #$0008
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0006
         STA   [$FD],Y
L01DDC7  LDA   #$0000
         LDY   #$0010
         STA   [$FD],Y
         LDA   #$0000
         STA   [$FD]
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         LDY   #$0004
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0002
         STA   [$FD],Y
         LDA   $F0
L01DDEE  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01DDF8  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0002
         TAY
         BNE   L01DE18
         LDA   #$0000
         STA   [$FD]
         LDA   #$0000
         BRA   L01DE89
L01DE18  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0004
         TAY
         BNE   L01DE76
         LDY   #$0010
         LDA   [$FD],Y
         AND   #$0002
         TAY
         BEQ   L01DE76
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         JSL   L01A847
         BEQ   L01DE76
         LDY   #$0008
         LDA   [$FD],Y
         TAX
         LDY   #$0006
         LDA   [$FD],Y
         PHX
         PHA
         LDY   #$0004
         LDA   [$FD],Y
         TAX
         LDY   #$0002
         LDA   [$FD],Y
         JSL   L01A847
         BVS   L01DE68
         EOR   #$8000
L01DE68  BMI   L01DE76
         PEI   $FF
         PEI   $FD
         JSL   L01DC2A
         PLY
         PLY
         BRA   L01DE18
L01DE76  LDY   #$0010
         LDA   [$FD],Y
         AND   #$0020
         TAY
         BEQ   L01DE86
         LDA   #$FFFF
         BRA   L01DE89
L01DE86  LDA   #$0000
L01DE89  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01DE93  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         LDAL  L02EA92+2
         TAX
         LDAL  L02EA92
         STA   $F2
         STX   $F4
         LDX   $F4
         LDA   #$0010
         CLC
         ADC   $F2
         BCC   L01DEB6
         INX
L01DEB6  STX   $F0
         STA   $EE
         BRA   L01DEF1
L01DEBC  LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         JSL   L01A847
         BNE   L01DEE5
         LDX   $FF
         LDA   $FD
         LDY   #$0002
         PHA
         TXA
         STA   [$EE],Y
         PLA
         STA   [$EE]
         LDA   #$0000
         BRA   L01DF1F
L01DEE5  LDA   $EE
         CLC
         ADC   #$0004
         STA   $EE
         BCC   L01DEF1
         INC   $F0
L01DEF1  LDAL  L02EA92+2
         TAX
         LDAL  L02EA92
         STA   $F2
         STX   $F4
         LDX   $F4
         LDA   #$0028
         CLC
         ADC   $F2
         BCC   L01DF09
         INX
L01DF09  PHX
         PHA
         LDX   $F0
         LDA   $EE
         JSL   L01A847
         BEQ   L01DF1C
         BVS   L01DF1A
         EOR   #$8000
L01DF1A  BMI   L01DEBC
L01DF1C  LDA   #$0001
L01DF1F  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01DF29  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   L050182
         SEC
         SBC   #$0000
         BEQ   L01DF44
         BVS   L01DF42
         EOR   #$8000
L01DF42  BMI   L01DF63
L01DF44  PEA   $0100
         PEA   ^L02E980
         PEA   L02E980
         JSL   L01E68B
         PLY
         PLY
         PLY
         STA   L050182
         LDA   #L02E980
         LDX   #^L02E980
         STX   L050186
         STA   L050184
L01DF63  LDY   #$000C
         LDA   [$FD],Y
         CMP   #$0000
         BNE   L01DF70
         BRL   L01E008
L01DF70  BCS   L01DF75
         BRL   L01E008
L01DF75  LDA   L050182
         SEC
         SBC   #$0000
         BNE   L01DF81
         BRL   L01E008
L01DF81  BVS   L01DF86
         EOR   #$8000
L01DF86  BMI   L01DF8B
         BRL   L01E008
L01DF8B  LDX   L050186
         LDA   L050184
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$0000
         BNE   L01DFA2
         BRL   L01E008
L01DFA2  LDX   L050186
         LDA   L050184
         PHX
         PHA
         CLC
         ADC   #$0001
         STA   L050184
         LDA   L050186
         BCC   L01DFB7
         INC
L01DFB7  STA   L050186
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         PHX
         PHA
         CLC
         ADC   #$0001
         LDY   #$000E
         STA   [$FD],Y
         LDY   #$0010
         LDA   [$FD],Y
         BCC   L01DFE1
         INC
L01DFE1  LDY   #$0010
         STA   [$FD],Y
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         SEP   #$20
         STA   [$F2]
         REP   #$20
         LDY   #$000C
         LDA   [$FD],Y
         DEC
         LDY   #$000C
         STA   [$FD],Y
         LDA   L050182
         DEC
         STA   L050182
         BRL   L01DF63
L01E008  LDA   #$0000
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01E015  PHD
         TSC
         SEC
         SBC   #$00E9
         TCD
         ADC   #$00E2
         TCS
         PEI   $F1
         PEI   $EF
         PEA   $0000
         TDC
         CLC
         ADC   #$00F3
         PHA
         PEI   $FF
         PEI   $FD
         PEA   $000B
         _SANEFP816
         TDC
         CLC
         ADC   #$00E9
         TCS
         PLD
         RTL

L01E04C  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
         LDY   #$000A
         LDA   [$FD],Y
         TAX
         LDY   #$0008
         LDA   [$FD],Y
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         STAL  L02EB29
         LDY   #$000C
         LDA   [$FD],Y
         LDX   #$0000
         PHA
         TXA
         STAL  L02EB31
         PLA
         STAL  L02EB2F
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         PHA
         TXA
         STAL  L02EB2D
         PLA
         STAL  L02EB2B
         PEA   $0012
         PEA   ^L02EB29
         PEA   L02EB29
         JSL   L01A356
         LDA   [$FD]
         AND   #$0020
         TAY
         BNE   L01E105
         LDAL  L02EB35
         TAX
         LDAL  L02EB33
         STA   $EE
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         STX   $EC
         STA   $EA
         BRA   L01E0F6
L01E0D5  LDA   [$EA]
         AND   #$00FF
         CMP   #$000D
         BNE   L01E0E8
         LDA   #$000A
         SEP   #$20
         STA   [$EA]
         REP   #$20
L01E0E8  LDA   $EE
         DEC   $EE
         LDX   $EC
         LDA   $EA
         INC   $EA
         BNE   L01E0F6
         INC   $EC
L01E0F6  LDA   $EE
         SEC
         SBC   #$0000
         BEQ   L01E105
         BVS   L01E103
         EOR   #$8000
L01E103  BMI   L01E0D5
L01E105  LDA   L050002
         CMP   #$004C
         BNE   L01E111
         STZ   $F0
         BRA   L01E116
L01E111  LDA   L050002
         STA   $F0
L01E116  LDA   $F0
         CMP   #$0000
         BNE   L01E15E
         LDY   #$000C
         LDA   [$FD],Y
         LDX   #$0000
         SEC
         SBCL  L02EB33
         PHA
         TXA
         SBCL  L02EB35
         TAX
         PLA
         LDY   #$000C
         STA   [$FD],Y
         LDY   #$0010
         LDA   [$FD],Y
         TAX
         LDY   #$000E
         LDA   [$FD],Y
         CLC
         ADCL  L02EB33
         PHA
         TXA
         ADCL  L02EB35
         TAX
         PLA
         LDY   #$0010
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$000E
         STA   [$FD],Y
         BRA   L01E165
L01E15E  LDA   $F0
         LDY   #$0002
         STA   [$FD],Y
L01E165  LDA   $F0
         CMP   #$0000
         BNE   L01E171
         LDA   #$0000
         BRA   L01E174
L01E171  LDA   #$0005
L01E174  TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01E17E  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   #$0000
         TAY
         TDC
         CLC
         ADC   #$00F7
         TCS
         TYA
         PLD
         RTL

L01E196  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         PEA   $0001
         PEA   $0000
         PEA   ^L02E973
         PEA   L02E973
         PEI   $F9
         PEI   $F7
         JSL   L01A755
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BNE   L01E1C6
         LDA   #$FFFF
         BRL   L01E1E0
L01E1C6  LDA   $FB
         BRL   L01E1D8
L01E1CB  LDA   #$4016
         BRL   L01E1E0
L01E1D1  LDA   #$0000
         BRA   L01E1E0
         BRA   L01E1E0
L01E1D8  CMP   #$6400
         BEQ   L01E1D1
         JMP   L01E1CB

L01E1E0  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L01E1EA  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         SEC
         LDA   $F7
         SBC   #$0000
         BNE   L01E204
         LDA   $F9
         SBC   #$0000
         BRA   L01E20B
L01E204  LDA   $F9
         SBC   #$0000
         REP   #$02
L01E20B  BEQ   L01E217
         LDA   [$F7]
         AND   #$00FF
         CMP   #$0000
         BNE   L01E21D
L01E217  LDA   #$4016
         BRL   L01E366
L01E21D  LDA   $FB
         BRL   L01E333
L01E222  LDA   #$4016
         BRL   L01E366
L01E228  PEI   $F9
         PEI   $F7
         PEI   $FF
         PEI   $FD
         JSL   L01E7FA
         PLY
         PLY
         PLY
         PLY
         BRL   L01E366
L01E23B  PEI   $F9
         PEI   $F7
         JSL   L019823
         PLY
         PLY
         LDX   $F9
         LDA   $F7
         PHA
         TXA
         STAL  L02EAFF
         PLA
         STAL  L02EAFD
         PEA   $0002
         PEA   ^L02EAFD
         PEA   L02EAFD
         JSL   L01A356
         PEI   $F9
         PEI   $F7
         JSL   L01C3DE
         PLY
         PLY
         BRL   L01E344
L01E26E  PEI   $F9
         PEI   $F7
         JSL   L019823
         PLY
         PLY
         PEI   $FF
         PEI   $FD
         JSL   L019823
         PLY
         PLY
         LDX   $F9
         LDA   $F7
         PHA
         TXA
         STAL  L02EAFF
         PLA
         STAL  L02EAFD
         LDX   $FF
         LDA   $FD
         PHA
         TXA
         STAL  L02EB03
         PLA
         STAL  L02EB01
         PEA   $0004
         PEA   ^L02EAFD
         PEA   L02EAFD
         JSL   L01A356
         PEI   $F9
         PEI   $F7
         JSL   L01C3DE
         PLY
         PLY
         PEI   $FF
         PEI   $FD
         JSL   L01C3DE
         PLY
         PLY
         BRL   L01E344
L01E2C4  PEI   $F9
         PEI   $F7
         JSL   L019823
         PLY
         PLY
         LDX   $F9
         LDA   $F7
         PHA
         TXA
         STAL  L02EB07
         PLA
         STAL  L02EB05
         PEA   $0006
         PEA   ^L02EB05
         PEA   L02EB05
         JSL   L01A356
         LDA   $FB
         CMP   #$6403
         BNE   L01E2FB
         LDX   $FF
         LDA   $FD
         STAL  L02EB0B
         BRA   L01E30A
L01E2FB  LDX   $FF
         LDA   $FD
         PHA
         TXA
         STAL  L02EB0F
         PLA
         STAL  L02EB0D
L01E30A  PEA   $0005
         PEA   ^L02EB05
         PEA   L02EB05
         JSL   L01A356
         PEI   $F9
         PEI   $F7
         JSL   L01C3DE
         PLY
         PLY
         BRL   L01E344
         BRL   L01E344
L01E327  DA    L01E228
         DA    L01E23B
         DA    L01E26E
         DA    L01E2C4
         DA    L01E2C4
         DA    L01E222
L01E333  SEC
         SBC   #$6400
         CMP   #$0005
         BCC   L01E33F
         LDA   #$0005
L01E33F  ASL
         TAX
         JMP   (L01E327,X)

L01E344  LDA   L050002
         CMP   #$0000
         BNE   L01E351
         LDA   #$0000
         BRA   L01E366
L01E351  LDA   L050002
         PHA
         LDA   #$8000
         PLX
         STX   $F0
         ORA   $F0
         PHA
         LDA   #$4000
         PLX
         STX   $F0
         ORA   $F0
L01E366  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L01E370  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E4
         TCS
         PEA   $0001
         PEA   $0000
         PEA   ^L02E956
         PEA   L02E956
         PEI   $F9
         PEI   $F7
         JSL   L01A755
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BEQ   L01E3A0
         LDA   #$0000
         BRL   L01E4E0
L01E3A0  PEA   $0001
         PEA   $0000
         PEA   ^L02E95C
         PEA   L02E95C
         PEI   $F9
         PEI   $F7
         JSL   L01A755
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BEQ   L01E3C4
         STZ   $EA
         BRL   L01E416
L01E3C4  PEA   $0001
         PEA   $0000
         PEA   ^L02E963
         PEA   L02E963
         PEI   $F9
         PEI   $F7
         JSL   L01A755
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BEQ   L01E3EA
         LDA   #$0001
         STA   $EA
         BRA   L01E416
L01E3EA  PEA   $0001
         PEA   $0000
         PEA   ^L02E96B
         PEA   L02E96B
         PEI   $F9
         PEI   $F7
         JSL   L01A755
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BEQ   L01E410
         LDA   #$0002
         STA   $EA
         BRA   L01E416
L01E410  LDA   #$FFFF
         BRL   L01E4E0
L01E416  LDA   $FB
         CMP   #$6400
         BEQ   L01E423
         LDA   #$4016
         BRL   L01E4E0
L01E423  LDA   [$FD]
         AND   #$0500
         CMP   #$0500
         BNE   L01E433
         LDA   #$4011
         BRL   L01E4E0
L01E433  PEA   $0000
         TDC
         CLC
         ADC   #$00EA
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $E8
         STA   $E6
         LDA   $E6
         CMP   #$0000
         BNE   L01E45A
         LDA   $E8
         CMP   #$0000
         BNE   L01E45A
         LDA   #$4009
         BRL   L01E4E0
L01E45A  LDA   [$FD]
         PHA
         LDA   [$E6]
         PLX
         STX   $F0
         AND   $F0
         AND   #$0003
         PHA
         LDA   [$FD]
         AND   #$0003
         PLX
         STX   $EC
         CMP   $EC
         BEQ   L01E479
         LDA   #$400D
         BRA   L01E4E0
L01E479  PEA   $0000
         PEA   $6601
         PEI   $E8
         PEI   $E6
         LDY   #$0006
         LDA   [$E6],Y
         TAX
         LDY   #$0004
         LDA   [$E6],Y
         STA   $EC
         STX   $EE
         LDY   #$0016
         LDA   [$EC],Y
         TAX
         LDY   #$0014
         LDA   [$EC],Y
         STA   $EC
         STX   $EE
         LDA   $EC
         LDX   $EE
         JSL   L01A615
         PLY
         PLY
         PLY
         PLY
         LDY   #$0006
         LDA   [$E6],Y
         TAX
         LDY   #$0004
         LDA   [$E6],Y
         LDY   #$0006
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0004
         STA   [$FD],Y
         LDY   #$000A
         LDA   [$E6],Y
         TAX
         LDY   #$0008
         LDA   [$E6],Y
         LDY   #$000A
         PHA
         TXA
         STA   [$FD],Y
         PLA
         LDY   #$0008
         STA   [$FD],Y
         LDA   #$0000
L01E4E0  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L01E4EA  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00DE
         TCS
         LDA   $F9
         SEC
         SBC   #$0000
         BVS   L01E500
         EOR   #$8000
L01E500  BMI   L01E514
         PEA   $0000
         PEA   $0016
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRL   L01E681
L01E514  PEA   $0000
         TDC
         CLC
         ADC   #$00F9
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $EC
         STA   $EA
         LDA   $EA
         CMP   #$0000
         BNE   L01E53B
         LDA   $EC
         CMP   #$0000
         BNE   L01E53B
         LDA   #$FFFF
         BRL   L01E681
L01E53B  LDA   $FB
         BRL   L01E676
L01E540  PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $EC
         PEI   $EA
         LDY   #$0006
         LDA   [$EA],Y
         TAX
         LDY   #$0004
         LDA   [$EA],Y
         STA   $EE
         STX   $F0
         LDY   #$0016
         LDA   [$EE],Y
         TAX
         LDY   #$0014
         LDA   [$EE],Y
         STA   $EE
         STX   $F0
         LDA   $EE
         LDX   $F0
         JSL   L01A615
         PLY
         PLY
         PLY
         PLY
         PLY
         STA   $E2
         LDA   $E2
         CMP   #$0000
         BNE   L01E584
         LDA   #$0000
         BRL   L01E681
L01E584  LDY   #$0002
         LDA   [$EA],Y
         PHA
         PEI   $E2
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRL   L01E681
L01E598  LDX   $FF
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L01E5A5
         EOR   #$8000
L01E5A5  BMI   L01E5B9
         PEA   $0000
         PEA   $0009
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRL   L01E681
L01E5B9  LDX   $FF
         LDA   $FD
         PHA
         LDA   #$FFFF
         PLX
         STX   $F2
         SEC
         SBC   $F2
         STA   $E4
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $E8
         STA   $E6
         LDA   $E6
         CMP   #$0000
         BNE   L01E5F0
         LDA   $E8
         CMP   #$0000
         BNE   L01E5F0
         LDA   #$FFFF
         BRL   L01E681
L01E5F0  PEA   $0000
         TDC
         CLC
         ADC   #$00F9
         PHA
         JSL   L01A8CC
         PLY
         PLY
         STX   $EC
         STA   $EA
         LDA   $EA
         LDX   $EC
         PHX
         PHA
         LDA   $E8
         PHA
         LDA   $E6
         PHA
         PEA   $0012
         JSL   L01A872
         PLA
         PLA
         PLA
         PLA
         PLX
         PEA   $0000
         PEA   $6601
         PEI   $EC
         PEI   $EA
         LDY   #$0006
         LDA   [$EA],Y
         TAX
         LDY   #$0004
         LDA   [$EA],Y
         STA   $EE
         STX   $F0
         LDY   #$0016
         LDA   [$EE],Y
         TAX
         LDY   #$0014
         LDA   [$EE],Y
         STA   $EE
         STX   $F0
         LDA   $EE
         LDX   $F0
         JSL   L01A615
         PLY
         PLY
         PLY
         PLY
         STA   $E2
         LDA   $E2
         CMP   #$0000
         BEQ   L01E670
         LDA   #$0000
         STA   [$E6]
         LDY   #$0002
         LDA   [$EA],Y
         PHA
         PEI   $E2
         JSL   L01BE3B
         PLY
         PLY
         LDA   #$FFFF
         BRA   L01E681
L01E670  LDA   $E4
         BRA   L01E681
         BRA   L01E681
L01E676  CMP   #$6601
         BNE   L01E67E
         BRL   L01E598
L01E67E  JMP   L01E540

L01E681  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L01E68B  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EB
         TCS
         STZ   $EE
L01E698  LDA   $EE
         SEC
         SBC   $FF
         BVS   L01E6A2
         EOR   #$8000
L01E6A2  BPL   L01E6A7
         BRL   L01E7EE
L01E6A7  PHA
         PEA   $0001
         _ReadChar
         PLA
         SEP   #$20
         STA   $ED
         REP   #$20
         PHA
         LDX   $FD
         LDA   $FB
         INC   $FB
         BNE   L01E6CD
         INC   $FD
L01E6CD  STA   $F0
         STX   $F2
         PLA
         SEP   #$20
         STA   [$F0]
         REP   #$20
         INC   $EE
         LDA   $ED
         AND   #$00FF
         CMP   #$000D
         BNE   L01E716
         LDX   $FD
         LDA   $FB
         SEC
         SBC   #$0001
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         STA   $F0
         STX   $F2
         LDA   #$000A
         SEP   #$20
         STA   [$F0]
         REP   #$20
         PEA   $000A
         _WriteChar
         BRL   L01E7EE
L01E716  LDA   $ED
         AND   #$00FF
         CMP   #$0000
         BNE   L01E749
         PEA   $000D
         _WriteChar
         PEA   $000A
         _WriteChar
         BRL   L01E7EE
L01E749  LDA   $ED
         AND   #$00FF
         CMP   #$007F
         BEQ   L01E756
         BRL   L01E7EB
L01E756  LDA   $FB
         BNE   L01E75C
         DEC   $FD
L01E75C  DEC   $FB
         DEC   $EE
         PEA   $0008
         _WriteChar
         PEA   $0020
         _WriteChar
         PEA   $0008
         _WriteChar
         LDA   $EE
         SEC
         SBC   #$0000
         BEQ   L01E7EB
         BVS   L01E7A6
         EOR   #$8000
L01E7A6  BPL   L01E7EB
         LDA   $FB
         BNE   L01E7AE
         DEC   $FD
L01E7AE  DEC   $FB
         DEC   $EE
         PEA   $0008
         _WriteChar
         PEA   $0020
         _WriteChar
         PEA   $0008
         _WriteChar
L01E7EB  BRL   L01E698
L01E7EE  LDA   $EE
         TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

L01E7FA  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E6
         TCS
         STZ   $EA
         PEI   $FF
         PEI   $FD
         JSL   L019823
         PLY
         PLY
         LDA   [$F9]
         STA   $EC
         LDX   $FF
         LDA   $FD
         PHA
         TXA
         STAL  L02EB07
         PLA
         STAL  L02EB05
         PEA   $0006
         PEA   ^L02EB05
         PEA   L02EB05
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01E83C
         BRL   L01E8F2
L01E83C  LDA   $EC
         AND   #$0500
         CMP   #$0500
         BNE   L01E84E
         LDA   #$0011
         STA   $EA
         BRL   L01E8EF
L01E84E  LDA   $EC
         AND   #$0001
         TAY
         BEQ   L01E860
         LDAL  L02EB09
         AND   #$0001
         TAY
         BEQ   L01E872
L01E860  LDA   $EC
         AND   #$0002
         TAY
         BEQ   L01E87A
         LDAL  L02EB09
         AND   #$0002
         TAY
         BNE   L01E87A
L01E872  LDA   #$000D
         STA   $EA
         BRL   L01E8EF
L01E87A  LDX   $FF
         LDA   $FD
         PHA
         TXA
         STAL  L02EB23
         PLA
         STAL  L02EB21
         PEA   $0010
         PEA   ^L02EB1F
         PEA   L02EB1F
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01E8A1
         BRL   L01E8EF
L01E8A1  LDA   $EC
         AND   #$0200
         TAY
         BNE   L01E8AC
         BRL   L01E8EF
L01E8AC  LDX   #$0000
         LDA   #$0000
         PHA
         TXA
         STAL  L02EB41
         PLA
         STAL  L02EB3F
         LDAL  L02EB1F
         STAL  L02EB3D
         PEA   $0018
         PEA   ^L02EB3D
         PEA   L02EB3D
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01E8EF
         LDAL  L02EB1F
         STAL  L02EB29
         PEA   $0014
         PEA   ^L02EB29
         PEA   L02EB29
         JSL   L01A356
L01E8EF  BRL   L01E998
L01E8F2  LDA   L050002
         CMP   #$0046
         BEQ   L01E8FD
         BRL   L01E998
L01E8FD  LDA   $EC
         AND   #$0100
         TAY
         BNE   L01E908
         BRL   L01E998
L01E908  LDAL  L02EB09
         ORA   #$00C3
         STAL  L02EB09
         LDA   $EC
         AND   #$0020
         TAY
         BEQ   L01E924
         LDA   #$0000
         STAL  L02EB0B
         BRA   L01E92B
L01E924  LDA   #$0004
         STAL  L02EB0B
L01E92B  LDA   #$0000
         STAL  L02EB15
         STAL  L02EB13
         PEA   $0001
         PEA   ^L02EB05
         PEA   L02EB05
         JSL   L01A356
         LDA   L050002
         CMP   #$0000
         BEQ   L01E94E
         BRL   L01E998
L01E94E  LDX   $FF
         LDA   $FD
         PHA
         TXA
         STAL  L02EB23
         PLA
         STAL  L02EB21
         PEA   $0010
         PEA   ^L02EB1F
         PEA   L02EB1F
         JSL   L01A356
         LDA   L050002
         STA   $E8
         LDA   L050002
         CMP   #$0000
         BEQ   L01E998
         LDX   $FF
         LDA   $FD
         PHA
         TXA
         STAL  L02EAFF
         PLA
         STAL  L02EAFD
         PEA   $0002
         PEA   ^L02EAFD
         PEA   L02EAFD
         JSL   L01A356
         LDA   $E8
         STA   L050002
L01E998  PEI   $FF
         PEI   $FD
         JSL   L01C3DE
         PLY
         PLY
         LDA   L050002
         CMP   #$0000
         BEQ   L01E9C2
         LDA   L050002
         PHA
         LDA   #$8000
         PLX
         STX   $F2
         ORA   $F2
         STA   $EA
         LDA   L050002
         LDY   #$0002
         STA   [$F9],Y
         BRA   L01E9D1
L01E9C2  LDA   $EA
         CMP   #$0000
         BEQ   L01E9D1
         LDA   #$0000
         LDY   #$0002
         STA   [$F9],Y
L01E9D1  LDA   $EA
         CMP   #$0000
         BNE   L01EA53
         PHX
         PHA
         PEA   $0000
         PEA   $000E
         LDA   appID
         ORA   #$0F00
         PHA
         PEA   $8300
         PEA   $0000
         PEA   $0000
         _NewHandle
         PLA
         PLX
         LDY   #$000A
         PHA
         TXA
         STA   [$F9],Y
         PLA
         LDY   #$0008
         STA   [$F9],Y
         LDY   #$000A
         LDA   [$F9],Y
         TAX
         LDY   #$0008
         LDA   [$F9],Y
         STA   $EE
         STX   $F0
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         STA   $EE
         STX   $F0
         LDAL  L02EB1F
         LDY   #$0002
         STA   [$EE],Y
         LDY   #$000A
         LDA   [$F9],Y
         TAX
         LDY   #$0008
         LDA   [$F9],Y
         STA   $EE
         STX   $F0
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         STA   $EE
         STX   $F0
         LDA   #$0001
         STA   [$EE]
L01EA53  LDA   $EA
         CMP   #$0000
         BNE   L01EA5F
         LDA   #$0000
         BRA   L01EA6A
L01EA5F  LDA   $EA
         PHA
         LDA   #$4000
         PLX
         STX   $F2
         ORA   $F2
L01EA6A  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

