Mnemonics for Saturn, probably
This commit is contained in:
parent
314906ce66
commit
b11fed8051
|
@ -79,7 +79,7 @@ namespace BizHawk.MultiClient
|
|||
N64AutoController[1] = new N64ButtonsTemplate(false);
|
||||
N64AutoController[2] = new N64ButtonsTemplate(false);
|
||||
N64AutoController[3] = new N64ButtonsTemplate(false);
|
||||
N64ConsoleButtons = new N64ConsoleButtonsTemplate(true);
|
||||
N64ConsoleButtons = new Standard2ButtonConsoleTemplate(true);
|
||||
|
||||
ColecoController[0] = new ColecoVisionControllerTemplate(true);
|
||||
ColecoController[1] = new ColecoVisionControllerTemplate(false);
|
||||
|
@ -809,7 +809,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public N64ButtonsTemplate[] N64Controller = new N64ButtonsTemplate[4];
|
||||
public N64ButtonsTemplate[] N64AutoController = new N64ButtonsTemplate[4];
|
||||
public N64ConsoleButtonsTemplate N64ConsoleButtons = new N64ConsoleButtonsTemplate();
|
||||
public Standard2ButtonConsoleTemplate N64ConsoleButtons = new Standard2ButtonConsoleTemplate();
|
||||
|
||||
//TI 83 settings
|
||||
public TI83ControllerTemplate[] TI83Controller = new TI83ControllerTemplate[1];
|
||||
|
@ -1428,14 +1428,14 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
public class N64ConsoleButtonsTemplate : iControllerConfigObject
|
||||
public class Standard2ButtonConsoleTemplate : iControllerConfigObject
|
||||
{
|
||||
public string Power = "";
|
||||
public string Reset = "";
|
||||
public bool Enabled = false;
|
||||
|
||||
public N64ConsoleButtonsTemplate() { }
|
||||
public N64ConsoleButtonsTemplate(bool defaults)
|
||||
public Standard2ButtonConsoleTemplate() { }
|
||||
public Standard2ButtonConsoleTemplate(bool defaults)
|
||||
{
|
||||
if (defaults)
|
||||
{
|
||||
|
|
|
@ -183,6 +183,14 @@ namespace BizHawk.MultiClient
|
|||
{"A", "A"}, {"B", "B"}, {"Z", "Z"}, {"Start", "S"},
|
||||
{"C Up", "u"}, {"C Down", "d"}, {"C Left", "l"}, {"C Right", "r"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Saturn Controller", new Dictionary<string, string>()
|
||||
{
|
||||
{"Up", "U"}, {"Down", "D"}, {"Left", "L"}, {"Right", "R"},
|
||||
{"Start", "S"}, {"Z", "Z"}, {"Y", "Y"}, {"X", "X"}, {"C", "C"}, {"B", "B"}, {"A", "A"},
|
||||
{"L", "L"}, {"R", "R"},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -199,13 +207,14 @@ namespace BizHawk.MultiClient
|
|||
{"SMS Controller", new Dictionary<string, string> {{"Pause", "p"}, {"Reset", "r"}}},
|
||||
{"TI83 Controller", new Dictionary<string, string> {}},
|
||||
{"Nintento 64 Controller", new Dictionary<string, string> {{"Pause", "p"}, {"Reset", "r"}}},
|
||||
{"Saturn Controller", new Dictionary<string, string> {{"Pause", "p"}, {"Reset", "r"}}},
|
||||
};
|
||||
|
||||
public static readonly Dictionary<string, int> PLAYERS = new Dictionary<string, int>
|
||||
{
|
||||
{"Gameboy Controller", 1}, {"GBA Controller", 1}, {"Genesis 3-Button Controller", 2}, {"NES Controller", 4},
|
||||
{"SNES Controller", 4}, {"PC Engine Controller", 5}, {"SMS Controller", 2}, {"TI83 Controller", 1}, {"Atari 2600 Basic Controller", 2}, {"Atari 7800 ProLine Joystick Controller", 2},
|
||||
{"ColecoVision Basic Controller", 2}, {"Commodore 64 Controller", 2}, {"Nintento 64 Controller", 4}
|
||||
{"ColecoVision Basic Controller", 2}, {"Commodore 64 Controller", 2}, {"Nintento 64 Controller", 4}, {"Saturn Controller", 2}
|
||||
};
|
||||
|
||||
// just experimenting with different possibly more painful ways to handle mnemonics
|
||||
|
|
|
@ -447,6 +447,8 @@ namespace BizHawk.MultiClient
|
|||
return "|.|..........|";
|
||||
case "N64":
|
||||
return "|.|............|............|............|............|";
|
||||
case "SAT":
|
||||
return "|.|.............|.............|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -590,6 +592,35 @@ namespace BizHawk.MultiClient
|
|||
return input.ToString();
|
||||
}
|
||||
|
||||
private string GetSaturnControllersAsMnemonic()
|
||||
{
|
||||
StringBuilder input = new StringBuilder("|");
|
||||
if (IsBasePressed("Power"))
|
||||
{
|
||||
input.Append('P');
|
||||
}
|
||||
else if (IsBasePressed("Reset"))
|
||||
{
|
||||
input.Append('r');
|
||||
}
|
||||
else
|
||||
{
|
||||
input.Append('.');
|
||||
}
|
||||
input.Append('|');
|
||||
|
||||
for (int player = 1; player <= Global.PLAYERS[ControlType]; player++)
|
||||
{
|
||||
foreach (string button in Global.BUTTONS[ControlType].Keys)
|
||||
{
|
||||
input.Append(IsBasePressed("P" + player + " " + button) ? Global.BUTTONS[ControlType][button] : ".");
|
||||
}
|
||||
input.Append('|');
|
||||
}
|
||||
|
||||
return input.ToString();
|
||||
}
|
||||
|
||||
public string GetControllersAsMnemonic()
|
||||
{
|
||||
if (ControlType == "Null Controller")
|
||||
|
@ -622,7 +653,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
else if (ControlType == "Saturn Controller")
|
||||
{
|
||||
return ""; // TODO
|
||||
return GetSaturnControllersAsMnemonic();
|
||||
}
|
||||
|
||||
StringBuilder input = new StringBuilder("|");
|
||||
|
@ -975,6 +1006,42 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
private void SetSaturnControllersAsMnemonic(string mnemonic)
|
||||
{
|
||||
MnemonicChecker c = new MnemonicChecker(mnemonic);
|
||||
MyBoolButtons.Clear();
|
||||
|
||||
if (mnemonic.Length < 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mnemonic[1] == 'P')
|
||||
{
|
||||
Force("Power", true);
|
||||
}
|
||||
else if (mnemonic[1] != '.' && mnemonic[1] != '0')
|
||||
{
|
||||
Force("Reset", true);
|
||||
}
|
||||
|
||||
for (int player = 1; player <= Global.PLAYERS[ControlType]; player++)
|
||||
{
|
||||
int srcindex = (player - 1) * (Global.BUTTONS[ControlType].Count + 1);
|
||||
|
||||
if (mnemonic.Length < srcindex + 3 + Global.BUTTONS[ControlType].Count - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int start = 3;
|
||||
foreach (string button in Global.BUTTONS[ControlType].Keys)
|
||||
{
|
||||
Force("P" + player + " " + button, c[srcindex + start++]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetAtari7800AsMnemonic(string mnemonic)
|
||||
{
|
||||
MnemonicChecker c = new MnemonicChecker(mnemonic);
|
||||
|
@ -1099,7 +1166,7 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
else if (ControlType == "Saturn Controller")
|
||||
{
|
||||
// TODO
|
||||
SetSaturnControllersAsMnemonic(mnemonic);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue