esop

Essential Stack-Operated Phone (concept)
git clone git://git.luxferre.top/esop.git
Log | Files | Refs | README | LICENSE

commit 4feb0d6529db1af84a7cb0023705337c9a24bc14
parent a15a2c15b83695d0bcfc2926765f45f5ae9c1dd3
Author: Luxferre <lux@ferre>
Date:   Sat, 30 Jul 2022 18:56:08 +0300

@sprite4 should work

Diffstat:
Mtal-lib/font.tal | 49++++++++++++++++++++++++++++---------------------
1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/tal-lib/font.tal b/tal-lib/font.tal @@ -6,7 +6,11 @@ BRK @on-frame - LIT 'O ;drawc JSR2 + LIT 'K ;putc JSR2 + LIT 'O ;putc JSR2 + LIT 'o ;putc JSR2 + LIT 'L ;putc JSR2 + SWP #10 SUB SWP ;&adv KP-A JMPKEY ;&back KP-B JMPKEY BRK @@ -45,33 +49,36 @@ BRK SWP #04 SUB SWP ( restore x coord ) JMP2r -( 4x4 sprite output from the memory ) -( x y addr* -- x y ) +( 4x4 sprite output from the short ) +( x y sprval* -- x y ) @sprite4 - ( get sprite contents ) - LDA2 ( x y sprval* -- ) SWP2 OVR2 ( sprval* x y sprval* -- ) - #04 ( sprval* x y sprval* counter -- ) - &lp - DEC ( first effective counter value is 3 ) - DUP SWP2 ROT ( sprval* x y counter sprval* counter -- ) - GETNIBBLE ( sprval* x y counter nibble -- ) - SWP ( sprval* x y nibble counter -- ) - DBGBYTE - STH ( sprval* x y nibble -- ) ( stash counter into return stack ) - ;line4 JSR2 ( sprval* x y -- ) - INC ( increment y coord ) - STHr ( sprval* x y counter -- ) ( restore counter from return stack ) - DBGBYTE - DUP ,&lp JCN - POP SWP2 POP2 ( sprval* x y counter -- x y ) - #04 SUB ( restore y coord ) + ( line 1 ) + #0c SFT2 NIP ( sprval* x y nibble -- ) + ;line4 JSR2 ( sprval* x y -- ) + ( line 2 ) + INC ( increment y coord ) + OVR2 ( sprval* x y sprval* -- ) + #08 SFT2 NIP #0f AND ( sprval* x y nibble -- ) + ;line4 JSR2 ( sprval* x y -- ) + ( line 3 ) + INC ( increment y coord ) + OVR2 ( sprval* x y sprval* -- ) + #04 SFT2 NIP #0f AND ( sprval* x y nibble -- ) + ;line4 JSR2 ( sprval* x y -- ) + ( line 4 ) + INC ( increment y coord ) + OVR2 ( sprval* x y sprval* -- ) + NIP #0f AND ( sprval* x y nibble -- ) + ;line4 JSR2 ( sprval* x y -- ) + #03 SUB ( restore y coord ) + SWP2 POP2 ( x y -- ) JMP2r ( nanofont character sprite output ) ( x y char -- x y ) @drawc - CHAR-TO-NF DBGSHORT ;sprite4 JSR2 + CHAR-TO-NF LDA2 ;sprite4 JSR2 JMP2r ( same as drawc but auto increment x coord ) @putc