Mirror pokeemerald PR#1329 & PR#1335 to pokefirered
The `giftRibbons` field in `SaveBlock1` has been split out into proper subfields. The new ExternalEvent structs deal with interconnectivity between external games/peripherals and FRLG. US & JP Colosseum Bonus Discs', Colosseum and XD's, Pokémon Channel's, and PokémonBox: Ruby & Sapphire's interactions with these fields has been documented. The `giftRibbon#` fields in `PokemonSubstruct3` have also been renamed to their appropriate ribbons, and commented with distribution info if applicable. The previous `fatefulEncounter` field was actually filler, and relabeled as such, while the `obedient` bit was renamed `eventLegal`. All relevant constants and functions dealing with the Pokémon data structure were renamed with these changes in mind. I still maintain that `eventLegal` is a misnomer and it should be called `fatefulEncounter` in all three repos.
This commit is contained in:
@@ -74,15 +74,15 @@
|
||||
#define MON_DATA_VICTORY_RIBBON 69
|
||||
#define MON_DATA_ARTIST_RIBBON 70
|
||||
#define MON_DATA_EFFORT_RIBBON 71
|
||||
#define MON_DATA_GIFT_RIBBON_1 72
|
||||
#define MON_DATA_GIFT_RIBBON_2 73
|
||||
#define MON_DATA_GIFT_RIBBON_3 74
|
||||
#define MON_DATA_GIFT_RIBBON_4 75
|
||||
#define MON_DATA_GIFT_RIBBON_5 76
|
||||
#define MON_DATA_GIFT_RIBBON_6 77
|
||||
#define MON_DATA_GIFT_RIBBON_7 78
|
||||
#define MON_DATA_FATEFUL_ENCOUNTER 79
|
||||
#define MON_DATA_OBEDIENCE 80
|
||||
#define MON_DATA_MARINE_RIBBON 72
|
||||
#define MON_DATA_LAND_RIBBON 73
|
||||
#define MON_DATA_SKY_RIBBON 74
|
||||
#define MON_DATA_COUNTRY_RIBBON 75
|
||||
#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_EVENT_LEGAL 80
|
||||
#define MON_DATA_KNOWN_MOVES 81
|
||||
#define MON_DATA_RIBBON_COUNT 82
|
||||
#define MON_DATA_RIBBONS 83
|
||||
|
||||
+49
-1
@@ -715,6 +715,52 @@ struct TrainerNameRecord
|
||||
u8 trainerName[PLAYER_NAME_LENGTH + 1];
|
||||
};
|
||||
|
||||
// For external event data storage. The majority of these may have never been used.
|
||||
// In FRLG, the only known used fields are the PokeCoupon and BoxRS ones, but hacking the distribution discs allows FRLG to receive events and set the others
|
||||
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 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
|
||||
u32 unknownExternalDataFields3:4;
|
||||
u32 totalEarnedPokeCoupons:24; // Used by the JP Colosseum bonus disc. Determines PokéCoupon rank to distribute rewards. Unread in International games. Colosseum/XD caps this at 9,999,999.
|
||||
u8 unknownExternalDataFields4[5]; // if actually used, may be broken up into different fields.
|
||||
} __attribute__((packed)); /*size = 0x14*/
|
||||
|
||||
// For external event flags. The majority of these may have never been used.
|
||||
// In FRLG, Jirachi cannot normally be received, but hacking the distribution discs allows FRLG to receive Jirachi and set the flag
|
||||
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 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.
|
||||
u8 unknownFlag3;
|
||||
u8 unknownFlag4;
|
||||
u8 unknownFlag5;
|
||||
u8 unknownFlag6;
|
||||
u8 unknownFlag7;
|
||||
u8 unknownFlag8;
|
||||
u8 unknownFlag9;
|
||||
u8 unknownFlag10;
|
||||
u8 unknownFlag11;
|
||||
u8 unknownFlag12;
|
||||
u8 unknownFlag13;
|
||||
u8 unknownFlag14;
|
||||
u8 unknownFlag15;
|
||||
u8 unknownFlag16;
|
||||
u8 unknownFlag17;
|
||||
u8 unknownFlag18;
|
||||
u8 unknownFlag19;
|
||||
u8 unknownFlag20;
|
||||
|
||||
} __attribute__((packed));/*size = 0x15*/
|
||||
|
||||
#define UNION_ROOM_KB_ROW_COUNT 10
|
||||
|
||||
struct SaveBlock1
|
||||
@@ -761,7 +807,9 @@ struct SaveBlock1
|
||||
/*0x2F18*/ OldMan oldMan; // unused
|
||||
/*0x2F54*/ struct EasyChatPair easyChatPairs[5]; // unused
|
||||
/*0x2F80*/ struct DayCare daycare;
|
||||
/*0x309C*/ u8 giftRibbons[52];
|
||||
/*0x309C*/ u8 giftRibbons[11];
|
||||
/*0x30A7*/ struct ExternalEventData externalEventData;
|
||||
/*0x30BB*/ struct ExternalEventFlags externalEventFlags;
|
||||
/*0x30D0*/ struct Roamer roamer;
|
||||
/*0x30EC*/ struct EnigmaBerry enigmaBerry;
|
||||
/*0x3120*/ struct MEventBuffers mysteryEventBuffers;
|
||||
|
||||
+10
-10
@@ -65,15 +65,15 @@ struct PokemonSubstruct3
|
||||
/* 0x0A */ u32 victoryRibbon:1;
|
||||
/* 0x0A */ u32 artistRibbon:1;
|
||||
/* 0x0A */ u32 effortRibbon:1;
|
||||
/* 0x0A */ u32 giftRibbon1:1;
|
||||
/* 0x0A */ u32 giftRibbon2:1;
|
||||
/* 0x0A */ u32 giftRibbon3:1;
|
||||
/* 0x0A */ u32 giftRibbon4:1;
|
||||
/* 0x0B */ u32 giftRibbon5:1;
|
||||
/* 0x0B */ u32 giftRibbon6:1;
|
||||
/* 0x0B */ u32 giftRibbon7:1;
|
||||
/* 0x0B */ u32 fatefulEncounter:4;
|
||||
/* 0x0B */ u32 obedient:1;
|
||||
/* 0x0A */ u32 marineRibbon:1; // never distributed
|
||||
/* 0x0A */ u32 landRibbon:1; // never distributed
|
||||
/* 0x0A */ u32 skyRibbon:1; // never distributed
|
||||
/* 0x0A */ u32 countryRibbon:1; // distributed during Pokémon Festa '04 and '05 to tournament winners
|
||||
/* 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 eventLegal:1; // controls Mew & Deoxys obedience; if set, Pokémon is a fateful encounter in FRLG & Gen 4+ summary screens; set for in-game event island legendaries, some distributed events, and Pokémon from XD: Gale of Darkness.
|
||||
};
|
||||
|
||||
union PokemonSubstruct
|
||||
@@ -449,7 +449,7 @@ bool8 sub_804455C(u8 caseId, u8 battlerId);
|
||||
void SetDeoxysStats(void);
|
||||
u16 sub_80447AC(void);
|
||||
u16 sub_80447F0(void);
|
||||
void CreateObedientEnemyMon(void);
|
||||
void CreateEventLegalEnemyMon(void);
|
||||
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
|
||||
bool8 CheckBattleTypeGhost(struct Pokemon *mon, u8 bank);
|
||||
struct OakSpeechNidoranFStruct *OakSpeechNidoranFSetup(u8 battlePosition, bool8 enable);
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ extern const u8 gText_GenderlessSymbol[];
|
||||
extern const u16 gUnknown_826601C[];
|
||||
void CB2_ReturnFromLinkTrade(void);
|
||||
s32 Trade_CalcLinkPlayerCompatibilityParam(void);
|
||||
s32 CanRegisterMonForTradingBoard(struct GFtgtGnameSub rfuPlayer, u16 species2, u16 species, u8 isObedientBitSet);
|
||||
s32 GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGnameSub rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isObedientBitSet);
|
||||
s32 CanRegisterMonForTradingBoard(struct GFtgtGnameSub rfuPlayer, u16 species2, u16 species, u8 isEventLegal);
|
||||
s32 GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGnameSub rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isEventLegal);
|
||||
void CB2_ReturnToTradeMenuFromSummary(void);
|
||||
|
||||
#endif //GUARD_TRADE_H
|
||||
|
||||
Reference in New Issue
Block a user