Always initialize independent instances of IController in cores to NullController

- Fixes #1168
This commit is contained in:
alyosha-tas 2018-03-31 11:23:55 -04:00
parent 7a21f55c43
commit b2ed6eb737
9 changed files with 9 additions and 9 deletions

View File

@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Calculators
private readonly byte[] _rom;
// configuration
private IController _controller;
private IController _controller = NullController.Instance;
private byte[] _ram;
private byte[] _vram = new byte[0x300];

View File

@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
// ports
public readonly CartridgePort CartPort;
public readonly CassettePort Cassette;
public IController Controller;
public IController Controller = NullController.Instance;
public readonly SerialPort Serial;
public readonly TapeDrive TapeDrive;
public readonly UserPort User;

View File

@ -131,7 +131,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
private readonly Z80A _cpu;
private readonly TraceBuffer _tracer;
public IController _controller;
public IController _controller = NullController.Instance;
public SpectrumBase _machine;
private List<GameInfo> _gameInfo;

View File

@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
private MapperBase _mapper;
private byte[] _ram;
private IController _controller;
private IController _controller = NullController.Instance;
private int _frame;
private int _lastAddress;

View File

@ -76,7 +76,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
GetControllerState(controller);
GetConsoleState(controller);
maria.RunFrame();
if (_islag)

View File

@ -75,7 +75,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
public bool temp_1_prev, temp_2_prev;
private int _frame;
private IController _controller;
private IController _controller = NullController.Instance;
private enum InputPortMode
{

View File

@ -309,7 +309,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
private int VsyncNum { get; set; }
private int VsyncDen { get; set; }
private IController _controller;
private IController _controller = NullController.Instance;
bool resetSignal;
bool hardResetSignal;

View File

@ -124,7 +124,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
private VPC VPC;
private ScsiCDBus SCSI;
private ADPCM ADPCM;
private IController _controller;
private IController _controller = NullController.Instance;
public HuC6280PSG PSG;
internal CDAudio CDAudio;

View File

@ -216,7 +216,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
private bool HasYM2413 = false;
private bool PortDEEnabled = false;
private IController _controller;
private IController _controller = NullController.Instance;
private int _frame = 0;