mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-17 00:38:06 +11:00
10da104873
I'm planning on de-hardcoding columns in VE a bit to add support for screens narrower than 67 columns. There's a lot of hardcoding. Let's begin with not using core's LIST anymore. This allows us to spit 1-16 numbers only at startup.
17 lines
614 B
Plaintext
17 lines
614 B
Plaintext
: contents 16 0 DO 3 I 3 + AT-XY
|
|
64 I * BLK( + DUP 64 + SWAP DO
|
|
I C@ 0x20 MAX EMIT LOOP LOOP
|
|
3 16 gutter ;
|
|
: selblk BLK> @ PREVBLK ! BLK@ contents ;
|
|
: mode! ( c -- ) 63 0 AT-XY ;
|
|
: pos! ( newpos -- ) EDPOS @ PREVPOS !
|
|
DUP 0< IF DROP 0 THEN 1023 MIN EDPOS ! ;
|
|
: setpos ( -- ) EDPOS @ 64 /MOD
|
|
3 + ( header ) SWAP 3 + ( gutter ) SWAP AT-XY ;
|
|
: cmv ( n -- , char movement ) acc@ * EDPOS @ + pos! ;
|
|
: buftype ( buf ln -- )
|
|
3 OVER AT-XY KEY DUP EMIT
|
|
DUP 0x20 < IF 2DROP DROP EXIT THEN
|
|
( buf ln c ) 63 nspcs SWAP 4 SWAP AT-XY ( buf c ) SWAP C!+
|
|
IN( _zbuf (rdln) IN( SWAP 63 MOVE ;
|