Starting time left

This commit is contained in:
Devine Lu Linvega 2024-07-24 15:20:55 -07:00
parent e4824b3048
commit 76a25b9ba8
2 changed files with 60 additions and 6 deletions

View File

@ -27,9 +27,7 @@
00 00 00 00 30 00 00 00 00 08 00 00 00 00 30 00
00 00 00 08 00 00 00 00 00 00 00 00 00 00 ]
@chicago-uf2 [
0000 0000 0000 0000 0008 0000 0000 0000
000b 0b09 0b00 0000 0000 0000 0000 0000
@font [
0406 070a 070b 0a03 0505 0707 0407 0407
0808 0808 0808 0808 0808 0404 0608 0608
0b08 0808 0807 0708 0806 0709 070c 0908

View File

@ -69,10 +69,12 @@
JMP2r
@<set-height> ( distance* -- )
#00f0 SWP2 SUB2 #02 SFT2 #001f MUL2
#00f0 SWP2 SUB2 #02 SFT2 #000f MUL2 DUP2 <pdec>
#0a18 DEO
@<set-seconds> ( seconds* -- )
DUP2 .remaining-seconds LDZ2 EQU2 ?{ .remaining-seconds STZ2 !<redraw-bar> }
DUP2 .remaining-seconds LDZ2 EQU2 ?{ .remaining-seconds STZ2
<draw-remains> !<redraw-bar> }
POP2 JMP2r
(
@ -81,6 +83,7 @@
@<redraw> ( -- )
<redraw-bar>
<draw-markers>
<draw-labels>
JMP2r
( | markers )
;tick-icn .Screen/addr DEO2
@ -125,6 +128,44 @@
INC2 GTH2k ?&>l
POP2 POP2 JMP2r
@<draw-remains> ( -- )
#003c .Screen/x DEO2
#00f5 .Screen/y DEO2
[ LIT2 15 -Screen/auto ] DEO
.remaining-seconds LDZ2 ORAk ?{ POP2 ;dict/min0 !<draw-uf2> }
( | minutes )
( x0 ) DUP2 #0258 DIV2 NIP [ LIT "0 ] ADD <draw-char>
( 0x ) DUP2 #003c DIV2 NIP #0a DIVk MUL SUB [ LIT "0 ] ADD <draw-char>
POP2 ;dict/min0 <draw-uf2>
JMP2r
@<draw-labels> ( -- )
#003c .Screen/x DEO2
#00a9 .Screen/y DEO2
;dict/min5 <draw-uf2>
#003c .Screen/x DEO2
#0059 .Screen/y DEO2
;dict/min10 <draw-uf2>
#003c .Screen/x DEO2
#000d .Screen/y DEO2
;dict/min15 <draw-uf2>
JMP2r
@<draw-uf2> ( addr* -- )
[ LIT2 15 -Screen/auto ] DEO
&>while ( -- )
LDAk <draw-char>
INC2 LDAk ?&>while
POP2 JMP2r
@<draw-char> ( char -- )
#20 SUB #00 SWP
( addr ) DUP2 #50 SFT2 ;font/glyphs ADD2 .Screen/addr DEO2
( move ) ;font ADD2 LDA #00 SWP .Screen/x DEI2 ADD2
( draw ) [ LIT2 01 -Screen/sprite ] DEOk DEO
.Screen/x DEO2
JMP2r
@<redraw-bar> ( -- )
;halftone-icn .Screen/addr DEO2
( | top )
@ -141,7 +182,7 @@
@<draw-bar> ( -- )
( y2 ) .Screen/height DEI2 #0010 SUB2
( y1 ) #0100 .remaining-seconds LDZ2 #001f DIV2 #20 SFT2 SUB2
( y1 ) #0100 .remaining-seconds LDZ2 #000f DIV2 #20 SFT2 SUB2
( | paint )
[ LIT2 32 -Screen/auto ] DEO
;line-icn .Screen/addr DEO2
@ -180,8 +221,23 @@
#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO
JMP2r
@<pdec> ( short* -- )
#2710 [ LIT2r 00fb ]
&w ( -- )
DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{
DUP [ LIT "0 ] ADD #19 DEO
INCr }
POP2 #000a DIV2 SWPr INCr STHkr ?&w
POP2r POP2 POP2 JMP2r
(
@|assets )
@dict
&min0 "Done. $1
&min5 "5 20 "Min $1
&min10 "10 20 "Min $1
&min15 "15 20 "Min $1
~assets.tal