From 2fa88176c06d6c4f0c687e300ccaaa6888d9ed36 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 22 Dec 2020 18:34:03 -0500 Subject: [PATCH] VE: don't emit chars higher than 0x7f Uninitialized blocks often contains garbage, and emitting it on the TRS-80 4P results in serious visual glitches. --- blk.fs | 5 +++-- tools/.gitignore | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blk.fs b/blk.fs index c4e9296..4935b8a 100644 --- a/blk.fs +++ b/blk.fs @@ -804,7 +804,8 @@ 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! ; : @emit C@ 0x20 MAX EMIT ; +: mode! ( c -- ) 4 col- CELL! ; +: @emit C@ 0x20 MAX 0x7f MIN EMIT ; : contents 16 0 DO large? IF 3 ELSE 0 THEN I 3 + AT-XY @@ -819,8 +820,8 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 , 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! ; ( ----- 128 ) +: cmv ( n -- , char movement ) acc@ * EDPOS @ + pos! ; : buftype ( buf ln -- ) 3 OVER AT-XY KEY DUP EMIT DUP 0x20 < IF 2DROP DROP EXIT THEN diff --git a/tools/.gitignore b/tools/.gitignore index a335747..22400e0 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -7,4 +7,5 @@ /blkpack /blkunpack /blkup +/blkdown /smsrom