BizHawk/BizHawk.Emulation.Common/Base Implementations/NullEmulator.cs

78 lines
1.8 KiB
C#
Raw Normal View History

namespace BizHawk.Emulation.Common
2011-01-11 02:55:51 +00:00
{
[Core("NullHawk", "", false, true)]
[ServiceNotApplicable(new[] {
typeof(IBoardInfo),
typeof(ICodeDataLogger),
typeof(IDebuggable),
typeof(IDisassemblable),
typeof(IDriveLight),
typeof(IInputPollable),
typeof(IMemoryDomains),
typeof(IRegionable),
typeof(ISaveRam),
typeof(ISettable<,>),
typeof(ISoundProvider),
typeof(IStatable),
typeof(ITraceable)
})]
public class NullEmulator : IEmulator, IVideoProvider
{
private readonly int[] _frameBuffer = new int[NullVideo.DefaultWidth * NullVideo.DefaultHeight];
public NullEmulator(CoreComm comm)
{
ServiceProvider = new BasicServiceProvider(this);
CoreComm = comm;
}
#region IEmulator
public IEmulatorServiceProvider ServiceProvider { get; }
2013-12-18 19:36:17 +00:00
public ControllerDefinition ControllerDefinition => NullController.Instance.Definition;
public bool FrameAdvance(IController controller, bool render, bool renderSound) => true;
2016-02-29 00:03:01 +00:00
public int Frame => 0;
public string SystemId => "NULL";
2017-04-15 20:37:30 +00:00
public bool DeterministicEmulation => true;
2017-04-15 20:37:30 +00:00
public void ResetCounters()
{
}
public string BoardName => null;
2017-04-15 20:37:30 +00:00
public CoreComm CoreComm { get; }
public void Dispose()
{
}
#endregion
2013-12-18 19:36:17 +00:00
#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;
2017-05-05 16:25:38 +00:00
public int VsyncNumerator => NullVideo.DefaultVsyncNum;
2017-05-05 16:25:38 +00:00
public int VsyncDenominator => NullVideo.DefaultVsyncDen;
2017-04-15 20:37:30 +00:00
#endregion
2014-12-17 19:52:30 +00:00
}
2011-01-11 02:55:51 +00:00
}