From 50bb98d4ed5a7925a3f8d00792463f0e3835bcef Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 12 Jan 2020 08:14:54 +1000 Subject: [PATCH] Decompile mpGetBotCommandName --- src/game/game_0f09f0.c | 2 +- src/game/game_187770.c | 33 ++++++++------------------------ src/include/game/game_187770.h | 2 +- src/include/setup/setup_020df0.h | 1 + src/setup/setup_020df0.c | 2 +- 5 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/game/game_0f09f0.c b/src/game/game_0f09f0.c index e0cb84225..33bd6f9a7 100644 --- a/src/game/game_0f09f0.c +++ b/src/game/game_0f09f0.c @@ -16137,7 +16137,7 @@ glabel func0f0fe280 /* f0fe81c: 8fbf0014 */ lw $ra,0x14($sp) .L0f0fe820: /* f0fe820: 00872021 */ addu $a0,$a0,$a3 -/* f0fe824: 0fc648fb */ jal func0f1923ec +/* f0fe824: 0fc648fb */ jal mpGetBotCommandName /* f0fe828: 9084cb78 */ lbu $a0,-0x3488($a0) /* f0fe82c: 8fa40038 */ lw $a0,0x38($sp) /* f0fe830: 0c004c4c */ jal strcpy diff --git a/src/game/game_187770.c b/src/game/game_187770.c index e58a41b25..dc5f2bea9 100644 --- a/src/game/game_187770.c +++ b/src/game/game_187770.c @@ -12627,31 +12627,14 @@ glabel func0f1921f8 /* f1923e8: 27bd0058 */ addiu $sp,$sp,0x58 ); -GLOBAL_ASM( -glabel func0f1923ec -/* f1923ec: 27bdffe8 */ addiu $sp,$sp,-24 -/* f1923f0: afbf0014 */ sw $ra,0x14($sp) -/* f1923f4: 04800004 */ bltz $a0,.L0f192408 -/* f1923f8: 00802825 */ or $a1,$a0,$zero -/* f1923fc: 2881000e */ slti $at,$a0,0xe -/* f192400: 14200005 */ bnez $at,.L0f192418 -/* f192404: 00057080 */ sll $t6,$a1,0x2 -.L0f192408: -/* f192408: 0fc5b9f1 */ jal textGet -/* f19240c: 240458b3 */ addiu $a0,$zero,0x58b3 -/* f192410: 10000006 */ beqz $zero,.L0f19242c -/* f192414: 8fbf0014 */ lw $ra,0x14($sp) -.L0f192418: -/* f192418: 3c048008 */ lui $a0,0x8008 -/* f19241c: 008e2021 */ addu $a0,$a0,$t6 -/* f192420: 0fc5b9f1 */ jal textGet -/* f192424: 8c847df4 */ lw $a0,0x7df4($a0) -/* f192428: 8fbf0014 */ lw $ra,0x14($sp) -.L0f19242c: -/* f19242c: 27bd0018 */ addiu $sp,$sp,0x18 -/* f192430: 03e00008 */ jr $ra -/* f192434: 00000000 */ sll $zero,$zero,0x0 -); +char *mpGetBotCommandName(s32 command) +{ + if (command < 0 || command > 13) { + return textGet(0x58b3); // "Normal" + } + + return textGet(g_MpBotCommands[command]); +} GLOBAL_ASM( glabel func0f192438 diff --git a/src/include/game/game_187770.h b/src/include/game/game_187770.h index ceb74a310..626bdb38c 100644 --- a/src/include/game/game_187770.h +++ b/src/include/game/game_187770.h @@ -138,7 +138,7 @@ u32 func0f191638(void); u32 func0f1918d0(void); u32 func0f191fa4(void); u32 func0f1921f8(void); -u32 func0f1923ec(void); +char *mpGetBotCommandName(s32 command); u32 func0f192438(void); u32 func0f192474(void); u32 func0f1924ac(void); diff --git a/src/include/setup/setup_020df0.h b/src/include/setup/setup_020df0.h index 7b3fa17d0..f3c361fb8 100644 --- a/src/include/setup/setup_020df0.h +++ b/src/include/setup/setup_020df0.h @@ -307,6 +307,7 @@ extern u32 mppresets[]; extern u32 g_TeamColours[]; extern u32 var80087d10; extern u32 var80087d14[]; +extern u32 g_MpBotCommands[]; extern u32 var80087e2c; extern u32 var80087e50; extern u32 var80087e98; diff --git a/src/setup/setup_020df0.c b/src/setup/setup_020df0.c index 395f655cd..3b8329e49 100644 --- a/src/setup/setup_020df0.c +++ b/src/setup/setup_020df0.c @@ -12275,7 +12275,7 @@ u32 var80087d14[] = { }; // 2de14 -u32 mpsimulantcommands[] = { +u32 g_MpBotCommands[] = { 0x58af, // "Follow" 0x58b0, // "Attack" 0x58b1, // "Defend"