added support for instruction read exceptions in interpreter

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@877 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc 2008-10-15 12:47:43 +00:00
parent 8e3bd6781e
commit bac3f878e8
3 changed files with 18 additions and 5 deletions

View File

@ -605,6 +605,21 @@ u32 Read_Instruction(const u32 _Address)
return Jit64::GetOriginalCode(_Address);
}
u32 Read_Opcode(const u32 _Address)
{
#ifdef LOGGING
if (_Address == 0x00000000)
{
PanicAlert("Program tried to read from [00000000]");
return 0x00000000;
}
#endif
u32 _var = 0;
ReadFromHardware2(_var, 32, _Address, _Address, FLAG_OPCODE);
return _var;
}
u8 Read_U8(const u32 _Address)
{

View File

@ -95,6 +95,8 @@ namespace Memory
#endif
}
u32 Read_Opcode(const u32 _Address);
//For use by emulator
u8 Read_U8(const u32 _Address);
u16 Read_U16(const u32 _Address);

View File

@ -81,14 +81,10 @@ void patches()
}
void SingleStepInner(void)
{
/* static int count = 0;
count++;
if ((count % 50) == 0)
PluginDSP::DSP_Update(); */
static UGeckoInstruction instCode;
NPC = PC + sizeof(UGeckoInstruction);
instCode.hex = Memory::ReadFast32(PC); // Memory::ReadUnchecked_U32(PC);
instCode.hex = Memory::Read_Opcode(PC);
UReg_MSR& msr = (UReg_MSR&)MSR;
if (msr.FP) //If FPU is enabled, just execute