apply ares64 changes to frontend

This commit is contained in:
CasualPokePlayer 2022-02-13 02:47:21 -08:00
parent 28cfb1aa74
commit c3e6a08b42
4 changed files with 14 additions and 10 deletions

View File

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

View File

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

View File

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

View File

@ -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<bool, AxisSpec> MupenRange = (bool isY) => new((-128).RangeTo(127), 0, false);
private static readonly Func<bool, AxisSpec> AresRange = (bool isY) => new((-32768).RangeTo(32767), 0, isY);
private static readonly Func<AxisSpec> MakeRange = () => new((-128).RangeTo(127), 0);
private static PadSchema StandardController(int controller, Func<bool, AxisSpec> 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()
}
}
};