]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/dosdetect.s
Added SER_ prefix. Whitespace cleanup
[cc65] / libsrc / atari / dosdetect.s
index 654da55b58b7dd0fc06eb2aadc7097174d243ab5..1dd6a87f5a13cd82bcf8b4fc591d3ac7117f4c65 100644 (file)
@@ -11,7 +11,7 @@
 ; ------------------------------------------------------------------------
 ; DOS type detection
 
-.segment        "INIT"
+.segment        "ONCE"
 
 detect: lda     DOS
         cmp     #'S'            ; SpartaDOS
@@ -20,6 +20,8 @@ detect: lda     DOS
         beq     mydos
         cmp     #'X'            ; XDOS
         beq     xdos
+        cmp     #'R'            ; RealDOS
+        beq     rdos
 
         lda     #$4C            ; probably default
         ldy     #COMTAB
@@ -33,21 +35,35 @@ detect: lda     DOS
         cmp     (DOSVEC),y
         beq     done
         lda     #OSADOS
+        bne     set
+
+spdos:  lda     DOS+3           ; 'B' in BW-DOS
+        cmp     #'B'
+        bne     spdos_real
+        lda     DOS+4           ; 'W' in BW-DOS
+        cmp     #'W'
+        bne     spdos_real
+
+        lda     #BWDOS
         .byte   $2C             ; BIT <abs>
 
-spdos:  lda     #SPARTADOS
+spdos_real:
+        lda     #SPARTADOS
         .byte   $2C             ; BIT <abs>
 
 mydos:  lda     #MYDOS
         .byte   $2C             ; BIT <abs>
 
+rdos:   lda     #REALDOS
+        .byte   $2C             ; BIT <abs>
+
 xdos:   lda     #XDOS
-        sta     __dos_type
+set:    sta     __dos_type
 done:   rts
 
 ; ------------------------------------------------------------------------
 ; Data
 
-        .bss
+        .data
 
-__dos_type:     .res    1       ; default to ATARIDOS
+__dos_type:     .byte   ATARIDOS; default to ATARIDOS