Skip to content

Commit

Permalink
Added option to disable species cries (#4791)
Browse files Browse the repository at this point in the history
* Added option to disable cries

* Update src/pokemon.c

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
  • Loading branch information
AsparagusEduardo and Bassoonian authored Jun 15, 2024
1 parent e5e38c1 commit 1eb0b32
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/config/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
// Other settings
#define P_CUSTOM_GENDER_DIFF_ICONS TRUE // If TRUE, will give more Pokémon custom icons for their female forms, i.e. Hippopotas and Hippowdon
#define P_FOOTPRINTS TRUE // If TRUE, Pokémon will have footprints (as was the case up to Gen 5 and in BDSP). Disabling this saves some ROM space.
#define P_CRIES_ENABLED TRUE // If TRUE, Pokémon will have cries. Disabling this saves around a LOT of ROM space (over 25%!), but instead we recommend disabling individual unused Pokémon families in include/config/species_enabled.h.
#define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs.
#define P_EV_CAP GEN_LATEST // Since Gen 6, the max EVs per stat is 252 instead of 255.
#define P_SHOW_TERA_TYPE GEN_8 // Since Gen 9, the Tera Type is shown on the summary screen.
Expand Down
4 changes: 4 additions & 0 deletions sound/cry_tables.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.align 2
gCryTable::
.if P_CRIES_ENABLED == TRUE
.if P_FAMILY_BULBASAUR == TRUE
cry Cry_Bulbasaur
cry Cry_Ivysaur
Expand Down Expand Up @@ -2423,9 +2424,11 @@ gCryTable::
.if P_FAMILY_PECHARUNT == TRUE
cry Cry_Pecharunt
.endif @ P_FAMILY_PECHARUNT
.endif @ P_CRIES_ENABLED

.align 2
gCryTable_Reverse::
.if P_CRIES_ENABLED == TRUE
.if P_FAMILY_BULBASAUR == TRUE
cry_reverse Cry_Bulbasaur
cry_reverse Cry_Ivysaur
Expand Down Expand Up @@ -4849,3 +4852,4 @@ gCryTable_Reverse::
.if P_FAMILY_PECHARUNT == TRUE
cry_reverse Cry_Pecharunt
.endif @ P_FAMILY_PECHARUNT
.endif @ P_CRIES_ENABLED
2 changes: 2 additions & 0 deletions sound/direct_sound_data.inc
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ DirectSoundWaveData_unknown_16::
DirectSoundWaveData_unknown_17::
.incbin "sound/direct_sound_samples/unknown_17.bin"

.if P_CRIES_ENABLED == TRUE
.if P_FAMILY_BULBASAUR == TRUE
.align 2
Cry_Bulbasaur::
Expand Down Expand Up @@ -6153,6 +6154,7 @@ Cry_Terapagos::
Cry_Pecharunt::
.incbin "sound/direct_sound_samples/cries/pecharunt.bin"
.endif @ P_FAMILY_PECHARUNT
.endif @ P_CRIES_ENABLED

.align 2
DirectSoundWaveData_register_noise::
Expand Down
4 changes: 2 additions & 2 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -6828,8 +6828,8 @@ void HealBoxPokemon(struct BoxPokemon *boxMon)
u16 GetCryIdBySpecies(u16 species)
{
species = SanitizeSpeciesId(species);
if (gSpeciesInfo[species].cryId >= CRY_COUNT)
return 0;
if (P_CRIES_ENABLED == FALSE || gSpeciesInfo[species].cryId >= CRY_COUNT)
return CRY_NONE;
return gSpeciesInfo[species].cryId;
}

Expand Down
3 changes: 2 additions & 1 deletion src/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "m4a.h"
#include "main.h"
#include "pokemon.h"
#include "constants/cries.h"
#include "constants/songs.h"
#include "task.h"

Expand Down Expand Up @@ -460,7 +461,7 @@ void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode)
SetPokemonCryPriority(priority);

species = GetCryIdBySpecies(species);
if (species != 0)
if (species != CRY_NONE)
{
species--;
gMPlay_PokemonCry = SetPokemonCryTone(reverse ? &gCryTable_Reverse[species] : &gCryTable[species]);
Expand Down

0 comments on commit 1eb0b32

Please sign in to comment.