From ec4a8dde09812d9e9864e1a6e29f78df88ea1c84 Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 29 May 2017 12:51:34 -0500 Subject: [PATCH] Vboy - button names and orders --- .../Consoles/Nintendo/VB/VirtualBoyee.cs | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs index 41cbdcf5be..5ea17ce76e 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/VB/VirtualBoyee.cs @@ -132,15 +132,36 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.VB private static readonly string[] CoreButtons = { "A", "B", "R", "L", - "Up_R", "Right_R", - "Right", "Left", "Down", "Up", - "Start", "Select", "Left_R", "Down_R" + "R_Up", "R_Right", + "L_Right", "L_Left", "L_Down", "L_Up", + "Start", "Select", "R_Left", "R_Down" + }; + + private static Dictionary _buttonOrdinals = new Dictionary + { + ["L_Up"] = 1, + ["L_Down"] = 2, + ["L_Left"] = 3, + ["L_Right"] = 4, + ["R_Up"] = 5, + ["R_Down"] = 6, + ["R_Left"] = 7, + ["R_Right"] = 8, + ["A"] = 9, + ["B"] = 10, + ["R"] = 11, + ["L"] = 12, + ["Select"] = 13, + ["Start"] = 14 }; private static readonly ControllerDefinition VirtualBoyController = new ControllerDefinition { Name = "VirtualBoy Controller", - BoolButtons = CoreButtons.Concat(new[] { "Power" }).ToList() + BoolButtons = CoreButtons + .OrderBy(b => _buttonOrdinals[b]) + .Concat(new[] { "Power" }) + .ToList() }; public ControllerDefinition ControllerDefinition => VirtualBoyController;