From d0d4d441c9c7de0c527c97b9641cc6c7df324eb8 Mon Sep 17 00:00:00 2001 From: beirich Date: Wed, 12 Jan 2011 02:05:48 +0000 Subject: [PATCH] make NullEmulator return a valid ControllerDefinition --- .../Interfaces/Base Implementations/NullEmulator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs b/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs index d73d6126b6..bd47ba3f55 100644 --- a/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs +++ b/BizHawk.Emulation/Interfaces/Base Implementations/NullEmulator.cs @@ -5,6 +5,8 @@ namespace BizHawk { public class NullEmulator : IEmulator, IVideoProvider, ISoundProvider { + private static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" }; + private int[] frameBuffer = new int[256 * 192]; private Random rand = new Random(); public IVideoProvider VideoProvider { get { return this; } } @@ -17,7 +19,7 @@ namespace BizHawk frameBuffer[i] = Colors.Luminosity((byte)rand.Next()); } public void HardReset() { } - public ControllerDefinition ControllerDefinition { get { return null; } } + public ControllerDefinition ControllerDefinition { get { return NullController; } } public IController Controller { get; set; } public int Frame { get; set; } public byte[] SaveRam { get { return new byte[0]; } }