mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
Fix time in some games (AC and ZWW at least). Many games doesn't use RTC but TBRs. So a TB offset is initialized at boot with localtime now. There are, indeed, side effects since time is CPU cycle dependent in this case.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1519 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -96,4 +96,17 @@ u64 Timer::GetTimeSinceJan1970(void)
|
||||
time(<ime);
|
||||
return((u64)ltime);
|
||||
}
|
||||
|
||||
u64 Timer::GetLocalTimeSinceJan1970(void)
|
||||
{
|
||||
time_t sysTime, tzDiff;
|
||||
struct tm * gmTime;
|
||||
|
||||
time(&sysTime);
|
||||
// Lazy way to get local time in sec
|
||||
gmTime = gmtime(&sysTime);
|
||||
tzDiff = sysTime - mktime(gmTime);
|
||||
|
||||
return (u64)(sysTime + tzDiff);
|
||||
}
|
||||
} // end of namespace Common
|
||||
|
Reference in New Issue
Block a user