various Z2Audio / JAudio debug cleanup (#2876)

* some JAudio work

* audio cleanup checkpoint

* checkpoint more audio cleanup

* fix symbols

* more z2 cleanup

* fix regression

* fix build

* some fixes
This commit is contained in:
TakaRikka
2025-11-27 21:19:33 -08:00
committed by GitHub
parent 767caeecc3
commit 6f96e66518
113 changed files with 6425 additions and 5542 deletions
+55 -15
View File
@@ -1,41 +1,81 @@
//
// Generated By: dol2asm
// Translation Unit: Z2AudioArcLoader
//
#include "Z2AudioLib/Z2AudioArcLoader.h"
#include "JSystem/JAudio2/JAUSectionHeap.h"
#include "JSystem/JAudio2/JAUSoundTable.h"
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "Z2AudioLib/Z2FxLineMgr.h"
#include "m_Do/m_Do_ext.h"
/* 802A9A34-802A9A70 2A4374 003C+00 0/0 1/1 0/0 .text __ct__16Z2AudioArcLoaderFP10JAUSection */
Z2AudioArcLoader::Z2AudioArcLoader(JAUSection* param_0) : JAUAudioArcLoader(param_0) {
/* empty function */
}
Z2AudioArcLoader::Z2AudioArcLoader(JAUSection* section) : JAUAudioArcLoader(section) {}
/* 802A9A70-802A9AC8 2A43B0 0058+00 1/0 0/0 0/0 .text readCommandMore__16Z2AudioArcLoaderFUl */
bool Z2AudioArcLoader::readCommandMore(u32 param_0) {
bool Z2AudioArcLoader::readCommandMore(u32 command) {
bool rv = false;
switch (param_0) {
u32 read = 0;
switch (command) {
case 'bfca':
readBFCA(getContent_(readU32_()));
read = readU32_();
readBFCA(getContent_(read));
rv = true;
break;
}
return rv;
}
/* 802A9AC8-802A9B54 2A4408 008C+00 1/1 0/0 0/0 .text readBFCA__16Z2AudioArcLoaderFPCv */
void Z2AudioArcLoader::readBFCA(void const* param_0) {
void Z2AudioArcLoader::readBFCA(const void* addr) {
JUT_ASSERT(76, addr);
JKRHeap* heap = JAUSectionHeap::getInstance()->getHeap();
JKRArchive* archive = JKRMountArchive((void*)param_0, JKRGetCurrentHeap(), JKRArchive::MOUNT_DIRECTION_TAIL);
JUT_ASSERT(78, heap);
JUT_ASSERT(79, Z2GetFxLineMgr());
JKRArchive* archive = JKRMountArchive((void*)addr, JKRGetCurrentHeap(), JKRArchive::MOUNT_DIRECTION_TAIL);
Z2GetFxLineMgr()->initDataArc(archive, heap);
JKRUnmountArchive(archive);
}
/* 802A9B54-802A9B58 2A4494 0004+00 1/0 0/0 0/0 .text readBSTN__16Z2AudioArcLoaderFPCvUl
*/
void Z2AudioArcLoader::readBSTN(void const* param_0, u32 param_1) {
/* empty function */
void Z2AudioArcLoader::readBSTN(const void* addr, u32 param_1) {
#if VERSION == VERSION_SHIELD_DEBUG
JAUSectionHeap* sectionHeap = JASGlobalInstance<JAUSectionHeap>::getInstance();
JUT_ASSERT(97, sectionHeap);
JUT_ASSERT(99, sectionHeap->isOpen());
JUT_ASSERT(100, sectionHeap->isBuilding());
JUT_ASSERT(101, addr);
JUT_ASSERT(103, sectionHeap->getSectionHeapData().soundNameTable == 0);
JKRHeap* heap = JKRHeap::getCurrentHeap();
JKRHeap* gameHeap = (JKRHeap*)mDoExt_getGameHeap();
JKRSetCurrentHeap(gameHeap);
u8* bstnDst = (u8*)addr;
if (param_1 != 0) {
bstnDst = new (gameHeap, 4) u8[param_1];
if (bstnDst != NULL) {
memcpy(bstnDst, addr, param_1);
}
JUT_ASSERT(122, bstnDst);
}
JAUSoundNameTable* soundNameTable = new (gameHeap, 0) JAUSoundNameTable(true);
JUT_ASSERT(125, soundNameTable);
soundNameTable->init(bstnDst);
JAUSectionHeap::TSectionHeapData& sectionHeapData = (JAUSectionHeap::TSectionHeapData&)sectionHeap->getSectionHeapData();
sectionHeapData.soundNameTable = soundNameTable;
JAUSection::TSectionData& sectionData = (JAUSection::TSectionData&)sectionHeap->getSectionData();
sectionData.mBstnDst = bstnDst;
JKRSetCurrentHeap(heap);
#endif
}