diff options
-rw-r--r-- | graphics/trainers/front_pics/cooltrainer_f_front_pic.png (renamed from graphics/trainers/front_pics/cool_trainer_f_front_pic.png) | bin | 681 -> 681 bytes | |||
-rw-r--r-- | graphics/trainers/front_pics/cooltrainer_m_front_pic.png (renamed from graphics/trainers/front_pics/cool_trainer_m_front_pic.png) | bin | 627 -> 627 bytes | |||
-rw-r--r-- | graphics/trainers/palettes/cooltrainer_f.pal (renamed from graphics/trainers/palettes/cool_trainer_f.pal) | 0 | ||||
-rw-r--r-- | graphics/trainers/palettes/cooltrainer_m.pal (renamed from graphics/trainers/palettes/cool_trainer_m.pal) | 0 | ||||
-rw-r--r-- | include/constants/species.h | 156 | ||||
-rw-r--r-- | src/data.c | 5 | ||||
-rw-r--r-- | src/data/graphics/trainers.h | 8 | ||||
-rw-r--r-- | src/data/trainer_graphics/back_pic_tables.h | 20 | ||||
-rw-r--r-- | src/data/trainer_graphics/front_pic_tables.h | 4 | ||||
-rw-r--r-- | src/daycare.c | 14 | ||||
-rw-r--r-- | src/menu.c | 43 |
11 files changed, 128 insertions, 122 deletions
diff --git a/graphics/trainers/front_pics/cool_trainer_f_front_pic.png b/graphics/trainers/front_pics/cooltrainer_f_front_pic.png Binary files differindex 572aa811a..572aa811a 100644 --- a/graphics/trainers/front_pics/cool_trainer_f_front_pic.png +++ b/graphics/trainers/front_pics/cooltrainer_f_front_pic.png diff --git a/graphics/trainers/front_pics/cool_trainer_m_front_pic.png b/graphics/trainers/front_pics/cooltrainer_m_front_pic.png Binary files differindex 6b998992e..6b998992e 100644 --- a/graphics/trainers/front_pics/cool_trainer_m_front_pic.png +++ b/graphics/trainers/front_pics/cooltrainer_m_front_pic.png diff --git a/graphics/trainers/palettes/cool_trainer_f.pal b/graphics/trainers/palettes/cooltrainer_f.pal index 292d0fc78..292d0fc78 100644 --- a/graphics/trainers/palettes/cool_trainer_f.pal +++ b/graphics/trainers/palettes/cooltrainer_f.pal diff --git a/graphics/trainers/palettes/cool_trainer_m.pal b/graphics/trainers/palettes/cooltrainer_m.pal index 52a32e925..52a32e925 100644 --- a/graphics/trainers/palettes/cool_trainer_m.pal +++ b/graphics/trainers/palettes/cooltrainer_m.pal diff --git a/include/constants/species.h b/include/constants/species.h index 8fa5cf77b..983e1a796 100644 --- a/include/constants/species.h +++ b/include/constants/species.h @@ -417,36 +417,36 @@ #define SPECIES_CHIMECHO 411 #define SPECIES_EGG 412 -#define SPECIES_UNOWN_B 413 -#define SPECIES_UNOWN_C 414 -#define SPECIES_UNOWN_D 415 -#define SPECIES_UNOWN_E 416 -#define SPECIES_UNOWN_F 417 -#define SPECIES_UNOWN_G 418 -#define SPECIES_UNOWN_H 419 -#define SPECIES_UNOWN_I 420 -#define SPECIES_UNOWN_J 421 -#define SPECIES_UNOWN_K 422 -#define SPECIES_UNOWN_L 423 -#define SPECIES_UNOWN_M 424 -#define SPECIES_UNOWN_N 425 -#define SPECIES_UNOWN_O 426 -#define SPECIES_UNOWN_P 427 -#define SPECIES_UNOWN_Q 428 -#define SPECIES_UNOWN_R 429 -#define SPECIES_UNOWN_S 430 -#define SPECIES_UNOWN_T 431 -#define SPECIES_UNOWN_U 432 -#define SPECIES_UNOWN_V 433 -#define SPECIES_UNOWN_W 434 -#define SPECIES_UNOWN_X 435 -#define SPECIES_UNOWN_Y 436 -#define SPECIES_UNOWN_Z 437 -#define SPECIES_UNOWN_EMARK 438 -#define SPECIES_UNOWN_QMARK 439 - #define NUM_SPECIES SPECIES_EGG +#define SPECIES_UNOWN_B (NUM_SPECIES + 1) +#define SPECIES_UNOWN_C (SPECIES_UNOWN_B + 1) +#define SPECIES_UNOWN_D (SPECIES_UNOWN_B + 2) +#define SPECIES_UNOWN_E (SPECIES_UNOWN_B + 3) +#define SPECIES_UNOWN_F (SPECIES_UNOWN_B + 4) +#define SPECIES_UNOWN_G (SPECIES_UNOWN_B + 5) +#define SPECIES_UNOWN_H (SPECIES_UNOWN_B + 6) +#define SPECIES_UNOWN_I (SPECIES_UNOWN_B + 7) +#define SPECIES_UNOWN_J (SPECIES_UNOWN_B + 8) +#define SPECIES_UNOWN_K (SPECIES_UNOWN_B + 9) +#define SPECIES_UNOWN_L (SPECIES_UNOWN_B + 10) +#define SPECIES_UNOWN_M (SPECIES_UNOWN_B + 11) +#define SPECIES_UNOWN_N (SPECIES_UNOWN_B + 12) +#define SPECIES_UNOWN_O (SPECIES_UNOWN_B + 13) +#define SPECIES_UNOWN_P (SPECIES_UNOWN_B + 14) +#define SPECIES_UNOWN_Q (SPECIES_UNOWN_B + 15) +#define SPECIES_UNOWN_R (SPECIES_UNOWN_B + 16) +#define SPECIES_UNOWN_S (SPECIES_UNOWN_B + 17) +#define SPECIES_UNOWN_T (SPECIES_UNOWN_B + 18) +#define SPECIES_UNOWN_U (SPECIES_UNOWN_B + 19) +#define SPECIES_UNOWN_V (SPECIES_UNOWN_B + 20) +#define SPECIES_UNOWN_W (SPECIES_UNOWN_B + 21) +#define SPECIES_UNOWN_X (SPECIES_UNOWN_B + 22) +#define SPECIES_UNOWN_Y (SPECIES_UNOWN_B + 23) +#define SPECIES_UNOWN_Z (SPECIES_UNOWN_B + 24) +#define SPECIES_UNOWN_EMARK (SPECIES_UNOWN_B + 25) +#define SPECIES_UNOWN_QMARK (SPECIES_UNOWN_B + 26) + // National Dex Index Defines #define NATIONAL_DEX_NONE 0 @@ -845,31 +845,31 @@ #define NATIONAL_DEX_COUNT NATIONAL_DEX_DEOXYS -#define NATIONAL_DEX_OLD_UNOWN_B 387 -#define NATIONAL_DEX_OLD_UNOWN_C 388 -#define NATIONAL_DEX_OLD_UNOWN_D 389 -#define NATIONAL_DEX_OLD_UNOWN_E 390 -#define NATIONAL_DEX_OLD_UNOWN_F 391 -#define NATIONAL_DEX_OLD_UNOWN_G 392 -#define NATIONAL_DEX_OLD_UNOWN_H 393 -#define NATIONAL_DEX_OLD_UNOWN_I 394 -#define NATIONAL_DEX_OLD_UNOWN_J 395 -#define NATIONAL_DEX_OLD_UNOWN_K 396 -#define NATIONAL_DEX_OLD_UNOWN_L 397 -#define NATIONAL_DEX_OLD_UNOWN_M 398 -#define NATIONAL_DEX_OLD_UNOWN_N 399 -#define NATIONAL_DEX_OLD_UNOWN_O 400 -#define NATIONAL_DEX_OLD_UNOWN_P 401 -#define NATIONAL_DEX_OLD_UNOWN_Q 402 -#define NATIONAL_DEX_OLD_UNOWN_R 403 -#define NATIONAL_DEX_OLD_UNOWN_S 404 -#define NATIONAL_DEX_OLD_UNOWN_T 405 -#define NATIONAL_DEX_OLD_UNOWN_U 406 -#define NATIONAL_DEX_OLD_UNOWN_V 407 -#define NATIONAL_DEX_OLD_UNOWN_W 408 -#define NATIONAL_DEX_OLD_UNOWN_X 409 -#define NATIONAL_DEX_OLD_UNOWN_Y 410 -#define NATIONAL_DEX_OLD_UNOWN_Z 411 +#define NATIONAL_DEX_OLD_UNOWN_B (NATIONAL_DEX_COUNT + 1) +#define NATIONAL_DEX_OLD_UNOWN_C (NATIONAL_DEX_OLD_UNOWN_B + 1) +#define NATIONAL_DEX_OLD_UNOWN_D (NATIONAL_DEX_OLD_UNOWN_B + 2) +#define NATIONAL_DEX_OLD_UNOWN_E (NATIONAL_DEX_OLD_UNOWN_B + 3) +#define NATIONAL_DEX_OLD_UNOWN_F (NATIONAL_DEX_OLD_UNOWN_B + 4) +#define NATIONAL_DEX_OLD_UNOWN_G (NATIONAL_DEX_OLD_UNOWN_B + 5) +#define NATIONAL_DEX_OLD_UNOWN_H (NATIONAL_DEX_OLD_UNOWN_B + 6) +#define NATIONAL_DEX_OLD_UNOWN_I (NATIONAL_DEX_OLD_UNOWN_B + 7) +#define NATIONAL_DEX_OLD_UNOWN_J (NATIONAL_DEX_OLD_UNOWN_B + 8) +#define NATIONAL_DEX_OLD_UNOWN_K (NATIONAL_DEX_OLD_UNOWN_B + 9) +#define NATIONAL_DEX_OLD_UNOWN_L (NATIONAL_DEX_OLD_UNOWN_B + 10) +#define NATIONAL_DEX_OLD_UNOWN_M (NATIONAL_DEX_OLD_UNOWN_B + 11) +#define NATIONAL_DEX_OLD_UNOWN_N (NATIONAL_DEX_OLD_UNOWN_B + 12) +#define NATIONAL_DEX_OLD_UNOWN_O (NATIONAL_DEX_OLD_UNOWN_B + 13) +#define NATIONAL_DEX_OLD_UNOWN_P (NATIONAL_DEX_OLD_UNOWN_B + 14) +#define NATIONAL_DEX_OLD_UNOWN_Q (NATIONAL_DEX_OLD_UNOWN_B + 15) +#define NATIONAL_DEX_OLD_UNOWN_R (NATIONAL_DEX_OLD_UNOWN_B + 16) +#define NATIONAL_DEX_OLD_UNOWN_S (NATIONAL_DEX_OLD_UNOWN_B + 17) +#define NATIONAL_DEX_OLD_UNOWN_T (NATIONAL_DEX_OLD_UNOWN_B + 18) +#define NATIONAL_DEX_OLD_UNOWN_U (NATIONAL_DEX_OLD_UNOWN_B + 19) +#define NATIONAL_DEX_OLD_UNOWN_V (NATIONAL_DEX_OLD_UNOWN_B + 20) +#define NATIONAL_DEX_OLD_UNOWN_W (NATIONAL_DEX_OLD_UNOWN_B + 21) +#define NATIONAL_DEX_OLD_UNOWN_X (NATIONAL_DEX_OLD_UNOWN_B + 22) +#define NATIONAL_DEX_OLD_UNOWN_Y (NATIONAL_DEX_OLD_UNOWN_B + 23) +#define NATIONAL_DEX_OLD_UNOWN_Z (NATIONAL_DEX_OLD_UNOWN_B + 24) // Hoenn Dex Index Defines @@ -1264,30 +1264,30 @@ #define HOENN_DEX_HO_OH 385 #define HOENN_DEX_CELEBI 386 -#define HOENN_DEX_OLD_UNOWN_B 387 -#define HOENN_DEX_OLD_UNOWN_C 388 -#define HOENN_DEX_OLD_UNOWN_D 389 -#define HOENN_DEX_OLD_UNOWN_E 390 -#define HOENN_DEX_OLD_UNOWN_F 391 -#define HOENN_DEX_OLD_UNOWN_G 392 -#define HOENN_DEX_OLD_UNOWN_H 393 -#define HOENN_DEX_OLD_UNOWN_I 394 -#define HOENN_DEX_OLD_UNOWN_J 395 -#define HOENN_DEX_OLD_UNOWN_K 396 -#define HOENN_DEX_OLD_UNOWN_L 397 -#define HOENN_DEX_OLD_UNOWN_M 398 -#define HOENN_DEX_OLD_UNOWN_N 399 -#define HOENN_DEX_OLD_UNOWN_O 400 -#define HOENN_DEX_OLD_UNOWN_P 401 -#define HOENN_DEX_OLD_UNOWN_Q 402 -#define HOENN_DEX_OLD_UNOWN_R 403 -#define HOENN_DEX_OLD_UNOWN_S 404 -#define HOENN_DEX_OLD_UNOWN_T 405 -#define HOENN_DEX_OLD_UNOWN_U 406 -#define HOENN_DEX_OLD_UNOWN_V 407 -#define HOENN_DEX_OLD_UNOWN_W 408 -#define HOENN_DEX_OLD_UNOWN_X 409 -#define HOENN_DEX_OLD_UNOWN_Y 410 -#define HOENN_DEX_OLD_UNOWN_Z 411 +#define HOENN_DEX_OLD_UNOWN_B (HOENN_DEX_CELEBI + 1) +#define HOENN_DEX_OLD_UNOWN_C (HOENN_DEX_OLD_UNOWN_B + 1) +#define HOENN_DEX_OLD_UNOWN_D (HOENN_DEX_OLD_UNOWN_B + 2) +#define HOENN_DEX_OLD_UNOWN_E (HOENN_DEX_OLD_UNOWN_B + 3) +#define HOENN_DEX_OLD_UNOWN_F (HOENN_DEX_OLD_UNOWN_B + 4) +#define HOENN_DEX_OLD_UNOWN_G (HOENN_DEX_OLD_UNOWN_B + 5) +#define HOENN_DEX_OLD_UNOWN_H (HOENN_DEX_OLD_UNOWN_B + 6) +#define HOENN_DEX_OLD_UNOWN_I (HOENN_DEX_OLD_UNOWN_B + 7) +#define HOENN_DEX_OLD_UNOWN_J (HOENN_DEX_OLD_UNOWN_B + 8) +#define HOENN_DEX_OLD_UNOWN_K (HOENN_DEX_OLD_UNOWN_B + 9) +#define HOENN_DEX_OLD_UNOWN_L (HOENN_DEX_OLD_UNOWN_B + 10) +#define HOENN_DEX_OLD_UNOWN_M (HOENN_DEX_OLD_UNOWN_B + 11) +#define HOENN_DEX_OLD_UNOWN_N (HOENN_DEX_OLD_UNOWN_B + 12) +#define HOENN_DEX_OLD_UNOWN_O (HOENN_DEX_OLD_UNOWN_B + 13) +#define HOENN_DEX_OLD_UNOWN_P (HOENN_DEX_OLD_UNOWN_B + 14) +#define HOENN_DEX_OLD_UNOWN_Q (HOENN_DEX_OLD_UNOWN_B + 15) +#define HOENN_DEX_OLD_UNOWN_R (HOENN_DEX_OLD_UNOWN_B + 16) +#define HOENN_DEX_OLD_UNOWN_S (HOENN_DEX_OLD_UNOWN_B + 17) +#define HOENN_DEX_OLD_UNOWN_T (HOENN_DEX_OLD_UNOWN_B + 18) +#define HOENN_DEX_OLD_UNOWN_U (HOENN_DEX_OLD_UNOWN_B + 19) +#define HOENN_DEX_OLD_UNOWN_V (HOENN_DEX_OLD_UNOWN_B + 20) +#define HOENN_DEX_OLD_UNOWN_W (HOENN_DEX_OLD_UNOWN_B + 21) +#define HOENN_DEX_OLD_UNOWN_X (HOENN_DEX_OLD_UNOWN_B + 22) +#define HOENN_DEX_OLD_UNOWN_Y (HOENN_DEX_OLD_UNOWN_B + 23) +#define HOENN_DEX_OLD_UNOWN_Z (HOENN_DEX_OLD_UNOWN_B + 24) #endif // GUARD_CONSTANTS_SPECIES_H diff --git a/src/data.c b/src/data.c index 29d1835ac..4861da18b 100644 --- a/src/data.c +++ b/src/data.c @@ -295,11 +295,6 @@ const union AnimCmd *const gUnknown_082FF70C[] = #define SPECIES_PAL(species, pal) [SPECIES_##species] = {pal, SPECIES_##species} #define SPECIES_SHINY_PAL(species, pal) [SPECIES_##species] = {pal, SPECIES_##species + SPECIES_SHINY_TAG} -#define TRAINER_SPRITE(trainerPic, sprite, size) [TRAINER_PIC_##trainerPic] = {sprite, size, TRAINER_PIC_##trainerPic} -#define TRAINER_PAL(trainerPic, pal) [TRAINER_PIC_##trainerPic] = {pal, TRAINER_PIC_##trainerPic} - -#define TRAINER_BACK_PAL(trainerPic, pal) [TRAINER_BACK_PIC_##trainerPic] = {pal, TRAINER_BACK_PIC_##trainerPic} - #include "data/pokemon_graphics/unknown_anims.h" #include "data/pokemon_graphics/front_pic_coordinates.h" #include "data/pokemon_graphics/still_front_pic_table.h" diff --git a/src/data/graphics/trainers.h b/src/data/graphics/trainers.h index 3de77d6ec..206d73a88 100644 --- a/src/data/graphics/trainers.h +++ b/src/data/graphics/trainers.h @@ -7,8 +7,8 @@ const u32 gTrainerPalette_AquaGruntM[] = INCBIN_U32("graphics/trainers/palettes/ const u32 gTrainerFrontPic_PokemonBreederF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_f_front_pic.4bpp.lz"); const u32 gTrainerPalette_PokemonBreederF[] = INCBIN_U32("graphics/trainers/palettes/pokemon_breeder_f.gbapal.lz"); -const u32 gTrainerFrontPic_CoolTrainerM[] = INCBIN_U32("graphics/trainers/front_pics/cool_trainer_m_front_pic.4bpp.lz"); -const u32 gTrainerPalette_CoolTrainerM[] = INCBIN_U32("graphics/trainers/palettes/cool_trainer_m.gbapal.lz"); +const u32 gTrainerFrontPic_CoolTrainerM[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_m_front_pic.4bpp.lz"); +const u32 gTrainerPalette_CoolTrainerM[] = INCBIN_U32("graphics/trainers/palettes/cooltrainer_m.gbapal.lz"); const u32 gTrainerFrontPic_BirdKeeper[] = INCBIN_U32("graphics/trainers/front_pics/bird_keeper_front_pic.4bpp.lz"); const u32 gTrainerPalette_BirdKeeper[] = INCBIN_U32("graphics/trainers/palettes/bird_keeper.gbapal.lz"); @@ -58,8 +58,8 @@ const u32 gTrainerPalette_TuberF[] = INCBIN_U32("graphics/trainers/palettes/tube const u32 gTrainerFrontPic_TuberM[] = INCBIN_U32("graphics/trainers/front_pics/tuber_m_front_pic.4bpp.lz"); const u32 gTrainerPalette_TuberM[] = INCBIN_U32("graphics/trainers/palettes/tuber_m.gbapal.lz"); -const u32 gTrainerFrontPic_CoolTrainerF[] = INCBIN_U32("graphics/trainers/front_pics/cool_trainer_f_front_pic.4bpp.lz"); -const u32 gTrainerPalette_CoolTrainerF[] = INCBIN_U32("graphics/trainers/palettes/cool_trainer_f.gbapal.lz"); +const u32 gTrainerFrontPic_CoolTrainerF[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_f_front_pic.4bpp.lz"); +const u32 gTrainerPalette_CoolTrainerF[] = INCBIN_U32("graphics/trainers/palettes/cooltrainer_f.gbapal.lz"); const u32 gTrainerFrontPic_Lady[] = INCBIN_U32("graphics/trainers/front_pics/lady_front_pic.4bpp.lz"); const u32 gTrainerPalette_Lady[] = INCBIN_U32("graphics/trainers/palettes/lady.gbapal.lz"); diff --git a/src/data/trainer_graphics/back_pic_tables.h b/src/data/trainer_graphics/back_pic_tables.h index 86efd7905..1dbffba42 100644 --- a/src/data/trainer_graphics/back_pic_tables.h +++ b/src/data/trainer_graphics/back_pic_tables.h @@ -13,18 +13,22 @@ const struct MonCoords gTrainerBackPicCoords[] = // this table goes functionally unused, since none of these pics are compressed // and the place they would get extracted to gets overwritten later anyway // the casts are so they'll play nice with the strict struct definition +#define TRAINER_BACK_SPRITE(trainerPic, sprite, size) [TRAINER_BACK_PIC_##trainerPic] = {(const u32 *)sprite, size, TRAINER_BACK_PIC_##trainerPic} + const struct CompressedSpriteSheet gTrainerBackPicTable[] = { - (const u32 *)gTrainerBackPic_Brendan, 0x2000, TRAINER_BACK_PIC_BRENDAN, - (const u32 *)gTrainerBackPic_May, 0x2000, TRAINER_BACK_PIC_MAY, - (const u32 *)gTrainerBackPic_Red, 0x2800, TRAINER_BACK_PIC_RED, - (const u32 *)gTrainerBackPic_Leaf, 0x2800, TRAINER_BACK_PIC_LEAF, - (const u32 *)gTrainerBackPic_RubySapphireBrendan, 0x2000, TRAINER_BACK_PIC_RUBY_SAPPHIRE_BRENDAN, - (const u32 *)gTrainerBackPic_RubySapphireMay, 0x2000, TRAINER_BACK_PIC_RUBY_SAPPHIRE_MAY, - (const u32 *)gTrainerBackPic_Wally, 0x2000, TRAINER_BACK_PIC_WALLY, - (const u32 *)gTrainerBackPic_Steven, 0x2000, TRAINER_BACK_PIC_STEVEN, + TRAINER_BACK_SPRITE(BRENDAN, gTrainerBackPic_Brendan, 0x2000), + TRAINER_BACK_SPRITE(MAY, gTrainerBackPic_May, 0x2000), + TRAINER_BACK_SPRITE(RED, gTrainerBackPic_Red, 0x2800), + TRAINER_BACK_SPRITE(LEAF, gTrainerBackPic_Leaf, 0x2800), + TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_BRENDAN, gTrainerBackPic_RubySapphireBrendan, 0x2000), + TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_MAY, gTrainerBackPic_RubySapphireMay, 0x2000), + TRAINER_BACK_SPRITE(WALLY, gTrainerBackPic_Wally, 0x2000), + TRAINER_BACK_SPRITE(STEVEN, gTrainerBackPic_Steven, 0x2000), }; +#define TRAINER_BACK_PAL(trainerPic, pal) [TRAINER_BACK_PIC_##trainerPic] = {pal, TRAINER_BACK_PIC_##trainerPic} + const struct CompressedSpritePalette gTrainerBackPicPaletteTable[] = { TRAINER_BACK_PAL(BRENDAN, gTrainerPalette_Brendan), diff --git a/src/data/trainer_graphics/front_pic_tables.h b/src/data/trainer_graphics/front_pic_tables.h index c3408b4c3..e751f3c1d 100644 --- a/src/data/trainer_graphics/front_pic_tables.h +++ b/src/data/trainer_graphics/front_pic_tables.h @@ -95,6 +95,8 @@ const struct MonCoords gTrainerFrontPicCoords[] = [TRAINER_PIC_RS_MAY] = {.size = 8, .y_offset = 1}, }; +#define TRAINER_SPRITE(trainerPic, sprite, size) [TRAINER_PIC_##trainerPic] = {sprite, size, TRAINER_PIC_##trainerPic} + const struct CompressedSpriteSheet gTrainerFrontPicTable[] = { TRAINER_SPRITE(HIKER, gTrainerFrontPic_Hiker, 0x800), @@ -192,6 +194,8 @@ const struct CompressedSpriteSheet gTrainerFrontPicTable[] = TRAINER_SPRITE(RS_MAY, gTrainerFrontPic_RubySapphireMay, 0x800), }; +#define TRAINER_PAL(trainerPic, pal) [TRAINER_PIC_##trainerPic] = {pal, TRAINER_PIC_##trainerPic} + const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[] = { TRAINER_PAL(HIKER, gTrainerPalette_Hiker), diff --git a/src/daycare.c b/src/daycare.c index fd6ed3a50..d849b39f3 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -547,13 +547,17 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare) for (i = 0; i < INHERITED_IV_COUNT; i++) { // Randomly pick an IV from the available list and stop from being chosen again. - selectedIvs[i] = availableIVs[Random() % (NUM_STATS - i)]; - // BUG: Instead of removing the IV that was just picked (like in RS and FRLG), this + // BUG: Instead of removing the IV that was just picked, this // removes position 0 (HP) then position 1 (DEF), then position 2. This is why HP and DEF // have a lower chance to be inherited in Emerald and why the IV picked for inheritance can - // be repeated. Uncomment the inline comment and remove the existing expression to get the - // intended behavior and to match the other Gen 3 games. - RemoveIVIndexFromList(availableIVs, i /*selectedIvs[i]*/); + // be repeated. Amusingly, FRLG and RS also got this wrong. They remove selectedIvs[i], which + // is not an index! This means that it can sometimes remove the wrong stat. To fix, delete + // the following two lines and uncomment the rest of the block. + selectedIvs[i] = availableIVs[Random() % (NUM_STATS - i)]; + RemoveIVIndexFromList(availableIVs, i); + // u8 index = Random() % (NUM_STATS - i); + // selectedIvs[i] = availableIVs[index]; + // RemoveIVIndexFromList(availableIVs, index); } // Determine which parent each of the selected IVs should inherit from. diff --git a/src/menu.c b/src/menu.c index dca8adc2d..4813f7b02 100644 --- a/src/menu.c +++ b/src/menu.c @@ -2016,7 +2016,7 @@ void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 src { int loopSrcY, loopDstY, loopSrcX, loopDstX, xEnd, yEnd, multiplierSrcY, multiplierDstY; const u8 *pixelsSrc; - u16 *pixelsDst; + u8 *pixelsDst; u16 toOrr; if (dst->width - dstX < width) @@ -2037,53 +2037,52 @@ void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 src for (loopSrcX = srcX, loopDstX = dstX; loopSrcX < xEnd; loopSrcX++, loopDstX++) { pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1B); - pixelsDst = (void*) dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + ((( loopDstY >> 3) * multiplierDstY) << 5) + ((u32)( loopDstY << 0x1d) >> 0x1B); + pixelsDst = (void*) dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + ((( loopDstY >> 3) * multiplierDstY) << 5) + ((u32)(loopDstY << 0x1d) >> 0x1B); - if ((uintptr_t )pixelsDst & 0x1) + if ((uintptr_t)pixelsDst & 0x1) { - pixelsDst = (void*)(pixelsDst) - 1; + pixelsDst--; if (loopDstX & 0x1) { - toOrr = *pixelsDst & 0x0fff; + toOrr = *(vu16*)pixelsDst; + toOrr &= 0x0fff; if (loopSrcX & 0x1) - *pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 8); + toOrr |= ((*pixelsSrc & 0xf0) << 8); else - *pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 12); + toOrr |= ((*pixelsSrc & 0x0f) << 12); } else { - toOrr = *pixelsDst & 0xf0ff; + toOrr = *(vu16*)pixelsDst; + toOrr &= 0xf0ff; if (loopSrcX & 0x1) - *pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 4); + toOrr |= ((*pixelsSrc & 0xf0) << 4); else - *pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 8); + toOrr |= ((*pixelsSrc & 0x0f) << 8); } } else { if (loopDstX & 1) { - toOrr = *pixelsDst & 0xff0f; + toOrr = *(vu16*)pixelsDst; + toOrr &= 0xff0f; if (loopSrcX & 1) - *pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 0); + toOrr |= ((*pixelsSrc & 0xf0) << 0); else - *pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 4); + toOrr |= ((*pixelsSrc & 0x0f) << 4); } else { - toOrr = *pixelsDst & 0xfff0; + toOrr = *(vu16*)pixelsDst; + toOrr &= 0xfff0; if (loopSrcX & 1) - *pixelsDst = toOrr | ((*pixelsSrc & 0xf0) >> 4); + toOrr |= ((*pixelsSrc & 0xf0) >> 4); else - *pixelsDst = toOrr | ((*pixelsSrc & 0x0f) >> 0); + toOrr |= ((*pixelsSrc & 0x0f) >> 0); } } - - // Needed to match, urgh. - #ifndef NONMATCHING - asm("":::"r4"); - pixelsDst++;pixelsDst--; - #endif // NONMATCHING + *(vu16*)pixelsDst = toOrr; } } } |