1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 19:58:06 +11:00

VE: properly initialize variables

This fixes weird glitches I had on trs80. It's *always* a matter of
RAM initialization. By now, I should know...
This commit is contained in:
Virgil Dupras 2020-06-07 16:16:07 -04:00
parent b2b556911f
commit a36db99651
4 changed files with 7 additions and 8 deletions

View File

@ -1,4 +1,4 @@
VARIABLE ACC
CREATE ACC 0 ,
: _LIST ." Block " DUP . NL LIST ;
: _NUM
ACC @ SWAP _pdacc

View File

@ -1,7 +1,7 @@
( Cursor position in buffer. EDPOS/64 is line number )
VARIABLE EDPOS
CREATE IBUF 64 ALLOT
CREATE FBUF 64 ALLOT
CREATE EDPOS 0 ,
CREATE IBUF 64 ALLOT0
CREATE FBUF 64 ALLOT0
: _cpos BLK( + ;
: _lpos 64 * _cpos ;
: _pln ( lineno -- )

View File

@ -3,14 +3,12 @@
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
UPPER 'Q' = ;
: bufp ( buf -- )
DUP 64 + SWAP DO
i C@ DUP 0x20 < IF DROP 0x20 THEN EMIT
LOOP ;
DUP 64 + SWAP DO i C@ 0x20 MAX EMIT LOOP ;
: bufs
1 aty ." I: " IBUF bufp
2 aty ." F: " FBUF bufp ;
: c<over KEY DUP EMIT DUP 0x0a = IF DROP 0x0d THEN ;
: VE ['] c<over 0x08 ( C< override ) RAM+ !
clrscr 0acc 0 EDPOS ! 0 PREVPOS ! contents
clrscr 0acc 0 PREVPOS ! contents
BEGIN status bufs setpos KEY handle UNTIL
0 0x08 RAM+ ! 19 aty ;

View File

@ -2,3 +2,4 @@
SWAP 2 PICK + ( a b a+n ) ROT ( b a+n a ) DO ( b )
DUP I C!
LOOP DROP ;
: ALLOT0 ( n -- ) H@ OVER 0 FILL ALLOT ;