diff options
| author | 2014-04-16 20:58:36 -0400 | |
|---|---|---|
| committer | 2014-04-16 20:58:36 -0400 | |
| commit | bb5bc2df257330561c886ed768ce2191e2641a6c (patch) | |
| tree | a5a10147dc07e3ed40fd73a8b94dc7f53e49bd9a /src | |
| parent | updated service comments (diff) | |
| download | yuzu-bb5bc2df257330561c886ed768ce2191e2641a6c.tar.gz yuzu-bb5bc2df257330561c886ed768ce2191e2641a6c.tar.xz yuzu-bb5bc2df257330561c886ed768ce2191e2641a6c.zip | |
added class stub for HID:User service
Diffstat (limited to 'src')
| -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 @@ | |||
| 155 | <ClCompile Include="hle\hle.cpp" /> | 155 | <ClCompile Include="hle\hle.cpp" /> |
| 156 | <ClCompile Include="hle\service\apt.cpp" /> | 156 | <ClCompile Include="hle\service\apt.cpp" /> |
| 157 | <ClCompile Include="hle\service\gsp.cpp" /> | 157 | <ClCompile Include="hle\service\gsp.cpp" /> |
| 158 | <ClCompile Include="hle\service\hid.cpp" /> | ||
| 158 | <ClCompile Include="hle\service\service.cpp" /> | 159 | <ClCompile Include="hle\service\service.cpp" /> |
| 159 | <ClCompile Include="hle\service\srv.cpp" /> | 160 | <ClCompile Include="hle\service\srv.cpp" /> |
| 160 | <ClCompile Include="hle\syscall.cpp" /> | 161 | <ClCompile Include="hle\syscall.cpp" /> |
| @@ -192,6 +193,7 @@ | |||
| 192 | <ClInclude Include="hle\hle.h" /> | 193 | <ClInclude Include="hle\hle.h" /> |
| 193 | <ClInclude Include="hle\service\apt.h" /> | 194 | <ClInclude Include="hle\service\apt.h" /> |
| 194 | <ClInclude Include="hle\service\gsp.h" /> | 195 | <ClInclude Include="hle\service\gsp.h" /> |
| 196 | <ClInclude Include="hle\service\hid.h" /> | ||
| 195 | <ClInclude Include="hle\service\service.h" /> | 197 | <ClInclude Include="hle\service\service.h" /> |
| 196 | <ClInclude Include="hle\service\srv.h" /> | 198 | <ClInclude Include="hle\service\srv.h" /> |
| 197 | <ClInclude Include="hle\syscall.h" /> | 199 | <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 @@ | |||
| 99 | <ClCompile Include="hle\service\gsp.cpp"> | 99 | <ClCompile Include="hle\service\gsp.cpp"> |
| 100 | <Filter>hle\service</Filter> | 100 | <Filter>hle\service</Filter> |
| 101 | </ClCompile> | 101 | </ClCompile> |
| 102 | <ClCompile Include="hle\service\hid.cpp"> | ||
| 103 | <Filter>hle\service</Filter> | ||
| 104 | </ClCompile> | ||
| 102 | </ItemGroup> | 105 | </ItemGroup> |
| 103 | <ItemGroup> | 106 | <ItemGroup> |
| 104 | <ClInclude Include="arm\disassembler\arm_disasm.h"> | 107 | <ClInclude Include="arm\disassembler\arm_disasm.h"> |
| @@ -193,6 +196,9 @@ | |||
| 193 | <ClInclude Include="hle\service\gsp.h"> | 196 | <ClInclude Include="hle\service\gsp.h"> |
| 194 | <Filter>hle\service</Filter> | 197 | <Filter>hle\service</Filter> |
| 195 | </ClInclude> | 198 | </ClInclude> |
| 199 | <ClInclude Include="hle\service\hid.h"> | ||
| 200 | <Filter>hle\service</Filter> | ||
| 201 | </ClInclude> | ||
| 196 | </ItemGroup> | 202 | </ItemGroup> |
| 197 | <ItemGroup> | 203 | <ItemGroup> |
| 198 | <Text Include="CMakeLists.txt" /> | 204 | <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 @@ | |||
| 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 | |||
| 13 | namespace HID_User { | ||
| 14 | |||
| 15 | const 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 | |||
| 26 | Interface::Interface() { | ||
| 27 | Register(FunctionTable, ARRAY_SIZE(FunctionTable)); | ||
| 28 | } | ||
| 29 | |||
| 30 | Interface::~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 | |||
| 15 | namespace HID_User { | ||
| 16 | |||
| 17 | class Interface : public Service::Interface { | ||
| 18 | public: | ||
| 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 | |||
| 32 | private: | ||
| 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 | ||
| 15 | namespace Service { | 16 | namespace 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 | } |