Win32 - disabled savestate, loadstate, and setsaveslot hotkeys when no rom is loaded.

This commit is contained in:
adelikat 2009-05-23 19:51:51 +00:00
parent 016a543ef3
commit 2ae4e618e5
1 changed files with 32 additions and 23 deletions

View File

@ -112,41 +112,50 @@ void HK_PrintScreen(int param)
void HK_StateSaveSlot(int num) void HK_StateSaveSlot(int num)
{ {
if (!paused) if (romloaded)
{ {
NDS_Pause(); if (!paused)
savestate_slot(num); //Savestate {
NDS_UnPause(); NDS_Pause();
savestate_slot(num); //Savestate
NDS_UnPause();
}
else
savestate_slot(num); //Savestate
lastSaveState = num; //Set last savestate used
SaveStateMessages(num, 0); //Display state loaded message
LoadSaveStateInfo();
} }
else
savestate_slot(num); //Savestate
lastSaveState = num; //Set last savestate used
SaveStateMessages(num, 0); //Display state loaded message
LoadSaveStateInfo();
} }
void HK_StateLoadSlot(int num) void HK_StateLoadSlot(int num)
{ {
BOOL wasPaused = paused; if (romloaded)
NDS_Pause(); {
loadstate_slot(num); //Loadstate BOOL wasPaused = paused;
lastSaveState = num; //Set last savestate used NDS_Pause();
SaveStateMessages(num, 1); //Display state loaded message loadstate_slot(num); //Loadstate
lastSaveState = num; //Set last savestate used
SaveStateMessages(num, 1); //Display state loaded message
Update_RAM_Watch(); //adelikat: TODO this should be a single function call in main, that way we can expand as future dialogs need updating Update_RAM_Watch(); //adelikat: TODO this should be a single function call in main, that way we can expand as future dialogs need updating
Update_RAM_Search(); //main.cpp - case IDM_STATE_LOAD: also calls these functions Update_RAM_Search(); //main.cpp - case IDM_STATE_LOAD: also calls these functions
if(!wasPaused) if(!wasPaused)
NDS_UnPause(); NDS_UnPause();
else else
Display(); Display();
}
} }
void HK_StateSetSlot(int num) void HK_StateSetSlot(int num)
{ {
lastSaveState = num; if (romloaded)
SaveStateMessages(num,2); {
lastSaveState = num;
SaveStateMessages(num,2);
}
} }
void HK_StateQuickSaveSlot(int) void HK_StateQuickSaveSlot(int)