]> git.sur5r.net Git - cc65/blob - libsrc/atari/dosdetect.s
Atari: clock_gettime() and clock_settime() implementations
[cc65] / libsrc / atari / dosdetect.s
1 ;
2 ; Freddy Offenga, Stefan Haubenthal, Christian Groessler, March 2007
3 ;
4 ; detect the DOS version we're running on
5 ;
6
7         .include        "atari.inc"
8         .constructor    detect, 26
9         .export         __dos_type
10
11 ; ------------------------------------------------------------------------
12 ; DOS type detection
13
14 .segment        "ONCE"
15
16 detect: lda     DOS
17         cmp     #'S'            ; SpartaDOS
18         beq     spdos
19         cmp     #'M'            ; MyDOS
20         beq     mydos
21         cmp     #'X'            ; XDOS
22         beq     xdos
23         cmp     #'R'            ; RealDOS
24         beq     rdos
25
26         lda     #$4C            ; probably default
27         ldy     #COMTAB
28         cmp     (DOSVEC),y
29         bne     done
30         ldy     #ZCRNAME
31         cmp     (DOSVEC),y
32         bne     done
33
34         ldy     #6              ; OS/A+ has a jmp here
35         cmp     (DOSVEC),y
36         beq     done
37         lda     #OSADOS
38         .byte   $2C             ; BIT <abs>
39
40 spdos:  lda     #SPARTADOS
41         .byte   $2C             ; BIT <abs>
42
43 mydos:  lda     #MYDOS
44         .byte   $2C             ; BIT <abs>
45
46 rdos:   lda     #REALDOS
47         .byte   $2C             ; BIT <abs>
48
49 xdos:   lda     #XDOS
50         sta     __dos_type
51 done:   rts
52
53 ; ------------------------------------------------------------------------
54 ; Data
55
56         .data
57
58 __dos_type:     .byte   ATARIDOS; default to ATARIDOS