diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index 3a19953083..4fcd1545e5 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -2969,7 +2969,7 @@ void ActionAfterMipsCall::run(MipsCall &call) { ActionAfterMipsCall *Thread::getRunningCallbackAction() { - if (this->GetUID() == currentThread && g_inCbCount > 0) { + if (this->GetUID() == currentThread && g_inCbCount > 0) { MipsCall *call = mipsCalls.get(this->currentMipscallId); ActionAfterMipsCall *action = 0; if (call) diff --git a/Core/HLE/sceUmd.cpp b/Core/HLE/sceUmd.cpp index 27da50810b..fe4448b809 100644 --- a/Core/HLE/sceUmd.cpp +++ b/Core/HLE/sceUmd.cpp @@ -114,7 +114,8 @@ void __UmdStatChange(u64 userdata, int cyclesLate) void __KernelUmdActivate() { u32 notifyArg = PSP_UMD_PRESENT | PSP_UMD_READABLE; - __KernelNotifyCallback(driveCBId, notifyArg); + if (driveCBId != -1) + __KernelNotifyCallback(driveCBId, notifyArg); // Don't activate immediately, take time to "spin up." CoreTiming::RemoveAllEvents(umdStatChangeEvent); @@ -124,7 +125,8 @@ void __KernelUmdActivate() void __KernelUmdDeactivate() { u32 notifyArg = PSP_UMD_PRESENT | PSP_UMD_READY; - __KernelNotifyCallback(driveCBId, notifyArg); + if (driveCBId != -1) + __KernelNotifyCallback(driveCBId, notifyArg); CoreTiming::RemoveAllEvents(umdStatChangeEvent); __UmdStatChange(0, 0); @@ -256,7 +258,7 @@ int sceUmdDeactivate(u32 mode, const char *name) u32 sceUmdRegisterUMDCallBack(u32 cbId) { - int retVal; + int retVal = 0; // TODO: If the callback is invalid, return PSP_ERROR_UMD_INVALID_PARAM. if (!kernelObjects.IsValid(cbId)) {