1
0
mirror of https://github.com/cc65/cc65.git synced 2026-04-26 13:18:31 +00:00

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:
ol.sc
2012-10-21 14:35:17 +00:00
parent 74fb91a3a2
commit 89d4f4a90c
6 changed files with 51 additions and 0 deletions
+1
View File
@@ -61,6 +61,7 @@ S_OBJS= _scrsize.o \
cputc.o \
crt0.o \
ctype.o \
curdevice.o \
cvline.o \
devicedir.o \
dioclose.o \
+27
View 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