(launcher.tal) Fixed scrolling issue after assembly

This commit is contained in:
neauoire 2022-01-16 09:22:37 -08:00
parent 4d9ba05045
commit acbd654165
1 changed files with 11 additions and 13 deletions

View File

@ -48,6 +48,7 @@
@browser @browser
&x $2 &y $2 &x2 $2 &y2 $2 &x $2 &y $2 &x2 $2 &y2 $2
&sel $1 &last $1 &scroll $1 &sel $1 &last $1 &scroll $1
&lines $1
( init ) ( init )
@ -119,7 +120,7 @@ BRK
DUP .browser/scroll LDZ + ;scroll-to JSR2 DUP .browser/scroll LDZ + ;scroll-to JSR2
&no-up &no-up
DUP #01 ! ,&no-down JCN DUP #01 ! ,&no-down JCN
.browser/scroll LDZ ;dir/lines LDA = ,&no-down JCN .browser/scroll LDZ .browser/lines LDZ = ,&no-down JCN
DUP .browser/scroll LDZ + ;scroll-to JSR2 DUP .browser/scroll LDZ + ;scroll-to JSR2
&no-down &no-down
POP POP
@ -149,7 +150,7 @@ BRK
POP BRK POP BRK
&no-up &no-up
DUP #20 ! ,&no-down JCN DUP #20 ! ,&no-down JCN
.browser/sel LDZ INC ;dir/lines LDA = ,&no-down JCN .browser/sel LDZ INC .browser/lines LDZ = ,&no-down JCN
.browser/sel LDZ INC ;select-file JSR2 .browser/sel LDZ INC ;select-file JSR2
;follow-selection JSR2 ;follow-selection JSR2
POP BRK POP BRK
@ -175,13 +176,14 @@ BRK
#1000 .File/length DEO2 #1000 .File/length DEO2
;dir/data .File/read DEO2 ;dir/data .File/read DEO2
.File/success DEI2 ;dir/length STA2 .File/success DEI2 ;dir/length STA2
#00 .browser/lines STZ
( split with null-char ) ( split with null-char )
;dir/data ;dir/data
&while &while
LDAk #1f > ,&no-lb JCN LDAk #1f > ,&no-lb JCN
( split ) STH2k #00 STH2r STA ( split ) STH2k #00 STH2r STA
( count lines ) ;dir/lines LDA INC ;dir/lines STA ( count lines ) .browser/lines LDZk INC SWP STZ
&no-lb &no-lb
INC2 LDAk ,&while JCN INC2 LDAk ,&while JCN
POP2 POP2
@ -195,7 +197,7 @@ RTN
POP RTN POP RTN
&has-changed &has-changed
( beyond ) ( beyond )
DUP ;dir/lines LDA < ,&valid JCN DUP .browser/lines LDZ < ,&valid JCN
POP RTN POP RTN
&valid &valid
@ -216,7 +218,7 @@ RTN
#0080 .Screen/y DEO2 #0080 .Screen/y DEO2
.browser/sel LDZ #02 ;draw-byte JSR2 .browser/sel LDZ #02 ;draw-byte JSR2
LIT '/ #02 ;draw-char JSR2 LIT '/ #02 ;draw-char JSR2
;dir/lines LDA #01 - #02 ;draw-byte JSR2 .browser/lines LDZ #01 - #02 ;draw-byte JSR2
AUTO-NONE AUTO-NONE
RTN RTN
@ -238,7 +240,7 @@ RTN
STH STH
( more lines than visible ) ( more lines than visible )
;dir/lines LDA LINES-COUNT .browser/lines LDZ LINES-COUNT
DUP2 > ,&can-scroll JCN DUP2 > ,&can-scroll JCN
POPr POP2 RTN POPr POP2 RTN
&can-scroll &can-scroll
@ -257,10 +259,9 @@ RTN
;get-entry JSR2 #0005 ++ ;get-entry JSR2 #0005 ++
DUP2 ;check-rom JSR2 ,&valid JCN DUP2 ;check-rom JSR2 ,&valid JCN
( check if tal file ) ( check if tal file )
DUP2 ;scap JSR2 #0004 -- ;&tal-ext ;scmp JSR2 #01 ! ,&no-tal JCN DUP2 ;scap JSR2 #0004 -- ;&tal-ext ;scmp JSR2 #01 ! ,&no-tal JCN
( assemble tal file )
DUP2 ;&output-path ;scpy JSR2 DUP2 ;&output-path ;scpy JSR2
;&rom-ext ;&output-path ;scat JSR2 ;&rom-ext ;&output-path ;scat JSR2
;&output-path ;asma-assemble-file JSR2 ;&output-path ;asma-assemble-file JSR2
@ -268,10 +269,8 @@ RTN
;redraw JSR2 ;redraw JSR2
RTN RTN
&no-tal &no-tal
POP2 RTN POP2 RTN
&valid &valid
;load-rom JSR2 ;load-rom JSR2
RTN RTN
@ -290,7 +289,7 @@ RTN
@draw-browser ( mask -- ) @draw-browser ( mask -- )
( when empty ) ( when empty )
;dir/lines LDA #01 = ;draw-browser-empty JCN2 .browser/lines LDZ #01 = ;draw-browser-empty JCN2
STH STH
@ -303,7 +302,7 @@ RTN
LINES-COUNT #00 LINES-COUNT #00
&loop &loop
( reached end ) ( reached end )
DUP INC ;dir/lines LDA > ,&end JCN DUP INC .browser/lines LDZ > ,&end JCN
( has file ) ( has file )
.browser/x LDZ2 .Screen/x DEO2 .browser/x LDZ2 .Screen/x DEO2
DUP TOS 10** .browser/y LDZ2 ++ .Screen/y DEO2 DUP TOS 10** .browser/y LDZ2 ++ .Screen/y DEO2
@ -561,7 +560,6 @@ JMP2r
@dir @dir
&path ". $1 &path ". $1
&lines $1
&length $2 &length $2
&data $1000 &data $1000