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

@ -19,27 +19,27 @@ namespace Ryujinx.HLE.HOS.Services.Nifm
[Command(0)]
// GetRequestState() -> u32
public long GetRequestState(ServiceCtx context)
public ResultCode GetRequestState(ServiceCtx context)
{
context.ResponseData.Write(1);
Logger.PrintStub(LogClass.ServiceNifm);
return 0;
return ResultCode.Success;
}
[Command(1)]
// GetResult()
public long GetResult(ServiceCtx context)
public ResultCode GetResult(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceNifm);
return 0;
return ResultCode.Success;
}
[Command(2)]
// GetSystemEventReadableHandles() -> (handle<copy>, handle<copy>)
public long GetSystemEventReadableHandles(ServiceCtx context)
public ResultCode GetSystemEventReadableHandles(ServiceCtx context)
{
if (context.Process.HandleTable.GenerateHandle(_event0.ReadableEvent, out int handle0) != KernelResult.Success)
{
@ -53,34 +53,34 @@ namespace Ryujinx.HLE.HOS.Services.Nifm
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle0, handle1);
return 0;
return ResultCode.Success;
}
[Command(3)]
// Cancel()
public long Cancel(ServiceCtx context)
public ResultCode Cancel(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceNifm);
return 0;
return ResultCode.Success;
}
[Command(4)]
// Submit()
public long Submit(ServiceCtx context)
public ResultCode Submit(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceNifm);
return 0;
return ResultCode.Success;
}
[Command(11)]
// SetConnectionConfirmationOption(i8)
public long SetConnectionConfirmationOption(ServiceCtx context)
public ResultCode SetConnectionConfirmationOption(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceNifm);
return 0;
return ResultCode.Success;
}
}
}