How adriadam10/mkw-recomp works
mkw-recomp turns a player’s own Switch 2 dump into a native Linux or Windows game: the launcher prepares the dump, AArch64 code is statically lifted to C, SM86 shaders are translated ahead of time, and the runtime supplies guest system services while implementing NVN2 over Vulkan. The runtime also covers input, audio, files, menus, and platform support. The README documents the overall workflow and major capabilities; several internal runtime connections are supported by the source index’s import references rather than inspected call sites.
Main entry points: main.c Runtime entry · cfg.h Configuration · launcher_setup.cpp Game preparation · gen.py AArch64 generator
Components 22
Preparation and translation
- Launcher
runtime/ui/launcher/launcher.cpp - Game preparation
runtime/ui/launcher/launcher_setup.cpp - AArch64 generator
recomp/gen.py - NSO loader
recomp/nso.py - AArch64 lifter
recomp/lifter.py - SIMD lowering
recomp/simd_c.py - Shader extraction
tools/shaders/extract.py
Game runtime
- Runtime entry
runtime/core/boot/main.c - Guest CPU and kernel
runtime/cpu/cpu.h - Guest memory
runtime/core/memory/memory.c - Audio runtime
runtime/audio/audio_mixer.c - Host platform
runtime/platform/platform.h
Graphics and shaders
- SM86 decoder
sm86/decode/sass_decode.py - SM86 specification
sm86/decode/sass_spec.py - Shader translator
sm86/translate/program.py - NVN2 implementation
runtime/gfx/nvn/api/nvn_api_core.c - Vulkan backend
runtime/gfx/vk/pipe/vk_pipeline.c
Host services and UI
- Configuration
runtime/core/base/cfg.h - Filesystem services
runtime/sdk/fs/fs_host.c - Input services
runtime/input/input.c - Settings menu
runtime/ui/menu/menu.cpp
Other components
- Player
Connections 24
- Player → Launcher: opens
README.md - Launcher → Game preparation: prepares dump
README.md - Game preparation → AArch64 generator: generates C
README.md - Game preparation → Shader extraction: extracts shaders
README.md - AArch64 generator → NSO loader: loads modules
- AArch64 generator → AArch64 lifter: lifts code
- AArch64 lifter → SIMD lowering: lowers SIMD
recomp/lifter.py - Shader extraction → NSO loader: reads NSO
tools/shaders/extract.py - Shader extraction → Shader translator: feeds programs
README.md - Shader translator → SM86 decoder: decodes instructions
sm86/translate/program.py - SM86 decoder → SM86 specification: uses specification
sm86/decode/sass_decode.py - Runtime entry → Launcher: runs launcher
runtime/core/boot/main.c - Runtime entry → Configuration: initializes settings
runtime/core/boot/main.c - Runtime entry → Host platform: uses host layer
runtime/core/boot/main.c - Runtime entry → Guest CPU and kernel: boots guest
- Runtime entry → Guest memory: reserves memory
runtime/core/boot/main.c - Runtime entry → Audio runtime: starts game runtime
- Runtime entry → NVN2 implementation: runs game graphics
- NVN2 implementation → Vulkan backend: reimplemented over
README.md - Input services → Settings menu: feeds controls
runtime/input/input.c - Input services → Configuration: reads settings
runtime/input/input.c - Settings menu → Configuration: edits settings
runtime/ui/menu/menu.cpp - Settings menu → Filesystem services: uses files
runtime/ui/menu/menu.cpp - Filesystem services → Configuration: reads configuration
runtime/sdk/fs/fs_host.c