about summary refs log tree commit diff stats
path: root/source/main.c
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-09-30 08:15:49 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-09-30 08:15:49 -0400
commitde39982228cc445fb02ca061e6484f7030104b7c (patch)
tree75b70bbf9e6b71d04863bc5c46f7399bcb1fc032 /source/main.c
parent62be650076d6ea83e9822be56eaa59ab4195202c (diff)
downloadgen3uploader-de39982228cc445fb02ca061e6484f7030104b7c.tar.gz
gen3uploader-de39982228cc445fb02ca061e6484f7030104b7c.tar.bz2
gen3uploader-de39982228cc445fb02ca061e6484f7030104b7c.zip
Extractor now gets gift ribbon descriptions
Also fixed offsets of gift ribbon descriptions in the RSE save data, and
added the offset for FRLG.
Diffstat (limited to 'source/main.c')
-rw-r--r--source/main.c49
1 files changed, 49 insertions, 0 deletions
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)
257 cJSON_AddNumberToObject(root, "gameId", gameId); 257 cJSON_AddNumberToObject(root, "gameId", gameId);
258 cJSON_AddNumberToObject(root, "language", gameLanguage); 258 cJSON_AddNumberToObject(root, "language", gameLanguage);
259 259
260 // Get gift ribbon descriptions.
261 u8 giftRibbons[7];
262
263 tnd = getMsg();
264 giftRibbons[0] = (tnd & 0xFF000000) >> 24;
265 giftRibbons[1] = (tnd & 0x00FF0000) >> 16;
266 giftRibbons[2] = (tnd & 0x0000FF00) >> 8;
267 giftRibbons[3] = (tnd & 0x000000FF);
268
269 tnd = getMsg();
270 giftRibbons[4] = (tnd & 0xFF000000) >> 24;
271 giftRibbons[5] = (tnd & 0x00FF0000) >> 16;
272 giftRibbons[6] = (tnd & 0x0000FF00) >> 8;
273
274 if (giftRibbons[0])
275 {
276 cJSON_AddNumberToObject(root, "marineRibbon", giftRibbons[0]);
277 }
278
279 if (giftRibbons[1])
280 {
281 cJSON_AddNumberToObject(root, "landRibbon", giftRibbons[1]);
282 }
283
284 if (giftRibbons[2])
285 {
286 cJSON_AddNumberToObject(root, "skyRibbon", giftRibbons[2]);
287 }
288
289 if (giftRibbons[3])
290 {
291 cJSON_AddNumberToObject(root, "countryRibbon", giftRibbons[3]);
292 }
293
294 if (giftRibbons[4])
295 {
296 cJSON_AddNumberToObject(root, "nationalRibbon", giftRibbons[4]);
297 }
298
299 if (giftRibbons[5])
300 {
301 cJSON_AddNumberToObject(root, "earthRibbon", giftRibbons[5]);
302 }
303
304 if (giftRibbons[6])
305 {
306 cJSON_AddNumberToObject(root, "worldRibbon", giftRibbons[6]);
307 }
308
260 // Get Pokédex data 309 // Get Pokédex data
261 u32 pokedexSeen[13]; 310 u32 pokedexSeen[13];
262 u32 pokedexCaught[13]; 311 u32 pokedexCaught[13];