source/page7C/initial.asm
author brandonlw
Fri, 09 May 2014 05:30:28 -0400
changeset 29 1c4ed1f8d543
parent 24 12b896331796
child 34 7740eaa2faeb
permissions -rw-r--r--
Eliminate all the unnecessary OPx equates.

a1_19_7C:		.asc '1.19 ',0

p7Csub_4006:
		ld		a, 6

SendHeaderPacket:
		ld		(ioData), de
		ld		de, 867Fh
		call	MovFrOP1
		ld		hl, 0Bh
		push	af
		ld		a, (unk_8A0B)
		and		1Eh
		jr		nz, p7Cloc_403E
		ld		hl, (OP2EXT)
		ld		a, h
		or		l
		jr		z, p7Cloc_4041
		push	hl
		call	HLMinus5
		ld		a, (hl)
		or		a
		jr		z, p7Cloc_402E
		ld		a, 80h ; '�'

p7Cloc_402E:
		ld		b, a
		pop		hl
		dec		hl
		ld		a, (hl)
		or		b
		ld		(ioNewData), a
		dec		hl
		ld		a, (hl)

p7Cloc_4038:
		ld		(unk_8688), a
		ld		hl, 0Dh

p7Cloc_403E:
		pop		af
		jr		p7Csub_404C
; ---------------------------------------------------------------------------

p7Cloc_4041:
		xor		a
		ld		(ioNewData), a
		jr		p7Cloc_4038
; End of function SendHeaderPacket


; =============== S U B	R O U T	I N E =======================================


p7Csub_4047:
		; SendApplication+5Ap ...
		ld		hl, 0Ah
; End of function p7Csub_4047


; =============== S U B	R O U T	I N E =======================================


p7Csub_404A:
		ld		a, 6
; End of function p7Csub_404A


; =============== S U B	R O U T	I N E =======================================


p7Csub_404C:

		ld		de, ioData
		ex		de, hl
		jp		SendRAMCmd
; End of function p7Csub_404C


; =============== S U B	R O U T	I N E =======================================


Page7C_2C49:
		call	FlashWriteDisable
		ld		de, 5
		call	Page7C_2C4F
		ret
; End of function Page7C_2C49


; =============== S U B	R O U T	I N E =======================================


Page7C_2C4F:

		ld		hl, 867Eh
		ld		(hl), a
		ld		hl, 867Ch
		ld		a, 36h ; '6'
		jr		SendRAMCmd
; ---------------------------------------------------------------------------

SendSkipExitPacket:
		; ReceiveVar+1F7p ...
		ld		de, 1

CancelTransmission:
		ld		hl, 867Ch
		ld		(hl), a
		ld		a, 36h ; '6'
		jr		SendRAMCmd
; ---------------------------------------------------------------------------

SendScreenContents:

		call	SendAck
		ld		de, 300h
		ld		(unk_8676), de
		call	p7Csub_6393
		ld		h, 15h
		ld		(header), hl
		call	Send4Bytes
		di
		ld		a, 7
		call	page0_AB9
		ld		a, 7Fh ; ''
		ld		b, 40h ; '@'

p7Cloc_4092:
		push	bc
		inc		a
		ld		(curXRow), a
		call	SetYUp
		call	page0_AB9
		ld		a, 20h ; ' '
		call	page0_AB9
		call	lcd_busy
		in		a, (11h)
		ld		b, 0Ch

p7Cloc_40A9:
		push	bc
		call	lcd_busy
		in		a, (11h)
		ld		c, a
		call	SendDataByte
		pop		bc
		djnz	p7Cloc_40A9
		pop		bc
		ld		a, (curXRow)
		djnz	p7Cloc_4092
		ld		a, 5
		call	page0_AB9
		ei
		jp		p7Cloc_4163
; ---------------------------------------------------------------------------

SendRAMVarData:
		ld		b, 0
		jr		p7Cloc_40CD
; ---------------------------------------------------------------------------

p7Cloc_40C9:
		; SendVariable+4Fp
		ld		a, (OP2+8)
		ld		b, a

p7Cloc_40CD:
		ld		a, 15h
		jr		SendCmd
; ---------------------------------------------------------------------------

SendRAMCmd:
		; Page7C_2C4F+9j ...
		ld		b, 0

SendCmd:
		ex		de, hl
		call	SetupPagedPtr
		ex		de, hl
		ld		(iMathPtr5), hl
		ld		(unk_8676), de
		ld		h, a
		call	p7Csub_6F33
		call	p7Csub_6B25
		call	p7Csub_6393
		ld		(header), hl
		ld		a, (sndRecState)
		cp		8
		jr		nz, SendArcPacket
		ld		a, (varClass)
		cp		0Ah
		jr		nz, SendArcPacket
		ld		de, (unk_8676)
		ld		hl, 37Dh
		call	CpHLDE
		jr		nc, SendArcPacket
		ld		(unk_8676), hl
		call	Send4Bytes
		ld		bc, 0
		ld		(unk_8678), bc
		ld		c, 63h ; 'c'
		call	SendDataByte
		ld		c, 0
		call	SendDataByte
		ld		de, (unk_8676)
		dec		de
		dec		de
		ld		hl, (iMathPtr5)
		inc		hl
		inc		hl
		call	PagedGet
		call	PagedGet
		jr		p7Cloc_415E
; ---------------------------------------------------------------------------

SendPacket:
		xor		a
		ld		(pagedCount+1), a

SendArcPacket:
		; Page7C_2C4F+9Bj ...
		call	Send4Bytes
		ld		de, (unk_8676)
		ld		hl, (iMathPtr5)
		ld		bc, 0
		ld		(unk_8678), bc
		jr		p7Cloc_415E
; ---------------------------------------------------------------------------

p7Cloc_4147:
		call	CHKERRBREAK
		push	de
		ld		a, (pagedCount+1)
		or		a
		jr		z, p7Cloc_4157
		call	PagedGet
		ld		c, a
		jr		p7Cloc_4158
; ---------------------------------------------------------------------------

p7Cloc_4157:
		ld		c, (hl)

p7Cloc_4158:
		call	SendDataByte
		pop		de
		dec		de
		inc		hl

p7Cloc_415E:
		; Page7C_2C4F+E8j
		ld		a, d
		or		e
		jr		nz, p7Cloc_4147
		di

p7Cloc_4163:

		ld		hl, (unk_8678)
		ld		a, l
		push	hl
		call	SendAByte
		pop		af
		call	SendAByte

ReceiveAck:

		call	p7Csub_430F
		call	Get4Bytes
		ld		a, (header+1)
		push	af
		ld		a, (header)
		ld		hl, (unk_8676)
		push	hl
		call	p7Csub_4306
		pop		hl
		ld		b, a
		pop		af
		cp		56h ; 'V'
		ret		z
		jp		JErrorNo
; End of function Page7C_2C4F


; =============== S U B	R O U T	I N E =======================================


p7Csub_418C:
		; ReceiveVar+6ABp ...
		ld		h, 92h ; '�'
		jr		Send4BytePacket
; End of function p7Csub_418C


; =============== S U B	R O U T	I N E =======================================


p7Csub_4190:
		; ReceiveVar+290p ...
		ld		h, 9
; End of function p7Csub_4190


; =============== S U B	R O U T	I N E =======================================


Send4BytePacket:
		call	p7Csub_6B25
		call	p7Csub_6393
		ld		(header), hl
		di
		call	Send4Bytes
		ei
		jr		ReceiveAck
; End of function Send4BytePacket


; =============== S U B	R O U T	I N E =======================================


SendDataByte:
		; Page7C_2C4F+B8p ...
		ld		b, 0
		ex		de, hl
		ld		hl, (unk_8678)
		add		hl, bc
		ld		(unk_8678), hl
		ex		de, hl
		jr		SendCByte
; End of function SendDataByte


; =============== S U B	R O U T	I N E =======================================


p7Csub_41AF:

		ld		l, 83h ; '�'
		jr		p7Cloc_41B5
; ---------------------------------------------------------------------------

p7Cloc_41B3:
		ld		l, 73h ; 's'

p7Cloc_41B5:
		ld		h, 68h ; 'h'
		ld		(header), hl
; End of function p7Csub_41AF


; =============== S U B	R O U T	I N E =======================================


Send4Bytes:
		; Page7C_2C4F+ACp ...
		call	p7Csub_6F33
		ld		hl, 0FAh ; '�'

p7Cloc_41C0:
		dec		hl
		ld		a, h
		or		l
		jr		nz, p7Cloc_41C0

p7Cloc_41C5:
		call	NZIf83Plus
		jr		z, p7Cloc_41E3
		ld		a, 0
		out		(0), a
		in		a, (0)
		and		3
		cp		3
		jr		z, p7Cloc_41E9

p7Cloc_41D6:
		call	p7Csub_447D
		call	p7Csub_4441
		jr		c, p7Cloc_41E0
		jr		z, p7Cloc_41C5

p7Cloc_41E0:
		jp		ErrLinkXmit
; ---------------------------------------------------------------------------

p7Cloc_41E3:
		in		a, (9)
		and		19h
		jr		nz, p7Cloc_41D6

p7Cloc_41E9:
		ld		hl, 0
		ld		(unk_8678), hl
		ld		a, (header)
		call	SendAByte
		ld		a, (header+1)
		call	SendAByte
		ld		a, (unk_8676)
		call	SendAByte
		ld		a, (unk_8676+1)
; End of function Send4Bytes


; =============== S U B	R O U T	I N E =======================================


SendAByte:
		; Page7C_2C4F+10Fp ...




		ld		c, a

SendCByte:
		call	NZIf83Plus
		jp		z, p7Cloc_6D81
		ld		b, 8

p7Cloc_420D:
		ld		de, 0FFFFh
		rr	c
		jr		nc, p7Cloc_4219
		ld		a, 2
		jp		p7Cloc_421B
; ---------------------------------------------------------------------------

p7Cloc_4219:
		ld		a, 1

p7Cloc_421B:
		out		(0), a

p7Cloc_421D:
		in		a, (0)
		and		3
		jp		z, p7Cloc_4234
		in		a, (0)
		and		3
		jp		z, p7Cloc_4234
		dec		de
		ld		a, d
		or		e
		jp		nz, p7Cloc_421D

p7Cloc_4231:
		; GetDataPacket+11j ...
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_4234:
		; SendAByte+24j
		ld		a, 0
		out		(0), a
		ld		de, 0FFFFh

p7Cloc_423B:
		dec		de
		ld		a, d
		or		e
		jr		z, p7Cloc_4231
		in		a, (0)
		and		3
		cp		3
		jp		nz, p7Cloc_423B
		djnz	p7Cloc_420D
		ret
; End of function SendAByte


; =============== S U B	R O U T	I N E =======================================


GetSmallPacket:

		xor		a
		ld		(unk_8688), a
		ld		(ioNewData), a
		ld		hl, ioData
		jr		p7Cloc_4278
; End of function GetSmallPacket


; =============== S U B	R O U T	I N E =======================================


GetDataPacket:
		ld		(iMathPtr5), de
		push	bc
		call	Get4Bytes
		pop		bc
		ld		hl, ioFlag
		ld		a, (header+1)
		cp		15h
		jr		nz, p7Cloc_4231
		ld		hl, (unk_8676)
		or		a
		sbc		hl, bc
		jr		nz, p7Cloc_4231
		jr		GetVariableData
; ---------------------------------------------------------------------------

GetSmallPacket2:
		ld		hl, 867Ch

p7Cloc_4278:
		ld		(iMathPtr5), hl
		ld		hl, (unk_8676)
		ld		de, 0Fh
		or		a
		sbc		hl, de
		jr		c, GetVariableData
		jp		ErrLinkXmit
; ---------------------------------------------------------------------------

GetVariableData:
		; GetDataPacket+2Cj ...
		ld		bc, (unk_8676)
		ld		de, 0
		ld		(unk_8678), de
		ld		a, c
		or		b
		jr		z, p7Cloc_42E6
		ld		hl, pagedBuf
		ld		(pagedGetPtr), hl
		xor		a
		ld		(pagedCount), a
		ld		hl, (iMathPtr5)

p7Cloc_42A5:
		call	CHKERRBREAK
		jp		nz, JErrorNo
		push	bc
		call	RecAByteIO
		bit		7, h
		jr		nz, p7Cloc_42CB
		push	hl
		ld		hl, (pagedGetPtr)
		ld		(hl), a
		inc		hl
		ld		(pagedGetPtr), hl
		pop		hl
		ld		a, (pagedCount)
		inc		a
		ld		(pagedCount), a
		cp		10h
		call	z, p7Cloc_6C65
		jr		p7Cloc_42CD
; ---------------------------------------------------------------------------

p7Cloc_42CB:
		ld		(hl), a
		inc		hl

p7Cloc_42CD:
		ex		de, hl
		ld		b, 0
		ld		hl, (unk_8678)
		add		hl, bc
		ld		(unk_8678), hl
		ex		de, hl
		pop		bc
		dec		bc
		ld		a, b
		or		c
		jp		nz, p7Cloc_42A5
		ld		a, (pagedCount)
		or		a
		call	nz, p7Cloc_6C65

p7Cloc_42E6:
		call	RecAByteIO
		push	af
		call	RecAByteIO
		ld		b, a
		pop		af
		call	p7Csub_64DF
; End of function GetDataPacket


; =============== S U B	R O U T	I N E =======================================


SendAck:

		call	p7Csub_430F
		ld		hl, 0

p7Cloc_42F8:
		ld		(unk_8676), hl
		call	p7Csub_6393
		ld		h, 56h ; 'V'
		ld		(header), hl
		call	Send4Bytes
; End of function SendAck


; =============== S U B	R O U T	I N E =======================================


p7Csub_4306:

		ld		hl, bakHeader
		ld		de, header

p7Cloc_430C:
		jp		mov9B2
; End of function p7Csub_4306


; =============== S U B	R O U T	I N E =======================================


p7Csub_430F:
		; SendAckp ...
		ld		hl, header
		ld		de, bakHeader
		jr		p7Cloc_430C
; End of function p7Csub_430F


; =============== S U B	R O U T	I N E =======================================


SendReadyPacket:
		ld		a, (unk_8A0B)
		and		1Eh
		ret		nz
		call	p7Csub_41AF
		call	Get4BytesCursor
		ld		a, (header)
		cp		73h ; 's'
		jr		z, locret_432E
		set		IDis83h, (iy+linkFlags)

locret_432E:
		ret
; End of function SendReadyPacket


; =============== S U B	R O U T	I N E =======================================


Get4Bytes:
		; GetDataPacket+5p ...
		call	RecAByteIO

Get3Bytes:
		; Get4BytesCursor:p7Cloc_6319p
		ld		(header), a
		bit		IDis95h, (iy+linkFlags)
		jr		z, p7Cloc_433F
		cp		95h ; '�'
		jr		p7Cloc_4380
; ---------------------------------------------------------------------------

p7Cloc_433F:
		cp		73h ; 's'
		jr		z, p7Cloc_4380
		cp		23h ; '#'
		jr		z, p7Cloc_4380
		cp		74h ; 't'
		jr		z, p7Cloc_4380
		cp		82h ; '�'
		jr		z, p7Cloc_4380
		cp		2
		jr		z, p7Cloc_4380
		cp		12h
		jr		z, p7Cloc_4380
		cp		83h ; '�'
		jr		z, p7Cloc_4380
		cp		3
		jr		z, p7Cloc_4380
		cp		13h
		jr		z, p7Cloc_4380
		cp		8
		jr		z, p7Cloc_4380
		call	RecAByteIO
		ld		(header+1), a
		cp		68h ; 'h'
		jr		z, p7Cloc_4386
		cp		47h ; 'G'
		jr		z, p7Cloc_4386
		cp		74h ; 't'
		jr		z, p7Cloc_4386
		cp		2Dh ; '-'
		jr		z, p7Cloc_4386
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_4380:
		; Get4Bytes+12j ...
		call	RecAByteIO
		ld		(header+1), a

p7Cloc_4386:
		; Get4Bytes+44j ...
		call	RecAByteIO
		ld		(unk_8676), a
		call	RecAByteIO
		ld		(unk_8676+1), a
		ret
; End of function Get4Bytes


; =============== S U B	R O U T	I N E =======================================


Rec1stByte:
		call	j_showCursor
		set		apdRunning, (iy+apdFlags)

Rec1stByteNC:
		call	Page7C_2DCF
		call	NZIf83Plus
		jr		nz, p7Cloc_43AB
		call	p7Csub_6F37
		call	p7Csub_6DCD
		jp		p7Cloc_443A
; ---------------------------------------------------------------------------

p7Cloc_43AB:
		; Rec1stByte+24j
		call	CHKERRBREAK
		call	HandleLinkKeyActivity
		in		a, (0)
		and		3
		cp		3
		jr		z, p7Cloc_43AB
		call	p7Csub_6B25
		ld		b, 8
		call	p7Cloc_44A9
		jp		p7Cloc_443A
; End of function Rec1stByte


; =============== S U B	R O U T	I N E =======================================


ContinueGetByte:
		call	p7Csub_6B25

p7Cloc_43C7:
		di
		res		5, (iy+3Dh)
		call	NZIf83Plus
		jr		nz, p7Cloc_43E2
		di
		call	p7Csub_6DDC
		cp		0
		jr		z, p7Cloc_43EC
		ld		a, c
		cp		0E0h ; '�'
		jr		z, p7Cloc_4410
		jp		p7Cloc_442B
; ---------------------------------------------------------------------------

locret_43E1:
		ret
; ---------------------------------------------------------------------------

p7Cloc_43E2:
		ld		b, 8
		call	p7Cloc_44A9
		cp		0
		jp		nz, ErrLinkXmit

p7Cloc_43EC:
		ld		a, c
		cp		0E0h ; '�'
		jr		nz, locret_43E1
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_4404
		in		a, (9)
		bit		6, a
		jr		nz, p7Cloc_4410
		and		19h
		jr		nz, p7Cloc_4428
		call	p7Cloc_6F2A

p7Cloc_4404:
		call	p7Csub_6E7E
		jp		c, p7Cloc_4476
		jr		z, p7Cloc_440F
		jp		p7Cloc_4476
; ---------------------------------------------------------------------------

p7Cloc_440F:
		nop

p7Cloc_4410:
		; ContinueGetByte+37j
		call	p7Csub_6EE6
		jr		nz, p7Cloc_442A
		set		5, (iy+3Dh)
		ld		b, a
		ld		a, (unk_9CAF)
		or		a
		ld		a, b
		ret		nz
		call	Page0Call_3051
		res		0, (iy+1Dh)
		ret
; ---------------------------------------------------------------------------

p7Cloc_4428:
		ld		a, c
		ret
; ---------------------------------------------------------------------------

p7Cloc_442A:
		nop
; End of function ContinueGetByte

; START	OF FUNCTION CHUNK FOR SendAByte

p7Cloc_442B:
		; p7Csub_447D:p7Cloc_44F8j ...
		ld		a, (iy+3Dh)
		and		0F0h ; '�'
		ld		(iy+3Dh), a
		jp		ErrLinkXmit
; END OF FUNCTION CHUNK	FOR SendAByte

; =============== S U B	R O U T	I N E =======================================


RecAByteIO:
		; GetDataPacket:p7Cloc_42E6p ...
		di
		call	p7Csub_447D

p7Cloc_443A:
		; Rec1stByte+2Ej
		call	p7Csub_4441
		ret		c
		ret		nz
		jr		z, RecAByteIO
; End of function RecAByteIO


; =============== S U B	R O U T	I N E =======================================


p7Csub_4441:
		; RecAByteIO:p7Cloc_443Ap
		cp		1
		ld		a, c
		jr		nz, p7Cloc_444D
		cp		0E0h ; '�'
		jp		nz, ErrLinkXmit
		jr		p7Cloc_446D
; ---------------------------------------------------------------------------

p7Cloc_444D:
		cp		0E0h ; '�'
		ret		nz
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_4466
		in		a, (9)
		bit		6, a
		jr		nz, p7Cloc_446D
		and		19h
		jr		nz, p7Cloc_4473
		nop
		nop
		nop
		nop
		nop
		nop

p7Cloc_4466:
		call	p7Csub_6E90
		jr		c, p7Cloc_4475
		jr		nz, p7Cloc_4476

p7Cloc_446D:
		call	p7Csub_6EE6
		nop
		xor		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_4473:
		ld		a, c
		ret
; ---------------------------------------------------------------------------

p7Cloc_4475:
		nop

p7Cloc_4476:
		; ContinueGetByte+48j ...
		call	p7Csub_6F33
		nop
		ld		a, c
		or		a
		ret
; End of function p7Csub_4441


; =============== S U B	R O U T	I N E =======================================


p7Csub_447D:
		; RecAByteIO+1p ...
		ld		b, 8

p7Cloc_447F:
		call	NZIf83Plus
		jp		z, p7Csub_6DDC
		ld		de, 0FFFFh
		jr		p7Cloc_44A0
; ---------------------------------------------------------------------------

p7Cloc_448A:
		in		a, (0)
		and		3
		jr		z, p7Cloc_44F8
		cp		3
		jp		nz, p7Cloc_44A9
		in		a, (0)
		and		3
		jr		z, p7Cloc_44F8
		cp		3
		jp		nz, p7Cloc_44A9

p7Cloc_44A0:
		dec		de
		ld		a, d
		or		e
		jp		nz, p7Cloc_448A
		jp		ErrLinkXmit
; ---------------------------------------------------------------------------

p7Cloc_44A9:
		; ContinueGetByte+20p ...
		cp		2
		jr		z, p7Cloc_44DD
		ld		a, 1
		out		(0), a
		rr	c
		ld		de, 0FFFFh

p7Cloc_44B6:
		in		a, (0)
		and		3
		cp		2
		jp		z, p7Cloc_44C7
		dec		de
		ld		a, d
		or		e
		jp		nz, p7Cloc_44B6
		jr		p7Cloc_44F5
; ---------------------------------------------------------------------------

p7Cloc_44C7:
		ld		a, 0
		out		(0), a
		ld		d, 4

p7Cloc_44CD:
		dec		d
		jr		z, p7Cloc_44D8
		in		a, (0)
		and		3
		cp		3
		jr		nz, p7Cloc_44CD

p7Cloc_44D8:
		djnz	p7Cloc_447F
		ld		a, 0
		ret
; ---------------------------------------------------------------------------

p7Cloc_44DD:
		ld		a, 2
		out		(0), a
		rr	c
		ld		de, 0FFFFh

p7Cloc_44E6:
		in		a, (0)
		and		3
		cp		1
		jp		z, p7Cloc_44C7
		dec		de
		ld		a, d
		or		e
		jp		nz, p7Cloc_44E6

p7Cloc_44F5:
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_44F8:
		jp		p7Cloc_442B
; End of function p7Csub_447D

; ---------------------------------------------------------------------------

p7Cloc_44FB:
		call	p7Csub_6F33
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		set		indicOnly, (iy+indicFlags)
		call	Page7C_2D87
		res		6, (iy+25h)
		ld		a, 10h
		ld		(sndRecState), a
		call	DeselectAllVars
		call	j_ClrWindow
		ld		hl, aWaiting
		ld		a, 34h ; '4'
		call	p7Csub_658D
		call	p7Csub_60D7
		xor		a
		ld		(ioFlag), a
		call	Get4BytesCursor
		cp		6
		jr		z, p7Cloc_456A
		cp		68h ; 'h'
		jr		nz, p7Cloc_44F5
		call	SendAck
		call	popErrorHandleR
		jp		p7Cloc_44FB
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_453D:
		call	SendAck
		call	popErrorHandleR
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	Get4BytesCursor
		cp		6
		jp		nz, JErrorNo
		call	GetSmallPacket
		jp		p7Cloc_5173
; END OF FUNCTION CHUNK	FOR ReceiveVar

; =============== S U B	R O U T	I N E =======================================


p7Csub_4557:
		; ReceiveVar+2FBp
		ld		a, (unk_867F)
		and		1Fh
		bit		IDis82h, (iy+linkFlags)
		ret		z
		cp		0Bh
		ret		c
		add		a, 4
		ld		(unk_867F), a
		ret
; End of function p7Csub_4557

; ---------------------------------------------------------------------------

p7Cloc_456A:
		ld		a, (header)
		cp		83h ; '�'
		jr		z, p7Cloc_458B
		cp		3
		jr		z, p7Cloc_458B
		cp		13h
		jr		z, p7Cloc_458B
		cp		82h ; '�'
		jr		z, p7Cloc_4585
		cp		2
		jr		z, p7Cloc_4585
		cp		12h
		jr		nz, p7Cloc_458F

p7Cloc_4585:
		set		IDis82h, (iy+linkFlags)
		jr		p7Cloc_458F
; ---------------------------------------------------------------------------

p7Cloc_458B:
		set		IDis83h, (iy+linkFlags)

p7Cloc_458F:
		call	GetSmallPacket
		call	p7Csub_6A30
		jp		nc, p7Cloc_464E
		call	p7Csub_4557
		cp		13h
		jp		z, p7Cloc_4674
		ld		a, (unk_867F)
		cp		24h ; '$'
		jp		nz, p7Cloc_45B3
		ld		a, (header)
		cp		73h ; 's'
		jp		nz, JError
		jp		p7Cloc_5173
; ---------------------------------------------------------------------------

p7Cloc_45B3:
		cp		23h ; '#'
		jr		nz, p7Cloc_4620
		ld		a, 38h ; '8'
		call	p7Csub_5B03
		xor		a
		ld		(kbdKey), a
		ld		(keyExtend), a
		call	Page7C_2DCF

p7Cloc_45C6:
		res		onInterrupt, (iy+onFlags)
		ei
		call	j_getkey
		ld		(kbdKey), a
		call	j_PULLDOWNCHK
		di
		jr		c, p7Cloc_45C6
		res		onInterrupt, (iy+onFlags)
		cp		1Ah
		jr		nz, p7Cloc_45E2
		jp		p7Cloc_5852
; ---------------------------------------------------------------------------

p7Cloc_45E2:
		cp		40h ; '@'
		jr		z, p7Cloc_45EB
		cp		15h
		jp		nz, p7Cloc_45C6

p7Cloc_45EB:
		call	p7Csub_6F33
		call	p7Csub_626B
		call	popErrorHandleR
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_430F
		ld		a, 73h ; 's'
		ld		(header), a
		ld		a, 1
		ld		(ioData+1), a
		ld		bc, 0
		ld		(unk_8676), bc
		ld		de, 5
		call	Page7C_2C4F
		call	p7Csub_4306
		call	popErrorHandleR
		call	Page7C_2DCF
		jp		p7Cloc_4E18
; ---------------------------------------------------------------------------

p7Cloc_4620:
		cp		25h ; '%'
		jp		nz, p7Cloc_4630
		ld		a, (header)
		cp		73h ; 's'
		jp		nz, JError
		jp		p7Cloc_5157
; ---------------------------------------------------------------------------

p7Cloc_4630:
		cp		28h ; '('
		jp		nz, p7Cloc_4646
		set		6, (iy+25h)
		call	p7Csub_5580
		call	popErrorHandleR
		res		6, (iy+25h)
		jp		p7Cloc_44FB
; ---------------------------------------------------------------------------

p7Cloc_4646:
		cp		22h ; '"'
		jp		z, JError
		jp		p7Cloc_4759
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_464E:
		; ReceiveVar+2F8j
		ld		hl, 867Fh
		rst		20h
		call	popErrorHandleR
		ld		b, 41h ; 'A'
		push	bc
		call	Page7C_2DCF
		call	OP1ToOP4
		ld		a, (sndRecState)
		cp		15h
		jr		nz, p7Cloc_466D

p7Cloc_4665:
		ld		a, 4
		call	SendSkipExitPacket
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_466D:
		ld		a, 3
		pop		bc
		call	Page0Call_2E29
		ret
; END OF FUNCTION CHUNK	FOR ReceiveVar
; ---------------------------------------------------------------------------

p7Cloc_4674:
		bit		IDis82h, (iy+linkFlags)
		jp		nz, JErrorNo

p7Cloc_467B:
		call	p7Csub_6444
		jp		nz, JErrorNo
		ld		a, (header)
		cp		73h ; 's'
		jr		z, p7Cloc_468D
		cp		23h ; '#'
		jp		nz, JErrorNo

p7Cloc_468D:
		call	popErrorHandleR
		call	Page7C_2DCF
		ld		hl, (unk_8683+1)
		ld		(OP3+6), hl
		ld		hl, (ioData)
		ld		(OP3), hl
		ld		hl, (unk_867F+1)
		ld		(OP3M), hl
		ld		de, (unk_8681+1)
		ld		(OP3+4), de
		add		hl, de
		push	hl
		call	Page0Call_2E2F
		ld		hl, 0FE67h
		or		a
		sbc		hl, de
		ld		de, userMem
		or		a
		sbc		hl, de
		ex		de, hl
		pop		hl
		or		a
		sbc		hl, de
		jr		z, p7Cloc_46C7
		jr		nc, p7Cloc_46DC

p7Cloc_46C7:
		ld		a, (sndRecState)
		cp		15h
		jr		z, p7Cloc_46FB
		ld		a, 13h
		ld		(sndRecState), a
		xor		a
		ld		(winTop), a
		ld		a, 35h ; '5'
		jp		p7Csub_5B03
; ---------------------------------------------------------------------------

p7Cloc_46DC:
		ld		(ioData), hl
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		ld		a, 3
		ld		de, 3
		call	CancelTransmission
		call	popErrorHandleR
		ld		a, (sndRecState)
		cp		15h
		jp		nz, p7Cloc_44FB
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_46F8:
		jp		JErrorNo
; END OF FUNCTION CHUNK	FOR ReceiveVar
; ---------------------------------------------------------------------------

p7Cloc_46FB:
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		jr		p7Cloc_470E
; ---------------------------------------------------------------------------

p7Cloc_4703:
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		ld		a, 14h
		ld		(sndRecState), a

p7Cloc_470E:
		call	p7Csub_4190
		ld		hl, ioFlag
		set		1, (hl)
		ld		bc, (OP3)
		ld		de, flags
		call	GetDataPacket
		ld		bc, (OP3M)
		ld		de, userMem
		call	GetDataPacket
		ld		hl, symTable
		ld		bc, (OP3+4)
		or		a
		sbc		hl, bc
		ex		de, hl
		inc		de
		call	GetDataPacket
		ld		hl, (OP3+6)
		ld		de, userMem
		or		a
		sbc		hl, de
		jr		z, p7Cloc_474C
		ld		b, h
		ld		c, l
		ld		de, 1
		call	DELVAR3C

p7Cloc_474C:
		call	Page0Call_2EEF
		call	Page0Call_2D45
		xor		a
		ld		(unk_9C87), a
		jp		p7Cloc_4C43
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_4759:
		; ReceiveVar+2FEj
		cp		12h
		jr		z, p7Cloc_46F8
		call	popErrorHandleR
		call	p7Csub_6B25
		ld		a, 11h
		ld		hl, sndRecState
		cp		(hl)
		jr		z, ReceiveVar
		ld		(hl), a
		ld		hl, 0FF01h
		ld		(varCurrent), hl
		call	j_ClrWindow
		ld		hl, aReceiving
		ld		a, 35h ; '5'
		call	p7Csub_658D
		call	p7Csub_60D7
		ld		a, 1
		ld		(winTop), a
		call	j_HomeUp
		xor		a
		ld		(ioFlag), a
; END OF FUNCTION CHUNK	FOR ReceiveVar

; =============== S U B	R O U T	I N E =======================================


ReceiveVar:















		ld		hl, 867Fh
		rst		20h
		bit		IDis95h, (iy+linkFlags)
		call	nz, OP6ToOP1
		call	CkOP1Real
		cp		15h
		jr		nc, p7Cloc_47D3
		cp		0Fh
		jr		c, p7Cloc_47D3
		call	SetTblGraphDraw
		call	CkOP1Real
		call	p7Csub_6E29
		set		7, (hl)
		sub		0Fh
		call	Page0Call_2DF9
		ld		(OP2), hl
		push	hl
		ld		hl, link_var_error_handler
		call	pushErrorHandleR
		call	OP1ToOP4
		ld		bc, (ioData)
		push	bc
		ld		de, (OP2)
		jp		p7Cloc_49C9
; End of function ReceiveVar


; =============== S U B	R O U T	I N E =======================================


p7Csub_47CB:
		; ReceiveVar+251p ...
		push	hl
		ld		hl, ioNewData
		bit		7, (hl)
		pop		hl
		ret
; End of function p7Csub_47CB

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_47D3:
		; ReceiveVar+14j
		ld		(OP2), a
		or		a
		jr		nz, p7Cloc_47E4
		ld		hl, (ioData)
		ld		de, 9
		sbc		hl, de
		jp		nz, ErrDataType

p7Cloc_47E4:
		call	p7Csub_47CB
		jr		z, p7Cloc_47FB
		call	Chk_Batt_Low
		jp		z, Page7C_2E89
		ld		hl, (ioData)
		ld		(unk_83F7), hl
		ld		hl, 4
		ld		(ioData), hl

p7Cloc_47FB:
		call	ChkFindSym
		jp		c, ReceiveVarData
		ld		a, (OP2)
		ld		(OP1), a
		ld		hl, (ioData)
		ld		(OP3), hl
		call	PushRealO1
		call	OP1ToOP4
		ld		a, (sndRecState)
		cp		15h
		jp		z, ReceiveVarDataExists
		call	Page7C_2DCF
		call	ChkFindSym
		call	Page7C_2DB7
		jp		z, ReceiveVarDataExists
		call	Page0Call_2E0B
		ret
; END OF FUNCTION CHUNK	FOR ReceiveVar
; ---------------------------------------------------------------------------

Page7C_2C67:
		ld		a, 2
		ld		b, 37h ; '7'
		call	Page0Call_2E17
		ld		a, (curRow)
		push	af
		ld		a, 7
		ld		(curRow), a
		ld		a, 1
		ld		(curRow+1), a
		ld		hl, 8479h
		call	j_PutS
		ld		a, 14h
		ld		(varClass), a
		ld		(varType), a
		call	Page0Call_2DF3
		pop		af
		ld		(curRow), a
		xor		a
		ld		(kbdKey), a
		ld		(keyExtend), a
		call	Page7C_2DCF

p7Cloc_485F:

		res		onInterrupt, (iy+onFlags)
		ei
		call	j_getkey
		ld		(kbdKey), a
		call	j_PULLDOWNCHK
		di
		jr		c, p7Cloc_485F
		res		onInterrupt, (iy+onFlags)
		cp		19h
		jr		nz, p7Cloc_489E
		call	p7Csub_626B
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_430F
		ld		a, 73h ; 's'
		ld		(header), a
		ld		a, 92h ; '�'
		ld		(header+1), a
		call	Send4Bytes
		call	p7Csub_4306
		call	popErrorHandleR
		call	p7Csub_6B25
		ld		a, 1
		jr		p7Cloc_48AF
; ---------------------------------------------------------------------------

p7Cloc_489E:
		cp		18h
		jr		nz, p7Cloc_48B3
		call	p7Csub_626B
		ld		a, (unk_8433)
		call	j_DeleteApp
		call	p7Csub_6B25
		xor		a

p7Cloc_48AF:
		ld		(appInfo), a
		ret
; ---------------------------------------------------------------------------

p7Cloc_48B3:
		cp		40h ; '@'
		jr		z, p7Cloc_48BB
		cp		15h
		jr		nz, p7Cloc_48EB

p7Cloc_48BB:
		call	p7Csub_626B
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_430F
		ld		a, 73h ; 's'
		ld		(header), a
		xor		a
		ld		(ioData+1), a
		ld		bc, 0
		ld		(unk_8676), bc
		ld		de, 5
		call	Page7C_2C4F
		call	p7Csub_4306
		call	popErrorHandleR
		set		indicOnly, (iy+indicFlags)
		ld		a, 2
		jr		p7Cloc_48AF
; ---------------------------------------------------------------------------

p7Cloc_48EB:
		jp		p7Cloc_485F
; ---------------------------------------------------------------------------

Page7C_2C6D:
		call	Get4BytesNC
		ld		a, (header+1)
		cp		92h ; '�'
		jr		nz, p7Cloc_48FC
		ld		a, 2
		jr		p7Cloc_4902
; ---------------------------------------------------------------------------

p7Cloc_48FC:
		cp		56h ; 'V'
		jp		nz, JError
		xor		a

p7Cloc_4902:
		ld		(appInfo), a
		ret
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

ReceiveVarDataExists:
		; ReceiveVar+98j ...
		call	CpyTo1FPST
		call	OP1ToOP4
		call	ChkFindSym
		push	af
		call	IsBZero
		jr		nz, p7Cloc_494C
		pop		af
		ex		de, hl
		call	DataSize
		ld		hl, (OP3)
		ld		(ioData), hl
		sbc		hl, de
		jr		c, p7Cloc_4930
		jr		z, p7Cloc_4930
		call	EnoughMem
		jr		nc, p7Cloc_4930
		call	FPOPREAL
		jr		p7Cloc_4976
; ---------------------------------------------------------------------------

p7Cloc_4930:
		; ReceiveVar+198j ...
		call	page0_16C4
		jr		nz, p7Cloc_4940
		call	OP1ToOP4
		di
		call	j_DelRes
		ei
		call	OP4ToOP1

p7Cloc_4940:
		call	page0_16F4
		call	DelVarArc
		call	PopRealO1
		xor		a
		jr		p7Cloc_4959
; ---------------------------------------------------------------------------

p7Cloc_494C:
		pop		af
		call	DelVarArc
		call	PopRealO1
		call	OP4ToOP1

ReceiveVarData:

		call	page0_18AE

p7Cloc_4959:
		ld		hl, (ioData)
		jr		p7Cloc_495E

p7Cloc_495E:
		call	page0_17B0
		jr		nz, p7Cloc_4968
		call	CMPPRGNAMLEN
		jr		p7Cloc_4971
; ---------------------------------------------------------------------------

p7Cloc_4968:
		call	ISO1NONTEMPLST
		jr		nz, p7Cloc_4971
		call	CMPPRGNAMLEN
		inc		a

p7Cloc_4971:
		; ReceiveVar+1DFj
		call	CMPMEMNEED
		jr		nc, p7Cloc_498E

p7Cloc_4976:

		call	Page7C_2DCF
		call	OP1ToOP4
		ld		a, (sndRecState)
		cp		15h
		ld		a, 3
		call	z, SendSkipExitPacket
		ld		a, 3
		ld		b, 34h ; '4'
		call	Page0Call_2E17
		ret
; ---------------------------------------------------------------------------

p7Cloc_498E:
		ld		(OP2), bc
		push	bc
		ld		hl, link_var_error_handler
		call	pushErrorHandleR
		set		indicOnly, (iy+indicFlags)
		ld		bc, (OP2)
		push	bc
		call	page0_17B0
		jr		z, p7Cloc_49B3
		call	ISO1NONTEMPLST
		jr		nz, p7Cloc_49BD
		push	bc
		call	CMPPRGNAMLEN
		inc		a
		jr		p7Cloc_49B7
; ---------------------------------------------------------------------------

p7Cloc_49B3:
		push	bc
		call	CMPPRGNAMLEN

p7Cloc_49B7:
		pop		bc
		call	CREATEPVAR4
		jr		p7Cloc_49C0
; ---------------------------------------------------------------------------

p7Cloc_49BD:
		call	CREATEVAR3

p7Cloc_49C0:
		ld		a, (sndRecState)
		cp		15h
		jr		z, p7Cloc_49C9
		set		7, (hl)

p7Cloc_49C9:
		; ReceiveVar+239j
		ld		a, (unk_8688)
		dec		hl
		dec		hl
		ld		(hl), a
		push	de
		call	OP4ToOP1
		call	p7Csub_61F5
		ld		hl, ioFlag
		set		1, (hl)
		pop		de
		pop		bc
		call	p7Csub_47CB
		jp		z, p7Cloc_4A2F
		di
		ld		hl, link_var_error_handler2
		call	pushErrorHandleR
		call	ChkFindSym
		ld		(chkDelPtr3), hl
		ld		a, (OP1+1)
		cp		5Dh ; ']'
		jr		nz, p7Cloc_4A00
		push	bc
		push	de
		push	hl
		call	Page0Call_321F
		pop		hl
		pop		de
		pop		bc

p7Cloc_4A00:
		call	p7Csub_7145
		push	af
		set		noDataWrite, (iy+groupFlags)
		call	Page0Call_2EAD
		pop		af
		ld		hl, (unk_83F1)
		ld		(hl), a
		call	popErrorHandleR
		ld		hl, (unk_83F3)
		ld		de, 4
		call	DelMem
		call	p7Csub_4190
		ld		de, (unk_83FB)
		ld		bc, (unk_83F7)
		call	GetDataPacket
		call	Page7C_2C91
		jr		p7Cloc_4A39
; ---------------------------------------------------------------------------

p7Cloc_4A2F:
		push	bc
		push	de
		call	p7Csub_4190
		pop		de
		pop		bc
		call	GetDataPacket

p7Cloc_4A39:
		call	Page7C_2F91
		call	page0_18AE
		jr		nc, p7Cloc_4A5A
		rst		10h
		ld		(hl), 3
		push	af
		ld		a, (sndRecState)
		cp		15h
		jr		z, p7Cloc_4A4E
		set		7, (hl)

p7Cloc_4A4E:
		pop		af
		ld		(chkDelPtr3), hl
		ld		(chkDelPtr1), de
		ld		h, a
		call	Page0Call_380D

p7Cloc_4A5A:
		ld		hl, ioFlag
		res		1, (hl)
		ld		a, (sndRecState)
		cp		15h
		call	nz, Page0Call_2DE7
		call	popErrorHandleR
		pop		bc
		ld		a, (sndRecState)
		cp		15h
		ret		z

p7Cloc_4A71:
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	Get4BytesCursor
		cp		6
		jr		nz, p7Cloc_4A8D
		call	GetSmallPacket
		call	p7Csub_6A30
		jp		nc, p7Cloc_464E
		call	p7Csub_4557
		jp		p7Cloc_4759
; ---------------------------------------------------------------------------

p7Cloc_4A8D:
		cp		68h ; 'h'
		jp		z, p7Cloc_453D
		cp		92h ; '�'
		jp		nz, p7Cloc_4B5F
		call	SendAck
		call	popErrorHandleR

p7Cloc_4A9D:
		res		IDis82h, (iy+linkFlags)

Page7C_2CD9:
		call	Page7C_2DCF
		ld		a, (ioFlag)
		bit		4, a
		jp		z, p7Cloc_4E18
		bit		5, a
		jp		z, p7Cloc_4E3D
		ld		a, 2
		ld		(sndRecState), a
		xor		a
		ld		(ioFlag), a
		call	Page7C_2F91
		ld		a, (curRow)
		ld		b, a
		dec		b
		call	CkOP1Real
		cp		0Fh
		jr		c, p7Cloc_4ACD
		cp		14h
		jr		c, p7Cloc_4ADA

p7Cloc_4ACD:
		ld		hl, 8479h
		call	page0_17B0
		ld		a, 0FEh	; '�'
		jr		z, p7Cloc_4AD8
		inc		hl

p7Cloc_4AD8:
		ld		(hl), a
		inc		b

p7Cloc_4ADA:
		; ReceiveVar+363j
		push	bc

p7Cloc_4ADB:
		call	j_SrchVLstDn
		jr		nc, p7Cloc_4AE6
		pop		bc
		call	Page7C_2F91
		jr		p7Cloc_4AF1
; ---------------------------------------------------------------------------

p7Cloc_4AE6:
		call	p7Csub_4B12
		jr		z, p7Cloc_4ADB
		call	Page7C_2DC9
		pop		bc
		djnz	p7Cloc_4ADA

p7Cloc_4AF1:
		call	j_ClrScrn
		call	j_HomeUp
		jr		p7Cloc_4AFC
; ---------------------------------------------------------------------------

p7Cloc_4AF9:
		call	j_moveDown

p7Cloc_4AFC:
		call	Page7C_2DC9
		call	Page0Call_2DED
		call	Page7C_2F91

p7Cloc_4B05:
		call	j_SrchVLstUp
		jp		c, p7Cloc_4E3D
		call	p7Csub_4B12
		jr		z, p7Cloc_4B05
		jr		p7Cloc_4AF9
; END OF FUNCTION CHUNK	FOR ReceiveVar

; =============== S U B	R O U T	I N E =======================================


p7Csub_4B12:
		; ReceiveVar+37Fp ...
		ld		b, a
		call	CkOP1Real
		cp		14h
		jr		nz, p7Cloc_4B22

p7Cloc_4B1A:
		call	NZIf83Plus
		jr		nz, p7Cloc_4B22
		ld		a, b
		and		(hl)
		ret
; ---------------------------------------------------------------------------

p7Cloc_4B22:
		bit		7, (hl)
		ret
; End of function p7Csub_4B12


; =============== S U B	R O U T	I N E =======================================


p7Csub_4B25:
		ld		b, a
		call	CkOP1Real
		cp		14h
		jr		nz, p7Cloc_4B36
		call	NZIf83Plus
		jr		nz, p7Cloc_4B36
		ld		a, b
		xor		(hl)
		ld		(hl), a
		ret
; ---------------------------------------------------------------------------

p7Cloc_4B36:
		ld		a, (hl)
		xor		80h ; '�'
		ld		(hl), a
		ret
; End of function p7Csub_4B25


; =============== S U B	R O U T	I N E =======================================


p7Csub_4B3B:
		ld		b, a
		call	CkOP1Real
		cp		14h
		jr		nz, p7Cloc_4B4C
		call	NZIf83Plus
		jr		nz, p7Cloc_4B4C
		ld		a, b
		xor		(hl)
		ld		(hl), a
		ret
; ---------------------------------------------------------------------------

p7Cloc_4B4C:
		res		7, (hl)
		ret
; End of function p7Csub_4B3B

; ---------------------------------------------------------------------------

p7Cloc_4B4F:
		call	p7Csub_6444
		jp		nz, JErrorNo
		ld		a, 5
		ld		(sndRecState), a
		ld		a, 32h ; '2'
		jp		p7Csub_5B03
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_4B5F:
		; p7Csub_4B62+67j
		jp		JErrorNo
; END OF FUNCTION CHUNK	FOR ReceiveVar

; =============== S U B	R O U T	I N E =======================================


p7Csub_4B62:



		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_6444
		jp		nz, JErrorNo
		set		indicOnly, (iy+indicFlags)
		ld		a, 13h
		ld		(unk_867F), a
		ld		hl, 13A5h
		ld		(ioData), hl
		ld		hl, (FPS)
		ld		de, userMem
		or		a
		sbc		hl, de
		ld		(unk_867F+1), hl
		ld		(OP3), hl
		ld		hl, symTable
		ld		de, (OPS)
		sbc		hl, de
		ld		(unk_8681+1), hl
		ld		(OP3M), hl
		ld		hl, userMem
		ld		(unk_8683+1), hl
		xor		a
		ld		(unk_8686), a
		ld		(unk_8687), a
		call	p7Csub_6FEA
		ld		(unk_8688), a
		ld		hl, 0Ch
		call	p7Csub_404A
		ld		a, (sndRecState)
		cp		0Ah
		jr		nz, p7Cloc_4BC0
		call	Get4BytesNC
		jr		p7Cloc_4BC3
; ---------------------------------------------------------------------------

p7Cloc_4BC0:
		call	Get4BytesCursor

p7Cloc_4BC3:
		cp		9
		jr		z, p7Cloc_4C1D
		cp		36h ; '6'
		jr		nz, p7Cloc_4B5F
		call	GetSmallPacket2
		call	popErrorHandleR
		call	Page7C_2DCF
		ld		a, (unk_867C)
		cp		1
		jp		z, Page7C_3A0B
		cp		2
		jr		nz, p7Cloc_4BEF
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_418C
		call	popErrorHandleR
		jp		Page7C_3A0B
; ---------------------------------------------------------------------------

p7Cloc_4BEF:
		cp		3
		jp		nz, ErrLinkXmit
		ld		a, 4
		ld		b, 36h ; '6'
		call	Page0Call_2E17
		ld		bc, 0Ch
		ld		de, 3
		ld		hl, aDeleteBytes
		ld		a, 36h ; '6'
		call	p7Csub_658D
		ld		bc, 15h
		call	p7Csub_60ED
		ld		hl, 703h
		ld		(curRow), hl
		ld		hl, (ioData)
		call	j_DispHL
		ei
		ret
; ---------------------------------------------------------------------------

p7Cloc_4C1D:
		call	SendAck
		ld		a, 2
		ld		(ioFlag), a
		ld		hl, flags
		ld		de, 13A5h
		call	SendRAMVarData
		ld		hl, userMem
		ld		de, (OP3)
		call	SendRAMVarData
		ld		hl, (OPS)
		inc		hl
		ld		de, (OP3M)
		call	SendRAMVarData

p7Cloc_4C43:
		call	popErrorHandleR
		ld		a, (sndRecState)
		cp		0Ah
		ret		z
		ld		a, (sndRecState)
		cp		15h
		jp		z, JErrorNo
		call	Page7C_2DCF
		xor		a
		ld		(winTop), a
		call	j_ClrScrn
		call	j_HomeUp
		ld		hl, aMemoryBackup
		ld		a, 3Ch ; '<'
		call	p7Csub_6586
		jp		p7Cloc_4E18
; End of function p7Csub_4B62


; =============== S U B	R O U T	I N E =======================================


Page7C_2DB7:

		call	CkOP1Real
		call	equ_or_newequ
		ret		nz
		ld		a, 3
		ld		(OP1), a

Page7C_2CFD:
		push	hl
		dec		hl
		dec		hl
		dec		hl
		ld		e, (hl)
		dec		hl
		ld		d, (hl)
		ex		de, hl
		ld		a, (hl)
		inc		hl
		or		(hl)
		pop		hl
		ret
; End of function Page7C_2DB7

; ---------------------------------------------------------------------------

p7Cloc_4C85:
		call	p7Csub_6F33
		ld		a, (varClass)
		cp		14h
		jp		z, p7Cloc_5DE5
		ld		a, 0FFh
		ld		(varCurrent), a
		ld		a, (sndRecState)
		cp		5
		jp		z, p7Csub_4B62
		ld		hl, p7Cloc_62C4
		call	pushErrorHandleR
		call	SendReadyPacket
		call	popErrorHandleR
		ld		a, 8
		ld		(sndRecState), a
		call	j_ClrScrn
		call	j_HomeUp
		xor		a
		ld		(ioFlag), a
		ld		(winTop), a
		call	Page7C_2D09
		ld		(OP1), a
		cp		1
		ld		a, 40h ; '@'
		jr		nz, p7Cloc_4CCE
		ld		a, 0FFh
		ld		(OP1M), a
		ld		a, 5Dh ; ']'

p7Cloc_4CCE:
		ld		(OP1+1), a

p7Cloc_4CD1:
		call	j_SrchVLstUp
		jr		nc, p7Cloc_4CF7

p7Cloc_4CD6:
		ld		hl, ioFlag
		bit		6, (hl)
		jp		z, p7Cloc_4E0E

p7Cloc_4CDE:
		ld		a, 14h
		ld		(varClass), a
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		set		indicOnly, (iy+indicFlags)
		xor		a
		ld		(ioFlag), a
		call	j_moveDown
		jp		p7Cloc_5E00
; ---------------------------------------------------------------------------

p7Cloc_4CF7:
		call	NZIf83Plus
		jr		nz, p7Cloc_4D14
		push	af
		call	CkOP1Real
		cp		14h
		jr		nz, p7Cloc_4D13
		pop		af
		ld		hl, 8697h
		ld		b, 0Eh
		xor		a

p7Cloc_4D0B:
		cp		(hl)
		jr		nz, p7Cloc_4CDE
		inc		hl
		djnz	p7Cloc_4D0B
		jr		p7Cloc_4CD6
; ---------------------------------------------------------------------------

p7Cloc_4D13:
		pop		af

p7Cloc_4D14:
		call	p7Csub_4B12
		jr		z, p7Cloc_4CD1
		ld		(OP2EXT), hl
		call	p7Csub_6A89
		jr		c, p7Cloc_4D37
		call	Page0Call_2EA7
		call	p7Csub_6A3D
		jr		c, p7Cloc_4D37
		call	Page7C_2DCF
		call	OP1ToOP4
		ld		a, 6
		ld		b, 41h ; 'A'
		call	Page0Call_2E29
		ret
; ---------------------------------------------------------------------------

p7Cloc_4D37:
		call	CkOP1Real
		cp		14h
		jr		nz, p7Cloc_4D46
		ld		hl, ioFlag
		set		6, (hl)
		jp		p7Cloc_4CD1
; ---------------------------------------------------------------------------

p7Cloc_4D46:
		ld		hl, p7Cloc_62C4
		call	pushErrorHandleR
		set		indicOnly, (iy+indicFlags)
		ld		hl, (OP2EXT)
		push	hl
		call	Page7C_2DC9
		call	Page0Call_2DE7
		pop		hl
		call	p7Csub_6A89
		jr		nc, p7Cloc_4D6C
		ld		de, 0
		ld		(OP2EXT), de
		call	Page0Call_2DF9
		jr		p7Cloc_4D78
; ---------------------------------------------------------------------------

p7Cloc_4D6C:
		dec		hl
		dec		hl
		dec		hl
		ld		e, (hl)
		dec		hl
		ld		d, (hl)
		dec		hl
		ld		a, (hl)
		ld		(OP2+8), a
		ex		de, hl

p7Cloc_4D78:
		call	CkOP1Real
		call	p7Csub_6A62
		push	hl
		push	de
		ld		a, (varClass)
		cp		0Ah
		jr		nz, p7Cloc_4D90
		ld		hl, 37Dh
		call	CpHLDE
		jr		nc, p7Cloc_4D90
		ex		de, hl

p7Cloc_4D90:
		ld		a, (OP1)
		and		1Fh
		ld		(OP1), a
		call	p7Csub_4006
		call	Get4BytesCursor
		push	af
		ld		a, (header)
		cp		73h ; 's'
		jr		z, p7Cloc_4DB7
		ld		a, (unk_867F)
		and		1Fh
		cp		14h
		jr		c, p7Cloc_4DB2

p7Cloc_4DAF:
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_4DB2:
		call	p7Cloc_6A43
		jr		nc, p7Cloc_4DAF

p7Cloc_4DB7:
		pop		af
		cp		9
		jr		z, p7Cloc_4DED
		cp		36h ; '6'
		jr		nz, p7Cloc_4DEA
		call	GetSmallPacket2
		pop		af
		pop		af
		ld		a, (unk_867C)
		cp		1
		jr		nz, p7Cloc_4DE6
		call	popErrorHandleR
		call	Page7C_2DCF

p7Cloc_4DD2:
		call	j_SrchVLstUp
		jp		c, p7Cloc_4DDD
		call	p7Csub_4B3B
		jr		p7Cloc_4DD2
; ---------------------------------------------------------------------------

p7Cloc_4DDD:
		ld		a, (ioFlag)
		and		10h
		jr		nz, p7Cloc_4E3D
		jr		p7Cloc_4E18
; ---------------------------------------------------------------------------

p7Cloc_4DE6:
		cp		2
		jr		z, p7Cloc_4DF5

p7Cloc_4DEA:
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_4DED:
		call	SendAck
		pop		de
		pop		hl
		call	p7Cloc_40C9

p7Cloc_4DF5:
		call	popErrorHandleR
		jp		p7Cloc_4CD1
; ---------------------------------------------------------------------------

p7Cloc_4DFB:
		xor		a
		ld		(ioFlag), a
		call	p7Csub_6023
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_634F
		call	popErrorHandleR
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_4E0E:
		; ReceiveVar+A35j ...
		call	Page7C_2DCF
		ld		a, (ioFlag)
		and		10h
		jr		nz, p7Cloc_4E31

p7Cloc_4E18:
		; ReceiveVar+31Dj ...
		xor		a
		ld		(ioFlag), a
		call	p7Csub_6023
; END OF FUNCTION CHUNK	FOR ReceiveVar

; =============== S U B	R O U T	I N E =======================================


p7Csub_4E1F:
		call	j_moveDown
		call	j_DispDone
		call	j_moveUp
		call	j_moveUp
		ei
		xor		a
		ld		(varClass), a
		ret
; End of function p7Csub_4E1F

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_4E31:
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_418C
		call	popErrorHandleR

p7Cloc_4E3D:
		; ReceiveVar+37Cj ...
		call	Page7C_2DCF
		ld		a, 2
		ld		(sndRecState), a
		call	p7Csub_4E1F
		call	Page7C_2E95
		ret
; END OF FUNCTION CHUNK	FOR ReceiveVar
; ---------------------------------------------------------------------------

p7Cloc_4E4C:
		jp		JErrorNo
; ---------------------------------------------------------------------------

GETVARCMD:
		call	NZIf83Plus
		jr		nz, p7Cloc_4E62
		ld		bc, 1689h
		in		a, (20h)
		and		1
		jr		z, p7Cloc_4E62

p7Cloc_4E5D:
		dec		bc
		ld		a, b
		or		c
		jr		nz, p7Cloc_4E5D

p7Cloc_4E62:
		set		comFailed, (iy+getSendFlg)
		res		IDis83h, (iy+linkFlags)
		ld		a, (iy+0Ch)
		push	af
		res		curAble, (iy+curFlags)
		ld		hl, p7Cloc_4F85
		call	pushErrorHandleR
		call	OP1ToOP6
		bit		IDis95h, (iy+linkFlags)
		jr		z, p7Cloc_4E93
		ld		hl, 104h
		ld		(OP1), hl
		ld		a, 41h ; 'A'
		ld		(OP1M), a
		ld		a, 1
		ld		(OP6), a
		jr		p7Cloc_4E9D
; ---------------------------------------------------------------------------

p7Cloc_4E93:
		bit		IDis82h, (iy+linkFlags)
		jr		nz, p7Cloc_4E9D
		set		IDis03h, (iy+linkFlags)

p7Cloc_4E9D:
		ld		de, 867Fh
		call	MovFrOP1
		ld		a, (sndRecState)
		cp		15h
		ld		a, 0A2h	; '�'
		jr		z, p7Cloc_4EAE
		ld		a, 0B7h	; '�'

p7Cloc_4EAE:
		set		indicOnly, (iy+indicFlags)
		ei
		ld		hl, 0Bh
		call	p7Csub_404C
		set		indicOnly, (iy+indicFlags)
		call	Get4BytesNC
		cp		36h ; '6'
		jr		nz, p7Cloc_4ECA
		call	GetSmallPacket2
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_4ECA:
		cp		6
		jp		nz, p7Cloc_4DEA
		call	GetSmallPacket
		call	p7Csub_6A30
		jp		nc, JErrorNo
		ld		a, (sndRecState)
		cp		15h
		jr		nz, p7Cloc_4EFD
		set		indicOnly, (iy+indicFlags)
		call	ReceiveVar
		set		indicOnly, (iy+indicFlags)
		bit		IDis95h, (iy+linkFlags)
		jr		z, p7Cloc_4EF3
		call	Convert85List

p7Cloc_4EF3:
		res		comFailed, (iy+getSendFlg)
		call	popErrorHandleR
		jp		p7Cloc_4F85
; ---------------------------------------------------------------------------

p7Cloc_4EFD:
		ld		a, 0FFh
		ld		(OP2EXT), a
		call	p7Csub_4190
		ld		de, OP1
		ld		bc, (ioData)
		call	GetDataPacket
		xor		a
		ld		(OP2EXT), a
		bit		IDis95h, (iy+linkFlags)
		jr		z, p7Cloc_4EF3
		ld		hl, OP1
		push	hl
		pop		de
		call	Convert85Real
		jr		p7Cloc_4EF3
; ---------------------------------------------------------------------------

SendVarCmd:
		di
		ld		a, (iy+0Ch)
		push	af
		res		curAble, (iy+curFlags)
		ld		hl, p7Cloc_4F85
		call	pushErrorHandleR
		ld		a, 0Bh
		ld		(sndRecState), a
		ld		a, 0C9h	; '�'
		set		indicOnly, (iy+indicFlags)
		call	Page7C_2D87
		set		IDis82h, (iy+linkFlags)
		call	SendVariable
		jr		p7Cloc_4EF3
; ---------------------------------------------------------------------------

SendScreenshot:
		ld		hl, p7Cloc_4F78
		call	pushErrorHandleR
		ld		hl, 300h
		ld		(ioData), hl
		ld		a, 12h
		ld		(unk_867F), a
		ld		hl, 3
		call	p7Csub_404A
		ld		a, b
		cp		3
		jr		z, p7Cloc_4F6A
		cp		13h
		jp		nz, p7Cloc_4E4C

p7Cloc_4F6A:
		call	Get4BytesCursor
		cp		9
		jp		nz, p7Cloc_4E4C
		call	SendScreenContents
		call	popErrorHandleR

p7Cloc_4F78:
		nop

; =============== S U B	R O U T	I N E =======================================


Page7C_2DCF:

		di
		res		indicOnly, (iy+indicFlags)
		ld		a, 5
		call	page0_AB9

p7Cloc_4F83:
		ei
		ret
; End of function Page7C_2DCF

; ---------------------------------------------------------------------------

p7Cloc_4F85:
		di
		pop		af
		bit		2, a
		jr		z, p7Cloc_4F8F
		set		curAble, (iy+curFlags)

p7Cloc_4F8F:
		jr		p7Cloc_4F78
; ---------------------------------------------------------------------------

keyscnlnk:
		di
		res		secondTimerEnabled, (iy+interruptFlags)
		call	NZIf83Plus
		jr		nz, p7Cloc_4FA3
		ld		b, a
		ld		a, (unk_9CAF)
		or		a
		ld		a, b
		jr		nz, p7Cloc_4FAB

p7Cloc_4FA3:
		call	CheckLinkLines
		jr		nz, p7Cloc_4F83
		call	p7Csub_6F33

p7Cloc_4FAB:
		call	Page7C_2D87
		res		6, (iy+25h)
		call	ApdSetup
		bit		7, (iy+36h)
		jr		z, p7Cloc_4FBF
		call	Page0Call_2CB5
		ret		z

p7Cloc_4FBF:
		ld		a, (ioErrState)
		push	af
		ld		a, (sndRecState)
		push	af
		ld		a, (ioFlag)
		push	af
		ld		hl, ioFlag
		res		1, (hl)
		ld		a, 7
		ld		(sndRecState), a
		ld		a, (iy+0Ch)
		push	af
		res		curAble, (iy+curFlags)
		ld		hl, link_handler
		call	pushErrorHandleR
		set		indicOnly, (iy+indicFlags)
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_5017
		ld		a, (unk_9CAF)
		or		a
		jr		z, p7Cloc_5017
		dec		a
		ld		(unk_9CAF), a
		ld		a, (unk_9CB2)
		ld		de, 9CB2h
		ld		hl, 9CB3h
		ld		bc, 0Fh
		ldir
		cp		41h ; 'A'
		jr		nz, p7Cloc_5012
		xor		a
		ld		(unk_9CAF), a
		ld		a, (unk_9CB2)
		jr		p7Cloc_505F
; ---------------------------------------------------------------------------

p7Cloc_5012:
		call	Page0Call_3051
		jr		p7Cloc_505C
; ---------------------------------------------------------------------------

p7Cloc_5017:
		ld		a, (ioData)
		call	ContinueGetByte
		bit		5, (iy+3Dh)
		jr		z, p7Cloc_505F
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_505C

p7Cloc_5029:
		in		a, (9)
		and		19h
		jr		z, p7Cloc_5059
		ld		a, (unk_9CAF)
		cp		0Fh
		jr		nc, p7Cloc_505C
		inc		a
		ld		(unk_9CAF), a
		call	ContinueGetByte
		ld		hl, 9CAFh
		ld		e, (hl)
		ld		d, 0
		ld		hl, 9CB1h
		add		hl, de
		bit		5, (iy+3Dh)
		jr		nz, p7Cloc_5056
		ld		b, a
		ld		a, 41h ; 'A'
		ld		(hl), a
		inc		hl
		ld		a, b
		ld		(hl), a
		jr		p7Cloc_505C
; ---------------------------------------------------------------------------

p7Cloc_5056:
		ld		(hl), a
		jr		p7Cloc_5029
; ---------------------------------------------------------------------------

p7Cloc_5059:
		call	p7Csub_6F20

p7Cloc_505C:
		jp		p7Cloc_5966
; ---------------------------------------------------------------------------

p7Cloc_505F:
		call	Get3Bytes
		ld		a, (header+1)
		cp		2Bh ; '+'
		jr		nz, p7Cloc_506F
		set		enableKeyEcho, (iy+hookflags1)
		jr		p7Cloc_50B2
; ---------------------------------------------------------------------------

p7Cloc_506F:
		cp		2Ch ; ','
		jr		nz, p7Cloc_5079
		res		enableKeyEcho, (iy+hookflags1)
		jr		p7Cloc_50B2
; ---------------------------------------------------------------------------

p7Cloc_5079:
		cp		29h ; ')'
		jr		nz, p7Cloc_5092
		in		a, (6)
		ld		(unk_9B7A), a
		ld		hl, p7Cloc_6ABC
		ld		(linkActivityHook), hl
		set		ignoreBPLink, (iy+hookflags1)
		set		bPLinkOn, (iy+hookflags1)
		jr		p7Cloc_50B2
; ---------------------------------------------------------------------------

p7Cloc_5092:
		cp		2Ah ; '*'
		jr		nz, p7Cloc_509C
		res		bPLinkOn, (iy+hookflags1)
		jr		p7Cloc_50B2
; ---------------------------------------------------------------------------

p7Cloc_509C:
		cp		68h ; 'h'
		jr		nz, p7Cloc_50B8
		call	Chk_Batt_Low
		jr		nz, p7Cloc_50B2
		ld		hl, 1000h
		push	hl
		call	p7Csub_430F
		pop		hl
		call	p7Cloc_42F8
		jr		p7Cloc_50B5
; ---------------------------------------------------------------------------

p7Cloc_50B2:
		call	SendAck

p7Cloc_50B5:
		jp		p7Cloc_5966
; ---------------------------------------------------------------------------

p7Cloc_50B8:
		cp		2Dh ; '-'
		jr		nz, p7Cloc_50FD
		call	SendAck
		call	Get4BytesNC
		cp		9
		jp		nz, JError
		call	SendAck
		ld		hl, ioData
		ld		(hl), 1
		inc		hl
		ld		(hl), 13h
		inc		hl
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80B7h
; ---------------------------------------------------------------------------
		ld		(hl), a
		inc		hl
		ld		(hl), b
		push	hl
		call	Chk_Batt_Low
		ld		a, 0
		jr		nz, p7Cloc_50E3
		ld		a, 1

p7Cloc_50E3:
		pop		hl
		inc		hl
		ld		(hl), a
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80BAh
; ---------------------------------------------------------------------------
		inc		hl
		ld		(hl), a
		ld		de, (localLanguage)
		inc		hl
		ld		(hl), e
		inc		hl
		ld		(hl), d
		ld		a, 15h
		ld		hl, 0Bh
		call	p7Csub_404C
		jr		p7Cloc_50B5
; ---------------------------------------------------------------------------

p7Cloc_50FD:
		cp		47h ; 'G'
		jr		nz, p7Cloc_5118
		ld		hl, 86B7h
		ld		(iMathPtr5), hl
		ld		hl, (unk_8676)
		ld		de, 20h	; ' '
		call	CpHLDE
		jp		nz, JError
		call	GetVariableData
		jr		p7Cloc_50B5
; ---------------------------------------------------------------------------

p7Cloc_5118:
		cp		74h ; 't'
		jr		nz, p7Cloc_5129
		ld		a, 47h ; 'G'
		ld		hl, 86B7h
		ld		de, 20h	; ' '
		call	SendRAMCmd
		jr		p7Cloc_50B5
; ---------------------------------------------------------------------------

p7Cloc_5129:
		cp		87h ; '�'
		jp		nz, p7Cloc_534D
		call	SendAck
		ld		a, (unk_8676)
		ld		(kbdKey), a
		ld		a, (unk_8676+1)
		or		a
		jr		z, p7Cloc_514D
		ld		b, a
		ld		a, (kbdKey)
		ld		(keyExtend), a
		ld		a, b
		ld		(kbdKey), a
		ld		a, (keyExtend)
		jr		p7Cloc_5150
; ---------------------------------------------------------------------------

p7Cloc_514D:
		ld		(keyExtend), a

p7Cloc_5150:
		set		5, (iy+1Fh)
		jp		p7Cloc_5966
; ---------------------------------------------------------------------------

p7Cloc_5157:
		set		6, (iy+25h)
		call	p7Csub_575D
		call	SendAck
		set		curLock, (iy+curFlags)
		call	popErrorHandleR
		res		6, (iy+25h)
		xor		a
		ld		(varClass), a
		jp		p7Cloc_44FB
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_5173:

		call	Chk_Batt_Low
		jp		z, p7Cloc_593F
		xor		a
		ld		(appInfo), a
		ld		a, (ioFlag)
		or		a
		call	z, Page0Call_3D05

p7Cloc_5184:
		call	p7Cloc_561B
		ld		a, (appInfo)
		or		a
		call	z, SendAck

p7Cloc_518E:
		call	Get4BytesCursor
		cp		92h ; '�'
		jp		z, p7Cloc_51B3
		cp		68h ; 'h'
		jr		nz, p7Cloc_519F
		call	p7Cloc_41B3
		jr		p7Cloc_518E
; ---------------------------------------------------------------------------

p7Cloc_519F:
		cp		6
		jp		nz, JErrorNo
		call	GetSmallPacket
		call	Chk_Batt_Low
		jp		z, p7Cloc_593F
		xor		a
		ld		(appInfo), a
		jr		p7Cloc_5184
; ---------------------------------------------------------------------------

p7Cloc_51B3:
		call	SendAck
		call	popErrorHandleR
		ld		hl, ioFlag
		bit		4, (hl)
		jp		nz, p7Cloc_4E3D
		jp		p7Cloc_4E0E
; END OF FUNCTION CHUNK	FOR ReceiveVar
; ---------------------------------------------------------------------------

p7Cloc_51C4:
		ld		b, 8
		ld		de, 8479h
		ld		hl, 8680h

p7Cloc_51CC:
		ld		a, (hl)
		ld		(de), a
		inc		de
		inc		hl
		djnz	p7Cloc_51CC
		call	j_FindApp
		jp		c, ErrUndefined
		call	SendApplication
		call	p7Csub_418C
		jp		p7Cloc_5966
; ---------------------------------------------------------------------------

p7Cloc_51E1:
		call	p7Csub_6530
		ld		hl, p7Cloc_59B8
		call	pushErrorHandleR
		set		indicOnly, (iy+indicFlags)
		ld		a, (unk_867F)
		cp		26h ; '&'
		jp		nz, p7Cloc_5321
		ld		a, 73h ; 's'
		ld		(header), a
		ld		a, 6
		ld		(header+1), a
		call	Page0Call_2B95
		jp		nz, p7Cloc_5257
		push	hl
		ld		e, (hl)
		inc		hl
		ld		d, (hl)
		dec		hl
		ld		a, 9
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8045h
; ---------------------------------------------------------------------------
		inc		hl
		inc		hl
		ld		(ioData), hl
		ld		de, 0Bh
		ld		(unk_8676), de
		ld		a, 26h ; '&'
		ld		(unk_867F), a
		ld		hl, ioData
		ld		a, 6
		call	SendRAMCmd
		call	Get4Bytes
		ld		a, (header+1)
		cp		9
		jp		nz, JErrorNo
		call	SendAck
		ld		a, 73h ; 's'
		ld		(header), a
		ld		a, 15h
		ld		(header+1), a
		ld		hl, (ioData)
		ld		(unk_8676), hl
		pop		hl
		ld		(iMathPtr5), hl
		call	SendPacket
		call	popErrorHandleR
		nop
		nop
		nop
		jp		p7Cloc_59B8
; ---------------------------------------------------------------------------

p7Cloc_5257:
		ld		a, 3
		call	Page7C_2C49
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_525F:
		call	Chk_Batt_Low
		jr		nz, p7Cloc_5272

p7Cloc_5264:
		ld		a, 0Ch
		call	SendSkipExitPacket
		ld		hl, 0
		ld		(curRow), hl
		jp		p7Cloc_593A
; ---------------------------------------------------------------------------

p7Cloc_5272:
		call	p7Csub_6530
		ld		hl, p7Cloc_598A
		call	pushErrorHandleR
		set		indicOnly, (iy+indicFlags)
		ld		a, (unk_867F)
		cp		27h ; '''
		jp		nz, p7Cloc_5321
		ld		a, 73h ; 's'
		ld		(header), a
		ld		a, 6
		ld		(header+1), a
		ld		bc, 0
		ld		(unk_8676), bc
		call	Send4Bytes
		call	ReceiveAck
		call	Get4Bytes
		nop
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	Page0Call_2B9B
		call	FlashWriteDisable
		jr		nz, p7Cloc_5306

p7Cloc_52BE:
		push	hl
		nop
		nop
		nop
		nop
		di
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	j_FindSwapSector
		inc		a
		inc		a
		call	Page0Call_2BA7
		call	FlashWriteDisable
		ld		hl, ramStart
		push	hl
		call	SendAck
		ld		de, 100h
		pop		hl
		call	SendRAMVarData
		call	Get4Bytes
		pop		hl
		ld		bc, 100h
		add		hl, bc
		ex		de, hl
		ld		hl, (unk_839F)
		sbc		hl, bc
		ld		(unk_839F), hl
		ex		de, hl
		jr		z, p7Cloc_531B
		jr		c, p7Cloc_531B
		jr		p7Cloc_52BE
; ---------------------------------------------------------------------------

p7Cloc_5306:
		bit		batteriesGood, (iy+batteryFlags)
		set		batteriesGood, (iy+batteryFlags)
		jp		z, p7Cloc_5264
		call	SendAck
		ld		h, 5Ah ; 'Z'
		call	Send4BytePacket
		jr		p7Cloc_5321
; ---------------------------------------------------------------------------

p7Cloc_531B:
		call	SendAck
		call	p7Csub_418C

p7Cloc_5321:
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	Page0Call_2BAD
		call	p7Cloc_6D10
		jp		JErrorNo

; =============== S U B	R O U T	I N E =======================================


p7Csub_533D:
		call	Page0Call_2BB3
		ld		a, (appInfo)
		or		a
		jr		nz, locret_534C
		call	Get4BytesNC
		ld		a, (header+1)

locret_534C:
		ret
; End of function p7Csub_533D

; ---------------------------------------------------------------------------

p7Cloc_534D:
		push	af
		ld		a, (header)
		cp		3
		jr		z, p7Cloc_5359
		cp		13h
		jr		nz, p7Cloc_535D

p7Cloc_5359:
		set		IDis83h, (iy+linkFlags)

p7Cloc_535D:
		pop		af
		cp		6Eh ; 'n'
		jp		z, p7Cloc_702E
		cp		6Fh ; 'o'
		jp		z, p7Cloc_70B0
		cp		6Dh ; 'm'
		jr		nz, p7Cloc_5381
		ld		a, (header)
		cp		2
		jr		z, p7Cloc_5377
		cp		12h
		jr		nz, p7Cloc_537B

p7Cloc_5377:
		set		IDis82h, (iy+linkFlags)

p7Cloc_537B:
		call	SendScreenContents

p7Cloc_537E:
		jp		p7Cloc_5966
; ---------------------------------------------------------------------------

p7Cloc_5381:
		cp		0CAh ; '�'
		jr		z, p7Cloc_5389
		cp		0C9h ; '�'
		jr		nz, p7Cloc_53F8

p7Cloc_5389:
		call	GetSmallPacket
		call	p7Csub_6A30
		jp		nc, p7Cloc_4665
		ld		a, (unk_867F)
		cp		22h ; '"'
		jp		z, p7Cloc_5869
		call	p7Csub_6421
		cp		12h
		jr		z, p7Cloc_537E
		call	p7Csub_6530
		ld		a, (unk_867F)
		ld		hl, 5F1h
		call	pushErrorHandleR
		push	af
		ld		a, 15h
		ld		(sndRecState), a
		call	p7Csub_6B25
		pop		af
		cp		13h
		jp		z, p7Cloc_467B
		ld		a, (header+1)
		push	af
		call	ReceiveVar
		call	p7Csub_430F
		call	Get4Bytes
		ld		a, (header+1)
		push	af
		ld		a, (header)
		call	p7Csub_4306
		ld		b, a
		pop		af
		cp		92h ; '�'
		jp		nz, JErrorNo
		pop		af
		cp		0CAh ; '�'
		jr		nz, p7Cloc_53EF
		ld		a, (OP1)
		cp		16h
		jr		nz, p7Cloc_53EF
		call	popErrorHandleR
		call	Page7C_2DCF
		jp		p7Cloc_54EA
; ---------------------------------------------------------------------------

p7Cloc_53EF:
		call	popErrorHandleR
		call	Page7C_2DCF
		jp		JForceCmdNoChar
; ---------------------------------------------------------------------------

p7Cloc_53F8:
		cp		0A2h ; '�'
		jr		nz, p7Cloc_5451
		ld		a, (header)
		cp		83h ; '�'
		jr		nz, p7Cloc_5407
		set		IDis83h, (iy+linkFlags)

p7Cloc_5407:
		call	GetSmallPacket
		ld		hl, 867Fh
		ld		a, (hl)
		cp		26h ; '&'
		jp		z, p7Cloc_51E1
		cp		27h ; '''
		jp		z, p7Cloc_525F
		cp		24h ; '$'
		jp		z, p7Cloc_51C4
		and		1Fh
		cp		19h
		jp		z, SendDirectoryContents
		rst		20h
		ld		a, 0Ah
		ld		(sndRecState), a
		call	CkOP1Real
		cp		15h
		jr		z, p7Cloc_5449
		cp		17h
		jr		z, p7Cloc_5449
		cp		13h
		jp		z, p7Cloc_6559
		sub		0Fh
		jr		c, p7Cloc_5449
		call	Page0Call_2DF9
		ld		a, 6
		call	p7Csub_59CE
		jp		p7Cloc_5556
; ---------------------------------------------------------------------------

p7Cloc_5449:
		ld		a, 6
		call	SendVariable
		jp		p7Cloc_5556
; ---------------------------------------------------------------------------

p7Cloc_5451:
		cp		88h ; '�'
		jp		nz, p7Cloc_54D7
		call	p7Csub_6530
		ld		hl, noErrorEntry
		ld		(mcxErrorEP), hl
		ld		hl, 5F1h
		call	pushErrorHandleR
		call	p7Csub_6B48
		cp		18h
		jp		nc, JErrorNo
		cp		14h
		jr		nz, p7Cloc_5489
		call	Chk_Batt_Low
		jr		nz, p7Cloc_547E
		ld		a, 0Ch
		call	SendSkipExitPacket
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_547E:
		call	j_FindApp
		call	nc, j_DeleteApp
		call	Page7C_2E65
		jr		p7Cloc_54C2
; ---------------------------------------------------------------------------

p7Cloc_5489:
		call	ChkFindSym
		jr		c, p7Cloc_54C2
		ld		a, (OP1+1)
		cp		5Eh ; '^'
		jr		nz, p7Cloc_54B7
		bit		5, (hl)
		call	nz, SetTblGraphDraw
		call	DelVarArc
		ld		hl, 0
		call	CreateEqu
		ld		a, (OP4M)
		bit		5, a
		jr		z, p7Cloc_54B5
		xor		1
		ld		(OP4M), a
		call	OP4ToOP1
		rst		10h
		res		5, (hl)

p7Cloc_54B5:
		jr		p7Cloc_54C2
; ---------------------------------------------------------------------------

p7Cloc_54B7:
		call	DelVarArc
		ld		a, (OP1+1)
		cp		5Dh ; ']'
		call	z, Page0Call_321F

p7Cloc_54C2:
		call	SendAck
		call	NZIf83Plus
		jr		nz, p7Cloc_54D4

p7Cloc_54CA:
		in		a, (9)
		bit		5, a
		jr		z, p7Cloc_54CA
		bit		7, a
		jr		nz, p7Cloc_54CA

p7Cloc_54D4:
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_54D7:
		cp		89h ; '�'
		jr		nz, p7Cloc_54F4
		call	p7Csub_6530
		ld		hl, 5F1h
		call	pushErrorHandleR
		call	p7Csub_6B48
		call	SendAck

p7Cloc_54EA:
		call	OP1ToOP4
		xor		a
		ld		(OP4+9), a
		jp		Page0Call_3E2B
; ---------------------------------------------------------------------------

p7Cloc_54F4:
		cp		0B7h ; '�'
		jr		nz, p7Cloc_5556
		call	GetSmallPacket
		ld		hl, 867Fh
		rst		20h
		rst		10h
		jr		c, p7Cloc_5551
		ld		a, b
		or		a
		jr		nz, p7Cloc_5551
		push	de
		ex		de, hl
		call	ldHLind
		ld		de, (OP1+7)
		ld		a, (OP1+1)
		cp		5Dh ; ']'
		jr		nz, p7Cloc_5541
		sbc		hl, de
		jr		c, p7Cloc_5551
		ex		de, hl
		pop		de
		call	j_AdrLEle

p7Cloc_551F:
		push	hl
		ld		de, 9
		ld		a, (hl)
		and		1Fh
		jr		z, p7Cloc_552B
		ld		de, 12h

p7Cloc_552B:
		push	de
		call	p7Csub_4006
		call	Get4BytesNC
		cp		9
		jp		nz, JErrorNo
		call	SendAck
		pop		de
		pop		hl
		call	SendRAMVarData
		jr		p7Cloc_5556
; ---------------------------------------------------------------------------

p7Cloc_5541:
		ld		a, h
		sub		d
		jr		c, p7Cloc_5551
		ld		a, l
		cp		e
		jr		c, p7Cloc_5551
		ld		b, d
		ld		c, e
		pop		de
		call	j_AdrMEle
		jr		p7Cloc_551F
; ---------------------------------------------------------------------------

p7Cloc_5551:
		ld		a, 1
		call	SendSkipExitPacket

p7Cloc_5556:
		cp		6
		jp		nz, p7Cloc_5966
		ld		a, (header)
		cp		23h ; '#'
		jp		nz, p7Cloc_5966
		call	GetSmallPacket
		call	Chk_Batt_Low
		jp		z, p7Cloc_593A
		call	p7Csub_6530
		ld		hl, p7Cloc_59B8
		call	pushErrorHandleR
		call	p7Csub_6B25
		ld		a, (unk_867F)
		cp		28h ; '('
		jp		nz, p7Cloc_55E4

; =============== S U B	R O U T	I N E =======================================


p7Csub_5580:
		ld		hl, (unk_8683)
		ld		bc, 8001h
		or		a
		sbc		hl, bc
		jp		nc, Page0Call_2BB9
		ld		hl, (unk_8683)
		push	hl
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Csub_6CD3
		ld		bc, 100h
		ld		de, 4000h
		call	p7Csub_6D6E
		call	p7Csub_6467
		call	p7Csub_6D6E
		call	Page0Call_2BBF
		jp		nc, p7Cloc_55D4
		nop
		nop
		nop
		call	Page0Call_2BC5
		nop
		nop
		nop
		nop
		call	Page0Call_2BCB
		jp		z, p7Cloc_55CE
		jr		p7Cloc_55D4
; ---------------------------------------------------------------------------

p7Cloc_55CE:
		call	Page0Call_2BD1
		jp		z, p7Cloc_55D4

p7Cloc_55D4:
		pop		hl
		call	Page0Call_2BD7
		call	p7Csub_56F5
		jp		z, p7Cloc_589A
		call	SendAck
		jp		FlashWriteDisable
; End of function p7Csub_5580

; ---------------------------------------------------------------------------

p7Cloc_55E4:
		cp		24h ; '$'
		jp		nz, p7Cloc_574F
		call	popErrorHandleR
		ld		hl, p7Cloc_59A0
		call	pushErrorHandleR
		ld		a, (header)
		cp		23h ; '#'
		jp		nz, p7Cloc_574F
		xor		a
		ld		(ioFlag), a
		set		0, (iy+25h)
		call	Page0Call_3D05
		ld		hl, (unk_8683)
		ld		bc, 4000h
		or		a
		sbc		hl, bc
		jp		nz, JErrorNo
		res		appTextSave, (iy+appFlags)
		ld		hl, 0
		ld		(curRow), hl

p7Cloc_561B:
		xor		a
		ld		(ramCodeEnd), a
		ld		(unk_9C87), a

p7Cloc_5622:
		ld		(appInfo), a
		rst		28h
; ---------------------------------------------------------------------------
		.dw		808Dh
; ---------------------------------------------------------------------------
		ld		a, 1
		ld		(unk_83A3+1), a
		xor		a
		ld		(unk_83A3), a
		ld		a, (ioFlag)
		or		a
		jr		nz, p7Cloc_5643
		call	Page0Call_3D05
		ld		hl, 0
		ld		(curRow), hl
		call	j_newline

p7Cloc_5643:
		xor		a
		ld		(unk_8685), a
		ld		a, 8
		ld		(unk_8434), a
		set		appTextSave, (iy+appFlags)
		call	p7Csub_533D
		push	af
		ld		a, (appInfo)
		cp		0
		jr		z, p7Cloc_565F
		pop		af
		jp		p7Cloc_56B2
; ---------------------------------------------------------------------------

p7Cloc_565F:
		ld		hl, p7Cloc_60B0
		ld		a, 37h ; '7'
		call	p7Csub_6595
		ld		hl, (curRow)
		push	hl
		ld		hl, 0
		ld		(curRow), hl
		ld		hl, appID
		call	j_PutS
		call	j_EraseEOL
		pop		hl
		ld		(curRow), hl
		pop		af
		cp		92h ; '�'
		push	af
		jr		z, p7Cloc_568C
		call	GetSmallPacket
		ld		a, 0FFh
		ld		(ramCodeEnd), a

p7Cloc_568C:
		pop		af
		jp		z, p7Cloc_56A1

p7Cloc_5690:
		ld		a, (unk_8434)
		call	p7Csub_533D
		cp		92h ; '�'
		jp		z, p7Cloc_56A1
		call	GetSmallPacket
		jp		p7Cloc_5690
; ---------------------------------------------------------------------------

p7Cloc_56A1:
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8018h
; ---------------------------------------------------------------------------
		ld		hl, p7Cloc_60CA
		ld		a, 39h ; '9'
		call	p7Csub_6595
		call	Page0Call_2BDD
		or		a
		jr		nz, p7Cloc_56C9

p7Cloc_56B2:
		ld		a, (header)
		cp		23h ; '#'
		ret		nz
		jp		p7Cloc_589A
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p7Csub_575D

p7Cloc_56BB:
		; p7Csub_575D+18Dj
		call	j_HomeUp
		call	p7Csub_56F5
		push	af
		ld		a, 0Ah
		call	Page7C_2C49
		jr		p7Cloc_56DA
; END OF FUNCTION CHUNK	FOR p7Csub_575D
; ---------------------------------------------------------------------------

p7Cloc_56C9:
		push	af
		call	j_HomeUp
		call	p7Csub_56F5
		pop		bc
		push	af
		ld		a, b
		cp		8
		jr		nz, p7Cloc_56E6
		call	p7Csub_56FB
; START	OF FUNCTION CHUNK FOR p7Csub_575D

p7Cloc_56DA:
		pop		af
		jr		z, p7Cloc_56E0
		call	popErrorHandleR

p7Cloc_56E0:
		call	j_ClrScrn
		jp		Page0Call_2539
; END OF FUNCTION CHUNK	FOR p7Csub_575D
; ---------------------------------------------------------------------------

p7Cloc_56E6:
		call	p7Csub_56FB
		pop		af
		jr		z, p7Cloc_56EF
		call	popErrorHandleR

p7Cloc_56EF:
		call	j_ClrScrn
		jp		Page0Call_253D

; =============== S U B	R O U T	I N E =======================================


p7Csub_56F5:
		ld		a, (header)
		cp		23h ; '#'
		ret
; End of function p7Csub_56F5


; =============== S U B	R O U T	I N E =======================================


p7Csub_56FB:

		push	af
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		ld		a, (unk_8434)
		call	Page0Call_2BE3
		call	j_HomeUp
		call	Page0Call_3D05
		call	Page0Call_2BAD
		call	FlashWriteDisable
		ld		de, 5
		xor		a
		ld		(unk_867C), a
		ld		(ioData), a
		ld		(unk_867F), a
		ld		(unk_867F+1), a
		pop		af
		call	Page7C_2C4F
		ret
; End of function p7Csub_56FB


; =============== S U B	R O U T	I N E =======================================


p7Csub_5737:
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8057h
; ---------------------------------------------------------------------------
		call	Page0Call_2BE9
		push	hl
		call	Page0Call_2BAD
		ld		hl, (ioData)
		call	Page0Call_2BEF
		jp		c, Page0Call_2BB9
		pop		de
		ld		bc, 0E8h ; '�'
		ret
; End of function p7Csub_5737

; ---------------------------------------------------------------------------

p7Cloc_574F:
		cp		25h ; '%'
		jp		nz, p7Cloc_584D
		call	popErrorHandleR
		ld		hl, p7Cloc_59B8
		call	pushErrorHandleR

; =============== S U B	R O U T	I N E =======================================


p7Csub_575D:




		call	Page0Call_3D05
		ld		hl, 0
		ld		(curRow), hl
		ld		hl, p7Cloc_60B0
		ld		a, 37h ; '7'
		call	p7Csub_6595
		ld		hl, appID
		call	j_PutS
		call	j_newline
		ld		hl, p7Cloc_60BD
		ld		a, 38h ; '8'
		call	p7Csub_6595
		ld		hl, appID
		call	j_PutS
		ld		hl, 0
		ld		(curRow), hl
		ld		de, 0A10h
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8027h
; ---------------------------------------------------------------------------
		jr		z, p7Cloc_57CC
		call	p7Csub_5737
		push	de
		call	p7Csub_6C11
		pop		hl
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	Page0Call_2BF5
		call	FlashWriteDisable
		jp		p7Cloc_589A
; ---------------------------------------------------------------------------

p7Cloc_57CC:
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Csub_5737
		call	p7Csub_6C11
		push	hl
		call	FlashWriteDisable
		ld		hl, p7Cloc_60CA
		ld		a, 39h ; '9'
		call	p7Csub_6595
		ld		hl, appID
		call	j_PutS
		nop
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	Page0Call_2BCB
		jp		nz, p7Cloc_56BB
		pop		hl
		ld		a, h
		cp		3
		jp		nz, p7Cloc_58D3
		ld		a, l
		and		0F0h ; '�'
		cp		0
		jr		z, p7Cloc_582A
		cp		20h ; ' '
		jr		nz, p7Cloc_582F
		call	Page0Call_2BFB
		jr		p7Cloc_5840
; ---------------------------------------------------------------------------

p7Cloc_582A:
		call	Page0Call_2BD1
		jr		p7Cloc_5840
; ---------------------------------------------------------------------------

p7Cloc_582F:
		cp		10h
		jr		nz, p7Cloc_5838
		call	Page0Call_2C01
		jr		p7Cloc_5840
; ---------------------------------------------------------------------------

p7Cloc_5838:
		cp		30h ; '0'
		jp		nz, p7Cloc_58B2
		rst		28h
; ---------------------------------------------------------------------------
		.dw		804Eh
; ---------------------------------------------------------------------------

p7Cloc_5840:
		jp		nz, p7Cloc_58D3
		ld		a, (header)
		cp		23h ; '#'
		jp		nz, FlashWriteDisable
		jr		p7Cloc_589A
; ---------------------------------------------------------------------------

p7Cloc_584D:
		cp		23h ; '#'
		jp		nz, p7Cloc_58B2

p7Cloc_5852:
		call	p7Csub_6F33
		ld		a, 0FFh
		ld		(appSearchPage), a
		xor		a
		ld		(ramCodeEnd), a
		ld		(unk_83A3+1), a
		rst		28h
; ---------------------------------------------------------------------------
		.dw		808Dh
; ---------------------------------------------------------------------------
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8072h
; ---------------------------------------------------------------------------
		jr		p7Cloc_589A
; ---------------------------------------------------------------------------

p7Cloc_5869:
		cp		22h ; '"'
		jp		nz, p7Cloc_58B2
		call	p7Csub_6530
		ld		hl, p7Cloc_59B8
		call	pushErrorHandleR
		call	p7Csub_6B25
		call	Page0Call_23DE
		jr		nc, p7Cloc_5882
		call	Page0Call_23E3

p7Cloc_5882:
		call	p7Csub_6B57
		call	Page0Call_2C07
		call	SendAck
		call	Page7C_2DCF
		call	popErrorHandleR
		call	Page0Call_2E35
		jp		JForceCmdNoChar
; ---------------------------------------------------------------------------

Page7C_2C73:
		jp		p7Csub_56FB
; ---------------------------------------------------------------------------

p7Cloc_589A:
		ld		hl, 0
		ld		(curRow), hl
		call	Page0Call_3D05
		call	SendAck

p7Cloc_58A6:
		call	popErrorHandleR
		call	Page7C_2DCF
		call	FlashWriteDisable
		jp		JForceCmdNoChar
; ---------------------------------------------------------------------------

p7Cloc_58B2:
		call	Page0Call_3D05
		nop
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	Page0Call_2BAD
		call	FlashWriteDisable
		jp		JErrorNo
; ---------------------------------------------------------------------------

p7Cloc_58D3:
		; p7Csub_575D:p7Cloc_5840j
		call	FlashWriteDisable
		call	j_HomeUp
		call	Page0Call_3D05
		bit		6, (iy+25h)
		ret		nz
		call	popErrorHandleR
		ld		hl, p7Cloc_59B8
		call	pushErrorHandleR
		jp		p7Cloc_56BB
; End of function p7Csub_575D

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p7Csub_6421

p7Cloc_58ED:
		call	p7Csub_6530
		ld		hl, p7Cloc_59B8
		call	pushErrorHandleR
		ld		a, (unk_8681)
		cp		25h ; '%'
		jp		nz, JError
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		ld		de, 0A10h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8027h
; ---------------------------------------------------------------------------
		jp		z, JError
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8081h
; ---------------------------------------------------------------------------
		call	Page0Call_3D05
		jp		JError
; END OF FUNCTION CHUNK	FOR p7Csub_6421
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

Page7C_2E89:
		call	FlashWriteDisable
		call	Page0Call_2D4B
		set		apdRunning, (iy+apdFlags)
		call	Page7C_2DCF
		res		curAble, (iy+curFlags)
		ei
		call	j_getkey
		jp		JForceCmdNoChar
; END OF FUNCTION CHUNK	FOR ReceiveVar
; ---------------------------------------------------------------------------

p7Cloc_593A:
		call	p7Csub_594D
		jr		p7Cloc_5966
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ReceiveVar

p7Cloc_593F:
		; ReceiveVar+A1Ej
		call	p7Csub_594D
		call	popErrorHandleR
		set		apdRunning, (iy+apdFlags)
		call	Page7C_2DCF
		ret
; END OF FUNCTION CHUNK	FOR ReceiveVar

; =============== S U B	R O U T	I N E =======================================


p7Csub_594D:
		; ReceiveVar:p7Cloc_593Fp
		call	Page0Call_3D05
		call	Page0Call_2D4B
		call	forceSlowSpeed
		ld		b, 64h ; 'd'

p7Cloc_5958:
		push	bc
		call	GetCSC
		pop		bc
		or		a
		jr		nz, p7Cloc_5962
		djnz	p7Cloc_5958

p7Cloc_5962:
		call	restorePreviousSpeed
		ret
; End of function p7Csub_594D

; ---------------------------------------------------------------------------

p7Cloc_5966:

		call	popErrorHandleR
link_handler:
		di
		pop		af
		bit		2, a
		jr		z, p7Cloc_5973
		set		curAble, (iy+curFlags)

p7Cloc_5973:
		pop		af
		ld		(ioFlag), a
		pop		af
		ld		(sndRecState), a
		pop		af
		ld		(ioErrState), a
		set		apdRunning, (iy+apdFlags)
		call	Page7C_2DCF
		call	p7Csub_6F20
		ret
p7Cloc_598A:
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Cloc_6D10
		jr		p7Cloc_59B8

p7Cloc_59A0:
		di
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	Page0Call_2C0D
		call	FlashWriteDisable

p7Cloc_59B8:
		ld		hl, 0
		ld		(curRow), hl
		call	Page0Call_3D05
		call	FlashWriteDisable
		ld		b, a
		ld		a, (sndRecState)
		inc		a
		ld		b, a
		ret		z
		jp		JForceCmdNoChar

; =============== S U B	R O U T	I N E =======================================


p7Csub_59CE:
		push	af
		ld		a, (OP1)
		ld		de, 0
		ld		(OP2EXT), de
		call	DataSize
		jr		p7Cloc_5A05
; End of function p7Csub_59CE


; =============== S U B	R O U T	I N E =======================================


SendVariable:
		set		comFailed, (iy+getSendFlg)
		push	af
		call	p7Csub_6A79
		jr		nc, p7Cloc_59EF

p7Cloc_59E8:
		; SendVariable+1Aj ...
		pop		af
		ld		a, 1
		call	SendSkipExitPacket
		ret
; ---------------------------------------------------------------------------

p7Cloc_59EF:
		call	p7Csub_6A3D
		jr		nc, p7Cloc_59E8
		and		1Fh
		cp		9
		jr		z, p7Cloc_59E8
		cp		0Ah
		jr		z, p7Cloc_59E8
		ld		(OP1), a
		ex		de, hl
		call	p7Csub_6A62

p7Cloc_5A05:
		pop		af
		push	hl
		push	de
		call	SendHeaderPacket
		ld		a, (sndRecState)
		cp		0Ah
		jr		z, p7Cloc_5A20
		ld		a, b
		cp		82h ; '�'

p7Cloc_5A15:
		; SendVariable+40j
		jp		z, JErrorNo
		cp		83h ; '�'
		jr		z, p7Cloc_5A15
		cp		73h ; 's'
		jr		z, p7Cloc_5A15

p7Cloc_5A20:
		call	Get4BytesNC
		cp		9
		jp		nz, JErrorNo
		call	SendAck
		pop		de
		pop		hl
		call	p7Cloc_40C9
		ld		a, (sndRecState)
		cp		0Bh
		jp		z, p7Csub_418C
		ret
; End of function SendVariable


; =============== S U B	R O U T	I N E =======================================


p7Csub_5A39:
		; Page7C_2CE5p
		ld		hl, 8694h
		ld		b, 23h ; '#'

p7Cloc_5A3E:
		res		7, (hl)
		inc		hl
		djnz	p7Cloc_5A3E
		call	NZIf83Plus
		ret		nz
		ld		hl, 8697h
		ld		b, 20h ; ' '
		xor		a

p7Cloc_5A4D:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_5A4D
		ret
; End of function p7Csub_5A39


; =============== S U B	R O U T	I N E =======================================


DeselectAllVars:
		; p7Csub_4B62:Page7C_3A0Bp ...
		call	p7Csub_5A39
		xor		a

p7Cloc_5A56:
		push	af
		ld		hl, symTable
		ld		d, 0
		ld		bc, (unk_982E)

p7Cloc_5A60:
		or		a
		sbc		hl, bc
		jr		c, p7Cloc_5A8D
		jr		z, p7Cloc_5A8D
		add		hl, bc
		pop		af
		push	af
		jr		nc, p7Cloc_5A70
		set		7, (hl)
		jr		p7Cloc_5A72
; ---------------------------------------------------------------------------

p7Cloc_5A70:
		res		7, (hl)

p7Cloc_5A72:
		ld		a, (hl)
		and		1Fh
		call	Page0Call_2407
		ld		e, 3
		call	page0_17B3
		jr		z, p7Cloc_5A86
		dec		hl
		ld		a, (hl)
		inc		hl
		cp		5Dh ; ']'
		jr		nz, p7Cloc_5A88

p7Cloc_5A86:
		ld		e, (hl)
		inc		e

p7Cloc_5A88:
		or		a
		sbc		hl, de
		jr		p7Cloc_5A60
; ---------------------------------------------------------------------------

p7Cloc_5A8D:
		; DeselectAllVars+13j
		pop		af
		ret
; End of function DeselectAllVars


; =============== S U B	R O U T	I N E =======================================


p7Csub_5A8F:
		ld		hl, 8694h
		ld		b, 3

p7Cloc_5A94:
		set		7, (hl)
		inc		hl
		djnz	p7Cloc_5A94
		ret
; End of function p7Csub_5A8F


; =============== S U B	R O U T	I N E =======================================


p7Csub_5A9A:
		call	ZeroOP1

p7Cloc_5A9D:
		call	j_FindAppUp
		ret		c
		call	NZIf83Plus
		jr		nz, p7Cloc_5AAD
		ld		a, (unk_9C87)
		cp		69h ; 'i'
		jr		z, p7Cloc_5AB3

p7Cloc_5AAD:
		ld		a, d
		call	Page0Call_2C13
		jr		p7Cloc_5A9D
; ---------------------------------------------------------------------------

p7Cloc_5AB3:
		ld		bc, 0Eh
		ld		hl, 9C88h
		ld		de, 8697h
		ldir
		ret
; End of function p7Csub_5A9A


; =============== S U B	R O U T	I N E =======================================


Page7C_2CE5:
		call	p7Csub_5A39
		call	p7Csub_5A8F
		call	p7Csub_5A9A
		scf
		call	p7Cloc_5A56
		ret
; End of function Page7C_2CE5

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p7Csub_4B62

Page7C_3A0B:
		call	DeselectAllVars

p7Cloc_5AD0:
		set		ignoreBPLink, (iy+hookflags1)
		xor		a
		ld		(varClass), a
		call	Page7C_2D87
		ld		hl, linkContext
		call	AppInit
		set		curLock, (iy+curFlags)
		res		inDelete, (iy+ioDelFlag)
		res		inGroup, (iy+groupFlags)
		set		grfSplitOverride, (iy+sGrFlags)
		xor		a
		ld		(winTop), a
		ld		a, 30h ; '0'
		call	p7Csub_5B03
		call	p7Csub_6023
		call	p7Cloc_6275
		jp		Page7C_2DCF
; END OF FUNCTION CHUNK	FOR p7Csub_4B62

; =============== S U B	R O U T	I N E =======================================


p7Csub_5B03:
		push	af
		call	j_ClrScrn
		pop		af
		call	j_LoadMenuNum
		set		5, (iy+16h)
		ret
; End of function p7Csub_5B03

; ---------------------------------------------------------------------------

Page7C_2CF1:
		bit		shiftALock, (iy+shiftFlags)
		jr		z, p7Cloc_5B2D
		push	af
		ld		a, (sndRecState)
		cp		4
		jr		z, p7Cloc_5B26
		cp		17h
		jr		z, p7Cloc_5B26
		cp		2
		jr		nz, p7Cloc_5B2C

p7Cloc_5B26:
		call	CanAlphIns
		call	j_restoreTR

p7Cloc_5B2C:
		pop		af

p7Cloc_5B2D:
		ld		b, a
		ld		a, 2
		bit		4, (iy+36h)
		call	nz, Page0Call_3123
		ld		a, b
		cp		14h
		jr		nz, p7Cloc_5B45
		call	NZIf83Plus
		call	z, p7Csub_6E1A
		jp		p7Cloc_44FB
; ---------------------------------------------------------------------------

p7Cloc_5B45:
		cp		5
		jr		nz, p7Cloc_5B63
		ld		a, (sndRecState)
		cp		17h
		jr		z, p7Cloc_5B53
		cp		4
		ret		nz

p7Cloc_5B53:
		call	Page7C_2F91
		call	Page7C_2E83
		ret		z
		call	Page0Call_2DE1
		call	p7Csub_4B25
		jp		Page7C_2E95
; ---------------------------------------------------------------------------

p7Cloc_5B63:
		cp		16h
		jp		z, p7Cloc_4C85
		cp		4
		jp		z, Page7C_2E71
		cp		3
		jp		z, Page7C_2E6B
		cp		2
		jr		z, p7Cloc_5B7A
		cp		1
		jr		nz, p7Cloc_5BBA

p7Cloc_5B7A:
		ld		a, (sndRecState)
		cp		4
		jr		z, p7Cloc_5B93
		cp		17h
		jr		z, p7Cloc_5B93
		cp		9
		ret		nz
		ld		a, (varClass)
		cp		9
		jp		nz, p7Cloc_5FD2
		jp		p7Cloc_5FD4
; ---------------------------------------------------------------------------

p7Cloc_5B93:
		res		IDis82h, (iy+linkFlags)
		ld		a, (sndRecState)
		cp		17h
		jr		nz, p7Cloc_5BA2
		set		IDis82h, (iy+linkFlags)

p7Cloc_5BA2:
		ld		a, 9
		ld		(sndRecState), a
		xor		a
		ld		(winTop), a
		call	j_ClrScrn
		ld		a, 31h ; '1'
		ld		l, 1
		call	j_LoadMenuNumL
		set		5, (iy+16h)
		ret
; ---------------------------------------------------------------------------

p7Cloc_5BBA:
		cp		1Ah
		jp		z, p7Cloc_4703
		cp		27h ; '''
		jr		nz, p7Cloc_5BCB
		ld		a, (ioErrState)
		or		a
		jp		z, p7Cloc_5AD0
		ret
; ---------------------------------------------------------------------------

p7Cloc_5BCB:
		cp		19h
		jr		nz, p7Cloc_5BF4
		ld		a, (unk_867F)
		cp		13h
		jr		z, p7Cloc_5BF9
		call	p7Cloc_626E
		cp		6
		jp		z, p7Cloc_4CD1
		cp		2
		call	z, FPOPREAL
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		ld		a, 2
		call	SendSkipExitPacket
		call	popErrorHandleR
		jp		p7Cloc_4A71
; ---------------------------------------------------------------------------

p7Cloc_5BF4:
		cp		15h
		jp		nz, p7Cloc_5C87

p7Cloc_5BF9:
		ld		a, (sndRecState)
		cp		13h
		jr		nz, p7Cloc_5C08
		call	p7Csub_6023
		call	p7Csub_634F
		jr		p7Cloc_5C36
; ---------------------------------------------------------------------------

p7Cloc_5C08:
		call	p7Cloc_626E
		cp		6
		jp		z, p7Cloc_4DFB
		cp		2
		jr		nz, p7Cloc_5C19
		call	FPOPREAL
		jr		p7Cloc_5C1D
; ---------------------------------------------------------------------------

p7Cloc_5C19:
		cp		3
		jr		nz, p7Cloc_5C23

p7Cloc_5C1D:
		call	p7Csub_634F

p7Cloc_5C20:

		jp		p7Cloc_4A9D
; ---------------------------------------------------------------------------

p7Cloc_5C23:
		cp		4
		jr		z, p7Cloc_5C36
		ld		a, (sndRecState)
		ld		hl, ioFlag
		cp		14h
		jr		nz, p7Cloc_5C39
		bit		1, (hl)
		jp		nz, resetRam

p7Cloc_5C36:
		jp		Page7C_3A0B
; ---------------------------------------------------------------------------

p7Cloc_5C39:
		cp		11h
		jp		nz, p7Cloc_5C84
		call	Page7C_2F91

p7Cloc_5C41:
		call	j_SrchVLstDn
		jr		c, p7Cloc_5C81
		call	p7Csub_4B12
		jr		z, p7Cloc_5C41
		call	Page7C_2DC9
		jr		p7Cloc_5C20

; =============== S U B	R O U T	I N E =======================================


p7Csub_5C50:
		call	CkOP1Real
		cp		15h
		jr		z, p7Cloc_5C6C
		cp		0Fh
		jr		c, p7Cloc_5C6C
		cp		10h
		jr		nz, locret_5C6B
		ld		hl, Xmin
		ld		de, uXmin
		ld		bc, 99h	; '�'
		ldir
		ret
; ---------------------------------------------------------------------------

locret_5C6B:
		ret
; ---------------------------------------------------------------------------

p7Cloc_5C6C:
		call	ChkFindSym
		ex		de, hl
		ld		bc, (freeRAM)
		dec		bc
		dec		bc
		ld		(hl), c
		inc		hl
		ld		(hl), b
		dec		hl
		ex		de, hl
		ld		a, 3
		call	DELVARIO
		ret
; End of function p7Csub_5C50

; ---------------------------------------------------------------------------

p7Cloc_5C81:
		jp		p7Cloc_5C20
; ---------------------------------------------------------------------------

p7Cloc_5C84:
		jp		Page7C_3A0B
; ---------------------------------------------------------------------------

p7Cloc_5C87:
		cp		18h
		jr		nz, p7Cloc_5CA5
		call	p7Cloc_626E
		jr		p7Cloc_5CA2
; ---------------------------------------------------------------------------

p7Cloc_5C90:
		ld		hl, ioFlag
		set		5, (hl)
		call	CpyO1ToFPST
		call	j_RclExit
		set		curLock, (iy+curFlags)
		call	p7Cloc_6271

p7Cloc_5CA2:
		jp		ReceiveVarDataExists
; ---------------------------------------------------------------------------

p7Cloc_5CA5:
		cp		17h
		jp		nz, p7Cloc_5DA6
		jp		Page0Call_2DFF
; ---------------------------------------------------------------------------

p7Cloc_5CAD:
		call	j_RclExit
		set		curLock, (iy+curFlags)
		call	CpyTo1FPST
		jp		Page0Call_2DFF
; ---------------------------------------------------------------------------

Page7C_2F49:
		ld		hl, (unk_9D8B)
		ld		(OP3), hl
		set		curLock, (iy+curFlags)
		jr		c, p7Cloc_5CD4
		call	j_RclExit
		set		curLock, (iy+curFlags)
		call	CpyTo4FPST
		call	Page0Call_2E05
		ret
; ---------------------------------------------------------------------------

p7Cloc_5CD4:
		call	CpyTo2FPST
		bit		1, (iy+11h)
		jr		z, p7Cloc_5CFA
		ld		a, (OP1+1)
		call	Page0Call_2D93
		jr		c, p7Cloc_5CAD
		ld		a, (OP2)
		ld		(OP1), a
		res		1, (iy+11h)

p7Cloc_5CEF:
		res		5, (iy+1Eh)
		call	ChkFindSym
		jr		nc, p7Cloc_5CAD
		jr		p7Cloc_5D78
; ---------------------------------------------------------------------------

p7Cloc_5CFA:
		bit		5, (iy+1Eh)
		jr		z, p7Cloc_5D46
		ld		a, (OP1)
		ld		b, a
		cp		6
		jr		nc, p7Cloc_5CAD
		ld		a, (OP1+1)
		cp		5Dh ; ']'
		jr		nz, p7Cloc_5D1B
		ld		a, b
		cp		2
		jr		nz, p7Cloc_5CAD

p7Cloc_5D14:
		ld		a, 1
		ld		(OP1), a
		jr		p7Cloc_5CEF
; ---------------------------------------------------------------------------

p7Cloc_5D1B:
		ld		hl, 8479h
		ld		a, (hl)
		call	Page0Call_2D93
		jr		c, p7Cloc_5CAD

p7Cloc_5D24:
		ld		a, (hl)
		call	Page0Call_2D93
		jr		nc, p7Cloc_5D34
		cp		30h ; '0'
		jp		c, p7Cloc_5CAD
		cp		3Ah ; ':'
		jp		nc, p7Cloc_5CAD

p7Cloc_5D34:
		inc		hl
		djnz	p7Cloc_5D24
		ld		(hl), 0
		call	page0_12C4
		call	page0_12C4
		ld		a, 5Dh ; ']'
		ld		(OP1+1), a
		jr		p7Cloc_5D14
; ---------------------------------------------------------------------------

p7Cloc_5D46:
		ld		a, (OP2)
		and		1Fh
		jr		nz, p7Cloc_5D5B
		ld		a, (OP1)
		cp		2
		jp		nc, p7Cloc_5CAD
		rst		10h
		jr		c, p7Cloc_5D78
		jp		p7Cloc_5CAD
; ---------------------------------------------------------------------------

p7Cloc_5D5B:
		ld		a, (OP2+1)
		ld		hl, 8479h
		cp		(hl)
		jp		nz, p7Cloc_5CAD
		rst		10h
		jr		c, p7Cloc_5D78
		call	Page7C_2DB7
		jp		nz, p7Cloc_5CAD
		bit		inGroup, (iy+groupFlags)
		jp		z, p7Cloc_5C90
		jp		Page0Call_2D0F
; ---------------------------------------------------------------------------

p7Cloc_5D78:
		ld		hl, ioFlag
		set		5, (hl)
		ld		hl, (OP3)
		push	hl
		call	j_RclExit
		set		curLock, (iy+curFlags)
		res		promptEdit, (iy+promptFlags)
		pop		hl
		ld		(ioData), hl
		call	p7Cloc_6271
		call	PopRealO2
		ld		a, (OP2)
		ld		(OP1), a
		bit		inGroup, (iy+groupFlags)
		jp		nz, Page0Call_2D0F
		jp		ReceiveVarData
; ---------------------------------------------------------------------------

p7Cloc_5DA6:
		cp		13h
		jp		z, p7Cloc_4B4F
		cp		10h
		jp		nz, p7Cloc_5FC5
		call	Page7C_2CE5
		jp		p7Cloc_5FCD
; ---------------------------------------------------------------------------

p7Cloc_5DB6:
		cp		1Fh
		jr		nz, p7Cloc_5DC3
		call	Page7C_2CEB

p7Cloc_5DBD:
		ld		(varClass), a
		jp		p7Cloc_5FD4
; ---------------------------------------------------------------------------

p7Cloc_5DC3:
		cp		27h ; '''
		jp		nz, p7Cloc_5F01
		ld		a, 14h
		jr		p7Cloc_5DBD

; =============== S U B	R O U T	I N E =======================================


Page7C_2CEB:
		ld		a, (keyExtend)
		ld		hl, p7Cloc_5DD7
		ld		e, a
		ld		d, 0
		add		hl, de
		ld		a, (hl)
p7Cloc_5DD7:
		ret
; End of function Page7C_2CEB

; ---------------------------------------------------------------------------
		.db		0
		.db		0Ch
		.db		1
		.db		2
		.db		3
		.db		5
		.db		7
		.db		8
		.db		4
		.db		0
		.db		14h
		.db		15h
		.db		17h
; ---------------------------------------------------------------------------

p7Cloc_5DE5:
		ld		a, 14h
		ld		(varClass), a
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_6B25
		xor		a
		ld		(ioFlag), a
		ld		hl, 0
		ld		(curRow), hl
		call	Page0Call_3D05

p7Cloc_5E00:
		ld		b, 0Dh
		ld		c, 15h
		call	NZIf83Plus
		jr		nz, p7Cloc_5E0D
		ld		b, 61h ; 'a'
		ld		c, 69h ; 'i'

p7Cloc_5E0D:
		push	bc
		call	NZIf83Plus
		jr		z, p7Cloc_5E1D
		ld		hl, 8697h
		ld		b, 0
		add		hl, bc
		bit		7, (hl)
		jr		p7Cloc_5E25
; ---------------------------------------------------------------------------

p7Cloc_5E1D:
		ld		b, c
		call	Page7C_2DB1
		ld		b, a
		call	p7Cloc_4B1A

p7Cloc_5E25:
		jp		z, p7Cloc_5EDE
		ld		a, (ioFlag)
		or		a
		jr		nz, p7Cloc_5E40
		call	p7Csub_41AF
		call	Get4BytesCursor
		ld		a, (header)
		cp		73h ; 's'
		jr		z, p7Cloc_5E40
		ld		a, 1
		jp		SendSkipExitPacket
; ---------------------------------------------------------------------------

p7Cloc_5E40:
		pop		bc
		push	bc
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		ld		a, c
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8096h
; ---------------------------------------------------------------------------
		jr		nz, p7Cloc_5E97
		push	hl
		ld		hl, 838Eh
		ld		a, (hl)
		and		0Fh
		ld		(hl), a
		pop		hl
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80A8h
; ---------------------------------------------------------------------------
		jr		z, p7Cloc_5E97
		push	hl
		call	Page0Call_2C19
		jr		nz, p7Cloc_5E76
		ld		a, 73h ; 's'
		ld		(header), a
		call	ret_6

p7Cloc_5E76:
		pop		hl
		nop
		nop
		nop
		call	Page0Call_2C1F
		jr		nz, p7Cloc_5E97
		nop
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	SendCertificate

p7Cloc_5E97:
		pop		af
		push	af
		call	Page0Call_2C25
		call	Page7C_2DC9
		call	Page0Call_2DE7
		di
		ld		a, 0FFh
		ld		(ioFlag), a
		pop		af
		call	SendApplication
		ld		a, (appInfo)
		cp		1
		jr		z, p7Cloc_5EDE
		cp		0
		jr		z, p7Cloc_5EBA
		pop		bc
		jr		p7Cloc_5EEA
; ---------------------------------------------------------------------------

p7Cloc_5EBA:
		ld		a, 92h ; '�'
		ld		(header+1), a
		ld		a, 73h ; 's'
		ld		(header), a
		ld		bc, 0
		ld		(unk_8676), bc
		call	Send4Bytes
		call	Get4BytesNC
		ld		a, (header+1)
		cp		36h ; '6'
		jp		z, p7Cloc_6764
		cp		56h ; 'V'
		jp		nz, JErrorNo

p7Cloc_5EDE:

		pop		bc
		dec		c
		dec		b
		jp		nz, p7Cloc_5E0D
		ld		a, (ioFlag)
		or		a
		jr		z, p7Cloc_5EF0

p7Cloc_5EEA:
		call	p7Csub_418C
		call	Page7C_2E95

p7Cloc_5EF0:
		call	popErrorHandleR
		call	FlashWriteDisable
		ld		hl, ioFlag
		bit		4, (hl)
		jp		nz, p7Cloc_4E3D
		jp		p7Cloc_4E0E
; ---------------------------------------------------------------------------

p7Cloc_5F01:
		cp		1Bh
		jr		nz, p7Cloc_5F69
		call	p7Csub_6F33
		call	Page0Call_2B95
		jp		nz, Page0Call_2535
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	Page0Call_2B95
		push	hl
		ld		a, 73h ; 's'
		ld		(header), a
		ld		a, 22h ; '"'
		ld		(unk_867F), a
		ld		hl, 0Bh
		ld		a, 0C9h	; '�'
		ld		de, ioData
		ex		de, hl
		call	SendRAMCmd
		call	p7Csub_4190
		ld		a, 15h
		ld		(header+1), a
		pop		hl
		push	hl
		ld		e, (hl)
		inc		hl
		ld		d, (hl)
		ld		a, 9
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8045h
; ---------------------------------------------------------------------------
		inc		hl
		inc		hl
		ld		(unk_8676), hl
		pop		hl
		ld		(iMathPtr5), hl
		call	SendPacket
		call	Page0Call_2E53
		call	popErrorHandleR
		call	Page7C_2DCF
		ld		hl, 0
		ld		(curRow), hl
		call	j_ClrScrn
		ld		hl, aIdlist
		ld		a, 3Dh ; '='
		call	p7Csub_6586
		jp		p7Cloc_4E18
; ---------------------------------------------------------------------------

p7Cloc_5F69:
		cp		1Ch
		jr		nz, p7Cloc_5FB4
		call	p7Csub_6F33
		ld		hl, Page7C_2C79
		call	pushErrorHandleR
		call	p7Csub_41AF
		call	Get4BytesCursor
		ld		a, (header)
		cp		73h ; 's'
		jr		z, p7Cloc_5F88
		ld		a, 1
		jp		SendSkipExitPacket
; ---------------------------------------------------------------------------

p7Cloc_5F88:
		call	Page0Call_3D05
		xor		a
		ld		(curRow), a
		ld		(curRow+1), a
		ld		hl, aOperatingSystem
		ld		a, 3Eh ; '>'
		call	p7Csub_6586
		call	j_newline
		ld		a, 1
		ld		(curRow), a
		ld		hl, 64h	; 'd'
		call	j_PutS
		call	SendOS
		call	popErrorHandleR
		call	Page7C_2DCF
		jp		p7Cloc_4E18
; ---------------------------------------------------------------------------

p7Cloc_5FB4:
		cp		12h
		ret		nz
		ld		a, 1
		ld		(varType), a
		ld		a, 0Ah
		ld		(varClass), a
		ld		a, 17h
		jr		p7Cloc_5FD9
; ---------------------------------------------------------------------------

p7Cloc_5FC5:
		cp		11h
		jp		nz, p7Cloc_5DB6
		call	DeselectAllVars

p7Cloc_5FCD:
		ld		a, 9
		ld		(varClass), a

p7Cloc_5FD2:
		ld		a, 5

p7Cloc_5FD4:
		ld		(varType), a
		ld		a, 4

p7Cloc_5FD9:
		res		IDis82h, (iy+linkFlags)
		ld		(sndRecState), a
		set		curLock, (iy+curFlags)
		call	j_ClrWindow
		ld		hl, aSelect
		set		textInverse, (iy+textFlags)
		ld		a, 5
		call	p7Csub_6586
		res		textInverse, (iy+textFlags)
		ld		hl, aTransmit
		ld		a, 6
		call	p7Csub_6586
		ld		a, 1

Page7C_2E5F:
		ld		(winTop), a
		call	Page7C_2D09
		ld		(varType), a
		call	p7Csub_61C5
		call	Page7C_2E83
		jp		p7Cloc_6252

; =============== S U B	R O U T	I N E =======================================


Page7C_2D09:
		ld		a, (varClass)
		cp		0Ah
		jr		nz, p7Cloc_601D
		ld		a, 1
		ret
; ---------------------------------------------------------------------------

p7Cloc_601D:
		cp		9
		ret		nz
		ld		a, 5
		ret
; End of function Page7C_2D09


; =============== S U B	R O U T	I N E =======================================


p7Csub_6023:
		; ReceiveVar+690p ...
		ld		a, 1
		ld		(sndRecState), a
		ret
; End of function p7Csub_6023

linkContext:
		.dw		Page7C_2CF1
		.dw		linkcxPPutAway
		.dw		linkcxPPutAway
		.dw		linkcxPPUtAway
		.dw		Page7C_3A0B
		.dw		linkcxSizeWind
		.db		12h

linkcxPPutAway:
		ld		hl, ioFlag
		ld		a, (sndRecState)
		cp		14h
		jr		nz, p7Cloc_6045
		bit		1, (hl)
		jp		nz, resetRam

p7Cloc_6045:
		ld		hl, (fpBase)
		ld		(FPS), hl
		res		curLock, (iy+curFlags)
		xor		a
		ld		(sndRecState), a
		res		IDis82h, (iy+linkFlags)
		call	Page7C_2DCF
		res		grfSplitOverride, (iy+sGrFlags)
		call	DeselectAllVars
		res		ignoreBPLink, (iy+hookflags1)
		ret
; ---------------------------------------------------------------------------
linkcxSizeWind:
		jr		c, locret_6087
		ld		a, (curRow)
		add		a, b
		sub		7
		cp		1
		ret		m
		ld		b, a
		set		appTextSave, (iy+appFlags)
		ld		hl, curRow

p7Cloc_6079:
		call	j_scrollUp
		dec		(hl)
		djnz	p7Cloc_6079
		res		appTextSave, (iy+appFlags)
		call	j_saveShadow2
		ret
; ---------------------------------------------------------------------------

locret_6087:
		ret
; ---------------------------------------------------------------------------
aWaiting:	.asc 'Waiting',0CEh,0
aReceiving:	.asc 'Receiving',0CEh,0
aDeleteBytes:	.asc 'DELETE        BYTES',0
p7Cloc_60B0:
aReceiving_0:	.asc ' Receiving',0CEh,0
		.db		0
p7Cloc_60BD:
aCertificate:	.asc 'Certificate',0
		.db		0
p7Cloc_60CA:
aValidating:	.asc 'Validating',0CEh,0
		.db		0

; =============== S U B	R O U T	I N E =======================================


p7Csub_60D7:
		; ReceiveVar-Fp
		ld		de, OP1
		ld		bc, 11h
		ldir
		ld		hl, 100h
		ld		(curRow), hl

p7Cloc_60E5:
		ld		hl, OP1
		call	j_PutS
		ei
		ret
; End of function p7Csub_60D7


; =============== S U B	R O U T	I N E =======================================


p7Csub_60ED:
		ld		(curRow), de
		ld		de, OP1
		ldir
		jr		p7Cloc_60E5
; End of function p7Csub_60ED


; =============== S U B	R O U T	I N E =======================================


p7Csub_60F8:

		bit		inDelete, (iy+ioDelFlag)
		jr		z, p7Cloc_6100
		xor		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6100:
		ld		a, (sndRecState)
		cp		4
		ret		z
		cp		17h
		ret		z
		cp		2
		ret
; End of function p7Csub_60F8

; ---------------------------------------------------------------------------

Page7C_2E6B:
		call	p7Csub_60F8
		ret		nz
		call	Page7C_2E83
		ret		z

Page7C_2E9B:
		call	p7Csub_6144
		jr		nz, p7Cloc_612F

p7Cloc_6119:
		call	j_SrchVLstDn
		jp		c, p7Csub_61F5
		bit		inDelete, (iy+ioDelFlag)
		jr		nz, p7Cloc_612A
		call	p7Csub_4B12
		jr		z, p7Cloc_6119

p7Cloc_612A:
		call	Page7C_2DC9
		jr		p7Cloc_6135
; ---------------------------------------------------------------------------

p7Cloc_612F:
		call	p7Csub_6237
		jp		z, p7Csub_61F5

p7Cloc_6135:
		call	p7Csub_6190
		call	Page7C_2F91
		call	j_moveUp
		call	m, Page0Call_2DED
		jp		Page7C_2E95

; =============== S U B	R O U T	I N E =======================================


p7Csub_6144:

		call	p7Cloc_6206
		bit		inDelete, (iy+ioDelFlag)
		jr		nz, p7Cloc_6153
		ld		a, (sndRecState)
		cp		2
		ret		nz

p7Cloc_6153:
		call	OP4ToOP1
		xor		a
		ret
; End of function p7Csub_6144

; ---------------------------------------------------------------------------

Page7C_2E71:
		call	p7Csub_60F8
		ret		nz
		call	Page7C_2E83
		ret		z
		call	p7Csub_6144
		jr		nz, p7Cloc_617B

p7Cloc_6165:
		call	j_SrchVLstUp
		jp		c, p7Csub_61F5
		bit		inDelete, (iy+ioDelFlag)
		jr		nz, p7Cloc_6176
		call	p7Csub_4B12
		jr		z, p7Cloc_6165

p7Cloc_6176:
		call	Page7C_2DC9
		jr		p7Cloc_6181
; ---------------------------------------------------------------------------

p7Cloc_617B:
		call	p7Csub_621A
		jp		z, p7Csub_61F5

p7Cloc_6181:
		call	p7Csub_6190
		call	Page7C_2F91
		call	j_moveDown
		call	nc, Page0Call_2DED
		jp		Page7C_2E95

; =============== S U B	R O U T	I N E =======================================


p7Csub_6190:

		xor		a
		ld		(curRow+1), a
		ld		a, 20h ; ' '
		call	j_PutMap
		ei
		call	OP4ToOP1
; End of function p7Csub_6190


; =============== S U B	R O U T	I N E =======================================


p7Csub_619D:
		ld		a, 0D0h	; '�'
; End of function p7Csub_619D

; START	OF FUNCTION CHUNK FOR Page7C_2E95

p7Cloc_619F:
		push	af
		bit		inDelete, (iy+ioDelFlag)
		jr		nz, p7Cloc_61B1
		ld		a, (sndRecState)
		cp		4
		jr		z, p7Cloc_61B3
		cp		17h
		jr		z, p7Cloc_61B3

p7Cloc_61B1:
		; Page7C_2E95-A0j
		pop		af
		ret
; ---------------------------------------------------------------------------

p7Cloc_61B3:
		; Page7C_2E95-AAj
		call	Page0Call_2DE1
		call	p7Csub_4B12
		jr		z, p7Cloc_61B1
		xor		a
		ld		(curRow+1), a
		pop		af
		call	j_PutMap
		ei
		ret
; END OF FUNCTION CHUNK	FOR Page7C_2E95

; =============== S U B	R O U T	I N E =======================================


p7Csub_61C5:
		cp		1
		ld		a, 40h ; '@'
		jr		nz, p7Cloc_61D2
		ld		a, 0FFh
		ld		(varCurrent+1), a
		ld		a, 5Dh ; ']'

p7Cloc_61D2:
		ld		(varCurrent), a
		call	j_HomeUp

Page7C_2E8F:
		call	p7Csub_621A
		ret		z
		call	p7Cloc_6206

p7Cloc_61DF:
		call	Page0Call_2DED
		call	p7Csub_619D
		call	j_newline
		call	Page0Call_3CCF
		jr		nc, p7Csub_61F5
		call	p7Csub_621A
		jr		nz, p7Cloc_61DF
		call	j_EraseEOW2
; End of function p7Csub_61C5


; =============== S U B	R O U T	I N E =======================================


p7Csub_61F5:

		ld		hl, OP4

p7Cloc_61F8:
		ld		de, varType

p7Cloc_61FB:
		jp		mov9B2
; End of function p7Csub_61F5


; =============== S U B	R O U T	I N E =======================================


Page7C_2F91:
		; ReceiveVar+32Ep ...
		ld		de, OP1
		ld		hl, 8481h
		jr		p7Cloc_620C
; ---------------------------------------------------------------------------

p7Cloc_6206:
		ld		de, OP4
		ld		hl, 84A2h

p7Cloc_620C:
		xor		a
		ld		(hl), a
		inc		hl
		ld		(hl), a
		ld		hl, varType
		jr		p7Cloc_61FB
; End of function Page7C_2F91


; =============== S U B	R O U T	I N E =======================================


Page7C_2DC9:
		; ReceiveVar:p7Cloc_4AFCp	...
		ld		hl, OP1
		jr		p7Cloc_61F8
; End of function Page7C_2DC9


; =============== S U B	R O U T	I N E =======================================


p7Csub_621A:
		; p7Csub_61C5:Page7C_2E8Fp ...
		call	Page7C_2F91
		call	p7Csub_6228
		call	Page7C_2DC9
; End of function p7Csub_621A


; =============== S U B	R O U T	I N E =======================================


Page7C_2E83:
		ld		a, (varCurrent)
		inc		a
		ret
; End of function Page7C_2E83


; =============== S U B	R O U T	I N E =======================================


p7Csub_6228:
		call	j_SrchVLstUp
		jr		c, p7Cloc_622E
		ret
; ---------------------------------------------------------------------------

p7Cloc_622E:
		call	Page7C_2F91
		ld		a, 0FFh
		ld		(OP1+1), a
		ret
; End of function p7Csub_6228


; =============== S U B	R O U T	I N E =======================================


p7Csub_6237:
		call	Page7C_2F91
		call	p7Csub_6246
		call	Page7C_2DC9
		ld		a, (varCurrent)
		cp		40h ; '@'
		ret
; End of function p7Csub_6237


; =============== S U B	R O U T	I N E =======================================


p7Csub_6246:
		call	j_SrchVLstDn
		jr		c, p7Cloc_624E
		ret
; ---------------------------------------------------------------------------
		jr		p7Csub_6246
; ---------------------------------------------------------------------------

p7Cloc_624E:
		call	page0_166E
		ret
; End of function p7Csub_6246

; ---------------------------------------------------------------------------

p7Cloc_6252:
		call	Page7C_2E83
		ret		z
		call	j_HomeUp

; =============== S U B	R O U T	I N E =======================================


Page7C_2E95:




		xor		a
		ld		(curRow+1), a
		ld		a, 5
		call	j_PutMap
		ei
		call	Page7C_2F91
		ld		a, 0DFh	; '�'
		jp		p7Cloc_619F
; End of function Page7C_2E95


; =============== S U B	R O U T	I N E =======================================


p7Csub_626B:
		call	Page0Call_3D05

p7Cloc_626E:

		call	j_rstrShadow2

p7Cloc_6271:
		set		appTextSave, (iy+appFlags)

p7Cloc_6275:
		ld		hl, ioErrState
		ld		a, (hl)
		ld		(hl), 0
		ret
; End of function p7Csub_626B

link_var_error_handler:
		pop		hl
		ld		(freeRAM), hl
		ld		a, (sndRecState)
		cp		15h
		jr		z, p7Cloc_628B
		cp		11h
		jr		nz, p7Cloc_62C4

p7Cloc_628B:
		ld		hl, ioFlag
		bit		1, (hl)
		jr		z, p7Cloc_62C4
		call	p7Csub_47CB
		jr		z, p7Cloc_62A2
		call	OP4ToOP1
		call	ChkFindSym
		call	nc, DelVarArc
		jr		p7Cloc_62A5
; ---------------------------------------------------------------------------

p7Cloc_62A2:
		call	p7Csub_5C50

p7Cloc_62A5:
		call	CkOP1Real
		call	equ_or_newequ
		jr		nz, p7Cloc_62B7
		ld		a, (OP1+1)
		cp		5Eh ; '^'
		call	z, Create0Equ
		jr		p7Cloc_62C4
; ---------------------------------------------------------------------------

p7Cloc_62B7:
		call	IS_A_LSTorCLST
		jr		nz, p7Cloc_62C4
		ld		a, (OP1+1)
		cp		5Dh ; ']'
		call	z, Page0Call_321F

p7Cloc_62C4:
		ld		a, (sndRecState)
		cp		15h
		jp		z, JErrorNo
		scf
		jr		p7Cloc_62E6
; ---------------------------------------------------------------------------

Page7C_2C79:
		ld		a, (sndRecState)
		cp		0Ah

p7Cloc_62D4:
		jp		z, JErrorNo
		cp		15h
		jr		nz, p7Cloc_62E5
		ld		hl, ioFlag
		bit		1, (hl)
		jp		nz, resetRam
		jr		p7Cloc_62D4
; ---------------------------------------------------------------------------

p7Cloc_62E5:
		xor		a

p7Cloc_62E6:
		push	af
		call	p7Csub_6329
		call	Page7C_2DCF
		ld		a, 1
		ld		b, 36h ; '6'
		call	Page0Call_2E17
		pop		af
		ret
link_var_error_handler2:
		call	popErrorHandleR
		pop		hl
		ld		(freeRAM), hl
		call	OP4ToOP1
		call	ChkFindSym
		jr		c, p7Cloc_6310
		push	de
		call	page0_1F38
		pop		hl
		ld		de, 4
		call	DelMem

p7Cloc_6310:
		jp		p7Cloc_4976

; =============== S U B	R O U T	I N E =======================================


Get4BytesCursor:

		call	ApdSetup
		call	Rec1stByte

p7Cloc_6319:
		call	Get3Bytes
		ld		a, (header+1)
		ret
; End of function Get4BytesCursor


; =============== S U B	R O U T	I N E =======================================


Get4BytesNC:
		; p7Csub_4B62+59p	...
		call	ApdSetup
		ei
		call	Rec1stByteNC
		jr		p7Cloc_6319
; End of function Get4BytesNC


; =============== S U B	R O U T	I N E =======================================


p7Csub_6329:
		call	p7Csub_6B25
		ld		a, 3
		out		(0), a
		call	forceSlowSpeed
		ld		hl, 0FFFFh

p7Cloc_6336:
		ld		a, 4

p7Cloc_6338:
		nop
		nop
		nop
		nop
		dec		a
		jr		nz, p7Cloc_6338
		dec		hl
		ld		a, h
		or		l
		jr		nz, p7Cloc_6336
		call	restorePreviousSpeed
		ld		a, 0
		out		(0), a
		call	Page7C_2DCF
		ret
p7Csub_634F:
		ld		hl, {+}
		call	pushErrorHandleR
		ld		a, 1
		call	SendSkipExitPacket
		call	popErrorHandleR
+:		ret

; =============== S U B	R O U T	I N E =======================================


Convert85List:
		call	FINDSYM_GET_SIZE
		inc		hl
		push	hl
		inc		de
		inc		de
		push	de
		pop		hl

p7Cloc_6367:
		pop		bc
		dec		bc
		ld		a, b
		or		c
		jr		z, p7Cloc_6373
		push	bc
		call	Convert85Real
		jr		p7Cloc_6367
; ---------------------------------------------------------------------------

p7Cloc_6373:
		sbc		hl, de
		ret		z
		ex		de, hl
		jp		DelMem
; End of function Convert85List


; =============== S U B	R O U T	I N E =======================================


Convert85Real:
		; Convert85List+10p
		ld		a, (hl)
		ld		(de), a
		inc		hl
		inc		de
		push	hl
		call	ldHLind
		ld		bc, 0FC00h
		or		a
		sbc		hl, bc
		ld		a, l
		add		a, 80h ; '�'
		ld		(de), a
		pop		hl
		inc		hl
		inc		hl
		inc		de
		jp		Mov7B2
; End of function Convert85Real


; =============== S U B	R O U T	I N E =======================================


p7Csub_6393:
		; Page7C_2C4F+89p ...
		ld		l, 82h ; '�'
		bit		IDis82h, (iy+linkFlags)
		ret		nz
		ld		l, 95h ; '�'
		bit		IDis95h, (iy+linkFlags)
		ret		nz
		ld		l, 83h ; '�'
		bit		IDis83h, (iy+linkFlags)
		ret		nz
		ld		l, 3
		bit		IDis03h, (iy+linkFlags)
		ret		nz
		ld		l, 73h ; 's'
		ret
; End of function p7Csub_6393

; ---------------------------------------------------------------------------

SendDirectoryContents:
		call	p7Csub_6530
		ld		hl, JForceCmdNoChar
		call	pushErrorHandleR
		call	p7Csub_6B25
		call	MemChk
		ld		(ioData), hl
		ld		a, 15h
		ld		hl, 2
		call	p7Csub_404C
		ld		hl, symTable

p7Cloc_63CF:
		call	Page0Call_2F9D
		jr		c, p7Cloc_63F4
		push	hl
		call	OP2ToOP1
		ld		a, (OP1+1)
		cp		62h ; 'b'
		jr		z, p7Cloc_63F3
		call	p7Csub_6A79
		push	de
		call	Page7C_2DB7
		pop		de
		jr		z, p7Cloc_63F3
		call	CkOP1Real
		ex		de, hl
		call	p7Csub_6A62
		call	p7Csub_4006

p7Cloc_63F3:
		pop		hl

p7Cloc_63F4:
		ld		de, (unk_982E)
		call	CpHLDE
		jr		nz, p7Cloc_63CF
		call	ZeroOP1

p7Cloc_6400:
		ld		a, 14h
		ld		(OP1), a
		call	j_FindAppUp
		jr		c, p7Cloc_641B
		ld		a, d
		push	af
		call	j_FindAppNumPages
		pop		de
		ld		e, c
		ld		a, 24h ; '$'
		ld		(OP1), a
		call	p7Csub_4006
		jr		p7Cloc_6400
; ---------------------------------------------------------------------------

p7Cloc_641B:
		call	p7Csub_418C
		jp		p7Cloc_58A6

; =============== S U B	R O U T	I N E =======================================


p7Csub_6421:



		ld		b, a
		ld		a, (header)
		cp		8
		jp		z, p7Cloc_58ED
		cp		3
		jr		z, p7Cloc_6437
		cp		23h ; '#'
		jr		z, p7Cloc_6437
		cp		13h
		jp		nz, JErrorNo

p7Cloc_6437:
		ld		a, b
		ret
; End of function p7Csub_6421


; =============== S U B	R O U T	I N E =======================================


Page7C_2D87:
		push	af
		ld		a, (unk_8A0B)
		and		0E1h ; '�'
		ld		(unk_8A0B), a
		pop		af
		ret
; End of function Page7C_2D87


; =============== S U B	R O U T	I N E =======================================


p7Csub_6444:

		ld		b, a
		ld		a, (unk_8A0B)
		and		0Eh
		ld		a, b
		ret
; End of function p7Csub_6444


; =============== S U B	R O U T	I N E =======================================


p7Csub_644C:
		push	de
		push	bc
		push	hl
		ld		h, 9
		call	Send4BytePacket
		pop		hl
		pop		bc
		pop		de
		ld		(iMathPtr5), de
		push	bc
		call	Get4Bytes
		pop		bc
		ld		hl, ioFlag
		ld		a, (header+1)
		ret
; End of function p7Csub_644C


; =============== S U B	R O U T	I N E =======================================


p7Csub_6467:
		ld		(appSearchPage), a
		call	p7Csub_644C
		cp		15h
		jr		z, p7Cloc_6477
		cp		92h ; '�'
		jp		nz, JErrorNo
		ret
; ---------------------------------------------------------------------------

p7Cloc_6477:
		ld		hl, (unk_8676)
		or		a
		sbc		hl, bc
		jp		nz, JErrorNo
		ld		hl, ramStart
		call	p7Csub_64BB
		call	SendAck
		ld		de, (iMathPtr5)
		ld		bc, (unk_8676)
		ld		hl, ramStart
		ld		a, (appSearchPage)
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80C9h
; End of function p7Csub_6467

; ---------------------------------------------------------------------------
		ld		hl, (iMathPtr5)
		ld		bc, (unk_8676)
		add		hl, bc
		ld		a, 80h ; '�'
		cp		h
		jr		nz, p7Cloc_64B1
		ld		a, (appSearchPage)
		inc		a
		ld		(appSearchPage), a
		ld		hl, 4000h

p7Cloc_64B1:
		ex		de, hl
		ld		bc, 100h
		ld		a, (appSearchPage)
		jp		p7Csub_6467

; =============== S U B	R O U T	I N E =======================================


p7Csub_64BB:
		ld		bc, (unk_8676)
		ld		de, 0
		ld		(unk_8678), de
		ld		a, c
		or		b
		jr		z, p7Cloc_64D6

p7Cloc_64CA:
		call	CHKERRBREAK
		jp		nz, JErrorNo
		di
		call	p7Csub_651A
		jr		nz, p7Cloc_64CA

p7Cloc_64D6:
		; p7Csub_6B57:p7Cloc_6C0Ap
		rst		28h
; ---------------------------------------------------------------------------
		.dw		807Bh
; ---------------------------------------------------------------------------
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		807Bh
; ---------------------------------------------------------------------------
		ld		b, a
		pop		af
; End of function p7Csub_64BB


; =============== S U B	R O U T	I N E =======================================


p7Csub_64DF:
		ld		c, a
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_64FD
		in		a, (20h)
		and		1
		jr		z, p7Cloc_64FD
		xor		a
		out		(20h), a
		ld		de, 0FEh ; '�'

p7Cloc_64F2:
		dec		de
		ld		a, d
		or		e
		jr		nz, p7Cloc_64F2
		ld		a, 1
		out		(20h), a
		jr		p7Cloc_6505
; ---------------------------------------------------------------------------

p7Cloc_64FD:
		ld		de, 100h

p7Cloc_6500:
		dec		de
		ld		a, d
		or		e
		jr		nz, p7Cloc_6500

p7Cloc_6505:
		ld		hl, (unk_8678)
		or		a
		sbc		hl, bc
		jr		nz, p7Cloc_650E
		ret
; ---------------------------------------------------------------------------

p7Cloc_650E:
		ld		hl, (unk_8676)
		push	hl
		ld		h, 5Ah ; 'Z'
		call	Send4BytePacket
		jp		JErrorNo
; End of function p7Csub_64DF


; =============== S U B	R O U T	I N E =======================================


p7Csub_651A:
		push	bc
		rst		28h
; ---------------------------------------------------------------------------
		.dw		807Bh
; ---------------------------------------------------------------------------
		ld		(hl), a
		inc		hl
		ex		de, hl
		ld		b, 0
		ld		hl, (unk_8678)
		add		hl, bc
		ld		(unk_8678), hl
		ex		de, hl
		pop		bc
		dec		bc
		ld		a, b
		or		c
		ret
; End of function p7Csub_651A


; =============== S U B	R O U T	I N E =======================================


p7Csub_6530:

		ld		a, 9
		call	j_PULLDOWNCHK
		call	nc, j_clrTR
		jr		c, p7Cloc_653D
		call	Page0Call_2D21

p7Cloc_653D:
		bit		allowProgTokens, (iy+newDispF)
		call	nz, j_TraceOff
		call	j_CursorOff
		set		monAbandon, (iy+monFlags)
		call	cxPutAway
		ld		a, (mcxCurApp)
		cp		40h ; '@'
		ret		nz
		set		nocxPutAway, (iy+contextFlags)
		ret
; End of function p7Csub_6530

; ---------------------------------------------------------------------------

p7Cloc_6559:
		call	p7Csub_6530
		ld		hl, JForceCmdNoChar
		call	pushErrorHandleR
		call	p7Csub_6B25
		call	p7Csub_4B62
		jp		JErrorNo
; ---------------------------------------------------------------------------

Page7C_2C7F:
		push	hl
		push	ix
		ld		hl, 0
		ld		(curRow), hl
		call	Page0Call_3D05
		ld		hl, aApplicationS
		ld		a, 3Fh ; '?'
		call	p7Csub_6586
		call	j_newline
		pop		ix
		pop		hl
		ret

; =============== S U B	R O U T	I N E =======================================


p7Csub_6586:

		call	p7Csub_658D
		call	j_PutS
		ret
; End of function p7Csub_6586


; =============== S U B	R O U T	I N E =======================================


p7Csub_658D:
		; ReceiveVar-12p ...
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		ret
; End of function p7Csub_658D


; =============== S U B	R O U T	I N E =======================================


p7Csub_6595:
		call	p7Csub_658D
		ld		de, appID
		ld		bc, 10h
		ldir
		ret
; End of function p7Csub_6595

; ---------------------------------------------------------------------------

Page7C_2C85:
		push	bc
		push	af
		push	hl
		push	ix
		ex		de, hl
		inc		hl
		call	p7Csub_6D77
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		push	af
		and		0F0h ; '�'
		ld		c, a
		pop		af
		xor		c
		ld		(appID), a
		inc		hl
		ld		c, a
		ld		b, 0
		call	p7Csub_6D77
		ld		de, 838Eh
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8054h
; ---------------------------------------------------------------------------
		ld		hl, curCol
		ld		(hl), 0
		ld		hl, appID
		call	j_PutPS
		pop		ix
		pop		hl
		pop		af
		pop		bc
		ret
; ---------------------------------------------------------------------------

Page7C_2C8B:
		push	bc
		push	af
		push	hl
		push	ix
		push	af
		ld		hl, 4000h
		ld		de, 8040h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8075h
; ---------------------------------------------------------------------------
		jr		nz, p7Cloc_6608
		inc		hl
		pop		af
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		805Ah
; ---------------------------------------------------------------------------
		ld		a, c
		ld		(appID), a
		pop		af
		ld		de, 838Eh
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8054h
; ---------------------------------------------------------------------------
		ld		hl, curCol
		ld		(hl), 0
		ld		hl, appID
		call	j_PutPS

p7Cloc_6602:
		pop		ix
		pop		hl
		pop		af
		pop		bc
		ret
; ---------------------------------------------------------------------------

p7Cloc_6608:
		pop		af
		jr		p7Cloc_6602

; =============== S U B	R O U T	I N E =======================================


ret_6:
		call	Page0Call_2C19
		ret		nz
		ld		a, 28h ; '('
		ld		(unk_867F), a
		ld		a, 73h ; 's'
		ld		(header), a
		ld		hl, 100h
		ld		(ioData), hl
		call	p7Csub_6D6E
		push	af
		ld		hl, 4001h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		ld		c, a
		inc		hl
		pop		af
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		ld		b, a
		inc		hl
		pop		af
		ld		(unk_8683), bc
		push	bc
		ld		hl, 4000h
		push	hl
		push	af
		jp		p7Cloc_6673
; End of function ret_6


; =============== S U B	R O U T	I N E =======================================


SendCertificate:
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8057h
; ---------------------------------------------------------------------------
		call	Page0Call_2BE9
		push	hl
		push	hl
		inc		hl
		call	p7Csub_6D77
		rst		28h
; ---------------------------------------------------------------------------
		.dw		805Ah
; ---------------------------------------------------------------------------
		adc	hl, bc
		inc		hl
		call	p7Csub_6D77
		rst		28h
; ---------------------------------------------------------------------------
		.dw		805Ah
; ---------------------------------------------------------------------------
		add		hl, bc
		pop		bc
		or		a
		sbc		hl, bc
		push	hl
		pop		bc
		pop		hl
		push	bc
		push	hl
		push	af
		ld		a, 25h ; '%'
		ld		(unk_867F), a
		ld		a, 73h ; 's'
		ld		(header), a
		ld		hl, 0E8h ; '�'
		ld		(ioData), hl

p7Cloc_6673:
		call	p7Csub_4047
		pop		af
		pop		hl
		pop		bc

p7Cloc_6679:
		push	bc
		push	hl
		ld		(appSearchPage), a
		call	Get4BytesNC
		ld		a, (header+1)
		cp		9
		jp		nz, JErrorNo
		call	SendAck
		ld		de, ramStart
		ld		bc, (ioData)
		ld		a, (appSearchPage)
		pop		hl
		push	hl
		push	bc
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8054h
; ---------------------------------------------------------------------------
		pop		bc
		ld		hl, ramStart
		ld		de, (ioData)
		call	SendRAMVarData
		pop		hl
		ld		bc, (ioData)
		add		hl, bc
		ex		de, hl
		pop		hl
		or		a
		sbc		hl, bc
		push	hl
		pop		bc
		ex		de, hl
		jr		c, p7Cloc_66CB
		ld		a, h
		cp		80h ; '�'
		jr		nz, p7Cloc_66C6
		ld		hl, 4000h
		ld		a, (appSearchPage)
		inc		a
		ld		(appSearchPage), a

p7Cloc_66C6:
		ld		a, (appSearchPage)
		jr		p7Cloc_6679
; ---------------------------------------------------------------------------

p7Cloc_66CB:
		call	Get4BytesNC
		ld		a, (header+1)
		cp		9
		jp		nz, JErrorNo
		call	SendAck
		ld		a, 92h ; '�'
		ld		(header+1), a
		ld		a, 73h ; 's'
		ld		(header), a
		ld		bc, 0
		ld		(unk_8676), bc
		call	Send4Bytes
		call	Get4BytesNC
		ld		a, (header+1)
		cp		56h ; 'V'
		ret		z
		cp		36h ; '6'
		jp		z, p7Cloc_6764
		jp		JErrorNo
; End of function SendCertificate


; =============== S U B	R O U T	I N E =======================================


p7Csub_66FE:
		; SendOSValidationData+56p
		ld		a, 15h
		ld		(iMathPtr5), hl
		ld		(unk_8676), de
		ld		h, a
		call	p7Csub_6B25
		call	p7Csub_6393
		ld		(header), hl
		ld		a, (sndRecState)
		cp		8
		call	Send4Bytes
		ld		de, (unk_8676)
		ld		hl, (iMathPtr5)
		ld		bc, 0
		ld		(unk_8678), bc
		jr		p7Cloc_6734
; ---------------------------------------------------------------------------

p7Cloc_6729:
		call	CHKERRBREAK
		push	de
		ld		c, (hl)
		call	SendDataByte
		pop		de
		dec		de
		inc		hl

p7Cloc_6734:
		ld		a, d
		or		e
		jr		nz, p7Cloc_6729
		di
		ld		hl, (unk_8678)
		ld		a, l
		push	hl
		call	SendAByte
		pop		af
		call	SendAByte
		call	Get4BytesNC
		cp		56h ; 'V'
		jr		z, p7Cloc_6757
		cp		92h ; '�'
		jr		z, p7Cloc_675A
		cp		36h ; '6'
		jp		nz, JErrorNo
		jr		p7Cloc_6764
; ---------------------------------------------------------------------------

p7Cloc_6757:
		xor		a
		jr		p7Cloc_6760
; ---------------------------------------------------------------------------

p7Cloc_675A:
		ld		a, 1
		jr		p7Cloc_6760
; ---------------------------------------------------------------------------

p7Cloc_675E:
		ld		a, 2

p7Cloc_6760:
		ld		(appInfo), a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6764:
		; SendCertificate+B8j ...
		call	GetSmallPacket
		ld		a, (unk_867F)
		cp		0
		jr		z, p7Cloc_675E
		call	popErrorHandleR
		ld		a, (unk_867F)
		cp		1
		jp		z, ErrMemory
		cp		7
		jp		z, Page0Call_2539
		cp		8
		jp		z, Page0Call_2539
		cp		9
		jp		z, Page0Call_253D
		cp		0Bh
		jp		z, Page0Call_2541
		cp		1
		jp		z, p7Cloc_4E18
		jp		JError
; End of function p7Csub_66FE


; =============== S U B	R O U T	I N E =======================================


SendApplication:
		ld		bc, 0
		ld		(MD5Buffer), bc
		ld		(unk_83A3), bc
		push	af
		ld		a, 0FFh
		ld		(unk_83A3+1), a
		pop		af
		ld		hl, 4000h
		ld		de, 8080h
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8075h
; ---------------------------------------------------------------------------
		jp		nz, locret_689B
		pop		af
		push	af
		inc		hl
		inc		hl
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		ld		c, a
		pop		af

p7Cloc_67BD:
		ld		de, 4000h
		ld		hl, 4000h
		push	de
		push	bc

p7Cloc_67C5:
		push	bc
		push	hl
		push	af
		ld		a, 24h ; '$'
		ld		(unk_867F), a
		ld		a, 73h ; 's'
		ld		(header), a
		ld		a, b
		ld		(unk_8685), a
		ld		(unk_8683), de
		xor		a
		ld		(unk_867F+1), a
		ld		(unk_8681), a
		ld		(unk_8686), a
		ld		a, 4
		ld		(unk_8681+1), a
		ld		hl, 80h	; '�'
		ld		(ioData), hl
		call	p7Csub_4047
		call	Get4BytesNC
		ld		a, (header+1)
		cp		36h ; '6'
		jp		z, p7Cloc_6764
		cp		9
		jp		nz, JErrorNo
		call	SendAck
		ld		de, ramStart
		pop		af
		ld		bc, 80h	; '�'
		pop		hl
		push	af
		ld		(ramCodeEnd), a
		push	hl
		push	bc
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8054h
; ---------------------------------------------------------------------------
		pop		bc
		ld		hl, ramStart
		ld		de, 80h	; '�'
		ld		a, 0
		push	hl
		ld		hl, 83A3h
		cp		(hl)
		pop		hl
		jr		nz, p7Cloc_6841
		ld		a, (ramCodeEnd)
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	Page0Call_2C2B
		call	FlashWriteDisable

p7Cloc_6841:
		call	p7Csub_66FE
		ld		a, (appInfo)
		cp		0
		jr		z, p7Cloc_6853
		pop		hl
		pop		af
		pop		bc
		pop		bc
		pop		de
		push	af
		jr		p7Cloc_689A
; ---------------------------------------------------------------------------

p7Cloc_6853:
		pop		hl
		ld		bc, 80h	; '�'
		adc	hl, bc
		push	hl
		pop		de
		ld		a, 0FFh
		ld		(unk_83A3), a
		ld		bc, 80h	; '�'
		call	p7Csub_6E37
		jr		c, p7Cloc_6883
		ld		hl, (MD5Buffer)
		call	p7Csub_6E31
		add		hl, bc
		call	p7Csub_6E31
		ld		(MD5Buffer), hl
		ld		a, (MD5Buffer)
		cp		40h ; '@'
		jr		z, p7Cloc_6883
		pop		af
		pop		bc
		push	de
		pop		hl
		jp		p7Cloc_67C5
; ---------------------------------------------------------------------------

p7Cloc_6883:
		; SendApplication+E5j
		pop		af
		pop		bc
		pop		bc
		inc		b
		pop		de
		push	af
		dec		c
		ld		a, 0
		or		c
		jr		z, p7Cloc_689A
		pop		af
		dec		a
		ld		hl, 0
		ld		(MD5Buffer), hl
		jp		p7Cloc_67BD
; ---------------------------------------------------------------------------

p7Cloc_689A:
		; SendApplication+F8j
		pop		af

locret_689B:
		ret
; End of function SendApplication


; =============== S U B	R O U T	I N E =======================================


FlashWriteDisable:
		nop
		nop
		nop
		nop
		push	af
		xor		a
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		or		a
		jp		nz, 0
		pop		af
		ret
; End of function FlashWriteDisable


; =============== S U B	R O U T	I N E =======================================


SendOSHeader:
		ld		hl, 4000h
		ld		de, ramStart
		ld		bc, 100h
		jr		p7Cloc_68D0
; End of function SendOSHeader


; =============== S U B	R O U T	I N E =======================================


SendOSValidationData:
		ld		hl, 4100h
		ld		de, ramStart
		ex		de, hl
		ld		a, 2
		ld		(hl), a
		inc		hl
		ld		a, 0Dh
		ld		(hl), a
		inc		hl
		ex		de, hl
		ld		bc, 0FEh ; '�'

p7Cloc_68D0:
		ld		a, 7Ah ; 'z'
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8054h
; ---------------------------------------------------------------------------
		push	hl
		ld		bc, 100h
		ld		(ioData), bc
		ld		a, 23h ; '#'
		ld		(unk_867F), a
		ld		a, 80h ; '�'
		ld		(unk_8681+1), a
		ld		a, 73h ; 's'
		ld		(header), a
		ld		hl, 4000h
		ld		(unk_8683), hl
		ld		a, 1Ah
		ld		(unk_8685), a
		call	p7Csub_4047
		call	Get4BytesCursor
		ld		a, (header+1)
		cp		36h ; '6'
		jp		z, p7Cloc_6918
		cp		9
		jp		nz, JError
		call	SendAck
		ld		hl, ramStart
		ld		de, 100h
		call	p7Csub_66FE
		pop		hl
		ret
; ---------------------------------------------------------------------------

p7Cloc_6918:
		call	GetSmallPacket
		call	popErrorHandleR
		call	Page7C_2DCF
		jp		p7Cloc_4E18
; End of function SendOSValidationData


; =============== S U B	R O U T	I N E =======================================


SendOSPage:
		push	hl
		cp		0
		jr		nz, p7Cloc_6937
		ld		hl, 4000h
		ld		(unk_839F), hl
		ld		hl, 0
		ld		de, 0
		jr		p7Cloc_6943
; ---------------------------------------------------------------------------

p7Cloc_6937:
		ld		hl, ramStart
		ld		(unk_839F), hl
		ld		hl, 4000h
		ld		de, 4000h

p7Cloc_6943:
		ld		(unk_83A1), a

p7Cloc_6946:
		push	hl
		ld		a, 23h ; '#'
		ld		(unk_867F), a
		ld		a, 73h ; 's'
		ld		(header), a
		ld		a, 0
		ld		(unk_8681+1), a
		ld		a, (unk_83A1)
		and		1Fh
		ld		(unk_8685), a
		ld		(unk_8683), de
		ld		hl, 100h
		ld		(ioData), hl
		call	p7Csub_4047
		call	Get4BytesCursor
		ld		a, (header+1)
		cp		9
		jp		nz, JError
		call	SendAck
		ld		de, ramStart
		ld		bc, 100h
		pop		hl
		ld		a, (unk_83A1)
		ld		(ramCodeEnd), a
		push	hl
		push	bc
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8054h
; ---------------------------------------------------------------------------
		ld		a, (unk_83A1)
		cp		0
		jr		nz, p7Cloc_69A2
		pop		bc
		pop		hl
		push	hl
		push	bc
		cp		h
		jr		nz, p7Cloc_69A2
		ld		hl, 8056h
		ld		a, 0FFh
		ld		(hl), a
		ld		a, (unk_83A1)

p7Cloc_69A2:
		; SendOSPage+73j
		and		1Fh
		cp		1Ah
		jr		nz, p7Cloc_69B4
		pop		bc
		pop		hl
		push	hl
		push	bc
		ld		a, 42h ; 'B'
		cp		h
		jr		c, p7Cloc_69B4
		call	nz, p7Csub_6A1E

p7Cloc_69B4:
		; SendOSPage+8Bj
		pop		bc
		ld		hl, ramStart
		ld		de, 100h
		ld		a, 15h
		call	SendRAMCmd
		pop		hl
		ld		bc, 100h
		add		hl, bc
		ld		d, h
		ld		e, l
		ld		a, (unk_839F+1)
		cp		h
		jp		nz, p7Cloc_6946
		ld		a, (unk_83A1)
		pop		hl
		ret
; End of function SendOSPage


; =============== S U B	R O U T	I N E =======================================


SendOS:
		call	SendOSHeader
		ld		hl, SendOSPageTable

p7Cloc_69D9:
		ld		a, (hl)
		cp		0FFh
		jr		z, p7Cloc_69EB
		call	NZIf83Plus
		jr		z, p7Cloc_69E5
		and		1Fh

p7Cloc_69E5:
		call	SendOSPage
		inc		hl
		jr		p7Cloc_69D9
; ---------------------------------------------------------------------------

p7Cloc_69EB:
		call	SendOSValidationData
		call	p7Csub_6393
		ld		(header), hl
		di
		ld		a, 92h ; '�'
		ld		(header+1), a
		call	Send4Bytes
		ei
		call	Get4BytesCursor
		ld		a, (header+1)
		cp		56h ; 'V'
		ret		z
		cp		36h ; '6'
		jp		z, p7Cloc_6764
		jp		JErrorNo
; End of function SendOS

SendOSPageTable:
		.db		0
		.db		1
		.db		2
		.db		3
		.db		4
		.db		5
		.db		6
		.db		7
		.db		78h	; x
		.db		79h	; y
		.db		7Ah	; z
		.db		7Bh	; {
		.db		7Ch	; |
		.db		7Dh	; }
		.db		0FFh

; =============== S U B	R O U T	I N E =======================================


p7Csub_6A1E:
		ld		hl, ramStart
		ld		bc, 100h
		ld		a, 0FFh

p7Cloc_6A26:
		ld		(hl), a
		inc		hl
		dec		bc
		ld		a, b
		or		c
		ld		a, 0FFh
		jr		nz, p7Cloc_6A26
		ret
; End of function p7Csub_6A1E


; =============== S U B	R O U T	I N E =======================================


p7Csub_6A30:
		; ReceiveVar+2F5p ...
		ld		a, (unk_8A0B)
		and		1Eh
		scf
		ret		nz
		ld		a, (unk_8688)
		cp		4
		ret
; End of function p7Csub_6A30


; =============== S U B	R O U T	I N E =======================================


p7Csub_6A3D:
		; SendVariable:p7Cloc_59EFp
		scf
		bit		IDis83h, (iy+linkFlags)
		ret		z

p7Cloc_6A43:
		push	hl
		push	af
		ld		hl, (OP2EXT)
		ld		a, h
		or		l
		jr		z, p7Cloc_6A5E
		ld		a, (hl)
		and		1Fh
		cp		14h
		jr		c, p7Cloc_6A58

p7Cloc_6A53:
		pop		af
		pop		hl
		scf
		ccf
		ret
; ---------------------------------------------------------------------------

p7Cloc_6A58:
		dec		hl
		dec		hl
		ld		a, (hl)
		or		a
		jr		nz, p7Cloc_6A53

p7Cloc_6A5E:
		pop		af
		pop		hl
		scf
		ret
; End of function p7Csub_6A3D


; =============== S U B	R O U T	I N E =======================================


p7Csub_6A62:
		; SendVariable+24p ...
		bit		7, h
		jr		nz, p7Cloc_6A75
		ld		a, (OP2+8)
		call	Page0Call_3267
		ld		d, b
		ld		e, c
		call	CkOP1Real
		call	Page0Call_20F8
		ret
; ---------------------------------------------------------------------------

p7Cloc_6A75:
		call	DataSize
		ret
; End of function p7Csub_6A62


; =============== S U B	R O U T	I N E =======================================


p7Csub_6A79:

		call	ChkFindSym
		call	Page0Call_2EA7
		ld		(OP2EXT), hl
		push	af
		ld		a, b
		ld		(OP2+8), a
		pop		af
		ret
; End of function p7Csub_6A79


; =============== S U B	R O U T	I N E =======================================


p7Csub_6A89:
		call	CkOP1Real
		cp		14h
		ret		nc
		sub		0Fh
		ccf
		ret
; End of function p7Csub_6A89


; =============== S U B	R O U T	I N E =======================================


CheckLinkLines:

		ld		bc, 0Fh
		ld		hl, ioData
		ld		(hl), a
		call	NZIf83Plus
		jr		nz, p7Cloc_6AAE
		bit		silentLinkActive, (iy+silentLinkFlags)
		jr		nz, p7Cloc_6ABA
		in		a, (20h)
		and		1
		jr		z, p7Cloc_6AAE
		ld		bc, 20h	; ' '

p7Cloc_6AAE:
		; CheckLinkLines+16j ...
		in		a, (0)
		and		3
		cp		(hl)
		ret		nz
		dec		bc
		ld		a, c
		or		b
		jr		nz, p7Cloc_6AAE
		ret
; ---------------------------------------------------------------------------

p7Cloc_6ABA:
		xor		a
		ret
; End of function CheckLinkLines

; ---------------------------------------------------------------------------

p7Cloc_6ABC:
RejectCommand:
		add		a, e
		call	NZIf83Plus
		call	nz, CheckLinkLines
		ret		nz
		bit		indicOnly, (iy+indicFlags)
		push	af
		ld		hl, RejectCommandHandler
		call	pushErrorHandleR
		ld		a, (ioData)
		call	p7Cloc_43C7
		bit		5, (iy+3Dh)
		jp		nz, p7Cloc_6B0E
		ld		(header), a
		call	p7Cloc_4380
		ld		a, (header+1)
		cp		68h ; 'h'
		jr		nz, p7Cloc_6AF2
		call	SendAck
		jr		p7Cloc_6B0E
RejectCommandTable:
		.db		29h
		.db		2Ah
		.db		87h
		.db		6Dh
p7Cloc_6AF2:
		ld		hl, RejectCommandTable
		ld		bc, 4
		cpir
		jr		z, p7Cloc_6B09
		ld		hl, (unk_8676)

p7Cloc_6AFF:
		ld		a, h
		or		l
		jr		nz, p7Cloc_6B13
		call	RecAByteIO
		call	RecAByteIO

p7Cloc_6B09:
		ld		a, 5
		call	SendSkipExitPacket

p7Cloc_6B0E:
		call	popErrorHandleR
		jr		p7Cloc_6B1F
; ---------------------------------------------------------------------------

p7Cloc_6B13:
		push	hl
		call	RecAByteIO
		pop		hl
		dec		hl
		jr		p7Cloc_6AFF

RejectCommandHandler:
		res		bPLinkOn, (iy+hookflags1)

p7Cloc_6B1F:
		pop		af
		res		indicOnly, (iy+indicFlags)
		ret		z

; =============== S U B	R O U T	I N E =======================================


p7Csub_6B25:
		; Send4BytePacketp ...
		set		indicOnly, (iy+indicFlags)
		ret
; End of function p7Csub_6B25

; ---------------------------------------------------------------------------

SendGetkeyPress:
		push	af
		ld		hl, {+}
		call	pushErrorHandleR
		ld		hl, 8773h
		ld		(header), hl
		ld		(unk_8676), a
		call	Send4Bytes
		call	popErrorHandleR
		pop		af
		ret
+:		res		enableKeyEcho, (iy+hookflags1)
		pop		af
		ret

; =============== S U B	R O U T	I N E =======================================


p7Csub_6B48:
		call	p7Csub_6B25
		call	GetSmallPacket
		call	p7Csub_6421
		ld		hl, 867Fh
		ld		a, (hl)
		rst		20h
		ret
; End of function p7Csub_6B48


; =============== S U B	R O U T	I N E =======================================


p7Csub_6B57:
		push	de
		call	p7Csub_6F33
		call	Get4Bytes
		pop		de
		ld		hl, ioFlag
		ld		a, (header+1)
		cp		9
		jp		nz, JErrorNo
		push	de
		call	SendAck
		call	Get4Bytes
		pop		de
		ld		hl, ioFlag
		ld		a, (header+1)
		cp		15h
		jp		nz, JErrorNo
		push	de
		ld		bc, (unk_8676)
		ld		de, 0
		ld		(unk_8678), de
		ld		a, c
		or		b
		pop		de
		jp		z, p7Cloc_6C0A
		ld		bc, (unk_8676)
		push	de
		rst		28h
		ld		a, e
		add		a, b
		ld		l, a
		push	hl
		ld		hl, (unk_8678)
		ld		b, 0
		add		hl, bc
		ld		(unk_8678), hl
		pop		hl
		rst		28h
; ---------------------------------------------------------------------------
		.dw		807Bh
; ---------------------------------------------------------------------------
		ld		h, a
		push	hl
		ld		hl, (unk_8678)
		ld		b, 0
		add		hl, bc
		ld		(unk_8678), hl
		pop		hl
		ld		bc, (unk_8676)
		dec		bc
		dec		bc
		pop		de

p7Cloc_6BB9:
		push	hl
		push	de
		ld		de, 0
		ld		hl, OP1

p7Cloc_6BC1:
		call	CHKERRBREAK
		jp		nz, JErrorNo
		push	de
		call	p7Csub_651A
		pop		de
		inc		de
		ld		a, e
		cp		9
		jp		nz, p7Cloc_6BC1
		pop		de
		push	bc
		push	de
		ld		bc, 9
		ld		hl, OP1M
		ld		de, OP4
		ldir
		call	OP1ToOP3
		pop		de
		call	Page0Call_2C31
		jr		nz, p7Cloc_6BFF
		push	de
		call	OP3ToOP1
		pop		de
		ld		a, 1
		call	j_IncLstSize
		call	j_AdrLEle
		ex		de, hl
		ld		hl, OP1
		ld		a, (hl)
		call	mov9B2

p7Cloc_6BFF:
		pop		bc
		pop		hl
		dec		hl
		ld		de, (insDelPtr)
		ld		a, l
		or		h
		jr		nz, p7Cloc_6BB9

p7Cloc_6C0A:
		call	p7Cloc_64D6
		call	SendAck
		ret
; End of function p7Csub_6B57


; =============== S U B	R O U T	I N E =======================================


p7Csub_6C11:
		call	p7Csub_644C
		cp		15h
		jr		z, p7Cloc_6C35
		cp		92h ; '�'
		jp		nz, JErrorNo
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8057h
; ---------------------------------------------------------------------------
		call	Page0Call_2BE9
		call	p7Csub_6D77
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		push	af
		call	p7Csub_6D77
		inc		hl
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		ld		l, a
		pop		af
		ld		h, a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6C35:
		ld		hl, (unk_8676)
		or		a
		sbc		hl, bc
		jp		nz, JErrorNo
		ld		hl, (unk_8676)
		push	hl
		ld		hl, (iMathPtr5)
		push	hl
		ld		hl, tempSwapArea
		call	p7Csub_64BB
		pop		de
		pop		bc
		call	p7Csub_6D77
		ld		hl, tempSwapArea
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8087h
; ---------------------------------------------------------------------------
		call	SendAck
		ld		hl, (iMathPtr5)
		ld		bc, 0E8h ; '�'
		add		hl, bc
		ex		de, hl
		jp		p7Csub_6C11
; End of function p7Csub_6C11

; ---------------------------------------------------------------------------

p7Cloc_6C65:
		; GetDataPacket+8Bp
		push	bc
		push	de
		push	hl
		ld		a, (pagedCount)
		ld		c, a
		xor		a
		ld		(pagedCount), a
		ld		hl, pagedBuf
		ld		(pagedGetPtr), hl
		ld		de, (iMathPtr5)
		ld		a, (arcInfo)
		push	de
		ld		(Abackup), a
		ld		a, i
		di
		push	af
		ld		a, (Abackup)
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		ld		b, 0
		call	p7Csub_6D5F
		jr		nc, p7Cloc_6CA7
		cp		8
		jr		c, p7Cloc_6CA7
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80C9h
; ---------------------------------------------------------------------------

p7Cloc_6CA7:
		call	FlashWriteDisable
		ld		(Abackup), a
		pop		af
		jp		po, p7Cloc_6CB2
		ei

p7Cloc_6CB2:
		ld		a, (Abackup)
		ld		(iMathPtr5), de
		pop		hl
		or		a
		sbc		hl, de
		jr		c, p7Cloc_6CC6
		ld		a, (arcInfo)
		inc		a
		ld		(arcInfo), a

p7Cloc_6CC6:
		pop		hl
		pop		de
		pop		bc
		ret

; =============== S U B	R O U T	I N E =======================================


p7Csub_6CCA:
		ld		a, 15h
		call	NZIf83Plus
		ret		nz
		ld		a, 69h ; 'i'
		ret
; End of function p7Csub_6CCA


; =============== S U B	R O U T	I N E =======================================


p7Csub_6CD3:
		call	p7Csub_6CCA
		ld		hl, 4000h
		call	j_FindAppNumPages
		xor		a
		cp		c
		jr		z, p7Cloc_6D0A
		call	j_FindSwapSector
		inc		a
		ld		b, a
		call	p7Csub_6CCA
		call	j_CopyFlashPage
		dec		a
		inc		b
		call	j_CopyFlashPage
		call	p7Csub_6D6E
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		call	j_FindSwapSector
		inc		a
		push	af
		call	p7Csub_6CCA
		ld		b, a
		pop		af
		call	j_CopyFlashPage
		inc		a
		dec		b
		call	j_CopyFlashPage
		jr		p7Cloc_6D10
; ---------------------------------------------------------------------------

p7Cloc_6D0A:
		call	p7Csub_6D6E
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------

p7Cloc_6D10:
		call	j_FindSwapSector
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		pop		af
		call	Page0Call_2C3D
		ret
; End of function p7Csub_6CD3


; =============== S U B	R O U T	I N E =======================================


LoadDEIndPaged:
		call	LoadCIndPaged
		ld		e, c
		inc		hl
		bit		7, h
		jr		z, p7Cloc_6D29
		inc		b
		ld		hl, 4000h

p7Cloc_6D29:
		call	LoadCIndPaged
		ld		d, c
		ret
; End of function LoadDEIndPaged

; ---------------------------------------------------------------------------

Page7C_3E31:
		push	hl
		push	de
		push	bc
		push	af
		ld		b, a
		call	LoadDEIndPaged
		ex		de, hl
		ld		e, h
		ld		d, l
		ld		hl, ramStart
		ld		a, 0Fh
		or		l
		ld		l, a
		or		a
		sbc		hl, de
		jr		nz, p7Cloc_6D4A

p7Cloc_6D45:
		pop		af
		ld		b, a
		xor		a
		jr		p7Cloc_6D5A
; ---------------------------------------------------------------------------

p7Cloc_6D4A:
		pop		af
		push	af
		ld		h, 0
		ld		l, 0Fh
		or		a
		sbc		hl, de
		jr		z, p7Cloc_6D45
		pop		af
		ld		b, a
		ld		a, 1
		or		a

p7Cloc_6D5A:
		ld		a, b
		pop		bc
		pop		de
		pop		hl
		ret

; =============== S U B	R O U T	I N E =======================================


p7Csub_6D5F:
		; Page7C_2C91+1Bp
		call	NZIf83Plus
		jr		nz, p7Cloc_6D69
		and		7Fh ; ''
		cp		6Ah ; 'j'
		ret
; ---------------------------------------------------------------------------

p7Cloc_6D69:
		and		1Fh
		cp		16h
		ret
; End of function p7Csub_6D5F


; =============== S U B	R O U T	I N E =======================================


p7Csub_6D6E:
		ld		a, 16h
		call	NZIf83Plus
		ret		nz
		ld		a, 6Ah ; 'j'
		ret
; End of function p7Csub_6D6E


; =============== S U B	R O U T	I N E =======================================


p7Csub_6D77:
		in		a, (2)
		and		80h ; '�'
		ld		a, 1Eh
		ret		z
		ld		a, 7Eh ; '~'
		ret
; End of function p7Csub_6D77

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR SendAByte

p7Cloc_6D81:
		call	p7Csub_6F37
		call	p7Csub_6DA1
		call	p7Csub_6DA1

p7Cloc_6D8A:
		ld		a, 250
		ld		(linkAssistHaltTickDelay), a
		in		a, (9)
		bit		5, a
		jr		z, p7Cloc_6D99
		ld		a, c
		out		(0Dh), a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6D99:
		call	p7Csub_6DB3
		jr		z, p7Cloc_6D8A

p7Cloc_6D9E:
		jp		p7Cloc_442B
; END OF FUNCTION CHUNK	FOR SendAByte

; =============== S U B	R O U T	I N E =======================================


p7Csub_6DA1:
		; SendAByte+2B83p ...
		push	hl
		ld		hl, 0FFFFh
		in		a, (20h)
		and		1
		jr		nz, p7Cloc_6DAE
		ld		hl, 6800h

p7Cloc_6DAE:
		ld		(unk_9CAC), hl
		pop		hl
		ret
; End of function p7Csub_6DA1


; =============== S U B	R O U T	I N E =======================================


p7Csub_6DB3:
		; p7Csub_6DDC+Ep
		push	hl
		ld		h, 2

p7Cloc_6DB6:
		dec		h
		jr		nz, p7Cloc_6DB6
		ld		hl, (unk_9CAC)
		dec		hl
		ld		(unk_9CAC), hl
		ld		a, l
		or		h
		jr		nz, p7Cloc_6DC8
		ld		a, 1
		jr		p7Cloc_6DCA
; ---------------------------------------------------------------------------

p7Cloc_6DC8:
		ld		a, 0

p7Cloc_6DCA:
		or		a
		pop		hl
		ret
; End of function p7Csub_6DB3


; =============== S U B	R O U T	I N E =======================================


p7Csub_6DCD:
		; p7Csub_6DCD+Aj
		call	CHKERRBREAK
		call	HandleLinkKeyActivity
		in		a, (9)
		and		58h ; 'X'
		jr		z, p7Csub_6DCD
		call	p7Csub_6B25
; End of function p7Csub_6DCD


; =============== S U B	R O U T	I N E =======================================


p7Csub_6DDC:
		call	p7Csub_6F37
		call	p7Csub_6DA1
		call	p7Csub_6DA1

p7Cloc_6DE5:
		ld		a, 0
		ld		(linkAssistHaltTickDelay), a
		call	p7Csub_6DB3
		jr		nz, p7Cloc_6D9E
		in		a, (9)
		bit		6, a
		jr		nz, p7Cloc_6DFF
		and		11h
		jr		z, p7Cloc_6DE5
		in		a, (0Ah)
		ld		c, a
		ld		a, 0
		ret
; ---------------------------------------------------------------------------

p7Cloc_6DFF:
		and		11h
		jp		z, p7Cloc_44F8
		in		a, (0Ah)
		ld		c, a
		ld		a, 1
		ret
; End of function p7Csub_6DDC

; ---------------------------------------------------------------------------

Page7C_3EAF:
		ld		a, 0
		out		(0), a
		ld		a, 97h ; '�'
		out		(9), a
		ld		a, 0B4h	; '�'
		out		(0Ah), a
		out		(0Bh), a
		out		(0Ch), a

; =============== S U B	R O U T	I N E =======================================


p7Csub_6E1A:
		ld		a, 80h ; '�'
		out		(8), a
		xor		a
		out		(8), a
		in		a, (9)
		set		silentLinkActive, (iy+silentLinkFlags)
		xor		a
		ret
; End of function p7Csub_6E1A


; =============== S U B	R O U T	I N E =======================================


p7Csub_6E29:
		ld		hl, 8685h
		ld		e, a
		ld		d, 0
		add		hl, de
		ret
; End of function p7Csub_6E29


; =============== S U B	R O U T	I N E =======================================


p7Csub_6E31:
		; SendApplication+DAp ...
		push	af
		ld		a, l
		ld		l, h
		ld		h, a
		pop		af
		ret
; End of function p7Csub_6E31


; =============== S U B	R O U T	I N E =======================================


p7Csub_6E37:
		ld		a, (unk_83A3+1)
		or		a
		ret		z
		ld		hl, (unk_83A1)
		call	p7Csub_6E31
		or		a
		sbc		hl, bc
		call	p7Csub_6E31
		ld		(unk_83A1), hl
		ret		nc
		ld		hl, 83A0h
		ld		a, (hl)
		sub		1
		ld		(hl), a
		ret		nc
		dec		hl
		ld		a, (hl)
		sub		1
		ld		(hl), a
		ret
; End of function p7Csub_6E37


; =============== S U B	R O U T	I N E =======================================


p7Csub_6E5A:
		push	hl
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_6E6A
		ld		hl, 39h	; '9'
		in		a, (20h)
		and		1
		jr		nz, p7Cloc_6E6D

p7Cloc_6E6A:
		ld		hl, 17h

p7Cloc_6E6D:
		dec		hl
		ld		a, h
		or		l
		jr		z, p7Cloc_6E7B
		in		a, (0)
		and		3
		jr		z, p7Cloc_6E6D

p7Cloc_6E78:
		pop		hl
		ld		a, c
		ret
; ---------------------------------------------------------------------------

p7Cloc_6E7B:
		scf
		jr		p7Cloc_6E78
; End of function p7Csub_6E5A


; =============== S U B	R O U T	I N E =======================================


p7Csub_6E7E:
		push	hl
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_6EC4
		ld		hl, 37h	; '7'
		in		a, (20h)
		and		1
		jr		z, p7Cloc_6EC4
		jr		p7Cloc_6EC7
; End of function p7Csub_6E7E


; =============== S U B	R O U T	I N E =======================================


p7Csub_6E90:

		push	hl
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_6EC4
		ld		hl, 28h	; '('
		in		a, (20h)
		and		1
		jr		nz, p7Cloc_6EA2
		ld		l, 10h

p7Cloc_6EA2:
		dec		hl
		ld		a, h
		or		l
		jr		z, p7Cloc_6EE0
		in		a, (9)
		bit		6, a
		jr		nz, p7Cloc_6EC1
		bit		4, a
		jr		nz, p7Cloc_6EDD
		and		8
		jr		z, p7Cloc_6EA2
		in		a, (9)
		bit		6, a
		jr		nz, p7Cloc_6EC1
		and		19h
		jr		z, p7Cloc_6EA2
		jr		nz, p7Cloc_6EDD

p7Cloc_6EC1:
		xor		a
		jr		p7Cloc_6EDD
; ---------------------------------------------------------------------------

p7Cloc_6EC4:
		ld		hl, 16h

p7Cloc_6EC7:
		dec		hl
		ld		a, h
		or		l
		jr		z, p7Cloc_6EE0
		in		a, (0)
		and		3
		cp		3
		jr		z, p7Cloc_6EC7
		in		a, (0)
		and		3
		cp		3
		jr		z, p7Cloc_6EC7
		or		a

p7Cloc_6EDD:
		pop		hl
		ld		a, c
		ret
; ---------------------------------------------------------------------------

p7Cloc_6EE0:
		scf
		jr		p7Cloc_6EDD
; End of function p7Csub_6E90

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p7Csub_6EE6

p7Cloc_6EE3:
		jp		c, ErrLinkXmit
; END OF FUNCTION CHUNK	FOR p7Csub_6EE6

; =============== S U B	R O U T	I N E =======================================


p7Csub_6EE6:
		; p7Csub_4441:p7Cloc_446Dp ...



		call	p7Csub_6F20
		call	p7Csub_6E5A
		jr		c, p7Cloc_6EE3
		in		a, (2)
		and		80h ; '�'
		call	nz, p7Csub_6E1A

p7Cloc_6EF5:
		call	p7Csub_447D
		ld		d, a
		ld		a, c
		cp		1
		push	af
		push	de
		call	p7Csub_447D
		pop		de
		ld		e, a
		pop		af
		ld		b, a
		ld		a, c
		ret
; End of function p7Csub_6EE6

; ---------------------------------------------------------------------------
		ld		b, 8

p7Cloc_6F09:
		in		a, (9)
		and		19h
		jp		z, p7Csub_6E1A
		ld		a, (iy+3Dh)
		and		0F0h ; '�'
		ld		(iy+3Dh), a
		call	p7Csub_6DDC
		djnz	p7Cloc_6F09
		jp		p7Csub_6E1A

; =============== S U B	R O U T	I N E =======================================


p7Csub_6F20:

		in		a, (2)
		and		80h ; '�'
		ret		z
		in		a, (9)
		and		99h ; '�'
		ret		nz

p7Cloc_6F2A:
		res		silentLinkActive, (iy+silentLinkFlags)
		ld		a, 80h ; '�'
		out		(8), a
		ret
; End of function p7Csub_6F20


; =============== S U B	R O U T	I N E =======================================


p7Csub_6F33:
		; Send4Bytesp ...
		call	NZIf83Plus
		ret		nz
; End of function p7Csub_6F33


; =============== S U B	R O U T	I N E =======================================


p7Csub_6F37:
		; SendAByte:p7Cloc_6D81p ...
		bit		silentLinkActive, (iy+silentLinkFlags)
		ret		nz
		set		silentLinkActive, (iy+silentLinkFlags)
		in		a, (9)
		xor		a
		out		(8), a
		ret
; End of function p7Csub_6F37

; ---------------------------------------------------------------------------

KeyboardGetKey:
		in		a, (0)
		and		3
		cp		3
		jr		nz, p7Cloc_6F8D
		in		a, (2)
		and		80h ; '�'
		ret		z
		ld		hl, KeyboardGetKeyHandler
		call	pushErrorHandleR
		in		a, (9)
		bit		6, a
		jr		z, p7Cloc_6F84
		and		11h
		jr		z, p7Cloc_6F7D
		in		a, (0Ah)
		cp		0E0h ; '�'
		jr		nz, p7Cloc_6F76
		call	p7Cloc_6EF5
		call	p7Csub_6E1A
		call	popErrorHandleR
		ld		a, 0FBh	; '�'
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6F76:
		call	popErrorHandleR
		ld		a, 0FAh	; '�'
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6F7D:
		call	popErrorHandleR
		ld		a, 0F9h	; '�'
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6F84:
		and		19h
		jr		nz, p7Cloc_6F99
		call	popErrorHandleR
		xor		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6F8D:
		ld		hl, KeyboardGetKeyHandler
		call	pushErrorHandleR
		in		a, (2)
		and		80h ; '�'
		jr		z, p7Cloc_6FA9

p7Cloc_6F99:
		ld		b, 8
		call	p7Csub_6DDC
		cp		0
		jr		z, p7Cloc_6FB2
		ld		a, c
		cp		0E0h ; '�'
		jr		nz, p7Cloc_6FDF
		jr		p7Cloc_6FBE
; ---------------------------------------------------------------------------

p7Cloc_6FA9:
		ld		b, 8
		call	p7Cloc_44A9
		cp		0
		jr		nz, p7Cloc_6FD8

p7Cloc_6FB2:
		ld		a, c
		cp		0E0h ; '�'
		jr		nz, p7Cloc_6FCA
		call	p7Csub_6E90
		jr		c, p7Cloc_6FCA
		jr		nz, p7Cloc_6FCA

p7Cloc_6FBE:
		call	p7Csub_6EE6
		jr		nz, p7Cloc_6FD1
		call	popErrorHandleR
		ld		a, 1
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6FCA:
		call	popErrorHandleR
		ld		a, 2
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6FD1:
		call	popErrorHandleR
		ld		a, 0FCh	; '�'
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6FD8:
		call	popErrorHandleR
		ld		a, 0FDh	; '�'
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_6FDF:
		call	popErrorHandleR
		ld		a, 0FEh	; '�'
		or		a
		ret
KeyboardGetKeyHandler:
		ld		a, 0FFh
		or		a
		ret

; =============== S U B	R O U T	I N E =======================================


p7Csub_6FEA:
		call	page0_1664
		call	p7Csub_7022
		call	page0_165F
		call	p7Csub_7022
		ld		hl, symTable
		ld		b, 0

p7Cloc_6FFB:
		ex		de, hl
		ld		hl, (unk_982E)
		ld		a, b
		or		a
		sbc		hl, de
		ret		nc
		ex		de, hl
		push	bc
		call	Page0Call_2EA7
		call	HLMinus5
		ld		a, (hl)
		or		a
		pop		bc
		inc		hl
		inc		hl
		inc		hl
		jr		nz, p7Cloc_701B
		ld		a, (hl)
		cp		b
		jr		c, p7Cloc_701B
		jr		z, p7Cloc_701B
		ld		b, a

p7Cloc_701B:
		inc		hl
		inc		hl
		call	j_MoveToNextSym
		jr		p7Cloc_6FFB
; End of function p7Csub_6FEA


; =============== S U B	R O U T	I N E =======================================


p7Csub_7022:
		call	FINDPROGSYM
		ret		c
		call	Page0Call_3519
		call	Page0Call_240B
		ld		(hl), a
		ret
; End of function p7Csub_7022

; ---------------------------------------------------------------------------

p7Cloc_702E:
		call	SendAck
		ld		hl, ioData
		call	p7Csub_705F
		ld		de, 9
		ld		(unk_8676), de
		call	p7Csub_6393
		ld		h, 15h
		ld		(header), hl
		call	Send4Bytes
		ld		hl, ioData
		ld		d, 9

p7Cloc_704E:
		push	de
		ld		c, (hl)
		call	SendDataByte
		pop		de
		inc		hl
		dec		d
		jr		nz, p7Cloc_704E
		ei
		call	p7Cloc_4163
		jp		p7Cloc_5966

; =============== S U B	R O U T	I N E =======================================


p7Csub_705F:
		call	OPSet0
		ld		a, (OP1)
		push	af
		di
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		ld		de, 0A10h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8027h
; ---------------------------------------------------------------------------
		jr		nz, p7Cloc_7094
		ld		de, 867Fh
		call	p7Csub_709C
		ld		de, 410h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8027h
; ---------------------------------------------------------------------------
		jr		nz, p7Cloc_7094
		ld		de, 8684h
		call	p7Csub_709C

p7Cloc_7094:
		call	FlashWriteDisable
		pop		af
		ld		(OP1), a
		ret
; End of function p7Csub_705F


; =============== S U B	R O U T	I N E =======================================


p7Csub_709C:
		inc		hl
		call	p7Csub_6D77
		call	Page0Call_2CCD
		and		0Fh
		ld		c, a
		ld		b, 0
		inc		hl
		call	p7Csub_6D77
		call	j_FlashToRam
		ret
; End of function p7Csub_709C

; ---------------------------------------------------------------------------

p7Cloc_70B0:
		call	GetSmallPacket
		ld		bc, (ioData)
		ld		a, b
		or		a
		jp		nz, ErrDomain
		ld		hl, (pagedCount)
		push	hl
		ld		hl, (pagedGetPtr)
		push	hl
		ld		hl, (pagedGetPtr)
		push	hl
		ld		hl, pagedErrorHandler
		call	pushErrorHandleR
		ld		bc, (ioData)
		ld		b, c
		ld		de, (unk_867F)
		call	SetupPagedPtr
		ld		de, (unk_8681)
		ld		(unk_8676), de
		call	p7Csub_6393
		ld		h, 15h
		ld		(header), hl
		call	Send4Bytes
		ld		de, (unk_8676)

p7Cloc_70F1:
		push	de
		ld		c, (hl)
		call	PagedGet
		ld		c, a
		call	SendDataByte
		pop		de
		dec		de
		ld		a, d
		or		e
		jr		nz, p7Cloc_70F1
		call	popErrorHandleR
		pop		de
		pop		de
		pop		bc
		call	SetupPagedPtr
		ei
		call	p7Cloc_4163
		jp		p7Cloc_5966
pagedErrorHandler:
		pop		de
		pop		de
		pop		bc
		call	SetupPagedPtr
		jp		JErrorNo

; =============== S U B	R O U T	I N E =======================================


Page7C_2C91:
		ld		de, (unk_8402)
		ld		b, 0FCh	; '�'
		ld		a, (unk_8404)
		di
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Csub_6D5F
		jr		nc, p7Cloc_7141
		call	Page0Call_2C43
		jr		c, p7Cloc_7141
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80C6h
; ---------------------------------------------------------------------------

p7Cloc_7141:
		; Page7C_2C91+23j
		call	FlashWriteDisable
		ret
; End of function Page7C_2C91


; =============== S U B	R O U T	I N E =======================================


p7Csub_7145:
		ld		a, (hl)
		push	af
		and		1Fh
		ld		(hl), a
		call	Page0Call_2ED1
		pop		af
		ret
; End of function p7Csub_7145

; ---------------------------------------------------------------------------

Page7C_2EB9:
		cp		5
		jp		z, p7Cloc_7714
		cp		6
		jp		z, p7Cloc_7F17
		bit		2, (iy+25h)
		jr		nz, p7Cloc_7178
		cp		3
		jp		z, p7Csub_7251
		cp		4
		jp		z, p7Csub_7257
		cp		1
		jp		z, p7Csub_7222
		cp		0
		ret		nz
		ld		a, b
		cp		0
		jp		z, p7Cloc_7237
		xor		a

p7Cloc_7178:
		push	af
		ld		b, 3Fh ; '?'
		call	j_LoadMenuB
		res		5, (iy+16h)
		xor		a
		ld		(kbdKey), a
		ld		(keyExtend), a
		call	Page7C_2DCF
		call	j_RunIndicOn
		res		curAble, (iy+curFlags)

p7Cloc_7193:
		ei
		call	j_getkey
		cp		8Fh ; '�'
		jr		z, p7Cloc_71AD
		cp		90h ; '�'
		jr		z, p7Cloc_71AD
		cp		3
		jr		z, p7Cloc_71AD
		cp		4
		jr		z, p7Cloc_71AD
		cp		5
		jr		z, p7Cloc_71AD
		jr		p7Cloc_7193
; ---------------------------------------------------------------------------

p7Cloc_71AD:
		call	j_PULLDOWNCHK
		di
		jr		c, p7Cloc_7193
		cp		1Dh
		jr		nz, p7Cloc_71CD
		pop		af
		cp		3
		jr		z, p7Cloc_71D0
		cp		4
		jr		z, p7Cloc_71D5
		cp		1
		jr		z, p7Cloc_71DA
		cp		0
		jr		nz, p7Cloc_71DD
		call	p7Csub_722B
		jr		p7Cloc_71DD
; ---------------------------------------------------------------------------

p7Cloc_71CD:
		pop		af
		jr		p7Cloc_71DD
; ---------------------------------------------------------------------------

p7Cloc_71D0:
		call	p7Csub_7251
		jr		p7Cloc_71DD
; ---------------------------------------------------------------------------

p7Cloc_71D5:
		call	p7Csub_7257
		jr		p7Cloc_71DD
; ---------------------------------------------------------------------------

p7Cloc_71DA:
		call	p7Csub_7222

p7Cloc_71DD:
		call	j_rstrShadow2
		set		appTextSave, (iy+appFlags)
		ret

; =============== S U B	R O U T	I N E =======================================


Page7C_2E65:
		call	IsFragmented
		ret		c
		di
		call	p7Csub_7E37
		call	p7Csub_725D
		ld		hl, lcdFlag
		bit		powerLcdForGC, (hl)
		call	nz, page0_AB7
		ei
		ret
; End of function Page7C_2E65


; =============== S U B	R O U T	I N E =======================================


IsFragmented:
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Csub_72B2
		push	af
		push	af
		xor		a
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		or		a
		jp		nz, 0
		pop		af
		pop		af
		ret
; End of function IsFragmented


; =============== S U B	R O U T	I N E =======================================


p7Csub_7222:

		di
		call	p7Csub_7E37
		call	p7Csub_725D
		ei
		ret
; End of function p7Csub_7222


; =============== S U B	R O U T	I N E =======================================


p7Csub_722B:
		di
		call	p7Csub_7E19
		call	p7Csub_725D
		call	p7Csub_7758
		ei
		ret
; End of function p7Csub_722B

; ---------------------------------------------------------------------------

p7Cloc_7237:
		res		appTextSave, (iy+appFlags)
		call	j_saveShadow2
		di
		call	p7Csub_7E19
		call	p7Csub_725D
		call	p7Csub_7758
		ei
		call	j_rstrShadow2
		set		appTextSave, (iy+appFlags)
		ret

; =============== S U B	R O U T	I N E =======================================


p7Csub_7251:

		di
		call	p7Csub_7758
		ei
		ret
; End of function p7Csub_7251


; =============== S U B	R O U T	I N E =======================================


p7Csub_7257:

		di
		call	p7Csub_725D
		ei
		ret
; End of function p7Csub_7257


; =============== S U B	R O U T	I N E =======================================


p7Csub_725D:
		; p7Csub_7222+4p ...
		di
		nop
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Csub_72B2
		jr		c, p7Cloc_728A
		call	p7Csub_7EE2
		call	p7Csub_7E06
		call	p7Csub_72E9
		call	p7Csub_728E
		call	p7Csub_7C20
		call	FillBasePageTable

p7Cloc_728A:
		call	Page0Call_3E0D
		ret
; End of function p7Csub_725D


; =============== S U B	R O U T	I N E =======================================


p7Csub_728E:
		call	p7Csub_7B46
		call	p7Csub_750C
		or		a
		jr		z, p7Cloc_72AE
		push	af
		ld		a, b
		cp		2
		jr		z, p7Cloc_72A5
		pop		af
		push	af
		call	p7Csub_7569
		call	p7Csub_7B46

p7Cloc_72A5:
		pop		af
		call	p7Csub_7626
		call	p7Csub_7B46
		jr		p7Csub_728E
; ---------------------------------------------------------------------------

p7Cloc_72AE:
		call	p7Csub_76D6
		ret
; End of function p7Csub_728E


; =============== S U B	R O U T	I N E =======================================


p7Csub_72B2:
		; p7Csub_725D+16p
		call	Page0Call_2B53
		call	p7Csub_7ED9

p7Cloc_72B8:
		cp		b
		jr		z, p7Cloc_72E3
		jr		c, p7Cloc_72E3
		push	bc
		push	af
		ld		hl, 4000h
		call	Page0Call_2CCD
		or		a
		jr		z, p7Cloc_72E5
		cp		80h ; '�'
		jr		nz, p7Cloc_72E5
		pop		af
		push	af
		ld		hl, 4000h
		call	Page0Call_2C97
		call	Page0Call_2B59
		jr		nz, p7Cloc_72E5
		pop		af
		push	af
		call	j_FindAppNumPages
		pop		af
		sub		c
		pop		bc
		jr		p7Cloc_72B8
; ---------------------------------------------------------------------------

p7Cloc_72E3:
		scf
		ret
; ---------------------------------------------------------------------------

p7Cloc_72E5:
		pop		af
		pop		af
		xor		a
		ret
; End of function p7Csub_72B2


; =============== S U B	R O U T	I N E =======================================


p7Csub_72E9:
		call	j_ResetHookBytes
		call	p7Csub_7E7F
		ld		hl, tempSwapArea
		ld		b, 0Ah
		call	NZIf83Plus
		jr		nz, p7Cloc_72FE
		ld		hl, ramStart
		ld		b, 5Eh ; '^'

p7Cloc_72FE:
		sla	b
		ld		a, 0FFh

p7Cloc_7302:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_7302
		call	p7Csub_735B
		res		6, (iy+24h)
		res		7, (iy+24h)
		xor		a
		ld		(unk_9C87), a
		ld		b, 0FEh	; '�'
		call	p7Csub_7E85
		ld		a, 8
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		0FEh ; '�'
		jr		z, p7Cloc_732B
		ld		b, 0FDh	; '�'
		call	p7Csub_7E85

p7Cloc_732B:
		call	Page0Call_2B53
		ld		a, b
		inc		a
		call	p7Csub_7E97
		ld		(hl), a
		ld		hl, 836Dh
		ld		a, 1
		and		(hl)
		ld		(hl), a
		inc		hl
		call	NZIf83Plus
		jr		z, p7Cloc_7347
		ld		a, (hl)
		and		80h ; '�'
		ld		(hl), a
		jr		p7Cloc_7352
; ---------------------------------------------------------------------------

p7Cloc_7347:
		xor		a
		ld		b, 0Bh

p7Cloc_734A:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_734A
		ld		a, (hl)
		and		0FCh ; '�'
		ld		(hl), a

p7Cloc_7352:
		call	p7Csub_7371
		ld		a, 4
		call	Page0Call_2B5F
		ret
; End of function p7Csub_72E9


; =============== S U B	R O U T	I N E =======================================


p7Csub_735B:
		ld		hl, tempSwapArea
		ld		b, 64h ; 'd'
		call	NZIf83Plus
		jr		z, p7Cloc_736A
		ld		hl, 837Bh
		ld		b, 12h

p7Cloc_736A:
		ld		a, 0FFh

p7Cloc_736C:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_736C
		ret
; End of function p7Csub_735B


; =============== S U B	R O U T	I N E =======================================


p7Csub_7371:
		xor		a
		ld		(unk_8436), a
		ld		a, 0F0h	; '�'
		ld		(indicBusy), a
		call	p7Csub_7EA2
		ld		a, 0FEh	; '�'
		ld		(hl), a
		inc		hl
		ld		(hl), a
		call	p7Csub_7ED9

p7Cloc_7385:
		ld		(unk_8435), a
		call	p7Csub_7E97
		cp		(hl)
		jr		c, p7Cloc_73AA
		ld		a, (unk_8435)
		push	af
		call	p7Csub_73E2
		jr		c, p7Cloc_739D
		pop		af
		call	p7Csub_73FE
		jr		p7Cloc_73A1
; ---------------------------------------------------------------------------

p7Cloc_739D:
		pop		af
		call	p7Csub_7417

p7Cloc_73A1:
		ld		a, (unk_8435)
		call	j_FindAppNumPages
		sub		c
		jr		p7Cloc_7385
; ---------------------------------------------------------------------------

p7Cloc_73AA:
		ld		a, (unk_8435)
		call	p7Csub_74C1

p7Cloc_73B0:
		ld		a, b
		ld		(unk_8435), a
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		0F0h ; '�'
		jr		z, p7Cloc_73C9
		cp		0FEh ; '�'
		jr		z, p7Cloc_73D0
		ld		a, 0FFh
		call	p7Csub_74CB
		jr		p7Cloc_73D3
; ---------------------------------------------------------------------------

p7Cloc_73C9:
		ld		a, 7Eh ; '~'
		call	p7Csub_74CB
		jr		p7Cloc_73D3
; ---------------------------------------------------------------------------

p7Cloc_73D0:
		call	p7Csub_74F8

p7Cloc_73D3:
		ld		a, (unk_8435)
		ld		b, a
		ld		a, 8
		inc		a
		cp		b
		ret		nc
		ld		a, b
		sub		4
		ld		b, a
		jr		p7Cloc_73B0
; End of function p7Csub_7371


; =============== S U B	R O U T	I N E =======================================


p7Csub_73E2:
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		0
		jr		z, p7Cloc_73FC
		ld		a, (unk_8435)
		ld		hl, 4000h
		call	Page0Call_2C97
		call	Page0Call_2B59
		jr		nz, p7Cloc_73FC
		scf
		ret
; ---------------------------------------------------------------------------

p7Cloc_73FC:
		xor		a
		ret
; End of function p7Csub_73E2


; =============== S U B	R O U T	I N E =======================================


p7Csub_73FE:
		push	af
		call	p7Csub_74B2
		push	hl
		call	j_FindAppNumPages
		pop		hl
		push	bc
		ld		b, c
		ld		a, 0FCh	; '�'

p7Cloc_740B:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_740B
		pop		bc
		pop		af
		push	af
		call	j_AdjustAllHooks
		pop		af
		ret
; End of function p7Csub_73FE


; =============== S U B	R O U T	I N E =======================================


p7Csub_7417:
		call	p7Csub_74B2
		call	j_FindAppNumPages
		ld		b, c
		ld		a, 0FEh	; '�'

p7Cloc_7420:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_7420
		ld		hl, tempSwapArea
		call	NZIf83Plus
		jr		nz, p7Cloc_742F
		ld		hl, ramStart

p7Cloc_742F:
		ld		a, (unk_8436)
		ld		e, a
		ld		d, 0
		add		hl, de
		ex		de, hl
		push	de
		call	Page0Call_2B65
		ld		a, (unk_8435)
		ld		b, a
		call	p7Csub_7ED9
		sub		b
		sla	a
		ld		e, a
		ld		d, 0
		add		hl, de
		call	p7Csub_7F0D
		ld		bc, 2
		pop		de
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8054h
; ---------------------------------------------------------------------------
		ld		a, (unk_8436)
		sra	a
		ld		b, a
		call	p7Csub_7ED9
		sub		b
		ld		c, a
		call	NZIf83Plus
		jr		z, p7Cloc_7492
		ld		b, 0
		ld		hl, 8697h
		add		hl, bc
		ex		de, hl
		ld		a, (unk_8435)
		ld		c, a
		ld		b, 0
		ld		hl, 8697h
		add		hl, bc
		bit		7, (hl)
		ex		de, hl
		jr		z, p7Cloc_747D
		set		7, (hl)
		jr		p7Cloc_747F
; ---------------------------------------------------------------------------

p7Cloc_747D:
		res		7, (hl)

p7Cloc_747F:
		ex		de, hl
		res		7, (hl)

p7Cloc_7482:
		ld		a, (unk_8435)
		call	j_FindAppNumPages
		sla	c
		ld		a, (unk_8436)
		add		a, c
		ld		(unk_8436), a
		ret
; ---------------------------------------------------------------------------

p7Cloc_7492:
		push	bc
		ld		a, (unk_8435)
		ld		b, a
		call	Page7C_2DB1
		pop		bc
		and		(hl)
		push	af
		jr		z, p7Cloc_74A1
		xor		(hl)
		ld		(hl), a

p7Cloc_74A1:
		ld		b, c
		call	Page7C_2DB1
		ld		b, a
		pop		af
		ld		a, b
		jr		z, p7Cloc_74AE
		or		(hl)

p7Cloc_74AB:
		ld		(hl), a
		jr		p7Cloc_7482
; ---------------------------------------------------------------------------

p7Cloc_74AE:
		cpl
		and		(hl)
		jr		p7Cloc_74AB
; End of function p7Csub_7417


; =============== S U B	R O U T	I N E =======================================


p7Csub_74B2:
		push	af
		ld		b, a
		call	p7Csub_7EE9
		sub		b
		ld		c, a
		ld		b, 0
		call	p7Csub_7EA2
		add		hl, bc
		pop		af
		ret
; End of function p7Csub_74B2


; =============== S U B	R O U T	I N E =======================================


p7Csub_74C1:
		ld		a, (unk_8435)
		or		3
		ld		c, a
		and		0FCh ; '�'
		ld		b, a
		ret
; End of function p7Csub_74C1


; =============== S U B	R O U T	I N E =======================================


p7Csub_74CB:
		push	af
		ld		a, (unk_8435)
		add		a, 3
		push	af
		call	Page0Call_2B53
		pop		af
		sub		b
		jr		c, p7Cloc_74E8
		ld		a, b
		call	p7Csub_74B2
		push	af
		ld		a, (unk_8435)
		ld		b, a
		pop		af
		sub		b
		inc		a
		ld		b, a
		jr		p7Cloc_74F2
; ---------------------------------------------------------------------------

p7Cloc_74E8:
		ld		a, (unk_8435)
		add		a, 3
		call	p7Csub_74B2
		ld		b, 4

p7Cloc_74F2:
		pop		af

p7Cloc_74F3:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_74F3
		ret
; End of function p7Csub_74CB


; =============== S U B	R O U T	I N E =======================================


p7Csub_74F8:
		ld		a, (unk_8435)
		add		a, 3
		call	p7Csub_74B2
		ld		b, 3
		ld		a, 0FFh

p7Cloc_7504:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_7504
		ld		a, 0FCh	; '�'
		ld		(hl), a
		ret
; End of function p7Csub_74F8


; =============== S U B	R O U T	I N E =======================================


p7Csub_750C:
		call	p7Csub_7EE9

p7Cloc_750F:
		push	af
		call	p7Csub_7529
		jr		c, p7Cloc_7526
		pop		af
		push	af
		call	p7Csub_7532
		jr		nc, p7Cloc_7521
		pop		af
		call	p7Csub_754B
		ret
; ---------------------------------------------------------------------------

p7Cloc_7521:
		pop		af
		sub		4
		jr		p7Cloc_750F
; ---------------------------------------------------------------------------

p7Cloc_7526:
		pop		af
		xor		a
		ret
; End of function p7Csub_750C


; =============== S U B	R O U T	I N E =======================================


p7Csub_7529:
		push	af
		call	p7Csub_7E97
		ld		a, (hl)
		ld		b, a
		pop		af
		sub		b
		ret
; End of function p7Csub_7529


; =============== S U B	R O U T	I N E =======================================


p7Csub_7532:
		call	p7Csub_74B2
		ld		b, 0

p7Cloc_7537:
		ld		a, (hl)
		cp		0FCh ; '�'
		jr		z, p7Cloc_7549
		cp		7Ch ; '|'
		jr		z, p7Cloc_7549
		inc		hl
		inc		b
		ld		a, b
		cp		4
		jr		nz, p7Cloc_7537
		xor		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_7549:
		scf
		ret
; End of function p7Csub_7532


; =============== S U B	R O U T	I N E =======================================


p7Csub_754B:
		push	af
		call	p7Csub_74B2
		ld		b, 0

p7Cloc_7551:
		ld		a, (hl)
		cp		0FEh ; '�'
		jr		z, p7Cloc_7565
		cp		7Eh ; '~'
		jr		z, p7Cloc_7565
		inc		hl
		inc		b
		ld		a, b
		cp		4
		jr		nz, p7Cloc_7551
		ld		b, 2
		jr		p7Cloc_7567
; ---------------------------------------------------------------------------

p7Cloc_7565:
		ld		b, 1

p7Cloc_7567:
		pop		af
		ret
; End of function p7Csub_754B


; =============== S U B	R O U T	I N E =======================================


p7Csub_7569:
		push	af
		call	p7Csub_7581
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		pop		af
		push	af
		call	p7Csub_758D
		pop		bc
		pop		af
		call	p7Csub_759B

p7Cloc_757B:
		ld		a, 3
		call	Page0Call_2B5F
		ret
; End of function p7Csub_7569


; =============== S U B	R O U T	I N E =======================================


p7Csub_7581:
		call	p7Csub_7E8C
		ld		a, (hl)
		and		2
		ld		a, 0Bh
		ret		nz
		ld		a, 0Fh
		ret
; End of function p7Csub_7581


; =============== S U B	R O U T	I N E =======================================


p7Csub_758D:
		push	af
		call	p7Csub_74B2
		ld		a, 0FFh
		ld		b, 4

p7Cloc_7595:
		ld		(hl), a
		inc		hl
		djnz	p7Cloc_7595
		pop		af
		ret
; End of function p7Csub_758D


; =============== S U B	R O U T	I N E =======================================


p7Csub_759B:
		ld		(unk_8435), a
		ld		(fmtString), a
		sub		3
		ld		(unk_8436), a
		ld		a, b
		ld		(unk_8437), a
		ld		(unk_97B2), a
		ld		a, (fmtString)

p7Cloc_75B0:
		push	af
		ld		a, (unk_8436)
		ld		d, a
		pop		af
		cp		d
		ret		c
		push	bc
		call	p7Csub_74B2
		pop		bc
		ld		a, (hl)
		cp		0FEh ; '�'
		jr		z, p7Cloc_75D8
		cp		7Eh ; '~'
		jr		z, p7Cloc_75CF
		ld		a, (fmtString)
		dec		a
		ld		(fmtString), a
		jr		p7Cloc_75B0
; ---------------------------------------------------------------------------

p7Cloc_75CF:
		push	af
		call	p7Csub_75F5
		ld		a, b
		ld		(unk_97B2), a
		pop		af

p7Cloc_75D8:
		call	p7Csub_7607
		ld		a, (unk_97B2)
		ld		b, a
		ld		a, (fmtString)
		call	j_CopyFlashPage
		call	p7Csub_7B46
		ld		hl, 97B2h
		ld		a, (hl)
		dec		a
		ld		b, a
		ld		(hl), a
		dec		hl
		ld		a, (hl)
		dec		a
		ld		(hl), a
		jr		p7Cloc_75B0
; End of function p7Csub_759B


; =============== S U B	R O U T	I N E =======================================


p7Csub_75F5:
		push	af
		ld		a, (fmtString)
		ld		b, a
		ld		a, (unk_8435)
		sub		b
		push	af
		ld		a, (unk_8437)
		pop		bc
		sub		b
		ld		b, a
		pop		af
		ret
; End of function p7Csub_75F5


; =============== S U B	R O U T	I N E =======================================


p7Csub_7607:
		; p7Csub_763E+27p
		push	af
		ld		a, (fmtString)
		call	p7Csub_74B2
		pop		af
		push	hl
		push	af
		ld		a, (unk_97B2)
		call	p7Csub_74B2
		pop		af
		ld		(hl), a
		pop		hl
		cp		0FEh ; '�'
		jr		nz, p7Cloc_7622
		ld		a, 0FCh	; '�'
		ld		(hl), a
		ret
; ---------------------------------------------------------------------------

p7Cloc_7622:
		ld		a, 7Ch ; '|'
		ld		(hl), a
		ret
; End of function p7Csub_7607


; =============== S U B	R O U T	I N E =======================================


p7Csub_7626:
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		pop		af
		call	p7Csub_758D
		push	af
		call	p7Csub_7581
		pop		bc
		push	bc
		call	p7Csub_759B
		pop		af
		call	p7Csub_763E
		jp		p7Cloc_757B
; End of function p7Csub_7626


; =============== S U B	R O U T	I N E =======================================


p7Csub_763E:
		call	p7Csub_766E
		push	bc
		push	af
		ld		a, b
		or		a
		jr		z, p7Cloc_766B
		pop		af
		push	af
		call	p7Csub_76AE
		ld		a, b
		or		a
		jr		z, p7Cloc_766B
		pop		de
		pop		bc
		push	de
		push	bc
		push	af
		call	j_CopyFlashPage
		call	p7Csub_7B46
		ld		hl, fmtString
		pop		af
		ld		(hl), a
		inc		hl
		pop		af
		ld		(hl), a
		ld		a, 0FEh	; '�'
		call	p7Csub_7607
		pop		af
		jr		p7Csub_763E
; ---------------------------------------------------------------------------

p7Cloc_766B:
		pop		af
		pop		bc
		ret
; End of function p7Csub_763E


; =============== S U B	R O U T	I N E =======================================


p7Csub_766E:
		push	af
		call	p7Csub_767D
		jr		c, p7Cloc_7679
		pop		af
		call	p7Csub_7692
		ret
; ---------------------------------------------------------------------------

p7Cloc_7679:
		pop		af
		ld		b, 0
		ret
; End of function p7Csub_766E


; =============== S U B	R O U T	I N E =======================================


p7Csub_767D:
		call	p7Csub_74B2
		ld		b, 0

p7Cloc_7682:
		ld		a, (hl)
		cp		7Eh ; '~'
		jr		z, p7Cloc_7690
		inc		hl
		inc		b
		ld		a, b
		cp		4
		jr		nz, p7Cloc_7682
		xor		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_7690:
		scf
		ret
; End of function p7Csub_767D


; =============== S U B	R O U T	I N E =======================================


p7Csub_7692:
		push	af
		call	p7Csub_74B2
		ld		b, 0

p7Cloc_7698:
		ld		a, (hl)
		cp		0FFh
		jr		z, p7Cloc_76A8
		inc		hl
		inc		b
		ld		a, b
		cp		4
		jr		nz, p7Cloc_7698
		ld		b, 0
		jr		p7Cloc_76AC
; ---------------------------------------------------------------------------

p7Cloc_76A8:
		pop		af
		push	af
		sub		b
		ld		b, a

p7Cloc_76AC:
		pop		af
		ret
; End of function p7Csub_7692


; =============== S U B	R O U T	I N E =======================================


p7Csub_76AE:
		sub		4
		push	af
		call	p7Csub_7E97
		ld		a, (hl)
		ld		b, a
		pop		af
		push	bc
		push	af

p7Cloc_76B9:
		sub		b
		jr		c, p7Cloc_76D0
		pop		af
		push	af
		call	p7Csub_74B2
		ld		a, (hl)
		cp		0FEh ; '�'
		jr		z, p7Cloc_76CD
		pop		af
		dec		a
		pop		bc
		push	bc
		push	af
		jr		p7Cloc_76B9
; ---------------------------------------------------------------------------

p7Cloc_76CD:
		pop		bc
		pop		af
		ret
; ---------------------------------------------------------------------------

p7Cloc_76D0:
		ld		b, 0
		pop		af
		pop		af
		ret
; End of function p7Csub_76AE

; ---------------------------------------------------------------------------
		.db		0

; =============== S U B	R O U T	I N E =======================================


p7Csub_76D6:
		call	p7Csub_76DE
		nop
		call	p7Csub_770E
		ret
; End of function p7Csub_76D6


; =============== S U B	R O U T	I N E =======================================


p7Csub_76DE:
		call	p7Csub_7581
		push	af
		call	p7Csub_76F9
		jr		nc, p7Cloc_76EC
		pop		af
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------

p7Cloc_76EC:
		pop		af
		sub		3
		ld		de, 4000h
		ld		b, 0FEh	; '�'
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8021h
; ---------------------------------------------------------------------------
		ret
; ---------------------------------------------------------------------------
		nop
; End of function p7Csub_76DE


; =============== S U B	R O U T	I N E =======================================


p7Csub_76F9:
		call	p7Csub_74B2
		ld		b, 0

p7Cloc_76FE:
		ld		a, (hl)
		cp		0FFh
		jr		nz, p7Cloc_770C
		inc		hl
		inc		b
		ld		a, b
		cp		4
		jr		nz, p7Cloc_76FE
		xor		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_770C:
		scf
		ret
; End of function p7Csub_76F9


; =============== S U B	R O U T	I N E =======================================


p7Csub_770E:
		call	p7Csub_735B
		jp		p7Cloc_757B
; End of function p7Csub_770E

; ---------------------------------------------------------------------------

p7Cloc_7714:
		di
		nop
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Csub_7EE2
		call	p7Csub_7E06
		call	p7Csub_77DA
		ld		a, 8
		call	p7Csub_78BF
		ld		a, b
		cp		0FFh
		jr		nz, p7Cloc_774E
		ld		a, 0Ch
		call	p7Csub_786A
		ld		a, 8
		ld		b, 0FEh	; '�'
		call	p7Csub_797E
		call	p7Csub_770E
		jr		p7Csub_7782
; ---------------------------------------------------------------------------

p7Cloc_774E:
		ld		a, 8
		call	p7Csub_78D2
		call	p7Csub_7D17
		jr		p7Csub_7782

; =============== S U B	R O U T	I N E =======================================


p7Csub_7758:
		di
		nop
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Csub_778D
		jr		c, p7Cloc_7789
		call	p7Csub_7EE2
		call	p7Csub_7E06
		call	p7Cloc_6D10
		call	p7Csub_77DA
		call	p7Csub_7D17
; End of function p7Csub_7758


; =============== S U B	R O U T	I N E =======================================


p7Csub_7782:
		call	Page0Call_2B53
		ld		a, b
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80CFh
; ---------------------------------------------------------------------------

p7Cloc_7789:
		call	Page0Call_3E0D
		ret
; End of function p7Csub_7782


; =============== S U B	R O U T	I N E =======================================


p7Csub_778D:
		call	Page0Call_2B53
		ld		a, b
		ld		(unk_8435), a
		call	p7Csub_74C1
		ld		a, b

p7Cloc_7798:
		push	af
		cp		8
		jr		c, p7Cloc_77B7
		pop		af
		push	af
		ld		hl, 4000h
		call	Page0Call_2CCD
		cp		0F0h ; '�'
		jr		z, p7Cloc_77AE

p7Cloc_77A9:
		pop		af
		sub		4
		jr		p7Cloc_7798
; ---------------------------------------------------------------------------

p7Cloc_77AE:
		pop		af
		push	af
		call	p7Csub_77BD
		jr		c, p7Cloc_77BA
		jr		p7Cloc_77A9
; ---------------------------------------------------------------------------

p7Cloc_77B7:
		pop		af
		scf
		ret
; ---------------------------------------------------------------------------

p7Cloc_77BA:
		pop		af
		or		a
		ret
; End of function p7Csub_778D


; =============== S U B	R O U T	I N E =======================================


p7Csub_77BD:
		push	af
		ld		hl, 4001h
		push	hl
		ld		c, 0F0h	; '�'
		call	Page0Call_2B6B
		jr		z, p7Cloc_77CD
		pop		hl
		pop		af
		scf
		ret
; ---------------------------------------------------------------------------

p7Cloc_77CD:
		pop		hl
		pop		af
		ld		c, 0FEh	; '�'
		call	Page0Call_2B6B
		jr		z, p7Cloc_77D8
		scf
		ret
; ---------------------------------------------------------------------------

p7Cloc_77D8:
		or		a
		ret
; End of function p7Csub_77BD


; =============== S U B	R O U T	I N E =======================================


p7Csub_77DA:
		ld		a, 0F0h	; '�'
		ld		(indicBusy), a
		call	p7Csub_7E7F
		call	p7Csub_735B
		res		7, (iy+24h)
		ld		b, 0FBh	; '�'
		call	p7Csub_7E85
		call	Page0Call_2B53
		ld		a, b
		inc		a
		call	p7Csub_7E97
		ld		(hl), a
		push	af
		ld		(unk_8435), a
		call	p7Csub_74C1
		pop		af
		cp		b
		jr		z, p7Cloc_7811
		ld		a, b
		push	af
		ld		hl, 4000h
		rst		28h
		ld		d, c
		add		a, b
		cp		0F0h ; '�'
		jr		z, p7Cloc_7826
		pop		af
		jr		p7Cloc_7812
; ---------------------------------------------------------------------------

p7Cloc_7811:
		ld		a, b

p7Cloc_7812:
		sub		4
		cp		8
		jr		c, p7Cloc_7837
		push	af
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		0F0h ; '�'
		jr		z, p7Cloc_782B
		pop		af
		jr		p7Cloc_7812
; ---------------------------------------------------------------------------

p7Cloc_7826:
		ld		b, 0F7h	; '�'
		call	p7Csub_7E85

p7Cloc_782B:
		pop		af
		call	p7Csub_7EA2
		ld		(hl), a
		call	p7Cloc_757B
		call	p7Csub_7AD8
		ret
; ---------------------------------------------------------------------------

p7Cloc_7837:
		call	p7Csub_7EA2
		ld		(hl), 8
		jp		p7Cloc_757B
; End of function p7Csub_77DA


; =============== S U B	R O U T	I N E =======================================


p7Csub_783F:
		ld		a, 8
		push	af

p7Cloc_7842:
		pop		af
		call	p7Csub_787C
		push	af
		push	af
		ld		a, b
		cp		1
		jr		z, p7Cloc_7858
		cp		2
		jr		z, p7Cloc_785E
		cp		3
		jr		z, p7Cloc_7864
		pop		af
		pop		af
		ret
; ---------------------------------------------------------------------------

p7Cloc_7858:
		pop		af
		call	p7Csub_78D2
		jr		p7Cloc_7842
; ---------------------------------------------------------------------------

p7Cloc_785E:
		pop		af
		call	p7Csub_7A09
		jr		p7Cloc_7842
; ---------------------------------------------------------------------------

p7Cloc_7864:
		pop		af
		call	p7Csub_786A
		jr		p7Cloc_7842
; End of function p7Csub_783F


; =============== S U B	R O U T	I N E =======================================


p7Csub_786A:
		push	af
		ld		b, 0FEh	; '�'
		call	p7Csub_7DC5
		pop		af
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		pop		af
		ld		b, 0FCh	; '�'
		call	p7Csub_7DC5
		ret
; End of function p7Csub_786A


; =============== S U B	R O U T	I N E =======================================


p7Csub_787C:
		call	p7Csub_78B5
		jr		c, p7Cloc_78B2
		call	p7Csub_78BF
		push	af
		ld		a, b
		cp		0F0h ; '�'
		jr		z, p7Cloc_7893
		cp		70h ; 'p'
		jr		z, p7Cloc_78AE
		pop		af
		add		a, 4
		jr		p7Csub_787C
; ---------------------------------------------------------------------------

p7Cloc_7893:
		pop		af
		push	af
		call	p7Csub_77BD
		jr		c, p7Cloc_789F
		pop		af
		add		a, 4
		jr		p7Csub_787C
; ---------------------------------------------------------------------------

p7Cloc_789F:
		pop		af
		push	af
		call	p7Csub_78C9
		jr		z, p7Cloc_78AA
		pop		af
		ld		b, 1
		ret
; ---------------------------------------------------------------------------

p7Cloc_78AA:
		pop		af
		ld		b, 3
		ret
; ---------------------------------------------------------------------------

p7Cloc_78AE:
		pop		af
		ld		b, 2
		ret
; ---------------------------------------------------------------------------

p7Cloc_78B2:
		ld		b, 4
		ret
; End of function p7Csub_787C


; =============== S U B	R O U T	I N E =======================================


p7Csub_78B5:
		; p7Csub_78D2:p7Cloc_78E3p ...
		push	bc
		call	p7Csub_7EA2
		ld		b, a
		ld		a, (hl)
		sub		b
		ld		a, b
		pop		bc
		ret
; End of function p7Csub_78B5


; =============== S U B	R O U T	I N E =======================================


p7Csub_78BF:
		push	af
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		ld		b, a
		pop		af
		ret
; End of function p7Csub_78BF


; =============== S U B	R O U T	I N E =======================================


p7Csub_78C9:
		ld		c, 0FCh	; '�'
		ld		hl, 4001h
		call	Page0Call_2B6B
		ret
; End of function p7Csub_78C9


; =============== S U B	R O U T	I N E =======================================


p7Csub_78D2:
		push	af
		call	p7Csub_7958
		ld		b, 0FCh	; '�'
		call	p7Csub_797E
		ld		b, a
		pop		af

p7Cloc_78DD:
		call	p7Csub_7987
		call	p7Csub_79E2

p7Cloc_78E3:
		call	p7Csub_78B5
		jr		c, p7Cloc_794E
		push	bc
		ld		a, c
		call	p7Csub_78BF
		ld		a, b
		cp		0F0h ; '�'
		jr		z, p7Cloc_78FD
		cp		70h ; 'p'
		jr		z, p7Cloc_78FD
		pop		bc

p7Cloc_78F7:
		ld		a, c
		add		a, 4
		ld		c, a
		jr		p7Cloc_78E3
; ---------------------------------------------------------------------------

p7Cloc_78FD:
		pop		bc
		ld		a, c
		ld		hl, 4001h

p7Cloc_7902:
		push	bc
		ld		c, 0FCh	; '�'
		call	Page0Call_2B6B
		push	bc
		pop		de
		pop		bc
		jr		z, p7Cloc_78F7
		push	af
		push	hl
		inc		de
		inc		de
		inc		de
		push	de
		push	bc
		ld		a, b
		ld		hl, 4001h
		ld		c, 0FFh
		call	Page0Call_2B6B
		ld		b, 16h
		call	Page0Call_2B71
		pop		bc
		ex		de, hl
		ld		de, 0Dh
		xor		a
		push	hl
		sbc		hl, de
		jr		c, p7Cloc_794A
		pop		hl
		pop		de
		xor		a
		sbc		hl, de
		jr		c, p7Cloc_7941
		pop		hl
		pop		af
		push	af
		push	hl
		push	bc
		call	p7Csub_79C2
		pop		bc
		pop		hl
		pop		af
		jr		p7Cloc_7902
; ---------------------------------------------------------------------------

p7Cloc_7941:
		pop		hl
		pop		af
		push	bc
		call	p7Csub_7D99
		pop		bc
		jr		p7Cloc_7902
; ---------------------------------------------------------------------------

p7Cloc_794A:
		pop		hl
		pop		hl
		pop		hl
		pop		hl

p7Cloc_794E:
		ld		a, b
		ld		b, 0F8h	; '�'
		call	p7Csub_797E
		call	p7Csub_79EA
		ret
; End of function p7Csub_78D2


; =============== S U B	R O U T	I N E =======================================


p7Csub_7958:
		ld		a, 8

p7Cloc_795A:
		call	NZIf83Plus
		jr		nz, p7Cloc_7963
		cp		68h ; 'h'
		jr		p7Cloc_7965
; ---------------------------------------------------------------------------

p7Cloc_7963:
		cp		14h

p7Cloc_7965:
		jr		z, p7Cloc_797C
		call	p7Csub_78BF
		push	af
		ld		a, b
		cp		0FEh ; '�'
		jr		z, p7Cloc_7979
		cp		0FFh
		jr		z, p7Cloc_7979
		pop		af
		add		a, 4
		jr		p7Cloc_795A
; ---------------------------------------------------------------------------

p7Cloc_7979:
		pop		af
		scf
		ret
; ---------------------------------------------------------------------------

p7Cloc_797C:
		or		a
		ret
; End of function p7Csub_7958


; =============== S U B	R O U T	I N E =======================================


p7Csub_797E:
		push	af
		ld		de, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8021h
; ---------------------------------------------------------------------------
		pop		af
		ret
; End of function p7Csub_797E


; =============== S U B	R O U T	I N E =======================================


p7Csub_7987:
		push	af
		push	bc
		ld		hl, 4001h

p7Cloc_798C:
		ld		c, 0FCh	; '�'
		call	Page0Call_2B6B
		jr		z, p7Cloc_799E
		pop		bc
		push	bc
		push	hl
		push	af
		call	p7Csub_79C2
		pop		af
		pop		hl
		jr		p7Cloc_798C
; ---------------------------------------------------------------------------

p7Cloc_799E:
		pop		bc
		pop		af
		ret
; End of function p7Csub_7987


; =============== S U B	R O U T	I N E =======================================


p7Csub_79A1:
		push	hl
		push	af
		ld		a, b
		ld		hl, 4001h
		ld		c, 0FFh
		call	Page0Call_2B6B
		ld		b, a
		push	hl
		pop		de
		pop		af
		pop		hl
		call	Page0Call_2B77
		push	af
		push	hl
		bit		4, (iy+25h)
		jr		nz, p7Cloc_79BF
		call	p7Csub_79CE

p7Cloc_79BF:
		pop		de
		pop		af
		ret
; End of function p7Csub_79A1


; =============== S U B	R O U T	I N E =======================================


p7Csub_79C2:
		call	p7Csub_79A1
		ld		b, 0F8h	; '�'
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8021h
; ---------------------------------------------------------------------------
		call	p7Csub_7B46
		ret
; End of function p7Csub_79C2


; =============== S U B	R O U T	I N E =======================================


p7Csub_79CE:
		push	de
		push	bc
		call	ChkFindSym
		pop		bc
		ld		a, b
		ld		(arcInfo), a
		pop		de
		ex		de, hl
		ld		(unk_83EF), hl
		ex		de, hl
		call	Page0Call_2EDD
		ret
; End of function p7Csub_79CE

; =============== S U B	R O U T	I N E =======================================


p7Csub_79E2:
		cp		b
		jr		nc, p7Cloc_79E6
		ld		a, b

p7Cloc_79E6:
		add		a, 4
		ld		c, a
		ret
; End of function p7Csub_79E2


; =============== S U B	R O U T	I N E =======================================


p7Csub_79EA:
		; p7Csub_7C3B:p7Cloc_7CC3p
		ld		a, 8

p7Cloc_79EC:
		call	p7Csub_78B5
		ret		c

p7Cloc_79F0:
		push	af
		ld		hl, 4001h
		ld		c, 0F8h	; '�'
		call	Page0Call_2B6B
		jr		z, p7Cloc_7A04
		ld		b, 0F0h	; '�'
		ex		de, hl
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8021h
; ---------------------------------------------------------------------------
		pop		af
		jr		p7Cloc_79F0
; ---------------------------------------------------------------------------

p7Cloc_7A04:
		pop		af
		add		a, 4
		jr		p7Cloc_79EC
; End of function p7Csub_79EA


; =============== S U B	R O U T	I N E =======================================


p7Csub_7A09:
		push	af
		call	p7Csub_7958
		call	p7Csub_7EB8
		ld		(hl), a
		ld		de, 12h
		call	p7Csub_7E5C
		call	p7Csub_7AD0
		ld		b, 7Ch ; '|'
		call	p7Csub_797E
		ld		b, a
		pop		af
		push	af
		push	bc
		call	p7Csub_7B21
		pop		bc
		pop		af
		call	p7Csub_7A37
		push	af
		ld		a, b
		ld		b, 78h ; 'x'
		call	p7Csub_797E
		pop		af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		ret
; End of function p7Csub_7A09


; =============== S U B	R O U T	I N E =======================================


p7Csub_7A37:
		push	af
		push	bc
		push	af
		ld		a, b
		add		a, 3
		ld		b, a
		pop		af
		add		a, 3
		push	af
		call	p7Csub_7A5E

p7Cloc_7A45:
		pop		af
		push	de
		push	bc
		push	af
		call	j_CopyFlashPage
		call	p7Csub_7B46
		pop		af
		pop		bc
		dec		a
		dec		b
		pop		de
		push	af
		inc		d
		ld		a, e
		cp		d
		jr		nz, p7Cloc_7A45
		pop		af
		pop		bc
		pop		af
		ret
; End of function p7Csub_7A37


; =============== S U B	R O U T	I N E =======================================


p7Csub_7A5E:
		call	p7Csub_7E97
		ld		d, (hl)
		push	af
		sub		b
		jr		c, p7Cloc_7A69
		pop		af
		jr		p7Cloc_7A6B
; ---------------------------------------------------------------------------

p7Cloc_7A69:
		pop		af
		ld		a, b

p7Cloc_7A6B:
		sub		d
		inc		a
		ld		e, a
		ld		d, 0
		ret
; End of function p7Csub_7A5E


; =============== S U B	R O U T	I N E =======================================


p7Csub_7A71:
		ld		b, 78h ; 'x'
		call	p7Csub_7AF1
		ld		b, a
		ld		hl, 4001h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		0FFh
		jr		z, p7Csub_7AB9
		push	bc
		call	p7Csub_7B0D
		pop		bc
		cp		1
		jr		z, p7Cloc_7AA2
		call	p7Csub_7AB9
		push	af
		ld		b, 0FFh
		call	p7Csub_7AF1
		call	p7Csub_7ECE
		ld		(hl), a
		ld		de, 13h
		call	p7Csub_7E5C
		call	p7Csub_7AD0
		jr		p7Cloc_7AA7
; ---------------------------------------------------------------------------

p7Cloc_7AA2:
		call	p7Csub_7AB9
		push	af
		ld		a, b

p7Cloc_7AA7:
		ld		b, 0FCh	; '�'
		call	p7Csub_797E
		ld		b, a
		pop		af
		push	bc
		call	p7Csub_7B21
		pop		af
		ld		b, 0F8h	; '�'
		call	p7Csub_797E
		ret
; End of function p7Csub_7A71


; =============== S U B	R O U T	I N E =======================================


p7Csub_7AB9:
		ld		a, b
		call	p7Csub_7EA2
		ld		b, (hl)
		call	p7Csub_7A37
		ret
; End of function p7Csub_7AB9


; =============== S U B	R O U T	I N E =======================================


p7Csub_7AC2:
		ld		de, 11h
		call	p7Csub_7E5C
		call	p7Csub_7AD0
		call	p7Csub_7EAD
		ld		(hl), a
		ret
; End of function p7Csub_7AC2


; =============== S U B	R O U T	I N E =======================================


p7Csub_7AD0:
		ex		de, hl
		push	af
		ld		b, a
		call	p7Csub_7DE3
		pop		af
		ret
; End of function p7Csub_7AD0


; =============== S U B	R O U T	I N E =======================================


p7Csub_7AD8:
		; p7Csub_7C3B:p7Cloc_7C5Fp
		call	p7Csub_7E8C
		bit		3, (hl)
		jr		nz, p7Cloc_7AEB
		call	p7Csub_7EA2
		ld		a, (hl)
		ld		b, 70h ; 'p'
		ld		de, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8021h
; ---------------------------------------------------------------------------

p7Cloc_7AEB:
		ld		a, 0FEh	; '�'
		call	p7Csub_7AC2
		ret
; End of function p7Csub_7AD8


; =============== S U B	R O U T	I N E =======================================


p7Csub_7AF1:
		ld		a, 8
; End of function p7Csub_7AF1


; =============== S U B	R O U T	I N E =======================================


p7Csub_7AF3:
		push	af
		call	p7Csub_78B5
		jr		c, p7Cloc_7B07
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		b
		jr		z, p7Cloc_7B0A
		pop		af
		add		a, 4
		jr		p7Csub_7AF3
; ---------------------------------------------------------------------------

p7Cloc_7B07:
		pop		af
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_7B0A:
		pop		af
		scf
		ret
; End of function p7Csub_7AF3


; =============== S U B	R O U T	I N E =======================================


p7Csub_7B0D:
		ld		b, 0FFh
		call	p7Csub_7AF1
		jr		nc, p7Cloc_7B1F
		ld		b, 0FFh
		call	p7Csub_7AF3
		ld		a, 1
		ret		nc
		ld		a, 2
		ret
; ---------------------------------------------------------------------------

p7Cloc_7B1F:
		xor		a
		ret
; End of function p7Csub_7B0D


; =============== S U B	R O U T	I N E =======================================


p7Csub_7B21:
		push	af
		push	bc
		ld		hl, 4001h

p7Cloc_7B26:
		ld		c, 0FCh	; '�'
		call	Page0Call_2B6B
		jr		z, p7Cloc_7B3B
		pop		bc
		push	bc
		push	hl
		push	af
		call	p7Csub_7B3E
		pop		af
		pop		hl
		call	p7Csub_7D99
		jr		p7Cloc_7B26
; ---------------------------------------------------------------------------

p7Cloc_7B3B:
		pop		bc
		pop		af
		ret
; End of function p7Csub_7B21


; =============== S U B	R O U T	I N E =======================================


p7Csub_7B3E:
		call	p7Csub_79A1
		bit		4, (iy+25h)
		ret		nz
; End of function p7Csub_7B3E


; =============== S U B	R O U T	I N E =======================================


p7Csub_7B46:
		ld		a, 1
		ld		(indicCounter), a
		call	HandleRunIndicator
		ret
; End of function p7Csub_7B46


; =============== S U B	R O U T	I N E =======================================


p7Csub_7B4F:
		ld		b, 78h ; 'x'
		call	p7Csub_7AF1
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		ret
; End of function p7Csub_7B4F


; =============== S U B	R O U T	I N E =======================================


p7Csub_7B58:
		ld		a, 8
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		0FEh ; '�'
		ret		z
		ld		b, a
		ld		a, 0Ch
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		0FEh ; '�'
		ret		z
		ld		c, a
		ld		a, b
		cp		0FFh
		jr		z, p7Cloc_7B7C
		ld		a, c
		cp		0FFh
		jr		z, p7Cloc_7B80
		scf
		ret
; ---------------------------------------------------------------------------

p7Cloc_7B7C:
		ld		a, 8
		jr		p7Cloc_7B82
; ---------------------------------------------------------------------------

p7Cloc_7B80:
		ld		a, 0Ch

p7Cloc_7B82:
		ld		b, 0FEh	; '�'
		call	p7Csub_797E
		or		a
		ret
; End of function p7Csub_7B58


; =============== S U B	R O U T	I N E =======================================


p7Csub_7B89:
		call	p7Csub_7958
		push	af
		ld		b, 0FCh	; '�'
		call	p7Csub_797E
		pop		bc
		push	bc
		ld		a, 8
		call	p7Csub_7B21
		pop		af
		ld		b, 0F8h	; '�'
		call	p7Csub_797E

p7Cloc_7B9F:
		ld		a, 8
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		ld		a, 8
		ld		b, 0FEh	; '�'
		call	p7Csub_797E
		ret
; End of function p7Csub_7B89


; =============== S U B	R O U T	I N E =======================================


p7Csub_7BAC:
		call	p7Csub_7E97
		ld		a, (hl)
		dec		a
		ld		(unk_8435), a
		call	p7Csub_74C1
		ld		a, b

p7Cloc_7BB8:
		push	af
		ld		hl, 4000h
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		cp		0F8h ; '�'
		jr		nz, p7Cloc_7BCA
		pop		af
		push	af
		ld		b, 0F0h	; '�'
		call	p7Csub_797E

p7Cloc_7BCA:
		pop		af
		sub		4
		cp		8
		jr		nc, p7Cloc_7BB8
		call	p7Csub_770E
		ret
; End of function p7Csub_7BAC

; ---------------------------------------------------------------------------
		call	p7Csub_7E8C
		ld		a, (hl)
		and		1
		ret
; ---------------------------------------------------------------------------
		call	p7Csub_7E8C
		ld		a, (hl)
		and		4
		ret
; ---------------------------------------------------------------------------

Page7C_2B89:
		ld		de, 0Eh
		call	p7Csub_7E5C
		call	p7Csub_7F0D
		call	Page0Call_2CCD
		ld		b, a
		and		1
		jr		z, p7Cloc_7C11
		ld		a, b
		and		4
		jr		nz, p7Csub_7C20
		call	p7Csub_7E7F
		call	p7Csub_7C2C
		call	p7Csub_7E19
		set		4, (iy+25h)
		call	p7Csub_7C3B
		call	p7Csub_7C20
		res		4, (iy+25h)
		ret
; ---------------------------------------------------------------------------

p7Cloc_7C11:
		call	p7Csub_7E7F
		call	p7Csub_7C2C
		call	p7Csub_7E37
		call	p7Csub_728E
		call	FillBasePageTable

; =============== S U B	R O U T	I N E =======================================


p7Csub_7C20:
		call	Page0Call_2B53
		ld		a, b
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80CFh
; ---------------------------------------------------------------------------
		set		2, (iy+25h)
		ret
; End of function p7Csub_7C20


; =============== S U B	R O U T	I N E =======================================


p7Csub_7C2C:
		call	p7Csub_7EE2
		ld		a, 8
		dec		a
		ld		(winBtm), a
		ld		a, 0F0h	; '�'
		ld		(indicBusy), a
		ret
; End of function p7Csub_7C2C


; =============== S U B	R O U T	I N E =======================================


p7Csub_7C3B:
		call	p7Csub_7B46
		call	p7Csub_7EAD
		ld		a, (hl)
		cp		0FFh
		jr		z, p7Cloc_7C5F
		cp		0FEh ; '�'
		jr		z, p7Cloc_7C64
		cp		0FCh ; '�'
		jp		z, p7Cloc_7CE2
		cp		0F8h ; '�'
		jp		z, p7Cloc_7CF6
		cp		0F0h ; '�'
		jp		z, p7Cloc_7CFF
		cp		0E0h ; '�'
		jp		z, p7Cloc_7D4C
		ret
; ---------------------------------------------------------------------------

p7Cloc_7C5F:
		call	p7Csub_7AD8
		jr		p7Cloc_7CA0
; ---------------------------------------------------------------------------

p7Cloc_7C64:
		call	p7Cloc_7DEA
		jr		nc, p7Cloc_7C75
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		pop		af
		ld		b, 0FCh	; '�'
		call	p7Csub_7DC5
		jr		p7Cloc_7CA0
; ---------------------------------------------------------------------------

p7Cloc_7C75:
		call	p7Csub_7EA2
		ld		a, (hl)
		cp		8
		jr		nz, p7Cloc_7C8E
		add		a, 4
		call	p7Csub_78BF
		push	af
		ld		a, b
		cp		0FCh ; '�'
		jr		nz, p7Cloc_7C8B
		pop		af
		jr		p7Cloc_7C95
; ---------------------------------------------------------------------------

p7Cloc_7C8B:
		pop		af
		jr		p7Cloc_7CA3
; ---------------------------------------------------------------------------

p7Cloc_7C8E:
		ld		b, 0FCh	; '�'
		call	p7Csub_7AF1
		jr		nc, p7Cloc_7CA3

p7Cloc_7C95:
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		pop		bc
		call	p7Csub_7D53
		call	p7Cloc_78DD

p7Cloc_7CA0:
		jp		p7Csub_7D17
; ---------------------------------------------------------------------------

p7Cloc_7CA3:
		call	p7Csub_7EA2
		ld		a, (hl)
		cp		8
		jr		nz, p7Cloc_7CBC
		add		a, 4
		call	p7Csub_78BF
		push	af
		ld		a, b
		cp		0F8h ; '�'
		jr		nz, p7Cloc_7CB9
		pop		af
		jr		p7Cloc_7CC3
; ---------------------------------------------------------------------------

p7Cloc_7CB9:
		pop		af
		jr		p7Cloc_7CC6
; ---------------------------------------------------------------------------

p7Cloc_7CBC:
		ld		b, 0F8h	; '�'
		call	p7Csub_7AF1
		jr		nc, p7Cloc_7CC6

p7Cloc_7CC3:
		call	p7Csub_79EA

p7Cloc_7CC6:
		ld		b, 7Ch ; '|'
		call	p7Csub_7AF1
		jr		nc, p7Cloc_7CD2
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		jr		p7Csub_7D17
; ---------------------------------------------------------------------------

p7Cloc_7CD2:
		ld		b, 78h ; 'x'
		call	p7Csub_7AF1
		jr		nc, p7Csub_7D17
		call	p7Csub_7EA2
		ld		a, (hl)
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		jr		p7Cloc_7D21
; ---------------------------------------------------------------------------

p7Cloc_7CE2:
		call	p7Csub_7EA2
		ld		a, (hl)
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		call	p7Csub_7ECE
		ld		a, (hl)
		cp		0FFh
		jr		z, p7Cloc_7D26
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		jr		p7Cloc_7D26
; ---------------------------------------------------------------------------

p7Cloc_7CF6:
		call	p7Csub_7EB8
		ld		a, (hl)
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		jr		p7Cloc_7D37
; ---------------------------------------------------------------------------

p7Cloc_7CFF:
		ld		b, 0FCh	; '�'
		call	p7Csub_7AF1
		jr		c, p7Cloc_7D12
		ld		b, 0F8h	; '�'
		call	p7Csub_7AF1
		jr		nc, p7Cloc_7D41
		call	p7Cloc_7B9F
		jr		p7Cloc_7D47
; ---------------------------------------------------------------------------

p7Cloc_7D12:
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8084h
; ---------------------------------------------------------------------------
		jr		p7Cloc_7D41
; End of function p7Csub_7C3B


; =============== S U B	R O U T	I N E =======================================


p7Csub_7D17:
		call	p7Csub_783F
; End of function p7Csub_7D17


; =============== S U B	R O U T	I N E =======================================


p7Csub_7D1A:
		call	p7Csub_7E8C
		bit		3, (hl)
		jr		nz, p7Cloc_7D37

p7Cloc_7D21:
		ld		a, 0FCh	; '�'
		call	p7Csub_7AC2

p7Cloc_7D26:
		call	p7Csub_7A71
		call	p7Csub_7B46
		ld		a, 0F8h	; '�'
		call	p7Csub_7AC2
		call	p7Csub_7B4F
		call	p7Csub_7B46

p7Cloc_7D37:
		call	p7Csub_7B58
		jr		nc, p7Cloc_7D47
		ld		a, 0F0h	; '�'
		call	p7Csub_7AC2

p7Cloc_7D41:
		call	p7Csub_7B89
		call	p7Csub_7B46

p7Cloc_7D47:
		ld		a, 0E0h	; '�'
		call	p7Csub_7AC2

p7Cloc_7D4C:
		call	p7Csub_7BAC
		call	p7Csub_7B46
		ret
; End of function p7Csub_7D1A


; =============== S U B	R O U T	I N E =======================================


p7Csub_7D53:
		ld		a, b
		ld		(unk_8436), a
		ld		b, 0FCh	; '�'
		call	p7Csub_797E
		ld		a, 8
		ld		(unk_8435), a

p7Cloc_7D61:
		call	p7Csub_78B5
		jr		c, p7Cloc_7D8B
		push	af
		ld		hl, 4001h

p7Cloc_7D6A:
		ld		c, 0F8h	; '�'
		call	Page0Call_2B6B
		jr		z, p7Cloc_7D86
		push	af
		ld		a, (unk_8436)
		ld		b, a
		pop		af
		ld		(unk_8435), a
		push	af
		push	hl
		call	p7Csub_7B3E
		pop		hl
		pop		af
		call	p7Csub_7D99
		jr		p7Cloc_7D6A
; ---------------------------------------------------------------------------

p7Cloc_7D86:
		pop		af
		add		a, 4
		jr		p7Cloc_7D61
; ---------------------------------------------------------------------------

p7Cloc_7D8B:
		ld		a, (unk_8435)
		call	p7Csub_74C1
		ld		a, b
		push	af
		ld		a, (unk_8436)
		ld		b, a
		pop		af
		ret
; End of function p7Csub_7D53


; =============== S U B	R O U T	I N E =======================================


p7Csub_7D99:
		call	p7Csub_7DBE
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		ld		e, a
		pop		af
		call	p7Csub_7DBE
		push	af
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8051h
; ---------------------------------------------------------------------------
		ld		d, a
		pop		af
		call	p7Csub_7DBE
		ld		(arcPage), a
		ld		(arcPtr), hl
		call	Page0Call_2CC7
		ld		a, (arcPage)
		ld		hl, (arcPtr)
		ret
; End of function p7Csub_7D99


; =============== S U B	R O U T	I N E =======================================


p7Csub_7DBE:
		inc		hl
		call	Page0Call_23FC
		ret		nc
		inc		a
		ret
; End of function p7Csub_7DBE


; =============== S U B	R O U T	I N E =======================================


p7Csub_7DC5:
		push	bc
		sra	a
		sra	a
		sub		2
		push	af
		ld		d, 0
		ld		e, a
		call	p7Csub_7EC3
		add		hl, de
		ld		a, b
		ld		(hl), a
		ld		de, 14h
		call	p7Csub_7E5C
		pop		af
		ld		d, 0
		ld		e, a
		add		hl, de
		ex		de, hl
		pop		bc
; End of function p7Csub_7DC5


; =============== S U B	R O U T	I N E =======================================


p7Csub_7DE3:
		call	p7Csub_7F0D
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8021h
; ---------------------------------------------------------------------------
		ret
; ---------------------------------------------------------------------------

p7Cloc_7DEA:
		ld		b, 0
		call	p7Csub_7EC3

p7Cloc_7DEF:
		ld		a, (hl)
		cp		0FEh ; '�'
		jr		z, p7Cloc_7DFD
		inc		hl
		inc		b
		ld		a, b
		cp		4
		jr		nz, p7Cloc_7DEF
		or		a
		ret
; ---------------------------------------------------------------------------

p7Cloc_7DFD:
		ld		a, b
		add		a, 2
		sla	a
		sla	a
		scf
		ret
; End of function p7Csub_7DE3


; =============== S U B	R O U T	I N E =======================================


p7Csub_7E06:
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8057h
; ---------------------------------------------------------------------------
		call	Page0Call_2BE9
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8060h
; ---------------------------------------------------------------------------
		ret
; End of function p7Csub_7E06

; ---------------------------------------------------------------------------

Page7C_2B8F:
		call	p7Csub_7E7F
		call	p7Csub_735B
		jp		p7Cloc_757B

; =============== S U B	R O U T	I N E =======================================


p7Csub_7E19:
		ld		hl, lcdFlag
		bit		powerLcdForGC, (hl)
		call	nz, j_LCD_DRIVERON
		call	p7Csub_7E52
		ld		hl, aGarbage
		ld		a, 72h ; 'r'
		nop
		call	p7Cloc_7E47
		call	j_newline
		ld		hl, aCollecting___
		ld		a, 73h ; 's'
		jr		p7Cloc_7E47

p7Csub_7E37:
		ld		hl, lcdFlag
		bit		powerLcdForGC, (hl)
		call	nz, j_LCD_DRIVERON
		call	p7Csub_7E52
		ld		hl, aDefragmenting___
		ld		a, 4Fh ; 'O'

p7Cloc_7E47:
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	j_PutS
		ret
; End of function p7Csub_7E37


; =============== S U B	R O U T	I N E =======================================


p7Csub_7E52:
		call	Page0Call_3D05
		ld		hl, 0
		ld		(curRow), hl
		ret
; End of function p7Csub_7E52


; =============== S U B	R O U T	I N E =======================================


p7Csub_7E5C:
		push	af
		call	NZIf83Plus
		jr		z, p7Cloc_7E68
		call	Page0Call_2B7D

p7Cloc_7E65:
		add		hl, de
		pop		af
		ret
; ---------------------------------------------------------------------------

p7Cloc_7E68:
		call	p7Csub_7E71
		ld		a, e
		sub		0Eh
		ld		e, a
		jr		p7Cloc_7E65
; End of function p7Csub_7E5C


; =============== S U B	R O U T	I N E =======================================


p7Csub_7E71:
		push	bc
		push	ix
		rst		28h
; ---------------------------------------------------------------------------
		.dw		8057h
; ---------------------------------------------------------------------------
		ld		bc, 1DEAh
		add		hl, bc
		pop		ix
		pop		bc
		ret
; End of function p7Csub_7E71


; =============== S U B	R O U T	I N E =======================================


p7Csub_7E7F:
		ld		a, 3
		call	Page0Call_2B83
		ret
; End of function p7Csub_7E7F


; =============== S U B	R O U T	I N E =======================================


p7Csub_7E85:
		call	p7Csub_7E8C
		ld		a, b
		and		(hl)
		ld		(hl), a
		ret
; End of function p7Csub_7E85


; =============== S U B	R O U T	I N E =======================================


p7Csub_7E8C:
		ld		hl, 837Bh
		call	NZIf83Plus
		ret		nz
		ld		hl, tempSwapArea
		ret
; End of function p7Csub_7E8C


; =============== S U B	R O U T	I N E =======================================


p7Csub_7E97:
		ld		hl, 837Ch
		call	NZIf83Plus
		ret		nz
		ld		hl, 82A6h
		ret
; End of function p7Csub_7E97


; =============== S U B	R O U T	I N E =======================================


p7Csub_7EA2:
		ld		hl, 837Dh
		call	NZIf83Plus
		ret		nz
		ld		hl, 82A7h
		ret
; End of function p7Csub_7EA2


; =============== S U B	R O U T	I N E =======================================


p7Csub_7EAD:
		ld		hl, 837Eh
		call	NZIf83Plus
		ret		nz
		ld		hl, 82A8h
		ret
; End of function p7Csub_7EAD


; =============== S U B	R O U T	I N E =======================================


p7Csub_7EB8:
		; p7Csub_7C3B:p7Cloc_7CF6p
		ld		hl, 837Fh
		call	NZIf83Plus
		ret		nz
		ld		hl, 82A9h
		ret
; End of function p7Csub_7EB8


; =============== S U B	R O U T	I N E =======================================


p7Csub_7EC3:
		ld		hl, 8381h
		call	NZIf83Plus
		ret		nz
		ld		hl, 82ABh
		ret
; End of function p7Csub_7EC3


; =============== S U B	R O U T	I N E =======================================


p7Csub_7ECE:
		ld		hl, 8380h
		call	NZIf83Plus
		ret		nz
		ld		hl, 82AAh
		ret
; End of function p7Csub_7ECE


; =============== S U B	R O U T	I N E =======================================


p7Csub_7ED9:
		ld		a, 15h
		call	NZIf83Plus
		ret		nz
		ld		a, 69h ; 'i'
		ret
; End of function p7Csub_7ED9


; =============== S U B	R O U T	I N E =======================================


p7Csub_7EE2:
		call	p7Csub_7EE9
		rst		28h
; ---------------------------------------------------------------------------
		.dw		80CFh
; ---------------------------------------------------------------------------
		ret
; End of function p7Csub_7EE2


; =============== S U B	R O U T	I N E =======================================


p7Csub_7EE9:
		ld		a, 17h
		call	NZIf83Plus
		ret		nz
		ld		a, 6Bh ; 'k'
		ret
; End of function p7Csub_7EE9


; =============== S U B	R O U T	I N E =======================================


Page7C_2DB1:
		ld		a, b
		sub		8
		ld		hl, 8697h
		ld		c, a
		ld		b, 0
		sra	c
		sra	c
		sra	c
		add		hl, bc
		and		7
		ld		c, a
		ld		b, c
		ld		a, 80h ; '�'
		inc		b

p7Cloc_7F09:
		rlca
		djnz	p7Cloc_7F09
		ret
; End of function Page7C_2DB1


; =============== S U B	R O U T	I N E =======================================


p7Csub_7F0D:
		in		a, (2)
		and		80h ; '�'
		ld		a, 1Eh
		ret		z
		ld		a, 7Eh ; '~'
		ret
; End of function p7Csub_7F0D

; ---------------------------------------------------------------------------

p7Cloc_7F17:
		res		appTextSave, (iy+appFlags)
		call	j_saveShadow2
		di
		call	p7Csub_7E19
		call	p7Csub_7F30
		push	af
		ei
		call	j_rstrShadow2
		set		appTextSave, (iy+appFlags)
		pop		af
		ret

; =============== S U B	R O U T	I N E =======================================


p7Csub_7F30:
		di
		nop
		nop
		nop
		nop
		push	af
		ld		a, 1
		nop
		di
		nop
		nop
		im	1
		di
		out		(14h), a
		di
		call	page0_1F8
		pop		af
		call	p7Csub_7EE2
		call	p7Csub_7E06
		call	p7Csub_77DA
		call	p7Csub_7F58
		push	af
		call	p7Csub_7782
		pop		af
		ret
; End of function p7Csub_7F30


; =============== S U B	R O U T	I N E =======================================


p7Csub_7F58:
		call	p7Csub_7F63
		push	de
		call	p7Csub_7D1A
		pop		de
		ld		a, e
		or		a
		ret
; End of function p7Csub_7F58


; =============== S U B	R O U T	I N E =======================================


p7Csub_7F63:
		ld		a, 8
		ld		de, 0
		push	af

p7Cloc_7F69:
		pop		af
		call	p7Csub_7F97
		push	af
		push	af
		ld		a, b
		cp		1
		jr		z, p7Cloc_7F7F
		cp		2
		jr		z, p7Cloc_7F86
		cp		3
		jr		z, p7Cloc_7F8D
		pop		af
		pop		af
		ret
; ---------------------------------------------------------------------------

p7Cloc_7F7F:
		pop		af
		push	de
		call	p7Csub_78D2
		jr		p7Cloc_7F92
; ---------------------------------------------------------------------------

p7Cloc_7F86:
		pop		af
		push	de
		call	p7Csub_7A09
		jr		p7Cloc_7F92
; ---------------------------------------------------------------------------

p7Cloc_7F8D:
		pop		af
		push	de
		call	p7Csub_786A

p7Cloc_7F92:
		pop		de
		ld		e, 1
		jr		p7Cloc_7F69
; End of function p7Csub_7F63


; =============== S U B	R O U T	I N E =======================================


p7Csub_7F97:
		push	de
		call	p7Csub_78B5
		jr		c, p7Cloc_7FE1
		call	p7Csub_78BF
		pop		de
		push	af
		ld		a, b
		cp		0F0h ; '�'
		jr		z, p7Cloc_7FB6
		cp		70h ; 'p'
		jr		z, p7Cloc_7FDD
		cp		0FFh
		jr		nz, p7Cloc_7FB1
		ld		d, 1

p7Cloc_7FB1:
		pop		af
		add		a, 4
		jr		p7Csub_7F97
; ---------------------------------------------------------------------------

p7Cloc_7FB6:
		pop		af
		push	af
		push	de
		call	p7Csub_77BD
		pop		de
		jr		c, p7Cloc_7FCC
		ld		a, d
		or		a
		jr		nz, p7Cloc_7FC8
		pop		af
		add		a, 4
		jr		p7Csub_7F97
; ---------------------------------------------------------------------------

p7Cloc_7FC8:
		pop		af
		ld		b, 1
		ret
; ---------------------------------------------------------------------------

p7Cloc_7FCC:
		pop		af
		push	af
		push	de
		call	p7Csub_78C9
		pop		de
		jr		z, p7Cloc_7FD9
		pop		af
		ld		b, 1
		ret
; ---------------------------------------------------------------------------

p7Cloc_7FD9:
		pop		af
		ld		b, 3
		ret
; ---------------------------------------------------------------------------

p7Cloc_7FDD:
		pop		af
		ld		b, 2
		ret
; ---------------------------------------------------------------------------

p7Cloc_7FE1:
		pop		de
		ld		b, 4
		ret