]> git.sur5r.net Git - cc65/blob - libsrc/atari/dosdetect.s
The spans do now contain the size of a span, no longer the end offset.
[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        "INIT"
15
16 detect: lda     #ATARIDOS
17         sta     __dos_type      ; set default
18
19         lda     DOS
20         cmp     #'S'            ; SpartaDOS
21         beq     spdos
22         cmp     #'M'            ; MyDOS
23         beq     mydos
24
25         ldy     #COMTAB
26         lda     #$4C
27         cmp     (DOSVEC),y
28         bne     done
29
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         sta     __dos_type
45 done:   rts
46
47 ; ------------------------------------------------------------------------
48 ; Data
49
50         .bss
51
52 __dos_type:     .res    1
53