Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/ShieldD/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2446,14 +2446,14 @@ JSystem/JAudio2/JASOscillator.cpp:
.text start:0x8048A950 end:0x8048B020
.rodata start:0x80654D60 end:0x80654E70
.data start:0x806FDFE8 end:0x806FE028
.sdata start:0x80748938 end:0x8074894C
.sdata start:0x80748938 end:0x80748948
.sdata2 start:0x80751C60 end:0x80751C88

JSystem/JAudio2/JASAiCtrl.cpp:
.text start:0x8048B020 end:0x8048BD30
.rodata start:0x80654E70 end:0x80654E80
.data start:0x806FE028 end:0x806FE188
.sdata start:0x8074894C end:0x80748970
.sdata start:0x80748948 end:0x80748970
.sbss start:0x8074CC68 end:0x8074CCA8
.sdata2 start:0x80751C88 end:0x80751CA8
.bss start:0x807C8D78 end:0x807C8D88
Expand Down
12 changes: 6 additions & 6 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,14 +742,14 @@ def MatchingFor(*versions):
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAExtraShape.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAChildShape.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAExTexShape.cpp"),
Object(NonMatching, "JSystem/JParticle/JPADynamicsBlock.cpp"),
Object(NonMatching, "JSystem/JParticle/JPAFieldBlock.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPADynamicsBlock.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAFieldBlock.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAKeyBlock.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPATexture.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAResourceLoader.cpp"),
Object(Equivalent, "JSystem/JParticle/JPAEmitterManager.cpp", extra_cflags=['-pragma "nosyminline off"']), # weak func order
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAEmitter.cpp"),
Object(NonMatching, "JSystem/JParticle/JPAParticle.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAParticle.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JParticle/JPAMath.cpp"),
],
),
Expand Down Expand Up @@ -826,7 +826,7 @@ def MatchingFor(*versions):
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASTrackPort.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASRegisterParam.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASSeqCtrl.cpp"),
Object(NonMatching, "JSystem/JAudio2/JASSeqParser.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASSeqParser.cpp"),
Object(MatchingFor("GZ2E01"), "JSystem/JAudio2/JASSeqReader.cpp"),
Object(NonMatching, "JSystem/JAudio2/JASAramStream.cpp"),
Object(NonMatching, "JSystem/JAudio2/JASBank.cpp"),
Expand Down Expand Up @@ -907,12 +907,12 @@ def MatchingFor(*versions):
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2SoundStarter.cpp"),
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2SoundHandles.cpp"),
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2SeMgr.cpp"),
Object(NonMatching, "Z2AudioLib/Z2SeqMgr.cpp"),
Object(Equivalent, "Z2AudioLib/Z2SeqMgr.cpp"),
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2StatusMgr.cpp"),
Object(NonMatching, "Z2AudioLib/Z2SceneMgr.cpp"),
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2FxLineMgr.cpp"),
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2SoundInfo.cpp"),
Object(NonMatching, "Z2AudioLib/Z2Audience.cpp"),
Object(Equivalent, "Z2AudioLib/Z2Audience.cpp"),
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2SoundObject.cpp"),
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2SoundObjMgr.cpp"),
Object(MatchingFor("GZ2E01"), "Z2AudioLib/Z2Creature.cpp"),
Expand Down
11 changes: 8 additions & 3 deletions include/JSystem/J3DGraphAnimator/J3DAnimation.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define J3DANIMATION_H

#include "JSystem/J3DGraphAnimator/J3DModelData.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTNameTab.h"
#include "global.h"

Expand Down Expand Up @@ -590,10 +591,11 @@ class J3DAnmTextureSRTKey : public J3DAnmBase {

u16 getUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx]; }
u16 getUpdateMaterialNum() const { return mTrackNum / 3; }
u16 getPostUpdateMaterialNum() const { return field_0x4a / 3; }

int getUpdateTexMtxID(u16 idx) { return mUpdateTexMtxID[idx]; }
int getUpdateTexMtxID(u16 idx) const { return mUpdateTexMtxID[idx]; }
bool isValidUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx] != 0xffff; }
u32 getTexMtxCalcType() const { return mTexMtxCalcType; }
u32 getTexMtxCalcType() { return mTexMtxCalcType; }
Vec* getSRTCenter(u16 idx) { return &mSRTCenter[idx]; }

/* 0x0C */ int mDecShift;
Expand Down Expand Up @@ -719,7 +721,10 @@ class J3DAnmColor : public J3DAnmBase {

u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; }
u16 getUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx]; }
u16 getUpdateMaterialID(u16 idx) const {
JUT_ASSERT_MSG(1578, 0 <= mUpdateMaterialNum - idx, "Error : range over.")
return mUpdateMaterialID[idx];
}

/* 0x0C */ u16 field_0xc;
/* 0x0E */ u16 field_0xe;
Expand Down
4 changes: 4 additions & 0 deletions include/JSystem/JAudio2/JASDSPInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ namespace JASDsp {
extern TChannel* CH_BUF;
extern FxBuf* FX_BUF;
extern f32 sDSPVolume;

#ifdef DEBUG
extern s32 dspMutex;
#endif
};

u16 DSP_CreateMap2(u32 msg);
Expand Down
12 changes: 8 additions & 4 deletions include/JSystem/JAudio2/JASHeapCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JSupport/JSUList.h"
#include "JSystem/JUtility/JUTAssert.h"
#include <dolphin/os.h>
#include <dolphin/os.h>

Expand Down Expand Up @@ -112,7 +113,7 @@ class JASMemChunkPool : public OSMutex {
mChunks = 0;
}

bool checkArea(void* ptr) {
bool checkArea(const void* ptr) const {
return (u8*)this + 0xc <= (u8*)ptr && (u8*)ptr < (u8*)this + (ChunkSize + 0xc);
}

Expand All @@ -127,11 +128,11 @@ class JASMemChunkPool : public OSMutex {
return rv;
}

void free() {
void free(void* mem) {
mChunks--;
}

bool isEmpty() {
bool isEmpty() const {
return mChunks == 0;
}

Expand Down Expand Up @@ -201,7 +202,8 @@ class JASMemChunkPool : public OSMutex {
MemoryChunk* prevChunk = NULL;
while (chunk != NULL) {
if (chunk->checkArea(ptr)) {
chunk->free();
chunk->free(ptr);

if (chunk != field_0x18 && chunk->isEmpty()) {
MemoryChunk* nextChunk = chunk->getNextChunk();
delete chunk;
Expand All @@ -212,6 +214,8 @@ class JASMemChunkPool : public OSMutex {
prevChunk = chunk;
chunk = chunk->getNextChunk();
}

JUT_PANIC(362,"Cannnot free for JASMemChunkPool")
}

/* 0x18 */ MemoryChunk* field_0x18;
Expand Down
8 changes: 4 additions & 4 deletions include/JSystem/JAudio2/JASSeqCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class JASSeqCtrl {
const JASSeqReader* getSeqReader() const { return &mReader; }
void* getBase() { return mReader.getBase(); }
void* getAddr(u32 param_0) { return mReader.getAddr(param_0); }
u8 getByte(u32 param_0) { return mReader.getByte(param_0); }
u16 get16(u32 param_0) { return mReader.get16(param_0); }
u32 get24(int param_0) { return mReader.get24(param_0); }
u32 get32(u32 param_0) { return mReader.get32(param_0); }
u8 getByte(u32 param_0) const { return mReader.getByte(param_0); }
u16 get16(u32 param_0) const { return mReader.get16(param_0); }
u32 get24(u32 param_0) const { return mReader.get24(param_0); }
u32 get32(u32 param_0) const { return mReader.get32(param_0); }
void* getCur() { return mReader.getCur(); }
u32 readByte() { return mReader.readByte(); }
u32 read16() { return mReader.read16(); }
Expand Down
23 changes: 12 additions & 11 deletions include/JSystem/JAudio2/JASSeqReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,30 @@ class JASSeqReader {
field_0x04 = (u8*)param_1;
}

u32 get24(int param_0) {
u32 get24(int param_0) const {
return (*(u32*)(field_0x00 + param_0 - 1)) & 0xffffff;
}

u32* getBase() { return (u32*)field_0x00; }
void* getAddr(u32 param_0) { return field_0x00 + param_0; }
u8 getByte(u32 param_0) { return *(field_0x00 + param_0); }
u16 get16(u32 param_0) { return *(u16*)(field_0x00 + param_0); }
u32 get32(u32 param_0) { return *(u32*)(field_0x00 + param_0); }
u8 getByte(u32 param_0) const { return *(field_0x00 + param_0); }
u16 get16(u32 param_0) const { return *(u16*)(field_0x00 + param_0); }
u32 get32(u32 param_0) const { return *(u32*)(field_0x00 + param_0); }
u8* getCur() { return field_0x04; }
u32 readByte() { return *field_0x04++; }
u32 read16() {
u16* tmp = (u16*)field_0x04;
field_0x04 += 2;
return *tmp;
return *((u16*)field_0x04)++;
}
u32 read24() {
field_0x04--;
u32* tmp = (u32*)field_0x04;
field_0x04 += 4;
return *tmp & 0x00ffffff;
return (*((u32*)field_0x04)++) & 0x00ffffff;
}
u16 getLoopCount() const {
if (field_0x08 == 0) {
return 0;
}
return field_0x2c[field_0x08 - 1];
}
u16 getLoopCount() const { return field_0x08 == 0 ? 0 : field_0x2c[field_0x08 - 1]; }

/* 0x00 */ u8* field_0x00;
/* 0x04 */ u8* field_0x04;
Expand Down
23 changes: 14 additions & 9 deletions include/JSystem/JAudio2/JASTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace JASDsp {
extern const u32 FILTER_MODE_IIR;
};

#define MAX_CHILDREN 16

/**
* @ingroup jsystem-jaudio
*
Expand Down Expand Up @@ -125,14 +127,17 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
static TList sTrackList;

JASSeqCtrl* getSeqCtrl() { return &mSeqCtrl; }
u16 getPort(u32 param_0) { return mTrackPort.get(param_0); }
u16 getPort(u32 param_0) const { return mTrackPort.get(param_0); }
void setPort(u32 param_0, u16 param_1) { mTrackPort.set(param_0, param_1); }
u32 checkPortIn(u32 param_0) { return mTrackPort.checkImport(param_0); }
u32 checkPort(u32 param_0) { return mTrackPort.checkExport(param_0); }
u32 checkPortIn(u32 param_0) const { return mTrackPort.checkImport(param_0); }
u32 checkPort(u32 param_0) const { return mTrackPort.checkExport(param_0); }
u32 readReg(JASRegisterParam::RegID param_0) { return mRegisterParam.read(param_0); }
void writeReg(JASRegisterParam::RegID param_0, u32 param_1) { mRegisterParam.write(param_0, param_1); }
JASTrack* getParent() { return mParent; }
JASTrack* getChild(u32 index) { return mChildren[index]; }
JASTrack* getChild(u32 index) {
JUT_ASSERT(115, index < MAX_CHILDREN)
return mChildren[index];
}
int getChannelMgrCount() { return mChannelMgrCount; }
f32 getVibDepth() const { return mVibDepth; }
void setVibDepth(f32 param_0) { mVibDepth = param_0; }
Expand All @@ -142,9 +147,9 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
void setTremDepth(f32 param_0) { mTremDepth = param_0; }
f32 getTremPitch() const { return mTremPitch; }
void setTremPitch(f32 param_0) { mTremPitch = param_0; }
u16 getVibDelay() const { return mVibDelay; }
u32 getVibDelay() const { return mVibDelay; }
void setVibDelay(u32 param_0) { mVibDelay = param_0; }
u16 getTremDelay() const { return mTremDelay; }
u32 getTremDelay() const { return mTremDelay; }
void setTremDelay(u32 param_0) { mTremDelay = param_0; }
u8 getStatus() const { return mStatus; }
void setAutoDelete(u8 param_0) { mFlags.autoDelete = param_0; }
Expand All @@ -155,8 +160,8 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
u16 getDirectRelease() const { return mDirectRelease; }
void setDirectRelease(u16 param_0) {mDirectRelease = param_0; }
u16 getTimebase() const { return mTimebase; }
s8 getTranspose() const { return mTranspose; }
void setTranspose(u32 param_0) { mTranspose = param_0; }
int getTranspose() const { return mTranspose; }
void setTranspose(s32 param_0) { mTranspose = param_0; }
u16 getBankNumber() const { return mBankNumber; }
void setBankNumber(u16 param_0) { mBankNumber = param_0; }
u16 getProgNumber() const { return mProgNumber; }
Expand Down Expand Up @@ -187,7 +192,7 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> {
/* 0x0e4 */ JASOscillator::Data mOscParam[2];
/* 0x114 */ JASOscillator::Point mOscPoint[4];
/* 0x12C */ JASTrack* mParent;
/* 0x130 */ JASTrack* mChildren[16];
/* 0x130 */ JASTrack* mChildren[MAX_CHILDREN];
/* 0x170 */ TChannelMgr* mChannelMgrs[4];
/* 0x180 */ TChannelMgr mDefaultChannelMgr;
/* 0x1D0 */ int mChannelMgrCount;
Expand Down
2 changes: 1 addition & 1 deletion include/JSystem/JAudio2/JASTrackPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class JASTrackPort {
/* 8029360C */ u32 checkImport(u32) const;
/* 80293628 */ u32 checkExport(u32) const;

u16 get(u32 param_0) { return field_0x4[param_0]; }
u16 get(u32 param_0) const { return field_0x4[param_0]; }
void set(u32 param_0, u16 param_1) { field_0x4[param_0] = param_1; }

u16 field_0x0;
Expand Down
Loading