
z_camera
with Partial Docs (3 Non-Equivalent) (#601)
* more boot files * Add VT macros and script * finish already existing boot files * most of libultra * fix 64bits libultra files * Use C files for libultra, wrap some functions in NON_MATCHING * Remove duplicate of OS_CLOCK_RATE from fault.c * C files for fbdemos * delete dumb files * bootstrap C files, still need to add them to the spec * update fixbaserom * boot OK? * I forgot to commit the spec * C for gamestates * C for kaleido * Change all includes to "" * copy actor sizes script from oot * I forgot to delete those files * Basic C files for effects * Add effects initvars names * Remove mislabelled boot functions from header/txt * Begin porting bootstrap_fx, some sizes * Fix <> * Fix enum * Fix diff.py * fix libultra stuff * update regconvert * update setup warnings * add some missing ; * Fix some makefile stuff and other fixes on some non_matching functions * add executable flag in extract_baserom and fixbaserom * fix relative path * copy assist from oot * fix map path * another assist path fix * Delete C files for handwritten files * add code_801A51F0 to spec * add gfxbuffers to spec * Move rodata to top of each file when possible * UNK_TYPEs for func_801A51F0 * Remove kaleido rodata from spec * Update spec and undefined_syms for recent merge * GCC warnings and fix errors in nonmatchings, * round percentage numbers * progress script: format changes * progress: error on non-existing files * fix warning in z_scene_table * Match 2 nonmatchings in z_actor * Warnings in lightswitch and invadepoh * Fix warning in z_actor_dlftbls * I though I fixed this one * whoops * Comment out CC_CHECK * Removed redundant ultra64.h includes * Update asm_processor, sorted boot_O1 into other folders, completed the fbdemo bootstrap, cleaned up undefined_syms * Completed gamestates bootstrap * Split kaleido_scope * Remove section.h and segment.h, move keep object externs to a common location in variables.h * Completed effects bootstrap * Segmented address externs for effects, fbdemos, gamestates and kaleido * Move actor data externs out of the if 0 * Segmented address externs for actors * Prepare actionfunc detection * fix script, how did it even work before * Fix actionfunc script again, re-introduce some more intermediate prints to the disassembler * Automated actionFunc detection in actors * Segmented addresses from player .text * rm old segment addrs script and fix build * Move sizes folder to tools * Make build.py executable * New Jenkinsfile Prayge * Remove numpy dependencies * Add warnings_disasm_current.txt * my bad * Update spec and undefined_syms * Add z_eff_ss_hahen to pametfrog * git subrepo pull (merge) --force tools/z64compress subrepo: subdir: "tools/z64compress" merged: "163ca2af" upstream: origin: "https://github.com/z64me/z64compress.git" branch: "main" commit: "163ca2af" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Make z64compress print to stdout * sneeky commit to update warnings tooling * test * Another test * Mark fixing overlay reloc generating as a TODO * Update warnings stuff * Communicate the return code from running z64compress back to the Makefile through the wrapper * Run formatter, remove extra commented copy of function * Re-fix some includes * Convert atan to hex to conform to decided style * Clean up most matching with rodata and most warnings * Match Parallel1, minor improvement in Jump and KeepOn * Begin Documentation * More docs, fixed warnings * cleanup * Continuing with docs * Small progress * Fix BSS, All but 1 matching functions freed, continue docs * Fix merge * Many function names * More Names * Change name * Docs * Begin camera_data docs * small progress * Minor change * Improve docs on functions * Player to TrackActor, progress on camera_data * Add Cam_Data Macro and fix warnings * Progress on Camera_Data docs * Document CsCamData * Cleanup * Minor clean up in Battle NON_MATCHING * Small fixes * Fix bss, OK * typo * revert some z64 macros and format * OK * minor settings docs * Many flags, names, and other documentation * Name many camera_data variables * A few more small changes * Refactoring Camera Action Function Structs WIP * Finish Struct reworking * Some door docs * Add my findings of Camera Settings as comments * More camera data names and comments cleanup * A few names * Slow progress on camera_data * More camera_data progress, slow and steady * Many renaming * wip * camera_data WIP * The grind continues * More data wip * All the macros are in! * Format and cleanup * more docs * format * Breakup camera into pieces * format * PR Feedback round 1 * revert macro * Fix header * Document Play Camera and Screen pos * cleanup * revert camera split * Start copying docs from OoT * remaining CAM_INTERFACE_FLAGS * roData and rwData * Change paramData * Flags * More docs * More Cleanup * cleanup * more * More docs * Standardize subcams * macro * Player_UpdateCamAndSeqModes * cleanup from PR * format * sync with bgCam and actorsCsCam PR * sync to z_play cam PR * docs progress * revert player changes * helper function cleanup * match Jump3, thanks petrie & synray * camera bg docs * brackets * cam math docs * more cam bg docs * rename flags * misc docs * more cleanup * some cam docs * some PR * hud visibility * fix macros, sync with PR * sync with PR * sync with PR * helper cleanup * cleanup * PR Suggestions * more PR * fix merge master * PR review * add comment * more quake cleanup * pr suggestions --------- Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com> Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
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:
- 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.
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
- 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
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. Install python dependencies
The build process has a few python packages required that are located in requirements.txt
.
To install them simply run in a terminal:
python3 -m pip install -r requirements.txt
4. 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
5. 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 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.