mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
More fixes
This commit is contained in:
1 parent
2b5b2a8fa5
commit
26547e2629
4 files changed
+15
-11
No files matched your search
+3
-2
@@ -2189,8 +2189,9 @@ static u32 sceIoOpenAsync(const char *filename, int flags, int mode) {
|
||||
|
||||
// TODO: Use an internal method so as not to pollute the log?
|
||||
// Intentionally does not work when interrupts disabled.
|
||||
if (!__KernelIsDispatchEnabled())
|
||||
sceKernelResumeDispatchThread(1);
|
||||
if (!__KernelIsDispatchEnabled()) {
|
||||
hleCall(ThreadManForUser, u32, sceKernelResumeDispatchThread, 1);
|
||||
}
|
||||
|
||||
int error;
|
||||
FileNode *f = __IoOpen(error, filename, flags, mode);
|
||||
|
||||
@@ -91,7 +91,7 @@ static int sceKernelCpuSuspendIntr()
|
||||
returnValue = 0;
|
||||
}
|
||||
hleEatCycles(15);
|
||||
return returnValue;
|
||||
return hleNoLog(returnValue);
|
||||
}
|
||||
|
||||
static void sceKernelCpuResumeIntr(u32 enable)
|
||||
@@ -108,6 +108,7 @@ static void sceKernelCpuResumeIntr(u32 enable)
|
||||
__DisableInterrupts();
|
||||
}
|
||||
hleEatCycles(15);
|
||||
hleNoLogVoid();
|
||||
}
|
||||
|
||||
static int sceKernelIsCpuIntrEnable() {
|
||||
@@ -123,6 +124,7 @@ static int sceKernelIsCpuIntrSuspended(int flag)
|
||||
|
||||
static void sceKernelCpuResumeIntrWithSync(u32 enable)
|
||||
{
|
||||
// Just a forward, don't bother with hleCall.
|
||||
sceKernelCpuResumeIntr(enable);
|
||||
}
|
||||
|
||||
|
||||
@@ -2409,7 +2409,7 @@ u32 __KernelStopUnloadSelfModuleWithOrWithoutStatus(u32 exitCode, u32 argSize, u
|
||||
INFO_LOG(Log::sceModule, "sceKernelStopUnloadSelfModuleWithStatus(%08x, %08x, %08x, %08x, %08x): no stop func", exitCode, argSize, argp, statusAddr, optionAddr);
|
||||
else
|
||||
INFO_LOG(Log::sceModule, "sceKernelSelfStopUnloadModule(%08x, %08x, %08x): no stop func", exitCode, argSize, argp);
|
||||
sceKernelExitDeleteThread(exitCode);
|
||||
hleCall(ThreadManForKernel, int, sceKernelExitDeleteThread, exitCode);
|
||||
module->Cleanup();
|
||||
kernelObjects.Destroy<PSPModule>(moduleID);
|
||||
} else {
|
||||
@@ -2417,7 +2417,7 @@ u32 __KernelStopUnloadSelfModuleWithOrWithoutStatus(u32 exitCode, u32 argSize, u
|
||||
ERROR_LOG_REPORT(Log::sceModule, "sceKernelStopUnloadSelfModuleWithStatus(%08x, %08x, %08x, %08x, %08x): bad stop func address", exitCode, argSize, argp, statusAddr, optionAddr);
|
||||
else
|
||||
ERROR_LOG_REPORT(Log::sceModule, "sceKernelSelfStopUnloadModule(%08x, %08x, %08x): bad stop func address", exitCode, argSize, argp);
|
||||
sceKernelExitDeleteThread(exitCode);
|
||||
hleCall(ThreadManForKernel, int, sceKernelExitDeleteThread, exitCode);
|
||||
module->Cleanup();
|
||||
kernelObjects.Destroy<PSPModule>(moduleID);
|
||||
}
|
||||
@@ -2428,7 +2428,7 @@ u32 __KernelStopUnloadSelfModuleWithOrWithoutStatus(u32 exitCode, u32 argSize, u
|
||||
ERROR_LOG_REPORT(Log::sceModule, "UNIMPL sceKernelSelfStopUnloadModule(%08x, %08x, %08x): game has likely crashed", exitCode, argSize, argp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return hleNoLog(0);
|
||||
}
|
||||
|
||||
static u32 sceKernelSelfStopUnloadModule(u32 exitCode, u32 argSize, u32 argp) {
|
||||
@@ -2452,12 +2452,13 @@ void __KernelReturnFromModuleFunc()
|
||||
|
||||
// Reschedule immediately (to leave the thread) and delete it and its stack.
|
||||
__KernelReSchedule("returned from module");
|
||||
sceKernelDeleteThread(leftThreadID);
|
||||
hleCall(ThreadManForKernel, int, sceKernelDeleteThread, leftThreadID);
|
||||
|
||||
u32 error;
|
||||
PSPModule *module = kernelObjects.Get<PSPModule>(leftModuleID, error);
|
||||
if (!module) {
|
||||
ERROR_LOG_REPORT(Log::sceModule, "Returned from deleted module start/stop func");
|
||||
hleNoLogVoid();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2472,7 +2473,7 @@ void __KernelReturnFromModuleFunc()
|
||||
{
|
||||
if (module->nm.status == MODULE_STATUS_UNLOADING) {
|
||||
// TODO: Maybe should maintain the exitCode?
|
||||
sceKernelTerminateDeleteThread(it->threadID);
|
||||
hleCall(ThreadManForKernel, int, sceKernelTerminateDeleteThread, it->threadID);
|
||||
} else {
|
||||
if (it->statusPtr != 0)
|
||||
Memory::Write_U32(exitStatus, it->statusPtr);
|
||||
@@ -2487,6 +2488,7 @@ void __KernelReturnFromModuleFunc()
|
||||
module->Cleanup();
|
||||
kernelObjects.Destroy<PSPModule>(leftModuleID);
|
||||
}
|
||||
hleNoLogVoid();
|
||||
}
|
||||
|
||||
struct GetModuleIdByAddressArg
|
||||
|
||||
@@ -2202,8 +2202,7 @@ int sceKernelExitDeleteThread(int exitStatus) {
|
||||
if (!__KernelIsDispatchEnabled() && sceKernelGetCompiledSdkVersion() >= 0x03080000)
|
||||
return hleLogError(Log::sceKernel, SCE_KERNEL_ERROR_CAN_NOT_WAIT);
|
||||
PSPThread *thread = __GetCurrentThread();
|
||||
if (thread)
|
||||
{
|
||||
if (thread) {
|
||||
INFO_LOG(Log::sceKernel,"sceKernelExitDeleteThread(%d)", exitStatus);
|
||||
uint32_t thread_attr = thread->nt.attr;
|
||||
uint32_t uid = thread->GetUID();
|
||||
@@ -2218,7 +2217,7 @@ int sceKernelExitDeleteThread(int exitStatus) {
|
||||
}
|
||||
else
|
||||
ERROR_LOG_REPORT(Log::sceKernel, "sceKernelExitDeleteThread(%d) ERROR - could not find myself!", exitStatus);
|
||||
return 0;
|
||||
return hleNoLog(0);
|
||||
}
|
||||
|
||||
u32 sceKernelSuspendDispatchThread()
|
||||
|
||||
Reference in new issue
Block a user