Add the option to hook, rather than replace, funcs.

This can be useful for debugging or developing translations/game hacks,
and also gives us options when dealing with GLES incompatibilities.
This commit is contained in:
Unknown W. Brackets committed 2014-05-31 10:03:00 -07:00
1 parent 72eb15f282
commit f489694515
6 files changed
+93 -44

No files matched your search

+8 -3
View File
@@ -1022,11 +1022,16 @@ namespace MIPSInt
const ReplacementTableEntry *entry = GetReplacementFunc(index);
if (entry && entry->replaceFunc) {
entry->replaceFunc();
if (entry->flags & (REPFLAG_HOOKENTER | REPFLAG_HOOKEXIT)) {
// Interpret the original instruction under the hook.
MIPSInterpret(Memory::Read_Instruction(PC, true));
} else {
PC = currentMIPS->r[MIPS_REG_RA];
}
} else {
ERROR_LOG(CPU, "Bad replacement function index %i", index);
}
PC = currentMIPS->r[MIPS_REG_RA];
}
}