Saturn - implement virtual pads, also break movie mnemonics for this core, hope nobody was making a movie yet.

This commit is contained in:
adelikat 2013-07-14 22:18:22 +00:00
parent fa79cdc63b
commit c5204487a7
12 changed files with 912 additions and 19 deletions

View File

@ -544,6 +544,18 @@
<Compile Include="tools\VirtualPadN64.Designer.cs">
<DependentUpon>VirtualPadN64.cs</DependentUpon>
</Compile>
<Compile Include="tools\VirtualPadSaturn.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="tools\VirtualPadSaturn.Designer.cs">
<DependentUpon>VirtualPadSaturn.cs</DependentUpon>
</Compile>
<Compile Include="tools\VirtualPadSaturnControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="tools\VirtualPadSaturnControl.Designer.cs">
<DependentUpon>VirtualPadSaturnControl.cs</DependentUpon>
</Compile>
<Compile Include="tools\VirtualPadSNES.cs">
<SubType>Component</SubType>
</Compile>
@ -697,6 +709,12 @@
<EmbeddedResource Include="tools\VirtualPadN64.resx">
<DependentUpon>VirtualPadN64.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\VirtualPadSaturn.resx">
<DependentUpon>VirtualPadSaturn.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\VirtualPadSaturnControl.resx">
<DependentUpon>VirtualPadSaturnControl.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

View File

@ -119,8 +119,8 @@ namespace BizHawk.MultiClient
"Saturn Controller", new Dictionary<string, string>()
{
{"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"},
}
}
};

View File

@ -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();

View File

@ -106,5 +106,10 @@ namespace BizHawk.MultiClient
B3.Checked = false;
B4.Checked = false;
}
private void VirtualPadA78Control_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -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);

View File

@ -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

View File

@ -0,0 +1,243 @@
namespace BizHawk.MultiClient
{
partial class VirtualPadSaturn
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View File

@ -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);
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,78 @@
namespace BizHawk.MultiClient
{
partial class VirtualPadSaturnControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View File

@ -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;
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>