source/page01/routines.asm
changeset 44 f4f75ec42b53
parent 43 486c42a314bc
equal deleted inserted replaced
43:486c42a314bc 44:f4f75ec42b53
       
     1 p01sub_55B5:
       
     2 		call	lcd_busy
       
     3 		out		(11h), a
       
     4 		jr		p01loc_55C6
       
     5 sOK:	call	lcd_busy
       
     6 		in		a, (11h)
       
     7 		call	lcd_busy
       
     8 		in		a, (11h)
       
     9 p01loc_55C6:
       
    10 		push	af
       
    11 		ld		a, (curXRow)
       
    12 		jr		p01loc_55DD
       
    13 p01sub_55CC:
       
    14 		call	lcd_busy
       
    15 		in		a, (11h)
       
    16 		call	lcd_busy
       
    17 		in		a, (11h)
       
    18 p01sub_55D6:
       
    19 		push	af
       
    20 		ld		a, (curXRow)
       
    21 		add		a, 8
       
    22 		sub		b
       
    23 p01loc_55DD:
       
    24 		call	p01sub_55E5
       
    25 		call	SetXUp
       
    26 		pop		af
       
    27 		ret
       
    28 p01sub_55E5:
       
    29 		call	SetYUp
       
    30 		cp		80h
       
    31 		ret		c
       
    32 		cp		0C0h
       
    33 		ret		nc
       
    34 		call	lcd_busy
       
    35 		out		(10h), a
       
    36 		ret
       
    37 
       
    38 PutMap:	di
       
    39 		push	af
       
    40 		push	bc
       
    41 		push	de
       
    42 		push	hl
       
    43 		push	ix
       
    44 		res		plotDisp, (iy+plotFlags)
       
    45 		bit		appTextSave, (iy+appFlags)
       
    46 		jr		z, p01loc_5609
       
    47 		call	getcurloc
       
    48 		ld		(hl), a
       
    49 p01loc_5609:
       
    50 		or		a
       
    51 		jr		z, p01loc_5610
       
    52 		cp		0F5h
       
    53 		jr		c, p01loc_5612
       
    54 p01loc_5610:
       
    55 		ld		a, 0D0h
       
    56 p01loc_5612:
       
    57 		ld		l, a
       
    58 		ld		h, 0
       
    59 		add		hl, hl
       
    60 		add		hl, hl
       
    61 		add		hl, hl
       
    62 		call	Page0Call_3BC7
       
    63 		push	hl
       
    64 		pop		ix
       
    65 		ld		a, (curRow)
       
    66 		call	MAKEROWCMD
       
    67 		ld		(curXRow), a
       
    68 		ld		a, (curRow+1)
       
    69 		and		1Fh
       
    70 		add		a, 20h
       
    71 		ld		b, a
       
    72 		xor		a
       
    73 		call	lcd_busy
       
    74 		out		(10h), a
       
    75 		ld		a, (curXRow)
       
    76 		call	p01sub_55E5
       
    77 		call	SetXUp
       
    78 		ld		a, b
       
    79 		call	lcd_busy
       
    80 		out		(10h), a
       
    81 		ld		b, 8
       
    82 p01loc_5646:
       
    83 		xor		a
       
    84 		dec		b
       
    85 		jr		z, p01loc_564F
       
    86 		ld		a, (ix+0)
       
    87 		inc		ix
       
    88 p01loc_564F:
       
    89 		inc		b
       
    90 		sla	a
       
    91 		bit		textInverse, (iy+textFlags)
       
    92 		jr		z, p01loc_568D
       
    93 		xor		3Eh
       
    94 p01loc_565A:
       
    95 		push	af
       
    96 		ld		a, (curRow+1)
       
    97 		and		1Fh
       
    98 		jr		z, p01loc_568A
       
    99 		add		a, 1Fh
       
   100 		call	lcd_busy
       
   101 		out		(10h), a
       
   102 		call	p01sub_55CC
       
   103 		or		1
       
   104 		bit		preClrForMode, (iy+newDispF)
       
   105 		jr		z, p01loc_5676
       
   106 		and		3Eh
       
   107 p01loc_5676:
       
   108 		call	lcd_busy
       
   109 		out		(11h), a
       
   110 		ld		a, (curRow+1)
       
   111 		and		1Fh
       
   112 		add		a, 20h
       
   113 		call	lcd_busy
       
   114 		out		(10h), a
       
   115 		call	p01sub_55D6
       
   116 p01loc_568A:
       
   117 		pop		af
       
   118 		jr		p01loc_5693
       
   119 p01loc_568D:
       
   120 		bit		preClrForMode, (iy+newDispF)
       
   121 		jr		nz, p01loc_565A
       
   122 p01loc_5693:
       
   123 		call	lcd_busy
       
   124 		out		(11h), a
       
   125 		djnz	p01loc_5646
       
   126 		ld		a, 1
       
   127 		call	lcd_busy
       
   128 		out		(10h), a
       
   129 p01loc_56A1:
       
   130 		pop		ix
       
   131 p01loc_56A3:
       
   132 		pop		hl
       
   133 		pop		de
       
   134 		pop		bc
       
   135 		pop		af
       
   136 		ret
       
   137 
       
   138 PutC:	push	af
       
   139 		push	hl
       
   140 		cp		0D6h
       
   141 		jr		nz, p01loc_56C0
       
   142 		call	EraseEOL
       
   143 		call	newline
       
   144 		ld		a, (winTop+1)
       
   145 		ld		l, a
       
   146 		ld		a, (curRow)
       
   147 		cp		l
       
   148 		jr		nc, p01loc_56D1
       
   149 		ld		a, 3Ah
       
   150 p01loc_56C0:
       
   151 		call	PutMap
       
   152 		res		preClrForMode, (iy+newDispF)
       
   153 		ld		hl, curCol
       
   154 		inc		(hl)
       
   155 		ld		a, (hl)
       
   156 		cp		10h
       
   157 		call	nc, newline
       
   158 p01loc_56D1:
       
   159 		pop		hl
       
   160 		pop		af
       
   161 		ret
       
   162 
       
   163 Page01_3C75:
       
   164 		push	bc
       
   165 p01loc_56D5:
       
   166 		ld		bc, (unk_839F)
       
   167 		ld		(OP1), bc
       
   168 		ld		bc, (unk_83A1)
       
   169 		ld		(OP1M), bc
       
   170 		ld		hl, 848Dh
       
   171 		ld		e, a
       
   172 		ld		d, 0
       
   173 		add		hl, de
       
   174 		push	de
       
   175 		push	hl
       
   176 		ld		b, a
       
   177 p01loc_56EF:
       
   178 		ld		de, 0Ah
       
   179 		push	hl
       
   180 		push	bc
       
   181 		rst		28h
       
   182 		.dw		80B1h
       
   183 		pop		bc
       
   184 		pop		hl
       
   185 		ld		a, (OP2+3)
       
   186 		add		a, 30h
       
   187 		ld		(hl), a
       
   188 		dec		hl
       
   189 		djnz	p01loc_56EF
       
   190 		sub		a
       
   191 		pop		hl
       
   192 		inc		hl
       
   193 		ld		(hl), a
       
   194 		ld		hl, 848Dh
       
   195 		ld		a, 30h
       
   196 		pop		bc
       
   197 		ld		b, c
       
   198 		dec		b
       
   199 p01loc_570E:
       
   200 		inc		hl
       
   201 		cp		(hl)
       
   202 		jr		nz, p01loc_5716
       
   203 		ld		(hl), 20h
       
   204 		djnz	p01loc_570E
       
   205 p01loc_5716:
       
   206 		ld		hl, OP3
       
   207 		ld		a, c
       
   208 		cp		7
       
   209 		jr		nz, p01loc_5724
       
   210 		ld		a, 20h
       
   211 		cp		(hl)
       
   212 		jr		nz, p01loc_5727
       
   213 		inc		hl
       
   214 p01loc_5724:
       
   215 		pop		bc
       
   216 		jr		Page01_3C81
       
   217 p01loc_5727:
       
   218 		ld		a, (OP3+4)
       
   219 		cp		35h
       
   220 		jr		nc, p01loc_573E
       
   221 		ld		a, 4Bh
       
   222 		ld		(OP3+4), a
       
   223 		xor		a
       
   224 		ld		(OP3+5), a
       
   225 		ld		a, 20h
       
   226 		call	PutC
       
   227 		jr		p01loc_5724
       
   228 p01loc_573E:
       
   229 		ld		hl, 83A2h
       
   230 		ld		a, 0F4h
       
   231 		add		a, (hl)
       
   232 		ld		(hl), a
       
   233 		dec		hl
       
   234 		ld		a, 1
       
   235 		adc	a, (hl)
       
   236 		ld		(hl), a
       
   237 		dec		hl
       
   238 		ld		a, 0
       
   239 		adc	a, (hl)
       
   240 		ld		(hl), a
       
   241 		ld		a, c
       
   242 		jr		p01loc_56D5
       
   243 DispHL:	push	bc
       
   244 		ld		de, 847Ch
       
   245 		ld		b, 5
       
   246 p01loc_5758:
       
   247 		call	DivHLBy10
       
   248 		add		a, 30h
       
   249 		ld		(de), a
       
   250 		dec		de
       
   251 		djnz	p01loc_5758
       
   252 		sub		a
       
   253 		ld		(OP1+5), a
       
   254 		ex		de, hl
       
   255 		ld		a, 30h
       
   256 		ld		b, 4
       
   257 p01loc_576A:
       
   258 		inc		hl
       
   259 		cp		(hl)
       
   260 		jr		nz, p01loc_5772
       
   261 		ld		(hl), 20h
       
   262 		djnz	p01loc_576A
       
   263 p01loc_5772:
       
   264 		ld		hl, OP1
       
   265 		pop		bc
       
   266 Page01_3C81:
       
   267 		push	bc
       
   268 		push	af
       
   269 p01loc_5778:
       
   270 		ld		a, (hl)
       
   271 		or		a
       
   272 		scf
       
   273 		jr		z, p01loc_5791
       
   274 		ld		a, (curRow+1)
       
   275 		cp		0Fh
       
   276 		ld		a, (hl)
       
   277 		jr		c, p01loc_578B
       
   278 		call	PutMap
       
   279 		xor		a
       
   280 		jr		p01loc_5791
       
   281 p01loc_578B:
       
   282 		call	PutC
       
   283 		inc		hl
       
   284 		jr		p01loc_5778
       
   285 p01loc_5791:
       
   286 		pop		bc
       
   287 		ld		a, b
       
   288 		pop		bc
       
   289 		ret
       
   290 
       
   291 PutS:	push	bc
       
   292 		push	af
       
   293 		ld		a, (winTop+1)
       
   294 		ld		b, a
       
   295 p01loc_579B:
       
   296 		ld		a, (hl)
       
   297 		inc		hl
       
   298 		or		a
       
   299 		scf
       
   300 		jr		z, p01loc_57AA
       
   301 		call	PutC
       
   302 		ld		a, (curRow)
       
   303 		cp		b
       
   304 		jr		c, p01loc_579B
       
   305 p01loc_57AA:
       
   306 		pop		bc
       
   307 		ld		a, b
       
   308 		pop		bc
       
   309 		ret
       
   310 
       
   311 putpsb:	ld		b, (hl)
       
   312 		inc		hl
       
   313 		ld		a, b
       
   314 		or		a
       
   315 		ret		z
       
   316 		ld		a, (hl)
       
   317 		cp		20h
       
   318 		jr		z, p01loc_57CB
       
   319 		jr		p01loc_57C8
       
   320 p01loc_57BA:
       
   321 		ld		a, (curRow+1)
       
   322 		cp		0Fh
       
   323 		jr		c, p01loc_57C7
       
   324 		ld		a, (hl)
       
   325 		call	PutMap
       
   326 		jr		p01loc_57CB
       
   327 p01loc_57C7:
       
   328 		ld		a, (hl)
       
   329 p01loc_57C8:
       
   330 		call	PutC
       
   331 p01loc_57CB:
       
   332 		inc		hl
       
   333 		djnz	p01loc_57BA
       
   334 		ret
       
   335 
       
   336 PutPS:	ld		b, (hl)
       
   337 		inc		hl
       
   338 		ld		a, b
       
   339 		or		a
       
   340 		ret		z
       
   341 p01loc_57D4:
       
   342 		ld		a, (hl)
       
   343 		inc		hl
       
   344 		call	PutC
       
   345 		ld		a, (curRow)
       
   346 		ld		c, a
       
   347 		ld		a, (winTop+1)
       
   348 		cp		c
       
   349 		ret		z
       
   350 		djnz	p01loc_57D4
       
   351 		ret
       
   352 
       
   353 wputps:	ld		b, (hl)
       
   354 		inc		hl
       
   355 		ld		a, b
       
   356 		or		a
       
   357 		ret		z
       
   358 p01loc_57EA:
       
   359 		ld		a, (hl)
       
   360 		inc		hl
       
   361 		call	wputc
       
   362 		ret		c
       
   363 		djnz	p01loc_57EA
       
   364 		ret
       
   365 
       
   366 putbuf:	xor		a
       
   367 putbuf1:bit		1, (iy+2Ah)
       
   368 		jr		z, p01loc_57FE
       
   369 		call	j_BCALL_4CC9
       
   370 		ret
       
   371 p01loc_57FE:
       
   372 		push	af
       
   373 		push	de
       
   374 		ld		hl, (editCursor)
       
   375 		ld		de, (editBtm)
       
   376 		call	CpHLDE
       
   377 		jr		nz, p01loc_5824
       
   378 		ld		a, (mcxCurApp)
       
   379 		cp		42h
       
   380 		jr		nz, p01loc_5824
       
   381 		ld		a, (curRow)
       
   382 		or		a
       
   383 		jr		nz, p01loc_5824
       
   384 		pop		de
       
   385 		ld		a, e
       
   386 		call	PutMap
       
   387 		call	j_BufLeft
       
   388 		ld		a, e
       
   389 		pop		bc
       
   390 		ret
       
   391 p01loc_5824:
       
   392 		pop		de
       
   393 		call	GETTOKSTRING
       
   394 		push	hl
       
   395 		ld		b, (hl)
       
   396 		inc		b
       
   397 		ld		hl, curCol
       
   398 		ld		a, 10h
       
   399 		push	af
       
   400 		sub		(hl)
       
   401 		cp		b
       
   402 		jr		c, p01loc_583C
       
   403 		pop		af
       
   404 		pop		hl
       
   405 		ld		a, (curRow+1)
       
   406 		jr		p01loc_585F
       
   407 p01loc_583C:
       
   408 		pop		af
       
   409 		sub		b
       
   410 		ld		(hl), a
       
   411 		pop		hl
       
   412 		push	af
       
   413 		ld		c, a
       
   414 		ld		a, (winLeftEdge)
       
   415 		inc		c
       
   416 		cp		c
       
   417 		jr		c, p01loc_5860
       
   418 		pop		hl
       
   419 p01loc_584A:
       
   420 		pop		de
       
   421 		ld		a, 0Eh
       
   422 		ld		(curRow+1), a
       
   423 		call	fdispEOL
       
   424 		ld		a, 0Eh
       
   425 		ld		(curRow+1), a
       
   426 		call	j_FDISPBOL
       
   427 		ld		a, 0Eh
       
   428 		jr		p01loc_5893
       
   429 p01loc_585F:
       
   430 		push	af
       
   431 p01loc_5860:
       
   432 		push	hl
       
   433 		call	PutPS
       
   434 		call	fdispEOL
       
   435 		pop		hl
       
   436 		pop		bc
       
   437 		ld		a, (curRow+1)
       
   438 		bit		1, (iy+0Eh)
       
   439 		jr		z, p01loc_5889
       
   440 		cp		0Fh
       
   441 		jr		nz, p01loc_5889
       
   442 		ld		c, a
       
   443 		pop		af
       
   444 		ld		a, c
       
   445 		jr		c, p01loc_588A
       
   446 		push	af
       
   447 		ld		a, (winLeftEdge)
       
   448 		cp		b
       
   449 		jr		z, p01loc_584A
       
   450 		ld		a, b
       
   451 		dec		a
       
   452 		ld		(curRow+1), a
       
   453 		jr		p01loc_585F
       
   454 p01loc_5889:
       
   455 		pop		de
       
   456 p01loc_588A:
       
   457 		push	af
       
   458 		ld		a, b
       
   459 		ld		(curRow+1), a
       
   460 		call	j_FDISPBOL1
       
   461 		pop		af
       
   462 p01loc_5893:
       
   463 		ld		(curRow+1), a
       
   464 		ret
       
   465 
       
   466 wputc:	push	bc
       
   467 		push	de
       
   468 		push	hl
       
   469 		ld		c, a
       
   470 		ld		hl, (winRow)
       
   471 		ld		de, (winAbove)
       
   472 		or		a
       
   473 		sbc		hl, de
       
   474 		jp		p, p01loc_58AE
       
   475 p01loc_58A8:
       
   476 		set		2, (iy+0Eh)
       
   477 		jr		p01loc_5910
       
   478 p01loc_58AE:
       
   479 		ld		a, (winTop+1)
       
   480 		ld		e, a
       
   481 		ld		d, 0
       
   482 		call	CpHLDE
       
   483 		jr		c, p01loc_58C0
       
   484 		scf
       
   485 		set		3, (iy+0Eh)
       
   486 		jr		p01loc_5910
       
   487 p01loc_58C0:
       
   488 		ld		a, l
       
   489 		ld		hl, winTop
       
   490 		cp		(hl)
       
   491 		jr		c, p01loc_58A8
       
   492 		ld		(curRow), a
       
   493 		ld		hl, (winLeft)
       
   494 		ld		a, (winLeftEdge)
       
   495 		ld		e, a
       
   496 		add		hl, de
       
   497 		ex		de, hl
       
   498 		ld		hl, (winCol)
       
   499 		call	CpHLDE
       
   500 		jp		m, p01loc_5914
       
   501 		ld		hl, (winLeft)
       
   502 		ld		de, 10h
       
   503 		add		hl, de
       
   504 		ex		de, hl
       
   505 		ld		hl, (winCol)
       
   506 		call	CpHLDE
       
   507 		jp		p, p01loc_5928
       
   508 		ld		de, (winLeft)
       
   509 		or		a
       
   510 		sbc		hl, de
       
   511 		ld		a, l
       
   512 		ld		hl, winLeftEdge
       
   513 		cp		(hl)
       
   514 		jr		nz, p01loc_5901
       
   515 		bit		0, (iy+0Eh)
       
   516 		jr		nz, p01loc_5909
       
   517 p01loc_5901:
       
   518 		ld		(curRow+1), a
       
   519 		ld		a, c
       
   520 		call	PutC
       
   521 		or		a
       
   522 p01loc_5909:
       
   523 		ld		hl, (winCol)
       
   524 		inc		hl
       
   525 		ld		(winCol), hl
       
   526 p01loc_5910:
       
   527 		pop		hl
       
   528 		pop		de
       
   529 		pop		bc
       
   530 		ret
       
   531 p01loc_5914:
       
   532 		or		a
       
   533 		bit		0, (iy+0Eh)
       
   534 		jr		nz, p01loc_5909
       
   535 		set		0, (iy+0Eh)
       
   536 		set		4, (iy+0Eh)
       
   537 		ld		a, (winLeftEdge)
       
   538 		jr		p01loc_5939
       
   539 p01loc_5928:
       
   540 		scf
       
   541 		bit		1, (iy+0Eh)
       
   542 		jr		nz, p01loc_5909
       
   543 		set		1, (iy+0Eh)
       
   544 		set		5, (iy+0Eh)
       
   545 		ld		a, 0Fh
       
   546 p01loc_5939:
       
   547 		ld		(curRow+1), a
       
   548 		ld		a, 0CEh
       
   549 		call	PutMap
       
   550 		jr		p01loc_5909
       
   551 
       
   552 wputs:	ld		de, (curRow)
       
   553 		push	de
       
   554 p01loc_5948:
       
   555 		ld		a, (hl)
       
   556 		or		a
       
   557 		jr		z, p01loc_5952
       
   558 		call	wputc
       
   559 		inc		hl
       
   560 		jr		nc, p01loc_5948
       
   561 p01loc_5952:
       
   562 		pop		hl
       
   563 		ld		(curRow), hl
       
   564 		ret
       
   565 
       
   566 wputsEOL:
       
   567 		ld		de, (curRow)
       
   568 		push	de
       
   569 p01loc_595C:
       
   570 		ld		a, (hl)
       
   571 		or		a
       
   572 		jr		z, p01loc_5968
       
   573 		call	wputc
       
   574 		inc		hl
       
   575 		jr		nc, p01loc_595C
       
   576 		jr		p01loc_596F
       
   577 p01loc_5968:
       
   578 		ld		a, (curRow+1)
       
   579 		or		a
       
   580 		call	nz, EraseEOL
       
   581 p01loc_596F:
       
   582 		pop		hl
       
   583 		ld		(curRow), hl
       
   584 		ret
       
   585 
       
   586 wdispEOL:
       
   587 		ld		hl, (curRow)
       
   588 		push	hl
       
   589 		ld		hl, (editTail)
       
   590 		ld		de, (editBtm)
       
   591 p01loc_597F:
       
   592 		call	CpHLDE
       
   593 		jr		z, p01loc_598D
       
   594 		ld		a, (hl)
       
   595 		call	wputc
       
   596 		inc		hl
       
   597 		jr		nc, p01loc_597F
       
   598 		jr		p01loc_5994
       
   599 p01loc_598D:
       
   600 		ld		a, (curRow+1)
       
   601 		or		a
       
   602 		call	nz, EraseEOL
       
   603 p01loc_5994:
       
   604 		pop		hl
       
   605 		ld		(curRow), hl
       
   606 		ret
       
   607 
       
   608 whomeup:ld		hl, 0
       
   609 		call	CheckSplitFlag
       
   610 		jr		z, p01loc_59A3
       
   611 		ld		l, 4
       
   612 p01loc_59A3:
       
   613 		ld		(winRow), hl
       
   614 		ld		l, 0
       
   615 		ld		(winCol), hl
       
   616 		ret
       
   617 
       
   618 setNumWindow:
       
   619 		call	whomeup
       
   620 		ld		a, (curRow)
       
   621 		call	j_setwinabove
       
   622 		ld		a, (curRow+1)
       
   623 		ld		(winLeftEdge), a
       
   624 		ld		e, a
       
   625 		ld		hl, 0
       
   626 		or		a
       
   627 		sbc		hl, de
       
   628 		ld		(winLeft), hl
       
   629 		res		1, (iy+0Eh)
       
   630 		res		0, (iy+0Eh)
       
   631 		ret
       
   632 		push	de
       
   633 		push	hl
       
   634 		ld		l, a
       
   635 		ld		h, 0
       
   636 		add		hl, hl
       
   637 		add		hl, hl
       
   638 		add		hl, hl
       
   639 		call	j_Load_SFont
       
   640 		ld		a, (hl)
       
   641 		pop		hl
       
   642 		pop		de
       
   643 		ret
       
   644 
       
   645 Page01_3CCF:
       
   646 		push	hl
       
   647 		ld		a, (curRow)
       
   648 		ld		hl, winBtm
       
   649 		cp		(hl)
       
   650 		pop		hl
       
   651 		ret
       
   652 
       
   653 newline:push	af
       
   654 		push	bc
       
   655 		push	de
       
   656 		push	hl
       
   657 		push	ix
       
   658 		sub		a
       
   659 		ld		(curRow+1), a
       
   660 		ld		hl, curRow
       
   661 		ld		ix, winTop
       
   662 		ld		a, (hl)
       
   663 		inc		a
       
   664 		cp		(ix+1)
       
   665 		jr		c, p01loc_5A3B
       
   666 		bit		appAutoScroll, (iy+appFlags)
       
   667 		jr		z, p01loc_5A3B
       
   668 		set		textScrolled, (iy+textFlags)
       
   669 		call	j_SCREENUP
       
   670 		ld		a, e
       
   671 		call	ClearRow
       
   672 		ei
       
   673 		bit		appTextSave, (iy+appFlags)
       
   674 		jr		z, p01loc_5A3C
       
   675 		ld		a, (ix+0)
       
   676 		call	ATimes16
       
   677 		ld		l, a
       
   678 		ld		h, 0
       
   679 		ld		de, textShadow
       
   680 		add		hl, de
       
   681 		ld		e, l
       
   682 		ld		d, h
       
   683 		ld		bc, 10h
       
   684 		add		hl, bc
       
   685 		call	p01sub_5B68
       
   686 		jr		z, p01loc_5A31
       
   687 		ldir
       
   688 p01loc_5A31:
       
   689 		ld		b, 10h
       
   690 		ld		a, 20h
       
   691 p01loc_5A35:
       
   692 		ld		(de), a
       
   693 		inc		de
       
   694 		djnz	p01loc_5A35
       
   695 		jr		p01loc_5A3C
       
   696 p01loc_5A3B:
       
   697 		ld		(hl), a
       
   698 p01loc_5A3C:
       
   699 		jp		p01loc_56A1
       
   700 
       
   701 p01sub_5A3F:
       
   702 		push	af
       
   703 		push	de
       
   704 		push	hl
       
   705 		ld		a, 0Fh
       
   706 		ld		(curRow+1), a
       
   707 		ld		de, curRow
       
   708 		ld		a, (de)
       
   709 		dec		a
       
   710 		ld		hl, winTop
       
   711 		cp		(hl)
       
   712 		jp		p, p01loc_5A5E
       
   713 		bit		appAutoScroll, (iy+appFlags)
       
   714 		jr		z, p01loc_5A5E
       
   715 		call	scrollDown
       
   716 		jr		p01loc_5A5F
       
   717 p01loc_5A5E:
       
   718 		ld		(de), a
       
   719 p01loc_5A5F:
       
   720 		pop		hl
       
   721 		pop		de
       
   722 		pop		af
       
   723 		ret
       
   724 
       
   725 moveDown:
       
   726 		ld		a, (curRow)
       
   727 		inc		a
       
   728 		ld		hl, winBtm
       
   729 		cp		(hl)
       
   730 		jr		nc, scrollUp
       
   731 		ld		(curRow), a
       
   732 		ret
       
   733 
       
   734 scrollUp:
       
   735 		push	af
       
   736 		push	bc
       
   737 		push	de
       
   738 		push	hl
       
   739 		push	ix
       
   740 		ld		ix, winTop
       
   741 		call	j_SCREENUP
       
   742 		ld		a, e
       
   743 		call	ClearRow
       
   744 		ei
       
   745 		bit		appTextSave, (iy+appFlags)
       
   746 		jp		z, p01loc_56A1
       
   747 		ld		a, (ix+0)
       
   748 		call	ATimes16
       
   749 		ld		l, a
       
   750 		ld		h, 0
       
   751 		ld		de, textShadow
       
   752 		add		hl, de
       
   753 		ld		e, l
       
   754 		ld		d, h
       
   755 		ld		bc, 10h
       
   756 		add		hl, bc
       
   757 		call	p01sub_5B68
       
   758 		jr		z, p01loc_5AA4
       
   759 		ldir
       
   760 p01loc_5AA4:
       
   761 		ld		b, 10h
       
   762 		ld		a, 20h
       
   763 p01loc_5AA8:
       
   764 		ld		(de), a
       
   765 		inc		de
       
   766 		djnz	p01loc_5AA8
       
   767 		jp		p01loc_56A1
       
   768 
       
   769 shrinkWindow:
       
   770 		ld		a, (curRow)
       
   771 		add		a, b
       
   772 		sub		7
       
   773 		cp		1
       
   774 		ret		m
       
   775 		ld		b, a
       
   776 		ld		hl, curRow
       
   777 p01loc_5ABC:
       
   778 		call	scrollUp
       
   779 		dec		(hl)
       
   780 		djnz	p01loc_5ABC
       
   781 		ret
       
   782 
       
   783 moveUp:	ld		a, (curRow)
       
   784 		dec		a
       
   785 		ld		hl, winTop
       
   786 		cp		(hl)
       
   787 		jp		m, scrollDown
       
   788 		ld		(curRow), a
       
   789 		ret
       
   790 
       
   791 p01sub_5AD2:
       
   792 		push	af
       
   793 		push	bc
       
   794 		push	de
       
   795 		push	hl
       
   796 		push	ix
       
   797 		ld		hl, winBtm
       
   798 		cp		(hl)
       
   799 		jr		nz, p01loc_5AE8
       
   800 		call	scrollUp
       
   801 		ld		hl, curRow
       
   802 		dec		(hl)
       
   803 		jp		p01loc_56A1
       
   804 p01loc_5AE8:
       
   805 		ld		hl, winTop
       
   806 		ld		b, (hl)
       
   807 		push	bc
       
   808 		ld		(hl), a
       
   809 		call	scrollDown
       
   810 		pop		af
       
   811 		ld		(hl), a
       
   812 		jp		p01loc_56A1
       
   813 
       
   814 scrollDown:
       
   815 		push	af
       
   816 		push	bc
       
   817 		push	de
       
   818 		push	hl
       
   819 		push	ix
       
   820 		call	RunIndicOff
       
   821 		set		textScrolled, (iy+textFlags)
       
   822 		ld		ix, winTop
       
   823 		ld		a, (ix+1)
       
   824 		sub		(ix+0)
       
   825 		dec		a
       
   826 		jr		nz, p01loc_5B19
       
   827 		ld		a, (ix+1)
       
   828 		dec		a
       
   829 		call	MAKEROWCMD
       
   830 		jr		p01loc_5B24
       
   831 p01loc_5B19:
       
   832 		ld		b, a
       
   833 		ld		c, 0F8h
       
   834 		ld		a, (ix+1)
       
   835 		dec		a
       
   836 		call	j_ScreenUpDown
       
   837 		ld		a, e
       
   838 p01loc_5B24:
       
   839 		call	ClearRow
       
   840 		ei
       
   841 		call	RunIndicOn
       
   842 		bit		appTextSave, (iy+appFlags)
       
   843 		jr		z, p01loc_5B53
       
   844 		ld		a, (ix+1)
       
   845 		call	ATimes16
       
   846 		ld		l, a
       
   847 		ld		h, 0
       
   848 		ld		de, asm_ind_call
       
   849 		add		hl, de
       
   850 		ld		e, l
       
   851 		ld		d, h
       
   852 		ld		bc, 0FFF0h
       
   853 		add		hl, bc
       
   854 		call	p01sub_5B68
       
   855 		jr		z, p01loc_5B4B
       
   856 		lddr
       
   857 p01loc_5B4B:
       
   858 		ld		b, 10h
       
   859 		ld		a, 20h
       
   860 p01loc_5B4F:
       
   861 		ld		(de), a
       
   862 		dec		de
       
   863 		djnz	p01loc_5B4F
       
   864 p01loc_5B53:
       
   865 		jp		p01loc_56A1
       
   866 
       
   867 #ifndef DEVIATE_FROM_ORIGINAL_FILE
       
   868 ;Apparently not referenced anywhere.
       
   869 		ld		a, (ix+1)
       
   870 		sub		(ix+0)
       
   871 		dec		a
       
   872 		push	hl
       
   873 		push	de
       
   874 		ld		b, a
       
   875 		call	p01sub_6100
       
   876 		ld		b, h
       
   877 		ld		c, l
       
   878 		pop		de
       
   879 		pop		hl
       
   880 		ret
       
   881 #endif
       
   882 
       
   883 p01sub_5B68:
       
   884 		ld		a, (ix+1)
       
   885 		sub		(ix+0)
       
   886 		dec		a
       
   887 		call	ATimes16
       
   888 		ld		c, a
       
   889 		ld		b, 0
       
   890 		ret
       
   891 
       
   892 ClrLCDFull:
       
   893 		push	af
       
   894 		ld		hl, 8A02h
       
   895 		push	hl
       
   896 		ld		a, (hl)
       
   897 		and		1
       
   898 		push	af
       
   899 		res		0, (hl)
       
   900 		ld		b, 80h
       
   901 		ld		a, 0B8h
       
   902 		jr		p01loc_5BAB
       
   903 
       
   904 ClrLCD:	push	af
       
   905 		ld		hl, 8A02h
       
   906 		push	hl
       
   907 		ld		a, (hl)
       
   908 		and		1
       
   909 		push	af
       
   910 		res		0, (hl)
       
   911 		ld		a, 0B8h
       
   912 		push	af
       
   913 		ld		b, 80h
       
   914 		call	CheckSplitFlag
       
   915 		jr		z, p01loc_5BAA
       
   916 		ld		b, 0A0h
       
   917 		bit		plotDisp, (iy+plotFlags)
       
   918 		jr		z, p01loc_5BAA
       
   919 		pop		af
       
   920 		ld		a, 98h
       
   921 		ld		b, 80h
       
   922 		push	af
       
   923 p01loc_5BAA:
       
   924 		pop		af
       
   925 p01loc_5BAB:
       
   926 		di
       
   927 p01loc_5BAC:
       
   928 		push	bc
       
   929 		push	af
       
   930 		call	ClearRow
       
   931 		pop		af
       
   932 		sub		8
       
   933 		pop		bc
       
   934 		cp		b
       
   935 		jr		nc, p01loc_5BAC
       
   936 		ei
       
   937 		pop		af
       
   938 		pop		hl
       
   939 		or		(hl)
       
   940 		ld		(hl), a
       
   941 		pop		af
       
   942 		ret
       
   943 
       
   944 p01sub_5BBF:
       
   945 		push	af
       
   946 		ld		a, i
       
   947 		push	af
       
   948 		ld		hl, 8A02h
       
   949 		push	hl
       
   950 		ld		a, (hl)
       
   951 		and		1
       
   952 		push	af
       
   953 		res		0, (hl)
       
   954 		ld		a, 0B8h
       
   955 		ld		b, 80h
       
   956 		di
       
   957 p01loc_5BD2:
       
   958 		push	bc
       
   959 		push	af
       
   960 		call	ClearRow
       
   961 		pop		af
       
   962 		sub		8
       
   963 		pop		bc
       
   964 		cp		b
       
   965 		jr		nc, p01loc_5BD2
       
   966 		pop		af
       
   967 		pop		hl
       
   968 		or		(hl)
       
   969 		ld		(hl), a
       
   970 		pop		af
       
   971 		jp		po, p01loc_5BE7
       
   972 		ei
       
   973 p01loc_5BE7:
       
   974 		pop		af
       
   975 		ret
       
   976 
       
   977 Page01_3D05:
       
   978 		call	p01sub_5BBF
       
   979 		jr		p01loc_5BF6
       
   980 
       
   981 ClrScrnFull:
       
   982 		call	ClrLCDFull
       
   983 		jr		p01loc_5BF6
       
   984 
       
   985 ClrScrn:
       
   986 		call	ClrLCD
       
   987 p01loc_5BF6:
       
   988 		bit		appTextSave, (iy+appFlags)
       
   989 		ret		z
       
   990 ClrTxtShd:
       
   991 		ld		bc, 7Fh
       
   992 		ld		de, 8509h
       
   993 		ld		hl, textShadow
       
   994 		ld		(hl), 20h
       
   995 		ldir
       
   996 		ret
       
   997 
       
   998 ClrWindow:
       
   999 		call	HomeUp
       
  1000 		ld		a, (winTop+1)
       
  1001 		dec		a
       
  1002 		call	MAKEROWCMD
       
  1003 		push	af
       
  1004 		ld		a, (winTop)
       
  1005 		call	MAKEROWCMD
       
  1006 		di
       
  1007 
       
  1008 p01loc_5C1B:
       
  1009 		call	ClearRow
       
  1010 		pop		af
       
  1011 		cp		d
       
  1012 		jr		z, p01loc_5C28
       
  1013 		push	af
       
  1014 		ld		a, d
       
  1015 		add		a, 8
       
  1016 		jr		p01loc_5C1B
       
  1017 
       
  1018 p01loc_5C28:
       
  1019 		ei
       
  1020 		bit		appTextSave, (iy+appFlags)
       
  1021 		ret		z
       
  1022 		ld		a, (winTop)
       
  1023 		ld		b, a
       
  1024 		ld		a, (winTop+1)
       
  1025 		sub		b
       
  1026 		call	ATimes16
       
  1027 		dec		a
       
  1028 		ld		c, a
       
  1029 		ld		a, (winTop)
       
  1030 		call	ATimes16
       
  1031 		ld		l, a
       
  1032 		ld		h, 0
       
  1033 		ld		b, h
       
  1034 		ld		de, textShadow
       
  1035 		add		hl, de
       
  1036 		ld		e, l
       
  1037 		ld		d, h
       
  1038 		inc		de
       
  1039 		ld		(hl), 20h
       
  1040 		ldir
       
  1041 		ret
       
  1042 
       
  1043 EraseEOL:
       
  1044 		push	af
       
  1045 		bit		1, (iy+2Ah)
       
  1046 		jr		z, p01loc_5C5D
       
  1047 		pop		af
       
  1048 		call	j_VEraseEOL
       
  1049 		ret
       
  1050 p01loc_5C5D:
       
  1051 		push	bc
       
  1052 		push	de
       
  1053 		push	hl
       
  1054 		ld		a, (curRow+1)
       
  1055 		push	af
       
  1056 		sub		10h
       
  1057 		jr		nc, p01loc_5C79
       
  1058 		neg
       
  1059 		ld		b, a
       
  1060 		ld		a, 20h
       
  1061 		dec		b
       
  1062 		jr		z, p01loc_5C75
       
  1063 p01loc_5C70:
       
  1064 		call	PutC
       
  1065 		djnz	p01loc_5C70
       
  1066 p01loc_5C75:
       
  1067 		call	PutMap
       
  1068 		ei
       
  1069 p01loc_5C79:
       
  1070 		pop		af
       
  1071 		ld		(curRow+1), a
       
  1072 		jp		p01loc_56A3
       
  1073 
       
  1074 EraseEOW:
       
  1075 		push	af
       
  1076 		push	hl
       
  1077 		ld		hl, (curRow)
       
  1078 		push	hl
       
  1079 		ld		a, l
       
  1080 		ld		hl, winBtm
       
  1081 		sub		(hl)
       
  1082 		jr		z, p01loc_5C98
       
  1083 p01loc_5C8D:
       
  1084 		call	EraseEOL
       
  1085 		inc		a
       
  1086 		jr		z, p01loc_5C98
       
  1087 		call	newline
       
  1088 		jr		p01loc_5C8D
       
  1089 p01loc_5C98:
       
  1090 		pop		hl
       
  1091 		ld		(curRow), hl
       
  1092 		pop		hl
       
  1093 		pop		af
       
  1094 		ret
       
  1095 
       
  1096 HomeUp:	push	hl
       
  1097 		ld		hl, (winTop)
       
  1098 		ld		h, 0
       
  1099 		ld		(curRow), hl
       
  1100 		pop		hl
       
  1101 		ret
       
  1102 
       
  1103 getcurloc:
       
  1104 		push	af
       
  1105 		push	bc
       
  1106 		push	de
       
  1107 		ld		hl, (curRow)
       
  1108 		ld		a, l
       
  1109 		call	ATimes16
       
  1110 		add		a, h
       
  1111 		ld		l, a
       
  1112 		ld		h, 0
       
  1113 		ld		de, textShadow
       
  1114 		add		hl, de
       
  1115 		pop		de
       
  1116 		pop		bc
       
  1117 		pop		af
       
  1118 		ret
       
  1119 
       
  1120 VPutMapRec:
       
  1121 		call	p01sub_5CCC
       
  1122 		res		6, (iy+32h)
       
  1123 		res		fracDrawLFont, (iy+fontFlags)
       
  1124 		ret
       
  1125 
       
  1126 p01sub_5CCC:
       
  1127 		push	bc
       
  1128 		ld		b, a
       
  1129 		ld		a, i
       
  1130 		push	af
       
  1131 		ld		a, b
       
  1132 		di
       
  1133 		push	hl
       
  1134 		res		fracDrawLFont, (iy+fontFlags)
       
  1135 		cp		8
       
  1136 		jr		z, p01loc_5D19
       
  1137 		res		fracDrawLFont, (iy+fontFlags)
       
  1138 		jr		p01loc_5D19
       
  1139 
       
  1140 LoadPattern:
       
  1141 		ld		l, a
       
  1142 		ld		h, 0
       
  1143 		add		hl, hl
       
  1144 		add		hl, hl
       
  1145 		add		hl, hl
       
  1146 		bit		fracDrawLFont, (iy+fontFlags)
       
  1147 		jr		z, p01loc_5CF2
       
  1148 		call	Page0Call_3C03
       
  1149 		ret
       
  1150 
       
  1151 p01loc_5CF2:
       
  1152 		bit		6, (iy+32h)
       
  1153 		jr		z, p01loc_5D0A
       
  1154 		call	Page0Call_3BC7
       
  1155 		ld		de, 8461h
       
  1156 		ld		hl, 8460h
       
  1157 		ld		bc, 7
       
  1158 		lddr
       
  1159 		ex		de, hl
       
  1160 		ld		(hl), 5
       
  1161 		ret
       
  1162 
       
  1163 p01loc_5D0A:
       
  1164 		call	j_Load_SFont
       
  1165 		ret
       
  1166 
       
  1167 VPutMap:push	bc
       
  1168 		ld		b, a
       
  1169 		ld		a, i
       
  1170 		push	af
       
  1171 		ld		a, b
       
  1172 		di
       
  1173 		push	hl
       
  1174 		call	LoadPattern
       
  1175 p01loc_5D19:
       
  1176 		push	hl
       
  1177 		pop		ix
       
  1178 		ld		e, (ix+0)
       
  1179 		ld		d, 0
       
  1180 		ld		hl, LCDTable-1
       
  1181 		add		hl, de
       
  1182 		ld		d, (hl)
       
  1183 		push	de
       
  1184 		ld		a, (penCol+1)
       
  1185 		ld		b, a
       
  1186 		or		80h
       
  1187 		ld		(curXRow), a
       
  1188 		call	p01sub_55E5
       
  1189 		call	SetXUp
       
  1190 		call	p01sub_6100
       
  1191 		ld		a, (penCol)
       
  1192 		ld		e, a
       
  1193 		srl	a
       
  1194 		srl	a
       
  1195 		srl	a
       
  1196 		or		20h
       
  1197 		ld		(curY), a
       
  1198 		call	lcd_busy
       
  1199 		out		(10h), a
       
  1200 		ld		d, 0
       
  1201 		add		hl, de
       
  1202 		ld		a, e
       
  1203 		pop		de
       
  1204 		add		a, e
       
  1205 		bit		write_on_graph, (iy+sGrFlags)
       
  1206 		jr		z, p01loc_5D6C
       
  1207 		call	Bit_VertSplit
       
  1208 		jr		z, p01loc_5D6C
       
  1209 		bit		3, (iy+11h)
       
  1210 		jr		nz, p01loc_5D68
       
  1211 		cp		30h
       
  1212 		jr		p01loc_5D82
       
  1213 p01loc_5D68:
       
  1214 		cp		17h
       
  1215 		jr		p01loc_5D82
       
  1216 p01loc_5D6C:
       
  1217 		bit		3, (iy+11h)
       
  1218 		jr		z, p01loc_5D76
       
  1219 		cp		30h
       
  1220 		jr		p01loc_5D82
       
  1221 p01loc_5D76:
       
  1222 		bit		4, (iy+24h)
       
  1223 		jr		z, p01loc_5D80
       
  1224 		cp		61h
       
  1225 		jr		p01loc_5D82
       
  1226 p01loc_5D80:
       
  1227 		cp		60h
       
  1228 p01loc_5D82:
       
  1229 		ccf
       
  1230 		jp		c, p01loc_5E78
       
  1231 		push	de
       
  1232 		ld		(penCol), a
       
  1233 		ld		a, l
       
  1234 		and		7
       
  1235 		ld		c, a
       
  1236 		srl	h
       
  1237 		rr	l
       
  1238 		srl	h
       
  1239 		rr	l
       
  1240 		srl	h
       
  1241 		rr	l
       
  1242 		ld		de, plotSScreen
       
  1243 		add		hl, de
       
  1244 		pop		de
       
  1245 		ld		a, (customHeight)
       
  1246 		ld		b, a
       
  1247 		bit		customFont, (iy+fontFlags)
       
  1248 		jr		nz, p01loc_5DC0
       
  1249 		ld		b, 7
       
  1250 		bit		6, (iy+32h)
       
  1251 		jr		nz, p01loc_5DC0
       
  1252 		bit		fracDrawLFont, (iy+fontFlags)
       
  1253 		jr		nz, p01loc_5DBF
       
  1254 		ld		b, 6
       
  1255 		bit		textEraseBelow, (iy+textFlags)
       
  1256 		jr		z, p01loc_5DC0
       
  1257 p01loc_5DBF:
       
  1258 		inc		b
       
  1259 p01loc_5DC0:
       
  1260 		ld		a, 8
       
  1261 		sub		c
       
  1262 		sub		(ix+0)
       
  1263 		inc		ix
       
  1264 		jp		m, p01loc_5E0E
       
  1265 		ld		c, a
       
  1266 		inc		c
       
  1267 p01loc_5DCD:
       
  1268 		push	bc
       
  1269 		ld		b, c
       
  1270 		ld		a, (hl)
       
  1271 		bit		textWrite, (iy+sGrFlags)
       
  1272 		call	z, sOK
       
  1273 		jr		p01loc_5DDA
       
  1274 p01loc_5DD9:
       
  1275 		rrca
       
  1276 p01loc_5DDA:
       
  1277 		djnz	p01loc_5DD9
       
  1278 		call	p01sub_5E81
       
  1279 		jr		p01loc_5DE2
       
  1280 p01loc_5DE1:
       
  1281 		rlca
       
  1282 p01loc_5DE2:
       
  1283 		djnz	p01loc_5DE1
       
  1284 		bit		textWrite, (iy+sGrFlags)
       
  1285 		jr		z, p01loc_5DF4
       
  1286 		ld		(hl), a
       
  1287 		push	de
       
  1288 		ld		de, 0Ch
       
  1289 		add		hl, de
       
  1290 		pop		de
       
  1291 		pop		bc
       
  1292 		jr		p01loc_5E03
       
  1293 p01loc_5DF4:
       
  1294 		call	lcd_busy
       
  1295 		out		(11h), a
       
  1296 		ld		hl, curXRow
       
  1297 		inc		(hl)
       
  1298 		pop		bc
       
  1299 		ld		a, (hl)
       
  1300 		cp		0C0h
       
  1301 		jr		nc, p01loc_5E05
       
  1302 p01loc_5E03:
       
  1303 		djnz	p01loc_5DCD
       
  1304 p01loc_5E05:
       
  1305 		pop		hl
       
  1306 		pop		af
       
  1307 		jp		po, p01loc_5E0B
       
  1308 		ei
       
  1309 p01loc_5E0B:
       
  1310 		pop		bc
       
  1311 		xor		a
       
  1312 		ret
       
  1313 p01loc_5E0E:
       
  1314 		neg
       
  1315 		ld		c, a
       
  1316 p01loc_5E11:
       
  1317 		push	bc
       
  1318 		ld		b, c
       
  1319 		bit		textWrite, (iy+sGrFlags)
       
  1320 		jr		z, p01loc_5E1E
       
  1321 		ld		a, (hl)
       
  1322 		inc		hl
       
  1323 		ld		e, (hl)
       
  1324 		jr		p01loc_5E30
       
  1325 p01loc_5E1E:
       
  1326 		call	sOK
       
  1327 		push	af
       
  1328 		ld		a, (curY)
       
  1329 		inc		a
       
  1330 		call	lcd_busy
       
  1331 		out		(10h), a
       
  1332 		call	sOK
       
  1333 		ld		e, a
       
  1334 		pop		af
       
  1335 p01loc_5E30:
       
  1336 		sla	e
       
  1337 		rla
       
  1338 		jr		nc, p01loc_5E36
       
  1339 		inc		e
       
  1340 p01loc_5E36:
       
  1341 		djnz	p01loc_5E30
       
  1342 		call	p01sub_5E81
       
  1343 p01loc_5E3B:
       
  1344 		srl	a
       
  1345 		rr	e
       
  1346 		jr		nc, p01loc_5E43
       
  1347 		add		a, 80h
       
  1348 p01loc_5E43:
       
  1349 		djnz	p01loc_5E3B
       
  1350 		bit		textWrite, (iy+sGrFlags)
       
  1351 		jr		z, p01loc_5E57
       
  1352 		ld		(hl), e
       
  1353 		dec		hl
       
  1354 		ld		(hl), a
       
  1355 		push	de
       
  1356 		ld		de, 0Ch
       
  1357 		add		hl, de
       
  1358 		pop		de
       
  1359 		pop		bc
       
  1360 		jr		p01loc_5E74
       
  1361 p01loc_5E57:
       
  1362 		push	af
       
  1363 		ld		a, e
       
  1364 		call	p01sub_55B5
       
  1365 		ld		a, (curY)
       
  1366 		call	lcd_busy
       
  1367 		out		(10h), a
       
  1368 		pop		af
       
  1369 		call	lcd_busy
       
  1370 		out		(11h), a
       
  1371 		ld		hl, curXRow
       
  1372 		inc		(hl)
       
  1373 		pop		bc
       
  1374 		ld		a, (hl)
       
  1375 		cp		0C0h
       
  1376 		jr		nc, p01loc_5E05
       
  1377 p01loc_5E74:
       
  1378 		djnz	p01loc_5E11
       
  1379 		jr		p01loc_5E05
       
  1380 p01loc_5E78:
       
  1381 		pop		hl
       
  1382 		pop		af
       
  1383 		jp		po, p01loc_5E7E
       
  1384 		ei
       
  1385 p01loc_5E7E:
       
  1386 		pop		bc
       
  1387 		scf
       
  1388 		ret
       
  1389 
       
  1390 p01sub_5E81:
       
  1391 		bit		textInverse, (iy+textFlags)
       
  1392 		jr		z, p01loc_5E8E
       
  1393 		ld		b, a
       
  1394 		ld		a, 0FFh
       
  1395 		xor		d
       
  1396 		or		b
       
  1397 		jr		p01loc_5E8F
       
  1398 p01loc_5E8E:
       
  1399 		and		d
       
  1400 p01loc_5E8F:
       
  1401 		xor		(ix+0)
       
  1402 		inc		ix
       
  1403 		ld		b, c
       
  1404 		ret
       
  1405 
       
  1406 LCDTable:
       
  1407 		.db		0FEh
       
  1408 		.db		0FCh
       
  1409 		.db		0F8h
       
  1410 		.db		0F0h
       
  1411 		.db		0E0h
       
  1412 		.db		0C0h
       
  1413 
       
  1414 VPutS:	push	af
       
  1415 		push	de
       
  1416 		push	ix
       
  1417 p01loc_5EA0:
       
  1418 		ld		a, (hl)
       
  1419 		inc		hl
       
  1420 		or		a
       
  1421 		jr		z, p01loc_5EAA
       
  1422 		call	VPutMap
       
  1423 		jr		nc, p01loc_5EA0
       
  1424 p01loc_5EAA:
       
  1425 		pop		ix
       
  1426 		pop		de
       
  1427 		pop		af
       
  1428 		ret
       
  1429 
       
  1430 VPutSN:	push	af
       
  1431 		push	de
       
  1432 		push	ix
       
  1433 p01loc_5EB3:
       
  1434 		ld		a, (hl)
       
  1435 		inc		hl
       
  1436 		call	VPutMap
       
  1437 		jr		c, p01loc_5EBC
       
  1438 		djnz	p01loc_5EB3
       
  1439 p01loc_5EBC:
       
  1440 		pop		ix
       
  1441 		pop		de
       
  1442 		pop		af
       
  1443 		ret
       
  1444 
       
  1445 vputsnG:scf
       
  1446 		push	af
       
  1447 		push	de
       
  1448 		push	ix
       
  1449 p01loc_5EC6:
       
  1450 		bit		4, (iy+11h)
       
  1451 		jr		z, p01loc_5F15
       
  1452 		ld		a, (hl)
       
  1453 		push	hl
       
  1454 		push	bc
       
  1455 		ld		l, a
       
  1456 		ld		h, 0
       
  1457 		add		hl, hl
       
  1458 		add		hl, hl
       
  1459 		add		hl, hl
       
  1460 		call	j_SFont_Len
       
  1461 		ld		a, (penCol)
       
  1462 		add		a, b
       
  1463 		call	Bit_VertSplit
       
  1464 		jr		z, p01loc_5EEF
       
  1465 		bit		3, (iy+11h)
       
  1466 		jr		nz, p01loc_5EEB
       
  1467 		cp		2Ch
       
  1468 		jr		p01loc_5EFB
       
  1469 p01loc_5EEB:
       
  1470 		cp		14h
       
  1471 		jr		p01loc_5EFB
       
  1472 p01loc_5EEF:
       
  1473 		bit		3, (iy+11h)
       
  1474 		jr		z, p01loc_5EF9
       
  1475 		cp		2Ch
       
  1476 		jr		p01loc_5EFB
       
  1477 p01loc_5EF9:
       
  1478 		cp		5Ch
       
  1479 p01loc_5EFB:
       
  1480 		ccf
       
  1481 		jr		nc, p01loc_5F13
       
  1482 		ld		a, 0CEh
       
  1483 		call	VPutMap
       
  1484 		pop		bc
       
  1485 		pop		hl
       
  1486 p01loc_5F05:
       
  1487 		pop		ix
       
  1488 		pop		de
       
  1489 		pop		af
       
  1490 		res		6, (iy+32h)
       
  1491 		res		fracDrawLFont, (iy+fontFlags)
       
  1492 		or		a
       
  1493 		ret
       
  1494 p01loc_5F13:
       
  1495 		pop		bc
       
  1496 		pop		hl
       
  1497 p01loc_5F15:
       
  1498 		bit		4, (iy+24h)
       
  1499 		jr		z, p01loc_5F1F
       
  1500 		set		fracDrawLFont, (iy+fontFlags)
       
  1501 p01loc_5F1F:
       
  1502 		ld		a, (hl)
       
  1503 		inc		hl
       
  1504 		call	VPutMap
       
  1505 		jr		c, p01loc_5F05
       
  1506 		djnz	p01loc_5EC6
       
  1507 		res		fracDrawLFont, (iy+fontFlags)
       
  1508 		jr		p01loc_5EBC
       
  1509 
       
  1510 vputsnT:
       
  1511 		ld		a, (hl)
       
  1512 		push	hl
       
  1513 		push	bc
       
  1514 		ld		l, a
       
  1515 		ld		h, 0
       
  1516 		add		hl, hl
       
  1517 		add		hl, hl
       
  1518 		add		hl, hl
       
  1519 		call	j_SFont_Len
       
  1520 		ld		a, (penCol)
       
  1521 		add		a, b
       
  1522 		cp		5Ch
       
  1523 		ccf
       
  1524 		jr		nc, p01loc_5F4C
       
  1525 		ld		a, 0CEh
       
  1526 		call	VPutMap
       
  1527 		pop		bc
       
  1528 		pop		hl
       
  1529 p01loc_5F4A:
       
  1530 		or		a
       
  1531 		ret
       
  1532 p01loc_5F4C:
       
  1533 		pop		bc
       
  1534 		pop		hl
       
  1535 		ld		a, (hl)
       
  1536 		inc		hl
       
  1537 		call	VPutMap
       
  1538 		jr		c, p01loc_5F4A
       
  1539 		djnz	vputsnT
       
  1540 		scf
       
  1541 		ret
       
  1542 
       
  1543 RunIndicOn:
       
  1544 		push	af
       
  1545 		push	bc
       
  1546 		push	de
       
  1547 		push	hl
       
  1548 		ld		a, 0F0h
       
  1549 		ld		(indicBusy), a
       
  1550 		ld		a, 1
       
  1551 		ld		(indicCounter), a
       
  1552 		call	HandleRunIndicator
       
  1553 		ei
       
  1554 		set		indicRun, (iy+indicFlags)
       
  1555 		jp		p01loc_56A3
       
  1556 
       
  1557 RunIndicOff:
       
  1558 		push	bc
       
  1559 		push	de
       
  1560 		push	hl
       
  1561 		res		indicRun, (iy+indicFlags)
       
  1562 		ld		b, 8
       
  1563 		call	p01sub_60C2
       
  1564 		ld		d, a
       
  1565 p01loc_5F7F:
       
  1566 		ld		a, d
       
  1567 		call	p01sub_55E5
       
  1568 		call	SetXUp
       
  1569 		call	lcd_busy
       
  1570 		in		a, (11h)
       
  1571 		call	lcd_busy
       
  1572 		in		a, (11h)
       
  1573 		and		0FEh
       
  1574 		ld		e, a
       
  1575 		ld		a, d
       
  1576 		call	p01sub_55E5
       
  1577 		call	SetXUp
       
  1578 		ld		a, e
       
  1579 		call	lcd_busy
       
  1580 		out		(11h), a
       
  1581 		inc		d
       
  1582 		djnz	p01loc_5F7F
       
  1583 		pop		hl
       
  1584 		pop		de
       
  1585 		pop		bc
       
  1586 		ei
       
  1587 		ret
       
  1588 
       
  1589 saveCmdShadow:
       
  1590 		call	saveShadow
       
  1591 		ld		de, cmdShadow
       
  1592 		ld		hl, textShadow
       
  1593 		ld		bc, 80h
       
  1594 		ldir
       
  1595 		ld		hl, (curRow)
       
  1596 		ld		(cmdShadCur), hl
       
  1597 		ret
       
  1598 
       
  1599 saveShadow:
       
  1600 		ld		hl, (curRow)
       
  1601 		ld		(textShadCur), hl
       
  1602 		ld		a, (winTop)
       
  1603 		ld		(textShadTop), a
       
  1604 		ld		a, (unk_8A02)
       
  1605 		ld		(textShadAlph), a
       
  1606 		ld		a, (unk_89F5)
       
  1607 		and		10h
       
  1608 		ld		(textShadIns), a
       
  1609 		ret
       
  1610 
       
  1611 #ifndef DEVIATE_FROM_ORIGINAL_FILE
       
  1612 		ld		a, (textShadTop)
       
  1613 		ld		(winTop), a
       
  1614 		ld		a, 8
       
  1615 		ld		hl, menuAppDepth
       
  1616 		sub		(hl)
       
  1617 		cp		6
       
  1618 		jr		nc, p01loc_5FEA
       
  1619 		ld		a, 6
       
  1620 p01loc_5FEA:
       
  1621 		ld		(winTop+1), a
       
  1622 		ld		hl, 0
       
  1623 		jr		p01loc_601B
       
  1624 #endif
       
  1625 
       
  1626 rstrShadow:
       
  1627 		ld		a, (textShadTop)
       
  1628 		ld		(winTop), a
       
  1629 		ld		a, 8
       
  1630 		ld		hl, menuAppDepth
       
  1631 		sub		(hl)
       
  1632 		cp		6
       
  1633 		jr		nc, p01loc_6004
       
  1634 		ld		a, 6
       
  1635 p01loc_6004:
       
  1636 		ld		(winTop+1), a
       
  1637 		ld		hl, 0
       
  1638 		call	CheckSplitFlag
       
  1639 		jr		z, p01loc_601B
       
  1640 		sub		4
       
  1641 		ld		l, 4
       
  1642 		ld		(curRow), hl
       
  1643 		ld		hl, 8548h
       
  1644 		jr		p01loc_6021
       
  1645 p01loc_601B:
       
  1646 		ld		(curRow), hl
       
  1647 		ld		hl, textShadow
       
  1648 p01loc_6021:
       
  1649 		call	ATimes16
       
  1650 		ld		b, a
       
  1651 		dec		b
       
  1652 p01loc_6026:
       
  1653 		ld		a, (hl)
       
  1654 		inc		hl
       
  1655 		call	PutC
       
  1656 		djnz	p01loc_6026
       
  1657 		ld		a, (hl)
       
  1658 		call	PutMap
       
  1659 BCALL_4D6B:
       
  1660 		ld		hl, (textShadCur)
       
  1661 		ld		(curRow), hl
       
  1662 		ld		a, (textShadAlph)
       
  1663 		ld		(unk_8A02), a
       
  1664 		ld		a, (textShadIns)
       
  1665 		and		0EFh
       
  1666 		ld		hl, 89F5h
       
  1667 		or		(hl)
       
  1668 		ld		(hl), a
       
  1669 		ret
       
  1670 
       
  1671 rstrpartial:
       
  1672 		ld		a, (textShadTop)
       
  1673 		ld		(winTop), a
       
  1674 		ld		a, 8
       
  1675 		ld		(winTop+1), a
       
  1676 		jr		BCALL_4D6B
       
  1677 rstrCurRow:
       
  1678 		ld		hl, (textShadCur)
       
  1679 		ld		h, 0
       
  1680 		ld		(curRow), hl
       
  1681 		call	getcurloc
       
  1682 		ld		b, 0Fh
       
  1683 		jr		p01loc_6026
       
  1684 
       
  1685 rstrUnderMenu:
       
  1686 		ld		a, (curRow)
       
  1687 		cp		6
       
  1688 		ret		c
       
  1689 		ld		hl, (curRow)
       
  1690 		push	hl
       
  1691 		sub		a
       
  1692 		ld		(curRow+1), a
       
  1693 		ld		b, 0Fh
       
  1694 		call	getcurloc
       
  1695 p01loc_6077:
       
  1696 		ld		a, (hl)
       
  1697 		inc		hl
       
  1698 		call	PutC
       
  1699 		djnz	p01loc_6077
       
  1700 		ld		a, (hl)
       
  1701 		call	PutMap
       
  1702 		pop		hl
       
  1703 		ld		(curRow), hl
       
  1704 		ret
       
  1705 
       
  1706 rstrbotrow:
       
  1707 		ld		hl, (curRow)
       
  1708 		push	hl
       
  1709 		sub		a
       
  1710 		ld		(curRow+1), a
       
  1711 		ld		b, 0Fh
       
  1712 		ld		hl, 978Fh
       
  1713 		jr		p01loc_6077
       
  1714 
       
  1715 saveTR:	bit		indicInUse, (iy+indicFlags)
       
  1716 		ret		nz
       
  1717 		push	af
       
  1718 		push	bc
       
  1719 		push	de
       
  1720 		push	hl
       
  1721 		push	ix
       
  1722 		set		indicInUse, (iy+indicFlags)
       
  1723 		ld		b, 8
       
  1724 		ld		ix, indicMem
       
  1725 		call	p01sub_60C2
       
  1726 		call	lcd_busy
       
  1727 		in		a, (11h)
       
  1728 p01loc_60B3:
       
  1729 		call	lcd_busy
       
  1730 		in		a, (11h)
       
  1731 		ld		(ix+0),	a
       
  1732 		inc		ix
       
  1733 		djnz	p01loc_60B3
       
  1734 		jp		p01loc_56A1
       
  1735 
       
  1736 p01sub_60C2:
       
  1737 		di
       
  1738 		ld		a, 2Bh
       
  1739 		call	lcd_busy
       
  1740 		out		(10h), a
       
  1741 		ld		a, 80h
       
  1742 		call	p01sub_55E5
       
  1743 		call	SetXUp
       
  1744 		ret
       
  1745 
       
  1746 restoreTR:
       
  1747 		bit		indicInUse, (iy+indicFlags)
       
  1748 		ret		z
       
  1749 		push	af
       
  1750 		push	bc
       
  1751 		push	de
       
  1752 		push	hl
       
  1753 		push	ix
       
  1754 		ld		b, 8
       
  1755 		ld		ix, indicMem
       
  1756 		call	p01sub_60C2
       
  1757 p01loc_60E7:
       
  1758 		ld		a, (ix+0)
       
  1759 		inc		ix
       
  1760 		call	lcd_busy
       
  1761 		out		(11h), a
       
  1762 		djnz	p01loc_60E7
       
  1763 		res		indicInUse, (iy+indicFlags)
       
  1764 		ei
       
  1765 		jp		p01loc_56A1
       
  1766 
       
  1767 ATimes16:
       
  1768 		add		a, a
       
  1769 		add		a, a
       
  1770 		add		a, a
       
  1771 		add		a, a
       
  1772 		ret
       
  1773 
       
  1774 p01sub_6100:
       
  1775 		inc		b
       
  1776 		ld		hl, 0
       
  1777 		ld		de, 60h
       
  1778 		jr		p01loc_610A
       
  1779 p01loc_6109:
       
  1780 		add		hl, de
       
  1781 p01loc_610A:
       
  1782 		djnz	p01loc_6109
       
  1783 		ret
       
  1784 
       
  1785 GetKeyPress:
       
  1786 		call	GETTOKSTRING
       
  1787 		dec		hl
       
  1788 		ld		a, (hl)
       
  1789 		ret
       
  1790 
       
  1791 GetTokLen:
       
  1792 		call	GETTOKSTRING
       
  1793 		ld		a, (hl)
       
  1794 		ret
       
  1795 
       
  1796 GET_TOK_STRNG:
       
  1797 		push	hl
       
  1798 		call	j_BUFPEEK3
       
  1799 		call	GETTOKSTRING
       
  1800 		ld		a, (hl)
       
  1801 		ld		c, a
       
  1802 		ld		b, 0
       
  1803 		inc		hl
       
  1804 		push	bc
       
  1805 		ld		de, OP3
       
  1806 		ldir
       
  1807 		ex		de, hl
       
  1808 		ld		(hl), 0
       
  1809 		pop		bc
       
  1810 		pop		hl
       
  1811 		ret
       
  1812 
       
  1813 GETTOKSTRING:
       
  1814 		ld		l, e
       
  1815 		ld		h, 0
       
  1816 		ld		a, d
       
  1817 		or		a
       
  1818 		jr		z, p01loc_61A6
       
  1819 		ld		de, StringTable4200
       
  1820 		cp		5Dh
       
  1821 		jr		c, p01loc_61A9
       
  1822 		ld		de, StringTable4214
       
  1823 		jr		z, p01loc_61A9
       
  1824 		ld		de, StringTable4220
       
  1825 		cp		60h
       
  1826 		jr		nc, p01loc_616A
       
  1827 		ld		a, l
       
  1828 		res		4, l
       
  1829 		bit		4, a
       
  1830 		jr		nz, p01loc_61A9
       
  1831 		ld		de, StringTable4234
       
  1832 		res		5, l
       
  1833 		bit		5, a
       
  1834 		jr		nz, p01loc_61A9
       
  1835 		ld		de, StringTable424C
       
  1836 		res		6, l
       
  1837 		bit		6, a
       
  1838 		jr		nz, p01loc_61A9
       
  1839 		res		7, l
       
  1840 		ld		de, StringTable4258
       
  1841 		jr		p01loc_61A9
       
  1842 p01loc_616A:
       
  1843 		ld		de, StringTable425E
       
  1844 		cp		61h
       
  1845 		jr		c, p01loc_61A9
       
  1846 		ld		de, StringTable4272
       
  1847 		jr		z, p01loc_61A9
       
  1848 		ld		de, StringTable429A
       
  1849 		cp		63h
       
  1850 		jr		c, p01loc_61A9
       
  1851 		ld		de, StringTable4314
       
  1852 		jr		z, p01loc_61A9
       
  1853 		cp		7Eh
       
  1854 		jr		z, p01loc_61A1
       
  1855 		ld		de, StringTable4286
       
  1856 		cp		0BBh
       
  1857 		jr		c, p01loc_61A9
       
  1858 		ld		de, StringTable43AA
       
  1859 		ld		a, l
       
  1860 		jr		nz, p01loc_619B
       
  1861 		cp		0F6h
       
  1862 		jr		c, p01loc_61A9
       
  1863 		ld		l, 0F6h
       
  1864 		jr		p01loc_61A9
       
  1865 p01loc_619B:
       
  1866 		cp		13h
       
  1867 		jr		c, p01loc_61A1
       
  1868 		ld		l, 13h
       
  1869 p01loc_61A1:
       
  1870 		ld		de, StringTable4384
       
  1871 		jr		p01loc_61A9
       
  1872 p01loc_61A6:
       
  1873 		ld		de, StringTable4000
       
  1874 p01loc_61A9:
       
  1875 		add		hl, hl
       
  1876 		add		hl, de
       
  1877 		ld		e, (hl)
       
  1878 		inc		hl
       
  1879 		ld		d, (hl)
       
  1880 		ex		de, hl
       
  1881 		bit		tokenHookActive, (iy+hookflags3)
       
  1882 		jr		z, p01loc_61D8
       
  1883 		ld		a, (hl)
       
  1884 		ld		(localTokStr), a
       
  1885 		push	bc
       
  1886 		push	hl
       
  1887 		ld		hl, StringTable4000+1
       
  1888 		ex		de, hl
       
  1889 		or		a
       
  1890 		sbc		hl, de
       
  1891 		ex		de, hl
       
  1892 		ld		bc, 0
       
  1893 		or		a
       
  1894 		ld		hl, 546h
       
  1895 		sbc		hl, de
       
  1896 		jr		nc, p01loc_61D3
       
  1897 		ld		b, d
       
  1898 		ld		c, e
       
  1899 		ld		de, 0Ch
       
  1900 p01loc_61D3:
       
  1901 		pop		hl
       
  1902 		call	Page0Call_3C15
       
  1903 		pop		bc
       
  1904 p01loc_61D8:
       
  1905 		inc		hl
       
  1906 		ret
       
  1907 
       
  1908 SGetTokString:
       
  1909 		call	GETTOKSTRING
       
  1910 		ld		de, ioPrompt
       
  1911 		ld		bc, 11h
       
  1912 		ldir
       
  1913 		ld		hl, ioPrompt
       
  1914 		ret
       
  1915 
       
  1916 PUTBPATBUF2:
       
  1917 		push	bc
       
  1918 		push	de
       
  1919 		push	hl
       
  1920 		push	af
       
  1921 		ld		b, 1
       
  1922 		jr		p01loc_61FB
       
  1923 
       
  1924 PUTBPATBUF:
       
  1925 		call	j_GetPrevTok
       
  1926 
       
  1927 putbPAT:
       
  1928 		xor		a
       
  1929 		push	bc
       
  1930 		push	de
       
  1931 		push	hl
       
  1932 		push	af
       
  1933 		ld		b, 0
       
  1934 p01loc_61FB:
       
  1935 		push	bc
       
  1936 		call	GETTOKSTRING
       
  1937 		ld		b, (hl)
       
  1938 		ld		e, b
       
  1939 		ld		d, 0
       
  1940 		add		hl, de
       
  1941 p01loc_6204:
       
  1942 		ld		a, (winLeftEdge)
       
  1943 		pop		de
       
  1944 		push	de
       
  1945 		bit		0, d
       
  1946 		jr		nz, p01loc_6250
       
  1947 		ld		a, (hl)
       
  1948 		cp		0D6h
       
  1949 		jr		nz, p01loc_624F
       
  1950 		ld		hl, curCol
       
  1951 		dec		(hl)
       
  1952 		ld		a, 3Ah
       
  1953 		call	PutMap
       
  1954 		call	p01sub_5A3F
       
  1955 		ld		a, (curRow)
       
  1956 		ld		hl, winTop
       
  1957 		cp		(hl)
       
  1958 		jp		m, p01loc_6281
       
  1959 		ld		hl, (editCursor)
       
  1960 p01loc_622B:
       
  1961 		ld		de, (editTop)
       
  1962 		dec		hl
       
  1963 		call	CpHLDE
       
  1964 		jr		c, p01loc_623E
       
  1965 		inc		hl
       
  1966 		call	j_GetPrevTok
       
  1967 		call	page0_17C7
       
  1968 		jr		nz, p01loc_622B
       
  1969 p01loc_623E:
       
  1970 		inc		hl
       
  1971 		ld		de, (editCursor)
       
  1972 		call	j_stringwidth
       
  1973 		ld		a, e
       
  1974 		inc		a
       
  1975 		and		0Fh
       
  1976 		ld		(curRow+1), a
       
  1977 		jr		p01loc_6265
       
  1978 p01loc_624F:
       
  1979 		xor		a
       
  1980 p01loc_6250:
       
  1981 		ld		c, a
       
  1982 		ld		a, (curRow+1)
       
  1983 		dec		a
       
  1984 		jp		m, p01loc_626C
       
  1985 		cp		c
       
  1986 		jr		c, p01loc_626C
       
  1987 		ld		(curRow+1), a
       
  1988 p01loc_625E:
       
  1989 		ld		a, (hl)
       
  1990 		dec		hl
       
  1991 		call	PutMap
       
  1992 		djnz	p01loc_6204
       
  1993 p01loc_6265:
       
  1994 		pop		de
       
  1995 		pop		af
       
  1996 		scf
       
  1997 p01loc_6268:
       
  1998 		pop		hl
       
  1999 		pop		de
       
  2000 		pop		bc
       
  2001 		ret
       
  2002 p01loc_626C:
       
  2003 		pop		de
       
  2004 		pop		af
       
  2005 		jr		nz, p01loc_6283
       
  2006 		push	af
       
  2007 		push	de
       
  2008 		call	p01sub_5A3F
       
  2009 		ld		a, (curRow)
       
  2010 		push	hl
       
  2011 		ld		hl, winTop
       
  2012 		cp		(hl)
       
  2013 		pop		hl
       
  2014 		jp		p, p01loc_625E
       
  2015 p01loc_6281:
       
  2016 		pop		de
       
  2017 		pop		af
       
  2018 p01loc_6283:
       
  2019 		or		a
       
  2020 		jr		p01loc_6268
       
  2021 
       
  2022 putcCheckScrolL:
       
  2023 		push	af
       
  2024 		res		textScrolled, (iy+textFlags)
       
  2025 		call	GETTOKSTRING
       
  2026 		ld		a, (mcxCurApp)
       
  2027 		cp		49h
       
  2028 		jr		nz, p01loc_62B2
       
  2029 		pop		af
       
  2030 		jr		nz, p01loc_62AB
       
  2031 		push	hl
       
  2032 		ld		a, (hl)
       
  2033 		ld		de, (curRow)
       
  2034 		add		a, d
       
  2035 		cp		10h
       
  2036 		ld		a, e
       
  2037 		inc		a
       
  2038 		call	nc, p01sub_5AD2
       
  2039 		pop		hl
       
  2040 		call	PutPS
       
  2041 		ret
       
  2042 
       
  2043 p01loc_62AB:
       
  2044 		call	PutPS
       
  2045 		call	j_DISPYEOS
       
  2046 		ret
       
  2047 
       
  2048 p01loc_62B2:
       
  2049 		pop		af
       
  2050 		call	PutPS
       
  2051 		bit		textScrolled, (iy+textFlags)
       
  2052 		ret		z
       
  2053 		call	j_DispEOW
       
  2054 		ret
       
  2055 
       
  2056 DispEOL:
       
  2057 		ld		a, (curRow+1)
       
  2058 		push	af
       
  2059 		ld		hl, (editTail)
       
  2060 p01loc_62C6:
       
  2061 		call	j_BUFPEEK1
       
  2062 		jr		z, p01loc_62E8
       
  2063 		inc		hl
       
  2064 		push	hl
       
  2065 		call	GETTOKSTRING
       
  2066 		ld		b, (hl)
       
  2067 p01loc_62D1:
       
  2068 		inc		hl
       
  2069 		ld		a, (curRow+1)
       
  2070 		cp		0Fh
       
  2071 		ld		a, (hl)
       
  2072 		jr		z, p01loc_62E2
       
  2073 		call	PutC
       
  2074 		djnz	p01loc_62D1
       
  2075 		pop		hl
       
  2076 		jr		p01loc_62C6
       
  2077 p01loc_62E2:
       
  2078 		call	PutMap
       
  2079 		pop		hl
       
  2080 		jr		p01loc_62EB
       
  2081 p01loc_62E8:
       
  2082 		call	EraseEOL
       
  2083 p01loc_62EB:
       
  2084 		pop		af
       
  2085 		ld		(curRow+1), a
       
  2086 		ret
       
  2087 
       
  2088 fdispEOL:
       
  2089 		bit		1, (iy+2Ah)
       
  2090 		jr		z, p01loc_62FA
       
  2091 		call	j_BCALL_4CCC
       
  2092 		ret
       
  2093 
       
  2094 p01loc_62FA:
       
  2095 		ld		a, (curRow+1)
       
  2096 		or		a
       
  2097 		ret		z
       
  2098 		call	Page0Call_3C3F
       
  2099 		push	af
       
  2100 		ld		hl, (editTail)
       
  2101 p01loc_6306:
       
  2102 		call	j_BUFPEEK1
       
  2103 		jr		z, p01loc_6349
       
  2104 		inc		hl
       
  2105 		push	hl
       
  2106 		call	GETTOKSTRING
       
  2107 		ld		b, (hl)
       
  2108 		inc		hl
       
  2109 p01loc_6312:
       
  2110 		ld		a, (curRow+1)
       
  2111 		cp		0Fh
       
  2112 		jr		z, p01loc_6323
       
  2113 		ld		a, (hl)
       
  2114 		inc		hl
       
  2115 		call	PutC
       
  2116 		djnz	p01loc_6312
       
  2117 		pop		hl
       
  2118 		jr		p01loc_6306
       
  2119 p01loc_6323:
       
  2120 		ld		c, (hl)
       
  2121 		pop		hl
       
  2122 		ld		a, b
       
  2123 		cp		2
       
  2124 		jr		nc, p01loc_6335
       
  2125 		ld		de, (editBtm)
       
  2126 		or		a
       
  2127 		sbc		hl, de
       
  2128 		ld		a, h
       
  2129 		or		l
       
  2130 		jr		z, p01loc_633D
       
  2131 p01loc_6335:
       
  2132 		set		1, (iy+0Eh)
       
  2133 		ld		a, 0CEh
       
  2134 		jr		p01loc_6341
       
  2135 p01loc_633D:
       
  2136 		ld		a, c
       
  2137 		call	Page0Call_3C3F
       
  2138 p01loc_6341:
       
  2139 		call	PutMap
       
  2140 		pop		af
       
  2141 		ld		(curRow+1), a
       
  2142 		ret
       
  2143 
       
  2144 p01loc_6349:
       
  2145 		call	EraseEOL
       
  2146 		call	Page0Call_3C3F
       
  2147 		pop		af
       
  2148 		ld		(curRow+1), a
       
  2149 		ret
       
  2150 
       
  2151 ClearRow:
       
  2152 		di
       
  2153 		ld		d, a
       
  2154 		ld		e, 20h
       
  2155 p01loc_6358:
       
  2156 		ld		a, d
       
  2157 		call	p01sub_55E5
       
  2158 		call	SetXUp
       
  2159 		ld		b, 8
       
  2160 		ld		a, e
       
  2161 		call	lcd_busy
       
  2162 		out		(10h), a
       
  2163 p01loc_6367:
       
  2164 		xor		a
       
  2165 		call	lcd_busy
       
  2166 		out		(11h), a
       
  2167 		djnz	p01loc_6367
       
  2168 		inc		e
       
  2169 		ld		a, e
       
  2170 		cp		2Ch
       
  2171 		jr		nz, p01loc_6358
       
  2172 		ret
       
  2173 
       
  2174 MAKEROWCMD:
       
  2175 		add		a, a
       
  2176 		add		a, a
       
  2177 		add		a, a
       
  2178 		add		a, 80h
       
  2179 		ret
       
  2180 
       
  2181 TOTOSTRP:
       
  2182 		ld		b, a
       
  2183 p01loc_637D:
       
  2184 		ld		a, (hl)
       
  2185 		ld		(de), a
       
  2186 		inc		de
       
  2187 		ld		a, (unk_865E)
       
  2188 		inc		a
       
  2189 		ld		(unk_865E), a
       
  2190 		cp		10h
       
  2191 		ret		z
       
  2192 		inc		hl
       
  2193 		djnz	p01loc_637D
       
  2194 		or		1
       
  2195 		ret
       
  2196 
       
  2197 SETVARNAME:
       
  2198 		ld		a, (OP1+1)
       
  2199 		ld		d, 0
       
  2200 		cp		5Ch
       
  2201 		jr		c, p01loc_63BA
       
  2202 		cp		5Dh
       
  2203 		ld		d, a
       
  2204 		ld		a, (OP1M)
       
  2205 		jr		nz, p01loc_63BA
       
  2206 		cp		6
       
  2207 		jr		c, p01loc_63BA
       
  2208 		ld		hl, OP1M
       
  2209 		ld		de, ioPrompt
       
  2210 p01loc_63AB:
       
  2211 		ld		a, (hl)
       
  2212 		or		a
       
  2213 		jr		z, p01loc_63C7
       
  2214 		cp		5Bh
       
  2215 		jr		nz, p01loc_63B5
       
  2216 		ld		a, 5Bh
       
  2217 p01loc_63B5:
       
  2218 		ld		(de), a
       
  2219 		inc		de
       
  2220 		inc		hl
       
  2221 		jr		p01loc_63AB
       
  2222 p01loc_63BA:
       
  2223 		ld		e, a
       
  2224 		call	GETTOKSTRING
       
  2225 		ld		c, (hl)
       
  2226 		ld		b, 0
       
  2227 		inc		hl
       
  2228 		ld		de, ioPrompt
       
  2229 		ldir
       
  2230 p01loc_63C7:
       
  2231 		ld		hl, {+}
       
  2232 		jp		strcopy
       
  2233 +:		.asc '=?',0
       
  2234 DispDone:
       
  2235 		bit		localizeHookActive, (iy+hookflags3)
       
  2236 		jr		z, p01loc_63DC
       
  2237 		ld		a, 0Dh
       
  2238 		call	j_call_character_hook
       
  2239 		ret		z
       
  2240 p01loc_63DC:
       
  2241 		ld		hl, curCol
       
  2242 		ld		(hl), 0Ch
       
  2243 		ld		hl, aDone
       
  2244 		call	PutS
       
  2245 		ret
       
  2246 
       
  2247 finishoutput:
       
  2248 		call	CpHLDE
       
  2249 		ret		z
       
  2250 		push	de
       
  2251 		call	j_BUFPEEK3
       
  2252 		inc		hl
       
  2253 		push	hl
       
  2254 		call	GETTOKSTRING
       
  2255 		ld		b, (hl)
       
  2256 p01loc_63F6:
       
  2257 		inc		hl
       
  2258 		ld		a, (hl)
       
  2259 		call	PutC
       
  2260 		call	Page01_3CCF
       
  2261 		jr		nc, p01loc_6407
       
  2262 		djnz	p01loc_63F6
       
  2263 		pop		hl
       
  2264 		pop		de
       
  2265 		jr		finishoutput
       
  2266 		ret
       
  2267 p01loc_6407:
       
  2268 		pop		de
       
  2269 		pop		hl
       
  2270 		ret
       
  2271 
       
  2272 DisplayCalcModelAndOSVersion:
       
  2273 		call	DisplayCalculatorModel
       
  2274 		call	PutS_penColPrefixed
       
  2275 		ld		hl, aOSVersionString
       
  2276 PutS_penColPrefixed:
       
  2277 		push	hl
       
  2278 		call	ldHLind
       
  2279 		inc		hl
       
  2280 		inc		hl
       
  2281 		ld		(penCol), hl
       
  2282 		pop		hl
       
  2283 		inc		hl
       
  2284 		inc		hl
       
  2285 		jp		VPutS
       
  2286 aHelpEducation_:
       
  2287 		.db		0
       
  2288 		.db		3Ah
       
  2289 		.asc 'Help:  education.ti.com',0
       
  2290 aTi83Plus:
       
  2291 		.db		1Ah
       
  2292 		.db		8
       
  2293 		.asc 'TI-83 Plus',0
       
  2294 aTi83PlusSilver:
       
  2295 		.db		6
       
  2296 		.db		8
       
  2297 		.asc 'TI-83 Plus  Silver  Edition',0
       
  2298 aCopyright19982:.asc 'Copyright 1998-2001, Texas Instruments Inc.',0
       
  2299 
       
  2300 Page01_3E07:
       
  2301 		call	j_CursorOff
       
  2302 		call	ClrLCD
       
  2303 		call	RunIndicOff
       
  2304 		call	DisplayCalculatorModel
       
  2305 		call	p01sub_65B0
       
  2306 		ld		hl, 62h
       
  2307 		call	p01sub_65B0
       
  2308 		ld		hl, aProd
       
  2309 		ld		a, 7Dh
       
  2310 		bit		localizeHookActive, (iy+hookflags3)
       
  2311 		call	nz, j_call_character_hook
       
  2312 		call	p01sub_65B0
       
  2313 		rst		28h
       
  2314 		.dw		80C3h
       
  2315 		ld		a, e
       
  2316 		ld		(OP4), a
       
  2317 		ld		ix, OP4
       
  2318 		ld		hl, OP1
       
  2319 		ld		b, 1
       
  2320 		call	Page0Call_3C4B
       
  2321 		ld		a, 2Dh
       
  2322 		ld		(OP1M), a
       
  2323 		xor		a
       
  2324 		ld		(OP1M+1), a
       
  2325 		call	VPutS
       
  2326 		ld		de, 80A0h
       
  2327 		call	p01sub_657F
       
  2328 		ld		hl, OP1+1
       
  2329 		call	VPutS
       
  2330 		ld		a, 2Dh
       
  2331 		ld		(OP1), a
       
  2332 		xor		a
       
  2333 		ld		(OP1+1), a
       
  2334 		ld		hl, OP1
       
  2335 		call	VPutS
       
  2336 		ld		de, 8020h
       
  2337 		call	p01sub_657F
       
  2338 		call	VPutS
       
  2339 		ld		a, 2Dh
       
  2340 		ld		(OP1), a
       
  2341 		xor		a
       
  2342 		ld		(OP1+1), a
       
  2343 		ld		hl, OP1
       
  2344 		call	VPutS
       
  2345 		ld		de, 8030h
       
  2346 		call	p01sub_657F
       
  2347 		call	VPutS
       
  2348 		rst		28h
       
  2349 		.dw		807Eh
       
  2350 		jr		nz, p01loc_654E
       
  2351 		ld		hl, aId_01
       
  2352 		call	p01sub_65B0
       
  2353 		ld		ix, OP4
       
  2354 		ld		hl, OP1
       
  2355 		ld		d, 1
       
  2356 		call	Page0Call_3C4B
       
  2357 		push	hl
       
  2358 		ld		hl, 8482h
       
  2359 		ld		de, OP2
       
  2360 		ld		bc, 6
       
  2361 		lddr
       
  2362 		ld		a, 2Dh
       
  2363 		ld		(OP1+5), a
       
  2364 		pop		hl
       
  2365 		call	VPutS
       
  2366 		ld		a, 2Dh
       
  2367 		call	VPutMap
       
  2368 		call	Page0Call_3C51
       
  2369 		inc		hl
       
  2370 		call	Page0Call_3C57
       
  2371 		dec		hl
       
  2372 		call	Page0Call_3C57
       
  2373 p01loc_654E:
       
  2374 		ld		hl, 2504h
       
  2375 		ld		(penCol), hl
       
  2376 		call	Page0Call_3C5D
       
  2377 		ld		hl, 2D00h
       
  2378 		ld		(penCol), hl
       
  2379 		call	Page0Call_3C63
       
  2380 		jr		nz, p01loc_656F
       
  2381 		ld		a, b
       
  2382 		cp		31h
       
  2383 		jr		c, p01loc_6569
       
  2384 		ld		b, 30h
       
  2385 p01loc_6569:
       
  2386 		ld		hl, tempSwapArea
       
  2387 		call	p01sub_65D6
       
  2388 p01loc_656F:
       
  2389 		ld		hl, aHelpEducation_
       
  2390 		ld		a, 70h
       
  2391 		bit		localizeHookActive, (iy+hookflags3)
       
  2392 		call	nz, j_call_character_hook
       
  2393 		call	p01sub_65B0
       
  2394 		ret
       
  2395 
       
  2396 p01sub_657F:
       
  2397 		ld		a, 7Ah
       
  2398 		ld		hl, 4000h
       
  2399 		rst		28h
       
  2400 		.dw		8075h
       
  2401 		jr		nz, p01loc_6593
       
  2402 		ld		a, 7Ah
       
  2403 		inc		hl
       
  2404 		rst		28h
       
  2405 		.dw		805Ah
       
  2406 		ld		a, b
       
  2407 		or		c
       
  2408 		jr		nz, p01loc_659A
       
  2409 p01loc_6593:
       
  2410 		ld		(OP4), a
       
  2411 		ld		c, 1
       
  2412 		jr		p01loc_65A4
       
  2413 p01loc_659A:
       
  2414 		ld		a, 7Ah
       
  2415 		ld		de, OP4
       
  2416 		push	bc
       
  2417 		rst		28h
       
  2418 		.dw		8054h
       
  2419 		pop		bc
       
  2420 p01loc_65A4:
       
  2421 		ld		ix, OP4
       
  2422 		ld		hl, OP1
       
  2423 		ld		b, c
       
  2424 		call	Page0Call_3C4B
       
  2425 		ret
       
  2426 
       
  2427 p01sub_65B0:
       
  2428 		push	hl
       
  2429 		call	ldHLind
       
  2430 		ld		(penCol), hl
       
  2431 		pop		hl
       
  2432 		inc		hl
       
  2433 		inc		hl
       
  2434 		jp		VPutS
       
  2435 
       
  2436 p01loc_65BD:
       
  2437 		inc		hl
       
  2438 		ld		a, b
       
  2439 		or		b
       
  2440 		ret		z
       
  2441 		dec		b
       
  2442 p01loc_65C2:
       
  2443 		ld		de, (penCol)
       
  2444 		ld		e, 0
       
  2445 		ld		a, 6
       
  2446 		add		a, d
       
  2447 		ld		d, a
       
  2448 		cp		37h
       
  2449 		ret		nc
       
  2450 		ld		(penCol), de
       
  2451 		ld		a, (hl)
       
  2452 		jr		p01loc_65DF
       
  2453 
       
  2454 p01sub_65D6:
       
  2455 		ld		a, b
       
  2456 		or		b
       
  2457 		ret		z
       
  2458 		dec		b
       
  2459 		ld		a, (hl)
       
  2460 		cp		0D6h
       
  2461 		jr		z, p01loc_65BD
       
  2462 p01loc_65DF:
       
  2463 		call	VPutMap
       
  2464 		jr		c, p01loc_65C2
       
  2465 		inc		hl
       
  2466 		jr		p01sub_65D6
       
  2467 
       
  2468 aProd:	.db		4
       
  2469 		.db		16h
       
  2470 		.asc 'PROD #:  ',0
       
  2471 aId_01:	.db		4
       
  2472 		.db		1Eh
       
  2473 		.asc 'ID:  ',0
       
  2474 
       
  2475 Page01_3FA5:
       
  2476 		di
       
  2477 		ld		a, 2Bh
       
  2478 		call	lcd_busy
       
  2479 		out		(10h), a
       
  2480 		ld		(hl), 14h
       
  2481 		ld		hl, indicBusy
       
  2482 		rrc		(hl)
       
  2483 		ld		c, (hl)
       
  2484 		ld		b, 8
       
  2485 		ld		d, 80h
       
  2486 p01loc_660F:
       
  2487 		ld		a, d
       
  2488 		call	p01sub_55E5
       
  2489 		call	SetXUp
       
  2490 		call	lcd_busy
       
  2491 		in		a, (11h)
       
  2492 		call	lcd_busy
       
  2493 		in		a, (11h)
       
  2494 		ld		e, a
       
  2495 		ld		a, d
       
  2496 		call	p01sub_55E5
       
  2497 		call	SetXUp
       
  2498 		ld		a, e
       
  2499 		rr	c
       
  2500 		jr		c, p01loc_6631
       
  2501 		res		0, a
       
  2502 		jr		p01loc_6633
       
  2503 p01loc_6631:
       
  2504 		set		0, a
       
  2505 p01loc_6633:
       
  2506 		call	lcd_busy
       
  2507 		out		(11h), a
       
  2508 		inc		d
       
  2509 		djnz	p01loc_660F
       
  2510 		ret
       
  2511 
       
  2512 JForceGraphNoKey:
       
  2513 		ld		a, kGraph
       
  2514 JForceGraphKey:
       
  2515 		ld		b, a
       
  2516 		ld		sp, (onSP)
       
  2517 		res		cmdExec, (iy+cmdFlags)
       
  2518 		ld		a, kGraph
       
  2519 		call	newContext0
       
  2520 		jp		sendKPress
       
  2521 
       
  2522 DisplayCalculatorModel:
       
  2523 		ld		hl, aTi83Plus
       
  2524 		ld		a, 65h
       
  2525 		call	NZIf83Plus
       
  2526 		jr		nz, p01loc_665E
       
  2527 		ld		hl, aTi83PlusSilver
       
  2528 		ld		a, 7Ch
       
  2529 p01loc_665E:
       
  2530 		bit		localizeHookActive, (iy+hookflags3)
       
  2531 		call	nz, j_call_character_hook
       
  2532 		ret
       
  2533 
       
  2534 KeyToString:
       
  2535 		ld		a, d
       
  2536 		cp		0FFh
       
  2537 		jr		z, p01loc_667C
       
  2538 		cp		0FBh
       
  2539 		jr		z, p01loc_6673
       
  2540 		cp		0FCh
       
  2541 		jr		nz, p01loc_667A
       
  2542 p01loc_6673:
       
  2543 		ld		h, 2
       
  2544 		call	Page0Call_3BB5
       
  2545 		jr		p01loc_6691
       
  2546 p01loc_667A:
       
  2547 		cp		0FEh
       
  2548 p01loc_667C:
       
  2549 		ld		a, e
       
  2550 		jr		z, p01loc_668C
       
  2551 		cp		5Ah
       
  2552 		jr		c, p01loc_6697
       
  2553 		call	p01sub_6720
       
  2554 		ret		z
       
  2555 		call	j_ConvKeyToTok
       
  2556 		jr		p01loc_6691
       
  2557 p01loc_668C:
       
  2558 		ld		h, 1
       
  2559 		call	Page0Call_3BB5
       
  2560 p01loc_6691:
       
  2561 		call	GETTOKSTRING
       
  2562 		jp		p01loc_670D
       
  2563 p01loc_6697:
       
  2564 		cp		1Fh
       
  2565 		jr		z, p01loc_66D6
       
  2566 		cp		40h
       
  2567 		jr		c, p01loc_66EA
       
  2568 		cp		59h
       
  2569 		jp		z, p01loc_66BC
       
  2570 		cp		40h
       
  2571 		jr		nz, p01loc_66CA
       
  2572 		ld		a, d
       
  2573 		cp		10h
       
  2574 		ld		a, e
       
  2575 		jr		nz, p01loc_66CA
       
  2576 		ld		hl, Condition8Table
       
  2577 		bit		localizeHookActive, (iy+hookflags3)
       
  2578 		ld		a, 8
       
  2579 		call	nz, j_call_character_hook
       
  2580 		jr		p01loc_670D
       
  2581 p01loc_66BC:
       
  2582 		ld		a, d
       
  2583 		cp		0
       
  2584 		jr		c, p01loc_66C5
       
  2585 		ld		a, 61h
       
  2586 		jr		p01loc_66D8
       
  2587 p01loc_66C5:
       
  2588 		ld		a, 40h
       
  2589 		ld		(kbdKey), a
       
  2590 p01loc_66CA:
       
  2591 		cp		55h
       
  2592 		jr		z, p01loc_66E7
       
  2593 		cp		4Ch
       
  2594 		jr		nz, p01loc_66DB
       
  2595 		ld		a, 5Fh
       
  2596 		jr		p01loc_66D8
       
  2597 p01loc_66D6:
       
  2598 		ld		a, 50h
       
  2599 p01loc_66D8:
       
  2600 		add		a, d
       
  2601 		jr		p01loc_66EC
       
  2602 p01loc_66DB:
       
  2603 		cp		56h
       
  2604 		jr		z, p01loc_66E3
       
  2605 		cp		42h
       
  2606 		jr		nz, p01loc_66E8
       
  2607 p01loc_66E3:
       
  2608 		add		a, 9
       
  2609 		add		a, 0Dh
       
  2610 p01loc_66E7:
       
  2611 		add		a, d
       
  2612 p01loc_66E8:
       
  2613 		sub		1Bh
       
  2614 p01loc_66EA:
       
  2615 		sub		10h
       
  2616 p01loc_66EC:
       
  2617 		cp		63h
       
  2618 		jr		c, p01loc_66F2
       
  2619 		ld		a, 13h
       
  2620 p01loc_66F2:
       
  2621 		ld		l, a
       
  2622 		ld		h, 0
       
  2623 		add		hl, hl
       
  2624 		ld		de, MenuItems2Table
       
  2625 		add		hl, de
       
  2626 		bit		localizeHookActive, (iy+hookflags3)
       
  2627 		jr		z, p01loc_6708
       
  2628 		ld		e, a
       
  2629 		ld		a, 9
       
  2630 		call	j_call_character_hook
       
  2631 		jr		z, p01loc_670D
       
  2632 p01loc_6708:
       
  2633 		ld		e, (hl)
       
  2634 		inc		hl
       
  2635 		ld		d, (hl)
       
  2636 		ex		de, hl
       
  2637 		cp		a
       
  2638 p01loc_670D:
       
  2639 		push	af
       
  2640 		push	bc
       
  2641 		push	de
       
  2642 		dec		hl
       
  2643 		ld		de, keyForStr
       
  2644 		ld		bc, 12h
       
  2645 		ldir
       
  2646 		pop		de
       
  2647 		pop		bc
       
  2648 		pop		af
       
  2649 		ld		hl, keyToStrRam
       
  2650 		ret
       
  2651 
       
  2652 p01sub_6720:
       
  2653 		ld		hl, MenuFunctionStringTable
       
  2654 		ld		b, 13
       
  2655 		jr		p01loc_6727
       
  2656 p01loc_6727:
       
  2657 		cp		(hl)
       
  2658 		jr		z, p01loc_6730
       
  2659 		inc		hl
       
  2660 		inc		hl
       
  2661 		inc		hl
       
  2662 		djnz	p01loc_6727
       
  2663 		ret
       
  2664 p01loc_6730:
       
  2665 		inc		hl
       
  2666 		bit		localizeHookActive, (iy+hookflags3)
       
  2667 		jr		z, p01loc_6708
       
  2668 		ld		e, a
       
  2669 		ld		a, 0Ah
       
  2670 		call	j_call_character_hook
       
  2671 		jr		p01loc_670D
       
  2672 		jr		p01loc_6708