__KernelModuleDoState: Only apply function replacement on state load. Improves performance of rewind states

This commit is contained in:
Henrik Rydgård
2026-07-14 20:31:39 +02:00
parent 8721e11694
commit a6516c8d66
2 changed files with 9 additions and 11 deletions
+8 -10
View File
@@ -434,18 +434,18 @@ static std::set<SceUID> loadedModules;
// STATE END
//////////////////////////////////////////////////////////////////////////
static void __KernelModuleInit()
{
static void __KernelModuleInit() {
actionAfterModule = __KernelRegisterActionType(AfterModuleEntryCall::Create);
}
void __KernelModuleDoState(PointerWrap &p)
{
void __KernelModuleDoState(PointerWrap &p) {
auto s = p.Section("sceKernelModule", 1, 2);
if (!s)
return;
Do(p, actionAfterModule);
// TODO: Only needed during read, right?
__KernelRestoreActionType(actionAfterModule, AfterModuleEntryCall::Create);
if (s >= 2) {
@@ -463,15 +463,13 @@ void __KernelModuleDoState(PointerWrap &p)
}
}
}
}
if (g_Config.bFuncReplacements) {
MIPSAnalyst::ReplaceFunctions();
if (g_Config.bFuncReplacements) {
MIPSAnalyst::ReplaceFunctions();
}
}
}
void __KernelModuleShutdown()
{
void __KernelModuleShutdown() {
loadedModules.clear();
MIPSAnalyst::Reset();
HLEPlugins::Unload();