Movies: Disable loading save states when playing or recording movies

This commit is contained in:
Souryo 2016-07-19 16:36:07 -04:00
parent c53237e90e
commit eec3798e00
2 changed files with 10 additions and 2 deletions

View file

@ -422,6 +422,10 @@ void Console::SaveState(ostream &saveStream)
void Console::LoadState(istream &loadStream)
{
if(Instance->_initialized) {
//Stop any movie that might have been playing/recording if a state is loaded
//(Note: Loading a state is disabled in the UI while a movie is playing/recording)
Movie::Stop();
Instance->_cpu->LoadSnapshot(&loadStream);
Instance->_ppu->LoadSnapshot(&loadStream);
Instance->_memoryManager->LoadSnapshot(&loadStream);

View file

@ -528,7 +528,9 @@ namespace Mesen.GUI.Forms
bool isNetPlayClient = InteropEmu.IsConnected();
mnuPause.Enabled = mnuStop.Enabled = mnuReset.Enabled = (_emuThread != null && !isNetPlayClient);
mnuSaveState.Enabled = mnuLoadState.Enabled = (_emuThread != null && !isNetPlayClient && !InteropEmu.IsNsf());
mnuSaveState.Enabled = (_emuThread != null && !isNetPlayClient && !InteropEmu.IsNsf());
mnuLoadState.Enabled = (_emuThread != null && !isNetPlayClient && !InteropEmu.IsNsf() && !InteropEmu.MoviePlaying() && !InteropEmu.MovieRecording());
mnuPause.Text = InteropEmu.IsPaused() ? ResourceHelper.GetMessage("Resume") : ResourceHelper.GetMessage("Pause");
mnuPause.Image = InteropEmu.IsPaused() ? Mesen.GUI.Properties.Resources.Play : Mesen.GUI.Properties.Resources.Pause;
@ -707,7 +709,9 @@ namespace Mesen.GUI.Forms
if(forSave) {
InteropEmu.SaveState(stateIndex);
} else {
InteropEmu.LoadState(stateIndex);
if(!InteropEmu.MoviePlaying() && !InteropEmu.MovieRecording()) {
InteropEmu.LoadState(stateIndex);
}
}
}
};