From 62be650076d6ea83e9822be56eaa59ab4195202c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 29 Sep 2017 18:39:52 -0400 Subject: Extractor now gets ribbons --- gba/source/savestructs.h | 14 +++++++------- gba/source/serialize.c | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 7 deletions(-) (limited to 'gba') diff --git a/gba/source/savestructs.h b/gba/source/savestructs.h index fb8ef36..a5aff4e 100644 --- a/gba/source/savestructs.h +++ b/gba/source/savestructs.h @@ -342,13 +342,13 @@ 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; + /* 0x0A */ u32 marineRibbon:1; + /* 0x0A */ u32 landRibbon:1; + /* 0x0A */ u32 skyRibbon:1; + /* 0x0A */ u32 countryRibbon:1; + /* 0x0B */ u32 nationalRibbon:1; + /* 0x0B */ u32 earthRibbon:1; + /* 0x0B */ u32 worldRibbon:1; /* 0x0B */ u32 fatefulEncounter:5; // unused in Ruby/Sapphire, but the high bit must be set for Mew/Deoxys to obey in FR/LG/Emerald }; diff --git a/gba/source/serialize.c b/gba/source/serialize.c index 5c4ff8d..4cb95ac 100644 --- a/gba/source/serialize.c +++ b/gba/source/serialize.c @@ -101,6 +101,26 @@ void PokemonIntermediateInit( pki->language = bpkm->language & 7; pki->orre = (sub3->metGame == 15); + pki->coolRibbons = sub3->coolRibbon; + pki->beautyRibbons = sub3->beautyRibbon; + pki->cuteRibbons = sub3->cuteRibbon; + pki->smartRibbons = sub3->smartRibbon; + pki->toughRibbons = sub3->toughRibbon; + + pki->miscRibbons = + (CHAMPION_RIBBON * sub3->championRibbon) + | (WINNING_RIBBON * sub3->winningRibbon) + | (VICTORY_RIBBON * sub3->victoryRibbon) + | (ARTIST_RIBBON * sub3->artistRibbon) + | (EFFORT_RIBBON * sub3->effortRibbon) + | (MARINE_RIBBON * sub3->marineRibbon) + | (LAND_RIBBON * sub3->landRibbon) + | (SKY_RIBBON * sub3->skyRibbon) + | (COUNTRY_RIBBON * sub3->countryRibbon) + | (NATIONAL_RIBBON * sub3->nationalRibbon) + | (EARTH_RIBBON * sub3->earthRibbon) + | (WORLD_RIBBON * sub3->worldRibbon); + // Derive nature from the personality value. pki->nature = (bpkm->personality % 25); -- cgit 1.4.1