Make MainForm.RebootCore return bool, read in MainForm.StartNewMovie

resolves #2147
This commit is contained in:
YoshiRulz 2021-05-14 12:16:53 +10:00
parent 5229d664c4
commit c57cd97f56
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 7 additions and 9 deletions

View File

@ -71,7 +71,7 @@ namespace BizHawk.Client.Common
void PauseEmulator();
/// <remarks>only referenced from <c>EmuClientApi</c></remarks>
void RebootCore();
bool RebootCore();
/// <remarks>only referenced from <c>EmuClientApi</c></remarks>
void Render();

View File

@ -32,7 +32,8 @@ namespace BizHawk.Client.EmuHawk
if (!_isLoadingRom)
{
RebootCore();
var rebootSucceeded = RebootCore();
if (!rebootSucceeded) return false;
}
Config.RecentMovies.Add(movie.Filename);

View File

@ -1103,20 +1103,17 @@ namespace BizHawk.Client.EmuHawk
}
public void RebootCore()
public bool RebootCore()
{
if (IsSlave && Master.WantsToControlReboot)
{
Master.RebootCore();
return true;
}
else
{
if (CurrentlyOpenRomArgs == null)
{
return;
}
LoadRom(CurrentlyOpenRomArgs.OpenAdvanced.SimplePath, CurrentlyOpenRomArgs);
if (CurrentlyOpenRomArgs == null) return true;
return LoadRom(CurrentlyOpenRomArgs.OpenAdvanced.SimplePath, CurrentlyOpenRomArgs);
}
}