d_snd_mgr OK

This commit is contained in:
robojumper
2025-07-10 23:21:46 +02:00
parent 84538b4ce0
commit ba3092ca92
25 changed files with 347 additions and 116 deletions
+1
View File
@@ -34,6 +34,7 @@ public:
}
bool isUnderwater() const;
f32 getUnderwaterDepth() const;
private:
/* 0x068 */ u8 _0x068[0x6C - 0x068];
+16
View File
@@ -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();
+1 -1
View File
@@ -19,7 +19,7 @@ public:
static u32 getDataPrefixLength();
dSndBgmSoundHarpMgr_c *getHarpMgrForSoundId(u32 soundId);
void initialize();
void setup();
void setupState0();
private:
@@ -30,7 +30,7 @@ public:
return sParam;
}
void initialize();
void setup();
void calc();
void onChangeStage();
+22
View File
@@ -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
+20
View File
@@ -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
+4 -3
View File
@@ -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
+6
View File
@@ -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;
}
+1
View File
@@ -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);
+30 -8
View File
@@ -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;
+3 -3
View File
@@ -26,7 +26,7 @@ public:
struct Arg {
Arg();
/* 0x00 */ EGG::Heap *heap;
/* 0x04 */ char *soundFileName;
/* 0x04 */ const char *soundFileName;
/* 0x08 */ int sndThreadPriority;
/* 0x0C */ int dvdThreadPriority;
/* 0x10 */ int sndThreadStackSize;
@@ -40,7 +40,7 @@ public:
field_0x04 = false;
}
virtual UNKTYPE initialize(Arg *) {}
virtual void initialize(Arg *) {}
virtual UNKTYPE calc() = 0;
bool field_0x04;
@@ -55,7 +55,7 @@ public:
SimpleAudioMgr();
virtual ~SimpleAudioMgr();
void initialize(EGG::IAudioMgr::Arg *) override;
virtual void initialize(EGG::IAudioMgr::Arg *) override;
virtual void calc() override;
virtual UNKTYPE *openDvdArchive(const char *, nw4r::snd::SoundHeap *) override; // at 0x10
+3
View File
@@ -72,6 +72,9 @@ namespace nw4r { namespace snd
detail::AxManager::GetInstance().PrepareReset();
}
static OutputMode GetOutputMode() {
return detail::AxManager::GetInstance().GetOutputMode();
}
static void SetOutputMode(OutputMode mode) {
detail::AxManager::GetInstance().SetOutputMode(mode);
-10
View File
@@ -1,10 +0,0 @@
#ifndef OTHER_SOUND_STUFF_H
#define OTHER_SOUND_STUFF_H
#include "common.h"
extern "C" void *lbl_80575DE0;
extern "C" void fn_803996B0(void *, const char *msgLabelName, u16, s32);
extern "C" void fn_803998A0(void *, u16, u16);
#endif