diff options
| author | 2018-07-27 15:39:30 -0400 | |
|---|---|---|
| committer | 2018-07-27 16:01:29 -0400 | |
| commit | f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9 (patch) | |
| tree | bf510ba8871ea8a6d2064f6f5b0d26626701e146 | |
| parent | Merge pull request #837 from lioncash/priv (diff) | |
| download | yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.tar.gz yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.tar.xz yuzu-f46bfdd77dd33b3495d6b9f16a955adc3e2e1bf9.zip | |
service: Add mii services
Adds the skeleton for the mii services based off information provided by
Switch Brew
| -rw-r--r-- | src/common/logging/backend.cpp | 1 | ||||
| -rw-r--r-- | src/common/logging/log.h | 1 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/mii/mii.cpp | 107 | ||||
| -rw-r--r-- | src/core/hle/service/mii/mii.h | 15 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 2 |
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) { | |||
| 175 | SUB(Service, HID) \ | 175 | SUB(Service, HID) \ |
| 176 | SUB(Service, LDN) \ | 176 | SUB(Service, LDN) \ |
| 177 | SUB(Service, LM) \ | 177 | SUB(Service, LM) \ |
| 178 | SUB(Service, Mii) \ | ||
| 178 | SUB(Service, MM) \ | 179 | SUB(Service, MM) \ |
| 179 | SUB(Service, NFP) \ | 180 | SUB(Service, NFP) \ |
| 180 | SUB(Service, NIFM) \ | 181 | 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 { | |||
| 62 | Service_HID, ///< The HID (Human interface device) service | 62 | Service_HID, ///< The HID (Human interface device) service |
| 63 | Service_LDN, ///< The LDN (Local domain network) service | 63 | Service_LDN, ///< The LDN (Local domain network) service |
| 64 | Service_LM, ///< The LM (Logger) service | 64 | Service_LM, ///< The LM (Logger) service |
| 65 | Service_Mii, ///< The Mii service | ||
| 65 | Service_MM, ///< The MM (Multimedia) service | 66 | Service_MM, ///< The MM (Multimedia) service |
| 66 | Service_NFP, ///< The NFP service | 67 | Service_NFP, ///< The NFP service |
| 67 | Service_NIFM, ///< The NIFM (Network interface) service | 68 | 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 | |||
| 170 | hle/service/ldr/ldr.h | 170 | hle/service/ldr/ldr.h |
| 171 | hle/service/lm/lm.cpp | 171 | hle/service/lm/lm.cpp |
| 172 | hle/service/lm/lm.h | 172 | hle/service/lm/lm.h |
| 173 | hle/service/mii/mii.cpp | ||
| 174 | hle/service/mii/mii.h | ||
| 173 | hle/service/mm/mm_u.cpp | 175 | hle/service/mm/mm_u.cpp |
| 174 | hle/service/mm/mm_u.h | 176 | hle/service/mm/mm_u.h |
| 175 | hle/service/nfp/nfp.cpp | 177 | 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 @@ | |||
| 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 | |||
| 14 | namespace Service::Mii { | ||
| 15 | |||
| 16 | class IDatabaseService final : public ServiceFramework<IDatabaseService> { | ||
| 17 | public: | ||
| 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 | |||
| 52 | class MiiDBModule final : public ServiceFramework<MiiDBModule> { | ||
| 53 | public: | ||
| 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 | |||
| 64 | private: | ||
| 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 | |||
| 74 | class MiiImg final : public ServiceFramework<MiiImg> { | ||
| 75 | public: | ||
| 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 | |||
| 100 | void 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 | |||
| 7 | namespace Service::SM { | ||
| 8 | class ServiceManager; | ||
| 9 | } | ||
| 10 | |||
| 11 | namespace Service::Mii { | ||
| 12 | |||
| 13 | void 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 8b84fd349..76a73f741 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include "core/hle/service/ldn/ldn.h" | 32 | #include "core/hle/service/ldn/ldn.h" |
| 33 | #include "core/hle/service/ldr/ldr.h" | 33 | #include "core/hle/service/ldr/ldr.h" |
| 34 | #include "core/hle/service/lm/lm.h" | 34 | #include "core/hle/service/lm/lm.h" |
| 35 | #include "core/hle/service/mii/mii.h" | ||
| 35 | #include "core/hle/service/mm/mm_u.h" | 36 | #include "core/hle/service/mm/mm_u.h" |
| 36 | #include "core/hle/service/nfp/nfp.h" | 37 | #include "core/hle/service/nfp/nfp.h" |
| 37 | #include "core/hle/service/nifm/nifm.h" | 38 | #include "core/hle/service/nifm/nifm.h" |
| @@ -206,6 +207,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) { | |||
| 206 | LDN::InstallInterfaces(*sm); | 207 | LDN::InstallInterfaces(*sm); |
| 207 | LDR::InstallInterfaces(*sm); | 208 | LDR::InstallInterfaces(*sm); |
| 208 | LM::InstallInterfaces(*sm); | 209 | LM::InstallInterfaces(*sm); |
| 210 | Mii::InstallInterfaces(*sm); | ||
| 209 | MM::InstallInterfaces(*sm); | 211 | MM::InstallInterfaces(*sm); |
| 210 | NFP::InstallInterfaces(*sm); | 212 | NFP::InstallInterfaces(*sm); |
| 211 | NIFM::InstallInterfaces(*sm); | 213 | NIFM::InstallInterfaces(*sm); |