make circular analog range setting work in ares

This commit is contained in:
Morilli 2025-02-13 04:07:35 +01:00
parent 69a938f29b
commit 26115624e4
3 changed files with 6 additions and 4 deletions

View File

@ -191,7 +191,7 @@ namespace BizHawk.Client.Common
public ClientProfile SelectedProfile { get; set; } = ClientProfile.Unknown;
// N64
// TODO: make this not N64-specific, it doesn't need to be
public bool N64UseCircularAnalogConstraint { get; set; } = true;
// Run-Control settings

View File

@ -872,8 +872,10 @@ namespace BizHawk.Client.EmuHawk
InputManager.ActiveController.LatchFromPhysical(finalHostController);
InputManager.ActiveController.ApplyAxisConstraints(
(Emulator is N64 && Config.N64UseCircularAnalogConstraint) ? "Natural Circle" : null);
if (Config.N64UseCircularAnalogConstraint)
{
InputManager.ActiveController.ApplyAxisConstraints("Natural Circle");
}
InputManager.ActiveController.OR_FromLogical(InputManager.ClickyVirtualPadController);
InputManager.AutoFireController.LatchFromPhysical(finalHostController);

View File

@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Common
var length = Math.Sqrt(xVal * xVal + yVal * yVal);
var ratio = Magnitude / length;
return ratio < 1.0
? ((int) (xVal * ratio), (int) (yVal * ratio))
? ((int) Math.Round(xVal * ratio), (int) Math.Round(yVal * ratio))
: ((int) xVal, (int) yVal);
}
}