initcwd from Oliver Schmidt
git-svn-id: svn://svn.cc65.org/cc65/trunk@3466 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -65,6 +65,7 @@ OBJS= _scrsize.o \
|
|||||||
getenv.o \
|
getenv.o \
|
||||||
gotoxy.o \
|
gotoxy.o \
|
||||||
gotoy.o \
|
gotoy.o \
|
||||||
|
initcwd.o \
|
||||||
joy_stddrv.o \
|
joy_stddrv.o \
|
||||||
kbhit.o \
|
kbhit.o \
|
||||||
mainargs.o \
|
mainargs.o \
|
||||||
|
|||||||
37
libsrc/apple2/initcwd.s
Normal file
37
libsrc/apple2/initcwd.s
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 18.04.2005
|
||||||
|
;
|
||||||
|
|
||||||
|
.export initcwd
|
||||||
|
.import __cwd
|
||||||
|
|
||||||
|
.include "zeropage.inc"
|
||||||
|
.include "mli.inc"
|
||||||
|
|
||||||
|
initcwd:
|
||||||
|
; Use imported buffer
|
||||||
|
lda #<__cwd
|
||||||
|
ldx #>__cwd
|
||||||
|
sta mliparam + MLI::PREFIX::PATHNAME
|
||||||
|
stx mliparam + MLI::PREFIX::PATHNAME+1
|
||||||
|
|
||||||
|
; Get current working directory
|
||||||
|
lda #GET_PREFIX_CALL
|
||||||
|
ldx #PREFIX_COUNT
|
||||||
|
jsr callmli
|
||||||
|
|
||||||
|
; Check length byte
|
||||||
|
ldx __cwd
|
||||||
|
beq done
|
||||||
|
|
||||||
|
; Replace trailing slash with zero
|
||||||
|
sta __cwd,x ; A = 0
|
||||||
|
|
||||||
|
; Remove length byte
|
||||||
|
tax
|
||||||
|
: inx
|
||||||
|
lda __cwd,x
|
||||||
|
sta __cwd-1,x
|
||||||
|
bne :-
|
||||||
|
|
||||||
|
done: rts
|
||||||
@@ -11,9 +11,19 @@ RW_BLOCK_COUNT = 3
|
|||||||
CREATE_CALL = $C0
|
CREATE_CALL = $C0
|
||||||
CREATE_COUNT = 7
|
CREATE_COUNT = 7
|
||||||
|
|
||||||
|
DESTROY_CALL = $C1
|
||||||
|
DESTROY_COUNT = 1
|
||||||
|
|
||||||
|
RENAME_CALL = $C2
|
||||||
|
RENAME_COUNT = 2
|
||||||
|
|
||||||
ON_LINE_CALL = $C5
|
ON_LINE_CALL = $C5
|
||||||
ON_LINE_COUNT = 2
|
ON_LINE_COUNT = 2
|
||||||
|
|
||||||
|
SET_PREFIX_CALL = $C6
|
||||||
|
GET_PREFIX_CALL = $C7
|
||||||
|
PREFIX_COUNT = 1
|
||||||
|
|
||||||
OPEN_CALL = $C8
|
OPEN_CALL = $C8
|
||||||
OPEN_COUNT = 3
|
OPEN_COUNT = 3
|
||||||
|
|
||||||
@@ -50,11 +60,24 @@ EOF_COUNT = 2
|
|||||||
CREATE_DATE .word
|
CREATE_DATE .word
|
||||||
CREATE_TIME .word
|
CREATE_TIME .word
|
||||||
.endstruct
|
.endstruct
|
||||||
|
.struct DESTROY
|
||||||
|
PARAM_COUNT .byte
|
||||||
|
PATHNAME .addr
|
||||||
|
.endstruct
|
||||||
|
.struct RENAME
|
||||||
|
PARAM_COUNT .byte
|
||||||
|
PATHNAME .addr
|
||||||
|
NEW_PATHNAME .addr
|
||||||
|
.endstruct
|
||||||
.struct ON_LINE
|
.struct ON_LINE
|
||||||
PARAM_COUNT .byte
|
PARAM_COUNT .byte
|
||||||
UNIT_NUM .byte
|
UNIT_NUM .byte
|
||||||
DATA_BUFFER .addr
|
DATA_BUFFER .addr
|
||||||
.endstruct
|
.endstruct
|
||||||
|
.struct PREFIX
|
||||||
|
PARAM_COUNT .byte
|
||||||
|
PATHNAME .addr
|
||||||
|
.endstruct
|
||||||
.struct OPEN
|
.struct OPEN
|
||||||
PARAM_COUNT .byte
|
PARAM_COUNT .byte
|
||||||
PATHNAME .addr
|
PATHNAME .addr
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ OBJS= _scrsize.o \
|
|||||||
getenv.o \
|
getenv.o \
|
||||||
gotoxy.o \
|
gotoxy.o \
|
||||||
gotoy.o \
|
gotoy.o \
|
||||||
|
initcwd.o \
|
||||||
joy_stddrv.o \
|
joy_stddrv.o \
|
||||||
kbhit.o \
|
kbhit.o \
|
||||||
mainargs.o \
|
mainargs.o \
|
||||||
|
|||||||
Reference in New Issue
Block a user