summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-09-16 05:31:16 -0300
committerSonic Dreamcaster <alejandro.asenjo88@gmail.com>2025-09-16 05:31:16 -0300
commit964bc598221b8c23d70f05e4c2c6b5adfa502029 (patch)
tree902645852f1b030627129e35e95a9326b62ed9f4 /src
parent48f3abef5b1a9e3cc0f3807c35e19bfb384fe133 (diff)
SEQ_NUM_CHANNELS macro usage
Diffstat (limited to 'src')
-rw-r--r--src/audio/audio_seqplayer.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/audio/audio_seqplayer.c b/src/audio/audio_seqplayer.c
index dd5b2a71..91a4462c 100644
--- a/src/audio/audio_seqplayer.c
+++ b/src/audio/audio_seqplayer.c
@@ -172,7 +172,7 @@ void AudioSeq_SequenceChannelDisable(SequenceChannel* channel) {
SequenceChannel* AudioSeq_RequestFreeSeqChannel(void) {
s32 i;
- for (i = 0; i < 48; i++) {
+ for (i = 0; i < ARRAY_COUNT(gSeqChannels); i++) {
if (gSeqChannels[i].seqPlayer == NULL) {
return &gSeqChannels[i];
}
@@ -184,7 +184,7 @@ void AudioSeq_SequencePlayerSetupChannels(SequencePlayer* seqPlayer, u16 channel
SequenceChannel* channel;
s32 i;
- for (i = 0; i < ARRAY_COUNT(seqPlayer->channels); i++) {
+ for (i = 0; i < SEQ_NUM_CHANNELS; i++) {
if (channelBits & 1) {
channel = seqPlayer->channels[i];
if ((IS_SEQUENCE_CHANNEL_VALID(channel) == 1) && (seqPlayer == channel->seqPlayer)) {
@@ -211,7 +211,7 @@ void AudioSeq_SequencePlayerSetupChannels(SequencePlayer* seqPlayer, u16 channel
void AudioSeq_SequencePlayerDisableChannels(SequencePlayer* seqPlayer, u16 channelBitsUnused) {
s32 i;
- for (i = 0; i < ARRAY_COUNT(seqPlayer->channels); i++) {
+ for (i = 0; i < SEQ_NUM_CHANNELS; i++) {
if (channelBitsUnused & 1) {
SequenceChannel* channel = seqPlayer->channels[i];
@@ -1516,8 +1516,7 @@ void AudioSeq_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) {
}
}
}
-
- for (i = 0; i < ARRAY_COUNT(seqPlayer->channels); i++) {
+ for (i = 0; i < SEQ_NUM_CHANNELS; i++) {
if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == 1) {
AudioSeq_SequenceChannelProcessScript(seqPlayer->channels[i]);
}
@@ -1568,7 +1567,7 @@ void AudioSeq_InitSequencePlayers(void) {
#ifdef AVOID_UB
for (j = 0; j < ARRAY_COUNT(gSeqChannels->layers); j++) {
#else
- for (j = 0; j < 64;
+ for (j = 0; j < ARRAY_COUNT(gSeqLayers);
j++) { // bug: this is ARRAY_COUNT(gSeqLayers) instead of ARRAY_COUNT(gSeqChannels[i].layers)
#endif
gSeqChannels[i].layers[j] = NULL;
@@ -1583,7 +1582,7 @@ void AudioSeq_InitSequencePlayers(void) {
}
for (i = 0; i < ARRAY_COUNT(gSeqPlayers); i++) {
- for (j = 0; j < 16; j++) {
+ for (j = 0; j < SEQ_NUM_CHANNELS; j++) {
gSeqPlayers[i].channels[j] = &gSeqChannelNone;
}
gSeqPlayers[i].unk_07[0] = -1;