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
|
2018-05-20 13:30:18 +00:00
|
|
|
.import popptr1
|
2009-02-22 14:06:12 +00:00
|
|
|
|
|
|
|
.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
|
|
|
|
|
2018-05-20 13:30:18 +00:00
|
|
|
jsr popptr1
|
|
|
|
; ldy #0 Y=0 guaranteed by popptr1
|
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
|
|
|
|
|
|
|
|
|