From a83c125ac4cb6db4ddf4d7eb8c9885a57efe226e Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 8 Apr 2020 13:26:51 -0500 Subject: [PATCH] Simplify nullemulator - emuHawk already handles cores with no video provider by using NullVideo, so no reason for NullEmulator to provide NullVideo --- .../Base Implementations/NullEmulator.cs | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs b/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs index d6b6824aba..7023b37076 100644 --- a/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs +++ b/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs @@ -2,6 +2,7 @@ { [Core("NullHawk", "", false, true)] [ServiceNotApplicable(new[] { + typeof(IVideoProvider), typeof(IBoardInfo), typeof(ICodeDataLogger), typeof(IDebuggable), @@ -16,17 +17,13 @@ typeof(IStatable), typeof(ITraceable) })] - public class NullEmulator : IEmulator, IVideoProvider + public class NullEmulator : IEmulator { - private readonly int[] _frameBuffer = new int[NullVideo.DefaultWidth * NullVideo.DefaultHeight]; - public NullEmulator() { ServiceProvider = new BasicServiceProvider(this); } - #region IEmulator - public IEmulatorServiceProvider ServiceProvider { get; } public ControllerDefinition ControllerDefinition => NullController.Instance.Definition; @@ -43,32 +40,8 @@ { } - public string BoardName => null; - public void Dispose() { } - - #endregion - - #region IVideoProvider - - public int[] GetVideoBuffer() => _frameBuffer; - - public int VirtualWidth => NullVideo.DefaultWidth; - - public int VirtualHeight => NullVideo.DefaultHeight; - - public int BufferWidth => NullVideo.DefaultWidth; - - public int BufferHeight => NullVideo.DefaultHeight; - - public int BackgroundColor => NullVideo.DefaultBackgroundColor; - - public int VsyncNumerator => NullVideo.DefaultVsyncNum; - - public int VsyncDenominator => NullVideo.DefaultVsyncDen; - - #endregion } }