r/decomps • u/balthierwings • 9d ago
Preview Ocarina of Time Remake running on 4th gen Apple TV (2GB RAM Limit)
Took a little bit of effort customizing nxnative work for Mac / iPhone, but it is possible to get Ocarina of Time remake working on the new Apple TV (A19 processor with 8GB of RAM and 128GB storage, but tvOS apps are limited to only 2GB). Will put codex's changes in a comment since it required some unique changes that Macs and iPhones don't need.
2.7k
Upvotes
71
u/balthierwings 9d ago •
Directly from codex, will look to put up a PR for nxnative in a day or two if the maintainers want to accept tvOS platform changes:
Native tvOS port: built the app and Metal shaders for tvOS, added the TV icon, and fixed Siri Remote focus/navigation in the launcher.
Larger virtual address space: enabled extended virtual addressing so the game could reserve its required 12.5 GiB address range. That doesn’t grant more physical RAM.
Lower rendering resolution: configured handheld mode, dynamic resolution, a 30 fps target, and 640 × 360 scene rendering, followed by higher-resolution composition.
Smaller depth textures: patched the TV-specific game copy to reduce 12,288-square → 3,072-square and 4,096-square → 1,024-square depth buffers. This saved roughly 300 MiB.
Lower texture detail: omitted the two highest-resolution mip levels for eligible compressed textures—typically one-quarter the width and height.
Less retained graphics memory: reduced upload staging blocks from 32 to 8 MiB, upload batches from 128 to 16 MiB, released large completed scratch buffers, and disabled render-target heap recycling. Limited command allocators to two, balancing memory against performance.
Faster cleanup after camera changes: reduced obsolete render-target retention from three seconds to one, checking every 100 ms. The measured Saria transition peak fell from 2,086 to 1,886 MiB.
Movie playback fixes: used the original decoded movie frames instead of the expensive enhancement path, added decoder recovery after suspension, and disabled bulk pipeline prebuilding to reduce startup load.