diff --git a/BizHawk.Client.Common/RomLoader.cs b/BizHawk.Client.Common/RomLoader.cs index fd85d7fa3b..ee235ce1eb 100644 --- a/BizHawk.Client.Common/RomLoader.cs +++ b/BizHawk.Client.Common/RomLoader.cs @@ -867,7 +867,7 @@ namespace BizHawk.Client.Common { // need to get rid of this hack at some point rom = new RomGame(file); - ((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = 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 + nextComm.CoreFileProvider.SubfileDirectory = 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 byte[] romData = null; byte[] xmlData = rom.FileData; @@ -963,8 +963,8 @@ namespace BizHawk.Client.Common // The user picked nothing in the Core picker break; case "83P": - var ti83Bios = ((CoreFileProvider)nextComm.CoreFileProvider).GetFirmware("TI83", "Rom", true); - var ti83BiosPath = ((CoreFileProvider)nextComm.CoreFileProvider).GetFirmwarePath("TI83", "Rom", true); + var ti83Bios = nextComm.CoreFileProvider.GetFirmware("TI83", "Rom", true); + var ti83BiosPath = nextComm.CoreFileProvider.GetFirmwarePath("TI83", "Rom", true); using (var ti83AsHawkFile = new HawkFile(ti83BiosPath)) { var ti83BiosAsRom = new RomGame(ti83AsHawkFile); @@ -995,7 +995,7 @@ namespace BizHawk.Client.Common else { // need to get rid of this hack at some point - ((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = 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 + nextComm.CoreFileProvider.SubfileDirectory = 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 var romData = isXml ? null : rom.FileData; var xmlData = isXml ? rom.FileData : null; var snes = new LibsnesCore(game, romData, xmlData, nextComm, GetCoreSettings(), GetCoreSyncSettings()); diff --git a/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs b/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs index 5b3e523e97..1152bc3a1e 100644 --- a/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs +++ b/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs @@ -7,6 +7,8 @@ namespace BizHawk.Emulation.Common /// public interface ICoreFileProvider { + string SubfileDirectory { get; set; } + /// /// Produces a path to the requested file, expected to be parallel to the running rom. for example: cue+bin files or SFC+PCM (MSU-1 games) ///