summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/fgm/fgm.cpp75
-rw-r--r--src/core/hle/service/fgm/fgm.h15
-rw-r--r--src/core/hle/service/service.cpp2
6 files changed, 96 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 55de535c0..01dd052c4 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -171,6 +171,7 @@ void FileBackend::Write(const Entry& entry) {
171 SUB(Service, BCAT) \ 171 SUB(Service, BCAT) \
172 SUB(Service, BTM) \ 172 SUB(Service, BTM) \
173 SUB(Service, Fatal) \ 173 SUB(Service, Fatal) \
174 SUB(Service, FGM) \
174 SUB(Service, Friend) \ 175 SUB(Service, Friend) \
175 SUB(Service, FS) \ 176 SUB(Service, FS) \
176 SUB(Service, HID) \ 177 SUB(Service, HID) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index e8d98de99..475493dd2 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -58,6 +58,7 @@ enum class Class : ClassType {
58 Service_BCAT, ///< The BCAT service 58 Service_BCAT, ///< The BCAT service
59 Service_BTM, ///< The BTM service 59 Service_BTM, ///< The BTM service
60 Service_Fatal, ///< The Fatal service 60 Service_Fatal, ///< The Fatal service
61 Service_FGM, ///< The FGM service
61 Service_Friend, ///< The friend service 62 Service_Friend, ///< The friend service
62 Service_FS, ///< The FS (Filesystem) service 63 Service_FS, ///< The FS (Filesystem) service
63 Service_HID, ///< The HID (Human interface device) service 64 Service_HID, ///< The HID (Human interface device) service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 3386c2231..69371d080 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -160,6 +160,8 @@ add_library(core STATIC
160 hle/service/filesystem/filesystem.h 160 hle/service/filesystem/filesystem.h
161 hle/service/filesystem/fsp_srv.cpp 161 hle/service/filesystem/fsp_srv.cpp
162 hle/service/filesystem/fsp_srv.h 162 hle/service/filesystem/fsp_srv.h
163 hle/service/fgm/fgm.cpp
164 hle/service/fgm/fgm.h
163 hle/service/friend/friend.cpp 165 hle/service/friend/friend.cpp
164 hle/service/friend/friend.h 166 hle/service/friend/friend.h
165 hle/service/friend/interface.cpp 167 hle/service/friend/interface.cpp
diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp
new file mode 100644
index 000000000..566fbf924
--- /dev/null
+++ b/src/core/hle/service/fgm/fgm.cpp
@@ -0,0 +1,75 @@
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 "core/hle/ipc_helpers.h"
8#include "core/hle/kernel/hle_ipc.h"
9#include "core/hle/service/fgm/fgm.h"
10#include "core/hle/service/service.h"
11#include "core/hle/service/sm/sm.h"
12
13namespace Service::FGM {
14
15class IRequest final : public ServiceFramework<IRequest> {
16public:
17 explicit IRequest() : ServiceFramework{"IRequest"} {
18 // clang-format off
19 static const FunctionInfo functions[] = {
20 {0, nullptr, "Initialize"},
21 {1, nullptr, "Set"},
22 {2, nullptr, "Get"},
23 {3, nullptr, "Cancel"},
24 };
25 // clang-format on
26
27 RegisterHandlers(functions);
28 }
29};
30
31class FGM final : public ServiceFramework<FGM> {
32public:
33 explicit FGM(const char* name) : ServiceFramework{name} {
34 // clang-format off
35 static const FunctionInfo functions[] = {
36 {0, &FGM::Initialize, "Initialize"},
37 };
38 // clang-format on
39
40 RegisterHandlers(functions);
41 }
42
43private:
44 void Initialize(Kernel::HLERequestContext& ctx) {
45 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
46 rb.Push(RESULT_SUCCESS);
47 rb.PushIpcInterface<IRequest>();
48
49 LOG_DEBUG(Service_FGM, "called");
50 }
51};
52
53class FGM_DBG final : public ServiceFramework<FGM_DBG> {
54public:
55 explicit FGM_DBG() : ServiceFramework{"fgm:dbg"} {
56 // clang-format off
57 static const FunctionInfo functions[] = {
58 {0, nullptr, "Initialize"},
59 {1, nullptr, "Read"},
60 {2, nullptr, "Cancel"},
61 };
62 // clang-format on
63
64 RegisterHandlers(functions);
65 }
66};
67
68void InstallInterfaces(SM::ServiceManager& sm) {
69 std::make_shared<FGM>("fgm")->InstallAsService(sm);
70 std::make_shared<FGM>("fgm:0")->InstallAsService(sm);
71 std::make_shared<FGM>("fgm:9")->InstallAsService(sm);
72 std::make_shared<FGM_DBG>()->InstallAsService(sm);
73}
74
75} // namespace Service::FGM
diff --git a/src/core/hle/service/fgm/fgm.h b/src/core/hle/service/fgm/fgm.h
new file mode 100644
index 000000000..e59691264
--- /dev/null
+++ b/src/core/hle/service/fgm/fgm.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
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::FGM {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::FGM
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 3cad64837..d6ebfaac5 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -27,6 +27,7 @@
27#include "core/hle/service/es/es.h" 27#include "core/hle/service/es/es.h"
28#include "core/hle/service/eupld/eupld.h" 28#include "core/hle/service/eupld/eupld.h"
29#include "core/hle/service/fatal/fatal.h" 29#include "core/hle/service/fatal/fatal.h"
30#include "core/hle/service/fgm/fgm.h"
30#include "core/hle/service/filesystem/filesystem.h" 31#include "core/hle/service/filesystem/filesystem.h"
31#include "core/hle/service/friend/friend.h" 32#include "core/hle/service/friend/friend.h"
32#include "core/hle/service/grc/grc.h" 33#include "core/hle/service/grc/grc.h"
@@ -208,6 +209,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
208 ES::InstallInterfaces(*sm); 209 ES::InstallInterfaces(*sm);
209 EUPLD::InstallInterfaces(*sm); 210 EUPLD::InstallInterfaces(*sm);
210 Fatal::InstallInterfaces(*sm); 211 Fatal::InstallInterfaces(*sm);
212 FGM::InstallInterfaces(*sm);
211 FileSystem::InstallInterfaces(*sm); 213 FileSystem::InstallInterfaces(*sm);
212 Friend::InstallInterfaces(*sm); 214 Friend::InstallInterfaces(*sm);
213 GRC::InstallInterfaces(*sm); 215 GRC::InstallInterfaces(*sm);