From b515b62b3e0768caa0fd2eb94ddcd5394e766e95 Mon Sep 17 00:00:00 2001 From: goyuken Date: Tue, 20 Nov 2012 01:35:28 +0000 Subject: [PATCH] gba: spend approximately 200 seconds on mnemonic stuff before getting bored --- BizHawk.MultiClient/Global.cs | 7 +++++++ BizHawk.MultiClient/movie/InputAdapters.cs | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/BizHawk.MultiClient/Global.cs b/BizHawk.MultiClient/Global.cs index 4682ee99fd..4ae07cdb7e 100644 --- a/BizHawk.MultiClient/Global.cs +++ b/BizHawk.MultiClient/Global.cs @@ -56,6 +56,13 @@ namespace BizHawk.MultiClient {"A", "A"} } }, + { + "GBA Controller", new Dictionary() + { + {"Up", "U"}, {"Down", "D"}, {"Left", "L"}, {"Right", "R"}, {"Select", "s"}, {"Start", "S"}, {"B", "B"}, + {"A", "A"}, {"L", "L"}, {"R", "R"}, + } + }, { "Genesis 3-Button Controller", new Dictionary() { diff --git a/BizHawk.MultiClient/movie/InputAdapters.cs b/BizHawk.MultiClient/movie/InputAdapters.cs index fae5a3cfbd..007f03692a 100644 --- a/BizHawk.MultiClient/movie/InputAdapters.cs +++ b/BizHawk.MultiClient/movie/InputAdapters.cs @@ -362,9 +362,24 @@ namespace BizHawk.MultiClient return "|..................|..................|"; case "C64": return "|.....|.....|..................................................................|"; + case "GBA": + return "|.|..........|"; } } + private string GetGBAControllersAsMnemonic() + { + StringBuilder input = new StringBuilder("|"); + // there's no power button for now + input.Append(".|"); + foreach (string button in Global.BUTTONS[ControlType].Keys) + { + input.Append(IsBasePressed(button) ? Global.BUTTONS[ControlType][button] : "."); + } + input.Append("|"); + return input.ToString(); + } + //adelikat: I"m going to do all controllers like this, so what if it is redundant! It is better than reducing lines of code with convoluted logic that is difficult to expand to support new platforms private string GetSNESControllersAsMnemonic() { @@ -439,7 +454,7 @@ namespace BizHawk.MultiClient } else if (ControlType == "GBA Controller") { - return "EAT AT JOE'S"; + return GetGBAControllersAsMnemonic(); } StringBuilder input = new StringBuilder("|");