mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-26 17:34:17 +01:00
Only initialise maxEntry for active input devices
This caused the menus in Sonic Mania to be nonfunctional, futhermore, default init is not ran for the input structs so the default max definition in CommonHeader never actually applied.
This commit is contained in:
parent
bc5c094860
commit
7167393e3c
@ -187,6 +187,7 @@ namespace skyline::input {
|
|||||||
|
|
||||||
info.header.timestamp = util::GetTimeTicks();
|
info.header.timestamp = util::GetTimeTicks();
|
||||||
info.header.entryCount = std::min(static_cast<u8>(info.header.entryCount + 1), constant::HidEntryCount);
|
info.header.entryCount = std::min(static_cast<u8>(info.header.entryCount + 1), constant::HidEntryCount);
|
||||||
|
info.header.maxEntry = constant::HidEntryCount - 1;
|
||||||
info.header.currentEntry = (info.header.currentEntry != constant::HidEntryCount - 1) ? info.header.currentEntry + 1 : 0;
|
info.header.currentEntry = (info.header.currentEntry != constant::HidEntryCount - 1) ? info.header.currentEntry + 1 : 0;
|
||||||
|
|
||||||
auto &entry{info.state.at(info.header.currentEntry)};
|
auto &entry{info.state.at(info.header.currentEntry)};
|
||||||
|
@ -21,7 +21,7 @@ namespace skyline {
|
|||||||
u64 timestamp; //!< The timestamp of the latest entry in ticks
|
u64 timestamp; //!< The timestamp of the latest entry in ticks
|
||||||
u64 entryCount; //!< The number of written entries
|
u64 entryCount; //!< The number of written entries
|
||||||
u64 currentEntry; //!< The index of the latest entry
|
u64 currentEntry; //!< The index of the latest entry
|
||||||
u64 maxEntry{constant::HidEntryCount - 1}; //!< The maximum entry index (16)
|
u64 maxEntry; //!< The maximum entry index
|
||||||
};
|
};
|
||||||
static_assert(sizeof(CommonHeader) == 0x20);
|
static_assert(sizeof(CommonHeader) == 0x20);
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ namespace skyline::input {
|
|||||||
|
|
||||||
section.header.timestamp = util::GetTimeTicks();
|
section.header.timestamp = util::GetTimeTicks();
|
||||||
section.header.entryCount = std::min(static_cast<u8>(section.header.entryCount + 1), constant::HidEntryCount);
|
section.header.entryCount = std::min(static_cast<u8>(section.header.entryCount + 1), constant::HidEntryCount);
|
||||||
|
section.header.maxEntry = constant::HidEntryCount - 1;
|
||||||
section.header.currentEntry = entryIndex;
|
section.header.currentEntry = entryIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user