From 9523fa2d33f08cc380f28e7499b7d5200ceaa37f Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 31 May 2016 07:37:58 +0200 Subject: [PATCH] Atari: get current drive on XDOS --- asminc/atari.inc | 1 + libsrc/atari/getdefdev.s | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/asminc/atari.inc b/asminc/atari.inc index b8f883cd8..f7a7ab223 100644 --- a/asminc/atari.inc +++ b/asminc/atari.inc @@ -1021,6 +1021,7 @@ XGLIN = $0871 ; get line XSKIP = $0874 ; skip parameter XMOVE = $0877 ; move filename XGNUM = $087A ; get number +XDEFDEV = $0816 ; current drive * undocumented * ;------------------------------------------------------------------------- ; End of atari.inc diff --git a/libsrc/atari/getdefdev.s b/libsrc/atari/getdefdev.s index 280c042e5..56ad8ff65 100644 --- a/libsrc/atari/getdefdev.s +++ b/libsrc/atari/getdefdev.s @@ -27,9 +27,10 @@ __getdefdev: lda __dos_type ; which DOS? - cmp #OSADOS+1 - bcs finish ; only supported on OS/A+ and SpartaDOS - ; (TODO: add XDOS support) + cmp #XDOS + beq xdos ; only supported on XDOS ... +; cmp #OSADOS+1 ; (redundant: #OSADOS+1 = #XDOS) + bcs finish ; ... and on OS/A+ and SpartaDOS ldy #BUFOFF lda #0 @@ -68,7 +69,7 @@ crvec: jsr $FFFF ; will be set to crunch vector sta __defdev iny lda (DOSVEC),y - sta __defdev+1 +done: sta __defdev+1 ; Return pointer to default device @@ -76,6 +77,11 @@ finish: lda #<__defdev ldx #>__defdev rts +; XDOS version + +xdos: lda XDEFDEV + bne done + .data ; Default device