Encapsulate `LibretroHost` constructor
This commit is contained in:
parent
ddd14d5274
commit
407c26e9d5
|
@ -73,7 +73,21 @@ namespace BizHawk.Emulation.Cores.Libretro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks>does not keep a reference to <paramref name="game"/></remarks>
|
||||||
public LibretroHost(CoreComm comm, IGameInfo game, string corePath, bool analysis = false)
|
public LibretroHost(CoreComm comm, IGameInfo game, string corePath, bool analysis = false)
|
||||||
|
: this(
|
||||||
|
comm,
|
||||||
|
libretroSystemDir: comm.CoreFileProvider.GetRetroSystemPath(game),
|
||||||
|
libretroSaveRAMDir: comm.CoreFileProvider.GetRetroSaveRAMDirectory(game),
|
||||||
|
corePath: corePath,
|
||||||
|
analysis: analysis) {}
|
||||||
|
|
||||||
|
public LibretroHost(
|
||||||
|
CoreComm comm,
|
||||||
|
string libretroSystemDir,
|
||||||
|
string libretroSaveRAMDir,
|
||||||
|
string corePath,
|
||||||
|
bool analysis)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -95,11 +109,13 @@ namespace BizHawk.Emulation.Cores.Libretro
|
||||||
throw new InvalidOperationException("Unsupported Libretro API version (or major error in interop)");
|
throw new InvalidOperationException("Unsupported Libretro API version (or major error in interop)");
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge.LibretroBridge_SetDirectories(cbHandler,
|
var libretroCoreDir = Path.GetDirectoryName(corePath);
|
||||||
comm.CoreFileProvider.GetRetroSystemPath(game),
|
bridge.LibretroBridge_SetDirectories(
|
||||||
comm.CoreFileProvider.GetRetroSaveRAMDirectory(game),
|
cbHandler,
|
||||||
Path.GetDirectoryName(corePath),
|
systemDirectory: libretroSystemDir,
|
||||||
Path.GetDirectoryName(corePath));
|
saveDirectory: libretroSaveRAMDir,
|
||||||
|
coreDirectory: libretroCoreDir,
|
||||||
|
coreAssetsDirectory: libretroCoreDir);
|
||||||
|
|
||||||
ControllerDefinition = ControllerDef;
|
ControllerDefinition = ControllerDef;
|
||||||
_notify = comm.Notify;
|
_notify = comm.Notify;
|
||||||
|
|
Loading…
Reference in New Issue