summaryrefslogtreecommitdiff
path: root/include/d
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-07-10 23:21:46 +0200
committerrobojumper <robojumper@gmail.com>2025-09-13 11:10:24 +0200
commitba3092ca928e9ab8df2428f9858e5e95d1c7d5b5 (patch)
tree668d618716e140fefa6bc2fe9335b11aea994b2b /include/d
parent84538b4ce0719859926a6ac9a25f84d38bb0b117 (diff)
d_snd_mgr OK
Diffstat (limited to 'include/d')
-rw-r--r--include/d/d_camera.h1
-rw-r--r--include/d/snd/d_snd_bgm_mgr.h16
-rw-r--r--include/d/snd/d_snd_bgm_seq_data_mgr.h2
-rw-r--r--include/d/snd/d_snd_distant_sound_actor_pool.h2
-rw-r--r--include/d/snd/d_snd_fi_vocal_mgr.h22
-rw-r--r--include/d/snd/d_snd_harp_song_mgr.h20
-rw-r--r--include/d/snd/d_snd_mgr.h7
-rw-r--r--include/d/snd/d_snd_player_mgr.h6
-rw-r--r--include/d/snd/d_snd_source_mgr.h1
-rw-r--r--include/d/snd/d_snd_state_mgr.h38
10 files changed, 102 insertions, 13 deletions
diff --git a/include/d/d_camera.h b/include/d/d_camera.h
index 6ad2ef47..5dbb0f61 100644
--- a/include/d/d_camera.h
+++ b/include/d/d_camera.h
@@ -34,6 +34,7 @@ public:
}
bool isUnderwater() const;
+ f32 getUnderwaterDepth() const;
private:
/* 0x068 */ u8 _0x068[0x6C - 0x068];
diff --git a/include/d/snd/d_snd_bgm_mgr.h b/include/d/snd/d_snd_bgm_mgr.h
index 3500283c..a6e8b80f 100644
--- a/include/d/snd/d_snd_bgm_mgr.h
+++ b/include/d/snd/d_snd_bgm_mgr.h
@@ -29,6 +29,8 @@ public:
};
dSndBgmMgr_c();
+ void calc();
+ void setup(EGG::Heap *heap);
void restoreEffects();
@@ -102,6 +104,20 @@ public:
field_0x306 = val;
}
+ void setField_0x307(u8 val) {
+ field_0x307 = val;
+ }
+
+ u8 getField_0x308() const {
+ return field_0x308;
+ }
+
+ void updateField_0x2F4(f32 value) {
+ if (field_0x2F4 > value) {
+ field_0x2F4 = value;
+ }
+ }
+
private:
dSndBgmBattleSound_c *getBgmBattleSound();
diff --git a/include/d/snd/d_snd_bgm_seq_data_mgr.h b/include/d/snd/d_snd_bgm_seq_data_mgr.h
index de8ad699..adc1ead6 100644
--- a/include/d/snd/d_snd_bgm_seq_data_mgr.h
+++ b/include/d/snd/d_snd_bgm_seq_data_mgr.h
@@ -19,7 +19,7 @@ public:
static u32 getDataPrefixLength();
dSndBgmSoundHarpMgr_c *getHarpMgrForSoundId(u32 soundId);
- void initialize();
+ void setup();
void setupState0();
private:
diff --git a/include/d/snd/d_snd_distant_sound_actor_pool.h b/include/d/snd/d_snd_distant_sound_actor_pool.h
index 108dcc7e..4a09d3bc 100644
--- a/include/d/snd/d_snd_distant_sound_actor_pool.h
+++ b/include/d/snd/d_snd_distant_sound_actor_pool.h
@@ -30,7 +30,7 @@ public:
return sParam;
}
- void initialize();
+ void setup();
void calc();
void onChangeStage();
diff --git a/include/d/snd/d_snd_fi_vocal_mgr.h b/include/d/snd/d_snd_fi_vocal_mgr.h
new file mode 100644
index 00000000..a918d990
--- /dev/null
+++ b/include/d/snd/d_snd_fi_vocal_mgr.h
@@ -0,0 +1,22 @@
+#ifndef D_SND_FI_VOCAL_MGR_H
+#define D_SND_FI_VOCAL_MGR_H
+
+#include "d/snd/d_snd_util.h"
+#include "nw4r/snd/snd_SoundHandle.h"
+
+SND_DISPOSER_FORWARD_DECL(dSndFiVocalMgr_c);
+
+class dSndFiVocalMgr_c {
+ SND_DISPOSER_MEMBERS(dSndFiVocalMgr_c)
+
+public:
+ dSndFiVocalMgr_c();
+
+ void fiSpeak(const char *, u16, s32);
+ void executeOutputText(u16, u16);
+
+private:
+ /* 0x10 */ nw4r::snd::SoundHandle mHandle;
+};
+
+#endif
diff --git a/include/d/snd/d_snd_harp_song_mgr.h b/include/d/snd/d_snd_harp_song_mgr.h
new file mode 100644
index 00000000..9b01bfc7
--- /dev/null
+++ b/include/d/snd/d_snd_harp_song_mgr.h
@@ -0,0 +1,20 @@
+#ifndef D_SND_HARP_SONG_MGR_H
+#define D_SND_HARP_SONG_MGR_H
+
+#include "d/snd/d_snd_util.h"
+
+SND_DISPOSER_FORWARD_DECL(dSndHarpSongMgr_c);
+
+class dSndHarpSongMgr_c {
+ SND_DISPOSER_MEMBERS(dSndHarpSongMgr_c)
+
+public:
+ dSndHarpSongMgr_c();
+
+ void setup();
+ void calc();
+
+private:
+};
+
+#endif
diff --git a/include/d/snd/d_snd_mgr.h b/include/d/snd/d_snd_mgr.h
index a8f73022..75673e8e 100644
--- a/include/d/snd/d_snd_mgr.h
+++ b/include/d/snd/d_snd_mgr.h
@@ -4,6 +4,7 @@
#include "common.h"
#include "egg/audio/eggAudioMgr.h"
#include "nw4r/snd/snd_SoundArchivePlayer.h"
+#include "nw4r/snd/snd_global.h"
/** The core audio manager used for most sounds. */
class dSndMgr_c : public EGG::SimpleAudioMgr {
@@ -11,7 +12,7 @@ public:
dSndMgr_c();
virtual void calc() override;
- void initialize(EGG::Heap *heap, u32 size);
+ void setup(EGG::Heap *heap, u32 size);
void initHbm(u32 frame);
static void restoreEffectsCallback();
@@ -46,8 +47,8 @@ public:
private:
static dSndMgr_c *sInstance;
- /* 0x6C8 */ u8 _0x6C8[0x6CC - 0x6C8];
- /* 0x6CC */ u8 field_0x6CC;
+ /* 0x6C8 */ nw4r::snd::OutputMode mOutputMode;
+ /* 0x6CC */ bool mIsInitialized;
};
#endif
diff --git a/include/d/snd/d_snd_player_mgr.h b/include/d/snd/d_snd_player_mgr.h
index 8302edd6..f7b74a4f 100644
--- a/include/d/snd/d_snd_player_mgr.h
+++ b/include/d/snd/d_snd_player_mgr.h
@@ -29,8 +29,10 @@ public:
void setup(s32 channel);
void shutdown(s32 channel);
+ void setup();
void shutdown();
void calc();
+ void calcActive();
void enterMenu();
void leaveMenu();
@@ -100,6 +102,10 @@ public:
MGR_CAUTION = 0x80,
};
+ bool isInit() const {
+ return mState0 > 0;
+ }
+
bool checkFlag(u32 mask) const {
return mFlags & mask;
}
diff --git a/include/d/snd/d_snd_source_mgr.h b/include/d/snd/d_snd_source_mgr.h
index 19f22d85..f3f56952 100644
--- a/include/d/snd/d_snd_source_mgr.h
+++ b/include/d/snd/d_snd_source_mgr.h
@@ -15,6 +15,7 @@ class dSndSourceMgr_c {
public:
dSndSourceMgr_c();
+ void setup();
static dSoundSourceIf_c *createSource(s32 sourceType, dAcBase_c *actor, const char *name, u8 subtype);
diff --git a/include/d/snd/d_snd_state_mgr.h b/include/d/snd/d_snd_state_mgr.h
index 75d279ed..4511ed2c 100644
--- a/include/d/snd/d_snd_state_mgr.h
+++ b/include/d/snd/d_snd_state_mgr.h
@@ -52,7 +52,7 @@ public:
dSndStateMgr_c();
void setup(EGG::Heap *pHeap);
- void onStageOrLayerUpdate();
+ void calc();
void restoreEffects();
static bool isInStage(const char *stageName);
@@ -69,8 +69,8 @@ public:
return field_0x044;
}
- s32 getField_0x058() const {
- return field_0x058;
+ s32 getLayer() const {
+ return mLayer;
}
u32 getFrameCounter() const {
@@ -87,11 +87,23 @@ public:
bool checkFlag0x18(u32 mask);
- bool checkFlag0x258(u32 mask) const {
+ bool checkFlag0x258(u32 mask) {
return field_0x258 & mask;
}
- bool checkFlag0x10(u32 mask) const {
+ void resetFlag0x258() {
+ field_0x258 = 0;
+ }
+
+ void onFlag0x258(u32 mask) {
+ field_0x258 |= mask;
+ }
+
+ void offFlag0x258(u32 mask) {
+ field_0x258 &= ~mask;
+ }
+
+ bool checkFlag0x10(u32 mask) {
return field_0x010 & mask;
}
@@ -122,6 +134,7 @@ public:
return getCurrentStageMusicDemoName() != nullptr;
}
+ void setStbEventName(const char *eventName);
void setEvent(const char *eventName);
// not sure, subtype is unused
bool isActiveDemoMaybe(s32 subtype) const;
@@ -135,8 +148,12 @@ public:
void onMsgWaitStart();
void onMsgWaitEnd();
+ void onLinkDie();
+
f32 getUserParamVolume(u32 userParam);
+ void onStageOrLayerUpdate();
+
// TODO better names
static const char *getStageName(s32 id);
const char *getStageName4(s32 id);
@@ -179,6 +196,11 @@ private:
bool handleStageEvent(const char *name);
void handleDemoEvent(const char *name);
+ void calcRoomId();
+ void setRoomId(s32 roomId);
+ void calcTgSnd();
+ void calcFilters();
+
u32 convertSeLabelToSoundId(const char *label);
u32 convertBgmLabelToSoundId(const char *label);
@@ -229,8 +251,8 @@ private:
/* 0x048 */ u8 _0x048[0x050 - 0x048];
/* 0x050 */ s32 mPreviousStageId;
/* 0x054 */ UNKWORD field_0x054;
- /* 0x058 */ UNKWORD field_0x058;
- /* 0x05C */ s32 mLayer;
+ /* 0x058 */ s32 mLayer;
+ /* 0x05C */ s32 mRoomId;
/* 0x060 */ UNKWORD field_0x060;
/* 0x064 */ u8 field_0x064;
/* 0x065 */ bool field_0x065;
@@ -250,7 +272,7 @@ private:
/* 0x094 */ u32 mEventFlags;
/* 0x098 */ SizedString<64> mEventName;
/* 0x0D8 */ SizedString<64> mPrevEventName;
- /* 0x118 */ const char *field_0x118;
+ /* 0x118 */ const char *mpStbEventName;
/* 0x11C */ u32 mFrameCounter;
/* 0x120 */ u32 mCameraCutFrameCounter;
/* 0x124 */ u32 mMsgFrameCounter;