A multi-target decompilation of EarthBound (Mother 2) supporting modern PC platforms.
This project converts EarthBound's original assembly code to maintainable C code with cross-platform executable using SDL2 for modern systems
# Install dependencies (macOS)
brew install cmake sdl2 sdl2_image sdl2_mixer
# Build
mkdir -p build && cd build
cmake ..
make
# Run
./earthbound
# Switch to archived SNES build
git checkout snes-build-archive
# Prerequisites
# - CC65 compiler
# - Your own EarthBound ROM file as `donor.sfc`
# Build SNES ROM
make -f Makefile.phase1
ebsrc/
├── CMakeLists.txt # Modern PC build configuration
├── Makefile* # Legacy SNES build files
├── snes*.cfg # SNES memory layout configs
├── README.md # This file
├── DEVELOPMENT.md # Development guidelines
├── CLAUDE.md # AI assistant instructions
├── C89_CONVERSION_GUIDE.md # Legacy SNES conversion guide
│
├── src/ # Source code
│ ├── main.c # PC build entry point (NEW)
│ ├── platform/ # SDL2 abstraction layer (NEW)
│ │ ├── graphics.c/h # Graphics/rendering
│ │ ├── audio.c/h # Audio/music system
│ │ └── input.c/h # Input handling
│ ├── stubs.c # Temporary implementations (NEW)
│ ├── battle.c # Battle system (modernized)
│ ├── system.c # Core system functions (modernized)
│ ├── audio.c # Audio system (legacy)
│ ├── *.c # Other game systems
│ ├── battle/ # Battle ASM files
│ │ ├── *.asm # Unconverted ASM
│ │ └── *.converted.asm # Converted to C
│ └── */ # Other ASM directories
│
├── include/ # Header files
│ ├── platform/ # Platform abstraction headers (NEW)
│ ├── battle.h # Battle system
│ ├── structs.h # Game data structures
│ ├── hardware.h # Hardware definitions
│ └── *.h # Other headers
│
├── build/ # PC build output (NEW)
├── assets/ # Game assets (extracted ROM data)
└── tools/ # Build tools
- CMake-based cross-platform build system
- SDL2 platform abstraction layer
- Modern C11 code style migration
- Project structure organization
- Basic compilation pipeline
- Complete ASM to C conversion
- Implement missing game functions
- Asset loading system
- Graphics rendering pipeline
- Audio system implementation
- Input mapping and controls
- Save/load system
- Cross-platform distribution
- Location:
src/*.c
(main files) - Style: C11 with inline declarations
- Platform: SDL2 abstraction layer
- Build: CMake
- Location:
src/*/
subdirectories - Status: Being converted to C
- Naming:
.asm
= Needs conversion.converted.asm
= Successfully converted.critical.asm
= Never convert (SNES boot code)
- Location:
include/
- Organization:
platform/
= SDL2 abstraction- Root = Game systems and data structures
- README.md - This file - project overview and quick start
- DEVELOPMENT.md - Development guidelines and procedures
- CLAUDE.md - AI assistant instructions and conversion procedures
- C89_CONVERSION_GUIDE.md - Legacy SNES build technical reference
See DEVELOPMENT.md
for detailed development guidelines including:
- ASM to C conversion procedures
- Code style guidelines
- Testing procedures
- Platform compatibility requirements
This is a decompilation project for educational and preservation purposes. This project contains no copyrighted game data - users must provide their own ROM files for data extraction.