Merge branch 'master' into voice

This commit is contained in:
engineer124
2021-11-07 20:59:08 +11:00
936 changed files with 44090 additions and 10365 deletions
+2
View File
@@ -10,6 +10,7 @@ __pycache__/
CMakeLists.txt
cmake-build-debug
venv/
tags
# Project-specific ignores
*.z64
@@ -31,6 +32,7 @@ tools/qemu-mips
tools/ido_recomp/* binary
ctx.c
graphs/
*.c.m2c
# Assets
*.png
+5 -5
View File
@@ -14,7 +14,7 @@ Useful Links
------------
- [Discord](https://discord.zelda64.dev/) - Primary discussion platform.
- [Trello board](https://trello.com/b/ruxw9n6m/majoras-mask-decompilation) - We use this to track decompilation progress, not GitHub Issues.
- [Google Sheets reservation board](https://docs.google.com/spreadsheets/d/1X83YCPRa532v-Zo0WgUsJ2kB1X9RxBta5_p9aWA8uro) - We use this to track decompilation progress, not GitHub Issues.
- [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.
@@ -50,12 +50,12 @@ An *actor* is any thing in the game that moves or performs actions or interactio
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 track who is working on what on the [Trello board](https://trello.com/b/ruxw9n6m/majoras-mask-decompilation).
After joining the Discord, ask to be added to the Trello board so you can claim your code file and avoid duplicate work. You may need to add a card if a card for your file does not currently exist.
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.
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.
Please note that unless it is communicated beforehand you will be expected to fully complete the file if you reserve it on Trello. 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 trello and unreserve immediately. Communicate any issues with your reservations as early as possible.
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.
Style Guide & Conventions
-------------------------
@@ -159,4 +159,4 @@ Once all comments are addressed, it is courteous to ping the reviewer on either
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.
Throughout the PR process, you (the author) should update the card on [Trello board](https://trello.com/b/ruxw9n6m/majoras-mask-decompilation) with the appropriate column and labels.
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.
Vendored
+12 -3
View File
@@ -4,6 +4,12 @@ pipeline {
}
stages {
stage('Check formatting') {
steps {
echo 'Checking formatting...'
sh 'bash -c "tools/check_format.sh 2>&1 >(tee tools/check_format.txt)"'
}
}
stage('Copy ROM') {
steps {
echo 'Setting up ROM...'
@@ -17,7 +23,7 @@ pipeline {
}
stage('Check setup warnings') {
steps {
sh 'python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_setup_current.txt tools/warnings_count/warnings_setup_new.txt'
sh 'bash -c "./tools/warnings_count/compare_warnings.sh setup"'
}
}
stage('Disasm') {
@@ -27,7 +33,7 @@ pipeline {
}
stage('Check disasm warnings') {
steps {
sh 'python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_disasm_current.txt tools/warnings_count/warnings_disasm_new.txt'
sh 'bash -c "./tools/warnings_count/compare_warnings.sh disasm"'
}
}
stage('Build') {
@@ -37,7 +43,7 @@ pipeline {
}
stage('Check build warnings') {
steps {
sh 'python3 tools/warnings_count/compare_warnings.py tools/warnings_count/warnings_build_current.txt tools/warnings_count/warnings_build_new.txt'
sh 'bash -c "./tools/warnings_count/compare_warnings.sh build"'
}
}
stage('Report Progress') {
@@ -68,6 +74,9 @@ pipeline {
}
}
post {
failure {
sh 'cat tools/check_format.txt tools/warnings_count/warnings_setup_new.txt tools/warnings_count/warnings_disasm_new.txt tools/warnings_count/warnings_build_new.txt'
}
always {
cleanWs()
}
+8 -4
View File
@@ -70,6 +70,7 @@ LD := $(MIPS_BINUTILS_PREFIX)ld
OBJCOPY := $(MIPS_BINUTILS_PREFIX)objcopy
OBJDUMP := $(MIPS_BINUTILS_PREFIX)objdump
IINC := -Iinclude -Isrc -Iassets -Ibuild -I.
ifeq ($(KEEP_MDEBUG),0)
RM_MDEBUG = $(OBJCOPY) --remove-section .mdebug $@
else
@@ -78,7 +79,7 @@ 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 -std=gnu90 -D _LANGUAGE_C -D NON_MATCHING -Iinclude -Isrc -Iassets -Ibuild -include stdarg.h $(CHECK_WARNINGS)
CC_CHECK := gcc -fno-builtin -fsyntax-only -funsigned-char -fdiagnostics-color -std=gnu89 -D _LANGUAGE_C -D NON_MATCHING $(IINC) -nostdinc $(CHECK_WARNINGS)
CPP := cpp
ELF2ROM := tools/buildtools/elf2rom
@@ -91,7 +92,7 @@ ASFLAGS := -march=vr4300 -32 -Iinclude
MIPS_VERSION := -mips2
# we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Surpress the warnings with -woff.
CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -Isrc -Iassets -Ibuild -I. -Wab,-r4300_mul -woff 624,649,838,712
CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm $(IINC) -nostdinc -Wab,-r4300_mul -woff 624,649,838,712
ifeq ($(shell getconf LONG_BIT), 32)
# Work around memory allocation bug in QEMU
@@ -128,7 +129,8 @@ TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),build/$f) \
$(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),build/$f) \
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
S_FILES := $(shell grep -F "build/asm" spec | sed 's/.*build\/// ; s/\.o\".*/.s/') \
$(shell grep -F "build/data" spec | sed 's/.*build\/// ; s/\.o\".*/.s/')
O_FILES := $(foreach f,$(S_FILES:.s=.o),build/$f) \
$(foreach f,$(wildcard baserom/*),build/$f.o) \
$(foreach f,$(C_FILES:.c=.o),build/$f) \
@@ -151,6 +153,8 @@ build/src/libultra/io/%.o: OPTFLAGS := -O2
build/src/libultra/libc/%.o: OPTFLAGS := -O2
build/src/libultra/gu/%.o: OPTFLAGS := -O2
build/src/libultra/rmon/%.o: OPTFLAGS := -O2
build/src/libultra/flash/%.o: OPTFLAGS := -g
build/src/libultra/flash/%.o: MIPS_VERSION := -mips1
# file flags
build/src/boot_O2_g3/fault.o: CFLAGS += -trapuv
@@ -230,7 +234,7 @@ disasm:
$(RM) -rf asm data
python3 tools/disasm/disasm.py
diff-init: all
diff-init: uncompressed
$(RM) -rf expected/
mkdir -p expected/
cp -r build expected/build
+1 -1
View File
@@ -13,7 +13,7 @@ Useful Links
------------
- [Discord](https://discord.zelda64.dev/) - Primary discussion platform.
- [Trello board](https://trello.com/b/ruxw9n6m/majoras-mask-decompilation) - We use this to track decompilation progress, not GitHub Issues.
- [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.
+29
View File
@@ -0,0 +1,29 @@
<Root>
<File Name="code" BaseAddress="0x800A5AC0" RangeStart="0x114A90" RangeEnd="0x115550" OutName="debug_display">
<Array Name="sDebugDisplay1Vtx" Count="36" Offset="0x114A90">
<Vtx/>
</Array>
<DList Name="sDebugDisplay1DL" Offset="0x114CD0"/>
<Array Name="sDebugDisplay2Vtx" Count="8" Offset="0x114D30">
<Vtx/>
</Array>
<DList Name="sDebugDisplay2DL" Offset="0x114DB0"/>
<Array Name="sDebugDisplay3Vtx" Count="40" Offset="0x114E00">
<Vtx/>
</Array>
<DList Name="sDebugDisplay3DL" Offset="0x115080"/>
<Texture Name="sDebugDisplayCircleTex" OutName="debug_circle" Format="i8" Width="16" Height="16" Offset="0x1150F8"/>
<Texture Name="sDebugDisplayBallTex" OutName="debug_ball" Format="i8" Width="16" Height="16" Offset="0x1151F8"/>
<Texture Name="sDebugDisplayCursorTex" OutName="debug_cursor" Format="i8" Width="16" Height="16" Offset="0x1152F8"/>
<Texture Name="sDebugDisplayCrossTex" OutName="debug_cross" Format="i8" Width="16" Height="16" Offset="0x1153F8"/>
<Array Name="sDebugDisplaySpriteVtx" Count="4" Offset="0x1154F8">
<Vtx/>
</Array>
<DList Name="sDebugDisplaySpriteDL" Offset="0x115538"/>
</File>
</Root>
+11
View File
@@ -0,0 +1,11 @@
<Root>
<File Name="ovl_Arrow_Ice" BaseAddress="0x80922430" RangeStart="0x980" RangeEnd="0x1DA0">
<Texture Name="sIceArrow1Tex" OutName="ice_tex_1" Format="ia8" Width="32" Height="64" Offset="0x980"/>
<Texture Name="sIceArrow2Tex" OutName="ice_tex_2" Format="ia8" Width="32" Height="64" Offset="0x1180"/>
<Array Name="sIceArrowVtx" Count="43" Offset="0x1980">
<Vtx/>
</Array>
<DList Name="sIceArrowDL" Offset="0x1C30"/>
<DList Name="sIceArrowVtxDL" Offset="0x1CE0"/>
</File>
</Root>
+1 -1
View File
@@ -1,5 +1,5 @@
<Root>
<File Name="ovl_En_Clear_Tag" BaseAddress="0x80947F60" RangeStart="0x2F00" RangeEnd="0x5D00" Segment="128">
<File Name="ovl_En_Clear_Tag" BaseAddress="0x80947F60" RangeStart="0x2F00" RangeEnd="0x5D00">
<!-- Debris from explosion -->
<DList Name="gClearTagDebrisEffectMaterialDL" Offset="0x3130"/>
+1 -1
View File
@@ -1,5 +1,5 @@
<Root>
<File Name="ovl_En_Holl" BaseAddress="0x80899960" RangeStart="0x0BF0" RangeEnd="0x0C58" Segment="128">
<File Name="ovl_En_Holl" BaseAddress="0x80899960" RangeStart="0x0BF0" RangeEnd="0x0C58">
<Array Name="gEnHollCentralPlaneVtx" Count="4" Offset="0x0BF0">
<Vtx/>
</Array>
@@ -0,0 +1,8 @@
<Root>
<File Name="nintendo_rogo_static" Segment="1" Game="MM">
<Texture Name="gNintendo64LogoTextTex" OutName="nintendo_64_logo_text" Format="i8" Width="192" Height="32" Offset="0x0"/>
<Texture Name="gNintendo64LogoTextShineTex" OutName="nintendo_64_logo_text_shine" Format="i8" Width="32" Height="32" Offset="0x1800"/>
<DList Name="gNintendo64LogoNDL" Offset="0x2720"/>
<Texture Name="gNintendo64LogoNShineTex" OutName="nintendo_64_logo_n_shine" Format="i8" Width="32" Height="32" Offset="0x29C0"/>
</File>
</Root>
+10 -2
View File
@@ -1,15 +1,22 @@
#!/usr/bin/env bash
FORMAT_VER="11"
FORMAT_OPTS="-i -style=file"
TIDY_OPTS="-p . --fix --fix-errors"
COMPILER_OPTS="-fno-builtin -std=gnu90 -Iinclude -Isrc -D_LANGUAGE_C -DNON_MATCHING"
shopt -s globstar
if [ -z `command -v clang-format-${FORMAT_VER}` ]
then
echo "clang-format-${FORMAT_VER} not found. Exiting."
exit 1
fi
if (( $# > 0 )); then
echo "Formatting file(s) $*"
echo "Running clang-format..."
clang-format-11 ${FORMAT_OPTS} "$@"
clang-format-${FORMAT_VER} ${FORMAT_OPTS} "$@"
echo "Running clang-tidy..."
clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null
echo "Adding missing final new lines..."
@@ -20,9 +27,10 @@ fi
echo "Formatting C files. This will take a bit"
echo "Running clang-format..."
clang-format-11 ${FORMAT_OPTS} src/**/*.c
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\' {} \;
echo "Done formatting all files."
+1 -1
View File
@@ -92,7 +92,7 @@
#define SEGMENT_ADDR(num, off) (((num) << 24) + (off))
#ifndef NULL
#define NULL 0
#define NULL ((void*)0)
#endif
#endif /* !_MBI_H_ */
-4
View File
@@ -1,4 +0,0 @@
#ifndef _ASSERT_H_
#define _ASSERT_H_
#endif
+6
View File
@@ -0,0 +1,6 @@
#ifndef BGM_H
#define BGM_H
#define NA_BGM_STOP 0x100000FF
#endif
+8 -2
View File
@@ -3,7 +3,7 @@
/**
* Command Base macros intended for use in designing of more specific command macros
* Each macro packs bytes (B), halfowrds (H) and words (W, for consistency) into a single word
* Each macro packs bytes (B), halfwords (H) and words (W, for consistency) into a single word
*/
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8))
@@ -16,6 +16,12 @@
#define CMD_W(a) (a)
#define CMD_PTR(a) (u32)(a)
#ifdef __GNUC__
#define CMD_F(a) {.f = (a)}
#else
#define CMD_F(a) {(a)}
#endif
#define CMD_PTR(a) (uintptr_t)(a)
#endif
+2
View File
@@ -1,6 +1,8 @@
#ifndef _ULTRA64_CONVERT_H_
#define _ULTRA64_CONVERT_H_
#include "libc/stdint.h"
#define OS_CLOCK_RATE 62500000LL
#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
+34
View File
@@ -0,0 +1,34 @@
#ifndef FIXED_POINT_H
#define FIXED_POINT_H
#include "ultra64.h"
extern f32 qNaN0x3FFFFF;
extern f32 qNaN0x10000;
extern f32 sNaN0x3FFFFF;
f32 floorf(f32 x);
f64 floor(f64 x);
s32 lfloorf(f32 x);
s32 lfloor(f64 x);
f32 ceilf(f32 x);
f64 ceil(f64 x);
s32 lceilf(f32 x);
s32 lceil(f64 x);
f32 truncf(f32 x);
f64 trunc(f64 x);
s32 ltruncf(f32 x);
s32 ltrunc(f64 x);
f32 nearbyintf(f32 x);
f64 nearbyint(f64 x);
s32 lnearbyintf(f32 x);
s32 lnearbyint(f64 x);
f32 roundf(f32 x);
f64 round(f64 x);
s32 lroundf(f32 x);
s32 lround(f64 x);
#endif
+414 -411
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,6 +1,8 @@
#ifndef _ICHAIN_H_
#define _ICHAIN_H_
#include "libc/stddef.h"
typedef struct {
u32 cont: 1;
u32 type: 4;
@@ -8,8 +10,6 @@ typedef struct {
s32 value: 16;
} InitChainEntry;
#define OFFSETOF(structure, member) ((size_t)&(((structure*)0)->member))
typedef enum {
/* 0x0 */ ICHAINTYPE_U8, // sets byte
/* 0x1 */ ICHAINTYPE_S8,
@@ -38,7 +38,7 @@ typedef enum {
* * cont ----- ICHAIN_CONTINUE (or ICHAIN_STOP) to continue (or stop) parsing
*/
#define ICHAIN(type, member, value, cont) \
{ cont, type, OFFSETOF(Actor, member), value }
{ cont, type, offsetof(Actor, member), value }
#define ICHAIN_U8(member, val, cont) ICHAIN(ICHAINTYPE_U8, member, val, cont)
#define ICHAIN_S8(member, val, cont) ICHAIN(ICHAINTYPE_S8, member, val, cont)
+8 -1
View File
@@ -139,10 +139,17 @@ typedef struct {
/* 0x01 */ u8 txsize;
/* 0x02 */ u8 rxsize;
/* 0x03 */ u8 cmd;
/* 0x04 */ u16 address;
/* 0x04 */ u8 hi;
/* 0x05 */ u8 lo;
/* 0x06 */ u8 data[32];
/* 0x26 */ u8 datacrc;
} __OSContRamReadFormat;
extern OSPifRam __osContPifRam;
// extern UNK_TYPE1 D_8009CF0C;
extern u8 __osContLastCmd;
extern u8 __osMaxControllers;
// extern OSMesgQueue D_8009CF38;
// extern OSMesg D_8009CF50;
#endif

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