SEQ_NUM_CHANNELS macro usage

This commit is contained in:
Sonic Dreamcaster
2025-09-16 05:31:16 -03:00
parent 48f3abef5b
commit 964bc59822
+6 -7
View File
@@ -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;