diff options
Diffstat (limited to 'include/global.h')
-rw-r--r-- | include/global.h | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/include/global.h b/include/global.h index 4ccd2be50..38850d6fa 100644 --- a/include/global.h +++ b/include/global.h @@ -9,6 +9,7 @@ #include "constants/flags.h" #include "constants/vars.h" #include "constants/species.h" +#include "constants/berry.h" // Prevent cross-jump optimization. #define BLOCK_CROSS_JUMP asm(""); @@ -500,7 +501,7 @@ struct SecretBaseParty struct SecretBase { /*0x1A9C*/ u8 secretBaseId; - /*0x1A9D*/ u8 sbr_field_1_0:4; + /*0x1A9D*/ bool8 toRegister:4; /*0x1A9D*/ u8 gender:1; /*0x1A9D*/ u8 battledOwnerToday:1; /*0x1A9D*/ u8 registryStatus:2; @@ -509,7 +510,7 @@ struct SecretBase /*0x1AA9*/ u8 language; /*0x1AAA*/ u16 numSecretBasesReceived; /*0x1AAC*/ u8 numTimesEntered; - /*0x1AAD*/ u8 sbr_field_11; + /*0x1AAD*/ u8 unused; /*0x1AAE*/ u8 decorations[DECOR_MAX_SECRET_BASE]; /*0x1ABE*/ u8 decorationPositions[DECOR_MAX_SECRET_BASE]; /*0x1AD0*/ struct SecretBaseParty party; @@ -897,6 +898,52 @@ struct MysteryEventStruct /*0x344 0x3570*/ u32 unk_344[2][5]; }; // 0x36C 0x3598 +// For external event data storage. The majority of these may have never been used. +// In Emerald, the only known used fields are the PokeCoupon and BoxRS ones, but hacking the distribution discs allows Emerald 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 Emerald, Jirachi cannot normally be received, but hacking the distribution discs allows Emerald 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*/ + struct SaveBlock1 { /*0x00*/ struct Coords16 pos; @@ -970,7 +1017,9 @@ struct SaveBlock1 /*0x2e90*/ struct ContestWinner contestWinners[NUM_CONTEST_WINNERS]; // see CONTEST_WINNER_* /*0x3030*/ struct DayCare daycare; /*0x3150*/ struct LinkBattleRecords linkBattleRecords; - /*0x31A8*/ u8 giftRibbons[52]; + /*0x31A8*/ u8 giftRibbons[11]; + /*0x31B3*/ struct ExternalEventData externalEventData; + /*0x31C7*/ struct ExternalEventFlags externalEventFlags; /*0x31DC*/ struct Roamer roamer; /*0x31F8*/ struct EnigmaBerry enigmaBerry; /*0x322C*/ struct MEventBuffers unk_322C; |