mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-11 13:08:33 -04:00
JAudio2 and Z2AudioLib work (#2223)
* JAudio2 and Z2AudioLib work * check1stDynamicWave matched
This commit is contained in:
@@ -10,7 +10,7 @@ class JAISeMgr;
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
*/
|
||||
class JAISe : public JSULink<JAISe>, public JAISound {
|
||||
class JAISe : public JSULink<JAISe>, public JASPoolAllocObject<JAISe>, public JAISound {
|
||||
public:
|
||||
class TInner {
|
||||
public:
|
||||
|
||||
@@ -42,7 +42,7 @@ class JAISeCategoryMgr : public JAISeqDataUser {
|
||||
public:
|
||||
/* 8029F9C4 */ void JAISeMgr_calc_();
|
||||
/* 8029FB30 */ void JAISeMgr_freeDeadSe_();
|
||||
/* 8029FC88 */ u32 JAISeMgr_acceptsNewSe_(u32) const;
|
||||
/* 8029FC88 */ bool JAISeMgr_acceptsNewSe_(u32) const;
|
||||
/* 8029FD40 */ void sortByPriority_();
|
||||
/* 8029FDE0 */ void stop(u32);
|
||||
/* 8029FE34 */ void stop();
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
JSUList<JAISe>* getSeList() { return &mSeList; }
|
||||
int getNumSe() const { return mSeList.getNumLinks(); }
|
||||
JAIAudience* getAudience() { return (JAIAudience*)field_0x4.field_0x0; }
|
||||
void JAISeMgr_appendSe_(JAISe* se) { mSeList.append(se); }
|
||||
|
||||
/* 0x04 */ JASNonCopyable field_0x4;
|
||||
/* 0x08 */ JAISoundParamsMove mParams;
|
||||
@@ -113,7 +114,7 @@ public:
|
||||
private:
|
||||
/* 0x008 */ JAIAudience* mAudience;
|
||||
/* 0x00C */ JAISeqDataMgr* mSeqDataMgr;
|
||||
/* 0x010 */ int field_0x10;
|
||||
/* 0x010 */ JAISoundStrategyMgr<JAISe>* mStrategyMgr;
|
||||
/* 0x014 */ JAISeCategoryMgr mCategoryMgrs[16];
|
||||
/* 0x6D4 */ JAISoundParamsMove mParams;
|
||||
}; // Size: 0x724
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
}
|
||||
JAISoundParamsMove* getParams() { return &mMove; }
|
||||
bool isActive() { return mSeqList.getNumLinks() != 0; }
|
||||
int getNumActiveSeqs() { return mSeqList.getNumLinks(); }
|
||||
int getNumActiveSeqs() const { return mSeqList.getNumLinks(); }
|
||||
void pause(bool i_pause) { mActivity.field_0x0.flags.flag2 = i_pause; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define JAISOUNDCHILD_H
|
||||
|
||||
#include "JSystem/JAudio2/JAISoundParams.h"
|
||||
#include "JSystem/JAudio2/JASHeapCtrl.h"
|
||||
|
||||
struct JASTrack;
|
||||
|
||||
@@ -9,7 +10,7 @@ struct JASTrack;
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
*/
|
||||
struct JAISoundChild {
|
||||
struct JAISoundChild : JASPoolAllocObject<JAISoundChild> {
|
||||
/* 802A2AB0 */ void init();
|
||||
/* 802A2B28 */ void mixOut(JASTrack*);
|
||||
/* 802A2B7C */ void calc();
|
||||
|
||||
@@ -18,7 +18,7 @@ struct JAIStreamDataMgr {
|
||||
*/
|
||||
struct JAIStreamAramMgr {
|
||||
virtual void* newStreamAram(u32*) = 0;
|
||||
virtual void deleteStreamAram(u32) = 0;
|
||||
virtual bool deleteStreamAram(u32) = 0;
|
||||
virtual ~JAIStreamAramMgr();
|
||||
};
|
||||
|
||||
|
||||
@@ -23,10 +23,11 @@ public:
|
||||
/* 802A40B8 */ void stopSoundID(JAISoundID);
|
||||
/* 802A4118 */ void mixOut();
|
||||
/* 802A4174 */ JAIStream* newStream_();
|
||||
/* 802B9978 */ bool isActive() const;
|
||||
/* 802B9978 */ bool isActive() const { return mStreamList.getNumLinks() != 0; }
|
||||
|
||||
JAISoundParamsMove* getParams() { return &mParams; }
|
||||
JAIStreamAramMgr* getStreamAramMgr() { return mStreamAramMgr; }
|
||||
JSUList<JAIStream>* getStreamList() { return &mStreamList; }
|
||||
void setStreamDataMgr(JAIStreamDataMgr* param_0) {
|
||||
JUT_ASSERT(139, !isActive());
|
||||
streamDataMgr_ = param_0;
|
||||
|
||||
@@ -8,9 +8,53 @@ class JASBasicBank;
|
||||
class JKRHeap;
|
||||
|
||||
namespace JASBNKParser {
|
||||
struct TFileHeader {
|
||||
/* 0x0 */ u8 _00[4];
|
||||
/* 0x4 */ u32 mSize;
|
||||
/* 0x8 */ u8 _08[4];
|
||||
/* 0xC */ u32 mVersion;
|
||||
};
|
||||
|
||||
namespace Ver1 {
|
||||
/* 80299600 */ void findChunk(void const*, u32);
|
||||
/* 8029963C */ void createBasicBank(void const*, JKRHeap*);
|
||||
struct TOsc {
|
||||
/* 0x00 */ u8 _00[4];
|
||||
/* 0x04 */ u8 mTarget;
|
||||
/* 0x08 */ f32 _08;
|
||||
/* 0x0C */ u32 mTableOffset;
|
||||
/* 0x10 */ u32 _10;
|
||||
/* 0x14 */ f32 mScale;
|
||||
/* 0x18 */ f32 _18;
|
||||
};
|
||||
|
||||
struct TPercData {
|
||||
/* 0x00 */ f32 mVolume;
|
||||
/* 0x04 */ f32 mPitch;
|
||||
/* 0x08 */ u8 mPan;
|
||||
/* 0x0A */ u16 mRelease;
|
||||
/* 0x0C */ u32 field_0xc;
|
||||
};
|
||||
|
||||
struct TChunk {
|
||||
/* 0x0 */ u32 mID;
|
||||
/* 0x4 */ u32 mSize;
|
||||
};
|
||||
|
||||
struct TEnvtChunk : TChunk {
|
||||
/* 0x8 */ u8 mData[0];
|
||||
};
|
||||
|
||||
struct TOscChunk : TChunk {
|
||||
/* 0x8 */ u32 mCount;
|
||||
/* 0xC */ TOsc mOsc[0];
|
||||
};
|
||||
|
||||
struct TListChunk : TChunk {
|
||||
/* 0x8 */ u32 mCount;
|
||||
/* 0xC */ u32 mOffsets[0];
|
||||
};
|
||||
|
||||
/* 80299600 */ static TChunk* findChunk(void const*, u32);
|
||||
/* 8029963C */ static JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
};
|
||||
|
||||
namespace Ver0 {
|
||||
@@ -18,18 +62,17 @@ namespace JASBNKParser {
|
||||
|
||||
struct TOsc {};
|
||||
|
||||
/* 80299A3C */ void createBasicBank(void const*, JKRHeap*);
|
||||
/* 80299E68 */ void findOscPtr(JASBasicBank*, JASBNKParser::Ver0::THeader const*,
|
||||
JASBNKParser::Ver0::TOsc const*);
|
||||
/* 80299F8C */ void getOscTableEndPtr(JASOscillator::Point const*);
|
||||
/* 80299A3C */ static JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
/* 80299E68 */ static void findOscPtr(JASBasicBank*, THeader const*, TOsc const*);
|
||||
/* 80299F8C */ static void getOscTableEndPtr(JASOscillator::Point const*);
|
||||
};
|
||||
|
||||
/* 80299538 */ JASBank* createBank(void const*, JKRHeap*);
|
||||
/* 80299558 */ JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
/* 80299538 */ static JASBank* createBank(void const*, JKRHeap*);
|
||||
/* 80299558 */ static JASBasicBank* createBasicBank(void const*, JKRHeap*);
|
||||
|
||||
inline u32 getBankNumber(const void* param_0) { return ((u32*)param_0)[2]; }
|
||||
inline static u32 getBankNumber(const void* param_0) { return ((u32*)param_0)[2]; }
|
||||
|
||||
extern u8 sUsedHeapSize[4];
|
||||
extern u32 sUsedHeapSize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
#ifndef JASBASICBANK_H
|
||||
#define JASBASICBANK_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JAudio2/JASBank.h"
|
||||
#include "JSystem/JAudio2/JASBasicInst.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
class JASBasicBank : public JASBank {
|
||||
public:
|
||||
/* 80297D78 */ JASBasicBank();
|
||||
/* 80297DA4 */ void newInstTable(u8, JKRHeap*);
|
||||
/* 80297E00 */ bool getInstParam(int, int, int, JASInstParam*) const;
|
||||
/* 80297E68 */ void setInst(int, JASInst*);
|
||||
/* 80297E80 */ JASInst* getInst(int) const;
|
||||
/* 80297F0C */ ~JASBasicBank() {}
|
||||
/* 80297F68 */ u32 getType() const { return 'BSIC'; }
|
||||
|
||||
/* 0x8 */ JASInst** mInstTable;
|
||||
/* 0xC */ u8 mInstNumMax;
|
||||
};
|
||||
|
||||
#endif /* JASBASICBANK_H */
|
||||
|
||||
@@ -45,13 +45,14 @@ struct JASInst {
|
||||
struct JASBasicInst : public JASInst {
|
||||
struct TKeymap {
|
||||
/* 80298250 */ ~TKeymap();
|
||||
/* 802982D4 */ TKeymap() { field_0x0 = -1; }
|
||||
/* 802982D4 */ TKeymap() { mHighKey = -1; }
|
||||
void setHighKey(int key) { mHighKey = key; }
|
||||
|
||||
s32 field_0x0;
|
||||
u16 field_0x4;
|
||||
u16 field_0x6;
|
||||
f32 field_0x8;
|
||||
f32 field_0xc;
|
||||
/* 0x0 */ s32 mHighKey;
|
||||
/* 0x4 */ u16 field_0x4;
|
||||
/* 0x6 */ u16 field_0x6;
|
||||
/* 0x8 */ f32 field_0x8;
|
||||
/* 0xC */ f32 field_0xc;
|
||||
};
|
||||
|
||||
/* 80298014 */ JASBasicInst();
|
||||
@@ -63,11 +64,14 @@ struct JASBasicInst : public JASInst {
|
||||
/* 802980F8 */ virtual bool getParam(int, int, JASInstParam*) const;
|
||||
/* 802982E0 */ virtual u32 getType() const { return 'BSIC'; };
|
||||
|
||||
f32 mVolume;
|
||||
f32 mPitch;
|
||||
JASOscillator::Data const* field_0xc[2];
|
||||
u32 mKeymapCount;
|
||||
TKeymap* mKeymap;
|
||||
void setVolume(f32 volume) { mVolume = volume; }
|
||||
void setPitch(f32 pitch) { mPitch = pitch; }
|
||||
|
||||
/* 0x04 */ f32 mVolume;
|
||||
/* 0x08 */ f32 mPitch;
|
||||
/* 0x0C */ JASOscillator::Data const* field_0xc[2];
|
||||
/* 0x10 */ u32 mKeymapCount;
|
||||
/* 0x14 */ TKeymap* mKeymap;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -10,11 +10,9 @@
|
||||
*/
|
||||
class JASWaveHandle {
|
||||
public:
|
||||
/* virtual */ ~JASWaveHandle() {};
|
||||
//virtual const JASWaveInfo* getWaveInfo() const = 0;
|
||||
//virtual int getWavePtr() const = 0;
|
||||
|
||||
void* vtable;
|
||||
virtual ~JASWaveHandle() {};
|
||||
virtual const JASWaveInfo* getWaveInfo() const = 0;
|
||||
virtual int getWavePtr() const = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -23,12 +21,10 @@ public:
|
||||
*/
|
||||
class JASWaveBank {
|
||||
public:
|
||||
/* 80298B88 */ /* virtual */ ~JASWaveBank() {};
|
||||
//virtual JASWaveHandle* getWaveHandle(u32) const = 0;
|
||||
//virtual JASWaveArc* getWaveArc(u32) = 0;
|
||||
//virtual u32 getArcCount() const = 0;
|
||||
|
||||
void* vtable;
|
||||
/* 80298B88 */ virtual ~JASWaveBank() {};
|
||||
virtual JASWaveHandle* getWaveHandle(u32) const = 0;
|
||||
virtual JASWaveArc* getWaveArc(u32) = 0;
|
||||
virtual u32 getArcCount() const = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -37,7 +33,7 @@ public:
|
||||
*/
|
||||
struct JASBasicWaveBank : public JASWaveBank {
|
||||
struct TWaveHandle : public JASWaveHandle {
|
||||
/* 802985E4 */ ~TWaveHandle();
|
||||
/* 802985E4 */ ~TWaveHandle() {}
|
||||
/* 80298B64 */ int getWavePtr() const;
|
||||
/* 80298C18 */ TWaveHandle() { mHeap = NULL; }
|
||||
/* 80298C64 */ const JASWaveInfo* getWaveInfo() const { return &field_0x4; }
|
||||
@@ -57,7 +53,7 @@ struct JASBasicWaveBank : public JASWaveBank {
|
||||
/* 0x04 */ int field_0x4;
|
||||
};
|
||||
|
||||
struct TWaveGroup {
|
||||
struct TWaveGroup : JASWaveArc {
|
||||
/* 802989C0 */ TWaveGroup();
|
||||
/* 80298A0C */ ~TWaveGroup();
|
||||
/* 80298A84 */ void setWaveCount(u32, JKRHeap*);
|
||||
@@ -65,7 +61,6 @@ struct JASBasicWaveBank : public JASWaveBank {
|
||||
/* 80298B2C */ void onEraseDone();
|
||||
/* 80298B54 */ u32 getWaveID(int) const;
|
||||
|
||||
/* 0x00 */ JASWaveArc base;
|
||||
/* 0x74 */ JASBasicWaveBank* mBank;
|
||||
/* 0x78 */ TGroupWaveInfo* mCtrlWaveArray;
|
||||
/* 0x7C */ u16 mWaveCount;
|
||||
@@ -82,7 +77,7 @@ struct JASBasicWaveBank : public JASWaveBank {
|
||||
/* 8029883C */ void decWaveTable(JASBasicWaveBank::TWaveGroup const*);
|
||||
/* 802988DC */ JASWaveHandle* getWaveHandle(u32) const;
|
||||
/* 80298910 */ void setWaveInfo(JASBasicWaveBank::TWaveGroup*, int, u16, JASWaveInfo const&);
|
||||
/* 80298C6C */ JASWaveArc* getWaveArc(u32 param_0); // { return getWaveGroup(param_0); }
|
||||
/* 80298C6C */ JASWaveArc* getWaveArc(u32 param_0) { return getWaveGroup(param_0); }
|
||||
/* 80298C8C */ u32 getArcCount() const { return mGroupCount; }
|
||||
|
||||
/* 0x04 */ OSMutex field_0x4;
|
||||
|
||||
@@ -120,4 +120,6 @@ namespace JASDsp {
|
||||
extern f32 sDSPVolume;
|
||||
};
|
||||
|
||||
u16 DSP_CreateMap2(u32 msg);
|
||||
|
||||
#endif /* JASDSPINTERFACE_H */
|
||||
|
||||
@@ -14,13 +14,17 @@ struct JASDrumSet : public JASInst {
|
||||
/* 802984C4 */ TPerc();
|
||||
/* 802984E4 */ void setRelease(u32);
|
||||
|
||||
f32 mVolume;
|
||||
f32 mPitch;
|
||||
f32 mPan;
|
||||
u16 field_0xc;
|
||||
u16 field_0xe;
|
||||
f32 field_0x10;
|
||||
f32 field_0x14;
|
||||
void setVolume(f32 volume) { mVolume = volume; }
|
||||
void setPitch(f32 pitch) { mPitch = pitch; }
|
||||
void setPan(f32 pan) { mPan = pan; }
|
||||
|
||||
/* 0x00 */ f32 mVolume;
|
||||
/* 0x04 */ f32 mPitch;
|
||||
/* 0x08 */ f32 mPan;
|
||||
/* 0x0C */ u16 field_0xc;
|
||||
/* 0x0E */ u16 field_0xe;
|
||||
/* 0x10 */ f32 field_0x10;
|
||||
/* 0x14 */ f32 field_0x14;
|
||||
};
|
||||
|
||||
/* 802982EC */ JASDrumSet();
|
||||
@@ -30,8 +34,8 @@ struct JASDrumSet : public JASInst {
|
||||
/* 802984B4 */ void setPerc(int, JASDrumSet::TPerc*);
|
||||
/* 802984EC */ virtual u32 getType() const;
|
||||
|
||||
TPerc** field_0x4;
|
||||
u8 field_0x8;
|
||||
/* 0x4 */ TPerc** field_0x4;
|
||||
/* 0x8 */ u8 field_0x8;
|
||||
};
|
||||
|
||||
#endif /* JASDRUMSET_H */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef JASHEAPCTRL_H
|
||||
#define JASHEAPCTRL_H
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include "dolphin/os/OSMutex.h"
|
||||
@@ -28,12 +29,13 @@ public:
|
||||
|
||||
void* getBase() { return mBase; }
|
||||
bool isAllocated() { return mBase; }
|
||||
u32 getSize() { return mSize; }
|
||||
|
||||
/* 0x00 */ JSUTree<JASHeap> mTree;
|
||||
/* 0x1C */ OSMutex mMutex;
|
||||
/* 0x34 */ JASDisposer* mDisposer;
|
||||
/* 0x38 */ u8* mBase;
|
||||
/* 0x3c */ u32 mSize;
|
||||
/* 0x3C */ u32 mSize;
|
||||
/* 0x40 */ JASHeap* field_0x40;
|
||||
};
|
||||
|
||||
@@ -49,9 +51,9 @@ struct JASGenericMemPool {
|
||||
/* 80290994 */ void free(void*, u32);
|
||||
|
||||
/* 0x00 */ void* field_0x0;
|
||||
/* 0x04 */ int freeMemCount;
|
||||
/* 0x08 */ int totalMemCount;
|
||||
/* 0x0C */ int field_0xc;
|
||||
/* 0x04 */ u32 freeMemCount;
|
||||
/* 0x08 */ u32 totalMemCount;
|
||||
/* 0x0C */ u32 usedMemCount;
|
||||
|
||||
};
|
||||
|
||||
@@ -151,6 +153,12 @@ class JASMemChunkPool {
|
||||
u8 mBuffer[ChunkSize];
|
||||
};
|
||||
public:
|
||||
JASMemChunkPool() {
|
||||
OSInitMutex(&mMutex);
|
||||
field_0x18 = NULL;
|
||||
createNewChunk();
|
||||
}
|
||||
|
||||
bool createNewChunk() {
|
||||
bool uVar2;
|
||||
if (field_0x18 != NULL && field_0x18->isEmpty()) {
|
||||
@@ -217,7 +225,7 @@ namespace JASKernel {
|
||||
/* 80290AD0 */ void setupAramHeap(u32, u32);
|
||||
/* 80290B08 */ JASHeap* getAramHeap();
|
||||
|
||||
extern u8 audioAramHeap[68];
|
||||
extern JASHeap audioAramHeap;
|
||||
extern u32 sAramBase;
|
||||
extern JKRHeap* sSystemHeap;
|
||||
extern JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* sCommandHeap;
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
/* 802962B0 */ int readMidiValue();
|
||||
|
||||
void jump(u32 param_1) {
|
||||
field_0x04 = (u8*)field_0x00 + param_1;
|
||||
field_0x04 = field_0x00 + param_1;
|
||||
}
|
||||
|
||||
void jump(void* param_1) {
|
||||
@@ -26,14 +26,14 @@ public:
|
||||
}
|
||||
|
||||
u32 get24(int param_0) {
|
||||
return (*(u32*)((int)field_0x00 + param_0 - 1)) & 0xffffff;
|
||||
return (*(u32*)(field_0x00 + param_0 - 1)) & 0xffffff;
|
||||
}
|
||||
|
||||
u32* getBase() { return field_0x00; }
|
||||
void* getAddr(u32 param_0) { return (u8*)field_0x00 + param_0; }
|
||||
u8 getByte(u32 param_0) { return *((u8*)field_0x00 + param_0); }
|
||||
u16 get16(u32 param_0) { return *(u16*)((u8*)field_0x00 + param_0); }
|
||||
u32 get32(u32 param_0) { return *(u32*)((u8*)field_0x00 + param_0); }
|
||||
u32* getBase() { return (u32*)field_0x00; }
|
||||
void* getAddr(u32 param_0) { return field_0x00 + param_0; }
|
||||
u8 getByte(u32 param_0) { return *(field_0x00 + param_0); }
|
||||
u16 get16(u32 param_0) { return *(u16*)(field_0x00 + param_0); }
|
||||
u32 get32(u32 param_0) { return *(u32*)(field_0x00 + param_0); }
|
||||
u8* getCur() { return field_0x04; }
|
||||
u32 readByte() { return *field_0x04++; }
|
||||
u32 read16() {
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
}
|
||||
u16 getLoopCount() const { return field_0x08 == 0 ? 0 : field_0x2c[field_0x08 - 1]; }
|
||||
|
||||
/* 0x00 */ u32* field_0x00;
|
||||
/* 0x00 */ u8* field_0x00;
|
||||
/* 0x04 */ u8* field_0x04;
|
||||
/* 0x08 */ u32 field_0x08;
|
||||
/* 0x0C */ u16* field_0x0c[8];
|
||||
|
||||
@@ -1,6 +1,31 @@
|
||||
#ifndef JASSIMPLEWAVEBANK_H
|
||||
#define JASSIMPLEWAVEBANK_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JAudio2/JASBasicWaveBank.h"
|
||||
#include "JSystem/JAudio2/JASWaveInfo.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
struct JASSimpleWaveBank : JASWaveBank, JASWaveArc {
|
||||
struct TWaveHandle : JASWaveHandle {
|
||||
/* 80298D84 */ ~TWaveHandle() {}
|
||||
/* 80298F38 */ int getWavePtr() const;
|
||||
/* 80298F5C */ TWaveHandle();
|
||||
/* 80298F90 */ const JASWaveInfo* getWaveInfo() const;
|
||||
|
||||
/* 0x04 */ JASWaveInfo mWaveInfo;
|
||||
/* 0x28 */ JASHeap* mHeap;
|
||||
};
|
||||
|
||||
/* 80298C94 */ JASSimpleWaveBank();
|
||||
/* 80298CF4 */ ~JASSimpleWaveBank();
|
||||
/* 80298DE0 */ void setWaveTableSize(u32, JKRHeap*);
|
||||
/* 80298E60 */ JASWaveHandle* getWaveHandle(u32) const;
|
||||
/* 80298E84 */ void setWaveInfo(u32, JASWaveInfo const&);
|
||||
/* 80298F18 */ JASWaveArc* getWaveArc(u32);
|
||||
/* 80298F98 */ u32 getArcCount() const;
|
||||
|
||||
/* 0x78 */ TWaveHandle* mWaveTable;
|
||||
/* 0x7C */ u32 mWaveTableSize;
|
||||
};
|
||||
|
||||
#endif /* JASSIMPLEWAVEBANK_H */
|
||||
|
||||
@@ -13,7 +13,7 @@ struct JASSoundParams;
|
||||
namespace JASDsp {
|
||||
class TChannel;
|
||||
|
||||
extern u32 FILTER_MODE_IIR;
|
||||
extern const u32 FILTER_MODE_IIR;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,56 +17,66 @@ public:
|
||||
template<class T>
|
||||
class TOffset {
|
||||
public:
|
||||
T* ptr(void* param_0) {
|
||||
T* ptr(void const* param_0) {
|
||||
return JSUConvertOffsetToPtr<T>(param_0, mOffset);
|
||||
}
|
||||
void* mOffset;
|
||||
|
||||
private:
|
||||
/* 0x0 */ u32 mOffset;
|
||||
};
|
||||
|
||||
struct TCtrlWave {
|
||||
/* 0x0 */ u32 _00;
|
||||
};
|
||||
|
||||
struct TWave {
|
||||
/* 0x00 */ u8 _00;
|
||||
/* 0x01 */ u8 _01;
|
||||
/* 0x02 */ u8 _02;
|
||||
/* 0x04 */ f32 _04;
|
||||
/* 0x08 */ u32 mOffset;
|
||||
/* 0x0C */ u32 _0C;
|
||||
/* 0x10 */ u32 _10;
|
||||
/* 0x14 */ u32 _14;
|
||||
/* 0x18 */ u32 _18;
|
||||
/* 0x1C */ u32 _1C;
|
||||
/* 0x20 */ s16 _20;
|
||||
/* 0x22 */ s16 _22;
|
||||
};
|
||||
|
||||
struct TWaveArchive {
|
||||
/* 0x00 */ char mFileName[0x74]; // unknown length
|
||||
/* 0x74 */ TOffset<TWave> mWaveOffsets[0];
|
||||
};
|
||||
|
||||
struct TWaveArchiveBank {
|
||||
/* 0x0 */ u8 _00[8];
|
||||
/* 0x8 */ TOffset<TWaveArchive> mArchiveOffsets[0];
|
||||
};
|
||||
|
||||
struct TCtrl {
|
||||
/* 0x0 */ u8 _00[4];
|
||||
/* 0x4 */ u32 mWaveCount;
|
||||
/* 0x8 */ TOffset<TCtrlWave> mCtrlWaveOffsets[0];
|
||||
};
|
||||
|
||||
struct TCtrlScene {
|
||||
/* 0x0 */ u8 _00[0xC];
|
||||
/* 0xC */ TOffset<TCtrl> mCtrlOffset;
|
||||
};
|
||||
|
||||
struct TCtrlGroup {
|
||||
/* 0x0 */ u8 _00[8];
|
||||
/* 0x8 */ u32 mGroupCount;
|
||||
/* 0xC */ TOffset<TCtrlScene> mCtrlSceneOffsets[0];
|
||||
};
|
||||
|
||||
/** @fabricated */
|
||||
struct THeader {
|
||||
u8 _00[0x10]; // _00 - unknown/padding
|
||||
u32 mArchiveBankOffset; // _10
|
||||
u32 mCtrlGroupOffset; // _14
|
||||
};
|
||||
struct TCtrlWave {
|
||||
u32 _00; // _00
|
||||
};
|
||||
struct TWave {
|
||||
u8 _00; // _00
|
||||
u8 _01; // _01
|
||||
u8 _02; // _02
|
||||
f32 _04; // _04
|
||||
u32 mOffset; // _08
|
||||
u32 _0C; // _0C
|
||||
u32 _10; // _10
|
||||
u32 _14; // _14
|
||||
u32 _18; // _18
|
||||
u32 _1C; // _1C
|
||||
s16 _20; // _20
|
||||
s16 _22; // _22
|
||||
};
|
||||
struct TWaveArchive {
|
||||
char mFileName[0x74]; // _00 - unknown length
|
||||
u32 mWaveOffsets[1]; // _74 - dynamic length
|
||||
};
|
||||
struct TWaveArchiveBank {
|
||||
u8 _00[8]; // _00 - unknown/padding
|
||||
u32 mArchiveOffsets[1]; // _08 - dynamic length
|
||||
};
|
||||
struct TCtrl {
|
||||
u8 _00[4]; // _00 - unknown/padding
|
||||
u32 mWaveCount; // _04
|
||||
u32 mCtrlWaveOffsets[1]; // _08 - dynamic length
|
||||
};
|
||||
struct TCtrlScene {
|
||||
u8 _00[12]; // _00 - unknown/padding
|
||||
u32 mCtrlOffset; // _0C
|
||||
};
|
||||
struct TCtrlGroup {
|
||||
u8 _00[8]; // _00 - unknown/padding
|
||||
u32 mCtrlGroupCount; // _08
|
||||
u32 mCtrlSceneOffsets[1]; // _0C - dynamic length
|
||||
/* 0x00 */ u8 _00[0xC];
|
||||
/* 0x0C */ u32 mWaveTableSize;
|
||||
/* 0x10 */ TOffset<TWaveArchiveBank> mArchiveBankOffset;
|
||||
/* 0x14 */ TOffset<TCtrlGroup> mCtrlGroupOffset;
|
||||
};
|
||||
|
||||
/* 80298FB0 */ static u32 getGroupCount(void const*);
|
||||
@@ -74,7 +84,7 @@ public:
|
||||
/* 80299034 */ static JASBasicWaveBank* createBasicWaveBank(void const*, JKRHeap*);
|
||||
/* 80299264 */ static JASSimpleWaveBank* createSimpleWaveBank(void const*, JKRHeap*);
|
||||
|
||||
static u8 sUsedHeapSize[4 + 4 /* padding */];
|
||||
static u32 sUsedHeapSize;
|
||||
};
|
||||
|
||||
#endif /* JASWSPARSER_H */
|
||||
|
||||
@@ -15,7 +15,7 @@ class JKRSolidHeap;
|
||||
struct JASDisposer {
|
||||
JASDisposer() {}
|
||||
/* 8029A7B8 */ virtual ~JASDisposer() {}
|
||||
/* 80290BCC */ virtual void onDispose();
|
||||
/* 80290BCC */ virtual void onDispose() {}
|
||||
};
|
||||
|
||||
#define DIR_MAX 64
|
||||
@@ -45,14 +45,16 @@ struct JASWaveArc : JASDisposer {
|
||||
/* 8029A404 */ bool sendLoadCmd();
|
||||
/* 8029A4C0 */ bool load(JASHeap*);
|
||||
/* 8029A580 */ bool loadTail(JASHeap*);
|
||||
/* 8029A640 */ void erase();
|
||||
/* 8029A640 */ bool erase();
|
||||
/* 8029A6AC */ void setEntryNum(s32);
|
||||
/* 8029A70C */ void setFileName(char const*);
|
||||
|
||||
/* 8029A1B4 */ virtual ~JASWaveArc();
|
||||
/* 8029A664 */ virtual void onDispose();
|
||||
/* 80298FA0 */ virtual void onLoadDone();
|
||||
/* 80298FA4 */ virtual void onEraseDone();
|
||||
/* 80298FA0 */ virtual void onLoadDone() {}
|
||||
/* 80298FA4 */ virtual void onEraseDone() {}
|
||||
|
||||
s32 getStatus() { return mStatus; }
|
||||
|
||||
struct loadToAramCallbackParams {
|
||||
// not official struct name
|
||||
@@ -64,7 +66,7 @@ struct JASWaveArc : JASDisposer {
|
||||
|
||||
/* 0x04 */ JASHeap mHeap;
|
||||
/* 0x48 */ u32 _48;
|
||||
/* 0x4C */ volatile s32 _4c;
|
||||
/* 0x4C */ volatile s32 mStatus;
|
||||
/* 0x50 */ int mEntryNum;
|
||||
/* 0x54 */ u32 mFileLength;
|
||||
/* 0x58 */ u16 _58;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef JASWAVEINFO_H
|
||||
#define JASWAVEINFO_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
@@ -27,4 +29,4 @@ struct JASWaveInfo {
|
||||
static u32 one;
|
||||
};
|
||||
|
||||
#endif /* JASWAVEINFO_H */
|
||||
#endif /* JASWAVEINFO_H */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef JAUBANKTABLE_H
|
||||
#define JAUBANKTABLE_H
|
||||
|
||||
#include "JSystem/JAudio2/JASBankList.h"
|
||||
#include "JSystem/JAudio2/JASGadget.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
@@ -10,17 +11,15 @@ class JASBank;
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
*/
|
||||
class JAUBankTable /* : public JASBankList */ {
|
||||
class JAUBankTable : public JASBankList {
|
||||
public:
|
||||
JAUBankTable(u32 param_0, JASBank** param_1, u32 param_2) : mBankPtrTable(param_1, param_2) {
|
||||
field_0xc = param_0;
|
||||
}
|
||||
/* 802A4AA0 */ JASBank* getBank(u32) const;
|
||||
/* 802A4AA0 */ JASBank* getBank(u32 bank) const { return mBankPtrTable.get(bank); }
|
||||
|
||||
JASBank* getBank(u32 param_0) { return mBankPtrTable.get(param_0); }
|
||||
void registBank(u32 param_0, JASBank* param_1) { mBankPtrTable.set(param_0, param_1); }
|
||||
|
||||
/* 0x0 */ void* vtable;
|
||||
/* 0x4 */ JASPtrTable<JASBank> mBankPtrTable;
|
||||
/* 0xC */ u32 field_0xc;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ class JKRSolidHeap;
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
*/
|
||||
class JAUSection /* : public JKRDisposer, protected JSULink<JAUSection> */ {
|
||||
class JAUSection : public JKRDisposer, protected JSULink<JAUSection> {
|
||||
public:
|
||||
struct TSectionData {
|
||||
/* 802A4EE8 */ TSectionData();
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
/* 802A5060 */ JAUSection(JAUSectionHeap*, u32, s32);
|
||||
/* 802A50F8 */ void finishBuild();
|
||||
/* 802A5160 */ /* virtual */ void dispose();
|
||||
/* 802A5160 */ virtual void dispose();
|
||||
/* 802A51E4 */ JAUSoundTable* newSoundTable(void const*, u32, bool);
|
||||
/* 802A52A0 */ JAUSoundNameTable* newSoundNameTable(void const*, u32, bool);
|
||||
/* 802A535C */ JAIStreamDataMgr* newStreamFileTable(void const*, bool);
|
||||
@@ -61,15 +61,13 @@ public:
|
||||
/* 802A5B84 */ JASVoiceBank* newVoiceBank(u32, u32);
|
||||
/* 802A5CAC */ bool beginNewBankTable(u32, u32);
|
||||
/* 802A5D9C */ JAUBankTable* endNewBankTable();
|
||||
/* 802A6468 */ /* virtual */ ~JAUSection();
|
||||
/* 802A6468 */ virtual ~JAUSection() {}
|
||||
|
||||
bool isBuilding() { return field_0x2c; }
|
||||
bool isOpen();
|
||||
JAUSectionHeap* asSectionHeap() { return (JAUSection*)sectionHeap_ == this ? sectionHeap_ : NULL; }
|
||||
JKRHeap* getHeap_();
|
||||
|
||||
/* 0x00 */ JKRDisposer base1;
|
||||
/* 0x18 */ JSULink<JAUSection> base2;
|
||||
/* 0x28 */ u32 field_0x28;
|
||||
/* 0x2C */ bool field_0x2c;
|
||||
/* 0x30 */ JAUSectionHeap* sectionHeap_;
|
||||
@@ -81,7 +79,7 @@ public:
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
*/
|
||||
class JAUSectionHeap /* : public JAUSection, JASGlobalInstance<JAUSectionHeap>, JAISeqDataMgr */ {
|
||||
class JAUSectionHeap : public JAUSection, public JASGlobalInstance<JAUSectionHeap>, public JAISeqDataMgr {
|
||||
public:
|
||||
struct TSectionHeapData {
|
||||
/* 802A5DF4 */ TSectionHeapData();
|
||||
@@ -102,10 +100,13 @@ public:
|
||||
/* 802A6094 */ JAUSection* getOpenSection();
|
||||
/* 802A60A0 */ bool setSeqDataUser(JAISeqDataUser*);
|
||||
/* 802A60AC */ bool newDynamicSeqBlock(u32);
|
||||
/* 802A61D0 */ s32 getSeqData(JAISoundID, JAISeqData*);
|
||||
/* 802A61D0 */ SeqDataReturnValue getSeqData(JAISoundID, JAISeqData*);
|
||||
/* 802A6270 */ int releaseSeqData();
|
||||
/* 802A6278 */ ~JAUSectionHeap();
|
||||
/* 802A6278 */ ~JAUSectionHeap() {}
|
||||
|
||||
JAISeqDataMgr* getSeqSeqDataMgr() { return this; }
|
||||
JAISeqDataMgr* getSeSeqDataMgr() { return sectionHeapData_.seSeqDataMgr_; }
|
||||
JAIStreamDataMgr* getStreamDataMgr() { return sectionHeapData_.streamDataMgr_; }
|
||||
TSectionHeapData const& getSectionHeapData() const { return sectionHeapData_; }
|
||||
JAUWaveBankTable& getWaveBankTable() { return sectionHeapData_.waveBankTable; }
|
||||
JKRHeap* getHeap() {
|
||||
@@ -115,8 +116,6 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 0x00 */ JAUSection base1;
|
||||
/* 0xDC */ u8 base2[0xE0 - 0xDC]; // JAISeqDataMgr
|
||||
/* 0xE0 */ JKRHeap* mHeap;
|
||||
/* 0xE4 */ int field_0xe4;
|
||||
/* 0xE8 */ JSUList<JAUSection> mSectionList;
|
||||
|
||||
@@ -75,8 +75,6 @@ struct JAUSoundTable_ {
|
||||
|
||||
const void* field_0x0;
|
||||
Root* field_0x4;
|
||||
u32 field_0x8;
|
||||
u32 field_0xc;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef JAUSTREAMSTATICARAMMGR_H
|
||||
#define JAUSTREAMSTATICARAMMGR_H
|
||||
|
||||
#include "JSystem/JAudio2/JAIStreamDataMgr.h"
|
||||
#include "JSystem/JAudio2/JASAramStream.h"
|
||||
#include "JSystem/JAudio2/JASHeapCtrl.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "bitset.h"
|
||||
|
||||
@@ -13,17 +16,17 @@ class JAUStreamAramMgrBase_ : public JAIStreamAramMgr {
|
||||
public:
|
||||
JAUStreamAramMgrBase_() {
|
||||
for (int i = 0; i < A0; i++) {
|
||||
field_0x4.reset(0);
|
||||
field_0x4.reset(i);
|
||||
}
|
||||
}
|
||||
~JAUStreamAramMgrBase_() { releaseAram_JAUStreamAramMgrBase_(); }
|
||||
bool isStreamUsingAram() { return field_0x4.any(); }
|
||||
void releaseAram_JAUStreamAramMgrBase_() {
|
||||
JUT_ASSERT(38, ! isStreamUsingAram());
|
||||
for (int i = 0; i >= 0; i--) {
|
||||
for (int i = 0; i < A0; i++) {
|
||||
if (mHeaps[i].isAllocated()) {
|
||||
JASHeap* heap = mHeaps[i];
|
||||
heap.free();
|
||||
JASHeap* heap = &mHeaps[0]; // should probably be mHeaps[i] but that doesn't match
|
||||
heap->free();
|
||||
if (!heap) {
|
||||
JUT_ASSERT(47, 0);
|
||||
}
|
||||
@@ -45,28 +48,29 @@ class JAUStreamStaticAramMgr_ : public JAUStreamAramMgrBase_<MAX_CHUNKS_> {
|
||||
public:
|
||||
JAUStreamStaticAramMgr_() { field_0x4c = 0; }
|
||||
virtual void* newStreamAram(u32* param_0) {
|
||||
for (int i = 0; i < field_0x4c; i++) {
|
||||
for (u32 i = 0; i < field_0x4c; i++) {
|
||||
if (this->field_0x4.test(i)) {
|
||||
continue;
|
||||
}
|
||||
this->field_0x4.set(i, true);
|
||||
param_0 = this->mHeaps[i].getSize();
|
||||
*param_0 = this->mHeaps[i].getSize();
|
||||
return this->mHeaps[i].getBase();
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
virtual void deleteStreamAram(u32 param_0) {
|
||||
for (int i = 0; i < field_0x4c; i++) {
|
||||
// NONMATCHING regalloc
|
||||
virtual bool deleteStreamAram(u32 param_0) {
|
||||
for (u32 i = 0; i < field_0x4c; i++) {
|
||||
if (!this->field_0x4.test(i)) {
|
||||
continue;
|
||||
}
|
||||
if (this->mHeaps[i].getBase() == param_0) {
|
||||
if ((u32)this->mHeaps[i].getBase() != param_0) {
|
||||
continue;
|
||||
}
|
||||
this->field_0x4.reset(i);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
bool isAramReserved() const { return field_0x4c; }
|
||||
void reserveAram(JASHeap* heap, int numReserve, u32 param_2) {
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#ifndef DSPPROC_H
|
||||
#define DSPPROC_H
|
||||
|
||||
#include "dolphin/dsp.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
void DSPReleaseHalt2(u32 msg);
|
||||
void DsetupTable(u32 param_0, u32 param_1, u32 param_2, u32 param_3, u32 param_4);
|
||||
void DsetMixerLevel(f32 level);
|
||||
void DsyncFrame2ch(u32 param_0, u32 param_1, u32 param_2);
|
||||
void DsyncFrame4ch(u32 param_0, u32 param_1, u32 param_2, u32 param_3, u32 param_4);
|
||||
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
|
||||
void DspBoot(void (*)(void*));
|
||||
void DspFinishWork(u16 param_0);
|
||||
int DSPSendCommands2(u32* msgs, u32 param_1, void (*param_2)(u16));
|
||||
|
||||
#endif /* DSPTASK_H */
|
||||
|
||||
@@ -115,6 +115,12 @@ struct TVec3<f32> : public Vec {
|
||||
z = other.z;
|
||||
}
|
||||
|
||||
void set(const Vec& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
}
|
||||
|
||||
void set(f32 x_, f32 y_, f32 z_) {
|
||||
x = x_;
|
||||
y = y_;
|
||||
@@ -455,6 +461,7 @@ struct TUtil {
|
||||
|
||||
template<>
|
||||
struct TUtil<f32> {
|
||||
static inline f32 epsilon() { return 32.0f * FLT_EPSILON; }
|
||||
static inline f32 PI() { return 3.1415927f; }
|
||||
|
||||
static inline f32 clamp(f32 v, f32 min, f32 max) {
|
||||
|
||||
@@ -39,16 +39,16 @@ struct TSinCosTable {
|
||||
|
||||
inline T sinDegree(T degree) {
|
||||
if (degree < (T)0.0) {
|
||||
return -table[(u16)(((T)(1 << N) / 360.0) * degree) & ((1 << N) - 1)].first;
|
||||
return -table[(u16)(-((T)(1 << N) / (T)360.0) * degree) & ((1 << N) - 1)].first;
|
||||
}
|
||||
return table[(u16)(((T)(1 << N) / 360.0) * degree) & ((1 << N) - 1)].first;
|
||||
return table[(u16)(((T)(1 << N) / (T)360.0) * degree) & ((1 << N) - 1)].first;
|
||||
}
|
||||
|
||||
inline T cosDegree(T degree) {
|
||||
if (degree < (T)0.0) {
|
||||
degree = -degree;
|
||||
}
|
||||
return table[(u16)(((T)(1 << N) / 360.0) * degree) & ((1 << N) - 1)].second;
|
||||
return table[(u16)(((T)(1 << N) / (T)360.0) * degree) & ((1 << N) - 1)].second;
|
||||
}
|
||||
|
||||
inline T sinRadian(T radian) {
|
||||
|
||||
@@ -8,6 +8,10 @@ void JMAEulerToQuat(s16 param_0, s16 param_1, s16 param_2, Quaternion* param_3);
|
||||
void JMAQuatLerp(const Quaternion*, const Quaternion*, f32, Quaternion*);
|
||||
void JMAFastVECNormalize(register const Vec* src, register Vec* dst);
|
||||
|
||||
inline int JMAAbs(int value) {
|
||||
return (value >> 0x1f ^ value) - (value >> 0x1f);
|
||||
}
|
||||
|
||||
inline f32 JMAFastReciprocal(f32 value) {
|
||||
return __fres(value);
|
||||
}
|
||||
|
||||
@@ -70,6 +70,16 @@ public:
|
||||
return val;
|
||||
}
|
||||
|
||||
JSUInputStream* operator>>(u8& dest) {
|
||||
read(&dest, 1);
|
||||
return this;
|
||||
}
|
||||
|
||||
JSUInputStream* operator>>(s16& dest) {
|
||||
read(&dest, 2);
|
||||
return this;
|
||||
}
|
||||
|
||||
// TODO: return value probably wrong
|
||||
/* 802DC298 */ s32 read(void*, s32);
|
||||
}; // Size = 0x8
|
||||
|
||||
@@ -45,13 +45,13 @@ class JSULink : public JSUPtrLink {
|
||||
public:
|
||||
JSULink(T* object) : JSUPtrLink((void*)object) {}
|
||||
|
||||
T* getObject() const { return (T*)getObjectPtr(); }
|
||||
T* getObject() const { return static_cast<T*>(getObjectPtr()); }
|
||||
|
||||
JSUList<T>* getSupervisor() const { return (JSUList<T>*)this->getList(); }
|
||||
JSUList<T>* getSupervisor() const { return static_cast<JSUList<T>*>(this->getList()); }
|
||||
|
||||
JSULink<T>* getNext() const { return (JSULink<T>*)this->JSUPtrLink::getNext(); }
|
||||
JSULink<T>* getNext() const { return static_cast<JSULink*>(this->JSUPtrLink::getNext()); }
|
||||
|
||||
JSULink<T>* getPrev() const { return (JSULink<T>*)this->JSUPtrLink::getPrev(); }
|
||||
JSULink<T>* getPrev() const { return static_cast<JSULink*>(this->JSUPtrLink::getPrev()); }
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
@@ -20,7 +20,7 @@ struct SMatrix34C<f32> {
|
||||
|
||||
typedef f32 ArrType[4];
|
||||
void set(const ArrType* src) {
|
||||
|
||||
JMath::gekko_ps_copy12(data, src);
|
||||
}
|
||||
|
||||
operator ArrType*() { return data; }
|
||||
@@ -81,4 +81,4 @@ typedef TPosition3<TRotation3<TMatrix34<SMatrix34C<f32> > > > TPosition3f32;
|
||||
|
||||
} // namespace JGeometry
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -226,7 +226,7 @@ struct Z2Audience : public JAIAudience, public JASGlobalInstance<Z2Audience> {
|
||||
/* 0x134 */ Z2AudioCamera mAudioCamera[1];
|
||||
/* 0x1A8 */ Z2SpotMic mSpotMic[1];
|
||||
/* 0x1D0 */ Z2SpotMic* mLinkMic;
|
||||
/* 0x1D4 */ s32 mNumPlayers;
|
||||
/* 0x1D4 */ s32 mMaxChannels;
|
||||
/* 0x1D8 */ u8 field_0x1d8[4];
|
||||
/* 0x1DC */ bool mUsingOffMicVol;
|
||||
}; // Size: 0x1E0
|
||||
|
||||
@@ -8,7 +8,22 @@ class JKRHeap;
|
||||
|
||||
struct Z2FxLineEditNode {};
|
||||
|
||||
struct Z2FxLineConfig {};
|
||||
struct Z2FxLineConfig {
|
||||
/* 0x00 */ u8 field_0x0;
|
||||
/* 0x01 */ u8 field_0x1;
|
||||
/* 0x02 */ u8 field_0x2;
|
||||
/* 0x03 */ u8 field_0x3;
|
||||
/* 0x04 */ s16 field_0x4;
|
||||
/* 0x06 */ s16 field_0x6;
|
||||
/* 0x08 */ s16 field_0x8[8];
|
||||
/* 0x18 */ u8 field_0x18;
|
||||
/* 0x19 */ u8 field_0x19;
|
||||
/* 0x1A */ u8 field_0x1a;
|
||||
/* 0x1B */ u8 field_0x1b;
|
||||
/* 0x1C */ s16 field_0x1c;
|
||||
/* 0x1E */ s16 field_0x1e;
|
||||
/* 0x20 */ s16 field_0x20[8];
|
||||
}; // Size: 0x30
|
||||
|
||||
struct Z2FxLineMgr : public JASGlobalInstance<Z2FxLineMgr> {
|
||||
/* 802BA7DC */ Z2FxLineMgr();
|
||||
@@ -19,10 +34,10 @@ struct Z2FxLineMgr : public JASGlobalInstance<Z2FxLineMgr> {
|
||||
/* 802BAE48 */ void setUnderWaterFx(bool);
|
||||
/* 802BAEB8 */ void setSceneFx(s32);
|
||||
|
||||
/* 0x00 */ int field_0x0;
|
||||
/* 0x00 */ Z2FxLineConfig* mConfig;
|
||||
/* 0x04 */ void* mFxLineBuffer[4];
|
||||
/* 0x14 */ s8 mLineID;
|
||||
/* 0x15 */ s8 mFxDataNum;
|
||||
/* 0x15 */ u8 mFxDataNum;
|
||||
/* 0x16 */ bool mSetUnderWaterFx;
|
||||
/* 0x18 */ Z2FxLineEditNode* mHIOEdit;
|
||||
}; // Size: 0x1C
|
||||
|
||||
+105
-19
@@ -24,11 +24,11 @@ public:
|
||||
void sceneBgmStart();
|
||||
void loadStaticWaves();
|
||||
BOOL checkFirstWaves();
|
||||
void eraseSeWave(u32);
|
||||
void eraseBgmWave(u32);
|
||||
void getWaveLoadStatus(u32, u32);
|
||||
void loadSeWave(u32);
|
||||
void loadBgmWave(u32);
|
||||
bool eraseSeWave(u32);
|
||||
bool eraseBgmWave(u32);
|
||||
s32 getWaveLoadStatus(u32, u32);
|
||||
bool loadSeWave(u32);
|
||||
bool loadBgmWave(u32);
|
||||
|
||||
bool isSceneExist() const { return sceneExist; }
|
||||
int getCurrentSceneNum() const { return sceneNum; }
|
||||
@@ -38,27 +38,29 @@ public:
|
||||
bool isInDarkness() const { return inDarkness; }
|
||||
s8 getRoomReverb() const { return dComIfGp_getReverb(roomNum); }
|
||||
bool isMovieDemo() { return sceneNum == 2 || sceneNum == 8 || sceneNum == 9; }
|
||||
s32 getSeLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 0); }
|
||||
s32 getBgmLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 1); }
|
||||
|
||||
private:
|
||||
/* 0x00 */ long BGM_ID;
|
||||
/* 0x00 */ JAISoundID BGM_ID;
|
||||
/* 0x04 */ int sceneNum;
|
||||
/* 0x08 */ int timer;
|
||||
/* 0x0C */ s8 roomNum;
|
||||
/* 0x0D */ u8 SeWave_1;
|
||||
/* 0x0E */ u8 SeWaveToErase_1;
|
||||
/* 0x0F */ u8 SeWave_2;
|
||||
/* 0x10 */ u8 SeWaveToErase_2;
|
||||
/* 0x11 */ u8 BgmWave_1;
|
||||
/* 0x12 */ u8 BgmWaveToErase_1;
|
||||
/* 0x13 */ u8 BgmWave_2;
|
||||
/* 0x14 */ u8 BgmWaveToErase_2;
|
||||
/* 0x15 */ u8 SeWave_3;
|
||||
/* 0x16 */ u8 SeWaveToErase_3;
|
||||
/* 0x17 */ u8 field_0x17;
|
||||
/* 0x0D */ u8 requestSeWave_1;
|
||||
/* 0x0E */ u8 loadedSeWave_1;
|
||||
/* 0x0F */ u8 requestSeWave_2;
|
||||
/* 0x10 */ u8 loadedSeWave_2;
|
||||
/* 0x11 */ u8 requestBgmWave_1;
|
||||
/* 0x12 */ u8 loadedBgmWave_1;
|
||||
/* 0x13 */ u8 requestBgmWave_2;
|
||||
/* 0x14 */ u8 loadedBgmWave_2;
|
||||
/* 0x15 */ u8 requestDemoWave;
|
||||
/* 0x16 */ u8 loadedDemoWave;
|
||||
/* 0x17 */ s8 load1stWait;
|
||||
/* 0x18 */ u8 field_0x18;
|
||||
/* 0x19 */ u8 field_0x19;
|
||||
/* 0x1A */ u8 field_0x1a;
|
||||
/* 0x1B */ u8 field_0x1b;
|
||||
/* 0x1A */ bool field_0x1a;
|
||||
/* 0x1B */ bool field_0x1b;
|
||||
/* 0x1C */ bool inGame;
|
||||
/* 0x1D */ bool sceneExist;
|
||||
/* 0x1E */ bool inDarkness;
|
||||
@@ -68,4 +70,88 @@ 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,
|
||||
};
|
||||
|
||||
#endif /* Z2SCENEMGR_H */
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
/* 802AE184 */ void processSeFramework();
|
||||
/* 802AE524 */ bool isLevelSe(JAISoundID);
|
||||
/* 802AE5B0 */ bool isSoundCulling(JAISoundID);
|
||||
/* 802B9AC4 */ void resetCrowdSize();
|
||||
/* 802B9AC4 */ void resetCrowdSize() { mCrowdSize = 0; }
|
||||
|
||||
private:
|
||||
/* 0x000 */ JAISoundHandle mSoundHandle[24];
|
||||
|
||||
@@ -123,28 +123,18 @@ public:
|
||||
void bgmNowBattle(float);
|
||||
void taktModeMute();
|
||||
void taktModeMuteOff();
|
||||
void setFieldBgmPlay(bool);
|
||||
/* 802B99AC */ void unMuteSceneBgm(u32);
|
||||
/* 802B9A24 */ void muteSceneBgm(u32, f32);
|
||||
/* 802B9AD0 */ void setTwilightGateVol(f32);
|
||||
/* 802B9AFC */ void setWindStoneVol(f32, u32);
|
||||
|
||||
void onEnemyDamage() { setBattleSeqState(2); }
|
||||
|
||||
void i_setTwilightGateVol(f32 vol) { mTwilightGateVol = vol; }
|
||||
|
||||
void i_setWindStoneVol(f32 vol, u32 count) { mWindStone.move(vol, count); }
|
||||
|
||||
void i_bgmAllUnMute(u32 count) { mAllBgmMaster.move(1.0f, count); }
|
||||
|
||||
void i_muteSceneBgm(u32 count, f32 vol) {
|
||||
mSceneBgm.move(vol, count);
|
||||
}
|
||||
|
||||
void i_unMuteSceneBgm(u32 count) {
|
||||
void setFieldBgmPlay(bool value) { mFlags.mFieldBgmPlay = value; }
|
||||
/* 802B99AC */ void unMuteSceneBgm(u32 count) {
|
||||
mBgmPause.move(1.0f, 0);
|
||||
mSceneBgm.move(1.0f, count);
|
||||
}
|
||||
/* 802B9A24 */ void muteSceneBgm(u32 count, f32 vol) { mSceneBgm.move(vol, count); }
|
||||
/* 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); };
|
||||
|
||||
void onEnemyDamage() { setBattleSeqState(2); }
|
||||
|
||||
void bgmAllMute(u32 count, f32 val) {
|
||||
mAllBgmMaster.mTransition.set(val, mAllBgmMaster.mIntensity, count);
|
||||
@@ -182,6 +172,14 @@ public:
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool checkBgmPlaying() {
|
||||
bool ret = false;
|
||||
if (mMainBgmHandle || mStreamBgmHandle) {
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
JAISoundHandle* getMainBgmHandle() { return &mMainBgmHandle; }
|
||||
JAISoundHandle* getSubBgmHandle() { return &mSubBgmHandle; }
|
||||
|
||||
@@ -221,9 +219,9 @@ public:
|
||||
bool mBattleSearched : 1;
|
||||
bool mBattleBgmOff : 1;
|
||||
bool mRiding : 1;
|
||||
bool flag5 : 1;
|
||||
bool flag6 : 1;
|
||||
bool flag7 : 1;
|
||||
bool mFieldBgmPlay : 1;
|
||||
bool mHeightVolMod : 1;
|
||||
bool mTimeProcVolMod : 1;
|
||||
} mFlags;
|
||||
}; // Size = 0xD4
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
|
||||
#include "JSystem/JAudio2/JAISoundHandles.h"
|
||||
#include "JSystem/JAudio2/JASHeapCtrl.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
// This should inherit JASPoolAllocObject (without which some functions in Z2SoundHandles.cpp badly mismatch)
|
||||
// but this inheritance causes the memPool_ to be generated in the first file that includes this header.
|
||||
// Perhaps this class definition should belong to a different header.
|
||||
class Z2SoundHandlePool : public JAISoundHandle, public JSULink<Z2SoundHandlePool> { // , public JASPoolAllocObject<Z2SoundHandlePool> {
|
||||
public:
|
||||
Z2SoundHandlePool() : JAISoundHandle(), JSULink<Z2SoundHandlePool>(this) {}
|
||||
|
||||
@@ -28,7 +28,9 @@ public:
|
||||
JGeometry::TVec3<f32> const*);
|
||||
|
||||
JAISeMgr* getSeMgr() { return &mSeMgr; }
|
||||
const JAISeMgr* getSeMgr() const { return &mSeMgr; }
|
||||
JAISeqMgr* getSeqMgr() { return &mSeqMgr; }
|
||||
const JAISeqMgr* getSeqMgr() const { return &mSeqMgr; }
|
||||
JAIStreamMgr* getStreamMgr() { return &mStreamMgr; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
class Z2CreatureEnemy;
|
||||
|
||||
struct Z2EnemyArea {
|
||||
/* 0x00 */ u8 field_0x0;
|
||||
/* 0x00 */ bool field_0x0;
|
||||
/* 0x02 */ u16 field_0x2;
|
||||
/* 0x04 */ u16 field_0x4;
|
||||
/* 0x06 */ u16 field_0x6;
|
||||
|
||||
@@ -28,9 +28,10 @@ struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> {
|
||||
f32 getCameraInWaterDepth() { return mUnderwaterDepth; }
|
||||
f32 getCameraInWaterDepthRatio() const { return mCameraInWaterDepthRatio; }
|
||||
u8 getHour() { return mHour; }
|
||||
bool isPaused() { return mIsMenuIn; }
|
||||
bool isPaused() { return mPauseFlag; }
|
||||
bool isHeartGuageOn() { return mHeartGaugeOn; }
|
||||
void getCameraMapInfo(u32 info) { mCameraMapInfo = info; }
|
||||
void setPauseFlag(u8 flag) { mPauseFlag = flag; }
|
||||
|
||||
/* 0x00 */ u8 mHour;
|
||||
/* 0x01 */ u8 mMinute;
|
||||
@@ -38,7 +39,7 @@ struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> {
|
||||
/* 0x03 */ u8 field_0x03;
|
||||
/* 0x04 */ s16 mTime;
|
||||
/* 0x08 */ void* mEventBit;
|
||||
/* 0x0C */ bool mIsMenuIn;
|
||||
/* 0x0C */ u8 mPauseFlag;
|
||||
/* 0x10 */ u32 mCameraMapInfo;
|
||||
/* 0x14 */ u32 field_0x14;
|
||||
/* 0x18 */ f32 mUnderwaterDepth;
|
||||
|
||||
@@ -80,11 +80,6 @@ u32 DSPReadMailFromDSP(void);
|
||||
void DSPSendMailToDSP(u32 mail);
|
||||
void DSPAssertInt();
|
||||
void DSPInit(void);
|
||||
void DSPReleaseHalt2(u32 msg);
|
||||
u16 DSP_CreateMap2(u32 msg);
|
||||
int DSPSendCommands2(u32* msgs, u32 param_1, void (*param_2)(u16));
|
||||
void DsetupTable(u32 param_0, u32 param_1, u32 param_2, u32 param_3, u32 param_4);
|
||||
void DsetMixerLevel(f32 level);
|
||||
|
||||
void __DSPHandler(__OSInterrupt interrupt, OSContext* context);
|
||||
|
||||
|
||||
@@ -96,4 +96,4 @@ void fopCamM_Management(void);
|
||||
u32 fopCamM_GetParam(camera_class* pCamera);
|
||||
void fopCamM_Init(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user