Petari: Super Mario Galaxy Decompilation Brings the Wii Masterpiece to Matching C++

The open-source project Petari by the SMGCommunity is actively decompiling Nintendo's 2007 Wii masterpiece Super Mario Galaxy into byte-matching C++, laying the essential groundwork for preservation and future ports.

Petari: Super Mario Galaxy Decompilation Brings the Wii Masterpiece to Matching C++

Considered by critics and players alike to be one of the greatest 3D platformers ever conceived, Nintendo’s 2007 Wii masterpiece Super Mario Galaxy is officially being reverse-engineered down to the bare metal. The open-source preservation effort Petari, developed by the SMGCommunity, is actively decompiling the game’s original PowerPC machine code into clean, readable, byte-matching C++.

Following the transformative footsteps of previous milestone decompilations like Super Mario 64, The Legend of Zelda: Ocarina of Time, and Twilight Princess, Petari seeks to decode every intricate system that made Nintendo EAD Tokyo’s cosmic platformer a technical marvel—from its mind-bending spherical gravity equations to its dynamic orbital camera and actor architectures.


Matching Decompilation vs. PC Port: Understanding the Milestone

In the project's documentation, the SMGCommunity makes an important clarification: Petari is currently a matching decompilation project, not an immediate plug-and-play PC port.

However, within the retro gaming preservation sphere, matching decompilations are the essential foundational bedrock upon which modern ports are built:

  • Byte-for-Byte Accuracy: A matching decompilation takes the compiled binary (specifically the RMGK01 Korean release's main.dol) and recreates the exact C++ source code that, when fed into the original Metrowerks CodeWarrior compiler, outputs an identical byte-for-byte binary match.
  • Unlocking the Engine: Once the game logic, JSystem framework extensions, audio drivers, and physics routines are mapped to clean C++, developers gain complete transparency into the engine.
  • The Stepping Stone to Native Ports: Projects like Ship of Harkinian (Ocarina of Time) and the Super Mario 64 PC Port only became possible after the underlying matching decompilations achieved critical mass. Petari represents that exact indispensable first stage for Super Mario Galaxy.

A Stand for Human Craft: Addressing the AI Rumors

As Petari saw rapid acceleration in merged pull requests and mapped function symbols, speculation began circulating across social media claiming that the project was being driven by automated generative AI and LLMs.

The development team tackled these rumors head-on, setting an industry benchmark for transparency and human-led engineering:

"A lot of discussion and accusations have been made saying we used AI/LLMs to accelerate the decompilation process. We did not. Although AI was allowed for tasks that did not directly affect progress, such as variable naming, cleanup, and documentation, it never ended up playing a role in this project. The quick acceleration was a result of new collaborators, a ton of motivation, and great community efforts."

The repository enforces strict anti-"AI slop" contribution policies: pull requests containing unverified automated decompilation output are rejected, and human contributors must be able to thoroughly explain and justify every assembly match they submit.


Modern Toolchain & Cross-Platform Building

Petari decompilation progress and matching assembly diffs via objdiff
Petari decompilation progress and matching assembly diffs via objdiff — View on GitHub

Built with modern reverse-engineering infrastructure, Petari provides a smooth developer experience across all major desktop environments:

  • Modern Diffing via objdiff: Integrates seamlessly with objdiff, allowing reverse-engineers to inspect live assembly differences in real-time as they edit C++ source code.
  • Native Windows Support: Requires no WSL or msys2 virtualization overhead; builds natively via Python and Ninja.
  • macOS & Linux Compatibility: Automatically downloads and utilizes wibo—a high-performance, lightweight 32-bit Windows binary wrapper—to execute legacy CodeWarrior compilers seamlessly on POSIX systems.
  • Collaborative Foundations: Borrows key headers, JSystem implementations, and tooling from the doldecomp team and the Twilight Princess decompilation (zeldaret/tp).

In accordance with strict legal preservation guidelines, Petari distributes zero proprietary Nintendo assets, textures, copyrighted audio, or extracted assembly. Contributors and developers extract their own main.dol executable from a legally dumped copy of the game using the Dolphin Emulator.