]> git.sur5r.net Git - cc65/blob - libsrc/apple2/curdevice.s
Fixed _textcolor definition.
[cc65] / libsrc / apple2 / curdevice.s
1 ;
2 ; Oliver Schmidt, 2012-10-21
3 ;
4 ; unsigned char getcurrentdevice (void);
5 ;
6
7         .export         _getcurrentdevice
8         .import         __dos_type
9
10         .include        "mli.inc"
11
12 _getcurrentdevice:
13
14         ; Use unit number of most recent accessed device
15         lda     DEVNUM
16         lsr
17         lsr
18         lsr
19         lsr
20
21         ; Check for ProDOS 8
22         ldx     __dos_type
23         bne     :+
24         lda     #$FF            ; INVALID_DEVICE
25
26 :       ldx     #$00
27         rts