Add an empty ICodeDataLogger emulator service, make it a required service for CDL.cs
This commit is contained in:
parent
17f73dc360
commit
400e4f4800
|
@ -44,6 +44,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
[RequiredService]
|
[RequiredService]
|
||||||
private IMemoryDomains MemoryDomains { get; set; }
|
private IMemoryDomains MemoryDomains { get; set; }
|
||||||
|
|
||||||
|
[RequiredService]
|
||||||
|
private ICodeDataLogger CodeDataLogger { get; set; }
|
||||||
|
|
||||||
private string _currentFileName = string.Empty;
|
private string _currentFileName = string.Empty;
|
||||||
|
|
||||||
public CDL()
|
public CDL()
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
<Compile Include="EmulationExceptions.cs" />
|
<Compile Include="EmulationExceptions.cs" />
|
||||||
<Compile Include="Enums.cs" />
|
<Compile Include="Enums.cs" />
|
||||||
<Compile Include="Extensions.cs" />
|
<Compile Include="Extensions.cs" />
|
||||||
|
<Compile Include="Interfaces\ICodeDataLogger.cs" />
|
||||||
<Compile Include="Interfaces\IController.cs" />
|
<Compile Include="Interfaces\IController.cs" />
|
||||||
<Compile Include="Interfaces\ICoreFileProvider.cs" />
|
<Compile Include="Interfaces\ICoreFileProvider.cs" />
|
||||||
<Compile Include="Interfaces\IDebuggable.cs" />
|
<Compile Include="Interfaces\IDebuggable.cs" />
|
||||||
|
|
|
@ -240,6 +240,21 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
|
||||||
return (IRegionable)core.ServiceProvider.GetService<IRegionable>();
|
return (IRegionable)core.ServiceProvider.GetService<IRegionable>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool CanDataLog(this IEmulator core)
|
||||||
|
{
|
||||||
|
if (core == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return core.ServiceProvider.HasService<ICodeDataLogger>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ICodeDataLogger AsCodeDataLogger(this IEmulator core)
|
||||||
|
{
|
||||||
|
return core.ServiceProvider.GetService<ICodeDataLogger>();
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: a better place for these
|
// TODO: a better place for these
|
||||||
public static bool IsImplemented(this MethodInfo info)
|
public static bool IsImplemented(this MethodInfo info)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace BizHawk.Emulation.Common
|
||||||
|
{
|
||||||
|
public interface ICodeDataLogger : IEmulatorService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue