From dcce0320d294838c219621e1a28e952f80bc6c03 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sat, 29 Oct 2016 19:39:47 -0400 Subject: [PATCH] Add Insert Coin Controls --- .../Consoles/Nintendo/NES/NES.Core.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs index 2a71f485be..c80b81cdd2 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.Core.cs @@ -192,6 +192,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES for (int i = 0; i < b.NumSides; i++) ControllerDefinition.BoolButtons.Add("FDS Insert " + i); } + + if (_isVS) + { + ControllerDefinition.BoolButtons.Add("Insert Coin P1"); + ControllerDefinition.BoolButtons.Add("Insert Coin P2"); + ControllerDefinition.BoolButtons.Add("Service Switch"); + } } // don't replace the magicSoundProvider on reset, as it's not needed @@ -327,6 +334,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES b.InsertSide(i); } + if (_isVS) + { + if (controller["Service Switch"]) + VS_service = 1; + else + VS_service = 0; + + if (controller["Insert Coin P1"]) + VS_coin_inserted |= 1; + else + VS_coin_inserted &= 2; + + if (controller["Insert Coin P2"]) + VS_coin_inserted |= 2; + else + VS_coin_inserted &= 1; + } + ppu.FrameAdvance(); if (lagged) {