goto-end + bugfix

This commit is contained in:
~d6 2022-02-12 02:25:41 -05:00
parent 652dac7830
commit 233e8b07f2
1 changed files with 13 additions and 4 deletions

View File

@ -280,7 +280,16 @@
@escape ( -> )
#01 ;saw-esc STA BRK
@goto-end ( FIXME )
( TODO: small buffers )
@goto-end ( -> )
;buffer/line-count LDA2 ;term/rows LDA2 ( #00 #00 DIV ) SUB2
DUP2 ;buffer/line-offset STA2
;abs-line JSR2 ;buffer/offset STA2
height #01 SUB ;cursor/row STA
;cur-len JSR2 NIP ;cursor/col STA
;draw-all JSR2
BRK
@goto-start ( -> )
;buffer/data ;buffer/offset STA2
#0000 ;buffer/line-offset STA2
@ -386,9 +395,9 @@
;messages/lines ;print JSR2
#20 emit
LIT '( emit
;cursor/col LDA ;emit-dec JSR2
;cursor/col LDA INC ;emit-dec JSR2
LIT ', emit
;cur-abs-row JSR2 ;emit-dec2 JSR2
;cur-abs-row JSR2 INC2 ;emit-dec2 JSR2
LIT ') emit
ansi LIT '0 emit LIT 'm emit
@ -441,7 +450,7 @@
@abs-line ( y* -> s* )
#0000 SWP2 SUB2 STH2 ( [-y] )
;buffer/data LDA2 ( addr )
;buffer/data ( addr )
&newline ( addr [-y] )
STH2kr ORA ,&loop JCN ,&done JMP
&loop ( addr [-y] )