diff options
| author | Nicholas Estelami <NEstelami@users.noreply.github.com> | 2022-07-11 22:37:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-11 22:37:39 -0400 |
| commit | 3aa93b985528a8ecd9e5cf1cf04e4144cd065632 (patch) | |
| tree | f18083471c9f8ba1308c34c4189242e61321441a /soh/src/code/audio_seqplayer.c | |
| parent | eab3b5bd7f58fb04899879e22cce6bb8abce9db4 (diff) | |
Removed legacy audio mode and fixed ganon sound bug (#657)
Diffstat (limited to 'soh/src/code/audio_seqplayer.c')
| -rw-r--r-- | soh/src/code/audio_seqplayer.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/soh/src/code/audio_seqplayer.c b/soh/src/code/audio_seqplayer.c index 6e33e94e1..3ae70719c 100644 --- a/soh/src/code/audio_seqplayer.c +++ b/soh/src/code/audio_seqplayer.c @@ -3,7 +3,6 @@ #include "ultra64.h" #include "global.h" -extern bool gUseLegacySD; extern char* sequenceMap[256]; #define PORTAMENTO_IS_SPECIAL(x) ((x).mode & 0x80) @@ -1062,18 +1061,14 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { result = (u8)parameters[0]; command = (u8)parameters[0]; - if (seqPlayer->defaultFont != 0xFF) { - if (gUseLegacySD) { - offset = ((u16*)gAudioContext.sequenceFontTable)[seqPlayer->seqId]; - lowBits = gAudioContext.sequenceFontTable[offset]; - command = gAudioContext.sequenceFontTable[offset + lowBits - result]; - } else { - SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqPlayer->seqId]); - command = sDat.fonts[sDat.numFonts - result - 1]; - } + if (seqPlayer->defaultFont != 0xFF) + { + SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqPlayer->seqId]); + command = sDat.fonts[sDat.numFonts - result - 1]; } - if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, command)) { + if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, command)) + { channel->fontId = command; } @@ -1178,18 +1173,16 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { result = (u8)parameters[0]; command = (u8)parameters[0]; - if (seqPlayer->defaultFont != 0xFF) { - if (gUseLegacySD) { - offset = ((u16*)gAudioContext.sequenceFontTable)[seqPlayer->seqId]; - lowBits = gAudioContext.sequenceFontTable[offset]; - command = gAudioContext.sequenceFontTable[offset + lowBits - result]; - } else { - SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqPlayer->seqId]); - command = sDat.fonts[sDat.numFonts - result - 1]; - } + if (seqPlayer->defaultFont != 0xFF) + { + SequenceData sDat = ResourceMgr_LoadSeqByName(sequenceMap[seqPlayer->seqId]); + int8_t idx = (sDat.numFonts - result - 1); + + command = sDat.fonts[abs(idx)]; } - if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, command)) { + if (AudioHeap_SearchCaches(FONT_TABLE, CACHE_EITHER, command)) + { channel->fontId = command; } |
