Merge pull request #14708 from unknownbrackets/ui-crash

Add Reset button on crash screen, allow load state and related
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2021-08-09 09:32:55 +02:00
commit a0225a5e7a
9 files changed
+53 -11

No files matched your search

+9
View File
@@ -335,11 +335,15 @@ namespace SaveState
void Load(const Path &filename, int slot, Callback callback, void *cbUserData)
{
if (coreState == CoreState::CORE_RUNTIME_ERROR)
Core_EnableStepping(true);
Enqueue(Operation(SAVESTATE_LOAD, filename, slot, callback, cbUserData));
}
void Save(const Path &filename, int slot, Callback callback, void *cbUserData)
{
if (coreState == CoreState::CORE_RUNTIME_ERROR)
Core_EnableStepping(true);
Enqueue(Operation(SAVESTATE_SAVE, filename, slot, callback, cbUserData));
}
@@ -350,6 +354,8 @@ namespace SaveState
void Rewind(Callback callback, void *cbUserData)
{
if (coreState == CoreState::CORE_RUNTIME_ERROR)
Core_EnableStepping(true);
Enqueue(Operation(SAVESTATE_REWIND, Path(), -1, callback, cbUserData));
}
@@ -866,6 +872,7 @@ namespace SaveState
callbackMessage = op.slot != LOAD_UNDO_SLOT ? sc->T("Loaded State") : sc->T("State load undone");
callbackResult = TriggerLoadWarnings(callbackMessage);
hasLoadedState = true;
Core_ResetException();
if (!slot_prefix.empty())
callbackMessage = slot_prefix + callbackMessage;
@@ -944,6 +951,7 @@ namespace SaveState
callbackMessage = sc->T("Loaded State");
callbackResult = Status::SUCCESS;
hasLoadedState = true;
Core_ResetException();
} else if (result == CChunkFileReader::ERROR_BROKEN_STATE) {
// Cripes. Good news is, we might have more. Let's try those too, better than a reset.
if (HandleLoadFailure()) {
@@ -951,6 +959,7 @@ namespace SaveState
callbackMessage = sc->T("Loaded State");
callbackResult = Status::SUCCESS;
hasLoadedState = true;
Core_ResetException();
} else {
callbackMessage = std::string(i18nLoadFailure) + ": " + errorString;
callbackResult = Status::FAILURE;