mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-08-07 17:25:12 +00:00
Adding error handling to DELETE. In progress.
This commit is contained in:
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
@@ -263,8 +263,8 @@ OSFILERET
|
|||||||
BNE :L3
|
BNE :L3
|
||||||
PLA
|
PLA
|
||||||
PLY ; Value of A on OSFILE entry
|
PLY ; Value of A on OSFILE entry
|
||||||
CPY #$FF ; LOAD
|
CPY #$FF ; See if command was LOAD
|
||||||
BNE :S4 ; Deal with return from SAVE
|
BNE :NOTLOAD ; Deal with return from SAVE
|
||||||
|
|
||||||
CMP #$01 ; No file found
|
CMP #$01 ; No file found
|
||||||
BNE :SL1
|
BNE :SL1
|
||||||
@@ -283,8 +283,8 @@ OSFILERET
|
|||||||
:SL2 LDA #$01 ; Return code - file found
|
:SL2 LDA #$01 ; Return code - file found
|
||||||
BRA :EXIT
|
BRA :EXIT
|
||||||
|
|
||||||
:S4 CPY #$00 ; Return from SAVE
|
:NOTLOAD CPY #$00 ; See if command was SAVE
|
||||||
BNE :S6
|
BNE :NOTLS ; Not LOAD or SAVE
|
||||||
CMP #$01 ; Unable to create or open
|
CMP #$01 ; Unable to create or open
|
||||||
BNE :SS1
|
BNE :SS1
|
||||||
BRK
|
BRK
|
||||||
@@ -295,13 +295,19 @@ OSFILERET
|
|||||||
BRK
|
BRK
|
||||||
|
|
||||||
:SS1 CMP #$02 ; Unable to write
|
:SS1 CMP #$02 ; Unable to write
|
||||||
BNE :S6
|
BNE :EXIT
|
||||||
BRK
|
BRK
|
||||||
DB $CA ; $CA = Premature end, 'Data lost'
|
DB $CA ; $CA = Premature end, 'Data lost'
|
||||||
ASC 'Write error'
|
ASC 'Write error'
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
:S6 LDA #$01 ; Short-term hack
|
:NOTLS CMP #$00 ; Unable to delete
|
||||||
|
BNE :EXIT
|
||||||
|
BRK
|
||||||
|
DB $D6 ; $D6 = File not found
|
||||||
|
ASC 'File not found'
|
||||||
|
BRK
|
||||||
|
|
||||||
:EXIT PLY
|
:EXIT PLY
|
||||||
PLX
|
PLX
|
||||||
RTS
|
RTS
|
||||||
|
14
mainmem.s
14
mainmem.s
@@ -141,9 +141,21 @@ COPYAUXBLK
|
|||||||
RTS
|
RTS
|
||||||
|
|
||||||
* ProDOS file handling to delete a file
|
* ProDOS file handling to delete a file
|
||||||
|
* Return A=0 not found, A=1 file, A=2 dir
|
||||||
DELFILE >>> ENTMAIN
|
DELFILE >>> ENTMAIN
|
||||||
|
JSR UPDFB ; Update FILEBLK
|
||||||
|
JSR COPYFB ; Copy back to aux mem
|
||||||
JSR DESTROY
|
JSR DESTROY
|
||||||
>>> XF2AUX,OSFILERET
|
BCC :DELETED
|
||||||
|
LDA $00 ; 'Not found'
|
||||||
|
BRA :EXIT
|
||||||
|
:DELETED LDA GINFOPL+7 ; Storage type
|
||||||
|
CMP #$0D ; Directory
|
||||||
|
BEQ :DIRDEL
|
||||||
|
LDA #$01 ; 'File deleted'
|
||||||
|
BRA :EXIT
|
||||||
|
:DIRDEL LDA #$02 ; 'Dir deleted'
|
||||||
|
:EXIT >>> XF2AUX,OSFILERET
|
||||||
|
|
||||||
DESTROY LDA #<MOSFILE ; Attempt to destroy file
|
DESTROY LDA #<MOSFILE ; Attempt to destroy file
|
||||||
STA DESTPL+1
|
STA DESTPL+1
|
||||||
|
Reference in New Issue
Block a user