diff options
Diffstat (limited to 'src')
9 files changed, 187 insertions, 54 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index b5b1192b3..724ed989d 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -425,8 +425,6 @@ add_library(core STATIC | |||
| 425 | hle/service/am/applet_message_queue.h | 425 | hle/service/am/applet_message_queue.h |
| 426 | hle/service/am/application_creator.cpp | 426 | hle/service/am/application_creator.cpp |
| 427 | hle/service/am/application_creator.h | 427 | hle/service/am/application_creator.h |
| 428 | hle/service/am/global_state_controller.cpp | ||
| 429 | hle/service/am/global_state_controller.h | ||
| 430 | hle/service/am/hid_registration.cpp | 428 | hle/service/am/hid_registration.cpp |
| 431 | hle/service/am/hid_registration.h | 429 | hle/service/am/hid_registration.h |
| 432 | hle/service/am/home_menu_functions.cpp | 430 | hle/service/am/home_menu_functions.cpp |
| @@ -467,10 +465,14 @@ add_library(core STATIC | |||
| 467 | hle/service/am/service/audio_controller.h | 465 | hle/service/am/service/audio_controller.h |
| 468 | hle/service/am/service/common_state_getter.cpp | 466 | hle/service/am/service/common_state_getter.cpp |
| 469 | hle/service/am/service/common_state_getter.h | 467 | hle/service/am/service/common_state_getter.h |
| 468 | hle/service/am/service/cradle_firmware_updater.cpp | ||
| 469 | hle/service/am/service/cradle_firmware_updater.h | ||
| 470 | hle/service/am/service/debug_functions.cpp | 470 | hle/service/am/service/debug_functions.cpp |
| 471 | hle/service/am/service/debug_functions.h | 471 | hle/service/am/service/debug_functions.h |
| 472 | hle/service/am/service/display_controller.cpp | 472 | hle/service/am/service/display_controller.cpp |
| 473 | hle/service/am/service/display_controller.h | 473 | hle/service/am/service/display_controller.h |
| 474 | hle/service/am/service/global_state_controller.cpp | ||
| 475 | hle/service/am/service/global_state_controller.h | ||
| 474 | hle/service/am/service/library_applet_proxy.cpp | 476 | hle/service/am/service/library_applet_proxy.cpp |
| 475 | hle/service/am/service/library_applet_proxy.h | 477 | hle/service/am/service/library_applet_proxy.h |
| 476 | hle/service/am/service/system_applet_proxy.cpp | 478 | hle/service/am/service/system_applet_proxy.cpp |
diff --git a/src/core/hle/service/am/global_state_controller.cpp b/src/core/hle/service/am/global_state_controller.cpp deleted file mode 100644 index ed0eb7108..000000000 --- a/src/core/hle/service/am/global_state_controller.cpp +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "core/hle/service/am/global_state_controller.h" | ||
| 5 | #include "core/hle/service/ipc_helpers.h" | ||
| 6 | |||
| 7 | namespace Service::AM { | ||
| 8 | |||
| 9 | IGlobalStateController::IGlobalStateController(Core::System& system_) | ||
| 10 | : ServiceFramework{system_, "IGlobalStateController"} { | ||
| 11 | // clang-format off | ||
| 12 | static const FunctionInfo functions[] = { | ||
| 13 | {0, nullptr, "RequestToEnterSleep"}, | ||
| 14 | {1, nullptr, "EnterSleep"}, | ||
| 15 | {2, nullptr, "StartSleepSequence"}, | ||
| 16 | {3, nullptr, "StartShutdownSequence"}, | ||
| 17 | {4, nullptr, "StartRebootSequence"}, | ||
| 18 | {9, nullptr, "IsAutoPowerDownRequested"}, | ||
| 19 | {10, nullptr, "LoadAndApplyIdlePolicySettings"}, | ||
| 20 | {11, nullptr, "NotifyCecSettingsChanged"}, | ||
| 21 | {12, nullptr, "SetDefaultHomeButtonLongPressTime"}, | ||
| 22 | {13, nullptr, "UpdateDefaultDisplayResolution"}, | ||
| 23 | {14, nullptr, "ShouldSleepOnBoot"}, | ||
| 24 | {15, nullptr, "GetHdcpAuthenticationFailedEvent"}, | ||
| 25 | {30, nullptr, "OpenCradleFirmwareUpdater"}, | ||
| 26 | }; | ||
| 27 | // clang-format on | ||
| 28 | |||
| 29 | RegisterHandlers(functions); | ||
| 30 | } | ||
| 31 | |||
| 32 | IGlobalStateController::~IGlobalStateController() = default; | ||
| 33 | |||
| 34 | } // namespace Service::AM | ||
diff --git a/src/core/hle/service/am/global_state_controller.h b/src/core/hle/service/am/global_state_controller.h deleted file mode 100644 index 7125464a1..000000000 --- a/src/core/hle/service/am/global_state_controller.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "core/hle/service/service.h" | ||
| 7 | |||
| 8 | namespace Service::AM { | ||
| 9 | |||
| 10 | class IGlobalStateController final : public ServiceFramework<IGlobalStateController> { | ||
| 11 | public: | ||
| 12 | explicit IGlobalStateController(Core::System& system_); | ||
| 13 | ~IGlobalStateController() override; | ||
| 14 | }; | ||
| 15 | |||
| 16 | } // namespace Service::AM | ||
diff --git a/src/core/hle/service/am/service/cradle_firmware_updater.cpp b/src/core/hle/service/am/service/cradle_firmware_updater.cpp new file mode 100644 index 000000000..0a8af0858 --- /dev/null +++ b/src/core/hle/service/am/service/cradle_firmware_updater.cpp | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "core/hle/service/am/service/cradle_firmware_updater.h" | ||
| 5 | #include "core/hle/service/cmif_serialization.h" | ||
| 6 | |||
| 7 | namespace Service::AM { | ||
| 8 | |||
| 9 | ICradleFirmwareUpdater::ICradleFirmwareUpdater(Core::System& system_) | ||
| 10 | : ServiceFramework{system_, "ICradleFirmwareUpdater"}, | ||
| 11 | m_context{system, "ICradleFirmwareUpdater"}, m_cradle_device_info_event{m_context} { | ||
| 12 | // clang-format off | ||
| 13 | static const FunctionInfo functions[] = { | ||
| 14 | {0, D<&ICradleFirmwareUpdater::StartUpdate>, "StartUpdate"}, | ||
| 15 | {1, D<&ICradleFirmwareUpdater::FinishUpdate>, "FinishUpdate"}, | ||
| 16 | {2, D<&ICradleFirmwareUpdater::GetCradleDeviceInfo>, "GetCradleDeviceInfo"}, | ||
| 17 | {3, D<&ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent>, "GetCradleDeviceInfoChangeEvent"}, | ||
| 18 | {4, nullptr, "GetUpdateProgressInfo"}, | ||
| 19 | {5, nullptr, "GetLastInternalResult"}, | ||
| 20 | |||
| 21 | }; | ||
| 22 | // clang-format on | ||
| 23 | |||
| 24 | RegisterHandlers(functions); | ||
| 25 | } | ||
| 26 | |||
| 27 | ICradleFirmwareUpdater::~ICradleFirmwareUpdater() = default; | ||
| 28 | |||
| 29 | Result ICradleFirmwareUpdater::StartUpdate() { | ||
| 30 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 31 | R_SUCCEED(); | ||
| 32 | } | ||
| 33 | |||
| 34 | Result ICradleFirmwareUpdater::FinishUpdate() { | ||
| 35 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 36 | R_SUCCEED(); | ||
| 37 | } | ||
| 38 | |||
| 39 | Result ICradleFirmwareUpdater::GetCradleDeviceInfo(Out<CradleDeviceInfo> out_cradle_device_info) { | ||
| 40 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 41 | *out_cradle_device_info = {}; | ||
| 42 | R_SUCCEED(); | ||
| 43 | } | ||
| 44 | |||
| 45 | Result ICradleFirmwareUpdater::GetCradleDeviceInfoChangeEvent( | ||
| 46 | OutCopyHandle<Kernel::KReadableEvent> out_event) { | ||
| 47 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 48 | *out_event = m_cradle_device_info_event.GetHandle(); | ||
| 49 | R_SUCCEED(); | ||
| 50 | } | ||
| 51 | |||
| 52 | } // namespace Service::AM | ||
diff --git a/src/core/hle/service/am/service/cradle_firmware_updater.h b/src/core/hle/service/am/service/cradle_firmware_updater.h new file mode 100644 index 000000000..3e803f0ae --- /dev/null +++ b/src/core/hle/service/am/service/cradle_firmware_updater.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "core/hle/service/cmif_types.h" | ||
| 7 | #include "core/hle/service/kernel_helpers.h" | ||
| 8 | #include "core/hle/service/os/event.h" | ||
| 9 | #include "core/hle/service/service.h" | ||
| 10 | |||
| 11 | namespace Service::AM { | ||
| 12 | |||
| 13 | struct CradleDeviceInfo { | ||
| 14 | bool unknown0; | ||
| 15 | bool unknown1; | ||
| 16 | bool unknown2; | ||
| 17 | u64 unknown3; | ||
| 18 | }; | ||
| 19 | static_assert(sizeof(CradleDeviceInfo) == 0x10, "CradleDeviceInfo has incorrect size"); | ||
| 20 | |||
| 21 | class ICradleFirmwareUpdater final : public ServiceFramework<ICradleFirmwareUpdater> { | ||
| 22 | public: | ||
| 23 | explicit ICradleFirmwareUpdater(Core::System& system_); | ||
| 24 | ~ICradleFirmwareUpdater() override; | ||
| 25 | |||
| 26 | private: | ||
| 27 | Result StartUpdate(); | ||
| 28 | Result FinishUpdate(); | ||
| 29 | Result GetCradleDeviceInfo(Out<CradleDeviceInfo> out_cradle_device_info); | ||
| 30 | Result GetCradleDeviceInfoChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); | ||
| 31 | |||
| 32 | private: | ||
| 33 | KernelHelpers::ServiceContext m_context; | ||
| 34 | Event m_cradle_device_info_event; | ||
| 35 | }; | ||
| 36 | |||
| 37 | } // namespace Service::AM | ||
diff --git a/src/core/hle/service/am/service/global_state_controller.cpp b/src/core/hle/service/am/service/global_state_controller.cpp new file mode 100644 index 000000000..dba5d3613 --- /dev/null +++ b/src/core/hle/service/am/service/global_state_controller.cpp | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "core/hle/service/am/service/cradle_firmware_updater.h" | ||
| 5 | #include "core/hle/service/am/service/global_state_controller.h" | ||
| 6 | #include "core/hle/service/cmif_serialization.h" | ||
| 7 | |||
| 8 | namespace Service::AM { | ||
| 9 | |||
| 10 | IGlobalStateController::IGlobalStateController(Core::System& system_) | ||
| 11 | : ServiceFramework{system_, "IGlobalStateController"}, | ||
| 12 | m_context{system_, "IGlobalStateController"}, m_hdcp_authentication_failed_event{m_context} { | ||
| 13 | // clang-format off | ||
| 14 | static const FunctionInfo functions[] = { | ||
| 15 | {0, nullptr, "RequestToEnterSleep"}, | ||
| 16 | {1, nullptr, "EnterSleep"}, | ||
| 17 | {2, nullptr, "StartSleepSequence"}, | ||
| 18 | {3, nullptr, "StartShutdownSequence"}, | ||
| 19 | {4, nullptr, "StartRebootSequence"}, | ||
| 20 | {9, nullptr, "IsAutoPowerDownRequested"}, | ||
| 21 | {10, D<&IGlobalStateController::LoadAndApplyIdlePolicySettings>, "LoadAndApplyIdlePolicySettings"}, | ||
| 22 | {11, nullptr, "NotifyCecSettingsChanged"}, | ||
| 23 | {12, nullptr, "SetDefaultHomeButtonLongPressTime"}, | ||
| 24 | {13, nullptr, "UpdateDefaultDisplayResolution"}, | ||
| 25 | {14, D<&IGlobalStateController::ShouldSleepOnBoot>, "ShouldSleepOnBoot"}, | ||
| 26 | {15, D<&IGlobalStateController::GetHdcpAuthenticationFailedEvent>, "GetHdcpAuthenticationFailedEvent"}, | ||
| 27 | {30, D<&IGlobalStateController::OpenCradleFirmwareUpdater>, "OpenCradleFirmwareUpdater"}, | ||
| 28 | }; | ||
| 29 | // clang-format on | ||
| 30 | |||
| 31 | RegisterHandlers(functions); | ||
| 32 | } | ||
| 33 | |||
| 34 | IGlobalStateController::~IGlobalStateController() = default; | ||
| 35 | |||
| 36 | Result IGlobalStateController::LoadAndApplyIdlePolicySettings() { | ||
| 37 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 38 | R_SUCCEED(); | ||
| 39 | } | ||
| 40 | |||
| 41 | Result IGlobalStateController::ShouldSleepOnBoot(Out<bool> out_should_sleep_on_boot) { | ||
| 42 | LOG_INFO(Service_AM, "called"); | ||
| 43 | *out_should_sleep_on_boot = false; | ||
| 44 | R_SUCCEED(); | ||
| 45 | } | ||
| 46 | |||
| 47 | Result IGlobalStateController::GetHdcpAuthenticationFailedEvent( | ||
| 48 | OutCopyHandle<Kernel::KReadableEvent> out_event) { | ||
| 49 | LOG_INFO(Service_AM, "called"); | ||
| 50 | *out_event = m_hdcp_authentication_failed_event.GetHandle(); | ||
| 51 | R_SUCCEED(); | ||
| 52 | } | ||
| 53 | |||
| 54 | Result IGlobalStateController::OpenCradleFirmwareUpdater( | ||
| 55 | Out<SharedPointer<ICradleFirmwareUpdater>> out_cradle_firmware_updater) { | ||
| 56 | LOG_INFO(Service_AM, "called"); | ||
| 57 | *out_cradle_firmware_updater = std::make_shared<ICradleFirmwareUpdater>(system); | ||
| 58 | R_SUCCEED(); | ||
| 59 | } | ||
| 60 | |||
| 61 | } // namespace Service::AM | ||
diff --git a/src/core/hle/service/am/service/global_state_controller.h b/src/core/hle/service/am/service/global_state_controller.h new file mode 100644 index 000000000..67c753513 --- /dev/null +++ b/src/core/hle/service/am/service/global_state_controller.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "core/hle/service/cmif_types.h" | ||
| 7 | #include "core/hle/service/kernel_helpers.h" | ||
| 8 | #include "core/hle/service/os/event.h" | ||
| 9 | #include "core/hle/service/service.h" | ||
| 10 | |||
| 11 | namespace Service::AM { | ||
| 12 | |||
| 13 | class ICradleFirmwareUpdater; | ||
| 14 | |||
| 15 | class IGlobalStateController final : public ServiceFramework<IGlobalStateController> { | ||
| 16 | public: | ||
| 17 | explicit IGlobalStateController(Core::System& system_); | ||
| 18 | ~IGlobalStateController() override; | ||
| 19 | |||
| 20 | private: | ||
| 21 | Result LoadAndApplyIdlePolicySettings(); | ||
| 22 | Result ShouldSleepOnBoot(Out<bool> out_should_sleep_on_boot); | ||
| 23 | Result GetHdcpAuthenticationFailedEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); | ||
| 24 | Result OpenCradleFirmwareUpdater( | ||
| 25 | Out<SharedPointer<ICradleFirmwareUpdater>> out_cradle_firmware_updater); | ||
| 26 | |||
| 27 | KernelHelpers::ServiceContext m_context; | ||
| 28 | Event m_hdcp_authentication_failed_event; | ||
| 29 | }; | ||
| 30 | |||
| 31 | } // namespace Service::AM | ||
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 589d53c20..7b5e9717d 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/global_state_controller.h" | ||
| 5 | #include "core/hle/service/am/home_menu_functions.h" | 4 | #include "core/hle/service/am/home_menu_functions.h" |
| 6 | #include "core/hle/service/am/library_applet_creator.h" | 5 | #include "core/hle/service/am/library_applet_creator.h" |
| 7 | #include "core/hle/service/am/library_applet_self_accessor.h" | 6 | #include "core/hle/service/am/library_applet_self_accessor.h" |
| @@ -12,6 +11,7 @@ | |||
| 12 | #include "core/hle/service/am/service/common_state_getter.h" | 11 | #include "core/hle/service/am/service/common_state_getter.h" |
| 13 | #include "core/hle/service/am/service/debug_functions.h" | 12 | #include "core/hle/service/am/service/debug_functions.h" |
| 14 | #include "core/hle/service/am/service/display_controller.h" | 13 | #include "core/hle/service/am/service/display_controller.h" |
| 14 | #include "core/hle/service/am/service/global_state_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" |
| 17 | #include "core/hle/service/cmif_serialization.h" | 17 | #include "core/hle/service/cmif_serialization.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 4bfbd1067..077f6eea7 100644 --- a/src/core/hle/service/am/service/system_applet_proxy.cpp +++ b/src/core/hle/service/am/service/system_applet_proxy.cpp | |||
| @@ -2,7 +2,6 @@ | |||
| 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/application_creator.h" | 4 | #include "core/hle/service/am/application_creator.h" |
| 5 | #include "core/hle/service/am/global_state_controller.h" | ||
| 6 | #include "core/hle/service/am/home_menu_functions.h" | 5 | #include "core/hle/service/am/home_menu_functions.h" |
| 7 | #include "core/hle/service/am/library_applet_creator.h" | 6 | #include "core/hle/service/am/library_applet_creator.h" |
| 8 | #include "core/hle/service/am/library_applet_self_accessor.h" | 7 | #include "core/hle/service/am/library_applet_self_accessor.h" |
| @@ -13,6 +12,7 @@ | |||
| 13 | #include "core/hle/service/am/service/common_state_getter.h" | 12 | #include "core/hle/service/am/service/common_state_getter.h" |
| 14 | #include "core/hle/service/am/service/debug_functions.h" | 13 | #include "core/hle/service/am/service/debug_functions.h" |
| 15 | #include "core/hle/service/am/service/display_controller.h" | 14 | #include "core/hle/service/am/service/display_controller.h" |
| 15 | #include "core/hle/service/am/service/global_state_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" |
| 18 | #include "core/hle/service/cmif_serialization.h" | 18 | #include "core/hle/service/cmif_serialization.h" |