7c93d5e125
* deimplementation complete * newlines * match * data import * back port cleanup changes * stuff * naming and such * all funcs provisionally named * more stuff * merge * Fix merge issues * begin cleanup * Use constants for all face animation data * Use THIS like almost every actor does * Change "Light Ball" to "UFO" * Rename the alien types * EnInvadePoh -> EnInvadepoh * Rename the types * Rename some Twinmold stuff * ConfusedRomani -> SilentRomani * Fix stack size issues with EnInvadepoh_Cremia_Init * Move a struct out of the header to where it belongs * Some header cleanup and struct names * Name remaining struct vars * Some more struct var renames * Finish reviewing the struct var names * Rename most of the interactInfo stuff * Consistency * Remove unused union * Define EN_INVADEPOH_LIMB_MAX like EndingHero6 does * Fix header * Update functions.txt and variables.txt * Create macros for accessing spawn time and kill count * Some defines * Some minor comments and cleanup * Rename some functions * Comments for those three functions * Draw function cleanups * Some damaged and dead cleanup * Death scale stuff * Good chunk of alien functions * Invasion state naming * Weekeventreg naming * Happy with >20% of functions now * A couple more functions * More consistent names for BSS variables * Some Init cleanup * Happy with 30% of the functions now * Finish the abductors * Some random functions to get the functions I'm happy with >1/3rd * Use `InitPath` for everything * UFO functions done, >40% functions I'm happy with * Do a lot of work on InvasionHandler action funcs * Finish invasion handler code * InitVars * Rename the "closest alien" stuff to "closest alien threat" * Finish most of the dog functions * Lots of small stuff here and there * Finish documenting the dog bug * Document `EnInvadepoh_Dog_IsCloseToPath` * `EnInvadepoh_Dog_MoveAlongPath` and other fixes * Simple comment for `EnInvadepoh_Dog_Move` * Various path functions, finish dog * Consistently use "SetMatrixTranslation" * Change all the angleToPlayer stuff to pitch/yaw * Some RewardRomani functions * Finish RewardRomani * Finish Night1Romani and BarnRomani, >75% of functions done * Some minor stuff * Document bug * Finish all of SilentRomani minus the Idle functions * Finish EnInvadepoh_SilentRomani_Idle * Finish Night3Cremia * Finish Night3Romani * Finish `EnInvadepoh_Ufo_SpawnSparkles` * Finish some library functions * Finish the alien pathing stuff * Finish Romani path stuff * Finish all non-InteractInfo stuff * InteractInfo -> ModelInfo * Create a `EnInvadepohFaceAnimBase` struct * Name some of the animation data * Switch to `Chained`/`ChainedDelay` and do some other cleanup * Name all of the animation data * Finish documenting and cleaning up the face animation functions * Some comments at the top of the file * Clean up forward declarations * Clean some stuff up to the ModelInfo functions * Fix build * Move the animation data around so all the ModelInfo functions are adjacent * Review * Use `CLOCK_TIME_MINUTE` in `EnInvadepoh_Alien_PathComputeProgress` * Respond to some of Anghelo's review * Update comment on spawn time macros explaining what indices are usable * Create a `DEATH_SCALE` define * `WEEKEVENTREG_RECEIVED_MILK_BOTTLE` -> `WEEKEVENTREG_RECEIVED_ALIENS_BOTTLE` * Forgot to do the bomber's notebook stuff too * parallelogram -> rectangle * Respond to engineer's review * Slight spacing fix --------- Co-authored-by: petrie911 <petrie911@users.noreply.github.com> Co-authored-by: petrie911 <pmontag@Monday.localdomain> Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: engineer124 <engineer124engineer124@gmail.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> |
||
---|---|---|
assets | ||
baseroms/n64-us | ||
docs | ||
include | ||
src | ||
tools | ||
.clang-format | ||
.clang-tidy | ||
.gitattributes | ||
.gitignore | ||
diff_settings.py | ||
diff.py | ||
Dockerfile | ||
extract_assets.py | ||
first_diff.py | ||
fixle.sh | ||
format.py | ||
Jenkinsfile | ||
Makefile | ||
README.md | ||
requirements.txt | ||
spec | ||
sym_info.py | ||
undefined_syms.txt |
Legend of Zelda: Majora's Mask (US) 1.0
- WARNING! -
This repository is a work in progress, and while it can be used to make certain changes, it's
still constantly evolving. If you wish to use it for modding purposes in its current state,
please be aware that the codebase could drastically change at any time. Also note that some
parts of the ROM may not be 'shiftable' yet, so modifying them could currently be difficult.
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, and will not, produce a PC port. For frequently asked questions, you can visit our website, and for more information you can get in touch with the team on our Discord server.
The only version currently supported is N64 US, but we intend to eventually support every retail version of the original game (i.e. not versions of MM3D, which is a totally different game).
It currently builds the following ROM and compressed ROM:
- mm-n64-us.z64
md5: f46493eaa0628827dbd6ad3ecd8d65d6
- mm-n64-us-compressed.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.
Docker
Preparation is covered in Building Docker.
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
- python3-pip
- python3-venv
- 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 python3-venv libpng-dev
2. Clone 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
This will copy the GitHub repository contents into a new folder in the current directory called mm
. Change into this directory before doing anything else:
cd mm
3. Prepare a base ROM
Place a copy of the US ROM inside the baseroms/n64-us/
folder.
Rename the file to baserom.z64
, baserom.n64
or baserom.v64
, depending on the original extension.
4. Make and Build the ROM
To start the extraction/build process, run the following command:
make init
The extraction/build process:
- Prepares build environment:
- Creates a Python virtual environment
- Downloads necessary tools from pip
- Compiles tools for the build process
- Extracts ROM contents:
- Decompresses the ROM
- Extracts individual files
- Extracts archive files
- Extracts assets:
- Extracts assets based on the XML files found in
assets/xml
- Extracts assets based on the XML files found in
- Disassembles code:
- Disassembles code-containing files
- Disassembles data (data, rodata, and bss)
- Builds the ROM:
- Compiles the code and assets into a new ROM
- Generates a compressed version of the ROM
If all goes well, the new ROM should be built at build/n64-us/mm-n64-us.z64
, a compressed version generated at build/n64-us/mm-n64-us-compressed.z64
, and the following text printed:
build/n64-us/mm-n64-us.z64: OK
and
build/n64-us/mm-n64-us-compressed.z64: OK
If you instead see the following:
build/n64-us/mm-n64-us.z64: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
or
build/n64-us/mm-n64-us-compressed.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 run 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 work also doesn'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 or ZeldaRET's other decompilation projects.
For more information on getting started, see our Contributing Guide, Style Guide and our Code Review Guidelines to see what code quality guidelines we follow.