Merge branch 'master' into parameter

This commit is contained in:
engineer124
2021-12-28 18:29:11 +11:00
48 changed files with 4256 additions and 645 deletions
+1
View File
@@ -33,6 +33,7 @@ tools/ido_recomp/* binary
ctx.c
graphs/
*.c.m2c
tools/**/*dSYM/
tools/decomp-permuter/
tools/mips_to_c/
+2 -7
View File
@@ -36,12 +36,7 @@ else
endif
endif
# Threads to compress and extract assets with, TODO improve later
ifeq ($(DETECTED_OS),linux)
N_THREADS ?= $(shell nproc)
else
N_THREADS ?= 1
endif
N_THREADS ?= $(shell nproc)
#### Tools ####
ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
@@ -246,7 +241,7 @@ setup:
$(MAKE) -C tools
python3 tools/fixbaserom.py
python3 tools/extract_baserom.py
python3 extract_assets.py -t $(N_THREADS)
python3 extract_assets.py -j $(N_THREADS)
## Assembly generation
disasm:
+18 -16
View File
@@ -23,26 +23,35 @@ in an experimental and research phase and cannot currently be used traditionally
source code base for general changes.
```
**This repo does not include any assets or code necessary for compiling the ROM. A prior copy of the game is required to extract the required assets.**
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 decompilation of Legend of Zelda: Majora's Mask (US) 1.0
The only build currently supported is N64 US, but other versions are planned to be supported.
It builds the following ROM:
It currently builds the following ROM:
* mm.us.rev1.rom.z64 `md5: 2a0a8acb61538235bc1094d297fb6556`
**This repo does not include any assets or assembly code necessary for compiling the ROM. A prior copy of the game is required to extract the required assets.**
Please refer to the following for more information:
- [Website](https://zelda64.dev/)
- [Discord](https://discord.zelda64.dev/)
- [How to Contribute](CONTRIBUTING.md)
## Installation
### Windows
For Windows 10, install WSL and a distribution by following this
[Windows Subsystem for Linux Installation Guide](https://docs.microsoft.com/en-us/windows/wsl/install-win10).
We recommend using Debian or Ubuntu 18.04 Linux distributions.
We recommend using Debian or Ubuntu 20.04 Linux distributions.
### MacOS
Preparation is covered in a [separate document](docsBUILDING_MACOS.md).
### Linux (Native or under WSL / VM)
@@ -110,30 +119,23 @@ This means that something is wrong with the ROM's contents. Either the baserom f
Running `make init` will also make the `./expected` directory and copy all of the files there, which will be useful when running the diff script. The diff script is useful in decompiling functions and can be ran with this command: `./tools/asm-differ/diff.py -wmo3 <insert_function_here>`
**Note**: to speed up the build, you can either:
* Pass `-jN` to `make setup` and `make`, where N is the number of threads to use in the build, e.g. `make -j4`. The generally-accepted wisdom is to use the number of virtual cores your computer has.
* Pass `-j` to `make setup` and `make`, to use as many threads as possible, but beware that this can use too much memory on lower-end systems.
Both of these have the disadvantage that the ordering of the terminal output is scrambled, so for debugging it is best to stick to one thread (i.e. not pass `-j` or `-jN`).
**Note**: to speed up the build, you can pass `-jN` to `make setup` and `make`, where N is the number of threads to use in the build, e.g. `make -j4`. The generally-accepted wisdom is to use the number of virtual cores your computer has, which is the output of `nproc` (which should be installed as part of `coreutils`).
The disadvantage that the ordering of the terminal output is scrambled, so for debugging it is best to stick to one thread (i.e. not pass `-jN`).
(`-j` also exists, which uses unlimited jobs, but is generally slower.)
**Note**: if you rename symbols, it is recommended that you use the `tools/rename_sym.sh` to ensure that you cover all instances, including the tables which are used to generate the `asm/` directory.
Usage: `tools/rename_sym.sh old_name new_name`. Example:
```bash
tools/rename_sym.sh func_808A3428 EnTorch2_UpdateIdle
```
## 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.
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.
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.
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?
+3
View File
@@ -8,6 +8,9 @@
<DList Name="object_fall_DL_000428" Offset="0x428" />
<DList Name="object_fall_DL_000490" Offset="0x490" />
<DList Name="object_fall_DL_000498" Offset="0x498" />
<Array Name="object_fall_Vtx_0004C0" Count="209" Offset="0x4C0">
<Vtx/>
</Array>
<DList Name="object_fall_DL_0011D0" Offset="0x11D0" />
<Texture Name="object_fall_Tex_001688" OutName="tex_001688" Format="i8" Width="64" Height="64" Offset="0x1688" />
<Texture Name="object_fall_Tex_002688" OutName="tex_002688" Format="i4" Width="64" Height="64" Offset="0x2688" />
+5 -2
View File
@@ -71,7 +71,10 @@
<Texture Name="object_oF1d_map_Tex_00FAB8" OutName="tex_00FAB8" Format="ci8" Width="8" Height="16" Offset="0xFAB8" />
<Texture Name="object_oF1d_map_Tex_00FB38" OutName="tex_00FB38" Format="ci8" Width="32" Height="64" Offset="0xFB38" />
<Texture Name="object_oF1d_map_Tex_010338" OutName="tex_010338" Format="ci8" Width="16" Height="16" Offset="0x10338" />
<!-- <Blob Name="object_oF1d_map_Blob_010438" Size="0x1000" Offset="0x10438" /> -->
<Texture Name="object_oF1d_map_Tex_010438" OutName="tex_010438" Format="ci8" Width="32" Height="32" Offset="0x10438" />
<Texture Name="object_oF1d_map_Tex_010838" OutName="tex_010838" Format="ci8" Width="32" Height="32" Offset="0x10838" />
<Texture Name="object_oF1d_map_Tex_010C38" OutName="tex_010C38" Format="ci8" Width="32" Height="32" Offset="0x10C38" />
<Texture Name="object_oF1d_map_Tex_011038" OutName="tex_011038" Format="ci8" Width="32" Height="32" Offset="0x11038" />
<Texture Name="object_oF1d_map_Tex_011438" OutName="tex_011438" Format="rgba16" Width="8" Height="8" Offset="0x11438" />
<Texture Name="object_oF1d_map_Tex_0114B8" OutName="tex_0114B8" Format="ci8" Width="16" Height="16" Offset="0x114B8" />
<Texture Name="object_oF1d_map_Tex_0115B8" OutName="tex_0115B8" Format="rgba16" Width="32" Height="16" Offset="0x115B8" />
@@ -98,7 +101,7 @@
<Animation Name="object_oF1d_map_Anim_0135E8" Offset="0x135E8" />
<Animation Name="object_oF1d_map_Anim_013DB0" Offset="0x13DB0" />
<Animation Name="object_oF1d_map_Anim_0143AC" Offset="0x143AC" />
<Blob Name="object_oF1d_map_Blob_0143C0" Size="0x930" Offset="0x143C0" /> <!-- ZAPD erroneously generates an extra pad variable if this is commented out -->
<Animation Name="object_oF1d_map_Anim_014CE0" Offset="0x14CE0" />
<DList Name="object_oF1d_map_DL_014CF0" Offset="0x14CF0" />
<DList Name="object_oF1d_map_DL_014D00" Offset="0x14D00" />
</File>
+83
View File
@@ -0,0 +1,83 @@
# Building on macOS
**N.B. C++17 is required to build the asset processing program that we use (ZAPD), so check your OS version can support this before proceeding**
## Dependencies
For macOS, use Homebrew to install the following dependencies:
* coreutils
* make
* python3
* libpng
* bash
* clang-format 11
You can install them with the following commands:
```bash
brew update
brew install coreutils make python3 libpng bash clang-format@11
```
(The repository expects Homebrew-installed programs to be either linked correctly in `$PATH` etc. or in their default locations.)
## Building mips-linux-binutils
The following instructions are written for MacOS users but should apply to any Unix-like system, with maybe some modifications at the end regarding the bash_profile.
Create destination dir for binutils
```bash
sudo mkdir -p /opt/cross
```
Create and enter local working dir
```bash
mkdir ~/binutils-tmp
cd ~/binutils-tmp
```
Get and extract binutils source
```bash
wget https://ftp.gnu.org/gnu/binutils/binutils-2.35.tar.bz2
tar xjf binutils-2.35.tar.bz2
```
(You may find this command does not work: if so, just access the URL in a browser and save it to `~/binutils-tmp`.)
Create and enter a build directory
```bash
mkdir build-binutils
cd build-binutils
```
Configure the build
```bash
../binutils-2.35/configure --target=mips-linux-gnu --prefix=/opt/cross --disable-gprof --disable-gdb --disable-werror
```
Make and install binutils
```bash
make -j
sudo make install
```
Edit your `~/.bash_profile`/`~/.zsh_profile` (or whichever shell you use) to add the new binutils binaries to the system PATH
```bash
echo "export PATH=$PATH:/opt/cross/bin" >> ~/.bash_profile
```
Reload ~/.bash_profile (or just launch a new terminal tab)
```bash
source ~/.bash_profile
```
If this worked, you can now delete the temporary directory `~/binutils-tmp`.
## Final note
Apple's version of `make` is very out-of-date, so you should use the brew-installed `gmake` in place of `make` in this repo from now on.
You should now be able to continue from [step 2](README.md#2-clone-the-repository) of the Linux instructions.
+28 -21
View File
@@ -1,9 +1,8 @@
#!/usr/bin/env python3
import argparse, json, os, signal, time, colorama
from multiprocessing import Pool, Event, Manager
import argparse, json, os, signal, time, colorama, multiprocessing
colorama.init();
colorama.init()
EXTRACTED_ASSETS_NAMEFILE = ".extracted-assets.json"
@@ -71,33 +70,33 @@ def initializeWorker(abort, unaccounted: bool, extractedAssetsTracker: dict, man
def main():
parser = argparse.ArgumentParser(description="baserom asset extractor")
parser.add_argument("-s", "--single", help="asset path relative to assets/, e.g. objects/gameplay_keep")
parser.add_argument("-t", "--threads", help="Number of cpu cores to extract with.")
parser.add_argument("-f", "--force", help="Force the extraction of every xml instead of checking the touched ones.", action="store_true")
parser.add_argument("-j", "--jobs", help="Number of cpu cores to extract with.")
parser.add_argument("-u", "--unaccounted", help="Enables ZAPD unaccounted detector warning system.", action="store_true")
parser.add_argument("-Z", help="Pass the argument on to ZAPD, e.g. `-ZWunaccounted` to warn about unaccounted blocks in XMLs. Each argument should be passed separately, *without* the leading dash.", metavar="ZAPD_ARG", action="append")
args = parser.parse_args()
global ZAPDArgs;
ZAPDArgs = "";
global ZAPDArgs
ZAPDArgs = ""
if args.Z is not None:
badZAPDArg = False;
badZAPDArg = False
for i in range(len(args.Z)):
z = args.Z[i]
if z[0] == '-':
print(f"{colorama.Fore.LIGHTRED_EX}error{colorama.Fore.RESET}: argument \"{z}\" starts with \"-\", which is not supported.", file=os.sys.stderr);
badZAPDArg = True;
print(f"{colorama.Fore.LIGHTRED_EX}error{colorama.Fore.RESET}: argument \"{z}\" starts with \"-\", which is not supported.", file=os.sys.stderr)
badZAPDArg = True
else:
args.Z[i] = "-" + z;
args.Z[i] = "-" + z
if badZAPDArg:
exit(1);
exit(1)
ZAPDArgs = " ".join(args.Z);
print("Using extra ZAPD arguments: " + ZAPDArgs);
ZAPDArgs = " ".join(args.Z)
print("Using extra ZAPD arguments: " + ZAPDArgs)
global mainAbort
mainAbort = Event()
manager = Manager()
mainAbort = multiprocessing.Event()
manager = multiprocessing.Manager()
signal.signal(signal.SIGINT, SignalHandler)
extractedAssetsTracker = manager.dict()
@@ -125,12 +124,20 @@ def main():
if file.endswith(".xml"):
xmlFiles.append(fullPath)
numCores = int(args.threads or 0)
if numCores <= 0:
numCores = 1
print("Extracting assets with " + str(numCores) + " CPU core" + ("s" if numCores > 1 else "") + ".")
with Pool(numCores, initializer=initializeWorker, initargs=(mainAbort, args.unaccounted, extractedAssetsTracker, manager)) as p:
p.map(ExtractFunc, xmlFiles)
try:
numCores = int(args.jobs or 0)
if numCores <= 0:
numCores = 1
print("Extracting assets with " + str(numCores) + " CPU core" + ("s" if numCores > 1 else "") + ".")
with multiprocessing.get_context("fork").Pool(numCores, initializer=initializeWorker, initargs=(mainAbort, args.unaccounted, extractedAssetsTracker, manager)) as p:
p.map(ExtractFunc, xmlFiles)
except (multiprocessing.ProcessError, TypeError):
print("Warning: Multiprocessing exception ocurred.", file=os.sys.stderr)
print("Disabling mutliprocessing.", file=os.sys.stderr)
initializeWorker(mainAbort, args.unaccounted, extractedAssetsTracker, manager)
for singlePath in xmlFiles:
ExtractFunc(singlePath)
with open(EXTRACTED_ASSETS_NAMEFILE, 'w', encoding='utf-8') as f:
serializableDict = dict()
+13 -3
View File
@@ -5,6 +5,16 @@ FORMAT_OPTS="-i -style=file"
TIDY_OPTS="-p . --fix --fix-errors"
COMPILER_OPTS="-fno-builtin -std=gnu90 -Iinclude -Isrc -D_LANGUAGE_C -DNON_MATCHING"
# https://backreference.org/2010/05/23/sanitizing-files-with-no-trailing-newline/index.html
# "gets the last character of the file pipes it into read, which will exit with a nonzero exit code if it encounters EOF before newline (so, if the last character of the file isn't a newline). If read exits nonzero, then append a newline onto the file using echo (if read exits 0, that satisfies the ||, so the echo command isn't run)." (https://stackoverflow.com/a/34865616)
function add_final_newline () {
for file in "$@"
do
tail -c1 $file | read -r _ || echo >> $file
done
}
export -f add_final_newline
shopt -s globstar
if [ -z `command -v clang-format-${FORMAT_VER}` ]
@@ -20,7 +30,7 @@ if (( $# > 0 )); then
echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
sed -i -e '$a\' "$@"
add_final_newline "$@"
echo "Done formatting file(s) $*"
exit
fi
@@ -31,6 +41,6 @@ clang-format-${FORMAT_VER} ${FORMAT_OPTS} src/**/*.c
echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} src/**/*.c -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
find src/ -type f -name "*.c" -exec sed -i -e '$a\' {} \;
find assets/xml/ -type f -name "*.xml" -exec sed -i -e '$a\' {} \;
find src/ -type f -name "*.c" -exec bash -c 'add_final_newline "$@"' bash {} +
find assets/xml/ -type f -name "*.xml" -exec bash -c 'add_final_newline "$@"' bash {} +
echo "Done formatting all files."
+4 -4
View File
@@ -97,7 +97,7 @@ void FaultDrawer_SetCharPad(s8 padW, s8 padH);
void FaultDrawer_SetCursor(s32 x, s32 y);
void FaultDrawer_FillScreen(void);
void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count);
void FaultDrawer_VPrintf(const char* str, char* args);
void FaultDrawer_VPrintf(const char* fmt, va_list ap);
void FaultDrawer_Printf(const char* fmt, ...);
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...);
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h);
@@ -3791,9 +3791,9 @@ void func_8019F230(void); // cancel
// void func_8019F258(void);
// void func_8019F300(void);
void func_8019F420(Vec3f* pos, u16 sfxId);
// void func_8019F4AC(void);
void func_8019F4AC(Vec3f* pos, u16 sfxId);
void func_8019F540(u8 arg0);
// void func_8019F570(void);
void func_8019F570(Vec3f* pos, s8 arg1);
// void func_8019F5AC(void);
// void func_8019F638(void);
// void func_8019F780(void);
@@ -3884,7 +3884,7 @@ void func_801A3CD8(s8 param_1);
// void func_801A3D98(void);
// void func_801A3E38(void);
// void func_801A3EC0(void);
// void func_801A3F54(void);
void func_801A3F54(s32 arg0);
// void func_801A3F6C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801A3FB4(void);
// void func_801A3FFC(UNK_TYPE1 param_1);
+3 -3
View File
@@ -1260,7 +1260,7 @@ extern UNK_PTR D_801C02F8;
// extern UNK_TYPE1 D_801C07F0;
// extern UNK_TYPE1 D_801C0820;
// extern UNK_TYPE1 D_801C0838;
// extern UNK_TYPE1 D_801C0850;
extern Gfx D_801C0850[];
// extern UNK_TYPE1 D_801C0860;
extern UNK_PTR D_801C0870;
// extern UNK_TYPE1 D_801C0890;
@@ -3773,7 +3773,7 @@ extern u16 gFramebuffer0[SCREEN_HEIGHT][SCREEN_WIDTH];
// keep objects
extern Gfx D_040008D0[];
extern UNK_TYPE D_040032B0;
extern Gfx D_040032B0[];
extern UNK_TYPE D_0400CF58;
extern UNK_TYPE D_0400CF88;
extern UNK_TYPE D_0400CF98;
@@ -3976,7 +3976,7 @@ extern UNK_TYPE D_04062020;
extern UNK_TYPE D_04062040;
extern UNK_TYPE D_04062060;
extern Gfx D_040622C0[];
extern UNK_TYPE D_0406AB30;
extern Gfx D_0406AB30[];
extern UNK_TYPE D_0406B730;
extern UNK_TYPE D_0406BB0C;
extern UNK_TYPE D_0406F380;
+5 -11
View File
@@ -1946,8 +1946,7 @@ beginseg
name "ovl_Effect_Ss_Stick"
compress
include "build/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.o"
include "build/data/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick.data.o"
include "build/data/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick.reloc.o"
include "build/src/overlays/effects/ovl_Effect_Ss_Stick/ovl_Effect_Ss_Stick_reloc.o"
endseg
beginseg
@@ -3120,9 +3119,7 @@ beginseg
name "ovl_En_Fall"
compress
include "build/src/overlays/actors/ovl_En_Fall/z_en_fall.o"
include "build/data/ovl_En_Fall/ovl_En_Fall.data.o"
include "build/data/ovl_En_Fall/ovl_En_Fall.bss.o"
include "build/data/ovl_En_Fall/ovl_En_Fall.reloc.o"
include "build/src/overlays/actors/ovl_En_Fall/ovl_En_Fall_reloc.o"
endseg
beginseg
@@ -3362,8 +3359,7 @@ beginseg
name "ovl_Obj_Tokeidai"
compress
include "build/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.o"
include "build/data/ovl_Obj_Tokeidai/ovl_Obj_Tokeidai.data.o"
include "build/data/ovl_Obj_Tokeidai/ovl_Obj_Tokeidai.reloc.o"
include "build/src/overlays/actors/ovl_Obj_Tokeidai/ovl_Obj_Tokeidai_reloc.o"
endseg
beginseg
@@ -3854,8 +3850,7 @@ beginseg
name "ovl_En_Talk_Gibud"
compress
include "build/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.o"
include "build/data/ovl_En_Talk_Gibud/ovl_En_Talk_Gibud.data.o"
include "build/data/ovl_En_Talk_Gibud/ovl_En_Talk_Gibud.reloc.o"
include "build/src/overlays/actors/ovl_En_Talk_Gibud/ovl_En_Talk_Gibud_reloc.o"
endseg
beginseg
@@ -4579,8 +4574,7 @@ beginseg
name "ovl_En_Geg"
compress
include "build/src/overlays/actors/ovl_En_Geg/z_en_geg.o"
include "build/data/ovl_En_Geg/ovl_En_Geg.data.o"
include "build/data/ovl_En_Geg/ovl_En_Geg.reloc.o"
include "build/src/overlays/actors/ovl_En_Geg/ovl_En_Geg_reloc.o"
endseg
beginseg
+5 -5
View File
@@ -24,30 +24,30 @@ f32 func_80086760(f32 x) {
// Unused
// Math_FFloorF
f32 func_80086794(f32 x) {
func_80086C70(x);
return func_80086C70(x);
}
// Unused
// Math_FCeilF
f32 func_800867B4(f32 x) {
func_80086CA8(x);
return func_80086CA8(x);
}
// Unused
// Math_FRoundF
f32 func_800867D4(f32 x) {
func_80086D50(x);
return func_80086D50(x);
}
// Unused
// Math_FTruncF
f32 func_800867F4(f32 x) {
func_80086CE0(x);
return func_80086CE0(x);
}
// Math_FNearbyIntF
f32 func_80086814(f32 x) {
func_80086D18(x);
return func_80086D18(x);
}
/**
File diff suppressed because it is too large Load Diff
+43 -3
View File
@@ -3,14 +3,54 @@
#include "global.h"
#define EN_FALL_SCALE(thisx) ((thisx)->params & 0x7F)
#define EN_FALL_TYPE(thisx) (((thisx)->params & 0xF80) >> 7)
#define EN_FALL_FLAG_FIRE_BALL_INTENSIFIES (1 << 0)
#define EN_FALL_FLAG_FIRE_RING_APPEARS (1 << 1)
typedef enum {
/* 0 */ EN_FALL_TYPE_TERMINA_FIELD_MOON,
/* 1 */ EN_FALL_TYPE_TITLE_SCREEN_MOON,
/* 2 */ EN_FALL_TYPE_CRASHING_MOON,
/* 3 */ EN_FALL_TYPE_CRASH_FIRE_BALL,
/* 4 */ EN_FALL_TYPE_CRASH_RISING_DEBRIS,
/* 5 */ EN_FALL_TYPE_LODMOON_NO_LERP, // unused in final game
/* 6 */ EN_FALL_TYPE_LODMOON,
/* 7 */ EN_FALL_TYPE_STOPPED_MOON_CLOSED_MOUTH,
/* 8 */ EN_FALL_TYPE_MOONS_TEAR,
/* 9 */ EN_FALL_TYPE_CLOCK_TOWER_MOON,
/* 10 */ EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH,
/* 11 */ EN_FALL_TYPE_CRASH_FIRE_RING,
/* 12 */ EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER,
} EnFallType;
struct EnFall;
typedef void (*EnFallActionFunc)(struct EnFall*, GlobalContext*);
typedef struct EnFall {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x1C];
/* 0x0160 */ EnFallActionFunc actionFunc;
/* 0x000 */ Actor actor;
/* 0x144 */ s16 dayStartTime;
/* 0x146 */ s16 currentDay;
/* 0x148 */ u8 objIndex;
/* 0x14C */ f32 scale;
/* 0x150 */ union {
f32 eyeGlowIntensity;
f32 fireBallIntensity;
f32 fireRingAlpha;
};
/* 0x154 */ u16 flags;
/* 0x158 */ union {
s32 fireBallAlpha;
s32 activeDebrisParticleCount;
};
/* 0x15C */ union {
s16 fireBallYTexScroll1;
s16 fireWallYScale;
};
/* 0x15E */ s16 fireBallYTexScroll2;
/* 0x160 */ EnFallActionFunc actionFunc;
} EnFall; // size = 0x164
extern const ActorInit En_Fall_InitVars;
File diff suppressed because it is too large Load Diff
+38 -4
View File
@@ -8,10 +8,44 @@ struct EnGeg;
typedef void (*EnGegActionFunc)(struct EnGeg*, GlobalContext*);
typedef struct EnGeg {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x44];
/* 0x0188 */ EnGegActionFunc actionFunc;
/* 0x018C */ char unk_18C[0x364];
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ EnGegActionFunc actionFunc;
/* 0x18C */ ColliderCylinder colliderCylinder;
/* 0x1D8 */ ColliderSphere colliderSphere;
/* 0x230 */ u16 unk_230;
/* 0x232 */ s16 unk_232;
/* 0x234 */ UNK_TYPE1 unk234[4];
/* 0x238 */ s16 unk_238;
/* 0x23A */ UNK_TYPE1 unk23A[0x4];
/* 0x23E */ s16 unk_23E;
/* 0x240 */ s16 unk_240;
/* 0x242 */ s16 unk_242;
/* 0x244 */ s16 unk_244;
/* 0x248 */ s32 unk_248;
/* 0x24C */ Vec3s jointTable[18];
/* 0x2B8 */ Vec3s morphTable[18];
/* 0x324 */ UNK_TYPE1 unk324[0x144];
/* 0x468 */ s16 unk_468;
/* 0x46A */ s16 unk_46A;
/* 0x46C */ s16 unk_46C;
/* 0x46E */ s16 unk_46E;
/* 0x470 */ Vec3f unk_470;
/* 0x47C */ Vec3s unk_47C;
/* 0x484 */ Vec3f unk_484;
/* 0x490 */ Vec3s unk_490;
/* 0x496 */ u16 unk_496;
/* 0x498 */ s16 unk_498;
/* 0x49A */ s16 unk_49A;
/* 0x49C */ s16 unk_49C[8];
/* 0x4AC */ s32 unk_4AC;
/* 0x4B0 */ s16 unk_4B0;
/* 0x4B4 */ Vec3f unk_4B4;
/* 0x4C0 */ Vec3f unk_4C0[2];
/* 0x4D8 */ s16 unk_4D8;
/* 0x4DC */ s32 unk_4DC;
/* 0x4E0 */ s16 unk_4E0;
/* 0x4E4 */ Vec3f unk_4E4;
} EnGeg; // size = 0x4F0
extern const ActorInit En_Geg_InitVars;
File diff suppressed because it is too large Load Diff
@@ -3,15 +3,86 @@
#include "global.h"
#define EN_TALK_GIBUD_REQUESTED_ITEM_INDEX(thisx) ((thisx)->params & 0xF)
#define EN_TALK_GIBUD_SWITCH_FLAG(thisx) (((thisx)->params & 0xFF0) >> 4)
typedef enum {
/* 0 */ EN_TALK_GIBUD_TYPE_GIBDO,
/* 1 */ EN_TALK_GIBUD_TYPE_REDEAD,
} EnTalkGibudType;
typedef enum {
/* 0 */ EN_TALK_GIBUD_GRAB_START,
/* 1 */ EN_TALK_GIBUD_GRAB_ATTACK,
/* 2 */ EN_TALK_GIBUD_GRAB_RELEASE,
} EnTalkGibudGrabState;
typedef enum {
/* 0 */ EN_TALK_GIBUD_LIMB_NONE,
/* 1 */ EN_TALK_GIBUD_LIMB_ROOT, // Root of Left Leg Root, Right Leg Root, Upper Body Root, and Pelvis
/* 2 */ EN_TALK_GIBUD_LIMB_LEFT_LEG_ROOT,
/* 3 */ EN_TALK_GIBUD_LIMB_LEFT_THIGH,
/* 4 */ EN_TALK_GIBUD_LIMB_LEFT_LOWER_LEG,
/* 5 */ EN_TALK_GIBUD_LIMB_LEFT_FOOT_ROOT,
/* 6 */ EN_TALK_GIBUD_LIMB_LEFT_FOOT,
/* 7 */ EN_TALK_GIBUD_LIMB_RIGHT_LEG_ROOT,
/* 8 */ EN_TALK_GIBUD_LIMB_RIGHT_THIGH,
/* 9 */ EN_TALK_GIBUD_LIMB_RIGHT_LOWER_LEG,
/* 10 */ EN_TALK_GIBUD_LIMB_RIGHT_FOOT_ROOT,
/* 11 */ EN_TALK_GIBUD_LIMB_RIGHT_FOOT,
/* 12 */ EN_TALK_GIBUD_LIMB_UPPER_BODY_ROOT,
/* 13 */ EN_TALK_GIBUD_LIMB_UPPER_BODY, // Root of Torso
/* 14 */ EN_TALK_GIBUD_LIMB_TORSO, // Root of Left Arm Root, Right Arm Root, and Head Root
/* 15 */ EN_TALK_GIBUD_LIMB_LEFT_ARM_ROOT,
/* 16 */ EN_TALK_GIBUD_LIMB_LEFT_SHOULDER_AND_UPPER_ARM,
/* 17 */ EN_TALK_GIBUD_LIMB_LEFT_FOREARM,
/* 18 */ EN_TALK_GIBUD_LIMB_LEFT_HAND,
/* 19 */ EN_TALK_GIBUD_LIMB_RIGHT_ARM_ROOT,
/* 20 */ EN_TALK_GIBUD_LIMB_RIGHT_SHOULDER_AND_UPPER_ARM,
/* 21 */ EN_TALK_GIBUD_LIMB_RIGHT_FOREARM,
/* 22 */ EN_TALK_GIBUD_LIMB_RIGHT_HAND,
/* 23 */ EN_TALK_GIBUD_LIMB_HEAD_ROOT,
/* 24 */ EN_TALK_GIBUD_LIMB_HEAD,
/* 25 */ EN_TALK_GIBUD_LIMB_PELVIS,
/* 26 */ EN_TALK_GIBUD_LIMB_MAX,
} EnTalkGibudLimbs;
struct EnTalkGibud;
typedef void (*EnTalkGibudActionFunc)(struct EnTalkGibud*, GlobalContext*);
typedef struct EnTalkGibud {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x90];
/* 0x01D4 */ EnTalkGibudActionFunc actionFunc;
/* 0x01D8 */ char unk_1D8[0x220];
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderCylinder collider;
/* 0x190 */ SkelAnime skelAnime;
/* 0x1D4 */ EnTalkGibudActionFunc actionFunc;
/* 0x1D8 */ Vec3f limbPos[15];
/* 0x28C */ s32 limbIndex;
/* 0x290 */ s32 requestedItemIndex;
/* 0x294 */ s32 itemActionParam;
/* 0x298 */ s32 switchFlag;
/* 0x29C */ f32 effectAlpha;
/* 0x2A0 */ f32 effectScale;
/* 0x2A4 */ Vec3s jointTable[EN_TALK_GIBUD_LIMB_MAX];
/* 0x340 */ Vec3s morphTable[EN_TALK_GIBUD_LIMB_MAX];
/* 0x3DC */ s16 textId;
/* 0x3DE */ Vec3s headRotation;
/* 0x3E4 */ Vec3s upperBodyRotation;
/* 0x3EA */ union {
s16 playerStunWaitTimer; // Cannot stun the player if this is non-zero
s16 grabDamageTimer;
s16 headShakeTimer;
s16 stunTimer;
s16 deathTimer;
s16 disappearanceTimer;
};
/* 0x3EC */ s16 grabState;
/* 0x3EE */ s16 grabWaitTimer; // Cannot grab the player if this is non-zero
/* 0x3F0 */ s16 effectTimer;
/* 0x3F2 */ s16 type;
/* 0x3F4 */ s16 isTalking;
/* 0x3F6 */ u8 effectType;
/* 0x3F7 */ s8 unk_3F7; // related to player->unk_ADD
} EnTalkGibud; // size = 0x3F8
extern const ActorInit En_Talk_Gibud_InitVars;
File diff suppressed because it is too large Load Diff
@@ -3,14 +3,63 @@
#include "global.h"
#define OBJ_TOKEIDAI_TYPE(thisx) (((thisx)->params & 0xF000) >> 12)
typedef enum {
/* 0 */ OBJ_TOKEIDAI_TYPE_TOWER_GEAR_CLOCK_TOWN,
/* 1 */ OBJ_TOKEIDAI_TYPE_UNUSED_WALL,
/* 2 */ OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN,
/* 3 */ OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN,
/* 4 */ OBJ_TOKEIDAI_TYPE_TOWER_GEAR_TERMINA_FIELD,
/* 5 */ OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD,
/* 6 */ OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD,
/* 8 */ OBJ_TOKEIDAI_TYPE_TOWER_WALLS_TERMINA_FIELD = 8,
/* 9 */ OBJ_TOKEIDAI_TYPE_WALL_CLOCK,
/* 10 */ OBJ_TOKEIDAI_TYPE_SMALL_WALL_CLOCK,
/* 11 */ OBJ_TOKEIDAI_TYPE_STAIRCASE_INTO_TOWER,
} ObjTokeidaiType;
struct ObjTokeidai;
typedef void (*ObjTokeidaiActionFunc)(struct ObjTokeidai*, GlobalContext*);
typedef struct ObjTokeidai {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x30];
/* 0x0174 */ ObjTokeidaiActionFunc actionFunc;
/* 0x000 */ Actor actor;
/* 0x144 */ Gfx* opaDList;
/* 0x148 */ Gfx* xluDList;
/* 0x14C */ s16 outerRingOrGearRotation;
/* 0x14E */ s16 outerRingOrGearRotationalVelocity;
/* 0x150 */ s16 outerRingOrGearRotationTimer;
/* 0x152 */ s16 clockFaceRotation;
/* 0x154 */ union {
s16 clockFaceRotationalVelocity;
s16 settleTimer;
s16 counterweightRotationalVelocity;
s16 openingWaitTimer;
s16 slidingClockFaceAngle;
};
/* 0x156 */ union {
s16 clockFaceRotationTimer;
s16 settleAmount;
s16 counterweightRotationalAcceleration;
s16 aerialClockFaceSpeed;
};
/* 0x158 */ s32 sunMoonDiskRotation;
/* 0x15C */ union {
s16 sunMoonDiskRotationalVelocity;
s16 fallingClockFaceRotationalVelocity;
};
/* 0x15E */ s16 yTranslation;
/* 0x160 */ s16 xRotation;
/* 0x162 */ s16 clockFaceZTranslation; // amount the clock face recesses inwards once it transforms
/* 0x164 */ s16 boundCount;
/* 0x168 */ s32 clockMinute; // only 30 minutes in an hour
/* 0x16C */ union {
s32 clockHour;
s32 spotlightIntensity;
};
/* 0x170 */ u16 currentTime;
/* 0x174 */ ObjTokeidaiActionFunc actionFunc;
} ObjTokeidai; // size = 0x178
extern const ActorInit Obj_Tokeidai_InitVars;

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