]> git.sur5r.net Git - cc65/commitdiff
Allow to set the ProDOS type and auxtype on creating new files in a similiar way...
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 5 Jan 2011 16:09:08 +0000 (16:09 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 5 Jan 2011 16:09:08 +0000 (16:09 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4902 b7a2c559-68d2-44c3-8de9-860c34a00d81

include/apple2.h
libsrc/apple2/open.s

index eefd1a0337e973ade2eca5e0a7f1b4bced017747..6f45a60d63a591b0cbafa5d0b99dd7fe48b1e46c 100644 (file)
@@ -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                                   */
 /*****************************************************************************/
index de0bb63fa5e58e00232fb980be96a1320788bf96..2e867a66fbe244cc183445c90664c4e69cf3209b 100644 (file)
@@ -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