Temporary fix for fanfares crashing until we get audio working (#21)

* Temporary fix for fanfares crashing until we get audio working

* Update mm/src/audio/lib/load.c

* Update code_8019AF00.c

---------

Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com>
This commit is contained in:
Garrett Cox
2024-05-22 09:04:57 -05:00
co-authored by louist103
parent 76e325feb8
commit daca951818
2 changed files with 8 additions and 2 deletions
+5 -2
View File
@@ -5651,8 +5651,11 @@ void Audio_PlayFanfare(u16 seqId) {
u32 outNumFonts;
u8* prevFontId = AudioThread_GetFontsForSequence(prevSeqId & 0xFF, &outNumFonts);
u8* fontId = AudioThread_GetFontsForSequence(seqId & 0xFF, &outNumFonts);
if ((prevSeqId == NA_BGM_DISABLED) || (*prevFontId == *fontId)) {
// BENTODO
// #region 2S2H [Audio] TODO: Fixes fanfare crash, should/can be removed after audio is done
// if ((prevSeqId == NA_BGM_DISABLED) || (*prevFontId == *fontId)) {
if ((prevSeqId == NA_BGM_DISABLED) || (prevFontId != NULL && fontId != NULL && *prevFontId == *fontId)) {
// #endregion
sFanfareState = 1;
} else {
sFanfareState = 5;
+3
View File
@@ -488,6 +488,9 @@ void AudioLoad_AsyncLoadFont(s32 fontId, s32 arg1, s32 retData, OSMesgQueue* ret
}
u8* AudioLoad_GetFontsForSequence(s32 seqId, u32* outNumFonts) {
// BENTODO
*outNumFonts = 0;
return NULL;
s32 index = ((u16*)gAudioCtx.sequenceFontTable)[seqId];
*outNumFonts = gAudioCtx.sequenceFontTable[index++];