From b2e88b04a85b41cc60af3485d88c90429e84a218 Mon Sep 17 00:00:00 2001
From: BaronKiko <BaronKiko@users.noreply.github.com>
Date: Tue, 16 Apr 2019 00:22:55 +0100
Subject: Config option to ignore missing services (#658)

* Implemented config option to ignore missing services

* Removed unused using statement

* Resolved comments from review
---
 Ryujinx.HLE/HOS/Services/ServiceFactory.cs | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'Ryujinx.HLE/HOS/Services/ServiceFactory.cs')

diff --git a/Ryujinx.HLE/HOS/Services/ServiceFactory.cs b/Ryujinx.HLE/HOS/Services/ServiceFactory.cs
index 83a217a5..113bbe51 100644
--- a/Ryujinx.HLE/HOS/Services/ServiceFactory.cs
+++ b/Ryujinx.HLE/HOS/Services/ServiceFactory.cs
@@ -1,3 +1,4 @@
+using Ryujinx.Common.Logging;
 using Ryujinx.HLE.HOS.Services.Acc;
 using Ryujinx.HLE.HOS.Services.Am;
 using Ryujinx.HLE.HOS.Services.Apm;
@@ -30,6 +31,11 @@ using System;
 
 namespace Ryujinx.HLE.HOS.Services
 {
+    public static class ServiceConfiguration
+    {
+        public static bool IgnoreMissingServices { get; set; }
+    }
+
     static class ServiceFactory
     {
         public static IpcService MakeService(Horizon system, string name)
@@ -209,6 +215,12 @@ namespace Ryujinx.HLE.HOS.Services
                     return new IApplicationRootService();
             }
 
+            if (ServiceConfiguration.IgnoreMissingServices)
+            {
+                Logger.PrintWarning(LogClass.Service, $"Missing service {name} ignored");
+                return new DummyService(name);
+            }
+
             throw new NotImplementedException(name);
         }
     }
-- 
cgit v1.2.3-70-g09d2