diff options
| author | 2016-07-28 20:50:49 -0400 | |
|---|---|---|
| committer | 2016-07-28 20:50:49 -0400 | |
| commit | 47fcd68b01a12143efa92ffa54bc9611fc376fd2 (patch) | |
| tree | 92d57d519cc683f94902895149ad84c6df3cfd35 /src | |
| parent | Merge pull request #1983 from hrydgard/font-reminder (diff) | |
| parent | Correct APT::0x00550040 and APT::0x00560000 function (diff) | |
| download | yuzu-47fcd68b01a12143efa92ffa54bc9611fc376fd2.tar.gz yuzu-47fcd68b01a12143efa92ffa54bc9611fc376fd2.tar.xz yuzu-47fcd68b01a12143efa92ffa54bc9611fc376fd2.zip | |
Merge pull request #1950 from JamePeng/fix-apt-0x0055004-and-0x00560000
Correct APT::0x00550040 and APT::0x00560000 function
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/apt/apt.cpp | 15 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt.h | 26 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_a.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_s.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_u.cpp | 4 |
5 files changed, 31 insertions, 22 deletions
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 0c623d45f..c009e6c98 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp | |||
| @@ -37,6 +37,8 @@ static u32 cpu_percent; ///< CPU time available to the running application | |||
| 37 | // APT::CheckNew3DSApp will check this unknown_ns_state_field to determine processing mode | 37 | // APT::CheckNew3DSApp will check this unknown_ns_state_field to determine processing mode |
| 38 | static u8 unknown_ns_state_field; | 38 | static u8 unknown_ns_state_field; |
| 39 | 39 | ||
| 40 | static ScreencapPostPermission screen_capture_post_permission; | ||
| 41 | |||
| 40 | /// Parameter data to be returned in the next call to Glance/ReceiveParameter | 42 | /// Parameter data to be returned in the next call to Glance/ReceiveParameter |
| 41 | static MessageParameter next_parameter; | 43 | static MessageParameter next_parameter; |
| 42 | 44 | ||
| @@ -389,23 +391,23 @@ void StartLibraryApplet(Service::Interface* self) { | |||
| 389 | cmd_buff[1] = applet->Start(parameter).raw; | 391 | cmd_buff[1] = applet->Start(parameter).raw; |
| 390 | } | 392 | } |
| 391 | 393 | ||
| 392 | void SetNSStateField(Service::Interface* self) { | 394 | void SetScreenCapPostPermission(Service::Interface* self) { |
| 393 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 395 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 394 | 396 | ||
| 395 | unknown_ns_state_field = cmd_buff[1]; | 397 | screen_capture_post_permission = static_cast<ScreencapPostPermission>(cmd_buff[1] & 0xF); |
| 396 | 398 | ||
| 397 | cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0); | 399 | cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0); |
| 398 | cmd_buff[1] = RESULT_SUCCESS.raw; | 400 | cmd_buff[1] = RESULT_SUCCESS.raw; |
| 399 | LOG_WARNING(Service_APT, "(STUBBED) unknown_ns_state_field=%u", unknown_ns_state_field); | 401 | LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", screen_capture_post_permission); |
| 400 | } | 402 | } |
| 401 | 403 | ||
| 402 | void GetNSStateField(Service::Interface* self) { | 404 | void GetScreenCapPostPermission(Service::Interface* self) { |
| 403 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 405 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 404 | 406 | ||
| 405 | cmd_buff[0] = IPC::MakeHeader(0x56, 2, 0); | 407 | cmd_buff[0] = IPC::MakeHeader(0x56, 2, 0); |
| 406 | cmd_buff[1] = RESULT_SUCCESS.raw; | 408 | cmd_buff[1] = RESULT_SUCCESS.raw; |
| 407 | cmd_buff[8] = unknown_ns_state_field; | 409 | cmd_buff[2] = static_cast<u32>(screen_capture_post_permission); |
| 408 | LOG_WARNING(Service_APT, "(STUBBED) unknown_ns_state_field=%u", unknown_ns_state_field); | 410 | LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", screen_capture_post_permission); |
| 409 | } | 411 | } |
| 410 | 412 | ||
| 411 | void GetAppletInfo(Service::Interface* self) { | 413 | void GetAppletInfo(Service::Interface* self) { |
| @@ -500,6 +502,7 @@ void Init() { | |||
| 500 | 502 | ||
| 501 | cpu_percent = 0; | 503 | cpu_percent = 0; |
| 502 | unknown_ns_state_field = 0; | 504 | unknown_ns_state_field = 0; |
| 505 | screen_capture_post_permission = ScreencapPostPermission::CleanThePermission; // TODO(JamePeng): verify the initial value | ||
| 503 | 506 | ||
| 504 | // TODO(bunnei): Check if these are created in Initialize or on APT process startup. | 507 | // TODO(bunnei): Check if these are created in Initialize or on APT process startup. |
| 505 | notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification"); | 508 | notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification"); |
diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index 53cee4867..077a6a316 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h | |||
| @@ -94,6 +94,13 @@ enum class StartupArgumentType : u32 { | |||
| 94 | OtherMedia = 2, | 94 | OtherMedia = 2, |
| 95 | }; | 95 | }; |
| 96 | 96 | ||
| 97 | enum class ScreencapPostPermission : u32 { | ||
| 98 | CleanThePermission = 0, //TODO(JamePeng): verify what "zero" means | ||
| 99 | NoExplicitSetting = 1, | ||
| 100 | EnableScreenshotPostingToMiiverse = 2, | ||
| 101 | DisableScreenshotPostingToMiiverse = 3 | ||
| 102 | }; | ||
| 103 | |||
| 97 | /// Send a parameter to the currently-running application, which will read it via ReceiveParameter | 104 | /// Send a parameter to the currently-running application, which will read it via ReceiveParameter |
| 98 | void SendParameter(const MessageParameter& parameter); | 105 | void SendParameter(const MessageParameter& parameter); |
| 99 | 106 | ||
| @@ -383,25 +390,24 @@ void StartLibraryApplet(Service::Interface* self); | |||
| 383 | void GetStartupArgument(Service::Interface* self); | 390 | void GetStartupArgument(Service::Interface* self); |
| 384 | 391 | ||
| 385 | /** | 392 | /** |
| 386 | * APT::SetNSStateField service function | 393 | * APT::SetScreenCapPostPermission service function |
| 387 | * Inputs: | 394 | * Inputs: |
| 388 | * 1 : u8 NS state field | 395 | * 0 : Header Code[0x00550040] |
| 396 | * 1 : u8 The screenshot posting permission | ||
| 389 | * Outputs: | 397 | * Outputs: |
| 390 | * 1 : Result of function, 0 on success, otherwise error code | 398 | * 1 : Result of function, 0 on success, otherwise error code |
| 391 | * Note: | ||
| 392 | * This writes the input u8 to a NS state field. | ||
| 393 | */ | 399 | */ |
| 394 | void SetNSStateField(Service::Interface* self); | 400 | void SetScreenCapPostPermission(Service::Interface* self); |
| 395 | 401 | ||
| 396 | /** | 402 | /** |
| 397 | * APT::GetNSStateField service function | 403 | * APT::GetScreenCapPostPermission service function |
| 404 | * Inputs: | ||
| 405 | * 0 : Header Code[0x00560000] | ||
| 398 | * Outputs: | 406 | * Outputs: |
| 399 | * 1 : Result of function, 0 on success, otherwise error code | 407 | * 1 : Result of function, 0 on success, otherwise error code |
| 400 | * 8 : u8 NS state field | 408 | * 2 : u8 The screenshot posting permission |
| 401 | * Note: | ||
| 402 | * This returns a u8 NS state field(which can be set by cmd 0x00550040), at cmdreply+8. | ||
| 403 | */ | 409 | */ |
| 404 | void GetNSStateField(Service::Interface* self); | 410 | void GetScreenCapPostPermission(Service::Interface* self); |
| 405 | 411 | ||
| 406 | /** | 412 | /** |
| 407 | * APT::CheckNew3DSApp service function | 413 | * APT::CheckNew3DSApp service function |
diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp index 223c0a8bd..6c44c491c 100644 --- a/src/core/hle/service/apt/apt_a.cpp +++ b/src/core/hle/service/apt/apt_a.cpp | |||
| @@ -33,8 +33,8 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 33 | {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, | 33 | {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, |
| 34 | {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, | 34 | {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, |
| 35 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, | 35 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, |
| 36 | {0x00550040, SetNSStateField, "SetNSStateField?"}, | 36 | {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, |
| 37 | {0x00560000, GetNSStateField, "GetNSStateField?"}, | 37 | {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, |
| 38 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, | 38 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, |
| 39 | {0x01020000, CheckNew3DS, "CheckNew3DS"} | 39 | {0x01020000, CheckNew3DS, "CheckNew3DS"} |
| 40 | }; | 40 | }; |
diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index f5c52fa3d..c70f2201f 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp | |||
| @@ -92,8 +92,8 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 92 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, | 92 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, |
| 93 | {0x00520104, nullptr, "Wrap1"}, | 93 | {0x00520104, nullptr, "Wrap1"}, |
| 94 | {0x00530104, nullptr, "Unwrap1"}, | 94 | {0x00530104, nullptr, "Unwrap1"}, |
| 95 | {0x00550040, SetNSStateField, "SetNSStateField?" }, | 95 | {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, |
| 96 | {0x00560000, GetNSStateField, "GetNSStateField?" }, | 96 | {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, |
| 97 | {0x00580002, nullptr, "GetProgramID"}, | 97 | {0x00580002, nullptr, "GetProgramID"}, |
| 98 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, | 98 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, |
| 99 | {0x01020000, CheckNew3DS, "CheckNew3DS"} | 99 | {0x01020000, CheckNew3DS, "CheckNew3DS"} |
diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index 0e60bd34f..7bb804ffa 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp | |||
| @@ -92,8 +92,8 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 92 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, | 92 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, |
| 93 | {0x00520104, nullptr, "Wrap1"}, | 93 | {0x00520104, nullptr, "Wrap1"}, |
| 94 | {0x00530104, nullptr, "Unwrap1"}, | 94 | {0x00530104, nullptr, "Unwrap1"}, |
| 95 | {0x00550040, SetNSStateField, "SetNSStateField?"}, | 95 | {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, |
| 96 | {0x00560000, GetNSStateField, "GetNSStateField?"}, | 96 | {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, |
| 97 | {0x00580002, nullptr, "GetProgramID"}, | 97 | {0x00580002, nullptr, "GetProgramID"}, |
| 98 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, | 98 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, |
| 99 | {0x01020000, CheckNew3DS, "CheckNew3DS"} | 99 | {0x01020000, CheckNew3DS, "CheckNew3DS"} |