uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 3ed8a61625113d964d12a13dbfddb100dd1981fd
parent e89ad768aa890df8a24638723b9aa5acc0550b24
Author: neauoire <aliceffekt@gmail.com>
Date:   Sat,  8 Jan 2022 17:42:38 -0800

(boot.tal) Fixed issue with empty folders

Diffstat:
Mprojects/software/boot.tal | 21+++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)

diff --git a/projects/software/boot.tal b/projects/software/boot.tal @@ -189,6 +189,10 @@ RTN DUP .browser/last LDZ ! ,&has-changed JCN POP RTN &has-changed + ( beyond ) + DUP ;dir/lines LDA < ,&valid JCN + POP RTN + &valid #00 ;draw-browser JSR2 DUP .browser/sel STZ @@ -263,6 +267,9 @@ RTN @draw-browser ( mask -- ) + ( when empty ) + ;dir/lines LDA #01 = ;draw-browser-empty JCN2 + STH ( draw hand ) @@ -273,18 +280,32 @@ RTN ( draw files ) LINES-COUNT #00 &loop + ( reached end ) + DUP INC ;dir/lines LDA > ,&end JCN + ( has file ) .browser/x LDZ2 .Screen/x DEO2 DUP TOS 10** .browser/y LDZ2 ++ .Screen/y DEO2 DUP .browser/scroll LDZ + ;get-entry JSR2 DUP2 ;get-type JSR2 ;draw-type JSR2 #01 STHkr * ;draw-str JSR2 INC GTHk ,&loop JCN + &end POP2 POPr RTN +@draw-browser-empty ( mask -- ) + + POP + .browser/x LDZ2 .Screen/x DEO2 + .browser/y LDZ2 .Screen/y DEO2 + ;&empty-txt #01 ;draw-str JSR2 + +RTN + &empty-txt "Empty 20 "Folder $1 + @get-type ( line* -- type ) ;scap JSR2 #0004 -- ;&rom-ext ;scmp JSR2