From f289ce75253c3f2fdd4c7b5adcb15ea15fc10b88 Mon Sep 17 00:00:00 2001 From: goyuken Date: Sat, 24 Nov 2012 16:14:30 +0000 Subject: [PATCH] grumble grumble grumble --- BizHawk.MultiClient/Config.cs | 55 +++++++++++++++++++++++++++++++++ BizHawk.MultiClient/Global.cs | 2 ++ BizHawk.MultiClient/MainForm.cs | 32 +++++++++++++++++++ 3 files changed, 89 insertions(+) diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index 04e1ee539f..20f8fb5b15 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -26,6 +26,9 @@ namespace BizHawk.MultiClient GBAutoController[0] = new GBControllerTemplate(true); TI83Controller[0] = new TI83ControllerTemplate(true); + GBAController[0] = new GBAControllerTemplate(true); + GBAAutoController[0] = new GBAControllerTemplate(false); + GenesisController[0] = new GenControllerTemplate(true); GenesisAutoController[0] = new GenControllerTemplate(false); @@ -724,6 +727,10 @@ namespace BizHawk.MultiClient public bool GB_AsSGB = false; public Emulation.Consoles.GB.GBColors.ColorType CGBColors = Emulation.Consoles.GB.GBColors.ColorType.gambatte; + //GBA settings + public GBAControllerTemplate[] GBAController = new GBAControllerTemplate[1]; + public GBAControllerTemplate[] GBAAutoController = new GBAControllerTemplate[1]; + //Commodore 64 Settings public SingleButtonJoyStickTemplate[] C64Joysticks = new SingleButtonJoyStickTemplate[2]; public SingleButtonJoyStickTemplate[] C64AutoJoysticks = new SingleButtonJoyStickTemplate[2]; @@ -912,6 +919,54 @@ namespace BizHawk.MultiClient } } + public class GBAControllerTemplate + { + public string Up; + public string Down; + public string Left; + public string Right; + public string A; + public string B; + public string Start; + public string Select; + public string L, R; + public string Power; + public bool Enabled; + public GBAControllerTemplate() { } + public GBAControllerTemplate(bool defaults) + { + if (defaults) + { + Enabled = true; + Up = "UpArrow, X1 DpadUp, X1 LStickUp"; + Down = "DownArrow, X1 DpadDown, X1 LStickDown"; + Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft"; + Right = "RightArrow, X1 DpadRight, X1 LStickRight"; + A = "X, X1 B"; + B = "Z, X1 A"; + L = "W, X1 LeftTrigger"; + R = "E, X1 RightTrigger"; + Start = "Return, X1 Start"; + Select = "Space, X1 Back"; + Power = ""; + } + else + { + Enabled = false; + Up = ""; + Down = ""; + Right = ""; + Left = ""; + A = ""; + B = ""; + Start = ""; + Select = ""; + L = R = ""; + Power = ""; + } + } + } + public class NESControllerTemplate { public string Up; diff --git a/BizHawk.MultiClient/Global.cs b/BizHawk.MultiClient/Global.cs index 4ae07cdb7e..d02c18bb80 100644 --- a/BizHawk.MultiClient/Global.cs +++ b/BizHawk.MultiClient/Global.cs @@ -30,6 +30,7 @@ namespace BizHawk.MultiClient public static Controller NESControls; public static Controller SNESControls; public static Controller GBControls; + public static Controller GBAControls; public static Controller Atari2600Controls; public static Controller NullControls; public static Controller ColecoControls; @@ -42,6 +43,7 @@ namespace BizHawk.MultiClient public static AutofireController AutofireSMSControls; public static AutofireController AutofirePCEControls; public static AutofireController AutofireGBControls; + public static AutofireController AutofireGBAControls; public static AutofireController AutofireGenControls; public static AutofireController AutofireAtari2600Controls; public static AutofireController AutofireCommodore64Controls; diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 99b4748ec9..14369a7a47 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -899,6 +899,34 @@ namespace BizHawk.MultiClient agbControls.BindMulti("Start", Global.Config.GBAutoController[0].Start); Global.AutofireGBControls = agbControls; + var gbaControls = new Controller(GBA.GBAController); + gbaControls.BindMulti("Up", Global.Config.GBAController[0].Up); + gbaControls.BindMulti("Down", Global.Config.GBAController[0].Down); + gbaControls.BindMulti("Left", Global.Config.GBAController[0].Left); + gbaControls.BindMulti("Right", Global.Config.GBAController[0].Right); + gbaControls.BindMulti("A", Global.Config.GBAController[0].A); + gbaControls.BindMulti("B", Global.Config.GBAController[0].B); + gbaControls.BindMulti("Select", Global.Config.GBAController[0].Select); + gbaControls.BindMulti("Start", Global.Config.GBAController[0].Start); + gbaControls.BindMulti("L", Global.Config.GBAController[0].L); + gbaControls.BindMulti("R", Global.Config.GBAController[0].R); + gbaControls.BindMulti("Power", Global.Config.GBAController[0].Power); + Global.GBAControls = gbaControls; + + var agbaControls = new AutofireController(GBA.GBAController); + agbaControls.BindMulti("Up", Global.Config.GBAAutoController[0].Up); + agbaControls.BindMulti("Down", Global.Config.GBAAutoController[0].Down); + agbaControls.BindMulti("Left", Global.Config.GBAAutoController[0].Left); + agbaControls.BindMulti("Right", Global.Config.GBAAutoController[0].Right); + agbaControls.BindMulti("A", Global.Config.GBAAutoController[0].A); + agbaControls.BindMulti("B", Global.Config.GBAAutoController[0].B); + agbaControls.BindMulti("Select", Global.Config.GBAAutoController[0].Select); + agbaControls.BindMulti("Start", Global.Config.GBAAutoController[0].Start); + agbaControls.BindMulti("L", Global.Config.GBAAutoController[0].L); + agbaControls.BindMulti("R", Global.Config.GBAAutoController[0].R); + agbaControls.BindMulti("Power", Global.Config.GBAAutoController[0].Power); + Global.AutofireGBAControls = agbaControls; + var genControls = new Controller(Genesis.GenesisController); genControls.BindMulti("P1 Up", Global.Config.GenesisController[0].Up); genControls.BindMulti("P1 Left", Global.Config.GenesisController[0].Left); @@ -1464,6 +1492,10 @@ namespace BizHawk.MultiClient Global.ActiveController = Global.GBControls; Global.AutoFireController = Global.AutofireGBControls; break; + case "GBA": + Global.ActiveController = Global.GBAControls; + Global.AutoFireController = Global.AutofireGBAControls; + break; case "Coleco": Global.ActiveController = Global.ColecoControls; Global.AutoFireController = Global.AutofireColecoControls;