From 42bd3225eb89818ed7c01260498b9f1a8d88d0d8 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Tue, 27 Aug 2024 09:45:43 -0700 Subject: [PATCH] (m291) Added scrolling --- gui/m291/src/m291.tal | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/gui/m291/src/m291.tal b/gui/m291/src/m291.tal index 924e0ad..c2b77e7 100644 --- a/gui/m291/src/m291.tal +++ b/gui/m291/src/m291.tal @@ -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 @@ -113,6 +115,13 @@ .Mouse/x DEI2 #0008 SUB2 DUP2 #00e7 GTH2 ?{ DUP2 } POP2 BRK + &scroll ( distance -> ) + .selection/scroll LDZ ADD + ( above ) DUP #ff EQU ?{ + ( below ) DUP #18 ADD .lines/tracks LDZ GTH ?{ DUP .selection/scroll STZ + } } + 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/ ! @ ( -- ) + ( > ) [ LIT2 00 -selection/scroll ] STZ ;path/null LDA ?{ JMP2r } path/pop ! @@ -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 } ( | 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 .Screen/y DEI2k #0010 ADD2 ROT DEO2 INC GTHk ?&>l