]> git.sur5r.net Git - cc65/commitdiff
Replaced Apple II specific solution with implementation of recently introduced mass...
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 9 Sep 2012 13:38:32 +0000 (13:38 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 9 Sep 2012 13:38:32 +0000 (13:38 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5821 b7a2c559-68d2-44c3-8de9-860c34a00d81

doc/apple2.sgml
include/apple2.h
libsrc/apple2/Makefile
libsrc/apple2/drives.s [deleted file]
libsrc/apple2/getdevice.s [new file with mode: 0644]
libsrc/apple2enh/Makefile

index 9810b023c8cbb7d66af93e9b8a9a6f203ec1acf5..3d55f6f96c7321b5553b58a113c8063f0150135d 100644 (file)
@@ -294,8 +294,6 @@ usage.
 <item>_auxtype
 <item>_dos_type
 <item>_filetype
-<item>drivecount
-<item>drivelist
 <item>get_ostype
 <item>rebootafterexit
 <item>rootdir
index 84f4fea35f55e4d730dc922e54f1b48779344e0f..b7826a764381f1fe3ef9241fb633f978855b439f 100644 (file)
@@ -149,12 +149,6 @@ extern unsigned int  _auxtype;   /* Default 0 */
 
 
 
-unsigned char drivecount (void);
-/* Returns the number of ProDOS 8 drives. */
-
-unsigned char* drivelist (void);
-/* Returns a pointer to the list of ProDOS 8 drives. */
-
 unsigned char get_ostype (void);
 /* Get the machine type. Returns one of the APPLE_xxx codes. */
 
index 9b0a4938e5f575a71d9a451645f48237f1359706..a8e92f467c8b7604e88f6bdd96c5a79d0ffdc3d3 100644 (file)
@@ -70,12 +70,12 @@ S_OBJS=     _scrsize.o      \
        diosectsize.o   \
        diowrite.o      \
        dosdetect.o     \
-       drives.o        \
        exec.o          \
        exehdr.o        \
        filedes.o       \
        filename.o      \
         get_ostype.o    \
+       getdevice.o     \
        gotoxy.o        \
        gotoy.o         \
         home.o          \
diff --git a/libsrc/apple2/drives.s b/libsrc/apple2/drives.s
deleted file mode 100644 (file)
index b54dfbe..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-;
-; Oliver Schmidt, 2010-05-24
-;
-; unsigned char drivecount (void);
-; unsigned char* drivelist (void);
-;
-
-        .export         _drivecount, _drivelist
-        .import         __dos_type
-
-        .include        "mli.inc"
-
-_drivecount:
-        ldx     #$00
-
-        ; Check for ProDOS 8
-        lda     __dos_type
-        beq     :+
-
-        ; Number of on-line devices (minus 1)
-        ldy     DEVCNT
-        iny
-        tya
-:       rts
-
-_drivelist:
-        ldx     #$00
-
-        ; Check for ProDOS 8
-        lda     __dos_type
-        beq     :+
-
-        ; Up to 14 units may be active
-        lda     #<DEVLST
-        ldx     #>DEVLST
-:       rts
diff --git a/libsrc/apple2/getdevice.s b/libsrc/apple2/getdevice.s
new file mode 100644 (file)
index 0000000..bc28969
--- /dev/null
@@ -0,0 +1,48 @@
+;
+; Oliver Schmidt, 2012-09-04
+;
+; unsigned char getfirstdevice (void);
+; unsigned char __fastcall__ getnextdevice (unsigned char device);
+;
+
+        .export         _getfirstdevice
+        .export         _getnextdevice
+
+        .import         __dos_type
+
+        .include        "zeropage.inc"
+        .include        "mli.inc"
+
+_getfirstdevice:
+        lda     #$FF
+        ; Fall through
+
+_getnextdevice:
+next:   tax
+        inx
+        txa
+        cmp     #$FF
+        beq     done
+
+        ; Check for ProDOS 8
+        ldx     __dos_type
+        beq     next
+
+        ; Up to 14 units may be active
+        ldx     #<DEVLST
+        ldy     #>DEVLST
+        stx     ptr1
+        sty     ptr1+1
+
+        ; Number of on-line devices (minus 1)
+        ldy     DEVCNT
+
+       ; Does the list contain the device?
+:       cmp     (ptr1),y
+        beq    done
+        dey
+        bpl     :-
+        bmi     next            ; Branch always
+
+done:   ldx     #$00
+        rts
index 4d984901ffe6856b48d6ee1ba2ba1aaee392f8c7..7b0cb08b954a788602db5fb57c0668e89d1017f4 100644 (file)
@@ -73,12 +73,12 @@ S_OBJS=     _scrsize.o      \
        diosectsize.o   \
        diowrite.o      \
        dosdetect.o     \
-       drives.o        \
        exec.o          \
        exehdr.o        \
        filedes.o       \
        filename.o      \
         get_ostype.o    \
+       getdevice.o     \
        gotoxy.o        \
        gotoy.o         \
         home.o          \