mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-04 21:05:06 +01:00
service: hid: Set the correct maxEntry value and signal on acquire event handle
This commit is contained in:
parent
baa6b5d5ea
commit
4da934579c
@ -188,8 +188,8 @@ namespace skyline::input {
|
||||
|
||||
info.header.timestamp = util::GetTimeTicks();
|
||||
info.header.entryCount = std::min(static_cast<u8>(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)};
|
||||
|
||||
|
@ -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<u8>(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;
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,8 @@ namespace skyline::service::hid {
|
||||
auto id{request.Pop<NpadId>()};
|
||||
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 {};
|
||||
|
Loading…
Reference in New Issue
Block a user