Repository navigation
iOS: add Duo portrait and tabletop gameplay layouts - #230
Conversation
|
Thanks a lot for this, @jonochocki. The Duo layouts and the external display support are things we wanted, and testing on a physical Duo with screenshots from the device is exactly the evidence that helps. The work looks careful. We'd like to review and merge it, but in this form it is hard to do well:
Could you split it into three PRs, in this order?
For each part, the same flow as you did here: a PR to seedds/nxnative first (splitting #683 the same way would help seedds too) and a CI has not run yet because this comes from a fork. We'll approve the runs once the split PRs are up. Thanks again, this is a big step for the iPhone side. |
v0lumehi
left a comment
There was a problem hiding this comment.
Requesting changes only to mark the state: please split this into the three PRs described in the comment above. Happy to review the Duo gameplay layouts first.
95488b0 to
4f7b1ee
Compare
|
Thanks for the split, @jonochocki, this is much easier to review. The Duo layout itself reads well: the hinge and reserved-region handling behind the availability checks, the aspect-fitted video, touch coordinates following the video rectangle, and releasing held inputs on a pose change. We want the Duo portrait and tabletop layouts, the near-square inner display really benefits from video above the controls. One change in scope, about orientations.
With that, this is good to go from our side once CI is green. @LNPANDY, could you take a look as well? It changes the orientation policy and the window behaviour of every iOS game, so a second pair of eyes would be good before it merges. |
|
Good callout. I’ll restore landscape-only orientations for iPhone and confirm on Duo that the outer display stays landscape while the inner display retains portrait and tabletop layouts; missed that check during the PR splits. Regarding Split View and small Stage Manager window behavior too: I’ll check that the video, controls and touch coordinates follow window resizing on the iPad before submitting an update. 👍 |
|
Thanks for the review. I’ve restored landscape-only orientations for iPhone and confirmed the behavior on my physical Duo:
I also checked iPad window resizing before and after Play. The production Metal viewport stays aspect-fitted at 16:9, controls follow the current window proportions, and newly delivered touches map correctly after resizing and rotation. This covers the gameplay presentation and input path, in addition to the launcher. I’ve added regression coverage for repeated window-size changes, Metal drawable dimensions, button hit targets and normalized video touches. The Duo harness passes all 27 tests. The iPad harness passes 26 tests, with one hinge-API availability skip on iOS 27.0 and no failures. Patch-queue validation also passes. |
|
I'll review in a bit |
v0lumehi
left a comment
There was a problem hiding this comment.
Thanks for the quick update, @jonochocki. This addresses everything from my earlier review, so I'm approving.
- Orientations: regular iPhones stay landscape-only, and only the iPad list (
~ipad) adds portrait. The Duo inner display ignores the list, so portrait and tabletop still work there. Thanks for checking both displays on your Duo. test_orientation_policy.pykeeps the iPhone landscape-only, the iPad on all four orientations andUIRequiresFullScreenout of both projects. Our tests workflow already runsdm/ios/tests/test_*.py, so it is enforced in CI.- Code: the split only applies to portrait bounds or a partially open hinge with a valid horizontal division, so landscape keeps today's overlay. Held keys and game touches are released on a pose change. Game touches map through the actual video rectangle. The hinge and reserved-region code sits behind
__has_includeand@available(iOS 27.1, *), so it still builds with older SDKs. - Upstream: patch 0033 is
forwarded seedds/nxnative#683, as it should be.
Two small things, neither blocks the merge:
- The patch header says
From: seedds <[email protected]>. It should name you as the author. If you regenerate the patch with your own git identity, the credit is right in the queue too. startGamenow setsg_root = self, whichviewDidAppear:already does. It is harmless, but the line can go.
@LNPANDY, this changes the iOS builds players get: iPads gain all four orientations plus Split View and Stage Manager windows (without UIRequiresFullScreen), and the Duo inner display gets portrait and tabletop layouts. iPhones stay landscape-only. Please have a look before it merges. It is a feature, so it waits until the 48 hours are up (2026-10-31, 23:03 UTC) and the CI run on the latest commit is green.
|
@jonochocki, one more step before this can merge: the branch now conflicts with main. Since you opened it, main moved the upstream pin to seedds Could you rebase onto current main and regenerate patch 0033 against the new pin ( |
|
Thanks for splitting the Duo layouts and for testing the orientation and resize behaviour on your devices. We want to keep this contribution for review, rather than close it. As noted above, it currently conflicts with main after the upstream sync; please rebase and regenerate the patch on the latest pin, preserving the Nintendo controller mapping and the current patch queue. Please also keep your own author identity on the patch so the credit is correct. After that, we will recheck CI and the Duo/iPad harness. Real iPad gameplay while resizing is still an open validation item. AirPlay can remain a separate follow-up. |
ceb9d18 to
e879a9c
Compare
|
Thanks, both, for the thoughtful reviews and guidance. The commit identity instructions were a little confusing to read, so I appreciate the clarification and the update in #244. The regenerated patch now uses my own Git identity. I’ve rebased onto current main and regenerated Happy to help contribute. My background also includes UX and design philosophy, so as the launcher progresses through design iterations, I’d be glad to lend a hand wherever useful. Thanks again for keeping this moving and helping get the contribution into a maintainable shape. |
v0lumehi
left a comment
There was a problem hiding this comment.
Thanks for the quick rebase, @jonochocki, and sorry that the identity instructions were confusing. That was on us, and #244 and #245 fixed the wording.
I checked the new head e879a9c3 against my earlier review:
- Patch 0033 is regenerated on the current pin with your own identity in
From:and stillforwarded seedds/nxnative#683. - The code is the same as what I approved, minus the redundant
g_rootassignment. It also picks up what main changed meanwhile: the Nintendo pad mapping note frompad_apple.hand thefront_ios_device_messagestub in the Duo harness runtime. - I approved the CI runs for this commit.
So my approval stands. Once CI is green it can merge after the 48 hours (2026-10-31, 23:03 UTC), unless @LNPANDY has objections. Real iPad gameplay while resizing stays the open validation item, as noted.
And beyond this PR: this is exactly the kind of help we can use. Careful work, tested on real hardware, with the evidence attached. If you like, you are very welcome to give feedback and ideas on the design too. The iOS shell that will hold several games in one app (#226, with screenshots) is still taking shape, and an eye from someone who owns a Duo and cares about how things feel on the device would help a lot. Comments there, or new issues with ideas, are both welcome.
e879a9c to
64220a8
Compare
|
I rebased this onto main. The engine changes are now patch 0054, because the repo builds the engine from patches/ instead of tracking dm/ and docs/. The author stays jonochocki. I merged the layout code with the layout editor and TV support that landed in the meantime, and I added a dm_set_opmode stub so the Duo harness links again. The harness passes on an iOS 27.0 simulator (27 tests, 1 skipped because it needs 27.1). |
64220a8 to
647d418
Compare
Adds patches/0054: portrait puts the 16:9 picture above the touch controls, native horizontal folds separate game and controls, and a Duo test harness under dm/ios/tests/duo.
647d418 to
35cdc63
Compare
|
@jonochocki The layout editor (patches 0035 and 0036) was taken out of main in #345 because it scattered the in-game controls. So I rebuilt patch 0054 on the layout without it. The DmGamepad.m part is now exactly your original change again, with your original face button hit test and positions. The only addition is the TV support check in front_ios.m that main needs. The Duo portrait and tabletop layouts look the same as before. I checked them on the simulator, and the Duo harness and the iOS smoke build pass. You stay the author of the commit. |
|
@jonochocki we will very likely include this in the release after 0.8.0, I need to see how this integrates with the new iPhone app before |
Renumber patch 0054 to 0061 and refresh its context for the new pin.
|
I merged
|
LNPANDY#230 took patch 0061 (Duo layouts). The button-mapping patch is now 0062, the next free number on main, and applies after it unchanged.
What and why
Add native iPhone Duo gameplay layouts. Portrait places the aspect-fitted 16:9 game picture above the virtual controls; a partially open horizontal hinge uses UIKit’s division region for tabletop play. Landscape retains the existing overlay when no tabletop division applies.
UIHingeInteractionand reserved regions on iOS 27.1+, including inactive division boundaries. Other SDKs/OS versions retain the geometry fallback.UIRequiresFullScreen;UILaunchScreen: {}replaces the empty storyboard entry. The existing launcher gets an orientation-capable hosting controller; its design and settings are unchanged.This is the Duo-only portion of the previously combined contribution, split at the maintainer’s request. It includes no AirPlay scene, launcher redesign, artwork fetching/bundling, accent extraction or desktop-builder changes. The AirPlay follow-up is prepared separately; the launcher redesign is deferred for discussion with NX2Apple’s shell work (#226 / #144).
Checked
Rebased onto current main. The fork retains the
ee6648cbupstream pin, existing patches0030and0031, and Duo patch0033. The patch and commits use the contributor’s own Git identity. The redundantg_rootassignment is removed; upstream’s Nintendo-controller mapping is retained.(0.5, 0.5)after resizing and rotation.The iPad checks use synthetic Metal frames through the production presentation and input code. Full-game testing on a physical iPad and game-performance measurements under resizing remain outstanding. The existing launcher’s two-column layout wraps long titles heavily in narrow windows; this PR does not redesign it.
Earlier device-SDK compile/link smoke checks passed with synthetic game modules and resources; those checks and physical Duo 1.3.19 acceptance predate this rebase. No shader, game-profile or guest-code changes are included. Existing screenshots below are from the previously approved physical Duo build; no new 1.3.19 screenshots are claimed.
Screenshots
Owner-provided physical Duo gameplay; the launcher and external-display screenshots are intentionally excluded.
Inner display: portrait game above controls
Inner display: landscape overlay
Outer display: landscape overlay
Scope
patches/0033-ios-adapt-gameplay-to-duo-portrait-and-tabletop.patch; existing patches0030and0031retain their order ahead of0033.No app-identity or save-data migration. The approved local combined IPA is preserved separately.