
*---------------------------------------------------------*
*     Disassembled with The Flaming Bird Disassembler     *
*    (c) Phoenix corp. 1992,93  -  All rights reserved    *
*---------------------------------------------------------*

         REL
	 mx	%00

	 use	MAIN4.X.S

L180000  ENT
         PHP
         SEP   #$20
         LDX   #L0244AC
         STX   $6C
         LDA   ($6C)
         STA   $5C
         BEQ   L180012
         JSL   L180032
L180012  LDX   $6C
         INX
         STX   $6C
         LDA   ($6C)
         STA   $5C
         BEQ   L180021
         JSL   L180032
L180021  LDX   $6C
         INX
         STX   $6C
         LDA   ($6C)
         STA   $5C
         BEQ   L180030
         JSL   L180032
L180030  PLP
         RTL

L180032  PHP
         SEP   #$20
         LDA   $5C
         AND   #$80
         STA   $5C
         BNE   L180040
         JMP   L1800F9

L180040  LDX   #$0000
         STX   L023D85
         LDY   #$0004
         LDA   ($6C),Y
         STA   $68
         LDY   #$0008
         LDA   ($6C),Y
         STA   $69
         STA   L02444E
         STA   $60
         STZ   $61
         LDX   $60
         LDA   L020888,X
         AND   #$FE
         STA   $5C
         BNE   L18006D
         LDA   #$02
         STA   $5C
         JMP   L180077

L18006D  LDA   $5C
         CMP   #$0A
         BCC   L180077
         LDA   #$0A
         STA   $5C
L180077  LDA   $5C
         LSR
         STA   $64
         STA   $5C
         LDX   $60
         LDA   L0206A8,X
         STA   $65
         LDX   $68
         STX   $04
         JSL   L1809AE
         LDX   $00
         STX   $60
         LDA   $60
         AND   #$FE
         STA   $60
         LDA   #$01
         STA   L024459
         LDX   $60
         STX   $68
         LDA   $60
         SEC
         SBC   $64
         STA   $60
         LDA   $61
         SBC   #$00
         STA   $61
         LDA   $68
         CLC
         ADC   $64
         STA   $68
         LDA   $69
         ADC   #$00
         STA   $69
         DEC   $61
         BEQ   L1800C2
         BPL   L1800F9
         STZ   $60
L1800C2  DEC   $69
         BEQ   L1800CC
         BMI   L1800F9
         LDA   #$FF
         STA   $68
L1800CC  LDA   $65
         SEC
         SBC   $64
         STA   $5C
         STA   $61
         CLC
         ADC   $64
         CLC
         ADC   $64
         STA   $5C
         STA   $69
         LDX   $60
         STX   L023FEE
         LDX   $68
         STX   L023FF0
         LDX   #$0000
         STX   L023362
         JSL   L0F26B4
         LDA   ($6C)
         AND   #$7F
         STA   ($6C)
L1800F9  LDA   ($6C)
         STA   $5C
         BNE   L180101
         PLP
         RTL

L180101  LDY   #$000C
         LDA   ($6C),Y
         INC
         AND   #$3F
         STA   ($6C),Y
         STA   $5C
         CMP   #$20
         BCS   L180124
         AND   #$1F
         ASL
         STA   $5C
         STA   $60
         STZ   $61
         LDX   $60
         LDY   L025A9D,X
         STY   $68
         JMP   L18014D

L180124  LDA   $5C
         AND   #$1F
         STA   $5C
         STA   $60
         STZ   $61
         LDA   #$1F
         SEC
         SBC   $60
         ASL
         STA   $5C
         STA   $60
         LDA   #$00
         LDX   $60
         SEC
         SBC   L025A9D,X
         STA   $68
         INX
         STX   $60
         LDA   #$00
         SEC
         SBC   L025A9D,X
         STA   $69
L18014D  LDX   L024442
         STX   $60
         LDA   $68
         CLC
         ADC   $60
         STA   $68
         LDA   $69
         CLC
         ADC   $61
         STA   $69
         LDY   #$0008
         STA   ($6C),Y
         LDY   #$0004
         LDA   $68
         STA   ($6C),Y
         LDX   #$AAAA
         STX   L023D85
         STZ   $61
         LDA   $69
         STA   $60
         LDX   $60
         LDA   L020888,X
         AND   #$FE
         STA   $5C
         BEQ   L180190
         LDA   $5C
         CMP   #$0B
         BCC   L180194
         LDA   #$0A
         STA   $5C
         JMP   L180194

L180190  LDA   #$02
         STA   $5C
L180194  LDX   #L025A75
         STX   $60
         LDX   #^L025A75
         STX   $62
         LDX   $5C
         PHX
         LDX   $68
         PHX
         JSL   L0F07DA
         LDX   #$9999
         STX   L023D85
         PLX
         STX   $68
         PLX
         STX   $5C
         LDX   #L025A89
         STX   $60
         LDX   #^L025A89
         STX   $62
         JSL   L0F07DA
         LDA   ($6C)
         ORA   #$80
         STA   ($6C)
         PLP
         RTL

L1801CA  ENT
         PHP
         SEP   #$20
         LDA   #$04
         STA   $65
         LDA   L0244AC
         AND   #$80
         STA   L0244AC
         LDA   L0244AD
         AND   #$80
         STA   L0244AD
         LDA   L0244AE
         AND   #$80
         STA   L0244AE
         LDA   L0244AF
         AND   #$80
         STA   L0244AF
         PLP
         JMP   L180000

L1801F5  ENT
         PHP
         SEP   #$20
         LDX   #L024336
         STX   $60
         LDX   #$0009
         STX   $64
L180202  SEP   #$20
         LDA   ($60)
         STA   $5C
         BEQ   L180214
         REP   #$20
         INC   $60
         DEC   $64
         BNE   L180202
         PLP
         RTL

L180214  SEP   #$20
         LDA   L024414
         STA   ($60)
         LDY   #$0009
         LDA   #$20
         STA   ($60),Y
         PLP
         RTL

L180224  ENT
         PHP
         SEP   #$20
         STZ   L024414
         LDX   #L024336
         STX   $6C
         LDX   #$0009
         STX   $64
L180234  LDX   $64
         PHX
         SEP   #$20
         LDA   ($6C)
         STA   $5C
         BEQ   L180243
         JSL   L180250
L180243  REP   #$20
         PLX
         STX   $64
         INC   $6C
         DEC   $64
         BNE   L180234
         PLP
         RTL

L180250  PHP
         SEP   #$20
         LDA   $5C
         DEC
         ASL
         STA   $60
         STZ   $61
         REP   #$20
         LDX   $60
         LDA   L025ADD,X
         STA   $68
         STA   $74
         LDA   ($74)
         STA   $68
         INC   $74
         INC   $74
         SEP   #$20
         LDA   $64
         STA   $5D
         STZ   $5C
         REP   #$20
         LDA   $5C
         LSR
         STA   $5C
         SEP   #$20
         ASL   $64
         LDA   $5D
         CLC
         ADC   $64
         STA   $5D
         REP   #$20
         LDA   $5C
         ASL
         CLC
         ADC   $68
         STA   $68
         STA   $70
         SEP   #$20
         LDA   L02436E
         STA   $5C
         BNE   L1802D3
         LDY   #$0009
         LDA   ($6C),Y
         DEC
         STA   ($6C),Y
         BEQ   L1802D3
         REP   #$20
         LDA   L024428
         AND   #$0003
         ASL
         TAX
         LDY   L02437C,X
         STY   L023D85
         SEP   #$20
         LDX   $74
         STX   $00
         LDX   #^L025ADD
         STX   $02
         LDX   $70
         STX   $04
         LDA   L023E28
         CMP   #$FD
         BEQ   L1802D1
         JSL   L1806EB
L1802D1  PLP
         RTL

L1802D3  LDX   #$0000
         STX   L023D85
         LDA   #$00
         STA   ($6C)
         LDX   $74
         STX   $00
         LDX   #^L025ADD
         STX   $02
         LDX   $70
         STX   $04
         LDA   L023E28
         CMP   #$FD
         BEQ   L1802F5
         JSL   L1806EB
L1802F5  PLP
         RTL

L1802F7  ENT
         PHP
         SEP   #$20
         LDX   $60
         PHX
         LDA   L024418
         STA   $60
         BNE   L180309
         PLX
         STX   $60
         PLP
         RTL

L180309  LDX   $68
         PHX
         LDX   $6C
         PHX
         LDX   $70
         PHX
         LDA   $60
         DEC
         ASL
         STA   $60
         STZ   $61
         LDX   $60
         LDY   L025C24,X
         STY   $60
         REP   #$20
         LDA   ($60)
         STA   $70
         LDA   $60
         INC
         INC
         STA   $60
         SEP   #$20
         LDA   L02436E
         STA   $5C
         BNE   L180373
         DEC   L02441A
         BEQ   L180373
         REP   #$20
         LDA   L024428
         AND   #$0003
         ASL
         TAX
         LDY   L02437C,X
         STY   L023D85
         SEP   #$20
         LDX   $60
         STX   $00
         LDX   #^L025ADD
         STX   $02
         LDX   $70
         STX   $04
         LDA   L023E28
         CMP   #$FD
         BEQ   L180365
         JSL   L1806EB
L180365  PLX
         STX   $70
         PLX
         STX   $6C
         PLX
         STX   $68
         PLX
         STX   $60
         PLP
         RTL

L180373  LDX   #$0000
         STX   L023D85
         STZ   L024418
         LDX   $60
         STX   $00
         LDX   #^L025ADD
         STX   $02
         LDX   $70
         STX   $04
         LDA   L023E28
         CMP   #$FD
         BEQ   L180394
         JSL   L1806EB
L180394  PLX
         STX   $70
         PLX
         STX   $6C
         PLX
         STX   $68
         PLX
         STX   $60
         PLP
         RTL

L1803A2  ENT
         PHP
         SEP   #$20
         LDA   #$FF
         STA   L02436E
         LDA   #$01
         STA   L02441A
         JSL   L1802F7
         JSL   L1801CA
         JSL   L0711A7
         JSL   L0F1815
         JSL   L180A7D
         LDA   #$FF
         STA   L024438
         LDX   #L024E00
         STX   $60
         LDX   #$0008
         STX   $64
L1803D2  SEP   #$20
         LDA   ($60)
         AND   #$7F
         STA   $5C
         CMP   #$10
         LDA   #$01
         STA   $5D
         BCC   L1803E6
         LDA   #$0F
         STA   $5D
L1803E6  LDA   ($60)
         AND   #$80
         ORA   $5D
         STA   $5C
         STA   ($60)
         REP   #$20
         LDA   $60
         CLC
         ADC   #$0060
         STA   $60
         DEC   $64
         BNE   L1803D2
         JSL   L030EF5
         JSL   L031160
         JSL   L0F030E
         JSL   L180224
         JSL   L1802F7
         PLP
         RTL

L180414  ENT
         PHP
         SEP   #$20
         LDA   L02447C
         STA   $5C
         BEQ   L18042C
         CMP   L024465
         BCC   L180429
         STA   L024465
         STZ   L024468
L180429  STZ   L02447C
L18042C  PLP
         RTL

L18042E  ENT
         PHP
         REP   #$20
         ASL
         ASL
         ASL
         ASL
         ASL
         TAX
         LDA   #$0004
         STA   $44
         LDA   #$00E1
         STA   $02
         LDY   #$0000
L180444  LDA   L025806
         ORAL  L0D0140,X
         INX
         INX
         STA   [$00],Y
         INY
         INY
         SEP   #$20
         LDA   L025806
         ORAL  L0D0140,X
         INX
         INX
         STA   [$00],Y
         REP   #$20
         TYA
         CLC
         ADC   #$009E
         TAY
         LDA   L025806
         ORAL  L0D0140,X
         INX
         INX
         STA   [$00],Y
         INY
         INY
         SEP   #$20
         LDA   L025806
         ORAL  L0D0140,X
         INX
         INX
         STA   [$00],Y
         REP   #$20
         TYA
         CLC
         ADC   #$009E
         TAY
         DEC   $44
         BNE   L180444
         PLP
         RTL

L18048E  ENT
         PHP
         REP   #$20
         ASL
         ASL
         ASL
         ASL
         ASL
         TAX
         LDA   #$0004
         STA   $44
         LDA   #$00E1
         STA   $02
         LDY   #$0000
L1804A4  INX
         SEP   #$20
         LDA   L025806
         ORAL  L0D0000,X
         INX
         STA   [$00],Y
         REP   #$20
         LDA   L025806
         ORAL  L0D0000,X
         INX
         INX
         INY
         STA   [$00],Y
         TYA
         CLC
         ADC   #$009F
         TAY
         INX
         SEP   #$20
         LDA   L025806
         ORAL  L0D0000,X
         INX
         STA   [$00],Y
         INY
         REP   #$20
         LDA   L025806
         ORAL  L0D0000,X
         INX
         INX
         STA   [$00],Y
         TYA
         CLC
         ADC   #$009F
         TAY
         DEC   $44
         BNE   L1804A4
         PLP
         RTL

L1804EC  ENT
         PHP
         REP   #$20
         AND   #$00FF
         DEC
         ASL
         STA   $08
         ASL
         ASL
         CLC
         ADC   L025804
         STA   $00
         LDA   ($00)
         STA   $04
         INC   $00
         INC   $00
         LDA   ($00)
         STA   $14
         INC   $00
         INC   $00
         LDA   #$5784
         CLC
         ADC   $08
         STA   $10
         JSL   L180538
         LDA   ($00)
         STA   $04
         INC   $00
         INC   $00
         LDA   ($00)
         STA   $14
         INC   $00
         INC   $00
         LDA   #$579A
         SEC
         SBC   $08
         STA   $10
         JSL   L180538
         PLP
         RTL

L180538  PHP
         REP   #$20
         LDA   #$00E1
         STA   $12
         LDA   #$0010
         SEC
         SBC   $08
         STA   $46
         LDY   #$0002
L18054B  LDA   $04
         STA   [$10]
         DEC   $46
         BEQ   L18056B
         LDA   $10
         CLC
         ADC   #$00A0
         STA   $10
         LDA   $14
         STA   [$10]
         LDA   $10
         CLC
         ADC   #$00A0
         STA   $10
         DEC   $46
         BNE   L18054B
L18056B  PLP
         RTL

L18056D  ENT
         PHP
         SEP   #$20
         STZ   $5D
         DEC   $5C
         LDA   #$08
         SEC
         SBC   $5C
         ASL
         STA   $68
         STZ   $69
         REP   #$20
         LDA   $5C
         ASL
         CLC
         ADC   #$5784
         STA   $70
         LDA   #$00E1
         STA   $72
         LDX   $68
L180590  LDA   L025806
         STA   [$70]
         LDA   $70
         CLC
         ADC   #$00A0
         STA   $70
         DEX
         BNE   L180590
         LDA   $5C
         ASL
         EOR   #$FFFF
         INC
         CLC
         ADC   #$579A
         STA   $70
         LDX   $68
L1805AF  LDA   L025806
         STA   [$70]
         LDA   $70
         CLC
         ADC   #$00A0
         STA   $70
         DEX
         BNE   L1805AF
         PLP
         RTL

L1805C1  ENT
         PHP
         REP   #$20
         LDA   #$9396
         STA   $00
         LDA   #$00E1
         STA   $02
         LDA   #$FFFF
         STA   $08
         LDA   L0242FD
L1805D6  INC   $08
         SEC
         SBC   #$000A
         BCS   L1805D6
         CLC
         ADC   #$000A
         PHA
         LDA   $08
         JSL   L18042E
         PLA
         INC   $00
         INC   $00
         INC   $00
         JSL   L18048E
         PLP
         RTL

L1805F6  DW    $3984
         DW    $398C
         DW    $3994
         DW    $4384
         DW    $438C
         DW    $4394
L180602  DA    L0C1F40
         DA    L0C1F40
         DA    L0C1F40
         DA    L0C1FC0
         DA    L0C2040
         DA    L0C20C0
L18060E  ENT
         PHP
         REP   #$20
         AND   #$00FF
         ASL
         TAX
         LDAL  L1805F6,X
         STA   $24
         LDAL  L180602,X
         STA   $28
         LDX   #$00E1
         STX   $26
         LDX   #^L0C1F40
         STX   $2A
         LDA   #$0010
         STA   $44
L180631  LDY   #$0000
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   $24
         CLC
         ADC   #$00A0
         STA   $24
         TYA
         CLC
         ADC   $28
         STA   $28
         DEC   $44
         BNE   L180631
         PLP
         RTL

L18066C  ENT
         PHP
         REP   #$20
         LDA   #$00E1
         STA   $02
         LDA   L025806
         STA   [$00]
         LDX   $00
         TXY
         INY
         LDA   #$0010
         STA   $44
         LDA   #$0006
L180685  PHB
         MVN   $E10000,$E10000
         PLB
         TYA
         CLC
         ADC   #$0098
         TAY
         LDX   $00
         LDA   #$0007
         DEC   $44
         BNE   L180685
         PLP
         RTL

L18069B  ENT
         ASL
         ASL
         ASL
         ASL
         ASL
         LDY   #$0002
         TAX
         LDA   #$00E1
         STA   $06
         LDA   #$0008
         STA   $44
L1806AE  LDAL  L100000,X
         AND   L023D85
         STA   $52
         LDAL  L100000,X
         EOR   #$FFFF
         AND   [$04]
         ORA   $52
         STA   [$04]
         INX
         INX
         LDAL  L100000,X
         AND   L023D85
         STA   $52
         LDAL  L100000,X
         EOR   #$FFFF
         AND   [$04],Y
         ORA   $52
         STA   [$04],Y
         INX
         INX
         LDA   $04
         CLC
         ADC   #$00A0
         STA   $04
         DEC   $44
         BNE   L1806AE
         RTL

L1806EB  ENT
         PHP
         REP   #$20
L1806EE  LDA   $04
         PHA
         LDA   [$00]
         AND   #$00FF
         SEC
         SBC   #$0020
         BCS   L1806FF
         PLA
         PLP
         RTL

L1806FF  INC   $00
         JSL   L18069B
         PLA
         INC
         INC
         INC
         INC
         STA   $04
         BRA   L1806EE
L18070E  DA    L180862
         DA    L180853
         DA    L180844
         DA    L180835
         DA    L180826
         DA    L180817
L18071A  ENT
         PHP
         SEP   #$20
         LDA   L023E06
         BEQ   L180725
         JMP   L180871

L180725  SEP   #$20
         LDA   $04
         AND   #$0F
         STA   $44
         LDA   $04
         AND   #$F0
         LSR
         LSR
         LSR
         LSR
         STA   $46
         LDA   $05
         AND   #$0F
         STA   $48
         LDA   $05
         AND   #$F0
         LSR
         LSR
         LSR
         LSR
         STA   $4A
         STZ   $4C
         STZ   $4E
         LDX   #$0000
         STX   $50
         LDA   $44
         BEQ   L180768
         CLC
         ADC   L024313,X
         STA   $44
         CMP   #$0A
         BCC   L180765
         SEC
         SBC   #$0A
         STA   $44
         INC   $46
L180765  STA   L024313,X
L180768  INX
         LDA   $46
         BEQ   L180786
         LDY   #$0002
         STY   $50
         CLC
         ADC   L024313,X
         STA   $46
         CMP   #$0A
         BCC   L180783
         SEC
         SBC   #$0A
         STA   $46
         INC   $48
L180783  STA   L024313,X
L180786  INX
L180787  LDA   $48
         BEQ   L1807A4
         LDY   #$0004
         STY   $50
         CLC
         ADC   L024313,X
         STA   $48
         CMP   #$0A
         BCC   L1807A1
         SEC
         SBC   #$0A
         STA   $48
         INC   $4A
L1807A1  STA   L024313,X
L1807A4  INX
         LDA   $4A
         BEQ   L1807C2
         LDY   #$0006
         STY   $50
         CLC
         ADC   L024313,X
         STA   $4A
         CMP   #$0A
         BCC   L1807BF
         SEC
         SBC   #$0A
         STA   $4A
         INC   $4C
L1807BF  STA   L024313,X
L1807C2  INX
         LDA   $4C
         BEQ   L1807E0
         LDY   #$0008
         STY   $50
         CLC
         ADC   L024313,X
         STA   $4C
         CMP   #$0A
         BCC   L1807DD
         SEC
         SBC   #$0A
         STA   $4C
         INC   $4E
L1807DD  STA   L024313,X
L1807E0  INX
         LDA   $4E
         BEQ   L18080A
         LDY   #$000A
         STY   $50
         CLC
         ADC   L024313,X
         STA   $4E
         CMP   #$0A
         BCC   L180807
         REP   #$20
         LDA   #$0909
         STA   L024313
         STA   L024315
         STA   L024317
         LDA   #$0009
         SEP   #$20
L180807  STA   L024313,X
L18080A  REP   #$20
         LDA   #$00E1
         STA   $02
         LDA   $50
         TAX
         JMP   (L18070E,X)

L180817  LDA   #$2A86
         STA   $00
         LDA   L024318
         AND   #$00FF
         JSL   L18042E
L180826  LDA   #$2A89
         STA   $00
         LDA   L024317
         AND   #$00FF
         JSL   L18048E
L180835  LDA   #$2A8C
         STA   $00
         LDA   L024316
         AND   #$00FF
         JSL   L18042E
L180844  LDA   #$2A8F
         STA   $00
         LDA   L024315
         AND   #$00FF
         JSL   L18048E
L180853  LDA   #$2A92
         STA   $00
         LDA   L024314
         AND   #$00FF
         JSL   L18042E
L180862  LDA   #$2A95
         STA   $00
         LDA   L024313
         AND   #$00FF
         JSL   L18048E
L180871  PLP
         RTL

L180873  DW    $0001
         DW    $0003
         DW    $0005
         DW    $0010
         DW    $0015
         DW    $0020
         DW    $0030
         DW    $0050
         DW    $0100
         DW    $0200
         DW    $0500
         DW    $1000
         DW    $2000
L18088D  ENT
         PHP
         SEP   #$20
         LDY   L023E06
         BNE   L1808D7
         LDA   $5C
         PHA
         CLC
         ADC   #$0D
         STA   L024414
         JSL   L1801F5
         LDA   #$00
         XBA
         PLA
         ASL
         TAX
         LDAL  L180873,X
         PHA
         AND   #$F0
         LSR
         LSR
         LSR
         LSR
         STA   $4A
         PLA
         AND   #$0F
         STA   $48
         INX
         LDAL  L180873,X
         PHA
         AND   #$F0
         LSR
         LSR
         LSR
         LSR
         STA   $4E
         PLA
         AND   #$0F
         STA   $4C
         LDX   #$0002
         LDA   #$04
         STA   $50
         JMP   L180787

L1808D7  PLP
         RTL

L1808D9  ENT
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L1808E9
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L1808E9  LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L1808F9
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L1808F9  LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L18090B
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L18090B  LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L18091D
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L18091D  LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L18092F
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L18092F  LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L180941
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L180941  ENT
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L180953
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L180953  ENT
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L180965
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L180965  ENT
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L180977
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L180977  ENT
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L180989
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L180989  ENT
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L18099B
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L18099B  LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCS   L1809AD
         LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $60
L1809AD  RTL

L1809AE  ENT
         PHP
         REP   #$20
         LDA   #$0000
         SEP   #$20
         LDA   $05
         XBA
         REP   #$20
         LSR
         LSR
         TAX
         SEP   #$20
         LDA   $04
         BIT   #$40
         BEQ   L180A08
         LDA   L020B08,X
         EOR   #$FF
         INC
         PHA
         STZ   $09
         LDA   $04
         AND   #$BF
         STA   $08
         REP   #$20
         TXA
         CLC
         ADC   $08
         TAX
         SEP   #$20
         PLA
         CLC
         ADC   L020B08,X
         CLC
         ADC   #$80
         STA   $00
         LDA   $05
         CMP   #$96
         BCS   L1809F8
         LDA   $00
         BMI   L180A02
L1809F2  LDA   #$02
         STA   $01
         BRA   L180A06
L1809F8  LDA   $04
         CMP   #$76
         BCS   L1809F2
         LDA   $00
         BPL   L1809F2
L180A02  LDA   #$01
         STA   $01
L180A06  PLP
         RTL

L180A08  PHX
         LDA   $04
         REP   #$20
         AND   #$00FF
         CLC
         ADC   $01,S
         PLX
         TAX
         SEP   #$20
         LDA   L020B08,X
         STA   $00
         LDA   $05
         CMP   #$96
         BCS   L180A2A
         LDA   $00
         BPL   L180A34
L180A26  STZ   $01
         BRA   L180A38
L180A2A  LDA   $04
         CMP   #$0A
         BCC   L180A26
         LDA   $00
         BMI   L180A26
L180A34  LDA   #$01
         STA   $01
L180A38  PLP
         RTL

L180A3A  ENT
         PHP
         SEP   #$20
         STA   $64
         LDA   #$08
         STA   $44
         LDX   #L025E20
         STX   $60
L180A48  LDA   ($60)
         BEQ   L180A57
         LDX   $60
         INX
         STX   $60
         DEC   $44
         BNE   L180A48
         PLP
         RTL

L180A57  LDA   $64
         STA   ($60)
         REP   #$20
         LDA   $60
         CLC
         ADC   #$0008
         STA   $60
         SEP   #$20
         LDA   $68
         STA   ($60)
         REP   #$20
         LDA   $60
         CLC
         ADC   #$0008
         STA   $60
         SEP   #$20
         LDA   $69
         STA   ($60)
         PLP
         RTL

L180A7D  PHP
         SEP   #$20
         LDA   #$08
         STA   $44
         LDX   #L025E20
         STX   $6C
L180A89  LDA   ($6C)
         CMP   #$02
         BEQ   L180A9E
         BCS   L180AA5
L180A91  LDX   $6C
         INX
         STX   $6C
         DEC   $44
         BNE   L180A89
         PLP
         JMP   L180AAC

L180A9E  LDA   #$01
         STA   ($6C)
         JMP   L180A91

L180AA5  LDA   #$00
         STA   ($6C)
         JMP   L180A91

L180AAC  ENT
         PHP
         SEP   #$20
         LDA   #$08
         STA   $44
         LDX   #L025E20
         STX   $60
L180AB8  LDA   ($60)
         STA   $5C
         BEQ   L180AC2
         JSL   L180ACD
L180AC2  LDX   $60
         INX
         STX   $60
         DEC   $44
         BNE   L180AB8
         PLP
         RTL

L180ACD  LDX   $60
         PHX
         LDA   $44
         PHA
         DEC   $5C
         LDA   $5C
         STA   ($60)
         BEQ   L180B32
         DEC   $5C
         BEQ   L180AE2
         JMP   L180BC3

L180AE2  LDY   #$0010
         LDA   L024443
         CMP   ($60),Y
         BCC   L180B2A
         LDA   L024442
         SEC
         SBC   #$03
         STA   $5C
         LDY   #$0008
         LDA   ($60),Y
         STA   $64
         LDA   $5C
         CMP   $64
         BCS   L180B2A
         LDA   $5C
         CLC
         ADC   #$06
         STA   $5C
         CMP   $64
         BCC   L180B2A
         LDA   #$01
         STA   L0244A2
         LDA   L024443
         SEC
         SBC   #$03
         STA   $69
         STA   $5C
         LDY   #$0008
         LDA   ($60),Y
         STA   $68
         JSL   L0F0384
         JSL   L290F5E
L180B2A  LDA   #$05
         STA   L023FEC
         JMP   L180B37

L180B32  LDA   #$00
         STA   L023FEC
L180B37  LDY   #$0010
         LDA   ($60),Y
         STA   $69
         LDY   #$0008
         LDA   ($60),Y
         STA   $68
         LDX   $68
         PHX
         LDX   $68
         STX   $04
         JSL   L1809AE
         LDX   $00
         STX   $5C
         STZ   $61
         LDA   $69
         STA   $60
         LDX   $60
         LDA   L0206A8,X
         STA   $5D
         LDX   $5C
         STX   L023FEE
         LDA   #$90
         STA   $69
         LDX   $68
         STX   $04
         JSL   L1809AE
         LDX   $00
         STX   $5C
         LDA   #$E7
         STA   $5D
         LDX   $5C
         STX   L023FF0
         JSL   L0F2148
         PLX
         STX   $68
         INC   $68
         LDX   $68
         STX   $04
         JSL   L1809AE
         LDX   $00
         STX   $5C
         STZ   $61
         LDA   $69
         STA   $60
         LDX   $60
         LDA   L0206A8,X
         STA   $5D
         LDX   $5C
         STX   L023FEE
         LDA   #$90
         STA   $69
         LDX   $68
         STX   $04
         JSL   L1809AE
         LDX   $00
         STX   $5C
         LDA   #$E7
         STA   $5D
         LDX   $5C
         STX   L023FF0
         JSL   L0F2148
L180BC3  PLA
         STA   $44
         PLX
         STX   $60
         RTL

L180BCA  ENT
         PHP
         SEP   #$20
         LDX   #$0000
         STX   $68
         LDX   L024442
         STX   $60
         TXA
         STA   $5C
         LDA   L024321
         BNE   L180BF7
         LDA   #$02
         STA   $65
         LDA   $5C
         SEC
         SBC   #$20
         STA   $5C
         BCC   L180C1C
         CMP   #$40
         BCC   L180C0F
         LDA   #$20
         STA   $68
         JMP   L180C1C

L180BF7  LDA   #$03
         STA   $65
         LDA   $5C
         SEC
         SBC   #$1F
         STA   $5C
         BCC   L180C1C
         CMP   #$42
         BCC   L180C0F
         LDA   #$16
         STA   $68
         JMP   L180C1C

L180C0F  INC   $68
         LDA   $5C
         SEC
         SBC   $65
         STA   $5C
         BCS   L180C0F
         DEC   $68
L180C1C  LDA   $61
         SEC
         SBC   #$4F
         STA   $5C
         BCC   L180C4A
         CMP   #$3C
         BCC   L180C3D
         LDA   $65
         BIT   #$01
         BNE   L180C36
         LDA   #$1E
         STA   $69
         JMP   L180C4A

L180C36  LDA   #$14
         STA   $69
         JMP   L180C4A

L180C3D  INC   $69
         LDA   $5C
         SEC
         SBC   $65
         STA   $5C
         BCS   L180C3D
         DEC   $69
L180C4A  LDX   $68
         STX   L024440
         PLP
         RTL

L180C51  ENT
         PHP
         SEP   #$20
         LDA   L023E24
         CLC
         ADC   L024494
         CLC
         BIT   #$01
         BEQ   L180C61
         SEC
L180C61  ROR
         STA   L024494
         PLP
         RTL

L180C67  ENT
         PHP
         REP   #$20
         LDA   $60
         PHA
         LDA   $64
         PHA
         LDA   L024446
         STA   $60
         STA   $64
         ASL
         CLC
         ADC   $60
         STA   $64
         SEP   #$20
         LDA   $60
         ASL
         CLC
         ADC   $60
         CLC
         ADC   $65
         STA   $65
         STA   $5C
         REP   #$20
         LDA   $60
         LSR
         STA   $60
         CLC
         ADC   $64
         STA   $64
         STA   L024446
         SEP   #$20
         STA   $5C
         PLX
         STX   $64
         PLX
         STX   $60
         PLP
         RTL

L180CA7  PHP
         SEP   #$20
         STZ   $64
L180CAC  LDA   $5C
         SEC
         SBC   $60
         STA   $5C
         BCC   L180CBA
         INC   $64
         JMP   L180CAC

L180CBA  LDA   $5C
         CLC
         ADC   $60
         STA   $5C
         REP   #$20
         LDA   $5C
         PHA
         SEP   #$20
         LDA   $64
         STA   $5C
         JSL   L18048E
         REP   #$20
         PLA
         STA   $5C
         INC   $70
         INC   $70
         PLP
         RTL

L180CDB  PHP
         SEP   #$20
         STZ   $64
L180CE0  LDA   $5C
         SEC
         SBC   $60
         STA   $5C
         BCC   L180CEE
         INC   $64
         JMP   L180CE0

L180CEE  LDA   $5C
         CLC
         ADC   $60
         STA   $5C
         REP   #$20
         LDA   $5C
         PHA
         SEP   #$20
         LDA   $64
         STA   $5C
         JSL   L18042E
         REP   #$20
         PLA
         STA   $5C
         INC   $70
         PLP
         RTL

L180D0D  ENT
         PHP
         SEP   #$20
         LDA   #$02
         STA   $60
         LDX   #$0000
         STX   $70
         LDA   #$64
         STA   $60
         JSL   L180CA7
         LDA   #$0A
         STA   $60
         JSL   L180CDB
         LDA   #$01
         STA   $60
         JSL   L180CA7
         LDA   #$04
         STA   $60
         LDX   #$0000
         STX   $70
         LDA   #$08
         STA   $69
         LDA   #$06
         STA   $68
         PLP
         RTL

         MX    %00
L180D44  ENT
         LDA   L024328
         CMP   #$0000
         BNE   L180D4F
         JMP   L180DCC

L180D4F  LDA   L024328
         AND   #$0001
         BEQ   L180D66
         LDA   #$0001
         STA   L02432C
         LDA   L024328
         AND   #$00FE
         STA   L024328
L180D66  LDA   L024328
         AND   #$0002
         BEQ   L180D7D
         LDA   #$0001
         STA   L02432A
         LDA   L024328
         AND   #$00FD
         STA   L024328
L180D7D  LDA   L024328
         AND   #$0004
         BEQ   L180D95
         JSL   L180E09
         STZ   L02432C
         LDA   L024328
         AND   #$00FB
         STA   L024328
L180D95  LDA   L024328
         AND   #$0008
         BEQ   L180DAD
         JSL   L180E5F
         STZ   L02432A
         LDA   L024328
         AND   #$00F7
         STA   L024328
L180DAD  LDA   L024328
         AND   #$0010
         BEQ   L180DCC
         JSL   L180EB5
         JSL   L180EFB
         LDA   L024328
         AND   #$00EF
         STA   L024328
         STZ   L02432C
         STZ   L02432A
L180DCC  LDA   L02432C
         BEQ   L180DEA
         LDA   L025E40
         BEQ   L180DE0
         JSL   L180E09
         STZ   L025E40
         JMP   L180DEA

L180DE0  JSL   L180EB5
         LDA   #$0001
         STA   L025E40
L180DEA  LDA   L02432A
         BEQ   L180E08
         LDA   L025E42
         BEQ   L180DFE
         JSL   L180E5F
         STZ   L025E42
         JMP   L180E08

L180DFE  JSL   L180EFB
         LDA   #$0001
         STA   L025E42
L180E08  RTL

L180E09  ENT
         PHP
         REP   #$20
         LDX   #L0255D3
         STX   $28
         LDX   #^L0255D3
         STX   $2A
         LDY   #$6184
         STY   $24
         LDX   #$00E1
         STX   $26
         LDA   #$0010
L180E23  PHA
         LDY   #$0000
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   $24
         CLC
         ADC   #$00A0
         STA   $24
         TYA
         CLC
         ADC   $28
         STA   $28
         PLA
         DEC
         BNE   L180E23
         PLP
         RTL

L180E5F  ENT
         PHP
         REP   #$20
         LDX   #L025653
         STX   $28
         LDX   #^L025653
         STX   $2A
         LDY   #$6194
         STY   $24
         LDX   #$00E1
         STX   $26
         LDA   #$0010
L180E79  PHA
         LDY   #$0000
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   [$28],Y
         ORA   L025806
         STA   [$24],Y
         INY
         INY
         LDA   $24
         CLC
         ADC   #$00A0
         STA   $24
         TYA
         CLC
         ADC   $28
         STA   $28
         PLA
         DEC
         BNE   L180E79
         PLP
         RTL

L180EB5  LDA   #$6184
         STAL  L180ECA+1
         LDA   #$00E1
         SEP   #$20
         STAL  L180ECA+3
         REP   #$20
         LDA   L025806
L180ECA  STAL  $000000
         LDX   #$6184
         LDY   #$6185
         LDA   #$0006
         PHA
         LDA   #$0010
         PHA
L180EDC  LDA   $03,S
         PHB
         MVN   $E10000,$E10000
         PLB
         TYA
         CLC
         ADC   #$0098
         TAY
         LDX   #$6184
         PLA
         DEC
         PHA
         PHP
         LDA   #$0007
         STA   $04,S
         PLP
         BNE   L180EDC
         PLA
         PLA
         RTL

L180EFB  LDA   #$6194
         STAL  L180F10+1
         LDA   #$00E1
         SEP   #$20
         STAL  L180F10+3
         REP   #$20
         LDA   L025806
L180F10  STAL  $000000
         LDX   #$6194
         LDY   #$6195
         LDA   #$0006
         PHA
         LDA   #$0010
         PHA
L180F22  LDA   $03,S
         PHB
         MVN   $E10000,$E10000
         PLB
         TYA
         CLC
         ADC   #$0098
         TAY
         LDX   #$6194
         PLA
         DEC
         PHA
         PHP
         LDA   #$0007
         STA   $04,S
         PLP
         BNE   L180F22
         PLA
         PLA
         RTL

L180F41  ENT
         PHP
         SEP   #$20
         LDA   L024323
         BNE   L180F4B
         PLP
         RTL

L180F4B  INC   L025E38
         LDA   L025E38
         CMP   L025E3A
         BEQ   L180F5D
         CMP   L025E3C
         BEQ   L180F66
         PLP
         RTL

L180F5D  LDX   #$5555
         STX   L023D85
         JMP   L180F6F

L180F66  LDX   L025806
         STX   L023D85
         STZ   L025E38
L180F6F  LDX   #$00E1
         STX   $72
         LDA   L024323
         BIT   #$01
         BEQ   L180FD1
         LDX   #$000A
         LDY   #L025EA4
         STY   $6C
         LDY   #$7C68
         STY   $70
         REP   #$20
L180F8A  LDA   ($6C)
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $64
         AND   L023D85
         STA   $68
         LDA   [$70]
         AND   $78
         ORA   $68
         STA   [$70]
         INC   $70
         INC   $70
         INC   $6C
         INC   $6C
         LDA   ($6C)
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $64
         AND   L023D85
         STA   $68
         LDA   [$70]
         AND   $78
         ORA   $68
         STA   [$70]
         INC   $6C
         INC   $6C
         LDA   $70
         CLC
         ADC   #$009E
         STA   $70
         DEX
         BNE   L180F8A
L180FD1  REP   #$20
         LDA   L024323
         BIT   #$0002
         BEQ   L181031
         LDX   #$000A
         LDY   #L025ECC
         STY   $6C
         LDY   #$7C74
         STY   $70
         REP   #$20
L180FEA  LDA   ($6C)
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $64
         AND   L023D85
         STA   $68
         LDA   [$70]
         AND   $78
         ORA   $68
         STA   [$70]
         INC   $70
         INC   $70
         INC   $6C
         INC   $6C
         LDA   ($6C)
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $64
         AND   L023D85
         STA   $68
         LDA   [$70]
         AND   $78
         ORA   $68
         STA   [$70]
         INC   $6C
         INC   $6C
         LDA   $70
         CLC
         ADC   #$009E
         STA   $70
         DEX
         BNE   L180FEA
L181031  LDA   L024323
         BIT   #$0004
         BNE   L18103C
         JMP   L1810D5

L18103C  LDX   #$000C
         LDY   #L025EF4
         STY   $6C
         LDY   #$816C
         STY   $70
         REP   #$20
L18104B  LDA   ($6C)
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $64
         AND   L023D85
         STA   $68
         LDA   [$70]
         AND   $78
         ORA   $68
         STA   [$70]
         INC   $70
         INC   $70
         INC   $6C
         INC   $6C
         LDA   ($6C)
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $64
         AND   L023D85
         STA   $68
         LDA   [$70]
         AND   $78
         ORA   $68
         STA   [$70]
         INC   $70
         INC   $70
         INC   $6C
         INC   $6C
         LDA   ($6C)
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $64
         AND   L023D85
         STA   $68
         LDA   [$70]
         AND   $78
         ORA   $68
         STA   [$70]
         INC   $70
         INC   $70
         INC   $6C
         INC   $6C
         LDA   ($6C)
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $64
         AND   L023D85
         STA   $68
         LDA   [$70]
         AND   $78
         ORA   $68
         STA   [$70]
         INC   $6C
         INC   $6C
         LDA   $70
         CLC
         ADC   #$009A
         STA   $70
         DEX
         BEQ   L1810D5
         JMP   L18104B

L1810D5  PLP
         RTL

L1810D7  ENT
         PHP
         REP   #$20
         AND   #$FF00
         TAX
         LDA   $60
         PHA
         LDA   $64
         PHA
         LDA   $68
         PHA
         LDA   $70
         PHA
         LDA   $6C
         PHA
         TXA
         CLC
         ADC   #L024548
         STA   $70
         STA   L025F68
         TXA
         XBA
         SEP   #$20
         STA   L02445B
         REP   #$20
         JMP   L181160

L181103  ENT
         PHP
         REP   #$20
         LDA   $60
         PHA
         LDA   $64
         PHA
         LDA   $68
         PHA
         LDA   $70
         PHA
         LDA   $6C
         PHA
         SEP   #$20
         LDA   L02445B
         STA   $61
         STZ   $60
         REP   #$20
         LDA   #L024548
         CLC
         ADC   $60
         STA   L025F68
         CLC
         ADC   #$0002
         STA   $70
         SEP   #$20
         LDA   #$00
         STA   ($70)
         REP   #$20
         JMP   L181160

L18113A  PHP
         REP   #$20
         LDA   $60
         PHA
         LDA   $64
         PHA
         LDA   $68
         PHA
         LDA   $70
         PHA
         LDA   $6C
         PHA
         LDA   #L024548
         STA   $70
         LDA   L02445B
         AND   #$00FF
         XBA
         CLC
         ADC   $70
         STA   $70
         STA   L025F68
L181160  LDA   L025F68
         STA   $70
         LDA   #L024D58
         STA   $6C
         LDY   #$0001
         SEP   #$20
         LDA   ($6C),Y
         STA   ($70)
         CMP   #$E8
         REP   #$20
         BCC   L18117C
         JMP   L181513

L18117C  LDA   $70
         CLC
         ADC   #$0004
         STA   $70
         SEP   #$20
         LDA   L024456
         STA   $5C
L18118B  LDA   $5C
         PHA
         LDY   #$0003
         LDA   ($6C),Y
         STA   $5C
         LDY   #$0001
         LDA   ($6C),Y
         STA   $60
         LDA   $5C
         SEC
         SBC   $60
         STA   $5C
         BNE   L1811A8
         JMP   L181480

L1811A8  BPL   L1811B0
         PLA
         STA   $5C
         JMP   L181506

L1811B0  STA   $69
         LDY   #$0002
         LDA   ($6C),Y
         STA   $5C
         LDA   ($6C)
         STA   $64
         LDA   $5C
         SEC
         SBC   $64
         STA   $5C
         BCC   L181244
         STA   $68
         CMP   $69
         BCS   L18120B
         LDA   $69
         LSR
         STA   $5C
         LDA   $69
         STA   $60
         INC   $60
L1811D7  LDA   $64
         STA   ($70)
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCC   L1811F3
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $60
         BNE   L1811D7
         JMP   L1812CE

L1811F3  LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $64
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $60
         BNE   L1811D7
         JMP   L1812CE

L18120B  LDA   $68
         LSR
         STA   $5C
         LDA   $68
         STA   $60
         LDA   $64
         STA   ($70)
L181218  INC   $64
         LDA   $5C
         SEC
         SBC   $69
         STA   $5C
         BCC   L18122A
         DEC   $60
         BNE   L181218
         JMP   L1812D6

L18122A  LDA   $5C
         CLC
         ADC   $68
         STA   $5C
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         LDA   $64
         STA   ($70)
         DEC   $60
         BNE   L181218
         JMP   L1812D6

L181244  LDA   $5C
         EOR   #$FF
         INC
         STA   $5C
         STA   $68
         CMP   $69
         BCS   L18128F
         LDA   $69
         LSR
         STA   $5C
         LDA   $69
         INC
         STA   $60
L18125B  LDA   $64
         STA   ($70)
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCC   L181277
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $60
         BNE   L18125B
         JMP   L1812CE

L181277  LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         DEC   $64
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $60
         BNE   L18125B
         JMP   L1812CE

L18128F  LDA   $68
         LSR
         STA   $5C
         LDA   $68
         STA   $60
L181298  LDA   $5C
         SEC
         SBC   $69
         STA   $5C
         BCC   L1812AE
         DEC   $64
         DEC   $60
         BNE   L181298
         LDA   $64
         STA   ($70)
         JMP   L1812D6

L1812AE  LDA   $5C
         CLC
         ADC   $68
         STA   $5C
         LDA   $64
         STA   ($70)
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $64
         DEC   $60
         BNE   L181298
         LDA   $64
         STA   ($70)
         JMP   L1812D6

L1812CE  REP   #$20
         DEC   $70
         DEC   $70
         SEP   #$20
L1812D6  PLA
         STA   $5C
         REP   #$20
         INC   $6C
         INC   $6C
         SEP   #$20
         DEC   $5C
         BEQ   L1812E8
         JMP   L18118B

L1812E8  LDY   #$0001
         LDA   L024D58,Y
         STA   $68
         LDA   ($6C),Y
         SEC
         SBC   $68
         INC
         STA   $5C
         REP   #$20
         LDA   L025F68
         INC
         STA   $70
         SEP   #$20
         LDA   $5C
         STA   ($70)
         REP   #$20
         LDA   #L024D78
         STA   $6C
         LDA   $70
         CLC
         ADC   #$0004
         STA   $70
         SEP   #$20
         LDA   L024457
         STA   $5C
L18131C  LDA   $5C
         PHA
         LDY   #$0003
         LDA   ($6C),Y
         STA   $5C
         LDY   #$0001
         LDA   ($6C),Y
         STA   $60
         LDA   $5C
         SEC
         SBC   $60
         STA   $5C
         BNE   L181339
         JMP   L1814C3

L181339  BPL   L181341
         PLA
         STA   $5C
         JMP   L181506

L181341  LDA   $5C
         STA   $69
         LDY   #$0002
         LDA   ($6C),Y
         STA   $5C
         LDA   ($6C)
         STA   $64
         LDA   $5C
         SEC
         SBC   $64
         STA   $5C
         BCS   L18135C
         JMP   L1813DF

L18135C  STA   $68
         CMP   $69
         BCS   L1813A0
         LDA   $69
         LSR
         STA   $5C
         LDA   $69
         INC
         STA   $60
L18136C  LDA   $64
         STA   ($70)
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCC   L181388
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $60
         BNE   L18136C
         JMP   L181463

L181388  LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $64
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $60
         BNE   L18136C
         JMP   L181463

L1813A0  LDA   $68
         LSR
         STA   $5C
         LDA   $68
         STA   $60
L1813A9  LDA   $5C
         SEC
         SBC   $69
         STA   $5C
         BCC   L1813BF
         INC   $64
         DEC   $60
         BNE   L1813A9
         LDA   $64
         STA   ($70)
         JMP   L18146B

L1813BF  LDA   $5C
         CLC
         ADC   $68
         STA   $5C
         LDA   $64
         STA   ($70)
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         INC   $64
         DEC   $60
         BNE   L1813A9
         LDA   $64
         STA   ($70)
         JMP   L18146B

L1813DF  LDA   $5C
         EOR   #$FF
         INC
         STA   $5C
         STA   $68
         CMP   $69
         BCS   L18142A
         LDA   $69
         LSR
         STA   $5C
         LDA   $69
         INC
         STA   $60
L1813F6  LDA   $64
         STA   ($70)
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCC   L181412
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $60
         BNE   L1813F6
         JMP   L181463

L181412  LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         DEC   $64
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         DEC   $60
         BNE   L1813F6
         JMP   L181463

L18142A  LDA   $68
         LSR
         STA   $5C
         LDA   $68
         STA   $60
         LDA   $64
         STA   ($70)
L181437  DEC   $64
         LDA   $5C
         SEC
         SBC   $69
         STA   $5C
         BCC   L181449
         DEC   $60
         BNE   L181437
         JMP   L18146B

L181449  LDA   $5C
         CLC
         ADC   $68
         STA   $5C
         REP   #$20
         INC   $70
         INC   $70
         SEP   #$20
         LDA   $64
         STA   ($70)
         DEC   $60
         BNE   L181437
         JMP   L18146B

L181463  REP   #$20
         DEC   $70
         DEC   $70
         SEP   #$20
L18146B  PLA
         STA   $5C
         REP   #$20
         INC   $6C
         INC   $6C
         SEP   #$20
         DEC   $5C
         BEQ   L18147D
         JMP   L18131C
L18147D  JMP   L181513

L181480  LDY   #$0002
         LDA   ($6C),Y
         STA   $5C
         LDA   ($6C)
         STA   $64
         LDA   $5C
         CMP   $64
         BCS   L1814AA
         LDA   $5C
         STA   ($70)
         PLA
         STA   $5C
         REP   #$20
         INC   $6C
         INC   $6C
         SEP   #$20
         DEC   $5C
         BEQ   L1814A7
         JMP   L18118B
L1814A7  JMP   L1812E8

L1814AA  LDA   $64
         STA   ($70)
         PLA
         STA   $5C
         REP   #$20
         INC   $6C
         INC   $6C
         SEP   #$20
         DEC   $5C
         BEQ   L1814C0
         JMP   L18118B
L1814C0  JMP   L1812E8

L1814C3  LDY   #$0002
         LDA   ($6C),Y
         STA   $5C
         LDA   ($6C)
         STA   $64
         LDA   $5C
         CMP   $64
         BCS   L1814ED
         LDA   $64
         STA   ($70)
         PLA
         STA   $5C
         REP   #$20
         INC   $6C
         INC   $6C
         SEP   #$20
         DEC   $5C
         BEQ   L1814EA
         JMP   L18131C
L1814EA  JMP   L181513

L1814ED  LDA   $5C
         STA   ($70)
         PLA
         STA   $5C
         REP   #$20
         INC   $6C
         INC   $6C
         SEP   #$20
         DEC   $5C
         BEQ   L181503
         JMP   L18131C
L181503  JMP   L181513

L181506  REP   #$20
         LDA   L025F68
         STA   $70
         SEP   #$20
         LDA   #$E8
         STA   ($70)
L181513  REP   #$20
         PLA
         STA   $6C
         PLA
         STA   $70
         PLA
         STA   $68
         PLA
         STA   $64
         PLA
         STA   $60
         PLP
         RTL

L181526  ENT
         PHP
         SEP   #$20
         LDX   $60
         PHX
         LDX   $64
         PHX
         LDX   $68
         PHX
         LDX   $70
         PHX
         LDX   $6C
         PHX
         LDX   #L024D98
         INX
         STX   $6C
         LDA   L024458
         STA   $65
         LDX   #$0000
         STX   $68
         LDA   $68
         STA   $64
         LDA   ($6C)
         STA   $5C
         STA   $5D
L181552  DEC   $65
         BEQ   L18157D
         LDY   $6C
         INY
         INY
         STY   $6C
         INC   $64
         LDA   $5C
         CMP   ($6C)
         BCC   L18156C
         LDA   ($6C)
         STA   $5C
         LDA   $64
         STA   $68
L18156C  LDA   $5D
         CMP   ($6C)
         BCS   L181552
         LDA   ($6C)
         STA   $5D
         LDA   $64
         STA   $69
         JMP   L181552

L18157D  REP   #$20
         LDA   $5C
         XBA
         STA   $5C
         LDA   $68
         PHA
         STZ   $64
         SEP   #$20
         LDA   $68
         ASL
         STA   $5C
         STZ   $5D
         REP   #$20
         INC   $5C
         LDA   #L024D98
         CLC
         ADC   $5C
         STA   $6C
         LDA   #L024D58
         STA   $70
         SEP   #$20
L1815A5  LDA   ($6C)
         STA   $5C
         LDX   $6C
         DEX
         STX   $6C
         LDY   #$0001
         LDA   $5C
         STA   ($70),Y
         LDA   ($6C)
         STA   $5C
         LDX   $6C
         DEX
         STX   $6C
         LDA   $5C
         STA   ($70)
         LDX   $70
         INX
         INX
         STX   $70
         INC   $64
         DEC   $68
         BPL   L1815E5
         LDA   L024458
         DEC
         STA   $68
         ASL
         STA   $5C
         REP   #$20
         INC   $5C
         LDA   #L024D98
         CLC
         ADC   $5C
         STA   $6C
         SEP   #$20
L1815E5  LDA   $68
         STA   $5C
         CMP   $69
         BNE   L1815A5
         LDA   ($6C)
         STA   $5C
         LDX   $6C
         DEX
         STX   $6C
         LDY   #$0001
         LDA   $5C
         STA   ($70),Y
         LDA   ($6C)
         STA   $5C
         STA   ($70)
         PLX
         STX   $68
         LDA   $68
         ASL
         STA   $5C
         STZ   $5D
         REP   #$20
         LDA   #L024D98
         CLC
         ADC   $5C
         STA   $6C
         LDA   #L024D78
         STA   $70
         SEP   #$20
L18161E  LDA   ($6C)
         STA   $5C
         LDX   $6C
         INX
         STX   $6C
         LDA   $5C
         STA   ($70)
         LDA   ($6C)
         STA   $5C
         LDX   $6C
         INX
         STX   $6C
         LDA   $5C
         LDY   #$0001
         STA   ($70),Y
         LDX   $70
         INX
         INX
         STX   $70
         INC   $65
         INC   $68
         LDA   L024458
         STA   $5C
         CMP   $68
         BNE   L181655
         STZ   $68
         LDX   #L024D98
         STX   $6C
L181655  LDA   $68
         STA   $5C
         CMP   $69
         BNE   L18161E
         LDA   ($6C)
         STA   $5C
         LDX   $6C
         INX
         STX   $6C
         LDA   $5C
         STA   ($70)
         LDA   ($6C)
         STA   $5C
         LDY   #$0001
         STA   ($70),Y
         LDX   $64
         STX   L024456
         JSL   L18113A
         LDA   L02445B
         STA   $61
         STZ   $60
         REP   #$20
         LDA   #L024548
         CLC
         ADC   $60
         STA   $6C
         STA   L025F6A
         SEP   #$20
         LDA   ($6C)
         STA   $5C
         CMP   #$E8
         BCC   L18169D
         JMP   L1819C2

L18169D  LDX   $6C
         INX
         STX   $6C
         LDA   ($6C)
         STA   $65
         REP   #$20
         LDA   $6C
         CLC
         ADC   #$0003
         STA   $6C
L1816B0  REP   #$20
         LDA   ($6C)
         STA   $68
         INC   $6C
         INC   $6C
         SEP   #$20
         LDA   $69
         CMP   $68
         BCC   L1816DA
         DEC   $65
         BNE   L1816B0
         REP   #$20
         LDA   L025F6A
         INC
         INC
         STA   $6C
         SEP   #$20
         LDA   ($6C)
         AND   #$7F
         STA   ($6C)
         JMP   L1819C2

L1816DA  SEP   #$20
         LDX   L025F6A
         INX
         INX
         STX   $6C
         LDA   ($6C)
         ORA   #$80
         STA   ($6C)
         BIT   #$01
         BNE   L1816F0
         JMP   L1819C2

L1816F0  LDX   $6C
         INX
         INX
         STX   $6C
         LDA   L024457
         STA   $61
         LDX   #L024D78
         STX   $70
L181700  LDY   #$0003
         LDA   ($70),Y
         STA   $69
         LDY   #$0001
         LDA   ($70),Y
         STA   $65
         LDA   $69
         SEC
         SBC   $65
         STA   $69
         LDY   #$0002
         LDA   ($70),Y
         STA   $5C
         LDA   ($70)
         STA   $64
         LDA   $5C
         SEC
         SBC   $64
         STA   $5C
         BCS   L18172C
         JMP   L1817AF

L18172C  LDA   $5C
         STA   $68
         CMP   $69
         BCS   L18176E
         LDA   $69
         LSR
         STA   $5C
         LDA   $69
         INC
         STA   $65
L18173E  LDA   $64
         STA   ($6C)
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCC   L181758
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $65
         BNE   L18173E
         JMP   L181847

L181758  LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $64
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $65
         BNE   L18173E
         JMP   L181847

L18176E  LDA   $69
         STA   $5C
         BEQ   L1817A8
         LDA   $68
         LSR
         STA   $5C
         LDA   $68
         INC
         STA   $65
         LDA   $64
         STA   ($6C)
L181782  DEC   $65
         BNE   L181789
         JMP   L18184D

L181789  INC   $64
         LDA   $5C
         SEC
         SBC   $69
         STA   $5C
         BCS   L181782
         LDA   $5C
         CLC
         ADC   $68
         STA   $5C
         LDX   $6C
         INX
         INX
         STX   $6C
         LDA   $64
         STA   ($6C)
         JMP   L181782

L1817A8  LDA   $64
         STA   ($6C)
         JMP   L18184D

L1817AF  LDA   $5C
         EOR   #$FF
         INC
         STA   $5C
         STA   $68
         LDA   $5C
         CMP   $69
         BCS   L1817F8
         LDA   $69
         LSR
         STA   $5C
         LDA   $69
         INC
         STA   $65
L1817C8  LDA   $64
         STA   ($6C)
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCC   L1817E2
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $65
         BNE   L1817C8
         JMP   L181847

L1817E2  LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         DEC   $64
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $65
         BNE   L1817C8
         JMP   L181847

L1817F8  LDA   $69
         STA   $5C
         BEQ   L18183B
         LDA   $68
         LSR
         STA   $5C
         LDA   $68
         STA   $65
L181807  LDA   $5C
         SEC
         SBC   $69
         STA   $5C
         BCC   L18181D
         DEC   $64
         DEC   $65
         BNE   L181807
         LDA   $64
         STA   ($6C)
         JMP   L18184D

L18181D  LDA   $5C
         CLC
         ADC   $68
         STA   $5C
         LDA   $64
         STA   ($6C)
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $64
         DEC   $65
         BNE   L181807
         LDA   $64
         STA   ($6C)
         JMP   L18184D

L18183B  LDY   #$0002
         LDA   ($70),Y
         STA   $5C
         STA   ($6C)
         JMP   L18184D

L181847  LDX   $6C
         DEX
         DEX
         STX   $6C
L18184D  LDX   $70
         INX
         INX
         STX   $70
         DEC   $61
         BEQ   L18185A
         JMP   L181700

L18185A  REP   #$20
         LDA   L025F6A
         CLC
         ADC   #$0005
         STA   $6C
         LDA   #L024D58
         STA   $70
         SEP   #$20
         LDA   L024456
         STA   $61
L181871  LDY   #$0003
         LDA   ($70),Y
         STA   $69
         LDY   #$0001
         LDA   ($70),Y
         STA   $65
         LDA   $69
         SEC
         SBC   $65
         STA   $69
         LDY   #$0002
         LDA   ($70),Y
         STA   $5C
         LDA   ($70)
         STA   $64
         LDA   $5C
         SEC
         SBC   $64
         STA   $5C
         BCS   L18189D
         JMP   L18192C

L18189D  LDA   $5C
         STA   $68
         CMP   $69
         BCS   L1818DF
         LDA   $69
         LSR
         STA   $5C
         LDA   $69
         INC
         STA   $65
L1818AF  LDA   $64
         STA   ($6C)
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCC   L1818C9
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $65
         BNE   L1818AF
         JMP   L1819AF

L1818C9  LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         INC   $64
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $65
         BNE   L1818AF
         JMP   L1819AF

L1818DF  LDA   $69
         BEQ   L181920
         LDA   $68
         LSR
         STA   $5C
         LDA   $68
         STA   $65
L1818EC  LDA   $5C
         SEC
         SBC   $69
         STA   $5C
         BCC   L181902
         INC   $64
         DEC   $65
         BNE   L1818EC
         LDA   $64
         STA   ($6C)
         JMP   L1819B5

L181902  LDA   $68
         CLC
         ADC   $5C
         STA   $5C
         LDA   $64
         STA   ($6C)
         LDX   $6C
         INX
         INX
         STX   $6C
         INC   $64
         DEC   $65
         BNE   L1818EC
         LDA   $64
         STA   ($6C)
         JMP   L1819B5

L181920  LDY   #$0002
         LDA   ($70),Y
         STA   $5C
         STA   ($6C)
         JMP   L1819B5

L18192C  LDA   $5C
         EOR   #$FF
         INC
         STA   $5C
         STA   $68
         CMP   $69
         BCS   L181973
         LDA   $69
         LSR
         STA   $5C
         LDA   $69
         INC
         STA   $65
L181943  LDA   $64
         STA   ($6C)
         LDA   $5C
         SEC
         SBC   $68
         STA   $5C
         BCC   L18195D
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $65
         BNE   L181943
         JMP   L1819AF

L18195D  LDA   $5C
         CLC
         ADC   $69
         STA   $5C
         DEC   $64
         LDX   $6C
         INX
         INX
         STX   $6C
         DEC   $65
         BNE   L181943
         JMP   L1819AF

L181973  LDA   $69
         BEQ   L1819A8
         LDA   $68
         LSR
         STA   $5C
         LDA   $68
         INC
         STA   $65
         LDA   $64
         STA   ($6C)
L181985  DEC   $65
         BEQ   L1819B5
         DEC   $64
         LDA   $5C
         SEC
         SBC   $69
         STA   $5C
         BCS   L181985
         LDA   $5C
         CLC
         ADC   $68
         STA   $5C
         LDX   $6C
         INX
         INX
         STX   $6C
         LDA   $64
         STA   ($6C)
         JMP   L181985

L1819A8  LDA   $64
         STA   ($6C)
         JMP   L1819B5

L1819AF  LDX   $6C
         DEX
         DEX
         STX   $6C
L1819B5  LDX   $70
         INX
         INX
         STX   $70
         DEC   $61
         BEQ   L1819C2
         JMP   L181871

L1819C2  PLX
         STX   $6C
         PLX
         STX   $70
         PLX
         STX   $68
         PLX
         STX   $64
         PLX
         STX   $60
         PLP
         RTL

L1819D3  ENT
         PHP
         REP   #$20
         AND   #$FF00
         TAX
         LDA   $5C
         PHA
         LDA   $60
         PHA
         LDA   $64
         PHA
         LDA   $6C
         PHA
         LDA   $70
         PHA
         LDA   #$00E1
         STA   $72
         TXA
         CLC
         ADC   #L024548
         STA   $6C
         LDY   #$0001
         LDA   ($6C),Y
         AND   #$00FF
         STA   L025F6C
         LDA   ($6C)
         AND   #$00FF
         STA   $60
         LDA   $6C
         CLC
         ADC   #$0004
         STA   $6C
         SEP   #$20
         LDA   L02444A
         SEC
         SBC   $60
         STA   $5C
         BCC   L181A4E
         BEQ   L181A4E
         LDA   $5C
         STA   $64
         SEC
         SBC   L025F6C
         STA   $5C
         BCC   L181A2C
         JMP   L181C9A

L181A2C  LDA   $5C
         EOR   #$FF
         INC
         STA   L025F6C
         LDA   $60
         CLC
         ADC   $64
         STA   $60
         LDA   $64
         ASL
         STA   $5C
         REP   #$20
         PHA
         AND   #$00FF
         CLC
         ADC   $6C
         STA   $6C
         PLA
         SEP   #$20
L181A4E  LDA   $60
         REP   #$20
         AND   #$00FF
         ASL
         TAX
         LDA   L020368,X
         STA   $70
         LDA   L0244D2
         AND   #$00FF
         ASL
         CLC
         ADC   $70
         STA   $70
L181A68  LDA   $70
         PHA
         LDA   ($6C)
         STA   $5C
         INC   $6C
         INC   $6C
         LDA   $5C
         AND   #$0007
         ASL
         TAX
         LDA   L025F6E,X
         STA   $64
         EOR   #$FFFF
         STA   $78
         LDA   $5D
         AND   #$0007
         ASL
         CLC
         ADC   #$0010
         TAX
         LDA   L025F6E,X
         STA   $68
         EOR   #$FFFF
         STA   $7C
         SEP   #$20
         LDA   $5D
         LSR
         LSR
         LSR
         STA   $60
         LDA   $5C
         LSR
         LSR
         LSR
         STA   $5C
         LDA   $60
         SEC
         SBC   $5C
         STA   $60
         LDA   $5C
         REP   #$20
         AND   #$00FF
         ASL
         CLC
         ADC   $70
         STA   $70
         SEP   #$20
         LDA   $60
         CMP   #$08
         BCC   L181AC9
         LDA   #$07
         STA   $60
L181AC9  LDA   $60
         ASL
         STA   $60
         REP   #$20
         LDA   L0244C4
         ROR
         ROR   L0244C4
         ROR
         ROR   L0244C4
         ROR
         ROR   L0244C4
         ROR
         ROR   L0244C4
         LDA   L0244C4
         STA   $5C
         AND   $64
         STA   $64
         LDA   $5C
         AND   $68
         STA   $68
         LDA   $60
         AND   #$00FF
         TAX
         JMP   (L181AFB,X)

L181AFB  DA    L181B0D
         DA    L181B20
         DA    L181B37
         DA    L181B56
         DA    L181B7B
         DA    L181BA6
         DA    L181BD7
         DA    L181C0E
         DA    L181C4B
L181B0D  LDA   $64
         AND   $68
         STA   $68
         LDA   $78
         ORA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
         JMP   L181C8B

L181B20  LDA   $78
         AND   [$70]
         ORA   $64
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
         JMP   L181C8B

L181B37  LDA   $78
         AND   [$70]
         ORA   $64
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $5C
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
         JMP   L181C8B

L181B56  LDA   $78
         AND   [$70]
         ORA   $64
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $5C
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
         JMP   L181C8B

L181B7B  LDA   $78
         AND   [$70]
         ORA   $64
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $5C
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
         JMP   L181C8B

L181BA6  LDA   $78
         AND   [$70]
         ORA   $64
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $5C
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
         JMP   L181C8B

L181BD7  LDA   $78
         AND   [$70]
         ORA   $64
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $5C
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
         JMP   L181C8B

L181C0E  LDA   $78
         AND   [$70]
         ORA   $64
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $5C
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
         JMP   L181C8B

L181C4B  LDA   $78
         AND   [$70]
         ORA   $64
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $5C
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         STA   [$70]
         INC   $70
         INC   $70
         LDA   $7C
         AND   [$70]
         ORA   $68
         STA   [$70]
L181C8B  PLA
         CLC
         ADC   #$00A0
         STA   $70
         DEC   L025F6C
         BEQ   L181C9A
         JMP   L181A68

L181C9A  REP   #$20
         PLA
         STA   $70
         PLA
         STA   $6C
         PLA
         STA   $64
         PLA
         STA   $60
         PLA
         STA   $5C
         PLP
         RTL

         MX    %11
L181CAD  ENT
         ADRL  $00000000
L181CB1  DW    $0001
         DW    $A55A
	 PHP
         PHB
         REP   #$30
         PHA
         PHX
         PHY
         SEP   #$30
         LDA   #$01
         STAL  L181CB1
         LDA   #^L023E18
         PHA
         PLB
         REP   #$30
         LDAL  L0242D5
         BEQ   L181CDA
         LDAL  L027AFC
         BNE   L181CDA
         JSL   L290B2B
L181CDA  REP   #$20
         LDAL  L023C89
         BEQ   L181CEB
         SEC
         SBC   #$000A
         BPL   L181CEB
         LDA   #$0000
L181CEB  STAL  L023C89
         LDAL  L023E1E
         INC
         STAL  L023E1E
         CMP   #$0004
         BCC   L181D0B
         LDA   #$0001
         STAL  L023E20
         LDA   #$0000
         STAL  L023E1E
L181D0B  LDAL  L023E1A
         INC
         STAL  L023E1A
         CMP   #$000A
         BCC   L181D27
         LDA   #$0001
         STAL  L023E1C
         LDA   #$0000
         STAL  L023E1A
L181D27  LDAL  L023E24
         INC
         STAL  L023E24
         SEP   #$20
         LDAL  L023E26
         INC
         STAL  L023E26
         REP   #$20
         LDA   #$0001
         STAL  L023E22
         LDAL  L023E28
         CMP   #$00FF
         BNE   L181D63
         LDAL  L023E16
         BEQ   L181D7E
         DEC
         STAL  L023E16
         BNE   L181D7E
         LDA   #$0001
         STAL  L023E14
         BRA   L181D7E
L181D63  LDAL  L023E2A
         BEQ   L181D77
         DEC
         BEQ   L181D70
         DEC
         BEQ   L181D70
         DEC
L181D70  STAL  L023E2A
         JMP   L181D7E

L181D77  LDA   #$0001
         STAL  L023E12
L181D7E  SEP   #$20
         REP   #$30
         PLY
         PLX
         PLA
         PLB
         SEP   #$30
         PLP
         CLC
         RTL

         DB    $00
         DB    $00
         ADRL  $00000000
         DW    $A55A
         PHP
         REP   #$30
         SEP   #$30
         PLP
         RTL

