vi, nx2: the Frame rate menu row: held 30 or 60, or Unlimited with the world stepping by the wall clock #1367
Closed
bibigurl-yum wants to merge 1 commit from
pr/vk-frame-rate-row into main
pull from: pr/vk-frame-rate-row
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
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/Hookshot!1367
Loading…
Reference in a new issue
No description provided.
Delete branch "pr/vk-frame-rate-row"
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?
What
The Frame rate menu row (Gameplay tab), split out from #1330 as requested:
Off / 30 / 60 / Unlimited, withHOS_FPS_LOCK=<fps>|unlimitedwinning for test runs. It holds the present-to-present period, so the acquire that paces the game loop waits a full 1/fps (a steady 30 for an outside frame generator to build on). Option id 10.Default path
Row Off, the game's rate slot is written exactly as upstream writes it: the smoothed loop rate clamped to 15..60. An earlier revision of this PR passed the unclamped measured rate through (a smoothed 61 on a paced-60 loop), which the engine's integer
60/fpsfields floor to 0 — above 60 the written value is now used only when the unlimited step is actually armed. With the step absent (an older lift, orHOS_UNL_STEP=0) the clamp holds no matter what the row says.Unlimited
Unlimited never waits between presents (1 ms floor). Above 60 fps the engine fast-forwards, because every one of its rate fields stores
60/fpswith an integer divide (f_8348c5c0: +0xfc = 60 / w20,f_83b6f370likewise for the vsync controller) — nothing above 60 is expressible and the per-frame step floors at 1/60 s.nx2/oot_patches.py patch_unlimited_stepreplaces the step divide off_80706be0with a host float: the world then advances by the wall time between frames (clamped to [0.2 ms, 20 ms] per frame), which is exact whatever the loop's pacing does (the sum of elapsed times is the elapsed time; a count-based rate broke on the bursty menu loops). The float is written whenever Unlimited (or a rate above 60) is chosen and the step is on — the step is on by default, so the menu row works without any environment variable;HOS_UNL_STEP=0puts it away, and a game version whose lift the patch did not apply keeps the engine's own integer step (the host float is inert without the patch).Tests
tests/test_unlimited_step_patch.py(auto-discovered bytests/run_all.py): the patch applies once, is idempotent, returns None when the lifted file has no such function, and leaves a function whose code differs (another game version) untouched, externs included. The present-trace fixture stubsfps_lock_wanted.Measurements (RTX 4090, 5120x1440, TOTK)
HOS_FPS_LOCK=30holds the loop at a measured 30.0 fps (log:wrote 30, measured 30.0). Unlimited at ~120–135 fps in real gameplay keeps the world clock at 1.00x (log:clock keeps 59.93x wallmedian over 68 windows, unit 1/60 s); 30/60 locks leave the engine's own step untouched, and the world clock is not read there.Notes
Frame lockcomments now sayFrame rate, matching the row.+0xd58read is guarded: it samples the accumulator only after the step's probe recorded the object, and only prints the address otherwise.Depends on nothing from #1330; both touch the menu rows list, so the second of the two to merge needs a trivial rebase.
Split out of #1330 per @hckrman101's review. The default-path clamp (write 15..60 unless the unlimited step is armed), the Unlimited row arming the wall-time step without any environment variable, the
patch_unlimited_steptest registered inrun_all.py(auto-discovered), and the Frame rate comment wording are all in this branch.Superseded by the v2.0.12 branch, which adds its own Frame rate cap row (60 to 240, with the game keeping real time past 60;
HOS_FPS_MAX). Two frame-rate rows would clash, so closing. Thanks for splitting it out of #1330!Correction to the closing note: the Frame rate cap row that replaces this is now on main, in #1485 (60 to 240, the game keeping real time past 60;
HOS_FPS_MAX), not only in a test branch. Two frame-rate rows would clash, so this stays closed. If held 30 or Unlimited is still wanted on top of the cap row, a follow-up PR against main is welcome. Thanks again for splitting it out of #1330.