From be7c24177c7eb0b3b86bc76b6f603368f6981ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Pati=C3=B1o?= Date: Sat, 3 Aug 2013 15:42:16 +0200 Subject: [PATCH 1/5] Promoted _auxtype to a struct to gain access to additional fields While creating files there was no possibility to explicitly set the time or date. This is necessary for example while copying files since the original time and date should be kept. --- include/apple2.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/apple2.h b/include/apple2.h index 190248b0d..396ddfde5 100644 --- a/include/apple2.h +++ b/include/apple2.h @@ -139,7 +139,12 @@ extern unsigned char _dos_type; * 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 */ +extern struct { + unsigned int aux; + unsigned char storage; + unsigned int date; + unsigned int time; +} _auxtype; /* Default 0 */ /* The addresses of the static drivers */ #if !defined(__APPLE2ENH__) From 9b157a5b1e7c2be37a6bb2a030290d89a556d7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Pati=C3=B1o?= Date: Sat, 3 Aug 2013 19:08:36 +0200 Subject: [PATCH 2/5] Defined a struct to contain the date and time data To keep backward compatibility auxtype and the date/time are kept separated. A struct similar to the one used in dirent.h is used to access the create_date and create_time fields. --- include/apple2.h | 16 +++++++++++----- libsrc/apple2/open.s | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/apple2.h b/include/apple2.h index 396ddfde5..89a01d857 100644 --- a/include/apple2.h +++ b/include/apple2.h @@ -139,12 +139,18 @@ extern unsigned char _dos_type; * 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 */ extern struct { - unsigned int aux; - unsigned char storage; - unsigned int date; - unsigned int time; -} _auxtype; /* Default 0 */ + struct { + unsigned day :5; + unsigned mon :4; + unsigned year :7; + } createdate; + struct { + unsigned char min; + unsigned char hour; + } createtime; +} _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 From 7d9bba213bf7f4dca221899c59571baa36293d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Pati=C3=B1o?= Date: Thu, 8 Aug 2013 18:23:48 +0200 Subject: [PATCH 3/5] Comments added --- include/apple2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/apple2.h b/include/apple2.h index 89a01d857..51475e234 100644 --- a/include/apple2.h +++ b/include/apple2.h @@ -138,18 +138,18 @@ 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. */ -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; + } createdate; /* Current date: 0 */ struct { unsigned char min; unsigned char hour; - } createtime; + } createtime; /* Current time: 0 */ } _datetime; /* The addresses of the static drivers */ From 5602cf742f9e9832ca139c5c1ab9a5fb2ae80a92 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Thu, 8 Aug 2013 18:46:21 +0200 Subject: [PATCH 4/5] Adjusted comment. --- include/apple2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/apple2.h b/include/apple2.h index 51475e234..310e697b1 100644 --- a/include/apple2.h +++ b/include/apple2.h @@ -136,7 +136,8 @@ 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 */ From 1dab0103f1ba9261b3e1dbf6eb5e294b65794df9 Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Tue, 20 Aug 2013 07:43:47 +0200 Subject: [PATCH 5/5] Made EXTZP segment optional on GEOS as it is used only by CONIO. --- cfg/geos-apple.cfg | 2 +- cfg/geos-cbm.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;