*
* Lode Runner
* (c) 1983, Broderbund Software
* (s) 2014, Brutal Deluxe Software
*

	mx	%11
	org	$6000
	lst	off

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

	use	LR.Equates
	use	LR.Monitor

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

L6000	JSR	L87A2

	LDA	#$01	; read score table
	JSR	L6359

*--- Show title page
* Data if from $0F00 to $1A84

L6008	JSR	L7A51	; display the compressed title page
	LDA	#<L0F00-1
	STA	L6030+1
	LDA	#>L0F00-1
	STA	L6030+2
	LDY	#$00
	STY	$86
	STY	$A7
	STY	$96
	LDA	#$20
	STA	$1F
	STA	$87
L6023	JSR	L7A31
	LDY	#$00
L6028	INC	L6030+1
	BNE	L6030
	INC	L6030+2
L6030	LDA	L6028
	BEQ	L603F
	BPL	L603C
	STA	($0C),Y
	INY
	BPL	L6028
L603C	TAY
	BPL	L6028
L603F	INC	$86
	LDY	$86
	CPY	#$C0	; until line 192
	BCC	L6023
	STA	TXTPAGE1
	STA	HIRES
	STA	MIXCLR
	STA	TXTCLR
	JMP	L618E

*---

L6056	LDA	#$00
	STA	$8E
	STA	$8F
	STA	$90
	STA	$91
	STA	$97
	STA	$A5
	STA	$53
	STA	$AB
	STA	$A8
	LDA	#>L9B00
	STA	$A9
	LDA	#$05	; 5 men to start with
	STA	$98
	LDA	$A7
	LSR
	BEQ	L6099
	LDA	#$01
	JSR	L6359
	CMP	#$00
	BNE	L6086
	JSR	L8106
	JMP	L6008	; start again

L6086	LDA	L1F00+$FF
	BNE	L6091
	LDA	$36
	LDX	$37
	BNE	L6095
L6091	LDA	$38
	LDX	$39
L6095	STA	$24
	STX	$25
L6099	JSR	L79AD
	STA	TXTPAGE1
L609F	LDX	#$01
	JSR	L6238
	LDA	#$00
	STA	$9E
	STA	$9F
	LDA	$A7
	LSR
	BEQ	L60BF
	JSR	L869F
	LDA	$00
	STA	$85
	LDA	$01
	STA	$86
	LDA	#$09
	JSR	L8700
L60BF	LDX	#$00
	STX	$9C
	STX	$54
	LDA	$97
	CLC
	ADC	$8D
	TAY
	LDX	L6214,Y
	LDA	L6CA7,X
	STA	$60
	LDA	L6CA7+1,X
	STA	$61
	LDA	L6CA7+2,X
	STA	$62
	LDY	$97
	LDA	L621D,Y
	STA	$5F
L60E4	JSR	L64BD
	LDA	$9A
	BEQ	L613F
	JSR	L8811
	LDA	$93
	BNE	L60F5
	JSR	L8631
L60F5	LDA	$01
	BNE	L6107
	LDA	$03
	CMP	#$02
	BNE	L6107
	LDA	$93
	BEQ	L611A
	CMP	#$FF
	BEQ	L611A
L6107	JSR	L75F4
	LDA	$9A
	BEQ	L613F
	JSR	L8811
	JSR	L6C82
	LDA	$9A
	BEQ	L613F
	BNE	L60E4
L611A	INC	$A6
	INC	$96
	INC	$98	; man++
	BNE	L6124
	DEC	$98	: man--
L6124	LDX	#$0F
	STX	$5C
L6128	LDY	#$01
	LDA	#$00
	JSR	L7A92
	JSR	L622A
	JSR	L622A
	JSR	L622A
	DEC	$5C
	BNE	L6128
L613C	JMP	L609F

L613F	DEC	$98	; man--
	JSR	L7A70
	JSR	L87E1
	HEX	02400240035003500460046005700570
	HEX	068006800790079008A008A009B009B0
	HEX	0AC00AC00BD00BD00CE00CE00DF00DF0
	HEX	00

L6178	JSR	L8811
	BCS	L6178
	LDA	$A7
	LSR
	BEQ	L61D0
	LDA	$98	: man
	BNE	L613C
	JSR	L84C8
	JSR	L8B1A	; we are dead, anim GAME OVER
	BCS	L61F6

L618E	JSR	L869F
	LDX	#$FF
	LDY	#$FF
	LDA	#$03
	STA	$86
L6199	LDA	$95
	CMP	#"K"
	BEQ	L61A9
	LDA	BUTN1
	BMI	L6201
	LDA	BUTN0
	BMI	L6201
L61A9	LDA	KBD
	BMI	L61F6
	DEX
	BNE	L6199
	DEY
	BNE	L6199
	DEC	$86
	BNE	L6199
	LDA	$A7
	BNE	L61DE
	LDX	#$01
	STX	$A7
	STX	$A6
	STX	$AC
	STX	$9D
	LDX	$99
	STX	L61D0+1
	STA	$99
	JMP	L6056

L61D0	LDA	#$00
	STA	$99
	LDA	KBD
	LDX	$AC
	BEQ	L61F6
	JMP	L618E

L61DE	CMP	#$01
	BNE	L61F3
	BEQ	L61E9
L61E4	LDA	#$01
	JSR	L6359
L61E9	JSR	L786B
	LDA	#$02
	STA	$A7
	JMP	L618E
L61F3	JMP	L6008

L61F6	STA	KBDSTROBE
	CMP	#$85	; Ctrl-E
	BEQ	L6211
	CMP	#$8D	; Return
	BEQ	L61E4

L6201	LDX	#$00
	STX	$96
	INX
	STX	$A6
	STX	$9D
	LDA	#$02
	STA	$A7
	JMP	L6056

L6211	JMP	L7B84	; Jump to the Editor

L6214	HEX	000306090C0F121518
L621D	HEX	26262E4447494A4B4C4D4E4F50

L622A	LDA	$5C
	ASL
	ASL
	ASL
	ASL
	LDX	#$06
	JSR	L87D5
	JMP	L8811

L6238	STX	$A2
	LDX	#$FF
	STX	$00
	INX
	STX	$A3
	STX	$93
	STX	$8D
	STX	$19
	STX	$A0
	STX	$92
	STX	$1A
	STX	$86
	TXA
	LDX	#$1E
L6252	STA	L0CE0,X
	DEX
	BPL	L6252
	LDX	#$05
L625A	STA	L0C98,X
	DEX
	BPL	L625A
	LDA	#$01
	STA	$9A
	JSR	L630E
	LDY	$86
L6269	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDA	#$00
	STA	$85
L627E	LDA	$1A
	LSR
	LDY	$92
	LDA	L0D00,Y
	BCS	L628C
	AND	#$0F
	BPL	L6292
L628C	LSR
	LSR
	LSR
	LSR
	INC	$92
L6292	INC	$1A
	LDY	$85
	CMP	#$0A
	BCC	L629C
	LDA	#$00
L629C	STA	($06),Y
	STA	($08),Y
	INC	$85
	LDA	$85
	CMP	#$1C
	BCC	L627E
	INC	$86
	LDY	$86
	CPY	#$10
	BCC	L6269
	JSR	L63B3
	BCC	L62C3
	LDA	$96
	BEQ	L62C4
	LDX	#$00
	STX	$96
	INC	$97
	DEX
	JMP	L6238
L62C3	RTS
L62C4	JMP	L6008

L62C7	LDA	#$00
	STA	$92
	STA	$1A
	STA	$86
L62CF	LDY	$86
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	#$00
	STY	$85
L62DF	LDA	$1A
	LSR
	LDA	($06),Y
	BCS	L62EA
	STA	$1E
	BPL	L62F7
L62EA	ASL
	ASL
	ASL
	ASL
	ORA	$1E
	LDY	$92
	STA	L0D00,Y
	INC	$92
L62F7	INC	$1A
	INC	$85
	LDY	$85
	CPY	#$1C
	BCC	L62DF
	INC	$86
	LDA	$86
	CMP	#$10
	BCC	L62CF
	LDA	#$02
	JMP	L630E

L630E	STA	LB7F4
	LDA	$A7
	LSR
	BEQ	L6345
	LDA	$96
	LSR
	LSR
	LSR
	LSR
	CLC
	ADC	#$03
	STA	LB7EC
	LDA	$96
	AND	#$0F
	STA	LB7ED
	LDA	#<L0D00
	STA	LB7F0
	LDA	#>L0D00
	STA	LB7F0+1
	LDA	#$00
	STA	LB7EB
L6338	LDY	#<LB7E8
	LDA	#>LB7E8
*	JSR	$0023	; LoGo - Souvenir from protection
	jsr     L63A5
	BCC	L6344
	JMP	L6008
L6344	RTS

L6345	LDA	$A6
	CLC
	ADC	#$9E
	STA	$0D
	LDY	#$00
	STY	$0C
L6350	LDA	($0C),Y
	STA	L0D00,Y
	INY
	BNE	L6350
	RTS

L6359	STA	LB7F4
	LDA	#$0C
	STA	LB7EC
	LDA	#$0F
	STA	LB7ED
	LDA	#<L1F00
	STA	LB7F0
	LDA	#>L1F00
	STA	LB7F0+1
	LDA	#$00
	STA	LB7EB
	LDY	#<LB7E8
	LDA	#>LB7E8
	JSR	L63A5
	BCC	L6381
	JMP	L6008

L6381	LDY	#$0A
	LDA	#$00
	STA	$50
L6387	LDA	L1F00+$F4,Y	; magic key
	EOR	L63A8,Y
	ORA	$50
	STA	$50
	DEY
	BPL	L6387
	LDA	$50
	BEQ	L639B
	LDA	#$00
	RTS

L639B	LDA	#$01
	LDX	L1F00+$FF
	BNE	L63A4
	LDA	#$FF
L63A4	RTS
L63A5	JMP	($0036)	; LoGo - to be replaced with JMP $BD00

L63A8	ASC	"LODE RUNNER"

L63B3	LDY	#$0F
	STY	$86
L63B7	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDY	#$1B
	STY	$85
L63CC	LDA	($06),Y
	LDX	$A2
	BEQ	L63EE
	CMP	#$06
	BNE	L63F0
	LDX	$A3
	CPX	#$2D
	BCS	L63E8
	INC	$A3
	INX
	LDA	$86
	STA	L0C30,X
	TYA
	STA	L0C00,X
L63E8	LDA	#$00
	STA	($06),Y
	STA	($08),Y
L63EE	BEQ	L6450
L63F0	CMP	#$07
	BNE	L63F8
	INC	$93
	BNE	L6450
L63F8	CMP	#$08
	BNE	L642A
	LDX	$8D
	CPX	#$05
	BCS	L63E8
	INC	$8D
	INX
	TYA
	STA	L0C60,X
	LDA	$86
	STA	L0C68,X
	LDA	#$00
	STA	L0C70,X
	STA	L0C88,X
	LDA	#$02
	STA	L0C78,X
	STA	L0C80,X
	LDA	#$00
	STA	($08),Y
	LDA	#$08
	BNE	L6450
L6426	BPL	L63B7
L6428	BPL	L63CC
L642A	CMP	#$09
	BNE	L644A
	LDX	$00
	BPL	L63E8
	STY	$00
	LDX	$86
	STX	$01
	LDX	#$02
	STX	$02
	STX	$03
	LDX	#$08
	STX	$04
	LDA	#$00
	STA	($08),Y
	LDA	#$09
	BNE	L6450
L644A	CMP	#$05
	BNE	L6450
	LDA	#$01
L6450	JSR	L82B0
	DEC	$85
	LDY	$85
	BPL	L6428
	DEC	$86
	LDY	$86
	BPL	L6426
	LDA	$A2
	BEQ	L6469
	LDA	$00
	BPL	L648B
	SEC
	RTS

L6469	LDA	#$20
	STA	$0E+1
	LDA	#$40
	STA	$0C+1
	LDA	#$00
	STA	$0E
	STA	$0C
	TAY
L6478	LDA	($0C),Y
	STA	($0E),Y
	INY
	BNE	L6478
	INC	$0E+1
	INC	$0C+1
	LDX	$0C+1
	CPX	#$60
	BCC	L6478
	CLC
	RTS

L648B	JSR	L88A2
	LDY	#$0F
	STY	$86
L6492	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	#$1B
	STY	$85
L64A0	LDA	($06),Y
	CMP	#$09
	BEQ	L64AA
	CMP	#$08
	BNE	L64AF
L64AA	LDA	#$00
	JSR	L82B0
L64AF	DEC	$85
	LDY	$85
	BPL	L64A0
	DEC	$86
	LDY	$86
	BPL	L6492
	CLC
	RTS

L64BD	LDA	#$01
	STA	$94
	LDA	$9C
	BEQ	L64CD
	BPL	L64CA
	JMP	L67E7
L64CA	JMP	L68AD

L64CD	LDY	$01
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$00
	LDA	($08),Y
	CMP	#$03
	BEQ	L6522
	CMP	#$04
	BNE	L64EB
	LDA	$03
	CMP	#$02
	BEQ	L6522
L64EB	LDA	$03
	CMP	#$02
	BCC	L6525
	LDY	$01
	CPY	#$0F
	BEQ	L6522
	LDA	L1C05+1,Y
	STA	$06
	STA	$08
	LDA	L1C15+1,Y
	STA	$07
	LDA	L1C25+1,Y
	STA	$09
	LDY	$00
	LDA	($06),Y
	CMP	#$00
	BEQ	L6525
	CMP	#$08
	BEQ	L6522
	LDA	($08),Y
	CMP	#$01
	BEQ	L6522
	CMP	#$02
	BEQ	L6522
	CMP	#$03
	BNE	L6525
L6522	JMP	L6584

L6525	LDA	#$00
	STA	$9B
	JSR	L6B85
	JSR	L8336
	LDA	#$07
	LDX	$05
	BMI	L6537
	LDA	#$0F
L6537	STA	$04
	JSR	L6C13
	INC	$03
	LDA	$03
	CMP	#$05
	BCS	L654A
	JSR	L6B9D
	JMP	L6C02

L654A	LDA	#$00
	STA	$03
	LDY	$01
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDY	$00
	LDA	($08),Y
	CMP	#$01
	BNE	L656B
	LDA	#$00
L656B	STA	($06),Y
	INC	$01
	LDY	$01
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$00
	LDA	#$09
	STA	($06),Y
	JMP	L6C02

L6584	LDA	$9B
	BNE	L658F
	LDA	#$64
	LDX	#$08
	JSR	L87BA
L658F	LDA	#$20
	STA	$A4
	STA	$9B
	JSR	L6A12

	LDA	$9E
	CMP	#"I"	; move up
	BNE	L65A4
	JSR	L66BD
	BCS	L65C2
	RTS

L65A4	CMP	#"K"	; move down
	BNE	L65AE
	JSR	L6766
	BCS	L65C2
	RTS

L65AE	CMP	#"U"	; dig left
	BNE	L65B8
	JSR	L67DB
	BCS	L65C2
	RTS

L65B8	CMP	#"O"	; dig right
	BNE	L65C2
	JSR	L68A1
	BCS	L65C2
	RTS

L65C2	LDA	$9F
	CMP	#"J"	; move left
	BNE	L65CB
	JMP	L65D3

L65CB	CMP	#"L"	; move right
	BNE	L65D2
	JMP	L6645
L65D2	RTS

L65D3	LDY	$01
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$06+1
	LDA	L1C25,Y
	STA	$08+1
	LDX	$02
	CPX	#$03
	BCS	L6600
	LDY	$00
	BEQ	L65FF
	DEY
	LDA	($06),Y
	CMP	#$02
	BEQ	L65FF
	CMP	#$01
	BEQ	L65FF
	CMP	#$05
	BNE	L6600
L65FF	RTS

L6600	JSR	L6B85
	JSR	L8336
	LDA	#$FF
	STA	$05
	JSR	L6C26
	DEC	$02
	BPL	L662A
	LDY	$00
	LDA	($08),Y
	CMP	#$01
	BNE	L661B
	LDA	#$00
L661B	STA	($06),Y
	DEC	$00
	DEY
	LDA	#$09
	STA	($06),Y
	LDA	#$04
	STA	$02
	BNE	L662D
L662A	JSR	L6B9D
L662D	LDY	$00
	LDA	($08),Y
	CMP	#$04
	BEQ	L663B
	LDA	#$00
	LDX	#$02
	BNE	L663F
L663B	LDA	#$03
	LDX	#$05
L663F	JSR	L6BF4
	JMP	L6C02

L6645	LDY	$01
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDX	$02
	CPX	#$02
	BCC	L6674
	LDY	$00
	CPY	#$1B
	BEQ	L6673
	INY
	LDA	($06),Y
	CMP	#$02
	BEQ	L6673
	CMP	#$01
	BEQ	L6673
	CMP	#$05
	BNE	L6674
L6673	RTS

L6674	JSR	L6B85
	JSR	L8336
	LDA	#$01
	STA	$05
	JSR	L6C26
	INC	$02
	LDA	$02
	CMP	#$05
	BCC	L66A2
	LDY	$00
	LDA	($08),Y
	CMP	#$01
	BNE	L6693
	LDA	#$00
L6693	STA	($06),Y
	INC	$00
	INY
	LDA	#$09
	STA	($06),Y
	LDA	#$00
	STA	$02
	BEQ	L66A5
L66A2	JSR	L6B9D
L66A5	LDY	$00
	LDA	($08),Y
	CMP	#$04
	BEQ	L66B3
	LDA	#$08
	LDX	#$0A
	BNE	L66B7
L66B3	LDA	#$0B
	LDX	#$0D
L66B7	JSR	L6BF4
	JMP	L6C02

L66BD	LDY	$01
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$00
	LDA	($08),Y
	CMP	#$03
	BEQ	L66ED
	LDY	$03
	CPY	#$03
	BCC	L66EB
	LDY	$01
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$00
	LDA	($08),Y
	CMP	#$03
	BEQ	L6711
L66EB	SEC
	RTS

L66ED	LDY	$03
	CPY	#$03
	BCS	L6711
	LDY	$01
	BEQ	L66EB
	LDA	$1C04,Y
	STA	$06
	LDA	$1C14,Y
	STA	$07
	LDY	$00
	LDA	($06),Y
	CMP	#$01
	BEQ	L66EB
	CMP	#$02
	BEQ	L66EB
	CMP	#$05
	BEQ	L66EB
L6711	JSR	L6B85
	JSR	L8336
	LDY	$01
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	JSR	L6C13
	DEC	$03
	BPL	L6757
	LDY	$00
	LDA	($08),Y
	CMP	#$01
	BNE	L673B
	LDA	#$00
L673B	STA	($06),Y
	DEC	$01
	LDY	$01
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$00
	LDA	#$09
	STA	($06),Y
	LDA	#$04
	STA	$03
	BNE	L675A
L6757	JSR	L6B9D
L675A	LDA	#$10
	LDX	#$11
	JSR	L6BF4
	JSR	L6C02
	CLC
	RTS

L6766	LDY	$03
	CPY	#$02
	BCC	L678A
	LDY	$01
	CPY	#$0F
	BCS	L6788
	LDA	L1C05+1,Y
	STA	$06
	LDA	L1C15+1,Y
	STA	$07
	LDY	$00
	LDA	($06),Y
	CMP	#$02
	BEQ	L6788
	CMP	#$01
	BNE	L678A
L6788	SEC
	RTS

L678A	JSR	L6B85
	JSR	L8336
	LDY	$01
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	JSR	L6C13
	INC	$03
	LDA	$03
	CMP	#$05
	BCC	L67D5
	LDY	$00
	LDA	($08),Y
	CMP	#$01
	BNE	L67B8
	LDA	#$00
L67B8	STA	($06),Y
	INC	$01
	LDY	$01
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$00
	LDA	#$09
	STA	($06),Y
	LDA	#$00
	STA	$03
	JMP	L675A
L67D5	JMP	L6757
L67D8	JMP	L6892

L67DB	LDA	#$FF
	STA	$9C
	STA	$9E
	STA	$9F
	LDA	#$00
	STA	$A0
L67E7	LDY	$01
	CPY	#$0F
	BCS	L67D8
	INY
	JSR	L884B
	LDY	$00
	BEQ	L67D8
	DEY
	LDA	($06),Y
	CMP	#$01
	BNE	L67D8
	LDY	$01
	JSR	L884B
	LDY	$00
	DEY
	LDA	($06),Y
	CMP	#$00
	BNE	L686E
	JSR	L6B85
	JSR	L8336
	JSR	L6C13
	JSR	L6C26
	LDY	$A0
	LDA	L699E,Y
	LDX	L69AB,Y
	JSR	L87D5
	LDX	$A0
	LDA	#$00
	CPX	#$06
	BCS	L682B
	LDA	#$06
L682B	STA	$04
	JSR	L6C02
	LDX	$A0
	CPX	#$0C
	BEQ	L6898
	CPX	#$00
	BEQ	L684C
	LDA	L6979,X
	PHA
	LDX	$00
	DEX
	LDY	$01
	JSR	L885D
	PLA
	JSR	L8336
	LDX	$A0
L684C	LDA	L697A,X
	PHA
	LDX	$00
	DEX
	STX	$85
	LDY	$01
	STY	$86
	JSR	L885D
	PLA
	JSR	L83A7
	LDX	$A0
	LDA	L6992,X
	INC	$86
	JSR	L82AA
	INC	$A0
	CLC
	RTS

L686E	LDY	$01
	INY
	STY	$86
	LDY	$00
	DEY
	STY	$85
	LDA	#$01
	JSR	L82AA
	LDX	$A0
	BEQ	L6892
	DEX
	LDA	L697A,X
	PHA
	LDY	$01
	LDX	$00
	DEX
	JSR	L885D
	PLA
	JSR	L8336
L6892	LDA	#$00
	STA	$9C
	SEC
	RTS

L6898	LDX	$00
	DEX
	JMP	L6C39
L689E	JMP	L695C

L68A1	LDA	#$01
	STA	$9C
	STA	$9E
	STA	$9F
	LDA	#$0C
	STA	$A0
L68AD	LDY	$01
	CPY	#$0F
	BCS	L689E
	INY
	JSR	L884B
	LDY	$00
	CPY	#$1B
	BCS	L689E
	INY
	LDA	($06),Y
	CMP	#$01
	BNE	L689E
	LDY	$01
	JSR	L884B
	LDY	$00
	INY
	LDA	($06),Y
	CMP	#$00
	BNE	L6936
	JSR	L6B85
	JSR	L8336
	JSR	L6C13
	JSR	L6C26
	LDY	$A0
	LDA	L6992,Y
	LDX	L699F,Y
	JSR	L87D5
	LDX	$A0
	LDA	#$08
	CPX	#$12
	BCS	L68F3
	LDA	#$0E
L68F3	STA	$04
	JSR	L6C02
	LDX	$A0
	CPX	#$18
	BEQ	L6962
	CPX	#$0C
	BEQ	L6914
	LDA	L6979,X
	PHA
	LDX	$00
	INX
	LDY	$01
	JSR	L885D
	PLA
	JSR	L8336
	LDX	$A0
L6914	LDA	L697A,X
	PHA
	LDX	$00
	INX
	STX	$85
	LDY	$01
	STY	$86
	JSR	L885D
	PLA
	JSR	L83A7
	INC	$86
	LDX	$A0
	LDA	L6986,X
	JSR	L82AA
	INC	$A0
	CLC
	RTS

L6936	LDY	$01
	INY
	STY	$86
	LDY	$00
	INY
	STY	$85
	LDA	#$01
	JSR	L82AA
	LDX	$A0
	CPX	#$0C
	BEQ	L695C
	DEX
	LDA	L697A,X
	PHA
	LDX	$00
	INX
	LDY	$01
	JSR	L885D
	PLA
	JSR	L8336
L695C	LDA	#$00
	STA	$9C
	SEC
	RTS

L6962	LDX	$00
	INX
	JMP	L6C39

L6968	DB	$0B
	DB	$0C
	DB	$0D
	DB	$18
	DB	$19
	DB	$1A
	DB	$0F
	DB	$13
	DB	$09
	DB	$10
	DB	$11
	DB	$15
	DB	$16
	DB	$17
	DB	$25
	DB	$14
	DB	$0E
L6979	DB	$12
L697A	DB	$1B
	DB	$1B
	DB	$1C
	DB	$1C
	DB	$1D
	DB	$1D
	DB	$1E
	DB	$1E
	DB	$00
	DB	$00
	DB	$00
	DB	$00
L6986	DB	$26
	DB	$26
	DB	$27
	DB	$27
	DB	$1D
	DB	$1D
	DB	$1E
	DB	$1E
	DB	$00
	DB	$00
	DB	$00
	DB	$00
L6992	DB	$1F
	DB	$1F
	DB	$20
	DB	$20
	DB	$21
	DB	$21
	DB	$22
	DB	$22
	DB	$23
	DB	$23
	DB	$24
	DB	$24
L699E	DB	$20
L699F	DB	$20
	DB	$20
	DB	$20
	DB	$20
	DB	$20
	DB	$20
	DB	$20
	DB	$24
	DB	$24
	DB	$24
	DB	$24
	DB	$24
L69AB	DB	$04
	DB	$04
	DB	$04
	DB	$04
	DB	$04
	DB	$04
	DB	$04
	DB	$04
	DB	$03
	DB	$03
	DB	$02
	DB	$02
	DB	$01

L69B8	LDA	KBD
	BMI	L69CD
	LDA	$95
	CMP	#"K"
	BEQ	L69D6
	LDA	BUTN1
	BMI	L69CD
	LDA	BUTN0
	BPL	L69D6
L69CD	LSR	$AC
	LSR	$9A
	LDA	#$01
	STA	$98	; one man
	RTS

L69D6	LDA	$AB
	BNE	L69F2
	LDY	#$00
	LDA	($A8),Y
	STA	$AA
	INY
	LDA	($A8),Y
	STA	$AB
	LDA	$A8
	CLC
	ADC	#$02
	STA	$A8
	LDA	$A9
	ADC	#$00
	STA	$A9
L69F2	LDA	$AA
	AND	#$0F
	TAX
	LDA	L6A0B,X
	STA	$9E
	LDA	$AA
	LSR
	LSR
	LSR
	LSR
	TAX
	LDA	L6A0B,X
	STA	$9F
	DEC	$AB
	RTS

L6A0B	ASC	"IJKLOU "

L6A12	LDA	$A7
	CMP	#$01
	BEQ	L69B8
	LDX	KBD
	STX	KBDSTROBE
	STX	$1E
	BMI	L6A2B
	LDA	$95
	CMP	#"K"
	BEQ	L6A55
L6A28	JMP	L6AD0

L6A2B	CPX	#$A0
	BCS	L6A49
	STX	$1E
	LDY	#$FF
L6A33	INY
	LDA	L6B59,Y
	BEQ	L6A49
	CMP	$1E
	BNE	L6A33
	TYA
	ASL
	TAY
	LDA	L6B67+1,Y
	PHA
	LDA	L6B67,Y
	PHA
	RTS

L6A49	LDA	$95
	CMP	#"J"
	BEQ	L6A28
	LDX	$1E
	STX	$9E
	STX	$9F
L6A55	RTS

L6A56	INC	$98	; man++
	INC	$A6
	INC	$96
	LSR	$9A
	LSR	$9D
	RTS

L6A61	INC	$98	; man++
	BNE	L6A67
	DEC	$98	; man--
L6A67	JSR	L7A70
	LSR	$9D
	JMP	L6A12

	INC	$97
	INC	$98	; man++
	LSR	$9A
	RTS

L6A76	JSR	L86A8
	CMP	#$9B
	BNE	L6A76
	JMP	L6A12

L6A80	LDA	#$01
	STA	$98	; man
L6A84	LSR	$9A
	RTS

L6A87	LDA	$99
	EOR	#$FF
	STA	$99
	JMP	L6A12

L6A90	LDA	#"J"
	STA	$95
	JMP	L6A12

L6A97	LDA	#"K"
	STA	$95
	JMP	L6A12

L6A9E	LDA	L6B81
	LDX	L6B82
	STA	L6B82
	STX	L6B81
	JMP	L6A12

L6AAD	LDA	L6B83
	LDX	L6B84
	STA	L6B84
	STX	L6B83
	JMP	L6A12

L6ABC	LDA	$8C
	BEQ	L6ACD
	DEC	$8C
	JMP	L6A12

L6AC5	LDA	$8C
	CMP	#$0F
	BEQ	L6ACD
	INC	$8C
L6ACD	JMP	L6A12

L6AD0	LDA	BUTN1
	BPL	L6AD9
	LDA	#$D5
	BNE	L6AE0
L6AD9	LDA	BUTN0
	BPL	L6AE5
	LDA	#$CF
L6AE0	STA	$9E
	STA	$9F
	RTS

L6AE5	JSR	L8746
	LDY	$65
	LDA	L6B82
	CMP	#$2E
	BEQ	L6AFA
	CPY	L6B82
	BCS	L6B03
	LDA	#$CC
	BNE	L6B1E
L6AFA	CPY	L6B82
	BCC	L6B03
	LDA	#$CC
	BNE	L6B1E
L6B03	LDA	L6B81
	CMP	#$2E
	BEQ	L6B13
	CPY	L6B81
	BCS	L6B1C
	LDA	#$CA
	BNE	L6B1E
L6B13	CPY	L6B81
	BCC	L6B1C
	LDA	#$CA
	BNE	L6B1E
L6B1C	LDA	#$C0
L6B1E	STA	$9F
	LDY	$66
	LDA	L6B83
	CMP	#$2E
	BEQ	L6B32
	CPY	L6B83
	BCS	L6B3B
	LDA	#$C9
	BNE	L6B56
L6B32	CPY	L6B83
	BCC	L6B3B
	LDA	#$C9
	BNE	L6B56
L6B3B	LDA	L6B84
	CMP	#$2E
	BEQ	L6B4B
	CPY	L6B84
	BCS	L6B54
	LDA	#$CB
	BNE	L6B56
L6B4B	CPY	L6B84
	BCC	L6B54
	LDA	#$CB
	BNE	L6B56
L6B54	LDA	#$C0
L6B56	STA	$9E
	RTS

L6B59	HEX	9E809B9281938A8B889598998D00

L6B67	DA	L6A56-1	;
	DA	L6A61-1	;
	DA	L6A76-1	;
	DA	L6A80-1	;
	DA	L6A84-1	;
	DA	L6A87-1	;
	DA	L6A90-1	;
	DA	L6A97-1	;
	DA	L6AC5-1	;
	DA	L6ABC-1	;
	DA	L6A9E-1	;
	DA	L6AAD-1	;
	DA	L77AC-1	;

L6B81	DB	$12
L6B82	DB	$2E
L6B83	DB	$12
L6B84	DB	$2E

L6B85	LDX	$00
	LDY	$02
	JSR	L888F
	STX	$1E
	LDY	$01
	LDX	$03
	JSR	L887C
	LDX	$04
	LDA	L6968,X
	LDX	$1E
	RTS

L6B9D	LDA	$02
	CMP	#$02
	BNE	L6BF3
	LDA	$03
	CMP	#$02
	BNE	L6BF3
	LDY	$01
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$00
	LDA	($08),Y
	CMP	#$07
	BNE	L6BF3
	LSR	$94
	DEC	$93
	LDY	$01
	STY	$86
	LDY	$00
	STY	$85
	LDA	#$00
	STA	($08),Y
	JSR	L82B0
	LDY	$86
	LDX	$85
	JSR	L885D
	LDA	#$07
	JSR	L8336
	LDY	#$02
	LDA	#$50
	JSR	L7A92
	JSR	L87E1
	HEX	07450655054404540343025300
L6BF3	RTS

L6BF4	INC	$04
	CMP	$04
	BCC	L6BFD
L6BFA	STA	$04
	RTS

L6BFD	CPX	$04
	BCC	L6BFA
	RTS

L6C02	JSR	L6B85
	JSR	L83A7
	LDA	$52
	BEQ	L6C12
	LDA	$94
	BEQ	L6C12
	LSR	$9A
L6C12	RTS

L6C13	LDA	$02
	CMP	#$02
	BCC	L6C20
	BEQ	L6C25
	DEC	$02
	JMP	L6B9D

L6C20	INC	$02
	JMP	L6B9D
L6C25	RTS

L6C26	LDA	$03
	CMP	#$02
	BCC	L6C33
	BEQ	L6C38
	DEC	$03
	JMP	L6B9D

L6C33	INC	$03
	JMP	L6B9D
L6C38	RTS

L6C39	LDA	#$00
	STA	$9C
	LDY	$01
	INY
	STX	$85
	STY	$86
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDA	#$00
	LDY	$85
	STA	($06),Y
	JSR	L82AA
	LDA	#$00
	JSR	L82B0
	DEC	$86
	LDA	#$00
	JSR	L82AA
	INC	$86
	LDX	#$FF
L6C67	INX
	CPX	#$1E
	BEQ	L6C81
	LDA	L0CE0,X
	BNE	L6C67
	LDA	$86
	STA	L0CC0,X
	LDA	$85
	STA	L0CA0,X
	LDA	#$B4
	STA	L0CE0,X
	SEC
L6C81	RTS

L6C82	LDX	$8D
	BEQ	L6CA6
	INC	$64
	LDY	$64
	CPY	#$03
	BCC	L6C92
	LDY	#$00
	STY	$64
L6C92	LDA	|$0060,Y
	STA	$63
L6C97	LSR	$63
	BCC	L6CA2
	JSR	L6CDB
	LDA	$9A
	BEQ	L6CA6
L6CA2	LDA	$63
	BNE	L6C97
L6CA6	RTS

L6CA7	HEX	000000
	HEX	000101
	HEX	010101
	HEX	010301
	HEX	010303
	HEX	030303
	HEX	030307
	HEX	030707
	HEX	070707
	HEX	07070F
	HEX	070F0F
	HEX	0F0F0F
L6CCB	HEX	082B2C3031323628292A2D2E2F353334
L6CDB	INC	$19
	LDX	$8D
	CPX	$19
	BCS	L6CE7
	LDX	#$01
	STX	$19
L6CE7	JSR	L75CE
	LDA	$16
	BMI	L6D08
	BEQ	L6D08
	DEC	$16
	LDY	$16
	CPY	#$0D
	BCS	L6CFB
	JMP	L6E65

L6CFB	LDX	$19
	LDA	L0C98,X
	BEQ	L6D05
	JMP	L75A8
L6D05	JMP	L6DB7

L6D08	LDY	$13
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$12
	LDA	($08),Y
	CMP	#$03
	BEQ	L6D61
	CMP	#$04
	BNE	L6D26
	LDA	$18
	CMP	#$02
	BEQ	L6D61
L6D26	LDA	$18
	CMP	#$02
	BCC	L6D64
	LDY	$13
	CPY	#$0F
	BEQ	L6D61
	LDA	L1C05+1,Y
	STA	$06
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDA	L1C15+1,Y
	STA	$07
	LDY	$12
	LDA	($06),Y
	CMP	#$00
	BEQ	L6D64
	CMP	#$09
	BEQ	L6D64
	CMP	#$08
	BEQ	L6D61
	LDA	($08),Y
	CMP	#$01
	BEQ	L6D61
	CMP	#$02
	BEQ	L6D61
	CMP	#$03
	BNE	L6D64
L6D61	JMP	L6E85

L6D64	JSR	L74DF
	JSR	L8336
	JSR	L7582
	LDA	#$06
	LDY	$15
	BMI	L6D75
	LDA	#$0D
L6D75	STA	$14
	INC	$18
	LDA	$18
	CMP	#$05
	BCS	L6DC0
	LDA	$18
	CMP	#$02
	BNE	L6DB7
	JSR	L74F7
	LDY	$13
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$12
	LDA	($08),Y
	CMP	#$01
	BNE	L6DB7
	LDA	$16
	BPL	L6DA2
	DEC	$93
L6DA2	LDA	$5F
	STA	$16
	LDY	#$00
	LDA	#$75
	JSR	L7A92
	JSR	L87E1
	HEX	06200430024000
L6DB7	JSR	L74DF
	JSR	L83A7
	JMP	L75A8

L6DC0	LDA	#$00
	STA	$18
	LDY	$13
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDY	$12
	LDA	($08),Y
	CMP	#$01
	BNE	L6DE1
	LDA	#$00
L6DE1	STA	($06),Y
	INC	$13
	LDY	$13
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDY	$12
	LDA	($06),Y
	CMP	#$09
	BNE	L6E02
	LSR	$9A
L6E02	LDA	($08),Y
	CMP	#$01
	BNE	L6E58
	LDA	$16
	BPL	L6E58
	LDY	$13
	DEY
	STY	$86
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDY	$12
	STY	$85
	LDA	($08),Y
	CMP	#$00
	BEQ	L6E31
	DEC	$93
	JMP	L6E46

L6E31	LDA	#$07
	STA	($06),Y
	STA	($08),Y
	JSR	L82B0
	LDY	$86
	LDX	$85
	JSR	L885D
	LDA	#$07
	JSR	L83A7
L6E46	LDY	$13
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDA	#$00
	STA	$16
	LDY	$12
L6E58	LDA	#$08
	STA	($06),Y
	JSR	L74DF
	JSR	L83A7
	JMP	L75A8

L6E65	CPY	#$07
	BCC	L6E85
	JSR	L74DF
	JSR	L8336
	LDY	$16
	LDA	L6E76+2,Y
	STA	$17
L6E76	JSR	L74DF
	JSR	L83A7
	JMP	L75A8

L6E7F	HEX	020102030201
L6E85	LDX	$12
	LDY	$13
	JSR	L70D8
	ASL
	TAY
	LDA	L6E97+1,Y
	PHA
	LDA	L6E97,Y
	PHA
	RTS

L6E97	DA	L75A8-1
	DA	L6FBC-1
	DA	L7047-1
	DA	L6EAC-1
	DA	L6F39-1

L6EA1	LDA	$16
	BEQ	L6EA9
	BMI	L6EA9
	INC	$16
L6EA9	JMP	L75A8

L6EAC	LDY	$18
	CPY	#$03
	BCS	L6ED5
	LDY	$13
	BEQ	L6EA1
	DEY
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$12
	LDA	($06),Y
	CMP	#$01
	BEQ	L6EA1
	CMP	#$02
	BEQ	L6EA1
	CMP	#$05
	BEQ	L6EA1
	CMP	#$08
	BEQ	L6EA1
L6ED5	JSR	L74DF
	JSR	L8336
	JSR	L7582
	LDY	$13
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	DEC	$18
	BPL	L6F26
	JSR	L753E
	LDY	$12
	LDA	($08),Y
	CMP	#$01
	BNE	L6F02
	LDA	#$00
L6F02	STA	($06),Y
	DEC	$13
	LDY	$13
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$12
	LDA	($06),Y
	CMP	#$09
	BNE	L6F1C
	LSR	$9A
L6F1C	LDA	#$08
	STA	($06),Y
	LDA	#$04
	STA	$18
	BNE	L6F29
L6F26	JSR	L74F7
L6F29	LDA	#$0E
	LDX	#$0F
	JSR	L7574
	JSR	L74DF
	JSR	L83A7
	JMP	L75A8

L6F39	LDY	$18
	CPY	#$02
	BCC	L6F63
	LDY	$13
	CPY	#$0F
	BCS	L6F60
	INY
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$12
	LDA	($06),Y
	CMP	#$02
	BEQ	L6F60
	CMP	#$08
	BEQ	L6F60
	CMP	#$01
	BNE	L6F63
L6F60	JMP	L75A8

L6F63	JSR	L74DF
	JSR	L8336
	JSR	L7582
	LDY	$13
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	INC	$18
	LDA	$18
	CMP	#$05
	BCC	L6FB9
	JSR	L753E
	LDY	$12
	LDA	($08),Y
	CMP	#$01
	BNE	L6F94
	LDA	#$00
L6F94	STA	($06),Y
	INC	$13
	LDY	$13
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$12
	LDA	($06),Y
	CMP	#$09
	BNE	L6FAE
	LSR	$9A
L6FAE	LDA	#$08
	STA	($06),Y
	LDA	#$00
	STA	$18
	JMP	L6F29
L6FB9	JMP	L6F26

L6FBC	LDY	$13
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDX	$17
	CPX	#$03
	BCS	L6FF1
	LDY	$12
	BEQ	L6FEE
	DEY
	LDA	($06),Y
	CMP	#$08
	BEQ	L6FEE
	CMP	#$02
	BEQ	L6FEE
	CMP	#$01
	BEQ	L6FEE
	LDA	($08),Y
	CMP	#$05
	BNE	L6FF1
L6FEE	JMP	L75A8

L6FF1	JSR	L74DF
	JSR	L8336
	JSR	L7595
	LDA	#$FF
	STA	$15
	DEC	$17
	BPL	L7026
	JSR	L753E
	LDY	$12
	LDA	($08),Y
	CMP	#$01
	BNE	L700F
	LDA	#$00
L700F	STA	($06),Y
	DEC	$12
	DEY
	LDA	($06),Y
	CMP	#$09
	BNE	L701C
	LSR	$9A
L701C	LDA	#$08
	STA	($06),Y
	LDA	#$04
	STA	$17
	BNE	L7029
L7026	JSR	L74F7
L7029	LDY	$12
	LDA	($08),Y
	CMP	#$04
	BEQ	L7037
	LDA	#$00
	LDX	#$02
	BNE	L703B
L7037	LDA	#$03
	LDX	#$05
L703B	JSR	L7574
	JSR	L74DF
	JSR	L83A7
	JMP	L75A8

L7047	LDY	$13
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDX	$17
	CPX	#$02
	BCC	L707E
	LDY	$12
	CPY	#$1B
	BEQ	L707B
	INY
	LDA	($06),Y
	CMP	#$08
	BEQ	L707B
	CMP	#$02
	BEQ	L707B
	CMP	#$01
	BEQ	L707B
	LDA	($08),Y
	CMP	#$05
	BNE	L707E
L707B	JMP	L75A8

L707E	JSR	L74DF
	JSR	L8336
	JSR	L7595
	LDA	#$01
	STA	$15
	INC	$17
	LDA	$17
	CMP	#$05
	BCC	L70B7
	JSR	L753E
	LDY	$12
	LDA	($08),Y
	CMP	#$01
	BNE	L70A0
	LDA	#$00
L70A0	STA	($06),Y
	INC	$12
	INY
	LDA	($06),Y
	CMP	#$09
	BNE	L70AD
	LSR	$9A
L70AD	LDA	#$08
	STA	($06),Y
	LDA	#$00
	STA	$17
	BEQ	L70BA
L70B7	JSR	L74F7
L70BA	LDY	$12
	LDA	($08),Y
	CMP	#$04
	BEQ	L70C8
	LDA	#$07
	LDX	#$09
	BNE	L70CC
L70C8	LDA	#$0A
	LDX	#$0C
L70CC	JSR	L7574
	JSR	L74DF
	JSR	L83A7
	JMP	L75A8

L70D8	STX	$55
	STY	$56
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$55
	LDA	($08),Y
	CMP	#$01
	BNE	L70F7
	LDA	$16
	BEQ	L70F7
	BMI	L70F7
	LDA	#$03
	RTS

L70F7	LDY	$56
	CPY	$01
	BEQ	L7100
	JMP	L7186

L7100	LDY	$55
	STY	$57
	CPY	$00
	BCS	L7147
L7108	INC	$57
	LDY	$56
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$57
	LDA	($08),Y
	CMP	#$03
	BEQ	L713E
	CMP	#$04
	BEQ	L713E
	LDY	$56
	CPY	#$0F
	BEQ	L713E
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$57
	LDA	($08),Y
	CMP	#$00
	BEQ	L7186
	CMP	#$05
	BEQ	L7186
L713E	LDY	$57
	CPY	$00
	BNE	L7108
	LDA	#$02
	RTS

L7147	DEC	$57
	LDY	$56
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$57
	LDA	($08),Y
	CMP	#$03
	BEQ	L717D
	CMP	#$04
	BEQ	L717D
	LDY	$56
	CPY	#$0F
	BEQ	L717D
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$57
	LDA	($08),Y
	CMP	#$00
	BEQ	L7186
	CMP	#$05
	BEQ	L7186
L717D	LDY	$57
	CPY	$00
	BNE	L7147
	LDA	#$01
	RTS

L7186	LDA	#$00
	STA	$58
	LDA	#$FF
	STA	$59
	LDX	$55
	LDY	$56
	JSR	L743E
	JSR	L7275
	JSR	L71A2
	JSR	L720C
	LDA	$58
	RTS
L71A1	RTS

L71A2	LDY	$5A
	CPY	$55
	BEQ	L71A1
	LDY	$56
	CPY	#$0F
	BEQ	L71DA
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$5A
	LDA	($08),Y
	CMP	#$01
	BEQ	L71DA
	CMP	#$02
	BEQ	L71DA
	LDX	$5A
	LDY	$56
	JSR	L739D
	LDX	$5A
	JSR	L72D4
	CMP	$59
	BCS	L71DA
	STA	$59
	LDA	#$01
	STA	$58
L71DA	LDY	$56
	BEQ	L7206
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$5A
	LDA	($08),Y
	CMP	#$03
	BNE	L7206
	LDY	$56
	LDX	$5A
	JSR	L7300
	LDX	$5A
	JSR	L72D4
	CMP	$59
	BCS	L7206
	STA	$59
	LDA	#$01
	STA	$58
L7206	INC	$5A
	JMP	L71A2
L720B	RTS

L720C	LDY	$5B
	CPY	$55
	BEQ	L720B
	LDY	$56
	CPY	#$0F
	BEQ	L7244
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$5B
	LDA	($08),Y
	CMP	#$01
	BEQ	L7244
	CMP	#$02
	BEQ	L7244
	LDX	$5B
	LDY	$56
	JSR	L739D
	LDX	$5B
	JSR	L72D4
	CMP	$59
	BCS	L7244
	STA	$59
	LDA	#$02
	STA	$58
L7244	LDY	$56
	BEQ	L7270
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$5B
	LDA	($08),Y
	CMP	#$03
	BNE	L7270
	LDY	$56
	LDX	$5B
	JSR	L7300
	LDX	$5B
	JSR	L72D4
	CMP	$59
	BCS	L7270
	STA	$59
	LDA	#$02
	STA	$58
L7270	DEC	$5B
	JMP	L720C

L7275	LDY	$56
	CPY	#$0F
	BEQ	L72A7
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$55
	LDA	($08),Y
	CMP	#$01
	BEQ	L72A7
	CMP	#$02
	BEQ	L72A7
	LDX	$55
	LDY	$56
	JSR	L739D
	LDX	$55
	JSR	L72D4
	CMP	$59
	BCS	L72A7
	STA	$59
	LDA	#$04
	STA	$58
L72A7	LDY	$56
	BEQ	L72D3
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$55
	LDA	($08),Y
	CMP	#$03
	BNE	L72D3
	LDX	$55
	LDY	$56
	JSR	L7300
	LDX	$55
	JSR	L72D4
	CMP	$59
	BCS	L72D3
	STA	$59
	LDA	#$03
	STA	$58
L72D3	RTS

L72D4	STA	$1A
	CMP	$01
	BNE	L72EB
	CPX	$12
	BCC	L72E3
	TXA
	SEC
	SBC	$12
	RTS

L72E3	STX	$1A
	LDA	$12
	SEC
	SBC	$1A
	RTS

L72EB	BCC	L72F4
	SEC
	SBC	$01
	CLC
	ADC	#$C8
	RTS

L72F4	LDA	$01
	SEC
	SBC	$1A
	CLC
	ADC	#$64
	RTS

L72FD	LDA	$5E
	RTS

L7300	STY	$5E
	STX	$5D
L7304	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$5D
	LDA	($08),Y
	CMP	#$03
	BNE	L72FD
	DEC	$5E
	LDY	$5D
	BEQ	L734A
	DEY
	LDA	($08),Y
	CMP	#$01
	BEQ	L7340
	CMP	#$02
	BEQ	L7340
	CMP	#$03
	BEQ	L7340
	LDY	$5E
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$5D
	DEY
	LDA	($08),Y
	CMP	#$04
	BNE	L734A
L7340	LDY	$5E
	STY	$5C
	CPY	$01
	BCC	L7397
	BEQ	L7397
L734A	LDY	$5D
	CPY	#$1B
	BEQ	L738C
	LDY	$5E
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$5D
	INY
	LDA	($08),Y
	CMP	#$01
	BEQ	L7382
	CMP	#$02
	BEQ	L7382
	CMP	#$03
	BEQ	L7382
	LDY	$5E
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$5D
	INY
	LDA	($08),Y
	CMP	#$04
	BNE	L738C
L7382	LDY	$5E
	STY	$5C
	CPY	$01
	BCC	L7397
	BEQ	L7397
L738C	LDY	$5E
	CPY	#$01
	BCC	L7395
	JMP	L7304

L7395	TYA
	RTS

L7397	LDA	$5C
	RTS

L739A	LDA	$5E
	RTS

L739D	STY	$5E
	STX	$5D
L73A1	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$5D
	LDA	($08),Y
	CMP	#$01
	BEQ	L739A
	CMP	#$02
	BEQ	L739A
	LDY	$5E
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$5D
	LDA	($08),Y
	CMP	#$00
	BEQ	L742D
	CPY	#$00
	BEQ	L73FB
	DEY
	LDA	($08),Y
	CMP	#$04
	BEQ	L73F3
	LDY	$5E
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$5D
	DEY
	LDA	($08),Y
	CMP	#$01
	BEQ	L73F3
	CMP	#$02
	BEQ	L73F3
	CMP	#$03
	BNE	L73FB
L73F3	LDY	$5E
	STY	$5C
	CPY	$01
	BCS	L743B
L73FB	LDY	$5D
	CPY	#$1B
	BCS	L742D
	INY
	LDA	($08),Y
	CMP	#$04
	BEQ	L7425
	LDY	$5E
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$5D
	INY
	LDA	($08),Y
	CMP	#$01
	BEQ	L7425
	CMP	#$03
	BEQ	L7425
	CMP	#$02
	BNE	L742D
L7425	LDY	$5E
	STY	$5C
	CPY	$01
	BCS	L743B
L742D	INC	$5E
	LDY	$5E
	CPY	#$10
	BCS	L7438
	JMP	L73A1

L7438	LDA	#$0F
	RTS

L743B	LDA	$5C
	RTS

L743E	STX	$5A
	STX	$5B
	STY	$1B
L7444	LDA	$5A
	BEQ	L7490
	LDY	$1B
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$5A
	DEY
	LDA	($06),Y
	CMP	#$01
	BEQ	L7490
	CMP	#$02
	BEQ	L7490
	CMP	#$03
	BEQ	L748A
	CMP	#$04
	BEQ	L748A
	LDY	$1B
	CPY	#$0F
	BEQ	L748A
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$5A
	DEY
	LDA	($08),Y
	CMP	#$01
	BEQ	L748A
	CMP	#$02
	BEQ	L748A
	CMP	#$03
	BNE	L748E
L748A	DEC	$5A
	BPL	L7444
L748E	DEC	$5A
L7490	LDA	$5B
	CMP	#$1B
	BEQ	L74DE
	LDY	$1B
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$5B
	INY
	LDA	($06),Y
	CMP	#$01
	BEQ	L74DE
	CMP	#$02
	BEQ	L74DE
	CMP	#$03
	BEQ	L74D8
	CMP	#$04
	BEQ	L74D8
	LDY	$1B
	CPY	#$0F
	BEQ	L74D8
	LDA	L1C05+1,Y
	STA	$08
	LDA	L1C25+1,Y
	STA	$09
	LDY	$5B
	INY
	LDA	($08),Y
	CMP	#$01
	BEQ	L74D8
	CMP	#$02
	BEQ	L74D8
	CMP	#$03
	BNE	L74DC
L74D8	INC	$5B
	BPL	L7490
L74DC	INC	$5B
L74DE	RTS

L74DF	LDX	$12
	LDY	$17
	JSR	L888F
	STX	$1E
	LDY	$13
	LDX	$18
	JSR	L887C
	LDX	$14
	LDA	L6CCB,X
	LDX	$1E
	RTS

L74F7	LDA	$17
	CMP	#$02
	BNE	L753D
	LDA	$18
	CMP	#$02
	BNE	L753D
	LDY	$13
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$12
	LDA	($08),Y
	CMP	#$07
	BNE	L753D
	LDA	$16
	BMI	L753D
	LDA	#$FF
	SEC
	SBC	$53
	STA	$16
	LDA	#$00
	STA	($08),Y
	LDY	$13
	STY	$86
	LDY	$12
	STY	$85
	JSR	L82B0
	LDY	$86
	LDX	$85
	JSR	L885D
	LDA	#$07
	JMP	L8336
L753D	RTS

L753E	LDA	$16
	BPL	L7573
	INC	$16
	BNE	L7573
	LDY	$13
	STY	$86
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$12
	STY	$85
	LDA	($08),Y
	CMP	#$00
	BNE	L7571
	LDA	#$07
	STA	($08),Y
	JSR	L82B0
	LDY	$86
	LDX	$85
	JSR	L885D
	LDA	#$07
	JMP	L83A7

L7571	DEC	$16
L7573	RTS

L7574	INC	$14
	CMP	$14
	BCC	L757D
L757A	STA	$14
	RTS

L757D	CPX	$14
	BCC	L757A
	RTS

L7582	LDA	$17
	CMP	#$02
	BCC	L758F
	BEQ	L7594
	DEC	$17
	JMP	L74F7

L758F	INC	$17
	JMP	L74F7
L7594	RTS

L7595	LDA	$18
	CMP	#$02
	BCC	L75A2
	BEQ	L75A7
	DEC	$18
	JMP	L74F7

L75A2	INC	$18
	JMP	L74F7
L75A7	RTS

L75A8	LDX	$19
	LDA	$12
	STA	L0C60,X
	LDA	$13
	STA	L0C68,X
	LDA	$17
	STA	L0C78,X
	LDA	$18
	STA	L0C80,X
	LDA	$16
	STA	L0C70,X
	LDA	$15
	STA	L0C90,X
	LDA	$14
	STA	L0C88,X
	RTS

L75CE	LDX	$19
	LDA	L0C60,X
	STA	$12
	LDA	L0C68,X
	STA	$13
	LDA	L0C78,X
	STA	$17
	LDA	L0C80,X
	STA	$18
	LDA	L0C88,X
	STA	$14
	LDA	L0C90,X
	STA	$15
	LDA	L0C70,X
	STA	$16
	RTS

L75F4	JSR	L7716
	INC	$53
	LDA	$53
	CMP	#$1C
	BCC	L7603
	LDA	#$00
	STA	$53
L7603	LDX	#$1E
L7605	LDA	L0CE0,X
	STX	$88
	BNE	L760F
	JMP	L770D

L760F	DEC	L0CE0,X
	BEQ	L7641
	LDA	L0CA0,X
	STA	$85
	LDA	L0CC0,X
	STA	$86
	LDA	L0CE0,X
	CMP	#$14
	BNE	L7639
	LDA	#$37
L7627	JSR	L82B0
	LDX	$85
	LDY	$86
	JSR	L885D
	LDA	#$00
	JSR	L8336
L7636	JMP	L770D

L7639	CMP	#$0A
	BNE	L7636
	LDA	#$38
	BNE	L7627
L7641	LDX	$88
	LDY	L0CC0,X
	STY	$86
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDY	L0CA0,X
	STY	$85
	LDA	($06),Y
	CMP	#$00
	BNE	L7667
	JMP	L7701

L7667	CMP	#$09
	BNE	L766D
	LSR	$9A
L766D	CMP	#$08
	BEQ	L767A
	CMP	#$07
	BNE	L7677
	DEC	$93
L7677	JMP	L7701

L767A	LDA	#$01
	STA	($06),Y
	STA	($08),Y
	JSR	L82AA
	LDA	#$01
	JSR	L82B0
	LDX	$8D
L768A	LDA	L0C60,X
	CMP	$85
	BNE	L76FE
	LDA	L0C68,X
	CMP	$86
	BNE	L76FE
	LDA	L0C70,X
	BPL	L769F
	DEC	$93
L769F	LDA	#$7F
	STA	L0C70,X
	STX	$19
	JSR	L75CE
	JSR	L74DF
	JSR	L8336
	LDX	$19
	LDY	#$01
	STY	$86
L76B5	LDY	$86
	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	$53
L76C3	LDA	($08),Y
	CMP	#$00
	BEQ	L76D9
	INC	$53
	LDY	$53
	CPY	#$1C
	BCC	L76C3
	INC	$86
	LDA	#$00
	STA	$53
	BEQ	L76B5
L76D9	TYA
	STA	L0C60,X
	LDA	$86
	STA	L0C68,X
	LDA	#$14
	STA	L0C98,X
	LDA	#$02
	STA	L0C80,X
	STA	L0C78,X
	LDA	#$00
	STA	L0C88,X
	LDY	#$00
	LDA	#$75
	JSR	L7A92
	JMP	L770D

L76FE	DEX
	BNE	L768A
L7701	LDA	#$01
	STA	($06),Y
	JSR	L82AA
	LDA	#$01
	JSR	L82B0
L770D	LDX	$88
	DEX
	BMI	L7715
	JMP	L7605
L7715	RTS

L7716	LDX	$8D
	BEQ	L7715
	LDA	$19
	PHA
L771D	LDA	L0C98,X
	BEQ	L7765
	STX	$19
	JSR	L75CE
	LDA	#$7F
	STA	L0C70,X
	LDA	L0C60,X
	STA	$85
	LDA	L0C68,X
	STA	$86
	DEC	L0C98,X
	BEQ	L776C
	LDA	L0C98,X
	CMP	#$13
	BNE	L7752
	LDA	#$39
	JSR	L82B0
	JSR	L74DF
	LDA	#$39
	JSR	L83A7
	JMP	L7763

L7752	CMP	#$0A
	BNE	L7765
	LDA	#$3A
	JSR	L82B0
	JSR	L74DF
	LDA	#$3A
	JSR	L83A7
L7763	LDX	$19
L7765	DEX
	BNE	L771D
	PLA
	STA	$19
	RTS

L776C	LDY	$86
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDX	$19
	INC	L0C98,X
	LDY	$85
	LDA	($06),Y
	BNE	L7765
	LDA	#$08
	STA	($06),Y
	LDA	#$00
	JSR	L82B0
	LDA	#$00
	LDX	$19
	STA	L0C70,X
	STA	L0C98,X
	LDA	#$08
	JSR	L82AA
	JSR	L87E1
	HEX	027C03780474057000
	LDX	$19
	JMP	L7765

L77AC	JSR	L786B
	LDX	#$FF
	LDY	#$FF
	LDA	#$04
	STA	$A1
L77B7	LDA	$95
	CMP	#"K"
	BEQ	L77C7
	LDA	BUTN1
	BMI	L77D6
	LDA	BUTN0
	BMI	L77D6
L77C7	LDA	KBD
	BMI	L77D6
	DEX
	BNE	L77B7
	DEY
	BNE	L77B7
	DEC	$A1
	BNE	L77B7
L77D6	STA	KBDSTROBE
	STA	TXTPAGE1
	JSR	L7A57
	LDY	#$0F
	STY	$86
L77E3	LDA	L1C05,Y
	STA	$08
	LDA	L1C25,Y
	STA	$09
	LDY	#$1B
	STY	$85
L77F1	LDA	($08),Y
	CMP	#$05
	BNE	L77F9
	LDA	#$01
L77F9	JSR	L82B0
	DEC	$85
	LDY	$85
	BPL	L77F1
	DEC	$86
	LDY	$86
	BPL	L77E3
	LDX	#$1E
L780A	STX	$88
	LDA	L0CE0,X
	BEQ	L7838
	LDY	L0CC0,X
	STY	$86
	LDY	L0CA0,X
	STY	$85
	CMP	#$15
	BCC	L7827
	LDA	#$00
	JSR	L82B0
	JMP	L7838

L7827	CMP	#$0B
	BCC	L7833
	LDA	#$37
	JSR	L82B0
	JMP	L7838

L7833	LDA	#$38
	JSR	L82B0
L7838	LDX	$88
	DEX
	BPL	L780A
	LDX	$8D
	BEQ	L7868
L7841	LDA	L0C98,X
	STX	$88
	BEQ	L7863
	LDY	L0C60,X
	STY	$85
	LDY	L0C68,X
	STY	$86
	CMP	#$14
	BCS	L7863
	CMP	#$0B
	BCC	L785E
	LDA	#$39
	BNE	L7860
L785E	LDA	#$3A
L7860	JSR	L82B0
L7863	LDX	$88
	DEX
	BNE	L7841
L7868	JMP	L6A12

L786B	JSR	L7A57
	LDA	#$40
	STA	$87
	LDA	#$00
	STA	$85
	STA	$86
	JSR	L86E0
	ASC	"    LODE RUNNER HIGH SCORES"8D8D8D
	ASC	"    INITIALS LEVEL  SCORE"8D
	ASC	"    -------- ----- --------"8D00
	LDA	#$01
	STA	$55
L78D4	CMP	#$0A
	BNE	L78E5
	LDA	#$01
	JSR	L7B15
	LDA	#$00
	JSR	L7B15
	JMP	L78EF

L78E5	LDA	#$A0
	JSR	L7B64
	LDA	$55
	JSR	L7B15
L78EF	JSR	L86E0
	ASC	".    "00
	LDX	$55
	LDY	L79A2,X
	STY	$56
	LDA	L1F03,Y
	BNE	L7907
	JMP	L798C

L7907	LDY	$56
	LDA	L1F00,Y
	JSR	L7B64
	LDY	$56
	LDA	L1F01,Y
	JSR	L7B64
	LDY	$56
	LDA	L1F02,Y
	JSR	L7B64
	JSR	L86E0
	ASC	"    "00
	LDY	$56
	LDA	L1F03,Y
	JSR	L7AF8
	LDA	$89
	JSR	L7B15
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JSR	L7B15
	JSR	L86E0
	ASC	"  "00
	LDY	$56
	LDA	L1F04,Y
	JSR	L7AE9
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JSR	L7B15
	LDY	$56
	LDA	L1F05,Y
	JSR	L7AE9
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JSR	L7B15
	LDY	$56
	LDA	L1F06,Y
	JSR	L7AE9
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JSR	L7B15
	LDY	$56
	LDA	L1F07,Y
	JSR	L7AE9
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JSR	L7B15
L798C	JSR	L7B7D
	INC	$55
	LDA	$55
	CMP	#$0B
	BCS	L799A
	JMP	L78D4

L799A	STA	TXTPAGE2
	LDA	#$20
	STA	$87
	RTS

L79A2	HEX	0000081018202830384048	;	LOGO	POINTER

L79AD	JSR	L7A51
	JSR	L7A57

*-------------------------------
* DRAW GAME FRAME
*-------------------------------

L79B3	LDY	#$27
	LDA	$87
	CMP	#$40
	BEQ	L79DD
L79BB	LDA	#$AA
	STA	$2350,Y
	STA	$2750,Y
	STA	$2B50,Y
	STA	$2F50,Y
	DEY
	LDA	#$D5
	STA	$2350,Y
	STA	$2750,Y
	STA	$2B50,Y
	STA	$2F50,Y
	DEY
	BPL	L79BB
	BMI	L79FD
L79DD	LDA	#$AA
	STA	$4350,Y
	STA	$4750,Y
	STA	$4B50,Y
	STA	$4F50,Y
	DEY
	LDA	#$D5
	STA	$4350,Y
	STA	$4750,Y
	STA	$4B50,Y
	STA	$4F50,Y
	DEY
	BPL	L79DD
L79FD	LDA	#$10
	STA	$86
	LDA	#$00
	STA	$85
	JSR	L86E0
	ASC	"SCORE        MEN    LEVEL   "00
	JSR	L7A70
	JSR	L7A8C
	LDA	#$00
	TAY
	JMP	L7A92

L7A31	LDA	L1A85,Y
	STA	$0C
	LDA	L1B45,Y
	ORA	$1F
	STA	$0C+1
	RTS

L7A3E	LDA	L1A85,Y
	STA	$0C
	STA	$0E
	LDA	L1B45,Y
	ORA	#$20
	STA	$0C+1
	EOR	#$60
	STA	$0E+1
	RTS

*-------------------------------
* CLEAR HGR1 
*-------------------------------

L7A51	LDA	#$20
	LDX	#$40
	BNE	L7A5B

*-------------------------------
* CLEAR HGR2
*-------------------------------

L7A57	LDA	#$40
	LDX	#$60

L7A5B	STA	$0A+1
	LDA	#$00
	STA	$0A
	TAY
	LDA	#$80
L7A64	STA	($0A),Y
	INY
	BNE	L7A64
	INC	$0A+1
	CPX	$0A+1
	BNE	L7A64
	RTS

L7A70	LDA	$98	; print number of men
	LDX	#$10
L7A74	STX	$85
	JSR	L7AF8
	LDA	#$10	; print three values (0-255)
	STA	$86
	LDA	$89
	JSR	L7B15
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JMP	L7B15

L7A8C	LDA	$A6	; print level
	LDX	#$19
	BNE	L7A74

L7A92	CLC
	SED
	ADC	$8E
	STA	$8E
	TYA
	ADC	$8F
	STA	$8F
	LDA	#$00
	ADC	$90
	STA	$90
	LDA	#$00
	ADC	$91
	STA	$91
	CLD
	LDA	#$05
	STA	$85
	LDA	#$10
	STA	$86
	LDA	$91
	JSR	L7AE9
	LDA	$8B
	JSR	L7B15
	LDA	$90
	JSR	L7AE9
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JSR	L7B15
	LDA	$8F
	JSR	L7AE9
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JSR	L7B15
	LDA	$8E
	JSR	L7AE9
	LDA	$8A
	JSR	L7B15
	LDA	$8B
	JMP	L7B15

L7AE9	STA	$8A
	AND	#$0F
	STA	$8B
	LDA	$8A
	LSR
	LSR
	LSR
	LSR
	STA	$8A
	RTS

L7AF8	LDX	#$00
	STX	$8A
	STX	$89
L7AFE	CMP	#100
	BCC	L7B08
	INC	$89
	SBC	#100
	BNE	L7AFE
L7B08	CMP	#10
	BCC	L7B12
	INC	$8A
	SBC	#10
	BNE	L7B08
L7B12	STA	$8B
	RTS

L7B15	CLC		; print a char
	ADC	#$3B
	LDX	$87
	CPX	#$40
	BEQ	L7B24
	JSR	L82AA	; print HGR1
	INC	$85
	RTS

L7B24	JSR	L82B0	; print HGR2
	INC	$85
	RTS

L7B2A	CMP	#"A"
	BCC	L7B32
	CMP	#"Z"+1
	BCC	L7B60
L7B32	LDX	#$7C
	CMP	#" "
	BEQ	L7B5F
	LDX	#$DB
	CMP	#">"	; DB
	BEQ	L7B5F
	INX
	CMP	#"."	; DC
	BEQ	L7B5F
	INX
	CMP	#"("	; DE
	BEQ	L7B5F
	INX
	CMP	#")"	; DF
	BEQ	L7B5F
	INX
	CMP	#"/"	; E0
	BEQ	L7B5F
	INX
	CMP	#"-"	; E1
	BEQ	L7B5F
	INX
	CMP	#">"	; E2
	BEQ	L7B5F
	LDA	#$10
	RTS

L7B5F	TXA		; calculate offset
L7B60	SEC
	SBC	#$7C
	RTS

L7B64	CMP	#$8D
	BEQ	L7B7D
	JSR	L7B2A
	LDX	$87
	CPX	#$40
	BEQ	L7B77
	JSR	L82AA
	INC	$85
	RTS

L7B77	JSR	L82B0
	INC	$85
	RTS

L7B7D	INC	$86
	LDA	#$00
	STA	$85
	RTS

*-------------------------------
* CTRL-E - LEVEL EDITOR
*-------------------------------

L7B84	LDA	#$00
	STA	$8E
	STA	$8F
	STA	$90
	STA	$91
	LDA	$36
	STA	$24
	LDA	$37
	STA	$25
	LDA	#$05
	STA	$98
	STA	$A7
	LDA	$95	; save interface mode
	STA	L7C76+1
	LDA	#"K"	; force keyboard in editor
	STA	$95
	STA	TXTPAGE1
	LDA	$96	; check level
	CMP	#maxLEVEL
	BCC	L7BB2
	LDA	#$00	; start at 0 if > 149
	STA	$96

L7BB2	JSR	L7A51	; clear HGR1
	LDA	#$20
	STA	$87
	LDA	#$00
	STA	$85
	STA	$86
	JSR	L86E0
	ASC	"  LODE RUNNER BOARD EDITOR"8D
	ASC	"----------------------------"8D
	ASC	"  <ESC> ABORTS ANY COMMAND"8D00

L7C16	LDA	$86	; are we at the
	CMP	#$09	; end of the screen?
	BCS	L7BB2	; yes, bottom line

	JSR	L86E0	; no, show command
	ASC	8D
	ASC	"COMMAND>"00

	JSR	L823D	; wait for key
	LDX	#$00
L7C2E	LDY	L7C4D,X	; authorized key?
	BEQ	L7C3B
	CMP	L7C4D,X
	BEQ	L7C41
	INX
	BNE	L7C2E
L7C3B	JSR	L86CE	; beep
	JMP	L7C16	; loop

L7C41	TXA		; yes, we know the key
	ASL		; jump to the feature
	TAX		; and handle it
	LDA	L7C54+1,X
	PHA
	LDA	L7C54,X
	PHA
	RTS

L7C4D	ASC	"PCEMIS"00

L7C54	DA	L7C60-1	; Play level
	DA	L7C8E-1	; Clear level
	DA	L7CBC-1	; Edit level
	DA	L7CD8-1	; Move level
	DA	L7D5D-1	; Initialize
	DA	L7E75-1	; Clear Score file

*-------------------------------
* P - PLAY LEVEL 
*-------------------------------

L7C60	JSR	L86E0
	ASC	8D
	ASC	">>PLAY LEVEL"00
	JSR	L817B
	BCS	L7C8B
L7C76	LDA	#$00
	STA	$95
	LDA	#$03
	STA	$A7
	LDA	#$01
	STA	$9D
	LDA	$96
	BEQ	L7C88
	LSR	$9D
L7C88	JMP	L6056
L7C8B	JMP	L7C3B

*-------------------------------
* C - CLEAR LEVEL 
*-------------------------------

L7C8E	JSR	L86E0
	ASC	8D
	ASC	">>CLEAR LEVEL"00
	JSR	L817B
	BCS	L7CB9
	JSR	L807F
	LDY	#$00
	TYA
L7CAB	STA	L0D00,Y
	INY
	BNE	L7CAB
	LDA	#$02
	JSR	L630E
	JMP	L7C16
L7CB9	JMP	L7C3B

*-------------------------------
* E - EDIT LEVEL 
*-------------------------------

L7CBC	JSR	L86E0
	ASC	8D
	ASC	">>EDIT LEVEL"00
	JSR	L817B	; is level valid?
	BCS	L7CD5	; no
	JMP	L7F01	; yes, handle edit
L7CD5	JMP	L7C3B

*-------------------------------
* M - MOVE LEVEL 
*-------------------------------

L7CD8	JSR	L86E0
	ASC	8D
	ASC	">>MOVE LEVEL"00
	JSR	L817B
	BCS	L7D5A
	STY	L824F
	JSR	L86E0
	ASC	" TO LEVEL"00
	JSR	L817B
	BCS	L7D5A
	STY	L8250
	JSR	L86E0
	ASC	8D
	ASC	"  SOURCE DISKETTE"00
	JSR	L823D
	JSR	L807F
	LDA	L824F
	STA	$96
	LDA	#$01
	JSR	L630E
	JSR	L86E0
	ASC	8D
	ASC	"  DESTINATION DISKETTE"00
	JSR	L823D
	JSR	L807F
	LDA	L8250
	STA	$96
	LDA	#$02
	JSR	L630E
	JMP	L7C16
L7D5A	JMP	L7C3B

*-------------------------------
* I - INITIALIZE DISKETTE
*-------------------------------

L7D5D	JSR	L86E0
	ASC	8D
	ASC	">>INITIALIZE"8D
	ASC	"  THIS FORMATS THE DISKETTE"8D
	ASC	"  FOR USER CREATED LEVELS."8D
	ASC	"  (CAUTION. IT ERASES THE"8D
	ASC	"   ENTIRE DISKETTE FIRST)"8D8D
	ASC	"  ARE YOU SURE (Y/N) "00
	JSR	L823D
	CMP	#"Y"
	BNE	L7E72
	NOP		; NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	LDA	$96
	PHA
	LDA	#$04	; Init command
	JSR	L630E

	LDA	#<L1DB2	; Save T0/S0
	STA	LB7F0
	LDA	#>L1DB2
	STA	LB7F0+1
	LDA	#$00
	STA	LB7ED
	STA	LB7EC
	LDA	#$02
	STA	LB7F4
	JSR	L6338
	LDA	#$E0
	STA	$96
	LDA	#$01
	JSR	L630E
	LDY	#$37
L7E33	LDA	L8251,Y
	STA	L0D00,Y
	DEY
	BPL	L7E33
	LDA	#$02
	JSR	L630E
	LDA	#$EF
	STA	$96
	LDA	#$01
	JSR	L630E
	LDY	#$20
L7E4C	LDA	L8289,Y
	STA	L0D0B,Y
	DEY
	BPL	L7E4C
	LDA	#$02
	JSR	L630E
	LDA	#$01
	JSR	L6359
	LDY	#$0A
L7E61	LDA	L63A8,Y
	STA	$1FF4,Y
	DEY
	BPL	L7E61
	LDA	#$02
	JSR	L6359
	PLA
	STA	$96
L7E72	JMP	L7C16

*-------------------------------
* C - CLEAR SCORE FILE 
*-------------------------------

L7E75	JSR	L86E0
	ASC	8D
	ASC	">>CLEAR SCORE FILE"8D
	ASC	"  THIS CLEARS THE HIGH"8D
	ASC	"  SCORE FILE OF ALL"8D
	ASC	"  ENTRIES."8D8D
	ASC	"  ARE YOU SURE (Y/N) "00
	JSR	L823D
	CMP	#"Y"
	BNE	L7EFE
	LDA	#$01
	JSR	L6359
	CMP	#$00
	BNE	L7EEF
	JSR	L8106
	JMP	L7BB2

L7EEF	LDY	#$4F	; clear score file
	LDA	#$00
L7EF3	STA	L1F00,Y
	DEY
	BPL	L7EF3
	LDA	#$02
	JSR	L6359
L7EFE	JMP	L7C16

*-------------------------------
* EDIT THE LEVEL 
*-------------------------------

L7F01	JSR	L7A57	; clear HGR2
	LDA	#$40
	STA	$87
	JSR	L79B3	; show frame
	LDA	#$20
	STA	$87
	JSR	L807F	; check diskette (master or data disk)
	LDX	#$01
	STX	$AD
	DEX
	JSR	L6238
	BCC	L7F1F
	JMP	L7C3B

L7F1F	LDA	#$00	; cursor is at 0,0
	STA	$85
	STA	$86
L7F25	JSR	L814B	; wait for key
	CMP	#"9"+1
	BCS	L7F54	; no sprite
	CMP	#"0"	; means check commands
	BCC	L7F54
	AND	#$0F
	STA	$1E	; save key
	LDY	$86	; get Y
	LDA	L1C05,Y	; get line address
	STA	$06
	LDA	L1C15,Y
	STA	$06+1
	LDY	$85	; get X
	LDA	$1E	; get sprite
	EOR	($06),Y	; same as before?
	BEQ	L7F4A	; yes
	LSR	$AD	; no
L7F4A	LDA	$1E	; get sprite
	STA	($06),Y	; save it
	JSR	L82AA	; print sprite
	JMP	L7F25	; loop

L7F54	STA	$1E	; same key
	LDY	#$FF
L7F58	INY
	LDA	L8162,Y	; is that a command?
	BEQ	L7F6E
	CMP	$1E	; same as our key?
	BNE	L7F58
	TYA		; yes, jump
	ASL
	TAY
	LDA	L816B+1,Y
	PHA
	LDA	L816B,Y
	PHA
	RTS

L7F6E	JSR	L86CE	; beep
	JMP	L7F25	; loop

*-------------------------------
* I - MOVE CURSOR UP 
*-------------------------------

L7F74	LDA	$86
	BEQ	L7F6E
	DEC	$86
	BPL	L7F25

*-------------------------------
* J - MOVE CURSOR LEFT
*-------------------------------

L7F7C	LDA	$85
	BEQ	L7F6E
	DEC	$85
	BPL	L7F25

*-------------------------------
* K - MOVE CURSOR RIGHT
*-------------------------------

L7F84	LDA	$85
	CMP	#$1B
	BCS	L7F6E
	INC	$85
	BNE	L7F25

*-------------------------------
* M - MOVE CURSOR DOWN 
*-------------------------------

L7F8E	LDA	$86
	CMP	#$0F
	BCS	L7F6E
	INC	$86
	BNE	L7F25

L7F98	LDA	$86
	PHA
	LDA	$85
	PHA
	LDA	#$01
	JSR	L6359
	CMP	#$00
	BNE	L7FAD
	JSR	L8106
	JMP	L7FC5

L7FAD	CMP	#$01
	BNE	L7FB7
	JSR	L8098
	JMP	L7FC5

L7FB7	JSR	L62C7
	PLA
	STA	$85
	PLA
	STA	$86
	LDA	#$01
	STA	$AD
	RTS

L7FC5	LDA	#$00
	STA	$85
	STA	$86
	JMP	L7F25

*-------------------------------
* CTRL-S - SAVE YOUR GAME 
*-------------------------------

L7FCE	JSR	L7F98
	JMP	L7F25

*-------------------------------
* CTRL-U - NEXT LEVEL 
*-------------------------------

L7FD4	LDA	$96
	CMP	#maxLEVEL-1	; 150-1
L7FD8	BEQ	L7F6E
	JSR	L7FF8
	INC	$96
	INC	$A6
	JMP	L7F01

*-------------------------------
* CTRL-H - PREVIOUS LEVEL
*-------------------------------

L7FE4	LDA	$96
	BEQ	L7FD8
	JSR	L7FF8
	DEC	$A6
	DEC	$96
	JMP	L7F01

*-------------------------------
* CTRL-Q - QUIT GAME GENERATOR 
*-------------------------------

L7FF2	JSR	L7FF8
	JMP	L7BB2

L7FF8	LDA	$AD
	BNE	L8075
	JSR	L7A57
	LDA	#$40
	STA	$87
	LDA	#$00
	STA	$85
	STA	$86
	JSR	L86E0
	ASC	"LEVEL HAS BEEN CHANGED BUT"8D
	ASC	"NOT SAVED. DO YOU WISH TO"8D
	ASC	"SAVE MODIFIED LEVEL (Y/N) "00
	JSR	L86CE
	STA	TXTPAGE2
L8062	LDA	#$00
	JSR	L85F3
	STA	KBDSTROBE
	CMP	#$CE
	BEQ	L8075
	CMP	#$D9
	BNE	L8062
	JSR	L7F98
L8075	STA	TXTPAGE1
	LDA	#$00
	STA	$85
	STA	$86
	RTS

L807F	LDA	#$01
	JSR	L6359
	CMP	#$00
	BNE	L808E
	JSR	L8106
	JMP	L7BB2

L808E	CMP	#$01
	BNE	L8105
	JSR	L8098
	JMP	L7BB2

L8098	JSR	L7A57
	LDA	#$40
	STA	$87
	LDA	#$00
	STA	$85
	STA	$86
	JSR	L86E0
	ASC	"USER NOT ALLOWED TO"8D
	ASC	"MANIPULATE MASTER DISKETTE."00
L80D8	JSR	L86E0
	ASC	8D8D
	ASC	"HIT A KEY TO CONTINUE "00
	JSR	L86CE
	STA	TXTPAGE2
	LDA	#$00
	JSR	L85F3
	STA	KBDSTROBE
	STA	TXTPAGE1
L8105	RTS

L8106	JSR	L7A57
	LDA	#$40
	STA	$87
	LDA	#$00
	STA	$85
	STA	$86
	JSR	L86E0
	ASC	"DISKETTE IN DRIVE IS NOT A"8D
	ASC	"LODE RUNNER DATA DISK."00
	JMP	L80D8

L814B	LDY	$86
	LDA	L1C05,Y
	STA	$06
	LDA	L1C15,Y
	STA	$07
	LDY	$85
	LDA	($06),Y
	JSR	L8700
	STA	KBDSTROBE
	RTS

L8162	ASC	"JIKM"
	HEX	9395889100

L816B	DA	L7F7C-1	; J move left
	DA	L7F74-1	; I move up
	DA	L7F84-1	; K move right
	DA	L7F8E-1	; M move down
	DA	L7FCE-1	; CTRL-S to save your game
	DA	L7FD4-1	; CTRL-U to load next level
	DA	L7FE4-1	; CTRL-H to load previous level
	DA	L7FF2-1	; CTRL-Q to quit game generator

*-------------------------------
* CHECK REQUIRED LEVEL NUMBER
*-------------------------------

L817B	LDY	$96
	INY
	TYA
	JSR	L7AF8
	LDA	$85
	STA	L824E
	LDY	#$00
L8189	LDA	|$0089,Y
	STY	L824D
	JSR	L7B15
	LDY	L824D
	INY
	CPY	#$03
	BCC	L8189
	LDA	L824E
	STA	$85
	LDY	#$00
	STY	L824D
L81A4	LDX	L824D
	LDA	$89,X
	CLC
	ADC	#$3B
	JSR	L8700
	STA	KBDSTROBE
	CMP	#$8D	; return
	BEQ	L820D
	CMP	#$88	; left arrow
	BNE	L81C7
	LDX	L824D
	BEQ	L8207
	DEC	L824D
	DEC	$85
	JMP	L81A4

L81C7	CMP	#$95	; right arrow
	BNE	L81DA
	LDX	L824D
	CPX	#$02
	BEQ	L8207
	INC	$85
	INC	L824D
	JMP	L81A4

L81DA	CMP	#$9B	; esc
	BNE	L81E1
	JMP	L7C16

L81E1	CMP	#"0"	; 0
	BCC	L8207
	CMP	#"9"+1	; 9+1
	BCS	L8207
	SEC
	SBC	#"0"
	LDY	L824D
	STA	|$0089,Y
	JSR	L7B15

	INC	L824D
	LDA	L824D
	CMP	#$03
	BCC	L81A4
	DEC	L824D
	DEC	$85
	JMP	L81A4

L8207	JSR	L86CE
	JMP	L81A4

*-------------------------------
* TRANSFORM A ASC NUMBER IN HEX
*-------------------------------

L820D	LDA	L824E
	CLC
	ADC	#$03
	STA	$85
	LDA	#$00
	LDX	$89
	BEQ	L8223
	CLC
L821C	ADC	#100
	BCS	L823C
	DEX
	BNE	L821C
L8223	LDX	$8A
	BEQ	L822F
	CLC
L8228	ADC	#10
	BCS	L823C
	DEX
	BNE	L8228
L822F	CLC
	ADC	$8B
	BCS	L823C
	STA	$A6
	TAY
	DEY
	STY	$96	; and make it our level
	CPY	#maxLEVEL
L823C	RTS

L823D	LDA	#$00
	JSR	L8700
	STA	KBDSTROBE
	CMP	#$9B	; escape
	BNE	L824C
	JMP	L7C16
L824C	RTS
L824D	RTS

L824E	DB	$85
L824F	DB	$0F
L8250	DB	$60

L8251	HEX	02110F040000FE000000000000000000
	HEX	00000000000000000000000000000000
	HEX	000000000000007A0000000000000000
	HEX	FFFF0000230F0001
L8289	HEX	220F8888888888888888CCCFC4C5A0D2
	HEX	D5CECEC5D2A0C4C1D4C1A0C4C9D3CBA0
	HEX	A0

*---------------------------------------
* PRINT CHAR
*---------------------------------------

L82AA	STA	$1E	; char in $1E
	LDA	#$20	; print HGR1
	BNE	L82B4

L82B0	STA	$1E	; char in $1E
	LDA	#$40	; print HGR2

L82B4	STA	$1F	; page in $1F
	LDY	$86	; take Y
	JSR	L885D
	STY	$1B	; make it Y screen
	LDX	$85	; take X
	JSR	L8868
	STA	$1C	; make it X screen
	STX	$71
	LDA	L8328,X
	STA	$50
	LDA	L832F,X
	STA	$51
	JSR	L8438
	LDA	#$0B
	STA	$1D
	LDX	#$00
	LDA	$71
	CMP	#$05
	BCS	L8301
L82DF	LDY	$1B
	JSR	L7A31
	LDY	$1C
	LDA	($0C),Y
	AND	$50
	ORA	$DF,X
	STA	($0C),Y
	INX
	INY
	LDA	($0C),Y
	AND	$51
	ORA	$DF,X
	STA	($0C),Y
	INX
	INX
	INC	$1B
	DEC	$1D
	BNE	L82DF
	RTS

L8301	LDY	$1B
	JSR	L7A31
	LDY	$1C
	LDA	($0C),Y
	AND	$50
	ORA	$DF,X
	STA	($0C),Y
	INX
	INY
	LDA	$DF,X
	STA	($0C),Y
	INX
	INY
	LDA	($0C),Y
	AND	$51
	ORA	$DF,X
	STA	($0C),Y
	INX
	INC	$1B
	DEC	$1D
	BNE	L8301
	RTS

L8328	HEX	000103070F1F3F
L832F	HEX	F8F0E0C080FEFC

L8336	STY	$1B
	STA	$1E
	JSR	L8872
	STA	$1C
	STX	$71
	JSR	L8438
	LDX	#$0B
	STX	$1D
	LDX	#$00
	LDA	$71
	CMP	#$05
	BCS	L8376
L8350	LDY	$1B
	JSR	L7A3E
	LDY	$1C
	LDA	$DF,X
	EOR	#$7F
	AND	($0C),Y
	ORA	($0E),Y
	STA	($0C),Y
	INX
	INY
	LDA	$DF,X
	EOR	#$7F
	AND	($0C),Y
	ORA	($0E),Y
	STA	($0C),Y
	INX
	INX
	INC	$1B
	DEC	$1D
	BNE	L8350
	RTS

L8376	LDY	$1B
	JSR	L7A3E
	LDY	$1C
	LDA	$DF,X
	EOR	#$7F
	AND	($0C),Y
	ORA	($0E),Y
	STA	($0C),Y
	INX
	INY
	LDA	$DF,X
	EOR	#$7F
	AND	($0C),Y
	ORA	($0E),Y
	STA	($0C),Y
	INX
	INY
	LDA	$DF,X
	EOR	#$7F
	AND	($0C),Y
	ORA	($0E),Y
	STA	($0C),Y
	INX
	INC	$1B
	DEC	$1D
	BNE	L8376
	RTS

L83A7	STY	$1B
	STA	$1E
	JSR	L8872
	STA	$1C
	STX	$71
	JSR	L8438
	LDA	#$0B
	STA	$1D
	LDX	#$00
	STX	$52
	LDA	$71
	CMP	#$05
	BCS	L83F5
L83C3	LDY	$1B
	JSR	L7A3E
	LDY	$1C
	LDA	($0C),Y
	EOR	($0E),Y
	AND	$DF,X
	ORA	$52
	STA	$52
	LDA	$DF,X
	ORA	($0C),Y
	STA	($0C),Y
	INX
	INY
	LDA	($0C),Y
	EOR	($0E),Y
	AND	$DF,X
	ORA	$52
	STA	$52
	LDA	$DF,X
	ORA	($0C),Y
	STA	($0C),Y
	INX
	INX
	INC	$1B
	DEC	$1D
	BNE	L83C3
	RTS

L83F5	LDY	$1B
	JSR	L7A3E
	LDY	$1C
	LDA	($0C),Y
	EOR	($0E),Y
	AND	$DF,X
	ORA	$52
	STA	$52
	LDA	$DF,X
	ORA	($0C),Y
	STA	($0C),Y
	INX
	INY
	LDA	($0C),Y
	EOR	($0E),Y
	AND	$DF,X
	ORA	$52
	STA	$52
	LDA	$DF,X
	ORA	($0C),Y
	STA	($0C),Y
	INX
	INY
	LDA	($0C),Y
	EOR	($0E),Y
	AND	$DF,X
	ORA	$52
	STA	$52
	LDA	$DF,X
	ORA	($0C),Y
	STA	($0C),Y
	INX
	INC	$1B
	DEC	$1D
	BNE	L83F5
	RTS

L8438	LDA	#$0B
	STA	$1D
	LDA	#<LAD00	; LOGO POINTER
	STA	$0A
	LDA	#>LAD00
	STA	$0B
	LDA	L84C1,X
	STA	L845A+2
	STA	L8466+2
	STA	L848B+2
	STA	L8497+2
	LDX	#$00
L8455	LDY	$1E
	LDA	($0A),Y
	TAY
L845A	LDA	LA000,Y
	STA	L846F+1
	CLC
	ADC	#$01
	STA	L8474+1
L8466	LDA	LA080,Y
	STA	L846F+2
	STA	L8474+2
L846F	LDA	LA000
	STA	$DF,X
L8474	LDA	LA000
	STA	$E0,X
	LDA	$0A
	CLC
	ADC	#$68
	STA	$0A
	LDA	$0B
	ADC	#$00
	STA	$0B
	LDY	$1E
	LDA	($0A),Y
	TAY
L848B	LDA	LA000,Y
	STA	L84A0+1
	CLC
	ADC	#$01
	STA	L84A7+1
L8497	LDA	LA080,Y
	STA	L84A0+2
	STA	L84A7+2
L84A0	LDA	LA000
	ORA	$E0,X
	STA	$E0,X
L84A7	LDA	LA000
	STA	$E1,X
	LDA	$0A
	CLC
	ADC	#$68
	STA	$0A
	LDA	$0B
	ADC	#$00
	STA	$0B
	INX
	INX
	INX
	DEC	$1D
	BNE	L8455
	RTS

L84C1	DB	>LA200	; LOGO POINTER
	DB	>LA300
	DB	>LA400
	DB	>LA500
	DB	>LA600
	DB	>LA700
	DB	>LA800

L84C8	LDA	$9D
	BEQ	L8514
	LDA	$8E
	ORA	$8F
	ORA	$90
	ORA	$91
	BEQ	L8514
	LDA	#$01
	JSR	L6359
	BEQ	L8514
	LDY	#$01
L84DF	LDX	L79A2,Y
	LDA	$A6
	CMP	L1F03,X
	BCC	L850F
	BNE	L8515
	LDA	$91
	CMP	L1F04,X
	BCC	L850F
	BNE	L8515
	LDA	$90
	CMP	L1F05,X
	BCC	L850F
	BNE	L8515
	LDA	$8F
	CMP	L1F06,X
	BCC	L850F
	BNE	L8515
	LDA	$8E
	CMP	L1F07,X
	BCC	L850F
	BNE	L8515
L850F	INY
	CPY	#$0B
	BCC	L84DF
L8514	RTS

L8515	CPY	#$0A
	BEQ	L8536
	STY	$56
	LDY	#$09
L851D	LDX	L79A2,Y
	LDA	#$08
	STA	$1D
L8524	LDA	L1F00,X
	STA	L1F08,X
	INX
	DEC	$1D
	BNE	L8524
	CPY	$56
	BEQ	L8536
	DEY
	BNE	L851D
L8536	LDX	L79A2,Y
	LDA	#$A0
	STA	L1F00,X
	STA	L1F01,X
	STA	L1F02,X
	LDA	$A6
	STA	L1F03,X
	LDA	$91
	STA	L1F04,X
	LDA	$90
	STA	L1F05,X
	LDA	$8F
	STA	L1F06,X
	LDA	$8E
	STA	L1F07,X
	STY	$69
	LDA	L79A2,Y
	STA	L8582+1
	STA	L85C9+1
	JSR	L786B
	LDA	#$40
	STA	$87
	LDA	$69
	CLC
	ADC	#$04
	STA	$86
	LDA	#$07
	STA	$85
	LDX	#$00
	STX	L824D
L857F	LDX	L824D
L8582	LDA	L1F00,X
	JSR	L7B2A
	JSR	L85F3
	STA	KBDSTROBE
	CMP	#$8D
	BEQ	L85E7
	CMP	#$88
	BNE	L85A3
	LDX	L824D
	BEQ	L85E1
	DEC	L824D
	DEC	$85
	JMP	L857F

L85A3	CMP	#$95
	BNE	L85B6
	LDX	L824D
	CPX	#$02
	BEQ	L85E1
	INC	$85
	INC	L824D
	JMP	L857F

L85B6	CMP	#$AE
	BEQ	L85C6
	CMP	#$A0
	BEQ	L85C6
	CMP	#$C1
	BCC	L85E1
	CMP	#$DB
	BCS	L85E1
L85C6	LDY	L824D
L85C9	STA	L1F00,Y
	JSR	L7B64
	INC	L824D
	LDA	L824D
	CMP	#$03
	BCC	L857F
	DEC	L824D
	DEC	$85
	JMP	L857F

L85E1	JSR	L86CE
	JMP	L857F

L85E7	LDA	#$20
	STA	$87
	LDA	#$02
	JSR	L6359
	JMP	L618E

L85F3	STA	L8745
L85F6	LDA	#$68
	STA	$A1
	LDA	L8745
	BNE	L8601
	LDA	#$0A
L8601	JSR	L82B0
L8604	LDA	KBD
	BMI	L8628
	JSR	L876D
	DEC	$A1
	BNE	L8604
	LDA	#$00
	JSR	L82B0
	LDA	#$68
	STA	$A1
L8619	LDA	KBD
	BMI	L8628
	JSR	L876D
	DEC	$A1
	BNE	L8619
	JMP	L85F6

L8628	PHA
	LDA	L8745
	JSR	L82B0
	PLA
	RTS

L8631	LDA	#$00
	STA	L0C00
	LDX	$A3
	STX	L869E
L863B	LDX	L869E
	BEQ	L8696
	LDA	L0C00,X
	BMI	L8690
	STA	$85
	LDA	L0C30,X
	STA	$86
	TAY
	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$07
	LDA	L1C25,Y
	STA	$09
	LDY	$85
	LDA	($08),Y
	BNE	L868B
	LDA	#$03
	STA	($08),Y
	LDA	($06),Y
	BNE	L8670
	LDA	#$03
	STA	($06),Y
L8670	LDA	#$03
	JSR	L82B0
	LDX	$85
	LDY	$86
	JSR	L885D
	LDA	#$03
	JSR	L83A7
	LDX	L869E
	LDA	#$FF
	STA	L0C00,X
	BMI	L8690
L868B	LDA	#$01
	STA	L0C00
L8690	DEC	L869E
	JMP	L863B

L8696	LDA	L0C00
	BNE	L869D
	DEC	$93
L869D	RTS

L869E	DB	$00
L869F	STA	KBDSTROBE
	LDA	KBD
	BMI	L869F
	RTS

L86A8	LDA	KBD
	BPL	L86A8
	STA	KBDSTROBE
	RTS

L86B1	LDA	L86BE,X
	TAX
L86B5	LDY	#$B4
L86B7	DEY
	BNE	L86B7
	DEX
	BNE	L86B5
	RTS

L86BE	HEX	020406080A0C0E10121416181A1C1E20

L86CE	LDY	#$C0
L86D0	LDX	#$80
L86D2	DEX
	BNE	L86D2
	LDA	$99
	BEQ	L86DC
	LDA	SPKR
L86DC	DEY
	BNE	L86D0
	RTS

L86E0	PLA
	STA	$10
	PLA
	STA	$11
	BNE	L86F1
L86E8	LDY	#$00
	LDA	($10),Y
	BEQ	L86F9
	JSR	L7B64
L86F1	INC	$10
	BNE	L86E8
	INC	$11
	BNE	L86E8
L86F9	LDA	$11
	PHA
	LDA	$10
	PHA
	RTS

L8700	STA	L8745
L8703	LDA	#$68
	STA	$A1
	LDA	#$00
	LDX	L8745
	BNE	L8710
	LDA	#$0A
L8710	JSR	L82AA
L8713	LDA	KBD
	BMI	L873C
	JSR	L876D
	BCS	L873C
	DEC	$A1
	BNE	L8713
	LDA	L8745
	JSR	L82AA
	LDA	#$68
	STA	$A1
L872B	LDA	KBD
	BMI	L873C
	JSR	L876D
	BCS	L873C
	DEC	$A1
	BNE	L872B
	JMP	L8703

L873C	PHA
	LDA	L8745
	JSR	L82AA
	PLA
	RTS

L8745	DB	$06

L8746	LDA	#$00
	STA	$65
	STA	$66
	LDA	PTRIG
L874F	LDX	#$01
L8751	LDA	$C064,X
	BPL	L8769
	INC	$65,X
L8758	DEX
	BPL	L8751
	LDA	PADDL0
	ORA	PADDL1
	BPL	L876C
	LDA	$65
	ORA	$66
	BPL	L874F
L8769	NOP
	BPL	L8758
L876C	RTS

L876D	LDA	$95
	CMP	#"K"
	BEQ	L8798
	JSR	L8746
	LDA	$65
	CMP	#$12
	BCC	L8796
	CMP	#$3B
	BCS	L8796
	LDA	$66
	CMP	#$12
	BCC	L8796
	CMP	#$3B
	BCS	L8796
	LDA	BUTN1
	BMI	L8796
	LDA	BUTN0
	BMI	L8796
	CLC
	RTS

L8796	SEC
	RTS

L8798	LDX	#$02
L879A	DEY
	BNE	L879A
	DEX
	BNE	L879A
	CLC
	RTS

L87A2	LDA	PTRIG
	LDX	#$10
L87A7	LDA	PADDL0
	ORA	PADDL1
	BPL	L87B9
	DEY
	BNE	L87A7
	DEX
	BNE	L87A7
	LDA	#"K"
	STA	$95
L87B9	RTS

L87BA	STA	$0A
	STX	$0B
L87BE	LDA	$99
	BEQ	L87C5
	LDA	SPKR
L87C5	DEY
	BNE	L87CC
	DEC	$0B
	BEQ	L87D4
L87CC	DEX
	BNE	L87C5
	LDX	$0A
	JMP	L87BE
L87D4	RTS

L87D5	INC	$54
	LDY	$54
	STA	L0E80,Y
	TXA
	STA	L0E00,Y
	RTS

L87E1	PLA
	STA	$10
	PLA
	STA	$10+1
	BNE	L8802
L87E9	LDY	#$00
	LDA	($10),Y
	BEQ	L880A
	INC	$54
	LDX	$54
	STA	L0E00,X
	INY
	LDA	($10),Y
	STA	L0E80,X
	INC	$10
	BNE	L8802
	INC	$10+1
L8802	INC	$10
	BNE	L87E9
	INC	$10+1
	BNE	L87E9
L880A	LDA	$10+1
	PHA
	LDA	$10
	PHA
	RTS

L8811	LDY	$54
	BEQ	L8832
	LDA	L0E80,Y
	LDX	L0E00,Y
	JSR	L87BA
	LDY	$54
	DEC	$54
	LDA	$8C
	SEC
	SBC	L0E00,Y
	BEQ	L8830
	BCC	L8830
	TAX
	JSR	L86B5
L8830	SEC
	RTS

L8832	LDA	$9B
	BNE	L8844
	LDA	$A4
	LSR
	INC	$A4
	LDX	$8C
	INX
	INX
	JSR	L87BA
	CLC
	RTS

L8844	LDX	$8C
	JSR	L86B1
	CLC
	RTS

L884B	LDA	L1C05,Y
	STA	$06
	STA	$08
	LDA	L1C15,Y
	STA	$06+1
	LDA	L1C25,Y
	STA	$08+1
	RTS

*-------------------------------
* FROM A Y IN TEXT TO A Y IN HGR
*-------------------------------

L885D	LDA	L1C51,Y
	PHA
	LDA	L1C35,X
	TAX
	PLA
	TAY
	RTS

L8868	LDA	L1C62,X
	PHA
	LDA	L1C7E,X
	TAX
	PLA
	RTS

L8872	LDA	L1C9A,X
	PHA
	LDA	L1D26,X
	TAX
	PLA
	RTS

L887C	TXA
	PHA
	JSR	L885D
	PLA
	TAX
	TYA
	CLC
	ADC	L888A,X
	TAY
	RTS

L888A	HEX	FBFD000204

L888F	TYA
	PHA
	JSR	L885D
	PLA
	TAY
	TXA
	CLC
	ADC	L889D,Y
	TAX
	RTS

L889D	HEX	FEFF000102

*-------------------------------
* CIRCLE ANIMATION
*-------------------------------

L88A2	LDA	#$58	; 88
	STA	$73
	LDA	#$8C	; 140
	STA	$74
	LDA	$A5
	BEQ	L88BD

	LDX	#$AA	; 170
	STX	$6D
	LDX	#$00	; 0
	STX	$72
L88B6	JSR	L88D7
	DEC	$6D
	BNE	L88B6

L88BD	LDA	#$01
	STA	$6D
	STA	$A5
	STA	$72
	JSR	L7A70
	JSR	L7A8C
L88CB	JSR	L88D7
	INC	$6D
	LDA	$6D
	CMP	#$AA	; 170
	BNE	L88CB
	RTS

L88D7	LDA	$6D
	STA	$69
	LDA	#$00
	STA	$6A
	STA	$67
	STA	$68
	LDA	$69
	ASL
	STA	$6B
	LDA	$6A
	ROL
	STA	$6C
	LDA	#$03
	SEC
	SBC	$6B
	STA	$6B
	LDA	#$00
	SBC	$6C
	STA	$6C
	LDA	$73
	SEC
	SBC	$6D
	STA	$75
	LDA	#$00
	SBC	#$00
	STA	$79
	LDA	$73
	STA	$76
	STA	$77
	LDA	#$00
	STA	$7A
	STA	$7B
	LDA	$73
	CLC
	ADC	$6D
	STA	$78
	LDA	#$00
	ADC	#$00
	STA	$7C
	LDA	$74
	SEC
	SBC	$6D
	TAX
	LDA	#$00
	SBC	#$00
	JSR	L8A45
	STY	$7D
	STA	$81
	LDX	$74
	LDA	#$00
	JSR	L8A45
	STY	$7E
	STY	$7F
	STA	$82
	STA	$83
	LDA	$74
	CLC
	ADC	$6D
	TAX
	LDA	#$00
	ADC	#$00
	JSR	L8A45
	STY	$80
	STA	$84
L8951	LDA	$68
	CMP	$6A
	BCC	L896F
	BEQ	L8969
L8959	LDA	$67
	CMP	$69
	BNE	L8968
	LDA	$68
	CMP	$6A
	BNE	L8968
	JMP	L8A69
L8968	RTS

L8969	LDA	$67
	CMP	$69
	BCS	L8959
L896F	JSR	L8A69
	LDA	$6C
	BPL	L89A7
	LDA	$67
	ASL
	STA	$6F
	LDA	$68
	ROL
	STA	$70
	LDA	$6F
	ASL
	STA	$6F
	LDA	$70
	ROL
	STA	$70
	LDA	$6B
	CLC
	ADC	$6F
	STA	$6F
	LDA	$6C
	ADC	$70
	STA	$70
	LDA	#$06
	CLC
	ADC	$6F
	STA	$6B
	LDA	#$00
	ADC	$70
	STA	$6C
	JMP	L8A14

L89A7	LDA	$67
	SEC
	SBC	$69
	STA	$6F
	LDA	$68
	SBC	$6A
	STA	$70
	LDA	$6F
	ASL
	STA	$6F
	LDA	$70
	ROL
	STA	$70
	LDA	$6F
	ASL
	STA	$6F
	LDA	$70
	ROL
	STA	$70
	LDA	$6F
	CLC
	ADC	#$10
	STA	$6F
	LDA	$70
	ADC	#$00
	STA	$70
	LDA	$6F
	CLC
	ADC	$6B
	STA	$6B
	LDA	$70
	ADC	$6C
	STA	$6C
	LDA	$69
	PHP
	DEC	$69
	PLP
	BNE	L89EC
	DEC	$6A
L89EC	INC	$75
	BNE	L89F2
	INC	$79
L89F2	DEC	$84
	BPL	L89FC
	LDA	#$06
	STA	$84
	DEC	$80
L89FC	INC	$81
	LDA	$81
	CMP	#$07
	BNE	L8A0A
	LDA	#$00
	STA	$81
	INC	$7D
L8A0A	DEC	$78
	LDA	$78
	CMP	#$FF
	BNE	L8A14
	DEC	$7C
L8A14	INC	$67
	BNE	L8A1A
	INC	$68
L8A1A	INC	$83
	LDA	$83
	CMP	#$07
	BNE	L8A28
	LDA	#$00
	STA	$83
	INC	$7F
L8A28	DEC	$76
	LDA	$76
	CMP	#$FF
	BNE	L8A32
	DEC	$7A
L8A32	INC	$77
	BNE	L8A38
	INC	$7B
L8A38	DEC	$82
	BPL	L8A42
	LDA	#$06
	STA	$82
	DEC	$7E
L8A42	JMP	L8951

L8A45	STX	$6F
	LDY	#$08
	SEC
	SBC	#$07
L8A4C	PHP
	ROL	$70
	ASL	$6F
	ROL
	PLP
	BCC	L8A5A
	SBC	#$07
	JMP	L8A5C

L8A5A	ADC	#$07
L8A5C	DEY
	BNE	L8A4C
	BCS	L8A64
	ADC	#$07
	CLC
L8A64	ROL	$70
	LDY	$70
	RTS

L8A69	LDY	$7C
	BNE	L8A8C
	LDY	$78
	CPY	#$B0
	BCS	L8A8C
	JSR	L7A3E
	LDY	$7F
	CPY	#$28
	BCS	L8A81
	LDX	$83
	JSR	L8AF6
L8A81	LDY	$7E
	CPY	#$28
	BCS	L8A8C
	LDX	$82
	JSR	L8AF6
L8A8C	LDY	$79
	BNE	L8AAF
	LDY	$75
	CPY	#$B0
	BCS	L8AAF
	JSR	L7A3E
	LDY	$7F
	CPY	#$28
	BCS	L8AA4
	LDX	$83
	JSR	L8AF6
L8AA4	LDY	$7E
	CPY	#$28
	BCS	L8AAF
	LDX	$82
	JSR	L8AF6
L8AAF	LDY	$7B
	BNE	L8AD2
	LDY	$77
	CPY	#$B0
	BCS	L8AD2
	JSR	L7A3E
	LDY	$80
	CPY	#$28
	BCS	L8AC7
	LDX	$84
	JSR	L8AF6
L8AC7	LDY	$7D
	CPY	#$28
	BCS	L8AD2
	LDX	$81
	JSR	L8AF6
L8AD2	LDY	$7A
	BNE	L8AF5
	LDY	$76
	CPY	#$B0
	BCS	L8AF5
	JSR	L7A3E
	LDY	$80
	CPY	#$28
	BCS	L8AEA
	LDX	$84
	JSR	L8AF6
L8AEA	LDY	$7D
	CPY	#$28
	BCS	L8AF5
	LDX	$81
	JMP	L8AF6
L8AF5	RTS

L8AF6	LDA	$72
	BNE	L8B02
	LDA	($0C),Y
	AND	L8B0C,X
	STA	($0C),Y
	RTS

L8B02	LDA	($0E),Y
	AND	L8B13,X
	ORA	($0C),Y
	STA	($0C),Y
	RTS

L8B0C	HEX	F0F0F0F08F8F8F
L8B13	HEX	8F8F8F8FF0F0F0

*-------------------------------
* SHOW GAME OVER
*-------------------------------

L8B1A	LDA	#$01
	STA	L8D4B
	LDA	#$20
	STA	$1F

L8B23	JSR	L8BCF
	JSR	L8BBE
	JSR	L8BAD
	JSR	L8B9C
	JSR	L8B8B
	JSR	L8B7A
	JSR	L8B8B
	JSR	L8B9C
	JSR	L8BAD
	JSR	L8BBE
	JSR	L8BCF
	JSR	L8C24
	JSR	L8C13
	JSR	L8C02
	JSR	L8BF1
	JSR	L8BE0
	JSR	L8BF1
	JSR	L8C02
	JSR	L8C13
	JSR	L8C24
	LDA	L8D4B
	CMP	#$64
	BCC	L8B23
	JSR	L8BCF
	JSR	L8BBE
	JSR	L8BAD
	JSR	L8B9C
	JSR	L8B8B
	JSR	L8B7A
	CLC
	RTS

L8B7A	JSR	L8CE5
	HEX	000102030405060708090A020100
L8B8B	JSR	L8CE5
	HEX	0000010203040507090A02010000
L8B9C	JSR	L8CE5
	HEX	00000001020304090A0201000000
L8BAD	JSR	L8CE5
	HEX	000000000102030A020100000000
L8BBE	JSR	L8CE5
	HEX	000000000001030A010000000000
L8BCF	JSR	L8CE5
	HEX	0000000000000101000000000000
L8BE0	JSR	L8CE5
	HEX	0001020A09080706050403020100
L8BF1	JSR	L8CE5
	HEX	000001020A090705040302010000
L8C02	JSR	L8CE5
	HEX	00000001020A0904030201000000
L8C13	JSR	L8CE5
	HEX	0000000001020A03020100000000
L8C24	JSR	L8CE5
	HEX	0000000000010A03010000000000

L8C35	HEX	8080808080808080808080808080
L8C43	HEX	C0AAD5AAD5AAD5AAD5AAD5AAD580
L8C51	HEX	9080808080808080808080808082
L8C5F	HEX	90AAD1A2D5A885A8C5A2D4A29582
L8C6D	HEX	908291A2C5A88088C5A294A09082
L8C7B	HEX	908290A2C4A88088C5A294A09082
L8C89	HEX	908290A2C4A88188C4A2D4A09582
L8C97	HEX	90A2D1A2C4888088C4A284A08582
L8CA5	HEX	908291A2C4888088C4AA84A08582
L8CB3	HEX	908291A2C4888088C48A84A09182
L8CC1	HEX	90AA91A2C4A885A88582D4A29182

L8CCF	DA	L8C35-$D
	DA	L8C43-$D
	DA	L8C51-$D
	DA	L8C5F-$D
	DA	L8C6D-$D
	DA	L8C7B-$D
	DA	L8C89-$D
	DA	L8C97-$D
	DA	L8CA5-$D
	DA	L8CB3-$D
	DA	L8CC1-$D

L8CE5	PLA
	STA	$0A
	PLA
	STA	$0A+1
	LDY	#$50
	STY	$86
	BNE	L8D12
L8CF1	JSR	L7A31
	LDY	#$00
	LDA	($0A),Y
	ASL
	TAX
	LDA	L8CCF,X
	STA	L8D08+1
	LDA	L8CCF+1,X
	STA	L8D08+2
	LDY	#$0D
L8D08	LDA	L8D08,Y
	STA	($0C),Y
	INY
	CPY	#$1B
	BCC	L8D08
L8D12	JSR	L8D4C
	INC	$86
	LDY	$86
	CPY	#$5F
	BCC	L8CF1
	LDX	L8D4B
	LDY	#$FF
L8D22	DEY
	BNE	L8D22
	DEX
	BNE	L8D22
	INC	L8D4B
	LDA	$95
	CMP	#"K"
	BEQ	L8D3B
	LDA	BUTN1
	BMI	L8D41
	LDA	BUTN0
	BMI	L8D41
L8D3B	LDA	KBD
	BMI	L8D41
	RTS

L8D41	PLA
	PLA
	SEC
	LDA	KBD
	STA	KBDSTROBE
	RTS

L8D4B	DB	$9D

L8D4C	INC	$0A
	BNE	L8D52
	INC	$0A+1
L8D52	RTS

	ds	\

*-------------------------------
* NOT USED?
*-------------------------------

L8E00	LDA	#$44	;	MASTER	DISKETTE
	STA	$0478
	LDA	#$00
	JSR	LB9A0
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	LDA	#$20
	STA	$4F
L8E14	DEY
	BNE	L8E20
	DEC	$4F
	BNE	L8E20
	JMP	LBEAF

	NOP
	NOP
L8E20	LDA	$C08C,X
	BPL	L8E20
L8E25	CMP	#$D4
	BNE	L8E14
	NOP
L8E2A	LDA	$C08C,X
	BPL	L8E2A
L8E2F	CMP	#$D5
	BNE	L8E25
	NOP
L8E34	LDA	$C08C,X
	BPL	L8E34
	CMP	#$D6
	BNE	L8E2F
	LDA	$C088,X
	JSR	L8098
	JMP	L7BB2

	DB	$00
	DB	$00
	DB	$00
	DB	$00
	DB	$00
	DB	$00
	DB	$00
	DB	$00
	DB	$00
	DB	$00
	JMP	LB7B5

	ds	\

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

	put	LR.Tables
	put	LR.RWTS
