summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-04-01 23:22:28 -0400
committerLioncash <mathew1800@gmail.com>2018-04-02 08:34:32 -0400
commitde0ed1a5fba7790212102f2920ea2a06b64c773f (patch)
tree07453778c965748741d5059d8d8b1789f7fa435d /Source/Core
parenta013638dcb9db5046443f4050117ffe7cbb1de4f (diff)
Interpreter_LoadStore: Update the DAR if a DSI exception occurs in eciwx and ecowx
Also once a DSI exception occurs, execution is supposed to leave the instruction immediately. It doesn't finish execution.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp
index d090142287..85aac4f524 100644
--- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp
+++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStore.cpp
@@ -24,6 +24,12 @@ void GenerateAlignmentException(u32 address)
PowerPC::ppcState.Exceptions |= EXCEPTION_ALIGNMENT;
PowerPC::ppcState.spr[SPR_DAR] = address;
}
+
+void GenerateDSIException(u32 address)
+{
+ PowerPC::ppcState.Exceptions |= EXCEPTION_DSI;
+ PowerPC::ppcState.spr[SPR_DAR] = address;
+}
}
u32 Interpreter::Helper_Get_EA(const UGeckoInstruction inst)
@@ -431,7 +437,8 @@ void Interpreter::eciwx(UGeckoInstruction inst)
if (!(PowerPC::ppcState.spr[SPR_EAR] & 0x80000000))
{
- PowerPC::ppcState.Exceptions |= EXCEPTION_DSI;
+ GenerateDSIException(EA);
+ return;
}
if (EA & 3)
@@ -449,7 +456,8 @@ void Interpreter::ecowx(UGeckoInstruction inst)
if (!(PowerPC::ppcState.spr[SPR_EAR] & 0x80000000))
{
- PowerPC::ppcState.Exceptions |= EXCEPTION_DSI;
+ GenerateDSIException(EA);
+ return;
}
if (EA & 3)