Replace (string, string) w/ FirmwareID in nyma core ctors

This commit is contained in:
YoshiRulz 2021-02-22 22:40:40 +10:00
parent cec46f1e65
commit 485817a8e4
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
5 changed files with 17 additions and 17 deletions

View File

@ -21,11 +21,11 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE
public HyperNyma(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp)
: base(lp.Comm, "PCE", "PC Engine Controller", lp.Settings, lp.SyncSettings)
{
var firmwares = new Dictionary<string, (string, string)>();
var firmwares = new Dictionary<string, FirmwareID>();
if (lp.Discs.Count > 0)
{
_hasCds = true;
firmwares.Add("FIRMWARE:syscard3.pce", ("PCECD", "Bios"));
firmwares.Add("FIRMWARE:syscard3.pce", new("PCECD", "Bios"));
}
_hyperNyma = DoInit<LibHyperNyma>(lp, "hyper.wbx", firmwares);

View File

@ -23,15 +23,15 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE
public TurboNyma(CoreLoadParameters<NymaSettings, NymaSyncSettings> lp)
: base(lp.Comm, "PCE", "PC Engine Controller", lp.Settings, lp.SyncSettings)
{
var firmwares = new Dictionary<string, (string, string)>();
var firmwares = new Dictionary<string, FirmwareID>();
if (lp.Discs.Count > 0)
{
_hasCds = true;
var ids = lp.Discs.Select(dg => dg.DiscType).ToList();
if (ids.Contains(DiscType.TurboCD))
firmwares.Add("FIRMWARE:syscard3.pce", ("PCECD", "Bios"));
firmwares.Add("FIRMWARE:syscard3.pce", new("PCECD", "Bios"));
if (ids.Contains(DiscType.TurboGECD))
firmwares.Add("FIRMWARE:gecard.pce", ("PCECD", "GE-Bios"));
firmwares.Add("FIRMWARE:gecard.pce", new("PCECD", "GE-Bios"));
}
else if (lp.Roms.Count == 1)
{

View File

@ -15,9 +15,9 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCFX
{
if (lp.Roms.Count > 0)
throw new InvalidOperationException("To load a PC-FX game, please load the CUE file and not the BIN file.");
var firmwares = new Dictionary<string, (string, string)>
var firmwares = new Dictionary<string, FirmwareID>
{
{ "FIRMWARE:pcfx.rom", ("PCFX", "BIOS") },
{ "FIRMWARE:pcfx.rom", new("PCFX", "BIOS") },
};
DoInit<LibNymaCore>(lp, "pcfx.wbx", firmwares);

View File

@ -15,13 +15,13 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn
{
if (lp.Roms.Count > 0)
throw new InvalidOperationException("To load a Saturn game, please load the CUE file and not the BIN file.");
var firmwares = new Dictionary<string, (string, string)>
var firmwares = new Dictionary<string, FirmwareID>
{
{ "FIRMWARE:$J", ("SAT", "J") },
{ "FIRMWARE:$U", ("SAT", "U") },
{ "FIRMWARE:$KOF", ("SAT", "KOF95") },
{ "FIRMWARE:$ULTRA", ("SAT", "ULTRAMAN") },
// { "FIRMWARE:$SATAR", ("SAT", "AR") }, // action replay garbage
{ "FIRMWARE:$J", new("SAT", "J") },
{ "FIRMWARE:$U", new("SAT", "U") },
{ "FIRMWARE:$KOF", new("SAT", "KOF95") },
{ "FIRMWARE:$ULTRA", new("SAT", "ULTRAMAN") },
// { "FIRMWARE:$SATAR", new("SAT", "AR") }, // action replay garbage
};
DoInit<LibNymaCore>(lp, "ss.wbx", firmwares);
}

View File

@ -30,7 +30,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
protected T DoInit<T>(
CoreLoadParameters<NymaSettings, NymaSyncSettings> lp,
string wbxFilename,
IDictionary<string, (string SystemID, string FirmwareID)> firmwares = null
IDictionary<string, FirmwareID> firmwares = null
)
where T : LibNymaCore
{
@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Waterbox
);
}
protected T DoInit<T>(GameInfo game, byte[] rom, Disc[] discs, string wbxFilename, string extension, bool deterministic,
IDictionary<string, (string SystemID, string FirmwareID)> firmwares = null)
IDictionary<string, FirmwareID> firmwares = null)
where T : LibNymaCore
{
_settingsQueryDelegate = SettingsQuery;
@ -56,9 +56,9 @@ namespace BizHawk.Emulation.Cores.Waterbox
var firmwareDelegate = new LibNymaCore.FrontendFirmwareNotify((name) =>
{
if (firmwares != null && firmwares.TryGetValue(name, out var info))
if (firmwares != null && firmwares.TryGetValue(name, out var id))
{
var data = CoreComm.CoreFileProvider.GetFirmware(info.SystemID, info.FirmwareID, true,
var data = CoreComm.CoreFileProvider.GetFirmware(id, true,
"Firmware files are usually required and may stop your game from loading");
if (data != null)
{