Repository navigation
Conversation
With dynamic resolution off, the level-function stub returned level 0, full resolution, so a device short of GPU time or running hot had no way to render the 3D smaller. It now returns the level in state +0x290 (DM_DRS_LEVEL=<n>, 0 to 15, capped at the game's last level; 0, the default, keeps full resolution). +0x290 is the first word past the controller's per-level records (+0x210..+0x28f), so the fixed level never overlaps what the controller keeps when it is on. The loader writes it with the other frame-step state; builds without the stub ignore it. Measured with the same stub at the earlier offset: on an iPhone 16 Pro Max at a 30 fps cap, level 3 throttled once the phone reached thermal state 2 (GPU time 30 -> 55 ms a frame, 16-18 fps); level 6, from a cool phone, held 30 fps for a whole session at thermal state 0-1, about 30 ms of GPU a frame. On a MacBook Air M5 (tier 2) level 6 renders the main 3D at 640x360 instead of 960x540; level 3 saved about 5% of GPU time there, as a third of the frame is compute that does not follow the resolution. The note's Dynamic resolution section has the figures. Checked: the stub disassembles as intended (the new branch lands on the controller path, the fixed path reads +0x290 and caps it at count - 1); dm/tools/tests test_patches, test_game_profile and test_fps_target pass. Not checked: a build and run from this exact commit on a device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What and why
With dynamic resolution off, Ocarina of Time's level-function stub always returned level 0 (full resolution), so a device short of GPU time or running hot had no way to render the 3D smaller.
DM_DRS_LEVEL=<n>(0 to 15, capped at the game's last level; 0, the default, keeps full resolution) now holds the game at level n. The loader writes it to state +0x290, the first word past the controller's per-level records (+0x210..+0x28f), so it never overlaps what the controller keeps when it is on. Builds without the stub ignore it.The game note (Dynamic resolution) gets the measurements, and
docs/env_switches.tsvthe switch.Checked
dm.tools.teststest_patches,test_game_profileandtest_fps_targetpass. The stub was disassembled: the new branch lands on the controller path, and the fixed path reads +0x290 and caps it at count − 1.Docs
🤖 Generated with Claude Code