mirror of
https://github.com/libretro/ppsspp.git
synced 2025-01-23 17:45:04 +00:00
Fix --state not loading a savestate on startup.
Was scheduling some random event instead after 883f61e3ddafc0de17cb78f355f860e8ce4406a6.
This commit is contained in:
parent
fb487ded17
commit
65ddd4d731
@ -58,6 +58,7 @@ namespace SaveState
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int timer;
|
static int timer;
|
||||||
|
static bool needsProcess = false;
|
||||||
static std::vector<Operation> pending;
|
static std::vector<Operation> pending;
|
||||||
static std::recursive_mutex mutex;
|
static std::recursive_mutex mutex;
|
||||||
|
|
||||||
@ -93,8 +94,10 @@ namespace SaveState
|
|||||||
// Warning: this may run on a different thread.
|
// Warning: this may run on a different thread.
|
||||||
Process(0, 0);
|
Process(0, 0);
|
||||||
}
|
}
|
||||||
else
|
else if (__KernelIsRunning())
|
||||||
CoreTiming::ScheduleEvent_Threadsafe(0, timer);
|
CoreTiming::ScheduleEvent_Threadsafe(0, timer);
|
||||||
|
else
|
||||||
|
needsProcess = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Load(const std::string &filename, Callback callback, void *cbUserData)
|
void Load(const std::string &filename, Callback callback, void *cbUserData)
|
||||||
@ -249,5 +252,12 @@ namespace SaveState
|
|||||||
timer = CoreTiming::RegisterEvent("SaveState", Process);
|
timer = CoreTiming::RegisterEvent("SaveState", Process);
|
||||||
// Make sure there's a directory for save slots
|
// Make sure there's a directory for save slots
|
||||||
pspFileSystem.MkDir("ms0:/PSP/PPSSPP_STATE");
|
pspFileSystem.MkDir("ms0:/PSP/PPSSPP_STATE");
|
||||||
|
|
||||||
|
std::lock_guard<std::recursive_mutex> guard(mutex);
|
||||||
|
if (needsProcess)
|
||||||
|
{
|
||||||
|
CoreTiming::ScheduleEvent(0, timer);
|
||||||
|
needsProcess = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user