test cartlist lengths and document limitations and alternative method for scrollbar rendering

This commit is contained in:
Iris Lightshard 2021-10-10 20:49:07 -06:00
parent bd123b825a
commit 417c1dd137
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
2 changed files with 30 additions and 4 deletions

View file

@ -34,3 +34,26 @@ and bizniss
and buznets
and whimsy
and also combs
noodle
orca
left
ustrat
katbug
soul grind
hyperkaos
niju
pokiminz
yeet
funk
what
is
this
bizzzz
eele
blunt
junt
hanf
yank
yunt
yeet
eee

View file

@ -548,6 +548,10 @@ RTN
RTN
( this scrollbar breaks down with about 2x as many cartridges as the scren
has room for. A better method would be keeping track of the height, step,
and position )
@draw-scrollbar ( -> )
.Screen/width DEI2 #0048 SUB2 .Screen/x DEO2
@ -571,18 +575,17 @@ RTN
&start-loop
#0028 .Screen/y DEO2
( store the number of carts per tile of the scroll bar )
.ncarts LDZ .list-height LDZ SUB .list-height LDZ MOD INC
STH
.ncarts LDZ .list-height LDZ DIV STH
.list-height LDZ #00
&while EQUk ,&end JCN
( trough top )
DUP INC .list-top LDZ GTH ,&handle JCN
DUP INC STHrk MUL .list-top LDZ GTH ,&handle JCN
INC
INC-Y
,&while JMP
&handle
DUP .list-top LDZ .list-height LDZ ADD STHrk SUB LTH #00 EQU ,&trough-bottom JCN
DUP INC INC STHrk .ncarts LDZ [ .list-top LDZ .list-height LDZ ADD ] SUB MUL ADD .list-height LDZ GTH ,&trough-bottom JCN
;scrollbar .Screen/addr DEO2
#81 .Screen/sprite DEO
&trough-bottom