From 4f1db9a00f172895ce4830281f3b18c3eb91d7f2 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi <18193363+elad335@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:15:02 +0300 Subject: [PATCH] Unix/Savestates: Fix savestates destination --- rpcs3/Emu/savestate_utils.cpp | 6 +++--- rpcs3/rpcs3qt/main_window.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/savestate_utils.cpp b/rpcs3/Emu/savestate_utils.cpp index 3f2d1976ee..46302e3ea5 100644 --- a/rpcs3/Emu/savestate_utils.cpp +++ b/rpcs3/Emu/savestate_utils.cpp @@ -225,7 +225,7 @@ std::string get_savestate_file(std::string_view title_id, std::string_view boot_ if (abs_id == -1 && rel_id == -1) { // Return directory - return fs::get_cache_dir() + "savestates/" + title + "/"; + return fs::get_config_dir() + "savestates/" + title + "/"; } ensure(rel_id < 0 || abs_id >= 0, "Unimplemented!"); @@ -236,7 +236,7 @@ std::string get_savestate_file(std::string_view title_id, std::string_view boot_ // While not needing to keep a 59 chars long suffix at all times for this purpose const char prefix = ::at32("0123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"sv, save_id.size()); - std::string path = fs::get_cache_dir() + "/savestates/" + title + "/" + title + '_' + prefix + '_' + save_id + ".SAVESTAT"; + std::string path = fs::get_config_dir() + "/savestates/" + title + "/" + title + '_' + prefix + '_' + save_id + ".SAVESTAT"; if (std::string path_compressed = path + ".zst"; fs::is_file(path_compressed)) { @@ -278,7 +278,7 @@ bool boot_last_savestate(bool testing) { if (!g_cfg.savestate.suspend_emu && !Emu.GetTitleID().empty() && (Emu.IsRunning() || Emu.GetStatus() == system_state::paused)) { - const std::string save_dir = fs::get_cache_dir() + "savestates/" + Emu.GetTitleID() + '/'; + const std::string save_dir = get_savestate_file(Emu.GetTitleID(), Emu.GetBoot(), -1, -1); std::string savestate_path; s64 mtime = smin; diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index e6ebcc72ae..e79a2e3489 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -620,7 +620,7 @@ void main_window::BootSavestate() stopped = true; } - const QString file_path = QFileDialog::getOpenFileName(this, tr("Select Savestate To Boot"), qstr(fs::get_cache_dir() + "savestates/"), tr( + const QString file_path = QFileDialog::getOpenFileName(this, tr("Select Savestate To Boot"), qstr(fs::get_config_dir() + "savestates/"), tr( "Savestate files (*.SAVESTAT *.SAVESTAT.zst *.SAVESTAT.gz);;" "All files (*.*)"), Q_NULLPTR, QFileDialog::DontResolveSymlinks);