2019-12-07 00:42:00 +00:00
|
|
|
|
namespace BizHawk.Emulation.Common
|
2011-01-11 02:55:51 +00:00
|
|
|
|
{
|
2017-07-12 19:10:55 +00:00
|
|
|
|
[Core("NullHawk", "", false, true)]
|
2020-02-18 15:10:24 +00:00
|
|
|
|
[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)
|
|
|
|
|
})]
|
2019-12-07 00:42:00 +00:00
|
|
|
|
public class NullEmulator : IEmulator, IVideoProvider
|
2011-07-11 23:26:20 +00:00
|
|
|
|
{
|
2019-12-07 00:42:00 +00:00
|
|
|
|
private readonly int[] _frameBuffer = new int[NullVideo.DefaultWidth * NullVideo.DefaultHeight];
|
|
|
|
|
|
|
|
|
|
public NullEmulator(CoreComm comm)
|
2014-12-04 03:38:30 +00:00
|
|
|
|
{
|
|
|
|
|
ServiceProvider = new BasicServiceProvider(this);
|
|
|
|
|
CoreComm = comm;
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-16 21:47:19 +00:00
|
|
|
|
#region IEmulator
|
2013-08-24 16:54:22 +00:00
|
|
|
|
|
2017-04-14 17:28:23 +00:00
|
|
|
|
public IEmulatorServiceProvider ServiceProvider { get; }
|
2013-12-18 19:36:17 +00:00
|
|
|
|
|
2017-04-14 17:28:23 +00:00
|
|
|
|
public ControllerDefinition ControllerDefinition => NullController.Instance.Definition;
|
2011-07-30 20:49:36 +00:00
|
|
|
|
|
2019-12-07 00:42:00 +00:00
|
|
|
|
public bool FrameAdvance(IController controller, bool render, bool renderSound) => true;
|
2016-02-29 00:03:01 +00:00
|
|
|
|
|
2019-12-07 00:42:00 +00:00
|
|
|
|
public int Frame => 0;
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-04-14 17:28:23 +00:00
|
|
|
|
public string SystemId => "NULL";
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-04-15 20:37:30 +00:00
|
|
|
|
public bool DeterministicEmulation => true;
|
2014-11-30 20:01:36 +00:00
|
|
|
|
|
2017-04-15 20:37:30 +00:00
|
|
|
|
public void ResetCounters()
|
2016-12-16 21:47:19 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-14 17:28:23 +00:00
|
|
|
|
public string BoardName => null;
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-04-15 20:37:30 +00:00
|
|
|
|
public CoreComm CoreComm { get; }
|
2014-09-01 18:43:41 +00:00
|
|
|
|
|
2017-04-14 17:28:23 +00:00
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
}
|
2013-11-11 03:20:33 +00:00
|
|
|
|
|
2016-12-16 21:47:19 +00:00
|
|
|
|
#endregion
|
2013-12-18 19:36:17 +00:00
|
|
|
|
|
2016-12-16 21:47:19 +00:00
|
|
|
|
#region IVideoProvider
|
|
|
|
|
|
2019-12-07 00:42:00 +00:00
|
|
|
|
public int[] GetVideoBuffer() => _frameBuffer;
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-05-05 14:51:00 +00:00
|
|
|
|
public int VirtualWidth => NullVideo.DefaultWidth;
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-05-05 14:51:00 +00:00
|
|
|
|
public int VirtualHeight => NullVideo.DefaultHeight;
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-05-05 14:51:00 +00:00
|
|
|
|
public int BufferWidth => NullVideo.DefaultWidth;
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-05-05 14:51:00 +00:00
|
|
|
|
public int BufferHeight => NullVideo.DefaultHeight;
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-05-05 14:51:00 +00:00
|
|
|
|
public int BackgroundColor => NullVideo.DefaultBackgroundColor;
|
2016-12-16 21:47:19 +00:00
|
|
|
|
|
2017-05-05 16:25:38 +00:00
|
|
|
|
public int VsyncNumerator => NullVideo.DefaultVsyncNum;
|
2017-05-05 16:21:37 +00:00
|
|
|
|
|
2017-05-05 16:25:38 +00:00
|
|
|
|
public int VsyncDenominator => NullVideo.DefaultVsyncDen;
|
2017-05-05 16:21:37 +00:00
|
|
|
|
|
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
|
|
|
|
}
|