From 34e22f57f04180d71772f192dad32df6e82fbe6d Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 24 Sep 2017 12:40:12 -0400 Subject: GBA now sends over contents of boxes --- gba/source/main.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'gba/source/main.c') 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) sendU32(partyCount); waitForAck(); - for (int pki=0; pkibox); struct PokemonIntermediate pki; @@ -209,4 +209,32 @@ int main(void) PokemonIntermediateInit(&pki, bpkm); PokemonIntermediateStream(&pki); } + + struct PokemonStorage* pc = gameData.SaveBlock3; + + for (int bi=0; bi<14; bi++) + { + struct BoxPokemon* box = pc->boxes[bi]; + + for (int si=0; si<30; si++) + { + struct BoxPokemon* bpkm = &(box[si]); + + DecryptBoxPokemon(bpkm); + struct PokemonSubstruct0* sub0 = GetBoxPokemonSubstruct0(bpkm); + bool isPoke = (sub0->species != 0); + EncryptBoxPokemon(bpkm); + + sendU32(isPoke); + waitForAck(); + + if (isPoke) + { + struct PokemonIntermediate pki; + + PokemonIntermediateInit(&pki, bpkm); + PokemonIntermediateStream(&pki); + } + } + } } -- cgit 1.4.1