From 26c072df514b328ec68be2b765ff58560a01aaeb Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 10 Aug 2013 18:13:48 -0700 Subject: [PATCH] Don't wait directly from GPUCommon, do it in sceGe. Makes debugging a bit easier. --- Core/HLE/sceGe.cpp | 10 ++++++++++ Core/HLE/sceGe.h | 2 ++ GPU/GPUCommon.cpp | 10 ++++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index d0d9bee62d..6a6dd271e2 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -215,6 +215,16 @@ bool __GeTriggerInterrupt(int listid, u32 pc, u64 atTicks) return true; } +void __GeWaitCurrentThread(WaitType type, SceUID waitId, const char *reason) +{ + __KernelWaitCurThread(type, waitId, 0, 0, false, reason); +} + +void __GeTriggerWait(WaitType type, SceUID waitId, const char *reason, bool noSwitch) +{ + __KernelTriggerWait(type, waitId, 0, reason, noSwitch); +} + bool __GeHasPendingInterrupt() { return !ge_pending_cb.empty(); diff --git a/Core/HLE/sceGe.h b/Core/HLE/sceGe.h index e11db00ed2..a9b456f009 100644 --- a/Core/HLE/sceGe.h +++ b/Core/HLE/sceGe.h @@ -43,6 +43,8 @@ void __GeDoState(PointerWrap &p); void __GeShutdown(); bool __GeTriggerSync(WaitType waitType, int id, u64 atTicks); bool __GeTriggerInterrupt(int listid, u32 pc, u64 atTicks); +void __GeWaitCurrentThread(WaitType type, SceUID waitId, const char *reason); +void __GeTriggerWait(WaitType type, SceUID waitId, const char *reason, bool noSwitch = false); bool __GeHasPendingInterrupt(); diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index c7dd65c592..d794b74b87 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -10,9 +10,7 @@ #include "Core/MemMap.h" #include "Core/Host.h" #include "Core/Reporting.h" -#include "Core/HLE/sceKernelInterrupt.h" #include "Core/HLE/sceKernelMemory.h" -#include "Core/HLE/sceKernelThread.h" #include "Core/HLE/sceGe.h" GPUCommon::GPUCommon() : @@ -58,7 +56,7 @@ u32 GPUCommon::DrawSync(int mode) { if (mode == 0) { // TODO: What if dispatch / interrupts disabled? if (drawCompleteTicks > CoreTiming::GetTicks()) { - __KernelWaitCurThread(WAITTYPE_GEDRAWSYNC, 1, 0, 0, false, "GeDrawSync"); + __GeWaitCurrentThread(WAITTYPE_GEDRAWSYNC, 1, "GeDrawSync"); } else { for (int i = 0; i < DisplayListMaxCount; ++i) { if (dls[i].state == PSP_GE_DL_STATE_COMPLETED) { @@ -130,7 +128,7 @@ int GPUCommon::ListSync(int listid, int mode) { } if (dl.waitTicks > CoreTiming::GetTicks()) { - __KernelWaitCurThread(WAITTYPE_GELISTSYNC, listid, 0, 0, false, "GeListSync"); + __GeWaitCurrentThread(WAITTYPE_GELISTSYNC, listid, "GeListSync"); } return PSP_GE_LIST_COMPLETED; } @@ -243,7 +241,7 @@ u32 GPUCommon::DequeueList(int listid) { dlQueue.remove(listid); dls[listid].waitTicks = 0; - __KernelTriggerWait(WAITTYPE_GELISTSYNC, listid, 0, "GeListSync"); + __GeTriggerWait(WAITTYPE_GELISTSYNC, listid, "GeListSync"); CheckDrawSync(); @@ -858,7 +856,7 @@ void GPUCommon::InterruptEnd(int listid) { // TODO: Unless the signal handler could change it? if (dl.state == PSP_GE_DL_STATE_COMPLETED || dl.state == PSP_GE_DL_STATE_NONE) { dl.waitTicks = 0; - __KernelTriggerWait(WAITTYPE_GELISTSYNC, listid, 0, "GeListSync", true); + __GeTriggerWait(WAITTYPE_GELISTSYNC, listid, "GeListSync", true); } if (dl.signal == PSP_GE_SIGNAL_HANDLER_PAUSE)