diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2025-11-27 21:19:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-27 21:19:33 -0800 |
| commit | 6f96e665186c87f15acb6f5cb8d27665afee3130 (patch) | |
| tree | 3ea70fe7d635a0f55aae44b1a386814766a46597 /include | |
| parent | 767caeecc3e374779cccc9960b6546b74e7a9e50 (diff) | |
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
Diffstat (limited to 'include')
55 files changed, 1024 insertions, 885 deletions
diff --git a/include/JSystem/JAudio2/JAISe.h b/include/JSystem/JAudio2/JAISe.h index e34cd71c45..6accefb8fc 100644 --- a/include/JSystem/JAudio2/JAISe.h +++ b/include/JSystem/JAudio2/JAISe.h @@ -37,17 +37,17 @@ public: /* 8029F868 */ virtual JAITempoMgr* getTempoMgr(); /* 8029F5C8 */ virtual bool JAISound_tryDie_(); - /* 8029F03C */ JAISe(JAISeMgr*, JAISoundStrategyMgr<JAISe>*, u32); - /* 8029F0F8 */ void mixOut_(JASSoundParams const&); + /* 8029F03C */ JAISe(JAISeMgr* seMgr, JAISoundStrategyMgr<JAISe>* soundStrategyMgr, u32 priority); + /* 8029F0F8 */ void mixOut_(const JASSoundParams& params); /* 8029F214 */ void stopTrack_(); - /* 8029F250 */ void startTrack_(JASSoundParams const&); - /* 8029F304 */ void JAISeCategoryMgr_mixOut_(bool, JASSoundParams const&, JAISoundActivity); + /* 8029F250 */ void startTrack_(const JASSoundParams& params); + /* 8029F304 */ void JAISeCategoryMgr_mixOut_(bool, const JASSoundParams& params, JAISoundActivity activity); /* 8029F4CC */ void JAISeCategoryMgr_calc_(); - /* 8029F650 */ void JAISeMgr_startID_(JAISoundID, JGeometry::TVec3<f32> const*, JAIAudience*); + /* 8029F650 */ void JAISeMgr_startID_(JAISoundID id, const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience); /* 8029F6EC */ bool prepare_getSeqData_(); /* 8029F78C */ void prepare_(); - JAISeqData* getSeqData() { return &inner_.mSeqData; } + const JAISeqData* getSeqData() const { return &inner_.mSeqData; } u32 JAISeCategoryMgr_getProperPriority_() const { return inner_.mProperPriority; } u32 JAISeCategoryMgr_getPriority_() const { return inner_.mPriority; } bool isFarAway() const { return inner_.mPriority == -1; } diff --git a/include/JSystem/JAudio2/JAISeMgr.h b/include/JSystem/JAudio2/JAISeMgr.h index 37e530c925..733d7ee66c 100644 --- a/include/JSystem/JAudio2/JAISeMgr.h +++ b/include/JSystem/JAudio2/JAISeMgr.h @@ -12,6 +12,8 @@ struct JASSoundParams; * */ struct JASNonCopyable { + JASNonCopyable() {} + /* 0x0 */ int field_0x0; }; // Size: 0x4 @@ -38,40 +40,43 @@ class JAISeMgr; * @ingroup jsystem-jaudio * */ -class JAISeCategoryMgr : public JAISeqDataUser { +class JAISeCategoryMgr : public JAISeqDataUser, public JASNonCopyable { public: /* 8029F9C4 */ void JAISeMgr_calc_(); /* 8029FB30 */ void JAISeMgr_freeDeadSe_(); - /* 8029FC88 */ bool JAISeMgr_acceptsNewSe_(u32) const; + /* 8029FC88 */ bool JAISeMgr_acceptsNewSe_(u32 priority) const; /* 8029FD40 */ void sortByPriority_(); - /* 8029FDE0 */ void stop(u32); + /* 8029FDE0 */ void stop(u32 fadeTime); /* 8029FE34 */ void stop(); - /* 8029FE78 */ void stopSoundID(JAISoundID); + /* 8029FE78 */ void stopSoundID(JAISoundID id); /* 8029FEEC */ void pause(bool); - /* 8029FF18 */ void JAISeMgr_mixOut_(JAISoundParamsMove const&, JAISoundActivity); + /* 8029FF18 */ void JAISeMgr_mixOut_(const JAISoundParamsMove& params, JAISoundActivity activity); /* 802A0994 */ JAISeCategoryMgr() { mParams.init(); mMaxActiveSe = 0; mMaxInactiveSe = 0; - field_0x4.field_0x0 = 0; + field_0x0 = 0; } - /* 8029F8B0 */ virtual bool isUsingSeqData(JAISeqDataRegion const&); - /* 8029F91C */ virtual int releaseSeqData(JAISeqDataRegion const&); + /* 8029F8B0 */ virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion); + /* 8029F91C */ virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion); JAISoundParamsMove* getParams() { return &mParams; } int getMaxSe() const { - return (mMaxActiveSe == 0) ? 0 : mMaxActiveSe + mMaxInactiveSe; + if (mMaxActiveSe == 0) { + return 0; + } + + return mMaxActiveSe + mMaxInactiveSe; } int getMaxActiveSe() const { return mMaxActiveSe; } - void setMaxActiveSe(int se) { mMaxActiveSe = se; } - void setMaxInactiveSe(int se) { mMaxInactiveSe = se; } - JSUList<JAISe>* getSeList() { return &mSeList; } + void setMaxActiveSe(int num) { mMaxActiveSe = num; } + void setMaxInactiveSe(int num) { mMaxInactiveSe = num; } + const JSUList<JAISe>* getSeList() const { return &mSeList; } int getNumSe() const { return mSeList.getNumLinks(); } - JAIAudience* getAudience() { return (JAIAudience*)field_0x4.field_0x0; } + JAIAudience* getAudience() { return (JAIAudience*)field_0x0; } void JAISeMgr_appendSe_(JAISe* se) { mSeList.append(se); } - /* 0x04 */ JASNonCopyable field_0x4; /* 0x08 */ JAISoundParamsMove mParams; /* 0x58 */ JSUList<JAISe> mSeList; /* 0x64 */ int mMaxInactiveSe; @@ -86,27 +91,28 @@ class JAISeMgr : public JASGlobalInstance<JAISeMgr>, public JAISeqDataUser, public JAISoundActivity { public: - /* 802A0074 */ JAISeMgr(bool); - /* 802A0268 */ void setCategoryArrangement(JAISeCategoryArrangement const&); + /* 802A0074 */ JAISeMgr(bool setInstance); + /* 802A0268 */ void setCategoryArrangement(const JAISeCategoryArrangement& arrangement); /* 802A02A0 */ void stop(); - /* 802A02F4 */ void stopSoundID(JAISoundID); + /* 802A02F4 */ void stopSoundID(JAISoundID id); /* 802A0358 */ void initParams(); - /* 802A03D8 */ void setAudience(JAIAudience*); - /* 802A03E0 */ void setSeqDataMgr(JAISeqDataMgr*); + /* 802A03D8 */ void setAudience(JAIAudience* audience); + /* 802A03E0 */ void setSeqDataMgr(JAISeqDataMgr* seqDataMgr); /* 802A0434 */ void resetSeqDataMgr(); - /* 802A0484 */ JAISe* newSe_(int, u32); + /* 802A0484 */ JAISe* newSe_(int category, u32 priority); /* 802A0574 */ void calc(); /* 802A0704 */ void mixOut(); - /* 802A0768 */ bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*); + /* 802A0768 */ bool startSound(JAISoundID id, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr); /* 802A08D0 */ int getNumActiveSe() const; - /* 802A0168 */ virtual bool isUsingSeqData(JAISeqDataRegion const&); - /* 802A01D8 */ virtual int releaseSeqData(JAISeqDataRegion const&); + /* 802A0168 */ virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion); + /* 802A01D8 */ virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion); - JAISeCategoryMgr* getCategory(int categoryIndex) { return &mCategoryMgrs[categoryIndex]; } - JAIAudience* getAudience(int categoryIndex) { - if (categoryIndex >= 0 && categoryIndex < 16) { - JAIAudience* rv = mCategoryMgrs[categoryIndex].getAudience(); + JAISeCategoryMgr* getCategory(int index) { return &mCategoryMgrs[index]; } + JAIAudience* getAudience() { return mAudience; } + JAIAudience* getAudience(int index) { + if (index >= 0 && index < NUM_CATEGORIES) { + JAIAudience* rv = mCategoryMgrs[index].getAudience(); if (rv) return rv; } return mAudience; @@ -114,11 +120,15 @@ public: JAISeqDataMgr* getSeqDataMgr() { return mSeqDataMgr; } JAISoundParamsMove* getParams() { return &mParams; } + bool isActive() const { return getNumActiveSe() > 0; } + + static const int NUM_CATEGORIES = 16; + private: /* 0x008 */ JAIAudience* mAudience; /* 0x00C */ JAISeqDataMgr* mSeqDataMgr; /* 0x010 */ JAISoundStrategyMgr<JAISe>* mStrategyMgr; - /* 0x014 */ JAISeCategoryMgr mCategoryMgrs[16]; + /* 0x014 */ JAISeCategoryMgr mCategoryMgrs[NUM_CATEGORIES]; /* 0x6D4 */ JAISoundParamsMove mParams; }; // Size: 0x724 diff --git a/include/JSystem/JAudio2/JAISeq.h b/include/JSystem/JAudio2/JAISeq.h index 469212b890..b1f602b7aa 100644 --- a/include/JSystem/JAudio2/JAISeq.h +++ b/include/JSystem/JAudio2/JAISeq.h @@ -14,12 +14,14 @@ class JAISoundChild; */ class JAISeq : public JASPoolAllocObject<JAISeq>, public JAISound, public JSULink<JAISeq> { public: + static const int NUM_CHILDREN = 32; + class TInner { public: TInner() : mSeqData(NULL, 0) {} /* 0x000 */ JASTrack outputTrack; - /* 0x248 */ JAISoundChild* mSoundChild[32]; + /* 0x248 */ JAISoundChild* mSoundChild[NUM_CHILDREN]; /* 0x2C8 */ JAITempoMgr mTempoMgr; /* 0x2D8 */ JASSoundParams mSoundParams; /* 0x2EC */ JAISeqData mSeqData; @@ -29,30 +31,30 @@ public: }; /* 802A1570 */ virtual s32 getNumChild() const; - /* 802A1578 */ virtual JAISoundChild* getChild(int); - /* 802A165C */ virtual void releaseChild(int); + /* 802A1578 */ virtual JAISoundChild* getChild(int index); + /* 802A165C */ virtual void releaseChild(int index); /* 802A1768 */ virtual JAISeq* asSeq(); /* 802A1728 */ virtual JASTrack* getTrack(); /* 802A1730 */ virtual JASTrack* getChildTrack(int); /* 802A176C */ virtual JAITempoMgr* getTempoMgr(); /* 802A12BC */ virtual bool JAISound_tryDie_(); - /* 802A0A8C */ JAISeq(JAISeqMgr*, JAISoundStrategyMgr<JAISeq>*); - /* 802A0B64 */ void JAISeqMgr_startID_(JAISoundID, JGeometry::TVec3<f32> const*, JAIAudience*, - int, int); - /* 802A0C04 */ void playSeqData_(JASSoundParams const&, JAISoundActivity); + /* 802A0A8C */ JAISeq(JAISeqMgr* seqMgr, JAISoundStrategyMgr<JAISeq>* soundStrategyMgr); + /* 802A0B64 */ void JAISeqMgr_startID_(JAISoundID id, const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience, + int category, int); + /* 802A0C04 */ void playSeqData_(const JASSoundParams& params, JAISoundActivity activity); /* 802A0CA4 */ void reserveChildTracks_(int); /* 802A0E48 */ void releaseChildTracks_(); /* 802A0EDC */ bool prepare_getSeqData_(); - /* 802A0F90 */ bool prepare_(JASSoundParams const&, JAISoundActivity); + /* 802A0F90 */ bool prepare_(const JASSoundParams& params, JAISoundActivity activity); /* 802A108C */ void JAISeqMgr_calc_(); /* 802A1180 */ void die_(); - /* 802A1348 */ void mixOut_(JASSoundParams const&, JAISoundActivity); - /* 802A14FC */ void JAISeqMgr_mixOut_(JASSoundParams const&, JAISoundActivity); + /* 802A1348 */ void mixOut_(const JASSoundParams& params, JAISoundActivity activity); + /* 802A14FC */ void JAISeqMgr_mixOut_(const JASSoundParams& params, JAISoundActivity activity); JAISeqData& getSeqData() { return inner_.mSeqData; } - /* 0x0a8 */ TInner inner_; + /* 0x0A8 */ TInner inner_; /* 0x3A8 */ JAISoundStrategyMgr__unknown<JAISeq>* field_0x3a8; }; diff --git a/include/JSystem/JAudio2/JAISeqDataMgr.h b/include/JSystem/JAudio2/JAISeqDataMgr.h index d4118ffd94..bbedc12a18 100644 --- a/include/JSystem/JAudio2/JAISeqDataMgr.h +++ b/include/JSystem/JAudio2/JAISeqDataMgr.h @@ -9,8 +9,8 @@ * */ struct JAISeqData { - JAISeqData(void* param_0, u32 param_1) { - field_0x0 = param_0; + JAISeqData(const void* param_0, u32 param_1) { + field_0x0 = (void*)param_0; field_0x4 = param_1; } @@ -28,7 +28,7 @@ struct JAISeqData { * */ struct JAISeqDataRegion { - bool intersects(JAISeqData& seqData) const { + bool intersects(const JAISeqData& seqData) const { if ((uintptr_t)addr + size < (uintptr_t)seqData.field_0x0) { return false; } diff --git a/include/JSystem/JAudio2/JAISeqMgr.h b/include/JSystem/JAudio2/JAISeqMgr.h index 6d4a116e4e..1357d7806c 100644 --- a/include/JSystem/JAudio2/JAISeqMgr.h +++ b/include/JSystem/JAudio2/JAISeqMgr.h @@ -18,29 +18,33 @@ public: RELEASE_SEQ_1 = 1, RELEASE_SEQ_2 = 2, }; - /* 802A1914 */ JAISeqMgr(bool); + /* 802A1914 */ JAISeqMgr(bool setInstance); /* 802A1A08 */ void freeDeadSeq_(); - /* 802A1B48 */ bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*); + /* 802A1B48 */ bool startSound(JAISoundID id, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr); /* 802A1C90 */ void calc(); /* 802A1DFC */ void stop(); - /* 802A1E3C */ void stop(u32); - /* 802A1E8C */ void stopSoundID(JAISoundID); + /* 802A1E3C */ void stop(u32 fadeTime); + /* 802A1E8C */ void stopSoundID(JAISoundID id); /* 802A1EFC */ void mixOut(); /* 802A1F58 */ JAISeq* beginStartSeq_(); - /* 802A1FE8 */ bool endStartSeq_(JAISeq*, JAISoundHandle*); + /* 802A1FE8 */ bool endStartSeq_(JAISeq* seq, JAISoundHandle* handle); /* 802A20F0 */ virtual ~JAISeqMgr() {} - /* 802A1804 */ virtual bool isUsingSeqData(JAISeqDataRegion const&); - /* 802A1870 */ virtual int releaseSeqData(JAISeqDataRegion const&); + /* 802A1804 */ virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion); + /* 802A1870 */ virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion); + + void setAudience(JAIAudience* audience) { mAudience = audience; } + JAIAudience* getAudience() { return mAudience; } - void setAudience(JAIAudience* param_0) { mAudience = param_0; } JAISeqDataMgr* getSeqDataMgr() { return seqDataMgr_; } - void setSeqDataMgr(JAISeqDataMgr* param_0) { + + void setSeqDataMgr(JAISeqDataMgr* seqDataMgr) { JUT_ASSERT(124, !isActive()); resetSeqDataMgr(); - seqDataMgr_ = param_0; + seqDataMgr_ = seqDataMgr; seqDataMgr_->setSeqDataUser(this); } + void resetSeqDataMgr() { JUT_ASSERT(131, !isActive()); if (seqDataMgr_) { @@ -48,10 +52,11 @@ public: seqDataMgr_ = NULL; } } + JAISoundParamsMove* getParams() { return &mMove; } - bool isActive() { return mSeqList.getNumLinks() != 0; } + bool isActive() const { return mSeqList.getNumLinks() != 0; } int getNumActiveSeqs() const { return mSeqList.getNumLinks(); } - void pause(bool i_pause) { mActivity.field_0x0.flags.flag2 = i_pause; } + void pause(bool paused) { mActivity.field_0x0.flags.flag2 = paused; } private: /* 0x04 */ JAISoundActivity mActivity; diff --git a/include/JSystem/JAudio2/JAISound.h b/include/JSystem/JAudio2/JAISound.h index 6e4c8ab597..10c1eee3a2 100644 --- a/include/JSystem/JAudio2/JAISound.h +++ b/include/JSystem/JAudio2/JAISound.h @@ -3,6 +3,7 @@ #include "JSystem/JAudio2/JAISoundParams.h" #include "JSystem/JAudio2/JAIAudible.h" +#include "JSystem/JUtility/JUTAssert.h" #include "global.h" /** @@ -11,31 +12,30 @@ */ class JAISoundID { public: - operator u32() const { return this->mId.mFullId; } + operator u32() const { return id_.composite_; } - JAISoundID(u32 pId) { mId.mFullId = pId; }; + JAISoundID(u32 id) { id_.composite_ = id; }; - JAISoundID(JAISoundID const& other) { mId.mFullId = other.mId.mFullId; }; + JAISoundID(const JAISoundID& other) { id_.composite_ = other.id_.composite_; }; JAISoundID() {} - bool isAnonymous() const { return mId.mFullId == 0xffffffff; } - void setAnonymous() { mId.mFullId = -1; } + bool isAnonymous() const { return id_.composite_ == 0xFFFFFFFF; } + void setAnonymous() { id_.composite_ = 0xFFFFFFFF; } union { - u32 mFullId; + u32 composite_; struct { - u8 b0; - u8 b1; - u8 b2; - u8 b3; - } mBytes; - struct { - u16 mSoundType; - u16 mShortId; - } mAdvancedId; // Debug doesn't have an inline for referencing the short ID so I assume - // it's similar to this - } mId; + union { + u16 value; + struct { + u8 sectionID; + u8 groupID; + } parts; + } type; + u16 waveID; + } info; + } id_; }; class JASTrack; @@ -52,16 +52,16 @@ struct JAISoundStatus_ { field_0x0.value = 0; field_0x1.value = 0; *((u16*)&state) = 0; - user_data = 0; + userdata_ = 0; } - bool isAlive() { return state.unk != 6; } - bool isDead() { return state.unk == 6;} + bool isAlive() const { return state.unk != 6; } + bool isDead() const { return state.unk == 6;} - inline bool isPlaying() { return state.unk == 5; } - bool isPrepared() { return state.unk >= 3; } - inline bool isMute() { return field_0x0.flags.mute; } - inline bool isPaused() { return field_0x0.flags.paused; } + bool isPlaying() const { return state.unk == 5; } + bool isPrepared() const { return state.unk >= 3; } + bool isMute() const { return field_0x0.flags.mute; } + bool isPaused() const { return field_0x0.flags.paused; } void pauseWhenOut() { field_0x1.flags.flag6 = 1; } @@ -96,7 +96,7 @@ struct JAISoundStatus_ { u8 unk; struct { u8 flag1 : 1; - u8 flag2 : 1; + u8 calcedOnce : 1; u8 animationState : 2; u8 flag5 : 1; u8 flag6 : 1; @@ -104,7 +104,7 @@ struct JAISoundStatus_ { u8 flag8 : 1; } flags; } state; - /* 0x4 */ u32 user_data; + /* 0x4 */ u32 userdata_; }; // Size: 0x8 /** @@ -113,38 +113,44 @@ struct JAISoundStatus_ { */ struct JAISoundFader { void forceIn() { - mIntensity = 1.0f; + value_ = 1.0f; mTransition.zero(); } + void forceOut() { - mIntensity = 0.0f; + value_ = 0.0f; mTransition.zero(); } - void fadeOut(u32 fadeCount) { - if (fadeCount != 0) { - mTransition.set(0.0f, mIntensity, fadeCount); + + void fadeOut(u32 maxSteps) { + if (maxSteps != 0) { + mTransition.set(0.0f, value_, maxSteps); } else { forceOut(); } } - void fadeIn(u32 param_1) { - if (param_1 != 0) { - mTransition.set(1.0f, mIntensity, param_1); + + void fadeIn(u32 maxSteps) { + if (maxSteps != 0) { + mTransition.set(1.0f, value_, maxSteps); } else { forceIn(); } } - void fadeInFromOut(u32 param_1) { - mIntensity = 0.0f; - fadeIn(param_1); + + void fadeInFromOut(u32 maxSteps) { + value_ = 0.0f; + fadeIn(maxSteps); } - bool isOut() { - return (mTransition.mCount == 0 && mIntensity < 0.01f); + + bool isOut() const { + return (mTransition.remainingSteps_ == 0 && value_ < 0.01f); } - inline void calc() { mIntensity = mTransition.apply(mIntensity); } - f32 getIntensity() { return mIntensity; } - /* 0x00 */ f32 mIntensity; + void calc() { value_ = mTransition.apply(value_); } + f32 getIntensity() const { return value_; } + + /* 0x00 */ f32 value_; /* 0x04 */ JAISoundParamsTransition::TTransition mTransition; }; // Size: 0x10 @@ -169,12 +175,6 @@ struct JAISoundStrategyMgr { virtual JAISoundStrategyMgr__unknown<A0>* calc(JAISoundID); virtual void virtual4(JAISoundStrategyMgr__unknown<A0>*); }; -/* JAISoundStrategyMgr<JAISe> */ -struct JAISoundStrategyMgr__template0 {}; -/* JAISoundStrategyMgr<JAISeq> */ -struct JAISoundStrategyMgr__template1 {}; -/* JAISoundStrategyMgr<JAIStream> */ -struct JAISoundStrategyMgr__template2 {}; /** * @ingroup jsystem-jaudio @@ -205,17 +205,17 @@ public: */ class JAITempoMgr { public: - /* 0x00 */ f32 mTempo; - /* 0x04 */ JAISoundParamsTransition::TTransition field_0x4; + /* 0x00 */ f32 tempo_; + /* 0x04 */ JAISoundParamsTransition::TTransition transition_; JAITempoMgr() { init(); } void init() { setTempo(1.0f); } - void setTempo(f32 param_0) { - mTempo = param_0; - field_0x4.zero(); + void setTempo(f32 tempo) { + tempo_ = tempo; + transition_.zero(); } - f32 getTempo() { return mTempo; } - void calc() { mTempo = field_0x4.apply(mTempo); } + f32 getTempo() const { return tempo_; } + void calc() { tempo_ = transition_.apply(tempo_); } }; class JAISoundHandle; @@ -234,18 +234,18 @@ class JAITempoMgr; class JAISound { public: /* 802A21A0 */ void releaseHandle(); - /* 802A21BC */ void attachHandle(JAISoundHandle*); + /* 802A21BC */ void attachHandle(JAISoundHandle* handle); /* 802A22F8 */ JAISound(); - /* 802A2328 */ void start_JAISound_(JAISoundID, JGeometry::TVec3<f32> const*, JAIAudience*); + /* 802A2328 */ void start_JAISound_(JAISoundID id, const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience); /* 802A244C */ bool acceptsNewAudible() const; - /* 802A2474 */ void newAudible(JGeometry::TVec3<f32> const&, JGeometry::TVec3<f32> const*, u32, + /* 802A2474 */ void newAudible(const JGeometry::TVec3<f32>&, JGeometry::TVec3<f32> const*, u32, JAIAudience*); /* 802A2598 */ void stop(); - /* 802A24DC */ void stop(u32 fadeout); + /* 802A24DC */ void stop(u32 fadeTime); /* 802A25F0 */ void die_JAISound_(); /* 802A266C */ void increasePrepareCount_JAISound_(); /* 802A26B8 */ bool calc_JAISound_(); - /* 802A29DC */ void initTrack_JAISound_(JASTrack*); + /* 802A29DC */ void initTrack_JAISound_(JASTrack* track); virtual s32 getNumChild() const = 0; virtual JAISoundChild* getChild(int) = 0; @@ -258,19 +258,24 @@ public: virtual JAITempoMgr* getTempoMgr() = 0; virtual bool JAISound_tryDie_() = 0; - JAISoundID getID() const { return soundID; } - u8 getAnimationState() const { return status_.state.flags.animationState; } + JAISoundID getID() const { return soundID_; } + u32 getAnimationState() const { return status_.state.flags.animationState; } bool isAnimated() const { return getAnimationState() != 0; } - void setAnimationState(u8 pState) { - status_.state.flags.animationState = pState; + void setAnimationState(u32 state) { + status_.state.flags.animationState = state; } - u32 getUserData() const { return status_.user_data; } - void setUserData(u32 pUserData) { status_.user_data = pUserData; } - JAIAudible* getAudible() const { return audible_; } + u32 getUserData() const { return status_.userdata_; } + void setUserData(u32 userData) { status_.userdata_ = userData; } + JAIAudible* getAudible() { return audible_; } bool isHandleAttached() const { return handle_ != NULL; } bool hasLifeTime() const { return status_.field_0x1.flags.flag2; } - void removeLifeTime_() { status_.field_0x1.flags.flag1 = false; } - bool isPrepared() { return status_.isPrepared(); } + + void removeLifeTime_() { + status_.field_0x1.flags.flag1 = false; + status_.field_0x1.flags.flag2 = 0; + } + + bool isPrepared() const { return status_.isPrepared(); } void unlockIfLocked() { status_.unlockIfLocked(); } void lockWhenPrepared() { status_.lockWhenPrepared(); } void stop_JAISound_() { @@ -278,65 +283,63 @@ public: status_.state.flags.flag1 = 1; } - bool isStopping() { - bool isStopping = false; - if (status_.state.flags.flag1) { - isStopping = !status_.state.flags.flag5 || fader.isOut(); - } - return isStopping; + bool isStopping() const { + return status_.state.flags.flag1 && (!status_.state.flags.flag5 || fader_.isOut()); } void pause(bool param_0) { status_.field_0x0.flags.paused = param_0; } - void updateLifeTime(u32 param_0) { - if (param_0 > lifeTime) { - lifeTime = param_0; + void updateLifeTime(u32 lifeTime) { + if (lifeTime > lifeTime_) { + lifeTime_ = lifeTime; } } - void setLifeTime(u32 param_0, bool param_1) { - lifeTime = param_0; + void setLifeTime(u32 lifeTime, bool param_1) { + JUT_ASSERT(333, status_.state.flags.calcedOnce == 0); + lifeTime_ = lifeTime; setComesBack(param_1); status_.field_0x1.flags.flag2 = 1; } void setComesBack(bool param_0) { + JUT_ASSERT(354, status_.state.flags.calcedOnce == 0); status_.field_0x1.flags.flag1 = 1; if (param_0) { status_.pauseWhenOut(); } } - bool setPos(const JGeometry::TVec3<f32>& param_1) { + bool setPos(const JGeometry::TVec3<f32>& pos) { if (audible_ != NULL) { - audible_->setPos(param_1); + audible_->setPos(pos); } return audible_ != NULL; } - JAISoundFader& getFader() { return fader; } - void fadeIn(u32 i_count) { fader.fadeInFromOut(i_count); } - void fadeOut(u32 i_count) { fader.fadeOut(i_count); } + JAISoundFader& getFader() { return fader_; } + void fadeIn(u32 maxSteps) { fader_.fadeInFromOut(maxSteps); } + void fadeOut(u32 maxSteps) { fader_.fadeOut(maxSteps); } - JAISoundParamsProperty& getProperty() { return params.mProperty; } + JAISoundParamsProperty& getProperty() { return params_.property_; } - s32 getCount() const { return mCount; } + s32 getCount() const { return count_; } - JAISoundParamsMove& getAuxiliary() { return params.mMove; } + JAISoundParamsMove& getAuxiliary() { return params_.move_; } /* 0x04 */ JAISoundHandle* handle_; /* 0x08 */ JAIAudible* audible_; /* 0x0C */ JAIAudience* audience_; - /* 0x10 */ u32 lifeTime; - /* 0x14 */ s32 prepareCount; - /* 0x18 */ JAISoundID soundID; + /* 0x10 */ u32 lifeTime_; + /* 0x14 */ s32 prepareCount_; + /* 0x18 */ JAISoundID soundID_; /* 0x1C */ JAISoundStatus_ status_; - /* 0x24 */ JAISoundFader fader; - /* 0x34 */ u32 mPriority; - /* 0x38 */ s32 mCount; - /* 0x3C */ JAISoundParams params; + /* 0x24 */ JAISoundFader fader_; + /* 0x34 */ u32 priority_; + /* 0x38 */ s32 count_; + /* 0x3C */ JAISoundParams params_; }; // Size: 0x98 STATIC_ASSERT(sizeof(JAISound) == 0x98); diff --git a/include/JSystem/JAudio2/JAISoundHandles.h b/include/JSystem/JAudio2/JAISoundHandles.h index f754e4976c..9bcd7de88a 100644 --- a/include/JSystem/JAudio2/JAISoundHandles.h +++ b/include/JSystem/JAudio2/JAISoundHandles.h @@ -18,6 +18,11 @@ public: bool isSoundAttached() const { return sound_ != NULL; } + JAISound* getSound() { + JUT_ASSERT(41, sound_ != NULL); + return sound_; + } + JAISound* operator->() const { JUT_ASSERT(58, sound_ != NULL); return sound_; @@ -27,9 +32,7 @@ public: void releaseSound(); - JAISound* getSound() { return sound_; } - - JAISound* sound_; // member from assert in operator->() + JAISound* sound_; }; /** @@ -38,18 +41,18 @@ public: */ class JAISoundHandles { public: - JAISoundHandles(JAISoundHandle* pHandle, int param_1) { - mSoundHandle = pHandle; - numHandles_ = param_1; + JAISoundHandles(JAISoundHandle* handle, int handleNum) { + handle_ = handle; + numHandles_ = handleNum; }; - JAISoundHandle& operator[](int n) { return mSoundHandle[n]; } + JAISoundHandle& operator[](int n) { return handle_[n]; } - JAISoundHandle* getHandleSoundID(JAISoundID); + JAISoundHandle* getHandleSoundID(JAISoundID id); JAISoundHandle* getFreeHandle(); private: - JAISoundHandle* mSoundHandle; + JAISoundHandle* handle_; int numHandles_; }; diff --git a/include/JSystem/JAudio2/JAISoundParams.h b/include/JSystem/JAudio2/JAISoundParams.h index 66daf59276..1e3189bd8b 100644 --- a/include/JSystem/JAudio2/JAISoundParams.h +++ b/include/JSystem/JAudio2/JAISoundParams.h @@ -26,56 +26,56 @@ struct JAISoundParamsProperty { struct JAISoundParamsTransition { struct TTransition { void zero() { - mStep = 0.0f; - mCount = 0; - mDest = 0.0f; + step_ = 0.0f; + remainingSteps_ = 0; + targetValue_ = 0.0f; } - void set(f32 newValue, f32 intensity, u32 fadeCount) { - mCount = fadeCount; - mStep = (newValue - intensity) / mCount; - mDest = newValue; + void set(f32 newValue, f32 currentValue, u32 maxSteps) { + remainingSteps_ = maxSteps; + step_ = (newValue - currentValue) / remainingSteps_; + targetValue_ = newValue; } - f32 apply(f32 param_0) { - if (mCount > 1) { - mCount--; - param_0 += mStep; + f32 apply(f32 value) { + if (remainingSteps_ > 1) { + remainingSteps_--; + value += step_; } else { - if (mCount == 1) { - mCount = 0; - param_0 = mDest; + if (remainingSteps_ == 1) { + remainingSteps_ = 0; + value = targetValue_; } } - return param_0; + return value; } - /* 0x0 */ f32 mStep; - /* 0x4 */ f32 mDest; - /* 0x8 */ u32 mCount; + /* 0x0 */ f32 step_; + /* 0x4 */ f32 targetValue_; + /* 0x8 */ u32 remainingSteps_; }; // Size: 0xC void init() { - mVolume.zero(); - mPitch.zero(); - mFxMix.zero(); - mPan.zero(); - mDolby.zero(); + volume_.zero(); + pitch_.zero(); + fxMix_.zero(); + pan_.zero(); + dolby_.zero(); } - void apply(JASSoundParams* pParams) { - pParams->mVolume = mVolume.apply(pParams->mVolume); - pParams->mPitch = mPitch.apply(pParams->mPitch); - pParams->mFxMix = mFxMix.apply(pParams->mFxMix); - pParams->mDolby = mDolby.apply(pParams->mDolby); - pParams->mPan = mPan.apply(pParams->mPan); + void apply(JASSoundParams* params) { + params->mVolume = volume_.apply(params->mVolume); + params->mPitch = pitch_.apply(params->mPitch); + params->mFxMix = fxMix_.apply(params->mFxMix); + params->mDolby = dolby_.apply(params->mDolby); + params->mPan = pan_.apply(params->mPan); } - /* 0x00 */ TTransition mVolume; - /* 0x0C */ TTransition mPitch; - /* 0x18 */ TTransition mFxMix; - /* 0x24 */ TTransition mPan; - /* 0x30 */ TTransition mDolby; + /* 0x00 */ TTransition volume_; + /* 0x0C */ TTransition pitch_; + /* 0x18 */ TTransition fxMix_; + /* 0x24 */ TTransition pan_; + /* 0x30 */ TTransition dolby_; }; // Size: 0x3C /** @@ -83,23 +83,23 @@ struct JAISoundParamsTransition { * */ struct JAISoundParamsMove { - JAISoundParamsMove() : mParams() {} + JAISoundParamsMove() : params_() {} void init() { - mParams.init(); - mTransition.init(); + params_.init(); + transition_.init(); } - void calc() { mTransition.apply(&mParams); } + void calc() { transition_.apply(¶ms_); } - /* 802A2DB4 */ void moveVolume(f32, u32); - /* 802A2E0C */ void movePitch(f32, u32); - /* 802A2E64 */ void moveFxMix(f32, u32); - /* 802A2EBC */ void movePan(f32, u32); - /* 802A2F14 */ void moveDolby(f32, u32); + /* 802A2DB4 */ void moveVolume(f32 newValue, u32 maxSteps); + /* 802A2E0C */ void movePitch(f32 newValue, u32 maxSteps); + /* 802A2E64 */ void moveFxMix(f32 newValue, u32 maxSteps); + /* 802A2EBC */ void movePan(f32 newValue, u32 maxSteps); + /* 802A2F14 */ void moveDolby(f32 newValue, u32 maxSteps); - /* 0x00 */ JASSoundParams mParams; - /* 0x14 */ JAISoundParamsTransition mTransition; + /* 0x00 */ JASSoundParams params_; + /* 0x14 */ JAISoundParamsTransition transition_; }; // Size: 0x50 /** @@ -107,17 +107,16 @@ struct JAISoundParamsMove { * */ struct JAISoundParams { - JAISoundParams() : mMove() {} - void mixOutAll(JASSoundParams const&, JASSoundParams*, f32); + JAISoundParams() : move_() {} + void mixOutAll(const JASSoundParams& inParams, JASSoundParams* outParams, f32); void init() { - mMove.init(); - mProperty.init(); + move_.init(); + property_.init(); } - /* 0x0 */ JAISoundParamsProperty mProperty; - /* 0xC */ JAISoundParamsMove mMove; + /* 0x0 */ JAISoundParamsProperty property_; + /* 0xC */ JAISoundParamsMove move_; }; // Size: 0x5C -// OG Size: 0x20 #endif /* JAISOUNDPARAMS_H */ diff --git a/include/JSystem/JAudio2/JAISoundStarter.h b/include/JSystem/JAudio2/JAISoundStarter.h index fda197b260..ef177adcd1 100644 --- a/include/JSystem/JAudio2/JAISoundStarter.h +++ b/include/JSystem/JAudio2/JAISoundStarter.h @@ -9,11 +9,11 @@ * */ struct JAISoundStarter : public JASGlobalInstance<JAISoundStarter> { - /* 802A2F6C */ JAISoundStarter(bool); + /* 802A2F6C */ JAISoundStarter(bool setInstance); virtual ~JAISoundStarter(); - virtual bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*) = 0; - /* 802A2FEC */ bool startLevelSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*); + virtual bool startSound(JAISoundID id, JAISoundHandle* handlePtr, const JGeometry::TVec3<f32>* posPtr) = 0; + /* 802A2FEC */ bool startLevelSound(JAISoundID id, JAISoundHandle* handlePtr, const JGeometry::TVec3<f32>* posPtr); }; #endif /* JAISOUNDSTARTER_H */ diff --git a/include/JSystem/JAudio2/JAIStream.h b/include/JSystem/JAudio2/JAIStream.h index 4f7b37e627..e430d790f0 100644 --- a/include/JSystem/JAudio2/JAIStream.h +++ b/include/JSystem/JAudio2/JAIStream.h @@ -14,39 +14,42 @@ class JAIStreamMgr; class JAIStream : public JASPoolAllocObject<JAIStream>, public JAISound, public JSULink<JAIStream> { public: struct TInner { - JASAramStream field_0x0; + JASAramStream aramStream_; }; - /* 802A3104 */ JAIStream(JAIStreamMgr*, JAISoundStrategyMgr<JAIStream>*); - /* 802A319C */ void JAIStreamMgr_startID_(JAISoundID, s32, JGeometry::TVec3<f32> const*, - JAIAudience*, int); + /* 802A3104 */ JAIStream(JAIStreamMgr* streamMgr, JAISoundStrategyMgr<JAIStream>* soundStrategyMgr); + /* 802A319C */ void JAIStreamMgr_startID_(JAISoundID id, s32 streamFileEntry, + const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience, + int category); /* 802A3230 */ bool prepare_prepareStream_(); /* 802A33F4 */ void prepare_(); /* 802A3498 */ void prepare_startStream_(); - /* 802A34E4 */ void JAIStreamMgr_mixOut_(JASSoundParams const&, JAISoundActivity); + /* 802A34E4 */ void JAIStreamMgr_mixOut_(const JASSoundParams& inParams, JAISoundActivity activity); /* 802A3720 */ void die_JAIStream_(); /* 802A37FC */ bool JAISound_tryDie_(); /* 802A388C */ void JAIStreamMgr_calc_(); /* 802A3948 */ s32 getNumChild() const; - /* 802A3950 */ JAISoundChild* getChild(int); - /* 802A3A24 */ void releaseChild(int); + /* 802A3950 */ JAISoundChild* getChild(int index); + /* 802A3A24 */ void releaseChild(int index); /* 802A3ABC */ JASTrack* getTrack(); /* 802A3AC4 */ JASTrack* getChildTrack(int); /* 802A3ACC */ JAIStream* asStream(); /* 802A3AD0 */ JAITempoMgr* getTempoMgr(); - void* JAIStreamMgr_getAramAddr_() { return field_0x29c; } + void* JAIStreamMgr_getAramAddr_() const { return streamAramAddr_; } - /* 0x0A8 */ TInner field_0x0a8; + static const int NUM_CHILDREN = 6; + + /* 0x0A8 */ TInner inner_; /* 0x290 */ int field_0x290; /* 0x294 */ s32 field_0x294; /* 0x298 */ int field_0x298; - /* 0x29C */ void* field_0x29c; - /* 0x2A0 */ JAISoundChild* field_0x2a0[6]; - /* 0x2B8 */ JAIStreamMgr* field_0x2b8; + /* 0x29C */ void* streamAramAddr_; + /* 0x2A0 */ JAISoundChild* children_[NUM_CHILDREN]; + /* 0x2B8 */ JAIStreamMgr* streamMgr_; /* 0x2BC */ JAISoundStrategyMgr__unknown<JAIStream>* field_0x2bc; /* 0x2C0 */ JAISoundStrategyMgr<JAIStream>* field_0x2c0; - /* 0x2C4 */ u8 field_0x2c4; + /* 0x2C4 */ bool field_0x2c4; /* 0x2C5 */ u8 field_0x2c5; /* 0x2C6 */ u8 field_0x2c6; }; diff --git a/include/JSystem/JAudio2/JAIStreamMgr.h b/include/JSystem/JAudio2/JAIStreamMgr.h index 5dbe8d3ab0..41ac1b0445 100644 --- a/include/JSystem/JAudio2/JAIStreamMgr.h +++ b/include/JSystem/JAudio2/JAIStreamMgr.h @@ -14,34 +14,38 @@ class JAIStreamDataMgr; */ class JAIStreamMgr : public JASGlobalInstance<JAIStreamMgr> { public: - /* 802A3B68 */ JAIStreamMgr(bool); - /* 802A3C3C */ bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*); + /* 802A3B68 */ JAIStreamMgr(bool setInstance); + /* 802A3C3C */ bool startSound(JAISoundID id, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr); /* 802A3D70 */ void freeDeadStream_(); /* 802A3EBC */ void calc(); /* 802A4028 */ void stop(); - /* 802A4068 */ void stop(u32); - /* 802A40B8 */ void stopSoundID(JAISoundID); + /* 802A4068 */ void stop(u32 fadeTime); + /* 802A40B8 */ void stopSoundID(JAISoundID id); /* 802A4118 */ void mixOut(); /* 802A4174 */ JAIStream* newStream_(); /* 802B9978 */ bool isActive() const { return mStreamList.getNumLinks() != 0; } + JAIAudience* getAudience() { return mAudience; } JAISoundParamsMove* getParams() { return &mParams; } JAIStreamAramMgr* getStreamAramMgr() { return mStreamAramMgr; } JSUList<JAIStream>* getStreamList() { return &mStreamList; } - void setStreamDataMgr(JAIStreamDataMgr* param_0) { + + void setStreamDataMgr(JAIStreamDataMgr* streamDataMgr) { JUT_ASSERT(139, !isActive()); - streamDataMgr_ = param_0; + streamDataMgr_ = streamDataMgr; } - void setStreamAramMgr(JAIStreamAramMgr* param_0) { + + void setStreamAramMgr(JAIStreamAramMgr* streamDataMgr) { JUT_ASSERT(157, !isActive()); - mStreamAramMgr = param_0; + mStreamAramMgr = streamDataMgr; } - void pause(bool i_pause) { mActivity.field_0x0.flags.flag2 = i_pause; } + + void pause(bool paused) { mActivity.field_0x0.flags.flag2 = paused; } private: /* 0x00 */ JAISoundActivity mActivity; /* 0x04 */ JAISoundParamsMove mParams; - /* 0x54 */ JAIAudience* field_0x54; + /* 0x54 */ JAIAudience* mAudience; /* 0x58 */ JSUList<JAIStream> mStreamList; /* 0x64 */ JAIStreamDataMgr* streamDataMgr_; /* 0x68 */ JAIStreamAramMgr* mStreamAramMgr; diff --git a/include/JSystem/JAudio2/JASCalc.h b/include/JSystem/JAudio2/JASCalc.h index 6f2b545c84..ea6773821c 100644 --- a/include/JSystem/JAudio2/JASCalc.h +++ b/include/JSystem/JAudio2/JASCalc.h @@ -8,11 +8,11 @@ * */ struct JASCalc { - /* 8028F2E8 */ static void imixcopy(s16 const*, s16 const*, s16*, u32); - /* 8028F318 */ static void bcopyfast(void const*, void*, u32); - /* 8028F354 */ static void bcopy(void const*, void*, u32); - /* 8028F454 */ static void bzerofast(void*, u32); - /* 8028F480 */ static void bzero(void*, u32); + /* 8028F2E8 */ static void imixcopy(const s16*, const s16*, s16*, u32); + /* 8028F318 */ static void bcopyfast(const void* src, void* dest, u32 size); + /* 8028F354 */ static void bcopy(const void* src, void* dest, u32 size); + /* 8028F454 */ static void bzerofast(void* dest, u32 size); + /* 8028F480 */ static void bzero(void* dest, u32 size); /* 8028F578 */ static f32 pow2(f32); // Could not make it work as inline - specialization is in JASCalc.cpp @@ -39,7 +39,7 @@ struct JASCalc { f32 fake2(long x); f32 fake3(); - static s16 const CUTOFF_TO_IIR_TABLE[128][4]; + static const s16 CUTOFF_TO_IIR_TABLE[128][4]; }; #endif /* JASCALC_H */ diff --git a/include/JSystem/JAudio2/JASCallback.h b/include/JSystem/JAudio2/JASCallback.h index 33bd5e7f5e..5aa3267d9d 100644 --- a/include/JSystem/JAudio2/JASCallback.h +++ b/include/JSystem/JAudio2/JASCallback.h @@ -12,28 +12,21 @@ typedef long JASCallback(void*); struct JASCallbackMgr { struct TCallback { TCallback() - : mFunction(NULL) - , mArgument(NULL) { + : callback_(NULL) + , arg_(NULL) { } - /** @fabricated */ - bool isMatch(JASCallback* function, void* argument) { return (mFunction == function && mArgument == argument); } - - /** @fabricated */ - void clear() { - mFunction = NULL; - mArgument = NULL; - } - - /* 0x00 */ JASCallback* mFunction; - /* 0x04 */ void* mArgument; + /* 0x00 */ JASCallback* callback_; + /* 0x04 */ void* arg_; }; - bool regist(JASCallback*, void*); - int reject(JASCallback*, void*); + bool regist(JASCallback* callback, void* argument); + int reject(JASCallback* callback, void* argument); void callback(); - /* 0x00 */ TCallback mCallbacks[0x20]; + static const int NUM_CALLBACKS = 32; + + /* 0x00 */ TCallback callbacks_[NUM_CALLBACKS]; }; #endif /* JASCALLBACK_H */ diff --git a/include/JSystem/JAudio2/JASDriverIF.h b/include/JSystem/JAudio2/JASDriverIF.h index ff2f42cad0..edb4574015 100644 --- a/include/JSystem/JAudio2/JASDriverIF.h +++ b/include/JSystem/JAudio2/JASDriverIF.h @@ -26,4 +26,8 @@ namespace JASDriver { extern u32 JAS_SYSTEM_OUTPUT_MODE; }; +inline void JAISetOutputMode(u32 mode) { + JASDriver::setOutputMode(mode); +} + #endif /* JASDRIVERIF_H */ diff --git a/include/JSystem/JAudio2/JASDvdThread.h b/include/JSystem/JAudio2/JASDvdThread.h index c76511ee58..38c022c058 100644 --- a/include/JSystem/JAudio2/JASDvdThread.h +++ b/include/JSystem/JAudio2/JASDvdThread.h @@ -12,7 +12,7 @@ class JASTaskThread; class JASDvd { public: /* 8028FEFC */ static JASTaskThread* getThreadPointer(); - /* 8028FF04 */ static bool createThread(s32, int, u32); + /* 8028FF04 */ static bool createThread(s32 priority, int msgCount, u32 stackSize); static JASTaskThread* sThread; }; diff --git a/include/JSystem/JAudio2/JASGadget.h b/include/JSystem/JAudio2/JASGadget.h index b48b234b2a..5c3e9f5542 100644 --- a/include/JSystem/JAudio2/JASGadget.h +++ b/include/JSystem/JAudio2/JASGadget.h @@ -15,8 +15,8 @@ public: sInstance = inst; } - JASGlobalInstance(bool param_1) { - if (param_1) { + JASGlobalInstance(bool setInstance) { + if (setInstance) { JUT_ASSERT(186, sInstance == NULL); sInstance = (T*)this; } diff --git a/include/JSystem/JAudio2/JASHeapCtrl.h b/include/JSystem/JAudio2/JASHeapCtrl.h index c6cc34ae30..db26f57f8e 100644 --- a/include/JSystem/JAudio2/JASHeapCtrl.h +++ b/include/JSystem/JAudio2/JASHeapCtrl.h @@ -94,8 +94,16 @@ template <typename T> class JASMemPool : public JASGenericMemPool { public: void newMemPool(int param_0) { JASGenericMemPool::newMemPool(sizeof(T), param_0); } - void* alloc(u32 n) { return JASGenericMemPool::alloc(n); } - void free(void* ptr, u32 n) { JASGenericMemPool::free(ptr, n); } + + void* alloc(u32 n) { + JUT_ASSERT(182, n == sizeof(T)); + return JASGenericMemPool::alloc(n); + } + + void free(void* ptr, u32 n) { + JUT_ASSERT(187, n == sizeof(T)); + JASGenericMemPool::free(ptr, n); + } }; namespace JASKernel { JKRHeap* getSystemHeap(); }; diff --git a/include/JSystem/JAudio2/JASTaskThread.h b/include/JSystem/JAudio2/JASTaskThread.h index b3e338ee28..7a16331d8d 100644 --- a/include/JSystem/JAudio2/JASTaskThread.h +++ b/include/JSystem/JAudio2/JASTaskThread.h @@ -4,6 +4,8 @@ #include "JSystem/JKernel/JKRThread.h" #include "JSystem/JAudio2/JASHeapCtrl.h" +typedef void (*JASThreadCallback)(void*); + /** * @ingroup jsystem-jaudio * @@ -11,27 +13,27 @@ class JASTaskThread : public JKRThread { private: struct JASThreadCallStack { - /* 0x00 */ void (*mRunFunc)(void*); - /* 0x04 */ u32 field_0x4; + /* 0x00 */ JASThreadCallback callback_; + /* 0x04 */ u32 msgType_; /* 0x08 */ union { u8 buffer[0x400]; - void* pBuffer; - }field_0x8; + void* bufferPtr; + } msg; }; public: typedef JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable> ThreadMemPool; - /* 8028F6C4 */ JASTaskThread(int, int, u32); - /* 8028F9EC */ void* allocCallStack(void (*)(void*), void*); - /* 8028F850 */ void* allocCallStack(void (*)(void*), void const*, u32); - /* 8028FC54 */ int sendCmdMsg(void (*)(void*), void*); - /* 8028FB5C */ int sendCmdMsg(void (*)(void*), void const*, u32); + /* 8028F6C4 */ JASTaskThread(int priority, int msgCount, u32 stackSize); + /* 8028F9EC */ void* allocCallStack(JASThreadCallback callback, void* msg); + /* 8028F850 */ void* allocCallStack(JASThreadCallback callback, const void* msg, u32 msgSize); + /* 8028FC54 */ int sendCmdMsg(JASThreadCallback callback, void* msg); + /* 8028FB5C */ int sendCmdMsg(JASThreadCallback callback, const void* msg, u32 msgSize); /* 8028FE88 */ void pause(bool); /* 8028F724 */ virtual ~JASTaskThread(); /* 8028FD4C */ virtual void* run(); - /* 0x7C */ OSThreadQueue mpThreadQueue; + /* 0x7C */ OSThreadQueue threadQueue_; /* 0x84 */ bool field_0x84; }; diff --git a/include/JSystem/JAudio2/JASTrack.h b/include/JSystem/JAudio2/JASTrack.h index 884f09b3d7..9a6c14c995 100644 --- a/include/JSystem/JAudio2/JASTrack.h +++ b/include/JSystem/JAudio2/JASTrack.h @@ -25,6 +25,7 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> { enum Status { STATUS_FREE, STATUS_RUN, + STATUS_STOP, }; struct TChannelMgr : public JASPoolAllocObject_MultiThreaded<TChannelMgr> { @@ -34,9 +35,11 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> { /* 80293220 */ bool noteOff(u32, u16); /* 802932A0 */ void setPauseFlag(bool); - /* 0x00 */ JASChannel* mChannels[8]; + static const int CHANNEL_MAX = 8; + + /* 0x00 */ JASChannel* mChannels[CHANNEL_MAX]; /* 0x20 */ JASChannelParams mParams; - /* 0x38 */ short field_0x38[8]; + /* 0x38 */ s16 field_0x38[CHANNEL_MAX]; /* 0x48 */ JASSoundParams* mSoundParams; /* 0x4c */ JASTrack* mTrack; }; @@ -138,7 +141,7 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> { JUT_ASSERT(115, index < MAX_CHILDREN) return mChildren[index]; } - int getChannelMgrCount() { return mChannelMgrCount; } + int getChannelMgrCount() const { return mChannelMgrCount; } f32 getVibDepth() const { return mVibDepth; } void setVibDepth(f32 param_0) { mVibDepth = param_0; } f32 getVibPitch() const { return mVibPitch; } @@ -152,7 +155,7 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded<JASTrack> { 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; } + void setAutoDelete(bool param_0) { mFlags.autoDelete = param_0; } f32 getPanPower() const { return mPanPower; } void setPanPower(f32 param_0) { mPanPower = param_0; } u32 getSkipSample() const { return mSkipSample; } diff --git a/include/JSystem/JAudio2/JASWaveArcLoader.h b/include/JSystem/JAudio2/JASWaveArcLoader.h index 288905339a..bf8e967b42 100644 --- a/include/JSystem/JAudio2/JASWaveArcLoader.h +++ b/include/JSystem/JAudio2/JASWaveArcLoader.h @@ -54,7 +54,7 @@ struct JASWaveArc : JASDisposer { /* 80298FA0 */ virtual void onLoadDone() {} /* 80298FA4 */ virtual void onEraseDone() {} - s32 getStatus() { return mStatus; } + s32 getStatus() const { return mStatus; } struct loadToAramCallbackParams { // not official struct name diff --git a/include/JSystem/JAudio2/JAUAudibleParam.h b/include/JSystem/JAudio2/JAUAudibleParam.h index 83baf7c9b8..0fd3058f82 100644 --- a/include/JSystem/JAudio2/JAUAudibleParam.h +++ b/include/JSystem/JAudio2/JAUAudibleParam.h @@ -1,6 +1,8 @@ #ifndef JAUAUDIBLEPARAM_H #define JAUAUDIBLEPARAM_H +#include <dolphin/types.h> + /** * @ingroup jsystem-jaudio * @@ -9,6 +11,7 @@ struct JAUAudibleParam { f32 getDopplerPower() const { return (u32)((*(u8*)&field_0x0.raw >> 4) & 0xf) * (1.0f / 15.0f); } + union { struct { u16 f0; diff --git a/include/JSystem/JAudio2/JAUAudioArcInterpreter.h b/include/JSystem/JAudio2/JAUAudioArcInterpreter.h index 86724662d0..7be5775766 100644 --- a/include/JSystem/JAudio2/JAUAudioArcInterpreter.h +++ b/include/JSystem/JAudio2/JAUAudioArcInterpreter.h @@ -37,7 +37,7 @@ public: mReadPtr += 4; return temp; } - const void* getContent_(u32 param_0) { return mBase + param_0; } + const void* getContent_(u32 param_0) const { return mBase + param_0; } /* 0x04 */ const u8* mReadPtr; diff --git a/include/JSystem/JAudio2/JAUInitializer.h b/include/JSystem/JAudio2/JAUInitializer.h index 7f5410527b..c0fd32380a 100644 --- a/include/JSystem/JAudio2/JAUInitializer.h +++ b/include/JSystem/JAudio2/JAUInitializer.h @@ -12,21 +12,21 @@ class JKRSolidHeap; class JAU_JASInitializer { public: /* 802A4AD0 */ JAU_JASInitializer(); - /* 802A4B28 */ void initJASystem(JKRSolidHeap*); + /* 802A4B28 */ void initJASystem(JKRSolidHeap* heap); - /* 0x00 */ u32 field_0x00; - /* 0x04 */ u32 field_0x04; - /* 0x08 */ int field_0x08; - /* 0x0C */ int field_0x0c; - /* 0x10 */ int field_0x10; - /* 0x14 */ int field_0x14; - /* 0x18 */ int field_0x18; + /* 0x00 */ u32 audioMemory_; + /* 0x04 */ u32 audioMemSize_; + /* 0x08 */ int heapSize_; + /* 0x0C */ int dvdThreadPriority_; + /* 0x10 */ int audioThreadPriority_; + /* 0x14 */ int dvdThreadId_; + /* 0x18 */ int audioThreadId_; /* 0x1C */ int field_0x1c; /* 0x20 */ int field_0x20; - /* 0x24 */ int field_0x24; - /* 0x28 */ int field_0x28; - /* 0x2C */ f32 field_0x2c; - /* 0x30 */ char* field_0x30; + /* 0x24 */ int aramBlockSize_; + /* 0x28 */ int aramChannelNum_; + /* 0x2C */ f32 dspLevel_; + /* 0x30 */ char* waveArcDir_; }; /** diff --git a/include/JSystem/JAudio2/JAUSectionHeap.h b/include/JSystem/JAudio2/JAUSectionHeap.h index c8eef69c1a..14607e772f 100644 --- a/include/JSystem/JAudio2/JAUSectionHeap.h +++ b/include/JSystem/JAudio2/JAUSectionHeap.h @@ -66,6 +66,8 @@ public: bool isBuilding() const { return field_0x2c; } bool isOpen() const; JAUSectionHeap* asSectionHeap() { return (JAUSection*)sectionHeap_ == this ? sectionHeap_ : NULL; } + const TSectionData& getSectionData() const { return data_; } + JKRHeap* getHeap_(); /* 0x28 */ u32 field_0x28; @@ -95,7 +97,7 @@ public: /* 802A5E60 */ void setSeqDataArchive(JKRArchive*); /* 802A5EC0 */ bool loadDynamicSeq(JAISoundID, bool); - /* 802A5EF8 */ void releaseIdleDynamicSeqDataBlock(); + /* 802A5EF8 */ u32 releaseIdleDynamicSeqDataBlock(); /* 802A5FE0 */ JAUSectionHeap(JKRSolidHeap*, bool, s32); /* 802A6094 */ JAUSection* getOpenSection(); /* 802A60A0 */ bool setSeqDataUser(JAISeqDataUser*); diff --git a/include/JSystem/JAudio2/JAUSeqCollection.h b/include/JSystem/JAudio2/JAUSeqCollection.h index 080473abfb..4831e1a020 100644 --- a/include/JSystem/JAudio2/JAUSeqCollection.h +++ b/include/JSystem/JAudio2/JAUSeqCollection.h @@ -49,6 +49,8 @@ public: /* 802A683C */ SeqDataReturnValue getSeqData(JAISoundID, JAISeqData*); /* 802A6894 */ ~JAUSeqDataMgr_SeqCollection(); + const void* getResource() const { return field_0x4; } + /* 0x14 */ JAISeqDataUser* user_; }; diff --git a/include/JSystem/JAudio2/JAUSoundTable.h b/include/JSystem/JAudio2/JAUSoundTable.h index 13c60ea68e..5fb3e275fa 100644 --- a/include/JSystem/JAudio2/JAUSoundTable.h +++ b/include/JSystem/JAudio2/JAUSoundTable.h @@ -157,7 +157,8 @@ struct JAUSoundTable : public JASGlobalInstance<JAUSoundTable> { return (JAUSoundTableItem*)((u8*)field_0x0.field_0x0 + offset); } - const void* getResource() { return field_0x0.field_0x0; } + const void* getResource() const { return field_0x0.field_0x0; } + bool isValid() const { return field_0x0.field_0x0 != NULL; } JAUSoundTable_<JAUSoundTableRoot,JAUSoundTableSection,JAUSoundTableGroup,void> field_0x0; }; diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 99209023af..72123903fe 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -41,6 +41,16 @@ struct TUtil<f32> { root = 0.5f * root * (3.0f - x * (root * root)); return root; } + + static inline f32 sqrt(f32 x) { + if (x <= 0.0f) { + return x; + } + + f32 root = __frsqrte(x); + root = 0.5f * root * (3.0f - x * (root * root)); + return x * root; + } }; template<> @@ -216,7 +226,7 @@ struct TVec3<f32> : public Vec { } inline TVec3<f32>& operator=(const TVec3<f32>& b) { - set(b.x, b.y, b.z); + setTVec3f(&b.x, &this->x); return *this; } @@ -439,12 +449,7 @@ struct TVec2 { } f32 length() const { - f32 sqr = squared(); - if (sqr <= 0.0f) { - return sqr; - } - sqr *= fsqrt_step(sqr); - return sqr; + return TUtil<f32>::sqrt(squared()); } T x; diff --git a/include/JSystem/JKernel/JKRThread.h b/include/JSystem/JKernel/JKRThread.h index f3e2d1b6ba..b82a22ae9b 100644 --- a/include/JSystem/JKernel/JKRThread.h +++ b/include/JSystem/JKernel/JKRThread.h @@ -80,7 +80,6 @@ public: mCurrentHeap = heap ? heap : JKRHeap::getCurrentHeap(); } -protected: void resume() { OSResumeThread(mThreadRecord); } BOOL sendMessage(OSMessage message) { return OSSendMessage(&mMessageQueue, message, OS_MESSAGE_NOBLOCK); diff --git a/include/JSystem/JMath/JMath.h b/include/JSystem/JMath/JMath.h index 4d9dd66608..7042cd8d6c 100644 --- a/include/JSystem/JMath/JMath.h +++ b/include/JSystem/JMath/JMath.h @@ -89,6 +89,10 @@ inline f32 fastReciprocal(f32 value) { return JMAFastReciprocal(value); } +inline void fastVECNormalize(const Vec* src, Vec* dst) { + return JMAFastVECNormalize(src, dst); +} + inline void gekko_ps_copy3(register void* dst, register const void* src) { register f32 src0; register f32 src1; diff --git a/include/JSystem/JSupport/JSUList.h b/include/JSystem/JSupport/JSUList.h index 884b8b9b64..75c18bb8d5 100644 --- a/include/JSystem/JSupport/JSUList.h +++ b/include/JSystem/JSupport/JSUList.h @@ -47,7 +47,7 @@ public: T* getObject() const { return static_cast<T*>(mObject); } - JSUList<T>* getSupervisor() const { return static_cast<JSUList<T>*>(this->getList()); } + JSUList<T>* getSupervisor() const { return static_cast<JSUList<T>*>(mList); } JSULink<T>* getNext() const { return static_cast<JSULink*>(mNext); } @@ -82,7 +82,7 @@ public: u32 getNumLinks() const { return mLength; } -private: +protected: JSUPtrLink* mHead; JSUPtrLink* mTail; u32 mLength; @@ -114,11 +114,11 @@ public: JSULink<T>* getLast() const { return (JSULink<T>*)getLastLink(); } - JSULink<T>* getNth(int index) { return (JSULink<T>*)getNthLink(index); } + JSULink<T>* getNth(u32 index) const { return (JSULink<T>*)getNthLink(index); } JSULink<T>* getEnd() const { return NULL; } - u32 getNumLinks() const { return this->JSUPtrList::getNumLinks(); } + u32 getNumLinks() const { return mLength; } }; /** diff --git a/include/JSystem/TPosition3.h b/include/JSystem/TPosition3.h index 807ce4fea5..92de4b5811 100644 --- a/include/JSystem/TPosition3.h +++ b/include/JSystem/TPosition3.h @@ -16,8 +16,6 @@ template <> struct SMatrix34C<f32> { f32 data[3][4]; - void identity() { MTXIdentity(data); } - typedef f32 ArrType[4]; void set(const ArrType* src) { JMath::gekko_ps_copy12(data, src); @@ -54,7 +52,9 @@ struct SMatrix33C { }; template <typename T> -struct TMatrix34 : public T {}; +struct TMatrix34 : public T { + void identity() { MTXIdentity(data); } +}; template <typename T> struct TRotation3 : public T {}; @@ -77,9 +77,11 @@ struct TRotation3<SMatrix33C<T> > : public SMatrix33C<T> { }; template <typename T> -struct TPosition3 : public T {}; +struct TPosition3 : public T { + TPosition3() {} +}; -typedef TPosition3<TRotation3<TMatrix34<SMatrix34C<f32> > > > TPosition3f32; +typedef TPosition3<TMatrix34<SMatrix34C<f32> > > TPosition3f32; } // namespace JGeometry diff --git a/include/Z2AudioLib/Z2Audience.h b/include/Z2AudioLib/Z2Audience.h index ca8099c495..9f1ff17d44 100644 --- a/include/Z2AudioLib/Z2Audience.h +++ b/include/Z2AudioLib/Z2Audience.h @@ -12,36 +12,39 @@ struct Z2Audible; struct Z2AudibleAbsPos { - /* 802BBCDC */ void calc(JGeometry::TVec3<f32> const&); - /* 802BBD18 */ void init(JGeometry::TVec3<f32>*, JGeometry::TVec3<f32> const&, - JGeometry::TVec3<f32> const*); + /* 802BBCDC */ void calc(const JGeometry::TVec3<f32>& pos); + /* 802BBD18 */ void init(JGeometry::TVec3<f32>*, const JGeometry::TVec3<f32>&, + const JGeometry::TVec3<f32>*); /* 0x00 */ JGeometry::TVec3<f32> field_0x0; - /* 0x0C */ JGeometry::TVec3<f32> field_0xc; + /* 0x0C */ JGeometry::TVec3<f32> velocity_; }; struct Z2AudioCamera { /* 802BC758 */ Z2AudioCamera(); /* 802BC788 */ void init(); - /* 802BC8AC */ void setCameraState(f32 (*)[4], Vec&, Vec&, f32, f32, bool, bool); - /* 802BC7DC */ void setCameraState(f32 const (*)[4], Vec&, bool); - /* 802BCBEC */ void convertAbsToRel(Z2Audible*, int); - /* 802BCC7C */ bool convertAbsToRel(Vec&, Vec*) const; + /* 802BC8AC */ void setCameraState(f32 (*)[4], Vec& pos, Vec&, f32, f32, bool, bool); + /* 802BC7DC */ void setCameraState(f32 const (*)[4], Vec& pos, bool); + /* 802BCBEC */ void convertAbsToRel(Z2Audible* audible, int channelNum); + /* 802BCC7C */ bool convertAbsToRel(Vec& src, Vec* dst) const; /* 802BCCC0 */ bool isInSight(Vec&) const; - JGeometry::TVec3<f32>* getPos() { return &mPos; } + + const JGeometry::TVec3<f32>* getPos() const { return &mPos; } f32 getVolCenterZ() const { return mVolCenterZ; } - void setMainCamera() { mSetMainCamera = true; } - void setTargetVolume(f32 volume) { - if (volume < 0.0f) { - volume = 0.0f; + void setMainCamera(bool param_0) { mSetMainCamera = param_0; } + + void setTargetVolume(f32 vol) { + JUT_ASSERT(281, vol <= 1.f); + if (vol < 0.0f) { + vol = 0.0f; } - mTargetVolume = volume; + mTargetVolume = vol; } + f32 getDolbyCenterZ() const { return mDolbyCenterZ; } f32 getFovySin() const { return mFovySin; } const JGeometry::TVec3<f32>* getVel() const { return &mVel; } - /* 0x00 */ JGeometry::TPosition3f32 field_0x0; /* 0x30 */ JGeometry::TVec3<f32> mVel; /* 0x3C */ JGeometry::TVec3<f32> mPos; @@ -58,15 +61,15 @@ struct Z2AudioCamera { struct Z2SpotMic { /* 802BCD28 */ Z2SpotMic(); - /* 802BCDA8 */ void clearMicState(int); - /* 802BCDE8 */ void calcVolumeFactor(int); - /* 802BCE14 */ void setMicState(Z2AudioCamera*, int); - /* 802BCF5C */ f32 calcMicDist(Z2Audible*); + /* 802BCDA8 */ void clearMicState(int camID); + /* 802BCDE8 */ void calcVolumeFactor(int camID); + /* 802BCE14 */ void setMicState(Z2AudioCamera* camera, int camID); + /* 802BCF5C */ f32 calcMicDist(Z2Audible* audible); /* 802BCFE4 */ u32 calcMicPriority(f32); - /* 802BD03C */ f32 calcMicVolume(f32, int, f32); + /* 802BD03C */ f32 calcMicVolume(f32, int camID, f32); - void setPosPtr(Vec* i_posPtr) { mPosPtr = i_posPtr; } - bool isOn() const { return mMicOn; } + void setPosPtr(Vec* posPtr) { mPosPtr = posPtr; } + bool isOn() { return mMicOn; } /* 0x00 */ f32 field_0x0; /* 0x04 */ f32 field_0x4; @@ -79,7 +82,7 @@ struct Z2SpotMic { /* 0x20 */ f32 field_0x20[1]; /* 0x24 */ bool mIgnoreIfOut; /* 0x25 */ bool mMicOn; - /* 0x26 */ u8 field_0x26[1]; + /* 0x26 */ bool field_0x26[1]; }; // Size: 0x28 struct Z2Audience3DSetting { @@ -152,14 +155,14 @@ struct Z2AudibleRelPos { struct Z2AudibleChannel { /* 802BBE74 */ Z2AudibleChannel(); void init() { - field_0x0.init(); + mParams.init(); field_0x28 = -1.0f; mPan = 0.5f; mDolby = 0.0f; field_0x34 = 1.0f; } - /* 0x00 */ JASSoundParams field_0x0; + /* 0x00 */ JASSoundParams mParams; /* 0x14 */ Z2AudibleRelPos field_0x14; /* 0x28 */ f32 field_0x28; /* 0x2c */ f32 mPan; @@ -168,65 +171,71 @@ struct Z2AudibleChannel { }; struct Z2Audible : public JAIAudible, public JASPoolAllocObject<Z2Audible> { - /* 802BBD94 */ Z2Audible(JGeometry::TVec3<f32> const&, JGeometry::TVec3<f32> const*, u32, bool); + /* 802BBD94 */ Z2Audible(const JGeometry::TVec3<f32>& pos, const JGeometry::TVec3<f32>*, u32 channel, bool); /* 802BBE98 */ void calc(); - /* 802BBED0 */ JASSoundParams* getOuterParams(int); - /* 802BBEE4 */ void setOuterParams(JASSoundParams const&, JASSoundParams const&, int); - /* 802BC204 */ Z2AudibleChannel* getChannel(int); + /* 802BBED0 */ JASSoundParams* getOuterParams(int index); + /* 802BBEE4 */ void setOuterParams(const JASSoundParams& outParams, const JASSoundParams& inParams, int index); + /* 802BC204 */ Z2AudibleChannel* getChannel(int index); /* 802BC218 */ u32 getDistVolBit(); /* 802BD510 */ ~Z2Audible(); + bool isDoppler() { - return ((*(u8*)&field_0x10.field_0x0) >> 4) & 0xf; + return ((*(u8*)&mParam.field_0x0) >> 4) & 0xf; } - JAUAudibleParam* getAudibleParam() { return &field_0x10; } - const JAUAudibleParam* getAudibleParam() const { return &field_0x10; } - void setAudibleParam(JAUAudibleParam param) { field_0x10 = param; } - const JGeometry::TVec3<f32>* getVel() const { return &field_0x14.field_0xc; } - - /* 0x10 */ JAUAudibleParam field_0x10; - /* 0x14 */ Z2AudibleAbsPos field_0x14; - /* 0x2C */ Z2AudibleChannel field_0x2c[1]; + + const JGeometry::TVec3<f32>& getPos() const { return mPos; } + + JAUAudibleParam* getAudibleParam() { return &mParam; } + const JAUAudibleParam* getAudibleParam() const { return &mParam; } + void setAudibleParam(JAUAudibleParam param) { mParam.field_0x0.raw = param.field_0x0.raw; } + const JGeometry::TVec3<f32>* getVel() const { return &mAbsPos.velocity_; } + + /* 0x10 */ JAUAudibleParam mParam; + /* 0x14 */ Z2AudibleAbsPos mAbsPos; + /* 0x2C */ Z2AudibleChannel mChannel[1]; /* 0x64 */ f32 field_0x64[1]; }; struct Z2Audience : public JAIAudience, public JASGlobalInstance<Z2Audience> { /* 802BD130 */ Z2Audience(); - /* 802BD2DC */ void setAudioCamera(f32 (*)[4], Vec&, Vec&, f32, f32, bool, int, bool); + /* 802BD2DC */ void setAudioCamera(f32 (*)[4], Vec&, Vec&, f32, f32, bool, int camID, bool); /* 802BD704 */ f32 calcOffMicSound(f32); - /* 802BD90C */ void setTargetVolume(f32, int); - /* 802BD92C */ bool convertAbsToRel(Vec&, Vec*, int); - /* 802BD95C */ f32 calcRelPosVolume(Vec const&, f32, int); - /* 802BDA44 */ f32 calcRelPosPan(Vec const&, int); - /* 802BDB44 */ f32 calcRelPosDolby(Vec const&, int); - /* 802BDBDC */ f32 calcVolume_(f32, int) const; - /* 802BDC44 */ u32 calcDeltaPriority_(f32, int, bool) const; - /* 802BDCB0 */ f32 calcPitchDoppler_(JGeometry::TVec3<f32> const&, - JGeometry::TVec3<f32> const&, - JGeometry::TVec3<f32> const&, f32) const; - /* 802BDD00 */ f32 calcFxMix_(f32, int) const; - /* 802BDD48 */ f32 calcPitch_(Z2AudibleChannel*, Z2Audible const*, Z2AudioCamera const*) const; + /* 802BD90C */ void setTargetVolume(f32 volume, int index); + /* 802BD92C */ bool convertAbsToRel(Vec& src, Vec* dst, int camID); + /* 802BD95C */ f32 calcRelPosVolume(const Vec&, f32, int camID); + /* 802BDA44 */ f32 calcRelPosPan(const Vec&, int camID); + /* 802BDB44 */ f32 calcRelPosDolby(const Vec&, int camID); + /* 802BDBDC */ f32 calcVolume_(f32, int distVolBit) const; + /* 802BDC44 */ u32 calcDeltaPriority_(f32, int distVolBit, bool) const; + /* 802BDCB0 */ f32 calcPitchDoppler_(const JGeometry::TVec3<f32>&, + const JGeometry::TVec3<f32>&, + const JGeometry::TVec3<f32>&, f32) const; + /* 802BDD00 */ f32 calcFxMix_(f32, int distVolBit) const; + /* 802BDD48 */ f32 calcPitch_(Z2AudibleChannel* channel, const Z2Audible* audible, const Z2AudioCamera* camera) const; /* 802BD1FC */ virtual ~Z2Audience(); - /* 802BD338 */ virtual JAIAudible* newAudible(JGeometry::TVec3<f32> const&, JAISoundID, - JGeometry::TVec3<f32> const*, u32); + /* 802BD338 */ virtual JAIAudible* newAudible(const JGeometry::TVec3<f32>& pos, JAISoundID soundID, + const JGeometry::TVec3<f32>*, u32); /* 802BDED4 */ virtual int getMaxChannels(); - /* 802BD4D4 */ virtual void deleteAudible(JAIAudible*); - /* 802BD5B8 */ virtual u32 calcPriority(JAIAudible*); - /* 802BD71C */ virtual void mixChannelOut(JASSoundParams const&, JAIAudible*, int); + /* 802BD4D4 */ virtual void deleteAudible(JAIAudible* audible); + /* 802BD5B8 */ virtual u32 calcPriority(JAIAudible* audible); + /* 802BD71C */ virtual void mixChannelOut(const JASSoundParams& outParams, JAIAudible* audible, int channelNum); Z2SpotMic* getLinkMic() { return mLinkMic; } - JGeometry::TVec3<f32> getAudioCamPos(int idx) { - return *mAudioCamera[idx].getPos(); + JGeometry::TVec3<f32> getAudioCamPos(int camID) { + return *mAudioCamera[camID].getPos(); } Z2Audience3DSetting* getSetting() { return &mSetting; } + const Z2AudioCamera* getAudioCamera(int camID) const { return &mAudioCamera[camID]; } + /* 0x004 */ f32 field_0x4; /* 0x008 */ u8 field_0x8; /* 0x00C */ Z2Audience3DSetting mSetting; /* 0x134 */ Z2AudioCamera mAudioCamera[1]; /* 0x1A8 */ Z2SpotMic mSpotMic[1]; /* 0x1D0 */ Z2SpotMic* mLinkMic; - /* 0x1D4 */ s32 mMaxChannels; + /* 0x1D4 */ s32 mNumPlayers; /* 0x1D8 */ u8 field_0x1d8[4]; /* 0x1DC */ bool mUsingOffMicVol; }; // Size: 0x1E0 diff --git a/include/Z2AudioLib/Z2AudioArcLoader.h b/include/Z2AudioLib/Z2AudioArcLoader.h index 031f191412..af8f87fe5d 100644 --- a/include/Z2AudioLib/Z2AudioArcLoader.h +++ b/include/Z2AudioLib/Z2AudioArcLoader.h @@ -8,9 +8,9 @@ public: Z2AudioArcLoader(JAUSection*); virtual ~Z2AudioArcLoader() {} - virtual bool readCommandMore(u32); - void readBFCA(const void*); - virtual void readBSTN(const void*, u32); + virtual bool readCommandMore(u32 command); + void readBFCA(const void* addr); + virtual void readBSTN(const void* addr, u32); }; #endif /* Z2AUDIOARCLOADER_H */ diff --git a/include/Z2AudioLib/Z2AudioCS.h b/include/Z2AudioLib/Z2AudioCS.h index 9cc975c361..2f9f79fe05 100644 --- a/include/Z2AudioLib/Z2AudioCS.h +++ b/include/Z2AudioLib/Z2AudioCS.h @@ -8,14 +8,14 @@ class JKRArchive; class Z2AudioCS { public: - void newSpkSoundMemPool(); + static void newSpkSoundMemPool(); int init(JKRHeap*, JKRArchive*, s32, s32); void update(); static void connect(s32); static void disconnect(s32); static void extensionProcess(s32, s32); u32 getHandleSoundID(s32); - void start(s32, s32); + static void start(s32, s32); static int startLevel(s32, s32); }; diff --git a/include/Z2AudioLib/Z2AudioMgr.h b/include/Z2AudioLib/Z2AudioMgr.h index 82f814ebfe..7f47400af2 100644 --- a/include/Z2AudioLib/Z2AudioMgr.h +++ b/include/Z2AudioLib/Z2AudioMgr.h @@ -12,6 +12,7 @@ #include "Z2AudioLib/Z2SoundObjMgr.h" #include "Z2AudioLib/Z2SpeechMgr2.h" #include "Z2AudioLib/Z2StatusMgr.h" +#include "Z2AudioLib/Z2DebugSys.h" #include "global.h" class JKRArchive; @@ -21,23 +22,21 @@ class Z2AudioMgr : public Z2SeMgr, public Z2SeqMgr, public Z2SceneMgr, public Z2 public: Z2AudioMgr(); ~Z2AudioMgr() {} - void init(JKRSolidHeap*, u32, void*, JKRArchive*); - void setOutputMode(u32); + void init(JKRSolidHeap* heap, u32 memSize, void* baaData, JKRArchive* seqArc); + void setOutputMode(u32 mode); void zeldaGFrameWork(); void gframeProcess(); void resetProcess(u32, bool); void resetRecover(); bool hasReset() const; + bool startLevelSound(JAISoundID soundID, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr); bool isResetting() { return mResettingFlag; } static Z2AudioMgr* getInterface() { return mAudioMgrPtr; } static Z2AudioMgr* mAudioMgrPtr; -#if DEBUG - u8 padding[0xC]; -#endif - /* 0x0514 */ virtual bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*); + /* 0x0514 */ virtual bool startSound(JAISoundID soundID, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr); /* 0x0518 */ bool mResettingFlag; /* 0x0519 */ bool field_0x519; /* 0x051C */ JASAudioReseter mAudioReseter; @@ -47,6 +46,9 @@ public: /* 0x0D4C */ Z2Audience mAudience; /* 0x0F2C */ Z2SpeechMgr2 mSpeechMgr; /* 0x1370 */ Z2FxLineMgr mFxLineMgr; + #if DEBUG + /* 0x13BC */ Z2DebugSys mDebugSys; + #endif }; // Size: 0x138C #if VERSION != VERSION_SHIELD_DEBUG diff --git a/include/Z2AudioLib/Z2Calc.h b/include/Z2AudioLib/Z2Calc.h index efef286d8a..883262ab40 100644 --- a/include/Z2AudioLib/Z2Calc.h +++ b/include/Z2AudioLib/Z2Calc.h @@ -14,35 +14,36 @@ static const Vec cNullVec = {0.0f, 0.0f, 0.0f}; #endif enum CurveSign { - CURVE_SIGN_0 = 0, - CURVE_SIGN_1 = 1, - CURVE_SIGN_2 = 2, + CURVE_NEGATIVE = 0, + CURVE_POSITIVE = 1, + CURVE_LINEAR = 2, }; struct FNoise1f { - FNoise1f(float param_0 = 0.1f, float param_1 = 0.0f, float param_2 = 0.01f) { - unk0 = param_0; - unk4 = param_0; - unk8 = param_2; - unk12 = param_1; + FNoise1f(f32 value = 0.1f, f32 threshold = 0.0f, f32 step = 0.01f) { + value_ = value; + targetValue_ = value; + step_ = step; + threshold_ = threshold; } - void setParam(float, float, float); - float tau(float); - float calcNoise1f(); - - float unk0; - float unk4; - float unk8; - float unk12; + + void setParam(f32 value, f32 threshold, f32 step); + f32 tau(f32 input); + f32 calcNoise1f(); + + f32 value_; + f32 targetValue_; + f32 step_; + f32 threshold_; }; -float linearTransform(float, float, float, float, float, bool); -float getParamByExp(float, float, float, float, float, float, Z2Calc::CurveSign); -float getRandom(float, float, float); -float getRandom_0_1(void); +f32 linearTransform(f32 inValue, f32 inMin, f32 inMax, f32 outMin, f32 outMax, bool noClamp); +f32 getParamByExp(f32 value, f32 inMin, f32 inMax, f32 exponent, f32 outMin, f32 outMax, CurveSign curveSign); +f32 getRandom(f32 magnitude, f32 exponent, f32 bias); +f32 getRandom_0_1(); -extern f32 cEqualCSlope; -extern f32 cEqualPSlope; +extern const f32 cEqualCSlope; +extern const f32 cEqualPSlope; } // namespace Z2Calc #endif /* Z2CALC_H */ diff --git a/include/Z2AudioLib/Z2Creature.h b/include/Z2AudioLib/Z2Creature.h index d71a4e3e98..0d0b9a2f23 100644 --- a/include/Z2AudioLib/Z2Creature.h +++ b/include/Z2AudioLib/Z2Creature.h @@ -9,22 +9,22 @@ public: Z2Creature(); ~Z2Creature(); - void init(Vec*, Vec*, u8, u8); - void init(Vec*, Vec*, Vec*, u8, u8, u8); - void initAnime(void*, bool, f32, f32); + void init(Vec* animePosPtr, Vec* simplePosPtr, u8 animeHandleNum, u8 simpleHandleNum); + void init(Vec* animePosPtr, Vec* simplePosPtr, Vec* simple2PosPtr, u8 animeHandleNum, u8 simpleHandleNum, u8 simple2HandleNum); + void initAnime(void* animation, bool, f32 startFrame, f32); void updateAnime(f32, f32); void stopAnime(); virtual void deleteObject(); - virtual void setSoundStarter(Z2SoundStarter*); - virtual void framework(u32, s8); - virtual Z2SoundHandlePool* startCreatureSound(JAISoundID, u32, s8); - virtual Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID, u32, s8); - virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID, s8); - virtual Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID, s8); - virtual Z2SoundHandlePool* startCreatureExtraSound(JAISoundID, u32, s8); - virtual Z2SoundHandlePool* startCreatureExtraSoundLevel(JAISoundID, u32, s8); - virtual Z2SoundHandlePool* startCollisionSE(u32, u32); + virtual void setSoundStarter(Z2SoundStarter* soundStarter); + virtual void framework(u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startCreatureSound(JAISoundID soundID, u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID soundID, u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID soundID, s8 reverb); + virtual Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID soundID, s8 reverb); + virtual Z2SoundHandlePool* startCreatureExtraSound(JAISoundID soundID, u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startCreatureExtraSoundLevel(JAISoundID soundID, u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startCollisionSE(u32 hitID, u32 mapinfo); Vec* getCurrentPos() const { return mpPos; } @@ -38,18 +38,18 @@ class Z2CreatureEnemy : public Z2Creature, public JSULink<Z2CreatureEnemy> { public: /* 802C0F64 */ Z2CreatureEnemy(); /* 802C0FC4 */ virtual void deleteObject(); - /* 802C1094 */ void init(Vec*, Vec*, u8, u8); + /* 802C1094 */ void init(Vec* animePosPtr, Vec* simplePosPtr, u8 animeHandleNum, u8 simpleHandleNum); /* 802C10B4 */ void init(Vec*, Vec*, Vec*, u8, u8, u8); - /* 802C10D4 */ virtual void framework(u32, s8); - /* 802C110C */ virtual Z2SoundHandlePool* startCreatureSound(JAISoundID, u32, s8); - /* 802C136C */ virtual Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID, u32, s8); - /* 802C168C */ virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID, s8); - /* 802C1948 */ virtual Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID, s8); - /* 802C199C */ virtual Z2SoundHandlePool* startCreatureExtraSound(JAISoundID, u32, s8); - /* 802C19D8 */ virtual Z2SoundHandlePool* startCreatureExtraSoundLevel(JAISoundID, u32, s8); - /* 802C1A14 */ virtual Z2SoundHandlePool* startCollisionSE(u32, u32); - /* 802C1B7C */ void setLinkSearch(bool); - /* 802C1B90 */ void setEnemyName(char const*); + /* 802C10D4 */ virtual void framework(u32 mapinfo, s8 reverb); + /* 802C110C */ virtual Z2SoundHandlePool* startCreatureSound(JAISoundID soundID, u32 mapinfo, s8 reverb); + /* 802C136C */ virtual Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID soundID, u32 mapinfo, s8 reverb); + /* 802C168C */ virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID soundID, s8 reverb); + /* 802C1948 */ virtual Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID soundID, s8 reverb); + /* 802C199C */ virtual Z2SoundHandlePool* startCreatureExtraSound(JAISoundID soundID, u32 mapinfo, s8 reverb); + /* 802C19D8 */ virtual Z2SoundHandlePool* startCreatureExtraSoundLevel(JAISoundID soundID, u32 mapinfo, s8 reverb); + /* 802C1A14 */ virtual Z2SoundHandlePool* startCollisionSE(u32 hitID, u32 mapinfo); + /* 802C1B7C */ void setLinkSearch(bool isLinkSearch); + /* 802C1B90 */ void setEnemyName(const char* enemyName); /* 0xA0 */ u8 mEnemyID; /* 0xA1 */ s8 field_0xa1; @@ -61,11 +61,11 @@ class Z2CreatureCitizen : public Z2Creature, public JSULink<Z2CreatureCitizen> { public: /* 802C0C10 */ Z2CreatureCitizen(); /* 802C0C6C */ ~Z2CreatureCitizen(); - /* 802C0CE4 */ void init(Vec*, Vec*, u8, u8); + /* 802C0CE4 */ void init(Vec* animePosPtr, Vec* simplePosPtr, u8 animeHandleNum, u8 simpleHandleNum); /* 802C0D04 */ virtual void deleteObject(); /* 802C0D48 */ void setMdlType(s8, bool, bool); /* 802C0E18 */ void playVoice(int); - /* 802C0ED8 */ virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID, s8); + /* 802C0ED8 */ virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID soundID, s8 reverb); private: /* 0xA0 */ s8 mCitizenID; @@ -77,15 +77,15 @@ private: class Z2CreatureSumomo : public Z2Creature { public: /* 802C1BE8 */ Z2CreatureSumomo(); - /* 802C1C24 */ void playSumomoBgm(u32); + /* 802C1C24 */ void playSumomoBgm(u32 dist); /* 802C1CA0 */ void deleteObject(); }; // Size: 0x90 class Z2SoundObjBeeGroup : public Z2SoundObjBase { public: /* 802C1D10 */ Z2SoundObjBeeGroup(); - /* 802C1D4C */ void init(Vec*, u8); - /* 802C1D6C */ void playBeeGroupSound(JAISoundID, u8); + /* 802C1D4C */ void init(Vec* posPtr, u8 handleNum); + /* 802C1D6C */ void playBeeGroupSound(JAISoundID soundID, u8); }; // Size: 0x20 class Z2CreatureFM : public Z2CreatureEnemy { @@ -93,9 +93,9 @@ public: /* 802C1F54 */ Z2CreatureFM(); /* 802C1FB0 */ void deleteObject(); /* 802C1FFC */ void init(Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, u8, u8, u8, u8, u8, u8); - /* 802C20E8 */ void framework(u32, s8); - /* 802C2194 */ Z2SoundHandlePool* startChainSound(JAISoundID, u8, f32, u32, s8); - /* 802C2290 */ Z2SoundHandlePool* startChainSoundLevel(JAISoundID, u8, f32, u32, s8); + /* 802C20E8 */ void framework(u32 mapinfo, s8 reverb); + /* 802C2194 */ Z2SoundHandlePool* startChainSound(JAISoundID soundID, u8, f32, u32 mapinfo, s8 reverb); + /* 802C2290 */ Z2SoundHandlePool* startChainSoundLevel(JAISoundID soundID, u8, f32, u32 mapinfo, s8 reverb); /* 0x0A4 */ Z2SoundObjSimple field_0xa4; /* 0x0C4 */ Z2SoundObjSimple field_0xc4; @@ -106,7 +106,7 @@ public: class Z2CreatureGob : public Z2Creature { public: /* 802C24B0 */ void init(Vec*, Vec*, Vec*, u8, u8, u8); - /* 802C24D0 */ Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID, s8); + /* 802C24D0 */ Z2SoundHandlePool* startCreatureVoiceLevel(JAISoundID soundID, s8 reverb); }; class Z2CreatureOI : public Z2CreatureEnemy { @@ -115,10 +115,10 @@ public: /* 802C25EC */ void deleteObject(); /* 802C2670 */ void init(Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*, Vec*); - /* 802C2864 */ void framework(u32, s8); - /* 802C29D4 */ Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID, u32, s8); - /* 802C2C84 */ Z2SoundHandlePool* startTentacleSound(JAISoundID, u8, u32, s8); - /* 802C2CD4 */ Z2SoundHandlePool* startTentacleSoundLevel(JAISoundID, u8, f32, u32, s8); + /* 802C2864 */ void framework(u32 mapinfo, s8 reverb); + /* 802C29D4 */ Z2SoundHandlePool* startCreatureSoundLevel(JAISoundID soundID, u32 mapinfo, s8 reverb); + /* 802C2C84 */ Z2SoundHandlePool* startTentacleSound(JAISoundID soundID, u8, u32 mapinfo, s8 reverb); + /* 802C2CD4 */ Z2SoundHandlePool* startTentacleSoundLevel(JAISoundID soundID, u8, f32, u32 mapinfo, s8 reverb); /* 0x0A4 */ Z2SoundObjSimple field_0xa4; /* 0x0C4 */ Z2SoundObjSimple field_0xc4; diff --git a/include/Z2AudioLib/Z2DebugSys.h b/include/Z2AudioLib/Z2DebugSys.h index 285228d3e1..9172d241ee 100644 --- a/include/Z2AudioLib/Z2DebugSys.h +++ b/include/Z2AudioLib/Z2DebugSys.h @@ -2,9 +2,16 @@ #define Z2DEBUGSYS_H #include "JSystem/JAudio2/JASGadget.h" +#include "JSystem/JAudio2/JAISeqDataMgr.h" -// Only here for instance sub. No known code. struct Z2DebugSys : public JASGlobalInstance<Z2DebugSys> { + Z2DebugSys(); + ~Z2DebugSys(); + + void initJAW(); + void initSoundHioNode(); + void debugframework(); + JAISeqDataMgr* initSeSeqDataMgr(const void*); }; -#endif
\ No newline at end of file +#endif diff --git a/include/Z2AudioLib/Z2EnvSeMgr.h b/include/Z2AudioLib/Z2EnvSeMgr.h index 8cf1a95784..77b105a9f1 100644 --- a/include/Z2AudioLib/Z2EnvSeMgr.h +++ b/include/Z2AudioLib/Z2EnvSeMgr.h @@ -12,10 +12,10 @@ enum WindType { }; struct Z2EnvSeBase { - /* 802C589C */ Z2EnvSeBase(Vec* param_0 = NULL); + /* 802C589C */ Z2EnvSeBase(Vec* posPtr = NULL); /* 802C58AC */ ~Z2EnvSeBase(); - /* 802C5908 */ bool startEnvSe(JAISoundID, f32, f32, f32, f32, f32, u32); - /* 802C5AB4 */ bool startEnvSeLevel(JAISoundID, f32, f32, f32, f32, f32, u32); + /* 802C5908 */ bool startEnvSe(JAISoundID soundID, f32 fxMix, f32 volume, f32 pan, f32 dolby, f32 pitch, u32 moveSteps); + /* 802C5AB4 */ bool startEnvSeLevel(JAISoundID soundID, f32 fxMix, f32 volume, f32 pan, f32 dolby, f32 pitch, u32 moveSteps); JAISoundHandle* getHandle() { return &mHandle; } void setPos(Vec* pos) { mPos = pos; } @@ -27,12 +27,12 @@ struct Z2EnvSeBase { struct Z2EnvSeAutoPan : public Z2EnvSeBase { /* 802C5ECC */ Z2EnvSeAutoPan(); /* 802C5F28 */ ~Z2EnvSeAutoPan(); - /* 802C5F7C */ void setPanParam(f32, f32, bool, bool, f32, f32); + /* 802C5F7C */ void setPanParam(f32 pan, f32 dolby, bool, bool, f32, f32); /* 802C5F98 */ void calcPan(); - /* 802C60E0 */ bool startEnvSeAutoPanLevel(JAISoundID, f32, f32, f32); + /* 802C60E0 */ bool startEnvSeAutoPanLevel(JAISoundID soundID, f32 fxMix, f32 volume, f32 pitch); - /* 0x08 */ f32 field_0x8; - /* 0x0C */ f32 field_0xc; + /* 0x08 */ f32 mPan; + /* 0x0C */ f32 mDolby; /* 0x10 */ f32 field_0x10; /* 0x14 */ f32 field_0x14; /* 0x18 */ bool field_0x18; @@ -40,14 +40,14 @@ struct Z2EnvSeAutoPan : public Z2EnvSeBase { }; // Size: 0x1C struct Z2EnvSeDir : public Z2EnvSeBase { - /* 802C5C9C */ Z2EnvSeDir(Vec* param_0 = NULL); + /* 802C5C9C */ Z2EnvSeDir(Vec* dir = NULL); /* 802C5D1C */ ~Z2EnvSeDir(); - /* 802C5D70 */ void setPanDir(Vec*); + /* 802C5D70 */ void setPanDir(Vec* dir); /* 802C5D9C */ void calcPan(f32); - /* 802C5E90 */ bool startEnvSeDirLevel(JAISoundID, f32, f32); + /* 802C5E90 */ bool startEnvSeDirLevel(JAISoundID soundID, f32 fxMix, f32 volume); - /* 0x08 */ f32 field_0x8; - /* 0x0C */ f32 field_0xc; + /* 0x08 */ f32 mPan; + /* 0x0C */ f32 mDolby; /* 0x10 */ Vec mPanDir; }; // Size: 0x1C @@ -57,40 +57,40 @@ struct Z2EnvSeMgr : public JASGlobalInstance<Z2EnvSeMgr> { /* 802C66B0 */ void framework(); /* 802C6998 */ void resetScene(); /* 802C699C */ void resetSceneInner(); - /* 802C6AC0 */ void initSceneEnvSe(s32, s8, f32); + /* 802C6AC0 */ void initSceneEnvSe(s32 sceneID, s8 room, f32); /* 802C6C1C */ void playSceneEnvSe(); /* 802C6C84 */ void initStaticEnvSe(u8, u8, u8, u8, Vec*); - /* 802C70C8 */ bool startStaticEnvSe(s8); - /* 802C780C */ void registWindowPos(Vec*); + /* 802C70C8 */ bool startStaticEnvSe(s8 reverb); + /* 802C780C */ void registWindowPos(Vec* posPtr); /* 802C7830 */ bool startRainSe(s32, s8); - /* 802C7CF4 */ void startNearThunderSe(s8); - /* 802C7E68 */ void startFarThunderSe(Vec*, s8); - /* 802C7FB4 */ void setSnowPower(s8); + /* 802C7CF4 */ void startNearThunderSe(s8 reverb); + /* 802C7E68 */ void startFarThunderSe(Vec* posPtr, s8 reverb); + /* 802C7FB4 */ void setSnowPower(s8 reverb); /* 802C7FBC */ void initStrongWindSe(); - /* 802C7FC8 */ void setWindDirection(Vec*); - /* 802C800C */ bool startStrongWindSe(s8); + /* 802C7FC8 */ void setWindDirection(Vec* dir); + /* 802C800C */ bool startStrongWindSe(s8 reverb); /* 802C80F8 */ void initRiverSe(u8, u8, u8, u8); - /* 802C8234 */ void registRiverSePos(Vec*); - /* 802C8258 */ void setHyrulSewerOpen(bool); - /* 802C8300 */ bool startRiverSe(s8); + /* 802C8234 */ void registRiverSePos(Vec* posPtr); + /* 802C8258 */ void setHyrulSewerOpen(bool isSewerOpen); + /* 802C8300 */ bool startRiverSe(s8 reverb); /* 802C8730 */ void initFallSe(u8, u8, u8, u8); - /* 802C886C */ void registFallSePos(Vec*); - /* 802C8890 */ bool startFallSe(s8); + /* 802C886C */ void registFallSePos(Vec* posPtr); + /* 802C8890 */ bool startFallSe(s8 reverb); /* 802C8A90 */ void initEtcSe(u8, u8, u8, u8); - /* 802C8C24 */ void registEtcSePos(Vec*); - /* 802C8C48 */ bool startEtcSe(s8); - /* 802C92C8 */ void registWolfSmellSePos(Vec*); - /* 802C92EC */ bool startFogWipeTrigger(Vec*); - /* 802C93A0 */ void setFogWipeWidth(f32); + /* 802C8C24 */ void registEtcSePos(Vec* posPtr); + /* 802C8C48 */ bool startEtcSe(s8 reverb); + /* 802C92C8 */ void registWolfSmellSePos(Vec* posPtr); + /* 802C92EC */ void startFogWipeTrigger(Vec* pos); + /* 802C93A0 */ void setFogWipeWidth(f32 width); /* 802C93E4 */ f32 getFogDensity(); /* 802C9400 */ bool startFogSe(); /* 802C950C */ void initLv3WaterSe(u8, u8, u8, u8); - /* 802C9F58 */ void registLv3WaterSePos(u8, Vec*); - /* 802CA794 */ void startLv3WaterSe(s8); + /* 802C9F58 */ void registLv3WaterSePos(u8, Vec* posPtr); + /* 802CA794 */ void startLv3WaterSe(s8 reverb); - void setWindType(u8 i_type) { mWindType = i_type; } - void registSmellSePos(Vec* param_0) { registEtcSePos(param_0); } - void startSmellSe(s8 param_0) { startEtcSe(param_0); } + void setWindType(u8 type) { mWindType = type; } + void registSmellSePos(Vec* posPtr) { registEtcSePos(posPtr); } + void startSmellSe(s8 reverb) { startEtcSe(reverb); } void initSmellSe(u8 param_0, u8 param_1, u8 param_2, u8 param_3) { initEtcSe(param_0, param_1, param_2, param_3); } diff --git a/include/Z2AudioLib/Z2FxLineMgr.h b/include/Z2AudioLib/Z2FxLineMgr.h index 0931742f6e..c88d030b99 100644 --- a/include/Z2AudioLib/Z2FxLineMgr.h +++ b/include/Z2AudioLib/Z2FxLineMgr.h @@ -27,12 +27,12 @@ struct Z2FxLineConfig { struct Z2FxLineMgr : public JASGlobalInstance<Z2FxLineMgr> { /* 802BA7DC */ Z2FxLineMgr(); - /* 802BA7FC */ void initDataArc(JKRArchive*, JKRHeap*); - /* 802BAC28 */ void setLineID(s8, bool, bool); - /* 802BAC74 */ void setLine(Z2FxLineConfig*, bool, bool); + /* 802BA7FC */ void initDataArc(JKRArchive* arc, JKRHeap* heap); + /* 802BAC28 */ void setLineID(s8 fxID, bool, bool); + /* 802BAC74 */ void setLine(Z2FxLineConfig* config, bool, bool); /* 802BAE1C */ void setFxForceOff(bool); - /* 802BAE48 */ void setUnderWaterFx(bool); - /* 802BAEB8 */ void setSceneFx(s32); + /* 802BAE48 */ void setUnderWaterFx(bool isUnderWaterFx); + /* 802BAEB8 */ void setSceneFx(s32 sceneNo); /* 0x00 */ Z2FxLineConfig* mConfig; /* 0x04 */ void* mFxLineBuffer[4]; diff --git a/include/Z2AudioLib/Z2LinkMgr.h b/include/Z2AudioLib/Z2LinkMgr.h index 35b8ebcb71..886226afd9 100644 --- a/include/Z2AudioLib/Z2LinkMgr.h +++ b/include/Z2AudioLib/Z2LinkMgr.h @@ -9,8 +9,10 @@ public: Z2LinkSoundStarter(); inline virtual ~Z2LinkSoundStarter(); - virtual bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*, u32, f32, - f32, f32, f32, f32, u32); + virtual bool startSound(JAISoundID soundID, JAISoundHandle* handle, + const JGeometry::TVec3<f32>* posPtr, u32 mapinfo, + f32 fxMix, f32 pitch, f32 volume, f32 pan, + f32 dolby, u32 moveSteps); }; class Z2CreatureLink : public Z2Creature, public Z2LinkSoundStarter { @@ -19,41 +21,41 @@ public: ~Z2CreatureLink(); void setLinkGroupInfo(u8); - void setLinkHp(s32, s32); - void setLinkSwordType(s32, s32); - void setLinkShieldType(s32, s32); - void setLinkBootsType(s32); + void setLinkHp(s32 linkHp, s32); + void setLinkSwordType(s32 swordType, s32); + void setLinkShieldType(s32 shieldType, s32); + void setLinkBootsType(s32 bootsType); virtual void deleteObject(); - void init(Vec*, Vec*, Vec*); - void initKantera(Vec*); - void deleteKantera(void); - void setKanteraState(u8); - virtual void framework(u32, s8); - void setSinkDepth(s8); - void setRiding(bool); - void setMagnetized(bool); - void setWolfEyeOpen(bool); - Z2SoundHandlePool* startLinkSound(JAISoundID, u32, s8); - JAISoundHandle* startLinkSoundLevel(JAISoundID, u32, s8); - Z2SoundHandlePool* startLinkVoice(JAISoundID, s8); - Z2SoundHandlePool* startLinkVoiceLevel(JAISoundID, s8); - void startLinkSwordSound(JAISoundID, u32, s8); - virtual Z2SoundHandlePool* startCollisionSE(u32, u32); - Z2SoundHandlePool* startHitItemSE(u32, u32, Z2SoundObjBase*, float); - void setResumeAttack(bool); - - void setInWater(bool status) { mInWater = status; } + void init(Vec* animePosPtr, Vec* simplePosPtr, Vec* simple2PosPtr); + void initKantera(Vec* posPtr); + void deleteKantera(); + void setKanteraState(u8 state); + virtual void framework(u32 mapinfo, s8 reverb); + void setSinkDepth(s8 sinkDepth); + void setRiding(bool isRiding); + void setMagnetized(bool isMagnetized); + void setWolfEyeOpen(bool wolfEyeOpen); + Z2SoundHandlePool* startLinkSound(JAISoundID, u32 mapinfo, s8 reverb); + JAISoundHandle* startLinkSoundLevel(JAISoundID, u32 mapinfo, s8 reverb); + Z2SoundHandlePool* startLinkVoice(JAISoundID, s8 reverb); + Z2SoundHandlePool* startLinkVoiceLevel(JAISoundID, s8 reverb); + void startLinkSwordSound(JAISoundID, u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startCollisionSE(u32 hitID, u32 mapinfo); + Z2SoundHandlePool* startHitItemSE(u32 soundID, u32 mapinfo, Z2SoundObjBase* other, f32 speed); + void setResumeAttack(bool resumeAttack); + + void setInWater(bool inWater) { mInWater = inWater; } bool isInWater() { return mInWater; } u8 getLinkState() { return mLinkState; } - u8 getMoveSpeed() const { return mMoveSpeed; } - bool isRiding() const { return mRiding; } - void setLinkState(u8 i_state) { mLinkState = i_state; } + u8 getMoveSpeed() { return mMoveSpeed; } + bool isRiding() { return mRiding; } + void setLinkState(u8 state) { mLinkState = state; } Z2SoundObjSimple& getKantera() { return mKantera; } - u8 getLinkHp() const { return mLinkHp; } + u8 getLinkHp() { return mLinkHp; } u8 getMovingTime() { return mMovingTime; } - u8 isWolfSmellOpen() const { return mWolfEyeOpen; } - void setUsingIronBall(bool i_using) { mUsingIronBall = i_using; } - void setMarkState(u8 i_state) { mMarkState = i_state; } + bool isWolfSmellOpen() { return mWolfEyeOpen; } + void setUsingIronBall(bool isUsingIronBall) { mUsingIronBall = isUsingIronBall; } + void setMarkState(u8 state) { mMarkState = state; } static Z2CreatureLink* mLinkPtr; @@ -63,7 +65,7 @@ public: private: /* 0x90 Z2LinkSoundStarter */ /* 0x94 */ Z2SoundObjSimple mKantera; - /* 0xB4 */ cXyz field_0xb4; + /* 0xB4 */ Vec field_0xb4; /* 0xC0 */ u8 mLinkState; /* 0xC1 */ u8 field_0xc1; /* 0xC2 */ u8 mMarkState; @@ -99,11 +101,12 @@ inline Z2CreatureLink* Z2GetLink() { class Z2CreatureRide; struct Z2RideSoundStarter : public Z2SoundStarter { - /* 802C5234 */ Z2RideSoundStarter(Z2CreatureRide*); + /* 802C5234 */ Z2RideSoundStarter(Z2CreatureRide* ride); - /* 802C5284 */ virtual bool startSound(JAISoundID, JAISoundHandle*, - JGeometry::TVec3<f32> const*, u32, f32, f32, f32, f32, - f32, u32); + /* 802C5284 */ virtual bool startSound(JAISoundID soundID, JAISoundHandle* handle, + const JGeometry::TVec3<f32>* posPtr, u32 mapinfo, + f32 fxMix, f32 pitch, f32 volume, f32 pan, + f32 dolby, u32 moveSteps); /* 0x4 */ Z2CreatureRide* mRide; }; @@ -112,8 +115,8 @@ class Z2CreatureRide : public Z2Creature, public Z2RideSoundStarter { public: Z2CreatureRide(); ~Z2CreatureRide(); - void init(Vec*, Vec*, u8, u8); - void setLinkRiding(bool); + void init(Vec* animePosPtr, Vec* simplePosPtr, u8 animeHandleNum, u8 simpleHandleNum); + void setLinkRiding(bool isRiding); bool isLinkRiding() { return mLinkRiding; } @@ -127,10 +130,10 @@ private: class Z2SoundObjCoach : public Z2SoundObjBase { public: /* 802C54B8 */ Z2SoundObjCoach(); - /* 802C54FC */ void init(Vec*, u8); + /* 802C54FC */ void init(Vec* posPtr, u8 handleNum); /* 802C551C */ Z2SoundHandlePool* startWheelSound(f32); /* 802C56C0 */ Z2SoundHandlePool* startFireSound(u16); - /* 802C57C0 */ Z2SoundHandlePool* startSound(JAISoundID, u32, s8); + /* 802C57C0 */ Z2SoundHandlePool* startSound(JAISoundID soundID, u32 mapinfo, s8 reverb); private: /* 0x20 */ f32 field_0x20; diff --git a/include/Z2AudioLib/Z2Param.h b/include/Z2AudioLib/Z2Param.h index d98289f7ef..541bbb9556 100644 --- a/include/Z2AudioLib/Z2Param.h +++ b/include/Z2AudioLib/Z2Param.h @@ -40,24 +40,28 @@ struct Z2Param { static f32 VOL_SE_ATMOSPHERE_PAUSING; static f32 MIN_DISTANCE_VOLUME; static f32 ENEMY_LASTHIT_MUTE_VOLUME; + + // made up names based on HIO labels + static u8 SCENE_CHANGE_BGM_FADEOUT_TIME; + static u8 BGM_CROSS_FADEIN_TIME; + static u8 BGM_CROSS_FADEOUT_TIME; + static u8 BATTLE_BGM_WAIT_TIME; + + static u8 FOUND_TRACK_FI_TIME; + static u8 FOUND_TRACK_FO_TIME; + static u8 CLOSE_BATTLE_TRACK_FI_TIME; + static u8 CLOSE_BATTLE_TRACK_FO_TIME; + + static u8 ENDING_BLOW_VOL_DOWN_TIME; + static u8 ENDING_BLOW_VOL_LOWER_TIME; + static u8 ENDING_BLOW_VOL_LOWER_RECOVER_TIME; + static u8 ENDING_BLOW_MIN_FINISH_TIME; + + static u8 DARK_SE_FILTER_ON; + static u8 DARK_SE_LOW_PASS_FILTER_SETTING; + static u8 SYSTEM_SE_USE_DARK_SE_SETTING; }; -extern u8 struct_80450860; -extern u8 struct_80450861; -extern u8 struct_80450862; -extern u8 struct_80450863; -extern u8 struct_80450864; -extern u8 struct_80450865; -extern u8 struct_80450866; -extern u8 struct_80450867; -extern u8 struct_80450868; -extern u8 struct_80450869; -extern u8 struct_8045086A; -extern u8 struct_8045086B; extern u8 data_8045086C; -extern u8 struct_80451340; -extern u8 struct_80451341; -extern u8 struct_80451342; - #endif /* Z2PARAM_H */ diff --git a/include/Z2AudioLib/Z2SceneMgr.h b/include/Z2AudioLib/Z2SceneMgr.h index 553ec2d5e8..c1e6402aca 100644 --- a/include/Z2AudioLib/Z2SceneMgr.h +++ b/include/Z2AudioLib/Z2SceneMgr.h @@ -9,12 +9,13 @@ s8 dComIfGp_getReverb(int roomNo); class Z2SceneMgr : public JASGlobalInstance<Z2SceneMgr> { public: Z2SceneMgr(); - void setInDarkness(bool); - void setSceneExist(bool); - void setFadeOutStart(u8); - void setFadeInStart(u8); - void setSceneName(char*, s32, s32); - void sceneChange(JAISoundID, u8, u8, u8, u8, u8, bool); + void setInDarkness(bool inDarkness); + void setSceneExist(bool isSceneExist); + void setFadeOutStart(u8 fadeType); + void setFadeInStart(u8 fadeType); + void setSceneName(char* spot, s32 room, s32 layer); + void sceneChange(JAISoundID bgm, u8 seWave1, u8 seWave2, u8 bgmWave1, u8 bgmWave2, + u8 demoWave, bool); void framework(); void load1stDynamicWave(); void _load1stWaveInner_1(); @@ -24,18 +25,22 @@ public: void sceneBgmStart(); void loadStaticWaves(); BOOL checkFirstWaves(); - bool eraseSeWave(u32); - bool eraseBgmWave(u32); - s32 getWaveLoadStatus(u32, u32); - bool loadSeWave(u32); - bool loadBgmWave(u32); + bool eraseSeWave(u32 wave); + bool eraseBgmWave(u32 wave); + s32 getWaveLoadStatus(u32 wave, u32 bank); + bool loadSeWave(u32 wave); + bool loadBgmWave(u32 wave); + + #if PLATFORM_SHIELD + bool loadSceneWave(u32 wave, u32 bank); + #endif bool isSceneExist() { return sceneExist; } int getCurrentSceneNum() { return sceneNum; } s8 getCurrentRoomNum() { return roomNum; } bool isInGame() { return inGame; } - void setInGame(bool i_inGame) { inGame = i_inGame; } - bool isInDarkness() const { return inDarkness; } + void setInGame(bool isInGame) { inGame = isInGame; } + bool isInDarkness() { return inDarkness_; } s8 getRoomReverb() { return dComIfGp_getReverb(roomNum); } bool isMovieDemo() { return sceneNum == 2 || sceneNum == 8 || sceneNum == 9; } s32 getSeLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 0); } @@ -64,95 +69,95 @@ private: /* 0x1B */ bool field_0x1b; /* 0x1C */ bool inGame; /* 0x1D */ bool sceneExist; - /* 0x1E */ bool inDarkness; + /* 0x1E */ bool inDarkness_; }; // Size = 0x20 inline Z2SceneMgr* Z2GetSceneMgr() { return JASGlobalInstance<Z2SceneMgr>::getInstance(); } -enum Spot { // aka scene - /* 0x00 */ SPOT_ORDON_RANCH, - /* 0x01 */ SPOT_ORDON_VILLAGE, - /* 0x02 */ SPOT_ORDON_INTERIOR, - /* 0x03 */ SPOT_ORDON_SPRING, - /* 0x04 */ SPOT_TWILIGHT_HYRULE_CASTLE, - /* 0x05 */ SPOT_FARON_WOODS, - /* 0x06 */ SPOT_CORO_SHOP, - /* 0x07 */ SPOT_SACRED_GROVE, - /* 0x08 */ SPOT_KAKARIKO_VILLAGE, - /* 0x09 */ SPOT_KAKARIKO_INTERIOR, - /* 0x0A */ SPOT_SANCTUARY_BASEMENT, - /* 0x0B */ SPOT_DEATH_MOUNTAIN, - /* 0x0C */ SPOT_SUMO_HALL, - /* 0x0D */ SPOT_KAKARIKO_GRAVEYARD, - /* 0x0E */ SPOT_HIDDEN_VILLAGE, - /* 0x0F */ SPOT_IMPAZ_HOUSE, - /* 0x10 */ SPOT_LAKE_HYLIA, - /* 0x11 */ SPOT_ZORAS_RIVER, - /* 0x12 */ SPOT_UPPER_ZORAS_RIVER, - /* 0x13 */ SPOT_FISHING_POND, - /* 0x14 */ SPOT_HENA_CABIN, - /* 0x15 */ SPOT_ZORAS_DOMAIN, - /* 0x16 */ SPOT_CASTLE_TOWN, - /* 0x17 */ SPOT_CASTLE_TOWN_INTERIOR, - /* 0x18 */ SPOT_CASTLE_TOWN_SHOPS, - /* 0x19 */ SPOT_STAR_TENT, - /* 0x1A */ SPOT_SNOWPEAK, - /* 0x1B */ SPOT_ARBITERS_GROUNDS_EXTERIOR, - /* 0x1C */ SPOT_GERUDO_DESERT, - /* 0x1D */ SPOT_MIRROR_CHAMBER, - /* 0x1E */ SPOT_HYRULE_FIELD, - /* 0x1F */ SPOT_CASTLE_TOWN_GATES, - /* 0x20 */ SPOT_HYLIA_BRIDGE_BATTLE, - /* 0x21 */ SPOT_SHADES_REALM, - /* 0x22 */ SPOT_ELDIN_BRIDGE_BATTLE, - /* 0x23 */ SPOT_NONE, - /* 0x24 */ SPOT_LIGHT_SPIRIT_CHAMBER, - /* 0x25 */ SPOT_CASTLE_THRONE_ROOM, - /* 0x26 */ SPOT_ENEMY_TEST, - /* 0x27 */ SPOT_FORTRESS, - /* 0x28 */ SPOT_FOREST_TEMPLE, - /* 0x29 */ SPOT_FOREST_TEMPLE_MINIBOSS, - /* 0x2A */ SPOT_FOREST_TEMPLE_BOSS, - /* 0x2B */ SPOT_GORON_MINES, - /* 0x2C */ SPOT_GORON_MINES_MINIBOSS, - /* 0x2D */ SPOT_GORON_MINES_BOSS, - /* 0x2E */ SPOT_LAKEBED_TEMPLE, - /* 0x2F */ SPOT_LAKEBED_TEMPLE_MINIBOSS, - /* 0x30 */ SPOT_LAKEBED_TEMPLE_BOSS, - /* 0x31 */ SPOT_ARBITERS_GROUNDS, - /* 0x32 */ SPOT_ARBITERS_GROUNDS_MINIBOSS, - /* 0x33 */ SPOT_ARBITERS_GROUNDS_BOSS, - /* 0x34 */ SPOT_SNOWPEAK_RUINS, - /* 0x35 */ SPOT_SNOWPEAK_RUINS_MINIBOSS, - /* 0x36 */ SPOT_SNOWPEAK_RUINS_BOSS, - /* 0x37 */ SPOT_TEMPLE_OF_TIME, - /* 0x38 */ SPOT_TEMPLE_OF_TIME_MINIBOSS, - /* 0x39 */ SPOT_TEMPLE_OF_TIME_BOSS, - /* 0x3A */ SPOT_CITY_IN_THE_SKY, - /* 0x3B */ SPOT_CITY_IN_THE_SKY_MINIBOSS, - /* 0x3C */ SPOT_CITY_IN_THE_SKY_BOSS, - /* 0x3D */ SPOT_PALACE_OF_TWILIGHT, - /* 0x3E */ SPOT_PALACE_OF_TWILIGHT_MINIBOSS_A, - /* 0x3F */ SPOT_PALACE_OF_TWILIGHT_MINIBOSS_B, - /* 0x40 */ SPOT_PALACE_OF_TWILIGHT_THRONE_ROOM, - /* 0x41 */ SPOT_PALACE_OF_TWILIGHT_BOSS, - /* 0x42 */ SPOT_HYRULE_CASTLE, - /* 0x43 */ SPOT_FINAL_BATTLE_THRONE_ROOM, - /* 0x44 */ SPOT_FINAL_BATTLE_FIELD, - /* 0x45 */ SPOT_FINAL_BATTLE_CUTSCENE, - /* 0x46 */ SPOT_ICE_BLOCK_PUZZLE, - /* 0x47 */ SPOT_CAVE_OF_ORDEALS, - /* 0x48 */ SPOT_GORGE_LANTERN_CAVE, - /* 0x49 */ SPOT_LAKE_LANTERN_CAVE, - /* 0x4A */ SPOT_ELDIN_MAGNET_CAVE, - /* 0x4B */ SPOT_GROTTO_GRASS_1, - /* 0x4C */ SPOT_GROTTO_GRASS_2, - /* 0x4D */ SPOT_GROTTO_ROCK_1, - /* 0x4E */ SPOT_GROTTO_ROCK_2, - /* 0x4F */ SPOT_GROTTO_POND, - /* 0x50 */ SPOT_FARON_WOODS_CAVE, +enum Z2Scene { + /* 0x00 */ Z2SCENE_ORDON_RANCH, + /* 0x01 */ Z2SCENE_ORDON_VILLAGE, + /* 0x02 */ Z2SCENE_ORDON_INTERIOR, + /* 0x03 */ Z2SCENE_ORDON_SPRING, + /* 0x04 */ Z2SCENE_TWILIGHT_HYRULE_CASTLE, + /* 0x05 */ Z2SCENE_FARON_WOODS, + /* 0x06 */ Z2SCENE_CORO_SHOP, + /* 0x07 */ Z2SCENE_SACRED_GROVE, + /* 0x08 */ Z2SCENE_KAKARIKO_VILLAGE, + /* 0x09 */ Z2SCENE_KAKARIKO_INTERIOR, + /* 0x0A */ Z2SCENE_SANCTUARY_BASEMENT, + /* 0x0B */ Z2SCENE_DEATH_MOUNTAIN, + /* 0x0C */ Z2SCENE_SUMO_HALL, + /* 0x0D */ Z2SCENE_KAKARIKO_GRAVEYARD, + /* 0x0E */ Z2SCENE_HIDDEN_VILLAGE, + /* 0x0F */ Z2SCENE_IMPAZ_HOUSE, + /* 0x10 */ Z2SCENE_LAKE_HYLIA, + /* 0x11 */ Z2SCENE_ZORAS_RIVER, + /* 0x12 */ Z2SCENE_UPPER_ZORAS_RIVER, + /* 0x13 */ Z2SCENE_FISHING_POND, + /* 0x14 */ Z2SCENE_HENA_CABIN, + /* 0x15 */ Z2SCENE_ZORAS_DOMAIN, + /* 0x16 */ Z2SCENE_CASTLE_TOWN, + /* 0x17 */ Z2SCENE_CASTLE_TOWN_INTERIOR, + /* 0x18 */ Z2SCENE_CASTLE_TOWN_SHOPS, + /* 0x19 */ Z2SCENE_STAR_TENT, + /* 0x1A */ Z2SCENE_SNOWPEAK, + /* 0x1B */ Z2SCENE_ARBITERS_GROUNDS_EXTERIOR, + /* 0x1C */ Z2SCENE_GERUDO_DESERT, + /* 0x1D */ Z2SCENE_MIRROR_CHAMBER, + /* 0x1E */ Z2SCENE_HYRULE_FIELD, + /* 0x1F */ Z2SCENE_CASTLE_TOWN_GATES, + /* 0x20 */ Z2SCENE_HYLIA_BRIDGE_BATTLE, + /* 0x21 */ Z2SCENE_SHADES_REALM, + /* 0x22 */ Z2SCENE_ELDIN_BRIDGE_BATTLE, + /* 0x23 */ Z2SCENE_NONE, + /* 0x24 */ Z2SCENE_LIGHT_SPIRIT_CHAMBER, + /* 0x25 */ Z2SCENE_CASTLE_THRONE_ROOM, + /* 0x26 */ Z2SCENE_ENEMY_TEST, + /* 0x27 */ Z2SCENE_FORTRESS, + /* 0x28 */ Z2SCENE_FOREST_TEMPLE, + /* 0x29 */ Z2SCENE_FOREST_TEMPLE_MINIBOSS, + /* 0x2A */ Z2SCENE_FOREST_TEMPLE_BOSS, + /* 0x2B */ Z2SCENE_GORON_MINES, + /* 0x2C */ Z2SCENE_GORON_MINES_MINIBOSS, + /* 0x2D */ Z2SCENE_GORON_MINES_BOSS, + /* 0x2E */ Z2SCENE_LAKEBED_TEMPLE, + /* 0x2F */ Z2SCENE_LAKEBED_TEMPLE_MINIBOSS, + /* 0x30 */ Z2SCENE_LAKEBED_TEMPLE_BOSS, + /* 0x31 */ Z2SCENE_ARBITERS_GROUNDS, + /* 0x32 */ Z2SCENE_ARBITERS_GROUNDS_MINIBOSS, + /* 0x33 */ Z2SCENE_ARBITERS_GROUNDS_BOSS, + /* 0x34 */ Z2SCENE_SNOWPEAK_RUINS, + /* 0x35 */ Z2SCENE_SNOWPEAK_RUINS_MINIBOSS, + /* 0x36 */ Z2SCENE_SNOWPEAK_RUINS_BOSS, + /* 0x37 */ Z2SCENE_TEMPLE_OF_TIME, + /* 0x38 */ Z2SCENE_TEMPLE_OF_TIME_MINIBOSS, + /* 0x39 */ Z2SCENE_TEMPLE_OF_TIME_BOSS, + /* 0x3A */ Z2SCENE_CITY_IN_THE_SKY, + /* 0x3B */ Z2SCENE_CITY_IN_THE_SKY_MINIBOSS, + /* 0x3C */ Z2SCENE_CITY_IN_THE_SKY_BOSS, + /* 0x3D */ Z2SCENE_PALACE_OF_TWILIGHT, + /* 0x3E */ Z2SCENE_PALACE_OF_TWILIGHT_MINIBOSS_A, + /* 0x3F */ Z2SCENE_PALACE_OF_TWILIGHT_MINIBOSS_B, + /* 0x40 */ Z2SCENE_PALACE_OF_TWILIGHT_THRONE_ROOM, + /* 0x41 */ Z2SCENE_PALACE_OF_TWILIGHT_BOSS, + /* 0x42 */ Z2SCENE_HYRULE_CASTLE, + /* 0x43 */ Z2SCENE_FINAL_BATTLE_THRONE_ROOM, + /* 0x44 */ Z2SCENE_FINAL_BATTLE_FIELD, + /* 0x45 */ Z2SCENE_FINAL_BATTLE_CUTSCENE, + /* 0x46 */ Z2SCENE_ICE_BLOCK_PUZZLE, + /* 0x47 */ Z2SCENE_CAVE_OF_ORDEALS, + /* 0x48 */ Z2SCENE_GORGE_LANTERN_CAVE, + /* 0x49 */ Z2SCENE_LAKE_LANTERN_CAVE, + /* 0x4A */ Z2SCENE_ELDIN_MAGNET_CAVE, + /* 0x4B */ Z2SCENE_GROTTO_GRASS_1, + /* 0x4C */ Z2SCENE_GROTTO_GRASS_2, + /* 0x4D */ Z2SCENE_GROTTO_ROCK_1, + /* 0x4E */ Z2SCENE_GROTTO_ROCK_2, + /* 0x4F */ Z2SCENE_GROTTO_POND, + /* 0x50 */ Z2SCENE_FARON_WOODS_CAVE, }; #endif /* Z2SCENEMGR_H */ diff --git a/include/Z2AudioLib/Z2SeMgr.h b/include/Z2AudioLib/Z2SeMgr.h index 4ff8e8f37a..8e07972977 100644 --- a/include/Z2AudioLib/Z2SeMgr.h +++ b/include/Z2AudioLib/Z2SeMgr.h @@ -7,56 +7,50 @@ struct Z2MultiSeMgr { Z2MultiSeMgr(); ~Z2MultiSeMgr(); - s8 registMultiSePos(Vec*); + s8 registMultiSePos(Vec* posPtr); void resetMultiSePos(); f32 getPanPower(); f32 getDolbyPower(); - void setVolumeScale(f32 param_0) { mVolumeScale = param_0; } + void setVolumeScale(f32 volumeScale) { volumeScale_ = volumeScale; } f32 getMaxVolume() { - if (mMaxVolume > 1.0f) { - return 1.0f; - } else if (mMaxVolume < 0.0f) { - return 0.0f; - } else { - return mMaxVolume; - } + return (maxVolume_ > 1.0f) ? 1.0f : (maxVolume_ < 0.0f ? 0.0f : maxVolume_); } f32 getMaxPowR() { - return (mMaxPowR > 1.0f) ? 1.0f : (mMaxPowR < 0.0f ? 0.0f : mMaxPowR); + return (maxPowR_ > 1.0f) ? 1.0f : (maxPowR_ < 0.0f ? 0.0f : maxPowR_); } f32 getMaxPowL() { - return (mMaxPowL > 1.0f) ? 1.0f : (mMaxPowL < 0.0f ? 0.0f : mMaxPowL); + return (maxPowL_ > 1.0f) ? 1.0f : (maxPowL_ < 0.0f ? 0.0f : maxPowL_); } f32 getMaxPowB() { - return (mMaxPowB > 1.0f) ? 1.0f : (mMaxPowB < 0.0f ? 0.0f : mMaxPowB); + return (maxPowB_ > 1.0f) ? 1.0f : (maxPowB_ < 0.0f ? 0.0f : maxPowB_); } f32 getMaxPowF() { - return (mMaxPowF > 1.0f) ? 1.0f : (mMaxPowF < 0.0f ? 0.0f : mMaxPowF); + return (maxPowF_ > 1.0f) ? 1.0f : (maxPowF_ < 0.0f ? 0.0f : maxPowF_); } - s8 getPosCount() { return mPosCount; } + s8 getPosCount() { return posCount_; } - /* 0x00 */ float mVolumeScale; - /* 0x04 */ float mMaxVolume; - /* 0x08 */ float mMaxPowL; - /* 0x0C */ float mMaxPowR; - /* 0x10 */ float mMaxPowF; - /* 0x14 */ float mMaxPowB; - /* 0x18 */ s8 mPosCount; + /* 0x00 */ f32 volumeScale_; + /* 0x04 */ f32 maxVolume_; + /* 0x08 */ f32 maxPowL_; + /* 0x0C */ f32 maxPowR_; + /* 0x10 */ f32 maxPowF_; + /* 0x14 */ f32 maxPowB_; + /* 0x18 */ s8 posCount_; }; // Size = 0x1C struct Z2MultiSeObj : Z2MultiSeMgr { Z2MultiSeObj(); ~Z2MultiSeObj() {} - /* 0x1C */ u32 mSoundID; - /* 0x20 */ s8 field_0x20; + /* 0x1C */ u32 soundID_; + /* 0x20 */ s8 reverb_; }; // Size = 0x24 class Z2SeMgr : public JASGlobalInstance<Z2SeMgr> { @@ -64,23 +58,25 @@ public: /* 802AB64C */ Z2SeMgr(); /* 802AB750 */ void initSe(); /* 802AB80C */ void resetModY(); - /* 802AB830 */ void modHeightAtCamera(Vec const**); + /* 802AB830 */ void modHeightAtCamera(const Vec**); /* 802AB93C */ void incrCrowdSize(); /* 802AB960 */ void decrCrowdSize(); - /* 802AB984 */ bool seStart(JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8); - /* 802AC50C */ bool seStartLevel(JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8); - /* 802AD8B0 */ void seStop(JAISoundID, u32); - /* 802AD94C */ void seStopAll(u32); - /* 802AD9F4 */ void seMoveVolumeAll(f32, u32); + /* 802AB984 */ bool seStart(JAISoundID soundID, const Vec* posPtr, u32, s8 reverb, + f32 pitch, f32 volume, f32 pan, f32 dolby, u8); + /* 802AC50C */ bool seStartLevel(JAISoundID soundID, const Vec* posPtr, u32, s8 reverb, + f32 pitch, f32 volume, f32 pan, f32 dolby, u8); + /* 802AD8B0 */ void seStop(JAISoundID soundID, u32 fadeTime); + /* 802AD94C */ void seStopAll(u32 fadeTime); + /* 802AD9F4 */ void seMoveVolumeAll(f32 volume, u32 moveTime); /* 802ADB14 */ void messageSePlay(u16, Vec*, s8); /* 802ADB50 */ void talkInSe(); /* 802ADC54 */ void talkOutSe(); /* 802ADD58 */ void menuInSe(); - /* 802ADE5C */ void setLevObjSE(u32, Vec*, s8); - /* 802ADFF4 */ void setMultiTriggerSE(u32, Vec*, s8); + /* 802ADE5C */ void setLevObjSE(u32 soundID, Vec* posPtr, s8 reverb); + /* 802ADFF4 */ void setMultiTriggerSE(u32 soundID, Vec* posPtr, s8 reverb); /* 802AE184 */ void processSeFramework(); - /* 802AE524 */ bool isLevelSe(JAISoundID); - /* 802AE5B0 */ bool isSoundCulling(JAISoundID); + /* 802AE524 */ bool isLevelSe(JAISoundID soundID); + /* 802AE5B0 */ bool isSoundCulling(JAISoundID soundID); /* 802B9AC4 */ void resetCrowdSize() { mCrowdSize = 0; } #if PLATFORM_WII || PLATFORM_SHIELD @@ -90,12 +86,19 @@ public: private: /* 0x000 */ JAISoundHandle mSoundHandle[24]; /* 0x060 */ JAISoundHandles mSoundHandles; + #if VERSION == VERSION_SHIELD_DEBUG + /* 0x068 */ JAISoundHandle dbg_field_0x68; + /* 0x06C */ f32 dbg_field_0x6c; + /* 0x070 */ f32 dbg_field_0x70; + /* 0x074 */ f32 dbg_field_0x74; + /* 0x078 */ f32 dbg_field_0x78; + #endif /* 0x068 */ Z2MultiSeObj mLevelObjSe[10]; /* 0x1D0 */ u8 mLevelObjectSeCount; /* 0x1D4 */ Z2MultiSeObj mMultiTriggerSe[10]; /* 0x33C */ u8 mMultiTriggerSeCount; /* 0x340 */ Vec field_0x340[8]; - /* 0x3A0 */ Vec const* mModY[8]; + /* 0x3A0 */ const Vec* mModY[8]; /* 0x3C0 */ u8 field_0x3c0; /* 0x3C1 */ u8 field_0x3c1; /* 0x3C2 */ u8 field_0x3c2; @@ -109,9 +112,6 @@ private: /* 0x3CA */ u8 field_0x3ca; /* 0x3CB */ u8 field_0x3cb; /* 0x3CC */ u8 mCrowdSize; -#if DEBUG - u8 semgr_pad[0x14]; -#endif }; // Size = 0x3D0 inline Z2SeMgr* Z2GetSeMgr() { diff --git a/include/Z2AudioLib/Z2SeqMgr.h b/include/Z2AudioLib/Z2SeqMgr.h index 5edd0f44ec..ede72e55d4 100644 --- a/include/Z2AudioLib/Z2SeqMgr.h +++ b/include/Z2AudioLib/Z2SeqMgr.h @@ -5,89 +5,89 @@ #include "JSystem/JAudio2/JASGadget.h" struct Z2SoundFader { - void move(f32 vol, u32 count) { - if (count != 0) { - mTransition.set(vol, mIntensity, count); + void move(f32 value, u32 moveTime) { + if (moveTime != 0) { + transition_.set(value, intensity_, moveTime); } else { - mIntensity = vol; - mTransition.zero(); + intensity_ = value; + transition_.zero(); } } void forceIn() { - mIntensity = 1.0f; - mTransition.zero(); + intensity_ = 1.0f; + transition_.zero(); } void forceOut() { - mIntensity = 0.0f; - mTransition.zero(); + intensity_ = 0.0f; + transition_.zero(); } - void fadeIn(u32 count) { - if (count != 0) { - mTransition.set(1.0f, mIntensity, count); + void fadeIn(u32 fadeTime) { + if (fadeTime != 0) { + transition_.set(1.0f, intensity_, fadeTime); } else { forceIn(); } } - void fadeOut(u32 count) { - if (count != 0) { - mTransition.set(0.0f, mIntensity, count); + void fadeOut(u32 fadeTime) { + if (fadeTime != 0) { + transition_.set(0.0f, intensity_, fadeTime); } else { forceOut(); } } - void fadeInFromOut(u32 count) { - mIntensity = 0.0f; - fadeIn(count); + void fadeInFromOut(u32 fadeTime) { + intensity_ = 0.0f; + fadeIn(fadeTime); } u32 getCount() { - return mTransition.mCount; + return transition_.remainingSteps_; } - f32 getIntensity() { - return mIntensity; + f32 getIntensity() const { + return intensity_; } f32 getDest() { if (getCount() != 0) { - return mTransition.mDest; + return transition_.targetValue_; } else { - return mIntensity; + return intensity_; } } void calc() { - mIntensity = mTransition.apply(mIntensity); + intensity_ = transition_.apply(intensity_); } f32 get() { return getIntensity(); } - /* 0x0 */ float mIntensity; - /* 0x4 */ JAISoundParamsTransition::TTransition mTransition; + /* 0x0 */ f32 intensity_; + /* 0x4 */ JAISoundParamsTransition::TTransition transition_; }; // Size = 0x10 class Z2SeqMgr : public JASGlobalInstance<Z2SeqMgr> { public: Z2SeqMgr(); - void bgmStart(u32 i_bgmID, u32, s32); - void bgmStop(u32 i_bgmID, s32); - void subBgmStart(u32); + void bgmStart(u32 bgmID, u32 fadeTime, s32); + void bgmStop(u32 fadeTime, s32); + void subBgmStart(u32 bgmID); void subBgmStop(); void subBgmStopInner(); - void bgmStreamPrepare(u32); + void bgmStreamPrepare(u32 bgmID); bool bgmStreamCheckReady(); void bgmStreamPlay(); - void bgmStreamStop(u32); - void changeBgmStatus(s32); - void changeSubBgmStatus(s32); + void bgmStreamStop(u32 fadeTime); + void changeBgmStatus(s32 status); + void changeSubBgmStatus(s32 status); void onVariantBgmJumpEnd(bool); void changeFishingBgm(s32); void talkInBgm(); @@ -96,23 +96,24 @@ public: void menuOutBgm(); void fanfareFramework(); void stopWolfHowlSong(); - void setHeightVolMod(bool, u32); - void setTimeProcVolMod(bool, u32); + void setHeightVolMod(bool isVolMod, u32 fadeTime); + void setTimeProcVolMod(bool isVolMod, u32 fadeTime); void processBgmFramework(); - bool checkBgmIDPlaying(u32); - f32 getChildTrackVolume(JAISoundHandle*, int); - void setChildTrackVolume(JAISoundHandle*, int, float, u32, float, float); + bool checkBgmIDPlaying(u32 bgmID); + f32 getChildTrackVolume(JAISoundHandle* handle, int trackId); + void setChildTrackVolume(JAISoundHandle* handle, int trackId, f32 volume, + u32 moveTime, f32 pan, f32 dolby); void resetBattleBgmParams(); - void setBattleBgmOff(bool); - void setBattleSearched(bool); - void setBattleDistIgnore(bool); - void setBattleGhostMute(bool); - void setBattleDistState(u8); - void setBattleSeqState(u8); - void setBattleLastHit(u8); + void setBattleBgmOff(bool isBgmOff); + void setBattleSearched(bool isBattleSearched); + void setBattleDistIgnore(bool isBattleDistIgnore); + void setBattleGhostMute(bool isBattleGhostMute); + void setBattleDistState(u8 state); + void setBattleSeqState(u8 state); + void setBattleLastHit(u8 lastHit); void battleBgmFramework(); - void startBattleBgm(bool); - void stopBattleBgm(u8, u8); + void startBattleBgm(bool isFadeIn); + void stopBattleBgm(u8 subFadeoutTime, u8 mainFadeinTime); void fieldBgmStart(); void fieldRidingMute(); void onFieldBgmJumpStart(); @@ -120,28 +121,33 @@ public: void fieldBgmFramework(); void mbossBgmMuteProcess(); void bgmSetSwordUsing(s32); - void bgmNowBattle(float); + void bgmNowBattle(f32); void taktModeMute(); void taktModeMuteOff(); + void setFieldBgmPlay(bool value) { mFlags.mFieldBgmPlay = value; } - /* 802B99AC */ void unMuteSceneBgm(u32 count) { + + /* 802B99AC */ void unMuteSceneBgm(u32 fadeTime) { mBgmPause.move(1.0f, 0); - mSceneBgm.move(1.0f, count); + mSceneBgm.move(1.0f, fadeTime); } - /* 802B9A24 */ void muteSceneBgm(u32 count, f32 vol) { mSceneBgm.move(vol, count); } + + /* 802B9A24 */ void muteSceneBgm(u32 fadeTime, f32 vol) { mSceneBgm.move(vol, fadeTime); } + /* 802B9AD0 */ void setTwilightGateVol(f32 vol) { mTwilightGateVol = vol < 0.0f ? 0.0f : vol > 1.0f ? 1.0f : vol; } - /* 802B9AFC */ void setWindStoneVol(f32 vol, u32 count) { mWindStone.move(vol, count); }; + + /* 802B9AFC */ void setWindStoneVol(f32 vol, u32 fadeTime) { mWindStone.move(vol, fadeTime); }; void onEnemyDamage() { setBattleSeqState(2); } - void bgmAllMute(u32 count, f32 val) { - mAllBgmMaster.mTransition.set(val, mAllBgmMaster.mIntensity, count); + void bgmAllMute(u32 fadeTime, f32 val) { + mAllBgmMaster.move(val, fadeTime); } - void bgmAllUnMute(u32 count) { - mAllBgmMaster.move(1.0f, count); + void bgmAllUnMute(u32 fadeTime) { + mAllBgmMaster.move(1.0f, fadeTime); } bool isItemGetDemo() { @@ -149,35 +155,40 @@ public: } u32 getMainBgmID() { + u32 id; if (mMainBgmHandle) { - return mMainBgmHandle->getID(); + id = mMainBgmHandle->getID(); + } else { + id = -1; } - return -1; + return id; } u32 getSubBgmID() { + u32 id; if (mSubBgmHandle) { - return mSubBgmHandle->getID(); + id = mSubBgmHandle->getID(); + } else { + id = -1; } - return -1; + return id; } u32 getStreamBgmID() { + u32 id; if (mStreamBgmHandle) { - return mStreamBgmHandle->getID(); + id = mStreamBgmHandle->getID(); + } else { + id = -1; } - return -1; + return id; } bool checkBgmPlaying() { - bool ret = false; - if (mMainBgmHandle || mStreamBgmHandle) { - ret = true; - } - return ret; + return mMainBgmHandle || mStreamBgmHandle; } u32 checkPlayingSubBgmFlag() { diff --git a/include/Z2AudioLib/Z2SoundHandles.h b/include/Z2AudioLib/Z2SoundHandles.h index 3b97ee2357..2d9d490f5e 100644 --- a/include/Z2AudioLib/Z2SoundHandles.h +++ b/include/Z2AudioLib/Z2SoundHandles.h @@ -14,33 +14,38 @@ public: Z2SoundHandles(); ~Z2SoundHandles(); - void initHandlesPool(u8 pNumHandles); + void initHandlesPool(u8 handleNum); void deleteHandlesPool(); Z2SoundHandlePool* getFreeHandle(); - Z2SoundHandlePool* getLowPrioSound(JAISoundID pSoundId); + Z2SoundHandlePool* getLowPrioSound(JAISoundID soundID); bool isActive() const; - Z2SoundHandlePool* getHandleSoundID(JAISoundID pSoundId); - Z2SoundHandlePool* getHandleUserData(u32 pUserData); + Z2SoundHandlePool* getHandleSoundID(JAISoundID soundID); + Z2SoundHandlePool* getHandleUserData(u32 userData); - void stopAllSounds(u32 fadeout); + void stopAllSounds(u32 fadeTime); - void stopSound(JAISoundID soundID, u32 param_1) { + void stopSound(JAISoundID soundID, u32 fadeTime) { // u32 cast is a fakematch JAISoundHandle* phandle = getHandleSoundID((u32)soundID); if (phandle != NULL) { - (*phandle)->stop(param_1); + (*phandle)->stop(fadeTime); } } void setPos(const JGeometry::TVec3<f32>& pos); int getNumHandles() const { return getNumLinks(); } - Z2SoundHandlePool* getHandle(int index) { return (Z2SoundHandlePool*)getNth(index); } + + Z2SoundHandlePool* getHandle(int index) { + JUT_ASSERT(49, index >= 0); + JUT_ASSERT(50, index < getNumLinks()); + return (Z2SoundHandlePool*)getNth(index); + } private: - /* 0xC */ u8 mNumHandles; + /* 0xC */ u8 handleNum_; }; #endif /* Z2SOUNDHANDLES_H */ diff --git a/include/Z2AudioLib/Z2SoundInfo.h b/include/Z2AudioLib/Z2SoundInfo.h index 668a1164cb..1d65714d8b 100644 --- a/include/Z2AudioLib/Z2SoundInfo.h +++ b/include/Z2AudioLib/Z2SoundInfo.h @@ -4,27 +4,30 @@ #include "JSystem/JAudio2/JAISoundInfo.h" #include "JSystem/JAudio2/JAIStreamDataMgr.h" #include "JSystem/JAudio2/JAUSoundInfo.h" +#include "JSystem/JAudio2/JAUSoundTable.h" class Z2SoundInfo : public JAISoundInfo, public JAUSoundInfo, public JAIStreamDataMgr, public JASGlobalInstance<Z2SoundInfo> { public: Z2SoundInfo() : JAISoundInfo(true), JAUSoundInfo(true), JASGlobalInstance<Z2SoundInfo>(true) {} - /* 802BB448 */ virtual u16 getAudibleSw(JAISoundID) const; - /* 802BB00C */ virtual u16 getBgmSeqResourceID(JAISoundID) const; - /* 802BBA88 */ virtual s32 getStreamFileEntry(JAISoundID); - /* 802BB090 */ virtual int getSoundType(JAISoundID) const; - /* 802BB0D8 */ virtual int getCategory(JAISoundID) const; - /* 802BB0E0 */ virtual u32 getPriority(JAISoundID) const; - /* 802BB6DC */ virtual void getSeInfo(JAISoundID, JAISe*) const; - /* 802BB8B4 */ virtual void getSeqInfo(JAISoundID, JAISeq*) const; - /* 802BB8E0 */ virtual void getStreamInfo(JAISoundID, JAIStream*) const; + /* 802BB448 */ virtual u16 getAudibleSw(JAISoundID soundID) const; + /* 802BB00C */ virtual u16 getBgmSeqResourceID(JAISoundID soundID) const; + /* 802BBA88 */ virtual s32 getStreamFileEntry(JAISoundID soundID); + /* 802BB090 */ virtual int getSoundType(JAISoundID soundID) const; + /* 802BB0D8 */ virtual int getCategory(JAISoundID soundID) const; + /* 802BB0E0 */ virtual u32 getPriority(JAISoundID soundID) const; + /* 802BB6DC */ virtual void getSeInfo(JAISoundID soundID, JAISe* sePtr) const; + /* 802BB8B4 */ virtual void getSeqInfo(JAISoundID soundID, JAISeq* seqPtr) const; + /* 802BB8E0 */ virtual void getStreamInfo(JAISoundID soundID, JAIStream* streamPtr) const; /* 802BBBE0 */ virtual ~Z2SoundInfo() {} - /* 802BB158 */ JAUAudibleParam getAudibleSwFull(JAISoundID); - /* 802BBA10 */ const char* getStreamFilePath(JAISoundID); - /* 802BBAC8 */ int getSwBit(JAISoundID) const; - /* 802BBB48 */ void getSoundInfo_(JAISoundID, JAISound*) const; + /* 802BB158 */ JAUAudibleParam getAudibleSwFull(JAISoundID soundID); + /* 802BBA10 */ const char* getStreamFilePath(JAISoundID soundID); + /* 802BBAC8 */ int getSwBit(JAISoundID soundID) const; + /* 802BBB48 */ void getSoundInfo_(JAISoundID soundID, JAISound* soundPtr) const; - BOOL isValid() const; + BOOL isValid() const { + return JASGlobalInstance<JAUSoundTable>::getInstance() != NULL && JASGlobalInstance<JAUSoundTable>::getInstance()->isValid(); + } }; diff --git a/include/Z2AudioLib/Z2SoundMgr.h b/include/Z2AudioLib/Z2SoundMgr.h index eea9dd8be9..137d2bc8e7 100644 --- a/include/Z2AudioLib/Z2SoundMgr.h +++ b/include/Z2AudioLib/Z2SoundMgr.h @@ -5,39 +5,38 @@ #include "JSystem/JAudio2/JAISeqMgr.h" #include "JSystem/JAudio2/JAIStreamMgr.h" -u16 seqCallback(JASTrack* param_0, u16 param_1); +u16 seqCallback(JASTrack* track, u16 command); class Z2SoundMgr : public JASGlobalInstance<Z2SoundMgr> { public: /* 802A9E80 */ Z2SoundMgr(); /* 802AA1B0 */ void calc(); - /* 802AA270 */ void setIIR(JAISound*, s16 const*); - /* 802AA33C */ void setFilterOff(JAISound*); + /* 802AA270 */ void setIIR(JAISound* sound, const s16* iir); + /* 802AA33C */ void setFilterOff(JAISound* sound); /* 802AA430 */ void resetFilterAll(); /* 802AA528 */ void mixOut(); /* 802AA67C */ void framework(); - /* 802AA6B0 */ void pauseAllGameSound(bool); - /* 802AA7DC */ void stopSoundID(JAISoundID); + /* 802AA6B0 */ void pauseAllGameSound(bool paused); + /* 802AA7DC */ void stopSoundID(JAISoundID soundID); /* 802AA84C */ void stopSync(); /* 802AA8C8 */ void stop(); /* 802AA908 */ void initParams(); - /* 802AA9E8 */ void multiVolumeSoundID(JAISoundID, f32); - /* 802AAAC4 */ bool isPlayingSoundID(JAISoundID); + /* 802AA9E8 */ void multiVolumeSoundID(JAISoundID soundID, f32 volume); + /* 802AAAC4 */ bool isPlayingSoundID(JAISoundID soundID); - /* 802A9EE8 */ virtual bool startSound(JAISoundID, JAISoundHandle*, - JGeometry::TVec3<f32> const*); + /* 802A9EE8 */ virtual bool startSound(JAISoundID soundID, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr); - JAISeMgr* getSeMgr() { return &mSeMgr; } - const JAISeMgr* getSeMgr() const { return &mSeMgr; } - JAISeqMgr* getSeqMgr() { return &mSeqMgr; } - const JAISeqMgr* getSeqMgr() const { return &mSeqMgr; } - JAIStreamMgr* getStreamMgr() { return &mStreamMgr; } + JAISeMgr* getSeMgr() { return &seMgr_; } + const JAISeMgr* getSeMgr() const { return &seMgr_; } + JAISeqMgr* getSeqMgr() { return &seqMgr_; } + const JAISeqMgr* getSeqMgr() const { return &seqMgr_; } + JAIStreamMgr* getStreamMgr() { return &streamMgr_; } private: - /* 0x004 */ JAISeMgr mSeMgr; - /* 0x728 */ JAISeqMgr mSeqMgr; - /* 0x79C */ JAIStreamMgr mStreamMgr; - /* 0x80C */ JAISoundID mSoundID; + /* 0x004 */ JAISeMgr seMgr_; + /* 0x728 */ JAISeqMgr seqMgr_; + /* 0x79C */ JAIStreamMgr streamMgr_; + /* 0x80C */ JAISoundID soundID_; }; // Size: 0x810 #if VERSION != VERSION_SHIELD_DEBUG diff --git a/include/Z2AudioLib/Z2SoundObjMgr.h b/include/Z2AudioLib/Z2SoundObjMgr.h index 0d1ead5e06..c7d5c4cfdf 100644 --- a/include/Z2AudioLib/Z2SoundObjMgr.h +++ b/include/Z2AudioLib/Z2SoundObjMgr.h @@ -3,6 +3,8 @@ #include "JSystem/JAudio2/JASGadget.h" #include "JSystem/JSupport/JSUList.h" +#include "Z2AudioLib/Z2SoundObject.h" +#include "global.h" class Z2CreatureEnemy; @@ -83,32 +85,39 @@ enum Z2EnemyID { class Z2SoundObjMgr : public JASGlobalInstance<Z2SoundObjMgr>, protected JSUList<Z2CreatureEnemy> { public: Z2SoundObjMgr(); - void setForceBattleArea(bool, u16, u16, u16); + void setForceBattleArea(bool forceBattle, u16, u16, u16); void searchEnemy(); - void setGhostEnemyState(u8); - u8 getEnemyID(char const*, JSULink<Z2CreatureEnemy>*); + void setGhostEnemyState(u8 state); + u8 getEnemyID(const char* enemyName, JSULink<Z2CreatureEnemy>* enemyLink); void setBattleInit(); bool checkBattleFinish(); void deleteEnemyAll(); - bool removeEnemy(JSULink<Z2CreatureEnemy>*); + bool removeEnemy(JSULink<Z2CreatureEnemy>* enemyLink); u8 isTwilightBattle(); - u8 getEnemyNumNear() { return mEnemyNumNear; } - u8 getEnemyNumVeryFar() { return mEnemyNumVeryFar; } - bool isForceBattle() { return mForceBattle; } + u8 getEnemyNumNear() const { return enemuNumNear_; } + u8 getEnemyNumVeryFar() { return enemuNumVeryFar_; } + bool isForceBattle() { return forceBattle_; } JSUList<Z2CreatureEnemy>* getEnemyList() { return this; } + #if VERSION == VERSION_SHIELD_DEBUG + JSUList<Z2SoundObjBase>* getAllList() { return &allList_; } + #endif + private: - /* 0x0C */ Z2EnemyArea mEnemyArea; + #if VERSION == VERSION_SHIELD_DEBUG + /* 0x0C */ JSUList<Z2SoundObjBase> allList_; + #endif + /* 0x0C */ Z2EnemyArea enemyArea_; /* 0x14 */ u8 field_0x14; - /* 0x15 */ u8 mEnemyNumNear; + /* 0x15 */ u8 enemuNumNear_; /* 0x16 */ u8 field_0x16; - /* 0x17 */ u8 mEnemyNumVeryFar; + /* 0x17 */ u8 enemuNumVeryFar_; /* 0x18 */ u8 field_0x18; - /* 0x19 */ u8 mGhostEnemyState; + /* 0x19 */ u8 ghostEnemyState_; /* 0x1A */ u8 field_0x1a; - /* 0x1B */ u8 mTwilightBattle; - /* 0x1C */ bool mForceBattle; + /* 0x1B */ u8 twilightBattle_; + /* 0x1C */ bool forceBattle_; }; // Size = 0x20 inline Z2SoundObjMgr* Z2GetSoundObjMgr() { diff --git a/include/Z2AudioLib/Z2SoundObject.h b/include/Z2AudioLib/Z2SoundObject.h index 4bab61402e..9db08cf480 100644 --- a/include/Z2AudioLib/Z2SoundObject.h +++ b/include/Z2AudioLib/Z2SoundObject.h @@ -6,33 +6,33 @@ class Z2SoundStarter; -class Z2SoundObjBase : public Z2SoundHandles { +class Z2SoundObjBase : public Z2SoundHandles +#if VERSION == VERSION_SHIELD_DEBUG +, public JSULink<Z2SoundObjBase> +#endif +{ public: Z2SoundObjBase(); ~Z2SoundObjBase(); void deleteObject(); - Z2SoundHandlePool* startCollisionSE(u32, u32, Z2SoundObjBase*); - - bool isAlive() const { return mIsInitialized; } - void setSoundStarter(Z2SoundStarter* i_soundStarter) { mSoundStarter = i_soundStarter; } + Z2SoundHandlePool* startCollisionSE(u32 hitID, u32 mapinfo, Z2SoundObjBase* other); -#if VERSION == VERSION_SHIELD_DEBUG - /* 0x10 */ u8 unk_0x10[0x20 - 0x10]; -#endif + bool isAlive() { return alive_; } + void setSoundStarter(Z2SoundStarter* soundStarter) { soundStarter_ = soundStarter; } - virtual void framework(u32, s8 reverb); + virtual void framework(u32 mapinfo, s8 reverb); virtual void dispose(); - virtual bool stopOK(Z2SoundHandlePool& pool); - virtual void init(Vec* pSoundPos, u8 pNumHandles); - virtual Z2SoundHandlePool* startSound(JAISoundID, u32, s8); - virtual Z2SoundHandlePool* startLevelSound(JAISoundID, u32, s8); + virtual bool stopOK(Z2SoundHandlePool& handlePool); + virtual void init(Vec* posPtr, u8 handleNum); + virtual Z2SoundHandlePool* startSound(JAISoundID soundID, u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb); - /* 0x14 */ Z2SoundStarter* mSoundStarter; - /* 0x18 */ JGeometry::TVec3<f32>* mSoundPos; + /* 0x14 */ Z2SoundStarter* soundStarter_; + /* 0x18 */ JGeometry::TVec3<f32>* pos_; /* 0x1C */ u16 field_0x1c; - /* 0x1E */ s8 field_0x1e; - /* 0x1F */ bool mIsInitialized; + /* 0x1E */ s8 reverb_; + /* 0x1F */ bool alive_; }; class Z2SoundObjSimple : public Z2SoundObjBase { @@ -40,51 +40,54 @@ public: Z2SoundObjSimple(); ~Z2SoundObjSimple() {} - virtual void init(Vec* pSoundPos, u8 pNumHandles); - virtual Z2SoundHandlePool* startSound(JAISoundID, u32, s8); - virtual Z2SoundHandlePool* startLevelSound(JAISoundID, u32, s8); + virtual void init(Vec* posPtr, u8 handleNum); + virtual Z2SoundHandlePool* startSound(JAISoundID soundID, u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb); }; class Z2SoundObjAnime : public Z2SoundObjBase { public: /* 802BEB94 */ Z2SoundObjAnime(); - /* 802BEBFC */ void initAnime(void*, bool, f32, f32); + /* 802BEBFC */ void initAnime(void* animation, bool, f32 startFrame, f32); /* 802BED68 */ void ageSounds_(); /* 802BEED4 */ void updateAnime(f32, f32); /* 802BF304 */ void updateSoundLifeTime_(f32, f32); - /* 802BF660 */ void startSoundInner(JGeometry::TVec3<f32> const&, f32, Z2SoundStarter*, u32, - s8); - /* 802BF890 */ u32 getSoundID(JAUSoundAnimationSound const*, - JGeometry::TVec3<f32> const&, f32); - /* 802BF898 */ bool playsSound(JAUSoundAnimationSound const*, JGeometry::TVec3<f32> const&, - f32); - - /* 802BEBDC */ virtual void init(Vec*, u8); - - void stopAnime() { mpAnimation = NULL; } - void setLoopStartFrame(f32 i_frame) { - mStartSoundFrame = i_frame; - mStartSoundIndex = mpAnimation->getStartSoundIndex(i_frame); + /* 802BF660 */ void startSoundInner(const JGeometry::TVec3<f32>& pos, f32 param_1, + Z2SoundStarter* soundStarter, u32 mapinfo, s8 reverb); + /* 802BF890 */ u32 getSoundID(const JAUSoundAnimationSound* animationSound, const JGeometry::TVec3<f32>&, f32); + /* 802BF898 */ bool playsSound(const JAUSoundAnimationSound* animationSound, const JGeometry::TVec3<f32>&, f32); + + /* 802BEBDC */ virtual void init(Vec* posPtr, u8 handleNum); + + void stopAnime() { animation_ = NULL; } + + void setLoopStartFrame(f32 frame) { + JUT_ASSERT(119, animation_); + startSoundFrame_ = frame; + startSoundIndex_ = animation_->getStartSoundIndex(frame); } - void setLoopEndFrame(f32 i_frame) { - mEndSoundFrame = i_frame; - mEndSoundIndex = mpAnimation->getEndSoundIndex(i_frame); + + void setLoopEndFrame(f32 frame) { + JUT_ASSERT(125, animation_); + endSoundFrame_ = frame; + endSoundIndex_ = animation_->getEndSoundIndex(frame); } - void setLoopFrame(f32 i_startFrame, f32 i_endFrame) { - setLoopStartFrame(i_startFrame); - setLoopEndFrame(i_endFrame); + + void setLoopFrame(f32 startFrame, f32 endFrame) { + setLoopStartFrame(startFrame); + setLoopEndFrame(endFrame); } - /* 0x20 */ JAUSoundAnimation* mpAnimation; + /* 0x20 */ JAUSoundAnimation* animation_; /* 0x24 */ int field_0x24; - /* 0x28 */ f32 mCurSoundFrame; - /* 0x2C */ f32 mStartSoundFrame; - /* 0x30 */ f32 mEndSoundFrame; - /* 0x34 */ int mStartSoundIndex; - /* 0x38 */ int mEndSoundIndex; + /* 0x28 */ f32 curSoundFrame_; + /* 0x2C */ f32 startSoundFrame_; + /* 0x30 */ f32 endSoundFrame_; + /* 0x34 */ int startSoundIndex_; + /* 0x38 */ int endSoundIndex_; /* 0x3C */ int field_0x3c; - /* 0x40 */ int mCurSoundIndex; - /* 0x44 */ bool mReverse; + /* 0x40 */ int curSoundIndex_; + /* 0x44 */ bool reverse_; }; class Z2DopplerSoundObjBase : public Z2SoundObjBase { @@ -92,10 +95,10 @@ public: Z2DopplerSoundObjBase(); ~Z2DopplerSoundObjBase(); - virtual void framework(u32, s8); - virtual void init(Vec*, u8); - virtual Z2SoundHandlePool* startSound(JAISoundID, u32, s8); - virtual Z2SoundHandlePool* startLevelSound(JAISoundID, u32, s8); + virtual void framework(u32 mapinfo, s8 reverb); + virtual void init(Vec* posPtr, u8 handleNum); + virtual Z2SoundHandlePool* startSound(JAISoundID soundID, u32 mapinfo, s8 reverb); + virtual Z2SoundHandlePool* startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb); /* 0x20 */ JGeometry::TVec3<f32> field_0x20; /* 0x2C */ JGeometry::TVec3<f32> field_0x2c; @@ -104,7 +107,7 @@ public: class Z2SoundObjArrow : public Z2DopplerSoundObjBase { public: /* 802BEB38 */ Z2SoundObjArrow(); - /* 802BEB74 */ virtual void init(Vec*, u8); + /* 802BEB74 */ virtual void init(Vec* posPtr, u8 handleNum); }; #endif /* Z2SOUNDOBJECT_H */ diff --git a/include/Z2AudioLib/Z2SoundStarter.h b/include/Z2AudioLib/Z2SoundStarter.h index ece10c7fd7..38f1e514ee 100644 --- a/include/Z2AudioLib/Z2SoundStarter.h +++ b/include/Z2AudioLib/Z2SoundStarter.h @@ -4,14 +4,15 @@ #include "JSystem/JAudio2/JAISoundStarter.h" struct Z2SoundStarter : public JAISoundStarter, public JASGlobalInstance<Z2SoundStarter> { - Z2SoundStarter(bool); - void setPortData(JAISoundHandle*, u32, u16, s8); - u16 getPortData(JAISoundHandle*, u32, s8); + Z2SoundStarter(bool setInstance); + void setPortData(JAISoundHandle* handlePtr, u32 portNum, u16 data, s8 childIndex); + u16 getPortData(JAISoundHandle* handlePtr, u32 portNum, s8 childIndex); virtual ~Z2SoundStarter() {} - virtual bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*); - virtual bool startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*, u32, float, - float, float, float, float, u32); + virtual bool startSound(JAISoundID soundID, JAISoundHandle* handlePtr, const JGeometry::TVec3<f32>* posPtr); + virtual bool startSound(JAISoundID soundID, JAISoundHandle* handlePtr, + const JGeometry::TVec3<f32>* posPtr, u32 mapinfo, f32 fxMix, + f32 pitch, f32 volume, f32 pan, f32 dolby, u32 moveSteps); }; inline Z2SoundStarter* Z2GetSoundStarter() { diff --git a/include/Z2AudioLib/Z2StatusMgr.h b/include/Z2AudioLib/Z2StatusMgr.h index f3b35f612f..6532801576 100644 --- a/include/Z2AudioLib/Z2StatusMgr.h +++ b/include/Z2AudioLib/Z2StatusMgr.h @@ -2,7 +2,7 @@ #define Z2STATUSMGR_H #include "JSystem/JAudio2/JASGadget.h" -#include "dolphin/mtx.h" +#include <dolphin/mtx.h> struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> { Z2StatusMgr(); @@ -13,13 +13,13 @@ struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> { void menuIn(); void menuOut(); bool isMovieDemo(); - void setDemoName(char*); + void setDemoName(char* demoName); void processTime(); bool checkDayTime(); - void setEventBit(void*); - void setCameraPolygonPos(Vec*); + void setEventBit(void* eventBit); + void setCameraPolygonPos(Vec* polygonPos); void setCameraGroupInfo(u8); - void setCameraInWaterDepth(float); + void setCameraInWaterDepth(f32 depth); u8 getDemoStatus() { return mDemoStatus; } void setHour(s32 hour) { mHour = hour; } @@ -28,7 +28,7 @@ struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> { f32 getCameraInWaterDepth() { return mUnderwaterDepth; } f32 getCameraInWaterDepthRatio() { return mCameraInWaterDepthRatio; } u8 getHour() { return mHour; } - bool isPaused() { return mPauseFlag; } + u8 isPaused() { return mPauseFlag; } bool isHeartGuageOn() { return mHeartGaugeOn; } void getCameraMapInfo(u32 info) { mCameraMapInfo = info; } void setPauseFlag(u8 flag) { mPauseFlag = flag; } diff --git a/include/Z2AudioLib/Z2WolfHowlMgr.h b/include/Z2AudioLib/Z2WolfHowlMgr.h index 3e7a586d04..2b2595d1ea 100644 --- a/include/Z2AudioLib/Z2WolfHowlMgr.h +++ b/include/Z2AudioLib/Z2WolfHowlMgr.h @@ -13,14 +13,33 @@ * The low byte of each u16 line corresponds to length of note */ -struct SongNote { - u8 barType; +struct Z2WolfHowlLine { + u8 type; u8 length; }; +#define HOWL_LINE_HIGH 1 +#define HOWL_LINE_MID 2 +#define HOWL_LINE_LOW 3 + struct Z2WolfHowlData { - u8 mLineNum; - SongNote* mSongData; + u8 lineNum; + Z2WolfHowlLine* lineData; +}; + +enum Z2WolfHowlCurveID { + Z2WOLFHOWL_NONE = -1, + Z2WOLFHOWL_TOBIKUSA, + Z2WOLFHOWL_UMAKUSA, + Z2WOLFHOWL_ZELDASONG, + Z2WOLFHOWL_HEALINGSONG, + Z2WOLFHOWL_SOULREQUIEM, + Z2WOLFHOWL_LIGHTPRELUDE, + Z2WOLFHOWL_NEWSONG1, + Z2WOLFHOWL_NEWSONG2, + Z2WOLFHOWL_NEWSONG3, + + Z2WOLFHOWL_MAX }; class Z2WolfHowlMgr : public JASGlobalInstance<Z2WolfHowlMgr> { @@ -32,32 +51,32 @@ public: f32 getNowPitch(); f32 getNowInputValue(); void calcPitchMod(f32, f32); - s8 startWolfHowlSound(f32, f32, bool, f32); - void setCorrectData(s8, Z2WolfHowlData*); - SongNote getCorrectLine(u8); + s8 startWolfHowlSound(f32, f32 stickValue, bool isHowl, f32); + void setCorrectData(s8 curveID, Z2WolfHowlData* data); + Z2WolfHowlLine getCorrectLine(u8 lineIndex); u8 getCorrectLineNum(); s8 checkLine(); s8 getOnLineNum(); - void startWindStoneSound(s8, Vec*); - int startGuideMelody(bool); + void startWindStoneSound(s8 curveID, Vec* pos); + int startGuideMelody(bool startSound); void skipCorrectDemo(); - void setCorrectCurve(s8 i_curve) { setCorrectData(i_curve, NULL); } + void setCorrectCurve(s8 curveID) { setCorrectData(curveID, NULL); } u32 getTimer() { return mTimer; } u8 getReleaseTimer() { return mReleaseTimer; } u8 getCorrectCurveID() { return mCorrectCurveID; } private: - /* 0x00 */ JAISoundHandle field_0x00; - /* 0x04 */ JAISoundHandle field_0x04; - /* 0x08 */ JAISoundHandle field_0x08; - /* 0x0C */ Z2WolfHowlData* mpCurSong; - /* 0x10 */ Z2WolfHowlData* mpSongList; + /* 0x00 */ JAISoundHandle mWolfHowlHandle; + /* 0x04 */ JAISoundHandle mWindStoneHandle; + /* 0x08 */ JAISoundHandle mGuideHandle; + /* 0x0C */ Z2WolfHowlData* mNowHowlData; + /* 0x10 */ Z2WolfHowlData* mGuideData; /* 0x14 */ f32 mNowInputValue; - /* 0x18 */ f32 field_0x18; + /* 0x18 */ f32 mWolfHowlVolume; /* 0x1C */ f32 field_0x1c; /* 0x20 */ f32 field_0x20; - /* 0x24 */ f32 field_0x24; + /* 0x24 */ f32 mNowPitch; /* 0x28 */ f32 field_0x28; /* 0x2C */ u8 field_0x2c[4]; /* 0x30 */ f32 field_0x30; @@ -69,13 +88,13 @@ private: /* 0x8D */ u8 field_0x8d; /* 0x8E */ s8 mCorrectCurveID; /* 0x8F */ u8 field_0x8f; - /* 0x90 */ s16 field_0x90; + /* 0x90 */ s16 mCorrectScore; /* 0x92 */ u16 field_0x92[20]; - /* 0xBA */ u8 field_0xba; + /* 0xBA */ u8 mNowLineIndex; /* 0xBB */ s8 field_0xbb; - /* 0xBC */ u8 field_0xbc; + /* 0xBC */ u8 mNowLineScore; /* 0xBD */ s8 field_0xbd; - /* 0xBE */ u16 field_0xbe; + /* 0xBE */ u16 mFullScore; }; #endif /* Z2WOLFHOWLMGR_H */ diff --git a/include/d/actor/d_a_alink.h b/include/d/actor/d_a_alink.h index 37c96e69bc..61d5357ae1 100644 --- a/include/d/actor/d_a_alink.h +++ b/include/d/actor/d_a_alink.h @@ -3759,8 +3759,8 @@ public: u8 getCorrectLineNum() { return mZ2WolfHowlMgr.getCorrectLineNum(); } u32 getWolfHowlTimer() { return mZ2WolfHowlMgr.getTimer(); } s8 getOnLineNum() { return mZ2WolfHowlMgr.getOnLineNum(); } - SongNote getCorrectLine(u8 param_0) { return mZ2WolfHowlMgr.getCorrectLine(param_0); } - void startWindStoneSound(s8 id, Vec* pos) { mZ2WolfHowlMgr.startWindStoneSound(id, pos); } + Z2WolfHowlLine getCorrectLine(u8 i_lineIndex) { return mZ2WolfHowlMgr.getCorrectLine(i_lineIndex); } + void startWindStoneSound(s8 i_curveID, Vec* i_pos) { mZ2WolfHowlMgr.startWindStoneSound(i_curveID, i_pos); } J3DModelData* getItemModelData() { return mpItemModelData; } cXyz* getIronBallChainPos() const { return mIronBallChainPos; } diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 04a5fc889a..538f53d117 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1083,6 +1083,7 @@ void dComIfGs_Grass_hide_Set(s8 param_0); void dComIfGs_onGetMagicUseFlag(); void dComIfG_playerStatusD(); void dComIfG_playerStatusD_pre_clear(); +void dComIfGs_staffroll_next_go(); inline void dComIfGs_init() { g_dComIfG_gameInfo.info.init(); |
