summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/controllers/npad.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-12-24 22:19:16 +0100
committerZach Hilman <zachhilman@gmail.com>2018-12-28 21:32:03 +0100
commit621b25b6be99d357c9996fcb2df77f42c7dc2001 (patch)
tree247cd25071b9e08657e1269e5f307b3c55b442ed /src/core/hle/service/hid/controllers/npad.cpp
parentromfs: Add SingleDiscard extraction type (diff)
downloadyuzu-621b25b6be99d357c9996fcb2df77f42c7dc2001.tar
yuzu-621b25b6be99d357c9996fcb2df77f42c7dc2001.tar.gz
yuzu-621b25b6be99d357c9996fcb2df77f42c7dc2001.tar.bz2
yuzu-621b25b6be99d357c9996fcb2df77f42c7dc2001.tar.lz
yuzu-621b25b6be99d357c9996fcb2df77f42c7dc2001.tar.xz
yuzu-621b25b6be99d357c9996fcb2df77f42c7dc2001.tar.zst
yuzu-621b25b6be99d357c9996fcb2df77f42c7dc2001.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 75fdb861a..2829f64e9 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -410,6 +410,8 @@ void Controller_NPad::OnUpdate(u8* data, std::size_t data_len) {
libnx_entry.pad.pad_states.raw = pad_state.pad_states.raw;
libnx_entry.pad.l_stick = pad_state.l_stick;
libnx_entry.pad.r_stick = pad_state.r_stick;
+
+ press_state |= static_cast<u32>(pad_state.pad_states.raw);
}
std::memcpy(data + NPAD_OFFSET, shared_memory_entries.data(),
shared_memory_entries.size() * sizeof(NPadEntry));
@@ -636,6 +638,12 @@ void Controller_NPad::ClearAllControllers() {
});
}
+u32 Controller_NPad::GetPressState() {
+ const auto res = press_state;
+ press_state = 0;
+ return res;
+}
+
bool Controller_NPad::IsControllerSupported(NPadControllerType controller) const {
const bool support_handheld =
std::find(supported_npad_id_types.begin(), supported_npad_id_types.end(), NPAD_HANDHELD) !=