From d2fb794340d65f60811d9986bc4e297a898d0714 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 15 Jan 2021 04:33:14 +1000 Subject: [PATCH] Pass forced core through other paths in RomLoader fixes c0b6bf61b; not sure if this matters currently (PCE-CD maybe?) but it may become important if we add more alternate cores --- src/BizHawk.Client.Common/RomLoader.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index a55715cdf6..7ea52b0857 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -305,7 +305,7 @@ namespace BizHawk.Client.Common return game; } - private bool LoadDisc(string path, CoreComm nextComm, HawkFile file, string ext, out IEmulator nextEmulator, out GameInfo game) + private bool LoadDisc(string path, CoreComm nextComm, HawkFile file, string ext, string forcedCoreName, out IEmulator nextEmulator, out GameInfo game) { var disc = DiscExtensions.CreateAnyType(path, str => DoLoadErrorCallback(str, "???", LoadErrorType.DiscError)); if (disc == null) @@ -331,11 +331,11 @@ namespace BizHawk.Client.Common } }, }; - nextEmulator = MakeCoreFromCoreInventory(cip); + nextEmulator = MakeCoreFromCoreInventory(cip, forcedCoreName); return true; } - private void LoadM3U(string path, CoreComm nextComm, HawkFile file, out IEmulator nextEmulator, out GameInfo game) + private void LoadM3U(string path, CoreComm nextComm, HawkFile file, string forcedCoreName, out IEmulator nextEmulator, out GameInfo game) { M3U_File m3u; using (var sr = new StreamReader(path)) @@ -370,7 +370,7 @@ namespace BizHawk.Client.Common Game = game, Discs = discs }; - nextEmulator = MakeCoreFromCoreInventory(cip); + nextEmulator = MakeCoreFromCoreInventory(cip, forcedCoreName); } private IEmulator MakeCoreFromCoreInventory(CoreInventoryParameters cip, string forcedCoreName = null) @@ -523,7 +523,7 @@ namespace BizHawk.Client.Common game = rom.GameInfo; } - private bool LoadXML(string path, CoreComm nextComm, HawkFile file, out IEmulator nextEmulator, out RomGame rom, out GameInfo game) + private bool LoadXML(string path, CoreComm nextComm, HawkFile file, string forcedCoreName, out IEmulator nextEmulator, out RomGame rom, out GameInfo game) { nextEmulator = null; rom = null; @@ -564,7 +564,7 @@ namespace BizHawk.Client.Common }) .ToList(), }; - nextEmulator = MakeCoreFromCoreInventory(cip); + nextEmulator = MakeCoreFromCoreInventory(cip, forcedCoreName); return true; } catch (Exception ex) @@ -689,10 +689,10 @@ namespace BizHawk.Client.Common switch (ext) { case ".m3u": - LoadM3U(path, nextComm, file, out nextEmulator, out game); + LoadM3U(path, nextComm, file, forcedCoreName, out nextEmulator, out game); break; case ".xml": - if (!LoadXML(path, nextComm, file, out nextEmulator, out rom, out game)) + if (!LoadXML(path, nextComm, file, forcedCoreName, out nextEmulator, out rom, out game)) return false; break; case ".psf": @@ -704,7 +704,7 @@ namespace BizHawk.Client.Common { if (file.IsArchive) throw new InvalidOperationException("Can't load CD files from archives!"); - if (!LoadDisc(path, nextComm, file, ext, out nextEmulator, out game)) + if (!LoadDisc(path, nextComm, file, ext, forcedCoreName, out nextEmulator, out game)) return false; } else