From b93ca7a9c33a4f758038f22b3a4ab72a4d5b005f Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 6 Oct 2019 23:57:44 +1000 Subject: [PATCH] Decompile aiReturn --- src/game/game.c | 27 ++++++++++++++++++++++++++- src/include/game.h | 2 +- src/setup.c | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/game/game.c b/src/game/game.c index 96e41b468..75dc299ab 100644 --- a/src/game/game.c +++ b/src/game/game.c @@ -88119,7 +88119,7 @@ bool aiSetPlayerDeadList(void) * @cmd 0008 */ GLOBAL_ASM( -glabel ai0008 +glabel aiReturn /* f04dff4: 3c05800a */ lui $a1,0x800a /* f04dff8: 24a59fc0 */ addiu $a1,$a1,-24640 /* f04dffc: 8ca20424 */ lw $v0,0x424($a1) @@ -88172,6 +88172,31 @@ glabel ai0008 /* f04e0a4: 00001025 */ or $v0,$zero,$zero ); +/** + * Commented because ld is refusing to link to the library binary, making the + * call to func000184d0 unresolvable. Matches otherwise. + * Assumes func000184d0 is defined as u8 *func000184d0(s16 ailistid); + */ +//bool aiReturn(void) +//{ +// u8 *ailist = NULL; +// +// if (g_Vars.chrdata) { +// ailist = func000184d0(g_Vars.chrdata->aireturnlist); +// } else if (g_Vars.objdata) { +// ailist = func000184d0(g_Vars.objdata->aireturnlist); +// } else if (g_Vars.aicdata) { +// ailist = func000184d0(g_Vars.aicdata->aireturnlist); +// } else if (g_Vars.aiddata) { +// ailist = func000184d0(g_Vars.aiddata->aireturnlist); +// } +// +// g_Vars.ailist = ailist; +// g_Vars.aioffset = 0; +// +// return false; +//} + /** * @cmd 0004 */ diff --git a/src/include/game.h b/src/include/game.h index 3eead041d..fe1cff7b4 100644 --- a/src/include/game.h +++ b/src/include/game.h @@ -11,7 +11,7 @@ /*0x0005*/ bool aiSetList(void); /*0x0006*/ bool aiSetReturnList(void); /*0x0007*/ bool ai0007(void); -/*0x0008*/ bool ai0008(void); +/*0x0008*/ bool aiReturn(void); /*0x0009*/ bool ai0009(void); /*0x000a*/ bool ai000a(void); /*0x000b*/ bool ai000b(void); diff --git a/src/setup.c b/src/setup.c index 7b7643818..65b962abf 100644 --- a/src/setup.c +++ b/src/setup.c @@ -13955,7 +13955,7 @@ bool (*command_pointers[])(void) = { /*0x0005*/ aiSetList, /*0x0006*/ aiSetReturnList, /*0x0007*/ ai0007, - /*0x0008*/ ai0008, + /*0x0008*/ aiReturn, /*0x0009*/ ai0009, /*0x000a*/ ai000a, /*0x000b*/ ai000b,