diff --git a/BizHawk.Client.EmuHawk/tools/CDL.cs b/BizHawk.Client.EmuHawk/tools/CDL.cs
index 08d798cb8f..d17e9420af 100644
--- a/BizHawk.Client.EmuHawk/tools/CDL.cs
+++ b/BizHawk.Client.EmuHawk/tools/CDL.cs
@@ -44,6 +44,9 @@ namespace BizHawk.Client.EmuHawk
[RequiredService]
private IMemoryDomains MemoryDomains { get; set; }
+ [RequiredService]
+ private ICodeDataLogger CodeDataLogger { get; set; }
+
private string _currentFileName = string.Empty;
public CDL()
diff --git a/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj b/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj
index dd74e4459f..ba070905d0 100644
--- a/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj
+++ b/BizHawk.Emulation.Common/BizHawk.Emulation.Common.csproj
@@ -73,6 +73,7 @@
+
diff --git a/BizHawk.Emulation.Common/Extensions.cs b/BizHawk.Emulation.Common/Extensions.cs
index c1130930f0..a4697d036a 100644
--- a/BizHawk.Emulation.Common/Extensions.cs
+++ b/BizHawk.Emulation.Common/Extensions.cs
@@ -240,6 +240,21 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
return (IRegionable)core.ServiceProvider.GetService();
}
+ public static bool CanDataLog(this IEmulator core)
+ {
+ if (core == null)
+ {
+ return false;
+ }
+
+ return core.ServiceProvider.HasService();
+ }
+
+ public static ICodeDataLogger AsCodeDataLogger(this IEmulator core)
+ {
+ return core.ServiceProvider.GetService();
+ }
+
// TODO: a better place for these
public static bool IsImplemented(this MethodInfo info)
{
diff --git a/BizHawk.Emulation.Common/Interfaces/ICodeDataLogger.cs b/BizHawk.Emulation.Common/Interfaces/ICodeDataLogger.cs
new file mode 100644
index 0000000000..dcdd063137
--- /dev/null
+++ b/BizHawk.Emulation.Common/Interfaces/ICodeDataLogger.cs
@@ -0,0 +1,6 @@
+namespace BizHawk.Emulation.Common
+{
+ public interface ICodeDataLogger : IEmulatorService
+ {
+ }
+}