diff --git a/Core/HLE/sceKernelMutex.cpp b/Core/HLE/sceKernelMutex.cpp index cfe1e2bca..20d73f28f 100644 --- a/Core/HLE/sceKernelMutex.cpp +++ b/Core/HLE/sceKernelMutex.cpp @@ -394,7 +394,7 @@ int sceKernelCreateMutex(const char *name, u32 attr, int initialCount, u32 optio if (optionsPtr != 0) { u32 size = Memory::Read_U32(optionsPtr); - if (size != 0) + if (size > 4) WARN_LOG_REPORT(HLE, "sceKernelCreateMutex(%s) unsupported options parameter, size = %d", name, size); } if ((attr & ~PSP_MUTEX_ATTR_KNOWN) != 0) @@ -751,7 +751,7 @@ int sceKernelCreateLwMutex(u32 workareaPtr, const char *name, u32 attr, int init if (optionsPtr != 0) { u32 size = Memory::Read_U32(optionsPtr); - if (size != 0) + if (size > 4) WARN_LOG_REPORT(HLE, "sceKernelCreateLwMutex(%s) unsupported options parameter, size = %d", name, size); } if ((attr & ~PSP_MUTEX_ATTR_KNOWN) != 0) diff --git a/Core/HLE/sceKernelSemaphore.cpp b/Core/HLE/sceKernelSemaphore.cpp index 0e7caa283..eee23afe0 100644 --- a/Core/HLE/sceKernelSemaphore.cpp +++ b/Core/HLE/sceKernelSemaphore.cpp @@ -292,7 +292,7 @@ int sceKernelCreateSema(const char* name, u32 attr, int initVal, int maxVal, u32 if (optionPtr != 0) { u32 size = Memory::Read_U32(optionPtr); - if (size != 0) + if (size > 4) WARN_LOG_REPORT(HLE, "sceKernelCreateSema(%s) unsupported options parameter, size = %d", name, size); } if ((attr & ~PSP_SEMA_ATTR_PRIORITY) != 0) diff --git a/Core/HLE/sceKernelVTimer.cpp b/Core/HLE/sceKernelVTimer.cpp index 7ede58d92..638f73708 100644 --- a/Core/HLE/sceKernelVTimer.cpp +++ b/Core/HLE/sceKernelVTimer.cpp @@ -177,9 +177,11 @@ void __KernelVTimerInit() { } u32 sceKernelCreateVTimer(const char *name, u32 optParamAddr) { + if (!name) { + WARN_LOG_REPORT(HLE, "%08x=sceKernelCreateVTimer(): invalid name", SCE_KERNEL_ERROR_ERROR); + return SCE_KERNEL_ERROR_ERROR; + } DEBUG_LOG(HLE, "sceKernelCreateVTimer(%s, %08x)", name, optParamAddr); - if (optParamAddr != 0) - WARN_LOG_REPORT(HLE, "sceKernelCreateVTimer: unsupported options parameter %08x", optParamAddr); VTimer *vtimer = new VTimer; SceUID id = kernelObjects.Create(vtimer); @@ -190,6 +192,12 @@ u32 sceKernelCreateVTimer(const char *name, u32 optParamAddr) { vtimer->nvt.name[KERNELOBJECT_MAX_NAME_LENGTH] = '\0'; vtimer->memoryPtr = 0; + if (optParamAddr != 0) { + u32 size = Memory::Read_U32(optParamAddr); + if (size > 4) + WARN_LOG_REPORT(HLE, "sceKernelCreateVTimer(%s) unsupported options parameter, size = %d", name, size); + } + return id; }