TAStudio: orderly shutdown if starting TAStudio returned nullEmulator.

This commit is contained in:
alyosha-tas 2019-04-21 08:46:50 -04:00
parent 6f1d61420d
commit 655729f29c
2 changed files with 17 additions and 3 deletions

View File

@ -104,6 +104,11 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.OSD.AddMessage("Warning: Movie hash does not match the ROM"); GlobalWin.OSD.AddMessage("Warning: Movie hash does not match the ROM");
} }
if (Emulator is NullEmulator)
{
return false;
}
return true; return true;
} }

View File

@ -416,6 +416,12 @@ namespace BizHawk.Client.EmuHawk
StartNewTasMovie(); StartNewTasMovie();
} }
if (Global.Emulator is NullEmulator)
{
DisengageTastudio();
return false;
}
EngageTastudio(); EngageTastudio();
return true; return true;
} }
@ -648,8 +654,11 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.PopulateWithDefaultHeaderValues(); CurrentTasMovie.PopulateWithDefaultHeaderValues();
SetTasMovieCallbacks(); SetTasMovieCallbacks();
CurrentTasMovie.ClearChanges(); // Don't ask to save changes here. CurrentTasMovie.ClearChanges(); // Don't ask to save changes here.
HandleMovieLoadStuff();
CurrentTasMovie.TasStateManager.Capture(); // Capture frame 0 always. if (HandleMovieLoadStuff())
{
CurrentTasMovie.TasStateManager.Capture(); // Capture frame 0 always.
}
// clear all selections // clear all selections
TasView.DeselectAll(); TasView.DeselectAll();
@ -699,7 +708,7 @@ namespace BizHawk.Client.EmuHawk
{ {
movie = CurrentTasMovie; movie = CurrentTasMovie;
} }
SetTasMovieCallbacks(movie as TasMovie); SetTasMovieCallbacks(movie as TasMovie);
bool result = Mainform.StartNewMovie(movie, record); bool result = Mainform.StartNewMovie(movie, record);