summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar JamePeng2016-03-29 05:25:05 +0800
committerGravatar JamePeng2016-04-05 02:04:58 +0800
commitaf9a8258b93e4fd6a0fc1980fadfd07330d00de2 (patch)
tree77d68557293259917538b36f2eb8f5d00887dd48 /src
parentAppend the missing function name"GetAppletInfo" to APT:A (diff)
downloadyuzu-af9a8258b93e4fd6a0fc1980fadfd07330d00de2.tar.gz
yuzu-af9a8258b93e4fd6a0fc1980fadfd07330d00de2.tar.xz
yuzu-af9a8258b93e4fd6a0fc1980fadfd07330d00de2.zip
implement APT::GetStartupArgument
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/apt/apt.cpp17
-rw-r--r--src/core/hle/service/apt/apt.h17
-rw-r--r--src/core/hle/service/apt/apt_a.cpp1
-rw-r--r--src/core/hle/service/apt/apt_s.cpp2
-rw-r--r--src/core/hle/service/apt/apt_u.cpp2
5 files changed, 37 insertions, 2 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp
index a49365287..6d72e8188 100644
--- a/src/core/hle/service/apt/apt.cpp
+++ b/src/core/hle/service/apt/apt.cpp
@@ -397,6 +397,23 @@ void GetAppletInfo(Service::Interface* self) {
397 LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id); 397 LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id);
398} 398}
399 399
400void GetStartupArgument(Service::Interface* self) {
401 u32* cmd_buff = Kernel::GetCommandBuffer();
402 u32 parameter_size = cmd_buff[1];
403 StartupArgumentType startup_argument_type = static_cast<StartupArgumentType>(cmd_buff[2]);
404
405 if (parameter_size >= 0x300) {
406 LOG_ERROR(Service_APT, "Parameter size is outside the valid range (capped to 0x300): parameter_size=0x%08x", parameter_size);
407 return;
408 }
409
410 LOG_WARNING(Service_APT,"(stubbed) called startup_argument_type=%u , parameter_size=0x%08x , parameter_value=0x%08x",
411 startup_argument_type, parameter_size, Memory::Read32(cmd_buff[41]));
412
413 cmd_buff[1] = RESULT_SUCCESS.raw;
414 cmd_buff[2] = (parameter_size > 0) ? 1 : 0;
415}
416
400void Init() { 417void Init() {
401 AddService(new APT_A_Interface); 418 AddService(new APT_A_Interface);
402 AddService(new APT_S_Interface); 419 AddService(new APT_S_Interface);
diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h
index 47a97c1a1..e4f96855b 100644
--- a/src/core/hle/service/apt/apt.h
+++ b/src/core/hle/service/apt/apt.h
@@ -67,6 +67,12 @@ enum class AppletId : u32 {
67 Ed2 = 0x402, 67 Ed2 = 0x402,
68}; 68};
69 69
70enum class StartupArgumentType : u32 {
71 OtherApp = 0,
72 Restart = 1,
73 OtherMedia = 2,
74};
75
70/// Send a parameter to the currently-running application, which will read it via ReceiveParameter 76/// Send a parameter to the currently-running application, which will read it via ReceiveParameter
71void SendParameter(const MessageParameter& parameter); 77void SendParameter(const MessageParameter& parameter);
72 78
@@ -344,6 +350,17 @@ void PreloadLibraryApplet(Service::Interface* self);
344 */ 350 */
345void StartLibraryApplet(Service::Interface* self); 351void StartLibraryApplet(Service::Interface* self);
346 352
353/**
354* APT::GetStartupArgument service function
355* Inputs:
356* 1 : Parameter Size (capped to 0x300)
357* 2 : StartupArgumentType
358* Outputs:
359* 0 : Return header
360* 1 : u8, Exists (0 = does not exist, 1 = exists)
361*/
362void GetStartupArgument(Service::Interface* self);
363
347/// Initialize the APT service 364/// Initialize the APT service
348void Init(); 365void Init();
349 366
diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp
index 61f660f55..c0bbf7dd4 100644
--- a/src/core/hle/service/apt/apt_a.cpp
+++ b/src/core/hle/service/apt/apt_a.cpp
@@ -28,6 +28,7 @@ const Interface::FunctionInfo FunctionTable[] = {
28 {0x00430040, NotifyToWait, "NotifyToWait?"}, 28 {0x00430040, NotifyToWait, "NotifyToWait?"},
29 {0x00440000, GetSharedFont, "GetSharedFont?"}, 29 {0x00440000, GetSharedFont, "GetSharedFont?"},
30 {0x004B00C2, AppletUtility, "AppletUtility?"}, 30 {0x004B00C2, AppletUtility, "AppletUtility?"},
31 {0x00510080, GetStartupArgument, "GetStartupArgument"},
31 {0x00550040, nullptr, "WriteInputToNsState?"}, 32 {0x00550040, nullptr, "WriteInputToNsState?"},
32}; 33};
33 34
diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp
index 7f6e81a63..b978b8f67 100644
--- a/src/core/hle/service/apt/apt_s.cpp
+++ b/src/core/hle/service/apt/apt_s.cpp
@@ -89,7 +89,7 @@ const Interface::FunctionInfo FunctionTable[] = {
89 {0x004E0000, nullptr, "HardwareResetAsync"}, 89 {0x004E0000, nullptr, "HardwareResetAsync"},
90 {0x004F0080, nullptr, "SetApplicationCpuTimeLimit"}, 90 {0x004F0080, nullptr, "SetApplicationCpuTimeLimit"},
91 {0x00500040, nullptr, "GetApplicationCpuTimeLimit"}, 91 {0x00500040, nullptr, "GetApplicationCpuTimeLimit"},
92 {0x00510080, nullptr, "GetStartupArgument"}, 92 {0x00510080, GetStartupArgument, "GetStartupArgument"},
93 {0x00520104, nullptr, "Wrap1"}, 93 {0x00520104, nullptr, "Wrap1"},
94 {0x00530104, nullptr, "Unwrap1"}, 94 {0x00530104, nullptr, "Unwrap1"},
95 {0x00580002, nullptr, "GetProgramID"}, 95 {0x00580002, nullptr, "GetProgramID"},
diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp
index b13b51549..0e85c6d08 100644
--- a/src/core/hle/service/apt/apt_u.cpp
+++ b/src/core/hle/service/apt/apt_u.cpp
@@ -89,7 +89,7 @@ const Interface::FunctionInfo FunctionTable[] = {
89 {0x004E0000, nullptr, "HardwareResetAsync"}, 89 {0x004E0000, nullptr, "HardwareResetAsync"},
90 {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, 90 {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"},
91 {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, 91 {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"},
92 {0x00510080, nullptr, "GetStartupArgument"}, 92 {0x00510080, GetStartupArgument, "GetStartupArgument"},
93 {0x00520104, nullptr, "Wrap1"}, 93 {0x00520104, nullptr, "Wrap1"},
94 {0x00530104, nullptr, "Unwrap1"}, 94 {0x00530104, nullptr, "Unwrap1"},
95 {0x00580002, nullptr, "GetProgramID"}, 95 {0x00580002, nullptr, "GetProgramID"},