Skip to content

Add iOS 16.1/17 compatibility and tvOS support for Pokémon Legends: Z-A - #310

Closed
widmonstertony wants to merge 16 commits into
seedds:mainfrom
widmonstertony:ios16-pokemon-za-port
Closed

widmonstertony wants to merge 16 commits into
seedds:mainfrom
widmonstertony:ios16-pokemon-za-port

Conversation

@widmonstertony

Copy link
Copy Markdown
Contributor

Summary

This draft ports the Pokémon Legends: Z-A host to the iOS/iPadOS 16.1 deployment baseline while keeping the newer iOS 17 path, and carries the companion tvOS frontend work developed and tested with the same game profile.

The implementation was developed on the fork's ios16-pokemon-za-port branch and is intentionally submitted as a draft because upstream main has advanced substantially since the branch point. The validated branch is currently 157 commits behind upstream and has conflicts in the Metal present path, the iOS embedded-image loader, input setup, and packaging scripts. Those conflicts need to be reconciled against the newer upstream architecture before this should be merged.

iOS 16/17 work

  • Set the iOS deployment target to 16.1 and use an Apple A10-compatible compiler baseline.
  • Add the legacy Metal buffer/pipeline/resource path required by pre-Metal-4 devices while retaining the newer path where available.
  • Keep executable code in signed __TEXT mappings for sideloaded iOS builds, including front-patch layouts.
  • Add guarded shader/resource fallbacks for Tier-1 argument buffers, sampler limits, atomics, zero images, minimum reduction, layered rendering, and unsupported ASTC payloads.
  • Add explicit render-pass synchronization and resource-lifetime handling for older Apple GPUs.
  • Preserve dynamic 60/120 Hz display requests without adding a 30 fps lock; hardware and game timing still determine the delivered frame rate.
  • Keep the game's original physical ABXY mapping and HUD positions. The optional Z-A battle layout only changes the displayed/touch skill labels while the battle skill UI is active.
  • Add keyboard, mouse/trackpad, controller, and touch input handling used by the iPad frontend.

Companion tvOS work

  • Add a tvOS frontend with controller and Siri Remote input paths.
  • Add app icon resources and packaging/resource validation.
  • Add fail-closed, transactional RomFS overlay materialization for device-side compatibility resources.

Validation

  • python3 -m unittest discover -s dm/ios/tests -p 'test_*.py' — 40 passed.
  • python3 -m unittest discover -s dm/tools/tests -p 'test_*.py' — 72 passed.
  • python3 dm/tvos/tests/test_resources.py — all resource validation cases passed.
  • python3 dm/tvos/tests/test_romfs_patch.py — all materialization, rollback, integrity, and concurrency cases passed.
  • python3 scripts/check_ios17_compile.py --all-profiles — 144 arm64 iOS 16.1 unit compilations across 48 profiles, 0 failures.
  • Device work covered an A10X iPad running iPadOS 17.7.11 and a newer M2 iPad. This establishes the old/new hardware paths on iPadOS 17; it does not claim a completed physical-device run on iOS 16 itself.

Review note

This is a large compatibility stack rather than a single isolated fix. I opened it as a draft so the validated implementation is visible without force-rebasing it over 157 upstream commits and invalidating the device results. I am happy to split the iOS/tvOS pieces or rework individual subsystems around the current upstream present, loader, and packaging architecture during review.

@v0lumehi

Copy link
Copy Markdown
Contributor

Thanks for putting this up as a draft, and for testing on both an A10X and an M2 iPad. That's real work.

Two thoughts, from a contributor's point of view. The scope call is @seedds's.

Splitting it up. At +22k / −4.5k lines across 151 files, 157 commits behind main, with about 7.8k of the changed lines in nvn_mtl.m alone, nobody can realistically review this as one piece. It also mixes three separate things that could each stand on their own, as separate PRs on current main:

  1. the tvOS front end,
  2. the iOS 16/17 baseline,
  3. the Z-A-specific parts (hle_za_timing.c, the battle layout).

The platform question first. The README currently targets iOS/iPadOS 26+ on A17 Pro / M1 and later, and the host is built around Metal 4 (MTL4Compiler, pipeline archives, the present path). Supporting devices without Metal 4 means a second rendering path, plus BC→ASTC for older GPUs, that every later change would have to keep working, on hardware few contributors can test. Whether the project wants that is a decision worth making before anyone spends time rebasing 157 commits. #306 adds a short "large changes and other platforms" note to CONTRIBUTING.md along these lines.

If the answer is no, a fork that tracks main for older devices is a perfectly good home for this work. If it's yes, splitting it as above would make it reviewable.

@widmonstertony

Copy link
Copy Markdown
Contributor Author

Thanks — I agree that the current draft is not reviewable as one PR.

I also understand the practical maintenance issue with older hardware. The maintainer cannot reasonably test and maintain a legacy rendering path without access to those devices. I have the A10X and M2 iPads, so I will take responsibility for that path in the public fork instead of asking upstream contributors to carry it.

I’ll keep widmonstertony/nxnative tracking upstream main, while maintaining the iOS/iPadOS 16/17 renderer fallback and BC-to-ASTC work on dedicated branches tested on those devices. This draft can remain temporarily as a public record of the implementation and hardware testing, rather than as a request to merge the entire branch.

If an individual part is independently useful upstream—for example the tvOS front end or a general bug fix—I’ll rebase only that change onto current main and submit it as a small, focused PR. I won’t combine the legacy platform path, tvOS support, and Z-A-specific changes into one PR again.

Thanks for the clear review guidance.

@v0lumehi

Copy link
Copy Markdown
Contributor

Thanks for taking it this way, and for owning the older-device path in your fork. That's a really generous answer, and having someone who can actually test on an A10X is worth a lot.

Speaking only as a fellow contributor (what lands is @seedds's call): looking through the branch again, two parts might not depend on the older-device question, and I'd personally love to see them as small PRs on current main:

  1. The render-pass synchronization and resource-lifetime fixes, if some of them also fix races on current GPUs. If you can point out which ones, I'm happy to test them on an iPhone 17 Pro Max and an M2 Max and report back in the PR.
  2. The signed __TEXT mappings for sideloaded builds, if that helps sideloading tools in general and not only on iOS 16.

For the tvOS front end, a short issue first is probably the easiest way to get a scope answer from @seedds before you spend time rebasing it.

And since your fork will track main for older devices: the README already links NX2Apple as a community project, so maybe yours could be listed the same way. Again @seedds's call, just an idea.

@widmonstertony
widmonstertony force-pushed the ios16-pokemon-za-port branch 8 times, most recently from a465217 to ad5aea6 Compare October 28, 2026 02:13
@seedds

seedds commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Thank you for the compatibility work and the A10X and M2 iPad testing, and for already offering to maintain the older-device path in your fork.

I'm closing this draft in line with that plan. The legacy renderer, older OS baseline and tvOS support introduce substantial additional paths outside nxnative's current support scope. Keeping them working alongside changes to the supported Apple platforms would require ongoing hardware and rendering validation that I don't have the development and testing capacity to take on. For the current project scope, that maintenance burden outweighs the benefit of carrying these paths upstream.

Please do continue the work in your fork, where you can maintain and test it on the devices you have. This closed PR will remain available as a record of the implementation and discussion. General bug fixes that also help the currently supported platforms are welcome as small, focused PRs on current main; any new platform proposal should start with a scope discussion. I appreciate your understanding and the time you've put into this.

@seedds seedds closed this Oct 28, 2026
@LNPANDY

LNPANDY commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Following up from the launcher side (NX2Apple). Two of the slices @v0lumehi pointed out look worth landing on current main regardless of the older-device question: the render-pass synchronization and resource-lifetime fixes (if some of them also fix races on current GPUs — naming the commits would help reviewers a lot), and the signed __TEXT mappings for sideloaded builds. Split that way each one is reviewable, @v0lumehi has already offered to test on an iPhone 17 Pro Max and an M2 Max, and we would pick them up through our daily upstream sync.

On the community side: we keep a short links section in the NX2Apple README, so we are adding a pointer to this fork for people on iOS 16/17 devices who want to keep playing. Whether seedds lists it upstream is his call; the offer on our side stands. Thanks again for taking the review the way you did — the A10X + M2 testing coverage is exactly what this path needs.

LNPANDY pushed a commit to LNPANDY/NX2Apple that referenced this pull request Oct 30, 2026
… older devices

Its author maintains the legacy Metal renderer path in their own fork
(upstream PR seedds/nxnative#310 was closed in favor of that plan), with
A10X and M2 iPad testing. Point iOS 16/17 users there.
ltrdpper pushed a commit to ltrdpper/BananaNative that referenced this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants