(m291) Housekeeping

This commit is contained in:
Devine Lu Linvega 2024-08-27 09:03:18 -07:00
parent e152dcb462
commit 5d7ae61420
1 changed files with 55 additions and 72 deletions

View File

@ -223,18 +223,13 @@
&folder ( id -- )
#00 SWP
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2 !<enter>
@<enter> ( folder* -- )
[ LIT2 00 -selection ] STZ
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2
( >> ) [ LIT2 00 -selection ] STZ
path/<push> !<refresh-dir>
@<leave> ( -- )
path/pop !<refresh-dir>
@<escape> ( -- )
;path/null LDA ?<leave>
JMP2r
;path/null LDA ?{ JMP2r }
path/pop !<refresh-dir>
(
@|events )
@ -253,7 +248,7 @@
@handle-frame ( buf* char -- )
POP
( skip key ) #0002 ADD2
( skip key ) INC2 INC2
( curr-frame ) parse-dec .frames/a STZ2
INC2
( next-frame ) parse-dec .frames/b STZ2
@ -284,8 +279,10 @@
@handle-pause ( buf* char -- )
POP INC2 INC2 LDA
( stop ) DUP [ LIT "0 ] NEQ ?{ }
( paused ) DUP [ LIT "1 ] NEQ ?{ #01 .paused STZ }
( playing ) DUP [ LIT "2 ] NEQ ?{ #00 .paused STZ }
( paused ) DUP [ LIT "1 ] NEQ ?{
[ LIT2 01 -paused ] STZ }
( playing ) DUP [ LIT "2 ] NEQ ?{
[ LIT2 00 -paused ] STZ }
( end ) DUP [ LIT "3 ] NEQ ?{ <skip-next> }
POP <draw-play> !message/<new>
@ -375,6 +372,20 @@
INC2 #01 SFT2 INC2r LITr 01 SFT2r }
[ LIT2r 00e7 ] MUL2r STH2r SWP2 DIV2 JMP2r
@find-next ( buf* c -- index* )
,&t STR
&>loop ( -- )
LDAk [ LIT &t $1 ] EQU ?{ INC2 !&>loop }
JMP2r
@parse-dec ( buf* -- end* res* )
[ LIT2r 000a ] [ LIT2r 0000 ]
&>loop ( -- )
LDAk [ LIT "0 ] SUB DUP #09 GTH ?{
OVR2r MUL2r #00 SWP STH2
ADD2r INC2 !&>loop }
POP STH2r POP2r JMP2r
(
@|path )
@ -414,8 +425,32 @@
( | folders )
;mem/folders .lines/folders LDZ .selection LDZ <draw-folders>
[ LIT2 00 -lines/folders ] LDZ EQU ?{ ;dash-icn <draw-spacer> }
;mem/tracks .lines/tracks LDZ .selection LDZ .lines/folders LDZ SUB <draw-files>
JMP2r
;mem/tracks .lines/tracks LDZ .selection LDZ .lines/folders LDZ SUB
( >> )
@<draw-files> ( addr* length selection -- )
,&sel STR
DUP ?{ POP2 POP JMP2r }
#0008 .Screen/x DEO2
#00 SWP2 ,&t STR2
&>l ( -- )
[ LITr 05 ]
( | selected )
DUP [ LIT &sel $1 ] NEQ ?{
POPr [ LITr 06 ] ;fill-icn <draw-background> }
( | marker )
DUP .selection/track LDZ NEQ ?{
[ LIT2 15 -Screen/auto ] DEO
#0000 .Screen/x DEO2
;poke-icn .Screen/addr DEO2
DUPr [ LITr -Screen/sprite ] DEOr }
( | normal )
#0008 .Screen/x DEO2
#00 OVR
( CELLSIZE ) #70 SFT2 [ LIT2 &t $2 ] ADD2 STHr <draw-uf2>
.Screen/y DEI2k #0010 ADD2 ROT DEO2
INC GTHk ?&>l
POP2 JMP2r
@<draw-path> ( -- )
( | clear )
@ -478,8 +513,8 @@
[ LIT2 16 -Screen/auto ] DEO
#0078 .Screen/x DEO2
#005c .Screen/y DEO2
;pause-icn #00 .paused LDZ #50 SFT2 ADD2 .Screen/addr DEO2
[ LIT2 03 -Screen/sprite ] DEOk DEO
;pause-icn [ LIT2 00 -paused ] LDZ #50 SFT2 ADD2 .Screen/addr DEO2
[ LIT2 01 -Screen/sprite ] DEOk DEO
JMP2r
@<draw-prev> ( -- )
@ -487,7 +522,7 @@
#0058 .Screen/x DEO2
#005c .Screen/y DEO2
;prev-icn .Screen/addr DEO2
[ LIT2 03 -Screen/sprite ] DEOk DEO
[ LIT2 01 -Screen/sprite ] DEOk DEO
JMP2r
@<draw-next> ( -- )
@ -495,7 +530,7 @@
#0098 .Screen/x DEO2
#005c .Screen/y DEO2
;next-icn .Screen/addr DEO2
[ LIT2 03 -Screen/sprite ] DEOk DEO
[ LIT2 01 -Screen/sprite ] DEOk DEO
JMP2r
@<draw-progress> ( -- )
@ -598,30 +633,6 @@
.Screen/y DEO2
JMP2r
@<draw-files> ( addr* length selection -- )
,&sel STR
DUP ?{ POP2 POP JMP2r }
#0008 .Screen/x DEO2
#00 SWP2 ,&t STR2
&>l ( -- )
[ LITr 05 ]
( | selected )
DUP [ LIT &sel $1 ] NEQ ?{
POPr [ LITr 06 ] ;fill-icn <draw-background> }
( | marker )
DUP .selection/track LDZ NEQ ?{
[ LIT2 15 -Screen/auto ] DEO
#0000 .Screen/x DEO2
;poke-icn .Screen/addr DEO2
STHkr .Screen/sprite DEO }
( | normal )
#0008 .Screen/x DEO2
#00 OVR
( CELLSIZE ) #70 SFT2 [ LIT2 &t $2 ] ADD2 STHr <draw-uf2>
.Screen/y DEI2k #0010 ADD2 ROT DEO2
INC GTHk ?&>l
POP2 JMP2r
@<draw-folders> ( addr* length selection -- )
,&sel STR
DUP ?{ POP2 POP JMP2r }
@ -699,30 +710,11 @@
.Screen/sprite DEOk DEO
JMP2r
(
@|helpers )
@find-next ( buf* c -- index* )
,&t STR
&>loop ( -- )
LDAk [ LIT &t $1 ] EQU ?{ INC2 !&>loop }
JMP2r
@parse-dec ( buf* -- end* res* )
[ LIT2r 000a ] [ LIT2r 0000 ]
&>loop ( -- )
LDAk [ LIT "0 ] SUB DUP #09 GTH ?{
OVR2r MUL2r #00 SWP STH2
ADD2r INC2 !&>loop }
POP STH2r POP2r JMP2r
(
@|stdlib )
@scap ( str* -- end* )
&w ( -- )
INC2 & LDAk ?&w
INC2 & LDAk ?scap
JMP2r
@scmp3 ( a* b* -- f )
@ -737,17 +729,8 @@
INC2r INC2 LDAk ?&>w
POP2 POP2r JMP2r
@<sclr> ( str* -- )
#00 ROT ROT
&>w ( -- )
STAk INC2 LDAk ?&>w
STA
JMP2r
@lcap ( str* -- next-line* )
&w ( -- )
LDAk #0a EQU ?{ INC2 & LDAk ?&w }
LDAk #0a EQU ?{ INC2 & LDAk ?lcap }
JMP2r
@<lcpy> ( src* dst* -- )