From 0ad9658eb201a73ab30518c0de84bc01e36da322 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 13 Apr 2013 00:35:24 -0700 Subject: [PATCH 1/2] Increment wakeupCount when a thread is pending. It might've been woken up but just not run yet. That doesn't mean it should not have wakeupCount incremented. Fixes Tales of Eternia freezing before world map. --- Core/HLE/sceKernelThread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index b80d310b0..5c1f165ce 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2238,11 +2238,12 @@ void sceKernelWakeupThread() Thread *t = kernelObjects.Get(uid, error); if (t) { - if (t->nt.waitType != WAITTYPE_SLEEP) { + if (!t->isWaitingFor(WAITTYPE_SLEEP, 1)) { t->nt.wakeupCount++; DEBUG_LOG(HLE,"sceKernelWakeupThread(%i) - wakeupCount incremented to %i", uid, t->nt.wakeupCount); RETURN(0); } else { + VERBOSE_LOG(HLE,"sceKernelWakeupThread(%i) - woke thread at %i", uid, t->nt.wakeupCount); __KernelResumeThreadFromWait(uid); } } @@ -2286,7 +2287,7 @@ static void __KernelSleepThread(bool doCallbacks) { } else { VERBOSE_LOG(HLE, "sceKernelSleepThread()"); RETURN(0); - __KernelWaitCurThread(WAITTYPE_SLEEP, 0, 0, 0, doCallbacks, "thread slept"); + __KernelWaitCurThread(WAITTYPE_SLEEP, 1, 0, 0, doCallbacks, "thread slept"); } } From b03b88b7ed6b88ab04e1c0e1b8898f90255ef1e9 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 13 Apr 2013 00:36:32 -0700 Subject: [PATCH 2/2] Fix small reporting typo. --- Core/HLE/sceIo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 08238d1dd..9f9bdfd75 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -1404,7 +1404,7 @@ int __IoIoctl(u32 id, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 out } break; - // Get UMD file start sector . + // Get UMD file start sector. case 0x01020006: INFO_LOG(HLE, "sceIoIoCtl: Asked for start sector of file %i", id); if (Memory::IsValidAddress(outdataPtr) && outlen >= 4) { @@ -1425,7 +1425,7 @@ int __IoIoctl(u32 id, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 out char temp[256]; // We want the reported message to include the cmd, so it's unique. sprintf(temp, "sceIoIoctl(%%s, %08x, %%08x, %%x, %%08x, %%x)", cmd); - Reporting::ReportMessage(temp, f->fullpath.c_str(), cmd, indataPtr, inlen, outdataPtr, outlen); + Reporting::ReportMessage(temp, f->fullpath.c_str(), indataPtr, inlen, outdataPtr, outlen); ERROR_LOG(HLE, "UNIMPL 0=sceIoIoctl id: %08x, cmd %08x, indataPtr %08x, inlen %08x, outdataPtr %08x, outLen %08x", id,cmd,indataPtr,inlen,outdataPtr,outlen); } break;