From 6df71489cd98d238ccd8a4a108b43f247eabf4bc Mon Sep 17 00:00:00 2001 From: d6 Date: Sun, 19 Feb 2023 01:39:19 -0500 Subject: [PATCH] improve cursor wrapping, etc --- term.tal | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/term.tal b/term.tal index cbd5a0e..26fb25a 100644 --- a/term.tal +++ b/term.tal @@ -1,7 +1,6 @@ ( term.tal ) ( TODO: ) -( 1. fix bugs ) ( 3. need to implement scrolling regions ) ( 5. need draw-line word, and need to use it more ) ( a. on delete, CSI-P ) @@ -15,7 +14,7 @@ ( 12. clean up super ugly selection code ) ( 13. hide cursor when not moving for awhile ) ( 15. blinking text? ) -( 16. status line in femto, etc. is weird ) +( 16. status line in femto, etc. is weird *** major bug ) ( 17. determ.terminfo ) ( ANSI sequences ) @@ -160,7 +159,7 @@ reset-terminal ( set to 01 to enable debug log ) - #00 .debug STZ + #01 .debug STZ .debug LDZ ?&continue BRK &continue #99 #010e DEO @@ -350,6 +349,7 @@ screen-to-cursor cur-addr LDA2 !draw-cell @draw-cursor ( -> ) + at-max-x .cur-wrap STZ screen-to-cursor cur-addr LDA2 .tcem LDZ #00 EQU ?&skip SWP reverse-tint SWP &skip !draw-cell @@ -828,7 +828,7 @@ @exec-vpa POP ;vpa !exec1 @exec-cha POP ;cha !exec1 @exec-el POP ;el !exec0 -@exec-ed POP ;ed_ !exec0 +@exec-ed POP ;edx !exec0 @exec-sm POP ;sm !exec1 @exec-rm POP ;rm !exec1 @exec-dsr POP ;dsr !exec1 @@ -878,7 +878,7 @@ &erase-to-end POP2 cur-addr eol-addr !erase &erase-from-start POP2 bol-addr cur-addr !erase -@ed_ ( n* -> ) +@edx ( n* -> ) DUP2 #0000 EQU2 ?&erase-to-end DUP2 #0001 EQU2 ?&erase-from-start DUP2 #0002 EQU2 ?&erase-full @@ -896,7 +896,8 @@ goto BRK ( ) @dec-floor ( x* -> x==0 ? 0* : x-1* ) - ORAk ?&sub JMP2r &sub #0001 SUB2 JMP2r + #0001 SUB2 JMP2r +( ORAk ?&sub JMP2r &sub #0001 SUB2 JMP2r ) @debug-esc ( c^ -> ) .debug LDZ ?&continue POP JMP2r &continue @@ -965,12 +966,7 @@ DUP #20 LTH ?read-ctrl DUP #7f EQU ?read-del .tint LDZ SWP DUP2 insert-cell draw-cell - ( TODO: all cursor movement should potentially set/unset this flag ) - ( so this should move into forward and everything else ) - .cur-x LDZ2 .max-x LDZ2 EQU2 .cur-wrap STZ - clear-cursor - forward - BRK + clear-cursor forward BRK @read-ctrl ( c^ -> BRK ) DUP #07 EQU ?read-bel @@ -1016,8 +1012,8 @@ @read-cr ( 0d -> BRK ) POP .cur-wrap LDZ ?&skip cr &skip BRK -@at-max-y ( -> true? ) - .cur-y LDZ2 .max-y LDZ2 EQU2 JMP2r +@at-max-x ( -> true? ) .cur-x LDZ2 .max-x LDZ2 EQU2 JMP2r +@at-max-y ( -> true? ) .cur-y LDZ2 .max-y LDZ2 EQU2 JMP2r @read-lf ( 0a -> BRK ) POP lf BRK