diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.ISettable.cs index 647283a62c..06fad7fb83 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.ISettable.cs @@ -44,6 +44,11 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Ares64 [DefaultValue(LibAres64.ControllerType.Unplugged)] public LibAres64.ControllerType P4Controller { get; set; } + [DisplayName("Restrict Analog Range")] + [Description("Restricts analog range to account for physical limitations.")] + [DefaultValue(false)] + public bool RestrictAnalogRange { get; set; } + public Ares64SyncSettings() => SettingsUtil.SetDefaultValues(this); public Ares64SyncSettings Clone() => MemberwiseClone() as Ares64SyncSettings; diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs index 6444280fb7..df894c6033 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/Ares64.cs @@ -73,7 +73,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Ares64 _exe.AddReadonlyFile(pif, pal ? "pif.pal.rom" : "pif.ntsc.rom"); _exe.AddReadonlyFile(rom, "program.rom"); - if (!_core.Init(ControllerSettings, pal)) + if (!_core.Init(ControllerSettings, _syncSettings.RestrictAnalogRange, pal)) { throw new InvalidOperationException("Init returned false!"); } @@ -114,7 +114,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Ares64 ret.BoolButtons.Add($"P{i + 1} C Right"); ret.BoolButtons.Add($"P{i + 1} L"); ret.BoolButtons.Add($"P{i + 1} R"); - ret.AddXYPair($"P{i + 1} {{0}} Axis", AxisPairOrientation.RightAndDown, (-32768).RangeTo(32767), 0); + ret.AddXYPair($"P{i + 1} {{0}} Axis", AxisPairOrientation.RightAndUp, (-128).RangeTo(127), 0); if (controllerSettings[i] == LibAres64.ControllerType.Rumblepak) { ret.HapticsChannels.Add($"P{i + 1} Rumble Pak"); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/LibAres64.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/LibAres64.cs index 1e85054655..f96428bb3b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/LibAres64.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64/LibAres64.cs @@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.Ares64 } [BizImport(CC)] - public abstract bool Init(ControllerType[] controllerSettings, bool pal); + public abstract bool Init(ControllerType[] controllerSettings, bool restrictAnalogRange, bool pal); [BizImport(CC)] public abstract bool GetRumbleStatus(int num); diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/N64Schema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/N64Schema.cs index 0168e2a7d2..647b3ff835 100644 --- a/src/BizHawk.Emulation.Cores/vpads_schemata/N64Schema.cs +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/N64Schema.cs @@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Cores { if (ss.Controllers[i].IsConnected) { - yield return StandardController(i + 1, MupenRange); + yield return StandardController(i + 1); } } } @@ -32,16 +32,15 @@ namespace BizHawk.Emulation.Cores { if (ares64.ControllerSettings[i] != LibAres64.ControllerType.Unplugged) { - yield return StandardController(i + 1, AresRange); + yield return StandardController(i + 1); } } } } - private static readonly Func MupenRange = (bool isY) => new((-128).RangeTo(127), 0, false); - private static readonly Func AresRange = (bool isY) => new((-32768).RangeTo(32767), 0, isY); + private static readonly Func MakeRange = () => new((-128).RangeTo(127), 0); - private static PadSchema StandardController(int controller, Func makeRange) + private static PadSchema StandardController(int controller) { return new PadSchema { @@ -64,8 +63,8 @@ namespace BizHawk.Emulation.Cores new ButtonSchema(194, 221, controller, "C Right") { Icon = VGamepadButtonImage.YellowArrE }, new AnalogSchema(6, 14, $"P{controller} X Axis") { - Spec = makeRange(false), - SecondarySpec = makeRange(true) + Spec = MakeRange(), + SecondarySpec = MakeRange() } } };