diff --git a/config/rel_slices.yml b/config/rel_slices.yml index 7ddc0392..bbeecd51 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -20,4 +20,6 @@ m_room_type/mRmTp_FtrItemNo2FtrIdx.c: # zurumode/zurumode.c: # .text: [0x8040eb38, 0x8040f008] # .bss: [0x812f9670, 0x812f9680] - # .data: [0x8065F9F0, 0x8065FA20] \ No newline at end of file + # .data: [0x8065F9F0, 0x8065FA20] +sys_vimgr.c: + .text: [0x803703F8, 0x80370418] \ No newline at end of file diff --git a/include/dolphin/vi.h b/include/dolphin/vi.h new file mode 100644 index 00000000..f6837a20 --- /dev/null +++ b/include/dolphin/vi.h @@ -0,0 +1,8 @@ +#ifndef VI_H +#define VI_H + +#include "types.h" + +void VISetBlack(BOOL); + +#endif \ No newline at end of file diff --git a/include/m_lib.h b/include/m_lib.h index 4f83d177..c325d33e 100644 --- a/include/m_lib.h +++ b/include/m_lib.h @@ -61,6 +61,6 @@ void _Game_play_isPause(u32 //IDK); //Unsure //?? check_percent_abs(); //?? get_percent_forAccelBrake(); -//?? Game_play_Projection_Trans(); -//?? get_percent(); +void Game_play_Projection_Trans(game_play*, Vec3f*, Vec3f); +f32 get_percent(s32, s32, s32); #endif \ No newline at end of file diff --git a/include/sys_vimgr.h b/include/sys_vimgr.h new file mode 100644 index 00000000..6680ef69 --- /dev/null +++ b/include/sys_vimgr.h @@ -0,0 +1,9 @@ +#ifndef SYS_VIMGR_H +#define SYS_VIMGR_H + +#include "types.h" +#include "dolphin/vi.h" + +void viBlack(BOOL); + +#endif \ No newline at end of file diff --git a/rel/m_lib.c b/rel/m_lib.c index 05dbbfd2..3ef2056d 100644 --- a/rel/m_lib.c +++ b/rel/m_lib.c @@ -1,5 +1,7 @@ #include "m_lib.h" + + void mem_copy(u8* arg0, u8* arg1, u32 arg2) { while (arg2 != 0) { *arg0 = *arg1; @@ -331,3 +333,39 @@ u32 none_proc1(void){ void none_proc2(void){ //stub } + +// f32 check_percent_abs(s32 arg0, f32 arg8, f32 arg9, f32 argA, f32 argB) +// f32 get_percent_forAccelBrake(f32 arg8, f32 arg9, f32 argA, f32 argB, f32 argC) + + +void Game_play_Projection_Trans(game_play* play, Vec3f* src, Vec3f* dest) { + f32 w; + + Matrix_mult(&play->unk_200C, 0); + Matrix_Position(src, dest); + w = play->unk_200C.ww + ( + (play->unk_200C.wx * src->x) + + (play->unk_200C.wy * src->y) + + (play->unk_200C.wz * src->z)); + dest->x = 160.0f + ((dest->x / w) * 160.0f); + dest->y = 120.0f - ((dest->y / w) * 120.0f); +} + +f32 get_percent(s32 arg0, s32 arg1, s32 arg2) { + f32 temp_f0; + f32 var_f2; + + var_f2 = 1.0f; + if (arg2 < arg1) { + var_f2 = 0.0f; + } else if (arg2 < arg0) { + temp_f0 = (f32) (arg0 - arg1); + if (temp_f0 != 0.0f) { + var_f2 = (f32) (arg2 - arg1) / temp_f0; + if (var_f2 > 1.0f) { + var_f2 = 1.0f; + } + } + } + return var_f2; +} \ No newline at end of file diff --git a/rel/sys_vimgr.c b/rel/sys_vimgr.c new file mode 100644 index 00000000..3b923fc3 --- /dev/null +++ b/rel/sys_vimgr.c @@ -0,0 +1,5 @@ +#include "sys_vimgr.h" + +void viBlack(BOOL black){ + VISetBlack(black); +} \ No newline at end of file