summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/hid.cpp49
-rw-r--r--src/core/hle/svc.cpp2
-rw-r--r--src/video_core/pica.h2
-rw-r--r--src/video_core/video_core.cpp5
4 files changed, 47 insertions, 11 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 @@
5#include "common/log.h" 5#include "common/log.h"
6 6
7#include "core/hle/hle.h" 7#include "core/hle/hle.h"
8#include "core/hle/kernel/event.h"
9#include "core/hle/kernel/shared_memory.h"
8#include "core/hle/service/hid.h" 10#include "core/hle/service/hid.h"
9 11
10//////////////////////////////////////////////////////////////////////////////////////////////////// 12////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -12,18 +14,55 @@
12 14
13namespace HID_User { 15namespace HID_User {
14 16
17Handle g_shared_mem = 0; ///< Handle to shared memory region designated to HID_User service
18
19/**
20 * HID_User::GetIPCHandles service function
21 * Inputs:
22 * None
23 * Outputs:
24 * 1 : Result of function, 0 on success, otherwise error code
25 * 2 : Unused
26 * 3 : Handle to HID_User shared memory
27 * 4 : Event signaled by HID_User
28 * 5 : Event signaled by HID_User
29 * 6 : Event signaled by HID_User
30 * 7 : Gyroscope event
31 * 8 : Event signaled by HID_User
32 */
33void GetIPCHandles(Service::Interface* self) {
34 u32* cmd_buff = Service::GetCommandBuffer();
35
36 cmd_buff[1] = 0; // No error
37 cmd_buff[3] = g_shared_mem;
38 cmd_buff[4] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventA");
39 cmd_buff[5] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventB");
40 cmd_buff[6] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventC");
41 cmd_buff[7] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventGyroscope");
42 cmd_buff[8] = Kernel::CreateEvent(RESETTYPE_ONESHOT, "HID_User:EventD");
43
44 DEBUG_LOG(KERNEL, "called");
45}
46
15const Interface::FunctionInfo FunctionTable[] = { 47const Interface::FunctionInfo FunctionTable[] = {
16 {0x000A0000, nullptr, "GetIPCHandles"}, 48 {0x000A0000, GetIPCHandles, "GetIPCHandles"},
17 {0x00110000, nullptr, "EnableAccelerometer"}, 49 {0x000B0000, nullptr, "StartAnalogStickCalibration"},
18 {0x00130000, nullptr, "EnableGyroscopeLow"}, 50 {0x000E0000, nullptr, "GetAnalogStickCalibrateParam"},
19 {0x00150000, nullptr, "GetGyroscopeLowRawToDpsCoefficient"}, 51 {0x00110000, nullptr, "EnableAccelerometer"},
20 {0x00160000, nullptr, "GetGyroscopeLowCalibrateParam"}, 52 {0x00120000, nullptr, "DisableAccelerometer"},
53 {0x00130000, nullptr, "EnableGyroscopeLow"},
54 {0x00140000, nullptr, "DisableGyroscopeLow"},
55 {0x00150000, nullptr, "GetGyroscopeLowRawToDpsCoefficient"},
56 {0x00160000, nullptr, "GetGyroscopeLowCalibrateParam"},
57 {0x00170000, nullptr, "GetSoundVolume"},
21}; 58};
22 59
23//////////////////////////////////////////////////////////////////////////////////////////////////// 60////////////////////////////////////////////////////////////////////////////////////////////////////
24// Interface class 61// Interface class
25 62
26Interface::Interface() { 63Interface::Interface() {
64 g_shared_mem = Kernel::CreateSharedMemory("HID_User:SharedMem"); // Create shared memory object
65
27 Register(FunctionTable, ARRAY_SIZE(FunctionTable)); 66 Register(FunctionTable, ARRAY_SIZE(FunctionTable));
28} 67}
29 68
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
56 56
57/// Maps a memory block to specified address 57/// Maps a memory block to specified address
58Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) { 58Result MapMemoryBlock(Handle handle, u32 addr, u32 permissions, u32 other_permissions) {
59 DEBUG_LOG(SVC, "called memblock=0x08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d", 59 DEBUG_LOG(SVC, "called memblock=0x%08X, addr=0x%08X, mypermissions=0x%08X, otherpermission=%d",
60 handle, addr, permissions, other_permissions); 60 handle, addr, permissions, other_permissions);
61 61
62 Kernel::MemoryPermission permissions_type = static_cast<Kernel::MemoryPermission>(permissions); 62 Kernel::MemoryPermission permissions_type = static_cast<Kernel::MemoryPermission>(permissions);
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 81af57336..640830144 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -549,8 +549,6 @@ struct float24 {
549 } 549 }
550 550
551private: 551private:
552 float24() = default;
553
554 // Stored as a regular float, merely for convenience 552 // Stored as a regular float, merely for convenience
555 // TODO: Perform proper arithmetic on this! 553 // TODO: Perform proper arithmetic on this!
556 float value; 554 float value;
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp
index 3b8039de4..087b08026 100644
--- a/src/video_core/video_core.cpp
+++ b/src/video_core/video_core.cpp
@@ -31,10 +31,9 @@ void Start() {
31/// Initialize the video core 31/// Initialize the video core
32void Init(EmuWindow* emu_window) { 32void Init(EmuWindow* emu_window) {
33 33
34#if EMU_PLATFORM == PLATFORM_MACOSX 34 // Required in order for GLFW to work on Linux,
35 // Known problem with GLEW prevents contexts above 2.x on OSX unless glewExperimental is enabled. 35 // or for GL contexts above 2.x on OS X
36 glewExperimental = GL_TRUE; 36 glewExperimental = GL_TRUE;
37#endif
38 37
39 g_emu_window = emu_window; 38 g_emu_window = emu_window;
40 g_emu_window->MakeCurrent(); 39 g_emu_window->MakeCurrent();