mirror of https://github.com/zeldaret/mm.git
En_Bji_01 (Shikashi) OK and partially documented. (#217)
* EnBji01_Init OK and Partially Documented. * EnBji01_Destroy OK and Fully Documented. * func_809CCE98 OK and partially documented. * Removed goto in func_809CCE98(). * func_809CD6C0 matching and partly documented. * Pasted raw mips_to_c into EnBji01_Update(). * EnBji01_Update() matching and partially documented. * EnBji01_Update() matching and partially documented. * func_809CDA4C() matching and partially documented. * func_809CDA4C actually matching this time, and partially documented. * func_809CDB04() matching and partially documented. * func_809CD028() matching and mostly documented. * func_809CD6B0() matching. * func_809CD328() matching and partially documented. * func_809CCDE0() matching and partially documented, func_8013E950() prototyped. * func_809CD634() and func_809CD70C() matching and partially documented. func_801A5BD0() prototyped. * func_809CD77C() matching and mostly documented. All functions now matching. * Imported data from ovl_En_Bji_01_data.asm to z_en_bji_01.c. Updated object_script.txt and code_script.txt. Ran format.sh. Builds OK. * Documented all of the unks in Shikashi's struct. Build still OK. * Fixed new warning in Bg_Haka_Tomb resulting from my new prototype of func_8013E3B8(). * Renamed remaining instances of unk160 to cutscenes. * Update src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h Remove unnecessary comment about compiler padding. Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> * Update src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c Correct stack declaration spacing. Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> * Update src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.h Remove unnecessary comment about compiler alignment padding. Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * Update src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c Remove unnecessary padding comment. Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> * Apply suggestions from code review Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * Batch commit for comments during code review. * Apply suggestions from code review (trailing Us) Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Deleted exteraneous space at the bottom of En_Bji_01 struct in the header file. * Used params enum for switch cases. * Update src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.h Co-authored-by: Parker Burnett <burnettparker@gmail.com> * Apply suggestions from code review replacing magic numbers with limb enums Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> * Renamed func_809CD328 to EnBji01_DialogueHandler per code review. Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: Parker Burnett <burnettparker@gmail.com>
This commit is contained in:
parent
9637e19303
commit
87137da829
|
@ -2736,16 +2736,16 @@ u8 func_8013DB90(GlobalContext* globalCtx, UNK_PTR arg1, f32 arg2);
|
|||
// void func_8013E054(void);
|
||||
// void func_8013E07C(void);
|
||||
// void func_8013E0A4(void);
|
||||
void func_8013E1C8(s32 iParm1, s32 iParm2, s32 iParm3, s32* piParm4);
|
||||
void func_8013E1C8(SkelAnime* skelAnime, struct_80B8E1A8 animations[], s32 animationIndex, s32* actorAnimationIndex);
|
||||
s32 func_8013E2D4(Actor* actor, s16 arg1, s32 arg2, s32 arg3);
|
||||
// void func_8013E3B8(void);
|
||||
s32 func_8013E3B8(Actor* actor, s16 cutscenes[], s32 cutsceneArrayLen);
|
||||
// void func_8013E4B0(void);
|
||||
// void func_8013E5CC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
||||
// void func_8013E640(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
// void func_8013E748(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
// void func_8013E7C0(void);
|
||||
// void func_8013E8F8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7);
|
||||
// void func_8013E950(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE2 param_10, UNK_TYPE2 param_11, UNK_TYPE2 param_12, UNK_TYPE2 param_13);
|
||||
s32 func_8013E950(Vec3f* param_1, Vec3f* param_2, s16 param_3, Vec3f* param_4, Vec3f* param_5, s16* param_6, s16* param_7, s16* param_8, s16* param_9, u16 param_10, u16 param_11, u16 param_12, u16 param_13);
|
||||
// void func_8013EC10(void);
|
||||
// void func_8013EC44(void);
|
||||
void func_8013ECE0(f32 param_1, u8 param_2, u8 param_3, u8 param_4);
|
||||
|
@ -4002,7 +4002,7 @@ void func_801A4D00(void);
|
|||
// void func_801A5808(void);
|
||||
// void func_801A5A10(void);
|
||||
// void func_801A5A1C(void);
|
||||
// void func_801A5BD0(void);
|
||||
void func_801A5BD0(s32 param_1);
|
||||
// void func_801A5C28(void);
|
||||
// void func_801A5C8C(void);
|
||||
// void func_801A5CFC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
||||
|
|
|
@ -3968,9 +3968,9 @@ SECTIONS
|
|||
ovl_En_Bji_01 : AT(RomLocation)
|
||||
{
|
||||
build/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.o(.text)
|
||||
build/asm/overlays/ovl_En_Bji_01_data.o(.data)
|
||||
build/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.o(.data)
|
||||
build/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.o(.rodata)
|
||||
build/asm/overlays/ovl_En_Bji_01_rodata.o(.rodata)
|
||||
build/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01_overlay.o(.ovl)
|
||||
}
|
||||
SegmentEnd = .;
|
||||
SegmentSize = SegmentEnd - SegmentStart;
|
||||
|
|
|
@ -241,6 +241,16 @@ D_060011C0 = 0x060011C0;
|
|||
D_060008B4 = 0x060008B4;
|
||||
D_06008198 = 0x06008198;
|
||||
|
||||
/* z_en_bji_01 */
|
||||
D_06000FDC = 0x06000FDC;
|
||||
D_06005B58 = 0x06005B58;
|
||||
D_06000AB0 = 0x06000AB0;
|
||||
D_0600066C = 0x0600066C;
|
||||
D_060049F0 = 0x060049F0;
|
||||
D_06004E70 = 0x06004E70;
|
||||
D_06005270 = 0x06005270;
|
||||
D_0600578C = 0x0600578C;
|
||||
|
||||
/* z_en_cha */
|
||||
D_06000710 = 0x06000710;
|
||||
D_06000958 = 0x06000958;
|
||||
|
|
|
@ -43,7 +43,7 @@ void BgHakaTomb_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
BcCheck3_BgActorInit(&this->dyna, 1);
|
||||
BgCheck3_LoadMesh(globalCtx, &this->dyna, D_06000EE8);
|
||||
func_8013E3B8(&this->dyna.actor, &this->unk160, 1);
|
||||
func_8013E3B8(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
|
||||
func_80BD6624(this);
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ void func_80BD66AC(BgHakaTomb* this, GlobalContext* globalCtx) {
|
|||
if (Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) {
|
||||
this->dyna.actor.flags |= 9;
|
||||
}
|
||||
if (!func_80BD6638(&temp, this->unk160, 1) && (temp < 0) &&
|
||||
if (!func_80BD6638(&temp, this->cutscenes, 1) && (temp < 0) &&
|
||||
Actor_GetRoomCleared(globalCtx, this->dyna.actor.room)) {
|
||||
this->dyna.actor.flags |= 1;
|
||||
if (this->dyna.actor.isTargeted) {
|
||||
|
@ -97,7 +97,7 @@ void func_80BD6754(BgHakaTomb* this) {
|
|||
}
|
||||
|
||||
void func_80BD6768(BgHakaTomb* this, GlobalContext* globalCtx) {
|
||||
if (func_8013E2D4(&this->dyna.actor, this->unk160[0], -1, 0)) {
|
||||
if (func_8013E2D4(&this->dyna.actor, this->cutscenes[0], -1, 0)) {
|
||||
BgHakaTomb_SetupDoNothing(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ typedef void (*BgHakaTombActionFunc)(struct BgHakaTomb*, GlobalContext*);
|
|||
typedef struct BgHakaTomb {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ BgHakaTombActionFunc actionFunc;
|
||||
/* 0x160 */ s16 unk160[2];
|
||||
/* 0x160 */ s16 cutscenes[1];
|
||||
} BgHakaTomb; // size = 0x164
|
||||
|
||||
extern const ActorInit Bg_Haka_Tomb_InitVars;
|
||||
|
|
|
@ -9,7 +9,30 @@ void EnBji01_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|||
void EnBji01_Update(Actor* thisx, GlobalContext* globalCtx);
|
||||
void EnBji01_Draw(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
||||
/*
|
||||
void func_809CCE98(EnBji01* this, GlobalContext* globalCtx); /* Level 1 */
|
||||
void func_809CCEE8(EnBji01* this, GlobalContext* globalCtx); /* Level 2 */
|
||||
void func_809CD028(EnBji01* this, GlobalContext* globalCtx); /* Level 3 */
|
||||
void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx); /* Level 4 */
|
||||
void func_809CCDE0(EnBji01* this, GlobalContext* globalCtx); /* Level 5 */
|
||||
void func_809CD634(EnBji01* this, GlobalContext* globalCtx); /* Level 5 */
|
||||
void EnBji01_DoNothing(EnBji01* this, GlobalContext* globalCtx); /* Level 6 */
|
||||
void func_809CD6C0(EnBji01* this, GlobalContext* globalCtx); /* Level 3 */
|
||||
void func_809CD70C(EnBji01* this, GlobalContext* globalCtx); /* Level 4 */
|
||||
void func_809CD77C(EnBji01* this, GlobalContext* globalCtx); /* Level 5 */
|
||||
|
||||
s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* actor);
|
||||
void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor);
|
||||
|
||||
extern AnimationHeader D_06000FDC;
|
||||
extern AnimationHeader D_06005B58;
|
||||
extern AnimationHeader D_06000AB0;
|
||||
extern AnimationHeader D_0600066C;
|
||||
extern void* D_060049F0[];
|
||||
extern void* D_06004E70[];
|
||||
extern void* D_06005270[];
|
||||
extern FlexSkeletonHeader D_0600578C;
|
||||
|
||||
const ActorInit En_Bji_01_InitVars = {
|
||||
ACTOR_EN_BJI_01,
|
||||
ACTORCAT_NPC,
|
||||
|
@ -21,36 +44,405 @@ const ActorInit En_Bji_01_InitVars = {
|
|||
(ActorFunc)EnBji01_Update,
|
||||
(ActorFunc)EnBji01_Draw,
|
||||
};
|
||||
*/
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CCDE0.asm")
|
||||
static ColliderCylinderInit sCylinderInit = {
|
||||
{
|
||||
COLTYPE_HIT0,
|
||||
AT_NONE,
|
||||
AC_ON | AC_TYPE_PLAYER,
|
||||
OC1_ON | OC1_TYPE_ALL,
|
||||
OC2_TYPE_1,
|
||||
COLSHAPE_CYLINDER,
|
||||
},
|
||||
{
|
||||
ELEMTYPE_UNK1,
|
||||
{ 0x00000000, 0x00, 0x00 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_NONE | TOUCH_SFX_NORMAL,
|
||||
BUMP_ON,
|
||||
OCELEM_ON,
|
||||
},
|
||||
{ 18, 64, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CCE98.asm")
|
||||
/* Animations struct */
|
||||
static struct_80B8E1A8 D_809CDC7C[] = {
|
||||
{ &D_06000FDC, 1.0f, 0, 0.0f }, /* Looking through telescope */
|
||||
{ &D_06005B58, 1.0f, 0, 10.0f }, /* Breathing? Unused? */
|
||||
{ &D_06000AB0, 1.0f, 0, 0.0f }, /* Talking */
|
||||
{ &D_0600066C, 1.0f, 2, -5.0f }, /* Scratching chin? */
|
||||
};
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CCEE8.asm")
|
||||
void func_809CCDE0(EnBji01* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
Vec3f sp58;
|
||||
s32 pad[2];
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CD028.asm")
|
||||
Math_Vec3f_Copy(&sp58, &player->actor.world.pos);
|
||||
sp58.y = player->bodyPartsPos[7].y + 3.0f;
|
||||
func_8013E950(&this->actor.world.pos, &this->actor.focus.pos, this->actor.shape.rot.y, &player->actor.world.pos,
|
||||
&sp58, &this->headZRotAdj, &this->headXRotAdj, &this->torsoZRotAdj, &this->torsoXRotAdj, 0x1554,
|
||||
0x1FFE, 0xE38, 0x1C70);
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CD328.asm")
|
||||
void func_809CCE98(EnBji01* this, GlobalContext* globalCtx) {
|
||||
func_8013E1C8(&this->skelAnime, D_809CDC7C, 0, &this->animationIndex);
|
||||
this->actor.textId = 0;
|
||||
this->actionFunc = func_809CCEE8;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CD634.asm")
|
||||
void func_809CCEE8(EnBji01* this, GlobalContext* globalCtx) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x444);
|
||||
if (this->actor.params == ENBJI01_PARAMS_DEFAULT) {
|
||||
if ((this->actor.xzDistToPlayer <= 60.0f) && (this->actor.yDistToPlayer <= 10.0f)) {
|
||||
this->actor.flags |= 0x10000;
|
||||
} else {
|
||||
this->actor.flags &= ~0x10000;
|
||||
}
|
||||
}
|
||||
if (func_800B84D0(&this->actor, globalCtx)) {
|
||||
globalCtx->msgCtx.unk11F22 = 0;
|
||||
globalCtx->msgCtx.unk11F10 = 0;
|
||||
func_809CD028(this, globalCtx);
|
||||
} else {
|
||||
if (this->moonsTear != NULL) {
|
||||
if (this->moonsTear->actor.colChkInfo.health == 1) {
|
||||
func_809CD6C0(this, globalCtx);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this->moonsTear =
|
||||
(ObjMoonStone*)func_ActorCategoryIterateById(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
|
||||
}
|
||||
func_800B8500(&this->actor, globalCtx, 60.0f, 10.0f, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CD6B0.asm")
|
||||
void func_809CD028(EnBji01* this, GlobalContext* globalCtx) {
|
||||
s32 tempDay;
|
||||
f32 tempTimeBeforeMoonCrash;
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CD6C0.asm")
|
||||
switch (this->actor.params) {
|
||||
case ENBJI01_PARAMS_DEFAULT:
|
||||
case ENBJI01_PARAMS_FINISHED_CONVERSATION:
|
||||
switch (gSaveContext.playerForm) {
|
||||
case PLAYER_FORM_DEKU:
|
||||
if (gSaveContext.weekEventReg[17] & 0x10) {
|
||||
if (gSaveContext.weekEventReg[74] & 0x80) {
|
||||
this->textId = 0x5F4;
|
||||
} else {
|
||||
this->textId = 0x5E2;
|
||||
}
|
||||
} else {
|
||||
this->textId = 0x5EC;
|
||||
gSaveContext.weekEventReg[17] |= 0x10;
|
||||
}
|
||||
break;
|
||||
case PLAYER_FORM_HUMAN:
|
||||
if (Player_GetMask(globalCtx) == PLAYER_MASK_KAFEIS_MASK) {
|
||||
this->textId = 0x236A;
|
||||
} else if (gSaveContext.weekEventReg[74] & 0x10) {
|
||||
this->textId = 0x5F6;
|
||||
} else {
|
||||
this->textId = 0x5F5;
|
||||
gSaveContext.weekEventReg[74] |= 0x10;
|
||||
}
|
||||
break;
|
||||
case PLAYER_FORM_GORON:
|
||||
case PLAYER_FORM_ZORA:
|
||||
if (gSaveContext.weekEventReg[75] & 8) {
|
||||
this->textId = 0x5E4;
|
||||
} else {
|
||||
this->textId = 0x5DC;
|
||||
gSaveContext.weekEventReg[75] |= 8;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ENBJI01_PARAMS_LOOKED_THROUGH_TELESCOPE:
|
||||
switch (gSaveContext.playerForm) {
|
||||
case PLAYER_FORM_DEKU:
|
||||
if (gSaveContext.weekEventReg[74] & 0x80) {
|
||||
this->textId = 0x5F2;
|
||||
} else {
|
||||
this->textId = 0x5F1;
|
||||
}
|
||||
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.yDistToPlayer, 0);
|
||||
break;
|
||||
case PLAYER_FORM_HUMAN:
|
||||
this->textId = 0x5F7;
|
||||
break;
|
||||
case PLAYER_FORM_GORON:
|
||||
case PLAYER_FORM_ZORA:
|
||||
switch (CURRENT_DAY) {
|
||||
case 1:
|
||||
this->textId = 0x5E9;
|
||||
break;
|
||||
case 2:
|
||||
this->textId = 0x5EA;
|
||||
break;
|
||||
case 3:
|
||||
tempDay = gSaveContext.day;
|
||||
tempTimeBeforeMoonCrash =
|
||||
((-(tempDay % 5 << 0x10) - ((u16)(gSaveContext.time - 0x4000))) + 0x40000);
|
||||
if (tempTimeBeforeMoonCrash < 2730.6667f) { /* 1 hr */
|
||||
this->textId = 0x5E8;
|
||||
} else {
|
||||
this->textId = 0x5EB;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
|
||||
this->actionFunc = EnBji01_DialogueHandler;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CD70C.asm")
|
||||
void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
|
||||
switch (func_80152498(&globalCtx->msgCtx)) {
|
||||
case 0:
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x444);
|
||||
func_809CCDE0(this, globalCtx);
|
||||
if (this->actor.shape.rot.y == this->actor.yawTowardsPlayer) {
|
||||
func_801518B0(globalCtx, this->textId, &this->actor);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (func_80147624(globalCtx) != 0) {
|
||||
this->actor.flags &= ~0x10000;
|
||||
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
|
||||
switch (globalCtx->msgCtx.choiceIndex) {
|
||||
case 0:
|
||||
func_8019F208();
|
||||
func_801477B4(globalCtx);
|
||||
func_809CD634(this, globalCtx);
|
||||
break;
|
||||
case 1:
|
||||
func_8019F230();
|
||||
switch (gSaveContext.playerForm) {
|
||||
case PLAYER_FORM_DEKU:
|
||||
func_80151938(globalCtx, 0x5F0);
|
||||
break;
|
||||
case PLAYER_FORM_HUMAN:
|
||||
func_80151938(globalCtx, 0x5F8);
|
||||
break;
|
||||
case PLAYER_FORM_GORON:
|
||||
case PLAYER_FORM_ZORA:
|
||||
func_80151938(globalCtx, 0x5E1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (func_80147624(globalCtx) != 0) {
|
||||
this->actor.flags &= ~0x10000;
|
||||
switch (globalCtx->msgCtx.unk11F04) {
|
||||
case 0x5DE:
|
||||
func_8013E1C8(&this->skelAnime, D_809CDC7C, 3, &this->animationIndex);
|
||||
func_80151938(globalCtx, 0x5DF);
|
||||
break;
|
||||
case 0x5E4:
|
||||
func_80151938(globalCtx, 0x5E7);
|
||||
break;
|
||||
case 0x5E5:
|
||||
func_80151938(globalCtx, 0x5E0);
|
||||
break;
|
||||
case 0x5E7:
|
||||
func_80151938(globalCtx, 0x5E5);
|
||||
break;
|
||||
case 0x5DC:
|
||||
case 0x5DD:
|
||||
case 0x5DF:
|
||||
case 0x5EC:
|
||||
case 0x5ED:
|
||||
case 0x5EE:
|
||||
case 0x5F2:
|
||||
case 0x5F5:
|
||||
func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
|
||||
break;
|
||||
case 0x5F0:
|
||||
case 0x5F6:
|
||||
func_80151938(globalCtx, 0x5EF);
|
||||
break;
|
||||
case 0x5E1:
|
||||
case 0x5E8:
|
||||
case 0x5E9:
|
||||
case 0x5EA:
|
||||
case 0x5EB:
|
||||
case 0x5F1:
|
||||
case 0x5F3:
|
||||
case 0x5F4:
|
||||
case 0x5F7:
|
||||
case 0x5F8:
|
||||
func_801477B4(globalCtx);
|
||||
this->actor.flags &= ~0x10000;;
|
||||
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
|
||||
func_809CCE98(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
|
||||
this->actor.flags &= ~0x10000;;
|
||||
func_809CCE98(this, globalCtx);
|
||||
break;
|
||||
}
|
||||
if ((this->animationIndex == 3) && (this->skelAnime.animCurrentFrame == this->skelAnime.animFrameCount)) {
|
||||
func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CD77C.asm")
|
||||
void func_809CD634(EnBji01* this, GlobalContext* globalCtx) {
|
||||
func_801A5BD0(0x6F);
|
||||
func_801A89A8(0xE0000101);
|
||||
globalCtx->nextEntranceIndex = 0x54A0; /* Termina Field from telescope */
|
||||
gSaveContext.respawn[0].entranceIndex = globalCtx->nextEntranceIndex;
|
||||
func_80169EFC(globalCtx); /* Load new entrance? */
|
||||
gSaveContext.respawnFlag = -2;
|
||||
this->actionFunc = EnBji01_DoNothing;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/EnBji01_Init.asm")
|
||||
void EnBji01_DoNothing(EnBji01* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/EnBji01_Destroy.asm")
|
||||
void func_809CD6C0(EnBji01* this, GlobalContext* globalCtx) {
|
||||
func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
|
||||
this->actionFunc = func_809CD70C;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/EnBji01_Update.asm")
|
||||
void func_809CD70C(EnBji01* this, GlobalContext* globalCtx) {
|
||||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x444);
|
||||
func_809CCDE0(this, globalCtx);
|
||||
if (this->actor.shape.rot.y == this->actor.yawTowardsPlayer) {
|
||||
func_800B86C8(&this->moonsTear->actor, globalCtx, &this->actor); /* Z-Target the Moon's Tear? */
|
||||
this->actionFunc = func_809CD77C;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CDA4C.asm")
|
||||
void func_809CD77C(EnBji01* this, GlobalContext* globalCtx) {
|
||||
if (this->moonsTear->actor.colChkInfo.health == 0) {
|
||||
func_809CCE98(this, globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/func_809CDB04.asm")
|
||||
void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBji01* this = THIS;
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_En_Bji_01_0x809CCDE0/EnBji01_Draw.asm")
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, func_800B3FC0, 30.0f);
|
||||
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_0600578C, &D_06000FDC, this->jointTable, this->morphTable, BJI_LIMB_MAX);
|
||||
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
|
||||
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
this->actor.targetMode = 0;
|
||||
this->actor.child = NULL;
|
||||
this->animationIndex = -1;
|
||||
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
func_8013E3B8(&this->actor, this->cutscenes,
|
||||
ARRAY_COUNT(this->cutscenes)); /* initializes all elements of cutscenes to -1 */
|
||||
this->moonsTear =
|
||||
(ObjMoonStone*)func_ActorCategoryIterateById(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
|
||||
|
||||
switch (gSaveContext.entranceIndex) {
|
||||
case 0x4C00: /* Observatory from ECT */
|
||||
case 0x4C10: /* Observatory from Termina Field door */
|
||||
this->actor.params = ENBJI01_PARAMS_DEFAULT;
|
||||
func_809CCE98(this, globalCtx);
|
||||
break;
|
||||
case 0x4C20: /* Observatory from Termina Field telescope */
|
||||
this->actor.flags |= 0x10000;
|
||||
func_801A5BD0(0);
|
||||
func_801A89A8(0xE0000100);
|
||||
this->actor.params = ENBJI01_PARAMS_LOOKED_THROUGH_TELESCOPE;
|
||||
func_809CCE98(this, globalCtx);
|
||||
break;
|
||||
default:
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EnBji01_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnBji01* this = THIS;
|
||||
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
void EnBji01_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
static s16 sBlinkSequence[] = { 0, 1, 2, 1, 0, 0 };
|
||||
EnBji01* this = THIS;
|
||||
s32 pad;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, (Actor*)this, 0.0f, 0.0f, 0.0f, 4U);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
|
||||
if (this->blinkTimer-- <= 0) {
|
||||
if (--this->blinkSeqIndex < 0) {
|
||||
this->blinkSeqIndex = 4;
|
||||
this->blinkTimer = (Rand_ZeroOne() * 60.0f) + 20.0f;
|
||||
} else {
|
||||
this->eyeTexIndex = sBlinkSequence[this->blinkSeqIndex];
|
||||
}
|
||||
}
|
||||
|
||||
Actor_SetHeight(&this->actor, 40.0f);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
}
|
||||
|
||||
s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* thisx) {
|
||||
EnBji01* this = THIS;
|
||||
|
||||
if ((limbIndex == BJI_LIMB_NONE) && ((globalCtx->gameplayFrames % 2) != 0)) {
|
||||
*dList = NULL;
|
||||
}
|
||||
if (limbIndex == BJI_LIMB_NONE) {
|
||||
rot->x = rot->x;
|
||||
rot->y = rot->y;
|
||||
rot->z = rot->z;
|
||||
}
|
||||
switch (limbIndex) {
|
||||
case BJI_LIMB_TORSO:
|
||||
rot->x += this->torsoXRotAdj;
|
||||
rot->z += this->torsoZRotAdj;
|
||||
break;
|
||||
case BJI_LIMB_HEAD:
|
||||
rot->x += this->headXRotAdj;
|
||||
rot->z += this->headZRotAdj;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
|
||||
static Vec3f D_809CDCC8 = { 1088.0f, 1200.0f, 0.0f };
|
||||
EnBji01* this = THIS;
|
||||
Vec3f sp20;
|
||||
s32 temp_f4 = 0;
|
||||
|
||||
if (limbIndex == BJI_LIMB_HEAD) {
|
||||
Math_Vec3f_Copy(&sp20, &D_809CDCC8);
|
||||
sp20.x += temp_f4 * 0.1f;
|
||||
sp20.y += temp_f4 * 0.1f;
|
||||
sp20.z += temp_f4 * 0.1f;
|
||||
SysMatrix_MultiplyVector3fByState(&sp20, &this->actor.focus.pos);
|
||||
}
|
||||
}
|
||||
|
||||
void EnBji01_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
static void* sEyeTextures[] = { D_060049F0, D_06004E70, D_06005270 };
|
||||
EnBji01* this = THIS;
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
func_8012C28C(globalCtx->state.gfxCtx);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex]));
|
||||
SkelAnime_DrawSV(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, this->skelAnime.dListCount,
|
||||
EnBji01_OverrideLimbDraw, EnBji01_PostLimbDraw, &this->actor);
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,56 @@
|
|||
#define Z_EN_BJI_01_H
|
||||
|
||||
#include <global.h>
|
||||
#include "overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.h"
|
||||
|
||||
struct EnBji01;
|
||||
|
||||
typedef void (*EnBji01ActionFunc)(struct EnBji01*, GlobalContext*);
|
||||
|
||||
typedef enum {
|
||||
/* 00 */ BJI_LIMB_NONE,
|
||||
/* 01 */ BJI_LIMB_ROOT,
|
||||
/* 02 */ BJI_LIMB_THIGH_LEFT,
|
||||
/* 03 */ BJI_LIMB_LEG_LEFT,
|
||||
/* 04 */ BJI_LIMB_FOOT_LEFT,
|
||||
/* 05 */ BJI_LIMB_THIGH_RIGHT,
|
||||
/* 06 */ BJI_LIMB_LEG_RIGHT,
|
||||
/* 07 */ BJI_LIMB_FOOT_RIGHT,
|
||||
/* 08 */ BJI_LIMB_TORSO,
|
||||
/* 09 */ BJI_LIMB_ARM_LEFT,
|
||||
/* 10 */ BJI_LIMB_FOREARM_LEFT,
|
||||
/* 11 */ BJI_LIMB_HAND_LEFT,
|
||||
/* 12 */ BJI_LIMB_ARM_RIGHT,
|
||||
/* 13 */ BJI_LIMB_FOREARM_RIGHT,
|
||||
/* 14 */ BJI_LIMB_HAND_RIGHT,
|
||||
/* 15 */ BJI_LIMB_HEAD,
|
||||
/* 16 */ BJI_LIMB_MAX
|
||||
} ObjectBjiLimbs;
|
||||
|
||||
typedef enum {
|
||||
/* 00 */ ENBJI01_PARAMS_DEFAULT,
|
||||
/* 01 */ ENBJI01_PARAMS_FINISHED_CONVERSATION,
|
||||
/* 03 */ ENBJI01_PARAMS_LOOKED_THROUGH_TELESCOPE = 3
|
||||
} EnBji01Params;
|
||||
|
||||
typedef struct EnBji01 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ char unk_144[0x170];
|
||||
/* 0x144 */ EnBji01ActionFunc actionFunc;
|
||||
/* 0x148 */ SkelAnime skelAnime;
|
||||
/* 0x18C */ ColliderCylinder collider;
|
||||
/* 0x1D8 */ Vec3s jointTable[BJI_LIMB_MAX];
|
||||
/* 0x238 */ Vec3s morphTable[BJI_LIMB_MAX];
|
||||
/* 0x298 */ s32 animationIndex;
|
||||
/* 0x29C */ s16 eyeTexIndex;
|
||||
/* 0x29E */ s16 blinkSeqIndex;
|
||||
/* 0x2A0 */ s16 blinkTimer;
|
||||
/* 0x2A2 */ s16 torsoZRotAdj;
|
||||
/* 0x2A4 */ s16 torsoXRotAdj;
|
||||
/* 0x2A6 */ s16 headZRotAdj;
|
||||
/* 0x2A8 */ s16 headXRotAdj;
|
||||
/* 0x2AA */ u16 textId;
|
||||
/* 0x2AC */ s16 cutscenes[1];
|
||||
/* 0x2B0 */ ObjMoonStone* moonsTear;
|
||||
} EnBji01; // size = 0x2B4
|
||||
|
||||
extern const ActorInit En_Bji_01_InitVars;
|
||||
|
|
|
@ -9186,7 +9186,7 @@
|
|||
0x809CCE98:("func_809CCE98",),
|
||||
0x809CCEE8:("func_809CCEE8",),
|
||||
0x809CD028:("func_809CD028",),
|
||||
0x809CD328:("func_809CD328",),
|
||||
0x809CD328:("EnBji01_DialogueHandler",),
|
||||
0x809CD634:("func_809CD634",),
|
||||
0x809CD6B0:("func_809CD6B0",),
|
||||
0x809CD6C0:("func_809CD6C0",),
|
||||
|
|
Loading…
Reference in New Issue