summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-06-07 02:00:04 -0400
committerGravatar GitHub2018-06-07 02:00:04 -0400
commitee1eb8cfdfa5502f2e27ecaab4e37d1e59eee3c5 (patch)
tree014ec98abac52d8a6e6ed61b93a795bf8699edc3 /src
parentMerge pull request #542 from bunnei/bfe_imm (diff)
parentRemove unused header files (diff)
downloadyuzu-ee1eb8cfdfa5502f2e27ecaab4e37d1e59eee3c5.tar.gz
yuzu-ee1eb8cfdfa5502f2e27ecaab4e37d1e59eee3c5.tar.xz
yuzu-ee1eb8cfdfa5502f2e27ecaab4e37d1e59eee3c5.zip
Merge pull request #522 from mailwl/mm-u
Service/MM: add service and stub some functions
Diffstat (limited to 'src')
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/mm/mm_u.cpp50
-rw-r--r--src/core/hle/service/mm/mm_u.h29
-rw-r--r--src/core/hle/service/service.cpp2
6 files changed, 85 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 3e31a74f2..c26b20062 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -41,6 +41,7 @@ namespace Log {
41 SUB(Service, FS) \ 41 SUB(Service, FS) \
42 SUB(Service, HID) \ 42 SUB(Service, HID) \
43 SUB(Service, LM) \ 43 SUB(Service, LM) \
44 SUB(Service, MM) \
44 SUB(Service, NFP) \ 45 SUB(Service, NFP) \
45 SUB(Service, NIFM) \ 46 SUB(Service, NIFM) \
46 SUB(Service, NS) \ 47 SUB(Service, NS) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 43e572ebe..c5015531c 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -61,6 +61,7 @@ enum class Class : ClassType {
61 Service_FS, ///< The FS (Filesystem) service 61 Service_FS, ///< The FS (Filesystem) service
62 Service_HID, ///< The HID (Human interface device) service 62 Service_HID, ///< The HID (Human interface device) service
63 Service_LM, ///< The LM (Logger) service 63 Service_LM, ///< The LM (Logger) service
64 Service_MM, ///< The MM (Multimedia) service
64 Service_NFP, ///< The NFP service 65 Service_NFP, ///< The NFP service
65 Service_NIFM, ///< The NIFM (Network interface) service 66 Service_NIFM, ///< The NIFM (Network interface) service
66 Service_NS, ///< The NS services 67 Service_NS, ///< The NS services
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index aff1d2180..ba5b02174 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -148,6 +148,8 @@ add_library(core STATIC
148 hle/service/hid/hid.h 148 hle/service/hid/hid.h
149 hle/service/lm/lm.cpp 149 hle/service/lm/lm.cpp
150 hle/service/lm/lm.h 150 hle/service/lm/lm.h
151 hle/service/mm/mm_u.cpp
152 hle/service/mm/mm_u.h
151 hle/service/nifm/nifm.cpp 153 hle/service/nifm/nifm.cpp
152 hle/service/nifm/nifm.h 154 hle/service/nifm/nifm.h
153 hle/service/nifm/nifm_a.cpp 155 hle/service/nifm/nifm_a.cpp
diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp
new file mode 100644
index 000000000..b3a85b818
--- /dev/null
+++ b/src/core/hle/service/mm/mm_u.cpp
@@ -0,0 +1,50 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "common/logging/log.h"
6#include "core/hle/ipc_helpers.h"
7#include "core/hle/kernel/client_session.h"
8#include "core/hle/service/mm/mm_u.h"
9
10namespace Service::MM {
11
12void InstallInterfaces(SM::ServiceManager& service_manager) {
13 std::make_shared<MM_U>()->InstallAsService(service_manager);
14}
15
16void MM_U::Initialize(Kernel::HLERequestContext& ctx) {
17 NGLOG_WARNING(Service_MM, "(STUBBED) called");
18 IPC::ResponseBuilder rb{ctx, 2};
19 rb.Push(RESULT_SUCCESS);
20}
21
22void MM_U::SetAndWait(Kernel::HLERequestContext& ctx) {
23 IPC::RequestParser rp{ctx};
24 min = rp.Pop<u32>();
25 max = rp.Pop<u32>();
26 current = min;
27
28 NGLOG_WARNING(Service_MM, "(STUBBED) called, min=0x{:X}, max=0x{:X}", min, max);
29 IPC::ResponseBuilder rb{ctx, 2};
30 rb.Push(RESULT_SUCCESS);
31}
32
33void MM_U::Get(Kernel::HLERequestContext& ctx) {
34 NGLOG_WARNING(Service_MM, "(STUBBED) called");
35 IPC::ResponseBuilder rb{ctx, 3};
36 rb.Push(RESULT_SUCCESS);
37 rb.Push(current);
38}
39
40MM_U::MM_U() : ServiceFramework("mm:u") {
41 static const FunctionInfo functions[] = {
42 {0, nullptr, "InitializeOld"}, {1, nullptr, "FinalizeOld"},
43 {2, nullptr, "SetAndWaitOld"}, {3, nullptr, "GetOld"},
44 {4, &MM_U::Initialize, "Initialize"}, {5, nullptr, "Finalize"},
45 {6, &MM_U::SetAndWait, "SetAndWait"}, {7, &MM_U::Get, "Get"},
46 };
47 RegisterHandlers(functions);
48}
49
50} // namespace Service::MM
diff --git a/src/core/hle/service/mm/mm_u.h b/src/core/hle/service/mm/mm_u.h
new file mode 100644
index 000000000..79eeedf9c
--- /dev/null
+++ b/src/core/hle/service/mm/mm_u.h
@@ -0,0 +1,29 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::MM {
10
11class MM_U final : public ServiceFramework<MM_U> {
12public:
13 MM_U();
14 ~MM_U() = default;
15
16private:
17 void Initialize(Kernel::HLERequestContext& ctx);
18 void SetAndWait(Kernel::HLERequestContext& ctx);
19 void Get(Kernel::HLERequestContext& ctx);
20
21 u32 min{0};
22 u32 max{0};
23 u32 current{0};
24};
25
26/// Registers all MM services with the specified service manager.
27void InstallInterfaces(SM::ServiceManager& service_manager);
28
29} // namespace Service::MM
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 409fec470..bdd9eb5a5 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -26,6 +26,7 @@
26#include "core/hle/service/friend/friend.h" 26#include "core/hle/service/friend/friend.h"
27#include "core/hle/service/hid/hid.h" 27#include "core/hle/service/hid/hid.h"
28#include "core/hle/service/lm/lm.h" 28#include "core/hle/service/lm/lm.h"
29#include "core/hle/service/mm/mm_u.h"
29#include "core/hle/service/nfp/nfp.h" 30#include "core/hle/service/nfp/nfp.h"
30#include "core/hle/service/nifm/nifm.h" 31#include "core/hle/service/nifm/nifm.h"
31#include "core/hle/service/ns/ns.h" 32#include "core/hle/service/ns/ns.h"
@@ -191,6 +192,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
191 Friend::InstallInterfaces(*sm); 192 Friend::InstallInterfaces(*sm);
192 HID::InstallInterfaces(*sm); 193 HID::InstallInterfaces(*sm);
193 LM::InstallInterfaces(*sm); 194 LM::InstallInterfaces(*sm);
195 MM::InstallInterfaces(*sm);
194 NFP::InstallInterfaces(*sm); 196 NFP::InstallInterfaces(*sm);
195 NIFM::InstallInterfaces(*sm); 197 NIFM::InstallInterfaces(*sm);
196 NS::InstallInterfaces(*sm); 198 NS::InstallInterfaces(*sm);