mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-17 07:30:22 +00:00
Merged in *DIR slot/drive (:sd) handling again
This commit is contained in:
parent
39d6fad471
commit
6fbac9ed99
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
63
mainmem.s
63
mainmem.s
@ -919,7 +919,34 @@ CATALOGRET
|
||||
* dir/file.ext filesystem, so '..' means parent dir (eg: '../SOMEDIR')
|
||||
* Also allows '^' as '^' is illegal character
|
||||
* Carry set on error, clear otherwise
|
||||
PREPATH JSR GETPREF ; Current pfx -> MOSFILE2
|
||||
PREPATH LDX MOSFILE ; Length
|
||||
BEQ :EXIT ; If zero length
|
||||
LDA MOSFILE+1 ; 1st char of pathname
|
||||
CMP #$3A ; ':'
|
||||
BNE :NOTCOLN ; Not colon
|
||||
CPX #$03 ; Length >= 3?
|
||||
BCC :ERR ; If not
|
||||
LDA MOSFILE+3 ; Drive
|
||||
SEC
|
||||
SBC #'1'
|
||||
TAX
|
||||
LDA MOSFILE+2 ; Slot
|
||||
SEC
|
||||
SBC #'0'
|
||||
JSR DRV2PFX ; Slot/drv->pfx in MOSFILE2
|
||||
JSR DEL1CHAR ; Delete ':' from MOSFILE
|
||||
JSR DEL1CHAR ; Delete slot from MOSFILE
|
||||
JSR DEL1CHAR ; Delete drive from MOSFILE
|
||||
LDA MOSFILE ; Is there more?
|
||||
BEQ :APPEND ; Only ':sd'
|
||||
CMP #$02 ; Length >= 2
|
||||
BCC :ERR ; If not
|
||||
LDA MOSFILE+1 ; 1st char of filename
|
||||
CMP #$2F ; '/'
|
||||
BNE :ERR
|
||||
JSR DEL1CHAR ; Delete '/' from MOSFILE
|
||||
BRA :APPEND
|
||||
:NOTCOLN JSR GETPREF ; Current pfx -> MOSFILE2
|
||||
:REENTER LDA MOSFILE+1 ; First char of dirname
|
||||
CMP #'.'
|
||||
BEQ :UPDIR1
|
||||
@ -927,7 +954,7 @@ PREPATH JSR GETPREF ; Current pfx -> MOSFILE2
|
||||
BEQ :CARET ; If '^'
|
||||
CMP #$2F ; '/' char - abs path
|
||||
BEQ :EXIT ; Nothing to do
|
||||
BRA :PARENT
|
||||
BRA :APPEND
|
||||
|
||||
:UPDIR1 LDA MOSFILE+2
|
||||
CMP #'.' ; '..'
|
||||
@ -936,7 +963,7 @@ PREPATH JSR GETPREF ; Current pfx -> MOSFILE2
|
||||
:CARET JSR DEL1CHAR ; Delete '^' from MOSFILE
|
||||
JSR PARENT ; Parent dir -> MOSFILE2
|
||||
LDA MOSFILE ; Is there more?
|
||||
BEQ :PARENT ; Only '^'
|
||||
BEQ :APPEND ; Only '^'
|
||||
CMP #$02 ; Len at least two?
|
||||
BCC :ERR ; Nope!
|
||||
LDA MOSFILE+1 ; What is next char?
|
||||
@ -944,7 +971,7 @@ PREPATH JSR GETPREF ; Current pfx -> MOSFILE2
|
||||
BNE :ERR ; Nope!
|
||||
JSR DEL1CHAR ; Delete '/' from MOSFILE
|
||||
BRA :REENTER ; Go again!
|
||||
:PARENT JSR APPMF2 ; Append MOSFILE->MOSFILE2
|
||||
:APPEND JSR APPMF2 ; Append MOSFILE->MOSFILE2
|
||||
JSR COPYMF2 ; Copy back to MOSFILE
|
||||
:EXIT CLC
|
||||
RTS
|
||||
@ -1019,20 +1046,12 @@ PARENT LDX MOSFILE2 ; Length of string
|
||||
|
||||
* Convert slot/drive to prefix
|
||||
* Expect slot number (1..7) in A, drive (0..1) in X
|
||||
* Puts prefix (or empty string) in MOSFILE
|
||||
DRV2PFX
|
||||
* ASL
|
||||
* ASL
|
||||
* ASL
|
||||
* ASL
|
||||
* STX :TEMP ; Gets 0SSS000D
|
||||
* ORA :TEMP ; Shouldn't this be DSSS00000 ?
|
||||
|
||||
CLC ; Cy=0 A=00000sss
|
||||
* Puts prefix (or empty string) in MOSFILE2
|
||||
DRV2PFX CLC ; Cy=0 A=00000sss
|
||||
ROR A ; s 000000ss
|
||||
ROR A ; s s000000s
|
||||
ROR A ; s ss000000
|
||||
ROR A ; s sss00000
|
||||
ROR A ; 0 sss00000
|
||||
CPX #1 ; d sss00000
|
||||
ROR A ; 0 dsss0000
|
||||
|
||||
@ -1042,16 +1061,20 @@ DRV2PFX
|
||||
DW ONLNPL ; Buffer set to DRVBUF2 (was $301)
|
||||
LDA DRVBUF2 ; was $301 ; Slot/Drive/Length
|
||||
AND #$0F ; Mask to get length
|
||||
STA MOSFILE ; Store length
|
||||
TAX
|
||||
:L1 CPX #$00 ; Copy -> MOSFILE
|
||||
INC ; Plus '/' at each end
|
||||
INC
|
||||
STA MOSFILE2 ; Store length
|
||||
LDA #$2F ; '/'
|
||||
STA MOSFILE2+1
|
||||
STA MOSFILE2+2,X
|
||||
:L1 CPX #$00 ; Copy -> MOSFILE2
|
||||
BEQ :EXIT
|
||||
LDA DRVBUF2,X ; was $301,X
|
||||
STA MOSFILE,X ; Should be able to read
|
||||
DEX ; directly to MOSFILE
|
||||
STA MOSFILE2+1,X
|
||||
DEX
|
||||
BRA :L1
|
||||
:EXIT RTS
|
||||
* :TEMP DB $00
|
||||
|
||||
* Delete first char of MOSFILE
|
||||
DEL1CHAR LDX MOSFILE ; Length
|
||||
|
Loading…
x
Reference in New Issue
Block a user