Simplify nullemulator - emuHawk already handles cores with no video provider by using NullVideo, so no reason for NullEmulator to provide NullVideo

This commit is contained in:
adelikat 2020-04-08 13:26:51 -05:00
parent cb2d365284
commit a83c125ac4
1 changed files with 2 additions and 29 deletions

View File

@ -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
}
}