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

         mx	%00
	rel
	dsk	GSTHINGS.L
	lst	off

	use	GSTHINGS.X

	use	4/Event.Macs
	use	4/Locator.Macs
	use	4/Mem.Macs
	use	4/Misc.Macs
	use	4/Qd.Macs
	use	4/SANE.Macs
	use	4/Sch.Macs
	use	4/Util.Macs
	
L080000  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00C8
         TCS
         LDA   $F9
         CMP   #$0000
         BNE   L08002A
         LDA   $FB
         CMP   #$0000
         BNE   L08002A
         LDA   #$0001
         STA   $E0
         LDX   L030130
         LDA   L03012E
         STX   $FB
         STA   $F9
         BRA   L08002C
L08002A  STZ   $E0
L08002C  LDA   [$F5]
         STA   $E8
         LDX   $F7
         LDA   $F5
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $F7
         STA   $F5
         LDA   $E8
         STA   $E4
         LDA   #$0002
         PHA
         LDA   $E8
         CLC
         JSL   L021F1A
         PLY
         STA   $D8
         LDA   [$F5]
         STA   $E6
         INC   $F5
         BNE   L08005F
         INC   $F7
L08005F  LDA   $E6
         STA   $E2
         LDA   $E6
         PHA
         LDA   $E8
         CLC
         JSL   L0220A5
         PLA
         STA   $DE
         SEP   #$30
         STZ   $CA
L080074  REP   #$30
         INC   $F5
         BNE   L08007C
         INC   $F7
L08007C  SEP   #$30
         LDA   [$F5]
         BMI   L0800C4
         PHA
         AND   #$0F
         STA   $CB
         PLA
         AND   #$70
         TAX
         LDAL  L051BD9,X
         TAY
L080090  BIT   $CA
         BMI   L08009E
         LDX   $CB
         LDAL  L051BD9,X
         STA   [$F9]
         BRA   L0800AE
L08009E  LDA   $CB
         ORA   [$F9]
         STA   [$F9]
         INC   $F9
         BNE   L0800AE
         INC   $FA
         BNE   L0800AE
         INC   $FB
L0800AE  LDA   $CA
         EOR   #$80
         STA   $CA
         REP   #$30
         DEC   $DE
         SEP   #$30
         BNE   L0800BF
         BRL   L0803AC
L0800BF  DEY
         BPL   L080090
         BRA   L080074
L0800C4  PHA
         BIT   #$40
         PHP
         REP   #$30
         INC   $F5
         BNE   L0800D0
         INC   $F7
L0800D0  SEP   #$30
         LDA   [$F5]
         STA   $DA
         STZ   $DB
         PLP
         BEQ   L0800EB
         STA   $DB
         REP   #$30
         INC   $F5
         BNE   L0800E5
         INC   $F7
L0800E5  SEP   #$30
         LDA   [$F5]
         STA   $DA
L0800EB  REP   #$30
         INC   $DA
         SEP   #$30
         PLA
         PHA
         AND   #$30
         BEQ   L080109
         CMP   #$10
         BNE   L0800FE
         BRL   L0801AE
L0800FE  CMP   #$30
         BNE   L080105
         BRL   L0802D3
L080105  PLA
         BRL   L080074
L080109  PLA
         AND   #$0F
         STA   $CB
         TAX
         LDAL  L051BD9,X
         ORA   $CB
         STA   $DC
         STA   $DD
         BIT   $CA
         BPL   L08013E
         LDA   $CB
         ORA   [$F9]
         STA   [$F9]
         INC   $F9
         BNE   L08012D
         INC   $FA
         BNE   L08012D
         INC   $FB
L08012D  LDA   $CA
         EOR   #$80
         STA   $CA
         REP   #$30
         DEC   $DE
         BNE   L08013C
         BRL   L0803AC
L08013C  DEC   $DA
L08013E  REP   #$30
         STZ   $E8
         LDA   $DA
         LSR
         ROR   $E8
         LSR
         ROR   $E8
         CMP   #$0000
         BEQ   L080166
         TAX
         LDA   $DC
         LDY   #$0000
L080155  STA   [$F9],Y
         INY
         INY
         DEX
         BNE   L080155
         CLC
         TYA
         ADC   $F9
         STA   $F9
         BCC   L080166
         INC   $FB
L080166  SEP   #$30
         BIT   $E9
         BPL   L08017A
         LDA   $DC
         STA   [$F9]
         REP   #$30
         INC   $F9
         BNE   L080178
         INC   $FB
L080178  SEP   #$30
L08017A  BIT   $E9
         BVC   L08019B
         LDX   $CB
         LDAL  L051BD9,X
         STA   [$F9]
         LDA   $CA
         EOR   #$80
         STA   $CA
         REP   #$30
         DEC   $DE
         SEP   #$30
         BNE   L080197
         BRL   L0803AC
L080197  REP   #$30
         DEC   $DA
L08019B  REP   #$30
         SEC
         LDA   $DE
         SBC   $DA
         STA   $DE
         SEP   #$30
         BEQ   L0801AB
         BRL   L080074
L0801AB  BRL   L0803AC
L0801AE  PLA
         AND   #$0F
         STA   $CB
         LDA   $DA
         AND   #$01
         BEQ   L0801EC
         BIT   $CA
         BMI   L0801C7
         LDX   $CB
         LDAL  L051BD9,X
         STA   [$F9]
         BRA   L0801D7
L0801C7  LDA   $CB
         ORA   [$F9]
         STA   [$F9]
         INC   $F9
         BNE   L0801D7
         INC   $FA
         BNE   L0801D7
         INC   $FB
L0801D7  LDA   $CA
         EOR   #$80
         STA   $CA
         REP   #$30
         DEC   $DE
         SEP   #$30
         BNE   L0801E8
         BRL   L0803AC
L0801E8  REP   #$30
         DEC   $DA
L0801EC  REP   #$30
         LDA   $DA
         LSR
         STA   $E8
         SEP   #$30
         BIT   $CA
         BMI   L08024F
         REP   #$30
         LSR
         PHP
         BEQ   L080227
         TAX
         LDY   #$0000
         INC   $F5
         BNE   L080209
         INC   $F7
L080209  LDA   [$F5],Y
         STA   [$F9],Y
         INY
         INY
         DEX
         BNE   L080209
         CLC
         TYA
         ADC   $F9
         STA   $F9
         BCC   L08021C
         INC   $FB
L08021C  DEY
         CLC
         TYA
         ADC   $F5
         STA   $F5
         BCC   L080227
         INC   $F7
L080227  PLP
         BCC   L08023E
         INC   $F5
         BNE   L080230
         INC   $F7
L080230  SEP   #$30
         LDA   [$F5]
         STA   [$F9]
         REP   #$30
         INC   $F9
         BNE   L08023E
         INC   $FB
L08023E  SEC
         LDA   $DE
         SBC   $DA
         STA   $DE
         SEP   #$30
         BEQ   L08024C
         BRL   L080074
L08024C  BRL   L0803AC
L08024F  REP   #$30
         INC   $F5
         BNE   L080257
         INC   $F7
L080257  SEP   #$30
         LDA   [$F5]
         TAX
         XBA
         LDAL  L051BD9,X
         AND   #$0F
         STA   $CB
         BIT   $CA
         BMI   L080273
         LDX   $CB
         LDAL  L051BD9,X
         STA   [$F9]
         BRA   L080283
L080273  LDA   $CB
         ORA   [$F9]
         STA   [$F9]
         INC   $F9
         BNE   L080283
         INC   $FA
         BNE   L080283
         INC   $FB
L080283  LDA   $CA
         EOR   #$80
         STA   $CA
         REP   #$30
         DEC   $DE
         SEP   #$30
         BNE   L080294
         BRL   L0803AC
L080294  XBA
         AND   #$0F
         STA   $CB
         BIT   $CA
         BMI   L0802A7
         LDX   $CB
         LDAL  L051BD9,X
         STA   [$F9]
         BRA   L0802B7
L0802A7  LDA   $CB
         ORA   [$F9]
         STA   [$F9]
         INC   $F9
         BNE   L0802B7
         INC   $FA
         BNE   L0802B7
         INC   $FB
L0802B7  LDA   $CA
         EOR   #$80
         STA   $CA
         REP   #$30
         DEC   $DE
         SEP   #$30
         BNE   L0802C8
         BRL   L0803AC
L0802C8  REP   #$30
         DEC   $E8
         BNE   L08024F
         SEP   #$30
         BRL   L080074
L0802D3  PLA
         AND   #$0F
         STA   $DC
         REP   #$30
         SEC
         LDA   $F9
         SBC   $D8
         STA   $D4
         LDA   $FB
         BCS   L0802E6
         DEC
L0802E6  STA   $D6
         SEP   #$30
         BIT   $CA
         BPL   L08031F
         LDA   [$D4]
         AND   #$0F
         ORA   [$F9]
         STA   [$F9]
         INC   $F9
         BNE   L080300
         INC   $FA
         BNE   L080300
         INC   $FB
L080300  LDA   $CA
         EOR   #$80
         STA   $CA
         REP   #$30
         DEC   $DE
         BNE   L08030F
         BRL   L0803AC
L08030F  DEC   $DA
         SEP   #$30
         BEQ   L080379
         INC   $D4
         BNE   L08031F
         INC   $D5
         BNE   L08031F
         INC   $D6
L08031F  REP   #$30
         STZ   $E8
         LDA   $DA
         LSR
         ROR   $E8
         LSR
         ROR   $E8
         TAX
         LDY   #$0000
         CMP   #$0000
         BEQ   L08033D
L080334  LDA   [$D4],Y
         STA   [$F9],Y
         INY
         INY
         DEX
         BNE   L080334
L08033D  BIT   $E8
         BPL   L08034A
         SEP   #$20
         LDA   [$D4],Y
         STA   [$F9],Y
         INY
         REP   #$30
L08034A  CLC
         TYA
         ADC   $F9
         STA   $F9
         BCC   L080354
         INC   $FB
L080354  CLC
         TYA
         ADC   $D4
         STA   $D4
         BCC   L08035E
         INC   $D6
L08035E  BIT   $E8
         BVC   L080370
         SEP   #$30
         LDA   [$D4]
         AND   #$F0
         STA   [$F9]
         LDA   #$80
         STA   $CA
         REP   #$30
L080370  SEC
         LDA   $DE
         SBC   $DA
         STA   $DE
         SEP   #$30
L080379  LDA   $DC
         STA   $CB
         BIT   $CA
         BMI   L08038B
         LDX   $CB
         LDAL  L051BD9,X
         STA   [$F9]
         BRA   L08039B
L08038B  LDA   $CB
         ORA   [$F9]
         STA   [$F9]
         INC   $F9
         BNE   L08039B
         INC   $FA
         BNE   L08039B
         INC   $FB
L08039B  LDA   $CA
         EOR   #$80
         STA   $CA
         REP   #$30
         DEC   $DE
         SEP   #$30
         BEQ   L0803AC
         BRL   L080074
L0803AC  REP   #$30
         LDA   $E0
         BEQ   L080419
         LDA   L03012C
         STA   $E0
         STZ   L03012C
         LDA   $FD
         STA   $CC
         LDA   $FF
         STA   $D0
         LDA   $CC
         CLC
         ADC   $E4
         SEC
         SBC   #$0001
         STA   $CE
         LDA   $D0
         CLC
         ADC   $E2
         SEC
         SBC   #$0001
         STA   $D2
         PEA   $FFFF
         PEA   $00A0
         LDA   #$0002
         PHA
         LDA   $E4
         CLC
         JSL   L021F1A
         PLY
         PHA
         PEA   $0000
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00CC
         PHA
         PEA   $0000
         PEA   $0000
         LDX   L030130
         LDA   L03012E
         PHX
         PHA
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         LDA   $E0
         STA   L03012C
L080419  TSC
         CLC
         ADC   #$0026
         TCS
         PLD
         RTL

L080421  ENT
         PHD
         TSC
         SEC
         SBC   #$00E7
         TCD
         ADC   #$0095
         TCS
         SEP   #$30
         LDY   #$0F
L080430  LDA   [$FD],Y
         TAX
         LDAL  L051BD9,X
         TYX
         STA   $97,X
         DEY
         BPL   L080430
         REP   #$30
         LDA   $F5
         CMP   $F9
         BNE   L0804A6
         LDA   $F7
         CMP   $FB
         BNE   L0804A6
         LDA   $FB
         PHA
         LDA   $F9
         CLC
         JSL   L0220A5
         PLA
         CLC
         ADC   #$0001
         STA   $BA
         SEP   #$20
         STZ   $A7
         REP   #$20
L080462  DEC   $BA
         BEQ   L0804A1
         SEP   #$30
         LDA   [$ED]
         LDX   $A7
         BMI   L08047E
         AND   #$F0
         TAX
         LDAL  L051BD9,X
         TAX
         LDA   [$F1]
         AND   #$0F
         ORA   $97,X
         BRA   L080487
L08047E  AND   #$0F
         TAY
         LDA   [$F1]
         AND   #$F0
         ORA   [$FD],Y
L080487  STA   [$F1]
         LDA   $A7
         EOR   #$80
         STA   $A7
         REP   #$30
         BMI   L080462
         INC   $F1
         BNE   L080499
         INC   $F3
L080499  INC   $ED
         BNE   L080462
         INC   $EF
         BRA   L080462
L0804A1  REP   #$30
         BRL   L0807B4
L0804A6  LDA   $F9
         CLC
         ADC   #$000F
         AND   #$FFF0
         LSR
         LDX   #$0000
         STX   $C8
         STA   $C6
         LDA   $FB
         LDX   #$0000
         PHX
         PHA
         LDX   $C8
         LDA   $C6
         SEC
         JSL   L0220EA
         PLA
         PLX
         STX   $C4
         STA   $C2
         LDX   $C4
         LDA   $C2
         CLC
         ADC   $F1
         PHA
         TXA
         ADC   $F3
         TAX
         PLA
         STX   $C0
         STA   $BE
         LDA   $F5
         CLC
         ADC   #$0001
         LSR
         STA   $BC
         LDX   #$0000
         LDA   #$0006
         PHX
         PHA
         LDA   $F9
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         LDA   #$000A
         PHX
         PHA
         LDA   $F5
         LDX   #$0000
         SEC
         JSL   L0222B8
         PLA
         PLX
         SEC
         JSL   L021FA9
         PLY
         PLY
         SEC
         JSL   L0222B8
         PLA
         PLX
         STX   $E0
         STA   $DE
         LDX   #$0000
         LDA   #$0006
         PHX
         PHA
         LDA   $FB
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         LDA   #$000A
         PHX
         PHA
         LDA   $F7
         LDX   #$0000
         SEC
         JSL   L0222B8
         PLA
         PLX
         SEC
         JSL   L021FA9
         PLY
         PLY
         SEC
         JSL   L0222B8
         PLA
         PLX
         STX   $DC
         STA   $DA
         LDA   #$0000
         SEP   #$20
         STA   $A7
         REP   #$20
         SEP   #$20
         STA   $A8
         REP   #$20
         LDX   #$0000
         LDA   #$0000
         STX   $D4
         STA   $D2
         STX   $D8
         STA   $D6
         INC   $FB
         INC   $F9
         LDA   $F9
         STA   $BA
         LDA   #L05822A
         LDX   #^L05822A
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L022171
         BEQ   L08058B
         BRL   L0806A0
L08058B  DEC   $FB
         BNE   L080592
         BRL   L08069B
L080592  LDA   $ED
         STA   $AD
         LDA   $EF
         STA   $AF
         LDA   $F1
         STA   $A9
         LDA   $F3
         STA   $AB
L0805A2  DEC   $BA
         BNE   L0805A9
         BRL   L08062A
L0805A9  SEP   #$30
         LDA   [$ED]
         TAX
         LDA   $A8
         EOR   $A7
         BEQ   L0805BA
         LDAL  L051BD9,X
         BRA   L0805BB
L0805BA  TXA
L0805BB  LDX   $A7
         BMI   L0805C9
         AND   #$F0
         STA   $B1
         LDA   [$F1]
         AND   #$0F
         BRA   L0805D1
L0805C9  AND   #$0F
         STA   $B1
         LDA   [$F1]
         AND   #$F0
L0805D1  ORA   $B1
         STA   [$F1]
         LDA   $A7
         EOR   #$80
         STA   $A7
         REP   #$30
         BMI   L0805E5
         INC   $F1
         BNE   L0805E5
         INC   $F3
L0805E5  CLC
         LDA   $D6
         ADC   $DE
         STA   $CE
         LDA   $D8
         ADC   $E0
         STA   $D0
         SEC
         SBC   $D8
         PHA
         LDX   $CE
         STX   $D6
         LDX   $D0
         STX   $D8
         PLA
         BNE   L080604
         BRL   L0806FF
L080604  LSR
         PHP
         CLC
         ADC   $ED
         STA   $ED
         BCC   L08060F
         INC   $EF
L08060F  PLP
         BCC   L0805A2
         SEP   #$30
         LDA   $A8
         EOR   #$80
         STA   $A8
         REP   #$30
         BMI   L0805A2
         INC   $ED
         BEQ   L080625
         BRL   L0805A2
L080625  INC   $EF
         BRL   L0805A2
L08062A  REP   #$30
         CLC
         LDA   $D2
         ADC   $DA
         STA   $CA
         LDA   $D4
         ADC   $DC
         STA   $CC
         SEC
         SBC   $D4
         PHA
         LDX   $CA
         STX   $D2
         LDX   $CC
         STX   $D4
         PLA
         BEQ   L08062A
         STA   $B6
         LDA   $BC
         STA   $B4
         LDA   #$0000
         STA   $ED
         STA   $EF
         LDX   #$0010
         LDA   #$0000
L08065B  ASL
         ROL   $EF
         ASL   $B6
         BCC   L080669
         CLC
         ADC   $B4
         BCC   L080669
         INC   $EF
L080669  DEX
         BNE   L08065B
         STA   $ED
         CLC
         LDA   $ED
         ADC   $AD
         STA   $ED
         LDA   $EF
         ADC   $AF
         STA   $EF
         CLC
         LDA   $A9
         ADC   $C6
         STA   $F1
         LDA   $AB
         ADC   $C8
         STA   $F3
         SEP   #$30
         STZ   $A8
         STZ   $A7
         REP   #$30
         STZ   $D6
         STZ   $D8
         LDA   $F9
         STA   $BA
         BRL   L08058B
L08069B  REP   #$30
         BRL   L0807B4
L0806A0  DEC   $FB
         BNE   L0806A7
         BRL   L0807B2
L0806A7  LDA   $ED
         STA   $AD
         LDA   $EF
         STA   $AF
         LDA   $F1
         STA   $A9
         LDA   $F3
         STA   $AB
L0806B7  DEC   $BA
         BNE   L0806BE
         BRL   L080741
L0806BE  SEP   #$30
         LDA   [$ED]
         TAX
         LDA   $A8
         EOR   $A7
         BEQ   L0806CF
         LDAL  L051BD9,X
         BRA   L0806D0
L0806CF  TXA
L0806D0  LDX   $A7
         BMI   L0806E4
         AND   #$F0
         TAX
         LDAL  L051BD9,X
         TAX
         LDA   [$F1]
         AND   #$0F
         ORA   $97,X
         BRA   L0806ED
L0806E4  AND   #$0F
         TAY
         LDA   [$F1]
         AND   #$F0
         ORA   [$FD],Y
L0806ED  STA   [$F1]
         LDA   $A7
         EOR   #$80
         STA   $A7
         REP   #$30
         BMI   L0806FF
         INC   $F1
         BNE   L0806FF
         INC   $F3
L0806FF  CLC
         LDA   $D6
         ADC   $DE
         STA   $CE
         LDA   $D8
         ADC   $E0
         STA   $D0
         SEC
         SBC   $D8
         PHA
         LDX   $CE
         STX   $D6
         LDX   $D0
         STX   $D8
         PLA
         BEQ   L0806FF
         LSR
         PHP
         CLC
         ADC   $ED
         STA   $ED
         BCC   L080726
         INC   $EF
L080726  PLP
         BCC   L0806B7
         SEP   #$30
         LDA   $A8
         EOR   #$80
         STA   $A8
         REP   #$30
         BMI   L0806B7
         INC   $ED
         BEQ   L08073C
         BRL   L0806B7
L08073C  INC   $EF
         BRL   L0806B7
L080741  REP   #$30
         CLC
         LDA   $D2
         ADC   $DA
         STA   $CA
         LDA   $D4
         ADC   $DC
         STA   $CC
         SEC
         SBC   $D4
         PHA
         LDX   $CA
         STX   $D2
         LDX   $CC
         STX   $D4
         PLA
         BEQ   L080741
         STA   $B6
         LDA   $BC
         STA   $B4
         LDA   #$0000
         STA   $ED
         STA   $EF
         LDX   #$0010
         LDA   #$0000
L080772  ASL
         ROL   $EF
         ASL   $B6
         BCC   L080780
         CLC
         ADC   $B4
         BCC   L080780
         INC   $EF
L080780  DEX
         BNE   L080772
         STA   $ED
         CLC
         LDA   $ED
         ADC   $AD
         STA   $ED
         LDA   $EF
         ADC   $AF
         STA   $EF
         CLC
         LDA   $A9
         ADC   $C6
         STA   $F1
         LDA   $AB
         ADC   $C8
         STA   $F3
         SEP   #$30
         STZ   $A8
         STZ   $A7
         REP   #$30
         STZ   $D6
         STZ   $D8
         LDA   $F9
         STA   $BA
         BRL   L0806A0
L0807B2  REP   #$30
L0807B4  TAY
         TSC
         CLC
         ADC   #$0051
         TCS
         TYA
         PLD
         RTL

L0807BE  ENT
         PHD
         TSC
         SEC
         SBC   #$00E5
         TCD
         ADC   #$00C4
         TCS
         LDA   $EF
         CMP   #$0000
         BNE   L0807E1
         LDA   $F1
         CMP   #$0000
         BNE   L0807E1
         LDX   L03002A
         LDA   L030028
         STX   $F1
         STA   $EF
L0807E1  LDA   L03012C
         CMP   #$0001
         BNE   L080810
         LDA   [$F3]
         AND   #$00FF
         STA   $D4
         LDY   #$0001
         LDA   [$F3],Y
         AND   #$00FF
         STA   $D2
         LDY   #$0003
         LDA   [$F3],Y
         AND   #$00FF
         STA   $CE
         LDY   #$0002
         LDA   [$F3],Y
         AND   #$00FF
         STA   $D0
         BRA   L080829
L080810  LDA   [$F3]
         STA   $D4
         LDY   #$0002
         LDA   [$F3],Y
         STA   $D2
         LDY   #$0006
         LDA   [$F3],Y
         STA   $CE
         LDY   #$0004
         LDA   [$F3],Y
         STA   $D0
L080829  LDA   $F7
         LSR
         PHA
         LDA   $F9
         PHA
         LDA   $FB
         CLC
         JSL   L0220A5
         PLA
         PLX
         STX   $E4
         CLC
         ADC   $E4
         LDX   #$0000
         PHX
         PHA
         LDX   $ED
         LDA   $EB
         JSL   L021F00
         PLA
         PLX
         STX   $ED
         STA   $EB
         LDA   $D4
         LSR
         PHA
         LDA   $D0
         PHA
         LDA   $FD
         CLC
         JSL   L0220A5
         PLA
         PLX
         STX   $E4
         CLC
         ADC   $E4
         LDX   #$0000
         PHX
         PHA
         LDX   $F1
         LDA   $EF
         JSL   L021F00
         PLA
         PLX
         STX   $F1
         STA   $EF
         LDA   #$0002
         PHA
         LDA   $F7
         CLC
         JSL   L021F1A
         PLA
         STA   $D8
         LDA   #$0002
         PHA
         LDA   $D4
         CLC
         JSL   L021F1A
         PLA
         STA   $D6
         LDA   $CE
         SEC
         SBC   $D0
         CLC
         ADC   #$0001
         STA   $DC
         LDA   $D2
         SEC
         SBC   $D4
         CLC
         ADC   #$0001
         LSR
         STA   $DA
         LDA   #$0002
         PHA
         LDA   $D4
         CLC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L0808C6
         LDA   #$000F
         SEP   #$20
         STA   $DF
         REP   #$20
         BRA   L0808CF
L0808C6  LDA   #$00FF
         SEP   #$20
         STA   $DF
         REP   #$20
L0808CF  LDA   #$0002
         PHA
         LDA   $D2
         CLC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L0808E9
         LDA   #$00FF
         SEP   #$20
         STA   $DE
         REP   #$20
         BRA   L0808F2
L0808E9  LDA   #$00F0
         SEP   #$20
         STA   $DE
         REP   #$20
L0808F2  LDA   $DE
         AND   #$00FF
         PHA
         LDA   $DF
         AND   #$00FF
         PLX
         STX   $E4
         AND   $E4
         CMP   #$00FF
         BNE   L080909
         DEC   $DA
L080909  LDA   $DA
         CMP   #$0000
         BNE   L080944
         LDA   $D4
         CMP   $D2
         BNE   L08092E
         LDA   $DE
         AND   #$00FF
         PHA
         LDA   $DF
         AND   #$00FF
         PLX
         STX   $E4
         AND   $E4
         SEP   #$20
         STA   $DF
         REP   #$20
         BRA   L080944
L08092E  LDA   $DE
         AND   #$00FF
         PHA
         LDA   $DF
         AND   #$00FF
         PLX
         STX   $E4
         ORA   $E4
         SEP   #$20
         STA   $DF
         REP   #$20
L080944  LDA   $FF
         BMI   L080965
         ASL
         ASL
         TAX
         LDAL  L053CD9,X
         STA   $CA
         LDAL  L053D19,X
         STA   $C6
         INX
         INX
         LDAL  L053CD9,X
         STA   $CC
         LDAL  L053D19,X
         STA   $C8
L080965  LDA   $D8
         EOR   $D6
         BEQ   L080975
         LDA   $D8
         BNE   L080972
         BRL   L080B09
L080972  BRL   L080A1F
L080975  LDA   $FF
         SEP   #$30
         BPL   L0809BE
L08097B  LDY   $DA
         BEQ   L080993
         LDA   [$EB],Y
         EOR   [$EF],Y
         AND   $DE
         EOR   [$EF],Y
         STA   [$EF],Y
         DEY
         BEQ   L080993
L08098C  LDA   [$EB],Y
         STA   [$EF],Y
         DEY
         BNE   L08098C
L080993  LDA   [$EB],Y
         EOR   [$EF],Y
         AND   $DF
         EOR   [$EF],Y
         STA   [$EF],Y
         REP   #$30
         CLC
         LDA   $EB
         ADC   $FB
         STA   $EB
         BCC   L0809AA
         INC   $ED
L0809AA  CLC
         LDA   $EF
         ADC   $FD
         STA   $EF
         BCC   L0809B5
         INC   $F1
L0809B5  DEC   $DC
         SEP   #$30
         BNE   L08097B
         BRL   L080BF7
L0809BE  LDY   $DA
         BEQ   L0809EA
         LDA   [$EB],Y
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         EOR   [$EF],Y
         AND   $DE
         EOR   [$EF],Y
         STA   [$EF],Y
         DEY
         BEQ   L0809EA
L0809D9  LDA   [$EB],Y
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         STA   [$EF],Y
         DEY
         BNE   L0809D9
L0809EA  LDA   [$EB],Y
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         EOR   [$EF],Y
         AND   $DF
         EOR   [$EF],Y
         STA   [$EF],Y
         REP   #$30
         CLC
         LDA   $EB
         ADC   $FB
         STA   $EB
         BCC   L080A0B
         INC   $ED
L080A0B  CLC
         LDA   $EF
         ADC   $FD
         STA   $EF
         BCC   L080A16
         INC   $F1
L080A16  DEC   $DC
         SEP   #$30
         BNE   L0809BE
         BRL   L080BF7
L080A1F  LDA   $FF
         SEP   #$30
         BPL   L080A88
L080A25  LDY   $DA
         BEQ   L080A51
         REP   #$20
         LDA   [$EB],Y
         XBA
         ASL
         ASL
         ASL
         ASL
         SEP   #$30
         XBA
         EOR   [$EF],Y
         AND   $DE
         EOR   [$EF],Y
         STA   [$EF],Y
         DEY
         BEQ   L080A51
L080A40  REP   #$20
         LDA   [$EB],Y
         XBA
         ASL
         ASL
         ASL
         ASL
         SEP   #$30
         XBA
         STA   [$EF],Y
         DEY
         BNE   L080A40
L080A51  REP   #$20
         LDA   [$EB],Y
         XBA
         ASL
         ASL
         ASL
         ASL
         SEP   #$30
         XBA
         EOR   [$EF],Y
         AND   $DF
         EOR   [$EF],Y
         STA   [$EF],Y
         REP   #$30
         CLC
         LDA   $EB
         ADC   $FB
         STA   $EB
         BCC   L080A72
         INC   $ED
L080A72  CLC
         LDA   $EF
         ADC   $FD
         STA   $EF
         BCC   L080A7D
         INC   $F1
L080A7D  DEC   $DC
         SEP   #$30
         BEQ   L080A85
         BRA   L080A25
L080A85  BRL   L080BF7
L080A88  LDY   $DA
         BEQ   L080AC8
         REP   #$20
         LDA   [$EB],Y
         XBA
         ASL
         ASL
         ASL
         ASL
         SEP   #$30
         XBA
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         EOR   [$EF],Y
         AND   $DE
         EOR   [$EF],Y
         STA   [$EF],Y
         DEY
         BEQ   L080AC8
L080AAD  REP   #$20
         LDA   [$EB],Y
         XBA
         ASL
         ASL
         ASL
         ASL
         SEP   #$30
         XBA
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         STA   [$EF],Y
         DEY
         BNE   L080AAD
L080AC8  REP   #$20
         LDA   [$EB],Y
         XBA
         ASL
         ASL
         ASL
         ASL
         SEP   #$30
         XBA
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         EOR   [$EF],Y
         AND   $DF
         EOR   [$EF],Y
         STA   [$EF],Y
         REP   #$30
         CLC
         LDA   $EB
         ADC   $FB
         STA   $EB
         BCC   L080AF3
         INC   $ED
L080AF3  CLC
         LDA   $EF
         ADC   $FD
         STA   $EF
         BCC   L080AFE
         INC   $F1
L080AFE  DEC   $DC
         SEP   #$30
         BEQ   L080B06
         BRA   L080A88
L080B06  BRL   L080BF7
L080B09  REP   #$30
         SEC
         LDA   $EB
         SBC   #$0001
         STA   $EB
         BCS   L080B17
         DEC   $ED
L080B17  LDA   $FF
         SEP   #$30
         BPL   L080B7C
L080B1D  LDY   $DA
         BEQ   L080B47
         REP   #$20
         LDA   [$EB],Y
         XBA
         LSR
         LSR
         LSR
         LSR
         SEP   #$30
         EOR   [$EF],Y
         AND   $DE
         EOR   [$EF],Y
         STA   [$EF],Y
         DEY
         BEQ   L080B47
L080B37  REP   #$20
         LDA   [$EB],Y
         XBA
         LSR
         LSR
         LSR
         LSR
         SEP   #$30
         STA   [$EF],Y
         DEY
         BNE   L080B37
L080B47  REP   #$20
         LDA   [$EB],Y
         XBA
         LSR
         LSR
         LSR
         LSR
         SEP   #$30
         EOR   [$EF],Y
         AND   $DF
         EOR   [$EF],Y
         STA   [$EF],Y
         REP   #$30
         CLC
         LDA   $EB
         ADC   $FB
         STA   $EB
         BCC   L080B67
         INC   $ED
L080B67  CLC
         LDA   $EF
         ADC   $FD
         STA   $EF
         BCC   L080B72
         INC   $F1
L080B72  DEC   $DC
         SEP   #$30
         BEQ   L080B7A
         BRA   L080B1D
L080B7A  BRA   L080BF7
L080B7C  LDY   $DA
         BEQ   L080BBA
         REP   #$20
         LDA   [$EB],Y
         XBA
         LSR
         LSR
         LSR
         LSR
         SEP   #$30
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         EOR   [$EF],Y
         AND   $DE
         EOR   [$EF],Y
         STA   [$EF],Y
         DEY
         BEQ   L080BBA
L080BA0  REP   #$20
         LDA   [$EB],Y
         XBA
         LSR
         LSR
         LSR
         LSR
         SEP   #$30
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         STA   [$EF],Y
         DEY
         BNE   L080BA0
L080BBA  REP   #$20
         LDA   [$EB],Y
         XBA
         LSR
         LSR
         LSR
         LSR
         SEP   #$30
         TAX
         LDA   [$EF],Y
         PHY
         TXY
         AND   [$CA],Y
         ORA   [$C6],Y
         PLY
         EOR   [$EF],Y
         AND   $DF
         EOR   [$EF],Y
         STA   [$EF],Y
         REP   #$30
         CLC
         LDA   $EB
         ADC   $FB
         STA   $EB
         BCC   L080BE4
         INC   $ED
L080BE4  CLC
         LDA   $EF
         ADC   $FD
         STA   $EF
         BCC   L080BEF
         INC   $F1
L080BEF  DEC   $DC
         SEP   #$30
         BEQ   L080BF7
         BRA   L080B7C
L080BF7  REP   #$30
         TSC
         CLC
         ADC   #$0020
         TCS
         PLD
         RTL

L080C01  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E2
         TCS
         LDA   $FD
         SEC
         SBC   #$0001
         STA   $EC
L080C14  CLC
         LDA   $F9
         STA   $E8
         ADC   $EC
         STA   $E4
         LDA   $FB
         STA   $EA
         ADC   #$0000
         STA   $E6
         LDA   $FD
         LSR
         BCC   L080C2C
         INC
L080C2C  TAY
L080C2D  SEP   #$30
         LDA   [$E8]
         TAX
         LDAL  L051BD9,X
         XBA
         LDA   [$E4]
         TAX
         LDAL  L051BD9,X
         STA   [$E8]
         XBA
         STA   [$E4]
         DEY
         REP   #$30
         BEQ   L080C58
         INC   $E8
         BNE   L080C4E
         INC   $EA
L080C4E  LDA   $E4
         BNE   L080C54
         DEC   $E6
L080C54  DEC   $E4
         BRA   L080C2D
L080C58  DEC   $FF
         BEQ   L080C69
         CLC
         LDA   $F9
         ADC   $FD
         STA   $F9
         BCC   L080C14
         INC   $FB
         BRA   L080C14
L080C69  TSC
         CLC
         ADC   #$0010
         TCS
         PLD
         RTL

L080C71  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E4
         TCS
         LDA   $FD
         SEC
         SBC   #$0002
         STA   $E8
         LDA   $FF
         LSR
         STA   $E6
         LDA   $FF
         SEC
         SBC   #$0001
         PHA
         LDA   $FD
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDX   $FB
         LDA   $F9
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
         LDX   $E6
L080CAD  LDY   $E8
L080CAF  LDA   [$F9],Y
         PHA
         LDA   [$EA],Y
         STA   [$F9],Y
         PLA
         STA   [$EA],Y
         DEY
         DEY
         BPL   L080CAF
         DEX
         BEQ   L080CD8
         CLC
         LDA   $F9
         ADC   $FD
         STA   $F9
         BCC   L080CCB
         INC   $FB
L080CCB  SEC
         LDA   $EA
         SBC   $FD
         STA   $EA
         BCS   L080CAD
         DEC   $EC
         BRA   L080CAD
L080CD8  TSC
         CLC
         ADC   #$000E
         TCS
         PLD
         RTL

L080CE0  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         LDA   $FF
         ASL
         ASL
         STA   $FF
         LDA   $FD
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   $FD
         PLX
         STX   $F2
         ORA   $F2
         STA   $FD
         LDA   $FD
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   $FD
         PLX
         STX   $F2
         ORA   $F2
         STA   $FD
         LDX   $FF
L080D17  LDA   $FD
         STA   [$F9]
         DEX
         BEQ   L080D2C
         CLC
         LDA   $F9
         ADC   #$0002
         STA   $F9
         BCC   L080D17
         INC   $FB
         BRA   L080D17
L080D2C  TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L080D34  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         PEA   $00A0
         PEI   $FF
         PEI   $FD
         PEI   $FB
         LDX   L03002A
         LDA   L030028
         PHX
         PHA
         JSL   L080D64
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L080D64  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00DA
         TCS
         LDA   L03012C
         CMP   #$0001
         BNE   L080D9E
         LDA   [$F9]
         AND   #$00FF
         STA   $E6
         LDY   #$0001
         LDA   [$F9],Y
         AND   #$00FF
         STA   $E4
         LDY   #$0003
         LDA   [$F9],Y
         AND   #$00FF
         STA   $E0
         LDY   #$0002
         LDA   [$F9],Y
         AND   #$00FF
         STA   $E2
         BRA   L080DB7
L080D9E  LDA   [$F9]
         STA   $E6
         LDY   #$0002
         LDA   [$F9],Y
         STA   $E4
         LDY   #$0006
         LDA   [$F9],Y
         STA   $E0
         LDY   #$0004
         LDA   [$F9],Y
         STA   $E2
L080DB7  LDA   $E0
         SEC
         SBC   $E2
         CLC
         ADC   #$0001
         STA   $E8
         LDA   $FD
         ASL
         ASL
         ASL
         ASL
         PHA
         LDA   $FD
         PLX
         STX   $EE
         ORA   $EE
         STA   $FD
         LDA   $E6
         LSR
         PHA
         LDA   $E2
         PHA
         LDA   $FF
         CLC
         JSL   L0220A5
         PLA
         PLX
         STX   $EE
         CLC
         ADC   $EE
         LDX   #$0000
         PHX
         PHA
         LDX   $F7
         LDA   $F5
         JSL   L021F00
         PLA
         PLX
         STX   $F7
         STA   $F5
         LDA   $E4
         SEC
         SBC   $E6
         CLC
         ADC   #$0001
         LSR
         STA   $DE
         LDA   #$0002
         PHA
         LDA   $E6
         CLC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L080E20
         LDA   #$000F
         SEP   #$20
         STA   $DD
         REP   #$20
         BRA   L080E29
L080E20  LDA   #$00FF
         SEP   #$20
         STA   $DD
         REP   #$20
L080E29  LDA   #$0002
         PHA
         LDA   $E4
         CLC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L080E43
         LDA   #$00FF
         SEP   #$20
         STA   $DC
         REP   #$20
         BRA   L080E4C
L080E43  LDA   #$00F0
         SEP   #$20
         STA   $DC
         REP   #$20
L080E4C  LDA   $DC
         AND   #$00FF
         PHA
         LDA   $DD
         AND   #$00FF
         PLX
         STX   $EE
         AND   $EE
         CMP   #$00FF
         BNE   L080E63
         DEC   $DE
L080E63  LDA   $DE
         CMP   #$0000
         BNE   L080E9E
         LDA   $E6
         CMP   $E4
         BNE   L080E88
         LDA   $DC
         AND   #$00FF
         PHA
         LDA   $DD
         AND   #$00FF
         PLX
         STX   $EE
         AND   $EE
         SEP   #$20
         STA   $DD
         REP   #$20
         BRA   L080E9E
L080E88  LDA   $DC
         AND   #$00FF
         PHA
         LDA   $DD
         AND   #$00FF
         PLX
         STX   $EE
         ORA   $EE
         SEP   #$20
         STA   $DD
         REP   #$20
L080E9E  SEP   #$30
         LDY   $DE
         BEQ   L080EB8
         LDA   $FD
         EOR   [$F5],Y
         AND   $DC
         EOR   [$F5],Y
         STA   [$F5],Y
         DEY
         BEQ   L080EB8
L080EB1  LDA   $FD
         STA   [$F5],Y
         DEY
         BNE   L080EB1
L080EB8  LDA   $FD
         EOR   [$F5],Y
         AND   $DD
         EOR   [$F5],Y
         STA   [$F5],Y
         REP   #$30
         CLC
         LDA   $F5
         ADC   $FF
         STA   $F5
         BCC   L080ECF
         INC   $F7
L080ECF  DEC   $E8
         BNE   L080E9E
         TSC
         CLC
         ADC   #$0014
         TCS
         PLD
         RTL

L080EDB  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         PEA   $00A0
         PEI   $FF
         PEI   $FD
         PEI   $FB
         LDX   L03002A
         LDA   L030028
         PHX
         PHA
         JSL   L080F0B
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L080F0B  PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00DA
         TCS
         LDA   L03012C
         CMP   #$0001
         BNE   L080F45
         LDA   [$F9]
         AND   #$00FF
         STA   $E6
         LDY   #$0001
         LDA   [$F9],Y
         AND   #$00FF
         STA   $E4
         LDY   #$0003
         LDA   [$F9],Y
         AND   #$00FF
         STA   $E0
         LDY   #$0002
         LDA   [$F9],Y
         AND   #$00FF
         STA   $E2
         BRA   L080F5E
L080F45  LDA   [$F9]
         STA   $E6
         LDY   #$0002
         LDA   [$F9],Y
         STA   $E4
         LDY   #$0006
         LDA   [$F9],Y
         STA   $E0
         LDY   #$0004
         LDA   [$F9],Y
         STA   $E2
L080F5E  LDA   $E0
         SEC
         SBC   $E2
         CLC
         ADC   #$0001
         STA   $E8
         LDA   $FD
         AND   #$000F
         STA   $FD
         LDA   #$000C
         PHA
         LDA   $FD
         CLC
         JSL   L0222A8
         LDA   $FD
         PLX
         STX   $EE
         ORA   $EE
         STA   $FD
         LDA   $E6
         LSR
         PHA
         LDA   $E2
         PHA
         LDA   $FF
         CLC
         JSL   L0220A5
         PLA
         PLX
         STX   $EE
         CLC
         ADC   $EE
         LDX   #$0000
         PHX
         PHA
         LDX   $F7
         LDA   $F5
         JSL   L021F00
         PLA
         PLX
         STX   $F7
         STA   $F5
         LDA   $E4
         SEC
         SBC   $E6
         CLC
         ADC   #$0001
         LSR
         STA   $DE
         LDA   #$0002
         PHA
         LDA   $E6
         CLC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L080FD2
         LDA   #$000F
         SEP   #$20
         STA   $DD
         REP   #$20
         BRA   L080FDB
L080FD2  LDA   #$00FF
         SEP   #$20
         STA   $DD
         REP   #$20
L080FDB  LDA   #$0002
         PHA
         LDA   $E4
         CLC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L080FF5
         LDA   #$00FF
         SEP   #$20
         STA   $DC
         REP   #$20
         BRA   L080FFE
L080FF5  LDA   #$00F0
         SEP   #$20
         STA   $DC
         REP   #$20
L080FFE  LDA   $DC
         AND   #$00FF
         PHA
         LDA   $DD
         AND   #$00FF
         PLX
         STX   $EE
         AND   $EE
         CMP   #$00FF
         BNE   L081015
         DEC   $DE
L081015  LDA   $DE
         CMP   #$0000
         BNE   L081050
         LDA   $E6
         CMP   $E4
         BNE   L08103A
         LDA   $DC
         AND   #$00FF
         PHA
         LDA   $DD
         AND   #$00FF
         PLX
         STX   $EE
         AND   $EE
         SEP   #$20
         STA   $DD
         REP   #$20
         BRA   L081050
L08103A  LDA   $DC
         AND   #$00FF
         PHA
         LDA   $DD
         AND   #$00FF
         PLX
         STX   $EE
         ORA   $EE
         SEP   #$20
         STA   $DD
         REP   #$20
L081050  SEP   #$30
         LDA   $E8
         AND   #$01
         BNE   L081088
         LDY   $DE
         BEQ   L081078
         LDA   [$F5],Y
         AND   #$F0
         ORA   $FD
         EOR   [$F5],Y
         AND   $DC
         EOR   [$F5],Y
         STA   [$F5],Y
         DEY
         BEQ   L081078
L08106D  LDA   [$F5],Y
         AND   #$F0
         ORA   $FD
         STA   [$F5],Y
         DEY
         BNE   L08106D
L081078  LDA   [$F5],Y
         AND   #$F0
         ORA   $FD
         EOR   [$F5],Y
         AND   $DD
         EOR   [$F5],Y
         STA   [$F5],Y
         BRA   L0810B6
L081088  LDY   $DE
         BEQ   L0810A8
         LDA   [$F5],Y
         AND   #$0F
         ORA   $FE
         EOR   [$F5],Y
         AND   $DC
         EOR   [$F5],Y
         STA   [$F5],Y
         DEY
         BEQ   L0810A8
L08109D  LDA   [$F5],Y
         AND   #$0F
         ORA   $FE
         STA   [$F5],Y
         DEY
         BNE   L08109D
L0810A8  LDA   [$F5],Y
         AND   #$0F
         ORA   $FE
         EOR   [$F5],Y
         AND   $DD
         EOR   [$F5],Y
         STA   [$F5],Y
L0810B6  REP   #$30
         CLC
         LDA   $F5
         ADC   $FF
         STA   $F5
         BCC   L0810C3
         INC   $F7
L0810C3  DEC   $E8
         BNE   L081050
         TSC
         CLC
         ADC   #$0014
         TCS
         PLD
         RTL

L0810CF  ENT
         PHD
         TSC
         SEC
         SBC   #$00DB
         TCD
         ADC   #$00AB
         TCS
         LDA   $FB
         CMP   #$FFFF
         BEQ   L0810F7
         LDA   $FB
         CMP   #$00FF
         BEQ   L0810F7
         LDA   $FB
         CMP   #$00FF
         BEQ   L0810FC
         LDA   $FB
         AND   #$0080
         TAY
         BEQ   L0810FC
L0810F7  LDA   #$0000
         BRA   L0810FF
L0810FC  LDA   #$0001
L0810FF  STA   $D2
         LDA   $FB
         CMP   #$FFFF
         BEQ   L08110F
         LDA   $FB
         AND   #$007F
         STA   $FB
L08110F  LDA   L03012C
         CMP   #$0001
         BNE   L08113E
         LDA   [$F1]
         AND   #$00FF
         STA   $B9
         LDY   #$0001
         LDA   [$F1],Y
         AND   #$00FF
         STA   $B7
         LDY   #$0003
         LDA   [$F1],Y
         AND   #$00FF
         STA   $B3
         LDY   #$0002
         LDA   [$F1],Y
         AND   #$00FF
         STA   $B5
         BRA   L081157
L08113E  LDA   [$F1]
         STA   $B9
         LDY   #$0002
         LDA   [$F1],Y
         STA   $B7
         LDY   #$0006
         LDA   [$F1],Y
         STA   $B3
         LDY   #$0004
         LDA   [$F1],Y
         STA   $B5
L081157  LDA   $F5
         ASL
         ASL
         ASL
         STA   $F5
         LDA   $F7
         ASL
         ASL
         ASL
         STA   $F7
         LDA   $F5
         SEC
         SBC   $F7
         STA   $D4
         LDA   $F7
         LDX   #$0000
         PHX
         PHA
         LDX   $E3
         LDA   $E1
         JSL   L021F00
         PLA
         PLX
         STX   $D0
         STA   $CE
         LDA   $E5
         CMP   #$0000
         BNE   L081199
         LDA   $E7
         CMP   #$0000
         BNE   L081199
         LDX   L03002A
         LDA   L030028
         STX   $E7
         STA   $E5
L081199  LDA   #$0001
         PHA
         LDA   $B9
         SEC
         JSL   L0222DF
         LDA   $B5
         PHA
         LDA   $F9
         CLC
         JSL   L0220A5
         PLA
         PLX
         STX   $DA
         CLC
         ADC   $DA
         LDX   #$0000
         PHX
         PHA
         LDX   $E7
         LDA   $E5
         JSL   L021F00
         PLA
         PLX
         STX   $E7
         STA   $E5
         STX   $C8
         STA   $C6
         LDA   $B3
         SEC
         SBC   $B5
         CLC
         ADC   #$0001
         STA   $B1
         LDA   #$0001
         PHA
         LDA   $B7
         SEC
         SBC   $B9
         CLC
         ADC   #$0001
         SEC
         JSL   L0222DF
         PLA
         STA   $AF
         LDA   #$0002
         PHA
         LDA   $B9
         SEC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L081206
         LDA   #$000F
         SEP   #$20
         STA   $BD
         REP   #$20
         BRA   L08120F
L081206  LDA   #$00FF
         SEP   #$20
         STA   $BD
         REP   #$20
L08120F  LDA   #$0002
         PHA
         LDA   $B7
         SEC
         JSL   L021F1A
         PLA
         TAY
         BEQ   L081229
         LDA   #$00FF
         SEP   #$20
         STA   $BC
         REP   #$20
         BRA   L081232
L081229  LDA   #$00F0
         SEP   #$20
         STA   $BC
         REP   #$20
L081232  LDA   $BC
         AND   #$00FF
         PHA
         LDA   $BD
         AND   #$00FF
         PLX
         STX   $DA
         AND   $DA
         CMP   #$00FF
         BNE   L081249
         DEC   $AF
L081249  LDA   $AF
         CMP   #$0000
         BNE   L081284
         LDA   $B9
         CMP   $B7
         BNE   L08126E
         LDA   $BC
         AND   #$00FF
         PHA
         LDA   $BD
         AND   #$00FF
         PLX
         STX   $DA
         AND   $DA
         SEP   #$20
         STA   $BD
         REP   #$20
         BRA   L081284
L08126E  LDA   $BC
         AND   #$00FF
         PHA
         LDA   $BD
         AND   #$00FF
         PLX
         STX   $DA
         ORA   $DA
         SEP   #$20
         STA   $BD
         REP   #$20
L081284  LDA   $FB
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L053CD9
         LDX   #^L053CD9
         JSL   L021F00
         PLA
         PLX
         STA   $D6
         STX   $D8
         LDY   #$0002
         LDA   [$D6],Y
         TAX
         LDA   [$D6]
         STX   $C4
         STA   $C2
         LDA   $FB
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L053D19
         LDX   #^L053D19
         JSL   L021F00
         PLA
         PLX
         STA   $D6
         STX   $D8
         LDY   #$0002
         LDA   [$D6],Y
         TAX
         LDA   [$D6]
         STX   $C0
         STA   $BE
         LDA   $D2
         BNE   L0812D5
         BRL   L0813C8
L0812D5  LDA   $FB
         ASL
         ASL
         ASL
         ASL
         ORA   $FB
         STA   $FB
         LDX   $D4
L0812E1  LDA   $AF
         STA   $AD
         BNE   L0812EA
         BRL   L081370
L0812EA  SEP   #$30
         LDA   [$E9]
         EOR   #$FF
         AND   $FB
         STA   $BB
         LDA   [$CE]
         AND   [$E9]
         ORA   $BB
         TAY
         LDA   [$C6]
         AND   [$C2],Y
         ORA   [$BE],Y
         EOR   [$C6]
         AND   $BC
         EOR   [$C6]
         STA   [$C6]
         REP   #$30
         DEX
         BEQ   L081316
         INC   $CE
         BNE   L081320
         INC   $D0
         BRA   L081320
L081316  LDA   $E1
         STA   $CE
         LDA   $E3
         STA   $D0
         LDX   $F5
L081320  INC   $E9
         BNE   L081326
         INC   $EB
L081326  INC   $C6
         BNE   L08132C
         INC   $C8
L08132C  DEC   $AD
         BEQ   L081370
L081330  SEP   #$30
         LDA   [$E9]
         EOR   #$FF
         AND   $FB
         STA   $BB
         LDA   [$CE]
         AND   [$E9]
         ORA   $BB
         TAY
         LDA   [$C6]
         AND   [$C2],Y
         ORA   [$BE],Y
         STA   [$C6]
         REP   #$30
         DEX
         BEQ   L081356
         INC   $CE
         BNE   L081360
         INC   $D0
         BRA   L081360
L081356  LDA   $E1
         STA   $CE
         LDA   $E3
         STA   $D0
         LDX   $F5
L081360  INC   $E9
         BNE   L081366
         INC   $EB
L081366  INC   $C6
         BNE   L08136C
         INC   $C8
L08136C  DEC   $AD
         BNE   L081330
L081370  SEP   #$30
         LDA   [$E9]
         EOR   #$FF
         AND   $FB
         STA   $BB
         LDA   [$CE]
         AND   [$E9]
         ORA   $BB
         TAY
         LDA   [$C6]
         AND   [$C2],Y
         ORA   [$BE],Y
         EOR   [$C6]
         AND   $BD
         EOR   [$C6]
         STA   [$C6]
         REP   #$30
         DEX
         BEQ   L08139C
         INC   $CE
         BNE   L0813A6
         INC   $D0
         BRA   L0813A6
L08139C  LDA   $E1
         STA   $CE
         LDA   $E3
         STA   $D0
         LDX   $F5
L0813A6  INC   $E9
         BNE   L0813AC
         INC   $EB
L0813AC  CLC
         LDA   $E5
         ADC   $F9
         STA   $E5
         STA   $C6
         LDA   $E7
         ADC   #$0000
         STA   $E7
         STA   $C8
         DEC   $B1
         BEQ   L0813C5
         BRL   L0812E1
L0813C5  BRL   L081475
L0813C8  LDX   $D4
L0813CA  LDA   $AF
         STA   $AD
         BEQ   L081432
         SEP   #$30
         LDA   [$CE]
         TAY
         LDA   [$C6]
         AND   [$C2],Y
         ORA   [$BE],Y
         EOR   [$C6]
         AND   $BC
         EOR   [$C6]
         STA   [$C6]
         REP   #$30
         DEX
         BEQ   L0813F0
         INC   $CE
         BNE   L0813FA
         INC   $D0
         BRA   L0813FA
L0813F0  LDA   $E1
         STA   $CE
         LDA   $E3
         STA   $D0
         LDX   $F5
L0813FA  INC   $C6
         BNE   L081400
         INC   $C8
L081400  DEC   $AD
         BEQ   L081432
L081404  SEP   #$30
         LDA   [$CE]
         TAY
         LDA   [$C6]
         AND   [$C2],Y
         ORA   [$BE],Y
         STA   [$C6]
         REP   #$30
         DEX
         BEQ   L08141E
         INC   $CE
         BNE   L081428
         INC   $D0
         BRA   L081428
L08141E  LDA   $E1
         STA   $CE
         LDA   $E3
         STA   $D0
         LDX   $F5
L081428  INC   $C6
         BNE   L08142E
         INC   $C8
L08142E  DEC   $AD
         BNE   L081404
L081432  SEP   #$30
         LDA   [$CE]
         TAY
         LDA   [$C6]
         AND   [$C2],Y
         ORA   [$BE],Y
         EOR   [$C6]
         AND   $BD
         EOR   [$C6]
         STA   [$C6]
         REP   #$30
         DEX
         BEQ   L081452
         INC   $CE
         BNE   L08145C
         INC   $D0
         BRA   L08145C
L081452  LDA   $E1
         STA   $CE
         LDA   $E3
         STA   $D0
         LDX   $F5
L08145C  CLC
         LDA   $E5
         ADC   $F9
         STA   $E5
         STA   $C6
         LDA   $E7
         ADC   #$0000
         STA   $E7
         STA   $C8
         DEC   $B1
         BEQ   L081475
         BRL   L0813CA
L081475  TSC
         CLC
         ADC   #$002F
         TCS
         PLD
         RTL

L08147D  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E8
         TCS
         CLC
         LDA   #L090436
         ADC   #$0023
         STA   $F2
         LDA   #^L090436
         ADC   #$0000
         STA   $F4
         LDA   L03002C
         STA   $EE
         LDA   L03002E
         STA   $F0
         LDA   #$34A0
         STA   $EA
         LDY   #$0002
         LDX   #$0038
L0814AE  LDA   $EE
         STA   [$F2]
         LDA   $F0
         SEP   #$20
         STA   [$F2],Y
         REP   #$20
         CLC
         LDA   $F2
         ADC   #$0004
         STA   $F2
         BCC   L0814C6
         INC   $F4
L0814C6  LDA   $EA
         STA   [$F2]
         CLC
         LDA   $F2
         ADC   #$0003
         STA   $F2
         BCC   L0814D6
         INC   $F4
L0814D6  CLC
         LDA   $EE
         ADC   #$0002
         STA   $EE
         BCC   L0814E2
         INC   $F0
L0814E2  CLC
         LDA   $EA
         ADC   #$0002
         STA   $EA
         BCC   L0814EE
         INC   $EC
L0814EE  DEX
         BNE   L0814AE
         CLC
         LDA   #L090777
         ADC   #$0012
         STA   $F2
         LDA   #^L090777
         ADC   #$0000
         STA   $F4
         LDA   #$8C20
         STA   $EE
         LDA   #$00E1     ; BANK
         STA   $F0
         STA   $EC
         LDA   #$8B80
         STA   $EA
         LDY   #$0002
         LDX   #$0050
L081519  LDA   $EE
         STA   [$F2]
         LDA   $F0
         SEP   #$20
         STA   [$F2],Y
         REP   #$20
         CLC
         LDA   $F2
         ADC   #$0004
         STA   $F2
         BCC   L081531
         INC   $F4
L081531  LDA   $EA
         STA   [$F2]
         LDA   $EC
         SEP   #$20
         STA   [$F2],Y
         REP   #$20
         CLC
         LDA   $F2
         ADC   #$0004
         STA   $F2
         BCC   L081549
         INC   $F4
L081549  CLC
         LDA   $EE
         ADC   #$0002
         STA   $EE
         BCC   L081555
         INC   $F0
L081555  CLC
         LDA   $EA
         ADC   #$0002
         STA   $EA
         BCC   L081561
         INC   $EC
L081561  DEX
         BNE   L081519
         TSC
         CLC
         ADC   #$0012
         TCS
         PLD
         RTL

L08156C  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EE
         TCS
         SEP   #$20
         STZ   $F5
         REP   #$20
L08157D  LDA   $F5
         SEP   #$20
         STA   $F3
         REP   #$20
         SEP   #$20
         STA   $F4
         REP   #$20
         LDA   #$0004
         PHA
         LDA   $F3
         AND   #$00FF
         SEC
         JSL   L0222DF
         LDA   $F4
         AND   #$00FF
         ASL
         ASL
         ASL
         ASL
         PLX
         STX   $FA
         ORA   $FA
         PHA
         LDA   $F5
         SEP   #$20
         INC   $F5
         REP   #$20
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L051BD9
         LDX   #^L051BD9
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F5
         AND   #$00FF
         CMP   #$0000
         BNE   L08157D
         SEP   #$20
         STZ   $F2
         REP   #$20
L0815DF  LDA   $F2
         AND   #$00FF
         AND   #$00F0
         SEP   #$20
         STA   $F1
         REP   #$20
         LDA   $F2
         AND   #$00FF
         AND   #$000F
         SEP   #$20
         STA   $F0
         REP   #$20
         LDA   $F0
         AND   #$00FF
         PHA
         LDA   #$0100
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L051CD9
         LDX   #^L051CD9
         JSL   L021F00
         LDA   $F0
         AND   #$00FF
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L053CD9
         LDX   #^L053CD9
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
         LDA   $F0
         AND   #$00FF
         PHA
         LDA   #$0100
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L052CD9
         LDX   #^L052CD9
         JSL   L021F00
         LDA   $F0
         AND   #$00FF
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L053D19
         LDX   #^L053D19
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
         SEP   #$20
         STZ   $F5
         REP   #$20
L08168D  SEP   #$20
         STZ   $F4
         REP   #$20
         LDA   $F5
         AND   #$00FF
         AND   #$00F0
         PHA
         LDA   $F1
         AND   #$00FF
         PLX
         STX   $F6
         CMP   $F6
         BNE   L0816B1
         LDA   #$00F0
         SEP   #$20
         STA   $F4
         REP   #$20
L0816B1  LDA   $F5
         AND   #$00FF
         AND   #$000F
         PHA
         LDA   $F0
         AND   #$00FF
         PLX
         STX   $F6
         CMP   $F6
         BNE   L0816D4
         LDA   $F4
         AND   #$00FF
         ORA   #$000F
         SEP   #$20
         STA   $F4
         REP   #$20
L0816D4  LDA   $F5
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         AND   #$00FF
         PHA
         LDA   #$0100
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L051CD9
         LDX   #^L051CD9
         JSL   L021F00
         PLA
         PLX
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   $F4
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F4
         AND   #$00FF
         EOR   #$FFFF
         PHA
         LDA   $F5
         AND   #$00FF
         PLX
         STX   $FA
         AND   $FA
         PHA
         LDA   $F5
         SEP   #$20
         INC   $F5
         REP   #$20
         AND   #$00FF
         LDX   #$0000
         PHX
         PHA
         LDA   $F0
         AND   #$00FF
         PHA
         LDA   #$0100
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L052CD9
         LDX   #^L052CD9
         JSL   L021F00
         PLA
         PLX
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   $F5
         AND   #$00FF
         CMP   #$0000
         BEQ   L081772
         BRL   L08168D
L081772  LDA   $F2
         AND   #$00FF
         CLC
         ADC   #$0011
         SEP   #$20
         STA   $F2
         REP   #$20
         LDA   $F2
         AND   #$00FF
         CMP   #$0010
         BEQ   L08178E
         BRL   L0815DF
L08178E  TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L081796  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EE
         TCS
         JSL   L020392
         PEI   $FF
         PEI   $FD
         JSL   L0221F6
         PLY
         PLY
         PHA
         PEI   $FB
         PEI   $FF
         PEI   $FD
         _SysFailMgr
         BCS   L0817C2
         LDA   #$0000
L0817C2  STAL  L030002
         PLA
L0817C7  BRA   L0817C7
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L0817D1  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F0
         TCS
         LDA   L030333
         PHA
         LDX   L030337
         LDA   L030335
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
         JSL   L090128
         PHA
         _QDShutDown
         BCS   L081802
         LDA   #$0000
L081802  STAL  L030002
         _SANEShutDown
         BCS   L081812
         LDA   #$0000
L081812  STAL  L030002
         _EMShutDown
         BCS   L081822
         LDA   #$0000
L081822  STAL  L030002
         _SchShutDown
         BCS   L081832
         LDA   #$0000
L081832  STAL  L030002
         _MTShutDown
         BCS   L081842
         LDA   #$0000
L081842  STAL  L030002
         LDA   L030000
         PHA
         _HUnlockAll
         BCS   L081856
         LDA   #$0000
L081856  STAL  L030002
         LDA   L030000
         PHA
         _DisposeAll
         BCS   L08186A
         LDA   #$0000
L08186A  STAL  L030002
         LDA   L030000
         PHA
         _MMShutDown
         BCS   L08187E
         LDA   #$0000
L08187E  STAL  L030002
         _TLShutDown
         BCS   L08188E
         LDA   #$0000
L08188E  STAL  L030002
         PLA
         LDA   #$0001
         STA   $F2
         LDA   #$0000
         STA   $F4
         PHA
         PEA   $2003
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         JSL   L0224DD
         PLA
         TSC
         CLC
         ADC   #$000A
         TCS
         PLD
         RTL

L0818B7  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EC
         TCS
         JSL   L08156C
         PHA
         _MMStartUp
         BCS   L0818D3
         LDA   #$0000
L0818D3  STAL  L030002
         PLA
         STA   L030000
         PHA
         _CompactMem
         BCS   L0818E8
         LDA   #$0000
L0818E8  STAL  L030002
         PLA
         LDX   #$0000
         LDA   #$0000
         PHX
         PHA
         PHX
         PHA
         _MaxBlock
         BCS   L081903
         LDA   #$0000
L081903  STAL  L030002
         PLA
         PLX
         SEC
         SBC   #$0000
         PHA
         TXA
         SBC   #$0001
         TAX
         PLA
         STX   $F4
         STA   $F2
         JSL   L022171
         BVS   L081921
         EOR   #$8000
L081921  BPL   L081933
         PEA   ^L053D59
         PEA   L053D59
         PEA   $0000
         JSL   L081796
         PLY
         PLY
         PLY
L081933  PHX
         PHA
         PEI   $F4
         PEI   $F2
         LDA   L030000
         PHA
         PEA   $C000
         PEA   $0000
         PEA   $0000
         _NewHandle
         BCS   L081952
         LDA   #$0000
L081952  STAL  L030002
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STX   $F0
         STA   $EE
         LDX   $F0
         LDA   $EE
         AND   #$0001
         TAY
         BEQ   L081980
         INC   $EE
         BNE   L081978
         INC   $F0
L081978  LDA   $F2
         BNE   L08197E
         DEC   $F4
L08197E  DEC   $F2
L081980  LDX   $F4
         LDA   $F2
         AND   #$0001
         PHA
         TXA
         AND   #$0000
         TAX
         PLA
         STX   $F6
         ORA   $F6
         BEQ   L08199C
         LDA   $F2
         BNE   L08199A
         DEC   $F4
L08199A  DEC   $F2
L08199C  PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEI   $F4
         PEI   $F2
         PEI   $F0
         PEI   $EE
         JSL   L0B08DD
         TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         PEA   $0001
         PEA   $0000
         PEA   $8000
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L030130
         STA   L03012E
         JSL   L0901C9
         JSL   L090051
         PHX
         PHA
         PEA   $0006
         _GetAddr
         BCS   L0819EB
         LDA   #$0000
L0819EB  STAL  L030002
         PLA
         PLX
         STX   L030337
         STA   L030335
         LDX   L030337
         LDA   L030335
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         AND   #$000F
         STA   L030333
         LDX   L030337
         LDA   L030335
         STA   $F6
         STX   $F8
         LDA   #$000F
         SEP   #$20
         STA   [$F6]
         REP   #$20
         LDA   #$0000
         PHA
         PHA
         PHA
         PHA
         _ReadTimeHex
         PLA
         STA   L030084
         PLA
         STA   L030086
         PLA
         PLA
         TSC
         CLC
         ADC   #$000E
         TCS
         PLD
         RTL

L081A3F  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00EC
         TCS
         PEI   $FB
         PEI   $F9
         JSL   L022405
         PLY
         PLY
         STA   [$FD]
         PEI   $FB
         PEI   $F9
         LDA   $FD
         CLC
         ADC   #$0002
         TAX
         LDA   $FF
         BCC   L081A66
         INC
L081A66  PHA
         PHX
         JSL   L02251A+1
         PLY
         PLY
         PLY
         PLY
         LDX   $FF
         LDA   $FD
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L081A7E  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00E4
         TCS
         LDA   #$0003
         STA   $E6
         LDA   $FB
         STA   $E8
         LDA   #$0000
         STA   $EA
         LDX   $FF
         LDA   $FD
         STX   $EE
         STA   $EC
         PHA
         PEA   $2016
         PEA   $0000
         TDC
         CLC
         ADC   #$00E6
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         CMP   #$0000
         BEQ   L081ABE
         LDA   #$0000
         BRA   L081AC1
L081ABE  LDA   #$0001
L081AC1  TAY
         TSC
         CLC
         ADC   #$0010
         TCS
         TYA
         PLD
         RTL

L081ACB  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00D8
         TCS
         LDA   #$0005
         STA   $DA
         LDA   $F7
         STA   $DC
         LDX   $FF
         LDA   $FD
         STX   $E0
         STA   $DE
         LDX   $FB
         LDA   $F9
         STX   $E4
         STA   $E2
         LDA   #$0000
         STA   $EA
         PHA
         PEA   $2012
         PEA   $0000
         TDC
         CLC
         ADC   #$00DA
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         CMP   #$0000
         BNE   L081B23
         SEC
         LDA   $E6
         SBC   $E2
         BNE   L081B1B
         LDA   $E8
         SBC   $E4
         BRA   L081B21
L081B1B  LDA   $E8
         SBC   $E4
         REP   #$02
L081B21  BEQ   L081B28
L081B23  LDA   #$0000
         BRA   L081B2B
L081B28  LDA   #$0001
L081B2B  TAY
         TSC
         CLC
         ADC   #$0018
         TCS
         TYA
         PLD
         RTL

L081B35  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00D8
         TCS
         LDA   #$0005
         STA   $DA
         LDA   $F7
         STA   $DC
         LDX   $FF
         LDA   $FD
         STX   $E0
         STA   $DE
         LDX   $FB
         LDA   $F9
         STX   $E4
         STA   $E2
         LDA   #$0000
         STA   $EA
         PHA
         PEA   $2013
         PEA   $0000
         TDC
         CLC
         ADC   #$00DA
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         CMP   #$0000
         BNE   L081B8D
         SEC
         LDA   $E6
         SBC   $E2
         BNE   L081B85
         LDA   $E8
         SBC   $E4
         BRA   L081B8B
L081B85  LDA   $E8
         SBC   $E4
         REP   #$02
L081B8B  BEQ   L081B92
L081B8D  LDA   #$0000
         BRA   L081B95
L081B92  LDA   #$0001
L081B95  TAY
         TSC
         CLC
         ADC   #$0018
         TCS
         TYA
         PLD
         RTL

L081B9F  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$0064
         TCS
         LDA   #$0002
         STA   $B8
         PEA   $0000
         TDC
         CLC
         ADC   #$0066
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L081A3F
         PLY
         PLY
         PLY
         PLY
         STX   $BE
         STA   $BC
         PHA
         PEA   $2010
         PEA   $0000
         TDC
         CLC
         ADC   #$00B8
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         CMP   #$0000
         BNE   L081BE8
         LDA   $BA
         BRA   L081BEB
         BRA   L081BEB
L081BE8  LDA   #$FFFF
L081BEB  TAY
         TSC
         CLC
         ADC   #$0092
         TCS
         TYA
         PLD
         RTL

L081BF5  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EE
         TCS
         LDA   #$0001
         STA   $F0
         LDA   $FF
         STA   $F2
         PHA
         PEA   $2014
         PEA   $0000
         TDC
         CLC
         ADC   #$00F0
         PHA
         JSL   L0224DD
         PLA
         TSC
         CLC
         ADC   #$000A
         TCS
         PLD
         RTL

L081C23  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$0086
         TCS
         LDA   #$0005
         STA   $DA
         PEA   $0000
         TDC
         CLC
         ADC   #$0088
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L081A3F
         PLY
         PLY
         PLY
         PLY
         STX   $DE
         STA   $DC
         LDA   #$00C3
         STA   $E0
         LDA   #$0000
         STA   $E2
         LDX   #$0000
         LDA   #$0000
         STX   $E6
         STA   $E4
         LDA   #$0001
         STA   $E8
         PHA
         PEA   $2001
         PEA   $0000
         TDC
         CLC
         ADC   #$00DA
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         CMP   #$0000
         BNE   L081C8D
         PEI   $FF
         PEI   $FD
         JSL   L081B9F
         PLY
         PLY
         BRA   L081C90
         BRA   L081C90
L081C8D  LDA   #$FFFF
L081C90  TAY
         TSC
         CLC
         ADC   #$0070
         TCS
         TYA
         PLD
         RTL

L081C9A  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$0098
         TCS
         LDA   #$0001
         STA   $EC
         PEA   $0000
         TDC
         CLC
         ADC   #$009A
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L081A3F
         PLY
         PLY
         PLY
         PLY
         STX   $F0
         STA   $EE
         PHA
         PEA   $2002
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L0224DD
         PLA
         TSC
         CLC
         ADC   #$005E
         TCS
         PLD
         RTL

L081CDD  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$003C
         TCS
         LDA   #$0002
         STA   $E2
         PEA   $0000
         TDC
         CLC
         ADC   #$0090
         PHA
         PEI   $FB
         PEI   $F9
         JSL   L081A3F
         PLY
         PLY
         PLY
         PLY
         STX   $E6
         STA   $E4
         PEA   $0000
         TDC
         CLC
         ADC   #$003E
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L081A3F
         PLY
         PLY
         PLY
         PLY
         STX   $EA
         STA   $E8
         PHA
         PEA   $2004
         PEA   $0000
         TDC
         CLC
         ADC   #$00E2
         PHA
         JSL   L0224DD
         PLA
         TSC
         CLC
         ADC   #$00B6
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EA
         TCS
         LDA   #$0002
         STA   $EC
         LDA   $FF
         STA   $EE
         PHA
         PEA   $2017
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L0224DD
         PLA
         LDX   $F2
         LDA   $F0
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PLD
         RTL

L081D6D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00EA
         TCS
         LDA   #$0002
         STA   $EC
         LDA   $FF
         STA   $EE
         PHA
         PEA   $2019
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         JSL   L0224DD
         PLA
         LDX   $F2
         LDA   $F0
         TAY
         TSC
         CLC
         ADC   #$000E
         TCS
         TYA
         PLD
         RTL

L081DA1  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L081DB7
         EOR   #$8000
L081DB7  BPL   L081DBE
         LDA   #$0000
         BRA   L081DC1
L081DBE  LDA   #$0001
L081DC1  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L081DCB  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E4
         TCS
         PHA
         PEA   $FFFF
         PEA   $0000
         TDC
         CLC
         ADC   #$00E6
         PHA
         _EventAvail
         BCS   L081DEF
         LDA   #$0000
L081DEF  STAL  L030002
         PLA
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         PLD
         RTL

L081DFE  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E2
         TCS
         LDA   L030200
         BEQ   L081E12
         JSL   L082D79
L081E12  PHA
         PEA   $0008
         PEA   $0000
         TDC
         CLC
         ADC   #$00E6
         PHA
         _EventAvail
         BCS   L081E2B
         LDA   #$0000
L081E2B  STAL  L030002
         PLA
         TAY
         BEQ   L081E46
         LDA   $E6
         CMP   #$0003
         BEQ   L081E3F
         LDA   #$0000
         BRA   L081E42
L081E3F  LDA   #$0001
L081E42  BRA   L081E49
         BRA   L081E49
L081E46  LDA   #$0000
L081E49  TAY
         TSC
         CLC
         ADC   #$0018
         TCS
         TYA
         PLD
         RTL

L081E53  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E0
         TCS
         LDA   L030200
         BEQ   L081E67
         JSL   L082D79
L081E67  PHA
         PEA   $0008
         PEA   $0000
         TDC
         CLC
         ADC   #$00E6
         PHA
         _GetNextEvent
         BCS   L081E80
         LDA   #$0000
L081E80  STAL  L030002
         PLA
         TAY
         BEQ   L081E9B
         PEA   $0000
         TDC
         CLC
         ADC   #$00E6
         PHA
         JSL   L070110
         PLY
         PLY
         BRA   L081EA1
         BRA   L081EA1
L081E9B  LDX   #$0000
         LDA   #$0000
L081EA1  TAY
         TSC
         CLC
         ADC   #$001A
         TCS
         TYA
         PLD
         RTL

L081EAB  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         PEI   $FF
         PEI   $FD
         PEA   $000F
         JSL   L0842BE
         PLY
         PLY
         PLY
         JSL   L0703AA
L081EC8  JSL   L081DCB
         TAY
         BNE   L081ED1
         BRA   L081EC8
L081ED1  JSL   L0703AA
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   $FF
         SEP   #$20
         STA   $F2
         REP   #$20
         LDA   #$0000
         SEP   #$20
         STA   $F3
         REP   #$20
         PEA   $0000
         TDC
         CLC
         ADC   #$00F2
         PHA
         JSL   L081EAB
         PLY
         PLY
         TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L081F10  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$0050
         TCS
         LDA   #$0001
         STA   $74
         LDA   #$0000
         STA   $76
         PHA
         PEA   $200C
         PEA   $0000
         TDC
         CLC
         ADC   #$0074
         PHA
         JSL   L0224DD
         PLA
         LDA   #$0002
         STA   $EE
         PEA   $0000
         TDC
         CLC
         ADC   #$009C
         PHA
         PEA   ^L053DC3
         PEA   L053DC3
         JSL   L081A3F
         PLY
         PLY
         PLY
         PLY
         STX   $F2
         STA   $F0
         LDA   #$0000
         STA   $F4
         PHA
         PEA   $2020
         PEA   $0000
         TDC
         CLC
         ADC   #$00EE
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         BEQ   L081F84
         PEA   ^L053DC6
         PEA   L053DC6
         LDA   L030002
         PHA
         JSL   L081796
         PLY
         PLY
         PLY
L081F84  LDA   $F4
         STA   L030140
         LDA   #$000A
         STA   $56
         LDA   L030140
         STA   $58
         LDA   #$0024
         STA   $78
         LDX   #$0000
         TDC
         CLC
         ADC   #$0078
         STX   $5C
         STA   $5A
         PHA
         PEA   $202C
         PEA   $0000
         TDC
         CLC
         ADC   #$0056
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         BEQ   L081FCC
         PEA   ^L053DE7
         PEA   L053DE7
         LDA   L030002
         PHA
         JSL   L081796
         PLY
         PLY
         PLY
L081FCC  LDA   $7A
         STAL  L053EA7
         PEA   $0000
         TDC
         CLC
         ADC   #$007C
         PHA
         PEA   ^L053EA9
         PEA   L053EA9
         JSL   L02251A+1
         PLY
         PLY
         PLY
         PLY
         LDA   $64
         CMP   #$0005
         BNE   L081FF7
         LDA   $66
         CMP   #$0001
         BEQ   L082007
L081FF7  PEA   ^L053E08
         PEA   L053E08
         PEA   $0000
         JSL   L081796
         PLY
         PLY
         PLY
L082007  LDX   #$0000
         LDA   #$C500
         STX   $54
         STA   $52
         LDY   #$0001
         LDA   [$52],Y
         AND   #$00FF
         CMP   #$0020
         BNE   L082053
         LDY   #$0003
         LDA   [$52],Y
         AND   #$00FF
         CMP   #$0000
         BNE   L082053
         LDY   #$0005
         LDA   [$52],Y
         AND   #$00FF
         CMP   #$0003
         BNE   L082053
         LDY   #$0007
         LDA   [$52],Y
         AND   #$00FF
         CMP   #$0000
         BNE   L082053
         LDY   #$00FB
         LDA   [$52],Y
         AND   #$00FF
         AND   #$0080
         TAY
         BNE   L082063
L082053  PEA   ^L053E2E
         PEA   L053E2E
         PEA   $0000
         JSL   L081796
         PLY
         PLY
         PLY
L082063  LDA   $6A
         CMP   #$0003
         BNE   L08208A
         PEA   $000B
         PEA   ^L053E5B
         PEA   L053E5B
         PEA   $0000
         TDC
         CLC
         ADC   #$007C
         PHA
         JSL   L022571
         PLY
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BNE   L08209A
L08208A  PEA   ^L053E67
         PEA   L053E67
         PEA   $0000
         JSL   L081796
         PLY
         PLY
         PLY
L08209A  LDA   L030140
         CLC
         ADC   #$0001
         STA   L030142
         LDA   #$000A
         STA   $56
         LDA   L030142
         STA   $58
         LDA   #$0024
         STA   $78
         LDX   #$0000
         TDC
         CLC
         ADC   #$0078
         STX   $5C
         STA   $5A
         PHA
         PEA   $202C
         PEA   $0000
         TDC
         CLC
         ADC   #$0056
         PHA
         JSL   L0224DD
         PLA
         LDA   $6A
         CMP   #$0003
         BNE   L0820FA
         STZ   L030144
         LDA   $7A
         STAL  L053EF9
         PEA   $0000
         TDC
         CLC
         ADC   #$007C
         PHA
         PEA   ^L053EFB
         PEA   L053EFB
         JSL   L02251A+1
         PLY
         PLY
         PLY
         PLY
         BRA   L082122
L0820FA  LDA   #$0001
         STA   L030144
         LDA   L030140
         STA   L030142
         LDAL  L053EA7
         STAL  L053EF9
         PEA   ^L053EA9
         PEA   L053EA9
         PEA   ^L053EFB
         PEA   L053EFB
         JSL   L02251A+1
         PLY
         PLY
         PLY
         PLY
L082122  LDA   #L053E87
         LDX   #^L053E87
         STX   L030152
         STA   L030150
         LDA   #L053E8F
         LDX   #^L053E8F
         STX   L030156
         STA   L030154
         TSC
         CLC
         ADC   #$00AA
         TCS
         PLD
         RTL

*
*
*

L082142  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00B2
         TCS
         LDA   L030166
         STA   $B6
         TAY
         BEQ   L08215F
         LDA   #$0001
         STA   L030166
         JSL   L0B0AC6
L08215F  LDA   #$0002
         STA   $DE
         LDA   $FF
         CMP   #$0001
         BNE   L082177
         LDA   #L053EA7
         LDX   #^L053EA7
         STX   $E2
         STA   $E0
         BRA   L082181
L082177  LDA   #L053EF9
         LDX   #^L053EF9
         STX   $E2
         STA   $E0
L082181  LDA   #$0024
         STA   $BA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00BA
         STX   $E6
         STA   $E4
         PHA
         PEA   $2008	; 
         PEA   $0000
         TDC
         CLC
         ADC   #$00DE
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         BNE   L0821AC
         BRL   L0821E4
L0821AC  LDA   L030002
         BRL   L0821CB
L0821B2  LDA   #$0003
         STA   $B8
         BRL   L0821E2
L0821BA  LDA   #$0004
         STA   $B8
         BRL   L0821E2
L0821C2  LDA   #$0002
         STA   $B8
         BRA   L0821E2
         BRA   L0821E2
L0821CB  CMP   #$0027
         BEQ   L0821B2
         CMP   #$002F
         BEQ   L0821BA
         CMP   #$004A
         BEQ   L0821B2
         CMP   #$0052
         BEQ   L0821B2
         JMP   L0821C2
L0821E2  BRA   L08222C
L0821E4  PEA   $0000
         TDC
         CLC
         ADC   #$00BE
         PHA
         PEA   ^L053E97	; :DUNGEON.MASTER
         PEA   L053E97
         JSL   L022457
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BNE   L082204
         STZ   $B8
         BRA   L08222C
L082204  PEA   $0000
         TDC
         CLC
         ADC   #$00BE
         PHA
         PEA   ^L053D83	; :DUNGEON.SAVE
         PEA   L053D83
         JSL   L022457
         PLY
         PLY
         PLY
         PLY
         CMP   #$0000
         BNE   L082227
         LDA   #$0001
         STA   $B8
         BRA   L08222C
L082227  LDA   #$0003
         STA   $B8
L08222C  LDA   $B6
         BEQ   L082239
         JSL   L0B0A80
         LDA   $B6
         STA   L030166
L082239  PEA   ^L021C62
         PEA   L021C62
         PEA   ^L071A00
         PEA   L071A00
         JSL   L074E7A
         PLY
         PLY
         PLY
         PLY
         CMP   #$C0EA
         BEQ   L082255
         BRL   L082283
L082255  PEA   ^L021DD2
         PEA   L021DD2
         PEA   ^L071A00
         PEA   L071A00
         JSL   L07503B
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L082283
         PEA   ^L021EC6
         PEA   L021EC6
         PEA   ^L071A00
         PEA   L071A00
         JSL   L074FC4
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L08228B
L082283  LDA   #$0004
         STA   L030146
         BRA   L082290
L08228B  LDA   $B8
         STA   L030146
L082290  TAY
         TSC
         CLC
         ADC   #$0046
         TCS
         TYA
         PLD
         RTL

L08229A  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$0094
         TCS
         LDA   #$0004
         STA   $E8
         LDA   #L053EF9
         LDX   #^L053EF9
         STX   $EC
         STA   $EA
         PEA   $0000
         TDC
         CLC
         ADC   #$0096
         PHA
         PEA   ^L053D83
         PEA   L053D83
         JSL   L081A3F
         PLY
         PLY
         PLY
         PLY
         STX   $F0
         STA   $EE
         LDA   #$0001
         STA   $F4
         PHA
         PEA   $2024
         PEA   $0000
         TDC
         CLC
         ADC   #$00E8
         PHA
         JSL   L0224DD
         PLA
         LDA   L030002
         BNE   L0822F1
         LDA   $F2
         CMP   $F4
         BEQ   L0822F8
L0822F1  LDA   #$0000
         BRA   L0822FB
         BRA   L0822FB
L0822F8  LDA   #$0001
L0822FB  TAY
         TSC
         CLC
         ADC   #$0066
         TCS
         TYA
         PLD
         RTL

L082305  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   $FF
         BRL   L08237D
L082315  LDA   #L053D91
         LDX   #^L053D91
         STX   L03014A
         STA   L030148
         LDA   #L053DAA
         LDX   #^L053DAA
         STX   L03014E
         STA   L03014C
         PEA   $0002
         JSL   L082142	; CHECK MASTER.DISK
         PLY
         CMP   #$0001
         BNE   L082342
         LDA   #$0001
         BRL   L08238A
         BRA   L082348
L082342  LDA   #$0000
         BRL   L08238A
L082348  BRL   L08238A
L08234B  PEA   $0002
         JSL   L082142	; CHECK MASTER.DISK
         PLY
         CMP   #$0003
         BNE   L082360
         LDA   #$0001
         BRL   L08238A
         BRA   L082366
L082360  LDA   #$0000
         BRL   L08238A
L082366  BRL   L08238A
L082369  LDA   #$0000
         BRL   L08238A
         BRL   L08238A
         BRL   L08238A
L082375  DA    L082315
         DA    L082315
         DA    L08234B
         DA    L082369
L08237D  CMP   #$0003
         BCC   L082385
         LDA   #$0003
L082385  ASL
         TAX
         JMP   (L082375,X)

L08238A  TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L082394  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00DA
         TCS
         LDA   #$0005
         STA   $E2
         LDA   $FF
         CMP   #$0001
         BNE   L0823B2
         LDA   L030140
         STA   $E4
         BRA   L0823B7
L0823B2  LDA   L030142
         STA   $E4
L0823B7  LDA   #$0002
         STA   $E6
         LDX   #$0000
         TDC
         CLC
         ADC   #$00DC
         STX   $EA
         STA   $E8
         LDX   #$0000
         LDA   #$0000
         STX   $EE
         STA   $EC
         PHA
         PEA   $202E
         PEA   $0000
         TDC
         CLC
         ADC   #$00E2
         PHA
         JSL   L0224DD
         PLA
         TSC
         CLC
         ADC   #$001E
         TCS
         PLD
         RTL

L0823EC  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0000
         TAY
         TSC
         CLC
         ADC   #$0006
         TCS
         TYA
         PLD
         RTL

L082404  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   $0001
         PEA   $0000
         PEA   $0240
         JSL   L0B006E
         PLY
         PLY
         PLY
         PHA
         TXA
         STAL  L055439
         PLA
         STAL  L055437
         PEA   $0001
         PEA   $0000
         PEA   $0240
         JSL   L0B006E
         PLY
         PLY
         PLY
         PHA
         TXA
         STAL  L05543D
         PLA
         STAL  L05543B
         PEA   $0001
         PEA   $0000
         PEA   $0240
         JSL   L0B006E
         PLY
         PLY
         PLY
         PHA
         TXA
         STAL  L055441
         PLA
         STAL  L05543F
         PEA   $0001
         PEA   $0000
         PEA   $0240
         JSL   L0B006E
         PLY
         PLY
         PLY
         PHA
         TXA
         STAL  L055445
         PLA
         STAL  L055443
         PEA   $0001
         PEA   $0000
         PEA   $02BC
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L030244
         STA   L030242
         PEA   $0001
         PEA   $0000
         PEA   $02BC
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L030248
         STA   L030246
         PEA   $0001
         PEA   $0000
         PEA   $02BC
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L03022E
         STA   L03022C
         PEA   $0001
         PEA   $0000
         PEA   $02BC
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L030232
         STA   L030230
         PEA   $0001
         PEA   $0000
         PEA   $02BC
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L030236
         STA   L030234
         PEA   $0001
         PEA   $0000
         PEA   $02BC
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L03023A
         STA   L030238
         PEA   $0001
         PEA   $0000
         PEA   $02BC
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   L03023E
         STA   L03023C
         LDX   L03022E
         LDA   L03022C
         PHX
         PHA
         PEA   $0001
         PEA   $0001
         PEA   ^L058642
         PEA   L058642
         PEA   ^L058600
         PEA   L058600
         PEA   $0003
         PEA   $000B
         JSL   L082D95
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         LDX   L030232
         LDA   L030230
         PHX
         PHA
         PEA   $0000
         PEA   $0000
         PEA   ^L058704
         PEA   L058704
         PEA   ^L058684
         PEA   L058684
         PEA   $0004
         PEA   $0010
         JSL   L082D95
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         LDA   #$0001
         STA   L030202
         PEA   $0000
         JSL   L082634
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L082583  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   #$0000
         PHA
         PHA
         PHA
         _ReadMouse
         PLA
         PLY
         PLX
         PHX
         PHX
         PHY
         PHY
         _ClampMouse
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L0825B1  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0000
         PHA
         PHA
         PHA
         _ReadMouse
         PLA
         PLA
         PLA
         STA   $F4
         LDA   $F4
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L0825DA  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0000
         PHA
         PHA
         PHA
         _ReadMouse
         PLA
         PLA
         STA   $F4
         PLA
         LDA   $F4
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L082603  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   #$0000
         PHA
         PHA
         PHA
         _ReadMouse
         PLA
         AND   #$8000
         BEQ   L082624
         LDA   #$FFFF
L082624  STA   $F4
         PLA
         PLA
         LDA   $F4
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L082634  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         JSL   L082EE5
         STZ   L03021E
         LDA   $FF
         CMP   #$0001
         BEQ   L082652
         LDA   #$0000
         BRA   L082655
L082652  LDA   #$0001
L082655  STA   L030220
         LDA   #$0001
         STA   L0301FC
L08265E  LDA   L0301FC
         BEQ   L082665
         BRA   L08265E
L082665  JSL   L082F35
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L082671  ENT
         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E8
         TCS
         LDA   #$0001
         STA   L03012C
         LDAL  L055439
         TAX
         LDAL  L055437
         STX   $EC
         STA   $EA
         PEA   $0024
         PEA   $000C
         PEI   $EC
         PEI   $EA
         JSL   L080CE0
         PLY
         PLY
         PLY
         PLY
         PEA   ^L058784
         PEA   L058784
         PEA   $0010
         PEA   $0010
         PEA   $0010
         PEA   $0010
         LDX   L030248
         LDA   L030246
         PHX
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         LDA   #$0002
         SEP   #$20
         STA   $F0
         REP   #$20
         SEP   #$20
         STA   $EE
         REP   #$20
         LDA   #$0011
         SEP   #$20
         STA   $F1
         REP   #$20
         SEP   #$20
         STA   $EF
         REP   #$20
         PEA   $FFFF
         PEA   $0010
         PEA   $0008
         PEA   $0000
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00EE
         PHA
         PEI   $EC
         PEI   $EA
         LDX   L030248
         LDA   L030246
         PHX
         PHA
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         PEA   $0120
         LDAL  L05543D
         TAX
         LDAL  L05543B
         PHX
         PHA
         PEI   $EC
         PEI   $EA
         JSL   L0202AB
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   ^L058794
         PEA   L058794
         PEA   $0010
         PEA   $0010
         PEA   $0010
         PEA   $0010
         LDX   L030248
         LDA   L030246
         PHX
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         LDA   #$0000
         SEP   #$20
         STA   $F0
         REP   #$20
         SEP   #$20
         STA   $EE
         REP   #$20
         LDA   #$000F
         SEP   #$20
         STA   $F1
         REP   #$20
         SEP   #$20
         STA   $EF
         REP   #$20
         PEA   $000C
         PEA   $0010
         PEA   $0008
         PEA   $0000
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00EE
         PHA
         PEI   $EC
         PEI   $EA
         LDX   L030248
         LDA   L030246
         PHX
         PHA
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         PEA   ^L0587A4
         PEA   L0587A4
         PEA   $0012
         PEA   $0020
         PEA   $0012
         PEA   $0020
         LDX   $EC
         LDA   $EA
         CLC
         ADC   #$0120
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEI   $EC
         PEI   $EA
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PEA   ^L0587B4
         PEA   L0587B4
         PEA   $0012
         PEA   $0020
         PEA   $0012
         PEA   $0020
         PEI   $EC
         PEI   $EA
         PEI   $EC
         PEI   $EA
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         LDX   L03023A
         LDA   L030238
         PHX
         PHA
         PEA   $0009
         PEA   $0009
         LDX   $EC
         LDA   $EA
         CLC
         ADC   #$0120
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEI   $EC
         PEI   $EA
         PEA   $0008
         PEA   $0012
         JSL   L082D95
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         LDA   #$0000
         SEP   #$20
         STA   $F0
         REP   #$20
         SEP   #$20
         STA   $EE
         REP   #$20
         LDA   #$000F
         SEP   #$20
         STA   $F1
         REP   #$20
         SEP   #$20
         STA   $EF
         REP   #$20
         PEA   $000C
         PEA   $0010
         PEA   $0008
         PEA   $0000
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00EE
         PHA
         LDAL  L05543D
         TAX
         LDAL  L05543B
         PHX
         PHA
         PEI   $FF
         PEI   $FD
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         LDAL  L05543D
         TAX
         LDAL  L05543B
         STX   $EC
         STA   $EA
         PEA   ^L0587C4
         PEA   L0587C4
         PEA   $0012
         PEA   $0020
         PEA   $0012
         PEA   $0020
         LDX   $EC
         LDA   $EA
         CLC
         ADC   #$0120
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEI   $EC
         PEI   $EA
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PEA   ^L0587B4
         PEA   L0587B4
         PEA   $0012
         PEA   $0020
         PEA   $0012
         PEA   $0020
         PEI   $EC
         PEI   $EA
         PEI   $EC
         PEI   $EA
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         LDX   L030236
         LDA   L030234
         PHX
         PHA
         PEA   $0009
         PEA   $0009
         LDX   $EC
         LDA   $EA
         CLC
         ADC   #$0120
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEI   $EC
         PEI   $EA
         PEA   $0008
         PEA   $0012
         JSL   L082D95
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         JSL   L082EE5
         LDA   #$0001
         STA   L03021E
         STZ   L030220
         LDA   #$0001
         STA   L0301FC
L082939  LDA   L0301FC
         BEQ   L082940
         BRA   L082939
L082940  JSL   L082F35
         TSC
         CLC
         ADC   #$000E
         TCS
         PLD
         RTL

L08294C  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L030254
         BEQ   L082974
         LDA   L03024E
         CMP   #$FFFF
         BNE   L082969
         LDA   #$0000
         BRA   L08296C
L082969  LDA   #$0001
L08296C  PHA
         JSL   L082634
         PLY
         BRA   L082985
L082974  LDAL  L056307
         TAX
         LDAL  L056305
         PHX
         PHA
         JSL   L082671
         PLY
         PLY
L082985  TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L08298D  ENT
         PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E4
         TCS
         LDA   L03021C
         BEQ   L0829A0
         BRL   L082BBF
L0829A0  LDA   $FF
         CLC
         ADC   L030044
         AND   #$0003
         PHA
         JSL   L0A34BE
         PLY
         CMP   #$FFFF
         BNE   L0829B7
         BRL   L082D6F
L0829B7  JSL   L082EE5
         STZ   L03012C
         LDAL  L055441
         TAX
         LDAL  L05543F
         STX   $E8
         STA   $E6
         PEA   $0024
         PEA   $000C
         PEI   $E8
         PEI   $E6
         JSL   L080CE0
         PLY
         PLY
         PLY
         PLY
         PEA   $0120
         PEA   $000C
         LDX   L030244
         LDA   L030242
         PHX
         PHA
         JSL   L080CE0
         PLY
         PLY
         PLY
         PLY
         LDA   $FF
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0587FC
         LDX   #^L0587FC
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
         PEA   $0000
         PEA   $0010
         PEA   $00A0
         LDY   #$0004
         LDA   [$EA],Y
         PHA
         LDA   [$EA]
         PHA
         PEA   ^L05542F
         PEA   L05542F
         LDX   L030244
         LDA   L030242
         PHX
         PHA
         LDX   L03002A
         LDA   L030028
         PHX
         PHA
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         PEA   ^L058784
         PEA   L058784
         PEA   $0010
         PEA   $0020
         PEA   $0010
         PEA   $0020
         LDX   L030248
         LDA   L030246
         PHX
         PHA
         LDX   L030244
         LDA   L030242
         PHX
         PHA
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PEA   $FFFF
         PEA   $0010
         PEA   $0010
         PEA   $0000
         PEA   $0000
         PEA   ^L055427
         PEA   L055427
         PEI   $E8
         PEI   $E6
         LDX   L030248
         LDA   L030246
         PHX
         PHA
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         PEA   $0120
         LDAL  L055445
         TAX
         LDAL  L055443
         PHX
         PHA
         PEI   $E8
         PEI   $E6
         JSL   L0202AB
         PLY
         PLY
         PLY
         PLY
         PLY
         PEA   $000C
         PEA   $0010
         PEA   $0010
         PEA   $0000
         PEA   $0000
         PEA   ^L05542F
         PEA   L05542F
         LDAL  L055445
         TAX
         LDAL  L055443
         PHX
         PHA
         LDX   L030244
         LDA   L030242
         PHX
         PHA
         JSL   L0807BE
         TAY
         TSC
         CLC
         ADC   #$0016
         TCS
         TYA
         LDAL  L055445
         TAX
         LDAL  L055443
         STX   $E8
         STA   $E6
         PEA   ^L0587C4
         PEA   L0587C4
         PEA   $0010
         PEA   $0020
         PEA   $0010
         PEA   $0020
         LDX   $E8
         LDA   $E6
         CLC
         ADC   #$0120
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEI   $E8
         PEI   $E6
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PEA   ^L0587B4
         PEA   L0587B4
         PEA   $0010
         PEA   $0020
         PEA   $0010
         PEA   $0020
         PEI   $E8
         PEI   $E6
         PEI   $E8
         PEI   $E6
         JSL   L080421
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         LDX   L03023E
         LDA   L03023C
         PHX
         PHA
         PEA   $0007
         PEA   $0009
         LDX   $E8
         LDA   $E6
         CLC
         ADC   #$0120
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         PEI   $E8
         PEI   $E6
         PEA   $0008
         PEA   $0010
         JSL   L082D95
         TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PEA   $0000
         PEI   $EC
         PEI   $EA
         JSL   L080D34
         PLY
         PLY
         PLY
         LDA   $FF
         STA   L030240
         LDA   $FF
         CLC
         ADC   #$0001
         STA   L03021C
         LDA   #$0001
         STA   L0301FC
L082BA8  LDA   L0301FC
         BEQ   L082BAF
         BRA   L082BA8
L082BAF  JSL   L082F35
         LDA   L030200
         BEQ   L082BBC
         JSL   L082D79
L082BBC  BRL   L082D6F
L082BBF  LDA   L03021C
         SEC
         SBC   #$0001
         STA   $F2
         STZ   L03021C
         STZ   L030200
         LDA   #$0001
         STA   L0301FC
         LDA   $F2
         CLC
         ADC   L030044
         AND   #$0003
         PHA
         JSL   L0A34BE
         PLY
         STA   $EE
         LDA   L030044
         PHA
         LDA   $EE
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         LDY   #$001C
         STA   [$F4],Y
         REP   #$20
         LDA   $F2
         CMP   $FF
         BNE   L082C52
         LDA   $EE
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0030
         LDA   [$F4],Y
         ORA   #$0400
         LDY   #$0030
         STA   [$F4],Y
         PEI   $EE
         JSL   L0A3E20
         PLY
         BRL   L082D6F
L082C52  LDA   $FF
         CLC
         ADC   L030044
         AND   #$0003
         PHA
         JSL   L0A34BE
         PLY
         STA   $F0
         JSL   L082EE5
         LDA   $F0
         SEC
         SBC   #$0000
         BVS   L082C72
         EOR   #$8000
L082C72  BMI   L082C77
         BRL   L082CE3
L082C77  LDA   $F2
         CLC
         ADC   L030044
         AND   #$0003
         PHA
         LDA   $F0
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         LDY   #$001D
         STA   [$F4],Y
         REP   #$20
         LDA   $F0
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0030
         LDA   [$F4],Y
         ORA   #$0400
         LDY   #$0030
         STA   [$F4],Y
         PEI   $F0
         JSL   L0A3E20
         PLY
         BRA   L082D01
L082CE3  PEA   $0000
         LDA   $F2
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L0587FC
         LDX   #^L0587FC
         JSL   L021F00
         JSL   L080D34
         PLY
         PLY
         PLY
L082D01  LDA   $FF
         CLC
         ADC   L030044
         AND   #$0003
         PHA
         LDA   $EE
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         LDY   #$001D
         STA   [$F4],Y
         REP   #$20
         LDA   $EE
         PHA
         LDA   #$031F
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L0554D4
         LDX   #^L0554D4
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0030
         LDA   [$F4],Y
         ORA   #$0400
         LDY   #$0030
         STA   [$F4],Y
         PEI   $EE
         JSL   L0A3E20
         PLY
         JSL   L082F35
L082D6F  TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PLD
         RTL

L082D79  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L030240
         PHA
         JSL   L08298D
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L082D95  PHD
         TSC
         SEC
         SBC   #$00E7
         TCD
         ADC   #$00DA
         TCS
         LDA   $EF
         PHA
         LDA   $ED
         CLC
         JSL   L0220A5
         LDA   $ED
         PLX
         STX   $E6
         CLC
         ADC   $E6
         STA   $E0
         LDA   $ED
         STA   [$FD]
         LDA   $EF
         CLC
         ADC   #$0001
         LDY   #$0002
         STA   [$FD],Y
         STZ   $DC
L082DC5  LDA   $EF
         STA   $DE
L082DC9  LDA   [$F1]
         PHA
         LDA   #$0002
         CLC
         ADC   $DC
         LDX   #$0000
         STX   $E6
         ASL
         ROL   $E6
         LDX   $E6
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         PLA
         STA   [$E2]
         LDA   $F1
         CLC
         ADC   #$0002
         STA   $F1
         BCC   L082DFB
         INC   $F3
L082DFB  LDA   [$F5]
         PHA
         LDA   #$0002
         CLC
         ADC   $E0
         CLC
         ADC   $DC
         LDX   #$0000
         STX   $E6
         ASL
         ROL   $E6
         LDX   $E6
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         PLA
         STA   [$E2]
         LDA   $F5
         CLC
         ADC   #$0002
         STA   $F5
         BCC   L082E30
         INC   $F7
L082E30  INC   $DC
         DEC   $DE
         LDA   $DE
         BNE   L082DC9
         LDA   #$0002
         CLC
         ADC   $DC
         LDX   #$0000
         STX   $E6
         ASL
         ROL   $E6
         LDX   $E6
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         LDA   #$0000
         STA   [$E2]
         LDA   #$0002
         CLC
         ADC   $E0
         CLC
         ADC   $DC
         LDX   #$0000
         STX   $E6
         ASL
         ROL   $E6
         LDX   $E6
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         LDA   #$0000
         STA   [$E2]
         INC   $DC
         DEC   $ED
         LDA   $ED
         BEQ   L082E90
         BRL   L082DC5
L082E90  LDA   $E0
         ASL
         STA   $E0
         LDA   #$0002
         CLC
         ADC   $E0
         LDX   #$0000
         STX   $E6
         ASL
         ROL   $E6
         LDX   $E6
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         LDA   $F9
         STA   [$E2]
         LDA   #$0003
         CLC
         ADC   $E0
         LDX   #$0000
         STX   $E6
         ASL
         ROL   $E6
         LDX   $E6
         PHX
         PHA
         LDX   $FF
         LDA   $FD
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         LDA   $FB
         STA   [$E2]
         TSC
         CLC
         ADC   #$000C
         TCS
         PLD
         RTL

L082EE5  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L0301FA
         PHA
         INC
         STA   L0301FA
         PLA
         CMP   #$0000
         BNE   L082F10
         PHA
         _HideCursor
         BCS   L082F0B
         LDA   #$0000
L082F0B  STAL  L030002
         PLA
L082F10  LDA   L0301EA
         CMP   #$31E9
         BEQ   L082F2D
         PEA   ^L050036
         PEA   L050036
         JSL   L0A810B
         PLY
         PLY
         TAY
         BNE   L082F2D
         LDA   #$0459
         STA   L030272
L082F2D  TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L082F35  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         LDA   L0301FA
         PHA
         DEC
         STA   L0301FA
         PLA
         CMP   #$0001
         BNE   L082F60
         PHA
         _ShowCursor
         BCS   L082F5B
         LDA   #$0000
L082F5B  STAL  L030002
         PLA
L082F60  TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L082F68  ENT
         REP   #$30
         LDAL  $E100FF
         AND   #$00FF
         BEQ   L082F86
         PHA
         LDA   #^L082F91
         PHA
         LDA   #L082F91
         PHA
         _SchAddTask
         PLA
         BRA   L082F8A
L082F86  JSL   L082F91
L082F8A  SEP   #$30
         STA   $C047
         CLC
         RTL

L082F91  SEP   #$30       ; Get the mouse!
         LDA   $047C
         STAL  L03024A
         LDA   $057C
         STAL  L03024B
         LDA   $04FC
         STAL  L03024C
         LDA   $05FC
         STAL  L03024D
         REP   #$30
         LDAL  L03021C
         BEQ   L082FDC
         LDAL  L030200
         BNE   L082FDC
         LDAL  L03024A
         CMP   #$0112
         BCC   L082FD5
         LDAL  L03024C
         CMP   #$001C
         BCS   L082FD5
         LDA   #$0004
         BRL   L08303C
L082FD5  LDA   #$0001
         STAL  L030200
L082FDC  LDAL  L03021E
         BEQ   L083011
         LDAL  L03024A
         CMP   #$0112
         BCS   L082FFA
         LDAL  L03024C
         CMP   #$001F
         BCS   L082FFA
         LDA   #$0002
         BRL   L08303C
L082FFA  LDAL  L03024A
         CMP   #$00DF
         BCS   L083011
         LDAL  L03024C
         CMP   #$001F
         BCC   L083011
         LDA   #$0003
         BRA   L08303C
L083011  LDAL  L030220
         BEQ   L083039
         LDAL  L03024C
         CMP   #$001F
         BCS   L08302B
         LDAL  L03024A
         CMP   #$0112
         BCC   L083034
         BCS   L083039
L08302B  LDAL  L03024A
         CMP   #$00DF
         BCS   L083039
L083034  LDA   #$0001
         BRA   L08303C
L083039  LDA   #$0000
L08303C  PHA
         LDAL  L0301FC
         BEQ   L08304D
         LDA   #$0000
         STAL  L0301FC
         PLA
         BRA   L083057
L08304D  PLA
         CMPL  L03022A
         BNE   L083057
         BRL   L0830C0
L083057  STAL  L03022A
         LDAL  L030202
         BNE   L083064
         BRL   L0830C0
L083064  LDAL  L03022A
         CMP   #$0000
         BNE   L083079
         LDAL  L03022E
         PHA
         LDAL  L03022C
         BRL   L0830B8
L083079  CMP   #$0001
         BNE   L08308A
         LDAL  L030232
         PHA
         LDAL  L030230
         BRL   L0830B8
L08308A  CMP   #$0002
         BNE   L08309A
         LDAL  L030236
         PHA
         LDAL  L030234
         BRA   L0830B8
L08309A  CMP   #$0003
         BNE   L0830AA
         LDAL  L03023A
         PHA
         LDAL  L030238
         BRA   L0830B8
L0830AA  CMP   #$0004
         BNE   L0830C0
         LDAL  L03023E
         PHA
         LDAL  L03023C
L0830B8  PHA
         _SetCursor
L0830C0  RTL

L0830C1  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         SEP   #$30
         LDX   $FF
         LDAL  L0578E7,X
         STA   $F2
         STZ   $F3
         REP   #$30
         LDA   $F2
         TAY
         TSC
         CLC
         ADC   #$0008
         TCS
         TYA
         PLD
         RTL

L0830E6  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         SEP   #$30
         LDX   $FF
         LDA   $FD
         STAL  L0578E7,X
         REP   #$30
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L083105  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F2
         TCS
         SEP   #$30
         LDX   $FF
         LDA   #$FF
         STAL  L0578E7,X
         REP   #$30
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L083124  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00F0
         TCS
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A09
         LDX   #^L057A09
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BVS   L083152
         EOR   #$8000
L083152  BMI   L083157
         BRL   L0831FE
L083157  SEP   #$30
L083159  LDA   $C03C
         BMI   L083159
         STZ   $C03C
         LDX   $FF
         CLC
         LDA   #$A0
         ADCL  L0579E7,X
         STA   $C03E
         LDA   #$01
         STA   $C03D
         STA   $C03D
         REP   #$30
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A09
         LDX   #^L057A09
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $F2
         BRA   L08319E
L083195  PEI   $F2
         JSL   L083105
         PLY
         INC   $F2
L08319E  LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A4D
         LDX   #^L057A4D
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A09
         LDX   #^L057A09
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         PLX
         STX   $F8
         CLC
         ADC   $F8
         CMP   $F2
         BEQ   L0831E1
         BCS   L083195
L0831E1  LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A09
         LDX   #^L057A09
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   #$FFFF
         STA   [$F4]
L0831FE  TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L083206  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E0
         TCS
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A09
         LDX   #^L057A09
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0000
         BVS   L083234
         EOR   #$8000
L083234  BPL   L08323C
         LDA   #$0000
         BRL   L08351F
L08323C  LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057B19
         LDX   #^L057B19
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         STA   $E6
         LDA   $E6
         CMP   #$0100
         BEQ   L083261
         BCS   L083266
L083261  STZ   $F2
         BRL   L0832CC
L083266  LDA   $E6
         CMP   #$0200
         BEQ   L08326F
         BCS   L083277
L08326F  LDA   #$0001
         STA   $F2
         BRL   L0832CC
L083277  LDA   $E6
         CMP   #$0400
         BEQ   L083280
         BCS   L083287
L083280  LDA   #$0002
         STA   $F2
         BRA   L0832CC
L083287  LDA   $E6
         CMP   #$0800
         BEQ   L083290
         BCS   L083297
L083290  LDA   #$0003
         STA   $F2
         BRA   L0832CC
L083297  LDA   $E6
         CMP   #$1000
         BEQ   L0832A0
         BCS   L0832A7
L0832A0  LDA   #$0004
         STA   $F2
         BRA   L0832CC
L0832A7  LDA   $E6
         CMP   #$2000
         BEQ   L0832B0
         BCS   L0832B7
L0832B0  LDA   #$0005
         STA   $F2
         BRA   L0832CC
L0832B7  LDA   $E6
         CMP   #$4000
         BEQ   L0832C0
         BCS   L0832C7
L0832C0  LDA   #$0006
         STA   $F2
         BRA   L0832CC
L0832C7  LDA   #$0007
         STA   $F2
L0832CC  LDA   $E6
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         LSR
         STA   $F0
         LDA   $E6
         AND   #$00FF
         TAY
         BEQ   L0832E2
         INC   $F0
L0832E2  STZ   $EE
L0832E4  LDA   $EE
         CMP   #$0100
         BCC   L0832EE
         BRL   L08340B
L0832EE  PEI   $EE
         JSL   L0830C1
         PLY
         CMP   #$00FF
         BEQ   L083324
         LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   #L0578DF
         LDX   #^L0578DF
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $EE
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $EE
         BRL   L083408
L083324  STZ   $EA
         LDA   $EE
         STA   $EC
         BRA   L08333E
L08332C  PEI   $EC
         JSL   L0830C1
         PLY
         CMP   #$00FF
         BEQ   L08333C
         INC   $EA
         BRA   L083349
L08333C  INC   $EC
L08333E  LDA   $EE
         CLC
         ADC   $F0
         CMP   $EC
         BEQ   L083349
         BCS   L08332C
L083349  LDA   $EA
         CMP   #$0000
         BEQ   L083353
         BRL   L0833E1
L083353  LDA   $EE
         STA   $EC
         BRA   L083365
L083359  PEI   $EC
         PEI   $FF
         JSL   L0830E6
         PLY
         PLY
         INC   $EC
L083365  LDA   $EE
         CLC
         ADC   $F0
         CMP   $EC
         BEQ   L083370
         BCS   L083359
L083370  LDA   $F0
         PHA
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A4D
         LDX   #^L057A4D
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A09
         LDX   #^L057A09
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   $EE
         STA   [$F4]
         LDA   $F2
         ASL
         ASL
         ASL
         PHA
         LDA   $F2
         PLX
         STX   $F8
         ORA   $F8
         PHA
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A6F
         LDX   #^L057A6F
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         PLA
         SEP   #$20
         STA   [$F4]
         REP   #$20
         LDA   #$0001
         BRL   L08351F
         BRA   L083408
L0833E1  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   #L0578DF
         LDX   #^L0578DF
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $EE
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $EE
L083408  BRL   L0832E4
L08340B  LDA   #$0000
         STA   $EE
         STA   $EC
         PEA   $0000
         JSL   L0830C1
         PLY
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057B5D
         LDX   #^L057B5D
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STX   $E4
         STA   $E2
L08343D  LDA   $EE
         CMP   #$0100
         BCC   L083447
         BRL   L0834EC
L083447  PEI   $EE
         JSL   L0830C1
         PLY
         STA   $EA
         CMP   #$00FF
         BNE   L083458
         BRL   L0834BC
L083458  LDX   $E4
         LDA   $E2
         PHX
         PHA
         LDA   $EA
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057B5D
         LDX   #^L057B5D
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         JSL   L022171
         BEQ   L0834BA
         BVS   L08348A
         EOR   #$8000
L08348A  BPL   L0834BA
         LDA   $EE
         STA   $EC
         PEI   $EE
         JSL   L0830C1
         PLY
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057B5D
         LDX   #^L057B5D
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STX   $E4
         STA   $E2
L0834BA  BRA   L0834C2
L0834BC  LDA   $EE
         STA   $EC
         BRA   L0834EC
L0834C2  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   #L0578DF
         LDX   #^L0578DF
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         AND   #$00FF
         PHA
         LDA   $EE
         PLX
         STX   $F8
         CLC
         ADC   $F8
         STA   $EE
         BRL   L08343D
L0834EC  LDA   $EC
         STA   $EA
         BRA   L08350D
L0834F2  PEI   $EA
         JSL   L0830C1
         PLY
         CMP   #$00FF
         BEQ   L08350B
         PEI   $EA
         JSL   L0830C1
         PLY
         PHA
         JSL   L083124
         PLY
L08350B  INC   $EA
L08350D  LDA   $EC
         CLC
         ADC   $F0
         CMP   $EA
         BEQ   L083518
         BCS   L0834F2
L083518  LDA   $EC
         STA   $EE
         BRL   L0832E4
L08351F  TAY
         TSC
         CLC
         ADC   #$0018
         TCS
         TYA
         PLD
         RTL

L083529  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         STZ   $F4
         BRL   L083621
L083539  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A09
         LDX   #^L057A09
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$FFFF
         STA   [$F6]
         LDA   $F4
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05885F
         LDX   #^L05885F
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         STA   $F2
         PEA   $0001
         LDA   $F2
         LDX   #$0000
         STX   $FA
         ASL
         ROL   $FA
         LDX   $FA
         PHX
         PHA
         LDX   L030170
         LDA   L03016E
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         LDX   #$0000
         PHX
         PHA
         JSL   L0B006E
         PLY
         PLY
         PLY
         STX   $EE
         STA   $EC
         PEA   $0000
         PEA   $0000
         PEI   $EE
         PEI   $EC
         LDA   $F2
         ORA   #$8000
         PHA
         JSL   L0B2447
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   [$EC]
         XBA
         CLC
         ADC   #$0001
         STA   $F0
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057B19
         LDX   #^L057B19
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   $F0
         STA   [$F6]
         LDX   $EE
         LDA   $EC
         CLC
         ADC   #$0002
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         STX   $EE
         STA   $EC
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A91
         LDX   #^L057A91
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDX   $EE
         LDA   $EC
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
         INC   $F4
L083621  LDA   $F4
         CMP   #$0022
         BCS   L08362B
         BRL   L083539
L08362B  STZ   $F2
         BRA   L083651
L08362F  LDA   $F2
         LDX   #$0000
         PHX
         PHA
         LDA   #L0578E7
         LDX   #^L0578E7
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$00FF
         SEP   #$20
         STA   [$F6]
         REP   #$20
         INC   $F2
L083651  LDA   $F2
         CMP   #$0100
         BCC   L08362F
         SEP   #$30
L08365A  LDA   $C03C
         BMI   L08365A
         STZ   $C03C
         LDA   #$E1
         STA   $C03E
         LDA   #$FF
         STA   $C03D
         REP   #$30
         TSC
         CLC
         ADC   #$0010
         TCS
         PLD
         RTL

L083676  PHD
         TSC
         SEC
         SBC   #$00F9
         TCD
         ADC   #$00E4
         TCS
         LDA   $FF
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057A91
         LDX   #^L057A91
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDY   #$0002
         LDA   [$F4],Y
         TAX
         LDA   [$F4]
         STX   $E8
         STA   $E6
         LDA   $FF
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057B19
         LDX   #^L057B19
         JSL   L021F00
         PLA
         PLX
         STA   $F4
         STX   $F6
         LDA   [$F4]
         SEC
         SBC   #$0001
         STA   $F0
         PEI   $FF
         JSL   L083206
         PLY
         CMP   #$0000
         BNE   L0836D4
         BRA   L08370C
L0836D4  SEP   #$30
L0836D6  LDA   $C03C
         BMI   L0836D6
         LDA   #$60
         STA   $C03C
         LDA   $FF
         ASL
         TAX
         LDAL  L057A09,X
         STA   $C03F
         STZ   $C03E
L0836EE  LDA   [$E6]
         CLC
         ADC   #$80
         BNE   L0836F6
         INC
L0836F6  STA   $C03D
         REP   #$30
         INC   $E6
         BNE   L083701
         INC   $E8
L083701  DEC   $F0
         SEP   #$30
         BNE   L0836EE
         STZ   $C03D
         REP   #$30
L08370C  TAY
         TSC
         CLC
         ADC   #$0014
         TCS
         TYA
         PLD
         RTL

L083716  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EA
         TCS
         LDA   L030331
         BEQ   L08372C
         BRL   L083909
         BRL   L0837C4
L08372C  LDA   L03032F
         INC
         STA   L03032F
         CMP   #$00C8
         BCS   L08373B
         BRL   L0837C4
L08373B  STZ   L03032F
         PEA   ^L021AF6
         PEA   L021AF6
         PEA   ^L021522
         PEA   L021522
         JSL   L074F1C
         PLY
         PLY
         PLY
         PLY
         CMP   #$EEDA
         BEQ   L08375A
         BRL   L0837BE
L08375A  PEA   ^L021B64
         PEA   L021B64
         PEA   ^L02176B
         PEA   L02176B
         JSL   L074F1C
         PLY
         PLY
         PLY
         PLY
         CMP   #$5828
         BEQ   L083776
         BRL   L0837BE
L083776  PEA   ^L021BF0
         PEA   L021BF0
         PEA   ^L02176B
         PEA   L02176B
         JSL   L07503B
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L083790
         BRL   L0837BE
L083790  PEA   ^L021B32
         PEA   L021B32
         PEA   ^L021522
         PEA   L021522
         JSL   L074FC4
         PLY
         PLY
         PLY
         PLY
         TAY
         BEQ   L0837BE
         PEA   ^L021C14
         PEA   L021C14
         PEA   ^L02176B
         PEA   L02176B
         JSL   L074FC4
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L0837C4
L0837BE  LDA   #$0001
         STA   L030331
L0837C4  PEI   $FB
         JSL   L083676
         PLY
         LDX   L03032D
         LDA   L03032B
         CLC
         ADC   #$0001
         STA   L03032B
         PHA
         LDA   L03032D
         BCC   L0837DF
         INC
L0837DF  TAX
         STA   L03032D
         PLA
         PHX
         PHA
         LDA   $FB
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057B5D
         LDX   #^L057B5D
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F0],Y
         PLA
         STA   [$F0]
         LDA   L030333
         PHA
         LDA   #$000F
         PHA
         LDA   $FF
         AND   #$00FF
         SEC
         JSL   L021F1A
         PLY
         SEC
         JSL   L0220A5
         PLA
         SEP   #$20
         STA   $ED
         REP   #$20
         LDA   L030333
         PHA
         LDA   #$000F
         PHA
         LDX   #$0100
         LDA   $00,X
         AND   #$00FF
         SEC
         JSL   L021F1A
         PLY
         SEC
         JSL   L0220A5
         PLA
         SEP   #$20
         STA   $EC
         REP   #$20
         SEP   #$30
L08384E  LDA   $C03C
         BMI   L08384E
         LDA   #$20
         STA   $C03C
         LDAL  L03032A
         TAX
         INC
         CMP   #$0F
         BCC   L083864
         LDA   #$00
L083864  STAL  L03032A
         TXA
         ASL
         STA   $EF
         LDX   #$00
L08386E  LDAL  L0579E7,X
         CMP   $EF
         BNE   L08387C
         LDA   #$FF
         STAL  L0579E7,X
L08387C  INX
         CPX   #$22
         BCC   L08386E
         LDX   $FB
         LDA   $EF
         STAL  L0579E7,X
         CLC
         LDA   #$A0
         ADC   $EF
         STA   $C03E
         LDA   #$01
         STA   $C03D
         STA   $C03D
         CLC
         LDA   #$80
         ADC   $EF
         STA   $C03E
         PHX
         LDA   $FB
         ASL
         TAX
         LDAL  L057A09,X
         STA   $C03D
         STA   $C03D
         PLX
         CLC
         LDA   #$C0
         ADC   $EF
         STA   $C03E
         LDAL  L057A6F,X
         STA   $C03D
         STA   $C03D
         CLC
         LDA   #$40
         ADC   $EF
         STA   $C03E
         LDA   $ED
         STA   $C03D
         LDA   $EC
         STA   $C03D
         CLC
         LDA   #$00
         ADC   $EF
         STA   $C03E
         LDA   $FD
         STA   $C03D
         STA   $C03D
         CLC
         LDA   #$20
         ADC   $EF
         STA   $C03E
         LDA   $FE
         STA   $C03D
         STA   $C03D
         CLC
         LDA   #$A0
         ADC   $EF
         STA   $C03E
         LDA   #$02
         STA   $C03D
         LDA   #$12
         STA   $C03D
         REP   #$30
L083909  TAY
         TSC
         CLC
         ADC   #$000A
         TCS
         TYA
         PLD
         RTL

L083913  ENT
         PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00D4
         TCS
         LDA   $FF
         BEQ   L08392D
         LDA   L03008A
         CMP   L030046
         BEQ   L08392D
         BRL   L083AC5
L08392D  LDA   $F9
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05885F
         LDX   #^L05885F
         JSL   L021F00
         PLA
         PLX
         STX   $EC
         STA   $EA
         LDA   $FF
         CMP   #$0001
         BEQ   L0839C9
         BCC   L0839C9
         LDX   #$0000
         LDA   #$0018
         PHX
         PHA
         LDA   L03008A
         LDX   #$0000
         TAY
         BPL   L083962
         DEX
L083962  SEC
         JSL   L0222B8
         LDA   $FF
         LDX   #$0000
         PHX
         PHA
         LDX   L030050
         LDA   L03004E
         JSL   L021F00
         PLA
         PLX
         SEC
         SBC   #$0001
         PHA
         TXA
         SBC   #$0000
         TAX
         PLA
         JSL   L021F9F
         PLA
         PLX
         STX   $DC
         STA   $DA
         LDA   #$0014
         SEP   #$20
         STA   $DE
         REP   #$20
         LDY   #$0004
         LDA   [$EA],Y
         SEP   #$20
         STA   $DF
         REP   #$20
         LDA   $F9
         STA   $E2
         LDA   $FB
         SEP   #$20
         STA   $E0
         REP   #$20
         LDA   $FD
         SEP   #$20
         STA   $E1
         REP   #$20
         PEA   $0000
         TDC
         CLC
         ADC   #$00DA
         PHA
         JSL   L044ED1
         PLY
         PLY
         BRL   L083AC5
L0839C9  PEA   $0000
         TDC
         CLC
         ADC   #$00D6
         PHA
         PEI   $FD
         PEI   $FB
         JSL   L083BE6
         PLY
         PLY
         PLY
         PLY
         TAY
         BNE   L0839E4
         BRL   L083AC5
L0839E4  LDA   $FF
         BNE   L083A1F
         LDX   #$0000
         TDC
         CLC
         ADC   #$00D6
         TAY
         TSC
         SEC
         SBC   #$0002
         TCS
         PHX
         PHY
         PEA   $0000
         INC
         PHA
         PEA   $0002
         JSL   L02219C
         PLY
         PLY
         PLY
         PLY
         PLY
         LDY   #$0003
         LDA   [$EA],Y
         AND   #$00FF
         PHA
         PEI   $F9
         JSL   L083716
         PLY
         PLY
         PLY
         BRL   L083AC5
L083A1F  LDA   $D7
         AND   #$00FF
         PHA
         LDA   $D6
         AND   #$00FF
         PLX
         STX   $F2
         CLC
         ADC   $F2
         PHA
         LDA   $F9
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDY   #$0001
         LDA   [$EE],Y
         AND   #$00FF
         PHA
         LDA   $F9
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         AND   #$00FF
         PLX
         STX   $F2
         CLC
         ADC   $F2
         PLX
         STX   $EE
         SEC
         SBC   $EE
         BVS   L083A80
         EOR   #$8000
L083A80  BMI   L083AC5
         LDA   $F9
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $D6
         SEP   #$20
         STA   [$EE]
         REP   #$20
         LDA   $F9
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   $D7
         SEP   #$20
         LDY   #$0001
         STA   [$EE],Y
         REP   #$20
L083AC5  TAY
         TSC
         CLC
         ADC   #$001E
         TCS
         TYA
         PLD
         RTL

L083ACF  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         STZ   $F4
         BRL   L083BD4
L083ADF  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   [$F6]
         AND   #$00FF
         CMP   #$0000
         BNE   L083B04
         BRL   L083BD2
L083B04  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0001
         LDA   [$F6],Y
         AND   #$00FF
         CMP   #$0000
         BNE   L083B2C
         BRL   L083BD2
L083B2C  LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   $F6
         LDX   $F8
         TAY
         TSC
         SEC
         SBC   #$0002
         TCS
         PHX
         PHY
         PEA   $0000
         INC
         PHA
         PEA   $0002
         JSL   L02219C
         PLY
         PLY
         PLY
         PLY
         PLY
         LDA   $F4
         ASL
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05885F
         LDX   #^L05885F
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0003
         LDA   [$F6],Y
         AND   #$00FF
         PHA
         PEI   $F4
         JSL   L083716
         PLY
         PLY
         PLY
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDA   #$0000
         SEP   #$20
         LDY   #$0001
         STA   [$F6],Y
         REP   #$20
         PHA
         LDA   $F4
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L057BE5
         LDX   #^L057BE5
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         SEP   #$20
         STA   [$F6]
         REP   #$20
L083BD2  INC   $F4
L083BD4  LDA   $F4
         CMP   #$0022
         BCS   L083BDE
         BRL   L083ADF
L083BDE  TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L083BE6  PHD
         TSC
         SEC
         SBC   #$00F3
         TCD
         ADC   #$00E6
         TCS
         LDA   L030044
         BRL   L083C60
L083BF7  LDA   $F9
         SEC
         SBC   L030040
         STA   $EC
         LDA   $FB
         SEC
         SBC   L030042
         STA   $EA
         BRL   L083C6D
L083C0A  LDA   $FB
         SEC
         SBC   L030042
         STA   $EC
         LDA   $F9
         SEC
         SBC   L030040
         EOR   #$FFFF
         INC
         STA   $EA
         BRL   L083C6D
L083C21  LDA   $F9
         SEC
         SBC   L030040
         EOR   #$FFFF
         INC
         STA   $EC
         LDA   $FB
         SEC
         SBC   L030042
         EOR   #$FFFF
         INC
         STA   $EA
         BRL   L083C6D
L083C3C  LDA   $FB
         SEC
         SBC   L030042
         EOR   #$FFFF
         INC
         STA   $EC
         LDA   $F9
         SEC
         SBC   L030040
         STA   $EA
         BRL   L083C6D
L083C53  BRL   L083C6D
L083C56  DA    L083BF7
         DA    L083C0A
         DA    L083C21
         DA    L083C3C
         DA    L083C53
L083C60  CMP   #$0004
         BCC   L083C68
         LDA   #$0004
L083C68  ASL
         TAX
         JMP   (L083C56,X)

L083C6D  LDA   $EC
         SEC
         SBC   #$FFF4
         BVS   L083C78
         EOR   #$8000
L083C78  BPL   L083C89
         LDA   $EC
         SEC
         SBC   #$000C
         BEQ   L083C8F
         BVS   L083C87
         EOR   #$8000
L083C87  BPL   L083C8F
L083C89  LDA   #$0000
         BRL   L083D3F
L083C8F  LDA   $EA
         SEC
         SBC   #$FFF4
         BVS   L083C9A
         EOR   #$8000
L083C9A  BPL   L083CAB
         LDA   $EA
         SEC
         SBC   #$000C
         BEQ   L083CB1
         BVS   L083CA9
         EOR   #$8000
L083CA9  BPL   L083CB1
L083CAB  LDA   #$0000
         BRL   L083D3F
L083CB1  LDA   $EC
         EOR   #$FFFF
         INC
         CLC
         ADC   #$000C
         STA   $E8
         LDA   $EC
         CLC
         ADC   #$000C
         STA   $EC
         LDA   $EA
         CLC
         ADC   #$000C
         STA   $EA
         LDA   $EC
         LDX   #$0000
         PHX
         PHA
         LDA   $EA
         PHA
         LDA   #$0019
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L05766E
         LDX   #^L05766E
         JSL   L021F00
         PLA
         PLX
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         SEP   #$20
         LDY   #$0001
         STA   [$FD],Y
         REP   #$20
         LDA   $E8
         LDX   #$0000
         PHX
         PHA
         LDA   $EA
         PHA
         LDA   #$0019
         CLC
         JSL   L0220A5
         PLA
         LDX   #$0000
         PHX
         PHA
         LDA   #L05766E
         LDX   #^L05766E
         JSL   L021F00
         PLA
         PLX
         JSL   L021F00
         PLA
         PLX
         STA   $EE
         STX   $F0
         LDA   [$EE]
         SEP   #$20
         STA   [$FD]
         REP   #$20
         LDA   #$0001
L083D3F  TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         PLD
         RTL

L083D49  ENT
         PHD
         TSC
         SEC
         SBC   #$00E9
         TCD
         ADC   #$00C8
         TCS
         LDA   [$FD]
         AND   #$00FF
         BNE   L083D5E
         BRL   L083E77
L083D5E  LDA   $F3
         PHA
         LDA   $F7
         SEC
         SBC   #$0004
         SEC
         JSL   L0220A5
         PLA
         LDX   #$0000
         TAY
         BPL   L083D74
         DEX
L083D74  PHX
         PHA
         LDX   $F1
         LDA   $EF
         JSL   L021F00
         PLA
         PLX
         STX   $DE
         STA   $DC
         SEP   #$30
         LDA   $F9
         AND   #$0F
         STA   $D2
         ASL
         ASL
         ASL
         ASL
         STA   $D3
         LDA   $FB
         AND   #$0F
         STA   $D0
         ASL
         ASL
         ASL
         ASL
         STA   $D1
         REP   #$30
         STZ   $CC
L083DA2  LDY   $CC
         LDA   [$FD],Y
         AND   #$00FF
         BNE   L083DAE
         BRL   L083E75
L083DAE  CLC
         ADC   #L058A2B
         STA   $D4
         LDA   #^L058A2B
         ADC   #$0000
         STA   $D6
         LDA   $F5
         LSR
         CLC
         ADC   $DC
         STA   $E0
         LDA   $DE
         ADC   #$0000
         STA   $E2
         STZ   $CA
L083DCD  LDA   $E0
         STA   $D8
         LDA   $E2
         STA   $DA
         SEP   #$30
         STZ   $CE
         LDA   $F5
         LSR
         ROR   $CE
         LDX   #$04
         LDA   #$01
L083DE2  ASL
         DEX
         BNE   L083DE2
         STA   $CF
L083DE8  LDA   [$D4]
         AND   $CF
         BEQ   L083E02
         LDA   $CE
         BEQ   L083DFA
         LDA   [$E0]
         AND   #$F0
         ORA   $D2
         BRA   L083E14
L083DFA  LDA   [$E0]
         AND   #$0F
         ORA   $D3
         BRA   L083E14
L083E02  LDA   $CE
         BEQ   L083E0E
         LDA   [$E0]
         AND   #$F0
         ORA   $D0
         BRA   L083E14
L083E0E  LDA   [$E0]
         AND   #$0F
         ORA   $D1
L083E14  STA   [$E0]
         LDA   $CE
         EOR   #$80
         STA   $CE
         BNE   L083E26
         REP   #$30
         INC   $E0
         BNE   L083E26
         INC   $E2
L083E26  SEP   #$30
         LSR   $CF
         BNE   L083DE8
         LDA   $CE
         BEQ   L083E38
         LDA   [$E0]
         AND   #$F0
         ORA   $D0
         BRA   L083E3E
L083E38  LDA   [$E0]
         AND   #$0F
         ORA   $D1
L083E3E  STA   [$E0]
         REP   #$30
         CLC
         LDA   $D4
         ADC   #$0080
         STA   $D4
         BCC   L083E4E
         INC   $D6
L083E4E  CLC
         LDA   $D8
         ADC   $F3
         STA   $E0
         LDA   $DA
         ADC   #$0000
         STA   $E2
         INC   $CA
         LDA   $CA
         CMP   #$0006
         BCS   L083E68
         BRL   L083DCD
L083E68  CLC
         LDA   $F5
         ADC   #$0006
         STA   $F5
         INC   $CC
         BRL   L083DA2
L083E75  REP   #$30
L083E77  TAY
         TSC
         CLC
         ADC   #$0020
         TCS
         TYA
         PLD
         RTL

L083E81  ENT
         PHD
         TSC
         SEC
         SBC   #$00E7
         TCD
         ADC   #$008E
         TCS
         STZ   $90
L083E8E  LDX   $FD
         LDA   $FB
         INC   $FB
         BNE   L083E98
         INC   $FD
L083E98  STA   $E2
         STX   $E4
         LDA   [$E2]
         PHA
         LDA   $90
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$0092
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         PLA
         SEP   #$20
         STA   [$E2]
         REP   #$20
         AND   #$00FF
         BEQ   L083EC8
         INC   $90
         BRA   L083E8E
L083EC8  BRA   L083EEE
L083ECA  LDA   $90
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$0092
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         LDA   #$0020
         SEP   #$20
         STA   [$E2]
         REP   #$20
         INC   $90
L083EEE  LDA   $90
         SEC
         SBC   $FF
         BVS   L083EF8
         EOR   #$8000
L083EF8  BPL   L083ECA
         LDA   $90
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$0092
         JSL   L021F00
         PLA
         PLX
         STA   $E2
         STX   $E4
         LDA   #$0000
         SEP   #$20
         STA   [$E2]
         REP   #$20
         PEA   $0000
         TDC
         CLC
         ADC   #$0092
         PHA
         PEI   $F9
         PEI   $F7
         PEI   $F5
         PEI   $F3
         PEI   $F1
         PEI   $EF
         PEI   $ED
         JSL   L083D49
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         TSC
         CLC
         ADC   #$0058
         TCS
         PLD
         RTL

L083F47  PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00F0
         TCS
         LDA   $FD
         SEC
         SBC   #$0000
         BVS   L083F5D
         EOR   #$8000
L083F5D  BMI   L083F63
         STZ   $FD
         BRA   L083F75
L083F63  LDA   $FD
         SEC
         SBC   #$0035
         BVS   L083F6E
         EOR   #$8000
L083F6E  BPL   L083F75
         LDA   #$0034
         STA   $FD
L083F75  LDA   $FD
         STA   L0303DD
         LDA   $FF
         SEC
         SBC   #$0000
         BVS   L083F85
         EOR   #$8000
L083F85  BMI   L083F8B
         STZ   $FF
         BRA   L083F9D
L083F8B  LDA   $FF
         SEC
         SBC   #$0004
         BVS   L083F96
         EOR   #$8000
L083F96  BPL   L083F9D
         LDA   #$0003
         STA   $FF
L083F9D  LDA   $FF
         STA   L0303DB
         STZ   L0303D9
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L083FAD  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00EA
         TCS
         STZ   L03012C
         LDA   #$0000
         STA   $EC
         LDA   #$013F
         STA   $EE
         LDA   #$00A9
         STA   $F0
         LDA   #$00C7
         STA   $F2
         JSL   L082EE5
         PEA   $00A0
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00EC
         PHA
         LDX   L03002A
         LDA   L030028
         PHX
         PHA
         JSL   L080D64
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         JSL   L082F35
         PEA   $0003
         PEA   $0000
         JSL   L083F47
         PLY
         PLY
         STZ   $F4
         BRA   L084035
L08400A  LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05918B
         LDX   #^L05918B
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDX   #$FFFF
         LDA   #$FFFF
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
         INC   $F4
L084035  LDA   $F4
         CMP   #$0004
         BCC   L08400A
         TSC
         CLC
         ADC   #$0010
         TCS
         PLD
         RTL

L084044  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00E4
         TCS
         STZ   L03012C
         LDA   #$0000
         STA   $E6
         LDA   #$013F
         STA   $E8
         STZ   $F2
         BRL   L08412D
L084061  LDA   $F2
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05918B
         LDX   #^L05918B
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         STX   $F0
         STA   $EE
         SEC
         LDA   $EE
         SBC   #$FFFF
         BNE   L084095
         LDA   $F0
         SBC   #$FFFF
         BRA   L08409C
L084095  LDA   $F0
         SBC   #$FFFF
         REP   #$02
L08409C  BEQ   L0840B8
         SEC
         LDA   $EE
         SBC   L03004E
         BNE   L0840AD
         LDA   $F0
         SBC   L030050
         BRA   L0840B4
L0840AD  LDA   $F0
         SBC   L030050
         REP   #$02
L0840B4  BEQ   L0840BB
         BCC   L0840BB
L0840B8  BRL   L08412B
L0840BB  LDA   $F2
         PHA
         LDA   #$0007
         CLC
         JSL   L0220A5
         LDA   #$00AC
         PLX
         STX   $FA
         CLC
         ADC   $FA
         STA   $EA
         CLC
         ADC   #$0006
         STA   $EC
         JSL   L082EE5
         PEA   $00A0
         PEA   $0000
         PEA   $0000
         TDC
         CLC
         ADC   #$00E6
         PHA
         LDX   L03002A
         LDA   L030028
         PHX
         PHA
         JSL   L080D64
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         JSL   L082F35
         LDA   $F2
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05918B
         LDX   #^L05918B
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDX   #$FFFF
         LDA   #$FFFF
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
L08412B  INC   $F2
L08412D  LDA   $F2
         CMP   #$0004
         BCS   L084137
         BRL   L084061
L084137  TSC
         CLC
         ADC   #$0016
         TCS
         PLD
         RTL

L08413F  PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         LDA   L0303DB
         CMP   #$0003
         BEQ   L084155
         BRL   L0841E0
L084155  LDA   L0303D9
         BEQ   L08415E
         JSL   L090609
L08415E  PEA   $0460
         PEA   ^L058D2B
         PEA   L058D2B
         JSL   L020232
         PLY
         PLY
         PLY
         LDA   #$0001
         STA   L0303D9
         STZ   $F4
         BRA   L0841C6
L084178  LDA   $F4
         CLC
         ADC   #$0001
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05918B
         LDX   #^L05918B
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDY   #$0002
         LDA   [$F6],Y
         TAX
         LDA   [$F6]
         PHX
         PHA
         LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05918B
         LDX   #^L05918B
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
         INC   $F4
L0841C6  LDA   $F4
         CMP   #$0003
         BCC   L084178
         LDX   #$FFFF
         LDA   #$FFFF
         PHA
         TXA
         STAL  L059199
         PLA
         STAL  L059197
         BRA   L0841E6
L0841E0  INC   L0303DB
         STZ   L0303D9
L0841E6  TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L0841EE  PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00EC
         TCS
         PEI   $FF
         PEI   $FD
         JSL   L022405
         PLY
         PLY
         STA   $EE
         LDA   L0303D9
         BEQ   L084239
         PEI   $FF
         PEI   $FD
         PEA   $0000
         PEI   $FB
         PEA   $0005
         LDA   L0303DD
         PHA
         LDA   #$0006
         SEC
         JSL   L0220A5
         PEA   $00A0
         PEA   ^L058D2B
         PEA   L058D2B
         JSL   L083D49
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         BRA   L084274
L084239  JSL   L082EE5
         PEI   $FF
         PEI   $FD
         PEA   $0000
         PEI   $FB
         LDA   L0303DB
         PHA
         LDA   #$0007
         SEC
         JSL   L0220A5
         PLA
         CLC
         ADC   #$00B1
         PHA
         LDA   L0303DD
         PHA
         LDA   #$0006
         SEC
         JSL   L0220A5
         JSL   L084545
         TAY
         TSC
         CLC
         ADC   #$000C
         TCS
         TYA
         JSL   L082F35
L084274  LDA   L0303DD
         CLC
         ADC   $EE
         STA   L0303DD
         LDX   L030050
         LDA   L03004E
         CLC
         ADC   #$0046
         PHA
         TXA
         ADC   #$0000
         TAX
         PLA
         PHX
         PHA
         LDA   L0303DB
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05918B
         LDX   #^L05918B
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         PLX
         LDY   #$0002
         PHA
         TXA
         STA   [$F0],Y
         PLA
         STA   [$F0]
         TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

L0842BE  ENT
         PHD
         TSC
         SEC
         SBC   #$00F5
         TCD
         ADC   #$00B4
         TCS
         LDA   L0303D9
         BEQ   L0842E5
         JSL   L090609
         PEA   $0460
         PEA   ^L058D2B
         PEA   L058D2B
         JSL   L020232
         PLY
         PLY
         PLY
         STZ   L0303D9
L0842E5  LDA   [$FD]
         AND   #$00FF
         BNE   L0842EF
         BRL   L0843E9
L0842EF  LDA   [$FD]
         AND   #$00FF
         CMP   #$000A
         BNE   L084319
         INC   $FD
         BNE   L0842FF
         INC   $FF
L0842FF  LDA   L0303DD
         CMP   #$0000
         BNE   L08430F
         LDA   L0303DB
         CMP   #$0000
         BEQ   L084316
L08430F  STZ   L0303DD
         JSL   L08413F
L084316  BRL   L0843E6
L084319  LDA   [$FD]
         AND   #$00FF
         CMP   #$0020
         BNE   L08434B
         INC   $FD
         BNE   L084329
         INC   $FF
L084329  LDA   L0303DD
         CMP   #$0035
         BEQ   L084348
         LDA   #$0020
         STA   $EE
         PEA   $0000
         TDC
         CLC
         ADC   #$00EE
         PHA
         PEI   $FB
         JSL   L0841EE
         PLY
         PLY
         PLY
L084348  BRL   L0843E6
L08434B  STZ   $EC
L08434D  LDX   $FF
         LDA   $FD
         INC   $FD
         BNE   L084357
         INC   $FF
L084357  STA   $F0
         STX   $F2
         LDA   [$F0]
         PHA
         LDA   $EC
         INC   $EC
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00B6
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         PLA
         SEP   #$20
         STA   [$F0]
         REP   #$20
         LDA   [$FD]
         AND   #$00FF
         BEQ   L08439B
         LDA   [$FD]
         AND   #$00FF
         CMP   #$0020
         BEQ   L08439B
         LDA   [$FD]
         AND   #$00FF
         CMP   #$000A
         BNE   L08434D
L08439B  LDA   $EC
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00B6
         JSL   L021F00
         PLA
         PLX
         STA   $F0
         STX   $F2
         LDA   #$0000
         SEP   #$20
         STA   [$F0]
         REP   #$20
         LDA   L0303DD
         CLC
         ADC   $EC
         CMP   #$0035
         BEQ   L0843D4
         BCC   L0843D4
         LDA   #$0002
         STA   L0303DD
         JSL   L08413F
L0843D4  PEA   $0000
         TDC
         CLC
         ADC   #$00B6
         PHA
         PEI   $FB
         JSL   L0841EE
         PLY
         PLY
         PLY
L0843E6  BRL   L0842E5
L0843E9  LDA   L0303D9
         BEQ   L084405
         JSL   L090609
         PEA   $0460
         PEA   ^L058D2B
         PEA   L058D2B
         JSL   L020232
         PLY
         PLY
         PLY
         STZ   L0303D9
L084405  TSC
         CLC
         ADC   #$0040
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00EE
         TCS
         LDA   $FF
         SEP   #$20
         STA   $F0
         REP   #$20
         LDA   #$0000
         SEP   #$20
         STA   $F1
         REP   #$20
         PEA   $0000
         TDC
         CLC
         ADC   #$00F0
         PHA
         PEI   $FD
         JSL   L0842BE
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00F7
         TCD
         ADC   #$00E7
         TCS
         LDA   #$0007
         STA   $F0
         LDA   #$0000
         SEP   #$20
         STA   $F0
         REP   #$20
L08445C  LDA   #$000A
         PHA
         LDA   $FF
         CLC
         JSL   L021F1A
         LDA   #$0030
         PLX
         STX   $F6
         CLC
         ADC   $F6
         PHA
         DEC   $F0
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00E9
         JSL   L021F00
         PLA
         PLX
         STA   $F2
         STX   $F4
         PLA
         SEP   #$20
         STA   [$F2]
         REP   #$20
         LDA   #$000A
         PHA
         LDA   $FF
         CLC
         JSL   L021F1A
         PLY
         STA   $FF
         TAY
         BNE   L08445C
         LDA   $F0
         LDX   #$0000
         PHX
         PHA
         LDX   #$0000
         TDC
         CLC
         ADC   #$00E9
         JSL   L021F00
         PEI   $FD
         JSL   L0842BE
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$000F
         TCS
         PLD
         RTL

         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   ^L0589A9
         PEA   L0589A9
         PEA   $000F
         JSL   L0842BE
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L0844EB  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F4
         TCS
         PEA   ^L0589A7
         PEA   L0589A7
         PEA   $0000
         JSL   L0842BE
         PLY
         PLY
         PLY
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L08450E  ENT
         PHD
         TSC
         SEC
         SBC   #$00F1
         TCD
         ADC   #$00EA
         TCS
         PEI   $FF
         PEI   $FD
         PEA   $000C
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEA   $0070
         LDX   L03002E
         LDA   L03002C
         PHX
         PHA
         JSL   L083D49
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L084545  ENT
         PHD
         TSC
         SEC
         SBC   #$00EF
         TCD
         ADC   #$00E8
         TCS
         PEI   $FF
         PEI   $FD
         PEI   $FB
         PEI   $F9
         PEI   $F7
         PEI   $F5
         PEA   $00A0
         LDX   L03002A
         LDA   L030028
         PHX
         PHA
         JSL   L083D49
         TAY
         TSC
         CLC
         ADC   #$0012
         TCS
         TYA
         TSC
         CLC
         ADC   #$0006
         TCS
         PLD
         RTL

L08457B  ENT
         PHD
         TSC
         SEC
         SBC   #$00FB
         TCD
         ADC   #$00F2
         TCS
         PEA   $0003
         PEA   $0000
         JSL   L083F47
         PLY
         PLY
         PEA   ^L058A2B
         PEA   L058A2B
         PEA   $822D
         JSL   L0B2447
         PLY
         PLY
         PLY
         STZ   $F4
         BRA   L0845D1
L0845A6  LDA   $F4
         ASL
         ASL
         LDX   #$0000
         PHX
         PHA
         LDA   #L05918B
         LDX   #^L05918B
         JSL   L021F00
         PLA
         PLX
         STA   $F6
         STX   $F8
         LDX   #$FFFF
         LDA   #$FFFF
         LDY   #$0002
         PHA
         TXA
         STA   [$F6],Y
         PLA
         STA   [$F6]
         INC   $F4
L0845D1  LDA   $F4
         CMP   #$0004
         BCC   L0845A6
         TSC
         CLC
         ADC   #$0008
         TCS
         PLD
         RTL

