Merge branch 'zret' of github.com:HarbourMasters/mm into zret

This commit is contained in:
Alejandro Javier Asenjo Nitti
2023-10-31 21:38:51 -03:00
34 changed files with 3511 additions and 443 deletions
+46 -40
View File
@@ -1,35 +1,37 @@
<Root>
<ExternalFile XmlPath="objects/gameplay_keep.xml" OutPath="assets/objects/gameplay_keep/"/>
<!-- Assets for the composer brothers Flat and Sharp -->
<File Name="object_po_composer" Segment="6">
<Animation Name="object_po_composer_Anim_00020C" Offset="0x20C" />
<Animation Name="object_po_composer_Anim_000570" Offset="0x570" />
<Animation Name="object_po_composer_Anim_000A58" Offset="0xA58" />
<Animation Name="object_po_composer_Anim_001420" Offset="0x1420" />
<Animation Name="object_po_composer_Anim_0015B8" Offset="0x15B8" />
<Animation Name="object_po_composer_Anim_00188C" Offset="0x188C" />
<Animation Name="object_po_composer_Anim_001F44" Offset="0x1F44" />
<Animation Name="object_po_composer_Anim_0023E8" Offset="0x23E8" />
<Animation Name="object_po_composer_Anim_002AE0" Offset="0x2AE0" />
<Animation Name="object_po_composer_Anim_003024" Offset="0x3024" />
<Animation Name="object_po_composer_Anim_00334C" Offset="0x334C" />
<Animation Name="object_po_composer_Anim_003954" Offset="0x3954" />
<Animation Name="object_po_composer_Anim_003DB0" Offset="0x3DB0" />
<Texture Name="object_po_composer_Tex_003DC0" OutName="tex_003DC0" Format="i8" Width="32" Height="64" Offset="0x3DC0" />
<!-- Animations -->
<Animation Name="gPoeComposerAttackAnim" Offset="0x20C" />
<Animation Name="gPoeComposerRaiseArmsAnim" Offset="0x570" />
<Animation Name="gPoeComposerBeginPlayAnim" Offset="0xA58" />
<Animation Name="gPoeComposerPlayAnim" Offset="0x1420" />
<Animation Name="gPoeComposerFleeAnim" Offset="0x15B8" />
<Animation Name="gPoeComposerIdleAnim" Offset="0x188C" />
<Animation Name="gPoeComposerArmsRaisedAnim" Offset="0x1F44" />
<Animation Name="gPoeComposerLowerArmsAnim" Offset="0x23E8" />
<Animation Name="gPoeComposerLookingDownAnim" Offset="0x2AE0" />
<Animation Name="gPoeComposerBeginRollAnim" Offset="0x3024" />
<Animation Name="gPoeComposerRollAnim" Offset="0x334C" />
<Animation Name="gPoeComposerAppearDisappearAnim" Offset="0x3954" />
<Animation Name="gPoeComposerStillAnim" Offset="0x3DB0" />
<!-- Texture -->
<Texture Name="gPoeComposerSoulTex" OutName="composer_soul" Format="i8" Width="32" Height="64" Offset="0x3DC0" />
<!-- Display Lists -->
<DList Name="object_po_composer_DL_004600" Offset="0x4600" />
<DList Name="object_po_composer_DL_0052E0" Offset="0x52E0" />
<DList Name="object_po_composer_DL_0054E0" Offset="0x54E0" />
<DList Name="object_po_composer_DL_0055D0" Offset="0x55D0" />
<DList Name="object_po_composer_DL_005898" Offset="0x5898" />
<DList Name="object_po_composer_DL_005948" Offset="0x5948" />
<DList Name="object_po_composer_DL_005A00" Offset="0x5A00" />
<DList Name="object_po_composer_DL_005CB8" Offset="0x5CB8" />
<DList Name="object_po_composer_DL_005D68" Offset="0x5D68" />
<DList Name="object_po_composer_DL_006A70" Offset="0x6A70" />
<DList Name="gPoeComposerSharpHeadDL" Offset="0x6A70" />
<DList Name="object_po_composer_DL_006D80" Offset="0x6D80" />
<DList Name="object_po_composer_DL_006E08" Offset="0x6E08" />
<DList Name="object_po_composer_DL_006EA8" Offset="0x6EA8" />
<DList Name="object_po_composer_DL_006F38" Offset="0x6F38" />
<DList Name="object_po_composer_DL_006FD8" Offset="0x6FD8" />
<DList Name="object_po_composer_DL_007BC0" Offset="0x7BC0" />
<DList Name="gPoeComposerLanternBaseDL" Offset="0x6E08" />
<DList Name="gPoeComposerLanternTopDL" Offset="0x6EA8" />
<DList Name="gPoeComposerLanternGlassDL" Offset="0x6F38" />
<DList Name="gPoeComposerFlatHeadDL" Offset="0x6FD8" />
<DList Name="gPoeComposerBurnDL" Offset="0x7BC0" />
<!-- Textures -->
<Texture Name="object_po_composer_Tex_007E80" OutName="tex_007E80" Format="rgba16" Width="16" Height="16" Offset="0x7E80" />
<Texture Name="object_po_composer_Tex_008080" OutName="tex_008080" Format="rgba16" Width="16" Height="16" Offset="0x8080" />
<Texture Name="object_po_composer_Tex_008280" OutName="tex_008280" Format="rgba16" Width="16" Height="16" Offset="0x8280" />
@@ -42,17 +44,21 @@
<Texture Name="object_po_composer_Tex_009280" OutName="tex_009280" Format="rgba16" Width="16" Height="16" Offset="0x9280" />
<Texture Name="object_po_composer_Tex_009480" OutName="tex_009480" Format="rgba16" Width="16" Height="16" Offset="0x9480" />
<Texture Name="object_po_composer_Tex_009680" OutName="tex_009680" Format="rgba16" Width="16" Height="16" Offset="0x9680" />
<Limb Name="object_po_composer_Standardlimb_009880" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_01" Offset="0x9880" />
<Limb Name="object_po_composer_Standardlimb_00988C" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_02" Offset="0x988C" />
<Limb Name="object_po_composer_Standardlimb_009898" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_03" Offset="0x9898" />
<Limb Name="object_po_composer_Standardlimb_0098A4" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_04" Offset="0x98A4" />
<Limb Name="object_po_composer_Standardlimb_0098B0" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_05" Offset="0x98B0" />
<Limb Name="object_po_composer_Standardlimb_0098BC" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_06" Offset="0x98BC" />
<Limb Name="object_po_composer_Standardlimb_0098C8" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_07" Offset="0x98C8" />
<Limb Name="object_po_composer_Standardlimb_0098D4" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_08" Offset="0x98D4" />
<Limb Name="object_po_composer_Standardlimb_0098E0" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_09" Offset="0x98E0" />
<Limb Name="object_po_composer_Standardlimb_0098EC" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_0A" Offset="0x98EC" />
<Limb Name="object_po_composer_Standardlimb_0098F8" Type="Standard" EnumName="OBJECT_PO_COMPOSER_LIMB_0B" Offset="0x98F8" />
<Skeleton Name="object_po_composer_Skel_009930" Type="Flex" LimbType="Standard" LimbNone="OBJECT_PO_COMPOSER_LIMB_NONE" LimbMax="OBJECT_PO_COMPOSER_LIMB_MAX" EnumName="ObjectPoComposerLimb" Offset="0x9930" />
<!-- Limbs -->
<Limb Name="gPoeComposerUpperBodyLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_UPPER_BODY" Offset="0x9880" />
<Limb Name="gPoeComposerLeftShoulderLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_LEFT_SHOULDER" Offset="0x988C" />
<Limb Name="gPoeComposerLeftArmLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_LEFT_ARM" Offset="0x9898" />
<Limb Name="gPoeComposerLeftHandLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_LEFT_HAND" Offset="0x98A4" />
<Limb Name="gPoeComposerConductorBatonLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_CONDUCTOR_BATON" Offset="0x98B0" />
<Limb Name="gPoeComposerRightShoulderLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_RIGHT_SHOULDER" Offset="0x98BC" />
<Limb Name="gPoeComposerRightArmLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_RIGHT_ARM" Offset="0x98C8" />
<Limb Name="gPoeComposerRightHandLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_RIGHT_HAND" Offset="0x98D4" />
<Limb Name="gPoeComposerLanternLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_LANTERN" Offset="0x98E0" />
<Limb Name="gPoeComposerHeadLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_HEAD" Offset="0x98EC" />
<Limb Name="gPoeComposerLowerBodyLimb" Type="Standard" EnumName="POE_COMPOSER_LIMB_LOWER_BODY" Offset="0x98F8" />
<!-- Skeleton -->
<Skeleton Name="gPoeComposerSkel" Type="Flex" LimbType="Standard" LimbNone="POE_COMPOSER_LIMB_NONE" LimbMax="POE_COMPOSER_LIMB_MAX" EnumName="PoComposerLimb" Offset="0x9930" />
</File>
</Root>
+26
View File
@@ -29,6 +29,32 @@ typedef struct {
/* 0x14 */ u16 distance[5]; // Distance value
} OSVoiceData; // size = 0x20
#define VOICE_STATUS_READY 0 /* stop/end */
#define VOICE_STATUS_START 1 /* Voice Undetected (no voice input) */
#define VOICE_STATUS_CANCEL 3 /* Cancel (cancel extraneous noise) */
#define VOICE_STATUS_BUSY 5 /* Detected/Detecting (voice being input, recognition processing under way) */
#define VOICE_STATUS_END 7 /* End recognition processing (enable execution of Get Recognition Results command) */
#define VOICE_WARN_TOO_SMALL 0x400 /* Voice level is too low (100 < Voice Level < 150) */
#define VOICE_WARN_TOO_LARGE 0x800 /* Voice level is too high (Voice Level > 3500) */
#define VOICE_WARN_NOT_FIT 0x4000 /* No words match recognition word (No. 1 Candidate Distance Value > 1600) */
#define VOICE_WARN_TOO_NOISY 0x8000 /* Too much ambient noise (Relative Voice Level =< 400) */
typedef struct {
/* 0x000 */ u16 words[20][15]; // 20 words, each with up to 15 syllables
/* 0x258 */ u8 numWords;
} OSVoiceDictionary; // size = 0x25C
typedef struct {
/* 0x00 */ OSVoiceDictionary* dict;
/* 0x04 */ s8 mode;
/* 0x08 */ OSVoiceData* data;
/* 0x0C */ u16 distance;
/* 0x0E */ u16 answerNum;
/* 0x10 */ u16 warning;
/* 0x12 */ u16 voiceLevel;
/* 0x14 */ u16 voiceRelLevel;
} OSVoiceUnk; // size = 0x18
s32 osVoiceInit(OSMesgQueue* mq, OSVoiceHandle* hd, int channel);
s32 osVoiceSetWord(OSVoiceHandle* hd, u8* word);
-19
View File
@@ -1194,25 +1194,6 @@ u8 func_801A3950(u8 seqPlayerIndex, u8 resetChannelIO);
u8 func_801A39F8(void);
s32 func_801A46F8(void);
void func_801A4EB0(void);
// void func_801A4EB8(void);
void func_801A4FD8(void);
void func_801A5080(u16 arg0);
u16 func_801A5100(void);
void func_801A5118(void);
UNK_TYPE func_801A51F0(UNK_TYPE arg0);
// void func_801A5228(void);
// void func_801A5390(void);
// void func_801A53E8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
// void func_801A541C(void);
// void func_801A5488(void);
// void func_801A54C4(void);
// void func_801A54D0(void);
// void func_801A5680(void);
// void func_801A5808(void);
void AudioVoice_ResetData(void);
// void func_801A5A1C(void);
void AudioSfx_MuteBanks(u16 muteMask);
void AudioSfx_LowerBgmVolume(u8 channelIndex);
void AudioSfx_RestoreBgmVolume(u8 channelIndex);
+3 -3
View File
@@ -305,9 +305,9 @@ extern UNK_PTR D_801D8B24;
// extern UNK_TYPE2 D_801D8BD0;
// extern UNK_TYPE4 D_801D8BD4;
// extern UNK_TYPE1 D_801D8BE0;
// extern UNK_TYPE1 D_801D8E3C;
// extern u8 D_801D8E3C;
// extern UNK_TYPE4 D_801D8E40;
// extern UNK_TYPE2 D_801D8E44;
// extern u16 sTopScoreWordId;
// extern UNK_TYPE1 D_801D8E48;
// extern UNK_TYPE1 D_801D8E50;
// extern UNK_TYPE1 D_801D8F70;
@@ -1723,7 +1723,7 @@ extern s32 D_801FD120;
// extern UNK_TYPE1 D_801FD5C4;
// extern UNK_TYPE1 D_801FD5C8;
// extern UNK_TYPE1 D_801FD5E8;
// extern UNK_TYPE1 D_801FD608;
extern u8 sVoiceMaskPattern[];
// extern UNK_TYPE1 D_801FD610;
extern ActiveSfx gActiveSfx[7][3];
extern SeqRequest sSeqRequests[][5];
+2 -3
View File
@@ -1369,11 +1369,10 @@ typedef enum {
#define WEEKEVENTREG_86_20 PACK_WEEKEVENTREG_FLAG(86, 0x20)
#define WEEKEVENTREG_86_40 PACK_WEEKEVENTREG_FLAG(86, 0x40)
#define WEEKEVENTREG_86_80 PACK_WEEKEVENTREG_FLAG(86, 0x80)
#define WEEKEVENTREG_87_01 PACK_WEEKEVENTREG_FLAG(87, 0x01)
// Currently talking to a cow using the voice recognition unit
#define WEEKEVENTREG_TALKING_TO_COW_WITH_VOICE PACK_WEEKEVENTREG_FLAG(87, 0x01)
// Set by Anju
#define WEEKEVENTREG_COUPLES_MASK_CUTSCENE_STARTED PACK_WEEKEVENTREG_FLAG(87, 0x02)
#define WEEKEVENTREG_87_04 PACK_WEEKEVENTREG_FLAG(87, 0x04)
#define WEEKEVENTREG_87_08 PACK_WEEKEVENTREG_FLAG(87, 0x08)
#define WEEKEVENTREG_87_10 PACK_WEEKEVENTREG_FLAG(87, 0x10)
+34
View File
@@ -0,0 +1,34 @@
#ifndef Z64VOICE_H
#define Z64VOICE_H
#include "PR/ultratypes.h"
#include "unk.h"
#include "PR/os_voice.h"
typedef enum {
/* 0 */ VOICE_WORD_ID_HOURS,
/* 1 */ VOICE_WORD_ID_CHEESE,
/* 2 */ VOICE_WORD_ID_WAKE_UP,
/* 3 */ VOICE_WORD_ID_SIT,
/* 4 */ VOICE_WORD_ID_MILK,
/* 5 */ VOICE_WORD_ID_HIYA,
/* 6 */ VOICE_WORD_ID_MAX,
/* -1 */ VOICE_WORD_ID_NONE = 0xFFFF
} OSVoiceWordId;
void func_801A4EB0(void);
void func_801A4FD8(void);
void func_801A5080(u16 wordId);
u16 AudioVoice_GetWord(void);
void func_801A5118(void);
s32 func_801A51F0(s32 errorCode);
s32 func_801A5228(OSVoiceDictionary* dict);
OSVoiceData* func_801A5390(void);
void func_801A53E8(u16 distance, u16 answerNum, u16 warning, u16 voiceLevel, u16 voiceRelLevel);
u8* func_801A54C4(void);
s32 func_801A54D0(u16 wordId);
s32 func_801A5680(u16 wordId);
s32 func_801A5808(void);
void AudioVoice_ResetData(void);
#endif
+4 -12
View File
@@ -591,10 +591,7 @@ beginseg
include "build/asm/code/code_8019AEC0.text.o" // handwritten
include "build/src/audio/code_8019AF00.o"
include "build/src/audio/voice_external.o"
include "build/data/code/voice_external.data.o"
include "build/src/audio/voice_internal.o"
include "build/data/code/voice_internal.data.o"
include "build/data/code/voice_internal.bss.o"
pad_text
include "build/src/audio/sfx_params.o"
include "build/src/audio/sfx.o"
@@ -1333,8 +1330,7 @@ beginseg
name "ovl_En_Honotrap"
compress
include "build/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.o"
include "build/data/ovl_En_Honotrap/ovl_En_Honotrap.data.o"
include "build/data/ovl_En_Honotrap/ovl_En_Honotrap.reloc.o"
include "build/src/overlays/actors/ovl_En_Honotrap/ovl_En_Honotrap_reloc.o"
endseg
beginseg
@@ -2880,9 +2876,7 @@ beginseg
name "ovl_Obj_Mine"
compress
include "build/src/overlays/actors/ovl_Obj_Mine/z_obj_mine.o"
include "build/data/ovl_Obj_Mine/ovl_Obj_Mine.data.o"
include "build/data/ovl_Obj_Mine/ovl_Obj_Mine.bss.o"
include "build/data/ovl_Obj_Mine/ovl_Obj_Mine.reloc.o"
include "build/src/overlays/actors/ovl_Obj_Mine/ovl_Obj_Mine_reloc.o"
endseg
beginseg
@@ -3421,8 +3415,7 @@ beginseg
name "ovl_Bg_Danpei_Movebg"
compress
include "build/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.o"
include "build/data/ovl_Bg_Danpei_Movebg/ovl_Bg_Danpei_Movebg.data.o"
include "build/data/ovl_Bg_Danpei_Movebg/ovl_Bg_Danpei_Movebg.reloc.o"
include "build/src/overlays/actors/ovl_Bg_Danpei_Movebg/ovl_Bg_Danpei_Movebg_reloc.o"
endseg
beginseg
@@ -4221,8 +4214,7 @@ beginseg
name "ovl_En_Po_Composer"
compress
include "build/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.o"
include "build/data/ovl_En_Po_Composer/ovl_En_Po_Composer.data.o"
include "build/data/ovl_En_Po_Composer/ovl_En_Po_Composer.reloc.o"
include "build/src/overlays/actors/ovl_En_Po_Composer/ovl_En_Po_Composer_reloc.o"
endseg
beginseg
+133 -8
View File
@@ -1,17 +1,142 @@
#include "global.h"
#include "z64voice.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A4EB0.s")
extern OSVoiceHandle gVoiceHandle;
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A4EB8.s")
OSVoiceDictionary D_801D8BE0 = {
{
// "アトナンジカン" - "atonanjikan" - "How many hours"
{ 0x8341, 0x8367, 0x8369, 0x8393, 0x8357, 0x834A, 0x8393 },
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A4FD8.s")
// "ハイチーズ" - "haichīzu" - "say cheese"
{ 0x836E, 0x8343, 0x8360, 0x815B, 0x8359 },
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A5080.s")
// "オキロー" - "okirō" - "wake up"
{ 0x8349, 0x834C, 0x838D, 0x815B },
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A50C0.s")
// "オスワリ" - "osuwari" - "sit"
{ 0x8349, 0x8358, 0x838F, 0x838A },
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A5100.s")
// "ミルク" - "miruku" - "milk"
{ 0x837E, 0x838B, 0x834E },
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A510C.s")
// "ハイヤー" - "haiyā" - "hiya!"
{ 0x836E, 0x8343, 0x8384, 0x815B },
},
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_external/func_801A5118.s")
VOICE_WORD_ID_MAX, // number of words
};
u8 D_801D8E3C = 0;
OSVoiceData* D_801D8E40 = NULL;
u16 sTopScoreWordId = VOICE_WORD_ID_NONE;
u8 D_801D8E48 = 0;
void func_801A4EB0(void) {
}
void func_801A4EB8(void) {
u8* new_var;
OSMesgQueue* serialEventQueue;
s32 index;
u8 sp38[1];
u8 i;
if (D_801D8E3C != 0) {
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
osVoiceStopReadData(&gVoiceHandle);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
}
new_var = func_801A54C4();
for (i = 0; i < 1; i++) {
sp38[i] = new_var[i];
}
if (func_801A5228(&D_801D8BE0) == 0) {
for (i = 0; i < VOICE_WORD_ID_MAX; i++) {
index = i / 8;
if (((sp38[index] >> (i % 8)) & 1) == 1) {
func_801A54D0(i);
}
}
func_801A53E8(800, 2, VOICE_WARN_TOO_SMALL, 500, 2000);
D_801D8E3C = 1;
}
}
// Used externally in code_8019AF00
void func_801A4FD8(void) {
s32 errorCode;
OSMesgQueue* serialEventQueue;
func_801A54D0(VOICE_WORD_ID_NONE);
if (D_801D8E3C != 0) {
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
osVoiceStopReadData(&gVoiceHandle);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
errorCode = func_801A5228(&D_801D8BE0);
func_801A54D0(VOICE_WORD_ID_NONE);
if (errorCode == 0) {
func_801A53E8(800, 2, VOICE_WARN_TOO_SMALL, 500, 2000);
D_801D8E3C = 1;
}
func_801A5080(VOICE_WORD_ID_HIYA);
func_801A5080(VOICE_WORD_ID_CHEESE);
}
}
void func_801A5080(u16 wordId) {
if ((D_801D8E3C != 0) && (wordId < VOICE_WORD_ID_MAX)) {
func_801A5680(wordId);
}
}
// Unused
void func_801A50C0(u16 wordId) {
if ((D_801D8E3C != 0) && (wordId < VOICE_WORD_ID_MAX)) {
func_801A54D0(wordId);
}
}
// Used externally in many files
u16 AudioVoice_GetWord(void) {
return sTopScoreWordId;
}
// Unused
u8 func_801A510C(void) {
return D_801D8E3C;
}
// Used externally in Audio_Update (code_8019AF00)
void func_801A5118(void) {
if (D_801D8E3C & 2) {
D_801D8E3C &= 1;
func_801A4EB8();
}
if (D_801D8E3C != 0) {
if (func_801A5808() != 0) {
D_801D8E48++;
if (D_801D8E48 == 10) {
D_801D8E3C = 0;
sTopScoreWordId = VOICE_WORD_ID_NONE;
return;
}
} else {
D_801D8E48 = 0;
}
D_801D8E40 = func_801A5390();
if (D_801D8E40 != 0) {
sTopScoreWordId = D_801D8E40->answer[0];
} else {
sTopScoreWordId = VOICE_WORD_ID_NONE;
}
}
}
+329 -22
View File
@@ -1,42 +1,349 @@
#include "global.h"
#include "z64voice.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/D_801E0EC0.s")
// internal voice functions
u8* func_801A5A1C(s8* words);
UNK_TYPE func_801A51F0(UNK_TYPE arg0) {
switch (arg0) {
case 1:
case 4:
case 5:
case 11:
case 13:
case 14:
case 15:
// BSS
OSVoiceUnk D_801FD5A0;
OSVoiceHandle gVoiceHandle;
OSVoiceData D_801FD5C8; // Intermediate Voice Data during processsing?
OSVoiceData D_801FD5E8; // Best Match Voice Data?
u8 sVoiceMaskPattern[8];
char D_801FD610[256];
// Data
s8 D_801D8E50[96][3] = {
"aa", "AA", "ii", "II", "uu", "UU", "ee", "EE", "oo", "OO", "KA", "GA", "KI", "GI", "KU", "GU",
"KE", "GE", "KO", "GO", "SA", "ZA", "SI", "ZI", "SU", "ZU", "SE", "ZE", "SO", "ZO", "TA", "DA",
"TI", "DI", "tu", "TU", "DU", "TE", "DE", "TO", "DO", "NA", "NI", "NU", "NE", "NO", "HA", "BA",
"PA", "HI", "BI", "PI", "HU", "BU", "PU", "HE", "BE", "PE", "HO", "BO", "PO", "MA", "MI", "MU",
"ME", "MO", "ya", "YA", "yu", "YU", "yo", "YO", "RA", "RI", "RU", "RE", "RO", "wa", "WA", "WI",
"WE", "WO", "NN", "VU", "ka", "ke", "", "", "", "", "", "", "", "", "", "",
};
s8 D_801D8F70[96][3] = {
"aa", "AA", "ii", "II", "uu", "UU", "ee", "EE", "oo", "OO", "KA", "GA", "KI", "GI", "KU", "GU",
"KE", "GE", "KO", "GO", "SA", "ZA", "SI", "ZI", "SU", "ZU", "SE", "ZE", "SO", "ZO", "TA", "DA",
"TI", "DI", "tu", "TU", "DU", "TE", "DE", "TO", "DO", "NA", "NI", "NU", "NE", "NO", "HA", "BA",
"PA", "HI", "BI", "PI", "HU", "BU", "PU", "HE", "BE", "PE", "HO", "BO", "PO", "MA", "MI", " ",
"MU", "ME", "MO", "ya", "YA", "yu", "YU", "yo", "YO", "RA", "RI", "RU", "RE", "RO", "wa", "WA",
"WI", "WE", "WO", "NN", "VU", "ka", "ke", "", "", "", "", "", "", "", "", "",
};
const char D_801E0EC0[] = "Error %d\n";
const char D_801E0ECC[] = "NAI_VRS:osVoiceClearDictionary %d\n";
const char D_801E0EF0[] = "NAI_VRS:dict error! (%d-%d %s)\n";
const char D_801E0F10[] = "NAI_VRS:Ina_SetVruGain Error!\n";
const char D_801E0F30[] = "NAI_VRS:mask on %d\n";
const char D_801E0F48[] = "NAI_VRS:mask off %d\n";
const char D_801E0F60[] = "NAI_VRS:answer No.:%d Dist:%d Warn:%04X Level:%5d SN:%5d (Num:%d)\n";
const char D_801E0FA4[] = "NAI_VRS:error !! (ANS_MAX:%d DIST:%d WARNING:%04X LEVEL:%5d SN:%5d)\n";
s32 func_801A51F0(s32 errorCode) {
switch (errorCode) {
case CONT_ERR_NO_CONTROLLER:
case CONT_ERR_CONTRFAIL:
case CONT_ERR_INVALID:
case CONT_ERR_DEVICE:
case CONT_ERR_VOICE_MEMORY:
case CONT_ERR_VOICE_WORD:
case CONT_ERR_VOICE_NO_RESPONSE:
return -1;
default:
return 0;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5228.s")
s32 func_801A5228(OSVoiceDictionary* dict) {
OSMesgQueue* serialEventQueue;
s32 errorCode;
u8 numWords;
u8 i;
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5390.s")
D_801FD5A0.mode = 0;
D_801FD5A0.data = NULL;
D_801FD5A0.distance = 1000;
D_801FD5A0.answerNum = 5;
D_801FD5A0.warning = 0;
D_801FD5A0.dict = dict;
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A53DC.s")
numWords = dict->numWords;
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A53E8.s")
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceClearDictionary(&gVoiceHandle, numWords);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A541C.s")
if (errorCode != 0) {
return errorCode;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5488.s")
for (i = 0; i < (((numWords - 1) / 8) + 1); i++) {
sVoiceMaskPattern[i] = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A54C4.s")
for (i = 0; i < numWords; i++) {
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceSetWord(&gVoiceHandle, &dict->words[i]);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A54D0.s")
if (func_801A51F0(errorCode) != 0) {
func_801A5A1C(&dict->words[i]);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5680.s")
return errorCode;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5808.s")
OSVoiceData* func_801A5390(void) {
OSVoiceData* voiceData;
OSMesgQueue* serialEventQueue;
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/AudioVoice_ResetData.s")
voiceData = D_801FD5A0.data;
D_801FD5A0.data = NULL;
#pragma GLOBAL_ASM("asm/non_matchings/code/voice_internal/func_801A5A1C.s")
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
osVoiceStartReadData(&gVoiceHandle);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
return voiceData;
}
// Unused
OSVoiceDictionary* func_801A53DC(void) {
return D_801FD5A0.dict;
}
void func_801A53E8(u16 distance, u16 answerNum, u16 warning, u16 voiceLevel, u16 voiceRelLevel) {
D_801FD5A0.distance = distance;
D_801FD5A0.answerNum = answerNum;
D_801FD5A0.warning = warning;
D_801FD5A0.voiceLevel = voiceLevel;
D_801FD5A0.voiceRelLevel = voiceRelLevel;
}
// Unused
// Could have a return? or be void return?
s32 func_801A541C(s32 analog, s32 digital) {
s32 errorCode;
OSMesgQueue* serialEventQueue;
if (D_801FD5A0.dict != NULL) {
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceControlGain(&gVoiceHandle, analog, digital);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
if (errorCode != 0) {
func_801A51F0(errorCode);
}
}
}
// Unused
s32 func_801A5488(u8* word) {
s32 errorCode;
OSMesgQueue* serialEventQueue;
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceCheckWord(word);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
return errorCode;
}
u8* func_801A54C4(void) {
return sVoiceMaskPattern;
}
s32 func_801A54D0(u16 wordId) {
s32 errorCode;
u8 phi_t0 = true;
u8 numWords;
u8 i;
OSMesgQueue* serialEventQueue;
if (D_801FD5A0.dict != NULL) {
numWords = D_801FD5A0.dict->numWords;
} else {
numWords = 20;
phi_t0 = false;
}
if (wordId == VOICE_WORD_ID_NONE) {
for (i = 0; i < numWords; i++) {
sVoiceMaskPattern[i / 8] |= 1 << (i % 8);
}
} else {
if (sVoiceMaskPattern[wordId / 8] & (1 << (wordId % 8))) {
phi_t0 = false;
} else {
sVoiceMaskPattern[wordId / 8] |= (1 << (wordId % 8));
}
}
if (phi_t0) {
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceStopReadData(&gVoiceHandle);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
if ((errorCode == 0) || (D_801FD5A0.mode == 0)) {
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceMaskDictionary(&gVoiceHandle, sVoiceMaskPattern, ((numWords - 1) / 8) + 1);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
}
D_801FD5A0.mode = 0;
}
return errorCode;
}
s32 func_801A5680(u16 wordId) {
s32 errorCode;
u8 phi_a3 = true;
u8 numWords;
u8 i;
OSMesgQueue* serialEventQueue;
if (D_801FD5A0.dict != NULL) {
numWords = D_801FD5A0.dict->numWords;
} else {
numWords = 20;
phi_a3 = false;
}
if (wordId == VOICE_WORD_ID_NONE) {
for (i = 0; i < (((numWords - 1) / 8) + 1); i++) {
sVoiceMaskPattern[i] = 0;
}
} else {
if (!(sVoiceMaskPattern[wordId / 8] & (1 << (wordId % 8)))) {
phi_a3 = false;
} else {
sVoiceMaskPattern[wordId / 8] &= (1 << (wordId % 8)) ^ 0xFF;
}
}
if (phi_a3) {
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceStopReadData(&gVoiceHandle);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
if ((errorCode == 0) || (D_801FD5A0.mode == 0)) {
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceMaskDictionary(&gVoiceHandle, sVoiceMaskPattern, ((numWords - 1) / 8) + 1);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
}
D_801FD5A0.mode = 0;
}
return errorCode;
}
s32 func_801A5808(void) {
s32 errorCode = 0;
s32 ret;
OSMesgQueue* serialEventQueue;
switch (D_801FD5A0.mode) {
case 0:
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceStartReadData(&gVoiceHandle);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
D_801FD5A0.mode = 1;
break;
case 1:
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceGetReadData(&gVoiceHandle, &D_801FD5C8);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
if (func_801A51F0(errorCode) == 0) {
switch (gVoiceHandle.status) {
case VOICE_STATUS_READY:
D_801FD5A0.mode = 2;
break;
case VOICE_STATUS_START:
case 2:
case VOICE_STATUS_CANCEL:
case 4:
case VOICE_STATUS_BUSY:
case 6:
break;
case VOICE_STATUS_END:
D_801FD5A0.mode = 2;
break;
default:
break;
}
}
break;
case 2:
if (((D_801FD5C8.warning & D_801FD5A0.warning) == 0) && (D_801FD5A0.answerNum >= D_801FD5C8.answerNum) &&
(D_801FD5A0.distance >= D_801FD5C8.distance[0]) && (D_801FD5C8.voiceLevel >= D_801FD5A0.voiceLevel) &&
(D_801FD5C8.voiceRelLevel >= D_801FD5A0.voiceRelLevel)) {
D_801FD5E8 = D_801FD5C8;
D_801FD5A0.data = &D_801FD5E8;
}
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
osVoiceStopReadData(&gVoiceHandle);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
serialEventQueue = PadMgr_VoiceAcquireSerialEventQueue();
errorCode = osVoiceStartReadData(&gVoiceHandle);
PadMgr_VoiceReleaseSerialEventQueue(serialEventQueue);
D_801FD5A0.mode = 1;
break;
default:
break;
}
ret = func_801A51F0(errorCode);
return ret;
}
// Unused
void AudioVoice_ResetData(void) {
D_801FD5A0.dict = NULL;
}
u8* func_801A5A1C(s8* words) {
u8 i;
u8 j;
u8 numSyllables = strlen(words); // technically twice the num of syllables
u8 syllable[2];
for (j = 0, i = 0; i < numSyllables; i += 2) {
syllable[0] = words[i];
syllable[1] = words[i + 1];
if (syllable[0] == 0x83) {
D_801FD610[j++] = D_801D8F70[syllable[1] - 0x40][0];
D_801FD610[j++] = D_801D8F70[syllable[1] - 0x40][1];
} else if (syllable[0] == 0x82) {
D_801FD610[j++] = D_801D8E50[syllable[1] - 0x9F][0];
D_801FD610[j++] = D_801D8E50[syllable[1] - 0x9F][1];
} else if ((syllable[0] == 0x81) && (syllable[1] == 0x5B)) {
D_801FD610[j++] = '-';
D_801FD610[j++] = '-';
} else {
D_801FD610[j++] = ' ';
D_801FD610[j++] = ' ';
}
}
D_801FD610[i] = '\0';
return D_801FD610;
}
+1
View File
@@ -35,6 +35,7 @@
#include "PR/controller.h"
#include "PR/os_motor.h"
#include "fault.h"
#include "z64voice.h"
extern FaultMgr gFaultMgr;
-1
View File
@@ -1,4 +1,3 @@
#include "prevent_bss_reordering.h"
#include "z64.h"
#include "regs.h"
#include "functions.h"
+3 -1
View File
@@ -3,6 +3,7 @@
#include "sys_cfb.h"
#include "z64snap.h"
#include "z64view.h"
#include "z64voice.h"
#include "archives/icon_item_static/icon_item_static_yar.h"
#include "interface/parameter_static/parameter_static.h"
#include "interface/do_action_static/do_action_static.h"
@@ -2345,7 +2346,8 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0;
restoreHudVisibility = true;
sPictoState = PICTO_BOX_STATE_OFF;
} else if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) || (func_801A5100() == 1)) {
} else if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) ||
(AudioVoice_GetWord() == VOICE_WORD_ID_CHEESE)) {
if (!CHECK_EVENTINF(EVENTINF_41) ||
(CHECK_EVENTINF(EVENTINF_41) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE))) {
Audio_PlaySfx(NA_SE_SY_CAMERA_SHUTTER);
+2 -2
View File
@@ -33,7 +33,7 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) {
sHandleStatus = data[0] & 7;
hd->status = sHandleStatus;
if ((sHandleStatus != 0) && (sHandleStatus != 7)) {
if ((sHandleStatus != VOICE_STATUS_READY) && (sHandleStatus != VOICE_STATUS_END)) {
return CONT_ERR_NOT_READY;
}
// fallthrough
@@ -88,7 +88,7 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) {
}
hd->status = data[34] & 7;
if ((sHandleStatus == 0) || (hd->status == 0)) {
if ((sHandleStatus == VOICE_STATUS_READY) || (hd->status == VOICE_STATUS_READY)) {
break;
}
// fallthrough
@@ -5,6 +5,7 @@
*/
#include "z_bg_danpei_movebg.h"
#include "objects/object_d_lift/object_d_lift.h"
#define FLAGS (ACTOR_FLAG_10)
@@ -14,7 +15,15 @@ void BgDanpeiMovebg_Init(Actor* thisx, PlayState* play);
void BgDanpeiMovebg_Destroy(Actor* thisx, PlayState* play);
void BgDanpeiMovebg_Update(Actor* thisx, PlayState* play);
#if 0
void func_80AF6EA8(BgDanpeiMovebg* this, PlayState* play);
void func_80AF70FC(BgDanpeiMovebg* this, PlayState* play);
void func_80AF74CC(Actor* thisx, PlayState* play);
u16 func_80AF705C(BgDanpeiMovebg* this, u16 flags);
void func_80AF71FC(BgDanpeiMovebg* this, PlayState* play);
void func_80AF72F8(BgDanpeiMovebg* this, PlayState* play);
void func_80AF7354(BgDanpeiMovebg* this, PlayState* play);
void func_80AF746C(BgDanpeiMovebg* this, PlayState* play);
ActorInit Bg_Danpei_Movebg_InitVars = {
/**/ ACTOR_BG_DANPEI_MOVEBG,
/**/ ACTORCAT_BG,
@@ -27,38 +36,181 @@ ActorInit Bg_Danpei_Movebg_InitVars = {
/**/ NULL,
};
// static InitChainEntry sInitChain[] = {
static InitChainEntry D_80AF753C[] = {
static u16 D_80AF7530[] = { OBJECT_D_LIFT, OBJECT_DANPEI_OBJECT };
static Gfx* D_80AF7534[] = { gDampeGraveBrownElevatorDL };
static CollisionHeader* D_80AF7538[] = { &gDampeGraveBrownElevatorCol };
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
#endif
s32 func_80AF6DE0(PlayState* this, ActorPathing* actorPathing) {
Actor* actor;
s32 res;
extern InitChainEntry D_80AF753C[];
actor = actorPathing->actor;
res = 0;
if (actorPathing->distSqToCurPoint < actor->speed * actor->speed) {
res = 1;
} else {
actor->world.rot.x = actorPathing->rotToCurPoint.x;
actor->world.rot.y = actorPathing->rotToCurPoint.y;
}
return res;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF6DE0.s")
void BgDanpeiMovebg_Init(Actor* thisx, PlayState* play) {
BgDanpeiMovebg* this = THIS;
DynaPolyActor_Init(&this->dyna, 1);
this->bankIdx = SubS_GetObjectSlot(D_80AF7530[BGDANPEIMOVEBG_GET_TYPE(thisx)], play);
if (this->bankIdx < 0) {
Actor_Kill(&this->dyna.actor);
}
this->actionFunc = func_80AF6EA8;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/BgDanpeiMovebg_Init.s")
void func_80AF6EA8(BgDanpeiMovebg* this, PlayState* play) {
Actor* thisx = (Actor*)this;
if (SubS_IsObjectLoaded(this->bankIdx, play)) {
gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->bankIdx].segment);
this->dyna.actor.objectSlot = this->bankIdx;
this->dyna.actor.draw = func_80AF74CC;
Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyActor_LoadMesh(play, &this->dyna, D_80AF7538[BGDANPEIMOVEBG_GET_TYPE(thisx)]);
this->dList = D_80AF7534[BGDANPEIMOVEBG_GET_TYPE(thisx)];
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF6EA8.s")
/* If D_LIFT */
if (BGDANPEIMOVEBG_GET_TYPE(thisx) == 0) {
this->dyna.actor.gravity = 0.0f;
this->dyna.actor.speed = 1.0f;
SubS_ActorPathing_Init(play, &thisx->world.pos, thisx, &this->actorPath, play->setupPathList,
BGDANPEIMOVEBG_GET_PATH_INDEX(thisx), 0, 0, 0, 0);
this->actionFunc = func_80AF70FC;
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/BgDanpeiMovebg_Destroy.s")
void BgDanpeiMovebg_Destroy(Actor* thisx, PlayState* play) {
BgDanpeiMovebg* this = THIS;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/BgDanpeiMovebg_Update.s")
void BgDanpeiMovebg_Update(Actor* thisx, PlayState* play) {
BgDanpeiMovebg* this = THIS;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF705C.s")
this->actionFunc(this, play);
this->prevFlags = this->flags;
this->flags &= ~1;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF70FC.s")
u16 func_80AF705C(BgDanpeiMovebg* this, u16 flags) {
u16 newFlags = flags & ~0x1C;
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF71FC.s")
if (DynaPolyActor_IsActorOnTop(&this->dyna) && (this->flags & 1)) {
newFlags |= 4;
}
if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
newFlags |= 8;
} else {
newFlags |= 0x10;
}
}
return newFlags;
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF72F8.s")
void func_80AF70FC(BgDanpeiMovebg* this, PlayState* play) {
this->flags = func_80AF705C(this, this->flags);
if (this->flags & 0xC) {
if (this->flags & 4) {
this->flags |= 2;
}
this->actionFunc = func_80AF71FC;
} else if (this->flags & 0x10) {
if (!(this->prevFlags & 0x10)) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SINK_WOOD_FLOOR);
}
Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 8.0f, 1.0f, 2.0f, 0.01f);
} else {
if (this->prevFlags & 0x10) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_REBOUND_WOOD_FLOOR);
}
Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 1.0f, 2.0f, 0.01f);
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF7354.s")
void func_80AF71FC(BgDanpeiMovebg* this, PlayState* play) {
SubS_ActorPathing_Update(play, &this->actorPath, SubS_ActorPathing_ComputePointInfo, func_80AF6DE0,
SubS_ActorPathing_MoveWithoutGravityReverse, SubS_ActorPathing_SetNextPoint);
Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_PLATE_LIFT_LEVEL - SFX_FLAG);
if (this->actorPath.flags & ACTOR_PATHING_REACHED_END_TEMPORARY) {
if (this->flags & 2) {
this->flags &= ~0x2;
}
this->actionFunc = func_80AF72F8;
} else {
this->flags = func_80AF705C(this, this->flags);
if ((this->flags & 0x10) || (this->flags & 0xC) == 0xC) {
this->actionFunc = func_80AF746C;
} else if ((this->flags & 0x1C) == 0) {
this->actorPath.flags |= ACTOR_PATHING_MOVE_BACKWARDS;
this->dyna.actor.speed = 2.0f;
this->actionFunc = func_80AF7354;
}
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF746C.s")
void func_80AF72F8(BgDanpeiMovebg* this, PlayState* play) {
this->flags = func_80AF705C(this, this->flags);
if (!(this->flags & 0x1C)) {
this->actorPath.flags |= ACTOR_PATHING_MOVE_BACKWARDS;
this->dyna.actor.speed = 2.0f;
this->actionFunc = func_80AF7354;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Danpei_Movebg/func_80AF74CC.s")
void func_80AF7354(BgDanpeiMovebg* this, PlayState* play) {
Actor_PlaySfx_Flagged(&this->dyna.actor, NA_SE_EV_PLATE_LIFT_LEVEL - SFX_FLAG);
this->flags = func_80AF705C(this, this->flags);
SubS_ActorPathing_Update(play, &this->actorPath, SubS_ActorPathing_ComputePointInfo, func_80AF6DE0,
SubS_ActorPathing_MoveWithoutGravityReverse, SubS_ActorPathing_SetNextPoint);
if ((this->flags & 0x10) || (this->flags & 0xC) == 0xC) {
this->actionFunc = func_80AF746C;
} else if ((this->flags & 0xC) && (this->flags & 0xC) != 0xC) {
this->actorPath.flags &= ~ACTOR_PATHING_MOVE_BACKWARDS;
this->dyna.actor.speed = 1.0f;
if (this->flags & 4) {
this->flags |= 2;
}
this->actionFunc = func_80AF71FC;
}
if (this->actorPath.flags & ACTOR_PATHING_REACHED_END_TEMPORARY) {
this->actorPath.flags &= ~ACTOR_PATHING_MOVE_BACKWARDS;
this->flags &= ~2;
this->dyna.actor.speed = 1.0f;
this->actionFunc = func_80AF70FC;
}
}
void func_80AF746C(BgDanpeiMovebg* this, PlayState* arg1) {
this->flags = func_80AF705C(this, this->flags);
if (!(this->flags & 0x18)) {
if (this->actorPath.flags & ACTOR_PATHING_MOVE_BACKWARDS) {
this->actionFunc = func_80AF7354;
} else {
this->actionFunc = func_80AF71FC;
}
}
}
void func_80AF74CC(Actor* thisx, PlayState* play) {
BgDanpeiMovebg* this = THIS;
if (this->dList != NULL) {
Gfx_DrawDListOpa(play, this->dList);
}
}
@@ -7,12 +7,17 @@ struct BgDanpeiMovebg;
typedef void (*BgDanpeiMovebgActionFunc)(struct BgDanpeiMovebg*, PlayState*);
#define BGDANPEIMOVEBG_GET_PATH_INDEX(thisx) ((thisx)->params & 0x7F)
#define BGDANPEIMOVEBG_GET_TYPE(thisx) (((thisx)->params >> 0xE) & 3)
typedef struct BgDanpeiMovebg {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ BgDanpeiMovebgActionFunc actionFunc;
/* 0x160 */ char unk_160[0x6C];
/* 0x1CC */ u16 unk_1CC;
/* 0x1CE */ char unk_1CE[0xA];
/* 0x160 */ ActorPathing actorPath;
/* 0x1CC */ u16 flags;
/* 0x1CE */ u16 prevFlags;
/* 0x1D0 */ Gfx* dList;
/* 0x1D4 */ s8 bankIdx;
} BgDanpeiMovebg; // size = 0x1D8
#endif // Z_BG_DANPEI_MOVEBG_H
@@ -6,6 +6,7 @@
#include "z_bg_dblue_balance.h"
#include "objects/object_dblue_object/object_dblue_object.h"
#include "prevent_bss_reordering.h"
#define FLAGS 0x00000000
@@ -48,7 +48,6 @@
* - Effect Update/Draw
* - Seaweed
*/
#include "z_boss_03.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
#include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h"
+13 -12
View File
@@ -6,6 +6,7 @@
#include "z_en_cow.h"
#include "z64horse.h"
#include "z64voice.h"
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY)
@@ -132,7 +133,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) {
this->actor.targetMode = TARGET_MODE_6;
gHorsePlayedEponasSong = false;
func_801A5080(4);
func_801A5080(VOICE_WORD_ID_MILK);
break;
case EN_COW_TYPE_TAIL:
@@ -158,7 +159,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.01f);
this->flags = 0;
CLEAR_WEEKEVENTREG(WEEKEVENTREG_87_01);
CLEAR_WEEKEVENTREG(WEEKEVENTREG_TALKING_TO_COW_WITH_VOICE);
}
void EnCow_Destroy(Actor* thisx, PlayState* play) {
@@ -291,11 +292,11 @@ void EnCow_Idle(EnCow* this, PlayState* play) {
}
}
if (this->actor.xzDistToPlayer < 150.0f &&
ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 25000) {
if (func_801A5100() == 4) {
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_87_01)) {
SET_WEEKEVENTREG(WEEKEVENTREG_87_01);
if ((this->actor.xzDistToPlayer < 150.0f) &&
(ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 0x61A8)) {
if (AudioVoice_GetWord() == VOICE_WORD_ID_MILK) {
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKING_TO_COW_WITH_VOICE)) {
SET_WEEKEVENTREG(WEEKEVENTREG_TALKING_TO_COW_WITH_VOICE);
if (Inventory_HasEmptyBottle()) {
this->actor.textId = 0x32C9; // Text to give milk.
} else {
@@ -306,7 +307,7 @@ void EnCow_Idle(EnCow* this, PlayState* play) {
this->actionFunc = EnCow_Talk;
}
} else {
CLEAR_WEEKEVENTREG(WEEKEVENTREG_87_01);
CLEAR_WEEKEVENTREG(WEEKEVENTREG_TALKING_TO_COW_WITH_VOICE);
}
}
@@ -322,8 +323,8 @@ void EnCow_DoTail(EnCow* this, PlayState* play) {
Animation_GetLastFrame(&gCowTailIdleAnim), ANIMMODE_ONCE, 1.0f);
}
if (this->actor.xzDistToPlayer < 150.0f &&
ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) > 25000) {
if ((this->actor.xzDistToPlayer < 150.0f) &&
(ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) > 0x61A8)) {
if (!(this->flags & EN_COW_FLAG_PLAYER_HAS_APPROACHED)) {
this->flags |= EN_COW_FLAG_PLAYER_HAS_APPROACHED;
if (this->skelAnime.animation == &gCowTailIdleAnim) {
@@ -360,8 +361,8 @@ void EnCow_Update(Actor* thisx, PlayState* play2) {
this->actionFunc(this, play);
if (this->actor.xzDistToPlayer < 150.0f &&
ABS_ALT(Math_Vec3f_Yaw(&thisx->world.pos, &player->actor.world.pos)) < 0xC000) {
if ((this->actor.xzDistToPlayer < 150.0f) &&
(ABS_ALT(Math_Vec3f_Yaw(&thisx->world.pos, &player->actor.world.pos)) < 0xC000)) {
targetX = Math_Vec3f_Pitch(&thisx->focus.pos, &player->actor.focus.pos);
targetY = Math_Vec3f_Yaw(&thisx->focus.pos, &player->actor.focus.pos) - this->actor.shape.rot.y;
+3 -2
View File
@@ -5,6 +5,7 @@
*/
#include "z_en_gs.h"
#include "z64voice.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "objects/object_gs/object_gs.h"
@@ -159,7 +160,7 @@ void EnGs_Init(Actor* thisx, PlayState* play) {
Math_Vec3f_Copy(&this->unk_1B0[0], &gOneVec3f);
Math_Vec3f_Copy(&this->unk_1B0[1], &gOneVec3f);
SubS_FillCutscenesList(&this->actor, this->csIdList, ARRAY_COUNT(this->csIdList));
func_801A5080(0);
func_801A5080(VOICE_WORD_ID_HOURS);
if (this->actor.params == ENGS_1) {
Actor_SetScale(&this->actor, 0.15f);
this->collider.dim.radius *= 1.5f;
@@ -946,7 +947,7 @@ void func_80999BC8(Actor* thisx, PlayState* play2) {
EnGs* this = THIS;
s32 pad;
if (this->actor.isLockedOn && !func_801A5100()) {
if (this->actor.isLockedOn && (AudioVoice_GetWord() == VOICE_WORD_ID_HOURS)) {
this->unk_19D = 0;
this->unk_19A |= 1;
func_80999AC0(this);
@@ -5,6 +5,7 @@
*/
#include "z_en_hidden_nuts.h"
#include "z64voice.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_2000000)
@@ -131,7 +132,7 @@ void EnHiddenNuts_Init(Actor* thisx, PlayState* play) {
this->path = SubS_GetPathByIndex(play, this->pathIndex, ENHIDDENNUTS_PATH_INDEX_NONE_ALT);
this->csId = this->actor.csId;
func_801A5080(2);
func_801A5080(VOICE_WORD_ID_WAKE_UP);
func_80BDB268(this);
}
@@ -213,7 +214,7 @@ void func_80BDB2B8(EnHiddenNuts* this, PlayState* play) {
if ((play->msgCtx.ocarinaMode == OCARINA_MODE_EVENT) && (play->msgCtx.lastPlayedSong == OCARINA_SONG_SONATA)) {
play->msgCtx.ocarinaMode = OCARINA_MODE_END;
func_80BDB788(this);
} else if (func_801A5100() == 2) {
} else if (AudioVoice_GetWord() == VOICE_WORD_ID_WAKE_UP) {
func_80BDB788(this);
} else {
Actor_OfferTalk(&this->actor, play, BREG(13) + 100.0f);

Some files were not shown because too many files have changed in this diff Show More