diff options
-rw-r--r-- | src/core/core.vcxproj | 2 | ||||
-rw-r--r-- | src/core/core.vcxproj.filters | 6 | ||||
-rw-r--r-- | src/core/hle/service/hid.cpp | 33 | ||||
-rw-r--r-- | src/core/hle/service/hid.h | 37 | ||||
-rw-r--r-- | src/core/hle/service/service.cpp | 2 |
5 files changed, 80 insertions, 0 deletions
diff --git a/src/core/core.vcxproj b/src/core/core.vcxproj index 931345441..caf827be4 100644 --- a/src/core/core.vcxproj +++ b/src/core/core.vcxproj @@ -155,6 +155,7 @@ <ClCompile Include="hle\hle.cpp" /> <ClCompile Include="hle\service\apt.cpp" /> <ClCompile Include="hle\service\gsp.cpp" /> + <ClCompile Include="hle\service\hid.cpp" /> <ClCompile Include="hle\service\service.cpp" /> <ClCompile Include="hle\service\srv.cpp" /> <ClCompile Include="hle\syscall.cpp" /> @@ -192,6 +193,7 @@ <ClInclude Include="hle\hle.h" /> <ClInclude Include="hle\service\apt.h" /> <ClInclude Include="hle\service\gsp.h" /> + <ClInclude Include="hle\service\hid.h" /> <ClInclude Include="hle\service\service.h" /> <ClInclude Include="hle\service\srv.h" /> <ClInclude Include="hle\syscall.h" /> diff --git a/src/core/core.vcxproj.filters b/src/core/core.vcxproj.filters index e022785ad..0a5b5a188 100644 --- a/src/core/core.vcxproj.filters +++ b/src/core/core.vcxproj.filters @@ -99,6 +99,9 @@ <ClCompile Include="hle\service\gsp.cpp"> <Filter>hle\service</Filter> </ClCompile> + <ClCompile Include="hle\service\hid.cpp"> + <Filter>hle\service</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="arm\disassembler\arm_disasm.h"> @@ -193,6 +196,9 @@ <ClInclude Include="hle\service\gsp.h"> <Filter>hle\service</Filter> </ClInclude> + <ClInclude Include="hle\service\hid.h"> + <Filter>hle\service</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <Text Include="CMakeLists.txt" /> 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 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#include "common/log.h" + +#include "core/hle/hle.h" +#include "core/hle/service/hid.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Namespace HID_User + +namespace HID_User { + +const HLE::FunctionDef FunctionTable[] = { + {0x000A0000, NULL, "GetIPCHandles"}, + {0x00110000, NULL, "EnableAccelerometer"}, + {0x00130000, NULL, "EnableGyroscopeLow"}, + {0x00150000, NULL, "GetGyroscopeLowRawToDpsCoefficient"}, + {0x00160000, NULL, "GetGyroscopeLowCalibrateParam"}, +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Interface class + +Interface::Interface() { + Register(FunctionTable, ARRAY_SIZE(FunctionTable)); +} + +Interface::~Interface() { +} + +} // 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 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#pragma once + +#include "core/hle/service/service.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Namespace HID_User + +// This service is used for interfacing to physical user controls... perhaps "Human Interface +// Devices"? Uses include game pad controls, accelerometers, gyroscopes, etc. + +namespace HID_User { + +class Interface : public Service::Interface { +public: + + Interface(); + + ~Interface(); + + /** + * Gets the string port name used by CTROS for the service + * @return Port name of service + */ + std::string GetPortName() const { + return "hid:USER"; + } + +private: + + DISALLOW_COPY_AND_ASSIGN(Interface); +}; + +} // 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 @@ #include "core/hle/service/service.h" #include "core/hle/service/apt.h" #include "core/hle/service/gsp.h" +#include "core/hle/service/hid.h" #include "core/hle/service/srv.h" namespace Service { @@ -78,6 +79,7 @@ void Init() { g_manager->AddService(new SRV::Interface); g_manager->AddService(new APT_U::Interface); g_manager->AddService(new GSP_GPU::Interface); + g_manager->AddService(new HID_User::Interface); NOTICE_LOG(HLE, "Services initialized OK"); } |