Refresh the save slots if either the crc *or* the serial number are different. (Needed for ps1 saves.)

This commit is contained in:
Shanoah Alkire committed 2018-10-28 16:03:50 -07:00
1 parent fc1d9aef09
commit 8f52d82e58
2 files changed
+8 -2

No files matched your search

+6
View File
@@ -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;
}
+2 -2
View File
@@ -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)