mirror of
https://github.com/cc65/cc65.git
synced 2024-06-06 01:29:31 +00:00
Atari: Make a good "default device" on AtariDOS (2.0 and 2.5) and MyDOS.
The default device will be the one the program was loaded from instead of always D1:.
This commit is contained in:
parent
08d164a811
commit
4691974466
|
@ -1003,15 +1003,15 @@ diopp_size = 5 ; size of structure
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
|
|
||||||
SPARTADOS = 0
|
SPARTADOS = 0
|
||||||
OSADOS = 1 ; OS/A+
|
REALDOS = 1
|
||||||
XDOS = 2
|
OSADOS = 2 ; OS/A+
|
||||||
REALDOS = 3
|
XDOS = 3
|
||||||
ATARIDOS = 4
|
ATARIDOS = 4
|
||||||
MYDOS = 5
|
MYDOS = 5
|
||||||
NODOS = 255
|
NODOS = 255
|
||||||
; The DOSes with dos_type below or equal MAX_DOS_WITH_CMDLINE do support
|
; The DOSes with dos_type below or equal MAX_DOS_WITH_CMDLINE do support
|
||||||
; command line arguments.
|
; command line arguments.
|
||||||
MAX_DOS_WITH_CMDLINE = REALDOS
|
MAX_DOS_WITH_CMDLINE = XDOS
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
; XDOS defines (version 2.4, taken from xdos24.pdf)
|
; XDOS defines (version 2.4, taken from xdos24.pdf)
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
;
|
;
|
||||||
; function to get default device: char *_getdefdev(void);
|
; 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
|
; the ZCRNAME routine is only used to get the default drive because
|
||||||
; ZCRNAME has two disadvantages:
|
; ZCRNAME has two disadvantages:
|
||||||
; 1. It will convert D: into D1: instead of Dn: (n = default drive)
|
; 1. It will convert D: into D1: instead of Dn: (n = default drive)
|
||||||
|
@ -30,7 +34,7 @@ __getdefdev:
|
||||||
cmp #XDOS
|
cmp #XDOS
|
||||||
beq xdos ; only supported on XDOS ...
|
beq xdos ; only supported on XDOS ...
|
||||||
; cmp #OSADOS+1 ; (redundant: #OSADOS+1 = #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
|
ldy #BUFOFF
|
||||||
lda #0
|
lda #0
|
||||||
|
@ -77,6 +81,17 @@ finish: lda #<__defdev
|
||||||
ldx #>__defdev
|
ldx #>__defdev
|
||||||
rts
|
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 default device retrieval
|
||||||
|
|
||||||
xdos:
|
xdos:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user