Genesis - implement Reset button on client side (not yet hooked up in core)

This commit is contained in:
adelikat 2012-11-08 04:33:18 +00:00
parent c32cef4bc4
commit 68cba7d792
6 changed files with 36 additions and 13 deletions

View File

@ -59,6 +59,7 @@ namespace BizHawk.MultiClient
NESConsoleButtons = new NESConsoleButtonTemplate();
SNESConsoleButtons = new NESConsoleButtonTemplate();
SMSConsoleButtons = new SMSConsoleButtonTemplate();
GenesisConsoleButtons = new GenConsoleButtonTemplate();
}
// Directories
@ -650,6 +651,7 @@ namespace BizHawk.MultiClient
// Genesis Settings
public GenControllerTemplate[] GenesisController = new GenControllerTemplate[1];
public GenControllerTemplate[] GenesisAutoController = new GenControllerTemplate[1];
public GenConsoleButtonTemplate GenesisConsoleButtons = new GenConsoleButtonTemplate();
//Atari 2600 Settings
public Atari2600ControllerTemplate[] Atari2600Controller = new Atari2600ControllerTemplate[2];
@ -734,6 +736,11 @@ namespace BizHawk.MultiClient
public string Pause = "V, X1 Start";
}
public class GenConsoleButtonTemplate
{
public string Reset = "";
}
public class SMSControllerTemplate
{
public string Up;
@ -865,8 +872,8 @@ namespace BizHawk.MultiClient
public string Right;
public string A;
public string B;
public string Start;
public string Select;
public string Start;
public bool Enabled;
public NESControllerTemplate() { }
public NESControllerTemplate(bool defaults)

View File

@ -120,7 +120,7 @@ namespace BizHawk.MultiClient
{
{"Atari 2600 Basic Controller", new Dictionary<string, string>() {{"Reset", "r"}, {"Select", "s"}}},
{"Gameboy Controller", new Dictionary<string, string>() {{"Power", "P"}}},
{"Genesis 3-Button Controller", new Dictionary<string, string>() {}},
{"Genesis 3-Button Controller", new Dictionary<string, string>() {{"Reset", "r"}}},
{"NES Controller", new Dictionary<string, string>() {{"Reset", "r"}, {"Power", "P"}}},
{"SNES Controller", new Dictionary<string, string>() {{"Power", "P"}, {"Reset", "r"}}},
{"PC Engine Controller", new Dictionary<string, string>() {}},

View File

@ -900,6 +900,7 @@ namespace BizHawk.MultiClient
genControls.BindMulti("P1 B", Global.Config.GenesisController[0].B);
genControls.BindMulti("P1 C", Global.Config.GenesisController[0].C);
genControls.BindMulti("P1 Start", Global.Config.GenesisController[0].Start);
genControls.BindMulti("Reset", Global.Config.GenesisConsoleButtons.Reset);
Global.GenControls = genControls;
var agenControls = new AutofireController(Genesis.GenesisController);

View File

@ -118,6 +118,7 @@
this.SNESController2Panel = new BizHawk.MultiClient.ControllerConfigPanel();
this.SNESController3Panel = new BizHawk.MultiClient.ControllerConfigPanel();
this.SNESController4Panel = new BizHawk.MultiClient.ControllerConfigPanel();
this.SNESConsoleButtons = new BizHawk.MultiClient.ControllerConfigPanel();
this.SNESAutofire1Panel = new BizHawk.MultiClient.ControllerConfigPanel();
this.SNESAutofire2Panel = new BizHawk.MultiClient.ControllerConfigPanel();
this.SNESAutofire3Panel = new BizHawk.MultiClient.ControllerConfigPanel();
@ -147,7 +148,7 @@
this.Atari2600Autofire1Panel = new BizHawk.MultiClient.ControllerConfigPanel();
this.Atari2600Autofire2Panel = new BizHawk.MultiClient.ControllerConfigPanel();
this.TI83ControllerPanel = new BizHawk.MultiClient.ControllerConfigPanel();
this.SNESConsoleButtons = new BizHawk.MultiClient.ControllerConfigPanel();
this.GenesisConsoleButtons = new BizHawk.MultiClient.ControllerConfigPanel();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ControllerImage)).BeginInit();
@ -182,6 +183,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
this.tabControl9.SuspendLayout();
this.tabPage52.SuspendLayout();
this.tabPage54.SuspendLayout();
this.tabPage55.SuspendLayout();
this.tabPage4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
@ -630,6 +632,7 @@
//
// tabPage54
//
this.tabPage54.Controls.Add(this.GenesisConsoleButtons);
this.tabPage54.Location = new System.Drawing.Point(4, 22);
this.tabPage54.Name = "tabPage54";
this.tabPage54.Size = new System.Drawing.Size(434, 375);
@ -1187,6 +1190,13 @@
this.SNESController4Panel.Size = new System.Drawing.Size(392, 332);
this.SNESController4Panel.TabIndex = 3;
//
// SNESConsoleButtons
//
this.SNESConsoleButtons.Location = new System.Drawing.Point(15, 13);
this.SNESConsoleButtons.Name = "SNESConsoleButtons";
this.SNESConsoleButtons.Size = new System.Drawing.Size(368, 125);
this.SNESConsoleButtons.TabIndex = 1;
//
// SNESAutofire1Panel
//
this.SNESAutofire1Panel.Location = new System.Drawing.Point(16, 19);
@ -1393,12 +1403,12 @@
this.TI83ControllerPanel.Size = new System.Drawing.Size(567, 414);
this.TI83ControllerPanel.TabIndex = 1;
//
// SNESConsoleButtons
// GenesisConsoleButtons
//
this.SNESConsoleButtons.Location = new System.Drawing.Point(15, 13);
this.SNESConsoleButtons.Name = "SNESConsoleButtons";
this.SNESConsoleButtons.Size = new System.Drawing.Size(368, 125);
this.SNESConsoleButtons.TabIndex = 1;
this.GenesisConsoleButtons.Location = new System.Drawing.Point(13, 14);
this.GenesisConsoleButtons.Name = "GenesisConsoleButtons";
this.GenesisConsoleButtons.Size = new System.Drawing.Size(368, 125);
this.GenesisConsoleButtons.TabIndex = 1;
//
// ControllerConfig
//
@ -1449,6 +1459,7 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit();
this.tabControl9.ResumeLayout(false);
this.tabPage52.ResumeLayout(false);
this.tabPage54.ResumeLayout(false);
this.tabPage55.ResumeLayout(false);
this.tabPage4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
@ -1610,5 +1621,6 @@
private ControllerConfigPanel SMSConsoleButtons;
private ControllerConfigPanel Atari2600ConsoleButtons;
private ControllerConfigPanel SNESConsoleButtons;
private ControllerConfigPanel GenesisConsoleButtons;
}
}

View File

@ -55,6 +55,7 @@ namespace BizHawk.MultiClient
GenesisController1Panel.LoadSettings(Global.Config.GenesisController[0]);
GenesisAutofire1Panel.LoadSettings(Global.Config.GenesisAutoController[0]);
GenesisConsoleButtons.LoadSettings(Global.Config.GenesisConsoleButtons);
SMSController1Panel.LoadSettings(Global.Config.SMSController[0]);
SMSController2Panel.LoadSettings(Global.Config.SMSController[1]);

View File

@ -412,10 +412,7 @@ namespace BizHawk.MultiClient
StringBuilder input = new StringBuilder("|");
if (
ControlType == "Genesis 3-Button Controller" || // ControlType == "Gameboy Controller" ||
ControlType == "PC Engine Controller"
)
if (ControlType == "PC Engine Controller")
{
input.Append(".");
}
@ -424,7 +421,7 @@ namespace BizHawk.MultiClient
input.Append(IsBasePressed("Reset") ? "r" : ".");
input.Append(IsBasePressed("Select") ? "s" : ".");
}
if (ControlType == "NES Controller")
if (ControlType == "NES Controller" || ControlType == "Genesis 3-Button Controller")
{
if (IsBasePressed("Power"))
{
@ -704,6 +701,11 @@ namespace BizHawk.MultiClient
if (mnemonic.Length < 2) return;
Force("Power", mnemonic[1] != '.');
}
if (ControlType == "Genesis 3-Button Controller")
{
if (mnemonic.Length < 2) return;
Force("Reset", mnemonic[1] != '.');
}
if (ControlType == "SMS Controller" || ControlType == "TI83 Controller")
{
start = 1;