diff --git a/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs b/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs index 8a81dc3fd4..b260ccca2e 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Sega/Saturn/Saturnus.cs @@ -103,9 +103,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.Saturn protected override HashSet ComputeHiddenPorts() { var devCount = 12; - if (SettingsQuery("ss.input.sport1.multitap") != "1") + if (_isArcade || SettingsQuery("ss.input.sport1.multitap") != "1") devCount -= 5; - if (SettingsQuery("ss.input.sport2.multitap") != "1") + if (_isArcade || SettingsQuery("ss.input.sport2.multitap") != "1") devCount -= 5; var ret = new HashSet(); for (var i = 1; i <= 12; i++) diff --git a/src/BizHawk.Emulation.Cores/Waterbox/LibNymaCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/LibNymaCore.cs index 11655d607e..abcf2248e6 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/LibNymaCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/LibNymaCore.cs @@ -123,6 +123,13 @@ namespace BizHawk.Emulation.Cores.Waterbox [BizImport(CC)] public abstract void SetLayers(ulong layers); + /// + /// Gets an input device override for a port + /// Corresponds to Game->DesiredInput[port].device_name + /// + [BizImport(CC)] + public abstract IntPtr GetInputDeviceOverride(int port); + [BizImport(CC)] public abstract void DumpInputs(); diff --git a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs index 13336b18c0..f8002171ca 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.Controller.cs @@ -35,6 +35,9 @@ namespace BizHawk.Emulation.Cores.Waterbox int thunkWriteOffset) => ret.AddAxis(name, 0.RangeTo(0xFFFF), 0x8000, isReversed); + private string GetInputDeviceOverride(int port) + => Mershul.PtrToStringUtf8(_nyma.GetInputDeviceOverride(port)); + private void InitControls(List allPorts, int numCds, ref SystemInfo si) { _controllerAdapter = new ControllerAdapter( @@ -43,6 +46,7 @@ namespace BizHawk.Emulation.Cores.Waterbox OverrideButtonName, numCds, ref si, + GetInputDeviceOverride, ComputeHiddenPorts(), AddAxis, _controllerDeckName); @@ -66,6 +70,7 @@ namespace BizHawk.Emulation.Cores.Waterbox Func overrideName, int numCds, ref SystemInfo systemInfo, + Func getInputDeviceOverride, HashSet hiddenPorts, AddAxisHook addAxisHook, string controllerDeckName) @@ -89,7 +94,15 @@ namespace BizHawk.Emulation.Cores.Waterbox for (int port = 0, devByteStart = 0; port < allPorts.Count; port++) { var portInfo = allPorts[port]; - if (!config.TryGetValue(port, out var deviceName)) deviceName = portInfo.DefaultDeviceShortName; + var deviceName = getInputDeviceOverride(port); + if (deviceName == null) + { + if (!config.TryGetValue(port, out deviceName)) + { + deviceName = portInfo.DefaultDeviceShortName; + } + } + finalDevices.Add(deviceName); if (hiddenPorts.Contains(portInfo.ShortName)) diff --git a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.cs index 69dd2f1da5..be88a2155a 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/NymaCore.cs @@ -255,7 +255,7 @@ namespace BizHawk.Emulation.Cores.Waterbox private IController _currentController; - private bool _isArcade; + protected bool _isArcade; protected override LibWaterboxCore.FrameInfo FrameAdvancePrep(IController controller, bool render, bool rendersound) {