diff --git a/Makefile b/Makefile index 56134bd7fc..5103d58691 100644 --- a/Makefile +++ b/Makefile @@ -366,8 +366,8 @@ CPPFLAGS += -P -xc -fno-dollars-in-identifiers $(CPP_DEFINES) ASFLAGS += -march=vr4300 -32 -no-pad-sections -Iinclude -I$(EXTRACTED_DIR) ifeq ($(COMPILER),gcc) - CFLAGS += $(CPP_DEFINES) $(GBI_DEFINES) -G 0 -nostdinc -MD $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -mdivide-breaks -fno-PIC -fno-common -ffreestanding -funsigned-char -fbuiltin -fno-builtin-sinf -fno-builtin-cosf $(CHECK_WARNINGS) - CCASFLAGS += $(CPP_DEFINES) $(GBI_DEFINES) -G 0 -nostdinc -MD $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -fno-PIC -fno-common -Wa,-no-pad-sections + CFLAGS += $(CPP_DEFINES) $(GBI_DEFINES) -G 0 -nostdinc -MD -MP $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -mdivide-breaks -fno-PIC -fno-common -ffreestanding -funsigned-char -fbuiltin -fno-builtin-sinf -fno-builtin-cosf $(CHECK_WARNINGS) + CCASFLAGS += $(CPP_DEFINES) $(GBI_DEFINES) -G 0 -nostdinc -MD -MP $(INC) -march=vr4300 -mfix4300 -mabi=32 -mno-abicalls -fno-PIC -fno-common -Wa,-no-pad-sections MIPS_VERSION := -mips3 else # Suppress warnings for wrong number of macro arguments (to fake variadic @@ -385,7 +385,7 @@ endif ifeq ($(COMPILER),ido) # Have CC_CHECK pretend to be a MIPS compiler MIPS_BUILTIN_DEFS := -D_MIPS_ISA_MIPS2=2 -D_MIPS_ISA=_MIPS_ISA_MIPS2 -D_ABIO32=1 -D_MIPS_SIM=_ABIO32 -D_MIPS_SZINT=32 -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32 - CC_CHECK = gcc -nostdinc -MD -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C $(CPP_DEFINES) $(MIPS_BUILTIN_DEFS) $(GBI_DEFINES) $(INC) $(CHECK_WARNINGS) + CC_CHECK = gcc -nostdinc -MD -MP -fno-builtin -fsyntax-only -funsigned-char -std=gnu90 -D_LANGUAGE_C $(CPP_DEFINES) $(MIPS_BUILTIN_DEFS) $(GBI_DEFINES) $(INC) $(CHECK_WARNINGS) ifeq ($(shell getconf LONG_BIT), 32) # Work around memory allocation bug in QEMU export QEMU_GUEST_BASE := 1 @@ -858,7 +858,7 @@ $(O_FILES): | asset_files .PHONY: o_files asset_files $(BUILD_DIR)/spec: $(SPEC) $(SPEC_INCLUDES) - $(CPP) $(CPPFLAGS) -MD -MF $@.d -MT $@ -I. $< | $(BUILD_DIR_REPLACE) > $@ + $(CPP) $(CPPFLAGS) -MD -MP -MF $@.d -MT $@ -I. $< | $(BUILD_DIR_REPLACE) > $@ $(LDSCRIPT): $(BUILD_DIR)/spec $(MKLDSCRIPT) $< $@ @@ -870,7 +870,7 @@ $(BUILD_DIR)/baserom/%.o: $(EXTRACTED_DIR)/baserom/% $(OBJCOPY) -I binary -O elf32-big $< $@ $(BUILD_DIR)/data/%.o: data/%.s - $(CPP) $(CPPFLAGS) -MD -MF $(@:.o=.d) -MT $@ -Iinclude $< | $(AS) $(ASFLAGS) -o $@ + $(CPP) $(CPPFLAGS) -MD -MP -MF $(@:.o=.d) -MT $@ -Iinclude $< | $(AS) $(ASFLAGS) -o $@ ifeq ($(PLATFORM),IQUE) NES_CHARMAP := assets/text/charmap.chn.txt @@ -879,10 +879,10 @@ else endif $(BUILD_DIR)/assets/text/%.enc.nes.h: assets/text/%.h $(EXTRACTED_DIR)/text/%.h $(NES_CHARMAP) - $(CPP) $(CPPFLAGS) -I$(EXTRACTED_DIR) -MD -MF $(@:.o=.d) -MT $@ $< | $(PYTHON) tools/msgenc.py --encoding utf-8 --charmap $(NES_CHARMAP) - $@ + $(CPP) $(CPPFLAGS) -I$(EXTRACTED_DIR) -MD -MP -MF $(@:.o=.d) -MT $@ $< | $(PYTHON) tools/msgenc.py --encoding utf-8 --charmap $(NES_CHARMAP) - $@ $(BUILD_DIR)/assets/text/%.enc.jpn.h: assets/text/%.h $(EXTRACTED_DIR)/text/%.h assets/text/charmap.jpn.txt - $(CPP) $(CPPFLAGS) -I$(EXTRACTED_DIR) -MD -MF $(@:.o=.d) -MT $@ $< | $(PYTHON) tools/msgenc.py --encoding SHIFT-JIS --wchar --charmap assets/text/charmap.jpn.txt - $@ + $(CPP) $(CPPFLAGS) -I$(EXTRACTED_DIR) -MD -MP -MF $(@:.o=.d) -MT $@ $< | $(PYTHON) tools/msgenc.py --encoding SHIFT-JIS --wchar --charmap assets/text/charmap.jpn.txt - $@ # Dependencies for encoded message headers. These dependencies are not automatic as these headers are generated # as part of the build. A clean build must know to generate them before the relevant .d files are created. @@ -895,7 +895,7 @@ $(BUILD_DIR)/assets/text/staff_message_data_static.o: $(BUILD_DIR)/assets/text/m $(BUILD_DIR)/assets/text/%.o: assets/text/%.c ifneq ($(COMPILER),gcc) # Preprocess text with modern cpp for varargs macros - $(CPP) -undef -D_LANGUAGE_C -D__sgi $(CPPFLAGS) -MD -MT $@ $(INC) $< -o $(@:.o=.c) + $(CPP) -undef -D_LANGUAGE_C -D__sgi $(CPPFLAGS) -MD -MP -MT $@ $(INC) $< -o $(@:.o=.c) $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $(@:.o=.c) else $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $< @@ -915,7 +915,7 @@ $(BUILD_DIR)/assets/%.o: $(EXTRACTED_DIR)/assets/%.c # Assemble the ROM header with GNU AS always $(BUILD_DIR)/src/makerom/rom_header.o: src/makerom/rom_header.s ifeq ($(COMPILER),ido) - $(CPP) $(CPPFLAGS) $(MIPS_BUILTIN_DEFS) $(INC) -MD -MF $(@:.o=.d) -MT $@ $< | $(AS) $(ASFLAGS) -o $@ + $(CPP) $(CPPFLAGS) $(MIPS_BUILTIN_DEFS) $(INC) -MD -MP -MF $(@:.o=.d) -MT $@ $< | $(AS) $(ASFLAGS) -o $@ else $(CCAS) -c $(CCASFLAGS) $(MIPS_VERSION) $(ASOPTFLAGS) -o $@ $< endif @@ -927,7 +927,7 @@ $(BUILD_DIR)/src/makerom/ipl3.o: $(EXTRACTED_DIR)/incbin/ipl3 $(BUILD_DIR)/src/%.o: src/%.s ifeq ($(COMPILER),ido) # For header dependencies - $(CPP) $(MIPS_BUILTIN_DEFS) $(CPPFLAGS) -x assembler-with-cpp $(INC) -MD -MF $(@:.o=.d) -MT $@ $< -o /dev/null + $(CPP) $(MIPS_BUILTIN_DEFS) $(CPPFLAGS) -x assembler-with-cpp $(INC) -MD -MP -MF $(@:.o=.d) -MT $@ $< -o /dev/null $(CCAS) -c $(CCASFLAGS) $(MIPS_VERSION) $(ASOPTFLAGS) -o $(@:.o=.tmp.o) $< # IDO generates bad symbol tables, fix the symbol table with strip.. $(STRIP) $(@:.o=.tmp.o) -N dummy-symbol-name @@ -1072,7 +1072,7 @@ $(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%. -include $(SOUNDFONT_DEP_FILES) $(BUILD_DIR)/assets/audio/soundfonts/%.o: $(BUILD_DIR)/assets/audio/soundfonts/%.c $(BUILD_DIR)/assets/audio/soundfonts/%.name - $(CPP) $(MIPS_BUILTIN_DEFS) $(CPPFLAGS) -x assembler-with-cpp $(INC) -I include/audio -MD -MF $(@:.o=.d) -MT $@ $< -o /dev/null + $(CPP) $(MIPS_BUILTIN_DEFS) $(CPPFLAGS) -x assembler-with-cpp $(INC) -I include/audio -MD -MP -MF $(@:.o=.d) -MT $@ $< -o /dev/null # compile c to unlinked object $(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -I include/audio -o $(@:.o=.tmp) $< # partial link @@ -1093,11 +1093,11 @@ endif # then assemble the sequences... $(BUILD_DIR)/assets/audio/sequences/%.o: assets/audio/sequences/%.seq include/audio/aseq.h $(SEQUENCE_TABLE) | $(SOUNDFONT_HEADERS) - $(SEQ_CPP) $(SEQ_CPPFLAGS) -MD -MT $@ $< -o $(@:.o=.s) + $(SEQ_CPP) $(SEQ_CPPFLAGS) -MD -MP -MT $@ $< -o $(@:.o=.s) $(AS) $(ASFLAGS) -I $(BUILD_DIR)/assets/audio/soundfonts -I include/audio -I $(dir $<) $(@:.o=.s) -o $@ $(BUILD_DIR)/assets/audio/sequences/%.o: $(EXTRACTED_DIR)/assets/audio/sequences/%.seq include/audio/aseq.h $(SEQUENCE_TABLE) | $(SOUNDFONT_HEADERS) - $(SEQ_CPP) $(SEQ_CPPFLAGS) -MD -MT $@ $< -o $(@:.o=.s) + $(SEQ_CPP) $(SEQ_CPPFLAGS) -MD -MP -MT $@ $< -o $(@:.o=.s) $(AS) $(ASFLAGS) -I $(BUILD_DIR)/assets/audio/soundfonts -I include/audio -I $(dir $<) $(@:.o=.s) -o $@ ifeq ($(AUDIO_BUILD_DEBUG),1) $(OBJCOPY) -O binary -j.data $@ $(@:.o=.aseq) diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 575755d445..6f897d28b0 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -90,28 +90,6 @@ void EnRu1_DrawNothing(EnRu1* this, PlayState* play); void EnRu1_DrawOpa(EnRu1* this, PlayState* play); void EnRu1_DrawXlu(EnRu1* this, PlayState* play); -typedef enum EnRu1Eyes { - /* 0 */ ENRU1_EYES_OPEN, - /* 1 */ ENRU1_EYES_HALF_BLINK, - /* 2 */ ENRU1_EYES_CLOSED, - /* 3 */ ENRU1_EYES_UP, - /* 4 */ ENRU1_EYES_GAZING, - /* 5 */ ENRU1_EYES_BLUSH, -} EnRu1Eyes; - -typedef enum EnRu1Mouth { - /* 0 */ ENRU1_MOUTH_SMILING, - /* 1 */ ENRU1_MOUTH_FROWNING, - /* 2 */ ENRU1_MOUTH_OPEN, -} EnRu1Mouth; - -typedef enum EnRu1WaterState { - /* 0 */ ENRU1_WATER_OUTSIDE, - /* 1 */ ENRU1_WATER_IMMERSED, - /* 2 */ ENRU1_WATER_BOBBING, - /* 3 */ ENRU1_WATER_SINKING, -} EnRu1WaterState; - static ColliderCylinderInitType1 sStandingCylinderInit = { { COL_MATERIAL_HIT0, @@ -154,13 +132,52 @@ static s32 sUnused = 0; static u32 D_80AF1938 = 0; static EnRu1ActionFunc sActionFuncs[] = { - func_80AEC0B4, func_80AEC100, func_80AEC130, func_80AEC17C, func_80AEC1D4, func_80AEC244, func_80AEC2C0, - func_80AECA94, func_80AECAB4, func_80AECAD4, func_80AECB18, func_80AECB60, func_80AECBB8, func_80AECC1C, - func_80AECC84, func_80AED304, func_80AED324, func_80AED344, func_80AED374, func_80AED3A4, func_80AED3E0, - func_80AED414, func_80AEF29C, func_80AEF2AC, func_80AEF2D0, func_80AEF354, func_80AEF3A8, func_80AEEBD4, - func_80AEEC5C, func_80AEECF0, func_80AEED58, func_80AEEDCC, func_80AEEE34, func_80AEEE9C, func_80AEEF08, - func_80AEEF5C, func_80AEF9D8, func_80AEFA2C, func_80AEFAAC, func_80AEFB04, func_80AEFB68, func_80AEFCE8, - func_80AEFBC8, func_80AEFC24, func_80AEFECC, func_80AEFF40, + func_80AEC0B4, // ENRU1_ACTION_00 + func_80AEC100, // ENRU1_ACTION_01 + func_80AEC130, // ENRU1_ACTION_02 + func_80AEC17C, // ENRU1_ACTION_03 + func_80AEC1D4, // ENRU1_ACTION_04 + func_80AEC244, // ENRU1_ACTION_05 + func_80AEC2C0, // ENRU1_ACTION_06 + func_80AECA94, // ENRU1_ACTION_07 + func_80AECAB4, // ENRU1_ACTION_08 + func_80AECAD4, // ENRU1_ACTION_09 + func_80AECB18, // ENRU1_ACTION_10 + func_80AECB60, // ENRU1_ACTION_11 + func_80AECBB8, // ENRU1_ACTION_12 + func_80AECC1C, // ENRU1_ACTION_13 + func_80AECC84, // ENRU1_ACTION_14 + func_80AED304, // ENRU1_ACTION_15 + func_80AED324, // ENRU1_ACTION_16 + func_80AED344, // ENRU1_ACTION_17 + func_80AED374, // ENRU1_ACTION_18 + func_80AED3A4, // ENRU1_ACTION_19 + func_80AED3E0, // ENRU1_ACTION_20 + func_80AED414, // ENRU1_ACTION_21 + func_80AEF29C, // ENRU1_ACTION_22 + func_80AEF2AC, // ENRU1_ACTION_23 + func_80AEF2D0, // ENRU1_ACTION_24 + func_80AEF354, // ENRU1_ACTION_25 + func_80AEF3A8, // ENRU1_ACTION_26 + func_80AEEBD4, // ENRU1_ACTION_27 + func_80AEEC5C, // ENRU1_ACTION_28 + func_80AEECF0, // ENRU1_ACTION_29 + func_80AEED58, // ENRU1_ACTION_30 + func_80AEEDCC, // ENRU1_ACTION_31 + func_80AEEE34, // ENRU1_ACTION_32 + func_80AEEE9C, // ENRU1_ACTION_33 + func_80AEEF08, // ENRU1_ACTION_34 + func_80AEEF5C, // ENRU1_ACTION_35 + func_80AEF9D8, // ENRU1_ACTION_36 + func_80AEFA2C, // ENRU1_ACTION_37 + func_80AEFAAC, // ENRU1_ACTION_38 + func_80AEFB04, // ENRU1_ACTION_39 + func_80AEFB68, // ENRU1_ACTION_40 + func_80AEFCE8, // ENRU1_ACTION_41 + func_80AEFBC8, // ENRU1_ACTION_42 + func_80AEFC24, // ENRU1_ACTION_43 + func_80AEFECC, // ENRU1_ACTION_44 + func_80AEFF40, // ENRU1_ACTION_45 }; static EnRu1PreLimbDrawFunc sPreLimbDrawFuncs[] = { @@ -325,7 +342,8 @@ s32 func_80AEB020(EnRu1* this, PlayState* play) { if (actorIt->id == ACTOR_EN_RU1) { someEnRu1 = (EnRu1*)actorIt; if (someEnRu1 != this) { - if ((someEnRu1->action == 31) || (someEnRu1->action == 32) || (someEnRu1->action == 24)) { + if ((someEnRu1->action == ENRU1_ACTION_31) || (someEnRu1->action == ENRU1_ACTION_32) || + (someEnRu1->action == ENRU1_ACTION_24)) { return true; } } @@ -385,8 +403,8 @@ s32 func_80AEB1B4(PlayState* play) { #if DEBUG_FEATURES void func_80AEB1D8(EnRu1* this) { - this->action = 36; - this->drawConfig = 0; + this->action = ENRU1_ACTION_36; + this->drawConfig = ENRU1_DRAW_NOTHING; this->actor.velocity.x = 0.0f; this->actor.velocity.y = 0.0f; this->actor.velocity.z = 0.0f; @@ -426,7 +444,7 @@ void EnRu1_AnimationChange(EnRu1* this, AnimationHeader* animation, u8 mode, f32 s32 EnRu1_UpdateSkelAnime(EnRu1* this) { // why? - if (this->action != 32) { + if (this->action != ENRU1_ACTION_32) { return SkelAnime_Update(&this->skelAnime); } else { return SkelAnime_Update(&this->skelAnime); @@ -449,8 +467,8 @@ void func_80AEB3CC(EnRu1* this) { void EnRu1_InitOutsideJabuJabu(EnRu1* this, PlayState* play) { EnRu1_AnimationChange(this, &gRutoChildWaitHandsBehindBackAnim, ANIMMODE_LOOP, 0, false); - this->action = 0; - this->drawConfig = 1; + this->action = ENRU1_ACTION_00; + this->drawConfig = ENRU1_DRAW_OPA; EnRu1_SetEyes(this, ENRU1_EYES_GAZING); EnRu1_SetMouth(this, ENRU1_MOUTH_SMILING); } @@ -653,8 +671,8 @@ void func_80AEBCB8(EnRu1* this, UNK_TYPE arg1) { void func_80AEBD1C(EnRu1* this, PlayState* play) { if (func_80AEB480(play, 2)) { - this->action = 1; - this->drawConfig = 0; + this->action = ENRU1_ACTION_01; + this->drawConfig = ENRU1_DRAW_NOTHING; func_80AEB914(this, play); func_80AEAECC(this, play); EnRu1_SpawnSplash(this, play); @@ -671,8 +689,8 @@ void func_80AEBD94(EnRu1* this, PlayState* play) { func_80AEB934(this, play); func_80AEB738(this, play); Animation_Change(&this->skelAnime, &gRutoChildResurfaceAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); - this->action = 2; - this->drawConfig = 1; + this->action = ENRU1_ACTION_02; + this->drawConfig = ENRU1_DRAW_OPA; } } @@ -684,7 +702,7 @@ void func_80AEBE3C(EnRu1* this, PlayState* play, s32 arg2) { func_80AEB7D0(this); Animation_Change(&this->skelAnime, &gRutoChildTreadWaterAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); - this->action = 3; + this->action = ENRU1_ACTION_03; } else { func_80AEB954(this, play); } @@ -699,7 +717,7 @@ void func_80AEBEC8(EnRu1* this, PlayState* play) { func_80AEB738(this, play); Animation_Change(&this->skelAnime, &gRutoChildTransitionToSwimOnBackAnim, 1.0f, 0, frameCount, ANIMMODE_ONCE, -8.0f); - this->action = 4; + this->action = ENRU1_ACTION_04; } } @@ -708,7 +726,7 @@ void func_80AEBF60(EnRu1* this, PlayState* play) { s32 pad; func_80AEB7D0(this); - this->action = 5; + this->action = ENRU1_ACTION_05; this->unk_364 = this->actor.world.pos; } else { func_80AEBA0C(this, play); @@ -729,7 +747,7 @@ void func_80AEBFD8(EnRu1* this, PlayState* play) { frameCount = Animation_GetLastFrame(&gRutoChildTransitionFromSwimOnBackAnim); Animation_Change(&this->skelAnime, &gRutoChildTransitionFromSwimOnBackAnim, 1.0, 0, frameCount, ANIMMODE_ONCE, -8.0f); - this->action = 6; + this->action = ENRU1_ACTION_06; } } } @@ -807,7 +825,7 @@ void func_80AEC2C0(EnRu1* this, PlayState* play) { void EnRu1_InitInJabuJabuHolesRoom(EnRu1* this, PlayState* play) { if (!GET_INFTABLE(INFTABLE_141)) { EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); - this->action = 7; + this->action = ENRU1_ACTION_07; EnRu1_SetMouth(this, ENRU1_MOUTH_FROWNING); } else if (GET_INFTABLE(INFTABLE_147) && !GET_INFTABLE(INFTABLE_140) && !GET_INFTABLE(INFTABLE_145)) { if (!func_80AEB020(this, play)) { @@ -815,9 +833,9 @@ void EnRu1_InitInJabuJabuHolesRoom(EnRu1* this, PlayState* play) { EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); actorRoom = this->actor.room; - this->action = 22; + this->action = ENRU1_ACTION_22; this->actor.room = -1; - this->drawConfig = 0; + this->drawConfig = ENRU1_DRAW_NOTHING; this->roomNum1 = actorRoom; this->roomNum3 = actorRoom; this->roomNum2 = actorRoom; @@ -907,7 +925,7 @@ void func_80AEC780(EnRu1* this, PlayState* play) { play->csCtx.script = gRutoFirstMeetingCs; gSaveContext.cutsceneTrigger = 1; player->speedXZ = 0.0f; - this->action = 8; + this->action = ENRU1_ACTION_08; } } @@ -923,8 +941,8 @@ void func_80AEC81C(EnRu1* this, PlayState* play) { newRotY = cue->rot.y; this->actor.shape.rot.y = newRotY; this->actor.world.rot.y = newRotY; - this->action = 9; - this->drawConfig = 1; + this->action = ENRU1_ACTION_09; + this->drawConfig = ENRU1_DRAW_OPA; } } @@ -932,7 +950,7 @@ void func_80AEC8B8(EnRu1* this, PlayState* play) { if (func_80AEAFA0(play, 3, 3)) { Animation_Change(&this->skelAnime, &gRutoChildTurnAroundAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildTurnAroundAnim), ANIMMODE_ONCE, -8.0f); - this->action = 10; + this->action = ENRU1_ACTION_10; } } @@ -941,7 +959,7 @@ void func_80AEC93C(EnRu1* this, UNK_TYPE arg1) { Animation_Change(&this->skelAnime, &gRutoChildWalkAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildWalkAnim), ANIMMODE_LOOP, -8.0f); this->actor.world.rot.y += 0x8000; - this->action = 0xB; + this->action = ENRU1_ACTION_11; this->unk_26C = 0.0f; } } @@ -949,7 +967,7 @@ void func_80AEC93C(EnRu1* this, UNK_TYPE arg1) { void func_80AEC9C4(EnRu1* this) { this->unk_26C += 1.0f; if (this->unk_26C >= 8.0f) { - this->action = 12; + this->action = ENRU1_ACTION_12; this->unk_26C = 0.0f; this->actor.velocity.y = -1.0f; } @@ -959,7 +977,7 @@ void func_80AECA18(EnRu1* this) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { s32 pad; - this->action = 13; + this->action = ENRU1_ACTION_13; this->unk_26C = 0.0f; this->actor.velocity.y = 0.0f; } @@ -968,7 +986,7 @@ void func_80AECA18(EnRu1* this) { void func_80AECA44(EnRu1* this, PlayState* play) { if (func_80AEAFA0(play, 5, 3)) { SET_INFTABLE(INFTABLE_141); - this->action = 14; + this->action = ENRU1_ACTION_14; } } @@ -1051,7 +1069,7 @@ void func_80AECCB0(EnRu1* this, PlayState* play) { void EnRu1_InitInBossRoom(EnRu1* this, PlayState* play) { EnRu1_AnimationChange(this, &gRutoChildWaitHandsOnHipsAnim, ANIMMODE_LOOP, 0, false); - this->action = 15; + this->action = ENRU1_ACTION_15; this->actor.shape.yOffset = -10000.0f; EnRu1_SetEyes(this, ENRU1_EYES_BLUSH); EnRu1_SetMouth(this, ENRU1_MOUTH_OPEN); @@ -1129,12 +1147,12 @@ void func_80AED0B0(EnRu1* this, s32 state) { } void func_80AED0C8(EnRu1* this, PlayState* play) { - this->action = 16; + this->action = ENRU1_ACTION_16; } void func_80AED0D8(EnRu1* this, PlayState* play) { - this->action = 17; - this->drawConfig = 1; + this->action = ENRU1_ACTION_17; + this->drawConfig = ENRU1_DRAW_OPA; this->actor.world.rot.y = this->actor.yawTowardsPlayer; this->actor.shape.rot.y = this->actor.yawTowardsPlayer; func_80AECCB0(this, play); @@ -1142,7 +1160,7 @@ void func_80AED0D8(EnRu1* this, PlayState* play) { void func_80AED110(EnRu1* this) { if (this->actor.shape.yOffset >= 0.0f) { - this->action = 18; + this->action = ENRU1_ACTION_18; this->actor.shape.yOffset = 0.0f; func_80AED0B0(this, WARP_BLUE_RUTO_STATE_READY); } @@ -1150,7 +1168,7 @@ void func_80AED110(EnRu1* this) { void func_80AED154(EnRu1* this, PlayState* play) { if (func_80AED084(this, WARP_BLUE_RUTO_STATE_ENTERED)) { - this->action = 0x13; + this->action = ENRU1_ACTION_19; this->unk_26C = 0.0f; func_80AECEB4(this, play); } @@ -1161,7 +1179,7 @@ void func_80AED19C(EnRu1* this, s32 cond) { Animation_Change(&this->skelAnime, &gRutoChildTransitionHandsOnHipToCrossArmsAndLegsAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildTransitionHandsOnHipToCrossArmsAndLegsAnim), ANIMMODE_ONCE, -8.0f); - this->action = 20; + this->action = ENRU1_ACTION_20; func_80AED0B0(this, WARP_BLUE_RUTO_STATE_3); } } @@ -1175,7 +1193,7 @@ void func_80AED218(EnRu1* this, UNK_TYPE arg1) { } else if (func_80AED084(this, WARP_BLUE_RUTO_STATE_WARPING)) { Animation_Change(&this->skelAnime, &gRutoChildWaitInBlueWarpAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildWaitInBlueWarpAnim), ANIMMODE_ONCE, -8.0f); - this->action = 21; + this->action = ENRU1_ACTION_21; this->unk_27C = this->actor.xzDistToPlayer; } } @@ -1223,7 +1241,7 @@ void EnRu1_InitInJabuJabuBasement(EnRu1* this, PlayState* play) { EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); actorRoom = this->actor.room; - this->action = 22; + this->action = ENRU1_ACTION_22; this->actor.room = -1; this->roomNum1 = actorRoom; this->roomNum3 = actorRoom; @@ -1273,9 +1291,9 @@ s32 func_80AED624(EnRu1* this, PlayState* play) { Actor_Kill(&this->actor); return false; } else if (((this->roomNum1 != curRoomNum) || (this->roomNum2 != curRoomNum)) && - (this->actor.depthInWater > kREG(16) + 50.0f) && (this->action != 33)) { - this->action = 33; - this->drawConfig = 2; + (this->actor.depthInWater > kREG(16) + 50.0f) && (this->action != ENRU1_ACTION_33)) { + this->action = ENRU1_ACTION_33; + this->drawConfig = ENRU1_DRAW_XLU; this->alpha = 0xFF; this->unk_2A4 = 0.0f; } @@ -1598,8 +1616,8 @@ s32 func_80AEE394(EnRu1* this, PlayState* play) { func_80AEE02C(this); play->csCtx.script = gRutoObtainingSapphireCs; gSaveContext.cutsceneTrigger = 1; - this->action = 36; - this->drawConfig = 0; + this->action = ENRU1_ACTION_36; + this->drawConfig = ENRU1_DRAW_NOTHING; this->bigOctoPlatform = (BgBdanObjects*)dynaPolyActor; this->actor.shape.shadowAlpha = 0; return true; @@ -1614,14 +1632,14 @@ void func_80AEE488(EnRu1* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { curRoomNum = play->roomCtx.curRoom.num; this->roomNum3 = curRoomNum; - this->action = 31; + this->action = ENRU1_ACTION_31; func_80AED520(this, play); } else if (!func_80AEE394(this, play) && !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) { s32 pad; this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f); this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f); - this->action = 28; + this->action = ENRU1_ACTION_28; } } @@ -1633,13 +1651,13 @@ void func_80AEE568(EnRu1* this, PlayState* play) { func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); - this->action = 27; + this->action = ENRU1_ACTION_27; EnRu1_DisableSittingOC(this); return; } if (this->actor.depthInWater > 0.0f) { - this->action = 29; + this->action = ENRU1_ACTION_29; this->waterState = ENRU1_WATER_OUTSIDE; } } @@ -1653,7 +1671,7 @@ void func_80AEE628(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildSittingAnim), ANIMMODE_LOOP, -8.0f); SET_INFTABLE(INFTABLE_144); - this->action = 31; + this->action = ENRU1_ACTION_31; } this->roomNum3 = curRoomNum; } @@ -1667,7 +1685,7 @@ s32 func_80AEE6D0(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildSeesSapphireAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f); func_80AED600(this); - this->action = 34; + this->action = ENRU1_ACTION_34; this->unk_26C = 0.0f; play->csCtx.script = gRutoFoundSapphireCs; gSaveContext.cutsceneTrigger = 1; @@ -1694,7 +1712,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { this->actor.minVelocityY = -((kREG(24) * 0.01f) + 6.8f); this->actor.gravity = -((kREG(23) * 0.01f) + 1.3f); func_80AED57C(this); - this->action = 28; + this->action = ENRU1_ACTION_28; *carryIdleTimer = 0.0f; } else if (func_80AEE6D0(this, play)) { s32 pad; @@ -1704,7 +1722,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { player = GET_PLAYER(play); if (player->stateFlags2 & PLAYER_STATE2_IDLE_FIDGET) { this->carryIdleTimer += 1.0f; - if (this->action != 32) { + if (this->action != ENRU1_ACTION_32) { if (*carryIdleTimer > 30.0f) { if (Rand_S16Offset(0, 3) == 0) { f32 frameCount = Animation_GetLastFrame(&gRutoChildSquirmAnim); @@ -1712,7 +1730,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildSquirmAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); func_80AED5DC(this); - this->action = 32; + this->action = ENRU1_ACTION_32; } *carryIdleTimer = 0.0f; } @@ -1722,7 +1740,7 @@ void EnRu1_UpdateCarriedBehavior(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildSittingAnim, 1.0f, 0, frameCount, ANIMMODE_LOOP, -8.0f); - this->action = 31; + this->action = ENRU1_ACTION_31; *carryIdleTimer = 0.0f; } } @@ -1741,7 +1759,7 @@ s32 EnRu1_CheckHitBottomUnderwater(EnRu1* this, PlayState* play) { func_80AEE02C(this); Actor_OfferCarry(&this->actor, play); - this->action = 27; + this->action = ENRU1_ACTION_27; EnRu1_DisableSittingOC(this); return true; } @@ -1749,8 +1767,8 @@ s32 EnRu1_CheckHitBottomUnderwater(EnRu1* this, PlayState* play) { } void EnRu1_CheckSinkingState(EnRu1* this, PlayState* play) { - if ((EnRu1_CheckHitBottomUnderwater(this, play) == 0) && (this->waterState == ENRU1_WATER_SINKING)) { - this->action = 30; + if ((!EnRu1_CheckHitBottomUnderwater(this, play)) && (this->waterState == ENRU1_WATER_SINKING)) { + this->action = ENRU1_ACTION_30; func_80AEE02C(this); this->actor.gravity = -0.1f; this->actor.minVelocityY = -((kREG(18) * 0.1f) + 0.7f); @@ -1881,7 +1899,7 @@ s32 func_80AEF0BC(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildSitAnim, 1.0f, 0, frameCount, ANIMMODE_ONCE, -8.0f); play->msgCtx.msgMode = MSGMODE_PAUSED; - this->action = 26; + this->action = ENRU1_ACTION_26; this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); return true; } @@ -1890,7 +1908,7 @@ s32 func_80AEF0BC(EnRu1* this, PlayState* play) { void func_80AEF170(EnRu1* this, PlayState* play, s32 cond) { if (cond) { - this->action = 25; + this->action = ENRU1_ACTION_25; } } @@ -1898,7 +1916,7 @@ void func_80AEF188(EnRu1* this, PlayState* play) { if (func_80AEB174(play) && !func_80AEF0BC(this, play)) { Message_CloseTextbox(play); SET_INFTABLE(INFTABLE_142); - this->action = 24; + this->action = ENRU1_ACTION_24; } } @@ -1910,18 +1928,18 @@ void func_80AEF1F0(EnRu1* this, PlayState* play, UNK_TYPE arg2) { SET_INFTABLE(INFTABLE_143); func_80AED6DC(this, play); Actor_OfferCarry(&this->actor, play); - this->action = 27; + this->action = ENRU1_ACTION_27; EnRu1_DisableSittingOC(this); } } void func_80AEF29C(EnRu1* this, PlayState* play) { - this->action = 23; + this->action = ENRU1_ACTION_23; } void func_80AEF2AC(EnRu1* this, PlayState* play) { - this->action = 24; - this->drawConfig = 1; + this->action = ENRU1_ACTION_24; + this->drawConfig = ENRU1_DRAW_OPA; this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY; } @@ -2032,8 +2050,8 @@ void func_80AEF624(EnRu1* this, PlayState* play) { Animation_Change(&this->skelAnime, &gRutoChildWalkToAndHoldUpSapphireAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, 0.0f); func_80AEB3A4(this, play); - this->action = 37; - this->drawConfig = 1; + this->action = ENRU1_ACTION_37; + this->drawConfig = ENRU1_DRAW_OPA; this->actor.shape.shadowAlpha = 0xFF; } } @@ -2043,7 +2061,7 @@ void func_80AEF728(EnRu1* this, UNK_TYPE arg1) { Animation_Change(&this->skelAnime, &gRutoChildHoldArmsUpAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gRutoChildHoldArmsUpAnim), ANIMMODE_LOOP, 0.0f); func_80AEB3CC(this); - this->action = 38; + this->action = ENRU1_ACTION_38; } } @@ -2051,7 +2069,7 @@ void func_80AEF79C(EnRu1* this, PlayState* play) { if (func_80AEAFE0(play, 2, 3)) { Animation_Change(&this->skelAnime, &gRutoChildBringHandsDownAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildBringHandsDownAnim), ANIMMODE_ONCE, -8.0f); - this->action = 39; + this->action = ENRU1_ACTION_39; } } @@ -2059,7 +2077,7 @@ void func_80AEF820(EnRu1* this, UNK_TYPE arg1) { if (arg1 != 0) { Animation_Change(&this->skelAnime, &gRutoChildWait2Anim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildWait2Anim), ANIMMODE_LOOP, -8.0f); - this->action = 40; + this->action = ENRU1_ACTION_40; } } @@ -2072,7 +2090,7 @@ void func_80AEF890(EnRu1* this, PlayState* play) { SET_INFTABLE(INFTABLE_145); Flags_SetSwitch(play, EnRu1_GetSwitchFlag(this)); EnRu1_SetPlatformCamSetting(this, 1); - this->action = 42; + this->action = ENRU1_ACTION_42; this->actor.room = curRoomNum; } } @@ -2087,8 +2105,8 @@ void func_80AEF930(EnRu1* this, PlayState* play) { Message_StartTextbox(play, this->actor.textId, NULL); #endif func_80AEF4A8(this, play); - this->action = 43; - this->drawConfig = 0; + this->action = ENRU1_ACTION_43; + this->drawConfig = ENRU1_DRAW_NOTHING; } } @@ -2178,7 +2196,7 @@ void EnRu1_InitInSapphireRoom(EnRu1* this, PlayState* play) { s32 pad; EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); - this->action = 41; + this->action = ENRU1_ACTION_41; this->bigOctoPlatform = EnRu1_FindBigOctoPlatform(play); EnRu1_SetPlatformCamSetting(this, 1); this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY); @@ -2190,8 +2208,8 @@ void EnRu1_InitInSapphireRoom(EnRu1* this, PlayState* play) { void func_80AEFCE8(EnRu1* this, PlayState* play) { this->bigOctoPlatform = EnRu1_FindBigOctoPlatform(play); if (this->bigOctoPlatform != NULL) { - this->action = 42; - this->drawConfig = 1; + this->action = ENRU1_ACTION_42; + this->drawConfig = ENRU1_DRAW_OPA; EnRu1_SetPlatformCamSetting(this, 1); } } @@ -2200,8 +2218,8 @@ void EnRu1_InitBesideKingZora(EnRu1* this, PlayState* play) { if (GET_EVENTCHKINF(EVENTCHKINF_37) && LINK_IS_CHILD) { EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); this->actor.flags &= ~ACTOR_FLAG_UPDATE_CULLING_DISABLED; - this->action = 44; - this->drawConfig = 1; + this->action = ENRU1_ACTION_44; + this->drawConfig = ENRU1_DRAW_OPA; } else { Actor_Kill(&this->actor); } @@ -2230,13 +2248,13 @@ s32 func_80AEFE38(EnRu1* this, PlayState* play) { void func_80AEFE84(EnRu1* this, PlayState* play, s32 cond) { if (cond) { - this->action = 45; + this->action = ENRU1_ACTION_45; } } void func_80AEFE9C(EnRu1* this, PlayState* play) { if (func_80AEFE38(this, play)) { - this->action = 44; + this->action = ENRU1_ACTION_44; } } @@ -2267,9 +2285,9 @@ void EnRu1_InitBesideDoorSwitch(EnRu1* this, PlayState* play) { (!(func_80AEB020(this, play)))) { EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); actorRoom = this->actor.room; - this->action = 22; + this->action = ENRU1_ACTION_22; this->actor.room = -1; - this->drawConfig = 0; + this->drawConfig = ENRU1_DRAW_NOTHING; this->roomNum1 = actorRoom; this->roomNum3 = actorRoom; this->roomNum2 = actorRoom; @@ -2283,7 +2301,7 @@ void EnRu1_InitBesideDoorSwitch(EnRu1* this, PlayState* play) { #if DEBUG_FEATURES void func_80AF0050(EnRu1* this, PlayState* play) { EnRu1_AnimationChange(this, &gRutoChildWait2Anim, ANIMMODE_LOOP, 0, false); - this->action = 36; + this->action = ENRU1_ACTION_36; this->roomNum1 = this->actor.room; this->bigOctoPlatform = EnRu1_FindBigOctoPlatform(play); this->actor.room = -1; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h index 6968b6fb0d..52e89effd1 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.h @@ -60,6 +60,61 @@ typedef struct EnRu1 { /* 0x0374 */ NpcInteractInfo interactInfo; } EnRu1; // size = 0x039C +typedef enum EnRu1Action { + /* 0 */ ENRU1_ACTION_00, + /* 1 */ ENRU1_ACTION_01, + /* 2 */ ENRU1_ACTION_02, + /* 3 */ ENRU1_ACTION_03, + /* 4 */ ENRU1_ACTION_04, + /* 5 */ ENRU1_ACTION_05, + /* 6 */ ENRU1_ACTION_06, + /* 7 */ ENRU1_ACTION_07, + /* 8 */ ENRU1_ACTION_08, + /* 9 */ ENRU1_ACTION_09, + /* 10 */ ENRU1_ACTION_10, + /* 11 */ ENRU1_ACTION_11, + /* 12 */ ENRU1_ACTION_12, + /* 13 */ ENRU1_ACTION_13, + /* 14 */ ENRU1_ACTION_14, + /* 15 */ ENRU1_ACTION_15, + /* 16 */ ENRU1_ACTION_16, + /* 17 */ ENRU1_ACTION_17, + /* 18 */ ENRU1_ACTION_18, + /* 19 */ ENRU1_ACTION_19, + /* 20 */ ENRU1_ACTION_20, + /* 21 */ ENRU1_ACTION_21, + /* 22 */ ENRU1_ACTION_22, + /* 23 */ ENRU1_ACTION_23, + /* 24 */ ENRU1_ACTION_24, + /* 25 */ ENRU1_ACTION_25, + /* 26 */ ENRU1_ACTION_26, + /* 27 */ ENRU1_ACTION_27, + /* 28 */ ENRU1_ACTION_28, + /* 29 */ ENRU1_ACTION_29, + /* 30 */ ENRU1_ACTION_30, + /* 31 */ ENRU1_ACTION_31, + /* 32 */ ENRU1_ACTION_32, + /* 33 */ ENRU1_ACTION_33, + /* 34 */ ENRU1_ACTION_34, + /* 35 */ ENRU1_ACTION_35, + /* 36 */ ENRU1_ACTION_36, + /* 37 */ ENRU1_ACTION_37, + /* 38 */ ENRU1_ACTION_38, + /* 39 */ ENRU1_ACTION_39, + /* 40 */ ENRU1_ACTION_40, + /* 41 */ ENRU1_ACTION_41, + /* 42 */ ENRU1_ACTION_42, + /* 43 */ ENRU1_ACTION_43, + /* 44 */ ENRU1_ACTION_44, + /* 45 */ ENRU1_ACTION_45 +} EnRu1Action; + +typedef enum EnRu1DrawConfig { + /* 0 */ ENRU1_DRAW_NOTHING, + /* 1 */ ENRU1_DRAW_OPA, + /* 2 */ ENRU1_DRAW_XLU +} EnRu1DrawConfig; + typedef enum EnRu1Type { /* 0 */ ENRU1_TYPE_BOSS_ROOM, /* 1 */ ENRU1_TYPE_FOUNTAIN, @@ -73,6 +128,28 @@ typedef enum EnRu1Type { #endif } EnRu1Type; +typedef enum EnRu1Eyes { + /* 0 */ ENRU1_EYES_OPEN, + /* 1 */ ENRU1_EYES_HALF_BLINK, + /* 2 */ ENRU1_EYES_CLOSED, + /* 3 */ ENRU1_EYES_UP, + /* 4 */ ENRU1_EYES_GAZING, + /* 5 */ ENRU1_EYES_BLUSH +} EnRu1Eyes; + +typedef enum EnRu1Mouth { + /* 0 */ ENRU1_MOUTH_SMILING, + /* 1 */ ENRU1_MOUTH_FROWNING, + /* 2 */ ENRU1_MOUTH_OPEN +} EnRu1Mouth; + +typedef enum EnRu1WaterState { + /* 0 */ ENRU1_WATER_OUTSIDE, + /* 1 */ ENRU1_WATER_IMMERSED, + /* 2 */ ENRU1_WATER_BOBBING, + /* 3 */ ENRU1_WATER_SINKING +} EnRu1WaterState; + typedef enum RutoLimb { /* 0 */ RUTO_CHILD_NONE, /* 1 */ RUTO_CHILD_ROOT,