]> git.sur5r.net Git - cc65/blob - libsrc/apple2/getdevice.s
Fixed _textcolor definition.
[cc65] / libsrc / apple2 / getdevice.s
1 ;
2 ; Oliver Schmidt, 2012-09-04
3 ;
4 ; unsigned char getfirstdevice (void);
5 ; unsigned char __fastcall__ getnextdevice (unsigned char device);
6 ;
7
8         .export         _getfirstdevice
9         .export         _getnextdevice
10         .import         __dos_type, isdevice
11
12         .include        "zeropage.inc"
13
14 _getfirstdevice:
15         lda     #$FF
16         ; Fall through
17
18 _getnextdevice:
19         tax
20 next:   inx
21         cpx     #$FF            ; INVALID_DEVICE
22         beq     done
23
24         ; Check for ProDOS 8
25         lda     __dos_type
26         beq     next
27
28         ; Check for valid device
29         jsr     isdevice
30         bne     next
31
32 done:   txa
33         ldx     #$00
34         rts