Improved label.tal

This commit is contained in:
neauoire 2022-04-08 11:41:07 -07:00
parent 9ade9bd524
commit 1e0edd7461
2 changed files with 24 additions and 42 deletions

View File

@ -6,7 +6,7 @@
|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 &debug $1 &halt $1 |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 |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 |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 |0000

View File

@ -8,11 +8,11 @@
@center &x $2 &y $2 @center &x $2 &y $2
|0100 |0100
( theme ) ( theme )
#f0d7 .System/r DEO2 #a0dc .System/r DEO2
#f0de .System/g DEO2 #a0dc .System/g DEO2
#f0dc .System/b DEO2 #a0dc .System/b DEO2
( find screen center ) ( find screen center )
.Screen/width DEI2 #01 SFT2 .center/x STZ2 .Screen/width DEI2 #01 SFT2 .center/x STZ2
.Screen/height DEI2 #01 SFT2 .center/y STZ2 .Screen/height DEI2 #01 SFT2 .center/y STZ2
@ -28,32 +28,32 @@
POP2 POP2 POP2 POP2
( left ) ( left )
.center/x LDZ2 .Screen/x DEO2 .center/x LDZ2 .Screen/x DEO2
.center/y LDZ2 #0020 SUB2 .Screen/y DEO2 .center/y LDZ2 #0018 SUB2 .Screen/y DEO2
;left-txt #09 ;draw-uf2 JSR2 ;left-txt ,draw-uf2 JSR
( center ) ( center )
.center/x LDZ2 .Screen/x DEO2 .center/x LDZ2 .Screen/x DEO2
.center/y LDZ2 .Screen/y DEO2 .center/y LDZ2 .Screen/y DEO2
;center-txt #09 ;draw-uf2-center JSR2 ;center-txt ,draw-uf2-center JSR
( right ) ( right )
.center/x LDZ2 .Screen/x DEO2 .center/x LDZ2 .Screen/x DEO2
.center/y LDZ2 #0020 ADD2 .Screen/y DEO2 .center/y LDZ2 #0018 ADD2 .Screen/y DEO2
;right-txt #09 ;draw-uf2-right JSR2 ;right-txt ,draw-uf2-right JSR
BRK BRK
@draw-uf2-center ( text* color -- ) @draw-uf2-center ( text* color -- )
STH DUP2 ,get-width JSR #01 SFT2 STH2
DUP2 ,get-width JSR #01 SFT2 STH2 .Screen/x DEI2k STH2r SUB2 ROT DEO2 .Screen/x DEI2k STH2r SUB2 ROT DEO2
STHr ,draw-uf2 JSR ,draw-uf2 JSR
JMP2r JMP2r
@draw-uf2-right ( text* color -- ) @draw-uf2-right ( text* color -- )
STH DUP2 ,get-width JSR STH2
DUP2 ,get-width JSR STH2 .Screen/x DEI2k STH2r SUB2 ROT DEO2 .Screen/x DEI2k STH2r SUB2 ROT DEO2
STHr ,draw-uf2 JSR ,draw-uf2 JSR
JMP2r JMP2r
@ -68,19 +68,17 @@ JMP2r
JMP2r JMP2r
@draw-uf2 ( text* color -- ) @draw-uf2 ( text* -- )
STH
#15 .Screen/auto DEO #15 .Screen/auto DEO
&while &while
LDAk STHkr SWP LDAk #20 SUB #00 SWP
#00 SWP #20 SUB DUP2 #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
( addr ) DUP2 #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2 ;font ADD2 LDA #00 SWP .Screen/x DEI2 ADD2
( anchor ) ;font ADD2 LDA #00 SWP .Screen/x DEI2 ADD2 STH2 #01 .Screen/sprite DEOk DEO
.Screen/sprite DEOk DEO .Screen/x DEO2
STH2r .Screen/x DEO2
INC2 LDAk ,&while JCN INC2 LDAk ,&while JCN
POP2 POPr POP2
JMP2r JMP2r
@ -88,22 +86,6 @@ JMP2r
@center-txt "Center 20 "Aligned 20 "Label $1 @center-txt "Center 20 "Aligned 20 "Label $1
@right-txt "Right 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 ) @font ( venice14 )
0505 0809 080c 0d05 0707 0a09 0609 0608 0505 0809 080c 0d05 0707 0a09 0609 0608
0808 0808 0908 0808 0808 0505 0708 0709 0808 0808 0908 0808 0808 0505 0708 0709