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.
This commit is contained in:
Lioncash 2018-04-01 23:22:28 -04:00
parent a013638dcb
commit de0ed1a5fb
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
1 changed files with 10 additions and 2 deletions

View File

@ -24,6 +24,12 @@ void GenerateAlignmentException(u32 address)
PowerPC::ppcState.Exceptions |= EXCEPTION_ALIGNMENT; PowerPC::ppcState.Exceptions |= EXCEPTION_ALIGNMENT;
PowerPC::ppcState.spr[SPR_DAR] = address; 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) u32 Interpreter::Helper_Get_EA(const UGeckoInstruction inst)
@ -431,7 +437,8 @@ void Interpreter::eciwx(UGeckoInstruction inst)
if (!(PowerPC::ppcState.spr[SPR_EAR] & 0x80000000)) if (!(PowerPC::ppcState.spr[SPR_EAR] & 0x80000000))
{ {
PowerPC::ppcState.Exceptions |= EXCEPTION_DSI; GenerateDSIException(EA);
return;
} }
if (EA & 3) if (EA & 3)
@ -449,7 +456,8 @@ void Interpreter::ecowx(UGeckoInstruction inst)
if (!(PowerPC::ppcState.spr[SPR_EAR] & 0x80000000)) if (!(PowerPC::ppcState.spr[SPR_EAR] & 0x80000000))
{ {
PowerPC::ppcState.Exceptions |= EXCEPTION_DSI; GenerateDSIException(EA);
return;
} }
if (EA & 3) if (EA & 3)