Hook up FDS and VS controls for SubNesHawk

fixes #3949
This commit is contained in:
CasualPokePlayer 2024-06-16 20:54:49 -07:00
parent acca29a66e
commit d2869686dc
1 changed files with 40 additions and 0 deletions

View File

@ -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);