summaryrefslogtreecommitdiff
path: root/src/core/hle/service/mm
diff options
context:
space:
mode:
authorGravatar mailwl2018-06-05 12:19:29 +0300
committerGravatar mailwl2018-06-05 12:19:29 +0300
commit7e3d746b06d68a7fbadf5b94ef62cad38482c000 (patch)
tree0c8616b647938f063f4159b31e8d9cbdf333e855 /src/core/hle/service/mm
parentMerge pull request #518 from Subv/incomplete_shaders (diff)
downloadyuzu-7e3d746b06d68a7fbadf5b94ef62cad38482c000.tar.gz
yuzu-7e3d746b06d68a7fbadf5b94ef62cad38482c000.tar.xz
yuzu-7e3d746b06d68a7fbadf5b94ef62cad38482c000.zip
Service/MM: add service and stub some functions
Diffstat (limited to 'src/core/hle/service/mm')
-rw-r--r--src/core/hle/service/mm/mm_u.cpp50
-rw-r--r--src/core/hle/service/mm/mm_u.h29
2 files changed, 79 insertions, 0 deletions
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..7f12fee27
--- /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 <sstream>
6#include <string>
7#include "common/logging/log.h"
8#include "core/hle/ipc_helpers.h"
9#include "core/hle/kernel/client_session.h"
10#include "core/hle/service/mm/mm_u.h"
11
12namespace Service::MM {
13
14void InstallInterfaces(SM::ServiceManager& service_manager) {
15 std::make_shared<MM_U>()->InstallAsService(service_manager);
16}
17
18void MM_U::Initialize(Kernel::HLERequestContext& ctx) {
19 NGLOG_WARNING(Service_MM, "(STUBBED) called");
20 IPC::ResponseBuilder rb{ctx, 2};
21 rb.Push(RESULT_SUCCESS);
22}
23
24void MM_U::SetAndWait(Kernel::HLERequestContext& ctx) {
25 IPC::RequestParser rp{ctx};
26 value = rp.Pop<u32>();
27
28 NGLOG_WARNING(Service_MM, "(STUBBED) called, value=0x{:X}", value);
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(value);
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..de3f3a311
--- /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 <vector>
8#include "core/hle/kernel/kernel.h"
9#include "core/hle/service/service.h"
10
11namespace Service::MM {
12
13class MM_U final : public ServiceFramework<MM_U> {
14public:
15 MM_U();
16 ~MM_U() = default;
17
18private:
19 void Initialize(Kernel::HLERequestContext& ctx);
20 void SetAndWait(Kernel::HLERequestContext& ctx);
21 void Get(Kernel::HLERequestContext& ctx);
22
23 u32 value;
24};
25
26/// Registers all MM services with the specified service manager.
27void InstallInterfaces(SM::ServiceManager& service_manager);
28
29} // namespace Service::MM