WIP: feat(input): custom gyro aiming with per-item aim detection #699

Draft
kendowashere wants to merge 3 commits from kendowashere/Longshot:feat/gyro-aim into main
First-time contributor

Type: feat · Risk: low · Tested on: Windows 11, RTX 5070 Ti, DualSense · Needs: Linux, any GPU

Why

The game's own motion aiming has a dead zone and smoothing, and it only works where the game turns it on. Players used to mouse-like gyro (as in controller remappers) have no way to get it here, nor a choice of how the controller's turn becomes a camera turn. This adds that as an opt-in Custom Motion style. It is a port of the custom gyro in NX2navi, a static recompilation of the same game build: https://github.com/tangerineturtle1/NX2navi/pull/955. Issue #974 asks for a way to recalibrate the gyro against drift and for an adjustable gyro dead zone: the Custom style's Gyro dead zone row is the second, and a Recalibrate gyro row, added here, is the first.

What changed

The Motion page's new Motion style row is Original (the game's own motion aiming, the default) or Custom: the controller's turn goes straight into the camera, 2.0 degrees of camera per degree of controller by default, with no smoothing, at any frame rate and Camera speed. While Custom turns the camera, the game's six-axis sensor reads the pad at rest, so the two never add up.

  • nx2/oot_patches.py patch_gyro_aim: two calls in the camera input update, f_8039c300. hos_gyro_aim_camera adds the gathered turn to the processed stick (s1 x, s0 y) before its first store, so the game's inversion, idle test, camera speed and Link's aim follow it as they follow the right stick; hos_gyro_aim_activity clears the idle bit before the last flags store when the gyro moved the camera.
  • host/gyro_aim.c, host/gyro_aim.h: the maths and the game reads. The spaces (what a gyro space is, and how the different ones turn the camera, is explained on Gyro Wiki: https://gyrowiki.jibbsmart.com/blog:player-space-gyro-and-alternatives-explained): Player space (the default), World space, Local yaw, Local roll, Local yaw + roll and Laser pointer (aims where the controller points, with no dead zone or tightening). Then the dead zone, the tightening (a turn slower than it is scaled down in proportion), and the touchpad pause. The turn is divided by the engine's frame step and the Camera speed row, so a degree of controller turns the same angle at any frame rate.
  • Gyro active: Always, or When the game allows: only while an item aims, found from the game's own state: the hookshot's camera bit (the camera input object's settings word, +0x218, bit 32), Link's item in use (+0xf84) for the bow and slingshot (3), the hookshot (4) and the boomerang (5) (a sword swing's 1 and 2 do not count), and Link's fishing word (+0xe58), rod held and its cast aimed (0x01000400). While none of those aims, the game's six-axis sensor reads the real motion, so the game's own aiming still covers anything this does not detect, and never an item it does (hos_gyro_aim_owns_sensor, host/nn_hid.c).
  • host/pad_sdl.c, host/hos_sdl.c: every 4 ms poll feeds the real rate with the filter's learned bias taken off, the filter's up direction, and whether a finger rests on the touchpad (hos_sdl_pad_touched, for SDL 2 and 3).
  • gpu/vk/vk_menu.cpp, vk_menu.h, vk_replay.cpp, vk_api.h: the rows, in order: Motion style, then while it is Custom: Gyro active, Gyro space, Horizontal sensitivity, Vertical sensitivity, Gyro dead zone, Gyro tightening, Touchpad pauses gyro. Option ids 80 to 87 (no open pull request uses them). gpu/vk/menu_i18n.h: the texts in all 13 languages.
  • Recalibrate gyro (#974), on the Motion page under Motion deadzone, for both styles: an action row (Start). The filter (host/hos_motion.h) already learns the gyroscope's resting rate whenever the pad lies still, quickly for its first 2 s of stillness (a quarter second's average), then slowly (3 s), so drift that changes later in play (a pad warming up) takes long stillness to follow. A press starts that learning over in its quick phase, from the bias it had (host/pad_sdl.c: learned_t and still_t back to 0, the pad's saved bias dropped), and the row says what happens: Set it down, then Done once 2 s of stillness are learned again, or No motion controller. The menu counts presses in opts.gyro_recalibrate (option id 88, read by the pad thread as a change), and the pad thread says back through rx_option_set (id 89, menu_option_set); neither is kept in the options file, and no interface struct changes. The log says hid: motion: recalibrating "..." and ... recalibrated, bias (...).
  • Motion deadzone (the console's three zero-drift steps, which only the game's own motion aiming reads) is hidden while Motion style is Custom, whose turn never passes through it: Custom has its own Gyro dead zone (row_shown). Its help says so.
  • README.md: the option table and a paragraph.
  • tests/gyro_aim_test.c, tests/test_gyro_aim.py: new; tests/test_damage_debug_menu.py: the row helper is listed in its stub, as is_laptop_row is; tests/test_menu_tune.py: its pinned prompt line now has the Recalibrate gyro row's Start.

Measurements

Verdict: nothing to measure: an input feature that is off by default; with Motion style on Original the two added calls return at once and the game's own motion path is unchanged.

Flags and settings

Eight new menu rows on the Motion page (ini keys motion_style, gyro_active, gyro_space, horizontal_sensitivity, vertical_sensitivity, gyro_dead_zone, gyro_tightening, touchpad_pauses_gyro), no switch and no build flag. The README's option table lists them.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
Motion style (motion_style, id 80) Original or Custom none Original Custom turns the camera from the controller's turn Helps: players who want mouse-like gyro. Untested: Linux, Steam Deck Original by default: it changes how aiming feels, so it is opt-in (as in NX2navi)
Gyro active (gyro_active, 82) Always, or when the game allows none Always When the game allows: only while an item aims - Always
Gyro space (gyro_space, 81) Player, World, Local yaw, Local roll, Local yaw + roll, Laser pointer none Player space How the controller's turn becomes left and right - Player space
Horizontal / Vertical sensitivity (86, 87) 0.1 to 10.0 none 2.0 Degrees of camera per degree of controller - 2.0
Gyro dead zone (83) 0 to 10.0 deg/s none 0 (off) A slower turn is dropped - Off
Gyro tightening (84) 0 to 10.0 deg/s none 1.5 A slower turn is scaled down in proportion - 1.5
Touchpad pauses gyro (85) Off or On none On A finger on the touchpad holds the camera Needs a DualSense or DualShock 4 On
Recalibrate gyro (88, 89; no ini line) An action: Start none - Learns the gyroscope's drift again, quickly, once the pad is set down Helps: drift that changed during play. Untested in the game -

Testing

Tested:

  • Game-free: tests/test_gyro_aim.py compiles the maths with synthetic readings (each space's turn however the controller is held, dead zone, tightening, the touchpad pause, the laser pointer returning to its start, the aim gate for each item and the cases that must not count), applies the patch to a fixture of the lifted function (once, and again unchanged; I also applied it by hand to the real lifted f_8039c300 of a build: one hook each, again unchanged), and checks that the rows reach the host and the defaults. It also checks the Recalibrate gyro row's wiring: the press counted, the reset after a new pad's filter is made (so the press wins over the pad's saved bias), Done when 2 s are learned, the no-pad case, and nothing in the options file (it fails with the press count removed). python -I -B tests/run_all.py on this branch (86d954d1) on main @ e41de662: 583 passed, 24 failed, 41 skipped; a clean main @ e41de662 on this PC: 581 passed, 25 failed, 41 skipped, the same 24 and test_mesh_args_cleanup, which passes on the branch.
  • In the game: Windows 11 Pro, GeForce RTX 5070 Ti (NVIDIA 621.24), a DualSense through SDL, a pack of this branch (together with a separate minimap-toggle branch) built on main @ 6c9edffe, before the rebase onto e090cc48, which touches none of this branch's files. With Motion style Custom and Gyro active When the game allows, aiming the bow or slingshot and the hookshot turns the camera with the controller and the log says so (gyro: the game aims: the custom gyro turns the camera (Link's item in use 3), and ... 4 for the hookshot); outside an aim it reports gyro: no aim (Link's item in use 0) and the camera is left alone. It plays well.
  • Linux, compiler only: host/gyro_aim.c, host/hos_sdl.c, host/pad_sdl.c and host/nn_hid.c compile for a Linux target (clang -fsyntax-only against the Linux sysroot's own headers and host/posix's compatibility layer, on a build tree with both of my branches merged). The same check passes on untouched host files and fails without host/posix, so it can tell. That is not a Linux build, link or run: the renderer's C++ files and the shader and game build were not compiled for Linux.

Not tested: the Recalibrate gyro row in the game (built and installed with my other branches, waiting for a run); the boomerang's and the fishing rod's cast aims (the same gate, not in the log of the run above); the Gyro spaces other than Player space in the game (their maths is in the game-free test); Always; Linux; a Steam Deck; controllers other than a DualSense (Switch Pro, DualShock 4's touchpad).

Must be tested:

  • Linux, any GPU: the host code builds (host/gyro_aim.c uses the same locking calls as the other host files; host/hos_sdl.c's touchpad calls name SDL 2's and SDL 3's functions) and the game starts with Motion style on Custom (asked of the Test Farm on this PR: build and start the game, open Controls > Motion and set Motion style to Custom, expecting the seven rows below it to appear and aiming the bow to turn the camera with a gyro pad).
  • Any Switch Pro Controller, Joy-Con or Steam Deck pad with a gyroscope, by hand: Motion style Custom, aim the bow, expecting the camera to follow the controller.
  • Windows or Linux, any pad with a gyroscope, by hand: Motion page, Recalibrate gyro, Start: the row says Set it down; lay the pad on a table for three seconds, expecting Done, and the aim not to creep afterwards; with no motion pad, expecting No motion controller.

Risks

What could break: the camera input update (f_8039c300) now calls the host twice a frame, and a pad's reading feeds the custom gyro on the polling thread. Both return at once on Original. A wrong aim gate would leave the camera still while aiming (the game's own motion aiming takes over outside the gate), never turn it without an aim under When the game allows.

Turning it off: Motion style Original (the default), or revert the commit.

Compatibility: the options file gains eight lines (an older file keeps its values and reads the defaults for these). The player's next build translates the game again because the lifted camera function changes, as for any change to nx2/oot_patches.py. The shader and pipeline caches and MKWVK_API_VERSION are untouched (the option ids are new HOS_OPT_* numbers and no struct changed, as when the earlier options such as HOS_OPT_HOLD_TOGGLE were added).

Issues

See #974 (recalibration and a gyro dead zone; it can close once this is merged).

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks. Not ticked yet: Two per-frame host calls and the polling-thread gyro work are stated as costs, with no timing given.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. (Open: the Motion page's rows, to add.)
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Open: built on Windows; for Linux only the host files were compile-checked, see Testing.)
  • Docs updated.
**Type:** feat · **Risk:** low · **Tested on:** Windows 11, RTX 5070 Ti, DualSense · **Needs:** Linux, any GPU ## Why The game's own motion aiming has a dead zone and smoothing, and it only works where the game turns it on. Players used to mouse-like gyro (as in controller remappers) have no way to get it here, nor a choice of how the controller's turn becomes a camera turn. This adds that as an opt-in **Custom** Motion style. It is a port of the custom gyro in NX2navi, a static recompilation of the same game build: https://github.com/tangerineturtle1/NX2navi/pull/955. Issue #974 asks for a way to recalibrate the gyro against drift and for an adjustable gyro dead zone: the Custom style's Gyro dead zone row is the second, and a **Recalibrate gyro** row, added here, is the first. ## What changed The Motion page's new **Motion style** row is **Original** (the game's own motion aiming, the default) or **Custom**: the controller's turn goes straight into the camera, 2.0 degrees of camera per degree of controller by default, with no smoothing, at any frame rate and Camera speed. While Custom turns the camera, the game's six-axis sensor reads the pad at rest, so the two never add up. - `nx2/oot_patches.py` `patch_gyro_aim`: two calls in the camera input update, `f_8039c300`. `hos_gyro_aim_camera` adds the gathered turn to the processed stick (s1 x, s0 y) before its first store, so the game's inversion, idle test, camera speed and Link's aim follow it as they follow the right stick; `hos_gyro_aim_activity` clears the idle bit before the last flags store when the gyro moved the camera. - `host/gyro_aim.c`, `host/gyro_aim.h`: the maths and the game reads. The spaces (what a gyro space is, and how the different ones turn the camera, is explained on Gyro Wiki: https://gyrowiki.jibbsmart.com/blog:player-space-gyro-and-alternatives-explained): **Player space** (the default), **World space**, **Local yaw**, **Local roll**, **Local yaw + roll** and **Laser pointer** (aims where the controller points, with no dead zone or tightening). Then the dead zone, the tightening (a turn slower than it is scaled down in proportion), and the touchpad pause. The turn is divided by the engine's frame step and the Camera speed row, so a degree of controller turns the same angle at any frame rate. - **Gyro active**: *Always*, or *When the game allows*: only while an item aims, found from the game's own state: the hookshot's camera bit (the camera input object's settings word, +0x218, bit 32), Link's item in use (+0xf84) for the bow and slingshot (3), the hookshot (4) and the boomerang (5) (a sword swing's 1 and 2 do not count), and Link's fishing word (+0xe58), rod held and its cast aimed (0x01000400). While none of those aims, the game's six-axis sensor reads the real motion, so the game's own aiming still covers anything this does not detect, and never an item it does (`hos_gyro_aim_owns_sensor`, `host/nn_hid.c`). - `host/pad_sdl.c`, `host/hos_sdl.c`: every 4 ms poll feeds the real rate with the filter's learned bias taken off, the filter's up direction, and whether a finger rests on the touchpad (`hos_sdl_pad_touched`, for SDL 2 and 3). - `gpu/vk/vk_menu.cpp`, `vk_menu.h`, `vk_replay.cpp`, `vk_api.h`: the rows, in order: Motion style, then while it is Custom: Gyro active, Gyro space, Horizontal sensitivity, Vertical sensitivity, Gyro dead zone, Gyro tightening, Touchpad pauses gyro. Option ids 80 to 87 (no open pull request uses them). `gpu/vk/menu_i18n.h`: the texts in all 13 languages. - **Recalibrate gyro** (#974), on the Motion page under Motion deadzone, for both styles: an action row (Start). The filter (`host/hos_motion.h`) already learns the gyroscope's resting rate whenever the pad lies still, quickly for its first 2 s of stillness (a quarter second's average), then slowly (3 s), so drift that changes later in play (a pad warming up) takes long stillness to follow. A press starts that learning over in its quick phase, from the bias it had (`host/pad_sdl.c`: `learned_t` and `still_t` back to 0, the pad's saved bias dropped), and the row says what happens: *Set it down*, then *Done* once 2 s of stillness are learned again, or *No motion controller*. The menu counts presses in `opts.gyro_recalibrate` (option id 88, read by the pad thread as a change), and the pad thread says back through `rx_option_set` (id 89, `menu_option_set`); neither is kept in the options file, and no interface struct changes. The log says `hid: motion: recalibrating "..."` and `... recalibrated, bias (...)`. - **Motion deadzone** (the console's three zero-drift steps, which only the game's own motion aiming reads) is hidden while Motion style is Custom, whose turn never passes through it: Custom has its own Gyro dead zone (`row_shown`). Its help says so. - `README.md`: the option table and a paragraph. - `tests/gyro_aim_test.c`, `tests/test_gyro_aim.py`: new; `tests/test_damage_debug_menu.py`: the row helper is listed in its stub, as `is_laptop_row` is; `tests/test_menu_tune.py`: its pinned prompt line now has the Recalibrate gyro row's Start. ## Measurements **Verdict:** nothing to measure: an input feature that is off by default; with Motion style on Original the two added calls return at once and the game's own motion path is unchanged. ### Flags and settings Eight new menu rows on the Motion page (ini keys `motion_style`, `gyro_active`, `gyro_space`, `horizontal_sensitivity`, `vertical_sensitivity`, `gyro_dead_zone`, `gyro_tightening`, `touchpad_pauses_gyro`), no switch and no build flag. The README's option table lists them. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | Motion style (`motion_style`, id 80) | Original or Custom | none | Original | Custom turns the camera from the controller's turn | Helps: players who want mouse-like gyro. Untested: Linux, Steam Deck | Original by default: it changes how aiming feels, so it is opt-in (as in NX2navi) | | Gyro active (`gyro_active`, 82) | Always, or when the game allows | none | Always | When the game allows: only while an item aims | - | Always | | Gyro space (`gyro_space`, 81) | Player, World, Local yaw, Local roll, Local yaw + roll, Laser pointer | none | Player space | How the controller's turn becomes left and right | - | Player space | | Horizontal / Vertical sensitivity (86, 87) | 0.1 to 10.0 | none | 2.0 | Degrees of camera per degree of controller | - | 2.0 | | Gyro dead zone (83) | 0 to 10.0 deg/s | none | 0 (off) | A slower turn is dropped | - | Off | | Gyro tightening (84) | 0 to 10.0 deg/s | none | 1.5 | A slower turn is scaled down in proportion | - | 1.5 | | Touchpad pauses gyro (85) | Off or On | none | On | A finger on the touchpad holds the camera | Needs a DualSense or DualShock 4 | On | | Recalibrate gyro (88, 89; no ini line) | An action: Start | none | - | Learns the gyroscope's drift again, quickly, once the pad is set down | Helps: drift that changed during play. Untested in the game | - | ## Testing **Tested:** - Game-free: `tests/test_gyro_aim.py` compiles the maths with synthetic readings (each space's turn however the controller is held, dead zone, tightening, the touchpad pause, the laser pointer returning to its start, the aim gate for each item and the cases that must not count), applies the patch to a fixture of the lifted function (once, and again unchanged; I also applied it by hand to the real lifted `f_8039c300` of a build: one hook each, again unchanged), and checks that the rows reach the host and the defaults. It also checks the Recalibrate gyro row's wiring: the press counted, the reset after a new pad's filter is made (so the press wins over the pad's saved bias), Done when 2 s are learned, the no-pad case, and nothing in the options file (it fails with the press count removed). `python -I -B tests/run_all.py` on this branch (86d954d1) on `main` @ e41de662: 583 passed, 24 failed, 41 skipped; a clean `main` @ e41de662 on this PC: 581 passed, 25 failed, 41 skipped, the same 24 and `test_mesh_args_cleanup`, which passes on the branch. - In the game: Windows 11 Pro, GeForce RTX 5070 Ti (NVIDIA 621.24), a DualSense through SDL, a pack of this branch (together with a separate minimap-toggle branch) built on `main` @ 6c9edffe, before the rebase onto e090cc48, which touches none of this branch's files. With Motion style Custom and Gyro active *When the game allows*, aiming the bow or slingshot and the hookshot turns the camera with the controller and the log says so (`gyro: the game aims: the custom gyro turns the camera (Link's item in use 3)`, and `... 4` for the hookshot); outside an aim it reports `gyro: no aim (Link's item in use 0)` and the camera is left alone. It plays well. - Linux, compiler only: `host/gyro_aim.c`, `host/hos_sdl.c`, `host/pad_sdl.c` and `host/nn_hid.c` compile for a Linux target (clang `-fsyntax-only` against the Linux sysroot's own headers and `host/posix`'s compatibility layer, on a build tree with both of my branches merged). The same check passes on untouched host files and fails without `host/posix`, so it can tell. That is not a Linux build, link or run: the renderer's C++ files and the shader and game build were not compiled for Linux. **Not tested:** the Recalibrate gyro row in the game (built and installed with my other branches, waiting for a run); the boomerang's and the fishing rod's cast aims (the same gate, not in the log of the run above); the Gyro spaces other than Player space in the game (their maths is in the game-free test); Always; Linux; a Steam Deck; controllers other than a DualSense (Switch Pro, DualShock 4's touchpad). **Must be tested:** - Linux, any GPU: the host code builds (`host/gyro_aim.c` uses the same locking calls as the other host files; `host/hos_sdl.c`'s touchpad calls name SDL 2's and SDL 3's functions) and the game starts with Motion style on Custom (asked of the Test Farm on this PR: build and start the game, open Controls > Motion and set Motion style to Custom, expecting the seven rows below it to appear and aiming the bow to turn the camera with a gyro pad). - Any Switch Pro Controller, Joy-Con or Steam Deck pad with a gyroscope, by hand: Motion style Custom, aim the bow, expecting the camera to follow the controller. - Windows or Linux, any pad with a gyroscope, by hand: Motion page, Recalibrate gyro, Start: the row says Set it down; lay the pad on a table for three seconds, expecting Done, and the aim not to creep afterwards; with no motion pad, expecting No motion controller. ## Risks **What could break:** the camera input update (`f_8039c300`) now calls the host twice a frame, and a pad's reading feeds the custom gyro on the polling thread. Both return at once on Original. A wrong aim gate would leave the camera still while aiming (the game's own motion aiming takes over outside the gate), never turn it without an aim under *When the game allows*. **Turning it off:** Motion style Original (the default), or revert the commit. **Compatibility:** the options file gains eight lines (an older file keeps its values and reads the defaults for these). The player's next build translates the game again because the lifted camera function changes, as for any change to `nx2/oot_patches.py`. The shader and pipeline caches and `MKWVK_API_VERSION` are untouched (the option ids are new `HOS_OPT_*` numbers and no struct changed, as when the earlier options such as `HOS_OPT_HOLD_TOGGLE` were added). ## Issues See #974 (recalibration and a gyro dead zone; it can close once this is merged). ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [ ] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. Not ticked yet: Two per-frame host calls and the polling-thread gyro work are stated as costs, with no timing given. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [ ] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. (Open: the Motion page's rows, to add.) - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Open: built on Windows; for Linux only the host files were compile-checked, see Testing.) - [x] Docs updated.
feat(input): custom gyro aiming with per-item aim detection
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
6fb56e871b
The Motion page's new Motion style row on Custom turns the camera straight from the controller's turn, like a mouse, in
place of the game's own motion aiming: one degree of camera per degree of controller at sensitivity 2.0, no smoothing,
at any frame rate and camera speed. The turn is added to the processed stick of the camera input update (f_8039c300), so
the game's inversion, idle test, camera speed and Link's aim follow it as they follow the right stick.

Gyro active chooses Always or When the game allows: only while an item aims, found from the game's own state (the
hookshot's camera bit, Link's item in use for the bow, slingshot, hookshot and boomerang, the fishing rod's cast aim).
While the custom gyro turns the camera the game's six-axis sensor reads the pad at rest, so the two never add up; outside
an aim it reads the real motion. Gyro space (player, world, local yaw, local roll, local yaw + roll, laser pointer),
Horizontal and Vertical sensitivity, Gyro dead zone, Gyro tightening and Touchpad pauses gyro, as in the author's NX2navi
version. Option ids 80 to 87; the translations are in all 13 languages.
kendowashere force-pushed feat/gyro-aim from 6fb56e871b
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to e5e5de5b74
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-15 05:23:31 +00:00
Compare
HumanBean force-pushed feat/gyro-aim from e5e5de5b74
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to f0678ba305
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) Successful in 2s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 7s
Third-party parts / As their notes say (pull_request) Successful in 8s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
2026-11-15 18:46:19 +00:00
Compare
Owner

Rebased onto main @ 7bacf846: conflicts in gpu/vk/menu_i18n.h: main dropped the "VRAM budget" entries, so they are dropped here too and the per-language entry counts in kLangs recomputed (checked against the arrays). No tests were run here; the test boxes stay yours.

Rebased onto `main` @ 7bacf846: conflicts in gpu/vk/menu_i18n.h: main dropped the "VRAM budget" entries, so they are dropped here too and the per-language entry counts in `kLangs` recomputed (checked against the arrays). No tests were run here; the test boxes stay yours.
Author
First-time contributor

@Beanstalk On Linux, with a controller that has a gyroscope (DualSense, Switch Pro Controller, Joy-Con or Steam Deck): build this branch and start the game. Open Controls > Motion and set Motion style to Custom: the seven rows below it should appear. In the field, aim the bow (or slingshot, hookshot, boomerang): moving the controller should turn the camera, and the camera should stay still from motion when not aiming. Then set Motion style back to Original: the game's own motion aiming should behave as on main. Pass: it builds and starts, the rows are there, and gyro aiming works as described. Please copy any log line containing 'gyro'.

@Beanstalk On Linux, with a controller that has a gyroscope (DualSense, Switch Pro Controller, Joy-Con or Steam Deck): build this branch and start the game. Open Controls > Motion and set Motion style to Custom: the seven rows below it should appear. In the field, aim the bow (or slingshot, hookshot, boomerang): moving the controller should turn the camera, and the camera should stay still from motion when not aiming. Then set Motion style back to Original: the game's own motion aiming should behave as on main. Pass: it builds and starts, the rows are there, and gyro aiming works as described. Please copy any log line containing 'gyro'.
Member

@kendowashere only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it. This request was for f0678ba, and the PR has changed since (86d954d), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@kendowashere only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it.~~ This request was for `f0678ba`, and the PR has changed since (`86d954d`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
kendowashere force-pushed feat/gyro-aim from f0678ba305
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) Successful in 2s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 7s
Third-party parts / As their notes say (pull_request) Successful in 8s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
to 86d954d162
Some checks failed
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2026-11-16 00:25:46 +00:00
Compare
feat(input): Motion deadzone is hidden while Motion style is Custom, which has its own
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 7s
2942d80484
Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: The Tested line gives an in-game run on Windows 11 Pro, RTX 5070 Ti and a DualSense on your PC.
  • Nothing gets worse that I know of: not ticked: Two per-frame host calls and the polling-thread gyro work are stated as costs, with no timing given. Measure that cost and state it in Risks, then tick it.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: The Tested line gives an in-game run on Windows 11 Pro, RTX 5070 Ti and a DualSense on your PC. - *Nothing gets worse that I know of*: not ticked: Two per-frame host calls and the polling-thread gyro work are stated as costs, with no timing given. Measure that cost and state it in Risks, then tick it.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 7s
This pull request has changes conflicting with the target branch.
  • gpu/vk/menu_i18n.h
  • gpu/vk/vk_menu.cpp
  • gpu/vk/vk_replay.cpp
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/gyro-aim:kendowashere-feat/gyro-aim'
git switch 'kendowashere-feat/gyro-aim'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!699
No description provided.