mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
SaveState: Restore replacements in only one place.
This commit is contained in:
parent
0a98ac43fa
commit
17d94cd358
3 changed files with 8 additions and 3 deletions
|
@ -1652,7 +1652,8 @@ std::map<u32, u32> SaveAndClearReplacements() {
|
|||
std::map<u32, u32> saved;
|
||||
for (auto it = replacedInstructions.begin(), end = replacedInstructions.end(); it != end; ++it) {
|
||||
const u32 addr = it->first;
|
||||
const u32 curInstr = Memory::Read_U32(addr);
|
||||
// This will not retain jit blocks.
|
||||
const u32 curInstr = Memory::Read_Opcode_JIT(addr).encoding;
|
||||
if (MIPS_IS_REPLACEMENT(curInstr)) {
|
||||
saved[addr] = curInstr;
|
||||
Memory::Write_U32(it->second, addr);
|
||||
|
|
|
@ -591,7 +591,7 @@ void Jit::Comp_ReplacementFunc(MIPSOpcode op) {
|
|||
// Not sure about the cause.
|
||||
Memory::Opcode origInstruction = Memory::Read_Instruction(GetCompilerPC(), true);
|
||||
if (origInstruction.encoding == op.encoding) {
|
||||
ERROR_LOG(HLE, "Replacement broken (savestate problem?): %08x", op.encoding);
|
||||
ERROR_LOG(HLE, "Replacement broken (savestate problem?): %08x at %08x", op.encoding, GetCompilerPC());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -316,7 +316,11 @@ namespace SaveState
|
|||
} else {
|
||||
Memory::DoState(p);
|
||||
}
|
||||
RestoreSavedReplacements(savedReplacements);
|
||||
|
||||
// Don't bother restoring if reading, we'll deal with that in KernelModuleDoState.
|
||||
// In theory, different functions might have been runtime loaded in the state.
|
||||
if (p.mode != p.MODE_READ)
|
||||
RestoreSavedReplacements(savedReplacements);
|
||||
|
||||
MemoryStick_DoState(p);
|
||||
currentMIPS->DoState(p);
|
||||
|
|
Loading…
Add table
Reference in a new issue