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
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "atari.inc"
|
2015-10-09 20:18:51 +00:00
|
|
|
.constructor detect, 26
|
2013-05-09 11:56:54 +00:00
|
|
|
.export __dos_type
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2005-02-26 09:38:46 +00:00
|
|
|
; ------------------------------------------------------------------------
|
2003-08-12 19:56:55 +00:00
|
|
|
; DOS type detection
|
|
|
|
|
2016-03-06 20:26:22 +00:00
|
|
|
.segment "ONCE"
|
2005-02-26 09:38:46 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
detect: lda DOS
|
|
|
|
cmp #'S' ; SpartaDOS
|
|
|
|
beq spdos
|
|
|
|
cmp #'M' ; MyDOS
|
|
|
|
beq mydos
|
|
|
|
cmp #'X' ; XDOS
|
|
|
|
beq xdos
|
2018-09-05 23:10:47 +00:00
|
|
|
cmp #'R' ; RealDOS
|
|
|
|
beq rdos
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
lda #$4C ; probably default
|
|
|
|
ldy #COMTAB
|
|
|
|
cmp (DOSVEC),y
|
|
|
|
bne done
|
|
|
|
ldy #ZCRNAME
|
|
|
|
cmp (DOSVEC),y
|
|
|
|
bne done
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldy #6 ; OS/A+ has a jmp here
|
|
|
|
cmp (DOSVEC),y
|
|
|
|
beq done
|
|
|
|
lda #OSADOS
|
2018-09-27 15:37:59 +00:00
|
|
|
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
|
2013-05-09 11:56:54 +00:00
|
|
|
.byte $2C ; BIT <abs>
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2018-09-27 15:37:59 +00:00
|
|
|
spdos_real:
|
|
|
|
lda #SPARTADOS
|
2013-05-09 11:56:54 +00:00
|
|
|
.byte $2C ; BIT <abs>
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
mydos: lda #MYDOS
|
|
|
|
.byte $2C ; BIT <abs>
|
2012-02-11 08:35:54 +00:00
|
|
|
|
2018-09-05 23:10:47 +00:00
|
|
|
rdos: lda #REALDOS
|
|
|
|
.byte $2C ; BIT <abs>
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
xdos: lda #XDOS
|
2018-09-27 15:37:59 +00:00
|
|
|
set: sta __dos_type
|
2013-05-09 11:56:54 +00:00
|
|
|
done: rts
|
2004-03-16 22:47:50 +00:00
|
|
|
|
2005-02-26 09:38:46 +00:00
|
|
|
; ------------------------------------------------------------------------
|
|
|
|
; Data
|
|
|
|
|
2016-03-16 15:28:32 +00:00
|
|
|
.data
|
2003-08-12 19:56:55 +00:00
|
|
|
|
2016-05-24 00:57:21 +00:00
|
|
|
__dos_type: .byte ATARIDOS; default to ATARIDOS
|