2002-11-16 23:45:15 +00:00
|
|
|
;
|
2009-02-22 14:02:52 +00:00
|
|
|
; Ullrich von Bassewitz, 2002-11-16, 2009-02-22
|
2002-11-16 23:45:15 +00:00
|
|
|
;
|
|
|
|
; Scratch a file on disk
|
|
|
|
;
|
|
|
|
|
|
|
|
.export scratch
|
2009-02-22 14:02:52 +00:00
|
|
|
.import opencmdchannel, closecmdchannel, writefndiskcmd
|
|
|
|
.import fnunit, fncmd
|
2002-11-16 23:45:15 +00:00
|
|
|
|
|
|
|
.include "cbm.inc"
|
|
|
|
|
|
|
|
;--------------------------------------------------------------------------
|
|
|
|
; scratch: Scratch a file on disk. Expects the name of the file to be already
|
|
|
|
; parsed. Returns an error code in A, which may either be the code read from
|
|
|
|
; the command channel, or another error when accessing the command channel
|
|
|
|
; failed.
|
|
|
|
|
|
|
|
.proc scratch
|
|
|
|
|
2002-11-17 22:45:55 +00:00
|
|
|
ldx fnunit
|
|
|
|
jsr opencmdchannel
|
|
|
|
bne done
|
2002-11-16 23:45:15 +00:00
|
|
|
|
|
|
|
lda #'s' ; Scratch command
|
|
|
|
sta fncmd
|
2009-02-22 14:02:52 +00:00
|
|
|
jsr writefndiskcmd
|
2002-11-16 23:45:15 +00:00
|
|
|
|
|
|
|
pha
|
2002-11-17 22:45:55 +00:00
|
|
|
ldx fnunit
|
|
|
|
jsr closecmdchannel
|
2002-11-16 23:45:15 +00:00
|
|
|
pla
|
|
|
|
|
|
|
|
done: rts
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|