Avoid clearing the jit cache on savestate.

Downside: saving state could "fix" some issues with games detecting jit,
which won't happen anymore.

However, it's now faster to savestate.
This commit is contained in:
Unknown W. Brackets committed 2013-09-29 14:26:13 -07:00
1 parent 0aa263511d
commit 394d91371f
3 files changed
+61 -6

No files matched your search

+11 -5
View File
@@ -75,7 +75,17 @@ namespace SaveState
// Gotta do CoreTiming first since we'll restore into it.
CoreTiming::DoState(p);
Memory::DoState(p);
// Memory is a bit tricky when jit is enabled, since there's emuhacks in it.
if (MIPSComp::jit && p.mode == p.MODE_WRITE)
{
auto blocks = MIPSComp::jit->GetBlockCache();
auto saved = blocks->SaveAndClearEmuHackOps();
Memory::DoState(p);
blocks->RestoreSavedEmuHackOps(saved);
}
else
Memory::DoState(p);
MemoryStick_DoState(p);
currentMIPS->DoState(p);
HLEDoState(p);
@@ -245,8 +255,6 @@ namespace SaveState
switch (op.type)
{
case SAVESTATE_LOAD:
if (MIPSComp::jit)
MIPSComp::jit->ClearCache();
INFO_LOG(COMMON, "Loading state from %s", op.filename.c_str());
result = CChunkFileReader::Load(op.filename, REVISION, PPSSPP_GIT_VERSION, state, &reason);
if (result == CChunkFileReader::ERROR_NONE) {
@@ -262,8 +270,6 @@ namespace SaveState
break;
case SAVESTATE_SAVE:
if (MIPSComp::jit)
MIPSComp::jit->ClearCache();
INFO_LOG(COMMON, "Saving state to %s", op.filename.c_str());
result = CChunkFileReader::Save(op.filename, REVISION, PPSSPP_GIT_VERSION, state);
if (result == CChunkFileReader::ERROR_NONE) {