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:
parent
4926f6523d
commit
4ad3936afd
147 changed files with 1413 additions and 1477 deletions
|
@ -15,29 +15,29 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs
|
|||
|
||||
[Command(302)]
|
||||
// ActivateIrsensor(nn::applet::AppletResourceUserId, pid)
|
||||
public long ActivateIrsensor(ServiceCtx context)
|
||||
public ResultCode ActivateIrsensor(ServiceCtx context)
|
||||
{
|
||||
long appletResourceUserId = context.RequestData.ReadInt64();
|
||||
|
||||
Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId });
|
||||
|
||||
return 0;
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[Command(303)]
|
||||
// DeactivateIrsensor(nn::applet::AppletResourceUserId, pid)
|
||||
public long DeactivateIrsensor(ServiceCtx context)
|
||||
public ResultCode DeactivateIrsensor(ServiceCtx context)
|
||||
{
|
||||
long appletResourceUserId = context.RequestData.ReadInt64();
|
||||
|
||||
Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId });
|
||||
|
||||
return 0;
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[Command(304)]
|
||||
// GetIrsensorSharedMemoryHandle(nn::applet::AppletResourceUserId, pid) -> handle<copy>
|
||||
public long GetIrsensorSharedMemoryHandle(ServiceCtx context)
|
||||
public ResultCode GetIrsensorSharedMemoryHandle(ServiceCtx context)
|
||||
{
|
||||
if (_irsensorSharedMemoryHandle == 0)
|
||||
{
|
||||
|
@ -49,12 +49,12 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs
|
|||
|
||||
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_irsensorSharedMemoryHandle);
|
||||
|
||||
return 0;
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[Command(311)]
|
||||
// GetNpadIrCameraHandle(u32) -> nn::irsensor::IrCameraHandle
|
||||
public long GetNpadIrCameraHandle(ServiceCtx context)
|
||||
public ResultCode GetNpadIrCameraHandle(ServiceCtx context)
|
||||
{
|
||||
NpadIdType npadIdType = (NpadIdType)context.RequestData.ReadUInt32();
|
||||
|
||||
|
@ -62,7 +62,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs
|
|||
npadIdType != NpadIdType.Unknown &&
|
||||
npadIdType != NpadIdType.Handheld)
|
||||
{
|
||||
return ErrorCode.MakeError(ErrorModule.Irsensor, IrsError.NpadIdOutOfRange);
|
||||
return ResultCode.NpadIdOutOfRange;
|
||||
}
|
||||
|
||||
HidControllerId irCameraHandle = HidUtils.GetIndexFromNpadIdType(npadIdType);
|
||||
|
@ -70,21 +70,21 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs
|
|||
context.ResponseData.Write((int)irCameraHandle);
|
||||
|
||||
// NOTE: If the irCameraHandle pointer is null this error is returned, Doesn't occur in our case.
|
||||
// return ErrorCode.MakeError(ErrorModule.Irsensor, IrsError.HandlePointerIsNull);
|
||||
// return ResultCode.HandlePointerIsNull;
|
||||
|
||||
return 0;
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
[Command(319)] // 4.0.0+
|
||||
// ActivateIrsensorWithFunctionLevel(nn::applet::AppletResourceUserId, nn::irsensor::PackedFunctionLevel, pid)
|
||||
public long ActivateIrsensorWithFunctionLevel(ServiceCtx context)
|
||||
public ResultCode ActivateIrsensorWithFunctionLevel(ServiceCtx context)
|
||||
{
|
||||
long appletResourceUserId = context.RequestData.ReadInt64();
|
||||
long packedFunctionLevel = context.RequestData.ReadInt64();
|
||||
|
||||
Logger.PrintStub(LogClass.ServiceIrs, new { appletResourceUserId, packedFunctionLevel });
|
||||
|
||||
return 0;
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue