Corrected System Menu from staying after a failure involving BIOS/Firmware.
This commit is contained in:
parent
13510e8213
commit
e65e9d8a22
|
@ -1439,104 +1439,108 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandlePlatformMenus()
|
private void HandlePlatformMenus()
|
||||||
{
|
{
|
||||||
var system = string.Empty;
|
var system = string.Empty;
|
||||||
|
if (!Global.Game.IsNullInstance)
|
||||||
|
{
|
||||||
|
//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;
|
||||||
|
|
||||||
if (!Global.Game.IsNullInstance)
|
}
|
||||||
{
|
|
||||||
system = Global.Game.System;
|
|
||||||
}
|
|
||||||
|
|
||||||
TI83SubMenu.Visible = false;
|
TI83SubMenu.Visible = false;
|
||||||
NESSubMenu.Visible = false;
|
NESSubMenu.Visible = false;
|
||||||
PCESubMenu.Visible = false;
|
PCESubMenu.Visible = false;
|
||||||
SMSSubMenu.Visible = false;
|
SMSSubMenu.Visible = false;
|
||||||
GBSubMenu.Visible = false;
|
GBSubMenu.Visible = false;
|
||||||
GBASubMenu.Visible = false;
|
GBASubMenu.Visible = false;
|
||||||
AtariSubMenu.Visible = false;
|
AtariSubMenu.Visible = false;
|
||||||
SNESSubMenu.Visible = false;
|
SNESSubMenu.Visible = false;
|
||||||
ColecoSubMenu.Visible = false;
|
ColecoSubMenu.Visible = false;
|
||||||
N64SubMenu.Visible = false;
|
N64SubMenu.Visible = false;
|
||||||
SaturnSubMenu.Visible = false;
|
SaturnSubMenu.Visible = false;
|
||||||
DGBSubMenu.Visible = false;
|
DGBSubMenu.Visible = false;
|
||||||
GenesisSubMenu.Visible = false;
|
GenesisSubMenu.Visible = false;
|
||||||
wonderSwanToolStripMenuItem.Visible = false;
|
wonderSwanToolStripMenuItem.Visible = false;
|
||||||
|
|
||||||
switch (system)
|
switch (system)
|
||||||
{
|
{
|
||||||
case "GEN":
|
case "GEN":
|
||||||
GenesisSubMenu.Visible = true;
|
GenesisSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "TI83":
|
case "TI83":
|
||||||
TI83SubMenu.Visible = true;
|
TI83SubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "NES":
|
case "NES":
|
||||||
NESSubMenu.Visible = true;
|
NESSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "PCE":
|
case "PCE":
|
||||||
case "PCECD":
|
case "PCECD":
|
||||||
case "SGX":
|
case "SGX":
|
||||||
PCESubMenu.Visible = true;
|
PCESubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "SMS":
|
case "SMS":
|
||||||
SMSSubMenu.Text = "&SMS";
|
SMSSubMenu.Text = "&SMS";
|
||||||
SMSSubMenu.Visible = true;
|
SMSSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "SG":
|
case "SG":
|
||||||
SMSSubMenu.Text = "&SG";
|
SMSSubMenu.Text = "&SG";
|
||||||
SMSSubMenu.Visible = true;
|
SMSSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "GG":
|
case "GG":
|
||||||
SMSSubMenu.Text = "&GG";
|
SMSSubMenu.Text = "&GG";
|
||||||
SMSSubMenu.Visible = true;
|
SMSSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "GB":
|
case "GB":
|
||||||
case "GBC":
|
case "GBC":
|
||||||
GBSubMenu.Visible = true;
|
GBSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "GBA":
|
case "GBA":
|
||||||
GBASubMenu.Visible = true;
|
GBASubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "A26":
|
case "A26":
|
||||||
AtariSubMenu.Visible = true;
|
AtariSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "SNES":
|
case "SNES":
|
||||||
case "SGB":
|
case "SGB":
|
||||||
// TODO: fix SNES9x here
|
// TODO: fix SNES9x here
|
||||||
if (Global.Emulator is LibsnesCore)
|
if (Global.Emulator is LibsnesCore)
|
||||||
{
|
{
|
||||||
if ((Global.Emulator as LibsnesCore).IsSGB)
|
if ((Global.Emulator as LibsnesCore).IsSGB)
|
||||||
{
|
{
|
||||||
SNESSubMenu.Text = "&SGB";
|
SNESSubMenu.Text = "&SGB";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SNESSubMenu.Text = "&SNES";
|
SNESSubMenu.Text = "&SNES";
|
||||||
}
|
}
|
||||||
SNESSubMenu.Visible = true;
|
SNESSubMenu.Visible = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SNESSubMenu.Visible = false;
|
SNESSubMenu.Visible = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Coleco":
|
case "Coleco":
|
||||||
ColecoSubMenu.Visible = true;
|
ColecoSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "N64":
|
case "N64":
|
||||||
N64SubMenu.Visible = true;
|
N64SubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "SAT":
|
case "SAT":
|
||||||
SaturnSubMenu.Visible = true;
|
SaturnSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "DGB":
|
case "DGB":
|
||||||
DGBSubMenu.Visible = true;
|
DGBSubMenu.Visible = true;
|
||||||
break;
|
break;
|
||||||
case "WSWAN":
|
case "WSWAN":
|
||||||
wonderSwanToolStripMenuItem.Visible = true;
|
wonderSwanToolStripMenuItem.Visible = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void InitControls()
|
private static void InitControls()
|
||||||
{
|
{
|
||||||
|
@ -3115,10 +3119,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// the new settings objects
|
// the new settings objects
|
||||||
CommitCoreSettingsToConfig(); // adelikat: I Think by reordering things, this isn't necessary anymore
|
CommitCoreSettingsToConfig(); // adelikat: I Think by reordering things, this isn't necessary anymore
|
||||||
CloseGame();
|
CloseGame();
|
||||||
|
|
||||||
var nextComm = CreateCoreComm();
|
var nextComm = CreateCoreComm();
|
||||||
CoreFileProvider.SyncCoreCommInputSignals(nextComm);
|
CoreFileProvider.SyncCoreCommInputSignals(nextComm);
|
||||||
|
|
||||||
var result = loader.LoadRom(path, nextComm);
|
var result = loader.LoadRom(path, nextComm);
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
|
@ -3223,6 +3226,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//This shows up if there's a problem
|
||||||
// TODO: put all these in a single method or something
|
// TODO: put all these in a single method or something
|
||||||
HandlePlatformMenus();
|
HandlePlatformMenus();
|
||||||
_stateSlots.Clear();
|
_stateSlots.Clear();
|
||||||
|
@ -3288,6 +3292,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
// whats the difference between these two methods??
|
// whats the difference between these two methods??
|
||||||
// its very tricky. rename to be more clear or combine them.
|
// 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)
|
private void CloseGame(bool clearSram = false)
|
||||||
{
|
{
|
||||||
if (clearSram)
|
if (clearSram)
|
||||||
|
@ -3311,21 +3317,20 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
StopMovie(true);
|
StopMovie(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Global.Emulator.Dispose();
|
Global.Emulator.Dispose();
|
||||||
Global.CoreComm = CreateCoreComm();
|
Global.CoreComm = CreateCoreComm();
|
||||||
CoreFileProvider.SyncCoreCommInputSignals();
|
CoreFileProvider.SyncCoreCommInputSignals();
|
||||||
Global.Emulator = new NullEmulator(Global.CoreComm);
|
Global.Emulator = new NullEmulator(Global.CoreComm);
|
||||||
Global.ActiveController = Global.NullControls;
|
Global.ActiveController = Global.NullControls;
|
||||||
Global.AutoFireController = Global.AutofireNullControls;
|
Global.AutoFireController = Global.AutofireNullControls;
|
||||||
|
|
||||||
RewireSound();
|
RewireSound();
|
||||||
RebootStatusBarIcon.Visible = false;
|
RebootStatusBarIcon.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseRom(bool clearSram = 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())
|
if (GlobalWin.Tools.AskSave())
|
||||||
{
|
{
|
||||||
CloseGame(clearSram);
|
CloseGame(clearSram);
|
||||||
|
@ -3335,7 +3340,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Global.Game = GameInfo.NullInstance;
|
Global.Game = GameInfo.NullInstance;
|
||||||
|
|
||||||
GlobalWin.Tools.Restart();
|
GlobalWin.Tools.Restart();
|
||||||
|
|
||||||
RewireSound();
|
RewireSound();
|
||||||
Global.Rewinder.ResetRewindBuffer();
|
Global.Rewinder.ResetRewindBuffer();
|
||||||
Text = "BizHawk" + (VersionInfo.DeveloperBuild ? " (interim) " : string.Empty);
|
Text = "BizHawk" + (VersionInfo.DeveloperBuild ? " (interim) " : string.Empty);
|
||||||
|
|
Loading…
Reference in New Issue