TI83 - implement mnemonic functions, finish hooking up buttons to main form

This commit is contained in:
andres.delikat 2011-04-24 19:01:12 +00:00
parent c94662ce00
commit 09162b5367
2 changed files with 162 additions and 42 deletions

View File

@ -55,7 +55,7 @@ namespace BizHawk.Emulation.Consoles.Calculator
else input += ".";
if (Controller.IsPressed("ON")) input += "O";
else input += ".";
if (Controller.IsPressed("ENTER")) input += "E";
if (Controller.IsPressed("ENTER")) input += "=";
else input += ".";
if (Controller.IsPressed("UP")) input += "U";
else input += ".";
@ -67,13 +67,71 @@ namespace BizHawk.Emulation.Consoles.Calculator
else input += ".";
if (Controller.IsPressed("PLUS")) input += "+";
else input += ".";
if (Controller.IsPressed("MINUS")) input += "-";
if (Controller.IsPressed("MINUS")) input += "_";
else input += ".";
if (Controller.IsPressed("MULTIPLY")) input += "*";
else input += ".";
if (Controller.IsPressed("DIVIDE")) input += "/";
else input += ".";
if (Controller.IsPressed("CLEAR")) input += "C";
if (Controller.IsPressed("CLEAR")) input += "c";
else input += ".";
if (Controller.IsPressed("EXP")) input += "^";
else input += ".";
if (Controller.IsPressed("DASH")) input += "-";
else input += ".";
if (Controller.IsPressed("PARAOPEN")) input += "(";
else input += ".";
if (Controller.IsPressed("PARACLOSE")) input += ")";
else input += ".";
if (Controller.IsPressed("TAN")) input += "T";
else input += ".";
if (Controller.IsPressed("VARS")) input += "V";
else input += ".";
if (Controller.IsPressed("COS")) input += "C";
else input += ".";
if (Controller.IsPressed("PRGM")) input += "P";
else input += ".";
if (Controller.IsPressed("STAT")) input += "s";
else input += ".";
if (Controller.IsPressed("MATRIX")) input += "m";
else input += ".";
if (Controller.IsPressed("X")) input += "X";
else input += ".";
if (Controller.IsPressed("STO")) input += ">";
else input += ".";
if (Controller.IsPressed("LN")) input += "n";
else input += ".";
if (Controller.IsPressed("LOG")) input += "L";
else input += ".";
if (Controller.IsPressed("SQUARED")) input += "2";
else input += ".";
if (Controller.IsPressed("NEG1")) input += "1";
else input += ".";
if (Controller.IsPressed("MATH")) input += "H";
else input += ".";
if (Controller.IsPressed("ALPHA")) input += "A";
else input += ".";
if (Controller.IsPressed("GRAPH")) input += "G";
else input += ".";
if (Controller.IsPressed("TRACE")) input += "t";
else input += ".";
if (Controller.IsPressed("ZOOM")) input += "Z";
else input += ".";
if (Controller.IsPressed("WINDOW")) input += "W";
else input += ".";
if (Controller.IsPressed("Y")) input += "Y";
else input += ".";
if (Controller.IsPressed("2ND")) input += "&";
else input += ".";
if (Controller.IsPressed("MODE")) input += "O";
else input += ".";
if (Controller.IsPressed("DEL")) input += "D";
else input += ".";
if (Controller.IsPressed("COMMA")) input += ",";
else input += ".";
if (Controller.IsPressed("SIN")) input += "S";
else input += ".";
if (Controller.IsPressed("APPS")) input += "@";
else input += ".";
input += "|.|"; //TODO: perhaps ON should go here?
@ -110,24 +168,82 @@ namespace BizHawk.Emulation.Consoles.Calculator
Controller.ForceButton("ON");
if (mnemonic[13] != '.')
Controller.ForceButton("ENTER");
if (mnemonic[13] != '.')
if (mnemonic[14] != '.')
Controller.ForceButton("UP");
if (mnemonic[13] != '.')
if (mnemonic[15] != '.')
Controller.ForceButton("DOWN");
if (mnemonic[13] != '.')
if (mnemonic[16] != '.')
Controller.ForceButton("LEFT");
if (mnemonic[13] != '.')
if (mnemonic[17] != '.')
Controller.ForceButton("RIGHT");
if (mnemonic[13] != '.')
if (mnemonic[18] != '.')
Controller.ForceButton("PLUS");
if (mnemonic[13] != '.')
if (mnemonic[19] != '.')
Controller.ForceButton("MINUS");
if (mnemonic[13] != '.')
if (mnemonic[20] != '.')
Controller.ForceButton("MULTIPLY");
if (mnemonic[13] != '.')
if (mnemonic[21] != '.')
Controller.ForceButton("DIVIDE");
if (mnemonic[13] != '.')
if (mnemonic[22] != '.')
Controller.ForceButton("CLEAR");
if (mnemonic[23] != '.')
Controller.ForceButton("EXP");
if (mnemonic[24] != '.')
Controller.ForceButton("DASH");
if (mnemonic[25] != '.')
Controller.ForceButton("PARAOPEN");
if (mnemonic[26] != '.')
Controller.ForceButton("PARACLOSE");
if (mnemonic[27] != '.')
Controller.ForceButton("TAN");
if (mnemonic[28] != '.')
Controller.ForceButton("VARS");
if (mnemonic[29] != '.')
Controller.ForceButton("COS");
if (mnemonic[30] != '.')
Controller.ForceButton("PGRM");
if (mnemonic[31] != '.')
Controller.ForceButton("STAT");
if (mnemonic[32] != '.')
Controller.ForceButton("MATRIX");
if (mnemonic[33] != '.')
Controller.ForceButton("X");
if (mnemonic[34] != '.')
Controller.ForceButton("STO");
if (mnemonic[35] != '.')
Controller.ForceButton("LN");
if (mnemonic[36] != '.')
Controller.ForceButton("LOG");
if (mnemonic[37] != '.')
Controller.ForceButton("SQUARED");
if (mnemonic[38] != '.')
Controller.ForceButton("NEG");
if (mnemonic[39] != '.')
Controller.ForceButton("MATH");
if (mnemonic[40] != '.')
Controller.ForceButton("ALPHA");
if (mnemonic[41] != '.')
Controller.ForceButton("GRAPH");
if (mnemonic[42] != '.')
Controller.ForceButton("TRACE");
if (mnemonic[43] != '.')
Controller.ForceButton("ZOOM");
if (mnemonic[44] != '.')
Controller.ForceButton("WINDOW");
if (mnemonic[45] != '.')
Controller.ForceButton("Y");
if (mnemonic[46] != '.')
Controller.ForceButton("2ND");
if (mnemonic[47] != '.')
Controller.ForceButton("MODE");
if (mnemonic[48] != '.')
Controller.ForceButton("DEL");
if (mnemonic[49] != '.')
Controller.ForceButton("COMMA");
if (mnemonic[50] != '.')
Controller.ForceButton("SIN");
if (mnemonic[51] != '.')
Controller.ForceButton("APPS");
}
public byte ReadMemory(ushort addr)
@ -285,7 +401,8 @@ namespace BizHawk.Emulation.Consoles.Calculator
if (Controller.IsPressed("LOG")) ret ^= 8;
if (Controller.IsPressed("SQUARED")) ret ^= 16;
if (Controller.IsPressed("NEG1")) ret ^= 32;
if (Controller.IsPressed("MATH")) ret ^= 64;
if (Controller.IsPressed("MATH"))
ret ^= 64;
if (Controller.IsPressed("ALPHA")) ret ^= 128;
}
@ -481,7 +598,7 @@ namespace BizHawk.Emulation.Consoles.Calculator
"CLEAR", "EXP", "DASH", "PARACLOSE", "TAN", "VARS", "PARAOPEN",
"COS", "PRGM", "STAT", "COMMA", "SIN", "MATRIX", "X",
"STO", "LN", "LOG", "SQUARED", "NEG1", "MATH", "ALPHA",
"GRAPH", "TRACE", "ZOOM", "WINDOW", "Y", "2ND", "MODE", "DEL"
"GRAPH", "TRACE", "ZOOM", "WINDOW", "Y", "2ND", "MODE", "DEL", "APPS"
}
};

View File

@ -405,34 +405,37 @@ namespace BizHawk.MultiClient
TI83Controls.BindMulti("DIVIDE", Global.Config.TI83Controller[0].DIVIDE);
TI83Controls.BindMulti("CLEAR", Global.Config.TI83Controller[0].CLEAR);
TI83Controls.BindMulti("DOT", Global.Config.TI83Controller[0].DOT);
TI83Controls.BindMulti("EXP", "");
TI83Controls.BindMulti("DASH", "");
TI83Controls.BindMulti("PARACLOSE", "0");
TI83Controls.BindMulti("TAN", "");
TI83Controls.BindMulti("VARS", "");
TI83Controls.BindMulti("PARAOPEN", "9");
TI83Controls.BindMulti("COS", "");
TI83Controls.BindMulti("PRGM", "");
TI83Controls.BindMulti("STAT", "");
TI83Controls.BindMulti("COMMA", "");
TI83Controls.BindMulti("SIN", "");
TI83Controls.BindMulti("MATRIX", "");
TI83Controls.BindMulti("X", "");
TI83Controls.BindMulti("STO", "");
TI83Controls.BindMulti("LN", "");
TI83Controls.BindMulti("LOG", "");
TI83Controls.BindMulti("SQUARED", "");
TI83Controls.BindMulti("NEG1", "");
TI83Controls.BindMulti("MATH", "");
TI83Controls.BindMulti("ALPHA", "");
TI83Controls.BindMulti("GRAPH", "");
TI83Controls.BindMulti("TRACE", "");
TI83Controls.BindMulti("ZOOM", "");
TI83Controls.BindMulti("WINDOW", "");
TI83Controls.BindMulti("Y", "");
TI83Controls.BindMulti("2ND", "");
TI83Controls.BindMulti("MODE", "");
TI83Controls.BindMulti("DEL", "");
TI83Controls.BindMulti("EXP", Global.Config.TI83Controller[0].EXP);
TI83Controls.BindMulti("DASH", Global.Config.TI83Controller[0].DASH);
TI83Controls.BindMulti("PARACLOSE", Global.Config.TI83Controller[0].DASH);
TI83Controls.BindMulti("TAN", Global.Config.TI83Controller[0].TAN);
TI83Controls.BindMulti("VARS", Global.Config.TI83Controller[0].VARS);
TI83Controls.BindMulti("PARAOPEN", Global.Config.TI83Controller[0].PARAOPEN);
TI83Controls.BindMulti("COS", Global.Config.TI83Controller[0].COS);
TI83Controls.BindMulti("PRGM", Global.Config.TI83Controller[0].PRGM);
TI83Controls.BindMulti("STAT", Global.Config.TI83Controller[0].STAT);
TI83Controls.BindMulti("COMMA", Global.Config.TI83Controller[0].COMMA);
TI83Controls.BindMulti("SIN", Global.Config.TI83Controller[0].SIN);
TI83Controls.BindMulti("MATRIX", Global.Config.TI83Controller[0].MATRIX);
TI83Controls.BindMulti("X", Global.Config.TI83Controller[0].X);
TI83Controls.BindMulti("STO", Global.Config.TI83Controller[0].STO);
TI83Controls.BindMulti("LN", Global.Config.TI83Controller[0].LN);
TI83Controls.BindMulti("LOG", Global.Config.TI83Controller[0].LOG);
TI83Controls.BindMulti("SQUARED", Global.Config.TI83Controller[0].SQUARED);
TI83Controls.BindMulti("NEG1", Global.Config.TI83Controller[0].NEG1);
TI83Controls.BindMulti("MATH", Global.Config.TI83Controller[0].MATH);
TI83Controls.BindMulti("ALPHA", Global.Config.TI83Controller[0].ALPHA);
TI83Controls.BindMulti("GRAPH", Global.Config.TI83Controller[0].GRAPH);
TI83Controls.BindMulti("TRACE", Global.Config.TI83Controller[0].TRACE);
TI83Controls.BindMulti("ZOOM", Global.Config.TI83Controller[0].ZOOM);
TI83Controls.BindMulti("WINDOW", Global.Config.TI83Controller[0].WINDOW);
TI83Controls.BindMulti("Y", Global.Config.TI83Controller[0].Y);
TI83Controls.BindMulti("2ND", Global.Config.TI83Controller[0].SECOND);
TI83Controls.BindMulti("MODE", Global.Config.TI83Controller[0].MODE);
TI83Controls.BindMulti("DEL", Global.Config.TI83Controller[0].DEL);
TI83Controls.BindMulti("DEL", Global.Config.TI83Controller[0].COMMA);
TI83Controls.BindMulti("DEL", Global.Config.TI83Controller[0].SIN);
TI83Controls.BindMulti("DEL", Global.Config.TI83Controller[0].APPS);
Global.TI83Controls = TI83Controls;
}