c_lib: Decomp a few functions (#89)

* c_lib: Decomp cLib_memSet and cLib_memCpy

Gets rid of some low-hanging fruit.

* c_lib: Decomp cLib_distanceAngleS

Another super trivial function to make match.

* c_lib: Decomp cLib_targetAngleY overload set

Fairly trivial in terms of matching.

* c_lib: Sate clang-format

I didn't touch this code, but the clang-format pass wants this done, and
so it is.
This commit is contained in:
LC
2021-01-21 20:29:22 -05:00
committed by GitHub
parent 411fcead8c
commit f0699b05a8
7 changed files with 23 additions and 78 deletions
+13 -19
View File
@@ -1,19 +1,18 @@
/* c_lib.cpp autogenerated by split.py v0.3 at 2021-01-01 14:12:11.766106 */
#include "SComponent/c_lib.h"
#include "SComponent/c_math.h"
// cLib_memCpy__FPvPCvUl
// cLib_memCpy(void*, const void*, unsigned long)
asm void cLib_memCpy(void*, const void*, unsigned long) {
nofralloc
#include "SComponent/c_lib/asm/func_8026F93C.s"
void cLib_memCpy(void* dst, const void* src, unsigned long size) {
memcpy(dst, src, size);
}
// cLib_memSet__FPviUl
// cLib_memSet(void*, int, unsigned long)
asm void cLib_memSet(void*, int, unsigned long) {
nofralloc
#include "SComponent/c_lib/asm/func_8026F95C.s"
void cLib_memSet(void* ptr, int value, unsigned long size) {
memset(ptr, value, size);
}
// cLib_addCalc__FPfffff
@@ -116,23 +115,20 @@ asm int cLib_chasePosXZ(cXyz*, const cXyz&, float) {
// cLib_chaseAngleS__FPsss
// cLib_chaseAngleS(short*, short, short)
asm int cLib_chaseAngleS(short*, short, short) {
nofralloc
asm int cLib_chaseAngleS(short*, short, short){nofralloc
#include "SComponent/c_lib/asm/func_80270B90.s"
}
// cLib_targetAngleY__FPC3VecPC3Vec
// cLib_targetAngleY(const Vec*, const Vec*)
asm short cLib_targetAngleY(const Vec*, const Vec*) {
nofralloc
#include "SComponent/c_lib/asm/func_80270C04.s"
s16 cLib_targetAngleY(const Vec* lhs, const Vec* rhs) {
return cM_atan2s(rhs->x - lhs->x, rhs->z - lhs->z);
}
// cLib_targetAngleY__FRC3VecRC3Vec
// cLib_targetAngleY(const Vec&, const Vec&)
asm short cLib_targetAngleY(const Vec&, const Vec&) {
nofralloc
#include "SComponent/c_lib/asm/func_80270C3C.s"
s16 cLib_targetAngleY(const Vec& lhs, const Vec& rhs) {
return cM_atan2s(rhs.x - lhs.x, rhs.z - lhs.z);
}
// cLib_targetAngleX__FPC4cXyzPC4cXyz
@@ -144,16 +140,14 @@ asm short cLib_targetAngleX(const cXyz*, const cXyz*) {
// cLib_offsetPos__FP4cXyzPC4cXyzsPC4cXyz
// cLib_offsetPos(cXyz*, const cXyz*, short, const cXyz*)
asm void cLib_offsetPos(cXyz*, const cXyz*, short, const cXyz*) {
nofralloc
asm void cLib_offsetPos(cXyz*, const cXyz*, short, const cXyz*){nofralloc
#include "SComponent/c_lib/asm/func_80270DC0.s"
}
// cLib_distanceAngleS__Fss
// cLib_distanceAngleS(short, short)
asm short cLib_distanceAngleS(short, short) {
nofralloc
#include "SComponent/c_lib/asm/func_80270E24.s"
s32 cLib_distanceAngleS(s16 x, s16 y) {
return abs(static_cast<s16>(x - y));
}
// MtxInit__Fv