1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-26 08:32:00 +00:00

rename defdev to __defdev and export it; add support for

DEFAULT_DEVICE and DYNAMIC_DD


git-svn-id: svn://svn.cc65.org/cc65/trunk@3336 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cpg 2004-12-16 22:46:28 +00:00
parent ae70828938
commit 47054d90d3

View File

@ -1,5 +1,5 @@
; ;
; Freddy Offenga & Christian Groessler, June 2004 ; Freddy Offenga & Christian Groessler, December 2004
; ;
; function to get default device: char *_getdefdev(void); ; function to get default device: char *_getdefdev(void);
; ;
@ -17,11 +17,18 @@
.include "atari.inc" .include "atari.inc"
.import __dos_type .import __dos_type
.export __getdefdev ; get default device (e.g. "D1:") .export __getdefdev ; get default device (e.g. "D1:")
.ifdef DYNAMIC_DD
.export __defdev
.endif
; Get default device (LBUF will be destroyed!!) ; Get default device (LBUF will be destroyed!!)
__getdefdev: __getdefdev:
.ifdef DEFAULT_DEVICE
lda #'0'+DEFAULT_DEVICE
sta __defdev+1
.endif
lda __dos_type ; which DOS? lda __dos_type ; which DOS?
cmp #ATARIDOS cmp #ATARIDOS
beq finish beq finish
@ -62,21 +69,21 @@ crvec: jsr $FFFF ; will be set to crunch vector
ldy #COMFNAM ; COMFNAM is always "Dn:" ldy #COMFNAM ; COMFNAM is always "Dn:"
lda (DOSVEC),y lda (DOSVEC),y
sta defdev sta __defdev
iny iny
lda (DOSVEC),y lda (DOSVEC),y
sta defdev+1 sta __defdev+1
; Return pointer to default device ; Return pointer to default device
finish: lda #<defdev finish: lda #<__defdev
ldx #>defdev ldx #>__defdev
rts rts
.data .data
; Default device ; Default device
defdev: __defdev:
.byte "D1:", 0 .byte "D1:", 0