about summary refs log tree commit diff stats
path: root/source
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-09-10 22:12:47 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-09-10 22:12:47 -0400
commit6ceeb199181d64031f4173cfbffa066f5b9796b8 (patch)
treeabda49c65817f58de5c0cb884e8848aae5723dea /source
parent1d82e3affd42c2336702af4a644baa8eec249ead (diff)
downloadgen3uploader-6ceeb199181d64031f4173cfbffa066f5b9796b8.tar.gz
gen3uploader-6ceeb199181d64031f4173cfbffa066f5b9796b8.tar.bz2
gen3uploader-6ceeb199181d64031f4173cfbffa066f5b9796b8.zip
Added identifying hash to Pokémon data structure
The purpose of this hash is described in detail in pokemon.h. The hash
is computed using an implementation of SHA-224. To allow the GBA
sufficient time to compute this hash, a delay of 5 milliseconds was
introduced on the GC side before reading a Pokémon.
Diffstat (limited to 'source')
-rw-r--r--source/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/main.c b/source/main.c index 1355533..3806106 100644 --- a/source/main.c +++ b/source/main.c
@@ -210,6 +210,8 @@ void* extractor(void* userdata)
210 210
211 for (u32 i = 0; i < partyCount; i++) 211 for (u32 i = 0; i < partyCount; i++)
212 { 212 {
213 usleep(5000);
214
213 u32 rawdata[sizeof(struct PokemonIntermediate) / 4]; 215 u32 rawdata[sizeof(struct PokemonIntermediate) / 4];
214 getMsgArr(rawdata, sizeof(struct PokemonIntermediate) / 4); 216 getMsgArr(rawdata, sizeof(struct PokemonIntermediate) / 4);
215 217
@@ -221,6 +223,18 @@ void* extractor(void* userdata)
221 char d_otName[22]; 223 char d_otName[22];
222 decodePokemonCharset(pki->otName, 7, d_otName, pki->language); 224 decodePokemonCharset(pki->otName, 7, d_otName, pki->language);
223 225
226 char d_key[57];
227 sprintf(
228 d_key,
229 "%08lx%08lx%08lx%08lx%08lx%08lx%08lx",
230 pki->key[0],
231 pki->key[1],
232 pki->key[2],
233 pki->key[3],
234 pki->key[4],
235 pki->key[5],
236 pki->key[6]);
237
224 printf("Species: %d\n", __builtin_bswap16(pki->species)); 238 printf("Species: %d\n", __builtin_bswap16(pki->species));
225 printf("Nickname: %s\n", d_pokename); 239 printf("Nickname: %s\n", d_pokename);
226 printf("OT: %s\n", d_otName); 240 printf("OT: %s\n", d_otName);
@@ -231,6 +245,7 @@ void* extractor(void* userdata)
231 printf("Special Attack: %ld\n", __builtin_bswap32(pki->spAttack)); 245 printf("Special Attack: %ld\n", __builtin_bswap32(pki->spAttack));
232 printf("Special Defense: %ld\n", __builtin_bswap32(pki->spDefense)); 246 printf("Special Defense: %ld\n", __builtin_bswap32(pki->spDefense));
233 printf("Speed: %ld\n", __builtin_bswap32(pki->speed)); 247 printf("Speed: %ld\n", __builtin_bswap32(pki->speed));
248 printf("Key: %s\n", d_key);
234 249
235 printf("\n"); 250 printf("\n");
236 } 251 }