From ccc8c12f4d61a54e2033cb095cca899a45cac502 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 26 Aug 2024 09:38:32 -0700 Subject: [PATCH] Drawing progress --- gui/m291/src/assets.tal | 40 ++++++++++++++-- gui/m291/src/m291.tal | 104 ++++++++++++++++++++++++---------------- gui/m291/ss10x10.chr | Bin 4096 -> 4096 bytes 3 files changed, 98 insertions(+), 46 deletions(-) diff --git a/gui/m291/src/assets.tal b/gui/m291/src/assets.tal index 25cd596..8ea0970 100644 --- a/gui/m291/src/assets.tal +++ b/gui/m291/src/assets.tal @@ -1,5 +1,40 @@ ( 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 [ 0406 070a 070b 0a03 0505 0707 0407 0407 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 3030 0000 0000 ] -@mem &filepath $80 &dir $800 - &folders $200 - &roms $200 - &misc $200 +@mem &filepath $80 &dir $800 &folders $200 &roms $200 &misc $200 @message &buf $200 diff --git a/gui/m291/src/m291.tal b/gui/m291/src/m291.tal index 7e486ef..edfd90f 100644 --- a/gui/m291/src/m291.tal +++ b/gui/m291/src/m291.tal @@ -1,5 +1,4 @@ -( -| special uxn11 console ) +( Well, I wasn't going to call it m7b ) |10 @Console &vector $2 |12 &read $1 @@ -121,6 +120,19 @@ STA 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 ) @@ -130,8 +142,20 @@ #0a19 DEO !message/ @handle-frame ( buf* char -- ) - POP - #0a19 DEO !message/ + POP + ( skip key ) #0003 ADD2 + ( skip curr-frame ) #20 find-next INC2 + ( skip next-frame ) #20 find-next INC2 + ( | ) + parse-dec STH2 + INC2 LDAk [ LIT "5 ] LTH ?{ INC2r } + #20 find-next INC2 + ( | ) + parse-dec STH2 + INC2 LDAk [ LIT "5 ] LTH ?{ INC2r } + POP2 STH2r STH2r SWP2 OVR2 ADD2 SWP2 + ( | print ) + calc-width !message/ @handle-id3 ( buf* char -- ) POP @@ -346,22 +370,36 @@ .Screen/width DEI2 #0008 SUB2 .Screen/x DEO2 #0070 .Screen/y DEO2 ;placeholder/time-b #01 + ( fill width ) #00e7 ( >> ) -@ ( -- ) +@ ( width* -- ) [ LIT2 01 -Screen/auto ] DEO #0004 .Screen/x DEO2 #0088 .Screen/y DEO2 + ( | cap left ) ;progress-icn/left .Screen/addr DEO2 [ LIT2 01 -Screen/sprite ] DEO + ( | fill ) #e3 &>t ( -- ) ;progress-icn/middle .Screen/addr DEO2 [ LIT2 01 -Screen/sprite ] DEO INC DUP ?&>t - POP ;progress-icn/right .Screen/addr DEO2 + POP + ( | cap right ) + ;progress-icn/right .Screen/addr DEO2 [ 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 @ ( addr* -- ) #0000 .Screen/x DEO2 @@ -456,6 +494,23 @@ .Screen/sprite DEOk DEO 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 ) @@ -543,40 +598,5 @@ &time-a "0:31 $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 diff --git a/gui/m291/ss10x10.chr b/gui/m291/ss10x10.chr index 15fb50eae5d0265a1ae9fff4584485252e15705c..4e854ce5b510e520763f3adae413afc9fc95888b 100644 GIT binary patch delta 20 bcmZorXi%8Y#KI#d$1~ZHv3fHj<9|K?JKhDo delta 20 bcmZorXi%8Y#9~lUVKCW|v3fHj<9|K?M=%Dt