-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTelnet.asm
More file actions
2967 lines (2510 loc) · 75.8 KB
/
Copy pathTelnet.asm
File metadata and controls
2967 lines (2510 loc) · 75.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;-----------+----------------------------------------------------+----------+
; Telnet 83 | Z80 Source Code for the TI-83 Graphing Calculator | Infiniti |
;-----------+----------------------------------------------------+----------+
;
; 1998 Justin Karneges
;
; Telnet83 V1.6
;
; Telnet83 is a terminal program for the TI-83. It has an 80x25
; scrolling view and vt100 emulation.
;
; To Use:
; -Link two calcs together with the regular link and talk.
; -Connect a Graphlink to a device such as a modem or TNC and
; then connect the Graphlink to the calculator.
; -It will work with anything that uses the linkport. Try the
; IR link. =)
;
; Note: There are a few vt100 sequences that telnet83 will recognize
; but not do anything in response. These are mainly sequences
; that either the calculator can't do OR they are so old and
; unused that I left it out.
;
;
;
; Programming Note:
; The instruction:
;
; call catchup ; *-* LINK CHECK *+*
;
; appears VERY often in the code (like a hundred times).
; In order to get 9600bps out of the calc, I have to check
; the link port insanely often. It makes the code very ugly
; to read, but it is a necessary step.
;
;-----------+----------------------------------------------------+----------+
; Telnet 83 | Includes/Defines/Program Start | Infiniti |
;-----------+----------------------------------------------------+----------+
.binarymode ti8x
#include "ti83plus.inc"
#include "mirage.inc"
#define GRAPH_MEM plotsscreen
BEL .equ 7
BS .equ 8
HT .equ 9
VT .equ 11
FF .equ 12
CR .equ 13
CAN .equ 24
SUB .equ 26
ESC .equ 27
NONE .equ 0
BOLD .equ 1
UNDERLINE .equ 4
BLINK .equ 5
INVERSE .equ 7
; (mode_flags)
INSERT: .equ %10000000 ; insert/overwrite
LINE_WRAP: .equ %01000000 ; line wrap
LOCAL_ECHO_OFF: .equ %00100000 ; disable local echo
CRLF: .equ %00010000 ; use CRLF instead of just CR
PORT .equ 0
.org $9d93
.db $BB,$6D
ret
.db 3
button:
.db %00000000,%00000000
.db %00000000,%00000000
.db %00111011,%10100000
.db %00010010,%00100000
.db %00010011,%00100000
.db %00010010,%00100000
.db %00010011,%10111000
.db %00000000,%00000000
.db %00110011,%10111000
.db %00101010,%00010000
.db %00101011,%00010000
.db %00101010,%00010000
.db %00101011,%10010000
.db %00000000,%00000000
.db %00000000,%00000000
.dw exit
;desc:
.db "Telnet83+ V1.6 by Infiniti",0
;-----------+----------------------------------------------------+----------+
; Telnet 83 | Program | Infiniti |
;-----------+----------------------------------------------------+----------+
start:
; benryves: disable MirageOS interrupt
im 1
; benryves: we need to try to find the appvar before allocating buffers
; in case it's archived and we need to move it into RAM.
call findappvar
; benryves: allocate buffers by inserting memory into the end of the program
; first check for enough free memory
ld hl, buffers_s
bcall (_EnoughMem)
jp c, quittoshell
; if there is, insert it into the variable
ex de, hl
ld de, buffers
bcall (_InsertMem)
; reset the terminal
call vt100reset
; default sign-on message
ld hl, signon
ld de, term
ld ix, pcury
signon_line_loop:
ld a, (hl)
inc hl
or a
jr z, signon_end
push de
signon_char_loop:
ld (de), a
inc de
ld a, (hl)
inc hl
or a
jr nz, signon_char_loop
pop de
; advance to next line
ex de, hl
ld bc, 80
add hl, bc
ex de, hl
inc (ix)
jr signon_line_loop
signon_end:
; load data from the appvar
call loadappvar
; call RINDOFF ; Turn off runindicator (not needed)
bcall(_grbufclr) ; call BUFCLR ; Clear the graphbuf
bcall(_grbufcpy) ; call BUFCOPY ; Copy the graphbuf to the LCD
;*****Using getcsc instead of getk, b/c getk is aka poop
bcall(_getcsc) ; call READKEY ; Clear out the keypad buffer
; ld (spbackup), sp ; backup the stack (for use with quitting) (quittoshell)
mainloop:
call catchup ; *-* LINK CHECK *+*
; --- render the screen ---
call fix_bound ; make sure the scrolling screen is inbounds
call render_text ; draw up the terminal
call render_stat ; draw the status bar at the bottom
ld a, (panned)
ld b, a
ld a, (mm_mode)
and b
call nz, render_minimap
xor a
ld (panned), a
call zap ; copy to LCD
; --- end ---
call catchup ; *-* LINK CHECK *+*
; --- check with direct input (for scrolling) ---
ld a, (shift)
cp 3
jr z, no_directarrow
; Credit goes to Hideaki Omuro (CRASHMAN) for this.
; I didn't feel like writing it. =)
; LD A, $FF \ OUT ($01), A ; Reset Port
; LD A, $FE \ OUT ($01), A ; Mask out Arrows
; IN A, ($01)
ld a,$FE
call directin
BIT 0, A \ CALL Z, scroll_down
BIT 3, A \ CALL Z, scroll_up
BIT 1, A \ CALL Z, scroll_left
BIT 2, A \ CALL Z, scroll_right
call catchup ; *-* LINK CHECK *+*
no_directarrow:
; --- end ---
; benryves: is the ON key held?
in a, ($04)
and %00001000
jr nz, no_on_held
call catchup ; *-* LINK CHECK *+*
; ON is held, so use alternate functions
bcall (_getcsc)
cp skGraph
call z, togglelocalecho
cp skClear
call z, vt100reset
cp skEnter
call z, togglenewlinemode
jp no_key
no_on_held:
; --- check keypad the normal way and respond accordingly ---
call catchup ; *-* LINK CHECK *+*
bcall (_getcsc)
or a
jp z, no_key
cp skGraph
jp z, exit ; quit
cp skClear
call z, vt100entirescreenhome
cp skZoom
call z, jumphome ; zoom to the left edge [ZOOM] button
cp skWindow
call z, jumpcursor ; bring the cursor into the current [WINDOW]
cp skTrace
call z, mm_mode_swap ; toggle minimap mode
cp skYEqu
call z, setwrap ; toggle the character wrap
; shift modes - do not call, only jump
cp sk2nd
jp z, toggle2nd ; set numeric
cp skAlpha
jp z, togglealph ; set capital
cp skMode
jp z, togglemode ; set extra
cp skGraphvar
jp z, togglectrl ; set ctrl
call catchup ; *-* LINK CHECK *+*
ld d, a
ld a, (shift)
cp 3
ld a, d
jr nz, no_vtarrows
cp 05h ; cursor keys are all in range 1-4
jr nc, no_vtarrows
call keypad2ascii
push af
call catchup ; *-* LINK CHECK *+*
call sendescbracket
pop af
jr send_key_byte
no_vtarrows:
; double check it really isn't a cursor key
cp 05h
jr c, no_key
call catchup ; *-* LINK CHECK *+*
call keypad2ascii ; convert the key into ASCII
call catchup ; *-* LINK CHECK *+*
or a ; cp 0
jr z, no_key ; key doesn't have an entry
send_key_byte:
push af
and %01111111 ; strip MSB (hack used to allow NUL to be typed and flag on RETURN key)
push af
ld a, 1
ld (sendstat), a ; flag the status bar to indicate send
call catchup ; *-* LINK CHECK *+*
pop af
call sendbyte ; chuck it out the window
call catchup ; *-* LINK CHECK *+*
pop af
cp 13+128
jr nz, no_key
ld a, (mode_flags)
and CRLF
jr z, no_key
ld a, '\n'
call sendbyte
no_key:
; --- end ---
; --- check for incoming data ---
more_data:
call catchup ; *-* LINK CHECK *+*
call recvbyte ; get a byte from the recv buffer
or a ; cp 0
jr z, no_data ; it's empty
call catchup ; *-* LINK CHECK *+*
ld b, a
ld a, (in_seq)
or a ; cp 0
ld a, b
jr nz, add2esc ; continue the current vt100 sequence
cp ESC
jr z, handle_esc ; begin tracking a new vt100 sequence
call catchup ; *-* LINK CHECK *+*
call putchar ; display the character
call catchup ; *-* LINK CHECK *+*
jr incoming_done
handle_esc:
ld a, 1
ld (in_seq), a ; flag that we're in sequence
ld hl, seqbuf
ld a, ESC
ld (hl), a ; load an ESC character into the sequence
jr incoming_done
add2esc:
cp ESC
jr z, handle_esc
cp CAN
jr nz, add2esc_not_can
call erase_esc
jr incoming_done
add2esc_not_can:
ld hl, seqbuf
ld d, a
ld a, (in_seq)
ld c, a
inc a
ld (in_seq), a ; bump the sequence pointer
ld a, d
ld b, 0
add hl, bc
ld (hl), a ; add in the new character to the sequence
call check_seq ; see if the sequence has a match
or a ; cp 0
jr z, seqoverflow ; no match or sequence to big?
cp 2
call z, erase_esc ; perfect match was executed, delete now
jr incoming_done
seqoverflow:
call catchup ; *-* LINK CHECK *+*
call killesc ; output the sequence to the screen
call catchup ; *-* LINK CHECK *+*
xor a
ld (in_seq), a ; flag out the sequence pointer
incoming_done:
call catchup ; *-* LINK CHECK *+*
jp more_data
no_data:
call catchup ; *-* LINK CHECK *+*
; --- end ---
; --- change cursor status ---
call catchup ; *-* LINK CHECK *+*
ld a, (timer)
cp 2
jr nz, noswap ; not time to swap yet
ld a, 0
ld (timer), a ; zero out the cursor timer
ld a, (curstat)
or a ; cp 0
jr z, curisoff
call cursor_off ; if on, turn back off
jr aftertimer
curisoff:
call cursor_on ; if off, turn back on
jr aftertimer
noswap:
inc a
ld (timer), a ; increment the timer
aftertimer:
; --- end ---
call catchup ; *-* LINK CHECK *+*
jp mainloop ; loop back to the top!
exit:
; benryves: store program state in appvar
call saveappvar
; benryves: free dynamically-allocated buffers
ld hl, buffers
ld de, buffers_s
bcall (_DelMem)
jp quittoshell
;-----------+----------------------------------------------------+----------+
; Telnet 83 | Keypad shift routines (jump, do not call) | benryves |
;-----------+----------------------------------------------------+----------+
toggle2nd:
ld a, 1
jr toggle_shift
togglealph:
ld a, 2
jr toggle_shift
togglemode:
ld a, 3
jr toggle_shift
togglectrl:
ld a, 4
; fall-through
toggle_shift:
call catchup ; *-* LINK CHECK *+*
push bc
ld b, a
ld a, (shift)
cp b
ld a, b
jr nz, shift_on
xor a
shift_on:
ld (shift), a
pop bc
xor a
jp no_key
;-----------+----------------------------------------------------+----------+
; Telnet 83 | AppVar helper functions | benryves |
;-----------+----------------------------------------------------+----------+
; find the existing appvar and unarchive it if possible
findappvar:
; does the appvar exist?
ld hl, appvarname
rst rMOV9TOOP1
bcall (_ChkFindSym)
ret c
appvarexists:
; is the appvar in the archive?
ld a, b
or a
ret z
appvararchived:
; is there enough free RAM to unarchive it?
ld hl, term_s + sdata_s + 256
bcall (_EnoughMem)
ret c
; unarchive the appvar and search for it again
bcall (_Arc_Unarc)
jr findappvar
checkappvarsize:
; fetch size bytes into HL
ex de, hl
ld e, (hl)
inc hl
ld d, (hl)
inc hl
ex de, hl
; check the expected size
ld bc, term_s + sdata_s
or a
sbc hl, bc
; set the carry flag if size mismatch
scf
ret nz
or a
ret
; save the program state to the appvar
saveappvar:
call findappvar
jr nc, overwriteappvar
; is there enough space to create the appvar?
ld hl, term_s + sdata_s + 256
bcall (_EnoughMem)
ret c
; create the appvar
ld hl, term_s + sdata_s
bcall (_CreateAppVar)
overwriteappvar:
; restore character under the cursor
push de
call cursor_off
pop de
call checkappvarsize
ret c
; copy the terminal buffer over
ld hl, term
ld bc, term_s
ldir
; copy variable data
ld hl, sdata
ld bc, sdata_s
ldir
or a
ret
; load the program state from the appvar
loadappvar:
call findappvar
ret c
call checkappvarsize
ret c
ex de, hl
; copy the terminal buffer over
ld de, term
ld bc, term_s
ldir
; copy variable data
ld de, sdata
ld bc, sdata_s
ldir
or a
ret
appvarname:
.db AppVarObj, "TELNET", 0
; ld sp, (spbackup)
; call CLRTSHD ; Clear textshadow
; call GOHOME ; Leave graphscreen and go to homescreen
; call BUFCLR ; Clear the graphbuf
; call READKEY ; Catch the clear press
; call HOMEUP ; Place cursor at home
; ret ; Exit program
;-----------+----------------------------------------------------+----------+
; Telnet 83 | Helper functions | Infiniti |
;-----------+----------------------------------------------------+----------+
killesc:
call catchup ; *-* LINK CHECK *+*
ld a, (in_seq)
ld b, a
ld hl, seqbuf
kill_lp:
call catchup ; *-* LINK CHECK *+*
push bc
push hl
ld a, (hl)
call catchup ; *-* LINK CHECK *+*
call putchar
call catchup ; *-* LINK CHECK *+*
pop hl
inc hl
pop bc
djnz kill_lp
xor a ; ld a, 0
ld (in_seq), a
ret
erase_esc:
call catchup ; *-* LINK CHECK *+*
xor a ; ld a, 0
ld (in_seq), a
ret
zap:
call catchup ; *-* LINK CHECK *+*
call bufcopy_catchup
ret
scroll_left:
call catchup ; *-* LINK CHECK *+*
push af
ld a, (sx)
sub 4
ld (sx), a
pop af
jr scrolled
scroll_right:
call catchup ; *-* LINK CHECK *+*
push af
ld a, (sx)
add a, 4
ld (sx), a
pop af
jr scrolled
scroll_up:
call catchup ; *-* LINK CHECK *+*
push af
ld a, (sy)
sub 2
ld (sy), a
pop af
jr scrolled
scroll_down:
call catchup ; *-* LINK CHECK *+*
push af
ld a, (sy)
add a, 2
ld (sy), a
pop af
; jr scrolled ; fall-through
scrolled:
call catchup ; *-* LINK CHECK *+*
push af
ld a, (panned)
or 1
ld (panned), a
xor a
ld (autoscroll), a
pop af
jp catchup ; *-* LINK CHECK *+*
jumphome:
xor a
ld (autoscroll), a
ld a, (sx)
or a
ret z
xor a
ld (sx), a
ld a, (panned)
or 1
ld (panned), a
ret
; benryves: scroll the window to bring the cursor into view
jumpcursor:
ld a, 1
ld (autoscroll), a
call cursor_to_window
ret z
ld a, (panned)
or 1
ld (panned), a
xor a
ret
cursor_to_window:
push bc
ld c, 0
ld a, (sx)
ld b, a
ld a, (curx)
cp 80
jr nz, curx_not_80
xor a
curx_not_80:
sub b
jr nc, notoffleft
add a, b
ld (sx), a
inc c
jr notoffright
notoffleft:
cp 24
jr c, notoffright
add a, b
sub 23
ld (sx), a
inc c
notoffright:
ld a, (sy)
ld b, a
ld a, (pcury)
sub b
jr nc, notofftop
add a, b
ld (sy), a
inc c
jr notoffbottom
notofftop:
cp 10
jr c, notoffbottom
add a, b
sub 9
ld (sy), a
inc c
notoffbottom:
ld a, c
or a
ld a, 0
pop bc
ret
cursor_moved:
ld a, (autoscroll)
or a
ret z
call cursor_to_window
ret z
ld a, (panned)
or 2
ld (panned), a
xor a
ret
mm_mode_swap: ; benryves: now cycles between 0, 1 and 3 for manual/autoscroll modes.
ld a, (mm_mode)
inc a
cp 2
jr nz, mm_not_2
inc a
mm_not_2:
and 3
mmzero:
ld (mm_mode), a
ret
setwrap:
call catchup ; *-* LINK CHECK *+*
ld a, (wrap)
cp 80
ld a, 80
jr nz, setwrapvalue
setwrap24:
ld a, 24
setwrapvalue:
ld (wrap), a
xor a
ret
togglelocalecho:
ld b, LOCAL_ECHO_OFF
jr toggleflags
togglenewlinemode:
ld b, CRLF
; fall-through
toggleflags:
call catchup ; *-* LINK CHECK *+*
ld a, (mode_flags)
xor b
ld (mode_flags), a
xor a
ret
putchar:
call catchup ; *-* LINK CHECK *+*
push af
call cursor_off
pop af
or a
ret z
jp p, putchar_next1
ld a, 22
putchar_next1:
call catchup ; *-* LINK CHECK *+*
cp '\n'
jr z, putnewline
cp CR
jr z, putreturn
cp BS
jr z, putbs
cp BEL
jp z, putbeep
cp HT
jp z, puttab
cp VT
jr z, putnewline
cp FF
jr z, putnewline
call catchup ; *-* LINK CHECK *+*
ld d, a
ld a, (curattr)
and %10000000 ; benryves: treat curattr as bitmask
or d
call catchup ; *-* LINK CHECK *+*
push af
ld a, (wrap)
ld b, a
ld a, (curx)
cp b
call catchup ; *-* LINK CHECK *+*
call nc, putcr
call catchup ; *-* LINK CHECK *+*
call catchup ; *-* LINK CHECK *+*
call getxy
call catchup ; *-* LINK CHECK *+*
pop af
ld (hl), a
ld a, (curx)
inc a
ld (curx), a
call catchup ; *-* LINK CHECK *+*
jp cursor_moved
putnewline:
ld a, (mode_flags)
and CRLF
call nz, putreturn
vt100index:
ld a, (scr_bot)
ld c, a
ld a, (pcury)
cp c
jp nc, scrollup
inc a
ld (pcury), a
jp cursor_moved
putreturn:
xor a
ld (curx), a
jp cursor_moved
putbs:
ld a, (curx)
or a
ret z
dec a
ld (curx), a
jp cursor_moved
vt100nextline:
putcr:
call catchup ; *-* LINK CHECK *+*
call putreturn
call catchup ; *-* LINK CHECK *+*
call putnewline
call catchup ; *-* LINK CHECK *+*
ret
putbeep:
call catchup ; *-* LINK CHECK *+*
ld hl, GRAPH_MEM
ld bc, 768
xorlp:
call catchup ; *-* LINK CHECK *+*
ld a, (hl)
cpl
ld (hl), a
inc hl
dec bc
ld a, b
or c
jr nz, xorlp
call catchup ; *-* LINK CHECK *+*
call zap
call catchup ; *-* LINK CHECK *+*
ret
puttab:
call getcurtab
ret c
ld d, a
ld a, (wrap)
dec a
ld c, a
call getwrappedcurx
jr nz, puttab_nowrap
call putcr
ld a, (curx)
puttab_nowrap:
cp c
ret nc
ld b, a
; b = column, c = max column, d = bitmask, hl -> tab data
puttab_not_found:
inc b
ld a, b
cp c
jr z, puttab_found
rrc d
jr nc, puttab_not_advanced
inc hl
puttab_not_advanced:
ld a, (hl)
and d
jr z, puttab_not_found
ld a, b
puttab_found:
ld (curx), a
jp cursor_moved
findchar:
call catchup ; *-* LINK CHECK *+*
ld e, a
ld hl, font
ld d, 0
ld b, 8
findlp:
call catchup ; *-* LINK CHECK *+*
add hl, de
djnz findlp
ret
buildtable:
ld ix, fonttable
ld hl, 0
ld de, 8
ld b, 128
buildlp:
push bc
ld a, l
ld (ix), a
ld a, h
ld (ix+1), a
add hl, de
inc ix
inc ix
pop bc
djnz buildlp
ret
render_text:
call catchup ; *-* LINK CHECK *+*
ld ix, GRAPH_MEM
ld (rptr), ix
ld a, 0
ld (rtype), a
call bufclr_catchup
ld hl, term
ld a, (sy)