From 544b76fbbf66cd2019d4b068e40de4a693e95e79 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 21 Oct 2024 08:58:49 -0400 Subject: [PATCH] Added value for bard sound length --- include/bard_music.h | 6 ++++-- src/bard_music.c | 2 +- src/data/bard_music/moves.h | 2 +- src/data/bard_music/pokemon.h | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/bard_music.h b/include/bard_music.h index 2942fa8e47..b1d051b8d7 100644 --- a/include/bard_music.h +++ b/include/bard_music.h @@ -1,6 +1,8 @@ #ifndef GUARD_BARD_MUSIC_H #define GUARD_BARD_MUSIC_H +#define BARD_SOUND_MAX_LENGTH 6 + struct BardSound { /*0x00*/ u8 songLengthId; @@ -26,8 +28,8 @@ struct BardSong /*0x06*/ u16 volume; /*0x08*/ s16 pitch; /*0x0A*/ s16 voiceInflection; - /*0x0C*/ u16 lyrics[6]; - /*0x18*/ struct BardPhoneme phonemes[6]; + /*0x0C*/ u16 lyrics[BARD_SOUND_MAX_LENGTH]; + /*0x18*/ struct BardPhoneme phonemes[BARD_SOUND_MAX_LENGTH]; /*0x30*/ const struct BardSound *sound; }; diff --git a/src/bard_music.c b/src/bard_music.c index 165b4fe770..369a2767d1 100644 --- a/src/bard_music.c +++ b/src/bard_music.c @@ -48,7 +48,7 @@ void GetWordPhonemes(struct BardSong *song, u16 word) const struct BardSound *sound; song->length = 0; - for (i = 0; i < 6; i ++) + for (i = 0; i < BARD_SOUND_MAX_LENGTH; i ++) { sound = &song->sound[i]; if (sound->songLengthId != 0xFF) diff --git a/src/data/bard_music/moves.h b/src/data/bard_music/moves.h index 6c658cd4a0..31c3395fcd 100644 --- a/src/data/bard_music/moves.h +++ b/src/data/bard_music/moves.h @@ -5,7 +5,7 @@ const u16 gNumBardWords_Moves = MOVES_COUNT; -const struct BardSound gBardSounds_Moves[MOVES_COUNT][6] = { +const struct BardSound gBardSounds_Moves[MOVES_COUNT][BARD_SOUND_MAX_LENGTH] = { [MOVE_NONE] = { NULL_BARD_SOUND, NULL_BARD_SOUND, diff --git a/src/data/bard_music/pokemon.h b/src/data/bard_music/pokemon.h index 57ab426590..b3a67a24ed 100644 --- a/src/data/bard_music/pokemon.h +++ b/src/data/bard_music/pokemon.h @@ -3,7 +3,7 @@ const u16 gNumBardWords_Species = NUM_SPECIES; -const struct BardSound gBardSounds_Pokemon[NUM_SPECIES][6] = { +const struct BardSound gBardSounds_Pokemon[NUM_SPECIES][BARD_SOUND_MAX_LENGTH] = { [SPECIES_NONE] = { NULL_BARD_SOUND, NULL_BARD_SOUND,