source/page05/initial.asm
author brandonlw
Thu, 08 May 2014 17:09:00 -0400
changeset 24 12b896331796
parent 20 7b2a10ddc8f2
child 27 5220b6f6c984
permissions -rw-r--r--
More cleanup.

p05loc_4000:
		call	p05sub_4702

Page05_3A11:
		ld		a, (keyExtend)
		push	af
		ld		hl, Page05Context1
		call	page0_7C1
		set		grfSplitOverride, (iy+sGrFlags)
		pop		af
		call	Page05_328B
		call	p05sub_407A

p05loc_4018:
		xor		a
		ld		(winTop), a
		call	j_ClrWindow
		call	p05sub_462B
		call	p05sub_4692
		call	p05sub_4567

p05loc_4028:
		ld		a, 0Ah
		bit		localizeHookActive, (iy+hookflags3)
		jr		z, p05loc_4035
		ld		a, 49h ; 'I'
		call	j_call_character_hook

p05loc_4035:
		ld		(curRow+1), a
		ld		a, 0
		ld		(curRow), a
		call	p05sub_4454
		call	p05sub_4477
; START	OF FUNCTION CHUNK FOR p05sub_40AD

p05loc_4043:
		ld		hl, OP3

p05loc_4046:
		ld		a, (hl)
		ld		e, a
		ld		d, 0
		inc		hl
		or		a
		jr		z, p05loc_4058
		push	hl
		call	j_bufInsert
		pop		hl
		jr		nz, p05loc_4046
		jp		ErrMemory
; ---------------------------------------------------------------------------

p05loc_4058:
		call	j_BufToTop
		res		5, (iy+5)
		ret
; END OF FUNCTION CHUNK	FOR p05sub_40AD

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


Page05_328B:
		ld		(unk_8479+1), a
		ld		a, 5Ch ; '\'
		ld		(unk_8479), a
		sub		a
		ld		(unk_847B), a
		ret
; End of function Page05_328B

Page05Context1:
		.dw		Context1cxMain
		.dw		j_numPPutAway
		.dw		p05sub_4702
		.dw		j_numRedisp
		.dw		Context1cxErrorEP
		.dw		Context1cxSizeWind
		.db		0Ah

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


p05sub_407A:
		call	Page0Call_2413
		jr		nc, p05loc_408D
		ld		hl, 101h
		call	CreateRMat
		inc		de
		inc		de
		call	OPSet0DE
		call	OP4ToOP1

p05loc_408D:
		call	page0_1847
		call	PushRealO1
		call	CanAlphIns
		call	page0_740
		call	p05sub_40A3
		call	FINDSYM_GET_SIZE
		ld		(matrixDimensions), hl
		ret
; End of function p05sub_407A


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


p05sub_40A3:
		ld		hl, 101h
		ld		(unk_96FC), hl
		ld		(unk_970A), hl
		ret
; End of function p05sub_40A3


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


p05sub_40AD:



		ld		a, 0Dh
		bit		localizeHookActive, (iy+hookflags3)
		jr		z, p05loc_40BA
		ld		a, 4Ah ; 'J'
		call	j_call_character_hook

p05loc_40BA:
		ld		(curRow+1), a
		call	p05sub_4454
		call	p05sub_4472
		jp		p05loc_4043
; End of function p05sub_40AD

Context1cxErrorEP:
		call	j_rstrShadow2
		call	dspmattable
		call	page0_166E
		call	j_setupEditEqu
		call	j_BufToBtm
		ld		hl, (editTop)
		inc		hl
		inc		hl
		ld		(editBtm), hl
		ld		(editTail), hl
		call	j_BufToTop
		call	Page0Call_37A7
		ret
p05_loc_40E7:
		jp		Page0Call_37F5

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


p05sub_40EA:
		ld		hl, 615h
		call	pushErrorHandleR
		call	p05sub_40F7
		call	popErrorHandleR
		ret
; End of function p05sub_40EA


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


p05sub_40F7:
		call	p05sub_448C
		res		5, (iy+5)
		ld		hl, (mcxMain)
		ld		bc, SecondarycxMain
		sub		a
		sbc		hl, bc
		jr		z, p05loc_411F
		ld		a, (matrixDimensions+1)
		cp		e
		ret		z
		set		5, (iy+5)
		ld		a, (matrixDimensions)
		ld		d, e
		ld		e, a
		call	p05sub_413B
		ld		a, h
		ld		(matrixDimensions+1), a
		ret
; ---------------------------------------------------------------------------

p05loc_411F:
		ld		a, (matrixDimensions)
		cp		e
		ret		z
		set		5, (iy+5)
		ld		a, (matrixDimensions+1)
		ld		d, a
		call	p05sub_413B
		ld		a, l
		ld		(matrixDimensions), a
		ld		hl, 101h
		ld		(unk_970A), hl
		or		h
		ret
; End of function p05sub_40F7


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


p05sub_413B:
		push	de
		call	CpyTo1FPST
		rst		10h
		call	page0_1847
		pop		hl
		push	hl
		call	j_RedimMat
		call	CpyTo1FPST
		rst		10h
		bit		6, a
		call	nz, SetTblGraphDraw
		pop		hl
		ret
; End of function p05sub_413B

Context1cxMain:
		cp		27h ; '''
		jp		z, p05loc_4000
		cp		5
		jr		z, p05loc_4164
		cp		4
		jr		z, p05loc_4164

p05loc_4160:
		cp		3
		jr		nz, p05loc_41C5

p05loc_4164:
		call	IsEditEmpty
		ret		z
		call	p05sub_40EA
		ld		a, (kbdKey)
		cp		3
		jr		nz, p05loc_4188
		ld		hl, Page05Context1
		call	AppInit
		bit		5, (iy+5)
		jp		nz, p05loc_4018
		call	p05sub_462B
		call	p05sub_4692
		jp		p05loc_4028
; ---------------------------------------------------------------------------

p05loc_4188:
		bit		5, (iy+5)
		jr		nz, p05loc_4196
		call	p05sub_462B
		call	p05sub_4692
		jr		p05loc_4199
; ---------------------------------------------------------------------------

p05loc_4196:
		call	p05sub_46C7

p05loc_4199:
		res		curLock, (iy+curFlags)
		sub		a
		ld		(curRow), a
		ld		hl, SecondarycxMain
		ld		(mcxMain), hl
		ld		hl, Context1cxErrorEP
		ld		(mcxErrorEP), hl
		ld		hl, p05sub_4702
		ld		(mcxPutAway), hl
		call	p05sub_40AD
		call	j_setNumWindow
		ret
; ---------------------------------------------------------------------------

p05loc_41BA:
		call	j_ClrWindow
		call	p05sub_4567
		call	CanAlphIns
		jr		p05loc_4199
; ---------------------------------------------------------------------------

p05loc_41C5:
		cp		0Ah
		jr		nz, p05loc_41CE
		call	j_Leftmore
		jr		p05loc_4240
; ---------------------------------------------------------------------------

p05loc_41CE:
		cp		9
		jr		nz, p05loc_41D7
		call	j_fDel
		jr		p05loc_4240
; ---------------------------------------------------------------------------

p05loc_41D7:
		cp		8Ah ; '�'
		ret		z
		cp		0Ch
		ret		z
		cp		0Bh
		jr		nz, p05loc_41E5
		call	Page0Call_369F
		ret
; ---------------------------------------------------------------------------

p05loc_41E5:
		cp		0Dh
		ret		z
		cp		0Eh
		jr		z, p05loc_41F0
		cp		2
		jr		nz, p05loc_41F7

p05loc_41F0:
		call	j_CursorLeft
		call	Page0Call_37A1
		ret
; ---------------------------------------------------------------------------

p05loc_41F7:
		cp		0Fh
		jr		z, p05loc_41FF
		cp		1
		jr		nz, p05loc_4229

p05loc_41FF:
		ld		hl, (editCursor)
		ld		de, (editBtm)
		dec		de
		call	CpHLDE
		jr		nz, p05loc_4214
		ld		a, 5
		ld		(kbdKey), a
		jp		p05loc_4164
; ---------------------------------------------------------------------------

p05loc_4214:
		res		textInsMode, (iy+textFlags)
		ld		hl, (editTail)
		ld		de, (editBtm)
		call	CpHLDE
		ret		z
		ld		a, (hl)
		ld		e, a
		ld		d, 0
		jr		p05loc_4233
; ---------------------------------------------------------------------------

p05loc_4229:
		cp		5Ah ; 'Z'
		ret		c
		call	j_ConvKeyToTok
		ld		a, d
		or		a
		ret		nz
		ld		a, e

p05loc_4233:
		cp		3Ah ; ':'
		ret		nc
		cp		30h ; '0'
		ret		c
		set		5, (iy+5)
		call	j_finsDisp

p05loc_4240:
		call	p05sub_42D4
		ret		nz
		ld		hl, (curRow)
		push	hl
		ld		a, 0Ch
		bit		localizeHookActive, (iy+hookflags3)
		jr		z, p05loc_4255
		ld		a, 4Bh ; 'K'
		call	j_call_character_hook

p05loc_4255:
		ld		(curRow+1), a
		call	p05loc_46B6
		pop		hl
		ld		(curRow), hl
		ret
SecondarycxMain:
		cp		27h ; '''
		jp		z, p05loc_4000
		cp		0Eh
		jr		z, p05loc_426D
		cp		2
		jr		nz, p05loc_4278

p05loc_426D:
		call	IsAtTop
		jp		nz, p05loc_41F0
		ld		a, 3
		ld		(kbdKey), a

p05loc_4278:
		cp		0Fh
		jr		z, p05loc_4280
		cp		1
		jr		nz, p05loc_4294

p05loc_4280:
		ld		hl, (editCursor)
		ld		de, (editBtm)
		dec		de
		call	CpHLDE
		jr		nz, p05loc_4294
		ld		a, 5
		ld		(kbdKey), a
		jr		p05loc_429D
; ---------------------------------------------------------------------------

p05loc_4294:
		cp		5
		jr		z, p05loc_429D
		cp		4
		jp		nz, p05loc_4160

p05loc_429D:
		call	IsEditEmpty
		ret		z
		ld		hl, 615h
		call	pushErrorHandleR
		call	p05sub_40F7
		jr		nz, p05loc_42B7
		call	popErrorHandleR
		call	p05sub_462B
		call	p05sub_4692
		jr		p05loc_42BD
; ---------------------------------------------------------------------------

p05loc_42B7:
		call	popErrorHandleR

p05loc_42BA:
		call	p05loc_46CD

p05loc_42BD:
		call	p05sub_42E8
		call	p05sub_443F

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


p05sub_42C3:

		ld		hl, ThirdcxMain
		ld		(mcxMain), hl
		ld		hl, p05_loc_589B
		ld		(mcxPutAway), hl
		set		curLock, (iy+curFlags)
		ret
; End of function p05sub_42C3


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


p05sub_42D4:

		ld		de, Context1cxMain
		ld		hl, (mcxMain)
		jp		CpHLDE
; End of function p05sub_42D4

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

Page05_3291:
		call	p05sub_42D4
		ret		z
		ld		de, SecondarycxMain
		call	CpHLDE
		ret		z

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


p05sub_42E8:

		set		textInverse, (iy+textFlags)
		jr		p05loc_42EE

p05loc_42EE:
		; p05sub_4435:p05loc_443Bp
		call	p05sub_42F9
		call	p05sub_4721
		res		textInverse, (iy+textFlags)
		ret
; End of function p05sub_42E8


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


p05sub_42F9:
		; p05sub_4567+29p	...



		ld		a, (unk_970A+1)
		dec		a
		sla	a
		ld		b, a
		sla	a
		add		a, b
		add		a, 0Ah
		call	CheckSplitFlag
		jr		z, p05loc_430C
		add		a, 20h ; ' '

p05loc_430C:
		ld		(penCol+1), a
		ld		a, (unk_970A)
		dec		a
		sla	a
		ld		b, a
		sla	a
		sla	a
		sla	a
		sla	a
		sub		b
		add		a, 5
		ld		(penCol), a
		jp		VPUTBLANK
; End of function p05sub_42F9


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


p05sub_4327:
		ld		a, (matrixDimensions+1)
		ld		hl, 96FDh
		cp		(hl)
		ret
; End of function p05sub_4327


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


p05sub_432F:
		ld		a, (unk_96FC+1)
		ld		hl, 9703h
		cp		(hl)
		ret
; End of function p05sub_432F

ThirdcxMain:
		cp		5
		jr		nz, p05loc_4359
		res		curLock, (iy+curFlags)
		ld		a, 7
		ld		(curRow), a
		ld		hl, p05loc_44B3
		ld		(mcxMain), hl
		ld		hl, p05loc_57B8
		ld		(mcxPutAway), hl
		ld		hl, p05_loc_40E7
		ld		(mcxErrorEP), hl
		jp		p05loc_4524
; ---------------------------------------------------------------------------

p05loc_4359:
		cp		3
		jr		nz, p05loc_436E

p05loc_435D:
		ld		a, (unk_96FC+1)
		cp		2
		jp		c, p05loc_41BA
		call	p05sub_4423
		ld		hl, 96FDh
		dec		(hl)
		jr		p05loc_43C7
; ---------------------------------------------------------------------------

p05loc_436E:
		cp		4
		jr		nz, p05loc_438A
		call	p05sub_432F
		ret		nc

p05loc_4376:
		call	p05sub_442D
		ld		hl, 96FDh
		inc		(hl)
		ld		hl, 970Bh
		ld		a, (hl)
		cp		7
		jr		p05loc_43A3
; ---------------------------------------------------------------------------

p05loc_4385:
		call	p05sub_42C3
		jr		p05loc_4396
; ---------------------------------------------------------------------------

p05loc_438A:
		cp		0Fh
		jr		z, p05loc_4392
		cp		1
		jr		nz, p05loc_43AD

p05loc_4392:
		call	p05sub_477B
		ret		nc

p05loc_4396:
		call	p05sub_4435
		ld		hl, 96FCh
		inc		(hl)
		ld		hl, 970Ah
		ld		a, (hl)
		cp		3

p05loc_43A3:
		jr		nc, p05loc_43A8
		inc		(hl)
		jr		p05loc_43AB
; ---------------------------------------------------------------------------

p05loc_43A8:
		call	p05sub_4562

p05loc_43AB:
		jr		p05loc_43D3
; ---------------------------------------------------------------------------

p05loc_43AD:
		cp		0Eh
		jr		z, p05loc_43B5
		cp		2
		jr		nz, p05loc_43DA

p05loc_43B5:
		ld		a, (unk_96FC)
		cp		2
		ret		c
		call	p05sub_441E
		ld		hl, 96FCh
		dec		(hl)
		ld		hl, 970Ah
		jr		p05loc_43CA
; ---------------------------------------------------------------------------

p05loc_43C7:
		ld		hl, 970Bh

p05loc_43CA:
		dec		(hl)
		ld		a, (hl)
		or		a
		jr		nz, p05loc_43D3
		inc		(hl)
		call	p05sub_4562

p05loc_43D3:

		call	p05sub_42E8
		call	p05sub_443F
		ret
; ---------------------------------------------------------------------------

p05loc_43DA:
		cp		0Ch
		ret		z
		cp		8Ah ; '�'
		ret		z
		cp		0Ah
		ret		z
		cp		0Bh
		ret		z
		cp		27h ; '''
		jr		nz, p05loc_43F0
		call	p05sub_57B8
		jp		Page05_3A11
; ---------------------------------------------------------------------------

p05loc_43F0:
		cp		9
		jr		z, p05loc_43FB
		cp		0Dh
		jr		z, p05loc_43FB
		cp		5Ah ; 'Z'
		ret		c

p05loc_43FB:
		res		curLock, (iy+curFlags)
		push	af
		ld		a, 7
		ld		(curRow), a
		ld		hl, p05loc_44B3
		ld		(mcxMain), hl
		ld		hl, p05loc_57B8
		ld		(mcxPutAway), hl
		ld		hl, p05_loc_40E7
		ld		(mcxErrorEP), hl
		call	p05sub_47A3
		pop		af
		jp		p05loc_44B3

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


p05sub_441E:
		ld		hl, 970Ah
		jr		p05loc_4426
; End of function p05sub_441E


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


p05sub_4423:
		ld		hl, 970Bh

p05loc_4426:
		ld		a, (hl)
		cp		2
		call	nc, p05loc_42EE
		ret
; End of function p05sub_4423


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


p05sub_442D:
		ld		hl, 970Bh
		ld		a, (hl)
		cp		7
		jr		p05loc_443B
; End of function p05sub_442D


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


p05sub_4435:
		ld		hl, 970Ah
		ld		a, (hl)
		cp		3

p05loc_443B:
		call	c, p05loc_42EE
		ret
; End of function p05sub_4435


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


p05sub_443F:
		ld		hl, (curRow)
		push	hl
		ld		hl, 7
		ld		(curRow), hl
		call	p05sub_460B
		call	p05sub_478B
		pop		hl
		ld		(curRow), hl
		ret
; End of function p05sub_443F


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


p05sub_4454:
		ld		a, (curRow+1)
		ld		(winLeftEdge), a
		call	j_createNumEditBuf
		ld		(editSym), hl
		call	page0_166E
		call	j_setEmptyEditEqu
		ld		hl, (editTop)
		inc		hl
		inc		hl
		ld		(editBtm), hl
		ld		(editTail), hl
		ret
; End of function p05sub_4454


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


p05sub_4472:
		ld		a, (matrixDimensions)
		jr		p05loc_447A
; End of function p05sub_4472


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


p05sub_4477:
		ld		a, (matrixDimensions+1)

p05loc_447A:
		ld		l, a
		ld		h, 0
		call	j_SetXXXXOP2
		call	OP2ToOP1
		ld		a, 3
		call	j_FormEReal
		ld		hl, OP3
		ret
; End of function p05sub_4477


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


p05sub_448C:
		call	j_BufToBtm
		ld		hl, (iMathPtr3)
		ld		(editBtm), hl
		ld		(editTail), hl
		call	parseEditBuf
		call	page0_1847
		call	page0_14D1
		jp		nz, ErrDimension
		call	j_ConvOP1
		sub		a
		cp		d
		jp		nz, ErrDimension
		ld		a, 63h ; 'c'
		cp		e
		jp		c, ErrDimension
		ret
; End of function p05sub_448C

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

p05loc_44B3:
		cp		5
		jr		nz, p05loc_4500
		call	IsEditEmpty
		jr		nz, p05loc_44CC
		call	closeEditBuf
		call	p05sub_477B
		jr		c, p05loc_44CF
		call	p05sub_432F
		call	nc, p05sub_478B
		jr		p05loc_44CF
; ---------------------------------------------------------------------------

p05loc_44CC:
		call	p05sub_4549

p05loc_44CF:
		call	p05sub_477B
		jp		c, p05loc_4385
		ld		a, (mcxCurApp)
		cp		42h ; 'B'
		jr		nz, p05loc_4524
		call	p05sub_432F
		jp		nc, p05loc_42BA
		call	p05sub_42C3
		ld		a, 1
		ld		(unk_96FC), a
		ld		(unk_970A), a
		ld		hl, 96FDh
		inc		(hl)
		ld		hl, 970Bh
		ld		a, (hl)
		cp		7
		jr		nc, p05loc_44FA
		inc		(hl)

p05loc_44FA:
		call	p05sub_4562
		jp		p05loc_43D3
; ---------------------------------------------------------------------------

p05loc_4500:
		cp		4
		jr		nz, p05loc_4528
		call	IsEditEmpty
		jr		nz, p05loc_4514
		call	closeEditBuf
		call	p05sub_432F
		call	nc, p05sub_478B
		jr		p05loc_4517
; ---------------------------------------------------------------------------

p05loc_4514:
		call	p05sub_4549

p05loc_4517:
		call	p05sub_42C3
		call	p05sub_432F
		jp		c, p05loc_4376
		call	p05sub_42E8
		ret
; ---------------------------------------------------------------------------

p05loc_4524:
		call	p05sub_47A3
		ret
; ---------------------------------------------------------------------------

p05loc_4528:
		cp		3
		jr		nz, p05loc_4535
		call	p05sub_4549
		call	p05sub_42C3
		jp		p05loc_435D
; ---------------------------------------------------------------------------

p05loc_4535:
		bit		enableQueue, (iy+rclFlag)
		jr		nz, p05loc_453E
		cp		8Ah ; '�'
		ret		z

p05loc_453E:
		cp		27h ; '''
		jp		nz, j_CallCommon
		call	p05sub_57B8
		jp		Page05_3A11

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


p05sub_4549:

		call	IsEditEmpty
		jr		nz, p05loc_4552
		call	closeEditBuf
		ret
; ---------------------------------------------------------------------------

p05loc_4552:
		ld		hl, 615h
		call	pushErrorHandleR
		call	p05sub_47C2
		call	p05sub_478B
		call	popErrorHandleR
		ret
; End of function p05sub_4549


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


p05sub_4562:

		call	j_ClrWindow
		jr		dspmattable
; End of function p05sub_4562


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


p05sub_4567:
		call	p05sub_40A3

dspmattable:
		ld		hl, (unk_970A)
		push	hl
		ld		hl, (unk_96FC)
		push	hl
		inc		h
		inc		l
		ld		de, (unk_970A)
		sub		a
		sbc		hl, de
		ld		(unk_96FC), hl
		ld		a, l
		push	af
		call	p05sub_46DD

p05loc_4583:
		ld		(unk_970A+1), a
		ld		a, 1
		ld		(unk_970A), a
		pop		af
		push	af
		ld		(unk_96FC), a
		call	p05sub_42F9
		sub		a
		ld		(penCol), a
		ld		a, (unk_96FC)
		cp		2
		jr		nc, p05loc_45A2
		ld		a, 0C1h	; '�'
		jr		p05loc_45A4
; ---------------------------------------------------------------------------

p05loc_45A2:
		ld		a, 5Fh ; '_'

p05loc_45A4:
		call	j_VPutMap
		call	p05sub_42F9
		call	p05sub_4758
		call	p05sub_45F7
		call	p05sub_45F7
		ld		a, 5Ch ; '\'
		ld		(penCol), a
		call	p05sub_477B
		jr		c, p05loc_45C1
		ld		a, 5Dh ; ']'
		jr		p05loc_45C3
; ---------------------------------------------------------------------------

p05loc_45C1:
		ld		a, 0CEh	; '�'

p05loc_45C3:
		call	j_VPutMap
		ld		a, (unk_970A+1)
		cp		2
		jr		nc, p05loc_45D5
		ld		a, (unk_96FC+1)
		cp		2
		call	nc, p05sub_47EA

p05loc_45D5:
		ld		a, (unk_96FC+1)
		ld		hl, 9703h
		cp		(hl)
		jr		nc, p05loc_45ED
		inc		a
		ld		(unk_96FC+1), a
		ld		a, (unk_970A+1)
		inc		a
		cp		8
		jr		c, p05loc_4583
		call	p05sub_47F6

p05loc_45ED:
		pop		af
		pop		hl
		ld		(unk_96FC), hl
		pop		hl
		ld		(unk_970A), hl
		ret
; End of function p05sub_4567


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


p05sub_45F7:
		call	p05sub_4783
		ret		z
		ret		c
		inc		(hl)
		ld		a, (unk_970A)
		inc		a
		ld		(unk_970A), a
		call	p05sub_42F9
		call	p05sub_4758
		ret
; End of function p05sub_45F7


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


p05sub_460B:
		sub		a
		ld		(curRow+1), a
		ld		a, (unk_96FC+1)
		call	p05sub_4626
		ld		a, 2Ch ; ','
		call	j_PutC
		ld		a, (unk_96FC)
		call	p05sub_4626
		ld		a, 3Dh ; '='
		call	j_PutC
		ret
; End of function p05sub_460B


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


p05sub_4626:
		ld		b, 80h ; '�'
		jp		p05sub_554E
; End of function p05sub_4626


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


p05sub_462B:
		ld		hl, aMatrix
		ld		a, 32h ; '2'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		sub		a
		ld		(curRow), a
		ld		(curRow+1), a
		call	j_PutS
		call	CpyTo1FPST
		ld		a, (unk_8479+1)
		add		a, 41h ; 'A'
		call	j_PutC
		ld		a, 5Dh ; ']'
		call	j_PutC
		ret
; End of function p05sub_462B

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

Page05_329D:
		push	af
		ld		a, 20h ; ' '
		call	j_PutC
		pop		af
		call	Page05_328B
		rst		10h
		jr		nc, p05loc_4663
		call	j_EraseEOL
		ret
; ---------------------------------------------------------------------------

p05loc_4663:
		call	IsBZero
		jr		z, p05loc_4674
		ld		hl, (matrixDimensions)
		push	hl
		ex		de, hl
		call	Page0Call_3267
		ld		h, b
		ld		l, c
		jr		p05loc_467C
; ---------------------------------------------------------------------------

p05loc_4674:
		ld		hl, (matrixDimensions)
		push	hl
		ex		de, hl
		call	ldHLind

p05loc_467C:
		ld		(matrixDimensions), hl
		ld		a, 6
		ld		(curRow+1), a
		ld		a, (matrixDimensions+1)
		call	DispListElementOffLA
		call	p05loc_46B6
		pop		hl
		ld		(matrixDimensions), hl
		ret

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


p05sub_4692:
		bit		localizeHookActive, (iy+hookflags3)
		jr		z, p05loc_469F
		ld		a, 4Ch ; 'L'
		call	j_call_character_hook
		jr		p05loc_46B6
; ---------------------------------------------------------------------------

p05loc_469F:
		ld		a, 0Ah
		ld		(curRow+1), a
		ld		a, (matrixDimensions+1)
		call	DispListElementOffLA
		ld		a, (curRow+1)
		cp		0Bh
		jr		nz, p05loc_46B6
		ld		a, 20h ; ' '
		call	j_PutC

p05loc_46B6:
		ld		a, 9
		call	j_PutC
		call	j_EraseEOL
		ld		a, (matrixDimensions)
; End of function p05sub_4692


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


DispListElementOffLA:
		ld		b, 30h ; '0'
		call	p05sub_554E
		ret
; End of function DispListElementOffLA


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


p05sub_46C7:
		ld		hl, 101h
		ld		(unk_970A), hl

p05loc_46CD:
		sub		a
		ld		(winTop), a
		call	j_ClrWindow
		call	p05sub_462B
		call	p05sub_4692
		call	dspmattable
; End of function p05sub_46C7


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


p05sub_46DD:
		ld		a, 1
		ld		(winTop), a
		ret
; End of function p05sub_46DD

Context1cxSizeWind:
p05loc_46E3:
		jr		c, p05loc_46E9
		call	p05sub_46F6
		ret
; ---------------------------------------------------------------------------

p05loc_46E9:
		call	j_rstrbotrow
		ld		a, (mcxCurApp)
		cp		4Ah ; 'J'
		ret		nz
		call	j_DRAWSPLITLINE
		ret

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


p05sub_46F6:
		ld		hl, 8578h
		ld		de, 978Fh
		ld		bc, 10h
		ldir
		ret
; End of function p05sub_46F6


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


p05sub_4702:
		ld		hl, p05_loc_471C
		call	pushErrorHandleR
		call	IsEditEmpty
		call	nz, p05sub_40F7
		call	closeEditBuf
		call	popErrorHandleR

p05loc_4714:
		call	p05sub_58A7
		res		grfSplitOverride, (iy+sGrFlags)
		ret
; End of function p05sub_4702

p05_loc_471C:
		call	j_releaseBuffer
		jr		p05loc_4714

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


p05sub_4721:
		call	p05sub_4797
		call	p05sub_475E
		res		1, (iy+0Eh)
		call	p05sub_67C8
		ret
; End of function p05sub_4721

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_5427

p05loc_472F:
		res		1, (iy+0Eh)
		res		textEraseBelow, (iy+textFlags)
		call	p05sub_475E
		ld		a, (OP1)
		sub		0Ch
		jp		nz, p05sub_67C8
		ld		a, c
		cp		7
		jp		c, p05sub_67C8
		sub		a
		ld		(unk_97B6), a
		call	j_VPutS
		ld		a, 0CEh	; '�'
		call	j_VPutMap
		call	p05sub_6B86
		ret
; END OF FUNCTION CHUNK	FOR p05sub_5427

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


p05sub_4758:
		call	p05sub_4797
		jp		p05sub_67F0
; End of function p05sub_4758


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


p05sub_475E:
		ld		a, 6

p05loc_4760:
		ld		hl, OP1
		ld		b, a
		ld		a, (OP1)
		call	page0_1032
		ld		a, b
		jr		z, p05loc_4774
		call	j_FormReal
		ld		hl, OP3
		ret
; ---------------------------------------------------------------------------

p05loc_4774:
		call	j_FormDCplx
		ld		hl, fmtString
		ret
; End of function p05sub_475E


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


p05sub_477B:

		ld		a, (unk_96FC)
		ld		hl, matrixDimensions
		cp		(hl)
		ret
; End of function p05sub_477B


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


p05sub_4783:
		ld		a, (matrixDimensions)
		ld		hl, 96FCh
		cp		(hl)
		ret
; End of function p05sub_4783


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


p05sub_478B:



		call	Page05_3279
		call	p05sub_4797
		call	p05sub_5663
		jp		Page05_327F
; End of function p05sub_478B


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


p05sub_4797:
		call	CpyTo1FPST
		rst		10h
		ld		bc, (unk_96FC)
		call	j_GetMToOP1
		ret
; End of function p05sub_4797


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


p05sub_47A3:

		call	j_RecallEd
		call	p05sub_47B8
		jr		z, p05loc_47AD
		jr		c, p05loc_47B4

p05loc_47AD:
		call	p05sub_4797
		call	Page0Call_3735
		ret
; ---------------------------------------------------------------------------

p05loc_47B4:
		call	Page0Call_3741
		ret
; End of function p05sub_47A3


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


p05sub_47B8:
		; p05sub_47C2:p05loc_47DFp
		call	p05sub_4327
		ret		nz
		dec		hl
		ld		a, (matrixDimensions)
		cp		(hl)
		ret
; End of function p05sub_47B8


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


p05sub_47C2:
		call	parseEditBuf
		call	page0_1847
		bit		5, (iy+5)
		jr		z, p05loc_47DF
		call	p05sub_58DC
		ld		hl, (unk_96FC)
		ld		d, 0
		ld		e, h
		ld		b, d
		ld		c, l
		call	j_StMatEl
		call	j_CleanAll

p05loc_47DF:
		call	p05sub_47B8
		ret		nc
		ld		hl, (unk_96FC)
		ld		(matrixDimensions), hl
		ret
; End of function p05sub_47C2


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


p05sub_47EA:
		ld		c, 1Eh

p05loc_47EC:
		ld		a, 5Ch ; '\'
		ld		(penCol), a
		ld		a, c
		call	j_VPutMap
		ret
; End of function p05sub_47EA


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


p05sub_47F6:
		ld		c, 1Fh
		jr		p05loc_47EC
; End of function p05sub_47F6


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


p05sub_47FA:
		call	p05loc_5868
		jr		Page05_3A17
; End of function p05sub_47FA

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_47FF:
		; p05sub_4DDF+2F3j ...
		call	p05loc_5874

Page05_3A17:
		call	p05sub_5AEE
		ld		hl, Page05Context2
		call	page0_7C1
		call	page0_176F
		call	p05sub_4882
		dec		a
		ld		(winTop), a
		ld		a, (unk_970F)
		ld		hl, 9710h
		add		a, (hl)
		inc		a
		ld		(unk_96FC), a
		ld		hl, 1
		ld		(unk_96FE), hl
		ld		a, (unk_9710)
		inc		a
		ld		l, a
		ld		h, 1
		ld		(unk_970A), hl
		call	p05sub_4861
		ld		a, (unk_89FA)
		ld		(unk_89FB), a
		xor		a
		ld		(unk_9301), a
		res		4, (iy+19h)
		call	p05sub_488C
		call	p05sub_56EA
		bit		4, (iy+19h)
		jr		z, p05loc_4877

p05loc_484D:
		ld		a, 3
		call	p05sub_4DDF
		ld		a, 5
		call	p05sub_4DDF
		ld		a, 5
		ld		hl, (mcxMain)
		res		4, (iy+19h)
		jp		(hl)
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


p05sub_4861:

		ld		a, (unk_970E)
		cp		14h
		jr		nz, p05loc_4872
		ld		a, (listName20)
		cp		71h ; 'q'
		ld		a, (unk_970E)
		jr		nz, p05loc_4873

p05loc_4872:
		dec		a

p05loc_4873:
		ld		(matrixDimensions), a
		ret
; End of function p05sub_4861

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_487A

p05loc_4877:
		jp		p05loc_5B62
; END OF FUNCTION CHUNK	FOR p05sub_487A

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


p05sub_487A:
		; p05sub_4DDF:p05loc_5152p ...




		ld		hl, Page05Context2
		call	AppInit
		jr		p05loc_4877
; End of function p05sub_487A


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


p05sub_4882:
		ld		a, 1
		bit		grfSplit, (iy+sGrFlags)
		ret		z
		add		a, 4
		ret
; End of function p05sub_4882


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


p05sub_488C:
		; p05sub_4DDF+21Cp ...
		call	j_ClrWindow
		call	Page05_322B
		call	p05sub_4882
		ld		(winTop), a
		call	dsplsts
		call	p05sub_54A7
		call	p05sub_5221
		jr		nz, p05loc_48B3
		ld		hl, 0
		ld		(unk_96FC+1), hl
		sub		a
		ld		(unk_970A+1), a
		ld		hl, p05_loc_4BF6
		ld		(mcxMain), hl

p05loc_48B3:
		call	Page05_3225
; End of function p05sub_488C


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


p05sub_48B6:
		call	p05sub_550D
		call	p05sub_55B6
		call	Page05_3219
		ret
; End of function p05sub_48B6


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


Page05_3219:
		ld		a, (unk_96FC)
		cp		0Ah
		jr		nc, p05loc_48D3
		ld		b, 6
		ld		a, 57h ; 'W'
		call	p05sub_48F2
		ld		a, (unk_96FC)
		jr		p05loc_48ED
; ---------------------------------------------------------------------------

p05loc_48D3:
		cp		14h
		jr		nz, p05loc_48DB
		ld		a, 82h ; '�'
		jr		p05loc_48DD
; ---------------------------------------------------------------------------

p05loc_48DB:
		ld		a, 81h ; '�'

p05loc_48DD:
		ld		b, a
		ld		a, 57h ; 'W'
		call	p05sub_48F2
		ld		a, (unk_96FC)
		sub		0Ah
		cp		0Ah
		jr		nz, p05loc_48ED
		sub		a

p05loc_48ED:
		; Page05_3219+2Aj
		add		a, 80h ; '�'
		ld		b, a
		ld		a, 5Bh ; '['
; End of function Page05_3219


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


p05sub_48F2:
		; Page05_3219+20p
		ld		(penCol), a
		sub		a
		ld		(penCol+1), a
		jp		p05loc_558A
; End of function p05sub_48F2

p05_loc_48FC:
		jr		c, p05loc_4902
		call	p05sub_46F6
		ret
; ---------------------------------------------------------------------------

p05loc_4902:
		call	j_rstrbotrow
		call	p05sub_54BB
		call	Page05_323D
		ret
Page05Context2:
		.dw		p05sub_4DDF
		.dw		j_numPPutAway
		.dw		p05_loc_5893
		.dw		j_numRedisp
		.dw		Page0Call_37FB
		.dw		p05_loc_48FC
		.db		0Ah

p05loc_4919:
		call	j_rstrShadow2
		ld		a, 7
		ld		(curRow), a
		call	j_SetMenuFlags
		xor		a
		ld		(unk_9301), a
		call	p05sub_552C
		rst		10h
		call	GET_FORM_NUM
		jp		p05loc_4DAB

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


p05sub_4932:
		; p05sub_4B4A:p05loc_4B6Ap ...
		ld		a, (mcxCurApp)
		cp		55h ; 'U'
		ret
; End of function p05sub_4932

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

Page05_342F:
		cp		6
		jr		z, Page05_3435
		cp		5
		jp		nz, p05loc_4B46

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


Page05_3435:
		call	CanAlphIns
		call	j_BufToBtm
		call	p05sub_5ADB
		ld		hl, (editCursor)
		ld		de, (editTail)
		call	CpHLDE
		jr		z, p05loc_495F
		ld		a, 0

p05loc_4958:
		ld		(hl), a
		inc		hl
		call	CpHLDE
		jr		nz, p05loc_4958

p05loc_495F:
		ld		hl, 84C8h
		ld		de, 84CCh
		ld		a, (mcxCurApp)
		cp		56h ; 'V'
		jr		nz, p05loc_4978
		bit		5, (iy+1Ch)
		jr		nz, p05loc_4983
		bit		6, (iy+1Ch)
		jr		nz, p05loc_4983

p05loc_4978:
		; Page05_3435+40j
		ld		a, (hl)
		cp		5Dh ; ']'
		jr		z, p05loc_49E7
		inc		hl
		call	CpHLDE
		jr		nz, p05loc_4978

p05loc_4983:
		; Page05_3435+35j
		ld		hl, nameBuff
		ld		de, 8479h
		call	Mov8B
		ld		hl, (editCursor)
		ld		de, nameBuff
		or		a
		sbc		hl, de
		jr		nz, p05loc_49A7
		ld		a, (mcxCurApp)
		cp		56h ; 'V'
		ret		nz
		bit		6, (iy+1Ch)
		ret		z
		call	ZeroOP1
		jr		p05loc_4A0B
; ---------------------------------------------------------------------------

p05loc_49A7:
		ld		a, (mcxCurApp)
		cp		56h ; 'V'
		jr		nz, p05loc_49BB
		bit		5, (iy+1Ch)
		jr		nz, p05loc_4A0F
		bit		6, (iy+1Ch)
		jp		nz, p05loc_4A2F

p05loc_49BB:
		ld		a, (unk_8479)
		cp		31h ; '1'
		jr		nz, p05loc_49CD
		bit		1, (iy+18h)
		jr		z, p05loc_49E7
		ld		a, l
		cp		1
		jr		z, p05loc_49EF

p05loc_49CD:
		cp		41h ; 'A'
		jr		c, p05loc_49E7
		cp		5Ch ; '\'
		jr		c, p05loc_49EF
		cp		5Dh ; ']'
		jr		nz, p05loc_49E7
		ld		a, l
		cp		3
		jr		nc, p05loc_49E7
		ld		a, (unk_8479+1)
		ld		(unk_8479), a
		dec		l
		jr		p05loc_49EF
; ---------------------------------------------------------------------------

p05loc_49E7:
		; Page05_3435+85j ...
		bit		monAbandon, (iy+monFlags)
		jp		z, ErrSyntax
		ret
; ---------------------------------------------------------------------------

p05loc_49EF:
		; Page05_3435+92j ...
		ld		a, 5
		sub		l
		jr		z, p05loc_49FE
		ld		hl, 847Eh
		ld		e, a
		ld		d, 0
		sbc		hl, de
		ld		(hl), 0

p05loc_49FE:
		ld		b, 0
		ld		c, 5
		call	p05sub_4932
		jr		z, p05loc_4A48
		cp		56h ; 'V'
		jr		nz, p05loc_4A4C

p05loc_4A0B:
		; Page05_3435+ECj ...
		call	Page0Call_3465
		ret
; ---------------------------------------------------------------------------

p05loc_4A0F:
		ld		a, (unk_8479)
		cp		5Ch ; '\'
		jr		nz, p05loc_49E7
		ld		a, (unk_8479+1)
		cp		0Ah
		jr		nc, p05loc_49E7
		ld		hl, (editCursor)
		ld		de, 84C9h
		or		a
		sbc		hl, de
		jr		nz, p05loc_49E7
		ld		a, 2
		ld		(OP1), a
		jr		p05loc_4A0B
; ---------------------------------------------------------------------------

p05loc_4A2F:
		ld		a, (unk_8479)
		cp		5Eh ; '^'
		jr		nz, p05loc_49E7
		ld		hl, (editCursor)
		ld		de, 84C9h
		or		a
		sbc		hl, de
		jr		nz, p05loc_49E7
		ld		a, 3
		ld		(OP1), a
		jr		p05loc_4A0B
; ---------------------------------------------------------------------------

p05loc_4A48:
		call	p05sub_735E
		ret
; ---------------------------------------------------------------------------

p05loc_4A4C:
		push	bc
		ld		a, (unk_8479)
		cp		5Dh ; ']'
		jr		z, p05loc_4A62
		ld		de, 847Fh
		ld		hl, 847Eh
		ld		bc, 6
		lddr
		inc		hl
		ld		(hl), 5Dh ; ']'

p05loc_4A62:
		call	Page0Call_241E
		pop		bc
		ld		a, (unk_96FC)
		dec		a
		call	p05sub_5199
		ex		de, hl
		ld		hl, OP1M
		ldir
		call	p05sub_5463
		jr		nz, p05loc_4A8C
		ld		(matrixDimensions), a
		cp		14h
		jp		z, p05loc_4A8C
		ld		a, (unk_96FC)
		call	p05sub_5199
		ld		(hl), 71h ; 'q'
		ld		hl, 970Eh
		inc		(hl)

p05loc_4A8C:
		; Page05_3435+13Cj
		ld		b, 0

p05loc_4A8E:
		inc		b

p05loc_4A8F:
		ld		a, (unk_96FC)
		cp		b
		jr		z, p05loc_4A8E
		push	bc
		ld		a, b
		call	p05sub_5199
		dec		hl
		ld		de, 847Eh
		ld		b, 5
		call	j_CmpSyms
		push	bc
		pop		de
		pop		bc
		ld		a, 5
		cp		e
		jr		z, p05loc_4ABC
		inc		b
		ld		a, (unk_970E)
		cp		b
		jr		nc, p05loc_4A8F
		rst		10h
		ld		hl, 0
		call	c, CreateRList
		jp		p05sub_4B30
; ---------------------------------------------------------------------------

p05loc_4ABC:
		call	p05sub_4AE3
		jr		p05sub_4B30
; End of function Page05_3435

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

Page05_321F:
		call	p05sub_4861
		ld		b, 1

p05loc_4AC6:
		push	bc
		ld		a, b
		call	p05sub_5199
		dec		hl
		ld		de, 847Eh
		ld		b, 5
		call	j_CmpSyms
		push	bc
		pop		de
		pop		bc
		ld		a, 5
		cp		e
		jr		z, p05sub_4AE3
		inc		b
		ld		a, (unk_970E)
		cp		b
		jr		nc, p05loc_4AC6

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


p05sub_4AE3:

		ld		hl, 96FCh
		ld		a, b
		cp		(hl)
		jr		nc, p05loc_4B07
		dec		(hl)
		ld		a, (unk_9710)
		or		0
		jr		nz, p05loc_4AFF
		ld		a, (unk_970F)
		or		0
		jr		z, p05loc_4B07
		ld		hl, 970Fh
		dec		(hl)
		jr		p05loc_4B07
; ---------------------------------------------------------------------------

p05loc_4AFF:
		ld		hl, 970Ah
		dec		(hl)
		ld		hl, 9710h
		dec		(hl)

p05loc_4B07:
		ld		hl, (unk_96FC)
		push	hl
		ld		a, b
		ld		(unk_96FC), a
		call	p05sub_4D70
		pop		hl
		ld		(unk_96FC), hl
		ret
; End of function p05sub_4AE3


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


p05sub_4B17:
		call	p05sub_5463
		jr		z, p05sub_4B30
		ld		(matrixDimensions), a
		cp		14h
		jr		z, p05sub_4B30
		ld		a, (unk_96FC)
		dec		a
		call	p05sub_5199
		ld		(hl), 71h ; 'q'
		ld		hl, 970Eh
		inc		(hl)
; End of function p05sub_4B17


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


p05sub_4B30:
		; Page05_3435+17Ej ...
		set		curLock, (iy+curFlags)
		call	CanAlphIns

p05loc_4B37:
		ld		hl, p05_loc_4BF6
		ld		(mcxMain), hl
		ld		hl, p05_loc_5893
		ld		(mcxPutAway), hl
		jp		p05loc_4FF8
; End of function p05sub_4B30

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4B4A

p05loc_4B46:
		; p05sub_4B4A+21Bj ...
		cp		9
		jr		nz, p05loc_4B8F
; END OF FUNCTION CHUNK	FOR p05sub_4B4A

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


p05sub_4B4A:





		call	j_DispHead
		ld		hl, (editBtm)
		ld		de, (editTail)
		call	CpHLDE
		jr		z, p05loc_4B6A
		call	j_EraseEOL
		call	j_BufClear
		ld		hl, nameBuff
		call	ZeroOP
		res		textInsMode, (iy+textFlags)
		ret
; ---------------------------------------------------------------------------

p05loc_4B6A:
		call	p05sub_4932
		ret		z
		cp		56h ; 'V'
		ret		z
		call	p05sub_5463
		call	z, p05sub_4D56
		jr		z, p05loc_4B37
		ld		hl, p05_loc_4BF6
		ld		(mcxMain), hl
		ld		hl, p05_loc_5893
		ld		(mcxPutAway), hl
		set		curLock, (iy+curFlags)
		call	CanAlphIns
		jp		p05loc_4CB9
; ---------------------------------------------------------------------------

p05loc_4B8F:
		cp		8
		jp		z, Page05_3435
		cp		4
		jp		z, Page05_3435
		cp		7
		jr		z, p05loc_4BA1
		cp		3
		jr		nz, p05loc_4BB6

p05loc_4BA1:
		call	p05sub_4932
		jr		z, p05loc_4BAA
		cp		56h ; 'V'
		jr		nz, p05loc_4BB5

p05loc_4BAA:
		ld		a, (unk_92C5)
		set		2, a
		ld		(unk_92C5), a
		jp		Page05_3435
; ---------------------------------------------------------------------------

p05loc_4BB5:
		ld		a, b

p05loc_4BB6:
		cp		27h ; '''
		jp		z, p05loc_4D38
		bit		6, (iy+5)
		jr		z, p05loc_4BE3
		cp		1
		jr		z, p05loc_4BDF
		cp		2
		jr		z, p05loc_4BDF
		cp		0Ah
		jr		c, p05loc_4BD1
		cp		10h
		jr		c, p05loc_4BDF

p05loc_4BD1:
		cp		56h ; 'V'
		jr		z, p05loc_4BE3
		call	IsEditEmpty
		jr		z, p05loc_4BDF
		push	af
		call	p05sub_4B4A
		pop		af

p05loc_4BDF:
		res		6, (iy+5)

p05loc_4BE3:
		jp		j_jpromptcursor

p05loc_4BE6:
		call	j_rstrShadow2
		call	j_SetMenuFlags
		call	j_BufToTop
		call	Page0Call_37A7
		call	j_fdispEOL
		ret
p05_loc_4BF6:
		cp		5
		jr		nz, p05loc_4C30
		call	p05sub_5221
		jr		z, p05loc_4C04
		ld		a, 5
		jp		p05loc_4C98
; ---------------------------------------------------------------------------

p05loc_4C04:
		; p05sub_4B4A+152j ...
		call	p05sub_54BB
		call	j_EraseEOL
		call	p05sub_551B
		res		curLock, (iy+curFlags)
		ld		hl, Page05_342F
		ld		(mcxMain), hl
		ld		hl, p05loc_5868
		ld		(mcxPutAway), hl
		ld		hl, p05loc_4BE6
		ld		(mcxErrorEP), hl
		call	j_CATALOGCHK
		ld		hl, 84CCh
		ld		(editBtm), hl
		ld		(editTail), hl
		ret
; ---------------------------------------------------------------------------

p05loc_4C30:
		cp		0Fh
		jr		z, p05loc_4C38
		cp		1
		jr		nz, p05loc_4C62

p05loc_4C38:
		call	j_QUAD
		ld		a, (unk_96FC)
		cp		14h
		jr		z, p05loc_4C47
		call	p05sub_5221
		jr		nz, p05loc_4C52

p05loc_4C47:
		ld		a, 1
		ld		(unk_96FC), a
		ld		(unk_970A), a
		jp		p05loc_4FF5
; ---------------------------------------------------------------------------

p05loc_4C52:
		ld		a, (unk_96FC)
		ld		hl, matrixDimensions
		cp		(hl)
		jp		nz, p05loc_4F76
		call	page0_3B8
		jp		p05loc_4F79
; ---------------------------------------------------------------------------

p05loc_4C62:
		cp		0Eh
		jr		z, p05loc_4C6A
		cp		2
		jr		nz, p05loc_4C8B

p05loc_4C6A:
		call	j_QUAD
		ld		a, (unk_96FC)
		cp		1
		jp		nz, p05loc_4FCC
		ld		a, (matrixDimensions)
		sub		3
		jp		c, Page05_3219
		ret		c
		add		a, 3
		ld		(unk_96FC), a
		ld		a, 3
		ld		(unk_970A), a
		jp		p05loc_4FF5
; ---------------------------------------------------------------------------

p05loc_4C8B:
		cp		8
		jr		z, p05loc_4C98
		cp		4
		jr		nz, p05loc_4CA9

p05loc_4C93:
		bit		0, (iy+1Dh)
		ret		nz

p05loc_4C98:
		; p05sub_4B4A+143j
		ld		b, a
		call	p05sub_5221
		jp		z, p05loc_4C04
		ld		a, b
		ld		hl, p05sub_4DDF
		ld		(mcxMain), hl
		jp		p05sub_4DDF
; ---------------------------------------------------------------------------

p05loc_4CA9:
		cp		3
		jr		z, p05loc_4C93
		cp		7
		ret		z
		cp		0Ah
		jp		nz, p05loc_4CC5
		call	p05sub_5221
		ret		z

p05loc_4CB9:
		call	p05sub_4D70
		call	p05sub_5221
		call	z, p05sub_4D56
		jp		p05loc_4FF8
; End of function p05sub_4B4A

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4B4A

p05loc_4CC5:
		cp		0Bh
		jr		nz, p05loc_4D29
		push	af
		call	p05sub_5221
		jr		z, p05loc_4D30
		pop		af
		call	p05sub_5468
		ret		z
		ld		a, (unk_970E)
		cp		14h
		jr		z, p05loc_4CDC
		inc		a

p05loc_4CDC:
		ld		hl, 96FCh
		sub		(hl)
		or		a
		jr		z, p05loc_4CFB
		ld		hl, 0
		call	p05sub_519C
		ld		a, l
		ld		b, 0
		ld		c, a
		ld		a, (unk_970E)
		cp		14h
		jr		z, p05loc_4CF5
		inc		a

p05loc_4CF5:
		call	p05sub_5199
		dec		hl
		jr		p05loc_4CFF
; ---------------------------------------------------------------------------

p05loc_4CFB:
		inc		hl
		inc		hl
		inc		hl
		inc		hl

p05loc_4CFF:
		push	hl
		ex		de, hl
		pop		hl
		dec		hl
		dec		hl
		dec		hl
		dec		hl
		dec		hl
		lddr
		ld		a, (unk_970E)
		cp		14h
		jr		nz, p05loc_4D23
		ld		a, (unk_96FC)
		dec		a
		call	p05sub_5199
		ld		(hl), 71h ; 'q'
		ld		hl, matrixDimensions
		inc		(hl)
		call	p05sub_4B30
		jp		p05loc_4C04
; ---------------------------------------------------------------------------

p05loc_4D23:
		call	p05sub_4B17
		jp		p05loc_4C04
; ---------------------------------------------------------------------------

p05loc_4D29:
		push	af
		call	p05sub_5221
		jp		nz, p05loc_50C2

p05loc_4D30:
		pop		af
		cp		9
		ret		z
		cp		27h ; '''
		jr		nz, p05loc_4D41

p05loc_4D38:
		call	p05sub_47FA
		call	p05sub_5221
		ret		nz
		jr		p05sub_4D56
; ---------------------------------------------------------------------------

p05loc_4D41:
		push	af
		call	p05loc_4C04
		pop		af
		cp		43h ; 'C'
		jr		nz, p05loc_4D5E
		ld		hl, p05_loc_4BF6
		ld		(mcxMain), hl
		ld		hl, p05_loc_5893
		ld		(mcxPutAway), hl
; END OF FUNCTION CHUNK	FOR p05sub_4B4A

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


p05sub_4D56:
		; p05sub_4B4A+175p ...
		call	page0_3B8
		set		curLock, (iy+curFlags)
		ret
; End of function p05sub_4D56

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4B4A

p05loc_4D5E:
		cp		9Ah ; '�'
		call	c, CanAlphIns
		cp		0B4h ; '�'
		jp		c, p05loc_4B46
		cp		0CCh ; '�'
		call	nz, CanAlphIns
		jp		p05loc_4B46
; END OF FUNCTION CHUNK	FOR p05sub_4B4A

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


p05sub_4D70:
		; p05sub_4B4A:p05loc_4CB9p ...
		ld		a, (unk_970E)
		ld		hl, 96FCh
		sub		(hl)
		ret		c
		or		a
		jr		z, p05loc_4DA0
		ld		hl, 0
		call	p05sub_519C
		ld		a, l
		ld		b, 0
		ld		c, a
		ld		a, (unk_96FC)
		dec		a
		call	p05sub_5199
		ex		de, hl
		ld		a, (unk_96FC)
		call	p05sub_5199
		ldir
		ld		a, (matrixDimensions)
		cp		14h
		jr		z, p05loc_4DA0
		ld		hl, 970Eh
		dec		(hl)

p05loc_4DA0:
		ld		hl, matrixDimensions
		dec		(hl)
		ld		a, (hl)
		call	p05sub_5199
		ld		(hl), 71h ; 'q'
		ret
; End of function p05sub_4D70

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_4DAB:
		ld		hl, p05loc_5922
		ld		(mcxMain), hl
		ld		hl, p05loc_584C
		ld		(mcxPutAway), hl
		ld		hl, Page0Call_37FB
		ld		(mcxErrorEP), hl
		push	af
		call	j_RecallEd
		pop		af
		ld		h, a
		ld		l, 3Fh ; '?'
		call	page0_1671
		rst		10h
		ld		a, 4
		call	j_rclVarToEditPtR
		call	j_dispVarVal
		bit		4, (iy+19h)
		ret		z
		set		5, (iy+5)
		res		4, (iy+19h)
		ret
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


p05sub_4DDF:
		; p05sub_4DDF-58Bp ...











		cp		5
		jr		nz, p05loc_4E28
		res		curLock, (iy+curFlags)
		ld		a, 7
		ld		(curRow), a
		call	p05sub_55AC
		jr		nz, p05sub_4E03
		call	p05sub_552C
		call	Page0Call_241E
		jp		c, p05sub_58EE
		call	GET_FORM_NUM
		or		a
		jp		z, p05sub_58EE
		jr		p05loc_4DAB
; End of function p05sub_4DDF


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


p05sub_4E03:
		; p05sub_4DDF+305p
		ld		hl, p05loc_5116
		ld		(mcxMain), hl
		ld		hl, p05loc_5874
		ld		(mcxPutAway), hl
		ld		hl, Page0Call_37FB
		ld		(mcxErrorEP), hl
		call	j_RecallEd
		call	p05sub_5470
		jr		c, p05loc_4E24
		call	p05sub_5649
		call	Page0Call_3735
		ret
; ---------------------------------------------------------------------------

p05loc_4E24:
		call	Page0Call_3741
		ret
; End of function p05sub_4E03

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_4E28:
		cp		3
		jp		nz, p05loc_4EAE

p05loc_4E2D:
		call	p05sub_55AC
		jr		z, p05loc_4E54
		call	p05sub_516D
		ld		hl, (unk_96FE)
		dec		hl
		ld		(unk_96FE), hl
		call	p05sub_55AC
		jr		nz, p05loc_4E4E
		ld		hl, 970Bh
		dec		(hl)
		ld		hl, p05_loc_4BF6
		ld		(mcxMain), hl
		jp		p05loc_5008
; ---------------------------------------------------------------------------

p05loc_4E4E:
		call	p05sub_4E97

p05loc_4E51:
		jp		p05loc_5008
; ---------------------------------------------------------------------------

p05loc_4E54:
		bit		0, (iy+1Dh)
		ret		nz
		ld		hl, (unk_9704)
		ld		de, 0FFF9h
		bit		grfSplit, (iy+sGrFlags)
		jr		z, p05loc_4E68
		ld		de, 0FFFEh

p05loc_4E68:
		add		hl, de
		jr		c, p05loc_4E7B
		call	p05sub_516D
		ld		hl, (unk_9704)
		inc		hl
		ld		(unk_96FE), hl
		ld		a, l
		ld		(unk_970A+1), a
		jr		p05loc_4E51
; ---------------------------------------------------------------------------

p05loc_4E7B:
		ld		hl, (unk_9704)
		call	p05sub_5B17
		jr		nc, p05loc_4E84
		inc		hl

p05loc_4E84:
		ld		(unk_96FE), hl
		ld		a, 7
		bit		grfSplit, (iy+sGrFlags)
		jr		z, p05loc_4E91
		ld		a, 2

p05loc_4E91:
		ld		(unk_970A+1), a
		jp		p05loc_4FF5
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


p05sub_4E97:
		; p05sub_4DDF+151p
		ld		hl, 970Bh
		sub		a
		push	af
		dec		(hl)
		ld		a, (hl)
		or		a
		jr		z, p05loc_4EA5
		pop		af
		ret		nc
		jr		p05loc_4EA6
; ---------------------------------------------------------------------------

p05loc_4EA5:
		pop		af

p05loc_4EA6:
		inc		(hl)
		call	j_TblScreenDn
		call	p05sub_53CE
		ret
; End of function p05sub_4E97

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_4EAE:
		cp		4
		jr		nz, p05loc_4F11
		call	p05sub_5470
		jr		c, p05loc_4ED7

p05loc_4EB7:
		call	p05sub_5B14
		jr		nc, p05loc_4EFE

p05loc_4EBC:
		call	p05sub_516D
		ld		hl, (unk_96FE)
		inc		hl
		ld		(unk_96FE), hl
		call	p05sub_6896
		jr		nc, p05loc_4ECE
		inc		(hl)
		jr		p05loc_4ED4
; ---------------------------------------------------------------------------

p05loc_4ECE:
		call	j_TblScreenUp
		call	p05sub_53CE

p05loc_4ED4:
		; p05sub_4DDF+11Dj
		jp		p05loc_5008
; ---------------------------------------------------------------------------

p05loc_4ED7:
		bit		0, (iy+1Dh)
		ret		nz
		ld		hl, (unk_96FE)
		ld		de, 0FFF8h
		bit		grfSplit, (iy+sGrFlags)
		jr		z, p05loc_4EEB
		ld		de, 0FFFDh

p05loc_4EEB:
		add		hl, de
		jr		c, p05loc_4EFE
		call	p05sub_516D
		ld		hl, 1
		ld		(unk_96FE), hl
		ld		a, 1
		ld		(unk_970A+1), a
		jr		p05loc_4ED4
; ---------------------------------------------------------------------------

p05loc_4EFE:
		; p05sub_4DDF+10Dj
		bit		0, (iy+1Dh)
		ret		nz
		ld		hl, 1
		ld		(unk_96FE), hl
		ld		a, 1
		ld		(unk_970A+1), a
		jp		p05loc_4FF5
; ---------------------------------------------------------------------------

p05loc_4F11:
		cp		7
		jr		nz, p05loc_4F39
		call	p05sub_516D
		ld		b, 6

p05loc_4F1A:
		ld		hl, (unk_96FE)
		ld		de, 1
		call	CpHLDE
		jr		z, p05loc_4F36
		ld		hl, (unk_96FE)
		dec		hl
		ld		(unk_96FE), hl
		push	bc
		call	p05sub_55AC
		call	nz, p05sub_4E97
		pop		bc
		djnz	p05loc_4F1A

p05loc_4F36:
		jp		p05loc_5008
; ---------------------------------------------------------------------------

p05loc_4F39:
		cp		8
		jr		nz, p05loc_4F6A
		call	p05sub_516D
		ld		b, 6

p05loc_4F42:
		call	p05sub_5470
		jp		c, p05loc_5008
		call	p05sub_5B14
		jp		z, p05loc_5008
		ld		hl, (unk_96FE)
		inc		hl
		ld		(unk_96FE), hl
		call	p05sub_6896
		jr		nc, p05loc_4F5D
		inc		(hl)
		jr		p05loc_4F65
; ---------------------------------------------------------------------------

p05loc_4F5D:
		push	bc
		call	j_TblScreenUp
		call	p05sub_53CE
		pop		bc

p05loc_4F65:
		djnz	p05loc_4F42
		jp		p05loc_5008
; ---------------------------------------------------------------------------

p05loc_4F6A:
		cp		0Fh
		jr		z, p05loc_4F72
		cp		1
		jr		nz, p05loc_4FC4

p05loc_4F72:
		call	p05sub_549F
		ret		nc

p05loc_4F76:
		call	j_QUAD

p05loc_4F79:
		call	p05sub_50F5
		ld		hl, 96FCh
		inc		(hl)
		call	p05sub_4F98
		push	af
		ld		hl, 970Ah
		ld		a, (hl)
		cp		3
		jr		c, p05loc_4F8F
		pop		af
		jr		p05loc_4FF5
; ---------------------------------------------------------------------------

p05loc_4F8F:
		inc		(hl)
		call	p05sub_500F
		pop		af
		jr		c, p05loc_4FF5
		jr		p05loc_5008
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


p05sub_4F98:
		; p05sub_4DDF+1FDp
		call	p05sub_54A7
		call	p05sub_5488
		ret		nc
		ld		hl, (unk_9704)
		inc		hl
		push	hl
		ld		hl, (unk_96FE)
		ld		a, (unk_970A+1)
		ld		e, a
		ld		d, 0
		or		a
		sbc		hl, de
		ex		de, hl
		pop		hl
		ld		(unk_96FE), hl
		or		a
		sbc		hl, de
		ld		a, l
		jr		c, p05loc_4FBD
		jr		nz, p05loc_4FC0

p05loc_4FBD:
		ld		a, 1
		scf

p05loc_4FC0:
		ld		(unk_970A+1), a
		ret
; End of function p05sub_4F98

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_4FC4:
		cp		0Eh
		jr		z, p05loc_4FCC
		cp		2
		jr		nz, p05loc_5021

p05loc_4FCC:
		; p05sub_4DDF+1E7j
		ld		a, (unk_96FC)
		cp		2
		ret		c
		call	j_QUAD
		call	p05sub_50EB
		ld		hl, 96FCh
		dec		(hl)
		call	p05sub_4F98
		ld		hl, 970Ah
		push	af
		dec		(hl)
		call	p05sub_500F
		ld		hl, 970Ah
		ld		a, (hl)
		or		a
		jr		z, p05loc_4FF3
		pop		af
		jr		nc, p05loc_5008
		jr		p05loc_4FF5
; ---------------------------------------------------------------------------

p05loc_4FF3:
		pop		af
		inc		(hl)

p05loc_4FF5:
		; p05sub_4B4A+13Ej ...
		call	p05sub_500F

p05loc_4FF8:
		; p05sub_4B4A+178j
		call	p05sub_5AEE
		call	p05sub_488C
		call	p05sub_56EA
		bit		4, (iy+19h)
		jp		nz, p05loc_484D

p05loc_5008:
		; p05sub_4DDF:p05loc_4E51j ...
		call	Page05_3225
		call	p05sub_48B6
		ret
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


p05sub_500F:
		; p05sub_4DDF+205p ...
		ld		a, (unk_970A)
		dec		a
		ld		(unk_9710), a
		ld		a, (unk_96FC)
		ld		hl, 970Ah
		sub		(hl)
		ld		(unk_970F), a
		ret
; End of function p05sub_500F

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_5021:
		cp		0Ah
		jr		nz, p05loc_5059
		call	p05sub_5A32
		ret		nz
		call	p05sub_55AC
		ret		z
		call	p05sub_5470
		jp		c, p05loc_55A4
		call	p05sub_552C
		call	Page0Call_241E
		jr		c, p05loc_5056
		call	page0_16FA
		call	page0_17E9
		rst		10h
		push	hl
		call	Page05_3249
		pop		hl
		jr		z, p05loc_5056
		ld		bc, (unk_96FE)
		ld		hl, 1
		ld		a, (OP1)
		call	j_dellistel

p05loc_5056:
		; p05sub_4DDF+268j
		jp		p05loc_4FF5
; ---------------------------------------------------------------------------

p05loc_5059:
		cp		0Bh
		jp		nz, p05loc_50AB
		call	p05sub_5A32
		ret		nz
		call	p05sub_55AC
		ret		z
		ld		hl, (unk_9704)
		call	p05sub_5B17
		ret		nc
		ld		hl, 615h
		call	pushErrorHandleR
		call	p05sub_552C
		call	Page0Call_241E
		jr		nc, p05loc_5088
		ld		hl, 1
		call	CreateRList
		inc		de
		inc		de
		call	OPSet0DE
		jr		p05loc_5097
; ---------------------------------------------------------------------------

p05loc_5088:
		call	page0_16FA
		ld		bc, (unk_96FE)
		dec		bc
		ld		hl, 1
		or		a
		call	j_InsertList

p05loc_5097:
		call	p05sub_552C
		call	Page0Call_241E
		jr		c, p05loc_50A5
		call	page0_16FA
		call	page0_17E9

p05loc_50A5:
		call	popErrorHandleR
		jp		p05loc_4FF5
; ---------------------------------------------------------------------------

p05loc_50AB:
		cp		0Ch
		ret		z
		cp		8Ah ; '�'
		ret		z
		cp		27h ; '''
		jp		z, p05loc_47FF
		cp		9
		jr		z, p05loc_50C1
		cp		0Dh
		jr		z, p05loc_50C1
		cp		5Ah ; 'Z'
		ret		c

p05loc_50C1:
		; p05sub_4DDF+2DDj
		push	af

p05loc_50C2:
		call	p05sub_552C
		call	Page0Call_241E
		call	GET_FORM_NUM
		or		a
		jr		z, p05loc_50D5
		pop		af
		cp		27h ; '''
		ret		nz
		jp		p05loc_47FF
; ---------------------------------------------------------------------------

p05loc_50D5:
		res		curLock, (iy+curFlags)
		ld		a, 7
		ld		(curRow), a
		call	p05sub_55AC
		jp		z, p05loc_591E
		call	p05sub_4E03
		pop		af
		jp		p05loc_5116
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


p05sub_50EB:
		ld		hl, 970Ah
		ld		a, (hl)
		cp		2
		call	nc, p05sub_516D
		ret
; End of function p05sub_50EB


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


p05sub_50F5:
		ld		hl, 970Ah
		ld		a, (hl)
		cp		3
		call	c, p05sub_516D
		ret
; End of function p05sub_50F5


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


p05sub_50FF:
		; p05sub_4DDF:p05loc_514Fp
		call	p05sub_552C
		call	Page0Call_241E
		push	af
		call	p05sub_5691
		call	p05sub_552C
		rst		10h
		pop		af
		ld		hl, OP1
		cp		(hl)
		call	nz, p05sub_488C
		ret
; End of function p05sub_50FF

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_5116:
		cp		5
		jr		z, p05loc_511E
		cp		4
		jr		nz, p05loc_5141

p05loc_511E:
		call	IsEditEmpty
		jr		nz, p05loc_512E
		call	closeEditBuf
		call	p05sub_5B14
		call	z, p05sub_55B6
		jr		p05loc_5131
; ---------------------------------------------------------------------------

p05loc_512E:
		call	p05sub_50FF

p05loc_5131:
		call	p05sub_487A
		call	p05sub_5B14
		jp		z, Page05_3225
		call	p05sub_5470
		ret		c
		jp		p05loc_4EB7
; ---------------------------------------------------------------------------

p05loc_5141:
		cp		3
		jr		nz, p05loc_5158
		call	IsEditEmpty
		jr		nz, p05loc_514F
		call	closeEditBuf
		jr		p05loc_5152
; ---------------------------------------------------------------------------

p05loc_514F:
		call	p05sub_50FF

p05loc_5152:
		call	p05sub_487A
		jp		p05loc_4E2D
; ---------------------------------------------------------------------------

p05loc_5158:
		bit		enableQueue, (iy+rclFlag)
		jr		nz, p05loc_5161
		cp		8Ah ; '�'
		ret		z

p05loc_5161:
		cp		27h ; '''
		jp		nz, j_CallCommon
		jp		p05loc_47FF
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


Page05_3225:
		; p05sub_4DDF:p05loc_5008p ...
		set		textInverse, (iy+textFlags)
; End of function Page05_3225


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


p05sub_516D:
		call	p05sub_5470
		jr		c, p05loc_5185
		ld		de, 0
		ld		hl, (unk_96FE)
		call	CpHLDE
		jr		z, p05loc_518A
		call	p05sub_5427

p05loc_5180:
		res		textInverse, (iy+textFlags)
		ret
; ---------------------------------------------------------------------------

p05loc_5185:
		call	p05sub_53C0
		jr		p05loc_5180
; ---------------------------------------------------------------------------

p05loc_518A:
		call	p05sub_51C7
		ld		a, (unk_9710)
		ld		b, a
		call	j_DisplstName
		res		textInverse, (iy+textFlags)
		ret
; End of function p05sub_516D


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


p05sub_5199:
		; Page05_3435+142p ...
		ld		hl, listName1
; End of function p05sub_5199


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


p05sub_519C:
		push	de
		ld		e, a
		ld		d, 0
		add		hl, de
		add		hl, de
		add		hl, de
		add		hl, de
		add		hl, de
		pop		de
		ret
; End of function p05sub_519C


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


p05sub_51A7:
		ld		a, (curRow)
		add		a, a
		add		a, a
		add		a, a
		ld		(penCol+1), a
		ret
; End of function p05sub_51A7


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


p05sub_51B1:
		ld		a, 6
		call	j_VPutMap
		ld		a, (penCol)
		sub		4
		ld		hl, curCol
		ld		(hl), 1

p05loc_51C0:
		sub		6
		ret		z
		ret		c
		inc		(hl)
		jr		p05loc_51C0
; End of function p05sub_51B1


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


p05sub_51C7:
		; Page05_322B+1Cp
		ld		a, 1
		ld		h, a
		xor		a
		bit		grfSplit, (iy+sGrFlags)
		jr		z, p05loc_51D3
		ld		a, 4

p05loc_51D3:
		ld		l, a
		ld		(curRow), hl
		jr		p05sub_51A7
; End of function p05sub_51C7


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


Page05_322B:
		ld		hl, nameBuff
		ld		de, OP2
		call	page0_118B
		ld		hl, 0
		xor		a
		bit		grfSplit, (iy+sGrFlags)
		jr		z, p05loc_51EE
		ld		a, 4

p05loc_51EE:
		ld		l, a
		ld		(curRow), hl
		call	j_EraseEOL
		call	p05sub_51C7
		ld		b, 0

p05loc_51FA:
		call	j_DisplstName
		inc		b
		ld		a, b
		cp		3
		jr		nz, p05loc_51FA
		ld		de, nameBuff
		ld		hl, OP2
		call	page0_118B
		ret
; End of function Page05_322B


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


Page05_3231:
		bit		textInverse, (iy+textFlags)
		jr		nz, p05loc_5217
		set		preClrForMode, (iy+newDispF)

p05loc_5217:
		ld		a, 4Ch ; 'L'
		call	j_VPutMap
		ld		a, b
		call	j_VPutMap
		ret
; End of function Page05_3231


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


p05sub_5221:
		ld		a, (unk_9710)
; End of function p05sub_5221


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


p05sub_5224:
		ld		hl, 970Fh
		add		a, (hl)
		call	p05sub_5199
		ld		a, (hl)
		cp		71h ; 'q'
		ret
; End of function p05sub_5224


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


p05sub_522F:
		call	p05sub_5A32
		ret		z
		ld		hl, (pTempCnt)
		push	hl
		ld		hl, p05loc_5250
		call	pushErrorHandleR
		call	p05sub_552C
		rst		10h
		call	j_InitPFlgs
		call	j_PARSE_FORMULA
		call	popErrorHandleR
		pop		hl
		ld		(pTempCnt), hl
		or		a
		ret
; End of function p05sub_522F

p05loc_5250:
		pop		de
		push	af
		call	j_FixTempCnt
		pop		af
		cp		8Dh ; '�'
		jr		z, p05loc_5282
		cp		0AFh ; '�'
		jr		z, p05loc_5282
		ld		a, (unk_9301)
		or		a
		jr		nz, p05loc_5282
		ld		a, (unk_970A)
		inc		a
		ld		(unk_9301), a

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


p05sub_526B:



		set		4, (iy+19h)
		ld		hl, (unk_96FC)
		ld		(unk_92FD), hl
		ld		hl, (unk_970A)
		ld		a, l
		ld		(unk_9710), a
		inc		l
		ld		h, 1
		ld		(unk_92FF), hl

p05loc_5282:
		jp		p05loc_5A68
; End of function p05sub_526B


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


dsplsts:
		call	p05sub_5A76
		res		4, (iy+19h)
		ld		hl, (matrixDimensions)
		push	hl
		ld		hl, (unk_9704)
		push	hl
		ld		de, (unk_970A)
		push	de
		ld		hl, (unk_96FC)
		push	hl
		ld		hl, (unk_96FE)
		push	hl
		inc		hl
		ld		de, (unk_970A+1)
		ld		d, 0
		sbc		hl, de
		ld		(unk_96FE), hl
		push	hl
		ld		a, (unk_96FC)
		inc		a
		ld		hl, 970Ah
		sub		(hl)
		push	af
		ld		(unk_96FC), a
		sub		a
		ld		(unk_970A), a
		bit		editOpen, (iy+editFlags)
		jr		nz, p05loc_52DD
		ld		a, (unk_9301)
		cp		1
		jr		nz, p05loc_52D0
		call	p05sub_526B
		jr		p05loc_52DD
; ---------------------------------------------------------------------------

p05loc_52D0:
		bit		5, (iy+27h)
		jr		z, p05loc_52DD
		res		5, (iy+27h)
		call	p05sub_522F

p05loc_52DD:
		sub		a
		call	p05sub_5224
		push	af
		call	nz, p05sub_538B
		pop		af
		jr		nz, p05loc_52ED
		ld		a, 1
		ld		(unk_970A), a

p05loc_52ED:
		pop		af
		pop		hl
		push	hl
		ld		(unk_96FE), hl
		inc		a
		ld		(unk_96FC), a
		push	af
		bit		editOpen, (iy+editFlags)
		jr		nz, p05loc_5317
		ld		a, (unk_9301)
		cp		2
		jr		nz, p05loc_530A
		call	p05sub_526B
		jr		p05loc_5317
; ---------------------------------------------------------------------------

p05loc_530A:
		bit		6, (iy+27h)
		jr		z, p05loc_5317
		res		6, (iy+27h)
		call	p05sub_522F

p05loc_5317:
		ld		a, 1
		call	p05sub_5224
		push	af
		call	nz, p05sub_5385
		pop		af
		jr		nz, p05loc_5327
		ld		hl, 970Ah
		inc		(hl)

p05loc_5327:
		pop		af
		inc		a
		ld		(unk_96FC), a
		pop		hl
		ld		(unk_96FE), hl
		bit		editOpen, (iy+editFlags)
		jr		nz, p05loc_534F
		ld		a, (unk_9301)
		cp		3
		jr		nz, p05loc_5342
		call	p05sub_526B
		jr		p05loc_534F
; ---------------------------------------------------------------------------

p05loc_5342:
		bit		7, (iy+27h)
		jr		z, p05loc_534F
		res		7, (iy+27h)
		call	p05sub_522F

p05loc_534F:
		ld		a, 2
		call	p05sub_5224
		call	nz, p05sub_5385

p05loc_5357:
		pop		hl
		ld		(unk_96FE), hl
		pop		hl
		bit		4, (iy+19h)
		jr		z, p05loc_5375
		ld		de, (unk_92FD)
		call	CpHLDE
		jr		z, p05loc_5375
		ex		de, hl
		ld		(unk_96FC), hl
		pop		hl
		ld		hl, (unk_92FF)
		jr		p05loc_5379
; ---------------------------------------------------------------------------

p05loc_5375:
		ld		(unk_96FC), hl
		pop		hl

p05loc_5379:
		ld		(unk_970A), hl
		pop		hl
		ld		(unk_9704), hl
		pop		hl
		ld		(matrixDimensions), hl
		ret
; End of function dsplsts


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


p05sub_5385:
		ld		a, (unk_970A)
		inc		a
		jr		p05loc_538D
; End of function p05sub_5385


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


p05sub_538B:
		ld		a, 1

p05loc_538D:
		ld		(unk_970A), a
		ld		a, 1
		ld		(unk_970A+1), a
		call	p05sub_54A7

p05loc_5398:
		call	p05sub_5470
		jr		nc, p05loc_53AA
		ld		hl, (unk_9704)
		inc		hl
		ld		(unk_9704), hl
		call	p05sub_5470
		jr		z, p05sub_53C0
		ret
; ---------------------------------------------------------------------------

p05loc_53AA:
		call	p05sub_5430
		ld		hl, 970Bh
		inc		(hl)
		call	p05sub_6896
		jr		z, p05loc_53B7
		ret		nc

p05loc_53B7:
		ld		hl, (unk_96FE)
		inc		hl
		ld		(unk_96FE), hl
		jr		p05loc_5398
; End of function p05sub_538B


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


p05sub_53C0:
		; p05sub_538B+1Cj
		call	p05sub_42F9
		ld		hl, a______
		res		textEraseBelow, (iy+textFlags)
		call	j_VPutS
		ret
; End of function p05sub_53C0


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


p05sub_53CE:
		ld		hl, (matrixDimensions)
		push	hl
		ld		hl, (unk_9704)
		push	hl
		ld		de, (unk_970A)
		push	de
		ld		hl, (unk_96FC)
		push	hl
		ld		hl, (unk_96FE)
		push	hl
		ld		a, (unk_96FC)
		inc		a
		sub		e
		push	af
		ld		(unk_96FC), a
		call	p05sub_5409
		pop		af
		inc		a
		ld		(unk_96FC), a
		push	af
		call	p05sub_5403
		pop		af
		inc		a
		ld		(unk_96FC), a
		call	p05sub_5403
		jp		p05loc_5357
; End of function p05sub_53CE


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


p05sub_5403:
		ld		a, (unk_970A)
		inc		a
		jr		p05loc_540B
; End of function p05sub_5403


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


p05sub_5409:
		ld		a, 1

p05loc_540B:
		ld		(unk_970A), a
		call	p05sub_54A7
		inc		hl
		inc		hl
		ld		de, (unk_96FE)
		call	CpHLDE
		ret		c
		jr		z, p05loc_5421
		call	p05sub_516D
		ret
; ---------------------------------------------------------------------------

p05loc_5421:
		call	p05sub_42F9
		jp		p05sub_6B86
; End of function p05sub_5409


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


p05sub_5427:



		call	p05sub_42F9
		call	p05sub_5649
		jp		p05loc_472F
; End of function p05sub_5427


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


p05sub_5430:
		call	p05sub_42F9
		call	p05sub_5649
		call	p05sub_67F0
		jp		p05sub_6B86
; End of function p05sub_5430


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


p05sub_543C:
		ld		b, 0

p05loc_543E:
		; Page05_324F+63p
		ld		c, a
		ld		e, a
		ld		d, 5Eh ; '^'
		call	j_DarkLine
		ret
; End of function p05sub_543C


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


p05sub_5446:
		call	CheckSplitFlag
		ret		z
		sub		20h ; ' '
		ret
; End of function p05sub_5446


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


p05sub_544D:
		; p05sub_5A76:p05loc_5AA2p
		ld		c, 9
		ld		b, a
		ld		d, a
		ld		a, 3Fh ; '?'
		call	p05sub_5446
		ld		e, a
		call	j_DarkLine
		ret
; End of function p05sub_544D

; ---------------------------------------------------------------------------
		ld		a, (matrixDimensions)
; START	OF FUNCTION CHUNK FOR p05sub_5463

p05loc_545E:
		ld		hl, 96FCh
		cp		(hl)
		ret
; END OF FUNCTION CHUNK	FOR p05sub_5463

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


p05sub_5463:
		; p05sub_4B17p ...



		ld		a, (unk_970E)
		jr		p05loc_545E
; End of function p05sub_5463


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


p05sub_5468:
		ld		a, (matrixDimensions)
		ld		hl, 970Eh
		cp		(hl)
		ret
; End of function p05sub_5468


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


p05sub_5470:
		push	de
		ld		hl, (unk_9704)

p05loc_5474:
		ld		de, (unk_96FE)
		call	CpHLDE
		ld		hl, (unk_96FC)
		pop		de
		ret
; End of function p05sub_5470

; ---------------------------------------------------------------------------
		push	de
		ld		hl, (unk_9704)
		inc		hl
		inc		hl
		jr		p05loc_5474

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


p05sub_5488:
		push	de
		ld		hl, (unk_9704)
		inc		hl
		jr		p05loc_5474
; End of function p05sub_5488


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


p05sub_548F:
		push	de
		ld		hl, (unk_96FE)
		ld		de, (unk_9704)
		call	CpHLDE
		ld		hl, (unk_9704)
		pop		de
		ret
; End of function p05sub_548F


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


p05sub_549F:
		ld		a, (unk_96FC)
		ld		hl, matrixDimensions
		cp		(hl)
		ret
; End of function p05sub_549F


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


p05sub_54A7:
		call	p05sub_552C
		call	Page0Call_241E
		ld		hl, 0
		jr		c, p05loc_54B7
		ld		h, d
		ld		l, e
		call	ldHLind

p05loc_54B7:
		ld		(unk_9704), hl
		ret
; End of function p05sub_54A7


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


p05sub_54BB:
		; p05sub_4B4A:p05loc_4C04p ...
		ld		hl, 7
		ld		(curRow), hl
		call	p05sub_51A7
		ld		a, 1
		ld		(penCol), a
		ret
; End of function p05sub_54BB


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


Page05_323D:



		call	p05sub_54BB
		call	p05sub_5221
		jr		z, p05sub_551B
		cp		6
		jr		nc, p05loc_54E0
		add		a, 81h ; '�'
		push	bc
		ld		b, a
		call	Page05_3231
		pop		bc
		jr		p05loc_54F3
; ---------------------------------------------------------------------------

p05loc_54E0:
		ld		de, nameBuff
		push	bc
		ld		bc, 5
		ldir
		pop		bc
		inc		de
		sub		a
		ld		(de), a
		ld		hl, nameBuff
		call	j_VPutS

p05loc_54F3:
		call	p05sub_55AC
		jr		z, p05loc_5508
		ld		a, 28h ; '('
		call	j_VPutMap
		ld		hl, (unk_96FE)
		call	p05loc_5553
		ld		a, 29h ; ')'
		call	j_VPutMap

p05loc_5508:
		call	p05sub_51B1
		jr		p05loc_5548
; End of function Page05_323D


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


p05sub_550D:
		call	p05sub_54BB
		call	j_EraseEOL
		call	Page05_323D
		call	j_EraseEOL

p05loc_5519:
		or		a
		ret
; End of function p05sub_550D


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


p05sub_551B:
		ld		hl, aName
		ld		a, 10h
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	j_PutS
		jr		p05loc_5519
; End of function p05sub_551B


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


p05sub_552C:
		ld		a, (unk_96FC)
		dec		a

Page05_3243:
		call	p05sub_5199

p05loc_5533:
		ex		de, hl
		ld		a, 5Dh ; ']'
		ld		(unk_8479), a
		ld		hl, OP1M
		ex		de, hl
		ld		b, 0
		ld		c, 5
		ldir
		sub		a
		ld		(unk_847F), a
		ret
; End of function p05sub_552C

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR Page05_323D

p05loc_5548:
		ld		a, 3Dh ; '='
; END OF FUNCTION CHUNK	FOR Page05_323D
; START	OF FUNCTION CHUNK FOR p05sub_5581

p05loc_554A:
		call	j_PutC
		ret
; END OF FUNCTION CHUNK	FOR p05sub_5581

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


p05sub_554E:
		; DispListElementOffLA+2p
		ld		l, a
		ld		h, 0
		jr		p05loc_5555
; ---------------------------------------------------------------------------

p05loc_5553:
		ld		b, 80h ; '�'

p05loc_5555:
		ld		de, 3E8h
		call	CpHLDE
		jr		c, p05loc_556F
		call	p05sub_5581
		ld		de, 64h	; 'd'

p05loc_5563:
		call	p05sub_5581
		ld		de, 0Ah

p05loc_5569:
		call	p05sub_5581

p05loc_556C:
		ld		a, l
		jr		p05loc_558A
; ---------------------------------------------------------------------------

p05loc_556F:
		ld		de, 64h	; 'd'
		call	CpHLDE
		jr		nc, p05loc_5563
		ld		de, 0Ah
		call	CpHLDE
		jr		nc, p05loc_5569
		jr		p05loc_556C
; End of function p05sub_554E


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


p05sub_5581:
		; p05sub_554E:p05loc_5563p ...



		sub		a
		jr		p05loc_5585
; ---------------------------------------------------------------------------

p05loc_5584:
		inc		a

p05loc_5585:
		sbc		hl, de
		jr		nc, p05loc_5584
		add		hl, de

p05loc_558A:
		add		a, b
		ld		e, a
		call	Page0Call_31FB
		ld		a, e
		jr		z, p05loc_554A
		ld		a, (mcxCurApp)
		cp		43h ; 'C'
		ld		a, e
		jr		z, p05loc_55A0
		bit		3, (iy+15h)
		jr		z, p05loc_554A

p05loc_55A0:
		call	j_VPutMap
		ret
; End of function p05sub_5581

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_55A4:
		set		5, (iy+5)
		call	j_fDel
		ret
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


p05sub_55AC:
		; p05sub_4DDF:p05loc_4E2Dp ...
		ld		a, (unk_96FE+1)
		or		a
		ret		nz
		ld		a, (unk_96FE)
		or		a
		ret
; End of function p05sub_55AC


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


p05sub_55B6:



		call	Page05_3279
		call	p05sub_55AC
		jr		z, p05loc_55CA
		call	p05sub_565F
		ret		c
; End of function p05sub_55B6

; START	OF FUNCTION CHUNK FOR p05sub_478B

Page05_327F:
		; dispTblBot:p05loc_63C2j	...
		res		1, (iy+0Eh)
		call	j_wputsEOL
		ret
; END OF FUNCTION CHUNK	FOR p05sub_478B
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_55B6

p05loc_55CA:
		call	p05sub_552C
		call	Page0Call_241E
		ret		c
		call	GET_FORM_NUM
		or		a
		jr		z, p05loc_55FB
		ld		h, a
		ld		l, 3Fh ; '?'
		call	page0_1671
		rst		10h
		ret		c
		push	de
		ld		a, 22h ; '"'
		call	j_PutC
		pop		de
		push	de
		pop		hl
		inc		de
		inc		de
		push	de
		ld		e, (hl)
		inc		hl
		ld		d, (hl)
		inc		hl
		add		hl, de
		pop		de
		call	j_DispForward
		ret		nc
		ld		a, 22h ; '"'
		call	j_PutC
		ret
; ---------------------------------------------------------------------------

p05loc_55FB:
		res		1, (iy+0Eh)
		call	Page05_3249
		ret		z
		ld		a, 7Bh ; '{'
		call	j_wputc
		jr		p05loc_5611
; ---------------------------------------------------------------------------

p05loc_560A:
		ld		a, 2Ch ; ','
		call	j_wputc
		jr		c, locret_5635

p05loc_5611:
		push	bc
		rst		20h
		ld		a, (OP1)
		call	page0_1032
		jr		nz, p05loc_561E
		call	Mov9ToOP2

p05loc_561E:
		push	hl
		ld		a, 14h
		call	p05loc_4760
		call	j_wputs
		pop		hl
		pop		bc
		jr		c, locret_5635
		dec		bc
		ld		a, c
		or		b
		jr		nz, p05loc_560A
		ld		a, 7Dh ; '}'
		call	j_wputc

locret_5635:
		ret
; END OF FUNCTION CHUNK	FOR p05sub_55B6

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


Page05_3249:
		; p05sub_55B6+49p	...
		ld		h, d
		ld		l, e
		ld		c, (hl)
		inc		hl
		ld		b, (hl)
		inc		hl
		ld		a, b
		or		c
		ret
; End of function Page05_3249


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


Page05_3279:
		call	Page0Call_37AD
		call	Page0Call_37A7
		call	j_setNumWindow
		ret
; End of function Page05_3279


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


p05sub_5649:
		call	p05sub_54A7
		call	p05sub_5470
		ret		c
		call	p05sub_552C
		call	Page0Call_241E
		ret		c
		ld		hl, (unk_96FE)
		call	j_GetLToOP1
		sub		a
		ret
; End of function p05sub_5649


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


p05sub_565F:
		call	p05sub_5649
		ret		c
; End of function p05sub_565F


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


p05sub_5663:
		; dispTblBot+4Fp ...
		ld		a, 14h

p05loc_5665:
		; dispTblBot:p05loc_649Ep
		ld		hl, OP1
		ld		de, fmtConv
		call	mov9B2
		ld		hl, OP1
		ld		b, a
		call	CkOP1Real
		ld		a, b
		jr		nz, p05loc_567F
		call	j_FormEReal
		ld		hl, OP3
		ret
; ---------------------------------------------------------------------------

p05loc_567F:
		call	j_FormDCplx
		ld		hl, fmtString
		or		a
		ret
; End of function p05sub_5663


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


closeEditBuf:
		call	CanAlphIns
		call	j_CloseEditEqu
		call	j_releaseBuffer
		ret
; End of function closeEditBuf


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


p05sub_5691:
		call	IsEditEmpty
		jr		nz, p05loc_5699
		inc		sp
		inc		sp
		ret
; ---------------------------------------------------------------------------

p05loc_5699:
		ld		hl, 615h
		call	pushErrorHandleR
		call	p05sub_56A9
		call	p05sub_55B6
		call	popErrorHandleR
		ret
; End of function p05sub_5691


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


p05sub_56A9:
		call	p05sub_575A
		call	parseEditBuf
		bit		5, (iy+5)
		ret		z
		call	PushOP1
		call	p05sub_552C
		call	OP1ToOP3
		call	popOP1
		ld		hl, 1Eh
		call	ErrNotEnoughMem
		call	p05loc_58DF
		call	nc,	page0_16F4
		call	p05sub_578B
		call	p05sub_552C
		call	Page0Call_241E
		ret		c
		call	page0_17E9
		bit		3, (iy+19h)
		ret		z
		call	p05sub_5AEE
		call	p05sub_56EA
		call	Page05_322B
		jp		dsplsts
; End of function p05sub_56A9


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


p05sub_56EA:
		; p05sub_4DDF+21Fp ...
		ld		hl, (unk_970A)
		push	hl
		ld		a, (unk_96FC)
		push	af
		ld		a, (unk_970F)
		inc		a
		ld		(unk_96FC), a
		ld		hl, 1
		ld		(unk_970A), hl
		ld		a, (unk_9301)
		cp		1
		jr		z, p05loc_5710
		bit		5, (iy+27h)
		jr		z, p05loc_5715
		res		5, (iy+27h)

p05loc_5710:
		call	p05sub_5A11
		jr		c, p05loc_5715

p05loc_5715:
		ld		hl, 96FCh
		inc		(hl)
		ld		hl, 970Ah
		inc		(hl)
		ld		a, (unk_9301)
		cp		2
		jr		z, p05loc_572E
		bit		6, (iy+27h)
		jr		z, p05loc_5733
		res		6, (iy+27h)

p05loc_572E:
		call	p05sub_5A11
		jr		c, p05loc_5733

p05loc_5733:
		ld		hl, 96FCh
		inc		(hl)
		ld		hl, 970Ah
		inc		(hl)
		ld		a, (unk_9301)
		cp		3
		jr		z, p05loc_574C
		bit		7, (iy+27h)
		jr		z, p05loc_5751
		res		7, (iy+27h)

p05loc_574C:
		call	p05sub_5A11
		jr		c, p05loc_5751

p05loc_5751:
		pop		af
		ld		(unk_96FC), a
		pop		hl
		ld		(unk_970A), hl
		ret
; End of function p05sub_56EA


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


p05sub_575A:
		ld		a, (unk_96FC)
		push	af
		ld		a, (unk_970F)
		inc		a
		ld		(unk_96FC), a
		call	p05sub_5A32
		jr		nz, p05loc_5782
		ld		hl, 96FCh
		inc		(hl)
		call	p05sub_5A32
		jr		nz, p05loc_5782
		ld		hl, 96FCh
		inc		(hl)
		call	p05sub_5A32
		jr		nz, p05loc_5782
		res		3, (iy+19h)
		jr		p05loc_5786
; ---------------------------------------------------------------------------

p05loc_5782:
		set		3, (iy+19h)

p05loc_5786:
		pop		af
		ld		(unk_96FC), a
		ret
; End of function p05sub_575A


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


p05sub_578B:
		ld		bc, (unk_96FE)
		call	j_STLSTVECEL
		call	j_CleanAll
		call	p05sub_548F
		ret		z
		ret		c
		inc		hl
		ld		(unk_9704), hl
		ret
; End of function p05sub_578B

; ---------------------------------------------------------------------------
		bit		statsValid, (iy+statFlags)
		ret		z
		call	j_DelRes
		ret

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


p05sub_57A8:
		call	p05sub_65A8
		ret		z
		ld		a, (unk_8479)
		ld		h, a
		ld		a, (unk_8479+1)
		ld		l, a
		ld		(unk_92AC), hl
		ret
; End of function p05sub_57A8


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

p05loc_57B8:
p05sub_57B8:
		ld		hl, p05loc_5847
		call	pushErrorHandleR
		bit		editOpen, (iy+editFlags)
		jp		z, p05loc_58A1
		call	IsEditEmpty
		jp		z, p05loc_58A1
		bit		monAbandon, (iy+monFlags)
		jp		nz, p05loc_58A1
		call	p05sub_47C2
		jp		p05loc_588E
; ---------------------------------------------------------------------------

p05loc_57D8:
		call	settblrefs
		ld		hl, p05loc_5839
		call	pushErrorHandleR
		bit		editOpen, (iy+editFlags)
		jp		z, p05loc_5833
		call	IsEditEmpty
		jp		z, p05loc_5833
		bit		monAbandon, (iy+monFlags)
		jr		nz, p05loc_5833
		call	p05sub_6B56
		call	p05sub_5CF2
		jr		p05loc_582B
; ---------------------------------------------------------------------------

p05loc_57FC:
		res		7, (iy+15h)
		call	settblrefs
		ld		hl, p05loc_5839
		call	pushErrorHandleR
		bit		editOpen, (iy+editFlags)
		jr		z, p05loc_5833
		ld		hl, (editSym)
		ld		a, (hl)
		and		1Fh
		cp		0Ah
		jr		nz, p05loc_5823
		ld		a, (hl)
		and		0E0h ; '�'
		ex		de, hl
		ld		hl, equ_edit_save
		or		(hl)
		ex		de, hl
		ld		(hl), a

p05loc_5823:
		call	IsEditEmpty
		jr		z, p05loc_5833
		call	p05sub_6D9C

p05loc_582B:
		call	j_releaseBuffer
		call	p05sub_57A8
		jr		p05loc_58A4
; ---------------------------------------------------------------------------

p05loc_5833:
		call	closeEditBuf
		call	popErrorHandleR
p05loc_5839:
		call	j_releaseBuffer
		ld		hl, p05sub_58A7
		call	pushErrorHandleR
		call	p05sub_57A8
		jr		p05loc_58A4

p05loc_5847:
		call	j_releaseBuffer
		jr		p05sub_58A7
; ---------------------------------------------------------------------------

p05loc_584C:
		ld		hl, p05loc_5847
		call	pushErrorHandleR
		bit		editOpen, (iy+editFlags)
		jr		z, p05loc_58A1
		bit		monAbandon, (iy+monFlags)
		jr		nz, p05loc_58A1
		call	IsEditEmpty
		jr		z, p05loc_58A1
		call	p05sub_59B0
		jr		p05loc_588E
; ---------------------------------------------------------------------------

p05loc_5868:
		call	p05sub_5463
		call	nz, p05sub_4D70
		ld		hl, p05loc_5874
		ld		(mcxPutAway), hl

p05loc_5874:
		ld		hl, p05loc_5847
		call	pushErrorHandleR
		bit		editOpen, (iy+editFlags)
		jr		z, p05loc_58A1
		call	IsEditEmpty
		jr		z, p05loc_58A1
		bit		monAbandon, (iy+monFlags)
		jr		nz, p05loc_58A1
		call	p05sub_56A9

p05loc_588E:
		call	j_releaseBuffer
		jr		p05loc_58A4
; ---------------------------------------------------------------------------
p05_loc_5893:
		res		saIndic, (iy+newIndicFlags)
		res		indicInUse, (iy+indicFlags)
p05_loc_589B:
		ld		hl, p05sub_58A7
		call	pushErrorHandleR

p05loc_58A1:
		call	closeEditBuf

p05loc_58A4:
		call	popErrorHandleR
; End of function p05sub_57B8


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


p05sub_58A7:
		; p05sub_57B8+92j
		call	page0_740
		res		curLock, (iy+curFlags)
		call	j_resetStacks
		call	j_CleanAll
		res		grfSplitOverride, (iy+sGrFlags)
		bit		3, (iy+15h)
		ret		z
		bit		4, (iy+15h)
		ret		z
		call	j_ClrScrn
		ret
; End of function p05sub_58A7


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


parseEditBuf:
		call	j_closeeditbufnor
		call	page0_166E
		call	zero_basic_prog
		call	j_ParseInp
		call	page0_1717
		call	page0_1032
		ret		z
		jp		EOP1NotReal
; End of function parseEditBuf


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


p05sub_58DC:
		call	CpyTo3FPST

p05loc_58DF:
		call	CkOP1Real
		push	af
		call	PushOP1
		call	OP3ToOP1
		pop		af
		call	Page0Call_241E
		ret
; End of function p05sub_58DC


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


p05sub_58EE:
		ld		hl, p05loc_5922
		ld		(mcxMain), hl
		ld		hl, p05loc_584C
		ld		(mcxPutAway), hl
		ld		hl, Page0Call_37FB
		ld		(mcxErrorEP), hl
		call	j_RecallEd
		call	p05sub_552C
		call	Page0Call_241E
		jr		c, p05loc_591A
		push	hl
		call	Page05_3249
		pop		hl
		ld		a, (hl)
		jr		z, p05loc_591A
		call	j_rclVarToEditPtR
		call	j_dispVarVal
		ret
; ---------------------------------------------------------------------------

p05loc_591A:
		call	Page0Call_3741
		ret
; End of function p05sub_58EE

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_4DDF

p05loc_591E:
		call	p05sub_58EE
		pop		af

p05loc_5922:
		cp		5
		jr		z, p05loc_592A
		cp		4
		jr		nz, p05loc_593D

p05loc_592A:
		call	p05sub_5954
		call	p05sub_487A
		bit		5, (iy+5)
		call	nz, p05sub_488C
		call	p05sub_56EA
		jp		p05loc_4EBC
; ---------------------------------------------------------------------------

p05loc_593D:
		cp		3
		ret		z
		bit		enableQueue, (iy+rclFlag)
		jr		nz, p05loc_5949
		cp		8Ah ; '�'
		ret		z

p05loc_5949:
		cp		27h ; '''
		jp		nz, j_CallCommon
		call	p05loc_584C
		jp		Page05_3A17
; END OF FUNCTION CHUNK	FOR p05sub_4DDF

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


p05sub_5954:
		call	IsEditEmpty
		jr		nz, p05sub_59A3
		call	p05sub_5A32
		jr		z, p05loc_5982
		ld		hl, (editCursor)
		ld		(rclQueue), hl
		ld		a, (unk_89FA)
		ld		(unk_89FB), a
		ld		a, 2Ah ; '*'
		call	j_bufQueueChar
		ret		c
		ld		a, 2Ah ; '*'
		call	j_bufQueueChar
		ret		c
		ld		hl, (rclQueue)
		ld		(editCursor), hl
		call	p05sub_59A3
		jp		p05sub_56EA
; ---------------------------------------------------------------------------

p05loc_5982:
		call	closeEditBuf
		call	p05sub_552C
		call	page0_17E9
		call	Page0Call_241E
		ret		c
		call	DelVar
		ld		hl, 0
		call	CreateRList
		bit		5, (iy+5)
		call	nz, p05sub_5AEE
		call	p05sub_56EA
		ret
; End of function p05sub_5954


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


p05sub_59A3:
		ld		hl, 615h
		call	pushErrorHandleR
		call	p05sub_59B0
		call	popErrorHandleR
		ret
; End of function p05sub_59A3


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


p05sub_59B0:
		call	j_closeeditbufnor
		call	page0_166E
		call	zero_basic_prog
		call	j_ParseInp
		call	page0_1717
		call	CkOP1Real
		cp		4
		jr		z, p05loc_59CF
		cp		0Dh
		jr		z, p05loc_59CF
		cp		1
		jp		nz, ErrDataType

p05loc_59CF:
		bit		5, (iy+5)
		jr		nz, p05loc_59D9
		call	j_CleanAll
		ret
; ---------------------------------------------------------------------------

p05loc_59D9:
		call	p05sub_5AEE
		call	PushOP1
		call	p05sub_552C
		rst		10h
		call	nc,	page0_16F4
		res		3, (iy+1Ah)
		call	j_StoOther
		call	j_CleanAll
		call	p05sub_552C
		rst		10h
		ret		c
		call	page0_17E9
		ld		a, (unk_970A)
		sub		2
		jr		nc, p05loc_5A05
		res		5, (iy+27h)
		jr		p05sub_5A11
; ---------------------------------------------------------------------------

p05loc_5A05:
		jr		nz, p05loc_5A0D
		res		6, (iy+27h)
		jr		p05sub_5A11
; ---------------------------------------------------------------------------

p05loc_5A0D:
		res		7, (iy+27h)
; End of function p05sub_59B0


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


p05sub_5A11:
		; p05sub_56EA:p05loc_572Ep ...
		call	p05sub_5A32
		ret		z
		ld		hl, (pTempCnt)
		push	hl
		ld		hl, p05loc_5A3F
		call	pushErrorHandleR
		call	p05sub_552C
		rst		10h
		call	j_InitPFlgs
		call	j_PARSE_FORMULA
		call	popErrorHandleR
		pop		hl
		ld		(pTempCnt), hl
		or		a
		ret
; End of function p05sub_5A11


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


p05sub_5A32:
		; p05sub_4DDF+27Fp ...
		call	p05sub_552C
		rst		10h
		jr		c, p05loc_5A3D
		call	GET_FORM_NUM
		or		a
		ret
; ---------------------------------------------------------------------------

p05loc_5A3D:
		xor		a
		ret
; End of function p05sub_5A32

p05loc_5A3F:
		pop		de
		push	af
		call	j_FixTempCnt
		pop		af
		cp		8Dh ; '�'
		jr		z, p05loc_5A68
		cp		0AFh ; '�'
		jr		z, p05loc_5A68
		ld		a, (unk_970A)
		ld		(unk_9301), a
		call	zero_basic_prog
		ld		hl, 0
		ld		(unk_96FE), hl
		ld		(unk_9704), hl
		ld		hl, p05loc_4919
		ld		(mcxErrorEP), hl
		jp		JErrorNo
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_526B

p05loc_5A68:

		set		5, (iy+5)
		call	zero_basic_prog
		scf
		ret
; END OF FUNCTION CHUNK	FOR p05sub_526B

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


Page05_324F:



		call	Bit_VertSplit
		jr		nz, p05loc_5AB4
; End of function Page05_324F


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


p05sub_5A76:
		call	Bit_VertSplit
		call	nz, j_SetNorm_Vals
		ld		a, (iy+2)
		push	af
		ld		hl, (XOffset)
		push	hl
		ld		hl, 0
		ld		(XOffset), hl
		set		plotLoc, (iy+plotFlags)
		ld		a, 9
		call	p05sub_543C
		ld		a, 37h ; '7'
		call	p05sub_5446
		call	p05sub_543C
		ld		a, 1Fh
		call	p05sub_544D
		ld		a, 3Dh ; '='

p05loc_5AA2:
		call	p05sub_544D
		pop		hl
		ld		(XOffset), hl
		pop		af
		ld		(iy+2),	a
		call	Bit_VertSplit
		call	nz, j_SetYOffset
		ret
; End of function p05sub_5A76

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR Page05_324F

p05loc_5AB4:
		call	j_SetNorm_Vals
		ld		a, (iy+2)
		push	af
		ld		hl, (XOffset)
		push	hl
		ld		hl, 0
		ld		(XOffset), hl
		set		plotLoc, (iy+plotFlags)
		ld		a, 9
		ld		b, 30h ; '0'
		call	p05loc_543E
		ld		a, 37h ; '7'
		ld		b, 30h ; '0'
		call	p05loc_543E
		ld		a, 47h ; 'G'
		jr		p05loc_5AA2
; END OF FUNCTION CHUNK	FOR Page05_324F

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


p05sub_5ADB:
		call	j_getcurloc

p05loc_5ADE:
		ld		a, (hl)
		cp		20h ; ' '
		ret		z
		ld		a, (curRow+1)
		inc		a
		or		a
		ret		z
		ld		(curRow+1), a
		inc		hl
		jr		p05loc_5ADE
; End of function p05sub_5ADB


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


p05sub_5AEE:
		; p05sub_4DDF:p05loc_4FF8p ...
		set		5, (iy+27h)
		set		6, (iy+27h)
		set		7, (iy+27h)
		ret
; End of function p05sub_5AEE


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


putsm:
		; p05sub_7113+1Dp	...
		push	bc
		push	af
		ld		a, (winBtm)
		ld		b, a

p05loc_5B01:
		ld		a, (hl)
		inc		hl
		or		a
		scf
		jr		z, p05loc_5B10
		call	j_PutC
		ld		a, (curRow)
		cp		b
		jr		c, p05loc_5B01

p05loc_5B10:
		pop		bc
		ld		a, b
		pop		bc
		ret
; End of function putsm


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


p05sub_5B14:
		; p05sub_4DDF+169p ...
		ld		hl, (unk_96FE)
; End of function p05sub_5B14


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


p05sub_5B17:
		; p05sub_4DDF+28Ap
		ld		de, 3E7h
		jp		CpHLDE
; End of function p05sub_5B17

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

p05loc_5B1D:
		call	p05loc_57D8

Page05_3A41:
		call	p05sub_6FCD
		res		4, (iy+1Dh)
		res		7, (iy+15h)
		ld		hl, Page05Table1
		call	page0_7C1
		call	Bit_VertSplit
		jr		z, p05loc_5B3E
		call	j_ClrTxtShd
		call	p05sub_5BA7
		jr		z, p05loc_5B41

p05loc_5B3E:
		call	j_ClrScrn

p05loc_5B41:
		call	page0_176F
		call	p05sub_620C
		call	Bit_VertSplit
		jr		z, p05loc_5B59
		set		splitOverride, (iy+graphFlags2)
		call	j_PDspGrph
		res		splitOverride, (iy+graphFlags2)
		jr		p05loc_5B62
; ---------------------------------------------------------------------------

p05loc_5B59:
		call	p05sub_6DEC
; START	OF FUNCTION CHUNK FOR p05sub_6C47

p05loc_5B5C:
		call	p05sub_5C38
		call	p05sub_61AD
; END OF FUNCTION CHUNK	FOR p05sub_6C47
; START	OF FUNCTION CHUNK FOR p05sub_487A

p05loc_5B62:

		res		curAble, (iy+curFlags)
		res		curOn, (iy+curFlags)
		set		curLock, (iy+curFlags)
		ret
; END OF FUNCTION CHUNK	FOR p05sub_487A

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


p05sub_5B6F:

		ld		hl, Page05Table1
		call	AppInit
		jr		p05loc_5B62
; End of function p05sub_5B6F

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

DspCurTbl:
		call	p05sub_6FCD
		set		6, (iy+15h)
		call	j_SaveScreen
		res		appAutoScroll, (iy+appFlags)
		call	p05sub_6DEC
		call	p05sub_5C38
		call	Bit_VertSplit
		jr		z, p05loc_5BA3
		set		6, (iy+1Dh)
		set		7, (iy+1Dh)
		call	j_ClrScrn
		call	j_PDspGrph
		res		appTextSave, (iy+appFlags)
		ret
; ---------------------------------------------------------------------------

p05loc_5BA3:
		call	p05sub_61AD
		ret

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


p05sub_5BA7:
		bit		6, (iy+1Dh)
		ret		z
		bit		7, (iy+1Dh)
		ret
; End of function p05sub_5BA7

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

DSPGRTBL:
		res		appTextSave, (iy+appFlags)
		call	p05sub_5BA7
		jr		z, p05loc_5BC3
		bit		editOpen, (iy+editFlags)
		jr		nz, p05loc_5BC3
		call	j_ClrScrn

p05loc_5BC3:
		bit		0, (iy+2)
		jr		nz, p05sub_5BE9
		bit		2, (iy+17h)
		jr		nz, p05sub_5BE9
		call	p05sub_6FCD
		call	p05sub_6DEC
		ld		hl, (curRow)
		push	hl
		ld		b, 8
		ld		l, b
		ld		h, 8

p05loc_5BDE:
		dec		l
		ld		(curRow), hl
		call	j_EraseEOL
		djnz	p05loc_5BDE
		jr		p05loc_5BED

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


p05sub_5BE9:
		ld		hl, (curRow)
		push	hl

p05loc_5BED:
		ld		a, (winLeftEdge)
		push	af
		set		2, (iy+1Fh)
		ld		hl, p05loc_5C21
		call	pushErrorHandleR
		res		appAutoScroll, (iy+appFlags)
		call	p05sub_5C38
		call	p05sub_61AD
		call	popErrorHandleR
		res		2, (iy+1Fh)
		pop		af
		ld		(winLeftEdge), a
		pop		hl
		ld		(curRow), hl
		set		appTextSave, (iy+appFlags)
		set		appAutoScroll, (iy+appFlags)
		res		7, (iy+1Dh)
		ret
; End of function p05sub_5BE9

p05loc_5C21:
		res		2, (iy+1Fh)
		pop		af
		ld		(winLeftEdge), a
		pop		hl
		ld		(curRow), hl
		set		appTextSave, (iy+appFlags)
		set		appAutoScroll, (iy+appFlags)
		jp		JErrorNo

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


p05sub_5C38:

		sub		a
		call	CheckSplitFlag
		jr		z, p05loc_5C40
		add		a, 4

p05loc_5C40:
		ld		(winTop), a
		ret
; End of function p05sub_5C38

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

zeroTemplate:
		ld		hl, 929Fh
		sub		a
		ld		b, 0Dh

p05loc_5C4A:
		ld		(hl), a
		inc		hl
		djnz	p05loc_5C4A
		ret

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


p05sub_5C4F:
		call	p05sub_6876
		jr		z, p05loc_5C80
		ld		hl, 91E2h
		ld		c, 7
		ld		de, 9
		ld		a, (unk_91E0)
		or		a
		jr		z, p05loc_5C70
		cp		7
		jr		nc, p05loc_5CCC
		ld		b, a
		ld		a, 2

p05loc_5C69:
		sla	a
		add		hl, de
		dec		c
		djnz	p05loc_5C69
		dec		a

p05loc_5C70:
		ld		(unk_929F), a
		ld		a, c
		sla	a
		sla	a
		sla	a
		add		a, c
		ld		b, a
		call	p05loc_5CEC
		ret
; ---------------------------------------------------------------------------

p05loc_5C80:
		ld		hl, 8622h
		rst		20h
		call	OP1ToOP4
		ld		hl, 91E2h
		ld		b, 7
		push	bc
		push	hl
		push	hl
		jr		p05loc_5C9D
; ---------------------------------------------------------------------------

p05loc_5C91:
		push	bc
		push	de
		push	hl
		call	OP4ToOP1
		call	Plus1
		call	OP1ToOP4

p05loc_5C9D:
		ld		hl, p05loc_5CD2
		call	pushErrorHandleR
		call	CkValidNum
		ld		hl, TblStep
		call	Mov9ToOP2
		call	FPMult
		call	p05sub_6FB2
		call	nz, j_RndGuard
		ld		hl, 862Bh
		call	Mov9ToOP2
		rst		30h
		call	CkValidNum
		call	popErrorHandleR
		pop		de

p05loc_5CC3:
		pop		de
		push	de
		call	MovFrOP1
		pop		hl
		pop		bc
		djnz	p05loc_5C91

p05loc_5CCC:
		ld		a, 0FFh
		ld		(unk_929F), a
		ret
; End of function p05sub_5C4F

p05loc_5CD2:
		pop		hl
		rst		20h
		jr		p05loc_5CC3

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


p05sub_5CD6:
		ld		a, 0FFh
		ld		(OP1), a
		ret
; End of function p05sub_5CD6

; ---------------------------------------------------------------------------
		ld		a, (OP1)
		cp		0FFh
		ret

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


p05sub_5CE2:
		ld		hl, 9221h
		ld		b, 7Eh ; '~'
		jr		p05loc_5CEC
; End of function p05sub_5CE2


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


p05sub_5CE9:
		add		hl, de

p05loc_5CEA:
		ld		b, 9

p05loc_5CEC:
		sub		a

p05loc_5CED:
		ld		(hl), a
		inc		hl
		djnz	p05loc_5CED
		ret
; End of function p05sub_5CE9


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


p05sub_5CF2:




		call	p05sub_6880
		ret		nz
		ld		a, (unk_91DB+1)
		jr		p05loc_5D01
; ---------------------------------------------------------------------------

p05loc_5CFB:
		ld		a, 1
		jr		p05loc_5D01
; ---------------------------------------------------------------------------

p05loc_5CFF:
		ld		a, 7

p05loc_5D01:
		call	p05sub_6880
		ret		nz
		ld		hl, (CurTableCol)
		push	hl
		ld		hl, (unk_91DB)
		push	hl
		ld		(unk_91DB+1), a
		call	p05sub_652D
		jr		z, p05loc_5D3F
		ld		(unk_91DB), a
		ld		a, 1
		call	p05sub_609D
		call	Bit_VertSplit
		jr		z, p05loc_5D32
		call	p05sub_6FAE
		jr		z, p05loc_5D3F
		call	p05sub_652D
		ld		hl, OP1M
		set		0, (hl)
		inc		a
		jr		p05loc_5D37
; ---------------------------------------------------------------------------

p05loc_5D32:
		call	p05sub_668B
		jr		z, p05loc_5D3F

p05loc_5D37:
		ld		(unk_91DB), a
		ld		a, 2
		call	p05sub_609D

p05loc_5D3F:
		jp		p05loc_6707
; End of function p05sub_5CF2


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


p05sub_5D42:
		call	p05sub_5CE2
		ld		hl, 92A0h
		ld		b, 0Ch
		call	p05loc_5CEC
		call	p05sub_6880
		ret		nz
		ld		hl, 92A0h
		ld		b, 0Ch
		ld		a, (unk_929F)
		call	p05loc_5CED
		call	p05sub_5EFA
		call	p05sub_5F01
		ret
; End of function p05sub_5D42


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


p05sub_5D63:
		call	Page0Call_33BD
		call	p05sub_5EDA
		ld		(unk_91DA), a
		ret
; End of function p05sub_5D63


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


p05sub_5D6D:
		ld		hl, 9221h
		ld		de, 9260h
		jr		p05loc_5D7B
; End of function p05sub_5D6D


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


p05sub_5D75:
		ld		de, 9221h
		ld		hl, 9260h

p05loc_5D7B:
		ld		bc, 3Fh	; '?'
		ldir
		ret
; End of function p05sub_5D75


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


p05sub_5D81:
		ld		de, 929Eh
		ld		hl, 9295h
		ld		bc, 0B4h ; '�'
		lddr
		ld		hl, 929Fh
		ld		b, 0Dh

p05loc_5D91:
		ld		a, (hl)
		sla	a
		ld		(hl), a
		inc		hl
		djnz	p05loc_5D91
		call	p05loc_5EA9
		ret
; End of function p05sub_5D81


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


p05sub_5D9C:
		ld		de, 91E2h
		ld		hl, 91EBh
		ld		bc, 0B4h ; '�'
		ldir
		ld		hl, 929Fh
		ld		b, 0Dh

p05loc_5DAC:
		ld		a, (hl)
		srl	a
		ld		(hl), a
		inc		hl
		djnz	p05loc_5DAC
		call	p05loc_5EA4
		ret
; End of function p05sub_5D9C


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


p05sub_5DB7:
		ld		a, (unk_91DB+1)
		cp		7
		jr		z, p05loc_5DDD
		ld		de, 929Eh
		ld		hl, 9295h
		call	p05sub_5E77
		push	bc
		lddr
		ld		de, 925Fh
		ld		hl, 9256h
		pop		bc
		push	bc
		lddr
		ld		de, 9220h
		ld		hl, 9217h
		pop		bc
		lddr

p05loc_5DDD:
		ld		hl, 929Fh
		ld		b, 0Dh

p05loc_5DE2:
		push	bc
		ld		a, (unk_91DB+1)
		or		a
		jr		z, p05loc_5DF4
		dec		a
		jr		z, p05loc_5DF4
		ld		b, a
		sub		a

p05loc_5DEE:
		sla	a
		add		a, 1
		djnz	p05loc_5DEE

p05loc_5DF4:
		ld		b, a
		ld		a, (hl)
		and		b
		ld		c, a
		ld		a, b
		xor		0FFh
		and		(hl)
		sla	a
		or		c
		ld		(hl), a
		pop		bc
		inc		hl
		djnz	p05loc_5DE2
		call	p05sub_605E
		or		(hl)
		ld		(hl), a
		call	p05sub_5E90
		call	p05sub_5E9F
		ret
; End of function p05sub_5DB7


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


p05sub_5E10:
		ld		a, (unk_91DB+1)
		cp		1
		jr		z, p05sub_5D9C
		cp		7
		jr		nc, p05loc_5E43
		call	p05sub_5E77
		push	bc
		ld		de, 9221h
		ld		hl, 9218h
		call	p05sub_5E6F
		ldir
		ld		de, 9260h
		ld		hl, 9257h
		pop		bc
		call	p05sub_5E6F
		push	bc
		ldir
		ld		de, 929Fh
		ld		hl, 9296h
		pop		bc
		call	p05sub_5E6F
		ldir

p05loc_5E43:
		call	p05loc_5EA4
		ld		hl, 929Fh
		ld		b, 0Dh

p05loc_5E4B:
		push	bc
		ld		a, (unk_91DB+1)
		or		a
		jr		z, p05loc_5E5D
		dec		a
		jr		z, p05loc_5E5D
		ld		b, a
		sub		a

p05loc_5E57:
		sla	a
		add		a, 1
		djnz	p05loc_5E57

p05loc_5E5D:
		ld		b, a
		xor		0FFh
		ld		c, a
		ld		a, (hl)
		and		b
		ld		b, a
		ld		a, (hl)
		srl	a
		and		c
		or		b
		ld		(hl), a
		pop		bc
		inc		hl
		djnz	p05loc_5E4B
		ret
; End of function p05sub_5E10


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


p05sub_5E6F:
		sub		a
		sbc		hl, bc
		ex		de, hl
		sub		a
		sbc		hl, bc
		ret
; End of function p05sub_5E6F


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


p05sub_5E77:
		ld		b, a
		ld		a, 7
		sub		b
		ld		b, a
		add		a, a
		add		a, a
		add		a, a
		add		a, b
		ld		c, a
		ld		b, 0
		ret
; End of function p05sub_5E77


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


p05sub_5E84:
		ld		a, (unk_91DB+1)
		dec		a
		ld		l, a
		ld		h, 0
		call	HLTimes9
		ex		de, hl
		ret
; End of function p05sub_5E84


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


p05sub_5E90:
		call	OP1Set0
		ld		de, 91E2h
		call	p05sub_5E84
		add		hl, de
		ex		de, hl
		call	MovFrOP1
		ret
; End of function p05sub_5E90


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


p05sub_5E9F:
		call	p05sub_5E84
		jr		p05loc_5EB2
; ---------------------------------------------------------------------------

p05loc_5EA4:
		; p05sub_5E10:p05loc_5E43p
		ld		de, 36h	; '6'
		jr		p05loc_5EAC
; ---------------------------------------------------------------------------

p05loc_5EA9:
		ld		de, 0

p05loc_5EAC:
		ld		hl, 91E2h
		call	p05sub_5CE9

p05loc_5EB2:
		ld		hl, 9221h
		call	p05sub_5CE9
		ld		hl, 9260h
		call	p05sub_5CE9
		call	p05sub_6891
		ret		z
		ld		b, a
		ld		a, 1
		jr		p05loc_5EC9
; ---------------------------------------------------------------------------

p05loc_5EC7:
		sla	a

p05loc_5EC9:
		djnz	p05loc_5EC7
		xor		0FFh
		ld		c, a
		ld		hl, 92A0h
		ld		b, 0Ch

p05loc_5ED3:
		and		(hl)
		ld		(hl), a
		inc		hl
		ld		a, c
		djnz	p05loc_5ED3
		ret
; End of function p05sub_5E9F


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


p05sub_5EDA:
		ld		hl, (EQS)
		ld		(FPS), hl
		ret
; End of function p05sub_5EDA


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


p05sub_5EE1:
		; dispTblBot+8Cp ...
		bit		grfParamM, (iy+grfModeFlags)
		ret
; End of function p05sub_5EE1


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


p05sub_5EE6:
		call	p05sub_652D
		ret		z
		push	af
		ld		a, 1
		ld		(CurTableCol), a
		pop		af
		call	p05loc_5F25
		ld		a, 2
		ld		(CurTableCol), a
		ret
; End of function p05sub_5EE6


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


p05sub_5EFA:
		ld		a, 1
		ld		(CurTableCol), a
		jr		p05loc_5F2E
; End of function p05sub_5EFA


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


p05sub_5F01:
		call	p05sub_6FAE
		jr		nz, p05loc_5F0A
		call	Bit_VertSplit
		ret		nz

p05loc_5F0A:
		ld		a, 2
		ld		(CurTableCol), a
		call	p05sub_65A8
		ret		z
		call	p05sub_5EE1
		jr		z, p05loc_5F20
		ld		hl, OP1M
		set		0, (hl)
		inc		a
		jr		p05loc_5F25
; ---------------------------------------------------------------------------

p05loc_5F20:
		call	j_NEXTEQ
		or		a
		ret		z

p05loc_5F25:
		ld		hl, (unk_91DB)
		push	hl
		ld		(unk_91DB), a
		jr		p05loc_5F3B
; ---------------------------------------------------------------------------

p05loc_5F2E:
		ld		(unk_91DB), a

p05loc_5F31:
		ld		hl, (unk_91DB)
		push	hl
		call	p05sub_65A8
		jp		z, p05loc_5FD4

p05loc_5F3B:
		sub		a
		ld		(unk_91DB+1), a
		ld		b, 7
		ld		hl, 91E2h

p05loc_5F44:
		push	bc
		push	hl
		ld		hl, CurTableRow
		inc		(hl)
		call	PushRealO1
		call	OP1ToOP2
		pop		hl
		rst		20h
		push	hl
		call	p05sub_6834
		jr		c, p05loc_5FCB
		jr		z, p05loc_5FCB
		call	p05sub_604B
		jr		nz, p05loc_5FCB
		ld		hl, (pTempCnt)
		push	hl
		ld		hl, p05loc_5FDC
		call	pushErrorHandleR
		call	p05sub_603D
		call	PushRealO2
		bit		grfRecurM, (iy+grfModeFlags)
		jr		z, p05loc_5F87
		call	ErrD_OP1NotPosInt
		call	OP1ToOP3
		ld		hl, nMin
		call	Mov9OP2Cp
		call	OP3ToOP1
		jp		c, ErrDomain

p05loc_5F87:
		call	popErrorHandleR
		ld		hl, 1
		ld		(unk_980E), hl
		set		drawingGraph, (iy+graphFlags)
		xor		a
		ld		(EST), a
		ld		hl, p05loc_5FE0
		call	pushErrorHandleR
		call	j_InitPFlgs
		ld		hl, 0
		ld		(unk_9665), hl
		call	j_CPYO1TOES15
		call	popErrorHandleR
		res		drawingGraph, (iy+graphFlags)
		ld		hl, p05loc_5FDC
		call	pushErrorHandleR
		call	p05sub_6185
		call	p05sub_602F
		xor		a
		ld		(EST), a
		call	popErrorHandleR
		pop		hl
		ld		(pTempCnt), hl
		call	p05sub_6020

p05loc_5FCB:
		call	PopRealO1
		pop		hl
		pop		bc
		dec		b
		jp		nz, p05loc_5F44

p05loc_5FD4:
		pop		hl
		ld		(unk_91DB), hl
		call	j_DOREFFLAGS02
		ret
; End of function p05sub_5F01

p05loc_5FDC:
		res		7, a
		jr		p05loc_5FE3
p05loc_5FE0:
		call	PopRealO1
p05loc_5FE3:
		pop		hl
		ld		(pTempCnt), hl
		call	p05sub_5FEC
		jr		p05loc_5FCB

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


p05sub_5FEC:
		res		drawingGraph, (iy+graphFlags)
		call	p05sub_602F
		ld		(errNo), a
		bit		7, a
		jr		z, p05loc_6004
		cp		87h ; '�'
		jr		z, p05loc_6019
		cp		86h ; '�'
		jr		c, p05loc_6019
		jr		p05loc_600C
; ---------------------------------------------------------------------------

p05loc_6004:
		cp		7
		jr		z, p05loc_6019
		cp		6
		jr		c, p05loc_6019

p05loc_600C:
		call	p05sub_6FD8
		bit		allowProgTokens, (iy+newDispF)
		call	nz, j_RetScreenErr
		jp		JErrorNo
; ---------------------------------------------------------------------------

p05loc_6019:
		call	p05sub_5CD6
		xor		a
		ld		(EST), a
; End of function p05sub_5FEC


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


p05sub_6020:
		res		reTable, (iy+tblFlags)
		call	p05sub_6077
		call	p05sub_607D
		ex		de, hl
		call	MovFrOP1
		ret
; End of function p05sub_6020


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


p05sub_602F:
		res		graphDraw, (iy+graphFlags)
		bit		7, (iy+13h)
		ret		z
		set		graphDraw, (iy+graphFlags)
		ret
; End of function p05sub_602F


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


p05sub_603D:
		res		7, (iy+13h)
		bit		graphDraw, (iy+graphFlags)
		ret		z
		set		7, (iy+13h)
		ret
; End of function p05sub_603D


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


p05sub_604B:
		call	p05sub_6880
		ret		z
		call	p05sub_6067
		ld		b, a
		and		(hl)
		xor		b
		ret
; End of function p05sub_604B


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


p05sub_6056:
		call	p05sub_6067
		xor		0FFh
		and		(hl)
		ld		(hl), a
		ret
; End of function p05sub_6056


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


p05sub_605E:
		ld		a, (unk_91DB+1)
		ld		hl, 929Fh
		ld		b, a
		jr		p05loc_6071
; End of function p05sub_605E


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


p05sub_6067:
		ld		hl, (unk_91DB)
		ld		b, h
		ld		h, 0
		ld		de, 929Fh
		add		hl, de

p05loc_6071:
		ld		a, 80h ; '�'

p05loc_6073:
		rlca
		djnz	p05loc_6073
		ret
; End of function p05sub_6067


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


p05sub_6077:
		call	p05sub_6067
		or		(hl)
		ld		(hl), a
		ret
; End of function p05sub_6077


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


p05sub_607D:
		ld		a, (CurTableCol)
		or		a
		jr		z, p05sub_608D
		dec		a
		jr		z, p05loc_6088
		ld		a, 7

p05loc_6088:
		ld		de, 9221h
		jr		p05loc_6090
; End of function p05sub_607D


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


p05sub_608D:
		ld		de, 91E2h

p05loc_6090:
		ld		hl, CurTableRow
		add		a, (hl)
		dec		a
		ld		l, a
		ld		h, 0
		call	HLTimes9
		add		hl, de
		ret
; End of function p05sub_608D


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


p05sub_609D:
		ld		(CurTableCol), a

p05loc_60A0:
		ld		hl, (pTempCnt)
		push	hl
		ld		hl, p05loc_6175
		call	pushErrorHandleR
		call	p05sub_603D
		call	PushRealO1
		sub		a
		call	p05sub_608D
		rst		20h
		call	p05sub_6834
		jp		c, p05loc_616A
		jp		z, p05loc_616A
		bit		grfRecurM, (iy+grfModeFlags)
		jr		z, p05loc_60D6
		call	ErrD_OP1NotPosInt
		call	OP1ToOP3
		ld		hl, nMin
		call	Mov9OP2Cp
		call	OP3ToOP1
		jp		c, ErrDomain

p05loc_60D6:
		call	popErrorHandleR
		ld		hl, 1
		ld		(unk_980E), hl
		set		drawingGraph, (iy+graphFlags)
		xor		a
		ld		(EST), a
		ld		hl, p05loc_6179
		call	pushErrorHandleR
		call	p05sub_6FB2
		jr		z, p05loc_6139
		call	IsFunctionMode
		jr		z, p05loc_60FE
		ld		a, (Xres_int)
		cp		1
		jr		nz, p05loc_6139

p05loc_60FE:
		call	page0_1A2
		jr		z, p05loc_6116
		ld		a, (CurTableCol)
		cp		2
		jr		z, p05loc_6122
		bit		6, (iy+3)
		jp		nz, ErrDomain
		call	j_RclX
		jr		p05loc_6145
; ---------------------------------------------------------------------------

p05loc_6116:
		call	p05sub_6DB5
		jr		nz, p05loc_6139
		bit		6, (iy+3)
		jp		nz, ErrDomain

p05loc_6122:
		bit		7, (iy+3)
		jp		nz, ErrDomain
		call	j_RclY
		call	page0_198
		jr		z, p05loc_6145
		call	RName
		call	j_RclVarSym
		jr		p05loc_6145
; ---------------------------------------------------------------------------

p05loc_6139:
		call	j_InitPFlgs
		ld		hl, 0
		ld		(unk_9665), hl
		call	j_CPYO1TOES15

p05loc_6145:
		call	popErrorHandleR
		res		drawingGraph, (iy+graphFlags)
		ld		hl, p05loc_6175
		call	pushErrorHandleR
		call	p05sub_6185
		call	p05sub_602F
		xor		a
		ld		(EST), a
		call	popErrorHandleR
		pop		hl
		ld		(pTempCnt), hl
		call	p05sub_6020

p05loc_6166:
		call	j_DOREFFLAGS02
		ret
; ---------------------------------------------------------------------------

p05loc_616A:
		call	PopRealO1
		call	popErrorHandleR
		pop		hl
		ld		(pTempCnt), hl
		ret
; End of function p05sub_609D

p05loc_6175:
		res		7, a
		jr		p05loc_617C
p05loc_6179:
		call	PopRealO1

p05loc_617C:
		pop		hl
		ld		(pTempCnt), hl
		call	p05sub_5FEC
		jr		p05loc_6166

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


p05sub_6185:
		call	CkOP1Real
		ret		z
		cp		0Ch
		jp		z, ErrNon_Real
		cp		0Dh
		jp		z, ErrNon_Real
		cp		0Eh
		jp		z, ErrDomain
		cp		1
		jp		nz, ErrDataType
		call	Page0Call_241E
		jp		c, ErrDataType
		ld		hl, 1
		call	j_GetLToOP1
		call	j_CleanAll
		ret
; End of function p05sub_6185


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


p05sub_61AD:

		bit		reTable, (iy+tblFlags)
		jr		z, p05loc_61D3
		call	p05sub_6236
		call	p05sub_622C
		call	p05sub_5C4F
		call	p05sub_5D63
		call	p05sub_5D42
		call	p05sub_622C
		call	p05sub_6FAE
		jr		z, p05loc_61CF
		ld		a, 1
		ld		(CurTableCol), a

p05loc_61CF:
		res		reTable, (iy+tblFlags)

p05loc_61D3:
		call	p05sub_62FE
		call	p05sub_61E9
		call	DispTblTop
		call	Page05_324F
		call	dispTblbody

p05loc_61E2:

		call	dispTblBot
		call	Page05_3195
		ret
; End of function p05sub_61AD


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


p05sub_61E9:
		call	Bit_VertSplit
		jr		nz, p05loc_61F2
		call	j_ClrWindow
		ret
; ---------------------------------------------------------------------------

p05loc_61F2:
		bit		editOpen, (iy+editFlags)
		ret		nz
		ld		hl, 800h
		ld		(curRow), hl
		call	j_EraseEOL
		ret
; End of function p05sub_61E9

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_6C47

p05loc_6201:
		call	DispTblTop
		call	p05sub_676B
		call	p05sub_6773
		jr		p05loc_61E2
; END OF FUNCTION CHUNK	FOR p05sub_6C47

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


p05sub_620C:

		ld		hl, TblMin
		res		6, (hl)
		ld		hl, TblStep
		res		6, (hl)
		ld		hl, 91D9h
		res		6, (hl)
		ret
; End of function p05sub_620C


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


settblrefs:
		; p05sub_57B8+48p	...
		ld		hl, TblMin
		set		6, (hl)
		ld		hl, TblStep
		set		6, (hl)
		ld		hl, 91D9h
		set		6, (hl)
		ret
; End of function settblrefs


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


p05sub_622C:
		ld		hl, 100h
		ld		(unk_91DB), hl
		ld		(CurTableCol), hl
		ret
; End of function p05sub_622C


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


p05sub_6236:
		call	p05sub_6876
		ret		nz
		ld		a, 7
		ld		(unk_91E0), a
		ret
; End of function p05sub_6236


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


p05sub_6240:
		ld		a, (unk_91E0)
		ld		hl, CurTableRow
		cp		(hl)
		ret
; End of function p05sub_6240


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


p05sub_6248:
		ld		a, (unk_91DB+1)
		ld		hl, 91E0h
		cp		(hl)
		ret
; End of function p05sub_6248


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


Page05_3195:
		set		textInverse, (iy+textFlags)

p05loc_6254:
		; p05sub_68F5:p05loc_6903p ...
		push	bc
		push	hl
		call	p05sub_6891
		jr		z, p05loc_6285
		call	p05sub_6FB2
		jr		nz, p05loc_626D
		call	p05sub_6312
		call	p05sub_67B1

p05loc_6266:
		; Page05_3195+73j ...
		res		textInverse, (iy+textFlags)
		pop		hl
		pop		bc
		ret
; ---------------------------------------------------------------------------

p05loc_626D:
		call	p05sub_6312
		call	p05sub_67B1
		ld		hl, CurTableCol
		ld		a, (hl)
		push	af
		inc		(hl)
		call	p05sub_6312
		call	p05sub_67B1
		pop		af
		ld		(CurTableCol), a
		jr		p05loc_6266
; ---------------------------------------------------------------------------

p05loc_6285:
		ld		a, (mcxCurApp)
		cp		4Ah ; 'J'
		jr		z, p05loc_62A6
		cp		40h ; '@'
		jr		z, p05loc_62A6
		ld		hl, (curRow)
		push	hl
		call	p05sub_62DB
		ld		de, (unk_92AC)
		bit		textInverse, (iy+textFlags)
		jr		nz, p05loc_62BC
		call	p05sub_664E
		jr		p05loc_62BC
; ---------------------------------------------------------------------------

p05loc_62A6:
		; Page05_3195+3Ej
		bit		editOpen, (iy+editFlags)
		jr		z, p05loc_62C5
		ld		hl, (curRow)
		push	hl
		call	p05sub_62DB
		ld		hl, (editSym)
		call	Page0Call_2407
		ld		d, (hl)
		dec		hl
		ld		e, (hl)

p05loc_62BC:
		; Page05_3195+54j
		call	p05sub_6663
		pop		hl
		ld		(curRow), hl
		jr		p05loc_6266
; ---------------------------------------------------------------------------

p05loc_62C5:
		call	p05sub_62DB
		call	p05sub_65A8
		jr		z, p05loc_6266
		bit		textInverse, (iy+textFlags)
		jr		nz, p05loc_62D6
		call	p05sub_664E

p05loc_62D6:
		call	p05sub_665C
		jr		p05loc_6266
; End of function Page05_3195


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


p05sub_62DB:
		; Page05_3195+60p ...
		ld		a, (winTop)
		ld		l, a
		ld		h, 0Dh
		call	Bit_VertSplit
		jr		z, p05loc_62EF
		call	page0_19D
		jr		z, p05loc_62FA
		ld		h, 0Ch
		jr		p05loc_62FA
; ---------------------------------------------------------------------------

p05loc_62EF:
		ld		h, 6
		ld		a, (CurTableCol)
		cp		2
		jr		c, p05loc_62FA
		ld		h, 0Ch

p05loc_62FA:
		ld		(curRow), hl
		ret
; End of function p05sub_62DB


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


p05sub_62FE:
		; p05sub_6C47+4Ap
		ld		a, (unk_91DB+1)
		cp		8
		jr		nc, p05loc_630C
		call	CheckSplitFlag
		ret		z
		cp		3
		ret		c

p05loc_630C:
		ld		a, 1
		ld		(unk_91DB+1), a
		ret
; End of function p05sub_62FE


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


p05sub_6312:
		; Page05_3195:p05loc_626Dp ...
		ld		a, (unk_91DB+1)
		dec		a
		sla	a
		ld		b, a
		sla	a
		add		a, b
		add		a, 0Ah
		call	CheckSplitFlag
		jr		z, p05loc_6325
		add		a, 20h ; ' '

p05loc_6325:
		ld		(penCol+1), a
		ld		a, (CurTableCol)
		call	Bit_VertSplit
		jr		nz, p05loc_6344
		sla	a
		ld		b, a
		sla	a
		sla	a
		sla	a
		sla	a
		sub		b
		add		a, 5
		ld		(penCol), a
		jp		VPUTBLANK
; ---------------------------------------------------------------------------

p05loc_6344:
		ld		b, 31h ; '1'
		call	p05sub_6FAE
		jr		z, p05loc_634F
		or		a
		jr		z, p05loc_6354
		dec		a

p05loc_634F:
		or		a
		jr		z, p05loc_6354
		ld		b, 49h ; 'I'

p05loc_6354:
		ld		a, b
		ld		(penCol), a
		jp		VPUTBLANK
; End of function p05sub_6312


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


p05sub_635B:
		; dispTblBot+A0p ...
		ld		hl, 7
		call	Bit_VertSplit
		jr		z, p05loc_636C
		ld		hl, 3830h
		ld		(penCol), hl
		ld		hl, 807h

p05loc_636C:
		ld		(curRow), hl
		ret
; End of function p05sub_635B


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


dispTblBot:




		call	Bit_VertSplit
		jr		z, p05loc_637C
		bit		4, (iy+1Dh)
		jp		z, p05loc_6408

p05loc_637C:
		call	p05sub_635B
		call	p05sub_6891
		jp		z, p05loc_6FDD
		ld		a, (unk_91DB)
		or		a
		jr		nz, p05loc_63DF
		ld		a, (iy+2)
		bit		7, a
		jr		nz, p05loc_63D3
		bit		6, a
		jr		nz, p05loc_63D7
		bit		5, a
		jr		nz, p05loc_63DB
		ld		a, 58h ; 'X'

p05loc_639C:
		; dispTblBot+69j ...
		call	j_PutC
		ld		a, 3Dh ; '='
		call	j_PutC
		call	j_setNumWindow
		call	p05sub_6830
		jr		c, p05loc_63C5
		jr		nz, p05loc_63B2

p05loc_63AE:
		call	j_EraseEOL
		ret
; ---------------------------------------------------------------------------

p05loc_63B2:
		ld		a, 0Eh
		bit		6, (iy+15h)
		jr		nz, p05loc_6402
		call	p05sub_6876
		jr		z, p05loc_6402
		call	p05sub_5663

p05loc_63C2:
		jp		Page05_327F
; ---------------------------------------------------------------------------

p05loc_63C5:
		; dispTblBot+80j
		ld		hl, aError
		ld		a, 48h ; 'H'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		jr		p05loc_63C2
; ---------------------------------------------------------------------------

p05loc_63D3:
		ld		a, 1
		jr		p05loc_639C
; ---------------------------------------------------------------------------

p05loc_63D7:
		ld		a, 54h ; 'T'
		jr		p05loc_639C
; ---------------------------------------------------------------------------

p05loc_63DB:
		ld		a, 5Bh ; '['
		jr		p05loc_639C
; ---------------------------------------------------------------------------

p05loc_63DF:
		call	p05sub_65A8
		call	p05sub_665C
		ld		a, 3Dh ; '='
		call	j_PutC
		call	j_setNumWindow
		call	p05sub_6830
		jr		c, p05loc_63C5
		jr		z, p05loc_63AE
		ld		a, 0Bh
		call	page0_19D
		jr		nz, p05loc_6402
		inc		a
		call	p05sub_5EE1
		jr		nz, p05loc_6402
		inc		a

p05loc_6402:
		; dispTblBot+4Dj ...
		call	p05loc_5665
		jp		Page05_327F
; ---------------------------------------------------------------------------

p05loc_6408:
		call	p05sub_6FB2
		ret		nz
		res		appAutoScroll, (iy+appFlags)
		call	p05sub_635B
		call	j_EraseEOL
		call	p05sub_6891
		jp		z, p05loc_6FF1
		ld		a, (unk_91DB)
		or		a
		jr		nz, p05loc_647B
		ld		a, (iy+2)
		bit		7, a
		jr		nz, p05loc_646F
		bit		6, a
		jr		nz, p05loc_6473
		bit		5, a
		jr		nz, p05loc_6477
		ld		a, 58h ; 'X'

p05loc_6433:
		; dispTblBot+105j ...
		call	p05sub_64AD
		ld		a, 3Dh ; '='
		call	p05sub_64AD
		call	j_setNumWindow
		call	p05sub_6830
		jr		c, p05loc_6461
		jr		nz, p05loc_6449

p05loc_6445:
		call	p05sub_6BD3
		ret
; ---------------------------------------------------------------------------

p05loc_6449:
		ld		a, 9
		call	page0_19D
		jr		nz, p05loc_6451
		inc		a

p05loc_6451:
		bit		6, (iy+15h)
		jr		nz, p05loc_649E
		call	p05sub_6876
		jr		z, p05loc_649E
		call	p05sub_5663

p05loc_645F:
		jr		p05loc_64A1
; ---------------------------------------------------------------------------

p05loc_6461:
		; dispTblBot+11Cj
		ld		hl, aError
		ld		a, 48h ; 'H'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		jr		p05loc_645F
; ---------------------------------------------------------------------------

p05loc_646F:
		ld		a, 1
		jr		p05loc_6433
; ---------------------------------------------------------------------------

p05loc_6473:
		ld		a, 54h ; 'T'
		jr		p05loc_6433
; ---------------------------------------------------------------------------

p05loc_6477:
		ld		a, 5Bh ; '['
		jr		p05loc_6433
; ---------------------------------------------------------------------------

p05loc_647B:
		call	p05sub_652D
		call	p05sub_6671
		ld		a, 3Dh ; '='
		call	p05sub_64AD
		call	j_setNumWindow
		call	p05sub_6830
		jr		c, p05loc_6461
		jr		z, p05loc_6445
		ld		a, 7
		call	page0_19D
		jr		nz, p05loc_649E
		inc		a
		call	p05sub_5EE1
		jr		nz, p05loc_649E
		inc		a

p05loc_649E:
		; dispTblBot+EAj ...
		call	p05loc_5665

p05loc_64A1:
		jp		p05loc_67C4
; End of function dispTblBot

; ---------------------------------------------------------------------------
		call	Bit_VertSplit
		jr		nz, p05sub_64AD
		call	j_PutC
		ret

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


p05sub_64AD:
		; dispTblBot+C8p ...
		call	j_VPutMap
		ret
; End of function p05sub_64AD


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


DispTblTop:
		; p05sub_6C47:p05loc_6201p ...
		ld		a, (winTop)
		ld		l, a
		ld		h, 2
		call	Bit_VertSplit
		jr		z, p05loc_64BE
		ld		h, 9

p05loc_64BE:
		ld		(curRow), hl
		ld		a, (iy+2)
		bit		7, a
		jr		nz, p05loc_64EB
		bit		6, a
		jr		nz, p05loc_64EF
		bit		5, a
		jr		nz, p05loc_650E
		ld		a, 58h ; 'X'

p05loc_64D2:
		; DispTblTop+5Fj
		call	p05sub_6516
		call	p05sub_652D
		ret		z
		call	p05sub_6635
		call	Bit_VertSplit
		ret		nz
		call	j_NEXTEQ
		ret		z

p05loc_64E4:
		set		preClrForMode, (iy+newDispF)
		jp		p05sub_665C
; ---------------------------------------------------------------------------

p05loc_64EB:
		ld		a, 1
		jr		p05loc_64D2
; ---------------------------------------------------------------------------

p05loc_64EF:
		ld		a, 54h ; 'T'
		call	p05sub_6FAE
		call	z, p05sub_6516
		call	p05sub_652D
		ret		z
		call	p05sub_6635
		call	p05sub_6FAE
		jr		nz, p05loc_6507
		call	Bit_VertSplit
		ret		nz

p05loc_6507:
		ld		hl, OP1M
		set		0, (hl)
		jr		p05loc_64E4
; ---------------------------------------------------------------------------

p05loc_650E:
		ld		a, 5Bh ; '['
		jr		p05loc_64D2
; End of function DispTblTop


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


p05sub_6512:
		ld		a, 0Ch
		jr		p05loc_6529
; End of function p05sub_6512


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


p05sub_6516:
		; DispTblTop+43p
		call	j_PutC
; End of function p05sub_6516


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


p05sub_6519:
		ld		a, 6
		call	Bit_VertSplit
		jr		z, p05loc_6529
		ld		a, 0Dh
		call	page0_19D
		jr		z, p05loc_6529
		ld		a, 0Ch

p05loc_6529:
		ld		(curRow+1), a
		ret
; End of function p05sub_6519


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


p05sub_652D:



		call	Bit_VertSplit
		jr		z, p05loc_654B
		bit		editOpen, (iy+editFlags)
		jr		z, p05loc_654B
		call	OP1Set0
		ld		a, 3
		ld		(OP1), a
		ld		hl, (unk_92AF)
		ld		(unk_8479), hl
		ld		a, (unk_92AE)
		or		a
		ret
; ---------------------------------------------------------------------------

p05loc_654B:
		ld		a, (CurTableCol)
		cp		2
		jr		c, p05loc_655C
		call	Bit_VertSplit
		jr		z, p05loc_6569
		ld		a, 1
		ld		(CurTableCol), a

p05loc_655C:
		call	p05sub_65A8
		ld		hl, (unk_8479)
		ld		(unk_92AF), hl
		ld		(unk_92AE), a
		ret
; ---------------------------------------------------------------------------

p05loc_6569:

		call	j_fndallseleq
		ld		a, (unk_91DB)
		call	p05sub_5EE1
		jr		nz, p05loc_657C
; End of function p05sub_652D


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


p05sub_6574:
		call	j_PREVEQ
		call	p05sub_5EDA
		or		a
		ret
; End of function p05sub_6574

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_652D

p05loc_657C:
		srl	a
		jr		c, p05loc_6588
		dec		a
		call	p05sub_6696
		sla	a
		dec		a
		ret
; ---------------------------------------------------------------------------

p05loc_6588:
		inc		a
		call	p05sub_6574
		ret		z
		sla	a
		ret
; END OF FUNCTION CHUNK	FOR p05sub_652D

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


p05sub_6590:
		call	p05sub_5EE1
		ret		z
		ld		hl, 91DBh
		bit		0, (hl)
		ret		z
		inc		(hl)
		ret
; End of function p05sub_6590


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


p05sub_659C:
		; p05sub_6C47:p05loc_6CADp
		call	p05sub_5EE1
		ret		z
		ld		hl, 91DBh
		bit		0, (hl)
		ret		nz
		dec		(hl)
		ret
; End of function p05sub_659C


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


p05sub_65A8:
		call	p05sub_6FB2
		jr		z, p05loc_65C0
		call	j_sDone
		call	p05sub_6DB5
		jr		z, p05loc_65BB
		ld		a, (unk_91CE)
		or		a
		jr		z, locret_65BF

p05loc_65BB:
		ld		a, (curGX2)
		or		a

locret_65BF:
		ret
; ---------------------------------------------------------------------------

p05loc_65C0:
		call	j_fndallseleq
		call	p05sub_688C
		jr		z, p05loc_65C9
		dec		a

p05loc_65C9:
		call	p05sub_5EE1
		jr		z, p05loc_65EB
		srl	a
		call	j_NEXTEQ
		call	p05sub_5EDA
		or		a
		ret		z
		call	p05sub_688C
		jr		nz, p05loc_65DF
		inc		a
		ret
; ---------------------------------------------------------------------------

p05loc_65DF:
		dec		a
		and		1
		ld		hl, OP1M
		or		(hl)
		ld		(hl), a
		call	p05sub_688C
		ret
; ---------------------------------------------------------------------------

p05loc_65EB:
		bit		grfRecurM, (iy+grfModeFlags)
		jr		z, p05loc_662D
		push	af
		call	Page0Call_38E5
		ld		hl, (EQS)
		bit		0, a
		jr		nz, p05loc_65FE
		res		1, (hl)

p05loc_65FE:
		bit		1, a
		jr		nz, p05loc_6604
		res		2, (hl)

p05loc_6604:
		bit		2, a
		jr		nz, p05loc_660A
		res		3, (hl)

p05loc_660A:
		or		a
		jr		z, p05loc_662C
		ld		a, 3
		bit		sequv, (iy+seqFlags)
		jr		nz, p05loc_6623
		add		a, a
		bit		seqvw, (iy+seqFlags)
		jr		nz, p05loc_6623
		dec		a
		bit		sequw, (iy+seqFlags)
		jr		z, p05loc_662C

p05loc_6623:
		ld		hl, 91CEh
		ld		b, a
		and		(hl)
		cp		b
		jp		nz, ErrInvalid

p05loc_662C:
		pop		af

p05loc_662D:
		call	j_NEXTEQ
		call	p05sub_5EDA
		or		a
		ret
; End of function p05sub_65A8


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


p05sub_6635:
		; DispTblTop+4Ap
		push	af
		call	p05sub_664E
		call	p05sub_665C
		call	p05sub_6FAE
		jr		z, p05loc_6646
		call	p05sub_6519
		jr		p05loc_664C
; ---------------------------------------------------------------------------

p05loc_6646:
		call	Bit_VertSplit
		call	z, p05sub_6512

p05loc_664C:
		pop		af
		ret
; End of function p05sub_6635


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


p05sub_664E:
		; Page05_3195+83p ...
		call	Bit_VertSplit
		jr		z, p05loc_6657
		call	page0_19D
		ret		nz

p05loc_6657:
		set		preClrForMode, (iy+newDispF)
		ret
; End of function p05sub_664E


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


p05sub_665C:
		; dispTblBot+72p ...
		ld		de, (unk_8479)
		ld		a, e
		ld		e, d
		ld		d, a
; End of function p05sub_665C


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


p05sub_6663:
		call	j_PutTokString
		call	page0_19D
		ret		z
		ld		hl, unk_2690
		call	j_PutS
		ret
; End of function p05sub_6663


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


p05sub_6671:
		; dispTblBot+C85p
		ld		de, (unk_8479)
		ld		a, e
		ld		e, d
		ld		d, a
		call	j_GetTokLen
		ld		b, a
		inc		hl
		call	j_VPutSN
		call	page0_19D
		ret		z
		ld		hl, unk_2690
		call	j_VPutS
		ret
; End of function p05sub_6671


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


p05sub_668B:




		call	j_fndallseleq
		ld		a, (unk_91DB)
		call	p05sub_5EE1
		jr		nz, p05loc_669E
; End of function p05sub_668B


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


p05sub_6696:
		call	j_NEXTEQ
		call	p05sub_5EDA
		or		a
		ret
; End of function p05sub_6696

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_668B

p05loc_669E:
		bit		0, a
		jr		nz, p05loc_66AC
		srl	a
		call	p05sub_6696
		ret		z
		sla	a
		dec		a
		ret
; ---------------------------------------------------------------------------

p05loc_66AC:
		dec		a
		srl	a
		call	p05sub_6696
		ret		z
		ld		hl, OP1M
		set		0, (hl)
		sla	a
		ret
; END OF FUNCTION CHUNK	FOR p05sub_668B

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


p05sub_66BB:
		ld		hl, (CurTableCol)
		push	hl
		call	p05sub_6FAE
		jr		nz, p05loc_66CB
		ld		de, 91E2h
		xor		a
		call	p05sub_66EA

p05loc_66CB:
		ld		de, 9221h
		ld		a, 1
		call	p05sub_66EA
		call	Bit_VertSplit
		jr		z, p05loc_66DD
		call	p05sub_6FAE
		jr		z, p05loc_66E5

p05loc_66DD:
		ld		de, 9260h
		ld		a, 2
		call	p05sub_66EA

p05loc_66E5:
		pop		hl
		ld		(CurTableCol), hl
		ret
; End of function p05sub_66BB


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


p05sub_66EA:
		ld		(CurTableCol), a
		call	p05sub_5E84
		add		hl, de
		rst		20h
		call	p05loc_6254
		ret
; End of function p05sub_66EA


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


dispTblbody:
		ld		hl, (CurTableCol)
		push	hl
		ld		hl, (unk_91DB)
		push	hl
		call	p05sub_6710
		call	p05sub_6752
		call	p05sub_675A
; End of function dispTblbody

; START	OF FUNCTION CHUNK FOR p05sub_5CF2

p05loc_6707:
		pop		hl
		ld		(unk_91DB), hl
		pop		hl
		ld		(CurTableCol), hl
		ret
; END OF FUNCTION CHUNK	FOR p05sub_5CF2

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


p05sub_6710:



		call	p05sub_6FAE
		ret		nz
		ld		hl, 91E2h
		ld		de, 0

p05loc_671A:
		call	Bit_VertSplit
		jr		nz, p05loc_6782
		ld		b, 7
		bit		grfSplit, (iy+sGrFlags)
		jr		z, p05loc_6729
		ld		b, 2

p05loc_6729:
		ld		ix, (unk_91DB+1)
		push	ix
		ld		(unk_91DB+1), de

p05loc_6733:
		push	bc
		push	hl
		ld		hl, CurTableRow
		inc		(hl)
		call	p05sub_6312
		pop		hl
		rst		20h
		push	hl
		call	p05sub_6834
		jr		c, p05loc_6746
		jr		z, p05loc_6749

p05loc_6746:
		call	p05sub_67EE

p05loc_6749:
		pop		hl
		pop		bc
		djnz	p05loc_6733
		pop		hl
		ld		(unk_91DB+1), hl
		ret
; End of function p05sub_6710


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


p05sub_6752:
		ld		hl, 9221h
		ld		de, 100h
		jr		p05loc_671A
; End of function p05sub_6752


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


p05sub_675A:
		ld		hl, 9260h
		ld		de, 200h
		call	Bit_VertSplit
		jr		z, p05loc_671A
		call	p05sub_6FAE
		jr		nz, p05loc_671A
		ret
; End of function p05sub_675A


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


p05sub_676B:
		ld		hl, 9221h
		ld		de, 100h
		jr		p05loc_6782
; End of function p05sub_676B


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


p05sub_6773:
		ld		hl, 9260h
		ld		de, 200h
		call	Bit_VertSplit
		jr		z, p05loc_6782
		call	p05sub_6FAE
		ret		z
; End of function p05sub_6773

; START	OF FUNCTION CHUNK FOR p05sub_6710

p05loc_6782:
		ld		b, 7
		bit		grfSplit, (iy+sGrFlags)
		jr		z, p05loc_678C
		ld		b, 2

p05loc_678C:
		ld		ix, (unk_91DB+1)
		push	ix
		ld		(unk_91DB+1), de

p05loc_6796:
		push	bc
		push	hl
		ld		hl, CurTableRow
		inc		(hl)
		call	p05sub_6312
		pop		hl
		rst		20h
		push	hl
		call	p05sub_6834
		call	p05sub_67B4
		pop		hl
		pop		bc
		djnz	p05loc_6796
		pop		hl
		ld		(unk_91DB+1), hl
		ret
; END OF FUNCTION CHUNK	FOR p05sub_6710

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


p05sub_67B1:
		; Page05_3195+20p ...
		call	p05sub_6830
; End of function p05sub_67B1


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


p05sub_67B4:



		jr		c, p05loc_67E9
		jr		nz, p05loc_67C1
		sub		a
		ld		(OP3), a
		ld		hl, OP3
		jr		p05loc_67C4
; ---------------------------------------------------------------------------

p05loc_67C1:
		call	p05sub_6825

p05loc_67C4:
		; p05sub_67B4+Bj ...
		res		1, (iy+0Eh)
; End of function p05sub_67B4


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


p05sub_67C8:
		res		textEraseBelow, (iy+textFlags)
		ld		de, (curRow)
		push	de
		ld		a, (hl)
		or		a
		jr		z, p05loc_67E1

p05loc_67D5:
		ld		a, (hl)
		or		a
		jr		z, p05loc_67E1
		call	j_VPutMap
		inc		hl
		jr		nc, p05loc_67D5
		jr		p05loc_67E4
; ---------------------------------------------------------------------------

p05loc_67E1:
		call	p05sub_6B86

p05loc_67E4:
		pop		hl
		ld		(curRow), hl
		ret
; End of function p05sub_67C8

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_67B4

p05loc_67E9:
		ld		hl, aError
		jr		p05loc_67C4
; END OF FUNCTION CHUNK	FOR p05sub_67B4

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


p05sub_67EE:



		jr		c, p05loc_6820
; End of function p05sub_67EE


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


p05sub_67F0:
		call	p05sub_6825
		ld		a, (OP1)
		sub		0Ch
		jr		nz, p05sub_6814
		ld		b, 7
		call	p05sub_6BB9
		jr		z, p05loc_6803
		ld		b, 6

p05loc_6803:
		ld		a, c
		cp		b
		jr		c, p05sub_6814
		sub		a
		ld		(unk_97B6), a
		call	p05sub_6814
		ld		a, 0CEh	; '�'
		call	j_VPutMap
		ret
; End of function p05sub_67F0


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


p05sub_6814:
		res		1, (iy+0Eh)
		res		textEraseBelow, (iy+textFlags)
		call	j_VPutS
		ret
; End of function p05sub_6814

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_67EE

p05loc_6820:
		ld		hl, aError
		jr		p05sub_6814
; END OF FUNCTION CHUNK	FOR p05sub_67EE

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


p05sub_6825:
		; p05sub_67F0p
		call	p05sub_6BB9
		jp		z, p05sub_475E
		ld		a, 5
		jp		p05loc_4760
; End of function p05sub_6825


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


p05sub_6830:
		; dispTblBot+7Dp ...
		call	p05sub_607D
		rst		20h
; End of function p05sub_6830


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


p05sub_6834:
		ld		a, (OP1)
		cp		0FFh
		jr		z, p05loc_684D
		sub		a
		ld		hl, OP1
		ld		bc, 9

p05loc_6842:
		cpi
		jr		nz, p05loc_684A
		cp		c
		jr		nz, p05loc_6842
		ret
; ---------------------------------------------------------------------------

p05loc_684A:
		scf
		ccf
		ret
; ---------------------------------------------------------------------------

p05loc_684D:
		scf
		ret
; End of function p05sub_6834

Page05Table1:
		.dw		p05loc_68AB
		.dw		j_numPPutAway
		.dw		p05loc_57D8
		.dw		j_numRedisp
		.dw		noErrorEntry
		.dw		p05loc_46E3
		.db		0Ah
Page05Table2:
		.dw		p05loc_6AC7
		.dw		j_numPPutAway
		.dw		p05loc_57D8
		.dw		j_numRedisp
		.dw		p05loc_6FC1
		.dw		p05loc_46E3
		.db		0Ah
Page05Table3:
		.dw		p05loc_6C34
		.dw		j_numPPutAway
		.dw		p05loc_57FC
		.dw		j_numRedisp
		.dw		noErrorEntry
		.dw		p05loc_46E3
		.db		0Ah

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


p05sub_6876:
		call	p05sub_6FB2
		jr		nz, p05loc_688A
		bit		autoFill, (iy+tblFlags)
		ret
; End of function p05sub_6876


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


p05sub_6880:
		; p05sub_5CF2:p05loc_5D01p ...
		call	p05sub_6FB2
		jr		nz, p05loc_688A
		bit		autoCalc, (iy+tblFlags)
		ret
; ---------------------------------------------------------------------------

p05loc_688A:
		cp		a
		ret
; End of function p05sub_6880


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


p05sub_688C:
		ld		a, (unk_91DB)
		or		a
		ret
; End of function p05sub_688C


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


p05sub_6891:
		; Page05_3195+6p ...
		ld		a, (unk_91DB+1)
		or		a
		ret
; End of function p05sub_6891


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


p05sub_6896:
		; p05sub_4DDF+176p ...
		ld		hl, 970Bh
		ld		a, (hl)
		jr		p05loc_689F
; ---------------------------------------------------------------------------

p05loc_689C:
		; p05sub_6938:p05loc_6952p ...
		ld		a, (unk_91DB+1)

p05loc_689F:
		bit		grfSplit, (iy+sGrFlags)
		jr		z, p05loc_68A8
		cp		2
		ret
; ---------------------------------------------------------------------------

p05loc_68A8:
		cp		7
		ret
; End of function p05sub_6896

; ---------------------------------------------------------------------------
p05loc_68AB:
Page05_31AD:
		cp		5
		jr		nz, p05loc_68F1
		call	p05sub_688C
		jr		nz, p05loc_68DD
		call	p05sub_6876
		ret		z

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


p05sub_68B8:
		call	Bit_VertSplit
		call	nz, p05loc_637C
		ld		hl, Page05Table2
		call	AppInit
		call	p05sub_635B
		call	j_RecallEd
		res		curLock, (iy+curFlags)
		call	p05sub_6830
		jr		c, p05loc_68D9
		jr		z, p05loc_68D9
		call	Page0Call_3735
		ret
; ---------------------------------------------------------------------------

p05loc_68D9:
		call	Page0Call_3741
		ret
; End of function p05sub_68B8

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

p05loc_68DD:
		call	p05sub_6891
		jp		z, p05sub_6C02
		call	p05sub_6880
		ret		z
		call	p05sub_65A8
		call	nz, p05loc_60A0
		call	p05loc_61E2
		ret
; ---------------------------------------------------------------------------

p05loc_68F1:
		cp		3
		jr		nz, p05loc_6934

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


p05sub_68F5:

		ld		hl, CurTableRow
		ld		a, (hl)
		cp		1
		ret		c
		jr		nz, p05loc_6903
		call	p05sub_688C
		jr		z, p05loc_690D

p05loc_6903:
		call	p05loc_6254
		ld		hl, CurTableRow
		dec		(hl)
		jp		p05loc_61E2
; ---------------------------------------------------------------------------

p05loc_690D:
		call	p05sub_6876
		ret		nz
		call	p05sub_6E04
		ret		c
		call	p05loc_6254
		call	j_TblScreenDn
		call	p05sub_5D81
		ld		hl, TblMin
		rst		20h
		ld		de, 91E2h
		call	MovFrOP1
		call	p05sub_66BB
		call	p05loc_5CFB
		call	p05sub_66BB
		jp		p05loc_61E2
; End of function p05sub_68F5

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

p05loc_6934:
		cp		4
		jr		nz, p05loc_6973

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


p05sub_6938:

		ld		hl, CurTableRow
		call	p05sub_6876
		jr		z, p05loc_6952
		call	p05sub_6240
		ret		c
		call	p05loc_689C
		ret		nc

p05loc_6948:
		call	p05loc_6254
		ld		hl, CurTableRow
		inc		(hl)
		jp		p05loc_61E2
; ---------------------------------------------------------------------------

p05loc_6952:
		call	p05loc_689C
		jr		c, p05loc_6948
		call	p05sub_6DFB
		ret		c
		call	p05loc_6254
		call	j_TblScreenUp
		call	p05sub_5D9C
		call	p05loc_5C80
		call	p05sub_66BB
		call	p05loc_5CFF
		call	p05sub_66BB
		jp		p05loc_61E2
; End of function p05sub_6938

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

p05loc_6973:
		ld		hl, CurTableRow
		cp		0Fh
		jr		z, p05loc_697E
		cp		1
		jr		nz, p05loc_69D9

p05loc_697E:
		call	p05sub_668B
		ret		z
		ld		b, a
		ld		a, (CurTableCol)
		cp		2
		jr		nc, p05loc_69A1
		call	Bit_VertSplit
		jr		z, p05loc_6993
		cp		1
		jr		nc, p05loc_69A1

p05loc_6993:
		call	p05loc_6254
		ld		a, b
		ld		(unk_91DB), a
		ld		hl, CurTableCol
		inc		(hl)
		jp		p05loc_61E2
; ---------------------------------------------------------------------------

p05loc_69A1:
		ld		a, b
		ld		(unk_91DB), a
		call	p05sub_5EE1
		jr		z, p05loc_69C0
		call	p05sub_5CE2
		ld		a, 1
		ld		(CurTableCol), a
		call	p05loc_5F31
		call	p05sub_5F01
		ld		a, 1
		ld		(CurTableCol), a
		jp		p05loc_6201
; ---------------------------------------------------------------------------

p05loc_69C0:
		ld		hl, 9221h
		call	Bit_VertSplit
		jr		nz, p05loc_69CE
		call	p05sub_5D75
		ld		hl, 9260h

p05loc_69CE:
		ld		b, 3Fh ; '?'
		call	p05loc_5CEC
		call	p05loc_5F31
		jp		p05loc_6201
; ---------------------------------------------------------------------------

p05loc_69D9:
		cp		0Eh
		jr		z, p05loc_69E1
		cp		2
		jr		nz, p05loc_6A42

p05loc_69E1:
		call	p05sub_688C
		ret		z
		cp		1
		jr		nz, p05loc_69ED
		call	p05sub_6891
		ret		z

p05loc_69ED:
		call	p05loc_6569
		ld		b, a
		jr		nz, p05loc_69F9
		call	p05sub_6891
		ret		z
		jr		p05loc_6A00
; ---------------------------------------------------------------------------

p05loc_69F9:
		ld		a, (CurTableCol)
		cp		1
		jr		z, p05loc_6A0E

p05loc_6A00:
		call	p05loc_6254
		ld		a, b
		ld		(unk_91DB), a
		ld		hl, CurTableCol
		dec		(hl)
		jp		p05loc_61E2
; ---------------------------------------------------------------------------

p05loc_6A0E:
		ld		a, b
		ld		(unk_91DB), a
		call	p05sub_5EE1
		jr		z, p05loc_6A3A
		call	Bit_VertSplit
		jr		nz, p05loc_6A3A
		call	p05sub_5CE2
		ld		a, 1
		ld		(CurTableCol), a
		ld		hl, 91DBh
		dec		(hl)
		call	p05loc_5F31
		call	p05sub_5F01
		ld		hl, 91DBh
		inc		(hl)
		ld		a, 2
		ld		(CurTableCol), a
		jp		p05loc_6201
; ---------------------------------------------------------------------------

p05loc_6A3A:
		call	p05sub_5D6D
		ld		hl, 9221h
		jr		p05loc_69CE
; ---------------------------------------------------------------------------

p05loc_6A42:
		cp		0Ah
		jr		nz, p05loc_6A5C
		call	p05sub_6876
		ret		z
		call	p05sub_6891
		ret		z
		call	p05sub_6240
		ret		c
		call	p05sub_5E10
		ld		hl, 91E0h
		dec		(hl)
		jp		p05loc_61D3
; ---------------------------------------------------------------------------

p05loc_6A5C:
		cp		0Bh
		jp		nz, p05loc_6A7B
		call	p05sub_6876
		ret		z
		call	p05sub_6891
		ret		z
		call	p05sub_5DB7
		ld		hl, 91E0h
		ld		a, 6
		cp		(hl)
		jr		c, p05loc_6A75
		inc		(hl)

p05loc_6A75:
		call	p05sub_5CF2
		jp		p05loc_61D3
; ---------------------------------------------------------------------------

p05loc_6A7B:
		cp		0Ch
		ret		z
		cp		8Ah ; '�'
		ret		z
		cp		27h ; '''
		jp		z, p05loc_5B1D
		cp		9
		jr		nz, p05loc_6AA9
		push	af
		call	p05sub_688C
		jr		z, p05loc_6ABE
		call	p05sub_6891
		jp		z, p05loc_6C30
		call	p05sub_6880
		jr		z, p05loc_6ABC
		call	p05sub_6056
		call	p05sub_607D
		call	p05loc_5CEA
		call	p05loc_61E2
		jr		p05loc_6ABC
; ---------------------------------------------------------------------------

p05loc_6AA9:
		cp		0Dh
		jr		z, p05loc_6AB0
		cp		5Ah ; 'Z'
		ret		c

p05loc_6AB0:
		push	af
		call	p05sub_688C
		jr		z, p05loc_6ABE
		call	p05sub_6891
		jp		z, p05loc_6C30

p05loc_6ABC:
		pop		af
		ret
; ---------------------------------------------------------------------------

p05loc_6ABE:
		call	p05sub_6876
		jr		z, p05loc_6ABC
		call	p05sub_68B8
		pop		af
p05loc_6AC7:
		cp		5
		jr		z, p05loc_6ACF
		cp		4
		jr		nz, p05loc_6AF8

p05loc_6ACF:
		call	IsEditEmpty
		jr		nz, p05loc_6AD9
		call	closeEditBuf
		jr		p05loc_6ADF
; ---------------------------------------------------------------------------

p05loc_6AD9:
		call	p05sub_6B36
		call	p05sub_5CF2

p05loc_6ADF:
		call	p05sub_5B6F
		call	p05sub_66BB
		call	p05loc_689C
		jr		nc, p05loc_6AF2
		call	p05sub_6240
		call	c, Page05_3195
		jr		p05loc_6AF5
; ---------------------------------------------------------------------------

p05loc_6AF2:
		call	p05loc_61E2

p05loc_6AF5:
		jp		p05sub_6938
; ---------------------------------------------------------------------------

p05loc_6AF8:
		cp		3
		jr		nz, p05loc_6B25
		call	IsEditEmpty
		jr		nz, p05loc_6B0E
		call	closeEditBuf
		ld		a, (unk_91DB+1)
		cp		2
		call	c, dispTblBot
		jr		p05loc_6B14
; ---------------------------------------------------------------------------

p05loc_6B0E:
		call	p05sub_6B36
		call	p05sub_5CF2

p05loc_6B14:
		call	p05sub_5B6F
		call	p05sub_66BB
		ld		a, (unk_91DB+1)
		cp		2
		call	c, Page05_3195
		jp		p05sub_68F5
; ---------------------------------------------------------------------------

p05loc_6B25:
		bit		enableQueue, (iy+rclFlag)
		jr		nz, p05loc_6B2E
		cp		8Ah ; '�'
		ret		z

p05loc_6B2E:
		cp		27h ; '''
		jp		nz, j_CallCommon
		jp		p05loc_5B1D

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


p05sub_6B36:

		call	IsEditEmpty
		jr		nz, p05loc_6B3E
		inc		sp
		inc		sp
		ret
; ---------------------------------------------------------------------------

p05loc_6B3E:
		ld		hl, 615h
		call	pushErrorHandleR
		call	p05sub_6B60
		call	p05sub_6248
		jr		c, p05loc_6B4F
		jr		z, p05loc_6B4F
		inc		(hl)

p05loc_6B4F:
		call	dispTblBot
		call	popErrorHandleR
		ret
; End of function p05sub_6B36


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


p05sub_6B56:
		call	p05sub_6B60
		call	p05sub_6248
		ret		c
		ret		z
		inc		(hl)
		ret
; End of function p05sub_6B56


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


p05sub_6B60:
		call	zero_basic_prog
		call	parseEditBuf
		bit		5, (iy+5)
		ret		z
		call	EOP1NotReal
		bit		grfRecurM, (iy+grfModeFlags)
		call	nz, ErrD_OP1NotPosInt
		call	p05sub_6077
		call	p05sub_607D
		ex		de, hl
		call	MovFrOP1
		call	j_releaseBuffer
		call	p05sub_5E9F
		ret
; End of function p05sub_6B60


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


p05sub_6B86:
		; p05sub_5409+1Bj	...



		call	p05sub_6BB9
		jr		nz, p05loc_6BC6
		ld		a, (penCol)
		sub		1Eh
		jr		c, p05loc_6B9B
		ret		z
		sub		1Eh
		jr		c, p05loc_6B9B
		ret		z
		sub		1Eh
		ret		nc

p05loc_6B9B:
		neg
		ld		b, a
		dec		b
		jr		z, VPUTBLANK

p05loc_6BA1:
		ld		a, b
		sub		4
		jr		c, p05loc_6BAC
		ld		b, a
		inc		b
		ld		a, 6
		jr		p05loc_6BAE
; ---------------------------------------------------------------------------

p05loc_6BAC:
		ld		a, 20h ; ' '

p05loc_6BAE:
		call	j_VPutMap
		djnz	p05loc_6BA1
; End of function p05sub_6B86

; START	OF FUNCTION CHUNK FOR p05sub_42F9

VPUTBLANK:
		ld		a, 20h ; ' '
		call	j_VPutMap
		ret
; END OF FUNCTION CHUNK	FOR p05sub_42F9

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


p05sub_6BB9:
		call	Bit_VertSplit
		ret		z
		ld		a, (mcxCurApp)
		cp		43h ; 'C'
		ret		z
		cp		42h ; 'B'
		ret
; End of function p05sub_6BB9

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p05sub_6B86

p05loc_6BC6:
		ld		a, (penCol)
		sub		46h ; 'F'
		jr		c, p05loc_6B9B
		ret		z
		sub		19h
		jr		c, p05loc_6B9B
		ret		nc
; END OF FUNCTION CHUNK	FOR p05sub_6B86

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


p05sub_6BD3:
		ld		a, (penCol)
		sub		5Fh ; '_'
		jr		c, p05loc_6B9B
		ret
; End of function p05sub_6BD3


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


p05sub_6BDB:
		ex		de, hl

p05loc_6BDC:
		push	de
		call	j_BUFPEEK2
		jr		z, p05loc_6BEF
		inc		hl
		push	hl
		call	j_GETTOKSTRING
		call	j_wputps
		pop		hl
		pop		de
		ret		c
		jr		p05loc_6BDC
; ---------------------------------------------------------------------------

p05loc_6BEF:
		pop		de
		ld		a, (curRow)
		cp		8
		jr		c, p05loc_6BFE
		ld		hl, 0F07h
		ld		(curRow), hl
		ret
; ---------------------------------------------------------------------------

p05loc_6BFE:
		call	j_EraseEOL
		ret
; End of function p05sub_6BDB


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


p05sub_6C02:

		call	Bit_VertSplit
		call	nz, p05loc_637C
		ld		hl, Page05Table3
		call	AppInit
		call	p05sub_635B
		res		curLock, (iy+curFlags)
		call	p05sub_65A8
		ld		a, (unk_8479+1)
		ld		(unk_9813), a
		call	j_EditEqu
		call	Page0Call_37AD
		call	Page0Call_37A7
		res		0, (iy+13h)
		res		5, (iy+5)
		ret
; End of function p05sub_6C02

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

p05loc_6C30:
		call	p05sub_6C02
		pop		af
p05loc_6C34:
		res		7, (iy+15h)
		bit		0, (iy+13h)
		jp		nz, p05loc_6DC0
		cp		5
		jp		nz, p05loc_6D15
		jp		p05loc_6D19

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


p05sub_6C47:




		call	p05sub_6D9C
		ld		hl, (editSym)
		bit		5, (hl)
		jp		nz, p05loc_6CEC
		call	p05sub_6DB5
		jp		nz, p05loc_6CEC
		call	p05sub_6590
		call	p05sub_668B
		jr		z, p05loc_6CAD
		ld		(unk_91DB), a

p05loc_6C63:
		ld		a, (CurTableCol)
		cp		2
		jr		c, p05loc_6C75
		call	p05sub_5CE2
		call	p05sub_6590
		call	p05sub_5EE6
		jr		p05loc_6CA0
; ---------------------------------------------------------------------------

p05loc_6C75:
		call	p05sub_5CE2
		call	p05sub_659C
		ld		a, (unk_91DB)
		push	af
		call	p05loc_5F31
		call	p05sub_5F01
		pop		af
		ld		(unk_91DB), a
		ld		a, 1
		ld		(CurTableCol), a

p05loc_6C8E:
		call	p05sub_5B6F
		call	p05sub_62FE
		call	p05sub_61E9
		call	DispTblTop
		call	Page05_324F
		jp		dispTblbody
; ---------------------------------------------------------------------------

p05loc_6CA0:
		ld		hl, 9260h
		ld		b, 3Fh ; '?'
		call	p05loc_5CEC
		call	p05loc_5F31
		jr		p05loc_6D0C
; ---------------------------------------------------------------------------

p05loc_6CAD:
		call	p05sub_659C
		call	p05loc_6569
		ld		(unk_91DB), a
		jr		nz, p05loc_6CC1
		call	p05sub_5B6F
		call	p05sub_6FD8
		jp		p05loc_5B5C
; ---------------------------------------------------------------------------

p05loc_6CC1:
		call	p05sub_5EE1
		jr		nz, p05loc_6C63
		ld		a, (CurTableCol)
		cp		1
		jr		z, p05loc_6CDF
		ld		hl, 9260h
		ld		b, 3Fh ; '?'
		call	p05loc_5CEC
		ld		a, 1
		ld		(CurTableCol), a
		call	p05loc_5F31
		jr		p05loc_6CEA
; ---------------------------------------------------------------------------

p05loc_6CDF:
		ld		hl, 9221h
		ld		b, 3Fh ; '?'
		call	p05loc_5CEC
		call	p05loc_5F31

p05loc_6CEA:
		jr		p05loc_6C8E
; ---------------------------------------------------------------------------

p05loc_6CEC:
		bit		5, (iy+5)
		jr		z, p05loc_6D12
		ld		a, (CurTableCol)
		cp		2
		jr		c, p05loc_6D01
		call	p05loc_5F31
		call	p05sub_5EE6
		jr		p05loc_6D0C
; ---------------------------------------------------------------------------

p05loc_6D01:
		call	p05loc_5F31
		call	p05sub_5F01
		ld		a, 1
		ld		(CurTableCol), a

p05loc_6D0C:
		call	p05sub_5B6F
		jp		p05loc_6201
; ---------------------------------------------------------------------------

p05loc_6D12:
		jp		p05sub_5B6F
; End of function p05sub_6C47

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

p05loc_6D15:
		cp		4
		jr		nz, p05loc_6D24

p05loc_6D19:
		call	p05sub_6C47
		ld		a, (unk_91DB)
		or		a
		ret		z
		jp		p05sub_6938
; ---------------------------------------------------------------------------

p05loc_6D24:
		cp		3
		ret		z
		cp		2
		jp		nz, p05loc_6D43
		res		textInsMode, (iy+textFlags)
		call	j_BufLeft
		jp		nz, j_CommonKeys
		res		6, (iy+5)
		set		0, (iy+13h)
		ld		hl, curCol
		dec		(hl)
		ret
; ---------------------------------------------------------------------------

p05loc_6D43:
		cp		0Ch
		jr		nz, p05loc_6D5D
		ld		hl, (editSym)
		ld		a, (hl)
		and		1Fh
		ld		(equ_edit_save), a
		ld		a, (hl)
		and		0E0h ; '�'
		or		0Ah
		ld		(hl), a
		set		7, (iy+15h)
		jp		j_RCLREGEQ_CALL
; ---------------------------------------------------------------------------

p05loc_6D5D:
		bit		enableQueue, (iy+rclFlag)
		jr		nz, p05loc_6D66
		cp		8Ah ; '�'
		ret		z

p05loc_6D66:
		cp		27h ; '''
		jr		nz, p05loc_6D70
		call	p05loc_57FC
		jp		Page05_3A41
; ---------------------------------------------------------------------------

p05loc_6D70:
		call	j_ProcessBufKeys
		cp		9
		jr		nz, p05loc_6D7D
		ld		c, 0

p05loc_6D79:
		call	j_AutoSelect
		ret
; ---------------------------------------------------------------------------

p05loc_6D7D:
		cp		0Dh
		jp		nz, p05loc_6D89

p05loc_6D82:
		call	SetGraphDraw
		ld		c, 1
		jr		p05loc_6D79
; ---------------------------------------------------------------------------

p05loc_6D89:
		cp		0Ah
		jr		nz, p05loc_6D94
		bit		5, (iy+5)
		ret		z
		jr		p05loc_6D82
; ---------------------------------------------------------------------------

p05loc_6D94:
		cp		5Ah ; 'Z'
		ret		c
		cp		3Eh ; '>'
		ret		z
		jr		p05loc_6D82

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


p05sub_6D9C:
		ld		hl, (editSym)
		call	p05sub_6DB5
		jr		nz, p05loc_6DA8
		bit		5, (hl)
		jr		z, p05loc_6DAE

p05loc_6DA8:
		bit		5, (iy+5)
		jr		z, p05loc_6DB1

p05loc_6DAE:
		call	p05sub_6FD8

p05loc_6DB1:
		call	j_closeEquField
		ret
; End of function p05sub_6D9C


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


p05sub_6DB5:
		; p05sub_65A8+8p ...
		bit		grfRecurM, (iy+grfModeFlags)
		ret		z
		ld		a, (iy+0Fh)
		and		1Ch
		ret
; End of function p05sub_6DB5

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

p05loc_6DC0:
		cp		5
		jr		nz, p05loc_6DD6
		set		5, (iy+5)
		ld		hl, (editSym)
		ld		c, 1
		bit		5, (hl)
		jr		z, p05loc_6DD2
		dec		c

p05loc_6DD2:
		call	j_AutoSelect
		ret
; ---------------------------------------------------------------------------

p05loc_6DD6:
		cp		1
		jr		nz, p05loc_6DE3
		res		0, (iy+13h)

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


p05sub_6DDE:
		ld		hl, curCol
		inc		(hl)
		ret
; End of function p05sub_6DDE

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

p05loc_6DE3:
		cp		4
		ret		nz
		call	p05sub_6DDE
		jp		p05loc_6D19

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


p05sub_6DEC:

		ld		de, 8622h
		call	OPSet0DE
		ld		hl, TblMin
		ld		de, 862Bh
		jp		mov9B2
; End of function p05sub_6DEC


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


p05sub_6DFB:
		ld		hl, 8622h
		rst		20h
		call	Plus1
		jr		p05loc_6E0B
; End of function p05sub_6DFB


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


p05sub_6E04:
		ld		hl, 8622h
		rst		20h
		call	Minus1

p05loc_6E0B:

		ld		hl, {+}
		call	pushErrorHandleR
		call	CkValidNum
		call	OP1ToOP5
		ld		hl, TblStep
		call	Mov9ToOP2
		call	FPMult
		call	p05sub_6FB2
		call	nz, j_RndGuard
		ld		hl, 862Bh
		call	Mov9ToOP2
		rst		30h
		call	CkValidNum
		ld		a, 1Ah
		call	j_StoSysTok
		ld		hl, OP5
		ld		de, 8622h
		call	mov9B2
		call	popErrorHandleR
		or		a
		ret
+:		scf
		ret
TBLTRACE:
		call	Bit_VertSplit
		ret		z
		bit		7, (iy+19h)
		ret		nz
		ld		a, (curPlotNumber)
		or		a
		ret		nz
		bit		allowProgTokens, (iy+newDispF)
		jr		z, p05loc_6E5D
		res		appTextSave, (iy+appFlags)

p05loc_6E5D:
		call	p05sub_620C
		bit		3, (iy+27h)
		jr		nz, p05loc_6EB1
		bit		0, (iy+27h)
		jr		nz, p05loc_6EAC
		call	p05sub_6FB2
		jr		z, p05loc_6EB1
		bit		1, (iy+1Fh)
		jr		nz, p05loc_6E9F
		ld		b, 1
		call	IsFunctionMode
		jr		z, p05loc_6E89
		ld		a, (Xres_int)
		or		a
		jr		z, p05loc_6E89
		cp		9
		jr		nc, p05loc_6E89
		ld		b, a

p05loc_6E89:
		push	bc
		bit		2, (iy+27h)
		jr		nz, p05loc_6E99
		bit		1, (iy+27h)
		call	nz, p05sub_6938
		jr		p05loc_6E9C
; ---------------------------------------------------------------------------

p05loc_6E99:
		call	p05sub_68F5

p05loc_6E9C:
		pop		bc
		djnz	p05loc_6E89

p05loc_6E9F:
		set		appTextSave, (iy+appFlags)
		jp		settblrefs

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


p05sub_6EA6:
		ld		de, TblStep
		jp		mov9B2
; End of function p05sub_6EA6

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

p05loc_6EAC:
		call	p05sub_6FB2
		jr		nz, p05loc_6EF0

p05loc_6EB1:
		call	p05sub_6FB7
		call	IsFunctionMode
		jr		nz, p05loc_6EE1
		call	page0_19D
		jr		nz, p05loc_6ED9
		call	page0_198
		jr		nz, p05loc_6ECE
		ld		hl, Tstep
		call	p05sub_6EA6
		ld		hl, TminPar
		jr		p05loc_6EEA
; ---------------------------------------------------------------------------

p05loc_6ECE:
		ld		hl, ThetaStep
		call	p05sub_6EA6
		ld		hl, ThetaMin
		jr		p05loc_6EEA
; ---------------------------------------------------------------------------

p05loc_6ED9:
		ld		hl, PlotStep
		call	p05sub_6EA6
		jr		p05loc_6EF0
; ---------------------------------------------------------------------------

p05loc_6EE1:
		ld		hl, deltaX
		call	p05sub_6EA6
		ld		hl, 8E6Ah

p05loc_6EEA:
		ld		de, 862Bh
		call	mov9B2

p05loc_6EF0:
		ld		hl, (curRow)
		push	hl
		call	p05sub_635B
		call	j_EraseEOL
		pop		hl
		ld		(curRow), hl
		call	p05sub_5EDA
		call	page0_19D
		jr		z, p05loc_6F45
		ld		hl, 75h	; 'u'
		call	AllocFPS1
		ld		bc, 36h	; '6'
		or		a
		sbc		hl, de
		ex		de, hl
		ld		hl, un1
		ldir
		ld		hl, 91D0h
		call	mov9B2
		ld		bc, 36h	; '6'
		ld		hl, 8E2Dh
		ldir
		ld		hl, (unk_84E9)
		push	hl
		call	j_RclN
		call	PushRealO1
		bit		7, (iy+0)
		jr		z, p05loc_6F3A
		ld		hl, 8D21h
		rst		20h

p05loc_6F3A:
		ld		de, 862Bh
		call	MovFrOP1
		call	OP1Set0
		jr		p05loc_6F48
; ---------------------------------------------------------------------------

p05loc_6F45:
		call	p05sub_6F87

p05loc_6F48:
		call	p05loc_6E0B
		call	settblrefs
		call	p05sub_6FD8
		call	p05sub_5BE9
		set		appTextSave, (iy+appFlags)
		call	page0_19D
		jr		z, p05loc_6F83
		call	PopRealO1
		call	j_StoN
		ld		de, 75h	; 'u'
		ld		bc, 36h	; '6'
		call	DeallocFPS1
		ld		de, un1
		ldir
		ld		de, 91D0h
		call	mov9B2
		ld		bc, 36h	; '6'
		ld		de, 8E2Dh
		ldir
		pop		hl
		ld		(unk_84E9), hl

p05loc_6F83:
		call	j_fndallseleq
		ret

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


p05sub_6F87:
		ld		a, (curInc)
		bit		7, (iy+0)
		jr		z, p05loc_6F93
		ld		a, (unk_8E2B)

p05loc_6F93:
		bit		7, (iy+17h)
		jr		z, p05loc_6F9B
		neg

p05loc_6F9B:
		ld		l, a
		ld		h, 0
		call	j_SetXXXXOP2
		bit		7, (iy+17h)
		call	nz, InvOP2S
		ld		hl, 8E73h
		rst		20h
		rst		30h
		ret
; End of function p05sub_6F87


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


p05sub_6FAE:
		call	p05sub_5EE1
		ret		z
; End of function p05sub_6FAE


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


p05sub_6FB2:
		bit		4, (iy+27h)
		ret
; End of function p05sub_6FB2


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


p05sub_6FB7:
		set		4, (iy+27h)
		ret
; End of function p05sub_6FB7


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


p05sub_6FBC:
		res		4, (iy+27h)
		ret
; End of function p05sub_6FBC

p05loc_6FC1:
		set		4, (iy+1Dh)
		call	Page0Call_37FB
		res		4, (iy+1Dh)
		ret

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


p05sub_6FCD:

		call	p05sub_6FB2
		ret		z
		call	p05sub_6FBC
		set		7, (iy+1Dh)
; End of function p05sub_6FCD


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


p05sub_6FD8:
		; p05sub_6C47+74p	...
		set		reTable, (iy+tblFlags)
		ret
; End of function p05sub_6FD8

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR dispTblBot

p05loc_6FDD:
		call	p05sub_65A8
		ret		z
		ld		a, (unk_8479+1)
		call	j_DispYPrompt2
		call	j_setNumWindow
		call	j_setupdispeq
		call	p05sub_6BDB
		ret
; ---------------------------------------------------------------------------

p05loc_6FF1:
		call	p05sub_652D
		ret		z
		call	p05sub_6671
		rst		10h
		ld		a, 3Dh ; '='
		call	j_VPutMap
		call	j_setupdispeq
		ex		de, hl

p05loc_7002:
		push	de
		call	j_BUFPEEK2
		jr		z, p05loc_7017
		inc		hl
		push	hl
		call	j_GetTokLen
		ld		b, a
		inc		hl
		call	j_vputsnT
		pop		hl
		pop		de
		ret		nc
		jr		p05loc_7002
; ---------------------------------------------------------------------------

p05loc_7017:
		pop		de
		ret
; END OF FUNCTION CHUNK	FOR dispTblBot
; ---------------------------------------------------------------------------

Page05_367B:
		ld		hl, p05loc_7239
		call	AppInit
		ld		hl, p05loc_7897
		call	CheckSplitFlag
		jr		z, p05loc_702A
		ld		hl, p05loc_78B5

p05loc_702A:
		ld		a, 3
		call	p05sub_71F3
		xor		a
		ld		(unk_97A2), a
		jp		p05sub_72F9
; ---------------------------------------------------------------------------

Page05_3A83:
		ld		a, (keyExtend)
		ld		(unk_92FC), a
		ld		hl, p05loc_7239
		call	AppInit
		set		grfSplitOverride, (iy+sGrFlags)

p05loc_7046:
		call	p05sub_7113
		ld		a, 3
		ld		(unk_97A2), a
		call	p05sub_72F9

p05loc_7051:
		call	p05sub_70E1
		call	BCALL_4FA2
		cp		5
		jr		nz, p05loc_7069
		ld		hl, 0A04h
		ld		a, 2Ch ; ','
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		jr		p05loc_7075
; ---------------------------------------------------------------------------

p05loc_7069:
		ld		hl, 604h
		ld		a, 2Dh ; '-'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook

p05loc_7075:
		ld		(curRow), hl
		ld		a, 0
		call	p05sub_70AC
		ld		hl, 605h
		ld		(curRow), hl
		call	BCALL_4FA2
		cp		5
		ret		z
		call	BCALL_4FA2
		jr		nc, p05loc_709B
		ld		a, 2Eh ; '.'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		ld		a, 1
		jr		p05sub_70AC
; ---------------------------------------------------------------------------

p05loc_709B:
		ld		hl, 505h
		ld		a, 2Fh ; '/'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		ld		(curRow), hl
		ld		a, 2

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


p05sub_70AC:
		ld		hl, 92C9h
		call	p05sub_519C
		call	p05loc_7104
; End of function p05sub_70AC


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


dispListNameY:
		ld		a, (hl)
		cp		6
		jr		c, p05loc_70D3
		cp		40h ; '@'
		jr		z, p05loc_70C2
		call	j_dispListName
		ret
; ---------------------------------------------------------------------------

p05loc_70C2:
		ld		hl, aIdlist
		ld		a, 3Dh ; '='
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	j_PutS
		jr		p05loc_70DD
; ---------------------------------------------------------------------------

p05loc_70D3:
		inc		a
		sla	a
		ld		e, a
		call	p05sub_755C
		call	putsm

p05loc_70DD:
		call	j_EraseEOL
		ret
; End of function dispListNameY


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


p05sub_70E1:

		ld		a, (unk_97A1)
		ld		b, a
		ld		ix, (unk_979F)

p05loc_70E9:
		or		a
		call	p05sub_74B8
		ld		de, 0Ah
		add		ix, de
		djnz	p05loc_70E9
		ret
; End of function p05sub_70E1

; ---------------------------------------------------------------------------
p05loc_70F5:
Page05_313B:
		ld		hl, (curRow)
		push	hl
		call	p05sub_70E1
		pop		hl
		ld		(curRow), hl
p05loc_7100:
		ret

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


p05sub_7101:
		ld		hl, 92C9h

p05loc_7104:
		ld		de, 11h
		ld		a, (unk_92FC)
		or		a
		jr		z, p05loc_7111
		ld		b, a

p05loc_710E:
		add		hl, de
		djnz	p05loc_710E

p05loc_7111:
		inc		hl
		ret
; End of function p05sub_7101


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


p05sub_7113:

		ld		a, 0
		ld		(winTop), a
		call	j_HomeUp
		call	j_ClrScrnFull
		ld		hl, 2
		ld		(curRow), hl
		ld		hl, p05loc_795E
		ld		a, 21h ; '!'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	putsm
		call	p05sub_76BF
		ld		a, 1
		ld		(unk_92C6), a
		call	p05sub_76BF
		call	BCALL_4FA2
		cp		5
		jr		nz, p05loc_717D
		ld		hl, 92C6h
		dec		(hl)
		ld		hl, p05loc_7919
		ld		a, 22h ; '"'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		ld		hl, p05loc_7924
		ld		a, 23h ; '#'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		ld		hl, p05loc_7951
		ld		a, 24h ; '$'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		ld		hl, p05loc_76DF
		ld		a, 10h
		jr		p05sub_71F3
; ---------------------------------------------------------------------------

p05loc_717D:
		ld		hl, p05loc_7912
		ld		a, 25h ; '%'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		call	BCALL_4FA2
		jr		nc, p05loc_71B6
		ld		hl, p05loc_792F
		ld		a, 26h ; '&'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		ld		hl, p05loc_7951
		ld		a, 24h ; '$'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		ld		hl, p05loc_777F
		ld		a, 0Eh
		jr		p05sub_71F3
; ---------------------------------------------------------------------------

p05loc_71B6:
		cp		2
		jr		nz, p05loc_71DF
		ld		hl, p05loc_7939
		ld		a, 27h ; '''
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		ld		hl, p05loc_7951
		ld		a, 24h ; '$'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		ld		hl, p05loc_780B
		ld		a, 0Eh
		jr		p05sub_71F3
; ---------------------------------------------------------------------------

p05loc_71DF:
		ld		hl, p05loc_7939
		ld		a, 27h ; '''
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76BC
		ld		hl, p05loc_780B
		ld		a, 0Bh
; End of function p05sub_7113


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


p05sub_71F3:
		ld		(unk_979F), hl
		ld		(unk_97A1), a
		ret
; End of function p05sub_71F3


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


BCALL_4FA2:
		call	p05sub_7101
		dec		hl
		ld		a, (hl)
		and		0Fh
		cp		2
		ret
; End of function BCALL_4FA2

; ---------------------------------------------------------------------------
		ret
p05loc_7205:
		res		saIndic, (iy+newIndicFlags)
		res		grfSplitOverride, (iy+sGrFlags)
		jr		p05sub_722B
p05loc_720F:
		res		grfSplitOverride, (iy+sGrFlags)
		set		monAbandon, (iy+monFlags)
		ld		hl, p05loc_7223
		call	pushErrorHandleR
		call	Page05_3435
		call	popErrorHandleR
p05loc_7223:
		res		monAbandon, (iy+monFlags)
		res		6, (iy+5)

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


p05sub_722B:
		call	page0_740
		ret
; End of function p05sub_722B

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

Page05_3141:
		ld		hl, (mcxMain)
		ld		de, p05loc_7246
		or		a
		sbc		hl, de
		ret
p05loc_7239:
		.dw		p05loc_7246
		.dw		p05loc_7100
		.dw		p05loc_7205
		.dw		p05loc_76DA
		.dw		p05loc_70F5
		.dw		p05loc_7100
		.db		42h
p05loc_7246:
		cp		27h ; '''
		jr		nz, p05loc_7256
		ld		a, (mcxCurApp)
		cp		49h ; 'I'
		ret		z
		call	p05sub_722B
		jp		Page05_3A83
; ---------------------------------------------------------------------------

p05loc_7256:
		ld		ix, (unk_97A3)
		ld		b, a
		ld		a, 4
		bit		4, (iy+36h)
		call	nz, Page0Call_3123
		ld		a, b
		cp		6
		jr		z, p05loc_726D
		cp		5
		jr		nz, p05loc_72BE

p05loc_726D:
		ld		a, (mcxCurApp)
		cp		49h ; 'I'
		jp		nz, p05loc_727D
		call	p05sub_7583
		ld		a, (hl)
		xor		1
		jr		p05loc_72B1
; ---------------------------------------------------------------------------

p05loc_727D:
		call	p05sub_756B
		ret		z
		call	p05sub_7298
		ld		a, (ix+8)
		cp		2
		jr		z, p05loc_7292
		cp		68h ; 'h'
		jp		z, p05loc_7046
		jr		p05loc_7295
; ---------------------------------------------------------------------------

p05loc_7292:
		call	p05sub_7113

p05loc_7295:
		jp		p05loc_7051

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


p05sub_7298:
		call	p05sub_7583
		jr		nc, p05loc_72A9
		ld		a, 0Fh
		and		(hl)
		ld		(hl), a
		ld		a, (ix+9)
		call	ShLAcc
		jr		p05loc_72B0
; ---------------------------------------------------------------------------

p05loc_72A9:
		ld		a, 0F0h	; '�'
		and		(hl)
		ld		(hl), a
		ld		a, (ix+9)

p05loc_72B0:
		or		(hl)

p05loc_72B1:
		ld		(hl), a
		bit		7, (ix+6)
		ret		z
; End of function p05sub_7298


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


p05sub_72B7:
		set		smarter_test, (iy+smartFlags)
		jp		SetGraphDraw
; End of function p05sub_72B7

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

p05loc_72BE:
		cp		1
		jp		c, p05loc_74AD
		cp		5
		jp		nc, p05loc_74AD
		dec		a
		ld		e, a
		ld		d, 0
		add		ix, de
		ld		a, (ix+0)
		cp		0FFh
		jr		nz, p05loc_72DF
		call	page0_19D
		jp		z, j_JForceYEqu
		call	Page0Call_3129
		ret
; ---------------------------------------------------------------------------

p05loc_72DF:
		ld		(unk_97A2), a
		cp		0FEh ; '�'
		jr		nz, p05sub_72F9
		ld		a, e
		cp		3
		jr		nz, p05loc_72EF
		ld		a, 0
		jr		p05loc_72F2
; ---------------------------------------------------------------------------

p05loc_72EF:
		ld		a, (unk_92C6)

p05loc_72F2:
		ld		(unk_92C5), a
		res		2, a
		jr		p05loc_731D

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


p05sub_72F9:
		ld		a, (unk_97A2)
		ld		l, a
		ld		h, 0
		ld		e, l
		ld		d, h
		add		hl, hl
		add		hl, hl
		add		hl, hl
		add		hl, de
		add		hl, de
		ld		de, (unk_979F)
		add		hl, de
		ld		(unk_97A3), hl
		push	hl
		pop		ix
		ret
; End of function p05sub_72F9

p05loc_7312:
		cp		27h ; '''
		jp		nz, Page05_342F
		call	p05sub_722B
		jp		Page05_3A83
; ---------------------------------------------------------------------------

p05loc_731D:
		ld		hl, p05loc_7312
		ld		(mcxMain), hl
		ld		hl, p05loc_720F
		ld		(mcxPutAway), hl
		xor		a
		ld		(winLeftEdge), a
		set		6, (iy+5)
; START	OF FUNCTION CHUNK FOR p05sub_735E

p05loc_7331:
		res		appCurWord, (iy+appFlags)
		call	j_CATALOGCHK
		ld		hl, 84CCh
		ld		(editTail), hl
		ld		(editBtm), hl
		call	p05sub_7429
		call	p05sub_7466
		call	NameToBuf
		call	j_RstrSomeFlags
		call	p05sub_7429
		call	CurNameLength
		ld		hl, (editCursor)
		add		hl, bc
		ld		(editCursor), hl
		call	j_BufToTop
		ret
; END OF FUNCTION CHUNK	FOR p05sub_735E

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


p05sub_735E:



		call	p05sub_7466
		ld		de, nameBuff
		ld		b, 0
		ld		c, 4

p05loc_7368:
		ld		a, (de)
		cp		5Dh ; ']'
		jr		z, p05loc_7376
		cp		(hl)
		call	nz, p05sub_72B7
		cp		0
		jr		z, p05loc_737A
		inc		hl

p05loc_7376:
		inc		de
		dec		c
		jr		nc, p05loc_7368

p05loc_737A:
		ld		a, (nameBuff)
		cp		31h ; '1'
		jr		z, p05loc_7394
		ld		hl, nameBuff
		ld		a, (hl)
		cp		5Dh ; ']'
		jr		nz, p05loc_738A
		inc		hl

p05loc_738A:
		call	p05loc_5533
		rst		10h
		ld		hl, 0
		call	c, CreateRList

p05loc_7394:
		ld		b, 0
		ld		c, 5
		call	p05sub_7466
		ld		de, nameBuff
		ex		de, hl
		ld		a, (hl)
		cp		5Dh ; ']'
		jr		nz, p05loc_73A6
		inc		hl
		dec		c

p05loc_73A6:
		ldir
		call	p05sub_7429
		call	p05sub_7466
		bit		monAbandon, (iy+monFlags)
		ret		nz
		call	dispListNameY
		call	BCALL_4F9F
		jr		nz, p05loc_73DD
		ld		a, (unk_92C6)
		cp		1
		ld		a, (unk_92C5)
		jr		nz, p05loc_73D4
		bit		2, a
		jr		nz, p05loc_73D4
		call	BCALL_4FA2
		jr		c, p05loc_73FA
		cp		2
		jr		nz, p05loc_73E6
		jr		p05loc_73FA
; ---------------------------------------------------------------------------

p05loc_73D4:
		bit		2, a
		jr		z, p05loc_73FA
		ld		hl, 92C5h
		jr		p05loc_73ED
; ---------------------------------------------------------------------------

p05loc_73DD:
		ld		hl, 92C5h
		ld		a, (hl)
		bit		2, a
		jr		nz, p05loc_73ED
		inc		(hl)

p05loc_73E6:
		set		6, (iy+5)
		jp		p05loc_7331
; ---------------------------------------------------------------------------

p05loc_73ED:
		res		2, (hl)
		dec		(hl)
		jp		p, p05loc_7331
		ld		a, 5
		ld		(unk_97A2), a
		jr		p05loc_73FF
; ---------------------------------------------------------------------------

p05loc_73FA:
		ld		a, 0Bh
		ld		(unk_97A2), a

p05loc_73FF:
		ld		hl, p05loc_7239
		call	AppInit
		set		appCurWord, (iy+appFlags)
		call	CanAlphIns
		jp		p05sub_72F9
; End of function p05sub_735E


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


CurNameLength:
		ld		hl, nameBuff
		ld		b, 5

p05loc_7414:
		ld		a, (hl)
		cp		5Dh ; ']'
		jr		nz, p05loc_741B
		dec		b
		inc		hl

p05loc_741B:
		inc		hl
		cp		0
		jr		z, p05loc_7422
		djnz	p05loc_7414

p05loc_7422:
		ld		a, 5
		sub		b
		ld		c, a
		ld		b, 0
		ret
; End of function CurNameLength


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


p05sub_7429:
		ld		a, 30h ; '0'
		bit		localizeHookActive, (iy+hookflags3)
		jr		z, p05loc_7436
		call	j_call_character_hook
		jr		z, p05loc_7458

p05loc_7436:
		ld		a, (unk_92C5)
		res		2, a
		add		a, 4
		ld		(curRow), a
		call	BCALL_4F9F
		jr		nz, p05loc_7456
		cp		0
		jr		nz, p05loc_744D
		ld		a, 0Ah
		jr		p05loc_7458
; ---------------------------------------------------------------------------

p05loc_744D:
		call	BCALL_4FA2
		jr		c, p05loc_7456
		ld		a, 5
		jr		p05loc_7458
; ---------------------------------------------------------------------------

p05loc_7456:
		ld		a, 6

p05loc_7458:
		ld		(curRow+1), a
		ret
; End of function p05sub_7429


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


BCALL_4F9F:
		ld		hl, 92C6h
		ld		a, (unk_92C5)
		res		2, a
		cp		(hl)
		ret
; End of function BCALL_4F9F


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


p05sub_7466:
		call	BCALL_4F9F
		jr		nz, p05loc_747C
		cp		0
		jr		z, p05loc_747C
		call	BCALL_4FA2
		jr		c, p05loc_747C
		set		1, (iy+18h)
		ld		a, 2
		jr		p05loc_7485
; ---------------------------------------------------------------------------

p05loc_747C:
		res		1, (iy+18h)
		ld		a, (unk_92C5)
		res		2, a

p05loc_7485:
		ld		hl, 92C9h
		call	p05sub_519C
		jp		p05loc_7104
; End of function p05sub_7466


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


NameToBuf:
		ld		de, nameBuff
		ld		a, (hl)
		cp		31h ; '1'
		jr		nz, p05loc_749B
		ex		de, hl
		ld		(hl), 31h ; '1'
		jr		p05loc_74A9
; ---------------------------------------------------------------------------

p05loc_749B:
		cp		6
		jr		nc, p05loc_74A6
		ex		de, hl
		ld		(hl), 5Dh ; ']'
		inc		hl
		ld		(hl), a
		jr		p05loc_74A9
; ---------------------------------------------------------------------------

p05loc_74A6:
		call	page0_118B

p05loc_74A9:
		; NameToBuf+16j
		ld		hl, nameBuff
		ret
; End of function NameToBuf

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

p05loc_74AD:
		cp		9
		jp		z, JForceCmdNoChar
		cp		5Ah ; 'Z'
		ret		c
		jp		JForceCmd

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


p05sub_74B8:
		push	bc
		ld		a, (unk_89F5)
		push	af
		ld		e, (ix+7)
		bit		6, (ix+6)
		jr		nz, p05loc_7510
		ld		l, (ix+4)
		ld		h, (ix+5)
		ld		(curRow), hl
		jr		nc, p05loc_74F1
		bit		localizeHookActive, (iy+hookflags3)
		jr		z, p05loc_74DE
		ld		a, 28h ; '('
		call	j_call_character_hook
		jr		z, p05loc_74E1

p05loc_74DE:
		ld		a, (ix+6)

p05loc_74E1:
		and		0Fh
		ld		b, a
		set		textInverse, (iy+textFlags)
		ld		a, 20h ; ' '

p05loc_74EA:
		call	j_PutC
		djnz	p05loc_74EA
		jr		p05loc_750A
; ---------------------------------------------------------------------------

p05loc_74F1:
		call	p05sub_7550
		bit		textInverse, (iy+textFlags)
		jr		nz, p05loc_74FE
		set		preClrForMode, (iy+newDispF)

p05loc_74FE:
		ld		a, 2Ah ; '*'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	putsm

p05loc_750A:
		pop		af
		ld		(unk_89F5), a
		pop		bc
		ret
; ---------------------------------------------------------------------------

p05loc_7510:
		ld		h, (ix+4)
		ld		l, (ix+5)
		ld		(penCol), hl
		set		textEraseBelow, (iy+textFlags)
		jr		nc, p05loc_753F
		bit		localizeHookActive, (iy+hookflags3)
		jr		z, p05loc_752C
		ld		a, 29h ; ')'
		call	j_call_character_hook
		jr		z, p05loc_7531

p05loc_752C:
		ld		a, (ix+6)
		and		1Fh

p05loc_7531:
		ld		b, a
		set		textInverse, (iy+textFlags)

p05loc_7536:
		ld		a, 20h ; ' '
		call	j_VPutMap
		djnz	p05loc_7536
		jr		p05loc_750A
; ---------------------------------------------------------------------------

p05loc_753F:
		call	p05sub_7550
		ld		a, 2Bh ; '+'
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76C7
		jr		p05loc_750A
; End of function p05sub_74B8


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


p05sub_7550:
		; p05sub_74B8:p05loc_753Fp
		call	p05sub_756B
		jr		nz, p05loc_7559
		set		textInverse, (iy+textFlags)

p05loc_7559:
		ld		e, (ix+7)
; End of function p05sub_7550


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


p05sub_755C:

		ld		d, 0
		ld		hl, p05loc_78D3
		add		hl, de
		jp		ldHLind
; End of function p05sub_755C

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

Page05_3147:
		call	p05sub_755C
		jp		putsm

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


p05sub_756B:
		; p05sub_7550p
		call	p05sub_7583
		push	af
		ld		a, (mcxCurApp)
		cp		49h ; 'I'
		jr		z, p05loc_757C
		pop		af
		call	c, ShRAcc
		jr		p05loc_757D
; ---------------------------------------------------------------------------

p05loc_757C:
		pop		af

p05loc_757D:
		and		0Fh
		cp		(ix+9)
		ret
; End of function p05sub_756B


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


p05sub_7583:
		ld		a, (ix+8)
		ld		e, a
		srl	e
		push	af
		ld		d, 0
		ld		hl, 92C8h
		add		hl, de
		cp		68h ; 'h'
		jr		z, p05loc_759F
		ld		a, (mcxCurApp)
		cp		49h ; 'I'
		jr		z, p05loc_759F
		call	p05loc_7104
		dec		hl

p05loc_759F:
		pop		af
		ld		a, (hl)
		ret
; End of function p05sub_7583


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


p05sub_75A2:
		ld		hl, 92C9h
		call	p05sub_519C
		call	p05loc_7104
		call	j_dispSLstNameHL
		ret
; End of function p05sub_75A2

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

Page05_314D:
		ld		a, (unk_92FC)
		push	af
		ld		a, d
		ld		(unk_92FC), a
		call	BCALL_4FA2
		push	hl
		pop		ix
		ld		hl, p05loc_795B
		ld		a, 1Dh
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		ld		a, (ix+10h)
		and		0Fh
		cp		1
		jr		z, p05loc_75DE
		ld		hl, p05loc_7957
		ld		a, 1Eh
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook

p05loc_75DE:
		ld		a, (winBtm)
		push	af
		ld		a, 7
		ld		(winBtm), a
		call	putsm
		pop		af
		ld		(winBtm), a
		call	j_newline
		call	j_EraseEOL
		ld		a, (curRow)
		add		a, a
		add		a, a
		add		a, a
		ld		(penCol+1), a
		ld		a, 0Ch
		ld		(penCol), a
		ld		a, (ix+0)
		and		0Fh
		ld		hl, p05loc_78EB
		call	p05sub_76B5
		call	p05sub_76A6
		ld		a, 1Ah
		ld		(penCol), a
		ld		a, 0
		call	p05sub_75A2
		ld		a, 31h ; '1'
		ld		(penCol), a
		call	BCALL_4FA2
		jr		c, p05loc_764B
		cp		5
		jr		nz, p05loc_7652
		ld		a, (ix+10h)
		call	ShRAcc
		ld		hl, p05loc_7901
		call	p05sub_76B5
		call	ldHLind
		call	p05sub_76C7
		ld		hl, p05loc_790D
		ld		a, 1Fh
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook
		call	p05sub_76C7
		jr		p05loc_765C
; ---------------------------------------------------------------------------

p05loc_764B:
		ld		a, 1
		call	p05sub_75A2
		jr		p05loc_765C
; ---------------------------------------------------------------------------

p05loc_7652:
		ld		a, 31h ; '1'
		ld		(penCol), a
		ld		a, 2
		call	p05sub_75A2

p05loc_765C:
		ld		a, 48h ; 'H'
		ld		(penCol), a
		call	BCALL_4FA2
		jr		c, p05loc_7677
		cp		2
		jr		z, p05loc_7677
		cp		5
		jr		nz, p05loc_7689
		ld		a, 20h ; ' '
		bit		localizeHookActive, (iy+hookflags3)
		call	nz, j_call_character_hook

p05loc_7677:
		ld		a, (ix+0)
		call	ShRAcc
		ld		hl, p05loc_78F7
		call	p05sub_76B5
		call	ldHLind
		call	p05sub_76C7

p05loc_7689:
		pop		af
		ld		(unk_92FC), a
		ret
; ---------------------------------------------------------------------------
		ld		de, nameBuff
		call	page0_118B
		ex		de, hl
		ld		(hl), 0
		ld		hl, nameBuff
		jp		p05loc_76A9
; ---------------------------------------------------------------------------
		inc		hl
		ld		a, (hl)
		inc		a
		ld		hl, p05loc_78D3
		call	p05sub_76B5

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


p05sub_76A6:
		call	ldHLind

p05loc_76A9:
		set		textEraseBelow, (iy+textFlags)
		call	p05sub_76C7
		res		textEraseBelow, (iy+textFlags)
		ret
; End of function p05sub_76A6


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


p05sub_76B5:
		sla	a
		ld		e, a
		ld		d, 0
		add		hl, de
		ret
; End of function p05sub_76B5


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


p05sub_76BC:
		call	putsm
; End of function p05sub_76BC


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


p05sub_76BF:
		ld		hl, curRow
		inc		(hl)
		sub		a
		inc		hl
		ld		(hl), a
		ret
; End of function p05sub_76BF


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


p05sub_76C7:
		push	af
		push	de
		push	ix

p05loc_76CB:
		ld		a, (hl)
		inc		hl
		or		a
		jr		z, p05loc_76D5
		call	j_VPutMap
		jr		nc, p05loc_76CB

p05loc_76D5:
		pop		ix
		pop		de
		pop		af
		ret
; End of function p05sub_76C7

p05loc_76DA:
		ld		c, 0
		jp		JForceCmd
p05loc_76DF:
		.db		1
		.db		0
		.db		0
		.db		3
		.db		1
		.db		0
		.db		52h ; R
		.db		12h
		.db		68h ; h
		.db		0
		.db		2
		.db		0
		.db		1
		.db		3
		.db		1
		.db		19h
		.db		52h ; R
		.db		14h
		.db		68h ; h
		.db		1
		.db		2
		.db		1
		.db		2
		.db		3
		.db		1
		.db		32h ; 2
		.db		52h ; R
		.db		16h
		.db		68h ; h
		.db		2
		.db		4
		.db		3
		.db		0
		.db		5
		.db		1
		.db		0
		.db		82h ; é
		.db		0Eh
		.db		22h ; "
		.db		1
		.db		4
		.db		3
		.db		0
		.db		5
		.db		1
		.db		3
		.db		83h ; â
		.db		10h
		.db		22h ; "
		.db		0
		.db		6
		.db		5
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		1Fh
		.db		0CBh ; -
		.db		18h
		.db		2
		.db		0
		.db		7
		.db		5
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		2Fh ; /
		.db		0CBh ; -
		.db		1Ah
		.db		2
		.db		1
		.db		8
		.db		6
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		3Fh ; ?
		.db		0CBh ; -
		.db		1Eh
		.db		2
		.db		3
		.db		9
		.db		7
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		1Fh
		.db		0CBh ; -
		.db		1Ch
		.db		2
		.db		2
		.db		0Ah
		.db		8
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		2Fh ; /
		.db		0CBh ; -
		.db		20h
		.db		2
		.db		4
		.db		0Ah
		.db		9
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		3Fh ; ?
		.db		0CBh ; -
		.db		22h ; "
		.db		2
		.db		5
		.db		0Ch
		.db		0Bh
		.db		0FEh ; ¦
		.db		0Dh
		.db		5
		.db		0Ah
		.db		81h ; ü
		.db		2Ah ; *
		.db		23h ; #
		.db		0
		.db		0Ch
		.db		0Bh
		.db		0FEh ; ¦
		.db		0Dh
		.db		5
		.db		0Ch
		.db		81h ; ü
		.db		2Ch ; ,
		.db		23h ; #
		.db		1
		.db		0Eh
		.db		0Dh
		.db		0Bh
		.db		0Dh
		.db		6
		.db		6
		.db		81h ; ü
		.db		24h ; $
		.db		3
		.db		0
		.db		0Fh
		.db		0Dh
		.db		0Bh
		.db		0Eh
		.db		6
		.db		8
		.db		81h ; ü
		.db		26h ; &
		.db		3
		.db		1
		.db		0Fh
		.db		0Eh
		.db		0Bh
		.db		0Fh
		.db		6
		.db		0Ah
		.db		81h ; ü
		.db		28h ; (
		.db		3
		.db		2
p05loc_777F:
		.db		1
		.db		0
		.db		0
		.db		3
		.db		1
		.db		0
		.db		52h ; R
		.db		12h
		.db		68h ; h
		.db		0
		.db		2
		.db		0
		.db		1
		.db		3
		.db		1
		.db		19h
		.db		52h ; R
		.db		14h
		.db		68h ; h
		.db		1
		.db		2
		.db		1
		.db		2
		.db		3
		.db		1
		.db		32h ; 2
		.db		52h ; R
		.db		16h
		.db		68h ; h
		.db		2
		.db		4
		.db		3
		.db		0
		.db		5
		.db		1
		.db		0
		.db		82h ; é
		.db		0Eh
		.db		22h ; "
		.db		1
		.db		4
		.db		3
		.db		0
		.db		5
		.db		1
		.db		3
		.db		83h ; â
		.db		10h
		.db		22h ; "
		.db		0
		.db		6
		.db		5
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		1Fh
		.db		0CBh ; -
		.db		18h
		.db		2
		.db		0
		.db		7
		.db		5
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		2Fh ; /
		.db		0CBh ; -
		.db		1Ah
		.db		2
		.db		1
		.db		8
		.db		6
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		3Fh ; ?
		.db		0CBh ; -
		.db		1Eh
		.db		2
		.db		3
		.db		9
		.db		7
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		1Fh
		.db		0CBh ; -
		.db		1Ch
		.db		2
		.db		2
		.db		0Ah
		.db		8
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		2Fh ; /
		.db		0CBh ; -
		.db		20h
		.db		2
		.db		4
		.db		0Ah
		.db		9
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		3Fh ; ?
		.db		0CBh ; -
		.db		22h ; "
		.db		2
		.db		5
		.db		0Ch
		.db		0Bh
		.db		0FEh ; ¦
		.db		0Bh
		.db		6
		.db		6
		.db		81h ; ü
		.db		24h ; $
		.db		3
		.db		0
		.db		0Dh
		.db		0Bh
		.db		0FEh ; ¦
		.db		0Ch
		.db		6
		.db		8
		.db		81h ; ü
		.db		26h ; &
		.db		3
		.db		1
		.db		0Dh
		.db		0Ch
		.db		0FEh ; ¦
		.db		0Dh
		.db		6
		.db		0Ah
		.db		81h ; ü
		.db		28h ; (
		.db		3
		.db		2
p05loc_780B:
		.db		1
		.db		0
		.db		0
		.db		3
		.db		1
		.db		0
		.db		52h ; R
		.db		12h
		.db		68h ; h
		.db		0
		.db		2
		.db		0
		.db		1
		.db		3
		.db		1
		.db		19h
		.db		52h ; R
		.db		14h
		.db		68h ; h
		.db		1
		.db		2
		.db		1
		.db		2
		.db		3
		.db		1
		.db		32h ; 2
		.db		52h ; R
		.db		16h
		.db		68h ; h
		.db		2
		.db		4
		.db		3
		.db		0
		.db		5
		.db		1
		.db		0
		.db		82h ; é
		.db		0Eh
		.db		22h ; "
		.db		1
		.db		4
		.db		3
		.db		0
		.db		5
		.db		1
		.db		3
		.db		83h ; â
		.db		10h
		.db		22h ; "
		.db		0
		.db		6
		.db		5
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		1Fh
		.db		0CBh ; -
		.db		18h
		.db		2
		.db		0
		.db		7
		.db		5
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		2Fh ; /
		.db		0CBh ; -
		.db		1Ah
		.db		2
		.db		1
		.db		8
		.db		6
		.db		3
		.db		0FEh ; ¦
		.db		10h
		.db		3Fh ; ?
		.db		0CBh ; -
		.db		1Eh
		.db		2
		.db		3
		.db		9
		.db		7
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		1Fh
		.db		0CBh ; -
		.db		1Ch
		.db		2
		.db		2
		.db		0Ah
		.db		8
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		2Fh ; /
		.db		0CBh ; -
		.db		20h
		.db		2
		.db		4
		.db		0Ah
		.db		9
		.db		3
		.db		0FEh ; ¦
		.db		18h
		.db		3Fh ; ?
		.db		0CBh ; -
		.db		22h ; "
		.db		2
		.db		5
		.db		0Ch
		.db		0Bh
		.db		0FEh ; ¦
		.db		0Bh
		.db		6
		.db		6
		.db		81h ; ü
		.db		24h ; $
		.db		3
		.db		0
		.db		0Dh
		.db		0Bh
		.db		0FEh ; ¦
		.db		0Ch
		.db		6
		.db		8
		.db		81h ; ü
		.db		26h ; &
		.db		3
		.db		1
		.db		0Dh
		.db		0Ch
		.db		0FEh ; ¦
		.db		0Dh
		.db		6
		.db		0Ah
		.db		81h ; ü
		.db		28h ; (
		.db		3
		.db		2
p05loc_7897:
		.db		1
		.db		0
		.db		0
		.db		0FFh
		.db		0
		.db		6
		.db		0D2h ; -
		.db		12h
		.db		22h ; "
		.db		1
		.db		2
		.db		0
		.db		1
		.db		0FFh
		.db		0
		.db		1Eh
		.db		0D2h ; -
		.db		14h
		.db		44h ; D
		.db		1
		.db		2
		.db		1
		.db		2
		.db		0FFh
		.db		0
		.db		36h ; 6
		.db		0D2h ; -
		.db		16h
		.db		66h ; f
		.db		1
p05loc_78B5:
		.db		1
		.db		0
		.db		0
		.db		0FFh
		.db		20h
		.db		6
		.db		0D2h ; -
		.db		12h
		.db		22h ; "
		.db		1
		.db		2
		.db		0
		.db		1
		.db		0FFh
		.db		20h
		.db		1Eh
		.db		0D2h ; -
		.db		14h
		.db		44h ; D
		.db		1
		.db		2
		.db		1
		.db		2
		.db		0FFh
		.db		20h
		.db		36h ; 6
		.db		0D2h ; -
		.db		16h
		.db		66h ; f
		.db		1
p05loc_78D3:
		.dw		p05loc_7936
		.dw		p05loc_793F
		.dw		p05loc_7942
		.dw		p05loc_7945
		.dw		p05loc_7948
		.dw		p05loc_794B
		.dw		p05loc_794E
		.dw		p05loc_795B
		.dw		p05loc_7957
		.dw		aPlot1
		.dw		aPlot2
		.dw		aPlot3
p05loc_78EB:
		.dw		p05loc_796A
		.dw		p05loc_796D
		.dw		p05loc_7976
		.dw		p05loc_7973
		.dw		p05loc_7970
		.dw		p05loc_7979
p05loc_78F7:
		.dw		p05loc_7964
		.dw		p05loc_7966
		.dw		p05loc_7968
		.dw		p05loc_7905
		.dw		p05loc_7907
p05loc_7901:
		.dw		p05loc_7909
		.dw		p05loc_790B
p05loc_7905:
		.db		58h ; X
		.db		0
p05loc_7907:
		.db		59h ; Y
		.db		0
p05loc_7909:
		.db		78h ; x
		.db		0
p05loc_790B:
		.db		79h ; y
		.db		0
p05loc_790D:
		.asc 'Axis',0
p05loc_7912:
		.asc 'Xlist:',0
p05loc_7919:
		.asc 'Data List:',0
p05loc_7924:
		.asc 'Data Axis:',0
p05loc_792F:
		.asc 'Ylist:',0
p05loc_7936:
		.asc ' 1',0
p05loc_7939:
		.asc 'Freq:',0
p05loc_793F:
		.asc 'L',81h,0
p05loc_7942:
		.asc 'L',82h,0
p05loc_7945:
		.asc 'L',83h,0
p05loc_7948:
		.asc 'L',84h,0
p05loc_794B:
		.asc 'L',85h,0
p05loc_794E:
		.asc 'L',86h,0
p05loc_7951:
		.asc 'Mark:',0
p05loc_7957:
		.asc 'Off',0
p05loc_795B:
		.asc 'On',0
p05loc_795E:
		.asc 'Type:',0
p05loc_7964:
		.db		0Ah
		.db		0
p05loc_7966:
		.db		0Bh
		.db		0
p05loc_7968:
		.db		0Ch
		.db		0
p05loc_796A:
		.db		0E1h ; ß
		.db		0E2h ; G
		.db		0
p05loc_796D:
		.db		0E3h ; p
		.db		0E4h ; S
		.db		0
p05loc_7970:
		.db		0E5h ; s
		.db		0E6h ; µ
		.db		0
p05loc_7973:
		.db		0E7h ; t
		.db		0E8h ; F
		.db		0
p05loc_7976:
		.db		0E9h ; T
		.db		0EAh ; O
		.db		0
p05loc_7979:
		.db		0EBh ; d
		.db		0ECh ; 8
		.db		0

GetBCOffsetIX2:
		push	ix
		add		ix, bc
		ld		a, (ix+0)
		pop		ix
		ret
; ---------------------------------------------------------------------------

curBlink:
		ld		hl, curTime
		dec		(hl)
		ret		nz
		push	af
		in		a, (3)
		push	af
		ld		a, 8
		out		(3), a
		pop		af
		out		(3), a
		pop		af
		bit		curOn, (iy+curFlags)
		jp		z, showCursor
		jr		hideCursor
; ---------------------------------------------------------------------------

CursorOff:
		res		curAble, (iy+curFlags)
		bit		appCurGraphic, (iy+appFlags)
		jr		z, hideCursor
		push	af
		bit		monAbandon, (iy+monFlags)
		jr		nz, p05loc_79CA
		res		saIndic, (iy+newIndicFlags)
		res		indicInUse, (iy+indicFlags)
		ld		a, 3
		bit		graphHookActive, (iy+hookflags3)
		call	nz, Page0Call_330F
		jr		nz, p05loc_79CA
		call	j_GrBufCpy
		call	j_GRLABELS

p05loc_79CA:
		pop		af
		res		curOn, (iy+curFlags)

hideCursor:
		push	af
		ld		a, 32h ; '2'
		ld		(curTime), a
		pop		af
		bit		curOn, (iy+curFlags)
		ret		z
		push	af
		bit		appCurGraphic, (iy+appFlags)
		jr		z, p05loc_79E7
		call	j_BLINKGCUR
		jr		p05loc_7A1E
; ---------------------------------------------------------------------------

p05loc_79E7:
		bit		appCurWord, (iy+appFlags)
		jr		z, p05loc_79F7
		push	ix
		or		a
		call	p05sub_7A24
		pop		ix
		jr		p05loc_7A1E
; ---------------------------------------------------------------------------

p05loc_79F7:
		ld		a, (curUnder)
		bit		cursorHookActive, (iy+hookflags2)
		jr		z, p05loc_7A08
		ld		b, a
		ld		a, 24h ; '$'
		call	j_cursorhook
		jr		z, p05loc_7A1E

p05loc_7A08:
		bit		1, (iy+2Ah)
		jr		z, p05loc_7A1B
		ld		hl, (penCol)
		push	hl
		call	j_VPutMap
		pop		hl
		ld		(penCol), hl
		jr		p05loc_7A1E
; ---------------------------------------------------------------------------

p05loc_7A1B:
		call	j_PutMap

p05loc_7A1E:
		res		curOn, (iy+curFlags)
		pop		af
		ret

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


p05sub_7A24:
		push	af
		ld		ix, (unk_97A3)
		ld		a, (mcxCurApp)
		cp		55h ; 'U'
		jr		z, p05loc_7A41
		cp		49h ; 'I'
		jr		z, p05loc_7A41
		cp		56h ; 'V'
		jr		z, p05loc_7A46
		cp		58h ; 'X'
		jr		z, p05loc_7A4B
		pop		af
		call	j_itemName
		ret
; ---------------------------------------------------------------------------

p05loc_7A41:
		pop		af
		call	p05sub_74B8
		ret
p05loc_7A46:
		pop		af
		call	Page0Call_3471
		ret
; ---------------------------------------------------------------------------

p05loc_7A4B:
		pop		af
		call	Page0Call_310B
		ret
; End of function p05sub_7A24

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

CursorOn:
		bit		curLock, (iy+curFlags)
		ret		nz
		bit		appCurGraphic, (iy+appFlags)
		call	nz, j_NBCURSOR
		set		curAble, (iy+curFlags)

showCursor:
		bit		curAble, (iy+curFlags)
		ret		z
		push	af
		push	de
		push	hl
		ld		a, 32h ; '2'
		ld		(curTime), a
		bit		appCurGraphic, (iy+appFlags)
		jr		z, p05loc_7A78
		call	j_BLINKGCUR
		jr		p05loc_7AC1
; ---------------------------------------------------------------------------

p05loc_7A78:
		bit		appCurWord, (iy+appFlags)
		jr		z, p05loc_7A8C
		push	ix
		ld		ix, (unk_97A3)
		scf
		call	p05sub_7A24
		pop		ix
		jr		p05loc_7AC1
; ---------------------------------------------------------------------------

p05loc_7A8C:
		bit		curOn, (iy+curFlags)
		jr		nz, p05loc_7ACA
		bit		cursorHookActive, (iy+hookflags2)
		jr		z, p05loc_7AA0
		ld		a, 22h ; '"'
		call	j_cursorhook
		jp		z, p05loc_7B21

p05loc_7AA0:
		bit		1, (iy+2Ah)
		jr		z, p05loc_7AC3

p05loc_7AA6:
		ld		hl, 81A0h
		bit		textInsMode, (iy+textFlags)
		jr		z, p05loc_7AB2
		ld		hl, 81A8h

p05loc_7AB2:
		ld		de, (penCol)
		push	de
		ld		a, 6
		call	j_VPutMapRec
		pop		de
		ld		(penCol), de

p05loc_7AC1:
		jr		p05loc_7B21
; ---------------------------------------------------------------------------

p05loc_7AC3:
		call	j_getcurloc
		ld		a, (hl)
		ld		(curUnder), a

p05loc_7ACA:
		bit		cursorHookActive, (iy+hookflags2)
		jr		z, p05loc_7AD7
		ld		a, 23h ; '#'
		call	j_cursorhook
		jr		z, p05loc_7B21

p05loc_7AD7:
		bit		1, (iy+2Ah)
		jr		nz, p05loc_7AA6
		call	j_isEditFull
		jr		nz, p05loc_7AF6
		bit		textInsMode, (iy+textFlags)
		jr		nz, p05loc_7AF2
		call	IsAtBtm
		jr		z, p05loc_7AF2
		ld		a, (de)
		cp		3Fh ; '?'
		jr		nz, p05loc_7AF6

p05loc_7AF2:
		ld		a, 0F1h	; '�'
		jr		p05loc_7B15
; ---------------------------------------------------------------------------

p05loc_7AF6:
		ld		a, 0E0h	; '�'
		bit		textInsMode, (iy+textFlags)
		jr		z, p05loc_7B00
		add		a, 4

p05loc_7B00:
		ld		h, (iy+12h)
		bit		3, h
		jr		z, p05loc_7B0A
		inc		a
		jr		p05loc_7B15
; ---------------------------------------------------------------------------

p05loc_7B0A:
		bit		4, h
		jr		z, p05loc_7B15
		add		a, 2
		bit		5, h
		jr		z, p05loc_7B15
		inc		a

p05loc_7B15:
		ld		b, a
		ld		a, (curRow)
		or		a
		ld		a, b
		jr		nz, p05loc_7B1E
		nop

p05loc_7B1E:
		call	j_PutMap

p05loc_7B21:

		set		curOn, (iy+curFlags)
		pop		hl
		pop		de
		pop		af
		ret