commit 1e0edd746113955794471fac640b8f52ed8d1a72
parent 9ade9bd524d1df57d5d19deae0e48cf425a822da
Author: neauoire <aliceffekt@gmail.com>
Date: Fri, 8 Apr 2022 11:41:07 -0700
Improved label.tal
Diffstat:
2 files changed, 24 insertions(+), 42 deletions(-)
diff --git a/projects/examples/demos/bunnymark.tal b/projects/examples/demos/bunnymark.tal
@@ -6,7 +6,7 @@
|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 &debug $1 &halt $1
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &wheel $1
-|b0 @Date &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
+|c0 @Date &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
|0000
diff --git a/projects/examples/gui/label.tal b/projects/examples/gui/label.tal
@@ -8,11 +8,11 @@
@center &x $2 &y $2
|0100
-
+
( theme )
- #f0d7 .System/r DEO2
- #f0de .System/g DEO2
- #f0dc .System/b DEO2
+ #a0dc .System/r DEO2
+ #a0dc .System/g DEO2
+ #a0dc .System/b DEO2
( find screen center )
.Screen/width DEI2 #01 SFT2 .center/x STZ2
.Screen/height DEI2 #01 SFT2 .center/y STZ2
@@ -28,32 +28,32 @@
POP2 POP2
( left )
.center/x LDZ2 .Screen/x DEO2
- .center/y LDZ2 #0020 SUB2 .Screen/y DEO2
- ;left-txt #09 ;draw-uf2 JSR2
+ .center/y LDZ2 #0018 SUB2 .Screen/y DEO2
+ ;left-txt ,draw-uf2 JSR
( center )
.center/x LDZ2 .Screen/x DEO2
.center/y LDZ2 .Screen/y DEO2
- ;center-txt #09 ;draw-uf2-center JSR2
+ ;center-txt ,draw-uf2-center JSR
( right )
.center/x LDZ2 .Screen/x DEO2
- .center/y LDZ2 #0020 ADD2 .Screen/y DEO2
- ;right-txt #09 ;draw-uf2-right JSR2
+ .center/y LDZ2 #0018 ADD2 .Screen/y DEO2
+ ;right-txt ,draw-uf2-right JSR
BRK
@draw-uf2-center ( text* color -- )
-
- STH
- DUP2 ,get-width JSR #01 SFT2 STH2 .Screen/x DEI2k STH2r SUB2 ROT DEO2
- STHr ,draw-uf2 JSR
+
+ DUP2 ,get-width JSR #01 SFT2 STH2
+ .Screen/x DEI2k STH2r SUB2 ROT DEO2
+ ,draw-uf2 JSR
JMP2r
@draw-uf2-right ( text* color -- )
- STH
- DUP2 ,get-width JSR STH2 .Screen/x DEI2k STH2r SUB2 ROT DEO2
- STHr ,draw-uf2 JSR
+ DUP2 ,get-width JSR STH2
+ .Screen/x DEI2k STH2r SUB2 ROT DEO2
+ ,draw-uf2 JSR
JMP2r
@@ -68,19 +68,17 @@ JMP2r
JMP2r
-@draw-uf2 ( text* color -- )
+@draw-uf2 ( text* -- )
- STH
#15 .Screen/auto DEO
&while
- LDAk STHkr SWP
- #00 SWP #20 SUB
- ( addr ) DUP2 #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
- ( anchor ) ;font ADD2 LDA #00 SWP .Screen/x DEI2 ADD2 STH2
- .Screen/sprite DEOk DEO
- STH2r .Screen/x DEO2
+ LDAk #20 SUB #00 SWP
+ DUP2 #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
+ ;font ADD2 LDA #00 SWP .Screen/x DEI2 ADD2
+ #01 .Screen/sprite DEOk DEO
+ .Screen/x DEO2
INC2 LDAk ,&while JCN
- POP2 POPr
+ POP2
JMP2r
@@ -88,22 +86,6 @@ JMP2r
@center-txt "Center 20 "Aligned 20 "Label $1
@right-txt "Right 20 "Aligned 20 "Label $1
-@unknown-icn
- aa55 aa55 aa55 aa55
- aa55 aa55 aa55 aa55
- aa55 aa55 aa55 aa55
- aa55 aa55 aa55 aa55
-@tab-icn
- 0000 0000 0000 1008
- 1000 0000 0000 0000
- 0000 0000 0000 0000
- 0000 0000 0000 0000
-@linebreak-icn
- 0000 0000 0000 1028
- 1000 0000 0000 0000
- 0000 0000 0000 0000
- 0000 0000 0000 0000
-
@font ( venice14 )
0505 0809 080c 0d05 0707 0a09 0609 0608
0808 0808 0908 0808 0808 0505 0708 0709