From 2118be4670ea6dfdd8af62ad7aba966d7f108cb3 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 29 Aug 2024 08:27:33 -0700 Subject: [PATCH] (m291) Sorting albums --- gui/m291/src/m291.tal | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gui/m291/src/m291.tal b/gui/m291/src/m291.tal index a2f741a..bdef5b0 100644 --- a/gui/m291/src/m291.tal +++ b/gui/m291/src/m291.tal @@ -335,7 +335,7 @@ &w ( -- ) DUP2 lcap/ INC2 LDAk ?&w - POP2 + POP2 sort-folders sort-tracks ( >> ) @ ( -- ) @@ -355,7 +355,7 @@ #0005 ADD2 LDAk [ LIT ". ] EQU ?&hidden is-folder ?&folder is-mp3 ?&mp3 - POP2 !sort-tracks + POP2 JMP2r &folder ( line* -- ) DUP2 llen #003f LTH2 ?{ POP2 JMP2r } @@ -387,10 +387,12 @@ POP2 INC2 INC2r !&>loop &done NIP2 LTH POP2r JMP2r +@sort-folders ( -- ) + ;mem/folders DUP2 LIT2 [ 00 -lines/folders ] LDZ #01 SUB #70 SFT2 ADD2 !sort-tracks-0 + @sort-tracks ( -- ) ;mem/tracks DUP2 LIT2 [ 00 -lines/tracks ] LDZ #01 SUB #70 SFT2 ADD2 - ( >> ) ( | selection sort; walk forward creating a sorted prefix ) - + ( >> ) @sort-tracks-0 ( first* last* -- ) SWP2 &loop GTH2k ?&ok