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

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

	 use	TLBOX.E.S
	 use	TLBOX.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
	
*-----------------------

L100000  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00D8
         TCS
         PEA   $0000
         TDC
         CLC
         ADC   #$00E2
         PHA
         _ReadAsciiTime
         BCS   L100020
         LDA   #$0000
L100020  STAL  L020010
         LDA   $F1
         AND   #$00FF
         PHA
         LDA   $F2
         AND   #$00FF
         PHA
         LDA   #$0100
         SEC
         JSL   L010FAB
         LDA   $EF
         AND   #$00FF
         PHA
         LDA   $EE
         AND   #$00FF
         PHA
         LDA   #$0100
         SEC
         JSL   L010FAB
         LDA   $EC
         AND   #$00FF
         PHA
         LDA   $EB
         AND   #$00FF
         PHA
         LDA   #$0100
         SEC
         JSL   L010FAB
         PLA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         PLX
         STX   $FA
         CLC
         ADC   $FA
         LDX   #$0000
         TAY
         BPL   L100086
         DEX
L100086  STX   $DC
         STA   $DA
         LDX   $DC
         LDA   $DA
         STA   L020168
         TSC
         CLC
         ADC   #$0022
         TCS
         PLD
         RTL

L100099  ENT
         LDY   #$0000
         LDX   #$0000
         LDA   L020164
         BEQ   L1000AB
         DEC
         STA   L020164
         BRL   L100119
L1000AB  SEP   #$20
         LDAL  PTRIG
         NOP
         NOP
         NOP
         NOP
         NOP
         NOP
L1000B7  LDAL  PADDL0
         BPL   L1000CC
         INY
         CPY   #$0190
         BPL   L100111
L1000C3  LDAL  PADDL1
         BPL   L1000B7
         INX
         BRA   L1000B7
L1000CC  LDAL  PADDL0
         BPL   L1000D5
         INY
         BRA   L1000C3
L1000D5  LDAL  PADDL1
         BPL   L1000DE
         INX
         BRA   L1000CC
L1000DE  REP   #$20
         LDA   #$0004
         CPY   #$0002
         BMI   L1000F3
         LDA   #$0008
         CPY   #$00E6
         BPL   L1000F3
         LDA   #$0000
L1000F3  STA   L02016A
         LDA   #$0001
         CPX   #$0002
         BMI   L100109
         LDA   #$0002
         CPX   #$00E6
         BPL   L100109
         LDA   #$0000
L100109  ORA   L02016A
         STA   L02016A
         BRA   L10011F
L100111  REP   #$20
         LDA   #$0014
         STA   L020164
L100119  LDA   #$0000
         STA   L02016A
L10011F  LDAL  L0200B6
         TAX
         LDAL  L033E05,X
         AND   #$00FF
         BEQ   L100130
         STA   L02016A
L100130  LDAL  BUTN0
         AND   #$8080
         BEQ   L10013C
         LDA   #$0080
L10013C  ORA   L02016A
         STA   L02016A
         RTL

L100143  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         LDA   #$0001
         STA   $F0
         LDA   #L03406A
         LDX   #^L03406A
         STX   $F4
         STA   $F2
         PEA   $000A	; P16 GET_PREFIX (1)
         PEA   $0000
         TDC
         CLC
         ADC   #$00F0
         PHA
         JSL   L01120A
         LDA   #$0003
         STA   $F0
         PEA   $0009	; P16 SET_PREFIX (3)
         PEA   $0000
         TDC
         CLC
         ADC   #$00F0
         PHA
         JSL   L01120A
         TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L10018A  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
*         LDA   #$8000	; block locked down
	 lda   #%10000000_00001000 ; locked + no special
         STA   $EA
         SEC
         LDA   $FD
         SBC   #$FDE8
         BNE   L1001A9
         LDA   $FF
         SBC   #$0000
         BRA   L1001B0
L1001A9  LDA   $FF
         SBC   #$0000
         REP   #$02
L1001B0  BVS   L1001B5
         EOR   #$8000
L1001B5  BMI   L1001BF
         LDA   $EA
         CLC
         ADC   #$0010
         STA   $EA
L1001BF  PHX
         PHA
         PEI   $FF
         PEI   $FD
         LDA   L02000C
         PHA
         PEI   $EA
         PEA   $0000
         PEA   $0000
         _NewHandle
         BCS   L1001DD
         LDA   #$0000
L1001DD  STAL  L020010
         PLA
         PLX
         STX   $F0
         STA   $EE
         LDA   $EE
         CMP   #$0000
         BNE   L1001FE
         LDA   $F0
         CMP   #$0000
         BNE   L1001FE
         LDA   L020010
         PHA
         JSL   L1009A5
         PLY
L1001FE  LDY   #$0002
         LDA   [$EE],Y
         TAX
         LDA   [$EE]
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PLD
         RTL

L100210  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EC
         TCS
         PHX
         PHA
         PEI   $FF
         PEI   $FD
         _FindHandle
         BCS   L10022D
         LDA   #$0000
L10022D  STAL  L020010
         PLA
         PLX
         STX   $F0
         STA   $EE
L100237  SEC
         LDA   $EE
         SBC   #$0000
         BNE   L100246
         LDA   $F0
         SBC   #$0000
         BRA   L10024D
L100246  LDA   $F0
         SBC   #$0000
         REP   #$02
L10024D  BEQ   L100263
         PEI   $F0
         PEI   $EE
         _DisposeHandle
         BCS   L10025F
         LDA   #$0000
L10025F  STAL  L020010
L100263  LDA   $EE
         CMP   #$0000
         BNE   L10027A
         LDA   $F0
         CMP   #$0000
         BNE   L10027A
         LDA   L020010
         PHA
         JSL   L1009A5
         PLY
L10027A  TSC
         CLC
         ADC   #$000A
         TCS
         PLD
         RTL

L100282  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E4
         TCS
         PEA   $0020
         PEI   $F9
         PEI   $F7
         JSL   L110068
         PLY
         PLY
         PLY
         STA   $EA
         LDA   $EA
         CMP   #$FFFF
         BEQ   L1002CA
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $EA
         JSL   L1100BA
         PLY
         PLY
         PLY
         PLY
         STA   $E8
         LDA   $E8
         LDX   #$0000
         STX   L02016E
         STA   L02016C
         PEI   $EA
         JSL   L110110
         PLY
L1002C8  BRA   L1002D6
L1002CA  STZ   $E8
         PEI   $F9
         PEI   $F7
         JSL   L1009C7
         PLY
         PLY
L1002D6  LDA   $E8
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PLD
         RTL

L1002E2  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00DC
         TCS
L1002ED  PEA   $0020
         PEI   $FF
         PEI   $FD
         JSL   L110068
         PLY
         PLY
         PLY
         STA   $DE
         LDA   $DE
         AND   #$8000
         TAY
         BEQ   L100312
         PEI   $FF
         PEI   $FD
         JSL   L1009C7
         PLY
         PLY
         BRL   L1003F4
L100312  PEI   $DE
         JSL   L110137
         PLY
         STX   $F0
         STA   $EE
         PEI   $F0
         PEI   $EE
         JSL   L10018A
         PLY
         PLY
         STX   $EC
         STA   $EA
         STX   $E8
         STA   $E6
         LDX   $F0
         LDA   $EE
         STX   L02016E
         STA   L02016C
L100339  SEC
         LDA   $EE
         SBC   #$FFFF
         BNE   L100348
         LDA   $F0
         SBC   #$0000
         BRA   L10034F
L100348  LDA   $F0
         SBC   #$0000
         REP   #$02
L10034F  BEQ   L1003B8
         BVS   L100356
         EOR   #$8000
L100356  BPL   L1003B8
         PEA   $FFFF
         PEI   $E8
         PEI   $E6
         PEI   $DE
         JSL   L1100BA
         PLY
         PLY
         PLY
         PLY
         STA   $E4
         LDA   $E4
         CMP   #$FFFF
         BEQ   L100390
         PEI   $FF
         PEI   $FD
         JSL   L100A31
         PLY
         PLY
         PEI   $EC
         PEI   $EA
         JSL   L100210
         PLY
         PLY
         STZ   $EA
         STZ   $EC
         STZ   $EE
         STZ   $F0
         BRA   L1003B6
L100390  LDX   $F0
         LDA   $EE
         SEC
         SBC   #$FFFF
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         STX   $F0
         STA   $EE
         LDX   $E8
         LDA   $E6
         CLC
         ADC   #$FFFF
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $E8
         STA   $E6
L1003B6  BRA   L100339
L1003B8  LDX   $F0
L1003BA  LDA   $EE
         PHA
         PEI   $E8
         PEI   $E6
         PEI   $DE
         JSL   L1100BA
         PLY
         PLY
         PLY
         PLY
         STA   $E4
         PEI   $DE
         JSL   L110110
         PLY
         LDX   $F0
         LDA   $EE
         CMP   $E4
         BEQ   L1003F4
         PEI   $FF
         PEI   $FD
         JSL   L100A31
         PLY
         PLY
         PEI   $EC
         PEI   $EA
         JSL   L100210
         PLY
         PLY
         STZ   $EA
         STZ   $EC
L1003F4  LDA   $EA
         CMP   #$0000
         BNE   L100400
         LDA   $EC
         CMP   #$0000
L100400  SEC
         LDA   $EA
         SBC   #$0000
         BNE   L10040F
         LDA   $EC
         SBC   #$0000
         BRA   L100416
L10040F  LDA   $EC
         SBC   #$0000
         REP   #$02
L100416  BNE   L10041B
         BRL   L1002ED
L10041B  LDX   $EC
         LDA   $EA
         TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PLD
         RTL

L100429  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00D0
         TCS
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00D2
         PHA
         _GetColorTable
         BCS   L10044C
         LDA   #$0000
L10044C  STAL  L020010
L100450  STZ   $F4
         STZ   $F2
         BRL   L100534
L100457  LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D2
         JSL   L010E15
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$0F00
         TAY
         BEQ   L1004A0
         LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D2
         JSL   L010E15
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEC
         SBC   #$0100
         STA   [$F6]
         LDA   #$FFFF
         STA   $F4
L1004A0  LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D2
         JSL   L010E15
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00F0
         TAY
         BEQ   L1004E9
         LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D2
         JSL   L010E15
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEC
         SBC   #$0010
         STA   [$F6]
         LDA   #$FFFF
         STA   $F4
L1004E9  LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D2
         JSL   L010E15
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$000F
         TAY
         BEQ   L100532
         LDA   $F2
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D2
         JSL   L010E15
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         SEC
         SBC   #$0001
         STA   [$F6]
         LDA   #$FFFF
         STA   $F4
L100532  INC   $F2
L100534  LDA   $F2
         CMP   #$0010
         BEQ   L10053E
         BRL   L100457
L10053E  JSL   L10082B
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00D2
         PHA
         _SetColorTable
         BCS   L10055A
         LDA   #$0000
L10055A  STAL  L020010
         LDA   $F4
         BEQ   L100565
         BRL   L100450
L100565  TSC
         CLC
         ADC   #$002A
         TCS
         PLD
         RTL

L10056D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00C8
         TCS
         STZ   $EC
         BRA   L10059D
L10057C  LDA   $EC
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00CA
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0000
         STA   [$F0]
         INC   $EC
L10059D  LDA   $EC
         CMP   #$0010
         BNE   L10057C
         STZ   $EA
L1005A6  STZ   $EE
         STZ   $EC
         BRL   L100702
L1005AD  LDA   $EC
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00CA
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$0F00
         PHA
         LDA   $EC
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDX   $FD
         LDA   $FB
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$0F00
         PLX
         STX   $F0
         CMP   $F0
         BEQ   L10061E
         BCC   L10061E
         LDA   $EC
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00CA
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         CLC
         ADC   #$0100
         STA   [$F0]
         LDA   #$FFFF
         STA   $EE
L10061E  LDA   $EC
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00CA
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00F0
         PHA
         LDA   $EC
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDX   $FD
         LDA   $FB
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$00F0
         PLX
         STX   $F0
         CMP   $F0
         BEQ   L10068F
         BCC   L10068F
         LDA   $EC
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00CA
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         CLC
         ADC   #$0010
         STA   [$F0]
         LDA   #$FFFF
         STA   $EE
L10068F  LDA   $EC
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00CA
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$000F
         PHA
         LDA   $EC
         LDX   #$0000
         STX   $F4
         ASL
         ROL   $F4
         LDX   $F4
         PHX
         PHA
         LDX   $FD
         LDA   $FB
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         AND   #$000F
         PLX
         STX   $F0
         CMP   $F0
         BEQ   L100700
         BCC   L100700
         LDA   $EC
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00CA
         JSL   L010E15
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   [$F0]
         CLC
         ADC   #$0001
         STA   [$F0]
         LDA   #$FFFF
         STA   $EE
L100700  INC   $EC
L100702  LDA   $EC
         CMP   #$0010
         BEQ   L10070C
         BRL   L1005AD
L10070C  INC   $EA
         JSL   L10082B
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00CA
         PHA
         _SetColorTable
         BCS   L10072A
         LDA   #$0000
L10072A  STAL  L020010
         LDA   $EE
         BEQ   L100735
         BRL   L1005A6
L100735  TSC
         CLC
         ADC   #$002C
         TCS
         PLD
         RTL

L10073D  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00D2
         TCS
         STZ   $D4
         BRA   L10076D
L10074C  LDA   $D4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D6
         JSL   L010E15
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         STA   [$F6]
         INC   $D4
L10076D  LDA   $D4
         CMP   #$0010
         BNE   L10074C
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00D6
         PHA
         _SetColorTable
         BCS   L10078C
         LDA   #$0000
L10078C  STAL  L020010
         TSC
         CLC
         ADC   #$0028
         TCS
         PLD
         RTL

L100798  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         PEA   $00C8
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         JSL   L100839
         PLY
         PLY
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L1007BF  ENT
         PHD
         TSC
         SEC
         SBC   #$00ED
         TCD
         ADC   #$00E6
         TCS
         PEI   $FF
         LDA   $FD
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L033ED8
         LDX   #^L033ED8
         JSL   L010E15
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         LDX   #$0000
         PHX
         PHA
         LDX   $FB
         LDA   $F9
         JSL   L010E15
         LDA   $F7
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L033ED8
         LDX   #^L033ED8
         JSL   L010E15
         PLA
         PLX
         STA   $E8
         STX   $EA
         LDA   [$E8]
         LDX   #$0000
         PHX
         PHA
         LDX   $F5
         LDA   $F3
         JSL   L010E15
         JSL   L100839
         PLY
         PLY
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L10082B  LDA   #$0000
         STAL  L020000
L100832  LDAL  L020000
         BEQ   L100832
         RTL

L100839  PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E8
         TCS
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L033ED8
         LDX   #^L033ED8
         JSL   L010E15
         PLA
         PLX
         STA   $EC
         STX   $EE
         LDA   [$EC]
         STA   $FF
         PHB
         PHK
         PLB
         PER   L10087B+1
         PLA
         STA   $EA
         SEP   #$20
         LDA   $F9
         XBA
         LDA   $FD
         REP   #$20
         STA   ($EA)
         LDX   $F7
         LDY   $FB
         LDA   $FF
         DEC
L10087B  MVN   $010000,$000000
         PLB
         TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L100887  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E3
         TCS
         LDX   $FD
         LDA   $FB
         STX   $E7
         STA   $E5
         CLC
         LDA   $FB
         ADC   $FF
         STA   $FF
         LDY   $F7
         LDX   $FB
         SEP   #$20
L1008A7  CPX   $FF
         BEQ   L1008E3
         LDA   [$F7]
         BEQ   L1008E3
         BPL   L1008CA
         STA   $E9
         INY
         STY   $F7
L1008B6  LDA   [$F7]
         INY
         STY   $F7
         STA   [$FB]
         INX
         CPX   $FF
         BEQ   L1008E3
         STX   $FB
         INC   $E9
         BNE   L1008B6
         BRA   L1008A7
L1008CA  INY
         STY   $F7
         STA   $E9
         LDA   [$F7]
         INY
         STY   $F7
L1008D4  STA   [$FB]
         INX
         CPX   $FF
         BEQ   L1008E3
         STX   $FB
         DEC   $E9
         BNE   L1008D4
         BRA   L1008A7
L1008E3  REP   #$20
         LDX   $E7
         LDA   $E5
         TAY
         TSC
         CLC
         ADC   #$000D
         TCS
         TYA
         PLD
         RTL

L1008F3  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00E7
         TCS
         PEI   $FF
         PEI   $FD
         PEI   $FB
         LDX   $F9
         LDA   $F7
         CLC
         ADC   #$0020
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         JSL   L100887
         PLY
         PLY
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0009
         TCS
         PLD
         RTL

L100926  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDX   L020166
         CPX   #$FFFF
         BEQ   L100947
         SEP   #$20
         LDAL  $E19D00,X
         AND   #$BF
         STAL  $E19D00,X
         REP   #$20
L100947  LDX   $FF
         CPX   #$FFFF
         BEQ   L10095C
         SEP   #$20
         LDAL  $E19D00,X
         ORA   #$40
         STAL  $E19D00,X
         REP   #$20
L10095C  LDA   $FF
         STA   L020166
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L100969  ENT
         LDAL  L020002
L10096D  CMPL  L020002
         BEQ   L10096D
         RTL

L100974  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         PEI   $FF
         PEI   $FD
         PEI   $FB
         JSL   L110000
         PLY
         PLY
         PHX
         PHA
         _SysFailMgr
         BCS   L100999
         LDA   #$0000
L100999  STAL  L020010
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L1009A5  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         PEI   $FF
         PEA   ^L033E87
         PEA   L033E87
         JSL   L100974
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L1009C7  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$008C
         TCS
         PEA   ^L033EA9
         PEA   L033EA9
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L011248
         PLY
         PLY
         PLY
         PLY
         PEI   $FF
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L01119D
         PLY
         PLY
         PLY
         PLY
         PEA   ^L033EB0
         PEA   L033EB0
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L01119D
         PLY
         PLY
         PLY
         PLY
         LDA   L020010
         PHA
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L100974
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$006A
         TCS
         PLD
         RTL

L100A31  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$008C
         TCS
         PEA   ^L033EBD
         PEA   L033EBD
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L011248
         PLY
         PLY
         PLY
         PLY
         PEI   $FF
         PEI   $FD
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L01119D
         PLY
         PLY
         PLY
         PLY
         PEA   ^L033ECF
         PEA   L033ECF
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L01119D
         PLY
         PLY
         PLY
         PLY
         PEA   $FFFF
         PEA   $0000
         TDC
         CLC
         ADC   #$008E
         PHA
         JSL   L100974
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$006A
         TCS
         PLD
         RTL

