summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/hle/service/am/home_menu_functions.cpp57
-rw-r--r--src/core/hle/service/am/home_menu_functions.h25
-rw-r--r--src/core/hle/service/am/service/home_menu_functions.cpp74
-rw-r--r--src/core/hle/service/am/service/home_menu_functions.h34
-rw-r--r--src/core/hle/service/am/service/library_applet_proxy.cpp4
-rw-r--r--src/core/hle/service/am/service/system_applet_proxy.cpp4
7 files changed, 114 insertions, 88 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 724ed989d..ae2fe0b68 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -427,8 +427,6 @@ add_library(core STATIC
427 hle/service/am/application_creator.h 427 hle/service/am/application_creator.h
428 hle/service/am/hid_registration.cpp 428 hle/service/am/hid_registration.cpp
429 hle/service/am/hid_registration.h 429 hle/service/am/hid_registration.h
430 hle/service/am/home_menu_functions.cpp
431 hle/service/am/home_menu_functions.h
432 hle/service/am/idle.cpp 430 hle/service/am/idle.cpp
433 hle/service/am/idle.h 431 hle/service/am/idle.h
434 hle/service/am/library_applet_accessor.cpp 432 hle/service/am/library_applet_accessor.cpp
@@ -473,6 +471,8 @@ add_library(core STATIC
473 hle/service/am/service/display_controller.h 471 hle/service/am/service/display_controller.h
474 hle/service/am/service/global_state_controller.cpp 472 hle/service/am/service/global_state_controller.cpp
475 hle/service/am/service/global_state_controller.h 473 hle/service/am/service/global_state_controller.h
474 hle/service/am/service/home_menu_functions.cpp
475 hle/service/am/service/home_menu_functions.h
476 hle/service/am/service/library_applet_proxy.cpp 476 hle/service/am/service/library_applet_proxy.cpp
477 hle/service/am/service/library_applet_proxy.h 477 hle/service/am/service/library_applet_proxy.h
478 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/home_menu_functions.cpp b/src/core/hle/service/am/home_menu_functions.cpp
deleted file mode 100644
index 640e9fbb7..000000000
--- a/src/core/hle/service/am/home_menu_functions.cpp
+++ /dev/null
@@ -1,57 +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/home_menu_functions.h"
5#include "core/hle/service/ipc_helpers.h"
6
7namespace Service::AM {
8
9IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_)
10 : ServiceFramework{system_, "IHomeMenuFunctions"}, service_context{system,
11 "IHomeMenuFunctions"} {
12 // clang-format off
13 static const FunctionInfo functions[] = {
14 {10, &IHomeMenuFunctions::RequestToGetForeground, "RequestToGetForeground"},
15 {11, nullptr, "LockForeground"},
16 {12, nullptr, "UnlockForeground"},
17 {20, nullptr, "PopFromGeneralChannel"},
18 {21, &IHomeMenuFunctions::GetPopFromGeneralChannelEvent, "GetPopFromGeneralChannelEvent"},
19 {30, nullptr, "GetHomeButtonWriterLockAccessor"},
20 {31, nullptr, "GetWriterLockAccessorEx"},
21 {40, nullptr, "IsSleepEnabled"},
22 {41, nullptr, "IsRebootEnabled"},
23 {50, nullptr, "LaunchSystemApplet"},
24 {51, nullptr, "LaunchStarter"},
25 {100, nullptr, "PopRequestLaunchApplicationForDebug"},
26 {110, nullptr, "IsForceTerminateApplicationDisabledForDebug"},
27 {200, nullptr, "LaunchDevMenu"},
28 {1000, nullptr, "SetLastApplicationExitReason"},
29 };
30 // clang-format on
31
32 RegisterHandlers(functions);
33
34 pop_from_general_channel_event =
35 service_context.CreateEvent("IHomeMenuFunctions:PopFromGeneralChannelEvent");
36}
37
38IHomeMenuFunctions::~IHomeMenuFunctions() {
39 service_context.CloseEvent(pop_from_general_channel_event);
40}
41
42void IHomeMenuFunctions::RequestToGetForeground(HLERequestContext& ctx) {
43 LOG_WARNING(Service_AM, "(STUBBED) called");
44
45 IPC::ResponseBuilder rb{ctx, 2};
46 rb.Push(ResultSuccess);
47}
48
49void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(HLERequestContext& ctx) {
50 LOG_WARNING(Service_AM, "(STUBBED) called");
51
52 IPC::ResponseBuilder rb{ctx, 2, 1};
53 rb.Push(ResultSuccess);
54 rb.PushCopyObjects(pop_from_general_channel_event->GetReadableEvent());
55}
56
57} // namespace Service::AM
diff --git a/src/core/hle/service/am/home_menu_functions.h b/src/core/hle/service/am/home_menu_functions.h
deleted file mode 100644
index e082d5d73..000000000
--- a/src/core/hle/service/am/home_menu_functions.h
+++ /dev/null
@@ -1,25 +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/kernel_helpers.h"
7#include "core/hle/service/service.h"
8
9namespace Service::AM {
10
11class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {
12public:
13 explicit IHomeMenuFunctions(Core::System& system_);
14 ~IHomeMenuFunctions() override;
15
16private:
17 void RequestToGetForeground(HLERequestContext& ctx);
18 void GetPopFromGeneralChannelEvent(HLERequestContext& ctx);
19
20 KernelHelpers::ServiceContext service_context;
21
22 Kernel::KEvent* pop_from_general_channel_event;
23};
24
25} // namespace Service::AM
diff --git a/src/core/hle/service/am/service/home_menu_functions.cpp b/src/core/hle/service/am/service/home_menu_functions.cpp
new file mode 100644
index 000000000..0c4d24b58
--- /dev/null
+++ b/src/core/hle/service/am/service/home_menu_functions.cpp
@@ -0,0 +1,74 @@
1// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#include "core/hle/result.h"
5#include "core/hle/service/am/applet_manager.h"
6#include "core/hle/service/am/service/home_menu_functions.h"
7#include "core/hle/service/cmif_serialization.h"
8
9namespace Service::AM {
10
11IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_, std::shared_ptr<Applet> applet)
12 : ServiceFramework{system_, "IHomeMenuFunctions"}, m_applet{std::move(applet)},
13 m_context{system, "IHomeMenuFunctions"}, m_pop_from_general_channel_event{m_context} {
14 // clang-format off
15 static const FunctionInfo functions[] = {
16 {10, D<&IHomeMenuFunctions::RequestToGetForeground>, "RequestToGetForeground"},
17 {11, D<&IHomeMenuFunctions::LockForeground>, "LockForeground"},
18 {12, D<&IHomeMenuFunctions::UnlockForeground>, "UnlockForeground"},
19 {20, nullptr, "PopFromGeneralChannel"},
20 {21, D<&IHomeMenuFunctions::GetPopFromGeneralChannelEvent>, "GetPopFromGeneralChannelEvent"},
21 {30, nullptr, "GetHomeButtonWriterLockAccessor"},
22 {31, nullptr, "GetWriterLockAccessorEx"},
23 {40, nullptr, "IsSleepEnabled"},
24 {41, D<&IHomeMenuFunctions::IsRebootEnabled>, "IsRebootEnabled"},
25 {50, nullptr, "LaunchSystemApplet"},
26 {51, nullptr, "LaunchStarter"},
27 {100, nullptr, "PopRequestLaunchApplicationForDebug"},
28 {110, D<&IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug>, "IsForceTerminateApplicationDisabledForDebug"},
29 {200, nullptr, "LaunchDevMenu"},
30 {1000, nullptr, "SetLastApplicationExitReason"},
31 };
32 // clang-format on
33
34 RegisterHandlers(functions);
35}
36
37IHomeMenuFunctions::~IHomeMenuFunctions() = default;
38
39Result IHomeMenuFunctions::RequestToGetForeground() {
40 LOG_WARNING(Service_AM, "(STUBBED) called");
41 R_SUCCEED();
42}
43
44Result IHomeMenuFunctions::LockForeground() {
45 LOG_WARNING(Service_AM, "(STUBBED) called");
46 R_SUCCEED();
47}
48
49Result IHomeMenuFunctions::UnlockForeground() {
50 LOG_WARNING(Service_AM, "(STUBBED) called");
51 R_SUCCEED();
52}
53
54Result IHomeMenuFunctions::GetPopFromGeneralChannelEvent(
55 OutCopyHandle<Kernel::KReadableEvent> out_event) {
56 LOG_INFO(Service_AM, "called");
57 *out_event = m_pop_from_general_channel_event.GetHandle();
58 R_SUCCEED();
59}
60
61Result IHomeMenuFunctions::IsRebootEnabled(Out<bool> out_is_reboot_enbaled) {
62 LOG_INFO(Service_AM, "called");
63 *out_is_reboot_enbaled = true;
64 R_SUCCEED();
65}
66
67Result IHomeMenuFunctions::IsForceTerminateApplicationDisabledForDebug(
68 Out<bool> out_is_force_terminate_application_disabled_for_debug) {
69 LOG_INFO(Service_AM, "called");
70 *out_is_force_terminate_application_disabled_for_debug = false;
71 R_SUCCEED();
72}
73
74} // namespace Service::AM
diff --git a/src/core/hle/service/am/service/home_menu_functions.h b/src/core/hle/service/am/service/home_menu_functions.h
new file mode 100644
index 000000000..caf6fbaab
--- /dev/null
+++ b/src/core/hle/service/am/service/home_menu_functions.h
@@ -0,0 +1,34 @@
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
11namespace Service::AM {
12
13struct Applet;
14
15class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {
16public:
17 explicit IHomeMenuFunctions(Core::System& system_, std::shared_ptr<Applet> applet);
18 ~IHomeMenuFunctions() override;
19
20private:
21 Result RequestToGetForeground();
22 Result LockForeground();
23 Result UnlockForeground();
24 Result GetPopFromGeneralChannelEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
25 Result IsRebootEnabled(Out<bool> out_is_reboot_enbaled);
26 Result IsForceTerminateApplicationDisabledForDebug(
27 Out<bool> out_is_force_terminate_application_disabled_for_debug);
28
29 const std::shared_ptr<Applet> m_applet;
30 KernelHelpers::ServiceContext m_context;
31 Event m_pop_from_general_channel_event;
32};
33
34} // 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 7b5e9717d..cf1a34db2 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/home_menu_functions.h"
5#include "core/hle/service/am/library_applet_creator.h" 4#include "core/hle/service/am/library_applet_creator.h"
6#include "core/hle/service/am/library_applet_self_accessor.h" 5#include "core/hle/service/am/library_applet_self_accessor.h"
7#include "core/hle/service/am/process_winding_controller.h" 6#include "core/hle/service/am/process_winding_controller.h"
@@ -12,6 +11,7 @@
12#include "core/hle/service/am/service/debug_functions.h" 11#include "core/hle/service/am/service/debug_functions.h"
13#include "core/hle/service/am/service/display_controller.h" 12#include "core/hle/service/am/service/display_controller.h"
14#include "core/hle/service/am/service/global_state_controller.h" 13#include "core/hle/service/am/service/global_state_controller.h"
14#include "core/hle/service/am/service/home_menu_functions.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"
@@ -119,7 +119,7 @@ Result ILibraryAppletProxy::GetAppletCommonFunctions(
119Result ILibraryAppletProxy::GetHomeMenuFunctions( 119Result ILibraryAppletProxy::GetHomeMenuFunctions(
120 Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions) { 120 Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions) {
121 LOG_DEBUG(Service_AM, "called"); 121 LOG_DEBUG(Service_AM, "called");
122 *out_home_menu_functions = std::make_shared<IHomeMenuFunctions>(system); 122 *out_home_menu_functions = std::make_shared<IHomeMenuFunctions>(system, m_applet);
123 R_SUCCEED(); 123 R_SUCCEED();
124} 124}
125 125
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 077f6eea7..8fa852cfa 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/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"
8#include "core/hle/service/am/process_winding_controller.h" 7#include "core/hle/service/am/process_winding_controller.h"
@@ -13,6 +12,7 @@
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"
15#include "core/hle/service/am/service/global_state_controller.h" 14#include "core/hle/service/am/service/global_state_controller.h"
15#include "core/hle/service/am/service/home_menu_functions.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"
@@ -118,7 +118,7 @@ Result ISystemAppletProxy::GetAppletCommonFunctions(
118Result ISystemAppletProxy::GetHomeMenuFunctions( 118Result ISystemAppletProxy::GetHomeMenuFunctions(
119 Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions) { 119 Out<SharedPointer<IHomeMenuFunctions>> out_home_menu_functions) {
120 LOG_DEBUG(Service_AM, "called"); 120 LOG_DEBUG(Service_AM, "called");
121 *out_home_menu_functions = std::make_shared<IHomeMenuFunctions>(system); 121 *out_home_menu_functions = std::make_shared<IHomeMenuFunctions>(system, m_applet);
122 R_SUCCEED(); 122 R_SUCCEED();
123} 123}
124 124