Refactoring commands handling (#728)
* Refactoring commands handling - Use Reflection to handle commands ID. - Add all symbols (from SwIPC so not all time accurate). - Re-sort some services commands methods. - Some cleanup. - Keep some empty constructor for consistency. * Fix order in IProfile
This commit is contained in:
parent
f723f6f39a
commit
560ccbeb2d
99 changed files with 1035 additions and 1983 deletions
|
@ -1,31 +1,11 @@
|
|||
using Ryujinx.HLE.HOS.Ipc;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Am
|
||||
{
|
||||
class ISystemAppletProxy : IpcService
|
||||
{
|
||||
private Dictionary<int, ServiceProcessRequest> _commands;
|
||||
|
||||
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
|
||||
|
||||
public ISystemAppletProxy()
|
||||
{
|
||||
_commands = new Dictionary<int, ServiceProcessRequest>
|
||||
{
|
||||
{ 0, GetCommonStateGetter },
|
||||
{ 1, GetSelfController },
|
||||
{ 2, GetWindowController },
|
||||
{ 3, GetAudioController },
|
||||
{ 4, GetDisplayController },
|
||||
{ 11, GetLibraryAppletCreator },
|
||||
{ 20, GetHomeMenuFunctions },
|
||||
{ 21, GetGlobalStateController },
|
||||
{ 22, GetApplicationCreator },
|
||||
{ 1000, GetDebugFunctions }
|
||||
};
|
||||
}
|
||||
public ISystemAppletProxy() { }
|
||||
|
||||
[Command(0)]
|
||||
// GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter>
|
||||
public long GetCommonStateGetter(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new ICommonStateGetter(context.Device.System));
|
||||
|
@ -33,6 +13,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(1)]
|
||||
// GetSelfController() -> object<nn::am::service::ISelfController>
|
||||
public long GetSelfController(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new ISelfController(context.Device.System));
|
||||
|
@ -40,6 +22,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(2)]
|
||||
// GetWindowController() -> object<nn::am::service::IWindowController>
|
||||
public long GetWindowController(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IWindowController());
|
||||
|
@ -47,6 +31,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(3)]
|
||||
// GetAudioController() -> object<nn::am::service::IAudioController>
|
||||
public long GetAudioController(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IAudioController());
|
||||
|
@ -54,6 +40,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(4)]
|
||||
// GetDisplayController() -> object<nn::am::service::IDisplayController>
|
||||
public long GetDisplayController(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IDisplayController());
|
||||
|
@ -61,6 +49,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(11)]
|
||||
// GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator>
|
||||
public long GetLibraryAppletCreator(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new ILibraryAppletCreator());
|
||||
|
@ -68,6 +58,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(20)]
|
||||
// GetHomeMenuFunctions() -> object<nn::am::service::IHomeMenuFunctions>
|
||||
public long GetHomeMenuFunctions(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IHomeMenuFunctions(context.Device.System));
|
||||
|
@ -75,6 +67,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(21)]
|
||||
// GetGlobalStateController() -> object<nn::am::service::IGlobalStateController>
|
||||
public long GetGlobalStateController(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IGlobalStateController());
|
||||
|
@ -82,6 +76,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(22)]
|
||||
// GetApplicationCreator() -> object<nn::am::service::IApplicationCreator>
|
||||
public long GetApplicationCreator(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IApplicationCreator());
|
||||
|
@ -89,6 +85,8 @@ namespace Ryujinx.HLE.HOS.Services.Am
|
|||
return 0;
|
||||
}
|
||||
|
||||
[Command(1000)]
|
||||
// GetDebugFunctions() -> object<nn::am::service::IDebugFunctions>
|
||||
public long GetDebugFunctions(ServiceCtx context)
|
||||
{
|
||||
MakeObject(context, new IDebugFunctions());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue