Audio Sequences: Scene/Ambience/SeqFlags Functions OK (#1033)

* import audio scene seq docs

* cleanup

* fix scene cmd

* small fixes

* more PR suggestions

* missed comment

* rename spot to resume

* cleanup comments

* SEQ_IO_VAL_NONE

* Empty-Commit

* another PR suggestion
This commit is contained in:
engineer124
2022-09-30 07:49:35 -04:00
committed by GitHub
parent 3a723efb15
commit 1af942ae12
50 changed files with 1445 additions and 855 deletions
+6 -6
View File
@@ -315,7 +315,7 @@ void AudioSeq_InitSequenceChannel(SequenceChannel* channel) {
channel->freqScale = 1.0f;
for (i = 0; i < ARRAY_COUNT(channel->soundScriptIO); i++) {
channel->soundScriptIO[i] = -1;
channel->soundScriptIO[i] = SEQ_IO_VAL_NONE;
}
channel->unused = false;
@@ -1791,12 +1791,12 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
case 0x10: // channel: load sample
if (lowBits < 8) {
channel->soundScriptIO[lowBits] = -1;
channel->soundScriptIO[lowBits] = SEQ_IO_VAL_NONE;
if (AudioLoad_SlowLoadSample(channel->fontId, scriptState->value,
&channel->soundScriptIO[lowBits]) == -1) {}
} else {
lowBits -= 8;
channel->soundScriptIO[lowBits] = -1;
channel->soundScriptIO[lowBits] = SEQ_IO_VAL_NONE;
if (AudioLoad_SlowLoadSample(channel->fontId, channel->unk_22 + 0x100,
&channel->soundScriptIO[lowBits]) == -1) {}
}
@@ -1805,7 +1805,7 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) {
case 0x60: // channel: io read value
scriptState->value = channel->soundScriptIO[lowBits];
if (lowBits < 2) {
channel->soundScriptIO[lowBits] = -1;
channel->soundScriptIO[lowBits] = SEQ_IO_VAL_NONE;
}
break;
@@ -2150,7 +2150,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
case 0x80: // seqPlayer: io read value
seqScript->value = seqPlayer->soundScriptIO[cmdLowBits];
if (cmdLowBits < 2) {
seqPlayer->soundScriptIO[cmdLowBits] = -1;
seqPlayer->soundScriptIO[cmdLowBits] = SEQ_IO_VAL_NONE;
}
break;
@@ -2286,7 +2286,7 @@ void AudioSeq_InitSequencePlayer(SequencePlayer* seqPlayer) {
seqPlayer->applyBend = false;
for (j = 0; j < ARRAY_COUNT(seqPlayer->soundScriptIO); j++) {
seqPlayer->soundScriptIO[j] = -1;
seqPlayer->soundScriptIO[j] = SEQ_IO_VAL_NONE;
}
seqPlayer->muteFlags = MUTE_FLAGS_SOFTEN | MUTE_FLAGS_STOP_NOTES;
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -671,7 +671,7 @@ void AudioSfx_PlayActiveSfx(u8 bankId) {
// "one-frame" sfx
entry->state = SFX_STATE_PLAYING_ONE_FRAME;
}
} else if ((u8)channel->soundScriptIO[1] == 0xFF) {
} else if ((u8)channel->soundScriptIO[1] == (u8)SEQ_IO_VAL_NONE) {
// Signal from seq 0 that the sfx is finished playing. Remove entry
AudioSfx_RemoveBankEntry(bankId, entryIndex);
} else if (entry->state == SFX_STATE_PLAYING_REFRESH) {
+2 -2
View File
@@ -2,7 +2,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_StartSequence.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A7D04.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_StopSequence.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A7D84.s")
@@ -10,7 +10,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A89D0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A8A50.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/Audio_GetActiveSequence.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_801A7B10/func_801A8ABC.s")
+1 -1
View File
@@ -225,7 +225,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g
void GameState_Destroy(GameState* gameState) {
AudioMgr_StopAllSfxExceptSystem();
func_8019E014();
Audio_Update();
osRecvMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK);
if (gameState->destroy != NULL) {
+1 -1
View File
@@ -232,7 +232,7 @@ void Graph_UpdateGame(GameState* gameState) {
Game_UpdateInput(gameState);
Game_IncrementFrameCount(gameState);
if (SREG(20) < 3) {
func_8019E014();
Audio_Update();
}
}
+2 -2
View File
@@ -6,8 +6,8 @@ void SaveContext_Init(void) {
bzero(&gSaveContext, sizeof(SaveContext));
gSaveContext.save.playerForm = 0;
gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
gSaveContext.unk_3F46 = NA_BGM_GENERAL_SFX;
gSaveContext.nextCutsceneIndex = 0xFFEF;
gSaveContext.cutsceneTrigger = 0;
+13 -17
View File
@@ -152,7 +152,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
break;
case 0x2:
if (isStartFrame) {
func_801A47DC(NATURE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0);
Audio_SetAmbienceChannelIO(AMBIENCE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0);
Environment_AddLightningBolts(play, 3);
D_801F4E68 = 1;
}
@@ -376,14 +376,14 @@ void Cutscene_Command_SetLighting(PlayState* play, CutsceneContext* csCtx, CsCmd
// Command 0x12C: Plays a sequence (Background music or Fanfare)
void Cutscene_Command_PlaySequence(PlayState* play, CutsceneContext* csCtx, CsCmdSequenceChange* cmd) {
if (csCtx->frames == cmd->startFrame) {
func_801A2C88(cmd->sequence - 1);
Audio_PlaySequenceInCutscene(cmd->sequence - 1);
}
}
// Command 0x12D: Stops a sequence (Background music or Fanfare)
void Cutscene_Command_StopSequence(PlayState* play, CutsceneContext* csCtx, CsCmdSequenceChange* cmd) {
if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) {
func_801A2D54(cmd->sequence - 1);
Audio_StopSequenceInCutscene(cmd->sequence - 1);
}
}
@@ -403,9 +403,7 @@ void Cutscene_Command_FadeSequence(PlayState* play, CutsceneContext* csCtx, CsCm
// Command 0x12E: Play Ambience sequence
void Cutscene_Command_PlayAmbienceSequence(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
if (csCtx->frames == cmd->startFrame) {
// Audio_PlayNatureAmbienceSequence
// nightSeqIndex is natureAmbienceId
func_801A4A28(play->soundCtx.nightSeqIndex);
Audio_PlayAmbience(play->sequenceCtx.ambienceId);
}
}
@@ -455,29 +453,27 @@ void func_800EADB0(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
break;
case 4:
// func_801A246C(SEQ_PLAYER_NATURE, TYPE_1);
func_801A246C(SEQ_PLAYER_NATURE, 1);
// func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_1);
func_801A246C(SEQ_PLAYER_AMBIENCE, 1);
break;
case 5:
// func_801A246C(SEQ_PLAYER_NATURE, TYPE_0);
func_801A246C(SEQ_PLAYER_NATURE, 0);
// func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_0);
func_801A246C(SEQ_PLAYER_AMBIENCE, 0);
break;
case 6:
// func_801A246C(SEQ_PLAYER_NATURE, TYPE_2);
func_801A246C(SEQ_PLAYER_NATURE, 2);
// func_801A246C(SEQ_PLAYER_AMBIENCE, TYPE_2);
func_801A246C(SEQ_PLAYER_AMBIENCE, 2);
break;
case 7:
// Audio_GetActiveSequence
seqId = func_801A8A50(0);
seqId = Audio_GetActiveSequence(SEQ_PLAYER_BGM_MAIN);
break;
case 8:
if (seqId != NA_BGM_DISABLED) {
// Audio_PlayBgmForDayScene
func_801A25E4(seqId, dayMinusOne);
Audio_PlaySceneSequence(seqId, dayMinusOne);
}
break;
}
@@ -647,7 +643,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
// Command 0x15F: Chooses between a cutscene or a rotating mask depending on whether the player has the corresponding
// mask
void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
if ((csCtx->frames >= cmd->startFrame) && (func_801A3950(0, true) != 0xFF)) {
if ((csCtx->frames >= cmd->startFrame) && (func_801A3950(SEQ_PLAYER_BGM_MAIN, true) != 0xFF)) {
switch (cmd->base) {
case 1:
Cutscene_TerminatorImpl(play, csCtx, cmd);
+3 -3
View File
@@ -46,8 +46,8 @@ void GameOver_Update(PlayState* play) {
gSaveContext.unk_3DC0 = 2000;
gSaveContext.save.playerData.tatlTimer = 0;
gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
gSaveContext.eventInf[0] = 0;
gSaveContext.eventInf[1] = 0;
gSaveContext.eventInf[2] = 0;
@@ -67,7 +67,7 @@ void GameOver_Update(PlayState* play) {
gameOverCtx->state = GAMEOVER_DEATH_WAIT_GROUND;
break;
case GAMEOVER_DEATH_FADE_OUT:
if (func_801A8A50(1) != NA_BGM_GAME_OVER) {
if (Audio_GetActiveSequence(SEQ_PLAYER_FANFARE) != NA_BGM_GAME_OVER) {
func_80169F78(&play->state);
if (gSaveContext.respawnFlag != -7) {
gSaveContext.respawnFlag = -6;
+5 -4
View File
@@ -436,11 +436,12 @@ void Scene_HeaderCmd09(PlayState* play, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x15: Sound Settings=
void Scene_HeaderCmdSoundSettings(PlayState* play, SceneCmd* cmd) {
play->soundCtx.seqIndex = cmd->soundSettings.musicSeq;
play->soundCtx.nightSeqIndex = cmd->soundSettings.nighttimeSFX;
play->sequenceCtx.seqId = cmd->soundSettings.seqId;
play->sequenceCtx.ambienceId = cmd->soundSettings.ambienceId;
if (gSaveContext.seqIndex == (u8)NA_BGM_DISABLED || func_801A8A50(0) == NA_BGM_FINAL_HOURS) {
audio_setBGM(cmd->soundSettings.bgmId);
if (gSaveContext.seqId == (u8)NA_BGM_DISABLED ||
Audio_GetActiveSequence(SEQ_PLAYER_BGM_MAIN) == NA_BGM_FINAL_HOURS) {
Audio_SetSpec(cmd->soundSettings.specId);
}
}
+2 -2
View File
@@ -521,7 +521,7 @@ void func_809ED224(Boss04* this) {
this->unk_2C8 = 200;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_DEAD);
this->actor.flags &= ~ACTOR_FLAG_1;
func_801A2ED8();
Audio_RestorePrevBgm();
this->unk_1F6 = 10;
}
@@ -759,7 +759,7 @@ void Boss04_Update(Actor* thisx, PlayState* play2) {
if (D_809EE4D0 != 0) {
D_809EE4D0--;
if (D_809EE4D0 == 0) {
func_801A2E54(0x38);
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
}
}
+2 -2
View File
@@ -670,7 +670,7 @@ void DmStk_PlaySfxForPlayingWithFairiesCutscene(DmStk* this, PlayState* play) {
void DmStk_PlaySfxForEndingCutsceneFirstPart(DmStk* this, PlayState* play) {
switch (play->csCtx.frames) {
case 5:
func_801A4A28(12);
Audio_PlayAmbience(AMBIENCE_ID_0C);
break;
case 660:
@@ -688,7 +688,7 @@ void DmStk_PlaySfxForEndingCutsceneSecondPart(DmStk* this, PlayState* play) {
switch (play->csCtx.frames) {
case 5:
func_801A4A28(12);
Audio_PlayAmbience(AMBIENCE_ID_0C);
break;
case 45:
@@ -537,7 +537,7 @@ void func_808A1784(DoorShutter* this, PlayState* play) {
} else {
DoorShutter_SetupAction(this, func_808A1090);
}
func_801A2ED8();
Audio_RestorePrevBgm();
}
}
@@ -671,7 +671,7 @@ void func_809C2730(EnAob01* this, PlayState* play) {
void func_809C2788(EnAob01* this, PlayState* play) {
this->unk_2D2 |= 0x20;
if (func_809C25E4(this, play)) {
if (func_801A8A50(0) != 0x41) {
if (Audio_GetActiveSequence(SEQ_PLAYER_BGM_MAIN) != NA_BGM_HORSE_GOAL) {
play->nextEntrance = ENTRANCE(DOGGY_RACETRACK, 1);
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & (u8)~7) | 3;
play->transitionType = TRANS_TYPE_64;
+2 -2
View File
@@ -1426,7 +1426,7 @@ void func_80A97AB4(EnAz* this, PlayState* play) {
if (play->msgCtx.choiceIndex == 0) {
func_8019F208();
play->msgCtx.msgMode = 0x44;
func_800FD750(NA_BGM_MINI_GAME_2);
func_800FD750(NA_BGM_TIMED_MINI_GAME);
func_80A94AB8(this, play, 1);
func_80A979DC(this, play);
} else {
@@ -1466,7 +1466,7 @@ void func_80A97C4C(EnAz* this, PlayState* play) {
func_80A97410(this, play);
if ((this->unk_2FA == 1) || (this->unk_2FA == 3) || (this->unk_2FA == 6) || (this->unk_2FA == 8)) {
gSaveContext.save.weekEventReg[24] &= (u8)~1;
func_800FD750(NA_BGM_MINI_GAME_2);
func_800FD750(NA_BGM_TIMED_MINI_GAME);
play->nextEntrance = Entrance_CreateFromSpawn(1);
gSaveContext.nextCutsceneIndex = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -220,7 +220,7 @@ void EnBigpo_Init(Actor* thisx, PlayState* play2) {
if (thisx->params == ENBIGPO_REGULAR) { // the well poe, starts immediately
thisx->flags &= ~ACTOR_FLAG_10; // always update OFF
this->unkBool204 = true;
this->storePrevBgm = true;
EnBigpo_InitWellBigpo(this);
} else if (thisx->params == ENBIGPO_SUMMONED) { // dampe type
EnBigpo_InitDampeMainPo(this);
@@ -439,9 +439,9 @@ void EnBigpo_SpawnCutsceneStage6(EnBigpo* this, PlayState* play) {
*/
void EnBigpo_SpawnCutsceneStage7(EnBigpo* this) {
this->idleTimer = 15;
if (this->unkBool204 == false) {
func_801A2E54(NA_BGM_MINI_BOSS);
this->unkBool204 = true;
if (this->storePrevBgm == false) {
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
this->storePrevBgm = true;
}
this->actionFunc = EnBigpo_SpawnCutsceneStage8;
}
@@ -525,9 +525,9 @@ void EnBigpo_WarpingIn(EnBigpo* this, PlayState* play) {
this->mainColor.a = this->idleTimer * (255.0f / 32.0f);
if (this->idleTimer == 32) {
this->mainColor.a = 255; // fully visible
if (this->unkBool204 == false) {
func_801A2E54(NA_BGM_MINI_BOSS);
this->unkBool204 = true;
if (this->storePrevBgm == false) {
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
this->storePrevBgm = true;
}
EnBigpo_SetupIdleFlying(this);
}
@@ -1124,7 +1124,7 @@ s32 EnBigpo_ApplyDamage(EnBigpo* this, PlayState* play) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DEAD);
Enemy_StartFinishingBlow(play, &this->actor);
if (this->actor.params == ENBIGPO_SUMMONED) { // dampe type
func_801A2ED8();
Audio_RestorePrevBgm();
}
} else {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DAMAGE);
@@ -30,7 +30,7 @@ typedef struct EnBigpo {
/* 0x188 */ Vec3s jointTable[ENBIGPO_LIMBCOUNT];
/* 0x1C4 */ Vec3s morphTable[ENBIGPO_LIMBCOUNT];
/* 0x200 */ EnBigPoActionFunc actionFunc;
/* 0x204 */ u8 unkBool204; // need to know what func_801A2E54 does to know what this is
/* 0x204 */ u8 storePrevBgm;
/* 0x206 */ s16 idleTimer; // frame counter
/* 0x208 */ s16 unk208; // facing rotY?
/* 0x20A */ s16 rotVelocity;
@@ -1005,7 +1005,7 @@ void EnBigslime_CallMinislime(EnBigslime* this, PlayState* play) {
} else if (this->isAnimUpdate) {
Animation_PlayLoop(&this->skelAnime, &gGekkoNervousIdleAnim);
EnBigslime_UpdateCameraIntroCs(this, play, 25);
func_801A2E54(0x38);
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
EnBigslime_InitFallMinislime(this);
play->envCtx.lightSettingOverride = 0xFF;
this->callTimer = 35;
@@ -2620,7 +2620,7 @@ void EnBigslime_ApplyDamageEffectGekko(EnBigslime* this, PlayState* play) {
if (this->actor.colChkInfo.damageEffect != BIGSLIME_DMGEFF_HOOKSHOT) {
if (Actor_ApplyDamage(&this->actor) == 0) {
func_800BE504(&this->actor, &this->gekkoCollider);
func_801A2ED8();
Audio_RestorePrevBgm();
Enemy_StartFinishingBlow(play, &this->actor);
this->gekkoCollider.base.acFlags &= ~AC_ON;
EnBigslime_GekkoThaw(this, play);
@@ -691,7 +691,7 @@ void func_80C02740(EnBomjimb* this, PlayState* play) {
gSaveContext.save.bombersCaughtNum++;
if (gSaveContext.save.bombersCaughtNum > 4) {
func_801A3098(0x922);
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
} else {
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_PIECE_OF_HEART);
}
+1 -1
View File
@@ -482,7 +482,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) {
this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z,
-1);
func_801A3098(0x2B | 0x900);
Audio_PlayFanfare(NA_BGM_OPEN_CHEST | 0x900);
}
if (this->getItemId == GI_STRAY_FAIRY) {
@@ -511,7 +511,7 @@ void func_8089B3D4(EnDinofos* this, PlayState* play) {
Math_Vec3f_StepTo(&subCam->eye, &this->unk_2BC, 10.0f);
this->unk_290++;
if (this->unk_290 == 10) {
func_801A2E54(NA_BGM_MINI_BOSS);
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
}
subCamAt.x = this->actor.world.pos.x;
@@ -530,7 +530,7 @@ void func_8089B3D4(EnDinofos* this, PlayState* play) {
void func_8089B4A4(EnDinofos* this) {
if (this->unk_290 < 10) {
func_801A2E54(NA_BGM_MINI_BOSS);
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
}
Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00C974);
this->unk_2BC.x = (Math_SinS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.x;
@@ -1279,7 +1279,7 @@ s32 func_8089D60C(EnDinofos* this, PlayState* play) {
}
if (this->actor.cutscene != -1) {
func_801A2ED8();
Audio_RestorePrevBgm();
}
}
@@ -493,7 +493,7 @@ void EnElforg_FreeFloating(EnElforg* this, PlayState* play) {
// You found a Stray Fairy!
Message_StartTextbox(play, 0x11, NULL);
if (gSaveContext.save.inventory.strayFairies[(void)0, gSaveContext.dungeonIndex] >= 15) {
func_801A3098(NA_BGM_GET_ITEM | 0x900);
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
}
}
}
+2 -2
View File
@@ -538,7 +538,7 @@ void func_80962660(EnFu* this, PlayState* play) {
player->stateFlags1 |= 0x20;
this->unk_53C = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 3);
func_801A2BB8(NA_BGM_MINI_GAME_2);
func_801A2BB8(NA_BGM_TIMED_MINI_GAME);
if (this->unk_542 == 0) {
if (this->unk_546 == 1) {
func_80961EC8(play);
@@ -799,7 +799,7 @@ void func_80962F4C(EnFu* this, PlayState* play) {
func_801A2C20();
gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] = SECONDS_TO_TIMER(0);
gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_STOP;
func_801A3098(NA_BGM_GET_ITEM | 0x900);
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
func_8011B4E0(play, 1);
this->unk_54A = 3;
func_809632D0(this);
+2 -2
View File
@@ -387,7 +387,7 @@ void EnIk_Idle(EnIk* this, PlayState* play) {
}
} else if (this->colliderCylinder.base.acFlags & AC_HIT) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IRONNACK_ARMOR_HIT);
func_801A2E54(NA_BGM_MINI_BOSS);
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
this->actor.hintId = TATL_HINT_ID_IRON_KNUCKLE;
this->colliderCylinder.base.acFlags &= ~AC_HIT;
this->invincibilityFrames = 12;
@@ -786,7 +786,7 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) {
isArmorBroken = true;
} else {
Enemy_StartFinishingBlow(play, &this->actor);
func_801A2ED8();
Audio_RestorePrevBgm();
}
}
if (isArmorBroken == true) {
@@ -1989,7 +1989,7 @@ void func_80B470E0(EnInvadepoh* this) {
void func_80B47108(EnInvadepoh* this, PlayState* play) {
if (this->actionTimer == 100) {
func_801A3098(NA_BGM_CLEAR_EVENT);
Audio_PlayFanfare(NA_BGM_CLEAR_EVENT);
}
this->actionTimer--;
if (this->actionTimer <= 0) {
@@ -881,7 +881,7 @@ void EnMaYto_SetupAfterMilkRunInit(EnMaYto* this) {
if (gSaveContext.save.weekEventReg[52] & 1) { // if (ProtectedCremia)
EnMaYto_SetFaceExpression(this, 3, 1);
} else {
func_801A3098(NA_BGM_FAILURE_1);
Audio_PlayFanfare(NA_BGM_FAILURE_1);
EnMaYto_SetFaceExpression(this, 5, 2);
}
this->actionFunc = EnMaYto_AfterMilkRunInit;
+1 -1
View File
@@ -303,7 +303,7 @@ void func_80A6F5E4(EnMm3* this, PlayState* play) {
this->unk_2AC--;
if (this->unk_2AC == 0) {
if (gSaveContext.timerCurTimes[TIMER_ID_POSTMAN] == SECONDS_TO_TIMER(10)) {
func_801A3098(0x922);
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
} else {
play_sound(NA_SE_SY_ERROR);
}
+4 -4
View File
@@ -356,7 +356,7 @@ void func_8095AE60(EnOwl* this, PlayState* play) {
void func_8095AEC0(EnOwl* this, PlayState* play) {
func_8095A920(this, play);
if (func_8095A978(this, play, 0x7D0, 360.0f, 200.0f)) {
func_801A3098(NA_BGM_OWL);
Audio_PlayFanfare(NA_BGM_OWL);
this->actionFunc = func_8095AE60;
}
}
@@ -385,7 +385,7 @@ void func_8095AF2C(EnOwl* this, PlayState* play) {
void func_8095AFEC(EnOwl* this, PlayState* play) {
func_8095A920(this, play);
if (func_8095A978(this, play, 0xBF6, 200.0f, 100.0f)) {
func_801A3098(NA_BGM_OWL);
Audio_PlayFanfare(NA_BGM_OWL);
this->actionFunc = func_8095AF2C;
this->unk_406 = 0;
this->actionFlags |= 0x40;
@@ -500,7 +500,7 @@ void func_8095B574(EnOwl* this, PlayState* play) {
func_8095A920(this, play);
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
this->actionFunc = func_8095BA84;
func_801A3098(NA_BGM_OWL);
Audio_PlayFanfare(NA_BGM_OWL);
this->actionFlags |= 0x40;
this->unk_406 = 2;
} else if (this->actor.xzDistToPlayer < 200.0f) {
@@ -713,7 +713,7 @@ void func_8095BE0C(EnOwl* this, PlayState* play) {
func_8095A920(this, play);
if (Actor_ProcessTalkRequest(&this->actor, &play->state)) {
this->actionFunc = func_8095BA84;
func_801A3098(NA_BGM_OWL);
Audio_PlayFanfare(NA_BGM_OWL);
this->unk_406 = 1;
this->actionFlags |= 0x40;
} else if (this->actor.textId == 0xBF0) {
@@ -1035,7 +1035,7 @@ void EnPametfrog_LookAround(EnPametfrog* this, PlayState* play) {
this->actor.shape.rot.y = this->actor.world.rot.y;
if (SkelAnime_Update(&this->skelAnime) && !Play_InCsMode(play)) {
if (!this->unk_2AE) {
func_801A2E54(NA_BGM_MINI_BOSS);
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
this->unk_2AE = true;
}
EnPametfrog_SetupJumpToLink(this);
@@ -1255,7 +1255,7 @@ void EnPametfrog_SetupTransitionGekkoSnapper(EnPametfrog* this, PlayState* play)
void EnPametfrog_TransitionGekkoSnapper(EnPametfrog* this, PlayState* play) {
if (this->actor.params == GEKKO_INIT_SNAPPER) {
func_801A2E54(NA_BGM_MINI_BOSS);
Audio_PlayBgm_StorePrevBgm(NA_BGM_MINI_BOSS);
EnPametfrog_SetupRunToSnapper(this);
}
}
@@ -1267,7 +1267,7 @@ void EnPametfrog_ApplyDamageEffect(EnPametfrog* this, PlayState* play) {
!(this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0xDB0B3)) {
if (this->actor.params == GEKKO_PRE_SNAPPER) {
if (Actor_ApplyDamage(&this->actor) == 0) {
func_801A2ED8();
Audio_RestorePrevBgm();
}
if (this->actor.colChkInfo.damageEffect == GEKKO_DMGEFF_ZORA_BARRIER) {
@@ -1303,7 +1303,7 @@ void EnPametfrog_ApplyDamageEffect(EnPametfrog* this, PlayState* play) {
EnPametfrog_ApplyMagicArrowEffects(this, play);
Enemy_StartFinishingBlow(play, &this->actor);
this->actor.flags &= ~ACTOR_FLAG_1;
func_801A2ED8();
Audio_RestorePrevBgm();
EnPametfrog_SetupCutscene(this);
} else if (this->actor.colChkInfo.damageEffect == GEKKO_DMGEFF_ZORA_BARRIER) {
EnPametfrog_ApplyElectricStun(this);
@@ -377,7 +377,7 @@ void EnSyatekiDekunuts_Update(Actor* thisx, PlayState* play) {
if ((this->actionFunc != func_80A2BF18) && (this->unk_1D8 < this->unk_1EE) && (this->unk_1D8 > 10)) {
if ((this->collider.base.acFlags & AC_HIT) && (this->unk_1E2 == 1)) {
if (EN_SYATEKI_DEKUNUTS_GET_PARAM_F(&this->actor) == 1) {
func_801A3098(NA_BGM_GET_ITEM | 0x900);
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
} else {
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
}
@@ -395,7 +395,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
func_80123F2C(play, 80);
this->shootingGameState = SG_GAME_STATE_RUNNING;
this->actionFunc = EnSyatekiMan_Swamp_StartGame;
func_801A2BB8(NA_BGM_MINI_GAME_2);
func_801A2BB8(NA_BGM_TIMED_MINI_GAME);
break;
case 0xA32: // You have to try harder!
@@ -753,7 +753,7 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
func_80112AFC(play);
func_80123F2C(play, 0x63);
this->shootingGameState = SG_GAME_STATE_RUNNING;
func_801A2BB8(NA_BGM_MINI_GAME_2);
func_801A2BB8(NA_BGM_TIMED_MINI_GAME);
this->actionFunc = EnSyatekiMan_Town_StartGame;
break;
@@ -1349,7 +1349,7 @@ void EnSyatekiMan_Town_RunGame(EnSyatekiMan* this, PlayState* play) {
func_801A2C20();
this->actionFunc = EnSyatekiMan_Town_EndGame;
if (this->score == 50) {
func_801A3098(NA_BGM_GET_ITEM | 0x900);
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
func_8011B4E0(play, 1);
}
}
@@ -424,7 +424,7 @@ void EnSyatekiWf_Update(Actor* thisx, PlayState* play2) {
this->unk_34C.base.acFlags &= ~AC_HIT;
this->actor.colChkInfo.health -= 2;
if (this->actor.colChkInfo.health == 0) {
func_801A3098(NA_BGM_GET_ITEM | 0x900);
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
func_80A20858(this, play);
} else {
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
@@ -690,7 +690,7 @@ void func_80A92188(EnTest6* this, PlayState* play) {
break;
case 110:
func_801A3098(0x4A);
Audio_PlayFanfare(NA_BGM_SONG_OF_DOUBLE_TIME);
break;
case 38:
@@ -409,7 +409,7 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) {
} else {
func_80AF082C(this, func_80AF19A8);
EnTest7_SetupAction(this, func_80AF2854);
func_801A2E54(NA_BGM_SONG_OF_SOARING);
Audio_PlayBgm_StorePrevBgm(NA_BGM_SONG_OF_SOARING);
}
if (play->playerActorCsIds[8] == -1) {
@@ -677,8 +677,8 @@ void func_80AF2350(EnTest7* this, PlayState* play) {
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_02;
gSaveContext.seqIndex = 0xFF;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
}
void func_80AF24D8(EnTest7* this, PlayState* play, f32 arg2) {
@@ -247,8 +247,8 @@ void EnWarpTag_GrottoReturn(EnWarptag* this, PlayState* play) {
func_8019F128(NA_SE_OC_SECRET_HOLE_OUT);
func_801A4058(5);
if (1) {}
gSaveContext.seqIndex = 0xFF;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
}
}
@@ -60,7 +60,7 @@ void ObjDemo_Init(Actor* thisx, PlayState* play) {
}
void func_80983634(PlayState* play) {
if ((play->sceneId == SCENE_CASTLE) && (func_801A8A50(0) == NA_BGM_IKANA_CASTLE)) {
if ((play->sceneId == SCENE_CASTLE) && (Audio_GetActiveSequence(SEQ_PLAYER_BGM_MAIN) == NA_BGM_IKANA_CASTLE)) {
Audio_QueueSeqCmd(0x100100FF);
}
}
+3 -3
View File
@@ -751,7 +751,7 @@ void ObjUm_Init(Actor* thisx, PlayState* play) {
ObjUm_SetupAction(this, ObjUm_PostMilkRunStartCs);
this->unk_354 = 0;
ObjUm_RotatePlayer(this, play, 0);
func_801A3098(NA_BGM_CLEAR_EVENT);
Audio_PlayFanfare(NA_BGM_CLEAR_EVENT);
} else {
this->type = OBJ_UM_TYPE_TERMINA_FIELD;
ObjUm_SetupAction(this, ObjUm_TerminaFieldIdle);
@@ -1295,9 +1295,9 @@ void ObjUm_RunMinigame(ObjUm* this, PlayState* play) {
switch (ObjUm_UpdatePath(this, play)) {
case OBJUM_PATH_STATE_1:
case OBJUM_PATH_STATE_FINISH:
gSaveContext.seqIndex = 0xFF;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.save.weekEventReg[31] &= (u8)~0x80;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
if (!(gSaveContext.save.weekEventReg[52] & 1) && !(gSaveContext.save.weekEventReg[52] & 2)) {
if (!this->areAllPotsBroken) {
@@ -41,8 +41,8 @@ void MapSelect_LoadGame(MapSelectState* this, u32 entrance, s32 spawn) {
}
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = 0xFFFF;
gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
gSaveContext.showTitleCard = true;
gSaveContext.respawnFlag = 0;
gSaveContext.respawn[RESPAWN_MODE_GORON].entrance = 0xFF;
+2 -2
View File
@@ -128,8 +128,8 @@ void ConsoleLogo_Main(GameState* thisx) {
ConsoleLogo_UpdateCounters(this);
ConsoleLogo_Draw(&this->state);
if (this->exit) {
gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
gSaveContext.nightSeqIndex = 0xFF;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.ambienceId = AMBIENCE_ID_DISABLED;
gSaveContext.gameMode = 1;
STOP_GAMESTATE(&this->state);