Some more work on stwcxd and lwarx
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1389 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
15e3fbc299
commit
e3fb58769c
|
@ -579,30 +579,43 @@ void stwbrx(UGeckoInstruction _inst)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// The following two instructions are for inter-cpu communications. On a single CPU, they cannot
|
// The following two instructions are for inter-cpu communications. On a single
|
||||||
// fail unless an interrupt happens in between, which usually won't happen with the JIT, so we just pretend
|
// CPU, they cannot
|
||||||
// they are regular loads and stores for now. If this proves to be a problem, we could add a reservation flag.
|
// fail unless an interrupt happens in between, which usually won't happen with
|
||||||
|
// the JIT.
|
||||||
|
bool g_bReserve = false;
|
||||||
|
u32 g_reserveAddr;
|
||||||
|
|
||||||
void lwarx(UGeckoInstruction _inst)
|
void lwarx(UGeckoInstruction _inst)
|
||||||
{
|
{
|
||||||
m_GPR[_inst.RD] = Memory::Read_U32(Helper_Get_EA_X(_inst));
|
u32 uAddress = Helper_Get_EA_X(_inst);
|
||||||
//static bool bFirst = true;
|
|
||||||
//if (bFirst)
|
m_GPR[_inst.RD] = Memory::Read_U32(uAddress);
|
||||||
// MessageBox(NULL, "lwarx", "Instruction unimplemented", MB_OK);
|
g_bReserve = true;
|
||||||
//bFirst = false;
|
g_reserveAddr = uAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
void stwcxd(UGeckoInstruction _inst)
|
void stwcxd(UGeckoInstruction _inst)
|
||||||
{
|
{
|
||||||
// This instruction, too
|
// This instruction, too
|
||||||
static bool bFirst = true;
|
//PanicAlert("stwcxd - suspicious instruction");
|
||||||
if (bFirst)
|
|
||||||
PanicAlert("stwcxd - suspicious instruction");
|
|
||||||
|
|
||||||
// TODO: Stores Word Conditional indeXed
|
// Stores Word Conditional indeXed
|
||||||
|
|
||||||
bFirst = false;
|
u32 uAddress;
|
||||||
u32 uAddress = Helper_Get_EA_X(_inst);
|
|
||||||
|
if(g_bReserve) {
|
||||||
|
uAddress = Helper_Get_EA_X(_inst);
|
||||||
|
if(uAddress == g_reserveAddr) {
|
||||||
Memory::Write_U32(m_GPR[_inst.RS], uAddress);
|
Memory::Write_U32(m_GPR[_inst.RS], uAddress);
|
||||||
|
g_bReserve = false;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Set CR0 to IS_XER_SO
|
||||||
}
|
}
|
||||||
|
|
||||||
void stwux(UGeckoInstruction _inst)
|
void stwux(UGeckoInstruction _inst)
|
||||||
|
|
Loading…
Reference in New Issue