From 00fc5ec40ee51be439f3933eed58907f923bd174 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 6 Aug 2013 23:59:28 -0700 Subject: [PATCH] Enable interrupts as a property of the list. This way there's no behavior change when enqueue is async. --- GPU/GPUCommon.cpp | 7 ++++--- GPU/GPUInterface.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 9bb123a59..6955339a9 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -186,6 +186,7 @@ u32 GPUCommon::EnqueueList(u32 listpc, u32 stall, int subIntrBase, bool head) dl.signal = PSP_GE_SIGNAL_NONE; dl.interrupted = false; dl.waitTicks = (u64)-1; + dl.interruptsEnabled = interruptsEnabled_; if (head) { if (currentList) { @@ -720,7 +721,7 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) { break; } // TODO: Technically, jump/call/ret should generate an interrupt, but before the pc change maybe? - if (interruptsEnabled_ && trigger) { + if (currentList->interruptsEnabled && trigger) { if (__GeTriggerInterrupt(currentList->id, currentList->pc, startingTicks + cyclesExecuted)) UpdateState(GPUSTATE_INTERRUPT); } @@ -729,7 +730,7 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) { case GE_CMD_FINISH: switch (currentList->signal) { case PSP_GE_SIGNAL_HANDLER_PAUSE: - if (interruptsEnabled_) { + if (currentList->interruptsEnabled) { if (__GeTriggerInterrupt(currentList->id, currentList->pc, startingTicks + cyclesExecuted)) UpdateState(GPUSTATE_INTERRUPT); } @@ -744,7 +745,7 @@ void GPUCommon::ExecuteOp(u32 op, u32 diff) { currentList->subIntrToken = prev & 0xFFFF; currentList->state = PSP_GE_DL_STATE_COMPLETED; UpdateState(GPUSTATE_DONE); - if (!interruptsEnabled_ || !__GeTriggerInterrupt(currentList->id, currentList->pc, startingTicks + cyclesExecuted)) { + if (!currentList->interruptsEnabled || !__GeTriggerInterrupt(currentList->id, currentList->pc, startingTicks + cyclesExecuted)) { currentList->waitTicks = startingTicks + cyclesExecuted; busyTicks = std::max(busyTicks, currentList->waitTicks); __GeTriggerSync(WAITTYPE_GELISTSYNC, currentList->id, currentList->waitTicks); diff --git a/GPU/GPUInterface.h b/GPU/GPUInterface.h index 7dadd1a36..2847e972e 100644 --- a/GPU/GPUInterface.h +++ b/GPU/GPUInterface.h @@ -130,6 +130,7 @@ struct DisplayList int stackptr; bool interrupted; u64 waitTicks; + bool interruptsEnabled; }; enum GPUInvalidationType {