From 28c83ca5dd69cf328b53cc91b3c0c0fa4b6267ec Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 30 Aug 2020 21:00:57 +1000 Subject: [PATCH] Decompile mpRemoveAllSimulants --- src/game/game_00c490.c | 2 +- src/game/game_0147d0.c | 24 ++++++++++-------------- src/include/game/game_0147d0.h | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/game/game_00c490.c b/src/game/game_00c490.c index 88bfef56a..4aa06c4a0 100644 --- a/src/game/game_00c490.c +++ b/src/game/game_00c490.c @@ -3863,7 +3863,7 @@ glabel var7f1a8224 /* f00f5ac: 0281c825 */ or $t9,$s4,$at /* f00f5b0: 0320a025 */ or $s4,$t9,$zero .L0f00f5b4: -/* f00f5b4: 0fc05208 */ jal func0f014820 +/* f00f5b4: 0fc05208 */ jal mpRemoveAllSimulants /* f00f5b8: 00000000 */ nop /* f00f5bc: 3c12800a */ lui $s2,%hi(g_StageSetup+0x10) /* f00f5c0: 8e52d040 */ lw $s2,%lo(g_StageSetup+0x10)($s2) diff --git a/src/game/game_0147d0.c b/src/game/game_0147d0.c index 4199d9822..ab8ee049a 100644 --- a/src/game/game_0147d0.c +++ b/src/game/game_0147d0.c @@ -50,20 +50,16 @@ glabel func0f0147f8 /* f01481c: 00000000 */ nop ); -GLOBAL_ASM( -glabel func0f014820 -/* f014820: 3c03800b */ lui $v1,%hi(g_MpSimulantChrs) -/* f014824: 3c02800b */ lui $v0,%hi(var800acca0) -/* f014828: 2442cca0 */ addiu $v0,$v0,%lo(var800acca0) -/* f01482c: 2463cc80 */ addiu $v1,$v1,%lo(g_MpSimulantChrs) -.L0f014830: -/* f014830: 24630004 */ addiu $v1,$v1,0x4 -/* f014834: 1462fffe */ bne $v1,$v0,.L0f014830 -/* f014838: ac60fffc */ sw $zero,-0x4($v1) -/* f01483c: 3c018008 */ lui $at,%hi(g_NumMpSimulantChrs) -/* f014840: 03e00008 */ jr $ra -/* f014844: a0207d10 */ sb $zero,%lo(g_NumMpSimulantChrs)($at) -); +void mpRemoveAllSimulants(void) +{ + s32 i; + + for (i = 0; i < 8; i++) { + g_MpSimulantChrs[i] = NULL; + } + + g_NumMpSimulantChrs = 0; +} GLOBAL_ASM( glabel func0f014848 diff --git a/src/include/game/game_0147d0.h b/src/include/game/game_0147d0.h index 66d7cdea7..8b624d419 100644 --- a/src/include/game/game_0147d0.h +++ b/src/include/game/game_0147d0.h @@ -5,7 +5,7 @@ void func0f0147d0(void); u32 func0f0147f8(void); -u32 func0f014820(void); +void mpRemoveAllSimulants(void); u32 func0f014848(void); u32 func0f014e90(void);