Add NES controllers to config and Input dialog.

This commit is contained in:
kylethomson 2011-02-20 07:16:34 +00:00
parent 3cf44657c1
commit 2b145b5d6e
7 changed files with 91 additions and 22 deletions

View File

@ -300,6 +300,9 @@
<ItemGroup>
<None Include="config\ControllerImages\GENController.png" />
</ItemGroup>
<ItemGroup>
<Content Include="config\ControllerImages\NESController.PNG" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -11,6 +11,10 @@
PCEController[2] = new PCEControllerTemplate(false);
PCEController[3] = new PCEControllerTemplate(false);
PCEController[4] = new PCEControllerTemplate(false);
NESController[0] = new NESControllerTemplate(true);
NESController[1] = new NESControllerTemplate(false);
NESController[2] = new NESControllerTemplate(false);
NESController[3] = new NESControllerTemplate(false);
}
// General Client Settings
@ -118,7 +122,9 @@
public string GenP1Start = "J1 B10, Return";
//GameBoy Settings
public NESControllerTemplate GameBoyController = new NESControllerTemplate();
public NESControllerTemplate GameBoyController = new NESControllerTemplate(true);
public NESControllerTemplate[] NESController = new NESControllerTemplate[4];
}
public class SMSControllerTemplate
@ -201,16 +207,31 @@
public string B;
public string Start;
public string Select;
public NESControllerTemplate()
public NESControllerTemplate() { }
public NESControllerTemplate(bool defaults)
{
Up = "J1 Up";
Down = "J1 Down";
Left = "J1 Left";
Right = "J1 Right";
A = "J1 B1, Z";
B = "J1 B2, X";
Start = "J1 B10, Return";
Select = "J1 B9, Space";
if (defaults)
{
Up = "J1 Up, UpArrow";
Down = "J1 Down, DownArrow";
Left = "J1 Left, LeftArrow";
Right = "J1 Right, RightArrow";
A = "J1 B1, Z";
B = "J1 B2, X";
Start = "J1 B10, Return";
Select = "J1 B9, Space";
}
else
{
Up = "";
Down = "";
Right = "";
Left = "";
A = "";
B = "";
Start = "";
Select = "";
}
}
}
}

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3615
// Runtime Version:2.0.50727.3053
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -109,6 +109,13 @@ namespace BizHawk.MultiClient.Properties {
}
}
internal static System.Drawing.Bitmap NESController {
get {
object obj = ResourceManager.GetObject("NESController", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap PCEngineController {
get {
object obj = ResourceManager.GetObject("PCEngineController", resourceCulture);

View File

@ -136,6 +136,9 @@
<data name="GENController" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\GENController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NESController" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\NESController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="InserSeparator" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\InserSeparator.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -149,7 +149,8 @@
"PC Engine / SGX",
"Gameboy",
"Sega Genesis",
"TI-83"});
"TI-83",
"NES"});
this.SystemComboBox.Location = new System.Drawing.Point(6, 19);
this.SystemComboBox.Name = "SystemComboBox";
this.SystemComboBox.Size = new System.Drawing.Size(146, 21);

View File

@ -45,7 +45,7 @@ namespace BizHawk.MultiClient
if (x != -1)
return oldmap.Substring(0, x + 2) + button;
else
return oldmap + ", " + button;
return button;
}
private void DoSMS()
@ -133,8 +133,7 @@ namespace BizHawk.MultiClient
ButtonMappings[4] = TruncateButtonMapping(Global.Config.PCEController[jpad].I);
ButtonMappings[5] = TruncateButtonMapping(Global.Config.PCEController[jpad].II);
ButtonMappings[6] = TruncateButtonMapping(Global.Config.PCEController[jpad].Run);
ButtonMappings[7] = TruncateButtonMapping(Global.Config.PCEController[jpad].Select);
Changed = true;
ButtonMappings[7] = TruncateButtonMapping(Global.Config.PCEController[jpad].Select);
Labels.Clear();
TextBoxes.Clear();
for (int i = 0; i < PCEControlList.Length; i++)
@ -200,7 +199,37 @@ namespace BizHawk.MultiClient
private void DoNES()
{
Label TempLabel;
InputWidget TempTextBox;
this.Text = ControllerStr + "NES";
ControllerImage.Image = BizHawk.MultiClient.Properties.Resources.NESController;
int jpad = this.ControllComboBox.SelectedIndex;
string[] ButtonMappings = new string[NESControlList.Length];
ButtonMappings[0] = TruncateButtonMapping(Global.Config.NESController[jpad].Up);
ButtonMappings[1] = TruncateButtonMapping(Global.Config.NESController[jpad].Down);
ButtonMappings[2] = TruncateButtonMapping(Global.Config.NESController[jpad].Left);
ButtonMappings[3] = TruncateButtonMapping(Global.Config.NESController[jpad].Right);
ButtonMappings[4] = TruncateButtonMapping(Global.Config.NESController[jpad].A);
ButtonMappings[5] = TruncateButtonMapping(Global.Config.NESController[jpad].B);
ButtonMappings[6] = TruncateButtonMapping(Global.Config.NESController[jpad].Start);
ButtonMappings[7] = TruncateButtonMapping(Global.Config.NESController[jpad].Select);
Changed = true;
Labels.Clear();
TextBoxes.Clear();
for (int i = 0; i < NESControlList.Length; i++)
{
TempLabel = new Label();
TempLabel.Text = NESControlList[i];
TempLabel.Location = new Point(8, 20 + (i * 24));
Labels.Add(TempLabel);
TempTextBox = new InputWidget();
TempTextBox.Location = new Point(48, 20 + (i * 24));
TextBoxes.Add(TempTextBox);
TempTextBox.Text = ButtonMappings[i];
ButtonsGroupBox.Controls.Add(TempTextBox);
ButtonsGroupBox.Controls.Add(TempLabel);
}
Changed = true;
}
private void DoGameBoy()
@ -315,7 +344,7 @@ namespace BizHawk.MultiClient
UpdatePCE(CurSelectController);
break;
case "Gameboy":
//UpdateGB();
UpdateGameBoy();
break;
case "Sega Genesis":
//UpdateGenesis();
@ -346,13 +375,15 @@ namespace BizHawk.MultiClient
UpdatePCE(CurSelectController);
break;
case "Gameboy":
//UpdateGB();
UpdateGameBoy();
break;
case "Sega Genesis":
//UpdateGenesis();
break;
case "TI-83":
//Update TI-83();
//Update TI-83();
break;
case "NES":
break;
}
Changed = false;
@ -373,8 +404,11 @@ namespace BizHawk.MultiClient
joypads = 8;
break;
case "TI-83":
joypads = 1;
break;
joypads = 1;
break;
case "NES":
joypads = 4;
break;
}
ControllComboBox.Items.Clear();
for (int i = 0; i < joypads; i++)
@ -395,10 +429,10 @@ namespace BizHawk.MultiClient
UpdateSMS(CurSelectController);
break;
case "PC Engine / SGX":
//UpdatePCE(CurSelectController);
UpdatePCE(CurSelectController);
break;
case "Gameboy":
//UpdateGB();
UpdateGameBoy();
break;
case "Sega Genesis":
//UpdateGenesis();