(m291) Redesigning scroll

This commit is contained in:
Devine Lu Linvega 2024-08-30 13:20:55 -07:00
parent 8859196212
commit f8cf42530f
1 changed files with 15 additions and 19 deletions

View File

@ -116,11 +116,10 @@
POP2 BRK
&scroll ( distance -> )
.selection/scroll LDZ ADD
( above ) DUP #ff EQU ?{
( below ) DUP #18 ADD .lines/tracks LDZ GTH ?{ DUP .selection/scroll STZ
<redraw-dir> } }
POP BRK
.selection/scroll LDZ ADD DUP #ff NEQ ?{ POP JMP2r }
.selection/scroll STZ
<redraw-dir>
BRK
@on-control ( -> )
( | mod )
@ -214,7 +213,6 @@
@<move> ( mod -- )
.selection LDZ ADD
( top ) DUP .selection/scroll LDZ #ff00 NEQ2 ?{ POP JMP2r }
( bottom ) DUP .lines/folders LDZ .lines/tracks LDZ ADD NEQ ?{ POP JMP2r }
( >> )
@ -229,7 +227,7 @@
POP JMP2r
&tracks ( id -- )
.selection/scroll LDZ ADD DUP .selection/track STZ
DUP .selection/track STZ
#00 SWP
( CELLSIZE ) #70 SFT2 ;mem/tracks ADD2 !<send-load>
@ -237,12 +235,11 @@
#00 SWP
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2
( > ) [ LIT2 00 -selection ] STZ
( > ) [ LIT2 00 -selection/scroll ] STZ
path/<push> !<refresh-dir>
@<escape> ( -- )
( > ) [ LIT2 00 -selection/scroll ] STZ
;path/null LDA ?{ JMP2r }
[ LIT2 00 -selection/scroll ] STZ
path/pop !<refresh-dir>
@<change-mode> ( -- )
@ -359,8 +356,8 @@
@<fit-window> ( -- )
#00
( folders ) .lines/folders LDZ
( tracks ) .lines/tracks LDZ
( scroll ) #18 LTHk [ JMP SWP ] POP ADD
( tracks ) .lines/tracks LDZ ADD
( scroll ) #18 LTHk [ JMP SWP ] POP
( empty ) DUP #00 EQU ADD #40 SFT2
( no-folder spacer ) has-spacer #00 EQU ?{ #0008 ADD2 }
( padding ) #0020 ADD2
@ -537,7 +534,7 @@
#0008 .Screen/x DEO2
;dict/empty #0f !<draw-uf2> }
( | folders )
;mem/folders .lines/folders LDZ .selection LDZ <draw-folders>
.selection LDZ <draw-folders>
has-spacer #00 EQU ?{ ;dash-icn <draw-spacer> }
;mem/tracks .lines/tracks LDZ .selection LDZ .lines/folders LDZ SUB
( >> )
@ -548,20 +545,19 @@
#0008 .Screen/x DEO2
#00 SWP2 ,&t STR2
&>l ( -- )
( scroll ) DUP #18 LTH ?{ POP2 JMP2r }
[ LITr 05 ]
( | selected )
DUP [ LIT &sel $1 ] NEQ ?{
POPr [ LITr 06 ] ;fill-icn <draw-background> }
( | marker )
DUP .selection/scroll LDZ ADD .selection/track LDZ NEQ ?{
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 .selection/scroll LDZ ADD
#00 OVR
( CELLSIZE ) #70 SFT2 [ LIT2 &t $2 ] ADD2 STHr <draw-uf2>
.Screen/y DEI2k #0010 ADD2 ROT DEO2
INC GTHk ?&>l
@ -781,11 +777,11 @@
.Screen/y DEO2
JMP2r
@<draw-folders> ( addr* length selection -- )
@<draw-folders> ( selection -- )
,&sel STR
DUP ?{ POP2 POP JMP2r }
#0008 .Screen/x DEO2
#00 SWP2 ,&t STR2
.lines/folders LDZ #00 NEQk ?{ POP JMP2r }
.selection/scroll LDZ ADD GTHk ?{ POP2 JMP2r }
&>l ( -- )
[ LITr 05 ]
( | selected )
@ -800,7 +796,7 @@
( | normal )
#0008 .Screen/x DEO2
#00 OVR
( CELLSIZE ) #70 SFT2 [ LIT2 &t $2 ] ADD2 STHr <draw-uf2>
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2 STHr <draw-uf2>
.Screen/y DEI2k #0010 ADD2 ROT DEO2
INC GTHk ?&>l
POP2 JMP2r