aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormageven <62494521+mageven@users.noreply.github.com>2020-07-04 04:18:07 +0530
committerGitHub <noreply@github.com>2020-07-04 00:48:07 +0200
commit5644780e6e103a8b1dd61098db3097d75eeb8069 (patch)
treeac4300574a1376cae74a3556a5a897a881ad125c
parentdbeb50684d24bf43c2bdbc087f6b1f52f385acf2 (diff)
Stub nifm IRequest GetAppletInfo (#1326)
* Stub GetAppletInfo to be consistent with GetResult * Fix formatting and enum * Update and use ResultCode
-rw-r--r--Ryujinx.HLE/HOS/Services/Nifm/ResultCode.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs32
2 files changed, 34 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Nifm/ResultCode.cs b/Ryujinx.HLE/HOS/Services/Nifm/ResultCode.cs
index c661ee81..73cadb11 100644
--- a/Ryujinx.HLE/HOS/Services/Nifm/ResultCode.cs
+++ b/Ryujinx.HLE/HOS/Services/Nifm/ResultCode.cs
@@ -7,6 +7,8 @@ namespace Ryujinx.HLE.HOS.Services.Nifm
Success = 0,
+ Unknown112 = (112 << ErrorCodeShift) | ModuleId, // IRequest::GetResult
+ Unknown180 = (180 << ErrorCodeShift) | ModuleId, // IRequest::GetAppletInfo
NoInternetConnection = (300 << ErrorCodeShift) | ModuleId,
ObjectIsNull = (350 << ErrorCodeShift) | ModuleId
}
diff --git a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs
index cfc6b516..395e976a 100644
--- a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs
+++ b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IRequest.cs
@@ -38,6 +38,11 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
{
Logger.PrintStub(LogClass.ServiceNifm);
+ return GetResultImpl();
+ }
+
+ private ResultCode GetResultImpl()
+ {
return ResultCode.Success;
}
@@ -86,5 +91,32 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
return ResultCode.Success;
}
+
+ [Command(21)]
+ // GetAppletInfo(u32) -> (u32, u32, u32, buffer<bytes, 6>)
+ public ResultCode GetAppletInfo(ServiceCtx context)
+ {
+ uint themeColor = context.RequestData.ReadUInt32();
+
+ Logger.PrintStub(LogClass.ServiceNifm);
+
+ ResultCode result = GetResultImpl();
+
+ if (result == ResultCode.Success || (ResultCode)((int)result & 0x3fffff) == ResultCode.Unknown112)
+ {
+ return ResultCode.Unknown180;
+ }
+
+ // Returns appletId, libraryAppletMode, outSize and a buffer.
+ // Returned applet ids- (0x19, 0xf, 0xe)
+ // libraryAppletMode seems to be 0 for all applets supported.
+
+ // TODO: check order
+ context.ResponseData.Write(0xe); // Use error applet as default for now
+ context.ResponseData.Write(0); // libraryAppletMode
+ context.ResponseData.Write(0); // outSize
+
+ return ResultCode.Success;
+ }
}
} \ No newline at end of file