diff --git a/src/game/game_0b3350.c b/src/game/game_0b3350.c index 70b251738..0bb56fd9c 100644 --- a/src/game/game_0b3350.c +++ b/src/game/game_0b3350.c @@ -1590,20 +1590,15 @@ glabel func0f0b39c0 /* f0b4954: 00000000 */ sll $zero,$zero,0x0 ); -GLOBAL_ASM( -glabel func0f0b4958 -/* f0b4958: 3c013f00 */ lui $at,0x3f00 -/* f0b495c: 44810000 */ mtc1 $at,$f0 -/* f0b4960: 3c02800a */ lui $v0,%hi(g_Vars+0x284) -/* f0b4964: 8c42a244 */ lw $v0,%lo(g_Vars+0x284)($v0) -/* f0b4968: 46006102 */ mul.s $f4,$f12,$f0 -/* f0b496c: e44c1704 */ swc1 $f12,0x1704($v0) -/* f0b4970: 46007182 */ mul.s $f6,$f14,$f0 -/* f0b4974: e44e1708 */ swc1 $f14,0x1708($v0) -/* f0b4978: e4441720 */ swc1 $f4,0x1720($v0) -/* f0b497c: 03e00008 */ jr $ra -/* f0b4980: e4461724 */ swc1 $f6,0x1724($v0) -); +void currentPlayerSetScreenSize(f32 width, f32 height) +{ + struct player *player = g_Vars.currentplayer; + + player->c_screenwidth = width; + player->c_screenheight = height; + player->c_halfwidth = width * 0.5f; + player->c_halfheight = height * 0.5f; +} void currentPlayerSetScreenPosition(f32 left, f32 top) { @@ -1624,7 +1619,7 @@ void currentPlayerSetPerspective(f32 near, f32 fovy, f32 aspect) f32 func0f0b49b8(f32 arg0) { - f32 result = func0f096750(g_Vars.currentplayer->unk176c * arg0 * g_Vars.currentplayer->unk1724, 1.0f); + f32 result = func0f096750(g_Vars.currentplayer->unk176c * arg0 * g_Vars.currentplayer->c_halfheight, 1.0f); result *= 114.591552f; if (result < 0) { diff --git a/src/include/game/game_0b3350.h b/src/include/game/game_0b3350.h index 944ab4a2b..e74811005 100644 --- a/src/include/game/game_0b3350.h +++ b/src/include/game/game_0b3350.h @@ -11,7 +11,7 @@ u32 func0f0b3548(void); u32 func0f0b35b8(void); u32 func0f0b3988(void); u32 func0f0b39c0(void); -u32 func0f0b4958(void); +void currentPlayerSetScreenSize(f32 width, f32 height); void currentPlayerSetScreenPosition(f32 left, f32 top); void currentPlayerSetPerspective(f32 near, f32 fovy, f32 aspect); f32 func0f0b49b8(f32 arg0); diff --git a/src/include/types.h b/src/include/types.h index 784f0e8c2..41391b559 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2553,15 +2553,15 @@ struct player { /*0x16f0*/ u32 unk16f0; /*0x16f4*/ f32 gunzoomfovs[3]; /*0x1700*/ u32 unk1700; - /*0x1704*/ u32 unk1704; - /*0x1708*/ u32 unk1708; + /*0x1704*/ f32 c_screenwidth; + /*0x1708*/ f32 c_screenheight; /*0x170c*/ f32 c_screenleft; /*0x1710*/ f32 c_screentop; /*0x1714*/ f32 c_perspnear; /*0x1718*/ f32 c_perspfovy; /*0x171c*/ f32 c_perspaspect; - /*0x1720*/ u32 unk1720; - /*0x1724*/ f32 unk1724; + /*0x1720*/ f32 c_halfwidth; + /*0x1724*/ f32 c_halfheight; /*0x1728*/ u32 unk1728; /*0x172c*/ u32 unk172c; /*0x1730*/ u32 unk1730; diff --git a/src/lib/lib_09660.c b/src/lib/lib_09660.c index 39eabf088..3c59ca6e0 100644 --- a/src/lib/lib_09660.c +++ b/src/lib/lib_09660.c @@ -2786,7 +2786,7 @@ glabel func0000bc28 /* bc5c: 448a2000 */ mtc1 $t2,$f4 /* bc60: 448b3000 */ mtc1 $t3,$f6 /* bc64: 46802320 */ cvt.s.w $f12,$f4 -/* bc68: 0fc2d256 */ jal func0f0b4958 +/* bc68: 0fc2d256 */ jal currentPlayerSetScreenSize /* bc6c: 468033a0 */ cvt.s.w $f14,$f6 /* bc70: 0fc2d289 */ jal func0f0b4a24 /* bc74: 00000000 */ sll $zero,$zero,0x0 @@ -2942,7 +2942,7 @@ glabel func0000bdd8 /* be2c: 448c4000 */ mtc1 $t4,$f8 /* be30: 448d5000 */ mtc1 $t5,$f10 /* be34: 46804320 */ cvt.s.w $f12,$f8 -/* be38: 0fc2d256 */ jal func0f0b4958 +/* be38: 0fc2d256 */ jal currentPlayerSetScreenSize /* be3c: 468053a0 */ cvt.s.w $f14,$f10 /* be40: 3c038006 */ lui $v1,%hi(var8005d594) /* be44: 2463d594 */ addiu $v1,$v1,%lo(var8005d594)