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

         REL
	 mx	%00

	 use	MAIN.X.S
	 use	MAIN.E.S

	 use	4/Mem.Macs
	 use	4/Misc.Macs
	 use	4/Util.Macs
	 
*-------------------------------

         JMP   L01004B

         ADRL  L12023B
         ADRL  L070EAB
         ADRL  L030FB1
         ADRL  L0303D9
         ADRL  L0F0384
         ADRL  L12034E
         ADRL  L200CA6
         ADRL  L010408
         ADRL  L0105BD
         ADRL  L20055D
         ADRL  L0503D4
         ADRL  L051B47
         ADRL  L0534D4
         ADRL  L201410
         ADRL  L0E0000
         ADRL  L1106C0
         ADRL  L110CA0
         ADRL  L111460

L01004B  PHP
         REP   #$20
         PHB
         PHA
         SEP   #$20
         LDA   #^L0242FD
         PHA
         PLB
         REP   #$20
         PLA
         STA   L020000
         JSL   L0F0146
         JSL   L29096B
         TSC
         STAL  L020353
         LDX   #L020368
         STX   L023FE8
         PEA   ^L181CAD
         PEA   L181CAD
         _SetHeartBeat
         PEA   $0002
         _IntSource
         JSL   L0F322A
         LDA   L0242EB
         ORA   L0242ED
         BEQ   L0100A7
         LDA   L0242ED
         PHA
         LDA   L0242EB
         PHA
         _DisposeHandle
         STZ   L0242EB
         STZ   L0242ED
L0100A7  LDA   L0242EF
         ORA   L0242F1
         BEQ   L0100C4
         LDA   L0242F1
         PHA
         LDA   L0242EF
         PHA
         _DisposeHandle
         STZ   L0242EF
         STZ   L0242F1
L0100C4  LDA   L0242F3
         ORA   L0242F5
         BEQ   L0100E1
         LDA   L0242F5
         PHA
         LDA   L0242F3
         PHA
         _DisposeHandle
         STZ   L0242F3
         STZ   L0242F5
L0100E1  LDA   L023E30
         BNE   L0100F2
         ldal  L2B0000		; Off-disk protection scheme
         sta   L023E30		; replacement
*         JSL   L2B0000
*         LDA   L023E30		; LoGo 8/2020
         BNE   L0100F2
         JMP   L01023F

L0100F2  LDA   L023E2C
         BNE   L0100FE
         JSL   L140037
         JMP   L010102

L0100FE  JSL   L1400E8
L010102  JSL   L11232C
         STZ   $5C
         JSL   L0105BD
         STA   L020051
         LDA   #$0001
         STA   L0257F8
L010115  JSL   L12031F
         JSL   L0F00F0
         LDA   L023E06
         BEQ   L010128
         LDA   #$0001
         STA   L023E10
L010128  JSL   L010382
         LDA   L023E06
         BNE   L010143
         LDA   #$0000
         STAL  L024313
         STAL  L024315
         STAL  L024317
         JMP   L010151

L010143  LDX   #L0244BC
         LDY   #L024313
         LDA   #$0005
         PHB
         MVN   L0244BC,L024313
         PLB
L010151  LDA   L020057
         BEQ   L010160
         JSL   L010714
         STZ   L020057
         JMP   L010188

L010160  LDA   L0257F4
         CMP   #$0001
         BNE   L010174
         STZ   L0257F4
         STZ   $5C
         JSL   L01063E
         JMP   L010188

L010174  LDA   L0257F6
         CMP   #$0001
         BNE   L010188
         STZ   L0257F6
         LDA   #$0001
         STA   $5C
         JSL   L01063E
L010188  JSL   L12031F
         JSL   L0F2F42
         JSL   L180E5F
         JSL   L180E09
         JSL   L120C11
L01019C  ENT
         REP   #$20
         LDA   L0242E3
         BEQ   L0101AC
         PHA
         JSL   L0E00B9
         PLA
         STA   L0242E3
L0101AC  LDA   L0242E7
         BEQ   L0101BA
         PHA
         JSL   L0E00B9
         PLA
         STA   L0242E7
L0101BA  LDA   L0242E5
         BEQ   L0101C8
         PHA
         JSL   L0E00B9
         PLA
         STA   L0242E5
L0101C8  LDA   #$FFFF
         STA   L024426
         LDA   L0257F8
         BEQ   L0101D7
         JSL   L1803A2
L0101D7  LDX   #L020368
         STX   L023FE8
         STZ   L020002
         JSL   L290C4C
         LDA   L023E0C
         BNE   L01023F
         LDA   L024546
         CMP   #$0001
         BNE   L0101F7
         STZ   L023E06
         JMP   L010115

L0101F7  LDA   L0257F4
         CMP   #$0001
         BNE   L01020E
         LDA   L020051
         STA   L023E10
         LDA   #$0001
         STA   L020055
         JMP   L010115

L01020E  LDA   L0257F6
         CMP   #$0001
         BNE   L01022D
         LDA   #$0001
         STA   $5C
         JSL   L0105BD
         LDA   $5C
         STA   L023E10
         LDA   #$0001
         STA   L020055
         JMP   L010115

L01022D  JSL   L0F00F0
         LDA   L023E04
         CMP   #$0001
         STZ   L023E04
         BNE   L01023F
         JMP   L010115

L01023F  REP   #$20
         JSL   L0F01AC
         JSL   L290D1B
         PEA   ^L181CAD
         PEA   L181CAD
         _DelHeartBeat
         JSL   L0F0182
         PLB
         PLP
         RTL

L01025D  ENT
         STZ   L024412
         LDA   #$FFFF
         STA   L024426
         LDA   #$0015
         STA   L02436A
         LDA   #$0002
         JSL   L0729D4
         LDX   #L0257DF
         LDY   #L024538
         LDA   #$0007
         PHB
         MVN   L0257DF,L024538
         PLB
         LDY   #$001A
         LDX   #$0000
L010287  LDA   #$FFFF
         STA   L0256D3,X
         INX
         INX
         LDA   #$00F0
         STA   L0256D3,X
         INX
         INX
         LDA   #$4E30
         STA   L0256D3,X
         INX
         INX
         LDA   #L020B08
         STA   L0256D3,X
         INX
         INX
         LDA   #$0000
         STA   L0256D3,X
         INX
         INX
         DEY
         BNE   L010287
         STZ   L024E00
         LDX   #L024E00
         LDY   #L024E01
         LDA   #$005E
         PHB
         MVN   L024E00,L024E00
         PLB
         STZ   L024E60
         LDX   #L024E60
         LDY   #L024E61
         LDA   #$005E
         PHB
         MVN   L024E60,L024E60
         PLB
         STZ   L024EC0
         LDX   #L024EC0
         LDY   #L024EC1
         LDA   #$005E
         PHB
         MVN   L024EC0,L024EC0
         PLB
         STZ   L024F20
         LDX   #L024F20
         LDY   #L024F21
         LDA   #$005E
         PHB
         MVN   L024F20,L024F20
         PLB
         STZ   L024F80
         LDX   #L024F80
         LDY   #L024F81
         LDA   #$005E
         PHB
         MVN   L024F80,L024F80
         PLB
         STZ   L024FE0
         LDX   #L024FE0
         LDY   #L024FE1
         LDA   #$005E
         PHB
         MVN   L024FE0,L024FE0
         PLB
         STZ   L025040
         LDX   #L025040
         LDY   #L025041
         LDA   #$005E
         PHB
         MVN   L025040,L025040
         PLB
         STZ   L0250A0
         LDX   #L0250A0
         LDY   #L0250A1
         LDA   #$005E
         PHB
         MVN   L0250A0,L0250A0
         PLB
         STZ   L025280
         LDX   #L025280
         LDY   #L025281
         LDA   #$00FE
         PHB
         MVN   L025280,L025280
         PLB
         STZ   L025100
         LDX   #L025100
         LDY   #L025101
         LDA   #$000E
         PHB
         MVN   L025100,L025100
         PLB
         STZ   L02449C
         STZ   L025250
         LDX   #L025250
         LDY   #L025251
         LDA   #$000E
         PHB
         MVN   L025250,L025250
         PLB
         STZ   L0244AC
         LDX   #L0244AC
         LDY   #L0244AD
         LDA   #$000E
         PHB
         MVN   L0244AC,L0244AC
         PLB
         RTL

L010382  JSL   L01025D
         STZ   L024323
         STZ   L024328
         STZ   L02432C
         STZ   L02432A
         STZ   L020002
         STZ   L02444A
         SEP   #$20
         LDA   #$11
         STA   L024441
         STZ   L024440
         REP   #$20
         STZ   L023DB5
         STZ   L024544
         STZ   L024444
         STZ   L02436C
         LDA   #$0001
         STA   L023E2A
         STZ   L02431D
         STZ   L024484
         LDA   #$0001
         STA   L02449E
         LDA   #$00FF
         STA   L0242FF
         STA   L024301
         LDA   #$0001
         STA   L02449A
         LDA   #$4040
         STA   L02448C
         STA   L02448E
         LDA   #$00FF
         STA   L024438
         LDA   #$004B
         STA   L02443C
         LDA   #$0006
         STA   L02431B
         LDA   #$0001
         STA   L024446
         LDA   #$0003
         STA   L02442A
         LDA   #$0004
         STA   L024424
         STZ   L02436E
         LDA   #L02547F
         INC
         STA   L02557F
L010408  STZ   L024546
         LDA   L023E10
         AND   #$00FF
         DEC
         TAX
         STA   L0242FD
         SEP   #$20
         LDA   L023D34,X
         STA   L02441E
         LDA   L023D5B,X
         STA   L024492
         LDAL  L04002A,X
         STA   L0244A6
         LDA   L023D48,X
         STA   L024461
         LDA   L023D70,X
         STA   L024448
         REP   #$20
         TXA
         ASL
         ASL
         TAX
         LDA   L023CE0,X
         STA   L0244A8
         INX
         INX
         LDA   L023CE0,X
         STA   L0244AA
         SEP   #$20
         STZ   L023E28
         REP   #$20
         LDX   #L0C1A40
         LDY   #L0255D3
         LDA   #$007F
         PHB
         MVN   L0C1A40,L0255D3
         PLB
         LDX   #L0C1CC0
         LDY   #L025653
         LDA   #$007F
         PHB
         MVN   L0C1CC0,L025653
         PLB
         REP   #$20
         LDA   L023E06
         BNE   L0104B2
         LDA   L023E10
         CMP   #$0001
         BNE   L010481
         JMPL  L072B47

L010481  CMP   #$0006
         BNE   L01048A
         JMPL  L072B9E

L01048A  CMP   #$000B
         BNE   L010493
         JMPL  L072BE4

L010493  CMP   #$0010
         BNE   L01049C
         JMPL  L072C2A

L01049C  CMP   #$0014
         BNE   L0104A5
         JMPL  L072C70

L0104A5  CMP   #$0015
         BNE   L0104AE
         JMPL  L072CB6
L0104AE  JMPL  L072B6F

L0104B2  LDA   #$0006
         STA   L0242FD
         STA   L024490
         LDA   #$0001
         STA   L024492
         LDA   #$0006
         STA   L02441E
         LDA   #$0018
         STA   L024448
         LDA   #$0001
         STA   L024319
         STA   L024321
         LDA   #$0004
         STA   L02430F
         STA   L024311
         LDA   #$0002
         STA   L024307
         STZ   L024309
         STZ   L02430B
         RTL

L0104EC  ENT
         JSL   L290C4C
         REP   #$20
         LDAL  L020353
         TCS
         JMP   L01023F

L0104FA  ENT
         PHP
         SEP   #$20
         LDA   L0257F0
         CMP   #$01
         BNE   L010507
         JMP   L0105BB

L010507  LDA   $5C
         BNE   L010529
         LDA   L0242FD
         INC
         CMP   L020051
         BCS   L010517
         JMP   L0105BB

L010517  STA   L020051
         LDX   #L02002C
         STX   L020006
         LDX   #^L02002C
         STX   L020008
         JMP   L010535

L010529  LDX   #L02003E
         STX   L020006
         LDX   #^L02003E
         STX   L020008
L010535  JSL   GSOS
         DW    $0010      ; Open
         ADRL  L020004
         BCC   L010544
         JMP   L0105BB

L010544  REP   #$20
         LDA   L020004
         STA   L02001E
         STA   L02000E
         LDA   #L024327
         SEC
         SBC   #L0242FD
         INC
         STA   L020024
         STA   $64
         INC   L0242FD
         LDA   L0242FD
         STA   L024305
         STA   L02431F
         LDA   #L0242FD
         STA   $6C
         LDA   #L0200BB
         STA   $70
         LDY   #$0000
         LDX   $64
L010577  SEP   #$20
         LDA   ($6C)
         EOR   L020077,Y
         CLC
         ADC   L0200A1,Y
         STA   ($70)
         REP   #$20
         INC   $6C
         INC   $70
         INY
         TYA
         AND   #$000F
         TAY
         DEX
         BNE   L010577
         LDA   #L0200BB
         STA   L020020
         LDA   #^L0200BB
         STA   L020022
         JSL   GSOS
         DW    $0013      ; Write
         ADRL  L02001E
         BCC   L0105AE
         JMP   L0105AE

L0105AE  DEC   L0242FD
         JSL   GSOS
         DW    $0014      ; Close
         ADRL  L02000E
L0105BB  PLP
         RTL

L0105BD  PHP
         SEP   #$20
         LDA   $5C
         BNE   L0105D3
         LDX   #L02002C
         STX   L020006
         LDX   #^L02002C
         STX   L020008
         JMP   L0105DF

L0105D3  LDX   #L02003E
         STX   L020006
         LDX   #^L02003E
         STX   L020008
L0105DF  STZ   $5C
         JSL   GSOS
         DW    $0010      ; Open
         ADRL  L020004
         BCC   L0105F0
         JMP   L010637

L0105F0  LDX   L020004
         STX   L020010
         STX   L02000E
         LDX   #$0001
         STX   L020016
         LDX   #L020053
         STX   L020012
         LDX   #^L020053
         STX   L020014
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L020010
         BCC   L010620
         LDX   #$0001
         STX   L020053
         JMP   L01062D

L010620  LDA   L020053
         SEC
         SBC   L0200A1
         EOR   L020077
         STA   L020053
L01062D  JSL   GSOS
         DW    $0014      ; Close
         ADRL  L02000E
L010637  LDA   L020053
         STA   $5C
         PLP
         RTL

L01063E  PHP
         REP   #$20
         LDA   L0257F0
         CMP   #$0001
         BNE   L01064C
         JMP   L010712

L01064C  LDA   $5C
         AND   #$00FF
         BNE   L010662
         LDA   #L02002C
         STA   L020006
         LDA   #^L02002C
         STA   L020008
         JMP   L01066E

L010662  LDA   #L02003E
         STA   L020006
         LDA   #^L02003E
         STA   L020008
L01066E  JSL   GSOS
         DW    $0010      ; Open
         ADRL  L020004
         BCC   L01067D
         JMP   L010712

L01067D  LDA   L020004
         STA   L020010
         STA   L02000E
         LDA   #L024327
         SEC
         SBC   #L0242FD
         INC
         STA   $64
         STA   L020016
         LDA   #L0200BB
         STA   L020012
         LDA   #^L0200BB
         STA   L020014
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L020010
         BCS   L010708
         LDA   #L0200BB
         STA   $6C
         LDY   #$0000
         LDX   $64
L0106B5  SEP   #$20
         LDA   ($6C)
         SEC
         SBC   L0200A1,Y
         EOR   L020077,Y
         STA   ($6C)
         REP   #$20
         INC   $6C
         INY
         TYA
         AND   #$000F
         TAY
         DEX
         BNE   L0106B5
         LDA   #L024305
         SEC
         SBC   #L0242FD
         TAX
         LDA   L0200BB
         CMP   L0200BB,X
         BNE   L010708
         LDA   #L02431F
         SEC
         SBC   #L0242FD
         TAX
         LDA   L0200BB
         CMP   L0200BB,X
         BNE   L010708
         LDX   #L0200BB
         LDY   #L0242FD
         LDA   $64
         DEC
         PHB
         MVN   L0200BB,L0242FD
         PLB
         LDA   L0242FD
         CMP   #$0001
         BEQ   L010708
         DEC   L0242FD
L010708  JSL   GSOS
         DW    $0014      ; Close
         ADRL  L02000E
L010712  PLP
         RTL

L010714  PHP
         SEP   #$20
         LDA   L0257F0
         CMP   #$01
         BEQ   L010721
         JMP   L010832

L010721  LDX   #L02002C
         STX   L020006
         LDX   #^L02002C
         STX   L020008
         JSL   GSOS
         DW    $0010      ; Open
         ADRL  L020004
         BCC   L01073C
         JMP   L010832

L01073C  REP   #$20
         LDA   L020004
         STA   L02001E
         STA   L02000E
         LDA   #L024327
         SEC
         SBC   #L0242FD
         INC
         STA   L020024
         STA   $64
         LDA   L0242FD
         STA   L024305
         STA   L02431F
         LDA   #L0242FD
         STA   $6C
         LDA   #L0200BB
         STA   $70
         LDY   #$0000
         LDX   $64
L01076C  SEP   #$20
         LDA   ($6C)
         EOR   L020077,Y
         CLC
         ADC   L0200A1,Y
         STA   ($70)
         REP   #$20
         INC   $6C
         INC   $70
         INY
         TYA
         AND   #$000F
         TAY
         DEX
         BNE   L01076C
         LDA   #L0200BB
         STA   L020020
         LDA   #^L0200BB
         STA   L020022
         JSL   GSOS
         DW    $0013      ; Write
         ADRL  L02001E
         JSL   GSOS
         DW    $0014      ; Close
         ADRL  L02000E
         LDX   #L02003E
         STX   L020006
         LDX   #^L02003E
         STX   L020008
         JMP   L0107B7

L0107B7  JSL   GSOS
         DW    $0010      ; Open
         ADRL  L020004
         BCC   L0107C6
         JMP   L010832

L0107C6  REP   #$20
         LDA   L020004
         STA   L02001E
         STA   L02000E
         LDA   #L024327
         SEC
         SBC   #L0242FD
         INC
         STA   L020024
         STA   $64
         LDA   L0242FD
         STA   L024305
         STA   L02431F
         LDA   #L0242FD
         STA   $6C
         LDA   #L0200BB
         STA   $70
         LDY   #$0000
         LDX   $64
L0107F6  SEP   #$20
         LDA   ($6C)
         EOR   L020077,Y
         CLC
         ADC   L0200A1,Y
         STA   ($70)
         REP   #$20
         INC   $6C
         INC   $70
         INY
         TYA
         AND   #$000F
         TAY
         DEX
         BNE   L0107F6
         LDA   #L0200BB
         STA   L020020
         LDA   #^L0200BB
         STA   L020022
         JSL   GSOS
         DW    $0013      ; Write
         ADRL  L02001E
         JSL   GSOS
         DW    $0014      ; Close
         ADRL  L02000E
L010832  PLP
         RTL

         JSL   L0F01AC
         LDA   #$0001
         STA   L023E08
         LDA   #$0030
         STA   L023C89
         JSL   L120000
         LDA   #$0001
         STA   L023E10
         RTL

