Repository navigation
Conversation
Ocarina of Time renders a 16:9 canvas, so Mac full screen on a MacBook (3024x1898 below the notch, 1.593) showed it with black bars at the top and bottom. The camera's aspect is its DefaultAspect parameter, which the camera's apply, init and reset hand from the camera's +0x140 to the projection's +0xb0 with ldr s0,[x19,#0x140]. A stub at each of the three loads runs the load and then takes the f32 at state +0x2a0 in its place when that word is not 0 (Hor-, as Tears of the Kingdom's Auto). The three functions are more others of the frame step rule, by fingerprint; the stubs go in only when all three match, and the rewriter then declares ASPECT_LIVE. x16 is free at each site (on every path from the load to the next call or return it is written before it is read, or not used). The persistent copies (+0xc8, +0x140) are left alone, so a 0 word gives 16:9 again on the next apply. Profile: aspect_live on. On the host, dm_aspect_live_set (hle_nvn.c) writes the ratio into state +0x2a0 with one atomic 32-bit store and sets a present shape the host owns (mtl_present_stretch): the 16:9 canvas is drawn stretched into that ratio, so it fills a full screen of that shape. present_shape checks it before the screen and layer shapes, so vi::CreateLayer cannot replace it, and 0 leaves the present as it was. The shape reported to the front ends (mouse map) and the presented-frame screenshots follow it. It acts only when the profile has aspect_live (DM_GAME_ASPECT_LIVE), main's fixups table has ASPECT_LIVE (loader.c dm_aspect_stubs) and there is a state page; otherwise a stretch alone would distort the picture. Every other game's present is unchanged. DM_ASPECT: auto (the Mac's default) = in full screen the drawable's own shape, pushed from front_mac.m on entering full screen and on drawable size changes, and 16:9 from the start of leaving it; a window and a screen within 1 % of 16:9 keep 16:9; 0 = 16:9; a ratio (1.6) or w:h (16:10) from the start. Malformed: a [RED] line and 16:9. Launcher row "Aspect ratio" for builds with ASPECT_LIVE (Auto on the Mac only). Until the HUD is squeezed back per draw it is stretched with the picture (about 11 % taller at 1.593). Checked: t_present_crop (a 16:9 texture fills a 16:10 canvas with no black pixel on both encoders, a sized layer does not replace the shape, the shot and the reported shape follow, 0 gives back both canvases byte for byte, the gates and DM_ASPECT's parsing); test_patches (the three stubs by disassembly). Played on an M5 MacBook Pro, macOS 27: native full screen on the built-in screen fills 3024x1898 at 1.593, a 16:9 Studio Display stays 16:9, and entering and leaving full screen switches live. Not checked: the scripted (cutscene) projections, iOS, other Macs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
oxyp1e
added a commit
to oxyp1e/nxnative
that referenced
this pull request
Nov 18, 2026
Native full screen keeps a notched MacBook's picture below the menu bar (3024x1898 on a 14" MacBook Pro), and the strips beside the camera housing stay black. With DM_FULLSCREEN=2, full screen on a screen with a top safe-area inset is instead a borderless window over the screen's whole frame (3024x1964): the custom full screen Apple documents with NSScreen.safeAreaInsets and auxiliaryTopLeftArea, built as SDL3 and GLFW build theirs. DmGameWindow is key and main while borderless, and its constrainFrameRect:toScreen: leaves the frame alone while the panel is up; level NSMainMenuWindowLevel+1, HideDock|HideMenuBar (0xa, so no menu bar on hover). A screen without a notch gets native full screen, exactly as DM_FULLSCREEN=1. The present fits the game's 16:9 picture into the panel as into any drawable, with bars at the sides; a game that takes the screen's shape fills it. DmGameWindow's toggleFullScreen: picks the panel or native full screen, so ⌃⌘F, the green button, the startup request and the GPU-lost path all follow the setting. win_full() replaces the full-screen style checks (screen_match_apply, so the 120 Hz screen match still applies; startup). Screen changes refit the panel, or leave it when its screen has no notch (a Studio Display in clamshell). While another app is active the window drops to its own level and the presentation options are cleared; activation puts both back. While a modal box is up (the software keyboard, the user choice, a Cheats question) the panel takes the window's own level, so the box shows above it; the Cheats panel is raised above the game window. One [notch] line on entering and on leaving. pack_app.py writes NSPrefersDisplaySafeAreaCompatibilityMode false, so macOS never letterboxes the screen below the camera housing instead. Launcher: Display mode gets "Fullscreen around the notch". Docs: env_switches.tsv, settings.md, development.md. Checked: the OoT host builds with no new warnings; test_launcher_settings and test_nsp_mac_app cover the new option and the Info.plist key. Played on an M5 MacBook Pro, macOS 27: a prototype of this window, and Ocarina of Time on a branch with PR seedds#2978's Auto aspect, filled 3024x1964 at about 120 fps, with no menu bar on hover. This branch alone (16:9 with side bars) was not run. Not checked: other Macs, the M1 and M2, Game Mode (off in nxnative apps anyway). Front-ends: new: DM_FULLSCREEN=2 needs NSPrefersDisplaySafeAreaCompatibilityMode false in the app's Info.plist (pack_app.py writes it); an app packed another way needs the key too. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 task done
Author
|
Related: #2979 (Fullscreen around the notch, independent and off |
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
Ocarina of Time renders a 16:9 canvas, so Mac full screen on a MacBook (3024x1898 below the notch, 1.593) shows it with black bars above and below. This adds an Auto aspect, as Tears of the Kingdom has: the game's camera takes the full screen's shape live and the present stretches the 16:9 canvas to it, so the picture fills the screen and circles stay round.
dm/games/0400486024DEC000/patches.py): the camera's aspect is itsDefaultAspectparameter, which the camera's apply, init and reset hand to the projection withldr s0,[x19,#0x140]. A stub at each of the three loads takes the f32 at state+0x2a0instead when that word is not 0 (Hor-). The three functions are found by fingerprint as moreothersof the frame step rule; the stubs go in only when all three match, and the rewriter then declaresASPECT_LIVE. x16 is free at each site. Profile:aspect_live on.dm_aspect_live_set(hle_nvn.c) stores the ratio with one atomic 32-bit store and sets a present shape the host owns (mtl_present_stretch, checked first inpresent_shape, sovi::CreateLayercan't replace it). The mouse map and presented-frame shots follow it. It does nothing unless the profile hasaspect_live, main has the stubs and there is a state page, so every other game's present is unchanged.front_mac.m): in full screen, the drawable's own width / height, pushed on entering full screen and on drawable size changes, and 16:9 from the start of leaving it. A window, and a screen within 1 % of 16:9, keep 16:9.Game note: Auto aspect. Reference entry updated: "A crop only picks texels" in
docs/reference/rendering.md.Settings
DM_ASPECT(launcher: Game › Aspect ratio, shown only for builds whose main hasASPECT_LIVE):auto(the Mac's default): the screen's shape in full screen, 16:9 in a window or on a 16:9 screen. Not offered on iOS, which keeps 16:9.0: always 16:9 (the iOS default).1.6or16:10(any ratio from 1 to 4, orw:h): that shape from the start, in a window too.[RED] [aspect]line, and 16:9.Not done yet
main+0x3b50b44,0x28e72a0,0x293d80c, cutscenes) and the layer's default projection (main+0xea5074) are not patched; the game note lists them.Checked
GAME=0400486024DEC000, Xcode 27.2):make -C dm/gfx/tests check_t_present_crop: 4/4 runs, 197 checks, 0 failed. New checks: a 16:9 texture fills a 16:10 canvas with no black pixel on the classic and Metal 4 presents; a sized layer does not replace the shape; the shot (1920x1200 at 1.6) and the reported shape follow; 0 gives back both canvases byte for byte; the gates;DM_ASPECTparsing on 22 values.test_patches(the three stubs by disassembly, and nothing written when one function is missing),test_docs,test_settings,test_launcher_settings,test_game_profile: OK. The wholedm/tools/tests: 1760 tests, the only failures aretest_shader_toolchain_cache(NameError: dmsh_rewrite, fails the same onmain) and a timing test intest_triage_reportthat passes when run alone.make -C dm/host/tests run(includingsymbolsandnro, which stubdm_aspect_start): OK.make -C dm/host dmhost: links, no new warnings.env_switches.py --check: OK.docs_patches.pyregenerateddocs/agents/game-patches.md.lint_c.py tidy(only LLVM 22 here, CI pins 23);lint_python.py(ruff and pyright not installed).0400486024DEC000v131072, played by me on the Mac:[aspect] auto: 1.593, the picture fills it with no bars;regress.py: not run. Every other game is unaffected by construction: the stretch is set only bydm_aspect_live_set, which returns at once withoutaspect_liveandASPECT_LIVE, andt_present_cropshows presents at 0 are byte-identical to before. No shader chain change (dmsh_chain.hand the lock untouched).Docs
docs/reference/<subsystem>.mdentry, andpython3 dm/tools/docs_symptoms.pywas run (the symptom index)Also:
docs/settings.md(Aspect ratio),docs/env_switches.tsv(DM_ASPECT),docs/agents/game-patches.md(regenerated).🤖 Generated with Claude Code