First-person view toggle (F10 menu row, F7, LARP_FIRST_PERSON) #86
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/gamingwithhomie--larp!86
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-86"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@SheppardX on GitHub · 2026-12-05 18:00 UTC · original
SheppardX:feature/first-person-toggle→main· +244 −8 · 16 files · 1 commits · merged 2026-12-05 19:00 UTCSummary
Adds a toggle for the title's own first-person camera, which no control in the game reaches. Off by default.
settings.ini.settings.ini/ environment:first_person = on|off, orLARP_FIRST_PERSON=1.Only for build 1.0.2.1 (
b99f876b…); on any other build the hook's byte check refuses and the option does nothing.How it works
The title picks the first-person camera when its view mode at
[title+0x5073C20() + 0x98]is 2 (its own test attitle+0xB79480). While the option is on, the entry of the camera selector (title+0x8317A0) holds that mode at 2; switched off, the value it found there is put back. A short black cut, as when the title itself changes view.The selector's arguments are unknown, so the detour goes through a naked thunk that keeps the flags, every volatile register and xmm0–xmm5, calls the Rust side on a 16-byte aligned stack with shadow space, then jumps to the original.
Tried and dropped (noted in the code so nobody repeats them): asking for the first-person camera's hash at the camera switch (
title+0x1DBBD50), or holding the director's phone flags (+0xBEB..+0xBEE), both leave the camera at hip height.Changes
crates/larp-game/src/hooks.rs:FirstPersonhook entry (selector, accessor, offset).crates/larp-game/src/settings.rs:Target::FirstPersonand thefirst_personsetting.crates/larp-hle/src/firstperson.rs(new): the on/off state and the mode hold, with a unit test.crates/larp-hle/src/settings.rs,settings/menu.rs,modules/gameinput.rs: the setting's arms, and F7 as a menu action.apps/larp/src/hooks.rs,run.rs: the detour and its register-keeping thunk.locales/*.json:setting.first_person.label/.aboutin all 7 languages.Verification
On this branch (
93042a5):cargo test --locked -p larp-core -p larp-hle -p larp-game -p larp: all passed, includingholds_first_person_and_gives_the_titles_mode_backand the locale completeness test.cargo clippy --workspace --all-targets --locked: no warnings in the changed code (the two inapps/larp/src/hooks.rs:486andrun.rs:7are already onmain).cargo build --release --locked -p larp: succeeded.In game: the same hook and view-mode write were confirmed working on foot and in a car (controller) under another Series compatibility layer on the same build. In larp, a run of an earlier build of this change logged the menu toggle reaching the layer; a full in-game check of this exact branch has not been done yet.
Notes:
record_keys,#[cfg(feature = "diagnostics")]); in such a build F7 does both.🤖 Generated with Claude Code
The title has a first-person camera that no control reaches. While the new `first_person` option is on, the camera selector's entry (title+0x8317A0, detoured with every volatile register, the flags and xmm0-5 kept) holds the view mode at [title+0x5073C20() + 0x98] at 2, the value the title's own test takes for the first-person camera; switched off, the mode it found is put back. - larp-game: `Target::FirstPerson`, the `first_person` setting (Picture page, When::Now, LARP_FIRST_PERSON), and the build's `FirstPerson` hook entry. - larp-hle: `firstperson` (state and the mode hold, with a unit test), the setting's arms, and F7 in the menu's keys (toggles the option, writes it to settings.ini like a menu change). - apps/larp: the selector's detour and its register-keeping thunk. - locales: setting.first_person.{label,about} in all seven catalogs. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>