diff options
| author | 2021-08-26 19:16:09 -0500 | |
|---|---|---|
| committer | 2021-08-27 14:15:34 -0500 | |
| commit | f134a5e56cbd7f507914ea4092ae561f8b23936b (patch) | |
| tree | 3b49071060f0ff88c3469848f08a19a1971441f8 | |
| parent | Merge pull request #6870 from yzct12345/trace-back-stack-back-stack-back (diff) | |
| download | yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.tar.gz yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.tar.xz yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.zip | |
ngct: Stub NGCT:U service
| -rw-r--r-- | src/common/logging/filter.cpp | 1 | ||||
| -rw-r--r-- | src/common/logging/types.h | 1 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/ngct/ngct.cpp | 46 | ||||
| -rw-r--r-- | src/core/hle/service/ngct/ngct.h | 20 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 2 |
6 files changed, 72 insertions, 0 deletions
diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index f055f0e11..42744c994 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp | |||
| @@ -111,6 +111,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) { | |||
| 111 | SUB(Service, NCM) \ | 111 | SUB(Service, NCM) \ |
| 112 | SUB(Service, NFC) \ | 112 | SUB(Service, NFC) \ |
| 113 | SUB(Service, NFP) \ | 113 | SUB(Service, NFP) \ |
| 114 | SUB(Service, NGCT) \ | ||
| 114 | SUB(Service, NIFM) \ | 115 | SUB(Service, NIFM) \ |
| 115 | SUB(Service, NIM) \ | 116 | SUB(Service, NIM) \ |
| 116 | SUB(Service, NPNS) \ | 117 | SUB(Service, NPNS) \ |
diff --git a/src/common/logging/types.h b/src/common/logging/types.h index 7ad0334fc..ddf9d27ca 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h | |||
| @@ -81,6 +81,7 @@ enum class Class : u8 { | |||
| 81 | Service_NCM, ///< The NCM service | 81 | Service_NCM, ///< The NCM service |
| 82 | Service_NFC, ///< The NFC (Near-field communication) service | 82 | Service_NFC, ///< The NFC (Near-field communication) service |
| 83 | Service_NFP, ///< The NFP service | 83 | Service_NFP, ///< The NFP service |
| 84 | Service_NGCT, ///< The NGCT (No Good Content for Terra) service | ||
| 84 | Service_NIFM, ///< The NIFM (Network interface) service | 85 | Service_NIFM, ///< The NIFM (Network interface) service |
| 85 | Service_NIM, ///< The NIM service | 86 | Service_NIM, ///< The NIM service |
| 86 | Service_NPNS, ///< The NPNS service | 87 | Service_NPNS, ///< The NPNS service |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index f5cf5c16a..87d47e2e5 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -452,6 +452,8 @@ add_library(core STATIC | |||
| 452 | hle/service/nfp/nfp.h | 452 | hle/service/nfp/nfp.h |
| 453 | hle/service/nfp/nfp_user.cpp | 453 | hle/service/nfp/nfp_user.cpp |
| 454 | hle/service/nfp/nfp_user.h | 454 | hle/service/nfp/nfp_user.h |
| 455 | hle/service/ngct/ngct.cpp | ||
| 456 | hle/service/ngct/ngct.h | ||
| 455 | hle/service/nifm/nifm.cpp | 457 | hle/service/nifm/nifm.cpp |
| 456 | hle/service/nifm/nifm.h | 458 | hle/service/nifm/nifm.h |
| 457 | hle/service/nim/nim.cpp | 459 | hle/service/nim/nim.cpp |
diff --git a/src/core/hle/service/ngct/ngct.cpp b/src/core/hle/service/ngct/ngct.cpp new file mode 100644 index 000000000..deb3abb28 --- /dev/null +++ b/src/core/hle/service/ngct/ngct.cpp | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included | ||
| 4 | |||
| 5 | #include "common/string_util.h" | ||
| 6 | #include "core/core.h" | ||
| 7 | #include "core/hle/ipc_helpers.h" | ||
| 8 | #include "core/hle/service/ngct/ngct.h" | ||
| 9 | #include "core/hle/service/service.h" | ||
| 10 | |||
| 11 | namespace Service::NGCT { | ||
| 12 | |||
| 13 | class IService final : public ServiceFramework<IService> { | ||
| 14 | public: | ||
| 15 | explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} { | ||
| 16 | // clang-format off | ||
| 17 | static const FunctionInfo functions[] = { | ||
| 18 | {0, nullptr, "Match"}, | ||
| 19 | {1, &IService::Filter, "Filter"}, | ||
| 20 | }; | ||
| 21 | // clang-format on | ||
| 22 | |||
| 23 | RegisterHandlers(functions); | ||
| 24 | } | ||
| 25 | |||
| 26 | private: | ||
| 27 | void Filter(Kernel::HLERequestContext& ctx) { | ||
| 28 | const auto buffer = ctx.ReadBuffer(); | ||
| 29 | const auto text = Common::StringFromFixedZeroTerminatedBuffer( | ||
| 30 | reinterpret_cast<const char*>(buffer.data()), buffer.size()); | ||
| 31 | |||
| 32 | LOG_WARNING(Service_NGCT, "(STUBBED) called, text={}", text); | ||
| 33 | |||
| 34 | // Return the same string since we don't censor anything | ||
| 35 | ctx.WriteBuffer(buffer); | ||
| 36 | |||
| 37 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 38 | rb.Push(ResultSuccess); | ||
| 39 | } | ||
| 40 | }; | ||
| 41 | |||
| 42 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { | ||
| 43 | std::make_shared<IService>(system)->InstallAsService(system.ServiceManager()); | ||
| 44 | } | ||
| 45 | |||
| 46 | } // namespace Service::NGCT | ||
diff --git a/src/core/hle/service/ngct/ngct.h b/src/core/hle/service/ngct/ngct.h new file mode 100644 index 000000000..1f2a47b78 --- /dev/null +++ b/src/core/hle/service/ngct/ngct.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | namespace Core { | ||
| 8 | class System; | ||
| 9 | } | ||
| 10 | |||
| 11 | namespace Service::SM { | ||
| 12 | class ServiceManager; | ||
| 13 | } | ||
| 14 | |||
| 15 | namespace Service::NGCT { | ||
| 16 | |||
| 17 | /// Registers all NGCT services with the specified service manager. | ||
| 18 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system); | ||
| 19 | |||
| 20 | } // namespace Service::NGCT | ||
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index b3e50433b..065133166 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | #include "core/hle/service/ncm/ncm.h" | 46 | #include "core/hle/service/ncm/ncm.h" |
| 47 | #include "core/hle/service/nfc/nfc.h" | 47 | #include "core/hle/service/nfc/nfc.h" |
| 48 | #include "core/hle/service/nfp/nfp.h" | 48 | #include "core/hle/service/nfp/nfp.h" |
| 49 | #include "core/hle/service/ngct/ngct.h" | ||
| 49 | #include "core/hle/service/nifm/nifm.h" | 50 | #include "core/hle/service/nifm/nifm.h" |
| 50 | #include "core/hle/service/nim/nim.h" | 51 | #include "core/hle/service/nim/nim.h" |
| 51 | #include "core/hle/service/npns/npns.h" | 52 | #include "core/hle/service/npns/npns.h" |
| @@ -271,6 +272,7 @@ Services::Services(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system | |||
| 271 | NCM::InstallInterfaces(*sm, system); | 272 | NCM::InstallInterfaces(*sm, system); |
| 272 | NFC::InstallInterfaces(*sm, system); | 273 | NFC::InstallInterfaces(*sm, system); |
| 273 | NFP::InstallInterfaces(*sm, system); | 274 | NFP::InstallInterfaces(*sm, system); |
| 275 | NGCT::InstallInterfaces(*sm, system); | ||
| 274 | NIFM::InstallInterfaces(*sm, system); | 276 | NIFM::InstallInterfaces(*sm, system); |
| 275 | NIM::InstallInterfaces(*sm, system); | 277 | NIM::InstallInterfaces(*sm, system); |
| 276 | NPNS::InstallInterfaces(*sm, system); | 278 | NPNS::InstallInterfaces(*sm, system); |