From e152dcb4627693fb61088cefe004ea44737795e3 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Tue, 27 Aug 2024 08:44:46 -0700 Subject: [PATCH] (m291) Optimizations --- gui/m291/src/m291.tal | 54 +++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/gui/m291/src/m291.tal b/gui/m291/src/m291.tal index 1b59a33..5b8be2a 100644 --- a/gui/m291/src/m291.tal +++ b/gui/m291/src/m291.tal @@ -43,7 +43,8 @@ [ LIT2 03 -Console/mode ] DEO [ LIT2 01 -Console/exec ] DEO [ LIT2 00 -playing ] STZ - ;dict/home-path set-path + ;dict/home-path path/ + ( | unlock ) ;on-mouse .Mouse/vector DEO2 ;on-control .Controller/vector DEO2 @@ -226,10 +227,10 @@ @ ( folder* -- ) [ LIT2 00 -selection ] STZ - push-path ! + path/ ! @ ( -- ) - pop-path ! + path/pop ! @ ( -- ) ;path/null LDA ? @@ -272,9 +273,12 @@ @handle-id3 ( buf* char -- ) POP [ LIT ". ] find-next INC2 LDA2k ( | parse lines ) - DUP2 [ LIT2 "ti ] NEQ2 ?{ OVR2 } - DUP2 [ LIT2 "ar ] NEQ2 ?{ OVR2 } - DUP2 [ LIT2 "al ] NEQ2 ?{ OVR2 } + DUP2 [ LIT2 "ti ] NEQ2 ?{ + OVR2 [ LIT ": ] find-next INC2 ;id3/title } + DUP2 [ LIT2 "ar ] NEQ2 ?{ + OVR2 [ LIT ": ] find-next INC2 ;id3/artist } + DUP2 [ LIT2 "al ] NEQ2 ?{ + OVR2 [ LIT ": ] find-next INC2 ;id3/album } POP2 POP2 !message/ @handle-pause ( buf* char -- ) @@ -354,8 +358,7 @@ .lines/folders LDZ .lines/tracks LDZ ADD JMP2r @has-spacer ( -- f ) - [ LIT2 00 -lines/folders ] LDZ NEQ - ( ) [ LIT2 00 -lines/tracks ] LDZ NEQ AND JMP2r + [ LIT2 00 -lines/folders ] LDZ NEQ [ LIT2 00 -lines/tracks ] LDZ NEQ AND JMP2r @is-folder ( line* -- line* f ) DUP2 lcap/ #0001 SUB2 LDA [ LIT "/ ] EQU JMP2r @@ -372,39 +375,24 @@ INC2 #01 SFT2 INC2r LITr 01 SFT2r } [ LIT2r 00e7 ] MUL2r STH2r SWP2 DIV2 JMP2r -( -@|id3 ) - -@ ( id3* -- ) - ;id3/title - [ LIT ": ] find-next INC2 ;id3/title ! - -@ ( id3* -- ) - ;id3/artist - [ LIT ": ] find-next INC2 ;id3/artist ! - -@ ( id3* -- ) - ;id3/album - [ LIT ": ] find-next INC2 ;id3/album ! - ( @|path ) -@set-path ( path* -- ) +@path/ ( path* -- ) ;path ! -@push-path ( subpath* -- ) +@path/ ( subpath* -- ) ;path scap/ ! -@pop-path ( -- ) +@path/pop ( -- ) ;path scap/ #0001 SUB2 - &w ( -- ) - ;path/null LDA ?{ POP2 JMP2r } - #0001 SUB2 LDAk [ LIT "/ ] NEQ ?{ - LITr 00 STH2 - INC2r STAr - JMP2r } - !&w + &>w ( -- ) + ;path/null LDA ?{ POP2 JMP2r } + #0001 SUB2 LDAk [ LIT "/ ] NEQ ?{ + LITr 00 STH2 + INC2r STAr + JMP2r } + !&>w ( @|drawing )