* Fixed a careless mistake of mine with SetJumpTarget

* Changed ABI_PARAM back to ECX/EDX.  Thanks for the tip, Soren
* Reverted r6035

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6036 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau
2010-08-02 14:06:27 +00:00
parent bbc69a64ad
commit f7c4670c9f
2 changed files with 8 additions and 27 deletions

View File

@ -413,37 +413,22 @@ void Jit64::stX(UGeckoInstruction inst)
//Still here? Do regular path. //Still here? Do regular path.
gpr.FlushLockX(ECX, EDX); gpr.FlushLockX(ECX, EDX);
gpr.Lock(a); gpr.Lock(s, a);
if (update && offset)
gpr.LoadToX64(a, true, true);
MOV(32, R(EDX), gpr.R(a)); MOV(32, R(EDX), gpr.R(a));
MOV(32, R(ECX), gpr.R(s)); MOV(32, R(ECX), gpr.R(s));
if (offset) SafeWriteRegToReg(ECX, EDX, accessSize, offset);
ADD(32, R(EDX), Imm32((u32)offset));
if (update && offset) if (update && offset)
{ {
MEMCHECK_START MEMCHECK_START
ADD(32, gpr.R(a), Imm32(offset)); ADD(32, gpr.R(a), Imm32((u32)offset));
MEMCHECK_END MEMCHECK_END
} }
TEST(32, R(EDX), Imm32(0x0C000000));
FixupBranch unsafe_addr = J_CC(CC_NZ);
BSWAP(accessSize, ECX);
#ifdef _M_X64
MOV(accessSize, MComplex(RBX, EDX, SCALE_1, 0), R(ECX));
#else
AND(32, R(EDX), Imm32(Memory::MEMVIEW32_MASK));
MOV(accessSize, MDisp(EDX, (u32)Memory::base), R(ECX));
#endif
FixupBranch skip_call = J();
SetJumpTarget(unsafe_addr);
switch (accessSize)
{
case 32: ABI_CallFunctionRR(thunks.ProtectFunction((void *)&Memory::Write_U32, 2), ECX, EDX); break;
case 16: ABI_CallFunctionRR(thunks.ProtectFunction((void *)&Memory::Write_U16, 2), ECX, EDX); break;
case 8: ABI_CallFunctionRR(thunks.ProtectFunction((void *)&Memory::Write_U8, 2), ECX, EDX); break;
}
SetJumpTarget(skip_call);
gpr.UnlockAll(); gpr.UnlockAll();
gpr.UnlockAllX(); gpr.UnlockAllX();
} }

View File

@ -175,11 +175,7 @@ void EmuCodeBlock::SafeWriteRegToReg(X64Reg reg_value, X64Reg reg_addr, int acce
case 8: ABI_CallFunctionRR(thunks.ProtectFunction((void *)&Memory::Write_U8, 2), reg_value, reg_addr); break; case 8: ABI_CallFunctionRR(thunks.ProtectFunction((void *)&Memory::Write_U8, 2), reg_value, reg_addr); break;
} }
FixupBranch exit = J(); FixupBranch exit = J();
if (!Core::g_CoreStartupParameter.bMMU || Core::g_CoreStartupParameter.bUseFastMem)
{
SetJumpTarget(fast); SetJumpTarget(fast);
}
UnsafeWriteRegToReg(reg_value, reg_addr, accessSize, 0, swap); UnsafeWriteRegToReg(reg_value, reg_addr, accessSize, 0, swap);
SetJumpTarget(exit); SetJumpTarget(exit);
} }