summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/am.cpp79
-rw-r--r--src/core/hle/service/am/am.h25
-rw-r--r--src/core/hle/service/am/applet_ae.cpp120
-rw-r--r--src/core/hle/service/am/applet_ae.h2
4 files changed, 221 insertions, 5 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index d93afbed7..e78cef552 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -103,7 +103,7 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger
103 {40, &ISelfController::CreateManagedDisplayLayer, "CreateManagedDisplayLayer"}, 103 {40, &ISelfController::CreateManagedDisplayLayer, "CreateManagedDisplayLayer"},
104 {41, nullptr, "IsSystemBufferSharingEnabled"}, 104 {41, nullptr, "IsSystemBufferSharingEnabled"},
105 {42, nullptr, "GetSystemSharedLayerHandle"}, 105 {42, nullptr, "GetSystemSharedLayerHandle"},
106 {50, nullptr, "SetHandlesRequestToDisplay"}, 106 {50, &ISelfController::SetHandlesRequestToDisplay, "SetHandlesRequestToDisplay"},
107 {51, nullptr, "ApproveToDisplay"}, 107 {51, nullptr, "ApproveToDisplay"},
108 {60, nullptr, "OverrideAutoSleepTimeAndDimmingTime"}, 108 {60, nullptr, "OverrideAutoSleepTimeAndDimmingTime"},
109 {61, nullptr, "SetMediaPlaybackState"}, 109 {61, nullptr, "SetMediaPlaybackState"},
@@ -229,6 +229,13 @@ void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx)
229 NGLOG_WARNING(Service_AM, "(STUBBED) called"); 229 NGLOG_WARNING(Service_AM, "(STUBBED) called");
230} 230}
231 231
232void ISelfController::SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx) {
233 IPC::ResponseBuilder rb{ctx, 2};
234 rb.Push(RESULT_SUCCESS);
235
236 NGLOG_WARNING(Service_AM, "(STUBBED) called");
237}
238
232ICommonStateGetter::ICommonStateGetter() : ServiceFramework("ICommonStateGetter") { 239ICommonStateGetter::ICommonStateGetter() : ServiceFramework("ICommonStateGetter") {
233 static const FunctionInfo functions[] = { 240 static const FunctionInfo functions[] = {
234 {0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"}, 241 {0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"},
@@ -445,7 +452,8 @@ IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationF
445 {10, nullptr, "CreateApplicationAndPushAndRequestToStart"}, 452 {10, nullptr, "CreateApplicationAndPushAndRequestToStart"},
446 {11, nullptr, "CreateApplicationAndPushAndRequestToStartForQuest"}, 453 {11, nullptr, "CreateApplicationAndPushAndRequestToStartForQuest"},
447 {12, nullptr, "CreateApplicationAndRequestToStart"}, 454 {12, nullptr, "CreateApplicationAndRequestToStart"},
448 {13, nullptr, "CreateApplicationAndRequestToStartForQuest"}, 455 {13, &IApplicationFunctions::CreateApplicationAndRequestToStartForQuest,
456 "CreateApplicationAndRequestToStartForQuest"},
449 {20, &IApplicationFunctions::EnsureSaveData, "EnsureSaveData"}, 457 {20, &IApplicationFunctions::EnsureSaveData, "EnsureSaveData"},
450 {21, &IApplicationFunctions::GetDesiredLanguage, "GetDesiredLanguage"}, 458 {21, &IApplicationFunctions::GetDesiredLanguage, "GetDesiredLanguage"},
451 {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"}, 459 {22, &IApplicationFunctions::SetTerminateResult, "SetTerminateResult"},
@@ -502,6 +510,13 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
502 NGLOG_DEBUG(Service_AM, "called"); 510 NGLOG_DEBUG(Service_AM, "called");
503} 511}
504 512
513void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(
514 Kernel::HLERequestContext& ctx) {
515 IPC::ResponseBuilder rb{ctx, 2};
516 rb.Push(RESULT_SUCCESS);
517 NGLOG_WARNING(Service_AM, "(STUBBED) called");
518}
519
505void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) { 520void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
506 IPC::RequestParser rp{ctx}; 521 IPC::RequestParser rp{ctx};
507 u128 uid = rp.PopRaw<u128>(); 522 u128 uid = rp.PopRaw<u128>();
@@ -572,4 +587,64 @@ void InstallInterfaces(SM::ServiceManager& service_manager,
572 std::make_shared<AppletOE>(nvflinger)->InstallAsService(service_manager); 587 std::make_shared<AppletOE>(nvflinger)->InstallAsService(service_manager);
573} 588}
574 589
590IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions") {
591 static const FunctionInfo functions[] = {
592 {10, &IHomeMenuFunctions::RequestToGetForeground, "RequestToGetForeground"},
593 {11, nullptr, "LockForeground"},
594 {12, nullptr, "UnlockForeground"},
595 {20, nullptr, "PopFromGeneralChannel"},
596 {21, nullptr, "GetPopFromGeneralChannelEvent"},
597 {30, nullptr, "GetHomeButtonWriterLockAccessor"},
598 {31, nullptr, "GetWriterLockAccessorEx"},
599 };
600 RegisterHandlers(functions);
601}
602
603void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx) {
604 IPC::ResponseBuilder rb{ctx, 2};
605 rb.Push(RESULT_SUCCESS);
606 NGLOG_WARNING(Service_AM, "(STUBBED) called");
607}
608
609IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStateController") {
610 static const FunctionInfo functions[] = {
611 {0, nullptr, "RequestToEnterSleep"},
612 {1, nullptr, "EnterSleep"},
613 {2, nullptr, "StartSleepSequence"},
614 {3, nullptr, "StartShutdownSequence"},
615 {4, nullptr, "StartRebootSequence"},
616 {10, nullptr, "LoadAndApplyIdlePolicySettings"},
617 {11, nullptr, "NotifyCecSettingsChanged"},
618 {12, nullptr, "SetDefaultHomeButtonLongPressTime"},
619 {13, nullptr, "UpdateDefaultDisplayResolution"},
620 {14, nullptr, "ShouldSleepOnBoot"},
621 {15, nullptr, "GetHdcpAuthenticationFailedEvent"},
622 };
623 RegisterHandlers(functions);
624}
625
626IApplicationCreator::IApplicationCreator() : ServiceFramework("IApplicationCreator") {
627 static const FunctionInfo functions[] = {
628 {0, nullptr, "CreateApplication"},
629 {1, nullptr, "PopLaunchRequestedApplication"},
630 {10, nullptr, "CreateSystemApplication"},
631 {100, nullptr, "PopFloatingApplicationForDevelopment"},
632 };
633 RegisterHandlers(functions);
634}
635
636IProcessWindingController::IProcessWindingController()
637 : ServiceFramework("IProcessWindingController") {
638 static const FunctionInfo functions[] = {
639 {0, nullptr, "GetLaunchReason"},
640 {11, nullptr, "OpenCallingLibraryApplet"},
641 {21, nullptr, "PushContext"},
642 {22, nullptr, "PopContext"},
643 {23, nullptr, "CancelWindingReservation"},
644 {30, nullptr, "WindAndDoReserved"},
645 {40, nullptr, "ReserveToStartAndWaitAndUnwindThis"},
646 {41, nullptr, "ReserveToStartAndWait"},
647 };
648 RegisterHandlers(functions);
649}
575} // namespace Service::AM 650} // namespace Service::AM
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 27dbd8c95..5b3d416f3 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -70,6 +70,7 @@ private:
70 void GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx); 70 void GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx);
71 void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx); 71 void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx);
72 void SetScreenShotPermission(Kernel::HLERequestContext& ctx); 72 void SetScreenShotPermission(Kernel::HLERequestContext& ctx);
73 void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx);
73 74
74 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 75 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
75 Kernel::SharedPtr<Kernel::Event> launchable_event; 76 Kernel::SharedPtr<Kernel::Event> launchable_event;
@@ -113,6 +114,7 @@ public:
113 114
114private: 115private:
115 void PopLaunchParameter(Kernel::HLERequestContext& ctx); 116 void PopLaunchParameter(Kernel::HLERequestContext& ctx);
117 void CreateApplicationAndRequestToStartForQuest(Kernel::HLERequestContext& ctx);
116 void EnsureSaveData(Kernel::HLERequestContext& ctx); 118 void EnsureSaveData(Kernel::HLERequestContext& ctx);
117 void SetTerminateResult(Kernel::HLERequestContext& ctx); 119 void SetTerminateResult(Kernel::HLERequestContext& ctx);
118 void GetDesiredLanguage(Kernel::HLERequestContext& ctx); 120 void GetDesiredLanguage(Kernel::HLERequestContext& ctx);
@@ -121,6 +123,29 @@ private:
121 void NotifyRunning(Kernel::HLERequestContext& ctx); 123 void NotifyRunning(Kernel::HLERequestContext& ctx);
122}; 124};
123 125
126class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {
127public:
128 IHomeMenuFunctions();
129
130private:
131 void RequestToGetForeground(Kernel::HLERequestContext& ctx);
132};
133
134class IGlobalStateController final : public ServiceFramework<IGlobalStateController> {
135public:
136 IGlobalStateController();
137};
138
139class IApplicationCreator final : public ServiceFramework<IApplicationCreator> {
140public:
141 IApplicationCreator();
142};
143
144class IProcessWindingController final : public ServiceFramework<IProcessWindingController> {
145public:
146 IProcessWindingController();
147};
148
124/// Registers all AM services with the specified service manager. 149/// Registers all AM services with the specified service manager.
125void InstallInterfaces(SM::ServiceManager& service_manager, 150void InstallInterfaces(SM::ServiceManager& service_manager,
126 std::shared_ptr<NVFlinger::NVFlinger> nvflinger); 151 std::shared_ptr<NVFlinger::NVFlinger> nvflinger);
diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cpp
index 8951980cf..7ce551de3 100644
--- a/src/core/hle/service/am/applet_ae.cpp
+++ b/src/core/hle/service/am/applet_ae.cpp
@@ -20,7 +20,7 @@ public:
20 {2, &ILibraryAppletProxy::GetWindowController, "GetWindowController"}, 20 {2, &ILibraryAppletProxy::GetWindowController, "GetWindowController"},
21 {3, &ILibraryAppletProxy::GetAudioController, "GetAudioController"}, 21 {3, &ILibraryAppletProxy::GetAudioController, "GetAudioController"},
22 {4, &ILibraryAppletProxy::GetDisplayController, "GetDisplayController"}, 22 {4, &ILibraryAppletProxy::GetDisplayController, "GetDisplayController"},
23 {10, nullptr, "GetProcessWindingController"}, 23 {10, &ILibraryAppletProxy::GetProcessWindingController, "GetProcessWindingController"},
24 {11, &ILibraryAppletProxy::GetLibraryAppletCreator, "GetLibraryAppletCreator"}, 24 {11, &ILibraryAppletProxy::GetLibraryAppletCreator, "GetLibraryAppletCreator"},
25 {20, &ILibraryAppletProxy::GetApplicationFunctions, "GetApplicationFunctions"}, 25 {20, &ILibraryAppletProxy::GetApplicationFunctions, "GetApplicationFunctions"},
26 {1000, &ILibraryAppletProxy::GetDebugFunctions, "GetDebugFunctions"}, 26 {1000, &ILibraryAppletProxy::GetDebugFunctions, "GetDebugFunctions"},
@@ -64,6 +64,13 @@ private:
64 NGLOG_DEBUG(Service_AM, "called"); 64 NGLOG_DEBUG(Service_AM, "called");
65 } 65 }
66 66
67 void GetProcessWindingController(Kernel::HLERequestContext& ctx) {
68 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
69 rb.Push(RESULT_SUCCESS);
70 rb.PushIpcInterface<IProcessWindingController>();
71 NGLOG_DEBUG(Service_AM, "called");
72 }
73
67 void GetDebugFunctions(Kernel::HLERequestContext& ctx) { 74 void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
68 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 75 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
69 rb.Push(RESULT_SUCCESS); 76 rb.Push(RESULT_SUCCESS);
@@ -88,6 +95,113 @@ private:
88 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 95 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
89}; 96};
90 97
98class ISystemAppletProxy final : public ServiceFramework<ISystemAppletProxy> {
99public:
100 explicit ISystemAppletProxy(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
101 : ServiceFramework("ISystemAppletProxy"), nvflinger(std::move(nvflinger)) {
102 static const FunctionInfo functions[] = {
103 {0, &ISystemAppletProxy::GetCommonStateGetter, "GetCommonStateGetter"},
104 {1, &ISystemAppletProxy::GetSelfController, "GetSelfController"},
105 {2, &ISystemAppletProxy::GetWindowController, "GetWindowController"},
106 {3, &ISystemAppletProxy::GetAudioController, "GetAudioController"},
107 {4, &ISystemAppletProxy::GetDisplayController, "GetDisplayController"},
108 {10, nullptr, "GetProcessWindingController"},
109 {11, &ISystemAppletProxy::GetLibraryAppletCreator, "GetLibraryAppletCreator"},
110 {20, &ISystemAppletProxy::GetHomeMenuFunctions, "GetHomeMenuFunctions"},
111 {21, &ISystemAppletProxy::GetGlobalStateController, "GetGlobalStateController"},
112 {22, &ISystemAppletProxy::GetApplicationCreator, "GetApplicationCreator"},
113 {1000, &ISystemAppletProxy::GetDebugFunctions, "GetDebugFunctions"},
114 };
115 RegisterHandlers(functions);
116 }
117
118private:
119 void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
120 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
121 rb.Push(RESULT_SUCCESS);
122 rb.PushIpcInterface<ICommonStateGetter>();
123 NGLOG_DEBUG(Service_AM, "called");
124 }
125
126 void GetSelfController(Kernel::HLERequestContext& ctx) {
127 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
128 rb.Push(RESULT_SUCCESS);
129 rb.PushIpcInterface<ISelfController>(nvflinger);
130 NGLOG_DEBUG(Service_AM, "called");
131 }
132
133 void GetWindowController(Kernel::HLERequestContext& ctx) {
134 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
135 rb.Push(RESULT_SUCCESS);
136 rb.PushIpcInterface<IWindowController>();
137 NGLOG_DEBUG(Service_AM, "called");
138 }
139
140 void GetAudioController(Kernel::HLERequestContext& ctx) {
141 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
142 rb.Push(RESULT_SUCCESS);
143 rb.PushIpcInterface<IAudioController>();
144 NGLOG_DEBUG(Service_AM, "called");
145 }
146
147 void GetDisplayController(Kernel::HLERequestContext& ctx) {
148 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
149 rb.Push(RESULT_SUCCESS);
150 rb.PushIpcInterface<IDisplayController>();
151 NGLOG_DEBUG(Service_AM, "called");
152 }
153
154 void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
155 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
156 rb.Push(RESULT_SUCCESS);
157 rb.PushIpcInterface<IDebugFunctions>();
158 NGLOG_DEBUG(Service_AM, "called");
159 }
160
161 void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
162 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
163 rb.Push(RESULT_SUCCESS);
164 rb.PushIpcInterface<ILibraryAppletCreator>();
165 NGLOG_DEBUG(Service_AM, "called");
166 }
167
168 void GetHomeMenuFunctions(Kernel::HLERequestContext& ctx) {
169 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
170 rb.Push(RESULT_SUCCESS);
171 rb.PushIpcInterface<IHomeMenuFunctions>();
172 NGLOG_DEBUG(Service_AM, "called");
173 }
174
175 void GetGlobalStateController(Kernel::HLERequestContext& ctx) {
176 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
177 rb.Push(RESULT_SUCCESS);
178 rb.PushIpcInterface<IGlobalStateController>();
179 NGLOG_DEBUG(Service_AM, "called");
180 }
181
182 void GetApplicationCreator(Kernel::HLERequestContext& ctx) {
183 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
184 rb.Push(RESULT_SUCCESS);
185 rb.PushIpcInterface<IApplicationCreator>();
186 NGLOG_DEBUG(Service_AM, "called");
187 }
188 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
189};
190
191void AppletAE::OpenSystemAppletProxy(Kernel::HLERequestContext& ctx) {
192 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
193 rb.Push(RESULT_SUCCESS);
194 rb.PushIpcInterface<ISystemAppletProxy>(nvflinger);
195 NGLOG_DEBUG(Service_AM, "called");
196}
197
198void AppletAE::OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx) {
199 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
200 rb.Push(RESULT_SUCCESS);
201 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger);
202 NGLOG_DEBUG(Service_AM, "called");
203}
204
91void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) { 205void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
92 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 206 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
93 rb.Push(RESULT_SUCCESS); 207 rb.Push(RESULT_SUCCESS);
@@ -98,9 +212,9 @@ void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
98AppletAE::AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger) 212AppletAE::AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
99 : ServiceFramework("appletAE"), nvflinger(std::move(nvflinger)) { 213 : ServiceFramework("appletAE"), nvflinger(std::move(nvflinger)) {
100 static const FunctionInfo functions[] = { 214 static const FunctionInfo functions[] = {
101 {100, nullptr, "OpenSystemAppletProxy"}, 215 {100, &AppletAE::OpenSystemAppletProxy, "OpenSystemAppletProxy"},
102 {200, &AppletAE::OpenLibraryAppletProxyOld, "OpenLibraryAppletProxyOld"}, 216 {200, &AppletAE::OpenLibraryAppletProxyOld, "OpenLibraryAppletProxyOld"},
103 {201, nullptr, "OpenLibraryAppletProxy"}, 217 {201, &AppletAE::OpenLibraryAppletProxy, "OpenLibraryAppletProxy"},
104 {300, nullptr, "OpenOverlayAppletProxy"}, 218 {300, nullptr, "OpenOverlayAppletProxy"},
105 {350, nullptr, "OpenSystemApplicationProxy"}, 219 {350, nullptr, "OpenSystemApplicationProxy"},
106 {400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"}, 220 {400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"},
diff --git a/src/core/hle/service/am/applet_ae.h b/src/core/hle/service/am/applet_ae.h
index 38fc428fb..f3a96651e 100644
--- a/src/core/hle/service/am/applet_ae.h
+++ b/src/core/hle/service/am/applet_ae.h
@@ -21,6 +21,8 @@ public:
21 ~AppletAE() = default; 21 ~AppletAE() = default;
22 22
23private: 23private:
24 void OpenSystemAppletProxy(Kernel::HLERequestContext& ctx);
25 void OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx);
24 void OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx); 26 void OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx);
25 27
26 std::shared_ptr<NVFlinger::NVFlinger> nvflinger; 28 std::shared_ptr<NVFlinger::NVFlinger> nvflinger;