From 391190b6d4fa14d1291dc61e0cea283b537fc3d0 Mon Sep 17 00:00:00 2001 From: James Groom Date: Tue, 14 Nov 2023 18:05:32 +1000 Subject: [PATCH] Inline `ICoreFileProvider.DllPath` --- src/BizHawk.Client.Common/CoreFileProvider.cs | 2 -- src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs | 5 ----- src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs | 3 ++- .../Consoles/Nintendo/BSNES/BsnesCore.cs | 3 ++- .../Consoles/Nintendo/SNES/LibsnesCore.cs | 3 ++- src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs | 3 ++- src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs | 3 ++- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/BizHawk.Client.Common/CoreFileProvider.cs b/src/BizHawk.Client.Common/CoreFileProvider.cs index b1d9e01b75..729e60347d 100644 --- a/src/BizHawk.Client.Common/CoreFileProvider.cs +++ b/src/BizHawk.Client.Common/CoreFileProvider.cs @@ -26,8 +26,6 @@ namespace BizHawk.Client.Common _firmwareUserSpecifications = firmwareUserSpecifications; } - public string DllPath() => PathUtils.DllDirectoryPath; - // Poop public string GetRetroSaveRAMDirectory(IGameInfo game) => _pathEntries.RetroSaveRamAbsolutePath(game); diff --git a/src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs b/src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs index a0cc671e67..0412ea0780 100644 --- a/src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs +++ b/src/BizHawk.Emulation.Common/Interfaces/ICoreFileProvider.cs @@ -5,11 +5,6 @@ /// public interface ICoreFileProvider { - /// - /// produces a path that contains emulation related DLL and exe files - /// - string DllPath(); - /// /// produces a path that contains saveram... because libretro cores need it /// diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs index 1bf8ddd705..fb5cb2846c 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs @@ -11,6 +11,7 @@ using System.Text; using BizHawk.BizInvoke; using BizHawk.Common; using BizHawk.Common.IOExtensions; +using BizHawk.Common.PathExtensions; using BizHawk.Common.StringExtensions; using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Waterbox; @@ -67,7 +68,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME _exe = new(new() { Filename = "libmamearcade.wbx", - Path = lp.Comm.CoreFileProvider.DllPath(), + Path = PathUtils.DllDirectoryPath, SbrkHeapSizeKB = 512 * 1024, InvisibleHeapSizeKB = 4, MmapHeapSizeKB = 1024 * 1024, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs index ecdc2af37f..d7b35ed2a4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/BSNES/BsnesCore.cs @@ -2,6 +2,7 @@ using System; using System.IO; using System.Runtime.InteropServices; using BizHawk.Common; +using BizHawk.Common.PathExtensions; using BizHawk.Emulation.Common; using BizHawk.Emulation.Common.Base_Implementations; using BizHawk.Emulation.Cores.Components.W65816; @@ -65,7 +66,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES msuEndCb = _currentMsuTrack.AtEnd }; - Api = new BsnesApi(CoreComm.CoreFileProvider.DllPath(), CoreComm, callbacks.AllDelegatesInMemoryOrder()); + Api = new(PathUtils.DllDirectoryPath, CoreComm, callbacks.AllDelegatesInMemoryOrder()); _controllers = new BsnesControllers(_syncSettings, subframe); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs index f8cb97d710..50a9eb2a33 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -4,6 +4,7 @@ using System.Xml; using System.IO; using BizHawk.Common; +using BizHawk.Common.PathExtensions; using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Components.W65816; @@ -69,7 +70,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES _pathrequestcb = snes_path_request; // TODO: pass profile here - Api = new LibsnesApi(CoreComm.CoreFileProvider.DllPath(), CoreComm, new Delegate[] + Api = new(PathUtils.DllDirectoryPath, CoreComm, new Delegate[] { _videocb, _inputpollcb, diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs index 54ec5f4561..9d3371f14b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64/GPGX.cs @@ -2,6 +2,7 @@ using System.Runtime.InteropServices; using BizHawk.BizInvoke; +using BizHawk.Common.PathExtensions; using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Waterbox; using BizHawk.Common; @@ -38,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx _elf = new WaterboxHost(new WaterboxOptions { - Path = lp.Comm.CoreFileProvider.DllPath(), + Path = PathUtils.DllDirectoryPath, Filename = "gpgx.wbx", SbrkHeapSizeKB = 512, SealedHeapSizeKB = 4 * 1024, diff --git a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs index 22e77bc185..0710d8b220 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using BizHawk.Common; using BizHawk.BizInvoke; +using BizHawk.Common.PathExtensions; using BizHawk.Emulation.Common; namespace BizHawk.Emulation.Cores.Waterbox @@ -48,7 +49,7 @@ namespace BizHawk.Emulation.Cores.Waterbox protected T PreInit(WaterboxOptions options, IEnumerable allExtraDelegates = null) where T : LibWaterboxCore { - options.Path ??= CoreComm.CoreFileProvider.DllPath(); + options.Path ??= PathUtils.DllDirectoryPath; _exe = new WaterboxHost(options); var delegates = new Delegate[] { _inputCallback }.AsEnumerable(); if (allExtraDelegates != null)