;-------------------------------------------------------------------------
SPARTADOS = 0
-OSADOS = 1 ; OS/A+
-XDOS = 2
-REALDOS = 3
+REALDOS = 1
+OSADOS = 2 ; OS/A+
+XDOS = 3
ATARIDOS = 4
MYDOS = 5
NODOS = 255
; The DOSes with dos_type below or equal MAX_DOS_WITH_CMDLINE do support
; command line arguments.
-MAX_DOS_WITH_CMDLINE = REALDOS
+MAX_DOS_WITH_CMDLINE = XDOS
;-------------------------------------------------------------------------
; XDOS defines (version 2.4, taken from xdos24.pdf)
;
; function to get default device: char *_getdefdev(void);
;
-; SpartaDOS:
+; AtariDOS/MyDOS:
+; Default device number is derived from DUNIT. Therefore "default
+; device" is the one the program was loaded from.
+;
+; SpartaDOS/RealDOS:
; the ZCRNAME routine is only used to get the default drive because
; ZCRNAME has two disadvantages:
; 1. It will convert D: into D1: instead of Dn: (n = default drive)
cmp #XDOS
beq xdos ; only supported on XDOS ...
; cmp #OSADOS+1 ; (redundant: #OSADOS+1 = #XDOS)
- bcs finish ; ... and on OS/A+ and SpartaDOS
+ bcs use_DUNIT ; ... and on OS/A+ and SpartaDOS
ldy #BUFOFF
lda #0
ldx #>__defdev
rts
+; On AtariDOS or MyDOS, use the DUNIT variable to setuo the default
+; device. The default device will then be the one the program was
+; loaded from.
+
+use_DUNIT:
+ lda DUNIT
+ clc
+ adc #'0'
+ sta __defdev + 1
+ bne finish ; jump always
+
; XDOS default device retrieval
xdos: