mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
link sys_matrix.c
This commit is contained in:
@@ -106,6 +106,11 @@ lb_reki.c:
|
||||
.text: [0x8040752C, 0x80407AE8]
|
||||
.rodata: [0x806437A0, 0x806437C0]
|
||||
.data: [0x8065ECD8, 0x8065F110]
|
||||
sys_matrix.c:
|
||||
.text: [0x8040C284, 0x8040EB38]
|
||||
.rodata: [0x80643828, 0x80643860]
|
||||
.data: [0x8065F970, 0x8065F9F0]
|
||||
.bss: [0x812F5668, 0x812F5670]
|
||||
zurumode.c:
|
||||
.text: [0x8040eb38, 0x8040f008]
|
||||
.bss: [0x812f9670, 0x812f9680]
|
||||
|
||||
@@ -581,6 +581,38 @@ do { \
|
||||
(u32)0 \
|
||||
}}
|
||||
|
||||
//Helpful macro for defining values of a Matrix
|
||||
|
||||
#define qs1616(e) ((s32)((e) * 0x00010000))
|
||||
|
||||
#define IPART(x) ((qs1616(x) >> 16) & 0xFFFF)
|
||||
#define FPART(x) (qs1616(x) & 0xFFFF)
|
||||
|
||||
#define gdSPDefMtx( \
|
||||
xx, yx, zx, wx, \
|
||||
xy, yy, zy, wy, \
|
||||
xz, yz, zz, wz, \
|
||||
xw, yw, zw, ww) \
|
||||
{{ \
|
||||
(IPART(xx) << 0x10) | IPART(xy), \
|
||||
(IPART(xz) << 0x10) | IPART(xw), \
|
||||
(IPART(yx) << 0x10) | IPART(yy), \
|
||||
(IPART(yz) << 0x10) | IPART(yw), \
|
||||
(IPART(zx) << 0x10) | IPART(zy), \
|
||||
(IPART(zz) << 0x10) | IPART(zw), \
|
||||
(IPART(wx) << 0x10) | IPART(wy), \
|
||||
(IPART(wz) << 0x10) | IPART(ww), \
|
||||
(FPART(xx) << 0x10) | FPART(xy), \
|
||||
(FPART(xz) << 0x10) | FPART(xw), \
|
||||
(FPART(yx) << 0x10) | FPART(yy), \
|
||||
(FPART(yz) << 0x10) | FPART(yw), \
|
||||
(FPART(zx) << 0x10) | FPART(zy), \
|
||||
(FPART(zz) << 0x10) | FPART(zw), \
|
||||
(FPART(wx) << 0x10) | FPART(wy), \
|
||||
(FPART(wz) << 0x10) | FPART(ww), \
|
||||
}}
|
||||
|
||||
|
||||
#define G_DL_GXDL 2
|
||||
|
||||
/* Macro for calling GC formatted display lists from N64 lists */
|
||||
|
||||
@@ -5,18 +5,14 @@
|
||||
|
||||
typedef float MtxF_t[4][4];
|
||||
|
||||
|
||||
|
||||
typedef union {
|
||||
MtxF_t mf;
|
||||
struct {
|
||||
|
||||
|
||||
float xx, yx, zx, wx,
|
||||
xy, yy, zy, wy,
|
||||
xz, yz, zz, wz,
|
||||
xw, yw, zw, ww;
|
||||
};
|
||||
MtxF_t mf;
|
||||
} MtxF;
|
||||
|
||||
typedef struct {
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@
|
||||
#include "m_play.h"
|
||||
#include "m_actor_type.h"
|
||||
#include "MSL_C/math.h"
|
||||
#include "PR/mbi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -90,7 +91,7 @@ extern void none_proc2(ACTOR* actor, GAME* game);
|
||||
extern int _Game_play_isPause(GAME_PLAY* play);
|
||||
extern f32 check_percent_abs(f32 x, f32 min, f32 max, f32 scale, int shift_by_min);
|
||||
extern f32 get_percent_forAccelBrake(const f32 now, const f32 start, const f32 end, const f32 accelerateDist, const f32 brakeDist);
|
||||
extern void Game_play_Projection_Trans(GAME_PLAY* const play, xyz_t* wpos, xyz_t* screen_pos);
|
||||
extern void Game_play_Projection_Trans(GAME_PLAY* const play, MtxF* matrix, xyz_t* screen_pos);
|
||||
|
||||
extern f32 get_percent(const int max, const int min, const int x);
|
||||
|
||||
|
||||
+25
-4
@@ -13,16 +13,37 @@ extern "C" {
|
||||
extern MtxF MtxF_clear;
|
||||
extern Mtx Mtx_clear;
|
||||
|
||||
extern void new_Matrix(GAME* game);
|
||||
extern void Matrix_push();
|
||||
extern void Matrix_pull();
|
||||
extern void Matrix_get(MtxF* m);
|
||||
extern void Matrix_put(MtxF* m);
|
||||
extern void new_Matrix(GAME* game);
|
||||
|
||||
extern MtxF* get_Matrix_now();
|
||||
extern void Matrix_mult(MtxF* m, u8 flag);
|
||||
extern void Matrix_translate(f32 x, f32 y, f32 z, u8 flag);
|
||||
extern void Matrix_scale(f32 x, f32 y, f32 z, u8 flag);
|
||||
extern void Matrix_RotateX(s16 x, int flag);
|
||||
extern void Matrix_RotateY(s16 x, int flag);
|
||||
extern void Matrix_RotateZ(s16 x, int flag);
|
||||
extern void Matrix_RotateXYZ(s16 x, s16 y, s16 z, int flag);
|
||||
extern void Matrix_softcv3_mult(xyz_t* src, s_xyz* dest);
|
||||
extern void Matrix_softcv3_load(s_xyz* src, f32 x, f32 y, f32 z);
|
||||
extern Mtx* _MtxF_to_Mtx(MtxF* src, Mtx* dest);
|
||||
extern void Matrix_mult(MtxF* m, s8 flag);
|
||||
extern void Matrix_Position(xyz_t* wpos, xyz_t* screen_pos);
|
||||
extern Mtx* _Matrix_to_Mtx(Mtx* dest);
|
||||
extern Mtx* _Matrix_to_Mtx_new(GRAPH* graph);
|
||||
extern void Matrix_Position(MtxF* matrix, xyz_t* screen_pos);
|
||||
extern void Matrix_Position_Zero(xyz_t* screen_pos);
|
||||
extern void Matrix_Position_VecX(xyz_t* screen_pos, f32 x);
|
||||
extern void Matrix_Position_VecZ(xyz_t* screen_pos, f32 x);
|
||||
extern void Matrix_copy_MtxF(MtxF* dest, MtxF* src);
|
||||
extern void Matrix_MtxToMtxF(Mtx* src, MtxF* dest);
|
||||
extern void Matrix_reverse(MtxF* m);
|
||||
extern void Matrix_to_rotate_new(MtxF* m, s_xyz* vec, int flag);
|
||||
extern void Matrix_to_rotate2_new(MtxF* m, s_xyz* vec, int flag);
|
||||
extern void Matrix_RotateVector(s16 angle, xyz_t* axis, u8 flag);
|
||||
extern void suMtxMakeTS(Mtx* m, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY, f32 translateZ);
|
||||
extern void suMtxMakeSRT(Mtx* m, f32 scaleX, f32 scaleY, f32 scaleZ, s16 rotX, s16 rotY, s16 rotZ, f32 translateX, f32 translateY, f32 translateZ);
|
||||
extern void suMtxMakeSRT_ZXY(Mtx* m, f32 scaleX, f32 scaleY, f32 scaleZ, s16 rotX, s16 rotY, s16 rotZ, f32 translateX, f32 translateY, f32 translateZ);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+5
-5
@@ -782,16 +782,16 @@ extern f32 get_percent_forAccelBrake(const f32 now, const f32 start, const f32 e
|
||||
* @param wpos Pointer to the 3D world position (xyz_t).
|
||||
* @param screen_pos Pointer to the resulting 2D screen position (xyz_t).
|
||||
*/
|
||||
extern void Game_play_Projection_Trans(GAME_PLAY* const play, xyz_t* wpos,
|
||||
extern void Game_play_Projection_Trans(GAME_PLAY* const play, MtxF* matrix,
|
||||
xyz_t* screen_pos) {
|
||||
f32 w;
|
||||
|
||||
Matrix_mult(&play->matrix, 0);
|
||||
Matrix_Position(wpos, screen_pos);
|
||||
Matrix_Position(matrix, screen_pos);
|
||||
w = play->matrix.ww +
|
||||
((play->matrix.wx * wpos->x) +
|
||||
(play->matrix.wy * wpos->y) +
|
||||
(play->matrix.wz * wpos->z));
|
||||
((play->matrix.wx * matrix->xx) +
|
||||
(play->matrix.wy * matrix->yx) +
|
||||
(play->matrix.wz * matrix->zx));
|
||||
screen_pos->x = (SCREEN_WIDTH_F / 2.0f) + ((screen_pos->x / w) * (SCREEN_WIDTH_F / 2.0f));
|
||||
screen_pos->y = (SCREEN_HEIGHT_F / 2.0f) - ((screen_pos->y / w) * (SCREEN_HEIGHT_F / 2.0f));
|
||||
}
|
||||
|
||||
+1068
File diff suppressed because it is too large
Load Diff
+1
-1
Submodule tools/ppcdis updated: eca3f3015a...29c3a24832
Reference in New Issue
Block a user