Skip to content

Donkey Kong Bananza: the frame-rate controller keeps 60 fps in busy scenes, Metal encoding on its own thread - #1765

Open
moretti wants to merge 1 commit into
seedds:mainfrom
moretti:bananza-60fps
Open

moretti wants to merge 1 commit into
seedds:mainfrom
moretti:bananza-60fps

Conversation

@moretti

@moretti moretti commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Donkey Kong Bananza (040074A01BF12000, v458752) fell to 30 fps for seconds in busy scenes on the Mac, such as the second world's dialog close-ups (18,000-24,000 draws), although the Mac shows those frames at 50-60 fps.

The game's fixed-refresh frame-rate controller (main+0x204a18) measures each frame from its start to the later of its submission and its GPU end. On the Mac, the host's translation (about 15 ms) and the GPU (about 12 ms) come one after the other in that measure. That makes about 27 ms, over the controller's 20 ms limit, so after two late frames it moved to present interval 2.

 frame-rate controller (main+0x204a18)
   cost = max(submit, gpu end) - frame start
-  candidate = cost over budget ? interval + 1 : interval       (clamped 1..3)
+  candidate = settings' minimum (1)                             (main+0x204abc: csinc w9,w11,w9,ge -> mov w9,w8)
   up after 2 late frames, down after 6 under
  • patches.py: the cut above. A late frame is shown when it is ready, instead of being held to 30 fps. The fixed-interval path (cutscenes at interval 3) is not touched.
  • game.tsv: enc_thread on. Translation on the submit thread in the close-ups goes from 15.6 to 12.6 ms.
  • The game's note and docs/agents/game-patches.md (regenerated) describe both.

This is complementary to #1389. That PR runs the game's own VRR controller on screens of 120 Hz and more. This cut covers the fixed-refresh controller, which every other screen uses, and #1389's controller when it drops below 40 fps.

Evidence

The host profiler (#1041), Mac M5 Pro, fullscreen, the same close-ups:

  • Before: present interval 2 for seconds at a time, 30 fps.
  • After: a 129 s session averaged 57.9 fps through the close-ups. That is 55-57 fps at about 23,000 draws, and 60 fps up to about 19,000.
  • dm/tools/patch_nso.py on v458752's main changes exactly 4 bytes, at 0x204abc.
  • test_docs.py and test_launcher_settings.py pass.

Open, in the game's note:

  • whether the game's time keeps real time when frames run late;
  • the last 1-2 ms of translation in the heaviest views.

Merge Danger

Door: two-way

The cut is gated to v458752's build ID, so other builds keep the game's controller unchanged.

Blast Radius: one-game

It affects Donkey Kong Bananza v458752 only, on the Mac and on iOS (the encode thread is already on for every game on iOS).

…coding on its own thread

The game's frame-rate controller (main+0x204a18) measures each frame from its start to the later of its
submission and GPU end, and raises the present interval to 2 (30 fps) after two frames over 20 ms. On the
Mac the host's translation and the GPU come one after the other in that measure (about 27 ms in the second
world's dialog close-ups, 18,000-24,000 draws), so busy scenes fell to 30 fps for seconds although the Mac
shows those frames at 50-60.

- patches.py (v458752 main): the controller's candidate interval is the settings' minimum (main+0x204abc,
  csinc w9,w11,w9,ge -> mov w9,w8), so it only steps back down to 1; a late frame is shown when it is ready.
  The fixed-interval path (cutscenes) is not touched.
- game.tsv: enc_thread on. Translation on the submit thread in the close-ups 15.6 -> 12.6 ms.

A 129 s session through those close-ups: 57.9 fps on average there (55-57 at about 23,000 draws, 60 up to
about 19,000), against 30 before. Open, in the game's note: whether the game's time keeps real time when
frames run late, and the last 1-2 ms of translation in the heaviest views.
@github-actions github-actions Bot added rewriter The NSO rewriter and per-build patches docs Documentation game: 040074A01BF12000 Donkey Kong Bananza labels Nov 8, 2026
zkkzkk added a commit to zkkzkk/nx-pocket that referenced this pull request Nov 9, 2026
…cenes (upstream PR #1765)

From seedds/nxnative#1765 by moretti, not merged upstream yet: a 4-byte cut
in v458752's main (0x204abc) makes the controller's candidate interval its
minimum, so a late frame shows when ready (45-58 fps) instead of the game
holding 30 fps; enc_thread on. On the iPhone Duo the GPU took 22-26 ms a
gameplay frame and the game sat at 30.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 040074A01BF12000 Donkey Kong Bananza rewriter The NSO rewriter and per-build patches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant