Pizza: Fix trying to load a CGB rom in SGB causing the universe to explode

This commit is contained in:
nattthebear 2017-07-09 14:42:37 -04:00
parent e1d0ea2bcb
commit 924515c69d
1 changed files with 14 additions and 23 deletions

View File

@ -851,12 +851,10 @@ namespace BizHawk.Client.Common
} }
else else
{ {
try if (Global.Config.SGB_UseBsnes)
{ {
game.System = "SNES"; game.System = "SNES";
game.AddOption("SGB"); game.AddOption("SGB");
if (Global.Config.SGB_UseBsnes)
{
var snes = new LibsnesCore(game, rom.FileData, null, nextComm, GetCoreSettings<LibsnesCore>(), GetCoreSyncSettings<LibsnesCore>()); var snes = new LibsnesCore(game, rom.FileData, null, nextComm, GetCoreSettings<LibsnesCore>(), GetCoreSyncSettings<LibsnesCore>());
nextEmulator = snes; nextEmulator = snes;
} }
@ -865,15 +863,6 @@ namespace BizHawk.Client.Common
core = CoreInventory.Instance["SGB", "Pizza Boy"]; core = CoreInventory.Instance["SGB", "Pizza Boy"];
} }
} }
catch
{
// failed to load SGB bios or game does not support SGB mode.
// To avoid catch-22, disable SGB mode
Global.Config.GB_AsSGB = false;
throw;
}
}
break; break;
case "A78": case "A78":
var gamedbpath = Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "EMU7800.csv"); var gamedbpath = Path.Combine(PathManager.GetExeDirectoryAbsolute(), "gamedb", "EMU7800.csv");
@ -970,7 +959,9 @@ namespace BizHawk.Client.Common
} }
else if (ex is CGBNotSupportedException) else if (ex is CGBNotSupportedException)
{ {
// Note: GB as SGB was set to false by this point, otherwise we would want to do it here // failed to load SGB bios or game does not support SGB mode.
// To avoid catch-22, disable SGB mode
Global.Config.GB_AsSGB = false;
DoMessageCallback("Failed to load a GB rom in SGB mode. Disabling SGB Mode."); DoMessageCallback("Failed to load a GB rom in SGB mode. Disabling SGB Mode.");
return LoadRom(path, nextComm, false, recursiveCount + 1); return LoadRom(path, nextComm, false, recursiveCount + 1);
} }