summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-07-27 21:39:30 +0200
committerLioncash <mathew1800@gmail.com>2018-07-27 22:01:29 +0200
commitf46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9 (patch)
treebf510ba8871ea8a6d2064f6f5b0d26626701e146 /src
parentMerge pull request #837 from lioncash/priv (diff)
downloadyuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.tar
yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.tar.gz
yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.tar.bz2
yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.tar.lz
yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.tar.xz
yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.tar.zst
yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.zip
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 ad9edbcdf..281336830 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -175,6 +175,7 @@ void FileBackend::Write(const Entry& entry) {
SUB(Service, HID) \
SUB(Service, LDN) \
SUB(Service, LM) \
+ SUB(Service, Mii) \
SUB(Service, MM) \
SUB(Service, NFP) \
SUB(Service, NIFM) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index ad3cbf5d1..7f0788801 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -62,6 +62,7 @@ enum class Class : ClassType {
Service_HID, ///< The HID (Human interface device) service
Service_LDN, ///< The LDN (Local domain network) service
Service_LM, ///< The LM (Logger) service
+ Service_Mii, ///< The Mii service
Service_MM, ///< The MM (Multimedia) service
Service_NFP, ///< The NFP service
Service_NIFM, ///< The NIFM (Network interface) service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index b74e495ef..568c0ae0f 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -170,6 +170,8 @@ add_library(core STATIC
hle/service/ldr/ldr.h
hle/service/lm/lm.cpp
hle/service/lm/lm.h
+ hle/service/mii/mii.cpp
+ hle/service/mii/mii.h
hle/service/mm/mm_u.cpp
hle/service/mm/mm_u.h
hle/service/nfp/nfp.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 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include <memory>
+
+#include "common/logging/log.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/kernel/hle_ipc.h"
+#include "core/hle/service/mii/mii.h"
+#include "core/hle/service/service.h"
+#include "core/hle/service/sm/sm.h"
+
+namespace Service::Mii {
+
+class IDatabaseService final : public ServiceFramework<IDatabaseService> {
+public:
+ explicit IDatabaseService() : ServiceFramework{"IDatabaseService"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "IsUpdated"},
+ {1, nullptr, "IsFullDatabase"},
+ {2, nullptr, "GetCount"},
+ {3, nullptr, "Get"},
+ {4, nullptr, "Get1"},
+ {5, nullptr, "UpdateLatest"},
+ {6, nullptr, "BuildRandom"},
+ {7, nullptr, "BuildDefault"},
+ {8, nullptr, "Get2"},
+ {9, nullptr, "Get3"},
+ {10, nullptr, "UpdateLatest1"},
+ {11, nullptr, "FindIndex"},
+ {12, nullptr, "Move"},
+ {13, nullptr, "AddOrReplace"},
+ {14, nullptr, "Delete"},
+ {15, nullptr, "DestroyFile"},
+ {16, nullptr, "DeleteFile"},
+ {17, nullptr, "Format"},
+ {18, nullptr, "Import"},
+ {19, nullptr, "Export"},
+ {20, nullptr, "IsBrokenDatabaseWithClearFlag"},
+ {21, nullptr, "GetIndex"},
+ {22, nullptr, "SetInterfaceVersion"},
+ {23, nullptr, "Convert"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+};
+
+class MiiDBModule final : public ServiceFramework<MiiDBModule> {
+public:
+ explicit MiiDBModule(const char* name) : ServiceFramework{name} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, &MiiDBModule::GetDatabaseService, "GetDatabaseService"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+
+private:
+ void GetDatabaseService(Kernel::HLERequestContext& ctx) {
+ IPC::ResponseBuilder rb{ctx, 2, 0, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushIpcInterface<IDatabaseService>();
+
+ LOG_DEBUG(Service_Mii, "called");
+ }
+};
+
+class MiiImg final : public ServiceFramework<MiiImg> {
+public:
+ explicit MiiImg() : ServiceFramework{"miiimg"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "Initialize"},
+ {10, nullptr, "Reload"},
+ {11, nullptr, "GetCount"},
+ {12, nullptr, "IsEmpty"},
+ {13, nullptr, "IsFull"},
+ {14, nullptr, "GetAttribute"},
+ {15, nullptr, "LoadImage"},
+ {16, nullptr, "AddOrUpdateImage"},
+ {17, nullptr, "DeleteImages"},
+ {100, nullptr, "DeleteFile"},
+ {101, nullptr, "DestroyFile"},
+ {102, nullptr, "ImportFile"},
+ {103, nullptr, "ExportFile"},
+ {104, nullptr, "ForceInitialize"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+};
+
+void InstallInterfaces(SM::ServiceManager& sm) {
+ std::make_shared<MiiDBModule>("mii:e")->InstallAsService(sm);
+ std::make_shared<MiiDBModule>("mii:u")->InstallAsService(sm);
+
+ std::make_shared<MiiImg>()->InstallAsService(sm);
+}
+
+} // 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 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+namespace Service::SM {
+class ServiceManager;
+}
+
+namespace Service::Mii {
+
+void InstallInterfaces(SM::ServiceManager& sm);
+
+} // namespace Service::Mii
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 8b84fd349..76a73f741 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -32,6 +32,7 @@
#include "core/hle/service/ldn/ldn.h"
#include "core/hle/service/ldr/ldr.h"
#include "core/hle/service/lm/lm.h"
+#include "core/hle/service/mii/mii.h"
#include "core/hle/service/mm/mm_u.h"
#include "core/hle/service/nfp/nfp.h"
#include "core/hle/service/nifm/nifm.h"
@@ -206,6 +207,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
LDN::InstallInterfaces(*sm);
LDR::InstallInterfaces(*sm);
LM::InstallInterfaces(*sm);
+ Mii::InstallInterfaces(*sm);
MM::InstallInterfaces(*sm);
NFP::InstallInterfaces(*sm);
NIFM::InstallInterfaces(*sm);