diff --git a/win32/wlanguage.h b/win32/wlanguage.h index 8577f1a5..c74a64d8 100644 --- a/win32/wlanguage.h +++ b/win32/wlanguage.h @@ -360,7 +360,7 @@ Nintendo is a trademark.") // Save Messages -#define FREEZE_INFO_SET_SLOT_N "Set save slot %03d" +#define FREEZE_INFO_SET_SLOT_N "Set save slot %03d [%s]" #define FREEZE_INFO_SET_BANK_N "Set save bank %03d" // AVI Messages diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index f25d0dc8..774ff7cd 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -727,6 +727,22 @@ static char InfoString [100]; static uint32 prevPadReadFrame = (uint32)-1; static bool skipNextFrameStop = false; +static void ShowStatusSlotInfo() +{ + static char str[64]; + + char filename[_MAX_PATH + 1] + GetSlotFilename(GUI.CurrentSaveBank * SAVE_SLOTS_PER_BANK + GUI.CurrentSaveSlot, filename); + + bool exists = false; + struct stat stats; + if (stat(filename, &stats) == 0) + exists = true; + + sprintf(str, FREEZE_INFO_SET_SLOT_N, GUI.CurrentSaveSlot, exists ? "used" : "empty"); + S9xSetInfoString(str); +} + int HandleKeyMessage(WPARAM wParam, LPARAM lParam) { // update toggles @@ -889,9 +905,7 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam) if(GUI.CurrentSaveSlot > LAST_SAVE_SLOT_IN_BANK) GUI.CurrentSaveSlot = 0; - static char str [64]; - sprintf(str, FREEZE_INFO_SET_SLOT_N, GUI.CurrentSaveSlot); - S9xSetInfoString(str); + ShowStatusSlotInfo(); hitHotKey = true; } @@ -902,9 +916,7 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam) if(GUI.CurrentSaveSlot < 0) GUI.CurrentSaveSlot = 9; - static char str [64]; - sprintf(str, FREEZE_INFO_SET_SLOT_N, GUI.CurrentSaveSlot); - S9xSetInfoString(str); + ShowStatusSlotInfo(); hitHotKey = true; } @@ -1270,9 +1282,7 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam) { GUI.CurrentSaveSlot = GUI.CurrentSaveBank * SAVE_SLOTS_PER_BANK + i; - static char str [64]; - sprintf(str, FREEZE_INFO_SET_SLOT_N, GUI.CurrentSaveSlot); - S9xSetInfoString(str); + ShowStatusSlotInfo(); hitHotKey = true; }