From a5bf181621707651e96be38e2113f99cf901fcdf Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Sun, 8 May 2011 13:43:53 +0000 Subject: [PATCH] active controls should be set to a null emulator as an option too (this still doesn't fix the crash on load though as it never gets to the code that sets active controls because that is triggered by the loading of a ROM) --- .../Interfaces/Base Implementations/NullEmulator.cs | 2 +- BizHawk.MultiClient/Global.cs | 1 + BizHawk.MultiClient/MainForm.cs | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs b/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs index 151f7cc3b5..2c4d3759f3 100644 --- a/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs +++ b/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs @@ -7,7 +7,7 @@ namespace BizHawk public class NullEmulator : IEmulator, IVideoProvider, ISoundProvider { public string SystemId { get { return "NULL"; } } - private static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" }; + public static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" }; private int[] frameBuffer = new int[256 * 192]; private Random rand = new Random(); diff --git a/BizHawk.MultiClient/Global.cs b/BizHawk.MultiClient/Global.cs index f20eb170fd..49a9dc9951 100644 --- a/BizHawk.MultiClient/Global.cs +++ b/BizHawk.MultiClient/Global.cs @@ -20,5 +20,6 @@ namespace BizHawk.MultiClient public static Controller TI83Controls; public static Controller NESControls; public static Controller ActiveController; + public static Controller NullControls; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index b5e430a58f..dfe20179ae 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -329,6 +329,9 @@ namespace BizHawk.MultiClient Global.ClientControls = controls; + + Global.NullControls = new Controller(NullEmulator.NullController); + var smsControls = new Controller(SMS.SmsController); smsControls.BindMulti("Reset", Global.Config.SmsReset); smsControls.BindMulti("Pause", Global.Config.SmsPause); @@ -529,6 +532,7 @@ namespace BizHawk.MultiClient case "GB": break; default: + Global.ActiveController = Global.NullControls; break; } Global.Emulator.Controller = Global.ActiveController;