From 4edda7f899b0cb468e092cfada30d6b31a3c56c2 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 5 Feb 2020 23:33:32 +1000 Subject: [PATCH] Decompile currentPlayerHasDataUplink --- src/game/game_111600.c | 29 ++++++++++------------------- src/game/game_176d70.c | 4 ++-- src/include/game/game_111600.h | 2 +- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/game/game_111600.c b/src/game/game_111600.c index 8d375f8c7..ba10e2e84 100644 --- a/src/game/game_111600.c +++ b/src/game/game_111600.c @@ -1240,26 +1240,17 @@ bool currentPlayerHasBriefcase(void) return false; } +bool currentPlayerHasDataUplink(void) +{ + if (g_Vars.currentplayer->isdead == false) { + return currentPlayerHasWeapon(WEAPON_DATAUPLINK); + } + + return false; +} + GLOBAL_ASM( -glabel func0f112884 -/* f112884: 3c0e800a */ lui $t6,0x800a -/* f112888: 8dcea244 */ lw $t6,-0x5dbc($t6) -/* f11288c: 27bdffe8 */ addiu $sp,$sp,-24 -/* f112890: afbf0014 */ sw $ra,0x14($sp) -/* f112894: 8dcf00d8 */ lw $t7,0xd8($t6) -/* f112898: 00001025 */ or $v0,$zero,$zero -/* f11289c: 15e00005 */ bnez $t7,.L0f1128b4 -/* f1128a0: 00000000 */ sll $zero,$zero,0x0 -/* f1128a4: 0fc4468a */ jal currentPlayerHasWeapon -/* f1128a8: 24040036 */ addiu $a0,$zero,0x36 -/* f1128ac: 10000002 */ beqz $zero,.L0f1128b8 -/* f1128b0: 8fbf0014 */ lw $ra,0x14($sp) -.L0f1128b4: -/* f1128b4: 8fbf0014 */ lw $ra,0x14($sp) -.L0f1128b8: -/* f1128b8: 27bd0018 */ addiu $sp,$sp,0x18 -/* f1128bc: 03e00008 */ jr $ra -/* f1128c0: 00000000 */ sll $zero,$zero,0x0 +glabel func0f1128c4 /* f1128c4: 03e00008 */ jr $ra /* f1128c8: 00001025 */ or $v0,$zero,$zero ); diff --git a/src/game/game_176d70.c b/src/game/game_176d70.c index b6d3cf388..023e5ebd1 100644 --- a/src/game/game_176d70.c +++ b/src/game/game_176d70.c @@ -12319,7 +12319,7 @@ void scenarioHtmCallback10(void) for (i = 0; i < PLAYERCOUNT(); i++) { setCurrentPlayerNum(i); - if (func0f112884()) { + if (currentPlayerHasDataUplink()) { g_ScenarioData.htm.uplink = g_Vars.currentplayer->prop; break; } @@ -12364,7 +12364,7 @@ glabel scenarioHtmCallback14 /* f1833c0: 1000000d */ beqz $zero,.L0f1833f8 /* f1833c4: 00409025 */ or $s2,$v0,$zero .L0f1833c8: -/* f1833c8: 0fc44a21 */ jal func0f112884 +/* f1833c8: 0fc44a21 */ jal currentPlayerHasDataUplink /* f1833cc: 00000000 */ sll $zero,$zero,0x0 /* f1833d0: 0002202b */ sltu $a0,$zero,$v0 /* f1833d4: 10800005 */ beqz $a0,.L0f1833ec diff --git a/src/include/game/game_111600.h b/src/include/game/game_111600.h index 269a55f5d..da96d466d 100644 --- a/src/include/game/game_111600.h +++ b/src/include/game/game_111600.h @@ -29,7 +29,7 @@ u32 func0f1122ec(void); u32 func0f11253c(void); u32 func0f112790(void); bool currentPlayerHasBriefcase(void); -bool func0f112884(void); +bool currentPlayerHasDataUplink(void); u32 currentPlayerHasProp(struct prop *prop); u32 func0f112950(void); u32 func0f112a58(void);