summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/ngct
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-08-27 02:16:09 +0200
committergerman77 <juangerman-13@hotmail.com>2021-08-27 21:15:34 +0200
commitf134a5e56cbd7f507914ea4092ae561f8b23936b (patch)
tree3b49071060f0ff88c3469848f08a19a1971441f8 /src/core/hle/service/ngct
parentMerge pull request #6870 from yzct12345/trace-back-stack-back-stack-back (diff)
downloadyuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.tar
yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.tar.gz
yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.tar.bz2
yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.tar.lz
yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.tar.xz
yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.tar.zst
yuzu-f134a5e56cbd7f507914ea4092ae561f8b23936b.zip
Diffstat (limited to 'src/core/hle/service/ngct')
-rw-r--r--src/core/hle/service/ngct/ngct.cpp46
-rw-r--r--src/core/hle/service/ngct/ngct.h20
2 files changed, 66 insertions, 0 deletions
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 @@
+// Copyright 2021 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included
+
+#include "common/string_util.h"
+#include "core/core.h"
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/ngct/ngct.h"
+#include "core/hle/service/service.h"
+
+namespace Service::NGCT {
+
+class IService final : public ServiceFramework<IService> {
+public:
+ explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "Match"},
+ {1, &IService::Filter, "Filter"},
+ };
+ // clang-format on
+
+ RegisterHandlers(functions);
+ }
+
+private:
+ void Filter(Kernel::HLERequestContext& ctx) {
+ const auto buffer = ctx.ReadBuffer();
+ const auto text = Common::StringFromFixedZeroTerminatedBuffer(
+ reinterpret_cast<const char*>(buffer.data()), buffer.size());
+
+ LOG_WARNING(Service_NGCT, "(STUBBED) called, text={}", text);
+
+ // Return the same string since we don't censor anything
+ ctx.WriteBuffer(buffer);
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(ResultSuccess);
+ }
+};
+
+void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
+ std::make_shared<IService>(system)->InstallAsService(system.ServiceManager());
+}
+
+} // 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 @@
+// Copyright 2021 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included
+
+#pragma once
+
+namespace Core {
+class System;
+}
+
+namespace Service::SM {
+class ServiceManager;
+}
+
+namespace Service::NGCT {
+
+/// Registers all NGCT services with the specified service manager.
+void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
+
+} // namespace Service::NGCT