mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-29 12:52:18 -05:00
Always use authentic cache policy for replaced seqs (#2176)
This commit is contained in:
parent
639e51bb8e
commit
7718e74d73
@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
extern char* fontMap[256];
|
extern char* fontMap[256];
|
||||||
|
|
||||||
|
#define MAX_AUTHENTIC_SEQID 110
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/* 0 */ ADSR_STATE_DISABLED,
|
/* 0 */ ADSR_STATE_DISABLED,
|
||||||
/* 1 */ ADSR_STATE_INITIAL,
|
/* 1 */ ADSR_STATE_INITIAL,
|
||||||
|
@ -7,7 +7,6 @@ void SfxEditor_AddSequence(char *otrPath, uint16_t seqNum);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define INSTRUMENT_OFFSET 0x81
|
#define INSTRUMENT_OFFSET 0x81
|
||||||
#define MAX_AUTHENTIC_SEQID 110
|
|
||||||
|
|
||||||
enum SeqType {
|
enum SeqType {
|
||||||
SEQ_NOSHUFFLE = 0,
|
SEQ_NOSHUFFLE = 0,
|
||||||
|
@ -78,6 +78,8 @@ void* sUnusedHandler = NULL;
|
|||||||
s32 gAudioContextInitalized = false;
|
s32 gAudioContextInitalized = false;
|
||||||
|
|
||||||
char* sequenceMap[MAX_SEQUENCES];
|
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];
|
char* fontMap[256];
|
||||||
|
|
||||||
uintptr_t fontStart;
|
uintptr_t fontStart;
|
||||||
@ -569,15 +571,20 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) {
|
|||||||
s32 index;
|
s32 index;
|
||||||
s32 numFonts;
|
s32 numFonts;
|
||||||
s32 fontId;
|
s32 fontId;
|
||||||
|
s8 authCachePolicy = -1; // since 0 is a valid cache policy value
|
||||||
|
|
||||||
AudioSeq_SequencePlayerDisable(seqPlayer);
|
AudioSeq_SequencePlayerDisable(seqPlayer);
|
||||||
|
|
||||||
fontId = 0xFF;
|
fontId = 0xFF;
|
||||||
|
|
||||||
if (gAudioContext.seqReplaced[playerIdx]) {
|
if (gAudioContext.seqReplaced[playerIdx]) {
|
||||||
|
authCachePolicy = seqCachePolicyMap[seqId];
|
||||||
seqId = gAudioContext.seqToPlay[playerIdx];
|
seqId = gAudioContext.seqToPlay[playerIdx];
|
||||||
}
|
}
|
||||||
SequenceData seqData2 = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
|
SequenceData seqData2 = ResourceMgr_LoadSeqByName(sequenceMap[seqId]);
|
||||||
|
if (authCachePolicy != -1) {
|
||||||
|
seqData2.cachePolicy = authCachePolicy;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < seqData2.numFonts; i++)
|
for (int i = 0; i < seqData2.numFonts; i++)
|
||||||
{
|
{
|
||||||
@ -1316,6 +1323,7 @@ void AudioLoad_Init(void* heap, size_t heapSize) {
|
|||||||
strcpy(str, seqList[i]);
|
strcpy(str, seqList[i]);
|
||||||
|
|
||||||
sequenceMap[sDat.seqNumber] = str;
|
sequenceMap[sDat.seqNumber] = str;
|
||||||
|
seqCachePolicyMap[sDat.seqNumber] = sDat.cachePolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(seqList);
|
free(seqList);
|
||||||
|
Loading…
Reference in New Issue
Block a user