diff options
| -rw-r--r-- | src/core/hle/service/apt/apt.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt.h | 17 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_a.cpp | 9 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_s.cpp | 10 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_u.cpp | 2 |
5 files changed, 47 insertions, 8 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 | ||
| 400 | void 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 | |||
| 400 | void Init() { | 417 | void 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..668b4a66f 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 | ||
| 70 | enum 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 |
| 71 | void SendParameter(const MessageParameter& parameter); | 77 | void SendParameter(const MessageParameter& parameter); |
| 72 | 78 | ||
| @@ -344,6 +350,17 @@ void PreloadLibraryApplet(Service::Interface* self); | |||
| 344 | */ | 350 | */ |
| 345 | void StartLibraryApplet(Service::Interface* self); | 351 | void 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 | */ | ||
| 362 | void GetStartupArgument(Service::Interface* self); | ||
| 363 | |||
| 347 | /// Initialize the APT service | 364 | /// Initialize the APT service |
| 348 | void Init(); | 365 | void Init(); |
| 349 | 366 | ||
diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp index 0c6a77305..9ff47701a 100644 --- a/src/core/hle/service/apt/apt_a.cpp +++ b/src/core/hle/service/apt/apt_a.cpp | |||
| @@ -13,9 +13,10 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 13 | {0x00020080, Initialize, "Initialize?"}, | 13 | {0x00020080, Initialize, "Initialize?"}, |
| 14 | {0x00030040, Enable, "Enable?"}, | 14 | {0x00030040, Enable, "Enable?"}, |
| 15 | {0x00040040, nullptr, "Finalize?"}, | 15 | {0x00040040, nullptr, "Finalize?"}, |
| 16 | {0x00050040, nullptr, "GetAppletManInfo?"}, | 16 | {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, |
| 17 | {0x00060040, nullptr, "GetAppletInfo?"}, | 17 | {0x00060040, GetAppletInfo, "GetAppletInfo"}, |
| 18 | {0x00090040, IsRegistered, "IsRegistered"}, | 18 | {0x00090040, IsRegistered, "IsRegistered"}, |
| 19 | {0x000B0040, InquireNotification, "InquireNotification"}, | ||
| 19 | {0x000C0104, SendParameter, "SendParameter"}, | 20 | {0x000C0104, SendParameter, "SendParameter"}, |
| 20 | {0x000D0080, ReceiveParameter, "ReceiveParameter"}, | 21 | {0x000D0080, ReceiveParameter, "ReceiveParameter"}, |
| 21 | {0x000E0080, GlanceParameter, "GlanceParameter"}, | 22 | {0x000E0080, GlanceParameter, "GlanceParameter"}, |
| @@ -24,9 +25,13 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 24 | {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, | 25 | {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, |
| 25 | {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, | 26 | {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, |
| 26 | {0x003B0040, nullptr, "CancelLibraryApplet?"}, | 27 | {0x003B0040, nullptr, "CancelLibraryApplet?"}, |
| 28 | {0x003E0080, nullptr, "ReplySleepQuery"}, | ||
| 27 | {0x00430040, NotifyToWait, "NotifyToWait?"}, | 29 | {0x00430040, NotifyToWait, "NotifyToWait?"}, |
| 28 | {0x00440000, GetSharedFont, "GetSharedFont?"}, | 30 | {0x00440000, GetSharedFont, "GetSharedFont?"}, |
| 29 | {0x004B00C2, AppletUtility, "AppletUtility?"}, | 31 | {0x004B00C2, AppletUtility, "AppletUtility?"}, |
| 32 | {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, | ||
| 33 | {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, | ||
| 34 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, | ||
| 30 | {0x00550040, nullptr, "WriteInputToNsState?"}, | 35 | {0x00550040, nullptr, "WriteInputToNsState?"}, |
| 31 | }; | 36 | }; |
| 32 | 37 | ||
diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index 7f6e81a63..ca54e593c 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp | |||
| @@ -13,8 +13,8 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 13 | {0x00020080, Initialize, "Initialize"}, | 13 | {0x00020080, Initialize, "Initialize"}, |
| 14 | {0x00030040, Enable, "Enable"}, | 14 | {0x00030040, Enable, "Enable"}, |
| 15 | {0x00040040, nullptr, "Finalize"}, | 15 | {0x00040040, nullptr, "Finalize"}, |
| 16 | {0x00050040, nullptr, "GetAppletManInfo"}, | 16 | {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, |
| 17 | {0x00060040, nullptr, "GetAppletInfo"}, | 17 | {0x00060040, GetAppletInfo, "GetAppletInfo"}, |
| 18 | {0x00070000, nullptr, "GetLastSignaledAppletId"}, | 18 | {0x00070000, nullptr, "GetLastSignaledAppletId"}, |
| 19 | {0x00080000, nullptr, "CountRegisteredApplet"}, | 19 | {0x00080000, nullptr, "CountRegisteredApplet"}, |
| 20 | {0x00090040, nullptr, "IsRegistered"}, | 20 | {0x00090040, nullptr, "IsRegistered"}, |
| @@ -87,9 +87,9 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 87 | {0x004C0000, nullptr, "SetFatalErrDispMode"}, | 87 | {0x004C0000, nullptr, "SetFatalErrDispMode"}, |
| 88 | {0x004D0080, nullptr, "GetAppletProgramInfo"}, | 88 | {0x004D0080, nullptr, "GetAppletProgramInfo"}, |
| 89 | {0x004E0000, nullptr, "HardwareResetAsync"}, | 89 | {0x004E0000, nullptr, "HardwareResetAsync"}, |
| 90 | {0x004F0080, nullptr, "SetApplicationCpuTimeLimit"}, | 90 | {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, |
| 91 | {0x00500040, nullptr, "GetApplicationCpuTimeLimit"}, | 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"}, |
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"}, |