From 382f3b91f482616433b17583955b79a47a9d0f58 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 28 Nov 2013 00:30:04 -0800 Subject: [PATCH] Eat cycles and reschedule in some rtc funcs. Reported to fix #2146. --- Core/HLE/sceRtc.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Core/HLE/sceRtc.cpp b/Core/HLE/sceRtc.cpp index 1703248bb2..41b2db7dd0 100644 --- a/Core/HLE/sceRtc.cpp +++ b/Core/HLE/sceRtc.cpp @@ -226,19 +226,21 @@ u32 sceRtcGetTickResolution() u32 sceRtcGetCurrentTick(u32 tickPtr) { - //Don't spam the log - //DEBUG_LOG(SCERTC, "sceRtcGetCurrentTick(%08x)", tickPtr); + VERBOSE_LOG(SCERTC, "sceRtcGetCurrentTick(%08x)", tickPtr); u64 curTick = __RtcGetCurrentTick(); if (Memory::IsValidAddress(tickPtr)) Memory::Write_U64(curTick, tickPtr); hleEatCycles(300); + hleReSchedule("rtc current tick"); return 0; } -u64 sceRtcGetAcculumativeTime() +u64 sceRtcGetAccumulativeTime() { - DEBUG_LOG(SCERTC, "sceRtcGetAcculumativeTime()"); + DEBUG_LOG(SCERTC, "sceRtcGetAccumulativeTime()"); + hleEatCycles(300); + hleReSchedule("rtc accumulative time"); return __RtcGetCurrentTick(); } @@ -268,6 +270,7 @@ u32 sceRtcGetCurrentClock(u32 pspTimePtr, int tz) Memory::WriteStruct(pspTimePtr, &ret); hleEatCycles(1900); + hleReSchedule("rtc current clock"); return 0; } @@ -293,6 +296,7 @@ u32 sceRtcGetCurrentClockLocalTime(u32 pspTimePtr) Memory::WriteStruct(pspTimePtr, &ret); hleEatCycles(2000); + hleReSchedule("rtc current clock local"); return 0; } @@ -886,8 +890,8 @@ const HLEFunction sceRtc[] = { {0xC41C2853, &WrapU_V, "sceRtcGetTickResolution"}, {0x3f7ad767, &WrapU_U, "sceRtcGetCurrentTick"}, - {0x011F03C1, &WrapU64_V, "sceRtcGetAccumulativeTime"}, - {0x029CA3B3, &WrapU64_V, "sceRtcGetAccumlativeTime"}, + {0x011F03C1, &WrapU64_V, "sceRtcGetAccumulativeTime"}, + {0x029CA3B3, &WrapU64_V, "sceRtcGetAccumlativeTime"}, {0x4cfa57b0, &WrapU_UI, "sceRtcGetCurrentClock"}, {0xE7C27D1B, &WrapU_U, "sceRtcGetCurrentClockLocalTime"}, {0x34885E0D, &WrapI_UU, "sceRtcConvertUtcToLocalTime"},