Fujiyama wrote:Does the need for the Y2K fix or not apply for all sorts of clocks in a plain ST/STe (internal clock boards, RTC modules attached to the MonSTer, clock cartridges etc.)?
The Y2K-fix applies to all ST's that does not
have the Mega/MegaSTE/Stacy RTC. However, if you use a third party RTC and some autofolder utility to update GEMDOS time from this, TOS 1 usually does not need to be patched (depending on how the RTC software works). In this case only TOS 2.x is affected on these machines.
Fujiyama wrote:I guess I'm wondering how the computer knows if it should use the keyboard processor or whatever else the Mega STe/STacy/Mega ST uses?
TOS from 1.02 and upwards will attempt to access the Mega/MegaSTE/Stacy RTC when booting. If the RTC responds, TOS will read the RTC and update the GEMDOS internal clock (a pure software clock running off the 200Hz timer interrupt) with the RTC time/date. From then on GEMDOS will only refer to this software clock, not the RTC.
If the RTC does not
respond TOS reads the time/date from the keyboard processor and sets the GEMDOS time to this. A warm reset does not reset the keyboard clock so you don't have to set the time/date after a warm reset.
The original Atari RTC (or keyboard clock if no RTC is present) is only accessed by TOS in these cases:
1. When booting the GEMDOS clock is updated with RTC time/date.
2. When the XBIOS Settime/Setdate functions are called. These are the interface to the RTC hardware, used to change RTC time/date.
3. In TOS 2 the RTC will be updated also when the GEMDOS time/date is changed using the GEMDOS Tsettime/Tsetdate calls. TOS then reads back the time from the RTC and updates it's internal GEMDOS clock according to this. This does not happen in TOS 1.
(3) is important, and the reason why TOS 2 needs to be patched when using an aftermarket RTC. The RTC software reads time/date from this custom RTC, and sets GEMDOS time accordingly using Tsettime/Tsetdate. Because there is no stock RTC, TOS falls back to the keyboard clock and when reading back the year the year is wrong. On a Mega/MegaSTE this is not a problem, because the keyboard clock is never used by TOS in this case.
So why is the keyboard clock year wrong? Because GEMDOS year 0 is actually 1980, while keyboard clock year is the last two digits of the actual year. So GEMDOS year 10 is displayed as 1990, and inside the keyboard clock it's stored as 90. This means that when TOS updates the keyboard clock, it actually writes GEMDOS year + 80, and when reading keyboard clock it reads keyboard year - 80.
Now, this is no problem when year is between 1980 and 1999. But try to do this math with a year after 2000, and you'll see that this does not add up
It is not a problem with the original RTC, because RTC year 0 is also 1980 so no conversion is needed between RTC and GEMDOS time.
So to sum up this rather confusing post - when using a MonSTer RTC and the M_RTC.PRG utility the Y2K fix is only needed on machines with TOS 2 and no original Atari RTC. I don't know if MagiC is affected. EmuTOS is not.