Fix comma mapping for input/hotkey config, make TI83 buttons remappable. TODO: find bit that maps to APPS button in TI83.cs

This commit is contained in:
andres.delikat 2011-04-24 16:57:43 +00:00
parent f0636a86ef
commit c94662ce00
3 changed files with 190 additions and 61 deletions

View File

@ -391,7 +391,6 @@
public string COS;
public string PRGM;
public string STAT;
public string COMMA;
public string SIN;
public string MATRIX;
public string X;
@ -412,59 +411,64 @@
public string DEL;
public TI83ControllerTemplate() { }
public bool Enabled;
public string COMMA;
public string APPS;
public TI83ControllerTemplate(bool defaults)
{
if (defaults)
{
Enabled = true;
_0 = "NumberPad0";
_1 = "NumberPad1";
_2 = "NumberPad2";
_3 = "NumberPad3";
_4 = "NumberPad4";
_5 = "NumberPad5";
_6 = "NumberPad6";
_7 = "NumberPad7";
_8 = "NumberPad8";
_9 = "NumberPad9";
DOT = "NumberPadPeriod";
ON = "Space";
ENTER = "Return";
UP = "UpArrow";
DOWN = "DownArrow";
LEFT = "LeftArrow";
RIGHT = "RightArrow";
PLUS = "NumberPadPlus";
MINUS = "NumberPadMinus";
MULTIPLY = "NumberPadStar";
DIVIDE = "NumberPadSlash";
CLEAR = "Escape";
EXP = "6";
DASH = "Minus";
PARACLOSE = "0";
PARAOPEN = "9";
TAN = "T";
VARS = "V";
COS = "C";
PRGM = "R";
STAT = "S";
MATRIX = "LeftBracket";
X = "X";
STO = "Insert";
LN = "L";
LOG = "O";
SQUARED = "2";
NEG1 = "1";
MATH = "M";
ALPHA = "A";
GRAPH = "G";
TRACE = "Home";
ZOOM = "Z";
WINDOW = "W";
Y = "Y";
SECOND = "Slash";
MODE = "BackSlash";
DEL = "Delete";
_0 = "NumberPad0"; //0
_1 = "NumberPad1"; //1
_2 = "NumberPad2"; //2
_3 = "NumberPad3"; //3
_4 = "NumberPad4"; //4
_5 = "NumberPad5"; //5
_6 = "NumberPad6"; //6
_7 = "NumberPad7"; //7
_8 = "NumberPad8"; //8
_9 = "NumberPad9"; //9
DOT = "NumberPadPeriod";//10
ON = "Space"; //11
ENTER = "Return"; //12
UP = "UpArrow"; //13
DOWN = "DownArrow"; //14
LEFT = "LeftArrow"; //15
RIGHT = "RightArrow"; //16
PLUS = "NumberPadPlus"; //17
MINUS = "NumberPadMinus"; //18
MULTIPLY = "NumberPadStar"; //19
DIVIDE = "NumberPadSlash"; //20
CLEAR = "Escape"; //21
EXP = "6"; //22
DASH = "Minus"; //23
PARACLOSE = "0"; //24
PARAOPEN = "9"; //25
TAN = "T"; //26
VARS = "V"; //27
COS = "C"; //28
PRGM = "R"; //29
STAT = "S"; //30
MATRIX = "LeftBracket"; //31
X = "X"; //32
STO = "Insert"; //33
LN = "L"; //34
LOG = "O"; //35
SQUARED = "2"; //36
NEG1 = "1"; //37
MATH = "M"; //38
ALPHA = "A"; //39
GRAPH = "G"; //40
TRACE = "Home"; //41
ZOOM = "Z"; //42
WINDOW = "W"; //43
Y = "Y"; //44
SECOND = "Slash"; //45
MODE = "BackSlash"; //46
DEL = "Delete"; //47
COMMA = "Comma"; //48
SIN = "Period"; //49
APPS = "Home"; //50
}
else
{
@ -500,7 +504,6 @@
COS = "";
PRGM = "";
STAT = "";
COMMA = "";
SIN = "";
MATRIX = "";
X = "";
@ -519,6 +522,8 @@
SECOND = "";
MODE = "";
DEL = "";
COMMA = "";
APPS = "";
}
}
}

View File

@ -17,9 +17,12 @@ namespace BizHawk.MultiClient
const string ControllerStr = "Configure Controllers - ";
public static string[] SMSControlList = new string[] { "Up", "Down", "Left", "Right", "B1", "B2", "Pause", "Reset" };
public static string[] PCEControlList = new string[] { "Up", "Down", "Left", "Right", "I", "II", "Run", "Select" };
public static string[] GenesisControlList = new string[] { "Up", "Down", "Left", "Right", "A", "B", "C", "Start", "X", "Y", "Z" };
public static string[] GenesisControlList = new string[] { "Up", "Down", "Left", "Right", "A", "B", "C", "Start", "X,T,0", "Y=", "Z" };
public static string[] NESControlList = new string[] { "Up", "Down", "Left", "Right", "A", "B", "Start", "Select" };
public static string[] TI83ControlList = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "Dot", "On", "Enter", "Up", "Down", "Left", "Right", "Plus", "Minus", "Multiply", "Divide", "Clear"};
public static string[] TI83ControlList = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "ON",
"ENTER", "Up", "Down", "Left", "Right", "+", "-", "Multiply", "Divide", "CLEAR", "^", "-", "(", ")", "TAN", "VARS",
"COS", "PRGM", "STAT", "Matrix", "X", "STO->", "LN", "LOG", "^2", "^-1", "MATH", "ALPHA", "GRAPH", "TRACE", "ZOOM", "WINDOW",
"Y", "2nd", "MODE", "Del", ",", "SIN", "APPS"}; //TODO: display shift / alpha names too, Also order these in the order
private ArrayList Labels;
private ArrayList TextBoxes;
private string CurSelectConsole;
@ -229,6 +232,35 @@ namespace BizHawk.MultiClient
ButtonMappings[19] = Global.Config.TI83Controller[jpad].MULTIPLY;
ButtonMappings[20] = Global.Config.TI83Controller[jpad].DIVIDE;
ButtonMappings[21] = Global.Config.TI83Controller[jpad].CLEAR;
ButtonMappings[22] = Global.Config.TI83Controller[jpad].EXP;
ButtonMappings[23] = Global.Config.TI83Controller[jpad].DASH;
ButtonMappings[24] = Global.Config.TI83Controller[jpad].PARACLOSE;
ButtonMappings[25] = Global.Config.TI83Controller[jpad].PARAOPEN;
ButtonMappings[26] = Global.Config.TI83Controller[jpad].TAN;
ButtonMappings[27] = Global.Config.TI83Controller[jpad].VARS;
ButtonMappings[28] = Global.Config.TI83Controller[jpad].COS;
ButtonMappings[29] = Global.Config.TI83Controller[jpad].PRGM;
ButtonMappings[30] = Global.Config.TI83Controller[jpad].STAT;
ButtonMappings[31] = Global.Config.TI83Controller[jpad].MATRIX;
ButtonMappings[32] = Global.Config.TI83Controller[jpad].X;
ButtonMappings[33] = Global.Config.TI83Controller[jpad].STO;
ButtonMappings[34] = Global.Config.TI83Controller[jpad].LN;
ButtonMappings[35] = Global.Config.TI83Controller[jpad].LOG;
ButtonMappings[36] = Global.Config.TI83Controller[jpad].SQUARED;
ButtonMappings[37] = Global.Config.TI83Controller[jpad].NEG1;
ButtonMappings[38] = Global.Config.TI83Controller[jpad].MATH;
ButtonMappings[39] = Global.Config.TI83Controller[jpad].ALPHA;
ButtonMappings[40] = Global.Config.TI83Controller[jpad].GRAPH;
ButtonMappings[41] = Global.Config.TI83Controller[jpad].TRACE;
ButtonMappings[42] = Global.Config.TI83Controller[jpad].ZOOM;
ButtonMappings[43] = Global.Config.TI83Controller[jpad].WINDOW;
ButtonMappings[44] = Global.Config.TI83Controller[jpad].Y;
ButtonMappings[45] = Global.Config.TI83Controller[jpad].SECOND;
ButtonMappings[46] = Global.Config.TI83Controller[jpad].MODE;
ButtonMappings[47] = Global.Config.TI83Controller[jpad].DEL;
ButtonMappings[48] = Global.Config.TI83Controller[jpad].COMMA;
ButtonMappings[49] = Global.Config.TI83Controller[jpad].SIN;
ButtonMappings[50] = Global.Config.TI83Controller[jpad].APPS;
IDX_CONTROLLERENABLED.Checked = Global.Config.TI83Controller[jpad].Enabled;
Changed = true;
Labels.Clear();
@ -288,35 +320,125 @@ namespace BizHawk.MultiClient
Global.Config.TI83Controller[0].DOT = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].DOT);
TempBox.Dispose();
TempBox = TextBoxes[11] as InputWidget;
Global.Config.TI83Controller[0].ENTER = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].ENTER);
Global.Config.TI83Controller[0].ON = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].ON);
TempBox.Dispose();
TempBox = TextBoxes[12] as InputWidget;
Global.Config.TI83Controller[0].UP = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].UP);
Global.Config.TI83Controller[0].ENTER = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].ENTER);
TempBox.Dispose();
TempBox = TextBoxes[13] as InputWidget;
Global.Config.TI83Controller[0].DOWN = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].DOWN);
Global.Config.TI83Controller[0].UP = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].UP);
TempBox.Dispose();
TempBox = TextBoxes[14] as InputWidget;
Global.Config.TI83Controller[0].LEFT = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].LEFT);
Global.Config.TI83Controller[0].DOWN = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].DOWN);
TempBox.Dispose();
TempBox = TextBoxes[15] as InputWidget;
Global.Config.TI83Controller[0].RIGHT = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].RIGHT);
Global.Config.TI83Controller[0].LEFT = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].LEFT);
TempBox.Dispose();
TempBox = TextBoxes[16] as InputWidget;
Global.Config.TI83Controller[0].PLUS = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].PLUS);
Global.Config.TI83Controller[0].RIGHT = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].RIGHT);
TempBox.Dispose();
TempBox = TextBoxes[17] as InputWidget;
Global.Config.TI83Controller[0].MINUS = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].MINUS);
Global.Config.TI83Controller[0].PLUS = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].PLUS);
TempBox.Dispose();
TempBox = TextBoxes[18] as InputWidget;
Global.Config.TI83Controller[0].MULTIPLY = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].MULTIPLY);
Global.Config.TI83Controller[0].MINUS = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].MINUS);
TempBox.Dispose();
TempBox = TextBoxes[19] as InputWidget;
Global.Config.TI83Controller[0].DIVIDE = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].DIVIDE);
Global.Config.TI83Controller[0].MULTIPLY = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].MULTIPLY);
TempBox.Dispose();
TempBox = TextBoxes[20] as InputWidget;
Global.Config.TI83Controller[0].DIVIDE = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].DIVIDE);
TempBox.Dispose();
TempBox = TextBoxes[21] as InputWidget;
Global.Config.TI83Controller[0].CLEAR = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].CLEAR);
TempBox.Dispose();
TempBox = TextBoxes[22] as InputWidget;
Global.Config.TI83Controller[0].EXP = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].EXP);
TempBox.Dispose();
TempBox = TextBoxes[23] as InputWidget;
Global.Config.TI83Controller[0].DASH = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].DASH);
TempBox.Dispose();
TempBox = TextBoxes[24] as InputWidget;
Global.Config.TI83Controller[0].PARACLOSE = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].PARACLOSE);
TempBox.Dispose();
TempBox = TextBoxes[25] as InputWidget;
Global.Config.TI83Controller[0].PARAOPEN = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].PARAOPEN);
TempBox.Dispose();
TempBox = TextBoxes[26] as InputWidget;
Global.Config.TI83Controller[0].TAN = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].TAN);
TempBox.Dispose();
TempBox = TextBoxes[27] as InputWidget;
Global.Config.TI83Controller[0].VARS = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].VARS);
TempBox.Dispose();
TempBox = TextBoxes[28] as InputWidget;
Global.Config.TI83Controller[0].COS = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].COS);
TempBox.Dispose();
TempBox = TextBoxes[29] as InputWidget;
Global.Config.TI83Controller[0].PRGM = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].PRGM);
TempBox.Dispose();
TempBox = TextBoxes[30] as InputWidget;
Global.Config.TI83Controller[0].STAT = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].STAT);
TempBox.Dispose();
TempBox = TextBoxes[31] as InputWidget;
Global.Config.TI83Controller[0].MATRIX = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].MATRIX);
TempBox.Dispose();
TempBox = TextBoxes[32] as InputWidget;
Global.Config.TI83Controller[0].X = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].X);
TempBox.Dispose();
TempBox = TextBoxes[33] as InputWidget;
Global.Config.TI83Controller[0].STO = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].STO);
TempBox.Dispose();
TempBox = TextBoxes[34] as InputWidget;
Global.Config.TI83Controller[0].LN = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].LN);
TempBox.Dispose();
TempBox = TextBoxes[35] as InputWidget;
Global.Config.TI83Controller[0].LOG = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].LOG);
TempBox.Dispose();
TempBox = TextBoxes[36] as InputWidget;
Global.Config.TI83Controller[0].SQUARED = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].SQUARED);
TempBox.Dispose();
TempBox = TextBoxes[37] as InputWidget;
Global.Config.TI83Controller[0].NEG1 = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].NEG1);
TempBox.Dispose();
TempBox = TextBoxes[38] as InputWidget;
Global.Config.TI83Controller[0].MATH = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].MATH);
TempBox.Dispose();
TempBox = TextBoxes[39] as InputWidget;
Global.Config.TI83Controller[0].ALPHA = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].ALPHA);
TempBox.Dispose();
TempBox = TextBoxes[40] as InputWidget;
Global.Config.TI83Controller[0].GRAPH = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].GRAPH);
TempBox.Dispose();
TempBox = TextBoxes[41] as InputWidget;
Global.Config.TI83Controller[0].TRACE = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].TRACE);
TempBox.Dispose();
TempBox = TextBoxes[42] as InputWidget;
Global.Config.TI83Controller[0].ZOOM = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].ZOOM);
TempBox.Dispose();
TempBox = TextBoxes[43] as InputWidget;
Global.Config.TI83Controller[0].WINDOW = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].WINDOW);
TempBox.Dispose();
TempBox = TextBoxes[44] as InputWidget;
Global.Config.TI83Controller[0].Y = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].Y);
TempBox.Dispose();
TempBox = TextBoxes[45] as InputWidget;
Global.Config.TI83Controller[0].SECOND = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].SECOND);
TempBox.Dispose();
TempBox = TextBoxes[46] as InputWidget;
Global.Config.TI83Controller[0].MODE = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].MODE);
TempBox.Dispose();
TempBox = TextBoxes[47] as InputWidget;
Global.Config.TI83Controller[0].DEL = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].DEL);
TempBox.Dispose();
TempBox = TextBoxes[48] as InputWidget;
Global.Config.TI83Controller[0].COMMA = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].COMMA);
TempBox.Dispose();
TempBox = TextBoxes[49] as InputWidget;
Global.Config.TI83Controller[0].SIN = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].SIN);
TempBox.Dispose();
TempBox = TextBoxes[50] as InputWidget;
Global.Config.TI83Controller[0].APPS = AppendButtonMapping(TempBox.Text, Global.Config.TI83Controller[0].APPS);
TempBox.Dispose();
for (int i = 0; i < TI83ControlList.Length; i++)
{

View File

@ -124,6 +124,8 @@ namespace BizHawk.MultiClient
str = "Slash";
if (str.Length == 8 && str == "Oemtilde")
str = "Grave";
if (str.Length == 8 && str == "Oemcomma")
str = "Comma";
if (str.Length > 3)
{
if (str.Substring(0, 3) == "Oem")