Skip to content

game: Ocarina of Time holds a fixed resolution level (DM_DRS_LEVEL) - #2940

Open
ismaproco wants to merge 1 commit into
seedds:mainfrom
ismaproco:pr/ocarina-drs-level
Open

ismaproco wants to merge 1 commit into
seedds:mainfrom
ismaproco:pr/ocarina-drs-level

Conversation

@ismaproco

Copy link
Copy Markdown

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.tsv the switch.

Checked

  • Tests: dm.tools.tests test_patches, test_game_profile and test_fps_target pass. The stub was disassembled: the new branch lands on the controller path, and the fixed path reads +0x290 and caps it at count − 1.
  • Games run: Ocarina of Time v131072, with the same stub at an earlier offset (which overlapped the controller's records; fixed here). On an iPhone 16 Pro Max at a 30 fps cap, level 3 throttled once the phone reached thermal state 2 (GPU 30 → 55 ms a frame, 16–18 fps); level 6, from a cool phone, held 30 fps 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.
  • Not checked: a build and run from this exact commit on a device.

Docs

  • The finding is in the game note
  • No game files, keys or data extracted from a game in the change

🤖 Generated with Claude Code

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>
@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) rewriter The NSO rewriter and per-build patches docs Documentation game: 0400486024DEC000 A game labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0400486024DEC000 A game host The Horizon host: SVCs, services, threads, memory (dm/host) rewriter The NSO rewriter and per-build patches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant