Repository navigation
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
Conversation
…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>
4 of 5 tasks
…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>
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
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"):
patches.py):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).OUTPUT_SIZEcapability, which is what shows the row.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.[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.settings.tsvchoice may carryoption_needs(<value>:<VAR>>=<n>,...).settings.pychecks that the option exists and that<VAR>is a range row, then writes{value: "VAR>=n"}tolauncher.json.LauncherSettings.swift) lets an option be chosen only while that range is at leastn; 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.Front ends
Front-ends: new:
launcher.jsonchoices may carryoption_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:
main+0x153da8c)main+0xed7128)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=5120x2880with 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 markedneeds 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/teststest_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/teststest_launcher_settings(two new: the row'soption_needson the Mac and its absence on iOS, andoption_needsparsing) andtest_nsp_mac_apppass (83 tests).make -C dm/host/tests GAME=01007EF00011E000 runpasses.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_feedbackandcheck_t_reorder_chain(dm/gfx/tests) pass.dm/tools/testspasses: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_candtest_gfx_tests_makefile.dm/ios/teststest_launcher_storagepasses.lint_python.py --against origin/mainreports one new finding,dm/gfx/tools/dmsh_entry.py:7(F401, an unused import).mainitself reports the same one, and this change does not touch that file.Docs
dm/games/01007EF00011E000/README.md, Output resolution on the Mac),docs/settings.md(Output resolution), the switch indocs/env_switches.tsv, and the new field indocs/frontends.mdanddocs/launcher.schema.json;python3 dm/tools/docs_symptoms.pyanddocs_patches.pywere run🤖 Generated with Claude Code