WIP: feat(input): an Ocarina controls row, N64 / GameCube: A and the right stick play the notes #1303
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1303
Loading…
Reference in a new issue
No description provided.
Delete branch "kingo/Longshot:feat/ocarina-right-stick"
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 5060 Ti 8 GB · Needs: Linux, any pad
Why
Players who grew up on the N64 or GameCube version play the ocarina with A and the C buttons (the C-stick on GameCube). On a PC pad that is A and the right stick, but in Longshot the notes are only on L, R, A, Y and X, and the five note rows (#1930) can take buttons, not the stick's directions. So songs that are muscle memory (Song of Time: right, A, down, right, A, down) don't work. Nothing on the tracker asks for it or does it (searched: ocarina, right stick, C buttons, C-stick).
What changed
A new row in Controls, Ocarina controls: Switch 2 (as now, the default) or N64 / GameCube. With N64 / GameCube, A plays the low D and the right stick plays the other four notes the way the C buttons did. While the ocarina waits for a note the stick plays notes and doesn't turn the camera; once the ocarina is put away it turns the camera again. Only that layout plays: L, R, Y and X play no note, song lessons included (learning Serenade of Water took a stray L, R, Y or X as a note). The staff's note icons show it: the low D the icon of the pad's A button, the other four arrows (down, right, left, up), as the N64 showed its C buttons.
The remake's notes rise L, R, A, Y, X (low D, F, A, B, high D). Checked against the game's own song sheets: Saria's Song is R A Y, Song of Time is A L R, Zelda's Lullaby is Y X A. So the mapping is:
pads_readinhost/nn_hid.cturns the right stick pushed past half way, by its main axis, into four inputs of their own (HOS_PAD_RS_*, bits pastHOS_PAD_Nlike the touchpad's, so the Controls page binds none of them); the Invert camera rows are undone for them, so up is up. While the note wait is on and the row is N64 / GameCube, the stick is zeroed for the camera.oc_notesadds the stick's ways to the note rows R, A, Y, X;oc_pad_wordmakes the A button the low D (the L note) and leaves the A note to the stick. The song lesson (kind 2) keeps the game's own buttons, as the note rows already do. Note rows the player bound keep working on top.oc_pad_wordwith the row on N64 / GameCube gives the game only that layout's notes in every wait, the lesson's too: the Switch 2 note buttons (L, R, A, Y, X) are taken out of the word, the A button put in as the low D, the stick's and the bound note rows' notes added.nx2/prompt_assets.pydraws the notes as that row plays them (TEX_N64_NOTE:OcarinaButtonL_00as each pad input's icon for the A button,OcarinaButtonR/A/Y/X_00as arrows on a disc, see-through white as the game's own) and marks each face's Switch 2 notes (TEX_SWITCH_NOTE) intextures.bin's u16 per entry (0 before);host/prompts.ctexture_runspicks them by the row, andcurrent_bindsfollows the row (BIND_OCARINA) so the notes change while the game runs. The "Play a note" hint line keeps its icons (the font's, not these textures).gpu/vk/vk_menu.cpp(opts.ocarina_stick, after Invert camera Y), read by the host asHOS_OPT_OCARINA_STICK(72; 62 to 71, 80, 88 and 90 are taken). README's option table has its line.Measurements
Verdict: nothing to measure: an input option, off by default; the stick is read every frame already.
Flags and settings
One new menu row.
ocarina_controls=in longshot_options.ini)Testing
Tested: Windows 11 Pro 26200, RTX 5060 Ti 8 GB, a pad through SDL. In the game: with N64 / GameCube, Song of Time, Zelda's Lullaby and Saria's Song played from A and the right stick; the camera stayed still while playing and turned again after the ocarina was put away; Switch 2 plays as before. Then with the later commits: L, R, Y and X played nothing, a song lesson took the N64 layout; the staff showed A and the arrows (Epona's Song above), and switching the row back to Switch 2 brought the Switch icons back at once.
python -I -B tests/run_all.pybefore the later commits: 578 passed, 52 failed, 90 skipped; the same 52 fail on main (54ef5ca3) on this PC (Windows tool paths and harness issues, e.g. test_pads_after_menu, test_crt_options), none new. After them, rebased on main @544229a2, the checks they touch pass (listed below); the full suite runs again before this leaves WIP.tests/test_ocarina_notes.pygets a case for the row (fails on main: no row; passes here), with the Switch 2 buttons playing nothing in a lesson too;tests/test_ocarina_note_icons.py(new) compilestexture_runsagainst atextures.binwritten bywrite_textures(Switch 2 picks the Switch notes, N64 / GameCube the A button's low D and the arrows) and checks each arrow points its way;test_prompt_font_bind.pygetsrx_optionandBIND_OCARINA, which it cuts withcurrent_binds;test_input_background.pyandtest_pads_after_menu.pyget the new constants they cut with the code.Not tested: Linux (
test_pads_after_menu.pybuildspads_readonly there); the keyboard (the row is for pads; bound note keys are unchanged); a pad through XInput only.Must be tested:
Risks
What could break: the right stick during the ocarina with the row on N64 / GameCube (the camera is held, by design). With Switch 2 nothing changes: the stick's new inputs are read but only the note layer looks at them, and only with the row on.
Turning it off: the row's Switch 2, or revert the commit.
Compatibility: one new line in longshot_options.ini; nothing else changes.
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
647d15cae32a1d5cb64cBrought 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).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.