diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 8bf6329861..3c00b8ebe6 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -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, diff --git a/src/BizHawk.Emulation.Common/Base Implementations/ControllerDefinition.cs b/src/BizHawk.Emulation.Common/Base Implementations/ControllerDefinition.cs index 55a1cbd387..8cde94dfc7 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/ControllerDefinition.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/ControllerDefinition.cs @@ -10,12 +10,7 @@ namespace BizHawk.Emulation.Common /// public class ControllerDefinition { - public ControllerDefinition() - { -#if DEBUG - HapticsChannels.Add("Debug"); -#endif - } + public ControllerDefinition() {} public ControllerDefinition(ControllerDefinition source) : this() diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ISettable.cs index 044356eaa2..6ae79a158a 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.ISettable.cs @@ -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); + } } } } diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs index 2d49c7f01f..40fc52c6a5 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/N64.cs @@ -130,7 +130,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64 api.frame_advance(); api.frame_advance(); - SetControllerButtons(); + SetControllerButtons(_syncSettings); } private readonly N64Input _inputProvider;