Drawing progress

This commit is contained in:
Devine Lu Linvega 2024-08-26 09:38:32 -07:00
parent 6b70e41478
commit ccc8c12f4d
3 changed files with 98 additions and 46 deletions

View File

@ -1,5 +1,40 @@
( assets ) ( assets )
@touch-chr [
0000 0000 0814 1417 0000 0000 0008 0808
0000 0000 0000 00c0 0000 0000 0000 0000
1010 2010 1008 0700 0f0f 1f0f 0f07 0000
2010 1010 2020 c000 c0e0 e0e0 c0c0 0000 ]
&down [
0000 0000 0000 0817 0000 0000 0000 0008
0000 0000 0000 00c0 0000 0000 0000 0000
1010 2010 1008 0700 0f0f 1f0f 0f07 0000
2010 1010 2020 c000 c0e0 e0e0 c0c0 0000 ]
@progress-icn
&left [ 0102 0404 0404 0201 ]
&middle [ ff00 0000 0000 00ff ]
&right [ 8040 2020 2020 4080 ]
&fill [ 0000 0c1e 1e0c 0000 ]
@button-icn [
0000 0000 0102 0408 0000 1f60 8000 0000
0000 f806 0100 0000 0000 0000 8040 2010
0810 1020 2020 2020 0000 0000 0000 0000
0000 0000 0000 0000 1008 0804 0404 0404
2020 2020 2010 1008 0000 0000 0000 0000
0000 0000 0000 0000 0404 0404 0408 0810
0804 0201 0000 0000 0000 0080 601f 0000
0000 0001 06f8 0000 1020 4080 0000 0000 ]
@fill-icn [
ffff ffff ffff ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff ffff ffff ]
@dash-icn [ 0000 00aa 0000 0000 ]
@line-icn [ 0000 00ff 0000 0000 ]
@font [ @font [
0406 070a 070b 0a03 0505 0707 0407 0407 0406 070a 070b 0a03 0505 0707 0407 0407
0808 0808 0808 0808 0808 0404 0608 0608 0808 0808 0808 0808 0808 0404 0608 0608
@ -349,10 +384,7 @@
0000 0000 0000 0000 0000 3333 0000 0000 0000 0000 0000 0000 0000 3333 0000 0000
0000 0000 0000 0000 0000 3030 0000 0000 ] 0000 0000 0000 0000 0000 3030 0000 0000 ]
@mem &filepath $80 &dir $800 @mem &filepath $80 &dir $800 &folders $200 &roms $200 &misc $200
&folders $200
&roms $200
&misc $200
@message &buf $200 @message &buf $200

View File

@ -1,5 +1,4 @@
( ( Well, I wasn't going to call it m7b )
| special uxn11 console )
|10 @Console &vector $2 |10 @Console &vector $2
|12 &read $1 |12 &read $1
@ -121,6 +120,19 @@
STA STA
JMP2r JMP2r
(
@|timestamp ) ( returns value between 0000 and 00d0 )
@calc-width ( total* curr* -- width* )
STH2
DUP2 #013c LTH2 ?&ready
&scale ( -- )
DUP2 #0277 LTH2 ?&almost
#01 SFT2 LITr 01 SFT2r !&scale
&almost INC2 #01 SFT2 INC2r LITr 01 SFT2r
&ready ( -- )
LIT2r 00d0 MUL2r STH2r SWP2 DIV2 JMP2r
( (
@|events ) @|events )
@ -130,8 +142,20 @@
#0a19 DEO !message/<new> #0a19 DEO !message/<new>
@handle-frame ( buf* char -- ) @handle-frame ( buf* char -- )
POP <perr> POP
#0a19 DEO !message/<new> ( skip key ) #0003 ADD2
( skip curr-frame ) #20 find-next INC2
( skip next-frame ) #20 find-next INC2
( | <curr-secs> )
parse-dec STH2
INC2 LDAk [ LIT "5 ] LTH ?{ INC2r }
#20 find-next INC2
( | <remaining-secs> )
parse-dec STH2
INC2 LDAk [ LIT "5 ] LTH ?{ INC2r }
POP2 STH2r STH2r SWP2 OVR2 ADD2 SWP2
( | print )
calc-width <draw-progress> !message/<new>
@handle-id3 ( buf* char -- ) @handle-id3 ( buf* char -- )
POP <perr> POP <perr>
@ -346,22 +370,36 @@
.Screen/width DEI2 #0008 SUB2 .Screen/x DEO2 .Screen/width DEI2 #0008 SUB2 .Screen/x DEO2
#0070 .Screen/y DEO2 #0070 .Screen/y DEO2
;placeholder/time-b #01 <draw-uf2-right> ;placeholder/time-b #01 <draw-uf2-right>
( fill width ) #00e7
( >> ) ( >> )
@<draw-progress> ( -- ) @<draw-progress> ( width* -- )
[ LIT2 01 -Screen/auto ] DEO [ LIT2 01 -Screen/auto ] DEO
#0004 .Screen/x DEO2 #0004 .Screen/x DEO2
#0088 .Screen/y DEO2 #0088 .Screen/y DEO2
( | cap left )
;progress-icn/left .Screen/addr DEO2 ;progress-icn/left .Screen/addr DEO2
[ LIT2 01 -Screen/sprite ] DEO [ LIT2 01 -Screen/sprite ] DEO
( | fill )
#e3 #e3
&>t ( -- ) &>t ( -- )
;progress-icn/middle .Screen/addr DEO2 ;progress-icn/middle .Screen/addr DEO2
[ LIT2 01 -Screen/sprite ] DEO [ LIT2 01 -Screen/sprite ] DEO
INC DUP ?&>t INC DUP ?&>t
POP ;progress-icn/right .Screen/addr DEO2 POP
( | cap right )
;progress-icn/right .Screen/addr DEO2
[ LIT2 01 -Screen/sprite ] DEO [ LIT2 01 -Screen/sprite ] DEO
JMP2r ( | fill )
#0008 .Screen/x DEO2
[ LIT2 00 -Screen/auto ] DEO
;progress-icn/fill .Screen/addr DEO2
#0000
&>l ( -- )
[ LIT2 05 -Screen/sprite ] DEO
.Screen/x DEI2 INC2 .Screen/x DEO2
INC2 GTH2k ?&>l
POP2 POP2 JMP2r
@<draw-spacer> ( addr* -- ) @<draw-spacer> ( addr* -- )
#0000 .Screen/x DEO2 #0000 .Screen/x DEO2
@ -456,6 +494,23 @@
.Screen/sprite DEOk DEO .Screen/sprite DEOk DEO
JMP2r JMP2r
(
@|helpers )
@find-next ( buf* c -- index* )
,&t STR
&>loop ( -- )
LDAk [ LIT &t $1 ] EQU ?{ INC2 !&>loop }
JMP2r
@parse-dec ( buf* -- end* res* )
[ LIT2r 000a ] [ LIT2r 0000 ]
&>loop ( -- )
LDAk [ LIT "0 ] SUB DUP #09 GTH ?{
OVR2r MUL2r #00 SWP STH2
ADD2r INC2 !&>loop }
POP STH2r POP2r JMP2r
( (
@|stdlib ) @|stdlib )
@ -543,40 +598,5 @@
&time-a "0:31 $1 &time-a "0:31 $1
&time-b "2:25 $1 &time-b "2:25 $1
@touch-chr [
0000 0000 0814 1417 0000 0000 0008 0808
0000 0000 0000 00c0 0000 0000 0000 0000
1010 2010 1008 0700 0f0f 1f0f 0f07 0000
2010 1010 2020 c000 c0e0 e0e0 c0c0 0000 ]
&down [
0000 0000 0000 0817 0000 0000 0000 0008
0000 0000 0000 00c0 0000 0000 0000 0000
1010 2010 1008 0700 0f0f 1f0f 0f07 0000
2010 1010 2020 c000 c0e0 e0e0 c0c0 0000 ]
@progress-icn
&left [ 0102 0404 0404 0201 ]
&middle [ ff00 0000 0000 00ff ]
&right [ 8040 2020 2020 4080 ]
&fill [ 0000 3078 7830 0000 ]
@button-icn [
0000 0000 0102 0408 0000 1f60 8000 0000
0000 f806 0100 0000 0000 0000 8040 2010
0810 1020 2020 2020 0000 0000 0000 0000
0000 0000 0000 0000 1008 0804 0404 0404
2020 2020 2010 1008 0000 0000 0000 0000
0000 0000 0000 0000 0404 0404 0408 0810
0804 0201 0000 0000 0000 0080 601f 0000
0000 0001 06f8 0000 1020 4080 0000 0000 ]
@fill-icn [
ffff ffff ffff ffff ffff ffff ffff ffff
ffff ffff ffff ffff ffff ffff ffff ffff ]
@dash-icn [ 0000 00aa 0000 0000 ]
@line-icn [ 0000 00ff 0000 0000 ]
~src/assets.tal ~src/assets.tal

Binary file not shown.