Attempt to decompile func0f0bfc7c and introduce Mtx and Mtxf types

This commit is contained in:
Ryan Dwyer
2020-12-23 08:19:41 +10:00
parent b913d584c3
commit 1b8c119e52
48 changed files with 419 additions and 322 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ void currentPlayerUpdateMoveInitSpeed(struct coord *newpos);
void currentPlayerUpdateFootsteps(bool arg0, bool arg1, bool arg2, bool arg3);
void func0f0cbf50(void);
void func0f0cc19c(struct coord *arg);
void func0f0cc3b8(f32 arg0, f32 arg1, f32 arg2, f32 *arg3, f32 arg4);
void func0f0cc3b8(f32 arg0, f32 arg1, f32 arg2, Mtxf *arg3, f32 arg4);
void func0f0cc654(f32 arg0, f32 arg1, f32 arg2);
s32 currentPlayerGetCrouchPos(void);
s32 playerGetCrouchPos(s32 playernum);
+2 -2
View File
@@ -4,8 +4,8 @@
#include "types.h"
u32 func0f096ca0(void);
void func0f096ed4(f32 *arg0, f32 *arg1);
void func0f097044(f32 *matrix, f32 *arg1);
void func0f096ed4(f32 *arg0, Mtxf *arg1);
void func0f097044(Mtxf *matrix, f32 *arg1);
u32 func0f097264(void);
void func0f0972b8(f32 *arg0, f32 *arg1, f32 arg2, f32 *arg3);
u32 func0f097518(void);
+2 -2
View File
@@ -68,9 +68,9 @@ u32 func0f09e4e0(void);
u32 func0f09ea90(void);
bool func0f09eae4(void);
u32 func0f09ebbc(void);
void func0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, f32 *matrix1, f32 *arg4, f32 *matrix2, struct prop *prop, struct coord *pos);
void func0f09ebcc(struct defaultobj *obj, struct coord *coord, s16 *rooms, Mtxf *matrix1, f32 *arg4, Mtxf *matrix2, struct prop *prop, struct coord *pos);
u32 func0f09ed2c(void);
void func0f09ee18(struct chrdata *chr, u8 *arg1, struct coord *pos, s16 *rooms, f32 *arg4, struct coord *arg5);
void func0f09ee18(struct chrdata *chr, u8 *arg1, struct coord *pos, s16 *rooms, Mtxf *arg4, struct coord *arg5);
u32 func0f09f100(void);
u32 func0f09f848(void);
u32 func0f09f974(void);
+16 -16
View File
@@ -22,32 +22,32 @@ void func0f0b4d68(struct coord *in, struct coord *out);
void func0f0b4dec(struct coord *in, struct coord *out);
void func0f0b4e68(struct coord *in, f32 divisor, struct coord *out);
void func0f0b4eb8(struct coord *arg0, f32 arg1[2], f32 zoom, f32 aspect);
void currentPlayerSetUnk1738(u32 value);
void currentPlayerSetUnk173c(u32 value);
u32 currentPlayerGetUnk173c(void);
void currentPlayerSetUnk006c(u32 value);
u32 currentPlayerGetUnk006c(void);
void currentPlayerSetUnk1738(void *matrix);
void currentPlayerSetUnk173c(Mtx *matrix);
Mtx *currentPlayerGetUnk173c(void);
void currentPlayerSetUnk006c(Mtxf *matrix);
Mtxf *currentPlayerGetUnk006c(void);
void currentPlayerSetUnk1750(void *value);
void *currentPlayerGetUnk1750(void);
void currentPlayerSetUnk1758(u32 value);
u32 currentPlayerGetUnk1758(void);
void currentPlayerSetMatrix(f32 *value);
void currentPlayerSetUnk1758(Mtx *matrix);
Mtx *currentPlayerGetUnk1758(void);
void currentPlayerSetMatrix1740(Mtxf *value);
u32 func0f0b5050(void);
u32 func0f0b53a4(void);
f32 *currentPlayerGetMatrix(void);
void currentPlayerSetUnk1754(u32 value);
u32 currentPlayerGetUnk1754(void);
void currentPlayerSetUnk174c(u32 value);
u32 currentPlayerGetUnk174c(void);
void currentPlayerSetUnk175c(u32 value);
u32 currentPlayerGetUnk175c(void);
Mtxf *currentPlayerGetMatrix1740(void);
void currentPlayerSetUnk1754(Mtxf *matrix);
Mtxf *currentPlayerGetUnk1754(void);
void currentPlayerSetUnk174c(Mtxf *matrix);
Mtxf *currentPlayerGetUnk174c(void);
void currentPlayerSetUnk175c(void *value);
void *currentPlayerGetUnk175c(void);
f32 currentPlayerGetLodScaleZ(void);
f32 currentPlayerGetScreenWidth(void);
f32 currentPlayerGetScreenHeight(void);
f32 currentPlayerGetScreenLeft(void);
f32 currentPlayerGetScreenTop(void);
f32 currentPlayerGetPerspAspect(void);
u32 func0f0b5838(void);
void func0f0b5838(void);
u32 func0f0b5b9c(void);
u32 func0f0b5d38(void);
u32 func0f0b6260(void);
+2 -2
View File
@@ -21,8 +21,8 @@ void func0f167330(void);
void func0f167350(void);
Gfx *func0f16793c(void);
struct gfxvtx *gfxAllocateVertices(s32 count);
u32 func0f167998(void);
u32 func0f1679b0(void);
void *gfxAllocateMatrix(void);
void *gfxAllocate4Words(s32 count);
u32 *gfxAllocateColours(s32 count);
struct model0c *func0f1679f4(s32 arg0);
void func0f167a18(void);
+1 -1
View File
@@ -89,7 +89,7 @@ u32 func0f06a52c(void);
struct prop *func0f06a550(struct singlemonitorobj *monitor);
u32 func0f06a580(void);
f32 func0f06a620(struct defaultobj *obj);
void func0f06a730(struct defaultobj *obj, struct pad *newpad, f32 *matrix, s16 *arg3, struct pad *arg4);
void func0f06a730(struct defaultobj *obj, struct pad *newpad, Mtxf *matrix, s16 *arg3, struct pad *arg4);
u32 func0f06ab60(void);
void func0f06ac40(struct defaultobj *obj);
void func0f06ac90(struct prop *prop);
+1 -1
View File
@@ -4,6 +4,6 @@
#include "types.h"
u32 func00004320(void);
u32 func0000470c(void);
void func0000470c(f32 *matrix, void *arg1, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz);
#endif
+1 -1
View File
@@ -4,6 +4,6 @@
#include "types.h"
u32 func00004840(void);
void func00004a24(u32 arg0, u16 *arg1, f32 fovy, f32 arg3, f32 arg4, f32 arg5, f32 arg6);
void func00004a24(f32 *matrix, u16 *arg1, f32 fovy, f32 arg3, f32 arg4, f32 arg5, f32 arg6);
#endif
+13 -13
View File
@@ -3,30 +3,30 @@
#include <ultra64.h>
#include "types.h"
void func000159b0(f32 *matrix);
void func000159fc(f32 *matrix, f32 *arg1);
void func00015a00(f32 *matrix, f32 *arg1, f32 *arg2);
void func00015b10(f32 *matrix, struct coord *coord);
void func000159b0(Mtxf *matrix);
void func000159fc(Mtxf *matrix, Mtxf *arg1);
void func00015a00(Mtxf *matrix, Mtxf *arg1, Mtxf *arg2);
void func00015b10(Mtxf *matrix, struct coord *coord);
void func00015b14(f32 *matrix, f32 *coord, struct coord *arg2);
void func00015b64(f32 *arg0, struct coord *coord);
void func00015b68(f32 *matrix, struct coord *arg1, struct coord *arg2);
void func00015be0(f32 *matrix1, f32 *matrix2);
void func00015be4(u32 arg0, struct model0c *model0c, f32 *arg2);
void func00015b64(Mtxf *arg0, struct coord *coord);
void func00015b68(Mtxf *matrix, struct coord *arg1, struct coord *arg2);
void func00015be0(Mtxf *matrix1, Mtxf *matrix2);
void func00015be4(Mtxf *arg0, struct model0c *model0c, Mtxf *arg2);
void func00015cd8(f32 *arg0, f32 *realrot);
u32 func00015d18(void);
void func00015d54(f32 *realrot, f32 *matrix);
void func00015da0(f32 *arg0, f32 *arg1);
void func00015dd4(struct coord *pos, f32 *matrix);
void func00015d54(f32 *realrot, Mtxf *matrix);
void func00015da0(Mtxf *arg0, f32 *arg1);
void func00015dd4(struct coord *pos, Mtxf *matrix);
u32 func00015df0(void);
void func00015e24(f32 mult, f32 *matrix);
u32 func00015e4c(void);
void func00015e80(f32 mult, f32 *matrix);
u32 func00015ea8(void);
void func00015edc(f32 mult, f32 *matrix);
void func00015f04(f32 arg0, f32 *arg1);
void func00015f04(f32 scale, Mtxf *arg1);
u32 func00015f4c(void);
u32 func00015f88(void);
u32 func00015fd0(void);
void func00016054(f32 *matrix, u32 arg1);
void func00016054(f32 *matrix, f32 *arg1);
#endif
+7 -7
View File
@@ -9,9 +9,9 @@ u32 func00016140(void);
void func000161b0(f32 *matrix, f32 src[3], f32 dest[3]);
void func00016208(f32 *matrix, struct coord *coord);
void func00016248(struct coord *coord, f32 angle, f32 *matrix);
void func000162e8(f32 angle, f32 *matrix);
void func00016374(f32 angle, f32 *matrix);
void func00016400(f32 angle, f32 *matrix);
void func000162e8(f32 angle, Mtxf *matrix);
void func00016374(f32 angle, Mtxf *matrix);
void func00016400(f32 angle, Mtxf *matrix);
void func0001648c(struct coord *coord, f32 *dest);
u32 func000165d8(void);
u32 func000166a4(void);
@@ -21,11 +21,11 @@ void func00016748(f32 arg0);
u32 func00016760(void);
u32 func00016784(void);
u32 func00016798(void);
u32 func00016820(void);
u32 func00016874(void);
void func00016820(Mtx *arg0, Mtx *arg1);
void func00016874(Mtxf *matrix, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz);
void func00016ae4(f32 *matrix, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9);
void func00016b58(f32 *matrix, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9);
void func00016d58(f32 *matrix, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz);
void func00016b58(Mtxf *matrix, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz);
void func00016d58(Mtxf *matrix, f32 posx, f32 posy, f32 posz, f32 lookx, f32 looky, f32 lookz, f32 upx, f32 upy, f32 upz);
u32 func00016dcc(void);
u32 func00016e98(void);
u32 func00017028(void);
+1 -1
View File
@@ -3,7 +3,7 @@
#include <ultra64.h>
#include "types.h"
u32 func0004a360(void);
void func0004a360(Mtxf *arg0, Mtx *arg1);
u32 func0004a460(void);
f32 sqrtf(f32 value);
+27 -18
View File
@@ -7,6 +7,15 @@
#define bool s32
#define ubool u32
// Float version of a graphics matrix, which has higher precision than an Mtx.
// Matrices are stored as Mtxfs then converted to an Mtx when passed to the GPU.
// Mtxs use a union and a long long int to force alignments. Mtxfs are not
// aligned but still use the union for consistency with Mtx.
typedef union {
f32 m[4][4];
s32 unused;
} Mtxf;
struct coord {
f32 x;
f32 y;
@@ -1246,7 +1255,7 @@ struct cameraobj { // objtype 0x06
// Note y is being used as an abbreviation for yaw
/*0x5c*/ s16 lookatpadnum;
/*0x5e*/ s16 toleft;
/*0x60*/ f32 camrotm[16];
/*0x60*/ Mtxf camrotm;
/*0xa0*/ f32 yzero;
/*0xa4*/ f32 yrot;
/*0xa8*/ f32 yleft;
@@ -2192,11 +2201,11 @@ struct player {
/*0x0038*/ struct coord globaldrawworldoffset;
/*0x0044*/ struct coord globaldrawcameraoffset;
/*0x0050*/ struct coord globaldrawworldbgoffset;
/*0x005c*/ f32 *matrix5c;
/*0x0060*/ u32 unk0060;
/*0x0064*/ u32 unk0064;
/*0x0068*/ u32 unk0068;
/*0x006c*/ u32 unk006c;
/*0x005c*/ Mtx *matrix5c;
/*0x0060*/ Mtx *matrix60;
/*0x0064*/ Mtxf *matrix64;
/*0x0068*/ Mtxf *matrix68;
/*0x006c*/ Mtxf *matrix6c;
/*0x0070*/ f32 sumground;
/*0x0074*/ f32 vv_manground; // Feet Y value in absolute coordinates
/*0x0078*/ f32 vv_ground; // Ground Y value in absolute coordinates
@@ -2597,19 +2606,19 @@ struct player {
/*0x172c*/ f32 c_scaley;
/*0x1730*/ f32 c_recipscalex;
/*0x1734*/ f32 c_recipscaley;
/*0x1738*/ u32 unk1738;
/*0x173c*/ u32 unk173c;
/*0x1740*/ f32 *matrix;
/*0x1738*/ void *unk1738;
/*0x173c*/ Mtx *unk173c;
/*0x1740*/ Mtxf *matrix1740;
/*0x1744*/ u32 unk1744;
/*0x1748*/ u32 unk1748;
/*0x174c*/ u32 unk174c;
/*0x174c*/ Mtxf *unk174c;
/*0x1750*/ void *unk1750;
/*0x1754*/ u32 unk1754;
/*0x1758*/ u32 unk1758;
/*0x175c*/ u32 unk175c;
/*0x1760*/ f32 *prevmatrix;
/*0x1754*/ Mtxf *unk1754;
/*0x1758*/ Mtx *unk1758;
/*0x175c*/ void *unk175c;
/*0x1760*/ Mtxf *prev1740;
/*0x1764*/ u32 unk1764;
/*0x1768*/ u32 unk1768;
/*0x1768*/ Mtxf *unk1768;
/*0x176c*/ f32 c_scalelod60;
/*0x1770*/ f32 c_scalelod;
/*0x1774*/ f32 c_lodscalez;
@@ -2721,7 +2730,7 @@ struct player {
/*0x1a88*/ u32 bondentertheta;
/*0x1a8c*/ u32 bondenterverta;
/*0x1a90*/ struct coord bondenterpos;
/*0x1a9c*/ f32 bondentermtx[16];
/*0x1a9c*/ Mtxf bondentermtx;
/*0x1adc*/ struct coord bondenteraim;
/*0x1ae8*/ f32 bondonground;
/*0x1aec*/ u32 unk1aec;
@@ -2729,7 +2738,7 @@ struct player {
/*0x1af4*/ u32 unk1af4;
/*0x1af8*/ s32 walkinitmove;
/*0x1afc*/ struct coord walkinitpos;
/*0x1b08*/ f32 walkinitmtx[16];
/*0x1b08*/ Mtxf walkinitmtx;
/*0x1b48*/ f32 walkinitt;
/*0x1b4c*/ f32 walkinitt2;
/*0x1b50*/ struct coord walkinitstart;
@@ -5917,7 +5926,7 @@ struct animheader {
};
struct objticksp476 {
/*0x00*/ f32 *matrix;
/*0x00*/ Mtxf *matrix;
/*0x04*/ u32 unk04;
/*0x08*/ u32 unk08;
/*0x0c*/ u32 unk0c;