2005-04-19 11:31:00 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 18.04.2005
|
|
|
|
;
|
|
|
|
|
|
|
|
.export initcwd
|
2013-05-09 11:56:54 +00:00
|
|
|
.import __cwd
|
2005-04-19 11:31:00 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "zeropage.inc"
|
2005-04-19 11:31:00 +00:00
|
|
|
.include "mli.inc"
|
|
|
|
|
|
|
|
initcwd:
|
2006-05-29 16:27:39 +00:00
|
|
|
; Set static prefix buffer
|
2013-05-09 11:56:54 +00:00
|
|
|
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
|
2015-10-14 22:15:38 +00:00
|
|
|
ldx __cwd
|
2013-05-09 11:56:54 +00:00
|
|
|
beq done
|
2006-05-29 16:27:39 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
; Remove length byte and trailing slash
|
2015-10-14 22:15:38 +00:00
|
|
|
dex
|
|
|
|
stx tmp1
|
|
|
|
ldx #$00
|
|
|
|
: lda __cwd + 1,x
|
|
|
|
sta __cwd,x
|
2013-05-09 11:56:54 +00:00
|
|
|
inx
|
|
|
|
cpx tmp1
|
|
|
|
bcc :-
|
2006-05-29 16:27:39 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
; Add terminating zero
|
|
|
|
lda #$00
|
2015-10-14 22:15:38 +00:00
|
|
|
sta __cwd,x
|
2018-09-08 21:14:54 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
done: rts
|