VE: avoid spitting control chars in "bufp"

On a TRS-80 4P, spitting control chars, in addition to being
visually distasteful, generated a bug where the blinking cursor
would disappear, making using VE much, much harder.

I had a hard time reproducing the bug: you don't trigger it by
simply spitting control chars, it had to be a specific number of
them in a specific order. I didn't identify the sequence, but I
know that "bufp" triggered it.

This commit was written on a TRS-80 4P and downloaded from my work
floppies!
This commit is contained in:
Virgil Dupras 2020-12-21 16:57:39 -05:00
parent 8992cdbbf6
commit 625afba86a
1 changed files with 3 additions and 4 deletions

7
blk.fs
View File

@ -804,12 +804,12 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 ,
BLKDTY @ IF '*' EMIT THEN 4 nspcs ;
: nums 17 1 DO 2 I + aty I . SPC SPC LOOP ;
( ----- 127 )
: mode! ( c -- ) 4 col- CELL! ;
: mode! ( c -- ) 4 col- CELL! ; : @emit C@ 0x20 MAX EMIT ;
: 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
DO I @emit LOOP LOOP
large? IF 3 16 gutter THEN ;
: selblk BLK> @ PREVBLK ! BLK@ contents ;
: pos! ( newpos -- ) EDPOS @ PREVPOS !
@ -877,7 +877,7 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 ,
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
0 ACC ! UPPER 'Q' = ;
: bufp ( buf -- )
DUP 3 col- + SWAP DO I C@ EMIT LOOP ;
DUP 3 col- + SWAP DO I @emit LOOP ;
: bufs
1 aty ." I: " IBUF bufp
2 aty ." F: " FBUF bufp
@ -1053,7 +1053,6 @@ CREATE tickfactor 44 ,
override. )
: LD(HL)E*, SYSVARS 0x3e + LDA(i), A ORr,
IFZ, (HL) E LDrr, ELSE, SYSVARS 0x3e + CALL, THEN, ;
( ----- 283 )
H@ ORG ! ( STABLE ABI )
0 JP, ( 00, main ) NOP, ( unused ) NOP, NOP, ( 04, BOOT )