diff --git a/src/BizHawk.Client.Common/Controller.cs b/src/BizHawk.Client.Common/Controller.cs index e159e8fd0f..eba8729950 100644 --- a/src/BizHawk.Client.Common/Controller.cs +++ b/src/BizHawk.Client.Common/Controller.cs @@ -48,6 +48,11 @@ namespace BizHawk.Client.Common private readonly Dictionary _feedbackBindings = new Dictionary(); +#if BIZHAWKBUILD_SUPERHAWK + public bool AnyInputHeld + => _buttons.ContainsValue(true) || _axes.Any(kvp => kvp.Value != _axisRanges[kvp.Key].Neutral); +#endif + public bool this[string button] => IsPressed(button); // Looks for bindings which are activated by the supplied physical button. diff --git a/src/BizHawk.Client.Common/config/Config.cs b/src/BizHawk.Client.Common/config/Config.cs index e41402915f..c58a6383de 100644 --- a/src/BizHawk.Client.Common/config/Config.cs +++ b/src/BizHawk.Client.Common/config/Config.cs @@ -203,6 +203,9 @@ namespace BizHawk.Client.Common public bool Unthrottled { get; set; } = false; public bool AutoMinimizeSkipping { get; set; } = true; public bool VSyncThrottle { get; set; } = false; +#if BIZHAWKBUILD_SUPERHAWK + public bool SuperHawkThrottle { get; set; } = false; +#endif public RewindConfig Rewind { get; set; } = new RewindConfig(); diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 8d33094981..42cc3d1feb 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -75,6 +75,15 @@ namespace BizHawk.Client.EmuHawk } } +#if BIZHAWKBUILD_SUPERHAWK + ToolStripMenuItemEx superHawkThrottleMenuItem = new() { Text = "SUPER·HAWK" }; + superHawkThrottleMenuItem.Click += (_, _) => Config.SuperHawkThrottle = !Config.SuperHawkThrottle; + SpeedSkipSubMenu.DropDownItems.Insert( + SpeedSkipSubMenu.DropDownItems.IndexOf(MinimizeSkippingMenuItem), + superHawkThrottleMenuItem); + ConfigSubMenu.DropDownOpened += (_, _) => superHawkThrottleMenuItem.Checked = Config.SuperHawkThrottle; +#endif + foreach (var (appliesTo, coreNames) in Config.CorePickerUIData) { var submenu = new ToolStripMenuItem { Text = string.Join(" | ", appliesTo) }; @@ -2976,7 +2985,11 @@ namespace BizHawk.Client.EmuHawk _frameAdvanceTimestamp = 0; } +#if BIZHAWKBUILD_SUPERHAWK + if (!EmulatorPaused && (!Config.SuperHawkThrottle || InputManager.ClientControls.AnyInputHeld)) +#else if (!EmulatorPaused) +#endif { runFrame = true; }