From bed58a6fac8d3bab0bc9437471e7fb5e1412d1b0 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 16 Mar 2020 17:20:27 +1000 Subject: [PATCH] Decompile currentPlayerSetPerspective --- src/game/game_0b3350.c | 19 ++++++++----------- src/include/game/game_0b3350.h | 2 +- src/include/types.h | 6 +++--- src/lib/lib_09660.c | 8 ++++---- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/game/game_0b3350.c b/src/game/game_0b3350.c index 0f9b5a38d..24daf18dd 100644 --- a/src/game/game_0b3350.c +++ b/src/game/game_0b3350.c @@ -1614,17 +1614,14 @@ glabel func0f0b4984 /* f0b4994: e44e1710 */ swc1 $f14,0x1710($v0) ); -GLOBAL_ASM( -glabel func0f0b4998 -/* f0b4998: 3c02800a */ lui $v0,%hi(g_Vars+0x284) -/* f0b499c: 8c42a244 */ lw $v0,%lo(g_Vars+0x284)($v0) -/* f0b49a0: afa60008 */ sw $a2,0x8($sp) -/* f0b49a4: e44c1714 */ swc1 $f12,0x1714($v0) -/* f0b49a8: e44e1718 */ swc1 $f14,0x1718($v0) -/* f0b49ac: c7a40008 */ lwc1 $f4,0x8($sp) -/* f0b49b0: 03e00008 */ jr $ra -/* f0b49b4: e444171c */ swc1 $f4,0x171c($v0) -); +void currentPlayerSetPerspective(f32 near, f32 fovy, f32 aspect) +{ + struct player *player = g_Vars.currentplayer; + + player->c_perspnear = near; + player->c_perspfovy = fovy; + player->c_perspaspect = aspect; +} f32 func0f0b49b8(f32 arg0) { diff --git a/src/include/game/game_0b3350.h b/src/include/game/game_0b3350.h index c2394745d..6564537d2 100644 --- a/src/include/game/game_0b3350.h +++ b/src/include/game/game_0b3350.h @@ -13,7 +13,7 @@ u32 func0f0b3988(void); u32 func0f0b39c0(void); u32 func0f0b4958(void); u32 func0f0b4984(void); -u32 func0f0b4998(void); +void currentPlayerSetPerspective(f32 near, f32 fovy, f32 aspect); f32 func0f0b49b8(f32 arg0); u32 func0f0b4a24(void); u32 func0f0b4c3c(void); diff --git a/src/include/types.h b/src/include/types.h index 809c6b9c5..3cb581387 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -2557,9 +2557,9 @@ struct player { /*0x1708*/ u32 unk1708; /*0x170c*/ u32 unk170c; /*0x1710*/ u32 unk1710; - /*0x1714*/ u32 unk1714; - /*0x1718*/ u32 unk1718; - /*0x171c*/ u32 unk171c; + /*0x1714*/ f32 c_perspnear; + /*0x1718*/ f32 c_perspfovy; + /*0x171c*/ f32 c_perspaspect; /*0x1720*/ u32 unk1720; /*0x1724*/ f32 unk1724; /*0x1728*/ u32 unk1728; diff --git a/src/lib/lib_09660.c b/src/lib/lib_09660.c index 2cfbcf7ea..4adf2f199 100644 --- a/src/lib/lib_09660.c +++ b/src/lib/lib_09660.c @@ -2875,7 +2875,7 @@ glabel func0000bd30 /* bd50: 8c620000 */ lw $v0,0x0($v1) /* bd54: c44c0010 */ lwc1 $f12,0x10($v0) /* bd58: c44e0008 */ lwc1 $f14,0x8($v0) -/* bd5c: 0fc2d266 */ jal func0f0b4998 +/* bd5c: 0fc2d266 */ jal currentPlayerSetPerspective /* bd60: 8c46000c */ lw $a2,0xc($v0) /* bd64: 0fc2d289 */ jal func0f0b4a24 /* bd68: 00000000 */ sll $zero,$zero,0x0 @@ -2898,7 +2898,7 @@ glabel func0000bd7c /* bd9c: 8c620000 */ lw $v0,0x0($v1) /* bda0: c44c0010 */ lwc1 $f12,0x10($v0) /* bda4: c44e0008 */ lwc1 $f14,0x8($v0) -/* bda8: 0fc2d266 */ jal func0f0b4998 +/* bda8: 0fc2d266 */ jal currentPlayerSetPerspective /* bdac: 8c46000c */ lw $a2,0xc($v0) /* bdb0: 0fc2d289 */ jal func0f0b4a24 /* bdb4: 00000000 */ sll $zero,$zero,0x0 @@ -2949,7 +2949,7 @@ glabel func0000bdd8 /* be48: 8c620000 */ lw $v0,0x0($v1) /* be4c: c44c0010 */ lwc1 $f12,0x10($v0) /* be50: c44e0008 */ lwc1 $f14,0x8($v0) -/* be54: 0fc2d266 */ jal func0f0b4998 +/* be54: 0fc2d266 */ jal currentPlayerSetPerspective /* be58: 8c46000c */ lw $a2,0xc($v0) /* be5c: 0fc2d289 */ jal func0f0b4a24 /* be60: 00000000 */ sll $zero,$zero,0x0 @@ -2984,7 +2984,7 @@ glabel func0000be84 /* beb4: 8c620000 */ lw $v0,0x0($v1) /* beb8: c44c0010 */ lwc1 $f12,0x10($v0) /* bebc: c44e0008 */ lwc1 $f14,0x8($v0) -/* bec0: 0fc2d266 */ jal func0f0b4998 +/* bec0: 0fc2d266 */ jal currentPlayerSetPerspective /* bec4: 8c46000c */ lw $a2,0xc($v0) /* bec8: 0fc2d289 */ jal func0f0b4a24 /* becc: 00000000 */ sll $zero,$zero,0x0