Repository navigation
Animal Crossing: New Horizons in a taller screen's own shape (DM_SCREEN_ASPECT; builds on #969) - #1091
Animal Crossing: New Horizons in a taller screen's own shape (DM_SCREEN_ASPECT; builds on #969)#1091zxcheergo wants to merge 4 commits into
Conversation
…EN_ASPECT) On a screen taller than 16:9, such as the iPhone Duo's 1.43:1, the game is shown as a 16:9 picture: stretched, or with bars. With DM_SCREEN_ASPECT=1.43 (launcher setting "Picture shape", offered for profiles with screen_aspect on) the host gives the game a 1920x1344 output and a 1280x896 layout space, and stubs in this profile make the game follow it: - sead::PerspectiveProjection takes the vertical angle that keeps 16:9's sides in view and stores it, so shadow cascades and culling see the view as drawn (widening only sin/cos/tan left the ground black in patches); the camera's fovy getters follow, the HUD camera takes the screen's ratio. - In Pane::Calculate (duo_anchor.c, compiled into the profile) widgets at the 720 space's edges, and a list of edge-anchored widgets generated from the layout files (dialog box, subtitles, names, logos), move out with the taller edges; full-screen backgrounds stretch, page frames grow once, side masks scale about the centre so the scope's circle stays round, the title art scales without stretching, and the map's scrolling cut-outs are left alone. - Full-screen captures and their copied rect follow the layout height, projected background textures map the whole height, the map's footprint trail keeps its 720-pane projection, and the camera rune's photo takes the screen's middle 16:9 band instead of the whole screen squeezed into its 854x480 picture. Checked on an M1 Mac (macOS 27.0.1) against the same routes at 16:9: the map and footprint mode at four zooms (trail offsets 0), inventory, system, options, album, compendium, weapon wheels, scope, camera rune and its shutter, a memory cutscene, the Adventure Log, sensor settings, fast travel, loading screens and a shrine. A photo taken at 1.43 now matches the 16:9 photo at scale 1.0 (it needed a 1.24 stretch). NPC dialogs and shops were checked against the layout rules only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dialog's backing Two things seen on an iPhone Duo at DM_SCREEN_ASPECT=1.43: - The title screen showed a bright band left of the menu. The menu's backing is two 480x720 halves side by side (FBLayout_00/01 from -320 to 160, FBLayout_02/03 from 160 to the right edge); the half against the side was taken for a side mask and scaled about the centre, which moved its inner edge out to 199. duo_anchor.c now stretches those panes like a middle panel, so the halves still meet. - An NPC's dialog box was dark across its bottom from the 720 space's edge down. Its blurred backing is a copy of the screen behind the box made by the second capture class (main+0xf66xxx, the same code as the first one at main+0xf5a0dc / main+0xf5a4b8), which still read the layout file's 720: its copied rect stood 88 units below the moved box, and its lower quarter read past the screen's bottom edge, black through the clamp-to-border sampler. The texture size (main+0xf66118) and the copied rect (main+0xf66334) now take the screen's layout height, as the first class does. Checked on this base on an M1 Mac, the game built with the NSP script (--allow-other-metal: this Mac's Xcode 27.1 Metal compiler), headless, with a save by an NPC in Kakariko Village: the title, the field, the dialog (the backing's copy centred on the box, v 0.8605 against 0.9587 before; the box as dark below the 720 edge as above it), the inventory and the map at 1.43, and the same route at 16:9 unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…EN_ASPECT) On a screen taller than 16:9, such as the iPhone Duo's 1.43:1, the game is shown as a 16:9 picture with bars or stretched. With DM_SCREEN_ASPECT=1.43 (the host side of Breath of the Wild's screen shape: a 1920x1344 output, a 1280x896 layout space) the stubs of this profile's new patches.py (3.0.3 main) make the game render that shape, one bit of DM_SCREEN_ASPECT_SITES each: - Sizes: the platform config's display and layout sizes (the graphics create arg, its static display size and 1280x720, another arg's 1920x1080), the per-frame resolution table entry (without it the 1920x1344 window was cropped back to its top 1920x1080) and the layouts' DrawInfo framebuffer size take the screen's height. - The view: the island camera's vertical angle (+0x2cc, read twice) and the other camera path's half angle are widened to 2 atan(tan(fovy/2) k), k = (16/9) / ratio, so 16:9's sides stay in view with more above and below (the aspect already follows the viewport, so the picture had lost a fifth of each side). - Layouts: nn::ui2d::DrawInfo::SetProjectionMtx's 16:9 perspective projection has its y row divided by the vertical stretch, so layouts keep their shape, centred (only a 16:9 one: the game copies a DrawInfo's projection into another, and the title came out divided twice). duo_anchor.c, run after Pane::Calculate's global matrix, stretches full-screen and full-height background leaves and moves the edge widgets out with the taller edges; the game's panes have no RTTI, so what draws is told by the vtable's DrawSelf. Checked on an M1 Mac (macOS 27.0.1), the game built on this base with the NSP script (--allow-other-metal), headless with an island save, at 1.43 against the same route at 16:9: the title (logo, version, press-A and settings lines at the new edges), the island (16:9's sides with more above and below; the ZL icon, clock and minimap at the new edges), the pocket and the NookPhone in their own shape. No [RED] line. The host tests pass with this profile; the words of duo_anchor.c rebuild to DUO_ANCHOR exactly. Open: an NPC's dialog box stays at its 16:9 place, and the phone's blurred backdrop has a hard edge at its top left. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # docs/agents/game-patches.md
…EN_ASPECT) (#1091) On a screen taller than 16:9, such as the iPhone Duo's 1.43:1, the game is shown as a 16:9 picture with bars or stretched. With DM_SCREEN_ASPECT=1.43 (the host side of Breath of the Wild's screen shape: a 1920x1344 output, a 1280x896 layout space) the stubs of this profile's new patches.py (3.0.3 main) make the game render that shape, one bit of DM_SCREEN_ASPECT_SITES each: - Sizes: the platform config's display and layout sizes (the graphics create arg, its static display size and 1280x720, another arg's 1920x1080), the per-frame resolution table entry (without it the 1920x1344 window was cropped back to its top 1920x1080) and the layouts' DrawInfo framebuffer size take the screen's height. - The view: the island camera's vertical angle (+0x2cc, read twice) and the other camera path's half angle are widened to 2 atan(tan(fovy/2) k), k = (16/9) / ratio, so 16:9's sides stay in view with more above and below (the aspect already follows the viewport, so the picture had lost a fifth of each side). - Layouts: nn::ui2d::DrawInfo::SetProjectionMtx's 16:9 perspective projection has its y row divided by the vertical stretch, so layouts keep their shape, centred (only a 16:9 one: the game copies a DrawInfo's projection into another, and the title came out divided twice). duo_anchor.c, run after Pane::Calculate's global matrix, stretches full-screen and full-height background leaves and moves the edge widgets out with the taller edges; the game's panes have no RTTI, so what draws is told by the vtable's DrawSelf. Checked on an M1 Mac (macOS 27.0.1), the game built on this base with the NSP script (--allow-other-metal), headless with an island save, at 1.43 against the same route at 16:9: the title (logo, version, press-A and settings lines at the new edges), the island (16:9's sides with more above and below; the ZL icon, clock and minimap at the new edges), the pocket and the NookPhone in their own shape. No [RED] line. The host tests pass with this profile; the words of duo_anchor.c rebuild to DUO_ANCHOR exactly. Open: an NPC's dialog box stays at its 16:9 place, and the phone's blurred backdrop has a hard edge at its top left. Co-Authored-By: Claude Opus 5.5 <[email protected]>
….43:1 picture under DM_SCREEN_ASPECT fills a 1.43:1 screen instead of being fitted into a 16:9 view (from #1091) The iOS front end sized the game's view to the largest 16:9 rectangle (DmLayout.h dm_aspect_fit / dm_aspect_fill) and the present then fitted the 1920x1344 frame of Breath of the Wild's or Animal Crossing's screen shape into that 16:9 drawable, so in Fit an iPhone Duo showed it smaller than the 16:9 picture, with bars on all four sides; the Mac mapped the mouse on a 16:9 rectangle of the window too. The present reports the shape of the frame it draws (nvn_mtl.m present_now, the valid rectangle of the presented texture, when its width / height changes) through front_picture_shape (front.h). DmLayout.h takes the shape as a parameter; front_ios.m lays the view out in it (overlay, split, Fill, the TV) and front_mac.m maps the mouse on it. A 16:9 game reports 16:9 and keeps its layout. Checked: the Duo harness on an iPhone 18 Pro simulator, 36 tests (1 skipped), two new (a taller picture in Fit, Fill and on a wider screen; the production root following a reported shape and back); the host build and host tests (Animal Crossing's profile), t_present_crop and t_present_rescue, the docs and settings tests, lint-c (no new findings). Not run on a device or in a windowed game.
|
Landed on main, with #969 under it, as these commits. Your three commits keep you as their author:
The last commit is a fix on top. On the current main, the iOS game view was always the largest 16:9 rectangle ( Left open, for a follow-up:
Thanks for the work! |
…EN_ASPECT) (seedds#1091) On a screen taller than 16:9, such as the iPhone Duo's 1.43:1, the game is shown as a 16:9 picture with bars or stretched. With DM_SCREEN_ASPECT=1.43 (the host side of Breath of the Wild's screen shape: a 1920x1344 output, a 1280x896 layout space) the stubs of this profile's new patches.py (3.0.3 main) make the game render that shape, one bit of DM_SCREEN_ASPECT_SITES each: - Sizes: the platform config's display and layout sizes (the graphics create arg, its static display size and 1280x720, another arg's 1920x1080), the per-frame resolution table entry (without it the 1920x1344 window was cropped back to its top 1920x1080) and the layouts' DrawInfo framebuffer size take the screen's height. - The view: the island camera's vertical angle (+0x2cc, read twice) and the other camera path's half angle are widened to 2 atan(tan(fovy/2) k), k = (16/9) / ratio, so 16:9's sides stay in view with more above and below (the aspect already follows the viewport, so the picture had lost a fifth of each side). - Layouts: nn::ui2d::DrawInfo::SetProjectionMtx's 16:9 perspective projection has its y row divided by the vertical stretch, so layouts keep their shape, centred (only a 16:9 one: the game copies a DrawInfo's projection into another, and the title came out divided twice). duo_anchor.c, run after Pane::Calculate's global matrix, stretches full-screen and full-height background leaves and moves the edge widgets out with the taller edges; the game's panes have no RTTI, so what draws is told by the vtable's DrawSelf. Checked on an M1 Mac (macOS 27.0.1), the game built on this base with the NSP script (--allow-other-metal), headless with an island save, at 1.43 against the same route at 16:9: the title (logo, version, press-A and settings lines at the new edges), the island (16:9's sides with more above and below; the ZL icon, clock and minimap at the new edges), the pocket and the NookPhone in their own shape. No [RED] line. The host tests pass with this profile; the words of duo_anchor.c rebuild to DUO_ANCHOR exactly. Open: an NPC's dialog box stays at its 16:9 place, and the phone's blurred backdrop has a hard edge at its top left. Co-Authored-By: Claude Opus 5.5 <[email protected]>
….43:1 picture under DM_SCREEN_ASPECT fills a 1.43:1 screen instead of being fitted into a 16:9 view (from seedds#1091) The iOS front end sized the game's view to the largest 16:9 rectangle (DmLayout.h dm_aspect_fit / dm_aspect_fill) and the present then fitted the 1920x1344 frame of Breath of the Wild's or Animal Crossing's screen shape into that 16:9 drawable, so in Fit an iPhone Duo showed it smaller than the 16:9 picture, with bars on all four sides; the Mac mapped the mouse on a 16:9 rectangle of the window too. The present reports the shape of the frame it draws (nvn_mtl.m present_now, the valid rectangle of the presented texture, when its width / height changes) through front_picture_shape (front.h). DmLayout.h takes the shape as a parameter; front_ios.m lays the view out in it (overlay, split, Fill, the TV) and front_mac.m maps the mouse on it. A 16:9 game reports 16:9 and keeps its layout. Checked: the Duo harness on an iPhone 18 Pro simulator, 36 tests (1 skipped), two new (a taller picture in Fit, Fill and on a wider screen; the production root following a reported shape and back); the host build and host tests (Animal Crossing's profile), t_present_crop and t_present_rescue, the docs and settings tests, lint-c (no new findings). Not run on a device or in a windowed game.
What and why
Animal Crossing: New Horizons in a screen's own shape on a screen taller than 16:9, such as the iPhone Duo's (about 1.43:1), instead of a 16:9 picture with bars or stretched: 16:9's sides with more above and below, the layouts in their own shape, centred, their edge widgets at the taller screen's edges.
This builds on #969, which adds the host side (
DM_SCREEN_ASPECTinloader.c, thescreen_aspectprofile key and the launcher setting Picture shape) with Breath of the Wild. Only the last commit (00232109) is new here: it adds this game's profile files and touches nothing in the host. Please review it after #969, or with it.dm/games/01006F8002326000/: a newpatches.py,duo_anchor.c,screen_aspect oningame.tsv), stubs of the 3.0.3mainonly, one bit ofDM_SCREEN_ASPECT_SITESeach:nn::ui2d::DrawInfo::SetProjectionMtx's 16:9 perspective projection has its y row divided by the vertical stretch, so layouts keep their shape (only a 16:9 one: the game copies a DrawInfo's projection into another, and the title came out divided twice);duo_anchor.c, run afterPane::Calculate's global matrix, stretches full-screen and full-height background leaves and moves edge widgets out with the taller edges. The game's panes have no RTTI, so what draws is told by the vtable's DrawSelf againstnn::ui2d::Pane::DrawSelf.DUO_ANCHORisduo_anchor.cbuilt with the command in the comment above it (182 words, no relocations; rebuilding it gives the same words). The game note's new section has the addresses and what each stub fixed (Screen shape).Checked
make -C dm/host/tests GAME=01006F8002326000 run(all pass);dm/tools/teststest_docs,test_game_profile,test_env_switches,test_launcher_settings,test_settings;dm/tools/lint_python.pywith.github/requirements/lint.txt(0 new). The Metal graphics tests ran on Breath of the Wild: a picture of a taller screen's own shape (DM_SCREEN_ASPECT) #969's branch (Breath of the Wild's profile); this commit changes no host or graphics code.01006F80023260003.0.3 with its DLC, built on this base (e5620b1a+ Breath of the Wild: a picture of a taller screen's own shape (DM_SCREEN_ASPECT) #969) with the NSP script (--platform mac --allow-other-metal: this Mac's Metal compiler is Xcode 27.1's 32023.921, the lock's 32023.922), headless with an island save, atDM_SCREEN_ASPECT=1.43against the same route with it unset: the title (the logo, the version, press-A and settings lines at the new edges), the island (16:9's sides with more above and below; the ZL icon, the clock and the minimap at the new edges), the pocket and the NookPhone in their own shape. WithDM_SCREEN_ASPECTunset the route looks as before. No[RED]line.scripts/regress.py checkwas not run (no harness root or route saves on this Mac); this commit adds a profile's stubs only, which keep the original instructions whileDM_SCREEN_ASPECTis unset.Docs
dm/games/01006F8002326000/README.md, Screen shape);docs/agents/game-patches.mdregenerated (the profile'sBINDING)🤖 Generated with Claude Code