From 5d017829ad3183e9fb8d684b1ba7c4bfba672e38 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 7 Apr 2013 16:47:29 -0700 Subject: [PATCH] Make sure lists aren't reused before they complete. --- Core/HLE/sceGe.cpp | 2 +- GPU/GPUCommon.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index 17ef2aaf71..eb6ccd2292 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -158,7 +158,7 @@ void __GeExecuteInterrupt(u64 userdata, int cyclesLate) intrdata.listid = listid; intrdata.pc = pc; ge_pending_cb.push_back(intrdata); - __TriggerInterrupt(PSP_INTR_HLE, PSP_GE_INTR, PSP_INTR_SUB_NONE); + __TriggerInterrupt(PSP_INTR_IMMEDIATE, PSP_GE_INTR, PSP_INTR_SUB_NONE); } void __GeInit() diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index bd6f3ef444..eb26cdd7bb 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -139,6 +139,7 @@ u32 GPUCommon::EnqueueList(u32 listpc, u32 stall, int subIntrBase, bool head) oldCompatibility = false; } + u64 currentTicks = CoreTiming::GetTicks(); for (int i = 0; i < DisplayListMaxCount; ++i) { if (dls[i].state != PSP_GE_DL_STATE_NONE && dls[i].state != PSP_GE_DL_STATE_COMPLETED) { @@ -157,7 +158,7 @@ u32 GPUCommon::EnqueueList(u32 listpc, u32 stall, int subIntrBase, bool head) id = i; break; } - if (id < 0 && dls[i].state == PSP_GE_DL_STATE_COMPLETED) + if (id < 0 && dls[i].state == PSP_GE_DL_STATE_COMPLETED && dls[i].waitTicks < currentTicks) { id = i; } @@ -690,7 +691,7 @@ void GPUCommon::InterruptEnd(int listid) DisplayList &dl = dls[listid]; // TODO: Unless the signal handler could change it? - if (dl.state == PSP_GE_DL_STATE_COMPLETED) { + 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); }