From 13ebf953629228bb39da5d4ae75691f17d5c56c1 Mon Sep 17 00:00:00 2001 From: beirich Date: Tue, 25 Mar 2014 02:12:42 +0000 Subject: [PATCH] SMS: fix a nullptrexception on Auto region setting and game not in DB. Fix logical error with YM2413 disable setting and game not in db. --- BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs index 1a2942e67c..d5c6b869bc 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/SMS/SMS.cs @@ -116,7 +116,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem CoreComm.Notify("Region was forced to Japan for game compatibility."); } - if (game.NotInDatabase || game["FM"] && SyncSettings.EnableFM && !IsGameGear) + if ((game.NotInDatabase || game["FM"]) && SyncSettings.EnableFM && !IsGameGear) HasYM2413 = true; if (Controller == null) @@ -199,6 +199,8 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem string DetermineRegion(string gameRegion) { + if (gameRegion == null) + return "Export"; if (gameRegion.IndexOf("USA") >= 0) return "Export"; if (gameRegion.IndexOf("Europe") >= 0) @@ -216,7 +218,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem { if (display == "NTSC") return DisplayType.NTSC; if (display == "PAL") return DisplayType.PAL; - if (region == "Europe") return DisplayType.PAL; + if (region != null && region == "Europe") return DisplayType.PAL; return DisplayType.NTSC; }