mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Format Script Update (#904)
* Bring over format.sh and .clang-tidy and run it * Little fixes * Adjustments * Jenkins kick * Jenkins kick 2 * format * small fixes * Bring over new formatter by Roman Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Force use of clang-11 * check_format * Update error messages * Fix from Tharo for python3.6 Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * Just use nproc to determine num jobs for check format * Update error message * AnimatedMat_DrawStepOpa texture arg -> matAnim * Fix enTwig draw prototype * Tidying up * Bring over fixes in OoT #1387 Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * Fix * Update doc tools * PR Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
co-authored by
Roman971
Tharo
parent
3e32379c2b
commit
26207594f2
+5
-1
@@ -1,5 +1,9 @@
|
||||
Checks: '-*,readability-braces-around-statements'
|
||||
Checks: '-*,readability-braces-around-statements,readability-inconsistent-declaration-parameter-name'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: '(src|include)\/.*\.h$'
|
||||
FormatStyle: 'file'
|
||||
CheckOptions:
|
||||
# Require argument names to match exactly (instead of allowing a name to be a prefix/suffix of another)
|
||||
# Note: 'true' is expected by clang-tidy 12+ but '1' is used for compatibility with older versions
|
||||
- key: readability-inconsistent-declaration-parameter-name.Strict
|
||||
value: 1
|
||||
|
||||
+25
-3
@@ -23,7 +23,7 @@
|
||||
- [`tools/warnings_count/check_new_warnings.sh`](#toolswarnings_countcheck_new_warningssh)
|
||||
- [`tools/warnings_count/update_current_warnings.sh`](#toolswarnings_countupdate_current_warningssh)
|
||||
- [`fixle.sh`](#fixlesh)
|
||||
- [`format.sh`](#formatsh)
|
||||
- [`format.py`](#formatpy)
|
||||
- [External tools](#external-tools)
|
||||
- [mips_to_c](#mips_to_c)
|
||||
- [Permuter](#permuter)
|
||||
@@ -196,9 +196,31 @@ If you have to add new warnings, **and have permission from the leads**, run thi
|
||||
|
||||
Fixes line endings in the repo to Linux style (LF), which is required for the build process to work. (You may be better off creating a new clone directly in Linux/WSL, though)
|
||||
|
||||
### `format.sh`
|
||||
### `format.py`
|
||||
|
||||
Formats all C files in the repo using `clang-format-11` (instructions on how to install this version are pinned in Discord if you can't get it from your package manager in the usual way). This will touch all files in the repo, so the next `make` will take longer.
|
||||
Formats all C files in the repo using `clang-format-11`, `clang-tidy`, and `clang-apply-replacements` (when multiprocessing). This will touch all files in the repo, so the next `make` will take longer.
|
||||
|
||||
You can specify how many threads you would like this to run with by adding the `-jN` flag. Where N is the number of threads. By default this will run using 1 thread (i.e. `-j1`).
|
||||
|
||||
`clang-11` is available in many native package managers, but if not try:
|
||||
|
||||
Linux:
|
||||
Download llvm's setup script, run it, than install normally
|
||||
```bash
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 11
|
||||
rm llvm.sh
|
||||
sudo apt install clang-format-11 clang-tidy-11 clang-apply-replacements-11
|
||||
```
|
||||
|
||||
Mac:
|
||||
Install with brew, than create symlinks for `clang-tidy` and `clang-apply-replacements` to use properly
|
||||
```bash
|
||||
brew install llvm clang-format-11
|
||||
ln -s "$(brew --prefix llvm)/bin/clang-tidy" "/usr/local/bin/clang-tidy"
|
||||
ln -s "$(brew --prefix llvm)/bin/clang-apply-replacements" "/usr/local/bin/clang-apply-replacements"
|
||||
```
|
||||
|
||||
## External tools
|
||||
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import multiprocessing
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
from functools import partial
|
||||
from typing import List
|
||||
|
||||
|
||||
# clang-format, clang-tidy and clang-apply-replacements default version
|
||||
# Version 11 is used when available for more consistency between contributors
|
||||
CLANG_VER = 11
|
||||
|
||||
# Clang-Format options (see .clang-format for rules applied)
|
||||
FORMAT_OPTS = "-i -style=file"
|
||||
|
||||
# Clang-Tidy options (see .clang-tidy for checks enabled)
|
||||
TIDY_OPTS = "-p ."
|
||||
TIDY_FIX_OPTS = "--fix --fix-errors"
|
||||
|
||||
# Clang-Apply-Replacements options (used for multiprocessing)
|
||||
APPLY_OPTS = ""
|
||||
|
||||
# Compiler options used with Clang-Tidy
|
||||
# Normal warnings are disabled with -Wno-everything to focus only on tidying
|
||||
INCLUDES = "-Iinclude -Isrc -Ibuild -I."
|
||||
DEFINES = "-D_LANGUAGE_C -DNON_MATCHING"
|
||||
COMPILER_OPTS = f"-fno-builtin -std=gnu90 -m32 -Wno-everything {INCLUDES} {DEFINES}"
|
||||
|
||||
|
||||
def get_clang_executable(allowed_executables: List[str]):
|
||||
for executable in allowed_executables:
|
||||
try:
|
||||
subprocess.check_call([executable, "--version"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
return executable
|
||||
except FileNotFoundError or subprocess.CalledProcessError:
|
||||
pass
|
||||
return None
|
||||
|
||||
|
||||
def get_tidy_version(tidy_executable: str):
|
||||
tidy_version_run = subprocess.run([tidy_executable, "--version"], stdout=subprocess.PIPE, universal_newlines=True)
|
||||
match = re.search(r"LLVM version ([0-9]+)", tidy_version_run.stdout)
|
||||
return int(match.group(1))
|
||||
|
||||
|
||||
CLANG_FORMAT = get_clang_executable([f"clang-format-{CLANG_VER}"])
|
||||
if CLANG_FORMAT is None:
|
||||
sys.exit(f"Error: clang-format-{CLANG_VER} found")
|
||||
|
||||
CLANG_TIDY = get_clang_executable([f"clang-tidy-{CLANG_VER}", "clang-tidy"])
|
||||
if CLANG_TIDY is None:
|
||||
sys.exit(f"Error: neither clang-tidy-{CLANG_VER} nor clang-tidy found")
|
||||
|
||||
CLANG_APPLY_REPLACEMENTS = get_clang_executable([f"clang-apply-replacements-{CLANG_VER}", "clang-apply-replacements"])
|
||||
|
||||
# Try to detect the clang-tidy version and add --fix-notes for version 13+
|
||||
# This is used to ensure all fixes are applied properly in recent versions
|
||||
if get_tidy_version(CLANG_TIDY) >= 13:
|
||||
TIDY_FIX_OPTS += " --fix-notes"
|
||||
|
||||
|
||||
def list_chunks(list: List, chunk_length: int):
|
||||
for i in range(0, len(list), chunk_length):
|
||||
yield list[i : i + chunk_length]
|
||||
|
||||
|
||||
def run_clang_format(files: List[str]):
|
||||
exec_str = f"{CLANG_FORMAT} {FORMAT_OPTS} {' '.join(files)}"
|
||||
subprocess.run(exec_str, shell=True)
|
||||
|
||||
|
||||
def run_clang_tidy(files: List[str]):
|
||||
exec_str = f"{CLANG_TIDY} {TIDY_OPTS} {TIDY_FIX_OPTS} {' '.join(files)} -- {COMPILER_OPTS}"
|
||||
subprocess.run(exec_str, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def run_clang_tidy_with_export(tmp_dir: str, files: List[str]):
|
||||
(handle, tmp_file) = tempfile.mkstemp(suffix=".yaml", dir=tmp_dir)
|
||||
os.close(handle)
|
||||
|
||||
exec_str = f"{CLANG_TIDY} {TIDY_OPTS} --export-fixes={tmp_file} {' '.join(files)} -- {COMPILER_OPTS}"
|
||||
subprocess.run(exec_str, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def run_clang_apply_replacements(tmp_dir: str):
|
||||
exec_str = f"{CLANG_APPLY_REPLACEMENTS} {APPLY_OPTS} {tmp_dir}"
|
||||
subprocess.run(exec_str, shell=True)
|
||||
|
||||
|
||||
def add_final_new_line(file: str):
|
||||
# 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)
|
||||
exec_str = f"tail -c1 {file} | read -r _ || echo >> {file}"
|
||||
subprocess.run(exec_str, shell=True)
|
||||
|
||||
|
||||
def format_files(src_files: List[str], extra_files: List[str], nb_jobs: int):
|
||||
if nb_jobs != 1:
|
||||
print(f"Formatting files with {nb_jobs} jobs")
|
||||
else:
|
||||
print(f"Formatting files with a single job (consider using -j to make this faster)")
|
||||
|
||||
# Format files in chunks to improve performance while still utilizing jobs
|
||||
file_chunks = list(list_chunks(src_files, (len(src_files) // nb_jobs) + 1))
|
||||
|
||||
print("Running clang-format...")
|
||||
# clang-format only applies changes in the given files, so it's safe to run in parallel
|
||||
with multiprocessing.get_context("fork").Pool(nb_jobs) as pool:
|
||||
pool.map(run_clang_format, file_chunks)
|
||||
|
||||
print("Running clang-tidy...")
|
||||
if nb_jobs > 1:
|
||||
# clang-tidy may apply changes in #included files, so when running it in parallel we use --export-fixes
|
||||
# then we call clang-apply-replacements to apply all suggested fixes at the end
|
||||
tmp_dir = tempfile.mkdtemp()
|
||||
|
||||
try:
|
||||
with multiprocessing.get_context("fork").Pool(nb_jobs) as pool:
|
||||
pool.map(partial(run_clang_tidy_with_export, tmp_dir), file_chunks)
|
||||
|
||||
run_clang_apply_replacements(tmp_dir)
|
||||
finally:
|
||||
shutil.rmtree(tmp_dir)
|
||||
else:
|
||||
run_clang_tidy(src_files)
|
||||
|
||||
print("Adding missing final new lines...")
|
||||
# Adding final new lines is safe to do in parallel and can be applied to all types of files
|
||||
with multiprocessing.get_context("fork").Pool(nb_jobs) as pool:
|
||||
pool.map(add_final_new_line, src_files + extra_files)
|
||||
|
||||
print("Done formatting files.")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Format files in the codebase to enforce most style rules")
|
||||
parser.add_argument("files", metavar="file", nargs="*")
|
||||
parser.add_argument(
|
||||
"-j",
|
||||
dest="jobs",
|
||||
type=int,
|
||||
nargs="?",
|
||||
default=1,
|
||||
help="number of jobs to run (default: 1 without -j, number of cpus with -j)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
nb_jobs = args.jobs or multiprocessing.cpu_count()
|
||||
if nb_jobs > 1:
|
||||
if CLANG_APPLY_REPLACEMENTS is None:
|
||||
sys.exit(
|
||||
f"Error: neither clang-apply-replacements-{CLANG_VER} nor clang-apply-replacements found (required to use -j)"
|
||||
)
|
||||
|
||||
if args.files:
|
||||
files = args.files
|
||||
extra_files = []
|
||||
else:
|
||||
files = glob.glob("src/**/*.c", recursive=True)
|
||||
extra_files = glob.glob("assets/**/*.xml", recursive=True)
|
||||
|
||||
format_files(files, extra_files, nb_jobs)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/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"
|
||||
|
||||
# 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}` ]
|
||||
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-${FORMAT_VER} ${FORMAT_OPTS} "$@"
|
||||
echo "Running clang-tidy..."
|
||||
clang-tidy ${TIDY_OPTS} "$@" -- ${COMPILER_OPTS} &> /dev/null
|
||||
echo "Adding missing final new lines..."
|
||||
add_final_newline "$@"
|
||||
echo "Done formatting file(s) $*"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Formatting C files. This will take a bit"
|
||||
echo "Running clang-format..."
|
||||
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 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."
|
||||
+147
-150
File diff suppressed because it is too large
Load Diff
+14
-14
@@ -29,21 +29,21 @@ typedef struct GfxPrint {
|
||||
/* 0x14 */ UNK_TYPE1 unk_14[0x1C]; // unused
|
||||
} GfxPrint; // size = 0x30
|
||||
|
||||
void GfxPrint_Setup(GfxPrint* printer);
|
||||
void GfxPrint_SetColor(GfxPrint* printer, u32 r, u32 g, u32 b, u32 a);
|
||||
void GfxPrint_SetPosPx(GfxPrint* printer, s32 x, s32 y);
|
||||
void GfxPrint_SetPos(GfxPrint* printer, s32 x, s32 y);
|
||||
void GfxPrint_SetBasePosPx(GfxPrint* printer, s32 x, s32 y);
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* printer, u8 c);
|
||||
void GfxPrint_PrintChar(GfxPrint* printer, u8 c);
|
||||
void GfxPrint_PrintStringWithSize(GfxPrint* printer, const void* buffer, size_t charSize, size_t charCount);
|
||||
void GfxPrint_PrintString(GfxPrint* printer, const char* str);
|
||||
void GfxPrint_Setup(GfxPrint* this);
|
||||
void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a);
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y);
|
||||
void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y);
|
||||
void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y);
|
||||
void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c);
|
||||
void GfxPrint_PrintChar(GfxPrint* this, u8 c);
|
||||
void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount);
|
||||
void GfxPrint_PrintString(GfxPrint* this, const char* str);
|
||||
void* GfxPrint_Callback(void* arg, const char* str, size_t size);
|
||||
void GfxPrint_Init(GfxPrint* printer);
|
||||
void GfxPrint_Init(GfxPrint* this);
|
||||
void GfxPrint_Destroy(GfxPrint* printer);
|
||||
void GfxPrint_Open(GfxPrint* printer, Gfx* dList);
|
||||
Gfx* GfxPrint_Close(GfxPrint* printer);
|
||||
s32 GfxPrint_VPrintf(GfxPrint* printer, const char* fmt, va_list args);
|
||||
s32 GfxPrint_Printf(GfxPrint* printer, const char* fmt, ...);
|
||||
void GfxPrint_Open(GfxPrint* this, Gfx* dList);
|
||||
Gfx* GfxPrint_Close(GfxPrint* this);
|
||||
s32 GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args);
|
||||
s32 GfxPrint_Printf(GfxPrint* this, const char* fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ void* __osMalloc(Arena* arena, size_t size);
|
||||
void* __osMallocR(Arena* arena, size_t size);
|
||||
void __osFree(Arena* arena, void* ptr);
|
||||
void* __osRealloc(Arena* arena, void* ptr, size_t newSize);
|
||||
void __osGetSizes(Arena* arena, size_t* maxFreeBlock, size_t* bytesFree, size_t* bytesAllocated);
|
||||
void __osGetSizes(Arena* arena, size_t* outMaxFree, size_t* outFree, size_t* outAlloc);
|
||||
s32 __osCheckArena(Arena* arena);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,7 +29,7 @@ MtxF* Matrix_GetCurrent(void);
|
||||
|
||||
/* Basic operations */
|
||||
|
||||
void Matrix_Mult(MtxF* matrix, MatrixMode mode);
|
||||
void Matrix_Mult(MtxF* mf, MatrixMode mode);
|
||||
void Matrix_Translate(f32 x, f32 y, f32 z, MatrixMode mode);
|
||||
void Matrix_Scale(f32 x, f32 y, f32 z, MatrixMode mode);
|
||||
void Matrix_RotateXS(s16 x, MatrixMode mode);
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ u32 Quake_SetQuakeValues(s16 quakeIndex, s16 verticalMag, s16 horizontalMag, s16
|
||||
u32 Quake_SetQuakeValues2(s16 quakeIndex, s16 isShakePerpendicular, Vec3s shakePlaneOffset);
|
||||
s16 Quake_Add(Camera* camera, u32 type);
|
||||
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
|
||||
u32 Quake_Remove(s16 quakeIndex);
|
||||
u32 Quake_Remove(s16 index);
|
||||
s32 Quake_NumActiveQuakes(void);
|
||||
void Quake_Init(void);
|
||||
|
||||
|
||||
+3
-3
@@ -480,9 +480,9 @@ void func_80144A94(SramContext* sramCtx);
|
||||
void Sram_OpenSave(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void func_8014546C(SramContext* sramCtx);
|
||||
void func_801457CC(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void func_80146580(struct FileSelectState* fileSelect, SramContext* sramCtx, s32 fileNum);
|
||||
void func_80146628(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void Sram_InitSave(struct FileSelectState* fileSelect, SramContext* sramCtx);
|
||||
void func_80146580(struct FileSelectState* fileSelect2, SramContext* sramCtx, s32 fileNum);
|
||||
void func_80146628(struct FileSelectState* fileSelect2, SramContext* sramCtx);
|
||||
void Sram_InitSave(struct FileSelectState* fileSelect2, SramContext* sramCtx);
|
||||
void func_80146DF8(SramContext* sramCtx);
|
||||
void Sram_InitSram(struct GameState* gameState, SramContext* sramCtx);
|
||||
void Sram_Alloc(struct GameState* gameState, SramContext* sramCtx);
|
||||
|
||||
+3
-3
@@ -100,7 +100,7 @@ void SubS_TimePathing_ComputeTargetPosXZ(f32* x, f32* z, f32 progress, s32 order
|
||||
s32 SubS_TimePathing_Update(Path* path, f32* progress, s32* elapsedTime, s32 waypointTime, s32 totalTime, s32* waypoint, f32 knots[], Vec3f* targetPos, s32 timeSpeed);
|
||||
void SubS_TimePathing_ComputeInitialY(struct PlayState* play, Path* path, s32 waypoint, Vec3f* targetPos);
|
||||
|
||||
Path* SubS_GetAdditionalPath(struct PlayState* play, u8 pathIndex, s32 max);
|
||||
Path* SubS_GetAdditionalPath(struct PlayState* play, u8 pathIndex, s32 limit);
|
||||
|
||||
Actor* SubS_FindNearestActor(Actor* actor, struct PlayState* play, u8 actorCategory, s16 actorId);
|
||||
|
||||
@@ -122,7 +122,7 @@ void SubS_GenShadowTex(Vec3f bodyPartsPos[], Vec3f* worldPos, u8* tex, f32 tween
|
||||
void SubS_DrawShadowTex(Actor* actor, struct GameState* gameState, u8* tex);
|
||||
|
||||
s16 SubS_ComputeTrackPointRot(s16* rot, s16 rotMax, s16 target, f32 slowness, f32 stepMin, f32 stepMax);
|
||||
s32 SubS_TrackPoint(Vec3f* point, Vec3f* focusPos, Vec3s* shapeRot, Vec3s* trackTarget, Vec3s* headRot, Vec3s* torsoRot, TrackOptionsSet* options);
|
||||
s32 SubS_TrackPoint(Vec3f* target, Vec3f* focusPos, Vec3s* shapeRot, Vec3s* trackTarget, Vec3s* headRot, Vec3s* torsoRot, TrackOptionsSet* options);
|
||||
|
||||
s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB);
|
||||
|
||||
@@ -130,7 +130,7 @@ Path* SubS_GetPathByIndex(struct PlayState* play, s16 pathIndex, s16 max);
|
||||
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst);
|
||||
s16 SubS_GetDistSqAndOrientPoints(Vec3f* vecA, Vec3f* vecB, f32* distSq);
|
||||
s32 SubS_MoveActorToPoint(Actor* actor, Vec3f* point, s16 rotStep);
|
||||
s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq);
|
||||
s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIndex, Vec3f* pos, f32* distSq);
|
||||
|
||||
s8 SubS_IsObjectLoaded(s8 index, struct PlayState* play);
|
||||
s8 SubS_GetObjectIndex(s16 id, struct PlayState* play);
|
||||
|
||||
@@ -79,7 +79,7 @@ s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex);
|
||||
EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play);
|
||||
void EnHy_ChangeObjectAndAnim(EnHy* enHy, PlayState* play, s16 animIndex);
|
||||
s32 EnHy_UpdateSkelAnime(EnHy* enHy, PlayState* play);
|
||||
void EnHy_Blink(EnHy* enHy, s32 arg1);
|
||||
void EnHy_Blink(EnHy* enHy, s32 eyeTexMaxIndex);
|
||||
s32 EnHy_Init(EnHy* enHy, PlayState* play, FlexSkeletonHeader* skeletonHeaderSeg, s16 animIndex);
|
||||
void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4);
|
||||
s32 func_800F0CE4(EnHy* enHy, PlayState* play, ActorFunc draw, s16 arg3, s16 arg4, f32 arg5);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "global.h"
|
||||
|
||||
void Setup_Destroy(GameState* gameState);
|
||||
void Setup_Init(GameState* gameState);
|
||||
void Setup_Init(GameState* thisx);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ GameState state;
|
||||
|
||||
@@ -5,22 +5,22 @@ volatile OSTime sIrqMgrResetTime = 0;
|
||||
volatile OSTime sIrqMgrRetraceTime = 0;
|
||||
s32 sIrqMgrRetraceCount = 0;
|
||||
|
||||
void IrqMgr_AddClient(IrqMgr* irqmgr, IrqMgrClient* param_2, OSMesgQueue* param_3) {
|
||||
void IrqMgr_AddClient(IrqMgr* irqmgr, IrqMgrClient* client, OSMesgQueue* msgQueue) {
|
||||
u32 saveMask;
|
||||
|
||||
saveMask = osSetIntMask(1);
|
||||
|
||||
param_2->queue = param_3;
|
||||
param_2->next = irqmgr->callbacks;
|
||||
irqmgr->callbacks = param_2;
|
||||
client->queue = msgQueue;
|
||||
client->next = irqmgr->callbacks;
|
||||
irqmgr->callbacks = client;
|
||||
|
||||
osSetIntMask(saveMask);
|
||||
|
||||
if (irqmgr->prenmiStage > 0) {
|
||||
osSendMesg(param_2->queue, &irqmgr->prenmiMsg.type, OS_MESG_NOBLOCK);
|
||||
osSendMesg(client->queue, &irqmgr->prenmiMsg.type, OS_MESG_NOBLOCK);
|
||||
}
|
||||
if (irqmgr->prenmiStage > 1) {
|
||||
osSendMesg(param_2->queue, &irqmgr->nmiMsg.type, OS_MESG_NOBLOCK);
|
||||
osSendMesg(client->queue, &irqmgr->nmiMsg.type, OS_MESG_NOBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ void* AudioLoad_SyncLoad(s32 tableType, u32 id, s32* didAllocate);
|
||||
u32 AudioLoad_GetRealTableIndex(s32 tableType, u32 id);
|
||||
void* AudioLoad_SearchCaches(s32 tableType, s32 id);
|
||||
AudioTable* AudioLoad_GetLoadTable(s32 tableType);
|
||||
void AudioLoad_SyncDma(uintptr_t devAddr, u8* addr, size_t size, s32 medium);
|
||||
void AudioLoad_SyncDma(uintptr_t devAddr, u8* ramAddr, size_t size, s32 medium);
|
||||
void AudioLoad_SyncDmaUnkMedium(uintptr_t devAddr, u8* addr, size_t size, s32 unkMediumParam);
|
||||
s32 AudioLoad_Dma(OSIoMesg* mesg, u32 priority, s32 direction, uintptr_t devAddr, void* ramAddr, size_t size,
|
||||
OSMesgQueue* reqQueue, s32 medium, const char* dmaFuncType);
|
||||
|
||||
@@ -21,14 +21,14 @@ typedef enum {
|
||||
/* 2 */ HAAS_EFFECT_DELAY_RIGHT // Delay right channel so that left channel is heard first
|
||||
} HaasEffectDelaySide;
|
||||
|
||||
Acmd* AudioSynth_SaveResampledReverbSamplesImpl(Acmd* cmd, u16 dmem, u16 arg2, uintptr_t arg3);
|
||||
Acmd* AudioSynth_SaveResampledReverbSamplesImpl(Acmd* cmd, u16 dmem, u16 size, uintptr_t startAddr);
|
||||
Acmd* AudioSynth_LoadReverbSamplesImpl(Acmd* cmd, u16 dmem, u16 startPos, s32 size, SynthesisReverb* reverb);
|
||||
Acmd* AudioSynth_SaveReverbSamplesImpl(Acmd* cmd, u16 dmem, u16 startPos, s32 size, SynthesisReverb* reverb);
|
||||
Acmd* AudioSynth_ProcessSamples(s16* aiBuf, s32 numSamplesPerUpdate, Acmd* cmd, s32 updateIndex);
|
||||
Acmd* AudioSynth_ProcessSample(s32 noteIndex, NoteSampleState* sampleState, NoteSynthesisState* synthState, s16* aiBuf,
|
||||
s32 numSamplesPerUpdate, Acmd* cmd, s32 updateIndex);
|
||||
Acmd* AudioSynth_ApplySurroundEffect(Acmd* cmd, NoteSampleState* sampleState, NoteSynthesisState* synthState, s32 size,
|
||||
s32 dmem, s32 flags);
|
||||
Acmd* AudioSynth_ApplySurroundEffect(Acmd* cmd, NoteSampleState* sampleState, NoteSynthesisState* synthState,
|
||||
s32 numSamplesPerUpdate, s32 haasDmem, s32 flags);
|
||||
Acmd* AudioSynth_FinalResample(Acmd* cmd, NoteSynthesisState* synthState, s32 size, u16 pitch, u16 inpDmem,
|
||||
s32 resampleFlags);
|
||||
Acmd* AudioSynth_ProcessEnvelope(Acmd* cmd, NoteSampleState* sampleState, NoteSynthesisState* synthState,
|
||||
|
||||
@@ -70,7 +70,7 @@ s32 Audio_SetGanonsTowerBgmVolume(u8 targetVolume);
|
||||
|
||||
void Audio_StartMorningSceneSequence(u16 seqId);
|
||||
void Audio_StartSceneSequence(u16 seqId);
|
||||
void Audio_PlaySequenceWithSeqPlayerIO(s8 playerIndex, u16 seqId, u8 fadeTimer, s8 arg3, u8 arg4);
|
||||
void Audio_PlaySequenceWithSeqPlayerIO(s8 playerIndex, u16 seqId, u8 fadeInDuration, s8 ioPort, u8 ioData);
|
||||
void func_801A4428(u8 reverbIndex);
|
||||
void func_801A3038(void);
|
||||
void Audio_PlayAmbience(u8 ambienceId);
|
||||
|
||||
@@ -843,10 +843,10 @@ void EnItem00_DrawSprite(EnItem00* this, PlayState* play) {
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
void EnItem00_DrawHeartContainer(EnItem00* actor, PlayState* play) {
|
||||
void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) {
|
||||
s32 pad[2];
|
||||
|
||||
if (Object_GetIndex(&play->objectCtx, OBJECT_GI_HEARTS) == actor->actor.objBankIndex) {
|
||||
if (Object_GetIndex(&play->objectCtx, OBJECT_GI_HEARTS) == this->actor.objBankIndex) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
func_8012C2DC(play->state.gfxCtx);
|
||||
|
||||
@@ -459,8 +459,8 @@ void AnimatedMat_DrawStep(PlayState* play, AnimatedMaterial* matAnim, u32 step)
|
||||
/**
|
||||
* Draws an animated material with a step to only the OPA buffer.
|
||||
*/
|
||||
void AnimatedMat_DrawStepOpa(PlayState* play, AnimatedMaterial* textures, u32 step) {
|
||||
AnimatedMat_DrawMain(play, textures, 1, step, 1);
|
||||
void AnimatedMat_DrawStepOpa(PlayState* play, AnimatedMaterial* matAnim, u32 step) {
|
||||
AnimatedMat_DrawMain(play, matAnim, 1, step, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,9 +8,9 @@ s32 SkelAnime_LoopFull(SkelAnime* skelAnime);
|
||||
s32 SkelAnime_LoopPartial(SkelAnime* skelAnime);
|
||||
s32 SkelAnime_Once(SkelAnime* skelAnime);
|
||||
void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animation);
|
||||
void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* pos, s16 angle);
|
||||
void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle);
|
||||
void LinkAnimation_Change(PlayState* play, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed,
|
||||
f32 frame, f32 frameCount, u8 animationMode, f32 morphFrames);
|
||||
f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames);
|
||||
void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src);
|
||||
|
||||
static AnimationEntryCallback sAnimationLoadDone[] = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user