match and link JAUAudioArcInterpreter.cpp

This commit is contained in:
SwareJonge 2023-12-30 15:46:52 +01:00
parent 90c551ff03
commit ef2538e9a9
6 changed files with 138 additions and 2 deletions

View File

@ -389,6 +389,12 @@ libs/JSystem/JAudio/System/JASInstRand.cpp:
.sbss: [0x80415ab0, 0x80415ab8]
.sdata2: [0x80417fb8, 0x80417fd8]
libs/JSystem/JAudio/Utility/JAUAudioArcInterpreter.cpp:
.text: [0x800a506c, 0x800a5560]
.rodata: [0x8036a110, 0x8036a130]
.data: [0x8038f2e0, 0x8038f320]
.sdata2: [0x80418138, 0x80418150]
libs/dolphin/base/PPCArch.c:
.text: [0x800af634, 0x800af748]

View File

@ -377,6 +377,10 @@ libs/JSystem/JAudio/System/JASInstRand.cpp:
.sbss: [0x803d4d40, 0x803d4d48]
.sdata2: [0x803d6e50, 0x803d6e60]
libs/JSystem/JAudio/Utility/JAUAudioArcInterpreter.cpp:
.text: [0x800a23ec, 0x800a28ac]
.data: [0x8034f1e0, 0x8034f220]
libs/dolphin/base/PPCArch.c:
.text: [0x800a9600, 0x800a9714]

View File

@ -49,7 +49,7 @@ public:
JAISoundID() {}
bool isAnonymous() { return mId.mFullId == 0xffffffff; }
bool isAnonymous() const { return mId.mFullId == 0xffffffff; }
void setAnonymous() { mId.mFullId = -1; }
union

View File

@ -26,7 +26,7 @@ public:
bool readCommand_();
bool parse(const void *);
u8 readU8_() { return *mReadPtr++; }
int readU8_() { return *mReadPtr++; } // does this really return int or u32? mkdd release needs it
u32 readU32_()
{

View File

@ -0,0 +1,126 @@
#include "JSystem/JAudio/JAUAudioArchive.h"
#include "JSystem/JUtility/JUTAssert.h"
JAUAudioArcInterpreter::JAUAudioArcInterpreter()
{
mBase = NULL;
mReadPtr = NULL;
}
JAUAudioArcInterpreter::~JAUAudioArcInterpreter() {}
bool JAUAudioArcInterpreter::parse(const void *data)
{
mBase = (const u8 *)data; // save pointer to start of .baa
mReadPtr = mBase;
if (readU32_() != 'AA_<') // start of audio archive
{
return false;
}
while (readCommand_())
{
}
return true;
}
bool JAUAudioArcInterpreter::readCommandMore(u32 cmd) { return false; }
bool JAUAudioArcInterpreter::readCommand_()
{
u32 cmd = readU32_();
switch (cmd)
{
case '>_AA': // end of audio archive
return false;
case 'ws ': // waveform
{
u32 bankNum = readU32_();
u32 startOffset = readU32_();
u32 id = readU32_(); // maybe this is a flag instead? in mkdd it's 0 of 0xffffffff(see JAUSection::loadWaveArc)
readWS(bankNum, getContent_(startOffset), id);
break;
}
case 'bnk ': // bank
{
u32 bankNum = readU32_();
u32 startOffset = readU32_();
readBNK(bankNum, getContent_(startOffset));
break;
}
case 'bl_<': // bank list begin
{
u32 startOffset = readU32_();
u32 cnt = readU32_();
beginBNKList(startOffset, cnt);
break;
}
case '>_bl': // bank list end
endBNKList();
break;
case 'bsc ': // sequence collection?
{
u32 startOffset = readU32_();
u32 endOffset = readU32_();
readBSC(getContent_(startOffset), endOffset - startOffset);
break;
}
case 'bst ': // sound table
{
u32 startOffset = readU32_();
u32 endOffset = readU32_();
readBST(getContent_(startOffset), endOffset - startOffset);
break;
}
case 'bstn': // sound name table
{
u32 startOffset = readU32_();
u32 endOffset = readU32_();
readBSTN(getContent_(startOffset), endOffset - startOffset);
break;
}
case 'bms ': // music sequence?
{
u32 soundId = readU32_();
u32 startOffset = readU32_();
u32 endOffset = readU32_();
readBMS(soundId, getContent_(startOffset), endOffset - startOffset);
break;
}
case 'bmsa': // music sequence archive?
{
u32 var1 = readU32_();
readBMS_fromArchive(var1);
break;
}
case 'dsqb': // dynamic sequence block
{
u32 size = readU32_();
newDynamicSeqBlock(size);
break;
}
case 'bsft': // stream file name table
{
u32 startOffset = readU32_();
readBSFT(getContent_(startOffset));
break;
}
case 'sect':
{
readU8_();
u8 categoryIndex = readU8_();
u8 activeSE = readU8_();
u8 inactiveSE = readU8_();
readMaxSeCategory(categoryIndex, activeSE, inactiveSE);
break;
}
default:
if (!readCommandMore(cmd))
{
#line 138
JUT_ASSERT(false);
}
break;
}
return true;
}