Refactoring result codes (#731)

* refactoring result codes

- Add a main enum who can handle some orphalin result codes and the default `ResultCode.Success` one.
- Add sub-enum by services when it's needed.
- Remove some empty line.
- Recast all service calls to ResultCode.
- Remove some unneeded static declaration.
- Delete unused `NvHelper` class.

* NvResult is back

* Fix
This commit is contained in:
Ac_K 2019-07-14 21:04:38 +02:00 committed by gdkchan
parent 4926f6523d
commit 4ad3936afd
147 changed files with 1413 additions and 1477 deletions

View file

@ -6,74 +6,74 @@ namespace Ryujinx.HLE.HOS.Services.Am
[Command(0)]
// GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter>
public long GetCommonStateGetter(ServiceCtx context)
public ResultCode GetCommonStateGetter(ServiceCtx context)
{
MakeObject(context, new ICommonStateGetter(context.Device.System));
return 0;
return ResultCode.Success;
}
[Command(1)]
// GetSelfController() -> object<nn::am::service::ISelfController>
public long GetSelfController(ServiceCtx context)
public ResultCode GetSelfController(ServiceCtx context)
{
MakeObject(context, new ISelfController(context.Device.System));
return 0;
return ResultCode.Success;
}
[Command(2)]
// GetWindowController() -> object<nn::am::service::IWindowController>
public long GetWindowController(ServiceCtx context)
public ResultCode GetWindowController(ServiceCtx context)
{
MakeObject(context, new IWindowController());
return 0;
return ResultCode.Success;
}
[Command(3)]
// GetAudioController() -> object<nn::am::service::IAudioController>
public long GetAudioController(ServiceCtx context)
public ResultCode GetAudioController(ServiceCtx context)
{
MakeObject(context, new IAudioController());
return 0;
return ResultCode.Success;
}
[Command(4)]
// GetDisplayController() -> object<nn::am::service::IDisplayController>
public long GetDisplayController(ServiceCtx context)
public ResultCode GetDisplayController(ServiceCtx context)
{
MakeObject(context, new IDisplayController());
return 0;
return ResultCode.Success;
}
[Command(11)]
// GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator>
public long GetLibraryAppletCreator(ServiceCtx context)
public ResultCode GetLibraryAppletCreator(ServiceCtx context)
{
MakeObject(context, new ILibraryAppletCreator());
return 0;
return ResultCode.Success;
}
[Command(20)]
// GetApplicationFunctions() -> object<nn::am::service::IApplicationFunctions>
public long GetApplicationFunctions(ServiceCtx context)
public ResultCode GetApplicationFunctions(ServiceCtx context)
{
MakeObject(context, new IApplicationFunctions());
return 0;
return ResultCode.Success;
}
[Command(1000)]
// GetDebugFunctions() -> object<nn::am::service::IDebugFunctions>
public long GetDebugFunctions(ServiceCtx context)
public ResultCode GetDebugFunctions(ServiceCtx context)
{
MakeObject(context, new IDebugFunctions());
return 0;
return ResultCode.Success;
}
}
}