1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 22:28:06 +11:00
collapseos/blk/402
Virgil Dupras 2d54c3243d grid: add CLRLN and change _lf behavior
Instead of clearing the rest of the line on a _lf, it's simpler
to just clear any new line we're entering into.
2020-11-10 19:35:47 -05:00

12 lines
327 B
Plaintext

: XYPOS [ GRID_MEM LITN ] ;
: _cl* COLS LINES * ;
: AT-XY ( x y -- ) LINES * + _cl* MOD XYPOS ! ;
'? CLRLN NIP NOT [IF]
: CLRLN ( ln -- ) COLS * DUP COLS + SWAP DO 0 I CELL! LOOP ;
[THEN]
: _lf
XYPOS @ COLS / 1+ DUP CLRLN
COLS * _cl* MOD XYPOS ! ;
: _bs 0 ( blank ) XYPOS @ TUCK CELL! ( pos ) 1-
_cl* MOD XYPOS ! ;