when attempting to load SGB, unset SGB config mode if we fail to load the bios file. this avoids a catch-22 where you can't load an SGB because you don't have a rom, and you can't reset to GB mode because you can't get the menu item.

This commit is contained in:
goyuken 2012-09-29 23:21:55 +00:00
parent ff117d2c49
commit ddf99f789c
1 changed files with 11 additions and 1 deletions

View File

@ -1469,7 +1469,17 @@ namespace BizHawk.MultiClient
else
{
// todo: get these bioses into a gamedb??
byte[] sgbrom = File.ReadAllBytes(PathManager.MakeAbsolutePath(Global.Config.PathSGBRom, "SGB"));
byte[] sgbrom;
try
{
sgbrom = File.ReadAllBytes(PathManager.MakeAbsolutePath(Global.Config.PathSGBRom, "SGB"));
}
catch (Exception)
{
// failed to load SGB bios. to avoid catch-22, disable SGB mode
Global.Config.GB_AsSGB = false;
throw;
}
game.AddOption("SGB");
game.System = "SGB";
var snes = new LibsnesCore();