diff --git a/config/rel_slices.yml b/config/rel_slices.yml index ab32463a..6b2ebe89 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -50,9 +50,9 @@ m_malloc.c: m_mail_password_check.c: .text: [0x803BD250, 0x803BEC9C] .data: [0x806566C0, 0x806571D8] -#m_lib.c: #sqrtf statics -# .text: [0x803BAB0C, 0x803BB960] -# .rodata: [0x80642640, 0x80642680] +m_lib.c: + .text: [0x803BAB0C, 0x803BB960] + .rodata: [0x80642640, 0x80642680] m_mushroom.c: .text: [0x803C8090, 0x803C90A8] .rodata: [0x80642950, 0x80642960] diff --git a/include/libc/math.h b/include/libc/math.h index ef3eff40..a0427698 100644 --- a/include/libc/math.h +++ b/include/libc/math.h @@ -8,6 +8,7 @@ #define M_PI 3.14159265358979323846f s16 sins(u16); +s16 coss(u16); f32 fatan2(f32, f32); diff --git a/include/libultra/libultra.h b/include/libultra/libultra.h index 32c32e3a..5e5c8cc4 100644 --- a/include/libultra/libultra.h +++ b/include/libultra/libultra.h @@ -10,6 +10,7 @@ #include "libultra/os_timer.h" #include "libultra/os_thread.h" #include "libultra/initialize.h" +#include "libc/math.h" /* TODO: sins and coss belong in libultra */ #define N64_SCREEN_HEIGHT 240 #define N64_SCREEN_WIDTH 320 diff --git a/include/sys_math3d.h b/include/sys_math3d.h index 3038e3df..cee44a56 100644 --- a/include/sys_math3d.h +++ b/include/sys_math3d.h @@ -1,5 +1,5 @@ -#ifndef SYS_MATH_H -#define SYS_MATH_H +#ifndef SYS_MATH3D_H +#define SYS_MATH3D_H #include "types.h" #include "m_lib.h" @@ -8,6 +8,8 @@ extern "C" { #endif +extern f32 Math3DVecLength(xyz_t* vec); + extern xyz_t ZeroVec; #ifdef __cplusplus diff --git a/include/sys_matrix.h b/include/sys_matrix.h index bd0196fd..22dfc35b 100644 --- a/include/sys_matrix.h +++ b/include/sys_matrix.h @@ -21,8 +21,8 @@ extern void new_Matrix(GAME* game); extern void Matrix_softcv3_mult(xyz_t* src, s_xyz* dest); 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); #ifdef __cplusplus } diff --git a/rel/m_lib.c b/rel/m_lib.c index df15d90d..1aa98d43 100644 --- a/rel/m_lib.c +++ b/rel/m_lib.c @@ -47,7 +47,12 @@ #include "m_actor.h" #include "m_play.h" #include "main.h" +#include "libultra/libultra.h" #include "MSL_C/w_math.h" +#include "libc64/qrand.h" +#include "sys_matrix.h" +#include "sys_math.h" +#include "sys_math3d.h" /** * @brief Copy memory from the source buffer to the destination buffer.