2009-02-22 14:06:12 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 2009-02-22
|
|
|
|
;
|
|
|
|
; unsigned char __fastcall__ _sysrename (const char *oldpath, const char *newpath);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export __sysrename
|
|
|
|
|
|
|
|
.import fnparse, fnadd, fnparsename
|
2009-07-27 18:42:37 +00:00
|
|
|
.import opencmdchannel, closecmdchannel
|
|
|
|
.import writefndiskcmd, readdiskerror
|
2009-02-22 14:06:12 +00:00
|
|
|
.import popax
|
|
|
|
|
|
|
|
.import fncmd, fnunit
|
2009-02-22 15:40:06 +00:00
|
|
|
.importzp ptr1
|
2009-02-22 14:06:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
;--------------------------------------------------------------------------
|
|
|
|
; __sysrename:
|
|
|
|
|
|
|
|
.proc __sysrename
|
|
|
|
|
|
|
|
jsr fnparse ; Parse first filename, pops newpath
|
|
|
|
bne done
|
|
|
|
|
|
|
|
lda #'='
|
|
|
|
jsr fnadd
|
|
|
|
|
|
|
|
jsr popax
|
2009-02-22 15:40:06 +00:00
|
|
|
sta ptr1
|
|
|
|
stx ptr1+1
|
|
|
|
ldy #0
|
2009-02-22 14:06:12 +00:00
|
|
|
jsr fnparsename ; Parse second filename
|
|
|
|
bne done
|
|
|
|
|
2009-02-22 14:43:02 +00:00
|
|
|
ldx fnunit
|
|
|
|
jsr opencmdchannel
|
|
|
|
bne done
|
|
|
|
|
2009-02-22 14:06:12 +00:00
|
|
|
lda #'r' ; Rename command
|
|
|
|
sta fncmd
|
|
|
|
jsr writefndiskcmd
|
|
|
|
|
2009-07-27 18:42:37 +00:00
|
|
|
; ldx fnunit
|
|
|
|
; jsr readdiskerror
|
|
|
|
|
2009-02-22 14:06:12 +00:00
|
|
|
pha
|
|
|
|
ldx fnunit
|
|
|
|
jsr closecmdchannel
|
|
|
|
pla
|
|
|
|
|
|
|
|
done: rts
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|