From 09e44959c1df4d7688ecf22d72db5355a98cd560 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 26 Aug 2024 11:08:34 -0700 Subject: [PATCH] Connected id3 --- gui/m291/src/assets.tal | 2 ++ gui/m291/src/m291.tal | 50 +++++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/gui/m291/src/assets.tal b/gui/m291/src/assets.tal index 2ec8924..c385623 100644 --- a/gui/m291/src/assets.tal +++ b/gui/m291/src/assets.tal @@ -396,3 +396,5 @@ @message &buf $200 +@id3 &title $100 &artist $100 &album $100 + diff --git a/gui/m291/src/m291.tal b/gui/m291/src/m291.tal index 722b999..9cfabf1 100644 --- a/gui/m291/src/m291.tal +++ b/gui/m291/src/m291.tal @@ -166,8 +166,12 @@ !message/ @handle-id3 ( buf* char -- ) - POP - #0a19 DEO !message/ + POP [ LIT ". ] find-next INC2 LDA2k + ( | parse lines ) + DUP2 [ LIT2 "ti ] NEQ2 ?{ OVR2 } + DUP2 [ LIT2 "ar ] NEQ2 ?{ OVR2 } + DUP2 [ LIT2 "al ] NEQ2 ?{ OVR2 } + POP2 POP2 !message/ @handle-pause ( buf* char -- ) POP INC2 INC2 LDA [ LIT "1 ] SUB #01 EOR .paused STZ @@ -314,6 +318,21 @@ @is-mp3 ( line* -- line*f ) DUP2 lcap/ #0003 SUB2 ;dict/mp3-ext !scmp3 +( +@|id3 ) + +@ ( id3* -- ) + [ LIT ": ] find-next INC2 ;id3/title + JMP2r + +@ ( id3* -- ) + [ LIT ": ] find-next INC2 ;id3/artist + JMP2r + +@ ( id3* -- ) + [ LIT ": ] find-next INC2 ;id3/album + JMP2r + ( @|path ) @@ -372,13 +391,13 @@ @ ( -- ) #0080 .Screen/x DEO2 #0020 .Screen/y DEO2 - ;placeholder/track #01 + ;id3/title #01 #0080 .Screen/x DEO2 #0030 .Screen/y DEO2 - ;placeholder/artist #01 + ;id3/artist #01 #0080 .Screen/x DEO2 #0040 .Screen/y DEO2 - ;placeholder/album #01 + ;id3/album #01 ! @@ -592,6 +611,13 @@ LDAkr LDAk STHr NEQ ?{ INC2r INC2 } LDA2r LDA2 STH2r EQU2 JMP2r +@ ( src* dst* -: ) + STH2 + &>w ( src* `dst* -- ) + LDAk #00 STH2kr STA2 + INC2r INC2 LDAk ?&>w + POP2 POP2r JMP2r + @lcap ( str* -- next-line* ) &w ( -- ) @@ -607,13 +633,6 @@ LDAk #00 STH2kr STA2 INC2r INC2 !&w -@ ( src* dst* -- ) - STH2 - &w ( -- ) - LDAk #00 STH2kr STA2 - INC2r INC2 LDAk ?&w - POP2 POP2r JMP2r - @ ( str* -- ) LDAk #18 DEO INC2 & LDAk ? @@ -659,12 +678,5 @@ &load-cmd "load 20 $1 &pause-cmd "pause 0a $1 -@placeholder - &artist "Blood 20 "Girl $1 - &track "Always 20 "Wrong $1 - &album "Unknown 20 "Album $1 - &time-a "0:31 $1 - &time-b "2:25 $1 - ~src/assets.tal