diff --git a/configure.py b/configure.py index f8fadf0c..d954e396 100755 --- a/configure.py +++ b/configure.py @@ -858,7 +858,7 @@ def MatchingFor(*versions): Object(Matching, "JSystem/JAudio/System/JASCallback.cpp"), Object(Matching, "JSystem/JAudio/System/JASCmdStack.cpp"), Object(Matching, "JSystem/JAudio/System/JASDvdThread.cpp"), - Object(Equivalent, "JSystem/JAudio/System/JASHeapCtrl.cpp"), + Object(Matching, "JSystem/JAudio/System/JASHeapCtrl.cpp"), Object(Matching, "JSystem/JAudio/System/JASProbe.cpp"), Object(Matching, "JSystem/JAudio/System/JASReport.cpp"), Object(Matching, "JSystem/JAudio/System/JASResArcLoader.cpp"), @@ -904,7 +904,7 @@ def MatchingFor(*versions): Object(Matching, "JSystem/JAudio/Utility/JAUAudioArcInterpreter.cpp"), Object(Matching, "JSystem/JAudio/Utility/JAUAudioArcLoader.cpp"), - Object(NonMatching, "JSystem/JAudio/Utility/JAUAudioMgr.cpp"), + Object(Matching, "JSystem/JAudio/Utility/JAUAudioMgr.cpp"), Object(Matching, "JSystem/JAudio/Utility/JAUBankTable.cpp"), Object(Matching, "JSystem/JAudio/Utility/JAUClusterSound.cpp"), Object(Matching, "JSystem/JAudio/Utility/JAUInitializer.cpp"), @@ -914,7 +914,7 @@ def MatchingFor(*versions): Object(Matching, "JSystem/JAudio/Utility/JAUSoundMgr.cpp"), Object(Matching, "JSystem/JAudio/Utility/JAUSoundTable.cpp"), Object(Matching, "JSystem/JAudio/Utility/JAUStreamFileTable.cpp"), - Object(NonMatching, "JSystem/JAudio/Utility/JAUAudience.cpp"), + Object(Equivalent, "JSystem/JAudio/Utility/JAUAudience.cpp"), Object(Matching, "JSystem/JAudio/Utility/JAUSectionHeap.cpp"), Object(Matching, "JSystem/JAudio/Utility/JAUSoundObject.cpp") ] diff --git a/include/Inagaki/GameSoundMgr.h b/include/Inagaki/GameSoundMgr.h index 430d10f3..2d1a8b48 100644 --- a/include/Inagaki/GameSoundMgr.h +++ b/include/Inagaki/GameSoundMgr.h @@ -6,7 +6,6 @@ #include "Inagaki/GameAudioMain.h" #include "JSystem/JAudio/Interface/JAISound.h" #include "JSystem/JAudio/Interface/JAISoundHandles.h" -#include "JSystem/JAudio/JAUSoundMgr.h" #include "JSystem/JGeometry/Vec.h" #include "JSystem/JUtility/JUTAssert.h" #include "Kaneshige/Course/CrsArea.h" diff --git a/include/Inagaki/GameSoundTable.h b/include/Inagaki/GameSoundTable.h index 1cbae3ae..acca7c4b 100644 --- a/include/Inagaki/GameSoundTable.h +++ b/include/Inagaki/GameSoundTable.h @@ -3,7 +3,7 @@ #include #include -#include +#include "JSystem/JAudio/JAUAudience.h" #include "JSystem/JAudio/JAUSoundTable.h" namespace GameAudio diff --git a/include/JSystem/JAudio/JAUAudience.h b/include/JSystem/JAudio/JAUAudience.h index a0e0d80e..f78535bd 100644 --- a/include/JSystem/JAudio/JAUAudience.h +++ b/include/JSystem/JAudio/JAUAudience.h @@ -40,19 +40,42 @@ struct JAUAudibleParam { } _00; }; +class JAUSoundInfo : public JASGlobalInstance +{ +public: + JAUSoundInfo(bool param_1) : JASGlobalInstance(param_1) {} + virtual u16 getAudibleSw(JAISoundID) const = 0; + virtual u16 getBgmSeqResourceID(JAISoundID) const = 0; + + JAUAudibleParam getAudibleSwFull(JAISoundID soundID) { + JAUAudibleParam audibleParams; + audibleParams._00.half.f0 = getAudibleSw(soundID); + audibleParams._00.half.f1 = 0xffff; + return audibleParams; + } +}; class JAUAudibleAbsPos { public: JAUAudibleAbsPos() {} ~JAUAudibleAbsPos() {} + void init(JGeometry::TVec3f* param_0, const JGeometry::TVec3f& param_1, const JGeometry::TVec3f* param_2) { + param_0->set(param_1); + if (param_2 != NULL) { + _00.set(*param_2); + velocity_.sub(param_1, _00); + } else { + _00.set(param_1); + velocity_.zero(); + } + } + void calc(const JGeometry::TVec3f &p1) { - _0C.sub(p1, _00); - _00.set(p1); } JGeometry::TVec3f _00; - JGeometry::TVec3f _0C; + JGeometry::TVec3f velocity_; }; class JAUDopplerAudibleAbsPos { @@ -60,13 +83,24 @@ class JAUDopplerAudibleAbsPos { JAUDopplerAudibleAbsPos() {} ~JAUDopplerAudibleAbsPos() {} + void init(JGeometry::TVec3f* param_0, const JGeometry::TVec3f& param_1, const JGeometry::TVec3f* param_2) { + param_0->set(param_1); + if (param_2 != NULL) { + _00.set(*param_2); + velocity_.sub(param_1, _00); + } else { + _00.set(param_1); + velocity_.zero(); + } + } + void calc(const JGeometry::TVec3f &p1) { - _0C.sub(p1, _00); + velocity_.sub(p1, _00); _00.set(p1); } JGeometry::TVec3f _00; - JGeometry::TVec3f _0C; + JGeometry::TVec3f velocity_; }; class JAUAudibleRelPos { @@ -82,6 +116,11 @@ class JAUAudibleChannel { public: JAUAudibleChannel() {} + void init() { + params_.init(); + _30 = 1.0f; + } + JASSoundParams params_; JGeometry::TVec3f _14; JGeometry::TVec3f _20; @@ -114,6 +153,13 @@ class JAUAudience_withSetting : public JAIAudience { updateSetting(); } ~JAUAudience_withSetting() {} + + //virtual JAIAudible *newAudible(const JGeometry::TVec3f &, JAISoundID soundID, const JGeometry::TVec3f *, u32 channels) = 0; + //virtual int getMaxChannels() = 0; + //virtual void deleteAudible(JAIAudible *audible) = 0; + //virtual u32 calcPriority(JAIAudible *audible) = 0; + //virtual void mixChannelOut(const JASSoundParams ¶ms, JAIAudible *audible, int channel) = 0; + void updateSetting(); struct { @@ -149,67 +195,7 @@ class JAUAudience_withSetting_doppler : public JAUAudience_withSetting { }; -class JAUAudienceState { -public: - JAUAudienceState() {} - //~JAUAudienceState() {} - - void init() { - Mtx m; - PSMTXIdentity(m); - resetMtx(m); - } - void resetMtx(const Mtx in) { - JGeometry::TPos3f m; - mMtx.set(in); - m.setPositionFromLookAt(mMtx); - m.getTrans(_3c); - _48.set(_3c); - _30.zero(); - - } - - JGeometry::TPos3f mMtx; - JGeometry::TVec3f _30; - JGeometry::TVec3f _3c; - JGeometry::TVec3f _48; -}; - -class JAUDopplerAudienceState { -public: - JAUDopplerAudienceState() {} - //~JAUDopplerAudienceState() {} - - void init() { - Mtx m; - PSMTXIdentity(m); - resetMtx(m); - } - void resetMtx(const Mtx in) { - JGeometry::TPos3f m; - mMtx.set(in); - m.setPositionFromLookAt(mMtx); - m.getTrans(_3c); - _48.set(_3c); - _30.zero(); - } - - void setMtx(const Mtx in) { - JGeometry::TPos3f m; - _48.set(_3c); - mMtx.set(in); - m.setPositionFromLookAt(mMtx); - m.getTrans(_3c); - _30.sub(_3c, _48); - } - - JGeometry::TPos3f mMtx; - JGeometry::TVec3f _30; - JGeometry::TVec3f _3c; - JGeometry::TVec3f _48; - -}; // Size: 0x54 class JAUDopplerAudibleChannel : public JAUAudibleChannel { public: @@ -219,13 +205,39 @@ class JAUDopplerAudibleChannel : public JAUAudibleChannel { template class JAUGenericAudible_ : public JAIAudible { public: - JAUGenericAudible_() {} + JAUGenericAudible_(const JGeometry::TVec3f &pos, const JGeometry::TVec3f *p3, u32 channel) { + audiblep._00.raw = 0xffffffff; + absPos_.init(&mPos, pos, p3); + for (int i = 0; i < N; i++) { + if ((channel & (1 << i)) == 0) { + channels[i].init(); + channel_[i] = &channels[i]; + } + else { + channel_[i] = NULL; + } + } + } ~JAUGenericAudible_() {} void calc() { absPos_.calc(mPos); } + u32 getDistVolBit() { + u16 uVar1 = getAudibleParam()._00.half.f1; + if (uVar1 != 0) { + if ((uVar1 & 7) != 0) { + return uVar1 & 7; + } + if ((uVar1 & 0x70) != 0) { + return ((int)(uVar1 & 0x70) >> 4) + 7; + } + } + + return 0; + } + JASSoundParams *getOuterParams(int index) { #line 483 JUT_ASSERT(index >= 0); @@ -247,6 +259,10 @@ class JAUGenericAudible_ : public JAIAudible { JAUAudibleParam &getAudibleParam() { return audiblep; } const JAUAudibleParam getAudibleParam() const { return audiblep; } + void setAudibleParam(JAUAudibleParam param) { + audiblep = param; + } + static const int MAX_CHANNELS = N; JAUAudibleParam audiblep; @@ -264,7 +280,8 @@ class JAUAudience_ : public Audience { } } ~JAUAudience_() { - +#line 617 + JUT_ASSERT(!isActive()); } bool isActive() const { return Audible::getTotalMemCount() != Audible::getFreeMemCount(); }; @@ -302,7 +319,7 @@ class JAUAudience_ : public Audience { f32 calcPitch_(JAUAudibleChannel *channel, const Audible *audible, int index) { JAUAudibleParam audParam = audible->getAudibleParam(); if ((*(u8*)&audParam._00.raw >> 4) & 0xf) { // probably fake - f32 dopplerPwr = calcPitchDoppler_(channel->_20, state[index]._30, audible->absPos_._0C, audible->getAudibleParam().getDopplerPower()); + f32 dopplerPwr = calcPitchDoppler_(channel->_20, state[index]._30, audible->absPos_.velocity_, audible->getAudibleParam().getDopplerPower()); if (channel->_30 > 0.0f) { if (channel->_30 > (dopplerPwr * this->setting_._34)) { @@ -406,48 +423,63 @@ class JAUAudience_ : public Audience { u32 calcPriority(JAIAudible *i_audible) { u32 deltaPriority[N]; + Audible *audible = (Audible*)i_audible; - JAUAudibleChannel *channel; // regswap most likely caused by missing inline(convertAbsToRel) if (!audible->getAudibleParam()._00.bytes.b0_4) { + for (int i = 0; i < numPlayers_; i++) { - channel = audible->getChannel(i); - if (channel != NULL) { - JGeometry::TVec3f diff; - diff.sub(audible->mPos, state[i]._3c); - PSMTXMultVecSR(state[i].mMtx, &diff, &channel->_14); - channel->_2C = channel->_20.normalize(diff); - } + state[i].convertAbsToRel(audible, i); } return 0; - } else { - u32 rv = 0xffffffff; - for (int i = 0; i < numPlayers_; i++) { - channel = (audible)->getChannel(i); - if (channel != NULL) { - JGeometry::TVec3f diff; - diff.sub(audible->mPos, state[i]._3c); - PSMTXMultVecSR(state[i].mMtx, &diff, &channel->_14); - channel->_2C = channel->_20.normalize(diff); - deltaPriority[i] = calcDeltaPriority_(channel->_2C, audible->getAudibleParam()._00.bytes.b0_7); - if (deltaPriority[i] < rv) { - rv = deltaPriority[i]; - } + } + + u32 rv = 0xffffffff; + for (int i = 0; i < numPlayers_; i++) { + JAUAudibleChannel *channel = audible->getChannel(i); + if (channel) { + // something is wrong here with convertAbsToRel, + // it's supposed to be this: state[i].convertAbsToRel(audible, i); + // however that creates more asserts, and making a new inline without asserts doesn't fix it either + channel->_2C = state[i].convertAbsToRel(audible->mPos, &channel->_20, &channel->_14); + + deltaPriority[i] = calcDeltaPriority_(channel->_2C, audible->getAudibleParam()._00.bytes.b0_7); + if (deltaPriority[i] < rv) { + rv = deltaPriority[i]; } - } - return rv; + } } - + return rv; } + void deleteAudible(JAIAudible *audible) { delete audible; } - JAIAudible *newAudible(const JGeometry::TVec3f &p1, JAISoundID soundID, const JGeometry::TVec3f *p3, u32 channel) { - u32 uVar4 = channel | ~((1 << numPlayers_) + -1); - if (uVar4 == 0xffffffff) { + JAIAudible *newAudible(const JGeometry::TVec3f &pos, JAISoundID soundID, const JGeometry::TVec3f *p3, u32 channels) { + u32 channelNum = channels | ~((1 << numPlayers_) - 1); + if (channelNum == 0xffffffff) { JUT_WARNING_F2("%s", "You masked all audible channels !") return NULL; } - return new Audible(); + + Audible *audible = new Audible(pos, p3, channelNum); + if (audible == NULL) { + return NULL; + } + + for (int i = 0; i < numPlayers_; i++) { + state[i].convertAbsToRel(audible, i); + } + + if (JAUSoundInfo::getInstance()) { + u16 sw = JAUSoundInfo::getInstance()->getAudibleSw(soundID); + JAUAudibleParam audibleParams; + audibleParams._00.half.f0 = sw; + audibleParams._00.half.f1 = 0xffff; + + audible->setAudibleParam(audibleParams); + } + + return audible; } void setAudienceMtx(MtxPtr m, int playerNumber, bool doReset) { @@ -471,7 +503,9 @@ class JAUAudience_ : public Audience { template class JAUAudible : public JAUGenericAudible_, public JASPoolAllocObject< JAUAudible > { public: - JAUAudible() { + typedef JAUGenericAudible_ BaseAudible; + + JAUAudible(const JGeometry::TVec3f &pos, const JGeometry::TVec3f *p3, u32 channel) : BaseAudible(pos, p3, channel) { } ~JAUAudible() { @@ -481,14 +515,121 @@ class JAUAudible : public JAUGenericAudible_ class JAUDopplerAudible : public JAUGenericAudible_, public JASPoolAllocObject< JAUDopplerAudible > { public: - JAUDopplerAudible() { + typedef JAUGenericAudible_ BaseAudible; + + JAUDopplerAudible(const JGeometry::TVec3f &pos, const JGeometry::TVec3f *p3, u32 channel) : BaseAudible(pos, p3, channel) { } ~JAUDopplerAudible() { } + + }; +class JAUAudienceState { +public: + JAUAudienceState() {} + //~JAUAudienceState() {} + + void init() { + Mtx m; + PSMTXIdentity(m); + resetMtx(m); + } + void resetMtx(const Mtx in) { + JGeometry::TPos3f m; + mMtx.set(in); + //m.setPositionFromLookAt(mMtx); + m.getTrans(_3c); + _48.set(_3c); + _30.zero(); + + } + + f32 convertAbsToRel(const JGeometry::TVec3f& src, JGeometry::TVec3f* src2, JGeometry::TVec3f* dst) { + JGeometry::TVec3f diff; + diff.sub(src, _3c); + PSMTXMultVecSR(mMtx, &diff, dst); + return src2->normalize(diff); + } + + template + void convertAbsToRel(JAUAudible *audible, int i) { + JAUAudibleChannel *channel = audible->getChannel(i); + if (channel == NULL) + return; + + JGeometry::TVec3f diff; + diff.sub(audible->mPos, _3c); + PSMTXMultVecSR(mMtx, &diff, &channel->_14); + channel->_2C = channel->_20.normalize(diff); + return; + } + + JGeometry::TPos3f mMtx; + JGeometry::TVec3f _30; + JGeometry::TVec3f _3c; + JGeometry::TVec3f _48; + +}; + +class JAUDopplerAudienceState { +public: + JAUDopplerAudienceState() {} + //~JAUDopplerAudienceState() {} + + void init() { + Mtx m; + PSMTXIdentity(m); + resetMtx(m); + } + void resetMtx(const Mtx in) { + JGeometry::TPos3f m; + mMtx.set(in); + m.setPositionFromLookAt(mMtx); + m.getTrans(_3c); + _48.set(_3c); + _30.zero(); + } + + void setMtx(const Mtx in) { + JGeometry::TPos3f m; + _48.set(_3c); + mMtx.set(in); + m.setPositionFromLookAt(mMtx); + m.getTrans(_3c); + _30.sub(_3c, _48); + } + + + f32 convertAbsToRel(const JGeometry::TVec3f &src, JGeometry::TVec3f* src2, JGeometry::TVec3f* dst) { + JGeometry::TVec3f diff; + diff.sub(src, _3c); + PSMTXMultVecSR(mMtx, &diff, dst); + return src2->normalize(diff); + } + + template + void convertAbsToRel(JAUDopplerAudible *audible, int i) { + JAUAudibleChannel *channel = audible->getChannel(i); + if (channel == NULL) + return; + + JGeometry::TVec3f diff; + diff.sub(audible->mPos, _3c); + PSMTXMultVecSR(mMtx, &diff, &channel->_14); + channel->_2C = channel->_20.normalize(diff); + + } + + JGeometry::TPos3f mMtx; + JGeometry::TVec3f _30; + JGeometry::TVec3f _3c; + JGeometry::TVec3f _48; + +}; // Size: 0x54 + template class JAUAudience : public JAUAudience_, JAUAudienceState, JAUAudience_withSetting> { diff --git a/include/JSystem/JAudio/JAUAudioMgr.h b/include/JSystem/JAudio/JAUAudioMgr.h index 11a1c5b2..b305d1ee 100644 --- a/include/JSystem/JAudio/JAUAudioMgr.h +++ b/include/JSystem/JAudio/JAUAudioMgr.h @@ -2,17 +2,19 @@ #define JAUDIO_JAUAUDIOMGR_H #include "JSystem/JAudio/JAUAudience.h" -#include "JSystem/JAudio/JAUSoundInfo.h" #include "JSystem/JAudio/JAUSoundMgr.h" #include "JSystem/JAudio/JAUSectionHeap.h" #include "JSystem/JAudio/System/JASHeap.h" -// fabricated +// fabricated, likely inheris JAUStdSoundInfo? however i'm not willing to dig into it as i'd need to base it of unused symbols +// probably similar to this https://github.com/zeldaret/tp/blob/main/include/Z2AudioLib/Z2SoundInfo.h +// https://github.com/zeldaret/tp/blob/main/include/Z2AudioLib/Z2AudioMgr.h class JAUAudioMgr : public JAUSoundMgr, JAUSoundInfo { public: JAUAudioMgr(JAUSectionHeap *); private: //JAUAudience<4> audience; + JAUAudience<4> mAudience; JASHeap mHeaps[4]; }; diff --git a/include/JSystem/JAudio/JAUSoundAnimator.h b/include/JSystem/JAudio/JAUSoundAnimator.h index 00d809cc..abc6f6f1 100644 --- a/include/JSystem/JAudio/JAUSoundAnimator.h +++ b/include/JSystem/JAudio/JAUSoundAnimator.h @@ -1,6 +1,7 @@ #ifndef JAUDIO_JAUSOUNDANIMATOR_H #define JAUDIO_JAUSOUNDANIMATOR_H +#include "JSystem/JAudio/Interface/JAISound.h" #include "JSystem/JAudio/Interface/JAISoundHandles.h" #include "JSystem/JAudio/System/JASSoundParams.h" #include "JSystem/JUtility/JUTAssert.h" @@ -77,7 +78,7 @@ class JAUSoundAnimationSound { class JAUSoundAnimationControl { public: virtual ~JAUSoundAnimationControl() = 0; - virtual JAUSoundAnimationSound* getSound(const JAUSoundAnimation*, int) = 0; + virtual /*const*/ JAUSoundAnimationSound* getSound(const JAUSoundAnimation*, int) = 0; virtual u16 getNumSounds(const JAUSoundAnimation*) = 0; }; @@ -122,6 +123,9 @@ class JAUSoundAnimator { void startAnimation(const JAUSoundAnimation *animation, bool, f32, f32); void updateAnimation(f32, const JGeometry::TVec3f&, JAISoundStarter *starter); + int getNumHandles() const { return handles_->getNumHandles(); } + JAISoundHandle &getHandle(int index) { return handles_->getHandle(index); } + void setLoopStartFrame(f32 val) { #line 178 JUT_ASSERT(animation_); diff --git a/include/JSystem/JAudio/JAUSoundInfo.h b/include/JSystem/JAudio/JAUSoundInfo.h deleted file mode 100644 index 3be62992..00000000 --- a/include/JSystem/JAudio/JAUSoundInfo.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef JAUDIO_JAUSOUNDINFO_H -#define JAUDIO_JAUSOUNDINFO_H - -#include "JSystem/JAudio/Interface/JAISound.h" -#include "JSystem/JAudio/System/JASGadget.h" - -class JAUSoundInfo : public JASGlobalInstance -{ -public: - JAUSoundInfo(bool param_1) : JASGlobalInstance(param_1) {} - virtual u16 getAudibleSw(JAISoundID) const = 0; - virtual u16 getBgmSeqResourceID(JAISoundID) const = 0; -}; - -#endif /* JAUDIO_JAUSOUNDINFO_H */ diff --git a/include/JSystem/JAudio/System/JASGadget.h b/include/JSystem/JAudio/System/JASGadget.h index be5f094c..1fcd53ef 100644 --- a/include/JSystem/JAudio/System/JASGadget.h +++ b/include/JSystem/JAudio/System/JASGadget.h @@ -17,6 +17,9 @@ template class JASGlobalInstance { public: + JASGlobalInstance(T* inst) { + sInstance = inst; + } JASGlobalInstance(bool param_1) { if (param_1) @@ -85,4 +88,4 @@ class JASPtrArray : public JASPtrTable T *mArray[N]; }; -#endif /* JAUDIO_JASGADGET_H */ \ No newline at end of file +#endif /* JAUDIO_JASGADGET_H */ diff --git a/libs/JSystem/JAudio/System/JASHeapCtrl.cpp b/libs/JSystem/JAudio/System/JASHeapCtrl.cpp index 6f970564..b882733d 100644 --- a/libs/JSystem/JAudio/System/JASHeapCtrl.cpp +++ b/libs/JSystem/JAudio/System/JASHeapCtrl.cpp @@ -142,11 +142,16 @@ void JASHeap::dump() { } void JASHeap::dump(int level) { - // JUTAssertion::showAssert needs to not inline here + // JUTAssertion::showAssert needs to not inline here, so it's likely something like this + JUT_REPORT_MSG("------------------------------------\n"); JUT_REPORT_MSG(" "); JUT_ASSERT(level >= 0 && level < 7) - JUT_REPORT_MSG("%s Heap %08x [Addr %8x , Max %8x] %c\n", _40, mBase, mBase + mSize, level) + JASMutexLock lock(&mMutex); + for (JSUTreeIterator it = mTree.getFirstChild(); it != mTree.getEndChild(); it++) { + JUT_REPORT_MSG("%s Heap %08x [Addr %8x , Max %8x] %c\n", it->_40, it->mBase, it->mBase + it->mSize, level); + it->dump(level); + } // functions emitted: // void JSUTree::getEndChild() const; // void JSUTreeIterator::operator++ (); diff --git a/libs/JSystem/JAudio/Utility/JAUAudience.cpp b/libs/JSystem/JAudio/Utility/JAUAudience.cpp index a4b54b92..1e23922b 100644 --- a/libs/JSystem/JAudio/Utility/JAUAudience.cpp +++ b/libs/JSystem/JAudio/Utility/JAUAudience.cpp @@ -1,6 +1,9 @@ #include "JSystem/JAUdio/JAUAudience.h" +#include "JSystem/JAudio/System/JASHeapCtrl.h" #include "JSystem/JUtility/JUTAssert.h" +// sdata2 ordering is incorrect, probably requires an exact match in testInstanciate... + void JAUAudience_withSetting::updateSetting() { #line 30 JUT_ASSERT(setting_.minVolume >= 0.0f); @@ -14,7 +17,10 @@ void JAUAudience_withSetting::updateSetting() { namespace { void testInstanciate() { - JAUGenericAudible_<4, JAUDopplerAudibleChannel, JAUDopplerAudibleAbsPos> *audible = new JAUGenericAudible_<4, JAUDopplerAudibleChannel, JAUDopplerAudibleAbsPos>[4]; - JAUDopplerAudience<4> *audience = new JAUDopplerAudience<4>[4]; + //JAUGenericAudible_<4, JAUDopplerAudibleChannel, JAUDopplerAudibleAbsPos> *audible = new JAUGenericAudible_<4, JAUDopplerAudibleChannel, JAUDopplerAudibleAbsPos>[4]; + + new JAUDopplerAudience<4>; + JASPoolAllocObject< JAUDopplerAudible<4> >::newMemPool(0x4e); + } } diff --git a/libs/JSystem/JAudio/Utility/JAUAudioMgr.cpp b/libs/JSystem/JAudio/Utility/JAUAudioMgr.cpp index 985d8162..1a0f9f40 100644 --- a/libs/JSystem/JAudio/Utility/JAUAudioMgr.cpp +++ b/libs/JSystem/JAudio/Utility/JAUAudioMgr.cpp @@ -1,13 +1,13 @@ #include "JSystem/JAudio/JAUAudioMgr.h" -#include "JSystem/JAudio/JAUSoundInfo.h" #include "JSystem/JAudio/System/JASGadget.h" -#include "JSystem/JAudio/JASFakeMatch12.h" #include "macros.h" template <> DECL_WEAK JAUSoundInfo *JASGlobalInstance::sInstance; -JAUAudioMgr::JAUAudioMgr(JAUSectionHeap *) : JAUSoundInfo(false) { +JAUAudioMgr::JAUAudioMgr(JAUSectionHeap *) : JAUSoundInfo(true) { } + +#include "JSystem/JAudio/JASFakeMatch12.h" diff --git a/libs/JSystem/JAudio/Utility/JAUSectionHeap.cpp b/libs/JSystem/JAudio/Utility/JAUSectionHeap.cpp index adf32e89..7a72ce65 100644 --- a/libs/JSystem/JAudio/Utility/JAUSectionHeap.cpp +++ b/libs/JSystem/JAudio/Utility/JAUSectionHeap.cpp @@ -1,9 +1,8 @@ -#include "JSystem/JAudio/Interface/JAISeqDataMgr.h" #define JAUSECTIONHEAP_FIX - +#include "JSystem/JAudio/Interface/JAISeqDataMgr.h" +#include "JSystem/JAudio/JAUAudience.h" #include "JSystem/JAudio/JAUSectionHeap.h" #include "JSystem/JAudio/JAUSeqCollection.h" -#include "JSystem/JAudio/JAUSoundInfo.h" #include "JSystem/JAudio/JAUStreamFileTable.h" #include "JSystem/JAudio/System/JASBNKParser.h" #include "JSystem/JAudio/System/JASCriticalSection.h" @@ -398,7 +397,7 @@ bool JAUSection::newStaticSeqData(JAISoundID soundID) { JKRArchive *seqArchive = data_.seqDataBlocks_.getSeqDataArchive(); #line 479 JUT_ASSERT(seqArchive); - JAUSoundInfo *soundInfo = JASGlobalInstance::getInstance(); + JAUSoundInfo *soundInfo = JAUSoundInfo::getInstance(); if (!soundInfo) { JUT_WARNING_F2("%s", "cannot JAUSoundInfo::getInstance()."); diff --git a/libs/JSystem/JAudio/Utility/JAUSeqDataBlockMgr.cpp b/libs/JSystem/JAudio/Utility/JAUSeqDataBlockMgr.cpp index a2f05e32..377f99fd 100644 --- a/libs/JSystem/JAudio/Utility/JAUSeqDataBlockMgr.cpp +++ b/libs/JSystem/JAudio/Utility/JAUSeqDataBlockMgr.cpp @@ -1,6 +1,6 @@ #include "JSystem/JAudio/JAUSeqDataBlockMgr.h" #include "JSystem/JAudio/Interface/JAISound.h" -#include "JSystem/JAudio/JAUSoundInfo.h" +#include "JSystem/JAudio/JAUAudience.h" #include "JSystem/JAudio/System/JASResArcLoader.h" #include "JSystem/JUtility/JUTAssert.h" #include "dolphin/types.h"