2011-01-29 00:10:08 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2011-02-19 20:31:32 +00:00
|
|
|
|
using System.Collections;
|
2011-01-29 00:10:08 +00:00
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk.MultiClient
|
|
|
|
|
{
|
|
|
|
|
public partial class InputConfig : Form
|
|
|
|
|
{
|
2011-01-29 01:25:57 +00:00
|
|
|
|
const string ControllerStr = "Configure Controllers - ";
|
2011-02-19 21:27:10 +00:00
|
|
|
|
public static string[] SMSControlList = new string[] { "Up", "Down", "Left", "Right", "B1", "B2", "Pause", "Reset" };
|
2011-02-20 07:30:16 +00:00
|
|
|
|
public static string[] PCEControlList = new string[] { "Up", "Down", "Left", "Right", "I", "II", "Run", "Select" };
|
2011-02-19 21:27:10 +00:00
|
|
|
|
public static string[] GenesisControlList = new string[] { "Up", "Down", "Left", "Right", "A", "B", "C", "Start", "X", "Y", "Z" };
|
2011-02-19 22:07:52 +00:00
|
|
|
|
public static string[] NESControlList = new string[] { "Up", "Down", "Left", "Right", "A", "B", "Start", "Select" };
|
2011-02-19 20:31:32 +00:00
|
|
|
|
private ArrayList Labels;
|
|
|
|
|
private ArrayList TextBoxes;
|
2011-02-19 21:06:58 +00:00
|
|
|
|
private string CurSelectConsole;
|
|
|
|
|
private int CurSelectController;
|
|
|
|
|
private bool Changed;
|
2011-01-29 00:10:08 +00:00
|
|
|
|
public InputConfig()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2011-02-19 20:31:32 +00:00
|
|
|
|
Labels = new ArrayList();
|
|
|
|
|
TextBoxes = new ArrayList();
|
2011-02-19 21:06:58 +00:00
|
|
|
|
Changed = false;
|
2011-01-29 00:10:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-01-30 16:15:39 +00:00
|
|
|
|
private string TruncateButtonMapping(string button)
|
|
|
|
|
{
|
|
|
|
|
//all config button mappings have the name followed by a comma & space, then key mapping, remove up through the space
|
2011-02-19 20:31:32 +00:00
|
|
|
|
int x = button.LastIndexOf(',');
|
|
|
|
|
if (x != -1)
|
|
|
|
|
return button.Substring(x + 2, button.Length - (x + 2));
|
|
|
|
|
else
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
private string AppendButtonMapping(string button, string oldmap)
|
|
|
|
|
{
|
|
|
|
|
int x = oldmap.LastIndexOf(',');
|
|
|
|
|
if (x != -1)
|
|
|
|
|
return oldmap.Substring(0, x + 2) + button;
|
|
|
|
|
else
|
2011-02-20 07:16:34 +00:00
|
|
|
|
return button;
|
2011-01-30 16:15:39 +00:00
|
|
|
|
}
|
2011-02-19 21:27:10 +00:00
|
|
|
|
|
2011-01-29 01:25:57 +00:00
|
|
|
|
private void DoSMS()
|
|
|
|
|
{
|
2011-02-19 20:31:32 +00:00
|
|
|
|
Label TempLabel;
|
|
|
|
|
InputWidget TempTextBox;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
this.Text = ControllerStr + "SMS / GG / SG-1000";
|
2011-01-29 19:06:34 +00:00
|
|
|
|
ControllerImage.Image = BizHawk.MultiClient.Properties.Resources.SMSController;
|
2011-02-19 20:31:32 +00:00
|
|
|
|
this.SystemComboBox.SelectedIndex = 0;
|
|
|
|
|
int jpad = this.ControllComboBox.SelectedIndex;
|
2011-02-19 21:27:10 +00:00
|
|
|
|
string[] ButtonMappings = new string[SMSControlList.Length];
|
2011-02-19 20:31:32 +00:00
|
|
|
|
ButtonMappings[0] = TruncateButtonMapping(Global.Config.SMSController[jpad].Up);
|
|
|
|
|
ButtonMappings[1] = TruncateButtonMapping(Global.Config.SMSController[jpad].Down);
|
|
|
|
|
ButtonMappings[2] = TruncateButtonMapping(Global.Config.SMSController[jpad].Left);
|
|
|
|
|
ButtonMappings[3] = TruncateButtonMapping(Global.Config.SMSController[jpad].Right);
|
|
|
|
|
ButtonMappings[4] = TruncateButtonMapping(Global.Config.SMSController[jpad].B1);
|
|
|
|
|
ButtonMappings[5] = TruncateButtonMapping(Global.Config.SMSController[jpad].B2);
|
|
|
|
|
ButtonMappings[6] = TruncateButtonMapping(Global.Config.SmsPause);
|
|
|
|
|
ButtonMappings[7] = TruncateButtonMapping(Global.Config.SmsReset);
|
2011-02-19 21:06:58 +00:00
|
|
|
|
Changed = true;
|
2011-02-19 20:31:32 +00:00
|
|
|
|
Labels.Clear();
|
2011-02-19 21:06:58 +00:00
|
|
|
|
TextBoxes.Clear();
|
2011-02-19 21:27:10 +00:00
|
|
|
|
for (int i = 0; i < SMSControlList.Length; i++)
|
2011-02-19 20:31:32 +00:00
|
|
|
|
{
|
|
|
|
|
TempLabel = new Label();
|
2011-02-19 21:27:10 +00:00
|
|
|
|
TempLabel.Text = SMSControlList[i];
|
2011-02-19 20:31:32 +00:00
|
|
|
|
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);
|
|
|
|
|
}
|
2011-02-19 21:06:58 +00:00
|
|
|
|
Changed = true;
|
|
|
|
|
}
|
|
|
|
|
private void UpdateSMS(int prev)
|
|
|
|
|
{
|
2011-02-20 02:59:15 +00:00
|
|
|
|
ButtonsGroupBox.Controls.Clear();
|
2011-02-19 21:06:58 +00:00
|
|
|
|
InputWidget TempBox;
|
|
|
|
|
Label TempLabel;
|
2011-02-20 07:30:16 +00:00
|
|
|
|
TempBox = TextBoxes[0] as InputWidget;
|
2011-02-19 21:06:58 +00:00
|
|
|
|
Global.Config.SMSController[prev].Up = AppendButtonMapping(TempBox.Text, Global.Config.SMSController[prev].Up);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[1] as InputWidget;
|
|
|
|
|
Global.Config.SMSController[prev].Down = AppendButtonMapping(TempBox.Text, Global.Config.SMSController[prev].Down);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[2] as InputWidget;
|
|
|
|
|
Global.Config.SMSController[prev].Left = AppendButtonMapping(TempBox.Text, Global.Config.SMSController[prev].Left);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[3] as InputWidget;
|
|
|
|
|
Global.Config.SMSController[prev].Right = AppendButtonMapping(TempBox.Text, Global.Config.SMSController[prev].Right);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[4] as InputWidget;
|
|
|
|
|
Global.Config.SMSController[prev].B1 = AppendButtonMapping(TempBox.Text, Global.Config.SMSController[prev].B1);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[5] as InputWidget;
|
|
|
|
|
Global.Config.SMSController[prev].B2 = AppendButtonMapping(TempBox.Text, Global.Config.SMSController[prev].B2);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[6] as InputWidget;
|
|
|
|
|
Global.Config.SmsPause = AppendButtonMapping(TempBox.Text, Global.Config.SmsPause);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[7] as InputWidget;
|
|
|
|
|
Global.Config.SmsReset = AppendButtonMapping(TempBox.Text, Global.Config.SmsReset);
|
|
|
|
|
TempBox.Dispose();
|
2011-02-19 22:07:52 +00:00
|
|
|
|
for (int i = 0; i < SMSControlList.Length; i++)
|
2011-02-19 21:06:58 +00:00
|
|
|
|
{
|
|
|
|
|
TempLabel = Labels[i] as Label;
|
|
|
|
|
TempLabel.Dispose();
|
|
|
|
|
}
|
2011-01-29 01:25:57 +00:00
|
|
|
|
}
|
|
|
|
|
private void DoPCE()
|
|
|
|
|
{
|
2011-02-19 21:27:10 +00:00
|
|
|
|
Label TempLabel;
|
|
|
|
|
InputWidget TempTextBox;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
this.Text = ControllerStr + "PCEjin / SGX";
|
2011-02-20 07:30:16 +00:00
|
|
|
|
ControllerImage.Image = BizHawk.MultiClient.Properties.Resources.PCEngineController;
|
2011-02-19 21:27:10 +00:00
|
|
|
|
int jpad = this.ControllComboBox.SelectedIndex;
|
|
|
|
|
string[] ButtonMappings = new string[PCEControlList.Length];
|
|
|
|
|
ButtonMappings[0] = TruncateButtonMapping(Global.Config.PCEController[jpad].Up);
|
|
|
|
|
ButtonMappings[1] = TruncateButtonMapping(Global.Config.PCEController[jpad].Down);
|
|
|
|
|
ButtonMappings[2] = TruncateButtonMapping(Global.Config.PCEController[jpad].Left);
|
|
|
|
|
ButtonMappings[3] = TruncateButtonMapping(Global.Config.PCEController[jpad].Right);
|
|
|
|
|
ButtonMappings[4] = TruncateButtonMapping(Global.Config.PCEController[jpad].I);
|
|
|
|
|
ButtonMappings[5] = TruncateButtonMapping(Global.Config.PCEController[jpad].II);
|
|
|
|
|
ButtonMappings[6] = TruncateButtonMapping(Global.Config.PCEController[jpad].Run);
|
2011-02-20 07:30:16 +00:00
|
|
|
|
ButtonMappings[7] = TruncateButtonMapping(Global.Config.PCEController[jpad].Select);
|
2011-02-19 21:27:10 +00:00
|
|
|
|
Labels.Clear();
|
|
|
|
|
TextBoxes.Clear();
|
|
|
|
|
for (int i = 0; i < PCEControlList.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
TempLabel = new Label();
|
|
|
|
|
TempLabel.Text = PCEControlList[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 UpdatePCE(int prev)
|
|
|
|
|
{
|
2011-02-20 02:59:15 +00:00
|
|
|
|
ButtonsGroupBox.Controls.Clear();
|
2011-02-19 21:27:10 +00:00
|
|
|
|
InputWidget TempBox;
|
|
|
|
|
Label TempLabel;
|
|
|
|
|
TempBox = TextBoxes[0] as InputWidget;
|
|
|
|
|
Global.Config.PCEController[prev].Up = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].Up);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[1] as InputWidget;
|
|
|
|
|
Global.Config.PCEController[prev].Down = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].Down);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[2] as InputWidget;
|
|
|
|
|
Global.Config.PCEController[prev].Left = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].Left);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[3] as InputWidget;
|
|
|
|
|
Global.Config.PCEController[prev].Right = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].Right);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[4] as InputWidget;
|
|
|
|
|
Global.Config.PCEController[prev].I = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].I);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[5] as InputWidget;
|
|
|
|
|
Global.Config.PCEController[prev].II = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].II);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[6] as InputWidget;
|
|
|
|
|
Global.Config.PCEController[prev].Run = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].Run);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[7] as InputWidget;
|
|
|
|
|
Global.Config.PCEController[prev].Select = AppendButtonMapping(TempBox.Text, Global.Config.PCEController[prev].Select);
|
|
|
|
|
TempBox.Dispose();
|
2011-02-19 22:07:52 +00:00
|
|
|
|
for (int i = 0; i < PCEControlList.Length; i++)
|
2011-02-19 21:27:10 +00:00
|
|
|
|
{
|
|
|
|
|
TempLabel = Labels[i] as Label;
|
|
|
|
|
TempLabel.Dispose();
|
|
|
|
|
}
|
2011-01-29 01:25:57 +00:00
|
|
|
|
}
|
|
|
|
|
private void DoGen()
|
|
|
|
|
{
|
|
|
|
|
this.Text = ControllerStr + "Sega Genesis";
|
2011-01-29 19:06:34 +00:00
|
|
|
|
ControllerImage.Image = BizHawk.MultiClient.Properties.Resources.GENController;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DoTI83()
|
|
|
|
|
{
|
|
|
|
|
this.Text = ControllerStr + "TI-83";
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-20 07:30:16 +00:00
|
|
|
|
private void DoNES()
|
|
|
|
|
{
|
2011-02-20 07:16:34 +00:00
|
|
|
|
Label TempLabel;
|
|
|
|
|
InputWidget TempTextBox;
|
2011-02-20 07:30:16 +00:00
|
|
|
|
this.Text = ControllerStr + "NES";
|
2011-02-20 07:16:34 +00:00
|
|
|
|
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;
|
2011-02-20 07:30:16 +00:00
|
|
|
|
Labels.Clear();
|
|
|
|
|
TextBoxes.Clear();
|
2011-02-20 07:16:34 +00:00
|
|
|
|
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;
|
2011-02-20 07:30:16 +00:00
|
|
|
|
}
|
2011-02-20 02:17:09 +00:00
|
|
|
|
|
2011-01-29 01:25:57 +00:00
|
|
|
|
private void DoGameBoy()
|
|
|
|
|
{
|
2011-02-19 22:07:52 +00:00
|
|
|
|
Label TempLabel;
|
|
|
|
|
InputWidget TempTextBox;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
this.Text = ControllerStr + "Gameboy";
|
2011-01-29 03:09:31 +00:00
|
|
|
|
ControllerImage.Image = BizHawk.MultiClient.Properties.Resources.GBController;
|
2011-02-19 22:07:52 +00:00
|
|
|
|
string[] ButtonMappings = new string[NESControlList.Length];
|
|
|
|
|
ButtonMappings[0] = TruncateButtonMapping(Global.Config.GameBoyController.Up);
|
|
|
|
|
ButtonMappings[1] = TruncateButtonMapping(Global.Config.GameBoyController.Down);
|
|
|
|
|
ButtonMappings[2] = TruncateButtonMapping(Global.Config.GameBoyController.Left);
|
|
|
|
|
ButtonMappings[3] = TruncateButtonMapping(Global.Config.GameBoyController.Right);
|
|
|
|
|
ButtonMappings[4] = TruncateButtonMapping(Global.Config.GameBoyController.A);
|
|
|
|
|
ButtonMappings[5] = TruncateButtonMapping(Global.Config.GameBoyController.B);
|
|
|
|
|
ButtonMappings[6] = TruncateButtonMapping(Global.Config.GameBoyController.Start);
|
|
|
|
|
ButtonMappings[7] = TruncateButtonMapping(Global.Config.GameBoyController.Select);
|
|
|
|
|
Changed = true;
|
2011-02-20 07:30:16 +00:00
|
|
|
|
Labels.Clear();
|
|
|
|
|
TextBoxes.Clear();
|
2011-02-19 22:07:52 +00:00
|
|
|
|
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 UpdateGameBoy()
|
|
|
|
|
{
|
2011-02-20 02:59:15 +00:00
|
|
|
|
ButtonsGroupBox.Controls.Clear();
|
2011-02-19 22:07:52 +00:00
|
|
|
|
InputWidget TempBox;
|
|
|
|
|
Label TempLabel;
|
|
|
|
|
TempBox = TextBoxes[0] as InputWidget;
|
|
|
|
|
Global.Config.GameBoyController.Up = AppendButtonMapping(TempBox.Text, Global.Config.GameBoyController.Up);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[1] as InputWidget;
|
|
|
|
|
Global.Config.GameBoyController.Down = AppendButtonMapping(TempBox.Text, Global.Config.GameBoyController.Down);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[2] as InputWidget;
|
|
|
|
|
Global.Config.GameBoyController.Left = AppendButtonMapping(TempBox.Text, Global.Config.GameBoyController.Left);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[3] as InputWidget;
|
|
|
|
|
Global.Config.GameBoyController.Right = AppendButtonMapping(TempBox.Text, Global.Config.GameBoyController.Right);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[4] as InputWidget;
|
|
|
|
|
Global.Config.GameBoyController.A = AppendButtonMapping(TempBox.Text, Global.Config.GameBoyController.A);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[5] as InputWidget;
|
|
|
|
|
Global.Config.GameBoyController.B = AppendButtonMapping(TempBox.Text, Global.Config.GameBoyController.B);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[6] as InputWidget;
|
|
|
|
|
Global.Config.GameBoyController.Start = AppendButtonMapping(TempBox.Text, Global.Config.GameBoyController.Start);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[7] as InputWidget;
|
|
|
|
|
Global.Config.GameBoyController.Select = AppendButtonMapping(TempBox.Text, Global.Config.GameBoyController.Select);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
for (int i = 0; i < NESControlList.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
TempLabel = Labels[i] as Label;
|
|
|
|
|
TempLabel.Dispose();
|
|
|
|
|
}
|
2011-01-29 01:25:57 +00:00
|
|
|
|
}
|
2011-02-20 07:30:16 +00:00
|
|
|
|
private void UpdateNES(int prev)
|
|
|
|
|
{
|
|
|
|
|
ButtonsGroupBox.Controls.Clear();
|
|
|
|
|
InputWidget TempBox;
|
|
|
|
|
Label TempLabel;
|
|
|
|
|
TempBox = TextBoxes[0] as InputWidget;
|
|
|
|
|
Global.Config.NESController[prev].Up = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].Up);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[1] as InputWidget;
|
|
|
|
|
Global.Config.NESController[prev].Down = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].Down);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[2] as InputWidget;
|
|
|
|
|
Global.Config.NESController[prev].Left = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].Left);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[3] as InputWidget;
|
|
|
|
|
Global.Config.NESController[prev].Right = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].Right);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[4] as InputWidget;
|
|
|
|
|
Global.Config.NESController[prev].A = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].A);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[5] as InputWidget;
|
|
|
|
|
Global.Config.NESController[prev].B = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].B);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[6] as InputWidget;
|
|
|
|
|
Global.Config.NESController[prev].Start = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].Start);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
TempBox = TextBoxes[7] as InputWidget;
|
|
|
|
|
Global.Config.NESController[prev].Select = AppendButtonMapping(TempBox.Text, Global.Config.NESController[prev].Select);
|
|
|
|
|
TempBox.Dispose();
|
|
|
|
|
for (int i = 0; i < NESControlList.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
TempLabel = Labels[i] as Label;
|
|
|
|
|
TempLabel.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-01-29 00:10:08 +00:00
|
|
|
|
private void InputConfig_Load(object sender, EventArgs e)
|
2011-02-20 06:52:39 +00:00
|
|
|
|
{
|
|
|
|
|
|
2011-01-29 01:25:57 +00:00
|
|
|
|
if (!(Global.Emulator is NullEmulator))
|
|
|
|
|
{
|
|
|
|
|
switch (Global.Game.System)
|
|
|
|
|
{
|
|
|
|
|
case "SMS":
|
|
|
|
|
case "SG":
|
|
|
|
|
case "GG":
|
2011-02-20 06:52:39 +00:00
|
|
|
|
this.SystemComboBox.SelectedItem = 0;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case "PCE":
|
|
|
|
|
case "SGX":
|
2011-02-20 06:52:39 +00:00
|
|
|
|
this.SystemComboBox.SelectedItem = 1;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case "GEN":
|
2011-02-20 06:52:39 +00:00
|
|
|
|
this.SystemComboBox.SelectedItem = 2;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case "TI83":
|
2011-02-20 06:52:39 +00:00
|
|
|
|
this.SystemComboBox.SelectedItem = 3;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case "GB":
|
2011-02-20 06:52:39 +00:00
|
|
|
|
this.SystemComboBox.SelectedItem = 4;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2011-02-20 07:30:16 +00:00
|
|
|
|
}
|
2011-01-29 00:10:08 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2011-02-20 06:52:39 +00:00
|
|
|
|
if (Changed)
|
|
|
|
|
{
|
2011-02-20 07:30:16 +00:00
|
|
|
|
UpdateAll();
|
2011-02-20 06:52:39 +00:00
|
|
|
|
}
|
2011-01-29 00:10:08 +00:00
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Cancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2011-01-29 01:25:57 +00:00
|
|
|
|
|
|
|
|
|
private void SystemComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2011-02-19 21:06:58 +00:00
|
|
|
|
if (Changed)
|
|
|
|
|
{
|
2011-02-20 07:30:16 +00:00
|
|
|
|
UpdateAll();
|
2011-02-19 21:06:58 +00:00
|
|
|
|
}
|
2011-02-19 20:31:32 +00:00
|
|
|
|
int joypads = 0;
|
|
|
|
|
switch (this.SystemComboBox.SelectedItem.ToString())
|
2011-01-29 01:25:57 +00:00
|
|
|
|
{
|
|
|
|
|
case "SMS / GG / SG-1000":
|
2011-02-19 20:31:32 +00:00
|
|
|
|
joypads = 2;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case "PC Engine / SGX":
|
2011-02-19 20:31:32 +00:00
|
|
|
|
joypads = 5;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case "Gameboy":
|
2011-02-19 20:31:32 +00:00
|
|
|
|
joypads = 1;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case "Sega Genesis":
|
2011-02-19 20:31:32 +00:00
|
|
|
|
joypads = 8;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
break;
|
|
|
|
|
case "TI-83":
|
2011-02-20 07:30:16 +00:00
|
|
|
|
joypads = 1;
|
|
|
|
|
break;
|
2011-02-20 07:16:34 +00:00
|
|
|
|
case "NES":
|
|
|
|
|
joypads = 4;
|
|
|
|
|
break;
|
2011-02-19 20:31:32 +00:00
|
|
|
|
}
|
|
|
|
|
ControllComboBox.Items.Clear();
|
|
|
|
|
for (int i = 0; i < joypads; i++)
|
|
|
|
|
{
|
|
|
|
|
ControllComboBox.Items.Add(string.Format("Joypad {0}", i + 1));
|
|
|
|
|
}
|
2011-02-20 07:30:16 +00:00
|
|
|
|
ControllComboBox.SelectedIndex = 0;
|
2011-02-19 21:06:58 +00:00
|
|
|
|
CurSelectConsole = this.SystemComboBox.SelectedItem.ToString();
|
|
|
|
|
CurSelectController = 0;
|
2011-02-19 20:31:32 +00:00
|
|
|
|
}
|
|
|
|
|
private void ControllComboBox_SelectedIndexChanged(object sender, EventArgs e)
|
2011-02-19 21:06:58 +00:00
|
|
|
|
{
|
|
|
|
|
if (Changed)
|
|
|
|
|
{
|
2011-02-20 07:30:16 +00:00
|
|
|
|
UpdateAll();
|
|
|
|
|
}
|
|
|
|
|
switch (SystemComboBox.SelectedItem.ToString())
|
|
|
|
|
{
|
|
|
|
|
case "SMS / GG / SG-1000":
|
|
|
|
|
DoSMS();
|
|
|
|
|
break;
|
|
|
|
|
case "PC Engine / SGX":
|
|
|
|
|
DoPCE();
|
|
|
|
|
break;
|
|
|
|
|
case "Gameboy":
|
|
|
|
|
DoGameBoy();
|
|
|
|
|
break;
|
|
|
|
|
case "Sega Genesis":
|
|
|
|
|
DoGen();
|
|
|
|
|
break;
|
|
|
|
|
case "TI-83":
|
|
|
|
|
DoTI83();
|
|
|
|
|
break;
|
|
|
|
|
case "NES":
|
|
|
|
|
DoNES();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
CurSelectController = ControllComboBox.SelectedIndex;
|
|
|
|
|
}
|
|
|
|
|
private void UpdateAll()
|
|
|
|
|
{
|
|
|
|
|
switch (CurSelectConsole)
|
|
|
|
|
{
|
|
|
|
|
case "SMS / GG / SG-1000":
|
|
|
|
|
UpdateSMS(CurSelectController);
|
|
|
|
|
break;
|
|
|
|
|
case "PC Engine / SGX":
|
|
|
|
|
UpdatePCE(CurSelectController);
|
|
|
|
|
break;
|
|
|
|
|
case "Gameboy":
|
|
|
|
|
UpdateGameBoy();
|
|
|
|
|
break;
|
|
|
|
|
case "Sega Genesis":
|
|
|
|
|
//UpdateGenesis();
|
|
|
|
|
break;
|
|
|
|
|
case "TI-83":
|
|
|
|
|
//Update TI-83();
|
|
|
|
|
break;
|
|
|
|
|
case "NES":
|
|
|
|
|
UpdateNES(CurSelectController);
|
|
|
|
|
break;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
}
|
2011-02-20 07:30:16 +00:00
|
|
|
|
Changed = false;
|
2011-01-29 01:25:57 +00:00
|
|
|
|
}
|
2011-01-29 00:10:08 +00:00
|
|
|
|
}
|
2011-02-19 20:31:32 +00:00
|
|
|
|
|
2011-02-20 07:30:16 +00:00
|
|
|
|
}
|
|
|
|
|
|