mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 21:57:57 +03:00
Added proper handling of the EIE bit by EI and DI. (needed for liberx)
This commit is contained in:
parent
d9b934a09e
commit
6c32b51d81
3 changed files with 15 additions and 4 deletions
|
@ -189,7 +189,7 @@ void CCOP_SCU::ERET()
|
||||||
void CCOP_SCU::EI()
|
void CCOP_SCU::EI()
|
||||||
{
|
{
|
||||||
m_codeGen->PushRel(offsetof(CMIPS, m_State.nCOP0[STATUS]));
|
m_codeGen->PushRel(offsetof(CMIPS, m_State.nCOP0[STATUS]));
|
||||||
m_codeGen->PushCst(0x00010001);
|
m_codeGen->PushCst(CMIPS::STATUS_EIE);
|
||||||
m_codeGen->Or();
|
m_codeGen->Or();
|
||||||
m_codeGen->PullRel(offsetof(CMIPS, m_State.nCOP0[STATUS]));
|
m_codeGen->PullRel(offsetof(CMIPS, m_State.nCOP0[STATUS]));
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ void CCOP_SCU::EI()
|
||||||
void CCOP_SCU::DI()
|
void CCOP_SCU::DI()
|
||||||
{
|
{
|
||||||
m_codeGen->PushRel(offsetof(CMIPS, m_State.nCOP0[STATUS]));
|
m_codeGen->PushRel(offsetof(CMIPS, m_State.nCOP0[STATUS]));
|
||||||
m_codeGen->PushCst(~0x00010001);
|
m_codeGen->PushCst(~CMIPS::STATUS_EIE);
|
||||||
m_codeGen->And();
|
m_codeGen->And();
|
||||||
m_codeGen->PullRel(offsetof(CMIPS, m_State.nCOP0[STATUS]));
|
m_codeGen->PullRel(offsetof(CMIPS, m_State.nCOP0[STATUS]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,8 @@ public:
|
||||||
{
|
{
|
||||||
STATUS_IE = (1 << 0),
|
STATUS_IE = (1 << 0),
|
||||||
STATUS_EXL = (1 << 1),
|
STATUS_EXL = (1 << 1),
|
||||||
STATUS_ERL = (1 << 2)
|
STATUS_ERL = (1 << 2),
|
||||||
|
STATUS_EIE = (1 << 16), //PS2 EE specific
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char* m_sGPRName[];
|
static const char* m_sGPRName[];
|
||||||
|
|
|
@ -59,6 +59,8 @@
|
||||||
#define BIOS_ADDRESS_WAITTHREADPROC 0x1FC03100
|
#define BIOS_ADDRESS_WAITTHREADPROC 0x1FC03100
|
||||||
#define BIOS_ADDRESS_ALARMHANDLER 0x1FC03200
|
#define BIOS_ADDRESS_ALARMHANDLER 0x1FC03200
|
||||||
|
|
||||||
|
#define INTERRUPTS_ENABLED_MASK (CMIPS::STATUS_IE | CMIPS::STATUS_EIE)
|
||||||
|
|
||||||
#define BIOS_ID_BASE 1
|
#define BIOS_ID_BASE 1
|
||||||
|
|
||||||
#define CONFIGPATH "./config/"
|
#define CONFIGPATH "./config/"
|
||||||
|
@ -209,6 +211,8 @@ void CPS2OS::Initialize()
|
||||||
m_semaWaitCount = 0;
|
m_semaWaitCount = 0;
|
||||||
m_semaWaitCaller = 0;
|
m_semaWaitCaller = 0;
|
||||||
m_semaWaitThreadId = -1;
|
m_semaWaitThreadId = -1;
|
||||||
|
|
||||||
|
m_ee.m_State.nCOP0[CCOP_SCU::STATUS] |= CMIPS::STATUS_IE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPS2OS::Release()
|
void CPS2OS::Release()
|
||||||
|
@ -1042,7 +1046,7 @@ void CPS2OS::ThreadShakeAndBake()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Don't switch if interrupts are disabled
|
//Don't switch if interrupts are disabled
|
||||||
if(!(m_ee.m_State.nCOP0[CCOP_SCU::STATUS] & CMIPS::STATUS_IE))
|
if((m_ee.m_State.nCOP0[CCOP_SCU::STATUS] & INTERRUPTS_ENABLED_MASK) != INTERRUPTS_ENABLED_MASK)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1269,6 +1273,12 @@ CPS2OS::DECI2HANDLER* CPS2OS::GetDeci2Handler(uint32 id)
|
||||||
|
|
||||||
void CPS2OS::HandleInterrupt()
|
void CPS2OS::HandleInterrupt()
|
||||||
{
|
{
|
||||||
|
//Check if interrupts are enabled here because EIE bit isn't checked by CMIPS
|
||||||
|
if((m_ee.m_State.nCOP0[CCOP_SCU::STATUS] & INTERRUPTS_ENABLED_MASK) != INTERRUPTS_ENABLED_MASK)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_semaWaitCount = 0;
|
m_semaWaitCount = 0;
|
||||||
m_ee.GenerateInterrupt(0x1FC00200);
|
m_ee.GenerateInterrupt(0x1FC00200);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue