From c467023dac848f36bcc6f719d142bd162a74e022 Mon Sep 17 00:00:00 2001 From: nattthebear Date: Tue, 26 May 2020 16:26:58 -0400 Subject: [PATCH] nyma pce - add gecd detection --- .../Consoles/NEC/PCE/TerboGrafix.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TerboGrafix.cs b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TerboGrafix.cs index 6346e1d079..b806b09bb1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TerboGrafix.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/NEC/PCE/TerboGrafix.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using BizHawk.Emulation.Common; using BizHawk.Emulation.Cores.Waterbox; using BizHawk.Emulation.DiscSystem; @@ -19,12 +20,13 @@ namespace BizHawk.Emulation.Cores.Consoles.NEC.PCE NymaSettings settings, NymaSyncSettings syncSettings) : base(comm, "PCE", "PC Engine Controller", settings, syncSettings) { - // TODO: detect GECD and only ask for the firmware we need - var firmwares = new Dictionary - { - { "FIRMWARE:syscard3.pce", comm.CoreFileProvider.GetFirmware("PCECD", "Bios", true) }, - { "FIRMWARE:gecard.pce", comm.CoreFileProvider.GetFirmware("PCECD", "GE-Bios", true) }, - }; + var firmwares = new Dictionary(); + var types = discs.Select(d => new DiscIdentifier(d).DetectDiscType()) + .ToList(); + if (types.Contains(DiscType.TurboCD)) + firmwares.Add("FIRMWARE:syscard3.pce", comm.CoreFileProvider.GetFirmware("PCECD", "Bios", true)); + if (types.Contains(DiscType.TurboGECD)) + firmwares.Add("FIRMWARE:gecard.pce", comm.CoreFileProvider.GetFirmware("PCECD", "GE-Bios", true)); DoInit(game, null, discs, "pce.wbx", null, firmwares); }