diff --git a/blk.fs b/blk.fs index 7bf1e37..e6ba921 100644 --- a/blk.fs +++ b/blk.fs @@ -776,7 +776,7 @@ block. Any change made to the previously selected block is saved beforehand. '[' and ']' advances the selected block by "modifier". 't' opens -the previously opened block. +the previously opened block. (cont.) ( ----- 123 ) 'h' and 'l' move the cursor by "modifier" characters. 'j' and @@ -806,7 +806,7 @@ be sure, then press 'E'. Following keystrokes replace current character and advance cursor. Press return to return to normal mode. -'@' re-reads current block even if it's dirty, thus undoing +'@' re-reads current block even if it's dirty, thus undoing recent changes. ( ----- 125 ) -20 LOAD+ ( B105, block editor ) @@ -855,7 +855,7 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 , CREATE xoff 0 , : $G ACC @ selblk ; : $[ BLK> @ acc@ - selblk ; : $] BLK> @ acc@ + selblk ; -: $t PREVBLK @ selblk ; +: $t PREVBLK @ selblk ; : $I mode! 'I' EMIT IBUF 1 buftype _i contents mode! SPC ; : $F mode! 'F' EMIT FBUF 2 buftype _F setpos mode! SPC ; : $Y Y ; @@ -2221,7 +2221,7 @@ Load range: B402-B403 ( ----- 402 ) : XYPOS [ GRID_MEM LITN ] ; : _cl* COLS LINES * ; -: AT-XY ( x y -- ) LINES * + _cl* MOD XYPOS ! ; +: AT-XY ( x y -- ) COLS * + _cl* MOD XYPOS ! ; '? NEWLN NIP NOT [IF] : NEWLN ( ln -- ) COLS * DUP COLS + SWAP DO 0 I CELL! LOOP ; [THEN] diff --git a/cvm/Makefile b/cvm/Makefile index d5f2473..cf62e36 100644 --- a/cvm/Makefile +++ b/cvm/Makefile @@ -15,7 +15,7 @@ $(BLKUNPACK): $(BLKPACK) stage: stage.c $(OBJS) blkfs $(CC) -DFBIN_PATH=\"`pwd`/stage.bin\" -DBLKFS_PATH=\"`pwd`/blkfs\" stage.c $(OBJS) -o $@ -blkfs: $(BLKPACK) +blkfs: ../blk.fs $(BLKPACK) $(BLKPACK) < ../blk.fs > $@ forth.bin: stage common.fs forth.fs blkfs diff --git a/cvm/forth.fs b/cvm/forth.fs index 04f19a6..e72064a 100644 --- a/cvm/forth.fs +++ b/cvm/forth.fs @@ -1,15 +1,15 @@ -: (emit) 0 PC! ; : COLS 80 ; : LINES 32 ; -: AT-XY 6 PC! ( y ) 5 PC! ( x ) ; +: CELL! ( g pos -- ) + COLS /MOD 6 PC! ( y ) 5 PC! ( x ) 0x20 + 0 PC! ; +: NEWLN ( ln -- ) DROP 0xa 0 PC! ; +SYSVARS 0x70 + CONSTANT GRID_MEM +402 403 LOADR ( Grid ) 390 LOAD ( xcomp core high ) (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -," BLK$ " -," ' EFS@ BLK@* ! " -," ' EFS! BLK!* ! " -EOT, +," BLK$ ' EFS@ BLK@* ! ' EFS! BLK!* ! 0 0 AT-XY " EOT, ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!