diff --git a/assets/xml/objects/object_an1.xml b/assets/xml/objects/object_an1.xml index d0f5f73c54..927fa848aa 100644 --- a/assets/xml/objects/object_an1.xml +++ b/assets/xml/objects/object_an1.xml @@ -1,88 +1,107 @@  + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_an2.xml b/assets/xml/objects/object_an2.xml index a1785e5dd8..f56be1431c 100644 --- a/assets/xml/objects/object_an2.xml +++ b/assets/xml/objects/object_an2.xml @@ -1,12 +1,18 @@  + - - - - - - - - + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_an3.xml b/assets/xml/objects/object_an3.xml index 2fa21dadc2..a5268448c7 100644 --- a/assets/xml/objects/object_an3.xml +++ b/assets/xml/objects/object_an3.xml @@ -1,12 +1,18 @@  + - - - - - - - - + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_an4.xml b/assets/xml/objects/object_an4.xml index a6bb94e37d..d159c3dd5f 100644 --- a/assets/xml/objects/object_an4.xml +++ b/assets/xml/objects/object_an4.xml @@ -1,15 +1,22 @@  + - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/assets/xml/objects/object_mask_kerfay.xml b/assets/xml/objects/object_mask_kerfay.xml index 282aa8029f..d80b8eaf07 100644 --- a/assets/xml/objects/object_mask_kerfay.xml +++ b/assets/xml/objects/object_mask_kerfay.xml @@ -1,10 +1,12 @@  + - - - - - - + + + + + + + diff --git a/include/z64cutscene.h b/include/z64cutscene.h index af427d1a7e..69cc5ce50c 100644 --- a/include/z64cutscene.h +++ b/include/z64cutscene.h @@ -482,7 +482,7 @@ typedef enum { /* 0x22A */ CS_CMD_ACTOR_CUE_554, /* 0x22B */ CS_CMD_ACTOR_CUE_555, /* 0x22C */ CS_CMD_ACTOR_CUE_556, - /* 0x22D */ CS_CMD_ACTOR_CUE_557, + /* 0x22D */ CS_CMD_ACTOR_CUE_557, // Couple's Mask cs, Anju cues /* 0x22E */ CS_CMD_ACTOR_CUE_558, /* 0x22F */ CS_CMD_ACTOR_CUE_559, /* 0x230 */ CS_CMD_ACTOR_CUE_560, diff --git a/include/z64save.h b/include/z64save.h index 333953a761..0b68210384 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -1017,7 +1017,7 @@ typedef enum { #define WEEKEVENTREG_51_08 PACK_WEEKEVENTREG_FLAG(51, 0x08) #define WEEKEVENTREG_51_10 PACK_WEEKEVENTREG_FLAG(51, 0x10) #define WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT PACK_WEEKEVENTREG_FLAG(51, 0x20) -#define WEEKEVENTREG_51_40 PACK_WEEKEVENTREG_FLAG(51, 0x40) +#define WEEKEVENTREG_COUPLES_MASK_CUTSCENE_FINISHED PACK_WEEKEVENTREG_FLAG(51, 0x40) #define WEEKEVENTREG_51_80 PACK_WEEKEVENTREG_FLAG(51, 0x80) // Protected Cremia diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 3a5d69a346..6c33a5565b 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -2515,7 +2515,7 @@ u8 D_801C0B1C[] = { Gfx* D_801C0B20[] = { object_mask_truth_DL_0001A0, // PLAYER_MASK_TRUTH - object_mask_kerfay_DL_000D40, // PLAYER_MASK_KAFEIS_MASK + gKafeisMaskDL, // PLAYER_MASK_KAFEIS_MASK object_mask_yofukasi_DL_000490, // PLAYER_MASK_ALL_NIGHT object_mask_rabit_DL_000610, // PLAYER_MASK_BUNNY object_mask_ki_tan_DL_0004A0, // PLAYER_MASK_KEATON diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.c b/src/overlays/actors/ovl_Dm_An/z_dm_an.c index 3b05c6e562..090360dd7f 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.c +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.c @@ -16,10 +16,10 @@ void DmAn_Init(Actor* thisx, PlayState* play); void DmAn_Destroy(Actor* thisx, PlayState* play); void DmAn_Update(Actor* thisx, PlayState* play); -void func_80C1C958(DmAn* this, PlayState* play); -void DmAn_HandleCutscene(DmAn* this, PlayState* play); +void DmAn_WaitForObject(DmAn* this, PlayState* play); +void DmAn_HandleCouplesMaskCs(DmAn* this, PlayState* play); void DmAn_DoNothing(DmAn* this, PlayState* play); -void func_80C1D0B0(Actor* thisx, PlayState* play); +void DmAn_Draw(Actor* thisx, PlayState* play); ActorInit Dm_An_InitVars = { ACTOR_DM_AN, @@ -33,40 +33,51 @@ ActorInit Dm_An_InitVars = { (ActorFunc)NULL, }; -typedef enum { - /* -1 */ DMAN_ANIM_NONE = -1, - /* 0x0 */ DMAN_ANIM_0, - /* 0x1 */ DMAN_ANIM_1, - /* 0x2 */ DMAN_ANIM_2, - /* 0x3 */ DMAN_ANIM_3, - /* 0x4 */ DMAN_ANIM_4, - /* 0x5 */ DMAN_ANIM_5, - /* 0x6 */ DMAN_ANIM_6, - /* 0x7 */ DMAN_ANIM_7, - /* 0x8 */ DMAN_ANIM_8, - /* 0x9 */ DMAN_ANIM_9, - /* 0xA */ DMAN_ANIM_10, - /* 0xB */ DMAN_ANIM_11, - /* 0xC */ DMAN_ANIM_12, - /* 0xD */ DMAN_ANIM_13, - /* 0xE */ DMAN_ANIM_MAX +/** + * Anju stores her animations across different objects and the ones used by this actor are put together right next to + * each other in the sAnimationInfo array. Due to this, animation functions check which object to load by comparing + * index ranges. To make this a bit easier to read, this enum includes `DMAN_ANIMOBJ_*` values that mark when a range of + * animations of a certain object start + */ +typedef enum DmAnAnimation { + /* -1 */ DMAN_ANIM_NONE = -1, + /* 0 */ DMAN_ANIM_SITTING_IN_DISBELIEF, + /* 1 */ DMAN_ANIM_SIT, + + /* 2 */ DMAN_ANIMOBJ_AN4, + /* 2 */ DMAN_ANIM_MASK_STAND_LOOP = DMAN_ANIMOBJ_AN4, + /* 3 */ DMAN_ANIM_HOLD_HANDS, //! @bug See note at `sAnimationInfo` + /* 4 */ DMAN_ANIM_MASK_KNEEL, + /* 5 */ DMAN_ANIM_MASK_KNEEL_LOOP, + /* 6 */ DMAN_ANIM_HUG, + /* 7 */ DMAN_ANIM_HUG_LOOP, + /* 8 */ DMAN_ANIM_HUG_RELEASE, + /* 9 */ DMAN_ANIM_HUG_RELEASE_LOOP, + /* 10 */ DMAN_ANIM_COMBINE_MASKS_1, + /* 11 */ DMAN_ANIM_COMBINE_MASKS_2, + /* 12 */ DMAN_ANIM_LOOK_UP, + /* 13 */ DMAN_ANIM_LOOK_UP_LOOP, + /* 14 */ DMAN_ANIM_MAX } DmAnAnimation; static AnimationInfoS sAnimationInfo[DMAN_ANIM_MAX] = { - { &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_0 - { &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_1 - { &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_2 - { &object_an1_Anim_013E1C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_3 - { &object_an4_Anim_007E3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_4 - { &object_an4_Anim_0088C0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_5 - { &object_an4_Anim_0013C8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_6 - { &object_an4_Anim_002550, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_7 - { &object_an4_Anim_00353C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_8 - { &object_an4_Anim_004498, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_9 - { &object_an4_Anim_0060B4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_10 - { &object_an4_Anim_00041C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_11 - { &object_an4_Anim_004A78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_12 - { &object_an4_Anim_00506C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_13 + { &gAnju1SittingInDisbeliefAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_SITTING_IN_DISBELIEF + { &gAnju1SitAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_SIT + + // DMAN_ANIMOBJ_AN4 + { &gAnju4MaskStandLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_MASK_STAND_LOOP + //! @bug Uses symbol from OBJECT_AN1 instead of OBJECT_AN4 + { &gAnju1HoldHandsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_HOLD_HANDS + { &gAnju4MaskKneelAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_MASK_KNEEL + { &gAnju4MaskKneelLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_MASK_KNEEL_LOOP + { &gAnju4HugAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_HUG + { &gAnju4HugLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_HUG_LOOP + { &gAnju4HugReleaseAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_HUG_RELEASE + { &gAnju4HugReleaseLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_HUG_RELEASE_LOOP + { &gAnju4CombineMasks1Anim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_COMBINE_MASKS_1 + { &gAnju4CombineMasks2Anim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_COMBINE_MASKS_2 + { &gAnju4LookUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_LOOK_UP + { &gAnju4LookUpLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_LOOK_UP_LOOP }; s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) { @@ -74,13 +85,13 @@ s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) { s8 objectSlot2; s32 isAnimFinished = false; - if (this->animIndex <= DMAN_ANIM_1) { + if (this->animIndex < DMAN_ANIMOBJ_AN4) { objectSlot2 = this->actor.objectSlot; } else { objectSlot2 = this->an4ObjectSlot; } - if (objectSlot2 >= 0) { + if (objectSlot2 > OBJECT_SLOT_NONE) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot2].segment); isAnimFinished = SkelAnime_Update(&this->skelAnime); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); @@ -89,18 +100,18 @@ s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) { return isAnimFinished; } -s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, s32 animIndex) { +s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, DmAnAnimation animIndex) { s8 objectSlot = this->actor.objectSlot; s8 objectSlot2; s32 didAnimChange = false; - if (animIndex <= DMAN_ANIM_1) { + if (animIndex < DMAN_ANIMOBJ_AN4) { objectSlot2 = this->actor.objectSlot; } else { objectSlot2 = this->an4ObjectSlot; } - if ((objectSlot2 >= 0) && (this->animIndex != animIndex)) { + if ((objectSlot2 > OBJECT_SLOT_NONE) && (this->animIndex != animIndex)) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot2].segment); this->animIndex = animIndex; didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); @@ -110,66 +121,85 @@ s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, s32 animIndex) { return didAnimChange; } -void func_80C1C5B4(DmAn* this) { - if (DECR(this->unk_2BA) == 0) { - this->unk_2B8++; - if (this->unk_2B8 >= 4) { - this->unk_2BA = Rand_S16Offset(30, 30); - this->unk_2B8 = 0; +typedef enum DmAnEyes { + /* 0 */ DMAN_EYES_OPEN, + /* 1 */ DMAN_EYES_HALF1, + /* 2 */ DMAN_EYES_CLOSED, + /* 3 */ DMAN_EYES_HALF2, + /* 4 */ DMAN_EYES_COMFORT, + /* 5 */ DMAN_EYES_SAD, + /* 6 */ DMAN_EYES_RELIEVED_CLOSED, + /* 7 */ DMAN_EYES_MAX +} DmAnEyes; + +typedef enum DmAnMouth { + /* 0 */ DMAN_MOUTH_CLOSED, + /* 1 */ DMAN_MOUTH_HAPPY, + /* 2 */ DMAN_MOUTH_OPEN, + /* 3 */ DMAN_MOUTH_MAX +} DmAnMouth; + +void DmAn_Blink(DmAn* this) { + if (DECR(this->eyeTimer) == 0) { + this->eyeTexIndex++; + if (this->eyeTexIndex > DMAN_EYES_HALF2) { + this->eyeTimer = Rand_S16Offset(30, 30); + this->eyeTexIndex = 0; } } } -s32 func_80C1C62C(DmAn* this, PlayState* play) { +s32 DmAn_UpdateHeadRot(DmAn* this, PlayState* play) { s32 pad; - Vec3f sp40; - Vec3f sp34; - s16 sp32; + Vec3f lookAtActorPos; + Vec3f pos; + s16 yaw; - Math_Vec3f_Copy(&sp40, &this->unk_2B4->world.pos); - Math_Vec3f_Copy(&sp34, &this->actor.world.pos); - sp32 = Math_Vec3f_Yaw(&sp34, &sp40); + Math_Vec3f_Copy(&lookAtActorPos, &this->lookAtActor->world.pos); + Math_Vec3f_Copy(&pos, &this->actor.world.pos); + yaw = Math_Vec3f_Yaw(&pos, &lookAtActorPos); - Math_ApproachS(&this->unk_2C0, (sp32 - this->unk_2C4) - this->actor.shape.rot.y, 4, 0x2AA8); - this->unk_2C0 = CLAMP(this->unk_2C0, -0x1FFE, 0x1FFE); + Math_ApproachS(&this->headRotY, (yaw - this->torsoRotY) - this->actor.shape.rot.y, 4, 0x2AA8); + this->headRotY = CLAMP(this->headRotY, -0x1FFE, 0x1FFE); - Math_ApproachS(&this->unk_2C4, (sp32 - this->unk_2C0) - this->actor.shape.rot.y, 4, 0x2AA8); - this->unk_2C4 = CLAMP(this->unk_2C4, -0x1C70, 0x1C70); + Math_ApproachS(&this->torsoRotY, (yaw - this->headRotY) - this->actor.shape.rot.y, 4, 0x2AA8); + this->torsoRotY = CLAMP(this->torsoRotY, -0x1C70, 0x1C70); - if (this->unk_2B4->id == ACTOR_PLAYER) { - sp40.y = ((Player*)this->unk_2B4)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; + if (this->lookAtActor->id == ACTOR_PLAYER) { + lookAtActorPos.y = ((Player*)this->lookAtActor)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; } else { - Math_Vec3f_Copy(&sp40, &this->unk_2B4->focus.pos); + Math_Vec3f_Copy(&lookAtActorPos, &this->lookAtActor->focus.pos); } - Math_Vec3f_Copy(&sp34, &this->actor.focus.pos); - Math_ApproachS(&this->unk_2BE, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_2C2, 4, 0x2AA8); - this->unk_2BE = CLAMP(this->unk_2BE, -0x1C70, 0x1C70); + Math_Vec3f_Copy(&pos, &this->actor.focus.pos); + Math_ApproachS(&this->headRotZ, Math_Vec3f_Pitch(&pos, &lookAtActorPos) - this->torsoRotZ, 4, 0x2AA8); + this->headRotZ = CLAMP(this->headRotZ, -0x1C70, 0x1C70); + + Math_ApproachS(&this->torsoRotZ, Math_Vec3f_Pitch(&pos, &lookAtActorPos) - this->headRotZ, 4, 0x2AA8); + this->torsoRotZ = CLAMP(this->torsoRotZ, -0x1C70, 0x1C70); - Math_ApproachS(&this->unk_2C2, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_2BE, 4, 0x2AA8); - this->unk_2C2 = CLAMP(this->unk_2C2, -0x1C70, 0x1C70); return true; } -s32 func_80C1C83C(DmAn* this, PlayState* play) { - if (this->unk_2B4 != NULL) { - func_80C1C62C(this, play); - this->unk_2AE &= ~1; - this->unk_2AE |= 2; - } else if (this->unk_2AE & 2) { - this->unk_2AE &= ~2; - this->unk_2BE = 0; - this->unk_2C0 = 0; - this->unk_2C2 = 0; - this->unk_2C4 = 0; - this->unk_2BC = 20; - } else if (DECR(this->unk_2BC) == 0) { - this->unk_2AE |= 1; +s32 DmAn_UpdateAttention(DmAn* this, PlayState* play) { + if (this->lookAtActor != NULL) { + DmAn_UpdateHeadRot(this, play); + this->stateFlags &= ~DMAN_STATE_LOST_ATTENTION; + this->stateFlags |= DMAN_STATE_FACE_TARGET; + } else if (this->stateFlags & DMAN_STATE_FACE_TARGET) { + this->stateFlags &= ~DMAN_STATE_FACE_TARGET; + this->headRotZ = 0; + this->headRotY = 0; + this->torsoRotZ = 0; + this->torsoRotY = 0; + this->loseAttentionTimer = 20; + } else if (DECR(this->loseAttentionTimer) == 0) { + this->stateFlags |= DMAN_STATE_LOST_ATTENTION; } return true; } -Actor* func_80C1C8E8(PlayState* play) { +Actor* DmAn_FindAnjusMotherActor(PlayState* play) { Actor* tempActor; Actor* foundActor = NULL; @@ -190,34 +220,42 @@ Actor* func_80C1C8E8(PlayState* play) { return foundActor; } -void func_80C1C958(DmAn* this, PlayState* play) { +void DmAn_WaitForObject(DmAn* this, PlayState* play) { if ((this->an4ObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->an4ObjectSlot, play) && (this->msmoObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->msmoObjectSlot, play)) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_an1_Skel_012618, NULL, this->jointTable, this->morphTable, - OBJECT_AN1_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gAnju1Skel, NULL, this->jointTable, this->morphTable, + ANJU1_LIMB_MAX); this->animIndex = DMAN_ANIM_NONE; - DmAn_ChangeAnim(this, play, DMAN_ANIM_0); + DmAn_ChangeAnim(this, play, DMAN_ANIM_SITTING_IN_DISBELIEF); this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; Actor_SetScale(&this->actor, 0.01f); - this->unk_2AE |= 1; - this->actor.draw = func_80C1D0B0; + this->stateFlags |= DMAN_STATE_LOST_ATTENTION; + this->actor.draw = DmAn_Draw; if ((play->sceneId == SCENE_YADOYA) && (play->curSpawn == 4)) { - this->unk_2B4 = func_80C1C8E8(play); - DmAn_ChangeAnim(this, play, DMAN_ANIM_1); + this->lookAtActor = DmAn_FindAnjusMotherActor(play); + DmAn_ChangeAnim(this, play, DMAN_ANIM_SIT); this->actionFunc = DmAn_DoNothing; } else { - this->actionFunc = DmAn_HandleCutscene; + this->actionFunc = DmAn_HandleCouplesMaskCs; } } } -void DmAn_HandleCutscene(DmAn* this, PlayState* play) { +void DmAn_HandleCouplesMaskCs(DmAn* this, PlayState* play) { s32 csAnimIndex[] = { - DMAN_ANIM_0, DMAN_ANIM_0, DMAN_ANIM_12, DMAN_ANIM_2, DMAN_ANIM_4, - DMAN_ANIM_6, DMAN_ANIM_8, DMAN_ANIM_10, DMAN_ANIM_11, DMAN_ANIM_3, + /* 0 */ 0, // no cue + /* 1 */ DMAN_ANIM_SITTING_IN_DISBELIEF, + /* 2 */ DMAN_ANIM_LOOK_UP, + /* 3 */ DMAN_ANIM_MASK_STAND_LOOP, + /* 4 */ DMAN_ANIM_MASK_KNEEL, + /* 5 */ DMAN_ANIM_HUG, + /* 6 */ DMAN_ANIM_HUG_RELEASE, + /* 7 */ DMAN_ANIM_COMBINE_MASKS_1, + /* 8 */ DMAN_ANIM_COMBINE_MASKS_2, + /* 9 */ DMAN_ANIM_HOLD_HANDS, }; u16 cueId; s32 cueChannel; @@ -247,8 +285,8 @@ void DmAn_HandleCutscene(DmAn* this, PlayState* play) { case 6: case 7: case 8: - if ((this->animIndex == DMAN_ANIM_12) || (this->animIndex == DMAN_ANIM_4) || - (this->animIndex == DMAN_ANIM_6) || (this->animIndex == DMAN_ANIM_8)) { + if ((this->animIndex == DMAN_ANIM_LOOK_UP) || (this->animIndex == DMAN_ANIM_MASK_KNEEL) || + (this->animIndex == DMAN_ANIM_HUG) || (this->animIndex == DMAN_ANIM_HUG_RELEASE)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { DmAn_ChangeAnim(this, play, this->animIndex + 1); } @@ -275,7 +313,7 @@ void DmAn_Init(Actor* thisx, PlayState* play) { this->an4ObjectSlot = SubS_GetObjectSlot(OBJECT_AN4, play); this->msmoObjectSlot = SubS_GetObjectSlot(OBJECT_MSMO, play); - this->actionFunc = func_80C1C958; + this->actionFunc = DmAn_WaitForObject; } void DmAn_Destroy(Actor* thisx, PlayState* play) { @@ -286,26 +324,25 @@ void DmAn_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - func_80C1C83C(this, play); + DmAn_UpdateAttention(this, play); if (this->actor.draw != NULL) { DmAn_UpdateSkelAnime(this, play); - func_80C1C5B4(this); + DmAn_Blink(this); } Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); } -Vec3f D_80C1D2C8 = { 450.0f, 700.0f, -760.0f }; -Vec3s D_80C1D2D4 = { 0x238C, 0, -0x3FFC }; -Vec3f D_80C1D2DC = { 1000.0f, 0.0f, 0.0f }; - -void func_80C1CD80(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { +void DmAn_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { s32 pad[2]; DmAn* this = THIS; s8 objectSlot = this->actor.objectSlot; s8 msmoObjectSlot = this->msmoObjectSlot; - if ((limbIndex == OBJECT_AN1_LIMB_05) && this->didAnimChangeInCs) { + if ((limbIndex == ANJU1_LIMB_LEFT_HAND) && this->didAnimChangeInCs) { + static Vec3f D_80C1D2C8 = { 450.0f, 700.0f, -760.0f }; + static Vec3s D_80C1D2D4 = { 0x238C, 0, -0x3FFC }; + OPEN_DISPS(play->state.gfxCtx); Matrix_Push(); @@ -321,19 +358,21 @@ void func_80C1CD80(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto CLOSE_DISPS(play->state.gfxCtx); } - if (limbIndex == OBJECT_AN1_LIMB_09) { + if (limbIndex == ANJU1_LIMB_HEAD) { + static Vec3f D_80C1D2DC = { 1000.0f, 0.0f, 0.0f }; + Matrix_MultVec3f(&D_80C1D2DC, &this->actor.focus.pos); Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot); } } -void func_80C1CEFC(PlayState* play, s32 limbIndex, Actor* thisx) { +void DmAn_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { DmAn* this = THIS; s16 stepRot; s16 overrideRot; - if (!(this->unk_2AE & 1)) { - if (this->unk_2AE & 2) { + if (!(this->stateFlags & DMAN_STATE_LOST_ATTENTION)) { + if (this->stateFlags & DMAN_STATE_FACE_TARGET) { overrideRot = true; } else { overrideRot = false; @@ -344,53 +383,57 @@ void func_80C1CEFC(PlayState* play, s32 limbIndex, Actor* thisx) { overrideRot = false; } - if (limbIndex == OBJECT_AN1_LIMB_09) { - SubS_UpdateLimb(this->unk_2BE + this->unk_2C2 + 0x4000, - this->unk_2C0 + this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_18C, - &this->unk_1A4, stepRot, overrideRot); + if (limbIndex == ANJU1_LIMB_HEAD) { + SubS_UpdateLimb(this->headRotZ + this->torsoRotZ + 0x4000, + this->headRotY + this->torsoRotY + this->actor.shape.rot.y + 0x4000, &this->headComputedPos, + &this->headComputedRot, stepRot, overrideRot); Matrix_Pop(); - Matrix_Translate(this->unk_18C.x, this->unk_18C.y, this->unk_18C.z, MTXMODE_NEW); + Matrix_Translate(this->headComputedPos.x, this->headComputedPos.y, this->headComputedPos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - Matrix_RotateYS(this->unk_1A4.y, MTXMODE_APPLY); - Matrix_RotateXS(this->unk_1A4.x, MTXMODE_APPLY); - Matrix_RotateZS(this->unk_1A4.z, MTXMODE_APPLY); + Matrix_RotateYS(this->headComputedRot.y, MTXMODE_APPLY); + Matrix_RotateXS(this->headComputedRot.x, MTXMODE_APPLY); + Matrix_RotateZS(this->headComputedRot.z, MTXMODE_APPLY); Matrix_Push(); - } else if (limbIndex == OBJECT_AN1_LIMB_02) { - SubS_UpdateLimb(this->unk_2C2 + 0x4000, this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_194, - &this->unk_1AA, stepRot, overrideRot); + } else if (limbIndex == ANJU1_LIMB_TORSO) { + SubS_UpdateLimb(this->torsoRotZ + 0x4000, this->torsoRotY + this->actor.shape.rot.y + 0x4000, + &this->torsoComputedPos, &this->torsoComputedRot, stepRot, overrideRot); Matrix_Pop(); - Matrix_Translate(this->unk_194.x, this->unk_194.y, this->unk_194.z, MTXMODE_NEW); + Matrix_Translate(this->torsoComputedPos.x, this->torsoComputedPos.y, this->torsoComputedPos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - Matrix_RotateYS(this->unk_1AA.y, MTXMODE_APPLY); - Matrix_RotateXS(this->unk_1AA.x, MTXMODE_APPLY); - Matrix_RotateZS(this->unk_1AA.z, MTXMODE_APPLY); + Matrix_RotateYS(this->torsoComputedRot.y, MTXMODE_APPLY); + Matrix_RotateXS(this->torsoComputedRot.x, MTXMODE_APPLY); + Matrix_RotateZS(this->torsoComputedRot.z, MTXMODE_APPLY); Matrix_Push(); } } -TexturePtr D_80C1D2E8[] = { - object_an1_Tex_00E6E0, - object_an1_Tex_00F7A0, - object_an1_Tex_0101A0, -}; - -TexturePtr D_80C1D2F4[] = { - object_an1_Tex_00E1E0, object_an1_Tex_00EFA0, object_an1_Tex_00F3A0, object_an1_Tex_00EFA0, - object_an1_Tex_00FDA0, object_an1_Tex_00F9A0, object_an1_Tex_0103A0, -}; - -void func_80C1D0B0(Actor* thisx, PlayState* play) { +void DmAn_Draw(Actor* thisx, PlayState* play) { + static TexturePtr sMouthTextures[DMAN_MOUTH_MAX] = { + gAnju1MouthClosedTex, // DMAN_MOUTH_CLOSED + gAnju1MouthHappyTex, // DMAN_MOUTH_HAPPY + gAnju1MouthOpenTex, // DMAN_MOUTH_OPEN + }; + static TexturePtr sEyeTextures[DMAN_EYES_MAX] = { + gAnju1EyeOpenTex, // DMAN_EYES_OPEN + gAnju1EyeHalfTex, // DMAN_EYES_HALF1 + gAnju1EyeClosedTex, // DMAN_EYES_CLOSED + gAnju1EyeHalfTex, // DMAN_EYES_HALF2 + gAnju1EyeComfortTex, // DMAN_EYES_COMFORT + gAnju1EyeSadTex, // DMAN_EYES_SAD + gAnju1EyeRelievedClosedTex, // DMAN_EYES_RELIEVED_CLOSED + }; DmAn* this = THIS; OPEN_DISPS(play->state.gfxCtx); Gfx_SetupDL25_Opa(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80C1D2F4[this->unk_2B8])); - gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C1D2E8[0])); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex])); + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sMouthTextures[DMAN_MOUTH_CLOSED])); SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, - this->skelAnime.dListCount, NULL, func_80C1CD80, func_80C1CEFC, &this->actor); + this->skelAnime.dListCount, NULL, DmAn_PostLimbDraw, DmAn_TransformLimbDraw, + &this->actor); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.h b/src/overlays/actors/ovl_Dm_An/z_dm_an.h index 00931d731b..7ead44b266 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.h +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.h @@ -8,28 +8,31 @@ struct DmAn; typedef void (*DmAnActionFunc)(struct DmAn*, PlayState*); +#define DMAN_STATE_LOST_ATTENTION (1 << 0) +#define DMAN_STATE_FACE_TARGET (1 << 1) + typedef struct DmAn { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ DmAnActionFunc actionFunc; - /* 0x18C */ Vec3f unk_18C; - /* 0x18C */ Vec3f unk_194; - /* 0x1A4 */ Vec3s unk_1A4; - /* 0x1A4 */ Vec3s unk_1AA; - /* 0x1B0 */ Vec3s jointTable[OBJECT_AN1_LIMB_MAX]; - /* 0x22E */ Vec3s morphTable[OBJECT_AN1_LIMB_MAX]; + /* 0x18C */ Vec3f headComputedPos; + /* 0x18C */ Vec3f torsoComputedPos; + /* 0x1A4 */ Vec3s headComputedRot; + /* 0x1A4 */ Vec3s torsoComputedRot; + /* 0x1B0 */ Vec3s jointTable[ANJU1_LIMB_MAX]; + /* 0x22E */ Vec3s morphTable[ANJU1_LIMB_MAX]; /* 0x2AC */ s8 an4ObjectSlot; /* 0x2AD */ s8 msmoObjectSlot; - /* 0x2AE */ u16 unk_2AE; + /* 0x2AE */ u16 stateFlags; /* 0x2B0 */ u8 cueId; - /* 0x2B4 */ Actor* unk_2B4; - /* 0x2B8 */ s16 unk_2B8; - /* 0x2BA */ s16 unk_2BA; - /* 0x2BC */ s16 unk_2BC; - /* 0x2BE */ s16 unk_2BE; - /* 0x2C0 */ s16 unk_2C0; - /* 0x2C2 */ s16 unk_2C2; - /* 0x2C4 */ s16 unk_2C4; + /* 0x2B4 */ Actor* lookAtActor; + /* 0x2B8 */ s16 eyeTexIndex; + /* 0x2BA */ s16 eyeTimer; + /* 0x2BC */ s16 loseAttentionTimer; + /* 0x2BE */ s16 headRotZ; + /* 0x2C0 */ s16 headRotY; + /* 0x2C2 */ s16 torsoRotZ; + /* 0x2C4 */ s16 torsoRotY; /* 0x2C8 */ s32 animIndex; /* 0x2CC */ s32 prevAnimIndex; /* 0x2D0 */ s32 isCutscenePlaying; diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c index 3994c8fcec..458b51193d 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c @@ -16,10 +16,10 @@ void DmGm_Init(Actor* thisx, PlayState* play); void DmGm_Destroy(Actor* thisx, PlayState* play); void DmGm_Update(Actor* thisx, PlayState* play); -void func_80C248A8(DmGm* this, PlayState* play); -void DmGm_HandleCutscene(DmGm* this, PlayState* play); +void DmGm_WaitForObject(DmGm* this, PlayState* play); +void DmGm_HandleCouplesMaskCs(DmGm* this, PlayState* play); void DmGm_DoNothing(DmGm* this, PlayState* play); -void func_80C25000(Actor* thisx, PlayState* play); +void DmGm_Draw(Actor* thisx, PlayState* play); ActorInit Dm_Gm_InitVars = { ACTOR_DM_GM, @@ -33,40 +33,51 @@ ActorInit Dm_Gm_InitVars = { (ActorFunc)NULL, }; -typedef enum { - /* -1 */ DMGM_ANIM_NONE = -1, - /* 0x0 */ DMGM_ANIM_0, - /* 0x1 */ DMGM_ANIM_1, - /* 0x2 */ DMGM_ANIM_2, - /* 0x3 */ DMGM_ANIM_3, - /* 0x4 */ DMGM_ANIM_4, - /* 0x5 */ DMGM_ANIM_5, - /* 0x6 */ DMGM_ANIM_6, - /* 0x7 */ DMGM_ANIM_7, - /* 0x8 */ DMGM_ANIM_8, - /* 0x9 */ DMGM_ANIM_9, - /* 0xA */ DMGM_ANIM_10, - /* 0xB */ DMGM_ANIM_11, - /* 0xC */ DMGM_ANIM_12, - /* 0xD */ DMGM_ANIM_13, - /* 0xE */ DMGM_ANIM_MAX +/** + * Anju stores her animations across different objects and the ones used by this actor are put together right next to + * each other in the sAnimationInfo array. Due to this, animation functions check which object to load by comparing + * index ranges. To make this a bit easier to read, this enum includes `DMGM_ANIMOBJ_*` values that mark when a range of + * animations of a certain object start + */ +typedef enum DmGmAnimation { + /* -1 */ DMGM_ANIM_NONE = -1, + /* 0 */ DMGM_ANIM_SITTING_IN_DISBELIEF, + /* 1 */ DMGM_ANIM_SIT, + + /* 2 */ DMGM_ANIMOBJ_AN4, + /* 2 */ DMGM_ANIM_MASK_STAND_LOOP = DMGM_ANIMOBJ_AN4, + /* 3 */ DMGM_ANIM_HOLD_HANDS, //! @bug See note at `sAnimationInfo` + /* 4 */ DMGM_ANIM_MASK_KNEEL, + /* 5 */ DMGM_ANIM_MASK_KNEEL_LOOP, + /* 6 */ DMGM_ANIM_HUG, + /* 7 */ DMGM_ANIM_HUG_LOOP, + /* 8 */ DMGM_ANIM_HUG_RELEASE, + /* 9 */ DMGM_ANIM_HUG_RELEASE_LOOP, + /* 10 */ DMGM_ANIM_COMBINE_MASKS_1, + /* 11 */ DMGM_ANIM_COMBINE_MASKS_2, + /* 12 */ DMGM_ANIM_LOOK_UP, + /* 13 */ DMGM_ANIM_LOOK_UP_LOOP, + /* 14 */ DMGM_ANIM_MAX } DmGmAnimation; static AnimationInfoS sAnimationInfo[DMGM_ANIM_MAX] = { - { &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_0 - { &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_1 - { &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DMGM_ANIM_2 - { &object_an1_Anim_013E1C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DMGM_ANIM_3 - { &object_an4_Anim_007E3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_4 - { &object_an4_Anim_0088C0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_5 - { &object_an4_Anim_0013C8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_6 - { &object_an4_Anim_002550, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_7 - { &object_an4_Anim_00353C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_8 - { &object_an4_Anim_004498, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_9 - { &object_an4_Anim_0060B4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_10 - { &object_an4_Anim_00041C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_11 - { &object_an4_Anim_004A78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_12 - { &object_an4_Anim_00506C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_13 + { &gAnju1SittingInDisbeliefAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_SITTING_IN_DISBELIEF + { &gAnju1SitAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_SIT + + // DMGM_ANIMOBJ_AN4 + { &gAnju4MaskStandLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DMGM_ANIM_MASK_STAND_LOOP + //! @bug Uses symbol from OBJECT_AN1 instead of OBJECT_AN4 + { &gAnju1HoldHandsAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 }, // DMGM_ANIM_HOLD_HANDS + { &gAnju4MaskKneelAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_MASK_KNEEL + { &gAnju4MaskKneelLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_MASK_KNEEL_LOOP + { &gAnju4HugAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_HUG + { &gAnju4HugLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_HUG_LOOP + { &gAnju4HugReleaseAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_HUG_RELEASE + { &gAnju4HugReleaseLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_HUG_RELEASE_LOOP + { &gAnju4CombineMasks1Anim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_COMBINE_MASKS_1 + { &gAnju4CombineMasks2Anim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_COMBINE_MASKS_2 + { &gAnju4LookUpAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMGM_ANIM_LOOK_UP + { &gAnju4LookUpLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMGM_ANIM_LOOK_UP_LOOP }; s32 DmGm_UpdateSkelAnime(DmGm* this, PlayState* play) { @@ -74,13 +85,13 @@ s32 DmGm_UpdateSkelAnime(DmGm* this, PlayState* play) { s8 objectIndex2; s32 isAnimFinished = false; - if (this->animIndex <= DMGM_ANIM_1) { + if (this->animIndex < DMGM_ANIMOBJ_AN4) { objectIndex2 = this->actor.objectSlot; } else { objectIndex2 = this->an4ObjectSlot; } - if (objectIndex2 >= 0) { + if (objectIndex2 > OBJECT_SLOT_NONE) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment); isAnimFinished = SkelAnime_Update(&this->skelAnime); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectSlot].segment); @@ -89,18 +100,18 @@ s32 DmGm_UpdateSkelAnime(DmGm* this, PlayState* play) { return isAnimFinished; } -s32 DmGm_ChangeAnim(DmGm* this, PlayState* play, s32 animIndex) { +s32 DmGm_ChangeAnim(DmGm* this, PlayState* play, DmGmAnimation animIndex) { s8 objectSlot = this->actor.objectSlot; s8 objectIndex2; s32 didAnimChange = false; - if (animIndex <= DMGM_ANIM_1) { + if (animIndex < DMGM_ANIMOBJ_AN4) { objectIndex2 = this->actor.objectSlot; } else { objectIndex2 = this->an4ObjectSlot; } - if ((objectIndex2 >= 0) && (this->animIndex != animIndex)) { + if ((objectIndex2 > OBJECT_SLOT_NONE) && (this->animIndex != animIndex)) { gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment); this->animIndex = animIndex; didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); @@ -110,66 +121,85 @@ s32 DmGm_ChangeAnim(DmGm* this, PlayState* play, s32 animIndex) { return didAnimChange; } -void func_80C24504(DmGm* this) { - if (DECR(this->unk_2BA) == 0) { - this->unk_2B8++; - if (this->unk_2B8 >= 4) { - this->unk_2BA = Rand_S16Offset(30, 30); - this->unk_2B8 = 0; +typedef enum DmGmEyes { + /* 0 */ DMGM_EYES_OPEN, + /* 1 */ DMGM_EYES_HALF1, + /* 2 */ DMGM_EYES_CLOSED, + /* 3 */ DMGM_EYES_HALF2, + /* 4 */ DMGM_EYES_COMFORT, + /* 5 */ DMGM_EYES_SAD, + /* 6 */ DMGM_EYES_RELIEVED_CLOSED, + /* 7 */ DMGM_EYES_MAX +} DmGmEyes; + +typedef enum DmGmMouth { + /* 0 */ DMGM_MOUTH_CLOSED, + /* 1 */ DMGM_MOUTH_HAPPY, + /* 2 */ DMGM_MOUTH_OPEN, + /* 3 */ DMGM_MOUTH_MAX +} DmGmMouth; + +void DmGm_Blink(DmGm* this) { + if (DECR(this->eyeTimer) == 0) { + this->eyeTexIndex++; + if (this->eyeTexIndex > DMGM_EYES_HALF2) { + this->eyeTimer = Rand_S16Offset(30, 30); + this->eyeTexIndex = 0; } } } -s32 func_80C2457C(DmGm* this, PlayState* play) { +s32 DmGm_UpdateHeadRot(DmGm* this, PlayState* play) { s32 pad; - Vec3f sp40; - Vec3f sp34; - s16 sp32; + Vec3f lookAtActorPos; + Vec3f pos; + s16 yaw; - Math_Vec3f_Copy(&sp40, &this->unk_2B4->world.pos); - Math_Vec3f_Copy(&sp34, &this->actor.world.pos); - sp32 = Math_Vec3f_Yaw(&sp34, &sp40); + Math_Vec3f_Copy(&lookAtActorPos, &this->lookAtActor->world.pos); + Math_Vec3f_Copy(&pos, &this->actor.world.pos); + yaw = Math_Vec3f_Yaw(&pos, &lookAtActorPos); - Math_ApproachS(&this->unk_2C0, (sp32 - this->unk_2C4) - this->actor.shape.rot.y, 4, 0x2AA8); - this->unk_2C0 = CLAMP(this->unk_2C0, -0x1FFE, 0x1FFE); + Math_ApproachS(&this->headRotY, (yaw - this->torsoRotY) - this->actor.shape.rot.y, 4, 0x2AA8); + this->headRotY = CLAMP(this->headRotY, -0x1FFE, 0x1FFE); - Math_ApproachS(&this->unk_2C4, (sp32 - this->unk_2C0) - this->actor.shape.rot.y, 4, 0x2AA8); - this->unk_2C4 = CLAMP(this->unk_2C4, -0x1C70, 0x1C70); + Math_ApproachS(&this->torsoRotY, (yaw - this->headRotY) - this->actor.shape.rot.y, 4, 0x2AA8); + this->torsoRotY = CLAMP(this->torsoRotY, -0x1C70, 0x1C70); - if (this->unk_2B4->id == ACTOR_PLAYER) { - sp40.y = ((Player*)this->unk_2B4)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; + if (this->lookAtActor->id == ACTOR_PLAYER) { + lookAtActorPos.y = ((Player*)this->lookAtActor)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f; } else { - Math_Vec3f_Copy(&sp40, &this->unk_2B4->focus.pos); + Math_Vec3f_Copy(&lookAtActorPos, &this->lookAtActor->focus.pos); } - Math_Vec3f_Copy(&sp34, &this->actor.focus.pos); - Math_ApproachS(&this->unk_2BE, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_2C2, 4, 0x2AA8); - this->unk_2BE = CLAMP(this->unk_2BE, -0x1C70, 0x1C70); + Math_Vec3f_Copy(&pos, &this->actor.focus.pos); + Math_ApproachS(&this->headRotZ, Math_Vec3f_Pitch(&pos, &lookAtActorPos) - this->torsoRotZ, 4, 0x2AA8); + this->headRotZ = CLAMP(this->headRotZ, -0x1C70, 0x1C70); + + Math_ApproachS(&this->torsoRotZ, Math_Vec3f_Pitch(&pos, &lookAtActorPos) - this->headRotZ, 4, 0x2AA8); + this->torsoRotZ = CLAMP(this->torsoRotZ, -0x1C70, 0x1C70); - Math_ApproachS(&this->unk_2C2, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_2BE, 4, 0x2AA8); - this->unk_2C2 = CLAMP(this->unk_2C2, -0x1C70, 0x1C70); return true; } -s32 func_80C2478C(DmGm* this, PlayState* play) { - if (this->unk_2B4 != NULL) { - func_80C2457C(this, play); - this->unk_2AE &= ~1; - this->unk_2AE |= 2; - } else if (this->unk_2AE & 2) { - this->unk_2AE &= ~2; - this->unk_2BE = 0; - this->unk_2C0 = 0; - this->unk_2C2 = 0; - this->unk_2C4 = 0; - this->unk_2BC = 20; - } else if (DECR(this->unk_2BC) == 0) { - this->unk_2AE |= 1; +s32 DmGm_UpdateAttention(DmGm* this, PlayState* play) { + if (this->lookAtActor != NULL) { + DmGm_UpdateHeadRot(this, play); + this->stateFlags &= ~DMGM_STATE_LOST_ATTENTION; + this->stateFlags |= DMGM_STATE_FACE_TARGET; + } else if (this->stateFlags & DMGM_STATE_FACE_TARGET) { + this->stateFlags &= ~DMGM_STATE_FACE_TARGET; + this->headRotZ = 0; + this->headRotY = 0; + this->torsoRotZ = 0; + this->torsoRotY = 0; + this->loseAttentionTimer = 20; + } else if (DECR(this->loseAttentionTimer) == 0) { + this->stateFlags |= DMGM_STATE_LOST_ATTENTION; } return true; } -Actor* func_80C24838(PlayState* play) { +Actor* DmGm_FindAnjusMotherActor(PlayState* play) { Actor* tempActor; Actor* foundActor = NULL; @@ -190,34 +220,42 @@ Actor* func_80C24838(PlayState* play) { return foundActor; } -void func_80C248A8(DmGm* this, PlayState* play) { +void DmGm_WaitForObject(DmGm* this, PlayState* play) { if ((this->an4ObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->an4ObjectSlot, play) && (this->msmoObjectSlot > OBJECT_SLOT_NONE) && SubS_IsObjectLoaded(this->msmoObjectSlot, play)) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 14.0f); - SkelAnime_InitFlex(play, &this->skelAnime, &object_an1_Skel_012618, NULL, this->jointTable, this->morphTable, - OBJECT_AN1_LIMB_MAX); + SkelAnime_InitFlex(play, &this->skelAnime, &gAnju1Skel, NULL, this->jointTable, this->morphTable, + ANJU1_LIMB_MAX); this->animIndex = DMGM_ANIM_NONE; - DmGm_ChangeAnim(this, play, DMGM_ANIM_0); + DmGm_ChangeAnim(this, play, DMGM_ANIM_SITTING_IN_DISBELIEF); this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; Actor_SetScale(&this->actor, 0.01f); - this->unk_2AE |= 1; - this->actor.draw = func_80C25000; + this->stateFlags |= 1; + this->actor.draw = DmGm_Draw; if ((play->sceneId == SCENE_YADOYA) && (play->curSpawn == 4)) { - this->unk_2B4 = func_80C24838(play); - DmGm_ChangeAnim(this, play, DMGM_ANIM_1); + this->lookAtActor = DmGm_FindAnjusMotherActor(play); + DmGm_ChangeAnim(this, play, DMGM_ANIM_SIT); this->actionFunc = DmGm_DoNothing; } else { - this->actionFunc = DmGm_HandleCutscene; + this->actionFunc = DmGm_HandleCouplesMaskCs; } } } -void DmGm_HandleCutscene(DmGm* this, PlayState* play) { +void DmGm_HandleCouplesMaskCs(DmGm* this, PlayState* play) { s32 csAnimIndex[] = { - DMGM_ANIM_0, DMGM_ANIM_0, DMGM_ANIM_12, DMGM_ANIM_2, DMGM_ANIM_4, - DMGM_ANIM_6, DMGM_ANIM_8, DMGM_ANIM_10, DMGM_ANIM_11, DMGM_ANIM_3, + /* 0 */ 0, // no cue + /* 1 */ DMGM_ANIM_SITTING_IN_DISBELIEF, + /* 2 */ DMGM_ANIM_LOOK_UP, + /* 3 */ DMGM_ANIM_MASK_STAND_LOOP, + /* 4 */ DMGM_ANIM_MASK_KNEEL, + /* 5 */ DMGM_ANIM_HUG, + /* 6 */ DMGM_ANIM_HUG_RELEASE, + /* 7 */ DMGM_ANIM_COMBINE_MASKS_1, + /* 8 */ DMGM_ANIM_COMBINE_MASKS_2, + /* 9 */ DMGM_ANIM_HOLD_HANDS, }; u16 cueId; s32 cueChannel; @@ -247,8 +285,8 @@ void DmGm_HandleCutscene(DmGm* this, PlayState* play) { case 6: case 7: case 8: - if ((this->animIndex == DMGM_ANIM_12) || (this->animIndex == DMGM_ANIM_4) || - (this->animIndex == DMGM_ANIM_6) || (this->animIndex == DMGM_ANIM_8)) { + if ((this->animIndex == DMGM_ANIM_LOOK_UP) || (this->animIndex == DMGM_ANIM_MASK_KNEEL) || + (this->animIndex == DMGM_ANIM_HUG) || (this->animIndex == DMGM_ANIM_HUG_RELEASE)) { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { DmGm_ChangeAnim(this, play, this->animIndex + 1); } @@ -275,7 +313,7 @@ void DmGm_Init(Actor* thisx, PlayState* play) { this->an4ObjectSlot = SubS_GetObjectSlot(OBJECT_AN4, play); this->msmoObjectSlot = SubS_GetObjectSlot(OBJECT_MSMO, play); - this->actionFunc = func_80C248A8; + this->actionFunc = DmGm_WaitForObject; } void DmGm_Destroy(Actor* thisx, PlayState* play) { @@ -286,42 +324,43 @@ void DmGm_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - func_80C2478C(this, play); + DmGm_UpdateAttention(this, play); if (this->actor.draw != NULL) { DmGm_UpdateSkelAnime(this, play); - func_80C24504(this); + DmGm_Blink(this); } Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_4); } -Vec3f D_80C25218 = { 450.0f, 700.0f, -760.0f }; -Vec3s D_80C25224 = { 0x238C, 0, -0x3FFC }; -Vec3f D_80C2522C = { 1000.0f, 0.0f, 0.0f }; - void DmGm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) { s32 pad[2]; DmGm* this = THIS; - s8 sp2B = this->actor.objectSlot; - s8 sp2A = this->msmoObjectSlot; + s8 objectSlot = this->actor.objectSlot; + s8 msmoObjectSlot = this->msmoObjectSlot; + + if ((limbIndex == ANJU1_LIMB_LEFT_HAND) && this->didAnimChangeInCs) { + static Vec3f D_80C25218 = { 450.0f, 700.0f, -760.0f }; + static Vec3s D_80C25224 = { 0x238C, 0, -0x3FFC }; - if ((limbIndex == OBJECT_AN1_LIMB_05) && this->didAnimChangeInCs) { OPEN_DISPS(play->state.gfxCtx); Matrix_Push(); Matrix_TranslateRotateZYX(&D_80C25218, &D_80C25224); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2A].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[msmoObjectSlot].segment); gSPDisplayList(POLY_OPA_DISP++, gMoonMaskDL); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2B].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectSlot].segment); Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx); } - if (limbIndex == OBJECT_AN1_LIMB_09) { + if (limbIndex == ANJU1_LIMB_HEAD) { + static Vec3f D_80C2522C = { 1000.0f, 0.0f, 0.0f }; + Matrix_MultVec3f(&D_80C2522C, &this->actor.focus.pos); Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot); } @@ -332,8 +371,8 @@ void DmGm_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { s16 stepRot; s16 overrideRot; - if (!(this->unk_2AE & 1)) { - if (this->unk_2AE & 2) { + if (!(this->stateFlags & DMGM_STATE_LOST_ATTENTION)) { + if (this->stateFlags & DMGM_STATE_FACE_TARGET) { overrideRot = true; } else { overrideRot = false; @@ -344,50 +383,53 @@ void DmGm_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) { overrideRot = false; } - if (limbIndex == OBJECT_AN1_LIMB_09) { - SubS_UpdateLimb(this->unk_2BE + this->unk_2C2 + 0x4000, - this->unk_2C0 + this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_18C, - &this->unk_1A4, stepRot, overrideRot); + if (limbIndex == ANJU1_LIMB_HEAD) { + SubS_UpdateLimb(this->headRotZ + this->torsoRotZ + 0x4000, + this->headRotY + this->torsoRotY + this->actor.shape.rot.y + 0x4000, &this->headComputedPos, + &this->headComputedRot, stepRot, overrideRot); Matrix_Pop(); - Matrix_Translate(this->unk_18C.x, this->unk_18C.y, this->unk_18C.z, MTXMODE_NEW); + Matrix_Translate(this->headComputedPos.x, this->headComputedPos.y, this->headComputedPos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - Matrix_RotateYS(this->unk_1A4.y, MTXMODE_APPLY); - Matrix_RotateXS(this->unk_1A4.x, MTXMODE_APPLY); - Matrix_RotateZS(this->unk_1A4.z, MTXMODE_APPLY); + Matrix_RotateYS(this->headComputedRot.y, MTXMODE_APPLY); + Matrix_RotateXS(this->headComputedRot.x, MTXMODE_APPLY); + Matrix_RotateZS(this->headComputedRot.z, MTXMODE_APPLY); Matrix_Push(); - } else if (limbIndex == OBJECT_AN1_LIMB_02) { - SubS_UpdateLimb(this->unk_2C2 + 0x4000, this->unk_2C4 + this->actor.shape.rot.y + 0x4000, &this->unk_194, - &this->unk_1AA, stepRot, overrideRot); + } else if (limbIndex == ANJU1_LIMB_TORSO) { + SubS_UpdateLimb(this->torsoRotZ + 0x4000, this->torsoRotY + this->actor.shape.rot.y + 0x4000, + &this->torsoComputedPos, &this->torsoComputedRot, stepRot, overrideRot); Matrix_Pop(); - Matrix_Translate(this->unk_194.x, this->unk_194.y, this->unk_194.z, MTXMODE_NEW); + Matrix_Translate(this->torsoComputedPos.x, this->torsoComputedPos.y, this->torsoComputedPos.z, MTXMODE_NEW); Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY); - Matrix_RotateYS(this->unk_1AA.y, MTXMODE_APPLY); - Matrix_RotateXS(this->unk_1AA.x, MTXMODE_APPLY); - Matrix_RotateZS(this->unk_1AA.z, MTXMODE_APPLY); + Matrix_RotateYS(this->torsoComputedRot.y, MTXMODE_APPLY); + Matrix_RotateXS(this->torsoComputedRot.x, MTXMODE_APPLY); + Matrix_RotateZS(this->torsoComputedRot.z, MTXMODE_APPLY); Matrix_Push(); } } -TexturePtr D_80C25238[] = { - object_an1_Tex_00E6E0, - object_an1_Tex_00F7A0, - object_an1_Tex_0101A0, -}; - -TexturePtr D_80C25244[] = { - object_an1_Tex_00E1E0, object_an1_Tex_00EFA0, object_an1_Tex_00F3A0, object_an1_Tex_00EFA0, - object_an1_Tex_00FDA0, object_an1_Tex_00F9A0, object_an1_Tex_0103A0, -}; - -void func_80C25000(Actor* thisx, PlayState* play) { +void DmGm_Draw(Actor* thisx, PlayState* play) { + static TexturePtr sMouthTextures[DMGM_MOUTH_MAX] = { + gAnju1MouthClosedTex, // DMGM_MOUTH_CLOSED + gAnju1MouthHappyTex, // DMGM_MOUTH_HAPPY + gAnju1MouthOpenTex, // DMGM_MOUTH_OPEN + }; + static TexturePtr sEyeTextures[DMGM_EYES_MAX] = { + gAnju1EyeOpenTex, // DMGM_EYES_OPEN + gAnju1EyeHalfTex, // DMGM_EYES_HALF1 + gAnju1EyeClosedTex, // DMGM_EYES_CLOSED + gAnju1EyeHalfTex, // DMGM_EYES_HALF2 + gAnju1EyeComfortTex, // DMGM_EYES_COMFORT + gAnju1EyeSadTex, // DMGM_EYES_SAD + gAnju1EyeRelievedClosedTex, // DMGM_EYES_RELIEVED_CLOSED + }; DmGm* this = THIS; OPEN_DISPS(play->state.gfxCtx); Gfx_SetupDL25_Opa(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80C25244[this->unk_2B8])); - gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C25238[0])); + gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTexIndex])); + gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sMouthTextures[DMGM_MOUTH_CLOSED])); SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL, DmGm_PostLimbDraw, DmGm_TransformLimbDraw, diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h index 8abcba712f..c04c66a34a 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.h @@ -8,28 +8,31 @@ struct DmGm; typedef void (*DmGmActionFunc)(struct DmGm*, PlayState*); +#define DMGM_STATE_LOST_ATTENTION (1 << 0) +#define DMGM_STATE_FACE_TARGET (1 << 1) + typedef struct DmGm { /* 0x000 */ Actor actor; /* 0x144 */ SkelAnime skelAnime; /* 0x188 */ DmGmActionFunc actionFunc; - /* 0x18C */ Vec3f unk_18C; - /* 0x18C */ Vec3f unk_194; - /* 0x1A4 */ Vec3s unk_1A4; - /* 0x1A4 */ Vec3s unk_1AA; - /* 0x1B0 */ Vec3s jointTable[OBJECT_AN1_LIMB_MAX]; - /* 0x22E */ Vec3s morphTable[OBJECT_AN1_LIMB_MAX]; + /* 0x18C */ Vec3f headComputedPos; + /* 0x18C */ Vec3f torsoComputedPos; + /* 0x1A4 */ Vec3s headComputedRot; + /* 0x1A4 */ Vec3s torsoComputedRot; + /* 0x1B0 */ Vec3s jointTable[ANJU1_LIMB_MAX]; + /* 0x22E */ Vec3s morphTable[ANJU1_LIMB_MAX]; /* 0x2AC */ s8 an4ObjectSlot; /* 0x2AD */ s8 msmoObjectSlot; - /* 0x2AE */ u16 unk_2AE; + /* 0x2AE */ u16 stateFlags; /* 0x2B0 */ u8 cueId; - /* 0x2B4 */ Actor* unk_2B4; - /* 0x2B8 */ s16 unk_2B8; - /* 0x2BA */ s16 unk_2BA; - /* 0x2BC */ s16 unk_2BC; - /* 0x2BE */ s16 unk_2BE; - /* 0x2C0 */ s16 unk_2C0; - /* 0x2C2 */ s16 unk_2C2; - /* 0x2C4 */ s16 unk_2C4; + /* 0x2B4 */ Actor* lookAtActor; + /* 0x2B8 */ s16 eyeTexIndex; + /* 0x2BA */ s16 eyeTimer; + /* 0x2BC */ s16 loseAttentionTimer; + /* 0x2BE */ s16 headRotZ; + /* 0x2C0 */ s16 headRotY; + /* 0x2C2 */ s16 torsoRotZ; + /* 0x2C4 */ s16 torsoRotY; /* 0x2C8 */ s32 animIndex; /* 0x2CC */ s32 prevAnimIndex; /* 0x2D0 */ s32 isCutscenePlaying; diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.c b/src/overlays/actors/ovl_En_Test3/z_en_test3.c index d3676daa26..db31d617ee 100644 --- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c +++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c @@ -824,7 +824,7 @@ s32 func_80A3FE20(EnTest3* this, PlayState* play) { s32 func_80A3FF10(EnTest3* this, PlayState* play, struct_80A41828* arg2, ScheduleOutput* scheduleOutput) { static Vec3f D_80A418BC = { -420.0f, 210.0f, -162.0f }; - if (CHECK_WEEKEVENTREG(WEEKEVENTREG_51_40)) { + if (CHECK_WEEKEVENTREG(WEEKEVENTREG_COUPLES_MASK_CUTSCENE_FINISHED)) { D_80A41D68 = 2; Math_Vec3f_Copy(&this->player.actor.world.pos, &D_80A418BC); Math_Vec3f_Copy(&this->player.actor.home.pos, &D_80A418BC); @@ -856,7 +856,7 @@ s32 func_80A3FFD0(EnTest3* this, PlayState* play2) { D_80A41D68 = 2; } } else { - SET_WEEKEVENTREG(WEEKEVENTREG_51_40); + SET_WEEKEVENTREG(WEEKEVENTREG_COUPLES_MASK_CUTSCENE_FINISHED); play->startPlayerCutscene(play, &this->player, PLAYER_CSMODE_110); } return false; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 323b6a014f..e8d717b458 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -16941,19 +16941,19 @@ 0x80C1C130:("DmAl_Draw",), 0x80C1C410:("DmAn_UpdateSkelAnime",), 0x80C1C4D8:("DmAn_ChangeAnim",), - 0x80C1C5B4:("func_80C1C5B4",), - 0x80C1C62C:("func_80C1C62C",), - 0x80C1C83C:("func_80C1C83C",), - 0x80C1C8E8:("func_80C1C8E8",), - 0x80C1C958:("func_80C1C958",), - 0x80C1CAB0:("DmAn_HandleCutscene",), + 0x80C1C5B4:("DmAn_Blink",), + 0x80C1C62C:("DmAn_UpdateHeadRot",), + 0x80C1C83C:("DmAn_UpdateAttention",), + 0x80C1C8E8:("DmAn_FindAnjusMotherActor",), + 0x80C1C958:("DmAn_WaitForObject",), + 0x80C1CAB0:("DmAn_HandleCouplesMaskCs",), 0x80C1CC80:("DmAn_DoNothing",), 0x80C1CC90:("DmAn_Init",), 0x80C1CCE4:("DmAn_Destroy",), 0x80C1CCF4:("DmAn_Update",), - 0x80C1CD80:("func_80C1CD80",), - 0x80C1CEFC:("func_80C1CEFC",), - 0x80C1D0B0:("func_80C1D0B0",), + 0x80C1CD80:("DmAn_PostLimbDraw",), + 0x80C1CEFC:("DmAn_TransformLimbDraw",), + 0x80C1D0B0:("DmAn_Draw",), 0x80C1D410:("DmAh_ChangeAnim",), 0x80C1D458:("func_80C1D458",), 0x80C1D4D0:("func_80C1D4D0",), @@ -17102,19 +17102,19 @@ 0x80C23F6C:("EnEndingHero6_Draw",), 0x80C24360:("DmGm_UpdateSkelAnime",), 0x80C24428:("DmGm_ChangeAnim",), - 0x80C24504:("func_80C24504",), - 0x80C2457C:("func_80C2457C",), - 0x80C2478C:("func_80C2478C",), - 0x80C24838:("func_80C24838",), - 0x80C248A8:("func_80C248A8",), - 0x80C24A00:("DmGm_HandleCutscene",), + 0x80C24504:("DmGm_Blink",), + 0x80C2457C:("DmGm_UpdateHeadRot",), + 0x80C2478C:("DmGm_UpdateAttention",), + 0x80C24838:("DmGm_FindAnjusMotherActor",), + 0x80C248A8:("DmGm_WaitForObject",), + 0x80C24A00:("DmGm_HandleCouplesMaskCs",), 0x80C24BD0:("DmGm_DoNothing",), 0x80C24BE0:("DmGm_Init",), 0x80C24C34:("DmGm_Destroy",), 0x80C24C44:("DmGm_Update",), 0x80C24CD0:("DmGm_PostLimbDraw",), 0x80C24E4C:("DmGm_TransformLimbDraw",), - 0x80C25000:("func_80C25000",), + 0x80C25000:("DmGm_Draw",), 0x80C25360:("func_80C25360",), 0x80C253D0:("func_80C253D0",), 0x80C255DC:("ObjSwprize_Init",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 2602149cff..fad35390c3 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -16414,8 +16414,8 @@ 0x80C1D2C8:("D_80C1D2C8","UNK_TYPE1","",0x1), 0x80C1D2D4:("D_80C1D2D4","UNK_TYPE1","",0x1), 0x80C1D2DC:("D_80C1D2DC","UNK_TYPE1","",0x1), - 0x80C1D2E8:("D_80C1D2E8","UNK_TYPE4","",0x4), - 0x80C1D2F4:("D_80C1D2F4","UNK_TYPE1","",0x1), + 0x80C1D2E8:("sMouthTextures","UNK_TYPE4","",0x4), + 0x80C1D2F4:("sEyeTextures","UNK_TYPE1","",0x1), 0x80C1D310:("jtbl_80C1D310","UNK_PTR","",0x4), 0x80C1DDC0:("Dm_Ah_InitVars","UNK_TYPE1","",0x1), 0x80C1DDE0:("D_80C1DDE0","UNK_PTR","",0x4), @@ -16501,8 +16501,8 @@ 0x80C25218:("D_80C25218","UNK_TYPE1","",0x1), 0x80C25224:("D_80C25224","UNK_TYPE1","",0x1), 0x80C2522C:("D_80C2522C","UNK_TYPE1","",0x1), - 0x80C25238:("D_80C25238","UNK_TYPE4","",0x4), - 0x80C25244:("D_80C25244","UNK_TYPE1","",0x1), + 0x80C25238:("sMouthTextures","UNK_TYPE4","",0x4), + 0x80C25244:("sEyeTextures","UNK_TYPE1","",0x1), 0x80C25260:("jtbl_80C25260","UNK_PTR","",0x4), 0x80C257D0:("Obj_Swprize_InitVars","UNK_TYPE1","",0x1), 0x80C257F0:("D_80C257F0","UNK_TYPE1","",0x1), diff --git a/tools/weekeventregconvert.py b/tools/weekeventregconvert.py index 35757a022f..671407ad19 100755 --- a/tools/weekeventregconvert.py +++ b/tools/weekeventregconvert.py @@ -418,7 +418,7 @@ weekEventReg = { (51 << 8) | 0x08: "WEEKEVENTREG_51_08", (51 << 8) | 0x10: "WEEKEVENTREG_51_10", (51 << 8) | 0x20: "WEEKEVENTREG_ESCAPED_SAKONS_HIDEOUT", - (51 << 8) | 0x40: "WEEKEVENTREG_51_40", + (51 << 8) | 0x40: "WEEKEVENTREG_COUPLES_MASK_CUTSCENE_FINISHED", (51 << 8) | 0x80: "WEEKEVENTREG_51_80", (52 << 8) | 0x01: "WEEKEVENTREG_ESCORTED_CREMIA", (52 << 8) | 0x02: "WEEKEVENTREG_52_02", diff --git a/undefined_syms.txt b/undefined_syms.txt index 3a630cd3dd..ecae60b8c4 100644 --- a/undefined_syms.txt +++ b/undefined_syms.txt @@ -338,21 +338,6 @@ D_06014040 = 0x06014040; D_06002D30 = 0x06002D30; D_06011458 = 0x06011458; -// ovl_Door_Spiral - -D_06000590 = 0x06000590; -D_060007A8 = 0x060007A8; -D_06000EA0 = 0x06000EA0; -D_060012C0 = 0x060012C0; -D_060014C8 = 0x060014C8; -D_06002110 = 0x06002110; -D_06004448 = 0x06004448; -D_060051B8 = 0x060051B8; -D_06006128 = 0x06006128; -D_06009278 = 0x06009278; -D_06012B70 = 0x06012B70; -D_06013EA8 = 0x06013EA8; - // ovl_En_An D_06000308 = 0x06000308;