diff --git a/blk/056 b/blk/056 index d3db076..5e28f9b 100644 --- a/blk/056 +++ b/blk/056 @@ -6,7 +6,9 @@ Logic >< n l h -- f Push true if l < n < h =><= n l h -- f Push true if l <= n <= h CMP n1 n2 -- n Compare n1 and n2 and set n to -1, 0, or 1. - n=0: a1=a2. n=1: a1>a2. n=-1: a1a2. n=-1: a1 CMP 1 = ; : 0< 32767 > ; : >= < NOT ; : <= > NOT ; : 0>= 0< NOT ; -( n l h -- f ) -: >< 2 PICK > ( n l f ) ROT ROT > AND ; +: >< ( n l h -- f ) 2 PICK > ( n l f ) ROT ROT > AND ; : =><= 2 PICK >= ( n l f ) ROT ROT >= AND ; -( a -- a+1 c ) -: C@+ DUP C@ SWAP 1+ SWAP ; -( c a -- a+1 ) -: C!+ SWAP OVER C! 1+ ; -( a -- a-1 c ) -: C@- DUP C@ SWAP 1- SWAP ; -( c a -- a-1 ) -: C!- SWAP OVER C! 1- ; +: MIN ( n n - n ) 2DUP > IF SWAP THEN DROP ; +: MAX ( n n - n ) 2DUP < IF SWAP THEN DROP ; +: C@+ ( a -- a+1 c ) DUP C@ SWAP 1+ SWAP ; +: C!+ ( c a -- a+1 ) SWAP OVER C! 1+ ; +: C@- ( a -- a-1 c ) DUP C@ SWAP 1- SWAP ; +: C!- ( c a -- a-1 ) SWAP OVER C! 1- ; diff --git a/blk/627 b/blk/627 index 4aa6757..b8ded29 100644 --- a/blk/627 +++ b/blk/627 @@ -1,14 +1,6 @@ -: _set ( row col tilenum -- ) - ROT 5 LSHIFT ROT OR 0x7800 OR _ctl - _data 1 _zero +: (emit) + XYPOS @ 2 * 0x7800 OR _ctl + 0x20 - 0x5e MIN ( tilenum ) _data 1 _zero + XYPOS @ 1+ DUP [ VDP_COLS VDP_ROWS * LITN ] + = IF DROP 0 THEN XYPOS ! ; -: VDP$ - 9 0 DO _idat I 2 * + @ _ctl LOOP _blank - ( palettes ) - 0xc000 _ctl - ( BG ) 1 _zero 0x3f _data 14 _zero - ( sprite, inverted colors ) 0x3f _data 15 _zero - 0x4000 _ctl 0x5e 0 DO ~FNT I 7 * + _sfont LOOP - 0 0 1 _set -; - diff --git a/blk/628 b/blk/628 new file mode 100644 index 0000000..abd4ef2 --- /dev/null +++ b/blk/628 @@ -0,0 +1,9 @@ +: VDP$ + 9 0 DO _idat I 2 * + @ _ctl LOOP _blank + ( palettes ) + 0xc000 _ctl + ( BG ) 1 _zero 0x3f _data 14 _zero + ( sprite, inverted colors ) 0x3f _data 15 _zero + 0x4000 _ctl 0x5e 0 DO ~FNT I 7 * + _sfont LOOP + 0 XYPOS ! +; diff --git a/emul/forth.bin b/emul/forth.bin index 85666f4..4bf769f 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ diff --git a/recipes/sms/xcomp.fs b/recipes/sms/xcomp.fs index 8fe4c50..9353fe6 100644 --- a/recipes/sms/xcomp.fs +++ b/recipes/sms/xcomp.fs @@ -21,12 +21,12 @@ CURRENT @ XCURRENT ! 282 LOAD ( boot.z80 ) 393 LOAD ( xcomp core low ) CREATE ~FNT CPFNT7x7 -623 627 LOADR ( VDP ) -: (key) 0 ; : (emit) DROP ; +623 628 LOADR ( VDP ) +: (key) 4 ; 420 LOAD ( xcomp core high ) (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -," VDP$ BYE " +," VDP$ " EOT, ORG @ 0x100 - 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!