diff options
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 5 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/am/applet_oe.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/service/am/applet_oe.h | 9 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 2 |
5 files changed, 32 insertions, 10 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index a761bea65..b6896852e 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -8,8 +8,9 @@ | |||
| 8 | namespace Service { | 8 | namespace Service { |
| 9 | namespace AM { | 9 | namespace AM { |
| 10 | 10 | ||
| 11 | void InstallInterfaces(SM::ServiceManager& service_manager) { | 11 | void InstallInterfaces(SM::ServiceManager& service_manager, |
| 12 | std::make_shared<AppletOE>()->InstallAsService(service_manager); | 12 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger) { |
| 13 | std::make_shared<AppletOE>(nvflinger)->InstallAsService(service_manager); | ||
| 13 | } | 14 | } |
| 14 | 15 | ||
| 15 | } // namespace AM | 16 | } // namespace AM |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 63d86cd41..3b8a06c1d 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -4,13 +4,19 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | ||
| 7 | #include "core/hle/service/service.h" | 8 | #include "core/hle/service/service.h" |
| 8 | 9 | ||
| 9 | namespace Service { | 10 | namespace Service { |
| 11 | namespace NVFlinger { | ||
| 12 | class NVFlinger; | ||
| 13 | } | ||
| 14 | |||
| 10 | namespace AM { | 15 | namespace AM { |
| 11 | 16 | ||
| 12 | /// Registers all AM services with the specified service manager. | 17 | /// Registers all AM services with the specified service manager. |
| 13 | void InstallInterfaces(SM::ServiceManager& service_manager); | 18 | void InstallInterfaces(SM::ServiceManager& service_manager, |
| 19 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger); | ||
| 14 | 20 | ||
| 15 | } // namespace AM | 21 | } // namespace AM |
| 16 | } // namespace Service | 22 | } // namespace Service |
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp index b4a6ad232..f593840b3 100644 --- a/src/core/hle/service/am/applet_oe.cpp +++ b/src/core/hle/service/am/applet_oe.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include "core/hle/kernel/event.h" | 7 | #include "core/hle/kernel/event.h" |
| 8 | #include "core/hle/service/am/applet_oe.h" | 8 | #include "core/hle/service/am/applet_oe.h" |
| 9 | #include "core/hle/service/apm/apm.h" | 9 | #include "core/hle/service/apm/apm.h" |
| 10 | #include "core/hle/service/nvflinger/nvflinger.h" | ||
| 10 | 11 | ||
| 11 | namespace Service { | 12 | namespace Service { |
| 12 | namespace AM { | 13 | namespace AM { |
| @@ -53,7 +54,8 @@ public: | |||
| 53 | 54 | ||
| 54 | class ISelfController final : public ServiceFramework<ISelfController> { | 55 | class ISelfController final : public ServiceFramework<ISelfController> { |
| 55 | public: | 56 | public: |
| 56 | ISelfController() : ServiceFramework("ISelfController") { | 57 | ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger) |
| 58 | : ServiceFramework("ISelfController"), nvflinger(std::move(nvflinger)) { | ||
| 57 | static const FunctionInfo functions[] = { | 59 | static const FunctionInfo functions[] = { |
| 58 | {1, &ISelfController::LockExit, "LockExit"}, | 60 | {1, &ISelfController::LockExit, "LockExit"}, |
| 59 | {2, &ISelfController::UnlockExit, "UnlockExit"}, | 61 | {2, &ISelfController::UnlockExit, "UnlockExit"}, |
| @@ -144,6 +146,8 @@ private: | |||
| 144 | 146 | ||
| 145 | LOG_WARNING(Service, "(STUBBED) called"); | 147 | LOG_WARNING(Service, "(STUBBED) called"); |
| 146 | } | 148 | } |
| 149 | |||
| 150 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger; | ||
| 147 | }; | 151 | }; |
| 148 | 152 | ||
| 149 | class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { | 153 | class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { |
| @@ -367,7 +371,8 @@ public: | |||
| 367 | 371 | ||
| 368 | class IApplicationProxy final : public ServiceFramework<IApplicationProxy> { | 372 | class IApplicationProxy final : public ServiceFramework<IApplicationProxy> { |
| 369 | public: | 373 | public: |
| 370 | IApplicationProxy() : ServiceFramework("IApplicationProxy") { | 374 | IApplicationProxy(std::shared_ptr<NVFlinger::NVFlinger> nvflinger) |
| 375 | : ServiceFramework("IApplicationProxy"), nvflinger(std::move(nvflinger)) { | ||
| 371 | static const FunctionInfo functions[] = { | 376 | static const FunctionInfo functions[] = { |
| 372 | {0, &IApplicationProxy::GetCommonStateGetter, "GetCommonStateGetter"}, | 377 | {0, &IApplicationProxy::GetCommonStateGetter, "GetCommonStateGetter"}, |
| 373 | {1, &IApplicationProxy::GetSelfController, "GetSelfController"}, | 378 | {1, &IApplicationProxy::GetSelfController, "GetSelfController"}, |
| @@ -413,7 +418,7 @@ private: | |||
| 413 | void GetSelfController(Kernel::HLERequestContext& ctx) { | 418 | void GetSelfController(Kernel::HLERequestContext& ctx) { |
| 414 | IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; | 419 | IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; |
| 415 | rb.Push(RESULT_SUCCESS); | 420 | rb.Push(RESULT_SUCCESS); |
| 416 | rb.PushIpcInterface<ISelfController>(); | 421 | rb.PushIpcInterface<ISelfController>(nvflinger); |
| 417 | LOG_DEBUG(Service, "called"); | 422 | LOG_DEBUG(Service, "called"); |
| 418 | } | 423 | } |
| 419 | 424 | ||
| @@ -437,16 +442,19 @@ private: | |||
| 437 | rb.PushIpcInterface<IApplicationFunctions>(); | 442 | rb.PushIpcInterface<IApplicationFunctions>(); |
| 438 | LOG_DEBUG(Service, "called"); | 443 | LOG_DEBUG(Service, "called"); |
| 439 | } | 444 | } |
| 445 | |||
| 446 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger; | ||
| 440 | }; | 447 | }; |
| 441 | 448 | ||
| 442 | void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { | 449 | void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { |
| 443 | IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; | 450 | IPC::RequestBuilder rb{ctx, 2, 0, 0, 1}; |
| 444 | rb.Push(RESULT_SUCCESS); | 451 | rb.Push(RESULT_SUCCESS); |
| 445 | rb.PushIpcInterface<IApplicationProxy>(); | 452 | rb.PushIpcInterface<IApplicationProxy>(nvflinger); |
| 446 | LOG_DEBUG(Service, "called"); | 453 | LOG_DEBUG(Service, "called"); |
| 447 | } | 454 | } |
| 448 | 455 | ||
| 449 | AppletOE::AppletOE() : ServiceFramework("appletOE") { | 456 | AppletOE::AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger) |
| 457 | : ServiceFramework("appletOE"), nvflinger(std::move(nvflinger)) { | ||
| 450 | static const FunctionInfo functions[] = { | 458 | static const FunctionInfo functions[] = { |
| 451 | {0x00000000, &AppletOE::OpenApplicationProxy, "OpenApplicationProxy"}, | 459 | {0x00000000, &AppletOE::OpenApplicationProxy, "OpenApplicationProxy"}, |
| 452 | }; | 460 | }; |
diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h index 6ee5b0e9f..8083135c3 100644 --- a/src/core/hle/service/am/applet_oe.h +++ b/src/core/hle/service/am/applet_oe.h | |||
| @@ -4,10 +4,15 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | ||
| 7 | #include "core/hle/kernel/hle_ipc.h" | 8 | #include "core/hle/kernel/hle_ipc.h" |
| 8 | #include "core/hle/service/service.h" | 9 | #include "core/hle/service/service.h" |
| 9 | 10 | ||
| 10 | namespace Service { | 11 | namespace Service { |
| 12 | namespace NVFlinger { | ||
| 13 | class NVFlinger; | ||
| 14 | } | ||
| 15 | |||
| 11 | namespace AM { | 16 | namespace AM { |
| 12 | 17 | ||
| 13 | // TODO: Add more languages | 18 | // TODO: Add more languages |
| @@ -18,11 +23,13 @@ enum SystemLanguage { | |||
| 18 | 23 | ||
| 19 | class AppletOE final : public ServiceFramework<AppletOE> { | 24 | class AppletOE final : public ServiceFramework<AppletOE> { |
| 20 | public: | 25 | public: |
| 21 | AppletOE(); | 26 | AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger); |
| 22 | ~AppletOE() = default; | 27 | ~AppletOE() = default; |
| 23 | 28 | ||
| 24 | private: | 29 | private: |
| 25 | void OpenApplicationProxy(Kernel::HLERequestContext& ctx); | 30 | void OpenApplicationProxy(Kernel::HLERequestContext& ctx); |
| 31 | |||
| 32 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger; | ||
| 26 | }; | 33 | }; |
| 27 | 34 | ||
| 28 | } // namespace AM | 35 | } // namespace AM |
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 403cce8e5..1b8565351 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -173,7 +173,7 @@ void Init() { | |||
| 173 | SM::ServiceManager::InstallInterfaces(SM::g_service_manager); | 173 | SM::ServiceManager::InstallInterfaces(SM::g_service_manager); |
| 174 | 174 | ||
| 175 | Account::InstallInterfaces(*SM::g_service_manager); | 175 | Account::InstallInterfaces(*SM::g_service_manager); |
| 176 | AM::InstallInterfaces(*SM::g_service_manager); | 176 | AM::InstallInterfaces(*SM::g_service_manager, nv_flinger); |
| 177 | AOC::InstallInterfaces(*SM::g_service_manager); | 177 | AOC::InstallInterfaces(*SM::g_service_manager); |
| 178 | APM::InstallInterfaces(*SM::g_service_manager); | 178 | APM::InstallInterfaces(*SM::g_service_manager); |
| 179 | Audio::InstallInterfaces(*SM::g_service_manager); | 179 | Audio::InstallInterfaces(*SM::g_service_manager); |