d_snd_bgm_sound_battle OK

This commit is contained in:
robojumper
2025-07-09 00:30:48 +02:00
parent bb3f0562bd
commit 4f9d63d357
11 changed files with 115 additions and 50 deletions
+4
View File
@@ -15,6 +15,10 @@
* G3-C4-E4-G4-B4-C5-E5-G5-B5-C6-E6-G6
* B3 is missing, possibly to prevent dissonance at the ends of the scale.
* (Sealed Grounds, before Demise fight, no actual BGM)
*
* TODO: This deals with slightly more than the harp. It additionally
* also deals with the combat hit sounds that also seem to match up in
* pitch with the BGM.
*/
/**
+1 -1
View File
@@ -100,7 +100,7 @@ private:
bool prepareBgmSound(u32 soundId, dSndBgmSound_c *handle, u32 startOffset);
bool startAdditionalBgm(u32 soundId);
bool playBattleBgm(u32 soundId, bool immediately);
bool playBattleBgm(u32 soundId, bool intense);
/** Used to mute other BGM when battle music is playing */
void setBgmHandleIdxVolume(u32 handleIdx, f32 volume, s32 fadeFrames);
+3 -3
View File
@@ -6,9 +6,9 @@
struct dSndBgmSeqConfig {
/* 0x00 */ u32 soundId;
/* 0x04 */ s32 field_0x04;
/* 0x08 */ s32 field_0x08;
/* 0x0C */ u16 field_0x0C;
/* 0x0E */ u16 field_0x0E;
/* 0x08 */ s32 mTimebase;
/* 0x0C */ u16 mLoopStart;
/* 0x0E */ u16 mLoopEnd;
static const dSndBgmSeqConfig *getConfig(u32 soundId, s32 unkParam);
+2 -2
View File
@@ -77,8 +77,8 @@ protected:
/* 0x108 */ s32 mSeqTempo;
/* 0x10C */ u32 mBgmFlags;
/* 0x110 */ bool mDidRewindPlaySamplePosition;
/* 0x114 */ s32 field_0x114;
/* 0x118 */ s32 field_0x118;
/* 0x114 */ s32 mBgmVar3;
/* 0x118 */ s32 mSeqTimebase;
/* 0x11C */ u32 mPlaySamplePosition;
/* 0x120 */ dSndBgmSoundHarpMgr_c mHarpMgr;
/* 0x140 */ dSndBgmSoundHarpMgr_c *mpHarpMgr;
+11 -2
View File
@@ -20,10 +20,19 @@ public:
virtual void calcSeqPlaySamplePosition() override; // vt 0x3C
virtual void loadCallbacks(u32 soundId) override; // vt 0x40
/**
* Called when the player is even closer to an enemy.
* Adds some more instruments to the battle sound.
*/
bool startMainBattleLoop();
private:
void setTrackGroupMuted(u32 groupId);
void setTrackGroupUnmuted(u32 groupId);
/* 0x184 */ const dSndBgmBattleConfig *mpBgmBattleConfig;
/* 0x188 */ u32 mMuteApplyStateMask;
/* 0x18C */ u32 mTickRelated;
/* 0x188 */ u32 mMuteGroupActiveMask;
/* 0x18C */ u32 mPrevTick;
/* 0x190 */ u8 field_0x190;
/* 0x191 */ u8 field_0x191;
};