2003-08-12 19:56:55 +00:00
|
|
|
;
|
2007-03-28 19:34:48 +00:00
|
|
|
; Freddy Offenga, Stefan Haubenthal, Christian Groessler, March 2007
|
2003-08-12 19:56:55 +00:00
|
|
|
;
|
|
|
|
; detect the DOS version we're running on
|
|
|
|
;
|
|
|
|
|
|
|
|
.include "atari.inc"
|
|
|
|
.constructor detect,26
|
|
|
|
.export __dos_type
|
|
|
|
|
2005-02-26 09:38:46 +00:00
|
|
|
; ------------------------------------------------------------------------
|
2003-08-12 19:56:55 +00:00
|
|
|
; DOS type detection
|
|
|
|
|
2012-02-11 08:35:54 +00:00
|
|
|
.segment "INIT"
|
2005-02-26 09:38:46 +00:00
|
|
|
|
2012-02-11 08:35:54 +00:00
|
|
|
detect: lda DOS
|
2004-03-16 22:47:50 +00:00
|
|
|
cmp #'S' ; SpartaDOS
|
2003-08-12 19:56:55 +00:00
|
|
|
beq spdos
|
2004-03-16 22:47:50 +00:00
|
|
|
cmp #'M' ; MyDOS
|
|
|
|
beq mydos
|
2012-02-11 08:35:54 +00:00
|
|
|
cmp #'X' ; XDOS
|
|
|
|
beq xdos
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2012-02-11 08:35:54 +00:00
|
|
|
lda #$4C ; probably default
|
2003-08-12 19:56:55 +00:00
|
|
|
ldy #COMTAB
|
|
|
|
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
|
2007-03-28 19:34:48 +00:00
|
|
|
.byte $2C ; BIT <abs>
|
2003-08-12 19:56:55 +00:00
|
|
|
|
|
|
|
spdos: lda #SPARTADOS
|
2007-03-28 19:34:48 +00:00
|
|
|
.byte $2C ; BIT <abs>
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2004-03-16 22:47:50 +00:00
|
|
|
mydos: lda #MYDOS
|
2012-02-11 08:35:54 +00:00
|
|
|
.byte $2C ; BIT <abs>
|
|
|
|
|
|
|
|
xdos: lda #XDOS
|
2004-03-16 22:47:50 +00:00
|
|
|
sta __dos_type
|
2007-03-28 19:34:48 +00:00
|
|
|
done: rts
|
2004-03-16 22:47:50 +00:00
|
|
|
|
2005-02-26 09:38:46 +00:00
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
; Data
|
|
|
|
|
2012-02-11 08:35:54 +00:00
|
|
|
.bss
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2012-02-11 08:35:54 +00:00
|
|
|
__dos_type: .res 1 ; default to ATARIDOS
|