Merge branch 'master' into parameter

This commit is contained in:
engineer124
2022-05-26 13:49:19 +10:00
368 changed files with 11720 additions and 5654 deletions
-9
View File
@@ -1,9 +0,0 @@
Before opening this PR, ensure the following:
- `./format.sh` was run to apply standard formatting.
- `make` successfully builds a matching ROM.
- No new compiler warnings were introduced during the build process.
- Can be verified locally by running `tools/warnings_count/check_new_warnings.sh`
- New variables & functions should follow standard naming conventions.
- Comments and variables have correct spelling.
---
<!-- Leave the text above intact. Add additional comments below. -->
+2
View File
@@ -46,7 +46,9 @@ tools/mips_to_c/
# Docs
!docs/**/*.png
docs/doxygen/
!.vscode/extensions.json
# Per-user configuration
.python-version
.make_options
+61 -72
View File
@@ -1,5 +1,5 @@
Contributing to the Majora's Mask Decompilation Project
=======================================================
# Contributing to the Majora's Mask Decompilation Project
Thanks for helping us reverse engineer *The Legend of Zelda: Majora's Mask* for the N64!
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.
@@ -10,21 +10,19 @@ For general information about the project, see [our readme](https://github.com/z
Most discussions happen on our [Discord Server](https://discord.zelda64.dev) 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.
Useful Links
------------
- [Discord](https://discord.zelda64.dev/) - Primary discussion platform.
- [Google Sheets reservation board](https://docs.google.com/spreadsheets/d/1X83YCPRa532v-Zo0WgUsJ2kB1X9RxBta5_p9aWA8uro) - We use this to track decompilation progress, not GitHub Issues.
## Useful Links
- [Installation guide](https://github.com/zeldaret/mm/blob/master/README.md#installation) - Instructions for getting this repository set up and built on your machine.
- [Code Review Guidelines](REVIEWING.md) - These are the guidelines that reviewers will be using when reviewing your code. Good to be familiar with these before submitting your code.
- [Style Guide](docs/STYLE.md) - Description of the project style that we ask contributors to adhere to.
- [Code Review Guidelines](docs/REVIEWING.md) - These are the guidelines that reviewers will be using when reviewing your code. Good to be familiar with these before submitting your code.
- [Zelda 64 Reverse Engineering Website](https://zelda64.dev/) - Our homepage, with links to other resources.
- [Introduction to OOT decomp](https://github.com/zeldaret/oot/blob/master/docs/tutorial/contents.md) - A very detailed tutorial on how to get started with decomp. For OOT, but largely applicable to MM as well.
- The `#resources` channel on the Discord contains many more links
- [Zelda 64 Reverse Engineering Website](https://zelda64.dev/mm) - Our homepage, with FAQ and progress graph :chart_with_upwards_trend:.
- [MM decomp tutorial](docs/tutorial/contents.md) Detailed tutorial for learning in general how decomp works and how to decompile a small, simple file.
- [Introduction to OOT decomp](https://github.com/zeldaret/oot/blob/master/docs/tutorial/contents.md) - The tutorial the MM one was based on. For OOT, but largely applicable to MM as well. Covers slightly different topics, including how to get your data OK with `vbindiff`.
- The `#resources` channel on the Discord contains many more links on specific details of decompiling IDO MIPS code.
Getting Started
---------------
## Getting Started
### What should I know to take part?
@@ -32,11 +30,14 @@ Basic knowledge of C, particularly arrays and pointers, is extremely useful. Kno
You should be familiar with using git and GitHub. There are a number of tutorials available online, [such as this one](https://github.com/firstcontributions/first-contributions) which can help you get started.
The most useful knowledge to have is a general understanding of how the game works. An afternoon of constructive mucking about in the [OOT Practice Rom](http://practicerom.com/) (aka GZ) or the [MM Practice Rom](https://kz.zeldacodes.org/) (aka KZ) will be very beneficial if you have not looked at either of the N64 Zelda's internals before.
The [OOT Decompilation Project](https://github.com/zeldaret/oot) is farther along than this project, so it can also be a great resource.
The most useful knowledge to have is a general understanding of how the game works. An afternoon of constructive mucking about in the [MM Practice Rom](https://kz.zeldacodes.org/) (aka KZ) or the [OoT Practice Rom](http://practicerom.com/) (aka GZ) will be very beneficial if you have not looked at either of the N64 Zelda's internals before.
The [OoT Decompilation Project](https://github.com/zeldaret/oot) is farther along than this project, so it can also be a great resource.
This project only uses *publicly available code*.
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.
**N.B.** 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.
### Environment Setup
@@ -46,53 +47,28 @@ You should be able to build a matching ROM before you start making any changes.
### First Contribution
Usually, the best place to get started is to decompile an actor overlay.
An *actor* is any thing in the game that moves or performs actions or interactions. This includes things like Link, enemies, NPCs, doors, pots, etc.
An *actor* is any thing in the game that moves or performs actions or interactions. This includes things like Link, enemies, NPCs, doors, pots, etc. Actors are good for a first file because they are generally small, self-contained systems.
You should [join the Discord](https://discord.zelda64.dev/) to say hello and get suggestions on where to start on the `#mm-decomp` channel.
We recommend that you [join the Discord](https://discord.zelda64.dev/) to say hello and get suggestions on where to start on the `#mm-decomp` channel.
We track who is working on what on the [Google Sheets reservation board](https://docs.google.com/spreadsheets/d/1X83YCPRa532v-Zo0WgUsJ2kB1X9RxBta5_p9aWA8uro).
After joining the Discord, open the Google Sheets reservation board so you can claim your code file and avoid duplicate work.
We track who is working on what on some Google Sheets available in the Discord. Once you've decided on or been recommended a good first file, mark it as Reserved.
The work flow is: Reserve a file, decompile it, submit a PR, and then repeat while addressing review comments. The expectation is that one reservation goes to one file which ends up in a one file PR.
The workflow is:
- Reserve a file,
- decompile it,
- submit a PR,
- repeat while addressing review comments.
Please note that unless it is communicated beforehand you will be expected to fully complete the file if you reserve it on Google Sheets reservation board. Exceptions are always easy to approve if it's communicated to the team. Real life circumstances can prevent someone from finishing. In these cases they should link their repo/branch in the Google Sheets reservation board and unreserve immediately. Communicate any issues with your reservations as early as possible.
The expectation is that one reservation goes to one file which ends up in a one file PR, although naturally some files are more sensibly worked on as a group, for example two actors that work together. This also does not apply to large asset files like `gameplay_keep`: you can just reserve the parts that are used in your files.
Style Guide & Conventions
-------------------------
If possible, we expect reserved files to be completed. If you find you cannot complete a file, because it is intractable for one reason or another, or real-life circumstances get in the way, please talk to one of the leads in Discord; we may find someone else interested in helping you finish, or who is happy to take over the file from you completely. If you unreserve a file on which you have useful progress, please leave a link to your branch in the Notes column on the Google Sheet that the next person who works on the file can use.
Most of the C formatting style is enforced by the `format.sh` script which is based on `clang-format`.
Running `./format.sh` will apply our standard style to all `.c` files in the repository.
There are some conventions that cannot be automatically enforced.
## Style Guide & Conventions
### Naming Scheme
See the [Style Guide](docs/STYLE.md).
The following overlays are good examples of our naming conventions:
- [`ovl_Dm_Ravine`](src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c)
- [`ovl_En_Jc_Mato`](src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c)
These files demonstrate the following:
- Word order in names are from least-to-most specific (`DM_RAVINE_STATE_ACTIVE`, not `DM_RAVINE_ACTIVE_STATE`)
- Functions, structs, unions, enums, and typedefs are `TitleCase` (`DmRavine`)
- "Methods" for objects separate the object from the verb with an underscore (`DmRavine_Init`)
- Variable names are `camelCase` (`actionFunc`)
- Global variables start with `g` (`gSaveContext`)
- Static global variables start with `s` (`sSphereInit`)
- Macros and enum constants are `SCREAMING_SNAKE_CASE` (`DM_RAVINE_STATE_ACTIVE`)
- Public structs, enums, and constants should be defined in the header file in the following cases:
- The primary `Actor` struct (`DmRavine`)
- The actor's `InitVars`, as an `extern` symbol (`Dm_Ravine_InitVars`)
- Types used in other public declarations, like `actionFunc` typedefs (`DmRavineActionFunc`)
- Macros and enums for accessing & setting actor `params`
- The struct/enum/define is needed by other files
- Trailing commas in array and struct definitions (see `EnJcMatoDamageTable`)
- Constants converted to whichever looks best in context: hexadecimal, decimal, or float
- Rotation angles should always be in hexadecimal
- Define macros for bitwise access to `actor->params`
### `NON_MATCHING` & `NON_EQUIVALENT`
## `NON_MATCHING` and `NON_EQUIVALENT`
If you make significant progress on decompiling a function, but can't get it to match perfectly, you can use a `NON_MATCHING` block to commit your code but have it excluded from the build, like so:
@@ -102,20 +78,23 @@ void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v) {
// ...
}
#else
void CollisionCheck_SpawnWaterDroplets(GlobalContext* globalCtx, Vec3f* v);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/CollisionCheck_SpawnWaterDroplets.s")
#endif
```
Before using `NON_MATCHING`, first try to use the [decomp-permuter](tools/decomp-permuter) tool to find a closer match.
Before PRing with a `NON_MATCHING`, you can try
- using the [decomp-permuter](tools/decomp-permuter) to find a closer match,
- Asking in `#mm-decomp-help` in Discord; the easiest way to allow other people to play around with the function you are stuck on is to make a scratch on [decomp.me](http://decomp.me).
`NON_EQUIVALENT` can be used with the same syntax as `NON_MATCHING`, but it is used to mark sections of code which do not match *and* do not have the same behavior as the original code.
### Matching vs. Documenting
## Matching and Documenting
Usually, the first step of decompiling a section of code is to get it *matching*: to produce a C version of the code that can be compiled into an identical ROM.
However, the goal of this project is to produce a codebase that can be understood and modified.
So, beyond producing matching C code, the next steps are *documenting* the code.
Therefore once C code produces matching assembly, the next step is to *document* the code.
Documenting is more than just adding comments. Documenting also includes:
@@ -123,22 +102,19 @@ Documenting is more than just adding comments. Documenting also includes:
- Using (or adding) constants, enums, and macros when possible
- Explaining sections of code that are not straightforward
Overlays are not required to be documented at this time, but `code/` and `boot/` should be documented. When documentation on a file has been started it should be as complete as possible.
Overlays are not required to be documented at this time, but files from `code/` and `boot/` should be documented. When documentation on a file has been started it should be as complete as reasonable.
For right now, object segment symbols should not be documented/renamed.
These will be given names when object reconstruction is ready.
However, it can be useful to add comments with name suggestions.
See the [Style Guide](docs/STYLE.md) for more details on documentation style.
Pull Requests (PRs)
-------------------
## Pull Requests (PRs)
### Checklist
Before opening a PR, walk through the following steps to ensure that your code conforms to the style guide and conventions.
- `./format.sh` was run to apply standard formatting.
- `make` successfully builds a matching ROM.
- `./format.sh` was run to apply standard formatting.
- No new compiler warnings were introduced during the build process.
- Can be verified locally by running `tools/warnings_count/check_new_warnings.sh`
- New variables & functions should follow standard naming conventions.
@@ -148,15 +124,28 @@ Feel free to reach out on the Discord if you have any questions about these step
### Pull Request Process
After opening a PR, the Jenkins server will verify your changes.
If there is an error, double-check that you can successfully `make clean && make` locally. If the build is OK, the next thing to check is that all added/modified files were `git add`-ed to your commit. The final check before posting on Discord for help is that there are no new warnings added to the code causing Jenkins to fail. You can check this by running: `tools/warnings_count/check_new_warnings.sh`.
After opening a PR, the Jenkins agent will test formatting, the contents of the spec, build the rom and check for warnings.
If there is an error, double-check that you can successfully
```bash
make disasm
./extract_assets.py -f
make clean
make
```
locally. If the build is `OK`, the next thing to check is that all added/modified files were `git add`-ed to your commit. The final check before posting on Discord for help is that there are no new warnings added to the code causing Jenkins to fail. You can check this by running: `tools/warnings_count/check_new_warnings.sh`.
Each PR needs a review from one reviewer and the project lead.
Each PR needs a review from two reviewers, at least one a project lead, and final approval from Kenix.
The PR author marks the comments as resolved: the commenter may not have permissions to do so.
Once all comments are addressed, it is courteous to ping the reviewer on either Discord or GitHub via re-requesting a review.
If the PR author agrees with a reviewer's suggestion, they make the change and resolve the conversation. If they disagree, have a better idea, or want to comment on something, they should at least leave a comment, and discuss it in Discord if it's not going to be resolved quickly, since long conversations on GitHub are hard to read.
After all the comments are addressed and at least one contributor has approved the review, the project lead can then review and merge the code.
The project lead is also responsible for ensuring that all of these procedures are followed.
Once all comments is addressed and all reviewers have approved, the PR will be merged.
Throughout the PR process, you (the author) should update the row on [Google Sheets reservation board](https://docs.google.com/spreadsheets/d/1X83YCPRa532v-Zo0WgUsJ2kB1X9RxBta5_p9aWA8uro) with the appropriate information as the decompilation process progresses.
Project leads are responsible for ensuring that these conventions are followed.
### Some git notes
- You should work on a branch on your fork separate from your copy of master: it is always useful to have a clean master branch around if you need to fix something.
- When a PR is merged into master, it may conflict with your work. While your branch is private (in particular, not used for a PR), you can rebase, but when your branch is public/used for a PR always merge master instead of rebasing: it makes it much easier for people to understand what you changed since the last review.
- We squash commits when merging, so your commit history does not have to be completely spotless.
Throughout the PR process, you (the author) should update the rows on the appropriate Google Sheets with the appropriate information as the decompilation process progresses.
Vendored
+21 -1
View File
@@ -36,6 +36,16 @@ pipeline {
sh 'bash -c "./tools/warnings_count/compare_warnings.sh setup"'
}
}
stage('Assets') {
steps {
sh 'bash -c "make -j assets 2> >(tee tools/warnings_count/warnings_assets_new.txt)"'
}
}
stage('Check assets warnings') {
steps {
sh 'bash -c "./tools/warnings_count/compare_warnings.sh assets"'
}
}
stage('Disasm') {
steps {
sh 'bash -c "make -j disasm 2> >(tee tools/warnings_count/warnings_disasm_new.txt)"'
@@ -48,7 +58,7 @@ pipeline {
}
stage('Build') {
steps {
sh 'bash -c "make -j all 2> >(tee tools/warnings_count/warnings_build_new.txt)"'
sh 'bash -c "make -j uncompressed 2> >(tee tools/warnings_count/warnings_build_new.txt)"'
}
}
stage('Check build warnings') {
@@ -56,6 +66,16 @@ pipeline {
sh 'bash -c "./tools/warnings_count/compare_warnings.sh build"'
}
}
stage('Compress') {
steps {
sh 'bash -c "make -j compressed 2> >(tee tools/warnings_count/warnings_compress_new.txt)"'
}
}
stage('Check compress warnings') {
steps {
sh 'bash -c "./tools/warnings_count/compare_warnings.sh compress"'
}
}
stage('Report Progress') {
when {
branch 'master'
+47 -21
View File
@@ -1,6 +1,11 @@
# Build options can be changed by modifying the makefile or by building with 'make SETTING=value'.
# It is also possible to override the settings in Defaults in a file called .make_options as 'SETTING=value'.
-include .make_options
MAKEFLAGS += --no-builtin-rules
# Build options can either be changed by modifying the makefile, or by building with 'make SETTING=value'
#### Defaults ####
# If COMPARE is 1, check the output md5sum after building
COMPARE ?= 1
@@ -13,7 +18,15 @@ WERROR ?= 0
# Keep .mdebug section in build
KEEP_MDEBUG ?= 0
# Disassembles all asm from the ROM instead of skipping files which are entirely in C
FULL_DISASM ?= 1
FULL_DISASM ?= 0
# Check code syntax with host compiler
RUN_CC_CHECK ?= 1
# Dump build object files
OBJDUMP_BUILD ?= 0
# Number of threads to disassmble, extract, and compress with
N_THREADS ?= $(shell nproc)
#### Setup ####
ifeq ($(NON_MATCHING),1)
CFLAGS := -DNON_MATCHING
@@ -45,9 +58,8 @@ else
endif
endif
N_THREADS ?= $(shell nproc)
#### Tools ####
ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
MIPS_BINUTILS_PREFIX := mips-linux-gnu-
else
@@ -86,8 +98,15 @@ else
endif
# Check code syntax with host compiler
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-label
CC_CHECK := gcc -fno-builtin -fsyntax-only -funsigned-char -fdiagnostics-color -std=gnu89 -D _LANGUAGE_C -D NON_MATCHING $(IINC) -nostdinc $(CHECK_WARNINGS)
ifneq ($(RUN_CC_CHECK),0)
CHECK_WARNINGS := -Wall -Wextra -Wno-format-security -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-variable -Wno-missing-braces -Wno-int-conversion -Wno-unused-but-set-variable -Wno-unused-label
CC_CHECK := gcc -fno-builtin -fsyntax-only -funsigned-char -fdiagnostics-color -std=gnu89 -D _LANGUAGE_C -D NON_MATCHING $(IINC) -nostdinc $(CHECK_WARNINGS)
ifneq ($(WERROR), 0)
CC_CHECK += -Werror
endif
else
CC_CHECK := @:
endif
CPP := cpp
ELF2ROM := tools/buildtools/elf2rom
@@ -103,12 +122,20 @@ MIPS_VERSION := -mips2
CFLAGS += -G 0 -non_shared -fullwarn -verbose -Xcpluscomm $(IINC) -nostdinc -Wab,-r4300_mul -woff 624,649,838,712,516
# Use relocations and abi fpr names in the dump
OBJDUMP_FLAGS := -d -r -z -Mreg-names=32
OBJDUMP_FLAGS := --disassemble --reloc --disassemble-zeroes -Mreg-names=32
ifneq ($(OBJDUMP_BUILD), 0)
OBJDUMP_CMD = $(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
OBJCOPY_BIN = $(OBJCOPY) -O binary $@ $@.bin
else
OBJDUMP_CMD = @:
OBJCOPY_BIN = @:
endif
ifeq ($(shell getconf LONG_BIT), 32)
# Work around memory allocation bug in QEMU
export QEMU_GUEST_BASE := 1
else
else ifneq ($(RUN_CC_CHECK),0)
# Ensure that gcc treats the code as 32-bit
CC_CHECK += -m32
endif
@@ -116,11 +143,7 @@ endif
# rom compression flags
COMPFLAGS := --threads $(N_THREADS)
ifneq ($(NON_MATCHING),1)
COMPFLAGS += --matching
endif
ifneq ($(WERROR), 0)
CC_CHECK += -Werror
COMPFLAGS += --matching
endif
#### Files ####
@@ -229,14 +252,14 @@ ifeq ($(COMPARE),1)
@md5sum -c checksum.md5
endif
.PHONY: all uncompressed compressed clean assetclean distclean disasm init setup
.PHONY: all uncompressed compressed clean assetclean distclean assets disasm init setup
.DEFAULT_GOAL := uncompressed
all: compressed
all: uncompressed compressed
$(ROM): $(ELF)
$(ELF2ROM) -cic 6105 $< $@
$(ROMC): uncompressed
$(ROMC): $(ROM)
python3 tools/z64compress_wrapper.py $(COMPFLAGS) $(ROM) $@ $(ELF) build/$(SPEC)
$(ELF): $(TEXTURE_FILES_OUT) $(ASSET_FILES_OUT) $(O_FILES) build/ldscript.txt build/undefined_syms.txt
@@ -263,6 +286,8 @@ setup:
$(MAKE) -C tools
python3 tools/fixbaserom.py
python3 tools/extract_baserom.py
assets:
python3 extract_assets.py -j $(N_THREADS)
## Assembly generation
@@ -278,6 +303,7 @@ diff-init: uncompressed
init:
$(MAKE) distclean
$(MAKE) setup
$(MAKE) assets
$(MAKE) disasm
$(MAKE) all
$(MAKE) diff-init
@@ -296,7 +322,7 @@ build/asm/%.o: asm/%.s
build/assets/%.o: assets/%.c
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
$(OBJCOPY) -O binary $@ $@.bin
$(OBJCOPY_BIN)
$(RM_MDEBUG)
build/baserom/%.o: baserom/%
@@ -308,7 +334,7 @@ build/data/%.o: data/%.s
build/src/overlays/%.o: src/overlays/%.c
$(CC_CHECK) $<
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
@$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
$(OBJDUMP_CMD)
# TODO: `() || true` is currently necessary to suppress `Error 1 (ignored)` make warnings caused by `test`, but this will go away if
# the following is moved to a separate rule that is only run once when all the required objects have been compiled.
$(ZAPD) bovl -eh -i $@ -cfg $< --outputpath $(@D)/$(notdir $(@D))_reloc.s
@@ -318,21 +344,21 @@ build/src/overlays/%.o: src/overlays/%.c
build/src/%.o: src/%.c
$(CC_CHECK) $<
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
@$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
$(OBJDUMP_CMD)
$(RM_MDEBUG)
build/src/libultra/libc/ll.o: src/libultra/libc/ll.c
$(CC_CHECK) $<
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
python3 tools/set_o32abi_bit.py $@
@$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
$(OBJDUMP_CMD)
$(RM_MDEBUG)
build/src/libultra/libc/llcvt.o: src/libultra/libc/llcvt.c
$(CC_CHECK) $<
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
python3 tools/set_o32abi_bit.py $@
@$(OBJDUMP) $(OBJDUMP_FLAGS) $@ > $(@:.o=.s)
$(OBJDUMP_CMD)
$(RM_MDEBUG)
# Build C files from assets
+9 -15
View File
@@ -17,15 +17,15 @@
```diff
- 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 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 producing a PC port.** For more information you can get in touch with the team on our [Discord server](https://discord.zelda64.dev).
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](https://zelda64.dev/mm), and for more information you can get in touch with the team on our [Discord server](https://discord.zelda64.dev).
The only build currently supported is N64 US, but other versions are planned to be supported.
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`
@@ -137,16 +137,10 @@ The disadvantage that the ordering of the terminal output is scrambled, so for d
## 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.
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](https://discord.zelda64.dev), 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.
Most discussions happen on our [Discord Server](https://discord.zelda64.dev), 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](CONTRIBUTING.md) and our [Code Review Guidelines](REVIEWING.md) 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.
For more information on getting started, see our [Contributing Guide](CONTRIBUTING.md), [Style Guide](docs/STYLE.md) and our [Code Review Guidelines](docs/REVIEWING.md) to see what code quality guidelines we follow.
-67
View File
@@ -1,67 +0,0 @@
Reviewing Pull Requests to the Majora's Mask Decompilation Project
=======================================================
Thanks for helping us reverse engineer *The Legend of Zelda: Majora's Mask* for the N64!
We invite all contributors to participate in our code review program. Every review submitted helps us keep code quality high and code merged in more quickly.
This document is meant to be a set of tips and guidelines for reviewers of pull requests to the project.
For general information about the project, see [our readme](https://github.com/zeldaret/mm/blob/master/README.md).
Most discussions happen on our [Discord Server](https://discord.zelda64.dev) 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.
Useful Links
------------
- [Discord](https://discord.zelda64.dev/) - Primary discussion platform.
- [Google Sheets reservation board](https://docs.google.com/spreadsheets/d/1X83YCPRa532v-Zo0WgUsJ2kB1X9RxBta5_p9aWA8uro) - We use this to track decompilation progress, not GitHub Issues.
- [Contributing guide](https://github.com/zeldaret/mm/blob/master/CONTRIBUTING.md) - Instructions for contributors.
- [Installation guide](https://github.com/zeldaret/mm/blob/master/README.md#installation) - Instructions for getting this repository set up and built on your machine.
- [Zelda 64 Reverse Engineering Website](https://zelda64.dev/) - Our homepage, with links to other resources.
- [Introduction to OOT decomp](https://github.com/zeldaret/oot/blob/master/docs/tutorial/contents.md) - A very detailed tutorial on how to get started with decomp. For OOT, but largely applicable to MM as well.
- The `#resources` channel on the Discord contains many more links
Getting Started
---------------
### What should I know to take part in the review process?
You should first get yourself familiar with our [Contributing guide](https://github.com/zeldaret/mm/blob/master/CONTRIBUTING.md). It is also recommended that you have already successfully submitted a merged pull request to understand how the process works before submitting a review.
Pull Requests (PRs)
------------
### How to review a Pull Request
- When reviewing a PR it is suggested that you follow the checklist outlined in this section.
- You are not required to check for all of the items in the checklist. It is meant as a guide.
- Once the PR author has addressed all of your comments, you should add a comment with approval to the PR to signify to the project leads that this PR has been through peer review.
- If someone does not address your comments and expresses that a different way is better than yours, look for feedback from other contributors. The project lead will have final say in these situations. All decisions will generally be guided by a consensus of contributors.
### Reviewer Checklist
- [ ] Jenkins build is successful.
- [ ] `make` builds a matching ROM.
- [ ] Any new compiler warnings that were added are required for matching. Ensure there is good reason if the warnings files have changed. `./tools/warnings_count/warnings_build_current.txt` and `./tools/warnings_count/warnings_setup_current.txt`
- [ ] Files with NON_MATCHING functions have equivalent behaviour. (This will only be reviewed once we have shiftability since equivalence testing is easiest in game)
- [ ] `code` and `boot` segment files should be documented as much as possible. Overlays with documentation should be complete.
- [ ] Overlays with documentation should have macros to define access to parameters if the parameter uses bitwise access. The params should have an enum when it makes sense.
- [ ] `format.sh` was run.
- [ ] Comments and variables have correct spelling.
- [ ] The following should be declared in an Actor header file. There should be nothing else in the Actor header file.
- [ ] Main Actor struct
- [ ] Extern'd initVar data.
- [ ] Types used in the actor struct. Specific example would be actionFunc typedefs.
- [ ] Param field macros and/or enums.
- [ ] For any other additional `enum`/`struct`/`define`/`function`/`global`, there needs to be evidence it is needed in another file.
- [ ] New variables and functions should follow standard naming conventions.
- [ ] Constants are converted to whichever looks best in context: hexadecimal, decimal, or float
- [ ] Rotation angles should always be in hexadecimal
- [ ] Colour values should always be in decimal.
- [ ] Functions, structs, unions, enums, and typedefs are `TitleCase` (`DmRavine`)
- [ ] "Methods" for objects separate the system from the verb with an underscore (`DmRavine_Init`)
- [ ] Variable names are `camelCase` (`actionFunc`)
- [ ] Global variables start with `g` (`gSaveContext`)
- [ ] Static global variables start with `s` (`sSphereInit`)
- [ ] Macros and enum constants are `SCREAMING_SNAKE_CASE` (`DM_RAVINE_STATE_ACTIVE`)
- [ ] Trailing commas in array and struct definitions (see `EnJcMatoDamageTable`)
+10 -10
View File
@@ -1062,15 +1062,15 @@
<Texture Name="gEffStone7Tex" OutName="eff_stone_7" Format="ia8" Width="32" Height="32" Offset="0x3B990" />
<Texture Name="gEffStone8Tex" OutName="eff_stone_8" Format="ia8" Width="32" Height="32" Offset="0x3BD90" />
<DList Name="gEffStoneDL" Offset="0x3C190" />
<Texture Name="gameplay_keep_Tex_03C230" OutName="tex_03C230" Format="i4" Width="32" Height="96" Offset="0x3C230" />
<Texture Name="gameplay_keep_Tex_03C830" OutName="tex_03C830" Format="i4" Width="32" Height="96" Offset="0x3C830" />
<Texture Name="gameplay_keep_Tex_03CE30" OutName="tex_03CE30" Format="i4" Width="32" Height="96" Offset="0x3CE30" />
<Texture Name="gameplay_keep_Tex_03D430" OutName="tex_03D430" Format="i4" Width="32" Height="96" Offset="0x3D430" />
<Texture Name="gameplay_keep_Tex_03DA30" OutName="tex_03DA30" Format="i4" Width="32" Height="96" Offset="0x3DA30" />
<Texture Name="gameplay_keep_Tex_03E030" OutName="tex_03E030" Format="i4" Width="32" Height="96" Offset="0x3E030" />
<Texture Name="gameplay_keep_Tex_03E630" OutName="tex_03E630" Format="i4" Width="32" Height="96" Offset="0x3E630" />
<Texture Name="gameplay_keep_Tex_03EC30" OutName="tex_03EC30" Format="i4" Width="32" Height="96" Offset="0x3EC30" />
<DList Name="gameplay_keep_DL_03F230" Offset="0x3F230" />
<Texture Name="gEffLightning1Tex" OutName="eff_lightning_1" Format="i4" Width="32" Height="96" Offset="0x3C230" />
<Texture Name="gEffLightning2Tex" OutName="eff_lightning_2" Format="i4" Width="32" Height="96" Offset="0x3C830" />
<Texture Name="gEffLightning3Tex" OutName="eff_lightning_3" Format="i4" Width="32" Height="96" Offset="0x3CE30" />
<Texture Name="gEffLightning4Tex" OutName="eff_lightning_4" Format="i4" Width="32" Height="96" Offset="0x3D430" />
<Texture Name="gEffLightning5Tex" OutName="eff_lightning_5" Format="i4" Width="32" Height="96" Offset="0x3DA30" />
<Texture Name="gEffLightning6Tex" OutName="eff_lightning_6" Format="i4" Width="32" Height="96" Offset="0x3E030" />
<Texture Name="gEffLightning7Tex" OutName="eff_lightning_7" Format="i4" Width="32" Height="96" Offset="0x3E630" />
<Texture Name="gEffLightning8Tex" OutName="eff_lightning_8" Format="i4" Width="32" Height="96" Offset="0x3EC30" />
<DList Name="gEffLightningDL" Offset="0x3F230" />
<Texture Name="gameplay_keep_Tex_03F300" OutName="tex_03F300" Format="i8" Width="32" Height="64" Offset="0x3F300" />
<Texture Name="gameplay_keep_Tex_03FB00" OutName="tex_03FB00" Format="i8" Width="32" Height="64" Offset="0x3FB00" />
<Texture Name="gameplay_keep_Tex_040300" OutName="tex_040300" Format="i8" Width="32" Height="64" Offset="0x40300" />
@@ -1180,7 +1180,7 @@
<Texture Name="gameplay_keep_Tex_054140" OutName="tex_054140" Format="i4" Width="64" Height="64" Offset="0x54140" />
<DList Name="gameplay_keep_DL_054940" Offset="0x54940" />
<DList Name="gameplay_keep_DL_0549A8" Offset="0x549A8" />
<DList Name="gameplay_keep_DL_054A90" Offset="0x54A90" />
<DList Name="gEffSparklesDL" Offset="0x54A90" />
<Texture Name="gameplay_keep_Tex_054AF0" OutName="tex_054AF0" Format="i4" Width="16" Height="16" Offset="0x54AF0" />
<DList Name="gameplay_keep_DL_054C90" Offset="0x54C90" />
<Texture Name="gameplay_keep_Tex_054D90" OutName="tex_054D90" Format="i4" Width="16" Height="16" Offset="0x54D90" />
+27 -24
View File
@@ -1,28 +1,31 @@
<Root>
<!-- Death Armos: flying statues in Inverted Stone Tower Temple -->
<File Name="object_famos" Segment="6">
<Animation Name="object_famos_Anim_0000F8" Offset="0xF8" />
<DList Name="object_famos_DL_0012B0" Offset="0x12B0" />
<DList Name="object_famos_DL_001528" Offset="0x1528" />
<DList Name="object_famos_DL_001C88" Offset="0x1C88" />
<DList Name="object_famos_DL_001DE8" Offset="0x1DE8" />
<DList Name="object_famos_DL_001FA8" Offset="0x1FA8" />
<Texture Name="object_famos_TLUT_002068" OutName="tlut_002068" Format="rgba16" Width="4" Height="4" Offset="0x2068" />
<Texture Name="object_famos_TLUT_002088" OutName="tlut_002088" Format="rgba16" Width="4" Height="4" Offset="0x2088" />
<Texture Name="object_famos_TLUT_0020A8" OutName="tlut_0020A8" Format="rgba16" Width="4" Height="4" Offset="0x20A8" />
<Texture Name="object_famos_TLUT_0020C8" OutName="tlut_0020C8" Format="rgba16" Width="4" Height="4" Offset="0x20C8" />
<Texture Name="object_famos_Tex_0020E8" OutName="tex_0020E8" Format="ci4" Width="64" Height="64" Offset="0x20E8" />
<Texture Name="object_famos_Tex_0028E8" OutName="tex_0028E8" Format="ci4" Width="32" Height="32" Offset="0x28E8" />
<Texture Name="object_famos_Tex_002AE8" OutName="tex_002AE8" Format="ci4" Width="64" Height="64" Offset="0x2AE8" />
<Texture Name="object_famos_Tex_0032E8" OutName="tex_0032E8" Format="ci4" Width="32" Height="32" Offset="0x32E8" />
<Texture Name="object_famos_Tex_0034E8" OutName="tex_0034E8" Format="rgba16" Width="32" Height="32" Offset="0x34E8" />
<Limb Name="object_famos_Standardlimb_003CE8" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_01" Offset="0x3CE8" />
<Limb Name="object_famos_Standardlimb_003CF4" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_02" Offset="0x3CF4" />
<Limb Name="object_famos_Standardlimb_003D00" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_03" Offset="0x3D00" />
<Limb Name="object_famos_Standardlimb_003D0C" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_04" Offset="0x3D0C" />
<Limb Name="object_famos_Standardlimb_003D18" Type="Standard" EnumName="OBJECT_FAMOS_LIMB_05" Offset="0x3D18" />
<Skeleton Name="object_famos_Skel_003D38" Type="Normal" LimbType="Standard" LimbNone="OBJECT_FAMOS_LIMB_NONE" LimbMax="OBJECT_FAMOS_LIMB_MAX" EnumName="object_famos_Limbs" Offset="0x3D38" />
<Animation Name="object_famos_Anim_003DC8" Offset="0x3DC8" />
<TextureAnimation Name="object_famos_Matanimheader_003E30" Offset="0x3E30" />
<TextureAnimation Name="object_famos_Matanimheader_003E38" Offset="0x3E38" />
<Animation Name="gFamosShakeAnim" Offset="0xF8" />
<DList Name="gFamosHelmetDL" Offset="0x12B0" />
<DList Name="gFamosMainBodyDL" Offset="0x1528" />
<DList Name="gFamosShieldDL" Offset="0x1C88" />
<DList Name="gFamosSwordDL" Offset="0x1DE8" />
<DList Name="gFamosLightSwitchDL" Offset="0x1FA8" />
<Texture Name="gFamosBodyTLUT" OutName="body_tlut" Format="rgba16" Width="4" Height="4" Offset="0x2068" />
<Texture Name="gFamosBottomTLUT" OutName="bottom_tlut" Format="rgba16" Width="4" Height="4" Offset="0x2088" />
<Texture Name="gFamosShieldTLUT" OutName="shield_tlut" Format="rgba16" Width="4" Height="4" Offset="0x20A8" />
<Texture Name="gFamosSwordHiltTLUT" OutName="sword_hilt_tlut" Format="rgba16" Width="4" Height="4" Offset="0x20C8" />
<Texture Name="gFamosMainBodyTex" OutName="famos_main_body" Format="ci4" Width="64" Height="64" Offset="0x20E8" />
<Texture Name="gFamosBottomTex" OutName="famos_bottom" Format="ci4" Width="32" Height="32" Offset="0x28E8" />
<Texture Name="gFamosShieldTex" OutName="famos_shield" Format="ci4" Width="64" Height="64" Offset="0x2AE8" />
<Texture Name="gFamosSwordHiltTex" OutName="famos_sword_hilt" Format="ci4" Width="32" Height="32" Offset="0x32E8" />
<Texture Name="gFamosLightSwitchTex" OutName="famos_light_switch" Format="rgba16" Width="32" Height="32" Offset="0x34E8" />
<Limb Name="gFamosBodyLimb" Type="Standard" EnumName="FAMOS_LIMB_BODY" Offset="0x3CE8" />
<Limb Name="gFamosEmblemLimb" Type="Standard" EnumName="FAMOS_LIMB_EMBLEM" Offset="0x3CF4" />
<Limb Name="gFamosSwordLimb" Type="Standard" EnumName="FAMOS_LIMB_SWORD" Offset="0x3D00" />
<Limb Name="gFamosShieldLimb" Type="Standard" EnumName="FAMOS_LIMB_SHIELD" Offset="0x3D0C" />
<Limb Name="gFamosHeadLimb" Type="Standard" EnumName="FAMOS_LIMB_HEAD" Offset="0x3D18" />
<Skeleton Name="gFamosSkeleton" Type="Normal" LimbType="Standard" LimbNone="FAMOS_LIMB_NONE" LimbMax="FAMOS_LIMB_MAX" EnumName="FamosLimbs" Offset="0x3D38" />
<Animation Name="gFamosIdleAnim" Offset="0x3DC8" />
<TextureAnimation Name="gFamosNormalGlowingEmblemTexAnim" Offset="0x3E30" />
<TextureAnimation Name="gFamosFlippedGlowingEmblemTexAnim" Offset="0x3E38" />
</File>
</Root>
+33 -29
View File
@@ -1,8 +1,9 @@
<Root>
<!-- Grog: the Cucco keeper, you raise his Cucco chicks into adults to earn the Bunny Hood mask -->
<File Name="object_hs" Segment="6">
<Animation Name="object_hs_Anim_000304" Offset="0x304" />
<Animation Name="object_hs_Anim_000528" Offset="0x528" />
<Animation Name="object_hs_Anim_0005C0" Offset="0x5C0" />
<Animation Name="gHsShiveringAnim" Offset="0x304" /> <!-- unused, "h_purupuru" japanese onomatopoeic for 'shivering' -->
<Animation Name="gHsPleadingAnim" Offset="0x528" /> <!-- unused, "h_tanomuu" japanese for 'to beg' -->
<Animation Name="gHsIdleAnim" Offset="0x5C0" /> <!-- "h_matsu" japanese for 'to wait' -->
<DList Name="object_hs_DL_003760" Offset="0x3760" />
<DList Name="object_hs_DL_003AB0" Offset="0x3AB0" />
<DList Name="object_hs_DL_004140" Offset="0x4140" />
@@ -13,35 +14,38 @@
<DList Name="object_hs_DL_004960" Offset="0x4960" />
<DList Name="object_hs_DL_004AB8" Offset="0x4AB8" />
<DList Name="object_hs_DL_004BF0" Offset="0x4BF0" />
<DList Name="object_hs_DL_004CF0" Offset="0x4CF0" />
<DList Name="gHsEndDL" Offset="0x4CF0" />
<DList Name="object_hs_DL_004CF8" Offset="0x4CF8" />
<Texture Name="object_hs_TLUT_004E50" OutName="tlut_004E50" Format="rgba16" Width="16" Height="16" Offset="0x4E50" />
<Texture Name="object_hs_Tex_005050" OutName="tex_005050" Format="ci8" Width="16" Height="32" Offset="0x5050" />
<Texture Name="object_hs_Tex_005250" OutName="tex_005250" Format="ci8" Width="8" Height="8" Offset="0x5250" />
<Texture Name="object_hs_Tex_005290" OutName="tex_005290" Format="ci8" Width="32" Height="16" Offset="0x5290" />
<Texture Name="object_hs_Tex_005490" OutName="tex_005490" Format="rgba16" Width="32" Height="16" Offset="0x5490" />
<Texture Name="object_hs_Tex_005890" OutName="tex_005890" Format="ci8" Width="16" Height="16" Offset="0x5890" />
<Texture Name="object_hs_Tex_005990" OutName="tex_005990" Format="ci8" Width="16" Height="16" Offset="0x5990" />
<Texture Name="object_hs_Tex_005A90" OutName="tex_005A90" Format="rgba16" Width="4" Height="4" Offset="0x5A90" />
<Texture Name="object_hs_Tex_005AB0" OutName="tex_005AB0" Format="ci8" Width="8" Height="8" Offset="0x5AB0" />
<Texture Name="object_hs_Tex_005AF0" OutName="tex_005AF0" Format="ci8" Width="32" Height="32" Offset="0x5AF0" />
<Texture Name="object_hs_Tex_005EF0" OutName="tex_005EF0" Format="ci8" Width="8" Height="16" Offset="0x5EF0" />
<Texture Name="object_hs_Tex_005F70" OutName="tex_005F70" Format="ci8" Width="16" Height="32" Offset="0x5F70" />
<Limb Name="object_hs_Standardlimb_006170" Type="Standard" EnumName="OBJECT_HS_LIMB_01" Offset="0x6170" />
<Limb Name="object_hs_Standardlimb_00617C" Type="Standard" EnumName="OBJECT_HS_LIMB_02" Offset="0x617C" />
<Limb Name="object_hs_Standardlimb_006188" Type="Standard" EnumName="OBJECT_HS_LIMB_03" Offset="0x6188" />
<Limb Name="object_hs_Standardlimb_006194" Type="Standard" EnumName="OBJECT_HS_LIMB_04" Offset="0x6194" />
<Limb Name="object_hs_Standardlimb_0061A0" Type="Standard" EnumName="OBJECT_HS_LIMB_05" Offset="0x61A0" />
<Limb Name="object_hs_Standardlimb_0061AC" Type="Standard" EnumName="OBJECT_HS_LIMB_06" Offset="0x61AC" />
<Limb Name="object_hs_Standardlimb_0061B8" Type="Standard" EnumName="OBJECT_HS_LIMB_07" Offset="0x61B8" />
<Limb Name="object_hs_Standardlimb_0061C4" Type="Standard" EnumName="OBJECT_HS_LIMB_08" Offset="0x61C4" />
<Limb Name="object_hs_Standardlimb_0061D0" Type="Standard" EnumName="OBJECT_HS_LIMB_09" Offset="0x61D0" />
<Limb Name="object_hs_Standardlimb_0061DC" Type="Standard" EnumName="OBJECT_HS_LIMB_0A" Offset="0x61DC" />
<Limb Name="object_hs_Standardlimb_0061E8" Type="Standard" EnumName="OBJECT_HS_LIMB_0B" Offset="0x61E8" />
<Texture Name="gHsRibsTex" OutName="ribs" Format="ci8" Width="16" Height="32" Offset="0x5050" />
<Texture Name="gHsEarTex" OutName="ear" Format="ci8" Width="8" Height="8" Offset="0x5250" />
<Texture Name="gHsMouthTex" OutName="mouth" Format="ci8" Width="32" Height="16" Offset="0x5290" />
<Texture Name="gHsEyeTex" OutName="eye" Format="rgba16" Width="32" Height="16" Offset="0x5490" />
<Texture Name="gHsPantsTex" OutName="pants" Format="ci8" Width="16" Height="16" Offset="0x5890" />
<Texture Name="gHsFingersTex" OutName="fingers" Format="ci8" Width="16" Height="16" Offset="0x5990" />
<Texture Name="gHsBraceletTex" OutName="bracelet" Format="rgba16" Width="4" Height="4" Offset="0x5A90" />
<Texture Name="gHsCuccoFeedBagTex" OutName="cucco_feed_bag" Format="ci8" Width="8" Height="8" Offset="0x5AB0" />
<Texture Name="gHsChairBoxTex" OutName="chair_box" Format="ci8" Width="32" Height="32" Offset="0x5AF0" />
<Texture Name="gHsAbsTex" OutName="abs" Format="ci8" Width="8" Height="16" Offset="0x5EF0" />
<Texture Name="gHsBackTex" OutName="back" Format="ci8" Width="16" Height="32" Offset="0x5F70" />
<Limb Name="gHsRootLimb" Type="Standard" EnumName="HS_LIMB_ROOT" Offset="0x6170" />
<Limb Name="gHsLeftUpperArmLimb" Type="Standard" EnumName="HS_LIMB_LEFT_UPPER_ARM" Offset="0x617C" />
<Limb Name="gHsLeftForarmLimb" Type="Standard" EnumName="HS_LIMB_LEFT_FORARM" Offset="0x6188" />
<Limb Name="gHsLeftHandLimb" Type="Standard" EnumName="HS_LIMB_LEFT_HAND" Offset="0x6194" />
<Limb Name="gHsRightUpperArmLimb" Type="Standard" EnumName="HS_LIMB_RIGHT_UPPER_ARM" Offset="0x61A0" />
<Limb Name="gHsRightForarmLimb" Type="Standard" EnumName="HS_LIMB_RIGHT_FORARM" Offset="0x61AC" />
<Limb Name="gHsRightHandLimb" Type="Standard" EnumName="HS_LIMB_RIGHT_HAND" Offset="0x61B8" />
<Limb Name="gHsHeadRoot" Type="Standard" EnumName="HS_LIMB_HEAD_ROOT" Offset="0x61C4" />
<Limb Name="gHsHeadLimb" Type="Standard" EnumName="HS_LIMB_HEAD" Offset="0x61D0" />
<Limb Name="gHsHairSpikesLimb" Type="Standard" EnumName="HS_LIMB_HAIR_SPIKES" Offset="0x61DC" />
<!-- this limb is nulled in the override limb function -->
<Limb Name="gHsHiddenHairLimb" Type="Standard" EnumName="HS_LIMB_HIDDEN_HAIR" Offset="0x61E8" />
<!-- both of these use the same display list, which is just an end display list, unfinished content? -->
<Limb Name="object_hs_Standardlimb_0061F4" Type="Standard" EnumName="OBJECT_HS_LIMB_0C" Offset="0x61F4" />
<Limb Name="object_hs_Standardlimb_006200" Type="Standard" EnumName="OBJECT_HS_LIMB_0D" Offset="0x6200" />
<Limb Name="object_hs_Standardlimb_00620C" Type="Standard" EnumName="OBJECT_HS_LIMB_0E" Offset="0x620C" />
<Limb Name="object_hs_Standardlimb_006218" Type="Standard" EnumName="OBJECT_HS_LIMB_0F" Offset="0x6218" />
<Skeleton Name="object_hs_Skel_006260" Type="Flex" LimbType="Standard" LimbNone="OBJECT_HS_LIMB_NONE" LimbMax="OBJECT_HS_LIMB_MAX" EnumName="object_hs_Limbs" Offset="0x6260" />
<!-- shoulders down to toes plus box hes sitting on -->
<Limb Name="gHsChestAndLowerBodyPlusBox" Type="Standard" EnumName="HS_LIMB_LOWER_BODY_PLUS_BOX" Offset="0x620C" />
<Limb Name="gHsCuccoFeedBagsLimb" Type="Standard" EnumName="HS_LIMB_CUCCO_FEED_BAGS" Offset="0x6218" />
<Skeleton Name="gHsSkeleton" Type="Flex" LimbType="Standard" LimbNone="OBJECT_HS_LIMB_NONE" LimbMax="OBJECT_HS_LIMB_MAX" EnumName="object_hs_Limbs" Offset="0x6260" />
</File>
</Root>
+34 -32
View File
@@ -1,38 +1,40 @@
<Root>
<!-- Cucco: zelda name for chicken, "Niw" likely short for "Niwatori" -->
<File Name="object_niw" Segment="6">
<Animation Name="object_niw_Anim_0000E8" Offset="0xE8" />
<DList Name="object_niw_DL_0009C0" Offset="0x9C0" />
<DList Name="object_niw_DL_000A98" Offset="0xA98" />
<DList Name="object_niw_DL_000DF0" Offset="0xDF0" />
<DList Name="object_niw_DL_000FD0" Offset="0xFD0" />
<DList Name="object_niw_DL_001088" Offset="0x1088" />
<DList Name="object_niw_DL_001128" Offset="0x1128" />
<DList Name="object_niw_DL_0011E0" Offset="0x11E0" />
<Texture Name="object_niw_Tex_001280" OutName="tex_001280" Format="rgba16" Width="16" Height="16" Offset="0x1280" />
<Texture Name="object_niw_Tex_001480" OutName="tex_001480" Format="rgba16" Width="8" Height="16" Offset="0x1480" />
<Texture Name="object_niw_Tex_001580" OutName="tex_001580" Format="rgba16" Width="8" Height="8" Offset="0x1580" />
<Texture Name="object_niw_Tex_001600" OutName="tex_001600" Format="rgba16" Width="8" Height="8" Offset="0x1600" />
<Texture Name="object_niw_Tex_001680" OutName="tex_001680" Format="rgba16" Width="16" Height="16" Offset="0x1680" />
<Texture Name="object_niw_Tex_001880" OutName="tex_001880" Format="rgba16" Width="32" Height="32" Offset="0x1880" />
<Texture Name="object_niw_Tex_002080" OutName="tex_002080" Format="rgba16" Width="8" Height="16" Offset="0x2080" />
<Texture Name="object_niw_Tex_002180" OutName="tex_002180" Format="rgba16" Width="16" Height="16" Offset="0x2180" />
<Animation Name="gNiwIdleAnim" Offset="0xE8" />
<DList Name="gNiwNeckDL" Offset="0x9C0" />
<DList Name="gNiwHeadDL" Offset="0xA98" />
<DList Name="gNiwTailDL" Offset="0xDF0" />
<DList Name="gNiwWingLeftDL" Offset="0xFD0" />
<DList Name="gNiwFootLeftDL" Offset="0x1088" />
<DList Name="gNiwWingRightDL" Offset="0x1128" />
<DList Name="gNiwFootRightDL" Offset="0x11E0" />
<Texture Name="gNiwEyeTex" OutName="eye" Format="rgba16" Width="16" Height="16" Offset="0x1280" />
<Texture Name="gNiwHeadFeathersTex" OutName="head_feathers" Format="rgba16" Width="8" Height="16" Offset="0x1480" />
<Texture Name="gNiwBaseFeathersTex" OutName="base_feathers" Format="rgba16" Width="8" Height="8" Offset="0x1580" />
<Texture Name="gNiwBeakTex" OutName="beak" Format="rgba16" Width="8" Height="8" Offset="0x1600" />
<Texture Name="gNiwCombTex" OutName="comb" Format="rgba16" Width="16" Height="16" Offset="0x1680" />
<Texture Name="gNiwTailFeathersTex" OutName="tail_feathers" Format="rgba16" Width="32" Height="32" Offset="0x1880" />
<Texture Name="gNiwFootTex" OutName="foot" Format="rgba16" Width="8" Height="16" Offset="0x2080" />
<Texture Name="gNiwFeatherTex" OutName="feather" Format="rgba16" Width="16" Height="16" Offset="0x2180" />
<DList Name="gNiwFeatherMaterialDL" Offset="0x23B0" />
<DList Name="gNiwFeatherDL" Offset="0x2428" />
<Limb Name="object_niw_Standardlimb_002440" Type="Standard" EnumName="OBJECT_NIW_LIMB_01" Offset="0x2440" />
<Limb Name="object_niw_Standardlimb_00244C" Type="Standard" EnumName="OBJECT_NIW_LIMB_02" Offset="0x244C" />
<Limb Name="object_niw_Standardlimb_002458" Type="Standard" EnumName="OBJECT_NIW_LIMB_03" Offset="0x2458" />
<Limb Name="object_niw_Standardlimb_002464" Type="Standard" EnumName="OBJECT_NIW_LIMB_04" Offset="0x2464" />
<Limb Name="object_niw_Standardlimb_002470" Type="Standard" EnumName="OBJECT_NIW_LIMB_05" Offset="0x2470" />
<Limb Name="object_niw_Standardlimb_00247C" Type="Standard" EnumName="OBJECT_NIW_LIMB_06" Offset="0x247C" />
<Limb Name="object_niw_Standardlimb_002488" Type="Standard" EnumName="OBJECT_NIW_LIMB_07" Offset="0x2488" />
<Limb Name="object_niw_Standardlimb_002494" Type="Standard" EnumName="OBJECT_NIW_LIMB_08" Offset="0x2494" />
<Limb Name="object_niw_Standardlimb_0024A0" Type="Standard" EnumName="OBJECT_NIW_LIMB_09" Offset="0x24A0" />
<Limb Name="object_niw_Standardlimb_0024AC" Type="Standard" EnumName="OBJECT_NIW_LIMB_0A" Offset="0x24AC" />
<Limb Name="object_niw_Standardlimb_0024B8" Type="Standard" EnumName="OBJECT_NIW_LIMB_0B" Offset="0x24B8" />
<Limb Name="object_niw_Standardlimb_0024C4" Type="Standard" EnumName="OBJECT_NIW_LIMB_0C" Offset="0x24C4" />
<Limb Name="object_niw_Standardlimb_0024D0" Type="Standard" EnumName="OBJECT_NIW_LIMB_0D" Offset="0x24D0" />
<Limb Name="object_niw_Standardlimb_0024DC" Type="Standard" EnumName="OBJECT_NIW_LIMB_0E" Offset="0x24DC" />
<Limb Name="object_niw_Standardlimb_0024E8" Type="Standard" EnumName="OBJECT_NIW_LIMB_0F" Offset="0x24E8" />
<Skeleton Name="object_niw_Skel_002530" Type="Flex" LimbType="Standard" LimbNone="OBJECT_NIW_LIMB_NONE" LimbMax="OBJECT_NIW_LIMB_MAX" EnumName="object_niw_Limbs" Offset="0x2530" />
<Limb Name="gNiwRootLimb" LimbType="Standard" EnumName="NIW_LIMB_ROOT" Offset="0x2440"/>
<Limb Name="gNiwLimb_244C" LimbType="Standard" EnumName="NIW_LIMB_2" Offset="0x244C"/>
<Limb Name="gNiwLimb_2458" LimbType="Standard" EnumName="NIW_LIMB_3" Offset="0x2458"/>
<Limb Name="gNiwTailAndUndersideLimb" LimbType="Standard" EnumName="NIW_LIMB_UNDER_SIDE" Offset="0x2464"/>
<Limb Name="gNiwLeftFootRootLimb" LimbType="Standard" EnumName="NIW_LIMB_LEFT_FOOT_ROOT" Offset="0x2470"/>
<Limb Name="gNiwLeftFootLimb" LimbType="Standard" EnumName="NIW_LIMB_LEFT_FOOT" Offset="0x247C"/>
<Limb Name="gNiwLeftWingRootLimb" LimbType="Standard" EnumName="NIW_LIMB_LEFT_WING_ROOT" Offset="0x2488"/>
<Limb Name="gNiwLeftWingLimb" LimbType="Standard" EnumName="NIW_LIMB_LEFT_WING" Offset="0x2494"/>
<Limb Name="gNiwRightFootRootLimb" LimbType="Standard" EnumName="NIW_LIMB_RIGHT_FOOT_ROOT" Offset="0x24A0"/>
<Limb Name="gNiwRightFootLimb" LimbType="Standard" EnumName="NIW_LIMB_RIGHT_FOOT" Offset="0x24AC"/>
<Limb Name="gNiwRightWingRootLimb" LimbType="Standard" EnumName="NIW_LIMB_RIGHT_WING_ROOT" Offset="0x24B8"/>
<Limb Name="gNiwRightWingLimb" LimbType="Standard" EnumName="NIW_LIMB_RIGHT_WING" Offset="0x24C4"/>
<Limb Name="gNiwUpperBodyRootLimb" LimbType="Standard" EnumName="NIW_LIMB_UPPER_BODY" Offset="0x24D0"/>
<Limb Name="gNiwNeckLimb" LimbType="Standard" EnumName="NIW_LIMB_NECK" Offset="0x24DC"/>
<Limb Name="gNiwHeadLimb" LimbType="Standard" EnumName="NIW_LIMB_HEAD" Offset="0x24E8"/>
<Skeleton Name="gNiwSkeleton" Type="Flex" LimbType="Standard" LimbNone="NIW_LIMB_NONE" LimbMax="NIW_LIMB_MAX" EnumName="ObjectNiwLimbs" Offset="0x2530" />
</File>
</Root>
+37 -9
View File
@@ -1,29 +1,57 @@
<Root>
<!-- Cucco Chick: the little baby Cucco you find and raise in the Cucco Shack -->
<File Name="object_nwc" Segment="6">
<DList Name="object_nwc_DL_0002E0" Offset="0x2E0" />
<DList Name="object_nwc_DL_0002E8" Offset="0x2E8" />
<Texture Name="object_nwc_Tex_0004D0" OutName="tex_0004D0" Format="rgba16" Width="8" Height="8" Offset="0x4D0" />
<Texture Name="object_nwc_Tex_000550" OutName="tex_000550" Format="rgba16" Width="8" Height="8" Offset="0x550" />
<Texture Name="object_nwc_Tex_0005D0" OutName="tex_0005D0" Format="rgba16" Width="16" Height="16" Offset="0x5D0" />
<Texture Name="object_nwc_Tex_0007D0" OutName="tex_0007D0" Format="rgba16" Width="16" Height="16" Offset="0x7D0" />
<Texture Name="object_nwc_Tex_0009D0" OutName="tex_0009D0" Format="rgba16" Width="16" Height="16" Offset="0x9D0" />
<TextureAnimation Name="object_nwc_Matanimheader_000BEC" Offset="0xBEC" />
<DList Name="gNwcEndDL" Offset="0x2E0" />
<DList Name="gNwcBodyDL" Offset="0x2E8" />
<Texture Name="gNwcBodyTex" OutName="body" Format="rgba16" Width="8" Height="8" Offset="0x4D0" />
<Texture Name="gNwcBeakTex" OutName="beak" Format="rgba16" Width="8" Height="8" Offset="0x550" />
<!-- Wing texture is reused for tail feathers -->
<Texture Name="gNwcWingTex" OutName="wing" Format="rgba16" Width="16" Height="16" Offset="0x5D0" />
<Texture Name="gNwcEyeOpenTex" OutName="eye_opened" Format="rgba16" Width="16" Height="16" Offset="0x7D0" />
<Texture Name="gNwcEyeClosedTex" OutName="eye_closed" Format="rgba16" Width="16" Height="16" Offset="0x9D0" />
<!-- **************************************************************************************** -->
<!-- *** Beyond this point is unused content, including broken display lists and textures *** -->
<!-- **************************************************************************************** -->
<!-- this blinking animated texture seems unused, as the actor cycles through blinking with code -->
<TextureAnimation Name="gNwcBlinkTexAnim" Offset="0xBEC" />
<!-- unused multi-colored texture? -->
<Texture Name="object_nwc_Tex_000C00" OutName="tex_000C00" Format="rgba16" Width="32" Height="32" Offset="0xC00" />
<DList Name="object_nwc_DL_001440" Offset="0x1440" />
<DList Name="object_nwc_DL_0014B8" Offset="0x14B8" />
<DList Name="object_nwc_DL_001520" Offset="0x1520" />
<!-- dark gold ball texture -->
<Texture Name="object_nwc_Tex_001550" OutName="tex_001550" Format="rgba16" Width="16" Height="16" Offset="0x1550" />
<!-- gold color pallet? -->
<Texture Name="object_nwc_Tex_001750" OutName="tex_001750" Format="rgba16" Width="4" Height="4" Offset="0x1750" />
<!-- both of these display lists use the dark gold ball texture -->
<DList Name="object_nwc_DL_001860" Offset="0x1860" />
<DList Name="object_nwc_DL_0018D0" Offset="0x18D0" />
<!-- draws two untextured triangles like jack-o-lantern eyes -->
<DList Name="object_nwc_DL_001940" Offset="0x1940" />
<!-- both of these display lists use the yellow pallet texture -->
<DList Name="object_nwc_DL_001960" Offset="0x1960" />
<DList Name="object_nwc_DL_0019B8" Offset="0x19B8" />
<!-- in z64utils draws a un-textured tetrahedron -->
<DList Name="object_nwc_DL_001A10" Offset="0x1A10" />
<!-- <Blob Name="object_nwc_Blob_001A38" Size="0x108" Offset="0x1A38" /> -->
<!-- contains an unsupported texture (i16) used in an unused display list ( @ 0x1B80 ) -->
<!-- is type G_IM_FMT_I, G_IM_SIZ_16b, dimensions are best guesses from Texture64 renders -->
<Texture Name="object_nwc_Tex_001A40" OutName="broken_tex_gimfmti_001A40" Format="ia16" Width="8" Height="16" Offset="0x1A40" />
<!-- Z64Utils throws an error for this DL because of the above texture -->
<DList Name="object_nwc_DL_001B80" Offset="0x1B80" />
<!-- requires unassigned segment 0x01 matrix to render, no idea what its doing -->
<DList Name="object_nwc_DL_001BE8" Offset="0x1BE8" />
<!-- loads a dark spot from gameplay keep -->
<DList Name="object_nwc_DL_001C10" Offset="0x1C10" />
<!-- unused DL produces a yellow textured triangle -->
<DList Name="object_nwc_DL_001C58" Offset="0x1C58" />
</File>
</Root>
+73 -45
View File
@@ -1,49 +1,77 @@
<Root>
<!-- Assets for Eeno -->
<File Name="object_snowman" Segment="6">
<Animation Name="object_snowman_Anim_000404" Offset="0x404" />
<Animation Name="object_snowman_Anim_0007B4" Offset="0x7B4" />
<DList Name="object_snowman_DL_0010B0" Offset="0x10B0" />
<DList Name="object_snowman_DL_002428" Offset="0x2428" />
<DList Name="object_snowman_DL_002640" Offset="0x2640" />
<DList Name="object_snowman_DL_0028F0" Offset="0x28F0" />
<DList Name="object_snowman_DL_0029B0" Offset="0x29B0" />
<DList Name="object_snowman_DL_002A50" Offset="0x2A50" />
<DList Name="object_snowman_DL_002B20" Offset="0x2B20" />
<DList Name="object_snowman_DL_002C70" Offset="0x2C70" />
<DList Name="object_snowman_DL_002D10" Offset="0x2D10" />
<DList Name="object_snowman_DL_002DE0" Offset="0x2DE0" />
<DList Name="object_snowman_DL_002E70" Offset="0x2E70" />
<Texture Name="object_snowman_Tex_002F00" OutName="tex_002F00" Format="rgba16" Width="32" Height="64" Offset="0x2F00" />
<Texture Name="object_snowman_Tex_003F00" OutName="tex_003F00" Format="i4" Width="16" Height="16" Offset="0x3F00" />
<Texture Name="object_snowman_Tex_003F80" OutName="tex_003F80" Format="i8" Width="16" Height="16" Offset="0x3F80" />
<Texture Name="object_snowman_Tex_004080" OutName="tex_004080" Format="rgba16" Width="16" Height="16" Offset="0x4080" />
<DList Name="object_snowman_DL_004400" Offset="0x4400" />
<Limb Name="object_snowman_Standardlimb_0044F0" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_01" Offset="0x44F0" />
<Limb Name="object_snowman_Standardlimb_0044FC" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_02" Offset="0x44FC" />
<Limb Name="object_snowman_Standardlimb_004508" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_03" Offset="0x4508" />
<Limb Name="object_snowman_Standardlimb_004514" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_04" Offset="0x4514" />
<Limb Name="object_snowman_Standardlimb_004520" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_05" Offset="0x4520" />
<Limb Name="object_snowman_Standardlimb_00452C" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_06" Offset="0x452C" />
<Limb Name="object_snowman_Standardlimb_004538" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_07" Offset="0x4538" />
<Limb Name="object_snowman_Standardlimb_004544" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_08" Offset="0x4544" />
<Limb Name="object_snowman_Standardlimb_004550" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_09" Offset="0x4550" />
<Limb Name="object_snowman_Standardlimb_00455C" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_0A" Offset="0x455C" />
<Limb Name="object_snowman_Standardlimb_004568" Type="Standard" EnumName="OBJECT_SNOWMAN_1_LIMB_0B" Offset="0x4568" />
<Skeleton Name="object_snowman_Skel_0045A0" Type="Flex" LimbType="Standard" LimbNone="OBJECT_SNOWMAN_1_LIMB_NONE" LimbMax="OBJECT_SNOWMAN_1_LIMB_MAX" EnumName="object_snowman_1_Limbs" Offset="0x45A0" />
<Animation Name="object_snowman_Anim_004628" Offset="0x4628" />
<Animation Name="object_snowman_Anim_0046D8" Offset="0x46D8" />
<DList Name="object_snowman_DL_004960" Offset="0x4960" />
<DList Name="object_snowman_DL_0049E0" Offset="0x49E0" />
<Limb Name="object_snowman_Standardlimb_004A70" Type="Standard" EnumName="OBJECT_SNOWMAN_2_LIMB_01" Offset="0x4A70" />
<Limb Name="object_snowman_Standardlimb_004A7C" Type="Standard" EnumName="OBJECT_SNOWMAN_2_LIMB_02" Offset="0x4A7C" />
<Skeleton Name="object_snowman_Skel_004A90" Type="Flex" LimbType="Standard" LimbNone="OBJECT_SNOWMAN_2_LIMB_NONE" LimbMax="OBJECT_SNOWMAN_2_LIMB_MAX" EnumName="object_snowman_2_Limbs" Offset="0x4A90" />
<Animation Name="object_snowman_Anim_004F14" Offset="0x4F14" />
<Animation Name="object_snowman_Anim_00544C" Offset="0x544C" />
<Animation Name="object_snowman_Anim_00554C" Offset="0x554C" />
<Animation Name="object_snowman_Anim_0058CC" Offset="0x58CC" />
<DList Name="object_snowman_DL_005CB0" Offset="0x5CB0" />
<DList Name="object_snowman_DL_006190" Offset="0x6190" />
<DList Name="object_snowman_DL_006620" Offset="0x6620" />
<Texture Name="object_snowman_Tex_006730" OutName="tex_006730" Format="rgba16" Width="32" Height="64" Offset="0x6730" />
<!-- Eeno Animations -->
<Animation Name="gEenoLargeSnowballCreateAnim" Offset="0x404" /> <!-- Original name is "sm_ageA" ("go up/raise A") -->
<Animation Name="gEenoSmallSnowballCreateAnim" Offset="0x7B4" /> <!-- Original name is "sm_ageB" ("go up/raise B") -->
<!-- Eeno Large Snowball DisplayList -->
<DList Name="gEenoLargeSnowballDL" Offset="0x10B0" />
<!-- Eeno Limb DisplayLists -->
<DList Name="gEenoBodyBottomDL" Offset="0x2428" />
<DList Name="gEenoBodyTopDL" Offset="0x2640" />
<DList Name="gEenoRightUpperArmDL" Offset="0x28F0" />
<DList Name="gEenoRightForearmDL" Offset="0x29B0" />
<DList Name="gEenoRightHandDL" Offset="0x2A50" />
<DList Name="gEenoLeftUpperArmDL" Offset="0x2B20" />
<DList Name="gEenoLeftForearmDL" Offset="0x2C70" />
<DList Name="gEenoLeftHandDL" Offset="0x2D10" />
<DList Name="gEenoRightEyeDL" Offset="0x2DE0" />
<DList Name="gEenoLeftEyeDL" Offset="0x2E70" />
<!-- Eeno Textures -->
<Texture Name="gEenoFaceTex" OutName="eeno_face" Format="rgba16" Width="32" Height="64" Offset="0x2F00" />
<Texture Name="gEenoUpperCheekTex" OutName="eeno_upper_cheek" Format="i4" Width="16" Height="16" Offset="0x3F00" />
<Texture Name="gEenoBodyTex" OutName="eeno_body" Format="i8" Width="16" Height="16" Offset="0x3F80" />
<Texture Name="gEenoEyeTex" OutName="eeno_eye" Format="rgba16" Width="16" Height="16" Offset="0x4080" />
<!-- Eeno Small Snowball DisplayList -->
<DList Name="gEenoSmallSnowballDL" Offset="0x4400" />
<!-- Eeno Limbs -->
<Limb Name="gEenoRootLimb" Type="Standard" EnumName="EENO_LIMB_ROOT" Offset="0x44F0" />
<Limb Name="gEenoBodyTopLimb" Type="Standard" EnumName="EENO_LIMB_BODY_TOP" Offset="0x44FC" />
<Limb Name="gEenoLeftEyeLimb" Type="Standard" EnumName="EENO_LIMB_LEFT_EYE" Offset="0x4508" />
<Limb Name="gEenoRightEyeLimb" Type="Standard" EnumName="EENO_LIMB_RIGHT_EYE" Offset="0x4514" />
<Limb Name="gEenoLeftUpperArmLimb" Type="Standard" EnumName="EENO_LIMB_LEFT_UPPER_ARM" Offset="0x4520" />
<Limb Name="gEenoLeftForearmLimb" Type="Standard" EnumName="EENO_LIMB_LEFT_FOREARM" Offset="0x452C" />
<Limb Name="gEenoLeftHandLimb" Type="Standard" EnumName="EENO_LIMB_LEFT_HAND" Offset="0x4538" />
<Limb Name="gEenoRightUpperArmLimb" Type="Standard" EnumName="EENO_LIMB_RIGHT_UPPER_ARM" Offset="0x4544" />
<Limb Name="gEenoRightForearmLimb" Type="Standard" EnumName="EENO_LIMB_RIGHT_FOREARM" Offset="0x4550" />
<Limb Name="gEenoRightHandLimb" Type="Standard" EnumName="EENO_LIMB_RIGHT_HAND" Offset="0x455C" />
<Limb Name="gEenoBodyBottomLimb" Type="Standard" EnumName="EENO_LIMB_BODY_BOTTOM" Offset="0x4568" />
<!-- Eeno Skeleton -->
<Skeleton Name="gEenoSkel" Type="Flex" LimbType="Standard" LimbNone="EENO_LIMB_NONE" LimbMax="EENO_LIMB_MAX" EnumName="EenoLimbs" Offset="0x45A0" />
<!-- Eeno Animations -->
<Animation Name="gEenoDamageAnim" Offset="0x4628" /> <!-- Original name is "sm_damege" -->
<Animation Name="gEenoSnowPileMoveAnim" Offset="0x46D8" /> <!-- Original name is "sm_fukurami" ("to swell") -->
<!-- Eeno Snow Pile Limb DisplayLists -->
<DList Name="gEenoSnowPileBottomDL" Offset="0x4960" />
<DList Name="gEenoSnowPileTopDL" Offset="0x49E0" />
<!-- Eeno Snow Pile Limbs -->
<Limb Name="gEenoSnowPileBottomLimb" Type="Standard" EnumName="EENO_SNOW_PILE_LIMB_BOTTOM" Offset="0x4A70" />
<Limb Name="gEenoSnowPileTopLimb" Type="Standard" EnumName="EENO_SNOW_PILE_LIMB_TOP" Offset="0x4A7C" />
<!-- Eeno Snow Pile Skeleton -->
<Skeleton Name="gEenoSnowPileSkel" Type="Flex" LimbType="Standard" LimbNone="EENO_SNOW_PILE_LIMB_NONE" LimbMax="EENO_SNOW_PILE_LIMB_MAX" EnumName="EenoSnowPileLimbs" Offset="0x4A90" />
<!-- Eeno Animations -->
<Animation Name="gEenoLargeSnowballThrowAnim" Offset="0x4F14" /> <!-- Original name is "sm_nageA" ("throw A") -->
<Animation Name="gEenoSmallSnowballThrowAnim" Offset="0x544C" /> <!-- Original name is "sm_nageB" ("throw B") -->
<Animation Name="gEenoEmergeAnim" Offset="0x554C" /> <!-- Original name is "sm_tojo" ("appearance") -->
<Animation Name="gEenoIdleAnim" Offset="0x58CC" /> <!-- Original name is "sm_wait" -->
<!-- Eeno Snowball Fragment DisplayLists -->
<DList Name="gEenoSnowballFragment1DL" Offset="0x5CB0" />
<DList Name="gEenoSnowballFragment2DL" Offset="0x6190" />
<DList Name="gEenoSnowballFragment3DL" Offset="0x6620" />
<!-- Eeno Snowball Fragment Texture -->
<Texture Name="gEenoSnowballFragmentTex" OutName="eeno_snowball_fragment" Format="rgba16" Width="32" Height="64" Offset="0x6730" />
</File>
</Root>
+3 -3
View File
@@ -8,7 +8,7 @@
<DList Name="object_wiz_DL_000F28" Offset="0xF28" />
<DList Name="object_wiz_DL_000FD8" Offset="0xFD8" />
<DList Name="object_wiz_DL_0010E0" Offset="0x10E0" />
<DList Name="object_wiz_DL_0010E8" Offset="0x10E8" />
<DList Name="gWizzrobePlatform" Offset="0x10E8" />
<Texture Name="object_wiz_Tex_001198" OutName="tex_001198" Format="rgba16" Width="16" Height="32" Offset="0x1198" />
<!-- <Blob Name="object_wiz_Blob_0015A0" Size="0x10" Offset="0x15A0" /> -->
<Collision Name="object_wiz_Colheader_001690" Offset="0x1690" />
@@ -40,11 +40,11 @@
<Texture Name="object_wiz_Tex_005230" OutName="tex_005230" Format="i4" Width="32" Height="64" Offset="0x5230" />
<Texture Name="object_wiz_Tex_005630" OutName="tex_005630" Format="i4" Width="16" Height="16" Offset="0x5630" />
<DList Name="object_wiz_DL_005750" Offset="0x5750" />
<DList Name="object_wiz_DL_005870" Offset="0x5870" />
<DList Name="gWizzrobePlatformCenter" Offset="0x5870" />
<DList Name="object_wiz_DL_005938" Offset="0x5938" />
<Texture Name="object_wiz_Tex_005940" OutName="tex_005940" Format="i4" Width="32" Height="32" Offset="0x5940" />
<Texture Name="object_wiz_Tex_005B40" OutName="tex_005B40" Format="i4" Width="16" Height="32" Offset="0x5B40" />
<TextureAnimation Name="object_wiz_Matanimheader_005C64" Offset="0x5C64" />
<TextureAnimation Name="gWizzrobePlatformTexAnim" Offset="0x5C64" />
<Animation Name="object_wiz_Anim_0060E8" Offset="0x60E8" />
<Animation Name="object_wiz_Anim_0066C0" Offset="0x66C0" />
<DList Name="object_wiz_DL_008640" Offset="0x8640" />
+59
View File
@@ -0,0 +1,59 @@
# Reviewing Pull Requests to the Majora's Mask Decompilation Project
Thanks for helping us reverse engineer *The Legend of Zelda: Majora's Mask*!
We encourage all contributors to participate in code review: this is your codebase too!
Every review submitted helps us keep code quality high and code merged in more quickly.
This document is meant to be a set of tips and guidelines for reviewers of pull requests to the project.
For general information about the project, see [our readme](https://github.com/zeldaret/mm/blob/master/README.md).
Most discussions happen on our [Discord Server](https://discord.zelda64.dev) 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.
Other links are available in the [CONTRIBUTING.md](CONTRIBUTING.md)
## Getting Started
### What should I know to take part in the review process?
You should first famiiarise yourself with our [Contributing guide](CONTRIBUTING.md) and [Style guide](docs/STYLE.md). It is also recommended that you have already successfully submitted a merged pull request to understand how the process works before submitting a review.
## Pull Requests (PRs)
### How to review a Pull Request
- When reviewing a PR it is suggested that you follow the checklist outlined in this section.
- You are not required to go through *every* item in the checklist. It is meant as a guide; if you have only one thing you want to mention, that's fine too.
- Once the PR author has addressed all of your comments, you should add a review with approval to the PR to signify to the project leads that this PR has been through peer review.
- If someone does not address your comments and expresses that a different way is better than yours, look for feedback from other contributors (we encourage discussing this sort of thing in Discord, since long GitHub conversations get hard to read). The project leads will have final say in these situations. All decisions are generally guided by a consensus of contributors.
### Reviewer Checklist
- [ ] Jenkins build is successful.
- [ ] `make` builds a matching ROM.
- [ ] `format.sh` was run.
- [ ] `spec` contains correct relocation files.
- [ ] Any new compiler warnings that were added are required for matching. Ensure there is good reason if the warnings files have changed.
- [ ] Files with `NON_MATCHING` functions have equivalent behaviour.
- [ ] `code` and `boot` segment files should be documented as much as possible. Overlays with documentation should be as complete as is reasonable.
- [ ] Overlays should have macros to define access to parameters if the parameter uses bitwise access. The params should have an enum when it makes sense.
- [ ] Comments and variables have correct spelling.
- [ ] The following should be declared in an Actor header file. There should be nothing else in the Actor header file.
- [ ] Main Actor struct
- [ ] Extern'd initVar data.
- [ ] Types used in the actor struct. Specific example would be actionFunc typedefs.
- [ ] Param field macros and/or enums.
- [ ] For any other additional `enum`/`struct`/`define`/`function`/`global`, there needs to be evidence it is needed in another file.
- [ ] New variables and functions should follow standard naming conventions.
- [ ] Constants are converted to whichever looks best in context: hexadecimal, decimal, or float
- [ ] Rotation angles should always be in hexadecimal
- [ ] Colour values should always be in decimal.
- [ ] Functions, structs, unions, enums, and typedefs are `TitleCase` (`DmRavine`)
- [ ] Functions within a system separate the system from the function's own subname with an underscore (`DmRavine_Init`)
- [ ] Variable names are `camelCase` (`actionFunc`)
- [ ] Global variables start with `g` (`gSaveContext`)
- [ ] Static global variables start with `s` (`sSphereInit`)
- [ ] Macros and enum constants are `SCREAMING_SNAKE_CASE` (`DM_RAVINE_STATE_ACTIVE`)
- [ ] Trailing commas in array and struct definitions chosen to make it look best (see e.g. `EnJcMatoDamageTable`)
etc.
+232
View File
@@ -0,0 +1,232 @@
# Majora's Mask decompilation style guide
In general, completed documented files are a good place to look to understand project style in general.
## Types
Use the types from `ultratypes.h`, not the standard C types: i.e. `u8`,`s8`,`s16`,`u16`,`s32`,`u32`,`f32` rather than `char`, `short`, `int`, `float` and their `signed`/`unsigned` varieties.
We always write our enums and structs as `typedef`s. (Usually one can't use an enum typedef as a function argument since enum typedefs are implicitly `s32`.)
## Naming
Names are "big-endian": the most significant/largest part of the system goes first, e.g. `DM_RAVINE_STATE_ACTIVE` rather than `DM_RAVINE_ACTIVE_STATE`.
| Type | Style | Example |
| -------------------- | ----------------------- | ----------------------- |
| Local variables | camelCase | `yawToPlayer` |
| Global variables | gCamelCase | `gSaveContext` |
| Static variables[^1] | sCamelCase | `sZeroVec` |
| Struct members | camelCase | `actionFunc` |
| Struct names | PascalCase | `EnFirefly` |
| Enum types | PascalCase | `EnFireflyMainType` |
| Enum values | SCREAMING_SNAKE_CASE | `AT_ON` |
| Defines/macros | SCREAMING_SNAKE_CASE | `SCREEN_WIDTH`,`ABS(x)` |
| Functions | SystemName_FunctionName | `Actor_SpawnAsChild` |
| Files | snake_case | `z_en_firefly.c` |
[^1]: including in-function static
Action functions are usually named with a simple present-tense verb or verb phrase: `{...}_Talk`, `{...}_Wait`, `{...}_FallToGround`, etc. Setup functions are `Setup{name of action}`.
Ideally names should be both short and clear, although it's better to be clear than short.
## Formatting
A lot of formatting is done by clang-format, such as
- indent is 4 spaces, tabs are not used
- case labels indented
- 120 column limit
- brackets go on the same line (`if (1) {`)
- pointer goes on type (`s32* var;` not `s32 *var;`)
There are various other conventions that it does not catch, though:
- Blank line between declarations and code:
```c
s32 var;
func();
```
- combine declarations and definitions if possible:
```c
s32 var = 0;
func();
```
instead of
```c
s32 var;
var = 0;
func();
```
- blank lines between switch cases if they're long (use your judgement).
## Numbers
### dec(imal)
- timers
- colours and alpha
- Usually array accesses and sizes
### hex(adecimal)
- angles (for now; the code itself is very inconsistent with round hex, round dec, and degrees)
- Addresses
- Bitmasks (i.e. `& 0x80` etc.)
- Struct offset comments
Numbers below `10`/`0xA` do not need the `0x` if by themselves in code.
### Booleans
If a function returns only `0` or `1`, and is used as a boolean (i.e. in conditionals), replace the returns by `false` and `true`. (We do not use `bool`, partly because is a C99 thing, and partly because the original has used almost every integer type as a boolean return at some point!)
### Floats
Floats usually need an `f` on the end to match, or IDO will use doubles. Our floats are always of the form `1.0f`, even when the decimal part is zero.
## Conditionals/Loops
- Spacing out conditional or loop blocks from surrounding code often makes them easier to read.
- Avoid assigning or mutating variables in conditionals if possible (including `++`/`--`), avoid side effects in the loop increment slot (i.e. incrementing/assigning to loop variables is fine, something like `*a = b++` is not).
- We *always* use `{}` on conditional/loop blocks, even if they're one line (clang-tidy will enforce this).
- When conditions are `&&`d or `||`d together, use brackets around each that includes an arithmetic comparison or bitwise operator (i.e. not `!var` or `func()`, but ones with `==` or `&` etc.)
- Flag checks or functions that return booleans do not need the `== 0`/`!= 0`.
- Prefer `if-else` over `if { return; }`, i.e.
```c
if (cond) {
foo();
} else {
bar();
}
```
over
```c
if (cond) {
foo();
return;
}
bar();
```
**Exception**: After `Actor_MarkForDeath` or sometimes setting the action function, if it makes sense to do so (this expresses the finality a bit better).
## Macros and enums
Become familiar with the various defines and enums we have available. There are too many to list all of them here, but the following are common:
- Those in `macros.h`
- `ABS`, `ABS_ALT`,
- `CLAMP` and friends,
- `BINANG_*`, which are used for angles, especially when there's a lot of `s16` casts around
- `MTXMODE` for many of the `sys_matrix` functions
- CollisionCheck flags: `AT_ON` and so on. Pick the appropriate one for the collider type.
- Actor flags, `ACTOR_FLAG_N`.
Damage flag enums are not being used at present: we want to wait until we have a better idea what the common groupings should be.
Pre-C99, commas at the end of the last item in an enum will cause a compiler warning, so leave them off.
All compound flag lists (e.g. `ACTOR_FLAG_4 | ACTOR_FLAG_8`) should be listed in *ascending* order
## Arrays
- It's better to not hardcode array sizes (easier to mod)
- Use `sizeof` or `ARRAY_COUNT`/`ARRAY_COUNTU` where it makes sense, e.g. in loops that are using an array.
- clang-format sometimes does weird things to array formatting. Experiment with and without a comma after the last element and see which looks better.
## GlobalCtx2
In some particular instances, IDO requires the function argument `globalCtx` to be cast to a second variable of the same type to match. In these particular instances, the function argument should be renamed to `globalCtx2` and than this `globalCtx2` just assigned to a stack variable called `globalCtx`. This cast should occur before the actor `THIS` cast is made. For example in `z_en_firefly.c`
```c
void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
EnFirefly* this = THIS;
```
In other places the cast is actually not explictly needed, but a stack `pad` variable is still needed. For this there should just be a stack variable called `pad` of type `s32` before the actor `THIS` cast. For example in `z_bg_goron_oyu`
```c
void BgGoronOyu_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
BgGoronOyu* this = THIS;
CollisionHeader* colHeader = NULL;
```
In general, pads should be `s32`, or `s16`/`s8` if required.
## Documentation and Comments
Documentation includes:
- Naming functions
- Naming struct variables
- Naming data
- Naming local variables
- Describing the general purpose of the file
- Describing any unusual, interesting or strange features of how the file or parts of its content work
- Labelling and explaining bugs
- Making enums or defines for significant numbers for the file, like actor params values.
- Naming the contents of the asset file(s) the file may use (for an actor, the object(s) it uses)
If you are not sure what something does, it is better to leave it unnamed than name it wrongly. It is fine to make a note of something you are not sure about when PRing, it means the reviewers will pay special attention to it.
We use comments for:
- Top of file: a short description of the system. For actors there is already a brief description of our current understanding, but feel free to add to it.
- For function descriptions, we use multiline comments,
```c
/**
* Describe what the function does
*/
```
These are *optional*: if you think the code is clear enough, you do not need to put a comment. You can use Doxygen formatting if you think it adds something, but it is also not required.
- If something in a function is strange, or unintuitive, do leave a comment explaining what's going on. We use `//` for this.
- We also use `//` for temporary comments above a function. Feel free to use `TODO:` in these if appropriate.
- A bug should be commented with an `//! @bug Bug description` above the code that causes the bug.
## What goes where
This section mostly applies to actors.
### Functions
All functions should go in the main C file in the same order as the assembly (the latter is required to match anyway). (We may make exceptions for particularly large files with a particular organisational structure, but we ask that you check on Discord first before doing this)
### Data
- If in doubt, leave all the data at the top of the file. Reviewers will decide for you.
- Data must go in the same order as in the assembly files, but is only constrained by other data, not functions or rodata.
- Some data has to be inline static to match. Generally it's better to not use `static` on data outside funtions until the file is matching, since `static` data is left out of the mapfile and this makes debugging harder.
- *This is even more true of bss, where we have trouble with IDO unpredictably reordering it in certain files.*
- For small arrays or simple data that is used in only one function, we usually inline it, if it fits in the ordering.
- Generally data that is only used by the draw functions is put down near them: this is one of the few consistencies in ordering of actors' functions.
### Enums and defines
- Actors that bitpack params should have macros made for each access or write that is made. `z_en_dg.h` has an undocumented example,
```c
#define ENDG_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA)
#define ENDG_GET_3E0(thisx) (((thisx)->params & 0x3E0) >> 5)
```
while `z_en_firefly.h` has a documented one,
```c
#define KEESE_INVISIBLE (1 << 0xF)
#define KEESE_GET_MAIN_TYPE(thisx) ((thisx)->params & 0x7FFF)
```
- In a similar manner, actors that use `home.rot.(x|y|z)` like params should also macros made for accesses and writes. (See, e.g. `z_obj_bean.h`.)
- Stuff that only the actor itself will use goes in the C file unless needed in the header.
- Anything actor-specific that might be used by another file goes in the header, in particular params access macros.
- Anything that is expected to have widespread use should go in `macros.h` or an appropriate header in `include`.
### Objects
Are covered in the [ZAPD extraction xml spec](../tools/ZAPD/docs/zapd_extraction_xml_reference.md). Symbol names are `gPrefixDescriptionSuffix` for symbols accessed from the header (they will be global). Texture OutNames are in snake_case since they are filenames.
## Above all else
*All of the above is subservient to matching.* Sometimes IDO cares about newlines, for example.
If you are not sure about any of the above, please ask in Discord.
+4 -4
View File
@@ -235,8 +235,8 @@ void func_80C10590(GlobalContext *globalCtx, s32 limbIndex, Actor *thisx) {
EnRecepgirl* this = THIS;
if (limbIndex == 5) {
Matrix_RotateY(0x400 - this->unk_2AE.x, MTXMODE_APPLY);
Matrix_GetStateTranslationAndScaledX(500.0f, &this->actor.focus.pos);
Matrix_RotateYS(0x400 - this->unk_2AE.x, MTXMODE_APPLY);
Matrix_MultVecX(500.0f, &this->actor.focus.pos);
}
}
@@ -426,8 +426,8 @@ void EnRecepgirl_UnkLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thi
EnRecepgirl* this = THIS;
if (limbIndex == 5) {
Matrix_RotateY(0x400 - this->unk_2AE.x, MTXMODE_APPLY);
Matrix_GetStateTranslationAndScaledX(500.0f, &this->actor.focus.pos);
Matrix_RotateYS(0x400 - this->unk_2AE.x, MTXMODE_APPLY);
Matrix_MultVecX(500.0f, &this->actor.focus.pos);
}
}
```
+7 -7
View File
@@ -163,22 +163,22 @@ As for the TransformLimbDraw, it has a much simpler prototype. mips2c gives
```C
void func_80C10590(GlobalContext *globalCtx, s32 limbIndex, Actor *actor) {
if (limbIndex == 5) {
Matrix_RotateY((s16) (0x400 - actor->unk2AE), 1);
Matrix_GetStateTranslationAndScaledX(500.0f, (Vec3f *) &actor->focus);
Matrix_RotateYS((s16) (0x400 - actor->unk2AE), 1);
Matrix_MultVecX(500.0f, (Vec3f *) &actor->focus);
}
}
```
There is only minor cleanup needed here:
- recasting the last argument,
- replacing the last argument of `Matrix_RotateY` by the enum `MTXMODE_APPLY` (which means "use the current matrix instead of starting from a new identity matrix"), and the first argument by `0x400 - this->unk_2AE.x`.
- replacing the last argument of `Matrix_RotateYS` by the enum `MTXMODE_APPLY` (which means "use the current matrix instead of starting from a new identity matrix"), and the first argument by `0x400 - this->unk_2AE.x`.
- `(Vec3f *) &actor->focus` to `&actor->focus.pos` (this is the same issue as `(Actor*)this`, where mips2c doesn't climb deep enough into the struct).
```C
void func_80C10590(GlobalContext *globalCtx, s32 limbIndex, Actor *thisx) {
EnRecepgirl* this = THIS;
if (limbIndex == 5) {
Matrix_RotateY(0x400 - this->unk_2AE.x, MTXMODE_APPLY);
Matrix_GetStateTranslationAndScaledX(500.0f, &this->actor.focus.pos);
Matrix_RotateYS(0x400 - this->unk_2AE.x, MTXMODE_APPLY);
Matrix_MultVecX(500.0f, &this->actor.focus.pos);
}
}
```
@@ -213,7 +213,7 @@ void ObjTree_Draw(Actor *thisx, GlobalContext *globalCtx) {
temp_s0->polyOpa.p = temp_v0_2 + 8;
temp_v0_2->words.w1 = (u32) &D_06000680;
temp_v0_2->words.w0 = 0xDE000000;
Matrix_InsertRotation(sp36, 0, sp34, 1);
Matrix_RotateZYX(sp36, 0, sp34, 1);
temp_v0_3 = temp_s0->polyOpa.p;
temp_s0->polyOpa.p = temp_v0_3 + 8;
temp_v0_3->words.w0 = 0xDA380003;
@@ -286,7 +286,7 @@ void ObjTree_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_06000680);
Matrix_InsertRotation(sp36, 0, sp34, MTXMODE_APPLY);
Matrix_RotateZYX(sp36, 0, sp34, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_060007C8);
+317 -48
View File
@@ -1347,60 +1347,329 @@ typedef union {
long int force_structure_alignment[4];
} Hilite;
#define gdSPDefLights0(ar,ag,ab) \
{ {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
{{{ { 0, 0, 0},0,{ 0, 0, 0},0,{ 0, 0, 0},0}}} }
#define gdSPDefLights1(ar,ag,ab,r1,g1,b1,x1,y1,z1) \
{ {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
{{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}} }
#define gdSPDefLights2(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2) \
{ {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
{{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
{{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}} }
#define gdSPDefLights3(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3) \
{ {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
{{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
{{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
{{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}} }
#define gdSPDefLights4(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4) \
{ {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
{{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
{{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
{{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \
{{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}} }
#define gdSPDefLights5(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5) \
{ {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
{{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
{{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
{{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \
{{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \
{{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}} }
#define gdSPDefLights0(ar,ag,ab) \
{ \
{{ \
{ ar, ag, ab }, 0, \
{ ar, ag, ab }, 0 \
}}, \
{ \
{{ \
{ 0, 0, 0 }, 0, \
{ 0, 0, 0 }, 0, \
{ 0, 0, 0 }, 0 \
}} \
} \
}
#define gdSPDefLights1(ar,ag,ab, \
r1,g1,b1, \
x1,y1,z1) \
{ \
{{ \
{ ar, ag, ab }, 0, \
{ ar, ag, ab }, 0 \
}}, \
{ \
{{ \
{ r1, g1, b1 }, 0, \
{ r1, g1, b1 }, 0, \
{ x1, y1, z1 }, 0 \
}} \
} \
}
#define gdSPDefLights6(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5,r6,g6,b6,x6,y6,z6) \
{ {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
{{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
{{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
{{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \
{{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \
{{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}, \
{{ {r6,g6,b6},0,{r6,g6,b6},0,{x6,y6,z6},0}}} }
#define gdSPDefLights2(ar,ag,ab, \
r1,g1,b1, \
x1,y1,z1, \
r2,g2,b2, \
x2,y2,z2) \
{ \
{{ \
{ ar, ag, ab }, 0, \
{ ar, ag, ab }, 0 \
}}, \
{ \
{{ \
{ r1, g1, b1 }, 0, \
{ r1, g1, b1 }, 0, \
{ x1, y1, z1 }, 0 \
}}, \
{{ \
{ r2, g2, b2 }, 0, \
{ r2, g2, b2 }, 0, \
{ x2, y2, z2 }, 0 \
}} \
} \
}
#define gdSPDefLights3(ar,ag,ab, \
r1,g1,b1, \
x1,y1,z1, \
r2,g2,b2, \
x2,y2,z2, \
r3,g3,b3, \
x3,y3,z3) \
{ \
{{ \
{ ar, ag, ab }, 0, \
{ ar, ag, ab }, 0 \
}}, \
{ \
{{ \
{ r1, g1, b1 }, 0, \
{ r1, g1, b1 }, 0, \
{ x1, y1, z1 }, 0 \
}}, \
{{ \
{ r2, g2, b2 }, 0, \
{ r2, g2, b2 }, 0, \
{ x2, y2, z2 }, 0 \
}}, \
{{ \
{ r3, g3, b3 }, 0, \
{ r3, g3, b3 }, 0, \
{ x3, y3, z3 }, 0 \
}} \
} \
}
#define gdSPDefLights7(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5,r6,g6,b6,x6,y6,z6,r7,g7,b7,x7,y7,z7) \
{ {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \
{{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \
{{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \
{{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \
{{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \
{{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}, \
{{ {r6,g6,b6},0,{r6,g6,b6},0,{x6,y6,z6},0}}, \
{{ {r7,g7,b7},0,{r7,g7,b7},0,{x7,y7,z7},0}}} }
#define gdSPDefLights4(ar,ag,ab, \
r1,g1,b1, \
x1,y1,z1, \
r2,g2,b2, \
x2,y2,z2, \
r3,g3,b3, \
x3,y3,z3, \
r4,g4,b4, \
x4,y4,z4) \
{ \
{{ \
{ ar, ag, ab }, 0, \
{ ar, ag, ab }, 0 \
}}, \
{ \
{{ \
{ r1, g1, b1 }, 0, \
{ r1, g1, b1 }, 0, \
{ x1, y1, z1 }, 0 \
}}, \
{{ \
{ r2, g2, b2 }, 0, \
{ r2, g2, b2 }, 0, \
{ x2, y2, z2 }, 0 \
}}, \
{{ \
{ r3, g3, b3 }, 0, \
{ r3, g3, b3 }, 0, \
{ x3, y3, z3 }, 0 \
}}, \
{{ \
{ r4, g4, b4 }, 0, \
{ r4, g4, b4 }, 0, \
{ x4, y4, z4 }, 0 \
}} \
} \
}
#define gdSPDefLights5(ar,ag,ab, \
r1,g1,b1, \
x1,y1,z1, \
r2,g2,b2, \
x2,y2,z2, \
r3,g3,b3, \
x3,y3,z3, \
r4,g4,b4, \
x4,y4,z4, \
r5,g5,b5, \
x5,y5,z5) \
{ \
{{ \
{ ar, ag, ab }, 0, \
{ ar, ag, ab }, 0 \
}}, \
{ \
{{ \
{ r1, g1, b1 }, 0, \
{ r1, g1, b1 }, 0, \
{ x1, y1, z1 }, 0 \
}}, \
{{ \
{ r2, g2, b2 }, 0, \
{ r2, g2, b2 }, 0, \
{ x2, y2, z2 }, 0 \
}}, \
{{ \
{ r3, g3, b3 }, 0, \
{ r3, g3, b3 }, 0, \
{ x3, y3, z3 }, 0 \
}}, \
{{ \
{ r4, g4, b4 }, 0, \
{ r4, g4, b4 }, 0, \
{ x4, y4, z4 }, 0 \
}}, \
{{ \
{ r5, g5, b5 }, 0, \
{ r5, g5, b5 }, 0, \
{ x5, y5, z5 }, 0 \
}} \
} \
}
#define gdSPDefLookAt(rightx,righty,rightz,upx,upy,upz) \
{ {{ {{0,0,0},0,{0,0,0},0,{rightx,righty,rightz},0}}, \
{ {{0,0x80,0},0,{0,0x80,0},0,{upx,upy,upz},0}}} }
#define gdSPDefLights6(ar,ag,ab, \
r1,g1,b1, \
x1,y1,z1, \
r2,g2,b2, \
x2,y2,z2, \
r3,g3,b3, \
x3,y3,z3, \
r4,g4,b4, \
x4,y4,z4, \
r5,g5,b5, \
x5,y5,z5, \
r6,g6,b6, \
x6,y6,z6) \
{ \
{{ \
{ ar, ag, ab }, 0, \
{ ar, ag, ab }, 0 \
}}, \
{ \
{{ \
{ r1, g1, b1 }, 0, \
{ r1, g1, b1 }, 0, \
{ x1, y1, z1 }, 0 \
}}, \
{{ \
{ r2, g2, b2 }, 0, \
{ r2, g2, b2 }, 0, \
{ x2, y2, z2 }, 0 \
}}, \
{{ \
{ r3, g3, b3 }, 0, \
{ r3, g3, b3 }, 0, \
{ x3, y3, z3 }, 0 \
}}, \
{{ \
{ r4, g4, b4 }, 0, \
{ r4, g4, b4 }, 0, \
{ x4, y4, z4 }, 0 \
}}, \
{{ \
{ r5, g5, b5 }, 0, \
{ r5, g5, b5 }, 0, \
{ x5, y5, z5 }, 0 \
}}, \
{{ \
{ r6, g6, b6 }, 0, \
{ r6, g6, b6 }, 0, \
{ x6, y6, z6 }, 0 \
}} \
} \
}
#define gdSPDefLights7(ar,ag,ab, \
r1,g1,b1, \
x1,y1,z1, \
r2,g2,b2, \
x2,y2,z2, \
r3,g3,b3, \
x3,y3,z3, \
r4,g4,b4, \
x4,y4,z4, \
r5,g5,b5, \
x5,y5,z5, \
r6,g6,b6, \
x6,y6,z6, \
r7,g7,b7, \
x7,y7,z7) \
{ \
{{ \
{ ar, ag, ab }, 0, \
{ ar, ag, ab }, 0 \
}}, \
{ \
{{ \
{ r1, g1, b1 }, 0, \
{ r1, g1, b1 }, 0, \
{ x1, y1, z1 }, 0 \
}}, \
{{ \
{ r2, g2, b2 }, 0, \
{ r2, g2, b2 }, 0, \
{ x2, y2, z2 }, 0 \
}}, \
{{ \
{ r3, g3, b3 }, 0, \
{ r3, g3, b3 }, 0, \
{ x3, y3, z3 }, 0 \
}}, \
{{ \
{ r4, g4, b4 }, 0, \
{ r4, g4, b4 }, 0, \
{ x4, y4, z4 }, 0 \
}}, \
{{ \
{ r5, g5, b5 }, 0, \
{ r5, g5, b5 }, 0, \
{ x5, y5, z5 }, 0 \
}}, \
{{ \
{ r6, g6, b6 }, 0, \
{ r6, g6, b6 }, 0, \
{ x6, y6, z6 }, 0 \
}}, \
{{ \
{ r7, g7, b7 }, 0, \
{ r7, g7, b7 }, 0, \
{ x7, y7, z7 }, 0 \
}} \
} \
}
#define gdSPDefLookAt(rightx,righty,rightz,upx,upy,upz) \
{{ \
{{ \
{ 0, 0, 0 }, 0, \
{ 0, 0, 0 }, 0, \
{ rightx, righty, rightz }, 0 \
}}, \
{{ \
{ 0, 0x80, 0 }, 0, \
{ 0, 0x80, 0 }, 0, \
{ upx, upy, upz }, 0 \
}} \
}}
#define qs1616(e) ((s32)((e) * 0x00010000))
#define IPART(x) ((qs1616(x) >> 16) & 0xFFFF)
#define FPART(x) (qs1616(x) & 0xFFFF)
#define gdSPDefMtx( \
xx, yx, zx, wx, \
xy, yy, zy, wy, \
xz, yz, zz, wz, \
xw, yw, zw, ww) \
{{ \
(IPART(xx) << 0x10) | IPART(xy), \
(IPART(xz) << 0x10) | IPART(xw), \
(IPART(yx) << 0x10) | IPART(yy), \
(IPART(yz) << 0x10) | IPART(yw), \
(IPART(zx) << 0x10) | IPART(zy), \
(IPART(zz) << 0x10) | IPART(zw), \
(IPART(wx) << 0x10) | IPART(wy), \
(IPART(wz) << 0x10) | IPART(ww), \
(FPART(xx) << 0x10) | FPART(xy), \
(FPART(xz) << 0x10) | FPART(xw), \
(FPART(yx) << 0x10) | FPART(yy), \
(FPART(yz) << 0x10) | FPART(yw), \
(FPART(zx) << 0x10) | FPART(zy), \
(FPART(zz) << 0x10) | FPART(zw), \
(FPART(wx) << 0x10) | FPART(wy), \
(FPART(wz) << 0x10) | FPART(ww), \
}}
/*
* Graphics DMA Packet
+8 -4
View File
@@ -27,6 +27,10 @@ typedef void* TexturePtr;
typedef long int Mtx_t[4][4];
typedef union {
Mtx_t m;
struct {
u16 intPart[4][4];
u16 fracPart[4][4];
};
long long int forc_structure_alignment;
} Mtx; // size = 0x40
@@ -34,10 +38,10 @@ typedef float MtxF_t[4][4];
typedef union {
MtxF_t mf;
struct {
float xx, xy, xz, xw,
yx, yy, yz, yw,
zx, zy, zz, zw,
wx, wy, wz, ww;
float xx, yx, zx, wx,
xy, yy, zy, wy,
xz, yz, zz, wz,
xw, yw, zw, ww;
};
} MtxF; // size = 0x40

Some files were not shown because too many files have changed in this diff Show More