diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index 91c687d65..a8de87bf0 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -33,6 +33,8 @@ struct GeInterruptData { int listid; u32 pc; + u32 subIntrBase; + u16 subIntrToken; }; static std::list ge_pending_cb; @@ -50,20 +52,21 @@ public: if (dl == NULL) { WARN_LOG(HLE, "Unable to run GE interrupt: list doesn't exist: %d", intrdata.listid); - return false; + // TODO: Use dl instead of just saving everything instead? + //return false; } gpu->InterruptStart(); u32 cmd = Memory::ReadUnchecked_U32(intrdata.pc) >> 24; - int subintr = dl->subIntrBase | (cmd == GE_CMD_FINISH ? PSP_GE_SUBINTR_FINISH : PSP_GE_SUBINTR_SIGNAL); + int subintr = intrdata.subIntrBase | (cmd == GE_CMD_FINISH ? PSP_GE_SUBINTR_FINISH : PSP_GE_SUBINTR_SIGNAL); SubIntrHandler* handler = get(subintr); if(handler != NULL) { DEBUG_LOG(CPU, "Entering interrupt handler %08x", handler->handlerAddress); currentMIPS->pc = handler->handlerAddress; - u32 data = dl->subIntrToken; + u32 data = intrdata.subIntrToken; currentMIPS->r[MIPS_REG_A0] = data & 0xFFFF; currentMIPS->r[MIPS_REG_A1] = handler->handlerArg; currentMIPS->r[MIPS_REG_A2] = sceKernelGetCompiledSdkVersion() <= 0x02000010 ? 0 : intrdata.pc + 4; @@ -109,11 +112,13 @@ void __GeShutdown() } -void __GeTriggerInterrupt(int listid, u32 pc) +void __GeTriggerInterrupt(int listid, u32 pc, u32 subIntrBase, u16 subIntrToken) { GeInterruptData intrdata; intrdata.listid = listid; intrdata.pc = pc; + intrdata.subIntrBase = subIntrBase; + intrdata.subIntrToken = subIntrToken; ge_pending_cb.push_back(intrdata); __TriggerInterrupt(PSP_INTR_HLE, PSP_GE_INTR, PSP_INTR_SUB_NONE); } diff --git a/Core/HLE/sceGe.h b/Core/HLE/sceGe.h index ce6661fe2..c2621a492 100644 --- a/Core/HLE/sceGe.h +++ b/Core/HLE/sceGe.h @@ -39,7 +39,7 @@ void Register_sceGe_user(); void __GeInit(); void __GeDoState(PointerWrap &p); void __GeShutdown(); -void __GeTriggerInterrupt(int listid, u32 pc); +void __GeTriggerInterrupt(int listid, u32 pc, u32 subIntrBase, u16 subIntrToken); bool __GeHasPendingInterrupt(); diff --git a/GPU/GLES/DisplayListInterpreter.cpp b/GPU/GLES/DisplayListInterpreter.cpp index ff1b55d55..3d38b7d7e 100644 --- a/GPU/GLES/DisplayListInterpreter.cpp +++ b/GPU/GLES/DisplayListInterpreter.cpp @@ -451,7 +451,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) { currentList->subIntrToken = data & 0xFFFF; // TODO: Should this run while interrupts are suspended? if (interruptsEnabled_) - __GeTriggerInterrupt(currentList->id, currentList->pc); + __GeTriggerInterrupt(currentList->id, currentList->pc, currentList->subIntrBase, currentList->subIntrToken); break; case GE_CMD_END: @@ -489,7 +489,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff) { } // TODO: Should this run while interrupts are suspended? if (interruptsEnabled_) - __GeTriggerInterrupt(currentList->id, currentList->pc); + __GeTriggerInterrupt(currentList->id, currentList->pc, currentList->subIntrBase, currentList->subIntrToken); } break; case GE_CMD_FINISH: diff --git a/GPU/Null/NullGpu.cpp b/GPU/Null/NullGpu.cpp index 73517092a..f9153be50 100644 --- a/GPU/Null/NullGpu.cpp +++ b/GPU/Null/NullGpu.cpp @@ -154,7 +154,7 @@ void NullGPU::ExecuteOp(u32 op, u32 diff) // TODO: Should this run while interrupts are suspended? if (interruptsEnabled_) - __GeTriggerInterrupt(currentList->id, currentList->pc); + __GeTriggerInterrupt(currentList->id, currentList->pc, currentList->subIntrBase, currentList->subIntrToken); } break; @@ -188,7 +188,7 @@ void NullGPU::ExecuteOp(u32 op, u32 diff) currentList->subIntrToken = data & 0xFFFF; // TODO: Should this run while interrupts are suspended? if (interruptsEnabled_) - __GeTriggerInterrupt(currentList->id, currentList->pc); + __GeTriggerInterrupt(currentList->id, currentList->pc, currentList->subIntrBase, currentList->subIntrToken); break; case GE_CMD_END: