(m291) Added repeat and random modes

This commit is contained in:
Devine Lu Linvega 2024-08-27 15:30:18 -07:00
parent 2dce8c937a
commit 85b07d0b30
3 changed files with 51 additions and 1 deletions

View File

@ -27,6 +27,14 @@
0804 0201 0000 0000 0000 0080 601f 0000 0804 0201 0000 0000 0000 0080 601f 0000
0000 0001 06f8 0000 1020 4080 0000 0000 ] 0000 0001 06f8 0000 1020 4080 0000 0000 ]
@mode-icns [
0000 001f 1f00 0000 0010 18fc fc18 1000
0000 001f 1f00 0000 0010 18fc fc18 1000
0000 001f 1f01 0101 0010 187c bc98 9080
0101 011d 1e00 0000 8090 98fc fc18 1000
0000 000f 1f18 1818 0010 18fc fc18 1008
1818 181f 0f00 0000 1818 18f8 f000 0000 ]
@pause-icn [ @pause-icn [
0000 001e 1e1e 1e1e 0000 0078 7878 7878 0000 001e 1e1e 1e1e 0000 0078 7878 7878
1e1e 1e1e 1e00 0000 7878 7878 7800 0000 ] 1e1e 1e1e 1e00 0000 7878 7878 7800 0000 ]

View File

@ -13,6 +13,7 @@
|80 @Controller &vector $2 &button $1 &key $1 |80 @Controller &vector $2 &button $1 &key $1
|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &chord $1 &pad $4 &scrolly &scrolly-hb $1 &scrolly-lb $1 |90 @Mouse &vector $2 &x $2 &y $2 &state $1 &chord $1 &pad $4 &scrolly &scrolly-hb $1 &scrolly-lb $1
|a0 @File &vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |a0 @File &vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
|000 |000
@ -20,6 +21,7 @@
@path $2 &null $80 @path $2 &null $80
@lines &folders $1 &tracks $1 @lines &folders $1 &tracks $1
@playing $1 @playing $1
@mode $1
@paused $1 @paused $1
@secfrom $2 @secfrom $2
@secto $2 @secto $2
@ -45,6 +47,7 @@
[ LIT2 00 -playing ] STZ [ LIT2 00 -playing ] STZ
;dict/home-path path/<set> ;dict/home-path path/<set>
<refresh-dir> <refresh-dir>
<prng-init>
( | unlock ) ( | unlock )
;on-mouse .Mouse/vector DEO2 ;on-mouse .Mouse/vector DEO2
;on-control .Controller/vector DEO2 ;on-control .Controller/vector DEO2
@ -93,7 +96,11 @@
BRK BRK
&status-bar ( y* -> ) &status-bar ( y* -> )
POP2 BRK POP2 .Mouse/state DEI ?{ BRK }
.Mouse/x DEI2 .Screen/width DEI2 #0014 SUB2 GTH2 ?{ BRK }
<change-mode>
;on-mouse-locked .Mouse/vector DEO2
BRK
&player ( y* -> ) &player ( y* -> )
.Mouse/state DEI ?{ POP2 BRK } .Mouse/state DEI ?{ POP2 BRK }
@ -181,6 +188,11 @@
@<skip-next> ( -- ) @<skip-next> ( -- )
.lines/tracks LDZ ?{ JMP2r } .lines/tracks LDZ ?{ JMP2r }
( | random )
[ LIT2 01 -mode ] LDZ NEQ ?{
prng ADD .lines/tracks LDZ DIVk MUL SUB !<pick>/tracks }
( | repeat )
[ LIT2 02 -mode ] LDZ NEQ ?{ .selection/track LDZ !<pick>/tracks }
.selection/track LDZ INC .lines/tracks LDZ DIVk MUL SUB !<pick>/tracks .selection/track LDZ INC .lines/tracks LDZ DIVk MUL SUB !<pick>/tracks
@<seek> ( x* -- ) @<seek> ( x* -- )
@ -238,6 +250,9 @@
;path/null LDA ?{ JMP2r } ;path/null LDA ?{ JMP2r }
path/pop !<refresh-dir> path/pop !<refresh-dir>
@<change-mode> ( -- )
.mode LDZk INC #03 DIVk MUL SUB SWP STZ !<draw-mode>
( (
@|events ) @|events )
@ -497,10 +512,19 @@
#0008 .Screen/x DEO2 #0008 .Screen/x DEO2
#0004 .Screen/y DEO2 #0004 .Screen/y DEO2
;path #01 <draw-uf2> ;path #01 <draw-uf2>
<draw-mode>
( | spacer ) ( | spacer )
#0014 .Screen/y DEO2 #0014 .Screen/y DEO2
;line-icn !<draw-spacer> ;line-icn !<draw-spacer>
@<draw-mode> ( -- )
[ LIT2 16 -Screen/auto ] DEO
#0004 .Screen/y DEO2
.Screen/width DEI2 #0014 SUB2 .Screen/x DEO2
;mode-icns [ LIT2 00 -mode ] LDZ #50 SFT2 ADD2 .Screen/addr DEO2
[ LIT2 03 -Screen/sprite ] DEOk DEO
JMP2r
@<redraw-player> ( -- ) @<redraw-player> ( -- )
#ffff ;<draw-timestamp>/last STA2 #ffff ;<draw-timestamp>/last STA2
#ffff ;<draw-progress>/last STA2 #ffff ;<draw-progress>/last STA2
@ -825,6 +849,24 @@
#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #19 DEO #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #19 DEO
JMP2r JMP2r
@<prng-init> ( -- )
( > ) [ LIT2 00 -DateTime/second ] DEI
( > ) [ LIT2 00 -DateTime/minute ] DEI #60 SFT2 EOR2
( > ) [ LIT2 00 -DateTime/hour ] DEI #c0 SFT2 EOR2 ,prng/x STR2
( > ) [ LIT2 00 -DateTime/hour ] DEI #04 SFT2
( > ) [ LIT2 00 -DateTime/day ] DEI #10 SFT2 EOR2
( > ) [ LIT2 00 -DateTime/month ] DEI #60 SFT2 EOR2
( > ) .DateTime/year DEI2 #a0 SFT2 EOR2 ,prng/y STR2
JMP2r
@prng ( -- number* )
( > ) [ LIT2 &x $2 ]
( > ) DUP2 #50 SFT2 EOR2
( > ) DUP2 #03 SFT2 EOR2
( > ) [ LIT2 &y $2 ] DUP2 ,&x STR2
( > ) DUP2 #01 SFT2 EOR2 EOR2
( > ) ,&y STR2k POP JMP2r
( (
@|theme ) @|theme )

Binary file not shown.