Hook up mnemonics for GPGX, in v1 movie system

This commit is contained in:
adelikat 2013-12-17 01:42:30 +00:00
parent 648c06c2bd
commit 3602233069
3 changed files with 42 additions and 7 deletions

View File

@ -326,6 +326,19 @@ namespace BizHawk.Client.Common
return input.ToString();
}
private string GetGeneis6ButtonControllersAsMnemonic()
{
var input = new StringBuilder("|");
foreach (var button in MnemonicConstants.BUTTONS[_controlType].Keys)
{
input.Append(IsBasePressed(button) ? MnemonicConstants.BUTTONS[_controlType][button] : ".");
}
input.Append("|");
return input.ToString();
}
public string GetControllersAsMnemonic()
{
if (_controlType == "Null Controller")
@ -366,7 +379,7 @@ namespace BizHawk.Client.Common
}
else if (_controlType == "GPGX Genesis Controller")
{
return "|.|"; // TODO
return GetGeneis6ButtonControllersAsMnemonic();
}
var input = new StringBuilder("|");

View File

@ -34,6 +34,13 @@ namespace BizHawk.Client.Common
{"C", "C"}
}
},
{
"GPGX Genesis Controller", new Dictionary<string, string>
{
{"P1 Up", "U"}, {"P1 Down", "D"}, {"P1 Left", "L"}, {"P1 Right", "R"}, {"P1 A", "A"}, {"P1 B", "B"}, {"P1 C", "C"},
{"P1 Start", "S"}, {"P1 X", "X"}, {"P1 Y", "Y"}, {"P1 Z", "Z"}, {"P1 Mode", "M"}
}
},
{
"NES Controller", new Dictionary<string, string>
{
@ -152,7 +159,7 @@ namespace BizHawk.Client.Common
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},
{"Gameboy Controller", 1}, {"GBA Controller", 1}, {"Genesis 3-Button Controller", 2}, {"GPGX Genesis Controller", 1}, {"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}, {"Saturn Controller", 2}
};
@ -292,6 +299,21 @@ namespace BizHawk.Client.Common
}
}
private void SetGensis6ControllersAsMnemonic(string mnemonic)
{
MnemonicChecker c = new MnemonicChecker(mnemonic);
MyBoolButtons.Clear();
if (mnemonic.Length < 9)
{
return;
}
int start = 1;
foreach (string button in MnemonicConstants.BUTTONS[ControlType].Keys)
{
Force(button, c[start++]);
}
}
private void SetSNESControllersAsMnemonic(string mnemonic)
{
MnemonicChecker c = new MnemonicChecker(mnemonic);
@ -544,7 +566,7 @@ namespace BizHawk.Client.Common
}
else if (ControlType == "GPGX Genesis Controller")
{
// TODO
SetGensis6ControllersAsMnemonic(mnemonic);
return;
}

View File

@ -29,9 +29,9 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
new CName("Down", LibGPGX.INPUT_KEYS.INPUT_DOWN),
new CName("Left", LibGPGX.INPUT_KEYS.INPUT_LEFT),
new CName("Right", LibGPGX.INPUT_KEYS.INPUT_RIGHT),
new CName("A", LibGPGX.INPUT_KEYS.INPUT_A),
new CName("B", LibGPGX.INPUT_KEYS.INPUT_B),
new CName("C", LibGPGX.INPUT_KEYS.INPUT_C),
new CName("A", LibGPGX.INPUT_KEYS.INPUT_A),
new CName("Start", LibGPGX.INPUT_KEYS.INPUT_START),
};
@ -41,13 +41,13 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
new CName("Down", LibGPGX.INPUT_KEYS.INPUT_DOWN),
new CName("Left", LibGPGX.INPUT_KEYS.INPUT_LEFT),
new CName("Right", LibGPGX.INPUT_KEYS.INPUT_RIGHT),
new CName("A", LibGPGX.INPUT_KEYS.INPUT_A),
new CName("B", LibGPGX.INPUT_KEYS.INPUT_B),
new CName("C", LibGPGX.INPUT_KEYS.INPUT_C),
new CName("A", LibGPGX.INPUT_KEYS.INPUT_A),
new CName("Start", LibGPGX.INPUT_KEYS.INPUT_START),
new CName("Z", LibGPGX.INPUT_KEYS.INPUT_Z),
new CName("Y", LibGPGX.INPUT_KEYS.INPUT_Y),
new CName("X", LibGPGX.INPUT_KEYS.INPUT_X),
new CName("Y", LibGPGX.INPUT_KEYS.INPUT_Y),
new CName("Z", LibGPGX.INPUT_KEYS.INPUT_Z),
new CName("Mode", LibGPGX.INPUT_KEYS.INPUT_MODE),
};