diff --git a/include/constants/global.h b/include/constants/global.h index ee2fd3abc7..d8dad0f457 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -51,6 +51,7 @@ #define MAX_REMATCH_ENTRIES 100 // only REMATCH_TABLE_ENTRIES (78) are used #define NUM_CONTEST_WINNERS 13 #define UNION_ROOM_KB_ROW_COUNT 10 +#define GIFT_RIBBONS_COUNT 11 #define PYRAMID_BAG_ITEMS_COUNT 10 #define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode. diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index e32ddf496a..3d757bed1d 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -171,7 +171,7 @@ #define MON_DATA_NATIONAL_RIBBON 76 #define MON_DATA_EARTH_RIBBON 77 #define MON_DATA_WORLD_RIBBON 78 -#define MON_DATA_FILLER 79 +#define MON_DATA_UNUSED_RIBBONS 79 #define MON_DATA_EVENT_LEGAL 80 #define MON_DATA_KNOWN_MOVES 81 #define MON_DATA_RIBBON_COUNT 82 diff --git a/include/global.h b/include/global.h index 38850d6fa2..44df26a9b2 100644 --- a/include/global.h +++ b/include/global.h @@ -905,7 +905,7 @@ struct ExternalEventData u8 unknownExternalDataFields1[7]; // if actually used, may be broken up into different fields. u32 unknownExternalDataFields2:8; u32 currentPokeCoupons:24; // PokéCoupons stored by Pokémon Colosseum and XD from Mt. Battle runs. Earned PokéCoupons are also added to totalEarnedPokeCoupons. Colosseum/XD caps this at 9,999,999, but will read up to 16,777,215. - u32 gotGoldPokeCouponTitleReward:1; // Master Ball from Jp Colosseum Bonus Disc; for reaching 30,000 totalEarnedPokeCoupons + u32 gotGoldPokeCouponTitleReward:1; // Master Ball from JP Colosseum Bonus Disc; for reaching 30,000 totalEarnedPokeCoupons u32 gotSilverPokeCouponTitleReward:1; // Light Ball Pikachu from JP Colosseum Bonus Disc; for reaching 5000 totalEarnedPokeCoupons u32 gotBronzePokeCouponTitleReward:1; // PP Max from JP Colosseum Bonus Disc; for reaching 2500 totalEarnedPokeCoupons u32 receivedAgetoCelebi:1; // from JP Colosseum Bonus Disc @@ -919,7 +919,7 @@ struct ExternalEventData struct ExternalEventFlags { u8 usedBoxRS:1; // Set by Pokémon Box: Ruby & Sapphire; denotes whether this save has connected to it and triggered the free False Swipe Swablu Egg giveaway. - u8 boxRSEggsUnlocked:2; // Set by Pokémon Box: Ruby & Sapphire; denotes the number of Eggs unlocked from deposits; 1 for ExtremeSpeed Zigzagoon (at 100 deposited), 2 for Pay Day Skitty (at 500 deposited), 3 for Surf Pichu (at 1500 deposited) + u8 boxRSEggsUnlocked:2; // Set by Pokémon Box: Ruby & Sapphire; denotes the number of Eggs unlocked from deposits; 1 for ExtremeSpeed Zigzagoon (at 100 deposited), 2 for Pay Day Skitty (at 500 deposited), 3 for Surf Pichu (at 1499 deposited) u8 padding:5; u8 unknownFlag1; u8 receivedGCNJirachi; // Both the US Colosseum Bonus Disc and PAL/AUS Pokémon Channel use this field. One cannot receive a WISHMKR Jirachi and CHANNEL Jirachi with the same savefile. @@ -1017,7 +1017,7 @@ struct SaveBlock1 /*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_* /*0x3030*/ struct DayCare daycare; /*0x3150*/ struct LinkBattleRecords linkBattleRecords; - /*0x31A8*/ u8 giftRibbons[11]; + /*0x31A8*/ u8 giftRibbons[GIFT_RIBBONS_COUNT]; /*0x31B3*/ struct ExternalEventData externalEventData; /*0x31C7*/ struct ExternalEventFlags externalEventFlags; /*0x31DC*/ struct Roamer roamer; diff --git a/include/pokemon.h b/include/pokemon.h index 7d6e960d77..82cdefeac8 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -72,7 +72,7 @@ struct PokemonSubstruct3 /* 0x0B */ u32 nationalRibbon:1; /* 0x0B */ u32 earthRibbon:1; /* 0x0B */ u32 worldRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners - /* 0x0B */ u32 filler:4; + /* 0x0B */ u32 unusedRibbons:4; // discarded in Gen 4 /* 0x0B */ u32 eventLegal:1; // controls Mew & Deoxys obedience; if set, Pokémon is a fateful encounter in Gen 4+; set for in-game event island legendaries, some distributed events, and Pokémon from XD: Gale of Darkness. }; diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 6f5a4dce7a..7b25754dba 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -553,20 +553,20 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon) const struct Evolution *evos2; CopyMon(&gPlayerParty[gPlayerPartyCount], mon, sizeof(struct Pokemon)); - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, (&gEvolutionTable[preEvoSpecies][1].targetSpecies)); - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, (gSpeciesNames[gEvolutionTable[preEvoSpecies][1].targetSpecies])); - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, (&data)); - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, (&data)); - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_ENCRYPT_SEPARATOR, (&data)); + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, &gEvolutionTable[preEvoSpecies][1].targetSpecies); + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, gSpeciesNames[gEvolutionTable[preEvoSpecies][1].targetSpecies]); + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, &data); + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, &data); + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_ENCRYPT_SEPARATOR, &data); for (i = MON_DATA_COOL_RIBBON; i < MON_DATA_COOL_RIBBON + CONTEST_CATEGORIES_COUNT; i++) - SetMonData(&gPlayerParty[gPlayerPartyCount], i, (&data)); - for (i = MON_DATA_CHAMPION_RIBBON; i <= MON_DATA_FILLER; i++) - SetMonData(&gPlayerParty[gPlayerPartyCount], i, (&data)); + SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data); + for (i = MON_DATA_CHAMPION_RIBBON; i <= MON_DATA_UNUSED_RIBBONS; i++) + SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data); - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_STATUS, (&data)); + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_STATUS, &data); data = 0xFF; - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MAIL, (&data)); + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MAIL, &data); CalculateMonStats(&gPlayerParty[gPlayerPartyCount]); CalculatePlayerPartyCount(); diff --git a/src/pokemon.c b/src/pokemon.c index 5812e987a8..c263cacc68 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3928,8 +3928,8 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) case MON_DATA_WORLD_RIBBON: retVal = substruct3->worldRibbon; break; - case MON_DATA_FILLER: - retVal = substruct3->filler; + case MON_DATA_UNUSED_RIBBONS: + retVal = substruct3->unusedRibbons; break; case MON_DATA_EVENT_LEGAL: retVal = substruct3->eventLegal; @@ -4307,8 +4307,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) case MON_DATA_WORLD_RIBBON: SET8(substruct3->worldRibbon); break; - case MON_DATA_FILLER: - SET8(substruct3->filler); + case MON_DATA_UNUSED_RIBBONS: + SET8(substruct3->unusedRibbons); break; case MON_DATA_EVENT_LEGAL: SET8(substruct3->eventLegal); diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 5b80fd428e..2f76c5d69a 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -36,7 +36,8 @@ static const struct UnknownStruct sBigMonSizeTable[] = { 1700, 1, -26 }, }; -static const u8 sGiftRibbonsMonDataIds[] = +// - 4 for unused gift ribbon bits in MON_DATA_UNUSED_RIBBONS +static const u8 sGiftRibbonsMonDataIds[GIFT_RIBBONS_COUNT - 4] = { MON_DATA_MARINE_RIBBON, MON_DATA_LAND_RIBBON, MON_DATA_SKY_RIBBON, MON_DATA_COUNTRY_RIBBON, MON_DATA_NATIONAL_RIBBON, MON_DATA_EARTH_RIBBON, @@ -200,7 +201,7 @@ void GiveGiftRibbonToParty(u8 index, u8 ribbonId) u8 array[8]; memcpy(array, sGiftRibbonsMonDataIds, sizeof(sGiftRibbonsMonDataIds)); - if (index < 11 && ribbonId < 65) + if (index < GIFT_RIBBONS_COUNT && ribbonId < 65) { gSaveBlock1Ptr->giftRibbons[index] = ribbonId; for (i = 0; i < PARTY_SIZE; i++) diff --git a/src/trade.c b/src/trade.c index afefce93cb..29279985e9 100644 --- a/src/trade.c +++ b/src/trade.c @@ -110,7 +110,7 @@ static EWRAM_DATA struct { /*0x007F*/ u8 unused_7F; /*0x0080*/ u16 linkData[20]; /*0x00A8*/ u8 timer; - /*0x00A9*/ u8 giftRibbons[11]; + /*0x00A9*/ u8 giftRibbons[GIFT_RIBBONS_COUNT]; /*0x00B4*/ u8 filler_B4[0x8D0-0xB4]; /*0x08D0*/ struct { bool8 queued;