1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-27 18:48:05 +11:00
collapseos/blk/127

17 lines
655 B
Plaintext
Raw Normal View History

2020-11-14 12:44:39 +11:00
: mode! ( c -- ) 4 col- 0 AT-XY ;
: contents
16 0 DO
large? IF 3 ELSE 0 THEN I 3 + AT-XY
64 I * BLK( + ( lineaddr ) xoff @ + DUP width + SWAP
DO I C@ 0x20 MAX EMIT LOOP LOOP
large? IF 3 16 gutter THEN ;
: selblk BLK> @ PREVBLK ! BLK@ contents ;
2020-06-07 21:25:02 +10:00
: pos! ( newpos -- ) EDPOS @ PREVPOS !
DUP 0< IF DROP 0 THEN 1023 MIN EDPOS ! ;
2020-11-14 12:44:39 +11:00
: xoff? pos@ DROP ( x )
xoff @ ?DUP IF < IF 0 xoff ! contents THEN ELSE
width >= IF 64 COLS - xoff ! contents THEN THEN ;
: setpos ( -- ) pos@ 3 + ( header ) SWAP ( y x ) xoff @ -
large? IF 3 + ( gutter ) THEN SWAP AT-XY ;
: cmv ( n -- , char movement ) acc@ * EDPOS @ + pos! ;