Quellcode durchsuchen

hle: Add service stubs for apm and appletOE.

bunnei vor 8 Jahren
Ursprung
Commit
72eeca1f03

+ 6 - 0
src/core/CMakeLists.txt

@@ -48,6 +48,9 @@ set(SRCS
             hle/kernel/wait_object.cpp
             hle/lock.cpp
             hle/romfs.cpp
+            hle/service/am/am.cpp
+            hle/service/am/applet_oe.cpp
+            hle/service/apm/apm.cpp
             hle/service/dsp_dsp.cpp
             hle/service/gsp_gpu.cpp
             hle/service/hid/hid.cpp
@@ -137,6 +140,9 @@ set(HEADERS
             hle/lock.h
             hle/result.h
             hle/romfs.h
+            hle/service/am/am.h
+            hle/service/am/applet_oe.h
+            hle/service/apm/apm.h
             hle/service/dsp_dsp.h
             hle/service/gsp_gpu.h
             hle/service/hid/hid.h

+ 18 - 0
src/core/hle/service/am/am.cpp

@@ -0,0 +1,18 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "common/logging/log.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/am/am.h"
+#include "core/hle/service/am/applet_oe.h"
+
+namespace Service {
+namespace AM {
+
+void InstallInterfaces(SM::ServiceManager& service_manager) {
+    std::make_shared<AppletOE>()->InstallAsService(service_manager);
+}
+
+} // namespace AM
+} // namespace Service

+ 16 - 0
src/core/hle/service/am/am.h

@@ -0,0 +1,16 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace AM {
+
+/// Registers all AM services with the specified service manager.
+void InstallInterfaces(SM::ServiceManager& service_manager);
+
+} // namespace AM
+} // namespace Service

+ 22 - 0
src/core/hle/service/am/applet_oe.cpp

@@ -0,0 +1,22 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "common/logging/log.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/am/applet_oe.h"
+
+namespace Service {
+namespace AM {
+
+AppletOE::AppletOE() : ServiceFramework("appletOE") {
+    static const FunctionInfo functions[] = {
+        {0x00000000, nullptr, "OpenApplicationProxy"},
+    };
+    RegisterHandlers(functions);
+}
+
+AppletOE::~AppletOE() = default;
+
+} // namespace AM
+} // namespace Service

+ 19 - 0
src/core/hle/service/am/applet_oe.h

@@ -0,0 +1,19 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace AM {
+
+class AppletOE final : public ServiceFramework<AppletOE> {
+public:
+    explicit AppletOE();
+    ~AppletOE();
+};
+
+} // namespace AM
+} // namespace Service

+ 27 - 0
src/core/hle/service/apm/apm.cpp

@@ -0,0 +1,27 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "common/logging/log.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/apm/apm.h"
+
+namespace Service {
+namespace APM {
+
+void InstallInterfaces(SM::ServiceManager& service_manager) {
+    std::make_shared<APM>()->InstallAsService(service_manager);
+}
+
+APM::APM() : ServiceFramework("apm") {
+    static const FunctionInfo functions[] = {
+        {0x00000000, nullptr, "OpenSession"},
+        {0x00000001, nullptr, "GetPerformanceMode"},
+    };
+    RegisterHandlers(functions);
+}
+
+APM::~APM() = default;
+
+} // namespace APM
+} // namespace Service

+ 22 - 0
src/core/hle/service/apm/apm.h

@@ -0,0 +1,22 @@
+// Copyright 2017 Citra Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include "core/hle/service/service.h"
+
+namespace Service {
+namespace APM {
+
+class APM final : public ServiceFramework<APM> {
+public:
+    explicit APM();
+    ~APM();
+};
+
+/// Registers all AM services with the specified service manager.
+void InstallInterfaces(SM::ServiceManager& service_manager);
+
+} // namespace APM
+} // namespace Service

+ 1 - 1
src/core/hle/service/lm/lm.cpp

@@ -14,7 +14,7 @@ void InstallInterfaces(SM::ServiceManager& service_manager) {
 }
 
 /**
- * SRV::Initialize service function
+ * LM::Initialize service function
  *  Inputs:
  *      0: 0x00000000
  *  Outputs:

+ 4 - 0
src/core/hle/service/service.cpp

@@ -15,6 +15,8 @@
 #include "core/hle/kernel/server_session.h"
 #include "core/hle/kernel/thread.h"
 #include "core/hle/kernel/handle_table.h"
+#include "core/hle/service/am/am.h"
+#include "core/hle/service/apm/apm.h"
 #include "core/hle/service/dsp_dsp.h"
 #include "core/hle/service/gsp_gpu.h"
 #include "core/hle/service/hid/hid.h"
@@ -157,6 +159,8 @@ void Init() {
     SM::g_service_manager = std::make_shared<SM::ServiceManager>();
     SM::ServiceManager::InstallInterfaces(SM::g_service_manager);
 
+    AM::InstallInterfaces(*SM::g_service_manager);
+    APM::InstallInterfaces(*SM::g_service_manager);
     LM::InstallInterfaces(*SM::g_service_manager);
 
     HID::Init();

+ 1 - 1
src/core/hle/service/sm/sm.cpp

@@ -103,7 +103,7 @@ void SM::GetService(Kernel::HLERequestContext& ctx) {
     IPC::RequestParser rp{ctx};
     u32 unk1 = rp.Pop<u32>();
     u32 unk2 = rp.Pop<u32>();
-    auto name_buf = rp.PopRaw<std::array<char, 6>>();
+    auto name_buf = rp.PopRaw<std::array<char, 9>>();
     std::string name(name_buf.data());
 
     // TODO(yuriks): Permission checks go here