source/page04/initial.asm
author brandonlw
Wed, 07 May 2014 06:56:39 -0400
changeset 6 e514aba854d4
parent 4 59f60baeaf6a
child 7 89b82476a75f
permissions -rw-r--r--
Standardize on all the tabs.

p04sub_4000:				; CODE XREF: BCALL_4D92+13p
		; BCALL_4D92+4Ep ...
		ld	h, 0
		ld	a, (unk_966C)
		jp	DivHLByA
; End of function p04sub_4000


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


HorizontalLine:				; CODE XREF: ForceGraphKeypress+874p
		; p04sub_6431+Ap
		ld	bc, (curGY2)
		ld	e, c
		ld	b, 0
		push	af
		ld	a, (pixWide_m_2)
		ld	d, a
		pop	af
		jr	DarkLine
; End of function HorizontalLine


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


p04sub_4017:				; CODE XREF: ForceGraphKeypress+86Bp
		; p04sub_6440+Ap ...
		ld	bc, (curGY2)
; End of function p04sub_4017


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


VerticalLine:				; CODE XREF: DRAWSPLITLINE+Fp
		push	af
		ld	a, (lcdTallP)
		ld	e, a
		pop	af
		dec	e
		ld	d, b
		ld	c, 1
; End of function VerticalLine


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


DarkLine:				; CODE XREF: HorizontalLine+Dj
		; ForceGraphKeypress+81Dp ...
		ld	h, 1
		jr	ILine

ILine:					; CODE XREF: p04sub_645F+14p p04sub_645F+1Ep ...
		push	af
		ld	a, 1
		bit	7, (iy+35h)
		call	nz, Page0Call_3483
		jr	z, p04loc_4038
		pop	af
		ret
; ---------------------------------------------------------------------------

ILineNoHook:
		push	af

p04loc_4038:				; CODE XREF: DarkLine+Ej
		push	bc
		ld	(unk_9315), bc
		pop	ix
		push	bc
		push	de
		push	hl
		ld	a, e
		sub	c
		jr	nc, p04loc_404A
		neg
		set	4, h

p04loc_404A:				; CODE XREF: DarkLine+1Fj
		ld	l, a
		ld	a, d
		sub	b
		jr	nc, p04loc_4053
		neg
		set	5, h

p04loc_4053:				; CODE XREF: DarkLine+28j
		ld	e, a
		ld	b, h
		ld	a, l
		cp	e
		jr	c, p04loc_405D
		set	6, b
		ld	l, e
		ld	e, a

p04loc_405D:				; CODE XREF: DarkLine+32j
		xor	a
		ld	d, a
		ld	h, a
		push	hl
		sbc	hl, de
		add	hl, hl
		ex	(sp), hl
		add	hl, hl
		push	hl
		sbc	hl, de
		push	ix
		inc	e
		ld	a, b
		and	0Fh
		ld	d, a
		ld	a, b
		pop	bc
		ld	ix, 0
		add	ix, sp

p04loc_4078:				; CODE XREF: DarkLine+7Fj
		call	IPoint
		push	bc
		bit	7, h
		jr	z, p04loc_4091
		ld	c, (ix+0)
		ld	b, (ix+1)
		add	hl, bc
		pop	bc
		bit	6, a
		jr	nz, p04loc_409C
		call	p04sub_4314
		jr	p04loc_40A3
; ---------------------------------------------------------------------------

p04loc_4091:				; CODE XREF: DarkLine+59j
		ld	c, (ix+2)
		ld	b, (ix+3)
		add	hl, bc
		pop	bc
		call	p04sub_4314

p04loc_409C:				; CODE XREF: DarkLine+65j
		inc	c
		bit	4, a
		jr	z, p04loc_40A3
		dec	c
		dec	c

p04loc_40A3:				; CODE XREF: DarkLine+6Aj DarkLine+7Aj
		dec	e
		jr	nz, p04loc_4078
; End of function DarkLine

; START	OF FUNCTION CHUNK FOR p04sub_41F1

p04loc_40A6:				; CODE XREF: p04sub_41F1+B7j
		pop	hl
		pop	hl

p04loc_40A8:				; CODE XREF: p04sub_41F1:p04loc_420Dj
		; p04sub_41F1:p04loc_4297j ...
		pop	hl
		pop	de
		pop	bc
		pop	af
		ret
; END OF FUNCTION CHUNK	FOR p04sub_41F1

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


BCALL_4D92:				; CODE XREF: IPoint+2Bp
		ld	hl, 9668h
		ld	a, (hl)
		or	a
		jr	nz, p04loc_40EB
		bit	7, (iy+1Eh)
		jr	nz, p04loc_40BF
		ld	a, 2
		ld	(unk_966C), a

p04loc_40BF:				; CODE XREF: BCALL_4D92+Bj
		ld	l, b
		call	p04sub_4000
		ld	e, a
		ld	a, (unk_966C)
		dec	a
		cp	e
		ret	nz
		ld	a, 1
		ld	(unk_966C), a
		xor	a

p04loc_40D0:				; CODE XREF: BCALL_4D92+3Cj
		; BCALL_4D92+5Ej ...
		ld	hl, 9775h
		bit	0, (hl)
		jr	z, p04loc_40D9
		neg

p04loc_40D9:				; CODE XREF: BCALL_4D92+28j
		add	a, c
		ret	z
		ld	c, a
		ld	hl, 966Dh
		cp	(hl)
		ret	nc
		ld	d, 1
		call	p04sub_41F1
		ld	a, (unk_966C)
		jr	p04loc_40D0
; ---------------------------------------------------------------------------

p04loc_40EB:				; CODE XREF: BCALL_4D92+5j
		cp	2
		jr	nc, p04loc_4115
		bit	7, (iy+1Eh)
		jr	nz, p04loc_40FA
		ld	a, 2
		ld	(unk_966C), a

p04loc_40FA:				; CODE XREF: BCALL_4D92+46j
		ld	l, c
		call	p04sub_4000
		ld	hl, 9775h
		bit	0, (hl)
		jr	nz, p04loc_410D
		ld	e, a
		ld	a, (unk_966C)
		dec	a
		sub	e
		jr	p04loc_40D0
; ---------------------------------------------------------------------------

p04loc_410D:				; CODE XREF: BCALL_4D92+56j
		push	af
		ld	a, (unk_966C)
		ld	e, a
		pop	af
		jr	p04loc_40D0
; ---------------------------------------------------------------------------

p04loc_4115:				; CODE XREF: BCALL_4D92+40j
		push	af
		bit	7, (iy+1Eh)
		jr	nz, p04loc_4121
		ld	a, 3
		ld	(unk_966C), a

p04loc_4121:				; CODE XREF: BCALL_4D92+6Dj
		ld	l, c
		call	p04sub_4000
		push	af
		ld	l, b
		call	p04sub_4000
		pop	de
		ld	e, a
		pop	af
		jr	z, p04loc_4135
		ld	a, e
		sub	d
		jr	nc, p04loc_4143
		jr	p04loc_413E
; ---------------------------------------------------------------------------

p04loc_4135:				; CODE XREF: BCALL_4D92+80j
		ld	a, e
		ld	a, (unk_966C)
		dec	a
		sub	e
		sub	d
		jr	nc, p04loc_4143

p04loc_413E:				; CODE XREF: BCALL_4D92+86j
		ld	e, a
		ld	a, (unk_966C)
		add	a, e

p04loc_4143:				; CODE XREF: BCALL_4D92+84j
		; BCALL_4D92+8Fj
		ld	hl, 9775h
		bit	0, (hl)
		jr	z, p04loc_40D0
		or	a
		jr	z, p04loc_40D0
		ld	e, a
		ld	a, (unk_966C)
		sub	e
		jp	p04loc_40D0
; End of function BCALL_4D92


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


PointOn:				; CODE XREF: ForceGraphKeypress+2F7p
		; Axes+145p ...
		ld	d, 1
; End of function PointOn


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


IPoint:					; CODE XREF: DarkLine:p04loc_4078p
		; CPoint+1Dp ...
		push	af
		ld	a, 0
		bit	7, (iy+35h)
		call	nz, Page0Call_3483
		jr	z, p04loc_4166
		pop	af
		ret
; ---------------------------------------------------------------------------

IPointNoGraphicsHook:
		push	af

p04loc_4166:				; CODE XREF: IPoint+Aj
		push	bc
		bit	5, (iy+14h)
		jp	z, p04loc_41F3
		ld	a, (unk_9775)
		cp	1
		jr	z, p04loc_418A
		jp	c, p04loc_41F3
		cp	4
		jr	nc, p04loc_41F3
		set	6, (iy+19h)
		push	hl
		push	de
		call	BCALL_4D92
		pop	de
		pop	hl
		pop	bc
		jr	p04loc_41F2
; ---------------------------------------------------------------------------

p04loc_418A:				; CODE XREF: IPoint+1Cj
		call	p04sub_41F1
		push	hl
		push	bc
		ld	a, c
		ld	bc, (unk_9315)
		cp	c
		jr	z, p04loc_41C0
		jr	c, p04loc_41A9
		inc	b
		call	p04sub_41F1
		dec	b
		inc	c
		dec	c
		pop	af
		cp	b
		jr	z, p04loc_41D2
		jr	c, p04loc_41D3
		dec	c
		jr	p04loc_41D4
; ---------------------------------------------------------------------------

p04loc_41A9:				; CODE XREF: IPoint+40j
		inc	b
		call	p04sub_41F1
		dec	b
		dec	c
		call	p04sub_41F1
		pop	af
		cp	b
		jr	nz, p04loc_41D7

p04loc_41B6:				; CODE XREF: IPoint+67j
		inc	b
		jr	p04loc_41D4
; ---------------------------------------------------------------------------
		dec	b
		call	p04sub_41F1
		inc	b
		jr	p04loc_41B6
; ---------------------------------------------------------------------------

p04loc_41C0:				; CODE XREF: IPoint+3Ej
		pop	af
		dec	c
		cp	b
		jr	z, p04loc_41D7
		push	af
		call	p04sub_41F1
		pop	af
		jr	c, p04loc_41CF
		inc	b
		jr	p04loc_41D4
; ---------------------------------------------------------------------------

p04loc_41CF:				; CODE XREF: IPoint+73j
		dec	b
		jr	p04loc_41D4
; ---------------------------------------------------------------------------

p04loc_41D2:				; CODE XREF: IPoint+4Bj
		inc	b

p04loc_41D3:				; CODE XREF: IPoint+4Dj
		inc	c

p04loc_41D4:				; CODE XREF: IPoint+50j IPoint+60j ...
		call	p04sub_41F1

p04loc_41D7:				; CODE XREF: IPoint+5Dj IPoint+6Cj
		pop	hl
		pop	bc
		ld	(unk_9315), bc
		pop	af
		ret
; End of function IPoint

; ---------------------------------------------------------------------------
		ld	a, (ix+0)
		or	(ix+1)
		jr	nz, p04loc_41EA
		dec	c
		jr	p04loc_41EB
; ---------------------------------------------------------------------------

p04loc_41EA:				; CODE XREF: seg001:41E5j
		inc	b

p04loc_41EB:				; CODE XREF: seg001:41E8j
		call	p04sub_41F1
		pop	bc
		pop	af
		ret

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


p04sub_41F1:				; CODE XREF: BCALL_4D92+36p
		; IPoint:p04loc_418Ap ...

; FUNCTION CHUNK AT 40A6 SIZE 00000007 BYTES

		push	af

p04loc_41F2:				; CODE XREF: IPoint+31j
		push	bc

p04loc_41F3:				; CODE XREF: IPoint+14j IPoint+1Ej ...
		ld	a, (XOffset)
		add	a, b
		ld	b, a
		ld	a, (YOffset)
		add	a, c
		ld	c, a
		push	de
		push	hl
		bit	2, (iy+2Bh)
		jr	z, p04loc_420A
		call	IBoundsFull
		jr	p04loc_420D
; ---------------------------------------------------------------------------

p04loc_420A:				; CODE XREF: p04sub_41F1+12j
		call	IBounds

p04loc_420D:				; CODE XREF: p04sub_41F1+17j
		jp	c, p04loc_40A8
		call	IOffset
		ld	b, d
		ld	c, a
		ex	de, hl
		ld	hl, appBackUpScreen
		add	hl, de
		push	hl
		bit	3, (iy+3Ch)
		jr	z, p04loc_4224
		push	hl
		jr	p04loc_4251
; ---------------------------------------------------------------------------

p04loc_4224:				; CODE XREF: p04sub_41F1+2Ej
		ld	hl, plotSScreen
		add	hl, de
		push	hl
		bit	0, (iy+3Ch)
		jr	nz, p04loc_4251
		di
		ld	a, (curXRow)
		call	SetYUp
		call	lcd_busy
		out	(10h), a
		call	SetXUp
		ld	a, (curY)
		call	lcd_busy
		out	(10h), a
		call	Page0Call_3C69
		pop	hl
		push	hl
		bit	1, (iy+2)
		jr	nz, p04loc_4252

p04loc_4251:				; CODE XREF: p04sub_41F1+31j p04sub_41F1+3Cj
		ld	a, (hl)

p04loc_4252:				; CODE XREF: p04sub_41F1+5Ej
		inc	b
		djnz	p04loc_4258

p04loc_4255:				; CODE XREF: p04sub_41F1+BEj
		or	c
		jr	p04loc_425F
; ---------------------------------------------------------------------------

p04loc_4258:				; CODE XREF: p04sub_41F1+62j
		djnz	p04loc_425D

p04loc_425A:				; CODE XREF: p04sub_41F1+C0j
		or	c
		jr	p04loc_4260
; ---------------------------------------------------------------------------

p04loc_425D:				; CODE XREF: p04sub_41F1:p04loc_4258j
		djnz	p04loc_429A

p04loc_425F:				; CODE XREF: p04sub_41F1+65j
		xor	c

p04loc_4260:				; CODE XREF: p04sub_41F1+6Aj
		bit	3, (iy+3Ch)
		jr	nz, p04loc_426C
		bit	0, (iy+3Ch)
		jr	z, p04loc_4270

p04loc_426C:				; CODE XREF: p04sub_41F1+73j
		pop	hl
		ei
		jr	p04loc_428E
; ---------------------------------------------------------------------------

p04loc_4270:				; CODE XREF: p04sub_41F1+79j
		ld	h, a
		call	Bit_VertSplit
		jr	z, p04loc_4280
		ld	a, (curY)
		cp	25h ; '%'
		ld	a, h
		jr	nz, p04loc_4280
		or	1

p04loc_4280:				; CODE XREF: p04sub_41F1+83j p04sub_41F1+8Bj
		call	lcd_busy
		out	(11h), a
		ld	a, h
		pop	hl
		ei
		bit	1, (iy+2)
		jr	nz, p04loc_428F

p04loc_428E:				; CODE XREF: p04sub_41F1+7Dj
		ld	(hl), a

p04loc_428F:				; CODE XREF: p04sub_41F1+9Bj
		pop	hl
		bit	2, (iy+3Ch)
		jr	z, p04loc_4297
		ld	(hl), a

p04loc_4297:				; CODE XREF: p04sub_41F1+A3j
		jp	p04loc_40A8
; ---------------------------------------------------------------------------

p04loc_429A:				; CODE XREF: p04sub_41F1:p04loc_425Dj
		dec	b
		jr	nz, p04loc_42A7
		ld	a, (hl)
		and	c
		ei
		pop	hl
		pop	hl
		pop	hl
		pop	hl
		pop	hl
		pop	hl
		ret
; ---------------------------------------------------------------------------

p04loc_42A7:				; CODE XREF: p04sub_41F1+AAj
		dec	b
		jp	nz, p04loc_40A6
		ld	b, a
		ld	a, (hl)
		and	c
		ld	a, b
		jr	z, p04loc_4255
		jr	p04loc_425A
; End of function p04sub_41F1


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


IOffset:				; CODE XREF: p04sub_41F1+1Fp p04sub_586B+2p	...
		push	de
		ld	hl, p04loc_42E2
		ld	d, 0
		ld	a, b
		and	7
		ld	e, a
		add	hl, de
		ld	e, (hl)
		ld	h, d
		srl	b
		srl	b
		srl	b
		ld	a, b
		or	20h ; ' '
		ld	(curY), a
		ld	a, 3Fh ; '?'
		sub	c
		or	80h ; '�'
		ld	(curXRow), a
		and	7Fh ; ''
		add	a, a
		add	a, a
		ld	c, a
		ld	l, a
		add	hl, hl
		ld	a, e
		ld	e, c
		add	hl, de
		ld	e, b
		add	hl, de
		pop	de
		ret
; End of function IOffset

p04loc_42E2:
		.db  80h	; �
		.db  40h	; @
		.db  20h
		.db  10h
		.db    8
		.db    4
		.db    2
		.db    1

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


IBounds:				; CODE XREF: p04sub_41F1:p04loc_420Ap
		; ForceGraphKeypress:p04loc_485Ap
		push	af
		push	hl
		ld	hl, (lcdTallP)
		dec	h
		ld	a, b
		cp	h
		jr	nc, p04loc_4300
		ld	a, c
		cp	40h ; '@'
		jr	nc, p04loc_4300
		or	a
		jr	z, p04loc_4300

p04loc_42FC:				; CODE XREF: IBoundsFull+Ej
		pop	hl
		pop	af
		or	a
		ret
; ---------------------------------------------------------------------------

p04loc_4300:				; CODE XREF: IBounds+8j IBounds+Dj ...
		pop	hl
		pop	af
		scf
		ret
; End of function IBounds


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


IBoundsFull:				; CODE XREF: p04sub_41F1+14p
		push	af
		push	hl
		ld	hl, (lcdTallP)
		ld	a, b
		cp	h
		jr	nc, p04loc_4300
		ld	a, c
		cp	40h ; '@'
		jr	nc, p04loc_4300
		jr	p04loc_42FC
; End of function IBoundsFull


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


p04sub_4314:				; CODE XREF: DarkLine+67p DarkLine+74p
		inc	b
		bit	5, a
		ret	z
		dec	b
		dec	b
		ret
; End of function p04sub_4314


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


XYRNDBOTH:				; CODE XREF: CPoint+9p	p04sub_71EF+6p
		ld	hl, (FPS)
		add	hl, de
		push	hl
		call	XYRND
		pop	hl
		ret	nz
		ld	de, 0FFF7h
		add	hl, de
; End of function XYRNDBOTH


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


XYRND:					; CODE XREF: XYRNDBOTH+5p YPIXSET+12p	...
		bit	5, (hl)
		ret	nz
		push	hl
		rst	20h
		call	Page0Call_3E37
		ld	a, (OP1+1)
		cp	0E4h ; '�'
		jr	nc, p04loc_433E
		pop	de
		call	MovFrOP1
		xor	a
		ret
; ---------------------------------------------------------------------------

p04loc_433E:				; CODE XREF: XYRND+Dj
		pop	hl
		set	5, (hl)
		inc	h
		ret
; End of function XYRND


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


CheckTOP:				; CODE XREF: CPoint+Ep	p04sub_71EF+Bp
		ld	hl, (FPS)
		ld	de, 0FFF7h
		add	hl, de
		ex	de, hl
		add	hl, de
		ex	de, hl

CheckXY:				; CODE XREF: Axes+35p
		push	de
		push	hl
		ex	de, hl
		xor	a
		ld	de, Xmin
		call	Page04_3408
		sla	a
		sla	a
		ld	de, Ymin
		pop	hl
		call	Page04_3408
		pop	de
		ret
; End of function CheckTOP


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


Page04_3408:				; CODE XREF: CheckTOP+11p CheckTOP+1Cp ...
		push	hl
		push	af
		push	de
		rst	20h
		pop	hl
		inc	de
		inc	de
		call	mov9B2
		push	hl
		call	cpop1op2
		jr	nc, p04loc_437A
		pop	hl
		pop	af
		or	2
		jr	p04loc_4388
; ---------------------------------------------------------------------------

p04loc_437A:				; CODE XREF: Page04_3408+Ej
		rst	8
		pop	hl
		rst	20h
		call	cpop1op2
		jr	nc, p04loc_4387
		pop	af
		or	1
		jr	p04loc_4388
; ---------------------------------------------------------------------------

p04loc_4387:				; CODE XREF: Page04_3408+1Cj
		pop	af

p04loc_4388:				; CODE XREF: Page04_3408+14j
		; Page04_3408+21j
		pop	hl
		ret
; End of function Page04_3408

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR PLOTPT

DarkPnt:				; CODE XREF: PLOTPT+19j PLOTPT+5Aj
		ld	a, 1
; END OF FUNCTION CHUNK	FOR PLOTPT

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


CPoint:					; CODE XREF: seg001:7EE5p
		push	af
		call	PUSHMCPLXO1
		pop	af

CPointS:				; CODE XREF: seg001:7B6Ej
		push	af
		ld	de, 0FFF7h
		call	XYRNDBOTH
		jr	nz, p04loc_43AF
		call	CheckTOP
		and	0Fh
		jr	nz, p04loc_43AF
		call	WTOV
		pop	de
		ld	(unk_9315), bc
		call	IPoint
		jp	FPOPCPLX
; ---------------------------------------------------------------------------

p04loc_43AF:				; CODE XREF: CPoint+Cj	CPoint+13j
		pop	hl
		jp	FPOPCPLX
; End of function CPoint


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


WTOV:					; CODE XREF: CPoint+15p p04sub_71EF+12p
		push	hl
		call	XftoI
		pop	de
		push	af
		call	YftoI
		pop	bc
		ld	c, a
		ret
; End of function WTOV


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


VtoWHLDE:				; CODE XREF: ForceGraphKeypress+8FFp
		ld	hl, OP4
; End of function VtoWHLDE


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


p04sub_43C2:				; CODE XREF: ForceGraphKeypress+2FDp
		ld	de, OP1
; End of function p04sub_43C2


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


p04sub_43C5:				; CODE XREF: ForceGraphKeypress+8F8p
		push	de
		push	bc
		ld	a, c
		call	p04sub_43E1
		pop	af
		pop	hl
; End of function p04sub_43C5


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


Xitof:					; CODE XREF: p04sub_465B+CCDp
		; p04sub_58BE+17Bp ...
		bit	7, (iy+17h)
		jr	z, p04loc_43D5
		neg

p04loc_43D5:				; CODE XREF: Xitof+4j
		ld	bc, 8E6Ah
		ld	de, deltaX
		push	hl
		ld	l, a
		ld	a, 0FFh
		jr	p04loc_43EA
; End of function Xitof


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


p04sub_43E1:				; CODE XREF: p04sub_43C5+3p seg001:7F96p
		ld	bc, Ymin
		ld	de, deltaY
		dec	a
		push	hl
		ld	l, a

p04loc_43EA:				; CODE XREF: Xitof+12j
		ld	h, 0

p04loc_43EC:				; CODE XREF: p04sub_4418+5j
		push	bc
		push	af
		push	de
		call	Page0Call_3B55
		bit	7, (iy+17h)
		call	nz, InvOP2S
		pop	hl
		pop	af
		inc	a
		jr	nz, p04loc_4406
		push	hl
		ld	hl, 8E73h
		rst	20h
		rst	30h
		rst	8
		pop	hl

p04loc_4406:				; CODE XREF: p04sub_43E1+1Bj
		rst	20h
		call	FPMult
		call	Page0Call_3E37
		pop	hl
		call	page0_BEC
		call	CkValidNum
		pop	de
		jp	MovFrOP1
; End of function p04sub_43E1


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


p04sub_4418:				; CODE XREF: p04sub_7221+1Dp
		push	hl
		ld	hl, (curInc)
		xor	a
		jr	p04loc_43EC
; End of function p04sub_4418


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


YftoI:					; CODE XREF: WTOV+6p YPIXSET+39p ...
		ld	bc, Ymin
		ld	hl, shortY
		or	a
		call	p04sub_4432
		inc	a
		ret
; End of function YftoI


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


XftoI:					; CODE XREF: WTOV+1p p04sub_465B+6Bp ...
		ld	bc, 8E6Ah
		ld	hl, shortX
		scf
; End of function XftoI


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


p04sub_4432:				; CODE XREF: YftoI+7p
		push	af
		push	hl
		push	bc
		ex	de, hl
		rst	20h
		pop	hl
		call	page0_C25
		pop	hl
		call	page0_D19
		pop	af
		jr	nc, p04loc_4448

p04loc_4442:				; CODE XREF: p04sub_444F+18j
		ld	hl, 8E73h
		call	page0_C25

p04loc_4448:				; CODE XREF: p04sub_4432+Ej
		call	p04sub_4469
		call	Page0Call_3B5B
		ret
; End of function p04sub_4432


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


p04sub_444F:				; CODE XREF: p04sub_465B+5Cp
		ld	hl, 8E6Ah
		call	page0_C25
		ld	hl, shortX
		call	page0_D19
		ld	hl, XresO
		call	page0_EC1
		call	int
		call	FPMult
		jr	p04loc_4442
; End of function p04sub_444F


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


p04sub_4469:				; CODE XREF: p04sub_4432:p04loc_4448p
		ld	a, (OP1+1)
		sub	7Fh ; ''
		jr	c, p04loc_4497
		jr	z, p04loc_4490
		ld	b, 2
		ld	hl, 847Bh
		cp	2
		ld	a, 50h ; 'P'
		jr	z, p04loc_4481
		ld	a, 5
		dec	b
		dec	hl

p04loc_4481:				; CODE XREF: p04sub_4469+12j p04sub_5DD4+3Bp
		call	ADDPROP
		ret	nc

p04loc_4485:				; CODE XREF: p04sub_4469+2Cj
		ld	hl, OP1M
		ld	(hl), 10h
		inc	hl
		ld	(hl), 0
		jp	INCO1EXP
; ---------------------------------------------------------------------------

p04loc_4490:				; CODE XREF: p04sub_4469+7j
		ld	a, (OP1M)
		cp	50h ; 'P'
		jr	nc, p04loc_4485

p04loc_4497:				; CODE XREF: p04sub_4469+5j
		jp	OP1Set0
; End of function p04sub_4469


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


p04sub_449A:				; CODE XREF: p04sub_465B:p04loc_50DCp
		xor	a
		call	NEXTEQ
		or	a
		ret
; End of function p04sub_449A

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

Page04_3A20:
		ld	b, a
		ld	a, 0
		bit	3, (iy+35h)
		call	nz, Page0Call_330F
		push	bc
		res	4, (iy+14h)
		ld	hl, p04loc_4516
		call	AppInit
		res	1, (iy+2)
		res	3, (iy+1Fh)
		pop	af
		ld	hl, p04loc_4523
		ld	bc, 9
		cpir
		jr	z, TraceOff
		bit	0, (iy+3)
		jr	z, p04loc_44E1
		or	a
		jr	z, TraceOff
		cp	6
		jr	c, p04loc_44DE
		cp	7
		jr	z, p04loc_44DE
		cp	5
		jr	nz, TraceOff
		ret
; ---------------------------------------------------------------------------

p04loc_44DE:				; CODE XREF: seg001:44D3j seg001:44D7j
		call	Regraph

p04loc_44E1:				; CODE XREF: seg001:44CCj
		call	DoNothing3

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


TraceOff:				; CODE XREF: seg001:44C6j seg001:44CFj ...
		call	p04sub_6715
		call	p04sub_5CEA
		ret
; End of function TraceOff


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


CentCursor:				; CODE XREF: ForceGraphKeypress+800p
		; Regraph+3Ap ...
		bit	0, (iy+2)
		ret	nz
		push	hl
		push	af
		ld	a, (lcdTallP+1)
		srl	a
		dec	a
		ld	h, a
		pop	af
		ld	l, 20h ; ' '
		call	CheckSplitFlag
		jr	z, p04loc_4503
		ld	l, 10h

p04loc_4503:				; CODE XREF: CentCursor+14j
		bit	1, (iy+14h)
		jr	z, p04loc_450B
		ld	l, 1Ah

p04loc_450B:				; CODE XREF: CentCursor+1Cj
		ld	(curGY), hl
		ld	(freeSaveY), hl
		ld	(curGY2), hl
		pop	hl
		ret
; End of function CentCursor

; ---------------------------------------------------------------------------
p04loc_4516:
		.dw p04loc_45A5
		.dw p04loc_5CCC
		.dw p04loc_5CB1
		.dw p04loc_4543
		.dw noErrorEntry
		.dw p04loc_452C
		.db 0AAh
p04loc_4523:
		.db  63h ; c
		.db  65h ; e
		.db  62h ; b
		.db  60h ; `
		.db  6Bh ; k
		.db  64h ; d
		.db  5Eh ; ^
		.db  68h ; h
		.db  5Bh ; [

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

p04loc_452C:
DoNothing3:				; CODE XREF: seg001:p04loc_44E1p
		ret
; End of function DoNothing3

; ---------------------------------------------------------------------------
		bit	2, (iy+2)
		jr	nz, p04loc_4533

p04loc_4533:
		call	GrBufCpy
		call	LABCOOR
		bit	0, (iy+11h)
		jr	z, p04loc_4541
		pop	af
		ret
; ---------------------------------------------------------------------------

p04loc_4541:				; CODE XREF: seg001:453Dj
		pop	af
		ret
; ---------------------------------------------------------------------------

p04loc_4543:
GrRedisp:
		bit	0, (iy+11h)
		jr	nz, p04loc_4555
		bit	2, (iy+17h)
		jr	nz, p04loc_4555
		ld	hl, (monQH)
		ld	a, h
		cp	l
		ret	nz

p04loc_4555:				; CODE XREF: seg001:4547j seg001:454Dj
		call	GRBUFCPY_V
		call	LABCOOR
		bit	0, (iy+11h)
		ret	z
		call	Page0Call_3D89
		bit	2, (iy+17h)
		ret	z
		ld	a, (curGY2+1)
		call	PUTEQUNO
		call	p04loc_48FE
		ret
p04loc_4572:
		call	GRBUFCPY_V
		ld	a, (unk_85FD)
		ld	(curGStyle), a
		call	LABCOOR
		bit	2, (iy+17h)
		jr	z, p04loc_458A
		ld	a, (curGY2+1)
		call	PUTEQUNO

p04loc_458A:				; CODE XREF: seg001:4582j
		call	p04loc_48FE
		call	p04sub_4FB9
		jp	Page0Call_3807

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


p04sub_4593:				; CODE XREF: ForceGraphKeypress:p04loc_45DFp
		call	Page0Call_3315
; End of function p04sub_4593


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


p04sub_4596:				; CODE XREF: ForceGraphKeypress+68p
		; seg001:5CB4p
		res	0, (iy+11h)
		set	5, (iy+0Dh)
		ld	hl, noErrorEntry
		ld	(mcxErrorEP), hl
		ret
; End of function p04sub_4596


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


ForceGraphKeypress:
p04loc_45A5:

; FUNCTION CHUNK AT 46FA SIZE 0000006A BYTES
; FUNCTION CHUNK AT 47BC SIZE 000000CA BYTES
; FUNCTION CHUNK AT 4896 SIZE 00000025 BYTES
; FUNCTION CHUNK AT 4A51 SIZE 000002E4 BYTES
; FUNCTION CHUNK AT 4D7D SIZE 000001F4 BYTES
; FUNCTION CHUNK AT 502C SIZE 00000033 BYTES
; FUNCTION CHUNK AT 51A2 SIZE 00000008 BYTES
; FUNCTION CHUNK AT 51D0 SIZE 000000F2 BYTES
; FUNCTION CHUNK AT 52CD SIZE 0000001F BYTES
; FUNCTION CHUNK AT 53B2 SIZE 000000B5 BYTES
; FUNCTION CHUNK AT 5483 SIZE 00000184 BYTES
; FUNCTION CHUNK AT 56E6 SIZE 0000003A BYTES

		ld	b, a
		ld	a, 6
		bit	3, (iy+35h)
		call	nz, Page0Call_330F
		ret	nz
		ld	a, b
		res	5, (iy+14h)
		bit	0, (iy+11h)
		jp	z, p04loc_46FA

p04loc_45BC:				; CODE XREF: ForceGraphKeypress+1A6j
		cp	0FEh ; '�'
		jp	z, Page0Call_3777
		cp	0Ch
		ret	z
		cp	5
		jp	z, p04loc_45DA
		cp	9
		jp	nz, Page0Call_3777
		call	IsEditEmpty
		jr	z, p04loc_45DF
		call	CanAlphIns
		call	Page0Call_378F
		ret
; ---------------------------------------------------------------------------

p04loc_45DA:				; CODE XREF: ForceGraphKeypress+21j
		call	IsEditEmpty
		jr	nz, p04loc_45E8

p04loc_45DF:				; CODE XREF: ForceGraphKeypress+2Cj
		call	p04sub_4593
		call	GRBUFCPY_V
		jp	p04sub_5720
; ---------------------------------------------------------------------------

p04loc_45E8:				; CODE XREF: ForceGraphKeypress+38j
		call	zero_basic_prog
		res	3, (iy+17h)
		call	Page0Call_331B
		call	page0_1851
		scf
		call	p04sub_5AE5

p04loc_45F9:				; CODE XREF: seg001:46DBj
		call	Page0Call_37CB
		call	PopRealO1
		ld	a, 4Fh ; 'O'
		bit	2, (iy+17h)
		jr	z, p04loc_460A
		ld	a, (unk_85FD)

p04loc_460A:				; CODE XREF: ForceGraphKeypress+60j
		ld	(curGStyle), a
		call	p04sub_4596
		ld	a, (curGStyle)
		res	4, (iy+1Eh)
		cp	4Fh ; 'O'
		jr	nz, p04loc_461F
		set	4, (iy+1Eh)

p04loc_461F:				; CODE XREF: ForceGraphKeypress+74j
		cp	52h ; 'R'
		jr	c, p04sub_465B
		bit	3, (iy+17h)
		jr	nz, p04sub_465B
		rst	18h
		set	5, (iy+17h)
		call	p04sub_465B
		res	5, (iy+17h)
		ld	hl, (EQS)
		ld	(FPS), hl
		call	PopRealO1
		ld	a, (curGStyle)
		cp	7Dh ; '}'
		jr	z, p04loc_464D
		cp	6Fh ; 'o'
		jr	c, p04loc_4652
		cp	74h ; 't'
		jr	nc, p04loc_4652

p04loc_464D:				; CODE XREF: ForceGraphKeypress+9Ej
		call	p04sub_5CA7
		jr	nz, p04sub_465B

p04loc_4652:				; CODE XREF: ForceGraphKeypress+A2j
		; ForceGraphKeypress+A6j
		set	0, (iy+2)
		ld	a, 5
		call	ForceGraphKeypress
; End of function ForceGraphKeypress


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


p04sub_465B:				; CODE XREF: ForceGraphKeypress+7Cj
		; ForceGraphKeypress+82j ...

; FUNCTION CHUNK AT 506F SIZE 0000008F BYTES
; FUNCTION CHUNK AT 5136 SIZE 0000006C BYTES
; FUNCTION CHUNK AT 52EC SIZE 000000C6 BYTES
; FUNCTION CHUNK AT 5607 SIZE 00000099 BYTES
; FUNCTION CHUNK AT 5758 SIZE 000000F0 BYTES

		ld	hl, 0
		call	page0_19D
		jr	z, p04loc_468B
		bit	0, (iy+0Fh)
		jr	nz, p04loc_4686
		rst	18h
		call	p04sub_501E
		call	OP1ToOP4
		call	PopRealO2
		call	InvSub
		ld	hl, PlotStep
		call	page0_EC1
		call	int
		call	FPMult
		call	OP4ToOP2
		rst	30h

p04loc_4686:				; CODE XREF: p04sub_465B+Cj
		call	p04sub_6726
		jr	p04loc_46CC
; ---------------------------------------------------------------------------

p04loc_468B:				; CODE XREF: p04sub_465B+6j
		call	page0_13
		jr	nz, p04loc_46B6
		ld	hl, ThetaMin
		call	page0_198
		jr	nz, p04loc_469B
		ld	hl, TminPar

p04loc_469B:				; CODE XREF: p04sub_465B+3Bj
		call	Mov9ToOP2
		push	hl
		call	FPSub
		pop	hl
		ld	de, 9
		add	hl, de
		call	page0_EC1
		call	int
		call	Page0Call_3B5B
		ex	de, hl
		ld	(unk_8E2B), hl
		jr	p04loc_46CC
; ---------------------------------------------------------------------------

p04loc_46B6:				; CODE XREF: p04sub_465B+33j
		rst	18h
		call	p04sub_444F
		ld	l, a
		ld	h, 0
		ld	(unk_8E2B), hl
		call	PopRealO1
		ld	de, OP1
		call	XftoI
		ld	l, a
		ld	h, 0

p04loc_46CC:				; CODE XREF: p04sub_465B+2Ej p04sub_465B+59j
		set	0, (iy+27h)
		jp	p04loc_506F
; End of function p04sub_465B

; ---------------------------------------------------------------------------
		call	p04sub_46DE
		rst	18h
		set	3, (iy+17h)
		jp	p04loc_45F9

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


p04sub_46DE:				; CODE XREF: seg001:46D3p
		; ForceGraphKeypress+599p
		call	page0_13
		call	nz, XName
		call	page0_1A2
		call	nz, TName
		call	page0_198
		call	nz, ThetaName
		call	page0_19D
		call	nz, RECURNNAME
		call	Page0Call_38B5
		ret
; End of function p04sub_46DE

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_46FA:				; CODE XREF: ForceGraphKeypress+14j
		bit	0, (iy+2)
		jr	nz, p04loc_4706
		ld	hl, (freeSaveY)
		ld	(curGY), hl

p04loc_4706:				; CODE XREF: ForceGraphKeypress+159j
		cp	7Fh ; ''
		jp	c, GRDECODA
		ld	b, a
		ld	a, 1
		bit	3, (iy+35h)
		call	nz, Page0Call_330F
		ret	nz
		bit	0, (iy+2)
		jr	z, p04loc_474E
		ld	a, (curPlotNumber)
		or	a
		jr	nz, p04loc_474E
		ld	a, (curGStyle)
		cp	65h ; 'e'
		jr	z, p04loc_474E
		cp	67h ; 'g'
		jr	z, p04loc_474E
		ld	hl, (EQS)
		ld	(FPS), hl
		res	0, (iy+2)
		set	2, (iy+17h)
		push	bc
		push	af
		call	p04sub_4F71
		pop	af
		ld	(curGStyle), a
		ld	(unk_85FD), a
		call	p04loc_48FE
		pop	af
		jp	p04loc_45BC
; ---------------------------------------------------------------------------

p04loc_474E:				; CODE XREF: ForceGraphKeypress+175j
		; ForceGraphKeypress+17Bj ...
		ld	a, (curGStyle)
		cp	2Fh ; '/'
		ld	a, b
		jp	nz, JForceCmd
		res	4, (iy+24h)

TEXT:
		call	Page0Call_3BBB
		call	GDISPTOKEN
		jp	p04loc_489F
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


GDISPTOKEN:				; CODE XREF: ForceGraphKeypress+1B9p
		; seg001:6782j
		ld	bc, (curGY)
		push	bc
		bit	4, (iy+11h)
		jr	nz, p04loc_478B
		push	de
		ld	a, (lcdTallP)
		dec	a
		sub	c
		ld	c, b
		ld	b, a
		ld	(penCol), bc
		pop	de
		push	de
		push	bc
		call	p04sub_47AB
		set	7, (iy+14h)
		pop	bc
		pop	de
		ld	(penCol), bc

p04loc_478B:				; CODE XREF: GDISPTOKEN+9j
		call	p04sub_47AB
		res	7, (iy+14h)
		ld	a, (penCol)
		pop	bc
		ld	b, a
		jr	nc, p04loc_479D
		cp	5Fh ; '_'
		jr	c, p04loc_47A6

p04loc_479D:				; CODE XREF: GDISPTOKEN+33j
		call	Bit_VertSplit
		ld	b, 2Eh ; '.'
		jr	nz, p04loc_47A6
		ld	b, 5Eh ; '^'

p04loc_47A6:				; CODE XREF: GDISPTOKEN+37j
		; GDISPTOKEN+3Ej
		ld	(curGY), bc
		ret
; End of function GDISPTOKEN


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


p04sub_47AB:				; CODE XREF: GDISPTOKEN+1Ap
		; GDISPTOKEN:p04loc_478Bp
		call	Page0Call_3DAD
		inc	hl
		ld	b, a
		set	4, (iy+14h)
		call	Page0Call_3D59
		res	4, (iy+14h)
		ret
; End of function p04sub_47AB

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

GRDECODA:				; CODE XREF: ForceGraphKeypress+163j
		ld	b, a
		ld	a, 7
		bit	3, (iy+35h)
		call	nz, Page0Call_330F
		ret	nz
		ld	a, b
		res	0, (iy+27h)
		res	1, (iy+27h)
		res	2, (iy+27h)
		res	5, (iy+14h)
		cp	5
		jr	c, p04loc_47E6
		cp	0Eh
		jp	c, p04loc_4A51
		cp	10h
		jp	nc, p04loc_4A51

p04loc_47E6:				; CODE XREF: ForceGraphKeypress+235j
		ld	d, a
		ld	a, 2
		bit	3, (iy+35h)
		call	nz, Page0Call_330F
		ret	nz
		ld	a, (curGStyle)
		cp	4Dh ; 'M'
		jr	z, p04loc_4811
		bit	0, (iy+2)
		jr	z, p04loc_4817
		cp	5
		jr	z, p04loc_4811
		cp	4Fh ; 'O'
		ld	a, d
		jp	nz, p04loc_51D0
		cp	3

p04loc_480A:				; CODE XREF: ForceGraphKeypress+26Aj
		jp	z, p04loc_51D0
		cp	4
		jr	z, p04loc_480A

p04loc_4811:				; CODE XREF: ForceGraphKeypress+251j
		; ForceGraphKeypress+25Bj
		call	Page0Call_3EFD
		call	p04sub_5CEA

p04loc_4817:				; CODE XREF: ForceGraphKeypress+257j
		ld	a, (curGStyle)
		or	a
		jr	nz, p04loc_4822
		ld	a, 7
		ld	(curGStyle), a

p04loc_4822:				; CODE XREF: ForceGraphKeypress+276j
		ld	a, d
		ld	bc, (curGY)
		cp	2
		jr	z, p04loc_4830
		jr	nc, p04loc_4836
		inc	b
		jr	p04loc_485A
; ---------------------------------------------------------------------------

p04loc_4830:				; CODE XREF: ForceGraphKeypress+284j
		dec	b
		jr	p04loc_485A
; ---------------------------------------------------------------------------

p04loc_4833:				; CODE XREF: ForceGraphKeypress+293j
		dec	c
		jr	p04loc_485A
; ---------------------------------------------------------------------------

p04loc_4836:				; CODE XREF: ForceGraphKeypress+286j
		cp	4
		jr	z, p04loc_4833
		jr	c, p04loc_4859
		cp	0Eh
		ld	a, b
		jr	nz, p04loc_484A
		sub	5
		ld	b, a
		jr	nc, p04loc_4860
		ld	b, 0
		jr	p04loc_4860
; ---------------------------------------------------------------------------

p04loc_484A:				; CODE XREF: ForceGraphKeypress+29Aj
		add	a, 5
		ld	hl, pixWide_m_1
		cp	(hl)
		jr	c, p04loc_4856
		ld	b, (hl)
		dec	b
		jr	p04loc_4860
; ---------------------------------------------------------------------------

p04loc_4856:				; CODE XREF: ForceGraphKeypress+2ABj
		ld	b, a
		jr	p04loc_4860
; ---------------------------------------------------------------------------

p04loc_4859:				; CODE XREF: ForceGraphKeypress+295j
		inc	c

p04loc_485A:				; CODE XREF: ForceGraphKeypress+289j
		; ForceGraphKeypress+28Cj ...
		call	IBounds
		jp	c, p04loc_48AE

p04loc_4860:				; CODE XREF: ForceGraphKeypress+29Fj
		; ForceGraphKeypress+2A3j ...
		call	CheckSplitFlag
		jr	z, p04loc_486A
		ld	a, c
		cp	20h ; ' '
		jr	nc, p04loc_48AE

p04loc_486A:				; CODE XREF: ForceGraphKeypress+2BEj
		call	Bit_VertSplit
		jr	z, p04loc_4874
		ld	a, c
		cp	34h ; '4'
		jr	nc, p04loc_48AE

p04loc_4874:				; CODE XREF: ForceGraphKeypress+2C8j
		ld	a, (curGStyle)
		cp	2Fh ; '/'
		jr	nz, p04loc_4896
		call	CHKTEXTCURS
		jr	nc, p04loc_48AE
		ld	(curGY), bc
		jr	p04loc_489F
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


p04sub_4886:				; CODE XREF: p04sub_465B:p04loc_53AEp
		set	3, (iy+2)
		set	7, (iy+8)
		ld	hl, (curGY)
		ld	(freeSaveY), hl
		jr	p04loc_48C2
; End of function p04sub_4886

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_4896:				; CODE XREF: ForceGraphKeypress+2D4j
		; ForceGraphKeypress:p04loc_5717j
		ld	(curGY), bc
		cp	2Dh ; '-'
		call	z, PointOn

p04loc_489F:				; CODE XREF: ForceGraphKeypress+1BCj
		; ForceGraphKeypress+2DFj ...
		ld	hl, OP6
		call	p04sub_43C2
		call	Page0Call_3321
		call	OP6ToOP1
		call	Page0Call_3327

p04loc_48AE:				; CODE XREF: ForceGraphKeypress+2B8j
		; ForceGraphKeypress+2C3j ...
		call	VALCUR
		set	7, (iy+8)

p04loc_48B5:				; CODE XREF: ForceGraphKeypress+CB5j
		; p04sub_465B+D50j ...
		ld	hl, (curGY)
		ld	(freeSaveY), hl
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


LABCOOR:				; CODE XREF: seg001:4536p seg001:4558p ...

; FUNCTION CHUNK AT 761E SIZE 00000008 BYTES
; FUNCTION CHUNK AT 764B SIZE 00000003 BYTES
; FUNCTION CHUNK AT 765C SIZE 00000005 BYTES
; FUNCTION CHUNK AT 767A SIZE 0000000B BYTES
; FUNCTION CHUNK AT 768B SIZE 00000017 BYTES
; FUNCTION CHUNK AT 7898 SIZE 00000098 BYTES
; FUNCTION CHUNK AT 7974 SIZE 00000006 BYTES

		call	GRLABELS

COORDISP:				; CODE XREF: seg001:651Cp
		res	3, (iy+2)

p04loc_48C2:				; CODE XREF: p04sub_4886+Ej
		ld	a, (curGStyle)
		or	a
		ret	z
		bit	2, (iy+17h)
		ret	nz
		cp	4Dh ; 'M'
		ret	z
		cp	2Fh ; '/'
		ret	z
		cp	5
		jp	z, PutXY
		bit	0, (iy+2)
		jr	z, p04loc_4948
		ld	a, (curPlotNumber)
		or	a
		jr	z, p04loc_48F4
		call	Page0Call_358B
		bit	4, (iy+4)
		jr	nz, p04loc_48FE
		ld	a, (curGStyle)
		cp	7Fh ; ''
		jr	nc, p04loc_48FE
		ret
; ---------------------------------------------------------------------------

p04loc_48F4:				; CODE XREF: LABCOOR+26j
		ld	a, (curGY2+1)
		bit	3, (iy+2)
		call	z, PUTEQUNO

p04loc_48FE:				; CODE XREF: seg001:456Ep
		; seg001:p04loc_458Ap ...
		ld	a, (curGStyle)
		cp	5Fh ; '_'
		jp	z, p04loc_78D0
		cp	61h ; 'a'
		jp	z, p04loc_78DE
		cp	53h ; 'S'
		jr	z, p04loc_4923
		cp	65h ; 'e'
		jp	z, p04loc_78A6
		cp	67h ; 'g'
		jp	z, p04loc_78B4
		cp	59h ; 'Y'
		jr	z, p04loc_4934
		cp	55h ; 'U'
		jr	z, p04loc_493D
		cp	69h ; 'i'

p04loc_4923:				; CODE XREF: LABCOOR+52j LABCOOR+6Dj ...
		jp	z, p04loc_7898
		cp	7Fh ; ''
		jr	z, p04loc_4923
		cp	81h ; '�'
		jr	z, p04loc_493D
		cp	6Bh ; 'k'
		jr	z, p04loc_493D
		cp	6Dh ; 'm'

p04loc_4934:				; CODE XREF: LABCOOR+60j LABCOOR+87j ...
		jp	z, p04loc_78EC
		cp	77h ; 'w'
		jr	z, p04loc_4923
		cp	79h ; 'y'

p04loc_493D:				; CODE XREF: LABCOOR+64j LABCOOR+71j ...
		jp	z, p04loc_78C2
		cp	7Bh ; '{'
		jr	z, p04loc_4934
		cp	57h ; 'W'
		jr	z, p04loc_4934

p04loc_4948:				; CODE XREF: LABCOOR+20j
		bit	0, (iy+11h)
		ret	nz
		cp	4Fh ; 'O'
		jr	z, p04loc_4956
		bit	4, (iy+4)
		ret	nz

p04loc_4956:				; CODE XREF: LABCOOR+94j
		set	6, (iy+1Dh)
		call	page0_198
		jr	z, p04loc_498D
		bit	0, (iy+2)
		jr	z, p04loc_498D
		bit	3, (iy+2)
		jr	z, p04loc_4983
		call	CLRGRAPHXY
		bit	3, (iy+4)
		jr	z, p04loc_497A
		call	p04sub_7685
		jp	FINISHSPEC
; ---------------------------------------------------------------------------

p04loc_497A:				; CODE XREF: LABCOOR+B7j
		call	PutXY
		call	FINISHSPEC
		jp	p04loc_761E
; ---------------------------------------------------------------------------

p04loc_4983:				; CODE XREF: LABCOOR+AEj
		bit	3, (iy+4)
		jp	nz, p04sub_7685
		jp	p04loc_767A
; ---------------------------------------------------------------------------

p04loc_498D:				; CODE XREF: LABCOOR+A2j LABCOOR+A8j
		bit	3, (iy+4)
		jp	z, p04loc_4A06
		bit	6, (iy+3)
		jp	nz, p04loc_4A06
		bit	7, (iy+3)
		jp	nz, p04loc_4A06
		ld	hl, p04loc_4A06
		call	pushErrorHandleR
		call	RName
		rst	10h
		jr	c, p04loc_49B3
		bit	6, (hl)
		jp	nz, ErrOverflow

p04loc_49B3:				; CODE XREF: LABCOOR+F1j
		call	ThetaName
		rst	10h
		jr	c, p04loc_49BE
		bit	6, (hl)
		jp	nz, ErrOverflow

p04loc_49BE:				; CODE XREF: LABCOOR+FCj
		call	Page0Call_353D
		rst	8
		call	Page0Call_38F1
		call	Page0Call_3AD1
		call	CkValidNum
		call	popErrorHandleR
		call	PushRealO2
		call	Page0Call_332D
		call	PopRealO1
		call	Page0Call_3333
		bit	0, (iy+2)
		jp	z, p04sub_7685
		bit	3, (iy+2)
		jr	z, p04loc_49FD
		call	CLRGRAPHXY
		call	p04sub_7685
		call	FINISHSPEC
		call	page0_19D
		call	nz, p04sub_7661
		call	page0_1A2
		ret	z
		jp	p04sub_762E
; ---------------------------------------------------------------------------

p04loc_49FD:				; CODE XREF: LABCOOR+12Aj
		call	page0_1A2
		jp	nz, p04loc_7682
		jp	p04sub_7685
; ---------------------------------------------------------------------------

p04loc_4A06:				; CODE XREF: LABCOOR+D6j LABCOOR+DDj ...
		bit	0, (iy+2)
		jp	z, PutXY
		call	page0_19D
		jr	z, p04loc_4A1F
		bit	3, (iy+2)
		jp	z, p04loc_765C
		call	p04sub_4A31
		jp	p04sub_7661
; ---------------------------------------------------------------------------

p04loc_4A1F:				; CODE XREF: LABCOOR+155j
		call	page0_1A2
		jr	z, p04sub_4A31
		bit	3, (iy+2)
		jp	z, p04loc_764B
		call	p04sub_4A31
		jp	p04sub_762E
; End of function LABCOOR


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


p04sub_4A31:				; CODE XREF: LABCOOR+15Ep LABCOOR+167j ...
		bit	3, (iy+2)
		call	nz, CLRGRAPHXY
		call	PutXY
		bit	3, (iy+2)
		ret	z
; End of function p04sub_4A31


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


FINISHSPEC:				; CODE XREF: LABCOOR+BCj LABCOOR+C2p ...
		call	Page0Call_3EFD
; End of function FINISHSPEC


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


p04sub_4A43:				; CODE XREF: LABCOOR+3051p
		call	GRLABELS
		ld	a, (curGY2+1)
		call	PUTEQUNO
		res	3, (iy+2)
		ret
; End of function p04sub_4A43

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_4A51:				; CODE XREF: ForceGraphKeypress+239j
		; ForceGraphKeypress+23Ej
		cp	5
		jp	nz, p04loc_4ED0
		bit	0, (iy+2)
		jp	z, p04loc_4DB3
		call	Page0Call_3EFD
		ld	a, (curGStyle)
		cp	51h ; 'Q'
		jp	z, p04loc_4D7D
		cp	7Dh ; '}'
		jr	nz, p04loc_4AE2
		bit	2, (iy+17h)
		jr	z, p04loc_4A76
		pop	de
		call	p04sub_6715

p04loc_4A76:				; CODE XREF: ForceGraphKeypress+4CBj
		call	p04sub_5CA7
		jp	nz, LABCOOR
		bit	2, (iy+3)
		push	af
		ld	hl, (curGY)
		push	hl
		call	Page0Call_38F1
		ld	de, 8D8Fh
		call	MovFrOP1
		call	MATHTANLN
		pop	hl
		ld	(curGY), hl
		call	CkOP1Real
		jr	nz, p04loc_4ACC
		call	CkValidNum
		call	Page0Call_3339
		call	page0_13
		jr	z, p04loc_4ABA
		ld	hl, 8D8Fh
		rst	20h
		call	Page0Call_3321
		call	p04sub_7636
		call	OP2ToOP1
		call	TAN_EQU_DISP
		call	markTableDirty
		jr	p04loc_4ABD
; ---------------------------------------------------------------------------

p04loc_4ABA:				; CODE XREF: ForceGraphKeypress+4FEj
		call	p04sub_787A

p04loc_4ABD:				; CODE XREF: ForceGraphKeypress+513j
		; ForceGraphKeypress+53Bj
		call	GRLABELS
		pop	af
		ret	z
		set	2, (iy+3)
		ld	a, 4Dh ; 'M'
		ld	(curGStyle), a
		ret
; ---------------------------------------------------------------------------

p04loc_4ACC:				; CODE XREF: ForceGraphKeypress+4F3j
		ld	hl, p04loc_7A20
		call	setPenX
		set	1, (iy+5)
		call	Page04_3348
		call	p04sub_7A03
		res	1, (iy+5)
		jr	p04loc_4ABD
; ---------------------------------------------------------------------------

p04loc_4AE2:				; CODE XREF: ForceGraphKeypress+4C5j
		cp	6Fh ; 'o'
		jr	z, p04loc_4AF3
		cp	73h ; 's'
		jr	z, p04loc_4AF3
		cp	71h ; 'q'
		jr	z, p04loc_4AF3
		cp	63h ; 'c'
		jp	nz, p04loc_4B7B

p04loc_4AF3:				; CODE XREF: ForceGraphKeypress+53Fj
		; ForceGraphKeypress+543j ...
		bit	2, (iy+17h)
		jr	z, p04loc_4AFA
		pop	hl

p04loc_4AFA:				; CODE XREF: ForceGraphKeypress+552j
		call	p04sub_5CA7
		jr	z, p04loc_4B09
		call	p04sub_6715
		call	LABCOOR
		call	p04sub_5CEA
		ret
; ---------------------------------------------------------------------------

p04loc_4B09:				; CODE XREF: ForceGraphKeypress+558j
		bit	2, (iy+3)
		push	af
		ld	hl, (pTempCnt)
		push	hl
		call	Page0Call_334B
		ld	a, (curGStyle)
		call	page0_13
		jr	nz, p04loc_4B43
		call	page0_198
		jr	nz, p04loc_4B48
		cp	63h ; 'c'
		jr	nz, p04loc_4B5C
		call	page0_17E0
		push	hl
		rst	18h
		pop	hl
		res	0, (hl)
		call	Page0Call_38D3

p04loc_4B31:				; CODE XREF: ForceGraphKeypress+5A1j
		; ForceGraphKeypress+5ADj
		ld	hl, p04loc_7A20

p04loc_4B34:				; CODE XREF: ForceGraphKeypress+5B5j
		; ForceGraphKeypress+5C4j ...
		call	CkOP1Real
		jp	nz, ErrDomain
		call	p04sub_6419
		pop	af
		call	p04sub_46DE
		jr	p04loc_4BBD
; ---------------------------------------------------------------------------

p04loc_4B43:				; CODE XREF: ForceGraphKeypress+576j
		call	Page0Call_38BB
		jr	p04loc_4B31
; ---------------------------------------------------------------------------

p04loc_4B48:				; CODE XREF: ForceGraphKeypress+57Bj
		cp	6Fh ; 'o'
		jr	z, p04loc_4B54
		call	Page0Call_38CD
		call	fpdiv
		jr	p04loc_4B31
; ---------------------------------------------------------------------------

p04loc_4B54:				; CODE XREF: ForceGraphKeypress+5A5j
		call	Page0Call_38C1
		ld	hl, p04loc_6735
		jr	p04loc_4B34
; ---------------------------------------------------------------------------

p04loc_4B5C:				; CODE XREF: ForceGraphKeypress+57Fj
		cp	73h ; 's'
		jr	z, p04loc_4B6B
		call	page0_17E0
		call	Page0Call_38C7
		ld	hl, p04loc_6743
		jr	p04loc_4B34
; ---------------------------------------------------------------------------

p04loc_4B6B:				; CODE XREF: ForceGraphKeypress+5B9j
		call	Page0Call_38C7
		ld	hl, p04loc_673C
		jr	p04loc_4B34
; ---------------------------------------------------------------------------

p04loc_4B73:				; CODE XREF: ForceGraphKeypress+5FFj
		; ForceGraphKeypress+62Dj ...
		call	Page0Call_38F1
		ld	de, 8D98h
		jr	p04loc_4B8C
; ---------------------------------------------------------------------------

p04loc_4B7B:				; CODE XREF: ForceGraphKeypress+54Bj
		cp	7Fh ; ''
		jr	z, p04loc_4B86
		cp	81h ; '�'
		ret	z
		cp	53h ; 'S'
		jr	nz, p04loc_4BA2

p04loc_4B86:				; CODE XREF: ForceGraphKeypress+5D8j
		; ForceGraphKeypress+625j ...
		call	Page0Call_38F1
		ld	de, 8D8Fh

p04loc_4B8C:				; CODE XREF: ForceGraphKeypress+5D4j
		call	MovFrOP1
		ld	a, (curGStyle)
		add	a, 2
		ld	(curGStyle), a
		bit	2, (iy+17h)
		ret	nz
		call	GrBufCpy
		jp	LABCOOR
; ---------------------------------------------------------------------------

p04loc_4BA2:				; CODE XREF: ForceGraphKeypress+5DFj
		cp	55h ; 'U'
		jr	z, p04loc_4B73
		cp	57h ; 'W'
		jr	nz, p04loc_4BC8
		call	p04sub_4D54
		push	hl
		call	Page0Call_3351
		call	Page0Call_3321
		call	p04sub_5B86
		call	p04sub_7968

p04loc_4BBA:				; CODE XREF: ForceGraphKeypress+693j
		; ForceGraphKeypress+78Dj
		call	Page0Call_38F1

p04loc_4BBD:				; CODE XREF: ForceGraphKeypress+59Cj
		set	4, (iy+17h)
		set	2, (iy+17h)
		jp	p04sub_465B
; ---------------------------------------------------------------------------

p04loc_4BC8:				; CODE XREF: ForceGraphKeypress+603j
		cp	5Fh ; '_'
		jr	z, p04loc_4B86
		cp	69h ; 'i'
		jr	z, p04loc_4B86
		cp	6Bh ; 'k'
		jr	z, p04loc_4B73
		cp	77h ; 'w'
		jr	z, p04loc_4B86
		cp	79h ; 'y'
		jr	z, p04loc_4B73
		cp	61h ; 'a'
		jr	nz, p04loc_4BEE
		call	p04sub_4D5C
		push	hl
		call	Page0Call_3357
		ld	hl, p04loc_672C
		call	p04sub_6419
		ret
; ---------------------------------------------------------------------------

p04loc_4BEE:				; CODE XREF: ForceGraphKeypress+639j
		cp	6Dh ; 'm'
		jr	nz, p04loc_4C3B
		or	a

p04loc_4BF3:				; CODE XREF: ForceGraphKeypress+699j
		push	af
		bit	2, (iy+17h)
		jr	z, p04loc_4BFD
		pop	af
		pop	de
		push	af

p04loc_4BFD:				; CODE XREF: ForceGraphKeypress+653j
		call	p04sub_6715
		call	p04sub_4D54
		pop	af
		push	hl
		push	af
		call	OP1ToOP5
		call	PopRealO3
		call	PopRealO1
		rst	8
		call	XName
		call	OP1ToOP4
		call	OP1Set1
		ld	a, 7Bh ; '{'
		ld	(OP1+1), a
		call	OP1ExOP5
		pop	af
		push	af
		ld	b, 0
		call	Page0Call_397B
		pop	af
		pop	hl
		push	af
		push	hl
		call	p04sub_5B86
		pop	af
		push	af
		call	c, p04sub_794C
		pop	af
		call	nc, p04sub_793E
		jp	p04loc_4BBA
; ---------------------------------------------------------------------------

p04loc_4C3B:				; CODE XREF: ForceGraphKeypress+64Bj
		cp	7Bh ; '{'
		scf
		jr	z, p04loc_4BF3
		cp	65h ; 'e'
		jr	nz, p04loc_4C78
		call	p04sub_5CA7
		jp	nz, LABCOOR
		ld	a, (curGY2+1)
		ld	(OP1M), a
		ld	hl, (unk_980E)
		ld	(unk_847D), hl
		ld	hl, (unk_9810)
		ld	(unk_847B), hl
		ld	a, 67h ; 'g'
		ld	(curGStyle), a
		ld	hl, (curGY)
		bit	2, (iy+3)
		jr	nz, p04loc_4C6C
		set	7, l

p04loc_4C6C:				; CODE XREF: ForceGraphKeypress+6C3j
		ld	(unk_847F), hl
		ld	de, 8D8Fh
		call	MovFrOP1
		jp	p04loc_51A2
; ---------------------------------------------------------------------------

p04loc_4C78:				; CODE XREF: ForceGraphKeypress+69Dj
		cp	67h ; 'g'
		jp	nz, p04loc_4CB7
		call	p04sub_5CA7
		jp	nz, LABCOOR
		ld	hl, 8D8Fh
		rst	20h
		ld	hl, curGX2
		ld	a, (OP1M)
		cp	(hl)
		jr	nz, p04loc_4C9B
		ld	hl, (unk_980E)
		ld	de, (unk_847D)
		sbc	hl, de
		jr	z, p04loc_4CB4

p04loc_4C9B:				; CODE XREF: ForceGraphKeypress+6E9j
		ld	hl, (curGY)
		bit	2, (iy+3)
		jr	nz, p04loc_4CA6
		set	7, l

p04loc_4CA6:				; CODE XREF: ForceGraphKeypress+6FDj
		ld	(OP1), hl
		ld	de, 8D8Fh
		call	MovFrOP1
		ld	a, 59h ; 'Y'
		ld	(curGStyle), a

p04loc_4CB4:				; CODE XREF: ForceGraphKeypress+6F4j
		jp	LABCOOR
; ---------------------------------------------------------------------------

p04loc_4CB7:				; CODE XREF: ForceGraphKeypress+6D5j
		cp	59h ; 'Y'
		jp	nz, p04sub_5CEA
		bit	2, (iy+17h)
		jr	z, p04loc_4CC3
		pop	hl

p04loc_4CC3:				; CODE XREF: ForceGraphKeypress+71Bj
		ld	l, 13h
		call	p04sub_4D35
		push	de
		ld	hl, 8D8Fh
		rst	20h
		ld	a, (OP1M)
		ld	(unk_847F), a
		ld	h, 41h ; 'A'
		ld	l, 63h ; 'c'
		ld	(OP1+1), hl
		pop	de
		ld	hl, 8479h
		call	page0_1189
		ld	a, (hl)
		call	p04sub_4D45
		push	de
		ld	hl, (unk_980E)
		ld	(unk_847D), hl
		ld	hl, (unk_9810)
		ld	(unk_847B), hl
		ld	h, 41h ; 'A'
		ld	l, 63h ; 'c'
		ld	(OP1+1), hl
		ld	a, 71h ; 'q'
		ld	hl, OP1
		ld	(hl), a
		pop	de
		call	Mov7B2
		call	p04sub_4D42
		call	OP4ToOP1
		rst	18h
		rst	18h
		ld	hl, (pTempCnt)
		push	hl
		ld	a, 5
		ld	(curGStyle), a
		call	VALCUR
		call	XName
		rst	18h
		call	Page0Call_335D
		call	Page0Call_3321
		call	PopRealO1
		rst	10h
		jr	c, p04loc_4D29
		set	7, (hl)

p04loc_4D29:				; CODE XREF: ForceGraphKeypress+780j
		call	Page0Call_38F1
		call	p04sub_5B86
		call	p04sub_795A
		jp	p04loc_4BBA
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


p04sub_4D35:				; CODE XREF: ForceGraphKeypress+720p
		ld	h, 0
; End of function p04sub_4D35


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


TMPEQUNOSRC:				; CODE XREF: MATHTANLN+4Ap
		call	CreateTempEqu
		inc	de
		inc	de
		xor	a
		ld	(de), a
		inc	de
		ld	(de), a
		inc	de
		ret
; End of function TMPEQUNOSRC


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


p04sub_4D42:				; CODE XREF: ForceGraphKeypress+75Ep
		ld	a, (curGY2+1)
; End of function p04sub_4D42


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


p04sub_4D45:				; CODE XREF: ForceGraphKeypress+73Dp
		push	de
		call	Page0Call_3363
		pop	de
		ld	a, 5Eh ; '^'
		ld	(de), a
		inc	de
		ld	a, (OP1M)
		ld	(de), a
		inc	de
		ret
; End of function p04sub_4D45


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


p04sub_4D54:				; CODE XREF: ForceGraphKeypress+605p
		; ForceGraphKeypress+65Bp
		ld	hl, 8D8Fh
		call	PushReal
		jr	p04loc_4D5F
; End of function p04sub_4D54


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


p04sub_4D5C:				; CODE XREF: ForceGraphKeypress+63Bp
		ld	hl, 8D8Fh

p04loc_4D5F:				; CODE XREF: p04sub_4D54+6j
		call	PushReal
		pop	hl
		bit	2, (iy+17h)
		jr	z, p04loc_4D6D
		pop	de
		call	p04sub_6715

p04loc_4D6D:				; CODE XREF: p04sub_4D5C+Bj
		push	hl
		ld	a, 5
		ld	(curGStyle), a
		call	VALCUR
		call	Page0Call_334B
		ld	hl, (pTempCnt)
		ret
; End of function p04sub_4D5C

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_4D7D:				; CODE XREF: ForceGraphKeypress+4C0j
		bit	6, (iy+3)
		jr	nz, p04loc_4DA2
		bit	7, (iy+3)
		jr	nz, p04loc_4DA2
		ld	hl, OP6
		call	page0_1254
		ld	hl, p04loc_6094
		call	pushErrorHandleR
		xor	a
		ld	hl, OP6
		ld	de, OP6
		call	Page0Call_35DF
		call	popErrorHandleR

p04loc_4DA2:				; CODE XREF: ForceGraphKeypress+7DCj
		; ForceGraphKeypress+7E2j
		call	TraceOff
		call	CentCursor
		call	SetTblGraphDraw
		ld	a, 5Ah ; 'Z'
		jp	ForceGraphKeypress
; ---------------------------------------------------------------------------

p04loc_4DB0:				; CODE XREF: ForceGraphKeypress+8BEj
		jp	p04loc_4F3D
; ---------------------------------------------------------------------------

p04loc_4DB3:				; CODE XREF: ForceGraphKeypress+4B5j
		ld	a, (curGStyle)
		cp	1Dh
		jr	nz, p04loc_4DC9
		ld	bc, (curGY)
		ld	de, (curGY2)
		call	DarkLine
		ld	a, 1Bh
		jr	p04loc_4DD3
; ---------------------------------------------------------------------------

p04loc_4DC9:				; CODE XREF: ForceGraphKeypress+813j
		cp	27h ; '''
		jr	nz, p04loc_4DD6
		xor	a
		call	Page0Call_35EB
		ld	a, 25h ; '%'

p04loc_4DD3:				; CODE XREF: ForceGraphKeypress+822j
		; ForceGraphKeypress+862j
		jp	p04loc_56FE
; ---------------------------------------------------------------------------

p04loc_4DD6:				; CODE XREF: ForceGraphKeypress+826j
		cp	0Bh
		jr	nz, p04loc_4DE3
		ld	hl, p04loc_6094
		call	pushErrorHandleR
		scf
		jr	p04loc_4DEE
; ---------------------------------------------------------------------------

p04loc_4DE3:				; CODE XREF: ForceGraphKeypress+833j
		cp	0Dh
		jr	nz, p04loc_4E0C
		ld	hl, p04loc_6094
		call	pushErrorHandleR
		or	a

p04loc_4DEE:				; CODE XREF: ForceGraphKeypress+83Cj
		ld	hl, YFact
		ld	de, XFact
		call	Page0Call_35DF
		call	popErrorHandleR
		ld	a, (curGStyle)
		call	SetTblGraphDraw
		call	Regraph
		bit	0, (iy+3)
		jr	z, p04loc_4DD3
		jp	p04loc_5470
; ---------------------------------------------------------------------------

p04loc_4E0C:				; CODE XREF: ForceGraphKeypress+840j
		cp	29h ; ')'
		jr	nz, p04loc_4E15
		call	p04sub_4017
		jr	p04loc_4E4D
; ---------------------------------------------------------------------------

p04loc_4E15:				; CODE XREF: ForceGraphKeypress+869j
		cp	31h ; '1'
		jr	nz, p04loc_4E1E
		call	HorizontalLine
		jr	p04loc_4E4D
; ---------------------------------------------------------------------------

p04loc_4E1E:				; CODE XREF: ForceGraphKeypress+872j
		cp	2Bh ; '+'
		jr	nz, p04loc_4E2B
		ld	a, 2Dh ; '-'
		ld	(curGStyle), a
		ld	d, 1
		jr	p04loc_4E46
; ---------------------------------------------------------------------------

p04loc_4E2B:				; CODE XREF: ForceGraphKeypress+87Bj
		cp	2Dh ; '-'
		jr	nz, p04loc_4E36
		ld	a, 2Bh ; '+'
		ld	(curGStyle), a
		jr	p04loc_4E4D
; ---------------------------------------------------------------------------

p04loc_4E36:				; CODE XREF: ForceGraphKeypress+888j
		ld	d, 0
		cp	21h ; '!'
		jr	z, p04loc_4E46
		inc	d
		cp	1Fh
		jr	z, p04loc_4E46
		inc	d
		cp	23h ; '#'
		jr	nz, p04loc_4E50

p04loc_4E46:				; CODE XREF: ForceGraphKeypress+884j
		; ForceGraphKeypress+895j ...
		ld	bc, (curGY)
		call	IPoint

p04loc_4E4D:				; CODE XREF: ForceGraphKeypress+86Ej
		; ForceGraphKeypress+877j ...
		jp	p04loc_48AE
; ---------------------------------------------------------------------------

p04loc_4E50:				; CODE XREF: ForceGraphKeypress+89Fj
		cp	15h
		jr	nz, p04loc_4E66
		call	p04sub_5CEA
		call	Page0Call_38F1
		call	OP1ToOP5
		call	Page0Call_353D
		call	ZmInt
		jp	p04loc_4DB0
; ---------------------------------------------------------------------------

p04loc_4E66:				; CODE XREF: ForceGraphKeypress+8ADj
		cp	13h
		jr	nz, p04loc_4E6E
		ld	a, 9
		jr	p04loc_4EC4
; ---------------------------------------------------------------------------

p04loc_4E6E:				; CODE XREF: ForceGraphKeypress+8C3j
		cp	9
		jp	nz, p04loc_4EB5
		call	p04sub_5CEA
		ld	hl, (curGY2)
		ld	de, (curGY)
		ld	a, h
		cp	d
		jp	z, Page0Call_250D
		jr	c, p04loc_4E85
		ex	de, hl

p04loc_4E85:				; CODE XREF: ForceGraphKeypress+8DDj
		ld	a, l
		cp	e
		jp	z, Page0Call_250D
		jr	c, p04loc_4E8E
		ld	l, e
		ld	e, a

p04loc_4E8E:				; CODE XREF: ForceGraphKeypress+8E5j
		ld	(curGY2), hl
		ld	(curGY), de
		ld	c, l
		ld	b, h
		ld	de, OP5
		ld	hl, OP6
		call	p04sub_43C5
		ld	bc, (curGY)
		call	VtoWHLDE
		call	COPYRNG
		call	p04sub_5EF2
		call	SetTblGraphDraw
		ld	a, 5Fh ; '_'
		jp	ForceGraphKeypress
; ---------------------------------------------------------------------------

p04loc_4EB5:				; CODE XREF: ForceGraphKeypress+8CBj
		cp	25h ; '%'
		jr	nz, p04loc_4EBD
		ld	a, 27h ; '''
		jr	p04loc_4EC4
; ---------------------------------------------------------------------------

p04loc_4EBD:				; CODE XREF: ForceGraphKeypress+912j
		cp	1Bh
		jp	nz, p04sub_5CEA
		ld	a, 1Dh

p04loc_4EC4:				; CODE XREF: ForceGraphKeypress+8C7j
		; ForceGraphKeypress+916j
		ld	(curGStyle), a
		ld	hl, (curGY)
		ld	(curGY2), hl
		jp	p04loc_48AE
; ---------------------------------------------------------------------------

p04loc_4ED0:				; CODE XREF: ForceGraphKeypress+4AEj
		cp	63h ; 'c'
		jr	nz, p04loc_4EDC
		call	COPYRNG
		call	ZooDefault
		jr	p04loc_4F3D
; ---------------------------------------------------------------------------

p04loc_4EDC:				; CODE XREF: ForceGraphKeypress+92Dj
		cp	5Bh ; '['
		jr	nz, p04loc_4EE5
		call	ZmFit
		jr	p04loc_4F3D
; ---------------------------------------------------------------------------

p04loc_4EE5:				; CODE XREF: ForceGraphKeypress+939j
		cp	65h ; 'e'
		jr	nz, p04loc_4EEE
		call	ZmUsr
		jr	p04loc_4F3D
; ---------------------------------------------------------------------------

p04loc_4EEE:				; CODE XREF: ForceGraphKeypress+942j
		cp	5Eh ; '^'
		jr	nz, p04loc_4EF7
		call	ZmPrev
		jr	p04loc_4F3D
; ---------------------------------------------------------------------------

p04loc_4EF7:				; CODE XREF: ForceGraphKeypress+94Bj
		cp	62h ; 'b'
		jr	nz, p04loc_4F00
		call	ZmSquare
		jr	p04loc_4F3D
; ---------------------------------------------------------------------------

p04loc_4F00:				; CODE XREF: ForceGraphKeypress+954j
		cp	60h ; '`'
		jr	nz, p04loc_4F09
		call	ZmDecml
		jr	p04loc_4F3D
; ---------------------------------------------------------------------------

p04loc_4F09:				; CODE XREF: ForceGraphKeypress+95Dj
		cp	66h ; 'f'
		jr	nz, p04loc_4F12
		call	SETUZM
		jr	p04loc_4F43
; ---------------------------------------------------------------------------

p04loc_4F12:				; CODE XREF: ForceGraphKeypress+966j
		cp	68h ; 'h'
		jr	nz, p04loc_4F1D
		ld	a, 8Fh ; '�'
		call	Page0Call_35EB
		jr	p04loc_4F3D
; ---------------------------------------------------------------------------

p04loc_4F1D:				; CODE XREF: ForceGraphKeypress+96Fj
		cp	44h ; 'D'
		jr	z, p04loc_4F43
		cp	6Bh ; 'k'
		jr	z, p04loc_4F3D
		cp	9
		jr	nz, p04loc_4F36
		call	Page0Call_3EFD
		ld	a, (curGStyle)
		or	a
		jp	z, JForceCmd

p04loc_4F33:				; CODE XREF: ForceGraphKeypress+9BFj
		jp	p04sub_5720
; ---------------------------------------------------------------------------

p04loc_4F36:				; CODE XREF: ForceGraphKeypress+982j
		cp	64h ; 'd'
		jr	nz, p04loc_4F52
		call	ZmTrig

p04loc_4F3D:				; CODE XREF: ForceGraphKeypress:p04loc_4DB0j
		; ForceGraphKeypress+935j ...
		call	SetTblGraphDraw
		xor	a
		jr	p04loc_4F52
; ---------------------------------------------------------------------------

p04loc_4F43:				; CODE XREF: ForceGraphKeypress+96Bj
		; ForceGraphKeypress+97Aj ...
		bit	0, (iy+3)
		push	af
		call	nz, Regraph
		pop	af
		call	z, GRBUFCPY_V
		jp	p04sub_5720
; ---------------------------------------------------------------------------

p04loc_4F52:				; CODE XREF: ForceGraphKeypress+993j
		; ForceGraphKeypress+99Cj
		bit	0, (iy+3)
		push	af
		call	nz, Regraph
		pop	af
		push	af
		call	z, GRBUFCPY_V
		pop	af
		bit	0, (iy+3)
		jr	nz, p04loc_4F33
		cp	75h ; 'u'
		jp	nz, p04loc_502C
		xor	a
		ld	(unk_85FD), a
		jr	p04loc_4F7B
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


p04sub_4F71:				; CODE XREF: ForceGraphKeypress+198p
		res	3, (iy+0Ch)
		call	GrBufCpy
		call	GRLABELS

p04loc_4F7B:				; CODE XREF: ForceGraphKeypress+9CAj
		call	Page04_33C0
		ld	hl, (EQS)
		ld	(FPS), hl
		jp	z, p04sub_5720
		call	p04sub_5720
		call	p04sub_4FB9
		ld	a, (curGY2+1)
		bit	2, (iy+17h)
		call	nz, PUTEQUNO
		call	Page0Call_3CC9
		call	Page0Call_3759
		ld	(editSym), hl
		call	Page0Call_3651
		call	CanAlphIns
		res	4, (iy+0Ch)
		set	0, (iy+11h)
		res	5, (iy+0Dh)
		ld	hl, p04loc_4572
		ld	(mcxErrorEP), hl
		ret
; End of function p04sub_4F71


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


p04sub_4FB9:				; CODE XREF: seg001:458Dp p04sub_4F71+19p
		call	p04sub_4FEC
		set	6, (iy+1Dh)
		set	7, (iy+1Dh)
		bit	2, (iy+17h)
		jr	p04loc_4FCA

p04loc_4FCA:
		ld	hl, aX
		call	page0_13
		jr	nz, p04loc_4FE5
		ld	hl, unk_26BF
		call	page0_198
		jr	nz, p04loc_4FE5
		ld	hl, aT
		call	page0_1A2
		jr	nz, p04loc_4FE5
		ld	hl, unk_26C8

p04loc_4FE5:				; CODE XREF: p04sub_4FB9+17j p04sub_4FB9+1Fj ...
		call	Page0Call_3C87
		call	Page0Call_3D1D
		ret
; End of function p04sub_4FB9


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


p04sub_4FEC:				; CODE XREF: p04sub_4FB9p
		ld	hl, (winBtm)
		dec	l
		bit	0, (iy+14h)
		jr	z, p04loc_4FF8
		ld	l, 3

p04loc_4FF8:				; CODE XREF: p04sub_4FEC+8j
		ld	h, 0
		ld	(curRow), hl
		ret
; End of function p04sub_4FEC

p04loc_4FFE:
		.db  5Ah	; Z
		.db  74h	; t
		.db  79h	; y
		.db  78h	; x
		.db  7Ah	; z
		.db  7Bh	; {
		.db  7Ch	; |
		.db  77h	; w
		.db  7Dh	; }
		.db  7Eh	; ~
		.db  76h	; v
		.db  69h	; i
p04loc_500A:
		.db  7Fh	; 
		.db  65h	; e
		.db  77h	; w
		.db  69h	; i
		.db  63h	; c
		.db  6Fh	; o
		.db  73h	; s
		.db  71h	; q
		.db  5Fh	; _
		.db  53h	; S
		.db  7Dh	; }
		.db  51h	; Q
p04loc_5016:
		.db  55h	; U
		.db  57h	; W
		.db  59h	; Y
		.db  61h	; a
		.db  6Bh	; k
		.db  6Dh	; m
		.db  79h	; y
		.db  7Bh	; {

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


p04sub_501E:				; CODE XREF: p04sub_465B+Fp p04sub_465B+B0Fp ...
		ld	a, 1Fh
		call	Page0Call_3633
		ld	hl, PlotStart
		call	page0_BEC
		jp	Minus1
; End of function p04sub_501E

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_502C:				; CODE XREF: ForceGraphKeypress+9C3j
		ld	hl, p04loc_4FFE
		ld	bc, 0Ch
		cpir
		jp	nz, p04loc_56E6
		set	3, (iy+27h)
		res	4, (iy+1Fh)
		ld	hl, p04loc_500A
		add	hl, bc
		ld	a, (hl)
		ld	(curGStyle), a
		ld	hl, p04loc_505F-1
		ld	a, (Xres_int)
		call	Bit_VertSplit
		jr	z, p04loc_5054
		add	a, 8

p04loc_5054:				; CODE XREF: ForceGraphKeypress+AABj
		ld	e, a
		ld	d, 0
		add	hl, de
		ld	l, (hl)
		ld	h, d
		call	p04sub_6715
		jr	p04loc_507D
p04loc_505F:
		.db  2Fh	; /
		.db  30h	; 0
		.db  30h	; 0
		.db  30h	; 0
		.db  32h	; 2
		.db  30h	; 0
		.db  31h	; 1
		.db  30h	; 0
		.db  17h
		.db  18h
		.db  18h
		.db  18h
		.db  19h
		.db  18h
		.db  1Ch
		.db  18h
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p04sub_465B

p04loc_506F:				; CODE XREF: p04sub_465B+75j
		bit	4, (iy+17h)
		jr	nz, p04loc_507D
		push	hl
		call	GRBUFCPY_V
		call	GRLABELS
		pop	hl

p04loc_507D:				; CODE XREF: ForceGraphKeypress+AB8j
		; p04sub_465B+A18j
		res	6, (iy+17h)
		ld	(curInc), hl
		bit	2, (iy+17h)
		jr	nz, p04loc_5099
		ld	hl, 0
		ld	(unk_8E65), hl
		ld	(curGY2), hl
		ld	(unk_9810), hl
		ld	(unk_980E), hl

p04loc_5099:				; CODE XREF: p04sub_465B+A2Dj
		call	Page0Call_35A9
		xor	a
		ld	(curPlotNumber), a
		set	0, (iy+2)
		call	FNDSELEQ
		bit	2, (iy+17h)
		jr	z, p04loc_50DC
		set	7, (iy+0)
		call	page0_19D
		jr	z, p04loc_50D9
		res	2, (iy+17h)
		call	Page0Call_39F3
		bit	0, (iy+0Fh)
		jr	z, p04loc_50CA
		ld	hl, nMin
		rst	20h
		call	Page0Call_39D5

p04loc_50CA:				; CODE XREF: p04sub_465B+A66j
		call	p04sub_51B5
		set	2, (iy+17h)
		set	6, (iy+17h)
		set	4, (iy+1Fh)

p04loc_50D9:				; CODE XREF: p04sub_465B+A59j
		jp	p04loc_52EC
; ---------------------------------------------------------------------------

p04loc_50DC:				; CODE XREF: p04sub_465B+A50j
		call	p04sub_449A
		jr	nz, p04loc_50E9
		call	Page0Call_35AF
		jp	z, p04loc_4F43
		jr	p04loc_5139
; ---------------------------------------------------------------------------

p04loc_50E9:				; CODE XREF: p04sub_465B+A84j
		ld	a, (curGStyle)
		cp	4Fh ; 'O'
		jr	z, p04loc_5139
		call	page0_1A2
		call	nz, p04sub_7298
		call	page0_198
		call	nz, p04sub_7289
		jr	p04loc_5136
; END OF FUNCTION CHUNK	FOR p04sub_465B

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


p04sub_50FE:				; CODE XREF: p04sub_465B:p04loc_5136p
		; ForceGraphKeypress+C46p
		ld	hl, (curInc)
		bit	7, (iy+0)
		jr	z, p04loc_511C
		call	page0_19D
		jr	z, p04loc_5119
		bit	0, (iy+0Fh)
		ret	nz
		ld	hl, 8D21h
		rst	20h
		call	Page0Call_39D5
		ret
; ---------------------------------------------------------------------------

p04loc_5119:				; CODE XREF: p04sub_50FE+Cj
		ld	hl, (unk_8E2B)

p04loc_511C:				; CODE XREF: p04sub_50FE+7j
		call	p04sub_6700
		ld	bc, ThetaMin
		call	page0_198
		jr	nz, p04loc_512E
		ld	bc, TminPar
		call	page0_1A2
		ret	z

p04loc_512E:				; CODE XREF: p04sub_50FE+27j
		ld	a, (curPlotNumber)
		or	a
		call	z, NEWINDEP
		ret
; End of function p04sub_50FE

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p04sub_465B

p04loc_5136:				; CODE XREF: p04sub_465B+AA1j
		call	p04sub_50FE

p04loc_5139:				; CODE XREF: p04sub_465B+A8Cj
		; p04sub_465B+A93j
		call	page0_19D
		jr	z, p04loc_5182
		call	Page0Call_39F3
		ld	a, (curGStyle)
		cp	4Fh ; 'O'
		jr	nz, p04loc_5150
		bit	0, (iy+0Fh)
		jr	z, p04loc_517F
		jr	p04loc_5173
; ---------------------------------------------------------------------------

p04loc_5150:				; CODE XREF: p04sub_465B+AEBj
		ld	hl, 8D21h
		rst	20h
		bit	7, (iy+0)
		jr	nz, p04loc_516D
		ld	hl, PlotStart
		rst	20h
		call	Minus1
		call	CkOP1Pos
		jp	nz, Page0Call_2509
		call	p04sub_6726
		call	p04sub_501E

p04loc_516D:				; CODE XREF: p04sub_465B+AFDj
		bit	0, (iy+0Fh)
		jr	z, p04loc_517C

p04loc_5173:				; CODE XREF: p04sub_465B+AF3j
		ld	hl, nMin
		rst	20h
		call	Page0Call_39D5
		jr	p04loc_517F
; ---------------------------------------------------------------------------

p04loc_517C:				; CODE XREF: p04sub_465B+B16j
		call	p04sub_6726

p04loc_517F:				; CODE XREF: p04sub_465B+AF1j
		; p04sub_465B+B1Fj
		call	p04sub_51B5

p04loc_5182:				; CODE XREF: p04sub_465B+AE1j
		set	7, (iy+0)
		ld	a, 0Bh
		ld	(curGY2+1), a
		bit	6, (iy+0Ch)
		jr	nz, p04loc_519C
		call	page0_189
		jr	z, p04loc_51A2
		call	GRBUFCPY_V
		call	GRLABELS

p04loc_519C:				; CODE XREF: p04sub_465B+B34j
		call	page0_189
		jp	nz, p04loc_5470
; END OF FUNCTION CHUNK	FOR p04sub_465B
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_51A2:				; CODE XREF: ForceGraphKeypress+6D0j
		; p04sub_465B+B39j
		ld	a, 4
		set	0, (iy+27h)
		jr	p04loc_51EF
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


p04sub_51AA:				; CODE XREF: ForceGraphKeypress+C3Bp
		bit	0, (iy+0Fh)
		call	nz, FPOPREAL
		ld	hl, 8D21h
		rst	20h
; End of function p04sub_51AA


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


p04sub_51B5:				; CODE XREF: p04sub_465B:p04loc_50CAp
		; p04sub_465B:p04loc_517Fp ...
		rst	18h
		call	Page04_38E8
		call	PopRealO1
		call	Page0Call_3AB9
		res	1, (iy+0Fh)
		set	5, (iy+0Fh)
		call	RECURNNAME
		rst	10h
		ld	(inputDat), de
		ret
; End of function p04sub_51B5

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_51D0:				; CODE XREF: ForceGraphKeypress+260j
		; ForceGraphKeypress:p04loc_480Aj
		ld	b, a
		ld	a, 1
		bit	0, (iy+36h)
		call	nz, Page0Call_3369
		ret	nz
		push	bc
		bit	4, (iy+1Fh)
		call	nz, p04sub_51AA
		res	4, (iy+1Fh)
		res	6, (iy+17h)
		call	p04sub_50FE
		pop	af

p04loc_51EF:				; CODE XREF: ForceGraphKeypress+C03j
		res	7, (iy+19h)
		res	1, (iy+1Fh)
		cp	2
		jp	z, p04loc_53B2
		jp	c, p04loc_5483
		cp	0Eh
		jr	nc, p04loc_5222
		ld	d, a
		ld	a, (curGStyle)
		cp	81h ; '�'
		jr	nz, p04loc_5216
		ld	hl, (unk_8E65)
		dec	hl
		ld	(unk_8E65), hl
		call	Page0Call_3591
		ret
; ---------------------------------------------------------------------------

p04loc_5216:				; CODE XREF: ForceGraphKeypress+C64j
		ld	hl, p04loc_5016
		ld	bc, 8
		cpir
		jp	z, p04loc_52F1
		ld	a, d

p04loc_5222:				; CODE XREF: ForceGraphKeypress+C5Cj
		cp	4
		jp	nz, p04loc_5548
		res	5, (iy+3)
		ld	a, (curPlotNumber)
		or	a
		jr	z, p04loc_525D
		call	Page0Call_35AF
		jr	nz, p04loc_5246
		call	NEXTEQ
		jr	nz, p04loc_5246
		call	Page0Call_35AF
		ld	b, a
		ld	a, (curPlotNumber)
		cp	b
		jp	z, LABCOOR

p04loc_5246:				; CODE XREF: ForceGraphKeypress+C8Fj
		; ForceGraphKeypress+C94j
		ld	a, (curPlotNumber)
		call	Page0Call_35C1

p04loc_524C:				; CODE XREF: ForceGraphKeypress+D1Bj
		call	Page0Call_3EFD
		ld	a, (curPlotNumber)
		call	Page0Call_35AF
		jr	z, p04loc_5274
		call	Page0Call_3585
		jp	p04loc_48B5
; ---------------------------------------------------------------------------

p04loc_525D:				; CODE XREF: ForceGraphKeypress+C8Aj
		ld	hl, (unk_9810)
		ld	a, l
		or	h
		jr	z, p04loc_5277
		ld	de, (unk_980E)
		or	a
		sbc	hl, de
		jr	z, p04loc_5277
		inc	de
		ld	(unk_980E), de
		jr	p04loc_52F1
; ---------------------------------------------------------------------------

p04loc_5274:				; CODE XREF: ForceGraphKeypress+CB0j
		ld	(curPlotNumber), a

p04loc_5277:				; CODE XREF: ForceGraphKeypress+CBDj
		; ForceGraphKeypress+CC6j
		ld	a, (curGY2+1)
		call	NEXTEQ
		jr	nz, p04loc_529B
		call	Page0Call_35AF
		jr	nz, p04loc_529B
		call	NEXTEQ
		ld	b, a
		ld	a, (curGY2+1)
		cp	b
		jr	nz, p04loc_529B
		ld	hl, (unk_9810)
		ld	a, l
		or	h
		jr	nz, p04loc_529B
		set	7, (iy+19h)
		jr	p04loc_52F1
; ---------------------------------------------------------------------------

p04loc_529B:				; CODE XREF: ForceGraphKeypress+CD8j
		; ForceGraphKeypress+CDDj ...
		ld	hl, 0
		ld	(unk_9810), hl
		inc	hl
		ld	(unk_980E), hl
		ld	a, (curGY2+1)
		cp	0Ah
		jr	z, p04loc_52B7
		or	a
		jr	z, p04loc_52B7
		call	page0_19D
		jr	z, p04loc_52B7
		call	p04sub_52C2

p04loc_52B7:				; CODE XREF: ForceGraphKeypress+D05j
		; ForceGraphKeypress+D08j ...
		call	NEXTEQ
		or	a
		jr	nz, p04loc_52CD
		ld	(curGY2+1), a
		jr	p04loc_524C
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


p04sub_52C2:				; CODE XREF: ForceGraphKeypress+D0Fp
		; ForceGraphKeypress+104Dp
		ld	hl, (EQS)
		ld	de, 12h
		add	hl, de
		ld	(FPS), hl
		ret
; End of function p04sub_52C2

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_52CD:				; CODE XREF: ForceGraphKeypress+D16j
		; ForceGraphKeypress+1054j
		ld	(curGY2+1), a
		call	page0_19D
		jr	z, p04loc_52E5
		bit	0, (iy+0Fh)
		jr	z, p04loc_52E5
		ld	hl, nMin
		rst	20h
		call	Page0Call_39D5
		call	p04sub_51B5

p04loc_52E5:				; CODE XREF: ForceGraphKeypress+D2Ej
		; ForceGraphKeypress+D34j
		set	0, (iy+27h)
		call	Page0Call_3EFD
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress
; START	OF FUNCTION CHUNK FOR p04sub_465B

p04loc_52EC:				; CODE XREF: p04sub_465B:p04loc_50D9j
		call	page0_19D
		jr	z, p04loc_52F1

p04loc_52F1:				; CODE XREF: ForceGraphKeypress+C79j
		; ForceGraphKeypress+CCDj ...
		res	6, (iy+17h)
		bit	2, (iy+17h)
		jr	z, p04loc_5300
		call	page0_13
		jr	nz, p04loc_5306

p04loc_5300:				; CODE XREF: p04sub_465B+C9Ej
		ld	hl, (curInc)
		call	p04sub_6700

p04loc_5306:				; CODE XREF: p04sub_465B+CA3j
		ld	hl, (pTempCnt)
		push	hl
		call	page0_13
		jp	z, p04loc_5607
		bit	7, (iy+19h)
		jr	nz, p04loc_5340
		call	VALCUR
		ld	hl, OP2
		ld	a, (curInc)
		ld	(curGY+1), a
		bit	2, (iy+17h)
		jr	nz, p04loc_5333
		call	Xitof
		ld	a, (curGStyle)
		cp	4Fh ; 'O'
		call	nz, Page0Call_3321

p04loc_5333:				; CODE XREF: p04sub_465B+CCBj
		call	Page0Call_336F

TRCYFUNC:				; CODE XREF: p04sub_465B+FC6j
		; p04sub_465B+FFAj ...
		rst	18h
		call	PopRealO1
		call	p04sub_5467
		call	p04sub_5BB6

p04loc_5340:				; CODE XREF: p04sub_465B+CB9j
		; p04sub_465B+1001j ...
		res	6, (iy+17h)
		ld	a, (iy+17h)
		push	af
		res	2, (iy+17h)
		ld	hl, (unk_980E)
		ld	a, l
		or	h
		cp	1
		call	z, Page0Call_3375
		res	7, (iy+19h)
		res	1, (iy+1Fh)
		res	3, (iy+27h)
		pop	af
		bit	2, a
		jr	z, p04loc_536B
		set	2, (iy+17h)

p04loc_536B:				; CODE XREF: p04sub_465B+D0Aj
		bit	2, (iy+17h)
		jr	z, p04loc_539A
		bit	5, (iy+17h)
		jr	nz, p04loc_5389
		call	p04loc_6721
		bit	4, (iy+17h)
		jr	z, p04loc_539A
		res	4, (iy+17h)
		ld	a, 4Fh ; 'O'
		ld	(curGStyle), a

p04loc_5389:				; CODE XREF: p04sub_465B+D1Aj
		res	5, (iy+17h)
		pop	hl
		ld	(pTempCnt), hl
		res	3, (iy+2)
		set	7, (iy+8)
		ret
; ---------------------------------------------------------------------------

p04loc_539A:				; CODE XREF: p04sub_465B+D14j
		; p04sub_465B+D23j
		res	4, (iy+17h)
		pop	hl
		ld	(pTempCnt), hl
		bit	4, (iy+4)
		jr	z, p04loc_53AE
		call	Page0Call_3EFD
		jp	p04loc_48B5
; ---------------------------------------------------------------------------

p04loc_53AE:				; CODE XREF: p04sub_465B+D4Bj
		call	p04sub_4886
		ret
; END OF FUNCTION CHUNK	FOR p04sub_465B
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_53B2:				; CODE XREF: ForceGraphKeypress+C54j
		ld	b, 1

p04loc_53B4:				; CODE XREF: ForceGraphKeypress+FB0j
		ld	a, (curPlotNumber)
		or	a
		jr	z, p04loc_53BE
		call	Page0Call_3597
		ret
; ---------------------------------------------------------------------------

p04loc_53BE:				; CODE XREF: ForceGraphKeypress+E13j
		set	2, (iy+27h)
		call	page0_19D
		jr	z, p04loc_541F
		bit	0, (iy+0Fh)
		jr	z, p04loc_53F0
		ld	hl, 8D21h
		rst	20h
		ld	hl, PlotStart
		call	Mov9OP2Cp
		jp	c, LABCOOR
		call	Minus1
		call	p04sub_6726
		call	FPOPREAL
		ld	hl, nMin
		rst	20h
		call	Page0Call_39D5
		call	p04sub_51B5
		jp	p04loc_52F1
; ---------------------------------------------------------------------------

p04loc_53F0:				; CODE XREF: ForceGraphKeypress+E26j
		push	bc
		call	p04sub_501E
		call	OP1ToOP3
		call	Page0Call_39F3
		pop	bc
		set	7, (iy+19h)

p04loc_53FF:				; CODE XREF: ForceGraphKeypress+E70j
		push	bc
		call	BCALL_4120
		call	cpop1op2
		pop	bc
		jr	z, p04loc_5417
		res	7, (iy+19h)
		push	bc
		ld	hl, PlotStep
		call	page0_C25
		pop	bc
		djnz	p04loc_53FF

p04loc_5417:				; CODE XREF: ForceGraphKeypress+E62j
		call	p04sub_6726
		call	Page0Call_3AB9
		jr	p04loc_5460
; ---------------------------------------------------------------------------

p04loc_541F:				; CODE XREF: ForceGraphKeypress+E20j
		call	p04sub_5474
		set	4, (iy+3)
		call	page0_13
		ld	de, 0FFFFh
		jp	z, p04loc_54E3

p04loc_542F:				; CODE XREF: ForceGraphKeypress:p04loc_545Ej
		ld	a, (curInc)
		sub	c
		ld	(curInc), a
		jr	nc, p04loc_545E
		push	bc
		call	p04sub_5C7A
		ld	a, (curInc)
		jr	nz, p04loc_5448
		pop	bc
		add	a, c
		ld	(curInc), a
		jr	p04loc_5460
; ---------------------------------------------------------------------------

p04loc_5448:				; CODE XREF: ForceGraphKeypress+E9Aj
		push	af
		call	Page0Call_3EFD
		call	p04sub_58BE
		pop	de
		push	af
		ld	a, d
		add	a, 8
		ld	l, a
		ld	h, 0
		pop	af
		pop	bc
		jr	nz, p04loc_5462
		ld	(curInc), hl

p04loc_545E:				; CODE XREF: ForceGraphKeypress+E91j
		djnz	p04loc_542F

p04loc_5460:				; CODE XREF: ForceGraphKeypress+E78j
		; ForceGraphKeypress+EA1j
		jr	p04loc_54D3
; ---------------------------------------------------------------------------

p04loc_5462:				; CODE XREF: ForceGraphKeypress+EB4j
		; ForceGraphKeypress+F27j
		call	SetTblGraphDraw
		jr	p04loc_5470
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


p04sub_5467:				; CODE XREF: p04sub_465B+CDFp
		; p04sub_465B+FB7p ...
		call	page0_189
		ret	z
		pop	hl
		pop	hl
		ld	(pTempCnt), hl

p04loc_5470:				; CODE XREF: ForceGraphKeypress+864j
		; p04sub_465B+B44j ...
		call	p04sub_5CEA
		ret
; End of function p04sub_5467


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


p04sub_5474:				; CODE XREF: ForceGraphKeypress:p04loc_541Fp
		; ForceGraphKeypress+EF7p
		res	6, (iy+17h)
		ld	c, 1
		call	page0_13
		ret	z
		ld	a, (Xres_int)
		ld	c, a
		ret
; End of function p04sub_5474

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_5483:				; CODE XREF: ForceGraphKeypress+C57j
		ld	b, 1

p04loc_5485:				; CODE XREF: ForceGraphKeypress+FADj
		res	4, (iy+3)
		ld	a, (curPlotNumber)
		or	a
		jr	z, p04loc_5493
		call	Page0Call_3591
		ret
; ---------------------------------------------------------------------------

p04loc_5493:				; CODE XREF: ForceGraphKeypress+EE8j
		set	1, (iy+27h)
		call	page0_13
		jr	z, p04loc_54DB
		call	p04sub_5474

p04loc_549F:				; CODE XREF: ForceGraphKeypress:p04loc_54D1j
		ld	a, (curInc)
		add	a, c
		ld	(curInc), a
		call	p04sub_75A2
		jr	c, p04loc_54D1
		push	bc
		call	p04sub_5C7A
		ld	a, (curInc)
		jr	nz, p04loc_54BB
		pop	bc
		sub	c
		ld	(curInc), a
		jr	p04loc_54D3
; ---------------------------------------------------------------------------

p04loc_54BB:				; CODE XREF: ForceGraphKeypress+F0Dj
		push	af
		call	Page0Call_3EFD
		call	p04sub_58BE
		pop	de
		push	af
		ld	a, d
		sub	8
		ld	h, 0
		ld	l, a
		pop	af
		pop	bc
		jr	nz, p04loc_5462
		ld	(curInc), hl

p04loc_54D1:				; CODE XREF: ForceGraphKeypress+F04j
		djnz	p04loc_549F

p04loc_54D3:				; CODE XREF: ForceGraphKeypress:p04loc_5460j
		; ForceGraphKeypress+F14j ...
		jp	p04loc_52F1
; ---------------------------------------------------------------------------

p04loc_54D6:				; CODE XREF: ForceGraphKeypress+F48j
		add	hl, de
		jr	c, p04loc_54F2

p04loc_54D9:				; CODE XREF: ForceGraphKeypress+F4Bj
		jr	p04loc_54D3
; ---------------------------------------------------------------------------

p04loc_54DB:				; CODE XREF: ForceGraphKeypress+EF5j
		call	page0_19D
		jr	nz, p04loc_5516
		ld	de, 1

p04loc_54E3:				; CODE XREF: ForceGraphKeypress+E87j
		set	7, (iy+19h)

p04loc_54E7:				; CODE XREF: ForceGraphKeypress+F6Cj
		ld	hl, (curInc)
		ld	a, e
		cp	1
		jr	nz, p04loc_54D6
		add	hl, de
		jr	c, p04loc_54D9

p04loc_54F2:				; CODE XREF: ForceGraphKeypress+F32j
		push	de
		push	bc
		ld	(curInc), hl
		ld	bc, TminPar
		call	page0_1A2
		jr	nz, p04loc_5502
		ld	bc, ThetaMin

p04loc_5502:				; CODE XREF: ForceGraphKeypress+F58j
		call	NEWINDEP
		pop	bc
		pop	de
		jr	c, p04loc_553F
		res	7, (iy+19h)
		res	1, (iy+1Fh)
		djnz	p04loc_54E7

p04loc_5513:				; CODE XREF: ForceGraphKeypress+F97j
		; ForceGraphKeypress+FA1j ...
		jp	p04loc_52F1
; ---------------------------------------------------------------------------

p04loc_5516:				; CODE XREF: ForceGraphKeypress+F39j
		bit	0, (iy+0Fh)
		jr	z, p04loc_5525
		ld	hl, 8D21h
		call	page0_186A
		jp	p04loc_54D3
; ---------------------------------------------------------------------------

p04loc_5525:				; CODE XREF: ForceGraphKeypress+F75j
		set	7, (iy+19h)

p04loc_5529:				; CODE XREF: ForceGraphKeypress+F95j
		push	bc
		call	p04sub_6F32
		jr	c, p04loc_553E
		res	7, (iy+19h)
		call	p04sub_6726
		call	Page0Call_3ABF
		pop	bc
		djnz	p04loc_5529
		jr	p04loc_5513
; ---------------------------------------------------------------------------

p04loc_553E:				; CODE XREF: ForceGraphKeypress+F88j
		pop	bc

p04loc_553F:				; CODE XREF: ForceGraphKeypress+F62j
		ld	hl, (curInc)
		dec	hl
		ld	(curInc), hl
		jr	p04loc_5513
; ---------------------------------------------------------------------------

p04loc_5548:				; CODE XREF: ForceGraphKeypress+C7Fj
		cp	0Eh
		jr	c, p04loc_5558
		set	0, (iy+27h)
		ld	b, 5
		jp	nz, p04loc_5485
		jp	p04loc_53B4
; ---------------------------------------------------------------------------

p04loc_5558:				; CODE XREF: ForceGraphKeypress+FA5j
		set	0, (iy+27h)
		set	5, (iy+3)
		ld	a, (curPlotNumber)
		or	a
		jr	z, p04loc_559E
		call	Page0Call_35BB
		jr	nz, p04loc_557F
		ld	a, 0Bh
		call	PREVEQ
		jr	nz, p04loc_557F
		ld	a, 4
		call	Page0Call_35BB
		ld	b, a
		ld	a, (curPlotNumber)
		cp	b
		jp	z, LABCOOR

p04loc_557F:				; CODE XREF: ForceGraphKeypress+FC4j
		; ForceGraphKeypress+FCBj
		ld	a, (curPlotNumber)
		call	Page0Call_35C1

p04loc_5585:				; CODE XREF: ForceGraphKeypress+105Fj
		call	Page0Call_3EFD
		call	Page0Call_35BB
		jr	z, p04loc_5593
		call	Page0Call_3585
		jp	p04loc_48B5
; ---------------------------------------------------------------------------

p04loc_5593:				; CODE XREF: ForceGraphKeypress+FE6j
		xor	a
		ld	(curPlotNumber), a
		ld	a, 0Bh
		ld	(curGY2+1), a
		jr	p04loc_55F5
; ---------------------------------------------------------------------------

p04loc_559E:				; CODE XREF: ForceGraphKeypress+FBFj
		ld	hl, (unk_9810)
		ld	a, l
		or	h
		jr	z, p04loc_55B5
		ld	de, (unk_980E)
		dec	de
		ld	a, e
		or	d
		jr	z, p04loc_55B5
		ld	(unk_980E), de
		jp	p04loc_5513
; ---------------------------------------------------------------------------

p04loc_55B5:				; CODE XREF: ForceGraphKeypress+FFEj
		; ForceGraphKeypress+1007j
		ld	a, (curGY2+1)
		call	PREVEQ
		jr	nz, p04loc_55DE
		ld	a, 4
		call	Page0Call_35BB
		jr	nz, p04loc_55DE
		ld	a, 0Bh
		call	PREVEQ
		ld	b, a
		ld	a, (curGY2+1)
		cp	b
		jr	nz, p04loc_55DE
		ld	hl, (unk_9810)
		ld	a, l
		or	h
		jr	nz, p04loc_55DE
		set	7, (iy+19h)
		jp	p04loc_52F1
; ---------------------------------------------------------------------------

p04loc_55DE:				; CODE XREF: ForceGraphKeypress+1016j
		; ForceGraphKeypress+101Dj ...
		xor	a
		ld	h, a
		ld	l, a
		ld	(unk_9810), hl
		ld	(curPlotNumber), a
		ld	a, (curGY2+1)
		or	a
		jr	z, p04loc_55F5
		call	page0_19D
		jr	z, p04loc_55F5
		call	p04sub_52C2

p04loc_55F5:				; CODE XREF: ForceGraphKeypress+FF7j
		; ForceGraphKeypress+1046j ...
		call	PREVEQ
		or	a
		jp	nz, p04loc_52CD
		ld	(curGY2+1), a
		ld	a, 4
		ld	(curPlotNumber), a
		jp	p04loc_5585
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p04sub_465B

p04loc_5607:				; CODE XREF: p04sub_465B+CB2j
		call	page0_1A2
		jr	z, p04loc_5624
		call	VALCUR
		call	Page0Call_336F
		call	p04sub_5467
		call	p04sub_5C0A
		call	Page0Call_334B
		call	page0_17E0
		call	Page0Call_337B
		jp	TRCYFUNC
; ---------------------------------------------------------------------------

p04loc_5624:				; CODE XREF: p04sub_465B+FAFj
		call	page0_19D
		jr	nz, p04loc_5658
		call	VALCUR
		call	Page0Call_336F
		call	p04sub_5467
		call	page0_18E
		jr	z, p04loc_564C
		call	Page0Call_332D
		ld	hl, (inputDat)
		call	Mov9ToOP2
		ld	hl, p04loc_56B9
		call	pushErrorHandleR
		call	Page0Call_3ACB
		call	popErrorHandleR

p04loc_564C:				; CODE XREF: p04sub_465B+FDAj
		call	PushRealO2
		call	p04sub_5C0A
		call	PopRealO1
		jp	TRCYFUNC
; ---------------------------------------------------------------------------

p04loc_5658:				; CODE XREF: p04sub_465B+FCCj
		bit	7, (iy+19h)
		jp	nz, p04loc_5340
		bit	0, (iy+0Fh)
		jp	nz, p04loc_5758
		set	0, (iy+7)
		call	VALCUR
		call	RCL_SEQ_X
		call	CkOP1Real
		cp	0Eh
		jr	nz, p04loc_5680
		res	0, (iy+7)
		ld	hl, OP1
		set	5, (hl)

p04loc_5680:				; CODE XREF: p04sub_465B+101Aj
		call	p04sub_5467
		call	p04sub_5C0A
		set	0, (iy+7)
		call	p04sub_5729
		call	CkOP1Real
		cp	0Eh
		jr	nz, p04loc_569D
		ld	hl, OP1
		set	5, (hl)
		res	0, (iy+7)

p04loc_569D:				; CODE XREF: p04sub_465B+1037j
		jp	TRCYFUNC
; END OF FUNCTION CHUNK	FOR p04sub_465B

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


RCL_SEQ_X:				; CODE XREF: p04sub_465B+1012p
		; Regraph+71Ep
		call	Page0Call_39F3
		call	p04sub_56B3
		ret	z
		ld	hl, 8E3Fh
		bit	3, a
		jr	nz, p04loc_56B1
		ld	hl, 8E2Dh

p04loc_56B1:				; CODE XREF: RCL_SEQ_X+Cj
		rst	20h
		ret
; End of function RCL_SEQ_X


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


p04sub_56B3:				; CODE XREF: RCL_SEQ_X+3p Regraph+70Fp ...
		ld	a, (iy+0Fh)
		and	1Ch
		ret
; End of function p04sub_56B3

p04loc_56B9:
		call	p04loc_5C4D
		call	p04loc_5BFB
		bit	3, (iy+4)
		jr	z, p04loc_56C9
		res	6, (iy+3)

p04loc_56C9:				; CODE XREF: seg001:56C3j
		jp	p04loc_5340
p04loc_56CC:
		.db  5Fh	; _
		.db  5Ch	; \
		.db  5Dh	; ]
		.db  70h	; p
		.db  6Fh	; o
		.db  6Eh	; n
		.db  71h	; q
		.db  72h	; r
		.db  6Ah	; j
		.db  6Dh	; m
		.db  67h	; g
		.db  6Ch	; l
		.db  73h	; s
p04loc_56D9:
		.db  2Fh	; /
		.db  1Bh
		.db  15h
		.db  2Bh	; +
		.db  25h	; %
		.db  31h	; 1
		.db  29h	; )
		.db  23h	; #
		.db  21h	; !
		.db  1Fh
		.db  0Dh
		.db  0Bh
		.db  13h
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR ForceGraphKeypress

p04loc_56E6:				; CODE XREF: ForceGraphKeypress+A8Fj
		ld	hl, p04loc_56CC
		ld	bc, 0Dh
		cpir
		jr	nz, p04loc_571D
		ld	hl, p04loc_56D9
		add	hl, bc
		ld	a, (hl)
		push	af
		bit	0, (iy+3)
		call	z, GRBUFCPY_V
		pop	af

p04loc_56FE:				; CODE XREF: ForceGraphKeypress:p04loc_4DD3j
		ld	bc, (curGY)
		ld	(curGStyle), a
		cp	2Fh ; '/'
		jr	nz, p04loc_571A
		ld	a, b
		cp	5Ch ; '\'
		jr	c, p04loc_5710
		ld	b, 5Bh ; '['

p04loc_5710:				; CODE XREF: ForceGraphKeypress+1167j
		ld	a, c
		cp	6
		jr	nc, p04loc_5717
		ld	c, 6

p04loc_5717:				; CODE XREF: ForceGraphKeypress+116Ej
		jp	p04loc_4896
; ---------------------------------------------------------------------------

p04loc_571A:				; CODE XREF: ForceGraphKeypress+1162j
		jp	p04loc_489F
; ---------------------------------------------------------------------------

p04loc_571D:				; CODE XREF: ForceGraphKeypress+1149j
		or	a
		jr	nz, p04loc_5723
; END OF FUNCTION CHUNK	FOR ForceGraphKeypress

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


p04sub_5720:				; CODE XREF: ForceGraphKeypress+40j
		; ForceGraphKeypress:p04loc_4F33j	...
		call	p04sub_5CEA

p04loc_5723:				; CODE XREF: ForceGraphKeypress+1179j
		jp	LABCOOR
; End of function p04sub_5720

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p04sub_58BE

p04loc_5726:				; CODE XREF: p04sub_58BE+2Dj
		jp	Page0Call_2509
; END OF FUNCTION CHUNK	FOR p04sub_58BE

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


p04sub_5729:				; CODE XREF: p04sub_465B+102Fp
		; p04sub_465B+1118p ...
		ld	a, (curGY2+1)
		ld	c, a
; End of function p04sub_5729


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


RCLSEQ2:				; CODE XREF: Regraph+743p
		ld	hl, 8E3Fh
		ld	a, (iy+0Fh)
		ld	b, 2
		bit	0, a
		jr	nz, p04loc_5743
		and	1Ch
		jr	z, p04loc_5743
		bit	2, a
		jr	nz, p04loc_5754
		jr	p04loc_574F
; ---------------------------------------------------------------------------

p04loc_5743:				; CODE XREF: RCLSEQ2+Aj RCLSEQ2+Ej
		ld	a, c
		cp	2
		jr	z, p04loc_5754
		ld	b, 1
		ld	hl, 8E2Dh
		jr	c, p04loc_5754

p04loc_574F:				; CODE XREF: RCLSEQ2+14j
		ld	b, 3
		ld	hl, 8E51h

p04loc_5754:				; CODE XREF: RCLSEQ2+12j RCLSEQ2+19j ...
		push	bc
		rst	20h
		pop	bc
		ret
; End of function RCLSEQ2

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p04sub_465B

p04loc_5758:				; CODE XREF: p04sub_465B+1008j
		; p04sub_465B+11BFj
		call	VALCUR
		ld	a, (iy+0Fh)
		bit	5, a
		jr	z, p04loc_57B3
		bit	1, a
		jr	nz, p04loc_5779
		call	Page0Call_3EFD
		set	1, (iy+0Fh)
		call	OP1Set0
		call	YPIXSET
		call	p04sub_5729
		rst	18h
		jr	p04loc_57DA
; ---------------------------------------------------------------------------

p04loc_5779:				; CODE XREF: p04sub_465B+1109j
		call	p04sub_5848
		ld	a, (iy+17h)
		push	af
		res	2, (iy+17h)
		call	Page0Call_3ABF
		pop	af
		bit	2, a
		jr	z, p04loc_5790
		set	2, (iy+17h)

p04loc_5790:				; CODE XREF: p04sub_465B+112Fj
		res	5, (iy+0Fh)
		res	1, (iy+0Fh)
		call	p04sub_5729
		rst	8
		call	CpyTo1FPST
		call	OP1ToOP3
		call	OP4Set0

p04loc_57A5:				; CODE XREF: p04sub_465B+11EAj
		call	Page0Call_3EFD
		call	p04sub_5855
		call	p04sub_5729
		call	YPIXSET
		jr	p04loc_57D7
; ---------------------------------------------------------------------------

p04loc_57B3:				; CODE XREF: p04sub_465B+1105j
		bit	1, a
		jr	nz, p04loc_581D
		set	1, (iy+0Fh)
		call	p04sub_5729
		call	OP1ToOP4
		rst	8
		call	CpyTo3FPST
		call	CpyO2ToFPST
		call	Page0Call_3EFD
		call	p04sub_5855
		call	CpyTo1FPST
		call	YPIXSET
		call	page0_1867

p04loc_57D7:				; CODE XREF: p04sub_465B+1156j
		call	CpyTo1FPST

p04loc_57DA:				; CODE XREF: p04sub_465B+111Cj
		call	XPIXSET
		pop	hl
		ld	(pTempCnt), hl
		ld	hl, 91D0h
		rst	20h
		bit	2, (iy+17h)
		call	nz, Page0Call_39F3
		ld	a, (curGStyle)
		cp	4Fh ; 'O'
		jr	nz, p04loc_57FA
		bit	4, (iy+1Eh)
		call	nz, Page0Call_39F3

p04loc_57FA:				; CODE XREF: p04sub_465B+1196j
		ld	hl, 8D21h
		call	Mov9OP2Cp
		jr	nz, p04loc_5816
		res	4, (iy+1Eh)
		res	2, (iy+17h)
		ld	de, 8D21h
		ld	hl, 91D0h
		call	mov9B2
		jp	p04loc_48B5
; ---------------------------------------------------------------------------

p04loc_5816:				; CODE XREF: p04sub_465B+11A5j
		ld	hl, (pTempCnt)
		push	hl
		jp	p04loc_5758
; ---------------------------------------------------------------------------

p04loc_581D:				; CODE XREF: p04sub_465B+115Aj
		res	1, (iy+0Fh)
		call	p04sub_5848
		ld	a, (iy+17h)
		push	af
		res	2, (iy+17h)
		call	Page0Call_3ABF
		pop	af
		bit	2, a
		jr	z, p04loc_5838
		set	2, (iy+17h)

p04loc_5838:				; CODE XREF: p04sub_465B+11D7j
		call	p04sub_5729
		rst	8
		call	CpyTo1FPST
		call	OP1ToOP3
		call	OP1ToOP4
		jp	p04loc_57A5
; END OF FUNCTION CHUNK	FOR p04sub_465B

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


p04sub_5848:				; CODE XREF: p04sub_465B:p04loc_5779p
		; p04sub_465B+11C6p
		call	page0_1867
		call	Page0Call_39F3
		call	Plus1
		call	Page0Call_39D5
		ret
; End of function p04sub_5848


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


p04sub_5855:				; CODE XREF: p04sub_465B+114Dp
		; p04sub_465B+1170p
		call	PUSHMCPLXO1
		ld	hl, 91D0h
		rst	20h
		ld	hl, PlotStart
		call	Mov9OP2Cp
		push	af
		call	POPMCPLXO1
		pop	af
		call	nc, Page0Call_356D
		ret
; End of function p04sub_5855


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


p04sub_586B:				; CODE XREF: p04sub_586B+25j p04sub_58BE+BBp ...
		push	bc
		push	de
		call	IOffset
		pop	de
		push	de
		add	hl, de
		ld	bc, 0Bh
		call	Bit_VertSplit
		jr	z, p04loc_587D
		ld	c, 5

p04loc_587D:				; CODE XREF: p04sub_586B+Ej
		ld	e, l
		ld	d, h
		bit	4, (iy+3)
		jr	z, p04loc_588A
		inc	de
		lddr
		jr	p04loc_588D
; ---------------------------------------------------------------------------

p04loc_588A:				; CODE XREF: p04sub_586B+18j
		dec	de
		ldir

p04loc_588D:				; CODE XREF: p04sub_586B+1Dj
		pop	de
		pop	bc
		dec	c
		jr	nz, p04sub_586B
		ret
; End of function p04sub_586B


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


p04sub_5893:				; CODE XREF: p04sub_58BE+E0p p04sub_58BE+EBp
		ld	b, 3Fh ; '?'
		push	de

p04loc_5896:				; CODE XREF: p04sub_5893+1Bj
		add	hl, de
		ld	(hl), 0
		push	hl
		bit	4, (iy+3)
		jr	nz, p04loc_58A5
		dec	hl
		ld	a, 0F8h	; '�'
		jr	p04loc_58A8
; ---------------------------------------------------------------------------

p04loc_58A5:				; CODE XREF: p04sub_5893+Bj
		inc	hl
		ld	a, 3Fh ; '?'

p04loc_58A8:				; CODE XREF: p04sub_5893+10j
		and	(hl)
		ld	(hl), a
		pop	hl
		ld	de, 0Ch
		djnz	p04loc_5896
		pop	hl
		ld	de, 0Bh
		add	hl, de
		inc	de
		ld	b, 3Fh ; '?'

p04loc_58B8:				; CODE XREF: p04sub_5893+28j
		res	0, (hl)
		add	hl, de
		djnz	p04loc_58B8
		ret
; End of function p04sub_5893


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


p04sub_58BE:				; CODE XREF: ForceGraphKeypress+EA7p
		; ForceGraphKeypress+F1Ap

; FUNCTION CHUNK AT 5726 SIZE 00000003 BYTES

		ld	hl, p04loc_5726
		call	pushErrorHandleR
		ld	a, 2
		bit	0, (iy+36h)
		call	nz, Page0Call_3369
		set	0, (iy+27h)
		set	6, (iy+17h)
		ld	hl, 8E73h
		rst	20h
		ld	a, 8
		call	Page0Call_3561
		bit	4, (iy+3)
		call	nz, InvOP2S
		rst	30h
		ld	a, (OP1+1)
		cp	8Eh ; '�'
		jp	z, p04loc_5726
		call	SetTblGraphDraw
		ld	de, 8E73h
		call	MovFrOP1
		ld	hl, deltaX
		call	page0_D19
		call	OP1ToOP4
		call	OP2ToOP1
		ld	a, (pixWide_m_2)
		ld	l, a
		ld	h, 0
		call	Page0Call_3B55
		call	FPMult
		call	OP4ToOP2
		call	OP1ToOP4
		ld	hl, 8E6Ah
		rst	20h
		rst	30h
		call	Page0Call_3E37
		call	CkValidNum
		call	OP1ToOP5
		call	OP4ToOP2
		rst	30h
		call	CkValidNum
		ld	hl, Xmax
		ld	(chkDelPtr1), hl
		call	Page0Call_3381
		ld	hl, OP5
		set	6, (hl)
		ld	de, Xmin
		call	mov9B2
		ld	hl, deltaX
		call	Mov9ToOP2
		ld	hl, 8484h
		call	INCEXP
		call	InvOP2S
		bit	4, (iy+3)
		jr	z, p04loc_5959
		call	InvOP2S
		call	OP5ToOP1

p04loc_5959:				; CODE XREF: p04sub_58BE+93j
		rst	30h
		rst	18h
		call	CKVALDELX
		call	PopRealO6
		call	popErrorHandleR
		ld	c, 3Fh ; '?'
		ld	b, 0Fh
		bit	4, (iy+3)
		jr	z, p04loc_5974
		ld	a, (lcdTallP+1)
		sub	9
		ld	b, a

p04loc_5974:				; CODE XREF: p04sub_58BE+AEj
		ld	de, plotSScreen
		push	bc
		push	hl
		call	p04sub_586B
		pop	hl
		pop	bc
		ld	de, appBackUpScreen
		bit	1, (iy+3Ch)
		call	nz, p04sub_586B
		ld	bc, (lcdTallP)
		dec	b
		ld	c, 3Fh ; '?'
		bit	4, (iy+3)
		jr	z, p04loc_5997
		ld	b, 7

p04loc_5997:				; CODE XREF: p04sub_58BE+D5j
		call	IOffset
		push	hl
		ld	de, plotSScreen
		call	p04sub_5893
		pop	hl
		ld	de, appBackUpScreen
		bit	1, (iy+3Ch)
		call	nz, p04sub_5893
		call	GrBufCpy
		bit	5, (iy+3)
		push	af
		set	5, (iy+3)
		ld	hl, (curGY2)
		push	hl
		ld	hl, (unk_9810)
		push	hl
		ld	hl, (unk_980E)
		push	hl
		ld	a, (curInc)
		push	af
		call	Axes
		res	1, (iy+3Ch)
		pop	af
		push	af
		ld	(curInc), a
		res	5, (iy+3)
		ld	hl, 0
		ld	(curGY2), hl
		set	1, (iy+3)
		ld	hl, (pTempCnt)
		push	hl
		call	p04sub_72C4
		rst	18h
		rst	18h

p04loc_59EB:				; CODE XREF: p04sub_58BE+1E9j
		call	p04sub_7211
		jp	z, p04loc_5AAD
		pop	hl
		pop	af
		push	af
		push	hl
		ld	(curInc), a
		ld	hl, 0
		ld	(unk_9810), hl
		inc	hl
		ld	(unk_980E), hl
		ld	a, (curInc)
		add	a, 8
		ld	hl, Xres_int
		bit	4, (iy+3)
		jr	nz, p04loc_5A20
		sub	10h
		push	af
		ld	a, (lcdTallP+1)
		sub	0Bh
		ld	d, a
		pop	af

p04loc_5A1A:				; CODE XREF: p04sub_58BE+15Ej
		sub	(hl)
		cp	d
		jr	nc, p04loc_5A1A
		jr	p04loc_5A25
; ---------------------------------------------------------------------------

p04loc_5A20:				; CODE XREF: p04sub_58BE+150j
		; p04sub_58BE+165j
		add	a, (hl)
		cp	0Ah
		jr	c, p04loc_5A20

p04loc_5A25:				; CODE XREF: p04sub_58BE+160j
		ld	(curInc+1), a

p04loc_5A28:				; CODE XREF: p04sub_58BE+1ECj
		ld	a, (curInc+1)
		set	3, (iy+17h)
		res	7, (iy+17h)

p04loc_5A33:				; CODE XREF: p04sub_58BE+1E0j
		ld	(curInc), a
		ld	hl, (XOutDat)
		call	Xitof
		call	Page0Call_336F
		call	INITNSEQ
		ld	de, OP3
		call	CPYFPS1
		inc	de
		inc	de
		call	mov9B2
		rst	8
		call	CpyO1ToFPST
		ld	hl, (XOutDat)
		rst	20h
		call	CpyO1ToFPS1
		call	NEDXT_Y_STYLE
		set	5, (iy+14h)
		bit	3, (iy+17h)
		call	z, PLOTPT
		res	3, (iy+17h)
		res	5, (iy+14h)
		call	page0_189
		jr	nz, p04loc_5AAD
		call	Page04_3396
		bit	7, (iy+17h)
		jr	nz, p04loc_5AA0
		ld	hl, pixWide_m_2
		ld	a, (curInc)
		cp	0
		jr	z, p04loc_5AA0
		cp	(hl)
		jr	nc, p04loc_5AA0
		ld	hl, Xres_int
		add	a, (hl)
		bit	4, (iy+3)
		jr	z, p04loc_5A9B
		sub	(hl)
		sub	(hl)
		jr	nc, p04loc_5A9B
		set	7, (iy+17h)

p04loc_5A9B:				; CODE XREF: p04sub_58BE+1D3j
		; p04sub_58BE+1D7j
		ld	(curInc), a
		jr	p04loc_5A33
; ---------------------------------------------------------------------------

p04loc_5AA0:				; CODE XREF: p04sub_58BE+1BCj
		; p04sub_58BE+1C6j ...
		res	7, (iy+17h)
		call	p04sub_712A
		jp	nc, p04loc_59EB
		jp	p04loc_5A28
; ---------------------------------------------------------------------------

p04loc_5AAD:				; CODE XREF: p04sub_58BE+130j
		; p04sub_58BE+1B3j
		res	0, (iy+3)
		res	1, (iy+3)
		res	1, (iy+17h)
		pop	hl
		pop	af
		ld	(pTempCnt), hl
		pop	hl
		ld	(unk_980E), hl
		pop	hl
		ld	(unk_9810), hl
		pop	hl
		ld	(curGY2), hl
		pop	af
		jr	z, p04loc_5AD1
		set	5, (iy+3)

p04loc_5AD1:				; CODE XREF: p04sub_58BE+20Dj
		call	FPOPCPLX
		ld	hl, (XOutSym)
		res	6, (hl)
		jp	page0_189
; End of function p04sub_58BE


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


Page04_33C0:				; CODE XREF: p04sub_4F71:p04loc_4F7Bp
		call	FNDSELEQ
		xor	a
		call	NEXTEQ
		or	a
		ret
; End of function Page04_33C0


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


p04sub_5AE5:				; CODE XREF: ForceGraphKeypress+51p
		push	af
		call	EOP1NotReal
		pop	af
		jr	nc, p04loc_5B51
		ld	hl, Xmin
		call	page0_13
		jr	nz, p04loc_5B22
		ld	hl, ThetaMin
		call	page0_198
		jr	nz, p04loc_5B22
		call	page0_19D
		jr	z, p04loc_5B1F
		bit	0, (iy+0Fh)
		jr	z, p04loc_5B12
		call	ErrD_OP1NotPosInt
		ld	hl, nMin
		call	Mov9ToOP2
		jr	p04loc_5B1A
; ---------------------------------------------------------------------------

p04loc_5B12:				; CODE XREF: p04sub_5AE5+20j
		rst	18h
		call	p04sub_501E
		rst	8
		call	PopRealO1

p04loc_5B1A:				; CODE XREF: p04sub_5AE5+2Bj
		ld	hl, nMax
		jr	p04loc_5B25
; ---------------------------------------------------------------------------

p04loc_5B1F:				; CODE XREF: p04sub_5AE5+1Aj
		ld	hl, TminPar

p04loc_5B22:				; CODE XREF: p04sub_5AE5+Dj p04sub_5AE5+15j
		call	Mov9ToOP2

p04loc_5B25:				; CODE XREF: p04sub_5AE5+38j
		push	hl
		call	OP1ToOP4
		call	cpop1op2
		pop	hl
		jr	z, p04loc_5B4E
		push	af
		call	Mov9OP2Cp
		jr	z, p04loc_5B4D
		jr	c, p04loc_5B48
		pop	af
		jr	c, p04loc_5B4E
		call	page0_19D
		jr	z, p04loc_5B45
		bit	0, (iy+0Fh)
		jr	nz, p04loc_5B4E

p04loc_5B45:				; CODE XREF: p04sub_5AE5+58j p04sub_5AE5+64j
		jp	ErrInvalid
; ---------------------------------------------------------------------------

p04loc_5B48:				; CODE XREF: p04sub_5AE5+50j
		pop	af
		jr	c, p04loc_5B45
		jr	p04loc_5B4E
; ---------------------------------------------------------------------------

p04loc_5B4D:				; CODE XREF: p04sub_5AE5+4Ej
		pop	hl

p04loc_5B4E:				; CODE XREF: p04sub_5AE5+48j p04sub_5AE5+53j ...
		call	OP4ToOP1

p04loc_5B51:				; CODE XREF: p04sub_5AE5+5j
		call	page0_13
		call	nz, Page0Call_3321
		call	page0_1A2
		call	nz, Page0Call_3399
		call	page0_198
		call	nz, Page0Call_3333
		call	page0_19D
		jr	z, p04loc_5B7F
p04loc_5B68:
		call	page0_14E1
		jp	nz, ErrDomain
		rst	18h
		call	RECURNNAME
		rst	10h
		push	de
		call	PopRealO1
		pop	de
		ld	(inputDat), de
		jp	MovFrOP1
; ---------------------------------------------------------------------------

p04loc_5B7F:				; CODE XREF: p04sub_5AE5+81j
		ld	hl, (chkDelPtr1)
		ld	(inputDat), hl
		ret
; End of function p04sub_5AE5


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


p04sub_5B86:				; CODE XREF: ForceGraphKeypress+60Fp
		; ForceGraphKeypress+687p ...
		call	p04sub_5C0A
		ld	(curInc), a
		call	Page0Call_38F1
		call	Page0Call_3339
		call	Page0Call_336F
		pop	bc
		call	p04sub_5467
		pop	hl
		ld	(pTempCnt), hl
		push	bc
		call	p04sub_5BB6
; End of function p04sub_5B86


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


GRLABELS:				; CODE XREF: LABCOORp p04sub_4A43p ...
		bit	0, (iy+3)
		ret	nz
		push	af
		bit	5, (iy+4)
		jr	nz, p04loc_5BB4
		bit	6, (iy+4)
		call	nz, p04sub_775A

p04loc_5BB4:				; CODE XREF: GRLABELS+Aj
		pop	af
		ret
; End of function GRLABELS


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


p04sub_5BB6:				; CODE XREF: p04sub_465B+CE2p
		; p04sub_5B86+18p
		call	page0_18E
		jr	z, p04loc_5BFB
; End of function p04sub_5BB6


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


YPIXSET:				; CODE XREF: p04sub_465B+1115p
		; p04sub_465B+1153p ...
		ld	hl, p04loc_5BFB
		call	pushErrorHandleR
		call	CkValidNum
		call	popErrorHandleR
		call	Page0Call_3327
		ld	hl, OP1
		call	XYRND
		jr	nz, p04loc_5BFB
		call	OP1ToOP3
		xor	a
		ld	de, Ymin
		ld	hl, OP1
		call	Page04_3408
		call	OP3ToOP1
		ld	b, a
		ld	a, 1
		bit	1, b
		jr	nz, p04loc_5C04
		ld	a, (lcdTallP)
		dec	a
		bit	0, b
		jr	nz, p04loc_5C04
		ld	de, OP1
		call	YftoI

p04loc_5BF7:				; CODE XREF: YPIXSET+4Dj
		ld	(curGY), a
		ret
; ---------------------------------------------------------------------------

p04loc_5BFB:				; CODE XREF: seg001:56BCp p04sub_5BB6+3j	...
		ld	a, (lcdTallP)
		srl	a
		set	7, (iy+3)

p04loc_5C04:				; CODE XREF: YPIXSET+2Cj YPIXSET+34j
		res	2, (iy+3)
		jr	p04loc_5BF7
; End of function YPIXSET


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


p04sub_5C0A:				; CODE XREF: p04sub_465B+FBAp
		; p04sub_465B+FF4p ...
		call	page0_18E
		jr	z, p04loc_5C4D
; End of function p04sub_5C0A


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


XPIXSET:				; CODE XREF: p04sub_465B:p04loc_57DAp
		ld	hl, p04loc_5C4D
		call	pushErrorHandleR
		call	CkValidNum
		call	popErrorHandleR
		call	Page0Call_3321
		ld	hl, OP1
		call	XYRND
		jr	nz, p04loc_5C4D
		call	OP1ToOP3
		xor	a
		ld	de, Xmin
		ld	hl, OP1
		call	Page04_3408
		call	OP3ToOP1
		ld	b, a
		xor	a
		bit	1, b
		jr	nz, p04loc_5C57
		ld	a, (pixWide_m_2)
		bit	0, b
		jr	nz, p04loc_5C57
		ld	de, OP1
		call	XftoI

p04loc_5C49:				; CODE XREF: XPIXSET+4Cj
		ld	(curGY+1), a
		ret
; ---------------------------------------------------------------------------

p04loc_5C4D:				; CODE XREF: seg001:56B9p p04sub_5C0A+3j	...
		ld	a, (lcdTallP+1)
		srl	a
		dec	a
		set	6, (iy+3)

p04loc_5C57:				; CODE XREF: XPIXSET+2Bj XPIXSET+32j
		res	2, (iy+3)
		jr	p04loc_5C49
; End of function XPIXSET


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


COPYRNG:				; CODE XREF: ForceGraphKeypress+902p
		; ForceGraphKeypress+92Fp ...
		ld	hl, Xmin
		ld	de, prevData
		set	7, (iy+4)
; End of function COPYRNG


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


p04sub_5C67:				; CODE XREF: ZmPrev+Fp
		ld	bc, 36h	; '6'
		ldir
		ret
; End of function p04sub_5C67


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


VALCUR:					; CODE XREF: ForceGraphKeypress:p04loc_48AEp
		; ForceGraphKeypress+76Fp ...
		set	2, (iy+3)
		res	6, (iy+3)
		res	7, (iy+3)
		ret
; End of function VALCUR


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


p04sub_5C7A:				; CODE XREF: ForceGraphKeypress+E94p
		; ForceGraphKeypress+F07p
		xor	a
		call	Page0Call_35B5
		jr	z, p04loc_5C86

p04loc_5C80:				; CODE XREF: p04sub_5C7A+15j p04sub_5C7A+1Bj ...
		set	1, (iy+1Fh)
		xor	a
		ret
; ---------------------------------------------------------------------------

p04loc_5C86:				; CODE XREF: p04sub_5C7A+4j
		call	page0_13
		jr	z, p04loc_5C91
		bit	6, (iy+19h)
		jr	nz, p04loc_5C80

p04loc_5C91:				; CODE XREF: p04sub_5C7A+Fj
		bit	6, (iy+17h)
		jr	nz, p04loc_5C80
		ld	a, (curGStyle)
		cp	61h ; 'a'
		jr	z, p04loc_5C80
		cp	55h ; 'U'
		jr	z, p04loc_5C80
		cp	57h ; 'W'
		jr	z, p04loc_5C80
		ret
; End of function p04sub_5C7A


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


p04sub_5CA7:				; CODE XREF: ForceGraphKeypress:p04loc_464Dp
		; ForceGraphKeypress:p04loc_4A76p	...
		bit	6, (iy+3)
		ret	nz
		bit	7, (iy+3)
		ret
; End of function p04sub_5CA7

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

p04loc_5CB1:
GRPUTAWAY:
		call	Page0Call_3315
		call	p04sub_4596
		call	Page0Call_3EFD
		res	4, (iy+1)
		res	4, (iy+14h)
		res	2, (iy+17h)
		set	7, (iy+1Dh)
		jr	RSTGFLAGS
; ---------------------------------------------------------------------------
p04loc_5CCC:
GRPPutAway:
		bit	0, (iy+11h)
		call	nz, Page0Call_3D71
		bit	2, (iy+17h)
		call	nz, Page0Call_3D71
		call	Page0Call_3EFD
		nop

RSTGFLAGS:				; CODE XREF: seg001:5CCAj
		res	2, (iy+11h)
		res	1, (iy+3)
		res	3, (iy+3)

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


p04sub_5CEA:				; CODE XREF: TraceOff+3p
		; ForceGraphKeypress+26Fp ...
		push	af
		bit	0, (iy+2)
		jr	z, p04loc_5D04
		push	hl
		push	de
		ld	hl, (EQS)
		ld	de, (FPS)
		call	CpHLDE
		jr	nc, p04loc_5D02
		ld	(FPS), hl

p04loc_5D02:				; CODE XREF: p04sub_5CEA+13j
		pop	de
		pop	hl

p04loc_5D04:				; CODE XREF: p04sub_5CEA+5j
		res	0, (iy+2)
		xor	a
		ld	(curGStyle), a
		res	2, (iy+3)
		pop	af
		ret
; End of function p04sub_5CEA

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

GRReset:
		push	af
		push	bc
		push	de
		push	hl
		res	6, (iy+19h)
		xor	a
		ld	(unk_8F4F), a
		ld	a, 0Eh
		ld	(OP1), a
		ld	de, u0
		ld	b, 6

p04loc_5D28:				; CODE XREF: seg001:5D2Dj
		push	bc
		call	MovFrOP1
		pop	bc
		djnz	p04loc_5D28
		ld	de, w02
		call	MovFrOP1
		call	p04sub_5E72
		call	ZooDefault
		call	p04loc_6145
		call	p04loc_614A
		call	p04loc_612A
		ld	de, uXmin
		ld	hl, Xmin
		ld	bc, 0CFh ; '�'
		ldir
		call	OP1Set0
		ld	a, 40h ; '@'
		ld	(OP1M), a
		ld	de, XFact
		call	MovFrOP1
		call	MovFrOP1
		ld	hl, 0D0h ; '�'
		ld	(unk_8F4D), hl
		ld	hl, 0CFh ; '�'
		ld	(unk_8E7C), hl
		ld	hl, 12h
		ld	(unk_92B1), hl
		jp	p04loc_40A8
; ---------------------------------------------------------------------------

XYCENT:					; CODE XREF: seg001:6750j
		ld	hl, Xmin
		rst	20h
		call	page0_BEC
		call	TimesPt5
		call	OP1ToOP5
		ld	hl, Ymin
		rst	20h
		call	page0_BEC
		jp	TimesPt5
; ---------------------------------------------------------------------------

Page04_3546:
		push	af
		push	de
		call	Mov9ToOP2
		rst	20h
		call	FPSub
		call	TimesPt5
		call	OP1ToOP4
		pop	hl
		rst	20h
		pop	af
		call	c, fprecip
		call	OP4ToOP2
		call	FPMult
		call	OP1ToOP4
		call	OP5ToOP2

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


p04sub_5DAD:				; CODE XREF: ZmSquare+50p
		rst	30h
		call	Page0Call_3E37
		call	CkValidNum
		call	OP4ToOP2
		call	OP1ToOP4
		call	OP5ToOP1
		call	FPSub
		call	Page0Call_3E37
		jp	CkValidNum
; End of function p04sub_5DAD


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


CPTDELY:				; CODE XREF: ZmSquare+6p
		; ZooDefault+21p ...
		ld	hl, Ymin
		ld	a, (lcdTallP)
		sub	2
		ld	c, a
		ld	b, 0
		ld	de, deltaY
; End of function CPTDELY


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


p04sub_5DD4:				; CODE XREF: CPTDELX+Cp
		push	de
		push	bc
		ld	de, OP2
		call	mov9B2
		call	page0_117C
		call	FPSub
		call	CkOP1Pos
		jp	nz, Page0Call_2509
		pop	hl
		call	Page0Call_3B55
		call	fpdiv
		ld	a, (OP1+1)
		cp	0E4h ; '�'
		jp	nc, Page0Call_2509
		call	CkValidNum
		call	CkOP1FP0
		jp	z, Page0Call_2509
		pop	de
		push	de
		call	MovFrOP1
		call	fprecip
		ld	hl, 847Ch
		ld	b, 3
		ld	a, 50h ; 'P'
		call	p04loc_4481
		ld	hl, 847Ch
		ld	b, 5
		call	ClrLp
		ld	hl, 12h
		pop	de
		add	hl, de
		ex	de, hl
		jp	MovFrOP1
; End of function p04sub_5DD4


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


CPTDELX:				; CODE XREF: ZmSquare+3p
		; ZooDefault+1Ep ...
		ld	hl, Xmin
		ld	a, (pixWide_m_2)
		ld	c, a
		ld	b, 0
		ld	de, deltaX
		call	p04sub_5DD4

CKVALDELX:				; CODE XREF: p04sub_58BE+9Dp
		ld	hl, Xmin
		ld	a, (unk_9153)
; End of function CPTDELX


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


CKVALDELTA:				; CODE XREF: p04sub_6DF3+3Bp seg001:7F22p
		push	af
		rst	20h
		call	Mov9ToOP2
		ld	a, (OP1M)
		or	a
		jr	z, p04loc_5E5B
		ld	a, (OP2M)
		or	a
		jr	z, p04loc_5E5B
		ld	a, (OP1+1)
		ld	hl, 8484h
		cp	(hl)
		jr	nc, p04loc_5E53
		ld	a, (hl)

p04loc_5E53:				; CODE XREF: CKVALDELTA+18j
		sub	0Ah
		pop	de
		sub	d
		jp	nc, Page0Call_2509
		ret
; ---------------------------------------------------------------------------

p04loc_5E5B:				; CODE XREF: CKVALDELTA+9j
		; CKVALDELTA+Fj
		pop	de
		ret
; End of function CKVALDELTA


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


p04sub_5E5D:				; CODE XREF: p04sub_5E72p	seg001:5E80p ...
		res	5, (iy+2)
		res	6, (iy+2)
		res	4, (iy+2)
		res	7, (iy+2)
		ret
; End of function p04sub_5E5D

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

SetFuncM:
		call	page0_13
		ret	nz

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


p04sub_5E72:				; CODE XREF: seg001:5D35p
		call	p04sub_5E5D
		set	4, (iy+2)

p04loc_5E79:				; CODE XREF: seg001:5E87j seg001:5E94j ...
		jp	SetTblGraphDraw
; End of function p04sub_5E72

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

SetSeqM:
		call	page0_19D
		ret	nz
		call	p04sub_5E5D
		set	7, (iy+2)
		jr	p04loc_5E79
; ---------------------------------------------------------------------------

SetPolM:
		call	page0_198
		ret	nz
		call	p04sub_5E5D
		set	5, (iy+2)
		jr	p04loc_5E79
; ---------------------------------------------------------------------------

SetParM:
		call	page0_1A2
		ret	nz
		call	p04sub_5E5D
		set	6, (iy+2)
		jr	p04loc_5E79

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


ZmInt:					; CODE XREF: ForceGraphKeypress+8BBp
		; seg001:6769j
		call	COPYRNG
		call	int
		bit	0, (iy+14h)
		ld	a, (lcdTallP)
		sub	2
		push	af
		srl	a
		call	Page0Call_3561
		call	FPSub
		call	OP1ToOP6
		pop	af
		call	Page0Call_3561
		rst	30h
		call	OP1ToOP4
		call	OP1Set1
		call	INCO1EXP
		ld	de, Xscl
		call	MovFrOP1
		ld	de, Yscl
		call	MovFrOP1
		call	OP5ToOP1
		call	int
		ld	a, (pixWide_m_2)
		push	af
		srl	a
		call	Page0Call_3561
		call	FPSub
		call	OP1ToOP5
		pop	af
		call	Page0Call_3561
		rst	30h
; End of function ZmInt


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


p04sub_5EF2:				; CODE XREF: ForceGraphKeypress+905p
		ld	hl, Xmax
		ld	(chkDelPtr1), hl
		call	Page0Call_3381
		call	OP4ToOP1
		ld	hl, Ymax
		ld	(chkDelPtr1), hl
		call	Page0Call_3381
		call	OP5ToOP1
		ld	a, 0Ah
		call	Page0Call_3675
		call	OP6ToOP1
		ld	hl, Ymin
		ld	(chkDelPtr1), hl
		call	Page0Call_3381
		ret
; End of function p04sub_5EF2


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


ZmDecml:				; CODE XREF: ForceGraphKeypress+95Fp
		; seg001:6773j
		call	COPYRNG
		call	OP1Set1
		ld	de, Xscl
		call	MovFrOP1
		ld	de, Yscl
		call	MovFrOP1
		ld	a, (pixWide_m_2)
		srl	a
		call	Page0Call_355B
		call	p04sub_60DC
		ld	a, (lcdTallP)
		sub	2
		srl	a
		call	Page0Call_355B
		call	FDIV10
		jp	p04sub_60D8
; End of function ZmDecml


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


ZmPrev:					; CODE XREF: ForceGraphKeypress+94Dp
		; seg001:676Ej
		ld	hl, Xmin
		bit	7, (iy+4)
		jr	z, p04loc_5F55
		ld	hl, prevData

p04loc_5F55:				; CODE XREF: ZmPrev+7j
		ld	de, OP1
		call	p04sub_5C67
		call	COPYRNG
		ld	de, OP1
		scf
		push	af
		jr	p04loc_5F9E
; End of function ZmPrev


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


ZmUsr:					; CODE XREF: ForceGraphKeypress+944p
		; seg001:6778j
		call	COPYRNG
		scf

p04loc_5F69:				; CODE XREF: SETUZM+1j
		push	af
		call	page0_198
		jr	z, p04loc_5F86
		ld	hl, ThetaMin
		ld	de, uThetMin
		jr	p04loc_5F91
; ---------------------------------------------------------------------------

p04loc_5F77:				; CODE XREF: ZmUsr+24j
		call	page0_19D
		jr	z, p04loc_5F9B
		ld	hl, PlotStart
		ld	de, uPlotStart
		ld	b, 5
		jr	p04loc_5F93
; ---------------------------------------------------------------------------

p04loc_5F86:				; CODE XREF: ZmUsr+8j
		call	page0_1A2
		jr	z, p04loc_5F77
		ld	hl, TminPar
		ld	de, uTmin

p04loc_5F91:				; CODE XREF: ZmUsr+10j
		ld	b, 3

p04loc_5F93:				; CODE XREF: ZmUsr+1Fj
		pop	af
		push	af
		jr	c, p04loc_5F98
		ex	de, hl

p04loc_5F98:				; CODE XREF: ZmUsr+30j
		call	p04sub_5FA7

p04loc_5F9B:				; CODE XREF: ZmUsr+15j
		ld	de, uXmin

p04loc_5F9E:				; CODE XREF: ZmPrev+1Aj
		ld	hl, Xmin
		ld	b, 6
		pop	af
		jr	c, p04sub_5FA7
		ex	de, hl
; End of function ZmUsr


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


p04sub_5FA7:				; CODE XREF: ZmUsr:p04loc_5F98p ZmUsr+3Fj ...
		call	page0_16FA
		ex	de, hl
		push	bc
		push	de
		call	mov9B2
		ex	de, hl
		ex	(sp), hl
		res	6, (hl)
		pop	hl
		pop	bc
		djnz	p04sub_5FA7
		ret
; End of function p04sub_5FA7


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


SETUZM:					; CODE XREF: ForceGraphKeypress+968p
		; seg001:677Dj
		or	a
		jr	p04loc_5F69
; End of function SETUZM


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


ZmFit:					; CODE XREF: ForceGraphKeypress+93Bp
		; seg001:6755j
		ld	hl, p04loc_6094
		call	pushErrorHandleR
		call	COPYRNG
		call	Bit_VertSplit
		jr	z, p04loc_5FD5
		bit	7, (iy+1Dh)
		call	nz, Page0Call_34AD
		res	2, (iy+1Fh)

p04loc_5FD5:				; CODE XREF: ZmFit+Cj
		call	page0_9B
		set	1, (iy+17h)
		set	2, (iy+11h)
		call	Regraph
		res	2, (iy+11h)
		call	CpyTo1FPS2
		ld	a, (OP1)
		inc	a
		jr	z, p04loc_601D
		call	Page0Call_3E37
		call	CkValidNum
		call	CpyO1ToFPS2
		call	CpyTo1FPS3
		call	Page0Call_3E37
		call	CkValidNum
		call	CpyO1ToFPS3
		call	PopRealO1
		call	Page0Call_3E37
		call	CkValidNum
		call	OP1ToOP4
		call	PopRealO1
		call	Page0Call_3E37
		call	CkValidNum
		call	Page0Call_35E5

p04loc_601D:				; CODE XREF: ZmFit+32j
		ld	hl, (EQS)
		ld	(FPS), hl
		call	popErrorHandleR
		call	page0_19D
		ret	z
		bit	0, (iy+0Fh)
		ret	z
; End of function ZmFit


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


ZmSquare:				; CODE XREF: ForceGraphKeypress+956p
		; seg001:6764j
		call	SetTblGraphDraw
		call	CPTDELX
		call	CPTDELY
		ld	hl, p04loc_6094
		call	pushErrorHandleR
		ld	hl, deltaY
		rst	20h
		ld	hl, deltaX
		call	Mov9OP2Cp
		jr	c, p04loc_6057
		jr	z, p04loc_6090
		ld	hl, Xmin
		ld	a, (pixWide_m_2)
		srl	a
		or	a
		jr	p04loc_6065
; ---------------------------------------------------------------------------

p04loc_6057:				; CODE XREF: ZmSquare+19j
		call	OP2ToOP1
		ld	hl, Ymin
		ld	a, (lcdTallP)
		sub	2
		srl	a
		scf

p04loc_6065:				; CODE XREF: ZmSquare+26j
		push	af
		push	hl
		call	Page0Call_3561
		call	FPMult
		call	OP1ToOP4
		pop	hl
		push	hl
		call	Mov9OP1OP2
		rst	30h
		call	TimesPt5
		call	OP1ToOP5
		call	OP4ToOP2
		call	p04sub_5DAD
		call	COPYRNG
		pop	de
		call	MovFrOP1
		ld	hl, OP4
		call	mov9B2
		pop	af

p04loc_6090:				; CODE XREF: ZmSquare+1Bj
		call	popErrorHandleR
		ret
; End of function ZmSquare

p04loc_6094:
		and	7Fh ; ''
		cp	6
		jp	nc, JErrorNo
		jp	Page0Call_250D
p04loc_609E:
		.db    0
		.db  82h	; �
		.db  35h	; 5
		.db  25h	; %
		.db    0
		.db    0
		.db    0
		.db    0
		.db    0

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


ZmTrig:					; CODE XREF: ForceGraphKeypress+995p
		; seg001:675Fj
		call	COPYRNG
		ld	a, 5Ah ; 'Z'
		call	Page0Call_355B
		bit	2, (iy+0)
		call	z, DToR
		ld	de, Xscl
		call	MovFrOP1
		ld	hl, p04loc_609E
		rst	20h
		bit	2, (iy+0)
		call	z, DToR
		call	SetXMinMax
		call	OP1Set1
		ld	de, Yscl
		call	MovFrOP1
		ld	a, 40h ; '@'
		ld	(OP1M), a
; End of function ZmTrig


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


p04sub_60D8:				; CODE XREF: ZmDecml+2Aj
		; ZooDefault+18p
		ld	a, 0Ch
		jr	p04loc_60E1
; End of function p04sub_60D8


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


p04sub_60DC:				; CODE XREF: ZmDecml+1Ap
		call	FDIV10
; End of function p04sub_60DC


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


SetXMinMax:				; CODE XREF: ZmTrig+20p ZooDefault+1Bp
		ld	a, 0Ah

p04loc_60E1:				; CODE XREF: p04sub_60D8+2j
		push	af
		call	OP1ToOP5
		call	InvOP1S
		pop	af
		push	af
		call	Page0Call_3675
		call	OP5ToOP1
		pop	af
		inc	a
		call	Page0Call_3675
		jp	OP5ToOP1
; End of function SetXMinMax


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


ZooDefault:				; CODE XREF: ForceGraphKeypress+932p
		; seg001:5D38p	...
		call	OP1Set1
		ld	a, 2
		call	Page0Call_3675
		ld	a, 3
		call	Page0Call_3675
		ld	a, 36h ; '6'
		call	page0_13
		call	nz, Page0Call_3675
		call	INCO1EXP
		call	p04sub_60D8
		call	SetXMinMax
		call	CPTDELX
		call	CPTDELY
		call	page0_13
		ret	nz
		call	page0_198
		jr	nz, p04loc_6145
		call	page0_1A2
		jr	nz, p04loc_614A

p04loc_612A:				; CODE XREF: seg001:5D41p
		call	OP1Set1
		ld	a, 1Fh
		call	Page0Call_3675
		ld	a, 1Bh
		call	Page0Call_3675
		ld	a, 34h ; '4'
		call	Page0Call_3675
		call	INCO1EXP
		ld	a, 1Dh
		call	Page0Call_3675
		ret
; ---------------------------------------------------------------------------

p04loc_6145:				; CODE XREF: seg001:5D3Bp
		; ZooDefault+2Bj
		ld	hl, ThetaMin
		jr	p04loc_614D
; ---------------------------------------------------------------------------

p04loc_614A:				; CODE XREF: seg001:5D3Ep
		; ZooDefault+30j
		ld	hl, TminPar

p04loc_614D:				; CODE XREF: ZooDefault+50j
		call	OPSet0
		ld	(chkDelPtr1), hl
		ld	de, 9
		add	hl, de
		push	hl
		call	OP1Set0
		ld	a, 75h ; 'u'
		ld	(OP1M), a
		bit	2, (iy+0)
		call	z, DToR
		pop	de
		call	MovFrOP1
		ld	a, 30h ; '0'
		call	Page0Call_3561
		call	FPMult
		call	Page0Call_3381
		ret
; End of function ZooDefault


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


GrBufClr:				; CODE XREF: Regraph+9Ap
		ld	hl, plotSScreen

BufClr:
		push	hl
		pop	de
		inc	de
		ld	bc, 2FFh
		ld	(hl), 0
		ldir
		ret
; End of function GrBufClr


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


GRBUFCPY_V:				; CODE XREF: seg001:p04loc_4555p
		; seg001:4572p	...
		set	2, (iy+2)
		call	Bit_VertSplit
		jr	z, GrBufCpy
		bit	7, (iy+1Dh)
		call	nz, Page0Call_34AD
		res	2, (iy+1Fh)
		set	2, (iy+2)
		res	7, (iy+1Dh)
		bit	6, (iy+1Dh)
		ret	z
; End of function GRBUFCPY_V


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


GrBufCpy:				; CODE XREF: seg001:p04loc_4533p
		; ForceGraphKeypress+5F7p ...
		ld	hl, plotSScreen

BufCpy:
		set	2, (iy+2)
		ld	b, 20h ; ' '
		call	CheckSplitFlag
		jr	nz, p04loc_61BB
		ld	a, (winBtm)
		add	a, a
		add	a, a
		add	a, a
		ld	b, a

p04loc_61BB:				; CODE XREF: GrBufCpy+Cj
		bit	0, (iy+2)
		jr	z, p04loc_61D3
		bit	3, (iy+2)
		jr	z, p04loc_61D3
		ld	a, b
		sub	7
		bit	1, (iy+14h)
		jr	z, p04loc_61D2
		sub	7

p04loc_61D2:				; CODE XREF: GrBufCpy+28j
		ld	b, a

p04loc_61D3:				; CODE XREF: GrBufCpy+19j GrBufCpy+1Fj
		call	RestoreDisp
		res	6, (iy+1Dh)
		ei
; End of function GrBufCpy


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


DRAWSPLITLINE:				; CODE XREF: Regraph+B2p
		call	Bit_VertSplit
		jr	z, p04loc_61F6
		push	de
		call	Page0Call_339F
		ld	b, 2Fh ; '/'
		set	1, (iy+2)
		call	VerticalLine
		res	1, (iy+2)
		call	Page0Call_33A5
		pop	de
		ret
; ---------------------------------------------------------------------------

p04loc_61F6:				; CODE XREF: DRAWSPLITLINE+3j
		call	CheckSplitFlag
		ret	z
		push	de
		ld	bc, 0
		ld	de, 5E00h
		call	DarkLine
		pop	de
		ret
; End of function DRAWSPLITLINE


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


RestoreDisp:				; CODE XREF: GrBufCpy:p04loc_61D3p
		di
		ld	a, 7
		call	lcd_busy
		out	(10h), a
		ld	a, 7Fh ; ''

p04loc_6210:				; CODE XREF: RestoreDisp+45j
		push	bc
		inc	a
		ld	(curXRow), a
		call	SetYUp
		call	lcd_busy
		out	(10h), a
		ld	a, 20h ; ' '
		call	lcd_busy
		out	(10h), a
		ld	b, 0Ch
		call	Bit_VertSplit
		jr	z, p04loc_622D
		ld	b, 5

p04loc_622D:				; CODE XREF: RestoreDisp+23j
		; RestoreDisp+2Ej
		ld	a, (hl)
		inc	hl
		call	lcd_busy
		out	(11h), a
		djnz	p04loc_622D
		call	Bit_VertSplit
		jr	z, p04loc_6247
		ld	a, (hl)
		or	1
		call	lcd_busy
		out	(11h), a
		ld	bc, 7
		add	hl, bc

p04loc_6247:				; CODE XREF: RestoreDisp+33j
		pop	bc
		ld	a, (curXRow)
		djnz	p04loc_6210
		ld	a, 5
		call	lcd_busy
		out	(10h), a
		ret
; End of function RestoreDisp

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

FNDDB:
		ld	hl, 0
		ld	(OP3), hl
		ld	(OP3M), hl
		ld	a, 2
		jr	p04loc_626C

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


p04loc_6265:
AllEq:
		ld	(OP2M), a
		jr	p04loc_627A
; End of function AllEq

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

fndallseleq:
		ld	a, 6
		jr	p04loc_626C

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


FNDSELEQ:				; CODE XREF: p04sub_465B+A49p
		; Page04_33C0p	...
		xor	a

p04loc_626C:				; CODE XREF: seg001:6260j seg001:6269j
		ld	(OP2M), a
		ld	hl, (FPS)
		ld	(EQS), hl
		call	ZeroOP1
		rst	18h
		rst	18h

p04loc_627A:				; CODE XREF: AllEq+3j
		ld	a, 1
		call	Page0Call_385B
		ld	hl, symTable

p04loc_6282:				; CODE XREF: FNDSELEQ+E7j
		; FNDSELEQ+16Aj
		ex	de, hl
		ld	hl, (unk_982E)
		or	a
		sbc	hl, de
		ret	z
		ex	de, hl
		push	hl
		ld	a, (hl)
		call	equ_or_newequ
		jp	nz, p04loc_634E
		ld	b, a
		ld	a, (OP2M)
		cp	1
		jr	nz, p04loc_62A4
		bit	3, b
		jr	z, p04loc_62A1
		res	3, (hl)

p04loc_62A1:				; CODE XREF: FNDSELEQ+32j
		jp	p04loc_634E
; ---------------------------------------------------------------------------

p04loc_62A4:				; CODE XREF: FNDSELEQ+2Ej
		cp	6
		jr	z, p04loc_62AB
		or	a
		jr	nz, p04loc_62FF

p04loc_62AB:				; CODE XREF: FNDSELEQ+3Bj
		call	page0_19D
		jr	z, p04loc_62DB
		ld	a, (iy+0Fh)
		and	1Ch
		jr	z, p04loc_62DB
		push	hl
		dec	hl
		dec	hl
		dec	hl
		dec	hl
		dec	hl
		dec	hl
		dec	hl
		ld	a, (hl)
		pop	hl
		bit	2, (iy+0Fh)
		jr	z, p04loc_62CB
		cp	82h ; '�'
		jr	p04loc_62D7
; ---------------------------------------------------------------------------

p04loc_62CB:				; CODE XREF: FNDSELEQ+5Aj
		bit	3, (iy+0Fh)
		jr	z, p04loc_62D5
		cp	80h ; '�'
		jr	p04loc_62D7
; ---------------------------------------------------------------------------

p04loc_62D5:				; CODE XREF: FNDSELEQ+64j
		cp	81h ; '�'

p04loc_62D7:				; CODE XREF: FNDSELEQ+5Ej FNDSELEQ+68j
		jr	z, p04loc_634E
		jr	p04loc_62DF
; ---------------------------------------------------------------------------

p04loc_62DB:				; CODE XREF: FNDSELEQ+43j FNDSELEQ+4Aj
		bit	5, (hl)
		jr	z, p04loc_634E

p04loc_62DF:				; CODE XREF: FNDSELEQ+6Ej
		ld	a, (OP2M)
		bit	0, (iy+2)
		jr	nz, p04loc_62FF
		cp	6
		jr	z, p04loc_62FF
		ld	a, (mcxCurApp)
		cp	4Ah ; 'J'
		jr	z, p04loc_62FF
		call	page0_185F
		jr	nz, p04loc_62FF
		ld	a, (hl)
		and	1Fh
		cp	0Bh
		jr	nz, p04loc_634E

p04loc_62FF:				; CODE XREF: FNDSELEQ+3Ej FNDSELEQ+7Bj ...
		dec	hl
		dec	hl
		dec	hl
		dec	hl
		dec	hl
		dec	hl
		dec	hl
		ld	a, (OP1M)
		and	0F0h ; '�'
		ld	b, a
		ld	a, (hl)
		and	0F0h ; '�'
		cp	b
		jr	nz, p04loc_634E
		cp	20h ; ' '
		ld	a, (hl)
		jr	nz, p04loc_6319
		srl	a

p04loc_6319:				; CODE XREF: FNDSELEQ+AAj
		and	0Fh
		inc	a
		ld	b, a
		ld	a, (OP2M)
		cp	3
		jr	nc, p04loc_6355

p04loc_6324:				; CODE XREF: FNDSELEQ+ECj
		ld	a, b
		call	p04sub_6409
		ld	hl, (EQS)
		call	isInSet
		or	(hl)
		ld	(hl), a
		ld	a, (OP2M)
		cp	2
		jr	nz, p04loc_634E
		pop	hl
		push	hl
		dec	hl
		dec	hl
		dec	hl
		ld	e, (hl)
		dec	hl
		ld	d, (hl)
		ex	de, hl
		ld	c, (hl)
		inc	hl
		ld	b, (hl)
		ld	hl, (OP3)
		add	hl, bc
		ld	(OP3), hl
		ld	hl, OP3M
		inc	(hl)

p04loc_634E:				; CODE XREF: FNDSELEQ+25j
		; FNDSELEQ:p04loc_62A1j ...
		pop	hl

p04loc_634F:				; CODE XREF: FNDSELEQ+F5j
		; FNDSELEQ+135j ...
		call	Page0Call_33AB
		jp	p04loc_6282
; ---------------------------------------------------------------------------

p04loc_6355:				; CODE XREF: FNDSELEQ+B7j
		cp	6
		jr	z, p04loc_6324
		pop	hl
		cp	3
		jr	nz, p04loc_63AA
		bit	5, (hl)
		jr	nz, p04loc_634F
		push	hl
		dec	hl
		dec	hl
		dec	hl
		ld	e, (hl)
		dec	hl
		ld	d, (hl)
		ex	de, hl
		ld	a, (hl)
		inc	hl
		or	(hl)
		jr	z, p04loc_634E
		call	page0_1A2
		jr	z, p04loc_6396
		ex	de, hl
		dec	hl
		dec	hl
		ld	e, (hl)
		dec	hl
		ld	a, (hl)
		xor	1
		ld	d, a
		ld	(OP1+1), de
		xor	a
		ld	(unk_847B), a
		rst	10h
		jr	c, p04loc_63A2
		ex	de, hl
		ld	a, (hl)
		inc	hl
		or	(hl)
		jr	z, p04loc_63A2
		ex	de, hl
		set	5, (hl)
		ld	a, 1
		call	Page0Call_385B

p04loc_6396:				; CODE XREF: FNDSELEQ+107j
		pop	hl
		set	5, (hl)

p04loc_6399:				; CODE XREF: FNDSELEQ+149j
		call	SetTblGraphDraw
		set	1, (iy+17h)
		jr	p04loc_634F
; ---------------------------------------------------------------------------

p04loc_63A2:				; CODE XREF: FNDSELEQ+11Bj
		; FNDSELEQ+121j
		ld	a, 1
		call	Page0Call_385B
		pop	hl
		jr	p04loc_634F
; ---------------------------------------------------------------------------

p04loc_63AA:				; CODE XREF: FNDSELEQ+F1j
		cp	5
		jr	z, p04loc_63B6
		bit	5, (hl)
		jr	z, p04loc_634F
		res	5, (hl)
		jr	p04loc_6399
; ---------------------------------------------------------------------------

p04loc_63B6:				; CODE XREF: FNDSELEQ+141j
		push	hl
		dec	hl
		dec	hl
		dec	hl
		ld	e, (hl)
		dec	hl
		ld	d, (hl)
		dec	hl
		ld	b, (hl)
		inc	hl
		inc	hl
		inc	hl
		inc	hl
		inc	hl
		bit	1, (iy+1Eh)
		jr	z, p04loc_63D1
		ld	a, (OP1M)
		cp	82h ; '�'
		jr	z, p04loc_63D4

p04loc_63D1:				; CODE XREF: FNDSELEQ+15Dj
		call	DelVar

p04loc_63D4:				; CODE XREF: FNDSELEQ+164j
		pop	hl
		jp	p04loc_6282
; End of function FNDSELEQ


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


NEXTEQ:					; CODE XREF: p04sub_449A+1p
		; ForceGraphKeypress+C91p ...
		ld	b, 1
		jr	p04loc_63DE
; ---------------------------------------------------------------------------

PREVEQ:					; CODE XREF: ForceGraphKeypress+FC8p
		; ForceGraphKeypress+1013p ...
		ld	b, 0FFh

p04loc_63DE:				; CODE XREF: NEXTEQ+2j	NEXTEQ+28j
		push	bc
		ld	b, a
		ld	a, (curGStyle)
		cp	7Fh ; ''
		ld	a, b
		pop	bc
		jr	nc, p04loc_63EE
		add	a, b
		cp	0FFh
		jr	nz, p04loc_63F0

p04loc_63EE:				; CODE XREF: NEXTEQ+Fj
		xor	a
		ret
; ---------------------------------------------------------------------------

p04loc_63F0:				; CODE XREF: NEXTEQ+14j
		cp	0Bh
		jr	c, p04loc_63F6
		xor	a
		ret
; ---------------------------------------------------------------------------

p04loc_63F6:				; CODE XREF: NEXTEQ+1Aj
		push	af
		ld	hl, (EQS)
		call	isInSet
		jr	nz, p04loc_6402
		pop	af
		jr	p04loc_63DE
; ---------------------------------------------------------------------------

p04loc_6402:				; CODE XREF: NEXTEQ+25j
		pop	af
		push	af
		call	Page0Call_385B
		pop	af
		ret
; End of function NEXTEQ


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


p04sub_6409:				; CODE XREF: FNDSELEQ+BAp
		ld	h, a
		call	ShRAcc
		ld	b, a
		ld	a, h
		and	0Fh
		inc	b
		jr	p04loc_6416
; ---------------------------------------------------------------------------

p04loc_6414:				; CODE XREF: p04sub_6409:p04loc_6416j
		add	a, 0Ah

p04loc_6416:				; CODE XREF: p04sub_6409+9j
		djnz	p04loc_6414
		ret
; End of function p04sub_6409


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


p04sub_6419:				; CODE XREF: ForceGraphKeypress+595p
		; ForceGraphKeypress+645p
		push	hl
		call	p04sub_5CEA
		call	CkValidNum
		call	Page0Call_3339
		call	GRLABELS
		pop	hl
		pop	de
		pop	bc
		ld	(pTempCnt), bc
		push	de
		jp	PutAns
; End of function p04sub_6419


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


p04sub_6431:				; CODE XREF: seg001:6554p
		set	1, (iy+2)
		ld	a, (curGY)
		ld	(curGY2), a
		call	HorizontalLine
		jr	p04loc_648F
; End of function p04sub_6431


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


p04sub_6440:				; CODE XREF: seg001:654Bp
		set	1, (iy+2)
		ld	a, (curGY+1)
		ld	(curGY2+1), a
		call	p04sub_4017
		jr	p04loc_648F
; End of function p04sub_6440


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


p04sub_644F:				; CODE XREF: seg001:6542p
		ld	de, (curGY2)
		set	1, (iy+2)
		ld	h, 1
		ld	bc, (curGY)
		jr	p04loc_648C
; End of function p04sub_644F


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


p04sub_645F:				; CODE XREF: seg001:6565p
		set	1, (iy+2)
		ld	h, 1
		ld	de, (curGY)
		ld	bc, (curGY2)
		ld	a, d
		ld	l, e
		ld	e, c
		cp	b
		jr	z, p04loc_648A
		call	ILine
		ld	a, l
		cp	c
		jr	z, p04loc_648F
		ld	c, l
		ld	l, e
		ld	e, c
		call	ILine
		ld	e, l
		ld	l, d
		ld	d, b
		call	ILine
		ld	b, l
		ld	d, l
		jr	p04loc_648C
; ---------------------------------------------------------------------------

p04loc_648A:				; CODE XREF: p04sub_645F+12j
		ld	b, d
		ld	c, l

p04loc_648C:				; CODE XREF: p04sub_644F+Ej p04sub_645F+29j
		call	ILine

p04loc_648F:				; CODE XREF: p04sub_6431+Dj p04sub_6440+Dj ...
		res	1, (iy+2)
		ret
; End of function p04sub_645F

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

BLINKGCUR:
		bit	2, (iy+3)
		ret	z
		bit	0, (iy+2)
		jr	nz, p04loc_64AB
		ld	a, 5
		bit	3, (iy+35h)
		call	nz, Page0Call_330F
		ret	nz
		jr	p04loc_64B5
; ---------------------------------------------------------------------------

p04loc_64AB:				; CODE XREF: seg001:649Dj
		ld	a, 3
		bit	0, (iy+36h)
		call	nz, Page0Call_3369
		ret	nz

p04loc_64B5:				; CODE XREF: seg001:64A9j
		ld	a, (curGStyle)
		ld	d, 2
		jp	p04sub_6580
; ---------------------------------------------------------------------------

NBCURSOR:
		bit	0, (iy+2)
		jr	nz, p04loc_64CF
		ld	a, 4
		bit	3, (iy+35h)
		call	nz, Page0Call_330F
		ret	nz
		jr	p04loc_64D9
; ---------------------------------------------------------------------------

p04loc_64CF:				; CODE XREF: seg001:64C1j
		ld	a, 4
		bit	0, (iy+36h)
		call	nz, Page0Call_3369
		ret	nz

p04loc_64D9:				; CODE XREF: seg001:64CDj
		ld	a, (curGStyle)
		cp	55h ; 'U'
		jr	nz, p04loc_64EB

p04loc_64E0:				; CODE XREF: seg001:64EDj seg001:64F1j ...
		ld	de, 8D8Fh
		ld	hl, p04loc_665F
		call	p04sub_6619
		jr	p04loc_6518
; ---------------------------------------------------------------------------

p04loc_64EB:				; CODE XREF: seg001:64DEj
		cp	6Bh ; 'k'
		jr	z, p04loc_64E0
		cp	79h ; 'y'
		jr	z, p04loc_64E0
		cp	61h ; 'a'
		jr	z, p04loc_64E0
		cp	6Dh ; 'm'
		jr	z, p04loc_6503
		cp	7Bh ; '{'
		jr	z, p04loc_6503
		cp	57h ; 'W'
		jr	nz, p04loc_650E

p04loc_6503:				; CODE XREF: seg001:64F9j seg001:64FDj
		ld	de, 8D98h
		ld	hl, p04loc_6664
		call	p04sub_6619
		jr	p04loc_64E0
; ---------------------------------------------------------------------------

p04loc_650E:				; CODE XREF: seg001:6501j
		bit	2, (iy+3)
		jr	z, p04loc_6518
		cp	81h ; '�'
		jr	z, p04loc_64E0

p04loc_6518:				; CODE XREF: seg001:64E9j seg001:6512j
		bit	7, (iy+8)
		call	z, COORDISP
		ld	a, (curGStyle)
		cp	67h ; 'g'
		jr	z, p04loc_6530
		cp	59h ; 'Y'
		jr	nz, p04loc_6536
		ld	de, 0FFF8h
		call	p04sub_666E

p04loc_6530:				; CODE XREF: seg001:6524j
		ld	de, 0FFFFh
		call	p04sub_666E

p04loc_6536:				; CODE XREF: seg001:6528j
		bit	2, (iy+3)
		ret	z
		ld	a, (curGStyle)
		cp	1Dh
		jr	nz, p04loc_6547
		call	p04sub_644F
		jr	p04loc_6568
; ---------------------------------------------------------------------------

p04loc_6547:				; CODE XREF: seg001:6540j
		cp	29h ; ')'
		jr	nz, p04loc_6550
		call	p04sub_6440
		jr	p04loc_657B
; ---------------------------------------------------------------------------

p04loc_6550:				; CODE XREF: seg001:6549j
		cp	31h ; '1'
		jr	nz, p04loc_6559
		call	p04sub_6431
		jr	p04loc_657B
; ---------------------------------------------------------------------------

p04loc_6559:				; CODE XREF: seg001:6552j
		cp	27h ; '''
		jr	nz, p04loc_6561
		and	0FEh ; '�'
		jr	p04loc_656A
; ---------------------------------------------------------------------------

p04loc_6561:				; CODE XREF: seg001:655Bj
		cp	9
		jr	nz, p04loc_657B
		call	p04sub_645F

p04loc_6568:				; CODE XREF: seg001:6545j
		ld	a, 2

p04loc_656A:				; CODE XREF: seg001:655Fj
		ld	hl, (curGY)
		push	hl
		ld	hl, (curGY2)
		ld	(curGY), hl
		call	p04sub_6580
		pop	hl
		ld	(curGY), hl

p04loc_657B:				; CODE XREF: seg001:654Ej seg001:6557j ...
		ld	a, (curGStyle)
		and	0FEh ; '�'

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


p04sub_6580:				; CODE XREF: seg001:64BAj seg001:6574p ...

; FUNCTION CHUNK AT 65DD SIZE 00000009 BYTES

		srl	a
		jr	c, p04loc_65DD
		ld	d, 1
		dec	a
		jr	c, p04loc_65D8
		cp	4
		jr	c, p04loc_659C
		cp	25h ; '%'
		jr	z, p04loc_6593
		cp	26h ; '&'

p04loc_6593:				; CODE XREF: p04sub_6580+Fj
		ld	a, 1
		jr	z, p04loc_659C
		ld	a, 4
		jr	c, p04loc_659C
		inc	a

p04loc_659C:				; CODE XREF: p04sub_6580+Bj p04sub_6580+15j	...
		ld	h, a
		add	a, a
		add	a, a
		add	a, h
		ld	hl, p04loc_6637
		ld	c, a
		ld	b, 0
		add	hl, bc
		ld	bc, (curGY)

p04loc_65AB:				; CODE XREF: p04sub_6619+12j
		set	1, (iy+2)
; End of function p04sub_6580


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


p04sub_65AF:				; CODE XREF: seg001:65FBp p04sub_6600+9p	...
		inc	b
		inc	b
		inc	c
		inc	c
		ld	e, 5

p04loc_65B5:				; CODE XREF: p04sub_65AF+27j
		push	hl
		ld	hl, p04loc_662E
		ld	a, (winBtm)
		add	a, l
		ld	l, a
		jr	nc, p04loc_65C1
		inc	h

p04loc_65C1:				; CODE XREF: p04sub_65AF+Fj
		ld	a, (hl)
		cp	c
		pop	hl
		jr	nc, p04loc_65D8
		push	bc
		ld	a, (hl)

p04loc_65C8:				; CODE XREF: p04sub_65AF+21j
		srl	a
		call	c, IPoint
		jr	z, p04loc_65D2
		dec	b
		jr	p04loc_65C8
; ---------------------------------------------------------------------------

p04loc_65D2:				; CODE XREF: p04sub_65AF+1Ej
		pop	bc
		dec	c
		inc	hl
		dec	e
		jr	nz, p04loc_65B5

p04loc_65D8:				; CODE XREF: p04sub_6580+7j p04sub_65AF+15j
		res	1, (iy+2)
		ret
; End of function p04sub_65AF

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p04sub_6580

p04loc_65DD:				; CODE XREF: p04sub_6580+2j
		cp	28h ; '('
		ld	a, 6
		jr	c, p04loc_659C
		inc	a
		jr	p04loc_659C
; END OF FUNCTION CHUNK	FOR p04sub_6580
; ---------------------------------------------------------------------------

STATMARK:
		cp	1
		ld	hl, p04loc_664B
		jr	z, p04loc_65F1
		ret	nc
		ld	hl, p04loc_6646

p04loc_65F1:				; CODE XREF: seg001:65EBj
		ld	bc, (curGY)
		res	1, (iy+2)
		ld	d, 1
		call	p04sub_65AF
		scf
		ret

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


p04sub_6600:				; CODE XREF: PLOTPT+2Bp
		ld	d, 4

p04loc_6602:				; CODE XREF: p04sub_6611+6j
		ld	hl, p04loc_6669
		set	1, (iy+2)
		call	p04sub_65AF
		res	1, (iy+2)
		ret
; End of function p04sub_6600


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


p04sub_6611:				; CODE XREF: p04sub_71DD+3p
		set	6, (iy+18h)
		ld	d, 1
		jr	p04loc_6602
; End of function p04sub_6611


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


p04sub_6619:				; CODE XREF: seg001:64E6p seg001:6509p
		push	hl
		call	XftoI
		push	af
		ld	a, (lcdTallP)
		sub	7
		sub	3
		ld	c, a
		pop	af
		ld	b, a
		pop	hl
		ld	d, 1
		jp	p04loc_65AB
; End of function p04sub_6619

p04loc_662E:
		.db  3Fh	; ?
		.db  37h	; 7
		.db  2Fh	; /
		.db  27h	; '
		.db  1Fh
		.db  17h
		.db  0Fh
		.db    7
		.db    0
p04loc_6637:
		.db    0
		.db  0Eh
		.db  0Eh
		.db  0Eh
		.db    0
		.db  11h
		.db  0Ah
		.db    0
		.db  0Ah
		.db  11h
		.db    4
		.db    4
		.db  1Bh
		.db    4
		.db    4
p04loc_6646:
		.db    0
		.db  0Eh
		.db  0Ah
		.db  0Eh
		.db    0
p04loc_664B:
		.db    0
		.db    4
		.db  0Eh
		.db    4
		.db    0
		.db  11h
		.db  0Eh
		.db  0Ah
		.db  0Eh
		.db  11h
		.db    0
		.db    0
		.db    4
		.db    0
		.db    0
		.db  11h
		.db    0
		.db    4
		.db    0
		.db  11h
p04loc_665F:
		.db  10h
		.db  18h
		.db  1Ch
		.db  18h
		.db  10h
p04loc_6664:
		.db    1
		.db    3
		.db    7
		.db    3
		.db    1
p04loc_6669:
		.db  0Eh
		.db  11h
		.db  11h
		.db  11h
		.db  0Eh

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


p04sub_666E:				; CODE XREF: seg001:652Dp seg001:6533p
		ld	hl, (curGY)
		push	hl
		ld	hl, 8D98h
		add	hl, de
		ld	d, (hl)
		dec	hl
		ld	e, (hl)
		ld	(curGY), de
		ld	a, 6
		call	p04sub_6580
		pop	hl
		ld	(curGY), hl
		ret
; End of function p04sub_666E


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


CHKTEXTCURS:				; CODE XREF: ForceGraphKeypress+2D6p
		; seg001:674Bj
		ld	a, c
		ld	hl, lcdTallP
		cp	(hl)
		ret	nc
		bit	4, (iy+24h)
		jr	z, p04loc_6697
		cp	7
		jr	p04loc_6699
; ---------------------------------------------------------------------------

p04loc_6697:				; CODE XREF: CHKTEXTCURS+Aj
		cp	6

p04loc_6699:				; CODE XREF: CHKTEXTCURS+Ej
		ccf
		ret	nc
		ld	a, b
		ld	hl, pixWide_m_1
		cp	(hl)
		ret	nc
		cp	0
		ccf
		ret
; End of function CHKTEXTCURS


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


CLRGRAPHXY:				; CODE XREF: LABCOOR+B0p LABCOOR+12Cp	...
		ld	a, 0B8h	; '�'
		ld	hl, 95ECh
		call	CheckSplitFlag
		jr	z, p04loc_66B4
		ld	a, 97h ; '�'
		ld	hl, 9460h

p04loc_66B4:				; CODE XREF: CLRGRAPHXY+8j
		call	Bit_VertSplit
		jr	z, p04loc_66C2
		ld	a, 0B1h	; '�'
		ld	hl, 9598h
		ld	b, 0Eh
		jr	p04loc_66C4
; ---------------------------------------------------------------------------

p04loc_66C2:				; CODE XREF: CLRGRAPHXY+12j
		ld	b, 7

p04loc_66C4:				; CODE XREF: CLRGRAPHXY+1Bj
		ld	d, a
		di

p04loc_66C6:				; CODE XREF: CLRGRAPHXY:p04loc_66F9j
		ld	e, 20h ; ' '
		inc	d
		ld	a, d
		call	SetYUp
		call	lcd_busy
		out	(10h), a
		ld	a, e
		call	lcd_busy
		out	(10h), a

p04loc_66D8:				; CODE XREF: CLRGRAPHXY:p04loc_66ECj
		ld	a, (hl)
		inc	hl
		call	lcd_busy
		out	(11h), a
		inc	e
		ld	a, e
		call	Bit_VertSplit
		jr	z, p04loc_66EA
		cp	26h ; '&'
		jr	p04loc_66EC
; ---------------------------------------------------------------------------

p04loc_66EA:				; CODE XREF: CLRGRAPHXY+3Fj
		cp	2Ch ; ','

p04loc_66EC:				; CODE XREF: CLRGRAPHXY+43j
		jr	nz, p04loc_66D8
		call	Bit_VertSplit
		jr	z, p04loc_66F9
		inc	hl
		inc	hl
		inc	hl
		inc	hl
		inc	hl
		inc	hl

p04loc_66F9:				; CODE XREF: CLRGRAPHXY+4Cj
		djnz	p04loc_66C6
		call	SetXUp
		ei
		ret
; End of function CLRGRAPHXY


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


p04sub_6700:				; CODE XREF: p04sub_50FE:p04loc_511Cp
		; p04sub_465B+CA8p
		ld	(curInc), hl
		ld	(unk_8E2B), hl
		ret
; End of function p04sub_6700

; ---------------------------------------------------------------------------
		ld	hl, (unk_9665)
		inc	hl

p04loc_670B:				; CODE XREF: seg001:6713j
		ld	(unk_9665), hl
		ret
; ---------------------------------------------------------------------------
		ld	hl, (unk_9665)
		dec	hl
		jr	p04loc_670B

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


p04sub_6715:				; CODE XREF: TraceOffp
		; ForceGraphKeypress+4CEp ...
		res	5, (iy+17h)
		res	4, (iy+17h)
		res	4, (iy+1Eh)

p04loc_6721:				; CODE XREF: p04sub_465B+D1Cp
		res	2, (iy+17h)
		ret
; End of function p04sub_6715


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


p04sub_6726:				; CODE XREF: p04sub_465B:p04loc_4686p
		; p04sub_465B+B0Cp ...
		ld	de, 8D21h
		jp	MovFrOP1
; End of function p04sub_6726

p04loc_672C:
		.db    8
		.db  66h	; f
		.db  28h	; (
		.db  78h	; x
		.db  29h	; )
		.db  64h	; d
		.db  78h	; x
		.db  3Dh	; =
		.db    0
p04loc_6735:
		.db  64h	; d
		.db  72h	; r
		.db  2Fh	; /
		.db  64h	; d
		.db  5Bh	; [
		.db  3Dh	; =
		.db    0
p04loc_673C:
		.db  64h	; d
		.db  78h	; x
		.db  2Fh	; /
		.db  64h	; d
		.db  74h	; t
		.db  3Dh	; =
		.db    0
p04loc_6743:
		.db  64h	; d
		.db  79h	; y
		.db  2Fh	; /
		.db  64h	; d
		.db  74h	; t
		.db  3Dh	; =
		.db    0
; ---------------------------------------------------------------------------

Page04_353A:
		or	a
		jp	z, CHKTEXTCURS
		cp	1
		jp	z, XYCENT
		cp	65h ; 'e'
		jp	z, ZmFit
		cp	86h ; '�'
		jp	z, ZooDefault
		cp	87h ; '�'
		jp	z, ZmTrig
		cp	8Bh ; '�'
		jp	z, ZmSquare
		cp	8Ch ; '�'
		jp	z, ZmInt
		cp	8Dh ; '�'
		jp	z, ZmPrev
		cp	8Eh ; '�'
		jp	z, ZmDecml
		cp	90h ; '�'
		jp	z, ZmUsr
		cp	92h ; '�'
		jp	z, SETUZM
		cp	93h ; '�'
		jp	z, GDISPTOKEN
		ret

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


p04sub_6786:				; CODE XREF: Regraph+10Ap Regraph+10Dp ...
		ld	hl, 8479h
		inc	(hl)
		rst	10h
		call	nc, DelVar
		ret
; End of function p04sub_6786


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


Regraph:				; CODE XREF: seg001:p04loc_44DEp
		; ForceGraphKeypress+85Bp ...

; FUNCTION CHUNK AT 6A00 SIZE 00000322 BYTES
; FUNCTION CHUNK AT 6D2B SIZE 000000C1 BYTES
; FUNCTION CHUNK AT 6E38 SIZE 000000F4 BYTES

		ei
		call	Page0Call_3F2D
		ld	b, a
		ld	a, 0
		call	p04sub_7564
		ld	a, b
		ret	nz
		res	2, (iy+1Fh)
		res	7, (iy+1Eh)
		push	af
		ld	a, 40h ; '@'

p04loc_67A6:
		ld	(unk_966D), a
		res	6, (iy+18h)
		res	7, (iy+0)
		res	2, (iy+14h)
		bit	0, (iy+2)
		jr	nz, p04loc_67C6
		ld	hl, 8D1Eh
		ld	(hl), 0
		inc	hl
		ld	(hl), 1
		inc	hl
		ld	(hl), 0

p04loc_67C6:				; CODE XREF: Regraph+2Aj
		call	TraceOff
		call	CentCursor
		call	page0_189
		jp	nz, p04loc_6993
		ld	a, 36h ; '6'
		call	Page0Call_3633
		call	Page0Call_3B5B
		ld	(Xres_int), a
		call	p04sub_756C
		jr	z, p04loc_67E9
		call	page0_13
		jr	z, p04loc_67F2
		jr	p04loc_67EF
; ---------------------------------------------------------------------------

p04loc_67E9:				; CODE XREF: Regraph+51j
		call	Page0Call_35A9
		call	CPTDELY

p04loc_67EF:				; CODE XREF: Regraph+58j
		call	CPTDELX

p04loc_67F2:				; CODE XREF: Regraph+56j
		ld	hl, Xmin
		ld	de, 8E6Ah
		call	mov9B2
		call	OP1Set0
		ld	de, 8E73h
		call	MovFrOP1
		res	5, (iy+3)
		call	p04sub_756C
		jr	nz, p04loc_686D
		set	2, (iy+2)
		pop	bc
		ld	a, 1
		call	p04sub_7564
		ld	a, b
		ret	nz
		push	af
		call	page0_185F
		jr	nz, p04loc_6824
		call	GRBUFCPY_V
		jr	p04loc_686D
; ---------------------------------------------------------------------------

p04loc_6824:				; CODE XREF: Regraph+8Ej
		ld	a, 0FFh
		ld	(unk_9668), a
		call	GrBufClr
		call	Page0Call_3CFF
		call	Bit_VertSplit
		call	nz, Page0Call_34AD
		set	2, (iy+2)
		ld	a, 2
		call	p04sub_7564
		call	z, Axes
		call	DRAWSPLITLINE
		call	page0_189
		jp	nz, p04loc_6993
		call	Page0Call_32EB
		ld	hl, Xmin
		ld	b, 17h
		call	p04sub_72F9
		ld	hl, fin_N
		ld	b, 7
		call	p04sub_72F9
		ld	hl, TblMin
		ld	b, 2
		call	p04sub_72F9
		ld	hl, uXmin
		ld	b, 17h
		call	p04sub_72F9

p04loc_686D:				; CODE XREF: Regraph+7Cj Regraph+93j
		ld	hl, 0
		ld	(curGY2), hl
		set	1, (iy+3)
		ld	hl, (pTempCnt)
		push	hl
		call	FNDSELEQ
		call	ZeroOP1
		rst	18h
		rst	18h
		call	page0_185F
		jr	z, p04loc_68B8
		res	6, (iy+19h)
		call	p04sub_756C
		jr	nz, p04loc_68C8
		call	ZeroOP1
		ld	a, 26h ; '&'
		ld	(OP1+1), a
		call	p04sub_6786
		call	p04sub_6786
		call	p04sub_6786
		xor	a
		ld	(curPlotNumber), a
		call	Page0Call_357F
		call	p04sub_7087
		call	Page0Call_357F
		call	p04sub_7087
		call	Page0Call_357F
		call	p04sub_7087

p04loc_68B8:				; CODE XREF: Regraph+F7j
		set	1, (iy+17h)
		xor	a
		ld	(curPlotNumber), a
		ld	a, 9
		call	p04sub_7564
		jp	nz, p04loc_6962

p04loc_68C8:				; CODE XREF: Regraph+100j
		call	page0_13
		jp	z, p04loc_6A99
		call	Page04_330C
		rst	18h
		ld	a, 0FFh
		ld	(OP1), a
		call	p04sub_756C
		jr	z, p04loc_68E8
		rst	18h
		ld	hl, Xmin
		rst	20h
		push	hl
		rst	18h
		pop	hl
		rst	20h
		rst	18h
		jr	p04loc_68F0
; ---------------------------------------------------------------------------

p04loc_68E8:				; CODE XREF: Regraph+14Bj
		bit	1, (iy+4)
		jp	nz, p04loc_6A00
		rst	18h

p04loc_68F0:				; CODE XREF: Regraph+157j Regraph+1CFj
		call	p04sub_7211
		jr	z, p04loc_6962
		call	p04sub_70D4

p04loc_68F8:				; CODE XREF: Regraph+1D1j
		call	p04sub_72A7
		set	5, (iy+3)
		call	p04sub_755F
		call	nz, GrBufCpy
		res	6, (iy+18h)
		call	NEDXT_Y_STYLE

p04loc_690C:				; CODE XREF: Regraph+1CAj
		ld	a, 3
		call	p04sub_7564
		call	p04sub_75A9
		call	INITNSEQ
		call	p04sub_756C
		jr	z, p04loc_6921
		call	p04sub_7571
		jr	p04loc_6941
; ---------------------------------------------------------------------------

p04loc_6921:				; CODE XREF: Regraph+18Bj
		call	p04sub_755A
		jr	z, p04loc_692D
		call	CpyO1ToFPST
		res	5, (iy+3)

p04loc_692D:				; CODE XREF: Regraph+195j
		set	5, (iy+14h)
		call	YRES
		res	5, (iy+14h)
		call	p04sub_6FCD
		call	p04sub_755F
		call	nz, p04sub_75B3

p04loc_6941:				; CODE XREF: Regraph+190j
		call	p04sub_7087
		call	Page04_3396
		call	p04sub_69EF
		jr	nc, p04loc_695B
		ld	hl, (inputDat)
		ld	b, a
		ld	a, 6
		call	p04sub_7564
		ld	a, b
		call	z, Xitof
		jr	p04loc_690C

p04loc_695B:				; CODE XREF: Regraph+1BBj
		call	p04sub_712A
		jr	nc, p04loc_68F0
		jr	p04loc_68F8
; ---------------------------------------------------------------------------

p04loc_6962:				; CODE XREF: Regraph+136j Regraph+164j ...
		res	0, (iy+3)
		res	1, (iy+17h)
		res	0, (iy+17h)
		call	p04sub_756C
		jr	nz, p04loc_698F
		res	6, (iy+1Dh)

p04loc_6977:				; CODE XREF: p04sub_7087+Cj
		call	p04sub_755F
		call	nz, GrBufCpy
		res	5, (iy+14h)
		ld	hl, (EQS)
		ld	(FPS), hl
		ld	a, 1
		call	AllEq
		call	p04sub_69AF

p04loc_698F:				; CODE XREF: Regraph+1E2j
		pop	hl
		ld	(pTempCnt), hl

p04loc_6993:				; CODE XREF: Regraph+40j Regraph+B8j
		res	1, (iy+3)
		pop	af
		call	TraceOff
		call	CentCursor
		ld	b, a
		ld	a, 7
		call	p04sub_7564
		ld	a, b
		ret
; End of function Regraph


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


p04sub_69A6:				; CODE XREF: p04sub_69AF+5p p04sub_69AF+10p	...
		ld	de, 9

p04loc_69A9:				; CODE XREF: p04sub_69A6+6j
		set	6, (hl)
		add	hl, de
		djnz	p04loc_69A9
		ret
; End of function p04sub_69A6


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


p04sub_69AF:				; CODE XREF: Regraph+1FDp
		ld	hl, TblMin
		ld	b, 2
		call	p04sub_69A6

DOREFFLAGS02:
		call	XName
		ld	hl, Xmin
		ld	b, 6
		call	p04sub_69A6
		call	page0_13
		jr	nz, p04loc_69EA
		call	ThetaName
		ld	hl, ThetaMin
		ld	b, 3
		call	page0_198
		jr	nz, p04loc_69E7
		call	TName
		ld	hl, TminPar
		call	page0_1A2
		jr	nz, p04loc_69E7
		call	RECURNNAME
		ld	hl, PlotStart
		ld	b, 9

p04loc_69E7:				; CODE XREF: p04sub_69AF+23j p04sub_69AF+2Ej
		call	p04sub_69A6

p04loc_69EA:				; CODE XREF: p04sub_69AF+16j
		rst	10h
		ret	c
		res	6, (hl)
		ret
; End of function p04sub_69AF


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


p04sub_69EF:				; CODE XREF: Regraph+1B8p Regraph+286p
		ld	a, (curInc)
		ld	hl, pixWide_m_2
		cp	(hl)
		ret	nc
		ld	hl, Xres_int
		add	a, (hl)
		ld	(curInc), a
		scf
		ret
; End of function p04sub_69EF

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR Regraph

p04loc_6A00:				; CODE XREF: Regraph+15Dj
		ld	hl, 1

p04loc_6A03:				; CODE XREF: Regraph+2C2j
		ld	(unk_980E), hl
		set	5, (iy+3)
		ld	a, (unk_9668)
		ld	(unk_9667), a

p04loc_6A10:				; CODE XREF: Regraph+2A0j Regraph+307j
		call	p04sub_70A9
		jr	nz, p04loc_6A53
		call	p04sub_69EF
		jr	nc, p04loc_6A31
		call	p04sub_713E
		ex	de, hl
		ld	hl, (inputDat)
		push	hl
		call	mov9B2
		pop	hl
		call	Xitof
		call	p04sub_755F
		call	nz, p04sub_75B3
		jr	p04loc_6A10
; ---------------------------------------------------------------------------

p04loc_6A31:				; CODE XREF: Regraph+289j
		ld	de, (EQS)
		ld	hl, 12h
		add	hl, de
		call	Page0Call_35D3
		ld	de, 9
		add	hl, de
		ld	(FPS), hl
		call	p04sub_755F
		call	nz, GrBufCpy
		res	6, (iy+18h)
		ld	hl, (unk_980E)
		inc	hl
		jr	p04loc_6A03
; ---------------------------------------------------------------------------

p04loc_6A53:				; CODE XREF: Regraph+284j
		ld	a, (curGY2)
		dec	a
		jr	nz, p04loc_6A65
		ld	a, (unk_9667)
		ld	(unk_9668), a
		call	p04sub_755A
		call	nz, p04sub_72A7

p04loc_6A65:				; CODE XREF: Regraph+2C8j
		call	NEDXT_Y_STYLE
		call	p04sub_75A9
		call	p04sub_755A
		call	nz, PushRealO1
		call	INITNSEQ
		call	p04sub_7162
		call	MovFrOP1
		call	p04sub_713E
		ld	de, OP3
		call	mov9B2
		rst	8
		ld	hl, (inputDat)
		rst	20h
		set	5, (iy+14h)
		call	PLOTPT
		res	5, (iy+14h)
		call	p04sub_7087
		jp	p04loc_6A10
; ---------------------------------------------------------------------------

p04loc_6A99:				; CODE XREF: Regraph+13Cj
		call	page0_1A2
		jp	z, p04loc_6C06
		ld	hl, TminPar
		call	p04sub_6DF3
		call	p04sub_72C4
		ld	a, 0FFh
		ld	(OP2), a
		call	p04sub_756C
		jr	z, p04loc_6AB7
		call	PUSHMCPLXO1
		jr	p04loc_6ABE
; ---------------------------------------------------------------------------

p04loc_6AB7:				; CODE XREF: Regraph+321j
		bit	1, (iy+4)
		jp	nz, p04loc_6B5E

p04loc_6ABE:				; CODE XREF: Regraph+326j
		rst	18h
		rst	18h

p04loc_6AC0:				; CODE XREF: Regraph+3C9j
		call	p04sub_70CF

p04loc_6AC3:				; CODE XREF: Regraph+3CCj
		call	p04sub_7298
		call	p04sub_756C
		jr	nz, p04loc_6ADF
		set	5, (iy+3)
		call	p04sub_755F
		call	nz, GrBufCpy
		res	6, (iy+18h)
		ld	hl, y0LineType
		call	p04sub_6FA7

p04loc_6ADF:				; CODE XREF: Regraph+33Aj Regraph+3C4j
		call	p04sub_75A9
		call	p04sub_755A
		call	nz, CpyO1ToFPS1
		call	p04sub_715C
		call	page0_18E
		push	af
		call	Page0Call_334B
		call	page0_17E0
		call	Page0Call_337B
		call	p04sub_755A
		jr	z, p04loc_6B04
		call	CpyO1ToFPST
		res	5, (iy+3)

p04loc_6B04:				; CODE XREF: Regraph+36Cj
		call	INITNSEQ
		call	p04sub_756C
		jr	z, p04loc_6B1B
		pop	af
		jr	z, p04loc_6B4A
		call	p04sub_7571
		ld	hl, (XOutDat)
		rst	20h
		call	Page0Call_35D9
		jr	p04loc_6B4A
; ---------------------------------------------------------------------------

p04loc_6B1B:				; CODE XREF: Regraph+37Bj
		call	CpyTo3FPS1
		inc	de
		inc	de
		call	mov9B2
		rst	8
		call	CpyO1ToFPST
		ld	hl, (XOutDat)
		rst	20h
		pop	af
		jr	nz, p04loc_6B33
		ld	hl, OP1
		set	5, (hl)

p04loc_6B33:				; CODE XREF: Regraph+39Dj
		call	CpyO1ToFPS1
		set	5, (iy+14h)
		call	PLOTPT
		res	5, (iy+14h)
		call	OP1Set1
		call	p04sub_755F
		call	nz, p04sub_75B3

p04loc_6B4A:				; CODE XREF: Regraph+37Ej Regraph+38Aj
		call	p04sub_7087
		call	Page04_3396
		call	p04sub_7221
		jr	nc, p04loc_6ADF
		call	p04sub_712A
		jp	nc, p04loc_6AC0
		jp	p04loc_6AC3
; ---------------------------------------------------------------------------

p04loc_6B5E:				; CODE XREF: Regraph+32Cj
		ld	hl, 1

p04loc_6B61:				; CODE XREF: Regraph+3FFj
		ld	(unk_980E), hl
		set	5, (iy+3)

p04loc_6B68:				; CODE XREF: Regraph+3E1j Regraph+474j
		call	p04sub_70A9
		jr	nz, p04loc_6B90
		call	p04sub_7221
		jr	nc, p04loc_6B68
		ld	de, (EQS)
		ld	hl, 12h
		add	hl, de
		call	Page0Call_35D3
		ld	(FPS), hl
		call	p04sub_755F
		call	nz, GrBufCpy
		res	6, (iy+18h)
		ld	hl, (unk_980E)
		inc	hl
		jr	p04loc_6B61
; ---------------------------------------------------------------------------

p04loc_6B90:				; CODE XREF: Regraph+3DCj
		ld	hl, y0LineType
		call	p04sub_6FA7
		ld	a, (curGY2)
		dec	a
		jr	nz, p04loc_6BA2
		call	p04sub_755A
		call	nz, p04sub_7298

p04loc_6BA2:				; CODE XREF: Regraph+40Bj
		call	p04sub_75A9
		call	p04sub_755A
		call	nz, PushRealO1
		call	p04sub_715C
		call	page0_18E
		push	af
		call	Page0Call_334B
		call	page0_17E0
		call	Page0Call_337B
		call	p04sub_755A
		call	nz, PushRealO1
		call	INITNSEQ
		ld	a, (curGY2)
		dec	a
		add	a, a
		ld	de, OP3
		call	p04sub_7168
		push	de
		ld	de, OP4
		call	mov9B2
		rst	8
		ld	hl, (XOutDat)
		rst	20h
		pop	de
		pop	af
		jr	nz, p04loc_6BE4
		ld	hl, OP1
		set	5, (hl)

p04loc_6BE4:				; CODE XREF: Regraph+44Ej
		call	MovFrOP1
		inc	hl
		inc	hl
		call	mov9B2
		set	5, (iy+14h)
		call	PLOTPT
		res	5, (iy+14h)
		call	OP1Set1
		call	p04sub_755F
		call	nz, p04sub_75B3
		call	p04sub_7087
		jp	p04loc_6B68
; ---------------------------------------------------------------------------

p04loc_6C06:				; CODE XREF: Regraph+30Dj
		call	page0_19D
		jp	nz, p04loc_6E38
		ld	hl, ThetaMin
		call	p04sub_6DF3
		call	p04sub_72C4
		call	p04sub_72ED
		ld	a, 0FFh
		ld	(OP2), a
		call	p04sub_756C
		jr	z, p04loc_6C27
		call	PUSHMCPLXO1
		jr	p04loc_6C2D
; ---------------------------------------------------------------------------

p04loc_6C27:				; CODE XREF: Regraph+491j
		bit	1, (iy+4)
		jr	nz, p04loc_6C98

p04loc_6C2D:				; CODE XREF: Regraph+496j
		call	PUSHMCPLXO1

p04loc_6C30:				; CODE XREF: Regraph+505j
		call	p04sub_70CF

p04loc_6C33:				; CODE XREF: Regraph+507j
		call	p04sub_7289
		set	5, (iy+3)
		call	p04sub_755F
		call	nz, GrBufCpy
		res	6, (iy+18h)
		ld	hl, para6LineType
		call	p04sub_6FA7

p04loc_6C4A:				; CODE XREF: Regraph+500j
		call	p04sub_75A9
		call	p04sub_70DF
		call	p04sub_756C
		jr	z, p04loc_6C63
		call	OP2ToOP4
		call	Page0Call_35D9
		call	OP4ToOP1
		call	p04sub_7571
		jr	p04loc_6C86
; ---------------------------------------------------------------------------

p04loc_6C63:				; CODE XREF: Regraph+4C4j
		call	p04sub_755A
		jr	z, p04loc_6C72
		call	CpyO1ToFPS1
		call	CpyO2ToFPST
		res	5, (iy+3)

p04loc_6C72:				; CODE XREF: Regraph+4D7j
		set	5, (iy+14h)
		call	p04sub_7180
		res	5, (iy+14h)
		call	OP1Set1
		call	p04sub_755F
		call	nz, p04sub_75B3

p04loc_6C86:				; CODE XREF: Regraph+4D2j
		call	p04sub_7087
		call	Page04_3396
		call	p04sub_721C
		jr	nc, p04loc_6C4A
		call	p04sub_712A
		jr	nc, p04loc_6C30
		jr	p04loc_6C33
; ---------------------------------------------------------------------------

p04loc_6C98:				; CODE XREF: Regraph+49Cj
		ld	hl, 1

p04loc_6C9B:				; CODE XREF: Regraph+544j
		ld	(unk_980E), hl
		set	5, (iy+3)

p04loc_6CA2:				; CODE XREF: Regraph+526j Regraph+590j
		call	p04sub_70A9
		jr	nz, p04loc_6CD5
		call	p04sub_721C
		jr	c, p04loc_6CB7
		call	OP1Set1
		call	p04sub_755F
		call	nz, p04sub_75B3
		jr	p04loc_6CA2
; ---------------------------------------------------------------------------

p04loc_6CB7:				; CODE XREF: Regraph+51Bj
		ld	de, (EQS)
		ld	hl, 12h
		add	hl, de
		call	Page0Call_35D3
		ld	(FPS), hl
		call	p04sub_755F
		call	nz, GrBufCpy
		res	6, (iy+18h)
		ld	hl, (unk_980E)
		inc	hl
		jr	p04loc_6C9B
; ---------------------------------------------------------------------------

p04loc_6CD5:				; CODE XREF: Regraph+516j
		ld	hl, para6LineType
		call	p04sub_6FA7
		ld	a, (curGY2)
		cp	1
		jr	nz, p04loc_6CE8
		call	p04sub_755A
		call	nz, p04sub_7289

p04loc_6CE8:				; CODE XREF: Regraph+551j
		call	p04sub_75A9
		call	p04sub_70DF
		call	p04sub_755A
		jr	z, p04loc_6CF6
		call	PUSHMCPLXO1

p04loc_6CF6:				; CODE XREF: Regraph+562j
		ld	a, (curGY2)
		dec	a
		add	a, a
		ld	de, OP3
		call	p04sub_7168
		push	de
		ld	de, OP4
		call	mov9B2
		pop	de
		call	MovFrOP1
		inc	hl
		inc	hl
		call	mov9B2
		set	5, (iy+14h)
		call	PLOTPT
		res	5, (iy+14h)
		call	p04sub_7087
		jp	p04loc_6CA2
; END OF FUNCTION CHUNK	FOR Regraph

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


p04sub_6D22:				; CODE XREF: Regraph+5B5p Regraph+5F7p ...
		res	5, (iy+8)
		res	6, (iy+8)
		ret
; End of function p04sub_6D22

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR Regraph

p04loc_6D2B:				; CODE XREF: Regraph+6FAj
		call	OP1Set1
		call	Page0Call_39D5
		ld	hl, Xmin
		rst	20h
		call	p04sub_72B6
		set	5, (iy+3)

p04loc_6D3C:				; CODE XREF: Regraph+638j
		call	p04sub_7087
		ld	a, 1
		ld	d, 0

p04loc_6D43:				; CODE XREF: Regraph+61Fj
		ld	b, a
		call	p04sub_6D22
		ld	a, (unk_91CE)
		and	b
		ld	a, b
		jr	z, p04loc_6DAB
		inc	d
		push	de
		push	af
		call	Page0Call_38F1
		call	p04sub_715C
		call	p04sub_756C
		jr	z, p04loc_6D61
		call	Page0Call_35D9
		jr	p04loc_6D67
; ---------------------------------------------------------------------------

p04loc_6D61:				; CODE XREF: Regraph+5CBj
		call	p04sub_755A
		call	nz, PushRealO1

p04loc_6D67:				; CODE XREF: Regraph+5D0j
		pop	af
		push	af
		cp	4
		jr	nz, p04loc_6D6E
		dec	a

p04loc_6D6E:				; CODE XREF: Regraph+5DCj
		ld	b, a
		ld	hl, 89F8h
		call	ShLAcc
		sla	a
		or	(hl)
		ld	(hl), a
		ld	a, b
		call	Page0Call_39DB
		ld	hl, p04loc_6DEC
		call	pushErrorHandleR
		call	Page0Call_337B
		call	p04sub_6D22
		call	popErrorHandleR
		call	INITNSEQ
		call	p04sub_756C
		jr	z, p04loc_6D99
		call	p04sub_7571
		jr	p04loc_6D9F
; ---------------------------------------------------------------------------

p04loc_6D99:				; CODE XREF: Regraph+603j
		call	p04sub_755A
		call	nz, PushRealO1

p04loc_6D9F:				; CODE XREF: Regraph+608j
		pop	bc
		pop	af
		push	af
		push	bc
		call	p04sub_756C
		call	z, p04sub_6F5D
		pop	af
		pop	de

p04loc_6DAB:				; CODE XREF: Regraph+5BDj
		add	a, a
		cp	8
		jr	nz, p04loc_6D43
		res	5, (iy+3)
		ld	a, (curInc)
		inc	a
		ld	hl, pixWide_m_1
		cp	(hl)
		jr	nc, p04loc_6DCA
		ld	(curInc), a
		ld	hl, (inputDat)
		call	Xitof
		jp	p04loc_6D3C
; ---------------------------------------------------------------------------

p04loc_6DCA:				; CODE XREF: Regraph+62Dj
		call	p04sub_756C
		jr	nz, p04loc_6DE9
		bit	5, (iy+4)
		jr	nz, p04loc_6DE9
		ld	a, 0Bh
		call	Page0Call_3633
		call	OP1ToOP3
		call	OP1ToOP4
		ld	a, 0Ah
		call	Page0Call_3633
		rst	8
		call	Page0Call_356D

p04loc_6DE9:				; CODE XREF: Regraph+63Ej Regraph+644j
		jp	p04loc_6962

p04loc_6DEC:
		pop	af
		call	p04sub_6D22
		jp	JErrorNo

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


p04sub_6DF3:				; CODE XREF: Regraph+313p Regraph+480p
		ld	(OP1), hl
		ld	hl, p04loc_6E35
		call	pushErrorHandleR
		ld	hl, (OP1)
		push	hl
		call	Mov9ToOP2
		rst	20h
		push	hl
		call	FPSub
		pop	hl
		call	Mov9ToOP2
		ld	hl, (unk_8484)
		push	hl
		ld	a, (OP1)
		and	80h ; '�'
		ld	b, a
		ld	a, (OP2)
		and	80h ; '�'
		xor	b
		jr	nz, p04loc_6E35
		call	fpdiv
		call	int
		ld	hl, p04loc_7121
		call	Mov9OP2Cp
		jr	nc, p04loc_6E35
		pop	de
		pop	hl
		call	CKVALDELTA
		call	popErrorHandleR
		ret
; ---------------------------------------------------------------------------

p04loc_6E35:				; CODE XREF: p04sub_6DF3+29j p04sub_6DF3+37j ...
		jp	Page0Call_2509
; End of function p04sub_6DF3

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR Regraph

p04loc_6E38:				; CODE XREF: Regraph+47Aj
		ld	hl, nMax
		rst	20h
		ld	hl, nMin
		call	Mov9OP2Cp
		jr	c, p04loc_6E35
		call	p04sub_72C4
		call	FPOPCPLX
		call	p04sub_756C
		jr	z, p04loc_6E58
		ld	a, 0FFh
		ld	(OP1), a
		rst	18h
		rst	18h
		rst	18h
		rst	18h

p04loc_6E58:				; CODE XREF: Regraph+6BEj
		call	Page04_38E8
		jr	z, p04loc_6E82
		ld	a, 3
		bit	2, (iy+0Fh)
		jr	nz, p04loc_6E73
		add	a, a
		bit	3, (iy+0Fh)
		jr	nz, p04loc_6E73
		dec	a
		bit	4, (iy+0Fh)
		jr	z, p04loc_6E7E

p04loc_6E73:				; CODE XREF: Regraph+6D4j Regraph+6DBj
		ld	hl, 91CEh
		ld	b, a
		and	(hl)
		cp	b
		jp	nz, ErrInvalid
		jr	p04loc_6E85
; ---------------------------------------------------------------------------

p04loc_6E7E:				; CODE XREF: Regraph+6E2j
		ld	a, (OP2)
		or	a

p04loc_6E82:				; CODE XREF: Regraph+6CCj
		jp	z, p04loc_6962

p04loc_6E85:				; CODE XREF: Regraph+6EDj
		bit	0, (iy+0Fh)
		jp	nz, p04loc_6D2B
		call	p04sub_501E
		call	Page0Call_3AB9
		set	5, (iy+3)

p04loc_6E96:				; CODE XREF: Regraph+79Aj
		call	p04sub_7087
		ld	a, 1
		ld	d, 0

p04loc_6E9D:				; CODE XREF: Regraph+782j
		ld	b, a
		call	p04sub_56B3
		jr	nz, p04loc_6EAA
		ld	a, (unk_91CE)
		and	b
		ld	a, b
		jr	z, p04loc_6F07

p04loc_6EAA:				; CODE XREF: Regraph+712j
		inc	d
		push	de
		push	af
		call	RCL_SEQ_X
		call	CkOP1Real
		cp	0Eh
		jr	nz, p04loc_6EBC
		ld	hl, OP1
		set	5, (hl)

p04loc_6EBC:				; CODE XREF: Regraph+726j
		call	p04sub_715C
		call	p04sub_756C
		jr	z, p04loc_6EC9
		call	Page0Call_35D9
		jr	p04loc_6ECF
; ---------------------------------------------------------------------------

p04loc_6EC9:				; CODE XREF: Regraph+733j
		call	p04sub_755A
		call	nz, PushRealO1

p04loc_6ECF:				; CODE XREF: Regraph+738j
		pop	bc
		push	bc
		ld	c, b
		call	RCLSEQ2
		call	CkOP1Real
		cp	0Eh
		jr	nz, p04loc_6EE1
		ld	hl, OP1
		set	5, (hl)

p04loc_6EE1:				; CODE XREF: Regraph+74Bj
		ld	a, b
		ld	hl, polar6LineType
		call	p04sub_6FAA
		call	INITNSEQ
		call	p04sub_756C
		jr	z, p04loc_6EF5
		call	p04sub_7571
		jr	p04loc_6EFB
; ---------------------------------------------------------------------------

p04loc_6EF5:				; CODE XREF: Regraph+75Fj
		call	p04sub_755A
		call	nz, PushRealO1

p04loc_6EFB:				; CODE XREF: Regraph+764j
		pop	bc
		pop	af
		push	af
		push	bc
		call	p04sub_756C
		call	z, p04sub_6F5D
		pop	af
		pop	de

p04loc_6F07:				; CODE XREF: Regraph+719j
		ld	b, a
		call	p04sub_56B3
		jr	nz, p04loc_6F13
		ld	a, b
		add	a, a
		cp	8
		jr	nz, p04loc_6E9D

p04loc_6F13:				; CODE XREF: Regraph+77Cj
		res	5, (iy+3)
		call	p04sub_6F32
		jp	c, p04loc_6962
		ld	hl, p04loc_6F2C
		call	pushErrorHandleR
		call	Page0Call_3ABF
		call	popErrorHandleR
		jp	p04loc_6E96

p04loc_6F2C:
		call	p04sub_7087
		jp	JErrorNo

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


p04sub_6F32:				; CODE XREF: ForceGraphKeypress+F85p
		; Regraph+788p
		call	Page0Call_39F3
		call	Plus1
		call	OP1ToOP4
		call	Page0Call_39F3
		ld	hl, PlotStep
		call	page0_BEC
		call	OP1ToOP3
		rst	8
		ld	hl, nMax
		rst	20h
		call	cpop1op2
		ret	c
		call	page0_1867
		call	OP4ToOP1
		call	Page0Call_39D5
		call	OP3ToOP1
		ret
; End of function p04sub_6F32


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


p04sub_6F5D:				; CODE XREF: Regraph+617p Regraph+773p
		push	af
		call	p04sub_56B3
		ld	a, 2
		jr	nz, p04loc_6F76
		ld	a, b
		cp	4
		jr	nz, p04loc_6F6B
		dec	a

p04loc_6F6B:				; CODE XREF: p04sub_6F5D+Bj
		ld	hl, (EQS)
		call	isInSet
		pop	de
		ret	z
		push	de
		ld	a, d
		add	a, a

p04loc_6F76:				; CODE XREF: p04sub_6F5D+6j
		pop	de
		ld	de, OP3
		call	p04sub_716A
		push	de
		ld	de, OP4
		call	mov9B2
		rst	8
		ld	hl, (XOutDat)
		rst	20h
		pop	de
		call	MovFrOP1
		inc	hl
		inc	hl
		call	mov9B2
		bit	0, (iy+0Fh)
		jr	nz, p04loc_6F9C
		set	5, (iy+14h)

p04loc_6F9C:				; CODE XREF: p04sub_6F5D+39j
		call	PLOTPT
		res	5, (iy+14h)
		ret
; End of function p04sub_6F5D


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


NEDXT_Y_STYLE:				; CODE XREF: p04sub_58BE+19Ap
		; Regraph+17Ap	...
		ld	hl, 9775h
; End of function NEDXT_Y_STYLE


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


p04sub_6FA7:				; CODE XREF: Regraph+34Dp Regraph+404p ...
		ld	a, (curGY2+1)
; End of function p04sub_6FA7


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


p04sub_6FAA:				; CODE XREF: Regraph+756p
		ld	e, a
		ld	d, 0
		add	hl, de
		ld	a, (hl)
		ld	(unk_9775), a
		cp	2
		ret	c
		cp	4
		ret	nc
		ld	hl, 9668h
		inc	(hl)
		ld	a, (hl)
		cp	4
		jr	c, p04loc_6FC3
		ld	(hl), 0

p04loc_6FC3:				; CODE XREF: p04sub_6FAA+15j
		inc	hl
		ld	(hl), 1
		inc	hl
		ld	(hl), 1
		inc	hl
		ld	(hl), 1
		ret
; End of function p04sub_6FAA


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


p04sub_6FCD:				; CODE XREF: Regraph+1A9p
		ld	a, 5
		call	p04sub_7564
		ret	nz
		ld	a, (unk_9775)
		cp	2
		ret	c
		cp	4
		ret	nc
		ld	b, a
		ld	a, (unk_9669)
		or	a
		jr	z, p04loc_6FE6
		dec	a
		jr	p04loc_6FE8
; ---------------------------------------------------------------------------

p04loc_6FE6:				; CODE XREF: p04sub_6FCD+14j
		ld	a, 1

p04loc_6FE8:				; CODE XREF: p04sub_6FCD+17j
		ld	(unk_9669), a
		ld	a, (unk_9668)
		cp	2
		ret	c
		jr	z, p04loc_7007
		ld	a, b
		cp	2
		ld	a, (unk_966B)
		jr	nz, p04loc_7002
		call	p04sub_7018

p04loc_6FFE:				; CODE XREF: p04sub_6FCD+38j
		ld	(unk_966B), a
		ret
; ---------------------------------------------------------------------------

p04loc_7002:				; CODE XREF: p04sub_6FCD+2Cj
		call	p04sub_701F
		jr	p04loc_6FFE
; ---------------------------------------------------------------------------

p04loc_7007:				; CODE XREF: p04sub_6FCD+24j
		ld	a, b
		cp	2
		ld	a, (unk_966A)
		jr	nz, p04loc_7013

p04loc_700F:				; CODE XREF: p04sub_6FCD+49j
		ld	(unk_966A), a
		ret
; ---------------------------------------------------------------------------

p04loc_7013:				; CODE XREF: p04sub_6FCD+40j
		call	p04sub_7018
		jr	p04loc_700F
; End of function p04sub_6FCD


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


p04sub_7018:				; CODE XREF: p04sub_6FCD+2Ep
		; p04sub_6FCD:p04loc_7013p
		inc	a
		cp	4
		ret	c
		ld	a, 1
		ret
; End of function p04sub_7018


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


p04sub_701F:				; CODE XREF: p04sub_6FCD:p04loc_7002p
		cp	2
		ld	a, 1
		ret	z
		ld	a, 3
		ret	c
		ld	a, 2
		ret
; End of function p04sub_701F


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


Page04_38E8:				; CODE XREF: p04sub_51B5+1p
		; Regraph:p04loc_6E58p
		xor	a
		ld	(unk_91CE), a
		ld	(OP2), a
		inc	a
		call	p04sub_703C
		ld	a, 2
		call	p04sub_703C
		ld	a, 4
; End of function Page04_38E8


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


p04sub_703C:				; CODE XREF: Page04_38E8+8p
		; Page04_38E8+Dp
		push	af
		cp	4
		jr	nz, p04loc_7042
		dec	a

p04loc_7042:				; CODE XREF: p04sub_703C+3j
		call	p04sub_707E
		pop	bc
		push	af
		jr	z, p04loc_7054
		ex	de, hl
		bit	5, (hl)
		jr	z, p04loc_7054
		ld	hl, OP2
		ld	a, (hl)
		or	b
		ld	(hl), a

p04loc_7054:				; CODE XREF: p04sub_703C+Bj p04sub_703C+10j
		ld	hl, 91CEh
		pop	af
		ld	a, (hl)
		jr	z, p04loc_705D
		or	b
		ld	(hl), a

p04loc_705D:				; CODE XREF: p04sub_703C+1Dj
		or	a
		push	af
		call	page0_19D
		jr	z, p04loc_707C
		bit	0, (iy+0Fh)
		jr	z, p04loc_707C
		call	page0_172A
		jr	nz, p04loc_7075
		bit	0, (iy+2)
		jr	z, p04loc_707C

p04loc_7075:				; CODE XREF: p04sub_703C+31j
		ld	a, (OP2)
		ld	(hl), a
		pop	bc
		or	a
		push	af

p04loc_707C:				; CODE XREF: p04sub_703C+26j p04sub_703C+2Cj ...
		pop	af
		ret
; End of function p04sub_703C


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


p04sub_707E:				; CODE XREF: p04sub_703C:p04loc_7042p
		call	Page0Call_39DB
		rst	10h
		ex	de, hl
		ld	a, (hl)
		inc	hl
		or	(hl)
		ret
; End of function p04sub_707E


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


p04sub_7087:				; CODE XREF: Regraph+11Ap Regraph+120p ...
		call	page0_189
		jr	z, p04loc_7096
		call	p04sub_756C
		jp	nz, ErrBreak

p04loc_7092:				; CODE XREF: p04sub_7087+1Fj
		pop	hl
		jp	p04loc_6977
; ---------------------------------------------------------------------------

p04loc_7096:				; CODE XREF: p04sub_7087+3j
		call	p04sub_756C
		ret	nz
		call	GetCSC
		cp	9
		ret	nz
		call	Page0Call_32F1
		call	page0_189
		jr	nz, p04loc_7092
		ret
; End of function p04sub_7087


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


p04sub_70A9:				; CODE XREF: Regraph:p04loc_6A10p
		; Regraph:p04loc_6B68p ...

; FUNCTION CHUNK AT 70CB SIZE 00000004 BYTES

		ld	hl, 0
		ld	(unk_9810), hl
		call	p04sub_720D
		ret	nz
		ld	a, (curGY2)
		cp	1
		jr	z, p04loc_70CB
		xor	a
		ld	(curGY2), a
		res	5, (iy+3)
; End of function p04sub_70A9


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


Page04_3396:				; CODE XREF: p04sub_58BE+1B5p
		; Regraph+1B5p	...
		pop	ix
		pop	hl
		push	hl
		ld	(pTempCnt), hl
		jp	(ix)
; End of function Page04_3396

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p04sub_70A9

p04loc_70CB:				; CODE XREF: p04sub_70A9+Fj p04sub_70CF+3j
		pop	hl
		jp	p04loc_6962
; END OF FUNCTION CHUNK	FOR p04sub_70A9

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


p04sub_70CF:				; CODE XREF: Regraph:p04loc_6AC0p
		; Regraph:p04loc_6C30p
		call	p04sub_7211
		jr	z, p04loc_70CB
; End of function p04sub_70CF


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


p04sub_70D4:				; CODE XREF: Regraph+166p
		ld	hl, 0
		ld	(unk_9810), hl
		inc	hl
		ld	(unk_980E), hl
		ret
; End of function p04sub_70D4


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


p04sub_70DF:				; CODE XREF: Regraph+4BEp Regraph+55Cp
		call	p04sub_7146
		ld	hl, (inputDat)
		call	Mov9ToOP2
		call	page0_18E
		jr	z, p04loc_7114
		ld	hl, p04loc_7114
		call	pushErrorHandleR
		call	Page0Call_3ACB
		call	CkValidNum
		ld	de, (XOutDat)
		call	MovFrOP1
		call	OP1ExOP2
		call	CkValidNum
		ld	de, (YOutDat)
		call	MovFrOP1
		call	OP1ExOP2
		call	popErrorHandleR
		ret
; ---------------------------------------------------------------------------

p04loc_7114:				; CODE XREF: p04sub_70DF+Cj
		res	0, (iy+7)
		ld	a, 20h ; ' '
		ld	(OP1), a
		ld	(OP2), a
		ret
; End of function p04sub_70DF

p04loc_7121:
		.db    0
		.db  84h	; �
		.db  65h	; e
		.db  53h	; S
		.db  60h	; `
		.db    0
		.db    0
		.db    0
		.db    0

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


p04sub_712A:				; CODE XREF: p04sub_58BE+1E6p
		; Regraph:p04loc_695Bp ...
		ld	hl, (unk_9810)
		ld	a, h
		or	l
		ret	z
		ld	de, (unk_980E)
		sbc	hl, de
		ret	z
		inc	de
		ld	(unk_980E), de
		scf
		ret
; End of function p04sub_712A


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


p04sub_713E:				; CODE XREF: Regraph+28Bp Regraph+2EBp ...
		ld	hl, (EQS)
		ld	de, 24h	; '$'
		add	hl, de
		ret
; End of function p04sub_713E


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


p04sub_7146:				; CODE XREF: p04sub_70DFp
		ld	hl, (inputSym)
		dec	hl
		dec	hl
		dec	hl
		ld	e, (hl)
		dec	hl
		ld	d, (hl)
		jr	p04loc_7155
; End of function p04sub_7146


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


INITNSEQ:				; CODE XREF: p04sub_58BE+181p
		; Regraph+185p	...
		ld	de, (YOutDat)

p04loc_7155:				; CODE XREF: p04sub_7146+9j p04sub_715C+4j
		call	page0_18E
		jp	nz, MovFrOP1
		ret
; End of function INITNSEQ


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


p04sub_715C:				; CODE XREF: Regraph+359p Regraph+41Cp ...
		ld	de, (XOutDat)
		jr	p04loc_7155
; End of function p04sub_715C


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


p04sub_7162:				; CODE XREF: Regraph+2E5p
		ld	a, (curGY2)
		ld	de, OP4
; End of function p04sub_7162


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


p04sub_7168:				; CODE XREF: Regraph+43Dp Regraph+56Fp
		add	a, 4
; End of function p04sub_7168


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


p04sub_716A:				; CODE XREF: p04sub_6F5D+1Dp
		ld	l, a
		ld	h, 0
		call	HLTimes9
		ld	bc, (EQS)
		add	hl, bc
		push	hl
		call	mov9B2
		pop	de
		ret
; End of function p04sub_716A


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


YRES:					; CODE XREF: Regraph+1A2p DrawCmd+1Dp
		rst	8
		ld	hl, (inputDat)
		rst	20h
; End of function YRES


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


p04sub_7180:				; CODE XREF: Regraph+4E7p
		call	CpyTo3FPS1
		inc	de
		inc	de
		call	mov9B2
		call	CpyO1ToFPS1
		call	CpyO2ToFPST
; End of function p04sub_7180


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


PLOTPT:					; CODE XREF: p04sub_58BE+1A5p
		; Regraph+2FDp	...

; FUNCTION CHUNK AT 438A SIZE 00000002 BYTES
; FUNCTION CHUNK AT 71E4 SIZE 0000000B BYTES

		call	page0_18E
		ret	z
		ld	a, 4
		call	p04sub_7564
		ret	nz
		bit	5, (iy+14h)
		jr	z, p04loc_71E4
		ld	a, (unk_9775)
		cp	4
		jr	c, p04loc_71EB
		cp	6
		jp	nc, DarkPnt
		call	PUSHMCPLXO1
		call	PUSHMCPLXO3
		call	OP3ToOP1
		call	OP4ToOP2
		call	p04sub_71EF
		call	z, p04sub_6600
		call	CpyTo1FPS3
		call	CpyTo2FPS2
		call	p04sub_71DD
		call	PopRealO4
		call	PopRealO3
		call	POPMCPLXO1
		ld	a, (unk_9775)
		cp	5
		ret	z
		call	PUSHMCPLXO1
		call	Page0Call_356D
		call	POPMCPLXO1
; End of function PLOTPT


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


p04sub_71DD:				; CODE XREF: PLOTPT+34p
		call	p04sub_71EF
		call	z, p04sub_6611
		ret
; End of function p04sub_71DD

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR PLOTPT

p04loc_71E4:				; CODE XREF: PLOTPT+Ej
		bit	0, (iy+4)
		jp	nz, DarkPnt

p04loc_71EB:				; CODE XREF: PLOTPT+15j
		call	Page0Call_356D
		ret
; END OF FUNCTION CHUNK	FOR PLOTPT

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


p04sub_71EF:				; CODE XREF: PLOTPT+28p p04sub_71DDp
		call	PUSHMCPLXO1
		ld	de, 0FFF7h
		call	XYRNDBOTH
		jr	nz, p04loc_7205
		call	CheckTOP
		and	0Fh
		jr	nz, p04loc_7205
		call	WTOV
		xor	a

p04loc_7205:				; CODE XREF: p04sub_71EF+9j p04sub_71EF+10j
		push	af
		push	bc
		call	FPOPCPLX
		pop	bc
		pop	af
		ret
; End of function p04sub_71EF


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


p04sub_720D:				; CODE XREF: p04sub_70A9+6p
		ld	hl, curGY2
		inc	(hl)
; End of function p04sub_720D


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


p04sub_7211:				; CODE XREF: p04sub_58BE:p04loc_59EBp
		; Regraph:p04loc_68F0p ...
		ld	a, (curGY2+1)
		call	NEXTEQ
		ld	(curGY2+1), a
		or	a
		ret
; End of function p04sub_7211


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


p04sub_721C:				; CODE XREF: Regraph+4FDp Regraph+518p
		ld	bc, ThetaMin
		jr	p04loc_7224
; End of function p04sub_721C


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


p04sub_7221:				; CODE XREF: Regraph+3C1p Regraph+3DEp
		ld	bc, TminPar

p04loc_7224:				; CODE XREF: p04sub_721C+3j
		ld	hl, (curInc)
		ld	de, 1
		add	hl, de
		ret	c
		ld	(curInc), hl

NEWINDEP:				; CODE XREF: p04sub_50FE+34p
		; ForceGraphKeypress:p04loc_5502p
		ld	hl, 9
		add	hl, bc
		push	hl
		ld	de, 9
		add	hl, de
		ld	a, (hl)
		push	af
		ex	de, hl
		ld	hl, OP4
		call	p04sub_4418
		call	Page0Call_3E37
		pop	af
		pop	hl
		call	Mov9ToOP2
		rla
		jr	nc, p04loc_7278
		call	cpop1op2
		jr	nz, p04loc_7268
		call	OP4ToOP1
		call	cpop1op2

p04loc_7257:				; CODE XREF: p04sub_7221+66j
		jr	nc, p04loc_7268
		call	CkOP2FP0
		call	z, OP2Set0
		call	OP2ToOP4
		ld	hl, OP4
		res	6, (hl)
		xor	a

p04loc_7268:				; CODE XREF: p04sub_7221+2Ej
		; p04sub_7221:p04loc_7257j ...
		ret	c
		call	OP4ToOP1
		call	CkValidNum
		ld	de, (inputDat)
		call	MovFrOP1
		or	a
		ret
; ---------------------------------------------------------------------------

p04loc_7278:				; CODE XREF: p04sub_7221+29j
		call	cpop1op2
		jr	z, p04loc_7280
		ccf
		jr	p04loc_7268
; ---------------------------------------------------------------------------

p04loc_7280:				; CODE XREF: p04sub_7221+5Aj
		call	OP4ToOP1
		call	cpop1op2
		ccf
		jr	p04loc_7257
; End of function p04sub_7221


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


p04sub_7289:				; CODE XREF: p04sub_465B+A9Ep
		; Regraph:p04loc_6C33p ...
		ld	hl, 0
		ld	(curInc), hl
		ld	hl, ThetaMin
		rst	20h
		call	Page0Call_3333
		jr	p04loc_72BD
; End of function p04sub_7289


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


p04sub_7298:				; CODE XREF: p04sub_465B+A98p
		; Regraph:p04loc_6AC3p ...
		ld	hl, TminPar
		rst	20h
		ld	hl, 0
		ld	(curInc), hl
		call	Page0Call_3399
		jr	p04loc_72BD
; End of function p04sub_7298


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


p04sub_72A7:				; CODE XREF: Regraph:p04loc_68F8p
		; Regraph+2D3p
		call	p04sub_713E
		push	hl
		ld	hl, Xmin
		rst	20h
		pop	de
		call	p04sub_756C
		call	z, MovFrOP1
; End of function p04sub_72A7


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


p04sub_72B6:				; CODE XREF: Regraph+5A6p
		xor	a
		ld	(curInc), a
		call	Page0Call_3321

p04loc_72BD:				; CODE XREF: p04sub_7289+Dj p04sub_7298+Dj
		ld	hl, (chkDelPtr1)
		ld	(inputDat), hl
		ret
; End of function p04sub_72B6


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


p04sub_72C4:				; CODE XREF: p04sub_58BE+128p
		; Regraph+316p	...
		call	OP1Set0
		call	Page0Call_3321
		ld	hl, (chkDelPtr3)
		ld	(XOutSym), hl
		ld	(hl), 0
		ld	hl, (chkDelPtr1)
		ld	(XOutDat), hl
; End of function p04sub_72C4


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


Page04_330C:				; CODE XREF: Regraph+13Fp
		; DRAWCMD_INIT+Ap ...
		call	OP1Set0
		call	Page0Call_3327
		ld	hl, (chkDelPtr3)
		ld	(YOutSym), hl
		ld	(hl), 0
		ld	hl, (chkDelPtr1)
		ld	(YOutDat), hl
		ret
; End of function Page04_330C


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


p04sub_72ED:				; CODE XREF: Regraph+486p
		call	Page0Call_332D
		ld	hl, (chkDelPtr3)
		ld	(inputSym), hl
		ld	(hl), 0
		ret
; End of function p04sub_72ED


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


p04sub_72F9:				; CODE XREF: Regraph+C3p Regraph+CBp ...
		ld	de, 9

p04loc_72FC:				; CODE XREF: p04sub_72F9+6j
		res	6, (hl)
		add	hl, de
		djnz	p04loc_72FC
		ret
; End of function p04sub_72F9


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


Axes:					; CODE XREF: p04sub_58BE+10Ap Regraph+AFp
		ld	a, (unk_8A2C)
		push	af
		bit	1, (iy+3Ch)
		jr	z, p04loc_7310
		set	2, (iy+3Ch)

p04loc_7310:				; CODE XREF: Axes+8j
		ld	de, deltaX
		ld	hl, Xscl
		call	p04sub_753F
		ld	(OP5), a
		ld	de, deltaY
		ld	hl, Yscl
		call	p04sub_753F
		ld	(unk_84A5), a
		bit	5, (iy+4)
		jp	nz, p04loc_73DD
		call	OP4Set0
		ld	de, OP4
		ld	l, e
		ld	h, d
		call	CheckXY
		ld	l, a
		push	hl
		ld	a, 0FFh
		call	p04sub_755A
		jr	z, p04loc_7362
		ld	a, (unk_8E69)
		call	p04sub_75A2
		jr	nc, p04loc_7362
		bit	4, (iy+3)
		jr	nz, p04loc_7359
		sub	8
		jr	nc, p04loc_7377
		set	3, l
		jr	p04loc_7362
; ---------------------------------------------------------------------------

p04loc_7359:				; CODE XREF: Axes+4Dj
		add	a, 8
		call	p04sub_75A2
		jr	c, p04loc_7377
		set	2, l

p04loc_7362:				; CODE XREF: Axes+3Fj Axes+47j ...
		ld	(unk_8E69), a
		xor	a
		bit	3, l
		jr	nz, p04loc_7395
		ld	a, (pixWide_m_2)
		bit	2, l
		jr	nz, p04loc_7395
		ld	de, OP4
		call	XftoI

p04loc_7377:				; CODE XREF: Axes+51j Axes+5Cj
		ld	(curGY2+1), a
		ld	(unk_8E69), a
		call	p04sub_7473
		call	c, p04sub_4017
		ld	b, a
		ld	a, (pixWide_m_2)
		cp	b
		ld	a, b
		jr	nz, p04loc_7394
		dec	a
		ld	(curGY2+1), a
		call	p04sub_74A0
		jr	p04loc_7398
; ---------------------------------------------------------------------------

p04loc_7394:				; CODE XREF: Axes+87j
		inc	a

p04loc_7395:				; CODE XREF: Axes+66j Axes+6Dj
		ld	(curGY2+1), a

p04loc_7398:				; CODE XREF: Axes+90j
		pop	hl
		ld	a, 1
		bit	1, l
		jr	nz, p04loc_73D1
		ld	a, (lcdTallP)
		dec	a
		bit	0, l
		jr	nz, p04loc_73D1
		call	OP4Set0
		ld	de, OP4
		call	YftoI
		ld	(curGY2), a
		ld	d, a
		ld	a, (lcdTallP)
		dec	a
		cp	d
		ld	a, d
		jr	nz, p04loc_73BF
		dec	a
		jr	p04loc_73C0
; ---------------------------------------------------------------------------

p04loc_73BF:				; CODE XREF: Axes+B8j
		inc	a

p04loc_73C0:				; CODE XREF: Axes+BBj
		ld	de, (curGY2)
		push	af
		ld	a, (pixWide_m_2)
		ld	c, a
		ld	b, 0
		pop	af
		ld	d, c
		ld	c, e
		call	DarkLine

p04loc_73D1:				; CODE XREF: Axes+9Bj Axes+A3j
		ld	(curGY2), a
		ld	a, (curGY2+1)
		call	p04sub_7478
		call	c, p04sub_74A0

p04loc_73DD:				; CODE XREF: Axes+2Aj
		ld	a, (OP5)
		or	a
		push	af
		jr	nz, p04loc_7400
		ld	b, a
		ld	a, (pixWide_m_2)
		ld	c, a
		call	p04sub_755A
		jr	z, p04loc_73FA
		sub	9
		ld	b, a
		bit	4, (iy+3)
		jr	z, p04loc_73FA
		ld	bc, 9

p04loc_73FA:				; CODE XREF: Axes+EAj Axes+F3j
		pop	af
		ld	a, c
		push	af
		ld	a, b
		jr	p04loc_7437
; ---------------------------------------------------------------------------

p04loc_7400:				; CODE XREF: Axes+E0j
		ld	bc, Xmin
		ld	de, Xmax
		ld	hl, Xscl
		call	p04sub_755A
		jr	z, p04loc_741C
		bit	4, (iy+3)
		jr	nz, p04loc_7419
		ld	bc, OP6
		jr	p04loc_741C
; ---------------------------------------------------------------------------

p04loc_7419:				; CODE XREF: Axes+110j
		ld	de, OP6

p04loc_741C:				; CODE XREF: Axes+10Aj	Axes+115j
		ld	(unk_84A7), de
		call	p04sub_74D7
		jr	c, p04loc_7467

p04loc_7425:				; CODE XREF: Axes+15Aj
		ld	de, (unk_84A7)
		ld	hl, Xscl
		call	p04sub_7514
		jr	c, p04loc_746A
		ld	de, OP1
		call	XftoI

p04loc_7437:				; CODE XREF: Axes+FCj Axes+163j
		call	page0_189
		jr	nz, p04loc_746A
		ld	(curGY2+1), a
		ld	bc, (curGY2)
		bit	5, (iy+4)
		call	z, PointOn
		ld	hl, (curInc)
		push	hl
		bit	2, (iy+4)
		call	nz, p04sub_74A0
		pop	hl
		inc	hl
		ld	(curInc), hl
		pop	af
		push	af
		jr	nz, p04loc_7425
		ld	bc, (curGY2)
		inc	b
		cp	b
		ld	a, b
		jr	nc, p04loc_7437

p04loc_7467:				; CODE XREF: Axes+121j
		pop	af
		jr	p04loc_746E
; ---------------------------------------------------------------------------

p04loc_746A:				; CODE XREF: Axes+12Dj	Axes+138j
		pop	af
		call	nz, FPOPREAL

p04loc_746E:				; CODE XREF: Axes+166j
		pop	af
		ld	(unk_8A2C), a
		ret
; End of function Axes


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


p04sub_7473:				; CODE XREF: Axes+7Bp
		call	p04sub_755A
		jr	nz, p04loc_748A
; End of function p04sub_7473


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


p04sub_7478:				; CODE XREF: Axes+D5p
		call	p04sub_755A
		jr	nz, p04loc_747F

p04loc_747D:				; CODE XREF: p04sub_7478+8j p04sub_7478+10j
		scf
		ret
; ---------------------------------------------------------------------------

p04loc_747F:				; CODE XREF: p04sub_7478+3j
		or	a
		jr	z, p04loc_747D
		push	hl
		ld	hl, pixWide_m_2
		cp	(hl)
		pop	hl
		jr	z, p04loc_747D

p04loc_748A:				; CODE XREF: p04sub_7473+3j
		bit	4, (iy+3)
		jr	z, p04loc_7493
		cp	0Ah
		ret
; ---------------------------------------------------------------------------

p04loc_7493:				; CODE XREF: p04sub_7478+16j
		push	hl
		push	af
		ld	a, (lcdTallP+1)
		sub	0Bh
		ld	l, a
		pop	af
		cp	l
		pop	hl
		ccf
		ret
; End of function p04sub_7478


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


p04sub_74A0:				; CODE XREF: Axes+8Dp Axes+D8p ...
		ld	a, (unk_84A5)
		or	a
		jp	z, p04sub_4017
		ld	bc, Ymin
		ld	de, Ymax
		ld	hl, Yscl
		call	p04sub_74D7
		ret	c

p04loc_74B4:				; CODE XREF: p04sub_74A0+35j
		ld	de, Ymax
		ld	hl, Yscl
		call	p04sub_7514
		jp	c, FPOPREAL
		ld	hl, (curInc)
		inc	hl
		ld	(curInc), hl
		ld	de, OP1
		call	YftoI
		ld	bc, (curGY2)
		ld	c, a
		call	PointOn
		jr	p04loc_74B4
; End of function p04sub_74A0


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


p04sub_74D7:				; CODE XREF: Axes+11Ep	p04sub_74A0+10p
		push	de
		push	bc
		call	Mov9ToOP2
		pop	hl
		rst	20h
		call	CkOP2FP0
		jr	z, p04loc_7511
		call	ClrOP2S
		call	OP2ToOP4
		call	fpdiv
		call	Page0Call_3E37
		call	Ceiling
		call	OP4ToOP2
		call	FPMult
		call	OP1ToOP4
		call	Page0Call_3E37
		rst	8
		pop	hl
		rst	20h
		call	cpop1op2
		ret	c
		call	OP4ToOP1
		rst	18h
		ld	hl, 0
		ld	(curInc), hl
		xor	a
		ret
; ---------------------------------------------------------------------------

p04loc_7511:				; CODE XREF: p04sub_74D7+Aj
		pop	af
		scf
		ret
; End of function p04sub_74D7


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


p04sub_7514:				; CODE XREF: Axes+12Ap	p04sub_74A0+1Ap
		push	de
		rst	20h
		call	ClrOP1S
		ld	hl, (curInc)
		call	Page0Call_3B55
		call	FPMult
		call	CpyTo2FPST
		rst	30h
		call	Page0Call_3E37
		call	OP1ToOP4
		rst	8
		pop	hl
		rst	20h
		call	cpop1op2
		ret	c
		jp	OP4ToOP1
; End of function p04sub_7514


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


Ceiling:				; CODE XREF: p04sub_74D7+18p
		call	InvOP1S
		call	BCALL_405D
		jp	InvOP1S
; End of function Ceiling


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


p04sub_753F:				; CODE XREF: Axes+14p Axes+20p
		push	de
		rst	20h
		call	ClrOP1S
		call	CkOP1FP0
		pop	hl
		jr	z, p04loc_7557
		call	Mov9ToOP2
		call	ClrOP2S
		call	cpop1op2
		jr	nc, p04loc_7557
		xor	a
		ret
; ---------------------------------------------------------------------------

p04loc_7557:				; CODE XREF: p04sub_753F+9j p04sub_753F+14j
		ld	a, 1
		ret
; End of function p04sub_753F


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


p04sub_755A:				; CODE XREF: Regraph:p04loc_6921p
		; Regraph+2D0p	...
		bit	5, (iy+3)
		ret
; End of function p04sub_755A


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


p04sub_755F:				; CODE XREF: Regraph+170p Regraph+1ACp ...
		bit	6, (iy+18h)
		ret
; End of function p04sub_755F


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


p04sub_7564:				; CODE XREF: Regraph+7p Regraph+85p ...
		bit	6, (iy+35h)
		call	nz, Page0Call_32F7
		ret
; End of function p04sub_7564


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


p04sub_756C:				; CODE XREF: Regraph+4Ep Regraph+79p ...
		bit	2, (iy+11h)
		ret
; End of function p04sub_756C


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


p04sub_7571:				; CODE XREF: Regraph+18Dp Regraph+380p ...
		call	page0_18E
		ret	z
		ld	hl, (FPS)
		ld	de, 0FFE5h
		add	hl, de
		ld	a, (hl)
		inc	a
		jr	nz, p04loc_7586
		call	CpyO1ToFPS3
		jp	CpyO1ToFPS2
; ---------------------------------------------------------------------------

p04loc_7586:				; CODE XREF: p04sub_7571+Dj
		call	OP1ToOP5
		call	CpyTo2FPS3
		call	cpop1op2
		jp	c, CpyO5ToFPS3
		call	OP5ToOP2
		call	CpyTo1FPS2
		call	cpop1op2
		ret	nc
		call	OP5ToOP1
		jp	CpyO1ToFPS2
; End of function p04sub_7571


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


p04sub_75A2:				; CODE XREF: ForceGraphKeypress+F01p
		; Axes+44p ...
		push	hl
		ld	hl, pixWide_m_1
		cp	(hl)
		pop	hl
		ret
; End of function p04sub_75A2


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


p04sub_75A9:				; CODE XREF: Regraph+182p Regraph+2D9p ...
		ld	hl, 0FFFFh
		ld	(unk_9C24), hl
		call	Page0Call_336F
		ret
; End of function p04sub_75A9


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


p04sub_75B3:				; CODE XREF: Regraph+1AFp Regraph+29Dp ...
		ld	hl, (unk_9C24)
		ld	de, 0FFF1h
		or	a
		sbc	hl, de
		ret	c
		ret	z
		ld	b, l

p04loc_75BF:				; CODE XREF: p04sub_75B3+Fj
		call	HandleLinkKeyActivity
		djnz	p04loc_75BF
		ret
; End of function p04sub_75B3


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


setPenX:				; CODE XREF: ForceGraphKeypress+52Ap
		; p04sub_7613p ...
		call	Bit_VertSplit
		jr	nz, p04sub_75EA

p04loc_75CA:				; CODE XREF: setPenY+3j
		sub	a

p04loc_75CB:				; CODE XREF: setPenY+7j seg001:7722p ...
		ld	(penCol), a
		ld	a, (winBtm)
		add	a, a
		add	a, a
		add	a, a
		sub	7

p04loc_75D6:				; CODE XREF: p04sub_75EB+Bj
		call	CheckSplitFlag
		jr	z, p04loc_75DD
		sub	21h ; '!'

p04loc_75DD:				; CODE XREF: setPenX+14j setPenT+9j ...
		ld	(penCol+1), a
		ret
; End of function setPenX


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


setPenY:				; CODE XREF: p04sub_7685:p04loc_7626p
		; p04sub_7651p ...
		call	Bit_VertSplit
		jr	nz, p04loc_75CA
		ld	a, 30h ; '0'
		jr	p04loc_75CB
; End of function setPenY


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


p04sub_75EA:				; CODE XREF: setPenX+3j setPenTp
		sub	a
; End of function p04sub_75EA


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


p04sub_75EB:				; CODE XREF: seg001:7611j p04sub_7767+Dp
		ld	(penCol), a
		ld	a, (winBtm)
		add	a, a
		add	a, a
		add	a, a
		sub	0Dh
		jr	p04loc_75D6
; End of function p04sub_75EB


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


setPenT:				; CODE XREF: seg001:7608p
		; LABCOOR:p04loc_761Ep ...
		call	p04sub_75EA
		call	Bit_VertSplit
		ret	z
		sub	6
		jr	p04loc_75DD
; End of function setPenT

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

Page04_32D6:
		call	Bit_VertSplit
		jr	z, p04loc_760F
		call	setPenT
		sub	6
		jr	p04loc_75DD
; ---------------------------------------------------------------------------

p04loc_760F:				; CODE XREF: seg001:7606j
		ld	a, 30h ; '0'
		jr	p04sub_75EB

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


p04sub_7613:				; CODE XREF: p04sub_7685p
		call	setPenX
		ld	h, 52h ; 'R'
		bit	6, (iy+3)
		jr	p04loc_768B
; End of function p04sub_7613

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR LABCOOR

p04loc_761E:				; CODE XREF: LABCOOR+C5j LABCOOR+2DC5j
		call	setPenT
		ld	h, 5Bh ; '['
		sub	a
		jr	p04loc_768B
; END OF FUNCTION CHUNK	FOR LABCOOR
; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR p04sub_7685

p04loc_7626:				; CODE XREF: p04sub_7685+3j
		call	setPenY
		ld	h, 5Bh ; '['
		sub	a
		jr	p04loc_768B
; END OF FUNCTION CHUNK	FOR p04sub_7685

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


p04sub_762E:				; CODE XREF: LABCOOR+13Fj LABCOOR+173j ...
		call	setPenT
		ld	h, 54h ; 'T'
		sub	a
		jr	p04loc_768B
; End of function p04sub_762E


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


p04sub_7636:				; CODE XREF: ForceGraphKeypress+507p
		call	Bit_VertSplit
		jr	nz, p04sub_7640
		call	setPenT
		jr	p04loc_7643
; End of function p04sub_7636


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


p04sub_7640:				; CODE XREF: p04sub_7636+3j PutXYp ...
		call	setPenX

p04loc_7643:				; CODE XREF: p04sub_7636+8j
		ld	h, 58h ; 'X'
		bit	6, (iy+3)
		jr	p04loc_768B
; End of function p04sub_7640

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR LABCOOR

p04loc_764B:				; CODE XREF: LABCOOR+16Dj
		call	p04sub_762E
; END OF FUNCTION CHUNK	FOR LABCOOR

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


PutXY:					; CODE XREF: LABCOOR+19j
		; LABCOOR:p04loc_497Ap ...
		call	p04sub_7640
; End of function PutXY


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


p04sub_7651:				; CODE XREF: LABCOOR+2DC2p
		call	setPenY
		ld	h, 59h ; 'Y'
		bit	7, (iy+3)
		jr	p04loc_768B
; End of function p04sub_7651

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR LABCOOR

p04loc_765C:				; CODE XREF: LABCOOR+15Bj
		call	p04sub_7661
		jr	PutXY
; END OF FUNCTION CHUNK	FOR LABCOOR

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


p04sub_7661:				; CODE XREF: LABCOOR+138p LABCOOR+161j ...
		call	setPenT
		set	1, (iy+5)
		call	Page04_3348
		ld	a, 1
		call	Page0Call_3D47
		ld	a, 3Dh ; '='
		call	Page0Call_3D47
		call	RECURNNAME
		jr	p04sub_76A2
; End of function p04sub_7661

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR LABCOOR

p04loc_767A:				; CODE XREF: LABCOOR+CFj
		call	p04sub_7640
		call	p04sub_7651
		jr	p04loc_761E
; ---------------------------------------------------------------------------

p04loc_7682:				; CODE XREF: LABCOOR+145j
		call	p04sub_762E
; END OF FUNCTION CHUNK	FOR LABCOOR

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


p04sub_7685:				; CODE XREF: LABCOOR+B9p LABCOOR+CCj ...

; FUNCTION CHUNK AT 7626 SIZE 00000008 BYTES

		call	p04sub_7613
		jr	p04loc_7626
; End of function p04sub_7685

; ---------------------------------------------------------------------------
		xor	a
; START	OF FUNCTION CHUNK FOR LABCOOR

p04loc_768B:				; CODE XREF: p04sub_7613+9j LABCOOR+2D69j ...
		push	af
		set	1, (iy+5)
		call	Page04_3348
		ld	a, h
		call	REALNAME
		call	Page0Call_3D47
		ld	a, 3Dh ; '='
		call	Page0Call_3D47
		pop	af
		jr	nz, p04loc_76A7
; END OF FUNCTION CHUNK	FOR LABCOOR

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


p04sub_76A2:				; CODE XREF: p04sub_7661+17j seg001:79EAp
		rst	10h
		ex	de, hl
; End of function p04sub_76A2


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


p04sub_76A4:				; CODE XREF: seg001:7711j p04sub_7737+1Bp
		call	p04sub_797A

p04loc_76A7:				; CODE XREF: LABCOOR+2DE5j
		res	1, (iy+5)
		ret
; End of function p04sub_76A4

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

Page04_350A:
		call	setPenX
		call	Page0Call_38F1
		ld	hl, (unk_8E65)
		ld	a, h
		or	h
		jr	z, p04loc_76CA

p04loc_76B9:				; CODE XREF: seg001:76CDj seg001:76D1j
		call	Page0Call_35A3
		ld	a, 5
		jr	z, p04loc_76D3
		call	Page0Call_359D
		ld	a, 1
		jr	z, p04loc_76D3
		jp	p04sub_7640
; ---------------------------------------------------------------------------

p04loc_76CA:				; CODE XREF: seg001:76B7j
		ld	a, l
		cp	2
		jr	c, p04loc_76B9
		cp	5
		jr	nc, p04loc_76B9

p04loc_76D3:				; CODE XREF: seg001:76BEj seg001:76C5j
		dec	a
		add	a, a
		ld	e, a
		ld	d, 0
		ld	hl, p04loc_7A16
		add	hl, de
		call	ldHLind
		ld	a, 5Dh ; ']'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45

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


p04sub_76E8:				; CODE XREF: seg001:79FFp
		set	1, (iy+5)
		call	p04sub_7A03
		ld	a, 3Dh ; '='
; End of function p04sub_76E8


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


p04sub_76F1:				; CODE XREF: seg001:79C7p
		call	Page0Call_3D47
		ld	a, (penCol)
		cp	16h
		ld	a, 5
		jr	z, p04loc_76FF
		ld	a, 6

p04loc_76FF:				; CODE XREF: p04sub_76F1+Aj
		call	Bit_VertSplit
		jr	nz, p04loc_7706
		ld	a, 9

p04loc_7706:				; CODE XREF: p04sub_76F1+11j
		call	DispOP1A
		res	1, (iy+5)
		ret
; End of function p04sub_76F1

; ---------------------------------------------------------------------------
		ld	hl, OP1
		jr	p04sub_76A4
; ---------------------------------------------------------------------------

Page04_32DC:
		call	p04sub_7737
		call	Bit_VertSplit
		jr	z, p04loc_7720
		call	setPenY
		jr	p04loc_772E
; ---------------------------------------------------------------------------

p04loc_7720:				; CODE XREF: seg001:7719j
		ld	a, 30h ; '0'
		call	p04loc_75CB
		set	7, (iy+14h)
		ld	a, 20h ; ' '
		call	Page0Call_3D47

p04loc_772E:				; CODE XREF: seg001:771Ej
		res	7, (iy+14h)
		ld	hl, 8B5Ah
		ld	a, 70h ; 'p'

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


p04sub_7737:				; CODE XREF: seg001:Page04_32DCp
		push	af
		rst	20h
		ld	d, 4
		call	Round
		pop	af
		set	7, (iy+14h)
		set	1, (iy+5)
		call	Page0Call_3D47
		ld	a, 3Dh ; '='
		call	Page0Call_3D47
		ld	hl, OP1
		call	p04sub_76A4
		res	7, (iy+14h)
		ret
; End of function p04sub_7737


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


p04sub_775A:				; CODE XREF: GRLABELS+10p
		set	6, (iy+1Dh)
		ld	de, 7800h
		call	p04sub_7767
		ld	de, 7901h
; End of function p04sub_775A


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


p04sub_7767:				; CODE XREF: p04sub_775A+7p
		ld	b, 1
		ld	a, (lcdTallP+1)
		sub	6
		push	de
		push	bc
		rrc	e
		jr	nz, p04loc_7796
		call	p04sub_75EB
		ld	a, (penCol+1)
		call	Bit_VertSplit
		jr	z, p04loc_7781
		sub	0Dh

p04loc_7781:				; CODE XREF: p04sub_7767+16j
		dec	a
		ld	(penCol+1), a

p04loc_7785:				; CODE XREF: p04sub_7767+3Dj
		set	1, (iy+5)
		call	Page04_3348
		pop	bc

p04loc_778D:				; CODE XREF: p04sub_7767+2Aj
		pop	af
		call	Page0Call_3D47
		djnz	p04loc_778D
		jp	p04loc_7875
; ---------------------------------------------------------------------------

p04loc_7796:				; CODE XREF: p04sub_7767+Bj
		ld	hl, 500h
		call	Bit_VertSplit
		jr	z, p04loc_77A1
		ld	hl, 600h

p04loc_77A1:				; CODE XREF: p04sub_7767+35j
		ld	(penCol), hl
		jr	p04loc_7785
; End of function p04sub_7767


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


p04sub_77A6:				; CODE XREF: PUTEQUNO+31p
		; PUTEQUNO:p04loc_784Ap
		ld	(penCol), hl
		ld	d, 5Eh ; '^'
		ld	a, (OP1M)
		ld	e, a
		call	Page0Call_3DAD
		ld	b, a
		inc	hl
		res	4, (iy+24h)
		call	Page0Call_3D59
		ld	hl, (curGY)
		push	hl
		rst	10h
		ex	de, hl
		ld	c, (hl)
		inc	hl
		ld	b, (hl)

p04loc_77C4:				; CODE XREF: TAN_EQU_DISP+23j
		ld	a, 3Dh ; '='
		call	Page0Call_3D47
		set	4, (iy+11h)
		call	Page0Call_34E9
		res	4, (iy+11h)
		pop	hl
		ld	(curGY), hl
		ret
; End of function p04sub_77A6


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


TAN_EQU_DISP:				; CODE XREF: ForceGraphKeypress+50Dp
		set	6, (iy+1Dh)
		res	3, (iy+11h)
		set	1, (iy+5)
		ld	a, 1
		call	p04loc_75CB
		ld	a, 79h ; 'y'
		call	Page0Call_3D47
		ld	hl, (curGY)
		push	hl
		rst	10h
		ex	de, hl
		ld	c, (hl)
		inc	hl
		ld	b, (hl)
		dec	bc
		dec	bc
		inc	hl
		inc	hl
		jr	p04loc_77C4
; End of function TAN_EQU_DISP


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


PUTEQUNO:				; CODE XREF: seg001:456Bp seg001:4587p ...
		ld	b, a
		ld	a, 0
		bit	0, (iy+36h)
		call	nz, Page0Call_3369
		ret	nz
		ld	a, b
		push	af
		set	1, (iy+5)
		bit	0, (iy+18h)
		jr	nz, p04loc_784F
		set	6, (iy+1Dh)
		ld	a, (curPlotNumber)
		or	a
		jr	nz, p04loc_7867
		pop	af
		call	Page0Call_385B
		call	page0_1A2
		jr	z, p04loc_782C
		set	3, (iy+11h)

p04loc_782C:				; CODE XREF: PUTEQUNO+28j
		ld	hl, 0
		call	p04sub_77A6
		res	3, (iy+11h)
		call	page0_1A2
		jr	z, p04loc_7875
		ld	hl, OP1M
		inc	(hl)
		ld	hl, 30h	; '0'
		call	Bit_VertSplit
		jr	z, p04loc_784A
		ld	hl, 18h

p04loc_784A:				; CODE XREF: PUTEQUNO+47j
		call	p04sub_77A6
		jr	p04loc_7875
; ---------------------------------------------------------------------------

p04loc_784F:				; CODE XREF: PUTEQUNO+15j
		pop	af
		bit	4, (iy+4)
		ret	nz
		push	af
		set	6, (iy+1Dh)
		ld	hl, 5Ah	; 'Z'
		call	Bit_VertSplit
		jr	z, p04loc_7864
		ld	l, 2Ah ; '*'

p04loc_7864:				; CODE XREF: PUTEQUNO+62j
		ld	(penCol), hl

p04loc_7867:				; CODE XREF: PUTEQUNO+1Fj
		call	Page04_3348
		pop	af
		cp	0Ah
		jr	nz, p04loc_7870
		xor	a

p04loc_7870:				; CODE XREF: PUTEQUNO+6Fj
		add	a, 30h ; '0'
		call	Page0Call_3D47

p04loc_7875:				; CODE XREF: p04sub_7767+2Cj PUTEQUNO+3Bj ...
		res	1, (iy+5)
		ret
; End of function PUTEQUNO


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


p04sub_787A:				; CODE XREF: ForceGraphKeypress:p04loc_4ABAp
		ld	hl, p04loc_7A20

PutAns:					; CODE XREF: p04sub_6419+15j
		call	setPenX
		set	1, (iy+5)
		call	Page04_3348
		call	p04sub_7A03
		call	Page0Call_32C1
		call	Bit_VertSplit
		call	nz, setPenY
		call	p04loc_797B
		jr	p04loc_7875
; End of function p04sub_787A

; ---------------------------------------------------------------------------
; START	OF FUNCTION CHUNK FOR LABCOOR

p04loc_7898:				; CODE XREF: LABCOOR:p04loc_4923j
		ld	hl, p04loc_7A8D
		ld	a, 5Ah ; 'Z'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_78F8
; ---------------------------------------------------------------------------

p04loc_78A6:				; CODE XREF: LABCOOR+56j
		ld	hl, p04loc_7A44
		ld	a, 5Fh ; '_'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_78F8
; ---------------------------------------------------------------------------

p04loc_78B4:				; CODE XREF: LABCOOR+5Bj
		ld	hl, p04loc_7A51
		ld	a, 5Eh ; '^'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_78F8
; ---------------------------------------------------------------------------

p04loc_78C2:				; CODE XREF: LABCOOR:p04loc_493Dj
		ld	hl, p04loc_7A99
		ld	a, 59h ; 'Y'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_78F8
; ---------------------------------------------------------------------------

p04loc_78D0:				; CODE XREF: LABCOOR+48j
		ld	hl, p04loc_7A73
		ld	a, 5Ch ; '\'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_78F8
; ---------------------------------------------------------------------------

p04loc_78DE:				; CODE XREF: LABCOOR+4Dj
		ld	hl, p04loc_7A80
		ld	a, 5Bh ; '['
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_78F8
; ---------------------------------------------------------------------------

p04loc_78EC:				; CODE XREF: LABCOOR:p04loc_4934j
		ld	hl, p04loc_7AA6
		ld	a, 58h ; 'X'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45

p04loc_78F8:				; CODE XREF: LABCOOR+2FE9j
		; LABCOOR+2FF7j ...
		bit	3, (iy+2)
		jr	z, p04loc_7910
		push	hl
		call	CLRGRAPHXY
		call	PutXY
		call	Page0Call_3EFD
		pop	hl
		call	p04sub_7930
		call	p04sub_4A43
		ret
; ---------------------------------------------------------------------------

p04loc_7910:				; CODE XREF: LABCOOR+3041j
		bit	2, (iy+17h)
		jr	z, p04loc_7925
		call	setPenT
		call	Bit_VertSplit
		jr	nz, p04loc_7933
		sub	2
		ld	(penCol+1), a
		jr	p04loc_7933
; ---------------------------------------------------------------------------

p04loc_7925:				; CODE XREF: LABCOOR+3059j
		bit	4, (iy+4)
		jr	z, p04loc_7974
		call	setPenX
		jr	p04loc_7933
; END OF FUNCTION CHUNK	FOR LABCOOR

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


p04sub_7930:				; CODE XREF: LABCOOR+304Ep
		; LABCOOR:p04loc_7974p
		call	setPenT

p04loc_7933:				; CODE XREF: LABCOOR+3061j
		; LABCOOR+3068j ...
		set	1, (iy+5)
		call	Page04_3348
		call	p04sub_7A03
		ret
; End of function p04sub_7930


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


p04sub_793E:				; CODE XREF: ForceGraphKeypress+690p
		ld	hl, p04loc_7A27
		ld	a, 62h ; 'b'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_7974
; End of function p04sub_793E


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


p04sub_794C:				; CODE XREF: ForceGraphKeypress+68Cp
		ld	hl, p04loc_7A2F
		ld	a, 61h ; 'a'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_7974
; End of function p04sub_794C


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


p04sub_795A:				; CODE XREF: ForceGraphKeypress+78Ap
		ld	hl, p04loc_7A37
		ld	a, 60h ; '`'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		jr	p04loc_7974
; End of function p04sub_795A


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


p04sub_7968:				; CODE XREF: ForceGraphKeypress+612p
		ld	hl, p04loc_7AAD
		ld	a, 57h ; 'W'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
; End of function p04sub_7968

; START	OF FUNCTION CHUNK FOR LABCOOR

p04loc_7974:				; CODE XREF: LABCOOR+306Ej p04sub_793E+Cj ...
		call	p04sub_7930
		jp	PutXY
; END OF FUNCTION CHUNK	FOR LABCOOR

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


p04sub_797A:				; CODE XREF: p04sub_76A4p
		rst	20h

p04loc_797B:				; CODE XREF: p04sub_787A+19p
		ld	a, 9

DispOP1A:				; CODE XREF: p04sub_76F1:p04loc_7706p
		set	6, (iy+1Dh)
		push	af
		call	Page0Call_39CF
		pop	af
		call	Page0Call_3639
		ld	hl, OP3
		call	p04sub_7A03
		call	Page04_3348
; End of function p04sub_797A


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


Page04_3348:				; CODE XREF: ForceGraphKeypress+531p
		; p04sub_7661+7p ...
		ld	a, 20h ; ' '
		call	Page0Call_3D47
		ret
; End of function Page04_3348

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

Page04_32E8:
		ld	c, a
		ld	b, 8
		sub	a

p04loc_799C:				; CODE XREF: seg001:p04loc_79A6j
		sla	c
		rla
		cp	0Ah
		jr	c, p04loc_79A6
		sub	0Ah
		inc	c

p04loc_79A6:				; CODE XREF: seg001:79A1j
		djnz	p04loc_799C
		ld	b, a
		ld	a, c
		or	a
		ret
; ---------------------------------------------------------------------------

Page04_3504:
		call	setPenX
		call	CpyTo1FPS1
		ld	hl, aTmax+1
		ld	a, 63h ; 'c'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		set	1, (iy+5)
		call	p04sub_7A03
		ld	a, 3Ch ; '<'
		call	p04sub_76F1
		call	YName
		call	Bit_VertSplit
		jr	z, p04loc_79D7
		call	setPenY
		jr	p04loc_79DC
; ---------------------------------------------------------------------------

p04loc_79D7:				; CODE XREF: seg001:79D0j
		ld	a, 3Ah ; ':'
		call	p04loc_75CB

p04loc_79DC:				; CODE XREF: seg001:79D5j
		set	1, (iy+5)
		ld	a, 6Eh ; 'n'
		call	Page0Call_3D47
		ld	a, 3Dh ; '='
		call	Page0Call_3D47
		call	p04sub_76A2
		call	CpyTo1FPS2
		call	setPenT
		ld	hl, aTmin+1
		ld	a, 64h ; 'd'
		bit	1, (iy+35h)
		call	nz, Page0Call_3C45
		call	p04sub_76E8
		ret

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


p04sub_7A03:				; CODE XREF: ForceGraphKeypress+534p
		; p04sub_76E8+4p ...
		push	af
		push	de
		push	ix

p04loc_7A07:				; CODE XREF: p04sub_7A03+Cj
		ld	a, (hl)
		inc	hl
		or	a
		jr	z, p04loc_7A11
		call	Page0Call_3D47
		jr	nc, p04loc_7A07

p04loc_7A11:				; CODE XREF: p04sub_7A03+7j
		pop	ix
		pop	de
		pop	af
		ret
; End of function p04sub_7A03

p04loc_7A16:
		.dw aMinx04
		.dw aQ1
		.dw aMed
		.dw aQ3
		.dw aMaxx04
p04loc_7A20:
aDyDx_04:   .asc 'dy/dx=',0
p04loc_7A27:
aMinimum:	.asc 'Minimum',0
p04loc_7A2F:
aMaximum:	.asc 'Maximum',0
p04loc_7A37:
aIntersection:	.asc 'Intersection',0
p04loc_7A44:
aFirstCurve?:	.asc 'First curve?',0
p04loc_7A51:
aSecondCurve?:	.asc 'Second curve?',0
p04loc_7A5F:
aQ1:		.asc 'Q1',0
p04loc_7A62:
aQ3:		.asc 'Q3',0
p04loc_7A65:
aMinx04:		.asc 'minX',0
p04loc_7A6A:
aMaxx04:		.asc 'maxX',0
p04loc_7A6F:
aMed:		.asc 'Med',0
p04loc_7A73:
aLowerLimit?:	.asc 'Lower Limit?',0
p04loc_7A80:
aUpperLimit?:	.asc 'Upper Limit?',0
p04loc_7A8D:
aLeftBound?:	.asc 'Left Bound?',0
p04loc_7A99:
aRightBound?:	.asc 'Right Bound?',0
p04loc_7AA6:
aGuess?:	.asc 'Guess?',0
p04loc_7AAD:
aZero:		.asc 'Zero',0

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


PDspGrph:				; CODE XREF: VertCmd:LineCmdp
		; seg001:UnLineCmdp ...
		res	1, (iy+2)
		bit	0, (iy+3)
		call	nz, Regraph
		bit	6, (iy+0Ch)
		jr	z, p04loc_7ADA
		call	Bit_VertSplit
		jr	z, p04loc_7AD4
		bit	6, (iy+1Dh)
		jr	nz, p04loc_7ADA
		bit	7, (iy+1Dh)
		jr	nz, p04loc_7ADA

p04loc_7AD4:				; CODE XREF: PDspGrph+14j
		bit	2, (iy+2)
		jr	nz, p04loc_7ADD

p04loc_7ADA:				; CODE XREF: PDspGrph+Fj PDspGrph+1Aj	...
		call	GRBUFCPY_V

p04loc_7ADD:				; CODE XREF: PDspGrph+26j
		call	GRLABELS
		ret
; End of function PDspGrph


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


p04sub_7AE1:				; CODE XREF: seg001:HorizCmdp VertCmdp
		ld	hl, 24h	; '$'
		call	AllocFPS1
		or	a
		sbc	hl, de
		ex	de, hl
		ret
; End of function p04sub_7AE1

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

HorizCmd:				; CODE XREF: seg001:7FC8j
		call	p04sub_7AE1
		ld	hl, Xmin
		call	mov9B2
		call	MovFrOP1
		ld	hl, Xmax
		call	mov9B2
		call	MovFrOP1
		jr	LineCmd

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


VertCmd:				; CODE XREF: MATHTANLN+DFp
		; seg001:7FB4j
		call	p04sub_7AE1
		call	MovFrOP1
		ld	hl, Ymax
		call	mov9B2
		call	MovFrOP1
		ld	hl, Ymin
		call	mov9B2

LineCmd:				; CODE XREF: seg001:7B01j seg001:7FAAj
		call	PDspGrph
		call	page0_189
		jr	nz, p04loc_7B24
		call	Page0Call_3573
		ret
; ---------------------------------------------------------------------------

p04loc_7B24:				; CODE XREF: VertCmd+1Bj seg001:7B30j
		ld	de, 24h	; '$'
		jp	DeallocFPS1
; End of function VertCmd

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

UnLineCmd:				; CODE XREF: seg001:7FAFj
		call	PDspGrph
		call	page0_189
		jr	nz, p04loc_7B24
		call	Page0Call_3567
		ret
; ---------------------------------------------------------------------------

p04loc_7B36:				; CODE XREF: seg001:7FB9j
		ld	a, b
		cp	2
		jr	z, p04loc_7B48
		cp	3
		jp	nz, ErrArgument
		ld	a, e
		cp	7
		jp	z, ErrArgument
		jr	p04loc_7B50
; ---------------------------------------------------------------------------

p04loc_7B48:				; CODE XREF: seg001:7B39j
		push	de
		call	PushOP1
		call	OP1Set1
		pop	de

p04loc_7B50:				; CODE XREF: seg001:7B46j
		ld	a, 0FBh	; '�'
		add	a, e
		push	af
		call	PushOP1
		ld	b, 3
		call	Page0Call_3981
		call	PopRealO1
		pop	af

PointCmd:
		push	af
		rst	18h
		call	PDspGrph
		call	PopRealO1
		pop	af
		ld	hl, OP1M
		bit	5, (hl)
		jp	z, CPointS
		push	af
		ld	a, (hl)
		push	af
		call	Page0Call_3579
		jr	z, p04loc_7B7C
		pop	af
		pop	af
		ret
; ---------------------------------------------------------------------------

p04loc_7B7C:				; CODE XREF: seg001:7B77j
		pop	bc
		pop	af
		ld	hl, p04loc_664B
		bit	4, b
		jr	nz, p04loc_7B88
		ld	hl, p04loc_6646

p04loc_7B88:				; CODE XREF: seg001:7B83j
		ld	bc, (curGY)
		res	1, (iy+2)
		ld	d, a
		call	p04sub_65AF
		ret
; ---------------------------------------------------------------------------

PixelTest:
		ld	a, 3
		push	af
		jr	p04loc_7B9E
; ---------------------------------------------------------------------------

PixelCmd:				; CODE XREF: seg001:7FBEj
		push	bc
		call	PDspGrph

p04loc_7B9E:				; CODE XREF: seg001:7B98j
		ld	a, (pixWide_m_1)
		call	p04sub_7BC8
		ld	b, a
		push	bc
		ld	a, (lcdTallP)
		dec	a
		call	p04sub_7BC8
		pop	bc
		ld	c, a
		ld	a, 3Fh ; '?'
		sub	c
		jr	z, p04loc_7BE1
		call	CheckSplitFlag
		jr	z, p04loc_7BBB
		sub	20h ; ' '

p04loc_7BBB:				; CODE XREF: seg001:7BB7j
		call	Bit_VertSplit
		jr	z, p04loc_7BC2
		sub	0Ch

p04loc_7BC2:				; CODE XREF: seg001:7BBEj
		ld	c, a
		pop	de
		call	IPoint
		ret

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


p04sub_7BC8:				; CODE XREF: seg001:7BA1p seg001:7BAAp
		push	af
		call	PopRealO1
		call	ErrD_OP1NotPosInt
		ld	a, (OP1+1)
		cp	83h ; '�'
		jr	nc, p04loc_7BE1
		call	Page0Call_3B5B
		ld	a, d
		or	a
		jr	nz, p04loc_7BE1
		ld	a, e
		pop	de
		cp	d
		ret	c
; End of function p04sub_7BC8

; START	OF FUNCTION CHUNK FOR MATHTANLN

p04loc_7BE1:				; CODE XREF: seg001:7BB2j p04sub_7BC8+Cj	...
		jp	ErrDomain
; END OF FUNCTION CHUNK	FOR MATHTANLN

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


MATHTANLN:				; CODE XREF: ForceGraphKeypress+4E9p

; FUNCTION CHUNK AT 7BE1 SIZE 00000003 BYTES

		call	Page0Call_334B
		call	page0_13
		jp	z, p04loc_7C93
		rst	18h
		call	Page0Call_353D

TanLnF:					; CODE XREF: seg001:7FCDj
		rst	8
		call	CpyTo1FPST
		call	CpyO2ToFPST
		call	Page0Call_38BB
		call	CkOP1Real
		jr	nz, p04loc_7BE1

p04loc_7C00:				; CODE XREF: MATHTANLN+D6j
		rst	8
		call	Page0Call_38F1
		call	FPMult
		call	CpyTo3FPST
		call	CpyO2ToFPST
		call	BCALL_4120
		call	InvSub

p04loc_7C13:				; CODE XREF: MATHTANLN+12Dj
		rst	18h
		call	Page0Call_39CF
		ld	a, 15h
		call	Page0Call_32A3
		push	bc
		call	CpyTo1FPS1
		call	Page0Call_39CF
		ld	a, 15h
		call	Page0Call_32A3
		pop	hl
		add	hl, bc
		ld	bc, 4
		add	hl, bc
		call	TMPEQUNOSRC
		ld	(inputDat), de
		call	PushRealO4
		call	CpyTo1FPS2
		call	Page0Call_39CF
		ld	a, 15h
		call	Page0Call_32A3
		ld	de, (inputDat)
		call	p04sub_7F9B
		ld	a, 58h ; 'X'
		ld	(de), a
		inc	de
		ld	a, 70h ; 'p'
		ld	(de), a
		inc	de
		push	de
		call	CpyTo1FPS1
		call	Page0Call_39CF
		ld	a, 15h
		call	Page0Call_32A3
		pop	de
		call	p04sub_7F9B
		call	PopRealO2
		call	FPOPREAL
		call	PopRealO1
		call	TraceOff
		call	PUSHMCPLXO1
		call	DrawCmd
		call	PopRealO1
		ld	a, (mcxCurApp)
		cp	44h ; 'D'
		jr	nz, p04loc_7C86
		call	page0_13
		jr	z, p04loc_7C86
		rst	8
		jr	p04loc_7C89
; ---------------------------------------------------------------------------

p04loc_7C86:				; CODE XREF: MATHTANLN+98j
		; MATHTANLN+9Dj
		call	markTableDirty

p04loc_7C89:				; CODE XREF: MATHTANLN+A0j
		call	PopRealO1

p04loc_7C8C:				; CODE XREF: MATHTANLN+E7j
		res	0, (iy+7)
		jp	TraceOff
; ---------------------------------------------------------------------------

p04loc_7C93:				; CODE XREF: MATHTANLN+6j
		call	page0_1A2
		jr	z, p04loc_7CCE
		call	Page0Call_38C7
		rst	18h
		call	Page0Call_334B
		call	page0_17E0
		call	Page0Call_38C7
		call	PopRealO2
		call	CkOP2FP0
		jr	z, p04loc_7CBD
		call	fpdiv
		call	OP1ToOP6
		call	Page0Call_353D
		rst	18h
		call	OP6ToOP1
		jp	p04loc_7C00
; ---------------------------------------------------------------------------

p04loc_7CBD:				; CODE XREF: MATHTANLN+C7j
		; MATHTANLN+F6j
		call	ErrD_OP1_0
		call	Page0Call_38F1
		call	VertCmd
		ld	a, 0FFh
		ld	(OP1), a
		jp	p04loc_7C8C
; ---------------------------------------------------------------------------

p04loc_7CCE:				; CODE XREF: MATHTANLN+B2j
		call	page0_19D
		jp	nz, Page0Call_24D9
		call	Page0Call_38CD
		call	CkOP2FP0
		jr	z, p04loc_7CBD
		call	fpdiv
		rst	18h
		call	ThetaName
		call	Page0Call_38B5
		call	Page0Call_39FF
		call	OP1ToOP5
		call	Mov11B
		call	RName
		call	Page0Call_38B5
		rst	8
		call	OP5ToOP1
		call	FPMult
		call	OP1ToOP5
		call	OP6ToOP1
		call	FPMult
		call	CpyTo2FPST
		call	FPMult
		call	OP5ToOP2
		call	InvSub
		jp	p04loc_7C13
; End of function MATHTANLN


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


DRAWCMD_INIT:				; CODE XREF: DrawCmdp
		call	PDspGrph
		call	Page04_32B8
		set	3, (iy+3)
		call	Page04_330C
		xor	a
		ld	(curInc), a
		ld	hl, Xmin
		rst	20h
		rst	18h
		rst	18h
		call	Page0Call_3321
		ld	hl, (chkDelPtr1)
		ld	(inputDat), hl
		set	5, (iy+3)
		ret
; End of function DRAWCMD_INIT


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


DrawCmd:				; CODE XREF: MATHTANLN+8Dp
		; seg001:7FD7j
		call	DRAWCMD_INIT
		ld	hl, (pTempCnt)
		push	hl

p04loc_7D40:				; CODE XREF: DrawCmd+31j
		call	CpyTo1FPS2
		call	Page0Call_337B
		bit	5, (iy+3)
		jr	z, p04loc_7D53
		call	CpyO1ToFPST
		res	5, (iy+3)

p04loc_7D53:				; CODE XREF: DrawCmd+11j
		call	INITNSEQ
		call	YRES
		call	p04sub_7D6C
		call	Page04_3396
		call	p04sub_7F07
		jr	nc, ENDDRAW
		ld	hl, (inputDat)
		call	Xitof
		jr	p04loc_7D40
; End of function DrawCmd


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


p04sub_7D6C:				; CODE XREF: DrawCmd+20p seg001:7F7Fp
		call	page0_189
		ret	z
		pop	hl

ENDDRAW:				; CODE XREF: DrawCmd+29j seg001:7F04j	...
		res	3, (iy+3)
		call	FPOPCPLX
		pop	hl
		ld	(pTempCnt), hl
		jp	TraceOff
; End of function p04sub_7D6C


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


p04sub_7D7F:				; CODE XREF: seg001:SHADECMDp
		; seg001:7DA0p
		call	PopRealO1
		call	page0_14D1
		jp	nz, ErrDomain
		call	GETEXP
		cp	81h ; '�'

p04loc_7D8D:				; CODE XREF: seg001:7D9Bj seg001:7DA5j
		jp	nc, ErrDomain
		ld	a, (OP1M)
		jp	ShRAcc
; End of function p04sub_7D7F

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

SHADECMD:				; CODE XREF: seg001:7FC3j
		call	p04sub_7D7F
		cp	9
		jr	nc, p04loc_7D8D
		ld	(unk_9D8E), a
		call	p04sub_7D7F
		cp	5
		jr	nc, p04loc_7D8D
		dec	a
		push	af
		call	PDspGrph
		pop	af
		ld	(unk_9668), a
		ld	a, 2
		ld	(unk_9775), a
		call	Page04_32B8
		ld	a, (unk_9D8E)
		push	af
		set	3, (iy+3)
		ld	hl, (pTempCnt)
		push	hl
		call	Page04_330C
		xor	a
		ld	(curInc), a
		ld	hl, Xmin
		rst	20h
		rst	18h
		rst	18h
		rst	18h
		call	Page0Call_3321
		ld	hl, (chkDelPtr1)
		ld	(inputDat), hl
		set	5, (iy+3)

p04loc_7DDF:				; CODE XREF: seg001:7EFBj
		ld	de, OP1
		ld	hl, (FPS)
		call	CpyTo1FPS6
		call	Page0Call_337B
		bit	5, (iy+3)
		call	nz, CpyO1ToFPS1
		ld	de, OP3
		call	CPYFPS2
		inc	de
		inc	de
		call	mov9B2
		rst	8
		call	CpyO1ToFPS1
		ld	hl, (inputDat)
		rst	20h
		call	PLOTPT
		call	CpyTo1FPS5
		call	Page0Call_337B
		bit	5, (iy+3)
		call	nz, CpyO1ToFPST
		res	5, (iy+3)
		call	INITNSEQ
		ld	de, OP3
		call	CPYFPS2
		ld	de, OP4
		call	CPYFPST
		rst	8
		call	CpyO1ToFPST
		ld	hl, (inputDat)
		rst	20h
		call	CpyO1ToFPS2
		call	PLOTPT
		call	page0_189
		jp	nz, p04loc_7EFE
		call	Page04_3396
		call	CpyTo2FPST
		call	CpyTo1FPS1
		call	cpop1op2
		jp	nc, p04loc_7EF0
		call	CpyTo2FPST
		call	CpyTo1FPS1
		ld	a, (OP1)
		bit	5, a
		jp	nz, p04loc_7EF0
		ld	a, (OP2)
		bit	5, a
		jp	nz, p04loc_7EF0
		ld	hl, (inputDat)
		ld	de, OP3
		call	mov9B2
		ld	hl, OP3
		call	XYRND
		ld	hl, (FPS)
		ld	de, 0FFD3h
		add	hl, de
		ex	de, hl
		ld	hl, OP3
		xor	a
		call	Page04_3408
		or	a
		jr	nz, p04loc_7EF0
		call	CpyTo1FPST
		call	Page0Call_3E37
		call	PushRealO3
		rst	18h
		ld	de, Ymin
		ld	hl, OP1
		xor	a
		call	Page04_3408
		call	PopRealO1
		bit	1, a
		jr	z, p04loc_7EA2
		call	FPOPREAL
		jr	p04loc_7EF0
; ---------------------------------------------------------------------------

p04loc_7EA2:				; CODE XREF: seg001:7E9Bj
		or	a
		ld	a, 40h ; '@'
		jr	nz, p04loc_7EAD
		ld	de, OP1
		call	YftoI

p04loc_7EAD:				; CODE XREF: seg001:7EA5j
		ld	(unk_966D), a
		call	CpyTo1FPS2
		call	Page0Call_3E37
		ld	de, Ymin
		ld	hl, OP1
		xor	a
		call	Page04_3408
		push	af
		call	PopRealO1
		call	CpyTo2FPS1
		ld	hl, Ymin
		pop	af
		bit	0, a
		jr	nz, p04loc_7EF0
		bit	1, a
		call	nz, Mov9ToOP2
		set	5, (iy+14h)
		pop	hl
		pop	af
		ld	(unk_966C), a
		push	af
		push	hl
		set	7, (iy+1Eh)
		ld	a, 3
		call	CPoint
		res	7, (iy+1Eh)
		res	5, (iy+14h)

p04loc_7EF0:				; CODE XREF: seg001:7E48j seg001:7E56j ...
		call	p04sub_7F07
		jr	nc, p04loc_7EFE
		ld	hl, (inputDat)
		call	Xitof
		jp	p04loc_7DDF
; ---------------------------------------------------------------------------

p04loc_7EFE:				; CODE XREF: seg001:7E39j seg001:7EF3j
		pop	hl
		pop	de
		push	hl
		call	FPOPREAL
		jp	ENDDRAW

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


p04sub_7F07:				; CODE XREF: DrawCmd+26p
		; seg001:p04loc_7EF0p
		ld	a, (curInc)
		inc	a
		call	p04sub_75A2
		ret	nc
		ld	(curInc), a
		ret
; End of function p04sub_7F07

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

InvCmd:					; CODE XREF: seg001:7FD2j
		call	page0_13
		jp	z, Page0Call_24D9
		call	CPTDELY
		ld	hl, Ymin
		ld	a, (unk_915C)
		call	CKVALDELTA
		call	PDspGrph
		call	Page04_32B8
		set	3, (iy+3)
		ld	hl, (pTempCnt)
		push	hl
		call	Page04_330C
		xor	a
		ld	(curInc), a
		ld	hl, Ymin
		rst	20h
		rst	8
		call	PUSHMCPLXO1
		call	Page0Call_3321
		ld	hl, (chkDelPtr1)
		ld	(inputDat), hl
		set	5, (iy+3)

p04loc_7F4F:				; CODE XREF: seg001:7F99j
		call	CpyTo1FPS2
		call	Page0Call_337B
		bit	5, (iy+3)
		jr	z, p04loc_7F62
		call	CpyO1ToFPS1
		res	5, (iy+3)

p04loc_7F62:				; CODE XREF: seg001:7F59j
		call	INITNSEQ
		ld	de, OP3
		call	CPYFPS1
		inc	de
		inc	de
		call	mov9B2
		call	CpyO1ToFPS1
		ld	hl, (inputDat)
		call	Mov9ToOP2
		call	CpyO2ToFPST
		call	PLOTPT
		call	p04sub_7D6C
		call	Page04_3396
		ld	a, (curInc)
		inc	a
		ld	hl, lcdTallP
		cp	(hl)
		jp	nc, ENDDRAW
		ld	(curInc), a
		ld	hl, (inputDat)
		call	p04sub_43E1
		jr	p04loc_7F4F

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


p04sub_7F9B:				; CODE XREF: MATHTANLN+63p
		; MATHTANLN+7Bp
		ld	hl, OP3
		ldir
		ret
; End of function p04sub_7F9B


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


Page04_32B8:				; CODE XREF: DRAWCMD_INIT+3p
		; seg001:7DB5p	...
		call	page0_189
		ret	z
		pop	hl
		jp	TraceOff
; End of function Page04_32B8

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

Page04_32BE:
		or	a
		jp	z, LineCmd
		cp	9Ch ; '�'
		jp	z, UnLineCmd
		cp	9Dh ; '�'
		jp	z, VertCmd
		cp	9Eh ; '�'
		jp	z, p04loc_7B36
		cp	0A1h ; '�'
		jp	z, PixelCmd
		cp	0A4h ; '�'
		jp	z, SHADECMD
		cp	0A6h ; '�'
		jp	z, HorizCmd
		cp	0A7h ; '�'
		jp	z, TanLnF
		cp	0A8h ; '�'
		jp	z, InvCmd
		cp	0A9h ; '�'
		jp	z, DrawCmd
		ret