Skip to content

Breath of the Wild: an Output resolution choice on the Mac (1440p, 4K, 5K), each offered from the Game memory it needs - #2285

Open
dontpokethebear3893 wants to merge 6 commits into
seedds:mainfrom
dontpokethebear3893:upstream/botw-output-resolution-2
Open

dontpokethebear3893 wants to merge 6 commits into
seedds:mainfrom
dontpokethebear3893:upstream/botw-output-resolution-2

Conversation

@dontpokethebear3893

Copy link
Copy Markdown

What and why

Stacked on #2284 (the Game memory slider): this branch's first commit is that PR's, and the three after it are this change. It is meant to go in after #2284.

Breath of the Wild draws at the Switch's 1080p when docked. On a large Mac display, the picture is then scaled up. This adds an Output resolution choice to the Mac launcher (Game section, docked). Its first option and default, 1600x900 (standard), is the game's own picture: its 900p scene scaled to 1080p, as on a docked Switch. Then 1080p, 1440p, 4K or 5K, at which the game draws natively: the 3D picture, the HUD and the render targets.

A larger picture needs more memory than the game's own 3.2 GB. So each size can be chosen only once Game memory (the slider in #2284, which this builds on) is high enough. Every size is listed; until then it is greyed out and says what it needs ("4K — needs 8 GB of Game memory"):

Game memory Selectable (the rest greyed out)
Default (3.2 GB) 1600x900, 1080p
4–6 GB 1600x900, 1080p, 1440p
8–12 GB 1600x900, 1080p, 1440p, 4K, 5K
  • The game (patches.py):
    • Stubs take the output width from the state page (+0x30c); the heights already come from +0x48.
    • The two render-target pools at main+0x12616d4 (115 MB and 60 MB) are multiplied by +0x308 (0 keeps the game's own size). At a larger output, the 115 MB pool ran out and the next target came back null (main+0xed7128).
    • The build declares the OUTPUT_SIZE capability, which is what shows the row.
  • The host (loader.c):
    • DM_OUTPUT_SIZE=<w>x<h> (16:9, multiples of 8, up to 7680 wide) writes the output size, a pool multiplier of 1.6 times the area over 1080p, and the 3D views at the output's size.
    • When the game memory is less than the size needs (4 GB up to 1440p, 8 GB up to 5K, 12 GB above), the host logs a [RED] line and keeps the game's own picture. That covers a saved choice with the launcher skipped, an env file, or a front end that doesn't know the new field.
  • The launcher:
    • A settings.tsv choice may carry option_needs (<value>:<VAR>>=<n>,...). settings.py checks that the option exists and that <VAR> is a range row, then writes {value: "VAR>=n"} to launcher.json.
    • The shared Swift model (LauncherSettings.swift) lets an option be chosen only while that range is at least n; the shared row (LauncherRow.swift) lists it greyed out with what it needs until then (a menu of buttons, as a menu picker cannot disable one entry). A saved choice is checked once every saved choice is read, so a saved 5K with 10 GB saved is kept at start. When the range is lowered below what the chosen option needs, the choice goes back to its default, 1600x900.
    • Render scale's pixel sizes now follow the chosen output size.

Front ends

Front-ends: new: launcher.json choices may carry option_needs (optional, schema 1; docs/frontends.md, docs/launcher.schema.json). A front end that does not know it offers every option, and the host's check keeps the game's own picture when the memory is too low.

Checked

  • Memory each size needs: Breath of the Wild 1.9.0 (01007EF00011E000), in a window, from a save outdoors on the Great Plateau, one run each:

    Output Game memory Result
    2560x1440 Default (3.2 GB) crashed at load (main+0x153da8c)
    2560x1440 4 GB ran to frame 15,300 at 60 fps, no GPU errors
    5120x2880 4 GB crashed at load: a null render target (main+0xed7128)
    5120x2880 6 GB ran standing still; with Link running laps, a failed command buffer at about frame 10,200 and a GPU lockup report
    5120x2880 8 GB Link running laps: ran to frame 15,300, no GPU errors

    4K (3840x2160) was not run. It is offered from 8 GB like 5K, rather than risk the failure seen at 6 GB.

  • GPU time (opening scene, GPU p50): 1440p 6.3 ms at 60 fps and 5.3 ms holding 120; 5K 8.4–9.4 ms at 60, and mostly 60 when asked for 120.

  • The host's fallback: DM_OUTPUT_SIZE=5120x2880 with 4 GB logged [RED] DM_OUTPUT_SIZE=5120x2880 needs 8 GB … keeping 1920x1080 (the line now names the game's own picture), and the render pools were the game's own sizes. That run later hit a GPU lockup at 1080p, after three lockups earlier the same day without a restart (16 GB, 5K at 6 GB); it was not run again after the restart.

  • The launcher's options: the shared Swift model, compiled against the app's launcher.json, stepped through Game memory Default → 4 → 6 → 8. At each step every size was listed and the ones not covered were marked needs 4 GB of Game memory / needs 8 GB of Game memory; 1600x900 is the default and 1080p selectable at any memory; lowering memory below the chosen size set it back to 1600x900. dm/ios/tests test_launcher_storage (which compiles the shared row and the Mac window) gains checks of the labels and of a saved 5K with 10 GB being kept at start; that check fails without the fix. The menu itself was type-checked for macOS and iOS, not looked at on screen.

  • Tests:

    • dm/tools/tests test_launcher_settings (two new: the row's option_needs on the Mac and its absence on iOS, and option_needs parsing) and test_nsp_mac_app pass (83 tests).
    • make -C dm/host/tests GAME=01007EF00011E000 run passes.
  • Known log line: MemoryPoolInitialize: non-virtual pool has no storage, of the swapchain's size, appears at sizes above 1080p and has shown no effect.

  • Devices and OS: Apple M5 Max (48 GB), macOS 27.2.1.

  • Not checked: native 1080p in the game at the game's own memory (its render pools are doubled, x2), 4K in the game, 1440p with Link running (the 4 GB run had him stuck climbing a ruin), fullscreen at the larger sizes, handheld mode, Macs with less memory, and other games.

  • After the rebase on main (6a6a018):

    • make -C dm/host/tests GAME=01007EF00011E000 run, check_t_feedback and check_t_reorder_chain (dm/gfx/tests) pass.
    • dm/tools/tests passes: test_docs, test_patches, test_game_profile, test_env_switches, test_launcher_settings, test_settings, test_nsp_mac_app, test_fps_target, test_player_env, test_lint_c and test_gfx_tests_makefile. dm/ios/tests test_launcher_storage passes.
    • lint_python.py --against origin/main reports one new finding, dm/gfx/tools/dmsh_entry.py:7 (F401, an unused import). main itself reports the same one, and this change does not touch that file.
    • The measurements and game runs above were made before the rebase and were not repeated on it.

Docs

  • The finding is in its game note (dm/games/01007EF00011E000/README.md, Output resolution on the Mac), docs/settings.md (Output resolution), the switch in docs/env_switches.tsv, and the new field in docs/frontends.md and docs/launcher.schema.json; python3 dm/tools/docs_symptoms.py and docs_patches.py were run
  • A chain tool changed: n/a
  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

tedkoniszewski and others added 4 commits November 10, 2026 23:40
…fault then 4 to 12 GB)

The game's nninitStartup asks for a fixed 3.05 GB heap whatever the application pool. Two stubs (patches.py, main+0x71c and main+0xc617c0) take the heap and the root arena from the state page (+0x310 / +0x318) and declare the GAME_HEAP capability, which offers the Mac launcher's Game memory slider. The host reads DM_MEMORY_GB when the game starts (hle_svc.c mem_sizes): an application pool of that many GB in place of the profile's app_pool when larger, the reservation grown by as much; loader.c writes the heap (the pool less 512 MB) only when the player raised it. At Default, on iOS and for other games nothing changes. No build option or profile key.

The slider stops at 12 GB: at 16 GB on an M5 Max the GPU locked up twice within 80 s and WindowServer, waiting on it, was restarted by the watchdog; 12 GB ran without errors (one windowed run from a save outdoors, 11.5 GB heap).

Front-ends: new: launcher.json ranges may carry unit (shown after the number instead of a percentage) and first (the label of the lowest value); settings.tsv conditions may join conditions with &

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…_SIZE, 1440p, 4K or 5K docked), each size offered from the Game memory it needs

patches.py widens the output (state +0x30c, the heights already at +0x48) and multiplies the two render-target pools at main+0x12616d4 by state +0x308; the build declares OUTPUT_SIZE. loader.c writes them from DM_OUTPUT_SIZE (16:9, multiples of 8, up to 7680 wide) with the 3D views at the output's size, and keeps 1920x1080 with a [RED] line when the game memory (DM_MEMORY_GB) is less than the size needs: 4 GB up to 1440p, 8 GB up to 5K, 12 GB above.

Measured on an M5 Max from a save outdoors, in a window: 1440p crashed at load with the game's own 3.2 GB (main+0x153da8c) and ran at 4 GB; 5K crashed at 4 GB (a null render target, main+0xed7128), failed on the GPU at 6 GB with Link running, and ran clean at 8 GB. 4K is not run and is held to 5K's 8 GB.

The launcher: settings.tsv choices may carry option_needs (<value>:<VAR>>=<n>,...); settings.py checks the option and the range row and writes {value: "VAR>=n"} to launcher.json. The shared Swift model offers an option only while that range is at least n, and sets a choice back to its default when the range is lowered below what it needs; Render scale's pixel sizes follow the output size.

Front-ends: new: launcher.json choices may carry option_needs (optional, schema 1; docs/frontends.md, docs/launcher.schema.json). A front end that does not know it offers every option and the host's check keeps 1080p

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and default is off (the 900p scene scaled to 1080p, as on a docked Switch), then 1080p, 1440p, 4K and 5K

The Mac offered native 1080p as its lowest size and default, so the game's own picture was not offered there. The launcher's reset when Game memory is lowered below a size now goes to that picture, as the loader's fallback does, and the loader's [RED] lines name it instead of 1920x1080. test_launcher_settings checks the options' order and the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…han is set is greyed out with what it needs ("4K — needs 8 GB of Game memory"), and a saved size is kept at start

The launcher hid an option whose option_needs did not hold. A row with option_needs is now a menu of buttons (a menu picker cannot disable one entry) listing every option, the ones that cannot be chosen yet disabled and labelled from the range's label and unit (LauncherModel.needLabel). Other choices keep their picker.

A saved 5K with 10 GB saved came up as 1600x900 on every start: the values observer settled each choice as it was read, and Output resolution is read before Game memory. The model now settles once every saved choice is read. launcher_storage_check checks both, with the output row first.

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) nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) rewriter The NSO rewriter and per-build patches ios The iPhone and iPad app (dm/ios) tools Tools and scripts (dm/tools, scripts) docs Documentation game: 01007EF00011E000 The Legend of Zelda: Breath of the Wild labels Nov 11, 2026
tedkoniszewski and others added 2 commits November 12, 2026 15:31
…tion-2

# Conflicts:
#	dm/host/loader.c
#	docs/env_switches.tsv
Brings the branch up to date with main (fixes for the t_save_sync cloud
device check and the clang-tidy fixture findings, among others) and
resolves the conflicts with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 01007EF00011E000 The Legend of Zelda: Breath of the Wild host The Horizon host: SVCs, services, threads, memory (dm/host) ios The iPhone and iPad app (dm/ios) nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) rewriter The NSO rewriter and per-build patches tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant