mirror of
https://github.com/SourMesen/Mesen.git
synced 2025-04-02 10:52:48 -04:00
Movies: Disable loading save states when playing or recording movies
This commit is contained in:
parent
c53237e90e
commit
eec3798e00
2 changed files with 10 additions and 2 deletions
|
@ -422,6 +422,10 @@ void Console::SaveState(ostream &saveStream)
|
||||||
void Console::LoadState(istream &loadStream)
|
void Console::LoadState(istream &loadStream)
|
||||||
{
|
{
|
||||||
if(Instance->_initialized) {
|
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->_cpu->LoadSnapshot(&loadStream);
|
||||||
Instance->_ppu->LoadSnapshot(&loadStream);
|
Instance->_ppu->LoadSnapshot(&loadStream);
|
||||||
Instance->_memoryManager->LoadSnapshot(&loadStream);
|
Instance->_memoryManager->LoadSnapshot(&loadStream);
|
||||||
|
|
|
@ -528,7 +528,9 @@ namespace Mesen.GUI.Forms
|
||||||
bool isNetPlayClient = InteropEmu.IsConnected();
|
bool isNetPlayClient = InteropEmu.IsConnected();
|
||||||
|
|
||||||
mnuPause.Enabled = mnuStop.Enabled = mnuReset.Enabled = (_emuThread != null && !isNetPlayClient);
|
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.Text = InteropEmu.IsPaused() ? ResourceHelper.GetMessage("Resume") : ResourceHelper.GetMessage("Pause");
|
||||||
mnuPause.Image = InteropEmu.IsPaused() ? Mesen.GUI.Properties.Resources.Play : Mesen.GUI.Properties.Resources.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) {
|
if(forSave) {
|
||||||
InteropEmu.SaveState(stateIndex);
|
InteropEmu.SaveState(stateIndex);
|
||||||
} else {
|
} else {
|
||||||
InteropEmu.LoadState(stateIndex);
|
if(!InteropEmu.MoviePlaying() && !InteropEmu.MovieRecording()) {
|
||||||
|
InteropEmu.LoadState(stateIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue