mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-02-12 09:30:40 +00:00
*RENAME uses PARSNAME + PARSNAME2 now
This commit is contained in:
parent
b7abbf1399
commit
52d802d375
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
@ -475,8 +475,7 @@ FSCRUNLP LDA (OSLPTR),Y ; Look for command line
|
|||||||
SEC ; Not from RESET
|
SEC ; Not from RESET
|
||||||
JMP (OSFILECB+6) ; Jump to EXEC addr
|
JMP (OSFILECB+6) ; Jump to EXEC addr
|
||||||
|
|
||||||
FSCREN JSR XYtoLPTR ; Pointer to command line
|
FSCREN JMP RENAME
|
||||||
JMP RENAME
|
|
||||||
|
|
||||||
FSCCHDIR JMP CHDIR
|
FSCCHDIR JMP CHDIR
|
||||||
|
|
||||||
@ -642,37 +641,13 @@ PRSPACE LDA #' '
|
|||||||
JMP OSWRCH
|
JMP OSWRCH
|
||||||
|
|
||||||
* Perform FSCV $0C RENAME function
|
* Perform FSCV $0C RENAME function
|
||||||
* Parameter string in OSLPTR
|
* Parameter string in XY
|
||||||
RENAME LDY #$00
|
RENAME JSR PARSNAME ; Copy Arg1->MOSFILE
|
||||||
:ARG1 LDA (OSLPTR),Y
|
CMP #$00 ; Length of arg1
|
||||||
CMP #$20 ; Space
|
BEQ :RENSYN
|
||||||
BEQ :ENDARG1
|
JSR PARSNAME2 ; Copy Arg2->MOSFILE2
|
||||||
CMP #$0D ; Carriage return
|
CMP #$00 ; Length of arg2
|
||||||
BEQ :RENSYN
|
BEQ :RENSYN
|
||||||
INY
|
|
||||||
>>> WRTMAIN
|
|
||||||
STA MOSFILE,Y
|
|
||||||
>>> WRTAUX
|
|
||||||
BRA :ARG1
|
|
||||||
:ENDARG1 >>> WRTMAIN
|
|
||||||
STY MOSFILE ; Length of Pascal string
|
|
||||||
>>> WRTAUX
|
|
||||||
JSR SKIPSPC
|
|
||||||
JSR LPTRtoXY ; Update LPTR and set Y=0
|
|
||||||
JSR XYtoLPTR ; ...
|
|
||||||
:ARG2 LDA (OSLPTR),Y
|
|
||||||
CMP #$20 ; Space
|
|
||||||
BEQ :ENDARG2
|
|
||||||
CMP #$0D ; Carriage return
|
|
||||||
BEQ :ENDARG2
|
|
||||||
INY
|
|
||||||
>>> WRTMAIN
|
|
||||||
STA MOSFILE2,Y
|
|
||||||
>>> WRTAUX
|
|
||||||
BRA :ARG2
|
|
||||||
:ENDARG2 >>> WRTMAIN
|
|
||||||
STY MOSFILE2 ; Length of Pascal string
|
|
||||||
>>> WRTAUX
|
|
||||||
>>> XF2MAIN,RENFILE
|
>>> XF2MAIN,RENFILE
|
||||||
:RENSYN BRK
|
:RENSYN BRK
|
||||||
DB $DC
|
DB $DC
|
||||||
@ -681,30 +656,8 @@ RENAME LDY #$00
|
|||||||
RENRET
|
RENRET
|
||||||
>>> ENTAUX
|
>>> ENTAUX
|
||||||
JSR CHKERROR
|
JSR CHKERROR
|
||||||
**** JSR CHKNOTFND ;;; NOPE: THIS IS MAINMEM FUNC!!!
|
|
||||||
* CMP #$44 ; Path not found
|
|
||||||
* BEQ :NOTFND
|
|
||||||
* CMP #$45 ; Vol dir not found
|
|
||||||
* BEQ :NOTFND
|
|
||||||
* CMP #$46 ; File not found
|
|
||||||
* BEQ :NOTFND
|
|
||||||
* CMP #$47 ; Duplicate filename
|
|
||||||
* BEQ :EXISTS
|
|
||||||
* CMP #$4E ; Access error
|
|
||||||
* BEQ :LOCKED
|
|
||||||
* CMP #$00
|
|
||||||
* BNE :OTHER ; All other errors
|
|
||||||
LDA #$00
|
LDA #$00
|
||||||
RTS
|
RTS
|
||||||
*:NOTFND JMP ERRNOTFND
|
|
||||||
*:EXISTS JMP ERREXISTS
|
|
||||||
*:LOCKED BRK
|
|
||||||
* DB $C3
|
|
||||||
* ASC 'Locked'
|
|
||||||
*:OTHER BRK
|
|
||||||
* DB $C7
|
|
||||||
* ASC 'Disc error'
|
|
||||||
* BRK
|
|
||||||
|
|
||||||
* Handle *DIR (directory change) command
|
* Handle *DIR (directory change) command
|
||||||
* On entry, XY points to command line
|
* On entry, XY points to command line
|
||||||
@ -750,6 +703,29 @@ PARSNAME JSR XYtoLPTR
|
|||||||
TXA ; Return len in A
|
TXA ; Return len in A
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
* Parse filename pointed to by (OSLPTR),Y
|
||||||
|
* Write filename to MOSFILE2 in main memory
|
||||||
|
* Returns length in A
|
||||||
|
PARSNAME2
|
||||||
|
CLC ; Means parsing a filename
|
||||||
|
JSR GSINIT ; Init gen string handling
|
||||||
|
PHP
|
||||||
|
SEI ; Disable IRQs
|
||||||
|
LDX #$00 ; Length
|
||||||
|
:L1 JSR GSREAD ; Handle next char
|
||||||
|
BCS :DONE
|
||||||
|
STA $C004 ; Write to main mem
|
||||||
|
STA MOSFILE2+1,X
|
||||||
|
STA $C005 ; Write to aux mem
|
||||||
|
INX
|
||||||
|
BNE :L1
|
||||||
|
:DONE STA $C004 ; Write to main mem
|
||||||
|
STX MOSFILE2 ; Length byte (Pascal)
|
||||||
|
STA $C005 ; Back to aux
|
||||||
|
PLP ; IRQs back as they were
|
||||||
|
TXA ; Return len in A
|
||||||
|
RTS
|
||||||
|
|
||||||
* Move this somewhere
|
* Move this somewhere
|
||||||
CHKERROR CMP #$20
|
CHKERROR CMP #$20
|
||||||
BCS MKERROR
|
BCS MKERROR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user