2019-04-16 00:22:55 +01:00
|
|
|
using Ryujinx.Common.Logging;
|
2018-08-17 00:47:36 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Acc;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Am;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Apm;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Aud;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Bsd;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Caps;
|
2018-11-18 19:37:41 +00:00
|
|
|
using Ryujinx.HLE.HOS.Services.Es;
|
2018-08-17 00:47:36 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.FspSrv;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Hid;
|
2019-06-27 17:02:41 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Hid.Irs;
|
2018-10-10 00:01:49 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Ldr;
|
2018-08-17 00:47:36 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Lm;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Mm;
|
2018-11-18 19:37:41 +00:00
|
|
|
using Ryujinx.HLE.HOS.Services.Ncm;
|
2019-06-28 12:08:23 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Nfc.Nfp;
|
2018-08-17 00:47:36 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Ns;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Nv;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Pctl;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Pl;
|
2019-02-14 00:44:39 +00:00
|
|
|
using Ryujinx.HLE.HOS.Services.Pm;
|
2018-08-17 00:47:36 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Prepo;
|
2018-10-21 07:01:22 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Psm;
|
2018-08-17 00:47:36 +01:00
|
|
|
using Ryujinx.HLE.HOS.Services.Set;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Sfdnsres;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Sm;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Spl;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Ssl;
|
|
|
|
using Ryujinx.HLE.HOS.Services.Vi;
|
2018-03-19 18:58:46 +00:00
|
|
|
using System;
|
|
|
|
|
2018-08-17 00:47:36 +01:00
|
|
|
namespace Ryujinx.HLE.HOS.Services
|
2018-03-19 18:58:46 +00:00
|
|
|
{
|
2019-04-16 00:22:55 +01:00
|
|
|
public static class ServiceConfiguration
|
|
|
|
{
|
|
|
|
public static bool IgnoreMissingServices { get; set; }
|
|
|
|
}
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
static class ServiceFactory
|
|
|
|
{
|
2018-12-06 11:16:24 +00:00
|
|
|
public static IpcService MakeService(Horizon system, string name)
|
2018-03-19 18:58:46 +00:00
|
|
|
{
|
2018-12-06 11:16:24 +00:00
|
|
|
switch (name)
|
2018-03-19 18:58:46 +00:00
|
|
|
{
|
|
|
|
case "acc:u0":
|
2018-09-01 23:04:20 +01:00
|
|
|
return new IAccountService();
|
|
|
|
|
|
|
|
case "acc:u1":
|
|
|
|
return new IAccountService();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "aoc:u":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IAddOnContentManager();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "apm":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IManager();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "apm:p":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IManager();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-04-21 20:30:06 +01:00
|
|
|
case "appletAE":
|
|
|
|
return new IAllSystemAppletProxiesService();
|
2018-04-22 00:04:43 +01:00
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "appletOE":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IApplicationProxyService();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "audout:u":
|
2018-03-21 23:30:10 +00:00
|
|
|
return new IAudioOutManager();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "audren:u":
|
2018-03-21 23:30:10 +00:00
|
|
|
return new IAudioRendererManager();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-07-23 15:20:16 +01:00
|
|
|
case "bcat:a":
|
|
|
|
return new Bcat.IServiceCreator();
|
|
|
|
|
|
|
|
case "bcat:m":
|
|
|
|
return new Bcat.IServiceCreator();
|
|
|
|
|
|
|
|
case "bcat:u":
|
|
|
|
return new Bcat.IServiceCreator();
|
|
|
|
|
|
|
|
case "bcat:s":
|
|
|
|
return new Bcat.IServiceCreator();
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "bsd:s":
|
2018-10-20 23:08:58 +01:00
|
|
|
return new IClient(true);
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "bsd:u":
|
2018-10-20 23:08:58 +01:00
|
|
|
return new IClient(false);
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-04-22 05:21:49 +01:00
|
|
|
case "caps:a":
|
|
|
|
return new IAlbumAccessorService();
|
|
|
|
|
|
|
|
case "caps:ss":
|
|
|
|
return new IScreenshotService();
|
|
|
|
|
2018-07-13 22:36:57 +01:00
|
|
|
case "csrng":
|
|
|
|
return new IRandomInterface();
|
|
|
|
|
2018-11-18 19:37:41 +00:00
|
|
|
case "es":
|
2018-12-06 11:16:24 +00:00
|
|
|
return new IeTicketService();
|
2018-11-18 19:37:41 +00:00
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "friend:a":
|
2018-07-23 15:20:16 +01:00
|
|
|
return new Friend.IServiceCreator();
|
2018-04-22 05:21:49 +01:00
|
|
|
|
|
|
|
case "friend:u":
|
2018-07-23 15:20:16 +01:00
|
|
|
return new Friend.IServiceCreator();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "fsp-srv":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IFileSystemProxy();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "hid":
|
2018-12-06 11:16:24 +00:00
|
|
|
return new IHidServer(system);
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-10-07 16:12:11 +01:00
|
|
|
case "irs":
|
2019-06-27 17:02:41 +01:00
|
|
|
return new IIrSensorServer();
|
2018-10-07 16:12:11 +01:00
|
|
|
|
2018-10-10 00:01:49 +01:00
|
|
|
case "ldr:ro":
|
|
|
|
return new IRoInterface();
|
|
|
|
|
2018-11-17 03:36:49 +00:00
|
|
|
case "hwopus":
|
|
|
|
return new IHardwareOpusDecoderManager();
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "lm":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new ILogService();
|
2018-08-17 00:47:36 +01:00
|
|
|
|
2018-06-28 22:32:07 +01:00
|
|
|
case "mm:u":
|
|
|
|
return new IRequest();
|
2018-08-17 00:47:36 +01:00
|
|
|
|
2018-11-18 19:37:41 +00:00
|
|
|
case "ncm":
|
|
|
|
return new IContentManager();
|
|
|
|
|
2018-06-02 23:46:09 +01:00
|
|
|
case "nfp:user":
|
|
|
|
return new IUserManager();
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "nifm:u":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new Nifm.IStaticService();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-11-18 19:37:41 +00:00
|
|
|
case "ns:am":
|
|
|
|
return new IApplicationManagerInterface();
|
|
|
|
|
2019-02-14 00:44:39 +00:00
|
|
|
case "ns:am2":
|
2018-04-22 00:04:43 +01:00
|
|
|
case "ns:ec":
|
|
|
|
return new IServiceGetterInterface();
|
|
|
|
|
|
|
|
case "ns:su":
|
|
|
|
return new ISystemUpdateInterface();
|
|
|
|
|
|
|
|
case "ns:vm":
|
|
|
|
return new IVulnerabilityManagerInterface();
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "nvdrv":
|
2018-12-06 11:16:24 +00:00
|
|
|
return new INvDrvServices(system);
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "nvdrv:a":
|
2018-12-06 11:16:24 +00:00
|
|
|
return new INvDrvServices(system);
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-05-25 22:33:09 +01:00
|
|
|
case "pctl:s":
|
|
|
|
return new IParentalControlServiceFactory();
|
|
|
|
|
|
|
|
case "pctl:r":
|
|
|
|
return new IParentalControlServiceFactory();
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "pctl:a":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IParentalControlServiceFactory();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-05-25 22:33:09 +01:00
|
|
|
case "pctl":
|
|
|
|
return new IParentalControlServiceFactory();
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "pl:u":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new ISharedFontManager();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2019-02-14 00:44:39 +00:00
|
|
|
case "pm:shell":
|
|
|
|
return new IShellInterface();
|
|
|
|
|
2018-04-24 19:57:39 +01:00
|
|
|
case "prepo:a":
|
|
|
|
return new IPrepoService();
|
|
|
|
|
2018-04-22 00:04:43 +01:00
|
|
|
case "prepo:u":
|
|
|
|
return new IPrepoService();
|
|
|
|
|
2018-10-21 07:01:22 +01:00
|
|
|
case "psm":
|
|
|
|
return new IPsmServer();
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "set":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new ISettingsServer();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "set:sys":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new ISystemSettingsServer();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "sfdnsres":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IResolver();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "sm:":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IUserInterface();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "ssl":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new ISslService();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
2018-04-22 00:04:43 +01:00
|
|
|
case "time:a":
|
|
|
|
return new Time.IStaticService();
|
|
|
|
|
2018-03-19 18:58:46 +00:00
|
|
|
case "time:s":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new Time.IStaticService();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "time:u":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new Time.IStaticService();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "vi:m":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IManagerRootService();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "vi:s":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new ISystemRootService();
|
2018-03-19 18:58:46 +00:00
|
|
|
|
|
|
|
case "vi:u":
|
2018-04-06 05:01:52 +01:00
|
|
|
return new IApplicationRootService();
|
2018-03-19 18:58:46 +00:00
|
|
|
}
|
|
|
|
|
2019-04-16 00:22:55 +01:00
|
|
|
if (ServiceConfiguration.IgnoreMissingServices)
|
|
|
|
{
|
|
|
|
Logger.PrintWarning(LogClass.Service, $"Missing service {name} ignored");
|
|
|
|
return new DummyService(name);
|
|
|
|
}
|
|
|
|
|
2018-12-06 11:16:24 +00:00
|
|
|
throw new NotImplementedException(name);
|
2018-03-19 18:58:46 +00:00
|
|
|
}
|
|
|
|
}
|
2018-05-25 22:33:09 +01:00
|
|
|
}
|