mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Add Configurable RTC
This commit is contained in:
@ -83,6 +83,9 @@ static int s_audio_dma_period;
|
||||
// we can just increase this number.
|
||||
static int s_ipc_hle_period;
|
||||
|
||||
// Custom RTC
|
||||
static u64 s_localtime_on_boot;
|
||||
|
||||
u32 GetTicksPerSecond()
|
||||
{
|
||||
return s_cpu_core_clock;
|
||||
@ -157,6 +160,11 @@ u64 GetFakeTimeBase()
|
||||
((CoreTiming::GetTicks() - CoreTiming::GetFakeTBStartTicks()) / TIMER_RATIO);
|
||||
}
|
||||
|
||||
u64 GetLocalTimeOnBoot()
|
||||
{
|
||||
return s_localtime_on_boot;
|
||||
}
|
||||
|
||||
static void PatchEngineCallback(u64 userdata, s64 cyclesLate)
|
||||
{
|
||||
// Patch mem and run the Action Replay
|
||||
@ -220,6 +228,7 @@ void Init()
|
||||
|
||||
Common::Timer::IncreaseResolution();
|
||||
// store and convert localtime at boot to timebase ticks
|
||||
s_localtime_on_boot = Common::Timer::GetLocalTimeSinceJan1970();
|
||||
CoreTiming::SetFakeTBStartValue((u64)(s_cpu_core_clock / TIMER_RATIO) *
|
||||
(u64)CEXIIPL::GetGCTime());
|
||||
CoreTiming::SetFakeTBStartTicks(CoreTiming::GetTicks());
|
||||
@ -249,6 +258,7 @@ void Init()
|
||||
void Shutdown()
|
||||
{
|
||||
Common::Timer::RestoreResolution();
|
||||
s_localtime_on_boot = 0;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user