Advertisement
PikalaxALT

My C

Sep 3rd, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.05 KB | None | 0 0
  1.  
  2. // TODO: Figure out what the f**k is going on here
  3. static void sub_8049ED4(u8 a0)
  4. {
  5.     u8 i;
  6.     s8 stringLength;
  7.     u8 whichParty = 1;
  8.     u8 whichPokemon;
  9.     u8 string1[40];
  10.     u8 string2[56];
  11.     u8 temp0 = gUnknown_03004824->unk_0082[a0];
  12.     if (temp0 < PARTY_SIZE)
  13.         whichParty = 0;
  14.     whichPokemon = temp0 % PARTY_SIZE;
  15.  
  16.     switch (gUnknown_03004824->unk_0080[a0])
  17.     {
  18.         case 1:
  19.             for (i = 0; i < gUnknown_03004824->partyCounts[a0]; i ++)
  20.             {
  21.                 gSprites[gUnknown_03004824->partyIcons[whichParty][i]].invisible = TRUE;
  22.             }
  23.             gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].invisible = FALSE;
  24.             gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].data0 = 20;
  25.             gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].data2 = (gTradeMonSpriteCoords[6 * whichParty + whichPokemon][0] + gTradeMonSpriteCoords[6 * whichParty + whichPokemon + 1][0]) / 2 * 8 + 14;
  26.             gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].data4 = gTradeMonSpriteCoords[6 * whichParty + whichPokemon][1] * 8 - 12;
  27.             oamt_set_x3A_32(&gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]], sub_809D62C);
  28.             gUnknown_03004824->unk_0080[a0] ++;
  29.             sub_8078A34(&gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]]);
  30.             HandleDestroyMenuCursors();
  31.             FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[whichParty][0], 0, gUnknown_0820C330[whichParty][1], 19);
  32.             sub_804A96C_alt(&gUnknown_03004824->unk_00c8, 15 * a0, 0, gTradePartyBoxTilemap, 15, 17, 0);
  33.             if (whichParty == 0)
  34.             {
  35.                 sub_804A80C();
  36.             }
  37.             break;
  38.         case 2:
  39.             if (gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].callback == sub_809D62C)
  40.             {
  41.                 gUnknown_03004824->unk_0080[a0] = 3;
  42.             }
  43.             break;
  44.         case 3:
  45.             sub_804A96C_alt(&gUnknown_03004824->unk_00c8, 15 * whichParty, 0, gTradePartyBoxTilemap, 15, 17, 0);
  46.             gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].pos1.x = (gTradeMonSpriteCoords[6 * whichParty + whichPokemon ][0] + gTradeMonSpriteCoords[6 * whichParty + whichPokemon + 1][0]) / 2 * 8 + 14;
  47.             gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].pos1.y = gTradeMonSpriteCoords[6 * whichParty + whichPokemon ][1] * 8 - 12;
  48.             gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].pos2.x = 0;
  49.             gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]].pos2.y = 0;
  50.             stringLength = sub_804A2B4(string1 + 6, whichParty, whichPokemon);
  51.             string1[0] = 0xFC;
  52.             string1[1] = 0x06;
  53.             string1[2] = 0x04;
  54.             string1[3] = 0xFC;
  55.             string1[4] = 0x11;
  56.             string1[5] = (64 - stringLength) / 2;
  57.             sub_8003460(&gUnknown_03004824->window, string1, gUnknown_03004824->unk_007a + whichParty * 6 * 32, gUnknown_0820C334[whichParty][0], gUnknown_0820C334[whichParty][1]);
  58.             sub_804A33C(string2, whichParty, whichPokemon);
  59.             sub_8003460(&gUnknown_03004824->window, gOtherText_Terminator2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 32, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1);
  60.             sub_8003460(&gUnknown_03004824->window, string2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 38, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1);
  61.             gUnknown_03004824->unk_0080[a0] ++;
  62.             break;
  63.         case 4:
  64.             sub_804ACD8(gUnknown_0820C14C[5], (u8 *)(BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e), 20);
  65.             sub_804A51C(a0, whichPokemon, gUnknown_0820C3D1[a0][0] + 4, gUnknown_0820C3D1[a0][1] + 1, gUnknown_0820C3D1[a0][0], gUnknown_0820C3D1[a0][1]);
  66.             gUnknown_03004824->unk_0080[a0] ++;
  67.             break;
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement