summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorXTra.KrazzY <XTra.KrazzY@gmail.com>2009-02-08 19:17:51 +0000
committerXTra.KrazzY <XTra.KrazzY@gmail.com>2009-02-08 19:17:51 +0000
commitc8526c7be1c480496e1a95cbe3ea462d47bd314f (patch)
tree2fb0c334409ef462f0c13e66474190cc261bd37f /Source/Core
parentc3dbbb1f238e46562971bfc4ef28c1defa9aaeaf (diff)
1. Fixed RTC in both Wii and GC (added Wii epoch bias, notify me if it isn't good for your PC and I'll revert it).
2. Added some Zelda UCode HLE Documentation and changed the way it handles mail, also fixed a bug there. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2155 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp8
-rw-r--r--Source/Core/Core/Src/HW/SystemTimers.cpp2
2 files changed, 7 insertions, 3 deletions
diff --git a/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp b/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp
index 3dc9e20fce..01f92d97b9 100644
--- a/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp
+++ b/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp
@@ -278,7 +278,8 @@ void CEXIIPL::TransferByte(u8& _uByte)
u32 CEXIIPL::GetGCTime()
{
- const u32 cJanuary2000 = 0x386D4380; // Seconds between 1.1.1970 and 1.1.2000
+ const u32 cJanuary2000 = 0x386D42C0; // Seconds between 1.1.1970 and 1.1.2000
+ const u32 cWiiBias = 0x0F111566; // Seconds between 1.1.2000 and 5.1.2008 (Wii epoch)
// (mb2): I think we can get rid of the IPL bias.
// I know, it's another hack so I let the previous code for a while.
@@ -296,7 +297,10 @@ u32 CEXIIPL::GetGCTime()
return ((u32)ltime - cJanuary2000 - Bias);
#else
u64 ltime = Common::Timer::GetLocalTimeSinceJan1970();
- return ((u32)ltime - cJanuary2000);
+ if (Core::GetStartupParameter().bWii)
+ return ((u32)ltime - cJanuary2000 - cWiiBias);
+ else
+ return ((u32)ltime - cJanuary2000);
#endif
}
diff --git a/Source/Core/Core/Src/HW/SystemTimers.cpp b/Source/Core/Core/Src/HW/SystemTimers.cpp
index 117d1ac2b7..b95a0ad45d 100644
--- a/Source/Core/Core/Src/HW/SystemTimers.cpp
+++ b/Source/Core/Core/Src/HW/SystemTimers.cpp
@@ -231,7 +231,7 @@ void Init()
{
if (Core::GetStartupParameter().bWii)
{
- CPU_CORE_CLOCK = 721000000;
+ CPU_CORE_CLOCK = 721000000u;
VI_PERIOD = GetTicksPerSecond() / (60*120);
SI_PERIOD = GetTicksPerSecond() / 60; // once a frame is good for controllers