在 iPhone 和 iPad 上原生畅玩 Switch 游戏

这不是模拟器。游戏自己的代码直接运行在苹果芯片上,Switch 的图形在 Metal 上重建。自备 NSP 文件和 prod.keys,一个脚本即可打包成 IPA 并侧载安装。

开始使用浏览 45 款游戏GitHub
45款可玩游戏
13款已提升到 60 帧
0仓库内的游戏文件
iOS 26+A17 Pro / M1 及更新

项目背景

用原生移植代替模拟:只有苹果内核要求的地方,才会改写游戏代码。

原生执行

每个游戏的 NSO 模块经过改写后直接在 CPU 上运行。宿主层代替 Switch 系统 Horizon,提供线程、内存、文件系统、音频和各类服务。

基于 Metal 的图形

NVN 和 Vulkan 调用在 Metal 上实现。Maxwell 着色器在构建时先转换为 SPIR-V,再转换为 Metal 着色语言。

自备游戏

本仓库不含任何游戏内容。打包脚本在你的 Mac 上用你的密钥读取 NSP,生成未签名的 IPA 供你侧载。

按游戏配置

每个游戏在 dm/games/<title id> 里有一份很小的配置,记录常量和着色器表。代码读取配置,从不把某个游戏写死。

基于 d2r-mobile、Ryujinx 的着色器转换器、Atmosphère、yuzu、LibHac、SPIRV-Cross 等项目。详见致谢。

快速教程

在 Mac 上打包 IPA,侧载到设备,开玩。第一次构建需要 30–60 分钟,之后约 10 分钟。

环境要求。装有 Xcode 和 Homebrew 的 Mac;空闲磁盘约为 NSP 大小的两倍再加 10 GB;目标设备为 iPhone 15 Pro 或更新机型(A17 Pro 及以上),或 M1 及以上的 iPad,系统为 iOS / iPadOS 26 及以上(游戏的 BC 压缩纹理需要)。

获取 nxnative 和所需工具

在 Mac 上只需做一次。

git clone https://github.com/seedds/nxnative.git && cd nxnative
brew install xcodegen zstd spirv-cross
brew install --cask dotnet-sdk
python3 -m pip install lz4 capstone fonttools "backports.zstd; python_version < '3.14'"

把一个游戏的 NSP 放进一个文件夹

基础游戏(NSP,或 XCI 转储)、它的更新包和任何 DLC。

~/Games/MarioWonder/
  Super Mario Bros. Wonder [010015100B514000][v0].nsp
  Super Mario Bros. Wonder [010015100B514800][v327680].nsp

运行脚本

IPA 会出现在同一个文件夹里。

python3 scripts/build_ipa_from_nsp.py ~/Games/MarioWonder -k ~/keys/prod.keys

侧载

用 AltStore、Sideloadly、LiveContainer 等工具安装 IPA。应用会使用游戏的名称、图标和版本。

开玩

点击顶部的 2D / 3D 切换触控布局。连接手柄后触控按键会隐藏。3D 模式下,在屏幕右侧三分之一处滑动来控制视角。摇晃手机即可摇动手柄。

游戏

全部在 iPhone 上测试过,可以游玩。点开查看详情。

Super Mario Bros. Wonder
Super Mario Bros. WonderIPA ~4 GB
2D 布局
Fire Emblem Engage
Fire Emblem EngageIPA ~15 GB
2D 布局60 fps
Metroid Dread
Metroid DreadIPA ~5 GB
2D 布局
13 Sentinels: Aegis Rim
13 Sentinels: Aegis RimIPA ~5 GB
2D 布局
Super Mario 3D World + Bowser's Fury
Super Mario 3D World + Bowser's FuryIPA ~3 GB
3D 布局
The Legend of Zelda: Breath of the Wild
The Legend of Zelda: Breath of the WildIPA ~16 GB
3D 布局60 fps
The Legend of Zelda: Link's Awakening
The Legend of Zelda: Link's AwakeningIPA ~6 GB
2D 布局
Super Mario Odyssey
Super Mario OdysseyIPA ~6 GB
3D 布局
Hades
HadesIPA ~4 GB
3D 布局
Hyrule Warriors: Age of Calamity
Hyrule Warriors: Age of CalamityIPA ~15 GB
3D 布局60 fps
Fire Emblem: Three Houses
Fire Emblem: Three HousesIPA ~13 GB
3D 布局60 fps
Super Mario Galaxy
Super Mario GalaxyIPA ~3 GB
3D 布局
The Legend of Zelda: Tears of the Kingdom
The Legend of Zelda: Tears of the KingdomIPA ~17 GB
3D 布局60 fps
Monster Hunter Rise
Monster Hunter RiseIPA ~22 GB
3D 布局60 fps
Ace Attorney Investigations Collection
Ace Attorney Investigations CollectionIPA ~7 GB
2D 布局
Hades II
Hades IIIPA ~4 GB
3D 布局
Unicorn Overlord
Unicorn OverlordIPA ~4 GB
2D 布局
Rhythm Heaven Groove
Rhythm Heaven GrooveIPA ~3 GB
2D 布局
Octopath Traveler 0
Octopath Traveler 0IPA ~4 GB
2D 布局60 fps
Pokémon Legends: Z-A
Pokémon Legends: Z-AIPA ~6 GB
2D 布局
Cuphead
CupheadIPA ~5 GB
2D 布局
Super Mario Galaxy 2
Super Mario Galaxy 2IPA ~3 GB
3D 布局
FINAL FANTASY TACTICS - The Ivalice Chronicles
FINAL FANTASY TACTICS - The Ivalice ChroniclesIPA ~11 GB
3D 布局
Absolum
AbsolumIPA ~2 GB
2D 布局
Captain Toad: Treasure Tracker
Captain Toad: Treasure TrackerIPA ~2 GB
3D 布局
Brain Memory Training Academy
Brain Memory Training AcademyIPA ~0.1 GB
2D 布局
The Great Ace Attorney Chronicles
The Great Ace Attorney ChroniclesIPA ~4 GB
2D 布局
STEINS;GATE RE:BOOT
STEINS;GATE RE:BOOTIPA ~6 GB
2D 布局
Big Brain Academy: Brain vs. Brain
Big Brain Academy: Brain vs. BrainIPA ~0.8 GB
2D 布局
Patrick's Parabox
Patrick's ParaboxIPA ~0.2 GB
2D 布局
Celeste
CelesteIPA ~0.9 GB
2D 布局
DRAGON QUEST XI S: Echoes of an Elusive Age – Definitive Edition
DRAGON QUEST XI S: Echoes of an Elusive Age – Definitive EditionIPA ~15 GB
3D 布局60 fps
Monster Train 2
Monster Train 2IPA ~1.6 GB
3D 布局60 fps
Raging Loop
Raging LoopIPA ~0.9 GB
2D 布局
DARK SOULS: REMASTERED
DARK SOULS: REMASTEREDIPA ~4 GB
3D 布局60 fps
Paper Mario: The Thousand-Year Door
Paper Mario: The Thousand-Year DoorIPA ~5 GB
3D 布局60 fps
Hollow Knight: Silksong
Hollow Knight: SilksongIPA ~6.4 GB
3D 布局
Catherine: Full Body
Catherine: Full BodyIPA ~14 GB
3D 布局
Digimon Story Cyber Sleuth: Complete Edition
Digimon Story Cyber Sleuth: Complete EditionIPA ~5 GB
3D 布局
Animal Crossing: New Horizons
Animal Crossing: New HorizonsIPA ~10.5 GB
3D 布局
DRAGON QUEST VII Reimagined
DRAGON QUEST VII ReimaginedIPA ~5.9 GB
3D 布局
FINAL FANTASY RESONANCE
FINAL FANTASY RESONANCEIPA ~10 GB
3D 布局60 fps
Luigi's Mansion 3
Luigi's Mansion 3IPA ~7.5 GB
3D 布局60 fps
AI: THE SOMNIUM FILES
AI: THE SOMNIUM FILESIPA ~8.3 GB
3D 布局
AI: THE SOMNIUM FILES - nirvanA Initiative
AI: THE SOMNIUM FILES - nirvanA InitiativeIPA ~11.6 GB
3D 布局

常见问题与技巧

语言

默认英文。打包时用 -l 指定(例如 -l zh-Hans),或在 Documents/env.txt 中加入 DM_LANG=zh-Hans。

存档与日志

在“文件”应用里,位于应用名称下:save/ 和 log.txt。出问题时请发送 log.txt。

卡顿

场景第一次出现时的短暂卡顿是正常的:图形只编译一次,之后会被记住。

重新安装

部分侧载工具会给重装的应用新的数据文件夹。请把旧文件夹里的 save/ 和 pso_user.tsv 复制过来。

设置

在 Documents/env.txt 中加入:DM_OPMODE=0 为掌机模式,DM_FPS_TARGET=30 省电,DM_SHOW_FPS=1 显示帧率。

不支持

没有 amiibo,没有联网功能。其他游戏会得到一份分析报告和尽力而为的 IPA,不一定能启动。