kartnative is a fork of nxnative for the Nintendo Switch 2 that runs Mario Kart World 1.0.0 natively on an Apple silicon Mac. As upstream, it is not an emulator: the game's own code runs on the Mac's CPU, its graphics API (NVN2) is reimplemented on Metal, and its Switch 2 shaders (Ampere SM86 machine code) are translated to Metal offline. Bring your own decrypted dump; nothing from the game is in this repository.
Captured on the Mac at the game's 2560x1440: the title screen, the main menu and a Grand Prix race on Mario Bros. Circuit.
| Game | Mario Kart World 1.0.0 (0400C3F00006E000), from a decrypted loose dump (exefs/ and romfs/) |
| Platform | Mac only, Apple silicon (tested on an M5 Pro with 24 GB, macOS 27). No iOS build yet |
| Plays | Boot, menus, the cup-opening movies, whole Grand Prix cups at 150cc, Time Trials and Free Roam, with a controller (DualSense tested) |
| Frame rate | A steady 60 fps, also in fullscreen on 120 Hz ProMotion screens |
| Memory | About 11–12 GB resident, flat over a cup |
| Graphics | All 11,567 of the game's shaders translate (task and mesh shaders become Metal mesh shaders); terrain and water draw correctly |
| Known issues | Some scenery objects vanish and reappear while driving (being investigated); online play is not available |
-
Clone this repository,
git clone https://github.com/pahorema/kartnative.git && cd kartnative, and install the tools of upstream's step 1 (Xcode's Metal toolchain, the Homebrew packages, .NET and the Python packages), skipping its clone of nxnative. -
Put the dump in one folder,
MarioKartWorld/exefs/(main,main.npdm,sdk,subsdk0) andMarioKartWorld/romfs/. -
Build for the Mac. The first build translates the game's ~11,600 shaders, about 30 minutes; later builds reuse them.
--allow-other-metalis needed when your Metal compiler is not the one indm/gfx/tools/dmsh_chain.lock:python3 scripts/build_ipa_from_nsp.py ~/Games/MarioKartWorld --platform mac --no-heap-check --allow-other-metal -
Run the command the script prints. It opens a window (
DM_WINDOW=1). Useful additions:Variable Effect DM_FULLSCREEN=1Start in fullscreen (⌃⌘F toggles, ⌘Q quits) DM_LANG=itGame language (any language code the game has) DM_PAD_SWAP=1Exchange A/B and X/Y on a physical controller, for pads labelled the Xbox / PlayStation way DM_PRESENT_UPSCALE=metalfxScale the 2560x1440 picture to a larger screen with MetalFX instead of bilinear filtering DM_METAL_HUD=1Apple's Metal performance HUD (frame rate, GPU time, memory) The first start prepares the game's pipelines (about 15 seconds) before the first frame. macOS turns Game Mode on in fullscreen when the host runs inside an app bundle that declares a games category, as the Mac app packaging does.
- Kernel and SDK: Switch 2 programs are detected from
main.npdm; the host answers with the Switch 2's 31.25 MHz system counter, six cores, its newsvcandGetInfovalues and its memory layout, and hooks the new SDK services the game uses (graphics scale,nn::vidisplay queries,nn::codecvideo decoding through libvpx,nn::syncpt, audio output streams). - NVN2 on Metal: API 231.16 and its device table, NVN2 queues, pools, command buffers (push constants, mesh-task draws, shading-rate state), programs and windows; Switch 2 block-linear layout; sparse textures on Metal placement-sparse textures; CPU-written textures taken from their memory at first sampling.
- Shaders: a native SM86 frontend inside the vendored Ryujinx translator (uniform registers, warp and tensor operations, task and mesh stages), the game's per-program compute bindings decoded from its shader control sections, threadgroup memory past Metal's 32 KB moved to a device buffer.
- Frame pacing: in fullscreen on screens faster than 60 Hz the display link runs at the screen's rate with 60 Hz ticks, so a late frame waits one refresh, not a whole frame. Mario Kart World advances its game one fixed step per frame, so a steady 60 fps is also what keeps its speed right.
Details: the game's note, NVN2, the SM86 frontend, Switch 2 shader containers and translation.
- nxnative by seedds, and d2r-mobile before it: everything this fork builds on.
- What Switch 2's services, NVN2 and SM86 do was learnt in part from the public commits and notes of the Eglantine and PokeDinner emulators. Only facts were taken, no code, so this fork keeps nxnative's MIT license. SM70+ instruction encodings follow Mesa's NAK compiler (MIT).
Not affiliated with Nintendo. Play games you own.
Play your own Nintendo Switch games natively on iPhone and iPad. Bring your game (its NSP files) and your prod.keys; one script turns them into an IPA that you sideload.
It is not an emulator: the game's own code runs directly on the Apple chip, with Switch graphics rebuilt on Metal. Nothing from any game is in this repository, and the project is not affiliated with Nintendo or any game publisher.
Community projects build on nxnative with Mac apps that turn your games into apps for your iPhone, iPad or Mac, with no command line, and keep them in a library. They are separate projects: questions and bugs about them go to their own pages.
You need a Mac with macOS 26.6 or later, Xcode 27.1, Homebrew and Python 3.12 or newer (an arm64 one, not an Intel Homebrew's). An iPhone build also needs Xcode's iOS platform (Xcode → Settings → Components).
The shaders are built with Xcode 27.1's Metal compiler, so take 27.1 from Apple's download page, not the App Store's newer Xcode. With a newer Xcode installed too, rename 27.1 to Xcode-27.1.app and select it before step 1: sudo xcode-select -s /Applications/Xcode-27.1.app.
1. Install the tools (only once), in Terminal:
xcodebuild -downloadComponent MetalToolchain
git clone https://github.com/seedds/nxnative.git && cd nxnative
brew install xcodegen zstd glslang
brew install --cask dotnet-sdk
python3 -m pip install lz4 "capstone>=5,<6" fonttools nsz zbic "backports.zstd; python_version < '3.14'"
2. Put your game in a folder: the game, plus its update and DLC if you have them (.nsp, .xci, .nsz or .xcz):
~/Games/MarioWonder/
Super Mario Bros. Wonder [010015100B514000][v0].nsp
Super Mario Bros. Wonder [010015100B514800][v327680].nsp
3. Build, with your game folder and your prod.keys:
python3 scripts/build_ipa_from_nsp.py ~/Games/MarioWonder -k ~/keys/prod.keys
The IPA appears in the game's folder. The first build takes 30–60 minutes and needs free disk space of about twice the game's size plus 10 GB; building again is much faster.
To play on the Mac instead, add --platform mac-app: you get a Mac app of the game to open from Finder. All options: The packing script in detail.
Install the IPA on your iPhone or iPad with a sideloading tool such as AltStore, Sideloadly or LiveContainer. If your tool offers Increased Memory Limit, turn it on: the bigger games need it.
Game too big to install? Build again with --romfs separate, and run the command the script prints once to copy the game files to your phone (Quick reinstalls).
Controls, saves and settings: Playing.
Games tested on Mac or iPhone. See the per-game notes for tested platforms, progress and known issues:
Needs iOS / iPadOS 26 or later on an iPhone 15 Pro or newer (A17 Pro chip or later) or an iPad with an M1 chip or later: the games' textures are BC-compressed, and older iPhones can't read that format. Other games aren't supported yet. For them the script writes a survey and still tries its best to pack an IPA, guessing the game's settings; such an IPA may not start.
Under a game, "60 fps with 1.2.0" means it runs at 60 fps (30 on the Switch) with that update.
How it works · Game notes · Bring-up and debugging · Front ends · Contributing
nxnative started from d2r-mobile (MIT), which developed this native-execution approach for Diablo II: Resurrected: its NSO rewriter, Horizon host, NVN-on-Metal layer and iOS app shell. Fixes go both ways. It also builds on Ryujinx (MIT; its shader translator, in dm/third_party/ryujinx with a few fixes, and a reference for system services), Atmosphère (Horizon's synchronization semantics), yuzu (Maxwell encodings, kernel cross-checks), LibHac and hactool (reading NSPs), SPIRV-Cross and glslang (shaders to Metal), deko3d (zlib; texture layout sizes), libvpx, stb_vorbis, the Vulkan headers and NVIDIA FLIP (licenses), and Capstone, lz4, fontTools and XcodeGen in the build.
MIT (LICENSE). Third-party code keeps its own license (dm/third_party).
This fork is provided as is, without warranty of any kind. It will not be kept up to date with upstream nxnative, and issues and pull requests will not be reviewed or merged. You are free to fork it, copy it and take whatever you find useful from it, under the MIT license above.





















































































































