mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 15:48:05 +11:00
VE: refresh IBUF and FBUF only when needed
In emulation, emitting is near-immediate. On a real machine, it's often not-so-near-immediate. These little things help usability. Again, this commit was meta-developed!
This commit is contained in:
parent
2fa88176c0
commit
7d29c12c25
30
blk.fs
30
blk.fs
@ -827,16 +827,22 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 ,
|
|||||||
DUP 0x20 < IF 2DROP DROP EXIT THEN
|
DUP 0x20 < IF 2DROP DROP EXIT THEN
|
||||||
( buf ln c ) 4 col- nspcs SWAP 4 SWAP AT-XY ( buf c )
|
( buf ln c ) 4 col- nspcs SWAP 4 SWAP AT-XY ( buf c )
|
||||||
SWAP C!+ IN( _zbuf (rdln) IN( SWAP 63 MOVE ;
|
SWAP C!+ IN( _zbuf (rdln) IN( SWAP 63 MOVE ;
|
||||||
|
: bufp ( buf -- )
|
||||||
|
DUP 3 col- + SWAP DO I @emit LOOP ;
|
||||||
|
: bufs
|
||||||
|
1 aty ." I: " IBUF bufp
|
||||||
|
2 aty ." F: " FBUF bufp
|
||||||
|
large? IF 0 3 gutter THEN ;
|
||||||
( ----- 129 )
|
( ----- 129 )
|
||||||
: $G ACC @ selblk ;
|
: $G ACC @ selblk ;
|
||||||
: $[ BLK> @ acc@ - selblk ;
|
: $[ BLK> @ acc@ - selblk ;
|
||||||
: $] BLK> @ acc@ + selblk ;
|
: $] BLK> @ acc@ + selblk ;
|
||||||
: $t PREVBLK @ selblk ;
|
: $t PREVBLK @ selblk ;
|
||||||
: $I 'I' mode! IBUF 1 buftype _i contents 0x20 mode! ;
|
: $I 'I' mode! IBUF 1 buftype _i bufs contents 0x20 mode! ;
|
||||||
: $F 'F' mode! FBUF 2 buftype _F setpos 0x20 mode! ;
|
: $F 'F' mode! FBUF 2 buftype _F bufs setpos 0x20 mode! ;
|
||||||
: $Y Y ;
|
: $Y Y bufs ;
|
||||||
: $E _E contents ;
|
: $E _E bufs contents ;
|
||||||
: $X acc@ _X contents ;
|
: $X acc@ _X bufs contents ;
|
||||||
: $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ;
|
: $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ;
|
||||||
: $H EDPOS @ 0x3c0 AND pos! ;
|
: $H EDPOS @ 0x3c0 AND pos! ;
|
||||||
: $L EDPOS @ 0x3f OR pos! ;
|
: $L EDPOS @ 0x3f OR pos! ;
|
||||||
@ -859,7 +865,7 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 ,
|
|||||||
: $f EDPOS @ PREVPOS @ 2DUP = IF 2DROP EXIT THEN
|
: $f EDPOS @ PREVPOS @ 2DUP = IF 2DROP EXIT THEN
|
||||||
2DUP > IF DUP pos! SWAP THEN
|
2DUP > IF DUP pos! SWAP THEN
|
||||||
( p1 p2, p1 < p2 ) OVER - 64 MIN ( pos len ) FBUF _zbuf
|
( p1 p2, p1 < p2 ) OVER - 64 MIN ( pos len ) FBUF _zbuf
|
||||||
SWAP _cpos FBUF ( len src dst ) ROT MOVE ;
|
SWAP _cpos FBUF ( len src dst ) ROT MOVE bufs ;
|
||||||
: $R ( replace mode )
|
: $R ( replace mode )
|
||||||
'R' mode!
|
'R' mode!
|
||||||
BEGIN setpos KEY DUP BS? IF -1 EDPOS +! DROP 0 THEN
|
BEGIN setpos KEY DUP BS? IF -1 EDPOS +! DROP 0 THEN
|
||||||
@ -870,22 +876,16 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 ,
|
|||||||
: $o EDPOS @ 0x3c0 < IF EDPOS @ 64 + EDPOS ! $O THEN ;
|
: $o EDPOS @ 0x3c0 < IF EDPOS @ 64 + EDPOS ! $O THEN ;
|
||||||
: $D $H 64 icpy
|
: $D $H 64 icpy
|
||||||
acc@ 0 DO 16 EDPOS @ 64 / DO I _mvln- LOOP LOOP
|
acc@ 0 DO 16 EDPOS @ 64 / DO I _mvln- LOOP LOOP
|
||||||
BLK!! contents ;
|
BLK!! bufs contents ;
|
||||||
( ----- 132 )
|
( ----- 132 )
|
||||||
: UPPER DUP 'a' 'z' =><= IF 32 - THEN ;
|
: UPPER DUP 'a' 'z' =><= IF 32 - THEN ;
|
||||||
: handle ( c -- f )
|
: handle ( c -- f )
|
||||||
DUP '0' '9' =><= IF num 0 EXIT THEN
|
DUP '0' '9' =><= IF num 0 EXIT THEN
|
||||||
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
|
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
|
||||||
0 ACC ! UPPER 'Q' = ;
|
0 ACC ! UPPER 'Q' = ;
|
||||||
: bufp ( buf -- )
|
|
||||||
DUP 3 col- + SWAP DO I @emit LOOP ;
|
|
||||||
: bufs
|
|
||||||
1 aty ." I: " IBUF bufp
|
|
||||||
2 aty ." F: " FBUF bufp
|
|
||||||
large? IF 0 3 gutter THEN ;
|
|
||||||
: VE
|
: VE
|
||||||
1 XYMODE C! clrscr 0 ACC ! 0 PREVPOS ! nums contents
|
1 XYMODE C! clrscr 0 ACC ! 0 PREVPOS ! nums bufs contents
|
||||||
BEGIN xoff? status bufs setpos KEY handle UNTIL
|
BEGIN xoff? status setpos KEY handle UNTIL
|
||||||
0 XYMODE C! 19 aty (infl) ;
|
0 XYMODE C! 19 aty (infl) ;
|
||||||
( ----- 160 )
|
( ----- 160 )
|
||||||
( AVR Programmer, load range 160-163. doc/avr.txt )
|
( AVR Programmer, load range 160-163. doc/avr.txt )
|
||||||
|
Loading…
Reference in New Issue
Block a user