summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcamthesaxman <cameronghall@cox.net>2017-08-24 19:26:19 -0500
committercamthesaxman <cameronghall@cox.net>2017-08-24 19:26:19 -0500
commitdf6720ea01ab251c3d90885d75847fc39cc862c9 (patch)
tree06870cb33a6eb76509f5c1c4960ae81a03fd8fa8
parentded9b4a8d0a59dab3882ab3fe43817bc38bca834 (diff)
fix build
-rw-r--r--include/bard_music.h18
-rw-r--r--src/bard_music.c27
-rw-r--r--src/mauville_old_man.c4
3 files changed, 23 insertions, 26 deletions
diff --git a/include/bard_music.h b/include/bard_music.h
index d0cb49ace..529fd50f8 100644
--- a/include/bard_music.h
+++ b/include/bard_music.h
@@ -1,19 +1,7 @@
#ifndef GUARD_BARD_MUSIC_H
#define GUARD_BARD_MUSIC_H
-struct BardSound
-{
- u8 pad_00[48];
-};
-
-struct UnkBard
-{
- /*0x00*/ u8 var00;
- /*0x01*/ s8 var01;
- /*0x02*/ u16 var02;
- /*0x04*/ u16 volume;
- /*0x06*/ u16 var06;
-};
+struct BardSound;
struct BardPhoneme
{
@@ -37,7 +25,7 @@ struct BardSong
/*0x18*/ struct BardPhoneme phonemes[6];
};
-struct UnkBard *GetWordSoundInfo(u16 arg0, u16 arg1);
-s32 GetWordPhonemes(struct BardSong *dest, struct UnkBard *src, u16 arg2);
+const struct BardSound *GetWordSounds(u16 arg0, u16 arg1);
+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 593376f35..5b7419735 100644
--- a/src/bard_music.c
+++ b/src/bard_music.c
@@ -2,7 +2,16 @@
#include "bard_music.h"
#include "easy_chat.h"
-extern struct UnkBard (*gBardMusicTable[])[][6];
+struct BardSound
+{
+ /*0x00*/ u8 var00;
+ /*0x01*/ s8 var01;
+ /*0x02*/ u16 var02;
+ /*0x04*/ u16 volume;
+ /*0x06*/ u16 var06;
+};
+
+extern const struct BardSound (*const gBardMusicTable[])[][6];
extern s16 *gUnknown_08417068[];
extern u32 gUnknown_084170F4[];
@@ -12,23 +21,23 @@ static s16 CalcWordPitch(u32 arg0, u32 songPos)
}
#if ENGLISH
-struct UnkBard *GetWordSoundInfo(u16 group, u16 word)
+const struct BardSound *GetWordSounds(u16 group, u16 word)
{
- struct UnkBard (*sounds)[][6] = gBardMusicTable[group];
+ const struct BardSound (*sounds)[][6] = gBardMusicTable[group];
return (*sounds)[word];
}
#elif GERMAN
-struct UnkBard *GetWordSoundInfo(u16 group, u16 word)
+struct BardSound *GetWordSounds(u16 group, u16 word)
{
- struct UnkBard (*sounds)[][6] = gBardMusicTable[group];
+ struct BardSound (*sounds)[][6] = gBardMusicTable[group];
u32 index = de_sub_80EB748(group, word);
return (*sounds)[index];
}
#endif
-s32 GetWordPhonemes(struct BardSong *song, struct UnkBard *src, u16 arg2)
+s32 GetWordPhonemes(struct BardSong *song, struct BardSound *src, u16 arg2)
{
s32 i;
s32 j;
@@ -39,11 +48,11 @@ s32 GetWordPhonemes(struct BardSong *song, struct UnkBard *src, u16 arg2)
song->phonemes[i].sound = src[i].var00;
if (src[i].var00 != 0xFF)
{
- s32 r1 = src[i].var01 + gUnknown_084170F4[src[i].var00];
+ s32 length = src[i].var01 + gUnknown_084170F4[src[i].var00];
- song->phonemes[i].length = r1;
+ song->phonemes[i].length = length;
song->phonemes[i].volume = src[i].volume;
- song->var04 += r1;
+ song->var04 += length;
}
}
diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c
index 3cf5265c0..c8bbf8c86 100644
--- a/src/mauville_old_man.c
+++ b/src/mauville_old_man.c
@@ -815,10 +815,10 @@ void BardSingWord(struct Task *task, struct BardSong *song)
{
u16 word = song->lyrics[song->currWord];
// TODO: fix this return type
- struct UnkBard *sounds = GetWordSoundInfo(EC_GROUP(word), EC_INDEX(word));
+ const struct BardSound *sounds = GetWordSounds(EC_GROUP(word), EC_INDEX(word));
song->var04 = 0;
- GetWordPhonemes(song, r1, MACRO1(word));
+ GetWordPhonemes(song, sounds, MACRO1(word));
}
break;
case 3: