diff --git a/src/core/system.cpp b/src/core/system.cpp index 169b6f635..2fa4eac2b 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1000,13 +1000,26 @@ bool System::SaveState(const char* filename, bool backup_existing_save) } else { - Host::AddFormattedOSDMessage(5.0f, Host::TranslateString("OSDMessage", "State saved to '%s'."), filename); + const std::string display_name(FileSystem::GetDisplayNameFromPath(filename)); + Host::AddIconOSDMessage("save_state", ICON_FA_SAVE, + fmt::format(Host::TranslateString("OSDMessage", "State saved to '{}'.").GetCharArray(), + Path::GetFileName(display_name)), + 5.0f); stream->Commit(); } return result; } +bool System::SaveResumeState() +{ + if (s_running_game_code.empty()) + return false; + + const std::string path(GetGameSaveStateFileName(s_running_game_code, -1)); + return SaveState(path.c_str(), false); +} + bool System::BootSystem(SystemBootParameters parameters) { if (!parameters.save_state.empty()) @@ -3522,11 +3535,8 @@ void System::ShutdownSystem(bool save_resume_state) if (!IsValid()) return; - if (save_resume_state && !s_running_game_code.empty()) - { - std::string path(GetGameSaveStateFileName(s_running_game_code, -1)); - SaveState(path.c_str(), false); - } + if (save_resume_state) + SaveResumeState(); DestroySystem(); } diff --git a/src/core/system.h b/src/core/system.h index b77f02ff0..b32cc8ff5 100644 --- a/src/core/system.h +++ b/src/core/system.h @@ -199,6 +199,7 @@ void ResetSystem(); /// Loads state from the specified filename. bool LoadState(const char* filename); bool SaveState(const char* filename, bool backup_existing_save); +bool SaveResumeState(); /// Runs the VM until the CPU execution is canceled. void Execute();