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 2e3352a3a3
commit 52d84413bb
301 changed files with 2061 additions and 3166 deletions
+10 -2
View File
@@ -2,9 +2,9 @@
#define Z2AUDIENCE_H
#include "JSystem/JAudio2/JAIAudience.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JGeometry.h"
#include "dolphin/mtx/mtxvec.h"
#include "dolphin/types.h"
struct Z2Audible;
@@ -40,6 +40,8 @@ struct Z2SpotMic {
/* 802BCFE4 */ void calcMicPriority(f32);
/* 802BD03C */ void calcMicVolume(f32, int, f32);
void setPosPtr(Vec* i_posPtr) { mPosPtr = i_posPtr; }
/* 0x00 */ f32 field_0x0;
/* 0x04 */ f32 field_0x4;
/* 0x08 */ f32 field_0x8;
@@ -101,7 +103,7 @@ struct Z2AudibleChannel {
/* 802BBE74 */ Z2AudibleChannel();
};
struct Z2Audience : public JAIAudience {
struct Z2Audience : public JAIAudience, public JASGlobalInstance<Z2Audience> {
/* 802BD130 */ Z2Audience();
/* 802BD2DC */ void setAudioCamera(f32 (*)[4], Vec&, Vec&, f32, f32, bool, int, bool);
/* 802BD704 */ void calcOffMicSound(f32);
@@ -126,6 +128,8 @@ struct Z2Audience : public JAIAudience {
/* 802BD5B8 */ virtual u32 calcPriority(JAIAudible*);
/* 802BD71C */ virtual void mixChannelOut(JASSoundParams const&, JAIAudible*, int);
Z2SpotMic* getLinkMic() { return mLinkMic; }
/* 0x004 */ f32 field_0x4;
/* 0x008 */ u8 field_0x8;
/* 0x00C */ Z2Audience3DSetting mSetting;
@@ -137,4 +141,8 @@ struct Z2Audience : public JAIAudience {
/* 0x1DC */ bool mUsingOffMicVol;
}; // Size: 0x1E0
inline Z2Audience* Z2GetAudience() {
return JASGlobalInstance<Z2Audience>::getInstance();
}
#endif /* Z2AUDIENCE_H */
+27 -14
View File
@@ -3,7 +3,6 @@
#include "SSystem/SComponent/c_xyz.h"
#include "Z2AudioLib/Z2SoundObject.h"
#include "dolphin/types.h"
class Z2Creature {
public:
@@ -27,8 +26,9 @@ public:
virtual void startCreatureExtraSoundLevel(JAISoundID, u32, s8);
virtual void startCollisionSE(u32, u32);
private:
/* 0x04 */ int field_0x04;
Vec* getCurrentPos() const { return mpPos; }
/* 0x04 */ Vec* mpPos;
/* 0x08 */ Z2SoundObjAnime mSoundObjAnime;
/* 0x50 */ Z2SoundObjSimple mSoundObjSimple1;
/* 0x70 */ Z2SoundObjSimple mSoundObjSimple2;
@@ -37,12 +37,12 @@ private:
struct Z2LinkSoundStarter : public Z2SoundStarter {
Z2LinkSoundStarter();
virtual ~Z2LinkSoundStarter();
inline virtual ~Z2LinkSoundStarter();
virtual void startSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*, u32, f32,
f32, f32, f32, f32, u32);
};
class Z2CreatureLink : public Z2Creature {
class Z2CreatureLink : public Z2Creature, public Z2LinkSoundStarter {
public:
Z2CreatureLink();
~Z2CreatureLink();
@@ -72,14 +72,13 @@ public:
int startHitItemSE(u32, u32, Z2SoundObjBase*, float);
void setResumeAttack(bool);
void setInWater(bool status) {
mFlags = (u8)((mFlags & ~0x40) | ((status << 6) & 0x40)); // what is going on here
}
void setInWater(bool status) { mInWater = status; }
bool isInWater() { return mInWater; }
static Z2CreatureLink* mLinkPtr;
private:
/* 0x90 */ Z2LinkSoundStarter mLinkSoundStarter;
/* 0x90 Z2LinkSoundStarter */
/* 0x94 */ Z2SoundObjSimple mKantera;
/* 0xB4 */ cXyz field_0xb4;
/* 0xC0 */ u8 mLinkState;
@@ -93,8 +92,22 @@ private:
/* 0xC8 */ u8 mMoveSpeed;
/* 0xC9 */ u8 mMovingTime;
/* 0xCA */ s8 mSinkDepth;
/* 0xCB */ u8 mFlags;
/* 0xCC */ u8 mFlags2;
/* 0xCB */ bool mWolfEyeOpen : 1;
/* 0xCB */ bool mInWater : 1;
/* 0xCB */ bool mResumeAttack : 1;
/* 0xCB */ bool mFlag3 : 1;
/* 0xCB */ bool mFlag4 : 1;
/* 0xCB */ bool mFlag5 : 1;
/* 0xCB */ bool mRiding : 1;
/* 0xCB */ bool mMagnetized : 1;
/* 0xCC */ bool mFlag8 : 1;
/* 0xCC */ bool mUsingIronBall : 1;
/* 0xCC */ bool mFlag10 : 1;
/* 0xCC */ bool mFlag11 : 1;
/* 0xCC */ bool mFlag12 : 1;
/* 0xCC */ bool mFlag13 : 1;
/* 0xCC */ bool mFlag14 : 1;
/* 0xCC */ bool mFlag15 : 1;
}; // Size: 0xD0
inline Z2CreatureLink* Z2GetLink() {
@@ -105,7 +118,7 @@ class Z2CreatureRide;
struct Z2RideSoundStarter : public Z2SoundStarter {
/* 802C5234 */ Z2RideSoundStarter(Z2CreatureRide*);
/* 802C5078 */ virtual ~Z2RideSoundStarter();
/* 802C5078 */ inline virtual ~Z2RideSoundStarter();
/* 802C5284 */ virtual void startSound(JAISoundID, JAISoundHandle*,
JGeometry::TVec3<f32> const*, u32, f32, f32, f32, f32,
f32, u32);
@@ -113,7 +126,7 @@ struct Z2RideSoundStarter : public Z2SoundStarter {
/* 0x4 */ Z2CreatureRide* mRide;
};
class Z2CreatureRide : public Z2Creature {
class Z2CreatureRide : public Z2Creature, public Z2RideSoundStarter {
public:
Z2CreatureRide();
~Z2CreatureRide();
@@ -123,7 +136,7 @@ public:
virtual void deleteObject();
private:
/* 0x90 */ Z2RideSoundStarter mSoundStarter;
/* 0x90 */ // Z2RideSoundStarter mSoundStarter;
/* 0x98 */ bool mLinkRiding;
}; // Size: 0x9C
+2 -2
View File
@@ -1,10 +1,10 @@
#ifndef Z2ENVSEMGR_H
#define Z2ENVSEMGR_H
#include "JSystem/JAudio2/JASGadget.h"
#include "Z2AudioLib/Z2Calc.h"
#include "Z2AudioLib/Z2SeMgr.h"
#include "dolphin/mtx/mtxvec.h"
#include "dolphin/types.h"
struct Z2EnvSeBase {
/* 802C589C */ Z2EnvSeBase(Vec*);
@@ -43,7 +43,7 @@ struct Z2EnvSeDir : public Z2EnvSeBase {
/* 0x10 */ Vec mPanDir;
}; // Size: 0x1C
struct Z2EnvSeMgr {
struct Z2EnvSeMgr : public JASGlobalInstance<Z2EnvSeMgr> {
/* 802C611C */ Z2EnvSeMgr();
/* 802C6540 */ ~Z2EnvSeMgr();
/* 802C66B0 */ void framework();
+6 -2
View File
@@ -3,13 +3,13 @@
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASGadget.h"
struct Z2FxLineEditNode {};
struct Z2FxLineConfig {};
struct Z2FxLineMgr {
struct Z2FxLineMgr : public JASGlobalInstance<Z2FxLineMgr> {
/* 802BA7DC */ Z2FxLineMgr();
/* 802BA7FC */ void initDataArc(JKRArchive*, JKRHeap*);
/* 802BAC28 */ void setLineID(s8, bool, bool);
@@ -26,4 +26,8 @@ struct Z2FxLineMgr {
/* 0x18 */ Z2FxLineEditNode* mHIOEdit;
}; // Size: 0x1C
inline Z2FxLineMgr* Z2GetFxLineMgr() {
return JASGlobalInstance<Z2FxLineMgr>::getInstance();
}
#endif /* Z2FXLINEMGR_H */
+6 -2
View File
@@ -2,9 +2,9 @@
#define Z2SCENEMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASGadget.h"
class Z2SceneMgr {
class Z2SceneMgr : public JASGlobalInstance<Z2SceneMgr> {
public:
Z2SceneMgr();
void setInDarkness(bool);
@@ -55,4 +55,8 @@ private:
/* 0x1E */ bool inDarkness;
}; // Size = 0x20
inline Z2SceneMgr* Z2GetSceneMgr() {
return JASGlobalInstance<Z2SceneMgr>::getInstance();
}
#endif /* Z2SCENEMGR_H */
+6 -2
View File
@@ -2,8 +2,8 @@
#define Z2SEMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "dolphin/mtx/vec.h"
#include "dolphin/types.h"
struct Z2MultiSeMgr {
Z2MultiSeMgr();
@@ -30,7 +30,7 @@ struct Z2MultiSeObj : Z2MultiSeMgr {
/* 0x20 */ u8 field_0x20;
}; // Size = 0x24
class Z2SeMgr {
class Z2SeMgr : public JASGlobalInstance<Z2SeMgr> {
public:
/* 802AB64C */ Z2SeMgr();
/* 802AB750 */ void initSe();
@@ -78,6 +78,10 @@ private:
/* 0x3CC */ u8 mCrowdSize;
}; // Size = 0x3D0
inline Z2SeMgr* Z2GetSeMgr() {
return JASGlobalInstance<Z2SeMgr>::getInstance();
}
// JAISoundID's for sound effects
enum Z2SoundID {
Z2SE_SY_DUMMY = 0x0,
+8 -2
View File
@@ -2,7 +2,7 @@
#define Z2SEQMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASGadget.h"
// move TTransition / Z2SoundFader ?
struct TTransition {
@@ -21,7 +21,7 @@ struct Z2SoundFader {
/* 0x4 */ JAISoundParamsTransition::TTransition mTransition;
}; // Size = 0x10
class Z2SeqMgr {
class Z2SeqMgr : public JASGlobalInstance<Z2SeqMgr> {
public:
Z2SeqMgr();
@@ -77,6 +77,8 @@ public:
/* 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); }
@@ -122,6 +124,10 @@ private:
/* 0xD0 */ u8 mFlags;
}; // Size = 0xD4
inline Z2SeqMgr* Z2GetSeqMgr() {
return JASGlobalInstance<Z2SeqMgr>::getInstance();
}
enum Z2BgmID {
Z2BGM_FIELD_LINK_DAY = 0x1000000,
Z2BGM_FIELD_LINK_NIGHT = 0x1000001,
+9 -10
View File
@@ -1,19 +1,18 @@
#ifndef Z2SOUNDINFO_H
#define Z2SOUNDINFO_H
#include "dolphin/types.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
struct JAISeq {};
struct JAISeq;
struct JAISound {};
struct JAISound;
struct JAIStream {};
struct JAIStream;
struct JAISe {};
struct JAISe;
struct JAISoundID {};
struct JAISoundInfo {
struct JAISoundInfo : public JASGlobalInstance<JAISoundInfo> {
virtual void getSoundType(JAISoundID) const = 0;
virtual void getCategory(JAISoundID) const = 0;
virtual void getPriority(JAISoundID) const = 0;
@@ -23,7 +22,7 @@ struct JAISoundInfo {
virtual ~JAISoundInfo();
};
struct JAUSoundInfo {
struct JAUSoundInfo : public JASGlobalInstance<JAUSoundInfo> {
virtual void getAudibleSw(JAISoundID) const = 0;
virtual void getBgmSeqResourceID(JAISoundID) const = 0;
};
@@ -33,7 +32,7 @@ struct JAIStreamDataMgr {
virtual ~JAIStreamDataMgr();
};
struct Z2SoundInfo /* : public JAISoundInfo, public JAUSoundInfo, public JAIStreamDataMgr */ {
struct Z2SoundInfo /* : public JAISoundInfo, public JAUSoundInfo, public JAIStreamDataMgr */ : public JASGlobalInstance<Z2SoundInfo> {
/* 802BB00C */ void getBgmSeqResourceID(JAISoundID) const;
/* 802BB158 */ void getAudibleSwFull(JAISoundID);
/* 802BB448 */ void getAudibleSw(JAISoundID) const;
+3 -5
View File
@@ -5,9 +5,9 @@
#include "JSystem/JAudio2/JAISeqMgr.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JAIStreamMgr.h"
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASGadget.h"
class Z2SoundMgr {
class Z2SoundMgr : public JASGlobalInstance<Z2SoundMgr> {
public:
/* 802A9E80 */ Z2SoundMgr();
/* 802AA1B0 */ void calc();
@@ -39,10 +39,8 @@ private:
STATIC_ASSERT(sizeof(Z2SoundMgr) == 0x810);
extern Z2SoundMgr* data_80450B60;
inline Z2SoundMgr* Z2GetSoundMgr() {
return data_80450B60;
return JASGlobalInstance<Z2SoundMgr>::getInstance();
}
#endif /* Z2SOUNDMGR_H */
+6 -2
View File
@@ -1,11 +1,11 @@
#ifndef Z2SOUNDOBJMGR_H
#define Z2SOUNDOBJMGR_H
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JSupport/JSUList.h"
#include "Z2AudioLib/Z2Creature.h"
#include "dolphin/types.h"
class Z2SoundObjMgr : protected JSUList<Z2CreatureEnemy> {
class Z2SoundObjMgr : protected JSUList<Z2CreatureEnemy>, public JASGlobalInstance<Z2SoundObjMgr> {
public:
Z2SoundObjMgr();
void setForceBattleArea(bool, u16, u16, u16);
@@ -36,4 +36,8 @@ private:
/* 0x1C */ bool mForceBattle;
}; // Size = 0x20
inline Z2SoundObjMgr* Z2GetSoundObjMgr() {
return JASGlobalInstance<Z2SoundObjMgr>::getInstance();
}
#endif /* Z2SOUNDOBJMGR_H */
+1
View File
@@ -17,6 +17,7 @@ public:
void startCollisionSE(u32, u32, Z2SoundObjBase*);
bool isAlive() const { return mIsInitialized; }
void setSoundStarter(Z2SoundStarter* i_soundStarter) { mSoundStarter = i_soundStarter; }
virtual void framework(u32, s8);
virtual void dispose();
+2 -2
View File
@@ -3,9 +3,9 @@
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JAISoundStarter.h"
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASGadget.h"
struct Z2SoundStarter : public JAISoundStarter {
struct Z2SoundStarter : public JAISoundStarter, public JASGlobalInstance<Z2SoundStarter> {
Z2SoundStarter(bool);
void setPortData(JAISoundHandle*, u32, u16, s8);
void getPortData(JAISoundHandle*, u32, s8);
+2 -2
View File
@@ -2,10 +2,10 @@
#define Z2SPEECHMGR2_H
#include "JSystem/JAudio2/JAISoundHandles.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JMath/random.h"
#include "Z2AudioLib/Z2SoundStarter.h"
#include "dolphin/mtx/vec.h"
#include "dolphin/types.h"
struct Z2SpeechStarter : public Z2SoundStarter {
/* 802CCFB8 */ Z2SpeechStarter();
@@ -16,7 +16,7 @@ struct Z2SpeechStarter : public Z2SoundStarter {
f32, u32);
};
struct Z2SpeechMgr2 {
struct Z2SpeechMgr2 : public JASGlobalInstance<Z2SpeechMgr2> {
/* 802CBC60 */ Z2SpeechMgr2();
/* 802CBD88 */ void setString(u16 const*, s16, u8, u16);
/* 802CBF60 */ void setTextCount(s16);
+8 -4
View File
@@ -2,9 +2,9 @@
#define Z2STATUSMGR_H
#include "dolphin/mtx/vec.h"
#include "dolphin/types.h"
#include "JSystem/JAudio2/JASGadget.h"
struct Z2StatusMgr {
struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> {
Z2StatusMgr();
void heartGaugeOn();
void processHeartGaugeSound();
@@ -34,11 +34,15 @@ struct Z2StatusMgr {
/* 0x0C */ bool mIsMenuIn;
/* 0x10 */ u32 mCameraMapInfo;
/* 0x14 */ u32 field_0x14;
/* 0x18 */ float mUnderwaterDepth;
/* 0x1C */ float mCameraInWaterDepthRatio;
/* 0x18 */ f32 mUnderwaterDepth;
/* 0x1C */ f32 mCameraInWaterDepthRatio;
/* 0x20 */ Vec mPolygonPosition;
/* 0x2C */ u8 mDemoStatus;
/* 0x2D */ u8 mHeartGaugeOn;
}; // Size = 0x30
inline Z2StatusMgr* Z2GetStatusMgr() {
return JASGlobalInstance<Z2StatusMgr>::getInstance();
}
#endif /* Z2STATUSMGR_H */
+2 -3
View File
@@ -1,9 +1,9 @@
#ifndef Z2WOLFHOWLMGR_H
#define Z2WOLFHOWLMGR_H
#include "dolphin/types.h"
#include "Z2AudioLib/Z2SoundObject.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "Z2AudioLib/Z2SoundObject.h"
#include "dolphin/types.h"
/*
* Z2WolfHowlData
@@ -37,7 +37,6 @@ public:
void startGuideMelody(bool);
void skipCorrectDemo();
private:
/* 0x00 */ JAISoundHandle field_0x00;
/* 0x04 */ JAISoundHandle field_0x04;