diff --git a/cfg/geos-apple.cfg b/cfg/geos-apple.cfg index 1900c4866..746e1f2bf 100644 --- a/cfg/geos-apple.cfg +++ b/cfg/geos-apple.cfg @@ -32,7 +32,7 @@ MEMORY { } SEGMENTS { ZEROPAGE: type = zp, load = ZP; - EXTZP: type = zp, load = ZP; + EXTZP: type = zp, load = ZP, optional = yes; EXTBSS: type = bss, load = EXT, define = yes, optional = yes; FILEINFO: type = ro, load = CVT, offset = $002; RECORDS: type = ro, load = CVT, offset = $100, optional = yes; diff --git a/cfg/geos-cbm.cfg b/cfg/geos-cbm.cfg index f2aea55a2..ddef00a99 100644 --- a/cfg/geos-cbm.cfg +++ b/cfg/geos-cbm.cfg @@ -31,7 +31,7 @@ MEMORY { } SEGMENTS { ZEROPAGE: type = zp, load = ZP; - EXTZP: type = zp, load = ZP; + EXTZP: type = zp, load = ZP, optional = yes; DIRENTRY: type = ro, load = CVT, align = $FE; FILEINFO: type = ro, load = CVT, align = $FE; RECORDS: type = ro, load = CVT, align = $FE, optional = yes; diff --git a/include/apple2.h b/include/apple2.h index 190248b0d..310e697b1 100644 --- a/include/apple2.h +++ b/include/apple2.h @@ -136,10 +136,22 @@ extern unsigned char _dos_type; /* 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. + * following variables to determine the file type, aux type and creation time + * stamp to use. */ -extern unsigned char _filetype; /* Default 6 */ -extern unsigned int _auxtype; /* Default 0 */ +extern unsigned char _filetype; /* Default: 6 */ +extern unsigned int _auxtype; /* Default: 0 */ +extern struct { + struct { + unsigned day :5; + unsigned mon :4; + unsigned year :7; + } createdate; /* Current date: 0 */ + struct { + unsigned char min; + unsigned char hour; + } createtime; /* Current time: 0 */ +} _datetime; /* The addresses of the static drivers */ #if !defined(__APPLE2ENH__) diff --git a/libsrc/apple2/open.s b/libsrc/apple2/open.s index db40c3c74..b1686df70 100644 --- a/libsrc/apple2/open.s +++ b/libsrc/apple2/open.s @@ -5,7 +5,7 @@ ; .export _open, closedirect, freebuffer - .export __filetype, __auxtype + .export __filetype, __auxtype, __datetime .constructor raisefilelevel .destructor closeallfiles, 5 @@ -246,5 +246,6 @@ __filetype: __auxtype: .word $0000 ; AUX_TYPE: Load address N/A .byte $01 ; STORAGE_TYPE: Standard seedling file +__datetime: .word $0000 ; CREATE_DATE: Current date .word $0000 ; CREATE_TIME: Current time