-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Y2K(20) issue #111
Comments
Thanks! I had seen this on Stardot, but posting here is a helpful reminder to look at it. I'm wondering whether the CMOSRAM[9] = BCD(static_cast<unsigned char>(CurTime->tm_year - (RTCY2KAdjust ? 20 : 0)));
As the MOS only looks for the last two digits of the year (info here), it seems we could just use the year modulo 100 and remove the |
Before this change, the year is stored as the last two digits, in BCD format. For years after 2000 (or 2020 with the "Master 128 RTC Y2K Adjust" option enabled), the value would be greater than 100, which overflows two digits. This change stores the year modulo-100. Note that the Master MOS still displays years as 19xx, but will accept any century when setting the time using TIME$. This change also removes the Master 128 RTC Y2K Adjust menu option, which is no longer needed. See #111
My suggestion for dealing with the "configuring RTC to return suitable years for specific things" issue would be to simply store and reload the offset from SysTime as part of the preferences (defaulting to zero offset so a new profile gets the current system time). That way the realtime clock still behaves in a predictable way but can be set to whatever date and time a user wants and persists when the emulated beeb is "off" just as a real machine. |
Originally posted on Stardot but for some reason I never opened a bug here 🤦♂️
The text was updated successfully, but these errors were encountered: