Fix mtsrin/mfsrin instructions. Not likely to change anything since they are only used by MMU code which doesn't work right anyway.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4837 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2010-01-14 22:16:12 +00:00
parent d7b4175605
commit 75c1661e19
1 changed files with 28 additions and 20 deletions

View File

@ -221,17 +221,14 @@ void mfmsr(UGeckoInstruction _inst)
m_GPR[_inst.RD] = MSR;
}
// segment register
// We can probably ignore all this junk
void mfsr(UGeckoInstruction _inst)
{
m_GPR[_inst.RD] = PowerPC::ppcState.sr[_inst.SR];
}
// segment register
void mfsrin(UGeckoInstruction _inst)
{
int index = m_GPR[_inst.RB] & 0xF;
int index = (m_GPR[_inst.RB] >> 28) & 0xF;
m_GPR[_inst.RD] = PowerPC::ppcState.sr[index];
}
@ -241,19 +238,29 @@ void mtmsr(UGeckoInstruction _inst)
MSR = m_GPR[_inst.RS];
}
// segment register
void mtsr(UGeckoInstruction _inst)
{
PowerPC::ppcState.sr[_inst.SR] = m_GPR[_inst.RS];
// Segment registers. MMU control.
void SetSR(int index, u32 value) {
DEBUG_LOG(POWERPC, "%08x: MMU: Segment register %i set to %08x", PowerPC::ppcState.pc, index, value);
PowerPC::ppcState.sr[index] = value;
}
void mtsr(UGeckoInstruction _inst)
{
int index = _inst.SR;
u32 value = m_GPR[_inst.RS];
SetSR(index, value);
}
// segment register
void mtsrin(UGeckoInstruction _inst)
{
int index = m_GPR[_inst.RB] & 0xF;
PowerPC::ppcState.sr[index] = m_GPR[_inst.RS];
int index = (m_GPR[_inst.RB] >> 28) & 0xF;
u32 value = m_GPR[_inst.RS];
SetSR(index, value);
}
void mftb(UGeckoInstruction _inst)
{
int iIndex = (_inst.TBR >> 5) | ((_inst.TBR & 0x1F) << 5);
@ -349,7 +356,7 @@ void mtspr(UGeckoInstruction _inst)
// PanicAlert("Locked cache enabled!");
if (HID2.PSE == 0)
PanicAlert("WARNING: PSE in HID2 isnt set");
PanicAlert("WARNING: PSE (paired single enable) in HID2 was unset");
// bool WriteGatherPipeEnable = (bool)HID2.WPE; //TODO?
// bool LockedCacheEnable = (bool)HID2.LCE;
@ -416,6 +423,7 @@ void mtspr(UGeckoInstruction _inst)
}
break;
// Page table base etc
case SPR_SDR:
Memory::SDRUpdated();
break;