Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added define value for bard sound length #2052

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/bard_music.h
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion src/bard_music.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/data/bard_music/moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/data/bard_music/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down