2018-08-16 23:47:36 +00:00
|
|
|
using Ryujinx.HLE.HOS.Ipc;
|
2018-04-21 19:30:06 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2018-08-16 23:47:36 +00:00
|
|
|
namespace Ryujinx.HLE.HOS.Services.Am
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
|
|
|
class ISystemAppletProxy : IpcService
|
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
private Dictionary<int, ServiceProcessRequest> m_Commands;
|
2018-04-21 19:30:06 +00:00
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
public ISystemAppletProxy()
|
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
m_Commands = new Dictionary<int, ServiceProcessRequest>()
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-04-24 18:57:39 +00:00
|
|
|
{ 0, GetCommonStateGetter },
|
|
|
|
{ 1, GetSelfController },
|
|
|
|
{ 2, GetWindowController },
|
|
|
|
{ 3, GetAudioController },
|
|
|
|
{ 4, GetDisplayController },
|
|
|
|
{ 11, GetLibraryAppletCreator },
|
|
|
|
{ 20, GetHomeMenuFunctions },
|
|
|
|
{ 21, GetGlobalStateController },
|
|
|
|
{ 22, GetApplicationCreator },
|
2018-04-21 19:30:06 +00:00
|
|
|
{ 1000, GetDebugFunctions }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetCommonStateGetter(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new ICommonStateGetter(Context.Device.System));
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetSelfController(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new ISelfController(Context.Device.System));
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetWindowController(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new IWindowController());
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
2018-04-24 18:57:39 +00:00
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetAudioController(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new IAudioController());
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetDisplayController(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new IDisplayController());
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetLibraryAppletCreator(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new ILibraryAppletCreator());
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetHomeMenuFunctions(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new IHomeMenuFunctions(Context.Device.System));
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetGlobalStateController(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new IGlobalStateController());
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetApplicationCreator(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new IApplicationCreator());
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-12-05 00:52:39 +00:00
|
|
|
public long GetDebugFunctions(ServiceCtx Context)
|
2018-04-21 19:30:06 +00:00
|
|
|
{
|
2018-12-05 00:52:39 +00:00
|
|
|
MakeObject(Context, new IDebugFunctions());
|
2018-04-21 19:30:06 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|