commit 626b31bb4b32b0d38a686e68cfc371a915a1e4f8
parent c5a76c5a9a0b9bff5fd81e5378fde1f09e3e8f28
Author: Luxferre <lux@ferre>
Date: Sat, 30 Jul 2022 21:04:16 +0300
Code reorg
Diffstat:
3 files changed, 42 insertions(+), 36 deletions(-)
diff --git a/tal-lib/esop-lib-subs.tal b/tal-lib/esop-lib-subs.tal
@@ -7,8 +7,7 @@
%CHAR-TO-NF { #20 SUB BTS #10 SFT2 ;nanofont ADD2 }
( 4x1 scanline output from the nibble )
-( x y nibble -- x y )
-@line4
+@line4 ( x y nibble -- x y )
#04 ( x y nibble counter -- )
&lp
DEC ( first effective counter value is 3 )
@@ -28,8 +27,7 @@
JMP2r
( 4x4 sprite output from the short )
-( x y sprval* -- x y )
-@sprite4
+@sprite4 ( x y sprval* -- x y )
SWP2 OVR2 ( sprval* x y sprval* -- )
( line 1 )
#0c SFT2 NIP ( sprval* x y nibble -- )
@@ -54,16 +52,16 @@
JMP2r
( nanofont character sprite output )
-( x y char -- x y )
-@drawc
+@drawc ( x y char -- x y )
CHAR-TO-NF LDA2 ;sprite4 JSR2
JMP2r
-( same as drawc but auto increment x coord )
-@putc
+
+@putc ( same as drawc but auto increment x coord )
;drawc JSR2
SWP #04 ADD SWP
JMP2r
+( output a complete null-terminated string at x y )
@draw-str ( x y s* -- x y )
&loop
LDAk ( x y s* c -- )
@@ -79,4 +77,10 @@
( nanofont glyphs for ESOP, courtesy of Michaelangel007 )
-@nanofont 0000 4400 aa00 aee0 64c4 ce60 4c60 4000 4840 4240 6600 4e40 0088 0e00 0080 2480 4a40 8440 c460 e6e0 ae20 64c0 8ee0 e220 6ec0 ee20 4040 0448 4840 e0e0 4240 6240 cc20 4ea0 cee0 6860 cac0 ece0 ec80 cae0 aea0 4440 22c0 aca0 88e0 eea0 eaa0 eae0 ee80 eac0 cea0 64c0 e440 aae0 aa40 aee0 a4a0 a440 e4e0 c8c0 8420 6260 4a00 00e0 8400 04c0 8cc0 0cc0 4cc0 08c0 4880 0ccc 8cc0 0880 0448 8ca0 8840 0ce0 0ca0 0cc0 0cc8 0cc4 0c80 0480 4c60 0ae0 0a40 0e60 0cc0 0ae2 0840 6c60 4444 c6c0 6c00 a4a4
+@nanofont
+0000 4400 aa00 aee0 64c4 ce60 4c60 4000 4840 4240 6600 4e40 0088 0e00 0080 2480
+4a40 8440 c460 e6e0 ae20 64c0 8ee0 e220 6ec0 ee20 4040 0448 4840 e0e0 4240 6240
+cc20 4ea0 cee0 6860 cac0 ece0 ec80 cae0 aea0 4440 22c0 aca0 88e0 eea0 eaa0 eae0
+ee80 eac0 cea0 64c0 e440 aae0 aa40 aee0 a4a0 a440 e4e0 c8c0 8420 6260 4a00 00e0
+8400 04c0 8cc0 0cc0 4cc0 08c0 4880 0ccc 8cc0 0880 0448 8ca0 8840 0ce0 0ca0 0cc0
+0cc8 0cc4 0c80 0480 4c60 0ae0 0a40 0e60 0cc0 0ae2 0840 6c60 4444 c6c0 6c00 a4a4
diff --git a/tal-lib/font.tal b/tal-lib/font.tal
@@ -1,27 +0,0 @@
-~esop-lib-macro.tal
-
-|0100
- ;on-frame SETSCRVEC
- #10 #12
-BRK
-
-@on-frame
- ;moveme ;draw-str JSR2
- NIP #10 SWP
- ;&adv KP-A JMPKEY
- ;&back KP-B JMPKEY
- BRK
- &adv
- #fa DBG
- DEC
- BRK
- &back
- #fb DBG
- INC
- BRK
-
-@moveme "MOVE 20 "ME! 00
-
-( include ESOP stdlib routines )
-
-~esop-lib-subs.tal
diff --git a/tal-lib/moveme.tal b/tal-lib/moveme.tal
@@ -0,0 +1,29 @@
+( test program to verify the correctness of graphics and input on ESOP )
+
+~esop-lib-macro.tal
+
+|0100
+ ;on-frame SETSCRVEC
+ #10 #12
+BRK
+
+@on-frame
+ ;moveme ;draw-str JSR2
+ NIP #10 SWP ( reset x coordinate )
+ ;&adv KP-A JMPKEY
+ ;&back KP-B JMPKEY
+ BRK
+ &adv
+ #fa DBG
+ DEC
+ BRK
+ &back
+ #fb DBG
+ INC
+ BRK
+
+@moveme "MOVE 20 "ME! 00
+
+( include ESOP stdlib routines )
+
+~esop-lib-subs.tal