2005-08-31 20:11:45 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 17.04.2005
|
|
|
|
;
|
|
|
|
; unsigned char __fastcall__ _syschdir (const char* name);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export __syschdir
|
2013-05-09 11:56:54 +00:00
|
|
|
.import pushname, popname
|
|
|
|
.import initcwd
|
2005-08-31 20:11:45 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "zeropage.inc"
|
|
|
|
.include "mli.inc"
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
__syschdir:
|
|
|
|
; Push name
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr pushname
|
|
|
|
bne oserr
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
; Set pushed name
|
2013-05-09 11:56:54 +00:00
|
|
|
lda sp
|
|
|
|
ldx sp+1
|
|
|
|
sta mliparam + MLI::PREFIX::PATHNAME
|
|
|
|
stx mliparam + MLI::PREFIX::PATHNAME+1
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
; Change directory
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #SET_PREFIX_CALL
|
|
|
|
ldx #PREFIX_COUNT
|
|
|
|
jsr callmli
|
|
|
|
bcs cleanup
|
2005-08-31 20:11:45 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
; Update current working directory
|
2023-08-18 12:36:52 +00:00
|
|
|
jsr initcwd
|
|
|
|
lda #$00
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
; Cleanup name
|
2013-05-09 11:56:54 +00:00
|
|
|
cleanup:jsr popname ; Preserves A
|
2005-08-31 20:11:45 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
oserr: rts
|