# MarioGolf64Recomp A native PC port of Mario Golf (Nintendo 64) for Linux, built using [N64Recomp](https://github.com/N64Recomp/N64Recomp) and [N64ModernRuntime](https://github.com/N64Recomp/N64ModernRuntime). > **This project is a work in progress.** The game is not yet playable. ## Legal This project does not distribute any copyrighted content from the original game. You must own a legitimate copy of **Mario Golf (USA)** and provide the ROM yourself. ROM MD5: `903e6929666531d72d05d1e4c522e305` ## System Requirements - Linux (x86_64) - Clang 15 or newer (`clang++`, `clang`) - CMake 3.20 or newer - Ninja build system - Python 3 with pyelftools (`pip install pyelftools`) - Vulkan-capable GPU and drivers - SDL2 ## Setup This project requires output from two upstream repositories before it can be built. Follow these steps in order. ### Step 1: Build the ELF from the decomp repo ```bash git clone --recurse-submodules https://github.com/jebsmartt/mariogolf64 cd mariogolf64 # Place your Mario Golf (USA) ROM at the repo root as mariogolf64.z64 make extract && make ``` A successful build prints the ROM MD5: `903e6929666531d72d05d1e4c522e305` ### Step 2: Generate recomp output ```bash cd .. git clone --recurse-submodules https://github.com/jebsmartt/N64Recomp cd N64Recomp git checkout mariogolf pip install pyelftools --break-system-packages # Build N64Recomp mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . -j$(nproc) cd .. # Patch the ELF and run the recompiler python3 patch_elf.py cd build && ./N64Recomp ../mariogolf.toml ``` A successful run prints `Function count: 4677` with no errors. ### Step 3: Build the port ```bash cd ../.. git clone --recurse-submodules https://github.com/jebsmartt/MarioGolf64Recomp cd MarioGolf64Recomp cmake -B build \ -G Ninja \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_BUILD_TYPE=Release \ -DRECOMP_OUTPUT=../N64Recomp/recomp_output ninja -C build ``` The built executable will be at `build/MarioGolf64Recomp`. ## Directory Layout ``` MarioGolf64Recomp/ src/ Game-specific glue code and platform callbacks include/ Headers lib/ N64ModernRuntime/ Runtime library (ultramodern + librecomp) rt64/ Graphics renderer CMakeLists.txt ``` ## Architecture ``` recomp_output/ Recompiled game code (C, generated by N64Recomp) ↓ librecomp Bridges recompiled code to ultramodern ↓ ultramodern Reimplements libultra (threads, audio, controllers) ↓ platform callbacks Controller input, audio playback (src/) ↓ RT64 Graphics renderer (Vulkan) ``` ## Contributing See [DEVELOPMENT.md](DEVELOPMENT.md) for technical documentation covering the full pipeline, ELF patching rationale, and known limitations. ## Acknowledgements - [N64Recomp](https://github.com/N64Recomp/N64Recomp) by Mr-Wiseguy - [N64ModernRuntime](https://github.com/N64Recomp/N64ModernRuntime) by Mr-Wiseguy - [RT64](https://github.com/rt64/rt64) - [Zelda64Recomp](https://github.com/Zelda64Recomp/Zelda64Recomp) — reference implementation - [mariogolf64](https://github.com/jebsmartt/mariogolf64) decompilation contributors