From d47bea35b2fbf6a638c94789b5eb82c7e5e325ea Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 16 Mar 2020 20:30:32 +1000 Subject: [PATCH] Decompile currentPlayerSetUnk1740 --- src/game/game_0b3350.c | 27 ++++++++++----------------- src/game/game_0b63b0.c | 2 +- src/game/game_1371b0.c | 2 +- src/include/game/game_0b3350.h | 2 +- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/game/game_0b3350.c b/src/game/game_0b3350.c index 78a8102cd..05d7d0d82 100644 --- a/src/game/game_0b3350.c +++ b/src/game/game_0b3350.c @@ -1880,23 +1880,16 @@ u32 currentPlayerGetUnk1758(void) return g_Vars.currentplayer->unk1758; } -GLOBAL_ASM( -glabel func0f0b5018 -/* f0b5018: 3c02800a */ lui $v0,%hi(g_Vars+0x284) -/* f0b501c: 8c42a244 */ lw $v0,%lo(g_Vars+0x284)($v0) -/* f0b5020: 3c0f8008 */ lui $t7,%hi(var80084008) -/* f0b5024: 3c19800b */ lui $t9,%hi(var800aa59c) -/* f0b5028: 8c4e1740 */ lw $t6,0x1740($v0) -/* f0b502c: ac441740 */ sw $a0,0x1740($v0) -/* f0b5030: 8c580484 */ lw $t8,0x484($v0) -/* f0b5034: ac4e1760 */ sw $t6,0x1760($v0) -/* f0b5038: 8def4008 */ lw $t7,%lo(var80084008)($t7) -/* f0b503c: ac580488 */ sw $t8,0x488($v0) -/* f0b5040: ac4f1744 */ sw $t7,0x1744($v0) -/* f0b5044: 8f39a59c */ lw $t9,%lo(var800aa59c)($t9) -/* f0b5048: 03e00008 */ jr $ra -/* f0b504c: ac590484 */ sw $t9,0x484($v0) -); +void currentPlayerSetUnk1740(u32 value) +{ + struct player *player = g_Vars.currentplayer; + + player->unk1760 = player->unk1740; + player->unk1740 = value; + player->unk1744 = var80084008; + player->unk0488 = player->unk0484; + player->unk0484 = var800aa59c; +} GLOBAL_ASM( glabel func0f0b5050 diff --git a/src/game/game_0b63b0.c b/src/game/game_0b63b0.c index d1e4b9494..bc53b1423 100644 --- a/src/game/game_0b63b0.c +++ b/src/game/game_0b63b0.c @@ -10830,7 +10830,7 @@ glabel func0f0bfc7c /* f0bff7c: 0fc2d3de */ jal currentPlayerSetUnk1738 /* f0bff80: 8de40060 */ lw $a0,0x60($t7) /* f0bff84: 8e580284 */ lw $t8,0x284($s2) -/* f0bff88: 0fc2d406 */ jal func0f0b5018 +/* f0bff88: 0fc2d406 */ jal currentPlayerSetUnk1740 /* f0bff8c: 8f040064 */ lw $a0,0x64($t8) /* f0bff90: 8e590284 */ lw $t9,0x284($s2) /* f0bff94: 0fc2d5d6 */ jal func0f0b5758 diff --git a/src/game/game_1371b0.c b/src/game/game_1371b0.c index d631aff1d..acc0bc44f 100644 --- a/src/game/game_1371b0.c +++ b/src/game/game_1371b0.c @@ -4737,7 +4737,7 @@ glabel var7f1b5948 /* f13b2f8: 27a40068 */ addiu $a0,$sp,0x68 /* f13b2fc: 0c005815 */ jal func00016054 /* f13b300: 8fa50064 */ lw $a1,0x64($sp) -/* f13b304: 0fc2d406 */ jal func0f0b5018 +/* f13b304: 0fc2d406 */ jal currentPlayerSetUnk1740 /* f13b308: 27a40068 */ addiu $a0,$sp,0x68 /* f13b30c: 3c180102 */ lui $t8,0x102 /* f13b310: 37180040 */ ori $t8,$t8,0x40 diff --git a/src/include/game/game_0b3350.h b/src/include/game/game_0b3350.h index 012bee701..b64f727de 100644 --- a/src/include/game/game_0b3350.h +++ b/src/include/game/game_0b3350.h @@ -31,7 +31,7 @@ void currentPlayerSetUnk1750(u32 value); u32 currentPlayerGetUnk1750(void); void currentPlayerSetUnk1758(u32 value); u32 currentPlayerGetUnk1758(void); -u32 func0f0b5018(void); +void currentPlayerSetUnk1740(u32 value); u32 func0f0b5050(void); u32 func0f0b53a4(void); f32 *func0f0b56f8(void);