feat(input):Improving Sprint feature: Sprint sets the game's dash input instead of holding A #2038

Merged
HumanBean merged 4 commits from kendowashere/Longshot:feat/sprint-dash-input into main 2026-11-21 22:41:53 +00:00
Contributor

Summary

Sprint (#1929, #1948, #1977, built on thegrandao's #196) gets the game's run by holding A and then hiding A's "pressed" bit from the game's controllers, so the game sees a held A (its run) without a press (no roll, no talk). This PR keeps everything players see from those PRs: the Sprint row on the Controls tab, the Controls page's Sprint line (Shift and L3 by default, rebindable), its Toggle cell and the saved keys (sprint=, toggle_sprint=, key_sprint, pad_sprint). It replaces only how Link is made to run, with the engine of my Sprint button from the NX2navi runtime (its PRs 752, 887 and 927; Alimjan suggested putting the two together on #196).

How: Link sprints while bit 4 of his input flags (*(Link +0x50)), the dash input, is set: the flag the game sets itself for the run that follows a roll. Two places load those flags: his movement update (f_804caa80 at 0x804ce798, the sprint's start and keep tests) and his stance and camera update (f_80c225d0 at 0x80c27f3c). nx2/oot_patches.py puts a call right after each load, and host/oot_sprint.c ORs the bit in while Sprint runs, only for the Link the player controls. The game's own sprint then runs: its speed, animation, camera, and every rule that ends it.

Why this is better than holding A:

main (A held, press hidden) this PR (dash input)
The player's own A while sprinting Sprint lets go of A for 50 ms (SPRINT_ROLL_GAP_MS) so the game can see a fresh press, then holds it again; a tap counts only through that gap Never touched: A rolls, talks, opens and picks up exactly as without Sprint
What is patched The game's controllers' update, f_8038a220 and also the menus' f_834a3680: every reader of A sees the mask Two loads in Link's own update code; no other actor, menu or controller reader sees anything
Where it acts A is held in whatever state Link is in while the stick is pushed (swimming, carrying, ladders, Epona, aiming...), and what a held A does there is up to the game Only Walk, Jump, Land, Fall and Clamber run it; Slide, StepOn and a roll keep it; any other state ends it
L3 in a conversation Turning Sprint on moves L3 from the Switch's LS to Sprint, so the press that hides the text box in a conversation never reaches the game A press that begins outside gameplay (a conversation or cutscene, an event running, or a load) goes to the game as LS while it is held, and starts no sprint
Toggle A latch: on until the next press, Insert, Plus/Minus or the focus lost; with the stick pushed it holds A again in any later state Also ends when Link stops (after 4 frames standing still, counted in 60 Hz frames so 240 fps behaves like 60), attacks, uses an item, swims, climbs, holds ZL, or input is blocked or an event starts; a roll or a jump keeps it
Other Links The controller's A, so whoever reads it Only the controlled Link (identified through the actor manager's +0x470 and its actor), never the other instance of his class

What players notice: Sprint feels the same (it is the same game run), A works while sprinting, L3 hides the text box again with Sprint on, and a toggled sprint stops when Link stops instead of coming back later.

Also: the Toggle cell's help says a toggled sprint ends with Link's state (all 13 languages), the user guide's Sprint paragraph and the control bridge's Sprint check follow, and injected_buttons (only the A handoff read it) is gone.

Read first: host/oot_sprint.c, hos_sprint_input's call in npad_states (host/nn_hid.c), patch_sprint_link and patch_sprint_stance in nx2/oot_patches.py.

Testing

Tested: Windows 11, NVIDIA GeForce RTX 5070 Ti (driver 621.24), by hand in the game: an earlier version of this branch's engine built together with my other open PRs (#699, #711, #1294) on main @ fd7dc40d (build/combined). Sprint On, Toggle off and on: L3 held (and Shift) runs the game's sprint with no roll and the plain run on letting go; Toggle on starts it with a press, keeps it through a roll and a jump, ends it when Link stops or attacks; A while sprinting rolls and talks as usual; in a conversation L3 hides the text box and starts nothing. Everything worked.

  • The game built from the earlier engine (dev.py packs base, llvm-mingw): oot_patches: Sprint's link site in code_hot.c and ... stance site in code_hot.c, each found once; oot_sprint.c compiled.
  • On the earlier version, tests/test_sprint.py (8 tests): the bindings and layout cases as before, and host/oot_sprint.c compiled alone against a fake game (Link's state chain, the actor and event managers): held on while held and off when let go; A never added and the player's A passed through; Toggle on through jumps, landings, slides and rolls, off at the next press, an attack, ZL, the host's reset, 4 frames standing still (16 updates at 240 fps), 90 frames after a press made standing; a conversation's L3 handed to the game as LS for as long as it is held; nothing handed for a key; blocked (Insert, ocarina) neither; a press held on from a load stays the game's; another Link never sprints. The patch tests have since changed to use synthetic functions and anchors; the updated tests still need to run.
  • On the earlier version, tests/test_input_background.py (every case but stick-directions, which fails on main @ 7c23d2be too, sprint-toggle now checks what npad_states hands host/oot_sprint.c and that the game's buttons stay the player's), test_walk_key, test_bound_keys, test_menu_i18n, test_settings_table, test_menu_modules, test_option_ids, test_alt_enter, test_pad_layout: pass. test_pads_after_menu fails on main too (#1721's stand-in, named in #1977), and test_menu_i18n fails on main @ 7c23d2be the same way (an Output resolution text #1859 changed). The whole suite on main @ e6196f0f: the same failures with and without this change.
  • The engine itself (the same state table, timings and hook sites) is my NX2navi Sprint button, played there since 0.10.0.

Still to test:

  • The updated head: build and automated tests
  • Windows, an Xbox controller: the same checks as above (by hand)
  • Linux: the build and the same checks with a controller (@Beanstalk build and start on Linux)

Measurements

Nothing to measure: per frame, a few guest pointer reads at Link's two updates replace the A handoff and a mask in the controllers' update; no switch is added.

Risks

  • If the recompiler stops writing either load as oot_patches.py expects, the build prints WARNING: Sprint's sites were found .... The sites are patched independently, so one hook may still run if the other is missing.
  • Link's state ids and the event manager's address come from game 1.1.1; another build's ids would end a toggled sprint at once (the sites would not be found there anyway).
  • Players' settings carry over unchanged (sprint=, toggle_sprint=, the bindings). A revert brings back A held.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: the base build above; Linux: the Test Farm)
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary Sprint ([#1929](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1929), [#1948](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1948), [#1977](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1977), built on thegrandao's [#196](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/196)) gets the game's run by **holding A** and then hiding A's "pressed" bit from the game's controllers, so the game sees a held A (its run) without a press (no roll, no talk). This PR keeps everything players see from those PRs: the **Sprint** row on the Controls tab, the Controls page's **Sprint** line (Shift and L3 by default, rebindable), its **Toggle** cell and the saved keys (`sprint=`, `toggle_sprint=`, `key_sprint`, `pad_sprint`). It replaces only how Link is made to run, with the engine of my Sprint button from the NX2navi runtime (its PRs 752, 887 and 927; Alimjan suggested putting the two together on #196). **How:** Link sprints while bit 4 of his input flags (`*(Link +0x50)`), the **dash input**, is set: the flag the game sets itself for the run that follows a roll. Two places load those flags: his movement update (`f_804caa80` at `0x804ce798`, the sprint's start and keep tests) and his stance and camera update (`f_80c225d0` at `0x80c27f3c`). `nx2/oot_patches.py` puts a call right after each load, and `host/oot_sprint.c` ORs the bit in while Sprint runs, only for the Link the player controls. The game's own sprint then runs: its speed, animation, camera, and every rule that ends it. **Why this is better than holding A:** | | main (A held, press hidden) | this PR (dash input) | |---|---|---| | The player's own A while sprinting | Sprint lets go of A for 50 ms (`SPRINT_ROLL_GAP_MS`) so the game can see a fresh press, then holds it again; a tap counts only through that gap | Never touched: A rolls, talks, opens and picks up exactly as without Sprint | | What is patched | The game's controllers' update, `f_8038a220` and also the **menus'** `f_834a3680`: every reader of A sees the mask | Two loads in **Link's own** update code; no other actor, menu or controller reader sees anything | | Where it acts | A is held in whatever state Link is in while the stick is pushed (swimming, carrying, ladders, Epona, aiming...), and what a held A does there is up to the game | Only Walk, Jump, Land, Fall and Clamber run it; Slide, StepOn and a roll keep it; any other state ends it | | L3 in a conversation | Turning Sprint on moves L3 from the Switch's LS to Sprint, so the press that **hides the text box** in a conversation never reaches the game | A press that begins outside gameplay (a conversation or cutscene, an event running, or a load) goes to the game as LS while it is held, and starts no sprint | | Toggle | A latch: on until the next press, Insert, Plus/Minus or the focus lost; with the stick pushed it holds A again in any later state | Also ends when Link stops (after 4 frames standing still, counted in 60 Hz frames so 240 fps behaves like 60), attacks, uses an item, swims, climbs, holds ZL, or input is blocked or an event starts; a roll or a jump keeps it | | Other Links | The controller's A, so whoever reads it | Only the controlled Link (identified through the actor manager's `+0x470` and its actor), never the other instance of his class | What players notice: Sprint feels the same (it is the same game run), A works while sprinting, L3 hides the text box again with Sprint on, and a toggled sprint stops when Link stops instead of coming back later. Also: the Toggle cell's help says a toggled sprint ends with Link's state (all 13 languages), the user guide's Sprint paragraph and the control bridge's Sprint check follow, and `injected_buttons` (only the A handoff read it) is gone. Read first: `host/oot_sprint.c`, `hos_sprint_input`'s call in `npad_states` (`host/nn_hid.c`), `patch_sprint_link` and `patch_sprint_stance` in `nx2/oot_patches.py`. ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 5070 Ti (driver 621.24), by hand in the game: an earlier version of this branch's engine built together with my other open PRs (#699, #711, #1294) on `main` @ fd7dc40d (`build/combined`). Sprint On, Toggle off and on: L3 held (and Shift) runs the game's sprint with no roll and the plain run on letting go; Toggle on starts it with a press, keeps it through a roll and a jump, ends it when Link stops or attacks; A while sprinting rolls and talks as usual; in a conversation L3 hides the text box and starts nothing. Everything worked. - The game built from the earlier engine (`dev.py packs base`, llvm-mingw): `oot_patches: Sprint's link site in code_hot.c` and `... stance site in code_hot.c`, each found once; `oot_sprint.c` compiled. - On the earlier version, `tests/test_sprint.py` (8 tests): the bindings and layout cases as before, and `host/oot_sprint.c` compiled alone against a fake game (Link's state chain, the actor and event managers): held on while held and off when let go; A never added and the player's A passed through; Toggle on through jumps, landings, slides and rolls, off at the next press, an attack, ZL, the host's reset, 4 frames standing still (16 updates at 240 fps), 90 frames after a press made standing; a conversation's L3 handed to the game as LS for as long as it is held; nothing handed for a key; blocked (Insert, ocarina) neither; a press held on from a load stays the game's; another Link never sprints. The patch tests have since changed to use synthetic functions and anchors; the updated tests still need to run. - On the earlier version, `tests/test_input_background.py` (every case but `stick-directions`, which fails on `main` @ 7c23d2be too, `sprint-toggle` now checks what `npad_states` hands `host/oot_sprint.c` and that the game's buttons stay the player's), `test_walk_key`, `test_bound_keys`, `test_menu_i18n`, `test_settings_table`, `test_menu_modules`, `test_option_ids`, `test_alt_enter`, `test_pad_layout`: pass. `test_pads_after_menu` fails on `main` too (#1721's stand-in, named in #1977), and `test_menu_i18n` fails on `main` @ 7c23d2be the same way (an Output resolution text #1859 changed). The whole suite on `main` @ e6196f0f: the same failures with and without this change. - The engine itself (the same state table, timings and hook sites) is my NX2navi Sprint button, played there since 0.10.0. **Still to test:** - The updated head: build and automated tests - Windows, an Xbox controller: the same checks as above (by hand) - Linux: the build and the same checks with a controller (@Beanstalk build and start on Linux) ## Measurements Nothing to measure: per frame, a few guest pointer reads at Link's two updates replace the A handoff and a mask in the controllers' update; no switch is added. ## Risks - If the recompiler stops writing either load as `oot_patches.py` expects, the build prints `WARNING: Sprint's sites were found ...`. The sites are patched independently, so one hook may still run if the other is missing. - Link's state ids and the event manager's address come from game 1.1.1; another build's ids would end a toggled sprint at once (the sites would not be found there anyway). - Players' settings carry over unchanged (`sprint=`, `toggle_sprint=`, the bindings). A revert brings back A held. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Windows: the base build above; Linux: the Test Farm) - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
Sprint keeps its row, its Controls page line and its Toggle, but no longer
holds A and hides A's press from the game's controllers. host/oot_sprint.c
sets bit 4 of Link's input flags (the dash input, the game's own run after a
roll) right after the two places that load them (nx2/oot_patches.py
patch_sprint_link at 0x804ce798, patch_sprint_stance at 0x80c27f3c), for the
controlled Link only.

- A is never touched: the player's A rolls, talks, opens and picks up as
  usual while sprinting, with no 50 ms release gap; the press mask in the
  controllers' update and the A handoff are gone.
- A toggled sprint ends with Link's state (stopping, an attack, an item,
  swimming, climbing, ZL held), keeps through jumps, slides and rolls, and
  counts standing still in 60 Hz frames at any frame rate.
- A press of the left stick that begins outside gameplay (a conversation or
  cutscene, where it hides the text box, or a load) goes to the game as LS
  again instead of being lost to Sprint.

Ported from the Sprint button of the NX2navi runtime (sprint-button,
sprint-event-pass, sprint-roll-keep).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge remote-tracking branch 'origin/main' into feat/sprint-dash-input
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 6s
6f44624e85
kendowashere changed title from WIP: feat(input): Sprint sets the game's dash input instead of holding A to feat(input): Sprint sets the game's dash input instead of holding A 2026-11-21 07:46:09 +00:00
kendowashere changed title from feat(input): Sprint sets the game's dash input instead of holding A to feat(input):Improving Sprint feature: Sprint sets the game's dash input instead of holding A 2026-11-21 07:47:55 +00:00
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The new sprint can remain active when input is blocked or an event begins, and the controlled-Link check can affect another actor. The change also commits examples described as lifted game output, which the repository forbids.

Sprint uses the game’s dash input instead of holding A, allowing the player’s A press to pass through and restoring L3 in conversations. The new state handling and guest-memory reads add complexity and per-frame work, including when Sprint is off.

@fix will do (5)

  1. L1 tests/test_sprint.py:536: These fixtures are described as the two places written by the lift and reproduce sequences from the game’s lifted output. (more on the line)
  2. L2 host/oot_sprint.c:150: Blocking input clears the held latch but does not clear an already active toggle or request a reset. (more on the line)
  3. L3 host/oot_sprint.c:140: The event check only decides who receives a new press; it does not end an existing toggle. (more on the line)
  4. L4 host/oot_sprint.c:98: The controlled-Link check accepts every Link instance when the actor manager or controlled-actor pointer is missing or fails its class check. (more on the line)
  5. L5 (its part an edit can do) host/oot_sprint.c:185: Skip the actor and state lookups when Sprint is disabled, while preserving the reset and gameplay-detection behavior needed when it is enabled.

Before merging, for the author (2) (a run, a measurement or a decision; it doesn't hold the recommendation)

  • L5 (minor) host/oot_sprint.c:185: Both hooks inspect guest pointers on every relevant update even when Sprint is off; each non-image pointer check takes the memory map lock. (more on the line)
  • L6 (minor): The recorded gameplay run combines this engine with other PRs and is not a run of this head alone. Test this head on Windows with an Xbox controller and on Linux or Steam Deck, including A, L3 in conversations, toggle cancellation and release while steering.

Checks: Failing on this head, which is behind its base, where it passes: PR description / Description follows the template (pull_request_target). @rebase (or @fix) brings it up to date and runs it again; not held against it.

More: does it help, other systems, switches, what was read

Does it help: Unproven for this head: the author reports successful manual gameplay on Windows with a combined build containing other PRs, but no run of this head alone. No before-and-after frame-time numbers are provided for the new per-frame work.

Other systems: The hooks run for Link updates even with Sprint off and can affect actor updates, camera and movement. Windows keyboard and controller behavior has partial evidence from a combined build; Xbox, Linux and Steam Deck behavior remains untested. The patch matcher and fake-game tests do not establish behavior with the actual game on those systems.

Switches: No environment switch added, changed or removed. The existing Sprint setting remains off by default and Toggle remains off by default; their behavior when enabled changes.

Reviewed: 6f44624e85 against 7c23d2be26: Read the repository rules, PR template, standards, commit history, sprint engine, input call site, guest-memory validation, patch changes and relevant test changes. Skimmed translations and documentation changes. The full diff output and some long changed files were truncated; the remaining unchanged portions of those files were not read in full. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The Sprint and Toggle defaults and saved option keys are retained.
  • The commit records AI assistance.
  • The vk_api.h edits do not change the versioned renderer interface.
  • The new engine uses atomic operations for its explicitly shared integer state.

Testing: No code or tests were run, as requested. The author’s Windows combined-build run and stated test results were considered; Linux and Xbox runs remain outstanding.

Overlaps and merge order: The description names combined testing with PRs #699, #711 and #1294; their diffs and merge order were not available.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The new sprint can remain active when input is blocked or an event begins, and the controlled-Link check can affect another actor. The change also commits examples described as lifted game output, which the repository forbids. Sprint uses the game’s dash input instead of holding A, allowing the player’s A press to pass through and restoring L3 in conversations. The new state handling and guest-memory reads add complexity and per-frame work, including when Sprint is off. **`@fix` will do (5)** 1. **L1** `tests/test_sprint.py:536`: These fixtures are described as the two places written by the lift and reproduce sequences from the game’s lifted output. (more on the line) 2. **L2** `host/oot_sprint.c:150`: Blocking input clears the held latch but does not clear an already active toggle or request a reset. (more on the line) 3. **L3** `host/oot_sprint.c:140`: The event check only decides who receives a new press; it does not end an existing toggle. (more on the line) 4. **L4** `host/oot_sprint.c:98`: The controlled-Link check accepts every Link instance when the actor manager or controlled-actor pointer is missing or fails its class check. (more on the line) 5. **L5** (its part an edit can do) `host/oot_sprint.c:185`: Skip the actor and state lookups when Sprint is disabled, while preserving the reset and gameplay-detection behavior needed when it is enabled. **Before merging, for the author (2)** (a run, a measurement or a decision; it doesn't hold the recommendation) - **L5** (minor) `host/oot_sprint.c:185`: Both hooks inspect guest pointers on every relevant update even when Sprint is off; each non-image pointer check takes the memory map lock. (more on the line) - **L6** (minor): The recorded gameplay run combines this engine with other PRs and is not a run of this head alone. Test this head on Windows with an Xbox controller and on Linux or Steam Deck, including A, L3 in conversations, toggle cancellation and release while steering. **Checks:** Failing on this head, which is behind its base, where it passes: `PR description / Description follows the template (pull_request_target)`. `@rebase` (or `@fix`) brings it up to date and runs it again; not held against it. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for this head: the author reports successful manual gameplay on Windows with a combined build containing other PRs, but no run of this head alone. No before-and-after frame-time numbers are provided for the new per-frame work. **Other systems:** The hooks run for Link updates even with Sprint off and can affect actor updates, camera and movement. Windows keyboard and controller behavior has partial evidence from a combined build; Xbox, Linux and Steam Deck behavior remains untested. The patch matcher and fake-game tests do not establish behavior with the actual game on those systems. **Switches:** No environment switch added, changed or removed. The existing Sprint setting remains off by default and Toggle remains off by default; their behavior when enabled changes. **Reviewed:** 6f44624e858b against 7c23d2be2613: Read the repository rules, PR template, standards, commit history, sprint engine, input call site, guest-memory validation, patch changes and relevant test changes. Skimmed translations and documentation changes. The full diff output and some long changed files were truncated; the remaining unchanged portions of those files were not read in full. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The Sprint and Toggle defaults and saved option keys are retained. - The commit records AI assistance. - The vk_api.h edits do not change the versioned renderer interface. - The new engine uses atomic operations for its explicitly shared integer state. **Testing:** No code or tests were run, as requested. The author’s Windows combined-build run and stated test results were considered; Linux and Xbox runs remain outstanding. **Overlaps and merge order:** The description names combined testing with PRs #699, #711 and #1294; their diffs and merge order were not available. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -0,0 +95,4 @@
if (!link || rd64(link) != g_module_base + LINK_CLASS) return 0;
const uint64_t mgr = rd64(rd64(g_module_base + ACTOR_MGR));
if (!mgr || rd64(mgr) != g_module_base + ACTOR_MGR_CLASS) return 1;
const uint64_t ctl = rd64(mgr + 0x470);
Member

L4: The controlled-Link check accepts every Link instance when the actor manager or controlled-actor pointer is missing or fails its class check. During initialization or a transition, the other instance can therefore consume a press, update the shared sprint state and receive the dash bit. Fail closed until the controlled actor can be identified, and cover missing and invalid manager pointers in the fixture.

**L4**: The controlled-Link check accepts every Link instance when the actor manager or controlled-actor pointer is missing or fails its class check. During initialization or a transition, the other instance can therefore consume a press, update the shared sprint state and receive the dash bit. Fail closed until the controlled actor can be identified, and cover missing and invalid manager pointers in the fixture.
@ -0,0 +137,4 @@
}
const int n = LOAD(polls);
if (n <= GAMEPLAY_POLLS) STORE(polls, n + 1);
const int gameplay = n < GAMEPLAY_POLLS && !event_running();
Member

L3: The event check only decides who receives a new press; it does not end an existing toggle. A conversation can keep updating Link in a permitted movement state, so a sprint started before the conversation can continue through it and resume afterward. Clear the active toggle when an event starts, with a test beginning the event after sprint has latched.

**L3**: The event check only decides who receives a new press; it does not end an existing toggle. A conversation can keep updating Link in a permitted movement state, so a sprint started before the conversation can continue through it and resume afterward. Clear the active toggle when an event starts, with a test beginning the event after sprint has latched.
@ -0,0 +147,4 @@
passing = !mine && !blocked && l3;
} else if (!down) {
STORE(latched, 0);
passing = 0;
Member

L2: Blocking input clears the held latch but does not clear an already active toggle or request a reset. For example, entering the ocarina note wait or an exclusive control-bridge session while a toggled sprint is active leaves the dash bit set on subsequent Link updates. End the active sprint when input becomes blocked, and test the transition from an active toggle.

**L2**: Blocking input clears the held latch but does not clear an already active toggle or request a reset. For example, entering the ocarina note wait or an exclusive control-bridge session while a toggled sprint is active leaves the dash bit set on subsequent Link updates. End the active sprint when input becomes blocked, and test the transition from an active toggle.
@ -0,0 +182,4 @@
return on;
}
/* (nx2/oot_patches.py) f_804caa80 at 0x804ce798, after its load of Link's input flags into x10 (Link in x19): the flags
Member

L5 (minor): Both hooks inspect guest pointers on every relevant update even when Sprint is off; each non-image pointer check takes the memory map lock. Measure frame time and 1% lows with Sprint off and on against the base in representative scenes, including Linux or Steam Deck.

**L5** (minor): Both hooks inspect guest pointers on every relevant update even when Sprint is off; each non-image pointer check takes the memory map lock. Measure frame time and 1% lows with Sprint off and on against the base in representative scenes, including Linux or Steam Deck.
@ -480,2 +535,2 @@
run = subprocess.run([str(binary)], text=True, capture_output=True, timeout=30)
self.assertEqual(run.returncode, 0, run.stdout + run.stderr)
# The two places as the lift writes them, inside their functions
LINK_FN = ('#include "a64.h"\n' + "void f_804caa80(Ctx *__restrict A64_NOESC c) {\n"
Member

L1: These fixtures are described as the two places written by the lift and reproduce sequences from the game’s lifted output. The repository forbids committing anything made from the game, including sampled output. Replace them with independently authored synthetic functions and matching anchors that do not reproduce game output; remove any such samples from the patch code too.

**L1**: These fixtures are described as the two places written by the lift and reproduce sequences from the game’s lifted output. The repository forbids committing anything made from the game, including sampled output. Replace them with independently authored synthetic functions and matching anchors that do not reproduce game output; remove any such samples from the patch code too.
Owner
@fix
Member

I didn't fix this pull request: it doesn't allow edits from maintainers (the author can turn on Allow edits from maintainers).


Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

I didn't fix this pull request: it doesn't allow edits from maintainers (the author can turn on *Allow edits from maintainers*). --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Author
Contributor

Tested in game: Windows 11, NVIDIA GeForce RTX 5070 Ti (driver 621.24): this engine in a build with my other open PRs (#699, #711, #1294) on main @ fd7dc40d. Sprint on L3 and Shift, held and with Toggle (keeps through a roll, ends when Link stops or attacks), A rolls and talks while sprinting, L3 hides the text box in a conversation: all worked.

**Tested in game:** Windows 11, NVIDIA GeForce RTX 5070 Ti (driver 621.24): this engine in a build with my other open PRs (#699, #711, #1294) on `main` @ fd7dc40d. Sprint on L3 and Shift, held and with Toggle (keeps through a roll, ends when Link stops or attacks), A rolls and talks while sprinting, L3 hides the text box in a conversation: all worked.
Author
Contributor

@BeanBot wrote in #2038 (comment):

I didn't fix this pull request: it doesn't allow edits from maintainers (the author can turn on Allow edits from maintainers).

Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

I have turned allow edits on (sorry wasn't meant to be off) @HumanBean @BeanBot

@BeanBot wrote in https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2038#issuecomment-68003: > I didn't fix this pull request: it doesn't allow edits from maintainers (the author can turn on _Allow edits from maintainers_). > > Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides. I have turned allow edits on (sorry wasn't meant to be off) @HumanBean @BeanBot
Owner
@fix
fix(sprint): stop sprint on blocked input and events
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Failing after 15s
PR description / Description follows the template (pull_request_target) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 21s
CI / Workflow lint (actionlint) (pull_request) Successful in 22s
Third-party parts / As their notes say (pull_request) Successful in 28s
CI / Website build and checks (pull_request) Failing after 21s
2c039ef5dd
As the review on #2038 asked.
BeanBot left a comment

Recommendation: Approve. The recorded gameplay run used an earlier engine with other pull requests, and the current head has no recorded gameplay or performance measurements. The requested Windows and Linux or Steam Deck runs and frame-time comparisons are still needed. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 2c039ef5dd. I merged main (c7bd8f80af) into it, as it has merge commits. I edited its description to match the change.

Changed

  • Sprint patch fixtures and anchors: Replaced lifted-output fixtures with synthetic functions and anchors, and replaced patch-code samples with matching patterns in tests/test_sprint.py:564 and nx2/oot_patches.py:1610.
  • Blocked input leaves toggle active: Clear active and pending sprint state when input is blocked, with transition coverage in host/oot_sprint.c:155 and tests/test_sprint.py:429.
  • Events leave toggle active: Clear active and pending sprint state when an event starts, with transition coverage in host/oot_sprint.c:155 and tests/test_sprint.py:433.
  • Controlled-Link identification: Fail closed for missing or invalid manager and controlled-actor pointers, with fixture coverage in host/oot_sprint.c:94 and tests/test_sprint.py:482.

Changed in part (the rest is for the author)

  • Sprint hook overhead: Skipped actor and state lookups while Sprint is disabled and reset gameplay detection in host/oot_sprint.c:136 and host/oot_sprint.c:193. The author must measure frame time and 1% lows with Sprint off and on against the base in representative scenes, including Linux or Steam Deck. Tests and builds were not run as requested.

Nothing was built or run: the checks run again on the new head.

Sprint sets Link’s dash input instead of holding A, allowing the player’s A input to pass through and returning L3 to the game for conversations. The new hooks add per-update work whose cost has not been measured.

Before merging, for the author (2) (a run, a measurement or a decision; it doesn't hold the recommendation)

  • L5 (minor) host/oot_sprint.c:185: Measure frame time and 1% lows with Sprint off and on against the base in representative scenes, including Linux or Steam Deck. The disabled hooks now skip actor and state lookups.
  • L6 (minor): The recorded gameplay run combines this engine with other PRs and is not a run of this head alone. Test this head on Windows with an Xbox controller and on Linux or Steam Deck, including A, L3 in conversations, toggle cancellation and release while steering.

Checks: they run again on this head (PR description / Description follows the template (pull_request_target) failed on the last one); a failure shows on the pull request.

More: does it help, other systems, switches, what was read

Does it help: Unproven on this head. The author reports successful gameplay on Windows with an earlier engine combined with other changes; no frame-time or 1% low comparisons are recorded.

Other systems: The hooks affect Link’s movement and stance updates; controller reads also detect events and blocked input. Windows Xbox controller and Linux or Steam Deck behavior remain untested on this head.

Switches: No switch added or changed. Existing Sprint and Toggle settings remain player-controlled; Toggle defaults off.

Reviewed: 2c039ef5dd against c7bd8f80af: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, host/oot_sprint.c, the Sprint patch code and relevant controller references. Skimmed the Sprint test changes and diff; the full base-to-head diff includes many additional merged-main files and was not read in full.; nothing run (a code review).

Checked and fine:

  • The disabled Sprint hooks return before actor and state lookups.
  • The description identifies the earlier gameplay run and lists the updated head’s build and tests as outstanding.

Testing: No commands that build or run code were executed. CI has not run on this head; the author’s recorded gameplay and automated checks cover an earlier engine.

Overlaps and merge order: The recorded gameplay build included PRs #699, #711 and #1294; their current overlap and merge order are unknown.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The recorded gameplay run used an earlier engine with other pull requests, and the current head has no recorded gameplay or performance measurements. The requested Windows and Linux or Steam Deck runs and frame-time comparisons are still needed. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 2c039ef5dde9. I merged `main` (c7bd8f80af52) into it, as it has merge commits. I edited its description to match the change. **Changed** - **Sprint patch fixtures and anchors**: Replaced lifted-output fixtures with synthetic functions and anchors, and replaced patch-code samples with matching patterns in tests/test_sprint.py:564 and nx2/oot_patches.py:1610. - **Blocked input leaves toggle active**: Clear active and pending sprint state when input is blocked, with transition coverage in host/oot_sprint.c:155 and tests/test_sprint.py:429. - **Events leave toggle active**: Clear active and pending sprint state when an event starts, with transition coverage in host/oot_sprint.c:155 and tests/test_sprint.py:433. - **Controlled-Link identification**: Fail closed for missing or invalid manager and controlled-actor pointers, with fixture coverage in host/oot_sprint.c:94 and tests/test_sprint.py:482. **Changed in part (the rest is for the author)** - **Sprint hook overhead**: Skipped actor and state lookups while Sprint is disabled and reset gameplay detection in host/oot_sprint.c:136 and host/oot_sprint.c:193. The author must measure frame time and 1% lows with Sprint off and on against the base in representative scenes, including Linux or Steam Deck. Tests and builds were not run as requested. Nothing was built or run: the checks run again on the new head. Sprint sets Link’s dash input instead of holding A, allowing the player’s A input to pass through and returning L3 to the game for conversations. The new hooks add per-update work whose cost has not been measured. **Before merging, for the author (2)** (a run, a measurement or a decision; it doesn't hold the recommendation) - **L5** (minor) `host/oot_sprint.c:185`: Measure frame time and 1% lows with Sprint off and on against the base in representative scenes, including Linux or Steam Deck. The disabled hooks now skip actor and state lookups. - **L6** (minor): The recorded gameplay run combines this engine with other PRs and is not a run of this head alone. Test this head on Windows with an Xbox controller and on Linux or Steam Deck, including A, L3 in conversations, toggle cancellation and release while steering. **Checks:** they run again on this head (`PR description / Description follows the template (pull_request_target)` failed on the last one); a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on this head. The author reports successful gameplay on Windows with an earlier engine combined with other changes; no frame-time or 1% low comparisons are recorded. **Other systems:** The hooks affect Link’s movement and stance updates; controller reads also detect events and blocked input. Windows Xbox controller and Linux or Steam Deck behavior remain untested on this head. **Switches:** No switch added or changed. Existing Sprint and Toggle settings remain player-controlled; Toggle defaults off. **Reviewed:** 2c039ef5dde9 against c7bd8f80af52: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, host/oot_sprint.c, the Sprint patch code and relevant controller references. Skimmed the Sprint test changes and diff; the full base-to-head diff includes many additional merged-main files and was not read in full.; nothing run (a code review). **Checked and fine:** - The disabled Sprint hooks return before actor and state lookups. - The description identifies the earlier gameplay run and lists the updated head’s build and tests as outstanding. **Testing:** No commands that build or run code were executed. CI has not run on this head; the author’s recorded gameplay and automated checks cover an earlier engine. **Overlaps and merge order:** The recorded gameplay build included PRs #699, #711 and #1294; their current overlap and merge order are unknown. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch feat/sprint-dash-input 2026-11-21 22:41:53 +00:00
llun approved these changes 2026-11-21 22:42:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2038
No description provided.