Merge pull request #1318 from GriffinRichards/bardmoves

Minor bard music clean up
This commit is contained in:
GriffinR 2021-02-01 14:59:45 -05:00 committed by GitHub
commit 90513a9d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 891 additions and 896 deletions

View File

@ -1,9 +1,6 @@
#ifndef GUARD_BARD_MUSIC_H
#define GUARD_BARD_MUSIC_H
// Exported type declarations
struct BardSound
{
/*0x00*/ u8 var00;
@ -34,12 +31,8 @@ struct BardSong
/*0x30*/ const struct BardSound *sound;
};
// Exported RAM declarations
// Exported ROM declarations
extern const u16 gNumSpeciesNames;
extern const u16 gUnknown_085FA1D4;
extern const u16 gNumBardWords_Species;
extern const u16 gNumBardWords_Moves;
const struct BardSound *GetWordSounds(u16 word);
void GetWordPhonemes(struct BardSong *song, u16 word);

View File

@ -127,7 +127,7 @@ u8 * CopyEasyChatWord(u8 *dest, u16 word);
bool32 sub_811F8D8(int word);
void InitializeEasyChatWordArray(u16 *words, u16 length);
u8 *ConvertEasyChatWordsToString(u8 *dest, const u16 *src, u16 columns, u16 rows);
bool8 ECWord_CheckIfOutsideOfValidRange(u16 word);
bool8 IsBardWordInvalid(u16 word);
u16 GetRandomEasyChatWordFromGroup(u16 group);
u16 GetNewHipsterPhraseToTeach(void);
u16 EasyChat_GetNumWordsInGroup(u8);

View File

@ -1,5 +1,3 @@
// Includes
#include "global.h"
#include "bard_music.h"
#include "constants/easy_chat.h"
@ -10,9 +8,9 @@
#include "data/bard_music/default_sound.h"
#include "data/bard_music/length_table.h"
s16 CalcWordPitch(int arg0, int songPos)
static s16 CalcWordPitch(int arg0, int songPos)
{
return gBardSoundPitchTables[arg0][songPos];
return sBardSoundPitchTables[arg0][songPos];
}
const struct BardSound *GetWordSounds(u16 word)
@ -21,7 +19,7 @@ const struct BardSound *GetWordSounds(u16 word)
u32 subword;
const struct BardSound (*ptr)[6];
if (ECWord_CheckIfOutsideOfValidRange(word))
if (IsBardWordInvalid(word))
{
return gBardSound_InvalidWord;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,182 +1,186 @@
#ifndef GUARD_WORD_PITCH_H
#define GUARD_WORD_PITCH_H
const s16 gUnknown_0860A1C0[] = {
-0x300, 0x1800
#define PITCH_END 0x1800
static const s16 sPitch1_0[] = {
-0x300, PITCH_END
};
const s16 gUnknown_0860A1C4[] = {
0x0900, 0x1800
static const s16 sPitch1_1[] = {
0x0900, PITCH_END
};
const s16 gUnknown_0860A1C8[] = {
0x0100, 0x1800
static const s16 sPitch1_2[] = {
0x0100, PITCH_END
};
const s16 gUnknown_0860A1CC[] = {
0x0400, 0x1800
static const s16 sPitch1_3[] = {
0x0400, PITCH_END
};
const s16 gUnknown_0860A1D0[] = {
0x0b00, 0x1800
static const s16 sPitch1_4[] = {
0x0b00, PITCH_END
};
const s16 gUnknown_0860A1D4[] = {
-0x300, -0x100, 0x1800
static const s16 sPitch2_0[] = {
-0x300, -0x100, PITCH_END
};
const s16 gUnknown_0860A1DA[] = {
-0x300, 0x0200, 0x1800
static const s16 sPitch2_1[] = {
-0x300, 0x0200, PITCH_END
};
const s16 gUnknown_0860A1E0[] = {
0x0200, 0x0400, 0x1800
static const s16 sPitch2_2[] = {
0x0200, 0x0400, PITCH_END
};
const s16 gUnknown_0860A1E6[] = {
0x0600, 0x0800, 0x1800
static const s16 sPitch2_3[] = {
0x0600, 0x0800, PITCH_END
};
const s16 gUnknown_0860A1EC[] = {
0x0900, 0x0800, 0x1800
static const s16 sPitch2_4[] = {
0x0900, 0x0800, PITCH_END
};
const s16 gUnknown_0860A1F2[] = {
-0x300, -0x100, -0x300, 0x1800
static const s16 sPitch3_0[] = {
-0x300, -0x100, -0x300, PITCH_END
};
const s16 gUnknown_0860A1FA[] = {
0x0400, -0x300, 0x0400, 0x1800
static const s16 sPitch3_1[] = {
0x0400, -0x300, 0x0400, PITCH_END
};
const s16 gUnknown_0860A202[] = {
0x0900, 0x0800, 0x0600, 0x1800
static const s16 sPitch3_2[] = {
0x0900, 0x0800, 0x0600, PITCH_END
};
const s16 gUnknown_0860A20A[] = {
0x0100, 0x0200, 0x0400, 0x1800
static const s16 sPitch3_3[] = {
0x0100, 0x0200, 0x0400, PITCH_END
};
const s16 gUnknown_0860A212[] = {
0x0600, 0x1000, 0x0d00, 0x1800
static const s16 sPitch3_4[] = {
0x0600, 0x1000, 0x0d00, PITCH_END
};
const s16 gUnknown_0860A21A[] = {
0x0400, 0x0900, 0x0400, 0x0900, 0x1800
static const s16 sPitch4_0[] = {
0x0400, 0x0900, 0x0400, 0x0900, PITCH_END
};
const s16 gUnknown_0860A224[] = {
0x0900, 0x0400, 0x0d00, 0x0400, 0x1800
static const s16 sPitch4_1[] = {
0x0900, 0x0400, 0x0d00, 0x0400, PITCH_END
};
const s16 gUnknown_0860A22E[] = {
0x0100, 0x0200, 0x0400, 0x0600, 0x1800
static const s16 sPitch4_2[] = {
0x0100, 0x0200, 0x0400, 0x0600, PITCH_END
};
const s16 gUnknown_0860A238[] = {
0x0800, 0x0600, 0x0400, 0x0200, 0x1800
static const s16 sPitch4_3[] = {
0x0800, 0x0600, 0x0400, 0x0200, PITCH_END
};
const s16 gUnknown_0860A242[] = {
0x0f00, 0x0d00, 0x0b00, 0x0a00, 0x1800
static const s16 sPitch4_4[] = {
0x0f00, 0x0d00, 0x0b00, 0x0a00, PITCH_END
};
const s16 gUnknown_0860A24C[] = {
-0x300, -0x100, 0x0100, 0x0200, 0x0400, 0x1800
static const s16 sPitch5_0[] = {
-0x300, -0x100, 0x0100, 0x0200, 0x0400, PITCH_END
};
const s16 gUnknown_0860A258[] = {
0x0900, 0x0800, 0x0600, 0x0400, 0x0200, 0x1800
static const s16 sPitch5_1[] = {
0x0900, 0x0800, 0x0600, 0x0400, 0x0200, PITCH_END
};
const s16 gUnknown_0860A264[] = {
0x0100, 0x0400, 0x0900, 0x0400, 0x0100, 0x1800
static const s16 sPitch5_2[] = {
0x0100, 0x0400, 0x0900, 0x0400, 0x0100, PITCH_END
};
const s16 gUnknown_0860A270[] = {
0x0900, 0x0400, 0x0900, 0x0400, -0x300, 0x1800
static const s16 sPitch5_3[] = {
0x0900, 0x0400, 0x0900, 0x0400, -0x300, PITCH_END
};
const s16 gUnknown_0860A27C[] = {
0x0b00, 0x0800, 0x0400, 0x0400, 0x0600, 0x1800
static const s16 sPitch5_4[] = {
0x0b00, 0x0800, 0x0400, 0x0400, 0x0600, PITCH_END
};
const s16 gUnknown_0860A288[] = {
-0x300, -0x100, 0x0100, 0x0200, 0x0400, 0x0600, 0x1800
static const s16 sPitch6_0[] = {
-0x300, -0x100, 0x0100, 0x0200, 0x0400, 0x0600, PITCH_END
};
const s16 gUnknown_0860A296[] = {
0x0800, 0x0600, 0x0400, 0x0200, 0x0100, -0x100, 0x1800
static const s16 sPitch6_1[] = {
0x0800, 0x0600, 0x0400, 0x0200, 0x0100, -0x100, PITCH_END
};
const s16 gUnknown_0860A2A4[] = {
0x0100, 0x0200, 0x0400, 0x0100, 0x0200, 0x1000, 0x1800
static const s16 sPitch6_2[] = {
0x0100, 0x0200, 0x0400, 0x0100, 0x0200, 0x1000, PITCH_END
};
const s16 gUnknown_0860A2B2[] = {
0x0400, -0x300, 0x0900, 0x0400, 0x0900, 0x0400, 0x1800
static const s16 sPitch6_3[] = {
0x0400, -0x300, 0x0900, 0x0400, 0x0900, 0x0400, PITCH_END
};
const s16 gUnknown_0860A2C0[] = {
0x0800, 0x0900, 0x0800, 0x0900, 0x0800, 0x0900, 0x1800
static const s16 sPitch6_4[] = {
0x0800, 0x0900, 0x0800, 0x0900, 0x0800, 0x0900, PITCH_END
};
const s16 gUnknown_0860A2CE[] = {
0x0200, 0x0100, 0x0200, 0x0100, 0x0200, 0x0400, 0x0200, 0x1800
static const s16 sPitch7_0[] = {
0x0200, 0x0100, 0x0200, 0x0100, 0x0200, 0x0400, 0x0200, PITCH_END
};
const s16 gUnknown_0860A2DE[] = {
0x0100, 0x0100, -0x100, -0x100, -0x300, 0x0400, -0x300, 0x1800
static const s16 sPitch7_1[] = {
0x0100, 0x0100, -0x100, -0x100, -0x300, 0x0400, -0x300, PITCH_END
};
const s16 gUnknown_0860A2EE[] = {
0x0800, 0x0900, 0x0b00, 0x0d00, 0x0e00, 0x0d00, 0x0b00, 0x1800
static const s16 sPitch7_2[] = {
0x0800, 0x0900, 0x0b00, 0x0d00, 0x0e00, 0x0d00, 0x0b00, PITCH_END
};
const s16 gUnknown_0860A2FE[] = {
0x0800, 0x0600, 0x0400, 0x0200, 0x0d00, 0x0b00, 0x0900, 0x1800
static const s16 sPitch7_3[] = {
0x0800, 0x0600, 0x0400, 0x0200, 0x0d00, 0x0b00, 0x0900, PITCH_END
};
const s16 gUnknown_0860A30E[] = {
0x0300, 0x0400, 0x0600, 0x0800, 0x0700, 0x0800, 0x0400, 0x1800
static const s16 sPitch7_4[] = {
0x0300, 0x0400, 0x0600, 0x0800, 0x0700, 0x0800, 0x0400, PITCH_END
};
const s16 *const gBardSoundPitchTables[] = {
gUnknown_0860A1C0,
gUnknown_0860A1C4,
gUnknown_0860A1C8,
gUnknown_0860A1CC,
gUnknown_0860A1D0,
gUnknown_0860A1D4,
gUnknown_0860A1DA,
gUnknown_0860A1E0,
gUnknown_0860A1E6,
gUnknown_0860A1EC,
gUnknown_0860A1F2,
gUnknown_0860A1FA,
gUnknown_0860A202,
gUnknown_0860A20A,
gUnknown_0860A212,
gUnknown_0860A21A,
gUnknown_0860A224,
gUnknown_0860A22E,
gUnknown_0860A238,
gUnknown_0860A242,
gUnknown_0860A24C,
gUnknown_0860A258,
gUnknown_0860A264,
gUnknown_0860A270,
gUnknown_0860A27C,
gUnknown_0860A288,
gUnknown_0860A296,
gUnknown_0860A2A4,
gUnknown_0860A2B2,
gUnknown_0860A2C0,
gUnknown_0860A2CE,
gUnknown_0860A2DE,
gUnknown_0860A2EE,
gUnknown_0860A2FE,
gUnknown_0860A30E
// Only sPitch7_# are used below
// This table is always indexed with (x + 30), where x is some value 0 - 4
static const s16 *const sBardSoundPitchTables[] = {
sPitch1_0,
sPitch1_1,
sPitch1_2,
sPitch1_3,
sPitch1_4,
sPitch2_0,
sPitch2_1,
sPitch2_2,
sPitch2_3,
sPitch2_4,
sPitch3_0,
sPitch3_1,
sPitch3_2,
sPitch3_3,
sPitch3_4,
sPitch4_0,
sPitch4_1,
sPitch4_2,
sPitch4_3,
sPitch4_4,
sPitch5_0,
sPitch5_1,
sPitch5_2,
sPitch5_3,
sPitch5_4,
sPitch6_0,
sPitch6_1,
sPitch6_2,
sPitch6_3,
sPitch6_4,
sPitch7_0,
sPitch7_1,
sPitch7_2,
sPitch7_3,
sPitch7_4
};

View File

@ -4876,7 +4876,7 @@ bool8 sub_811EAA4(u16 easyChatWord)
}
}
bool8 ECWord_CheckIfOutsideOfValidRange(u16 easyChatWord)
bool8 IsBardWordInvalid(u16 easyChatWord)
{
int numWordsInGroup;
u8 groupId = EC_GROUP(easyChatWord);
@ -4888,11 +4888,11 @@ bool8 ECWord_CheckIfOutsideOfValidRange(u16 easyChatWord)
{
case EC_GROUP_POKEMON:
case EC_GROUP_POKEMON_2:
numWordsInGroup = gNumSpeciesNames;
numWordsInGroup = gNumBardWords_Species;
break;
case EC_GROUP_MOVE_1:
case EC_GROUP_MOVE_2:
numWordsInGroup = gUnknown_085FA1D4;
numWordsInGroup = gNumBardWords_Moves;
break;
default:
numWordsInGroup = gEasyChatGroups[groupId].numWords;