mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 08:39:51 +00:00
Minimal revert of the GE-related interrupt changes.
Keep most of them, just revert using getList() which isn't cutting it right now. Fixes #595.
This commit is contained in:
parent
2a305a9288
commit
430139b12a
@ -33,6 +33,8 @@ struct GeInterruptData
|
||||
{
|
||||
int listid;
|
||||
u32 pc;
|
||||
u32 subIntrBase;
|
||||
u16 subIntrToken;
|
||||
};
|
||||
|
||||
static std::list<GeInterruptData> 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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user