1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00

object_du OK (#693)

* .gitkeep and xml

Signed-off-by: angie <angheloalf95@gmail.com>

* comment out most of the xml

Signed-off-by: angie <angheloalf95@gmail.com>

* add all animations

Signed-off-by: angie <angheloalf95@gmail.com>

* textures

Signed-off-by: angie <angheloalf95@gmail.com>

* more textures

Signed-off-by: angie <angheloalf95@gmail.com>

* another texture

Signed-off-by: angie <angheloalf95@gmail.com>

* eye and mouth textures

Signed-off-by: Anghelo <angheloalf95@gmail.com>

* add to spec and comment out a problematic skeleton

Signed-off-by: Anghelo <angheloalf95@gmail.com>

* replace almost all d_ references

Signed-off-by: Anghelo <angheloalf95@gmail.com>

* add missing include

Signed-off-by: Anghelo <angheloalf95@gmail.com>

* fix problems with overlapping data

Signed-off-by: angie <angheloalf95@gmail.com>

* replace references to Darunia's skeleton

Signed-off-by: Angie <angheloalf95@gmail.com>

* rename cutscenes in en_du

Signed-off-by: Angie <angheloalf95@gmail.com>

* last renaming

Signed-off-by: Angie <angheloalf95@gmail.com>

* ups, forgot to delete some pointers from undefined_syms.txt

Signed-off-by: Angie <angheloalf95@gmail.com>

* Rename the animations

Signed-off-by: angie <angheloalf95@gmail.com>

* run format

Signed-off-by: angie <angheloalf95@gmail.com>

* gDaruniaSageFormationAnim

Signed-off-by: angie <angheloalf95@gmail.com>

* update actor symbols from object

Signed-off-by: angie <angheloalf95@gmail.com>

* rename eyes

Signed-off-by: angie <angheloalf95@gmail.com>

* rename a mouth texture

Signed-off-by: angie <angheloalf95@gmail.com>

* run format.sh

Signed-off-by: angie <angheloalf95@gmail.com>

* typo

Signed-off-by: angie <angheloalf95@gmail.com>

* delete gitkeep

Signed-off-by: angie <angheloalf95@gmail.com>

* link of the pr

Signed-off-by: Angie <angheloalf95@gmail.com>

* update the cs name to the correct one

Signed-off-by: angie <angheloalf95@gmail.com>

* tlut

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

* add object name to outname in palettes

Signed-off-by: angie <angheloalf95@gmail.com>

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal 2021-03-28 00:02:45 -03:00 committed by GitHub
parent 833dc2928d
commit 3aad8f7244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 187 additions and 114 deletions

View File

@ -0,0 +1,81 @@
<Root>
<File Name="object_du" Segment="6">
<!-- Darunia's skeleton -->
<Skeleton Name="gDaruniaSkel" Type="Flex" LimbType="Standard" Offset="0x11CA8"/>
<Animation Name="gDaruniaIdleAnim" Offset="0x6EB0"/>
<Animation Name="gDaruniaItemGiveAnim" Offset="0x800"/>
<Animation Name="gDaruniaItemGiveIdleAnim" Offset="0xD00"/>
<!-- Used in the Goron's Ruby Cutscene -->
<Animation Name="gDaruniaHitLinkAnim" Offset="0x1D70"/>
<Animation Name="gDaruniaHitBreastAnim" Offset="0x2374"/>
<Animation Name="gDaruniaStandUpAfterFallingAnim" Offset="0x288C"/>
<!-- Animations of Darunia dancing the Saria's Song -->
<!-- He opens and closes his arms -->
<Animation Name="gDaruniaDancingLoop1Anim" Offset="0x2D94"/>
<!-- I don't understand this one -->
<Animation Name="gDaruniaDancingLoop2Anim" Offset="0x3D48"/>
<!-- Dances side to side -->
<Animation Name="gDaruniaDancingLoop3Anim" Offset="0x4C04"/>
<!-- I don't know. He thinks he is a chicken maybe (?) -->
<Animation Name="gDaruniaDancingLoop4Anim" Offset="0x4ED8"/>
<!-- Seems to go from from dancing to idle -->
<Animation Name="gDaruniaDancingEndAnim" Offset="0x41F4"/>
<!-- Link played a song which isn't the Saria's Song -->
<Animation Name="gDaruniaWrongSongAnim" Offset="0x3A30"/>
<Animation Name="gDaruniaWrongSongEndAnim" Offset="0x46F4"/>
<!-- Cutscene in the Chamber of Sages, after killing Ganon -->
<Animation Name="gDaruniaSageFormationAnim" Offset="0x12014"/>
<!-- Cutscene in credits. Saria is in Darunia's shoulders -->
<Animation Name="gDaruniaLookingUpToSariaAnim" Offset="0x5458"/>
<Animation Name="gDaruniaCreditsHitBreastAnim" Offset="0x6104"/>
<Animation Name="gDaruniaCreditsIdleAnim" Offset="0x67CC"/>
<!-- Darunia's eyes textures -->
<Texture Name="gDaruniaEyeOpenTex" OutName="darunia_eye_open" Format="ci8" Width="32" Height="32" Offset="0x8080"/>
<Texture Name="gDaruniaEyeOpeningTex" OutName="darunia_eye_opening" Format="ci8" Width="32" Height="32" Offset="0x8480"/>
<Texture Name="gDaruniaEyeShutTex" OutName="darunia_eye_shut" Format="ci8" Width="32" Height="32" Offset="0x8880"/>
<Texture Name="gDaruniaEyeClosingTex" OutName="darunia_eye_closing" Format="ci8" Width="32" Height="32" Offset="0xA540"/>
<!-- Darunia's mouth textures -->
<Texture Name="gDaruniaMouthSeriousTex" OutName="darunia_mouth_serious" Format="ci8" Width="64" Height="32" Offset="0x8C80"/>
<Texture Name="gDaruniaMouthGrinningTex" OutName="darunia_mouth_grinning" Format="ci8" Width="64" Height="32" Offset="0x9D40"/>
<Texture Name="gDaruniaMouthOpenTex" OutName="darunia_mouth_open" Format="ci8" Width="64" Height="32" Offset="0xA940"/>
<Texture Name="gDaruniaMouthHappyTex" OutName="darunia_mouth_happy" Format="ci8" Width="64" Height="32" Offset="0xB180"/>
<!-- Darunia's nose textures -->
<Texture Name="gDaruniaNoseSeriousTex" OutName="darunia_nose_serious" Format="ci8" Width="8" Height="8" Offset="0x7FC0"/>
<Texture Name="gDaruniaNoseHappyTex" OutName="darunia_nose_happy" Format="ci8" Width="8" Height="8" Offset="0xB140"/>
<!-- Palettes -->
<Texture Name="gDaruniaTLUT_6EC0" OutName="darunia_tlut_6EC0" Format="rgb5a1" Width="16" Height="16" Offset="0x6EC0"/>
<Texture Name="gDaruniaTLUT_7AF8" OutName="darunia_tlut_7AF8" Format="rgb5a1" Width="29" Height="8" Offset="0x7AF8"/>
<Texture Name="gDaruniaTLUT_7CC8" OutName="darunia_tlut_7CC8" Format="rgb5a1" Width="21" Height="12" Offset="0x7CC8"/>
<Texture Name="gDaruniaTLUT_7980" OutName="darunia_tlut_7980" Format="rgb5a1" Width="47" Height="4" Offset="0x7980"/>
<!-- Palette: gDaruniaPalette_6EC0 -->
<Texture Name="gDaruniaSkelTex_70C0" OutName="darunia_tex_70C0" Format="ci8" Width="32" Height="16" Offset="0x70C0"/>
<Texture Name="gDaruniaSkelTex_72C0" OutName="darunia_tex_72C0" Format="ci8" Width="16" Height="16" Offset="0x72C0"/>
<Texture Name="gDaruniaSkelTex_73C0" OutName="darunia_tex_73C0" Format="ci8" Width="8" Height="16" Offset="0x73C0"/>
<Texture Name="gDaruniaSkelTex_7440" OutName="darunia_tex_7440" Format="ci8" Width="8" Height="8" Offset="0x7440"/>
<Texture Name="gDaruniaSkelTex_7480" OutName="darunia_tex_7480" Format="ci8" Width="16" Height="16" Offset="0x7480"/>
<Texture Name="gDaruniaSkelTex_7580" OutName="darunia_tex_7580" Format="ci8" Width="32" Height="32" Offset="0x7580"/>
<!-- Palette: gDaruniaPalette_7980 -->
<Texture Name="gDaruniaSkelTex_7EC0" OutName="darunia_tex_7EC0" Format="ci8" Width="8" Height="16" Offset="0x7EC0"/>
<Texture Name="gDaruniaSkelTex_7F40" OutName="darunia_tex_7F40" Format="ci8" Width="8" Height="16" Offset="0x7F40"/>
<Texture Name="gDaruniaSkelTex_8000" OutName="darunia_tex_8000" Format="ci8" Width="8" Height="16" Offset="0x8000"/>
<Texture Name="gDaruniaSkelTex_9480" OutName="darunia_tex_9480" Format="ci8" Width="8" Height="16" Offset="0x9480"/>
<Texture Name="gDaruniaSkelTex_9500" OutName="darunia_tex_9500" Format="ci8" Width="32" Height="64" Offset="0x9500"/>
<Texture Name="gDaruniaSkelTex_9D00" OutName="darunia_tex_9D00" Format="ci8" Width="8" Height="8" Offset="0x9D00"/>
</File>
</Root>

View File

@ -1,6 +1,11 @@
<Root>
<File Name="spot18_scene">
<Scene Name="spot18_scene">
<CutsceneHint Name="gGoronCityDaruniaCorrectCs" Offset="0x59E0"/>
<CutsceneHint Name="gGoronCityDarunia01Cs" Offset="0x6930"/>
<CutsceneHint Name="gGoronCityDaruniaWrongCs" Offset="0x7DE0"/>
</Scene>
</File>
<File Name="spot18_room_0">

3
spec
View File

@ -4344,7 +4344,8 @@ endseg
beginseg
name "object_du"
romalign 0x1000
include "build/baserom/object_du.o"
include "build/assets/objects/object_du/object_du.o"
number 6
endseg
beginseg

View File

@ -1,4 +1,5 @@
#include "z_demo_du.h"
#include "objects/object_du/object_du.h"
#include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h"
#include "vt.h"
@ -14,25 +15,13 @@ void DemoDu_Destroy(Actor* thisx, GlobalContext* globalCtx);
void DemoDu_Update(Actor* thisx, GlobalContext* globalCtx);
void DemoDu_Draw(Actor* thisx, GlobalContext* globalCtx);
extern AnimationHeader D_06000800;
extern AnimationHeader D_06000D00;
extern AnimationHeader D_06001D70;
extern AnimationHeader D_06002374;
extern AnimationHeader D_0600288C;
extern AnimationHeader D_06005458;
extern AnimationHeader D_06006104;
extern AnimationHeader D_060067CC;
extern AnimationHeader D_06006EB0;
extern u64* D_06007FC0;
extern FlexSkeletonHeader D_06011CA8;
extern AnimationHeader D_06012014;
static s32 sUnused = 0;
#include "z_demo_du_cutscene_data.c" EARLY
static u64* sEyeTextures[] = { 0x06008080, 0x06008480, 0x06008880, 0x0600A540 };
static u64* sMouthTextures[] = { 0x06008C80, 0x06009D40, 0x0600A940, 0x0600B180 };
static u64* sEyeTextures[] = { gDaruniaEyeOpenTex, gDaruniaEyeOpeningTex, gDaruniaEyeShutTex, gDaruniaEyeClosingTex };
static u64* sMouthTextures[] = { gDaruniaMouthSeriousTex, gDaruniaMouthGrinningTex, gDaruniaMouthOpenTex,
gDaruniaMouthHappyTex };
/**
* Cs => Cutscene
@ -170,7 +159,7 @@ void func_80969DDC(DemoDu* this, AnimationHeader* animation, u8 mode, f32 morphF
}
void DemoDu_InitCs_FireMedallion(DemoDu* this, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011CA8, &D_06006EB0, NULL, NULL, 0);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, &gDaruniaIdleAnim, NULL, NULL, 0);
this->actor.shape.yOffset = -10000.0f;
DemoDu_SetEyeTexIndex(this, 1);
DemoDu_SetMouthTexIndex(this, 3);
@ -241,7 +230,8 @@ void DemoDu_CsFireMedallion_AdvanceTo04(DemoDu* this, GlobalContext* globalCtx)
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 2)) {
Animation_Change(&this->skelAnime, &D_06000800, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000800), 2, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaItemGiveAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaItemGiveAnim), 2, 0.0f);
this->updateIndex = CS_FIREMEDALLION_SUBSCENE(4);
}
}
@ -249,7 +239,8 @@ void DemoDu_CsFireMedallion_AdvanceTo04(DemoDu* this, GlobalContext* globalCtx)
void DemoDu_CsFireMedallion_AdvanceTo05(DemoDu* this, s32 animFinished) {
if (animFinished) {
Animation_Change(&this->skelAnime, &D_06000D00, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000D00), 0, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaItemGiveIdleAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaItemGiveIdleAnim), 0, 0.0f);
this->updateIndex = CS_FIREMEDALLION_SUBSCENE(5);
}
}
@ -305,7 +296,7 @@ void DemoDu_UpdateCs_FM_06(DemoDu* this, GlobalContext* globalCtx) {
}
void DemoDu_InitCs_GoronsRuby(DemoDu* this, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011CA8, NULL, NULL, NULL, 0);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(0);
}
@ -479,7 +470,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo02(DemoDu* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 1)) {
Animation_Change(&this->skelAnime, &D_0600288C, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600288C), 2, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaStandUpAfterFallingAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaStandUpAfterFallingAnim), 2, 0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(2);
this->drawIndex = 1;
DemoDu_CsGoronsRuby_DaruniaFalling(this, globalCtx);
@ -512,7 +504,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo04(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsGoronsRuby_AdvanceTo05(DemoDu* this, s32 animFinished) {
if (animFinished) {
Animation_Change(&this->skelAnime, &D_06006EB0, 1.0f, 0.0f, Animation_GetLastFrame(&D_06006EB0), 0, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), 0,
0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(5);
}
}
@ -522,7 +515,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo06(DemoDu* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 3)) {
Animation_Change(&this->skelAnime, &D_06002374, 1.0f, 0.0f, Animation_GetLastFrame(&D_06002374), 2, -4.0f);
Animation_Change(&this->skelAnime, &gDaruniaHitBreastAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaHitBreastAnim), 2, -4.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(6);
}
}
@ -530,7 +524,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo06(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsGoronsRuby_AdvanceTo07(DemoDu* this, s32 animFinished) {
if (animFinished) {
Animation_Change(&this->skelAnime, &D_06006EB0, 1.0f, 0.0f, Animation_GetLastFrame(&D_06006EB0), 0, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), 0,
0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(7);
}
}
@ -540,7 +535,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo08(DemoDu* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 4)) {
Animation_Change(&this->skelAnime, &D_06001D70, 1.0f, 0.0f, Animation_GetLastFrame(&D_06001D70), 2, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaHitLinkAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaHitLinkAnim), 2, 0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(8);
}
}
@ -548,14 +544,16 @@ void DemoDu_CsGoronsRuby_AdvanceTo08(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsGoronsRuby_AdvanceTo09(DemoDu* this, s32 animFinished) {
if (animFinished) {
Animation_Change(&this->skelAnime, &D_06002374, 1.0f, 0.0f, Animation_GetLastFrame(&D_06002374), 2, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaHitBreastAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaHitBreastAnim), 2, 0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(9);
}
}
void DemoDu_CsGoronsRuby_AdvanceTo10(DemoDu* this, s32 animFinished) {
if (animFinished) {
Animation_Change(&this->skelAnime, &D_06006EB0, 1.0f, 0.0f, Animation_GetLastFrame(&D_06006EB0), 0, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), 0,
0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(10);
}
}
@ -565,7 +563,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo11(DemoDu* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 5)) {
Animation_Change(&this->skelAnime, &D_06000800, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000800), 2, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaItemGiveAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaItemGiveAnim), 2, 0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(11);
}
}
@ -573,7 +572,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo11(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_CsGoronsRuby_AdvanceTo12(DemoDu* this, s32 animFinished) {
if (animFinished) {
Animation_Change(&this->skelAnime, &D_06000D00, 1.0f, 0.0f, Animation_GetLastFrame(&D_06000D00), 0, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaItemGiveIdleAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gDaruniaItemGiveIdleAnim), 0, 0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(12);
}
}
@ -583,7 +583,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo13(DemoDu* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[2];
if ((npcAction != NULL) && (npcAction->action != 6)) {
Animation_Change(&this->skelAnime, &D_06006EB0, 1.0f, 0.0f, Animation_GetLastFrame(&D_06006EB0), 0, 0.0f);
Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim),
0, 0.0f);
this->updateIndex = CS_GORONSRUBY_SUBSCENE(13);
}
}
@ -699,10 +700,10 @@ void DemoDu_UpdateCs_GR_13(DemoDu* this, GlobalContext* globalCtx) {
void DemoDu_InitCs_AfterGanon(DemoDu* this, GlobalContext* globalCtx) {
s32 pad[3];
f32 lastFrame = Animation_GetLastFrame(&D_06012014);
f32 lastFrame = Animation_GetLastFrame(&gDaruniaSageFormationAnim);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011CA8, NULL, NULL, NULL, 0);
Animation_Change(&this->skelAnime, &D_06012014, 1.0f, 0.0f, lastFrame, 2, 0.0f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0);
Animation_Change(&this->skelAnime, &gDaruniaSageFormationAnim, 1.0f, 0.0f, lastFrame, 2, 0.0f);
this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(0);
this->actor.shape.shadowAlpha = 0;
}
@ -809,7 +810,7 @@ void DemoDu_Draw_02(Actor* thisx, GlobalContext* globalCtx2) {
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture));
gSPSegment(POLY_XLU_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(mouthTexture));
gSPSegment(POLY_XLU_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(&D_06007FC0));
gSPSegment(POLY_XLU_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(&gDaruniaNoseSeriousTex));
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->shadowAlpha);
@ -822,7 +823,7 @@ void DemoDu_Draw_02(Actor* thisx, GlobalContext* globalCtx2) {
}
void DemoDu_InitCs_Credits(DemoDu* this, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011CA8, &D_060067CC, NULL, NULL, 0);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, &gDaruniaCreditsIdleAnim, NULL, NULL, 0);
this->updateIndex = CS_CREDITS_SUBSCENE(0);
this->drawIndex = 0;
this->actor.shape.shadowAlpha = 0;
@ -862,18 +863,18 @@ void DemoDu_CsCredits_AdvanceTo02(DemoDu* this) {
}
void DemoDu_CsCredits_AdvanceTo03(DemoDu* this) {
func_80969DDC(this, &D_06005458, ANIMMODE_ONCE, -8.0f, 0);
func_80969DDC(this, &gDaruniaLookingUpToSariaAnim, ANIMMODE_ONCE, -8.0f, 0);
this->updateIndex = CS_CREDITS_SUBSCENE(3);
}
void DemoDu_CsCredits_AdvanceTo04(DemoDu* this) {
func_80969DDC(this, &D_06006104, ANIMMODE_ONCE, 0.0f, 0);
func_80969DDC(this, &gDaruniaCreditsHitBreastAnim, ANIMMODE_ONCE, 0.0f, 0);
this->updateIndex = CS_CREDITS_SUBSCENE(4);
}
void DemoDu_CsCredits_BackTo02(DemoDu* this, s32 animFinished) {
if (animFinished) {
func_80969DDC(this, &D_060067CC, ANIMMODE_LOOP, 0.0f, 0);
func_80969DDC(this, &gDaruniaCreditsIdleAnim, ANIMMODE_LOOP, 0.0f, 0);
this->updateIndex = CS_CREDITS_SUBSCENE(2);
}
}
@ -1004,7 +1005,7 @@ void DemoDu_Draw_01(Actor* thisx, GlobalContext* globalCtx2) {
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(mouthTexture));
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(&D_06007FC0));
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(&gDaruniaNoseSeriousTex));
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);

View File

@ -1,4 +1,6 @@
#include "z_en_du.h"
#include "objects/object_du/object_du.h"
#include "scenes/overworld/spot18/spot18_scene.h"
#define FLAGS 0x02000009
@ -59,23 +61,23 @@ static CollisionCheckInfoInit2 sColChkInfoInit = {
};
static struct_80034EC0_Entry sAnimations[] = {
{ 0x06006EB0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, { 0x06006EB0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ 0x06000800, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f }, { 0x06000D00, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ 0x06001D70, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f }, { 0x06002374, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ 0x0600288C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f }, { 0x06002D94, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, -10.0f },
{ 0x06002D94, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, { 0x06003D48, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ 0x06004C04, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, { 0x06003A30, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ 0x060046F4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, { 0x06004ED8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ 0x060041F4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, -6.0f },
{ &gDaruniaIdleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
{ &gDaruniaIdleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ &gDaruniaItemGiveAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ &gDaruniaItemGiveIdleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ &gDaruniaHitLinkAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ &gDaruniaHitBreastAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ &gDaruniaStandUpAfterFallingAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -10.0f },
{ &gDaruniaDancingLoop1Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, -10.0f },
{ &gDaruniaDancingLoop1Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gDaruniaDancingLoop2Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gDaruniaDancingLoop3Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gDaruniaWrongSongAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gDaruniaWrongSongEndAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
{ &gDaruniaDancingLoop4Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gDaruniaDancingEndAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, -6.0f },
};
extern CutsceneData D_020059E0[];
extern CutsceneData D_02006930[];
extern CutsceneData D_02007DE0[];
extern AnimationHeader D_060041F4;
extern FlexSkeletonHeader D_06011CA8;
void EnDu_SetupAction(EnDu* this, EnDuActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@ -160,56 +162,57 @@ void func_809FDE24(EnDu* this, GlobalContext* globalCtx) {
}
void func_809FDE9C(EnDu* this) {
if (this->unk_1F2 > 0) {
this->unk_1F2--;
if (this->blinkTimer > 0) {
this->blinkTimer--;
} else {
this->unk_1F2 = 0;
this->blinkTimer = 0;
}
if (this->unk_1F2 < 3) {
this->unk_1EF = this->unk_1F2;
if (this->blinkTimer < 3) {
this->eyeTexIndex = this->blinkTimer;
}
switch (this->unk_1EC) {
case 0:
if (this->unk_1F2 == 0) {
this->unk_1F2 = Rand_S16Offset(0x1E, 0x1E);
if (this->blinkTimer == 0) {
this->blinkTimer = Rand_S16Offset(30, 30);
}
break;
case 1:
if (this->unk_1F2 == 0) {
this->unk_1EF = 2;
if (this->blinkTimer == 0) {
this->eyeTexIndex = 2;
}
break;
case 2:
if (this->unk_1F2 == 0) {
this->unk_1EF = 2;
if (this->blinkTimer == 0) {
this->eyeTexIndex = 2;
}
break;
case 3:
if (this->unk_1F2 == 0) {
this->unk_1EF = 0;
if (this->blinkTimer == 0) {
this->eyeTexIndex = 0;
}
break;
}
switch (this->unk_1ED) {
case 1:
this->unk_1F0 = 1;
this->mouthTexIndex = 1;
break;
case 2:
this->unk_1F0 = 2;
this->mouthTexIndex = 2;
break;
case 3:
this->unk_1F0 = 3;
this->mouthTexIndex = 3;
break;
default:
this->unk_1F0 = 0;
this->mouthTexIndex = 0;
break;
}
if (this->unk_1EE == 1) {
this->unk_1F1 = 1;
this->noseTexIndex = 1;
} else {
this->unk_1F1 = 0;
this->noseTexIndex = 0;
}
}
@ -255,7 +258,7 @@ void EnDu_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011CA8, NULL, 0, 0, 0);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, NULL, 0, 0, 0);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
@ -269,7 +272,7 @@ void EnDu_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_1F4.unk_00 = 0;
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(D_02006930);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDarunia01Cs);
gSaveContext.cutsceneTrigger = 1;
EnDu_SetupAction(this, func_809FE890);
} else if (globalCtx->sceneNum == 4) {
@ -317,14 +320,14 @@ void func_809FE4A4(EnDu* this, GlobalContext* globalCtx) {
globalCtx->msgCtx.unk_E3EE = 0;
EnDu_SetupAction(this, func_809FE3C0);
} else if (globalCtx->msgCtx.unk_E3EE >= 6) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(D_02007DE0);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaWrongCs);
gSaveContext.cutsceneTrigger = 1;
this->unk_1E8 = 1;
EnDu_SetupAction(this, func_809FE890);
globalCtx->msgCtx.unk_E3EE = 4;
} else if (globalCtx->msgCtx.unk_E3EE == 3) {
Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(D_020059E0);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaCorrectCs);
gSaveContext.cutsceneTrigger = 1;
this->unk_1E8 = 0;
EnDu_SetupAction(this, func_809FE890);
@ -435,13 +438,13 @@ void func_809FE890(EnDu* this, GlobalContext* globalCtx) {
}
this->unk_1EA = csAction->action;
if (this->unk_1EA == 7) {
this->unk_1F2 = 0xB;
this->blinkTimer = 11;
this->unk_1EC = 2;
this->unk_1ED = 2;
this->unk_1EE = 1;
}
if (this->unk_1EA == 8) {
this->unk_1F2 = 0xB;
this->blinkTimer = 11;
this->unk_1EC = 3;
this->unk_1ED = 3;
this->unk_1EE = 0;
@ -473,7 +476,7 @@ void func_809FE890(EnDu* this, GlobalContext* globalCtx) {
}
void func_809FEB08(EnDu* this, GlobalContext* globalCtx) {
this->unk_1F2 = 0xB;
this->blinkTimer = 11;
this->unk_1EC = 0;
this->unk_1ED = 0;
this->unk_1EE = 0;
@ -492,7 +495,7 @@ void func_809FEB08(EnDu* this, GlobalContext* globalCtx) {
EnDu_SetupAction(this, func_809FE3C0);
}
func_8010B680(globalCtx, this->actor.textId, NULL);
func_80034EC0(&this->skelAnime, sAnimations, 0xE);
func_80034EC0(&this->skelAnime, sAnimations, 14);
this->unk_1F4.unk_00 = 1;
}
@ -528,7 +531,8 @@ void EnDu_Update(Actor* thisx, GlobalContext* globalCtx) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->skelAnime.animation == &D_060041F4 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if (this->skelAnime.animation == &gDaruniaDancingEndAnim &&
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
func_80034EC0(&this->skelAnime, sAnimations, 1);
}
@ -583,17 +587,19 @@ void EnDu_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
}
void EnDu_Draw(Actor* thisx, GlobalContext* globalCtx) {
static UNK_TYPE D_809FF418[] = { 0x06008080, 0x06008480, 0x06008880, 0x0600A540 };
static UNK_TYPE D_809FF428[] = { 0x06008C80, 0x06009D40, 0x0600A940, 0x0600B180 };
static UNK_TYPE D_809FF438[] = { 0x06007FC0, 0x0600B140 };
static u64* sEyeTextures[] = { gDaruniaEyeOpenTex, gDaruniaEyeOpeningTex, gDaruniaEyeShutTex,
gDaruniaEyeClosingTex };
static u64* sMouthTextures[] = { gDaruniaMouthSeriousTex, gDaruniaMouthGrinningTex, gDaruniaMouthOpenTex,
gDaruniaMouthHappyTex };
static u64* sNoseTextures[] = { gDaruniaNoseSeriousTex, gDaruniaNoseHappyTex };
EnDu* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_du.c", 1470);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809FF418[this->unk_1EF]));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(D_809FF428[this->unk_1F0]));
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(D_809FF438[this->unk_1F1]));
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[this->eyeTexIndex]));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[this->mouthTexIndex]));
gSPSegment(POLY_OPA_DISP++, 0x0A, SEGMENTED_TO_VIRTUAL(sNoseTextures[this->noseTexIndex]));
func_80034BA0(globalCtx, &this->skelAnime, EnDu_OverrideLimbDraw, EnDu_PostLimbDraw, &this->actor, 255);

View File

@ -22,10 +22,10 @@ typedef struct EnDu {
/* 0x01EC */ u8 unk_1EC;
/* 0x01ED */ u8 unk_1ED;
/* 0x01EE */ u8 unk_1EE;
/* 0x01EF */ u8 unk_1EF;
/* 0x01F0 */ u8 unk_1F0;
/* 0x01F1 */ u8 unk_1F1;
/* 0x01F2 */ s16 unk_1F2;
/* 0x01EF */ u8 eyeTexIndex;
/* 0x01F0 */ u8 mouthTexIndex;
/* 0x01F1 */ u8 noseTexIndex;
/* 0x01F2 */ s16 blinkTimer;
/* 0x01F4 */ struct_80034A14_arg1 unk_1F4;
} EnDu; // size = 0x021C

View File

@ -1721,20 +1721,6 @@ D_060022B0 = 0x060022B0;
D_060035E0 = 0x060035E0;
D_060039D0 = 0x060039D0;
// z_demo_du
D_06000800 = 0x06000800;
D_06000D00 = 0x06000D00;
D_06001D70 = 0x06001D70;
D_06002374 = 0x06002374;
D_0600288C = 0x0600288C;
D_06005458 = 0x06005458;
D_06006104 = 0x06006104;
D_060067CC = 0x060067CC;
D_06006EB0 = 0x06006EB0;
D_06007FC0 = 0x06007FC0;
D_06011CA8 = 0x06011CA8;
D_06012014 = 0x06012014;
// z_demo_ext
D_0600FAA0 = 0x0600FAA0;
@ -1896,13 +1882,6 @@ D_06000860 = 0x06000860;
D_060009D4 = 0x060009D4;
D_060020E0 = 0x060020E0;
// z_en_du
D_020059E0 = 0x020059E0;
D_02006930 = 0x02006930;
D_02007DE0 = 0x02007DE0;
D_060041F4 = 0x060041F4;
D_06011CA8 = 0x06011CA8;
// z_en_eiyer
D_06000288 = 0x06000288;
D_060004C4 = 0x060004C4;