From 600048613f0d256e361d9145d7c81cdd8f7f79f1 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 24 Jul 2024 15:26:22 -0700 Subject: [PATCH] Display time left --- gui/teatime/teatime.tal | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gui/teatime/teatime.tal b/gui/teatime/teatime.tal index 4cb09dc..5d029f6 100644 --- a/gui/teatime/teatime.tal +++ b/gui/teatime/teatime.tal @@ -134,10 +134,14 @@ [ LIT2 15 -Screen/auto ] DEO .remaining-seconds LDZ2 ORAk ?{ POP2 ;dict/min0 ! } ( | minutes ) - ( x0 ) DUP2 #0258 DIV2 NIP [ LIT "0 ] ADD - ( 0x ) DUP2 #003c DIV2 NIP #0a DIVk MUL SUB [ LIT "0 ] ADD - POP2 ;dict/min0 - JMP2r + ( x0 ) DUP2 #0258 DIV2 NIP DUP #00 EQU ?{ + DUP [ LIT "0 ] ADD } + POP + ( 0x ) DUP2 #003c DIV2 NIP + ( : ) [ LIT ": ] + ( | seconds ) + ( x0 ) DUP2 #003c DIV2k MUL2 SUB2 #000a DIV2 NIP + ( 0x ) #000a DIV2k MUL2 SUB2 NIP ! @ ( -- ) #003c .Screen/x DEO2 @@ -158,6 +162,10 @@ INC2 LDAk ?&>while POP2 JMP2r +@ ( -- ) + #0a DIVk MUL SUB [ LIT "0 ] ADD + ( >> ) + @ ( char -- ) #20 SUB #00 SWP ( addr ) DUP2 #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2