Clear SPU IRQ pending flag when C_IRQINFO is read.

This commit is contained in:
Jean-Philip Desjardins 2015-10-17 00:12:42 -04:00
parent 1cf4173174
commit 523cf71a8c
3 changed files with 9 additions and 1 deletions

View File

@ -82,9 +82,11 @@ uint32 CSpu2::ReadRegisterImpl(uint32 address, uint32 value)
case C_IRQINFO:
for(unsigned int i = 0; i < CORE_NUM; i++)
{
if(m_core[i]->GetSpuBase().GetIrqPending())
auto& core = m_core[i];
if(core->GetSpuBase().GetIrqPending())
{
result |= (1 << (i + 2));
core->GetSpuBase().ClearIrqPending();
}
}
break;

View File

@ -291,6 +291,11 @@ bool CSpuBase::GetIrqPending() const
return m_irqPending;
}
void CSpuBase::ClearIrqPending()
{
m_irqPending = false;
}
uint32 CSpuBase::GetIrqAddress() const
{
return m_irqAddr;

View File

@ -168,6 +168,7 @@ namespace Iop
void SetBaseSamplingRate(uint32);
bool GetIrqPending() const;
void ClearIrqPending();
uint32 GetIrqAddress() const;
void SetIrqAddress(uint32);