Skip to content

Add acknowledged native-camera widescreen for BOTW and TOTK - #817

Open
ComicBit wants to merge 15 commits into
seedds:mainfrom
ComicBit:zelda-native-widescreen-current
Open

ComicBit wants to merge 15 commits into
seedds:mainfrom
ComicBit:zelda-native-widescreen-current

Conversation

@ComicBit

@ComicBit ComicBit commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Revision and goal

a2f038d3f4fea3c67516de30b75c5dd76f0bedc5, based on the previously verified e208 integration. This follow-up adds launcher settings only; no upstream rebase or drift-conflict resolution is included.

Implements #93's native landscape-camera widescreen goal for the verified BOTW 1.9.0 and TOTK 1.4.3 builds: expand horizontal world view rather than stretch/crop the original camera. Guard the verified projection stores and consume the guest acknowledgement only after its actual camera write. Fixed guest render-target sizes remain unchanged. Unsupported builds and narrow layouts retain their framing; DM_WIDESCREEN=0 disables landscape widening.

Compatibility and state contract

  • Preserve upstream DM_SCREEN_ASPECT tall output/layout/FOV patches for BOTW and Animal Crossing, including its verified main build. Valid supported tall mode takes precedence, withdraws the wide request and masks stale landscape acknowledgements without manufacturing a guest ACK. TOTK has no verified tall output/layout hooks here: a tall environment value alone must not disable its working landscape path.
  • Separate physical source shape, requested drawable ratio and acknowledged camera aspect. Logical picture/touch aspect is valid ACK, otherwise actual source, otherwise 16:9.
  • Landscape Fit may reserve a wide canvas before ACK. Fill, portrait/tabletop and TV keep source-shaped canvases to request restoration; an old wide ACK cannot feed itself back into the next request. Presentation/touch preserve the old ACK until restoration is acknowledged.
  • Notify the frontend on ACK changes even when physical source stays 16:9. Mac mouse mapping uses the same precedence, near-match tolerance and backing-pixel fitting.
  • Retain camera desired/ACK fields at +0x40/+0x44. Actual current upstream tall fields start at +0x48 and end with the four-byte field at +0x98; loader/rewriter bounds cover 0x9c. No relocation is needed against current main. Old Breath of the Wild above 60 fps and above 1080p (reworked from #62) #76 and the earlier proposed +0x60/+0x64 relocation must not be combined unchanged with this tall-state layout.

TOTK UI identities remain profile data, classified once at shader setup. MacNativeGames MIT notices/adaptation credit are retained. No invented game addresses, FPS uncapping or shader-producer changes are introduced by this feature.

Launcher review follow-up

Added the default-on Widescreen toggle immediately after Picture shape, gated by the rewritten main module's CAMERA_ASPECT capability. Unsupported/unpatched builds do not offer it. Updated the player documentation and added a regression covering BOTW/TOTK × iOS/Mac with missing, unrelated and camera-patched metadata.

The follow-up passes 28 launcher/settings/storage/documentation tests and the full Python ratchet against the pinned e208 base. A smoke using the production shared model, row and Mac launcher verifies default-on, off persistence/reload, reset-to-default and env-file precedence; its rendered row was inspected. Synthetic capability/language metadata was used, with no game assets or game started. No physical iPhone validation is claimed.

Existing upstream integration conflicts are deliberately left unresolved. The green GitHub checks below belong to predecessor 1fa7ee73; new-head CI is not claimed green.

Current verification

Current production integration 1fa7ee73 passes generated indexes, registry/aspect/profile/ARM64 tests, separately compiled BOTW/Animal Crossing/TOTK host-protocol tests, real-GPU presentation/crop/capture checks, Mac host build and full Python ratchets. The unsigned app/XCTest build succeeds with no errors and three inherited mainScreen deprecation warnings; UIKit execution is not claimed.

The complete 228-unit LLVM 23.1.4 scan observes 261 findings and zero new/stale baseline pairs against e20888b4. Upstream #1141's cleanup is preserved. The remaining single-count NullDereference reduction belongs to the required-descriptor contract carried from #1060; no allowance or suppression is added. No new full-game shader generation or foreground gameplay occurred during this rebase. All eight required exact-head GitHub checks pass for 1fa7ee73, including LLVM/Python lint, build/host/tool tests, coverage, sanitizers and unsigned iOS compilation. This does not settle the runtime merge gates below.

Carries #1060's independent immutable-event-base and fixture-lifetime/required-descriptor repairs until they land. Upstream 8f8b9d5a already fixed the immediate Animal Crossing helper-name failure; removal of the implementation namespace assertion here is general test-contract cleanup, not another runtime improvement.

Runtime evidence and remaining merge gates

Normal 316-chain game preparation completed from predecessor 6ee5c9f9, using internal runtime assets and external compiler-only CAS. Actual matched BOTW outdoor 16:9/wide window captures show extra lateral world and proportional HUD. Foreground focus changed before restoration: partial visual proof, not a completed transition matrix or a render crash. This is not claimed as gameplay validation of the later 1b94 integration.

  • Complete current-branch BOTW/TOTK native/wide/restored window captures.
  • Menus, maps, inventory previews, camera/cinematic transitions and relevant TOTK special modes.
  • Actual iOS Fit/Fill, ACK, rotation/half-fold and TV handoff. No Simulator runtime is available; compilation/geometry tests do not settle these cases.
  • Maintainer agreement on sufficient additional-game shared-path coverage; only the two provided Zelda runtimes are available locally.

Foreground runs are paused while the desktop is in use. Inactive over-3-GiB TOTK acceptance shader generations were retired, with manifests/build logs retained externally; canonical launchers, assets and saves are unchanged. Frozen B219 runs and the installed B3/e047 phone release remain separate evidence boundaries. No new phone deployment, FPS, RAM, power or thermal gain is claimed. No game assets, saves, keys or extracted shaders are included.

@ComicBit

ComicBit commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@seedds I moved this out of draft for active review, with explicit unchecked merge gates in the description; this is not a request to merge before those gates are met. This implements the native-camera widescreen goal in #93 for the supported BOTW/TOTK builds, separately from FPS/resolution changes.

Could you confirm two interface/scope decisions?

  1. What shared-state allocation should the desired/acknowledged camera ratios use so this can coexist with Breath of the Wild above 60 fps and above 1080p (reworked from #62) #76? The current +0x40/+0x44 fields intersect that proposal. I would rather agree one contract and update host, emitted stubs and tests consistently than choose another offset in isolation.
  2. Would you prefer the projection patches plus shared presentation/UI handling as one end-to-end PR, or shared plumbing followed by separate game-specific PRs?

The remaining gates include rebasing the isolated topic onto current main, exact-branch native/wide gameplay captures, relevant menu/camera/special-mode checks, and agreed shared-path regression coverage. Historical captures and combined local builds are explicitly not presented as exact-branch coverage. The focused ARM64, loader and Metal tests are documented separately. No game assets or shader-translator changes are included.

GitHub denied my attempt to assign you formally as reviewer, so I am requesting the review here instead.

@ComicBit
ComicBit force-pushed the zelda-native-widescreen-current branch 2 times, most recently from 49526ba to bf0b380 Compare November 1, 2026 15:36
@Xipzer

Xipzer commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Tested this merged with #76 on BotW 1.9.0 and TotK 1.4.3 (Mac, M-series), in a 21:9 window: both widen the camera and keep the HUD in proportion, no crash; also together with #76's render scale 1.5 (2400x1350 output) in a 7:3 window.

One clash to settle with #76, as you flagged: #76 already uses state +0x40..+0x4b (output size +0x40 u64, output width float +0x48) and +0x4c..+0x5b (pool factor, variable step, heap extra), so FS_STATE_SIZE is 0x60 there. With both merged, the desired ratio at +0x40 would land on #76's output size. In my merge I moved the pair to +0x60 / +0x64 (stub immediates add x8,x8,#0x60 / add x10,x10,#0x60, the loader, FS_STATE_SIZE 0x68, and the offsets in test_botw_aspect.py, test_totk_aspect.py and t_aspect.c); all those tests pass. Happy to open that as a PR against your branch if it helps.

test_botw_aspect.py also needs keys={} on its SimpleNamespace once #76 is in, since #76's stubs write ctx.keys.

@ComicBit
ComicBit force-pushed the zelda-native-widescreen-current branch from bf0b380 to 756848c Compare November 2, 2026 22:25
@ComicBit

ComicBit commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current upstream 65501fbbaf8526f7aab0a1edd028135888590f8e; new head 756848c9b1c20b33dd2e3de19ec13c760b4d0d14. The original topic was kept isolated; this is not the combined local release branch. New exact-head CI is being checked. Previously reported game/performance evidence remains historical and is not relabeled as validation of this refreshed head. The shared-state ABI overlap with #76 and requested wider camera/UI/mode coverage remain maintainer/review gates; no shared-state offsets were changed unilaterally and this is not a merge-ready claim.

@ComicBit
ComicBit force-pushed the zelda-native-widescreen-current branch from 92c868c to a911659 Compare November 2, 2026 23:28
@ComicBit

ComicBit commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

CI follow-up at a911659fdd99: corrected the shared geometry fixture with an explicit program owner through GPU completion/unregister, registry teardown and a checked readback allocation. No production-renderer change, lint suppression or baseline growth in this correction.

BOTW and TOTK host/GPU aspect and presentation-crop checks passed, as did the ARM64 aspect-tool tests. Documentation checks also passed. These are local exact-head checks; the fresh GitHub CI run is still pending, not claimed green. Temporary analyzer instrumentation was removed from the published tree/history.

@ComicBit
ComicBit force-pushed the zelda-native-widescreen-current branch from a911659 to 8ba14a7 Compare November 3, 2026 02:59
@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) mac The Mac front end and app (dm/mac, front_mac.m) tools Tools and scripts (dm/tools, scripts) docs Documentation game: 01007EF00011E000 The Legend of Zelda: Breath of the Wild game: 0100F2C0115B6000 The Legend of Zelda: Tears of the Kingdom labels Nov 3, 2026
@ComicBit
ComicBit force-pushed the zelda-native-widescreen-current branch 2 times, most recently from dbfb1d2 to 3dc44c8 Compare November 3, 2026 07:17
@github-actions github-actions Bot added the ci Continuous integration and repository settings (.github) label Nov 3, 2026
@ComicBit
ComicBit force-pushed the zelda-native-widescreen-current branch 7 times, most recently from 1681871 to 6ee5c9f Compare November 3, 2026 21:08
@ComicBit

ComicBit commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@Xipzer Heads-up after rebasing onto 235eb51: current main now uses the tall-screen state through +0x98, so the earlier +0x60/+0x64 relocation cannot be applied unchanged. This integration retains +0x40/+0x44, which are disjoint from current main’s +0x48..+0x98 fields, and preserves BOTW/Animal Crossing tall mode alongside landscape widening. Loader/rewriter bounds and the profile/build precedence checks are updated; actual iOS mode-transition coverage remains an explicit review gate. Thanks for the earlier combined-build evidence.

Xipzer added a commit to Xipzer/nxnative that referenced this pull request Nov 3, 2026
…ream

Upstream now has its own screen-shape stubs for BotW (DM_SCREEN_ASPECT, seedds#969) on the same state page
(+0x48..+0x9c and +0x100..) and the same camera code; seedds#817 was never merged upstream.

Discord: https://discord.com/channels/1491224015434678394/1524915513606803549
@ComicBit
ComicBit force-pushed the zelda-native-widescreen-current branch from c98e451 to f3418aa Compare November 3, 2026 22:25
seedds added 14 commits November 4, 2026 00:09
The focused LLVM 23.1.4 report attributes an opaque serial-table CF retain to original in image_view_case. Complement that registry ownership with an explicit ARC fixture owner, as in t_queue_origin, without changing production ownership or suppressing the finding.

Keep both serial-table assertions and image view coverage. Verify cached views retire, unbind the fixture descriptor and attachment state, complete the next fence used by deferred retirement, drain releases, and require the base texture to leave residency before dropping the ARC owner. Pixel expectations and production feedback behavior are unchanged. Focused lint and GPU verification are reserved to the parent exclusive runner.
Xipzer added a commit to Xipzer/nxnative that referenced this pull request Nov 3, 2026
… grouped by what they change; Metal HUD from the launcher again

- seedds#817's camera aspect returns with its fields after ours (+0x320 desired, +0x324 acknowledged;
  FS_STATE_SIZE 0x328). On iOS the picture covers the screen while Widescreen (DM_WIDESCREEN) is on,
  as before the merge, instead of upstream's 16:9 view; the split layout of a half-folded Duo stays.
- Settings: Taller picture (DM_SCREEN_ASPECT) off by default (it was 1.43:1 on every iOS screen).
  Game: frame rate, frame generation, console mode, language. Picture: how the picture fits the
  screen (display mode, widescreen, fit, taller picture), then resolution and upscaling, then
  filtering. Performance: pacing and heat, then host internals, then the counter and the HUD.
- Metal HUD: last run's launcher choice sets MTL_HUD_ENABLED before any Metal device exists, and the
  layer's HUD is set again after the first layout, with a log line saying which part failed.

Discord: https://discord.com/channels/1491224015434678394/1524915513606803549
@ComicBit
ComicBit force-pushed the zelda-native-widescreen-current branch from f3418aa to 1fa7ee7 Compare November 3, 2026 23:41
@Lieforse

Lieforse commented Nov 4, 2026

Copy link
Copy Markdown

Nice work on this. One small suggestion: could DM_WIDESCREEN get a toggle on the launcher's settings screen? Right now the only way to turn it off is editing Documents/env.txt, which is awkward on a phone, especially while the iOS cases are still being checked.

It's one row in dm/games/settings.tsv, after DM_SCREEN_ASPECT:

DM_WIDESCREEN	toggle	-	1	fixups:CAMERA_ASPECT	Game	Widescreen

fixups:CAMERA_ASPECT makes it show up only for the builds this PR patches, and it stays on by default. The "There is no launcher row for this switch" line in docs/settings.md would need updating too.

I tried it on your branch (1fa7ee7): the launcher, settings and docs tests pass, and the row shows for BotW with the patch and stays hidden without it.

@ComicBit

ComicBit commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@Lieforse Added in a2f038d: the default-on Widescreen row follows DM_SCREEN_ASPECT and uses fixups:CAMERA_ASPECT, so it is hidden on unpatched builds. Updated docs/settings.md and added BOTW/TOTK × iOS/Mac capability-gating regression coverage.

Local verification: 28 launcher/settings/storage/docs tests, full Python ratchet, and a production Mac launcher/model smoke covering default-on, off persistence/reload, reset and env-file precedence; inspected the rendered row. No game build or iPhone run is implied.

This is one focused commit on the existing PR base. I have not rebased or resolved the unrelated conflicts caused by later upstream changes; predecessor CI results are not attributed to this new head. Thanks for the concrete suggestion.

@padsiwono

padsiwono commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

For TOTK's tall path, in case it helps: on 1.4.3 (main 277178b7) we run 3024x1964 (the 14-inch MacBook Pro panel, 1.54:1) with the 3D and the HUD in proportion. That build also renders the targets at the full size with our own render-size stubs, which main doesn't have, so this only covers the camera and the HUD.

  • Camera: the same copy you guard at main+0x628c74. For Vert+ we also change fovy at its load at main+0x628c3c: fovy' = 2·atan(tan(fovy/2) · (16/9) · h / w), and the aspect at +0x628c74 becomes w / h. Both only when the camera's aspect is 16:9 (within 0.01), so render-to-texture cameras keep theirs.
  • HUD: all 334 layouts are 1920x1080, and main+0x32be4 copies the lyt1 size into the Layout (+0x28, +0x2c). A stub at the height load (main+0x32bf0) that gives a 1920x1080 layout the height 1920 · h / w (1247 at 3024x1964) brings the HUD back into proportion. It sits in a centred band of the 16:9 picture's height, because the corner pieces are placed against the centre, not the edges. Menus come out in proportion and letterboxed.

3024x1964, the 16:9 picture stretched (oval minimap) 3024x1964, Vert+ with the HUD in its band (round minimap)
3024x1964 before and after: the 16:9 picture stretched (oval minimap), then Vert+ with the HUD in its band.

Headless at 60 fps on the Great Sky Island route, 33 of 33 windows. Not checked on the MacBook's own screen, or in cutscenes after the opening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration and repository settings (.github) docs Documentation game: 0100F2C0115B6000 The Legend of Zelda: Tears of the Kingdom 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) mac The Mac front end and app (dm/mac, front_mac.m) 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.

5 participants