diff --git a/BizHawk.Client.Common/movie/MnemonicsGenerator.cs b/BizHawk.Client.Common/movie/MnemonicsGenerator.cs index 284327997d..f0329f6176 100644 --- a/BizHawk.Client.Common/movie/MnemonicsGenerator.cs +++ b/BizHawk.Client.Common/movie/MnemonicsGenerator.cs @@ -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("|"); diff --git a/BizHawk.Client.Common/movie/MovieMnemonics.cs b/BizHawk.Client.Common/movie/MovieMnemonics.cs index ac0522c803..381b74dfed 100644 --- a/BizHawk.Client.Common/movie/MovieMnemonics.cs +++ b/BizHawk.Client.Common/movie/MovieMnemonics.cs @@ -34,6 +34,13 @@ namespace BizHawk.Client.Common {"C", "C"} } }, + { + "GPGX Genesis Controller", new Dictionary + { + {"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 { @@ -152,7 +159,7 @@ namespace BizHawk.Client.Common public static readonly Dictionary PLAYERS = new Dictionary { - {"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; } diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs index 2180e9dcbf..dfdf408bde 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/gpgx/GPGXControlConverter.cs @@ -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), };