diff --git a/src/BizHawk.Client.Common/CoreFileProvider.cs b/src/BizHawk.Client.Common/CoreFileProvider.cs index c95708c764..12c08f5ce6 100644 --- a/src/BizHawk.Client.Common/CoreFileProvider.cs +++ b/src/BizHawk.Client.Common/CoreFileProvider.cs @@ -29,11 +29,11 @@ namespace BizHawk.Client.Common public string DllPath() => PathUtils.DllDirectoryPath; // Poop - public string GetRetroSaveRAMDirectory(GameInfo game) + public string GetRetroSaveRAMDirectory(IGameInfo game) => _pathEntries.RetroSaveRamAbsolutePath(game); // Poop - public string GetRetroSystemPath(GameInfo game) + public string GetRetroSystemPath(IGameInfo game) => _pathEntries.RetroSystemAbsolutePath(game); private void FirmwareWarn(string sysID, string firmwareID, bool required, string msg = null) diff --git a/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs b/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs index 9cd371fa63..578da1ae2d 100644 --- a/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs +++ b/src/BizHawk.Client.Common/config/PathEntryCollectionExtensions.cs @@ -222,7 +222,7 @@ namespace BizHawk.Client.Common return collection.AbsolutePathFor(path.Path, systemId); } - public static string SaveRamAbsolutePath(this PathEntryCollection collection, GameInfo game, IMovie movie) + public static string SaveRamAbsolutePath(this PathEntryCollection collection, IGameInfo game, IMovie movie) { var name = game.FilesystemSafeName(); if (movie.IsActive()) @@ -237,7 +237,7 @@ namespace BizHawk.Client.Common } // Shenanigans - public static string RetroSaveRamAbsolutePath(this PathEntryCollection collection, GameInfo game) + public static string RetroSaveRamAbsolutePath(this PathEntryCollection collection, IGameInfo game) { var name = game.FilesystemSafeName(); name = Path.GetDirectoryName(name); @@ -255,7 +255,7 @@ namespace BizHawk.Client.Common } // Shenanigans - public static string RetroSystemAbsolutePath(this PathEntryCollection collection, GameInfo game) + public static string RetroSystemAbsolutePath(this PathEntryCollection collection, IGameInfo game) { var name = game.FilesystemSafeName(); name = Path.GetDirectoryName(name); @@ -270,7 +270,7 @@ namespace BizHawk.Client.Common return Path.Combine(collection.AbsolutePathFor(pathEntry.Path, game.System), name); } - public static string AutoSaveRamAbsolutePath(this PathEntryCollection collection, GameInfo game, IMovie movie) + public static string AutoSaveRamAbsolutePath(this PathEntryCollection collection, IGameInfo game, IMovie movie) { var path = collection.SaveRamAbsolutePath(game, movie); return path.Insert(path.Length - 8, ".AutoSaveRAM"); diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs index c11df17bb2..2f59d58073 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -319,7 +319,7 @@ namespace BizHawk.Client.EmuHawk private void OpenAdvancedMenuItem_Click(object sender, EventArgs e) { - using var oac = new OpenAdvancedChooser(this, Config); + using var oac = new OpenAdvancedChooser(this, Config, Game); if (oac.ShowHawkDialog() == DialogResult.Cancel) { return; diff --git a/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs b/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs index a657531597..f57fa0bda7 100644 --- a/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs +++ b/src/BizHawk.Client.EmuHawk/OpenAdvancedChooser.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Windows.Forms; using BizHawk.Emulation.Cores.Libretro; using BizHawk.Client.Common; +using BizHawk.Emulation.Common; // these match strings from OpenAdvance. should we make them constants in there? namespace BizHawk.Client.EmuHawk @@ -24,15 +25,17 @@ namespace BizHawk.Client.EmuHawk { private readonly MainForm _mainForm; private readonly Config _config; + private readonly IGameInfo _game; public AdvancedRomLoaderType Result; public string SuggestedExtensionFilter; private RetroDescription _currentDescription; - public OpenAdvancedChooser(MainForm mainForm, Config config) + public OpenAdvancedChooser(MainForm mainForm, Config config, IGameInfo game) { _mainForm = mainForm; _config = config; + _game = game; InitializeComponent(); @@ -70,7 +73,7 @@ namespace BizHawk.Client.EmuHawk try { var coreComm = _mainForm.CreateCoreComm(); - using var retro = new LibretroCore(coreComm, GlobalWin.Game, core); + using var retro = new LibretroCore(coreComm, _game, core); btnLibretroLaunchGame.Enabled = true; if (retro.Description.SupportsNoGame) btnLibretroLaunchNoGame.Enabled = true; diff --git a/src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs b/src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs index 7fef4d6536..df081dae77 100644 --- a/src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs +++ b/src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs @@ -13,12 +13,12 @@ /// /// produces a path that contains saveram... because libretro cores need it /// - string GetRetroSaveRAMDirectory(GameInfo game); + string GetRetroSaveRAMDirectory(IGameInfo game); /// /// produces a path for use as a libretro system path (different for each core) /// - string GetRetroSystemPath(GameInfo game); + string GetRetroSystemPath(IGameInfo game); /// /// Get a firmware as a byte array diff --git a/src/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs b/src/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs index 0eef7fe8af..45149a1970 100644 --- a/src/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs +++ b/src/BizHawk.Emulation.Cores/Libretro/LibretroCore.cs @@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Libretro private LibretroApi api; // TODO: codepath just for introspection (lighter weight; no speex, no controls, etc.) - public LibretroCore(CoreComm nextComm, GameInfo game, string corePath) + public LibretroCore(CoreComm nextComm, IGameInfo game, string corePath) { ServiceProvider = new BasicServiceProvider(this); _SyncSettings = new SyncSettings();