77cfd399d0
* starting * a bunch * and another bunch * a bunch * Match func_800EB1DC * func_800EB4B4 * func_800EB6F8 * 2 more * fix prototype of a random kankyo function * func_800EBD60 non matching * func_800EC678 matched? * func_800EC6D4 * break * func_800ECD7C * A bunch of functions * func_800EE200 * func_800EDF78 and func_800EE0CC * func_800EDBE0 NON_MATCHING * Cutscene_Init NON_MATCHING * func_800EA324 NON_EQUIVALENT * Fix warnings * func_800EC924 NON_EQUIVALENT * Cutscene_ProcessCommands NON_EQUIVALENT * Format * Split z_demo data and import it * Import bss * Match func_800EB364 * Rename Cutscene_Command_SetTime * Improve Cutscene_ProcessCommands a bit (still not equivalent, probably) * Improve Cutscene_ProcessCommands thanks to engineer and anon * Cutscene_ProcessCommands NON_MATCHING * Name some commands * Fix * Renames based on Engineer knowledge of Audio stuff * More command names * Cutscene_Command_GiveTatlToPlayer * Some cutscene commands macros * more command macros * Macros for unknown commands * Improve Cutscene_Command_Textbox a bit * Rename stuff * Name Terminator and Camera * MOTIONBLUR * Macros for textbox commands * CS_PLAYER_ACTION_LIST * A few macro renames * Small cleaning * A bit more of cleanup * Rumble * Entrance comments in func_800EB6F8 * Some var renames * CS_CMD_FADESCREEN * More clean up * Clean functions protos * Move CutsceneStateHandler out of z64.h * Cutscene_DoNothing * Cutscene_IsPlayingCs & Cutscene_GetSceneSetupIndex * And more renames * name some stuff in the cutscenecontext struct * npcActionIndex->actorActionIndex * Undo names of CS_STATE_ enum * Name Cutscene_ActorTranslate family of functions * small docs pass * sfxconvert and format * Hopefully last cleanup * Add some missing functions to actorfixer * Fix merge issues and remove trailing commas * Cutscene commands fix * Cutscene_Command_Misc improved by engineer * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Address review * bss * Match Cutscene_Command_Textbox by anon58 * Fix merge issues * Match Cutscene_Command_Misc by @hensldm * review * float time macros * fix merge issues * format * Fix building assets * fix merge issues * format * Fix * format * fix merge issues * fix * fix * format * fix issues and run format * bss * Fix conflicts, bss and formatter * Update include/functions.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/functions.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/z64.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/z64cutscene.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/z64cutscene.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/z64cutscene.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * address review and fix some stuff * fix merge problems * more fixes and format * Fixes * Update include/functions.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update include/functions.h Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_demo.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Engineer suggestions * format * Elliptic review * Use dec for ShrinkWindow_SetLetterboxTarget * add a few comments * Cutscene_Command_ChooseCreditsScenes * Update src/code/z_demo.c Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * format * some cleanups and some comments * change actorActionCmd from hex to dec in the codebase * minor comment on textboxcmd * ahhhh * Update src/code/z_demo.c Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * brackets * minor comments * rewording * im dumb * brackets * another bracket * Dawn of the New Day * Update src/code/z_demo.c Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * fixes * Cutscene_Command_TransitionFX by Anon Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> |
||
---|---|---|
.github | ||
assets | ||
docs | ||
include | ||
src | ||
tools | ||
.clang-format | ||
.clang-tidy | ||
.gitattributes | ||
.gitignore | ||
checksum_uncompressed.md5 | ||
checksum.md5 | ||
CONTRIBUTING.md | ||
diff_settings.py | ||
diff.py | ||
extract_assets.py | ||
first_diff.py | ||
fixle.sh | ||
format.sh | ||
Jenkinsfile | ||
Makefile | ||
README.md | ||
requirements.txt | ||
REVIEWING.md | ||
spec | ||
sym_info.py | ||
undefined_syms.txt |
Legend of Zelda: Majora's Mask (US) 1.0
- WARNING! -
The ROM this repository builds while has a matching checksum cannot be 'shifted' due
to hardcoded pointers which have yet to be dumped. Thus this repository is currently
in an experimental and research phase and cannot currently be used traditionally as a
source code base for general changes.
This is a WIP decompilation of The Legend of Zelda: Majora's Mask. The purpose of the project is to recreate a source code base for the game from scratch, using information found inside the game along with static and/or dynamic analysis. It is not producing a PC port. For more information you can get in touch with the team on our Discord server.
The only build currently supported is N64 US, but other versions are planned to be supported.
It currently builds the following ROM:
- mm.us.rev1.rom.z64
md5: 2a0a8acb61538235bc1094d297fb6556
This repo does not include any assets or assembly code necessary for compiling the ROM. A prior copy of the game is required to extract the required assets.
Please refer to the following for more information:
Installation
Windows
For Windows 10, install WSL and a distribution by following this Windows Subsystem for Linux Installation Guide. We recommend using Debian or Ubuntu 20.04 Linux distributions.
MacOS
Preparation is covered in a separate document.
Linux (Native or under WSL / VM)
1. Install build dependencies
The build process has the following package requirements:
- make
- git
- build-essential
- binutils-mips-linux-gnu
- python3
- pip3
- libpng-dev
Under Debian / Ubuntu (which we recommend using), you can install them with the following commands:
sudo apt update
sudo apt install make git build-essential binutils-mips-linux-gnu python3 python3-pip libpng-dev
To install the Python dependencies simply run in a terminal:
python3 -m pip install -r requirements.txt
2. Fork the repository
Create your own fork of the repository at https://github.com/zeldaret/mm
. Then clone your fork where you wish to have the project, with the command:
git clone https://github.com/<YOUR_USERNAME>/mm.git
3. Prepare a base ROM
Copy your ROM to inside the root of this new project directory, and rename the file of the baserom to reflect the version of ROM you are using. ex: baserom.mm.us.rev1.z64
4. Make and Build the ROM
To start the extraction/build process, run the following command:
make init
This will extract all the individual files in the ROM into a newly created baserom folder, as well as decompress the compressed files in a newly created decomp folder. This will create the build folders as well as a new folder with the ASM as well as containing the disassemblies of nearly all the files containing code.
This make target will also build the ROM. If all goes well, a new ROM called "mm.us.rev1.rom.z64" should be built and the following text should be printed:
mm.us.rev1.rom.z64: OK
If you instead see the following:
mm.us.rev1.rom.z64: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
This means that something is wrong with the ROM's contents. Either the baserom files are incorrect due to a bad ROM, or some of the code is not matching.
Running make init
will also make the ./expected
directory and copy all of the files there, which will be useful when running the diff script. The diff script is useful in decompiling functions and can be ran with this command: ./tools/asm-differ/diff.py -wmo3 <insert_function_here>
Note: to speed up the build, you can pass -jN
to make setup
and make
, where N is the number of threads to use in the build, e.g. make -j4
. The generally-accepted wisdom is to use the number of virtual cores your computer has, which is the output of nproc
(which should be installed as part of coreutils
).
The disadvantage that the ordering of the terminal output is scrambled, so for debugging it is best to stick to one thread (i.e. not pass -jN
).
(-j
also exists, which uses unlimited jobs, but is generally slower.)
Contributing
All contributions are welcome. This is a group effort, and even small contributions can make a difference. Some tasks also don't require much knowledge to get started.
Please note that is is our strict policy that Anyone who wishes to contribute to the OOT or MM projects must not have accessed leaked source code at any point in time for Nintendo 64 SDK, iQue player SDK, libultra, Ocarina of Time, Majora's Mask, Animal Crossing/Animal Forest, or any other game that shares the same game engine or significant portions of code to a Zelda 64 game or any other console similar to the Nintendo 64.
Most discussions happen on our Discord Server, where you are welcome to ask if you need help getting started, or if you have any questions regarding this project and other decompilation projects.
For more information on getting started, see our Contributing Guide and our Code Review Guidelines to see what code quality guidelines we follow.
FAQ
Q: Why does MM use transient assembly?
A: It is the view of the MM project leads that transient asm is safer than storing the disassembly in the repo. We feel like the C code is more transformative than a straight disassembly.