summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorbriaguya <70942617+briaguya-ai@users.noreply.github.com>2022-12-14 01:33:30 -0500
committerGitHub <noreply@github.com>2022-12-14 01:33:30 -0500
commita6120811d5d270a322e2ec4e9fda01b1fee65b74 (patch)
treed51a730649a89c32b7ecae14c5c5a18f9003ce53 /soh/src/code
parent639e51bb8edcda4a4e7756de88070b7a53b91079 (diff)
parenta05bc1e29f8fa0e85cfb86cde3ee888fd7dcd543 (diff)
bradley -> dev #2187
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/audio_load.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c
index 354119cb2..ad6310157 100644
--- a/soh/src/code/audio_load.c
+++ b/soh/src/code/audio_load.c
@@ -78,6 +78,8 @@ void* sUnusedHandler = NULL;
s32 gAudioContextInitalized = false;
char* sequenceMap[MAX_SEQUENCES];
+// A map of authentic sequence IDs to their cache policies, for use with sequence swapping.
+u8 seqCachePolicyMap[MAX_AUTHENTIC_SEQID];
char* fontMap[256];
uintptr_t fontStart;
@@ -569,15 +571,20 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) {
s32 index;
s32 numFonts;
s32 fontId;
+ s8 authCachePolicy = -1; // since 0 is a valid cache policy value
AudioSeq_SequencePlayerDisable(seqPlayer);
fontId = 0xFF;
if (gAudioContext.seqReplaced[playerIdx]) {
+ authCachePolicy = seqCachePolicyMap[seqId];
seqId = gAudioContext.seqToPlay[playerIdx];
}
SequenceData seqData2 = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
+ if (authCachePolicy != -1) {
+ seqData2.cachePolicy = authCachePolicy;
+ }
for (int i = 0; i < seqData2.numFonts; i++)
{
@@ -1316,6 +1323,7 @@ void AudioLoad_Init(void* heap, size_t heapSize) {
strcpy(str, seqList[i]);
sequenceMap[sDat.seqNumber] = str;
+ seqCachePolicyMap[sDat.seqNumber] = sDat.cachePolicy;
}
free(seqList);