diff options
| author | 2018-06-05 12:19:29 +0300 | |
|---|---|---|
| committer | 2018-06-05 12:19:29 +0300 | |
| commit | 7e3d746b06d68a7fbadf5b94ef62cad38482c000 (patch) | |
| tree | 0c8616b647938f063f4159b31e8d9cbdf333e855 /src | |
| parent | Merge pull request #518 from Subv/incomplete_shaders (diff) | |
| download | yuzu-7e3d746b06d68a7fbadf5b94ef62cad38482c000.tar.gz yuzu-7e3d746b06d68a7fbadf5b94ef62cad38482c000.tar.xz yuzu-7e3d746b06d68a7fbadf5b94ef62cad38482c000.zip | |
Service/MM: add service and stub some functions
Diffstat (limited to 'src')
| -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/mm/mm_u.cpp | 50 | ||||
| -rw-r--r-- | src/core/hle/service/mm/mm_u.h | 29 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 2 |
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..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 | |||
| 12 | namespace Service::MM { | ||
| 13 | |||
| 14 | void InstallInterfaces(SM::ServiceManager& service_manager) { | ||
| 15 | std::make_shared<MM_U>()->InstallAsService(service_manager); | ||
| 16 | } | ||
| 17 | |||
| 18 | void 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 | |||
| 24 | void 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 | |||
| 33 | void 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 | |||
| 40 | MM_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 | |||
| 11 | namespace Service::MM { | ||
| 12 | |||
| 13 | class MM_U final : public ServiceFramework<MM_U> { | ||
| 14 | public: | ||
| 15 | MM_U(); | ||
| 16 | ~MM_U() = default; | ||
| 17 | |||
| 18 | private: | ||
| 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. | ||
| 27 | void 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); |