From 3c68b7ac1a5af88e9895760039103f9d03ee06db Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 30 Jul 2020 23:50:31 +1000 Subject: [PATCH] Decompile func0f197c00 --- src/game/game_197600.c | 47 +++++++++++------------------------------- src/include/types.h | 12 +++++++++-- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/src/game/game_197600.c b/src/game/game_197600.c index 15648958f..14a06a36c 100644 --- a/src/game/game_197600.c +++ b/src/game/game_197600.c @@ -409,41 +409,18 @@ void mpAibotApplyCommand(struct chrdata *chr, u32 command) } } -GLOBAL_ASM( -glabel func0f197c00 -/* f197c00: 27bdffe8 */ addiu $sp,$sp,-24 -/* f197c04: afbf0014 */ sw $ra,0x14($sp) -/* f197c08: 10800015 */ beqz $a0,.L0f197c60 -/* f197c0c: 00803025 */ or $a2,$a0,$zero -/* f197c10: 8c8202d4 */ lw $v0,0x2d4($a0) -/* f197c14: 50400013 */ beqzl $v0,.L0f197c64 -/* f197c18: 8fbf0014 */ lw $ra,0x14($sp) -/* f197c1c: 804e0018 */ lb $t6,0x18($v0) -/* f197c20: 00001825 */ or $v1,$zero,$zero -/* f197c24: 00002025 */ or $a0,$zero,$zero -/* f197c28: 19c0000b */ blez $t6,.L0f197c58 -/* f197c2c: 2405ffff */ addiu $a1,$zero,-1 -/* f197c30: 8c4f0014 */ lw $t7,0x14($v0) -.L0f197c34: -/* f197c34: 24630001 */ addiu $v1,$v1,0x1 -/* f197c38: 01e4c021 */ addu $t8,$t7,$a0 -/* f197c3c: af050000 */ sw $a1,0x0($t8) -/* f197c40: 8cc202d4 */ lw $v0,0x2d4($a2) -/* f197c44: 24840014 */ addiu $a0,$a0,0x14 -/* f197c48: 80590018 */ lb $t9,0x18($v0) -/* f197c4c: 0079082a */ slt $at,$v1,$t9 -/* f197c50: 5420fff8 */ bnezl $at,.L0f197c34 -/* f197c54: 8c4f0014 */ lw $t7,0x14($v0) -.L0f197c58: -/* f197c58: 0fc47bba */ jal dprint -/* f197c5c: 00000000 */ nop -.L0f197c60: -/* f197c60: 8fbf0014 */ lw $ra,0x14($sp) -.L0f197c64: -/* f197c64: 27bd0018 */ addiu $sp,$sp,0x18 -/* f197c68: 03e00008 */ jr $ra -/* f197c6c: 00000000 */ nop -); +void func0f197c00(struct chrdata *chr) +{ + if (chr && chr->aibot) { + s32 i = 0; + + for (i = 0; i < chr->aibot->unk018; i++) { + chr->aibot->unk014[i].unk00 = -1; + } + + dprint(); + } +} GLOBAL_ASM( glabel func0f197c70 diff --git a/src/include/types.h b/src/include/types.h index 07df4ab1e..088b24227 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -337,6 +337,14 @@ struct waypoint { s32 padnum; }; +struct aibot014 { + s32 unk00; + u32 unk04; + u32 unk08; + u32 unk0c; + u32 unk10; +}; + struct aibot { /*0x000*/ u8 unk000; /*0x004*/ struct mpsim *simulant; @@ -344,8 +352,8 @@ struct aibot { /*0x008*/ s16 followingplayernum; /*0x00c*/ s16 dangerouspropnum; // index into g_DangerousProps /*0x010*/ struct prop *prop; - /*0x014*/ u32 unk014; - /*0x018*/ u32 unk018; + /*0x014*/ struct aibot014 *unk014; + /*0x018*/ s8 unk018; // count of unk014 /*0x01c*/ s32 *ammoheld; /*0x020*/ u32 weaponnum; /*0x024*/ s32 unk024[2]; // probably current clip count or reserve count