diff options
| author | 2024-02-11 19:23:26 -0500 | |
|---|---|---|
| committer | 2024-02-11 21:59:33 -0500 | |
| commit | af35057212949c4a1088157b4f2e6e592f23f5ee (patch) | |
| tree | 280704e9b7dd4969dbfa23162c69fd40fd4eadfc /src | |
| parent | am: rewrite IAudioController (diff) | |
| download | yuzu-af35057212949c4a1088157b4f2e6e592f23f5ee.tar.gz yuzu-af35057212949c4a1088157b4f2e6e592f23f5ee.tar.xz yuzu-af35057212949c4a1088157b4f2e6e592f23f5ee.zip | |
am: rewrite IAppletCommonFunctions
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/core/hle/service/am/service/applet_common_functions.cpp (renamed from src/core/hle/service/am/applet_common_functions.cpp) | 34 | ||||
| -rw-r--r-- | src/core/hle/service/am/service/applet_common_functions.h (renamed from src/core/hle/service/am/applet_common_functions.h) | 6 | ||||
| -rw-r--r-- | src/core/hle/service/am/service/application_proxy.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/service/library_applet_proxy.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/service/system_applet_proxy.cpp | 2 |
6 files changed, 26 insertions, 24 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 8e4928e08..236051515 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -421,8 +421,6 @@ add_library(core STATIC | |||
| 421 | hle/service/am/applet_data_broker.cpp | 421 | hle/service/am/applet_data_broker.cpp |
| 422 | hle/service/am/applet_data_broker.h | 422 | hle/service/am/applet_data_broker.h |
| 423 | hle/service/am/applet_manager.h | 423 | hle/service/am/applet_manager.h |
| 424 | hle/service/am/applet_common_functions.cpp | ||
| 425 | hle/service/am/applet_common_functions.h | ||
| 426 | hle/service/am/applet_message_queue.cpp | 424 | hle/service/am/applet_message_queue.cpp |
| 427 | hle/service/am/applet_message_queue.h | 425 | hle/service/am/applet_message_queue.h |
| 428 | hle/service/am/application_creator.cpp | 426 | hle/service/am/application_creator.cpp |
| @@ -465,6 +463,8 @@ add_library(core STATIC | |||
| 465 | hle/service/am/self_controller.h | 463 | hle/service/am/self_controller.h |
| 466 | hle/service/am/service/all_system_applet_proxies_service.cpp | 464 | hle/service/am/service/all_system_applet_proxies_service.cpp |
| 467 | hle/service/am/service/all_system_applet_proxies_service.h | 465 | hle/service/am/service/all_system_applet_proxies_service.h |
| 466 | hle/service/am/service/applet_common_functions.cpp | ||
| 467 | hle/service/am/service/applet_common_functions.h | ||
| 468 | hle/service/am/service/application_proxy_service.cpp | 468 | hle/service/am/service/application_proxy_service.cpp |
| 469 | hle/service/am/service/application_proxy_service.h | 469 | hle/service/am/service/application_proxy_service.h |
| 470 | hle/service/am/service/application_proxy.cpp | 470 | hle/service/am/service/application_proxy.cpp |
diff --git a/src/core/hle/service/am/applet_common_functions.cpp b/src/core/hle/service/am/service/applet_common_functions.cpp index 130614ae5..0f29ab285 100644 --- a/src/core/hle/service/am/applet_common_functions.cpp +++ b/src/core/hle/service/am/service/applet_common_functions.cpp | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/am/applet.h" | 4 | #include "core/hle/service/am/applet.h" |
| 5 | #include "core/hle/service/am/applet_common_functions.h" | 5 | #include "core/hle/service/am/service/applet_common_functions.h" |
| 6 | #include "core/hle/service/ipc_helpers.h" | 6 | #include "core/hle/service/cmif_serialization.h" |
| 7 | 7 | ||
| 8 | namespace Service::AM { | 8 | namespace Service::AM { |
| 9 | 9 | ||
| @@ -20,18 +20,18 @@ IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_, | |||
| 20 | {40, nullptr, "GetDisplayLogicalResolution"}, | 20 | {40, nullptr, "GetDisplayLogicalResolution"}, |
| 21 | {42, nullptr, "SetDisplayMagnification"}, | 21 | {42, nullptr, "SetDisplayMagnification"}, |
| 22 | {50, nullptr, "SetHomeButtonDoubleClickEnabled"}, | 22 | {50, nullptr, "SetHomeButtonDoubleClickEnabled"}, |
| 23 | {51, nullptr, "GetHomeButtonDoubleClickEnabled"}, | 23 | {51, D<&IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled>, "GetHomeButtonDoubleClickEnabled"}, |
| 24 | {52, nullptr, "IsHomeButtonShortPressedBlocked"}, | 24 | {52, nullptr, "IsHomeButtonShortPressedBlocked"}, |
| 25 | {60, nullptr, "IsVrModeCurtainRequired"}, | 25 | {60, nullptr, "IsVrModeCurtainRequired"}, |
| 26 | {61, nullptr, "IsSleepRequiredByHighTemperature"}, | 26 | {61, nullptr, "IsSleepRequiredByHighTemperature"}, |
| 27 | {62, nullptr, "IsSleepRequiredByLowBattery"}, | 27 | {62, nullptr, "IsSleepRequiredByLowBattery"}, |
| 28 | {70, &IAppletCommonFunctions::SetCpuBoostRequestPriority, "SetCpuBoostRequestPriority"}, | 28 | {70, D<&IAppletCommonFunctions::SetCpuBoostRequestPriority>, "SetCpuBoostRequestPriority"}, |
| 29 | {80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"}, | 29 | {80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"}, |
| 30 | {81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"}, | 30 | {81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"}, |
| 31 | {90, nullptr, "OpenNamedChannelAsParent"}, | 31 | {90, nullptr, "OpenNamedChannelAsParent"}, |
| 32 | {91, nullptr, "OpenNamedChannelAsChild"}, | 32 | {91, nullptr, "OpenNamedChannelAsChild"}, |
| 33 | {100, nullptr, "SetApplicationCoreUsageMode"}, | 33 | {100, nullptr, "SetApplicationCoreUsageMode"}, |
| 34 | {300, &IAppletCommonFunctions::GetCurrentApplicationId, "GetCurrentApplicationId"}, | 34 | {300, D<&IAppletCommonFunctions::GetCurrentApplicationId>, "GetCurrentApplicationId"}, |
| 35 | }; | 35 | }; |
| 36 | // clang-format on | 36 | // clang-format on |
| 37 | 37 | ||
| @@ -40,24 +40,24 @@ IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_, | |||
| 40 | 40 | ||
| 41 | IAppletCommonFunctions::~IAppletCommonFunctions() = default; | 41 | IAppletCommonFunctions::~IAppletCommonFunctions() = default; |
| 42 | 42 | ||
| 43 | void IAppletCommonFunctions::SetCpuBoostRequestPriority(HLERequestContext& ctx) { | 43 | Result IAppletCommonFunctions::GetHomeButtonDoubleClickEnabled( |
| 44 | Out<bool> out_home_button_double_click_enabled) { | ||
| 44 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 45 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 46 | *out_home_button_double_click_enabled = false; | ||
| 47 | R_SUCCEED(); | ||
| 48 | } | ||
| 45 | 49 | ||
| 46 | IPC::RequestParser rp{ctx}; | 50 | Result IAppletCommonFunctions::SetCpuBoostRequestPriority(s32 priority) { |
| 47 | 51 | LOG_WARNING(Service_AM, "(STUBBED) called"); | |
| 48 | std::scoped_lock lk{applet->lock}; | 52 | std::scoped_lock lk{applet->lock}; |
| 49 | applet->cpu_boost_request_priority = rp.Pop<s32>(); | 53 | applet->cpu_boost_request_priority = priority; |
| 50 | 54 | R_SUCCEED(); | |
| 51 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 52 | rb.Push(ResultSuccess); | ||
| 53 | } | 55 | } |
| 54 | 56 | ||
| 55 | void IAppletCommonFunctions::GetCurrentApplicationId(HLERequestContext& ctx) { | 57 | Result IAppletCommonFunctions::GetCurrentApplicationId(Out<u64> out_application_id) { |
| 56 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 58 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 57 | 59 | *out_application_id = system.GetApplicationProcessProgramID() & ~0xFFFULL; | |
| 58 | IPC::ResponseBuilder rb{ctx, 4}; | 60 | R_SUCCEED(); |
| 59 | rb.Push(ResultSuccess); | ||
| 60 | rb.Push<u64>(system.GetApplicationProcessProgramID() & ~0xFFFULL); | ||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | } // namespace Service::AM | 63 | } // namespace Service::AM |
diff --git a/src/core/hle/service/am/applet_common_functions.h b/src/core/hle/service/am/service/applet_common_functions.h index b86adf5cb..4424fc83d 100644 --- a/src/core/hle/service/am/applet_common_functions.h +++ b/src/core/hle/service/am/service/applet_common_functions.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include "core/hle/service/cmif_types.h" | ||
| 6 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 7 | 8 | ||
| 8 | namespace Service::AM { | 9 | namespace Service::AM { |
| @@ -15,8 +16,9 @@ public: | |||
| 15 | ~IAppletCommonFunctions() override; | 16 | ~IAppletCommonFunctions() override; |
| 16 | 17 | ||
| 17 | private: | 18 | private: |
| 18 | void SetCpuBoostRequestPriority(HLERequestContext& ctx); | 19 | Result GetHomeButtonDoubleClickEnabled(Out<bool> out_home_button_double_click_enabled); |
| 19 | void GetCurrentApplicationId(HLERequestContext& ctx); | 20 | Result SetCpuBoostRequestPriority(s32 priority); |
| 21 | Result GetCurrentApplicationId(Out<u64> out_application_id); | ||
| 20 | 22 | ||
| 21 | const std::shared_ptr<Applet> applet; | 23 | const std::shared_ptr<Applet> applet; |
| 22 | }; | 24 | }; |
diff --git a/src/core/hle/service/am/service/application_proxy.cpp b/src/core/hle/service/am/service/application_proxy.cpp index d28321a4a..b22960610 100644 --- a/src/core/hle/service/am/service/application_proxy.cpp +++ b/src/core/hle/service/am/service/application_proxy.cpp | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/am/applet_common_functions.h" | ||
| 5 | #include "core/hle/service/am/application_functions.h" | 4 | #include "core/hle/service/am/application_functions.h" |
| 6 | #include "core/hle/service/am/common_state_getter.h" | 5 | #include "core/hle/service/am/common_state_getter.h" |
| 7 | #include "core/hle/service/am/debug_functions.h" | 6 | #include "core/hle/service/am/debug_functions.h" |
| @@ -10,6 +9,7 @@ | |||
| 10 | #include "core/hle/service/am/library_applet_self_accessor.h" | 9 | #include "core/hle/service/am/library_applet_self_accessor.h" |
| 11 | #include "core/hle/service/am/process_winding_controller.h" | 10 | #include "core/hle/service/am/process_winding_controller.h" |
| 12 | #include "core/hle/service/am/self_controller.h" | 11 | #include "core/hle/service/am/self_controller.h" |
| 12 | #include "core/hle/service/am/service/applet_common_functions.h" | ||
| 13 | #include "core/hle/service/am/service/application_proxy.h" | 13 | #include "core/hle/service/am/service/application_proxy.h" |
| 14 | #include "core/hle/service/am/service/audio_controller.h" | 14 | #include "core/hle/service/am/service/audio_controller.h" |
| 15 | #include "core/hle/service/am/window_controller.h" | 15 | #include "core/hle/service/am/window_controller.h" |
diff --git a/src/core/hle/service/am/service/library_applet_proxy.cpp b/src/core/hle/service/am/service/library_applet_proxy.cpp index dd0f8ff11..c4ea9392a 100644 --- a/src/core/hle/service/am/service/library_applet_proxy.cpp +++ b/src/core/hle/service/am/service/library_applet_proxy.cpp | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/am/applet_common_functions.h" | ||
| 5 | #include "core/hle/service/am/common_state_getter.h" | 4 | #include "core/hle/service/am/common_state_getter.h" |
| 6 | #include "core/hle/service/am/debug_functions.h" | 5 | #include "core/hle/service/am/debug_functions.h" |
| 7 | #include "core/hle/service/am/display_controller.h" | 6 | #include "core/hle/service/am/display_controller.h" |
| @@ -11,6 +10,7 @@ | |||
| 11 | #include "core/hle/service/am/library_applet_self_accessor.h" | 10 | #include "core/hle/service/am/library_applet_self_accessor.h" |
| 12 | #include "core/hle/service/am/process_winding_controller.h" | 11 | #include "core/hle/service/am/process_winding_controller.h" |
| 13 | #include "core/hle/service/am/self_controller.h" | 12 | #include "core/hle/service/am/self_controller.h" |
| 13 | #include "core/hle/service/am/service/applet_common_functions.h" | ||
| 14 | #include "core/hle/service/am/service/audio_controller.h" | 14 | #include "core/hle/service/am/service/audio_controller.h" |
| 15 | #include "core/hle/service/am/service/library_applet_proxy.h" | 15 | #include "core/hle/service/am/service/library_applet_proxy.h" |
| 16 | #include "core/hle/service/am/window_controller.h" | 16 | #include "core/hle/service/am/window_controller.h" |
diff --git a/src/core/hle/service/am/service/system_applet_proxy.cpp b/src/core/hle/service/am/service/system_applet_proxy.cpp index cc1f83fef..c63b53ac8 100644 --- a/src/core/hle/service/am/service/system_applet_proxy.cpp +++ b/src/core/hle/service/am/service/system_applet_proxy.cpp | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/am/applet_common_functions.h" | ||
| 5 | #include "core/hle/service/am/application_creator.h" | 4 | #include "core/hle/service/am/application_creator.h" |
| 6 | #include "core/hle/service/am/common_state_getter.h" | 5 | #include "core/hle/service/am/common_state_getter.h" |
| 7 | #include "core/hle/service/am/debug_functions.h" | 6 | #include "core/hle/service/am/debug_functions.h" |
| @@ -12,6 +11,7 @@ | |||
| 12 | #include "core/hle/service/am/library_applet_self_accessor.h" | 11 | #include "core/hle/service/am/library_applet_self_accessor.h" |
| 13 | #include "core/hle/service/am/process_winding_controller.h" | 12 | #include "core/hle/service/am/process_winding_controller.h" |
| 14 | #include "core/hle/service/am/self_controller.h" | 13 | #include "core/hle/service/am/self_controller.h" |
| 14 | #include "core/hle/service/am/service/applet_common_functions.h" | ||
| 15 | #include "core/hle/service/am/service/audio_controller.h" | 15 | #include "core/hle/service/am/service/audio_controller.h" |
| 16 | #include "core/hle/service/am/service/system_applet_proxy.h" | 16 | #include "core/hle/service/am/service/system_applet_proxy.h" |
| 17 | #include "core/hle/service/am/window_controller.h" | 17 | #include "core/hle/service/am/window_controller.h" |