summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/bard_music.h18
-rw-r--r--src/bard_music.c87
-rw-r--r--src/data/bard_music/word_pitch.h183
3 files changed, 202 insertions, 86 deletions
diff --git a/include/bard_music.h b/include/bard_music.h
index 529fd50f8..ee8a5f80b 100644
--- a/include/bard_music.h
+++ b/include/bard_music.h
@@ -1,7 +1,17 @@
#ifndef GUARD_BARD_MUSIC_H
#define GUARD_BARD_MUSIC_H
-struct BardSound;
+// Exported type declarations
+
+
+struct BardSound
+{
+ /*0x00*/ u8 var00;
+ /*0x01*/ s8 var01;
+ /*0x02*/ u16 var02;
+ /*0x04*/ s16 volume;
+ /*0x06*/ u16 var06;
+};
struct BardPhoneme
{
@@ -25,7 +35,11 @@ struct BardSong
/*0x18*/ struct BardPhoneme phonemes[6];
};
-const struct BardSound *GetWordSounds(u16 arg0, u16 arg1);
+// Exported RAM declarations
+
+// Exported ROM declarations
+
+const struct BardSound *GetWordSounds(u16 group, u16 word);
s32 GetWordPhonemes(struct BardSong *dest, const struct BardSound *src, u16 arg2);
#endif // GUARD_BARD_MUSIC_H
diff --git a/src/bard_music.c b/src/bard_music.c
index 4518cf09b..820c282ce 100644
--- a/src/bard_music.c
+++ b/src/bard_music.c
@@ -2,88 +2,7 @@
#include "bard_music.h"
#include "easy_chat.h"
-struct BardSound
-{
- /*0x00*/ u8 var00;
- /*0x01*/ s8 var01;
- /*0x02*/ u16 var02;
- /*0x04*/ u16 volume;
- /*0x06*/ u16 var06;
-};
-
-static const s16 Unknown_8416F08[] = {-768, 6144};
-static const s16 Unknown_8416F0C[] = {2304, 6144};
-static const s16 Unknown_8416F10[] = {256, 6144};
-static const s16 Unknown_8416F14[] = {1024, 6144};
-static const s16 Unknown_8416F18[] = {2816, 6144};
-static const s16 Unknown_8416F1C[] = {-768, -256, 6144};
-static const s16 Unknown_8416F22[] = {-768, 512, 6144};
-static const s16 Unknown_8416F28[] = {512, 1024, 6144};
-static const s16 Unknown_8416F2E[] = {1536, 2048, 6144};
-static const s16 Unknown_8416F34[] = {2304, 2048, 6144};
-static const s16 Unknown_8416F3A[] = {-768, -256, -768, 6144};
-static const s16 Unknown_8416F42[] = {1024, -768, 1024, 6144};
-static const s16 Unknown_8416F4A[] = {2304, 2048, 1536, 6144};
-static const s16 Unknown_8416F52[] = {256, 512, 1024, 6144};
-static const s16 Unknown_8416F5A[] = {1536, 4096, 3328, 6144};
-static const s16 Unknown_8416F62[] = {1024, 2304, 1024, 2304, 6144};
-static const s16 Unknown_8416F6C[] = {2304, 1024, 3328, 1024, 6144};
-static const s16 Unknown_8416F76[] = {256, 512, 1024, 1536, 6144};
-static const s16 Unknown_8416F80[] = {2048, 1536, 1024, 512, 6144};
-static const s16 Unknown_8416F8A[] = {3840, 3328, 2816, 2560, 6144};
-static const s16 Unknown_8416F94[] = {-768, -256, 256, 512, 1024, 6144};
-static const s16 Unknown_8416FA0[] = {2304, 2048, 1536, 1024, 512, 6144};
-static const s16 Unknown_8416FAC[] = {256, 1024, 2304, 1024, 256, 6144};
-static const s16 Unknown_8416FB8[] = {2304, 1024, 2304, 1024, -768, 6144};
-static const s16 Unknown_8416FC4[] = {2816, 2048, 1024, 1024, 1536, 6144};
-static const s16 Unknown_8416FD0[] = {-768, -256, 256, 512, 1024, 1536, 6144};
-static const s16 Unknown_8416FDE[] = {2048, 1536, 1024, 512, 256, -256, 6144};
-static const s16 Unknown_8416FEC[] = {256, 512, 1024, 256, 512, 4096, 6144};
-static const s16 Unknown_8416FFA[] = {1024, -768, 2304, 1024, 2304, 1024, 6144};
-static const s16 Unknown_8417008[] = {2048, 2304, 2048, 2304, 2048, 2304, 6144};
-static const s16 Unknown_8417016[] = {512, 256, 512, 256, 512, 1024, 512, 6144};
-static const s16 Unknown_8417026[] = {256, 256, -256, -256, -768, 1024, -768, 6144};
-static const s16 Unknown_8417036[] = {2048, 2304, 2816, 3328, 3584, 3328, 2816, 6144};
-static const s16 Unknown_8417046[] = {2048, 1536, 1024, 512, 3328, 2816, 2304, 6144};
-static const s16 Unknown_8417056[] = {768, 1024, 1536, 2048, 1792, 2048, 1024, 6144};
-
-static const s16 *const sWordPitches[] = {
- Unknown_8416F08,
- Unknown_8416F0C,
- Unknown_8416F10,
- Unknown_8416F14,
- Unknown_8416F18,
- Unknown_8416F1C,
- Unknown_8416F22,
- Unknown_8416F28,
- Unknown_8416F2E,
- Unknown_8416F34,
- Unknown_8416F3A,
- Unknown_8416F42,
- Unknown_8416F4A,
- Unknown_8416F52,
- Unknown_8416F5A,
- Unknown_8416F62,
- Unknown_8416F6C,
- Unknown_8416F76,
- Unknown_8416F80,
- Unknown_8416F8A,
- Unknown_8416F94,
- Unknown_8416FA0,
- Unknown_8416FAC,
- Unknown_8416FB8,
- Unknown_8416FC4,
- Unknown_8416FD0,
- Unknown_8416FDE,
- Unknown_8416FEC,
- Unknown_8416FFA,
- Unknown_8417008,
- Unknown_8417016,
- Unknown_8417026,
- Unknown_8417036,
- Unknown_8417046,
- Unknown_8417056
-};
+#include "data/bard_music/word_pitch.h"
static const u32 sBardSoundLengthDeltas[] = {
9,
@@ -171,9 +90,9 @@ static const struct BardSound (*const gBardMusicTable[])[6] = {
BardMusic_POKEMON_2
};
-static s16 CalcWordPitch(u32 arg0, u32 songPos)
+s16 CalcWordPitch(int arg0, int songPos)
{
- return sWordPitches[arg0][songPos];
+ return gBardSoundPitchTables[arg0][songPos];
}
#if ENGLISH
diff --git a/src/data/bard_music/word_pitch.h b/src/data/bard_music/word_pitch.h
new file mode 100644
index 000000000..b8cb86f87
--- /dev/null
+++ b/src/data/bard_music/word_pitch.h
@@ -0,0 +1,183 @@
+#ifndef GUARD_WORD_PITCH_H
+#define GUARD_WORD_PITCH_H
+
+const s16 gUnknown_08416F08[] = {
+ -0x300, 0x1800
+};
+
+const s16 gUnknown_08416F0C[] = {
+ 0x0900, 0x1800
+};
+
+const s16 gUnknown_08416F10[] = {
+ 0x0100, 0x1800
+};
+
+const s16 gUnknown_08416F14[] = {
+ 0x0400, 0x1800
+};
+
+const s16 gUnknown_08416F18[] = {
+ 0x0b00, 0x1800
+};
+
+const s16 gUnknown_08416F1C[] = {
+ -0x300, -0x100, 0x1800
+};
+
+const s16 gUnknown_08416F22[] = {
+ -0x300, 0x0200, 0x1800
+};
+
+const s16 gUnknown_08416F28[] = {
+ 0x0200, 0x0400, 0x1800
+};
+
+const s16 gUnknown_08416F2E[] = {
+ 0x0600, 0x0800, 0x1800
+};
+
+const s16 gUnknown_08416F34[] = {
+ 0x0900, 0x0800, 0x1800
+};
+
+const s16 gUnknown_08416F3A[] = {
+ -0x300, -0x100, -0x300, 0x1800
+};
+
+const s16 gUnknown_08416F42[] = {
+ 0x0400, -0x300, 0x0400, 0x1800
+};
+
+const s16 gUnknown_08416F4A[] = {
+ 0x0900, 0x0800, 0x0600, 0x1800
+};
+
+const s16 gUnknown_08416F52[] = {
+ 0x0100, 0x0200, 0x0400, 0x1800
+};
+
+const s16 gUnknown_08416F5A[] = {
+ 0x0600, 0x1000, 0x0d00, 0x1800
+};
+
+const s16 gUnknown_08416F62[] = {
+ 0x0400, 0x0900, 0x0400, 0x0900, 0x1800
+};
+
+const s16 gUnknown_08416F6C[] = {
+ 0x0900, 0x0400, 0x0d00, 0x0400, 0x1800
+};
+
+const s16 gUnknown_08416F76[] = {
+ 0x0100, 0x0200, 0x0400, 0x0600, 0x1800
+};
+
+const s16 gUnknown_08416F80[] = {
+ 0x0800, 0x0600, 0x0400, 0x0200, 0x1800
+};
+
+const s16 gUnknown_08416F8A[] = {
+ 0x0f00, 0x0d00, 0x0b00, 0x0a00, 0x1800
+};
+
+const s16 gUnknown_08416F94[] = {
+ -0x300, -0x100, 0x0100, 0x0200, 0x0400, 0x1800
+};
+
+const s16 gUnknown_08416FA0[] = {
+ 0x0900, 0x0800, 0x0600, 0x0400, 0x0200, 0x1800
+};
+
+const s16 gUnknown_08416FAC[] = {
+ 0x0100, 0x0400, 0x0900, 0x0400, 0x0100, 0x1800
+};
+
+const s16 gUnknown_08416FB8[] = {
+ 0x0900, 0x0400, 0x0900, 0x0400, -0x300, 0x1800
+};
+
+const s16 gUnknown_08416FC4[] = {
+ 0x0b00, 0x0800, 0x0400, 0x0400, 0x0600, 0x1800
+};
+
+const s16 gUnknown_08416FD0[] = {
+ -0x300, -0x100, 0x0100, 0x0200, 0x0400, 0x0600, 0x1800
+};
+
+const s16 gUnknown_08416FDE[] = {
+ 0x0800, 0x0600, 0x0400, 0x0200, 0x0100, -0x100, 0x1800
+};
+
+const s16 gUnknown_08416FEC[] = {
+ 0x0100, 0x0200, 0x0400, 0x0100, 0x0200, 0x1000, 0x1800
+};
+
+const s16 gUnknown_08416FFA[] = {
+ 0x0400, -0x300, 0x0900, 0x0400, 0x0900, 0x0400, 0x1800
+};
+
+const s16 gUnknown_08417008[] = {
+ 0x0800, 0x0900, 0x0800, 0x0900, 0x0800, 0x0900, 0x1800
+};
+
+const s16 gUnknown_08417016[] = {
+ 0x0200, 0x0100, 0x0200, 0x0100, 0x0200, 0x0400, 0x0200, 0x1800
+};
+
+const s16 gUnknown_08417026[] = {
+ 0x0100, 0x0100, -0x100, -0x100, -0x300, 0x0400, -0x300, 0x1800
+};
+
+const s16 gUnknown_08417036[] = {
+ 0x0800, 0x0900, 0x0b00, 0x0d00, 0x0e00, 0x0d00, 0x0b00, 0x1800
+};
+
+const s16 gUnknown_08417046[] = {
+ 0x0800, 0x0600, 0x0400, 0x0200, 0x0d00, 0x0b00, 0x0900, 0x1800
+};
+
+const s16 gUnknown_08417056[] = {
+ 0x0300, 0x0400, 0x0600, 0x0800, 0x0700, 0x0800, 0x0400, 0x1800
+};
+
+const s16 *const gBardSoundPitchTables[] = {
+ gUnknown_08416F08,
+ gUnknown_08416F0C,
+ gUnknown_08416F10,
+ gUnknown_08416F14,
+ gUnknown_08416F18,
+ gUnknown_08416F1C,
+ gUnknown_08416F22,
+ gUnknown_08416F28,
+ gUnknown_08416F2E,
+ gUnknown_08416F34,
+ gUnknown_08416F3A,
+ gUnknown_08416F42,
+ gUnknown_08416F4A,
+ gUnknown_08416F52,
+ gUnknown_08416F5A,
+ gUnknown_08416F62,
+ gUnknown_08416F6C,
+ gUnknown_08416F76,
+ gUnknown_08416F80,
+ gUnknown_08416F8A,
+ gUnknown_08416F94,
+ gUnknown_08416FA0,
+ gUnknown_08416FAC,
+ gUnknown_08416FB8,
+ gUnknown_08416FC4,
+ gUnknown_08416FD0,
+ gUnknown_08416FDE,
+ gUnknown_08416FEC,
+ gUnknown_08416FFA,
+ gUnknown_08417008,
+ gUnknown_08417016,
+ gUnknown_08417026,
+ gUnknown_08417036,
+ gUnknown_08417046,
+ gUnknown_08417056
+};
+
+
+#endif //GUARD_WORD_PITCH_H