name world_goombario_can_pause

This commit is contained in:
Alex Bates 2020-12-23 11:37:03 +00:00
parent f4dd1420b6
commit 6cf7ed0327
5 changed files with 24 additions and 16 deletions

View File

@ -1,7 +1,5 @@
#include "common.h"
#include "world/partner/goombario.h"
// TODO: move to world/partner/goombario.c
#include "goombario.h"
s32 func_802BD100(s32 arg0) {
s32 i;
@ -27,7 +25,23 @@ INCLUDE_ASM(s32, "world/partner/goombario", func_802BD1D0);
INCLUDE_ASM(s32, "world/partner/goombario", func_802BD564);
INCLUDE_ASM(s32, "world/partner/goombario", func_802BD5A8);
// Compiler is generating more efficient code than the original asm, using xori and sltiu instead of beq
#ifdef NON_MATCHING
s32 world_goombario_can_pause(Npc* partner) {
if (D_8010EBB0[0]) {
return FALSE;
}
if ((partner->flags & 0x1800) != 0x1000) {
return FALSE;
}
return TRUE;
}
#else
INCLUDE_ASM(s32, "world/partner/goombario", world_goombario_can_pause, Npc* partner);
#endif
INCLUDE_ASM(s32, "world/partner/goombario", func_802BD5D8);

View File

@ -4,14 +4,8 @@
#include "common.h"
#include "script_api/map.h"
s32 func_802BD100(s32 arg0);
void world_goombario_init(Npc* npc);
s32 func_802BD188();
s32 func_802BD1D0();
s32 func_802BD564();
s32 func_802BD5A8();
s32 func_802BD5D8();
s32 func_802BDB30();
void world_goombario_init(Npc* partner);
s32 world_goombario_can_pause(Npc* partner);
ApiStatus func_802BDB84(ScriptInstance* script, s32 isInitialCall);
void world_goombario_pre_battle(s32 arg0);

View File

@ -42,8 +42,8 @@ WorldPartner gWorldPartners[] = {
.useAbility = 0x802BDDA8,
.putAway = 0x802BDE60,
.idle = NPC_ANIM(world_goombario, normal, idle),
.canUseAbility = func_802BD5A8,
.canPlayerPause = func_802BD5A8,
.canUseAbility = world_goombario_can_pause,
.canPlayerPause = world_goombario_can_pause,
.preBattle = world_goombario_pre_battle,
},
{

View File

@ -15,8 +15,8 @@ typedef struct WorldPartner {
/* 0x24 */ Bytecode* putAway;
/* 0x28 */ NpcAnimID idle;
/* 0x2C */ UNK_FUN_PTR(testFirstStrike);
/* 0x30 */ UNK_FUN_PTR(canUseAbility);
/* 0x34 */ UNK_FUN_PTR(canPlayerPause);
/* 0x30 */ s32 (*canUseAbility)(Npc* partner);
/* 0x34 */ s32 (*canPlayerPause)(Npc* partner);
/* 0x38 */ void (*preBattle)(Npc* partner);
/* 0x3C */ UNK_FUN_PTR(postBattle);
/* 0x40 */ Bytecode* whileRiding;