summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/hid.cpp33
-rw-r--r--src/core/hle/service/hid.h37
-rw-r--r--src/core/hle/service/service.cpp2
3 files changed, 72 insertions, 0 deletions
diff --git a/src/core/hle/service/hid.cpp b/src/core/hle/service/hid.cpp
new file mode 100644
index 000000000..2d823dd16
--- /dev/null
+++ b/src/core/hle/service/hid.cpp
@@ -0,0 +1,33 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5#include "common/log.h"
6
7#include "core/hle/hle.h"
8#include "core/hle/service/hid.h"
9
10////////////////////////////////////////////////////////////////////////////////////////////////////
11// Namespace HID_User
12
13namespace HID_User {
14
15const HLE::FunctionDef FunctionTable[] = {
16 {0x000A0000, NULL, "GetIPCHandles"},
17 {0x00110000, NULL, "EnableAccelerometer"},
18 {0x00130000, NULL, "EnableGyroscopeLow"},
19 {0x00150000, NULL, "GetGyroscopeLowRawToDpsCoefficient"},
20 {0x00160000, NULL, "GetGyroscopeLowCalibrateParam"},
21};
22
23////////////////////////////////////////////////////////////////////////////////////////////////////
24// Interface class
25
26Interface::Interface() {
27 Register(FunctionTable, ARRAY_SIZE(FunctionTable));
28}
29
30Interface::~Interface() {
31}
32
33} // namespace
diff --git a/src/core/hle/service/hid.h b/src/core/hle/service/hid.h
new file mode 100644
index 000000000..746c1b1fc
--- /dev/null
+++ b/src/core/hle/service/hid.h
@@ -0,0 +1,37 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9////////////////////////////////////////////////////////////////////////////////////////////////////
10// Namespace HID_User
11
12// This service is used for interfacing to physical user controls... perhaps "Human Interface
13// Devices"? Uses include game pad controls, accelerometers, gyroscopes, etc.
14
15namespace HID_User {
16
17class Interface : public Service::Interface {
18public:
19
20 Interface();
21
22 ~Interface();
23
24 /**
25 * Gets the string port name used by CTROS for the service
26 * @return Port name of service
27 */
28 std::string GetPortName() const {
29 return "hid:USER";
30 }
31
32private:
33
34 DISALLOW_COPY_AND_ASSIGN(Interface);
35};
36
37} // namespace
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index f612ff830..e6605a398 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -10,6 +10,7 @@
10#include "core/hle/service/service.h" 10#include "core/hle/service/service.h"
11#include "core/hle/service/apt.h" 11#include "core/hle/service/apt.h"
12#include "core/hle/service/gsp.h" 12#include "core/hle/service/gsp.h"
13#include "core/hle/service/hid.h"
13#include "core/hle/service/srv.h" 14#include "core/hle/service/srv.h"
14 15
15namespace Service { 16namespace Service {
@@ -78,6 +79,7 @@ void Init() {
78 g_manager->AddService(new SRV::Interface); 79 g_manager->AddService(new SRV::Interface);
79 g_manager->AddService(new APT_U::Interface); 80 g_manager->AddService(new APT_U::Interface);
80 g_manager->AddService(new GSP_GPU::Interface); 81 g_manager->AddService(new GSP_GPU::Interface);
82 g_manager->AddService(new HID_User::Interface);
81 83
82 NOTICE_LOG(HLE, "Services initialized OK"); 84 NOTICE_LOG(HLE, "Services initialized OK");
83} 85}