(m291) Clamp scroll bounds

This commit is contained in:
Devine Lu Linvega 2024-08-30 13:55:05 -07:00
parent c57be86439
commit 9b15f5f079
1 changed files with 11 additions and 5 deletions

View File

@ -117,7 +117,9 @@
&scroll ( distance -> )
.selection/scroll LDZ ADD DUP #ff NEQ ?{ POP BRK }
.selection/scroll STZ
.lines/folders LDZ .lines/tracks LDZ ADD #18 SUB
( needs scroll ) DUP #80 LTH ?{ POP2 BRK }
( max scroll ) LTHk [ JMP SWP POP ] .selection/scroll STZ
<redraw-dir>
BRK
@ -251,13 +253,15 @@
( | folders )
.lines/folders LDZ #00
&>folders ( -- )
#00 OVR #70 SFT2 ;mem/folders ADD2 LDA cflc STHkr NEQ ?{ POPr NIP !<select> }
#00 OVR
( CELLSIZE ) #70 SFT2 ;mem/folders ADD2 LDA cflc STHkr NEQ ?{ POPr NIP !<select> }
INC GTHk ?&>folders
POP2
( | tracks )
.lines/tracks LDZ #00
&>tracks ( -- )
#00 OVR #70 SFT2 ;mem/tracks ADD2 LDA cflc STHkr NEQ ?{
#00 OVR
( CELLSIZE ) #70 SFT2 ;mem/tracks ADD2 LDA cflc STHkr NEQ ?{
POPr NIP .lines/folders LDZ ADD !<select> }
INC GTHk ?&>tracks
POP2 POPr JMP2r
@ -390,11 +394,13 @@
@sort-folders ( -- )
.lines/folders LDZ ?{ JMP2r }
;mem/folders DUP2 LIT2 [ 00 -lines/folders ] LDZ #01 SUB #70 SFT2 ADD2 !sort-files
;mem/folders DUP2 LIT2 [ 00 -lines/folders ] LDZ #01 SUB
( CELLSIZE ) #70 SFT2 ADD2 !sort-files
@sort-tracks ( -- )
.lines/tracks LDZ ?{ JMP2r }
;mem/tracks DUP2 LIT2 [ 00 -lines/tracks ] LDZ #01 SUB #70 SFT2 ADD2
;mem/tracks DUP2 LIT2 [ 00 -lines/tracks ] LDZ #01 SUB
( CELLSIZE ) #70 SFT2 ADD2
( >> )
@sort-files ( first* last* -- )