*
* Dugeon Master
* (c) 1987, FTL
* (s) 2016, Brutal Deluxe Software
*

         mx	%00
	rel
	dsk	DUNMAN.L
	lst	off

	use	DUNMAN.X

L060000  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E4
         TCS
         PEI   $FD
         JSL   L060C4E
         PLY
         STX   $F0
         STA   $EE
         LDY   #$0004
         LDA   [$EE],Y
         AND   #$00FF
         STA   $E6
         LDA   $FF
         LDX   #$0000
         STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300AE
         LDA   L0300AC
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
         LDY   #$0008
         LDA   [$EA],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         AND   #$001F
         LDX   #$0000
         PHX
         PHA
         LDY   #$0008
         LDA   [$EA],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$001F
         LDX   #$0000
         STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDA   $FF
         LDX   #$0000
         STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300B6
         LDA   L0300B4
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L021F00
         PLA
         PLX
         CLC
         ADC   #$0001
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $F0
         STA   $EE
         LDY   #$000C
         LDA   [$EA],Y
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         STA   $E8
         BRA   L0600F6
L0600D8  LDX   $F0
         LDA   $EE
         INC   $EE
         BNE   L0600E2
         INC   $F0
L0600E2  STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   $E6
         BNE   L0600F4
         LDA   #$0001
         BRA   L060108
L0600F4  DEC   $E8
L0600F6  LDA   $E8
         SEC
         SBC   #$0000
         BEQ   L060105
         BVS   L060103
         EOR   #$8000
L060103  BMI   L0600D8
L060105  LDA   #$0000
L060108  TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         PLD
         RTL

L060112  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         CMP   #$FFFF
         BNE   L06012A
         LDA   #$0000
         BRL   L060276
L06012A  PEI   $FF
         JSL   L060C4E
         PLY
         STX   $F0
         STA   $EE
         LDA   #$000A
         PHA
         LDA   $FF
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         BRL   L060263
L060147  LDY   #$0002
         LDA   [$EE],Y
         AND   #$007F
         PHA
         LDA   #$0006
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0508C4
         LDX   #^L0508C4
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $F2
         BRL   L060274
L060178  LDY   #$0002
         LDA   [$EE],Y
         AND   #$007F
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0509D8
         LDX   #^L0509D8
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $F2
         BRL   L060274
L0601A1  LDY   #$0002
         LDA   [$EE],Y
         AND   #$007F
         LDX   #$0000
         PHX
         PHA
         LDA   #L050AC0
         LDX   #^L050AC0
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $F2
         LDY   #$0002
         LDA   [$EE],Y
         AND   #$007F
         CMP   #$0001
         BNE   L0601F0
         LDY   #$0002
         LDA   [$EE],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         ASL
         PHA
         LDA   $F2
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $F2
L0601F0  BRL   L060274
L0601F3  LDA   #$0032
         STA   $F2
         LDY   #$0002
         LDA   [$EE],Y
         STA   $FF
L0601FF  LDA   $FF
         CMP   #$FFFE
         BEQ   L060223
         PEI   $FF
         JSL   L060112
         PLY
         PHA
         LDA   $F2
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $F2
         PEI   $FF
         JSL   L060D39
         PLY
         STA   $FF
         BRA   L0601FF
L060223  BRL   L060274
L060226  LDY   #$0002
         LDA   [$EE],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$007F
         CMP   #$0014
         BNE   L060242
         LDA   #$0001
         STA   $F2
         BRA   L060247
L060242  LDA   #$0003
         STA   $F2
L060247  BRL   L060274
L06024A  LDA   #$0001
         STA   $F2
         BRL   L060274
L060252  BRL   L060274
L060255  DA    L060147
         DA    L060178
         DA    L06024A
         DA    L060226
         DA    L0601F3
         DA    L0601A1
         DA    L060252
L060263  SEC
         SBC   #$0005
         CMP   #$0006
         BCC   L06026F
         LDA   #$0006
L06026F  ASL
         TAX
         JMP   (L060255,X)

L060274  LDA   $F2
L060276  TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PLD
         RTL

L060280  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         JSL   L060C4E
         PLY
         STX   $F2
         STA   $F0
         LDA   #$000A
         PHA
         LDA   $FF
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         BRL   L060337
L0602A8  LDA   #$0000
         BRL   L060348
L0602AE  LDY   #$0004
         LDA   [$F0],Y
         LSR
         AND   #$0003
         PHA
         LDA   #$0001
         PLX
         STX   $F8
         CLC
         ADC   $F8
         BRL   L060348
L0602C4  LDY   #$0002
         LDA   [$F0],Y
         AND   #$007F
         PHA
         LDA   #$007F
         PLX
         STX   $F8
         CLC
         ADC   $F8
         BRL   L060348
L0602D9  LDY   #$0002
         LDA   [$F0],Y
         AND   #$007F
         PHA
         LDA   #$0017
         PLX
         STX   $F8
         CLC
         ADC   $F8
         BRL   L060348
L0602EE  LDY   #$0002
         LDA   [$F0],Y
         AND   #$007F
         PHA
         LDA   #$0045
         PLX
         STX   $F8
         CLC
         ADC   $F8
         BRL   L060348
L060303  LDY   #$0002
         LDA   [$F0],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$007F
         PHA
         LDA   #$0002
         PLX
         STX   $F8
         CLC
         ADC   $F8
         BRL   L060348
L060320  LDA   #$FFFF
         BRL   L060348
         BRL   L060348
L060329  DA    L0602D9
         DA    L0602EE
         DA    L0602A8
         DA    L060303
         DA    L0602AE
         DA    L0602C4
         DA    L060320
L060337  SEC
         SBC   #$0005
         CMP   #$0006
         BCC   L060343
         LDA   #$0006
L060343  ASL
         TAX
         JMP   (L060329,X)

L060348  TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L060352  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EA
         TCS
         LDA   #$000A
         PHA
         LDA   $FF
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         STA   $EE
         CMP   #$000F
         BNE   L0603BE
         LDA   $FF
         CMP   #$FF80
         BNE   L060382
         LDA   #$FFF5
         BRL   L06041B
         BRA   L0603BC
L060382  LDA   $FF
         CMP   #$FF81
         BNE   L060391
         LDA   #$FFF3
         BRL   L06041B
         BRA   L0603BC
L060391  LDA   $FF
         CMP   #$FF82
         BNE   L0603A0
         LDA   #$FFFC
         BRL   L06041B
         BRA   L0603BC
L0603A0  LDA   $FF
         CMP   #$FF86
         BEQ   L0603AE
         LDA   $FF
         CMP   #$FF87
         BNE   L0603B6
L0603AE  LDA   #$FFF2
         BRL   L06041B
         BRA   L0603BC
L0603B6  LDA   #$FFF4
         BRL   L06041B
L0603BC  BRA   L0603ED
L0603BE  LDA   $EE
         CMP   #$0005
         BNE   L0603ED
         PEI   $FF
         JSL   L060CF6
         PLY
         STX   $F2
         STA   $F0
         LDY   #$0004
         LDA   [$F0],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$001F
         STA   $EC
         TAY
         BEQ   L0603ED
         LDA   $EC
         EOR   #$FFFF
         INC
         BRA   L06041B
L0603ED  PEI   $FF
         JSL   L060280
         PLY
         PHA
         LDA   #$0006
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L05048C
         LDX   #^L05048C
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         AND   #$00FF
L06041B  TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PLD
         RTL

L060425  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EC
         TCS
         LDY   #$0001
         LDA   [$FB],Y
         AND   #$00FF
         STA   $EE
         LDA   $FF
         BEQ   L06045C
         LDY   #$0002
         LDA   [$FB],Y
         AND   #$00FF
         AND   #$0007
         CLC
         ADC   #$0004
         PHA
         PEA   $0003
         PEI   $EE
         JSL   L0205CE
         PLY
         PLY
         PLY
         STA   $EE
L06045C  LDA   $EE
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L060468  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         JSL   L060C4E
         PLY
         STX   $F2
         STA   $F0
         LDY   #$0004
         LDA   [$F0],Y
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L0604B4  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00ED
         TCS
         LDY   #$0005
         LDA   [$FB],Y
         SEP   #$20
         STA   $EF
         REP   #$20
         LDA   L030046
         CMP   $FF
         BNE   L060506
         LDA   $EF
         AND   #$00FF
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0003
         LDA   [$F0],Y
         SEP   #$20
         STA   $EF
         REP   #$20
L060506  LDA   $EF
         AND   #$00FF
         TAY
         TSC
         CLC
         ADC   #$0007
         TCS
         TYA
         PLD
         RTL

L060515  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDA   L030046
         CMP   $FF
         BNE   L060563
         LDA   $FD
         PHA
         LDY   #$0005
         LDA   [$F9],Y
         AND   #$00FF
         LDX   #$0000
         STX   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         LDY   #$0003
         STA   [$EE],Y
         REP   #$20
         BRA   L06056E
L060563  LDA   $FD
         SEP   #$20
         LDY   #$0005
         STA   [$F9],Y
         REP   #$20
L06056E  TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L060576  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDA   L030046
         CMP   $FF
         BNE   L0605C1
         LDY   #$0005
         LDA   [$FB],Y
         AND   #$00FF
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         AND   #$00FF
         BRA   L0605EB
         BRA   L0605EB
L0605C1  LDY   #$000E
         LDA   [$FB],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         LDX   #$0000
         PHX
         PHA
         LDA   #L051066
         LDX   #^L051066
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00FF
L0605EB  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L0605F5  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDA   L030046
         CMP   $FF
         BNE   L060643
         LDA   $FD
         PHA
         LDY   #$0005
         LDA   [$F9],Y
         AND   #$00FF
         LDX   #$0000
         STX   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         LDY   #$0002
         STA   [$EE],Y
         REP   #$20
         BRA   L060668
L060643  LDA   $FD
         AND   #$0003
         AND   #$0003
         PHA
         PHA
         LDY   #$000E
         LDA   [$F9],Y
         AND   #$FCFF
         STA   $F2
         PLA
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ORA   $F2
         LDY   #$000E
         STA   [$F9],Y
         PLA
L060668  TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L060670  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L060686
         EOR   #$8000
L060686  BPL   L0606BE
         STZ   $F2
         BRA   L0606B1
L06068C  LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05109B
         LDX   #^L05109B
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         CMP   $FF
         BNE   L0606AF
         LDA   #$0001
         BRA   L0606C1
L0606AF  INC   $F2
L0606B1  LDA   $F2
         SEC
         SBC   #$0003
         BVS   L0606BC
         EOR   #$8000
L0606BC  BPL   L06068C
L0606BE  LDA   #$0000
L0606C1  TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L0606CB  ENT
         PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$00E6
         TCS
         LDA   $F5
         PHA
         LDA   $F3
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05045C
         LDX   #^L05045C
         JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         SEC
         JSL   L0220A5
         LDA   [$F9]
         PLX
         STX   $EC
         CLC
         ADC   $EC
         STA   [$F9]
         LDA   $F5
         PHA
         LDA   $F3
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050464
         LDX   #^L050464
         JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         SEC
         JSL   L0220A5
         LDA   [$FD]
         PLX
         STX   $EC
         CLC
         ADC   $EC
         STA   [$FD]
         LDA   $F3
         CLC
         ADC   #$0001
         STA   $F3
         LDA   $F3
         AND   #$0003
         STA   $F3
         LDA   $F7
         PHA
         LDA   $F3
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05045C
         LDX   #^L05045C
         JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         SEC
         JSL   L0220A5
         LDA   [$F9]
         PLX
         STX   $EC
         CLC
         ADC   $EC
         STA   [$F9]
         LDA   $F7
         PHA
         LDA   $F3
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050464
         LDX   #^L050464
         JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         SEC
         JSL   L0220A5
         LDA   [$FD]
         PLX
         STX   $EC
         CLC
         ADC   $EC
         STA   [$FD]
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L06079D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L0607B3
         EOR   #$8000
L0607B3  BPL   L0607C2
         LDA   $FF
         SEC
         SBC   L0300A6
         BVS   L0607C0
         EOR   #$8000
L0607C0  BPL   L0607C7
L0607C2  LDA   #$0000
         BRA   L0607CA
L0607C7  LDA   #$0001
L0607CA  STA   $EE
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L0607D7
         EOR   #$8000
L0607D7  BPL   L0607E6
         LDA   $FD
         SEC
         SBC   L0300A4
         BVS   L0607E4
         EOR   #$8000
L0607E4  BPL   L0607EB
L0607E6  LDA   #$0000
         BRA   L0607EE
L0607EB  LDA   #$0001
L0607EE  STA   $F0
         TAY
         BEQ   L060841
         LDA   $EE
         BEQ   L060841
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L060800
         DEX
L060800  PHX
         PHA
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L06080B
         DEX
L06080B  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         BRL   L0609E8
         BRL   L0609E8
L060841  LDA   $EE
         BNE   L060848
         BRL   L060910
L060848  LDA   $FD
         CMP   #$FFFF
         BNE   L06088C
         LDA   #$0005
         PHA
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L06085C
         DEX
L06085C  PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         STA   $EE
         CMP   #$0001
         BEQ   L060893
L06088C  LDA   $EE
         CMP   #$0002
         BNE   L06089C
L060893  LDA   #$0004
         BRL   L0609E8
         BRL   L06090D
L06089C  LDA   $FD
         CMP   L0300A4
         BNE   L060900
         LDA   #$0005
         PHA
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L0608B0
         DEX
L0608B0  PHX
         PHA
         LDA   L0300A4
         SEC
         SBC   #$0001
         LDX   #$0000
         TAY
         BPL   L0608C0
         DEX
L0608C0  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         STA   $EE
         CMP   #$0001
         BEQ   L060907
L060900  LDA   $EE
         CMP   #$0002
         BNE   L06090D
L060907  LDA   #$0001
         BRL   L0609E8
L06090D  BRL   L0609E5
L060910  LDA   $F0
         BNE   L060917
         BRL   L0609E5
L060917  LDA   $FF
         CMP   #$FFFF
         BNE   L060965
         LDA   #$0005
         PHA
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L06092B
         DEX
L06092B  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         STA   $F0
         CMP   #$0001
         BEQ   L06096C
L060965  LDA   $F0
         CMP   #$0002
         BNE   L060975
L06096C  LDA   #$0002
         BRL   L0609E8
         BRL   L0609E5
L060975  LDA   $FF
         CMP   L0300A6
         BNE   L0609D9
         LDA   #$0005
         PHA
         LDA   L0300A6
         SEC
         SBC   #$0001
         LDX   #$0000
         TAY
         BPL   L06098E
         DEX
L06098E  PHX
         PHA
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L060999
         DEX
L060999  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         STA   $F0
         CMP   #$0001
         BEQ   L0609E0
L0609D9  LDA   $F0
         CMP   #$0002
         BNE   L0609E5
L0609E0  LDA   #$0008
         BRA   L0609E8
L0609E5  LDA   #$0000
L0609E8  TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L0609F2  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         PEA   $0000
         TDC
         CLC
         ADC   #$00FF
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00FD
         PHA
         PEI   $FB
         PEI   $F9
         PEI   $F7
         JSL   L0606CB
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEI   $FF
         PEI   $FD
         JSL   L06079D
         PLY
         PLY
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L060A35  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         LDA   #$0005
         PHA
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         JSL   L0609F2
         PLY
         PLY
         PLY
         PLY
         PLY
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L060A6A  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00DA
         TCS
         LDA   L030046
         CMP   #$00FF
         BNE   L060A83
         LDA   #$FFFF
         BRL   L060BB8
L060A83  LDA   $F5
         LDX   #$0000
         TAY
         BPL   L060A8C
         DEX
L060A8C  STX   $EE
         ASL
         ROL   $EE
         ASL
         ROL   $EE
         ASL
         ROL   $EE
         ASL
         ROL   $EE
         LDX   $EE
         PHX
         PHA
         LDX   L0300AE
         LDA   L0300AC
         JSL   L021F00
         PLA
         PLX
         STX   $E8
         STA   $E6
         LDA   [$F9]
         PHA
         LDY   #$0006
         LDA   [$E6],Y
         AND   #$00FF
         PLX
         STX   $EE
         CLC
         ADC   $EE
         STA   $E4
         LDA   [$FD]
         PHA
         LDY   #$0007
         LDA   [$E6],Y
         AND   #$00FF
         PLX
         STX   $EE
         CLC
         ADC   $EE
         STA   $E2
         LDY   #$0008
         LDA   [$E6],Y
         AND   #$003F
         CLC
         ADC   $F7
         STA   $E0
         LDX   L0300AE
         LDA   L0300AC
         STX   $E8
         STA   $E6
         STZ   $DC
         BRL   L060B94
L060AF0  LDY   #$0008
         LDA   [$E6],Y
         AND   #$003F
         PHA
         LDA   $E0
         PLX
         STX   $EA
         CMP   $EA
         BEQ   L060B05
         BRL   L060B86
L060B05  LDY   #$0006
         LDA   [$E6],Y
         AND   #$00FF
         STA   $DE
         SEC
         SBC   $E4
         BEQ   L060B1B
         BVS   L060B19
         EOR   #$8000
L060B19  BMI   L060B86
L060B1B  LDY   #$0008
         LDA   [$E6],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$001F
         PHA
         LDA   $DE
         PLX
         STX   $EE
         CLC
         ADC   $EE
         CMP   $E4
         BCC   L060B86
         LDY   #$0007
         LDA   [$E6],Y
         AND   #$00FF
         STA   $DE
         SEC
         SBC   $E2
         BEQ   L060B4C
         BVS   L060B4A
         EOR   #$8000
L060B4A  BMI   L060B86
L060B4C  LDY   #$0008
         LDA   [$E6],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         AND   #$001F
         PHA
         LDA   $DE
         PLX
         STX   $EE
         CLC
         ADC   $EE
         CMP   $E2
         BCC   L060B86
         LDA   $E2
         SEC
         SBC   $DE
         STA   [$FD]
         LDY   #$0006
         LDA   [$E6],Y
         AND   #$00FF
         PHA
         LDA   $E4
         PLX
         STX   $EE
         SEC
         SBC   $EE
         STA   [$F9]
         LDA   $DC
         BRA   L060BB8
L060B86  LDA   $E6
         CLC
         ADC   #$0010
         STA   $E6
         BCC   L060B92
         INC   $E8
L060B92  INC   $DC
L060B94  LDX   L0300B2
         LDA   L0300B0
         STA   $EA
         STX   $EC
         LDY   #$0004
         LDA   [$EA],Y
         AND   #$00FF
         SEC
         SBC   $DC
         BEQ   L060BB5
         BVS   L060BB0
         EOR   #$8000
L060BB0  BPL   L060BB5
         BRL   L060AF0
L060BB5  LDA   #$FFFF
L060BB8  TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PLD
         RTL

L060BC2  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L06079D
         PLY
         PLY
         AND   #$00FF
         AND   #$0008
         TAY
         BEQ   L060BE5
         LDA   #$0000
         BRA   L060BE8
L060BE5  LDA   #$0001
L060BE8  STA   $EE
         TAY
         BEQ   L060C01
         LDA   $FD
         CLC
         ADCL  L05045E
         STA   $FD
         LDA   $FF
         CLC
         ADCL  L050466
         STA   $FF
         BRA   L060C13
L060C01  LDA   $FD
         CLC
         ADCL  L05045C
         STA   $FD
         LDA   $FF
         CLC
         ADCL  L050464
         STA   $FF
L060C13  LDA   #$0005
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L06079D
         PLY
         PLY
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         STA   $F0
         CMP   #$0000
         BEQ   L060C3D
         LDA   $F0
         CMP   #$0003
         BEQ   L060C3D
         LDA   #$0000
         BRA   L060C40
L060C3D  LDA   #$0001
L060C40  ASL
         CLC
         ADC   $EE
         TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L060C4E  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   #$000A
         PHA
         LDA   $FF
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L05046C
         LDX   #^L05046C
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $FF
         AND   #$03FF
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #$000A
         PHA
         LDA   $FF
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0510A7
         LDX   #^L0510A7
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         JSL   L021F00
         PLA
         PLX
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L060CD1  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L060E4D
         PLY
         PLY
         PHA
         JSL   L060C4E
         PLY
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L060CF6  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         JSL   L060C4E
         PLY
         STX   $F2
         STA   $F0
         LDY   #$0002
         LDA   [$F0],Y
         AND   #$007F
         PHA
         LDA   #$0006
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0508C4
         LDX   #^L0508C4
         JSL   L021F00
         PLA
         PLX
         TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L060D39  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         JSL   L060C4E
         PLY
         STX   $F2
         STA   $F0
         LDA   [$F0]
         TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L060D5B  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L060D6F
         DEX
L060D6F  STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         STX   $EC
         STA   $EA
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L060DA2
         EOR   #$8000
L060DA2  BPL   L060DEF
         LDA   $FD
         SEC
         SBC   L0300A4
         BVS   L060DAF
         EOR   #$8000
L060DAF  BMI   L060DEF
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L060DBC
         EOR   #$8000
L060DBC  BPL   L060DEF
         LDA   $FF
         SEC
         SBC   L0300A6
         BVS   L060DC9
         EOR   #$8000
L060DC9  BMI   L060DEF
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L060DD4
         DEX
L060DD4  PHX
         PHA
         LDX   $EC
         LDA   $EA
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         AND   #$0010
         TAY
         BNE   L060DF4
L060DEF  LDA   #$FFFF
         BRA   L060E43
L060DF4  STZ   $EE
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L060DFF
         DEX
L060DFF  STX   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L03009E
         LDA   L03009C
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         STA   $F0
L060E1C  LDA   $EE
         INC   $EE
         CMP   $FF
         BEQ   L060E41
         LDX   $EC
         LDA   $EA
         INC   $EA
         BNE   L060E2E
         INC   $EC
L060E2E  STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         AND   #$0010
         TAY
         BEQ   L060E3F
         INC   $F0
L060E3F  BRA   L060E1C
L060E41  LDA   $F0
L060E43  TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PLD
         RTL

L060E4D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L060D5B
         PLY
         PLY
         STA   $F0
         CMP   #$FFFF
         BNE   L060E70
         LDA   #$FFFE
         BRA   L060E94
         BRA   L060E94
L060E70  LDA   $F0
         LDX   #$0000
         TAY
         BPL   L060E79
         DEX
L060E79  STX   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300C4
         LDA   L0300C2
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
L060E94  TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L060E9E  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L060E4D
         PLY
         PLY
         STA   $F0
L060EB5  LDA   $F0
         CMP   #$FFFE
         BEQ   L060EDB
         LDA   #$000A
         PHA
         LDA   $F0
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         CMP   #$0004
         BCS   L060EDB
         PEI   $F0
         JSL   L060D39
         PLY
         STA   $F0
         BRA   L060EB5
L060EDB  LDA   $F0
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L060EE7  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00DA
         TCS
         LDA   $F9
         CMP   #$FFFE
         BNE   L060EFC
         BRL   L061109
L060EFC  PEI   $F9
         JSL   L060C4E
         PLY
         STX   $E0
         STA   $DE
         LDA   #$FFFE
         STA   [$DE]
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L060F17
         EOR   #$8000
L060F17  BMI   L060F1C
         BRL   L0610DC
L060F1C  LDA   $FF
         LDX   #$0000
         TAY
         BPL   L060F25
         DEX
L060F25  PHX
         PHA
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L060F30
         DEX
L060F30  STX   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         JSL   L021F00
         PLA
         PLX
         STX   $E8
         STA   $E6
         LDA   [$E6]
         AND   #$00FF
         AND   #$0010
         TAY
         BEQ   L060F78
         PEI   $FF
         PEI   $FD
         JSL   L060E4D
         PLY
         PLY
         STA   $FB
         BRL   L0610DC
L060F78  LDA   [$E6]
         AND   #$00FF
         ORA   #$0010
         SEP   #$20
         STA   [$E6]
         REP   #$20
         LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L060F97
         DEX
L060F97  SEC
         JSL   L0222B8
         LDX   L03009E
         LDA   L03009C
         JSL   L021F00
         PLA
         PLX
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $EC
         STA   $EA
         LDA   L03008A
         LDX   #$0000
         TAY
         BPL   L060FC1
         DEX
L060FC1  STX   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L0300BE
         LDA   L0300BC
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         CLC
         ADC   $FD
         PHA
         LDA   L0300C0
         PLX
         STX   $F2
         SEC
         SBC   $F2
         SEC
         SBC   #$0001
         STA   $E2
L060FEF  LDA   $E2
         DEC   $E2
         TAY
         BEQ   L061016
         LDX   $EC
         LDA   $EA
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $EA
         LDA   $EC
         BCC   L061007
         INC
L061007  STA   $EC
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         INC
         STA   [$EE]
         BRA   L060FEF
L061016  STZ   $DC
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L061021
         DEX
L061021  PHX
         PHA
         LDX   $E8
         LDA   $E6
         JSL   L02209A
         PLA
         PLX
         STX   $E8
         STA   $E6
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L06103A
         DEX
L06103A  STX   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L03009E
         LDA   L03009C
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         STA   $E2
L061057  LDA   $DC
         INC   $DC
         PHA
         LDA   $FF
         PLX
         STX   $EE
         CMP   $EE
         BEQ   L061082
         LDX   $E8
         LDA   $E6
         INC   $E6
         BNE   L06106F
         INC   $E8
L06106F  STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         AND   #$0010
         TAY
         BEQ   L061080
         INC   $E2
L061080  BRA   L061057
L061082  LDA   $E2
         LDX   #$0000
         STX   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L0300C4
         LDA   L0300C2
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
         LDX   L0300B2
         LDA   L0300B0
         STA   $EE
         STX   $F0
         LDY   #$000A
         LDA   [$EE],Y
         SEC
         SBC   $E2
         SEC
         SBC   #$0001
         ASL
         PHA
         LDX   $EC
         LDA   $EA
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEI   $EC
         PEI   $EA
         JSL   L0202AB
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $F9
         STA   [$EA]
         BRA   L061109
L0610DC  PEI   $FB
         JSL   L060D39
         PLY
         STA   $E4
L0610E5  LDA   $E4
         CMP   #$FFFE
         BEQ   L0610FA
         LDA   $E4
         STA   $FB
         PHA
         JSL   L060D39
         PLY
         STA   $E4
         BRA   L0610E5
L0610FA  PEI   $FB
         JSL   L060C4E
         PLY
         STX   $E0
         STA   $DE
         LDA   $F9
         STA   [$DE]
L061109  TAY
         TSC
         CLC
         ADC   #$0018
         TCS
         TYA
         PLD
         RTL

L061113  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00DE
         TCS
         LDA   $F9
         CMP   #$FFFE
         BNE   L061128
         BRL   L06132F
L061128  LDA   $F9
         AND   #$3FFF
         STA   $F9
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L06113A
         EOR   #$8000
L06113A  BMI   L06113F
         BRL   L0612DB
L06113F  PEI   $F9
         JSL   L060C4E
         PLY
         STX   $EC
         STA   $EA
         PEI   $FF
         PEI   $FD
         JSL   L060D5B
         PLY
         PLY
         STA   $E4
         LDX   #$0000
         STX   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L0300C4
         LDA   L0300C2
         JSL   L021F00
         PLA
         PLX
         STX   $E8
         STA   $E6
         LDA   [$EA]
         CMP   #$FFFE
         BEQ   L06117C
         BRL   L0612C8
L06117C  LDA   [$E6]
         AND   #$3FFF
         CMP   $F9
         BEQ   L061188
         BRL   L0612C8
L061188  LDA   $FF
         LDX   #$0000
         TAY
         BPL   L061191
         DEX
L061191  PHX
         PHA
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L06119C
         DEX
L06119C  STX   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         AND   #$FFEF
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDX   L0300B2
         LDA   L0300B0
         STA   $EE
         STX   $F0
         LDY   #$000A
         LDA   [$EE],Y
         SEC
         SBC   #$0001
         STA   $E2
         SEC
         SBC   $E4
         ASL
         PHA
         PEI   $E8
         PEI   $E6
         LDX   $E8
         LDA   $E6
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         JSL   L0202AB
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $E2
         LDX   #$0000
         STX   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L0300C4
         LDA   L0300C2
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   #$FFFF
         STA   [$EE]
         LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDA   $FD
         LDX   #$0000
         TAY
         BPL   L061244
         DEX
L061244  SEC
         JSL   L0222B8
         LDX   L03009E
         LDA   L03009C
         JSL   L021F00
         PLA
         PLX
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E8
         STA   $E6
         LDA   L03008A
         LDX   #$0000
         TAY
         BPL   L06126E
         DEX
L06126E  STX   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L0300BE
         LDA   L0300BC
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         CLC
         ADC   $FD
         PHA
         LDA   L0300C0
         PLX
         STX   $F2
         SEC
         SBC   $F2
         SEC
         SBC   #$0001
         STA   $E2
L06129C  LDA   $E2
         DEC   $E2
         TAY
         BEQ   L0612C3
         LDX   $E8
         LDA   $E6
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $E6
         LDA   $E8
         BCC   L0612B4
         INC
L0612B4  STA   $E8
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         DEC
         STA   [$EE]
         BRA   L06129C
L0612C3  BRL   L06132A
         BRA   L0612D7
L0612C8  LDA   [$E6]
         AND   #$3FFF
         CMP   $F9
         BNE   L0612D7
         LDA   [$EA]
         STA   [$E6]
         BRA   L06132A
L0612D7  LDA   [$E6]
         STA   $FB
L0612DB  PEI   $FB
         JSL   L060D39
         PLY
         STA   $E0
L0612E4  LDA   $E0
         AND   #$3FFF
         CMP   $F9
         BEQ   L06130B
         LDA   $E0
         CMP   #$FFFE
         BEQ   L0612FB
         LDA   $E0
         CMP   #$FFFF
         BNE   L0612FD
L0612FB  BRA   L06132A
L0612FD  LDA   $E0
         STA   $FB
         PHA
         JSL   L060D39
         PLY
         STA   $E0
         BRA   L0612E4
L06130B  PEI   $FB
         JSL   L060C4E
         PLY
         STX   $EC
         STA   $EA
         PEI   $E0
         JSL   L060D39
         PLY
         STA   [$EA]
         PEI   $F9
         JSL   L060C4E
         PLY
         STX   $EC
         STA   $EA
L06132A  LDA   #$FFFE
         STA   [$EA]
L06132F  TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PLD
         RTL

L061339  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00D4
         TCS
         LDA   $FF
         CMP   #$000F
         BNE   L061351
         LDA   #$FFFF
         BRL   L06175D
L061351  LDA   L03008A
         STA   $DC
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L051262
         LDX   #^L051262
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         STA   $E4
         PHA
         LDA   L030046
         PLX
         STX   $F4
         CMP   $F4
         BNE   L0613A1
         INC   $E4
         LDA   $E4
         PHA
         LDX   L0300B2
         LDA   L0300B0
         STA   $F4
         STX   $F6
         LDY   #$0004
         LDA   [$F4],Y
         AND   #$00FF
         PLX
         STX   $F4
         CMP   $F4
         BEQ   L06139F
         BCS   L0613A1
L06139F  STZ   $E4
L0613A1  LDA   $E4
         STA   $DE
L0613A5  LDA   $E4
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300AE
         LDA   L0300AC
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0008
         LDA   [$F4],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$001F
         STA   $DA
         LDA   $E4
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300AE
         LDA   L0300AC
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0008
         LDA   [$F4],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         AND   #$001F
         STA   $D8
         LDA   $E4
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300B6
         LDA   L0300B4
         JSL   L021F00
         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]
         STX   $F2
         STA   $F0
         LDA   $E4
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300BE
         LDA   L0300BC
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300BA
         LDA   L0300B8
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300C4
         LDA   L0300C2
         JSL   L021F00
         PLA
         PLX
         STX   $EE
         STA   $EC
         STZ   $EA
         BRL   L0616CC
L0614AC  STZ   $E8
         BRL   L0616BC
L0614B1  LDX   $F2
         LDA   $F0
         INC   $F0
         BNE   L0614BB
         INC   $F2
L0614BB  STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         AND   #$0010
         TAY
         BNE   L0614CD
         BRL   L0616BA
L0614CD  LDX   $EE
         LDA   $EC
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $EC
         LDA   $EE
         BCC   L0614DE
         INC
L0614DE  STA   $EE
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $E6
         LDA   L030046
         CMP   $E4
         BNE   L061516
         LDA   $EA
         SEC
         SBC   L030040
         CLC
         ADC   #$0005
         CMP   #$000A
         BEQ   L061502
         BCS   L061516
L061502  LDA   $E8
         SEC
         SBC   L030042
         CLC
         ADC   #$0005
         CMP   #$000A
         BEQ   L061513
         BCS   L061516
L061513  BRL   L0616BA
L061516  LDA   #$000A
         PHA
         LDA   $E6
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         STA   $D6
         CMP   #$0003
         BNE   L061548
         PEI   $E6
         JSL   L060C4E
         PLY
         STX   $E2
         STA   $E0
         LDY   #$0002
         LDA   [$E0],Y
         AND   #$007F
         TAY
         BEQ   L061545
         BRL   L0616BA
L061545  BRL   L0616A9
L061548  LDA   $D6
         CMP   $FF
         BEQ   L061551
         BRL   L0616A9
L061551  PEI   $E6
         JSL   L060C4E
         PLY
         STX   $E2
         STA   $E0
         LDA   $FF
         BRL   L061668
L061561  LDY   #$000E
         LDA   [$E0],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         AND   #$0001
         TAY
         BEQ   L061575
         BRL   L0616A9
L061575  PEI   $E4
         JSL   L062325
         PLY
         LDA   $FF
         CMP   #$0004
         BNE   L0615A0
         PEA   $FFFF
         PEI   $E6
         PEI   $E8
         PEI   $EA
         JSL   L0633D1
         PLY
         PLY
         PLY
         PLY
         PEI   $E8
         PEI   $EA
         JSL   L063519
         PLY
         PLY
         BRA   L0615CD
L0615A0  PEI   $E6
         JSL   L04046D
         PLY
         PEI   $E8
         PEI   $EA
         PEA   $0000
         PEI   $E6
         JSL   L061113
         PLY
         PLY
         PLY
         PLY
         PEI   $E8
         PEI   $EA
         PEA   $0000
         PEA   $0000
         PEI   $E6
         JSL   L040496
         PLY
         PLY
         PLY
         PLY
         PLY
L0615CD  BRL   L061679
L0615D0  LDY   #$0002
         LDA   [$E0],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0001
         TAY
         BEQ   L0615E5
         BRL   L0616A9
L0615E5  BRL   L061631
L0615E8  LDY   #$0002
         LDA   [$E0],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0001
         TAY
         BEQ   L0615FD
         BRL   L0616A9
L0615FD  BRL   L061631
L061600  LDY   #$0002
         LDA   [$E0],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0001
         TAY
         BEQ   L061615
         BRL   L0616A9
L061615  BRL   L061631
L061618  LDY   #$0002
         LDA   [$E0],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0001
         TAY
         BEQ   L061631
         BRL   L0616A9
L061631  PEI   $E4
         JSL   L062325
         PLY
         PEA   $0000
         PEA   $FFFF
         PEI   $E8
         PEI   $EA
         PEI   $E6
         JSL   L042D63
         PLY
         PLY
         PLY
         PLY
         PLY
L06164D  BRL   L061679
L061650  DA    L061561
         DA    L0615E8
         DA    L0615D0
         DA    L06164D
         DA    L061618
         DA    L06164D
         DA    L061600
         DA    L06164D
         DA    L06164D
         DA    L06164D
         DA    L061575
         DA    L06164D
L061668  SEC
         SBC   #$0004
         CMP   #$000B
         BCC   L061674
         LDA   #$000B
L061674  ASL
         TAX
         JMP   (L061650,X)

L061679  PEI   $DC
         JSL   L062325
         PLY
         LDA   $E4
         PHA
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L051262
         LDX   #^L051262
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         LDA   $E6
         AND   #$3FFF
         BRL   L06175D
L0616A9  PEI   $E6
         JSL   L060D39
         PLY
         STA   $E6
         CMP   #$FFFE
         BEQ   L0616BA
         BRL   L061516
L0616BA  INC   $E8
L0616BC  LDA   $E8
         CMP   $D8
         BNE   L0616C5
         BRL   L0614B1
L0616C5  BCS   L0616CA
         BRL   L0614B1
L0616CA  INC   $EA
L0616CC  LDA   $EA
         CMP   $DA
         BNE   L0616D5
         BRL   L0614AC
L0616D5  BCS   L0616DA
         BRL   L0614AC
L0616DA  LDA   L030046
         CMP   $E4
         BEQ   L061700
         LDX   L0300B2
         LDA   L0300B0
         STA   $F4
         STX   $F6
         LDY   #$0004
         LDA   [$F4],Y
         AND   #$00FF
         SEC
         SBC   #$0001
         BEQ   L061700
         BVS   L0616FE
         EOR   #$8000
L0616FE  BMI   L061726
L061700  LDA   $E4
         PHA
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L051262
         LDX   #^L051262
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         LDA   #$FFFF
         BRA   L06175D
L061726  INC   $E4
         LDA   $E4
         PHA
         LDX   L0300B2
         LDA   L0300B0
         STA   $F4
         STX   $F6
         LDY   #$0004
         LDA   [$F4],Y
         AND   #$00FF
         PLX
         STX   $F4
         CMP   $F4
         BEQ   L061746
         BCS   L061748
L061746  STZ   $E4
L061748  LDA   L030046
         CMP   $E4
         BEQ   L061726
         LDA   $E4
         CMP   $DE
         BNE   L06175A
         LDA   L030046
         STA   $E4
L06175A  BRL   L0613A5
L06175D  TAY
         TSC
         CLC
         ADC   #$0024
         TCS
         TYA
         PLD
         RTL

L061767  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E6
         TCS
         LDA   $FF
         AND   #$7FFF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   L0300B2
         LDA   L0300B0
         STA   $F4
         STX   $F6
         LDX   $F6
         LDA   #$000C
         CLC
         ADC   $F4
         BCC   L061792
         INX
L061792  JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $EA
         LDA   $FF
         CMP   #$800A
         BNE   L0617AE
         LDA   #$000A
         STA   $FF
         BRA   L0617BD
L0617AE  LDA   $FF
         CMP   #$000A
         BNE   L0617BD
         LDA   $EA
         SEC
         SBC   #$0003
         STA   $EA
L0617BD  LDA   $EA
         STA   $EE
         LDA   #$0001
         PHA
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L05046C
         LDX   #^L05046C
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         STA   $EC
         LDA   $FF
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0510A7
         LDX   #^L0510A7
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STX   $F2
         STA   $F0
L06180E  LDA   [$F0]
         CMP   #$FFFF
         BNE   L061832
         LDA   $EA
         SEC
         SBC   $EE
         PHA
         LDA   #$000A
         PHA
         LDA   $FF
         CLC
         JSL   L0222A8
         PLA
         PLX
         STX   $F8
         ORA   $F8
         STA   $E8
         BRA   L061880
         BRA   L06187E
L061832  DEC   $EE
         LDA   $EE
         BEQ   L06185E
         LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDA   $EC
         LDX   #$0000
         TAY
         BPL   L061849
         DEX
L061849  SEC
         JSL   L0222B8
         LDX   $F2
         LDA   $F0
         JSL   L021F00
         PLA
         PLX
         STX   $F2
         STA   $F0
         BRA   L06187E
L06185E  PEI   $FF
         JSL   L061339
         PLY
         STA   $E8
         CMP   #$FFFF
         BNE   L061871
         LDA   #$FFFF
         BRA   L061896
L061871  PEI   $E8
         JSL   L060C4E
         PLY
         STX   $F2
         STA   $F0
         BRA   L061880
L06187E  BRA   L06180E
L061880  LDA   $EC
         ASL
         PHA
         PEI   $F2
         PEI   $F0
         JSL   L020232
         PLY
         PLY
         PLY
         LDA   #$FFFE
         STA   [$F0]
         LDA   $E8
L061896  TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         PLD
         RTL

L0618A0  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E8
         TCS
         LDA   #$0005
         STA   $F0
         LDA   $FF
         CMP   #$0004
         BCC   L0618C5
         LDA   $FF
         CMP   #$0007
         BEQ   L0618C0
         BCS   L0618C5
L0618C0  LDA   #$0004
         STA   $FF
L0618C5  LDA   $FF
         BRL   L061917
L0618CA  LDA   #$001E
         STA   $F2
         BRL   L061942
L0618D2  LDA   #$0019
         STA   $F2
         LDA   #$000A
         STA   $F0
         BRL   L061942
L0618DF  LDA   #$001B
         STA   $F2
         BRL   L061942
L0618E7  LDA   #$001C
         STA   $F2
         BRL   L061942
L0618EF  LDA   #$001F
         STA   $F2
         BRL   L061942
L0618F7  LDA   #$0020
         STA   $F2
         BRL   L061942
L0618FF  LDA   #$0008
         STA   $F2
         BRL   L061942
L061907  LDA   #$0002
         STA   $F2
         BRL   L061942
L06190F  LDA   #$FFFF
         BRL   L0619BA
         BRA   L061942
L061917  CMP   #$0004
         BEQ   L061907
         CMP   #$0020
         BEQ   L0618FF
         CMP   #$0033
         BEQ   L0618DF
         CMP   #$0034
         BEQ   L0618E7
         CMP   #$0036
         BEQ   L0618CA
         CMP   #$0037
         BEQ   L0618EF
         CMP   #$0038
         BEQ   L0618F7
         CMP   #$0080
         BEQ   L0618D2
         JMP   L06190F

L061942  PEI   $F0
         JSL   L061767
         PLY
         STA   $EE
         CMP   #$FFFF
         BNE   L061955
         LDA   #$FFFF
         BRA   L0619BA
L061955  PEI   $EE
         JSL   L060C4E
         PLY
         STX   $EC
         STA   $EA
         LDA   $F2
         AND   #$007F
         PHA
         PHA
         LDY   #$0002
         LDA   [$EA],Y
         AND   #$FF80
         STA   $F8
         PLA
         ORA   $F8
         LDY   #$0002
         STA   [$EA],Y
         PLA
         LDA   $FF
         CMP   #$0004
         BNE   L0619B8
         LDY   #$0002
         LDA   [$EA],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0001
         TAY
         BEQ   L0619B8
         LDA   #$000F
         AND   #$000F
         PHA
         PHA
         LDY   #$0002
         LDA   [$EA],Y
         AND   #$C3FF
         STA   $F8
         PLA
         XBA
         AND   #$FF00
         ASL
         ASL
         ORA   $F8
         LDY   #$0002
         STA   [$EA],Y
         PLA
L0619B8  LDA   $EE
L0619BA  TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         PLD
         RTL

L0619C4  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00D7
         TCS
         LDA   $FD
         AND   #$03FF
         LDX   #$0000
         STX   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDAL  L0510B1
         TAX
         LDAL  L0510AF
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $EE
         LDX   $F0
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00D9
         PHA
         PEA   $0004
         JSL   L02219C
         PLA
         PLA
         PLA
         PLA
         PLX
         LDA   $DB
         AND   #$0001
         TAY
         BNE   L061A24
         LDA   $FF
         AND   #$8000
         TAY
         BNE   L061A24
         BRL   L061C3F
L061A24  LDA   $FF
         AND   #$7FFF
         STA   $FF
         LDA   $FF
         CMP   #$0001
         BNE   L061A54
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L061A3C
         INC   $FB
L061A3C  STA   $EE
         STX   $F0
         LDA   #$000A
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   #$0020
         SEP   #$20
         STA   $E3
         REP   #$20
         BRA   L061A6F
L061A54  LDA   $FF
         CMP   #$0000
         BNE   L061A66
         LDA   #$0080
         SEP   #$20
         STA   $E3
         REP   #$20
         BRA   L061A6F
L061A66  LDA   #$000A
         SEP   #$20
         STA   $E3
         REP   #$20
L061A6F  STZ   $E6
         STZ   $E1
         LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDA   $DB
         LSR
         LSR
         LSR
         AND   #$1FFF
         LDX   #$0000
         SEC
         JSL   L0222B8
         LDX   L03008E
         LDA   L03008C
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
L061A9B  LDA   $E6
         BNE   L061ACF
         LDX   $EC
         LDA   $EA
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $EA
         LDA   $EC
         BCC   L061AB0
         INC
L061AB0  STA   $EC
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         STA   $E8
         LDA   #$000A
         PHA
         LDA   $E8
         CLC
         JSL   L0222DF
         PLA
         AND   #$001F
         STA   $E4
         BRA   L061AEB
L061ACF  LDA   $E6
         CMP   #$0001
         BNE   L061AE4
         LDA   $E8
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$001F
         STA   $E4
         BRA   L061AEB
L061AE4  LDA   $E8
         AND   #$001F
         STA   $E4
L061AEB  LDA   #$0003
         PHA
         INC   $E6
         LDA   $E6
         CLC
         JSL   L021F1A
         PLA
         STA   $E6
         LDA   $E1
         BNE   L061B02
         BRL   L061BC0
L061B02  LDA   #$0000
         SEP   #$20
         STA   [$F9]
         REP   #$20
         LDA   $E1
         CMP   #$001E
         BNE   L061B51
         LDA   $FF
         CMP   #$0000
         BEQ   L061B35
         LDA   $E4
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050E26
         LDX   #^L050E26
         JSL   L021F00
         PLA
         PLX
         STX   $DF
         STA   $DD
         BRA   L061B4F
L061B35  LDA   $E4
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050F66
         LDX   #^L050F66
         JSL   L021F00
         PLA
         PLX
         STX   $DF
         STA   $DD
L061B4F  BRA   L061B8A
L061B51  LDA   $FF
         CMP   #$0000
         BEQ   L061B72
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050F26
         LDX   #^L050F26
         JSL   L021F00
         PLA
         PLX
         STX   $DF
         STA   $DD
         BRA   L061B8A
L061B72  LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050F26
         LDX   #^L050F26
         JSL   L021F00
         PLA
         PLX
         STX   $DF
         STA   $DD
L061B8A  PEI   $DF
         PEI   $DD
         PEI   $FB
         PEI   $F9
         JSL   L02234C
         PLY
         PLY
         PLY
         PLY
         PEI   $DF
         PEI   $DD
         JSL   L022405
         PLY
         PLY
         LDX   #$0000
         TAY
         BPL   L061BAB
         DEX
L061BAB  PHX
         PHA
         LDX   $FB
         LDA   $F9
         JSL   L021F00
         PLA
         PLX
         STX   $FB
         STA   $F9
         STZ   $E1
         BRL   L061C3C
L061BC0  LDA   $E4
         CMP   #$001C
         BCS   L061C0C
         LDA   $FF
         CMP   #$0000
         BEQ   L061BF2
         LDA   $E4
         CMP   #$001A
         BNE   L061BDC
         LDA   #$0020
         STA   $E4
         BRA   L061BF2
L061BDC  LDA   $E4
         CMP   #$001B
         BNE   L061BEA
         LDA   #$002E
         STA   $E4
         BRA   L061BF2
L061BEA  LDA   $E4
         CLC
         ADC   #$0041
         STA   $E4
L061BF2  LDA   $E4
         PHA
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L061BFF
         INC   $FB
L061BFF  STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         BRA   L061C3C
L061C0C  LDA   $E4
         CMP   #$001C
         BNE   L061C2B
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L061C1D
         INC   $FB
L061C1D  STA   $EE
         STX   $F0
         LDA   $E3
         SEP   #$20
         STA   [$EE]
         REP   #$20
         BRA   L061C3C
L061C2B  LDA   $E4
         CMP   #$001E
         BEQ   L061C34
         BCS   L061C3A
L061C34  LDA   $E4
         STA   $E1
         BRA   L061C3C
L061C3A  BRA   L061C3F
L061C3C  BRL   L061A9B
L061C3F  LDA   $FF
         CMP   #$0000
         BNE   L061C51
         LDA   #$0081
         SEP   #$20
         STA   [$F9]
         REP   #$20
         BRA   L061C5A
L061C51  LDA   #$0000
         SEP   #$20
         STA   [$F9]
         REP   #$20
L061C5A  TSC
         CLC
         ADC   #$001B
         TCS
         PLD
         RTL

L061C62  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDA   $FF
         PHA
         LDX   L0300B2
         LDA   L0300B0
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         LDA   $FD
         PHA
         LDA   #$000B
         CLC
         JSL   L0220A5
         LDA   $FB
         PHA
         LDA   #$7AB9
         CLC
         JSL   L0220A5
         PLA
         LSR
         PLX
         STX   $F4
         CLC
         ADC   $F4
         PLX
         STX   $F4
         CLC
         ADC   $F4
         LSR
         LSR
         CLC
         JSL   L021F1A
         PLA
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L061CB3  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E8
         TCS
         LDA   $F7
         BEQ   L061D12
         PEI   $FF
         LDA   L03008A
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   #$0BB8
         PLX
         STX   $F0
         CLC
         ADC   $F0
         CLC
         ADC   L0300A4
         CLC
         ADC   L0300A6
         PHA
         LDA   $FB
         ASL
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   #$07D0
         PLX
         STX   $F0
         CLC
         ADC   $F0
         CLC
         ADC   $FD
         PHA
         JSL   L061C62
         PLY
         PLY
         PLY
         STA   $EA
         SEC
         SBC   $F9
         BVS   L061D06
         EOR   #$8000
L061D06  BMI   L061D12
         LDA   $EA
         CLC
         ADC   #$0001
         BRA   L061D15
         BRA   L061D15
L061D12  LDA   #$0000
L061D15  TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L061D1F  PHD
         TSC
         SEC
         SBC   #$00E9
         TCD
         ADC   #$00E0
         TCS
         LDX   L03009A
         LDA   L030098
         STA   $E4
         STX   $E6
         LDY   #$000A
         LDA   [$E4],Y
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         STA   $E2
         PEA   $001E
         INC   $F9
         LDA   $F9
         AND   #$0003
         CLC
         ADC   #$0001
         PHA
         INC   $FD
         LDA   $FD
         SEC
         JSL   L0220A5
         PEI   $FB
         PEI   $E2
         PEI   $F3
         JSL   L061CB3
         PLY
         PLY
         PLY
         PLY
         PLY
         LDY   #$0004
         STA   [$EF],Y
         PEA   $001E
         INC   $F9
         LDA   $F9
         AND   #$0003
         CLC
         ADC   #$0001
         PHA
         LDA   $FD
         SEC
         JSL   L0220A5
         PEI   $FB
         PEI   $E2
         PEI   $F5
         JSL   L061CB3
         PLY
         PLY
         PLY
         PLY
         PLY
         LDY   #$0006
         STA   [$EF],Y
         PEA   $001E
         INC   $F9
         LDA   $F9
         AND   #$0003
         CLC
         ADC   #$0001
         PHA
         LDA   $FD
         DEC   $FD
         SEC
         JSL   L0220A5
         PEI   $FB
         PEI   $E2
         PEI   $F7
         JSL   L061CB3
         PLY
         PLY
         PLY
         PLY
         PLY
         LDY   #$0008
         STA   [$EF],Y
         LDA   $FF
         BNE   L061DFC
         LDA   $FB
         SEC
         SBC   #$0000
         BVS   L061DD3
         EOR   #$8000
L061DD3  BPL   L061DFC
         LDA   $FB
         SEC
         SBC   L0300A4
         BVS   L061DE0
         EOR   #$8000
L061DE0  BMI   L061DFC
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L061DED
         EOR   #$8000
L061DED  BPL   L061DFC
         LDA   $FD
         SEC
         SBC   L0300A6
         BVS   L061DFA
         EOR   #$8000
L061DFA  BPL   L061E68
L061DFC  LDA   #$0002
         STA   $E2
         BRA   L061E59
L061E03  LDA   $E2
         LDX   #$0000
         TAY
         BPL   L061E0C
         DEX
L061E0C  STX   $E8
         ASL
         ROL   $E8
         LDX   $E8
         PHX
         PHA
         LDX   $F1
         LDA   $EF
         JSL   L021F00
         PLA
         PLX
         STA   $E4
         STX   $E6
         LDA   [$E4]
         SEC
         SBC   #$0001
         PHA
         JSL   L060670
         PLY
         TAY
         BEQ   L061E57
         LDA   $E2
         LDX   #$0000
         TAY
         BPL   L061E3B
         DEX
L061E3B  STX   $E8
         ASL
         ROL   $E8
         LDX   $E8
         PHX
         PHA
         LDX   $F1
         LDA   $EF
         JSL   L021F00
         PLA
         PLX
         STA   $E4
         STX   $E6
         LDA   #$0000
         STA   [$E4]
L061E57  INC   $E2
L061E59  LDA   $E2
         SEC
         SBC   #$0004
         BEQ   L061E03
         BVS   L061E66
         EOR   #$8000
L061E66  BPL   L061E03
L061E68  TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L061E70  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00D9
         TCS
         PEA   $000A
         PEI   $F9
         PEI   $F7
         JSL   L020232
         PLY
         PLY
         PLY
         PEI   $FF
         PEI   $FD
         JSL   L060E4D
         PLY
         PLY
         STA   $DB
         PEI   $FF
         PEI   $FD
         JSL   L06079D
         PLY
         PLY
         SEP   #$20
         STA   $E7
         REP   #$20
         LDA   #$0005
         PHA
         LDA   $E7
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         STA   [$F7]
         BRL   L062307
L061EB9  LDA   $FB
         BRL   L061F4C
L061EBE  LDA   $E7
         AND   #$00FF
         AND   #$0004
         STA   $E5
         LDA   $E7
         AND   #$00FF
         AND   #$0002
         STA   $E3
         LDA   $E7
         AND   #$00FF
         AND   #$0001
         STA   $E1
         BRL   L061F59
L061EDF  LDA   $E7
         AND   #$00FF
         AND   #$0002
         STA   $E5
         LDA   $E7
         AND   #$00FF
         AND   #$0001
         STA   $E3
         LDA   $E7
         AND   #$00FF
         AND   #$0008
         STA   $E1
         BRL   L061F59
L061F00  LDA   $E7
         AND   #$00FF
         AND   #$0001
         STA   $E5
         LDA   $E7
         AND   #$00FF
         AND   #$0008
         STA   $E3
         LDA   $E7
         AND   #$00FF
         AND   #$0004
         STA   $E1
         BRL   L061F59
L061F21  LDA   $E7
         AND   #$00FF
         AND   #$0008
         STA   $E5
         LDA   $E7
         AND   #$00FF
         AND   #$0004
         STA   $E3
         LDA   $E7
         AND   #$00FF
         AND   #$0002
         STA   $E1
L061F3F  BRL   L061F59
L061F42  DA    L061EBE
         DA    L061EDF
         DA    L061F00
         DA    L061F21
         DA    L061F3F
L061F4C  CMP   #$0004
         BCC   L061F54
         LDA   #$0004
L061F54  ASL
         TAX
         JMP   (L061F42,X)

L061F59  STZ   L0300CE
         STZ   $DD
L061F5E  PEI   $DD
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $E1
         PEI   $E3
         PEI   $E5
         PEI   $F9
         PEI   $F7
         JSL   L061D1F
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
L061F7C  LDA   $DB
         CMP   #$FFFE
         BNE   L061F86
         BRL   L062078
L061F86  LDA   #$000A
         PHA
         LDA   $DB
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         STA   $DF
         SEC
         SBC   #$0003
         BEQ   L061FA7
         BVS   L061FA2
         EOR   #$8000
L061FA2  BPL   L061FA7
         BRL   L062078
L061FA7  LDA   #$000E
         PHA
         LDA   $DB
         CLC
         JSL   L0222DF
         PLA
         SEC
         SBC   $FB
         AND   #$0003
         STA   $E3
         TAY
         BNE   L061FC1
         BRL   L06206C
L061FC1  PEI   $DB
         JSL   L060C4E
         PLY
         STX   $EA
         STA   $E8
         LDA   $DF
         CMP   #$0002
         BNE   L062014
         LDY   #$0002
         LDA   [$E8],Y
         AND   #$0001
         TAY
         BEQ   L062012
         LDA   L030094
         CLC
         ADC   #$0001
         PHA
         LDA   $E3
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L061FF3
         DEX
L061FF3  STX   $F0
         ASL
         ROL   $F0
         LDX   $F0
         PHX
         PHA
         LDX   $F9
         LDA   $F7
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         PLA
         STA   [$EC]
         LDA   $DB
         STA   L0300D0
L062012  BRA   L06206C
L062014  LDY   #$0004
         LDA   [$E8],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         PHA
         LDA   $E3
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L062032
         DEX
L062032  STX   $F0
         ASL
         ROL   $F0
         LDX   $F0
         PHX
         PHA
         LDX   $F9
         LDA   $F7
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         PLA
         STA   [$EC]
         LDY   #$0002
         LDA   [$E8],Y
         AND   #$007F
         CMP   #$007F
         BNE   L06206C
         LDY   #$0002
         LDA   [$E8],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         CLC
         ADC   #$0001
         STA   L0300CE
L06206C  PEI   $DB
         JSL   L060D39
         PLY
         STA   $DB
         BRL   L061F7C
L062078  LDA   $DD
         BEQ   L062095
         LDA   L030040
         CMP   $FD
         BEQ   L062095
         LDA   L030042
         CMP   $FF
         BEQ   L062095
         LDA   #$FFFE
         LDY   #$0002
         STA   [$F7],Y
         BRL   L06231B
L062095  BRL   L062314
L062098  LDA   $E7
         AND   #$00FF
         AND   #$0008
         TAY
         BEQ   L0620C0
         LDA   $E7
         AND   #$00FF
         AND   #$0004
         LDY   #$0004
         STA   [$F7],Y
         LDA   $E7
         AND   #$00FF
         AND   #$0001
         SEP   #$20
         STA   $E7
         REP   #$20
         BRA   L0620CE
L0620C0  LDA   #$0001
         STA   [$F7]
         LDA   #$0001
         SEP   #$20
         STA   $E7
         REP   #$20
L0620CE  BRL   L062157
L0620D1  LDA   $E7
         AND   #$00FF
         AND   #$0004
         TAY
         BNE   L0620F7
         LDA   #$0000
         STA   [$F7]
         LDA   $E7
         AND   #$00FF
         AND   #$0008
         STA   $E3
         STA   $E1
         STA   $E5
         LDA   #$0001
         STA   $DD
         BRL   L061F5E
L0620F7  LDA   #$0001
         STA   [$F7]
         LDA   $E7
         AND   #$00FF
         AND   #$0008
         TAY
         BEQ   L06210C
         LDA   #$0008
         BRA   L06210F
L06210C  LDA   #$0000
L06210F  SEP   #$20
         STA   $E7
         REP   #$20
L062115  PEA   $001E
         PEI   $FF
         PEI   $FD
         LDX   L03009A
         LDA   L030098
         STA   $EC
         STX   $EE
         LDY   #$000A
         LDA   [$EC],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         PHA
         LDA   $E7
         AND   #$00FF
         AND   #$0008
         PHA
         JSL   L061CB3
         PLY
         PLY
         PLY
         PLY
         PLY
         LDY   #$0008
         STA   [$F7],Y
L06214E  LDA   #$0001
         SEP   #$20
         STA   $E7
         REP   #$20
L062157  LDA   $DB
         CMP   #$FFFE
         BEQ   L0621AE
         LDA   #$000A
         PHA
         LDA   $DB
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         STA   $FB
         SEC
         SBC   #$0003
         BEQ   L06217C
         BVS   L06217A
         EOR   #$8000
L06217A  BMI   L0621AE
L06217C  LDA   $FB
         CMP   #$0003
         BNE   L0621A3
         PEI   $DB
         JSL   L060C4E
         PLY
         STX   $EA
         STA   $E8
         LDY   #$0004
         LDA   [$E8],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         LDY   #$0008
         STA   [$F7],Y
L0621A3  PEI   $DB
         JSL   L060D39
         PLY
         STA   $DB
         BRA   L062157
L0621AE  BRL   L06228D
L0621B1  LDA   $E7
         AND   #$00FF
         AND   #$0008
         TAY
         BEQ   L0621C7
         LDA   $E7
         AND   #$00FF
         AND   #$0004
         TAY
         BNE   L0621CC
L0621C7  LDA   #$0000
         BRA   L0621CF
L0621CC  LDA   #$0001
L0621CF  LDY   #$0004
         STA   [$F7],Y
         BRL   L06214E
L0621D7  LDA   #$0003
         PHA
         LDA   $E7
         AND   #$00FF
         AND   #$0008
         SEC
         JSL   L0222DF
         LDA   $FB
         AND   #$0001
         PLX
         STX   $EC
         CMP   $EC
         BNE   L0621F9
         LDA   #$0012
         BRA   L0621FC
L0621F9  LDA   #$0013
L0621FC  STA   [$F7]
         LDA   $E7
         AND   #$00FF
         AND   #$0004
         LDY   #$0004
         STA   [$F7],Y
         SEP   #$20
         STZ   $E7
         REP   #$20
         BRL   L062265
L062214  LDA   #$0003
         PHA
         LDA   $E7
         AND   #$00FF
         AND   #$0008
         SEC
         JSL   L0222DF
         LDA   $FB
         AND   #$0001
         PLX
         STX   $EC
         CMP   $EC
         BNE   L062238
         LDA   #$0010
         STA   [$F7]
         BRA   L06225C
L062238  LDA   #$0011
         STA   [$F7]
         LDA   $E7
         AND   #$00FF
         AND   #$0007
         LDY   #$0004
         STA   [$F7],Y
         PEI   $FF
         PEI   $FD
         JSL   L060E4D
         PLY
         PLY
         AND   #$03FF
         LDY   #$0006
         STA   [$F7],Y
L06225C  LDA   #$0001
         SEP   #$20
         STA   $E7
         REP   #$20
L062265  LDA   $DB
         CMP   #$FFFE
         BEQ   L06228D
         LDA   #$000A
         PHA
         LDA   $DB
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         CMP   #$0003
         BEQ   L062282
         BCS   L06228D
L062282  PEI   $DB
         JSL   L060D39
         PLY
         STA   $DB
         BRA   L062265
L06228D  LDA   $E7
         AND   #$00FF
         BEQ   L0622F4
         PEI   $FF
         PEI   $FD
         JSL   L0A66AC
         PLY
         PLY
         SEP   #$20
         STA   $E7
         REP   #$20
         AND   #$00FF
         BEQ   L0622F4
         SEP   #$20
         DEC   $E7
         REP   #$20
         LDA   $E7
         AND   #$00FF
         PHA
         LDAL  L05615C
         AND   #$00FF
         PLX
         STX   $EC
         SEC
         SBC   $EC
         BEQ   L0622CB
         BVS   L0622C9
         EOR   #$8000
L0622C9  BMI   L0622F4
L0622CB  LDA   $E7
         AND   #$00FF
         PHA
         LDAL  L05615D
         AND   #$00FF
         PLX
         STX   $EC
         SEC
         SBC   $EC
         BEQ   L0622F4
         BVS   L0622E5
         EOR   #$8000
L0622E5  BPL   L0622F4
         LDY   #$0008
         LDA   [$F7],Y
         ORA   #$8000
         LDY   #$0008
         STA   [$F7],Y
L0622F4  BRL   L062314
L0622F7  DA    L061EB9
         DA    L062115
         DA    L062098
         DA    L0621D7
         DA    L062214
         DA    L0621B1
         DA    L0620D1
         DA    L0622F4
L062307  CMP   #$0007
         BCC   L06230F
         LDA   #$0007
L06230F  ASL
         TAX
         JMP   (L0622F7,X)

L062314  LDA   $DB
         LDY   #$0002
         STA   [$F7],Y
L06231B  TAY
         TSC
         CLC
         ADC   #$0017
         TCS
         TYA
         PLD
         RTL

L062325  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   L03008A
         CMP   $FF
         BNE   L06233A
         BRL   L0624A4
L06233A  LDA   $FF
         STA   L03008A
         LDA   $FF
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300B6
         LDA   L0300B4
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STX   L0300A2
         STA   L0300A0
         LDA   $FF
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300AE
         LDA   L0300AC
         JSL   L021F00
         PLA
         PLX
         STX   L03009A
         STA   L030098
         LDX   L03009A
         LDA   L030098
         STA   $F4
         STX   $F6
         LDY   #$0008
         LDA   [$F4],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$001F
         CLC
         ADC   #$0001
         STA   L0300A4
         LDX   L03009A
         LDA   L030098
         STA   $F4
         STX   $F6
         LDY   #$0008
         LDA   [$F4],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         AND   #$001F
         CLC
         ADC   #$0001
         STA   L0300A6
         LDX   L03009A
         LDA   L030098
         STA   $F4
         STX   $F6
         LDY   #$000E
         LDA   [$F4],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050E1E
         LDX   #^L050E1E
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   $F4
         LDX   $F6
         PHX
         PHA
         PEA   ^L0510A3
         PEA   L0510A3
         PEA   $0002
         JSL   L02219C
         PLA
         PLA
         PLA
         PLA
         PLX
         LDX   L03009A
         LDA   L030098
         STA   $F4
         STX   $F6
         LDY   #$000E
         LDA   [$F4],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050E1E
         LDX   #^L050E1E
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   $F4
         LDX   $F6
         PHX
         PHA
         PEA   ^L0510A5
         PEA   L0510A5
         PEA   $0002
         JSL   L02219C
         PLA
         PLA
         PLA
         PLA
         PLX
         LDA   $FF
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300BE
         LDA   L0300BC
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300BA
         LDA   L0300B8
         JSL   L021F00
         PLA
         PLX
         STX   L03009E
         STA   L03009C
L0624A4  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L0624AE  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         STA   L030046
         PHA
         JSL   L062325
         PLY
         LDA   L0300A6
         LDX   #$0000
         TAY
         BPL   L0624CE
         DEX
L0624CE  PHX
         PHA
         LDA   L0300A4
         SEC
         SBC   #$0001
         LDX   #$0000
         TAY
         BPL   L0624DE
         DEX
L0624DE  STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         JSL   L021F00
         PLA
         PLX
         STX   $F2
         STA   $F0
         LDX   $F2
         LDA   $F0
         STX   L030092
         STA   L030090
         LDX   L03009A
         LDA   L030098
         STA   $F4
         STX   $F6
         LDY   #$000A
         LDA   [$F4],Y
         AND   #$000F
         STA   L030094
         PHA
         PEA   ^L05106A
         PEA   L05106A
         LDX   L03009A
         LDA   L030098
         STA   $F4
         STX   $F6
         LDY   #$000C
         LDA   [$F4],Y
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         LDX   #$0000
         PHX
         PHA
         LDX   $F2
         LDA   $F0
         JSL   L021F00
         PLA
         PLX
         STX   $F2
         STA   $F0
         PHX
         PHA
         JSL   L0202AB
         PLY
         PLY
         PLY
         PLY
         PLY
         LDX   L03009A
         LDA   L030098
         STA   $F4
         STX   $F6
         LDY   #$000A
         LDA   [$F4],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         STA   $EE
         PHA
         PEA   ^L05107A
         PEA   L05107A
         LDA   L030094
         LDX   #$0000
         TAY
         BPL   L062593
         DEX
L062593  PHX
         PHA
         LDX   $F2
         LDA   $F0
         JSL   L021F00
         PLA
         PLX
         STX   $F2
         STA   $F0
         PHX
         PHA
         JSL   L0202AB
         PLY
         PLY
         PLY
         PLY
         PLY
         LDX   L03009A
         LDA   L030098
         STA   $F4
         STX   $F6
         LDY   #$000C
         LDA   [$F4],Y
         AND   #$000F
         PHA
         PEA   ^L05108A
         PEA   L05108A
         LDA   $EE
         LDX   #$0000
         TAY
         BPL   L0625D0
         DEX
L0625D0  PHX
         PHA
         LDX   $F2
         LDA   $F0
         JSL   L021F00
         JSL   L0202AB
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   L030094
         LDX   #$0000
         PHX
         PHA
         LDA   #L05106A
         LDX   #^L05106A
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$0000
         SEP   #$20
         STA   [$F4]
         REP   #$20
         TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L06260C  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L060E4D
         PLY
         PLY
         STA   $F0
L062623  LDA   $F0
         CMP   #$FFFE
         BEQ   L062649
         LDA   #$000A
         PHA
         LDA   $F0
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         CMP   #$0004
         BEQ   L062649
         PEI   $F0
         JSL   L060D39
         PLY
         STA   $F0
         BRA   L062623
L062649  LDA   $F0
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L062655  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EB
         TCS
         LDA   L03008A
         PHA
         PEI   $FD
         PEI   $FB
         JSL   L0604B4
         PLY
         PLY
         PLY
         SEP   #$20
         STA   $EF
         REP   #$20
         AND   #$00FF
         CMP   #$00FF
         BNE   L062683
         LDA   #$0001
         BRL   L06277D
L062683  LDY   #$000E
         LDA   [$FB],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         SEP   #$20
         STA   $EE
         REP   #$20
         LDY   #$0004
         LDA   [$FB],Y
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         AND   #$0003
         CMP   #$0001
         BEQ   L0626CD
         BRL   L062749
L0626CD  LDA   L03008A
         PHA
         PEI   $FD
         PEI   $FB
         JSL   L060576
         PLY
         PLY
         PLY
         AND   #$0001
         PHA
         LDA   $FF
         AND   #$0001
         PLX
         STX   $F0
         CMP   $F0
         BNE   L0626F7
         LDA   $FF
         SEC
         SBC   #$0001
         AND   #$0003
         STA   $FF
L0626F7  LDA   $EE
         AND   #$00FF
         ASL
         PHA
         LDA   $EF
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         AND   #$0003
         SEP   #$20
         STA   $ED
         REP   #$20
         AND   #$00FF
         CMP   $FF
         BEQ   L06272F
         LDA   $ED
         AND   #$00FF
         PHA
         LDA   $FF
         CLC
         ADC   #$0001
         AND   #$0003
         PLX
         STX   $F0
         CMP   $F0
         BNE   L06273A
L06272F  LDA   $EE
         AND   #$00FF
         CLC
         ADC   #$0001
         BRA   L06277D
L06273A  LDA   $EE
         SEP   #$20
         DEC   $EE
         REP   #$20
         AND   #$00FF
         BNE   L0626F7
         BRA   L06277A
L062749  LDA   $EE
         AND   #$00FF
         ASL
         PHA
         LDA   $EF
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         AND   #$0003
         CMP   $FF
         BNE   L06276D
         LDA   $EE
         AND   #$00FF
         CLC
         ADC   #$0001
         BRA   L06277D
L06276D  LDA   $EE
         SEP   #$20
         DEC   $EE
         REP   #$20
         AND   #$00FF
         BNE   L062749
L06277A  LDA   #$0000
L06277D  TAY
         TSC
         CLC
         ADC   #$0009
         TCS
         TYA
         PLD
         RTL

L062787  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00DC
         TCS
         PEI   $F9
         PEI   $F7
         JSL   L06260C
         PLY
         PLY
         STA   $E2
         CMP   #$FFFE
         BNE   L0627AA
         LDA   #$0000
         BRA   L06280D
         BRA   L06280D
L0627AA  PEI   $E2
         JSL   L060C4E
         PLY
         STX   $EA
         STA   $E8
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEA   $0000
         TDC
         CLC
         ADC   #$00DE
         PHA
         JSL   L041D5F
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         STZ   $E6
L0627D6  LDA   $E6
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00DE
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         PHA
         PEI   $EA
         PEI   $E8
         JSL   L062655
         PLY
         PLY
         PLY
         STA   $E4
         TAY
         BEQ   L062809
         LDA   $E4
         BRA   L06280D
L062809  INC   $E6
         BRA   L0627D6
L06280D  TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PLD
         RTL

L062817  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDA   $FF
         AND   #$0003
         STA   $FF
         LDA   $FD
         ASL
         STA   $FD
         PHA
         LDA   $FF
         CLC
         JSL   L0222A8
         PLA
         STA   $FF
         LDA   $FD
         PHA
         LDA   #$0003
         CLC
         JSL   L0222A8
         PLA
         EOR   #$FFFF
         PHA
         LDA   $FB
         PLX
         STX   $F4
         AND   $F4
         PHA
         LDA   $FF
         PLX
         STX   $F4
         ORA   $F4
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L062862  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00DC
         TCS
         LDA   [$F9]
         LDX   #$0000
         TAY
         BPL   L062876
         DEX
L062876  STX   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDAL  L0510B9
         TAX
         LDAL  L0510B7
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
         LDY   #$0004
         LDA   [$EA],Y
         AND   #$00FF
         STA   $E0
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDY   #$0004
         LDA   [$EE],Y
         STA   $E6
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L0628D6
         EOR   #$8000
L0628D6  BPL   L0628DD
         LDA   #$0000
         BRA   L0628E0
L0628DD  LDA   #$0001
L0628E0  STA   $E2
         TAY
         BEQ   L0628F4
         LDY   #$000E
         LDA   [$EA],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         STA   $FD
L0628F4  LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $F9
         CLC
         ADC   #$000C
         LDX   $FB
         BCC   L062906
         INX
L062906  JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         AND   #$00C0
         STA   $E8
         LDA   #$000C
         PHA
         LDA   $E6
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
         STA   $E4
         TAY
         BEQ   L062955
         LDA   $E4
         PHA
         JSL   L02051C
         CLC
         JSL   L021F1A
         PLA
         STA   $E4
         JSL   L020564
         TAY
         BEQ   L06294F
         LDA   $E4
         EOR   #$FFFF
         INC
         AND   #$0007
         STA   $E4
L06294F  LDA   $E8
         ORA   $E4
         STA   $E8
L062955  LDA   #$000E
         PHA
         LDA   $E6
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
         STA   $E4
         TAY
         BEQ   L062999
         LDA   $E4
         PHA
         JSL   L02051C
         CLC
         JSL   L021F1A
         PLA
         STA   $E4
         JSL   L020564
         TAY
         BEQ   L06298A
         LDA   $E4
         EOR   #$FFFF
         INC
         AND   #$0007
         STA   $E4
L06298A  LDA   $E4
         ASL
         ASL
         ASL
         PHA
         LDA   $E8
         PLX
         STX   $F2
         ORA   $F2
         STA   $E8
L062999  LDA   $FF
         BNE   L0629A0
         BRL   L062A1A
L0629A0  LDA   $E6
         AND   #$0200
         TAY
         BNE   L0629AB
         BRL   L062A09
L0629AB  LDA   $E8
         AND   #$0080
         TAY
         BEQ   L0629E0
         LDA   $E0
         CMP   #$0012
         BNE   L0629E0
         JSL   L020564
         TAY
         BEQ   L0629DE
         LDA   $E8
         EOR   #$0040
         STA   $E8
         PEA   $0001
         LDA   L03010E
         PHA
         LDA   L03010C
         PHA
         PEA   $0010
         JSL   L083913
         PLY
         PLY
         PLY
         PLY
L0629DE  BRA   L062A07
L0629E0  LDA   $E8
         AND   #$0080
         TAY
         BEQ   L0629F0
         LDA   $E6
         AND   #$0400
         TAY
         BNE   L062A07
L0629F0  JSL   L020564
         TAY
         BEQ   L062A00
         LDA   $E8
         ORA   #$0040
         STA   $E8
         BRA   L062A07
L062A00  LDA   $E8
         AND   #$FFBF
         STA   $E8
L062A07  BRA   L062A10
L062A09  LDA   $E8
         AND   #$FFBF
         STA   $E8
L062A10  LDA   $E8
         ORA   #$0080
         STA   $E8
         BRL   L062A8B
L062A1A  LDA   $E6
         AND   #$0004
         TAY
         BNE   L062A25
         BRL   L062A7D
L062A25  LDA   $E0
         CMP   #$000D
         BNE   L062A64
         JSL   L020564
         TAY
         BEQ   L062A62
         LDA   $E8
         EOR   #$0040
         STA   $E8
         PEA   $000D
         JSL   L043A20
         PLY
         STA   $DE
         LDA   $DE
         CMP   #$0022
         BEQ   L062A4D
         BCS   L062A62
L062A4D  PEA   $0001
         LDA   L03010E
         PHA
         LDA   L03010C
         PHA
         PEI   $DE
         JSL   L083913
         PLY
         PLY
         PLY
         PLY
L062A62  BRA   L062A7B
L062A64  JSL   L020564
         TAY
         BEQ   L062A74
         LDA   $E8
         ORA   #$0040
         STA   $E8
         BRA   L062A7B
L062A74  LDA   $E8
         AND   #$FFBF
         STA   $E8
L062A7B  BRA   L062A84
L062A7D  LDA   $E8
         AND   #$FFBF
         STA   $E8
L062A84  LDA   $E8
         AND   #$FF7F
         STA   $E8
L062A8B  LDA   $E8
         PHA
         LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $F9
         CLC
         ADC   #$000C
         LDX   $FB
         BCC   L062AA0
         INX
L062AA0  JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $E2
         BEQ   L062ABF
         LDA   $FD
         DEC   $FD
         TAY
         BEQ   L062ABF
         BRL   L0628F4
L062ABF  LDY   #$0004
         LDA   [$EA],Y
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDY   #$0014
         LDA   [$EE],Y
         STA   $E8
         JSL   L020564
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         BEQ   L062B09
         LDA   $E8
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         BRA   L062B12
L062B09  LDA   $E8
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
L062B12  LDX   #$0000
         PHX
         PHA
         LDX   L030050
         LDA   L03004E
         JSL   L021F00
         PLA
         PLX
         JSL   L021F00
         PLA
         PLX
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         PLD
         RTL

L062B33  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00DC
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L06260C
         PLY
         PLY
         PHA
         JSL   L060C4E
         PLY
         STX   $F0
         STA   $EE
         LDY   #$000E
         LDA   [$EE],Y
         AND   #$000F
         CMP   #$0004
         BCC   L062B7A
         LDA   #$0000
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EE],Y
         AND   #$FFF0
         STA   $F6
         PLA
         ORA   $F6
         LDY   #$000E
         STA   [$EE],Y
         PLA
L062B7A  LDX   #$0000
         LDA   #$0018
         PHX
         PHA
         LDA   L03008A
         LDX   #$0000
         TAY
         BPL   L062B8C
         DEX
L062B8C  SEC
         JSL   L0222B8
         LDX   L030050
         LDA   L03004E
         CLC
         ADC   #$0001
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         JSL   L021F9F
         PLA
         PLX
         STX   $E0
         STA   $DE
         LDA   #$0025
         SEP   #$20
         STA   $E2
         REP   #$20
         LDY   #$0004
         LDA   [$EE],Y
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0006
         LDA   [$F2],Y
         AND   #$00FF
         PHA
         LDA   #$00FF
         PLX
         STX   $F6
         SEC
         SBC   $F6
         SEP   #$20
         STA   $E3
         REP   #$20
         LDA   #$0000
         SEP   #$20
         STA   $E6
         REP   #$20
         LDA   $FD
         SEP   #$20
         STA   $E4
         REP   #$20
         LDA   $FF
         SEP   #$20
         STA   $E5
         REP   #$20
         PEA   $0000
         TDC
         CLC
         ADC   #$00DE
         PHA
         JSL   L044ED1
         PLY
         PLY
         TSC
         CLC
         ADC   #$001A
         TCS
         PLD
         RTL

L062C24  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
         LDX   L0303E3
         LDA   L0303E1
         STX   $F0
         STA   $EE
         STZ   $EC
         BRA   L062CA4
L062C3D  LDX   #$0000
         LDA   #$0018
         PHX
         PHA
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         SEC
         JSL   L022303
         PLA
         PLX
         PHA
         LDA   L03008A
         PLX
         STX   $F2
         CMP   $F2
         BNE   L062C96
         LDY   #$0004
         LDA   [$EE],Y
         AND   #$00FF
         STA   $EA
         CMP   #$001C
         BEQ   L062C96
         BCC   L062C96
         LDA   $EA
         CMP   #$002A
         BCS   L062C96
         LDY   #$0006
         LDA   [$EE],Y
         AND   #$00FF
         CMP   $FD
         BNE   L062C96
         LDY   #$0007
         LDA   [$EE],Y
         AND   #$00FF
         CMP   $FF
         BNE   L062C96
         PEI   $EC
         JSL   L044E12
         PLY
L062C96  LDA   $EE
         CLC
         ADC   #$0010
         STA   $EE
         BCC   L062CA2
         INC   $F0
L062CA2  INC   $EC
L062CA4  LDA   $EC
         CMP   L0303DF
         BCC   L062C3D
         TSC
         CLC
         ADC   #$000E
         TCS
         PLD
         RTL

L062CB3  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EA
         TCS
         STZ   $EC
         BRA   L062CEE
L062CC2  LDA   $EC
         INC   $EC
         LDX   #$0000
         PHX
         PHA
         LDA   $F9
         CLC
         ADC   #$000C
         LDX   $FB
         BCC   L062CD6
         INX
L062CD6  JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         AND   #$FF7F
         SEP   #$20
         STA   [$EE]
         REP   #$20
L062CEE  LDA   $EC
         SEC
         SBC   #$0004
         BVS   L062CF9
         EOR   #$8000
L062CF9  BPL   L062CC2
         PEI   $FF
         PEI   $FD
         JSL   L062C24
         PLY
         PLY
         TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L062D0D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00DA
         TCS
         LDX   L030108
         LDA   L030106
         STX   $E6
         STA   $E4
         STZ   $DC
L062D24  LDA   [$E4]
         SEC
         SBC   #$0000
         BVS   L062D2F
         EOR   #$8000
L062D2F  BPL   L062D4B
         INC   $DC
         LDA   $DC
         CMP   L03010A
         BCC   L062D3D
         BRL   L062E93
L062D3D  LDA   $E4
         CLC
         ADC   #$0010
         STA   $E4
         BCC   L062D49
         INC   $E6
L062D49  BRA   L062D24
L062D4B  INC   L030104
         LDA   $FB
         AND   #$03FF
         STA   [$E4]
         LDX   #$0000
         TAY
         BPL   L062D5C
         DEX
L062D5C  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDAL  L0510B9
         TAX
         LDAL  L0510B7
         JSL   L021F00
         PLA
         PLX
         STX   $EA
         STA   $E8
         LDY   #$0005
         LDA   [$E8],Y
         SEP   #$20
         LDY   #$0003
         STA   [$E4],Y
         REP   #$20
         LDA   $DC
         SEP   #$20
         LDY   #$0005
         STA   [$E8],Y
         REP   #$20
         LDA   $FD
         SEP   #$20
         LDY   #$000A
         STA   [$E4],Y
         REP   #$20
         SEP   #$20
         LDY   #$0008
         STA   [$E4],Y
         REP   #$20
         LDA   $FF
         SEP   #$20
         LDY   #$000B
         STA   [$E4],Y
         REP   #$20
         SEP   #$20
         LDY   #$0009
         STA   [$E4],Y
         REP   #$20
         LDX   L030050
         LDA   L03004E
         SEC
         SBC   #$007F
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         SEP   #$20
         LDY   #$0004
         STA   [$E4],Y
         REP   #$20
         LDY   #$0004
         LDA   [$E8],Y
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         AND   #$0003
         CMP   #$0001
         BEQ   L062E15
         LDA   #$0000
         BRA   L062E18
L062E15  LDA   #$0001
L062E18  STA   $DE
         LDY   #$000E
         LDA   [$E8],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         STA   $EC
L062E29  LDY   #$000E
         LDA   [$E8],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         PHA
         PEI   $EC
         LDY   #$0002
         LDA   [$E4],Y
         AND   #$00FF
         PHA
         JSL   L062817
         PLY
         PLY
         PLY
         SEP   #$20
         LDY   #$0002
         STA   [$E4],Y
         REP   #$20
         LDA   $EC
         LDX   #$0000
         PHX
         PHA
         LDA   $E4
         CLC
         ADC   #$000C
         LDX   $E6
         BCC   L062E67
         INX
L062E67  JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0000
         SEP   #$20
         STA   [$F0]
         REP   #$20
         LDA   $EC
         DEC   $EC
         TAY
         BNE   L062E29
         PEA   $0000
         PEA   $FFFF
         PEI   $E6
         PEI   $E4
         JSL   L062862
         PLY
         PLY
         PLY
         PLY
L062E93  TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PLD
         RTL

L062E9D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E6
         TCS
         LDA   $FF
         CMP   L03010A
         BEQ   L062EB1
         BCS   L062EE5
L062EB1  LDA   $FF
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BVS   L062EE3
         EOR   #$8000
L062EE3  BMI   L062EE8
L062EE5  BRL   L062FA6
L062EE8  LDA   $FF
         LDX   #$0000
         STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STX   $F2
         STA   $F0
         LDA   [$F0]
         LDX   #$0000
         TAY
         BPL   L062F18
         DEX
L062F18  STX   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDAL  L0510B9
         TAX
         LDAL  L0510B7
         JSL   L021F00
         PLA
         PLX
         STX   $EE
         STA   $EC
         DEC   L030104
         LDY   #$0003
         LDA   [$F0],Y
         SEP   #$20
         LDY   #$0005
         STA   [$EC],Y
         REP   #$20
         LDY   #$0002
         LDA   [$F0],Y
         AND   #$00FF
         AND   #$0003
         AND   #$0003
         PHA
         PHA
         LDY   #$000E
         LDA   [$EC],Y
         AND   #$FCFF
         STA   $F8
         PLA
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ORA   $F8
         LDY   #$000E
         STA   [$EC],Y
         PLA
         LDY   #$000E
         LDA   [$EC],Y
         AND   #$000F
         CMP   #$0004
         BCC   L062FA1
         LDA   #$0000
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EC],Y
         AND   #$FFF0
         STA   $F8
         PLA
         ORA   $F8
         LDY   #$000E
         STA   [$EC],Y
         PLA
L062FA1  LDA   #$FFFF
         STA   [$F0]
L062FA6  TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         PLD
         RTL

L062FB0  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00D6
         TCS
         LDA   L03010A
         SEC
         SBC   #$0005
         CMP   L030104
         BEQ   L062FC9
         BCS   L062FD1
L062FC9  LDA   L03008A
         CMP   L030046
         BEQ   L062FE0
L062FD1  PEA   $0004
         JSL   L061767
         PLY
         STA   $E0
         CMP   #$FFFF
         BNE   L062FE6
L062FE0  LDA   #$FFFF
         BRL   L063159
L062FE6  PEI   $E0
         JSL   L060C4E
         PLY
         STX   $E8
         STA   $E6
         LDA   #$FFFE
         LDY   #$0002
         STA   [$E6],Y
         LDA   #$0000
         AND   #$0001
         PHA
         PHA
         LDY   #$000E
         LDA   [$E6],Y
         AND   #$FBFF
         STA   $EE
         PLA
         XBA
         AND   #$FF00
         ASL
         ASL
         ORA   $EE
         LDY   #$000E
         STA   [$E6],Y
         PLA
         LDA   $FB
         AND   #$0003
         PHA
         PHA
         LDY   #$000E
         LDA   [$E6],Y
         AND   #$FCFF
         STA   $EE
         PLA
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ORA   $EE
         LDY   #$000E
         STA   [$E6],Y
         PLA
         LDA   $F9
         AND   #$0003
         PHA
         PHA
         LDY   #$000E
         LDA   [$E6],Y
         AND   #$FF9F
         STA   $EE
         PLA
         ASL
         ASL
         ASL
         ASL
         ASL
         ORA   $EE
         LDY   #$000E
         STA   [$E6],Y
         PLA
         LDA   $F9
         STA   $D8
         TAY
         BEQ   L06306A
         JSL   L020599
         STA   $DC
         BRA   L06306F
L06306A  LDA   #$00FF
         STA   $DA
L06306F  LDA   $F5
         SEP   #$20
         LDY   #$0004
         STA   [$E6],Y
         REP   #$20
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STX   $E4
         STA   $E2
         LDY   #$0009
         LDA   [$E2],Y
         AND   #$00FF
         STA   $DE
L0630A6  LDA   $DE
         LSR
         LSR
         CLC
         ADC   #$0001
         PHA
         JSL   L02051C
         CLC
         JSL   L021F1A
         LDA   $F7
         PHA
         LDA   $DE
         CLC
         JSL   L0220A5
         PLA
         PLX
         STX   $EE
         CLC
         ADC   $EE
         PHA
         LDA   $F9
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $E6
         CLC
         ADC   #$0006
         LDX   $E8
         BCC   L0630DD
         INX
L0630DD  JSL   L021F00
         PLA
         PLX
         STA   $EA
         STX   $EC
         PLA
         STA   [$EA]
         LDA   $D8
         BEQ   L063116
         LDA   $DC
         INC   $DC
         PHA
         PEI   $F9
         PEI   $DA
         JSL   L062817
         PLY
         PLY
         PLY
         STA   $DA
         LDY   #$0002
         LDA   [$E2],Y
         AND   #$0003
         CMP   #$0001
         BNE   L06310F
         INC   $DC
L06310F  LDA   $DC
         AND   #$0003
         STA   $DC
L063116  LDA   $F9
         DEC   $F9
         TAY
         BNE   L0630A6
         LDA   $DA
         SEP   #$20
         LDY   #$0005
         STA   [$E6],Y
         REP   #$20
         PEI   $FF
         PEI   $FD
         PEA   $0000
         PEA   $FFFF
         PEI   $E0
         JSL   L042D63
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L063145
         LDA   #$FFFF
         BRA   L063159
L063145  PEA   $0001
         PEI   $FF
         PEI   $FD
         PEA   $0011
         JSL   L083913
         PLY
         PLY
         PLY
         PLY
         LDA   $E0
L063159  TAY
         TSC
         CLC
         ADC   #$0018
         TCS
         TYA
         PLD
         RTL

L063163  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00D8
         TCS
         STZ   $DC
         STZ   $DA
         LDA   $F7
         BRL   L0631F3
L063177  BRL   L06335C
L06317A  LDA   #L050DCE
         LDX   #^L050DCE
         STX   $EA
         STA   $E8
         BRL   L06322F
L063187  LDA   #L050DD4
         LDX   #^L050DD4
         STX   $EA
         STA   $E8
         BRL   L06322F
L063194  LDA   #L050DD8
         LDX   #^L050DD8
         STX   $EA
         STA   $E8
         BRL   L06322F
L0631A1  LDA   #$0001
         STA   $DC
         LDA   #L050DDC
         LDX   #^L050DDC
         STX   $EA
         STA   $E8
         BRL   L06322F
L0631B3  LDA   #L050DEA
         LDX   #^L050DEA
         STX   $EA
         STA   $E8
         BRL   L06322F
L0631C0  LDA   #L050DF4
         LDX   #^L050DF4
         STX   $EA
         STA   $E8
         BRL   L06322F
L0631CD  LDA   #L050DFA
         LDX   #^L050DFA
         STX   $EA
         STA   $E8
         BRL   L06322F
L0631DA  LDA   #L050E00
         LDX   #^L050E00
         STX   $EA
         STA   $E8
         BRL   L06322F
L0631E7  LDA   #L050E08
         LDX   #^L050E08
         STX   $EA
         STA   $E8
         BRA   L06322F
L0631F3  CMP   #$0004
         BEQ   L0631C0
         CMP   #$0006
         BEQ   L0631CD
         CMP   #$0007
         BEQ   L0631B3
         CMP   #$0009
         BNE   L06320A
         BRL   L063187
L06320A  CMP   #$000C
         BNE   L063212
         BRL   L06317A
L063212  CMP   #$000F
         BEQ   L0631DA
         CMP   #$0010
         BNE   L06321F
         BRL   L063194
L06321F  CMP   #$0012
         BNE   L063227
         BRL   L0631A1
L063227  CMP   #$0018
         BEQ   L0631E7
         JMP   L063177

L06322F  LDX   $EA
         LDA   $E8
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $E8
         LDA   $EA
         BCC   L063240
         INC
L063240  STA   $EA
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         STA   $E2
         TAY
         BNE   L063252
         BRL   L063341
L063252  LDA   $E2
         AND   #$8000
         TAY
         BEQ   L063263
         JSL   L020564
         TAY
         BEQ   L063263
         BRA   L06322F
L063263  LDA   $E2
         AND   #$7FFF
         STA   $E2
         CMP   #$007F
         BCC   L06327E
         LDA   #$000A
         STA   $E0
         LDA   $E2
         SEC
         SBC   #$007F
         STA   $E2
         BRA   L0632A6
L06327E  LDA   $E2
         CMP   #$0045
         BCC   L063294
         LDA   #$0006
         STA   $E0
         LDA   $E2
         SEC
         SBC   #$0045
         STA   $E2
         BRA   L0632A6
L063294  LDA   #$0001
         STA   $DA
         LDA   #$0005
         STA   $E0
         LDA   $E2
         SEC
         SBC   #$0017
         STA   $E2
L0632A6  PEI   $E0
         JSL   L061767
         PLY
         STA   $DE
         CMP   #$FFFF
         BNE   L0632B7
         BRL   L06322F
L0632B7  PEI   $DE
         JSL   L060C4E
         PLY
         STX   $E6
         STA   $E4
         LDA   $E2
         AND   #$007F
         PHA
         PHA
         LDY   #$0002
         LDA   [$E4],Y
         AND   #$FF80
         STA   $F0
         PLA
         ORA   $F0
         LDY   #$0002
         STA   [$E4],Y
         PLA
         LDA   $DC
         AND   #$0001
         PHA
         PHA
         LDY   #$0002
         LDA   [$E4],Y
         AND   #$FEFF
         STA   $F0
         PLA
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ORA   $F0
         LDY   #$0002
         STA   [$E4],Y
         PLA
         LDA   #$000E
         PHA
         LDA   $FD
         CMP   #$00FF
         BEQ   L063310
         JSL   L020599
         TAY
         BNE   L063316
L063310  JSL   L020599
         BRA   L063318
L063316  LDA   $FD
L063318  CLC
         JSL   L0222A8
         LDA   $DE
         AND   #$3FFF
         PLX
         STX   $F0
         ORA   $F0
         STA   $DE
         PEI   $FB
         PEI   $F9
         PEA   $0000
         PEA   $FFFF
         PEI   $DE
         JSL   L042D63
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L06322F
L063341  PEI   $FF
         PEI   $FB
         PEI   $F9
         LDA   $DA
         BEQ   L063350
         LDA   #$0000
         BRA   L063353
L063350  LDA   #$0004
L063353  PHA
         JSL   L083913
         PLY
         PLY
         PLY
         PLY
L06335C  TAY
         TSC
         CLC
         ADC   #$0018
         TCS
         TYA
         PLD
         RTL

L063366  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E8
         TCS
         LDA   L030122
         BNE   L063379
         BRL   L0633C9
L063379  PEI   $FB
         JSL   L060C4E
         PLY
         STX   $EE
         STA   $EC
         LDY   #$0004
         LDA   [$EC],Y
         AND   #$00FF
         STA   $EA
L06338E  LDA   L030122
         BEQ   L0633C9
         PEA   $0002
         LDA   L030122
         DEC
         STA   L030122
         LDX   #$0000
         PHX
         PHA
         LDA   #L051AAC
         LDX   #^L051AAC
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00FF
         PHA
         PEI   $FF
         PEI   $FD
         PEI   $EA
         JSL   L063163
         PLY
         PLY
         PLY
         PLY
         PLY
         BRA   L06338E
L0633C9  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L0633D1  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00DC
         TCS
         PEI   $FD
         JSL   L060C4E
         PLY
         STX   $EC
         STA   $EA
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L0633F2
         EOR   #$8000
L0633F2  BMI   L0633F7
         BRL   L06347F
L0633F7  LDY   #$0004
         LDA   [$EA],Y
         AND   #$00FF
         STA   $E4
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDY   #$0002
         LDA   [$EE],Y
         AND   #$0200
         TAY
         BEQ   L06347F
         LDY   #$000E
         LDA   [$EA],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         STA   $E2
         LDA   L03008A
         PHA
         PEI   $EC
         PEI   $EA
         JSL   L0604B4
         PLY
         PLY
         PLY
         STA   $E0
L06344B  PEI   $FF
         LDA   $E0
         CMP   #$00FF
         BNE   L063459
         LDA   #$00FF
         BRA   L063468
L063459  LDA   $E2
         ASL
         PHA
         LDA   $E0
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
L063468  PHA
         PEI   $FB
         PEI   $F9
         PEI   $E4
         JSL   L063163
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $E2
         DEC   $E2
         TAY
         BNE   L06344B
L06347F  LDY   #$0002
         LDA   [$EA],Y
         STA   $E8
         CMP   #$FFFE
         BNE   L06348E
         BRL   L063511
L06348E  STZ   $DE
L063490  PEI   $E8
         JSL   L060D39
         PLY
         STA   $E6
         LDA   #$000E
         PHA
         JSL   L020599
         CLC
         JSL   L0222A8
         LDA   $E8
         AND   #$3FFF
         PLX
         STX   $F2
         ORA   $F2
         STA   $E8
         LDA   #$000A
         PHA
         LDA   $E8
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         CMP   #$0005
         BNE   L0634CB
         LDA   #$0001
         STA   $DE
L0634CB  PEI   $FB
         PEI   $F9
         PEA   $0000
         PEA   $FFFF
         PEI   $E8
         JSL   L042D63
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $E6
         STA   $E8
         CMP   #$FFFE
         BNE   L063490
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L0634F4
         EOR   #$8000
L0634F4  BPL   L063511
         PEI   $FF
         PEI   $FB
         PEI   $F9
         LDA   $DE
         BEQ   L063505
         LDA   #$0000
         BRA   L063508
L063505  LDA   #$0004
L063508  PHA
         JSL   L083913
         PLY
         PLY
         PLY
         PLY
L063511  TSC
         CLC
         ADC   #$0016
         TCS
         PLD
         RTL

L063519  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EA
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L06260C
         PLY
         PLY
         STA   $EC
         CMP   #$FFFE
         BNE   L063538
         BRL   L0635BC
L063538  PEI   $EC
         JSL   L060C4E
         PLY
         STX   $F0
         STA   $EE
         PEA   $0008
         LDA   $EE
         CLC
         ADC   #$0006
         TAX
         LDA   $F0
         BCC   L063552
         INC
L063552  PHA
         PHX
         JSL   L020232
         PLY
         PLY
         PLY
         PEA   $0000
         PEA   $FFFF
         PEI   $FF
         PEI   $FD
         PEI   $EC
         JSL   L042D63
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   #$FFFF
         STA   [$EE]
         LDA   L03008A
         CMP   L030046
         BNE   L0635B2
         LDY   #$0005
         LDA   [$EE],Y
         AND   #$00FF
         LDX   #$0000
         STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   #$FFFF
         STA   [$F2]
         DEC   L030104
L0635B2  PEI   $FF
         PEI   $FD
         JSL   L062C24
         PLY
         PLY
L0635BC  TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PLD
         RTL

L0635C6  ENT
         PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$00CA
         TCS
         LDY   #$0004
         LDA   [$F3],Y
         AND   #$00FF
         STA   $D4
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STX   $E6
         STA   $E4
         LDY   #$0002
         LDA   [$E4],Y
         AND   #$2000
         TAY
         BEQ   L063608
         BRL   L063A47
L063608  LDA   $F7
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $F3
         CLC
         ADC   #$0006
         LDX   $F5
         BCC   L06361B
         INX
L06361B  JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         PHA
         LDA   $FD
         PLX
         STX   $E8
         CMP   $E8
         BCS   L063634
         BRL   L063A14
L063634  LDA   L03008A
         PHA
         PEI   $F5
         PEI   $F3
         JSL   L0604B4
         PLY
         PLY
         PLY
         STA   $D2
         LDA   $D2
         CMP   #$00FF
         BNE   L063651
         LDA   #$00FF
         BRA   L063660
L063651  LDA   $F7
         ASL
         PHA
         LDA   $D2
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
L063660  STA   $CC
         LDY   #$000E
         LDA   [$F3],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         STA   $D6
         TAY
         BNE   L0636A4
         LDA   $FF
         BEQ   L06369C
         PEA   $0002
         PEI   $FB
         PEI   $F9
         JSL   L06260C
         PLY
         PLY
         PHA
         PEI   $FB
         PEI   $F9
         JSL   L0633D1
         PLY
         PLY
         PLY
         PLY
         PEI   $FB
         PEI   $F9
         JSL   L063519
         PLY
         PLY
L06369C  LDA   #$0002
         STA   $E0
         BRL   L0639D1
L0636A4  LDA   L03008A
         PHA
         PEI   $F5
         PEI   $F3
         JSL   L060576
         PLY
         PLY
         PLY
         STA   $D0
         LDY   #$0002
         LDA   [$E4],Y
         AND   #$0200
         TAY
         BEQ   L063702
         LDA   $FF
         BEQ   L0636DA
         PEA   $0002
         PEI   $CC
         PEI   $FB
         PEI   $F9
         PEI   $D4
         JSL   L063163
         PLY
         PLY
         PLY
         PLY
         PLY
         BRA   L063702
L0636DA  LDA   $CC
         PHA
         LDA   L030122
         PHA
         INC
         STA   L030122
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L051AAC
         LDX   #^L051AAC
         JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         PLA
         SEP   #$20
         STA   [$E8]
         REP   #$20
L063702  LDA   L03008A
         CMP   L030046
         BEQ   L06370F
         LDA   #$0000
         BRA   L063712
L06370F  LDA   #$0001
L063712  STA   $CE
         TAY
         BEQ   L063744
         LDY   #$0005
         LDA   [$F3],Y
         AND   #$00FF
         LDX   #$0000
         STX   $EC
         ASL
         ROL   $EC
         ASL
         ROL   $EC
         ASL
         ROL   $EC
         ASL
         ROL   $EC
         LDX   $EC
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STX   $DA
         STA   $D8
L063744  LDY   #$000E
         LDA   [$F3],Y
         AND   #$000F
         CMP   #$0006
         BEQ   L063754
         BRL   L06389E
L063754  LDX   L0303E3
         LDA   L0303E1
         STX   $DE
         STA   $DC
         STZ   $E2
         BRL   L06381A
L063763  LDX   #$0000
         LDA   #$0018
         PHX
         PHA
         LDY   #$0002
         LDA   [$DC],Y
         TAX
         LDA   [$DC]
         SEC
         JSL   L022303
         PLA
         PLX
         PHA
         LDA   L03008A
         PLX
         STX   $E8
         CMP   $E8
         BEQ   L063788
         BRL   L06380C
L063788  LDY   #$0006
         LDA   [$DC],Y
         AND   #$00FF
         CMP   $F9
         BEQ   L063797
         BRL   L06380C
L063797  LDY   #$0007
         LDA   [$DC],Y
         AND   #$00FF
         CMP   $FB
         BEQ   L0637A6
         BRL   L06380C
L0637A6  LDY   #$0004
         LDA   [$DC],Y
         AND   #$00FF
         STA   $E0
         CMP   #$0020
         BEQ   L06380C
         BCC   L06380C
         LDA   $E0
         CMP   #$002A
         BCS   L06380C
         LDA   $E0
         CMP   #$0025
         BCS   L0637CF
         LDA   $E0
         SEC
         SBC   #$0021
         STA   $E0
         BRA   L0637D7
L0637CF  LDA   $E0
         SEC
         SBC   #$0026
         STA   $E0
L0637D7  LDA   $E0
         CMP   $F7
         BNE   L0637E6
         PEI   $E2
         JSL   L044E12
         PLY
         BRA   L06380C
L0637E6  LDA   $E0
         CMP   $F7
         BEQ   L06380C
         BCC   L06380C
         LDY   #$0004
         LDA   [$DC],Y
         PHA
         DEC
         SEP   #$20
         LDY   #$0004
         STA   [$DC],Y
         REP   #$20
         PLA
         PEI   $E2
         JSL   L044B12
         PLY
         PHA
         JSL   L044B6D
         PLY
L06380C  LDA   $DC
         CLC
         ADC   #$0010
         STA   $DC
         BCC   L063818
         INC   $DE
L063818  INC   $E2
L06381A  LDA   $E2
         CMP   L0303DF
         BCS   L063824
         BRL   L063763
L063824  LDA   $CE
         BEQ   L06389E
         LDY   #$0010
         LDA   [$E4],Y
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         STA   $D4
         CMP   #$000F
         BEQ   L06389E
         LDA   $D6
         SEC
         SBC   #$0001
         PHA
         LDA   $D4
         PLX
         STX   $EC
         CLC
         ADC   $EC
         STA   $D4
         PHA
         JSL   L02051C
         AND   #$000F
         PLX
         STX   $E8
         CMP   $E8
         BEQ   L06389E
         BCC   L06389E
         LDA   $D4
         ASL
         ASL
         PHA
         LDA   #$0064
         PLX
         STX   $EC
         SEC
         SBC   $EC
         PHA
         JSL   L02051C
         CLC
         JSL   L021F1A
         PLA
         CLC
         ADC   #$0014
         SEP   #$20
         LDY   #$0005
         STA   [$D8],Y
         REP   #$20
         LDA   #$0005
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$F3],Y
         AND   #$FFF0
         STA   $EC
         PLA
         ORA   $EC
         LDY   #$000E
         STA   [$F3],Y
         PLA
L06389E  LDA   $F7
         STA   $E2
         STA   $E0
         BRL   L06396B
L0638A7  INC   $E0
         LDA   $E0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $F3
         CLC
         ADC   #$0006
         LDX   $F5
         BCC   L0638BC
         INX
L0638BC  JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         PHA
         LDA   $E2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $F3
         CLC
         ADC   #$0006
         LDX   $F5
         BCC   L0638DC
         INX
L0638DC  JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         PLA
         STA   [$E8]
         LDA   $E0
         ASL
         PHA
         LDA   $D0
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
         PHA
         PEI   $E2
         PEI   $D0
         JSL   L062817
         PLY
         PLY
         PLY
         STA   $D0
         LDA   $E0
         ASL
         PHA
         LDA   $D2
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
         PHA
         PEI   $E2
         PEI   $D2
         JSL   L062817
         PLY
         PLY
         PLY
         STA   $D2
         LDA   $CE
         BEQ   L063969
         LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   $D8
         CLC
         ADC   #$000C
         LDX   $DA
         BCC   L063939
         INX
L063939  JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         PHA
         LDA   $E2
         LDX   #$0000
         PHX
         PHA
         LDA   $D8
         CLC
         ADC   #$000C
         LDX   $DA
         BCC   L063958
         INX
L063958  JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         PLA
         SEP   #$20
         STA   [$E8]
         REP   #$20
L063969  INC   $E2
L06396B  LDA   $E2
         CMP   $D6
         BCS   L063974
         BRL   L0638A7
L063974  LDA   $D2
         AND   #$003F
         STA   $D2
         LDA   L03008A
         PHA
         PEI   $D2
         PEI   $F5
         PEI   $F3
         JSL   L060515
         PLY
         PLY
         PLY
         PLY
         LDA   L03008A
         PHA
         PEI   $D0
         PEI   $F5
         PEI   $F3
         JSL   L0605F5
         PLY
         PLY
         PLY
         PLY
         LDY   #$000E
         LDA   [$F3],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         PHA
         DEC
         AND   #$0003
         PHA
         PHA
         LDY   #$000E
         LDA   [$F3],Y
         AND   #$FF9F
         STA   $EC
         PLA
         ASL
         ASL
         ASL
         ASL
         ASL
         ORA   $EC
         LDY   #$000E
         STA   [$F3],Y
         PLA
         PLA
         LDA   #$0001
         STA   $E0
L0639D1  LDY   #$0002
         LDA   [$E4],Y
         AND   #$0003
         STA   $E2
         CMP   #$0000
         BNE   L0639E7
         LDA   #$006E
         STA   $E2
         BRA   L0639FA
L0639E7  LDA   $E2
         CMP   #$0001
         BNE   L0639F5
         LDA   #$00BE
         STA   $E2
         BRA   L0639FA
L0639F5  LDA   #$00FF
         STA   $E2
L0639FA  PEI   $CC
         PEI   $FB
         PEI   $F9
         PEI   $E2
         PEA   $FFA8
         JSL   L040156
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $E0
         BRA   L063A4A
         BRA   L063A4A
L063A14  LDA   $FD
         SEC
         SBC   #$0000
         BEQ   L063A47
         BVS   L063A21
         EOR   #$8000
L063A21  BPL   L063A47
         LDA   $F7
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $F3
         CLC
         ADC   #$0006
         LDX   $F5
         BCC   L063A36
         INX
L063A36  JSL   L021F00
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         SEC
         SBC   $FD
         STA   [$E8]
L063A47  LDA   #$0000
L063A4A  TAY
         TSC
         CLC
         ADC   #$0022
         TCS
         TYA
         PLD
         RTL

L063A54  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00DE
         TCS
         STZ   $E2
         LDA   #$0001
         STA   $E0
         STZ   L030122
         LDA   $FD
         SEC
         SBC   #$0000
         BNE   L063A74
         BRL   L063B25
L063A74  BVS   L063A79
         EOR   #$8000
L063A79  BMI   L063A7E
         BRL   L063B25
L063A7E  LDY   #$000E
         LDA   [$F5],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         STA   $E6
         LDA   #$0003
         PHA
         LDA   $FD
         SEC
         JSL   L0222DF
         PLA
         CLC
         ADC   #$0001
         STA   $E8
         PHA
         LDA   $FD
         PLX
         STX   $EE
         SEC
         SBC   $EE
         STA   $FD
         LDA   $E8
         ASL
         STA   $E8
L063AAF  PEI   $FF
         LDA   $E8
         PHA
         JSL   L02051C
         CLC
         JSL   L021F1A
         LDA   $FD
         PLX
         STX   $EE
         CLC
         ADC   $EE
         PHA
         PEI   $FB
         PEI   $F9
         PEI   $E6
         PEI   $F7
         PEI   $F5
         JSL   L0635C6
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         STA   $E4
         TAY
         BEQ   L063AE5
         LDA   $E0
         BNE   L063AEA
L063AE5  LDA   #$0000
         BRA   L063AED
L063AEA  LDA   #$0001
L063AED  STA   $E0
         LDA   $E2
         BNE   L063AFC
         LDA   $E4
         BNE   L063AFC
         LDA   #$0000
         BRA   L063AFF
L063AFC  LDA   #$0001
L063AFF  STA   $E2
         LDA   $E6
         DEC   $E6
         TAY
         BNE   L063AAF
         LDA   $E0
         BEQ   L063B13
         LDA   #$0002
         BRA   L063B28
         BRA   L063B23
L063B13  LDA   $E2
         BEQ   L063B1E
         LDA   #$0001
         BRA   L063B28
         BRA   L063B23
L063B1E  LDA   #$0000
         BRA   L063B28
L063B23  BRA   L063B28
L063B25  LDA   #$0000
L063B28  TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         PLD
         RTL

L063B32  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         LDA   $FF
         BEQ   L063B79
         LDA   $FD
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0012
         LDA   [$F2],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         STA   $F0
         CMP   #$000F
         BNE   L063B80
L063B79  LDA   #$0000
         BRA   L063B9B
         BRA   L063B9B
L063B80  INC   $F0
         LDA   $F0
         PHA
         JSL   L020599
         PHA
         LDA   $FF
         PLX
         STX   $F6
         CLC
         ADC   $F6
         ASL
         ASL
         ASL
         CLC
         JSL   L021F1A
         PLY
L063B9B  TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L063BA5  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E0
         TCS
         STZ   $E2
         LDA   $FF
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STX   $EE
         STA   $EC
         PHX
         PHA
         JSL   L0A60F7
         PLY
         PLY
         PHA
         LDA   #$0064
         PLX
         STX   $F4
         SEC
         SBC   $F4
         STA   $EA
         JSL   L02051C
         AND   #$0007
         STA   $E6
L063BF0  LDA   $EA
         SEC
         SBC   #$0000
         BNE   L063BFB
         BRL   L063CCD
L063BFB  BVS   L063C00
         EOR   #$8000
L063C00  BMI   L063C05
         BRL   L063CCD
L063C05  PEI   $EA
         PEI   $EE
         PEI   $EC
         JSL   L0A5EC2
         PLY
         PLY
         PLY
         TAY
         BEQ   L063C18
         BRL   L063CCD
L063C18  LDA   $E6
         LDX   #$0000
         PHX
         PHA
         LDA   #L051BD1
         LDX   #^L051BD1
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00FF
         STA   $E8
         CMP   #$000D
         BNE   L063C52
         LDA   #$0011
         PHA
         JSL   L02051C
         CLC
         JSL   L021F1A
         LDA   $E8
         PLX
         STX   $F4
         CLC
         ADC   $F4
         STA   $E8
L063C52  LDA   $E8
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   $EC
         CLC
         ADC   #$00D3
         LDX   $EE
         BCC   L063C65
         INX
L063C65  JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         STA   $E4
         CMP   #$FFFF
         BEQ   L063CB9
         LDA   #$0001
         STA   $E2
         PEI   $E8
         PEI   $FF
         JSL   L0A4E78
         PLY
         PLY
         STA   $E4
         LDY   #$0002
         LDA   [$FB],Y
         CMP   #$FFFE
         BNE   L063C9C
         LDA   $E4
         LDY   #$0002
         STA   [$FB],Y
         BRA   L063CB2
L063C9C  PEA   $0000
         PEA   $FFFF
         LDY   #$0002
         LDA   [$FB],Y
         PHA
         PEI   $E4
         JSL   L060EE7
         PLY
         PLY
         PLY
         PLY
L063CB2  PEI   $FF
         JSL   L0A3E20
         PLY
L063CB9  INC   $E6
         LDA   $E6
         AND   #$0007
         STA   $E6
         LDA   $EA
         SEC
         SBC   #$0014
         STA   $EA
         BRL   L063BF0
L063CCD  JSL   L02051C
         AND   #$0007
         TAY
         BEQ   L063CE2
         LDA   $E2
         BEQ   L063D40
         JSL   L020564
         TAY
         BEQ   L063D40
L063CE2  JSL   L02051C
         AND   #$003F
         CLC
         ADC   #$0014
         PHA
         LDY   #$0005
         LDA   [$FB],Y
         AND   #$00FF
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         SEP   #$20
         LDY   #$0005
         STA   [$F0],Y
         REP   #$20
         LDA   #$0005
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$FB],Y
         AND   #$FFF0
         STA   $F4
         PLA
         ORA   $F4
         LDY   #$000E
         STA   [$FB],Y
         PLA
L063D40  TSC
         CLC
         ADC   #$0014
         TCS
         PLD
         RTL

L063D48  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         STZ   $F4
         BRA   L063D94
L063D57  LDA   $F4
         LDX   #$0000
         STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEC
         SBC   #$0000
         BVS   L063D89
         EOR   #$8000
L063D89  BPL   L063D92
         PEI   $F4
         JSL   L062E9D
         PLY
L063D92  INC   $F4
L063D94  LDA   L030104
         CMP   #$0000
         BEQ   L063D9E
         BCS   L063D57
L063D9E  TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L063DA6  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E6
         TCS
         LDX   L0300A2
         LDA   L0300A0
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STX   $F4
         STA   $F2
         LDX   L03009E
         LDA   L03009C
         STA   $F6
         STX   $F8
         LDA   [$F6]
         LDX   #$0000
         STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDX   L0300C4
         LDA   L0300C2
         JSL   L021F00
         PLA
         PLX
         STX   $F0
         STA   $EE
         STZ   $EC
         BRL   L063E84
L063DF4  STZ   $EA
         BRL   L063E76
L063DF9  LDX   $F4
         LDA   $F2
         INC   $F2
         BNE   L063E03
         INC   $F4
L063E03  STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         AND   #$0010
         TAY
         BEQ   L063E74
         LDX   $F0
         LDA   $EE
         PHX
         PHA
         CLC
         ADC   #$0002
         STA   $EE
         LDA   $F0
         BCC   L063E23
         INC
L063E23  STA   $F0
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         STA   $E8
L063E2F  LDA   #$000A
         PHA
         LDA   $E8
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         CMP   #$0004
         BNE   L063E66
         PEI   $EA
         PEI   $EC
         JSL   L062C24
         PLY
         PLY
         PEI   $EA
         PEI   $EC
         PEI   $E8
         JSL   L062D0D
         PLY
         PLY
         PLY
         PEI   $EA
         PEI   $EC
         JSL   L062B33
         PLY
         PLY
         BRA   L063E74
L063E66  PEI   $E8
         JSL   L060D39
         PLY
         STA   $E8
         CMP   #$FFFE
         BNE   L063E2F
L063E74  INC   $EA
L063E76  LDA   L0300A6
         CMP   $EA
         BEQ   L063E82
         BCC   L063E82
         BRL   L063DF9
L063E82  INC   $EC
L063E84  LDA   L0300A4
         CMP   $EC
         BEQ   L063E90
         BCC   L063E90
         BRL   L063DF4
L063E90  TSC
         CLC
         ADC   #$0014
         TCS
         PLD
         RTL

L063E98  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   L030030
         BEQ   L063EAE
         LDA   #$003C
         STA   L03010A
L063EAE  PEA   $0001
         LDA   L03010A
         ASL
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L030108
         STA   L030106
         STZ   $F4
         BRA   L063EFC
L063ECE  LDA   $F4
         INC   $F4
         LDX   #$0000
         STX   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$FFFF
         STA   [$F6]
L063EFC  LDA   $F4
         CMP   L03010A
         BCC   L063ECE
         TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L063F0B  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E6
         TCS
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   $FD
         LDX   #$0000
         STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $EC
         LSR
         LSR
         LSR
         LSR
         LSR
         STA   $EA
         CMP   #$0004
         BNE   L063FB9
         PEI   $FF
         PEI   $FD
         JSL   L060CD1
         PLY
         PLY
         STX   $F0
         STA   $EE
         LDA   $EC
         AND   #$0007
         STA   $E8
         CMP   #$0003
         BEQ   L063F84
         LDA   $E8
         CMP   #$0004
         BNE   L063FAD
L063F84  LDY   #$0002
         LDA   [$EE],Y
         AND   #$0001
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0510A3
         LDX   #^L0510A3
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         AND   #$0001
         TAY
         BEQ   L063FB2
L063FAD  LDA   #$0000
         BRA   L063FB5
L063FB2  LDA   #$0001
L063FB5  BRA   L063FD7
         BRA   L063FD7
L063FB9  LDA   $EA
         CMP   #$0000
         BEQ   L063FD4
         LDA   $EA
         CMP   #$0006
         BNE   L063FCF
         LDA   $EC
         AND   #$0004
         TAY
         BEQ   L063FD4
L063FCF  LDA   #$0000
         BRA   L063FD7
L063FD4  LDA   #$0001
L063FD7  TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         PLD
         RTL

L063FE1  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   $FD
         LDX   #$0000
         STX   $F6
         ASL
         ROL   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$0002
         LDA   [$F2],Y
         TAX
         LDA   [$F2]
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         STA   $F0
         LSR
         LSR
         LSR
         LSR
         LSR
         STA   $EE
         CMP   #$0000
         BEQ   L06404D
         LDA   $EE
         CMP   #$0006
         BNE   L064048
         LDA   $F0
         AND   #$0004
         TAY
         BEQ   L06404D
L064048  LDA   #$0000
         BRA   L064050
L06404D  LDA   #$0001
L064050  TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L06405A  PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00D4
         TCS
         LDA   $FB
         PHA
         LDA   $F7
         PLX
         STX   $EE
         SEC
         SBC   $EE
         PHA
         JSL   L020467
         PLY
         PHA
         LDA   $F9
         PHA
         LDA   $F5
         PLX
         STX   $EE
         SEC
         SBC   $EE
         PHA
         JSL   L020467
         PLY
         PLX
         STX   $EE
         CLC
         ADC   $EE
         SEC
         SBC   #$0001
         BEQ   L06409B
         BVS   L064099
         EOR   #$8000
L064099  BMI   L0640A1
L06409B  LDA   #$0001
         BRL   L064363
L0640A1  LDA   $F9
         SEC
         SBC   $F5
         STA   $E4
         SEC
         SBC   #$0000
         BVS   L0640B1
         EOR   #$8000
L0640B1  BMI   L0640BB
         LDA   $E4
         EOR   #$FFFF
         INC
         BRA   L0640BD
L0640BB  LDA   $E4
L0640BD  STA   $E4
         PHA
         LDA   $FB
         SEC
         SBC   $F7
         STA   $E2
         SEC
         SBC   #$0000
         BVS   L0640D0
         EOR   #$8000
L0640D0  BMI   L0640DA
         LDA   $E2
         EOR   #$FFFF
         INC
         BRA   L0640DC
L0640DA  LDA   $E2
L0640DC  STA   $E2
         PLX
         STX   $EA
         SEC
         SBC   $EA
         BEQ   L0640ED
         BVS   L0640EB
         EOR   #$8000
L0640EB  BMI   L0640F2
L0640ED  LDA   #$0000
         BRA   L0640F5
L0640F2  LDA   #$0001
L0640F5  STA   $DE
         LDA   $E4
         CMP   $E2
         BEQ   L064102
         LDA   #$0000
         BRA   L064105
L064102  LDA   #$0001
L064105  STA   $D8
         LDA   $F9
         STA   $E4
         SEC
         SBC   $F5
         SEC
         SBC   #$0000
         BEQ   L064120
         BVS   L064119
         EOR   #$8000
L064119  BPL   L064120
         LDA   #$FFFF
         BRA   L064123
L064120  LDA   #$0001
L064123  STA   $E8
         LDA   $FB
         STA   $E2
         SEC
         SBC   $F7
         SEC
         SBC   #$0000
         BEQ   L06413E
         BVS   L064137
         EOR   #$8000
L064137  BPL   L06413E
         LDA   #$FFFF
         BRA   L064141
L06413E  LDA   #$0001
L064141  STA   $E6
         LDA   $DE
         BEQ   L06416C
         LDA   $E2
         SEC
         SBC   $F7
         STA   $E0
         TAY
         BEQ   L064167
         LDA   $E0
         PHA
         LDA   $E4
         SEC
         SBC   $F5
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         SEC
         JSL   L021F1A
         PLY
         BRA   L06416A
L064167  LDA   #$0080
L06416A  BRA   L06418F
L06416C  LDA   $E4
         SEC
         SBC   $F5
         STA   $E0
         TAY
         BEQ   L06418C
         LDA   $E0
         PHA
         LDA   $E2
         SEC
         SBC   $F7
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         SEC
         JSL   L021F1A
         PLY
         BRA   L06418F
L06418C  LDA   #$0080
L06418F  STA   $D6
L064191  LDA   $D8
         BEQ   L0641E5
         PEI   $E2
         LDA   $E4
         CLC
         ADC   $E8
         PHA
         LDA   $FD
         LDX   $FF
         JSL   L022569
         PLY
         PLY
         TAY
         BEQ   L0641BF
         LDA   $E2
         CLC
         ADC   $E6
         PHA
         PEI   $E4
         LDA   $FD
         LDX   $FF
         JSL   L022569
         PLY
         PLY
         TAY
         BNE   L0641DC
L0641BF  LDA   $E2
         CLC
         ADC   $E6
         STA   $E2
         PHA
         LDA   $E4
         CLC
         ADC   $E8
         STA   $E4
         PHA
         LDA   $FD
         LDX   $FF
         JSL   L022569
         PLY
         PLY
         TAY
         BEQ   L0641E2
L0641DC  LDA   #$0000
         BRL   L064363
L0641E2  BRL   L06431A
L0641E5  LDA   $DE
         BEQ   L064211
         LDA   $E2
         SEC
         SBC   $F7
         STA   $E0
         TAY
         BEQ   L06420C
         LDA   $E0
         PHA
         LDA   $E4
         CLC
         ADC   $E8
         SEC
         SBC   $F5
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         SEC
         JSL   L021F1A
         PLY
         BRA   L06420F
L06420C  LDA   #$0080
L06420F  BRA   L064237
L064211  LDA   $E4
         CLC
         ADC   $E8
         SEC
         SBC   $F5
         STA   $E0
         TAY
         BEQ   L064234
         LDA   $E0
         PHA
         LDA   $E2
         SEC
         SBC   $F7
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         SEC
         JSL   L021F1A
         PLY
         BRA   L064237
L064234  LDA   #$0080
L064237  SEC
         SBC   $D6
         STA   $E0
         SEC
         SBC   #$0000
         BVS   L064245
         EOR   #$8000
L064245  BMI   L06424F
         LDA   $E0
         EOR   #$FFFF
         INC
         BRA   L064251
L06424F  LDA   $E0
L064251  STA   $DC
         PHA
         LDA   $DE
         BEQ   L064280
         LDA   $E2
         CLC
         ADC   $E6
         SEC
         SBC   $F7
         STA   $E0
         TAY
         BEQ   L06427B
         LDA   $E0
         PHA
         LDA   $E4
         SEC
         SBC   $F5
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         SEC
         JSL   L021F1A
         PLY
         BRA   L06427E
L06427B  LDA   #$0080
L06427E  BRA   L0642A6
L064280  LDA   $E4
         SEC
         SBC   $F5
         STA   $E0
         TAY
         BEQ   L0642A3
         LDA   $E0
         PHA
         LDA   $E2
         CLC
         ADC   $E6
         SEC
         SBC   $F7
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         SEC
         JSL   L021F1A
         PLY
         BRA   L0642A6
L0642A3  LDA   #$0080
L0642A6  SEC
         SBC   $D6
         STA   $E0
         SEC
         SBC   #$0000
         BVS   L0642B4
         EOR   #$8000
L0642B4  BMI   L0642BE
         LDA   $E0
         EOR   #$FFFF
         INC
         BRA   L0642C0
L0642BE  LDA   $E0
L0642C0  STA   $DA
         PLX
         STX   $EA
         SEC
         SBC   $EA
         BEQ   L0642DA
         BVS   L0642CF
         EOR   #$8000
L0642CF  BPL   L0642DA
         LDA   $E4
         CLC
         ADC   $E8
         STA   $E4
         BRA   L0642E1
L0642DA  LDA   $E2
         CLC
         ADC   $E6
         STA   $E2
L0642E1  PEI   $E2
         PEI   $E4
         LDA   $FD
         LDX   $FF
         JSL   L022569
         PLY
         PLY
         TAY
         BEQ   L06431A
         LDA   $DC
         CMP   $DA
         BNE   L064315
         LDA   $E2
         SEC
         SBC   $E6
         STA   $E2
         PHA
         LDA   $E4
         CLC
         ADC   $E8
         STA   $E4
         PHA
         LDA   $FD
         LDX   $FF
         JSL   L022569
         PLY
         PLY
         TAY
         BEQ   L06431A
L064315  LDA   #$0000
         BRA   L064363
L06431A  LDA   $F7
         PHA
         LDA   $E2
         PLX
         STX   $EE
         SEC
         SBC   $EE
         PHA
         JSL   L020467
         PLY
         PHA
         LDA   $F5
         PHA
         LDA   $E4
         PLX
         STX   $EE
         SEC
         SBC   $EE
         PHA
         JSL   L020467
         PLY
         PLX
         STX   $EE
         CLC
         ADC   $EE
         SEC
         SBC   #$0001
         BEQ   L064353
         BVS   L06434E
         EOR   #$8000
L06434E  BPL   L064353
         BRL   L064191
L064353  PEI   $FB
         PEI   $F9
         PEI   $F7
         PEI   $F5
         JSL   L041B2C
         PLY
         PLY
         PLY
         PLY
L064363  TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PLD
         RTL

L06436D  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00D6
         TCS
         LDY   #$0004
         LDA   [$F7],Y
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STX   $EA
         STA   $E8
         LDAL  L0561A6
         AND   #$00FF
         BEQ   L0643B9
         LDY   #$0002
         LDA   [$E8],Y
         AND   #$0800
         TAY
         BNE   L0643B9
         LDA   #$0000
         BRL   L064553
L0643B9  LDY   #$0002
         LDA   [$E8],Y
         AND   #$0004
         TAY
         BEQ   L0643CA
         BRL   L0644ED
         BRL   L0644AB
L0643CA  LDY   #$0005
         LDA   [$F7],Y
         AND   #$00FF
         LDX   #$0000
         STX   $F0
         ASL
         ROL   $F0
         ASL
         ROL   $F0
         ASL
         ROL   $F0
         ASL
         ROL   $F0
         LDX   $F0
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDY   #$0002
         LDA   [$EC],Y
         AND   #$00FF
         STA   $E0
         LDA   $FB
         SEC
         SBC   #$0000
         BVS   L06440C
         EOR   #$8000
L06440C  BPL   L064411
         BRL   L064495
L064411  STZ   $E4
         LDY   #$000E
         LDA   [$F7],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         STA   $FB
         BRA   L064486
L064424  LDA   $FB
         ASL
         PHA
         LDA   $E0
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
         STA   $E6
         LDA   $E4
         STA   $E2
L064439  LDA   $E2
         DEC   $E2
         TAY
         BEQ   L064464
         LDA   $E2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D8
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         CMP   $E6
         BNE   L064462
         BRA   L064484
L064462  BRA   L064439
L064464  LDA   $E4
         INC   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D8
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   $E6
         STA   [$EC]
L064484  DEC   $FB
L064486  LDA   $FB
         SEC
         SBC   #$0000
         BVS   L064491
         EOR   #$8000
L064491  BMI   L064424
         BRA   L0644AB
L064495  LDA   $FB
         ASL
         PHA
         LDA   $E0
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
         STA   $D8
         LDA   #$0001
         STA   $E4
L0644AB  LDA   $E4
         DEC   $E4
         TAY
         BNE   L0644B5
         BRL   L064550
L0644B5  LDA   L030042
         PHA
         LDA   L030040
         PHA
         PEI   $FF
         PEI   $FD
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D8
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         PHA
         JSL   L041B80
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L0644ED
         BRL   L06454D
L0644ED  LDY   #$000E
         LDA   [$E8],Y
         AND   #$000F
         STA   $E2
         LDY   #$0002
         LDA   [$E8],Y
         AND   #$1000
         TAY
         BNE   L064518
         LDA   #$0001
         PHA
         LDA   L03003C
         SEC
         JSL   L0222DF
         LDA   $E2
         PLX
         STX   $F0
         SEC
         SBC   $F0
         STA   $E2
L064518  PEI   $E2
         PEA   $0001
         JSL   L0204BA
         PLY
         PLY
         CMP   L030112
         BCS   L06452D
         LDA   #$0000
         BRA   L064553
L06452D  PEA   ^L063F0B
         PEA   L063F0B
         LDA   L030042
         PHA
         LDA   L030040
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L06405A
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         BRA   L064553
L06454D  BRL   L0644AB
L064550  LDA   #$0000
L064553  TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PLD
         RTL

L06455D  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E8
         TCS
         LDY   #$000E
         LDA   [$F9],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         STA   $EC
         TAY
         BNE   L064583
         LDA   #$0000
         BRL   L064668
L064583  LDA   $EC
         CLC
         ADC   #$0001
         LSR
         CMP   L030112
         BCC   L0645C0
         PEA   ^L063FE1
         PEA   L063FE1
         LDA   L030042
         PHA
         LDA   L030040
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L06405A
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BEQ   L0645C0
         LDA   L030116
         STA   L030010
         LDA   L030114
         CLC
         ADC   #$0001
         BRL   L064668
L0645C0  PEI   $FF
         PEI   $FD
         JSL   L0A66AC
         PLY
         PLY
         STA   $EA
         TAY
         BNE   L0645D2
         BRL   L064665
L0645D2  JSL   L020599
         PHA
         LDA   $EA
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDA   #L05618E
         LDX   #^L05618E
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         PLX
         STX   $F2
         CLC
         ADC   $F2
         PHA
         LDA   $EC
         ASL
         PHA
         LDA   #$001E
         PLX
         STX   $F2
         SEC
         SBC   $F2
         PLX
         STX   $EE
         CMP   $EE
         BCS   L064665
         LDA   $EA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05615E
         LDX   #^L05615E
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$001F
         PHA
         LDA   $EA
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05615E
         LDX   #^L05615E
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$001F
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L041C4E
         PLY
         PLY
         PLY
         PLY
         CLC
         ADC   #$0001
         BRA   L064668
L064665  LDA   #$0000
L064668  TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L064672  PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00DA
         TCS
         LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   #L051AA4
         LDX   #^L051AA4
         JSL   L021F00
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   #$0001
         SEP   #$20
         STA   [$EA]
         REP   #$20
         LDA   #$FFFE
         STA   L03011C
         STZ   L03011E
         STZ   L030120
         LDY   #$0006
         LDA   [$F5],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L0646BC
         LDA   #$0000
         BRL   L064984
L0646BC  PEA   $0000
         TDC
         CLC
         ADC   #$00FB
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00F9
         PHA
         PEA   $0000
         PEA   $0001
         PEI   $FD
         JSL   L0606CB
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDA   $F9
         STA   $E4
         LDA   $FB
         STA   $E2
         LDA   $E4
         SEC
         SBC   #$0000
         BVS   L0646F5
         EOR   #$8000
L0646F5  BMI   L0646FA
         BRL   L0647CC
L0646FA  LDA   $E4
         SEC
         SBC   L0300A4
         BVS   L064705
         EOR   #$8000
L064705  BPL   L06470A
         BRL   L0647CC
L06470A  LDA   $E2
         SEC
         SBC   #$0000
         BVS   L064715
         EOR   #$8000
L064715  BMI   L06471A
         BRL   L0647CC
L06471A  LDA   $E2
         SEC
         SBC   L0300A6
         BVS   L064725
         EOR   #$8000
L064725  BPL   L06472A
         BRL   L0647CC
L06472A  LDA   $E2
         LDX   #$0000
         TAY
         BPL   L064733
         DEX
L064733  PHX
         PHA
         LDA   $E4
         LDX   #$0000
         TAY
         BPL   L06473E
         DEX
L06473E  STX   $EE
         ASL
         ROL   $EE
         ASL
         ROL   $EE
         LDX   $EE
         PHX
         PHA
         LDX   L0300A2
         LDA   L0300A0
         JSL   L021F00
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         JSL   L021F00
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   [$EA]
         AND   #$00FF
         STA   $E0
         LSR
         LSR
         LSR
         LSR
         LSR
         STA   $DE
         CMP   #$0000
         BEQ   L0647CC
         LDA   $DE
         CMP   #$0003
         BEQ   L0647CC
         LDA   $DE
         CMP   #$0002
         BNE   L0647AC
         LDA   $E0
         AND   #$0001
         TAY
         BEQ   L064799
         LDA   $FF
         BNE   L0647AC
L064799  LDA   $E0
         AND   #$0008
         TAY
         BEQ   L0647AC
         LDY   #$0002
         LDA   [$F5],Y
         AND   #$0020
         TAY
         BEQ   L0647CC
L0647AC  LDA   $DE
         CMP   #$0006
         BNE   L0647C7
         LDA   $E0
         AND   #$0004
         TAY
         BNE   L0647C7
         LDA   $E0
         AND   #$0001
         TAY
         BEQ   L0647CC
         LDA   $FF
         BEQ   L0647CC
L0647C7  LDA   #$0000
         BRA   L0647CF
L0647CC  LDA   #$0001
L0647CF  STA   L03011A
         TAY
         BEQ   L0647DB
         LDA   #$0000
         BRL   L064984
L0647DB  LDY   #$0002
         LDA   [$F5],Y
         AND   #$2000
         TAY
         BNE   L0647E9
         BRL   L064865
L0647E9  PEI   $E2
         PEI   $E4
         JSL   L060E4D
         PLY
         PLY
         STA   $DC
L0647F5  LDA   $DC
         CMP   #$FFFE
         BNE   L0647FF
         BRL   L064865
L0647FF  LDA   #$000A
         PHA
         LDA   $DC
         AND   #$3C00
         CLC
         JSL   L0222DF
         PLA
         CMP   #$000F
         BNE   L06485A
         PEI   $DC
         JSL   L060C4E
         PLY
         STX   $E8
         STA   $E6
         LDY   #$0002
         LDA   [$E6],Y
         AND   #$007F
         CMP   #$0032
         BNE   L06485A
         LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   #L051AA8
         LDX   #^L051AA8
         JSL   L021F00
         PLA
         PLX
         STA   $EA
         STX   $EC
         LDA   #$0001
         SEP   #$20
         STA   [$EA]
         REP   #$20
         INC   L030118
         LDA   #$0001
         STA   L03011A
         LDA   #$0000
         BRL   L064984
L06485A  PEI   $DC
         JSL   L060D39
         PLY
         STA   $DC
         BRA   L0647F5
L064865  LDA   $DE
         CMP   #$0005
         BEQ   L06486F
         BRL   L0648DA
L06486F  LDA   $E0
         AND   #$0008
         TAY
         BEQ   L0648DA
         LDA   #$000C
         PHA
         LDY   #$0010
         LDA   [$F5],Y
         CLC
         JSL   L0222DF
         PLA
         CMP   #$000A
         BCC   L0648DA
         PEI   $E2
         PEI   $E4
         JSL   L060CD1
         PLY
         PLY
         STX   $E8
         STA   $E6
         LDY   #$0002
         LDA   [$E6],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         AND   #$0001
         TAY
         BEQ   L0648DA
         LDY   #$0004
         LDA   [$E6],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$00FF
         PHA
         LDA   L030110
         PHA
         JSL   L060000
         PLY
         PLY
         TAY
         BNE   L0648DA
         LDA   #$0001
         STA   L03011A
         LDA   #$0000
         BRL   L064984
L0648DA  LDA   L03008A
         CMP   L030046
         BNE   L0648F0
         LDA   $E4
         CMP   L030040
         BNE   L0648F0
         LDA   $E2
         CMP   L030042
         BEQ   L0648F5
L0648F0  LDA   #$0000
         BRA   L0648F8
L0648F5  LDA   #$0001
L0648F8  STA   L030120
         TAY
         BEQ   L064904
         LDA   #$0000
         BRL   L064984
L064904  LDA   $DE
         CMP   #$0004
         BNE   L06496A
         PEI   $E2
         PEI   $E4
         JSL   L060CD1
         PLY
         PLY
         STX   $E8
         STA   $E6
         LDA   $E0
         AND   #$0007
         PHA
         LDY   #$0002
         LDA   [$E6],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0001
         TAY
         BEQ   L064940
         LDY   #$0002
         LDA   [$F5],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         BRA   L064943
L064940  LDA   #$0001
L064943  PLX
         STX   $EA
         CMP   $EA
         BCS   L06496A
         LDA   $E0
         AND   #$0007
         CMP   #$0005
         BEQ   L06496A
         LDY   #$0002
         LDA   [$F5],Y
         AND   #$0040
         TAY
         BNE   L06496A
         LDA   #$0001
         STA   L03011E
         LDA   #$0000
         BRA   L064984
L06496A  PEI   $E2
         PEI   $E4
         JSL   L06260C
         PLY
         PLY
         STA   L03011C
         CMP   #$FFFE
         BEQ   L064981
         LDA   #$0000
         BRA   L064984
L064981  LDA   #$0001
L064984  TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PLD
         RTL

L06498E  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E8
         TCS
         STZ   $EA
         BRA   L0649E0
L06499D  LDA   $EA
         LDX   #$0000
         PHX
         PHA
         LDA   #L051AA4
         LDX   #^L051AA4
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         BNE   L0649DE
         PEI   $FF
         PEI   $EA
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         JSL   L064672
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BEQ   L0649DE
         LDA   $EA
         CLC
         ADC   #$0001
         BRA   L0649F2
L0649DE  INC   $EA
L0649E0  LDA   $EA
         SEC
         SBC   #$0003
         BEQ   L06499D
         BVS   L0649ED
         EOR   #$8000
L0649ED  BPL   L06499D
         LDA   #$0000
L0649F2  TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L0649FC  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L051AA8
         LDX   #^L051AA8
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         BEQ   L064A2A
         LDA   #$0000
         BRA   L064A8D
L064A2A  LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05045C
         LDX   #^L05045C
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         PHA
         LDA   $FB
         PLX
         STX   $F0
         CLC
         ADC   $F0
         STA   $FB
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050464
         LDX   #^L050464
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         PHA
         LDA   $FD
         PLX
         STX   $F0
         CLC
         ADC   $F0
         STA   $FD
         PEA   $0000
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         JSL   L064672
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
L064A8D  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L064A97  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E8
         TCS
         LDA   $FF
         BEQ   L064ACB
         LDX   L030126
         LDA   L030124
         PHX
         PHA
         LDX   L030050
         LDA   L03004E
         JSL   L022171
         BNE   L064ACB
         LDA   $F7
         CMP   L030128
         BNE   L064ACB
         LDA   $F9
         CMP   L03012A
         BNE   L064ACB
         BRL   L064B57
L064ACB  LDA   $FD
         ASL
         PHA
         LDY   #$0002
         LDA   [$F7],Y
         AND   #$00FF
         STA   $EA
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
         SEC
         SBC   $FB
         AND   #$0003
         CMP   #$0002
         BNE   L064B10
         JSL   L02051C
         AND   #$0002
         CLC
         ADC   $FB
         CLC
         ADC   #$0001
         AND   #$0003
         STA   $FB
         PHA
         PEI   $FD
         PEI   $EA
         JSL   L062817
         PLY
         PLY
         PLY
         STA   $EA
         BRA   L064B1F
L064B10  PEI   $FB
         PEI   $FD
         PEI   $EA
         JSL   L062817
         PLY
         PLY
         PLY
         STA   $EA
L064B1F  LDA   $FF
         BEQ   L064B4C
         PEI   $FB
         LDA   $FD
         EOR   #$0001
         PHA
         PEI   $EA
         JSL   L062817
         PLY
         PLY
         PLY
         STA   $EA
         LDX   L030050
         LDA   L03004E
         STX   L030126
         STA   L030124
         LDX   $F9
         LDA   $F7
         STX   L03012A
         STA   L030128
L064B4C  LDA   $EA
         SEP   #$20
         LDY   #$0002
         STA   [$F7],Y
         REP   #$20
L064B57  TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L064B61  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E8
         TCS
         LDA   $FD
         BEQ   L064B77
         LDA   $FF
         CMP   #$0001
         BEQ   L064B7C
L064B77  LDA   #$0000
         BRA   L064B7F
L064B7C  LDA   #$0001
L064B7F  STA   $EA
         TAY
         BEQ   L064B86
         DEC   $FD
L064B86  LDA   $FD
         BEQ   L064B91
         JSL   L020564
         TAY
         BEQ   L064BA4
L064B91  PEI   $EA
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         JSL   L064A97
         PLY
         PLY
         PLY
         PLY
         PLY
L064BA4  LDA   $FD
         DEC   $FD
         TAY
         BNE   L064B86
         TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L064BB3  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00CA
         TCS
         LDX   L030050
         LDA   L03004E
         STX   L03000A
         STA   L030008
         LDY   #$0005
         LDA   [$F7],Y
         AND   #$00FF
         LDX   #$0000
         STX   $F0
         ASL
         ROL   $F0
         ASL
         ROL   $F0
         ASL
         ROL   $F0
         ASL
         ROL   $F0
         LDX   $F0
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   $EC
         LDX   $EE
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00CC
         PHA
         PEA   $0010
         JSL   L02219C
         PLA
         PLA
         PLA
         PLA
         PLX
         LDY   #$0004
         LDA   [$F7],Y
         AND   #$00FF
         STA   $E6
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STX   $EA
         STA   $E8
         LDA   L030114
         STA   $E4
         LDA   $CF
         AND   #$00FF
         STA   $E2
         CMP   #$00FF
         BNE   L064C54
         JSL   L020564
         STA   $E2
         BRA   L064C70
L064C54  LDA   $FF
         ASL
         PHA
         LDA   $E2
         CLC
         JSL   L0222DF
         PLA
         AND   #$0003
         CLC
         ADC   #$0005
         SEC
         SBC   $E4
         AND   #$0002
         LSR
         STA   $E2
L064C70  LDA   $E2
         CLC
         ADC   $E4
         STA   $E2
         LDA   $E2
         AND   #$0003
         STA   $E2
         LDA   #$000C
         PHA
         LDY   #$000E
         LDA   [$E8],Y
         CLC
         JSL   L0222DF
         PLA
         CMP   #$0001
         BNE   L064C95
         BRL   L064DF0
L064C95  BCS   L064C9A
         BRL   L064DF0
L064C9A  LDA   L030112
         CMP   #$0001
         BEQ   L064CA4
         BCS   L064CAE
L064CA4  JSL   L020564
         TAY
         BNE   L064CAE
         BRL   L064DF0
L064CAE  LDA   $E6
         BRL   L064D3A
L064CB3  JSL   L020564
         TAY
         BEQ   L064CC2
         LDA   #$FF80
         STA   $E6
         BRL   L064D00
L064CC2  JSL   L020599
         BRL   L064CF3
L064CC9  LDA   #$FF83
         STA   $E6
         BRL   L064D00
L064CD1  LDA   #$FF82
         STA   $E6
         BRL   L064D00
L064CD9  LDA   #$FF87
         STA   $E6
         BRL   L064D00
L064CE1  LDA   #$FF84
         STA   $E6
L064CE6  BRL   L064D00
L064CE9  DA    L064CC9
         DA    L064CD1
         DA    L064CD9
         DA    L064CE1
         DA    L064CE6
L064CF3  CMP   #$0004
         BCC   L064CFB
         LDA   #$0004
L064CFB  ASL
         TAX
         JMP   (L064CE9,X)

L064D00  BRL   L064D63
L064D03  LDA   #$FF81
         STA   $E6
         BRL   L064D63
L064D0B  JSL   L02051C
         AND   #$0007
         TAY
         BEQ   L064D1C
         LDA   #$FF82
         STA   $E6
         BRA   L064D21
L064D1C  LDA   #$FF84
         STA   $E6
L064D21  BRL   L064D63
L064D24  JSL   L020564
         TAY
         BEQ   L064D33
         LDA   #$FF87
         STA   $E6
         BRL   L064D63
L064D33  LDA   #$FF80
         STA   $E6
         BRA   L064D63
L064D3A  CMP   #$0001
         BEQ   L064D03
         CMP   #$0003
         BEQ   L064D0B
         CMP   #$000E
         BNE   L064D4C
         BRL   L064CB3
L064D4C  CMP   #$0013
         BEQ   L064D24
         CMP   #$0016
         BEQ   L064D33
         CMP   #$0017
         BNE   L064D5E
         BRL   L064CB3
L064D5E  CMP   #$0018
         BEQ   L064D33
L064D63  LDA   #$0002
         PHA
         LDY   #$000A
         LDA   [$E8],Y
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         CLC
         ADC   #$0001
         STA   $E0
         LDA   $E0
         PHA
         JSL   L02051C
         CLC
         JSL   L021F1A
         LDA   $E0
         PLX
         STX   $F0
         CLC
         ADC   $F0
         STA   $E0
         LDA   $E0
         PHA
         JSL   L02051C
         CLC
         JSL   L021F1A
         LDA   $E0
         PLX
         STX   $F0
         CLC
         ADC   $F0
         STA   $E0
         PEA   $0000
         PEI   $FD
         PEI   $FB
         PEA   $000D
         JSL   L083913
         PLY
         PLY
         PLY
         PLY
         PEA   $0008
         LDY   #$000C
         LDA   [$E8],Y
         AND   #$00FF
         PHA
         PEA   $00FF
         PEI   $E0
         PEA   $0014
         JSL   L0204E3
         PLY
         PLY
         PLY
         PHA
         LDA   L030114
         PHA
         PEI   $E2
         PEI   $FD
         PEI   $FB
         PEI   $E6
         JSL   L040000
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         BRL   L064EEF
L064DF0  LDY   #$0002
         LDA   [$E8],Y
         AND   #$0010
         TAY
         BEQ   L064E56
         JSL   L020599
         STA   $E2
         STZ   $E0
         BRA   L064E12
L064E05  LDA   $E2
         CLC
         ADC   #$0001
         AND   #$0003
         STA   $E2
         INC   $E0
L064E12  LDA   $E0
         SEC
         SBC   #$0004
         BVS   L064E1D
         EOR   #$8000
L064E1D  BMI   L064E47
         LDA   $E2
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDY   #$0034
         LDA   [$EC],Y
         BEQ   L064E05
L064E47  LDA   $E0
         CMP   #$0004
         BNE   L064E54
         LDA   #$0000
         BRL   L064F2D
L064E54  BRA   L064E76
L064E56  PEI   $E2
         PEI   $FD
         PEI   $FB
         JSL   L0A351E
         PLY
         PLY
         PLY
         STA   $E2
         SEC
         SBC   #$0000
         BVS   L064E6E
         EOR   #$8000
L064E6E  BMI   L064E76
         LDA   #$0000
         BRL   L064F2D
L064E76  LDA   $E6
         CMP   #$0002
         BNE   L064E8C
         PEI   $E2
         PEI   $F9
         PEI   $F7
         JSL   L063BA5
         PLY
         PLY
         PLY
         BRA   L064EEF
L064E8C  PEI   $E2
         PEI   $F9
         PEI   $F7
         JSL   L041DC1
         PLY
         PLY
         PLY
         CLC
         ADC   #$0001
         STA   $E0
         LDA   $E2
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STX   $DE
         STA   $DC
         LDY   #$0029
         LDA   [$DC],Y
         AND   #$00FF
         SEC
         SBC   $E0
         BVS   L064ED0
         EOR   #$8000
L064ED0  BMI   L064EEF
         LDA   $E0
         SEP   #$20
         LDY   #$0029
         STA   [$DC],Y
         REP   #$20
         LDA   $E4
         CLC
         ADC   #$0002
         AND   #$0003
         SEP   #$20
         LDY   #$0028
         STA   [$DC],Y
         REP   #$20
L064EEF  LDY   #$0001
         LDA   [$E8],Y
         AND   #$00FF
         STA   $E0
         TAY
         BEQ   L064F2A
         PEA   $0001
         PEI   $FD
         PEI   $FB
         DEC   $E0
         LDA   $E0
         LDX   #$0000
         PHX
         PHA
         LDA   #L050DC3
         LDX   #^L050DC3
         JSL   L021F00
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         PHA
         JSL   L083913
         PLY
         PLY
         PLY
         PLY
L064F2A  LDA   #$0001
L064F2D  TAY
         TSC
         CLC
         ADC   #$0026
         TCS
         TYA
         PLD
         RTL

L064F37  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDY   #$0002
         LDA   [$F9],Y
         TAX
         LDA   [$F9]
         AND   #$FFFF
         PHA
         TXA
         AND   #$00FF
         TAX
         PLA
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L022171
         BEQ   L064FC1
         BCC   L064FC1
         LDY   #$0004
         LDA   [$F9],Y
         AND   #$00FF
         SEC
         SBC   #$0005
         SEP   #$20
         LDY   #$0004
         STA   [$F9],Y
         REP   #$20
         LDY   #$0002
         LDA   [$F9],Y
         TAX
         LDA   [$F9]
         AND   #$FFFF
         PHA
         TXA
         AND   #$00FF
         TAX
         PLA
         SEC
         SBC   $FD
         PHA
         TXA
         SBC   $FF
         TAX
         PLA
         SEP   #$20
         LDY   #$0008
         STA   [$F9],Y
         REP   #$20
         LDY   #$0002
         LDA   [$F9],Y
         TAX
         LDA   [$F9]
         AND   #$0000
         PHA
         TXA
         AND   #$FF00
         TAX
         PLA
         ORA   $FD
         PHA
         TXA
         ORA   $FF
         TAX
         PLA
         LDY   #$0002
         PHA
         TXA
         STA   [$F9],Y
         PLA
         STA   [$F9]
         BRA   L064FE8
L064FC1  LDY   #$0002
         LDA   [$F9],Y
         TAX
         LDA   [$F9]
         AND   #$FFFF
         PHA
         TXA
         AND   #$00FF
         TAX
         PLA
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L02209A
         PLA
         PLX
         SEP   #$20
         LDY   #$0008
         STA   [$F9],Y
         REP   #$20
L064FE8  PEI   $FB
         PEI   $F9
         JSL   L044ED1
         PLY
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L064FFA  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$0094
         TCS
         LDA   L03008A
         CMP   L030046
         BEQ   L06502E
         LDA   $FD
         STA   $E4
         CMP   #$0025
         BEQ   L06502E
         LDA   $E4
         CMP   #$0020
         BEQ   L06502E
         LDA   $E4
         CMP   #$0026
         BEQ   L06502E
         LDA   $E4
         CMP   #$0021
         BEQ   L06502E
         BRL   L06645F
L06502E  PEI   $FB
         PEI   $F9
         JSL   L06260C
         PLY
         PLY
         STA   $C6
         CMP   #$FFFE
         BNE   L065042
         BRL   L06645F
L065042  PEI   $C6
         JSL   L060C4E
         PLY
         STX   $EC
         STA   $EA
         LDY   #$0004
         LDA   [$EA],Y
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L050B05
         LDX   #^L050B05
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $EE
         LDX   $F0
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         PEA   $001A
         JSL   L02219C
         PLA
         PLA
         PLA
         PLA
         PLX
         LDX   #$0000
         LDA   #$0018
         PHX
         PHA
         LDA   L03008A
         LDX   #$0000
         TAY
         BPL   L0650A1
         DEX
L0650A1  SEC
         JSL   L0222B8
         LDX   L030050
         LDA   L03004E
         JSL   L021F9F
         PLA
         PLX
         STX   $98
         STA   $96
         LDA   $CE
         AND   #$00FF
         PHA
         LDA   #$00FF
         PLX
         STX   $F2
         SEC
         SBC   $F2
         SEP   #$20
         STA   $9B
         REP   #$20
         LDA   $F9
         SEP   #$20
         STA   $9C
         REP   #$20
         LDA   $FB
         SEP   #$20
         STA   $9D
         REP   #$20
         LDA   L03008A
         CMP   L030046
         BNE   L0650E6
         BRL   L0651E1
L0650E6  PEA   $0000
         JSL   L020599
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L064672
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BNE   L06510F
         BRL   L06518C
L06510F  LDA   $F9
         STA   $C4
         LDA   $FB
         STA   $C2
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05045C
         LDX   #^L05045C
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDA   $C4
         PLX
         STX   $F2
         CLC
         ADC   $F2
         STA   $C4
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050464
         LDX   #^L050464
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDA   $C2
         PLX
         STX   $F2
         CLC
         ADC   $F2
         STA   $C2
         PEI   $C2
         PEI   $C4
         PEI   $FB
         PEI   $F9
         PEI   $C6
         JSL   L042D63
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L06517A
         BRL   L06645F
L06517A  LDA   L030260
         SEP   #$20
         STA   $9C
         REP   #$20
         LDA   L030262
         SEP   #$20
         STA   $9D
         REP   #$20
L06518C  LDA   #$0025
         SEP   #$20
         STA   $9A
         REP   #$20
         LDA   $CE
         AND   #$00FF
         ASL
         PHA
         LDA   L03008A
         SEC
         SBC   L030046
         PHA
         JSL   L020467
         PLY
         ASL
         ASL
         ASL
         ASL
         PHA
         JSL   L0204BA
         PLY
         PLY
         STA   $E4
L0651B6  LDA   $E4
         LDX   #$0000
         TAY
         BPL   L0651BF
         DEX
L0651BF  PHX
         PHA
         LDX   $98
         LDA   $96
         JSL   L021F00
         PLA
         PLX
         STX   $98
         STA   $96
         PEA   $0000
         TDC
         CLC
         ADC   #$0096
         PHA
         JSL   L044ED1
         PLY
         PLY
         BRL   L06645F
L0651E1  LDA   $CA
         AND   #$2000
         STA   $AA
         TAY
         BEQ   L065207
         LDA   L030038
         BEQ   L0651F3
         BRL   L06645F
L0651F3  STZ   L030118
         LDX   #$0000
         LDA   #$0000
         PHA
         TXA
         STAL  L051AAA
         PLA
         STAL  L051AA8
L065207  LDY   #$0005
         LDA   [$EA],Y
         AND   #$00FF
         LDX   #$0000
         STX   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         ASL
         ROL   $F2
         LDX   $F2
         PHX
         PHA
         LDX   L030108
         LDA   L030106
         JSL   L021F00
         PLA
         PLX
         STX   $E8
         STA   $E6
         LDY   #$0004
         LDA   [$E6],Y
         AND   #$00FF
         PHA
         LDX   L030050
         LDA   L03004E
         AND   #$00FF
         PLX
         STX   $F2
         SEC
         SBC   $F2
         STA   $AC
         SEC
         SBC   #$0000
         BVS   L065257
         EOR   #$8000
L065257  BMI   L065261
         LDA   $AC
         CLC
         ADC   #$0100
         STA   $AC
L065261  LDA   $CE
         AND   #$00FF
         STA   $AE
         CMP   #$00FF
         BNE   L065272
         LDA   #$0064
         STA   $AE
L065272  LDAL  L05615B
         AND   #$00FF
         BEQ   L0652A7
         LDA   $AA
         BNE   L0652A7
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L06528A
         EOR   #$8000
L06528A  BMI   L06528F
         BRL   L06645F
L06528F  LDA   $FD
         SEP   #$20
         STA   $9A
         REP   #$20
         LDA   $FF
         SEP   #$20
         STA   $9E
         REP   #$20
         LDA   #$0004
         STA   $E4
         BRL   L0651B6
L0652A7  LDA   $FD
         SEC
         SBC   #$0000
         BVS   L0652B2
         EOR   #$8000
L0652B2  BMI   L0652EF
         LDA   $FD
         CLC
         ADC   #$0020
         SEP   #$20
         STA   $9A
         REP   #$20
         LDA   $FD
         CMP   #$FFFF
         BEQ   L0652E7
         LDA   #$0002
         PHA
         LDA   $AE
         CLC
         ADC   #$0002
         SEC
         JSL   L0222DF
         PLA
         SEC
         SBC   $AC
         STA   $E4
         SEC
         SBC   #$0001
         BVS   L0652E5
         EOR   #$8000
L0652E5  BMI   L0652EC
L0652E7  LDA   #$0001
         STA   $E4
L0652EC  BRL   L0651B6
L0652EF  LDY   #$000E
         LDA   [$EA],Y
         AND   #$000F
         STA   $E2
         LDY   #$000E
         LDA   [$EA],Y
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         STA   $B0
         LDA   $CA
         AND   #$0003
         STA   $B2
         LDA   $F9
         SEC
         SBC   L030040
         STA   $E4
         SEC
         SBC   #$0000
         BVS   L065320
         EOR   #$8000
L065320  BMI   L06532A
         LDA   $E4
         EOR   #$FFFF
         INC
         BRA   L06532C
L06532A  LDA   $E4
L06532C  STA   $C4
         LDA   $FB
         SEC
         SBC   L030042
         STA   $E4
         SEC
         SBC   #$0000
         BVS   L06533F
         EOR   #$8000
L06533F  BMI   L065349
         LDA   $E4
         EOR   #$FFFF
         INC
         BRA   L06534B
L065349  LDA   $E4
L06534B  STA   $C2
         LDA   $F9
         STA   L03010C
         LDA   $FB
         STA   L03010E
         LDA   $C6
         STA   L030110
         LDX   #$0000
         LDA   #$0000
         PHA
         TXA
         STAL  L051AA6
         PLA
         STAL  L051AA4
         LDA   L030042
         PHA
         LDA   L030040
         PHA
         PEI   $FB
         PEI   $F9
         JSL   L041B2C
         PLY
         PLY
         PLY
         PLY
         STA   L030112
         LDA   L030042
         PHA
         LDA   L030040
         PHA
         PEI   $FB
         PEI   $F9
         JSL   L041C4E
         PLY
         PLY
         PLY
         PLY
         STA   L030114
         LDA   L030010
         STA   L030116
         STZ   $A6
         STZ   $A8
         LDA   #$0001
         STA   $BA
         LDA   $FD
         SEC
         SBC   #$001F
         BEQ   L0653BC
         BVS   L0653B7
         EOR   #$8000
L0653B7  BPL   L0653BC
         BRL   L065495
L0653BC  LDA   $FD
         SEC
         SBC   #$0020
         STA   $FD
         BRL   L065484
L0653C7  LDA   $E2
         CMP   #$0006
         BEQ   L0653E4
         LDA   $E2
         CMP   #$0005
         BEQ   L0653E4
         PEI   $FB
         PEI   $F9
         JSL   L062C24
         PLY
         PLY
         BRL   L065641
         BRA   L0653FF
L0653E4  LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
         BRL   L06645F
L0653FF  LDA   $E2
         CMP   #$0006
         BEQ   L06540D
         LDA   $E2
         CMP   #$0005
         BNE   L065410
L06540D  BRL   L06645F
L065410  LDA   $E2
         CMP   #$0003
         BEQ   L065423
         LDA   $E2
         CMP   #$0002
         BEQ   L065423
         LDA   #$0000
         BRA   L065426
L065423  LDA   #$0001
L065426  STA   $E4
         TAY
         BNE   L065432
         JSL   L020599
         TAY
         BEQ   L065463
L065432  PEI   $FB
         PEI   $F9
         PEA   $FFFF
         PEI   $EC
         PEI   $EA
         JSL   L06436D
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L065455
         LDA   #$0000
         STA   $BE
         STA   $B4
         BRL   L065A40
         BRA   L065463
L065455  LDA   $E4
         BNE   L065460
         JSL   L020599
         TAY
         BEQ   L065463
L065460  BRL   L06645F
L065463  LDA   $E2
         CMP   #$0006
         BEQ   L06546F
         LDA   #$0000
         BRA   L065472
L06546F  LDA   #$0001
L065472  STA   $B4
         STZ   $BE
         BRL   L06584A
L065479  BRL   L065495
L06547C  DA    L065463
         DA    L0653FF
         DA    L0653C7
         DA    L065479
L065484  SEC
         SBC   #$FFFD
         CMP   #$0003
         BCC   L065490
         LDA   #$0003
L065490  ASL
         TAX
         JMP   (L06547C,X)

L065495  LDA   $FD
         SEC
         SBC   #$0025
         BVS   L0654A0
         EOR   #$8000
L0654A0  BPL   L0654A5
         BRL   L0655D5
L0654A5  LDA   $FD
         CLC
         ADC   #$0005
         SEP   #$20
         STA   $9A
         REP   #$20
         PEI   $FB
         PEI   $F9
         PEA   $FFFF
         PEI   $EC
         PEI   $EA
         JSL   L06436D
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L0654CB
         BRL   L065546
L0654CB  LDA   $E2
         CMP   #$0006
         BEQ   L06552E
         LDA   $E2
         CMP   #$0005
         BEQ   L06552E
         LDA   $FB
         PHA
         LDA   L030042
         PLX
         STX   $F2
         SEC
         SBC   $F2
         PHA
         JSL   L020467
         PLY
         PHA
         LDA   $F9
         PHA
         LDA   L030040
         PLX
         STX   $F2
         SEC
         SBC   $F2
         PHA
         JSL   L020467
         PLY
         PLX
         STX   $F2
         CLC
         ADC   $F2
         SEC
         SBC   #$0001
         BEQ   L065511
         BVS   L06550F
         EOR   #$8000
L06550F  BMI   L065516
L065511  BRL   L065641
         BRA   L06552E
L065516  LDA   $E2
         CMP   #$0000
         BEQ   L065524
         LDA   $E2
         CMP   #$0003
         BNE   L06552E
L065524  LDA   $E2
         CMP   #$0007
         BEQ   L06552E
         BRL   L0657D0
L06552E  LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
L065546  LDA   $E2
         CMP   #$0006
         BNE   L065591
         LDA   $FD
         SEC
         SBC   #$0021
         STA   $E4
         LDA   $E4
         LDX   #$0000
         PHX
         PHA
         LDA   $E6
         CLC
         ADC   #$000C
         LDX   $E8
         BCC   L065567
         INX
L065567  JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         AND   #$0080
         PHA
         PEI   $E4
         PEI   $E8
         PEI   $E6
         JSL   L062862
         PLY
         PLY
         PLY
         PLY
         STX   $A8
         STA   $A6
         BRL   L06641A
         BRA   L0655D5
L065591  LDA   $C4
         SEC
         SBC   #$0003
         BEQ   L0655A0
         BVS   L06559E
         EOR   #$8000
L06559E  BMI   L0655AF
L0655A0  LDA   $C2
         SEC
         SBC   #$0003
         BEQ   L0655D2
         BVS   L0655AD
         EOR   #$8000
L0655AD  BPL   L0655D2
L0655AF  LDA   $DC
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         LDX   #$0000
         PHX
         PHA
         LDX   L030050
         LDA   L03004E
         JSL   L021F00
         PLA
         PLX
         STX   $A8
         STA   $A6
         BRL   L06641A
         BRA   L0655D5
L0655D2  BRL   L0663FA
L0655D5  STZ   $BA
         LDA   $FF
         BEQ   L0655E5
         LDX   L030050
         LDA   L03004E
         STX   $A8
         STA   $A6
L0655E5  LDA   $FD
         CMP   #$0025
         BEQ   L0655EF
         BRL   L065F13
L0655EF  LDA   $E2
         CMP   #$0000
         BEQ   L065607
         LDA   $E2
         CMP   #$0002
         BEQ   L065607
         LDA   $E2
         CMP   #$0003
         BEQ   L065607
         BRL   L065AB0
L065607  PEI   $FB
         PEI   $F9
         PEA   $FFFF
         PEI   $EC
         PEI   $EA
         JSL   L06436D
         PLY
         PLY
         PLY
         PLY
         PLY
         STA   $C0
         TAY
         BNE   L065623
         BRL   L065813
L065623  LDA   #$000C
         PHA
         LDA   $D6
         CLC
         JSL   L0222DF
         PLA
         CMP   $C0
         BCS   L065636
         BRL   L0657C9
L065636  LDA   $C4
         BEQ   L065641
         LDA   $C2
         BEQ   L065641
         BRL   L0657C9
L065641  LDA   $FD
         CMP   #$FFFE
         BNE   L065652
         PEI   $FB
         PEI   $F9
         JSL   L062C24
         PLY
         PLY
L065652  LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
         LDA   #$0006
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EA],Y
         AND   #$FFF0
         STA   $F2
         PLA
         ORA   $F2
         LDY   #$000E
         STA   [$EA],Y
         PLA
         LDA   L030114
         STA   $E4
         LDA   $B0
         STA   $E2
         BRL   L0657B4
L065691  LDA   $E2
         ASL
         PHA
         LDY   #$0002
         LDA   [$E6],Y
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         AND   #$0003
         CMP   $E4
         BNE   L0656AD
         BRL   L065719
L0656AD  LDA   $E2
         BEQ   L0656B8
         JSL   L020564
         TAY
         BNE   L065719
L0656B8  LDA   $B0
         BEQ   L0656C3
         LDA   $B2
         CMP   #$0001
         BEQ   L0656C8
L0656C3  LDA   #$0000
         BRA   L0656CB
L0656C8  LDA   #$0001
L0656CB  PHA
         PEI   $E2
         PEI   $E4
         PEI   $E8
         PEI   $E6
         JSL   L064A97
         PLY
         PLY
         PLY
         PLY
         PLY
         JSL   L020599
         LDX   #$0000
         PHX
         PHA
         LDX   L030050
         LDA   L03004E
         JSL   L021F00
         PLA
         PLX
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         LDX   $98
         LDA   $96
         AND   #$0000
         PHA
         TXA
         AND   #$FF00
         TAX
         PLA
         JSL   L021F9F
         PLA
         PLX
         STX   $98
         STA   $96
         BRA   L065744
L065719  LDX   L030050
         LDA   L03004E
         CLC
         ADC   #$0001
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         LDX   $98
         LDA   $96
         AND   #$0000
         PHA
         TXA
         AND   #$FF00
         TAX
         PLA
         JSL   L021F9F
         PLA
         PLX
         STX   $98
         STA   $96
L065744  LDA   $BA
         BEQ   L065782
         PEI   $FF
         JSL   L020599
         PHA
         LDA   #$0001
         PHA
         LDA   $CF
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         PLX
         STX   $F2
         CLC
         ADC   $F2
         PHA
         JSL   L020493
         PLY
         PLY
         LDX   #$0000
         TAY
         BPL   L065772
         DEX
L065772  PHX
         PHA
         LDX   $98
         LDA   $96
         JSL   L021F00
         PLA
         PLX
         STX   $98
         STA   $96
L065782  LDA   #$0026
         CLC
         ADC   $E2
         SEP   #$20
         STA   $9A
         REP   #$20
         PEA   $0000
         PEI   $E2
         PEI   $E8
         PEI   $E6
         JSL   L062862
         PLY
         PLY
         PLY
         PLY
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$0096
         PHA
         JSL   L064F37
         PLY
         PLY
         PLY
         PLY
         DEC   $E2
L0657B4  LDA   $E2
         SEC
         SBC   #$0000
         BVS   L0657BF
         EOR   #$8000
L0657BF  BPL   L0657C4
         BRL   L065691
L0657C4  BRL   L06645F
         BRA   L065810
L0657C9  LDA   $E2
         CMP   #$0002
         BEQ   L065810
L0657D0  LDA   #$0007
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EA],Y
         AND   #$FFF0
         STA   $F2
         PLA
         ORA   $F2
         LDY   #$000E
         STA   [$EA],Y
         PLA
         LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
         LDX   $98
         LDA   $96
         INC   $96
         BNE   L06580D
         INC   $98
L06580D  BRL   L0663F1
L065810  BRL   L065AAD
L065813  LDA   $E2
         CMP   #$0000
         BEQ   L06581D
         BRL   L065AAD
L06581D  PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L06455D
         PLY
         PLY
         PLY
         PLY
         STA   $BC
         TAY
         BEQ   L06583E
         DEC   $BC
         STZ   $B8
         BRL   L065B79
L06583E  STZ   $BE
         JSL   L020564
         TAY
         BNE   L06584A
         BRL   L0659ED
L06584A  JSL   L020599
         STA   $E4
         LDA   $E4
         STA   $E2
         STZ   $B6
L065856  LDA   $F9
         STA   $C4
         LDA   $FB
         STA   $C2
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05045C
         LDX   #^L05045C
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDA   $C4
         PLX
         STX   $F2
         CLC
         ADC   $F2
         STA   $C4
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050464
         LDX   #^L050464
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDA   $C2
         PLX
         STX   $F2
         CLC
         ADC   $F2
         STA   $C2
         LDY   #$0008
         LDA   [$E6],Y
         AND   #$00FF
         CMP   $C4
         BNE   L0658D7
         LDY   #$0009
         LDA   [$E6],Y
         AND   #$00FF
         CMP   $C2
         BNE   L0658D7
         JSL   L020599
         TAY
         BEQ   L0658CC
         LDA   #$0000
         BRA   L0658CF
L0658CC  LDA   #$0001
L0658CF  STA   $B6
         TAY
         BNE   L0658D7
         BRL   L065984
L0658D7  PEA   $0000
         PEI   $E4
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L064672
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BNE   L0658FB
         BRL   L065984
L0658FB  LDA   #$0001
         PHA
         LDA   $AE
         SEC
         JSL   L0222DF
         PLA
         SEC
         SBC   $AC
         STA   $E2
         SEC
         SBC   #$0000
         BEQ   L06591E
         BVS   L065917
         EOR   #$8000
L065917  BPL   L06591E
         LDA   #$0000
         BRA   L065921
L06591E  LDA   #$0001
L065921  STA   $BE
         TAY
         BEQ   L065978
         PEI   $C2
         PEI   $C4
         PEI   $FB
         PEI   $F9
         PEI   $C6
         JSL   L042D63
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L06593F
         BRL   L06645F
L06593F  LDA   L030260
         SEP   #$20
         STA   $9C
         REP   #$20
         LDA   L030262
         SEP   #$20
         STA   $9D
         REP   #$20
         LDA   $F9
         SEP   #$20
         LDY   #$0008
         STA   [$E6],Y
         REP   #$20
         LDA   $FB
         SEP   #$20
         LDY   #$0009
         STA   [$E6],Y
         REP   #$20
         LDX   L030050
         LDA   L03004E
         SEP   #$20
         LDY   #$0004
         STA   [$E6],Y
         REP   #$20
         BRA   L065981
L065978  LDA   $E2
         STA   $AE
         LDA   #$FFFF
         STA   $AC
L065981  BRL   L0659ED
L065984  LDA   L030120
         BEQ   L0659DB
         LDA   $FD
         CMP   #$FFFD
         BEQ   L0659C3
         LDY   #$000E
         LDA   [$EA],Y
         AND   #$000F
         CMP   #$0005
         BNE   L0659C0
         PEA   $0000
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L06498E
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L0659C0
         JSL   L020564
         TAY
         BEQ   L0659C3
L0659C0  BRL   L065641
L0659C3  LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
L0659DB  LDA   $E4
         CLC
         ADC   #$0001
         AND   #$0003
         STA   $E4
         CMP   $E2
         BEQ   L0659ED
         BRL   L065856
L0659ED  LDA   $BE
         BNE   L065A1D
         LDA   $AC
         CMP   #$FFFF
         BEQ   L065A1D
         LDA   $AA
         BEQ   L065A1D
         LDA   $FD
         CMP   #$FFFD
         BEQ   L065A0A
         JSL   L020599
         TAY
         BNE   L065A1D
L065A0A  JSL   L020599
         STA   $BC
         CLC
         ADC   #$0001
         AND   #$0003
         STA   L030010
         BRL   L065C91
L065A1D  LDA   $BE
         BNE   L065A40
         JSL   L020599
         TAY
         BEQ   L065A39
         LDA   $D6
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$000F
         CMP   $C0
         BCC   L065A6A
L065A39  LDA   $FD
         CMP   #$FFFD
         BEQ   L065A6A
L065A40  LDA   $BE
         BNE   L065A57
         LDA   $AC
         SEC
         SBC   #$0000
         BVS   L065A4F
         EOR   #$8000
L065A4F  BPL   L065A57
         JSL   L020599
         STA   $E4
L065A57  PEI   $B2
         PEI   $B0
         PEI   $E4
         PEI   $E8
         PEI   $E6
         JSL   L064B61
         PLY
         PLY
         PLY
         PLY
         PLY
L065A6A  LDA   $FD
         SEC
         SBC   #$FFFF
         BVS   L065A75
         EOR   #$8000
L065A75  BMI   L065AAD
         LDA   $BE
         BNE   L065A7E
         BRL   L06645F
L065A7E  LDA   $B4
         BEQ   L065A9D
         LDA   #$0007
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EA],Y
         AND   #$FFF0
         STA   $F2
         PLA
         ORA   $F2
         LDY   #$000E
         STA   [$EA],Y
         PLA
L065A9D  PEI   $FB
         PEI   $F9
         PEI   $E8
         PEI   $E6
         JSL   L062CB3
         PLY
         PLY
         PLY
         PLY
L065AAD  BRL   L065F10
L065AB0  LDA   $E2
         CMP   #$0007
         BEQ   L065ABA
         BRL   L065DC3
L065ABA  PEI   $FB
         PEI   $F9
         PEA   $FFFF
         PEI   $EC
         PEI   $EA
         JSL   L06436D
         PLY
         PLY
         PLY
         PLY
         PLY
         STA   $C0
         TAY
         BEQ   L065B22
         LDA   #$000C
         PHA
         LDA   $D6
         CLC
         JSL   L0222DF
         PLA
         CMP   $C0
         BCC   L065AEE
         LDA   $C4
         BEQ   L065AEB
         LDA   $C2
         BNE   L065AEE
L065AEB  BRL   L065641
L065AEE  INC   $AE
         LDA   #$0001
         PHA
         LDA   $AE
         SEC
         JSL   L0222DF
         PLA
         STA   $AE
         LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         AND   #$00FF
         STA   $C4
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
         AND   #$00FF
         STA   $C2
         BRA   L065B62
L065B22  LDY   #$0006
         LDA   [$E6],Y
         AND   #$00FF
         STA   $C4
         LDY   #$0007
         LDA   [$E6],Y
         AND   #$00FF
         STA   $C2
         LDA   $F9
         CMP   $C4
         BNE   L065B62
         LDA   $FB
         CMP   $C2
         BNE   L065B62
         STZ   $BE
         LDA   #$0000
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EA],Y
         AND   #$FFF0
         STA   $F2
         PLA
         ORA   $F2
         LDY   #$000E
         STA   [$EA],Y
         PLA
         BRL   L065A40
L065B62  LDA   #$0001
         STA   $B8
L065B67  PEI   $C2
         PEI   $C4
         PEI   $FB
         PEI   $F9
         JSL   L041C4E
         PLY
         PLY
         PLY
         PLY
         STA   $BC
L065B79  PEI   $B8
         LDA   $BC
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L064672
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BEQ   L065B9F
         BRL   L065C35
L065B9F  LDA   $B8
         BEQ   L065BAA
         JSL   L020564
         TAY
         BNE   L065BAF
L065BAA  LDA   #$0000
         BRA   L065BB2
L065BAF  LDA   #$0001
L065BB2  PHA
         LDA   L030010
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L064672
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BNE   L065C35
         PEA   $0000
         LDA   $E4
         CLC
         ADC   #$0002
         AND   #$0003
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L064672
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BNE   L065C35
         JSL   L020599
         TAY
         BEQ   L065C0A
         BRL   L065C8A
L065C0A  PEA   $0000
         LDA   $BC
         CLC
         ADC   #$0002
         AND   #$0003
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L064672
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BEQ   L065C8A
L065C35  LDA   $F9
         STA   $C4
         LDA   $FB
         STA   $C2
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05045C
         LDX   #^L05045C
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDA   $C4
         PLX
         STX   $F2
         CLC
         ADC   $F2
         STA   $C4
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050464
         LDX   #^L050464
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDA   $C2
         PLX
         STX   $F2
         CLC
         ADC   $F2
         STA   $C2
         BRL   L0658FB
L065C8A  LDA   $AA
         BNE   L065C91
         BRL   L065DAD
L065C91  PEA   $0000
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L06498E
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $BC
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L0649FC
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L065CCB
         BRL   L065D44
L065CCB  LDA   L030010
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L0649FC
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L065D44
         LDA   L030118
         BEQ   L065D14
         LDA   $E4
         CLC
         ADC   #$0002
         AND   #$0003
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L0649FC
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L065D44
L065D14  LDA   L030118
         CMP   #$0002
         BCS   L065D1F
         BRL   L065DAD
L065D1F  LDA   $BC
         CLC
         ADC   #$0002
         AND   #$0003
         STA   $E4
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L0649FC
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L065DAD
L065D44  LDA   $F9
         STA   $C4
         LDA   $FB
         STA   $C2
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05045C
         LDX   #^L05045C
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         ASL
         PHA
         LDA   $C4
         PLX
         STX   $F2
         CLC
         ADC   $F2
         STA   $C4
         LDA   $E4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L050464
         LDX   #^L050464
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         ASL
         PHA
         LDA   $C2
         PLX
         STX   $F2
         CLC
         ADC   $F2
         STA   $C2
         PEA   $0001
         PEI   $C2
         PEI   $C4
         PEA   $0011
         JSL   L083913
         PLY
         PLY
         PLY
         PLY
         BRL   L0658FB
L065DAD  PEI   $B2
         PEI   $B0
         PEI   $BC
         PEI   $E8
         PEI   $E6
         JSL   L064B61
         PLY
         PLY
         PLY
         PLY
         PLY
         BRL   L065F10
L065DC3  LDA   $E2
         CMP   #$0005
         BEQ   L065DCD
         BRL   L065F10
L065DCD  LDA   #$0001
         STA   $B8
         PEI   $FB
         PEI   $F9
         PEA   $FFFF
         PEI   $EC
         PEI   $EA
         JSL   L06436D
         PLY
         PLY
         PLY
         PLY
         PLY
         STA   $C0
         TAY
         BEQ   L065E10
         LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         AND   #$00FF
         STA   $C4
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
         AND   #$00FF
         STA   $C2
         BRL   L065ED2
L065E10  LDY   #$0005
         LDA   [$E6],Y
         DEC
         SEP   #$20
         LDY   #$0005
         STA   [$E6],Y
         REP   #$20
         AND   #$00FF
         BNE   L065E47
L065E24  STZ   $BE
         LDA   #$0000
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EA],Y
         AND   #$FFF0
         STA   $F2
         PLA
         ORA   $F2
         LDY   #$000E
         STA   [$EA],Y
         PLA
         BRL   L065A40
         BRL   L065ED2
L065E47  JSL   L020564
         TAY
         BEQ   L065EBE
         PEA   $0000
         PEI   $FB
         PEI   $F9
         PEA   $0000
         TDC
         CLC
         ADC   #$00C8
         PHA
         JSL   L06498E
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L065EA5
         LDA   L030042
         PHA
         LDA   $FB
         PLX
         STX   $F2
         SEC
         SBC   $F2
         PHA
         JSL   L020467
         PLY
         PHA
         LDA   L030040
         PHA
         LDA   $F9
         PLX
         STX   $F2
         SEC
         SBC   $F2
         PHA
         JSL   L020467
         PLY
         PLX
         STX   $F2
         CLC
         ADC   $F2
         SEC
         SBC   #$0001
         BEQ   L065EA2
         BVS   L065EA0
         EOR   #$8000
L065EA0  BMI   L065EA5
L065EA2  BRL   L065E24
L065EA5  LDY   #$000A
         LDA   [$E6],Y
         AND   #$00FF
         STA   $C4
         LDY   #$000B
         LDA   [$E6],Y
         AND   #$00FF
         STA   $C2
         BRL   L065B67
         BRA   L065ED2
L065EBE  LDY   #$0006
         LDA   [$E6],Y
         AND   #$00FF
         STA   $C4
         LDY   #$0007
         LDA   [$E6],Y
         AND   #$00FF
         STA   $C2
L065ED2  PEI   $C2
         PEI   $C4
         PEI   $FB
         PEI   $F9
         JSL   L041C4E
         PLY
         PLY
         PLY
         PLY
         CLC
         ADC   #$0002
         AND   #$0003
         STA   $BC
         LDA   L030010
         CLC
         ADC   #$0002
         AND   #$0003
         STA   L030010
         LDA   #$0002
         PHA
         LDA   $AE
         SEC
         JSL   L0222DF
         LDA   $AE
         PLX
         STX   $F2
         SEC
         SBC   $F2
         STA   $AE
         BRL   L065B79
L065F10  BRL   L0663C5
L065F13  LDA   $E2
         CMP   #$0005
         BNE   L065F31
         LDA   $B0
         BEQ   L065F2E
         PEI   $FB
         PEI   $F9
         PEI   $E8
         PEI   $E6
         JSL   L062CB3
         PLY
         PLY
         PLY
         PLY
L065F2E  BRL   L065DCD
L065F31  LDA   $FD
         SEC
         SBC   #$0026
         STA   $E2
         LDX   #$0000
         PHX
         PHA
         LDA   $E6
         CLC
         ADC   #$000C
         LDX   $E8
         BCC   L065F49
         INX
L065F49  JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         AND   #$0080
         TAY
         BEQ   L065FCC
         PEA   $0000
         PEI   $E2
         PEI   $E8
         PEI   $E6
         JSL   L062862
         PLY
         PLY
         PLY
         PLY
         STX   $A8
         STA   $A6
         JSL   L020599
         PHA
         LDA   $CF
         AND   #$00FF
         STA   $E2
         PLX
         STX   $F2
         CLC
         ADC   $F2
         SEC
         SBC   #$0001
         LDX   #$0000
         PHX
         PHA
         LDX   $98
         LDA   $96
         JSL   L021F00
         PLA
         PLX
         STX   $98
         STA   $96
         LDA   $E2
         SEC
         SBC   #$000F
         BEQ   L065FC9
         BVS   L065FA9
         EOR   #$8000
L065FA9  BPL   L065FC9
         JSL   L02051C
         AND   #$0007
         SEC
         SBC   #$0002
         LDX   #$0000
         PHX
         PHA
         LDX   $98
         LDA   $96
         JSL   L021F00
         PLA
         PLX
         STX   $98
         STA   $96
L065FC9  BRL   L0663BB
L065FCC  LDA   $E2
         CMP   $B0
         BEQ   L065FD7
         BCC   L065FD7
         BRL   L06645F
L065FD7  LDA   L030114
         STA   $BC
         PEI   $FB
         PEI   $F9
         PEI   $E2
         PEI   $EC
         PEI   $EA
         JSL   L06436D
         PLY
         PLY
         PLY
         PLY
         PLY
         STA   $C0
         TAY
         BEQ   L06600C
         LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
L06600C  LDA   $B0
         BEQ   L066013
         BRL   L0660C0
L066013  LDA   $B2
         CMP   #$0002
         BNE   L06601D
         BRL   L0660C0
L06601D  JSL   L02051C
         STA   $E4
         AND   #$00C0
         TAY
         BEQ   L06602C
         BRL   L0660C0
L06602C  LDY   #$0003
         LDA   [$E6],Y
         AND   #$00FF
         CMP   #$00FF
         BEQ   L066076
         LDA   $E4
         AND   #$0038
         TAY
         BEQ   L06604F
         LDA   #$00FF
         SEP   #$20
         LDY   #$0003
         STA   [$E6],Y
         REP   #$20
         BRA   L066076
L06604F  LDA   $E4
         AND   #$0001
         TAY
         BEQ   L06605C
         LDA   #$0001
         BRA   L06605F
L06605C  LDA   #$FFFF
L06605F  PHA
         LDY   #$0003
         LDA   [$E6],Y
         AND   #$00FF
         AND   #$0003
         PLX
         STX   $F2
         CLC
         ADC   $F2
         AND   #$0003
         STA   $E4
L066076  LDA   $E4
         AND   #$0038
         TAY
         BNE   L0660C0
         LDA   $C0
         CMP   #$0001
         BEQ   L0660C0
         LDA   $B2
         CMP   #$0000
         BNE   L0660C0
         LDY   #$0003
         LDA   [$E6],Y
         AND   #$00FF
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $FFFF
         JSL   L040C92
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L0660B2
         LDA   L030012
         CMP   #$0002
         BNE   L0660B2
         BRL   L06645F
L0660B2  LDA   $E4
         AND   #$0003
         SEP   #$20
         LDY   #$0003
         STA   [$E6],Y
         REP   #$20
L0660C0  LDA   $C0
         BNE   L0660C7
         BRL   L06630E
L0660C7  LDA   $CA
         AND   #$0004
         TAY
         BNE   L0660EB
         LDA   $E2
         ASL
         PHA
         LDY   #$0002
         LDA   [$E6],Y
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         AND   #$0003
         CMP   $BC
         BEQ   L0660EB
         BRL   L06630E
L0660EB  LDA   #$000C
         PHA
         LDA   $D6
         CLC
         JSL   L0222DF
         PLA
         STA   $E4
         SEC
         SBC   $C0
         BVS   L066101
         EOR   #$8000
L066101  BMI   L066106
         BRL   L0662D9
L066106  LDA   $C4
         BEQ   L066111
         LDA   $C2
         BEQ   L066111
         BRL   L0662D9
L066111  JSL   L02051C
         AND   #$000F
         CLC
         ADC   #$0001
         CMP   $E4
         BCS   L066123
         BRL   L0662D9
L066123  LDA   $E4
         CMP   #$0001
         BEQ   L06612D
         BRL   L06628E
L06612D  LDA   $CA
         STA   $E4
         AND   #$0008
         TAY
         BEQ   L066149
         JSL   L020599
         TAY
         BEQ   L066149
         LDA   $E4
         AND   #$0010
         TAY
         BEQ   L066149
         BRL   L06628E
L066149  LDA   $B2
         CMP   #$0000
         BEQ   L066153
         BRL   L06628E
L066153  LDY   #$0003
         LDA   [$E6],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066163
         BRL   L06628E
L066163  LDA   $E2
         ASL
         PHA
         LDY   #$0003
         LDA   [$E6],Y
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         AND   #$0003
         STA   $E4
         CMP   $BC
         BNE   L066181
         BRL   L06628E
L066181  LDA   $BC
         CLC
         ADC   #$0001
         AND   #$0003
         CMP   $E4
         BNE   L066191
         BRL   L06628E
L066191  LDA   $B0
         BNE   L0661AB
         JSL   L020564
         TAY
         BEQ   L0661AB
         LDA   #$00FF
         SEP   #$20
         LDY   #$0003
         STA   [$E6],Y
         REP   #$20
         BRL   L066248
L0661AB  LDA   $BC
         AND   #$0001
         PHA
         LDA   $E4
         AND   #$0001
         PLX
         STX   $EE
         CMP   $EE
         BNE   L0661C1
         DEC   $E4
         BRA   L0661C3
L0661C1  INC   $E4
L0661C3  LDA   $E4
         AND   #$0003
         STA   $E4
         PHA
         PEI   $EC
         PEI   $EA
         JSL   L062655
         PLY
         PLY
         PLY
         TAY
         BEQ   L0661FD
         JSL   L020564
         TAY
         BNE   L0661E3
         BRL   L066248
L0661E3  LDA   $E4
         CLC
         ADC   #$0002
         AND   #$0003
         STA   $E4
         PHA
         PEI   $EC
         PEI   $EA
         JSL   L062655
         PLY
         PLY
         PLY
         TAY
         BNE   L066248
L0661FD  LDY   #$0003
         LDA   [$E6],Y
         AND   #$00FF
         PHA
         PEI   $FB
         PEI   $F9
         PEA   $FFFF
         JSL   L040C92
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L066223
         LDA   L030012
         CMP   #$0002
         BNE   L066223
         BRL   L06645F
L066223  LDA   L030012
         CMP   #$0001
         BEQ   L066248
         PEI   $E4
         PEI   $E2
         LDY   #$0003
         LDA   [$E6],Y
         AND   #$00FF
         PHA
         JSL   L062817
         PLY
         PLY
         PLY
         SEP   #$20
         LDY   #$0003
         STA   [$E6],Y
         REP   #$20
L066248  JSL   L020564
         PHA
         LDA   #$0001
         PHA
         LDA   $CE
         AND   #$00FF
         SEC
         JSL   L0222DF
         PLA
         PLX
         STX   $F2
         CLC
         ADC   $F2
         PHA
         PEA   $0001
         JSL   L0204BA
         PLY
         PLY
         LDX   #$0000
         TAY
         BPL   L066273
         DEX
L066273  PHX
         PHA
         LDX   $98
         LDA   $96
         JSL   L021F00
         PLA
         PLX
         STX   $98
         STA   $96
         LDA   $FD
         SEP   #$20
         STA   $9A
         REP   #$20
         BRL   L0663FA
L06628E  PEI   $E2
         PEI   $FB
         PEI   $F9
         PEI   $EC
         PEI   $EA
         JSL   L064BB3
         PLY
         PLY
         PLY
         PLY
         PLY
         PHA
         PEI   $E2
         PEI   $E8
         PEI   $E6
         JSL   L062862
         PLY
         PLY
         PLY
         PLY
         STX   $A8
         STA   $A6
         JSL   L020564
         PHA
         LDA   $DC
         AND   #$000F
         PLX
         STX   $F2
         CLC
         ADC   $F2
         LDX   #$0000
         PHX
         PHA
         LDX   $98
         LDA   $96
         JSL   L021F00
         PLA
         PLX
         STX   $98
         STA   $96
         BRA   L06630B
L0662D9  LDA   #$0007
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EA],Y
         AND   #$FFF0
         STA   $F2
         PLA
         ORA   $F2
         LDY   #$000E
         STA   [$EA],Y
         PLA
         LDA   $B0
         BEQ   L066308
         PEI   $FB
         PEI   $F9
         PEI   $E8
         PEI   $E6
         JSL   L062CB3
         PLY
         PLY
         PLY
         PLY
L066308  BRL   L065AEE
L06630B  BRL   L0663BB
L06630E  PEI   $FB
         PEI   $F9
         PEA   $FFFF
         PEI   $EC
         PEI   $EA
         JSL   L06436D
         PLY
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L066389
         LDA   L030040
         SEP   #$20
         LDY   #$0006
         STA   [$E6],Y
         REP   #$20
         LDA   L030042
         SEP   #$20
         LDY   #$0007
         STA   [$E6],Y
         REP   #$20
         LDA   $B0
         BEQ   L066348
         LDA   $B2
         CMP   #$0001
         BEQ   L06634D
L066348  LDA   #$0000
         BRA   L066350
L06634D  LDA   #$0001
L066350  PHA
         PEI   $E2
         PEI   $BC
         PEI   $E8
         PEI   $E6
         JSL   L064A97
         PLY
         PLY
         PLY
         PLY
         PLY
         LDX   $98
         LDA   $96
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $98
         STA   $96
         LDX   $98
         LDA   $96
         AND   #$FFFF
         PHA
         TXA
         AND   #$00FF
         TAX
         PLA
         STX   $A8
         STA   $A6
         BRA   L0663BB
L066389  LDA   #$0007
         AND   #$000F
         PHA
         PHA
         LDY   #$000E
         LDA   [$EA],Y
         AND   #$FFF0
         STA   $F2
         PLA
         ORA   $F2
         LDY   #$000E
         STA   [$EA],Y
         PLA
         LDA   $B0
         BEQ   L0663B8
         PEI   $FB
         PEI   $F9
         PEI   $E8
         PEI   $E6
         JSL   L062CB3
         PLY
         PLY
         PLY
         PLY
L0663B8  BRL   L065B22
L0663BB  LDA   $FD
         SEP   #$20
         STA   $9A
         REP   #$20
         BRA   L06641A
L0663C5  JSL   L020599
         CLC
         ADC   $AE
         SEC
         SBC   #$0001
         PHA
         PEA   $0001
         JSL   L0204BA
         PLY
         PLY
         LDX   #$0000
         TAY
         BPL   L0663E1
         DEX
L0663E1  PHX
         PHA
         LDX   $98
         LDA   $96
         JSL   L021F00
         PLA
         PLX
         STX   $98
         STA   $96
L0663F1  LDA   #$0025
         SEP   #$20
         STA   $9A
         REP   #$20
L0663FA  LDX   $A8
         LDA   $A6
         STX   $EE
         ORA   $EE
         BNE   L06641A
         PEA   $0000
         PEA   $FFFF
         PEI   $E8
         PEI   $E6
         JSL   L062862
         PLY
         PLY
         PLY
         PLY
         STX   $A8
         STA   $A6
L06641A  LDA   $BA
         BEQ   L066435
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDX   $98
         LDA   $96
         JSL   L021F00
         PLA
         PLX
         STX   $98
         STA   $96
         BRA   L06644A
L066435  LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDX   $A8
         LDA   $A6
         JSL   L021F00
         PLA
         PLX
         STX   $A8
         STA   $A6
L06644A  PEI   $A8
         PEI   $A6
         PEA   $0000
         TDC
         CLC
         ADC   #$0096
         PHA
         JSL   L064F37
         PLY
         PLY
         PLY
         PLY
L06645F  TSC
         CLC
         ADC   #$005E
         TCS
         PLD
         RTL

L066467  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         LDA   [$FD]
         AND   #$00FF
         CMP   #$00D5
         BEQ   L06647F
         BRL   L066521
L06647F  LDY   #$0001
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00AA
         BEQ   L06648F
         BRL   L066521
L06648F  LDY   #$0002
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00AD
         BEQ   L06649F
         BRL   L066521
L06649F  LDY   #$0009
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066521
         LDY   #$000A
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066521
         LDY   #$000B
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066521
         LDY   #$000C
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066521
         LDY   #$02BF
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066521
         LDY   #$02C0
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066521
         LDY   #$02C1
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066521
         LDY   #$02C2
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00FF
         BNE   L066521
         LDY   #$02C3
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00DE
         BNE   L066521
         LDY   #$02C4
         LDA   [$FD],Y
         AND   #$00FF
         CMP   #$00AA
         BEQ   L066527
L066521  LDA   #$0000
         BRL   L0665D8
L066527  LDA   #$000D
         STA   $F0
         BRL   L0665C1
L06652F  LDA   $F0
         AND   #$0001
         TAY
         BEQ   L06659B
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$00A9
         BEQ   L066599
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$00AA
         BEQ   L066599
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$00B2
         BEQ   L066599
         LDA   #$0000
         BRA   L0665D8
L066599  BRA   L0665BF
L06659B  LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         CMP   #$00EF
         BEQ   L0665BF
         LDA   #$0000
         BRA   L0665D8
L0665BF  INC   $F0
L0665C1  LDA   $F0
         CMP   #$02BF
         BCS   L0665CB
         BRL   L06652F
L0665CB  LDA   L030088
         CLC
         ADC   #$0004
         STA   L030088
         LDA   #$0004
L0665D8  TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

