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

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

	 use	FNAPRO1.X.S
	 
*-----------------------

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

L070000  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00D2
         TCS
         LDA   $FB
         PHA
         LDA   #$0006
         SEC
         JSL   L010FAB
         PLA
         STA   $EE
         LDA   L020149
         PHA
         LDA   #$0008
         SEC
         JSL   L010FAB
         PLA
         STA   $EA
         LDA   #$0006
         STA   L020147
         LDA   #$0020
         STA   $E8
         LDA   #L03325D
         LDX   #^L03325D
         STX   $E6
         STA   $E4
         STZ   $EC
         BRA   L07007A
L070041  LDA   $EE
         CLC
         ADC   $EC
         LDX   #$0000
         TAY
         BPL   L07004D
         DEX
L07004D  PEA   $0000
         PEA   $000C
         CLC
         JSL   L010FF0
         LDA   #L033D29
         LDX   #^L033D29
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDX   #$0000
         LDA   #$0000
         LDY   #$0002
         PHA
         TXA
         STA   [$F0],Y
         PLA
         STA   [$F0]
         INC   $EC
L07007A  LDA   $EC
         SEC
         SBC   #$0006
         BVS   L070085
         EOR   #$8000
L070085  BPL   L070041
L070087  LDA   L020147
         BNE   L07008F
         BRL   L070211
L07008F  LDA   $E8
         BNE   L070096
         BRL   L070211
L070096  DEC   $E8
         LDY   #$000E
         LDA   [$E4],Y
         BNE   L0700A2
         BRL   L070202
L0700A2  LDY   #$000A
         LDA   [$E4],Y
         PHA
         LDA   $EA
         SEC
         SBC   #$0064
         PLX
         STX   $F0
         SEC
         SBC   $F0
         BVS   L0700B9
         EOR   #$8000
L0700B9  BPL   L0700BE
         BRL   L070202
L0700BE  LDY   #$000A
         LDA   [$E4],Y
         PHA
         LDA   $EA
         CLC
         ADC   #$01A4
         PLX
         STX   $F0
         SEC
         SBC   $F0
         BNE   L0700D5
         BRL   L070202
L0700D5  BVS   L0700DA
         EOR   #$8000
L0700DA  BMI   L0700DF
         BRL   L070202
L0700DF  DEC   L020147
         LDA   [$E4]
         LDX   #$0000
         TAY
         BPL   L0700EB
         DEX
L0700EB  STX   $F4
         ASL
         ROL   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDA   #L03362D
         LDX   #^L03362D
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDY   #$0002
         LDA   [$F0],Y
         TAX
         LDA   [$F0]
         STX   $DA
         STA   $D8
         LDY   #$0004
         LDA   [$E4],Y
         LDX   #$0000
         TAY
         BPL   L07011F
         DEX
L07011F  PEA   $0000
         PEA   $0006
         CLC
         JSL   L010FF0
         LDX   $DA
         LDA   $D8
         JSL   L010E15
         PLA
         PLX
         STX   $DE
         STA   $DC
         LDY   #$0008
         LDA   [$E4],Y
         BNE   L07017C
         LDA   [$DC]
         AND   #$8000
         TAY
         BNE   L070162
         LDY   #$0004
         LDA   [$E4],Y
         PHA
         INC
         LDY   #$0004
         STA   [$E4],Y
         PLA
         LDA   $DC
         CLC
         ADC   #$0006
         STA   $DC
         BCC   L070160
         INC   $DE
L070160  BRA   L070172
L070162  LDA   #$0000
         LDY   #$0004
         STA   [$E4],Y
         LDX   $DA
         LDA   $D8
         STX   $DE
         STA   $DC
L070172  LDA   [$DC]
         AND   #$7FFF
         LDY   #$0008
         STA   [$E4],Y
L07017C  LDY   #$0008
         LDA   [$E4],Y
         PHA
         DEC
         LDY   #$0008
         STA   [$E4],Y
         PLA
         LDY   #$0002
         LDA   [$DC],Y
         PHA
         LDY   #$000A
         LDA   [$E4],Y
         PLX
         STX   $F4
         CLC
         ADC   $F4
         LDY   #$000A
         STA   [$E4],Y
         LDY   #$0004
         LDA   [$DC],Y
         PHA
         LDY   #$000C
         LDA   [$E4],Y
         PLX
         STX   $F4
         CLC
         ADC   $F4
         LDY   #$000C
         STA   [$E4],Y
         LDA   $EE
         INC   $EE
         LDX   #$0000
         TAY
         BPL   L0701C0
         DEX
L0701C0  PEA   $0000
         PEA   $000C
         CLC
         JSL   L010FF0
         LDA   #L033D29
         LDX   #^L033D29
         JSL   L010E15
         PLA
         PLX
         STX   $D6
         STA   $D4
         LDX   #$FFFF
         LDA   #$FFFF
         LDY   #$0002
         PHA
         TXA
         STA   [$D4],Y
         PLA
         STA   [$D4]
         LDY   #$000A
         LDA   [$E4],Y
         SEC
         SBC   $EA
         LDY   #$0008
         STA   [$D4],Y
         LDY   #$000C
         LDA   [$E4],Y
         LDY   #$000A
         STA   [$D4],Y
L070202  LDA   $E4
         CLC
         ADC   #$001A
         STA   $E4
         BCC   L07020E
         INC   $E6
L07020E  BRL   L070087
L070211  TSC
         CLC
         ADC   #$0022
         TCS
         PLD
         RTL

L070219  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         STZ   L02001F
         LDA   $FF
         PHA
         LDA   #$0006
         SEC
         JSL   L010FAB
         PLA
         STA   $F2
         BRA   L0702A4
L070237  LDA   $F2
         LDX   #$0000
         TAY
         BPL   L070240
         DEX
L070240  PEA   $0000
         PEA   $000C
         CLC
         JSL   L010FF0
         LDA   #L033D29
         LDX   #^L033D29
         JSL   L010E15
         PLA
         PLX
         STX   $F0
         STA   $EE
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         STX   $F4
         ORA   $F4
         BEQ   L0702A2
         PEI   $F0
         PEI   $EE
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         PHX
         PHA
         LDY   #$000A
         LDA   [$EE],Y
         PHA
         LDY   #$0008
         LDA   [$EE],Y
         PHA
         JSL   L050541
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TAY
         BNE   L0702A2
         LDX   #$0000
         LDA   #$0000
         LDY   #$0002
         PHA
         TXA
         STA   [$EE],Y
         PLA
         STA   [$EE]
L0702A2  INC   $F2
L0702A4  LDA   #$0006
         SEC
         SBC   L020147
         PHA
         LDA   $FF
         PHA
         LDA   #$0006
         SEC
         JSL   L010FAB
         PLA
         PLX
         STX   $F8
         CLC
         ADC   $F8
         SEC
         SBC   $F2
         BEQ   L0702CD
         BVS   L0702C8
         EOR   #$8000
L0702C8  BPL   L0702CD
         BRL   L070237
L0702CD  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L0702D5  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         PHA
         LDA   #$0006
         SEC
         JSL   L010FAB
         PLA
         STA   $F2
         BRA   L07033E
L0702F0  LDA   $F2
         LDX   #$0000
         TAY
         BPL   L0702F9
         DEX
L0702F9  PEA   $0000
         PEA   $000C
         CLC
         JSL   L010FF0
         LDA   #L033D29
         LDX   #^L033D29
         JSL   L010E15
         PLA
         PLX
         STX   $F0
         STA   $EE
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         STX   $F4
         ORA   $F4
         BEQ   L07033C
         LDY   #$000A
         LDA   [$EE],Y
         PHA
         LDA   #$0001
         PHA
         LDY   #$0008
         LDA   [$EE],Y
         SEC
         JSL   L011179
         JSL   L010AA9
         PLY
         PLY
L07033C  INC   $F2
L07033E  LDA   #$0006
         SEC
         SBC   L020147
         PHA
         LDA   $FF
         PHA
         LDA   #$0006
         SEC
         JSL   L010FAB
         PLA
         PLX
         STX   $F8
         CLC
         ADC   $F8
         SEC
         SBC   $F2
         BEQ   L070364
         BVS   L070362
         EOR   #$8000
L070362  BMI   L0702F0
L070364  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L07036C  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         PHA
         LDA   #$0006
         SEC
         JSL   L010FAB
         PLA
         STA   $F2
         BRA   L0703D5
L070387  LDA   $F2
         LDX   #$0000
         TAY
         BPL   L070390
         DEX
L070390  PEA   $0000
         PEA   $000C
         CLC
         JSL   L010FF0
         LDA   #L033D29
         LDX   #^L033D29
         JSL   L010E15
         PLA
         PLX
         STX   $F0
         STA   $EE
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         STX   $F4
         ORA   $F4
         BEQ   L0703D3
         LDY   #$000A
         LDA   [$EE],Y
         PHA
         LDA   #$0001
         PHA
         LDY   #$0008
         LDA   [$EE],Y
         SEC
         JSL   L011179
         JSL   L010796
         PLY
         PLY
L0703D3  INC   $F2
L0703D5  LDA   #$0006
         SEC
         SBC   L020147
         PHA
         LDA   $FF
         PHA
         LDA   #$0006
         SEC
         JSL   L010FAB
         PLA
         PLX
         STX   $F8
         CLC
         ADC   $F8
         SEC
         SBC   $F2
         BEQ   L0703FB
         BVS   L0703F9
         EOR   #$8000
L0703F9  BMI   L070387
L0703FB  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EA
         TCS
         LDA   $FD
         EOR   #$0001
         LDX   #$0000
         TAY
         BPL   L07041A
         DEX
L07041A  PEA   $0000
         PEA   $000C
         CLC
         JSL   L010FF0
         LDA   #L033DED
         LDX   #^L033DED
         JSL   L010E15
         PLA
         PLX
         STX   $F0
         STA   $EE
         LDA   $FF
         LDX   #$0000
         TAY
         BPL   L07043E
         DEX
L07043E  PEA   $0000
         PEA   $001C
         CLC
         JSL   L010FF0
         LDA   #L032787
         LDX   #^L032787
         JSL   L010E15
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDY   #$000E
         LDA   [$F2],Y
         SEC
         SBC   #$00AC
         BEQ   L07046B
         BVS   L070469
         EOR   #$8000
L070469  BMI   L070470
L07046B  LDA   #$0001
         BRA   L070473
L070470  LDA   #$0000
L070473  STA   $EC
         LDA   L02013F
         BNE   L0704CF
         LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         STX   $F2
         ORA   $F2
         BEQ   L0704CD
         LDA   $EC
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   #$0040
         PLX
         STX   $F6
         CLC
         ADC   $F6
         PHA
         PEA   $0004
         LDY   #$000A
         LDA   [$EE],Y
         TAX
         LDY   #$0008
         LDA   [$EE],Y
         PHX
         PHA
         LDY   #$0006
         LDA   [$EE],Y
         TAX
         LDY   #$0004
         LDA   [$EE],Y
         CLC
         ADC   #$0006
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         JSL   L0505AF
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
L0704CD  BRA   L070522
L0704CF  LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         STX   $F2
         ORA   $F2
         BEQ   L070522
         LDA   $EC
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   #$0040
         PLX
         STX   $F6
         CLC
         ADC   $F6
         PHA
         PEA   $0004
         LDY   #$000A
         LDA   [$EE],Y
         TAX
         LDY   #$0008
         LDA   [$EE],Y
         PHX
         PHA
         LDY   #$0006
         LDA   [$EE],Y
         TAX
         LDY   #$0004
         LDA   [$EE],Y
         CLC
         ADC   #$0006
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         JSL   L0505AF
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
L070522  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L07052A  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E2
         TCS
         PEI   $FF
         _SetSolidPenPat
         BCS   L070543
         LDA   #$0000
L070543  STAL  L020010
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         PEI   $F7
         PEI   $F9
         LDA   $FB
         CLC
         ADC   #$0001
         PHA
         LDA   $FD
         CLC
         ADC   #$0001
         PHA
         _SetRect
         BCS   L07056E
         LDA   #$0000
L07056E  STAL  L020010
         PEA   $0000
         TDC
         CLC
         ADC   #$00E4
         PHA
         _FrameRect
         BCS   L070587
         LDA   #$0000
L070587  STAL  L020010
         TSC
         CLC
         ADC   #$000E
         TCS
         PLD
         RTL

L070593  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDX   L0200B4
         LDA   L0200B2
         CLC
         ADC   #$2800
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         CLC
         ADC   #$0008
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   L020113
         STA   L020111
         PEA   $0010
         PEA   $0000
         PEA   $0080
         PEA   $0040
         PEA   $0004
         LDX   L0200B4
         LDA   L0200B2
         CLC
         ADC   #$0008
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         JSL   L050817
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEA   $0190
         LDX   L020113
         LDA   L020111
         PHX
         PHA
         PEA   $0007
         PEA   $000F
         LDX   L020131
         LDA   L02012F
         PHX
         PHA
         JSL   L050721
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDA   #$0001
         PHA
         LDA   L020149
         SEC
         JSL   L011179
         JSL   L010D58
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L07062C  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDX   #$0000
         LDA   #$0002
         PHX
         PHA
         PHX
         PHA
         _TickCount
         BCS   L07064D
         LDA   #$0000
L07064D  STAL  L020010
         PLA
         PLX
         SEC
         JSL   L010EAF
         PLY
         PLY
         SEC
         SBC   L020092
         PHA
         TXA
         SBC   L020094
         TAX
         PLA
         CLC
         ADC   L02010C
         PHA
         TXA
         ADC   L02010E
         TAX
         PLA
         STX   L020117
         STA   L020115
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L07067E  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDX   L02011B
         LDA   L020119
         STX   L02010E
         STA   L02010C
         LDX   #$0000
         LDA   #$0002
         PHX
         PHA
         PHX
         PHA
         _TickCount
         BCS   L0706AB
         LDA   #$0000
L0706AB  STAL  L020010
         PLA
         PLX
         SEC
         JSL   L010EAF
         PLY
         PLY
         STX   L020094
         STA   L020092
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L0706C6  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E8
         TCS
         LDA   $FF
         PHA
         LDA   #$0003
         SEC
         JSL   L010FAB
         PLA
         CLC
         ADC   #$0001
         LDX   #$0000
         TAY
         BPL   L0706E8
         DEX
L0706E8  PHX
         PHA
         LDA   #L033248
         LDX   #^L033248
         JSL   L010E15
         PLA
         PLX
         STX   $EC
         STA   $EA
         STZ   $EE
L0706FC  LDA   $EE
         LDX   #$0000
         TAY
         BPL   L070705
         DEX
L070705  PHX
         PHA
         LDX   $FD
         LDA   $FB
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00FF
         BEQ   L070720
         INC   $EE
         BRA   L0706FC
L070720  LDA   $EE
         BEQ   L07075B
         DEC   $EE
         LDA   $EE
         LDX   #$0000
         TAY
         BPL   L07072F
         DEX
L07072F  PHX
         PHA
         LDX   $FD
         LDA   $FB
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         LDX   $EC
         LDA   $EA
         LDA   $EA
         BNE   L07074C
         DEC   $EC
L07074C  DEC   $EA
         STA   $F0
         STX   $F2
         PLA
         SEP   #$20
         STA   [$F0]
         REP   #$20
         BRA   L070720
L07075B  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L070763  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         LDA   L0200FE
         BEQ   L070776
         BRL   L070899
L070776  LDA   #$0012
         STA   L0200FE
         PEA   ^L07062C
         PEA   L07062C
         JSL   L0E01B6
         PLY
         PLY
         LDX   L020117
         LDA   L020115
         PHX
         PHA
         LDX   #$0000
         LDA   #$0005
         CLC
         JSL   L010FF0
         PLA
         PLX
         STX   $F2
         STA   $F0
         SEC
         LDA   $F0
         SBC   L02011D
         BNE   L0707B0
         LDA   $F2
         SBC   L02011F
         BRA   L0707B7
L0707B0  LDA   $F2
         SBC   L02011F
         REP   #$02
L0707B7  BEQ   L0707C3
         BCC   L0707C3
         STZ   L020115
         STZ   L020117
         BRA   L0707E7
L0707C3  LDX   #$0000
         LDA   #$0032
         PHX
         PHA
         LDX   L02011F
         LDA   L02011D
         SEC
         SBC   $F0
         PHA
         TXA
         SBC   $F2
         TAX
         PLA
         CLC
         JSL   L010EAF
         PLY
         PLY
         STX   L020117
         STA   L020115
L0707E7  LDX   #$0000
         LDA   #$0E10
         PHX
         PHA
         LDX   L020117
         LDA   L020115
         CLC
         JSL   L010EAF
         PLY
         PLY
         STA   L020121
         LDX   #$0000
         LDA   #$003C
         PHX
         PHA
         LDX   #$0000
         LDA   #$0E10
         PHX
         PHA
         LDX   L020117
         LDA   L020115
         CLC
         JSL   L010EAF
         PLA
         PLX
         CLC
         JSL   L010EAF
         PLY
         PLY
         STA   L020123
         LDA   L020121
         BNE   L070836
         LDA   L020123
         BNE   L070836
         LDA   #$0001
         STA   L0200FC
L070836  PEA   $0009
         PEA   ^L033248
         PEA   L033248
         PEA   ^L03323F
         PEA   L03323F
         JSL   L0B0E24
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $0000
         LDA   L020121
         PHA
         JSL   L0E02A3
         PLY
         PHX
         PHA
         JSL   L0706C6
         PLY
         PLY
         PLY
         PEA   $0001
         LDA   L020123
         PHA
         JSL   L0E02A3
         PLY
         PHX
         PHA
         JSL   L0706C6
         PLY
         PLY
         PLY
         LDA   #$0000
         SEP   #$20
         STAL  L033248+$5
         REP   #$20
         PEA   ^L033248
         PEA   L033248
         PEA   $001F
         PEA   $000B
         JSL   L0509E2
         PLY
         PLY
         PLY
         PLY
         BRA   L07089C
L070899  DEC   L0200FE
L07089C  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L0708A4  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         LDA   #$000F
         SEP   #$20
         STA   L02015F
         REP   #$20
         STZ   L020151
         STZ   L02014D
         STZ   L02013F
         STZ   L020149
         STZ   L02014B
         LDX   #$0000
         LDA   #$0000
         PHA
         TXA
         STAL  L033DEF
         PLA
         STAL  L033DED
         LDA   #L033DED
         LDX   #^L033DED
         STA   $F6
         STX   $F8
         LDX   #$0000
         LDA   #$0000
         LDY   #$000A
         PHA
         TXA
         STA   [$F6],Y
         PLA
         LDY   #$0008
         STA   [$F6],Y
         LDA   #L033DED
         LDX   #^L033DED
         STA   $F6
         STX   $F8
         LDX   #$0000
         LDA   #$0000
         LDY   #$0006
         PHA
         TXA
         STA   [$F6],Y
         PLA
         LDY   #$0004
         STA   [$F6],Y
         LDX   #$0000
         LDA   #$0000
         PHA
         TXA
         STAL  L033DFB
         PLA
         STAL  L033DF9
         LDA   #L033DF9
         LDX   #^L033DF9
         STA   $F6
         STX   $F8
         LDX   #$0000
         LDA   #$0000
         LDY   #$000A
         PHA
         TXA
         STA   [$F6],Y
         PLA
         LDY   #$0008
         STA   [$F6],Y
         LDA   #L033DF9
         LDX   #^L033DF9
         STA   $F6
         STX   $F8
         LDX   #$0000
         LDA   #$0000
         LDY   #$0006
         PHA
         TXA
         STA   [$F6],Y
         PLA
         LDY   #$0004
         STA   [$F6],Y
         LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDA   #$0002
         PHA
         LDA   L020149
         SEC
         JSL   L010E20
         PLY
         LDX   #$0000
         TAY
         BPL   L07097A
         DEX
L07097A  SEC
         JSL   L011152
         LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDA   L02014B
         PHA
         LDA   #$00C8
         SEC
         JSL   L010FAB
         PLA
         LDX   #$0000
         TAY
         BPL   L07099B
         DEX
L07099B  SEC
         JSL   L011152
         LDX   L020129
         LDA   L020127
         JSL   L010E15
         PLA
         PLX
         JSL   L010E15
         PLA
         PLX
         STX   L020131
         STA   L02012F
         JSL   L070593
         PEA   $00C8
         PEA   $0000
         LDX   L0200B4
         LDA   L0200B2
         PHX
         PHA
         PEA   $0000
         PEA   $00E1
         PEA   $2000
         JSL   L1007BF
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDX   L0200B4
         LDA   L0200B2
         PHX
         PHA
         JSL   L0F0371
         PLY
         PLY
         PEA   $000D
         PEA   $00C0
         PEA   $0110
         PEA   $003F
         PEA   $000F
         JSL   L07052A
         PLY
         PLY
         PLY
         PLY
         PLY
         JSL   L0F03BA
         LDAL  L033DE7
         TAX
         LDAL  L033DE5
         PHX
         PHA
         LDX   L0200B4
         LDA   L0200B2
         PHX
         PHA
         PEA   $002C
         PEA   $0006
         PEA   $0008
         JSL   L0F06F8
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         LDAL  L033DE7
         TAX
         LDAL  L033DE5
         PHX
         PHA
         LDX   L0200B4
         LDA   L0200B2
         PHX
         PHA
         PEA   $0030
         PEA   $0104
         PEA   $0009
         JSL   L0F06F8
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PEA   $00C8
         PEA   $0000
         LDX   L020135
         LDA   L020133
         PHX
         PHA
         PEA   $0000
         LDX   L0200B4
         LDA   L0200B2
         PHX
         PHA
         JSL   L1007BF
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         STZ   L0200FE
         STZ   L020119
         STZ   L02011B
         PEA   ^L07067E
         PEA   L07067E
         JSL   L0E01B6
         PLY
         PLY
         JSL   L0905D6
         LDA   #$0001
         STA   L02015B
         STZ   L02015D
         TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L070AA8  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         LDA   #L0327DB
         LDX   #^L0327DB
         STX   $F2
         STA   $F0
L070ABD  LDA   [$F0]
         AND   #$8000
         TAY
         BNE   L070ADE
         LDA   [$F0]
         CMP   $FF
         BNE   L070AD0
         LDA   #$0001
         BRA   L070AE1
L070AD0  LDA   $F0
         CLC
         ADC   #$0002
         STA   $F0
         BCC   L070ADC
         INC   $F2
L070ADC  BRA   L070ABD
L070ADE  LDA   #$0000
L070AE1  TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L070AEB  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         JSL   L100099
         SEP   #$20
         STA   L020110
         REP   #$20
         LDY   #$0008
         LDA   [$FD],Y
         SEC
         SBC   #$0050
         BEQ   L070B13
         BVS   L070B11
         EOR   #$8000
L070B11  BMI   L070B25
L070B13  LDA   #$0001
         STA   L020151
         LDA   #$0009
         SEP   #$20
         STA   L02015F
         REP   #$20
         BRA   L070B45
L070B25  LDY   #$0008
         LDA   [$FD],Y
         SEC
         SBC   #$0C08
         BVS   L070B33
         EOR   #$8000
L070B33  BPL   L070B45
         LDA   #$0001
         STA   L020151
         LDA   #$0005
         SEP   #$20
         STA   L02015F
         REP   #$20
L070B45  LDA   L020100
         SEC
         SBC   #$0096
         BVS   L070B51
         EOR   #$8000
L070B51  BPL   L070BA1
         LDA   L020110
         AND   #$00FF
         BNE   L070BA1
         LDY   #$000A
         LDA   [$FD],Y
         SEC
         SBC   #$00A8
         BEQ   L070BA1
         BVS   L070B6B
         EOR   #$8000
L070B6B  BPL   L070BA1
         LDY   #$0008
         LDA   [$FD],Y
         SEC
         SBC   #$0640
         BVS   L070B7B
         EOR   #$8000
L070B7B  BMI   L070B8F
         LDA   #$0008
         SEP   #$20
         STA   L020110
         REP   #$20
         LDA   #$0002
         BRL   L070BF2
         BRA   L070B9F
L070B8F  LDA   #$0004
         SEP   #$20
         STA   L020110
         REP   #$20
         LDA   #$0008
         BRL   L070BF2
L070B9F  BRA   L070BB1
L070BA1  LDA   L020110
         AND   #$00FF
         BEQ   L070BAE
         STZ   L020100
         BRA   L070BB1
L070BAE  INC   L020100
L070BB1  LDA   L020151
         BEQ   L070BBB
         DEC   L020151
         BRA   L070BC5
L070BBB  LDA   #$000F
         SEP   #$20
         STA   L02015F
         REP   #$20
L070BC5  LDA   L02015F
         AND   #$00FF
         PHA
         LDA   L020110
         AND   #$00FF
         PLX
         STX   $F6
         AND   $F6
         LDX   #$0000
         TAY
         BPL   L070BDE
         DEX
L070BDE  PHX
         PHA
         LDA   #L033BF0
         LDX   #^L033BF0
         JSL   L010E15
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
L070BF2  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L070BFC  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EF
         TCS
         LDA   L020153
         CMP   #$003A
         BEQ   L070C12
         BRL   L070C9C
L070C12  PEI   $FF
         PEI   $FD
         JSL   L0805D1
         PLY
         PLY
         TAY
         BEQ   L070C22
         BRL   L070C9C
L070C22  LDA   L020110
         AND   #$00FF
         AND   #$000E
         SEP   #$20
         STA   $F1
         REP   #$20
         LDA   #$0003
         PHA
         LDA   $F1
         AND   #$00FF
         AND   #$0080
         SEC
         JSL   L011179
         LDA   L02015F
         AND   #$00FF
         PHA
         LDA   $F1
         AND   #$00FF
         PLX
         STX   $F6
         AND   $F6
         LDX   #$0000
         TAY
         BPL   L070C5A
         DEX
L070C5A  PHX
         PHA
         LDA   #L033BF0
         LDX   #^L033BF0
         JSL   L010E15
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         AND   #$00FF
         PLX
         STX   $F6
         CLC
         ADC   $F6
         LDX   #$0000
         TAY
         BPL   L070C7E
         DEX
L070C7E  STX   $F6
         ASL
         ROL   $F6
         LDX   $F6
         PHX
         PHA
         LDA   #L033C97
         LDX   #^L033C97
         JSL   L010E15
         PLA
         PLX
         STA   $F2
         STX   $F4
         LDA   [$F2]
         STA   L020153
L070C9C  TSC
         CLC
         ADC   #$0007
         TCS
         PLD
         RTL

L070CA4  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0003
         PHA
         LDA   L020110
         AND   #$00FF
         AND   #$0080
         SEC
         JSL   L011179
         LDA   $FF
         AND   #$00FF
         PLX
         STX   $F8
         CLC
         ADC   $F8
         LDX   #$0000
         TAY
         BPL   L070CD3
         DEX
L070CD3  STX   $F8
         ASL
         ROL   $F8
         LDX   $F8
         PHX
         PHA
         LDA   #L033C97
         LDX   #^L033C97
         JSL   L010E15
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   L020153
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L070CF9  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00DA
         TCS
         STZ   $DC
         STZ   $F4
         BRL   L070D80
L070D0B  STZ   $F2
         BRA   L070D71
L070D0F  LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDA   $F2
         LDX   #$0000
         TAY
         BPL   L070D20
         DEX
L070D20  SEC
         JSL   L011152
         LDX   #$0000
         LDA   #$0001
         PHX
         PHA
         LDA   $F4
         PHA
         LDA   #$00C8
         SEC
         JSL   L010FAB
         PLA
         LDX   #$0000
         TAY
         BPL   L070D40
         DEX
L070D40  SEC
         JSL   L011152
         LDX   L020129
         LDA   L020127
         JSL   L010E15
         PLA
         PLX
         JSL   L010E15
         PLA
         PLX
         STX   $EE
         STA   $EC
         LDA   [$EC]
         STA   $EA
         LDA   $EA
         XBA
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         STA   $EA
         LDA   $EA
         STA   [$EC]
         INC   $F2
L070D71  LDA   $F2
         SEC
         SBC   #$00C6
         BVS   L070D7C
         EOR   #$8000
L070D7C  BPL   L070D0F
         INC   $F4
L070D80  LDA   $F4
         SEC
         SBC   #$0008
         BVS   L070D8B
         EOR   #$8000
L070D8B  BMI   L070D90
         BRL   L070D0B
L070D90  TSC
         CLC
         ADC   #$0020
         TCS
         PLD
         RTL

