A78 - Virtual Pads
This commit is contained in:
parent
e5a6a28940
commit
d57b850c7e
|
@ -442,6 +442,18 @@
|
|||
<Compile Include="tools\TraceLogger.Designer.cs">
|
||||
<DependentUpon>TraceLogger.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="tools\VirtualPadA78.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="tools\VirtualPadA78.Designer.cs">
|
||||
<DependentUpon>VirtualPadA78.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="tools\VirtualPadA78Control.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="tools\VirtualPadA78Control.Designer.cs">
|
||||
<DependentUpon>VirtualPadA78Control.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="tools\VirtualPadC64Keyboard.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -580,6 +592,12 @@
|
|||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="tools\VirtualPadA78.resx">
|
||||
<DependentUpon>VirtualPadA78.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="tools\VirtualPadA78Control.resx">
|
||||
<DependentUpon>VirtualPadA78Control.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="tools\VirtualPadC64Keyboard.resx">
|
||||
<DependentUpon>VirtualPadC64Keyboard.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
namespace BizHawk.MultiClient
|
||||
{
|
||||
partial class VirtualPadA78
|
||||
{
|
||||
/// <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.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.B2 = new System.Windows.Forms.CheckBox();
|
||||
this.B1 = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// 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(32, 19);
|
||||
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(53, 28);
|
||||
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(74, 19);
|
||||
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(53, 7);
|
||||
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);
|
||||
//
|
||||
// B2
|
||||
//
|
||||
this.B2.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.B2.AutoSize = true;
|
||||
this.B2.Location = new System.Drawing.Point(93, 57);
|
||||
this.B2.Name = "B2";
|
||||
this.B2.Size = new System.Drawing.Size(23, 23);
|
||||
this.B2.TabIndex = 9;
|
||||
this.B2.Text = "2";
|
||||
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(10, 57);
|
||||
this.B1.Name = "B1";
|
||||
this.B1.Size = new System.Drawing.Size(23, 23);
|
||||
this.B1.TabIndex = 8;
|
||||
this.B1.Text = "1";
|
||||
this.B1.UseVisualStyleBackColor = true;
|
||||
this.B1.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged);
|
||||
//
|
||||
// VirtualPadA78
|
||||
//
|
||||
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.Controls.Add(this.PL);
|
||||
this.Controls.Add(this.PD);
|
||||
this.Controls.Add(this.PR);
|
||||
this.Controls.Add(this.PU);
|
||||
this.Name = "VirtualPadA78";
|
||||
this.Size = new System.Drawing.Size(128, 89);
|
||||
this.Load += new System.EventHandler(this.VirtualPadA78_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 B2;
|
||||
private System.Windows.Forms.CheckBox B1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BizHawk.MultiClient
|
||||
{
|
||||
public partial class VirtualPadA78 : UserControl, IVirtualPad
|
||||
{
|
||||
public string Controller = "P1";
|
||||
|
||||
public VirtualPadA78()
|
||||
{
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
this.BorderStyle = BorderStyle.Fixed3D;
|
||||
this.Paint += new System.Windows.Forms.PaintEventHandler(this.VirtualPad_Paint);
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||
{
|
||||
if (keyData == Keys.Up)
|
||||
{
|
||||
//TODO: move to next logical key
|
||||
this.Refresh();
|
||||
}
|
||||
else if (keyData == Keys.Down)
|
||||
{
|
||||
this.Refresh();
|
||||
}
|
||||
else if (keyData == Keys.Left)
|
||||
{
|
||||
this.Refresh();
|
||||
}
|
||||
else if (keyData == Keys.Right)
|
||||
{
|
||||
this.Refresh();
|
||||
}
|
||||
else if (keyData == Keys.Tab)
|
||||
{
|
||||
this.Refresh();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void VirtualPad_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void VirtualPadA78_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
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(B1.Checked ? "1" : ".");
|
||||
input.Append(B2.Checked ? "2" : ".");
|
||||
input.Append("|");
|
||||
return input.ToString();
|
||||
}
|
||||
|
||||
public void SetButtons(string buttons)
|
||||
{
|
||||
if (buttons.Length < 6) 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] == '.') B1.Checked = false; else B1.Checked = true;
|
||||
if (buttons[5] == '.') B2.Checked = false; else B2.Checked = true;
|
||||
}
|
||||
|
||||
private void Buttons_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Global.Emulator.SystemId != "A78")
|
||||
{
|
||||
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 == B1)
|
||||
{
|
||||
Global.StickyXORAdapter.SetSticky(Controller + " Trigger", B1.Checked);
|
||||
}
|
||||
else if (sender == B2)
|
||||
{
|
||||
Global.StickyXORAdapter.SetSticky(Controller + " Trigger 2", B2.Checked);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
if (Global.Emulator.SystemId != "A78") 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 (B1.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Trigger", false);
|
||||
if (B2.Checked) Global.StickyXORAdapter.SetSticky(Controller + " Trigger 2", false);
|
||||
|
||||
|
||||
PU.Checked = false;
|
||||
PD.Checked = false;
|
||||
PL.Checked = false;
|
||||
PR.Checked = false;
|
||||
B1.Checked = false;
|
||||
B2.Checked = false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -0,0 +1,108 @@
|
|||
namespace BizHawk.MultiClient
|
||||
{
|
||||
partial class VirtualPadA78Control
|
||||
{
|
||||
/// <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.B4 = new System.Windows.Forms.CheckBox();
|
||||
this.B3 = 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, 5);
|
||||
this.B2.Name = "B2";
|
||||
this.B2.Size = new System.Drawing.Size(45, 23);
|
||||
this.B2.TabIndex = 11;
|
||||
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, 5);
|
||||
this.B1.Name = "B1";
|
||||
this.B1.Size = new System.Drawing.Size(47, 23);
|
||||
this.B1.TabIndex = 10;
|
||||
this.B1.Text = "Power";
|
||||
this.B1.UseVisualStyleBackColor = true;
|
||||
this.B1.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged);
|
||||
//
|
||||
// B4
|
||||
//
|
||||
this.B4.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.B4.AutoSize = true;
|
||||
this.B4.Location = new System.Drawing.Point(160, 5);
|
||||
this.B4.Name = "B4";
|
||||
this.B4.Size = new System.Drawing.Size(47, 23);
|
||||
this.B4.TabIndex = 13;
|
||||
this.B4.Text = "Pause";
|
||||
this.B4.UseVisualStyleBackColor = true;
|
||||
this.B4.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged);
|
||||
//
|
||||
// B3
|
||||
//
|
||||
this.B3.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.B3.AutoSize = true;
|
||||
this.B3.Location = new System.Drawing.Point(107, 5);
|
||||
this.B3.Name = "B3";
|
||||
this.B3.Size = new System.Drawing.Size(47, 23);
|
||||
this.B3.TabIndex = 12;
|
||||
this.B3.Text = "Select";
|
||||
this.B3.UseVisualStyleBackColor = true;
|
||||
this.B3.CheckedChanged += new System.EventHandler(this.Buttons_CheckedChanged);
|
||||
//
|
||||
// VirtualPadA78Control
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.B4);
|
||||
this.Controls.Add(this.B3);
|
||||
this.Controls.Add(this.B2);
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.CheckBox B2;
|
||||
private System.Windows.Forms.CheckBox B1;
|
||||
private System.Windows.Forms.CheckBox B4;
|
||||
private System.Windows.Forms.CheckBox B3;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BizHawk.MultiClient
|
||||
{
|
||||
public partial class VirtualPadA78Control : UserControl, IVirtualPad
|
||||
{
|
||||
public VirtualPadA78Control()
|
||||
{
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
this.BorderStyle = BorderStyle.Fixed3D;
|
||||
this.Paint += new System.Windows.Forms.PaintEventHandler(this.VirtualPad_Paint);
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void VirtualPadA78Control_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||
{
|
||||
if (keyData == Keys.Up)
|
||||
{
|
||||
//TODO: move to next logical key
|
||||
this.Refresh();
|
||||
}
|
||||
else if (keyData == Keys.Down)
|
||||
{
|
||||
this.Refresh();
|
||||
}
|
||||
else if (keyData == Keys.Left)
|
||||
{
|
||||
this.Refresh();
|
||||
}
|
||||
else if (keyData == Keys.Right)
|
||||
{
|
||||
this.Refresh();
|
||||
}
|
||||
else if (keyData == Keys.Tab)
|
||||
{
|
||||
this.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(B3.Checked ? "s" : ".");
|
||||
input.Append(B4.Checked ? "p" : ".");
|
||||
input.Append("|");
|
||||
return input.ToString();
|
||||
}
|
||||
|
||||
public void SetButtons(string buttons)
|
||||
{
|
||||
if (buttons.Length < 4) return;
|
||||
if (buttons[0] == '.') B1.Checked = false; else B1.Checked = true;
|
||||
if (buttons[1] == '.') B2.Checked = false; else B2.Checked = true;
|
||||
if (buttons[2] == '.') B3.Checked = false; else B3.Checked = true;
|
||||
if (buttons[3] == '.') B4.Checked = false; else B4.Checked = true;
|
||||
}
|
||||
|
||||
private void Buttons_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Global.Emulator.SystemId != "A78")
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (sender == B1)
|
||||
{
|
||||
Global.StickyXORAdapter.SetSticky("Power", B1.Checked);
|
||||
}
|
||||
else if (sender == B2)
|
||||
{
|
||||
Global.StickyXORAdapter.SetSticky("Reset", B2.Checked);
|
||||
}
|
||||
else if (sender == B3)
|
||||
{
|
||||
Global.StickyXORAdapter.SetSticky("Select", B3.Checked);
|
||||
}
|
||||
else if (sender == B4)
|
||||
{
|
||||
Global.StickyXORAdapter.SetSticky("Pause", B4.Checked);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
if (Global.Emulator.SystemId != "A78") return;
|
||||
|
||||
if (B1.Checked) Global.StickyXORAdapter.SetSticky("Power", false);
|
||||
if (B2.Checked) Global.StickyXORAdapter.SetSticky("Reset", false);
|
||||
if (B3.Checked) Global.StickyXORAdapter.SetSticky("Select", false);
|
||||
if (B4.Checked) Global.StickyXORAdapter.SetSticky("Pause", false);
|
||||
|
||||
B1.Checked = false;
|
||||
B2.Checked = false;
|
||||
B3.Checked = false;
|
||||
B4.Checked = false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -56,8 +56,8 @@ namespace BizHawk.MultiClient
|
|||
private void VirtualPad_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public string GetMnemonic()
|
||||
{
|
||||
StringBuilder input = new StringBuilder("");
|
||||
|
|
|
@ -81,6 +81,22 @@ namespace BizHawk.MultiClient
|
|||
Pads.Add(ataricontrols);
|
||||
ControllerBox.Controls.Add(Pads[2] as Control);
|
||||
break;
|
||||
case "A78":
|
||||
VirtualPadA78 atari78pad1 = new VirtualPadA78();
|
||||
atari78pad1.Location = new Point(8, 19);
|
||||
atari78pad1.Controller = "P1";
|
||||
VirtualPadA78 atari78pad2 = new VirtualPadA78();
|
||||
atari78pad2.Location = new Point(150, 19);
|
||||
atari78pad2.Controller = "P2";
|
||||
Pads.Add(atari78pad1);
|
||||
Pads.Add(atari78pad2);
|
||||
ControllerBox.Controls.Add(atari78pad1);
|
||||
ControllerBox.Controls.Add(atari78pad2);
|
||||
VirtualPadA78Control atari78controls = new VirtualPadA78Control();
|
||||
atari78controls.Location = new Point(8, 125);
|
||||
Pads.Add(atari78controls);
|
||||
ControllerBox.Controls.Add(Pads[2] as Control);
|
||||
break;
|
||||
case "NES":
|
||||
VirtualPadNES nespad1 = new VirtualPadNES();
|
||||
nespad1.Location = new Point(8, 19);
|
||||
|
|
Loading…
Reference in New Issue