From e7a6c777c7364186b4d9aa4f8e631f7a43fa792f Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 5 Jun 2020 10:38:05 -0400 Subject: [PATCH] VE: refactor mode indicators The indicator is going to be empty most of the time and will be emitted by the mode changer directly. That's going to the upper-right corner and the status bar avoids emitting in that area. --- blk/126 | 10 +++++----- blk/127 | 2 +- blk/128 | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/blk/126 b/blk/126 index 9b6d2fe..71f7a23 100644 --- a/blk/126 +++ b/blk/126 @@ -1,13 +1,13 @@ CREATE CMD 2 C, '$' C, 0 C, -VARIABLE MODE VARIABLE MODEC +VARIABLE MODE : 0acc 0 ACC ! ; : acc@ ACC @ 1 MAX 0acc ; : num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ; : nspcs ( n -- , spit n space ) 0 DO SPC LOOP ; : aty 0 SWAP AT-XY ; -: clrln DUP aty COLS nspcs aty ; -: clrscr LINES 0 DO i clrln LOOP ; -: status 0 clrln ." BLK" SPC BLK> ? SPC ACC ? - SPC EDPOS @ 64 /MOD . ',' EMIT . SPC MODEC C@ EMIT ; +: clrscr LINES 0 DO i aty COLS nspcs LOOP ; +: status 0 aty ." BLK" SPC BLK> ? SPC ACC ? + SPC EDPOS @ 64 /MOD . ',' EMIT . 10 nspcs ; : contents 3 aty BLK> @ LIST ; : selblk BLK@ contents ; +: mode! ( c -- ) 63 0 AT-XY ; diff --git a/blk/127 b/blk/127 index 24ebb2a..089812b 100644 --- a/blk/127 +++ b/blk/127 @@ -6,7 +6,7 @@ : $g ACC @ selblk 0acc ; : $[ BLK> @ acc@ - selblk ; : $] BLK> @ acc@ + selblk ; -: $I 3 1 AT-XY I contents ; +: $I mode! 'I' EMIT 3 1 AT-XY I contents mode! SPC ; : $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ; : $H 0acc EDPOS @ 0x3c0 AND EDPOS ! ; : $L 0acc EDPOS @ 0x3f OR EDPOS ! ; diff --git a/blk/128 b/blk/128 index b9c2563..6c627f8 100644 --- a/blk/128 +++ b/blk/128 @@ -8,4 +8,4 @@ DUP '0' '9' =><= IF num 0 EXIT THEN DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN UPPER 'Q' = ; -: modeM ['] handleM MODE ! 'M' MODEC C! ; +: modeM ['] handleM MODE ! mode! SPC ;