Repository navigation
Game: draw keyboard key caps over the title's button prompts - #3433
Open
imjustprism wants to merge 4 commits into
Open
imjustprism wants to merge 4 commits into
imjustprism wants to merge 4 commits into
Conversation
Contributor
Author
fuzeofficlal
approved these changes
Nov 27, 2026
fuzeofficlal
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me — thorough, clean-room implementation with well-bounded parsing, safe pointer-hook validation, and solid test coverage across the affected crates.
Review & Verification Notes
- Clean-room & dependencies:
cargo xtask policypasses (asset policy: 196 files ok), no new external dependencies are added, and key-cap glyphs are outlined at runtime from host Windows fonts (Segoe UI/Segoe UI Symbol) viaGetGlyphOutlineWwith no bundled retail or font assets. - Safety & bounds:
victory-core/src/pad.rs,victory-formats/src/gfx.rs, andvictory-game/src/prompts.rsare pure safe Rust, with checked arithmetic and explicit bit-width bounds (WIDEST_FIELD_BITS=31,WIDEST_EDGE_BITS=17) throughout GFx/SWF parsing and rewriting.victory-loader/src/windows.rsvalidates 8-byte alignment, image bounds, and data vs. executable section flags (SCN_MEM_EXECUTE) onread_pointer/write_pointer/code_address;prompts/hook.rsverifies the dereferenced original function pointer points into an executable image section before installing and stays completely inactive unless--prompts keys --executeis explicitly requested for a matching known build.
- Local verification on
4f7fdb5d:cargo clippy -p victory-core -p victory-formats -p victory-game -p victory-hle -p victory-loader -p victory --lib --bins --tests -- -D warningsandcargo clippy -p victory-hle -p victory --features diagnostics --tests -- -D warningsare both clean.- Tests pass across all touched crates:
victory-core(14/14),victory-formats(64/64, 5 ignored benchmarks/external),victory-game(50/50, including live Windows GDI font outline tests andprompts::hook::tests),victory-loader(35unit +crash_log+load_probepointer-swap integration tests +title_dlls), andvictory-hlemodules::gameinput(11/11).
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.

with
--prompts keysthe title's button prompts show the keys of the keyboard's stand-in pad (enter, backspace, esc, wasd and so on) instead of xbox buttons. the icon movie is redrawn in memory when the streaming store hands it over: each known icon becomes a white key cap with its label, outlined at run time from segoe ui bold and segoe ui symbol on the host. nothing of the game is stored. the movie is recognised by its structure, and the hook sits on one pointer whose per-build offset is in victory-game. the default stays--prompts gamepad, which places no hook.the stand-in pad's bindings move to victory-core so victory-game can name them without depending on victory-hle, and the loader gets checked helpers to read and write one pointer slot and to resolve a code address.
tested on an rx 9070 xt with a diag build, together with #2427 for a faster start: the first screen shows the y and enter keys, and a playthrough of the menus logged one redraw, the title using it, and no errors. unit tests cover the movie reader, the shape writer, the outline parser and the hook with stand-in title functions. animated hold prompts keep their pad pictures, and the prompts don't switch back when a pad is plugged in.
#3399 takes another route, for playstation glyphs from the user's files; this one draws its own pictures and needs no files.
refs #187