mirror of
https://github.com/HarbourMasters/Starship
synced 2026-05-22 22:44:42 -04:00
Apply F-Zero X version of AudioHeap_DiscardSampleCaches bugfix
This commit is contained in:
@@ -991,16 +991,14 @@ void AudioHeap_DiscardSampleCaches(void) {
|
||||
Instrument* instrument;
|
||||
SampleCacheEntry* entry;
|
||||
|
||||
#ifdef AVOID_UB
|
||||
entry = gPersistentSampleCache.entries;
|
||||
#endif
|
||||
|
||||
for (fontId = 0; fontId < numFonts; fontId++) {
|
||||
sampleBankId1 = gSoundFontList[fontId].sampleBankId1;
|
||||
sampleBankId2 = gSoundFontList[fontId].sampleBankId2;
|
||||
if (((sampleBankId1 != SAMPLES_NONE_U) && (entry->sampleBankId == sampleBankId1)) ||
|
||||
((sampleBankId2 != SAMPLES_NONE) && (entry->sampleBankId == sampleBankId2)) ||
|
||||
(entry->sampleBankId == SAMPLES_SFX)) {
|
||||
// @port: avoid reading from garbage memory,
|
||||
// F-Zero X newer version of this audio driver has this fix:
|
||||
if (((sampleBankId1 != SAMPLES_NONE_U) /* && (entry->sampleBankId == sampleBankId1) */) ||
|
||||
((sampleBankId2 != SAMPLES_NONE) /* && (entry->sampleBankId == sampleBankId2)*/ ) /* ||
|
||||
(entry->sampleBankId == SAMPLES_SFX) */) {
|
||||
if (((void*) AudioHeap_SearchCaches(FONT_TABLE, CACHE_PERMANENT, fontId) != NULL) &&
|
||||
((gFontLoadStatus[fontId] > 1) != 0)) {
|
||||
for (i = 0; i < gPersistentSampleCache.numEntries; i++) {
|
||||
|
||||
Reference in New Issue
Block a user