In FIND_IN_MEM, don't treat inactive resource as found - caller is checking for active only

This commit is contained in:
Martin Haye committed 2026-08-25 17:11:09 -07:00
1 parent e96b3d333d
commit 7d2a2f8605
1 file changed
+5 -2
+5 -2
View File
@@ -1815,9 +1815,12 @@ mem_find:
beq .notFound ; nope, pass to next loader
.found stx segNum ; save seg num for later
lda tSegType,x ; get flags
ora #$80 ; reactivate if necessary
bmi .alrAct ; if already active, no need to re-activate
bit .findonly ; in find mode...
bmi .notFound ; ...don't count inactive as found (caller is checking for active)
ora #$80 ; reactivate
sta tSegType,x ; save modified flag
lda tSegAdrHi,x ; get seg address hi
.alrAct lda tSegAdrHi,x ; get seg address hi
tay ; in Y for return
lda tSegAdrLo,x ; addr lo
tax ; in X for return