From bee54df02967b774c485b0a7fa703b5a76345d4e Mon Sep 17 00:00:00 2001
From: "ol.sc"
Date: Wed, 5 Jan 2011 16:09:08 +0000
Subject: [PATCH] Allow to set the ProDOS type and auxtype on creating new
files in a similiar way done on the CBMs.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4902 b7a2c559-68d2-44c3-8de9-860c34a00d81
---
include/apple2.h | 14 ++++++++++++++
libsrc/apple2/open.s | 5 ++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/include/apple2.h b/include/apple2.h
index eefd1a033..6f45a60d6 100644
--- a/include/apple2.h
+++ b/include/apple2.h
@@ -131,6 +131,20 @@ extern unsigned char _dos_type;
+/*****************************************************************************/
+/* Variables */
+/*****************************************************************************/
+
+
+
+/* The file stream implementation and the POSIX I/O functions will use the
+ * following variables to determine the file type and the aux type to use.
+ */
+extern unsigned char _filetype; /* Default 6 */
+extern unsigned int _auxtype; /* Default 0 */
+
+
+
/*****************************************************************************/
/* Code */
/*****************************************************************************/
diff --git a/libsrc/apple2/open.s b/libsrc/apple2/open.s
index de0bb63fa..2e867a66f 100644
--- a/libsrc/apple2/open.s
+++ b/libsrc/apple2/open.s
@@ -8,6 +8,7 @@
; called before closeallfiles).
.export _open, closedirect, freebuffer
+ .export __filetype, __auxtype
.destructor closeallfiles, 17
.import pushname, popname
@@ -221,10 +222,12 @@ closedirect:
ldx #CLOSE_COUNT
jmp callmli
- .rodata
+ .data
CREATE: .byte %11000011 ; ACCESS: Standard full access
+__filetype:
.byte $06 ; FILE_TYPE: Standard binary file
+__auxtype:
.word $0000 ; AUX_TYPE: Load address N/A
.byte $01 ; STORAGE_TYPE: Standard seedling file
.word $0000 ; CREATE_DATE: Current date
--
2.39.5