summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorfires.gc <fires.gc@gmail.com>2008-10-15 12:47:43 +0000
committerfires.gc <fires.gc@gmail.com>2008-10-15 12:47:43 +0000
commitbac3f878e86850e04aaef916024f4e27b948dbd6 (patch)
tree5c6541c3a6ce4cce44ae7f9112ccc7186370520a /Source/Core
parent8e3bd6781e1416b1d8f1a15b39eab767849d5f58 (diff)
added support for instruction read exceptions in interpreter
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@877 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/HW/Memmap.cpp15
-rw-r--r--Source/Core/Core/Src/HW/Memmap.h2
-rw-r--r--Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp6
3 files changed, 18 insertions, 5 deletions
diff --git a/Source/Core/Core/Src/HW/Memmap.cpp b/Source/Core/Core/Src/HW/Memmap.cpp
index e9b69ee923..f76dc760d5 100644
--- a/Source/Core/Core/Src/HW/Memmap.cpp
+++ b/Source/Core/Core/Src/HW/Memmap.cpp
@@ -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)
{
diff --git a/Source/Core/Core/Src/HW/Memmap.h b/Source/Core/Core/Src/HW/Memmap.h
index ac7a8427cf..87d383ed33 100644
--- a/Source/Core/Core/Src/HW/Memmap.h
+++ b/Source/Core/Core/Src/HW/Memmap.h
@@ -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);
diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
index 21957fad4a..743eb16da9 100644
--- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
+++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter.cpp
@@ -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