Sheldon Simms wrote: > Im Artikel <250220021717533216Mon, 25 Feb 2002 23:17:53 > +0100oug@palantir.ca> schrieb "Self Violator" : > > > PRODOS DATE PROBLEMS > > > > SYSTEM CONFIGURATION > > Macintosh LC II with Apple IIe Card (Version 2.1 Copyright 77-92) > > and ImageWriter II printer, ProDOS Version 1.9, 16-Jul-90 > > > > THE PROBLEM > > Currently when I save a file in the IIe partition of the computer, the > > date is set at 91. > > Prodos itself is the problem. It can only recognize a short > range of dates. Not exactly. It is the Thunderclock driver in ProDOS which only recognises a small range of dates. This is because the Thunderclock card doesn't have a year register, so the year must be calculated given the day of week, day of month and month. This calculation only works over a five or six year period, depending on when leap years occur in relation to the reference dates, so the table must be patched every few years to identify a new range of years. If you are using ProDOS-8 on an Apple IIgs, or in an Apple II/II+/IIe with a different clock card (which has a year register and an appropriate driver patched into ProDOS) then you don't need to update ProDOS every few years. Unfortunately the LC IIe emulation card emulates a Thunderclock, so it suffers from the "five/six year patch" problem. > Apple used to update this range when they released a new Prodos but of > course that won't help you now. > > You can patch Prodos yourself with a sector editor by searching > for the string of date bytes and changing them. Search for 5c 5d 5e > or something like that in Copy II+, quickly scan the surrounding > area to find the beginning and ending of the string (I think there's > 7 sequential bytes representing 7 years) and change all of the > bytes to "current" values. Since (obviously) I'm not describing > the problem exactly you may have to try a few times before you > get the right years in the right order in the list, or maybe > the bytes are in descending order, etc. I haven't done this in > a while so I don't remember all of the details, unfortunately. There is a much easier method: Apple released an Applesoft BASIC program which patches the date table for you. If I remember right, the last version of it supported ProDOS-8 1.9, 2.0.1 and 2.0.3. It was included on the official ProDOS-8 system disk which Apple were distributing under the name "Apple II System Disk". The disk included Apple II Utilities. Patching it by hand is tricky. You need to update the year table, representing leap years correctly, and probably need to patch another entry which identifies the day of week which corresponds with the first entry in the year table. I'd need to see a disassembly of it to work out the details. One important point: if you are patching the table by hand for years after 1999, you must use the correct format for years 2000 and later: reset the year value back to zero, rather than continuing with 100, 101, etc. In hex, the sequence goes as follows: 56 1986 57 1987 58 1988 59 1989 5A 1990 5B 1991 5C 1992 5D 1993 5E 1994 5F 1995 60 1996 61 1997 62 1998 63 1999 00 2000 01 2001 02 2002 etc. You also need to deal with leap years correctly. The table will be seven bytes long, and contains repeated values corresponding to leap years. -- David Empson dempson@actrix.gen.nz Sheldon Simms wrote: > Im Artikel <1f88qjn.k9wka3e29tobNTue, 26 Feb 2002 15:57:39 > +0100empson@actrix.gen.nz> schrieb "David Empson" : > > > Sheldon Simms wrote: > > > >> Im Artikel <250220021717533216Mon, 25 Feb 2002 23:17:53 > >> +0100oug@palantir.ca> schrieb "Self Violator" : > >> > >> > PRODOS DATE PROBLEMS > >> > > >> > SYSTEM CONFIGURATION > >> > Macintosh LC II with Apple IIe Card (Version 2.1 Copyright 77-92) > >> > and ImageWriter II printer, ProDOS Version 1.9, 16-Jul-90 > >> > > >> > THE PROBLEM > >> > Currently when I save a file in the IIe partition of the computer, > >> > the date is set at 91. > >> > >> Prodos itself is the problem. It can only recognize a short range of > >> dates. > > > > Not exactly. It is the Thunderclock driver in ProDOS which only > > recognises a small range of dates. > > True. But this is, of course, the only driver in standard ProDOS. The IIgs driver is in the PRODOS file as well - the kernel loader works out whether it is running on a IIgs, and if so it copies the IIgs clock driver into the kernel instead of the Thunderclock driver. It is certainly true that the Thunderclock driver is the only clock driver for 8-bit machines which is included in a standard copy of ProDOS. :-) It is also worth emphasising that the problem only affects the "get current time" mechanism. Timestamps stored with files support years in the range 1940 to 2039, and patching the Thunderclock driver won't affect the timestamps for existing files. -- David Empson dempson@actrix.gen.nz