summaryrefslogtreecommitdiff
path: root/src/field
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-12-17 15:19:32 -0500
committerscnorton <scnorton@biociphers.org>2017-12-17 15:19:32 -0500
commite212655df1491cbf28675b77ec63eca73edf5f56 (patch)
tree7999660dae792e79af107db549d5432636db9a1e /src/field
parent77f725951f12425734235db42f17ce978a56d41f (diff)
Decompile data: bard_music
Diffstat (limited to 'src/field')
-rw-r--r--src/field/bard_music.c145
1 files changed, 136 insertions, 9 deletions
diff --git a/src/field/bard_music.c b/src/field/bard_music.c
index daf003233..4122c2e26 100644
--- a/src/field/bard_music.c
+++ b/src/field/bard_music.c
@@ -11,29 +11,156 @@ struct BardSound
/*0x06*/ u16 var06;
};
-extern const struct BardSound (*const gBardMusicTable[])[][6];
-extern s16 *gUnknown_08417068[];
-extern u32 gUnknown_084170F4[];
+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
+};
+
+static const u32 sBardSoundLengthDeltas[] = {
+ 9,
+ 22,
+ 15,
+ 16,
+ 39,
+ 21,
+ 9,
+ 30,
+ 24,
+ 15,
+ 25,
+ 12,
+ 22,
+ 45,
+ 24,
+ 15,
+ 40,
+ 9,
+ 21,
+ 42,
+ 18,
+ 9,
+ 22,
+ 15,
+ 27,
+ 48,
+ 18,
+ 27,
+ 33,
+ 24,
+ 25,
+ 39,
+ 19,
+ 16,
+ 54,
+ 18,
+ 9,
+ 45,
+ 15,
+ 12,
+ 39,
+ 23,
+ 5,
+ 45,
+ 12,
+ 21,
+ 48,
+ 12,
+ 21,
+ 69,
+ 18,
+ 15
+};
+
+#include "../src/data/bard_music.h"
static s16 CalcWordPitch(u32 arg0, u32 songPos)
{
- return gUnknown_08417068[arg0][songPos];
+ return sWordPitches[arg0][songPos];
}
#if ENGLISH
const struct BardSound *GetWordSounds(u16 group, u16 word)
{
- const struct BardSound (*sounds)[][6] = gBardMusicTable[group];
+ const struct BardSound (*sounds)[6] = gBardMusicTable[group];
- return (*sounds)[word];
+ return sounds[word];
}
#elif GERMAN
const struct BardSound *GetWordSounds(u16 group, u16 word)
{
- const struct BardSound (*sounds)[][6] = gBardMusicTable[group];
+ const struct BardSound (*sounds)[6] = gBardMusicTable[group];
u32 index = de_sub_80EB748(group, word);
- return (*sounds)[index];
+ return sounds[index];
}
#endif
@@ -48,7 +175,7 @@ s32 GetWordPhonemes(struct BardSong *song, const struct BardSound *src, u16 arg2
song->phonemes[i].sound = src[i].var00;
if (src[i].var00 != 0xFF)
{
- s32 length = src[i].var01 + gUnknown_084170F4[src[i].var00];
+ s32 length = src[i].var01 + sBardSoundLengthDeltas[src[i].var00];
song->phonemes[i].length = length;
song->phonemes[i].volume = src[i].volume;