*
* Stickybear Opposites
*
* (c) 1988, Optimum Resource
* (h) 2021, Antoine Vignau
*

	mx	%00
	rel
	dsk	OPP.HDD
	lst	off

*-----------------

	USE	4/ACE.MACS
	USE	4/EVENT.MACS
	USE	4/INT.MACS
	USE	4/LOCATOR.MACS
	USE	4/MEM.MACS
	USE	4/MISC.MACS
	USE	4/QD.MACS
	USE	4/SOUND.MACS
	USE	4/UTIL.MACS

GSOS	=	$E100A8

*-----------------

         PHK
         PLB
         _TLStartUp
         PEA   $0000
         _MMStartUp
         PLA
         STA   $2E
         PEA   $0000	; we want the shadowing screen
         PEA   $0000
         PEA   $0000
         PEA   $8000
         pei   $2E
         PEA   $C003
         PEA   $0001
         PEA   $2000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         PLA

         _MTStartUp
         LDX   #$0002
         JSR   L0204FE
         PEA   $0000	; we want a DP
         PEA   $0000
         PEA   $0000
         PEA   $0600
         pei   $2E
         PEA   $C001
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         STA   $00
         STA   L0210F4
         PLA
         STA   $02
         STA   L0210F4+2
         LDA   [$00]
         STA   $04

         pei   $04
         PEA   $0000
         PEA   $00A0
         pei   $2E
         _QDStartUp
         LDX   #$0004
         JSR   L0204FE

         LDA   $04
         CLC
         ADC   #$0300
         PHA
         PEA   $0014
         PEA   $0000
         PEA   $0140
         PEA   $0000
         PEA   $00C8
         pei   $2E
         _EMStartUp
         LDX   #$0005
         JSR   L0204FE

*--- Do not load tools if they are already started...

*         PEA   ^L0210DE
*         PEA   L0210DE
*         _LoadTools

	PushWord #29	; AV 202103 - Load the ACE toolset
	PushWord #0
	_LoadOneTool
	LDX   #$001D	; AV 202103 - WAS 1C
	JSR   L0204FE

*--- No need to push the mem ID

*         LDA   $2E
*         PHA
         LDA   $04
         CLC
         ADC   #$0400
         PHA
         _SoundStartUp
         LDX   #$0008	; AV 202103 - WAS 1C
         JSR   L0204FE

*--- No need to push the mem ID

*         LDA   $2E
*         PHA
         LDA   $04
         CLC
         ADC   #$0500
         PHA
         _ACEStartUp
         LDX   #$001D
         JSR   L0204FE

         LDA   #$2000
         STA   $18
         LDA   #$00E1
         STA   $1A
         LDA   #$2000
         STA   $10
         STA   L0206F3
         LDA   #$0001
         STA   $12
         STA   L0206F5
         PEA   $0000
         PEA   $0000
         _GetPort
         PLA
         STA   L0206ED
         PLA
         STA   L0206EF
         PEA   ^L02072D
         PEA   L02072D
         _OpenPort
         PEA   ^L02072D
         PEA   L02072D
         _SetPort
         PEA   ^L0206F1
         PEA   L0206F1
         _SetPortLoc
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $8000
         pei   $2E
         PEA   $C010
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         PLX
         JSR   L0204D9
         STA   $14
         STX   $16
         STA   L0206F3
         STX   L0206F5
         PEA   ^L0207EB
         PEA   L0207EB
         _OpenPort
         PEA   ^L0207EB
         PEA   L0207EB
         _SetPort
         PEA   ^L0206F1
         PEA   L0206F1
         _SetPortLoc
         LDA   L0206EF
         PHA
         LDA   L0206ED
         PHA
         _SetPort
         JSR   L020FF4
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $7312
         pei   $2E
         PEA   $C010
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         PLX
         JSR   L0204D9
         STA   $42
         STX   $44
         STA   L021199
         STX   L021199+2
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $8000
         pei   $2E
         PEA   $C010
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         PLX
         JSR   L0204D9
         STA   $6A
         STX   $6C
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $6AB8
         pei   $2E
         PEA   $C010
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         PLX
         JSR   L0204D9
         STA   $52
         STX   $54
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $8000
         pei   $2E
         PEA   $C010
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         STA   $5E
         PLX
         STX   $60
         JSR   L0204D9
         STA   $62
         STX   $64
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $5000
         pei   $2E
         PEA   $C010
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         PLX
         JSR   L0204D9
         STA   $6E
         STX   $70
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $4000
         pei   $2E
         PEA   $C010
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         STA   $56
         PLX
         STX   $58
         JSR   L0204D9
         STA   $5A
         STX   $5C
         PEA   $0000
         PEA   $0000
         PEA   $0000
         PEA   $024F
         pei   $2E
         PEA   $C010
         PEA   $0000
         PEA   $0000
         _NewHandle
         LDX   #$0003
         JSR   L0204FE
         PLA
         PLX
         JSR   L0204D9
         STA   $46
         STX   $48
         STA   L02119D
         STX   L02119D+2
         JSR   L0224B2
         JSR   L021108
         JSR   L0208A9
         JSR   L0221D9
         JSR   L021519
         LDAL  $E0C034
         AND   #$FFF0
         STAL  $E0C034
         STZ   L0210F0
         STZ   $7E
         STZ   $82
         STZ   $84
         STZ   $9A
         JSR   L023865
         JSR   L0237C7
         JSR   L022676
         LDA   #$0000
         LDX   #$000C
         STX   $80
         JSR   L021628
         STZ   $80
*         JSR   L023A07	; call the protection
         JSR   L0230B5
         JSR   L0208B7
         JSR   L0221E7
*         _ACEBootInit
	_ACEShutDown

	PushWord	#29	; AV 202103 - Unload the ACE toolset
	_UnloadOneTool
	
         _SoundShutDown
         _EMShutDown
         _QDShutDown
         _MTShutDown
         pei   $2E
         _DisposeAll
         LDA   L0210F4+2
         PHA
         LDA   L0210F4
         PHA
         _DisposeHandle
         pei   $2E
         _MMShutDown
         _TLShutDown
         JSL   GSOS
         DW    $0029      ; Quit
         ADRL  L0210D8
	 brk   $bd
	
*---
 
L02037B  LDA   [$4A]
         BNE   L020383
         RTS

L020383  STA   L020498
         LDA   $4A
         CLC
         ADC   #$0002
         STA   $4A
	 lda   $4c
	 adc   #0
	 sta   $4c
L02038E  LDA   [$4A]
         ASL
         TAX
         JSR   (L02049A,X)
         DEC   L020498
         BNE   L02038E
         LDA   #$9E20
         STA   $26
         LDA   #$00E1
         STA   $28
         LDY   #$001E
L0203AB  LDA   [$4A],Y
         STA   [$26],Y
         DEY
         DEY
         BPL   L0203AB
         RTS

L0203B4  LDY   #$0002
         LDA   [$4A],Y
         ASL
         TAY
         LDA   [$52],Y
         BEQ   L0203DA
         CLC
         ADC   $52
         ADC   #$0004
         STA   $38
         LDA   $54
	 adc   #0
         STA   $3A
         LDY   #$0004
         LDA   [$4A],Y
         TAX
         LDY   #$0006
         LDA   [$4A],Y
         TAY
         JSR   L0208DA
L0203DA  LDA   $4A
         CLC
         ADC   #$0008
         STA   $4A
	 lda   $4c
	 adc   #0
	 sta   $4c
         RTS

L0203E3  LDY   #$0004
         LDA   [$4A],Y
         STA   L02048E
         INY
         INY
         LDA   [$4A],Y
         STA   L020492
         INY
         INY
         LDA   [$4A],Y
         STA   L020490
         INY
         INY
         LDA   [$4A],Y
         STA   L020496
         INY
         INY
         LDA   [$4A],Y
         STA   L020494
         PEA   ^L02072D
         PEA   L02072D
         _SetPort
         LDA   L02048E
         PHA
         _SetSolidPenPat
         PEA   ^L020490
         PEA   L020490
         _PaintRect
         PEA   $0000
         _SetSolidPenPat
         LDA   L0206EF
         PHA
         LDA   L0206ED
         PHA
         _SetPort
         LDA   $4A
         CLC
         ADC   #$000E
         STA   $4A
	 lda   $4c
	 adc   #0
	 sta   $4c
         RTS

L02044E  LDY   #$0004
         LDA   [$4A],Y
         BPL   L02045F
         LDA   $6A
         STA   $38
         LDA   $6C
         STA   $3A
         BRA   L02046C
L02045F  ASL
         ASL
         TAX
         LDA   L021199,X
         STA   $38
         LDA   L021199+2,X
         STA   $3A
L02046C  LDY   #$0002
         LDA   [$4A],Y
         CLC
         ADC   $38
         STA   $38
	 lda   $3a	; LOGO
	 adc   #0
	 sta   $3a
         LDY   #$0006
         LDA   [$4A],Y
         TAX
         LDY   #$0008
         LDA   [$4A],Y
         TAY
         JSR   L0208DA
         LDA   $4A
         CLC
         ADC   #$000A
         STA   $4A
	 lda   $4c
	 adc   #0
	 sta   $4c
         RTS

L02048E  DW    $0000
L020490  DW    $0000
L020492  DW    $0000
L020494  DW    $0000
L020496  DW    $0000
L020498  DW    $0000
L02049A  DA    L0203B4
         DA    L0203E3
         DA    L02044E
L0204A6  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L0204B8  DW    $0000      ;  ref num
L0204BA  ADRL  L0204A6    ;  path name
         ADRL  $00000000  ;  reserved
L0204C2  DW    $0000      ;  ref num
L0204C4  ADRL  $00000000  ;  buffer ptr
L0204C8  ADRL  $00008000  ;  request count
         ADRL  $00000000  ;  transfer count
L0204D0  DW    $0000      ;  ref num
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L0204D8  RTS

L0204D9  STA   $00
         STX   $02
         LDY   #$0004
         LDA   [$00],Y
         ORA   #$8000
         STA   [$00],Y
         DEY
         DEY
         LDA   [$00],Y
         TAX
         LDA   [$00]
         RTS

*         STA   $00
*         STX   $02
*         LDY   #$0004
*         LDA   [$00],Y
*         AND   #$7FFF
*         STA   [$00],Y
*         RTS

L0204FE  BCS   L020501
         RTS

L020501  PHX
         PEA   $0000
         PEA   $0000
         PHA
         _HexIt
         PLA
         STA   L020542
         PLA
         STA   L020542+2
         PLA
         ORA   #$FF00
         PHA
         PEA   ^L02052A
         PEA   L02052A
         _SysFailMgr
L02052A  ASC   1C
         ASC   'Could not handle error '
L020542  HEX   00000000
         ASC   20

L020547  LDA   $2C
         ASL
         TAY
         LDA   L020559,Y
         STA   $1C
         LDA   $2A
         LSR
         CLC
         ADC   $1C
         STA   $1C
         RTS

L020559  DW    $0000
         DW    $00A0
         DW    $0140
         DW    $01E0
         DW    $0280
         DW    $0320
         DW    $03C0
         DW    $0460
         DW    $0500
         DW    $05A0
         DW    $0640
         DW    $06E0
         DW    $0780
         DW    $0820
         DW    $08C0
         DW    $0960
         DW    $0A00
         DW    $0AA0
         DW    $0B40
         DW    $0BE0
         DW    $0C80
         DW    $0D20
         DW    $0DC0
         DW    $0E60
         DW    $0F00
         DW    $0FA0
         DW    $1040
         DW    $10E0
         DW    $1180
         DW    $1220
         DW    $12C0
         DW    $1360
         DW    $1400
         DW    $14A0
         DW    $1540
         DW    $15E0
         DW    $1680
         DW    $1720
         DW    $17C0
         DW    $1860
         DW    $1900
         DW    $19A0
         DW    $1A40
         DW    $1AE0
         DW    $1B80
         DW    $1C20
         DW    $1CC0
         DW    $1D60
         DW    $1E00
         DW    $1EA0
         DW    $1F40
         DW    $1FE0
         DW    $2080
         DW    $2120
         DW    $21C0
         DW    $2260
         DW    $2300
         DW    $23A0
         DW    $2440
         DW    $24E0
         DW    $2580
         DW    $2620
         DW    $26C0
         DW    $2760
         DW    $2800
         DW    $28A0
         DW    $2940
         DW    $29E0
         DW    $2A80
         DW    $2B20
         DW    $2BC0
         DW    $2C60
         DW    $2D00
         DW    $2DA0
         DW    $2E40
         DW    $2EE0
         DW    $2F80
         DW    $3020
         DW    $30C0
         DW    $3160
         DW    $3200
         DW    $32A0
         DW    $3340
         DW    $33E0
         DW    $3480
         DW    $3520
         DW    $35C0
         DW    $3660
         DW    $3700
         DW    $37A0
         DW    $3840
         DW    $38E0
         DW    $3980
         DW    $3A20
         DW    $3AC0
         DW    $3B60
         DW    $3C00
         DW    $3CA0
         DW    $3D40
         DW    $3DE0
         DW    $3E80
         DW    $3F20
         DW    $3FC0
         DW    $4060
         DW    $4100
         DW    $41A0
         DW    $4240
         DW    $42E0
         DW    $4380
         DW    $4420
         DW    $44C0
         DW    $4560
         DW    $4600
         DW    $46A0
         DW    $4740
         DW    $47E0
         DW    $4880
         DW    $4920
         DW    $49C0
         DW    $4A60
         DW    $4B00
         DW    $4BA0
         DW    $4C40
         DW    $4CE0
         DW    $4D80
         DW    $4E20
         DW    $4EC0
         DW    $4F60
         DW    $5000
         DW    $50A0
         DW    $5140
         DW    $51E0
         DW    $5280
         DW    $5320
         DW    $53C0
         DW    $5460
         DW    $5500
         DW    $55A0
         DW    $5640
         DW    $56E0
         DW    $5780
         DW    $5820
         DW    $58C0
         DW    $5960
         DW    $5A00
         DW    $5AA0
         DW    $5B40
         DW    $5BE0
         DW    $5C80
         DW    $5D20
         DW    $5DC0
         DW    $5E60
         DW    $5F00
         DW    $5FA0
         DW    $6040
         DW    $60E0
         DW    $6180
         DW    $6220
         DW    $62C0
         DW    $6360
         DW    $6400
         DW    $64A0
         DW    $6540
         DW    $65E0
         DW    $6680
         DW    $6720
         DW    $67C0
         DW    $6860
         DW    $6900
         DW    $69A0
         DW    $6A40
         DW    $6AE0
         DW    $6B80
         DW    $6C20
         DW    $6CC0
         DW    $6D60
         DW    $6E00
         DW    $6EA0
         DW    $6F40
         DW    $6FE0
         DW    $7080
         DW    $7120
         DW    $71C0
         DW    $7260
         DW    $7300
         DW    $73A0
         DW    $7440
         DW    $74E0
         DW    $7580
         DW    $7620
         DW    $76C0
         DW    $7760
         DW    $7800
         DW    $78A0
         DW    $7940
         DW    $79E0
         DW    $7A80
         DW    $7B20
         DW    $7BC0
         DW    $7C60
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L0206ED  DB    $00
         DB    $00
L0206EF  DB    $00
         DB    $00
L0206F1  DB    $00
         DB    $00
L0206F3  DB    $00
         DB    $00
L0206F5  DB    $00
         DB    $00
         DB    $A0
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $C8
         DB    $00
         DB    $40
         DB    $01
L020701  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $C8
         DB    $00
         DB    $40
         DB    $01
         DB    $0D
         DB    $00
         DB    $00
         DB    $00
         DB    $C8
         DB    $00
         DB    $40
         DB    $01
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $1E
         DB    $00
         DB    $00
         DB    $00
         DB    $AF
         DB    $00
         DB    $40
         DB    $01
         DB    $0D
         DB    $00
         DB    $A8
         DB    $00
         DB    $80
         DB    $00
         DB    $40
         DB    $01
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L02072D  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $C8
         DB    $00
         DB    $40
         DB    $01
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L0207EB  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $C8
         DB    $00
         DB    $40
         DB    $01
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00

L0208A9  PEA   ^L0208C5
         PEA   L0208C5
         _SetHeartBeat
         RTS

L0208B7  PEA   ^L0208C5
         PEA   L0208C5
         _DelHeartBeat
         RTS

L0208C5  ADRL  $00000000
         DW    $0000
         DW    $A55A
         RTL

L0208CE  ADRL  $00000000
L0208D2  ADRL  $00000000
L0208D6  ADRL  $00000000

L0208DA  STY   $2C
         STX   $2A
         LDA   [$38]
         CLC
         ADC   $2A
         STA   $2A
         LDY   #$0002
         LDA   [$38],Y
         CLC
         ADC   $2C
         STA   $2C
         LDA   $38
         CLC
         ADC   #$0004
         STA   $38
	 lda   $3a
	 adc   #0
	 sta   $3a
         JSR   L020547
         LDA   $10
         CLC
         ADC   $1C
         STA   $22
         LDA   $12
	 adc   #0
         STA   $24
L020908  LDY   #$0000
         LDA   [$38]
         BNE   L020923
         INY
         INY
         LDA   [$38],Y
         CLC
         ADC   $22
         STA   $22
	 lda   $24
	 adc   #0
	 sta   $24
         LDA   $38
         CLC
         ADC   #$0004
         STA   $38
	 lda   $3a
	 adc   #0
	 sta   $3a
         JMP   L020908

L020923  BMI   L02094B
         ASL
         TAX
         LDA   $38
         CLC
         ADC   #$0002
         STA   $38
	 lda   $3a
	 adc   #0
	 sta   $3a
         LDA   [$22]
         AND   L0209AB,X
         ORA   [$38]
         STA   [$22]
         LDA   $22
         CLC
         ADC   #$0002
         STA   $22
	 lda   $24
	 adc   #0
	 sta   $24
         LDA   $38
         CLC
         ADC   #$0002
         STA   $38
	 lda   $3a
	 adc   #0
	 sta   $3a
         JMP   L020908

L02094B  AND   #$7FFF
         BNE   L020951
         RTS

L020951  PHA
         AND   #$0F00
         BEQ   L02097E
         PLA
         AND   #$00FF
         STA   $26
         LDA   $38
         CLC
         ADC   #$0002
         STA   $38
	 lda   $3a
	 adc   #0
	 sta   $3a
L020965  LDA   [$38],Y
         STA   [$22],Y
         INY
         INY
         DEC   $26
         BNE   L020965
         TYA
         CLC
         ADC   $22
         STA   $22
	 lda   $24
	 adc   #0
	 sta   $24
         TYA
         CLC
         ADC   $38
         STA   $38
	 lda   $3a
	 adc   #0
	 sta   $3a
         JMP   L020908

L02097E  PLA
         AND   #$00FF
         STA   $26
         LDA   $38
         CLC
         ADC   #$0002
         STA   $38
	 lda   $3a
	 adc   #0
	 sta   $3a
         LDA   [$38]
         STA   $28
         LDA   $38
         CLC
         ADC   #$0002
         STA   $38
	 lda   $3a
	 adc   #0
	 sta   $3a
L020998  LDA   $28
         STA   [$22]
         LDA   $22
         CLC
         ADC   #$0002
         STA   $22
	 lda   $24
	 adc   #0
	 sta   $24
         DEC   $26
         BNE   L020998
         JMP   L020908

L0209AB  HEX   FFFFFFF0
         HEX   FF0FFF00
         HEX   F0FFF0F0
         HEX   F00FF000
         HEX   0FFF0FF0
         HEX   0F0F0F00
         HEX   00FF00F0
         HEX   000F0000

L0209CB  LDA   $34
         BNE   L0209D0
         RTS

L0209D0  LDA   #L020C5D
         STA   $30
         LDA   #^L020C5D
         STA   $32
L0209DA  LDAL  $E0C035
         AND   #$FFF7
         STAL  $E0C035
L0209E5  LDA   [$30]
         STA   $2A
         LDY   #$0002
         LDA   [$30],Y
         STA   $2C
         LDY   #$0004
         LDA   [$30],Y
         STA   $1E
         LDY   #$0006
         LDA   [$30],Y
         STA   $20
         JSR   L020547
         LDA   #$0050
         SEC
         SBC   $1E
         ASL
         STA   $1E
         ASL
         CLC
         ADC   $1E
         ADC   #L020A24
         STA   L020A21+1
         LDY   $20
         LDX   $1C
         PHB
         PEA   $0101
         PLB
         PLB
L020A21  JMP   L020A24

L020A24  LDA   $209E,X
         STA   $209E,X
         LDA   $209C,X
         STA   $209C,X
         LDA   $209A,X
         STA   $209A,X
         LDA   $2098,X
         STA   $2098,X
         LDA   $2096,X
         STA   $2096,X
         LDA   $2094,X
         STA   $2094,X
         LDA   $2092,X
         STA   $2092,X
         LDA   $2090,X
         STA   $2090,X
         LDA   $208E,X
         STA   $208E,X
         LDA   $208C,X
         STA   $208C,X
         LDA   $208A,X
         STA   $208A,X
         LDA   $2088,X
         STA   $2088,X
         LDA   $2086,X
         STA   $2086,X
         LDA   $2084,X
         STA   $2084,X
         LDA   $2082,X
         STA   $2082,X
         LDA   $2080,X
         STA   $2080,X
         LDA   $207E,X
         STA   $207E,X
         LDA   $207C,X
         STA   $207C,X
         LDA   $207A,X
         STA   $207A,X
         LDA   $2078,X
         STA   $2078,X
         LDA   $2076,X
         STA   $2076,X
         LDA   $2074,X
         STA   $2074,X
         LDA   $2072,X
         STA   $2072,X
         LDA   $2070,X
         STA   $2070,X
         LDA   $206E,X
         STA   $206E,X
         LDA   $206C,X
         STA   $206C,X
         LDA   $206A,X
         STA   $206A,X
         LDA   $2068,X
         STA   $2068,X
         LDA   $2066,X
         STA   $2066,X
         LDA   $2064,X
         STA   $2064,X
         LDA   $2062,X
         STA   $2062,X
         LDA   $2060,X
         STA   $2060,X
         LDA   $205E,X
         STA   $205E,X
         LDA   $205C,X
         STA   $205C,X
         LDA   $205A,X
         STA   $205A,X
         LDA   $2058,X
         STA   $2058,X
         LDA   $2056,X
         STA   $2056,X
         LDA   $2054,X
         STA   $2054,X
         LDA   $2052,X
         STA   $2052,X
         LDA   $2050,X
         STA   $2050,X
         LDA   $204E,X
         STA   $204E,X
         LDA   $204C,X
         STA   $204C,X
         LDA   $204A,X
         STA   $204A,X
         LDA   $2048,X
         STA   $2048,X
         LDA   $2046,X
         STA   $2046,X
         LDA   $2044,X
         STA   $2044,X
         LDA   $2042,X
         STA   $2042,X
         LDA   $2040,X
         STA   $2040,X
         LDA   $203E,X
         STA   $203E,X
         LDA   $203C,X
         STA   $203C,X
         LDA   $203A,X
         STA   $203A,X
         LDA   $2038,X
         STA   $2038,X
         LDA   $2036,X
         STA   $2036,X
         LDA   $2034,X
         STA   $2034,X
         LDA   $2032,X
         STA   $2032,X
         LDA   $2030,X
         STA   $2030,X
         LDA   $202E,X
         STA   $202E,X
         LDA   $202C,X
         STA   $202C,X
         LDA   $202A,X
         STA   $202A,X
         LDA   $2028,X
         STA   $2028,X
         LDA   $2026,X
         STA   $2026,X
         LDA   $2024,X
         STA   $2024,X
         LDA   $2022,X
         STA   $2022,X
         LDA   $2020,X
         STA   $2020,X
         LDA   $201E,X
         STA   $201E,X
         LDA   $201C,X
         STA   $201C,X
         LDA   $201A,X
         STA   $201A,X
         LDA   $2018,X
         STA   $2018,X
         LDA   $2016,X
         STA   $2016,X
         LDA   $2014,X
         STA   $2014,X
         LDA   $2012,X
         STA   $2012,X
         LDA   $2010,X
         STA   $2010,X
         LDA   $200E,X
         STA   $200E,X
         LDA   $200C,X
         STA   $200C,X
         LDA   $200A,X
         STA   $200A,X
         LDA   $2008,X
         STA   $2008,X
         LDA   $2006,X
         STA   $2006,X
         LDA   $2004,X
         STA   $2004,X
         LDA   $2002,X
         STA   $2002,X
         LDA   $2000,X
         STA   $2000,X
         TXA
         CLC
         ADC   #$00A0
         TAX
         DEY
         BEQ   L020C10
         JMP   L020A21

L020C10  PLB
         DEC   $34
         BEQ   L020C20
         LDA   $30
         CLC
         ADC   #$0008
         STA   $30
         JMP   L0209E5

L020C20  LDAL  $E0C035
         ORA   #$0008
         STAL  $E0C035
         RTS

*         LDA   L020CFD
*         BEQ   L020C40
*         STA   $34
*         LDA   #L020CFF
*         STA   $30
*         LDA   #^L020CFF
*         STA   $32
*         JSR   L0209DA
*L020C40  RTS
*
*         LDA   #$0000
*         STA   L020CFF
*         STA   L020D01
*         LDA   #$0050
*         STA   L020D03
*         LDA   #$00C8
*         STA   L020D05
*         LDA   #$0001
*         STA   L020CFD
*         RTS

L020C5D  DW    $0000
L020C5F  DW    $0000
L020C61  DW    $0000
L020C63  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L020CFD  DB    $00
         DB    $00
L020CFF  DB    $00
         DB    $00
L020D01  DB    $00
         DB    $00
L020D03  DB    $00
         DB    $00
L020D05  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00

L020D4F  LDA   $40
         BNE   L020D54
         RTS

L020D54  STA   L0210D6
         LDA   #L021034
         STA   $3C
         LDA   #^L021034
         STA   $3E
L020D61  LDA   [$3C]
         STA   $2A
         LDY   #$0002
         LDA   [$3C],Y
         STA   $2C
         LDY   #$0004
         LDA   [$3C],Y
         STA   $1E
         LDY   #$0006
         LDA   [$3C],Y
         STA   $20
         JSR   L020547
         LDA   #$0050
         SEC
         SBC   $1E
         STA   $1E
         ASL
         PHA
         CLC
         ADC   $1E
         STA   $1E
         PLA
         ASL
         CLC
         ADC   $1E
         ADC   #L020DA7
         STA   L020DA4+1
         LDY   $20
         LDX   $1C
         PHB
         PEA   $0101
         PLB
         PLB
L020DA4  JMP   L020DA7

L020DA7  LDAL  $01209E,X
         STA   $209E,X
         LDAL  $01209C,X
         STA   $209C,X
         LDAL  $01209A,X
         STA   $209A,X
         LDAL  $012098,X
         STA   $2098,X
         LDAL  $012096,X
         STA   $2096,X
         LDAL  $012094,X
         STA   $2094,X
         LDAL  $012092,X
         STA   $2092,X
         LDAL  $012090,X
         STA   $2090,X
         LDAL  $01208E,X
         STA   $208E,X
         LDAL  $01208C,X
         STA   $208C,X
         LDAL  $01208A,X
         STA   $208A,X
         LDAL  $012088,X
         STA   $2088,X
         LDAL  $012086,X
         STA   $2086,X
         LDAL  $012084,X
         STA   $2084,X
         LDAL  $012082,X
         STA   $2082,X
         LDAL  $012080,X
         STA   $2080,X
         LDAL  $01207E,X
         STA   $207E,X
         LDAL  $01207C,X
         STA   $207C,X
         LDAL  $01207A,X
         STA   $207A,X
         LDAL  $012078,X
         STA   $2078,X
         LDAL  $012076,X
         STA   $2076,X
         LDAL  $012074,X
         STA   $2074,X
         LDAL  $012072,X
         STA   $2072,X
         LDAL  $012070,X
         STA   $2070,X
         LDAL  $01206E,X
         STA   $206E,X
         LDAL  $01206C,X
         STA   $206C,X
         LDAL  $01206A,X
         STA   $206A,X
         LDAL  $012068,X
         STA   $2068,X
         LDAL  $012066,X
         STA   $2066,X
         LDAL  $012064,X
         STA   $2064,X
         LDAL  $012062,X
         STA   $2062,X
         LDAL  $012060,X
         STA   $2060,X
         LDAL  $01205E,X
         STA   $205E,X
         LDAL  $01205C,X
         STA   $205C,X
         LDAL  $01205A,X
         STA   $205A,X
         LDAL  $012058,X
         STA   $2058,X
         LDAL  $012056,X
         STA   $2056,X
         LDAL  $012054,X
         STA   $2054,X
         LDAL  $012052,X
         STA   $2052,X
         LDAL  $012050,X
         STA   $2050,X
         LDAL  $01204E,X
         STA   $204E,X
         LDAL  $01204C,X
         STA   $204C,X
         LDAL  $01204A,X
         STA   $204A,X
         LDAL  $012048,X
         STA   $2048,X
         LDAL  $012046,X
         STA   $2046,X
         LDAL  $012044,X
         STA   $2044,X
         LDAL  $012042,X
         STA   $2042,X
         LDAL  $012040,X
         STA   $2040,X
         LDAL  $01203E,X
         STA   $203E,X
         LDAL  $01203C,X
         STA   $203C,X
         LDAL  $01203A,X
         STA   $203A,X
         LDAL  $012038,X
         STA   $2038,X
         LDAL  $012036,X
         STA   $2036,X
         LDAL  $012034,X
         STA   $2034,X
         LDAL  $012032,X
         STA   $2032,X
         LDAL  $012030,X
         STA   $2030,X
         LDAL  $01202E,X
         STA   $202E,X
         LDAL  $01202C,X
         STA   $202C,X
         LDAL  $01202A,X
         STA   $202A,X
         LDAL  $012028,X
         STA   $2028,X
         LDAL  $012026,X
         STA   $2026,X
         LDAL  $012024,X
         STA   $2024,X
         LDAL  $012022,X
         STA   $2022,X
         LDAL  $012020,X
         STA   $2020,X
         LDAL  $01201E,X
         STA   $201E,X
         LDAL  $01201C,X
         STA   $201C,X
         LDAL  $01201A,X
         STA   $201A,X
         LDAL  $012018,X
         STA   $2018,X
         LDAL  $012016,X
         STA   $2016,X
         LDAL  $012014,X
         STA   $2014,X
         LDAL  $012012,X
         STA   $2012,X
         LDAL  $012010,X
         STA   $2010,X
         LDAL  $01200E,X
         STA   $200E,X
         LDAL  $01200C,X
         STA   $200C,X
         LDAL  $01200A,X
         STA   $200A,X
         LDAL  $012008,X
         STA   $2008,X
         LDAL  $012006,X
         STA   $2006,X
         LDAL  $012004,X
         STA   $2004,X
         LDAL  $012002,X
         STA   $2002,X
         LDAL  $012000,X
         STA   $2000,X
         TXA
         CLC
         ADC   #$00A0
         TAX
         DEY
         BEQ   L020FE3
         JMP   L020DA4

L020FE3  PLB
         DEC   $40
         BEQ   L020FF3
         LDA   $3C
         CLC
         ADC   #$0008
         STA   $3C
         JMP   L020D61
L020FF3  RTS

L020FF4  LDA   #L020DA7
         INC
         STA   $22
         LDA   #^L020DA7
         STA   $24
         LDX   #$0050
         LDA   #$009E
         STA   L0210D4
L021008  LDA   $14
         CLC
         ADC   L0210D4
         STA   [$22]
         SEP   #$20
         LDY   #$0002
         LDA   $16
         STA   [$22],Y
         REP   #$20
         LDA   $22
         CLC
         ADC   #$0007
         STA   $22
	 lda   $24
	 adc   #0
	 sta   $24
         LDA   L0210D4
         SEC
         SBC   #$0002
         STA   L0210D4
         DEX
         BNE   L021008
         RTS

L021034  DW    $0000
L021036  DW    $0000
L021038  DW    $0000
L02103A  DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
         DB    $00
L0210D4  DW    $0000
L0210D6  DW    $0000
L0210D8  ADRL  $00000000  ;  path name
         DW    $0000      ;  flags
*L0210DE  DW    $0004
*         DW    $0004
*         DW    $0101
*         DW    $0006
*         DW    $0100
*         DW    $001C
*         DW    $0000
*         DW    $001D
*         DW    $0000

L0210F0  ADRL  $00000000
L0210F4  ADRL  $00000000
L0210F8  DW    $0000      ; event code
L0210FA  ADRL  $00000000  ; event message
         ADRL  $00000000  ; tick count
         DW    $0000      ; mouse location
         DW    $0000
         DW    $0000      ; modifiers

L021108  LDX   #$000E
L02110B  LDA   L0211A1,X
         STA   L0204A6,X
         DEX
         DEX
         BPL   L02110B
         LDA   $42
         STA   L0204C4
         LDA   $44
         STA   L0204C4+2
         LDA   #$7312
         STA   L0204C8
         JSL   GSOS
         DW    $0010      ; Open
         ADRL  L0204B8
         BCC   L021131
L021131  LDA   L0204B8
         STA   L0204C2
         STA   L0204D0
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         BCC   L021146
L021146  JSL   GSOS
         DW    $0014      ; Close
         ADRL  L0204D0
         LDX   #$000E
L021153  LDA   L0211AE,X
         STA   L0204A6,X
         DEX
         DEX
         BPL   L021153
         LDA   $46
         STA   L0204C4
         LDA   $48
         STA   L0204C4+2
         LDA   #$024F
         STA   L0204C8
         JSL   GSOS
         DW    $0010      ; Open
         ADRL  L0204B8
         BCC   L021179
L021179  LDA   L0204B8
         STA   L0204C2
         STA   L0204D0
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         BCC   L02118E
L02118E  JSL   GSOS
         DW    $0014      ; Close
         ADRL  L0204D0
         RTS

L021199  ADRL  $00000042
L02119D  ADRL  $00000046
L0211A1  STR   '1/Opp.Images'
L0211AE  STR   '1/Opp.Sounds'

L0211BB  STZ   $36
         LDA   [$72]
         STA   $90
         DEC   $90
         BPL   L0211C9
         RTS

L0211C9  LDA   $90
         ASL
         CLC
         ADC   #$0002
         ADC   $72
         STA   $7A
         LDA   $74
         STA   $7C
         LDA   [$7A]
         CLC
         ADC   $6E
         STA   $76
         LDA   $70
	 adc   #0
         STA   $78
         JSR   L0211F0
         DEC   $90
         BPL   L0211C9
         JMP   L0220D2

L0211F0  LDY   #$0004
         LDA   [$76],Y
         LDY   #$0002
         STA   [$76],Y
         LDY   #$0008
         LDA   [$76],Y
         LDY   #$0006
         STA   [$76],Y
         CLC
         ADC   $76
         STA   $22
         LDA   $78
	 adc   #0
         STA   $24
         LDA   [$22]
         CLC
         ADC   $36
         LDY   #$000A
         STA   [$76],Y
         LDA   #$0000
         LDY   #$000C
         STA   [$76],Y
         LDA   [$76]
         BNE   L021232
         JSR   L021288
         JSR   L0212A7
         JMP   L021287

L021232  CMP   #$0001
         BNE   L021243
         JSR   L021288
         JSR   L0212A7
         JSR   L021316
         JMP   L021287

L021243  CMP   #$0002
         BNE   L021254
         JSR   L021288
         JSR   L0212A7
         JSR   L021316
         JMP   L021287

L021254  CMP   #$0003
         BNE   L02126F
         JSR   L021288
         JSR   L0212A7
         JSR   L021316
         LDY   #$006C
         LDA   [$76],Y
         LDY   #$006A
         STA   [$76],Y
         JMP   L021287

L02126F  CMP   #$0004
         BNE   L021277
         JMP   L021287

L021277  CMP   #$0005
         BNE   L02127F
         JMP   L021287

L02127F  CMP   #$0006
         BNE   L021287
         JSR   L02135D
L021287  RTS

L021288  LDY   #$0010
         LDA   [$76],Y
         LDY   #$0012
         STA   [$76],Y
         LDY   #$0014
         STA   [$76],Y
         LDY   #$0016
         LDA   [$76],Y
         LDY   #$0018
         STA   [$76],Y
         LDY   #$001A
         STA   [$76],Y
         RTS

L0212A7  LDY   #$0022
         LDA   [$76],Y
         LDY   #$0020
         STA   [$76],Y
         LDY   #$001E
         LDA   [$76],Y
         LDY   #$001C
         STA   [$76],Y
         LDY   #$002A
         LDA   [$76],Y
         LDY   #$0028
         STA   [$76],Y
         LDY   #$002E
         LDA   [$76],Y
         LDY   #$002C
         STA   [$76],Y
         LDY   #$0034
         LDA   [$76],Y
         LDY   #$0032
         STA   [$76],Y
         LDY   #$0030
         STA   [$76],Y
         LDY   #$0038
         LDA   [$76],Y
         LDY   #$0036
         STA   [$76],Y
         LDY   #$003C
         LDA   [$76],Y
         LDY   #$003A
         STA   [$76],Y
         LDY   #$0040
         LDA   [$76],Y
         LDY   #$003E
         STA   [$76],Y
         LDY   #$0046
         LDA   [$76],Y
         LDY   #$0044
         STA   [$76],Y
         LDY   #$0042
         STA   [$76],Y
         LDY   #$004A
         LDA   [$76],Y
         LDY   #$0048
         STA   [$76],Y
         RTS

L021316  LDY   #$004E
         LDA   [$76],Y
         LDY   #$004C
         STA   [$76],Y
         LDY   #$0052
         LDA   [$76],Y
         LDY   #$0050
         STA   [$76],Y
         LDY   #$0060
         STA   [$76],Y
         LDY   #$0056
         LDA   [$76],Y
         LDY   #$0054
         STA   [$76],Y
         LDY   #$005A
         LDA   [$76],Y
         LDY   #$0058
         STA   [$76],Y
         LDY   #$0062
         STA   [$76],Y
         LDY   #$005E
         LDA   [$76],Y
         LDY   #$005C
         STA   [$76],Y
         LDY   #$0066
         LDA   [$76],Y
         LDY   #$0064
         STA   [$76],Y
         RTS

L02135D  LDY   #$0014
         LDA   [$76],Y
         LDY   #$0012
         STA   [$76],Y
         LDY   #$0018
         LDA   [$76],Y
         LDY   #$0016
         STA   [$76],Y
         LDY   #$001C
         LDA   [$76],Y
         LDY   #$001A
         STA   [$76],Y
         LDY   #$0020
         LDA   [$76],Y
         LDY   #$001E
         STA   [$76],Y
         LDY   #$0026
         STA   [$76],Y
         LDY   #$0024
         LDA   [$76],Y
         LDY   #$0022
         STA   [$76],Y
         LDY   #$002A
         LDA   [$76],Y
         LDY   #$0028
         STA   [$76],Y
         LDY   #$002E
         LDA   [$76],Y
         LDY   #$002C
         STA   [$76],Y
         LDY   #$0032
         LDA   [$76],Y
         LDY   #$0030
         STA   [$76],Y
         LDY   #$0038
         STA   [$76],Y
         LDY   #$0036
         LDA   [$76],Y
         LDY   #$0034
         STA   [$76],Y
         LDY   #$0010
         LDA   [$76],Y
         TAX
         LDY   #$0028
         LDA   [$76],Y
         JSR   L021555
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$0020
         TAX
         LDY   #$0028
         LDA   [$76],Y
         XBA
         JSR   L021555
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$0040
         TAX
         LDY   #$0016
         LDA   [$76],Y
         JSR   L021555
         RTS

*         PEA   ^L0207EB
*         PEA   L0207EB
*         PEA   ^L020701
*         PEA   L020701
*         PEA   $0000
*         PEA   $0000
*         PEA   $0000
*         _PPToPort
*         RTS
*
*         PEA   ^L02072D
*         PEA   L02072D
*         _SetPort
*         PEA   ^L0207EB
*         PEA   L0207EB
*         PEA   ^L020701
*         PEA   L020701
*         PEA   $0000
*         PEA   $0000
*         PEA   $0000
*         _PPToPort
*         LDA   L0206EF
*         PHA
*         LDA   L0206ED
*         PHA
*         _SetPort
*         RTS

L02144B  PEA   ^L02072D
         PEA   L02072D
         PEA   ^L020701
         PEA   L020701
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _PPToPort
         RTS

*         PEA   ^L0207EB
*         PEA   L0207EB
*         _SetPort
*         LDA   L0206EF
*         PHA
*         LDA   L0206ED
*         PHA
*         PEA   ^L020701
*         PEA   L020701
*         PEA   $0000
*         PEA   $0000
*         PEA   $0000
*         _PPToPort
*         LDA   L0206EF
*         PHA
*         LDA   L0206ED
*         PHA
*         _SetPort
*         RTS

L0214A3  PEA   ^L0207EB
         PEA   L0207EB
         _SetPort
         PEA   ^L02072D
         PEA   L02072D
         PEA   ^L020701
         PEA   L020701
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _PPToPort
         LDA   L0206EF
         PHA
         LDA   L0206ED
         PHA
         _SetPort
         RTS

L0214DC  LDX   #$00A0
         JSR   L021560
         ORA   #$0001
         LDX   #$00A0
         JSR   L021555
         LDX   #$00A1
         JSR   L021560
         ORA   #$0001
         LDX   #$00A1
         JSR   L021555
         LDX   #$00A2
         JSR   L021560
         ORA   #$0001
         LDX   #$00A2
         JSR   L021555
         LDX   #$00A3
         JSR   L021560
         ORA   #$0001
         LDX   #$00A3
         JSR   L021555
         RTS

L021519  PEA   $0000
         PEA   $0000
         _GetTableAddress
         PLA
         STA   $66
         PLA
         STA   $68
         LDY   #$0004
         LDA   [$66],Y
         STA   L021558+1
         LDY   #$0006
         LDA   [$66],Y
         SEP   #$20
         STA   L021558+3
         REP   #$20
         LDA   [$66]
         STA   L021563+1
         LDY   #$0002
         LDA   [$66],Y
         SEP   #$20
         STA   L021563+3
         REP   #$20
         RTS

L021555  SEP   #$20
         SEI
L021558  JSL   $123456
         CLI
         REP   #$20
         RTS

L021560  SEP   #$20
         SEI
L021563  JSL   $123456
         CLI
         REP   #$20
         RTS

L02156B  _ACEExpBegin
         BCS   L02156B
         pei   $58
         pei   $56
         PEA   $0000
         PEA   $0000
         pei   $60
         pei   $5E
         PEA   $0000
         PEA   $0000
         LDA   L0215EA
         ASL
         TAX
         LDA   L0215FA,X
         PHA
         PEA   $0002
         _ACEExpand
         RTS

L0215A0  _ACEExpBegin
         BCS   L0215A0
         pei   $58
         pei   $56
         PEA   $0000
         PEA   $0000
         pei   $60
         pei   $5E
         PEA   $0000
         PEA   $0000
         LDA   L0215EA
         ASL
         TAX
         LDA   L0215FA,X
         PHA
         PEA   $0001
         _ACEExpand
         RTS

L0215D5  LDY   L0215E8
         LDX   #$0003
         LDA   #$0000
L0215DE  STA   [$62],Y
         INY
         INY
         DEX
         BPL   L0215DE
         RTS

L0215E6  DW    $0006
L0215E8  DW    $0000
L0215EA  DW    $0000
L0215EC  DW    $0000
         DW    $0009
         DW    $0012
         DW    $001B
         DW    $0024
         DW    $002D
         DW    $0036
L0215FA  DW    $0001
         DW    $0001
         DW    $0002
         DW    $0004
         DW    $0008
         DW    $0010
         DW    $0020
L021608  DW    $0100
         DW    $0200
         DW    $0400
         DW    $0800
         DW    $1000
         DW    $2000
         DW    $4000
L021616  DW    $0000
         DW    $4000
         DW    $8000
         DW    $C000
L02161E  DW    $0000
         DW    $0040
         DW    $0080
         DW    $00C0
         DW    $000F

L021628  PHX
         JSR   L021686
         LDA   $14
         STA   $4A
         LDA   $16
         STA   $4C
         JSR   L02037B
         JSR   L0214A3
         JSR   L02174D
         JSR   L0211BB
         JSR   L0221F5
         JSR   L02144B
         JSR   L022216
         JSR   L02395C
         PLX
         JMP   L021ADF

L021650  PHA
         JSR   L021686
         PLA
         JSR   L022342
         LDA   $14
         STA   $4A
         LDA   $16
         STA   $4C
         JSR   L02037B
         JSR   L0214A3
         JSR   L02174D
         JSR   L0211BB
         JSR   L0221F5
         JSR   L02144B
         JSR   L022216
         JSR   L02395C
         PEA   $00A0
         PEA   $0064
         _PosMouse
         RTS

L021686  ASL
         TAX
         LDA   L023111,X
         STA   L02169C+1
         LDX   #$000E
L02169C  LDA   L023185,X
         STA   L0204A6,X
         DEX
         DEX
         BPL   L02169C
         LDA   #L021747
         STA   L0204C4
         LDA   #^L021747
         STA   L0204C4+2
         LDA   #$0006
         STA   L0204C8
         JSL   GSOS
         DW    $0010      ; Open
         ADRL  L0204B8
         BCC   L0216C5
L0216C5  LDA   L0204B8
         STA   L0204C2
         STA   L0204D0
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         BCC   L0216DA
L0216DA  LDA   $6E
         STA   L0204C4
         LDA   $70
         STA   L0204C4+2
         LDA   L021747
         STA   L0204C8
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         LDA   $14
         STA   L0204C4
         LDA   $16
         STA   L0204C4+2
         LDA   L021749
         STA   L0204C8
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         LDA   $6A
         STA   L0204C4
         LDA   $6C
         STA   L0204C4+2
         LDA   L02174B
         STA   L0204C8
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         JSL   GSOS
         DW    $0014      ; Close
         ADRL  L0204D0
         LDA   [$6E]
         STA   L0208D6
         LDA   $6E
         CLC
         ADC   #$0002
         STA   $72
         LDA   $70
	 adc   #0
         STA   $74
         RTS

L021747  DW    $0000
L021749  DW    $0000
L02174B  DW    $0000

L02174D  LDA   [$72]
         STA   $90
         DEC   $90
         BPL   L021759
         RTS

L021759  LDA   $90
         ASL
         CLC
         ADC   #$0002
         ADC   $72
         STA   $7A
         LDA   $74
	 adc   #0
         STA   $7C
         LDA   [$7A]
         CLC
         ADC   $6E
         STA   $76
         LDA   $70
	 adc   #0
         STA   $78
         LDA   [$76]
         ASL
         TAX
         JSR   (L021952,X)
         DEC   $90
         BPL   L021759
         RTS

L021785  LDA   #$004C
         CLC
         ADC   $76
         STA   $22
         LDA   $78
	 adc   #0
         STA   $24
         JSR   L02191F
         CLC
         RTS

L021796  LDA   #$006A
         CLC
         ADC   $76
         STA   $22
         LDA   $78
	 adc   #0
         STA   $24
         JSR   L02191F
         CLC
         RTS

L0217A7  LDY   #$0068
         LDA   [$76],Y
         STA   $26
         DEC   $26
L0217B0  LDA   $26
         ASL
         STA   $28
         ASL
         ASL
         CLC
         ADC   $28
         ADC   #$006A
         ADC   $76
         STA   $22
         LDA   $78
	 adc   #0
         STA   $24
         JSR   L02191F
         DEC   $26
         BPL   L0217B0
         RTS

L0217CD  LDY   #$0068
         LDA   [$76],Y
         STA   $4A
         LDA   $76
         CLC
         ADC   #$006E
         STA   $26
         LDA   $78
	 adc   #0
         STA   $28
L0217E0  LDY   #$0000
         LDA   [$26],Y
         STA   $4E
         LDA   $26
         CLC
         ADC   #$0002
         STA   $22
         LDA   $28
	 adc   #0
         STA   $24
L0217F3  JSR   L02191F
         LDA   $22
         CLC
         ADC   #$000A
         STA   $22
         DEC   $4E
         BNE   L0217F3
         DEC   $4A
         BEQ   L021810
         LDA   $26
         CLC
         ADC   #$00A2
         STA   $26
         BRA   L0217E0
L021810  RTS

L021811  LDY   #$0026
         LDA   [$76],Y
         STA   L021960
         LDY   #$0038
         LDA   [$76],Y
         STA   L021962
         LDA   #L021960
         STA   $22
         LDA   #^L021960
         STA   $24
         JSR   L02191F
         LDA   L021960
         STA   $22
         LDA   L021962
         STA   $24
         LDY   #$0002
         LDA   [$22],Y
         STA   L0215E8
         LDY   #$0004
         LDA   [$22],Y
         STA   L0215EA
         LDA   $22
         CLC
         ADC   L0215E6
         STA   $26
         LDA   $24
	 adc   #0
         STA   $28
         LDY   #$3FFE
         LDA   #$8080
L02185A  STA   [$62],Y
         DEY
         DEY
         BPL   L02185A
         LDY   #$0000
         LDA   [$22],Y
         BNE   L02187D
         LDY   L0215E8
         DEY
         SEP   #$20
L02186D  LDA   [$26],Y
         STA   [$62],Y
         DEY
         BNE   L02186D
         LDA   [$26],Y
         STA   [$62],Y
         REP   #$20
         JMP   L0218A9

L02187D  LDA   L0215EA
         ASL
         TAX
         LDA   L021608,X
         TAY
         DEY
         SEP   #$20
L021889  LDA   [$26],Y
         STA   [$5A],Y
         DEY
         BNE   L021889
         LDA   [$26],Y
         STA   [$5A],Y
         REP   #$20
         LDY   #$0000
         LDA   [$22],Y
         CMP   #$0001
         BNE   L0218A6
         JSR   L0215A0
         JMP   L0218A9

L0218A6  JSR   L02156B
L0218A9  LDY   #$000E
         LDA   [$76],Y
         BNE   L0218B3
         JSR   L0215D5
L0218B3  LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$00A0
         TAX
         PHX
         JSR   L021560
         JSR   L021560
         ORA   #$0001
         PLX
         JSR   L021555
         SEI
         LDA   $64
         PHA
         LDA   $62
         PHA
         LDY   #$0010
         LDA   [$76],Y
         ASL
         TAX
         LDA   L021616,X
         PHA
         LDA   L0215EA
         ASL
         TAX
         LDA   L021608,X
         PHA
         _WriteRamBlock
         CLI
         LDY   #$0010
         LDA   [$76],Y
         ASL
         TAX
         LDA   L02161E,X
         PHA
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$0080
         TAX
         PLA
         JSR   L021555
         LDA   L0215EA
         ASL
         TAX
         LDA   L0215EC,X
         PHA
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$00C0
         TAX
         PLA
         JSR   L021555
         RTS

L02191F  LDY   #$0002
         LDA   [$22],Y
         BPL   L021930
         LDA   $6A
         STA   $38
         LDA   $6C
         STA   $3A
         BRA   L02193D
L021930  ASL
         ASL
         TAX
         LDA   L021199,X
         STA   $38
         LDA   L021199+2,X
         STA   $3A
L02193D  LDY   #$0000
         LDA   [$22],Y
         CLC
         ADC   $38
         LDY   #$0000
         STA   [$22],Y
         LDY   #$0002
         LDA   $3A
         STA   [$22],Y
         RTS

L021952  DA    L021785
         DA    L021796
         DA    L0217A7
         DA    L0217CD
         DA    L0204D8
         DA    L0204D8
         DA    L021811
L021960  DW    $0000
L021962  DW    $0000

L021964  LDY   #$0006
         LDA   [$76],Y
         CLC
         ADC   $76
         STA   $22
         LDA   $78
	 adc   #0
         STA   $24
         LDY   #$0002
         LDA   [$22],Y
         STA   L021ADD
         LDA   $22
         CLC
         ADC   #$0004
         STA   $22
	 lda   $24
	 adc   #0
	 sta   $24
         LDA   L021ADD
         BNE   L02198A
         JMP   L021A96

L02198A  LDA   [$22]
         BNE   L021994
         JMP   L021AC2

L021994  BPL   L021999
         JMP   L021AD5

L021999  TAX
         LDY   #$0002
         LDA   [$22],Y
         TXY
         STA   [$76],Y
         CPX   #$0002
         BNE   L0219FC
         CMP   #$0000
         BEQ   L0219AF
         JMP   L021A86

L0219AF  LDA   [$76]
         CMP   #$0006
         BNE   L0219D1
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$00A0
         TAX
         PHX
         JSR   L021560
         ORA   #$0001
         PLX
         JSR   L021555
         JMP   L021A86

L0219D1  LDA   $34
         ASL
         ASL
         ASL
         TAX
         LDY   #$0014
         LDA   [$76],Y
         STA   L020C5D,X
         LDY   #$001A
         LDA   [$76],Y
         STA   L020C5F,X
         LDY   #$0024
         LDA   [$76],Y
         STA   L020C61,X
         LDY   #$0026
         LDA   [$76],Y
         STA   L020C63,X
         INC   $34
         JMP   L021A86

L0219FC  CPX   #$0012
         BNE   L021A30
         LDY   #$0000
         LDA   [$76],Y
         CMP   #$0006
         BNE   L021A30
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$0040
         TAX
         LDY   #$0012
         LDA   [$76],Y
         BNE   L021A27
         LDY   #$0016
         LDA   [$76],Y
         JSR   L021555
         JMP   L021A86

L021A27  LDA   #$0000
         JSR   L021555
         JMP   L021A86

L021A30  CPX   #$0032
         BNE   L021A3D
         LDY   #$0030
         STA   [$76],Y
         JMP   L021A86

L021A3D  CPX   #$0044
         BNE   L021A4A
         LDY   #$0042
         STA   [$76],Y
         JMP   L021A86

L021A4A  CPX   #$0050
         BNE   L021A57
         LDY   #$0060
         STA   [$76],Y
         JMP   L021A86

L021A57  CPX   #$0058
         BNE   L021A61
         LDY   #$0062
         STA   [$76],Y
L021A61  LDY   #$004C
         LDA   [$76],Y
         BNE   L021A86
         CPX   #$0064
         BNE   L021A6F
         BRA   L021A7E
L021A6F  LDY   #$0000
         LDA   [$76],Y
         CMP   #$0003
         BNE   L021A86
         CPX   #$006A
         BNE   L021A86
L021A7E  LDY   #$0064
         LDA   [$76],Y
         DEC
         STA   [$76],Y
L021A86  LDA   $22
         CLC
         ADC   #$0004
         STA   $22
	 lda   $24
	 adc   #0
	 sta   $24
         DEC   L021ADD
         BEQ   L021A96
         JMP   L02198A

L021A96  LDA   [$22]
         BNE   L021AA8
         LDY   #$000C
         STA   [$76],Y
         LDY   #$000A
         STA   [$76],Y
         RTS

L021AA8  CLC
         ADC   $36
         LDY   #$000A
         STA   [$76],Y
         LDY   #$0006
         LDA   $22
         SEC
         SBC   $76
         STA   [$76],Y
         LDA   $36
         LDY   #$000C
         STA   [$76],Y
         RTS

L021AC2  LDY   #$0002
         LDA   [$22],Y
         LDY   #$0008
         CLC
         ADC   [$76],Y
         LDY   #$0006
         STA   [$76],Y
         JMP   L021964

L021AD5  LDA   #$0001
         STA   $90
         JMP   L0211F0

L021ADD  DW    $0000

L021ADF  LDA   $84
         BEQ   L021B10
         PEA   $0000
         PEA   $0000
         PHX
         PEA   $003C
         _Multiply
         PLA
         STA   $22
         PLA
         STA   $24
         PEA   $0000
         PEA   $0000
         LDA   $22
         PHA
         LDA   L0208D6
         PHA
         _UDivide
         PLX
         PLA
L021B10  CPX   #$0000
         BNE   L021B1E
         LDA   #$0001
         STA   L022113
         JMP   L021B24

L021B1E  STX   L022115
         STZ   L022113
L021B24  PEA   $0000
         PEA   $0008
         PEA   $0000
         _FlushEvents
         PLA
L021B35  PEA   $0000
         PEA   $0000
         _GetTick
         PLA
         STA   L0208CE
         PLA
         STA   L0208CE+2
         LDA   L0208CE
         CLC
         ADC   L0208D6
         STA   L0208D2
         JSR   L021BC2
         LDA   L022113
         BNE   L021B67
         DEC   L022115
         BNE   L021B67
         PHA
         CLC
         PHP
         JMP   L021B6F

L021B67  JSR   L0238B2
         BCC   L021B75
         PHA
         SEC
         PHP
L021B6F  JSR   L0214DC
         PLP
         PLA
         RTS

L021B75  LDA   L0208CE
         BPL   L021B9F
         PEA   $0000
         PEA   $0000
         _GetTick
         PLA
         STA   L0208CE
         PLA
         STA   L0208CE+2
         LDA   L0208CE
         BMI   L021B97
         JMP   L021B35

L021B97  CMP   L0208D2
         BCC   L021B67
         JMP   L021B35

L021B9F  PEA   $0000
         PEA   $0000
         _GetTick
         PLA
         STA   L0208CE
         PLA
         STA   L0208CE+2
         LDA   L0208CE
         CMP   L0208D2
         BCS   L021BBF
         JMP   L021B67
L021BBF  JMP   L021B35

L021BC2  JSR   L022066
         STZ   $34
         LDA   [$72]
         STA   $90
         DEC   $90
         BPL   L021BD5
         JMP   L021C23

L021BD5  LDA   $90
         PHA
         ASL
         CLC
         ADC   #$0002
         ADC   $72
         STA   $7A
         LDA   $74
         STA   $7C
         LDA   [$7A]
         CLC
         ADC   $6E
         STA   $76
         LDA   $70
	 adc   #0
         STA   $78
         LDY   #$000C
         LDA   [$76],Y
         LDY   #$000A
         ORA   [$76],Y
         BEQ   L021C08
         LDA   [$76],Y
         CMP   $36
         BNE   L021C08
         JSR   L021964
L021C08  LDY   #$0002
         LDA   [$76],Y
         BEQ   L021C19
         LDY   #$0000
         LDA   [$76],Y
         ASL
         TAX
         JSR   (L022117,X)
L021C19  PLA
         STA   $90
         DEC   $90
         BPL   L021BD5
         JSR   L0209CB
L021C23  INC   $36
         RTS

L021C26  JSR   L021F67
         JMP   L021C2C

L021C2C  LDY   #$004C
         LDA   [$76],Y
         STA   $38
         INY
         INY
         LDA   [$76],Y
         STA   $3A
         LDY   #$0012
         LDA   [$76],Y
         STA   $2A
         LDY   #$0018
         LDA   [$76],Y
         STA   $2C
         JMP   L021E3D

L021C4A  JSR   L021EDE
         JMP   L021C50

L021C50  LDY   #$0064
         LDA   [$76],Y
         ASL
         CLC
         ADC   #$006E
         TAY
         LDA   [$76],Y
         LDY   #$006A
         CLC
         ADC   [$76],Y
         STA   $38
         INY
         INY
         LDA   [$76],Y
         STA   $3A
         LDY   #$0012
         LDA   [$76],Y
         STA   $2A
         LDY   #$0018
         LDA   [$76],Y
         STA   $2C
         JMP   L021E3D

L021C7C  JSR   L021EDE
         JSR   L021F67
         JMP   L021C85

L021C85  LDY   #$0064
         LDA   [$76],Y
         ASL
         STA   $38
         ASL
         ASL
         CLC
         ADC   $38
         ADC   #$006A
         ADC   $76
         STA   $4A
         LDA   $78
	 adc   #0
         STA   $4C
         LDA   [$4A]
         STA   $38
         LDY   #$0002
         LDA   [$4A],Y
         STA   $3A
         JMP   L021E23

L021CAE  LDY   #$006A
         LDA   [$76],Y
         TAY
         BEQ   L021CC0
         LDA   #$0000
L021CB9  CLC
         ADC   #$00A2
         DEY
         BNE   L021CB9
L021CC0  CLC
         ADC   #$006E
         ADC   $76
         STA   $22
         LDA   $78
	 adc   #0
         STA   $24
         LDA   [$22]
         STA   L022111
         JSR   L021EDE
         JSR   L021F67
         JMP   L021CDD

L021CDD  LDY   #$006A
         LDA   [$76],Y
         TAY
         BEQ   L021CEF
         LDA   #$0000
L021CE8  CLC
         ADC   #$00A2
         DEY
         BNE   L021CE8
L021CEF  CLC
         ADC   #$006E
         ADC   $76
         STA   $22
         LDA   $78
	 adc   #0
         STA   $24
         LDY   #$0064
         LDA   [$76],Y
         ASL
         STA   $38
         ASL
         ASL
         CLC
         ADC   $38
         ADC   $22
         ADC   #$0002
         STA   $4A
         LDA   $78
	 adc   #0
         STA   $4C
         LDA   [$4A]
         STA   $38
         LDY   #$0002
         LDA   [$4A],Y
         STA   $3A
         JMP   L021E23

L021D24  LDA   $7E
         BEQ   L021D29
         RTS

L021D29  LDY   #$000E
         LDA   [$76],Y
         BNE   L021D53
         LDY   #$0002
         LDA   #$0000
         STA   [$76],Y
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$00A0
         TAX
         PHX
         JSR   L021560
         AND   #$00F8
         ORA   #$0002
         PLX
         JSR   L021555
         JMP   L021D7A

L021D53  LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$00A0
         TAX
         JSR   L021560
         AND   #$0001
         BEQ   L021D7A
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$00A0
         TAX
         PHX
         JSR   L021560
         AND   #$00F8
         PLX
         JSR   L021555
L021D7A  LDY   #$0016
         LDA   [$76],Y
         LDY   #$0022
         CMP   [$76],Y
         BEQ   L021DB1
         LDY   #$001A
         LDA   [$76],Y
         BEQ   L021DB1
         LDY   #$0026
         LDA   [$76],Y
         BEQ   L021D9A
         DEC
         STA   [$76],Y
         JMP   L021DB1

L021D9A  LDY   #$001E
         LDA   [$76],Y
         LDY   #$0026
         STA   [$76],Y
         LDY   #$001A
         LDA   [$76],Y
         LDY   #$0016
         CLC
         ADC   [$76],Y
         STA   [$76],Y
L021DB1  LDY   #$0012
         LDA   [$76],Y
         BNE   L021DCA
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$0040
         TAX
         LDY   #$0016
         LDA   [$76],Y
         JSR   L021555
L021DCA  LDY   #$0028
         LDA   [$76],Y
         LDY   #$0034
         CMP   [$76],Y
         BEQ   L021E01
         LDY   #$002C
         LDA   [$76],Y
         BEQ   L021E01
         LDY   #$0038
         LDA   [$76],Y
         BEQ   L021DEA
         DEC
         STA   [$76],Y
         JMP   L021E01

L021DEA  LDY   #$0030
         LDA   [$76],Y
         LDY   #$0038
         STA   [$76],Y
         LDY   #$002C
         LDA   [$76],Y
         LDY   #$0028
         CLC
         ADC   [$76],Y
         STA   [$76],Y
L021E01  LDY   #$0010
         LDA   [$76],Y
         TAX
         LDY   #$0028
         LDA   [$76],Y
         JSR   L021555
         LDY   #$0010
         LDA   [$76],Y
         CLC
         ADC   #$0020
         TAX
         LDY   #$0028
         LDA   [$76],Y
         XBA
         JSR   L021555
         RTS

L021E23  LDY   #$0012
         LDA   [$76],Y
         LDY   #$0006
         CLC
         ADC   [$4A],Y
         STA   $2A
         LDY   #$0018
         LDA   [$76],Y
         LDY   #$0008
         CLC
         ADC   [$4A],Y
         STA   $2C
L021E3D  LDY   #$000E
         LDA   [$76],Y
         BNE   L021E47
         JMP   L021ECB

L021E47  LDA   $34
         ASL
         ASL
         ASL
         TAX
         LDY   #$0014
         LDA   [$76],Y
         CMP   $2A
         BEQ   L021E83
         BCS   L021E6E
         STA   L020C5D,X
         LDA   $2A
         SEC
         SBC   [$76],Y
         LSR
         LSR
         INC
         LDY   #$0024
         CLC
         ADC   [$76],Y
         STA   L020C61,X
         BRA   L021E8E
L021E6E  SBC   $2A
         LSR
         LSR
         INC
         LDY   #$0024
         CLC
         ADC   [$76],Y
         STA   L020C61,X
         LDA   $2A
         STA   L020C5D,X
         BRA   L021E8E
L021E83  STA   L020C5D,X
         LDY   #$0024
         LDA   [$76],Y
         STA   L020C61,X
L021E8E  LDY   #$001A
         LDA   [$76],Y
         CMP   $2C
         BEQ   L021EBE
         BCS   L021EAC
         STA   L020C5F,X
         LDA   $2C
         SEC
         SBC   [$76],Y
         LDY   #$0026
         CLC
         ADC   [$76],Y
         STA   L020C63,X
         BRA   L021EC9
L021EAC  SBC   $2C
         LDY   #$0026
         CLC
         ADC   [$76],Y
         STA   L020C63,X
         LDA   $2C
         STA   L020C5F,X
         BRA   L021EC9
L021EBE  STA   L020C5F,X
         LDY   #$0026
         LDA   [$76],Y
         STA   L020C63,X
L021EC9  INC   $34
L021ECB  LDA   $2A
         LDY   #$0014
         STA   [$76],Y
         TAX
         LDA   $2C
         LDY   #$001A
         STA   [$76],Y
         TAY
         JMP   L0208DA

L021EDE  LDY   #$004C
         LDA   [$76],Y
         BNE   L021F4D
         LDY   #$0060
         LDA   [$76],Y
         BEQ   L021EF2
         DEC
         STA   [$76],Y
         JMP   L021F4D

L021EF2  LDY   #$0050
         LDA   [$76],Y
         LDY   #$0060
         STA   [$76],Y
         LDY   #$005C
         CMP   [$76],Y
         BEQ   L021F29
         LDY   #$0062
         LDA   [$76],Y
         BEQ   L021F0F
         DEC
         STA   [$76],Y
         BRA   L021F29
L021F0F  LDY   #$0058
         LDA   [$76],Y
         LDY   #$0062
         STA   [$76],Y
         LDY   #$0050
         LDA   [$76],Y
         LDY   #$0054
         CLC
         ADC   [$76],Y
         LDY   #$0050
         STA   [$76],Y
L021F29  LDY   #$0000
         LDA   [$76],Y
         CMP   #$0003
         BEQ   L021F4E
         LDY   #$0064
         LDA   [$76],Y
         INC
         STA   $22
         LDY   #$0068
         LDA   [$76],Y
         CMP   $22
         BNE   L021F46
         STZ   $22
L021F46  LDY   #$0064
         LDA   $22
         STA   [$76],Y
L021F4D  RTS

L021F4E  LDY   #$0064
         LDA   [$76],Y
         INC
         STA   $22
         LDA   L022111
         CMP   $22
         BNE   L021F5F
         STZ   $22
L021F5F  LDY   #$0064
         LDA   $22
         STA   [$76],Y
         RTS

L021F67  LDY   #$0020
         LDA   [$76],Y
         BEQ   L021F6F
         RTS

L021F6F  LDY   #$0028
         LDA   [$76],Y
         LDY   #$0012
         CLC
         ADC   [$76],Y
         STA   [$76],Y
         LDY   #$003A
         LDA   [$76],Y
         LDY   #$0018
         CLC
         ADC   [$76],Y
         STA   [$76],Y
         LDY   #$0036
         LDA   [$76],Y
         LDY   #$0028
         CMP   [$76],Y
         BEQ   L021FB9
         LDY   #$0030
         LDA   [$76],Y
         BEQ   L021FA2
         DEC
         STA   [$76],Y
         JMP   L021FB9

L021FA2  LDY   #$002C
         LDA   [$76],Y
         CLC
         LDY   #$0028
         ADC   [$76],Y
         STA   [$76],Y
         LDY   #$0032
         LDA   [$76],Y
         LDY   #$0030
         STA   [$76],Y
L021FB9  LDY   #$0048
         LDA   [$76],Y
         LDY   #$003A
         CMP   [$76],Y
         BEQ   L021FE9
         LDY   #$0042
         LDA   [$76],Y
         BEQ   L021FD2
         DEC
         STA   [$76],Y
         JMP   L021FE9

L021FD2  LDY   #$003E
         LDA   [$76],Y
         CLC
         LDY   #$003A
         ADC   [$76],Y
         STA   [$76],Y
         LDY   #$0044
         LDA   [$76],Y
         LDY   #$0042
         STA   [$76],Y
L021FE9  LDY   #$0028
         LDA   [$76],Y
         BPL   L022001
         LDY   #$0012
         LDA   [$76],Y
         LDY   #$0028
         CLC
         ADC   [$76],Y
         BEQ   L02201F
         BMI   L02201F
         BRA   L02202A
L022001  LDY   #$0012
         LDA   [$76],Y
         STA   L022064
         LDY   #$0024
         LDA   [$76],Y
         ASL
         ASL
         CLC
         ADC   L022064
         LDY   #$0028
         CLC
         ADC   [$76],Y
         CMP   #$013F
         BCC   L02202A
L02201F  LDY   #$0028
         LDA   [$76],Y
         EOR   #$FFFF
         INC
         STA   [$76],Y
L02202A  LDY   #$003A
         LDA   [$76],Y
         BPL   L022042
         LDY   #$0018
         LDA   [$76],Y
         LDY   #$003A
         CLC
         ADC   [$76],Y
         BEQ   L022058
         BMI   L022058
         BRA   L022063
L022042  LDY   #$0018
         LDA   [$76],Y
         LDY   #$0026
         CLC
         ADC   [$76],Y
         LDY   #$003A
         CLC
         ADC   [$76],Y
         CMP   #$00C7
         BCC   L022063
L022058  LDY   #$003A
         LDA   [$76],Y
         EOR   #$FFFF
         INC
         STA   [$76],Y
L022063  RTS

L022064  DW    $0000

L022066  LDA   [$72]
         STA   $90
         DEC   $90
         BPL   L022072
         RTS

L022072  STZ   $40
L022074  LDA   $90
         ASL
         CLC
         ADC   #$0002
         ADC   $72
         STA   $7A
         LDA   $74
	 adc   #0
         STA   $7C
         LDA   [$7A]
         CLC
         ADC   $6E
         STA   $76
         LDA   $70
         STA   $78
L022091  LDY   #$0002
         LDA   [$76],Y
         BEQ   L0220A2
         LDA   [$76]
         ASL
         TAX
         JSR   (L022125,X)
L0220A2  DEC   $90
         BPL   L022074
         JMP   L020D4F

L0220A9  LDA   $40
         ASL
         ASL
         ASL
         TAX
         LDY   #$0014
         LDA   [$76],Y
         STA   L021034,X
         LDY   #$001A
         LDA   [$76],Y
         STA   L021036,X
         LDY   #$0024
         LDA   [$76],Y
         STA   L021038,X
         LDY   #$0026
         LDA   [$76],Y
         STA   L02103A,X
         INC   $40
         RTS

L0220D2  LDA   [$72]
         STA   $90
         DEC   $90
         BPL   L0220DE
         RTS

L0220DE  LDA   $90
         ASL
         CLC
         ADC   #$0002
         ADC   $72
         STA   $7A
         LDA   $74
	 adc   #0
         STA   $7C
         LDA   [$7A]
         CLC
         ADC   $6E
         STA   $76
         LDA   $70
	 adc   #0
         STA   $78
         LDY   #$0002
         LDA   [$76],Y
         BEQ   L02210C
         LDA   [$76]
         ASL
         TAX
         JSR   (L022133,X)
L02210C  DEC   $90
         BPL   L0220DE
         RTS

L022111  DW    $0000
L022113  DW    $0000
L022115  DW    $0000
L022117  DA    L021C26
         DA    L021C4A
         DA    L021C7C
         DA    L021CAE
         DA    L0204D8
         DA    L0204D8
         DA    L021D24
L022125  DA    L0220A9
         DA    L0220A9
         DA    L0220A9
         DA    L0220A9
         DA    L0204D8
         DA    L0204D8
         DA    L0204D8
L022133  DA    L021C2C
         DA    L021C50
         DA    L021C85
         DA    L021CDD
         DA    L0204D8
         DA    L0204D8
         DA    L0204D8

L022141  PEA   $0000
         PEA   $0000
         _GetTick
         PLA
         STA   L0208CE
         PLA
         STA   L0208CE+2
         LDA   L0208CE
         CLC
         ADC   L0208D6
         STA   L0208D2
         JSR   L021BC2
L022163  JSR   L0238B2
         BCC   L02216F
         PHA
         JSR   L0214DC
         PLA
         SEC
         RTS

L02216F  LDA   L0208CE
         BPL   L022197
         PEA   $0000
         PEA   $0000
         _GetTick
         PLA
         STA   L0208CE
         PLA
         STA   L0208CE+2
         LDA   L0208CE
         BMI   L022190
         BRA   L0221B7
L022190  CMP   L0208D2
         BCC   L022163
         BRA   L0221B7
L022197  PEA   $0000
         PEA   $0000
         _GetTick
         PLA
         STA   L0208CE
         PLA
         STA   L0208CE+2
         LDA   L0208CE
         CMP   L0208D2
         BCS   L0221B7
         JMP   L022163

L0221B7  CLC
         RTS

L0221B9  LDA   L021034
         STA   L020C5D
         LDA   L021036
         STA   L020C5F
         LDA   L021038
         STA   L020C61
         LDA   L02103A
         STA   L020C63
         LDA   #$0001
         STA   $34
         JMP   L0209CB

L0221D9  PEA   ^L022266
         PEA   L022266
         _SetHeartBeat
         RTS

L0221E7  PEA   ^L022266
         PEA   L022266
         _DelHeartBeat
         RTS

L0221F5  LDA   #L022246
         STA   L022242
         LDA   #^L022246
         STA   L022244
         LDA   #$0001
         STA   L022236
         STZ   L022238
         LDA   L022234
         STA   L02226A
L022210  LDA   L022238
         BEQ   L022210
         RTS

L022216  LDA   #$9E20
         STA   L022242
         LDA   #$00E1
         STA   L022244
         STZ   L022236
         STZ   L022238
         LDA   L022234
         STA   L02226A
L02222E  LDA   L022238
         BEQ   L02222E
         RTS

L022234  DW    $0002
L022236  DW    $0000
L022238  DW    $0000
L02223A  DW    $0000
L02223C  DW    $0000
L02223E  DW    $0000
L022240  DW    $0000
L022242  DW    $0000
L022244  DW    $0000
L022246  DS    $20

         MX    %11

L022266  ADRL  $00000000
L02226A  DW    $0000
         DW    $A55A
         LDA   L022244
         STA   L02228F+3
         STA   L022320+3
         REP   #$30
         LDA   L022242
         STA   L02228F+1
         STA   L022320+1
         LDX   #$001E
L022285  STZ   L02223A
         LDAL  $E19E00,X
         STA   L02223E
L02228F  LDAL  $E19E20,X
         STA   L022240
         LDA   L022240
         AND   #$000F
         STA   L02223C
         LDA   L02223E
         AND   #$000F
         CMP   L02223C
         BEQ   L0222B9
         LDY   L022236
         BNE   L0222B5
         CLC
         ADC   #$0001
         BRA   L0222B9
L0222B5  SEC
         SBC   #$0001
L0222B9  STA   L02223A
         LDA   L022240
         AND   #$00F0
         STA   L02223C
         LDA   L02223E
         AND   #$00F0
         CMP   L02223C
         BEQ   L0222DF
         LDY   L022236
         BNE   L0222DB
         CLC
         ADC   #$0010
         BRA   L0222DF
L0222DB  SEC
         SBC   #$0010
L0222DF  ORA   L02223A
         STA   L02223A
         LDA   L022240
         AND   #$0F00
         STA   L02223C
         LDA   L02223E
         AND   #$0F00
         CMP   L02223C
         BEQ   L022308
         LDY   L022236
         BNE   L022304
         CLC
         ADC   #$0100
         BRA   L022308
L022304  SEC
         SBC   #$0100
L022308  ORA   L02223A
         STA   L02223A
         STAL  $E19E00,X
         DEX
         DEX
         BMI   L022319
         JMP   L022285

L022319  LDX   #$001E
L02231C  LDAL  $E19E00,X
L022320  CMPL  $E19E20,X
         BNE   L022339
         DEX
         DEX
         BPL   L02231C
         LDA   #$0000
         STA   L02226A
         LDA   #$0001
         STA   L022238
         JMP   L02233F

L022339  LDA   L022234
         STA   L02226A
L02233F  SEP   #$30
         RTL

         MX    %00

L022342  ASL
         ASL
         ASL
         TAX
         PHX
         LDA   L023504,X
         STA   $22
         LDA   L023504+2,X
         STA   $24
         JSR   L02243A
         LDA   #$0002
         STA   L0224AA
         JSR   L022374
         PLX
         LDA   L023508,X
         STA   $22
         LDA   L023508+2,X
         STA   $24
         JSR   L02243A
         LDA   #$0003
         STA   L0224AA
         JMP   L022374

L022374  LDY   #$3FFE
         LDA   #$8080
L02237A  STA   [$62],Y
         DEY
         DEY
         BPL   L02237A
         LDA   L0224B0
         STA   L0215EA
         JSR   L0215A0
         LDA   L0224AE
         STA   L0215E8
         JSR   L0215D5
         LDA   L0224AA
         CLC
         ADC   #$00A0
         TAX
         PHX
         JSR   L021560
         JSR   L021560
         ORA   #$0001
         PLX
         JSR   L021555
         SEI
         pei   $64
         pei   $62
         LDA   L0224AA
         ASL
         TAX
         LDA   L021616,X
         PHA
         LDA   L0224B0
         ASL
         TAX
         LDA   L021608,X
         PHA
         _WriteRamBlock
         CLI
         LDA   L0224AA
         ASL
         TAX
         LDA   L02161E,X
         PHA
         LDA   L0224AA
         CLC
         ADC   #$0080
         TAX
         PLA
         JSR   L021555
         LDA   L0224B0
         ASL
         TAX
         LDA   L0215EC,X
         PHA
         LDA   L0224AA
         CLC
         ADC   #$00C0
         TAX
         PLA
         JSR   L021555
         LDX   L0224AA
         LDA   #$00A5
         JSR   L021555
         LDA   L0224AA
         CLC
         ADC   #$0020
         TAX
         LDA   #$0000
         JSR   L021555
         LDA   L0224AA
         CLC
         ADC   #$0040
         TAX
         LDA   #$00FF
         JSR   L021555
         RTS

L022419  LDA   $7E
         BEQ   L02241E
         RTS

L02241E  LDA   $8A
         AND   #$0001
         CLC
         ADC   #$0002
         ADC   #$00A0
         TAX
         PHX
         JSR   L021560
         AND   #$00F8
         ORA   #$0002
         PLX
         JSR   L021555
         RTS

L02243A  LDA   $22
         STA   L0204BA
         LDA   $24
         STA   L0204BA+2
         LDA   #L0224AC
         STA   L0204C4
         LDA   #^L0224AC
         STA   L0204C4+2
         LDA   #$0006
         STA   L0204C8
         JSL   GSOS
         DW    $0010      ; Open
         ADRL  L0204B8
         BCC   L022462
L022462  LDA   L0204B8
         STA   L0204C2
         STA   L0204D0
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         BCC   L022477
L022477  LDA   $5A
         STA   L0204C4
         LDA   $5C
         STA   L0204C4+2
         LDA   #$8000
         STA   L0204C8
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         BCC   L022493
L022493  JSL   GSOS
         DW    $0014      ; Close
         ADRL  L0204D0
         LDA   #L0204A6
         STA   L0204BA
         LDA   #^L0204A6
         STA   L0204BA+2
         RTS

L0224AA  DW    $0000
L0224AC  DW    $0000
L0224AE  DW    $0000
L0224B0  DW    $0000

L0224B2  LDA   #L0225FB
         STA   $22
         LDA   #^L0225FB
         STA   $24
         LDA   #L0204A6
         STA   $4E
         LDA   #^L0204A6
         STA   $50
         LDY   #$000E
L0224C9  LDA   [$22],Y
         STA   [$4E],Y
         DEY
         DEY
         BPL   L0224C9
         LDA   $52
         STA   L0204C4
         LDA   $54
         STA   L0204C4+2
         LDA   #$6AB8
         STA   L0204C8
         JSL   GSOS
         DW    $0010      ; Open
         ADRL  L0204B8
         BCC   L0224ED
L0224ED  LDA   L0204B8
         STA   L0204C2
         STA   L0204D0
         JSL   GSOS
         DW    $0012      ; Read
         ADRL  L0204C2
         BCC   L022502
L022502  JSL   GSOS
         DW    $0014      ; Close
         ADRL  L0204D0
         CLC
         RTS

L02250E  LDX   #$0001
         STX   L02260C
         JSR   L02251B
         STZ   L02260C
         RTS

L02251B  LDA   $8A
         ASL
         ASL
         TAX
         LDA   L0232BB,X
         STA   $86
         LDA   L0232BB+2,X
         STA   $88
         LDA   [$86]
         STA   L022608
         LDY   #$0002
         LDA   [$86],Y
         STA   L02260A
         LDY   #$0004
         LDA   [$86],Y
         AND   #$00FF
         STA   L022606
         LDA   L022608
         STA   L020C5D
         LDA   L02260A
         SEC
         SBC   #$000B
         STA   L020C5F
         LDA   #$0025
         STA   L020C63
         LDA   $86
         CLC
         ADC   #$0005
         STA   $86
	 lda   $88
	 adc   #0
	 sta   $88
L022560  LDA   [$86]
         AND   #$00FF
         CMP   #$0020
         BNE   L022577
         LDA   L022608
         CLC
         ADC   #$0014
         STA   L022608
         JMP   L0225B1

L022577  PHA
         ASL
         TAY
         LDA   [$52],Y
         CLC
         ADC   $52
         ADC   #$0004
         STA   $38
         LDA   $54
         STA   $3A
         PLA
         SEC
         SBC   #$0061
         ASL
         TAX
         PHX
         LDA   L02260A
         SEC
         SBC   L022642,X
         TAY
         LDX   L022608
         LDA   L02260C
         BNE   L0225A3
         JSR   L0208DA
L0225A3  PLX
         LDA   L02260E,X
         CLC
         ADC   L022608
         ADC   #$0003
         STA   L022608
L0225B1  INC   $86
         DEC   L022606
         BNE   L022560
         LDA   L022608
         SEC
         SBC   L020C5D
         LSR
         LSR
         INC
         STA   L020C61
         LDA   #$0001
         STA   $34
         LDA   L02260C
         BEQ   L0225EF
         LDA   L020C5D
         STA   L021034
         LDA   L020C5F
         STA   L021036
         LDA   L020C61
         STA   L021038
         LDA   L020C63
         STA   L02103A
         LDA   #$0001
         STA   $40
         JSR   L020D4F
L0225EF  JSR   L0209CB
         LDA   L02260C
         BNE   L0225FA
         JSR   L022419
L0225FA  RTS

L0225FB  STR   '1/Gfx.Font'

L022606  DW    $0000
L022608  DW    $0000
L02260A  DW    $0000
L02260C  DW    $0000
L02260E  DW    $0015
         DW    $0016
         DW    $0013
         DW    $0016
         DW    $0014
         DW    $000D
         DW    $0016
         DW    $0017
         DW    $0008
         DW    $000C
         DW    $0015
         DW    $0008
         DW    $0024
         DW    $0016
         DW    $0015
         DW    $0016
         DW    $0016
         DW    $0012
         DW    $0014
         DW    $000F
         DW    $0016
         DW    $0017
         DW    $0023
         DW    $0014
         DW    $0018
         DW    $0015
L022642  DW    $0000
         DW    $000B
         DW    $0000
         DW    $000B
         DW    $0000
         DW    $000B
         DW    $0000
         DW    $000B
         DW    $0005
         DW    $0005
         DW    $000B
         DW    $000B
         DW    $0000
         DW    $0000
         DW    $0000
         DW    $0000
         DW    $0000
         DW    $0000
         DW    $0000
         DW    $0004
         DW    $0000
         DW    $0000
         DW    $0000
         DW    $0000
         DW    $0000
         DW    $0000

L022676  JSL   GSOS
         DW    $0009      ; SetPrefix
         ADRL  L0226CB
         JSL   GSOS
         DW    $0009      ; SetPrefix
         ADRL  L0226DA
         RTS

L02268B  LDA   #$001E
         STA   L020C5D
         LDA   #$00A0
         STA   L020C5F
         LDA   #$0046
         STA   L020C61
         LDA   #$000F
         STA   L020C63
         LDA   #$0001
         STA   $34
         JMP   L0209CB

L0226AB  LDA   #$001E
         STA   L021034
         LDA   #$00A0
         STA   L021036
         LDA   #$0046
         STA   L021038
         LDA   #$000F
         STA   L02103A
         LDA   #$0001
         STA   $40
         JMP   L020D4F

L0226CB  DW    $0004      ;  prefix num
         ADRL  L0226D1    ;  prefix ptr
L0226D1  STR   '1/Scenes'
L0226DA  DW    $0003      ;  prefix num
         ADRL  L0226E0    ;  prefix ptr
L0226E0  STR   '1/Speech'

L0226E9  LDA   #$0001
         JSR   L021650
         LDA   #$000B
         STA   L0208D6
         STZ   $9A
         LDA   #$0001
         STA   $8A
         JSR   L02251B
L0226FF  LDX   #$0000
         JSR   L021ADF
         LDA   $92
         BNE   L02270B
         SEC
         RTS

L02270B  LDA   $98
         BNE   L022711
         CLC
         RTS

L022711  LDA   L0208D6
         EOR   #$0008
         STA   L0208D6
         JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L0226FF

L02272D  LDA   #$0005
         JSR   L021650
         STZ   $9A
         LDA   #$000A
         STA   $8A
         JSR   L02251B
L02273D  JSR   L022784
         BCC   L02273D
         LDA   $92
         BNE   L022748
         SEC
         RTS
L022748  CLC
         RTS

L02274A  LDA   #$0006
         JSR   L021650
         STZ   $9A
         LDA   #$000C
         STA   $8A
         JSR   L02251B
L02275A  JSR   L022784
         BCC   L02275A
         LDA   $92
         BNE   L022765
         SEC
         RTS
L022765  CLC
         RTS

L022767  LDA   #$000C
         JSR   L021650
         STZ   $9A
         LDA   #$0017
         STA   $8A
         JSR   L02251B
L022777  JSR   L022784
         BCC   L022777
         LDA   $92
         BNE   L022782
         SEC
         RTS
L022782  CLC
         RTS

L022784  JSR   L023956
         LDA   $92
         BNE   L02278D
         SEC
         RTS

L02278D  LDA   $98
         BNE   L022793
         SEC
         RTS

L022793  LDA   $8A
         JSR   L02250E
         JSR   L022141
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         CLC
         RTS

L0227AA  LDA   #$0003
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$0004
         STA   $8A
         JSR   L02251B
L0227BD  JSR   L023950
         LDA   $92
         BNE   L0227C6
         SEC
         RTS

L0227C6  LDA   $98
         BNE   L0227CC
         CLC
         RTS

L0227CC  LDA   $8A
         JSR   L02250E
         LDX   #$0005
         STX   $80
         JSR   L021ADF
         STZ   $80
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L0227BD

L0227EB  LDA   #$0004
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$0006
         STA   $8A
         JSR   L02251B
L0227FE  JSR   L023950
         LDA   $92
         BNE   L022807
         SEC
         RTS

L022807  LDA   $98
         BNE   L02280D
         CLC
         RTS

L02280D  LDA   $8A
         JSR   L02250E
         LDA   $8A
         LSR
         BCS   L02281C
         LDX   #$0007
         BRA   L02281F
L02281C  LDX   #$0006
L02281F  STX   $80
         JSR   L021ADF
         STZ   $80
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L0227FE

L022836  LDA   #$0007
         JSR   L021650
         STZ   $9A
         LDA   #$000E
         STA   $8A
         JSR   L02251B
L022846  JSR   L022141
         BCC   L022846
         LDA   $92
         BNE   L022851
         SEC
         RTS

L022851  LDA   $98
         BNE   L022857
         CLC
         RTS

L022857  JSR   L02250E
         LDA   $8A
         CMP   #$000E
         BEQ   L0228A0
         LDA   #$0002
         JSR   L022905
         JSR   L0228EF
         LDY   #$0002
         LDA   #$0000
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0000
         JSR   L022905
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0001
         JSR   L022905
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         JMP   L0228DF

L0228A0  LDA   #$0000
         JSR   L022905
         JSR   L0228EF
         LDY   #$0002
         LDA   #$0000
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0001
         JSR   L022905
         JSR   L0228EF
         LDY   #$0002
         LDA   #$0000
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0002
         JSR   L022905
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
L0228DF  LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022846

L0228EF  LDA   $90
         PHA
         LDA   $8C
         STA   $76
         LDA   $8E
         STA   $78
         STZ   $90
         JSR   L022091
         PLA
         STA   $90
         JMP   L0221B9

L022905  ASL
         CLC
         ADC   #$0002
         ADC   $72
         STA   $7A
         LDA   $74
         STA   $7C
         LDY   #$0000
         LDA   [$7A],Y
         CLC
         ADC   $6E
         STA   $8C
         LDA   $70
         STA   $8E
         RTS

L022921  LDA   #$0009
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$0002
         STA   $8A
         JSR   L02251B
L022934  JSR   L022141
         BCC   L022966
         LDA   $92
         BNE   L02293F
         SEC
         RTS

L02293F  LDA   $98
         BNE   L022945
         CLC
         RTS

L022945  LDA   #$0001
         JSR   L022905
         LDY   #$0028
         LDA   [$8C],Y
         EOR   #$FFFF
         INC
         STA   [$8C],Y
         JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
L022966  LDA   #$0001
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         CMP   #$010E
         BCC   L022990
         LDA   $8A
         CMP   #$0002
         BNE   L022934
         JSR   L0228EF
         LDA   #$0006
         LDY   #$0012
         STA   [$8C],Y
         LDY   #$0014
         STA   [$8C],Y
         JMP   L022934

L022990  CMP   #$000A
         BCS   L022934
         LDA   $8A
         CMP   #$0003
         BNE   L022934
         JSR   L0228EF
         LDA   #$0110
         LDY   #$0012
         STA   [$8C],Y
         LDY   #$0014
         STA   [$8C],Y
         JMP   L022934

L0229AF  LDA   #$0008
         JSR   L021650
         STZ   $9A
         LDA   #$0011
         STA   $8A
         JSR   L02251B
L0229BF  JSR   L022141
         BCS   L0229C7
         JMP   L022A5B

L0229C7  LDA   $92
         BNE   L0229CD
         SEC
         RTS

L0229CD  LDA   $98
         BNE   L0229D3
         CLC
         RTS

L0229D3  JSR   L02250E
         LDA   $8A
         CMP   #$0010
         BEQ   L022A17
         LDA   #$0000
         JSR   L022905
         LDY   #$0002
         LDA   #$0000
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0001
         JSR   L022905
         LDY   #$0002
         LDA   #$0000
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0002
         JSR   L022905
         LDY   #$0018
         LDA   [$8C],Y
         CLC
         ADC   #$0008
         STA   [$8C],Y
         JMP   L022A4E

L022A17  LDA   #$0000
         JSR   L022905
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0001
         JSR   L022905
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0002
         JSR   L022905
         LDY   #$0018
         LDA   [$8C],Y
         SEC
         SBC   #$0008
         STA   [$8C],Y
L022A4E  LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
L022A5B  LDA   #$0002
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         CMP   #$0008
         BCS   L022A7B
         JSR   L0228EF
         LDA   #$0112
         LDY   #$0012
         STA   [$8C],Y
         LDY   #$0014
         STA   [$8C],Y
L022A7B  JMP   L0229BF

L022A7E  LDA   #$000B
         JSR   L021650
L022A84  LDA   #$0001
         STA   $9A
         LDA   #$0015
         STA   $8A
         JSR   L02251B
L022A91  JSR   L022141
         BCS   L022A99
         JMP   L022AC4

L022A99  LDA   $92
         BNE   L022A9F
         SEC
         RTS

L022A9F  LDA   $98
         BNE   L022AA5
         CLC
         RTS

L022AA5  JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         LDA   #$0002
         JSR   L022905
         JSR   L0228EF
         JSR   L022ADD
         JSR   L02251B
         JSR   L0239DB
         JMP   L022A91

L022AC4  LDA   #$0002
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         CMP   #$00F8
         BCC   L022ADA
         JSR   L0228EF
         JSR   L022ADD
L022ADA  JMP   L022A91

L022ADD  LDA   #$0002
         JSR   L022905
         LDA   #$0002
         LDY   #$0012
         STA   [$8C],Y
         LDY   #$0014
         STA   [$8C],Y
         LDA   #$0061
         LDY   #$0018
         STA   [$8C],Y
         LDY   #$001A
         STA   [$8C],Y
         LDA   $8A
         CMP   #$0014
         BEQ   L022B1E
         LDA   #$0006
         LDY   #$003A
         STA   [$8C],Y
         LDA   #$FFFF
         LDY   #$003E
         STA   [$8C],Y
         LDA   #$FFFA
         LDY   #$0048
         STA   [$8C],Y
         BRA   L022B36
L022B1E  LDA   #$FFFA
         LDY   #$003A
         STA   [$8C],Y
         LDA   #$0001
         LDY   #$003E
         STA   [$8C],Y
         LDA   #$0006
         LDY   #$0048
         STA   [$8C],Y
L022B36  LDY   #$0046
         LDA   [$8C],Y
         LDY   #$0044
         STA   [$8C],Y
         LDY   #$0042
         STA   [$8C],Y
         RTS

L022B46  LDA   #$000A
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$0013
         STA   $8A
         JSR   L02251B
L022B59  JSR   L023950
         LDA   $92
         BNE   L022B62
         SEC
         RTS

L022B62  LDA   $98
         BNE   L022B68
         CLC
         RTS

L022B68  LDA   #$0002
         JSR   L022905
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
         LDA   $8A
         JSR   L02250E
         LDX   #$0013
         STX   $80
         JSR   L021ADF
         STZ   $80
         LDA   #$0001
         JSR   L022905
         LDY   #$0028
         LDA   [$8C],Y
         EOR   #$FFFF
         INC
         STA   [$8C],Y
         LDY   #$003A
         LDA   #$FFF7
         STA   [$8C],Y
         LDY   #$0048
         LDA   #$0009
         STA   [$8C],Y
         LDY   #$003E
         LDA   #$0001
         STA   [$8C],Y
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022B59

L022BBE  LDA   #$0014
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$0027
         STA   $8A
         JSR   L02251B
L022BD1  JSR   L023950
         LDA   $92
         BNE   L022BDA
         SEC
         RTS

L022BDA  LDA   $98
         BNE   L022BE0
         CLC
         RTS

L022BE0  LDA   $8A
         JSR   L02250E
         LDX   #$000C
         STX   $80
         JSR   L021ADF
         STZ   $80
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022BD1

L022BFF  LDA   #$0013
         JSR   L021650
         STZ   $9A
         LDA   #$0025
         STA   $8A
         JSR   L02251B
L022C0F  JSR   L022784
         BCC   L022C0F
         LDA   $92
         BNE   L022C1A
         SEC
         RTS

L022C1A  CLC
         RTS

L022C1C  LDA   #$000F
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$001D
         STA   $8A
         JSR   L02251B
L022C2F  JSR   L022141
         BCS   L022C37
         JMP   L022C62

L022C37  LDA   $92
         BNE   L022C3D
         SEC
         RTS

L022C3D  LDA   $98
         BNE   L022C43
         CLC
         RTS

L022C43  JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         LDA   #$0000
         JSR   L022905
         JSR   L0228EF
         JSR   L022C7B
         JSR   L02251B
         JSR   L0239DB
         JMP   L022C2F

L022C62  LDA   #$0000
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         CMP   #$00F8
         BCC   L022C78
         JSR   L0228EF
         JSR   L022C7B
L022C78  JMP   L022C2F

L022C7B  LDA   #$0000
         JSR   L022905
         LDA   #$0002
         LDY   #$0012
         STA   [$8C],Y
         LDY   #$0014
         STA   [$8C],Y
         LDA   $8A
         CMP   #$001D
         BEQ   L022CA3
         LDA   #$000A
         LDY   #$0018
         STA   [$8C],Y
         LDY   #$001A
         STA   [$8C],Y
         RTS

L022CA3  LDA   #$0082
         LDY   #$0018
         STA   [$8C],Y
         LDY   #$001A
         STA   [$8C],Y
         RTS

L022CB1  LDA   #$0012
         JSR   L021650
         STZ   $9A
         LDA   #$0022
         STA   $8A
         JSR   L02251B
L022CC1  JSR   L023950
         LDA   $92
         BNE   L022CCA
         SEC
         RTS

L022CCA  LDA   $98
         BNE   L022CD0
         CLC
         RTS

L022CD0  LDA   $8A
         JSR   L02250E
         LDX   #$0019
         STX   $80
         JSR   L021ADF
         STZ   $80
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022CC1

L022CEF  LDA   #$0011
         JSR   L021650
         STZ   $9A
         LDA   #$0020
         STA   $8A
         JSR   L02251B
L022CFF  JSR   L022141
         BCC   L022CFF
         LDA   $92
         BNE   L022D0A
         SEC
         RTS

L022D0A  LDA   $98
         BNE   L022D10
         CLC
         RTS

L022D10  JSR   L022D26
         JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022CFF

L022D26  LDA   #$0003
         STA   L022D4B
L022D2C  LDA   L022D4B
         JSR   L022905
         JSR   L0228EF
         LDY   #$0002
         LDA   [$8C],Y
         EOR   #$0001
         STA   [$8C],Y
         INC   L022D4B
         LDA   L022D4B
         CMP   #$0009
         BNE   L022D2C
         RTS

L022D4B  DW    $0000

L022D4D  LDA   #$000D
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$0018
         STA   $8A
         JSR   L02251B
L022D60  JSR   L023950
         LDA   $92
         BNE   L022D69
         SEC
         RTS

L022D69  LDA   $98
         BNE   L022D6F
         CLC
         RTS

L022D6F  LDA   $8A
         JSR   L02250E
         LDX   #$0004
         STX   $80
         JSR   L021ADF
         STZ   $80
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022D60

L022D8E  LDA   #$0002
         JSR   L021650
         LDA   #$0008
         STA   $8A
         JSR   L02251B
L022D9C  JSR   L022784
         BCS   L022DDC
         LDA   $8A
         CMP   #$0008
         BNE   L022DC2
         LDAL  $E19E38
         STAL  $E19E18
         LDAL  $E19E3A
         STAL  $E19E1A
         LDAL  $E19E3C
         STAL  $E19E1C
         BRA   L022D9C
L022DC2  LDAL  $E19E08
         STAL  $E19E18
         LDAL  $E19E0C
         STAL  $E19E1A
         LDAL  $E19E0E
         STAL  $E19E1C
         BRA   L022D9C
L022DDC  LDA   $92
         BNE   L022DE2
         SEC
         RTS

L022DE2  CLC
         RTS

L022DE4  LDA   #$0015
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$0029
         STA   $8A
         JSR   L02251B
L022DF7  JSR   L022141
         BCS   L022DFF
         JMP   L022E96

L022DFF  LDA   $92
         BNE   L022E05
         SEC
         RTS

L022E05  LDA   $98
         BNE   L022E0B
         CLC
         RTS

L022E0B  LDA   $8A
         CMP   #$0029
         BNE   L022E4C
         LDA   #$0003
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         PHA
         LDY   #$0018
         LDA   [$8C],Y
         PHA
         JSR   L0228EF
         LDY   #$0002
         LDA   #$0000
         STA   [$8C],Y
         LDA   #$0004
         JSR   L022905
         LDY   #$0018
         PLA
         STA   [$8C],Y
         LDY   #$0012
         PLA
         STA   [$8C],Y
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
         JMP   L022E83

L022E4C  LDA   #$0004
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         PHA
         LDY   #$0018
         LDA   [$8C],Y
         PHA
         JSR   L0228EF
         LDY   #$0002
         LDA   #$0000
         STA   [$8C],Y
         LDA   #$0003
         JSR   L022905
         LDY   #$0018
         PLA
         STA   [$8C],Y
         LDY   #$0012
         PLA
         STA   [$8C],Y
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
L022E83  JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022DF7

L022E96  LDA   $8A
         CMP   #$0029
         BNE   L022EC2
         LDA   #$0003
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         CMP   #$00E8
         BNE   L022EE5
         JSR   L0228EF
         LDY   #$0012
         LDA   #$0020
         STA   [$8C],Y
         LDY   #$0018
         LDA   #$0019
         STA   [$8C],Y
         BRA   L022EE5
L022EC2  LDA   #$0004
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         CMP   #$0020
         BNE   L022EE5
         JSR   L0228EF
         LDY   #$0012
         LDA   #$00E8
         STA   [$8C],Y
         LDY   #$0018
         LDA   #$007D
         STA   [$8C],Y
L022EE5  JMP   L022DF7

L022EE8  LDA   #$0010
         JSR   L021650
         LDA   #$001E
         STA   $8A
         JSR   L02251B
L022EF6  JSR   L022141
         BCC   L022EF6
         LDA   $92
         BNE   L022F01
         SEC
         RTS

L022F01  LDA   $98
         BNE   L022F07
         CLC
         RTS

L022F07  JSR   L02250E
         LDA   $8A
         CMP   #$001E
         BEQ   L022F39
         LDA   #$0000
         JSR   L022905
         JSR   L0228EF
         LDY   #$0002
         LDA   #$0000
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDX   #$001E
L022F2A  LDAL  $E19E20,X
         STAL  $E19E00,X
         DEX
         DEX
         BPL   L022F2A
         JMP   L022F61

L022F39  LDA   #$0000
         JSR   L022905
         LDY   #$0002
         LDA   #$0001
         STA   [$8C],Y
         LDY   #$0004
         STA   [$8C],Y
         LDA   #$0FFF
         STAL  $E19E00
         LDA   #$0000
         LDX   #$001E
L022F59  STAL  $E19E00,X
         DEX
         DEX
         BNE   L022F59
L022F61  LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022EF6

L022F71  LDA   #$000E
         JSR   L021650
L022F77  LDA   #$0001
         STA   $9A
         LDA   #$001A
         STA   $8A
         JSR   L02251B
L022F84  LDX   #$0000
         JSR   L021ADF
         LDA   $92
         BNE   L022F90
         SEC
         RTS

L022F90  LDA   $98
         BNE   L022F96
         CLC
         RTS

L022F96  JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JSR   L023956
         LDA   $92
         BNE   L022FAF
         SEC
         RTS

L022FAF  LDA   $98
         BNE   L022FB5
         CLC
         RTS

L022FB5  JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022F84

L022FC8  LDA   #$0019
         JSR   L021650
         JMP   L022F77

L022FD1  LDA   #$0016
         JSR   L021650
         STZ   $9A
         LDA   #$0017
         STA   $8A
         JSR   L02251B
L022FE1  JSR   L023950
         LDA   $92
         BNE   L022FEA
         SEC
         RTS

L022FEA  LDA   $98
         BNE   L022FF0
         CLC
         RTS

L022FF0  LDA   $8A
         JSR   L02250E
         LDX   #$0002
         STX   $80
         JSR   L021ADF
         STZ   $80
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L022FE1

L02300F  LDA   #$0017
         JSR   L021650
         LDA   #$0015
         STA   $8A
         JSR   L02251B
         JMP   L022A84

L023020  LDA   #$0018
         JSR   L021650
         LDA   #$0001
         STA   $9A
         LDA   #$002B
         STA   $8A
         JSR   L02251B
L023033  JSR   L022141
         BCS   L02303B
         JMP   L023066

L02303B  LDA   $92
         BNE   L023041
         SEC
         RTS

L023041  LDA   $98
         BNE   L023047
         CLC
         RTS

L023047  JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         LDA   #$0001
         JSR   L022905
         JSR   L0228EF
         JSR   L02307F
         JSR   L02251B
         JSR   L0239DB
         JMP   L023033

L023066  LDA   #$0001
         JSR   L022905
         LDY   #$0012
         LDA   [$8C],Y
         CMP   #$0004
         BCS   L02307C
         JSR   L0228EF
         JSR   L02307F
L02307C  JMP   L023033

L02307F  LDA   #$0001
         JSR   L022905
         LDA   #$010A
         LDY   #$0012
         STA   [$8C],Y
         LDY   #$0014
         STA   [$8C],Y
         LDA   $8A
         CMP   #$002B
         BEQ   L0230A7
         LDA   #$000A
         LDY   #$0018
         STA   [$8C],Y
         LDY   #$001A
         STA   [$8C],Y
         RTS

L0230A7  LDA   #$0082
         LDY   #$0018
         STA   [$8C],Y
         LDY   #$001A
         STA   [$8C],Y
         RTS

L0230B5  LDA   L0230D3
         ASL
         TAX
         JSR   (L0230D7,X)
         BCS   L0230D2
         INC   L0230D3
         LDA   L0230D3
         CMP   L0230D5
         BNE   L0230B5
         LDA   #$0001
         STA   L0230D3
         BRA   L0230B5
L0230D2  RTS

L0230D3  DW    $0001
L0230D5  DW    $001D
L0230D7  DA    L0204D8
L0230D9  DA    L023AD7
         DA    L0227AA
         DA    L022F71
         DA    L0229AF
         DA    L022FD1
         DA    L023020
         DA    L02274A
L0230E7  DA    L022B46
         DA    L022BFF
         DA    L022D8E
         DA    L0226E9
         DA    L022A7E
         DA    L022DE4
         DA    L022D4D
L0230F5  DA    L022CEF
         DA    L023B46
         DA    L022C1C
         DA    L022FC8
         DA    L022BBE
         DA    L022EE8
         DA    L022767
L023103  DA    L022921
         DA    L022836
         DA    L023A75
         DA    L022CB1
         DA    L02272D
         DA    L02300F
         DA    L0227EB

L023111  DA    L023185
         DA    L02318D
         DA    L023198
         DA    L0231A3
         DA    L0231AD
         DA    L0231B5
         DA    L0231BD
         DA    L0231C8
         DA    L0231D4
         DA    L0231DD
         DA    L0231EB
         DA    L0231F3
         DA    L0231FF
         DA    L02320B
         DA    L023217
         DA    L023220
         DA    L02322A
         DA    L023236
         DA    L023240
         DA    L023248
         DA    L023254
         DA    L023260
         DA    L023269
         DA    L023277
         DA    L023284
         DA    L02328F
         DA    L023299
         DA    L0232A4
         DA    L0232AF
L023185  STR   '4/Title'
L02318D  STR   '4/FastSlow'
L023198  STR   '4/DayNight'
L0231A3  STR   '4/NearFar'
L0231AD  STR   '4/EFull'
L0231B5  STR   '4/FBack'
L0231BD  STR   '4/HappySad'
L0231C8  STR   '4/InsideOut'
L0231D4  STR   '4/InfBeh'
L0231DD  STR   '4/ForwardBack'
L0231EB  STR   '4/InOut'
L0231F3  STR   '4/OverUnder'
L0231FF  STR   '4/OpenClose'
L02320B  STR   '4/ShortTall'
L023217  STR   '4/StopGo'
L023220  STR   '4/HighLow'
L02322A  STR   '4/LightDark'
L023236  STR   '4/ManyFew'
L023240  STR   '4/OnOff'
L023248  STR   '4/LeftRight'
L023254  STR   '4/TopBottom'
L023260  STR   '4/UpDown'
L023269  STR   '4/OpenClosed2'
L023277  STR   '4/OverUnder2'
L023284  STR   '4/HighLow2'
L02328F  STR   '4/StopGo2'
L023299  STR   '4/NearFar2'
L0232A4  STR   '4/ManyFew2'
L0232AF  STR   '4/FastSlow2'

L0232BB  ADRL  L02336B
         ADRL  L023374
         ADRL  L02337D
         ADRL  L023389
         ADRL  L023396
         ADRL  L02339F
         ADRL  L0233A7
         ADRL  L0233B1
         ADRL  L0233BA
         ADRL  L0233C2
         ADRL  L0233CC
         ADRL  L0233D6
         ADRL  L0233DF
         ADRL  L0233E9
         ADRL  L0233F1
         ADRL  L0233FC
         ADRL  L023408
         ADRL  L023415
         ADRL  L023420
         ADRL  L023427
         ADRL  L02342F
         ADRL  L023438
         ADRL  L023442
         ADRL  L02344B
         ADRL  L023456
         ADRL  L023460
         ADRL  L023469
         ADRL  L023470
         ADRL  L023479
         ADRL  L023482
         ADRL  L02348A
         ADRL  L023494
         ADRL  L02349D
         ADRL  L0234A6
         ADRL  L0234AE
         ADRL  L0234B5
         ADRL  L0234BD
         ADRL  L0234C7
         ADRL  L0234D0
         ADRL  L0234D8
         ADRL  L0234E3
         ADRL  L0234EA
         ADRL  L0234F3
         ADRL  L0234FC
L02336B  DW    $0011
         DW    $0010
         STR   'fast'
L023374  DW    $0011
         DW    $0010
         STR   'slow'
L02337D  DW    $0011
         DW    $0010
         STR   'forward'
L023389  DW    $0011
         DW    $0010
         STR   'backward'
L023396  DW    $0011
         DW    $0010
         STR   'near'
L02339F  DW    $0011
         DW    $0010
         STR   'far'
L0233A7  DW    $0011
         DW    $0010
         STR   'empty'
L0233B1  DW    $0011
         DW    $0010
         STR   'full'
L0233BA  DW    $0011
         DW    $0010
         STR   'day'
L0233C2  DW    $0011
         DW    $0010
         STR   'night'
L0233CC  DW    $0011
         DW    $0010
         STR   'front'
L0233D6  DW    $0011
         DW    $0010
         STR   'back'
L0233DF  DW    $0011
         DW    $0010
         STR   'happy'
L0233E9  DW    $0011
         DW    $0010
         STR   'sad'
L0233F1  DW    $0011
         DW    $0010
         STR   'inside'
L0233FC  DW    $0011
         DW    $0010
         STR   'outside'
L023408  DW    $0011
         DW    $0010
         STR   'in front'
L023415  DW    $0011
         DW    $0010
         STR   'behind'
L023420  DW    $0011
         DW    $00AA
         STR   'in'
L023427  DW    $0011
         DW    $00AA
         STR   'out'
L02342F  DW    $0011
         DW    $0010
         STR   'over'
L023438  DW    $0011
         DW    $0010
         STR   'under'
L023442  DW    $0011
         DW    $0010
         STR   'open'
L02344B  DW    $0011
         DW    $0010
         STR   'closed'
L023456  DW    $0011
         DW    $0010
         STR   'short'
L023460  DW    $0011
         DW    $0010
         STR   'tall'
L023469  DW    $0011
         DW    $0010
         STR   'go'
L023470  DW    $0011
         DW    $0010
         STR   'stop'
L023479  DW    $0011
         DW    $0032
         STR   'high'
L023482  DW    $0011
         DW    $005E
         STR   'low'
L02348A  DW    $0011
         DW    $0010
         STR   'light'
L023494  DW    $0011
         DW    $0010
         STR   'dark'
L02349D  DW    $0011
         DW    $0010
         STR   'many'
L0234A6  DW    $0011
         DW    $0010
         STR   'few'
L0234AE  DW    $0011
         DW    $0010
         STR   'on'
L0234B5  DW    $0011
         DW    $0010
         STR   'off'
L0234BD  DW    $00CA
         DW    $0010
         STR   'right'
L0234C7  DW    $0011
         DW    $0010
         STR   'left'
L0234D0  DW    $00F5
         DW    $0010
         STR   'top'
L0234D8  DW    $00A8
         DW    $00AA
         STR   'bottom'
L0234E3  DW    $0100
         DW    $0010
         STR   'up'
L0234EA  DW    $00C8
         DW    $0010
         STR   'down'
L0234F3  DW    $0011
         DW    $005E
         STR   'high'
L0234FC  DW    $0011
         DW    $005E
         STR   'low'

L023504  ADRL  $00000000
L023508  ADRL  $00000000
         ADRL  L0235EC
         ADRL  L0235F7
         ADRL  L02364B
         ADRL  L023655
         ADRL  L02361F
         ADRL  L02362A
         ADRL  L023634
         ADRL  L023640
         ADRL  L023661
         ADRL  L02366D
         ADRL  L023678
         ADRL  L023684
         ADRL  L02368E
         ADRL  L02369B
         ADRL  L0236A9
         ADRL  L0236B7
         ADRL  L023602
         ADRL  L023610
         ADRL  L0236C4
         ADRL  L0236CD
         ADRL  L0236D7
         ADRL  L0236E2
         ADRL  L0236EE
         ADRL  L0236F9
         ADRL  L023706
         ADRL  L023712
         ADRL  L02371D
         ADRL  L023726
         ADRL  L023731
         ADRL  L02373C
         ADRL  L023746
         ADRL  L023752
         ADRL  L02375D
         ADRL  L023768
         ADRL  L023772
         ADRL  L02377B
         ADRL  L023785
         ADRL  L023791
         ADRL  L02379C
         ADRL  L0237A6
         ADRL  L0237B3
         ADRL  L0237BC
         ADRL  L0236EE
         ADRL  L0236F9
         ADRL  L0236D7
         ADRL  L0236E2
         ADRL  L023731
         ADRL  L02373C
         ADRL  L02371D
         ADRL  L023726
         ADRL  L02361F
         ADRL  L02362A
         ADRL  L02375D
         ADRL  L023768
         ADRL  L0235EC
         ADRL  L0235F7
L0235EC  STR   '3/fast.spc'
L0235F7  STR   '3/slow.spc'
L023602  STR   '3/forward.spc'
L023610  STR   '3/backward.spc'
L02361F  STR   '3/near.spc'
L02362A  STR   '3/far.spc'
L023634  STR   '3/empty.spc'
L023640  STR   '3/full.spc'
L02364B  STR   '3/day.spc'
L023655  STR   '3/night.spc'
L023661  STR   '3/front.spc'
L02366D  STR   '3/back.spc'
L023678  STR   '3/happy.spc'
L023684  STR   '3/sad.spc'
L02368E  STR   '3/inside.spc'
L02369B  STR   '3/outside.spc'
L0236A9  STR   '3/infront.spc'
L0236B7  STR   '3/behind.spc'
L0236C4  STR   '3/in.spc'
L0236CD  STR   '3/out.spc'
L0236D7  STR   '3/over.spc'
L0236E2  STR   '3/under.spc'
L0236EE  STR   '3/open.spc'
L0236F9  STR   '3/closed.spc'
L023706  STR   '3/short.spc'
L023712  STR   '3/tall.spc'
L02371D  STR   '3/go.spc'
L023726  STR   '3/stop.spc'
L023731  STR   '3/high.spc'
L02373C  STR   '3/low.spc'
L023746  STR   '3/light.spc'
L023752  STR   '3/dark.spc'
L02375D  STR   '3/many.spc'
L023768  STR   '3/few.spc'
L023772  STR   '3/on.spc'
L02377B  STR   '3/off.spc'
L023785  STR   '3/right.spc'
L023791  STR   '3/left.spc'
L02379C  STR   '3/top.spc'
L0237A6  STR   '3/bottom.spc'
L0237B3  STR   '3/up.spc'
L0237BC  STR   '3/down.spc'

         MX    %00
L0237C7  LDA   #$0003
         STA   L02385F
L0237CD  JSR   L023850
         LDX   L023863
         LDA   L0230D9,X
         PHA
         LDY   L023861
         LDA   L0230D9,Y
         STA   L0230D9,X
         PLA
         STA   L0230D9,Y
         DEC   L02385F
         BNE   L0237CD
         LDA   #$0003
         STA   L02385F
L0237EF  JSR   L023850
         LDX   L023863
         LDA   L0230E7,X
         PHA
         LDY   L023861
         LDA   L0230E7,Y
         STA   L0230E7,X
         PLA
         STA   L0230E7,Y
         DEC   L02385F
         BNE   L0237EF
         LDA   #$0003
         STA   L02385F
L023811  JSR   L023850
         LDX   L023863
         LDA   L0230F5,X
         PHA
         LDY   L023861
         LDA   L0230F5,Y
         STA   L0230F5,X
         PLA
         STA   L0230F5,Y
         DEC   L02385F
         BNE   L023811
         LDA   #$0003
         STA   L02385F
L023833  JSR   L023850
         LDX   L023863
         LDA   L023103,X
         PHA
         LDY   L023861
         LDA   L023103,Y
         STA   L023103,X
         PLA
         STA   L023103,Y
         DEC   L02385F
         BNE   L023833
         RTS

L023850  JSR   L02388A
         ASL
         STA   L023861
         JSR   L02388A
         ASL
         STA   L023863
         RTS

L02385F  DW    $0000
L023861  DW    $0000
L023863  DW    $0000

L023865  PEA   $0000
         PEA   $0000
         _GetTick
         PLA
         STA   L0238A0
         PLA
         STA   L0238A2
         LDA   L0238A0
         AND   #$0007
         CMP   #$0007
         BNE   L023886
         DEC
L023886  STA   L0238A0
         RTS

L02388A  LDA   L0238A0
         ASL
         TAX
         LDA   L0238A4,X
         INX
         INX
         CPX   #$0007
         BCC   L02389C
         LDX   #$0000
L02389C  STX   L0238A0
         RTS

L0238A0  DW    $0000
L0238A2  DW    $0000
L0238A4  DW    $0000
         DW    $0003
         DW    $0001
         DW    $0006
         DW    $0004
         DW    $0002
         DW    $0005

L0238B2  LDA   #$0001
         STA   $94
         STA   $96
         STA   $98
         STA   $92
         JSR   L0238C7
         BCC   L0238C3
         RTS

L0238C3  JSR   L02396E
         RTS

L0238C7  PEA   $0000
         PEA   $0408
         PEA   ^L0210F8
         PEA   L0210F8
         _GetNextEvent
         PLA
         BNE   L0238DF
         BRA   L02394A
L0238DF  LDX   $80
         BEQ   L0238E5
         BRA   L02394A
L0238E5  JSR   L0239E9
         BCC   L0238EF
         JSR   L0239DB
         BRA   L02394A
L0238EF  LDA   L0210FA
         CMP   #$0011
         BNE   L023905
         LDA   $7E
         EOR   #$0001
         STA   $7E
         BEQ   L02394A
         JSR   L0214DC
         BRA   L02394A
L023905  CMP   #$001B
         BNE   L02390E
         STZ   $92
         BRA   L02394C
L02390E  CMP   #$0008
         BNE   L023917
         STZ   $94
         BRA   L02394C
L023917  CMP   #$0015
         BNE   L023920
         STZ   $96
         BRA   L02394C
L023920  CMP   #$000B
         BNE   L023929
         STZ   $94
         BRA   L02394C
L023929  CMP   #$000A
         BNE   L023932
         STZ   $96
         BRA   L02394C
L023932  CMP   #$0020
         BNE   L02393B
         STZ   $98
         BRA   L02394C
L02393B  CMP   #$000D
         BNE   L023944
         STZ   $98
         BRA   L02394C
L023944  LDX   $82
         BEQ   L02394A
         BRA   L02394C
L02394A  CLC
         RTS

L02394C  JSR   L0239B4
         RTS

L023950  JSR   L0238B2
         BCC   L023950
         RTS

L023956  JSR   L0238B2
         BCC   L023956
         RTS

L02395C  PEA   $0000
         PEA   $FFFF
         PEA   $0000
         _FlushEvents
         PLA
         RTS

L02396E  LDA   $80
         BNE   L0239AE
         JSR   L0239E9
         BCS   L0239AE
         PEA   $0000
         PEA   $0000
         PEA   $0000
         _ReadMouse
         PLA
         BIT   #$8000
         BEQ   L023993
         STZ   $98
         PLA
         PLA
         BRA   L0239B0
L023993  PLA
         PLA
         CMP   #$00A0
         BEQ   L0239AE
         BCS   L0239A5
         CMP   #$0050
         BCS   L0239AE
         STZ   $94
         BRA   L0239B0
L0239A5  CMP   #$00F0
         BCC   L0239AE
         STZ   $96
         BRA   L0239B0
L0239AE  CLC
         RTS

L0239B0  JSR   L0239B4
         RTS

L0239B4  LDA   $94
         AND   $96
         BEQ   L0239BC
         BRA   L0239D0
L0239BC  LDA   $94
         BNE   L0239C8
         LDA   $9A
         BNE   L0239D0
         INC   $94
         BRA   L0239D9
L0239C8  LDA   $9A
         BEQ   L0239D0
         INC   $96
         BRA   L0239D9
L0239D0  LDA   $9A
         EOR   #$0001
         STA   $9A
         SEC
         RTS

L0239D9  CLC
         RTS

L0239DB  PEA   $00A0
         PEA   $0064
         _PosMouse
         RTS

L0239E9  LDX   #$00A2
         JSR   L021560
         AND   #$0001
         BNE   L0239F7
         SEC
         BRA   L023A06
L0239F7  LDX   #$00A3
         JSR   L021560
         AND   #$0001
         BNE   L023A05
         SEC
         BRA   L023A06
L023A05  CLC
L023A06  RTS

*--- Protection

*L023A07  JSL   GSOS
*         DW    $0020      ; GetDevNumber
*         ADRL  L023A57
*         BCC   L023A18
*         JSR   L023A2D
*         BRA   L023A07
*L023A18  LDA   L023A5B
*         STA   L023A6B
*         JSL   GSOS
*         DW    $0022      ; READ_BLOCK
*         ADRL  L023A6B
*         BCS   L023A2C
*         BRA   L023A07
*L023A2C  RTS
*
*L023A2D  LDA   $42
*         CLC
*         ADC   #$6F26
*         STA   $38
*         LDA   $44
*         STA   $3A
*         LDX   #$001E
*         LDY   #$00A0
*         JSR   L0208DA
*         JSR   L02268B
*         LDA   #$0001
*         STA   $82
*L023A4A  JSR   L0238C7
*         BCC   L023A4A
*         STZ   $82
*         JSR   L0226AB
*         JMP   L02268B
*
*L023A57  ADRL  L023A5D    ;  device name
*L023A5B  DW    $0000      ;  device num
*L023A5D  STR   '/SB.Opposites'
*L023A6B  DW    $0000      ;  device num
*         ADRL  $00000062  ;  buffer ptr
*         DW    $0055      ;  block num
*         DW    $0000

L023A75  LDA   #$001C
         JSR   L021650
         STA   $9A
         LDA   #$0008
         STA   L0208D6
         LDA   #$0001
         STA   $8A
         JSR   L02251B
L023A8B  LDX   #$0000
         JSR   L021ADF
         LDA   $92
         BNE   L023A97
         SEC
         RTS

L023A97  LDA   $98
         BNE   L023A9D
         CLC
         RTS

L023A9D  LDA   #$0000
         JSR   L022905
         LDY   #$0064
         LDA   $8A
         ASL
         STA   [$8C],Y
         LDA   #$0003
         JSR   L022905
         LDY   #$0028
         LDA   [$8C],Y
         EOR   #$0080
         STA   [$8C],Y
         LDA   L0208D6
         EOR   #$000A
         STA   L0208D6
         JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L023A8B

L023AD7  LDA   #$001B
         JSR   L021650
         LDA   #$0020
         STA   $8A
         JSR   L02251B
L023AE5  JSR   L022141
         BCC   L023AE5
         LDA   $92
         BNE   L023AF0
         SEC
         RTS

L023AF0  LDA   $98
         BNE   L023AF6
         CLC
         RTS

L023AF6  JSR   L023B0C
         JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L023AE5

L023B0C  LDA   #$0000
         STA   L023B44
L023B12  LDA   L023B44
         JSR   L022905
         JSR   L0228EF
         LDY   #$0002
         LDA   [$8C],Y
         EOR   #$0001
         STA   [$8C],Y
         INC   L023B44
         LDA   L023B44
         CMP   #$0011
         BNE   L023B12
         LDA   $8A
         CMP   #$0020
         BEQ   L023B3C
         LDA   #$0011
         BRA   L023B3F
L023B3C  LDA   #$0008
L023B3F  STA   [$72]
         JMP   L0211BB

L023B44  DW    $0000

L023B46  LDA   #$001A
         JSR   L021650
         STZ   $9A
         LDA   #$0004
         STA   $8A
         JSR   L02251B
L023B56  JSR   L022141
         BCC   L023B56
         LDA   $92
         BNE   L023B61
         SEC
         RTS

L023B61  LDA   $98
         BNE   L023B67
         CLC
         RTS

L023B67  JSR   L023B7D
         JSR   L02250E
         LDA   $8A
         EOR   #$0001
         STA   $8A
         JSR   L02251B
         JSR   L0239DB
         JMP   L023B56

L023B7D  LDA   #$0009
         STA   $90
         JSR   L022074
         LDA   #$0009
         STA   L023BB8
L023B8B  LDA   L023BB8
         JSR   L022905
         LDY   #$0002
         LDA   [$8C],Y
         EOR   #$0001
         STA   [$8C],Y
         DEC   L023BB8
         BPL   L023B8B
         JSR   L0220D2
         LDA   L0210D6
         STA   $34
         LDX   #$0026
L023BAB  LDA   L021034,X
         STA   L020C5D,X
         DEX
         DEX
         BPL   L023BAB
         JMP   L0209CB

L023BB8  DW    $0000
