d_snd_bgm_seq_data_mgr, d_snd_bgm_seq_config OK

This commit is contained in:
robojumper
2025-07-08 00:10:45 +02:00
parent 030c5a3952
commit b18a2f00d7
15 changed files with 217 additions and 69 deletions
+30
View File
@@ -0,0 +1,30 @@
#ifndef D_SND_BGM_SEQ_CONFIG_H
#define D_SND_BGM_SEQ_CONFIG_H
#include "common.h"
struct dSndBgmSeqConfig {
/* 0x00 */ u32 soundId;
/* 0x04 */ s32 field_0x04;
/* 0x08 */ s32 field_0x08;
/* 0x0C */ u16 field_0x0C;
/* 0x0E */ u16 field_0x0E;
static const dSndBgmSeqConfig *getConfig(u32 soundId, s32 unkParam);
};
struct dSndBgmBattleConfig_MuteUnmuteMasks {
/* 0x00 */ u16 unmuteMask;
/* 0x02 */ u16 muteMask;
};
struct dSndBgmBattleConfig {
/* 0x00 */ u32 soundId;
/* 0x04 */ dSndBgmBattleConfig_MuteUnmuteMasks mTrackMasks[3];
static bool hasConfig(u32 soundId);
static const dSndBgmBattleConfig *getConfig(u32 soundId);
};
#endif
@@ -1,28 +1,32 @@
#ifndef D_SND_BGM_BATTLE_DATA_MGR_H
#define D_SND_BGM_BATTLE_DATA_MGR_H
#ifndef D_SND_BGM_SEQ_DATA_MGR_H
#define D_SND_BGM_SEQ_DATA_MGR_H
#include "common.h"
#include "d/snd/d_snd_util.h"
#include "d/snd/d_snd_types.h"
#include "d/snd/d_snd_util.h"
SND_DISPOSER_FORWARD_DECL(dSndBgmBattleDataMgr_c);
SND_DISPOSER_FORWARD_DECL(dSndBgmSeqDataMgr_c);
// Previous Ghidra name: SomeUnusedSoundMgr
class dSndBgmBattleDataMgr_c {
class dSndBgmSeqDataMgr_c {
public:
SND_DISPOSER_MEMBERS(dSndBgmBattleDataMgr_c);
SND_DISPOSER_MEMBERS(dSndBgmSeqDataMgr_c);
public:
dSndBgmBattleDataMgr_c();
dSndBgmSeqDataMgr_c();
static const char *getDataPrefix();
static u32 getDataPrefixLength();
dSndBgmSoundHarpMgr_c *getHarpMgrForSoundId(u32 soundId);
void initialize();
void setupState0();
private:
static const s32 NUM_SOUNDS = 2;
/* 0x10 */ dSndBgmSoundHarpMgr_c *mpMgrs;
/* 0x14 */ u8 field_0x14;
/* 0x14 */ bool mInitialized;
};
#endif
-7
View File
@@ -7,13 +7,6 @@
#include "nw4r/snd/snd_SoundStartable.h"
#include "nw4r/ut/ut_list.h"
struct dSndBgmSeqConfig {
/* 0x00 */ u32 soundId;
/* 0x04 */ u8 _0x04[0x0C - 0x04];
/* 0x0C */ u16 field_0x0C;
/* 0x0E */ u16 field_0x0E;
};
class dSndBgmSound_c : public dSndSound_c {
enum BgmSoundFlags_e {
BGM_FLAG_BATTLE = 0x1,
+4
View File
@@ -41,6 +41,10 @@ public:
mPrevIdx = -1;
}
u32 getSoundId() const {
return mSoundId;
}
private:
/* 0x00 */ dSndBgmHarpData_c mHarpData;
/* 0x0C */ dSndBgmDataHarpVarSetBase_c *mpCurrVarSet;
+6 -5
View File
@@ -31,7 +31,8 @@ public:
};
enum EventFlags_e {
EVENT_0x2 = 0x2,
EVENT_IN_EVENT = 0x1,
EVENT_DEMO = 0x2,
EVENT_MUTE_BGM_PARTIAL = 0x8,
EVENT_MUTE_BGM_FULL = 0x10,
EVENT_MUTE_STAGE_EFFECTS_PARTIAL = 0x20,
@@ -92,15 +93,15 @@ public:
}
bool checkEventFlag(u32 mask) const {
return field_0x094 & mask;
return mEventFlags & mask;
}
void onEventFlag(u32 mask) {
field_0x094 |= mask;
mEventFlags |= mask;
}
void offEventFlag(u32 mask) {
field_0x094 &= ~mask;
mEventFlags &= ~mask;
}
void setFlowEvent(u32 eventId);
@@ -197,7 +198,7 @@ private:
/* 0x088 */ UNKWORD field_0x088;
/* 0x08C */ s32 mSoundEventId;
/* 0x090 */ UNKWORD field_0x090;
/* 0x094 */ u32 field_0x094;
/* 0x094 */ u32 mEventFlags;
/* 0x098 */ SizedString<64> field_0x098;
/* 0x0D8 */ SizedString<64> field_0x0D8;
/* 0x118 */ const char *field_0x118;
+1
View File
@@ -23,5 +23,6 @@ class dSndBgmSound_c;
class dSndBgmBattleSound_c;
class dSndBgmSoundHarpMgr_c;
class dSndBgmSeqConfig;
#endif