summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
Diffstat (limited to 'src/code')
-rw-r--r--src/code/code_800EC960.c18
-rw-r--r--src/code/z_common_data.c6
-rw-r--r--src/code/z_game_over.c4
-rw-r--r--src/code/z_kankyo.c68
-rw-r--r--src/code/z_parameter.c4
-rw-r--r--src/code/z_play.c10
-rw-r--r--src/code/z_scene.c8
7 files changed, 59 insertions, 59 deletions
diff --git a/src/code/code_800EC960.c b/src/code/code_800EC960.c
index 18c23f141..b1af38f95 100644
--- a/src/code/code_800EC960.c
+++ b/src/code/code_800EC960.c
@@ -2809,7 +2809,7 @@ void AudioDebug_ProcessInput(void) {
if (CHECK_BTN_ANY(sDebugPadPress, BTN_A)) {
sAudioSndContWork[5] ^= 1;
Audio_SeqCmdE01(SEQ_PLAYER_BGM_MAIN, sAudioSndContWork[5]);
- if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) != NA_BGM_NATURE_BACKGROUND) {
+ if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) != NA_BGM_NATURE_AMBIENCE) {
Audio_SeqCmd1(SEQ_PLAYER_BGM_MAIN, 0);
}
Audio_SeqCmd1(SEQ_PLAYER_FANFARE, 0);
@@ -3840,7 +3840,7 @@ void func_800F5BF0(u8 arg0) {
u16 temp_v0;
temp_v0 = func_800FA0B4(SEQ_PLAYER_BGM_MAIN);
- if (temp_v0 != NA_BGM_NATURE_BACKGROUND) {
+ if (temp_v0 != NA_BGM_NATURE_AMBIENCE) {
D_80130628 = temp_v0;
}
func_800F6FB4(arg0);
@@ -3934,7 +3934,7 @@ void func_800F5E90(u8 arg0) {
}
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 3, sAudioEnemyVol, phi_t0);
Audio_StartSeq(SEQ_PLAYER_BGM_SUB, 10, NA_BGM_ENEMY | 0x800);
- if (phi_t1 != NA_BGM_NATURE_BACKGROUND) {
+ if (phi_t1 != NA_BGM_NATURE_AMBIENCE) {
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 3, (0x7F - sAudioEnemyVol) & 0xFF, 0xA);
func_800F510C(sAudioEnemyVol);
}
@@ -3990,11 +3990,11 @@ void func_800F6114(f32 dist) {
sAudioEnemyVol = ((350.0f - adjDist) * 127.0f) / 350.0f;
Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 3, sAudioEnemyVol, 0xA);
- if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_BACKGROUND) {
+ if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_AMBIENCE) {
Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 3, (0x7F - sAudioEnemyVol), 0xA);
}
}
- if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_BACKGROUND) {
+ if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_AMBIENCE) {
func_800F510C(sAudioEnemyVol);
}
}
@@ -4028,7 +4028,7 @@ void func_800F6268(f32 dist, u16 arg1) {
D_8016B9D8++;
}
}
- } else if ((temp_a0 == NA_BGM_NATURE_BACKGROUND) && ((arg1 & 0xFF) == NA_BGM_LONLON)) {
+ } else if ((temp_a0 == NA_BGM_NATURE_AMBIENCE) && ((arg1 & 0xFF) == NA_BGM_LONLON)) {
temp_a0 = (s8)(func_800FA0B4(SEQ_PLAYER_BGM_SUB) & 0xFF);
if ((temp_a0 != (arg1 & 0xFF)) && (D_8016B9D8 < 10)) {
func_800F5E18(SEQ_PLAYER_BGM_SUB, NA_BGM_LONLON, 0, 0, 0);
@@ -4151,7 +4151,7 @@ void Audio_SetExtraFilter(u8 filter) {
sAudioExtraFilter2 = filter;
sAudioExtraFilter = filter;
- if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 == NA_BGM_NATURE_BACKGROUND) {
+ if (D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 == NA_BGM_NATURE_AMBIENCE) {
for (i = 0; i < 16; i++) {
t = i;
// CHAN_UPD_SCRIPT_IO (seq player 0, all channels, slot 6)
@@ -4275,7 +4275,7 @@ void func_800F6D58(u8 arg0, u8 arg1, u8 arg2) {
u8 temp_a0;
u8 i;
- if ((D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_BACKGROUND) && func_800FA11C(1, 0xF00000FF)) {
+ if ((D_8016E750[SEQ_PLAYER_BGM_MAIN].unk_254 != NA_BGM_NATURE_AMBIENCE) && func_800FA11C(1, 0xF00000FF)) {
sAudioNatureFailed = 1;
return;
}
@@ -4316,7 +4316,7 @@ void func_800F6E7C(u16 arg0, u16 arg1) {
Audio_SeqCmdE01(SEQ_PLAYER_BGM_MAIN, 0);
}
- Audio_StartSeq(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_NATURE_BACKGROUND);
+ Audio_StartSeq(SEQ_PLAYER_BGM_MAIN, 0, NA_BGM_NATURE_AMBIENCE);
if (i != 0) {
Audio_SeqCmdE01(SEQ_PLAYER_BGM_MAIN, 1);
diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c
index f63c9b4af..fbe01f7c7 100644
--- a/src/code/z_common_data.c
+++ b/src/code/z_common_data.c
@@ -8,9 +8,9 @@ void SaveContext_Init(void) {
bzero(&gSaveContext, sizeof(gSaveContext));
D_8015FA88 = 0;
D_8015FA8C = 0;
- gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
- gSaveContext.nightSeqIndex = 0xFF;
- gSaveContext.unk_140E = NA_BGM_GENERAL_SFX;
+ gSaveContext.seqId = (u8)NA_BGM_DISABLED;
+ gSaveContext.natureAmbienceId = 0xFF;
+ gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
gSaveContext.nextCutsceneIndex = 0xFFEF;
gSaveContext.cutsceneTrigger = 0;
gSaveContext.chamberCutsceneNum = 0;
diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c
index d8e00faad..e9a0eef64 100644
--- a/src/code/z_game_over.c
+++ b/src/code/z_game_over.c
@@ -62,8 +62,8 @@ void GameOver_Update(GlobalContext* globalCtx) {
gSaveContext.nayrusLoveTimer = 2000;
gSaveContext.naviTimer = 0;
- gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
- gSaveContext.nightSeqIndex = 0xFF;
+ gSaveContext.seqId = (u8)NA_BGM_DISABLED;
+ gSaveContext.natureAmbienceId = 0xFF;
gSaveContext.eventInf[0] = 0;
gSaveContext.eventInf[1] = 0;
gSaveContext.eventInf[2] = 0;
diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c
index 612537201..99d5dffa8 100644
--- a/src/code/z_kankyo.c
+++ b/src/code/z_kankyo.c
@@ -1922,34 +1922,34 @@ void func_800758AC(GlobalContext* globalCtx) {
// both lost woods exits on the bridge from kokiri to hyrule field
if (((void)0, gSaveContext.entranceIndex) == 0x4DE || ((void)0, gSaveContext.entranceIndex) == 0x5E0) {
func_800F6FB4(4);
- } else if (((void)0, gSaveContext.unk_140E) != NA_BGM_GENERAL_SFX) {
- if (!func_80077600()) {
- Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | (s32)((void)0, gSaveContext.unk_140E));
+ } else if (((void)0, gSaveContext.forcedSeqId) != NA_BGM_GENERAL_SFX) {
+ if (!Environment_IsForcedSequenceDisabled()) {
+ Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | (s32)((void)0, gSaveContext.forcedSeqId));
}
- gSaveContext.unk_140E = NA_BGM_GENERAL_SFX;
- } else if (globalCtx->soundCtx.seqIndex == NA_BGM_NO_MUSIC) {
- if (globalCtx->soundCtx.nightSeqIndex == 0x13) {
+ gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
+ } else if (globalCtx->sequenceCtx.seqId == NA_BGM_NO_MUSIC) {
+ if (globalCtx->sequenceCtx.natureAmbienceId == 0x13) {
return;
}
- if (((void)0, gSaveContext.nightSeqIndex) != globalCtx->soundCtx.nightSeqIndex) {
- func_800F6FB4(globalCtx->soundCtx.nightSeqIndex);
+ if (((void)0, gSaveContext.natureAmbienceId) != globalCtx->sequenceCtx.natureAmbienceId) {
+ func_800F6FB4(globalCtx->sequenceCtx.natureAmbienceId);
}
- } else if (globalCtx->soundCtx.nightSeqIndex == 0x13) {
+ } else if (globalCtx->sequenceCtx.natureAmbienceId == 0x13) {
// "BGM Configuration"
- osSyncPrintf("\n\n\nBGM設定game_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n", globalCtx->soundCtx.seqIndex,
- ((void)0, gSaveContext.seqIndex));
- if (((void)0, gSaveContext.seqIndex) != globalCtx->soundCtx.seqIndex) {
- func_800F5550(globalCtx->soundCtx.seqIndex);
+ osSyncPrintf("\n\n\nBGM設定game_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n", globalCtx->sequenceCtx.seqId,
+ ((void)0, gSaveContext.seqId));
+ if (((void)0, gSaveContext.seqId) != globalCtx->sequenceCtx.seqId) {
+ func_800F5550(globalCtx->sequenceCtx.seqId);
}
} else if (((void)0, gSaveContext.dayTime) > 0x4AAA && ((void)0, gSaveContext.dayTime) < 0xB71D) {
- if (((void)0, gSaveContext.seqIndex) != globalCtx->soundCtx.seqIndex) {
- func_800F5550(globalCtx->soundCtx.seqIndex);
+ if (((void)0, gSaveContext.seqId) != globalCtx->sequenceCtx.seqId) {
+ func_800F5550(globalCtx->sequenceCtx.seqId);
}
globalCtx->envCtx.unk_E0 = 1;
} else {
- if (((void)0, gSaveContext.nightSeqIndex) != globalCtx->soundCtx.nightSeqIndex) {
- func_800F6FB4(globalCtx->soundCtx.nightSeqIndex);
+ if (((void)0, gSaveContext.natureAmbienceId) != globalCtx->sequenceCtx.natureAmbienceId) {
+ func_800F6FB4(globalCtx->sequenceCtx.natureAmbienceId);
}
if (((void)0, gSaveContext.dayTime) > 0xB71C && ((void)0, gSaveContext.dayTime) < 0xCAAC) {
@@ -1961,10 +1961,10 @@ void func_800758AC(GlobalContext* globalCtx) {
}
}
- osSyncPrintf("\n-----------------\n", ((void)0, gSaveContext.unk_140E));
- osSyncPrintf("\n 強制BGM=[%d]", ((void)0, gSaveContext.unk_140E)); // "Forced BGM"
- osSyncPrintf("\n BGM=[%d]", globalCtx->soundCtx.seqIndex);
- osSyncPrintf("\n エンブ=[%d]", globalCtx->soundCtx.nightSeqIndex);
+ osSyncPrintf("\n-----------------\n", ((void)0, gSaveContext.forcedSeqId));
+ osSyncPrintf("\n 強制BGM=[%d]", ((void)0, gSaveContext.forcedSeqId)); // "Forced BGM"
+ osSyncPrintf("\n BGM=[%d]", globalCtx->sequenceCtx.seqId);
+ osSyncPrintf("\n エンブ=[%d]", globalCtx->sequenceCtx.natureAmbienceId);
osSyncPrintf("\n status=[%d]", globalCtx->envCtx.unk_E0);
Audio_SetEnvReverb(globalCtx->roomCtx.curRoom.echo);
@@ -1977,7 +1977,7 @@ void func_80075B44(GlobalContext* globalCtx) {
func_800F6D58(86, 1, 0);
if (globalCtx->envCtx.unk_EE[0] == 0 && globalCtx->envCtx.unk_F2[0] == 0) {
osSyncPrintf("\n\n\nNa_StartMorinigBgm\n\n");
- func_800F5510(globalCtx->soundCtx.seqIndex);
+ func_800F5510(globalCtx->sequenceCtx.seqId);
}
globalCtx->envCtx.unk_E0++;
break;
@@ -1997,7 +1997,7 @@ void func_80075B44(GlobalContext* globalCtx) {
break;
case 3:
if (globalCtx->envCtx.unk_EE[0] == 0 && globalCtx->envCtx.unk_F2[0] == 0) {
- func_800F6FB4(globalCtx->soundCtx.nightSeqIndex);
+ func_800F6FB4(globalCtx->sequenceCtx.natureAmbienceId);
func_800F6D58(1, 1, 1);
}
globalCtx->envCtx.unk_E0++;
@@ -2390,25 +2390,25 @@ s32 Environment_GetTotalDays(void) {
return gSaveContext.totalDays;
}
-void func_800775F0(u16 arg0) {
- gSaveContext.unk_140E = arg0;
+void Environment_ForcePlaySequence(u16 seqId) {
+ gSaveContext.forcedSeqId = seqId;
}
-s32 func_80077600(void) {
- s32 ret = false;
+s32 Environment_IsForcedSequenceDisabled(void) {
+ s32 isDisabled = false;
- if (gSaveContext.unk_140E == NA_BGM_DISABLED) {
- ret = true;
+ if (gSaveContext.forcedSeqId == NA_BGM_DISABLED) {
+ isDisabled = true;
}
- return ret;
+ return isDisabled;
}
void func_80077624(GlobalContext* globalCtx) {
- if (globalCtx->soundCtx.nightSeqIndex == 19) {
+ if (globalCtx->sequenceCtx.natureAmbienceId == 19) {
func_800F6FB4(5);
} else {
- func_800F6FB4(globalCtx->soundCtx.nightSeqIndex);
+ func_800F6FB4(globalCtx->sequenceCtx.natureAmbienceId);
}
func_800F6D58(14, 1, 1);
@@ -2419,8 +2419,8 @@ void func_80077684(GlobalContext* globalCtx) {
func_800F6D58(14, 1, 0);
func_800F6D58(15, 1, 0);
- if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) == NA_BGM_NATURE_BACKGROUND) {
- gSaveContext.seqIndex = NA_BGM_NATURE_SFX_RAIN;
+ if (func_800FA0B4(SEQ_PLAYER_BGM_MAIN) == NA_BGM_NATURE_AMBIENCE) {
+ gSaveContext.seqId = NA_BGM_NATURE_SFX_RAIN;
func_800758AC(globalCtx);
}
}
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index c0d674e7c..03fa51887 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -4160,8 +4160,8 @@ void Interface_Update(GlobalContext* globalCtx) {
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
func_800F6964(30);
- gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
- gSaveContext.nightSeqIndex = 0xFF;
+ gSaveContext.seqId = (u8)NA_BGM_DISABLED;
+ gSaveContext.natureAmbienceId = 0xFF;
} else {
gSaveContext.sunsSongState = SUNSSONG_SPECIAL;
}
diff --git a/src/code/z_play.c b/src/code/z_play.c
index 7e82bf3b5..de86b1b2e 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -393,8 +393,8 @@ void Gameplay_Init(GameState* thisx) {
Interface_SetSceneRestrictions(globalCtx);
func_800758AC(globalCtx);
- gSaveContext.seqIndex = globalCtx->soundCtx.seqIndex;
- gSaveContext.nightSeqIndex = globalCtx->soundCtx.nightSeqIndex;
+ gSaveContext.seqId = globalCtx->sequenceCtx.seqId;
+ gSaveContext.natureAmbienceId = globalCtx->sequenceCtx.natureAmbienceId;
func_8002DF18(globalCtx, GET_PLAYER(globalCtx));
AnimationContext_Update(globalCtx, &globalCtx->animationCtx);
gSaveContext.respawnFlag = 0;
@@ -479,12 +479,12 @@ void Gameplay_Update(GlobalContext* globalCtx) {
if (!(gEntranceTable[globalCtx->nextEntranceIndex + sp6E].field & 0x8000)) { // Continue BGM Off
// "Sound initalized. 111"
osSyncPrintf("\n\n\nサウンドイニシャル来ました。111");
- if ((globalCtx->fadeTransition < 56) && (func_80077600() == 0)) {
+ if ((globalCtx->fadeTransition < 56) && !Environment_IsForcedSequenceDisabled()) {
// "Sound initalized. 222"
osSyncPrintf("\n\n\nサウンドイニシャル来ました。222");
func_800F6964(0x14);
- gSaveContext.seqIndex = (u8)NA_BGM_DISABLED;
- gSaveContext.nightSeqIndex = 0xFF;
+ gSaveContext.seqId = (u8)NA_BGM_DISABLED;
+ gSaveContext.natureAmbienceId = 0xFF;
}
}
}
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index d6fcf566c..6948d09cc 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -413,11 +413,11 @@ void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd) {
// Scene Command 0x15: Sound Settings
void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) {
- globalCtx->soundCtx.seqIndex = cmd->soundSettings.seqIndex;
- globalCtx->soundCtx.nightSeqIndex = cmd->soundSettings.nightSeqIndex;
+ globalCtx->sequenceCtx.seqId = cmd->soundSettings.seqId;
+ globalCtx->sequenceCtx.natureAmbienceId = cmd->soundSettings.natureAmbienceId;
- if (gSaveContext.seqIndex == (u8)NA_BGM_DISABLED) {
- Audio_QueueSeqCmd(cmd->soundSettings.bgmId | 0xF0000000);
+ if (gSaveContext.seqId == (u8)NA_BGM_DISABLED) {
+ Audio_QueueSeqCmd(cmd->soundSettings.specId | 0xF0000000);
}
}