From e798fb2b291a00128c5bf5289df7fab8b9b6611a Mon Sep 17 00:00:00 2001 From: nattthebear Date: Thu, 4 Jun 2020 12:45:36 -0400 Subject: [PATCH] play around in romloader to replace some snes hackery with slightly different snes hackery --- src/BizHawk.Client.Common/RomLoader.cs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index 19299feb18..3bb61aed1e 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -893,26 +893,24 @@ namespace BizHawk.Client.Common break; case "SNES": - bool useSnes9x = Global.Config.PreferredCores["SNES"] == CoreNames.Snes9X; - if (Global.Config.CoreForcingViaGameDb && !string.IsNullOrEmpty(game.ForcedCore)) - { + { + var name = Global.Config.PreferredCores["SNES"]; + if (Global.Config.CoreForcingViaGameDb) + { if (game.ForcedCore.ToLower() == "snes9x") { - useSnes9x = true; + name = CoreNames.Snes9X; } else if (game.ForcedCore.ToLower() == "bsnes") { - useSnes9x = false; + name = CoreNames.Bsnes; } } - - if (useSnes9x) + try { - // TODO - // core = CoreInventory.Instance["SNES", "Faust"]; - core = CoreInventory.Instance["SNES", CoreNames.Snes9X]; + core = CoreInventory.Instance["SNES", name]; } - else + catch // TODO: CoreInventory should support some sort of trygetvalue { // need to get rid of this hack at some point var basePath = Path.GetDirectoryName(path.Replace("|", "")); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename @@ -921,8 +919,8 @@ namespace BizHawk.Client.Common var snes = new LibsnesCore(game, romData, xmlData, basePath, nextComm, GetCoreSettings(), GetCoreSyncSettings()); nextEmulator = snes; } - break; + } case "NES": { // apply main spur-of-the-moment switcheroo as lowest priority