]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/dosdetect.s
Merge pull request #48 from efornara/time_fix
[cc65] / libsrc / atari / dosdetect.s
index a9014fe93ab541c0612a954a1495fe9f65116524..c60ac479b4b80c5be61a5a81fc7e8eaef101af63 100644 (file)
@@ -1,49 +1,53 @@
 ;
-; Freddy Offenga & Christian Groessler, June 2004
+; Freddy Offenga, Stefan Haubenthal, Christian Groessler, March 2007
 ;
 ; detect the DOS version we're running on
 ;
 
-       .include        "atari.inc"
-       .constructor    detect,26
-       .export         __dos_type
+        .include        "atari.inc"
+        .constructor    detect,26
+        .export         __dos_type
 
+; ------------------------------------------------------------------------
 ; DOS type detection
 
-detect:        lda     #ATARIDOS
-       sta     __dos_type      ; set default
+.segment        "INIT"
 
-       lda     DOS
-       cmp     #'S'            ; SpartaDOS
-       beq     spdos
-       cmp     #'M'            ; MyDOS
-       beq     mydos
+detect: lda     DOS
+        cmp     #'S'            ; SpartaDOS
+        beq     spdos
+        cmp     #'M'            ; MyDOS
+        beq     mydos
+        cmp     #'X'            ; XDOS
+        beq     xdos
 
-       ldy     #COMTAB
-       lda     #$4C
-       cmp     (DOSVEC),y
-       bne     done
+        lda     #$4C            ; probably default
+        ldy     #COMTAB
+        cmp     (DOSVEC),y
+        bne     done
+        ldy     #ZCRNAME
+        cmp     (DOSVEC),y
+        bne     done
 
-       ldy     #ZCRNAME
-       cmp     (DOSVEC),y
-       bne     done
+        ldy     #6              ; OS/A+ has a jmp here
+        cmp     (DOSVEC),y
+        beq     done
+        lda     #OSADOS
+        .byte   $2C             ; BIT <abs>
 
-       ldy     #6              ; OS/A+ has a jmp here
-       cmp     (DOSVEC),y
-       beq     done
-       lda     #OSADOS
-       sta     __dos_type
-       rts
+spdos:  lda     #SPARTADOS
+        .byte   $2C             ; BIT <abs>
 
-spdos: lda     #SPARTADOS
-       sta     __dos_type
-done:  rts
+mydos:  lda     #MYDOS
+        .byte   $2C             ; BIT <abs>
 
-mydos: lda     #MYDOS
-       sta     __dos_type
-       rts
+xdos:   lda     #XDOS
+        sta     __dos_type
+done:   rts
 
-       .bss
+; ------------------------------------------------------------------------
+; Data
 
-__dos_type:    .res    1
+        .bss
 
+__dos_type:     .res    1       ; default to ATARIDOS