Dependencies

May 30, 2026 · View on GitHub

Super Smash Bros Melee
Build Status Code Progress Data Progress Linked Progress Discord Badge

This repo contains a WIP decompilation of Super Smash Bros Melee (US).

Tip

The DOL this repository builds can be shifted! Meaning you are able to now add and remove code as you see fit, for modding or research purposes.

It builds main.dol:

VersionGame IDSHA-1
1.02GALE0108e0bf20134dfcb260699671004527b2d6bb1a45

Dependencies

Windows:

On Windows, it's highly recommended to use native tooling. WSL or msys2 are not required. When running under WSL, objdiff is unable to get filesystem notifications for automatic rebuilds.

  • Install Python and add it to %PATH%.
  • Download ninja and add it to %PATH%.
    • Quick install via pip: pip install ninja

macOS:

  • Install ninja:
    brew install ninja
    
  • Install wine-crossover:
    brew install --cask --no-quarantine gcenx/wine/wine-crossover
    

After OS upgrades, if macOS complains about Wine Crossover.app being unverified, you can unquarantine it using:

sudo xattr -rd com.apple.quarantine '/Applications/Wine Crossover.app'

Linux:

  • Install ninja.
  • For non-x86(_64) platforms: Install wine from your package manager.
    • For x86(_64), WiBo, a minimal 32-bit Windows binary wrapper, will be automatically downloaded and used.

Building

  • Clone the repository:
    git clone https://github.com/doldecomp/melee.git --depth=1
    
  • Using Dolphin Emulator, find your ISO and click Properties. Go to the Filesystem tab, right-click Disc - GALE01 and select Extract System Data. Choose orig/GALE01 of this repository.
    • To save space, only main.dol (and .gitkeep) are necessary. Other files can be deleted.
  • Configure:
    python configure.py
    
  • Build:
    ninja
    

Tooling

We use Python for our command line tooling. It is recommended that you use a virtual environment.

  1. Create a virtual environment.
    python -m venv --upgrade-deps '.venv'
    
  2. You'll need to activate it whenever you open a new shell.
    • Windows:
      .venv/Scripts/Activate.ps1
      
    • Linux/macOS:
      . .venv/bin/activate
      
  3. After that, you can install or update our packages with:
    pip install -r reqs/decomp.txt
    
  4. Now you can run decomp.py to decomp a function using m2c. Pass it -h to see all the options.
    python tools/decomp.py my_function_name
    

Modding

Coming soon.

Containers

Coming soon.

Diffing

Once the initial build succeeds, an objdiff.json should exist in the project root.

Download the latest release from 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.

Tip

It's recommended that you enable the Relax relocation diffs option under Diff Options.

Contributing

Contributions are welcome! If you're new to decomp, check out our Getting Started guide. Before opening a pull request, please read our contributing guidelines. If you're new to Git and don't know how to create a pull request, we encourage you to create an issue with your decomp.me link and a maintainer will add your code to the repository.

We're also happy to answer any questions in the #smash-bros-melee channel on Discord.

Gamecube/Wii Decompilation Discord

FAQ

How is the codebase structured?

The code in src is divided into several modules, the main one being melee, which is the game code.

melee

The main game code is divided into several two-letter folders, which were left behind by HAL in assert messages and game data on the original disc.

ShortFullNotes
cmCamera
dbDebug
efEffectVisual effects.
ftFighterThe player characters.
gmGameThe main game loop.
grGroundStages and other levels.
ifInterfaceUser interface.
itItems
lbLibraryUtility functions that are often thin wrappers around dolphin or baselib code.
mnMenu
mpMapRelated to stages and contains things like mpcoll (map collisions).
plPlayerAs in users.
scSceneMenu, versus mode, single-player, etc. The game mode.
tyToyTrophies.
viVisualCutscenes, etc.

melee/ft/chara

HAL also used two-letter abbreviations for each fighter.

ShortFullCanonical English
BoZako1 BoyMale wire frame
CaCaptainCaptain Falcon
ChCrazy Hand
ClChild LinkYoung Link
CoCommonShared code
DkDonkey Kong
DrDr. Mario
FcFalco
FeFire EmblemRoy
FxFox
GkGiga KoopaGiga Bowser
GlZako GirlFemale wire frame
GnGanondorf
GwMr. Game & Watch
KbKirby
KpKoopaBowser
LgLuigi
LkLink
MhMaster Hand
MrMario
MsMarsMarth
MtMewtwo
NnNana
NsNess
PcPichu
PePeach
PkPikachu
PpPopo
PrPurinJigglypuff
SbSandbag
SkSeakSheik
SsSamus
YsYoshi
ZdZelda

1 Zako (雑魚) is Japanese for "trash mob" in video games, literally "small fish."

sysdolphin/baselib

HAL's core internal library.

ClassFull
AObjAnimation
CObjCamera
DObjDraw/Display
FObjFrame
GObjGlobal/Game
JObjJoint
LObjLight
MObjMaterial
PObjPolygon
TObjTexture
RObjReference
SObjScene
WObjWorld

dolphin

The Dolphin SDK.

MetroTRK

The Metrowerks Target Resident Kernel.

MSL

The Metrowerks Standard Library.

Runtime

The Gekko hardware runtime.

What can be done after decompiling Melee?

Note that this project's purpose is to only match the ASM with C code. This is entirely for research and archival purposes. After this is created, you essentially have a C project that can be compiled into Melee, but it won't be portable (aka you can't compile it to run on a normal computer).

So creating mods would be a lot easier as C code is much easier to consume than ASM. However, there are additional projects that could be undertaken once this is complete, but those technical endeavours are out-of-scope for this repo.

Do we know how the compiler works?

  • Kind of. We don’t have its source though.

How do we get the compiler to pick a certain register allocation?

Considering we don't have the source for the compiler, this is kind of "anything goes" territory. Unfortunately register allocation is an NP-hard problem which means there are all types of heuristics you can use to select registers, some of which can be confused by things as silly as variable names.

One option is to attempt to automatically permute the source code to get the correct register allocation.