diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2021-12-01 05:47:09 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-30 13:47:09 -0500 |
| commit | 783ef3a1170085aebd229f4bf243972824616a7c (patch) | |
| tree | 6ba8b01e9fda3041b2d4bb5cbb62568a70434a73 /src/code/code_800F7260.c | |
| parent | d9c1dffe09d8ba9a5ec6cfa723d36f71718c9ee0 (diff) | |
Audio Sequence Player Ids Enum (#1040)
* bgm.h -> sequence.h
* First round of filling in enum
* More
* seqCmd
* format
Diffstat (limited to 'src/code/code_800F7260.c')
| -rw-r--r-- | src/code/code_800F7260.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/code/code_800F7260.c b/src/code/code_800F7260.c index af14f7014..b04dfb6cf 100644 --- a/src/code/code_800F7260.c +++ b/src/code/code_800F7260.c @@ -108,15 +108,15 @@ void Audio_SetSoundBanksMute(u16 muteMask) { void Audio_QueueSeqCmdMute(u8 channelIdx) { D_801333D0 |= (1 << channelIdx); - Audio_SetVolScale(0, 2, 0x40, 0xF); - Audio_SetVolScale(3, 2, 0x40, 0xF); + Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 2, 0x40, 0xF); + Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 2, 0x40, 0xF); } void Audio_ClearBGMMute(u8 channelIdx) { D_801333D0 &= ((1 << channelIdx) ^ 0xFFFF); if (D_801333D0 == 0) { - Audio_SetVolScale(0, 2, 0x7F, 0xF); - Audio_SetVolScale(3, 2, 0x7F, 0xF); + Audio_SetVolScale(SEQ_PLAYER_BGM_MAIN, 2, 0x7F, 0xF); + Audio_SetVolScale(SEQ_PLAYER_BGM_SUB, 2, 0x7F, 0xF); } } @@ -496,7 +496,7 @@ void Audio_PlayActiveSounds(u8 bankId) { entryIndex = gActiveSounds[bankId][i].entryIndex; if (entryIndex != 0xFF) { entry = &gSoundBanks[bankId][entryIndex]; - channel = gAudioContext.seqPlayers[2].channels[sCurSfxPlayerChannelIdx]; + channel = gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[sCurSfxPlayerChannelIdx]; if (entry->state == SFX_STATE_READY) { entry->channelIdx = sCurSfxPlayerChannelIdx; if (entry->sfxParams & 8) { @@ -519,10 +519,11 @@ void Audio_PlayActiveSounds(u8 bankId) { } } Audio_SetSoundProperties(bankId, entryIndex, sCurSfxPlayerChannelIdx); - Audio_QueueCmdS8(0x06020000 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8), 1); - Audio_QueueCmdS8(0x06020000 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8) | 4, entry->sfxId & 0xFF); + Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8), 1); + Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8) | 4, + entry->sfxId & 0xFF); if (gIsLargeSoundBank[bankId]) { - Audio_QueueCmdS8(0x06020000 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8) | 5, + Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((sCurSfxPlayerChannelIdx & 0xFF) << 8) | 5, (entry->sfxId & 0x100) >> 8); } if (entry->sfxId & 0xC00) { @@ -554,7 +555,7 @@ void Audio_StopSfxByBank(u8 bankId) { while (entryIndex != 0xFF) { entry = &gSoundBanks[bankId][entryIndex]; if (entry->state >= SFX_STATE_PLAYING_REFRESH) { - Audio_QueueCmdS8(0x06020000 | ((entry->channelIdx & 0xFF) << 8), 0); + Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); } if (entry->state != SFX_STATE_EMPTY) { Audio_RemoveSoundBankEntry(bankId, entryIndex); @@ -574,7 +575,7 @@ void func_800F8884(u8 bankId, Vec3f* pos) { entry = &gSoundBanks[bankId][entryIndex]; if (entry->posX == &pos->x) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) { - Audio_QueueCmdS8(0x06020000 | ((entry->channelIdx & 0xFF) << 8), 0); + Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); } if (entry->state != SFX_STATE_EMPTY) { Audio_RemoveSoundBankEntry(bankId, entryIndex); @@ -616,7 +617,7 @@ void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId) { entry = &gSoundBanks[SFX_BANK(sfxId)][entryIndex]; if (entry->posX == &pos->x && entry->sfxId == sfxId) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) { - Audio_QueueCmdS8(0x06020000 | ((entry->channelIdx & 0xFF) << 8), 0); + Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); } if (entry->state != SFX_STATE_EMPTY) { Audio_RemoveSoundBankEntry(SFX_BANK(sfxId), entryIndex); @@ -644,7 +645,7 @@ void Audio_StopSfxByTokenAndId(u8 token, u16 sfxId) { entry = &gSoundBanks[SFX_BANK(sfxId)][entryIndex]; if (entry->token == token && entry->sfxId == sfxId) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) { - Audio_QueueCmdS8(0x06020000 | ((entry->channelIdx & 0xFF) << 8), 0); + Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); } if (entry->state != SFX_STATE_EMPTY) { Audio_RemoveSoundBankEntry(SFX_BANK(sfxId), entryIndex); @@ -671,7 +672,7 @@ void Audio_StopSfxById(u32 sfxId) { entry = &gSoundBanks[SFX_BANK(sfxId)][entryIndex]; if (entry->sfxId == sfxId) { if (entry->state >= SFX_STATE_PLAYING_REFRESH) { - Audio_QueueCmdS8(0x06020000 | ((entry->channelIdx & 0xFF) << 8), 0); + Audio_QueueCmdS8(0x6 << 24 | SEQ_PLAYER_SFX << 16 | ((entry->channelIdx & 0xFF) << 8), 0); } if (entry->state != SFX_STATE_EMPTY) { Audio_RemoveSoundBankEntry(SFX_BANK(sfxId), entryIndex); @@ -715,7 +716,7 @@ void Audio_StepUnusedBankLerp(u8 bankId) { void func_800F8F88(void) { u8 bankId; - if (IS_SEQUENCE_CHANNEL_VALID(gAudioContext.seqPlayers[2].channels[0])) { + if (IS_SEQUENCE_CHANNEL_VALID(gAudioContext.seqPlayers[SEQ_PLAYER_SFX].channels[0])) { sCurSfxPlayerChannelIdx = 0; for (bankId = 0; bankId < ARRAY_COUNT(gSoundBanks); bankId++) { Audio_ChooseActiveSounds(bankId); |
