~vdupras/collapseos

ac3629b817115b1af75096856ee9499cfbbd3392 — Virgil Dupras 1 year, 5 months ago 421ca51
Make BLK@* and BLK!* into ialiases
M arch/8086/pcat/blk.fs => arch/8086/pcat/blk.fs +1 -1
@@ 85,4 85,4 @@ RS_ADDR 0xa0 - CONSTANT SYSVARS
610 LOAD  ( AT-XY drivers )
390 LOAD  ( xcomp core high )
(entry) _ ( Update LATEST ) PC ORG @ 8 + !
," BLK$ FD$ ' FD@ BLK@* ! ' FD! BLK!* ! " EOT,
," BLK$ FD$ ' FD@ ' BLK@* **! ' FD! ' BLK!* **! " EOT,

M arch/z80/sms/xcomptextmode.fs => arch/z80/sms/xcomptextmode.fs +1 -1
@@ 39,7 39,7 @@ CREATE ~FNT CPFNT5x7
(entry) _
( Update LATEST )
PC ORG @ 8 + !
," TMS$ GRID$ PS2$ BLK$ ' SDC@ BLK@* ! (im1) " EOT,
," TMS$ GRID$ PS2$ BLK$ ' SDC@ ' BLK@* **! (im1) " EOT,
ORG @ 0x100 - DUP |M 2 PC! 2 PC!
DUP 1 ( 16K ) segasig
0x4000 + |M 2 PC! 2 PC!

M arch/z80/trs80/blk.fs => arch/z80/trs80/blk.fs +1 -1
@@ 98,7 98,7 @@ EXX, ( unprotect BC ) ;CODE
( ----- 610 )
: FD@ ['] @RDSEC SWAP FD@! ;
: FD! ['] @WRSEC SWAP FD@! ;
: FD$ ['] FD@ BLK@* ! ['] FD! BLK!* ! ;
: FD$ ['] FD@ ['] BLK@* **! ['] FD! ['] BLK!* **! ;

: CL$ 0x02 0xe8 PC! ( UART RST ) 0xee 0xe9 PC! ( 9600 bauds )
    0b01101100 0xea PC! ( word8 no parity RTS ) ;

M arch/z80/z80mbc2/xcomp.fs => arch/z80/z80mbc2/xcomp.fs +1 -1
@@ 38,6 38,6 @@ CODE (key?) ( TODO: make non-blocking )
(entry) _
( Update LATEST )
PC ORG @ 8 + !
," BLK$ FD$ ' FD@ BLK@* ! ' FD! BLK!* ! " EOT,
," BLK$ FD$ ' FD@ ' BLK@* **! ' FD! ' BLK!* **! " EOT,
ORG @ |M 2 PC! 2 PC!
H@ |M 2 PC! 2 PC!

M blk.fs => blk.fs +5 -7
@@ 833,7 833,7 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 ,
: $H EDPOS @ 0x3c0 AND pos! ;
: $L EDPOS @ 0x3f OR pos! ;
: $g ACC @ 1 MAX 1- 64 * pos! ;
: $@ BLK> @ BLK@* @ EXECUTE 0 BLKDTY ! contents ;
: $@ BLK> @ BLK@* 0 BLKDTY ! contents ;
( ----- 130 )
: $w EDPOS @ BLK( + acc@ 0 DO
    BEGIN C@+ WS? UNTIL BEGIN C@+ WS? NOT UNTIL LOOP


@@ 1911,9 1911,9 @@ SYSVARS 0x55 + :** KEY?
: [THEN] ;
( ----- 372 )
( n -- Fetches block n and write it to BLK( )
: BLK@* 0x34 RAM+ ;
SYSVARS 0x34 + :** BLK@*
( n -- Write back BLK( to storage at block n )
: BLK!* 0x36 RAM+ ;
SYSVARS 0x36 + :** BLK!*
( Current blk pointer in ( )
: BLK> 0x38 RAM+ ;
( Whether buffer is dirty )


@@ 1931,13 1931,11 @@ SYSVARS 0x55 + :** KEY?
    -1 BLK> !
;
( ----- 374 )
: BLK! ( -- )
    BLK> @ BLK!* @ EXECUTE
    0 BLKDTY ! ;
: BLK! ( -- ) BLK> @ BLK!* 0 BLKDTY ! ;
: FLUSH BLKDTY @ IF BLK! THEN -1 BLK> ! ;
: BLK@ ( n -- )
    DUP BLK> @ = IF DROP EXIT THEN
    FLUSH DUP BLK> ! BLK@* @ EXECUTE ;
    FLUSH DUP BLK> ! BLK@* ;
: BLK!! 1 BLKDTY ! ;
: WIPE BLK( 1024 0 FILL BLK!! ;
: WIPED? ( -- f )

M cvm/forth.fs => cvm/forth.fs +1 -1
@@ 9,7 9,7 @@ SYSVARS 0xa0 + CONSTANT GRID_MEM
(entry) _
( Update LATEST )
PC ORG @ 8 + !
," BLK$ ' EFS@ BLK@* ! ' EFS! BLK!* ! GRID$ " EOT,
," BLK$ ' EFS@ ' BLK@* **! ' EFS! ' BLK!* **! GRID$ " EOT,
ORG @ |M 2 PC! 2 PC!
H@ |M 2 PC! 2 PC!


M cvm/stage.bin => cvm/stage.bin +0 -0
M cvm/stage.fs => cvm/stage.fs +2 -2
@@ 4,8 4,8 @@
( Update LATEST )
PC ORG @ 8 + !
," BLK$ "
," ' EFS@ BLK@* ! "
," ' EFS! BLK!* ! "
," ' EFS@ ' BLK@* **! "
," ' EFS! ' BLK!* **! "
EOT,
ORG @ |M 2 PC! 2 PC!
H@ |M 2 PC! 2 PC!

M doc/hw/sdcard.txt => doc/hw/sdcard.txt +3 -2
@@ 15,8 15,9 @@ The subsystem is loaded with "423 436 LOADR".

Initialization of the SDC system is done in multiple steps.
First, the BLK system needs to be initialized with "BLK$". Then
you can plug SDC@ and SDC! into BLK with "' SDC@ BLK@* !" and
"' SDC! BLK! !". That only needs to be done once per boot.
you can plug SDC@ and SDC! into BLK with "' SDC@ ' BLK@* **!"
and "' SDC! ' BLK! **!". That only needs to be done once per
boot.

Then, the SD card that was inserted needs to be initialized. You
can do it with "SDC$". If you have no error, it means that the

M doc/impl.txt => doc/impl.txt +1 -0
@@ 172,6 172,7 @@ SYSVARS   FUTURE USES          +3c       BLK(*
+2e       BOOT C< PTR          +57       FUTURE USES
+30       IN>                  +60       INPUT BUFFER
+32       FUTURE USES          +a0       DRIVERS
+34       BLK@*
+36       BLK!*
+38       BLK>
+3a       BLKDTY

M emul/8086/xcomp.fs => emul/8086/xcomp.fs +2 -2
@@ 19,8 19,8 @@ CODE PC! AX POPx, ( discard ) AX POPx, 6 INT, ;CODE
390 LOAD  ( xcomp core high )
(entry) _ ( Update LATEST ) PC ORG @ 8 + !
," BLK$ "
," ' EFS@ BLK@* ! "
," ' EFS! BLK!* ! "
," ' EFS@ ' BLK@* **! "
," ' EFS! ' BLK!* **! "
EOT,
ORG @ 256 /MOD 2 PC! 2 PC!
H@ 256 /MOD 2 PC! 2 PC!

M emul/z80/xcomp.fs => emul/z80/xcomp.fs +2 -2
@@ 28,8 28,8 @@ RS_ADDR 0xa0 - CONSTANT SYSVARS
( Update LATEST )
PC ORG @ 8 + !
," BLK$ "
," ' EFS@ BLK@* ! "
," ' EFS! BLK!* ! "
," ' EFS@ ' BLK@* **! "
," ' EFS! ' BLK!* **! "
EOT,
ORG @ 256 /MOD 2 PC! 2 PC!
H@ 256 /MOD 2 PC! 2 PC!