From b28af1f6c9d66cdbfbd0982f3de5aabac94cf660 Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Thu, 26 Jul 2018 09:25:54 -0400
Subject: [PATCH] service: Add the grc:c service

Adds the basic skeleton for the grc:c service based off the information
provided by Switch Brew.
---
 src/core/CMakeLists.txt          |  2 ++
 src/core/hle/service/grc/grc.cpp | 31 +++++++++++++++++++++++++++++++
 src/core/hle/service/grc/grc.h   | 15 +++++++++++++++
 src/core/hle/service/service.cpp |  2 ++
 4 files changed, 50 insertions(+)
 create mode 100644 src/core/hle/service/grc/grc.cpp
 create mode 100644 src/core/hle/service/grc/grc.h

diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 2e2de59b12..7d493e0a16 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -156,6 +156,8 @@ add_library(core STATIC
     hle/service/friend/friend.h
     hle/service/friend/interface.cpp
     hle/service/friend/interface.h
+    hle/service/grc/grc.cpp
+    hle/service/grc/grc.h
     hle/service/hid/hid.cpp
     hle/service/hid/hid.h
     hle/service/ldr/ldr.cpp
diff --git a/src/core/hle/service/grc/grc.cpp b/src/core/hle/service/grc/grc.cpp
new file mode 100644
index 0000000000..24910ac6c5
--- /dev/null
+++ b/src/core/hle/service/grc/grc.cpp
@@ -0,0 +1,31 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include <memory>
+
+#include "core/hle/service/grc/grc.h"
+#include "core/hle/service/service.h"
+#include "core/hle/service/sm/sm.h"
+
+namespace Service::GRC {
+
+class GRC final : public ServiceFramework<GRC> {
+public:
+    explicit GRC() : ServiceFramework{"grc:c"} {
+        // clang-format off
+        static const FunctionInfo functions[] = {
+            {1, nullptr, "OpenContinuousRecorder"},
+            {2, nullptr, "OpenGameMovieTrimmer"},
+        };
+        // clang-format on
+
+        RegisterHandlers(functions);
+    }
+};
+
+void InstallInterfaces(SM::ServiceManager& sm) {
+    std::make_shared<GRC>()->InstallAsService(sm);
+}
+
+} // namespace Service::GRC
diff --git a/src/core/hle/service/grc/grc.h b/src/core/hle/service/grc/grc.h
new file mode 100644
index 0000000000..e0d29e70d2
--- /dev/null
+++ b/src/core/hle/service/grc/grc.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::GRC {
+
+void InstallInterfaces(SM::ServiceManager& sm);
+
+} // namespace Service::GRC
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 482989ea72..10c6757e5e 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -27,6 +27,7 @@
 #include "core/hle/service/fatal/fatal.h"
 #include "core/hle/service/filesystem/filesystem.h"
 #include "core/hle/service/friend/friend.h"
+#include "core/hle/service/grc/grc.h"
 #include "core/hle/service/hid/hid.h"
 #include "core/hle/service/ldr/ldr.h"
 #include "core/hle/service/lm/lm.h"
@@ -198,6 +199,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
     Fatal::InstallInterfaces(*sm);
     FileSystem::InstallInterfaces(*sm);
     Friend::InstallInterfaces(*sm);
+    GRC::InstallInterfaces(*sm);
     HID::InstallInterfaces(*sm);
     LDR::InstallInterfaces(*sm);
     LM::InstallInterfaces(*sm);
-- 
GitLab