New Super Mario Bros. 2 Recompiled — Linux build

New Super Mario Bros. 2 Recompiled is an experimental Linux port of the Nintendo 3DS game built on the RecompOne project.

README

New Super Mario Bros. 2 Recompiled — Linux build

Experimental native x64 port of the European Nintendo 3DS release (CTR-P-ABEP), built on Linux and played through Proton or Wine. The build translates the original ARM and Thumb code to C and cross-compiles it for x64 with LLVM-MinGW; it reads the original game resources from your own cartridge image.

The port itself is Okxmir/new-super-mario-bros-2-recompiled (MIT). Its official builder is Windows-only (MSVC / PowerShell). This repository carries the same source snapshot plus the Linux build chain, so the game can be built and played here.

No game files are here. The game's code is recompiled from your own decrypted European cartridge.

Quick start

  1. You need Linux x64, your own decrypted European .3ds image, python3 with Pillow and pypng, cmake (3.24+), ninja, curl, unzip, tar and xz, about 7 GB free disk, and internet access for the first build. Proton (Steam) or Wine to play. Details in BUILD.md.

  2. Put the cartridge image in roms/ next to these files, or name it in rom.txt, or pass it.

  3. Run:

    ./play.sh -rom "/path/New Super Mario Bros. 2 (Europe).3ds"
    

    The first run downloads the pinned toolchain and dependencies, recompiles the game and builds it (several minutes); later runs start the game straight away.

  4. The playable folder is work/dist. Run it again any time, or ./build.sh --rom ... to only build.

With RecompLauncher

The release ships recomplauncher.json, so the launcher sets the game up itself: pick your cartridge on the game's page, its setup step recompiles it (progress shown), and Play starts the built game. Settings in the launcher: internal resolution, scaling, widescreen, HUD size, volume, language, plus VSync, frame interpolation and fullscreen under Advanced. Add the repository with add a recomp by link if it isn't in the store yet.

Default controls

3DS inputKeyboard and mouseXbox controllerPlayStation controller
Circle PadW, A, S, D (Z, Q, S, D on AZERTY)Left stickLeft stick
D-PadArrow keysD-PadD-Pad
AKBCircle
BJACross
XIYTriangle
YUXSquare
LQ (A on AZERTY)LBL1
RERBR1
ZL1 (number row)LTL2
ZR3 (number row)RTR2
StartEnterMenuOptions
SelectBackspaceViewShare / Create
Touch screenLeft-click or drag on the lower screen
PC shortcuts
ShortcutAction
Tab or right stick click (R3)Swap the two screens
F5Cycle adaptive layouts for the current scene in single-screen mode
F6Toggle adaptive layout
F7Toggle widescreen
F8Toggle picture-in-picture
F9Toggle single-screen mode
F10Start or stop dumping textures for debugging
F11Toggle fullscreen
F12Take a screenshot and save diagnostic logs

Upscaling

Open Upscaling below the window title (or the launcher at F1) to choose 1×, 2×, 3× or 4× rendering, and the scaling filter. The choice is saved in work/dist/userdata/settings.ini. On a 4K display, resolution=4 with filter=1 (smooth) looks sharp and still runs at full speed on a mid-range GPU.

The Linux build

build.sh is the Linux equivalent of the project's scripts/prepare.ps1 + build_game.ps1 + package.ps1: same stages, same pinned versions and SHA-256 hashes, only the host-side tools differ.

Upstream (Windows)Here (Linux host)
llvm-mingw-20260616-ucrt-x86_64llvm-mingw-20260616-ucrt-ubuntu-22.04-x86_64 + cmake/llvm-mingw-toolchain.cmake
Rust 1.100.0 x86_64-pc-windows-gnullvm builds recomp.exe/ctrx.exeLinux Rust 1.100.0 builds recomp/ctrx as host tools (memmap2 needs libc on unix)
SDL3-devel-3.4.0-VC.zipofficial SDL3-devel-3.4.0-mingw.zip, with a cmake/SDL3Config.cmake shim for the pinned path
dxc.exe compiles the LCD shaderlinux_dxc 1.8.2505.1 at the same pinned path
embedded Python + wheelshost Python + Pillow/pypng

All of it is pinned in scripts/fetch-deps.sh. The cartridge code.bin SHA-256 is checked, so a wrong region or revision is refused instead of producing a broken build.

Repository layout

build.sh                     the Linux builder (all stages)
play.sh                      RecompLauncher / player entry point (build once, then play)
scripts/fetch-deps.sh        pinned dependencies, versions and hashes
cmake/llvm-mingw-toolchain.cmake
source/                      the port's source (upstream snapshot, MIT, unmodified)
work/                        created by the build: toolchain, generated code, dist/ (git-ignored)

Legal

This repository contains the port's source (MIT) and build scripts only: no game code and no game data. Recompiling requires your own legally obtained copy of New Super Mario Bros. 2 (European release). Nothing is uploaded from your machine.

The port is by Okxmir and contributors (MIT); the recompiler runtime is Clockwork by watchmakerers (MIT); SDL3, Xbyak, LLVM-MinGW and DXC keep their own licences, copied next to the built game and in source/licenses/. See LICENSE and NOTICE.md.