fix: JAInter::SoundTable::init (#955)

This commit is contained in:
Sean Gillespie
2026-04-16 18:05:00 -07:00
committed by GitHub
parent 55a6be8b87
commit 1bde6a60bc
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -876,7 +876,7 @@ config.libs = [
Object(Matching, "JSystem/JAudio/JAISequenceHeap.cpp"),
Object(NonMatching, "JSystem/JAudio/JAISequenceMgr.cpp"),
Object(NonMatching, "JSystem/JAudio/JAISound.cpp"),
Object(NonMatching, "JSystem/JAudio/JAISoundTable.cpp"),
Object(Matching, "JSystem/JAudio/JAISoundTable.cpp"),
Object(NonMatching, "JSystem/JAudio/JAIStreamMgr.cpp"),
Object(Matching, "JSystem/JAudio/JAISystemInterface.cpp"),
],
+2 -3
View File
@@ -19,15 +19,14 @@ u8* JAInter::SoundTable::mAddress;
/* 8029B570-8029B6FC .text init__Q27JAInter10SoundTableFPUcUl */
void JAInter::SoundTable::init(u8* param_1, u32 param_2) {
/* Nonmatching - operand swap */
mAddress = param_1;
mDatasize = param_2;
mVersion = param_1[3];
mSoundMax = new (JAIBasic::getCurrentJAIHeap(), 4) u16[18];
mPointerCategory = new (JAIBasic::getCurrentJAIHeap(), 4) SoundInfo*[18];
for (u8 i = 0; i < 18; i++) {
mSoundMax[i] = reinterpret_cast<u16*>(&mAddress[6])[i*2];
u32 temp = reinterpret_cast<u16*>(&mAddress[8])[i*2];
mSoundMax[i] = *reinterpret_cast<u16*>(&mAddress[i*4 + 6]);
u32 temp = *reinterpret_cast<u16*>(&mAddress[i*4 + 8]);
mPointerCategory[i] = &(reinterpret_cast<SoundInfo*>(&mAddress[0x50])[temp]);
if (i < 16 && mSoundMax[i] != 0) {