SNES - hook up power cycle to mnemonics for recording & input display, TAStudio - hook up the power button on virtual pad

This commit is contained in:
adelikat 2012-09-16 17:39:57 +00:00
parent ef710a84b9
commit 32ca8fba61
3 changed files with 51 additions and 4 deletions

View File

@ -121,7 +121,7 @@ namespace BizHawk.MultiClient
{"Gameboy Controller", new Dictionary<string, string>() {{"Power", "P"}}},
{"Genesis 3-Button Controller", new Dictionary<string, string>() {}},
{"NES Controller", new Dictionary<string, string>() {{"Reset", "r"}}},
{"SNES Controller", new Dictionary<string, string>() {{"Reset", "r"}}},
{"SNES Controller", new Dictionary<string, string>() {{"Power", "P"}, {"Reset", "r"}}},
{"PC Engine Controller", new Dictionary<string, string>() {}},
{"SMS Controller", new Dictionary<string, string>() {{"Pause", "p"}, {"Reset", "r"}}},
{"TI83 Controller", new Dictionary<string, string>() {}}

View File

@ -366,6 +366,16 @@ namespace BizHawk.MultiClient
{
StringBuilder input = new StringBuilder("|");
input.Append(IsBasePressed("Reset") ? Global.COMMANDS[ControlType]["Reset"] : ".");
if (IsBasePressed("Power"))
{
input.Append(Global.COMMANDS[ControlType]["Power"]);
}
else if (IsBasePressed("Reset"))
{
input.Append(Global.COMMANDS[ControlType]["Reset"]);
}
input.Append("|");
for (int player = 1; player <= Global.PLAYERS[ControlType]; player++)
{
@ -608,6 +618,16 @@ namespace BizHawk.MultiClient
}
Force("Reset", mnemonic[1] != '.' && mnemonic[1] != '0' && mnemonic[1] != 'l');
if (mnemonic[1] == 'P')
{
Force("Power", true);
}
else if (mnemonic[1] != '.' && mnemonic[1] != '0')
{
Force("Reset", true);
}
for (int player = 1; player <= Global.PLAYERS[ControlType]; player++)
{
int srcindex = (player - 1) * (Global.BUTTONS[ControlType].Count + 1);

View File

@ -36,7 +36,6 @@ namespace BizHawk.MultiClient
this.B1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
this.B1.UseVisualStyleBackColor = true;
this.B1.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged);
this.B1.Enabled = false; //Until a hard reset is emulated by SNESHawk
this.B1.ForeColor = Color.Red;
this.B2 = new CheckBox();
@ -88,7 +87,18 @@ namespace BizHawk.MultiClient
public override string GetMnemonic()
{
StringBuilder input = new StringBuilder("");
input.Append(B2.Checked ? "r" : ".");
if (B1.Checked)
{
input.Append('P');
}
else if (B2.Checked)
{
input.Append('r');
}
else
{
input.Append('.');
}
input.Append("|");
return input.ToString();
}
@ -96,10 +106,14 @@ namespace BizHawk.MultiClient
public override void SetButtons(string buttons)
{
if (buttons.Length < 1) return;
if (buttons[0] == '.' || buttons[0] == 'l' || buttons[0] == '0')
if (buttons[0] == '.' || buttons[0] == '0')
{
B2.Checked = false;
}
else if (buttons[0] == 'P')
{
B1.Checked = true;
}
else
{
B2.Checked = true;
@ -112,6 +126,18 @@ namespace BizHawk.MultiClient
{
return;
}
else if (sender == B1)
{
Global.StickyXORAdapter.SetSticky("Power", B1.Checked);
if (B1.Checked == true)
{
B1.BackColor = Color.Pink;
}
else
{
B1.BackColor = SystemColors.Control;
}
}
else if (sender == B2)
{
Global.StickyXORAdapter.SetSticky("Reset", B2.Checked);
@ -137,6 +163,7 @@ namespace BizHawk.MultiClient
B1.Checked = false;
B2.Checked = false;
Global.StickyXORAdapter.SetSticky("Reset", false);
Global.StickyXORAdapter.SetSticky("Power", false);
}
}
}