6ce382bc8d
* Darkmeiro decompilation
Bg_Gnd_Darkmeiro decompiled, matched, and documented.
* give this a shot
* fix conflict
* one more try
* it begins
* more functions
* another match
* starting documentation
* the big function works. also two more matches
* small fix
* data cleanup
* removed .s
* match with player
* inching closer to matching
* two more matches. almost there
* OH MY GOD IT MATCHES
* cleanup: part 1 of infinity
* named a bunch of stuff
* Naming particle fields
* terminal commas
* terminal commas
* small enum fix
* added description of droplet widths
* merge
* updating
* Gfx
* vt
* xml
* bgcheck
* more on objects
* unused stuff
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "44f5d7cb9"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "44f5d7cb9"
git-subrepo:
version: "0.4.3"
origin: "https://github.com/ingydotnet/git-subrepo.git"
commit: "2f68596"
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "6f874af4a"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "6f874af4a"
git-subrepo:
version: "0.4.3"
origin: "https://github.com/ingydotnet/git-subrepo.git"
commit: "2f68596"
* object names
* fixes
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "6f874af4a"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "6f874af4a"
git-subrepo:
version: "0.4.3"
origin: "https://github.com/ingydotnet/git-subrepo.git"
commit: "2f68596"
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "0305ec2c2"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "0305ec2c2"
git-subrepo:
version: "0.4.3"
origin: "https://github.com/ingydotnet/git-subrepo.git"
commit: "2f68596"
* ZAPD works
* .s
* merge
* starting work
* more stuff
* builds OK
* first pass
* PR fixes (Louis)
* Bg_toki_hikari all functions matching (#781)
* starting toki_hikari
* func_808BA018 matched and some work on other func
* init and draw matched, one to go
* matched final function, removed ASM, updated spec
* adding suggested changes
* Volvagia (ovl_Boss_Fd) and related actors (#352)
* Darkmeiro decompilation
Bg_Gnd_Darkmeiro decompiled, matched, and documented.
* Lots of functions matched. Some big ones are close.
* Five left unmatched, one close.
* Merged data and decompiled the giant function into something readable. Its branch structure has yet to be matched.
* Three unmatched, one essentially matched, the rest matched.
* More fixes.
* Documented more of the structure and cleaned up a bit.
* BossFd2, BgVbSima, and EnVbBall matched and documented
* Also removed unneeded .s files
* And need to name EnVbBall's functions
* give this a shot
* fix conflict
* one more try
* removing darkmeiro changes
* and again
* now OK from make clean
* minor cleanup
* One more matching function for BossFd
* which means it doesn't need its .s
* splitting
* splitting
* splitting
* forgot some .s
* fancy new names
* fancy new names
* trying again
* sneaky .s files
* sound effects and some hex to decimal conversions
* Sound effects and static variable cleanup
* format.sh and clean up static variables
* sfx and formatting
* ZAP and cleanup
* small cleanup
* cleanup and ZAP
* ZAP
* looking at the giant function again
* looking at the giant function again
* Only the big function left.
* Those .s files aren't mine, officer
* float literals might be fixed. regalloc still a nightmare
* almost done with the big function
* should make now
* not much of a change
* all functions match. rodata somehow doesn't.
* forgot some things
* lots of cleanup
* and a little more
* small error
* large cleanup. Also BossFd has function names and inlined variable declarations
* still more cleanup
* the quest for 0.1f continues
* forgot to put NON_MATCHING back in
* Data structures fully documented. Still more cleanup.
* DECR now works with BossFd2
* should match now
* cleanup
* small cleanup
* cleanup and names
* tiny thing
* particles and headers and stuff
* now with more enums
* merge
* test
* end test
* update
* cleanup
* object 2
* object 1
* doc object_fd2
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "6f874af4a"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "6f874af4a"
git-subrepo:
version: "0.4.3"
origin: "https://github.com/ingydotnet/git-subrepo.git"
commit: "2f68596"
* formatting
* .s
* merge actor
* vertex arrays
* a little more
* formatting
* merge opd
* fixed damage check
* cleanup
* fixes
* effect struct
* review
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: fig02 <fig02srl@gmail.com>
* fix mistake in z_bg_hidan_hamstep (#771)
if you're just going to close this pr just wait a week and review it then.
* ovl_En_River_Sound 1 non-matching (#786)
* ovl_En_River_Sound
* Implement review suggestions, run through clang-format
* Responding to PR comments
* Use CHECK_QUEST_ITEM, run through clang-tidy.
* EnTp, 1 nonmatching, and object_tp (#782)
* Data imported, 8 easy functions matched
* Init only remaining nonmatching, data in
* some renaming & fiddling with Init, still nonmatching
* fix colours
* Init still not matching
* Decompile object_tp
* renames
* Rename func_80B20DE0
* Horrible new idea
* Known equivalent, docs next
* Another attempt
* Finished naming in object_tp
* Named functions, more enums
* DrawBridge -> Drawbridge
* skulltulla -> Skulltula
* Name almost all struct variables
* Named most of the temps
* delete asm
* spec
* Missed data file, whoops
* Review
* More review changes
* cleanup en_dha (#787)
* Set __FILE__ in asm_processor (#793)
* Set __FILE__ in asm_processor
* bss fix
* Update to upstream version
Co-authored-by: zelda2774 <zelda2774@invalid>
* ovl_Efc_Erupc OK (#773)
* a few good dead Gfx_TwoTexScrolls
* EfcErupc OK, mostly documented
* review
* remove fake match
Co-authored-by: Fig02 <fig02srl@gmail.com>
* z_bg_mizu_movebg and object_mizu_objects (#747)
* OK a few functions
* BgMizuMovebg_Draw OK, make tweaks to bg_mizu_bwall
* migrate data
* create mizu_objects, defines for water temple water level
* clean up some code
* implement most suggestions
* review
* review2
* formatting
Co-authored-by: Fig02 <fig02srl@gmail.com>
* Document BodyBreak (en_part, body part spawner) (#797)
* done
* status defines
* whoops
* comment wording
* size calc change
* elseif
* Improve the format in z_map_mark_data.c and cleanup mapmark.py (#798)
* Cleanup mapmark.py script
* Rename map mark defines
* Remove unused entries from map_mark_data
* `assert` macro OK (#755)
* create assert macro and replace a bunch of __assert
Signed-off-by: angie <angheloalf95@gmail.com>
* Another bunch of assert
Signed-off-by: angie <angheloalf95@gmail.com>
* more assert
Signed-off-by: angie <angheloalf95@gmail.com>
* assert(false)
Signed-off-by: angie <angheloalf95@gmail.com>
* last assert used in matching code
Signed-off-by: angie <angheloalf95@gmail.com>
* the non-matchings
Signed-off-by: angie <angheloalf95@gmail.com>
* typo
Signed-off-by: angie <angheloalf95@gmail.com>
* format
Signed-off-by: angie <angheloalf95@gmail.com>
* change macro to uppercase
Signed-off-by: angie <angheloalf95@gmail.com>
* Apply suggestions from code review
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
* Change ASSERT(false) to ASSERT(0)
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
* General object cleanup (#799)
* Object cleanup
* Fix running man
* fix mm symbols
* Updated to use latest version of ZAPD (#777)
* Updated config file
* Added missing files
* Temporarily removed asm_processor changes.
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "96ffc1e62"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "96ffc1e62"
git-subrepo:
version: "0.4.3"
origin: "???"
commit: "???"
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "179af7d11"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "179af7d11"
git-subrepo:
version: "0.4.3"
origin: "???"
commit: "???"
* Cleanup and fixes.
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "50ad2fe78"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "50ad2fe78"
git-subrepo:
version: "0.4.3"
origin: "???"
commit: "???"
* Makefile fix
* git subrepo pull --force tools/ZAPD
subrepo:
subdir: "tools/ZAPD"
merged: "b9120803e"
upstream:
origin: "https://github.com/zeldaret/ZAPD.git"
branch: "master"
commit: "b9120803e"
git-subrepo:
version: "0.4.3"
origin: "???"
commit: "???"
Co-authored-by: Jack Walker <7463599+Jack-Walker@users.noreply.github.com>
* Decompile `object_zo` 🐬 (#794)
* Initial xml
* most of in-code references
* Add limbs and evrything else
* Functions used by EnRiverSound
* Fix forearm and use void* for textures
* Run formatter
* Change Hints in scene's XMLs (#800)
* Remove blobhint
* Add segments and offsets, and remove most hints
* Change PathHint to Path
* Add missing final new lines in scenes xmls
* finished object_skb (#790)
* finished object_skb
* neglected the limbs and dlists, so I added them
* adding the textures
* fixing some names
* ....forgot to change the c file....
* hopefully fixed formatting issue
* EnFish, OK and documented (#795)
* Matching
* Some naming
* spec
* Name another function
* Name animations, clarify use of GI_MAX and GI_NONE
* Documented bottle range functions
* Simplify squared distance function in EnIceHono, actor descriptions
* Functions for dropped fish
* More naming
* Change 65535.5f to (0xFFFF + 0.5f)
* Change 65535.5f to (0xFFFF + 0.5f)
* name phases
* Named other types, Docile functions
* Naming complete
* delete asm
* format, remove outdated comment
* Fix a few DrawFlexOpa arguments
* Review changes
* Change back to original playSound
* Function comments per review
* Update asm-processor and add make dependencies for global asm and early includes (#801)
* Update asm-processor to latest master
* Add make dependencies for global asm and early includes
* Update asm-processor to latest master
* Decompile the pause menu aka. ovl_kaleido_scope (+ minor changes) (#803)
* Decompile ovl_kaleido_scope + minor cleanups
* Add a common header for ovl_kaleido_scope
* Start cleaning up and documenting kaleido_scope (+ some interface docs)
* Improve and fix some kaleido_scope non matchings
* Match KaleidoSetup_Init
* Extract icon_item_fra/ger_static files
* Add more documentation and matches to kaleido_scope
* Improve the z_kaleido_collect.c non matching
* Rename z_kaleido_8081EFF0.c to z_kaleido_prompt.c
* Update most kaleido variables to be static
* Improve GS flag macros
* Improve z_lmap_mark.c and extract z_lmap_mark_data.c with a script
* Various minor fixes and improvements
* Minor fixes and review changes
* Review changes part 2
* Rename gSetTileCustom to gDPSetTileCustom
* Review changes part 3
* Delete `-j` from `make setup` and document use of `-jN` and `-j` in readme (#804)
* Add nproc to make setup
* Add cross-platform nproc equivalents
* Scrap that, just ditch -j in makefile altogether
* Clarified thread advice
* ViMode progress (#802)
* ViMode OK
* Fix variable name in regconvert tool
* ViMode: fix formatting
* Add nonmatching impl for ViMode_Configure, respond to PR
- Fixed struct field naming (unkXX -> unk_XX)
- ViMode_Configure args are not flags for top/left etc; seem to be for
video mode
- Used @Random06457's implementation of `ViMode_LogPrint`
* Use plain LOG_ADDRESS in ViMode_LogPrint
* Incorporate PR feedback from Roman971
* Add scene macros (#792)
* add scene macros
* SCENECMD -> SCENE_CMD
* light renaming
* SCENE_CMD_ROOM_BEHAVIOR
* update params names
* Remove extra spaces
* More review changes by fig
* remove MM cmd ids
* more review changes
* last minute edit
* I keep confusing both lights commands
* Review changes
* Yet another cutscene change
* Unused02 is unused
* Add UNK_09 macro and other minor fixes (#813)
(cherry picked from commit
|
||
---|---|---|
asm | ||
assets | ||
data | ||
docs | ||
include | ||
src | ||
tools | ||
.clang-format | ||
.clang-tidy | ||
.gitattributes | ||
.gitignore | ||
checksum.md5 | ||
diff.py | ||
diff_settings.py | ||
docker-compose.yml | ||
Dockerfile | ||
Doxyfile | ||
extract_assets.py | ||
extract_baserom.py | ||
first_diff.py | ||
fixbaserom.py | ||
fixle.sh | ||
format.sh | ||
Jenkinsfile | ||
Makefile | ||
progress.py | ||
README.md | ||
spec | ||
sym_info.py | ||
undefined_syms.txt |
The Legend of Zelda: Ocarina of Time
- 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 use it for modding purposes in its current state, please be aware that
the codebase can drastically change at any time. Also note that some parts of the ROM may not be
'shiftable' yet, so modifying them could be difficult at this point.
This is a WIP decompilation of The Legend of Zelda: Ocarina of Time. 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. The only build currently supported is Master Quest (Debug), but other versions are planned to be supported.
It builds the following ROM:
- zelda_ocarina_mq_dbg.z64
md5: f0b7f35375f9cc8ca1b2d59d78e35405
Note: This repository does not include any of the assets necessary to build the ROM. A prior copy of the game is required to extract the needed assets.
Website: https://zelda64.dev
Discord: https://discord.zelda64.dev
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 18.04 Linux distributions.
For older versions of Windows, install a Linux VM or refer to either Cygwin or Docker instructions.
macOS
For macOS, use homebrew to install the following dependencies:
- coreutils
- make
- python3
- md5sha1sum
- libpng
You can install them with the following commands:
brew update
brew install coreutils make python3 md5sha1sum libpng
You'll also need to build and install mips-linux-binutils.
Going forward in this guide, please use gmake
whenever you encounter a make
command.
The make
that comes with MacOS behaves differently than GNU make and is incompatible with this project.
You should now be able to continue from step 2 of the Linux instructions.
Linux (Native or under WSL / VM)
1. Install build dependencies
The build process has the following package requirements:
- git
- build-essential
- binutils-mips-linux-gnu
- python3
- libpng-dev
Under Debian / Ubuntu (which we recommend using), you can install them with the following commands:
sudo apt-get update
sudo apt-get install git build-essential binutils-mips-linux-gnu python3 libpng-dev
2. Clone the repository
Clone https://github.com/zeldaret/oot.git
where you wish to have the project, with a command such as:
git clone https://github.com/zeldaret/oot.git
3. Prepare a base ROM
Copy over your copy of the Master Quest (Debug) ROM inside the root of this new project directory. Rename the file to "baserom_original.z64", "baserom_original.n64" or "baserom_original.v64", depending on the original extension.
4. Setup the ROM and build process
Setup and extract everything from your ROM with the following command:
make setup
This will generate a new ROM called "baserom.z64" that will have the overdump removed and the header patched. It will also extract the individual assets from the ROM.
5. Build the ROM
Run make to build the ROM. Make sure your path to the project is not too long, otherwise this process may error.
make
If all goes well, a new ROM called "zelda_ocarina_mq_debug.z64" should be built and the following text should be printed:
zelda_ocarina_mq_dbg.z64: OK
If you instead see the following:
zelda_ocarina_mq_dbg.z64: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
This means that the built ROM isn't the same as the base one, so something went wrong or some part of the code doesn't match.
NOTE: to speed up the build, you can either:
- pass
-jN
tomake setup
andmake
, where N is the number of threads to use in the build. The generally-accepted wisdom is to use the number of virtual cores your computer has. - pass
-j
tomake setup
andmake
, to use as many threads as possible, but beware that this can use too much memory on lower-end systems.
Both of these have 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 -j
or -jN
).
Cygwin
If you want to use Cygwin, you will need to:
- Download and install Git Bash.
- Download and install Cygwin.
- Build and install mips-linux-binutils.
Once mips-linux-binutils is installed you will need to install the following packages using Cygwin's installer:
- libiconv
- dos2unix
- python3
- libpng-devel
Then you can continue from step step 2 of the Linux instructions.
Note that, before building anything, you will need to run the following commands to fix line endings:
dos2unix fixle.sh
./fixle.sh
Docker
1. Setup requirements
To use Docker, you'll need either Docker Desktop or Docker Toolbox installed and setup based on your system.
You'll also need to prepare a local version of the project with a copied base ROM (see steps 2 and 3 of the Linux instructions).
2. Create the docker image
From inside your local project, run the following command:
docker build . -t oot
3. Start the container
To start the container, you can mount your local filesystem into the docker container and run an interactive bash session.
docker run -it --rm --mount type=bind,source="$(pwd)",destination=/oot oot /bin/bash
4. Setup and Build the ROM
Once inside the container, you can follow steps 4 and 5 of the Linux instructions to setup and build the ROM, or run any other command you need.
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.
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.