mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-05 19:29:37 +00:00
Implemented OSFILE A=&06: Delete file, *DELETE cmd
This commit is contained in:
parent
69790423f2
commit
35a8b8b2a0
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
@ -227,10 +227,11 @@ FILEHND PHX
|
||||
|
||||
PLA ; Get action back
|
||||
PHA
|
||||
BEQ :S1 ; A=00 -> SAVE
|
||||
BEQ :SAVE ; A=00 -> SAVE
|
||||
CMP #$FF
|
||||
BEQ :S2 ; A=FF -> LOAD
|
||||
|
||||
BEQ :LOAD ; A=FF -> LOAD
|
||||
CMP #$06
|
||||
BEQ :DELETE ; A=06 -> DELET
|
||||
LDA #<OSFILEM ; If not implemented, print msg
|
||||
LDY #>OSFILEM
|
||||
JSR PRSTR
|
||||
@ -244,8 +245,9 @@ FILEHND PHX
|
||||
PLY
|
||||
PLX
|
||||
RTS
|
||||
:S1 >>> XF2MAIN,SAVEFILE
|
||||
:S2 >>> XF2MAIN,LOADFILE
|
||||
:SAVE >>> XF2MAIN,SAVEFILE
|
||||
:LOAD >>> XF2MAIN,LOADFILE
|
||||
:DELETE >>> XF2MAIN,DELFILE
|
||||
OSFILERET
|
||||
>>> ENTAUX
|
||||
PHA
|
||||
|
@ -64,7 +64,7 @@ CLIHND PHX
|
||||
JSR STRCMP
|
||||
BCS :S5
|
||||
JSR STARLOAD
|
||||
BRA :EXIT
|
||||
BRA :IEXIT
|
||||
:S5 LDA #<:SAVE
|
||||
STA ZP2
|
||||
LDA #>:SAVE
|
||||
@ -81,7 +81,15 @@ CLIHND PHX
|
||||
BCS :S7
|
||||
JSR STARRUN
|
||||
BRA :EXIT
|
||||
:S7 LDA #<:HELP
|
||||
:S7 LDA #<:DELETE
|
||||
STA ZP2
|
||||
LDA #>:DELETE
|
||||
STA ZP2+1
|
||||
JSR STRCMP
|
||||
BCS :S8
|
||||
JSR STARDEL
|
||||
BRA :EXIT
|
||||
:S8 LDA #<:HELP
|
||||
STA ZP2
|
||||
LDA #>:HELP
|
||||
STA ZP2+1
|
||||
@ -91,9 +99,6 @@ CLIHND PHX
|
||||
BRA :EXIT
|
||||
:ASKROM LDA $8006 ; Check for service entry
|
||||
BPL :UNSUPP ; No service entry
|
||||
* LDA $8003 ; Check for service entry
|
||||
* CMP #$4C ; Not a JMP?
|
||||
* BNE :UNSUPP ; Only BASIC has no srvc entry
|
||||
LDA ZP1 ; String in (OSLPTR),Y
|
||||
STA OSLPTR
|
||||
LDA ZP1+1
|
||||
@ -142,6 +147,8 @@ CLIHND PHX
|
||||
DB $00
|
||||
:RUN ASC 'RUN'
|
||||
DB $00
|
||||
:DELETE ASC 'DELETE'
|
||||
DB $00
|
||||
:HELP ASC 'HELP'
|
||||
DB $00
|
||||
:OSCLIM ASC 'OSCLI('
|
||||
@ -399,6 +406,25 @@ JUMPFSCV PHA
|
||||
PLA
|
||||
CALLFSCV JMP (FSCV) ; Hand on to filing system
|
||||
|
||||
* Handle *DELETE command
|
||||
* On entry, ZP1 points to command line
|
||||
STARDEL JSR EATSPC ; Eat leading space
|
||||
JSR ADDZP1Y ; Advance ZP1
|
||||
LDA ZP1
|
||||
STA OSFILECB+0
|
||||
LDA ZP1+1
|
||||
STA OSFILECB+1
|
||||
JSR EATWORD
|
||||
LDA #$0D
|
||||
STA (ZP1),Y ; Terminate filename
|
||||
LDX #<OSFILECB
|
||||
LDY #>OSFILECB
|
||||
LDA #$06 ; OSFILE delete command
|
||||
JSR OSFILE
|
||||
RTS
|
||||
:ERR JSR BEEP
|
||||
RTS
|
||||
|
||||
* Clear OSFILE control block to zeros
|
||||
CLRCB LDA #$00
|
||||
LDX #$00
|
||||
|
20
mainmem.s
20
mainmem.s
@ -139,21 +139,27 @@ COPYAUXBLK
|
||||
CLI
|
||||
RTS
|
||||
|
||||
* ProDOS file handling for MOS OSFIND OPEN call
|
||||
* Options in A: $40 'r', $80 'w', $C0 'rw'
|
||||
OFILE >>> ENTMAIN
|
||||
PHA ; Preserve arg for later
|
||||
CMP #$80 ; Write mode
|
||||
BNE :S0
|
||||
* ProDOS file handling to delete a file
|
||||
DELFILE >>> ENTMAIN
|
||||
JSR DESTROY
|
||||
>>> XF2AUX,OSFILERET
|
||||
|
||||
LDA #<MOSFILE ; Attempt to destroy file
|
||||
DESTROY LDA #<MOSFILE ; Attempt to destroy file
|
||||
STA DESTPL+1
|
||||
LDA #>MOSFILE
|
||||
STA DESTPL+2
|
||||
JSR MLI
|
||||
DB DESTCMD
|
||||
DW DESTPL
|
||||
RTS
|
||||
|
||||
* ProDOS file handling for MOS OSFIND OPEN call
|
||||
* Options in A: $40 'r', $80 'w', $C0 'rw'
|
||||
OFILE >>> ENTMAIN
|
||||
PHA ; Preserve arg for later
|
||||
CMP #$80 ; Write mode
|
||||
BNE :S0
|
||||
JSR DESTROY
|
||||
LDA #<MOSFILE ; Attempt to create file
|
||||
STA CREATEPL+1
|
||||
STA OPENPL+1
|
||||
|
Loading…
Reference in New Issue
Block a user