Files
tp/include/JSystem/JMath/JMath.h
T
TakaRikka ca71275bbe big d_a_alink pass (#214)
* d_a_alink pass1 wip

* more d_a_alink work

* remove asm

* more daalink work

* 20% dol code decompiled

* fixed some nonmatchings for building

* a few daalink functions and labeling some HIO data
2022-12-19 12:06:32 -07:00

41 lines
766 B
C++

#ifndef JMATH_H
#define JMATH_H
#include "dolphin/mtx/mtx.h"
#include "dolphin/types.h"
void JMAMTXApplyScale(const Mtx, Mtx, f32, f32, f32);
void JMAEulerToQuat(s16 param_0, s16 param_1, s16 param_2, Quaternion* param_3);
inline f32 JMAFastReciprocal(f32 value) {
return __fres(value);
}
inline float __frsqrtes(register double f) {
register float out;
// clang-format off
asm {
frsqrte out, f
}
// clang-format on
return out;
}
inline f32 JMAFastSqrt(f32 input) {
if (input > 0.0f) {
f32 tmp = __frsqrtes(input);
return tmp * input;
}
return input;
}
namespace JMath {
inline f32 fastReciprocal(f32 value) {
return JMAFastReciprocal(value);
}
}; // namespace JMath
#endif /* JMATH_H */