summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-07-16 23:20:26 +0200
committerrobojumper <robojumper@gmail.com>2025-09-13 11:10:26 +0200
commit81e2b7824908407e1c494b9d3eca74a1eda2aaa8 (patch)
treeb0b81e432993b2bde87a4266720136dc316ba02c /include
parentba3092ca928e9ab8df2428f9858e5e95d1c7d5b5 (diff)
more harp stuff
Diffstat (limited to 'include')
-rw-r--r--include/d/snd/d_snd_bgm_mml_parsers.h13
-rw-r--r--include/d/snd/d_snd_fi_vocal_mgr.h6
-rw-r--r--include/d/snd/d_snd_harp_song_data.h69
-rw-r--r--include/d/snd/d_snd_harp_song_mgr.h57
-rw-r--r--include/d/snd/d_snd_state_mgr.h2
-rw-r--r--include/d/snd/d_snd_types.h2
6 files changed, 148 insertions, 1 deletions
diff --git a/include/d/snd/d_snd_bgm_mml_parsers.h b/include/d/snd/d_snd_bgm_mml_parsers.h
index 52873832..0cff96f5 100644
--- a/include/d/snd/d_snd_bgm_mml_parsers.h
+++ b/include/d/snd/d_snd_bgm_mml_parsers.h
@@ -19,4 +19,17 @@ private:
/* 0x298 */ dSndBgmSoundHarpMgr_c *field_0x298;
};
+class dSndBgmMmlParserHarpSong_c : dSndBgmMmlParser_c {
+public:
+ dSndBgmMmlParserHarpSong_c();
+
+ virtual void CommandProc(u32 trackNo, int wait, u32 command, s32 commandArg1, s32 commandArg2) const override;
+ virtual void NoteOnCommandProc(u32 trackNo, int wait, int key, int velocity, s32 length) const override;
+
+ bool parseData(u32 soundId, dSndHarpSongData_c *pData);
+
+private:
+ /* 0x294 */ dSndHarpSongData_c *field_0x294;
+};
+
#endif
diff --git a/include/d/snd/d_snd_fi_vocal_mgr.h b/include/d/snd/d_snd_fi_vocal_mgr.h
index a918d990..19f743d0 100644
--- a/include/d/snd/d_snd_fi_vocal_mgr.h
+++ b/include/d/snd/d_snd_fi_vocal_mgr.h
@@ -14,9 +14,13 @@ public:
void fiSpeak(const char *, u16, s32);
void executeOutputText(u16, u16);
+ /** The bank argument affects what Fi is singing */
+ bool startFiVocal(s16 pitch, s16 bank);
+
+ s16 getStaticSongValue(s32, u32, s32, s32);
private:
- /* 0x10 */ nw4r::snd::SoundHandle mHandle;
+ /* 0x10 */ nw4r::snd::SoundHandle mSpeechHandle;
};
#endif
diff --git a/include/d/snd/d_snd_harp_song_data.h b/include/d/snd/d_snd_harp_song_data.h
new file mode 100644
index 00000000..9ca29b0e
--- /dev/null
+++ b/include/d/snd/d_snd_harp_song_data.h
@@ -0,0 +1,69 @@
+#ifndef D_SND_HARP_SONG_DATA_H
+#define D_SND_HARP_SONG_DATA_H
+
+#include "common.h"
+
+class dSndHarpSongEntryBase_c {
+public:
+ dSndHarpSongEntryBase_c(s16 count, s16 stride);
+ ~dSndHarpSongEntryBase_c();
+
+ void insert(u32 idx, s16 value);
+ s32 get(u32 idx) const;
+
+ void reset();
+
+private:
+ /* 0x00 */ s16 *mpData;
+ /* 0x04 */ u16 mCount;
+ /* 0x06 */ u16 mStride;
+};
+
+class dSndHarpSongEntry1_c : public dSndHarpSongEntryBase_c {
+ static const s32 NUM_ENTRIES_TYPE_1 = 24;
+
+public:
+ dSndHarpSongEntry1_c();
+ void loadStaticData(s32 i1, u32 i2, s32 i3);
+ s16 getStaticDatum(u32 idx) const;
+
+private:
+ /* 0x08 */ s16 mStaticValues[24];
+};
+
+class dSndHarpSongEntry2_c : public dSndHarpSongEntryBase_c {
+ static const s32 NUM_ENTRIES_TYPE_2 = 12;
+
+public:
+ dSndHarpSongEntry2_c() : dSndHarpSongEntryBase_c(NUM_ENTRIES_TYPE_2, NUM_ENTRIES_TYPE_2 * 2) {}
+
+private:
+};
+
+class dSndHarpSongData_c {
+public:
+ dSndHarpSongData_c();
+
+ void init(u32 idx);
+ void loadStaticValues();
+
+ void insert2(u32 key, s16 value, s32);
+ void insert1(u32 key, s16 value);
+
+ static const s32 sNumHarpSongs;
+
+ void setSoundId(u32 id) {
+ mSoundId = id;
+ }
+
+private:
+ /* 0x00 */ u32 mSoundId;
+ /* 0x04 */ u32 mIndex;
+ /* 0x08 */ UNKWORD field_0x08;
+ /* 0x0C */ f32 field_0x0C;
+ /* 0x10 */ dSndHarpSongEntry2_c mEntries2[4][2][2];
+ /* 0x90 */ UNKWORD field_0x90[4][2];
+ /* 0xB0 */ dSndHarpSongEntry1_c mEntries1[4][2];
+};
+
+#endif
diff --git a/include/d/snd/d_snd_harp_song_mgr.h b/include/d/snd/d_snd_harp_song_mgr.h
index 9b01bfc7..2ffca321 100644
--- a/include/d/snd/d_snd_harp_song_mgr.h
+++ b/include/d/snd/d_snd_harp_song_mgr.h
@@ -1,7 +1,10 @@
#ifndef D_SND_HARP_SONG_MGR_H
#define D_SND_HARP_SONG_MGR_H
+#include "common.h"
#include "d/snd/d_snd_util.h"
+#include "d/snd/d_snd_types.h"
+#include "nw4r/snd/snd_SoundHandle.h"
SND_DISPOSER_FORWARD_DECL(dSndHarpSongMgr_c);
@@ -12,9 +15,63 @@ public:
dSndHarpSongMgr_c();
void setup();
+ void setupState0();
+
void calc();
+ nw4r::snd::SoundHandle &getFiSingHandle() {
+ return mFiSingHandle;
+ }
+
private:
+
+ void resetFloatArr1();
+ void resetFloatArr2();
+
+ /* 0x010 */ u8 field_0x010;
+ /* 0x011 */ u8 field_0x011;
+ /* 0x012 */ bool mDataLoaded;
+ /* 0x014 */ UNKWORD field_0x014;
+ /* 0x018 */ UNKWORD field_0x018;
+ /* 0x01C */ UNKWORD field_0x01C;
+ /* 0x020 */ UNKWORD field_0x020;
+ /* 0x024 */ UNKWORD field_0x024;
+ /* 0x028 */ UNKWORD field_0x028;
+ /* 0x02C */ UNKWORD field_0x02C;
+ /* 0x030 */ UNKWORD field_0x030;
+ /* 0x034 */ UNKWORD field_0x034;
+ /* 0x038 */ f32 field_0x038;
+ /* 0x03C */ f32 field_0x03C;
+ /* 0x040 */ u8 field_0x040;
+ /* 0x041 */ u8 field_0x041;
+ /* 0x042 */ u8 field_0x042;
+ /* 0x043 */ u8 field_0x043;
+ /* 0x044 */ u8 field_0x044;
+ /* 0x048 */ UNKWORD field_0x048;
+ /* 0x04C */ UNKWORD field_0x04C;
+ /* 0x050 */ UNKWORD field_0x050;
+ /* 0x054 */ UNKWORD field_0x054;
+ /* 0x058 */ UNKWORD field_0x058;
+ /* 0x05C */ UNKWORD field_0x05C;
+ /* 0x060 */ UNKWORD field_0x060;
+ /* 0x064 */ UNKWORD field_0x064;
+ /* 0x068 */ UNKWORD field_0x068;
+ /* 0x06C */ UNKWORD field_0x06C;
+ /* 0x070 */ f32 field_0x070;
+ /* 0x074 */ u8 _0x074[0x078 - 0x074];
+ /* 0x078 */ u8 field_0x078;
+ /* 0x07C */ f32 field_0x07C[300];
+ /* 0x52C */ f32 field_0x52C[30];
+
+ /* 0x5A4 */ dSndHarpSongData_c *mpData;
+ /* 0x5A8 */ dSndHarpSongData_c *mpTmpData;
+ /* 0x5AC */ UNKWORD field_0x5AC;
+ /* 0x5B0 */ nw4r::snd::SoundHandle mFiSingHandle;
+ /* 0x5B4 */ UNKWORD field_0x5B4;
+ /* 0x5B8 */ UNKWORD field_0x5B8;
+ /* 0x5BC */ u8 field_0x5BC;
+ /* 0x5C0 */ UNKWORD field_0x5C0;
+ /* 0x5C4 */ UNKWORD field_0x5C4;
};
#endif
diff --git a/include/d/snd/d_snd_state_mgr.h b/include/d/snd/d_snd_state_mgr.h
index 4511ed2c..7ad4dbe2 100644
--- a/include/d/snd/d_snd_state_mgr.h
+++ b/include/d/snd/d_snd_state_mgr.h
@@ -189,6 +189,8 @@ public:
void onCameraCut(s32 cutIdx);
+ static void clearExecuteCallback();
+
private:
void resetOverrides();
void initializeEventCallbacks(const char *name);
diff --git a/include/d/snd/d_snd_types.h b/include/d/snd/d_snd_types.h
index 901074b6..2edec499 100644
--- a/include/d/snd/d_snd_types.h
+++ b/include/d/snd/d_snd_types.h
@@ -26,4 +26,6 @@ class dSndBgmSoundHarpMgr_c;
class dSndBgmSeqConfig;
class dSndBgmBattleConfig;
+class dSndHarpSongData_c;
+
#endif