*
* Hostage
*
* (c) 1990, Infogrames / Mindscape
* (s) 2020, Antoine Vignau
*

*-----------------------
		
	 mx	%00
	 rel
	 lst	off

	 use	SCRO2.X.S
	 
*-----------------------

	use	4/Event.Macs
	use	4/Locator.Macs
	use	4/Mem.Macs
	use	4/Misc.Macs
	use	4/QD.Macs
	use	4/Sound.Macs
	use	4/Util.Macs
	
*-----------------------

L120000  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$FFB7
         TCS
         STZ   $EC
         STZ   $D7
         LDX   #$FFD0
         STZ   $00,X
         LDX   #$FFCE
         STZ   $00,X
         LDX   #$FFCC
         STZ   $00,X
         LDA   #$0001
         LDX   #$FFCA
         STA   $00,X
         LDA   $FB
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03080A
         LDX   #^L03080A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         LDX   #$FFC8
         STA   $00,X
         LDX   #$FFC8
         LDA   $00,X
         PHA
         JSL   L08080C
         PLY
         JSL   L070062
         PEA   $00A8
         PEA   $0000
         JSL   L1507AF
         PLY
         PLY
         SEP   #$20
         STZ   $EA
         REP   #$20
         LDX   #$FFD4
         STZ   $00,X
         LDX   #$FFD2
         STZ   $00,X
         STZ   L0200D9
         PEI   $FF
         PEI   $FD
         LDX   #$FFC8
         LDA   $00,X
         PHA
         JSL   L1107FE
         PLY
         PLY
         PLY
         LDA   $FB
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03080A
         LDX   #^L03080A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         STA   $E8
         LDA   $FB
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03080A
         LDX   #^L03080A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         STA   $E6
         LDA   $E8
         AND   #$000F
         STA   $E4
         LDA   $E6
         AND   #$000F
         STA   $E2
         LDA   #$0004
         PHA
         LDA   $E8
         SEC
         JSL   L01076A
         PLA
         STA   $E8
         LDA   #$0004
         PHA
         LDA   $E6
         SEC
         JSL   L01076A
         PLA
         STA   $E6
         SEP   #$20
         STZ   $D9
         REP   #$20
         LDX   #$FFE0
         STZ   $00,X
         LDA   #$0001
         LDX   #$FFDE
         STA   $00,X
         LDX   L0200FD
         LDA   L0200FB
         STX   $DC
         STA   $DA
         STZ   $D7
         BRL   L120275
L120129  LDA   $D7
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         LDX   #$FFC8
         CMP   $00,X
         BEQ   L120156
         BRL   L120248
L120156  LDA   $D7
         CLC
         ADC   #$0003
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         BNE   L12017E
         BRL   L120248
L12017E  LDA   $D7
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         PHA
         LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         STA   [$F0]
         LDA   $D7
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         PHA
         LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0002
         STA   [$F0],Y
         LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0006
         LDY   #$0008
         STA   [$F0],Y
         BRA   L120273
L120248  LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0000
         LDY   #$0008
         STA   [$F0],Y
L120273  INC   $D7
L120275  LDA   $D7
         SEC
         SBC   #$0003
         BVS   L120280
         EOR   #$8000
L120280  BMI   L120285
         BRL   L120129
L120285  LDA   $FB
         LDX   #$0000
         TAY
         BPL   L12028E
         DEX
L12028E  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   ^L032C77
         PEA   L032C77
         PEA   $00E1
         PEA   $2000
         PEA   $0014
         PEA   $0108
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         LDA   $FB
         LDX   #$0000
         TAY
         BPL   L1202DB
         DEX
L1202DB  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   ^L032C7F
         PEA   L032C7F
         PEA   $00E1
         PEA   $2000
         PEA   $0015
         PEA   $0107
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         LDA   $FB
         LDX   #$0000
         TAY
         BPL   L120328
         DEX
L120328  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   ^L032C87
         PEA   L032C87
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $0014
         PEA   $0108
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         LDA   $FB
         LDX   #$0000
         TAY
         BPL   L120377
         DEX
L120377  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   ^L032C8F
         PEA   L032C8F
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $0015
         PEA   $0107
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         JSL   L01027B
L1203C1  PEA   $0000
         JSL   L0F102A
         PLY
         PEI   $FB
         JSL   L0A0D67
         PLY
         LDX   #$FFC8
         LDA   $00,X
         PHA
         JSL   L08080C
         PLY
         LDX   #$FFD0
         LDA   $00,X
         BEQ   L120453
         LDX   #$FFD0
         LDA   $00,X
         CLC
         ADC   #$0001
         LDX   #$FFD0
         STA   $00,X
         LDA   $D5
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0008
         LDA   [$F0],Y
         SEC
         SBC   #$0001
         LDY   #$0008
         STA   [$F0],Y
         LDA   $D5
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0008
         LDA   [$F0],Y
         CMP   #$0000
         BNE   L120453
         LDX   #$FFD0
         STZ   $00,X
L120453  STZ   $D7
         BRL   L12050F
L120458  LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         SEC
         SBC   $E8
         ASL
         ASL
         ASL
         ASL
         CLC
         LDX   #$FFE0
         ADC   $00,X
         PHA
         LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0004
         STA   [$F0],Y
         LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         SEC
         SBC   $E6
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0006
         STA   [$F0],Y
         INC   $D7
L12050F  LDA   $D7
         SEC
         SBC   #$0003
         BVS   L12051A
         EOR   #$8000
L12051A  BMI   L12051F
         BRL   L120458
L12051F  LDX   #$FFD4
         LDA   $00,X
         CLC
         ADC   #$0001
         LDX   #$FFD4
         STA   $00,X
         LDX   #$FFD4
         LDA   $00,X
         SEC
         SBC   #$000A
         BVS   L12053B
         EOR   #$8000
L12053B  BPL   L12054B
         JSL   L0703A5
         AND   #$0001
         STA   $EC
         LDX   #$FFD4
         STZ   $00,X
L12054B  LDA   $E8
         ASL
         PHA
         LDA   $E6
         PHA
         LDA   #$0078
         SEC
         JSL   L01059C
         PLA
         PLX
         STX   $F4
         CLC
         ADC   $F4
         LDX   #$0000
         TAY
         BPL   L120568
         DEX
L120568  PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L010410
         PLA
         PLX
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E0
         STA   $DE
         PEA   $003C
         LDX   L020070
         LDA   L02006E
         CLC
         ADC   #$2800
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         CLC
         ADC   #$0020
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEA   $0006
         PEA   $0006
         PEI   $DC
         PEI   $DA
         PEI   $E0
         PEI   $DE
         JSL   L15085B
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         SEP   #$20
         STZ   $D9
         REP   #$20
         STZ   $D7
         BRL   L1206C4
L1205C9  LDA   $D7
         PHA
         LDA   #$000E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFC8
         LDA   $00,X
         PHA
         LDA   #$007E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0312AA
         LDX   #^L0312AA
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         STA   $D3
         LDA   $D7
         PHA
         LDA   #$000E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFC8
         LDA   $00,X
         PHA
         LDA   #$007E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0312AA
         LDX   #^L0312AA
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         STA   $D1
         PEA   $0006
         PEA   $0006
         PEI   $D1
         PEI   $D3
         LDA   $E6
         SEC
         SBC   #$0001
         PHA
         LDA   $E8
         SEC
         SBC   #$0001
         PHA
         JSL   L1107AB
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         AND   #$00FF
         BEQ   L1206BC
         LDA   #$0001
         SEP   #$20
         STA   $D9
         REP   #$20
         LDA   $D3
         SEC
         SBC   $E8
         ASL
         ASL
         ASL
         ASL
         STA   $D3
         LDA   $D1
         SEC
         SBC   $E6
         ASL
         ASL
         ASL
         ASL
         STA   $D1
         PEA   $0000
         TDC
         CLC
         ADC   #$000D
         PHA
         PEI   $D7
         LDX   #$FFC8
         LDA   $00,X
         PHA
         PEI   $D1
         PEI   $D3
         JSL   L111266
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         LDA   $D7
         STA   L0200F2
         BRA   L1206D4
         BRA   L1206C2
L1206BC  LDA   #$FFFF
         STA   L0200F2
L1206C2  INC   $D7
L1206C4  LDA   $D7
         SEC
         SBC   #$0009
         BVS   L1206CF
         EOR   #$8000
L1206CF  BMI   L1206D4
         BRL   L1205C9
L1206D4  PEA   $0000
         TDC
         CLC
         ADC   #$FFDE
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFE0
         PHA
         JSL   L11073B
         PLY
         PLY
         PLY
         PLY
         STZ   $D7
         BRL   L120893
L1206F3  LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0008
         LDA   [$F0],Y
         BNE   L120720
         BRL   L120891
L120720  LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         STA   $D3
         LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0006
         LDA   [$F0],Y
         STA   $D1
         PEA   $00A0
         PEA   $00A0
         PEI   $D1
         PEI   $D3
         PEA   $FFC0
         PEA   $FFC0
         JSL   L1107AB
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         AND   #$00FF
         BNE   L120798
         BRL   L120869
L120798  LDA   $D1
         CLC
         ADC   #$0018
         STA   $D1
         LDX   L020054
         LDA   L020052
         PHX
         PHA
         LDX   L020070
         LDA   L02006E
         PHX
         PHA
         LDX   #$FFD0
         LDA   $00,X
         PHA
         LDA   #$0008
         SEC
         JSL   L01059C
         LDA   $D1
         CLC
         ADC   #$0040
         PLX
         STX   $F4
         CLC
         ADC   $F4
         PHA
         LDA   $D3
         CLC
         ADC   #$0040
         SEC
         SBC   #$0004
         PHA
         LDA   #$0003
         CLC
         ADC   $EC
         PHA
         JSL   L130695
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDA   $D7
         CLC
         ADC   #$0003
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$000D
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   $D3
         STA   [$F0]
         LDA   $D1
         SEC
         SBC   #$0018
         PHA
         LDA   $D7
         CLC
         ADC   #$0003
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$000D
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0002
         STA   [$F0],Y
         LDA   $D7
         CLC
         ADC   #$0001
         PHA
         LDA   $D7
         CLC
         ADC   #$0003
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$000D
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0004
         STA   [$F0],Y
         BRA   L120891
L120869  LDA   $D7
         CLC
         ADC   #$0003
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$000D
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0000
         LDY   #$0004
         STA   [$F0],Y
L120891  INC   $D7
L120893  LDA   $D7
         SEC
         SBC   #$0003
         BVS   L12089E
         EOR   #$8000
L12089E  BMI   L1208A3
         BRL   L1206F3
L1208A3  PEA   $0003
         PEA   $0050
         PEA   $0050
         PEA   $0058
         PEA   $00D0
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         LDA   $E2
         CLC
         ADC   #$0040
         PHA
         LDA   $E4
         CLC
         ADC   #$0040
         PHA
         LDX   L020070
         LDA   L02006E
         PHX
         PHA
         JSL   L150690
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         STZ   $D7
         BRL   L120A09
L1208E1  LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0008
         LDA   [$F0],Y
         BNE   L12090E
         BRL   L120A07
L12090E  LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         PHA
         LDA   #$00D0
         PLX
         STX   $F4
         CLC
         ADC   $F4
         SEC
         SBC   $E4
         SEC
         LDX   #$FFE0
         SBC   $00,X
         CLC
         ADC   #$000C
         STA   $D3
         LDA   $E6
         PHA
         LDA   #$0010
         SEC
         JSL   L01059C
         LDA   #$0058
         PLX
         STX   $F4
         SEC
         SBC   $F4
         SEC
         SBC   $E2
         SEC
         SBC   #$0002
         STA   $D1
         LDA   $D7
         PHA
         LDA   #$000A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$FFE2
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0006
         LDA   [$F0],Y
         PHA
         LDA   #$0058
         PLX
         STX   $F4
         CLC
         ADC   $F4
         SEC
         SBC   $E2
         STA   $CD
         LDA   $D3
         CLC
         ADC   #$0008
         LDX   #$FFD6
         STA   $00,X
         LDA   $D1
         LDX   #$FFD8
         STA   $00,X
         LDA   $D3
         CLC
         LDX   #$FFE0
         ADC   $00,X
         CLC
         ADC   #$0008
         LDX   #$FFDA
         STA   $00,X
         LDA   $CD
         SEC
         SBC   #$0010
         LDX   #$FFDC
         STA   $00,X
         PEA   $0000
         TDC
         CLC
         ADC   #$FFD6
         PHA
         JSL   L150848
         PLY
         PLY
         TAY
         BEQ   L120A07
         PEA   $0003
         LDX   #$FFDC
         LDA   $00,X
         PHA
         LDX   #$FFDA
         LDA   $00,X
         PHA
         LDX   #$FFD8
         LDA   $00,X
         PHA
         LDX   #$FFD6
         LDA   $00,X
         PHA
         JSL   L150098
         PLY
         PLY
         PLY
         PLY
         PLY
L120A07  INC   $D7
L120A09  LDA   $D7
         SEC
         SBC   #$0003
         BVS   L120A14
         EOR   #$8000
L120A14  BMI   L120A19
         BRL   L1208E1
L120A19  LDX   L020054
         LDA   L020052
         PHX
         PHA
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $00A7
         PEA   $00D0
         PEA   $0000
         JSL   L130695
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDA   $D9
         AND   #$00FF
         BEQ   L120A9B
         LDX   #$FFD2
         LDA   $00,X
         BEQ   L120A76
         LDX   L020054
         LDA   L020052
         PHX
         PHA
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $0082
         PEA   $00F0
         PEA   $0005
         JSL   L130695
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDX   #$FFD2
         STZ   $00,X
L120A76  LDX   L020054
         LDA   L020052
         PHX
         PHA
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $0082
         PEA   $00F0
         PEA   $0002
         JSL   L130695
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
L120A9B  PEA   $0000
         JSL   L0C0000
         PLY
         LDA   #$0001
         STA   L0200F4
         LDA   #$0003
         STA   $D7
         BRL   L120C0C
L120AB1  LDA   $D7
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         BNE   L120AD5
         BRL   L120C0A
L120AD5  LDX   #$FFCA
         LDA   $00,X
         BNE   L120ADF
         BRL   L120C0A
L120ADF  LDA   $D7
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         BNE   L120B03
         BRL   L120C0A
L120B03  STZ   L0200F4
         LDA   L0200EE
         BNE   L120B0E
         BRL   L120BE9
L120B0E  LDA   $D7
         LDX   #$0000
         TAY
         BPL   L120B17
         DEX
L120B17  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFB9
         PHA
         JSL   L010882
         PLY
         PLY
         PLY
         PLY
         LDA   $D7
         LDX   #$0000
         TAY
         BPL   L120B57
         DEX
L120B57  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L031688
         LDX   #^L031688
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFB9
         PHA
         JSL   L0107D7
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$FFB9
         PHA
         PEA   ^L032C97
         PEA   L032C97
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $00B9
         PEA   $00F0
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFB9
         PHA
         PEA   ^L032C9F
         PEA   L032C9F
         PEA   $00E1
         PEA   $2000
         PEA   $00B9
         PEA   $00F0
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         STZ   L0200EE
         LDA   #$0001
         STA   L0200F0
         BRA   L120C08
L120BE9  PEA   $00E1
         PEA   $2000
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         JSL   L0103DB
         PLY
         PLY
         PLY
         PLY
         LDA   #$0001
         STA   L0200EE
         STZ   L0200F0
L120C08  BRA   L120C1C
L120C0A  INC   $D7
L120C0C  LDA   $D7
         SEC
         SBC   #$0006
         BVS   L120C17
         EOR   #$8000
L120C17  BMI   L120C1C
         BRL   L120AB1
L120C1C  LDA   L0200F4
         BEQ   L120C3F
         LDA   L0200F0
         BEQ   L120C3F
         PEA   $00E1
         PEA   $2000
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         JSL   L0103DB
         PLY
         PLY
         PLY
         PLY
         STZ   L0200F0
L120C3F  PEA   $0050
         PEA   $004E
         LDAL  L033444
         CLC
         ADC   #$0068
         PHA
         JSL   L13090D
         PLY
         PLY
         PLY
         JSL   L160143
         SEP   #$20
         STA   L0200F6
         REP   #$20
         AND   #$00FF
         BNE   L120C68
         BRL   L120DB3
L120C68  LDA   L0200F6
         AND   #$00FF
         PHA
         JSL   L1508E5
         PLY
         SEP   #$20
         STA   L0200F6
         REP   #$20
         LDA   L0200F6
         AND   #$00FF
         BRL   L120D7B
L120C84  LDA   L0200F6
         AND   #$00FF
         SEC
         SBC   #$00C9
         STA   $EE
         LDA   $EE
         CMP   $FB
         BEQ   L120D01
         LDA   #$0001
         SEP   #$20
         STA   $EA
         REP   #$20
         LDA   $E8
         ASL
         ASL
         ASL
         ASL
         CLC
         ADC   $E4
         PHA
         LDA   $FB
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03080A
         LDX   #^L03080A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0002
         STA   [$F0],Y
         LDA   $E6
         ASL
         ASL
         ASL
         ASL
         CLC
         ADC   $E2
         PHA
         LDA   $FB
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03080A
         LDX   #^L03080A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0004
         STA   [$F0],Y
L120D01  BRL   L120DB3
L120D04  LDA   #$000C
         STA   $EE
         LDA   #$0001
         SEP   #$20
         STA   $EA
         REP   #$20
         LDA   $E8
         ASL
         ASL
         ASL
         ASL
         CLC
         ADC   $E4
         PHA
         LDA   $FB
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03080A
         LDX   #^L03080A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0002
         STA   [$F0],Y
         LDA   $E6
         ASL
         ASL
         ASL
         ASL
         CLC
         ADC   $E2
         PHA
         LDA   $FB
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03080A
         LDX   #^L03080A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0004
         STA   [$F0],Y
         BRL   L120DB3
L120D77  BRA   L120DB3
         BRA   L120DB3
L120D7B  CMP   #$001B
         BEQ   L120D04
         CMP   #$00C9
         BNE   L120D88
         BRL   L120C84
L120D88  CMP   #$00CA
         BNE   L120D90
         BRL   L120C84
L120D90  CMP   #$00CB
         BNE   L120D98
         BRL   L120C84
L120D98  CMP   #$00CC
         BNE   L120DA0
         BRL   L120C84
L120DA0  CMP   #$00CD
         BNE   L120DA8
         BRL   L120C84
L120DA8  CMP   #$00CE
         BNE   L120DB0
         BRL   L120C84
L120DB0  JMP   L120D77

L120DB3  JSL   L010276
         TAY
         BEQ   L120DBE
         JSL   L0B0529
L120DBE  LDX   #$FFD0
         LDA   $00,X
         BNE   L120DD1
         JSL   L150027
         SEP   #$20
         STA   $EB
         REP   #$20
         BRA   L120DD7
L120DD1  SEP   #$20
         STZ   $EB
         REP   #$20
L120DD7  LDA   $EB
         AND   #$00FF
         AND   #$0080
         TAY
         BEQ   L120DE5
         BRL   L120F5A
L120DE5  LDA   $EB
         AND   #$00FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032B7B
         LDX   #^L032B7B
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         LDA   $E4
         PLX
         STX   $F4
         CLC
         ADC   $F4
         STA   $E4
         LDA   $EB
         AND   #$00FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032B8D
         LDX   #^L032B8D
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         LDA   $E2
         PLX
         STX   $F4
         CLC
         ADC   $F4
         STA   $E2
         LDX   #$FFD4
         LDA   $00,X
         SEC
         SBC   #$0006
         BEQ   L120E5A
         BVS   L120E45
         EOR   #$8000
L120E45  BPL   L120E5A
         JSL   L0703A5
         LDX   #$FFCE
         STA   $00,X
         LDX   #$FFCE
         LDA   $00,X
         LDX   #$FFCC
         STA   $00,X
L120E5A  LDX   #$FFCE
         LDA   $00,X
         SEC
         SBC   #$0000
         BVS   L120E68
         EOR   #$8000
L120E68  BMI   L120E8D
         LDX   #$FFCC
         LDA   $00,X
         AND   #$0001
         LDX   #$FFCC
         STA   $00,X
         LDA   $E2
         SEC
         LDX   #$FFCC
         SBC   $00,X
         STA   $E2
         LDA   $E4
         SEC
         LDX   #$FFCC
         SBC   $00,X
         STA   $E4
         BRA   L120EAE
L120E8D  LDX   #$FFCC
         LDA   $00,X
         AND   #$0001
         LDX   #$FFCC
         STA   $00,X
         LDA   $E2
         CLC
         LDX   #$FFCC
         ADC   $00,X
         STA   $E2
         LDA   $E4
         CLC
         LDX   #$FFCC
         ADC   $00,X
         STA   $E4
L120EAE  LDA   $E4
         SEC
         SBC   #$0000
         BVS   L120EB9
         EOR   #$8000
L120EB9  BMI   L120ECD
         LDA   $E8
         BNE   L120EC3
         STZ   $E4
         BRA   L120ECB
L120EC3  LDA   $E8
         SEC
         SBC   #$0001
         STA   $E8
L120ECB  BRA   L120EFC
L120ECD  LDA   $E8
         SEC
         SBC   #$0037
         BVS   L120ED8
         EOR   #$8000
L120ED8  BMI   L120EF3
         LDA   $E4
         SEC
         SBC   #$000F
         BEQ   L120EF3
         BVS   L120EE7
         EOR   #$8000
L120EE7  BPL   L120EF3
         LDA   $E8
         CLC
         ADC   #$0001
         STA   $E8
         BRA   L120EFC
L120EF3  LDA   $E8
         CMP   #$0037
         BNE   L120EFC
         STZ   $E4
L120EFC  LDA   $E2
         SEC
         SBC   #$0000
         BVS   L120F07
         EOR   #$8000
L120F07  BMI   L120F1B
         LDA   $E6
         BNE   L120F11
         STZ   $E2
         BRA   L120F19
L120F11  LDA   $E6
         SEC
         SBC   #$0001
         STA   $E6
L120F19  BRA   L120F4A
L120F1B  LDA   $E6
         SEC
         SBC   #$002B
         BVS   L120F26
         EOR   #$8000
L120F26  BMI   L120F41
         LDA   $E2
         SEC
         SBC   #$000F
         BEQ   L120F41
         BVS   L120F35
         EOR   #$8000
L120F35  BPL   L120F41
         LDA   $E6
         CLC
         ADC   #$0001
         STA   $E6
         BRA   L120F4A
L120F41  LDA   $E6
         CMP   #$002B
         BNE   L120F4A
         STZ   $E2
L120F4A  LDA   $E4
         AND   #$000F
         STA   $E4
         LDA   $E2
         AND   #$000F
         STA   $E2
         BRA   L120FA9
L120F5A  LDX   #$FFD0
         LDA   $00,X
         BNE   L120FA1
         PEI   $FF
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$FFD0
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFE2
         PHA
         LDX   #$FFC8
         LDA   $00,X
         PHA
         PEI   $E2
         PEI   $E4
         PEA   $0000
         TDC
         CLC
         ADC   #$000D
         PHA
         LDA   $D9
         AND   #$00FF
         PHA
         JSL   L11096B
         TAY
         TSC
         CLC
         ADC   #$0018
         TCS
         TYA
         AND   #$00FF
         STA   $D5
L120FA1  LDA   #$0001
         LDX   #$FFD2
         STA   $00,X
L120FA9  LDA   $EA
         AND   #$00FF
         BNE   L120FBB
         LDA   L020045
         AND   #$00FF
         BEQ   L120FBB
         BRL   L1203C1
L120FBB  LDA   $EE
         TAY
         TSC
         CLC
         ADC   #$013D
         TCS
         TYA
         PLD
         RTL

L120FC7  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$FFD2
         TCS
         STZ   $EC
         LDX   #$FFFE
         STZ   $00,X
         LDX   #$FFF2
         STZ   $00,X
         LDX   #$FFF0
         STZ   $00,X
         LDX   #$FFEE
         STZ   $00,X
         LDX   #$FFEC
         STZ   $00,X
         LDX   #$FFE8
         STZ   $00,X
         LDA   #$0001
         LDX   #$FFE6
         STA   $00,X
         LDA   #$0001
         SEP   #$20
         LDX   #$FFD6
         STA   $00,X
         REP   #$20
         LDX   #$FFD4
         STZ   $00,X
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         LDX   #$FFEC
         STA   $00,X
         LDX   #$FFEC
         LDA   $00,X
         PHA
         JSL   L08080C
         PLY
         PEA   $00C7
         PEA   $0000
         JSL   L1507AF
         PLY
         PLY
         JSL   L070062
         PEA   $00B0
         PEA   $0000
         JSL   L1507AF
         PLY
         PLY
         LDA   $FB
         AND   #$00FF
         STA   $EE
         STZ   L0200D9
         PEI   $FF
         PEI   $FD
         LDX   #$FFEC
         LDA   $00,X
         PHA
         JSL   L1107FE
         PLY
         PLY
         PLY
         STZ   $03
         STZ   $01
         LDX   #$FFF4
         STZ   $00,X
         SEP   #$20
         STZ   $EA
         REP   #$20
         LDX   #$FFF8
         STZ   $00,X
         STZ   $CD
         LDX   #$FFFA
         STZ   $00,X
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         PHA
         LDA   #$0010
         SEC
         JSL   L01059C
         PLA
         SEC
         SBC   #$00E8
         CLC
         ADC   #$00B0
         STA   $E8
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         PHA
         LDA   #$0010
         SEC
         JSL   L01059C
         PLA
         SEC
         SBC   #$0048
         CLC
         ADC   #$0040
         STA   $E6
         LDA   $E8
         AND   #$000F
         STA   $E4
         LDA   $E6
         AND   #$000F
         STA   $E2
         LDA   #$0004
         PHA
         LDA   $E8
         SEC
         JSL   L01076A
         PLA
         STA   $E8
         LDA   #$0004
         PHA
         LDA   $E6
         SEC
         JSL   L01076A
         PLA
         STA   $E6
         LDA   $E6
         SEC
         SBC   #$0001
         STA   $E6
         LDX   L0200FD
         LDA   L0200FB
         STX   $DC
         STA   $DA
         LDA   $FB
         AND   #$00FF
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   ^L032CA7
         PEA   L032CA7
         PEA   $00E1
         PEA   $2000
         PEA   $0014
         PEA   $0108
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         LDA   $FB
         AND   #$00FF
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   ^L032CAF
         PEA   L032CAF
         PEA   $00E1
         PEA   $2000
         PEA   $0015
         PEA   $0107
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         LDA   $FB
         AND   #$00FF
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   ^L032CB7
         PEA   L032CB7
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $0014
         PEA   $0108
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         LDA   $FB
         AND   #$00FF
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   ^L032CBF
         PEA   L032CBF
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $0015
         PEA   $0107
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         JSL   L01027B
L12128D  PEA   $0001
         JSL   L0F102A
         PLY
         LDX   #$FFF4
         LDA   $00,X
         BNE   L1212A7
         LDA   $FB
         AND   #$00FF
         PHA
         JSL   L0A0D67
         PLY
L1212A7  LDX   #$FFEC
         LDA   $00,X
         PHA
         JSL   L08080C
         PLY
         LDX   #$FFF4
         LDA   $00,X
         BNE   L1212BC
         BRL   L1213F5
L1212BC  LDX   #$FFF4
         LDA   $00,X
         CLC
         ADC   #$0001
         LDX   #$FFF4
         STA   $00,X
         LDX   #$FFF4
         LDA   $00,X
         CMP   #$0005
         BNE   L1212E5
         PEI   $FF
         PEI   $FD
         LDX   #$FFEC
         LDA   $00,X
         PHA
         JSL   L1107FE
         PLY
         PLY
         PLY
L1212E5  LDX   #$FFF4
         LDA   $00,X
         SEC
         SBC   #$0007
         BVS   L1212F3
         EOR   #$8000
L1212F3  BMI   L1212F8
         BRL   L1213F5
L1212F8  LDX   #$FFEE
         LDA   $00,X
         PHA
         LDA   #$000E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFEC
         LDA   $00,X
         PHA
         LDA   #$007E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0312AA
         LDX   #^L0312AA
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         PHA
         LDA   $FB
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03059A
         LDX   #^L03059A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0004
         STA   [$F0],Y
         LDX   #$FFEC
         LDA   $00,X
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032C71
         LDX   #^L032C71
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         LDA   $FB
         AND   #$00FF
         PHA
         LDA   #$001A
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03059A
         LDX   #^L03059A
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0008
         STA   [$F0],Y
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$FFFF
         STA   [$F0]
         LDA   $FB
         AND   #$00FF
         STA   $EE
         LDX   #$FFD6
         LDA   $00,X
         AND   #$00FF
         BEQ   L1213F5
         LDA   #$0001
         SEP   #$20
         STA   $EA
         REP   #$20
L1213F5  LDX   #$FFF8
         LDA   $00,X
         CLC
         ADC   #$0001
         LDX   #$FFF8
         STA   $00,X
         LDX   #$FFF8
         LDA   $00,X
         SEC
         SBC   #$000A
         BVS   L121411
         EOR   #$8000
L121411  BPL   L121421
         JSL   L0703A5
         AND   #$0001
         STA   $EC
         LDX   #$FFF8
         STZ   $00,X
L121421  LDA   $E8
         ASL
         PHA
         LDA   $E6
         PHA
         LDA   #$0078
         SEC
         JSL   L01059C
         PLA
         PLX
         STX   $F4
         CLC
         ADC   $F4
         LDX   #$0000
         TAY
         BPL   L12143E
         DEX
L12143E  PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L010410
         PLA
         PLX
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E0
         STA   $DE
         PEA   $003C
         LDX   L020070
         LDA   L02006E
         CLC
         ADC   #$2800
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         CLC
         ADC   #$0020
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEA   $0008
         PEA   $0009
         PEI   $DC
         PEI   $DA
         PEI   $E0
         PEI   $DE
         JSL   L15085B
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         STZ   $D7
         BRL   L121581
L121499  LDA   $D7
         PHA
         LDA   #$000E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFEC
         LDA   $00,X
         PHA
         LDA   #$007E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0312AA
         LDX   #^L0312AA
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         STA   $D5
         LDA   $D7
         PHA
         LDA   #$000E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFEC
         LDA   $00,X
         PHA
         LDA   #$007E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0312AA
         LDX   #^L0312AA
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         STA   $D3
         PEA   $0006
         PEA   $0006
         PEI   $D3
         PEI   $D5
         LDA   $E6
         SEC
         SBC   #$0001
         PHA
         LDA   $E8
         SEC
         SBC   #$0001
         PHA
         JSL   L1107AB
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         AND   #$00FF
         BEQ   L12157F
         LDA   $D5
         SEC
         SBC   $E8
         ASL
         ASL
         ASL
         ASL
         STA   $D5
         LDA   $D3
         SEC
         SBC   $E6
         ASL
         ASL
         ASL
         ASL
         STA   $D3
         PEA   $0000
         TDC
         CLC
         ADC   #$000D
         PHA
         PEI   $D7
         LDX   #$FFEC
         LDA   $00,X
         PHA
         PEI   $D3
         PEI   $D5
         JSL   L111266
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         LDX   #$FFEA
         STA   $00,X
L12157F  INC   $D7
L121581  LDA   $D7
         SEC
         SBC   #$0009
         BVS   L12158C
         EOR   #$8000
L12158C  BMI   L121591
         BRL   L121499
L121591  PEA   $0003
         PEA   $006F
         PEA   $0080
         PEA   $0040
         PEA   $00B0
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         LDA   $E2
         CLC
         ADC   #$0040
         PHA
         LDA   $E4
         CLC
         ADC   #$0040
         PHA
         LDX   L020070
         LDA   L02006E
         PHX
         PHA
         JSL   L150690
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         LDA   #$00F8
         STA   $D5
         STZ   $D3
         LDA   #$0055
         STA   $CF
         LDA   #$00F8
         SEC
         SBC   $CD
         STA   $D1
         LDA   $D5
         STA   $05
         LDA   $D3
         STA   $07
         LDA   $D1
         STA   $09
         LDA   $CF
         STA   $0B
         PEA   $0000
         TDC
         CLC
         ADC   #$0005
         PHA
         JSL   L150848
         PLY
         PLY
         TAY
         BEQ   L12161B
         LDX   #$FFF0
         LDA   $00,X
         BNE   L12161B
         PEA   $0003
         PEI   $0B
         PEI   $09
         PEI   $07
         PEI   $05
         JSL   L150098
         PLY
         PLY
         PLY
         PLY
         PLY
L12161B  LDA   $03
         CLC
         ADC   $01
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032C05
         LDX   #^L032C05
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         LDX   #$FFFC
         STA   $00,X
         LDX   L02005C
         LDA   L02005A
         PHX
         PHA
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         LDX   #$FFF0
         LDA   $00,X
         PHA
         LDA   #$0008
         SEC
         JSL   L01059C
         LDA   #$0088
         PLX
         STX   $F4
         CLC
         ADC   $F4
         PHA
         LDA   #$00E8
         SEC
         SBC   $CD
         PHA
         LDX   #$FFFC
         LDA   $00,X
         PHA
         JSL   L130695
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDA   $01
         CMP   #$0005
         BEQ   L12168D
         LDA   $01
         CLC
         ADC   #$0001
         STA   $01
L12168D  LDA   $03
         CMP   #$0018
         BNE   L1216A0
         LDX   #$FFFA
         LDA   $00,X
         BNE   L1216A0
         LDA   #$0006
         STA   $03
L1216A0  LDA   $03
         CMP   #$0018
         BNE   L1216B3
         LDA   $01
         CMP   #$0005
         BNE   L1216B3
         LDA   #$002A
         STA   $03
L1216B3  LDA   $03
         CMP   #$002A
         BNE   L1216C6
         LDX   #$FFFA
         LDA   $00,X
         BNE   L1216C6
         LDA   #$0006
         STA   $03
L1216C6  LDA   $03
         CMP   #$0024
         BNE   L1216D9
         LDA   $01
         CMP   #$0005
         BNE   L1216D9
         LDA   #$0006
         STA   $03
L1216D9  LDA   $03
         CMP   #$0006
         BNE   L1216E9
         LDA   $01
         CMP   #$0005
         BNE   L1216E9
         STZ   $03
L1216E9  LDA   $03
         CMP   #$001E
         BEQ   L1216FA
         LDA   $03
         CMP   #$0030
         BEQ   L1216FA
         BRL   L1217BC
L1216FA  LDA   $01
         CMP   #$0005
         BEQ   L121704
         BRL   L1217BC
L121704  LDX   #$FFF2
         LDA   $00,X
         BEQ   L12170E
         BRL   L1217A9
L12170E  LDX   #$FFF0
         LDA   $00,X
         CLC
         ADC   #$0001
         LDX   #$FFF0
         STA   $00,X
         LDX   #$FFF0
         LDA   $00,X
         CMP   #$0008
         BEQ   L121729
         BRL   L1217A7
L121729  LDA   $FB
         AND   #$00FF
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0000
         LDY   #$0002
         STA   [$F0],Y
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$FFFF
         STA   [$F0]
         LDA   #$0001
         SEP   #$20
         STA   $EA
         REP   #$20
         PEA   $005A
         JSL   L0405F2
         PLY
         PEA   $0000
         PEA   ^L031626
         PEA   L031626
         JSL   L040732
         PLY
         PLY
         PLY
         PEA   $7530
         JSL   L140D0A
         PLY
         BRL   L1221D9
L1217A7  BRA   L1217BC
L1217A9  LDX   #$FFF2
         LDA   $00,X
         SEC
         SBC   #$0001
         LDX   #$FFF2
         STA   $00,X
         LDX   #$FFF0
         STZ   $00,X
L1217BC  LDA   $03
         CMP   #$000C
         BEQ   L1217CA
         LDA   $03
         CMP   #$002A
         BNE   L1217D3
L1217CA  LDX   #$FFFA
         LDA   $00,X
         STA   $CD
         BRA   L1217D5
L1217D3  STZ   $CD
L1217D5  LDX   L020054
         LDA   L020052
         PHX
         PHA
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $00AF
         PEA   $00B0
         PEA   $0001
         JSL   L130695
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEA   $0000
         JSL   L0C0000
         PLY
         LDA   #$0001
         STA   L0200F4
         LDA   #$0003
         STA   $D7
         BRL   L12196B
L121810  LDA   $D7
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0004
         LDA   [$F0],Y
         BNE   L121834
         BRL   L121969
L121834  LDX   #$FFE6
         LDA   $00,X
         BNE   L12183E
         BRL   L121969
L12183E  LDA   $D7
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         BNE   L121862
         BRL   L121969
L121862  STZ   L0200F4
         LDA   L0200EE
         BNE   L12186D
         BRL   L121948
L12186D  LDA   $D7
         LDX   #$0000
         TAY
         BPL   L121876
         DEX
L121876  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03165E
         LDX   #^L03165E
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFD7
         PHA
         JSL   L010882
         PLY
         PLY
         PLY
         PLY
         LDA   $D7
         LDX   #$0000
         TAY
         BPL   L1218B6
         DEX
L1218B6  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L031688
         LDX   #^L031688
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         PHX
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFD7
         PHA
         JSL   L0107D7
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         TDC
         CLC
         ADC   #$FFD7
         PHA
         PEA   ^L032CC7
         PEA   L032CC7
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         PEA   $00B9
         PEA   $00F0
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         PEA   $0000
         TDC
         CLC
         ADC   #$FFD7
         PHA
         PEA   ^L032CCF
         PEA   L032CCF
         PEA   $00E1
         PEA   $2000
         PEA   $00B9
         PEA   $00F0
         JSL   L130403
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         STZ   L0200EE
         LDA   #$0001
         STA   L0200F0
         BRA   L121967
L121948  PEA   $00E1
         PEA   $2000
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         JSL   L0103DB
         PLY
         PLY
         PLY
         PLY
         LDA   #$0001
         STA   L0200EE
         STZ   L0200F0
L121967  BRA   L12197B
L121969  INC   $D7
L12196B  LDA   $D7
         SEC
         SBC   #$0006
         BVS   L121976
         EOR   #$8000
L121976  BMI   L12197B
         BRL   L121810
L12197B  LDA   L0200F4
         BEQ   L12199E
         LDA   L0200F0
         BEQ   L12199E
         PEA   $00E1
         PEA   $2000
         LDX   L0200A6
         LDA   L0200A4
         PHX
         PHA
         JSL   L0103DB
         PLY
         PLY
         PLY
         PLY
         STZ   L0200F0
L12199E  PEA   $0080
         PEA   $006F
         LDAL  L033414
         CLC
         ADC   #$0058
         PHA
         JSL   L13090D
         PLY
         PLY
         PLY
         JSL   L160143
         PHA
         JSL   L1508E5
         PLY
         SEP   #$20
         STA   L0200F6
         REP   #$20
         AND   #$00FF
         BNE   L1219CD
         BRL   L121C84
L1219CD  LDA   $03
         CMP   #$0000
         BEQ   L1219D7
         BRL   L121C84
L1219D7  LDX   #$FFF0
         LDA   $00,X
         BEQ   L1219E1
         BRL   L121C84
L1219E1  LDA   L0200F6
         AND   #$00FF
         BRL   L121C49
L1219EA  LDA   L0200F6
         AND   #$00FF
         SEC
         SBC   #$00C9
         STA   $EE
         LDA   $FB
         AND   #$00FF
         CMP   $EE
         BNE   L121A02
         BRL   L121B1E
L121A02  LDA   #$0001
         SEP   #$20
         STA   $EA
         REP   #$20
         LDA   #$0004
         PHA
         LDA   $E8
         PHA
         LDA   #$0010
         SEC
         JSL   L01059C
         PLA
         CLC
         ADC   $E4
         CLC
         ADC   #$00E8
         SEC
         SBC   #$00B0
         SEC
         JSL   L01076A
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0002
         STA   [$F0],Y
         LDA   $E6
         PHA
         LDA   #$0010
         SEC
         JSL   L01059C
         PLA
         CLC
         ADC   $E2
         CLC
         ADC   #$0048
         SEC
         SBC   #$0040
         PHA
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032CD7
         LDX   #^L032CD7
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         STA   [$F0]
         LDA   #$0004
         PHA
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032CD7
         LDX   #^L032CD7
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         SEC
         JSL   L01076A
         PLA
         CLC
         ADC   #$0001
         PHA
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0004
         STA   [$F0],Y
         LDA   #$0010
         PHA
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032CD7
         LDX   #^L032CD7
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         SEC
         JSL   L01041B
         PLA
         STA   [$F0]
L121B1E  BRL   L121C84
L121B21  LDA   #$000C
         STA   $EE
         LDA   #$0001
         SEP   #$20
         STA   $EA
         REP   #$20
         LDA   #$0004
         PHA
         LDA   $E8
         PHA
         LDA   #$0010
         SEC
         JSL   L01059C
         PLA
         CLC
         ADC   $E4
         CLC
         ADC   #$00E8
         SEC
         SBC   #$00B0
         SEC
         JSL   L01076A
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0002
         STA   [$F0],Y
         LDA   $E6
         PHA
         LDA   #$0010
         SEC
         JSL   L01059C
         PLA
         CLC
         ADC   $E2
         CLC
         ADC   #$0048
         SEC
         SBC   #$0040
         PHA
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032CD7
         LDX   #^L032CD7
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         STA   [$F0]
         LDA   #$0004
         PHA
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032CD7
         LDX   #^L032CD7
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         SEC
         JSL   L01076A
         PLA
         CLC
         ADC   #$0001
         PHA
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         LDY   #$0004
         STA   [$F0],Y
         LDA   #$0010
         PHA
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L032CD7
         LDX   #^L032CD7
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         SEC
         JSL   L01041B
         PLA
         STA   [$F0]
         BRL   L121C84
L121C45  BRA   L121C84
         BRA   L121C84
L121C49  CMP   #$001B
         BNE   L121C51
         BRL   L121B21
L121C51  CMP   #$00C9
         BNE   L121C59
         BRL   L1219EA
L121C59  CMP   #$00CA
         BNE   L121C61
         BRL   L1219EA
L121C61  CMP   #$00CB
         BNE   L121C69
         BRL   L1219EA
L121C69  CMP   #$00CC
         BNE   L121C71
         BRL   L1219EA
L121C71  CMP   #$00CD
         BNE   L121C79
         BRL   L1219EA
L121C79  CMP   #$00CE
         BNE   L121C81
         BRL   L1219EA
L121C81  JMP   L121C45

L121C84  JSL   L010276
         TAY
         BEQ   L121C8F
         JSL   L0B0529
L121C8F  LDX   #$FFF4
         LDA   $00,X
         BNE   L121CA9
         LDX   #$FFF0
         LDA   $00,X
         BNE   L121CA9
         JSL   L150027
         SEP   #$20
         STA   $EB
         REP   #$20
         BRA   L121CAF
L121CA9  SEP   #$20
         STZ   $EB
         REP   #$20
L121CAF  LDA   $EB
         AND   #$00FF
         AND   #$0080
         TAY
         BNE   L121CE5
         LDX   #$FFFE
         LDA   $00,X
         BEQ   L121CE5
         PEA   $0064
         JSL   L0405F2
         PLY
         PEA   $0000
         PEA   ^L031638
         PEA   L031638
         JSL   L040732
         PLY
         PLY
         PLY
         LDA   #$0018
         STA   $03
         STZ   $01
         LDX   #$FFFE
         STZ   $00,X
L121CE5  LDA   $EB
         AND   #$00FF
         AND   #$0080
         TAY
         BEQ   L121D3C
         LDA   $03
         CMP   #$0000
         BEQ   L121CFE
         LDA   $03
         CMP   #$0012
         BNE   L121D3C
L121CFE  LDX   #$FFFA
         LDA   $00,X
         CLC
         ADC   #$000C
         LDX   #$FFFA
         STA   $00,X
         LDA   $03
         CMP   #$0012
         BEQ   L121D15
         STZ   $01
L121D15  LDA   #$0012
         STA   $03
         LDA   #$0001
         LDX   #$FFFE
         STA   $00,X
         LDX   #$FFFA
         LDA   $00,X
         SEC
         SBC   #$003C
         BEQ   L121D3C
         BVS   L121D32
         EOR   #$8000
L121D32  BPL   L121D3C
         LDA   #$003C
         LDX   #$FFFA
         STA   $00,X
L121D3C  LDA   $EB
         AND   #$00FF
         CMP   #$0003
         BNE   L121D74
         LDX   #$FFFA
         LDA   $00,X
         BEQ   L121D5E
         LDA   #$000C
         STA   $03
         STZ   $01
         LDA   #$000C
         LDX   #$FFF6
         STA   $00,X
         BRA   L121D74
L121D5E  LDA   $03
         CMP   #$001E
         BEQ   L121D74
         LDA   #$001E
         STA   $03
         STZ   $01
         LDA   #$0008
         LDX   #$FFF2
         STA   $00,X
L121D74  LDX   #$FFEA
         LDA   $00,X
         BNE   L121D7E
         BRL   L121E4E
L121D7E  LDX   #$FFE8
         LDA   $00,X
         BNE   L121D88
         BRL   L121E4E
L121D88  LDA   $03
         CMP   #$0030
         BNE   L121D92
         BRL   L121E4E
L121D92  LDA   #$0030
         STA   $03
         LDX   #$FFF2
         STZ   $00,X
         LDA   #$0005
         STA   $01
         LDA   #$0001
         LDX   #$FFF0
         STA   $00,X
         PEA   $00A0
         JSL   L0405F2
         PLY
         PEA   $0000
         PEA   ^L03162A
         PEA   L03162A
         JSL   L040732
         PLY
         PLY
         PLY
         LDX   #$FFD4
         LDA   $00,X
         SEC
         SBC   #$0001
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFEC
         LDA   $00,X
         PHA
         LDA   #$0012
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L032BCF
         LDX   #^L032BCF
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0001
         STA   [$F0]
         LDA   #$0001
         LDX   #$FFE8
         STA   $00,X
         LDX   #$FFD4
         LDA   $00,X
         SEC
         SBC   #$0001
         LDX   #$FFEE
         STA   $00,X
         LDA   #$0001
         LDX   #$FFF4
         STA   $00,X
         SEP   #$20
         LDX   #$FFD6
         STZ   $00,X
         REP   #$20
         PEA   $2710
         JSL   L140D0A
         PLY
         PEA   $008C
         JSL   L0405F2
         PLY
         PEA   $0000
         PEA   ^L031622
         PEA   L031622
         JSL   L040732
         PLY
         PLY
         PLY
         PEA   $7530
         JSL   L140D0A
         PLY
L121E4E  LDX   #$FFF0
         LDA   $00,X
         BEQ   L121E58
         BRL   L121FA7
L121E58  LDX   #$FFEE
         LDA   $00,X
         BEQ   L121E62
         BRL   L121FA7
L121E62  STZ   $D7
         BRL   L121F97
L121E67  LDA   $D7
         PHA
         LDA   #$000E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFEC
         LDA   $00,X
         PHA
         LDA   #$007E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0312AA
         LDX   #^L0312AA
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         STA   $D5
         LDA   $D7
         PHA
         LDA   #$000E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFEC
         LDA   $00,X
         PHA
         LDA   #$007E
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0312AA
         LDX   #^L0312AA
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         STA   $D3
         LDA   $D5
         ASL
         ASL
         ASL
         ASL
         STA   $D5
         LDA   $D3
         ASL
         ASL
         ASL
         ASL
         STA   $D3
         LDA   $FB
         AND   #$00FF
         SEC
         SBC   #$0003
         PHA
         LDA   #$0006
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L03081C
         LDX   #^L03081C
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         ASL
         ASL
         ASL
         ASL
         CLC
         ADC   #$0006
         STA   $D1
         LDA   $E6
         ASL
         ASL
         ASL
         ASL
         CLC
         ADC   $E2
         CLC
         ADC   #$0048
         SEC
         SBC   #$0040
         CLC
         ADC   #$0040
         SEC
         SBC   #$000C
         STA   $CF
         PEA   $0026
         PEA   $0014
         PEI   $CF
         PEI   $D1
         LDA   $D3
         CLC
         ADC   #$0008
         PHA
         PEI   $D5
         JSL   L1107AB
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         AND   #$00FF
         BEQ   L121F90
         LDX   #$FFEA
         LDA   $00,X
         BEQ   L121F81
         LDA   $CD
         BNE   L121F81
         LDA   #$0001
         LDX   #$FFE8
         STA   $00,X
L121F81  LDA   $D7
         CLC
         ADC   #$0001
         LDX   #$FFD4
         STA   $00,X
         BRA   L121FA7
         BRA   L121F95
L121F90  LDX   #$FFD4
         STZ   $00,X
L121F95  INC   $D7
L121F97  LDA   $D7
         SEC
         SBC   #$0009
         BVS   L121FA2
         EOR   #$8000
L121FA2  BMI   L121FA7
         BRL   L121E67
L121FA7  LDX   #$FFF0
         LDA   $00,X
         BEQ   L121FB1
         BRL   L122070
L121FB1  LDA   $EB
         AND   #$00FF
         CMP   #$0007
         BEQ   L121FBE
         BRL   L12204B
L121FBE  LDA   $03
         CMP   #$0006
         BNE   L121FC8
         BRL   L12204B
L121FC8  LDA   #$0006
         STA   $03
         STZ   $01
         LDX   #$FFFA
         LDA   $00,X
         BNE   L121FD9
         BRL   L12204B
L121FD9  LDX   #$FFD4
         LDA   $00,X
         BEQ   L12204B
         LDX   #$FFD4
         LDA   $00,X
         STA   $D7
         LDA   $D7
         SEC
         SBC   #$0001
         STA   $D7
         LDA   $D7
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$FFEC
         LDA   $00,X
         PHA
         LDA   #$0012
         CLC
         JSL   L01059C
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L032BCF
         LDX   #^L032BCF
         JSL   L010410
         PLA
         PLX
         JSL   L010410
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0001
         STA   [$F0]
         LDX   #$FFEA
         LDA   $00,X
         BEQ   L122037
         LDA   #$0001
         LDX   #$FFE8
         STA   $00,X
         BRA   L12204B
L122037  LDA   $D7
         LDX   #$FFEE
         STA   $00,X
         LDA   #$0001
         LDX   #$FFF4
         STA   $00,X
         LDX   #$FFE8
         STZ   $00,X
L12204B  LDA   $EB
         AND   #$00FF
         CMP   #$0001
         BNE   L122070
         LDA   $03
         CMP   #$0024
         BEQ   L122070
         LDA   #$0024
         STA   $03
         STZ   $01
         LDA   $E2
         SEC
         SBC   #$0010
         STA   $E2
         LDX   #$FFFA
         STZ   $00,X
L122070  LDA   $03
         CMP   #$002A
         BNE   L1220A1
         LDX   #$FFFA
         LDA   $00,X
         BEQ   L1220A1
         LDX   #$FFFA
         LDA   $00,X
         SEC
         SBC   #$000C
         LDX   #$FFFA
         STA   $00,X
         LDX   #$FFFA
         LDA   $00,X
         SEC
         SBC   #$0000
         BVS   L12209A
         EOR   #$8000
L12209A  BMI   L1220A1
         LDX   #$FFFA
         STZ   $00,X
L1220A1  LDA   $03
         CMP   #$000C
         BNE   L122107
         LDX   #$FFFA
         LDA   $00,X
         BEQ   L1220FA
         LDX   #$FFF6
         LDA   $00,X
         CLC
         ADC   #$0002
         LDX   #$FFF6
         STA   $00,X
         LDX   #$FFFA
         LDA   $00,X
         SEC
         SBC   #$0002
         LDX   #$FFFA
         STA   $00,X
         LDX   #$FFFA
         LDA   $00,X
         SEC
         SBC   #$0000
         BVS   L1220D9
         EOR   #$8000
L1220D9  BMI   L1220E0
         LDX   #$FFFA
         STZ   $00,X
L1220E0  LDA   #$0001
         PHA
         LDX   #$FFF6
         LDA   $00,X
         SEC
         JSL   L01076A
         LDA   $E2
         PLX
         STX   $F4
         CLC
         ADC   $F4
         STA   $E2
         BRA   L122107
L1220FA  LDA   #$001E
         STA   $03
         LDA   #$0008
         LDX   #$FFF2
         STA   $00,X
L122107  LDA   $03
         CMP   #$001E
         BEQ   L122115
         LDA   $03
         CMP   #$0030
         BNE   L12211D
L122115  LDA   $E2
         CLC
         ADC   #$0008
         STA   $E2
L12211D  LDA   $E4
         SEC
         SBC   #$0000
         BVS   L122128
         EOR   #$8000
L122128  BMI   L12213C
         LDA   $E8
         BNE   L122132
         STZ   $E4
         BRA   L12213A
L122132  LDA   $E8
         SEC
         SBC   #$0001
         STA   $E8
L12213A  BRA   L12216B
L12213C  LDA   $E8
         SEC
         SBC   #$0037
         BVS   L122147
         EOR   #$8000
L122147  BMI   L122162
         LDA   $E4
         SEC
         SBC   #$000F
         BEQ   L122162
         BVS   L122156
         EOR   #$8000
L122156  BPL   L122162
         LDA   $E8
         CLC
         ADC   #$0001
         STA   $E8
         BRA   L12216B
L122162  LDA   $E8
         CMP   #$0037
         BNE   L12216B
         STZ   $E4
L12216B  LDA   $E2
         SEC
         SBC   #$0000
         BVS   L122176
         EOR   #$8000
L122176  BMI   L12218A
         LDA   $E6
         BNE   L122180
         STZ   $E2
         BRA   L122188
L122180  LDA   $E6
         SEC
         SBC   #$0001
         STA   $E6
L122188  BRA   L1221B9
L12218A  LDA   $E6
         SEC
         SBC   #$0027
         BVS   L122195
         EOR   #$8000
L122195  BMI   L1221B0
         LDA   $E2
         SEC
         SBC   #$000F
         BEQ   L1221B0
         BVS   L1221A4
         EOR   #$8000
L1221A4  BPL   L1221B0
         LDA   $E6
         CLC
         ADC   #$0001
         STA   $E6
         BRA   L1221B9
L1221B0  LDA   $E6
         CMP   #$0027
         BNE   L1221B9
         STZ   $E2
L1221B9  LDA   $E4
         AND   #$000F
         STA   $E4
         LDA   $E2
         AND   #$000F
         STA   $E2
         LDA   $EA
         AND   #$00FF
         BNE   L1221D9
         LDA   L020045
         AND   #$00FF
         BEQ   L1221D9
         BRL   L12128D
L1221D9  LDA   $EE
         TAY
         TSC
         CLC
         ADC   #$0122
         TCS
         TYA
         PLD
         RTL

L1221E5  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         CMP   #$0000
         BNE   L122217
         BRL   L122272
L122217  LDA   $FF
         SEC
         SBC   #$0003
         BVS   L122222
         EOR   #$8000
L122222  BPL   L122227
         BRL   L122272
L122227  LDX   L0200F9
         LDA   L0200F7
         PHX
         PHA
         PEI   $FF
         JSL   L120000
         PLY
         PLY
         PLY
         STA   $FF
         LDA   $FF
         CMP   #$000C
         BEQ   L122265
         LDA   $FF
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         CMP   #$0000
         BEQ   L12226B
L122265  LDA   $FF
         BRA   L122275
         BRA   L122270
L12226B  LDA   #$000C
         BRA   L122275
L122270  BRA   L122275
L122272  LDA   #$000C
L122275  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L12227F  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         BEQ   L1222E5
         LDA   $FF
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0304DA
         LDX   #^L0304DA
         JSL   L010410
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         CMP   #$0001
         BNE   L1222E5
         LDX   L0200F9
         LDA   L0200F7
         PHX
         PHA
         PEI   $FF
         JSL   L120FC7
         PLY
         PLY
         PLY
         STA   $FF
         LDA   $FF
         BRA   L1222E8
         BRA   L1222E8
L1222E5  LDA   #$000C
L1222E8  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

