feat(input): Invert aiming X and Y, the right stick while you aim with ZR, apart from Invert camera #3188

Merged
HumanBean merged 3 commits from cuecuemoar/Longshot:feat/aim-invert into main 2026-12-05 17:46:27 +00:00
Contributor

Summary

Invert camera X and Y flip the controller's right stick everywhere, aiming included, so there was no way to aim the slingshot, bow, hookshot or longshot inverted while keeping the camera as it is, or the other way round (#1084). This adds two Controls rows under Invert camera X/Y:

  • Invert aiming X and Invert aiming Y: Same as camera, Off, On. Same as camera is the default, so nobody's aiming changes after updating; Off and On give aiming that axis whatever Invert camera says.

"Aiming" is ZR held with an aiming item on it: the slingshot or bow (any arrows), the hookshot or longshot, as the game's trigger state (game_trigger_state) says what is on ZR. ZR counts as the game is given it: held on a pad, or kept by the Controls page's Toggle column, whose second press ends the aim at once though the button stays held. The rows change the pads' right stick only: the mouse and the keyboard have their own rows (Invert mouse X/Y), and the gyro has Invert motion X/Y. The boomerang and looking around in first person have no such signal and follow Invert camera; their rows' help says so.

The pad threads (host/pad_sdl.c, the XInput thread in host/nn_hid.c) apply Invert camera as before. read_input (host/nn_hid.c) takes the pads' stick in through pads_stick_in, in front and with Controller in background, and keeps their right stick in pad_aim. Then npad_states calls aim_invert right after the toggles (hold_toggle_apply), on the buttons the game is given. Where the aiming row differs from the camera row, it flips an axis only while the game is given just the pads' value: a scripted, control-bridge, mouse or key tilt is never turned.

Read first: host/nn_hid.c pads_stick_in, aim_invert and its call in npad_states; game/mods/controls/mod.toml invert_aim_x / invert_aim_y.

Fixes #1084

Testing

Tested: Windows 10, RTX 4090, driver 617.42; an Xbox-style controller; a copy of my own save, with the bow and the hookshot. Runtime v3.2.0-335-ga9db7e2ae (the head a9db7e2ae, after BeanBot's review), Controls page, Controller section:

  • Invert camera Y Off, Invert aiming Y On: aiming with ZR held is inverted up and down; the camera, ZR let go, is not.
  • Invert camera Y On, Invert aiming Y Off: aiming is not inverted; the camera is.
  • Same as camera: aiming as the camera, as before. X the same way.
  • ZR's Toggle on, tapped and let go: aiming inverted as its row says while the toggle keeps ZR held. Pressed again and held: the aim ends and the stick is back as the camera's at once, while still held. Let go and pressed once more: kept and inverted again. Toggle off, ZR held: inverted while held.
  • The other cases above were played on 269b1da04 too, before the review fix.

Checks:

  • tests/test_aim_invert.py (new): production's pads_read, read_input's pad block, pads_stick_in, hold_toggle_apply and aim_invert with fakes, the item on ZR from a fake game_trigger_state; it compiles with the runner's compiler ({cc}, else CC, else gcc). It fails on main (FAIL:418 right stick 1000,2000 (camera 0,0, aiming 0,2, ZR item 1, ZR held): got 1000,2000, want 1000,-2000) and passes here with gcc and clang. Its cases: not aiming (ZR up, the hammer or nothing on ZR, no Link in play), each row against each camera setting for the bow and the hookshot, the Toggle column (kept, let go, pressed again and held: the aim ends; kept again while held), a scripted tilt with and without the pads', a camera key's tilt past the pads', and the left stick never changed. It also checks that production calls aim_invert once, in npad_states, after hold_toggle_apply and before the free camera, and takes the pads' stick in through pads_stick_in on both paths. Each fails when undone: the flip judged before the toggles, as before the review (FAIL:481 ... got 1000,-2000, want 1000,2000, pressed again and held); the flip regardless of pad_aim (the scripted rows); the background path merged in place; the call moved before the toggles.
  • The checks that compile read_input's pad block compile pads_stick_in (and test_input_background.py an aim_invert stub for npad_states): tests/test_pads_after_menu.py, tests/test_input_background.py, tests/test_walk_key.py. All pass, as do tests/test_stick_inversion_rest.py, tests/test_menu_ini_keys.py and tests/test_settings_area_keys.py (FROZEN: the two new keys), tests/test_i18n_complete.py (the rows' texts in all 13 languages), and the menu mod's tests (cargo test -p modtool: the rows' place, the docs table).
  • schema-gen --check and ffi-gen --check are current (the settings snapshot's two new fields); scripts/check_host_compile.py: 83 host units, 0 failed.
  • The whole suite --strict on the head a9db7e2ae against main 3a0f7d8f7: 846 passed, 53 failed, 13 skipped against 845, 53, 13 (the new check), the same 53 files failing on both (they fail on main in this WSL); scripts/check_host_compile.py passes for Linux and Windows (llvm-mingw) on a9db7e2ae; schema-gen --check and ffi-gen --check current there. The rebase onto 3a0f7d8f7 had no conflict.
  • BeanBot's review of 87b0d76d8: L1 (the flip judged before the Toggle, so a press ending a kept aim stayed inverted while held), L2 (the background path flipped the merged stick, a scripted tilt included) and L3 (the check hard-coded gcc) are fixed in a9db7e2ae, as above.
  • A cold review by a second agent (the diff and the tests): two gaps it found, ZR kept by the Toggle column and the Controller in background path, are fixed and tested in the game; nothing else blocking.

Still to test:

  • None. ZR bound to a key with a controller's stick does not count as aiming (the rows are the pads'); a keyboard player has Invert mouse X/Y.

Measurements

Nothing on the frame path: one read of the input a frame, which asks the game's trigger state only while a row is not Same as camera and ZR is held.

Risks

None with the rows at Same as camera, the default: the stick is as before. With a row set, the right stick's axis while ZR aims goes as the row says. A revert is enough; the two new keys in the options file are then ignored.

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 fix: a game-free test that fails on main and passes here.
  • 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.
  • 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.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o

## Summary Invert camera X and Y flip the controller's right stick everywhere, aiming included, so there was no way to aim the slingshot, bow, hookshot or longshot inverted while keeping the camera as it is, or the other way round (#1084). This adds two Controls rows under Invert camera X/Y: - **Invert aiming X** and **Invert aiming Y**: Same as camera, Off, On. **Same as camera** is the default, so nobody's aiming changes after updating; Off and On give aiming that axis whatever Invert camera says. "Aiming" is ZR held with an aiming item on it: the slingshot or bow (any arrows), the hookshot or longshot, as the game's trigger state (`game_trigger_state`) says what is on ZR. ZR counts as the game is given it: held on a pad, or kept by the Controls page's Toggle column, whose second press ends the aim at once though the button stays held. The rows change the pads' right stick only: the mouse and the keyboard have their own rows (Invert mouse X/Y), and the gyro has Invert motion X/Y. The boomerang and looking around in first person have no such signal and follow Invert camera; their rows' help says so. The pad threads (`host/pad_sdl.c`, the XInput thread in `host/nn_hid.c`) apply Invert camera as before. `read_input` (`host/nn_hid.c`) takes the pads' stick in through `pads_stick_in`, in front and with Controller in background, and keeps their right stick in `pad_aim`. Then `npad_states` calls `aim_invert` right after the toggles (`hold_toggle_apply`), on the buttons the game is given. Where the aiming row differs from the camera row, it flips an axis only while the game is given just the pads' value: a scripted, control-bridge, mouse or key tilt is never turned. Read first: `host/nn_hid.c` `pads_stick_in`, `aim_invert` and its call in `npad_states`; `game/mods/controls/mod.toml` `invert_aim_x` / `invert_aim_y`. Fixes #1084 ## Testing **Tested:** Windows 10, RTX 4090, driver 617.42; an Xbox-style controller; a copy of my own save, with the bow and the hookshot. Runtime `v3.2.0-335-ga9db7e2ae` (the head a9db7e2ae, after BeanBot's review), Controls page, Controller section: - Invert camera Y Off, Invert aiming Y On: aiming with ZR held is inverted up and down; the camera, ZR let go, is not. - Invert camera Y On, Invert aiming Y Off: aiming is not inverted; the camera is. - Same as camera: aiming as the camera, as before. X the same way. - ZR's Toggle on, tapped and let go: aiming inverted as its row says while the toggle keeps ZR held. Pressed again and held: the aim ends and the stick is back as the camera's at once, while still held. Let go and pressed once more: kept and inverted again. Toggle off, ZR held: inverted while held. - The other cases above were played on 269b1da04 too, before the review fix. Checks: - `tests/test_aim_invert.py` (new): production's `pads_read`, `read_input`'s pad block, `pads_stick_in`, `hold_toggle_apply` and `aim_invert` with fakes, the item on ZR from a fake `game_trigger_state`; it compiles with the runner's compiler (`{cc}`, else `CC`, else gcc). It fails on `main` (`FAIL:418 right stick 1000,2000 (camera 0,0, aiming 0,2, ZR item 1, ZR held): got 1000,2000, want 1000,-2000`) and passes here with gcc and clang. Its cases: not aiming (ZR up, the hammer or nothing on ZR, no Link in play), each row against each camera setting for the bow and the hookshot, the Toggle column (kept, let go, pressed again and held: the aim ends; kept again while held), a scripted tilt with and without the pads', a camera key's tilt past the pads', and the left stick never changed. It also checks that production calls `aim_invert` once, in `npad_states`, after `hold_toggle_apply` and before the free camera, and takes the pads' stick in through `pads_stick_in` on both paths. Each fails when undone: the flip judged before the toggles, as before the review (`FAIL:481 ... got 1000,-2000, want 1000,2000`, pressed again and held); the flip regardless of `pad_aim` (the scripted rows); the background path merged in place; the call moved before the toggles. - The checks that compile `read_input`'s pad block compile `pads_stick_in` (and `test_input_background.py` an `aim_invert` stub for `npad_states`): `tests/test_pads_after_menu.py`, `tests/test_input_background.py`, `tests/test_walk_key.py`. All pass, as do `tests/test_stick_inversion_rest.py`, `tests/test_menu_ini_keys.py` and `tests/test_settings_area_keys.py` (FROZEN: the two new keys), `tests/test_i18n_complete.py` (the rows' texts in all 13 languages), and the menu mod's tests (`cargo test -p modtool`: the rows' place, the docs table). - `schema-gen --check` and `ffi-gen --check` are current (the settings snapshot's two new fields); `scripts/check_host_compile.py`: 83 host units, 0 failed. - The whole suite `--strict` on the head a9db7e2ae against `main` 3a0f7d8f7: 846 passed, 53 failed, 13 skipped against 845, 53, 13 (the new check), the same 53 files failing on both (they fail on `main` in this WSL); `scripts/check_host_compile.py` passes for Linux and Windows (llvm-mingw) on a9db7e2ae; `schema-gen --check` and `ffi-gen --check` current there. The rebase onto 3a0f7d8f7 had no conflict. - BeanBot's review of 87b0d76d8: L1 (the flip judged before the Toggle, so a press ending a kept aim stayed inverted while held), L2 (the background path flipped the merged stick, a scripted tilt included) and L3 (the check hard-coded gcc) are fixed in a9db7e2ae, as above. - A cold review by a second agent (the diff and the tests): two gaps it found, ZR kept by the Toggle column and the Controller in background path, are fixed and tested in the game; nothing else blocking. **Still to test:** - None. ZR bound to a key with a controller's stick does not count as aiming (the rows are the pads'); a keyboard player has Invert mouse X/Y. ## Measurements Nothing on the frame path: one read of the input a frame, which asks the game's trigger state only while a row is not Same as camera and ZR is held. ## Risks None with the rows at Same as camera, the default: the stick is as before. With a row set, the right stick's axis while ZR aims goes as the row says. A revert is enough; the two new keys in the options file are then ignored. ## 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. - [x] `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 fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [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. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o
feat(input): Invert aiming X and Y, the right stick while you aim with ZR, apart from Invert camera (#1084)
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
30c89fea54
Invert camera X/Y flip the pads' right stick everywhere, so aiming the slingshot, bow, hookshot or longshot went as
the camera did. Two Controls rows, Invert aiming X and Y (Same as camera, Off, On; Same as camera by default, so
nobody's aiming changes), give the right stick's axis while ZR is held with one of those items on it (the game's
trigger state): read_input's pad block flips it once more where the row differs from Invert camera. The pads'
stick only: the mouse and the keys are added after it, the gyro has its own rows. The boomerang and the first-person
look have no such signal and follow Invert camera.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o
Author
Contributor

Tested in game: Windows 10, RTX 4090, driver 617.42, Xbox-style controller, a copy of my save (bow, hookshot); runtime of 269b1da04 (this head's code). Invert camera Y Off + Invert aiming Y On: aiming inverted, camera not; camera On + aiming Off: aiming not inverted, camera is; Same as camera: as before; X likewise; ZR on the Toggle column, tapped: aiming inverted as its row says.

Tested in game: Windows 10, RTX 4090, driver 617.42, Xbox-style controller, a copy of my save (bow, hookshot); runtime of 269b1da04 (this head's code). Invert camera Y Off + Invert aiming Y On: aiming inverted, camera not; camera On + aiming Off: aiming not inverted, camera is; Same as camera: as before; X likewise; ZR on the Toggle column, tapped: aiming inverted as its row says.
cuecuemoar changed title from WIP: feat(input): Invert aiming X and Y, the right stick while you aim with ZR, apart from Invert camera to feat(input): Invert aiming X and Y, the right stick while you aim with ZR, apart from Invert camera 2026-12-04 18:03:42 +00:00
Owner
@review
BeanBot requested changes 2026-12-04 20:21:17 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The aiming direction can remain inverted after a toggled aim is released, and background controller input can invert scripted stick input. The new test also hard-codes GCC, so it can be skipped on supported compiler setups.

Adds independent right-stick aiming inversion settings while preserving the previous camera setting by default. The input ordering needs correction for toggle transitions and background input, and the test needs to use the selected compiler.

Blocking (2): must change before merging.

  1. L1 host/nn_hid.c:1159: The inversion uses the raw ZR press and the previous latch instead of the toggle result delivered to the game. (more on the line) Do: Determine the effective ZR state after applying the toggle, then apply inversion to the saved pad axes using that state. Test both latching and unlatching while the button stays held.
  2. L4: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

Should fix (2): not blocking, but worth doing before merging.

  • L2 host/nn_hid.c:1234: The background path inverts the already merged stick, including input that did not come from a controller. (more on the line) Do: Read and invert the pad into a separate zeroed stick array, then merge it into the existing stick as the foreground path does.
  • L3 tests/test_aim_invert.py:21: The new check hard-codes GCC instead of using the compiler selected by the test runner. (more on the line) Do: Use the runner's {cc} placeholder and honor CC for direct invocation.

@fix can do L1, L2 and L3.

Checks: Still running: 11 checks.

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

Does it help: Yes for the tested controller cases: the author reports both inversion combinations, both axes, the default, and a latched ZR working in game on Windows. This is not a performance change.

Other systems: The default leaves pad axes unchanged. The new path also affects background controller input and can interact with scripted input and toggle state. Mouse, keyboard axes and gyro are merged or handled separately. The reported game run was on Windows; the input logic is shared across platforms.

Switches: No environment switches added, changed or removed. Invert aiming X and Y are player settings, both defaulting to Same as camera; that preserves existing behavior.

Reviewed: 30c89fea54 against 9f76a4379c: Read the repository rules and PR template, commit messages, changed input implementation, settings definitions, new test and surrounding toggle and trigger code. Skimmed translation and generated settings changes and the other changed test diffs. The full changed files and every caller were not read in full; docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance.
  • The new setting keys are added to the frozen key table, and the documented defaults preserve existing inversion.
  • No game-derived files or third-party modifications appear in the changed-file list.

Testing: No commands that build or run code were executed. The author reports an in-game Windows run and game-free checks; the supplied CI checks are still running.

Overlaps and merge order: Not checked; network is closed.


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

**Recommendation: Request changes.** The aiming direction can remain inverted after a toggled aim is released, and background controller input can invert scripted stick input. The new test also hard-codes GCC, so it can be skipped on supported compiler setups. Adds independent right-stick aiming inversion settings while preserving the previous camera setting by default. The input ordering needs correction for toggle transitions and background input, and the test needs to use the selected compiler. **Blocking (2)**: must change before merging. 1. **L1** `host/nn_hid.c:1159`: The inversion uses the raw ZR press and the previous latch instead of the toggle result delivered to the game. (more on the line) **Do:** Determine the effective ZR state after applying the toggle, then apply inversion to the saved pad axes using that state. Test both latching and unlatching while the button stays held. 2. **L4**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* **Should fix (2)**: not blocking, but worth doing before merging. - **L2** `host/nn_hid.c:1234`: The background path inverts the already merged stick, including input that did not come from a controller. (more on the line) **Do:** Read and invert the pad into a separate zeroed stick array, then merge it into the existing stick as the foreground path does. - **L3** `tests/test_aim_invert.py:21`: The new check hard-codes GCC instead of using the compiler selected by the test runner. (more on the line) **Do:** Use the runner's {cc} placeholder and honor CC for direct invocation. `@fix` can do L1, L2 and L3. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the tested controller cases: the author reports both inversion combinations, both axes, the default, and a latched ZR working in game on Windows. This is not a performance change. **Other systems:** The default leaves pad axes unchanged. The new path also affects background controller input and can interact with scripted input and toggle state. Mouse, keyboard axes and gyro are merged or handled separately. The reported game run was on Windows; the input logic is shared across platforms. **Switches:** No environment switches added, changed or removed. Invert aiming X and Y are player settings, both defaulting to Same as camera; that preserves existing behavior. **Reviewed:** 30c89fea5455 against 9f76a4379cea: Read the repository rules and PR template, commit messages, changed input implementation, settings definitions, new test and surrounding toggle and trigger code. Skimmed translation and generated settings changes and the other changed test diffs. The full changed files and every caller were not read in full; docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance. - The new setting keys are added to the frozen key table, and the documented defaults preserve existing inversion. - No game-derived files or third-party modifications appear in the changed-file list. **Testing:** No commands that build or run code were executed. The author reports an in-game Windows run and game-free checks; the supplied CI checks are still running. **Overlaps and merge order:** Not checked; network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
host/nn_hid.c Outdated
@ -1151,0 +1156,4 @@
static void aim_invert(uint64_t buttons, int32_t stick[4]) {
const int aim_x = HOS_SETTING(invert_aim_x, 0), aim_y = HOS_SETTING(invert_aim_y, 0);
int zr_item = RENHDRUM_ITEM_NONE;
if (!(aim_x || aim_y) || !((buttons | toggles.latched) >> B_ZR & 1) || !game_trigger_state(&zr_item, NULL, NULL) ||
Member

L1 (blocking): The inversion uses the raw ZR press and the previous latch instead of the toggle result delivered to the game.

When: With ZR Toggle enabled and a bow latched on, press ZR again and keep it held. hold_toggle_apply clears the latch and releases ZR to the game, but this condition remains true for the whole physical press, so the camera uses the aiming inversion after aiming has ended.

Do: Determine the effective ZR state after applying the toggle, then apply inversion to the saved pad axes using that state. Test both latching and unlatching while the button stays held.

**L1** (blocking): The inversion uses the raw ZR press and the previous latch instead of the toggle result delivered to the game. *When:* With ZR Toggle enabled and a bow latched on, press ZR again and keep it held. hold_toggle_apply clears the latch and releases ZR to the game, but this condition remains true for the whole physical press, so the camera uses the aiming inversion after aiming has ended. **Do:** Determine the effective ZR state after applying the toggle, then apply inversion to the saved pad axes using that state. Test both latching and unlatching while the button stays held.
host/nn_hid.c Outdated
@ -1217,1 +1232,3 @@
if (pads_in_background(env, PADS_IN_BACKGROUND_SETTING)) pads_read(buttons, stick, NULL), sprint_now = pad_sprint_down();
if (pads_in_background(env, PADS_IN_BACKGROUND_SETTING)) {
pads_read(buttons, stick, NULL);
aim_invert(*buttons, stick); /* (the pads alone here: the stick is theirs) */
Member

L2 (should fix): The background path inverts the already merged stick, including input that did not come from a controller.

When: With Controller in background enabled, a scripted or control-bridge right-stick input can already be in stick before pads_read. If ZR is held with a bow and the aiming setting differs from the camera setting, aim_invert reverses that scripted axis even when the pad contributes no stick movement.

Do: Read and invert the pad into a separate zeroed stick array, then merge it into the existing stick as the foreground path does.

**L2** (should fix): The background path inverts the already merged stick, including input that did not come from a controller. *When:* With Controller in background enabled, a scripted or control-bridge right-stick input can already be in stick before pads_read. If ZR is held with a bow and the aiming setting differs from the camera setting, aim_invert reverses that scripted axis even when the pad contributes no stick movement. **Do:** Read and invert the pad into a separate zeroed stick array, then merge it into the existing stick as the foreground path does.
@ -0,0 +18,4 @@
import test_pads_after_menu as pads # noqa: E402
from area_settings import HOS_SETTING_C # noqa: E402
RUN_ALL_ARGS = ["--cc", "gcc"]
Member

L3 (should fix): The new check hard-codes GCC instead of using the compiler selected by the test runner.

When: On a supported machine with Clang and CC set but no gcc executable, run_all skips this test, or fails it in strict mode, although a suitable C compiler is available.

Do: Use the runner's {cc} placeholder and honor CC for direct invocation.

**L3** (should fix): The new check hard-codes GCC instead of using the compiler selected by the test runner. *When:* On a supported machine with Clang and CC set but no gcc executable, run_all skips this test, or fails it in strict mode, although a suitable C compiler is available. **Do:** Use the runner's {cc} placeholder and honor CC for direct invocation.
cuecuemoar force-pushed feat/aim-invert from 30c89fea54
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 87b0d76d8c
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-04 20:34:49 +00:00
Compare
Author
Contributor

Rebased onto main 5dffd615b: head 87b0d76d8 (test b322d3139). The only conflict was the generated settings ABI (game/settings_abi.h, host-sys settings_abi.rs: layout hash and count after main's new settings), regenerated with schema-gen; schema-gen and ffi-gen --check pass. git range-diff: host/nn_hid.c, the controls mod and the strings unchanged, so the in-game runs stand. Linux: test_aim_invert fails on the test commit (FAIL:418) and passes on the head; compile check passes (Linux, Windows); strict suite 841/53/13 against main's 840/53/13, the same 53 files.

Rebased onto main 5dffd615b: head 87b0d76d8 (test b322d3139). The only conflict was the generated settings ABI (game/settings_abi.h, host-sys settings_abi.rs: layout hash and count after main's new settings), regenerated with schema-gen; schema-gen and ffi-gen --check pass. git range-diff: host/nn_hid.c, the controls mod and the strings unchanged, so the in-game runs stand. Linux: test_aim_invert fails on the test commit (FAIL:418) and passes on the head; compile check passes (Linux, Windows); strict suite 841/53/13 against main's 840/53/13, the same 53 files.
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The aiming inversion still disagrees with the ZR toggle result on toggle transitions, and the background path can invert input from other sources. The new test also still selects GCC instead of the runner’s compiler.

The change adds independent right-stick aiming inversion while preserving the existing camera setting by default. It gives players more control, but the input ordering and background merge need correction.

Blocking (1): must change before merging.

  1. L1 host/nn_hid.c:1159: The inversion uses the raw ZR press and the previous latch instead of the toggle result delivered to the game. When: With ZR Toggle enabled and a bow latched on, press ZR again and keep it held. hold_toggle_apply clears the latch and releases ZR to the game, but this condition remains true for the whole physical press, so the camera uses the aiming inversion after aiming has ended. Do: Determine the effective ZR state after applying the toggle, then apply inversion to the saved pad axes using that state. Test both latching and unlatching while the button stays held.

Should fix (2): not blocking, but worth doing before merging.

  • L2 host/nn_hid.c:1234: The background path inverts the already merged stick, including input that did not come from a controller. When: With Controller in background enabled, a scripted or control-bridge right-stick input can already be in stick before pads_read. If ZR is held with a bow and the aiming setting differs from the camera setting, aim_invert reverses that scripted axis even when the pad contributes no stick movement. Do: Read and invert the pad into a separate zeroed stick array, then merge it into the existing stick as the foreground path does.
  • L3 tests/test_aim_invert.py:21: The new check hard-codes GCC instead of using the compiler selected by the test runner. When: On a supported machine with Clang and CC set but no gcc executable, run_all skips this test, or fails it in strict mode, although a suitable C compiler is available. Do: Use the runner's {cc} placeholder and honor CC for direct invocation.

@fix can do L1, L2 and L3.

Since the last review (on 30c89fea54)
Resolved: L4 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)
Still open: L1 (The inversion uses the raw ZR press and the previous latch instead of the toggle result de…); L2 (The background path inverts the already merged stick, including input that did not come fr…); L3 (The new check hard-codes GCC instead of using the compiler selected by the test runner.)

Checks: Still running: 11 checks.

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

Does it help: Unproven as a complete fix: the author reports successful Windows in-game checks for both axes and a latched ZR, but the toggle transition cases remain incorrect.

Other systems: The foreground and background controller paths, keyboard, mouse, scripted and control-bridge input share the input pipeline. The author reports Linux and Windows compile checks and Windows game testing; the background path still operates on a merged stick.

Switches: Invert aiming X and Y each default to Same as camera, preserving existing behavior; Off and On override the corresponding camera inversion while aiming. The defaults are appropriate.

Reviewed: 87b0d76d8c against 5dffd615b9: Read the repository rules, the relevant input and toggle code, the aiming test and the settings ABI diff. Skimmed the remaining changed tests, controls declarations and documentation; translations and generated ABI files were not read in full.; nothing run (a code review).

Checked and fine:

  • The new settings default to Same as camera and are included in both settings ABI representations.
  • The reported game-free check covers the aiming items and camera setting combinations.

Testing: No tests were run during this read-only review. The author reports Windows in-game testing and Linux and Windows compile checks; CI is still running.

Overlaps and merge order: None identified.


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

**Recommendation: Request changes.** The aiming inversion still disagrees with the ZR toggle result on toggle transitions, and the background path can invert input from other sources. The new test also still selects GCC instead of the runner’s compiler. The change adds independent right-stick aiming inversion while preserving the existing camera setting by default. It gives players more control, but the input ordering and background merge need correction. **Blocking (1)**: must change before merging. 1. **L1** `host/nn_hid.c:1159`: The inversion uses the raw ZR press and the previous latch instead of the toggle result delivered to the game. *When:* With ZR Toggle enabled and a bow latched on, press ZR again and keep it held. hold_toggle_apply clears the latch and releases ZR to the game, but this condition remains true for the whole physical press, so the camera uses the aiming inversion after aiming has ended. **Do:** Determine the effective ZR state after applying the toggle, then apply inversion to the saved pad axes using that state. Test both latching and unlatching while the button stays held. **Should fix (2)**: not blocking, but worth doing before merging. - **L2** `host/nn_hid.c:1234`: The background path inverts the already merged stick, including input that did not come from a controller. *When:* With Controller in background enabled, a scripted or control-bridge right-stick input can already be in stick before pads_read. If ZR is held with a bow and the aiming setting differs from the camera setting, aim_invert reverses that scripted axis even when the pad contributes no stick movement. **Do:** Read and invert the pad into a separate zeroed stick array, then merge it into the existing stick as the foreground path does. - **L3** `tests/test_aim_invert.py:21`: The new check hard-codes GCC instead of using the compiler selected by the test runner. *When:* On a supported machine with Clang and CC set but no gcc executable, run_all skips this test, or fails it in strict mode, although a suitable C compiler is available. **Do:** Use the runner's {cc} placeholder and honor CC for direct invocation. `@fix` can do L1, L2 and L3. **Since the last review** (on 30c89fea5455) Resolved: L4 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) Still open: L1 (The inversion uses the raw ZR press and the previous latch instead of the toggle result de…); L2 (The background path inverts the already merged stick, including input that did not come fr…); L3 (The new check hard-codes GCC instead of using the compiler selected by the test runner.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven as a complete fix: the author reports successful Windows in-game checks for both axes and a latched ZR, but the toggle transition cases remain incorrect. **Other systems:** The foreground and background controller paths, keyboard, mouse, scripted and control-bridge input share the input pipeline. The author reports Linux and Windows compile checks and Windows game testing; the background path still operates on a merged stick. **Switches:** Invert aiming X and Y each default to Same as camera, preserving existing behavior; Off and On override the corresponding camera inversion while aiming. The defaults are appropriate. **Reviewed:** 87b0d76d8cf8 against 5dffd615b995: Read the repository rules, the relevant input and toggle code, the aiming test and the settings ABI diff. Skimmed the remaining changed tests, controls declarations and documentation; translations and generated ABI files were not read in full.; nothing run (a code review). **Checked and fine:** - The new settings default to Same as camera and are included in both settings ABI representations. - The reported game-free check covers the aiming items and camera setting combinations. **Testing:** No tests were run during this read-only review. The author reports Windows in-game testing and Linux and Windows compile checks; CI is still running. **Overlaps and merge order:** None identified. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
cuecuemoar force-pushed feat/aim-invert from 87b0d76d8c
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to a9db7e2ae4
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-05 05:26:47 +00:00
Compare
Author
Contributor

BeanBot's L1, L2 and L3 are fixed in a9db7e2ae, after a rebase onto main 3a0f7d8f7 (no conflicts).

  • L1: aim_invert now runs in npad_states right after hold_toggle_apply, on the buttons the game is given. The press that ends a kept aim ends the flip at once, though ZR stays held; a press that keeps it again while held flips again.
  • L2: the pads' stick goes in through pads_stick_in on both paths (in front, and Controller in background into a zeroed array, then stick_max). It keeps the pads' right stick in pad_aim, and aim_invert flips an axis only while the game is given just that value. A scripted, bridge, mouse or key tilt is never turned.
  • L3: RUN_ALL_ARGS = ["--cc", "{cc}"], and --cc defaults to CC, else gcc.

tests/test_aim_invert.py runs the real hold_toggle_apply. New cases: latch, let go, press again and hold (no flip for the whole press), latch again while held; a scripted tilt with and without the pads'; a camera key past the pads'. It also checks where production calls both functions. Each undo fails: the old order (FAIL:481, pressed again and held), flipping regardless of pad_aim, the background merged in place, the call before the toggles.

In game on a9db7e2ae (v3.2.0-335-ga9db7e2ae, Windows 10, RTX 4090, Xbox-style controller, my own save, bow): the four Toggle steps, including press again and hold, all as above. Linux: host compile (Linux and Windows) and schema/ffi-gen current; strict suite 846/53/13 against main's 845/53/13, the same 53 files failing on both.

BeanBot's L1, L2 and L3 are fixed in a9db7e2ae, after a rebase onto main 3a0f7d8f7 (no conflicts). - **L1:** `aim_invert` now runs in `npad_states` right after `hold_toggle_apply`, on the buttons the game is given. The press that ends a kept aim ends the flip at once, though ZR stays held; a press that keeps it again while held flips again. - **L2:** the pads' stick goes in through `pads_stick_in` on both paths (in front, and Controller in background into a zeroed array, then `stick_max`). It keeps the pads' right stick in `pad_aim`, and `aim_invert` flips an axis only while the game is given just that value. A scripted, bridge, mouse or key tilt is never turned. - **L3:** `RUN_ALL_ARGS = ["--cc", "{cc}"]`, and `--cc` defaults to `CC`, else gcc. `tests/test_aim_invert.py` runs the real `hold_toggle_apply`. New cases: latch, let go, press again and hold (no flip for the whole press), latch again while held; a scripted tilt with and without the pads'; a camera key past the pads'. It also checks where production calls both functions. Each undo fails: the old order (`FAIL:481`, pressed again and held), flipping regardless of `pad_aim`, the background merged in place, the call before the toggles. In game on a9db7e2ae (v3.2.0-335-ga9db7e2ae, Windows 10, RTX 4090, Xbox-style controller, my own save, bow): the four Toggle steps, including press again and hold, all as above. Linux: host compile (Linux and Windows) and schema/ffi-gen current; strict suite 846/53/13 against main's 845/53/13, the same 53 files failing on both.
Owner
@rebase
Member

I rebased this pull request onto main (3145d9d48f): the new head is 2f10b8fb74.

Conflicts resolved

  • docs/user/graphics-and-controls.md: Kept the aiming and ocarina rows.
  • game/crates/host-sys/src/settings_abi.rs: Kept both settings additions and updated the layout hash and count.
  • game/mods/controls/mod.toml: Kept the aiming and ocarina controls.
  • game/mods/menu/strings/de.json: Kept both sets of translations.
  • game/mods/menu/strings/es-419.json: Kept both sets of translations.
  • game/mods/menu/strings/es.json: Kept both sets of translations.
  • game/mods/menu/strings/fr.json: Kept both sets of translations.
  • game/mods/menu/strings/it.json: Kept both sets of translations.
  • game/mods/menu/strings/ja.json: Kept both sets of translations.
  • game/mods/menu/strings/ko.json: Kept both sets of translations.
  • game/mods/menu/strings/nl.json: Kept both sets of translations.
  • game/mods/menu/strings/pl.json: Kept both sets of translations.
  • game/mods/menu/strings/pt-BR.json: Kept both sets of translations.
  • game/mods/menu/strings/ru.json: Kept both sets of translations.
  • game/mods/menu/strings/zh-Hans.json: Kept both sets of translations.
  • game/mods/menu/strings/zh-Hant.json: Kept both sets of translations.
  • game/mods/menu/test/menu.test.ts: Kept both controls in menu order.
  • game/settings_abi.h: Kept both settings additions and updated the layout hash.

Nothing was built or run: read the resolution before merging.


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

I rebased this pull request onto `main` (3145d9d48f05): the new head is 2f10b8fb7408. **Conflicts resolved** - docs/user/graphics-and-controls.md: Kept the aiming and ocarina rows. - game/crates/host-sys/src/settings_abi.rs: Kept both settings additions and updated the layout hash and count. - game/mods/controls/mod.toml: Kept the aiming and ocarina controls. - game/mods/menu/strings/de.json: Kept both sets of translations. - game/mods/menu/strings/es-419.json: Kept both sets of translations. - game/mods/menu/strings/es.json: Kept both sets of translations. - game/mods/menu/strings/fr.json: Kept both sets of translations. - game/mods/menu/strings/it.json: Kept both sets of translations. - game/mods/menu/strings/ja.json: Kept both sets of translations. - game/mods/menu/strings/ko.json: Kept both sets of translations. - game/mods/menu/strings/nl.json: Kept both sets of translations. - game/mods/menu/strings/pl.json: Kept both sets of translations. - game/mods/menu/strings/pt-BR.json: Kept both sets of translations. - game/mods/menu/strings/ru.json: Kept both sets of translations. - game/mods/menu/strings/zh-Hans.json: Kept both sets of translations. - game/mods/menu/strings/zh-Hant.json: Kept both sets of translations. - game/mods/menu/test/menu.test.ts: Kept both controls in menu order. - game/settings_abi.h: Kept both settings additions and updated the layout hash. Nothing was built or run: read the resolution before merging. --- <sub>Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
BeanBot force-pushed feat/aim-invert from a9db7e2ae4
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 2f10b8fb74
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-05 17:22:35 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The three ledger items are resolved, and the reported in-game run shows the aiming settings and toggle behavior working. An equal-value input collision remains a minor edge case. Recommend approval; not approved on the forge.

Players can set right-stick aiming inversion independently of camera inversion while preserving existing behavior by default. The change adds two settings and input-source tracking.

Should fix (1): not blocking, but worth doing before merging.

  • L5 host/nn_hid.c:1217: Equality with the pad value does not establish that the merged axis came from the pad. (more on the line) Do: Track which source won each axis during merging and flip only axes won by the pad.

@fix can do L5.

Since the last review (on 87b0d76d8c)
Resolved: L1 (The inversion uses the raw ZR press and the previous latch instead of the toggle result de…); L2 (The background path inverts the already merged stick, including input that did not come fr…); L3 (The new check hard-codes GCC instead of using the compiler selected by the test runner.)
New: L5 (Equality with the pad value does not establish that the merged axis came from the pad.)

Checks: Still running: 11 checks.

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

Does it help: Yes. The author reports successful Windows in-game checks for both axes, camera settings, and the ZR toggle; this is not a performance change.

Other systems: The input path covers SDL and XInput controllers, foreground and background input, toggle handling, and scripted input. The author reports Linux and Windows host compile checks; the in-game run was on Windows.

Switches: Invert aiming X and Y are new saved choices, each defaulting to Same as camera. That default preserves existing behavior; the controls documentation and settings keys were updated.

Reviewed: 2f10b8fb74 against 3145d9d48f: Read the repository rules, the changed host input path and relevant test changes; reviewed the controls and settings ABI diffs. Skimmed generated settings and translation changes. The complete changed files and all referenced project rules were not read in full.; nothing run (a code review).

Checked and fine:

  • The default settings leave the camera-adjusted stick unchanged.
  • The reported test exercises the toggle release and selected compiler.

Testing: No commands that build or run tests were executed. The author reports in-game Windows testing, game-free checks, and Linux and Windows host compile checks; CI is still running.

Overlaps and merge order: Not checked; network access is closed.


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

**Recommendation: Approve.** The three ledger items are resolved, and the reported in-game run shows the aiming settings and toggle behavior working. An equal-value input collision remains a minor edge case. Recommend approval; not approved on the forge. Players can set right-stick aiming inversion independently of camera inversion while preserving existing behavior by default. The change adds two settings and input-source tracking. **Should fix (1)**: not blocking, but worth doing before merging. - **L5** `host/nn_hid.c:1217`: Equality with the pad value does not establish that the merged axis came from the pad. (more on the line) **Do:** Track which source won each axis during merging and flip only axes won by the pad. `@fix` can do L5. **Since the last review** (on 87b0d76d8cf8) Resolved: L1 (The inversion uses the raw ZR press and the previous latch instead of the toggle result de…); L2 (The background path inverts the already merged stick, including input that did not come fr…); L3 (The new check hard-codes GCC instead of using the compiler selected by the test runner.) New: L5 (Equality with the pad value does not establish that the merged axis came from the pad.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports successful Windows in-game checks for both axes, camera settings, and the ZR toggle; this is not a performance change. **Other systems:** The input path covers SDL and XInput controllers, foreground and background input, toggle handling, and scripted input. The author reports Linux and Windows host compile checks; the in-game run was on Windows. **Switches:** Invert aiming X and Y are new saved choices, each defaulting to Same as camera. That default preserves existing behavior; the controls documentation and settings keys were updated. **Reviewed:** 2f10b8fb7408 against 3145d9d48f05: Read the repository rules, the changed host input path and relevant test changes; reviewed the controls and settings ABI diffs. Skimmed generated settings and translation changes. The complete changed files and all referenced project rules were not read in full.; nothing run (a code review). **Checked and fine:** - The default settings leave the camera-adjusted stick unchanged. - The reported test exercises the toggle release and selected compiler. **Testing:** No commands that build or run tests were executed. The author reports in-game Windows testing, game-free checks, and Linux and Windows host compile checks; CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.</sub>
host/nn_hid.c Outdated
@ -1192,0 +1214,4 @@
const int flip[2] = {aim_x && (aim_x == 2) != (HOS_SETTING(invert_camera_x, 0) != 0),
aim_y && (aim_y == 2) != (HOS_SETTING(invert_camera_y, 0) != 0)};
for (int i = 0; i < 2; i++)
if (flip[i] && pad_aim[i] && stick[2 + i] == pad_aim[i]) stick[2 + i] = -stick[2 + i];
Member

L5 (should fix): Equality with the pad value does not establish that the merged axis came from the pad.

When: If a script or control bridge supplies an axis value of 1000 and the pad supplies the same value, stick_max keeps the existing scripted value, but aim_invert sees it equal pad_aim and reverses it while aiming.

Do: Track which source won each axis during merging and flip only axes won by the pad.

**L5** (should fix): Equality with the pad value does not establish that the merged axis came from the pad. *When:* If a script or control bridge supplies an axis value of 1000 and the pad supplies the same value, stick_max keeps the existing scripted value, but aim_invert sees it equal pad_aim and reverses it while aiming. **Do:** Track which source won each axis during merging and flip only axes won by the pad.
Owner
@rebase
Member

I rebased this pull request onto main (df19b74049): the new head is f6a8fe3976.

Conflicts resolved

  • game/settings_abi.h: Updated the layout hash for the merged fields.
  • game/crates/host-sys/src/settings_abi.rs: Updated the matching Rust layout hash.

Nothing was built or run: read the resolution before merging.


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

I rebased this pull request onto `main` (df19b7404967): the new head is f6a8fe397687. **Conflicts resolved** - game/settings_abi.h: Updated the layout hash for the merged fields. - game/crates/host-sys/src/settings_abi.rs: Updated the matching Rust layout hash. Nothing was built or run: read the resolution before merging. --- <sub>Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
BeanBot force-pushed feat/aim-invert from 2f10b8fb74
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to f6a8fe3976
Some checks are pending
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Successful in 6s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Waiting to run
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Waiting to run
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Waiting to run
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Waiting to run
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Waiting to run
CI / Website build and checks (pull_request) Waiting to run
CI / Third-party parts and guide screenshots (pull_request) Successful in 11s
2026-12-05 17:44:29 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The aiming options work in the reported controller tests and preserve the existing behavior by default. L5 remains a minor input-source ambiguity in mixed scripted and controller input. Recommend approval; not approved on the forge.

Adds separate horizontal and vertical controller aiming inversion settings. The default follows camera inversion; the added input handling has a minor ambiguity when two sources provide the same axis value.

Should fix (1): not blocking, but worth doing before merging.

  • L5 host/nn_hid.c:1217: Equality with the pad value does not establish that the merged axis came from the pad. When: If a script or control bridge supplies an axis value of 1000 and the pad supplies the same value, stick_max keeps the existing scripted value, but aim_invert sees it equal pad_aim and reverses it while aiming. Do: Track which source won each axis during merging and flip only axes won by the pad.

@fix can do L5.

Since the last review (on 2f10b8fb74)
Still open: L5 (Equality with the pad value does not establish that the merged axis came from the pad.)

Checks: Still running: 11 checks.

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

Does it help: Yes. The author reports in-game tests of both axes, both inversion directions, and ZR toggle behavior on Windows with an Xbox-style controller. This is not a performance change.

Other systems: The input path also serves SDL and XInput controllers, background controller input, scripts, the control bridge, mouse and keyboard. The reported game run covers Windows and one controller; the game-free checks cover several mixed-input and toggle cases.

Switches: Invert aiming X and Invert aiming Y each default to Same as camera, preserving existing behavior. Off and On select independent aiming inversion. The controls documentation includes both rows.

Reviewed: f6a8fe3976 against df19b74049: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the input-path changes and surrounding merge and toggle code, the controls settings and ABI diffs, and the new aiming test. Skimmed the remaining changes and translations; did not read every changed code file in full.; nothing run (a code review).

Checked and fine:

  • The rebased C and Rust settings ABI layout hashes match, and the Rust settings count includes the two new entries.
  • The aiming inversion runs after the hold-toggle logic, and the default leaves the pad axis unchanged.

Testing: No commands that run project code or tests were executed. The author reports game-free checks and an in-game Windows run; CI is still running.

Overlaps and merge order: Not checked; network access is closed.


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

**Recommendation: Approve.** The aiming options work in the reported controller tests and preserve the existing behavior by default. L5 remains a minor input-source ambiguity in mixed scripted and controller input. Recommend approval; not approved on the forge. Adds separate horizontal and vertical controller aiming inversion settings. The default follows camera inversion; the added input handling has a minor ambiguity when two sources provide the same axis value. **Should fix (1)**: not blocking, but worth doing before merging. - **L5** `host/nn_hid.c:1217`: Equality with the pad value does not establish that the merged axis came from the pad. *When:* If a script or control bridge supplies an axis value of 1000 and the pad supplies the same value, stick_max keeps the existing scripted value, but aim_invert sees it equal pad_aim and reverses it while aiming. **Do:** Track which source won each axis during merging and flip only axes won by the pad. `@fix` can do L5. **Since the last review** (on 2f10b8fb7408) Still open: L5 (Equality with the pad value does not establish that the merged axis came from the pad.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The author reports in-game tests of both axes, both inversion directions, and ZR toggle behavior on Windows with an Xbox-style controller. This is not a performance change. **Other systems:** The input path also serves SDL and XInput controllers, background controller input, scripts, the control bridge, mouse and keyboard. The reported game run covers Windows and one controller; the game-free checks cover several mixed-input and toggle cases. **Switches:** Invert aiming X and Invert aiming Y each default to Same as camera, preserving existing behavior. Off and On select independent aiming inversion. The controls documentation includes both rows. **Reviewed:** f6a8fe397687 against df19b7404967: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the input-path changes and surrounding merge and toggle code, the controls settings and ABI diffs, and the new aiming test. Skimmed the remaining changes and translations; did not read every changed code file in full.; nothing run (a code review). **Checked and fine:** - The rebased C and Rust settings ABI layout hashes match, and the Rust settings count includes the two new entries. - The aiming inversion runs after the hold-toggle logic, and the default leaves the pad axis unchanged. **Testing:** No commands that run project code or tests were executed. The author reports game-free checks and an in-game Windows run; CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch feat/aim-invert 2026-12-05 17:46:27 +00:00
Author
Contributor

Linux checks for this PR after main's Ocarina controls row (#3253), on a local rebase whose PR changes are the same as BeanBot's head f6a8fe397 (git range-diff: the test and fix commits are identical; the feat commit differs only in context, and the PR's own diff differs only in the generated LAYOUT hash and SETTINGS count, because main differs).

WSL (Ubuntu 22.04), head e9ad06951 (on main 3131b1ddc) against main 3131b1ddc:

  • scripts/check_host_compile.py: Linux 83 host units, 0 failed; Windows (llvm-mingw) 81 units, 0 failed.
  • Generated files: schema-gen matches. ffi-gen --check fails the same way on main (rx_menu_open in host/game_host.h has no doc comment); this PR doesn't touch that file.
  • This PR's tests: test_aim_invert, test_menu_ini_keys, test_pads_after_menu, test_input_background, test_walk_key pass on head; all but test_aim_invert pass on main too.
  • tests/run_all.py --strict: head 855 passed, 50 failed, 13 skipped; main 854 / 50 / 13. The same 50 files fail on both sides.

Not covered: main's #352 (native mouse look for the aim cameras, df19b7404) landed after 3131b1ddc. This PR inverts only the pads' own tilt, but the in-game test predates #352, so mouse aim with Invert aiming on is untested on this head.

Linux checks for this PR after main's Ocarina controls row (#3253), on a local rebase whose PR changes are the same as BeanBot's head f6a8fe397 (`git range-diff`: the test and fix commits are identical; the feat commit differs only in context, and the PR's own diff differs only in the generated `LAYOUT` hash and `SETTINGS` count, because main differs). WSL (Ubuntu 22.04), head e9ad06951 (on main 3131b1ddc) against main 3131b1ddc: - `scripts/check_host_compile.py`: Linux 83 host units, 0 failed; Windows (llvm-mingw) 81 units, 0 failed. - Generated files: schema-gen matches. `ffi-gen --check` fails the same way on main (`rx_menu_open` in `host/game_host.h` has no doc comment); this PR doesn't touch that file. - This PR's tests: `test_aim_invert`, `test_menu_ini_keys`, `test_pads_after_menu`, `test_input_background`, `test_walk_key` pass on head; all but `test_aim_invert` pass on main too. - `tests/run_all.py --strict`: head 855 passed, 50 failed, 13 skipped; main 854 / 50 / 13. The same 50 files fail on both sides. Not covered: main's #352 (native mouse look for the aim cameras, df19b7404) landed after 3131b1ddc. This PR inverts only the pads' own tilt, but the in-game test predates #352, so mouse aim with Invert aiming on is untested on this head.
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!3188
No description provided.