From 92bb44fca1074c663b512d50fac2f4f3b44e8362 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 9 Jun 2024 17:40:03 +0200 Subject: [PATCH 1/3] Add config to turn off two-framed front sprites --- include/config/pokemon.h | 1 + src/data/pokemon_graphics/front_pic_anims.h | 2 -- src/pokemon.c | 2 +- src/trainer_pokemon_sprites.c | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/config/pokemon.h b/include/config/pokemon.h index 18f9c28e459d..fd5cac2a8d7a 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -46,6 +46,7 @@ #define P_SHOW_TERA_TYPE GEN_8 // Since Gen 9, the Tera Type is shown on the summary screen. #define P_TM_LITERACY GEN_LATEST // Since Gen 6, TM illiterate Pokémon can learn TMs that teach moves that are in their level-up learnsets. #define P_EGG_CYCLE_LENGTH GEN_LATEST // Since Gen 8, egg cycles take half as many steps as before. +#define P_TWO_FRAME_FRONT_SPRITES FALSE // In Pokémon Emerald, Pokémon front sprites always consist of two frames. This config can revert it to only use the first frame, as is the case in the other Gen 3 games. // Learnset helper toggles #define P_LEARNSET_HELPER_TEACHABLE TRUE // If TRUE, teachable_learnsets.h will be populated by tools/learnset_helpers/teachable.py using the included JSON files based on available TMs and tutors. diff --git a/src/data/pokemon_graphics/front_pic_anims.h b/src/data/pokemon_graphics/front_pic_anims.h index d802521afe57..05213d34191e 100644 --- a/src/data/pokemon_graphics/front_pic_anims.h +++ b/src/data/pokemon_graphics/front_pic_anims.h @@ -16,8 +16,6 @@ static const union AnimCmd sAnim_##name##_1[] = \ static const union AnimCmd sAnim_None_1[] = { - ANIMCMD_FRAME(0, 30), - ANIMCMD_FRAME(1, 30), ANIMCMD_FRAME(0, 1), ANIMCMD_END, }; diff --git a/src/pokemon.c b/src/pokemon.c index a706c9578697..7d0478e56478 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2199,7 +2199,7 @@ void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition) speciesTag = speciesTag - SPECIES_SHINY_TAG; speciesTag = SanitizeSpeciesId(speciesTag); - if (gSpeciesInfo[speciesTag].frontAnimFrames != NULL) + if (P_TWO_FRAME_FRONT_SPRITES && gSpeciesInfo[speciesTag].frontAnimFrames != NULL) gMultiuseSpriteTemplate.anims = gSpeciesInfo[speciesTag].frontAnimFrames; else gMultiuseSpriteTemplate.anims = gSpeciesInfo[SPECIES_NONE].frontAnimFrames; diff --git a/src/trainer_pokemon_sprites.c b/src/trainer_pokemon_sprites.c index 675c7643c805..5b7fd839eaa0 100644 --- a/src/trainer_pokemon_sprites.c +++ b/src/trainer_pokemon_sprites.c @@ -221,7 +221,7 @@ u16 CreateMonPicSprite_Affine(u16 species, bool8 isShiny, u32 personality, u8 fl images[j].size = MON_PIC_SIZE; } sCreatingSpriteTemplate.tileTag = TAG_NONE; - sCreatingSpriteTemplate.anims = gSpeciesInfo[species].frontAnimFrames; + sCreatingSpriteTemplate.anims = gSpeciesInfo[P_TWO_FRAME_FRONT_SPRITES ? species : SPECIES_NONE].frontAnimFrames; sCreatingSpriteTemplate.images = images; if (type == MON_PIC_AFFINE_FRONT) { From 074f0af05a996ae04e1a0eec48b60221e7d8bc71 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 9 Jun 2024 17:42:03 +0200 Subject: [PATCH 2/3] Two frames should be on by default --- include/config/pokemon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/config/pokemon.h b/include/config/pokemon.h index fd5cac2a8d7a..3aa4b14db548 100644 --- a/include/config/pokemon.h +++ b/include/config/pokemon.h @@ -46,7 +46,7 @@ #define P_SHOW_TERA_TYPE GEN_8 // Since Gen 9, the Tera Type is shown on the summary screen. #define P_TM_LITERACY GEN_LATEST // Since Gen 6, TM illiterate Pokémon can learn TMs that teach moves that are in their level-up learnsets. #define P_EGG_CYCLE_LENGTH GEN_LATEST // Since Gen 8, egg cycles take half as many steps as before. -#define P_TWO_FRAME_FRONT_SPRITES FALSE // In Pokémon Emerald, Pokémon front sprites always consist of two frames. This config can revert it to only use the first frame, as is the case in the other Gen 3 games. +#define P_TWO_FRAME_FRONT_SPRITES TRUE // In Pokémon Emerald, Pokémon front sprites always consist of two frames. This config can revert it to only use the first frame, as is the case in the other Gen 3 games. // Learnset helper toggles #define P_LEARNSET_HELPER_TEACHABLE TRUE // If TRUE, teachable_learnsets.h will be populated by tools/learnset_helpers/teachable.py using the included JSON files based on available TMs and tutors. From ea6a1ab9b74eb1ef311f719cd62a682803ae498a Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Sun, 9 Jun 2024 18:17:35 +0200 Subject: [PATCH 3/3] Simplifies integration --- src/data/pokemon_graphics/front_pic_anims.h | 2 ++ src/pokemon.c | 4 ++-- src/trainer_pokemon_sprites.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/data/pokemon_graphics/front_pic_anims.h b/src/data/pokemon_graphics/front_pic_anims.h index 05213d34191e..d802521afe57 100644 --- a/src/data/pokemon_graphics/front_pic_anims.h +++ b/src/data/pokemon_graphics/front_pic_anims.h @@ -16,6 +16,8 @@ static const union AnimCmd sAnim_##name##_1[] = \ static const union AnimCmd sAnim_None_1[] = { + ANIMCMD_FRAME(0, 30), + ANIMCMD_FRAME(1, 30), ANIMCMD_FRAME(0, 1), ANIMCMD_END, }; diff --git a/src/pokemon.c b/src/pokemon.c index 7d0478e56478..3f0f9f363af8 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2199,7 +2199,7 @@ void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition) speciesTag = speciesTag - SPECIES_SHINY_TAG; speciesTag = SanitizeSpeciesId(speciesTag); - if (P_TWO_FRAME_FRONT_SPRITES && gSpeciesInfo[speciesTag].frontAnimFrames != NULL) + if (gSpeciesInfo[speciesTag].frontAnimFrames != NULL) gMultiuseSpriteTemplate.anims = gSpeciesInfo[speciesTag].frontAnimFrames; else gMultiuseSpriteTemplate.anims = gSpeciesInfo[SPECIES_NONE].frontAnimFrames; @@ -6220,7 +6220,7 @@ void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality) bool8 HasTwoFramesAnimation(u16 species) { - return species != SPECIES_UNOWN; + return P_TWO_FRAME_FRONT_SPRITES && species != SPECIES_UNOWN; } static bool8 ShouldSkipFriendshipChange(void) diff --git a/src/trainer_pokemon_sprites.c b/src/trainer_pokemon_sprites.c index 5b7fd839eaa0..675c7643c805 100644 --- a/src/trainer_pokemon_sprites.c +++ b/src/trainer_pokemon_sprites.c @@ -221,7 +221,7 @@ u16 CreateMonPicSprite_Affine(u16 species, bool8 isShiny, u32 personality, u8 fl images[j].size = MON_PIC_SIZE; } sCreatingSpriteTemplate.tileTag = TAG_NONE; - sCreatingSpriteTemplate.anims = gSpeciesInfo[P_TWO_FRAME_FRONT_SPRITES ? species : SPECIES_NONE].frontAnimFrames; + sCreatingSpriteTemplate.anims = gSpeciesInfo[species].frontAnimFrames; sCreatingSpriteTemplate.images = images; if (type == MON_PIC_AFFINE_FRONT) {