mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-16 16:00:30 +02:00
Refactor down the begin/end callback stuff.
This commit is contained in:
1 parent
1bf974aff6
commit
b20bb3b609
11 files changed
+311
-622
No files matched your search
@@ -22,22 +22,23 @@
|
||||
|
||||
#include "Common/LogManager.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "HLE.h"
|
||||
#include "HLETables.h"
|
||||
#include "../MIPS/MIPSInt.h"
|
||||
#include "../MIPS/MIPSCodeUtils.h"
|
||||
#include "../MIPS/MIPS.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/HLE/HLETables.h"
|
||||
#include "Core/MIPS/MIPSInt.h"
|
||||
#include "Core/MIPS/MIPSCodeUtils.h"
|
||||
#include "Core/MIPS/MIPS.h"
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/MemMap.h"
|
||||
#include "Core/Reporting.h"
|
||||
#include "ChunkFile.h"
|
||||
#include "Common/ChunkFile.h"
|
||||
|
||||
#include "sceAudio.h"
|
||||
#include "sceKernel.h"
|
||||
#include "sceKernelMemory.h"
|
||||
#include "sceKernelThread.h"
|
||||
#include "sceKernelModule.h"
|
||||
#include "sceKernelInterrupt.h"
|
||||
#include "Core/HLE/sceAudio.h"
|
||||
#include "Core/HLE/sceKernel.h"
|
||||
#include "Core/HLE/sceKernelMemory.h"
|
||||
#include "Core/HLE/sceKernelThread.h"
|
||||
#include "Core/HLE/sceKernelModule.h"
|
||||
#include "Core/HLE/sceKernelInterrupt.h"
|
||||
#include "Core/HLE/KernelWaitHelpers.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -924,14 +925,9 @@ void __KernelDelayBeginCallback(SceUID threadID, SceUID prevCallbackId) {
|
||||
u32 error;
|
||||
SceUID waitID = __KernelGetWaitID(threadID, WAITTYPE_DELAY, error);
|
||||
if (waitID == threadID) {
|
||||
// This means two callbacks in a row. PSP crashes if the same callback runs inside itself.
|
||||
// TODO: Handle this better?
|
||||
if (pausedDelays.find(pauseKey) != pausedDelays.end())
|
||||
return;
|
||||
|
||||
s64 cyclesLeft = CoreTiming::UnscheduleEvent(eventScheduledWakeup, threadID);
|
||||
pausedDelays[pauseKey] = CoreTiming::GetTicks() + cyclesLeft;
|
||||
|
||||
// Most waits need to keep track of waiting threads, delays don't. Use a fake list.
|
||||
std::vector<SceUID> dummy;
|
||||
HLEKernel::WaitBeginCallback(threadID, prevCallbackId, eventScheduledWakeup, dummy, pausedDelays, true);
|
||||
DEBUG_LOG(HLE, "sceKernelDelayThreadCB: Suspending delay for callback");
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user