diff --git a/app/src/main/cpp/skyline/input/npad_device.cpp b/app/src/main/cpp/skyline/input/npad_device.cpp index 3f5cb8c9..004f78ca 100644 --- a/app/src/main/cpp/skyline/input/npad_device.cpp +++ b/app/src/main/cpp/skyline/input/npad_device.cpp @@ -188,8 +188,8 @@ namespace skyline::input { info.header.timestamp = util::GetTimeTicks(); info.header.entryCount = std::min(static_cast(info.header.entryCount + 1), constant::HidEntryCount); - info.header.maxEntry = info.header.entryCount; - info.header.currentEntry = (info.header.currentEntry != constant::HidEntryCount - 1) ? info.header.currentEntry + 1 : 0; + info.header.maxEntry = info.header.entryCount - 1; + info.header.currentEntry = (info.header.currentEntry < info.header.maxEntry) ? info.header.currentEntry + 1 : 0; auto &nextEntry{info.state.at(info.header.currentEntry)}; diff --git a/app/src/main/cpp/skyline/input/touch.cpp b/app/src/main/cpp/skyline/input/touch.cpp index 9951b5ea..9a7f4f92 100644 --- a/app/src/main/cpp/skyline/input/touch.cpp +++ b/app/src/main/cpp/skyline/input/touch.cpp @@ -74,15 +74,15 @@ namespace skyline::input { return; const auto &lastEntry{section.entries[section.header.currentEntry]}; - auto entryIndex{(section.header.currentEntry != constant::HidEntryCount - 1) ? section.header.currentEntry + 1 : 0}; - auto &entry{section.entries[entryIndex]}; - entry = screenState; - entry.globalTimestamp = lastEntry.globalTimestamp + 1; - entry.localTimestamp = lastEntry.localTimestamp + 1; section.header.timestamp = util::GetTimeTicks(); section.header.entryCount = std::min(static_cast(section.header.entryCount + 1), constant::HidEntryCount); - section.header.maxEntry = section.header.entryCount; - section.header.currentEntry = entryIndex; + section.header.maxEntry = section.header.entryCount - 1; + section.header.currentEntry = (section.header.currentEntry < section.header.maxEntry) ? section.header.currentEntry + 1 : 0; + + auto &entry{section.entries[section.header.currentEntry]}; + entry = screenState; + entry.globalTimestamp = lastEntry.globalTimestamp + 1; + entry.localTimestamp = lastEntry.localTimestamp + 1; } } diff --git a/app/src/main/cpp/skyline/services/hid/IHidServer.cpp b/app/src/main/cpp/skyline/services/hid/IHidServer.cpp index ca22733d..01714a80 100644 --- a/app/src/main/cpp/skyline/services/hid/IHidServer.cpp +++ b/app/src/main/cpp/skyline/services/hid/IHidServer.cpp @@ -79,6 +79,8 @@ namespace skyline::service::hid { auto id{request.Pop()}; auto handle{state.process->InsertItem(state.input->npad.at(id).updateEvent)}; + state.input->npad.at(id).updateEvent->Signal(); + Logger::Debug("Npad {} Style Set Update Event Handle: 0x{:X}", id, handle); response.copyHandles.push_back(handle); return {};