Dolphin, the GameCube and Wii emulator - Forums

Full Version: Wii RTC patch
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

gasuki2

For some reason the system menu, Today & Tomorrow Channel and games like Animal Crossing: City Folk use the Gamecube epoch (1.1.2000) and not the Wii epoch despite being Wii titles. Here is my shot at it, it's not really a fix, some way to tell which to use would be the real fix, if that is possible.

This patch adds a checkbox to the Wii config tab under Misc Settings for "Use Gamecube Epoch". I also fixed Timer::GetLocalTimeSinceJan1970() to account for DST when reported by the system since the original method doesn't seem to.

I tweaked the epoch constants as well. I could only test Wii epoch with Alarmii homebrew because I don't have the ability to compile WRTC from SVN right now, so that could be totally wrong(most likely) but I have yet to find anything else that uses the Wii epoch.

I've tested it with as many things as I have access to. Mostly this was for my own use to fix the time when loading things that rely on it. I thought I would share in case someone could use it. Let me know if there is any issue.
IMO a game-specific option would be more appropriate here, since that option won't really be used very often (uhm, I think so at least) and only for specific games.
(we don't want to clutter the config dialogs with uncommon options too much.. there are already too many of those)
How does the real hardware detect whether to use the GC epoch?

gasuki2

I think I've got it at last Wink Homebrew, system menu, Wii and GC titles reporting the correct time with no need for any options or settings.

From what I can tell most titles (system menu, animal crossing, etc.) are reading time base ticks which is based on the 1.1.2000 epoch. Homebrew and possibly other things(?) were reading the time from IPL-DEV which needs the Wii bias subtracted.

This patch includes the aforementioned fix to calculate DST correctly, the tweak to the epoch constants (my last post) and the fix above.

Perhaps it would be more clear to those working on the code to create a function like:

CEXIIPL::GetWiiTime()

which would be called when m_RTC is filled but instead I just subtracted the Wii bias from CEXIIPL::GetGCTime() for simplicity.
Looks good. E-mail hrydgard from the googlecode project homepage for SVN access.
Pages: 1 2