various documentation

This commit is contained in:
Banjo Kazooie
2024-07-01 00:28:11 -05:00
parent 676533f2dc
commit 9688497485
104 changed files with 1034 additions and 947 deletions

View File

@@ -2,14 +2,16 @@
#include "functions.h"
#include "variables.h"
static void _guMtxIdentF(float mf[4][4]);
u8 D_80275900[] = {0xCF, 0xAD, 0xA2, 0x90, 0x93, 0x4A, 0x83, 0xF1};
f32 D_80275908 = BAD_DTOR;
s32 func_80245980(f32 arg0){
static s32 guFToFix32(f32 arg0){
return arg0*65536.0f;
}
void func_802459A0(float mf[4][4], Mtx *m)
static void __guMtxF2L(float mf[4][4], Mtx *m)
{
int i, j;
int e1,e2;
@@ -21,14 +23,14 @@ void func_802459A0(float mf[4][4], Mtx *m)
for (i=0; i<4; i++)
for (j=0; j<2; j++) {
e1=func_80245980(mf[i][j*2]);
e2=func_80245980(mf[i][j*2+1]);
e1=guFToFix32(mf[i][j*2]);
e2=guFToFix32(mf[i][j*2+1]);
*(ai++) = ( e1 & 0xffff0000 ) | ((e2 >> 16)&0xffff);
*(af++) = ((e1 << 16) & 0xffff0000) | (e2 & 0xffff);
}
}
void func_80245A7C(float mf[4][4], Mtx *m) //should be mf[4][4]
void _guMtxF2L(float mf[4][4], Mtx *m) //should be mf[4][4]
{
int i;
int j;
@@ -50,10 +52,10 @@ void func_80245A7C(float mf[4][4], Mtx *m) //should be mf[4][4]
}
}
void func_80245BE4(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
void _guFustrumF(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
s32 i, j;
_guMtxIdentF_80245D44(mf);
_guMtxIdentF(mf);
mf[0][0] = (2 * arg5) / (arg2 - arg1);
mf[1][1] = (2 * arg5) / (arg4 - arg3);
mf[2][0] = (arg2 + arg1) / (arg2 - arg1);
@@ -69,7 +71,7 @@ void func_80245BE4(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg
}
}
void _guMtxIdentF_80245D44(float mf[4][4]) //static
static void _guMtxIdentF(float mf[4][4]) //static
{
int i, j;
@@ -79,7 +81,7 @@ void _guMtxIdentF_80245D44(float mf[4][4]) //static
else mf[i][j] = 0.0;
}
void func_80245DCC(f32 lmf[4][4], f32 rmf[4][4], f32 dst[4][4]) {
void guMtxCatF(f32 lmf[4][4], f32 rmf[4][4], f32 dst[4][4]) {
s32 i, j, k;
f32 sp1C[4][4];
@@ -98,7 +100,7 @@ void func_80245DCC(f32 lmf[4][4], f32 rmf[4][4], f32 dst[4][4]) {
}
}
void func_80245F34(f32 *arg0, f32 *arg1, f32 *arg2) {
static void _guNormalize(f32 *arg0, f32 *arg1, f32 *arg2) {
f32 inv_len;
inv_len = 1.0f / gu_sqrtf((*arg0 * *arg0) + (*arg1 * *arg1) + (*arg2 * *arg2));
@@ -107,7 +109,7 @@ void func_80245F34(f32 *arg0, f32 *arg1, f32 *arg2) {
*arg2 *= inv_len;
}
void func_80245FB8(float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far, float scale)
void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far, float scale)
{
float cot;
float tmp;
@@ -163,25 +165,25 @@ void func_80245FB8(float mf[4][4], u16 *perspNorm, float fovy, float aspect, flo
void guPerspective(Mtx *m, u16 *perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) {
f32 sp28[4][4];
func_80245FB8(sp28, perspNorm, fovy, aspect, near, far, scale);
func_802459A0(sp28, m);
guPerspectiveF(sp28, perspNorm, fovy, aspect, near, far, scale);
__guMtxF2L(sp28, m);
}
void func_8024632C(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
void _guRotateF(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
f32 sp34;
f32 sp30;
f32 sp2C;
f32 sp28;
volatile f32 sp24;
func_80245F34(&arg2, &arg3, &arg4);
_guNormalize(&arg2, &arg3, &arg4);
arg1 *= D_80275908;
sp34 = sinf(arg1);
sp30 = cosf(arg1);
sp2C = arg2 * arg3 * (1.0f - sp30);
sp28 = arg3 * arg4 * (1.0f - sp30);
sp24 = (arg4 * arg2 * (1.0f - sp30));
_guMtxIdentF_80245D44(mf);
_guMtxIdentF(mf);
mf[0][0] = ((1.0f - (arg2 * arg2)) * sp30) + (arg2 * arg2);
mf[2][1] = (sp28 - (arg2 * sp34));
mf[1][2] = ((arg2 * sp34) + sp28);
@@ -195,10 +197,10 @@ void func_8024632C(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
mf[0][1] = (arg4 * sp34) + sp2C;
}
void func_802464B0(f32 mf[4][4], f32 arg1){
void guRotateRollF(f32 mf[4][4], f32 arg1){
f32 c, s;
arg1 *= D_80275908;
_guMtxIdentF_80245D44(mf);
_guMtxIdentF(mf);
c = cosf(arg1);
mf[1][1] = c;
mf[2][2] = c;
@@ -207,10 +209,10 @@ void func_802464B0(f32 mf[4][4], f32 arg1){
mf[2][1] = -s;
}
void func_80246510(f32 mf[4][4], f32 arg1){
void guRotatePitchF(f32 mf[4][4], f32 arg1){
f32 c, s;
arg1 *= D_80275908;
_guMtxIdentF_80245D44(mf);
_guMtxIdentF(mf);
c = cosf(arg1);
mf[0][0] = c;
mf[2][2] = c;
@@ -219,10 +221,10 @@ void func_80246510(f32 mf[4][4], f32 arg1){
mf[0][2] = -s;
}
void func_80246570(f32 mf[4][4], f32 arg1){
void guRotateYawF(f32 mf[4][4], f32 arg1){
f32 c, s;
arg1 *= D_80275908;
_guMtxIdentF_80245D44(mf);
_guMtxIdentF(mf);
c = cosf(arg1);
mf[0][0] = c;
mf[1][1] = c;
@@ -231,16 +233,16 @@ void func_80246570(f32 mf[4][4], f32 arg1){
mf[1][0] = -s;
}
void func_802465D0(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3){
_guMtxIdentF_80245D44(mf);
void _guScaleF(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3){
_guMtxIdentF(mf);
mf[0][0] = arg1;
mf[1][1] = arg2;
mf[2][2] = arg3;
mf[3][3] = 1.0f;
}
void func_80246624(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3){
_guMtxIdentF_80245D44(mf);
void _guTranslateF(f32 mf[4][4], f32 arg1, f32 arg2, f32 arg3){
_guMtxIdentF(mf);
mf[3][0] = arg1;
mf[3][1] = arg2;
mf[3][2] = arg3;