]> git.sur5r.net Git - cc65/blob - libsrc/apple2/dioopen.s
Renamed the defines in symdefs.h to something more meaningful. They were named
[cc65] / libsrc / apple2 / dioopen.s
1 ;
2 ; Oliver Schmidt, 24.03.2005
3 ;
4 ; dhandle_t __fastcall__ dio_open (driveid_t drive_id);
5 ;
6
7         .export         _dio_open
8         .import         return0, __dos_type
9
10         .include        "errno.inc"
11         .include        "mli.inc"
12
13 _dio_open:
14         ; Check for ProDOS 8
15         ldx     __dos_type
16         bne     :+
17         lda     #$01            ; "Bad system call number"
18         bne     oserr           ; Branch always
19
20         ; Walk device list
21 :       ldx     DEVCNT
22 :       cmp     DEVLST,x
23         beq     :+              ; Found drive_id in device list
24         dex
25         bpl     :-
26         lda     #$28            ; "No device connected"
27         
28         ; Return oserror
29 oserr:  sta     __oserror
30         jmp     return0
31
32         ; Return success
33 :       ldx     #$00
34         stx     __oserror
35         rts