d_a_alink_swim work / fix JASGlobalInstance (#288)

* daalink / z2linkmgr wip

* first cleanup of JASGlobalInstance data

* fix sInstance stuff part 2

* more d_a_alink_swim work

* remove asm
This commit is contained in:
TakaRikka
2023-02-16 13:09:22 -08:00
committed by GitHub
parent ebc54b9a93
commit af684e72c6
301 changed files with 2061 additions and 3166 deletions
@@ -595,6 +595,7 @@ public:
f32 getRate() const { return mRate; }
f32 getFrame() const { return mFrame; }
s16 getEnd() const { return mEnd; }
s16 getStart() const { return mStart; }
u8 getAttribute() const { return mAttribute; }
u8 getState() const { return mState; }
void setAttribute(u8 attr) { mAttribute = attr; }
+4 -2
View File
@@ -4,8 +4,8 @@
#include "JSystem/JAudio2/JAIAudience.h"
#include "JSystem/JAudio2/JAISeqDataMgr.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/types.h"
struct JASNonCopyable {
/* 0x0 */ int field_0x0;
@@ -48,7 +48,9 @@ public:
/* 0x68 */ int mMaxActiveSe;
}; // Size: 0x6C
class JAISeMgr : public JAISeqDataUser, public JAISoundActivity {
class JAISeMgr : public JAISeqDataUser,
public JAISoundActivity,
public JASGlobalInstance<JAISeMgr> {
public:
/* 802A0074 */ JAISeMgr(bool);
/* 802A0268 */ void setCategoryArrangement(JAISeCategoryArrangement const&);
+2 -2
View File
@@ -4,12 +4,12 @@
#include "JSystem/JAudio2/JAIAudience.h"
#include "JSystem/JAudio2/JAISeqDataMgr.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/types.h"
struct JAISeq;
class JAISeqMgr : public JAISeqDataUser {
class JAISeqMgr : public JAISeqDataUser, public JASGlobalInstance<JAISeqMgr> {
public:
/* 802A1914 */ JAISeqMgr(bool);
/* 802A1A08 */ void freeDeadSeq_();
+1 -12
View File
@@ -29,18 +29,7 @@ public:
} mId;
};
struct JASTrack {
/* 80291444 */ void setChannelMgrCount(u32);
/* 802919F4 */ void assignExtBuffer(u32, JASSoundParams*);
/* 80291C30 */ void openChild(u32);
/* 80292918 */ void writePort(u32, u16);
/* 8029297C */ void readPort(u32);
inline int getChannelMgrCount() { return channelMgrCount; }
/* 0x0 */ u8 field_0x0[0x1d0];
/* 0x1d0 */ int channelMgrCount;
};
class JASTrack;
struct JAISoundStatus_ {
/* 802A2220 */ s32 lockWhenPrepared();
+2 -2
View File
@@ -32,7 +32,7 @@ public:
class JAISoundHandles {
public:
JAISoundHandles(JAISoundHandle* pHandle, int param_1) {
*mSoundHandle = pHandle;
mSoundHandle = pHandle;
numHandles_ = param_1;
};
@@ -40,7 +40,7 @@ public:
JAISoundHandle* getFreeHandle();
private:
JAISoundHandle** mSoundHandle;
JAISoundHandle* mSoundHandle;
int numHandles_;
};
+2 -2
View File
@@ -1,10 +1,10 @@
#ifndef JAISOUNDSTARTER_H
#define JAISOUNDSTARTER_H
#include "dolphin/types.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
struct JAISoundStarter {
struct JAISoundStarter : public JASGlobalInstance<JAISoundStarter> {
/* 802A2F6C */ JAISoundStarter(bool);
/* 802A2FEC */ void startLevelSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
+2 -2
View File
@@ -2,8 +2,8 @@
#define JAISTREAMMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/types.h"
class JAIStreamMgr;
@@ -15,7 +15,7 @@ struct JAIStream {
/* 802A388C */ void JAIStreamMgr_calc_();
};
class JAIStreamMgr {
class JAIStreamMgr : public JASGlobalInstance<JAIStreamMgr> {
public:
/* 802A3B68 */ JAIStreamMgr(bool);
/* 802A3C3C */ void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*);
+2 -2
View File
@@ -1,9 +1,9 @@
#ifndef JASAUDIOTHREAD_H
#define JASAUDIOTHREAD_H
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASGadget.h"
struct JASAudioThread {
struct JASAudioThread : public JASGlobalInstance<JASAudioThread> {
/* 8029CCDC */ JASAudioThread(int, int, u32);
/* 8029CD4C */ void create(s32);
/* 8029CDC0 */ void stop();
+10 -10
View File
@@ -3,21 +3,21 @@
#include "dolphin/types.h"
template <class T>
template<class T>
class JASGlobalInstance {
public:
inline T* getInstance() { return sInstance; }
JASGlobalInstance(T* inst) {
sInstance = inst;
}
inline JASGlobalInstance(bool param) {
if (param) {
ASSERT(sInstance == 0);
//if (this!=NULL) {
sInstance = (T*)this;
//We need a better way to compute the location of sInstance
//sInstance = (T*)((char*)this-(char*)&(((T*)NULL)->JASGlobalInstance<T>));
//}
~JASGlobalInstance() {
if (this == sInstance) {
sInstance = NULL;
}
}
static T* getInstance() { return sInstance; }
static T* sInstance;
};
+10 -1
View File
@@ -1,8 +1,8 @@
#ifndef JASTRACK_H
#define JASTRACK_H
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JAudio2/JASSoundParams.h"
#include "dolphin/types.h"
struct JASDsp {
struct TChannel {
@@ -106,6 +106,15 @@ struct JASTrack {
static u8 const sPitchEnvOsc[24];
static u8 sDefaultBankTable[1036];
static u8 sTrackList[16];
int getChannelMgrCount() { return channelMgrCount; }
/* 0x000 */ u8 field_0x0[0x1d0];
/* 0x1D0 */ int channelMgrCount;
};
struct JASDefaultBankTable : public JASGlobalInstance<JASDefaultBankTable> {
/* 802934B4 */ ~JASDefaultBankTable();
};
#endif /* JASTRACK_H */
+12 -1
View File
@@ -1,6 +1,17 @@
#ifndef JAUSOUNDTABLE_H
#define JAUSOUNDTABLE_H
#include "dolphin/types.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
struct JAUSoundTable : public JASGlobalInstance<JAUSoundTable> {
/* 802A7114 */ void init(void const*);
/* 802A7160 */ void getTypeID(JAISoundID) const;
/* 802A728C */ void getData(JAISoundID) const;
};
struct JAUSoundNameTable : public JASGlobalInstance<JAUSoundNameTable> {
/* 802A73D4 */ void init(void const*);
};
#endif /* JAUSOUNDTABLE_H */