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")