From 691d7bd353d952dae5d6a039f1e752cd7843f0c1 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Thu, 28 Nov 2019 18:41:34 +1000 Subject: [PATCH] Decompile aiPrint --- src/game/chr/chraicommands.c | 18 +++++++++++++++++- src/include/game/chr/chraicommands.h | 2 +- src/include/game/game_11ecf0.h | 2 +- src/setup/setup_000000.c | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index a4bcd9e4a..306c102b5 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -5336,7 +5336,7 @@ bool aiChrCopyPadPreset(void) * @cmd 00b5 */ GLOBAL_ASM( -glabel ai00b5 +glabel aiPrint /* f054ec4: 27bdffe8 */ addiu $sp,$sp,-24 /* f054ec8: afbf0014 */ sw $ra,0x14($sp) /* f054ecc: 0fc47bba */ jal dprint @@ -5359,6 +5359,22 @@ glabel ai00b5 /* f054f0c: 00001025 */ or $v0,$zero,$zero ); +// Mismatch because the if statement gets optimised out +//bool aiPrint(void) +//{ +// u32 len; +// +// if (dprint()) { +// // empty +// } +// +// len = chraiGetCommandLength(g_Vars.ailist, g_Vars.aioffset); +// +// g_Vars.aioffset += len; +// +// return false; +//} + /** * @cmd 0091 */ diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index 0255ad489..38b34e62b 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -183,7 +183,7 @@ /*0x00b2*/ bool aiSetPadPreset(void); /*0x00b3*/ bool aiChrSetPadPreset(void); /*0x00b4*/ bool aiChrCopyPadPreset(void); -/*0x00b5*/ bool ai00b5(void); +/*0x00b5*/ bool aiPrint(void); /*0x00b6*/ bool aiRestartTimer(void); /*0x00b7*/ bool aiResetTimer(void); /*0x00b8*/ bool aiPauseTimer(void); diff --git a/src/include/game/game_11ecf0.h b/src/include/game/game_11ecf0.h index 26bfb4e30..036b5300e 100644 --- a/src/include/game/game_11ecf0.h +++ b/src/include/game/game_11ecf0.h @@ -4,7 +4,7 @@ #include "types.h" u32 calculatePlayerIndex(u32 playernum); -u32 dprint(); +u32 dprint(char *); u32 func0f11ecf0(void); bool func0f11ed70(void); bool func0f11ed78(void); diff --git a/src/setup/setup_000000.c b/src/setup/setup_000000.c index d7105449a..39eb374b5 100644 --- a/src/setup/setup_000000.c +++ b/src/setup/setup_000000.c @@ -14313,7 +14313,7 @@ bool (*g_CommandPointers[])(void) = { /*0x00b2*/ aiSetPadPreset, /*0x00b3*/ aiChrSetPadPreset, /*0x00b4*/ aiChrCopyPadPreset, - /*0x00b5*/ ai00b5, + /*0x00b5*/ aiPrint, /*0x00b6*/ aiRestartTimer, /*0x00b7*/ aiResetTimer, /*0x00b8*/ aiPauseTimer,