BSNESv115: better define allowed input devices for port 1

- also allows the multitap and payload controller to be used, as it makes sense
This commit is contained in:
Morilli 2022-06-16 17:40:29 +02:00
parent 2c3b6b3cd4
commit 363afcd551
7 changed files with 16 additions and 15 deletions

View File

@ -72,10 +72,6 @@ namespace BizHawk.Client.EmuHawk
| System.Windows.Forms.AnchorStyles.Right)));
this.Port2ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.Port2ComboBox.FormattingEnabled = true;
this.Port2ComboBox.Items.AddRange(new object[] {
"None",
"Gamepad",
"Mouse"});
this.Port2ComboBox.Location = new System.Drawing.Point(12, 104);
this.Port2ComboBox.Name = "Port2ComboBox";
this.Port2ComboBox.Size = new System.Drawing.Size(284, 21);
@ -88,10 +84,6 @@ namespace BizHawk.Client.EmuHawk
| System.Windows.Forms.AnchorStyles.Right)));
this.Port1ComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.Port1ComboBox.FormattingEnabled = true;
this.Port1ComboBox.Items.AddRange(new object[] {
"None",
"Gamepad",
"Mouse"});
this.Port1ComboBox.Location = new System.Drawing.Point(12, 54);
this.Port1ComboBox.Name = "Port1ComboBox";
this.Port1ComboBox.Size = new System.Drawing.Size(284, 21);

View File

@ -24,20 +24,20 @@ namespace BizHawk.Client.EmuHawk
{
LimitAnalogChangeCheckBox.Checked = _syncSettings.LimitAnalogChangeSensitivity;
Port1ComboBox.SelectedIndex = (int) _syncSettings.LeftPort >= Port1ComboBox.Items.Count ? 0 : (int) _syncSettings.LeftPort;
Port1ComboBox.PopulateFromEnum(_syncSettings.LeftPort);
Port2ComboBox.PopulateFromEnum(_syncSettings.RightPort);
}
private void OkBtn_Click(object sender, EventArgs e)
{
bool changed =
_syncSettings.LeftPort != (BsnesApi.BSNES_INPUT_DEVICE) Port1ComboBox.SelectedIndex
_syncSettings.LeftPort != (BsnesApi.BSNES_PORT1_INPUT_DEVICE) Port1ComboBox.SelectedIndex
|| _syncSettings.RightPort != (BsnesApi.BSNES_INPUT_DEVICE) Port2ComboBox.SelectedIndex
|| _syncSettings.LimitAnalogChangeSensitivity != LimitAnalogChangeCheckBox.Checked;
if (changed)
{
_syncSettings.LeftPort = (BsnesApi.BSNES_INPUT_DEVICE) Port1ComboBox.SelectedIndex;
_syncSettings.LeftPort = (BsnesApi.BSNES_PORT1_INPUT_DEVICE) Port1ComboBox.SelectedIndex;
_syncSettings.RightPort = (BsnesApi.BSNES_INPUT_DEVICE) Port2ComboBox.SelectedIndex;
_syncSettings.LimitAnalogChangeSensitivity = LimitAnalogChangeCheckBox.Checked;

View File

@ -246,7 +246,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
public struct SnesInitData
{
public ENTROPY entropy;
public BSNES_INPUT_DEVICE left_port;
public BSNES_PORT1_INPUT_DEVICE left_port;
public BSNES_INPUT_DEVICE right_port;
public bool hotfixes;
public bool fast_ppu;

View File

@ -34,6 +34,15 @@
Justifiers
}
public enum BSNES_PORT1_INPUT_DEVICE
{
None,
Gamepad,
Mouse,
SuperMultitap,
Payload
}
public enum ENTROPY
{
None,

View File

@ -39,7 +39,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
{
_ports = new[]
{
GetController(ss.LeftPort, ss),
GetController((BSNES_INPUT_DEVICE)ss.LeftPort, ss),
GetController(ss.RightPort, ss)
};

View File

@ -67,7 +67,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.BSNES
public class SnesSyncSettings
{
public BsnesApi.BSNES_INPUT_DEVICE LeftPort { get; set; } = BsnesApi.BSNES_INPUT_DEVICE.Gamepad;
public BsnesApi.BSNES_PORT1_INPUT_DEVICE LeftPort { get; set; } = BsnesApi.BSNES_PORT1_INPUT_DEVICE.Gamepad;
public BsnesApi.BSNES_INPUT_DEVICE RightPort { get; set; } = BsnesApi.BSNES_INPUT_DEVICE.None;

View File

@ -118,7 +118,7 @@ namespace BizHawk.Emulation.Cores
var ports = new[]
{
syncSettings.LeftPort,
(BsnesApi.BSNES_INPUT_DEVICE) syncSettings.LeftPort,
syncSettings.RightPort
};