Eat cycles and reschedule in some rtc funcs.

Reported to fix #2146.
This commit is contained in:
Unknown W. Brackets 2013-11-28 00:30:04 -08:00
parent 1c9f7f316e
commit 382f3b91f4

View file

@ -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>, "sceRtcGetTickResolution"},
{0x3f7ad767, &WrapU_U<sceRtcGetCurrentTick>, "sceRtcGetCurrentTick"},
{0x011F03C1, &WrapU64_V<sceRtcGetAcculumativeTime>, "sceRtcGetAccumulativeTime"},
{0x029CA3B3, &WrapU64_V<sceRtcGetAcculumativeTime>, "sceRtcGetAccumlativeTime"},
{0x011F03C1, &WrapU64_V<sceRtcGetAccumulativeTime>, "sceRtcGetAccumulativeTime"},
{0x029CA3B3, &WrapU64_V<sceRtcGetAccumulativeTime>, "sceRtcGetAccumlativeTime"},
{0x4cfa57b0, &WrapU_UI<sceRtcGetCurrentClock>, "sceRtcGetCurrentClock"},
{0xE7C27D1B, &WrapU_U<sceRtcGetCurrentClockLocalTime>, "sceRtcGetCurrentClockLocalTime"},
{0x34885E0D, &WrapI_UU<sceRtcConvertUtcToLocalTime>, "sceRtcConvertUtcToLocalTime"},