Skip to content

NSMBW-Community/NSMBW-Decomp

Repository files navigation

NSMBW-Decomp

Progress badge DOL Progress badge d_profileNP Progress badge d_basesNP Progress badge d_en_bossNP

A decompilation project of New Super Mario Bros. Wii, based on the PALv1 binaries.

Quick links

Overview

The build essentially consists of 3 steps:

1. Compilation

All source files get compiled and the corresponding object files placed in bin/compiled/.

2. Slicing

Since most of the binary does not yet have a corresponding decompiled source file, in order to produce a 1:1 match for the generated binaries, these parts must be extracted from the original files. The slices generate object files in bin/sliced/ from the slice information files in slices/.

3. Linking and rebuilding

All compiled object files and the remaining sliced object files are linked together to form the final object file, which is then converted into .dol or .rel.

Other relevant files

  • alias_db.txt: Contains relocation helpers for rebuilding the .rel files.
  • syms.txt: Contains known symbol names for main.dol. Will eventually be replaced by a proper symbol map.

Setup

  1. Obtain main.dol and the four .rel.LZ files from a dumped PALv1 disc of NSMBW (a tutorial to do so can be found here).
  2. Use tools/uncompress_lz.py to decompress the .rel.LZ files to .rel.
  3. Rename main.dol to wiimj2d.dol, then place it along with the four decompressed .rel files in original/.
  4. Ensure that the checksums match:
$ md5sum original/*
17096d0ed441d44a0c31039138a8d7f8  original/d_basesNP.rel
f8cffd634edbec6c1bc210dab02c1e32  original/d_en_bossNP.rel
458f1aa94706dde1a8f2f9d97ff1f35c  original/d_enemiesNP.rel
393bf12ef4254dd1ea1366d5b06fbebb  original/d_profileNP.rel
ddab9e5dca53d8c18bf4051b927e822e  original/wiimj2d.dol
  1. Obtain the CodeWarrior for Embedded PowerPC binaries from here and place the contents of the zip file in compilers/. The path to the compiler that will actually be used should be compilers/Wii/1.1/mwcceppc.exe.
  2. Run ./build.py to compile the sources and generate the output binaries.
  3. Optionally, run ./progress.py --verify-bin to ensure the output binaries match the originals.