mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Reset JIT before saving/loading state
This commit is contained in:
parent
90e3042b17
commit
f9133c1a56
5 changed files with 15 additions and 8 deletions
|
@ -94,8 +94,10 @@ public:
|
|||
|
||||
JitBlockCache *GetBlockCache() { return &blocks; }
|
||||
AsmRoutineManager &Asm() { return asm_; }
|
||||
private:
|
||||
|
||||
void ClearCache();
|
||||
|
||||
private:
|
||||
void FlushAll();
|
||||
|
||||
void WriteExit(u32 destination, int exit_num);
|
||||
|
|
|
@ -93,8 +93,9 @@ public:
|
|||
|
||||
JitBlockCache *GetBlockCache() { return &blocks; }
|
||||
AsmRoutineManager &Asm() { return asm_; }
|
||||
private:
|
||||
|
||||
void ClearCache();
|
||||
private:
|
||||
void FlushAll();
|
||||
|
||||
void WriteExit(u32 destination, int exit_num);
|
||||
|
|
|
@ -104,7 +104,6 @@ JitBlockCache::~JitBlockCache()
|
|||
Shutdown();
|
||||
}
|
||||
|
||||
|
||||
// This clears the JIT cache. It's called from JitCache.cpp when the JIT cache
|
||||
// is full and when saving and loading states.
|
||||
void JitBlockCache::Clear()
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "HW/MemoryStick.h"
|
||||
#include "MemMap.h"
|
||||
#include "MIPS/MIPS.h"
|
||||
#include "MIPS/JitCommon/JitCommon.h"
|
||||
#include "System.h"
|
||||
|
||||
namespace SaveState
|
||||
|
@ -95,12 +96,12 @@ namespace SaveState
|
|||
CoreTiming::ScheduleEvent_Threadsafe(0, timer);
|
||||
}
|
||||
|
||||
void Load(std::string &filename, Callback callback)
|
||||
void Load(const std::string &filename, Callback callback)
|
||||
{
|
||||
Enqueue(Operation(SAVESTATE_LOAD, filename, callback));
|
||||
}
|
||||
|
||||
void Save(std::string &filename, Callback callback)
|
||||
void Save(const std::string &filename, Callback callback)
|
||||
{
|
||||
Enqueue(Operation(SAVESTATE_SAVE, filename, callback));
|
||||
}
|
||||
|
@ -132,11 +133,15 @@ 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, state);
|
||||
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, state);
|
||||
break;
|
||||
|
|
|
@ -29,11 +29,11 @@ namespace SaveState
|
|||
|
||||
// Load the specified file into the current state (async.)
|
||||
// Warning: callback will be called on a different thread.
|
||||
void Load(std::string &filename, Callback callback = NULL);
|
||||
void Load(const std::string &filename, Callback callback = NULL);
|
||||
// Save the current state to the specified file (async.)
|
||||
// Warning: callback will be called on a different thread.
|
||||
void Save(std::string &filename, Callback callback = NULL);
|
||||
void Save(const std::string &filename, Callback callback = NULL);
|
||||
// For testing / automated tests. Runs a save state verification pass (async.)
|
||||
// Warning: callback will be called on a different thread.
|
||||
void Verify(Callback callback = NULL);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue