Introduced getcurrentdevice() and implemented it for CBM and Apple.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5863 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -55,6 +55,8 @@ unsigned char getfirstdevice (void);
|
|||||||
|
|
||||||
unsigned char __fastcall__ getnextdevice (unsigned char device);
|
unsigned char __fastcall__ getnextdevice (unsigned char device);
|
||||||
|
|
||||||
|
unsigned char getcurrentdevice (void);
|
||||||
|
|
||||||
char* __fastcall__ getdevicedir (unsigned char device, char* buf, size_t size);
|
char* __fastcall__ getdevicedir (unsigned char device, char* buf, size_t size);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ S_OBJS= _scrsize.o \
|
|||||||
cputc.o \
|
cputc.o \
|
||||||
crt0.o \
|
crt0.o \
|
||||||
ctype.o \
|
ctype.o \
|
||||||
|
curdevice.o \
|
||||||
cvline.o \
|
cvline.o \
|
||||||
devicedir.o \
|
devicedir.o \
|
||||||
dioclose.o \
|
dioclose.o \
|
||||||
|
|||||||
27
libsrc/apple2/curdevice.s
Normal file
27
libsrc/apple2/curdevice.s
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-10-21
|
||||||
|
;
|
||||||
|
; unsigned char getcurrentdevice (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _getcurrentdevice
|
||||||
|
.import __dos_type
|
||||||
|
|
||||||
|
.include "mli.inc"
|
||||||
|
|
||||||
|
_getcurrentdevice:
|
||||||
|
|
||||||
|
; Use unit number of most recent accessed device
|
||||||
|
lda DEVNUM
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
|
||||||
|
; Check for ProDOS 8
|
||||||
|
ldx __dos_type
|
||||||
|
bne :+
|
||||||
|
lda #$FF ; INVALID_DEVICE
|
||||||
|
|
||||||
|
: ldx #$00
|
||||||
|
rts
|
||||||
@@ -64,6 +64,7 @@ S_OBJS= _scrsize.o \
|
|||||||
cputc.o \
|
cputc.o \
|
||||||
crt0.o \
|
crt0.o \
|
||||||
ctype.o \
|
ctype.o \
|
||||||
|
curdevice.o \
|
||||||
cvline.o \
|
cvline.o \
|
||||||
devicedir.o \
|
devicedir.o \
|
||||||
dioclose.o \
|
dioclose.o \
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ S_OBJS = c_acptr.o \
|
|||||||
close.o \
|
close.o \
|
||||||
closedir.o \
|
closedir.o \
|
||||||
ctype.o \
|
ctype.o \
|
||||||
|
curdevice.o \
|
||||||
cvline.o \
|
cvline.o \
|
||||||
devicedir.o \
|
devicedir.o \
|
||||||
dir.o \
|
dir.o \
|
||||||
|
|||||||
19
libsrc/cbm/curdevice.s
Normal file
19
libsrc/cbm/curdevice.s
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-10-21
|
||||||
|
;
|
||||||
|
; unsigned char getcurrentdevice (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.export _getcurrentdevice
|
||||||
|
.import curunit
|
||||||
|
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
; _getcurrentdevice
|
||||||
|
|
||||||
|
.proc _getcurrentdevice
|
||||||
|
|
||||||
|
lda curunit
|
||||||
|
ldx #$00
|
||||||
|
rts
|
||||||
|
|
||||||
|
.endproc
|
||||||
Reference in New Issue
Block a user