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

@ -9,18 +9,18 @@ namespace Ryujinx.HLE.HOS.Services.Ns
[Command(2)]
// CountAddOnContent(u64, pid) -> u32
public static long CountAddOnContent(ServiceCtx context)
public static ResultCode CountAddOnContent(ServiceCtx context)
{
context.ResponseData.Write(0);
Logger.PrintStub(LogClass.ServiceNs);
return 0;
return ResultCode.Success;
}
[Command(3)]
// ListAddOnContent(u32, u32, u64, pid) -> (u32, buffer<u32, 6>)
public static long ListAddOnContent(ServiceCtx context)
public static ResultCode ListAddOnContent(ServiceCtx context)
{
Logger.PrintStub(LogClass.ServiceNs);
@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
// It's unknown what it contains.
context.ResponseData.Write(0);
return 0;
return ResultCode.Success;
}
}
}

View file

@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
[Command(400)]
// GetApplicationControlData(unknown<0x10>) -> (unknown<4>, buffer<unknown, 6>)
public long GetApplicationControlData(ServiceCtx context)
public ResultCode GetApplicationControlData(ServiceCtx context)
{
long position = context.Request.ReceiveBuff[0].Position;
@ -189,7 +189,6 @@ namespace Ryujinx.HLE.HOS.Services.Ns
context.Memory.WriteBytes(position, reserved03);
position += reserved03.Length;
for (int i = 0; i < 16; i++)
{
ulong value = 0;
@ -207,7 +206,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns
context.Memory.WriteByte(position++, nacp.RepairFlag);
context.Memory.WriteByte(position++, nacp.ProgramIndex);
return 0;
return ResultCode.Success;
}
}
}

View file

@ -8,11 +8,11 @@ namespace Ryujinx.HLE.HOS.Services.Ns
[Command(7996)]
// GetApplicationManagerInterface() -> object<nn::ns::detail::IApplicationManagerInterface>
public long GetApplicationManagerInterface(ServiceCtx context)
public ResultCode GetApplicationManagerInterface(ServiceCtx context)
{
MakeObject(context, new IApplicationManagerInterface(context));
return 0;
return ResultCode.Success;
}
}
}