From 80a4731d72d505f7c40aa3bbec58c08395b26642 Mon Sep 17 00:00:00 2001 From: d6 Date: Fri, 11 Mar 2022 00:48:52 -0500 Subject: [PATCH] wip --- femto.tal | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/femto.tal b/femto.tal index 0732d9b..898cc17 100644 --- a/femto.tal +++ b/femto.tal @@ -521,13 +521,23 @@ @term-erase-all ( -> ) ansi LIT '2 emit LIT 'J emit JMP2r +@offset-for-cur-row + .buffer/offset LDZ2 ( offset ) + #0000 ;cur-rel-row JSR2 SUB2 STH2 ( offset [-k] ) + &loop STH2r ORA ,&next JCN + POP2r JMP2r + &next LDAk #0a NEQ JMP INC2r + INC2 ,&loop JMP + @draw-cursor ( -> ) ;cur-w-col JSR2 .term/lmargin LDZ2 ADD2 - DUP2 .term/cols LDZ2 LTH2 ,&ok JCN - ( TODO: handle long line here ) + .term/cols LDZ2 LTH2 ,&ok JCN + ( we have a long line ) + ( ;offset-for-cur-row JSR2 ) &ok - ;cur-rel-row JSR2 - ;term-move-cursor JMP2 + ;cur-w-col JSR2 .term/lmargin LDZ2 ADD2 + ;cur-rel-row JSR2 + ;term-move-cursor JMP2 @draw-statusbar ( -> ) #0000 .term/rows LDZ2 ;term-move-cursor JSR2