2 ; Freddy Offenga & Christian Groessler, June 2004
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?
33 sta (DOSVEC),y ; reset buffer offset
35 ; Store dummy argument
44 ; One extra store to avoid the buggy sequence from OS/A+ DOS:
45 ; <D><RETURN><:> => drive number = <RETURN>
50 ; Create crunch vector
59 crvec: jsr $FFFF ; will be set to crunch vector
63 ldy #COMFNAM ; COMFNAM is always "Dn:"
70 ; return ointer to default device