From 33aa77d8e3547abca4d38c4c4ec644a3e86d9028 Mon Sep 17 00:00:00 2001 From: Asnivor Date: Mon, 12 Mar 2018 18:17:06 +0000 Subject: [PATCH] Removed [CoreConstructor("ZXSpectrum")] identifier (as this was causing an exception when loading roms for other systems --- BizHawk.Emulation.Common/SystemLookup.cs | 3 ++- .../SinclairSpectrum/ZXSpectrum.IEmulator.cs | 11 ++++++++++- .../Computers/SinclairSpectrum/ZXSpectrum.cs | 1 - BizHawk.Emulation.Cores/FileID.cs | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/BizHawk.Emulation.Common/SystemLookup.cs b/BizHawk.Emulation.Common/SystemLookup.cs index f8e1a0de3c..4c6c692e46 100644 --- a/BizHawk.Emulation.Common/SystemLookup.cs +++ b/BizHawk.Emulation.Common/SystemLookup.cs @@ -32,7 +32,8 @@ namespace BizHawk.Emulation.Common new SystemInfo { SystemId = "C64", FullName = "Commodore 64" }, new SystemInfo { SystemId = "AppleII", FullName = "Apple II" }, - new SystemInfo { SystemId = "INTV", FullName = "Intellivision" } + new SystemInfo { SystemId = "INTV", FullName = "Intellivision" }, + new SystemInfo { SystemId = "ZXSpectrum", FullName = "Sinclair ZX Spectrum" } }; public SystemInfo this[string systemId] diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs index 33bcc68276..c87c9991d7 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.IEmulator.cs @@ -41,7 +41,16 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum } } - public int Frame => _machine.FrameCount; + public int Frame + { + get + { + if (_machine == null) + return 0; + else + return _machine.FrameCount; + } + } public string SystemId => "ZXSpectrum"; diff --git a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs index d2c7db7abe..bb116f8922 100644 --- a/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs +++ b/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/ZXSpectrum.cs @@ -18,7 +18,6 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum [ServiceNotApplicable(typeof(IDriveLight))] public partial class ZXSpectrum : IDebuggable, IInputPollable, IStatable, IRegionable { - [CoreConstructor("ZXSpectrum")] public ZXSpectrum(CoreComm comm, IEnumerable files, List game, object settings, object syncSettings) { var ser = new BasicServiceProvider(this); diff --git a/BizHawk.Emulation.Cores/FileID.cs b/BizHawk.Emulation.Cores/FileID.cs index edc5252484..1314be8b6f 100644 --- a/BizHawk.Emulation.Cores/FileID.cs +++ b/BizHawk.Emulation.Cores/FileID.cs @@ -42,6 +42,7 @@ namespace BizHawk.Emulation.Cores WS, WSC, NGC, C64, + ZXSpectrum, INT, A26, A52, A78, LNX,