diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index e89f5c4aaa..966c5c7fac 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -544,6 +544,18 @@ VirtualPadN64.cs + + UserControl + + + VirtualPadSaturn.cs + + + UserControl + + + VirtualPadSaturnControl.cs + Component @@ -697,6 +709,12 @@ VirtualPadN64.cs + + VirtualPadSaturn.cs + + + VirtualPadSaturnControl.cs + SettingsSingleFileGenerator Settings.Designer.cs diff --git a/BizHawk.MultiClient/movie/MovieMnemonics.cs b/BizHawk.MultiClient/movie/MovieMnemonics.cs index 574d086138..65b288271b 100644 --- a/BizHawk.MultiClient/movie/MovieMnemonics.cs +++ b/BizHawk.MultiClient/movie/MovieMnemonics.cs @@ -119,8 +119,8 @@ namespace BizHawk.MultiClient "Saturn Controller", new Dictionary() { {"Up", "U"}, {"Down", "D"}, {"Left", "L"}, {"Right", "R"}, - {"Start", "S"}, {"Z", "Z"}, {"Y", "Y"}, {"X", "X"}, {"C", "C"}, {"B", "B"}, {"A", "A"}, - {"L", "L"}, {"R", "R"}, + {"Start", "S"}, {"X", "X"}, {"Y", "Y"}, {"Z", "Z"}, {"A", "A"}, {"B", "B"}, {"C", "C"}, + {"L", "l"}, {"R", "r"}, } } }; diff --git a/BizHawk.MultiClient/tools/VirtualPadA78Control.Designer.cs b/BizHawk.MultiClient/tools/VirtualPadA78Control.Designer.cs index 6f412bc9c4..098dc3c271 100644 --- a/BizHawk.MultiClient/tools/VirtualPadA78Control.Designer.cs +++ b/BizHawk.MultiClient/tools/VirtualPadA78Control.Designer.cs @@ -92,6 +92,7 @@ this.Controls.Add(this.B1); this.Name = "VirtualPadA78Control"; this.Size = new System.Drawing.Size(217, 34); + this.Load += new System.EventHandler(this.VirtualPadA78Control_Load); this.ResumeLayout(false); this.PerformLayout(); diff --git a/BizHawk.MultiClient/tools/VirtualPadA78Control.cs b/BizHawk.MultiClient/tools/VirtualPadA78Control.cs index 510199a191..03474c0124 100644 --- a/BizHawk.MultiClient/tools/VirtualPadA78Control.cs +++ b/BizHawk.MultiClient/tools/VirtualPadA78Control.cs @@ -106,5 +106,10 @@ namespace BizHawk.MultiClient B3.Checked = false; B4.Checked = false; } + + private void VirtualPadA78Control_Load(object sender, EventArgs e) + { + + } } } diff --git a/BizHawk.MultiClient/tools/VirtualPadForm.Designer.cs b/BizHawk.MultiClient/tools/VirtualPadForm.Designer.cs index 7391cc7528..268f01029b 100644 --- a/BizHawk.MultiClient/tools/VirtualPadForm.Designer.cs +++ b/BizHawk.MultiClient/tools/VirtualPadForm.Designer.cs @@ -38,10 +38,10 @@ this.autolaodToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveWindowPositionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.StickyBox = new System.Windows.Forms.CheckBox(); this.restoreDefaultSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.StickyBox = new System.Windows.Forms.CheckBox(); this.contextMenuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); @@ -54,7 +54,7 @@ this.ControllerBox.ContextMenuStrip = this.contextMenuStrip1; this.ControllerBox.Location = new System.Drawing.Point(9, 26); this.ControllerBox.Name = "ControllerBox"; - this.ControllerBox.Size = new System.Drawing.Size(367, 251); + this.ControllerBox.Size = new System.Drawing.Size(431, 251); this.ControllerBox.TabIndex = 5; this.ControllerBox.TabStop = false; this.ControllerBox.Text = "Controllers"; @@ -79,7 +79,7 @@ this.optionsToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(388, 24); + this.menuStrip1.Size = new System.Drawing.Size(452, 24); this.menuStrip1.TabIndex = 6; this.menuStrip1.Text = "menuStrip1"; // @@ -116,6 +116,18 @@ this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(196, 6); // + // restoreDefaultSettingsToolStripMenuItem + // + this.restoreDefaultSettingsToolStripMenuItem.Name = "restoreDefaultSettingsToolStripMenuItem"; + this.restoreDefaultSettingsToolStripMenuItem.Size = new System.Drawing.Size(199, 22); + this.restoreDefaultSettingsToolStripMenuItem.Text = "Restore Default Settings"; + this.restoreDefaultSettingsToolStripMenuItem.Click += new System.EventHandler(this.restoreDefaultSettingsToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(196, 6); + // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; @@ -136,23 +148,11 @@ this.StickyBox.UseVisualStyleBackColor = true; this.StickyBox.CheckedChanged += new System.EventHandler(this.StickyBox_CheckedChanged); // - // restoreDefaultSettingsToolStripMenuItem - // - this.restoreDefaultSettingsToolStripMenuItem.Name = "restoreDefaultSettingsToolStripMenuItem"; - this.restoreDefaultSettingsToolStripMenuItem.Size = new System.Drawing.Size(199, 22); - this.restoreDefaultSettingsToolStripMenuItem.Text = "Restore Default Settings"; - this.restoreDefaultSettingsToolStripMenuItem.Click += new System.EventHandler(this.restoreDefaultSettingsToolStripMenuItem_Click); - // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(196, 6); - // // VirtualPadForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(388, 312); + this.ClientSize = new System.Drawing.Size(452, 312); this.Controls.Add(this.ControllerBox); this.Controls.Add(this.StickyBox); this.Controls.Add(this.menuStrip1); diff --git a/BizHawk.MultiClient/tools/VirtualPadForm.cs b/BizHawk.MultiClient/tools/VirtualPadForm.cs index 936562f80b..572a5f2ee0 100644 --- a/BizHawk.MultiClient/tools/VirtualPadForm.cs +++ b/BizHawk.MultiClient/tools/VirtualPadForm.cs @@ -187,6 +187,17 @@ namespace BizHawk.MultiClient ControllerBox.Controls.Add(n64pad3); ControllerBox.Controls.Add(n64pad4); break; + case "SAT": + VirtualPadSaturn saturnpad1 = new VirtualPadSaturn { Location = new Point(8, 19), Controller = "P1" }; + VirtualPadSaturn saturnpad2 = new VirtualPadSaturn { Location = new Point(208, 19), Controller = "P2" }; + Pads.Add(saturnpad1); + Pads.Add(saturnpad2); + ControllerBox.Controls.Add(saturnpad1); + ControllerBox.Controls.Add(saturnpad2); + VirtualPadSaturnControl saturncontrols = new VirtualPadSaturnControl { Location = new Point(8, 125) }; + Pads.Add(saturncontrols); + ControllerBox.Controls.Add(saturncontrols); + break; } //Hack for now diff --git a/BizHawk.MultiClient/tools/VirtualPadSaturn.Designer.cs b/BizHawk.MultiClient/tools/VirtualPadSaturn.Designer.cs new file mode 100644 index 0000000000..1f90e197fb --- /dev/null +++ b/BizHawk.MultiClient/tools/VirtualPadSaturn.Designer.cs @@ -0,0 +1,243 @@ +namespace BizHawk.MultiClient +{ + partial class VirtualPadSaturn + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.BA = new System.Windows.Forms.CheckBox(); + this.BB = new System.Windows.Forms.CheckBox(); + this.BC = new System.Windows.Forms.CheckBox(); + this.BZ = new System.Windows.Forms.CheckBox(); + this.BX = new System.Windows.Forms.CheckBox(); + this.BY = new System.Windows.Forms.CheckBox(); + this.BStart = new System.Windows.Forms.CheckBox(); + this.PL = new System.Windows.Forms.CheckBox(); + this.PD = new System.Windows.Forms.CheckBox(); + this.PR = new System.Windows.Forms.CheckBox(); + this.PU = new System.Windows.Forms.CheckBox(); + this.BL = new System.Windows.Forms.CheckBox(); + this.BR = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // BA + // + this.BA.Appearance = System.Windows.Forms.Appearance.Button; + this.BA.AutoSize = true; + this.BA.Location = new System.Drawing.Point(107, 64); + this.BA.Name = "BA"; + this.BA.Size = new System.Drawing.Size(24, 23); + this.BA.TabIndex = 15; + this.BA.Text = "A"; + this.BA.UseVisualStyleBackColor = true; + this.BA.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // BB + // + this.BB.Appearance = System.Windows.Forms.Appearance.Button; + this.BB.AutoSize = true; + this.BB.Location = new System.Drawing.Point(132, 59); + this.BB.Name = "BB"; + this.BB.Size = new System.Drawing.Size(24, 23); + this.BB.TabIndex = 14; + this.BB.Text = "B"; + this.BB.UseVisualStyleBackColor = true; + this.BB.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // BC + // + this.BC.Appearance = System.Windows.Forms.Appearance.Button; + this.BC.AutoSize = true; + this.BC.Location = new System.Drawing.Point(157, 54); + this.BC.Name = "BC"; + this.BC.Size = new System.Drawing.Size(24, 23); + this.BC.TabIndex = 16; + this.BC.Text = "C"; + this.BC.UseVisualStyleBackColor = true; + this.BC.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // BZ + // + this.BZ.Appearance = System.Windows.Forms.Appearance.Button; + this.BZ.AutoSize = true; + this.BZ.Location = new System.Drawing.Point(156, 27); + this.BZ.Name = "BZ"; + this.BZ.Size = new System.Drawing.Size(24, 23); + this.BZ.TabIndex = 19; + this.BZ.Text = "Z"; + this.BZ.UseVisualStyleBackColor = true; + this.BZ.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // BX + // + this.BX.Appearance = System.Windows.Forms.Appearance.Button; + this.BX.AutoSize = true; + this.BX.Location = new System.Drawing.Point(106, 37); + this.BX.Name = "BX"; + this.BX.Size = new System.Drawing.Size(24, 23); + this.BX.TabIndex = 18; + this.BX.Text = "X"; + this.BX.UseVisualStyleBackColor = true; + this.BX.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // BY + // + this.BY.Appearance = System.Windows.Forms.Appearance.Button; + this.BY.AutoSize = true; + this.BY.Location = new System.Drawing.Point(131, 32); + this.BY.Name = "BY"; + this.BY.Size = new System.Drawing.Size(24, 23); + this.BY.TabIndex = 17; + this.BY.Text = "Y"; + this.BY.UseVisualStyleBackColor = true; + this.BY.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // BStart + // + this.BStart.Appearance = System.Windows.Forms.Appearance.Button; + this.BStart.AutoSize = true; + this.BStart.Location = new System.Drawing.Point(68, 66); + this.BStart.Name = "BStart"; + this.BStart.Size = new System.Drawing.Size(24, 23); + this.BStart.TabIndex = 20; + this.BStart.Text = "S"; + this.BStart.UseVisualStyleBackColor = true; + this.BStart.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // PL + // + this.PL.Appearance = System.Windows.Forms.Appearance.Button; + this.PL.AutoSize = true; + this.PL.Image = global::BizHawk.MultiClient.Properties.Resources.Back; + this.PL.Location = new System.Drawing.Point(6, 38); + this.PL.Name = "PL"; + this.PL.Size = new System.Drawing.Size(22, 22); + this.PL.TabIndex = 7; + this.PL.UseVisualStyleBackColor = true; + this.PL.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // PD + // + this.PD.Appearance = System.Windows.Forms.Appearance.Button; + this.PD.AutoSize = true; + this.PD.Image = global::BizHawk.MultiClient.Properties.Resources.BlueDown; + this.PD.Location = new System.Drawing.Point(27, 47); + this.PD.Name = "PD"; + this.PD.Size = new System.Drawing.Size(22, 22); + this.PD.TabIndex = 6; + this.PD.UseVisualStyleBackColor = true; + this.PD.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // PR + // + this.PR.Appearance = System.Windows.Forms.Appearance.Button; + this.PR.AutoSize = true; + this.PR.Image = global::BizHawk.MultiClient.Properties.Resources.Forward; + this.PR.Location = new System.Drawing.Point(48, 38); + this.PR.Name = "PR"; + this.PR.Size = new System.Drawing.Size(22, 22); + this.PR.TabIndex = 5; + this.PR.UseVisualStyleBackColor = true; + this.PR.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // PU + // + this.PU.Appearance = System.Windows.Forms.Appearance.Button; + this.PU.AutoSize = true; + this.PU.Image = global::BizHawk.MultiClient.Properties.Resources.BlueUp; + this.PU.Location = new System.Drawing.Point(27, 26); + this.PU.Name = "PU"; + this.PU.Size = new System.Drawing.Size(22, 22); + this.PU.TabIndex = 4; + this.PU.UseVisualStyleBackColor = true; + this.PU.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // BL + // + this.BL.Appearance = System.Windows.Forms.Appearance.Button; + this.BL.AutoSize = true; + this.BL.Location = new System.Drawing.Point(3, 3); + this.BL.Name = "BL"; + this.BL.Size = new System.Drawing.Size(23, 23); + this.BL.TabIndex = 21; + this.BL.Text = "L"; + this.BL.UseVisualStyleBackColor = true; + this.BL.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // BR + // + this.BR.Appearance = System.Windows.Forms.Appearance.Button; + this.BR.AutoSize = true; + this.BR.Location = new System.Drawing.Point(169, 3); + this.BR.Name = "BR"; + this.BR.Size = new System.Drawing.Size(25, 23); + this.BR.TabIndex = 22; + this.BR.Text = "R"; + this.BR.UseVisualStyleBackColor = true; + this.BR.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // VirtualPadSaturn + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.BR); + this.Controls.Add(this.BL); + this.Controls.Add(this.BStart); + this.Controls.Add(this.BZ); + this.Controls.Add(this.BX); + this.Controls.Add(this.BY); + this.Controls.Add(this.BC); + this.Controls.Add(this.BA); + this.Controls.Add(this.BB); + this.Controls.Add(this.PL); + this.Controls.Add(this.PD); + this.Controls.Add(this.PR); + this.Controls.Add(this.PU); + this.Name = "VirtualPadSaturn"; + this.Size = new System.Drawing.Size(196, 92); + this.Load += new System.EventHandler(this.VirtualPadSaturn_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox PL; + private System.Windows.Forms.CheckBox PD; + private System.Windows.Forms.CheckBox PR; + private System.Windows.Forms.CheckBox PU; + private System.Windows.Forms.CheckBox BA; + private System.Windows.Forms.CheckBox BB; + private System.Windows.Forms.CheckBox BC; + private System.Windows.Forms.CheckBox BZ; + private System.Windows.Forms.CheckBox BX; + private System.Windows.Forms.CheckBox BY; + private System.Windows.Forms.CheckBox BStart; + private System.Windows.Forms.CheckBox BL; + private System.Windows.Forms.CheckBox BR; + } +} diff --git a/BizHawk.MultiClient/tools/VirtualPadSaturn.cs b/BizHawk.MultiClient/tools/VirtualPadSaturn.cs new file mode 100644 index 0000000000..999ef7fe6e --- /dev/null +++ b/BizHawk.MultiClient/tools/VirtualPadSaturn.cs @@ -0,0 +1,198 @@ +using System; +using System.Text; +using System.Windows.Forms; + +namespace BizHawk.MultiClient +{ + public partial class VirtualPadSaturn : UserControl, IVirtualPad + { + public string Controller = "P1"; + + public VirtualPadSaturn() + { + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + BorderStyle = BorderStyle.Fixed3D; + Paint += VirtualPad_Paint; + InitializeComponent(); + } + + private void VirtualPadSaturn_Load(object sender, EventArgs e) + { + + } + + private void VirtualPad_Paint(object sender, PaintEventArgs e) + { + + } + + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (keyData == Keys.Up) + { + //TODO: move to next logical key + Refresh(); + } + else if (keyData == Keys.Down) + { + Refresh(); + } + else if (keyData == Keys.Left) + { + Refresh(); + } + else if (keyData == Keys.Right) + { + Refresh(); + } + else if (keyData == Keys.Tab) + { + Refresh(); + } + return true; + } + + public string GetMnemonic() + { + StringBuilder input = new StringBuilder(""); + input.Append(PU.Checked ? "U" : "."); + input.Append(PD.Checked ? "D" : "."); + input.Append(PL.Checked ? "L" : "."); + input.Append(PR.Checked ? "R" : "."); + + input.Append(BStart.Checked ? "S" : "."); + input.Append(BX.Checked ? "X" : "."); + input.Append(BY.Checked ? "Y" : "."); + input.Append(BZ.Checked ? "Z" : "."); + input.Append(BA.Checked ? "A" : "."); + input.Append(BB.Checked ? "B" : "."); + input.Append(BC.Checked ? "C" : "."); + + input.Append(BL.Checked ? "L" : "."); + input.Append(BR.Checked ? "R" : "."); + + input.Append("|"); + return input.ToString(); + } + + public void Clear() + { + if (Global.Emulator.SystemId != "SAT") return; + + if (PU.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Up", false); + if (PD.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Down", false); + if (PL.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Left", false); + if (PR.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Right", false); + + if (BStart.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Start", false); + + if (BX.Checked) Global.StickyXORAdapter.SetSticky(Controller + " X", false); + if (BY.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Y", false); + if (BZ.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Z", false); + + if (BA.Checked) Global.StickyXORAdapter.SetSticky(Controller + " A", false); + if (BB.Checked) Global.StickyXORAdapter.SetSticky(Controller + " B", false); + if (BC.Checked) Global.StickyXORAdapter.SetSticky(Controller + " C", false); + + if (BL.Checked) Global.StickyXORAdapter.SetSticky(Controller + " L", false); + if (BR.Checked) Global.StickyXORAdapter.SetSticky(Controller + " R", false); + + PU.Checked = false; + PD.Checked = false; + PL.Checked = false; + PR.Checked = false; + + BX.Checked = false; + BY.Checked = false; + BZ.Checked = false; + + BA.Checked = false; + BB.Checked = false; + BC.Checked = false; + + BL.Checked = false; + BR.Checked = false; + } + + public void SetButtons(string buttons) + { + if (buttons.Length < 13) return; + + if (buttons[0] == '.') PU.Checked = false; else PU.Checked = true; + if (buttons[1] == '.') PD.Checked = false; else PD.Checked = true; + if (buttons[2] == '.') PL.Checked = false; else PL.Checked = true; + if (buttons[3] == '.') PR.Checked = false; else PR.Checked = true; + if (buttons[4] == '.') BStart.Checked = false; else BStart.Checked = true; + if (buttons[5] == '.') BX.Checked = false; else BX.Checked = true; + if (buttons[6] == '.') BY.Checked = false; else BY.Checked = true; + if (buttons[7] == '.') BZ.Checked = false; else BZ.Checked = true; + if (buttons[8] == '.') BA.Checked = false; else BA.Checked = true; + if (buttons[9] == '.') BB.Checked = false; else BB.Checked = true; + if (buttons[10] == '.') BC.Checked = false; else BC.Checked = true; + if (buttons[11] == '.') BL.Checked = false; else BL.Checked = true; + if (buttons[12] == '.') BR.Checked = false; else BR.Checked = true; + } + + private void Buttons_CheckedChanged(object sender, EventArgs e) + { + if (Global.Emulator.SystemId != "SAT") + { + return; + } + else if (sender == PU) + { + Global.StickyXORAdapter.SetSticky(Controller + " Up", PU.Checked); + } + else if (sender == PD) + { + Global.StickyXORAdapter.SetSticky(Controller + " Down", PD.Checked); + } + else if (sender == PL) + { + Global.StickyXORAdapter.SetSticky(Controller + " Left", PL.Checked); + } + else if (sender == PR) + { + Global.StickyXORAdapter.SetSticky(Controller + " Right", PR.Checked); + } + else if (sender == BStart) + { + Global.StickyXORAdapter.SetSticky(Controller + " Start", BStart.Checked); + } + else if (sender == BX) + { + Global.StickyXORAdapter.SetSticky(Controller + " X", BX.Checked); + } + else if (sender == BY) + { + Global.StickyXORAdapter.SetSticky(Controller + " Y", BY.Checked); + } + else if (sender == BZ) + { + Global.StickyXORAdapter.SetSticky(Controller + " Z", BZ.Checked); + } + else if (sender == BA) + { + Global.StickyXORAdapter.SetSticky(Controller + " A", BA.Checked); + } + else if (sender == BB) + { + Global.StickyXORAdapter.SetSticky(Controller + " B", BB.Checked); + } + else if (sender == BC) + { + Global.StickyXORAdapter.SetSticky(Controller + " C", BC.Checked); + } + else if (sender == BL) + { + Global.StickyXORAdapter.SetSticky(Controller + " L", BL.Checked); + } + else if (sender == BR) + { + Global.StickyXORAdapter.SetSticky(Controller + " R", BR.Checked); + } + } + } +} diff --git a/BizHawk.MultiClient/tools/VirtualPadSaturn.resx b/BizHawk.MultiClient/tools/VirtualPadSaturn.resx new file mode 100644 index 0000000000..29dcb1b3a3 --- /dev/null +++ b/BizHawk.MultiClient/tools/VirtualPadSaturn.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/BizHawk.MultiClient/tools/VirtualPadSaturnControl.Designer.cs b/BizHawk.MultiClient/tools/VirtualPadSaturnControl.Designer.cs new file mode 100644 index 0000000000..bbb932045d --- /dev/null +++ b/BizHawk.MultiClient/tools/VirtualPadSaturnControl.Designer.cs @@ -0,0 +1,78 @@ +namespace BizHawk.MultiClient +{ + partial class VirtualPadSaturnControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.B2 = new System.Windows.Forms.CheckBox(); + this.B1 = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // B2 + // + this.B2.Appearance = System.Windows.Forms.Appearance.Button; + this.B2.AutoSize = true; + this.B2.Location = new System.Drawing.Point(56, 3); + this.B2.Name = "B2"; + this.B2.Size = new System.Drawing.Size(45, 23); + this.B2.TabIndex = 13; + this.B2.Text = "Reset"; + this.B2.UseVisualStyleBackColor = true; + this.B2.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // B1 + // + this.B1.Appearance = System.Windows.Forms.Appearance.Button; + this.B1.AutoSize = true; + this.B1.Location = new System.Drawing.Point(3, 3); + this.B1.Name = "B1"; + this.B1.Size = new System.Drawing.Size(47, 23); + this.B1.TabIndex = 12; + this.B1.Text = "Power"; + this.B1.UseVisualStyleBackColor = true; + this.B1.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged); + // + // VirtualPadSaturnControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.B2); + this.Controls.Add(this.B1); + this.Name = "VirtualPadSaturnControl"; + this.Size = new System.Drawing.Size(104, 29); + this.Load += new System.EventHandler(this.VirtualPadSaturnControl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.CheckBox B2; + private System.Windows.Forms.CheckBox B1; + } +} diff --git a/BizHawk.MultiClient/tools/VirtualPadSaturnControl.cs b/BizHawk.MultiClient/tools/VirtualPadSaturnControl.cs new file mode 100644 index 0000000000..25c866a2a8 --- /dev/null +++ b/BizHawk.MultiClient/tools/VirtualPadSaturnControl.cs @@ -0,0 +1,99 @@ +using System; +using System.Text; +using System.Windows.Forms; + +namespace BizHawk.MultiClient +{ + public partial class VirtualPadSaturnControl : UserControl, IVirtualPad + { + public VirtualPadSaturnControl() + { + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.DoubleBuffer, true); + BorderStyle = BorderStyle.Fixed3D; + Paint += VirtualPad_Paint; + InitializeComponent(); + } + + private void VirtualPadSaturnControl_Load(object sender, EventArgs e) + { + + } + + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (keyData == Keys.Up) + { + //TODO: move to next logical key + Refresh(); + } + else if (keyData == Keys.Down) + { + Refresh(); + } + else if (keyData == Keys.Left) + { + Refresh(); + } + else if (keyData == Keys.Right) + { + Refresh(); + } + else if (keyData == Keys.Tab) + { + Refresh(); + } + + return true; + } + + private void VirtualPad_Paint(object sender, PaintEventArgs e) + { + + } + + public string GetMnemonic() + { + StringBuilder input = new StringBuilder(""); + input.Append(B1.Checked ? "P" : "."); + input.Append(B2.Checked ? "r" : "."); + input.Append("|"); + return input.ToString(); + } + + public void SetButtons(string buttons) + { + if (buttons.Length < 2) return; + if (buttons[0] == '.') B1.Checked = false; else B1.Checked = true; + if (buttons[1] == '.') B2.Checked = false; else B2.Checked = true; + } + + private void Buttons_CheckedChanged(object sender, EventArgs e) + { + if (Global.Emulator.SystemId != "SAT") + { + return; + } + else if (sender == B1) + { + Global.StickyXORAdapter.SetSticky("Power", B1.Checked); + } + else if (sender == B2) + { + Global.StickyXORAdapter.SetSticky("Reset", B2.Checked); + } + } + + public void Clear() + { + if (Global.Emulator.SystemId != "SAT") return; + + if (B1.Checked) Global.StickyXORAdapter.SetSticky("Power", false); + if (B2.Checked) Global.StickyXORAdapter.SetSticky("Reset", false); + + B1.Checked = false; + B2.Checked = false; + } + } +} diff --git a/BizHawk.MultiClient/tools/VirtualPadSaturnControl.resx b/BizHawk.MultiClient/tools/VirtualPadSaturnControl.resx new file mode 100644 index 0000000000..29dcb1b3a3 --- /dev/null +++ b/BizHawk.MultiClient/tools/VirtualPadSaturnControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file