feat(input): an Ocarina controls row, N64 / GameCube: A and the right stick play the notes (kingo's #1303) #3253
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3253
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:feat/ocarina-controls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: feat · Risk: low · Tested on: Windows 11, RTX 5080, Xbox controller · Needs: Linux with a real controller
Summary
Players who grew up on the N64 or GameCube play the ocarina with A and the C buttons (the C-stick on GameCube). On a PC controller that is A and the right stick, but in Longshot the notes are only on L, R, A, Y and X, and the five Ocarina note bindings take buttons, not stick directions. So songs that are muscle memory don't work. A player asked for this on Discord.
This adds a row to the Controls tab, Ocarina controls: Switch 2 (as now, the default) or N64 / GameCube. With N64 / GameCube:
This is kingo's work from #1303 (closed as stale on 2026-12-04, after kingo didn't answer whether we could take it over), finished on current
main. kingo's commits no longer apply: since then the note code moved behindgame.h, the host reads settings from the game's snapshot, a menu row became a system mod's setting, andnx2/prompt_assets.pybecame build-assets' Rust. So the two commits here redo kingo's six, withCo-Authored-By: kingo. The design, the note mapping (checked by kingo against the game's song sheets: Saria's Song is R A Y, Zelda's Lullaby Y X A) and the icons are kingo's. The Linux test with a real controller is the one futondestroyer's farm review asked for on 1303.Read first:
host/nn_hid.c:pad_right_stick_way(new),pads_read(the stick held from the camera while it plays notes),oc_notesandoc_pad_word(the N64 layout).game/mods/controls/mod.toml: theocarina_controlssetting (an area mod's: the host readsHOS_SETTING(ocarina_controls, 0)).builder/crates/build-assets/src/prompts/textures.rsandhost/prompts.ctexture_runs: each textures.bin entry's u16 is now its flags (a note as the Switch 2 plays it, or as N64 / GameCube plays it), and the host takes the ones the row chooses, at the start and when the row changes in play.The right stick's four ways are input bits of their own past
HOS_PAD_N(like the DualSense touchpad's), so no control can be bound to them. The row stays outside the prompts'BINDS, sogame.his unchanged.Left for other pull requests (one topic each):
game/crates/binds, the Controls page), a different area.Closes nothing; supersedes #1303.
Testing
Tested: Windows 11 Pro (26300), RTX 5080, driver 621.47, an Xbox controller, this branch over main 7bc53f841's base (
dev.py rt,HOS_SYSTEM_MODS_DIRon). In the game, by hand, from the castle-gate save with the Fairy Ocarina and the songs given: with N64 / GameCube, Zelda's Lullaby played from the right stick (left, up, right, left, up, right) and the song was recognised ("You played Zelda's Lullaby!"), the staff showing the four arrows; with Switch 2, the songs played on Y, X and A as before. Then, in a second run with N64 / GameCube: the right stick held while the ocarina was out did not turn the camera, and once the ocarina was put away it turned the camera again.dev.py smoke: PASS (in play from kokiri-start, 900 frames, the menu opened).The staff after Zelda's Lullaby on the right stick is in the first comment below.
Game-free:
tests/test_ocarina_notes.py: kingo's cases on main's code (each stick way plays its note, A the low D, L/R/Y/X nothing in a lesson too, bound note rows still play, the stick back to the camera on Switch 2 and once the ocarina is away), plus the stick's ways themselves (past half way, the main axis, Invert camera undone). Fails on main (no row), passes here.tests/test_ocarina_note_icons.py(new): host/prompts.c'stexture_runsover a textures.bin with flags, for both rows; that the start's file and the live writes follow the row. Fails on main, passes here.the_n64_notes_point_their_way_and_say_so_in_their_flags(new), and the keyboard note test counts the new layers.mise run test's checks (run_all.py --jobs 12, Windows): 757 passed, 1 failed, run without the ones that fail onmainand that this doesn't touch (not run: test_present_geometry_trace, test_present_image_free, test_present_held_image, test_present_acquire_ahead, test_dlssg, test_no_map_reload, test_sync_watch_event, test_turf_budget, test_ui_renderer, test_no_game_title). The one failure is test_lifter, by parts that fail onmain7bc53f841: host-sys's clippy (large_const_arrays,SETTINGS), build-assets' clippy (needless_range_loopandchunks_exact, both main's lines), api'sa_walked_reshade_folder_counts_a_change_once_two_walks_agree, build-driver'sthe_repository_s_lock_and_the_table_agree, and modtool'sthe_menu_passes_its_tests(the developer page's PLACED; the controls tab with the new row passes before it). The rest of the Rust workspace, run on its own past those: 3413 tests passed;schema-gen --checkandcargo fmt --all --checkpass; build-assets' clippy finds nothing in the new code.mise run lintpasses.Still to test:
Measurements
Verdict: nothing to measure: an input row, off (Switch 2) by default. The right stick is already read every 2 ms; this adds one compare to that read and none to the frame. The build's prompt files grow: each face's textures.bin gains the low D's icons and the four arrows (Xbox 4.44 MB to 4.62 MB, Switch 2.44 to 2.64 MB, keyboard 6.12 to 7.18 MB, one icon per key; main 7bc53f841's base against this build). Only the chosen icons are written into the game's file, as before.
Risks
What could break: with N64 / GameCube, the right stick during the ocarina (held from the camera, by design). With Switch 2 nothing changes: the stick's new input bits are read, but only the note code looks at them, and only with the row on. Note icons: textures.bin's entries carried a u16 0 before, so a build of before this reads as "no flags": every icon as now.
Turning it off: the row's Switch 2, or a revert.
After updating: one new line in settings.toml when the row is changed (
ocarina_controls); the prompts' cached textures are written again once (their key now includes the row).Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.mainand here, for a change that shows on screen. (Here only: onmain, and with Switch 2, the staff shows the game's own note buttons, unchanged)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11 Pro (26300), RTX 5080, driver 621.47, an Xbox controller, castle-gate save with the Fairy Ocarina and songs given: with Ocarina controls on N64 / GameCube, Zelda's Lullaby played from the right stick and recognised, the staff showing arrows, the camera still while playing; with Switch 2, the songs played on Y, X and A as before. dev.py smoke: PASS.
Zelda's Lullaby played on the right stick with Ocarina controls on N64 / GameCube (Windows 11, RTX 5080, Xbox controller): the game recognised the song, and the staff shows the notes as arrows.
A correction to the first comment: "the camera still while playing" was not checked by eye in this run. The code holds the stick from the camera during the note wait and the game-free test checks it; the in-game check is now in Still to test.
Possibly related, for context:
@Beanstalk linux, a tester with a physical controller: F1 > Controls > Ocarina controls > N64 / GameCube, take out the ocarina and play Song of Time as right, A, down, right, A, down (the right stick and A). Expect the song to play, the camera to stay still while playing and to turn again once the ocarina is put away, L/R/Y/X to play no note, and the staff's notes to show A and arrows. Then set the row back to Switch 2 and play it on A, L, R: expect it to play and the staff's icons to be the Switch's again. Without a physical controller, a start-up smoke on Linux with the row set to N64 / GameCube is still useful.
Beanstalk test farm
Commit
670073a· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.@review
Recommendation: Approve. The Windows game run shows the new layout can play a song, but the camera transition and a real-controller Linux run remain unverified. The new icon test also ignores CC when run directly. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
Adds an optional N64 / GameCube ocarina layout using A and the right stick, with matching note icons. Switch 2 remains the default; the added prompt textures increase build output size.
Should fix (1): not blocking, but worth doing before merging.
tests/test_ocarina_note_icons.py:89: The standalone test defaults to gcc without consulting CC. (more on the line) Do: Default to CC when set, with an available compiler fallback, while retaining the explicit --cc override.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
host/nn_hid.c:908: The camera and physical-controller paths still need the in-game checks listed in the PR. (more on the line) Do: Check the transition in game on Windows and run the described song and camera checks with a physical controller on Linux.@fixcan do L1.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports Zelda’s Lullaby was recognised using the right stick on Windows with an Xbox controller. Camera suppression and restoration have not yet been checked in game.
Other systems: The input path also serves SDL controllers, keyboard bindings and scripted input; prompt textures change for every controller face and the keyboard. The author reports game-free checks on Windows and Linux, but real-controller Linux, SDL controller icons and the keyboard face remain untested in game.
Switches: No environment switch added, changed or removed. The player-facing Ocarina controls choice defaults to Switch 2, preserving the existing layout; N64 / GameCube is opt-in. The controls table is updated.
Reviewed:
24dd5c43bfagainst7bc53f8413: Read the supplied PR description, comments and CI status, repository contribution rules and PR template, commit messages, and the substantive diffs and surrounding input, prompt, settings and test paths. Skimmed translations and generated settings changes; did not read every changed code file in full.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no tests, builds or project scripts were run. The author reports Windows in-game and Windows/Linux game-free checks; CI is still running.
Overlaps and merge order: The PR identifies the closed #1303 as the work it supersedes; no other overlap was verified.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -893,1 +905,4 @@if (!sdl_pads && xinput_pads > 0) controlled = xinput_pads; /* (XInput-only: no SDL pad to count it) */raw |= pad_right_stick_way(s);/* (while the ocarina waits for a note and the stick plays them: the stick is the notes', not the camera's) */if (oc_consumed_pads & HOS_PAD_RS_MASK) s[2] = s[3] = 0;L2 (should fix): The camera and physical-controller paths still need the in-game checks listed in the PR.
When: When a player takes out or puts away the ocarina, the right stick must switch between notes and camera control; the reported Windows run did not observe that transition, and Linux has not been exercised with a physical controller.
Do: Check the transition in game on Windows and run the described song and camera checks with a physical controller on Linux.
@ -0,0 +86,4 @@def main():p = argparse.ArgumentParser(description=__doc__)p.add_argument("--cc", default="gcc")L1 (should fix): The standalone test defaults to gcc without consulting CC.
When: On a supported development setup with CC set to clang and no gcc on PATH, running this test directly fails to find gcc even though the configured C compiler is available.
Do: Default to CC when set, with an available compiler fallback, while retaining the explicit --cc override.
Thanks for the review.
554b2dcf4: run alone,tests/test_ocarina_note_icons.pynow takes$CC, else gcc, else clang (--ccstill wins, as run_all.py passes it). Checked on Windows with CC=clang, with CC unset, and through run_all.py; on Linux (WSL, gcc) with CC unset and CC=gcc.Camera checked in game (Windows 11, RTX 5080, Xbox controller, N64 / GameCube): with the ocarina out, the right stick held did not turn the camera; with the ocarina put away, it turned the camera again. Moved from Still to test to Tested (BeanBot's L2, Windows part). The Linux run with a physical controller is still to do, by hand.
@review
Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The compiler selection fix resolves L1, and the Windows camera check has been reported. The physical-controller checks on Linux and the other setups listed in the PR remain outstanding. Recommend approval; not approved on the forge.
Adds an optional N64 / GameCube ocarina layout using A and the right stick, with matching note icons. The fix makes the standalone icon test respect the selected compiler.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
host/nn_hid.c:908: The remaining physical-controller and icon checks listed in the PR need in-game results. When: Linux with a physical controller, Windows with an SDL DualSense or Switch Pro controller, and the keyboard face have not yet been checked in game. Do: Perform the remaining checks described in Still to test and report the results.Since the last review (on
24dd5c43bf)Resolved: L1 (The standalone test defaults to gcc without consulting CC.)
Still open: L2 (The remaining physical-controller and icon checks listed in the PR need in-game results.)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports that Zelda’s Lullaby was recognized with the new layout on Windows and that the camera stopped and resumed responding as intended. This is not a performance change.
Other systems: Linux physical-controller behavior, Windows SDL controllers, and keyboard note icons remain unverified in game.
Switches: Ocarina controls defaults to Switch 2; N64 / GameCube is opt-in. The default preserves the existing layout.
Reviewed:
554b2dcf4bagainst7bc53f8413: Read AGENTS.md, CONTRIBUTING.md, the full icon test, the input changes, and the fix diff. The remaining changed files and full base diff were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. The author reports Windows in-game and game-free checks; CI is still running.
Overlaps and merge order: The PR identifies #1303 as superseded.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@rebase
I rebased this pull request onto
main(27114559f1): the new head is0cf93e8686.Conflicts resolved
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.
554b2dcf4b0cf93e8686Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The new layout worked in the reported Windows Xbox-controller game run, including the camera check. The remaining physical-controller and icon checks are still outstanding. Recommend approval; not approved on the forge.
Adds an optional N64 / GameCube ocarina layout using A and the right stick, with matching note icons. It preserves the existing layout by default at the cost of additional input and prompt-texture logic and larger prompt assets.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
host/nn_hid.c:908: The remaining physical-controller and icon checks listed in the PR need in-game results. When: Linux with a physical controller, Windows with an SDL DualSense or Switch Pro controller, and the keyboard face have not yet been checked in game. Do: Perform the remaining checks described in Still to test and report the results.Since the last review (on
554b2dcf4b)Still open: L2 (The remaining physical-controller and icon checks listed in the PR need in-game results.)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the reported Windows Xbox-controller setup: Zelda's Lullaby was recognised with the right stick, and the camera stayed still during play and worked again afterward. The other setups in the ledger have not yet been checked in game.
Other systems: The input path also handles SDL controllers and Linux; prompt textures vary by controller face and keyboard. Linux with a physical controller, an SDL controller on Windows, and the keyboard icons remain unverified in game.
Switches: Adds Ocarina controls, defaulting to Switch 2; N64 / GameCube is opt-in. Preserving the existing layout by default is appropriate.
Reviewed:
0cf93e8686against27114559f1: Read the repository instructions, contribution guide and pull request template, the input and prompt diffs and the relevant input code; skimmed the remaining diff and translations. The full changed code files and all referenced developer rules were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run code were executed. The author reports a passing Windows Xbox-controller game run and game-free checks; CI is still running.
Overlaps and merge order: The description identifies #1303 as superseded; no further overlap was checked.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.
@rebase
I rebased this pull request onto
main(6b21da7b48): the new head is670073ad71.Conflicts resolved
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.
0cf93e8686670073ad71Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The Windows Xbox run shows the new layout playing a song and the camera returning to normal afterward. The remaining physical-controller and icon checks are still needed before merge. Recommend approval; not approved on the forge.
Adds an optional N64 / GameCube ocarina layout using A and the right stick, with matching staff icons. The default remains the existing Switch 2 layout; the feature adds prompt assets and input-handling complexity.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
host/nn_hid.c:908: The remaining physical-controller and icon checks listed in the PR need in-game results. When: Linux with a physical controller, Windows with an SDL DualSense or Switch Pro controller, and the keyboard face have not yet been checked in game. Do: Perform the remaining checks described in Still to test and report the results.Since the last review (on
0cf93e8686)Still open: L2 (The remaining physical-controller and icon checks listed in the PR need in-game results.)
Checks: Still running:
PR description / Title and description (pull_request_target).More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports Zelda's Lullaby was recognized with the right stick on Windows with an Xbox controller, and the camera check passed. The remaining setups have not yet been checked in game.
Other systems: The input and prompt paths also affect Linux controllers, Windows SDL controllers and keyboard icons. Their outstanding in-game checks remain in L2.
Switches: Ocarina controls adds Switch 2 as the default and N64 / GameCube as the optional layout. The existing behavior is the appropriate default pending the remaining checks.
Reviewed:
670073ad71against6b21da7b48: Read the rebased settings ABI diff and relevant input, prompt and settings paths; inspected the repository rules and the PR's recorded runs. The remaining changed files and translations were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports Windows in-game and game-free checks; the remaining checks are listed in L2. The PR description check is still running.
Overlaps and merge order: PR #1303 is identified as superseded by this change.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.