diff --git a/BizHawk.Client.Common/RomLoader.cs b/BizHawk.Client.Common/RomLoader.cs index 8b79c36602..f46ebe829f 100644 --- a/BizHawk.Client.Common/RomLoader.cs +++ b/BizHawk.Client.Common/RomLoader.cs @@ -242,7 +242,7 @@ namespace BizHawk.Client.Common return discs; } - public bool LoadRom(string path, CoreComm nextComm, bool forceAccurateCore = false, + public bool LoadRom(string path, CoreComm nextComm, string launchLibretroCore, bool forceAccurateCore = false, int recursiveCount = 0) // forceAccurateCore is currently just for Quicknes vs Neshawk but could be used for other situations { if (recursiveCount > 1) // hack to stop recursive calls from endlessly rerunning if we can't load it @@ -295,9 +295,9 @@ namespace BizHawk.Client.Common // must be done before LoadNoGame (which triggers retro_init and the paths to be consumed by the core) // game name == name of core - string codePathPart = Path.GetFileNameWithoutExtension(nextComm.LaunchLibretroCore); + string codePathPart = Path.GetFileNameWithoutExtension(launchLibretroCore); Global.Game = game = new GameInfo { Name = codePathPart, System = "Libretro" }; - var retro = new LibretroCore(nextComm, game, nextComm.LaunchLibretroCore); + var retro = new LibretroCore(nextComm, game, launchLibretroCore); nextEmulator = retro; if (retro.Description.SupportsNoGame && string.IsNullOrEmpty(path)) @@ -1183,7 +1183,7 @@ namespace BizHawk.Client.Common DoMessageCallback("Unable to use quicknes, using NESHawk instead"); } - return LoadRom(path, nextComm, true, recursiveCount + 1); + return LoadRom(path, nextComm, launchLibretroCore, true, recursiveCount + 1); } if (ex is MissingFirmwareException) @@ -1196,7 +1196,7 @@ namespace BizHawk.Client.Common // To avoid catch-22, disable SGB mode Global.Config.GbAsSgb = false; DoMessageCallback("Failed to load a GB rom in SGB mode. Disabling SGB Mode."); - return LoadRom(path, nextComm, false, recursiveCount + 1); + return LoadRom(path, nextComm, launchLibretroCore, false, recursiveCount + 1); } // handle exceptions thrown by the new detected systems that BizHawk does not have cores for diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 86c75cf1a7..164a23489d 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -3604,8 +3604,7 @@ namespace BizHawk.Client.EmuHawk ioaRetro.CorePath = Config.LibretroCore; } - nextComm.LaunchLibretroCore = ioaRetro.CorePath; - if (nextComm.LaunchLibretroCore == null) + if (ioaRetro.CorePath == null) { throw new InvalidOperationException("Can't load a file via Libretro until a core is specified"); } @@ -3619,7 +3618,7 @@ namespace BizHawk.Client.EmuHawk } CoreFileProvider.SyncCoreCommInputSignals(nextComm); - var result = loader.LoadRom(path, nextComm); + var result = loader.LoadRom(path, nextComm, ioaRetro?.CorePath); // we need to replace the path in the OpenAdvanced with the canonical one the user chose. // It can't be done until loader.LoadRom happens (for CanonicalFullPath) diff --git a/BizHawk.Client.EmuHawk/tools/BatchRunner.cs b/BizHawk.Client.EmuHawk/tools/BatchRunner.cs index e3a0d681c3..a91cec7048 100644 --- a/BizHawk.Client.EmuHawk/tools/BatchRunner.cs +++ b/BizHawk.Client.EmuHawk/tools/BatchRunner.cs @@ -133,7 +133,7 @@ namespace BizHawk.Client.EmuHawk bool result; try { - result = _ldr.LoadRom(f, _comm); + result = _ldr.LoadRom(f, _comm, null); } catch (Exception e) { diff --git a/BizHawk.Emulation.Common/CoreComms.cs b/BizHawk.Emulation.Common/CoreComms.cs index 15e3b44b0a..6f9414fb23 100644 --- a/BizHawk.Emulation.Common/CoreComms.cs +++ b/BizHawk.Emulation.Common/CoreComms.cs @@ -32,9 +32,6 @@ namespace BizHawk.Emulation.Common public int NominalWidth { get; set; } = 640; public int NominalHeight { get; set; } = 480; - // I know we want to get rid of CoreComm, but while it's still here, I'll use it for this - public string LaunchLibretroCore { get; set; } - /// /// Gets a message to show. reasonably annoying (dialog box), shouldn't be used most of the time ///