mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 06:25:17 +00:00
Avoid using mli.s to initcwd
This commit is contained in:
committed by
Oliver Schmidt
parent
ce3bcadd24
commit
1f68846116
@@ -3,22 +3,39 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
.export initcwd
|
.export initcwd
|
||||||
.import __cwd
|
.import __cwd, __dos_type
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
|
.include "apple2.inc"
|
||||||
.include "mli.inc"
|
.include "mli.inc"
|
||||||
|
|
||||||
initcwd:
|
mli_parameters:
|
||||||
; Set static prefix buffer
|
.byte $01 ; number of parameters
|
||||||
lda #<__cwd
|
.addr __cwd ; address of parameter
|
||||||
ldx #>__cwd
|
|
||||||
sta mliparam + MLI::PREFIX::PATHNAME
|
|
||||||
stx mliparam + MLI::PREFIX::PATHNAME+1
|
|
||||||
|
|
||||||
; Get current working directory
|
initcwd:
|
||||||
lda #GET_PREFIX_CALL
|
; Check for ProDOS 8
|
||||||
ldx #PREFIX_COUNT
|
lda __dos_type
|
||||||
jsr callmli
|
beq oserr
|
||||||
|
|
||||||
|
; Save random counter
|
||||||
|
lda RNDL
|
||||||
|
pha
|
||||||
|
lda RNDH
|
||||||
|
pha
|
||||||
|
|
||||||
|
; Call MLI
|
||||||
|
jsr $BF00 ; MLI call entry point
|
||||||
|
.byte GET_PREFIX_CALL ; MLI command
|
||||||
|
.addr mli_parameters ; MLI parameter
|
||||||
|
|
||||||
|
; Restore random counter
|
||||||
|
tax
|
||||||
|
pla
|
||||||
|
sta RNDH
|
||||||
|
pla
|
||||||
|
sta RNDL
|
||||||
|
txa
|
||||||
|
|
||||||
; Check for null prefix
|
; Check for null prefix
|
||||||
ldx __cwd
|
ldx __cwd
|
||||||
@@ -39,3 +56,7 @@ initcwd:
|
|||||||
sta __cwd,x
|
sta __cwd,x
|
||||||
|
|
||||||
done: rts
|
done: rts
|
||||||
|
|
||||||
|
oserr: lda #$01 ; "Bad system call number"
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
Reference in New Issue
Block a user