fix some bugs

This commit is contained in:
~d6 2022-03-11 00:06:48 -05:00
parent 7fce584588
commit ed20ad7865
1 changed files with 10 additions and 9 deletions

View File

@ -440,6 +440,7 @@
&noop JMP2r &noop JMP2r
@refresh @refresh
;rel-line-error ;error! JMP2 ( FIXME )
;draw-all JSR2 BRK ;draw-all JSR2 BRK
@debug @debug
@ -522,6 +523,9 @@
@draw-cursor ( -> ) @draw-cursor ( -> )
;cur-w-col JSR2 .term/lmargin LDZ2 ADD2 ;cur-w-col JSR2 .term/lmargin LDZ2 ADD2
DUP2 .term/cols LDZ2 LTH2 ,&ok JCN
( TODO: handle long line here )
&ok
;cur-rel-row JSR2 ;cur-rel-row JSR2
;term-move-cursor JMP2 ;term-move-cursor JMP2
@ -546,7 +550,7 @@
;messages/lines ;print JSR2 ;messages/lines ;print JSR2
#20 emit #20 emit
LIT '( emit LIT '( emit
;cur-col JSR2 INC ;emit-dec JSR2 ;cur-col JSR2 INC2 ;emit-dec2 JSR2
LIT ', emit LIT ', emit
;cur-abs-row JSR2 INC2 ;emit-dec2 JSR2 ;cur-abs-row JSR2 INC2 ;emit-dec2 JSR2
LIT ') emit LIT ') emit
@ -586,9 +590,6 @@
&bol &bol
ADD2kr STH2r ;draw-linenum JSR2 ADD2kr STH2r ;draw-linenum JSR2
.term/lmargin LDZ2 INC2 ,&x STR2 .term/lmargin LDZ2 INC2 ,&x STR2
( TODO: use this for cursor-line highlighting and long line support )
( STH2kr .cursor/row LDZ2 INC2 NEQ2 ,&loop JCN
;emit-color-reverse JSR2 )
&loop ( offset [k line-offset] ) &loop ( offset [k line-offset] )
LDAk #00 EQU ,&eof JCN LDAk #00 EQU ,&eof JCN
LDAk #0a EQU ,&eol JCN LDAk #0a EQU ,&eol JCN
@ -759,10 +760,10 @@
JMP2r JMP2r
@inc-row ( -> ) @inc-row ( -> )
.cursor/row LDZ2k INC2 SWP2 STA2 JMP2r .cursor/row LDZ2 INC2 .cursor/row STZ2 JMP2r
@dec-row ( -> ) @dec-row ( -> )
.cursor/row LDZ2k #0001 SUB2 SWP2 STA2 .cursor/row LDZ2 #0001 SUB2 .cursor/row STZ2 JMP2r
@last-pos ( -> addr* ) @last-pos ( -> addr* )
.buffer/limit LDZ2 #0001 SUB2 JMP2r .buffer/limit LDZ2 #0001 SUB2 JMP2r