mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-29 00:59:56 -06:00
JIT: handle STR post with rd == rn
fixes Zelda Four Swords
This commit is contained in:
@ -98,7 +98,9 @@ void Compiler::A_Comp_MRS()
|
||||
MOV(32, rd, R(RSCRATCH3));
|
||||
}
|
||||
else
|
||||
{
|
||||
MOV(32, rd, R(RCPSR));
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateModeTrampoline(ARM* arm, u32 oldmode, u32 newmode)
|
||||
@ -703,7 +705,9 @@ JitBlockEntry Compiler::CompileBlock(ARM* cpu, bool thumb, FetchedInstr instrs[]
|
||||
ABI_CallFunction(InterpretTHUMB[CurInstr.Info.Kind]);
|
||||
}
|
||||
else
|
||||
{
|
||||
(this->*comp)();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -724,7 +728,7 @@ JitBlockEntry Compiler::CompileBlock(ARM* cpu, bool thumb, FetchedInstr instrs[]
|
||||
}
|
||||
else
|
||||
{
|
||||
IrregularCycles = false;
|
||||
IrregularCycles = comp == NULL;
|
||||
|
||||
FixupBranch skipExecute;
|
||||
if (cond < 0xE)
|
||||
@ -737,7 +741,9 @@ JitBlockEntry Compiler::CompileBlock(ARM* cpu, bool thumb, FetchedInstr instrs[]
|
||||
ABI_CallFunction(InterpretARM[CurInstr.Info.Kind]);
|
||||
}
|
||||
else
|
||||
{
|
||||
(this->*comp)();
|
||||
}
|
||||
|
||||
Comp_SpecialBranchBehaviour(true);
|
||||
|
||||
@ -755,7 +761,9 @@ JitBlockEntry Compiler::CompileBlock(ARM* cpu, bool thumb, FetchedInstr instrs[]
|
||||
SetJumpTarget(skipFailed);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetJumpTarget(skipExecute);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -130,6 +130,12 @@ void Compiler::Comp_MemAccess(int rd, int rn, const Op2& op2, int size, int flag
|
||||
if (Thumb && rn == 15)
|
||||
rnMapped = Imm32(R15 & ~0x2);
|
||||
|
||||
if (flags & memop_Store && flags & (memop_Post|memop_Writeback) && rd == rn)
|
||||
{
|
||||
MOV(32, R(RSCRATCH4), rdMapped);
|
||||
rdMapped = R(RSCRATCH4);
|
||||
}
|
||||
|
||||
X64Reg finalAddr = RSCRATCH3;
|
||||
if (flags & memop_Post)
|
||||
{
|
||||
@ -282,13 +288,15 @@ void Compiler::Comp_MemAccess(int rd, int rn, const Op2& op2, int size, int flag
|
||||
{
|
||||
if (Num == 0)
|
||||
{
|
||||
// on Windows param 3 is R8 which is also scratch 4 which can be used for rd
|
||||
if (flags & memop_Store)
|
||||
MOV(32, R(ABI_PARAM3), rdMapped);
|
||||
|
||||
MOV(64, R(ABI_PARAM2), R(RCPU));
|
||||
if (ABI_PARAM1 != RSCRATCH3)
|
||||
MOV(32, R(ABI_PARAM1), R(RSCRATCH3));
|
||||
if (flags & memop_Store)
|
||||
{
|
||||
MOV(32, R(ABI_PARAM3), rdMapped);
|
||||
|
||||
switch (size | NDS::ConsoleType)
|
||||
{
|
||||
case 32: CALL((void*)&SlowWrite9<u32, 0>); break;
|
||||
|
Reference in New Issue
Block a user