Remove "Debug" haptic channel and debug hotkey, prepare Mupen

This commit is contained in:
YoshiRulz 2021-07-15 00:36:55 +10:00
parent 045c4815a4
commit 52333e4862
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
4 changed files with 14 additions and 15 deletions

View File

@ -703,8 +703,6 @@ namespace BizHawk.Client.EmuHawk
// handle events and dispatch as a hotkey action, or a hotkey button, or an input button
// ...but prepare haptics first, those get read in ProcessInput
var finalHostController = (ControllerInputCoalescer) InputManager.ControllerInputCoalescer;
// for now, vibrate the first gamepad when the Fast Forward hotkey is held, using the value from the previous (host) frame
InputManager.ActiveController.SetHapticChannelStrength("Debug", InputManager.ClientControls.IsPressed("Fast Forward") ? int.MaxValue : 0);
InputManager.ActiveController.PrepareHapticsForHost(finalHostController);
ProcessInput(
_hotkeyCoalescer,

View File

@ -10,12 +10,7 @@ namespace BizHawk.Emulation.Common
/// <seealso cref="IEmulator" />
public class ControllerDefinition
{
public ControllerDefinition()
{
#if DEBUG
HapticsChannels.Add("Debug");
#endif
}
public ControllerDefinition() {}
public ControllerDefinition(ControllerDefinition source)
: this()

View File

@ -23,14 +23,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
public PutSettingsDirtyBits PutSyncSettings(N64SyncSettings o)
{
_syncSettings = o;
SetControllerButtons();
SetControllerButtons(_syncSettings = o);
return PutSettingsDirtyBits.RebootCore;
}
private void SetControllerButtons()
private void SetControllerButtons(N64SyncSettings syncSettings)
{
static void AddN64StandardController(ControllerDefinition def, int player)
static void AddN64StandardController(ControllerDefinition def, int player, bool hasRumblePak)
{
def.BoolButtons.AddRange(new[] { $"P{player} A Up", $"P{player} A Down", $"P{player} A Left", $"P{player} A Right", $"P{player} DPad U", $"P{player} DPad D", $"P{player} DPad L", $"P{player} DPad R", $"P{player} Start", $"P{player} Z", $"P{player} B", $"P{player} A", $"P{player} C Up", $"P{player} C Down", $"P{player} C Left", $"P{player} C Right", $"P{player} L", $"P{player} R" });
def.AddXYPair(
@ -40,15 +39,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
0,
new CircularAxisConstraint("Natural Circle", $"P{player} Y Axis", 127.0f)
);
if (hasRumblePak) def.HapticsChannels.Add($"P{player} Rumble Pak");
}
ControllerDefinition.BoolButtons.Clear();
ControllerDefinition.Axes.Clear();
ControllerDefinition.BoolButtons.AddRange(new[] { "Reset", "Power" });
for (var i = 1; i <= 4; i++)
for (var i = 0; i < 4; i++)
{
if (_syncSettings.Controllers[i - 1].IsConnected) AddN64StandardController(ControllerDefinition, i);
if (_syncSettings.Controllers[i].IsConnected)
{
AddN64StandardController(
ControllerDefinition,
i + 1,
syncSettings.Controllers[i].PakType == N64SyncSettings.N64ControllerSettings.N64ControllerPakType.RUMBLE_PAK);
}
}
}
}

View File

@ -130,7 +130,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
api.frame_advance();
api.frame_advance();
SetControllerButtons();
SetControllerButtons(_syncSettings);
}
private readonly N64Input _inputProvider;