Pass Konami sequence element counts#91
Open
mjc wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes Konami footpad gesture initialization to pass sequence element counts (not byte sizes) into the Konami state machine, preventing potential out-of-bounds indexing after a gesture is consumed.
Changes:
- Update flywheel Konami gesture initialization to pass array element count.
- Update headlights-on Konami gesture initialization to pass array element count.
- Update headlights-off Konami gesture initialization to pass array element count.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lukash
reviewed
Jul 19, 2026
mjc
force-pushed
the
refloat-fix-konami-length
branch
from
July 20, 2026 16:33
5643199 to
72c0d92
Compare
Contributor
Author
|
Added array_size helper and addressed the other feedback. |
mjc
force-pushed
the
refloat-fix-konami-length
branch
from
July 20, 2026 16:42
72c0d92 to
96ea667
Compare
Contributor
Author
|
second force push was just formatting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passes element counts, rather than byte sizes, when initializing the three footpad gesture sequences.
Why
konami_initexpects auint8_telement count. The old code passedsizeof(sequence), which is the array byte size. After a valid gesture was consumed, the state machine could therefore continue indexing past the end of the sequence.Changes
uint8_tAPI boundary.Scope
Only initialization of the three fixed gestures changes. Their contents, timing, and valid state-machine behavior are otherwise unchanged.
Hilariously, it seems possible to do a TAS-style physical reproduction of this but there is no way I am going to spend the time to try. I did get strange behavior after enough trying to trigger it manually though.