From: ol.sc
Date: Wed, 2 Jun 2010 07:03:54 +0000 (+0000)
Subject: Align rootdir() return value rather with POSIX functions than with DIO functions.
X-Git-Tag: V2.13.3~750
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=710f59b6548bf90bbaafda7fabcbee486afafee2;p=cc65
Align rootdir() return value rather with POSIX functions than with DIO functions.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4680 b7a2c559-68d2-44c3-8de9-860c34a00d81
---
diff --git a/include/apple2.h b/include/apple2.h
index d856c2840..eefd1a033 100644
--- a/include/apple2.h
+++ b/include/apple2.h
@@ -149,9 +149,9 @@ unsigned char get_ostype (void);
void rebootafterexit (void);
/* Reboot machine after program termination has completed. */
-unsigned char __fastcall__ rootdir (unsigned char drive, char* buf);
-/* Fill buffer with root directory name of ProDOS 8 disk in ProDOS 8 drive.
- * Returns 0 for success and an OS specific error code in case of failure.
+int __fastcall__ rootdir (unsigned char drive, char* buf);
+/* Fill buffer with root directory name of ProDOS 8 disk in
+ * ProDOS 8 drive. Returns 0 on success and -1 on error.
*/
#define ser_apple2_slot(num) ser_ioctl (0, (void*) (num))
diff --git a/libsrc/apple2/rootdir.s b/libsrc/apple2/rootdir.s
index baa4b445d..f3cf1f1ae 100644
--- a/libsrc/apple2/rootdir.s
+++ b/libsrc/apple2/rootdir.s
@@ -1,11 +1,11 @@
;
; Oliver Schmidt, 2010-05-24
;
-; unsigned char __fastcall__ rootdir (unsigned char drive, char* buf);
+; int __fastcall__ rootdir (unsigned char drive, char* buf);
;
.export _rootdir
- .import popax
+ .import popax, oserrexit
.include "zeropage.inc"
.include "errno.inc"
@@ -50,7 +50,5 @@ _rootdir:
tax
rts
- ; Return error
-oserr: sta __oserror
- ldx #$00
- rts
+ ; Return oserror
+oserr: jmp oserrexit