2 ; Freddy Offenga & Christian Groessler, December 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
20 .export __defdev ; this is the default device string (e.g. "D1:")
22 .constructor __getdefdev,24
25 ; Get default device (LBUF will be destroyed!!)
29 lda __dos_type ; which DOS?
37 sta (DOSVEC),y ; reset buffer offset
39 ; Store dummy argument
48 ; One extra store to avoid the buggy sequence from OS/A+ DOS:
49 ; <D><RETURN><:> => drive number = <RETURN>
54 ; Create crunch vector
63 crvec: jsr $FFFF ; will be set to crunch vector
67 ldy #COMFNAM ; COMFNAM is always "Dn:"
74 ; Return pointer to default device
76 finish: lda #<__defdev
86 .byte 'D', '0'+DEFAULT_DEVICE, ':', 0