2005-04-19 11:31:00 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 18.04.2005
|
|
|
|
;
|
|
|
|
|
|
|
|
.export initcwd
|
|
|
|
.import __cwd
|
|
|
|
|
|
|
|
.include "zeropage.inc"
|
|
|
|
.include "mli.inc"
|
|
|
|
|
|
|
|
initcwd:
|
2006-05-29 16:27:39 +00:00
|
|
|
; Set static prefix buffer
|
|
|
|
lda #<__cwd
|
|
|
|
ldx #>__cwd
|
2005-04-19 11:31:00 +00:00
|
|
|
sta mliparam + MLI::PREFIX::PATHNAME
|
|
|
|
stx mliparam + MLI::PREFIX::PATHNAME+1
|
|
|
|
|
|
|
|
; Get current working directory
|
|
|
|
lda #GET_PREFIX_CALL
|
|
|
|
ldx #PREFIX_COUNT
|
|
|
|
jsr callmli
|
|
|
|
|
2005-04-19 14:28:15 +00:00
|
|
|
; Check for null prefix
|
2006-05-29 16:27:39 +00:00
|
|
|
lda __cwd
|
|
|
|
beq done
|
|
|
|
|
|
|
|
; Remove length byte and trailing slash
|
|
|
|
sta tmp1
|
|
|
|
ldx #$01
|
|
|
|
: lda __cwd,x
|
|
|
|
sta __cwd - 1,x
|
|
|
|
inx
|
|
|
|
cpx tmp1
|
|
|
|
bcc :-
|
|
|
|
|
|
|
|
; Add terminating zero
|
|
|
|
lda #$00
|
|
|
|
sta __cwd - 1,x
|
|
|
|
|
|
|
|
done: rts
|