fix(vi): the pick-up counter fades again above a 60 fps cap (#1832) #2006
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2006
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pickup-indicator"
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?
Fixes #1832 (one of the above-60 side effects tracked in #1742).
Cause
Above a Frame rate cap of 60, #1612 makes the game's frame step the frame's own time, so at 144 fps each frame steps about 0.42 of a 60th.
The counter that pops up above Link's head after a pickup (rupees, Deku Sticks and the other stacking items) is updated by
f_80a87e50:+864) toward the new total (+860) by(int)(step * max(distance / 50, 1)).At a step of 0.42 that cut is 0 every frame. The shown count never moves, so the counter stays up until a door or a talk replaces it. At 60 fps the step is 1 and the count moves normally.
Fix
nx2/oot_patches.pyroutes that one cut throughhos_frame_whole(host/frame_whole.h, called fromhost/nn_vi.c).f_832b32b0((unsigned)stepadded to a counter), has the same flaw. It never ran in any of the logged pickup sessions, though, and what it drives is unknown, so it's left out of this PR. A separate look at the other above-60 truncations (#1742) will add sites only once they're seen to misbehave in game. Two others (f_83423a90,f_8337b110) are correct with fractional steps.A64_HOT_FUNCS).hos_movie_framesand follows the same carry-the-fraction approach.How it was found
f_80a87e50starting at the pickup.Tests
tests/test_frame_whole.pycovers two things:test_frame_rate_cap_step,test_text_speedandtest_free_view_anchorstill pass.🤖 Generated with Claude Code
Read the patch, the helper and the test; looks good to me. The fix is narrow: one cut in f_80a87e50 goes through hos_frame_whole, the helper only carries fractions while hos_frame_seconds_bits is non-zero (so a cap of 60 is cut exactly as before), the lock makes sense for the game's update threads, and the patch only matches when the function and the one cut are found, with a build warning otherwise. The hot-code case is covered in the test, and the description says plainly what was left out (f_832b32b0) and what wasn't tried in game.
CI: the only red check is the Windows
test_log_batch.py(GetTickCount64() - t0 < 200, a timing check), which this PR doesn't touch; main's own source-regression runs are failing too. Everything else, including the Windows Vulkan build, is green.Nit, no change needed: the per-counter remainder survives the fade, so a leftover fraction (under 1) is added to the next pickup's first frame. Harmless, just noting it.
github-sync referenced this pull request2026-11-12 06:22:54 +00:00