Implement Enter/ExitCriticalSection.

This commit is contained in:
Jean-Philip Desjardins 2018-02-06 18:34:31 -05:00
parent 1ec189aa04
commit 79834c3a3c

View File

@ -1109,12 +1109,15 @@ void CPsxBios::sc_ChangeClearRCnt()
void CPsxBios::sc_EnterCriticalSection()
{
bool isIntEnabled = (m_cpu.m_State.nCOP0[CCOP_SCU::STATUS] & CMIPS::STATUS_IE) != 0;
m_cpu.m_State.nCOP0[CCOP_SCU::STATUS] &= ~CMIPS::STATUS_IE;
m_cpu.m_State.nGPR[SC_RETURN].nD0 = static_cast<int32>(isIntEnabled ? 1 : 0);
}
void CPsxBios::sc_ExitCriticalSection()
{
m_cpu.m_State.nCOP0[CCOP_SCU::STATUS] |= CMIPS::STATUS_IE;
}
void CPsxBios::sc_Illegal()