From 55a8109097d02da49cf0db0d7f3ef1282582287d Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 16 Mar 2020 17:23:22 +1000 Subject: [PATCH] Decompile currentPlayerSetScreenPosition --- src/game/game_0b3350.c | 15 +++++++-------- src/include/game/game_0b3350.h | 2 +- src/include/types.h | 4 ++-- src/lib/lib_09660.c | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/game/game_0b3350.c b/src/game/game_0b3350.c index 24daf18dd..70b251738 100644 --- a/src/game/game_0b3350.c +++ b/src/game/game_0b3350.c @@ -1605,14 +1605,13 @@ glabel func0f0b4958 /* f0b4980: e4461724 */ swc1 $f6,0x1724($v0) ); -GLOBAL_ASM( -glabel func0f0b4984 -/* f0b4984: 3c02800a */ lui $v0,%hi(g_Vars+0x284) -/* f0b4988: 8c42a244 */ lw $v0,%lo(g_Vars+0x284)($v0) -/* f0b498c: e44c170c */ swc1 $f12,0x170c($v0) -/* f0b4990: 03e00008 */ jr $ra -/* f0b4994: e44e1710 */ swc1 $f14,0x1710($v0) -); +void currentPlayerSetScreenPosition(f32 left, f32 top) +{ + struct player *player = g_Vars.currentplayer; + + player->c_screenleft = left; + player->c_screentop = top; +} void currentPlayerSetPerspective(f32 near, f32 fovy, f32 aspect) { diff --git a/src/include/game/game_0b3350.h b/src/include/game/game_0b3350.h index 6564537d2..944ab4a2b 100644 --- a/src/include/game/game_0b3350.h +++ b/src/include/game/game_0b3350.h @@ -12,7 +12,7 @@ u32 func0f0b35b8(void); u32 func0f0b3988(void); u32 func0f0b39c0(void); u32 func0f0b4958(void); -u32 func0f0b4984(void); +void currentPlayerSetScreenPosition(f32 left, f32 top); void currentPlayerSetPerspective(f32 near, f32 fovy, f32 aspect); f32 func0f0b49b8(f32 arg0); u32 func0f0b4a24(void); diff --git a/src/include/types.h b/src/include/types.h index 3cb581387..784f0e8c2 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2555,8 +2555,8 @@ struct player { /*0x1700*/ u32 unk1700; /*0x1704*/ u32 unk1704; /*0x1708*/ u32 unk1708; - /*0x170c*/ u32 unk170c; - /*0x1710*/ u32 unk1710; + /*0x170c*/ f32 c_screenleft; + /*0x1710*/ f32 c_screentop; /*0x1714*/ f32 c_perspnear; /*0x1718*/ f32 c_perspfovy; /*0x171c*/ f32 c_perspaspect; diff --git a/src/lib/lib_09660.c b/src/lib/lib_09660.c index 4adf2f199..39eabf088 100644 --- a/src/lib/lib_09660.c +++ b/src/lib/lib_09660.c @@ -2830,7 +2830,7 @@ glabel func0000bca8 /* bcdc: 448a2000 */ mtc1 $t2,$f4 /* bce0: 448b3000 */ mtc1 $t3,$f6 /* bce4: 46802320 */ cvt.s.w $f12,$f4 -/* bce8: 0fc2d261 */ jal func0f0b4984 +/* bce8: 0fc2d261 */ jal currentPlayerSetScreenPosition /* bcec: 468033a0 */ cvt.s.w $f14,$f6 /* bcf0: 8fbf0014 */ lw $ra,0x14($sp) /* bcf4: 27bd0018 */ addiu $sp,$sp,0x18