(m291) Added scrolling

This commit is contained in:
Devine Lu Linvega 2024-08-27 09:45:43 -07:00
parent 615f87dff8
commit 42bd3225eb
1 changed files with 15 additions and 5 deletions

View File

@ -75,6 +75,8 @@
BRK
@on-mouse ( -> )
.Mouse/scrolly-lb DEI DUP ?&scroll
POP
( | cursor )
#c1 ;touch-chr/down ;touch-chr .Mouse/state DEI ?{ SWP2 }
POP2 <update-cursor>
@ -113,6 +115,13 @@
.Mouse/x DEI2 #0008 SUB2 DUP2 #00e7 GTH2 ?{ DUP2 <seek> }
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> } }
POP BRK
@on-control ( -> )
( | mod )
[ LIT2 04 -Controller/button ] DEI AND #00 NEQ .selection/mod STZ
@ -224,10 +233,12 @@
&folder ( id -- )
#00 SWP
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2
( >> ) [ LIT2 00 -selection ] STZ
( > ) [ LIT2 00 -selection ] STZ
( > ) [ LIT2 00 -selection/scroll ] STZ
path/<push> !<refresh-dir>
@<escape> ( -- )
( > ) [ LIT2 00 -selection/scroll ] STZ
;path/null LDA ?{ JMP2r }
path/pop !<refresh-dir>
@ -437,21 +448,20 @@
#0008 .Screen/x DEO2
#00 SWP2 ,&t STR2
&>l ( -- )
DUP
( scroll ) #18 LTH ?{ POP2 JMP2r }
( scroll ) DUP #18 LTH ?{ POP2 JMP2r }
[ LITr 05 ]
( | selected )
DUP [ LIT &sel $1 ] NEQ ?{
POPr [ LITr 06 ] ;fill-icn <draw-background> }
( | marker )
DUP .selection/track LDZ NEQ ?{
DUP .selection/scroll LDZ ADD .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
#00 OVR .selection/scroll LDZ ADD
( CELLSIZE ) #70 SFT2 [ LIT2 &t $2 ] ADD2 STHr <draw-uf2>
.Screen/y DEI2k #0010 ADD2 ROT DEO2
INC GTHk ?&>l