2 ; Freddy Offenga & Christian Groessler, August 2003
4 ; function to get default device: char *getdefdev(void);
7 ; the ZCRNAME routine is only used to get the default drive because
8 ; ZCRNAME has two disadvantages:
9 ; 1. It will convert D: into D1: instead of Dn: (n = default drive)
10 ; 2. It will give a 'no arguments' status if it detects something
11 ; like Dn: (without filename).
14 ; ZCRNAME is slightly different from SpartaDOS. It will convert D:
15 ; into Dn: where n is the default drive.
19 .export _getdefdev ; get default device (e.g. "D1:")
21 ; Get default device (LBUF will be destroyed!!)
25 lda __dos_type ; which DOS?
31 sta (DOSVEC),y ; reset buffer offset
33 ; Store dummy argument
42 ; One extra store to avoid the buggy sequence from OS/A+ DOS:
43 ; <D><RETURN><:> => drive number = <RETURN>
48 ; Create crunch vector
57 crvec: jsr $FFFF ; will be set to crunch vector
61 ldy #COMFNAM ; COMFNAM is always "Dn:"
68 ; return ointer to default device