Add novel throttle experiment (locked behind build flag for now)

:)
This commit is contained in:
YoshiRulz 2025-02-18 05:12:06 +10:00
parent 72f880db27
commit d3362f5e0c
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 21 additions and 0 deletions

View File

@ -48,6 +48,11 @@ namespace BizHawk.Client.Common
private readonly Dictionary<string, FeedbackBind> _feedbackBindings = new Dictionary<string, FeedbackBind>();
#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.

View File

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

View File

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