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

         mx	%00
	rel
	dsk	MAIN.L
	lst	off

	use	MAIN.E
	use	MAIN.X

	use	4/Mem.Macs
	use	4/Misc.Macs
	use	4/Util.Macs
	
         PHA
         SEP   #$30
         LDA   #^L030000
         PHA
         PLB
         REP   #$30
         PLA
         STA   L030000
         TDC
         STA   L030004
         TSC
         STA   L030006
         JMPL  L02088B

L020019  ENT
         PHD
         LDAL  L030004
         TCD
         PLA
         STA   $0F
         PLA
         STA   $0C
         SEP   #$20
         PLA
         STA   $0E
         REP   #$20
         PLA
         STA   $00
         PLA
         STA   $02
         PLA
         STA   $04
         PLA
         STA   $06
         PLA
         STA   $08
         PLA
         STA   $0A
         CLC
         LDA   $00
         STA   $11
         ADC   #$0014
         STA   $00
         LDA   $02
         STA   $13
         ADC   #$0000
         STA   $02
         JSR   L0200E7
L020054  LDA   #$0001
         JSR   L0200B5
         CMP   #$0000
         BEQ   L02007E
         LDA   #$0001
         JSR   L0200B5
         CMP   #$0000
         BNE   L020076
         LDA   #$0004
         JSR   L0200B5
         CLC
         ADC   #$0004
         BRA   L020084
L020076  LDA   #$0008
         JSR   L0200B5
         BRA   L020087
L02007E  LDA   #$0002
         JSR   L0200B5
L020084  TAY
         LDA   [$11],Y
L020087  SEP   #$20
         STA   [$04]
         REP   #$20
         INC   $04
         BNE   L020093
         INC   $06
L020093  LDA   $08
         BNE   L020099
         DEC   $0A
L020099  DEC   $08
         BNE   L020054
         LDA   $0A
         BNE   L020054
         TSC
         SEC
         SBC   #$000C
         TCS
         SEP   #$20
         LDA   $0E
         PHA
         REP   #$20
         LDA   $0C
         PHA
         LDA   $0F
         TCD
         RTL

L0200B5  STA   $17
         STZ   $1B
         LDA   $19
         BEQ   L0200D2
         CMP   $17
         BCS   L0200D5
         BEQ   L0200D5
         SEC
         LDA   $17
         SBC   $19
         STA   $17
L0200CA  ASL   $15
         ROL   $1B
         DEC   $19
         BNE   L0200CA
L0200D2  JSR   L0200E7
L0200D5  SEC
         LDA   $19
         SBC   $17
         STA   $19
L0200DC  ASL   $15
         ROL   $1B
         DEC   $17
         BNE   L0200DC
         LDA   $1B
         RTS

L0200E7  LDA   [$00]
         XBA
         STA   $15
         CLC
         LDA   $00
         ADC   #$0002
         STA   $00
         BCC   L0200F8
         INC   $02
L0200F8  LDA   #$0010
         STA   $19
         RTS

L0200FE  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E2
         TCS
         LDA   #$0001
         PHA
         LDA   $F9
         SEC
         JSL   L0222DF
         PLA
         LDX   #$0000
         TAY
         BPL   L02011C
         DEX
L02011C  PHX
         PHA
         LDA   $FD
         PHA
         LDA   #$00A0
         SEC
         JSL   L0220A5
         PLA
         LDX   #$0000
         TAY
         BPL   L020131
         DEX
L020131  PHX
         PHA
         LDX   L03002A
         LDA   L030028
         JSL   L021F00
         PLA
         PLX
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
         LDA   #$0001
         PHA
         LDA   $F9
         SEC
         JSL   L0222DF
         LDA   #$0001
         PHA
         LDA   $FB
         SEC
         JSL   L0222DF
         PLA
         PLX
         STX   $F2
         SEC
         SBC   $F2
         STA   $E6
         LDA   #$0002
         PHA
         LDA   $F9
         SEC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L020182
         LDA   #$0004
         SEP   #$20
         STA   $E9
         REP   #$20
         BRA   L02018B
L020182  LDA   #$0044
         SEP   #$20
         STA   $E9
         REP   #$20
L02018B  LDA   #$0002
         PHA
         LDA   $FB
         SEC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L0201A5
         LDA   #$0044
         SEP   #$20
         STA   $E8
         REP   #$20
         BRA   L0201AE
L0201A5  LDA   #$0040
         SEP   #$20
         STA   $E8
         REP   #$20
L0201AE  LDA   $E6
         CMP   #$0000
         BNE   L0201E9
         LDA   $F9
         CMP   $FB
         BNE   L0201E0
         LDA   #$0002
         PHA
         LDA   $FB
         SEC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L0201D5
         LDA   #$0004
         SEP   #$20
         STA   $E8
         REP   #$20
         BRA   L0201DE
L0201D5  LDA   #$0040
         SEP   #$20
         STA   $E8
         REP   #$20
L0201DE  BRA   L0201E9
L0201E0  LDA   #$0044
         SEP   #$20
         STA   $E8
         REP   #$20
L0201E9  LDA   $FF
         SEC
         SBC   $FD
         STA   $E4
L0201F0  SEP   #$20
         LDY   $E6
         BNE   L0201FE
         LDA   [$EA]
         EOR   $E8
         STA   [$EA]
         BRA   L020216
L0201FE  LDA   [$EA],Y
         EOR   $E8
         STA   [$EA],Y
         DEY
         BEQ   L020210
L020207  LDA   [$EA],Y
         EOR   #$44
         STA   [$EA],Y
         DEY
         BNE   L020207
L020210  LDA   [$EA],Y
         EOR   $E9
         STA   [$EA],Y
L020216  REP   #$20
         DEC   $E4
         BMI   L02022A
         CLC
         LDA   $EA
         ADC   #$00A0
         STA   $EA
         BCC   L0201F0
         INC   $EC
         BRA   L0201F0
L02022A  TSC
         CLC
         ADC   #$0010
         TCS
         PLD
         RTL

L020232  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDX   $FF
         LDA   #$0000
L020242  SEP   #$20
         STA   [$FB]
         REP   #$20
         INC   $FB
         BNE   L02024E
         INC   $FD
L02024E  DEX
         BNE   L020242
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L020259  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         LDX   $FB
L020266  SEP   #$30
         LDA   $FD
         STA   [$F7]
         REP   #$30
         CLC
         LDA   $F7
         ADC   $FF
         STA   $F7
         BCC   L020279
         INC   $F9
L020279  DEX
         BNE   L020266
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L020284  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         LDX   $FB
L020291  LDA   $FD
         STA   [$F7]
         CLC
         LDA   $F7
         ADC   $FF
         STA   $F7
         BCC   L0202A0
         INC   $F9
L0202A0  DEX
         BNE   L020291
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L0202AB  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E6
         TCS
         LDA   $FF
         BNE   L0202BD
         BRL   L020373
L0202BD  BPL   L0202C2
         BRL   L020353
L0202C2  CLC
         LDA   $F7
         ADC   $FF
         BCC   L0202CC
         BRL   L020353
L0202CC  CLC
         LDA   $FB
         ADC   $FF
         BCC   L0202D6
         BRL   L020353
L0202D6  DEC   $FF
         LDA   $FD
         CMP   $F9
         BCC   L02032A
         BEQ   L0202E2
         BCS   L0202ED
L0202E2  LDA   $FB
         CMP   $F7
         BCC   L02032A
         BNE   L0202ED
         BRL   L020373
L0202ED  LDA   #L02037B
         STA   $E8
         LDA   #^L02037B
         STA   $EA
         CLC
         LDA   $F7
         ADC   $FF
         STA   $F7
         BCC   L020302
         INC   $F9
L020302  CLC
         LDA   $FB
         ADC   $FF
         STA   $FB
         BCC   L02030D
         INC   $FD
L02030D  SEP   #$30
         LDY   #$02
         LDA   $F9
         STA   [$E8],Y
         DEY
         LDA   $FD
         STA   [$E8],Y
         REP   #$30
         LDX   $F7
         LDY   $FB
         LDA   $FF
         PHB
         JSL   L02037B
         PLB
         BRA   L020373
L02032A  REP   #$30
         LDA   #L02037F
         STA   $E8
         LDA   #^L02037F
         STA   $EA
         SEP   #$30
         LDY   #$02
         LDA   $F9
         STA   [$E8],Y
         DEY
         LDA   $FD
         STA   [$E8],Y
         REP   #$30
         LDX   $F7
         LDY   $FB
         LDA   $FF
         PHB
         JSL   L02037F
         PLB
         BRA   L020373
L020353  LDA   $F9
         PHA
         LDA   $F7
         PHA
         LDA   $FD
         PHA
         LDA   $FB
         PHA
         LDA   #$0000
         PHA
         LDA   $FF
         PHA
         _BlockMove
         BCC   L020373
         STAL  L030002
L020373  TSC
         CLC
         ADC   #$000A
         TCS
         PLD
         RTL

L02037B  MVP   $FF0000,$FF0000
         RTL

L02037F  MVN   $FF0000,$FF0000
         RTL

         SEP   #$30
         LDA   $C029
         AND   #$1F
         ORA   #$C0
         STA   $C029
         REP   #$30
         RTL

L020392  ENT
         SEP   #$30
         LDA   $C029
         AND   #$1F
         ORA   #$40
         STA   $C029
         REP   #$30
         RTL

L0203A1  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEA   ^L050018
         PEA   L050018
         PEI   $FF
         JSL   L081796
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L0203C3  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00E8
         TCS
         LDA   #$0000
         STA   L03012C
         PEI   $FF
         PEA   $0070
         PEI   $FD
         PEA   $0000
         PEA   $0000
         PEI   $FB
         PEI   $F9
         LDX   L03002E
         LDA   L03002C
         PHX
         PHA
         PEI   $F7
         PEI   $F5
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L020405  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00E8
         TCS
         LDA   #$0000
         STA   L03012C
         PEI   $FF
         PEA   $00A0
         PEI   $FD
         PEA   $0000
         PEA   $0000
         PEI   $FB
         PEI   $F9
         LDX   L03002A
         LDA   L030028
         PHX
         PHA
         PEI   $F7
         PEI   $F5
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L020447  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
L020452  LDA   $FF
         DEC   $FF
         TAY
         BEQ   L02045F
         JSL   L0901A7
         BRA   L020452
L02045F  TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L020467  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L02047D
         EOR   #$8000
L02047D  BMI   L020487
         LDA   $FF
         EOR   #$FFFF
         INC
         BRA   L020489
L020487  LDA   $FF
L020489  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L020493  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FD
         SEC
         SBC   $FF
         BVS   L0204A8
         EOR   #$8000
L0204A8  BMI   L0204AE
         LDA   $FD
         BRA   L0204B0
L0204AE  LDA   $FF
L0204B0  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L0204BA  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FD
         SEC
         SBC   $FF
         BEQ   L0204D7
         BVS   L0204D1
         EOR   #$8000
L0204D1  BPL   L0204D7
         LDA   $FD
         BRA   L0204D9
L0204D7  LDA   $FF
L0204D9  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L0204E3  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDA   $FD
         SEC
         SBC   $FB
         BVS   L0204F8
         EOR   #$8000
L0204F8  BMI   L0204FE
         LDA   $FB
         BRA   L020512
L0204FE  LDA   $FD
         SEC
         SBC   $FF
         BEQ   L020510
         BVS   L02050A
         EOR   #$8000
L02050A  BPL   L020510
         LDA   $FF
         BRA   L020512
L020510  LDA   $FD
L020512  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L02051C  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDX   #$0000
         LDA   #$0008
         PHX
         PHA
         LDX   L030086
         LDA   L030084
         PEA   $BB40
         PEA   $E62D
         CLC
         JSL   L0220EA
         PLA
         PLX
         CLC
         ADC   #$000B
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   L030086
         STA   L030084
         CLC
         JSL   L022303
         PLA
         PLX
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L020564  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         SEP   #$30
         LDA   $C02F
         STA   $F4
         LSR
         EOR   $F4
         LSR
         EOR   $F4
         LSR
         EOR   $F4
         LSR
         EOR   $F4
         LSR
         EOR   $F4
         AND   #$01
         STA   $F4
         STZ   $F5
         REP   #$30
         LDA   $F4
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L020599  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         SEP   #$30
         LDA   $C02F
         STA   $F4
         LSR
         EOR   $F4
         LSR
         EOR   $F4
         LSR
         EOR   $F4
         LSR
         EOR   $F4
         LSR
         EOR   $F4
         AND   #$03
         STA   $F4
         STZ   $F5
         REP   #$30
         LDA   $F4
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L0205CE  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         LDA   $FD
         LDX   #$0000
         PHX
         PHA
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   $FB
         LDX   #$0000
         SEC
         JSL   L0220EA
         PLA
         PLX
         SEC
         JSL   L022303
         PLA
         PLX
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L020604  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   #$000A
         STA   L030054
L020615  STZ   L030052
         LDA   L03001E
         CMP   #$FFFF
         BEQ   L02064D
L020620  LDA   L03001E
         PHA
         JSL   L0207B5
         PLY
         LDA   L030042
         PHA
         LDA   L030040
         PHA
         PEA   $0000
         PEA   $FFFF
         PEA   $FFFF
         JSL   L042D63
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   #$FFFF
         STA   L03001E
         JSL   L0703AA
L02064D  JSL   L046D1A
         LDA   L03001E
         CMP   #$FFFF
         BEQ   L02065B
         BRA   L020620
L02065B  LDA   L030160
         BEQ   L020663
         BRL   L0206B5
L020663  LDA   L030034
         BEQ   L02066B
         BRL   L0206B5
L02066B  LDA   L030042
         PHA
         LDA   L030040
         PHA
         LDA   L030044
         PHA
         JSL   L0C5AB9
         PLY
         PLY
         PLY
         LDA   L030060
         BEQ   L02069F
         STZ   L030060
         JSL   L082EE5
         LDAL  L056307
         TAX
         LDAL  L056305
         PHX
         PHA
         JSL   L082671
         PLY
         PLY
         JSL   L082F35
L02069F  LDA   L030062
         BEQ   L0206B5
         STZ   L030062
         LDA   #$0001
         STA   L0301FC
         JSL   L082EE5
         JSL   L082F35
L0206B5  JSL   L070746
         JSL   L083ACF
         JSL   L0A6C90
         LDA   L03003A
         BEQ   L0206C9
         BRL   L0207AD
L0206C9  INC   L03004E
         BNE   L0206D1
         INC   L030050
L0206D1  LDX   L030050
         LDA   L03004E
         AND   #$01FF
         TAY
         BNE   L0206E1
         JSL   L0A0664
L0206E1  LDAL  L05615B
         AND   #$00FF
         BEQ   L0206F7
         LDAL  L05615B
         DEC
         SEP   #$20
         STAL  L05615B
         REP   #$20
L0206F7  JSL   L072A2E
         LDA   L030034
         BEQ   L020705
         LDA   #$000F
         BRA   L020708
L020705  LDA   #$003F
L020708  PHA
         LDX   L030050
         LDA   L03004E
         PLX
         STX   $FA
         AND   $FA
         TAY
         BNE   L020724
         JSL   L0A79E4
         LDA   L030034
         BEQ   L020724
         JSL   L0A79E4
L020724  LDA   L030048
         BEQ   L02072C
         DEC   L030048
L02072C  LDA   L03004A
         BEQ   L020734
         DEC   L03004A
L020734  JSL   L084044
         SEC
         LDA   L0303ED
         SBC   L03004E
         BNE   L020749
         LDA   L0303EF
         SBC   L030050
         BRA   L020751
L020749  LDA   L0303EF
         SBC   L030050
         REP   #$02
L020751  BCS   L02075B
         PEA   $003C
         JSL   L0203A1
         PLY
L02075B  STZ   L03001C
L02075E  JSL   L081DFE
         TAY
         BEQ   L020773
         JSL   L081E53
         PHX
         PHA
         JSL   L0705B8
         PLY
         PLY
         BRA   L02075E
L020773  LDA   L03006A
         BEQ   L020784
         STZ   L030068
         STZ   L03006A
         JSL   L0A1E0D
         BRA   L020793
L020784  LDA   L03006E
         BEQ   L020793
         STZ   L03006C
         STZ   L03006E
         JSL   L0A1AD3
L020793  JSL   L071A00
         LDA   L03001C
         BNE   L0207A0
         JSL   L070746
L0207A0  LDA   L03001C
         BEQ   L02075E
         LDA   L030036
         BEQ   L02075E
         BRL   L020615
L0207AD  TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L0207B5  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E2
         TCS
         JSL   L063D48
         PEI   $FF
         JSL   L0624AE
         PLY
         JSL   L0C035B
         LDX   #$0000
         LDA   #$01F4
         PHX
         PHA
         LDX   L030050
         LDA   L03004E
         SEC
         SBC   L030250
         PHA
         TXA
         SBC   L030252
         TAX
         PLA
         JSL   L022171
         BCC   L0207F1
         BRL   L02087B
L0207F1  LDX   L030050
         LDA   L03004E
         CLC
         ADC   #$0001
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   L030252
         STA   L030250
         LDA   #$0016
         SEP   #$20
         STA   $E8
         REP   #$20
         LDX   #$0000
         LDA   #$0018
         PHX
         PHA
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L020822
         DEX
L020822  SEC
         JSL   L0222B8
         LDX   L030252
         LDA   L030250
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         JSL   L021F9F
         PLA
         PLX
         STX   $E6
         STA   $E4
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         JSL   L044ED1
         PLY
         PLY
         PEA   $0000
         PEA   $0000
         JSL   L0D0FA2
         PLY
         PLY
         PEA   ^L050036
         PEA   L050036
         JSL   L02176B
         PLY
         PLY
         LDA   #$0459
         STA   L0301EA
         LDA   #$00FF
         STA   L0303D5
         LDA   #$022B
         STA   L030102
L02087B  JSL   L063DA6
         JSL   L0A03FC
         TSC
         CLC
         ADC   #$0016
         TCS
         PLD
         RTL

L02088B  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         JSL   L0D56C1
L02089A  JSL   L020604
         LDA   L03003A
         PHA
         JSL   L0D3ED4
         PLY
         BRA   L02089A
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L0208B1  ENT
         LDA   $34
         PHA
         LDA   $32
         PHA
         PER   L0209B6
         PLA
         STA   $32
         SEP   #$20
         PHK
         PLA
         STA   $34
         STZ   $35
         REP   #$20
         LDY   #$001A
         LDA   [$32],Y
         TAY
         PLA
         STA   $32
         PLA
         STA   $34
         TDC
         TAX
         TYA
         TCD
         STX   $30
         PER   L0209B6
         PLA
         STA   $32
         SEP   #$20
         PHK
         PLA
         STA   $34
         STZ   $35
         REP   #$20
         LDY   #$0014
         LDA   #$0000
         STA   [$32],Y
         LDY   #$0000
         LDA   [$32],Y
         STA   $36
         INY
         INY
         LDA   [$32],Y
         STA   $38
         LDY   #$0016
         LDA   [$32],Y
         STA   [$36]
         INC   $36
         INC   $36
         INY
         INY
         LDA   [$32],Y
         STA   [$36]
         LDY   #$0008
         PHD
         LDA   [$32],Y
         PHA
         PER   L020939
         PLA
         INC
         STA   $36
         LDA   $34
         STA   $38
         LDY   #$0004
         LDA   [$32],Y
         STA   [$36]
         INC   $36
         INC   $36
         INY
         INY
         SEP   #$20
         LDA   [$32],Y
         STA   [$36]
         REP   #$20
         LDA   $30
         TCD
L020939  JSL   $FF0000
         PLY
         PLD
         STX   $3C
         STA   $3A
         CLC
         ADC   #$00C8
         BCC   L02095E
         LDX   #$00C6
         TXY
L02094D  LDA   [$3A],Y
         STA   $40,X
         DEX
         DEX
         DEY
         DEY
         BPL   L02094D
         LDA   #$0040
         STA   $3A
         STZ   $3C
L02095E  LDY   #$0012
L020961  LDA   [$32],Y
         PHA
         DEY
         DEY
         CPY   #$000A
         BCS   L020961
         PER   L020985
         PLA
         INC
         STA   $36
         LDA   $34
         STA   $38
         LDA   $3A
         STA   [$36]
         LDY   #$0002
         SEP   #$20
         LDA   $3C
         STA   [$36],Y
         REP   #$20
L020985  JSL   $FF0000
         TSC
         CLC
         ADC   #$000A
         TCS
         PER   L0209B2
         PLA
         INC
         STA   $36
         LDA   $34
         STA   $38
         LDY   #$0000
         LDA   [$32],Y
         STA   [$36]
         INC   $36
         INC   $36
         INY
         INY
         SEP   #$20
         LDA   [$32],Y
         STA   [$36]
         REP   #$20
         LDA   $30
         TCD
L0209B2  JMPL  $FF0000

L0209B6  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         PEA   $0001
         PEA   $0000
         PEA   $0080
         JSL   L0B006E
         PLY
         PLY
         PLY
         PHA
         TXA
         STAL  L056307
         PLA
         STAL  L056305
         PEA   $0001
         PEA   $022C
         JSL   L0B26A4
         PLY
         CLC
         ADC   #$00C7
         LDX   #$0000
         PHX
         PHA
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   $F4
         STA   $F2
         PEA   $0000
         PEA   $0000
         PEA   $0AE2
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   $F0
         STA   $EE
         PEI   $F0
         PEI   $EE
         PEA   $822C
         JSL   L0B2447
         PLY
         PLY
         PLY
         STZ   $EC
         BRL   L020AC1
L020A22  LDA   $EC
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L053F4B
         LDX   #^L053F4B
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDX   $F4
         LDA   $F2
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
L020A49  LDA   [$EE]
         AND   #$00FF
         AND   #$0080
         TAY
         BNE   L020A7C
         LDX   $F0
         LDA   $EE
         INC   $EE
         BNE   L020A5E
         INC   $F0
L020A5E  STA   $F6
         STX   $F8
         LDA   [$F6]
         PHA
         LDX   $F4
         LDA   $F2
         INC   $F2
         BNE   L020A6F
         INC   $F4
L020A6F  STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         BRA   L020A49
L020A7C  LDX   $F0
         LDA   $EE
         INC   $EE
         BNE   L020A86
         INC   $F0
L020A86  STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         AND   #$007F
         PHA
         LDX   $F4
         LDA   $F2
         INC   $F2
         BNE   L020A9D
         INC   $F4
L020A9D  STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDX   $F4
         LDA   $F2
         INC   $F2
         BNE   L020AB2
         INC   $F4
L020AB2  STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $EC
L020AC1  LDA   $EC
         CMP   #$00C7
         BCS   L020ACB
         BRL   L020A22
L020ACB  PEA   $0000
         PEA   $0AE2
         JSL   L0B0175
         PLY
         PLY
         TSC
         CLC
         ADC   #$0010
         TCS
         PLD
         RTL

L020ADF  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   $FF
         CMP   #$FFFF
         BNE   L020AF6
         LDA   #$FFFF
         BRA   L020B2D
L020AF6  PEI   $FF
         JSL   L060280
         PLY
         STA   $F2
         LDA   $F2
         CMP   #$FFFF
         BEQ   L020B2B
         LDA   $F2
         PHA
         LDA   #$0006
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L05048C
         LDX   #^L05048C
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $F2
L020B2B  LDA   $F2
L020B2D  TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L020B37  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         PEI   $FF
         JSL   L020ADF
         PLY
         STA   $F2
         CMP   #$FFFF
         BNE   L020B53
         BRL   L020C88
L020B53  LDA   $F2
         SEC
         SBC   #$0020
         BVS   L020B5E
         EOR   #$8000
L020B5E  BMI   L020B6D
         LDA   $F2
         SEC
         SBC   #$0000
         BVS   L020B6B
         EOR   #$8000
L020B6B  BMI   L020B93
L020B6D  LDA   $F2
         SEC
         SBC   #$0094
         BVS   L020B78
         EOR   #$8000
L020B78  BPL   L020B89
         LDA   $F2
         SEC
         SBC   #$00A3
         BEQ   L020B93
         BVS   L020B87
         EOR   #$8000
L020B87  BPL   L020B93
L020B89  LDA   $F2
         CMP   #$00C3
         BEQ   L020B93
         BRL   L020C88
L020B93  PEI   $FF
         JSL   L060C4E
         PLY
         STX   $F0
         STA   $EE
         LDA   $F2
         BRL   L020C75
L020BA3  LDA   $F2
         CLC
         ADC   L030044
         STA   $F2
         BRL   L020C88
L020BAE  LDY   #$0002
         LDA   [$EE],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0001
         TAY
         BEQ   L020BF7
         LDY   #$0002
         LDA   [$EE],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         AND   #$000F
         LDX   #$0000
         PHX
         PHA
         LDA   #L05842C
         LDX   #^L05842C
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $F2
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $F2
L020BF7  BRL   L020C88
L020BFA  LDY   #$0002
         LDA   [$EE],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         AND   #$003F
         TAY
         BEQ   L020C0D
         INC   $F2
L020C0D  BRL   L020C88
L020C10  LDY   #$0002
         LDA   [$EE],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         TAY
         BEQ   L020C27
         INC   $F2
L020C27  BRL   L020C88
L020C2A  LDY   #$0002
         LDA   [$EE],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         AND   #$000F
         TAY
         BEQ   L020C3D
         INC   $F2
L020C3D  BRL   L020C88
L020C40  BRL   L020C88
L020C43  DA    L020BA3
         DA    L020BAE
         DA    L020C10
         DA    L020C10
         DA    L020C10
         DA    L020C2A
         DA    L020C2A
         DA    L020C2A
         DA    L020C2A
         DA    L020C2A
         DA    L020C2A
         DA    L020BFA
         DA    L020C40
L020C5D  DW    $0000
         DW    $0004
         DW    $0008
         DW    $000A
         DW    $000C
         DW    $000E
         DW    $0010
         DW    $0012
         DW    $0014
         DW    $0017
         DW    $0019
         DW    $001E
L020C75  TAX
         PEA   ^L020C5D
         PEA   L020C5D
         LDA   #$0016
         JSL   L022262
         PLA
         PLA
         JMP   (L020C43,X)

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

L020C94  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00D8
         TCS
         PEI   $FF
         JSL   L020B37
         PLY
         STA   $EA
         LDA   $EA
         CMP   #$0093
         BEQ   L020CB2
         BRL   L020D3B
L020CB2  PEI   $FF
         JSL   L060C4E
         PLY
         STX   $EE
         STA   $EC
         LDY   #$0002
         LDA   [$EC],Y
         XBA
         AND   #$00FF
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         AND   #$0003
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PEA   $0000
         TDC
         CLC
         ADC   #$00DA
         PHA
         JSL   L02251A+1
         PLY
         PLY
         PLY
         PLY
         LDA   $EA
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L053F4B
         LDX   #^L053F4B
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00DA
         PHA
         JSL   L02234C
         PLY
         PLY
         PLY
         PLY
         LDX   #$0000
         TDC
         CLC
         ADC   #$00DA
         STX   $F2
         STA   $F0
         BRA   L020D60
L020D3B  LDA   $EA
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L053F4B
         LDX   #^L053F4B
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STX   $F2
         STA   $F0
L020D60  PEA   $000E
         PEI   $F2
         PEI   $F0
         PEA   $0000
         PEA   $0004
         PEA   $0025
         PEA   $00E9
         PEA   $00A0
         LDX   L03002A
         LDA   L030028
         PHX
         PHA
         JSL   L083E81
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         TSC
         CLC
         ADC   #$0020
         TCS
         PLD
         RTL

L020D92  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0000
         PEA   ^L058424
         PEA   L058424
         JSL   L080D34
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L020DB5  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E8
         TCS
         STZ   $EE
         BRA   L020DE8
L020DC4  LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L058412
         LDX   #^L058412
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         CMP   $FB
         BEQ   L020DE6
         BCC   L020DE6
         BRA   L020DEF
L020DE6  INC   $EE
L020DE8  LDA   $EE
         CMP   #$0007
         BCC   L020DC4
L020DEF  DEC   $EE
         LDA   $EE
         PHA
         LDA   #$002A
         PLX
         STX   $F4
         CLC
         ADC   $F4
         PHA
         JSL   L0B225C
         PLY
         STX   $EC
         STA   $EA
         LDA   $EE
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L058412
         LDX   #^L058412
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         LDA   $FB
         PLX
         STX   $F4
         SEC
         SBC   $F4
         STA   $FB
         LDX   #$0000
         LDA   #$0002
         PHX
         PHA
         LDA   $FB
         AND   #$000F
         ASL
         PHA
         LDA   $FB
         AND   #$0FF0
         ASL
         ASL
         ASL
         ASL
         ASL
         PLX
         STX   $F4
         CLC
         ADC   $F4
         LDX   #$0000
         SEC
         JSL   L0222B8
         LDX   $EC
         LDA   $EA
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
         STZ   $EE
         BRL   L020EF2
L020E66  LDX   $EC
         LDA   $EA
         PHX
         PHA
         CLC
         ADC   #$0004
         STA   $EA
         LDA   $EC
         BCC   L020E77
         INC
L020E77  STA   $EC
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         PHX
         PHA
         CLC
         ADC   #$0004
         STA   $FD
         LDA   $FF
         BCC   L020E9A
         INC
L020E9A  STA   $FF
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F0],Y
         PLA
         STA   [$F0]
         LDY   #$0002
         LDA   [$EA],Y
         TAX
         LDA   [$EA]
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         PHX
         PHA
         CLC
         ADC   #$0004
         STA   $FD
         LDA   $FF
         BCC   L020EC9
         INC
L020EC9  STA   $FF
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F0],Y
         PLA
         STA   [$F0]
         LDX   $EC
         LDA   $EA
         CLC
         ADC   #$007C
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $EC
         STA   $EA
         INC   $EE
L020EF2  LDA   $EE
         CMP   #$0010
         BCS   L020EFC
         BRL   L020E66
L020EFC  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L020F04  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E2
         TCS
         PEA   $0000
         PEA   $0000
         PEA   $0080
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   $EE
         STA   $EC
         LDA   $FD
         STA   $E4
         CLC
         ADC   #$000F
         STA   $E6
         LDA   $FF
         STA   $E8
         CLC
         ADC   #$000F
         STA   $EA
         PEI   $EE
         PEI   $EC
         PEI   $FB
         JSL   L020DB5
         PLY
         PLY
         PLY
         PEA   $FFFF
         PEA   $0008
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         PEI   $EE
         PEI   $EC
         JSL   L020405
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PEA   $0000
         PEA   $0080
         JSL   L0B0175
         PLY
         PLY
         TSC
         CLC
         ADC   #$0012
         TCS
         PLD
         RTL

L020F77  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00D8
         TCS
         LDA   $FD
         PHA
         LDA   #$0006
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L05843C
         LDX   #^L05843C
         JSL   L021F00
         PLA
         PLX
         STX   $EE
         STA   $EC
         LDA   $FF
         LDY   #$0004
         STA   [$EC],Y
         CMP   #$FFFF
         BNE   L020FB2
         BRL   L021097
L020FB2  LDA   [$EC]
         STA   $E0
         CLC
         ADC   #$000F
         STA   $E2
         LDY   #$0002
         LDA   [$EC],Y
         STA   $E4
         CLC
         ADC   #$000F
         STA   $E6
         STZ   $F0
         BRA   L020FF7
L020FCD  LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L058412
         LDX   #^L058412
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         SEC
         SBC   $FF
         BEQ   L020FF5
         BVS   L020FF1
         EOR   #$8000
L020FF1  BPL   L020FF5
         BRA   L020FFE
L020FF5  INC   $F0
L020FF7  LDA   $F0
         CMP   #$0007
         BCC   L020FCD
L020FFE  DEC   $F0
         LDA   $F0
         CLC
         ADC   #$002A
         PHA
         JSL   L0B225C
         PLY
         STX   $EA
         STA   $E8
         LDA   $F0
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L058412
         LDX   #^L058412
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         PHA
         LDA   $FF
         PLX
         STX   $F6
         SEC
         SBC   $F6
         STA   $FF
         LDA   $FD
         CMP   #$0008
         BCC   L02104D
         LDX   L03002E
         LDA   L03002C
         STX   $DE
         STA   $DC
         LDA   #$0070
         STA   $DA
         BRA   L02105C
L02104D  LDX   L03002A
         LDA   L030028
         STX   $DE
         STA   $DC
         LDA   #$00A0
         STA   $DA
L02105C  LDA   #$0000
         STA   L03012C
         PEA   $FFFF
         PEI   $DA
         PEA   $0080
         LDA   $FF
         AND   #$0FF0
         PHA
         LDA   $FF
         AND   #$000F
         ASL
         ASL
         ASL
         ASL
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$00E0
         PHA
         PEI   $DE
         PEI   $DC
         PEI   $EA
         PEI   $E8
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
L021097  TAY
         TSC
         CLC
         ADC   #$001E
         TCS
         TYA
         PLD
         RTL

L0210A1  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         PHA
         LDA   #$0006
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L05843C
         LDX   #^L05843C
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0004
         LDA   [$F4],Y
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L0210DC  ENT
         PHP              ; ON-DISK PROT
         SEP   #$20
         LDA   $C031
         ORA   #$80
         STA   $C031
         PLP
         PHP
         REP   #$30
         PHD
         LDAL  L030004
         TCD
         PHB
         PHK
         PLB
         JSR   L0211AD
         BCS   L021138
         LDA   #$000B
         STA   $2C
L0210FE  JSR   L02115C
         BCS   L02110B
         JSR   L0211AD
         JSR   L021144
         BCC   L021138
L02110B  DEC   $2C
         BNE   L0210FE
         JSR   L02115C
         BCS   L021138
         JSR   L0211F7
         BCS   L021138
         JSR   L021144
         BCS   L021138
         SEP   #$30
         LDA   $C0E3
         LDA   $C0E4
         LDA   $C0ED
         LDA   $C0EE
         STA   $C0EC
         BMI   L021138
         REP   #$30
         PLB
         PLD
         PLP
         CLC
         RTL

L021138  REP   #$30
         LDA   #$0000
         STA   [$21]
         PLB
         PLD
         PLP
         SEC
         RTL

L021144  SEP   #$20
         LDX   #$0004
L021149  LDA   L021277,X
         CMP   L021272,X
         BNE   L021158
         DEX
         BPL   L021149
         REP   #$20
         CLC
         RTS

L021158  REP   #$20
         SEC
         RTS

L02115C  SEP   #$30
         LDA   #$07
         STA   $2B
         LDY   #$9E
L021164  LDX   #$02
L021166  DEY
         BNE   L02116D
         DEC   $2B
         BMI   L0211A9
L02116D  LDA   $C0EC
         BPL   L02116D
         CMP   L02126F,X
         BNE   L021164
         DEX
         BPL   L021166
         LDY   #$04
         STZ   $2B
L02117E  LDX   $C0EC
         BPL   L02117E
         LDA   L021285,X
         STA   L021277,Y
         EOR   $2B
         STA   $2B
         DEY
         BPL   L02117E
         TAY
         BNE   L0211A9
L021193  LDA   $C0EC
         BPL   L021193
         CMP   #$DE
         BNE   L0211A9
L02119C  LDA   $C0EC
         BPL   L02119C
         CMP   #$AA
         BNE   L0211A9
         REP   #$30
         CLC
         RTS

L0211A9  REP   #$30
         SEC
         RTS

L0211AD  SEP   #$20       ; E2 20
         REP   #$10
         LDX   #$0019
L0211B4  DEX
         BEQ   L0211F3
L0211B7  LDA   $C0EC
         BPL   L0211B7
         CMP   #$D5
         BNE   L0211B4
L0211C0  LDA   $C0EC
         BPL   L0211C0
         CMP   #$AA
         BNE   L0211B4
L0211C9  LDA   $C0EC
         BPL   L0211C9
         CMP   #$AD
         BNE   L0211B4
         LDX   #$02C0
L0211D5  LDA   $C0EC
         BPL   L0211D5
         DEX
         BNE   L0211D5
L0211DD  LDA   $C0EC
         BPL   L0211DD
         CMP   #$DE
         BNE   L0211F3
L0211E6  LDA   $C0EC
         BPL   L0211E6
         CMP   #$AA
         BNE   L0211F3
         REP   #$30
         CLC
         RTS

L0211F3  REP   #$30
         SEC
         RTS

L0211F7  SEP   #$20
         REP   #$10
         LDY   #$0019
L0211FE  LDX   #$0002
L021201  DEY
         BEQ   L02126B
L021204  LDA   $C0EC
         BPL   L021204
         CMP   L02127C,X
         BNE   L0211FE
         DEX
         BPL   L021201
         LDX   #$0006
L021214  LDA   $C0EC
         BPL   L021214
         DEX
         BNE   L021214
         LDX   #$0004
L02121F  LDA   $C0EC
         BPL   L02121F
         CMP   #$FF
         BNE   L02126B
         DEX
         BNE   L02121F
         LDY   #$0000
L02122E  TYA
         AND   #$01
         BNE   L021246
L021233  LDA   $C0EC
         BPL   L021233
         CMP   #$A9
         BEQ   L02124F
         CMP   #$AA
         BEQ   L02124F
         CMP   #$B2
         BEQ   L02124F
         BRA   L02126B
L021246  LDA   $C0EC
         BPL   L021246
         CMP   #$EF
         BNE   L02126B
L02124F  STA   [$21],Y
         INY
         CPY   #$02B2
         BCC   L02122E
         LDX   #$0005
L02125A  LDA   $C0EC
         BPL   L02125A
         CMP   L02127F,X
         BNE   L02126B
         DEX
         BPL   L02125A
         REP   #$30
         CLC
         RTS

L02126B  REP   #$30
         SEC
         RTS

L02126F  DB    $96
         DB    $AA
         DB    $D5
L021272  DB    $09
         DB    $22
         DB    $20
         DB    $0B
         DB    $00
L021277  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L02127C  DB    $AD
         DB    $AA
         DB    $D5
L02127F  DB    $AA
         DB    $DE
         DB    $FF
         DB    $FF
         DB    $FF
         DB    $FF
         MX    %11
L021285  JSR   $5DAF
         STZ   $0F51
         LDA   #$A5
         CMP   $0FB6
         BEQ   L0212B5
         STA   $0FB6
         LDA   #$03
         JSR   $5FAE
         JSR   $5652
         SEC
         ROR   $0F56
         LDA   #$FA
         STA   $0F26
         STA   $0F27
         JSR   $565D
         JSR   $566B
         JSR   $5DE0
         JSR   $64AB
L0212B5  BIT   $0F56
         BMI   L0212C6
         LDX   $0F56
         STX   $0F28
         JSR   $5E16
         JSR   $5ECC
L0212C6  JSR   $5858
         BIT   $C0E8
         STZ   $C031
         CLC
         LDA   $0F4B
         BEQ   L0212D6
         SEC
L0212D6  RTS

         LDA   #$04
         STA   $0F4F
         LDA   #$80
         STA   $0F50
         RTS

         LDX   #$41
L0212E4  LDAL  $FF5800,X
         STAL  $E10F6D,X
         DEX
         BPL   L0212E4
         RTS

         LDX   #$15
L0212F2  LDAL  $FF5842,X
         STA   $0F57,X
         DEX
         BPL   L0212F2
         RTS

         LDA   #$28
         SEC
         STA   $0F4B
         RTS

         JSR   $5CA4
         LDA   #$01
         STA   $45
         LDA   #$FF
         STA   $0F51
         JSR   $597A
         BCS   L021315
L021315  RTS

         DB    $96
         DB    $19
         DB    $19
         DB    $19
         DB    $19
         DB    $00
         DB    $01
         DB    $98
         DB    $99
         DB    $02
         DB    $03
         DB    $9C
         DB    $04
         DB    $05
         DB    $06
         DB    $A0
         DB    $A1
         DB    $A2
         DB    $A3
         DB    $A4
         DB    $A5
         DB    $07
         DB    $08
         DB    $A8
         DB    $A9
         DB    $AA
         DB    $09
         DB    $0A
         DB    $0B
         DB    $0C
         DB    $0D
         DB    $B0
         DB    $B1
         DB    $0E
         DB    $0F
         DB    $10
         DB    $11
         DB    $12
         DB    $13
         DB    $B8
         DB    $14
         DB    $15
         DB    $16
         DB    $17
         DB    $18
         DB    $19
         DB    $1A
         DB    $C0
         DB    $C1
         DB    $C2
         DB    $C3
         DB    $C4
         DB    $C5
         DB    $C6
         DB    $C7
         DB    $C8
         DB    $C9
         DB    $CA
         DB    $1B
         DB    $CC
         DB    $1C
         DB    $1D
         DB    $1E
         DB    $D0
         DB    $D1
         DB    $D2
         DB    $1F
         DB    $D4
         DB    $D5
         DB    $20
         DB    $21
         DB    $D8
         DB    $22
         DB    $23
         DB    $24
         DB    $25
         DB    $26
         DB    $27
         DB    $28
         DB    $E0
         DB    $E1
         DB    $E2
         DB    $E3
         DB    $E4
         DB    $29
         DB    $2A
         DB    $2B
         DB    $E8
         DB    $2C
         DB    $2D
         DB    $2E
         DB    $2F
         DB    $30
         DB    $31
         DB    $32
         DB    $F0
         DB    $F1
         DB    $33
         DB    $34
         DB    $35
         DB    $36
         DB    $37
         DB    $38
         DB    $F8
         DB    $39
         DB    $3A
         DB    $3B
         DB    $3C
         DB    $3D
         DB    $3E
         DB    $3F
L021385  ENT
         PHD
         LDAL  L030004
         TCD
         PHB
         PHK
         PLB
         SEP   #$30
         LDX   #$20
L021392  LDA   L0214D1,X
         STA   $00,X
         DEX
         BPL   L021392
         CLC
         LDAL  $00C5FF
         ADC   #$03
         STA   $02
         STA   $0D
         STA   $18
         LDA   #$44
         STA   $04
         STA   $0F
         LDA   #$41
         STA   $1A
         LDA   #$04
         STA   L021502
         REP   #$30
         LDA   #L021507
         STA   $10
         LDA   #^L021507
         STA   $12
L0213C2  CLC
         TDC
         ADC   #$000B
         JSR   L021495
         SEP   #$20
         LDA   L021502
         DEC
         STA   L021502
         REP   #$20
         BNE   L0213C2
         LDA   #L02151B
         STA   $10
         LDA   #^L02151B
         STA   $12
         CLC
         TDC
         ADC   #$000B
         JSR   L021495
         LDA   #L0214F9
         STA   $05
         LDA   #^L0214F9
         STA   $07
         LDA   #L021507
         STA   $10
         LDA   #^L021507
         STA   $12
         LDA   #L02150E
         STA   $1B
         LDA   #^L02150E
         STA   $1D
         CLC
         TDC
         ADC   #$0000
         JSR   L021495
         CLC
         LDAL  L03012E
         STA   $21
         STA   $27
         ADC   #$0564
         STA   L021510
         LDAL  L030130
         STA   $23
         STA   $29
         ADC   #$0000
         STA   L021512
         LDA   #$0000
         STA   [$21]
         CLC
         TDC
         ADC   #$0016
         JSR   L021495
         CLC
         LDA   $21
         ADC   #$02B2
         STA   $21
         BCC   L021445
         INC   $23
L021445  LDA   #$0000
         STA   [$21]
         CLC
         TDC
         ADC   #$0016
         JSR   L021495
         SEP   #$20
         LDA   #$02
         STA   L021502
         REP   #$20
         CLC
         TDC
         ADC   #$000B
         JSR   L021495
         LDA   [$21]
         BEQ   L021491
         LDA   [$27]
         BEQ   L021491
         LDY   #$02B0
         LDX   #$0000
L021471  LDA   [$21],Y
         EOR   [$27],Y
         STA   $25
         AND   #$E4E4
         BNE   L021491
         LDA   $25
         AND   #$1B1B
         BEQ   L021484
         INX
L021484  DEY
         DEY
         BPL   L021471
         CPX   #$0000
         BEQ   L021491
         CLC
         PLB
         PLD
         RTL

L021491  SEC
         PLB
         PLD
         RTL

L021495  SEI
         REP   #$30
         STA   L0214C1+1
         SEP   #$20
         LDA   #$00
         STA   L0214C1+3
         REP   #$20
         TSC
         TAX
         SEP   #$20
         LDA   #$01
         XBA
         LDAL  $010100
         TCS
         PHX
         PHB
         LDA   #$00
         PHA
         PLB
         REP   #$20
         PHD
         LDA   #$0000
         TCD
         SEP   #$30
         SEC
         XCE
L0214C1  JSL   $FF0000
         PHP
         CLC
         XCE
         PLP
         REP   #$30
         PLD
         PLB
         PLX
         TXS
         CLI
         RTS

L0214D1  CLI
         JSR   $C500
         BRK   $00
         BRK   $00
         BRK   $78
         RTL

         CLI
         JSR   $C500
         BRK   $00
         BRK   $00
         BRK   $78
         RTL

         CLI
         JSR   $C500
         BRK   $00
         BRK   $00
         BRK   $78
         RTL

L0214F2  DB    $04
         DB    $00
         DB    $82
         ADRL  L0210DC
L0214F9  DB    $03
         DB    $01
         ADRL  L0214F2
         DB    $05
L021500  DB    $04
         DB    $00
L021502  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L021507  DB    $03
         DB    $01
         ADRL  L021500
         DB    $06
L02150E  DB    $03
         DB    $01
L021510  DB    $00
         DB    $00
L021512  DB    $00
         DB    $00
         DB    $17
         DB    $00
         DB    $00
         DB    $00
L021518  DB    $16
         DB    $00
         DB    $00
L02151B  DB    $03
         DB    $01
         ADRL  L021518
         DB    $08
L021522  ENT
         PHP
         REP   #$30
         PHD
         LDAL  L030004
         TCD
         PHB
         PHK
         PLB
         JSR   L0215E7
         BCS   L021572
         LDA   #$000B
         STA   $2C
L021538  JSR   L021596
         BCS   L021545
         JSR   L0215E7
         JSR   L02157E
         BCC   L021572
L021545  DEC   $2C
         BNE   L021538
         JSR   L021596
         BCS   L021572
         JSR   L021631
         BCS   L021572
         JSR   L02157E
         BCS   L021572
         SEP   #$30
         LDA   $C0E3
         LDA   $C0E4
         LDA   $C0ED
         LDA   $C0EE
         STA   $C0EC
         BMI   L021572
         REP   #$30
         PLB
         PLD
         PLP
         CLC
         RTL

L021572  REP   #$30
         LDA   #$0000
         STA   [$21]
         PLB
         PLD
         PLP
         SEC
         RTL

L02157E  SEP   #$20
         LDX   #$0004
L021583  LDA   L021666,X
         CMP   L021661,X
         BNE   L021592
         DEX
         BPL   L021583
         REP   #$20
         CLC
         RTS

L021592  REP   #$20
         SEC
         RTS

L021596  SEP   #$30
         LDA   #$07
         STA   $2B
         LDY   #$9E
L02159E  LDX   #$02
L0215A0  DEY
         BNE   L0215A7
         DEC   $2B
         BMI   L0215E3
L0215A7  LDA   $C0EC
         BPL   L0215A7
         CMP   L02165E,X
         BNE   L02159E
         DEX
         BPL   L0215A0
         LDY   #$04
         STZ   $2B
L0215B8  LDX   $C0EC
         BPL   L0215B8
         LDA   L02166B,X
         STA   L021666,Y
         EOR   $2B
         STA   $2B
         DEY
         BPL   L0215B8
         TAY
         BNE   L0215E3
L0215CD  LDA   $C0EC
         BPL   L0215CD
         CMP   #$DE
         BNE   L0215E3
L0215D6  LDA   $C0EC
         BPL   L0215D6
         CMP   #$AA
         BNE   L0215E3
         REP   #$30
         CLC
         RTS

L0215E3  REP   #$30
         SEC
         RTS

L0215E7  SEP   #$20
         REP   #$10
         LDX   #$0019
L0215EE  DEX
         BEQ   L02162D
L0215F1  LDA   $C0EC
         BPL   L0215F1
         CMP   #$D5
         BNE   L0215EE
L0215FA  LDA   $C0EC
         BPL   L0215FA
         CMP   #$AA
         BNE   L0215EE
L021603  LDA   $C0EC
         BPL   L021603
         CMP   #$AD
         BNE   L0215EE
         LDX   #$02C0
L02160F  LDA   $C0EC
         BPL   L02160F
         DEX
         BNE   L02160F
L021617  LDA   $C0EC
         BPL   L021617
         CMP   #$DE
         BNE   L02162D
L021620  LDA   $C0EC
         BPL   L021620
         CMP   #$AA
         BNE   L02162D
         REP   #$30
         CLC
         RTS

L02162D  REP   #$30
         SEC
         RTS

L021631  SEP   #$20
         REP   #$10
         LDX   #$0019
         LDY   #$0000
L02163B  LDA   $C0EC
         BPL   L02163B
         CMP   #$D5
         BEQ   L02164E
         DEX
         BNE   L02163B
         BRA   L02165A
L021649  LDA   $C0EC
         BPL   L021649
L02164E  STA   [$21],Y
         INY
         CPY   #$02C5
         BCC   L021649
         REP   #$30
         CLC
         RTS

L02165A  REP   #$30
         SEC
         RTS

         MX    %11
L02165E  DB    $96
         DB    $AA
         DB    $D5
L021661  DB    $09
         DB    $22
         DB    $20
         DB    $0B
         DB    $00
L021666  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L02166B  DB    $20
         DB    $AF
         DB    $5D
         DB    $9C
         DB    $51
         DB    $0F
         DB    $A9
         DB    $A5
         DB    $CD
         DB    $B6
         DB    $0F
         DB    $F0
         DB    $23
         DB    $8D
         DB    $B6
         DB    $0F
         DB    $A9
         DB    $03
         DB    $20
         DB    $AE
         DB    $5F
         DB    $20
         DB    $52
         DB    $56
         DB    $38
         DB    $6E
         DB    $56
         DB    $0F
         DB    $A9
         DB    $FA
         DB    $8D
         DB    $26
         DB    $0F
         DB    $8D
         DB    $27
         DB    $0F
         DB    $20
         DB    $5D
         DB    $56
         DB    $20
         DB    $6B
         DB    $56
         DB    $20
         DB    $E0
         DB    $5D
         DB    $20
         DB    $AB
         DB    $64
         DB    $2C
         DB    $56
         DB    $0F
         DB    $30
         DB    $0C
         DB    $AE
         DB    $56
         DB    $0F
         DB    $8E
         DB    $28
         DB    $0F
         DB    $20
         DB    $16
         DB    $5E
         DB    $20
         DB    $CC
         DB    $5E
         DB    $20
         DB    $58
         DB    $58
         DB    $2C
         DB    $E8
         DB    $C0
         DB    $9C
         DB    $31
         DB    $C0
         DB    $18
         DB    $AD
         DB    $4B
         DB    $0F
         DB    $F0
         DB    $01
         DB    $38
         DB    $60
         DB    $A9
         DB    $04
         DB    $8D
         DB    $4F
         DB    $0F
         DB    $A9
         DB    $80
         DB    $8D
         DB    $50
         DB    $0F
         DB    $60
         DB    $A2
         DB    $41
         DB    $BF
         DB    $00
         DB    $58
         DB    $FF
         DB    $9F
         DB    $6D
         DB    $0F
         DB    $E1
         DB    $CA
         DB    $10
         DB    $F5
         DB    $60
         DB    $A2
         DB    $15
         DB    $BF
         DB    $42
         DB    $58
         DB    $FF
         DB    $9D
         DB    $57
         DB    $0F
         DB    $CA
         DB    $10
         DB    $F6
         DB    $60
         DB    $A9
         DB    $28
         DB    $38
         DB    $8D
         DB    $4B
         DB    $0F
         DB    $60
         DB    $20
         DB    $A4
         DB    $5C
         DB    $A9
         DB    $01
         DB    $85
         DB    $45
         DB    $A9
         DB    $FF
         DB    $8D
         DB    $51
         DB    $0F
         DB    $20
         DB    $7A
         DB    $59
         DB    $B0
         DB    $00
         DB    $60
         DB    $96
         DB    $19
         DB    $19
         DB    $19
         DB    $19
         DB    $00
         DB    $01
         DB    $98
         DB    $99
         DB    $02
         DB    $03
         DB    $9C
         DB    $04
         DB    $05
         DB    $06
         DB    $A0
         DB    $A1
         DB    $A2
         DB    $A3
         DB    $A4
         DB    $A5
         DB    $07
         DB    $08
         DB    $A8
         DB    $A9
         DB    $AA
         DB    $09
         DB    $0A
         DB    $0B
         DB    $0C
         DB    $0D
         DB    $B0
         DB    $B1
         DB    $0E
         DB    $0F
         DB    $10
         DB    $11
         DB    $12
         DB    $13
         DB    $B8
         DB    $14
         DB    $15
         DB    $16
         DB    $17
         DB    $18
         DB    $19
         DB    $1A
         DB    $C0
         DB    $C1
         DB    $C2
         DB    $C3
         DB    $C4
         DB    $C5
         DB    $C6
         DB    $C7
         DB    $C8
         DB    $C9
         DB    $CA
         DB    $1B
         DB    $CC
         DB    $1C
         DB    $1D
         DB    $1E
         DB    $D0
         DB    $D1
         DB    $D2
         DB    $1F
         DB    $D4
         DB    $D5
         DB    $20
         DB    $21
         DB    $D8
         DB    $22
         DB    $23
         DB    $24
         DB    $25
         DB    $26
         DB    $27
         DB    $28
         DB    $E0
         DB    $E1
         DB    $E2
         DB    $E3
         DB    $E4
         DB    $29
         DB    $2A
         DB    $2B
         DB    $E8
         DB    $2C
         DB    $2D
         DB    $2E
         DB    $2F
         DB    $30
         DB    $31
         DB    $32
         DB    $F0
         DB    $F1
         DB    $33
         DB    $34
         DB    $35
         DB    $36
         DB    $37
         DB    $38
         DB    $F8
         DB    $39
         DB    $3A
         DB    $3B
         DB    $3C
         DB    $3D
         DB    $3E
         DB    $3F

L02176B  ENT
         PHD
         LDAL  L030004
         TCD
         PLA
         STA   $29
         PLA
         STA   $25
         SEP   #$20
         PLA
         STA   $27
         REP   #$20
         PLA
         STA   $21
         PLA
         STA   $23
         PHB
         PHK
         PLB
         SEP   #$30
         LDX   #$20
L02178B  LDA   L021885,X
         STA   $00,X
         DEX
         BPL   L02178B
         CLC
         LDAL  $00C5FF
         ADC   #$03
         STA   $02
         STA   $0D
         STA   $18
         LDA   #$44
         STA   $04
         STA   $0F
         LDA   #$41
         STA   $1A
         LDA   #$04
         STA   L0218B6
         REP   #$30
         LDA   #L0218BB
         STA   $10
         LDA   #^L0218BB
         STA   $12
L0217BB  CLC
         TDC
         ADC   #$000B
         JSR   L021849
         SEP   #$20
         LDA   L0218B6
         DEC
         STA   L0218B6
         REP   #$20
         BNE   L0217BB
         LDA   #L0218CF
         STA   $10
         LDA   #^L0218CF
         STA   $12
         CLC
         TDC
         ADC   #$000B
         JSR   L021849
         LDA   #L0218AD
         STA   $05
         LDA   #^L0218AD
         STA   $07
         LDA   #L0218BB
         STA   $10
         LDA   #^L0218BB
         STA   $12
         LDA   #L0218C2
         STA   $1B
         LDA   #^L0218C2
         STA   $1D
         CLC
         TDC
         ADC   #$0000
         JSR   L021849
         LDAL  L03012E
         STA   L0218C4
         LDAL  L030130
         STA   L0218C6
         LDA   #$0000
         STA   [$21]
         CLC
         TDC
         ADC   #$0016
         JSR   L021849
         SEP   #$20
         LDA   #$02
         STA   L0218B6
         REP   #$20
         CLC
         TDC
         ADC   #$000B
         JSR   L021849
         PLB
         TSC
         SEC
         SBC   #$0004
         TCS
         SEP   #$20
         LDA   $27
         PHA
         REP   #$20
         LDA   $25
         PHA
         LDA   $29
         TCD
         RTL

L021849  SEI
         REP   #$30
         STA   L021875+1
         SEP   #$20
         LDA   #$00
         STA   L021875+3
         REP   #$20
         TSC
         TAX
         SEP   #$20
         LDA   #$01
         XBA
         LDAL  $010100
         TCS
         PHX
         PHB
         LDA   #$00
         PHA
         PLB
         REP   #$20
         PHD
         LDA   #$0000
         TCD
         SEP   #$30
         SEC
         XCE
L021875  JSL   $FF0000
         PHP
         CLC
         XCE
         PLP
         REP   #$30
         PLD
         PLB
         PLX
         TXS
         CLI
         RTS

L021885  CLI
         JSR   $C500
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         SEI
         RTL

         CLI
         JSR   $C500
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         SEI
         RTL

         CLI
         JSR   $C500
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         SEI
         RTL

L0218A6  DB    $04
         DB    $00
         DB    $82
         ADRL  L021522
L0218AD  DB    $03
         DB    $01
         ADRL  L0218A6
         DB    $05
L0218B4  DB    $04
         DB    $00
L0218B6  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L0218BB  DB    $03
         DB    $01
         ADRL  L0218B4
         DB    $06
L0218C2  DB    $03
         DB    $01
L0218C4  DB    $00
         DB    $00
L0218C6  DB    $00
         DB    $00
         DB    $17
         DB    $00
         DB    $00
         DB    $00
L0218CC  DB    $16
         DB    $00
         DB    $00
L0218CF  DB    $03
         DB    $01
         ADRL  L0218CC
         DB    $08
L0218D6  ENT
         DB    $D3
         DB    $01
         DB    $0E
         DB    $00
         DB    $03
         DB    $00
         DB    $1D
         DB    $00
         DB    $03
         DB    $00
         DB    $28
         DB    $00
         DB    $03
         DB    $00
         DB    $2E
         DB    $00
         DB    $03
         DB    $00
         DB    $3F
         DB    $00
         DB    $03
         DB    $00
         DB    $4D
         DB    $00
         DB    $02
         DB    $00
         DB    $50
         DB    $00
         DB    $02
         DB    $00
         DB    $5E
         DB    $00
         DB    $03
         DB    $00
         DB    $6A
         DB    $00
         DB    $02
         DB    $00
         DB    $6D
         DB    $00
         DB    $02
         DB    $00
         DB    $7B
         DB    $00
         DB    $03
         DB    $00
         DB    $9F
         DB    $00
         DB    $03
         DB    $00
         DB    $AD
         DB    $00
         DB    $02
         DB    $00
         DB    $B0
         DB    $00
         DB    $02
         DB    $00
         DB    $B5
         DB    $00
         DB    $02
         DB    $00
         DB    $B8
         DB    $00
         DB    $02
         DB    $00
         DB    $BD
         DB    $00
         DB    $02
         DB    $00
         DB    $C0
         DB    $00
         DB    $02
         DB    $00
         DB    $C5
         DB    $00
         DB    $02
         DB    $00
         DB    $C8
         DB    $00
         DB    $02
         DB    $00
         DB    $DA
         DB    $00
         DB    $03
         DB    $00
         DB    $F2
         DB    $00
         DB    $03
         DB    $00
         DB    $03
         DB    $01
         DB    $03
         DB    $00
         DB    $2F
         DB    $01
         DB    $03
         DB    $00
         DB    $43
         DB    $01
         DB    $02
         DB    $00
         DB    $49
         DB    $01
         DB    $02
         DB    $00
         DB    $4C
         DB    $01
         DB    $02
         DB    $00
         DB    $56
         DB    $01
         DB    $02
         DB    $00
         DB    $59
         DB    $01
         DB    $02
         DB    $00
         DB    $72
         DB    $01
         DB    $02
         DB    $00
         DB    $75
         DB    $01
         DB    $02
         DB    $00
         DB    $81
         DB    $01
         DB    $0C
         DB    $00
         DB    $98
         DB    $01
         DB    $02
         DB    $00
         DB    $C6
         DB    $01
         DB    $02
         DB    $00
         DB    $C9
         DB    $01
         DB    $02
         DB    $00
         DB    $FF
         DB    $FF
L021966  ENT
         DB    $28
         DB    $00
         DB    $00
         DB    $00
         ADRL  L021385
         DB    $FF
         DB    $FF
         DB    $FF
         DB    $FF
L021972  ENT
         DB    $A9
         DB    $02
         DB    $11
         DB    $00
         DB    $03
         DB    $00
         DB    $19
         DB    $00
         DB    $02
         DB    $00
         DB    $23
         DB    $00
         DB    $02
         DB    $00
         DB    $28
         DB    $00
         DB    $02
         DB    $00
         DB    $2B
         DB    $00
         DB    $02
         DB    $00
         DB    $34
         DB    $00
         DB    $02
         DB    $00
         DB    $39
         DB    $00
         DB    $02
         DB    $00
         DB    $3E
         DB    $00
         DB    $02
         DB    $00
         DB    $6E
         DB    $00
         DB    $02
         DB    $00
         DB    $71
         DB    $00
         DB    $02
         DB    $00
         DB    $97
         DB    $00
         DB    $02
         DB    $00
         DB    $A8
         DB    $00
         DB    $02
         DB    $00
         DB    $AB
         DB    $00
         DB    $02
         DB    $00
         DB    $2E
         DB    $01
         DB    $02
         DB    $00
         DB    $84
         DB    $01
         DB    $02
         DB    $00
         DB    $9B
         DB    $01
         DB    $05
         DB    $00
         DB    $FF
         DB    $FF
L0219B6  ENT
         DB    $19
         DB    $00
         DA    L0211AD
         DB    $23
         DB    $00
         DA    L02115C
         DB    $28
         DB    $00
         DA    L0211AD
         DB    $2B
         DB    $00
         DA    L021144
         DB    $34
         DB    $00
         DA    L02115C
         DB    $39
         DB    $00
         DA    L0211F7
         DB    $3E
         DB    $00
         DA    L021144
         DB    $6E
         DB    $00
         DA    L021277
         DB    $71
         DB    $00
         DA    L021272
         DB    $97
         DB    $00
         DA    L02126F
         DB    $A8
         DB    $00
         DA    L021285
         DB    $AB
         DB    $00
         DA    L021277
         DB    $2E
         DB    $01
         DA    L02127C
         DB    $84
         DB    $01
         DA    L02127F
         DB    $FF
         DB    $FF
L0219F0  ENT
         DB    $9D
         DB    $01
         DB    $02
         DB    $00
         DB    $03
         DB    $00
         DB    $0E
         DB    $00
         DB    $02
         DB    $00
         DB    $2F
         DB    $00
         DB    $02
         DB    $00
         DB    $34
         DB    $00
         DB    $02
         DB    $00
         DB    $39
         DB    $00
         DB    $02
         DB    $00
         DB    $43
         DB    $00
         DB    $02
         DB    $00
         DB    $48
         DB    $00
         DB    $02
         DB    $00
         DB    $4C
         DB    $00
         DB    $02
         DB    $00
         DB    $53
         DB    $00
         DB    $02
         DB    $00
         DB    $58
         DB    $00
         DB    $02
         DB    $00
         DB    $62
         DB    $00
         DB    $02
         DB    $00
         DB    $65
         DB    $00
         DB    $02
         DB    $00
         DB    $6A
         DB    $00
         DB    $02
         DB    $00
         DB    $6F
         DB    $00
         DB    $02
         DB    $00
         DB    $74
         DB    $00
         DB    $02
         DB    $00
         DB    $79
         DB    $00
         DB    $02
         DB    $00
         DB    $7E
         DB    $00
         DB    $02
         DB    $00
         DB    $88
         DB    $00
         DB    $02
         DB    $00
         DB    $8C
         DB    $00
         DB    $03
         DB    $00
         DB    $97
         DB    $00
         DB    $02
         DB    $00
         DB    $9A
         DB    $00
         DB    $03
         DB    $00
         DB    $A5
         DB    $00
         DB    $02
         DB    $00
         DB    $B2
         DB    $00
         DB    $02
         DB    $00
         DB    $CB
         DB    $00
         DB    $02
         DB    $00
         DB    $D2
         DB    $00
         DB    $02
         DB    $00
         DB    $DC
         DB    $00
         DB    $02
         DB    $00
         DB    $14
         DB    $01
         DB    $02
         DB    $00
         DB    $1B
         DB    $01
         DB    $02
         DB    $00
         DB    $3D
         DB    $01
         DB    $03
         DB    $00
         DB    $70
         DB    $01
         DB    $04
         DB    $00
         DB    $76
         DB    $01
         DB    $04
         DB    $00
         DB    $7D
         DB    $01
         DB    $01
         DB    $00
         DB    $84
         DB    $01
         DB    $04
         DB    $00
         DB    $8B
         DB    $01
         DB    $04
         DB    $00
         DB    $98
         DB    $01
         DB    $04
         DB    $00
         DB    $FF
         DB    $FF
L021A80  ENT
         DB    $70
         DB    $01
         DB    $00
         DB    $00
         ADRL  L0210DC
         DB    $76
         DB    $01
         DB    $00
         DB    $00
         ADRL  L0214F2
         DB    $84
         DB    $01
         DB    $00
         DB    $00
         ADRL  L021500
         DB    $98
         DB    $01
         DB    $00
         DB    $00
         ADRL  L021518
         DB    $FF
         DB    $FF
         DB    $FF
         DB    $FF
L021AA4  ENT
         DB    $0E
         DB    $00
         DA    L0214D1
         DB    $2F
         DB    $00
         DA    L021502
         DB    $34
         DB    $00
         DA    L021507
         DB    $43
         DB    $00
         DA    L021495
         DB    $48
         DB    $00
         DA    L021502
         DB    $4C
         DB    $00
         DA    L021502
         DB    $53
         DB    $00
         DA    L02151B
         DB    $62
         DB    $00
         DA    L021495
         DB    $65
         DB    $00
         DA    L0214F9
         DB    $6F
         DB    $00
         DA    L021507
         DB    $79
         DB    $00
         DA    L02150E
         DB    $88
         DB    $00
         DA    L021495
         DB    $97
         DB    $00
         DA    L021510
         DB    $A5
         DB    $00
         DA    L021512
         DB    $B2
         DB    $00
         DA    L021495
         DB    $CB
         DB    $00
         DA    L021495
         DB    $D2
         DB    $00
         DA    L021502
         DB    $DC
         DB    $00
         DA    L021495
         DB    $14
         DB    $01
         DA    L0214C1+1
         DB    $1B
         DB    $01
         DA    L0214C1+3
         DB    $FF
         DB    $FF
L021AF6  ENT
         DB    $49
         DB    $02
         DB    $05
         DB    $00
         DB    $03
         DB    $00
         DB    $0D
         DB    $00
         DB    $02
         DB    $00
         DB    $17
         DB    $00
         DB    $02
         DB    $00
         DB    $1C
         DB    $00
         DB    $02
         DB    $00
         DB    $1F
         DB    $00
         DB    $02
         DB    $00
         DB    $28
         DB    $00
         DB    $02
         DB    $00
         DB    $2D
         DB    $00
         DB    $02
         DB    $00
         DB    $32
         DB    $00
         DB    $02
         DB    $00
         DB    $62
         DB    $00
         DB    $02
         DB    $00
         DB    $65
         DB    $00
         DB    $02
         DB    $00
         DB    $8B
         DB    $00
         DB    $02
         DB    $00
         DB    $9C
         DB    $00
         DB    $02
         DB    $00
         DB    $9F
         DB    $00
         DB    $02
         DB    $00
         DB    $44
         DB    $01
         DB    $05
         DB    $00
         DB    $FF
         DB    $FF
L021B32  ENT
         DB    $0D
         DB    $00
         DA    L0215E7
         DB    $17
         DB    $00
         DA    L021596
         DB    $1C
         DB    $00
         DA    L0215E7
         DB    $1F
         DB    $00
         DA    L02157E
         DB    $28
         DB    $00
         DA    L021596
         DB    $2D
         DB    $00
         DA    L021631
         DB    $32
         DB    $00
         DA    L02157E
         DB    $62
         DB    $00
         DA    L021666
         DB    $65
         DB    $00
         DA    L021661
         DB    $8B
         DB    $00
         DA    L02165E
         DB    $9C
         DB    $00
         DA    L02166B
         DB    $9F
         DB    $00
         DA    L021666
         DB    $FF
         DB    $FF
L021B64  ENT
         DB    $6B
         DB    $01
         DB    $02
         DB    $00
         DB    $03
         DB    $00
         DB    $21
         DB    $00
         DB    $02
         DB    $00
         DB    $42
         DB    $00
         DB    $02
         DB    $00
         DB    $47
         DB    $00
         DB    $02
         DB    $00
         DB    $4C
         DB    $00
         DB    $02
         DB    $00
         DB    $56
         DB    $00
         DB    $02
         DB    $00
         DB    $5B
         DB    $00
         DB    $02
         DB    $00
         DB    $5F
         DB    $00
         DB    $02
         DB    $00
         DB    $66
         DB    $00
         DB    $02
         DB    $00
         DB    $6B
         DB    $00
         DB    $02
         DB    $00
         DB    $75
         DB    $00
         DB    $02
         DB    $00
         DB    $78
         DB    $00
         DB    $02
         DB    $00
         DB    $7D
         DB    $00
         DB    $02
         DB    $00
         DB    $82
         DB    $00
         DB    $02
         DB    $00
         DB    $87
         DB    $00
         DB    $02
         DB    $00
         DB    $8C
         DB    $00
         DB    $02
         DB    $00
         DB    $91
         DB    $00
         DB    $02
         DB    $00
         DB    $9B
         DB    $00
         DB    $02
         DB    $00
         DB    $9E
         DB    $00
         DB    $03
         DB    $00
         DB    $A2
         DB    $00
         DB    $02
         DB    $00
         DB    $A5
         DB    $00
         DB    $03
         DB    $00
         DB    $A9
         DB    $00
         DB    $02
         DB    $00
         DB    $B6
         DB    $00
         DB    $02
         DB    $00
         DB    $BD
         DB    $00
         DB    $02
         DB    $00
         DB    $C7
         DB    $00
         DB    $02
         DB    $00
         DB    $E2
         DB    $00
         DB    $02
         DB    $00
         DB    $E9
         DB    $00
         DB    $02
         DB    $00
         DB    $0B
         DB    $01
         DB    $03
         DB    $00
         DB    $3E
         DB    $01
         DB    $04
         DB    $00
         DB    $44
         DB    $01
         DB    $04
         DB    $00
         DB    $4B
         DB    $01
         DB    $01
         DB    $00
         DB    $52
         DB    $01
         DB    $04
         DB    $00
         DB    $59
         DB    $01
         DB    $04
         DB    $00
         DB    $66
         DB    $01
         DB    $04
         DB    $00
         DB    $FF
         DB    $FF
L021BF0  ENT
         DB    $3E
         DB    $01
         DB    $00
         DB    $00
         ADRL  L021522
         DB    $44
         DB    $01
         DB    $00
         DB    $00
         ADRL  L0218A6
         DB    $52
         DB    $01
         DB    $00
         DB    $00
         ADRL  L0218B4
         DB    $66
         DB    $01
         DB    $00
         DB    $00
         ADRL  L0218CC
         DB    $FF
         DB    $FF
         DB    $FF
         DB    $FF
L021C14  ENT
         DB    $21
         DB    $00
         DA    L021885
         DB    $42
         DB    $00
         DA    L0218B6
         DB    $47
         DB    $00
         DA    L0218BB
         DB    $56
         DB    $00
         DA    L021849
         DB    $5B
         DB    $00
         DA    L0218B6
         DB    $5F
         DB    $00
         DA    L0218B6
         DB    $66
         DB    $00
         DA    L0218CF
         DB    $75
         DB    $00
         DA    L021849
         DB    $78
         DB    $00
         DA    L0218AD
         DB    $82
         DB    $00
         DA    L0218BB
         DB    $8C
         DB    $00
         DA    L0218C2
         DB    $9B
         DB    $00
         DA    L021849
         DB    $A2
         DB    $00
         DA    L0218C4
         DB    $A9
         DB    $00
         DA    L0218C6
         DB    $B6
         DB    $00
         DA    L021849
         DB    $BD
         DB    $00
         DA    L0218B6
         DB    $C7
         DB    $00
         DA    L021849
         DB    $E2
         DB    $00
         DA    L021875+1
         DB    $E9
         DB    $00
         DA    L021875+3
         DB    $FF
         DB    $FF
L021C62  ENT
         DB    $95
         DB    $03
         DB    $0C
         DB    $00
         DB    $03
         DB    $00
         DB    $13
         DB    $00
         DB    $02
         DB    $00
         DB    $16
         DB    $00
         DB    $02
         DB    $00
         DB    $30
         DB    $00
         DB    $02
         DB    $00
         DB    $35
         DB    $00
         DB    $02
         DB    $00
         DB    $38
         DB    $00
         DB    $03
         DB    $00
         DB    $3F
         DB    $00
         DB    $02
         DB    $00
         DB    $47
         DB    $00
         DB    $03
         DB    $00
         DB    $51
         DB    $00
         DB    $02
         DB    $00
         DB    $54
         DB    $00
         DB    $02
         DB    $00
         DB    $57
         DB    $00
         DB    $03
         DB    $00
         DB    $84
         DB    $00
         DB    $02
         DB    $00
         DB    $89
         DB    $00
         DB    $02
         DB    $00
         DB    $8E
         DB    $00
         DB    $02
         DB    $00
         DB    $9B
         DB    $00
         DB    $02
         DB    $00
         DB    $A0
         DB    $00
         DB    $02
         DB    $00
         DB    $A3
         DB    $00
         DB    $03
         DB    $00
         DB    $AA
         DB    $00
         DB    $02
         DB    $00
         DB    $B2
         DB    $00
         DB    $03
         DB    $00
         DB    $BC
         DB    $00
         DB    $02
         DB    $00
         DB    $BF
         DB    $00
         DB    $02
         DB    $00
         DB    $C2
         DB    $00
         DB    $03
         DB    $00
         DB    $D0
         DB    $00
         DB    $02
         DB    $00
         DB    $D8
         DB    $00
         DB    $03
         DB    $00
         DB    $E2
         DB    $00
         DB    $02
         DB    $00
         DB    $E5
         DB    $00
         DB    $02
         DB    $00
         DB    $E8
         DB    $00
         DB    $03
         DB    $00
         DB    $F9
         DB    $00
         DB    $02
         DB    $00
         DB    $FD
         DB    $00
         DB    $02
         DB    $00
         DB    $0D
         DB    $01
         DB    $02
         DB    $00
         DB    $10
         DB    $01
         DB    $02
         DB    $00
         DB    $13
         DB    $01
         DB    $03
         DB    $00
         DB    $27
         DB    $01
         DB    $03
         DB    $00
         DB    $4D
         DB    $01
         DB    $03
         DB    $00
         DB    $79
         DB    $01
         DB    $02
         DB    $00
         DB    $7E
         DB    $01
         DB    $02
         DB    $00
         DB    $89
         DB    $01
         DB    $03
         DB    $00
         DB    $B6
         DB    $01
         DB    $03
         DB    $00
         DB    $D8
         DB    $01
         DB    $02
         DB    $00
         DB    $E7
         DB    $01
         DB    $03
         DB    $00
         DB    $1A
         DB    $02
         DB    $02
         DB    $00
         DB    $1F
         DB    $02
         DB    $02
         DB    $00
         DB    $26
         DB    $02
         DB    $03
         DB    $00
         DB    $35
         DB    $02
         DB    $02
         DB    $00
         DB    $38
         DB    $02
         DB    $02
         DB    $00
         DB    $3B
         DB    $02
         DB    $02
         DB    $00
         DB    $3E
         DB    $02
         DB    $02
         DB    $00
         DB    $41
         DB    $02
         DB    $03
         DB    $00
         DB    $51
         DB    $02
         DB    $03
         DB    $00
         DB    $60
         DB    $02
         DB    $02
         DB    $00
         DB    $63
         DB    $02
         DB    $02
         DB    $00
         DB    $66
         DB    $02
         DB    $02
         DB    $00
         DB    $69
         DB    $02
         DB    $02
         DB    $00
         DB    $6C
         DB    $02
         DB    $03
         DB    $00
         DB    $7A
         DB    $02
         DB    $03
         DB    $00
         DB    $89
         DB    $02
         DB    $02
         DB    $00
         DB    $8C
         DB    $02
         DB    $02
         DB    $00
         DB    $8F
         DB    $02
         DB    $02
         DB    $00
         DB    $92
         DB    $02
         DB    $02
         DB    $00
         DB    $95
         DB    $02
         DB    $03
         DB    $00
         DB    $A5
         DB    $02
         DB    $03
         DB    $00
         DB    $B4
         DB    $02
         DB    $02
         DB    $00
         DB    $B7
         DB    $02
         DB    $02
         DB    $00
         DB    $BA
         DB    $02
         DB    $02
         DB    $00
         DB    $BD
         DB    $02
         DB    $02
         DB    $00
         DB    $C0
         DB    $02
         DB    $03
         DB    $00
         DB    $CE
         DB    $02
         DB    $03
         DB    $00
         DB    $DD
         DB    $02
         DB    $02
         DB    $00
         DB    $E0
         DB    $02
         DB    $02
         DB    $00
         DB    $E3
         DB    $02
         DB    $02
         DB    $00
         DB    $E6
         DB    $02
         DB    $02
         DB    $00
         DB    $E9
         DB    $02
         DB    $03
         DB    $00
         DB    $F9
         DB    $02
         DB    $03
         DB    $00
         DB    $08
         DB    $03
         DB    $02
         DB    $00
         DB    $0B
         DB    $03
         DB    $02
         DB    $00
         DB    $0E
         DB    $03
         DB    $02
         DB    $00
         DB    $11
         DB    $03
         DB    $02
         DB    $00
         DB    $14
         DB    $03
         DB    $03
         DB    $00
         DB    $22
         DB    $03
         DB    $03
         DB    $00
         DB    $31
         DB    $03
         DB    $02
         DB    $00
         DB    $34
         DB    $03
         DB    $02
         DB    $00
         DB    $37
         DB    $03
         DB    $02
         DB    $00
         DB    $3A
         DB    $03
         DB    $02
         DB    $00
         DB    $3D
         DB    $03
         DB    $03
         DB    $00
         DB    $4B
         DB    $03
         DB    $03
         DB    $00
         DB    $5A
         DB    $03
         DB    $02
         DB    $00
         DB    $62
         DB    $03
         DB    $02
         DB    $00
         DB    $66
         DB    $03
         DB    $03
         DB    $00
         DB    $75
         DB    $03
         DB    $02
         DB    $00
         DB    $7A
         DB    $03
         DB    $02
         DB    $00
         DB    $86
         DB    $03
         DB    $03
         DB    $00
         DB    $FF
         DB    $FF
L021DD2  ENT
         DB    $0C
         DB    $00
         DB    $00
         DB    $00
         ADRL  L070000
         ADRL  $00000038
         ADRL  L07058A
         ADRL  $00000047
         ADRL  L0220A5
         ADRL  $00000057
         ADRL  L021F00
         ADRL  $000000A3
         ADRL  L07058A
         ADRL  $000000B2
         ADRL  L0220A5
         ADRL  $000000C2
         ADRL  L021F00
         ADRL  $000000D8
         ADRL  L0220A5
         ADRL  $000000E8
         ADRL  L021F00
         ADRL  $00000113
         ADRL  L07058A
         ADRL  $00000127
         ADRL  L070803
         ADRL  $0000014D
         ADRL  L0708CF
         ADRL  $00000189
         ADRL  L070C19
         ADRL  $000001B6
         ADRL  L08298D
         ADRL  $000001E7
         ADRL  L0A5404
         ADRL  $00000226
         ADRL  L0A1ED3
         ADRL  $00000241
         ADRL  L074E7A
         ADRL  $00000251
         ADRL  L0A1ED3
         ADRL  $0000026C
         ADRL  L07503B
         ADRL  $0000027A
         ADRL  L0A1ED3
         ADRL  $00000295
         ADRL  L074E7A
         ADRL  $000002A5
         ADRL  L0A1ED3
         ADRL  $000002C0
         ADRL  L074FC4
         ADRL  $000002CE
         ADRL  L0A1ED3
         ADRL  $000002E9
         ADRL  L074E7A
         ADRL  $000002F9
         ADRL  L0A1ED3
         ADRL  $00000314
         ADRL  L07503B
         ADRL  $00000322
         ADRL  L0A1ED3
         ADRL  $0000033D
         ADRL  L074FC4
         ADRL  $0000034B
         ADRL  L0A1ED3
         ADRL  $FFFFFFFF
L021EC6  ENT
         DW    $0238
         DA    L0218D6
         DW    $023E
         DA    L0D15F7
         DW    $0263
         DA    L021966
         DW    $0269
         DA    L0D15F7
         DW    $028C
         DA    L021972
         DW    $0292
         DA    L0210DC
         DW    $02B7
         DA    L0219B6
         DW    $02BD
         DA    L0210DC
         DW    $02E0
         DA    L0219F0
         DW    $02E6
         DA    L021385
         DW    $030B
         DA    L021A80
         DW    $0311
         DA    L021385
         DW    $0334
         DA    L021AA4
         DW    $033A
         DA    L021385
         DW    $FFFF
L021F00  ENT
         CLC
         ADC   $04,S
         STA   $04,S
         TXA
         ADC   $06,S
         STA   $06,S
         RTL

L021F0B  ENT
         PHA
         TXA
         EOR   #$FFFF
         TAX
         PLA
         EOR   #$FFFF
         INC
         BNE   L021F19
         INX
L021F19  RTL

L021F1A  ENT
         PHD
         PHA
         PEA   $0001
         TSC
         TCD
         LDA   $0A
         BEQ   L021F8F
         LDX   #$0000
         BCC   L021F45
         BIT   #$8000
         BEQ   L021F36
         EOR   #$FFFF
         INC
         STA   $0A
         INX
L021F36  LDA   $03
         BIT   #$8000
         BEQ   L021F45
         EOR   #$FFFF
         INC
         STA   $03
         INX
         INX
L021F45  LDY   #$0000
         BRA   L021F4C
L021F4A  ASL   $01
L021F4C  ASL   $0A
         BCC   L021F4A
         ROR   $0A
L021F52  LDA   $03
         CMP   $0A
         BCC   L021F63
         LDA   $03
         SEC
         SBC   $0A
         STA   $03
         TYA
         ORA   $01
         TAY
L021F63  LSR   $0A
         LSR   $01
         BCC   L021F52
         LDA   $03
         STA   $0A
         TYA
         CPX   #$0000
         BEQ   L021F8B
         CPX   #$0003
         BEQ   L021F81
         EOR   #$FFFF
         INC
         CPX   #$0001
         BEQ   L021F8B
L021F81  TAY
         LDA   $0A
         EOR   #$FFFF
         INC
         STA   $0A
         TYA
L021F8B  PLY
         PLY
         PLD
         RTL

L021F8F  PEA   $0004
         PEA   $0000
         PEA   $0000
         _SysFailMgr
L021F9F  ENT
         ORA   $04,S
         STA   $04,S
         TXA
         ORA   $06,S
         STA   $06,S
         RTL

L021FA9  ENT
         PHD
         PHX
         PHA
         PEA   $0000
         PEA   $0001
         PEA   $0000
         PEA   $0000
         TSC
         TCD
         LDA   $12
         ORA   $14
         BNE   L021FC6
         LDX   #$0000
         BRL   L02208A
L021FC6  LDX   #$0000
         BCC   L021FFE
         LDA   $14
         BIT   #$8000
         BEQ   L021FE4
         EOR   #$FFFF
         STA   $14
         LDA   $12
         EOR   #$FFFF
         INC
         BNE   L021FE1
         INC   $14
L021FE1  STA   $12
         INX
L021FE4  LDA   $0B
         BIT   #$8000
         BEQ   L021FFE
         EOR   #$FFFF
         STA   $0B
         LDA   $09
         EOR   #$FFFF
         INC
         BNE   L021FFA
         INC   $0B
L021FFA  STA   $09
         INX
         INX
L021FFE  BRA   L022004
L022000  ASL   $05
         ROL   $07
L022004  ASL   $12
         ROL   $14
         BCC   L022000
         ROR   $14
         ROR   $12
L02200E  LDA   $0B
         CMP   $14
         BEQ   L022018
         BCC   L022037
         BRA   L02201E
L022018  LDA   $09
         CMP   $12
         BCC   L022037
L02201E  LDA   $09
         SEC
         SBC   $12
         STA   $09
         LDA   $0B
         SBC   $14
         STA   $0B
         LDA   $01
         ORA   $05
         STA   $01
         LDA   $03
         ORA   $07
         STA   $03
L022037  LSR   $14
         ROR   $12
         LSR   $07
         ROR   $05
         BCC   L02200E
         CPX   #$0000
         BEQ   L022076
         CPX   #$0003
         BEQ   L022063
         LDA   $01
         EOR   #$FFFF
         STA   $01
         LDA   $03
         EOR   #$FFFF
         INC   $01
         BNE   L02205C
         INC
L02205C  STA   $03
         CPX   #$0001
         BEQ   L022076
L022063  LDA   $09
         EOR   #$FFFF
         STA   $09
         LDA   $0B
         EOR   #$FFFF
         INC   $09
         BNE   L022074
         INC
L022074  STA   $0B
L022076  LDA   $09
         STA   $12
         LDA   $0B
         STA   $14
         LDA   $01
         LDX   $03
         PLY
         PLY
         PLY
         PLY
         PLY
         PLY
         PLD
         RTL

L02208A  PEA   $0004
         PEA   $0000
         PEA   $0000
         _SysFailMgr
L02209A  ENT
         SEC
         SBC   $04,S
         STA   $04,S
         TXA
         SBC   $06,S
         STA   $06,S
         RTL

L0220A5  ENT
         PHD
         PHA
         TSC
         TCD
         LDX   #$0000
         BCC   L0220CA
         LDA   $08
         BIT   #$8000
         BEQ   L0220BC
         EOR   #$FFFF
         INC
         STA   $08
         INX
L0220BC  LDA   $01
         BIT   #$8000
         BEQ   L0220CA
         EOR   #$FFFF
         INC
         STA   $01
         DEX
L0220CA  LDA   #$0000
         BRA   L0220D8
L0220CF  LSR   $01
         BCC   L0220D6
         CLC
         ADC   $08
L0220D6  ASL   $08
L0220D8  LDY   $01
         BNE   L0220CF
         CPX   #$0000
         BEQ   L0220E5
         EOR   #$FFFF
         INC
L0220E5  STA   $08
         PLY
         PLD
         RTL

L0220EA  ENT
         PHD
         PHX
         PHA
         PEA   $0000
         PEA   $0000
         TSC
         TCD
         LDX   #$0000
         BCC   L02212C
         LDA   $10
         BIT   #$8000
         BEQ   L022113
         EOR   #$FFFF
         STA   $10
         LDA   $0E
         EOR   #$FFFF
         INC
         BNE   L022110
         INC   $10
L022110  STA   $0E
         INX
L022113  LDA   $07
         BIT   #$8000
         BEQ   L02212C
         EOR   #$FFFF
         STA   $07
         LDA   $05
         EOR   #$FFFF
         INC
         BNE   L022129
         INC   $07
L022129  STA   $05
         DEX
L02212C  BRA   L022145
L02212E  LSR   $07
         ROR   $05
         BCC   L022141
         LDA   $01
         CLC
         ADC   $0E
         STA   $01
         LDA   $03
         ADC   $10
         STA   $03
L022141  ASL   $0E
         ROL   $10
L022145  LDA   $05
         ORA   $07
         BNE   L02212E
         CPX   #$0000
         BEQ   L022163
         LDA   $01
         EOR   #$FFFF
         STA   $01
         LDA   $03
         EOR   #$FFFF
         INC   $01
         BNE   L022161
         INC
L022161  STA   $03
L022163  LDA   $01
         STA   $0E
         LDA   $03
         STA   $10
         PLY
         PLY
         PLY
         PLY
         PLD
         RTL

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

L02219C  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E6
         TCS
         LDX   $FB
         LDA   $F9
         STX   $EA
         STA   $E8
L0221AF  LDA   $F7
         CMP   #$0001
         BEQ   L0221DA
         BCC   L0221DA
         LDA   [$FD]
         STA   [$F9]
         LDA   $F9
         CLC
         ADC   #$0002
         STA   $F9
         BCC   L0221C8
         INC   $FB
L0221C8  LDA   $FD
         CLC
         ADC   #$0002
         STA   $FD
         BCC   L0221D4
         INC   $FF
L0221D4  DEC   $F7
         DEC   $F7
         BRA   L0221AF
L0221DA  LDA   $F7
         BEQ   L0221E6
         SEP   #$20
         LDA   [$FD]
         STA   [$F9]
         REP   #$20
L0221E6  LDX   $EA
         LDA   $E8
         STX   $FF
         STA   $FD
         TDC
         CLC
         ADC   #$00F1
         TCS
         PLD
         RTL

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

L022262  ENT
         TAY
         PHB
         LDA   $06,S
         PHA
         PLB
         PLB
         PHY
         PHY
         PEA   $0000
         TXA
         CMP   ($0B,S),Y
         BEQ   L0222A2
         LDY   #$0000
         CMP   ($0B,S),Y
         BEQ   L0222A2
         BRA   L02227F
L02227C  TYA
         STA   $03,S
L02227F  LDA   $03,S
         CMP   $01,S
         BEQ   L02229D
         CLC
         ADC   $01,S
         LSR
         AND   #$00FE
         CMP   $01,S
         BEQ   L02229D
         TAY
         TXA
         CMP   ($0B,S),Y
         BEQ   L0222A2
         BCC   L02227C
         TYA
         STA   $01,S
         BRA   L02227F
L02229D  LDA   $05,S
         INC
         INC
         TAY
L0222A2  TYX
         PLA
         PLA
         PLA
         PLB
         RTL

L0222A8  ENT
         TAY
         LDA   $04,S
         TAX
         BEQ   L0222B4
         TYA
L0222AF  ASL
         DEX
         BNE   L0222AF
         TAY
L0222B4  TYA
         STA   $04,S
         RTL

L0222B8  ENT
         PHD
         PHX
         PHA
         TSC
         TCD
         LDX   $0A
         LDA   $0C
         BEQ   L0222C6
         LDX   #$0021
L0222C6  TXY
         BEQ   L0222D3
         LDA   $01
L0222CB  ASL
         ROL   $03
         DEX
         BNE   L0222CB
         STA   $01
L0222D3  LDA   $01
         STA   $0A
         LDA   $03
         STA   $0C
         PLY
         PLY
         PLD
         RTL

L0222DF  ENT
         BCC   L0222F3
         TAY
         LDA   $04,S
         TAX
         BEQ   L0222FF
         TYA
         BEQ   L022300
         BPL   L0222FA
L0222EC  SEC
         ROR
         DEX
         BNE   L0222EC
         BRA   L022300
L0222F3  TAY
         LDA   $04,S
         TAX
         BEQ   L0222FF
         TYA
L0222FA  LSR
         DEX
         BNE   L0222FA
         TAY
L0222FF  TYA
L022300  STA   $04,S
         RTL

L022303  ENT
         BCC   L022325
         PHD
         PHX
         PHA
         TSC
         TCD
         LDX   $0A
         LDA   $0C
         BEQ   L022313
         LDX   #$0021
L022313  TXY
         BEQ   L022340
         LDA   $03
         BPL   L022336
L02231A  SEC
         ROR
         ROR   $01
         DEX
         BNE   L02231A
         STA   $03
         BRA   L022340
L022325  PHD
         PHX
         PHA
         TSC
         TCD
         LDX   $0A
         LDA   $0C
         BEQ   L022333
         LDX   #$0021
L022333  TXY
         BEQ   L022340
L022336  LDA   $03
L022338  LSR
         ROR   $01
         DEX
         BNE   L022338
         STA   $03
L022340  LDA   $03
         STA   $0C
         LDA   $01
         STA   $0A
         PLY
         PLY
         PLD
         RTL

L02234C  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E8
         TCS
         LDX   $FB
         LDA   $F9
         STX   $EC
         STA   $EA
L02235F  LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L022369
         INC   $FB
L022369  STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         BEQ   L022376
         BRA   L02235F
L022376  LDA   $F9
         BNE   L02237C
         DEC   $FB
L02237C  DEC   $F9
L02237E  LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L022388
         INC   $FF
L022388  STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L022399
         INC   $FB
L022399  STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         AND   #$00FF
         BEQ   L0223AB
         BRA   L02237E
L0223AB  LDX   $EC
         LDA   $EA
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L0223B9  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
L0223C4  LDA   [$FB]
         AND   #$00FF
         PHA
         LDA   $FF
         AND   #$00FF
         PLX
         STX   $F0
         CMP   $F0
         BNE   L0223DC
         LDX   $FD
         LDA   $FB
         BRA   L0223FB
L0223DC  LDX   $FD
         LDA   $FB
         INC   $FB
         BNE   L0223E6
         INC   $FD
L0223E6  STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00FF
         BNE   L0223C4
         LDA   #$0000
         LDX   #$0000
         TAY
         BPL   L0223FB
         DEX
L0223FB  TAY
         TDC
         CLC
         ADC   #$00F5
         TCS
         TYA
         PLD
         RTL

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

L022457  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDA   $F9
         CMP   $FD
         BNE   L022473
         LDA   $FB
         CMP   $FF
         BNE   L022473
         LDA   #$0000
         BRA   L0224D3
L022473  LDA   [$F9]
         AND   #$00FF
         PHA
         LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L022483
         INC   $FF
L022483  STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         PLX
         STX   $EE
         CMP   $EE
         BNE   L0224B2
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L02249D
         INC   $FB
L02249D  STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         CMP   #$0000
         BNE   L0224B0
         LDA   #$0000
         BRA   L0224D3
L0224B0  BRA   L022473
L0224B2  LDA   $FD
         BNE   L0224B8
         DEC   $FF
L0224B8  DEC   $FD
         LDX   $FF
         LDA   $FD
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         PHA
         LDA   [$F9]
         AND   #$00FF
         PLX
         STX   $F2
         SEC
         SBC   $F2
L0224D3  TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

L0224DD  ENT
         PHB
         PLA
         XBA
         STAL  L022518
         PLA
         STAL  L022518+1
         PLA
         STAL  L0224FE
         PLA
         STAL  L0224FE+2
         PLA
         STAL  L0224FC
         JSL   GSOS
L0224FC  DW    $0000
L0224FE  ADRL  $00000000
         BCS   L022507
         LDA   #$0000
L022507  STAL  L030002
         LDAL  L022518+1
         PHA
         PHB
         LDAL  L022518
         STA   $01,S
         RTL

L022518  BRK   $00
L02251A  ENT
         BRK   $0B
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E8
         TCS
         LDX   $FB
         LDA   $F9
         STX   $EC
         STA   $EA
L02252E  LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L022538
         INC   $FF
L022538  STA   $EE
         STX   $F0
         LDA   [$EE]
         PHA
         LDX   $FB
         LDA   $F9
         INC   $F9
         BNE   L022549
         INC   $FB
L022549  STA   $EE
         STX   $F0
         PLA
         SEP   #$20
         STA   [$EE]
         REP   #$20
         AND   #$00FF
         BEQ   L02255B
         BRA   L02252E
L02255B  LDX   $EC
         LDA   $EA
         TAY
         TDC
         CLC
         ADC   #$00F3
         TCS
         TYA
         PLD
         RTL

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

L022571  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         LDA   $F7
         CMP   $FB
         BNE   L02258E
         LDA   $F9
         CMP   $FD
         BNE   L02258E
         LDA   #$0000
         BRL   L02260F
L02258E  DEC   $FF
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L02259B
         EOR   #$8000
L02259B  BPL   L0225DC
         LDA   [$F7]
         AND   #$00FF
         PHA
         LDX   $FD
         LDA   $FB
         INC   $FB
         BNE   L0225AD
         INC   $FD
L0225AD  STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         PLX
         STX   $EC
         CMP   $EC
         BNE   L0225DC
         LDX   $F9
         LDA   $F7
         INC   $F7
         BNE   L0225C7
         INC   $F9
L0225C7  STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         CMP   #$0000
         BNE   L0225DA
         LDA   #$0000
         BRA   L02260F
L0225DA  BRA   L02258E
L0225DC  LDA   $FF
         SEC
         SBC   #$0000
         BVS   L0225E7
         EOR   #$8000
L0225E7  BMI   L0225EE
         LDA   #$0000
         BRA   L02260F
L0225EE  LDA   $FB
         BNE   L0225F4
         DEC   $FD
L0225F4  DEC   $FB
         LDX   $FD
         LDA   $FB
         STA   $EC
         STX   $EE
         LDA   [$EC]
         AND   #$00FF
         PHA
         LDA   [$F7]
         AND   #$00FF
         PLX
         STX   $F0
         SEC
         SBC   $F0
L02260F  TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L022619  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E6
         TCS
         LDX   $F9
         LDA   $F7
         STX   $EA
         STA   $E8
L02262C  DEC   $FF
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L022639
         EOR   #$8000
L022639  BPL   L022693
         LDX   $FD
         LDA   $FB
         INC   $FB
         BNE   L022645
         INC   $FD
L022645  STA   $EC
         STX   $EE
         LDA   [$EC]
         PHA
         LDX   $F9
         LDA   $F7
         INC   $F7
         BNE   L022656
         INC   $F9
L022656  STA   $EC
         STX   $EE
         PLA
         SEP   #$20
         STA   [$EC]
         REP   #$20
         AND   #$00FF
         CMP   #$0000
         BNE   L022691
L022669  DEC   $FF
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L022676
         EOR   #$8000
L022676  BPL   L022691
         LDX   $F9
         LDA   $F7
         INC   $F7
         BNE   L022682
         INC   $F9
L022682  STA   $EC
         STX   $EE
         LDA   #$0000
         SEP   #$20
         STA   [$EC]
         REP   #$20
         BRA   L022669
L022691  BRA   L02262C
L022693  LDX   $EA
         LDA   $E8
         TAY
         TDC
         CLC
         ADC   #$00F1
         TCS
         TYA
         PLD
         RTL

L0226A1  ENT
         PHD
         TSC
         TCD
         TYA
         AND   #$0001
         BNE   L0226C3
         SEP   #$20
         LDA   [$06],Y
         CMP   [$0A],Y
         REP   #$20
         BNE   L0226C6
         TYA
         BNE   L0226C2
         LDY   #$FFFE
         BRA   L0226C6
L0226BC  LDA   [$06],Y
         CMP   [$0A],Y
         BNE   L0226C6
L0226C2  DEY
L0226C3  DEY
         BPL   L0226BC
L0226C6  LDA   $04,S
         STA   $0C,S
         LDA   $02,S
         STA   $0A,S
         PLD
         TSC
         CLC
         ADC   #$0008
         TCS
         CPY   #$FFFE
         RTL

