2011-01-11 02:55:51 +00:00
|
|
|
|
using System;
|
2011-01-21 03:59:50 +00:00
|
|
|
|
using System.Collections.Generic;
|
2011-01-11 02:55:51 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk
|
|
|
|
|
{
|
|
|
|
|
public class NullEmulator : IEmulator, IVideoProvider, ISoundProvider
|
|
|
|
|
{
|
2011-02-16 04:45:59 +00:00
|
|
|
|
public string SystemId { get { return "NULL"; } }
|
2011-01-12 02:05:48 +00:00
|
|
|
|
private static readonly ControllerDefinition NullController = new ControllerDefinition { Name = "Null Controller" };
|
|
|
|
|
|
2011-01-11 02:55:51 +00:00
|
|
|
|
private int[] frameBuffer = new int[256 * 192];
|
|
|
|
|
private Random rand = new Random();
|
|
|
|
|
public IVideoProvider VideoProvider { get { return this; } }
|
|
|
|
|
public ISoundProvider SoundProvider { get { return this; } }
|
2011-01-21 07:02:48 +00:00
|
|
|
|
public NullEmulator()
|
|
|
|
|
{
|
|
|
|
|
var domains = new List<MemoryDomain>(1);
|
|
|
|
|
domains.Add(new MemoryDomain("Main RAM", 1, Endian.Little, addr=>0, (a,v)=> { }));
|
|
|
|
|
memoryDomains = domains.AsReadOnly();
|
|
|
|
|
}
|
2011-01-11 02:55:51 +00:00
|
|
|
|
public void LoadGame(IGame game) { }
|
|
|
|
|
public void FrameAdvance(bool render)
|
|
|
|
|
{
|
|
|
|
|
if (render == false) return;
|
|
|
|
|
for (int i = 0; i < 256 * 192; i++)
|
|
|
|
|
frameBuffer[i] = Colors.Luminosity((byte)rand.Next());
|
|
|
|
|
}
|
2011-01-12 02:05:48 +00:00
|
|
|
|
public ControllerDefinition ControllerDefinition { get { return NullController; } }
|
2011-01-11 02:55:51 +00:00
|
|
|
|
public IController Controller { get; set; }
|
2011-02-26 21:36:46 +00:00
|
|
|
|
|
2011-02-27 22:33:25 +00:00
|
|
|
|
public string GetControllersAsMnemonic() { return "|.|.|"; }
|
|
|
|
|
public void SetControllersAsMnemonic(string mnemonic) { return; }
|
2011-02-26 21:36:46 +00:00
|
|
|
|
|
2011-01-11 02:55:51 +00:00
|
|
|
|
public int Frame { get; set; }
|
|
|
|
|
public byte[] SaveRam { get { return new byte[0]; } }
|
|
|
|
|
public bool DeterministicEmulation { get; set; }
|
|
|
|
|
public bool SaveRamModified { get; set; }
|
|
|
|
|
public void SaveStateText(TextWriter writer) { }
|
|
|
|
|
public void LoadStateText(TextReader reader) { }
|
|
|
|
|
public void SaveStateBinary(BinaryWriter writer) { }
|
|
|
|
|
public void LoadStateBinary(BinaryReader reader) { }
|
|
|
|
|
public byte[] SaveStateBinary() { return new byte[1]; }
|
|
|
|
|
public int[] GetVideoBuffer() { return frameBuffer; }
|
|
|
|
|
public int BufferWidth { get { return 256; } }
|
|
|
|
|
public int BufferHeight { get { return 192; } }
|
|
|
|
|
public int BackgroundColor { get { return 0; } }
|
|
|
|
|
public void GetSamples(short[] samples) { }
|
2011-01-21 07:02:48 +00:00
|
|
|
|
private IList<MemoryDomain> memoryDomains;
|
|
|
|
|
public IList<MemoryDomain> MemoryDomains { get { return memoryDomains; } }
|
|
|
|
|
public MemoryDomain MainMemory { get { return memoryDomains[0]; } }
|
2011-02-16 04:45:59 +00:00
|
|
|
|
|
2011-02-21 09:48:53 +00:00
|
|
|
|
public object Query(EmulatorQuery query)
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2011-01-11 02:55:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|