From a1a1a5c6c537fa35f914e3bb5deaae48ada95c99 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 8 Mar 2015 21:32:13 -0400 Subject: HID: Cleanup how `next_touch_index` is calculated for Pad and touch. --- src/core/hle/service/hid/hid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service/hid/hid.cpp') diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 72e2d63e..703a765b 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -88,7 +88,7 @@ void PadUpdateComplete() { shared_mem->pad.current_state.hex = next_state.hex; shared_mem->pad.index = next_pad_index; - next_pad_index = (next_pad_index + 1) % shared_mem->pad.entries.size(); + ++next_touch_index %= shared_mem->pad.entries.size(); // Get the previous Pad state u32 last_entry_index = (shared_mem->pad.index - 1) % shared_mem->pad.entries.size(); @@ -146,7 +146,7 @@ void TouchUpdateComplete() { return; shared_mem->touch.index = next_touch_index; - next_touch_index = (next_touch_index + 1) % shared_mem->touch.entries.size(); + ++next_touch_index %= shared_mem->touch.entries.size(); // Get the current touch entry TouchDataEntry* current_touch_entry = &shared_mem->touch.entries[shared_mem->touch.index]; -- cgit v1.2.3