Corrected System Menu from staying after a failure involving BIOS/Firmware.

This commit is contained in:
hegyak 2014-08-27 18:15:02 +00:00
parent 13510e8213
commit e65e9d8a22
1 changed files with 105 additions and 101 deletions

View File

@ -1441,10 +1441,14 @@ namespace BizHawk.Client.EmuHawk
private void HandlePlatformMenus()
{
var system = string.Empty;
if (!Global.Game.IsNullInstance)
{
system = Global.Game.System;
//New Code
//We use SystemID as that has the system we are playing on.
system = Global.Emulator.SystemId;
//Old Code below.
//system = Global.Game.System;
}
TI83SubMenu.Visible = false;
@ -3118,7 +3122,6 @@ namespace BizHawk.Client.EmuHawk
var nextComm = CreateCoreComm();
CoreFileProvider.SyncCoreCommInputSignals(nextComm);
var result = loader.LoadRom(path, nextComm);
if (result)
@ -3223,6 +3226,7 @@ namespace BizHawk.Client.EmuHawk
}
else
{
//This shows up if there's a problem
// TODO: put all these in a single method or something
HandlePlatformMenus();
_stateSlots.Clear();
@ -3288,6 +3292,8 @@ namespace BizHawk.Client.EmuHawk
// whats the difference between these two methods??
// its very tricky. rename to be more clear or combine them.
// This gets called whenever a core related thing is changed.
// Like reboot core.
private void CloseGame(bool clearSram = false)
{
if (clearSram)
@ -3311,21 +3317,20 @@ namespace BizHawk.Client.EmuHawk
{
StopMovie(true);
}
Global.Emulator.Dispose();
Global.CoreComm = CreateCoreComm();
CoreFileProvider.SyncCoreCommInputSignals();
Global.Emulator = new NullEmulator(Global.CoreComm);
Global.ActiveController = Global.NullControls;
Global.AutoFireController = Global.AutofireNullControls;
RewireSound();
RebootStatusBarIcon.Visible = false;
}
public void CloseRom(bool clearSram = false)
{
//This gets called after Close Game gets called.
//Tested with NESHawk and SMB3 (U)
if (GlobalWin.Tools.AskSave())
{
CloseGame(clearSram);
@ -3335,7 +3340,6 @@ namespace BizHawk.Client.EmuHawk
Global.Game = GameInfo.NullInstance;
GlobalWin.Tools.Restart();
RewireSound();
Global.Rewinder.ResetRewindBuffer();
Text = "BizHawk" + (VersionInfo.DeveloperBuild ? " (interim) " : string.Empty);