diff options
| -rw-r--r-- | src/common/emu_window.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h index b6b7bfd26..7c3486dea 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h | |||
| @@ -105,7 +105,7 @@ public: | |||
| 105 | * @todo Fix this function to be thread-safe. | 105 | * @todo Fix this function to be thread-safe. |
| 106 | * @return PadState object indicating the current pad state | 106 | * @return PadState object indicating the current pad state |
| 107 | */ | 107 | */ |
| 108 | const Service::HID::PadState GetPadState() const { | 108 | Service::HID::PadState GetPadState() const { |
| 109 | return pad_state; | 109 | return pad_state; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| @@ -116,7 +116,7 @@ public: | |||
| 116 | * @return std::tuple of (x, y, pressed) where `x` and `y` are the touch coordinates and | 116 | * @return std::tuple of (x, y, pressed) where `x` and `y` are the touch coordinates and |
| 117 | * `pressed` is true if the touch screen is currently being pressed | 117 | * `pressed` is true if the touch screen is currently being pressed |
| 118 | */ | 118 | */ |
| 119 | const std::tuple<u16, u16, bool> GetTouchState() const { | 119 | std::tuple<u16, u16, bool> GetTouchState() const { |
| 120 | return std::make_tuple(touch_x, touch_y, touch_pressed); | 120 | return std::make_tuple(touch_x, touch_y, touch_pressed); |
| 121 | } | 121 | } |
| 122 | 122 | ||
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index b27ab6d9b..1053d0f40 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -83,17 +83,17 @@ void Update() { | |||
| 83 | PadState changed = { { (state.hex ^ old_state.hex) } }; | 83 | PadState changed = { { (state.hex ^ old_state.hex) } }; |
| 84 | 84 | ||
| 85 | // Get the current Pad entry | 85 | // Get the current Pad entry |
| 86 | PadDataEntry* pad_entry = &mem->pad.entries[mem->pad.index]; | 86 | PadDataEntry& pad_entry = mem->pad.entries[mem->pad.index]; |
| 87 | 87 | ||
| 88 | // Update entry properties | 88 | // Update entry properties |
| 89 | pad_entry->current_state.hex = state.hex; | 89 | pad_entry.current_state.hex = state.hex; |
| 90 | pad_entry->delta_additions.hex = changed.hex & state.hex; | 90 | pad_entry.delta_additions.hex = changed.hex & state.hex; |
| 91 | pad_entry->delta_removals.hex = changed.hex & old_state.hex;; | 91 | pad_entry.delta_removals.hex = changed.hex & old_state.hex;; |
| 92 | 92 | ||
| 93 | // Set circle Pad | 93 | // Set circle Pad |
| 94 | pad_entry->circle_pad_x = state.circle_left ? -MAX_CIRCLEPAD_POS : | 94 | pad_entry.circle_pad_x = state.circle_left ? -MAX_CIRCLEPAD_POS : |
| 95 | state.circle_right ? MAX_CIRCLEPAD_POS : 0x0; | 95 | state.circle_right ? MAX_CIRCLEPAD_POS : 0x0; |
| 96 | pad_entry->circle_pad_y = state.circle_down ? -MAX_CIRCLEPAD_POS : | 96 | pad_entry.circle_pad_y = state.circle_down ? -MAX_CIRCLEPAD_POS : |
| 97 | state.circle_up ? MAX_CIRCLEPAD_POS : 0x0; | 97 | state.circle_up ? MAX_CIRCLEPAD_POS : 0x0; |
| 98 | 98 | ||
| 99 | // If we just updated index 0, provide a new timestamp | 99 | // If we just updated index 0, provide a new timestamp |
| @@ -106,11 +106,11 @@ void Update() { | |||
| 106 | next_touch_index = (next_touch_index + 1) % mem->touch.entries.size(); | 106 | next_touch_index = (next_touch_index + 1) % mem->touch.entries.size(); |
| 107 | 107 | ||
| 108 | // Get the current touch entry | 108 | // Get the current touch entry |
| 109 | TouchDataEntry* touch_entry = &mem->touch.entries[mem->touch.index]; | 109 | TouchDataEntry& touch_entry = mem->touch.entries[mem->touch.index]; |
| 110 | bool pressed = false; | 110 | bool pressed = false; |
| 111 | 111 | ||
| 112 | std::tie(touch_entry->x, touch_entry->y, pressed) = VideoCore::g_emu_window->GetTouchState(); | 112 | std::tie(touch_entry.x, touch_entry.y, pressed) = VideoCore::g_emu_window->GetTouchState(); |
| 113 | touch_entry->valid.Assign(pressed ? 1 : 0); | 113 | touch_entry.valid.Assign(pressed ? 1 : 0); |
| 114 | 114 | ||
| 115 | // TODO(bunnei): We're not doing anything with offset 0xA8 + 0x18 of HID SharedMemory, which | 115 | // TODO(bunnei): We're not doing anything with offset 0xA8 + 0x18 of HID SharedMemory, which |
| 116 | // supposedly is "Touch-screen entry, which contains the raw coordinate data prior to being | 116 | // supposedly is "Touch-screen entry, which contains the raw coordinate data prior to being |