Finally have *INFO working! OMG, what a nightmare.

This commit is contained in:
Bobbi Webber-Manners 2021-09-11 21:42:27 -04:00
parent f75d7cce86
commit e91b5a3991
3 changed files with 32 additions and 6 deletions

Binary file not shown.

View File

@ -711,12 +711,12 @@ INFO JSR PREPATH ; Preprocess pathname
** it does not go well ;)
INFOREENTRY
JSR WILDNEXT ; Start of new block
JSR WILDNEXT2 ; Start of new block
BCS INFOEXIT ; No more matches
INFOFIRST LDA WILDIDX
CMP #$FF ; Is WILDNEXT about to read new blk?
BEQ :DONEBLK ; If so, print this blk first
JSR WILDNEXT
JSR WILDNEXT2
BCS :DONEBLK ; If no more matches
BRA INFOFIRST
:DONEBLK JSR COPYAUXBLK

View File

@ -59,16 +59,42 @@ WILDCARD STZ :LAST
* Caller should check WILDIDX and call again if value is $FF
WILDNEXT LDX MFTEMP ; Length of MFTEMP
:L1 CPX #$00 ; Find final segment (previous match)
BEQ :S1
BEQ :AGAIN
LDA MFTEMP,X
CMP #'/'
BNE :S2
DEX
STX MFTEMP ; Trim MFTEMP
BRA :S1
BRA :AGAIN
:S2 DEX
BRA :L1
:S1 JSR SRCHBLK
:AGAIN JSR SRCHBLK
BCC :NOMATCH
JSR APPMATCH ; Append MATCHBUF to MFTEMP
JSR TMPtoMF ; Copy back to MOSFILE
CLC
RTS
:NOMATCH LDA WILDIDX ; See if there are more blocks
CMP #$FF
BEQ :AGAIN ; Yes, go again
SEC
RTS
* Different version of WILDNEXT which is used by the *INFO handler
* Because it needs to intercept each block.
* TODO: Once this works, refactor/cleanup
WILDNEXT2 LDX MFTEMP ; Length of MFTEMP
:L1 CPX #$00 ; Find final segment (previous match)
BEQ :AGAIN
LDA MFTEMP,X
CMP #'/'
BNE :S2
DEX
STX MFTEMP ; Trim MFTEMP
BRA :AGAIN
:S2 DEX
BRA :L1
:AGAIN JSR SRCHBLK
BCC :NOMATCH
JSR APPMATCH ; Append MATCHBUF to MFTEMP
JSR TMPtoMF ; Copy back to MOSFILE
@ -184,7 +210,7 @@ SRCHBLK LDA WILDIDX
:EOF
:BADDIR
:NODIR
SEC ; No match, caller checks WILDIDX ..
CLC ; No match, caller checks WILDIDX ..
RTS ; .. to see if another block
:CONT JSR SRCHBLK2 ; Handle one block