From 8f52d82e580ded03c0a89438c321de66fbea6eb3 Mon Sep 17 00:00:00 2001 From: Shanoah Alkire Date: Sun, 28 Oct 2018 16:03:50 -0700 Subject: [PATCH] Refresh the save slots if either the crc *or* the serial number are different. (Needed for ps1 saves.) --- pcsx2/gui/Saveslots.h | 6 ++++++ pcsx2/gui/UpdateUI.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pcsx2/gui/Saveslots.h b/pcsx2/gui/Saveslots.h index 0eacfc05d4..8dc30a7df2 100644 --- a/pcsx2/gui/Saveslots.h +++ b/pcsx2/gui/Saveslots.h @@ -36,6 +36,8 @@ //#define SAVESLOT_LOGS #endif +extern wxString DiscSerial; + class Saveslot { public: @@ -43,6 +45,7 @@ public: bool empty; wxDateTime updated; u32 crc; + wxString serialName; bool menu_update, invalid_cache; Saveslot() @@ -51,6 +54,7 @@ public: empty = true; updated = wxInvalidDateTime; crc = ElfCRC; + serialName = DiscSerial; menu_update = false; invalid_cache = true; } @@ -61,6 +65,7 @@ public: empty = true; updated = wxInvalidDateTime; crc = ElfCRC; + serialName = DiscSerial; menu_update = false; invalid_cache = true; } @@ -82,6 +87,7 @@ public: empty = !isUsed(); updated = GetTimestamp(); crc = ElfCRC; + serialName = DiscSerial; invalid_cache = false; } diff --git a/pcsx2/gui/UpdateUI.cpp b/pcsx2/gui/UpdateUI.cpp index 33f259a9dd..f9edebcb77 100644 --- a/pcsx2/gui/UpdateUI.cpp +++ b/pcsx2/gui/UpdateUI.cpp @@ -50,8 +50,8 @@ static void _SaveLoadStuff(bool enabled) int load_menu_item = MenuId_State_Load01 + i + 1; int save_menu_item = MenuId_State_Save01 + i + 1; - // We need to reload the file information if the crc changed. - if (saveslot_cache[i].crc != ElfCRC) saveslot_cache[i].invalid_cache = true; + // We need to reload the file information if the crc or serial # changed. + if ((saveslot_cache[i].crc != ElfCRC)|| (saveslot_cache[i].serialName != DiscSerial)) saveslot_cache[i].invalid_cache = true; // Either the cache needs updating, or the menu items do, or both. if (saveslot_cache[i].menu_update || saveslot_cache[i].invalid_cache)