commit de4a534bf4ba7841e00ff524db6d21ab1af7bbb5 parent b00cafe0f269c1841357e21fd7dec06c1579a881 Author: Devine Lu Linvega <aliceffekt@gmail.com> Date: Sun, 25 Feb 2024 13:16:48 -0800 (timer.tal) Updated example Diffstat:
M | projects/examples/gui/timer.tal | | | 30 | ++++++++++++++++++++---------- |
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/projects/examples/gui/timer.tal b/projects/examples/gui/timer.tal @@ -43,21 +43,31 @@ !&<draw> &pause ( -- ) [ LIT2 00 _&paused ] LDR EQU - ( ) DUP ,&paused STR - ( ) INC ;<draw-num>/color STA + ( ) INCk <set-dec-color> + ,&paused STR !&<draw> &end ( -- ) #0000 .Screen/vector DEO2 - #06 ;<draw-num>/color STA + #06 <set-dec-color> !&<draw> &<draw> ( -- ) - #0010 DUP2 .Screen/x DEO2 - .Screen/y DEO2 - [ LIT2 01 -Screen/auto ] DEO - ,&time LDR DUP - ( x0 ) #0a DIV <draw-num> - ( 0x ) #0a DIVk MUL SUB <draw-num> - JMP2r + ,&time LDR !<draw-dec> + +( +@|drawing ) + +@<set-dec-color> ( color -- ) + ;<draw-num>/color STA + JMP2r + +@<draw-dec> ( dec -- ) + #0010 DUP2 .Screen/x DEO2 + .Screen/y DEO2 + [ LIT2 01 -Screen/auto ] DEO + DUP + ( x0 ) #0a DIV <draw-num> + ( 0x ) #0a DIVk MUL SUB + ( >> ) @<draw-num> ( num -- ) #00 SWP #30 SFT2 ;numbers-icns ADD2 .Screen/addr DEO2