summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-08-13 00:23:17 +0200
committerbunnei <bunneidev@gmail.com>2014-08-13 00:23:17 +0200
commitbf7bc3dacd7a1a87d068bf7f42432892cb34a5f8 (patch)
treef874735b656200ea23f34da4e2a96284b6f71681 /src/core
parentMerge pull request #41 from archshift/itr (diff)
parentHID: Added new function entries from 3dbrew to FunctionTable. (diff)
downloadyuzu-bf7bc3dacd7a1a87d068bf7f42432892cb34a5f8.tar
yuzu-bf7bc3dacd7a1a87d068bf7f42432892cb34a5f8.tar.gz
yuzu-bf7bc3dacd7a1a87d068bf7f42432892cb34a5f8.tar.bz2
yuzu-bf7bc3dacd7a1a87d068bf7f42432892cb34a5f8.tar.lz
yuzu-bf7bc3dacd7a1a87d068bf7f42432892cb34a5f8.tar.xz
yuzu-bf7bc3dacd7a1a87d068bf7f42432892cb34a5f8.tar.zst
yuzu-bf7bc3dacd7a1a87d068bf7f42432892cb34a5f8.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/hid.cpp49
-rw-r--r--src/core/hle/svc.cpp2
2 files changed, 45 insertions, 6 deletions
diff --git a/src/core/hle/service/hid.cpp b/src/core/hle/service/hid.cpp
index ab78f47d7..4e470795f 100644
--- a/src/core/hle/service/hid.cpp
+++ b/src/core/hle/service/hid.cpp
@@ -5,6 +5,8 @@
#include "common/log.h"
#include "core/hle/hle.h"
+#include "core/hle/kernel/event.h"
+#include "core/hle/kernel/shared_memory.h"
#include "core/hle/service/hid.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -12,18 +14,55 @@
namespace HID_User {
+Handle g_shared_mem = 0; ///< Handle to shared memory region designated to HID_User service
+
+/**
+ * HID_User::GetIPCHandles service function
+ * Inputs:
+ * None
+ * Outputs:
+ * 1 : Result of function, 0 on success, otherwise error code
+ * 2 : Unused
+ * 3 : Handle to HID_User shared memory
+ * 4 : Event signaled by HID_User
+ * 5 : Event signaled by HID_User
+ * 6 : Event signaled by HID_User
+ * 7 : Gyroscope event
+ * 8 : Event signaled by HID_User
+ */
+void GetIPCHandles(Service::Interface* self) {
+ u32* cmd_buff = Service::GetCommandBuffer();
+
+ cmd_buff[1] = 0; // No error
+ cmd_buff[3] = g_shared_mem;
+ cmd_buff[4] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventA");
+ cmd_buff[5] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventB");
+ cmd_buff[6] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventC");
+ cmd_buff[7] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventGyroscope");
+ cmd_buff[8] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventD");
+
+ DEBUG_LOG(KERNEL, "called");
+}
+
const Interface::FunctionInfo FunctionTable[] = {
- {0x000A0000, nullptr, "GetIPCHandles"},
- {0x00110000, nullptr, "EnableAccelerometer"},
- {0x00130000, nullptr, "EnableGyroscopeLow"},
- {0x00150000, nullptr, "GetGyroscopeLowRawToDpsCoefficient"},
- {0x00160000, nullptr, "GetGyroscopeLowCalibrateParam"},
+ {0x000A0000, GetIPCHandles, "GetIPCHandles"},
+ {0x000B0000, nullptr, "StartAnalogStickCalibration"},
+ {0x000E0000, nullptr, "GetAnalogStickCalibrateParam"},
+ {0x00110000, nullptr, "EnableAccelerometer"},
+ {0x00120000, nullptr, "DisableAccelerometer"},
+ {0x00130000, nullptr, "EnableGyroscopeLow"},
+ {0x00140000, nullptr, "DisableGyroscopeLow"},
+ {0x00150000, nullptr, "GetGyroscopeLowRawToDpsCoefficient"},
+ {0x00160000, nullptr, "GetGyroscopeLowCalibrateParam"},
+ {0x00170000, nullptr, "GetSoundVolume"},
};
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface class
Interface::Interface() {
+ g_shared_mem = Kernel::CreateSharedMemory("HID_User:SharedMem"); // Create shared memory object
+
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
}
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 328d048bd..19f717bd2 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -56,7 +56,7 @@ Result ControlMemory(u32* out_addr, u32 operation, u32 addr0, u32 addr1, u32 siz
/// Maps a memory block to specified address
Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) {
- DEBUG_LOG(SVC, "called memblock=0x08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d",
+ DEBUG_LOG(SVC, "called memblock=0x%08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d",
handle, addr, permissions, other_permissions);
Kernel::MemoryPermission permissions_type = static_cast<Kernel::MemoryPermission>(permissions);