Remove "Debug" haptic channel and debug hotkey, prepare Mupen
This commit is contained in:
parent
045c4815a4
commit
52333e4862
|
@ -703,8 +703,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// handle events and dispatch as a hotkey action, or a hotkey button, or an input button
|
// 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
|
// ...but prepare haptics first, those get read in ProcessInput
|
||||||
var finalHostController = (ControllerInputCoalescer) InputManager.ControllerInputCoalescer;
|
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);
|
InputManager.ActiveController.PrepareHapticsForHost(finalHostController);
|
||||||
ProcessInput(
|
ProcessInput(
|
||||||
_hotkeyCoalescer,
|
_hotkeyCoalescer,
|
||||||
|
|
|
@ -10,12 +10,7 @@ namespace BizHawk.Emulation.Common
|
||||||
/// <seealso cref="IEmulator" />
|
/// <seealso cref="IEmulator" />
|
||||||
public class ControllerDefinition
|
public class ControllerDefinition
|
||||||
{
|
{
|
||||||
public ControllerDefinition()
|
public ControllerDefinition() {}
|
||||||
{
|
|
||||||
#if DEBUG
|
|
||||||
HapticsChannels.Add("Debug");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
public ControllerDefinition(ControllerDefinition source)
|
public ControllerDefinition(ControllerDefinition source)
|
||||||
: this()
|
: this()
|
||||||
|
|
|
@ -23,14 +23,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
|
||||||
|
|
||||||
public PutSettingsDirtyBits PutSyncSettings(N64SyncSettings o)
|
public PutSettingsDirtyBits PutSyncSettings(N64SyncSettings o)
|
||||||
{
|
{
|
||||||
_syncSettings = o;
|
SetControllerButtons(_syncSettings = o);
|
||||||
SetControllerButtons();
|
|
||||||
return PutSettingsDirtyBits.RebootCore;
|
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.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(
|
def.AddXYPair(
|
||||||
|
@ -40,15 +39,22 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
|
||||||
0,
|
0,
|
||||||
new CircularAxisConstraint("Natural Circle", $"P{player} Y Axis", 127.0f)
|
new CircularAxisConstraint("Natural Circle", $"P{player} Y Axis", 127.0f)
|
||||||
);
|
);
|
||||||
|
if (hasRumblePak) def.HapticsChannels.Add($"P{player} Rumble Pak");
|
||||||
}
|
}
|
||||||
|
|
||||||
ControllerDefinition.BoolButtons.Clear();
|
ControllerDefinition.BoolButtons.Clear();
|
||||||
ControllerDefinition.Axes.Clear();
|
ControllerDefinition.Axes.Clear();
|
||||||
|
|
||||||
ControllerDefinition.BoolButtons.AddRange(new[] { "Reset", "Power" });
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
|
||||||
api.frame_advance();
|
api.frame_advance();
|
||||||
api.frame_advance();
|
api.frame_advance();
|
||||||
|
|
||||||
SetControllerButtons();
|
SetControllerButtons(_syncSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly N64Input _inputProvider;
|
private readonly N64Input _inputProvider;
|
||||||
|
|
Loading…
Reference in New Issue