From d2869686dc1d340922dd988cb70a0653faed5dbc Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Sun, 16 Jun 2024 20:54:49 -0700 Subject: [PATCH] Hook up FDS and VS controls for SubNesHawk fixes #3949 --- .../SubNESHawk/SubNESHawk.IEmulator.cs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs index 18a6ac94a9..b5628b4a5a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SubNESHawk/SubNESHawk.IEmulator.cs @@ -1,5 +1,6 @@ using System; using BizHawk.Emulation.Common; +using BizHawk.Emulation.Cores.Nintendo.NES; namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk { @@ -35,6 +36,45 @@ namespace BizHawk.Emulation.Cores.Nintendo.SubNESHawk reset_cycle = controller.AxisValue("Reset Cycle"); reset_cycle_int = (int)Math.Floor(reset_cycle); + if (_nesCore.Board is FDS fds) + { + if (controller.IsPressed("FDS Eject")) + { + fds.Eject(); + } + + for (var i = 0; i < fds.NumSides; i++) + { + if (controller.IsPressed("FDS Insert " + i)) + { + fds.InsertSide(i); + } + } + } + + if (_nesCore.IsVS) + { + _nesCore.VS_service = (byte)(controller.IsPressed("Service Switch") ? 1 : 0); + + if (controller.IsPressed("Insert Coin P1")) + { + _nesCore.VS_coin_inserted |= 1; + } + else + { + _nesCore.VS_coin_inserted &= 2; + } + + if (controller.IsPressed("Insert Coin P2")) + { + _nesCore.VS_coin_inserted |= 2; + } + else + { + _nesCore.VS_coin_inserted &= 1; + } + } + _nesCore.lagged = true; DoFrame(controller);