(m291) Sending jump commands

This commit is contained in:
Devine Lu Linvega 2024-08-26 19:36:49 -07:00
parent 000f103533
commit 4622c8b34f
1 changed files with 40 additions and 22 deletions

View File

@ -25,6 +25,7 @@
@secfrom $2
@secto $2
@secprog $2
@frames &a $2 &b $2
|100
@ -173,10 +174,30 @@
.selection/track LDZ INC .lines/tracks LDZ DIVk MUL SUB !<pick>/tracks
@<seek> ( x* -- )
<phex>
#0a19 DEO
;dict/jump-cmd <pstr>
.frames/a LDZ2 .frames/b LDZ2 ADD2 #00e7 DIV2
( At least 1 ) DUP2 #0000 EQU2 #00 SWP ADD2 MUL2 <pdec>
#0a18 DEO
JMP2r
@<send-load> ( file* -- )
( | start ID3 )
;dict/no-title ;id3/title <scpy>
;dict/no-artist ;id3/artist <scpy>
;dict/no-album ;id3/album <scpy>
[ LIT2 01 -playing ] STZ
<fit-window>
( | request )
;dict/load-cmd <pstr>
;path <pstr>
<pstr>/
#0a18 DEO
JMP2r
@<send-pause> ( -- )
[ LIT2 02 -paused ] LDZ ORA .paused STZ
;dict/pause-cmd <pstr> !<draw-play>
(
@|events )
@ -192,8 +213,10 @@
@handle-frame ( buf* char -- )
POP
( skip key ) #0003 ADD2
( skip curr-frame ) #20 find-next INC2
( skip next-frame ) #20 find-next INC2
( skip curr-frame ) parse-dec .frames/a STZ2
INC2
( skip next-frame ) parse-dec .frames/b STZ2
INC2
( | <curr-secs> )
parse-dec STH2k .secfrom STZ2
INC2 LDAk [ LIT "5 ] LTH ?{ INC2r }
@ -322,24 +345,6 @@
#00 SWP
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2 !<enter>
@<send-load> ( file* -- )
( | start ID3 )
;dict/no-title ;id3/title <scpy>
;dict/no-artist ;id3/artist <scpy>
;dict/no-album ;id3/album <scpy>
[ LIT2 01 -playing ] STZ
<fit-window>
( | request )
;dict/load-cmd <pstr>
;path <pstr>
<pstr>/
#0a18 DEO
JMP2r
@<send-pause> ( -- )
[ LIT2 02 -paused ] LDZ ORA .paused STZ
;dict/pause-cmd <pstr> !<draw-play>
@<enter> ( folder* -- )
.selection/mod LDZ ?&special
push-path !<refresh-dir>
@ -768,6 +773,18 @@
LDAk #00 STH2kr STA2
INC2r INC2 !&w
@<pdec> ( short* -- )
ORAk ?{
POP2 [ LIT2 "0 18 ] DEO
JMP2r }
#2710 [ LIT2r 00fb ]
&>w ( -- )
DIV2k #000a DIV2k MUL2 SUB2 SWPr EQUk OVR STHkr EQU AND ?{
DUP [ LIT "0 ] ADD #18 DEO
INCr }
POP2 #000a DIV2 SWPr INCr STHkr ?&>w
POP2r POP2 POP2 JMP2r
@<pstr> ( str* -- )
LDAk #18 DEO
INC2 & LDAk ?<pstr>
@ -812,6 +829,7 @@
&empty "(empty) $1
&mpg-cmd "mpg123 20 "-R $1
&load-cmd "load 20 $1
&jump-cmd "jump 20 $1
&pause-cmd "pause 0a $1
&no-title "Unknown 20 "Title $1
&no-artist "Unknown 20 "Artist $1