2010-05-26 21:02:35 +00:00
|
|
|
;
|
|
|
|
; Oliver Schmidt, 2010-05-24
|
|
|
|
;
|
2010-06-02 07:03:54 +00:00
|
|
|
; int __fastcall__ rootdir (unsigned char drive, char* buf);
|
2010-05-26 21:02:35 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
.export _rootdir
|
2010-07-07 22:28:14 +00:00
|
|
|
.import popa
|
2010-05-26 21:02:35 +00:00
|
|
|
|
|
|
|
.include "zeropage.inc"
|
|
|
|
.include "errno.inc"
|
|
|
|
.include "mli.inc"
|
|
|
|
|
|
|
|
_rootdir:
|
|
|
|
; Save buf
|
|
|
|
sta ptr1
|
|
|
|
stx ptr1+1
|
|
|
|
|
|
|
|
; Set buf
|
|
|
|
sta mliparam + MLI::ON_LINE::DATA_BUFFER
|
|
|
|
stx mliparam + MLI::ON_LINE::DATA_BUFFER+1
|
|
|
|
|
|
|
|
; Set drive
|
2010-07-07 22:28:14 +00:00
|
|
|
jsr popa
|
2010-05-26 21:02:35 +00:00
|
|
|
sta mliparam + MLI::ON_LINE::UNIT_NUM
|
|
|
|
|
|
|
|
; Get volume name
|
|
|
|
lda #ON_LINE_CALL
|
|
|
|
ldx #ON_LINE_COUNT
|
|
|
|
jsr callmli
|
2010-06-01 21:01:59 +00:00
|
|
|
bcs oserr
|
2010-05-26 21:02:35 +00:00
|
|
|
|
|
|
|
; Get volume name length
|
|
|
|
ldy #$00
|
|
|
|
lda (ptr1),y
|
|
|
|
and #15 ; Max volume name length
|
|
|
|
sta tmp1
|
|
|
|
|
|
|
|
; Add leading slash
|
|
|
|
lda #'/'
|
|
|
|
sta (ptr1),y
|
|
|
|
|
|
|
|
; Add terminating zero
|
|
|
|
ldy tmp1
|
|
|
|
iny
|
|
|
|
lda #$00
|
|
|
|
sta (ptr1),y
|
|
|
|
|
2010-06-15 21:44:18 +00:00
|
|
|
; Return success ; A = 0
|
2010-06-01 21:01:59 +00:00
|
|
|
|
2010-06-15 20:38:05 +00:00
|
|
|
; Set __oserror
|
|
|
|
oserr: jmp __mappederrno
|