From f2e52c253e7295851cd2b35a2ca9bb4f3f9afca1 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 16 Mar 2020 20:23:23 +1000 Subject: [PATCH] Decompile currentPlayerGetUnk1758 --- src/game/game_0b3350.c | 11 ++++------- src/game/game_129900.c | 2 +- src/game/game_12d3f0.c | 2 +- src/game/game_150820.c | 4 ++-- src/game/game_157db0.c | 14 +++++++------- src/game/propobj.c | 4 ++-- src/include/game/game_0b3350.h | 2 +- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/game/game_0b3350.c b/src/game/game_0b3350.c index ce662f873..78a8102cd 100644 --- a/src/game/game_0b3350.c +++ b/src/game/game_0b3350.c @@ -1875,13 +1875,10 @@ void currentPlayerSetUnk1758(u32 value) g_Vars.currentplayer->unk1758 = value; } -GLOBAL_ASM( -glabel func0f0b5008 -/* f0b5008: 3c0e800a */ lui $t6,%hi(g_Vars+0x284) -/* f0b500c: 8dcea244 */ lw $t6,%lo(g_Vars+0x284)($t6) -/* f0b5010: 03e00008 */ jr $ra -/* f0b5014: 8dc21758 */ lw $v0,0x1758($t6) -); +u32 currentPlayerGetUnk1758(void) +{ + return g_Vars.currentplayer->unk1758; +} GLOBAL_ASM( glabel func0f0b5018 diff --git a/src/game/game_129900.c b/src/game/game_129900.c index 8bd47670d..a29b911d0 100644 --- a/src/game/game_129900.c +++ b/src/game/game_129900.c @@ -3204,7 +3204,7 @@ glabel func0f12c654 /* f12c774: 35ef0040 */ ori $t7,$t7,0x40 /* f12c778: 02a08825 */ or $s1,$s5,$zero /* f12c77c: ae2f0000 */ sw $t7,0x0($s1) -/* f12c780: 0fc2d402 */ jal func0f0b5008 +/* f12c780: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f12c784: 26b50008 */ addiu $s5,$s5,0x8 /* f12c788: 0c012d20 */ jal osVirtualToPhysical /* f12c78c: 00402025 */ or $a0,$v0,$zero diff --git a/src/game/game_12d3f0.c b/src/game/game_12d3f0.c index 9a7f640a7..f522c16d5 100644 --- a/src/game/game_12d3f0.c +++ b/src/game/game_12d3f0.c @@ -2266,7 +2266,7 @@ glabel func0f12f230 /* f12f408: 02201825 */ or $v1,$s1,$zero /* f12f40c: ac6f0000 */ sw $t7,0x0($v1) /* f12f410: afa3005c */ sw $v1,0x5c($sp) -/* f12f414: 0fc2d402 */ jal func0f0b5008 +/* f12f414: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f12f418: 26310008 */ addiu $s1,$s1,0x8 /* f12f41c: 0c012d20 */ jal osVirtualToPhysical /* f12f420: 00402025 */ or $a0,$v0,$zero diff --git a/src/game/game_150820.c b/src/game/game_150820.c index 93c6c513e..0edfddee4 100644 --- a/src/game/game_150820.c +++ b/src/game/game_150820.c @@ -1128,7 +1128,7 @@ glabel func0f151780 /* f151884: 02608025 */ or $s0,$s3,$zero /* f151888: 26f79fc0 */ addiu $s7,$s7,%lo(g_Vars) /* f15188c: ae190000 */ sw $t9,0x0($s0) -/* f151890: 0fc2d402 */ jal func0f0b5008 +/* f151890: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f151894: 26730008 */ addiu $s3,$s3,0x8 /* f151898: 0c012d20 */ jal osVirtualToPhysical /* f15189c: 00402025 */ or $a0,$v0,$zero @@ -1667,7 +1667,7 @@ glabel func0f151ed0 /* f152074: 35290040 */ ori $t1,$t1,0x40 /* f152078: 26080008 */ addiu $t0,$s0,0x8 /* f15207c: afa80140 */ sw $t0,0x140($sp) -/* f152080: 0fc2d402 */ jal func0f0b5008 +/* f152080: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f152084: ae090000 */ sw $t1,0x0($s0) /* f152088: 0c012d20 */ jal osVirtualToPhysical /* f15208c: 00402025 */ or $a0,$v0,$zero diff --git a/src/game/game_157db0.c b/src/game/game_157db0.c index 775d13735..c386a0fe6 100644 --- a/src/game/game_157db0.c +++ b/src/game/game_157db0.c @@ -2741,7 +2741,7 @@ glabel func0f15a2c4 /* f15a458: 36940040 */ ori $s4,$s4,0x40 /* f15a45c: 260f0008 */ addiu $t7,$s0,0x8 /* f15a460: afaf0238 */ sw $t7,0x238($sp) -/* f15a464: 0fc2d402 */ jal func0f0b5008 +/* f15a464: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f15a468: ae140000 */ sw $s4,0x0($s0) /* f15a46c: 0c012d20 */ jal osVirtualToPhysical /* f15a470: 00402025 */ or $a0,$v0,$zero @@ -2809,7 +2809,7 @@ glabel func0f15a2c4 /* f15a554: 244e0008 */ addiu $t6,$v0,0x8 /* f15a558: afae0238 */ sw $t6,0x238($sp) /* f15a55c: ac540000 */ sw $s4,0x0($v0) -/* f15a560: 0fc2d402 */ jal func0f0b5008 +/* f15a560: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f15a564: 00408025 */ or $s0,$v0,$zero /* f15a568: 0c012d20 */ jal osVirtualToPhysical /* f15a56c: 00402025 */ or $a0,$v0,$zero @@ -2833,7 +2833,7 @@ glabel func0f15a2c4 /* f15a5ac: 166f0038 */ bne $s3,$t7,.L0f15a690 /* f15a5b0: 26390008 */ addiu $t9,$s1,0x8 /* f15a5b4: afb90238 */ sw $t9,0x238($sp) -/* f15a5b8: 0fc2d402 */ jal func0f0b5008 +/* f15a5b8: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f15a5bc: ae340000 */ sw $s4,0x0($s1) /* f15a5c0: 0c012d20 */ jal osVirtualToPhysical /* f15a5c4: 00402025 */ or $a0,$v0,$zero @@ -3196,7 +3196,7 @@ glabel func0f15a6f4 /* f15aac8: 35ef0040 */ ori $t7,$t7,0x40 /* f15aacc: ac4f0000 */ sw $t7,0x0($v0) /* f15aad0: 00408025 */ or $s0,$v0,$zero -/* f15aad4: 0fc2d402 */ jal func0f0b5008 +/* f15aad4: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f15aad8: 24510008 */ addiu $s1,$v0,0x8 /* f15aadc: 0c012d20 */ jal osVirtualToPhysical /* f15aae0: 00402025 */ or $a0,$v0,$zero @@ -3356,7 +3356,7 @@ glabel func0f15a6f4 /* f15ad0c: 02201025 */ or $v0,$s1,$zero /* f15ad10: ac4c0000 */ sw $t4,0x0($v0) /* f15ad14: afa20080 */ sw $v0,0x80($sp) -/* f15ad18: 0fc2d402 */ jal func0f0b5008 +/* f15ad18: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f15ad1c: 26310008 */ addiu $s1,$s1,0x8 /* f15ad20: 0c012d20 */ jal osVirtualToPhysical /* f15ad24: 00402025 */ or $a0,$v0,$zero @@ -3454,7 +3454,7 @@ glabel func0f15a6f4 /* f15ae80: 35ef0040 */ ori $t7,$t7,0x40 /* f15ae84: ac4f0000 */ sw $t7,0x0($v0) /* f15ae88: 00408025 */ or $s0,$v0,$zero -/* f15ae8c: 0fc2d402 */ jal func0f0b5008 +/* f15ae8c: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f15ae90: 24510008 */ addiu $s1,$v0,0x8 /* f15ae94: 0c012d20 */ jal osVirtualToPhysical /* f15ae98: 00402025 */ or $a0,$v0,$zero @@ -3507,7 +3507,7 @@ glabel func0f15a6f4 /* f15af48: 02201025 */ or $v0,$s1,$zero /* f15af4c: ac580000 */ sw $t8,0x0($v0) /* f15af50: afa20074 */ sw $v0,0x74($sp) -/* f15af54: 0fc2d402 */ jal func0f0b5008 +/* f15af54: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f15af58: 26310008 */ addiu $s1,$s1,0x8 /* f15af5c: 0c012d20 */ jal osVirtualToPhysical /* f15af60: 00402025 */ or $a0,$v0,$zero diff --git a/src/game/propobj.c b/src/game/propobj.c index bff487e4d..8b70e5a34 100644 --- a/src/game/propobj.c +++ b/src/game/propobj.c @@ -30557,7 +30557,7 @@ glabel func0f0809c4 /* f080a08: 0009182b */ sltu $v1,$zero,$t1 /* f080a0c: 50600005 */ beqzl $v1,.L0f080a24 /* f080a10: 8fab0074 */ lw $t3,0x74($sp) -/* f080a14: 0fc2d402 */ jal func0f0b5008 +/* f080a14: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f080a18: 00000000 */ sll $zero,$zero,0x0 /* f080a1c: 0002182b */ sltu $v1,$zero,$v0 /* f080a20: 8fab0074 */ lw $t3,0x74($sp) @@ -30816,7 +30816,7 @@ glabel func0f0809c4 /* f080dcc: 02201825 */ or $v1,$s1,$zero /* f080dd0: ac6b0000 */ sw $t3,0x0($v1) /* f080dd4: afa30044 */ sw $v1,0x44($sp) -/* f080dd8: 0fc2d402 */ jal func0f0b5008 +/* f080dd8: 0fc2d402 */ jal currentPlayerGetUnk1758 /* f080ddc: 26310008 */ addiu $s1,$s1,0x8 /* f080de0: 8fa30044 */ lw $v1,0x44($sp) /* f080de4: ac620004 */ sw $v0,0x4($v1) diff --git a/src/include/game/game_0b3350.h b/src/include/game/game_0b3350.h index 16e4f9003..012bee701 100644 --- a/src/include/game/game_0b3350.h +++ b/src/include/game/game_0b3350.h @@ -30,7 +30,7 @@ u32 currentPlayerGetUnk006c(void); void currentPlayerSetUnk1750(u32 value); u32 currentPlayerGetUnk1750(void); void currentPlayerSetUnk1758(u32 value); -u32 func0f0b5008(void); +u32 currentPlayerGetUnk1758(void); u32 func0f0b5018(void); u32 func0f0b5050(void); u32 func0f0b53a4(void);