From de39982228cc445fb02ca061e6484f7030104b7c Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 30 Sep 2017 08:15:49 -0400 Subject: Extractor now gets gift ribbon descriptions Also fixed offsets of gift ribbon descriptions in the RSE save data, and added the offset for FRLG. --- source/main.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'source/main.c') diff --git a/source/main.c b/source/main.c index 316ebf7..6c97255 100644 --- a/source/main.c +++ b/source/main.c @@ -257,6 +257,55 @@ void* extractor(void* userdata) cJSON_AddNumberToObject(root, "gameId", gameId); cJSON_AddNumberToObject(root, "language", gameLanguage); + // Get gift ribbon descriptions. + u8 giftRibbons[7]; + + tnd = getMsg(); + giftRibbons[0] = (tnd & 0xFF000000) >> 24; + giftRibbons[1] = (tnd & 0x00FF0000) >> 16; + giftRibbons[2] = (tnd & 0x0000FF00) >> 8; + giftRibbons[3] = (tnd & 0x000000FF); + + tnd = getMsg(); + giftRibbons[4] = (tnd & 0xFF000000) >> 24; + giftRibbons[5] = (tnd & 0x00FF0000) >> 16; + giftRibbons[6] = (tnd & 0x0000FF00) >> 8; + + if (giftRibbons[0]) + { + cJSON_AddNumberToObject(root, "marineRibbon", giftRibbons[0]); + } + + if (giftRibbons[1]) + { + cJSON_AddNumberToObject(root, "landRibbon", giftRibbons[1]); + } + + if (giftRibbons[2]) + { + cJSON_AddNumberToObject(root, "skyRibbon", giftRibbons[2]); + } + + if (giftRibbons[3]) + { + cJSON_AddNumberToObject(root, "countryRibbon", giftRibbons[3]); + } + + if (giftRibbons[4]) + { + cJSON_AddNumberToObject(root, "nationalRibbon", giftRibbons[4]); + } + + if (giftRibbons[5]) + { + cJSON_AddNumberToObject(root, "earthRibbon", giftRibbons[5]); + } + + if (giftRibbons[6]) + { + cJSON_AddNumberToObject(root, "worldRibbon", giftRibbons[6]); + } + // Get Pokédex data u32 pokedexSeen[13]; u32 pokedexCaught[13]; -- cgit 1.4.1