Skip to content
← All articles
Project introduction

Porting sm64coopdx to Switch and New 3DS: keep the platform boundary small

Listen to the audio story

One Mario 64 engine, two handhelds · 2:17 · AI-written script, synthetic voices

Transcript

Ava: Taking one game engine and teaching it to run on two very different handheld consoles sounds like it needs a huge rewrite. Antoine's approach was the opposite: keep the part that touches each console as small as possible.

Andrew: Which game are we talking about?

Ava: Super Mario 64, in its Coop Deluxe multiplayer version, sm64coopdx. Antoine's fork, sm64coopdx-switch-N3DS, brings it to the Nintendo Switch and the New 3DS. The multiplayer engine and Lua mods come from the Coop Deluxe Team, and his work is the console adapters around it.

Andrew: What does an adapter actually do?

Ava: Think of travel plugs. The game plays the same tune, and each console gets a plug that fits its own socket. The shared engine calls a set of platform functions, and each target fills them in for graphics, input, audio, threading and packaging.

Andrew: The New 3DS sounds like the harder one.

Ava: It's a graphics translation job. The backend implements the game's rendering API with Citro3D on the PICA200 chip, mapping common color combinations to the chip's own stages and handling textures, depth, blending and fog. It also reports the cases where the chip can't match an effect exactly.

Andrew: And the controls?

Ava: They're native. The Circle Pad moves Mario, the C-Stick moves the camera, and the touch screen works too. The top screen is four hundred by two forty and the bottom one is three twenty by two forty. Audio runs through NDSP with bounded buffers.

Andrew: Is there a rule that keeps the two ports from tangling?

Ava: Yes, a neat one. The New 3DS target must add no libctru, Citro3D or devkitARM dependency to the desktop or Switch builds. Separate Docker compose files and build folders keep the toolchains apart. There are even small smoke builds, one for the platform shell and one for the full game.

Andrew: And the Switch side?

Ava: It covers CoopNet, local wireless, an in-game keypad, crash diagnostics and packaging. You bring your own legally obtained North American ROM. The takeaway is a clean design habit: share the engine, shrink the platform layer. The full write-up has the diagram and the source links.

Table of contents

The interesting part of a console port is rarely a single compiler flag. sm64coopdx-switch-N3DS brings the Coop Deluxe engine to two very different handheld targets. The work lives at the platform boundary: graphics, input, audio, threading, and packaging.

This fork builds on the Coop Deluxe Team’s sm64coopdx, which continues djoslin0’s sm64ex-coop. The multiplayer engine and Lua ecosystem are upstream work; the console adapters are the focus here.

1. One engine, different platform services

flowchart TD
  E["Shared CoopDX engine and Lua mods"] --> A["Platform APIs"]
  A --> S["Switch target"]
  A --> N["New 3DS target"]
  S --> SI["Switch controller backend"]
  S --> SN["Switch packaging and networking"]
  N --> G["Citro3D / PICA200 renderer"]
  N --> I["Circle Pad, C-Stick and touch"]
  N --> AU["NDSP audio and libctru threads"]

The repository’s New 3DS port notes[1] explicitly require that desktop and Switch builds gain no libctru, Citro3D, or devkitARM dependencies from the new target. That is the architectural constraint worth preserving.

2. New 3DS is a graphics translation problem

The New 3DS backend implements CoopDX’s rendering API through Citro3D and PICA200. It translates common color-combiner paths into TEV stages, handles texture swizzling, depth, scissor, blending, and fog, and reports degraded combiner cases.

That last point matters. A backend that compiles is not automatically a faithful renderer. Explicit diagnostics tell you where the target GPU cannot represent an effect in the initial implementation.

The hardware foundation also separates the 400×240 top screen from the 320×240 bottom screen. Native controls map Circle Pad movement and C-Stick camera input. NDSP uses bounded buffers for stereo PCM16 audio.

3. Build the shell before the game

There are two New 3DS paths: a small platform shell in Makefile.new3ds, and full-game integration in Makefile.new3ds-game.

make -f Makefile.new3ds port-smoke -j2
make -f Makefile.new3ds-game new3ds-integration-smoke -j2

These are documented compile checks, not commands I ran as part of writing this article. Separate Docker compose files and build subtrees keep the Switch and New 3DS toolchains apart.

4. Release files do not settle hardware status

The README links a New 3DS release, while the detailed port notes still say not to call the port playable and describe hardware gameplay as unverified. Those signals should be read together: an artifact exists, but that alone does not establish stability or full multiplayer compatibility.

Switch documentation covers CoopNet, local wireless, an in-game keypad, crash diagnostics, and packaging. Consult the Switch installation guide[2] for current instructions.

Builds require your own legally obtained North American SM64 ROM. This article supplies no ROM or extracted game assets.

5. Source trail

References

  1. antoinebou12. (). New 3DS port notes. [Source file or documentation] github.com.
  2. antoinebou12. (). Switch installation guide. [Source file or documentation] github.com.
  3. antoinebou12. (). sm64coopdx-switch-N3DS. [Software repository] github.com.
  4. antoinebou12. (). Switch build notes. [Source file or documentation] github.com.
  5. antoinebou12. (). Switch controller adapter. [Source file or documentation] github.com.

References use this article’s publication date.