Repository navigation
fix(vi): the pick-up counter fades again above a 60 fps cap (#1832) - #2006
Merged
Merged
Conversation
…#1832) Above a Frame rate cap of 60, NotRexed#1612 makes the game's frame step the frame's own time: under 1 (0.42 at 144 fps). The counter that pops up above Link's head after a pickup (rupees, Deku Sticks, seeds, bombs) moves the count it shows toward the new total by (int)(step * max(distance / 50, 1)) and fades when they meet (f_80a87e50). At 0.42 that cut is 0 every frame: the count never moved, and the counter stayed until a door or a talk replaced it. The counter's step now goes through hos_frame_whole (host/frame_whole.h), which carries the fractions per counter while the frames' own time is the step, so the count moves at the game's rate whatever the frame rate. Without that step (a cap of 60) the amount is cut exactly as the game cuts it. f_832b32b0, the one other reader of the frame step that cuts it straight to whole frames ((unsigned)step into a counter), takes the same carry. The build warns when either site is not found. Found with the step forced to 1/144 s on a slower PC (the counter stuck), the frame-time keeper's fields put back to their 60 fps values one at a time (only the step mattered), and logging the step's readers as they first ran (f_80a87e50 started at the pickup). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ame time read atomically Review follow-ups for NotRexed#1832: - f_80a87e50's site was found by the multiply before its cut as well. In a lift where the function is among A64_HOT_FUNCS that multiply is a64_fpx_hot_mul32_fma32, and the patch would have been left out (with a warning). The cut alone is the anchor now: it is the function's only one. - hos_frame_whole reads hos_frame_seconds_bits with __atomic_load_n, as hos_movie_frames does (realtime_step writes it on the present thread). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…b0 left for a separate look) f_832b32b0 cuts the step to whole frames the same way, but it never ran in any of the pickup sessions logged (rupees and Deku Sticks, at 60 and at the forced 144 fps step) and what it drives is not known. It is left for a separate look at the other above-60 truncations (NotRexed#1742), with a site added only once it is seen to misbehave in game. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
DevL0rd
pushed a commit
to DevL0rd/Hookshot
that referenced
this pull request
Nov 12, 2026
f_803edf70 adds (int)(2 * step) game seconds to the time of day each frame. Above a 60 cap the step is the frame's own time: below 120 fps the cut is 1 (the day slow, 83% at 100) and above it 0, so the clock stood still and the sun swung back and forth over the frozen hour. The cut takes hos_frame_whole's whole seconds like the pick-up counter (NotRexed#2006). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jordanella
added a commit
to jordanella/Hookshot
that referenced
this pull request
Nov 12, 2026
f_803edf70 adds (int)(2 * step) game seconds to the time of day each frame. Above a 60 cap the step is the frame's own time: below 120 fps the cut is 1 (the day slow, 83% at 100) and above it 0, so the clock stood still and the sun swung back and forth over the frozen hour. The cut takes hos_frame_whole's whole seconds like the pick-up counter (NotRexed#2006). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (The game intro doesn't run well at more than 60 fps #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