fix wrap bug

This commit is contained in:
~d6 2023-02-15 17:30:23 -05:00
parent d711a6106e
commit 7e0041c4ac
1 changed files with 7 additions and 4 deletions

View File

@ -129,7 +129,7 @@
;meta .System/metadata DEO2
;meta/name .System/title DEO2
( 80 cols x 24 rows + 1 col for padding )
( 80 cols x 24 rows )
#0018 .rows STZ2
#0050 .cols STZ2
@ -883,10 +883,10 @@
DUP #20 LTH ?read-ctrl
DUP #7f EQU ?read-del
.tint LDZ SWP DUP2 insert-cell draw-cell
forward
( 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
forward
BRK
@read-ctrl ( c^ -> BRK )
@ -976,14 +976,17 @@
@maybe-autowrap ( -> )
.cur-wrap LDZ #00 EQU ?&skip
#00 .cur-wrap STZ
( #010e DEO )
clear-cursor #0000 .cur-x STZ2
at-max-y ?&scrolling
.cur-y LDZ2k INC2 ROT STZ2
&skip JMP2r
&scrolling #010e DEO !scroll
&scrolling !scroll
@insert-cell ( cell* -> )
maybe-autowrap ( cell* )
( DUP #20 EQU ?&space ) ( cell* )
maybe-autowrap ( &space ) ( cell* )
.irm LDZ #00 EQU ?&replace ( cell* )
cur-addr ( cell* lim* )
eol-addr #0002 SUB2 ( cell* lim* last=eol-2* )