Fix some replace-related bugs. Add "jal" replace inlining, not activated.

This commit is contained in:
Henrik Rydgard committed 2013-12-18 16:27:23 +01:00
1 parent b2d0f37d96
commit 1e300447e1
8 files changed
+90 -26

No files matched your search

+22 -4
View File
@@ -171,15 +171,22 @@ void Clear()
memset(m_pVRAM, 0, VRAM_SIZE);
}
Opcode Read_Instruction(u32 address)
{
Opcode inst = Opcode(Read_U32(address));
if (MIPS_IS_RUNBLOCK(inst.encoding) && MIPSComp::jit)
{
if (MIPS_IS_RUNBLOCK(inst.encoding) && MIPSComp::jit) {
JitBlockCache *bc = MIPSComp::jit->GetBlockCache();
int block_num = bc->GetBlockNumberFromEmuHackOp(inst, true);
if (block_num >= 0) {
return bc->GetOriginalFirstOp(block_num);
inst = bc->GetOriginalFirstOp(block_num);
/*
u32 op;
if (GetReplacedOpAt(address, &op)) {
return Opcode(op);
}*/
return inst;
} else {
return inst;
}
@@ -197,7 +204,18 @@ Opcode Read_Instruction(u32 address)
Opcode Read_Opcode_JIT(u32 address)
{
return Read_Instruction(address);
Opcode inst = Opcode(Read_U32(address));
if (MIPS_IS_RUNBLOCK(inst.encoding) && MIPSComp::jit) {
JitBlockCache *bc = MIPSComp::jit->GetBlockCache();
int block_num = bc->GetBlockNumberFromEmuHackOp(inst, true);
if (block_num >= 0) {
return bc->GetOriginalFirstOp(block_num);
} else {
return inst;
}
} else {
return inst;
}
}
// WARNING! No checks!