]> git.sur5r.net Git - cc65/commitdiff
Added functions to learn about the unit numbers of the ProDOS 8 devices found.
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 24 May 2010 20:10:19 +0000 (20:10 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 24 May 2010 20:10:19 +0000 (20:10 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4663 b7a2c559-68d2-44c3-8de9-860c34a00d81

include/apple2.h
libsrc/apple2/Makefile
libsrc/apple2/drives.s [new file with mode: 0644]
libsrc/apple2/mli.inc
libsrc/apple2enh/Makefile

index 15fb8bacaf486f5a82897de866dff7162a1ecf78..1fbf181e793d50df75ef62094f7f05b2f6cf7c4e 100644 (file)
@@ -143,6 +143,12 @@ unsigned char get_ostype (void);
 void rebootafterexit (void);
 /* Reboot machine after program termination has completed. */
 
+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. */
+
 #define ser_apple2_slot(num)    ser_ioctl (0, (void *) (num))
 /* Select a slot number from 1 to 7 prior to ser_open.
  * The default slot number is 2.
index a38de748270ec2912ca5ba42e368ce601dbe851a..8ecb7d5b7d2e6fe341c7ed70d181f5294621db24 100644 (file)
@@ -70,6 +70,7 @@ S_OBJS=       _scrsize.o      \
        diosectsize.o   \
        diowrite.o      \
        dosdetect.o     \
+       drives.o        \
        filedes.o       \
        fileerr.o       \
        filename.o      \
diff --git a/libsrc/apple2/drives.s b/libsrc/apple2/drives.s
new file mode 100644 (file)
index 0000000..abeafb5
--- /dev/null
@@ -0,0 +1,38 @@
+;
+; 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
+        bne     :+
+        rts
+
+        ; Number of on-line devices (minus 1)
+:       ldy     DEVCNT
+        iny
+        tya
+        rts
+
+_drivelist:
+        ldx     #$00
+
+        ; Check for ProDOS 8
+        lda     __dos_type
+        bne     :+
+        rts
+
+        ; Up to 14 units may be active
+:       lda     #<DEVLST
+        ldx     #>DEVLST
+        rts
index 2134c8785049814530a79e5ebb9e08ea32ed459f..26b40fdd7f55b6ca31091b80b66921e760cc7b77 100644 (file)
@@ -115,6 +115,8 @@ EOF_COUNT       = 2
         .global         callmli
 
 DEVNUM  :=      $BF30          ; Most recent accessed device
+DEVCNT  :=      $BF31          ; Number of on-line devices (minus 1)
+DEVLST  :=      $BF32          ; Up to 14 units may be active
 DATELO  :=      $BF90          ; Bits 15-9 = Year, 8-5 = Month, 4-0 = Day
 TIMELO  :=      $BF92          ; Bits 12-8 = Hour, 5-0 = Minute
 PFIXPTR :=      $BF9A          ; If = 0, no prefix active
index 91936240264ba9995f78c8933627a6f00c4dcb89..d2ed5112063ca0c80755a25b209cf6ced5e7dcf5 100644 (file)
@@ -73,6 +73,7 @@ S_OBJS=       _scrsize.o      \
        diosectsize.o   \
        diowrite.o      \
        dosdetect.o     \
+       drives.o        \
        filedes.o       \
        fileerr.o       \
        filename.o      \