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:
memberTwo.mb2
2008-12-13 11:57:01 +00:00
parent d1712f15ca
commit 82cd659638
5 changed files with 31 additions and 4 deletions

View File

@ -96,4 +96,17 @@ u64 Timer::GetTimeSinceJan1970(void)
time(&ltime);
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