about summary refs log tree commit diff stats
path: root/gba/source/main.c
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-09-24 12:40:12 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-09-24 12:40:12 -0400
commit34e22f57f04180d71772f192dad32df6e82fbe6d (patch)
tree804414973e108be676e132ae1ca433619bfeb02a /gba/source/main.c
parent0632b82c82cb26ec942a6b77a95b3b919482b8d4 (diff)
downloadgen3uploader-34e22f57f04180d71772f192dad32df6e82fbe6d.tar.gz
gen3uploader-34e22f57f04180d71772f192dad32df6e82fbe6d.tar.bz2
gen3uploader-34e22f57f04180d71772f192dad32df6e82fbe6d.zip
GBA now sends over contents of boxes
Diffstat (limited to 'gba/source/main.c')
-rw-r--r--gba/source/main.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/gba/source/main.c b/gba/source/main.c index 4bb120f..375adb8 100644 --- a/gba/source/main.c +++ b/gba/source/main.c
@@ -199,9 +199,9 @@ int main(void)
199 sendU32(partyCount); 199 sendU32(partyCount);
200 waitForAck(); 200 waitForAck();
201 201
202 for (int pki=0; pki<partyCount; pki++) 202 for (int ki=0; ki<partyCount; ki++)
203 { 203 {
204 struct Pokemon* pkm = (playerParty + pki); 204 struct Pokemon* pkm = (playerParty + ki);
205 struct BoxPokemon* bpkm = &(pkm->box); 205 struct BoxPokemon* bpkm = &(pkm->box);
206 206
207 struct PokemonIntermediate pki; 207 struct PokemonIntermediate pki;
@@ -209,4 +209,32 @@ int main(void)
209 PokemonIntermediateInit(&pki, bpkm); 209 PokemonIntermediateInit(&pki, bpkm);
210 PokemonIntermediateStream(&pki); 210 PokemonIntermediateStream(&pki);
211 } 211 }
212
213 struct PokemonStorage* pc = gameData.SaveBlock3;
214
215 for (int bi=0; bi<14; bi++)
216 {
217 struct BoxPokemon* box = pc->boxes[bi];
218
219 for (int si=0; si<30; si++)
220 {
221 struct BoxPokemon* bpkm = &(box[si]);
222
223 DecryptBoxPokemon(bpkm);
224 struct PokemonSubstruct0* sub0 = GetBoxPokemonSubstruct0(bpkm);
225 bool isPoke = (sub0->species != 0);
226 EncryptBoxPokemon(bpkm);
227
228 sendU32(isPoke);
229 waitForAck();
230
231 if (isPoke)
232 {
233 struct PokemonIntermediate pki;
234
235 PokemonIntermediateInit(&pki, bpkm);
236 PokemonIntermediateStream(&pki);
237 }
238 }
239 }
212} 240}