diff --git a/Core/ControlManager.cpp b/Core/ControlManager.cpp index d3f3d7fd..60ce1f85 100644 --- a/Core/ControlManager.cpp +++ b/Core/ControlManager.cpp @@ -33,6 +33,7 @@ #include "VsZapper.h" #include "AsciiTurboFile.h" #include "BattleBox.h" +#include "VbController.h" ControlManager::ControlManager(shared_ptr console, shared_ptr systemActionManager, shared_ptr mapperControlDevice) { @@ -128,6 +129,7 @@ shared_ptr ControlManager::CreateControllerDevice(ControllerT case ControllerType::SnesMouse: device.reset(new SnesMouse(console, port)); break; case ControllerType::SuborMouse: device.reset(new SuborMouse(console, port)); break; case ControllerType::VsZapper: device.reset(new VsZapper(console, port)); break; + case ControllerType::VbController: device.reset(new VbController(console, port, console->GetSettings()->GetControllerKeys(port))); break; } return device; diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 230e0e16..f3abf2e2 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -949,6 +949,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index b71eff7d..135b29fe 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -1499,6 +1499,9 @@ Nes\Mappers + + Nes\Input\Controllers + diff --git a/Core/EmulationSettings.cpp b/Core/EmulationSettings.cpp index c6fd49d4..1b576e1a 100644 --- a/Core/EmulationSettings.cpp +++ b/Core/EmulationSettings.cpp @@ -193,7 +193,8 @@ const vector ControllerTypeNames = { "PowerPad", "SnesMouse", "SuborMouse", - "VsZapper" + "VsZapper", + "VbController", }; const vector ExpansionPortDeviceNames = { diff --git a/Core/EmulationSettings.h b/Core/EmulationSettings.h index 47be9568..6f9fb899 100644 --- a/Core/EmulationSettings.h +++ b/Core/EmulationSettings.h @@ -267,7 +267,8 @@ enum class ControllerType PowerPad = 5, SnesMouse = 6, SuborMouse = 7, - VsZapper = 8 + VsZapper = 8, + VbController = 9, }; extern const vector ExpansionPortDeviceNames; @@ -326,6 +327,7 @@ struct KeyMapping uint32_t JissenMahjongButtons[21] = {}; uint32_t SuborKeyboardButtons[99] = {}; uint32_t BandaiMicrophoneButtons[3] = {}; + uint32_t VirtualBoyButtons[14] = {}; bool HasKeySet() { @@ -342,6 +344,7 @@ struct KeyMapping hasKeyBinding |= HasKeyBinding(JissenMahjongButtons, sizeof(JissenMahjongButtons) / sizeof(JissenMahjongButtons[0])); hasKeyBinding |= HasKeyBinding(SuborKeyboardButtons, sizeof(SuborKeyboardButtons) / sizeof(SuborKeyboardButtons[0])); hasKeyBinding |= HasKeyBinding(BandaiMicrophoneButtons, sizeof(BandaiMicrophoneButtons) / sizeof(BandaiMicrophoneButtons[0])); + hasKeyBinding |= HasKeyBinding(VirtualBoyButtons, sizeof(VirtualBoyButtons) / sizeof(VirtualBoyButtons[0])); return hasKeyBinding; } diff --git a/Core/VbController.h b/Core/VbController.h new file mode 100644 index 00000000..839cda9a --- /dev/null +++ b/Core/VbController.h @@ -0,0 +1,107 @@ +#pragma once +#include "stdafx.h" +#include "BaseControlDevice.h" + +class VbController : public BaseControlDevice +{ +private: + uint32_t _stateBuffer = 0; + +protected: + enum Buttons { Down1 = 0, Left1, Select, Start, Up0, Down0, Left0, Right0, Right1, Up1, L, R, B, A }; + + string GetKeyNames() override + { + return "dlSTUDLRruLRBA"; + } + + void InternalSetStateFromInput() override + { + for(KeyMapping keyMapping : _keyMappings) { + for(int i=0; i<14; i++) + { + SetPressedState(i, keyMapping.VirtualBoyButtons[i]); + } + + if(!_console->GetSettings()->CheckFlag(EmulationFlags::AllowInvalidInput)) { + //If both U+D or L+R are pressed at the same time, act as if neither is pressed + if(IsPressed(Buttons::Up0) && IsPressed(Buttons::Down0)) { + ClearBit(Buttons::Down0); + ClearBit(Buttons::Up0); + } + if(IsPressed(Buttons::Left0) && IsPressed(Buttons::Right0)) { + ClearBit(Buttons::Left0); + ClearBit(Buttons::Right0); + } + if (IsPressed(Buttons::Up1) && IsPressed(Buttons::Down1)) { + ClearBit(Buttons::Down1); + ClearBit(Buttons::Up1); + } + if (IsPressed(Buttons::Left1) && IsPressed(Buttons::Right1)) { + ClearBit(Buttons::Left1); + ClearBit(Buttons::Right1); + } + } + } + } + + uint16_t ToByte() + { + //"A Virtual Boy controller returns a 16-bit report in a similar order as SNES, with two additional buttons." + + return + (uint8_t)IsPressed(Buttons::Down1) | + ((uint8_t)IsPressed(Buttons::Left1) << 1) | + ((uint8_t)IsPressed(Buttons::Select) << 2) | + ((uint8_t)IsPressed(Buttons::Start) << 3) | + ((uint8_t)IsPressed(Buttons::Up0) << 4) | + ((uint8_t)IsPressed(Buttons::Down0) << 5) | + ((uint8_t)IsPressed(Buttons::Left0) << 6) | + ((uint8_t)IsPressed(Buttons::Right0) << 7) | + ((uint8_t)IsPressed(Buttons::Right1) << 8) | + ((uint8_t)IsPressed(Buttons::Up1) << 9) | + ((uint8_t)IsPressed(Buttons::L) << 10) | + ((uint8_t)IsPressed(Buttons::R) << 11) | + ((uint8_t)IsPressed(Buttons::B) << 12) | + ((uint8_t)IsPressed(Buttons::A) << 13) | + (1 << 14); + } + + void StreamState(bool saving) override + { + BaseControlDevice::StreamState(saving); + Stream(_stateBuffer); + } + + void RefreshStateBuffer() override + { + _stateBuffer = (uint32_t)ToByte(); + } + +public: + VbController(shared_ptr console, uint8_t port, KeyMappingSet keyMappings) : BaseControlDevice(console, port, keyMappings) + { + } + + uint8_t ReadRAM(uint16_t addr) override + { + uint8_t output = 0; + + if(IsCurrentPort(addr)) { + StrobeProcessRead(); + + output = _stateBuffer & 0x01; + _stateBuffer >>= 1; + + //"All subsequent reads will return D=1 on an authentic controller but may return D=0 on third party controllers." + _stateBuffer |= 0x8000; + } + + return output; + } + + void WriteRAM(uint16_t addr, uint8_t value) override + { + StrobeProcessWrite(value); + } +}; \ No newline at end of file diff --git a/GUI.NET/Config/InputInfo.cs b/GUI.NET/Config/InputInfo.cs index 1269b450..9edb8e65 100644 --- a/GUI.NET/Config/InputInfo.cs +++ b/GUI.NET/Config/InputInfo.cs @@ -36,6 +36,7 @@ namespace Mesen.GUI.Config [XmlElement("JissenMahjong")] public XmlIntArray JissenMahjongButtons = new UInt32[21]; [XmlElement("SuborKeyboard")] public XmlIntArray SuborKeyboardButtons = new UInt32[99]; [XmlElement("BandaiMicrophone")] public XmlIntArray BandaiMicrophoneButtons = new UInt32[3]; + [XmlElement("VirtualBoy")] public XmlIntArray VirtualBoyButtons = new UInt32[14]; public KeyMappings() { @@ -50,8 +51,9 @@ namespace Mesen.GUI.Config clone.PachinkoButtons = this.PachinkoButtons.Clone(); clone.ExcitingBoxingButtons = this.ExcitingBoxingButtons.Clone(); clone.JissenMahjongButtons = this.JissenMahjongButtons.Clone(); - clone.SuborKeyboardButtons = this.SuborKeyboardButtons.Clone(); - clone.BandaiMicrophoneButtons = this.BandaiMicrophoneButtons.Clone(); + clone.SuborKeyboardButtons = this.SuborKeyboardButtons.Clone(); + clone.BandaiMicrophoneButtons = this.BandaiMicrophoneButtons.Clone(); + clone.VirtualBoyButtons = this.VirtualBoyButtons.Clone(); return clone; } @@ -82,6 +84,7 @@ namespace Mesen.GUI.Config mapping.JissenMahjongButtons = JissenMahjongButtons; mapping.SuborKeyboardButtons = SuborKeyboardButtons; mapping.BandaiMicrophoneButtons = BandaiMicrophoneButtons; + mapping.VirtualBoyButtons = VirtualBoyButtons; return mapping; } @@ -180,6 +183,7 @@ namespace Mesen.GUI.Config controllerInfo.Keys[0].PowerPadButtons = presets.PowerPad.PowerPadButtons; controllerInfo.Keys[0].SuborKeyboardButtons = presets.SuborKeyboard.SuborKeyboardButtons; controllerInfo.Keys[0].BandaiMicrophoneButtons = presets.BandaiMicrophone.BandaiMicrophoneButtons; + controllerInfo.Keys[0].VirtualBoyButtons = presets.VirtualBoy.VirtualBoyButtons; } else if(Controllers.Count == 1) { if(controllerInfo.Keys.Count == 0) { controllerInfo.Keys.Add(new KeyMappings()); diff --git a/GUI.NET/Config/KeyPresets.cs b/GUI.NET/Config/KeyPresets.cs index 2fe8abb3..092c218e 100644 --- a/GUI.NET/Config/KeyPresets.cs +++ b/GUI.NET/Config/KeyPresets.cs @@ -37,6 +37,9 @@ namespace Mesen.GUI.Config KeyMappings _bandaiMicrophone; public KeyMappings BandaiMicrophone { get { return _bandaiMicrophone.Clone(); } } + KeyMappings _virtualBoy; + public KeyMappings VirtualBoy { get { return _virtualBoy.Clone(); } } + public KeyMappings WasdLayout { get { return _wasdLayout.Clone(); } } public KeyMappings ArrowLayout { get { return _arrowLayout.Clone(); } } public KeyMappings NestopiaLayout { get { return _nestopiaLayout.Clone(); } } @@ -301,6 +304,26 @@ namespace Mesen.GUI.Config 0,0,0 } }; + + _virtualBoy = new KeyMappings() + { + VirtualBoyButtons = new UInt32[14] { + InteropEmu.GetKeyCode("K"), + InteropEmu.GetKeyCode("J"), + InteropEmu.GetKeyCode("E"), + InteropEmu.GetKeyCode("R"), + InteropEmu.GetKeyCode("W"), + InteropEmu.GetKeyCode("S"), + InteropEmu.GetKeyCode("A"), + InteropEmu.GetKeyCode("D"), + InteropEmu.GetKeyCode("L"), + InteropEmu.GetKeyCode("I"), + InteropEmu.GetKeyCode("Q"), + InteropEmu.GetKeyCode("O"), + InteropEmu.GetKeyCode("Y"), + InteropEmu.GetKeyCode("U"), + } + }; } } } diff --git a/GUI.NET/Dependencies/resources.ca.xml b/GUI.NET/Dependencies/resources.ca.xml index 7b01390b..250f16b9 100644 --- a/GUI.NET/Dependencies/resources.ca.xml +++ b/GUI.NET/Dependencies/resources.ca.xml @@ -975,6 +975,7 @@ Power Pad SNES Mouse Subor Mouse + Virtual Boy Controller Cap diff --git a/GUI.NET/Dependencies/resources.en.xml b/GUI.NET/Dependencies/resources.en.xml index 6596cc30..a6a53a7d 100644 --- a/GUI.NET/Dependencies/resources.en.xml +++ b/GUI.NET/Dependencies/resources.en.xml @@ -1009,6 +1009,7 @@ Power Pad SNES Mouse Subor Mouse + Virtual Boy Controller None diff --git a/GUI.NET/Dependencies/resources.es.xml b/GUI.NET/Dependencies/resources.es.xml index ae43d4a9..e906a995 100644 --- a/GUI.NET/Dependencies/resources.es.xml +++ b/GUI.NET/Dependencies/resources.es.xml @@ -992,6 +992,7 @@ Power Pad Ratón SNES Ratón Subor + Control Virtual Boy Ninguno diff --git a/GUI.NET/Dependencies/resources.fr.xml b/GUI.NET/Dependencies/resources.fr.xml index 0155bd82..4023132f 100644 --- a/GUI.NET/Dependencies/resources.fr.xml +++ b/GUI.NET/Dependencies/resources.fr.xml @@ -1006,6 +1006,7 @@ Power Pad Souris SNES Souris Subor + Manette Virtual Boy Aucun diff --git a/GUI.NET/Dependencies/resources.it.xml b/GUI.NET/Dependencies/resources.it.xml index b4bdc94a..9888dbc7 100644 --- a/GUI.NET/Dependencies/resources.it.xml +++ b/GUI.NET/Dependencies/resources.it.xml @@ -1008,6 +1008,7 @@ Power Pad SNES Mouse Subor Mouse + Virtual Boy Controller Nessuno diff --git a/GUI.NET/Dependencies/resources.ja.xml b/GUI.NET/Dependencies/resources.ja.xml index 9f8d10dd..23bb60d4 100644 --- a/GUI.NET/Dependencies/resources.ja.xml +++ b/GUI.NET/Dependencies/resources.ja.xml @@ -994,6 +994,7 @@ パワーパッド スーパーファミコマウス Suborマウス + バーチャルボーイコントローラ なし diff --git a/GUI.NET/Dependencies/resources.pt.xml b/GUI.NET/Dependencies/resources.pt.xml index d3f152d3..e3bdf9ac 100644 --- a/GUI.NET/Dependencies/resources.pt.xml +++ b/GUI.NET/Dependencies/resources.pt.xml @@ -1008,6 +1008,7 @@ Power Pad Mouse SNES Mouse Subor + Controle Virtual Boy Nenhum diff --git a/GUI.NET/Dependencies/resources.ru.xml b/GUI.NET/Dependencies/resources.ru.xml index a752072f..d81a344e 100644 --- a/GUI.NET/Dependencies/resources.ru.xml +++ b/GUI.NET/Dependencies/resources.ru.xml @@ -994,6 +994,7 @@ Power Pad SNES Mouse Subor Mouse + Virtual Boy Controller Пусто diff --git a/GUI.NET/Dependencies/resources.uk.xml b/GUI.NET/Dependencies/resources.uk.xml index 9d6dec93..fe6f8c0c 100644 --- a/GUI.NET/Dependencies/resources.uk.xml +++ b/GUI.NET/Dependencies/resources.uk.xml @@ -994,6 +994,7 @@ Power Pad SNES Mouse Subor Mouse + Virtual Boy Controller Пусто diff --git a/GUI.NET/Dependencies/resources.zh.xml b/GUI.NET/Dependencies/resources.zh.xml index 69068960..b652e2f4 100644 --- a/GUI.NET/Dependencies/resources.zh.xml +++ b/GUI.NET/Dependencies/resources.zh.xml @@ -1021,6 +1021,7 @@ Power Pad SFC 鼠标 小霸王鼠标 + Virtual Boy 控制器 diff --git a/GUI.NET/Forms/Config/Controllers/ctrlVirtualBoyConfig.Designer.cs b/GUI.NET/Forms/Config/Controllers/ctrlVirtualBoyConfig.Designer.cs new file mode 100644 index 00000000..59260164 --- /dev/null +++ b/GUI.NET/Forms/Config/Controllers/ctrlVirtualBoyConfig.Designer.cs @@ -0,0 +1,344 @@ +namespace Mesen.GUI.Forms.Config +{ + partial class ctrlVirtualBoyConfig + { + /// + /// 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 Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tlpMain = new System.Windows.Forms.TableLayoutPanel(); + this.btn1 = new System.Windows.Forms.Button(); + this.btn2 = new System.Windows.Forms.Button(); + this.btn3 = new System.Windows.Forms.Button(); + this.btn4 = new System.Windows.Forms.Button(); + this.btn5 = new System.Windows.Forms.Button(); + this.btn6 = new System.Windows.Forms.Button(); + this.btn7 = new System.Windows.Forms.Button(); + this.btn8 = new System.Windows.Forms.Button(); + this.btn10 = new System.Windows.Forms.Button(); + this.btn11 = new System.Windows.Forms.Button(); + this.btn12 = new System.Windows.Forms.Button(); + this.lbl2 = new System.Windows.Forms.Label(); + this.lbl3 = new System.Windows.Forms.Label(); + this.lbl12 = new System.Windows.Forms.Label(); + this.lbl11 = new System.Windows.Forms.Label(); + this.lbl10 = new System.Windows.Forms.Label(); + this.btn9 = new System.Windows.Forms.Button(); + this.btnClearKeys = new System.Windows.Forms.Button(); + this.btn13 = new System.Windows.Forms.Button(); + this.lbl13 = new System.Windows.Forms.Label(); + this.btn0 = new System.Windows.Forms.Button(); + this.tlpMain.SuspendLayout(); + this.SuspendLayout(); + // + // tlpMain + // + this.tlpMain.AutoSize = true; + this.tlpMain.ColumnCount = 9; + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tlpMain.Controls.Add(this.btn2, 2, 1); + this.tlpMain.Controls.Add(this.btn3, 3, 1); + this.tlpMain.Controls.Add(this.lbl2, 2, 2); + this.tlpMain.Controls.Add(this.lbl3, 3, 2); + this.tlpMain.Controls.Add(this.btn9, 6, 3); + this.tlpMain.Controls.Add(this.btn11, 7, 1); + this.tlpMain.Controls.Add(this.lbl11, 7, 2); + this.tlpMain.Controls.Add(this.btn4, 2, 3); + this.tlpMain.Controls.Add(this.btn10, 1, 1); + this.tlpMain.Controls.Add(this.lbl10, 1, 2); + this.tlpMain.Controls.Add(this.btn12, 4, 1); + this.tlpMain.Controls.Add(this.lbl12, 4, 2); + this.tlpMain.Controls.Add(this.btn13, 6, 1); + this.tlpMain.Controls.Add(this.lbl13, 6, 2); + this.tlpMain.Controls.Add(this.btn6, 1, 4); + this.tlpMain.Controls.Add(this.btn7, 3, 4); + this.tlpMain.Controls.Add(this.btn1, 4, 4); + this.tlpMain.Controls.Add(this.btn8, 7, 4); + this.tlpMain.Controls.Add(this.btn0, 6, 6); + this.tlpMain.Controls.Add(this.btn5, 2, 6); + this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpMain.Location = new System.Drawing.Point(0, 0); + this.tlpMain.Name = "tlpMain"; + this.tlpMain.RowCount = 8; + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tlpMain.Size = new System.Drawing.Size(415, 175); + this.tlpMain.TabIndex = 2; + // + // btn1 + // + this.btn1.Location = new System.Drawing.Point(212, 99); + this.btn1.Name = "btn1"; + this.btn1.Size = new System.Drawing.Size(61, 29); + this.btn1.TabIndex = 30; + this.btn1.Text = "Left 2"; + this.btn1.UseVisualStyleBackColor = true; + // + // btn2 + // + this.btn2.Location = new System.Drawing.Point(78, 11); + this.btn2.Name = "btn2"; + this.btn2.Size = new System.Drawing.Size(61, 29); + this.btn2.TabIndex = 34; + this.btn2.Text = "Select"; + this.btn2.UseVisualStyleBackColor = true; + // + // btn3 + // + this.btn3.Location = new System.Drawing.Point(145, 11); + this.btn3.Name = "btn3"; + this.btn3.Size = new System.Drawing.Size(61, 29); + this.btn3.TabIndex = 32; + this.btn3.Text = "Start"; + this.btn3.UseVisualStyleBackColor = true; + // + // btn4 + // + this.btn4.Location = new System.Drawing.Point(78, 64); + this.btn4.Name = "btn4"; + this.btn4.Size = new System.Drawing.Size(61, 29); + this.btn4.TabIndex = 33; + this.btn4.Text = "Up 1"; + this.btn4.UseVisualStyleBackColor = true; + // + // btn5 + // + this.btn5.Location = new System.Drawing.Point(78, 134); + this.btn5.Name = "btn5"; + this.btn5.Size = new System.Drawing.Size(61, 29); + this.btn5.TabIndex = 37; + this.btn5.Text = "Down 1"; + this.btn5.UseVisualStyleBackColor = true; + // + // btn6 + // + this.btn6.Location = new System.Drawing.Point(11, 99); + this.btn6.Name = "btn6"; + this.btn6.Size = new System.Drawing.Size(61, 29); + this.btn6.TabIndex = 35; + this.btn6.Text = "Left 1"; + this.btn6.UseVisualStyleBackColor = true; + // + // btn7 + // + this.btn7.Location = new System.Drawing.Point(145, 99); + this.btn7.Name = "btn7"; + this.btn7.Size = new System.Drawing.Size(61, 29); + this.btn7.TabIndex = 38; + this.btn7.Text = "Right 1"; + this.btn7.UseVisualStyleBackColor = true; + // + // btn8 + // + this.btn8.Location = new System.Drawing.Point(345, 99); + this.btn8.Name = "btn8"; + this.btn8.Size = new System.Drawing.Size(58, 29); + this.btn8.TabIndex = 36; + this.btn8.Text = "Right 2"; + this.btn8.UseVisualStyleBackColor = true; + // + // btn10 + // + this.btn10.Location = new System.Drawing.Point(11, 11); + this.btn10.Name = "btn10"; + this.btn10.Size = new System.Drawing.Size(61, 29); + this.btn10.TabIndex = 40; + this.btn10.Text = "L"; + this.btn10.UseVisualStyleBackColor = true; + // + // btn11 + // + this.btn11.Location = new System.Drawing.Point(345, 11); + this.btn11.Name = "btn11"; + this.btn11.Size = new System.Drawing.Size(58, 29); + this.btn11.TabIndex = 42; + this.btn11.Text = "R"; + this.btn11.UseVisualStyleBackColor = true; + // + // btn12 + // + this.btn12.Location = new System.Drawing.Point(212, 11); + this.btn12.Name = "btn12"; + this.btn12.Size = new System.Drawing.Size(61, 29); + this.btn12.TabIndex = 39; + this.btn12.Text = "B"; + this.btn12.UseVisualStyleBackColor = true; + // + // lbl2 + // + this.lbl2.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.lbl2.AutoSize = true; + this.lbl2.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl2.Location = new System.Drawing.Point(82, 43); + this.lbl2.Name = "lbl2"; + this.lbl2.Size = new System.Drawing.Size(53, 18); + this.lbl2.TabIndex = 45; + this.lbl2.Text = "Select"; + // + // lbl3 + // + this.lbl3.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.lbl3.AutoSize = true; + this.lbl3.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl3.Location = new System.Drawing.Point(154, 43); + this.lbl3.Name = "lbl3"; + this.lbl3.Size = new System.Drawing.Size(42, 18); + this.lbl3.TabIndex = 44; + this.lbl3.Text = "Start"; + // + // lbl12 + // + this.lbl12.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.lbl12.AutoSize = true; + this.lbl12.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl12.Location = new System.Drawing.Point(233, 43); + this.lbl12.Name = "lbl12"; + this.lbl12.Size = new System.Drawing.Size(19, 18); + this.lbl12.TabIndex = 50; + this.lbl12.Text = "B"; + // + // lbl11 + // + this.lbl11.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.lbl11.AutoSize = true; + this.lbl11.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl11.Location = new System.Drawing.Point(364, 43); + this.lbl11.Name = "lbl11"; + this.lbl11.Size = new System.Drawing.Size(19, 18); + this.lbl11.TabIndex = 51; + this.lbl11.Text = "R"; + // + // lbl10 + // + this.lbl10.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.lbl10.AutoSize = true; + this.lbl10.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl10.Location = new System.Drawing.Point(33, 43); + this.lbl10.Name = "lbl10"; + this.lbl10.Size = new System.Drawing.Size(17, 18); + this.lbl10.TabIndex = 52; + this.lbl10.Text = "L"; + // + // btn9 + // + this.btn9.Location = new System.Drawing.Point(279, 64); + this.btn9.Name = "btn9"; + this.btn9.Size = new System.Drawing.Size(60, 29); + this.btn9.TabIndex = 41; + this.btn9.Text = "Up 2"; + this.btn9.UseVisualStyleBackColor = true; + // + // btnClearKeys + // + this.btnClearKeys.AutoSize = true; + this.btnClearKeys.Location = new System.Drawing.Point(3, 3); + this.btnClearKeys.Name = "btnClearKeys"; + this.btnClearKeys.Size = new System.Drawing.Size(105, 23); + this.btnClearKeys.TabIndex = 3; + this.btnClearKeys.Text = "Clear Key Bindings"; + this.btnClearKeys.UseVisualStyleBackColor = true; + // + // btn13 + // + this.btn13.Location = new System.Drawing.Point(279, 11); + this.btn13.Name = "btn13"; + this.btn13.Size = new System.Drawing.Size(60, 29); + this.btn13.TabIndex = 54; + this.btn13.Text = "A"; + this.btn13.UseVisualStyleBackColor = true; + // + // lbl13 + // + this.lbl13.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.lbl13.AutoSize = true; + this.lbl13.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl13.Location = new System.Drawing.Point(300, 43); + this.lbl13.Name = "lbl13"; + this.lbl13.Size = new System.Drawing.Size(17, 18); + this.lbl13.TabIndex = 55; + this.lbl13.Text = "A"; + // + // btn0 + // + this.btn0.Location = new System.Drawing.Point(279, 134); + this.btn0.Name = "btn0"; + this.btn0.Size = new System.Drawing.Size(60, 29); + this.btn0.TabIndex = 56; + this.btn0.Text = "Down 2"; + this.btn0.UseVisualStyleBackColor = true; + // + // ctrlVirtualBoyConfig + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.tlpMain); + this.Name = "ctrlVirtualBoyConfig"; + this.Size = new System.Drawing.Size(415, 175); + this.tlpMain.ResumeLayout(false); + this.tlpMain.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tlpMain; + private System.Windows.Forms.Button btn0; + private System.Windows.Forms.Button btn1; + private System.Windows.Forms.Button btn2; + private System.Windows.Forms.Button btn3; + private System.Windows.Forms.Button btn4; + private System.Windows.Forms.Button btn5; + private System.Windows.Forms.Button btn6; + private System.Windows.Forms.Button btn7; + private System.Windows.Forms.Button btn8; + private System.Windows.Forms.Button btn9; + private System.Windows.Forms.Button btn10; + private System.Windows.Forms.Button btn11; + private System.Windows.Forms.Button btn12; + private System.Windows.Forms.Button btn13; + private System.Windows.Forms.Label lbl2; + private System.Windows.Forms.Label lbl3; + private System.Windows.Forms.Label lbl10; + private System.Windows.Forms.Label lbl11; + private System.Windows.Forms.Label lbl12; + private System.Windows.Forms.Label lbl13; + private System.Windows.Forms.Button btnClearKeys; + } +} \ No newline at end of file diff --git a/GUI.NET/Forms/Config/Controllers/ctrlVirtualBoyConfig.cs b/GUI.NET/Forms/Config/Controllers/ctrlVirtualBoyConfig.cs new file mode 100644 index 00000000..b73f61e8 --- /dev/null +++ b/GUI.NET/Forms/Config/Controllers/ctrlVirtualBoyConfig.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using Mesen.GUI.Config; +using Mesen.GUI.Controls; + +namespace Mesen.GUI.Forms.Config +{ + public partial class ctrlVirtualBoyConfig : BaseInputConfigControl + { + private List