summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-28 10:45:31 -0700
committerGravatar GitHub2018-07-28 10:45:31 -0700
commitd00dcdb1be093216e144ad63a8bff09b5402914c (patch)
tree8612edabf55ab735774a33645e3080b5c4feab77 /src
parentMerge pull request #842 from bunnei/audio-core (diff)
parentservice: Add mii services (diff)
downloadyuzu-d00dcdb1be093216e144ad63a8bff09b5402914c.tar.gz
yuzu-d00dcdb1be093216e144ad63a8bff09b5402914c.tar.xz
yuzu-d00dcdb1be093216e144ad63a8bff09b5402914c.zip
Merge pull request #846 from lioncash/mii
service: Add mii services
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/mii/mii.cpp107
-rw-r--r--src/core/hle/service/mii/mii.h15
-rw-r--r--src/core/hle/service/service.cpp2
6 files changed, 128 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 30537b27b..ca30fa6ff 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -176,6 +176,7 @@ void FileBackend::Write(const Entry& entry) {
176 SUB(Service, LBL) \ 176 SUB(Service, LBL) \
177 SUB(Service, LDN) \ 177 SUB(Service, LDN) \
178 SUB(Service, LM) \ 178 SUB(Service, LM) \
179 SUB(Service, Mii) \
179 SUB(Service, MM) \ 180 SUB(Service, MM) \
180 SUB(Service, NFC) \ 181 SUB(Service, NFC) \
181 SUB(Service, NFP) \ 182 SUB(Service, NFP) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 805f82d2f..2515cb40f 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -63,6 +63,7 @@ enum class Class : ClassType {
63 Service_LBL, ///< The LBL (LCD backlight) service 63 Service_LBL, ///< The LBL (LCD backlight) service
64 Service_LDN, ///< The LDN (Local domain network) service 64 Service_LDN, ///< The LDN (Local domain network) service
65 Service_LM, ///< The LM (Logger) service 65 Service_LM, ///< The LM (Logger) service
66 Service_Mii, ///< The Mii service
66 Service_MM, ///< The MM (Multimedia) service 67 Service_MM, ///< The MM (Multimedia) service
67 Service_NFC, ///< The NFC (Near-field communication) service 68 Service_NFC, ///< The NFC (Near-field communication) service
68 Service_NFP, ///< The NFP service 69 Service_NFP, ///< The NFP service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 30d7667c8..18faf08f8 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -178,6 +178,8 @@ add_library(core STATIC
178 hle/service/ldr/ldr.h 178 hle/service/ldr/ldr.h
179 hle/service/lm/lm.cpp 179 hle/service/lm/lm.cpp
180 hle/service/lm/lm.h 180 hle/service/lm/lm.h
181 hle/service/mii/mii.cpp
182 hle/service/mii/mii.h
181 hle/service/mm/mm_u.cpp 183 hle/service/mm/mm_u.cpp
182 hle/service/mm/mm_u.h 184 hle/service/mm/mm_u.h
183 hle/service/nfc/nfc.cpp 185 hle/service/nfc/nfc.cpp
diff --git a/src/core/hle/service/mii/mii.cpp b/src/core/hle/service/mii/mii.cpp
new file mode 100644
index 000000000..a6197124a
--- /dev/null
+++ b/src/core/hle/service/mii/mii.cpp
@@ -0,0 +1,107 @@
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 <memory>
6
7#include "common/logging/log.h"
8#include "core/hle/ipc_helpers.h"
9#include "core/hle/kernel/hle_ipc.h"
10#include "core/hle/service/mii/mii.h"
11#include "core/hle/service/service.h"
12#include "core/hle/service/sm/sm.h"
13
14namespace Service::Mii {
15
16class IDatabaseService final : public ServiceFramework<IDatabaseService> {
17public:
18 explicit IDatabaseService() : ServiceFramework{"IDatabaseService"} {
19 // clang-format off
20 static const FunctionInfo functions[] = {
21 {0, nullptr, "IsUpdated"},
22 {1, nullptr, "IsFullDatabase"},
23 {2, nullptr, "GetCount"},
24 {3, nullptr, "Get"},
25 {4, nullptr, "Get1"},
26 {5, nullptr, "UpdateLatest"},
27 {6, nullptr, "BuildRandom"},
28 {7, nullptr, "BuildDefault"},
29 {8, nullptr, "Get2"},
30 {9, nullptr, "Get3"},
31 {10, nullptr, "UpdateLatest1"},
32 {11, nullptr, "FindIndex"},
33 {12, nullptr, "Move"},
34 {13, nullptr, "AddOrReplace"},
35 {14, nullptr, "Delete"},
36 {15, nullptr, "DestroyFile"},
37 {16, nullptr, "DeleteFile"},
38 {17, nullptr, "Format"},
39 {18, nullptr, "Import"},
40 {19, nullptr, "Export"},
41 {20, nullptr, "IsBrokenDatabaseWithClearFlag"},
42 {21, nullptr, "GetIndex"},
43 {22, nullptr, "SetInterfaceVersion"},
44 {23, nullptr, "Convert"},
45 };
46 // clang-format on
47
48 RegisterHandlers(functions);
49 }
50};
51
52class MiiDBModule final : public ServiceFramework<MiiDBModule> {
53public:
54 explicit MiiDBModule(const char* name) : ServiceFramework{name} {
55 // clang-format off
56 static const FunctionInfo functions[] = {
57 {0, &MiiDBModule::GetDatabaseService, "GetDatabaseService"},
58 };
59 // clang-format on
60
61 RegisterHandlers(functions);
62 }
63
64private:
65 void GetDatabaseService(Kernel::HLERequestContext& ctx) {
66 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
67 rb.Push(RESULT_SUCCESS);
68 rb.PushIpcInterface<IDatabaseService>();
69
70 LOG_DEBUG(Service_Mii, "called");
71 }
72};
73
74class MiiImg final : public ServiceFramework<MiiImg> {
75public:
76 explicit MiiImg() : ServiceFramework{"miiimg"} {
77 // clang-format off
78 static const FunctionInfo functions[] = {
79 {0, nullptr, "Initialize"},
80 {10, nullptr, "Reload"},
81 {11, nullptr, "GetCount"},
82 {12, nullptr, "IsEmpty"},
83 {13, nullptr, "IsFull"},
84 {14, nullptr, "GetAttribute"},
85 {15, nullptr, "LoadImage"},
86 {16, nullptr, "AddOrUpdateImage"},
87 {17, nullptr, "DeleteImages"},
88 {100, nullptr, "DeleteFile"},
89 {101, nullptr, "DestroyFile"},
90 {102, nullptr, "ImportFile"},
91 {103, nullptr, "ExportFile"},
92 {104, nullptr, "ForceInitialize"},
93 };
94 // clang-format on
95
96 RegisterHandlers(functions);
97 }
98};
99
100void InstallInterfaces(SM::ServiceManager& sm) {
101 std::make_shared<MiiDBModule>("mii:e")->InstallAsService(sm);
102 std::make_shared<MiiDBModule>("mii:u")->InstallAsService(sm);
103
104 std::make_shared<MiiImg>()->InstallAsService(sm);
105}
106
107} // namespace Service::Mii
diff --git a/src/core/hle/service/mii/mii.h b/src/core/hle/service/mii/mii.h
new file mode 100644
index 000000000..7ce9be50e
--- /dev/null
+++ b/src/core/hle/service/mii/mii.h
@@ -0,0 +1,15 @@
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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::Mii {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::Mii
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 8026d27a7..98c912eb3 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -34,6 +34,7 @@
34#include "core/hle/service/ldn/ldn.h" 34#include "core/hle/service/ldn/ldn.h"
35#include "core/hle/service/ldr/ldr.h" 35#include "core/hle/service/ldr/ldr.h"
36#include "core/hle/service/lm/lm.h" 36#include "core/hle/service/lm/lm.h"
37#include "core/hle/service/mii/mii.h"
37#include "core/hle/service/mm/mm_u.h" 38#include "core/hle/service/mm/mm_u.h"
38#include "core/hle/service/nfc/nfc.h" 39#include "core/hle/service/nfc/nfc.h"
39#include "core/hle/service/nfp/nfp.h" 40#include "core/hle/service/nfp/nfp.h"
@@ -211,6 +212,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
211 LDN::InstallInterfaces(*sm); 212 LDN::InstallInterfaces(*sm);
212 LDR::InstallInterfaces(*sm); 213 LDR::InstallInterfaces(*sm);
213 LM::InstallInterfaces(*sm); 214 LM::InstallInterfaces(*sm);
215 Mii::InstallInterfaces(*sm);
214 MM::InstallInterfaces(*sm); 216 MM::InstallInterfaces(*sm);
215 NFC::InstallInterfaces(*sm); 217 NFC::InstallInterfaces(*sm);
216 NFP::InstallInterfaces(*sm); 218 NFP::InstallInterfaces(*sm);