Skip to content

Commit

Permalink
win32: use selected bank for slot save/load, display both slot and bank
Browse files Browse the repository at this point in the history
in info string (#953)
  • Loading branch information
OV2 committed Sep 27, 2024
1 parent 0727b4a commit 72e4946
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions win32/wlanguage.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,7 @@ Nintendo is a trademark.")

// Save Messages

#define FREEZE_INFO_SET_SLOT_N "Set save slot %03d [%s]"
#define FREEZE_INFO_SET_BANK_N "Set save bank %03d"
#define FREEZE_INFO_SET_SLOT_N "Set save slot %03d, bank %03d [%s]"

// AVI Messages

Expand Down
14 changes: 5 additions & 9 deletions win32/wsnes9x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ static void ShowStatusSlotInfo()
if (stat(filename, &stats) == 0)
exists = true;

sprintf(str, FREEZE_INFO_SET_SLOT_N, GUI.CurrentSaveSlot, exists ? "used" : "empty");
sprintf(str, FREEZE_INFO_SET_SLOT_N, GUI.CurrentSaveSlot, GUI.CurrentSaveBank, exists ? "used" : "empty");
S9xSetInfoString(str);
}

Expand Down Expand Up @@ -885,13 +885,13 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam)
if(wParam == CustomKeys.SlotSave.key
&& modifiers == CustomKeys.SlotSave.modifiers)
{
FreezeUnfreezeSlot (GUI.CurrentSaveSlot, true);
FreezeUnfreezeSlot (GUI.CurrentSaveBank * SAVE_SLOTS_PER_BANK + GUI.CurrentSaveSlot, true);
hitHotKey = true;
}
if(wParam == CustomKeys.SlotLoad.key
&& modifiers == CustomKeys.SlotLoad.modifiers)
{
FreezeUnfreezeSlot (GUI.CurrentSaveSlot, false);
FreezeUnfreezeSlot (GUI.CurrentSaveBank * SAVE_SLOTS_PER_BANK + GUI.CurrentSaveSlot, false);
hitHotKey = true;
}
if(wParam == CustomKeys.DialogSave.key
Expand Down Expand Up @@ -935,9 +935,7 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam)
if (GUI.CurrentSaveBank > LAST_SAVE_BANK)
GUI.CurrentSaveBank = 0;

static char str[64];
sprintf(str, FREEZE_INFO_SET_BANK_N, GUI.CurrentSaveBank);
S9xSetInfoString(str);
ShowStatusSlotInfo();

hitHotKey = true;
}
Expand All @@ -948,9 +946,7 @@ int HandleKeyMessage(WPARAM wParam, LPARAM lParam)
if (GUI.CurrentSaveBank < 0)
GUI.CurrentSaveBank = 9;

static char str[64];
sprintf(str, FREEZE_INFO_SET_BANK_N, GUI.CurrentSaveBank);
S9xSetInfoString(str);
ShowStatusSlotInfo();

hitHotKey = true;
}
Expand Down

0 comments on commit 72e4946

Please sign in to comment.