Garigari [![Build Status]][actions] ![SB4E01_Code]![SB4E01_Link] [![Discord Badge]][discord] ============= [Build Status]: https://github.com/SMGCommunity/Garigari/actions/workflows/build.yml/badge.svg [actions]: https://github.com/SMGCommunity/Garigari/actions/workflows/build.yml [SB4E01_Code]: https://decomp.dev/SMGCommunity/Garigari/SB4E01.svg?mode=shield&measure=code&label=SB4E01 [SB4E01_Link]: https://decomp.dev/SMGCommunity/Garigari/SB4E01.svg?mode=shield&measure=complete_code_percent&label= [Discord Badge]: https://img.shields.io/discord/727908905392275526?color=%237289DA&logo=discord&logoColor=%23FFFFFF [discord]: https://discord.gg/ZxEqyYeZbf [progress_link]: https://decomp.dev/SMGCommunity/Garigari [A visual][progress_link] A work-in-progress decompilation of Super Mario Galaxy 2. This repository does **not** contain any game assets or assembly whatsoever. An existing copy of the game is required. This project is **not** meant to be an effort to create a PC port. Join the Discord server to learn more and ask about our work-in-progress PC port "AstroCore". > [!NOTE] > AI may be used for code cleanup, formatting, documentation, and naming assistance. AI-generated decompilation work is not allowed. Pull requests containing obvious AI-generated decompilation output or other AI slop will be rejected. Contributors should be able to explain and justify any decompilation work they submit. This also applies to all tool-generated code. We want to keep this project as human as possible. Supported versions: - `SB4E01`: Rev 0 (USA) Dependencies ============ Windows -------- On Windows, it's **highly recommended** to use native tooling. WSL or msys2 are **not** required. When running under WSL, [objdiff](#diffing) is unable to get filesystem notifications for automatic rebuilds. - Install [Python](https://www.python.org/downloads/) and add it to `%PATH%`. - Also available from the [Windows Store](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K). - Download [ninja](https://github.com/ninja-build/ninja/releases) and add it to `%PATH%`. - Quick install via pip: `pip install ninja` macOS ------ - Install [ninja](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages): ```sh brew install ninja ``` [wibo](https://github.com/decompals/wibo), a minimal 32-bit Windows binary wrapper, will be automatically downloaded and used. Linux ------ - Install [ninja](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages). [wibo](https://github.com/decompals/wibo), a minimal 32-bit Windows binary wrapper, will be automatically downloaded and used. Building ======== - Clone the repository: ```sh git clone https://github.com/SMGCommunity/Garigari.git ``` - Using [Dolphin Emulator](https://dolphin-emu.org/), extract your game to `orig/GAMEID`. ![](assets/dolphin-extract.png) - To save space, the only necessary files are the following. Any others can be deleted. - `sys/main.dol` - Configure: ```sh python configure.py ``` To use a version other than `GAMEID` (USA), specify it with `--version`. - Build: ```sh ninja ``` Diffing ======= Once the initial build succeeds, an `objdiff.json` should exist in the project root. Download the latest release from [encounter/objdiff](https://github.com/encounter/objdiff). Under project settings, set `Project directory`. The configuration should be loaded automatically. Select an object from the left sidebar to begin diffing. Changes to the project will rebuild automatically: changes to source files, headers, `configure.py`, `splits.txt` or `symbols.txt`. ![](assets/objdiff.png) Credits ======= Big thanks to the [doldecomp team](https://github.com/doldecomp/sdk_2009-12-11) for their efforts on bte, [tp](https://github.com/zeldaret/tp) for JSystem, and [ogws](https://github.com/doldecomp/ogws/tree/master), where this repository has sourced code and headers from.