diff --git a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs index 5d1abe90f8..c001236168 100644 --- a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs +++ b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs @@ -45,7 +45,10 @@ namespace BizHawk.Client.EmuHawk CoreType = core, CoreAttributes = core.GetCustomAttributes(false) .OfType() - .Single() + .Single(), + ServicesNotApplicable = core.GetCustomAttributes(false) + .OfType() + .SingleOrDefault() ?? new ServiceNotApplicable() }) .OrderBy(c => !c.CoreAttributes.Released) .ThenBy(c => c.CoreAttributes.CoreName) @@ -67,7 +70,7 @@ namespace BizHawk.Client.EmuHawk bool missingImplementation = false; - foreach (var service in services) + foreach (var service in services.Where(s => !core.ServicesNotApplicable.NotApplicableTypes.Contains(s))) { bool isImplemented = false; if (service.IsAssignableFrom(core.CoreType)) diff --git a/BizHawk.Emulation.Common/Interfaces/ICoreService.cs b/BizHawk.Emulation.Common/Interfaces/ICoreService.cs index 030469f420..b153b39d8d 100644 --- a/BizHawk.Emulation.Common/Interfaces/ICoreService.cs +++ b/BizHawk.Emulation.Common/Interfaces/ICoreService.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; namespace BizHawk.Emulation.Common { @@ -19,4 +21,21 @@ namespace BizHawk.Emulation.Common { public FeatureNotImplemented() { } } + + public class ServiceNotApplicable : Attribute + { + public ServiceNotApplicable(params Type[] types) + { + if (types != null) + { + NotApplicableTypes = types.ToList(); + } + else + { + NotApplicableTypes = new List(); + } + } + + public IEnumerable NotApplicableTypes { get; private set; } + } } diff --git a/BizHawk.Emulation.Cores/Calculator/TI83.cs b/BizHawk.Emulation.Cores/Calculator/TI83.cs index 1f64f4354d..c2829076ba 100644 --- a/BizHawk.Emulation.Cores/Calculator/TI83.cs +++ b/BizHawk.Emulation.Cores/Calculator/TI83.cs @@ -19,6 +19,7 @@ namespace BizHawk.Emulation.Cores.Calculators isPorted: false, isReleased: true )] + [ServiceNotApplicable(typeof(ISaveRam))] public partial class TI83 : IEmulator, IMemoryDomains, IStatable, IDebuggable, IInputPollable, ISettable { //hardware diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs index 5e20bf5add..4dfd702286 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.cs @@ -13,6 +13,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 isPorted: false, isReleased: false )] + [ServiceNotApplicable(typeof(ISettable<,>))] sealed public partial class C64 : IEmulator, IMemoryDomains, IStatable, IInputPollable { // internal variables diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs index bdfb23937e..af93a69a04 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs @@ -15,6 +15,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 isPorted: false, isReleased: true )] + [ServiceNotApplicable(typeof(ISaveRam))] public partial class Atari2600 : IEmulator, IMemoryDomains, IStatable, IDebuggable, IInputPollable, ISettable { private readonly GameInfo _game; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs b/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs index a044f3e3a9..d7158adda3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/7800/Atari7800.cs @@ -16,6 +16,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari7800 portedVersion: "v1.5", portedUrl: "http://emu7800.sourceforge.net/" )] + [ServiceNotApplicable(typeof(ISettable<,>))] public partial class Atari7800 : IEmulator, IMemoryDomains, ISaveRam, IDebuggable, IStatable, IInputPollable { // TODO: diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs b/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs index 574e7bd6d8..6c86a7c80d 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/lynx/Lynx.cs @@ -12,6 +12,7 @@ using Newtonsoft.Json; namespace BizHawk.Emulation.Cores.Atari.Lynx { [CoreAttributes("Handy", "K. Wilkins", true, true, "mednafen 0-9-34-1", "http://mednafen.sourceforge.net/")] + [ServiceNotApplicable(typeof(ISettable<,>))] public class Lynx : IEmulator, IVideoProvider, ISyncSoundProvider, IMemoryDomains, ISaveRam, IStatable, IInputPollable { IntPtr Core; diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index 57a630be64..bbb0460dbc 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -17,6 +17,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision isPorted: false, isReleased: true )] + [ServiceNotApplicable(typeof(ISaveRam))] public sealed partial class ColecoVision : IEmulator, IMemoryDomains, IDebuggable, IInputPollable, IStatable, ISettable { // ROM diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs index 0c31133658..4a66da0ed8 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs @@ -13,6 +13,7 @@ namespace BizHawk.Emulation.Cores.Intellivision isPorted: false, isReleased: false )] + [ServiceNotApplicable(typeof(ISaveRam))] public sealed partial class Intellivision : IEmulator { byte[] Rom;