From 1bde6a60bc3eb563fbc12c4441604917aa871b93 Mon Sep 17 00:00:00 2001 From: Sean Gillespie Date: Thu, 16 Apr 2026 18:05:00 -0700 Subject: [PATCH] fix: JAInter::SoundTable::init (#955) --- configure.py | 2 +- src/JSystem/JAudio/JAISoundTable.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/configure.py b/configure.py index 85e746ca1..89cdd1994 100755 --- a/configure.py +++ b/configure.py @@ -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"), ], diff --git a/src/JSystem/JAudio/JAISoundTable.cpp b/src/JSystem/JAudio/JAISoundTable.cpp index b6687259f..b148dac54 100644 --- a/src/JSystem/JAudio/JAISoundTable.cpp +++ b/src/JSystem/JAudio/JAISoundTable.cpp @@ -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(&mAddress[6])[i*2]; - u32 temp = reinterpret_cast(&mAddress[8])[i*2]; + mSoundMax[i] = *reinterpret_cast(&mAddress[i*4 + 6]); + u32 temp = *reinterpret_cast(&mAddress[i*4 + 8]); mPointerCategory[i] = &(reinterpret_cast(&mAddress[0x50])[temp]); if (i < 16 && mSoundMax[i] != 0) {