2005-08-31 20:11:45 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 15.04.2005
|
|
|
|
;
|
|
|
|
; unsigned char _sysmkdir (const char* name, ...);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export __sysmkdir
|
2013-05-09 11:56:54 +00:00
|
|
|
.import pushname, popname
|
|
|
|
.import addysp, popax
|
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
|
|
|
|
|
|
|
__sysmkdir:
|
|
|
|
; Throw away all parameters except the name
|
|
|
|
dey
|
|
|
|
dey
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr addysp
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
; Get and push name
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr popax
|
|
|
|
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::CREATE::PATHNAME
|
|
|
|
stx mliparam + MLI::CREATE::PATHNAME+1
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
; Set all other parameters from template
|
2013-05-09 11:56:54 +00:00
|
|
|
ldx #(MLI::CREATE::CREATE_TIME+1) - (MLI::CREATE::PATHNAME+1) - 1
|
|
|
|
: lda CREATE,x
|
|
|
|
sta mliparam + MLI::CREATE::ACCESS,x
|
2005-08-31 20:11:45 +00:00
|
|
|
dex
|
2013-05-09 11:56:54 +00:00
|
|
|
bpl :-
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
; Make directory
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #CREATE_CALL
|
|
|
|
ldx #CREATE_COUNT
|
|
|
|
jsr callmli
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
; Cleanup name
|
2013-05-09 11:56:54 +00:00
|
|
|
jsr popname ; Preserves A
|
2005-08-31 20:11:45 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
oserr: rts
|
2005-08-31 20:11:45 +00:00
|
|
|
|
|
|
|
.rodata
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
CREATE: .byte %11000011 ; ACCESS: Standard full access
|
|
|
|
.byte $0F ; FILE_TYPE: Directory file
|
|
|
|
.word $0000 ; AUX_TYPE: N/A
|
|
|
|
.byte $0D ; STORAGE_TYPE: Linked directory file
|
|
|
|
.word $0000 ; CREATE_DATE: Current date
|
|
|
|
.word $0000 ; CREATE_TIME: Current time
|