diff options
| author | 2018-10-18 22:34:30 +1100 | |
|---|---|---|
| committer | 2018-11-18 23:21:33 -0500 | |
| commit | 0c3e7b708684fb17cb29c491fca46125d7d716b9 (patch) | |
| tree | 2b0d5fa7202464a02dee2cc08e0155e43b2c2691 /src/core | |
| parent | Added debugpad skeleton (diff) | |
| download | yuzu-0c3e7b708684fb17cb29c491fca46125d7d716b9.tar.gz yuzu-0c3e7b708684fb17cb29c491fca46125d7d716b9.tar.xz yuzu-0c3e7b708684fb17cb29c491fca46125d7d716b9.zip | |
Added missing start/end touch attributes to touchscreen
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.h | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index 43efef803..07244fe4e 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp | |||
| @@ -41,7 +41,11 @@ void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) { | |||
| 41 | 41 | ||
| 42 | const auto [x, y, pressed] = touch_device->GetStatus(); | 42 | const auto [x, y, pressed] = touch_device->GetStatus(); |
| 43 | auto& touch_entry = cur_entry.states[0]; | 43 | auto& touch_entry = cur_entry.states[0]; |
| 44 | touch_entry.attribute.raw = 0; | ||
| 44 | if (pressed) { | 45 | if (pressed) { |
| 46 | if (cur_entry.entry_count == 0) { | ||
| 47 | touch_entry.attribute.start_touch.Assign(1); | ||
| 48 | } | ||
| 45 | touch_entry.x = static_cast<u16>(x * Layout::ScreenUndocked::Width); | 49 | touch_entry.x = static_cast<u16>(x * Layout::ScreenUndocked::Width); |
| 46 | touch_entry.y = static_cast<u16>(y * Layout::ScreenUndocked::Height); | 50 | touch_entry.y = static_cast<u16>(y * Layout::ScreenUndocked::Height); |
| 47 | touch_entry.diameter_x = 15; | 51 | touch_entry.diameter_x = 15; |
| @@ -53,6 +57,9 @@ void Controller_Touchscreen::OnUpdate(u8* data, std::size_t size) { | |||
| 53 | touch_entry.finger = 0; | 57 | touch_entry.finger = 0; |
| 54 | cur_entry.entry_count = 1; | 58 | cur_entry.entry_count = 1; |
| 55 | } else { | 59 | } else { |
| 60 | if (cur_entry.entry_count == 1) { | ||
| 61 | touch_entry.attribute.end_touch.Assign(1); | ||
| 62 | } | ||
| 56 | cur_entry.entry_count = 0; | 63 | cur_entry.entry_count = 0; |
| 57 | } | 64 | } |
| 58 | 65 | ||
diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h index e5db6e6ba..94cd0eba9 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.h +++ b/src/core/hle/service/hid/controllers/touchscreen.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "common/bit_field.h" | ||
| 7 | #include "common/common_funcs.h" | 8 | #include "common/common_funcs.h" |
| 8 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 9 | #include "common/swap.h" | 10 | #include "common/swap.h" |
| @@ -29,9 +30,18 @@ public: | |||
| 29 | void OnLoadInputDevices() override; | 30 | void OnLoadInputDevices() override; |
| 30 | 31 | ||
| 31 | private: | 32 | private: |
| 33 | struct Attributes { | ||
| 34 | union { | ||
| 35 | u32 raw{}; | ||
| 36 | BitField<0, 1, u32_le> start_touch; | ||
| 37 | BitField<1, 1, u32_le> end_touch; | ||
| 38 | }; | ||
| 39 | }; | ||
| 40 | static_assert(sizeof(Attributes) == 0x4, "Attributes is an invalid size"); | ||
| 41 | |||
| 32 | struct TouchState { | 42 | struct TouchState { |
| 33 | u64_le delta_time; | 43 | u64_le delta_time; |
| 34 | u32_le attribute; | 44 | Attributes attribute; |
| 35 | u32_le finger; | 45 | u32_le finger; |
| 36 | u32_le x; | 46 | u32_le x; |
| 37 | u32_le y; | 47 | u32_le y; |