]> git.sur5r.net Git - cc65/blob - libsrc/apple2/rootdir.s
Added VIC2 sprites as output format. Started to code the processing pipeline:
[cc65] / libsrc / apple2 / rootdir.s
1 ;
2 ; Oliver Schmidt, 2010-05-24
3 ;
4 ; int __fastcall__ rootdir (unsigned char drive, char* buf);
5 ;
6
7         .export         _rootdir
8         .import         popa
9
10         .include        "zeropage.inc"
11         .include        "errno.inc"
12         .include        "mli.inc"
13
14 _rootdir:
15         ; Save buf
16         sta     ptr1
17         stx     ptr1+1
18
19         ; Set buf
20         sta     mliparam + MLI::ON_LINE::DATA_BUFFER
21         stx     mliparam + MLI::ON_LINE::DATA_BUFFER+1
22
23         ; Set drive
24         jsr     popa
25         sta     mliparam + MLI::ON_LINE::UNIT_NUM
26
27         ; Get volume name
28         lda     #ON_LINE_CALL
29         ldx     #ON_LINE_COUNT
30         jsr     callmli
31         bcs     oserr
32
33         ; Get volume name length
34         ldy     #$00
35         lda     (ptr1),y
36         and     #15             ; Max volume name length
37         sta     tmp1
38         
39         ; Add leading slash
40         lda     #'/'
41         sta     (ptr1),y
42
43         ; Add terminating zero
44         ldy     tmp1
45         iny        
46         lda     #$00
47         sta     (ptr1),y
48         
49         ; Return success        ; A = 0
50         
51         ; Set __oserror
52 oserr:  jmp     __mappederrno