From ce6e97fa0b24e69582615048dbbac17a55afe8ac Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 2 Dec 2017 21:44:50 +0100 Subject: [PATCH] sprite data fields to array --- src/battle_2.c | 126 +++--- src/battle_controller_link_opponent.c | 38 +- src/battle_controller_link_partner.c | 42 +- src/battle_controller_opponent.c | 40 +- src/battle_controller_player.c | 46 +-- src/battle_controller_player_partner.c | 44 +- src/battle_controller_recorded_opponent.c | 36 +- src/battle_controller_recorded_player.c | 44 +- src/battle_controller_safari.c | 2 +- src/battle_controller_wally.c | 32 +- src/battle_gfx_sfx_util.c | 10 +- src/battle_interface.c | 144 +++---- src/battle_script_commands.c | 4 +- src/berry_blender.c | 110 ++--- src/decoration.c | 68 ++-- src/egg_hatch.c | 78 ++-- src/evolution_graphics.c | 80 ++-- src/field_map_obj.c | 468 +++++++++++----------- src/hall_of_fame.c | 18 +- src/pokemon_summary_screen.c | 4 +- src/region_map.c | 38 +- src/reshow_battle_screen.c | 12 +- src/sprite.c | 17 +- src/starter_choose.c | 24 +- 24 files changed, 759 insertions(+), 766 deletions(-) diff --git a/src/battle_2.c b/src/battle_2.c index eead4d7a9..8905a0ec7 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -1620,7 +1620,7 @@ void CB2_QuitRecordedBattle(void) void sub_8038528(struct Sprite* sprite) { - sprite->data0 = 0; + sprite->data[0] = 0; sprite->callback = sub_8038538; } @@ -1628,42 +1628,42 @@ static void sub_8038538(struct Sprite *sprite) { u16 *arr = (u16*)(gDecompressionBuffer); - switch (sprite->data0) + switch (sprite->data[0]) { case 0: - sprite->data0++; - sprite->data1 = 0; - sprite->data2 = 0x281; - sprite->data3 = 0; - sprite->data4 = 1; + sprite->data[0]++; + sprite->data[1] = 0; + sprite->data[2] = 0x281; + sprite->data[3] = 0; + sprite->data[4] = 1; // fall through case 1: - sprite->data4--; - if (sprite->data4 == 0) + sprite->data[4]--; + if (sprite->data[4] == 0) { s32 i; s32 r2; s32 r0; - sprite->data4 = 2; - r2 = sprite->data1 + sprite->data3 * 32; - r0 = sprite->data2 - sprite->data3 * 32; + sprite->data[4] = 2; + r2 = sprite->data[1] + sprite->data[3] * 32; + r0 = sprite->data[2] - sprite->data[3] * 32; for (i = 0; i < 29; i += 2) { arr[r2 + i] = 0x3D; arr[r0 + i] = 0x3D; } - sprite->data3++; - if (sprite->data3 == 21) + sprite->data[3]++; + if (sprite->data[3] == 21) { - sprite->data0++; - sprite->data1 = 32; + sprite->data[0]++; + sprite->data[1] = 32; } } break; case 2: - sprite->data1--; - if (sprite->data1 == 20) + sprite->data[1]--; + if (sprite->data[1] == 20) SetMainCallback2(CB2_InitBattle); break; } @@ -1824,12 +1824,12 @@ void nullsub_17(void) static void sub_8038B04(struct Sprite *sprite) { - if (sprite->data0 != 0) - sprite->pos1.x = sprite->data1 + ((sprite->data2 & 0xFF00) >> 8); + if (sprite->data[0] != 0) + sprite->pos1.x = sprite->data[1] + ((sprite->data[2] & 0xFF00) >> 8); else - sprite->pos1.x = sprite->data1 - ((sprite->data2 & 0xFF00) >> 8); + sprite->pos1.x = sprite->data[1] - ((sprite->data[2] & 0xFF00) >> 8); - sprite->data2 += 0x180; + sprite->data[2] += 0x180; if (sprite->affineAnimEnded) { @@ -2382,8 +2382,8 @@ u32 sub_80397C4(u32 setId, u32 tableId) return gUnknown_0831ABA0[setId][tableId].width * 8; } -#define tBank data0 -#define tSpeciesId data2 +#define tBank data[0] +#define tSpeciesId data[2] void oac_poke_opponent(struct Sprite *sprite) { @@ -2431,20 +2431,20 @@ void SpriteCallbackDummy_2(struct Sprite *sprite) static void sub_80398BC(struct Sprite *sprite) // unused? { - sprite->data3 = 6; - sprite->data4 = 1; + sprite->data[3] = 6; + sprite->data[4] = 1; sprite->callback = sub_80398D0; } static void sub_80398D0(struct Sprite *sprite) { - sprite->data4--; - if (sprite->data4 == 0) + sprite->data[4]--; + if (sprite->data[4] == 0) { - sprite->data4 = 8; + sprite->data[4] = 8; sprite->invisible ^= 1; - sprite->data3--; - if (sprite->data3 == 0) + sprite->data[3]--; + if (sprite->data[3] == 0) { sprite->invisible = FALSE; sprite->callback = SpriteCallbackDummy_2; @@ -2495,8 +2495,8 @@ void sub_8039934(struct Sprite *sprite) yOffset = gMonFrontPicCoords[species].y_offset; } - sprite->data3 = 8 - yOffset / 8; - sprite->data4 = 1; + sprite->data[3] = 8 - yOffset / 8; + sprite->data[4] = 1; sprite->callback = sub_8039A48; } @@ -2504,20 +2504,20 @@ static void sub_8039A48(struct Sprite *sprite) { s32 i; - sprite->data4--; - if (sprite->data4 == 0) + sprite->data[4]--; + if (sprite->data[4] == 0) { - sprite->data4 = 2; + sprite->data[4] = 2; sprite->pos2.y += 8; - sprite->data3--; - if (sprite->data3 < 0) + sprite->data[3]--; + if (sprite->data[3] < 0) { FreeSpriteOamMatrix(sprite); DestroySprite(sprite); } else { - u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBankIdentity(sprite->tBank)] + (gBattleMonForms[sprite->tBank] << 11) + (sprite->data3 << 8); + u8 *dst = (u8 *)gMonSpritesGfxPtr->sprites[GetBankIdentity(sprite->tBank)] + (gBattleMonForms[sprite->tBank] << 11) + (sprite->data[3] << 8); for (i = 0; i < 0x100; i++) *(dst++) = 0; @@ -2529,25 +2529,25 @@ static void sub_8039A48(struct Sprite *sprite) void sub_8039AD8(struct Sprite *sprite) { - sprite->data3 = 8; - sprite->data4 = sprite->invisible; + sprite->data[3] = 8; + sprite->data[4] = sprite->invisible; sprite->callback = sub_8039AF4; } static void sub_8039AF4(struct Sprite *sprite) { - sprite->data3--; - if (sprite->data3 == 0) + sprite->data[3]--; + if (sprite->data[3] == 0) { sprite->invisible ^= 1; - sprite->data3 = 8; + sprite->data[3] = 8; } } void sub_8039B2C(struct Sprite *sprite) { - sprite->invisible = sprite->data4; - sprite->data4 = FALSE; + sprite->invisible = sprite->data[4]; + sprite->data[4] = FALSE; sprite->callback = SpriteCallbackDummy_2; } @@ -2577,7 +2577,7 @@ static void oac_poke_ally_(struct Sprite *sprite) if (sprite->pos2.x == 0) { sprite->callback = SpriteCallbackDummy_3; - sprite->data1 = 0; + sprite->data[1] = 0; } } } @@ -2595,8 +2595,8 @@ void sub_8039C00(struct Sprite *sprite) { if (!(gUnknown_020243FC & 1)) { - sprite->pos2.x += sprite->data1; - sprite->pos2.y += sprite->data2; + sprite->pos2.x += sprite->data[1]; + sprite->pos2.y += sprite->data[2]; } } @@ -2622,19 +2622,19 @@ void dp11b_obj_instanciate(u8 bank, u8 b, s8 c, s8 d) spriteId2 = gHealthBoxesIds[bank]; gBattleSpritesDataPtr->healthBoxesData[bank].field_2 = bounceHealthBoxSpriteId; gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2 = 1; - gSprites[bounceHealthBoxSpriteId].data0 = 0x80; + gSprites[bounceHealthBoxSpriteId].data[0] = 0x80; } else { spriteId2 = gBankSpriteIds[bank]; gBattleSpritesDataPtr->healthBoxesData[bank].field_3 = bounceHealthBoxSpriteId; gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4 = 1; - gSprites[bounceHealthBoxSpriteId].data0 = 0xC0; + gSprites[bounceHealthBoxSpriteId].data[0] = 0xC0; } - gSprites[bounceHealthBoxSpriteId].data1 = c; - gSprites[bounceHealthBoxSpriteId].data2 = d; - gSprites[bounceHealthBoxSpriteId].data3 = spriteId2; - gSprites[bounceHealthBoxSpriteId].data4 = b; + gSprites[bounceHealthBoxSpriteId].data[1] = c; + gSprites[bounceHealthBoxSpriteId].data[2] = d; + gSprites[bounceHealthBoxSpriteId].data[3] = spriteId2; + gSprites[bounceHealthBoxSpriteId].data[4] = b; gSprites[spriteId2].pos2.x = 0; gSprites[spriteId2].pos2.y = 0; } @@ -2648,7 +2648,7 @@ void dp11b_obj_free(u8 bank, bool8 b) if (!gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2) return; - r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2].data3; + r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2].data[3]; DestroySprite(&gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_2]); gBattleSpritesDataPtr->healthBoxesData[bank].flag_x2 = 0; } @@ -2657,7 +2657,7 @@ void dp11b_obj_free(u8 bank, bool8 b) if (!gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4) return; - r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3].data3; + r4 = gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3].data[3]; DestroySprite(&gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].field_3]); gBattleSpritesDataPtr->healthBoxesData[bank].flag_x4 = 0; } @@ -2667,16 +2667,16 @@ void dp11b_obj_free(u8 bank, bool8 b) static void SpriteCB_HealthBoxBounce(struct Sprite *sprite) { - u8 spriteId = sprite->data3; + u8 spriteId = sprite->data[3]; s32 var; - if (sprite->data4 == 1) - var = sprite->data0; + if (sprite->data[4] == 1) + var = sprite->data[0]; else - var = sprite->data0; + var = sprite->data[0]; - gSprites[spriteId].pos2.y = Sin(var, sprite->data2) + sprite->data2; - sprite->data0 = (sprite->data0 + sprite->data1) & 0xFF; + gSprites[spriteId].pos2.y = Sin(var, sprite->data[2]) + sprite->data[2]; + sprite->data[0] = (sprite->data[0] + sprite->data[1]) & 0xFF; } void sub_8039E44(struct Sprite *sprite) diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index e691af6a1..4795d2bd4 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -465,18 +465,18 @@ static void DoHitAnimBlinkSpriteEffect(void) { u8 spriteId = gBankSpriteIds[gActiveBank]; - if (gSprites[spriteId].data1 == 32) + if (gSprites[spriteId].data[1] == 32) { - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[1] = 0; gSprites[spriteId].invisible = 0; gDoingBattleAnim = FALSE; LinkOpponentBufferExecCompleted(); } else { - if ((gSprites[spriteId].data1 % 4) == 0) + if ((gSprites[spriteId].data[1] % 4) == 0) gSprites[spriteId].invisible ^= 1; - gSprites[spriteId].data1++; + gSprites[spriteId].data[1]++; } } @@ -1168,7 +1168,7 @@ static void LinkOpponentHandleLoadMonSprite(void) sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]); @@ -1201,11 +1201,11 @@ static void sub_8066494(u8 bank, bool8 dontClearSubstituteBit) GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); - gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; - gSprites[gUnknown_03005D7C[bank]].data2 = bank; + gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank]; + gSprites[gUnknown_03005D7C[bank]].data[2] = bank; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = species; + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = species; gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); @@ -1213,7 +1213,7 @@ static void sub_8066494(u8 bank, bool8 dontClearSubstituteBit) gSprites[gBankSpriteIds[bank]].invisible = TRUE; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); + gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); } static void LinkOpponentHandleReturnMonToBall(void) @@ -1334,7 +1334,7 @@ static void LinkOpponentHandleDrawTrainerPic(void) sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = 2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; @@ -1357,7 +1357,7 @@ static void LinkOpponentHandleTrainerSlide(void) gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 96; gSprites[gBankSpriteIds[gActiveBank]].pos1.x += 32; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; @@ -1369,9 +1369,9 @@ static void LinkOpponentHandleTrainerSlide(void) static void LinkOpponentHandleTrainerSlideBack(void) { oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 280; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy); gBattleBankFunc[gActiveBank] = sub_8064470; @@ -1670,7 +1670,7 @@ static void LinkOpponentHandleHitAnimation(void) else { gDoingBattleAnim = TRUE; - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; DoHitAnimHealthboxEffect(gActiveBank); gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect; } @@ -1731,9 +1731,9 @@ static void LinkOpponentHandleIntroTrainerBallThrow(void) oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 280; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_80676FC); diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 02159970e..fde364a55 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -352,18 +352,18 @@ static void DoHitAnimBlinkSpriteEffect(void) { u8 spriteId = gBankSpriteIds[gActiveBank]; - if (gSprites[spriteId].data1 == 32) + if (gSprites[spriteId].data[1] == 32) { - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[1] = 0; gSprites[spriteId].invisible = 0; gDoingBattleAnim = FALSE; LinkPartnerBufferExecCompleted(); } else { - if ((gSprites[spriteId].data1 % 4) == 0) + if ((gSprites[spriteId].data[1] % 4) == 0) gSprites[spriteId].invisible ^= 1; - gSprites[spriteId].data1++; + gSprites[spriteId].data[1]++; } } @@ -1053,7 +1053,7 @@ static void LinkPartnerHandleLoadMonSprite(void) GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]); gBattleBankFunc[gActiveBank] = sub_814B290; @@ -1084,11 +1084,11 @@ static void sub_814CC98(u8 bank, bool8 dontClearSubstituteBit) GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); - gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; - gSprites[gUnknown_03005D7C[bank]].data2 = bank; + gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank]; + gSprites[gUnknown_03005D7C[bank]].data[2] = bank; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = species; + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = species; gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); @@ -1096,7 +1096,7 @@ static void sub_814CC98(u8 bank, bool8 dontClearSubstituteBit) gSprites[gBankSpriteIds[bank]].invisible = TRUE; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void LinkPartnerHandleReturnMonToBall(void) @@ -1174,7 +1174,7 @@ static void LinkPartnerHandleDrawTrainerPic(void) gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy; @@ -1188,9 +1188,9 @@ static void LinkPartnerHandleTrainerSlide(void) static void LinkPartnerHandleTrainerSlideBack(void) { oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy); gBattleBankFunc[gActiveBank] = sub_814AF54; @@ -1211,8 +1211,8 @@ static void LinkPartnerHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER); - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 5; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00; gBattleBankFunc[gActiveBank] = sub_814B340; } @@ -1492,7 +1492,7 @@ static void LinkPartnerHandleHitAnimation(void) else { gDoingBattleAnim = TRUE; - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; DoHitAnimHealthboxEffect(gActiveBank); gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect; } @@ -1554,11 +1554,11 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void) oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 50; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; - gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 7338fdb00..dc23db8bc 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -453,18 +453,18 @@ static void DoHitAnimBlinkSpriteEffect(void) { u8 spriteId = gBankSpriteIds[gActiveBank]; - if (gSprites[spriteId].data1 == 32) + if (gSprites[spriteId].data[1] == 32) { - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[1] = 0; gSprites[spriteId].invisible = 0; gDoingBattleAnim = FALSE; OpponentBufferExecCompleted(); } else { - if ((gSprites[spriteId].data1 % 4) == 0) + if ((gSprites[spriteId].data[1] % 4) == 0) gSprites[spriteId].invisible ^= 1; - gSprites[spriteId].data1++; + gSprites[spriteId].data[1]++; } } @@ -1156,8 +1156,8 @@ static void OpponentHandleLoadMonSprite(void) sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; - gSprites[gBankSpriteIds[gActiveBank]].data2 = species; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = species; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]); @@ -1190,11 +1190,11 @@ static void sub_80613DC(u8 bank, bool8 dontClearSubstituteBit) GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = species; + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = species; - gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; - gSprites[gUnknown_03005D7C[bank]].data2 = bank; + gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank]; + gSprites[gUnknown_03005D7C[bank]].data[2] = bank; gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; @@ -1203,7 +1203,7 @@ static void sub_80613DC(u8 bank, bool8 dontClearSubstituteBit) gSprites[gBankSpriteIds[bank]].invisible = TRUE; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); + gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); } static void OpponentHandleReturnMonToBall(void) @@ -1321,7 +1321,7 @@ static void OpponentHandleDrawTrainerPic(void) sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = 2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; @@ -1391,7 +1391,7 @@ static void OpponentHandleTrainerSlide(void) gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 96; gSprites[gBankSpriteIds[gActiveBank]].pos1.x += 32; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; @@ -1402,9 +1402,9 @@ static void OpponentHandleTrainerSlide(void) static void OpponentHandleTrainerSlideBack(void) { oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 280; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy); gBattleBankFunc[gActiveBank] = sub_805F240; @@ -1815,7 +1815,7 @@ static void OpponentHandleHitAnimation(void) else { gDoingBattleAnim = TRUE; - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; DoHitAnimHealthboxEffect(gActiveBank); gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect; } @@ -1876,9 +1876,9 @@ static void OpponentHandleIntroTrainerBallThrow(void) oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 280; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_806280C); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 7c97c83bb..137b33274 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -1431,18 +1431,18 @@ static void DoHitAnimBlinkSpriteEffect(void) { u8 spriteId = gBankSpriteIds[gActiveBank]; - if (gSprites[spriteId].data1 == 32) + if (gSprites[spriteId].data[1] == 32) { - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[1] = 0; gSprites[spriteId].invisible = 0; gDoingBattleAnim = FALSE; PlayerBufferExecCompleted(); } else { - if ((gSprites[spriteId].data1 % 4) == 0) + if ((gSprites[spriteId].data[1] % 4) == 0) gSprites[spriteId].invisible ^= 1; - gSprites[spriteId].data1++; + gSprites[spriteId].data[1]++; } } @@ -2241,11 +2241,11 @@ static void sub_805B258(u8 bank, bool8 dontClearSubstituteBit) GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); - gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; - gSprites[gUnknown_03005D7C[bank]].data2 = bank; + gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank]; + gSprites[gUnknown_03005D7C[bank]].data[2] = bank; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = species; + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = species; gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); @@ -2253,7 +2253,7 @@ static void sub_805B258(u8 bank, bool8 dontClearSubstituteBit) gSprites[gBankSpriteIds[bank]].invisible = TRUE; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void PlayerHandleReturnMonToBall(void) @@ -2358,7 +2358,7 @@ static void PlayerHandleDrawTrainerPic(void) gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; gSprites[gBankSpriteIds[gActiveBank]].pos2.y = 48; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; gSprites[gBankSpriteIds[gActiveBank]].oam.affineMode = 0; gSprites[gBankSpriteIds[gActiveBank]].hFlip = 1; @@ -2372,7 +2372,7 @@ static void PlayerHandleDrawTrainerPic(void) gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; } @@ -2411,7 +2411,7 @@ static void PlayerHandleTrainerSlide(void) gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -96; - gSprites[gBankSpriteIds[gActiveBank]].data0 = 2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy2; @@ -2420,9 +2420,9 @@ static void PlayerHandleTrainerSlide(void) static void PlayerHandleTrainerSlideBack(void) { oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 50; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1); @@ -2444,8 +2444,8 @@ static void PlayerHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER); - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 5; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00; gBattleBankFunc[gActiveBank] = sub_80596A8; } @@ -2902,7 +2902,7 @@ static void PlayerHandleHitAnimation(void) else { gDoingBattleAnim = TRUE; - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; DoHitAnimHealthboxEffect(gActiveBank); gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect; } @@ -2963,11 +2963,11 @@ static void PlayerHandleIntroTrainerBallThrow(void) oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 50; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; - gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1); @@ -2988,7 +2988,7 @@ static void PlayerHandleIntroTrainerBallThrow(void) void sub_805CC00(struct Sprite *sprite) { - u8 bank = sprite->data5; + u8 bank = sprite->data[5]; FreeSpriteOamMatrix(sprite); FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(sprite->oam.paletteNum)); diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index c05c3dcf8..3ce12fac7 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -539,18 +539,18 @@ static void DoHitAnimBlinkSpriteEffect(void) { u8 spriteId = gBankSpriteIds[gActiveBank]; - if (gSprites[spriteId].data1 == 32) + if (gSprites[spriteId].data[1] == 32) { - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[1] = 0; gSprites[spriteId].invisible = 0; gDoingBattleAnim = FALSE; PlayerPartnerBufferExecCompleted(); } else { - if ((gSprites[spriteId].data1 % 4) == 0) + if ((gSprites[spriteId].data[1] % 4) == 0) gSprites[spriteId].invisible ^= 1; - gSprites[spriteId].data1++; + gSprites[spriteId].data[1]++; } } @@ -1240,7 +1240,7 @@ static void PlayerPartnerHandleLoadMonSprite(void) GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]); gBattleBankFunc[gActiveBank] = sub_81BB1D4; @@ -1271,11 +1271,11 @@ static void sub_81BD0E4(u8 bank, bool8 dontClearSubstituteBit) GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); - gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; - gSprites[gUnknown_03005D7C[bank]].data2 = bank; + gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank]; + gSprites[gUnknown_03005D7C[bank]].data[2] = bank; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = species; + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = species; gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); @@ -1283,7 +1283,7 @@ static void sub_81BD0E4(u8 bank, bool8 dontClearSubstituteBit) gSprites[gBankSpriteIds[bank]].invisible = TRUE; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void PlayerPartnerHandleReturnMonToBall(void) @@ -1353,7 +1353,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void) gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; } else // otherwise use front sprite @@ -1365,7 +1365,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void) gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; gSprites[gBankSpriteIds[gActiveBank]].pos2.y = 48; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; gSprites[gBankSpriteIds[gActiveBank]].oam.affineMode = 0; gSprites[gBankSpriteIds[gActiveBank]].hFlip = 1; @@ -1382,9 +1382,9 @@ static void PlayerPartnerHandleTrainerSlide(void) static void PlayerPartnerHandleTrainerSlideBack(void) { oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy); gBattleBankFunc[gActiveBank] = sub_81BAE98; @@ -1405,8 +1405,8 @@ static void PlayerPartnerHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER); - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 5; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00; gBattleBankFunc[gActiveBank] = sub_81BB78C; } @@ -1745,7 +1745,7 @@ static void PlayerPartnerHandleHitAnimation(void) else { gDoingBattleAnim = TRUE; - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; DoHitAnimHealthboxEffect(gActiveBank); gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect; } @@ -1806,11 +1806,11 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(void) oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 50; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; - gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1); diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index d400d74b6..a57b2c576 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -449,18 +449,18 @@ static void DoHitAnimBlinkSpriteEffect(void) { u8 spriteId = gBankSpriteIds[gActiveBank]; - if (gSprites[spriteId].data1 == 32) + if (gSprites[spriteId].data[1] == 32) { - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[1] = 0; gSprites[spriteId].invisible = 0; gDoingBattleAnim = FALSE; RecordedOpponentBufferExecCompleted(); } else { - if ((gSprites[spriteId].data1 % 4) == 0) + if ((gSprites[spriteId].data[1] % 4) == 0) gSprites[spriteId].invisible ^= 1; - gSprites[spriteId].data1++; + gSprites[spriteId].data[1]++; } } @@ -1155,7 +1155,7 @@ static void RecordedOpponentHandleLoadMonSprite(void) gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]); @@ -1187,11 +1187,11 @@ static void sub_81885D8(u8 bank, bool8 dontClearSubstituteBit) GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); - gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; - gSprites[gUnknown_03005D7C[bank]].data2 = bank; + gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank]; + gSprites[gUnknown_03005D7C[bank]].data[2] = bank; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = species; + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = species; gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); @@ -1199,7 +1199,7 @@ static void sub_81885D8(u8 bank, bool8 dontClearSubstituteBit) gSprites[gBankSpriteIds[bank]].invisible = TRUE; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); + gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_OPPONENT_SENDOUT); } static void RecordedOpponentHandleReturnMonToBall(void) @@ -1285,7 +1285,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void) sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = 2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBankSpriteIds[gActiveBank]].oam.affineParam = trainerPicId; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; @@ -1301,9 +1301,9 @@ static void RecordedOpponentHandleTrainerSlide(void) static void RecordedOpponentHandleTrainerSlideBack(void) { oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 280; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy); gBattleBankFunc[gActiveBank] = sub_81865C8; @@ -1614,7 +1614,7 @@ static void RecordedOpponentHandleHitAnimation(void) else { gDoingBattleAnim = TRUE; - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; DoHitAnimHealthboxEffect(gActiveBank); gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect; } @@ -1675,9 +1675,9 @@ static void RecordedOpponentHandleIntroTrainerBallThrow(void) oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 280; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 280; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_818962C); diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 5c25ddf88..86558d25c 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -437,18 +437,18 @@ static void DoHitAnimBlinkSpriteEffect(void) { u8 spriteId = gBankSpriteIds[gActiveBank]; - if (gSprites[spriteId].data1 == 32) + if (gSprites[spriteId].data[1] == 32) { - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[1] = 0; gSprites[spriteId].invisible = 0; gDoingBattleAnim = FALSE; RecordedPlayerBufferExecCompleted(); } else { - if ((gSprites[spriteId].data1 % 4) == 0) + if ((gSprites[spriteId].data[1] % 4) == 0) gSprites[spriteId].invisible ^= 1; - gSprites[spriteId].data1++; + gSprites[spriteId].data[1]++; } } @@ -1138,7 +1138,7 @@ static void RecordedPlayerHandleLoadMonSprite(void) GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], gBattleMonForms[gActiveBank]); gBattleBankFunc[gActiveBank] = sub_818A064; @@ -1169,11 +1169,11 @@ static void sub_818BA6C(u8 bank, bool8 dontClearSubstituteBit) GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); - gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; - gSprites[gUnknown_03005D7C[bank]].data2 = bank; + gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank]; + gSprites[gUnknown_03005D7C[bank]].data[2] = bank; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = species; + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = species; gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); @@ -1181,7 +1181,7 @@ static void sub_818BA6C(u8 bank, bool8 dontClearSubstituteBit) gSprites[gBankSpriteIds[bank]].invisible = TRUE; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void RecordedPlayerHandleReturnMonToBall(void) @@ -1272,7 +1272,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; gSprites[gBankSpriteIds[gActiveBank]].pos2.y = 48; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; gSprites[gBankSpriteIds[gActiveBank]].oam.affineMode = 0; gSprites[gBankSpriteIds[gActiveBank]].hFlip = 1; @@ -1285,7 +1285,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; } @@ -1300,9 +1300,9 @@ static void RecordedPlayerHandleTrainerSlide(void) static void RecordedPlayerHandleTrainerSlideBack(void) { oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 35; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 35; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], SpriteCallbackDummy); gBattleBankFunc[gActiveBank] = sub_81899F0; @@ -1323,8 +1323,8 @@ static void RecordedPlayerHandleFaintAnimation(void) gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, -64); - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; - gSprites[gBankSpriteIds[gActiveBank]].data2 = 5; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = 5; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_8039C00; gBattleBankFunc[gActiveBank] = sub_818A114; } @@ -1633,7 +1633,7 @@ static void RecordedPlayerHandleHitAnimation(void) else { gDoingBattleAnim = TRUE; - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; DoHitAnimHealthboxEffect(gActiveBank); gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect; } @@ -1695,11 +1695,11 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(void) oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 50; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; - gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1); diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 635f5fef1..2ec14cab5 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -384,7 +384,7 @@ static void SafariHandleDrawTrainerPic(void) 30); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy; } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 7aec76ffa..9df747888 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -396,18 +396,18 @@ static void DoHitAnimBlinkSpriteEffect(void) { u8 spriteId = gBankSpriteIds[gActiveBank]; - if (gSprites[spriteId].data1 == 32) + if (gSprites[spriteId].data[1] == 32) { - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[1] = 0; gSprites[spriteId].invisible = 0; gDoingBattleAnim = FALSE; WallyBufferExecCompleted(); } else { - if ((gSprites[spriteId].data1 % 4) == 0) + if ((gSprites[spriteId].data[1] % 4) == 0) gSprites[spriteId].invisible ^= 1; - gSprites[spriteId].data1++; + gSprites[spriteId].data[1]++; } } @@ -1073,7 +1073,7 @@ static void WallyHandleDrawTrainerPic(void) 30); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240; - gSprites[gBankSpriteIds[gActiveBank]].data0 = -2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = -2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy; } @@ -1088,7 +1088,7 @@ static void WallyHandleTrainerSlide(void) 30); gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank; gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -96; - gSprites[gBankSpriteIds[gActiveBank]].data0 = 2; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 2; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC; gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy2; } @@ -1408,7 +1408,7 @@ static void WallyHandleHitAnimation(void) else { gDoingBattleAnim = TRUE; - gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; + gSprites[gBankSpriteIds[gActiveBank]].data[1] = 0; DoHitAnimHealthboxEffect(gActiveBank); gBattleBankFunc[gActiveBank] = DoHitAnimBlinkSpriteEffect; } @@ -1462,11 +1462,11 @@ static void WallyHandleIntroTrainerBallThrow(void) oamt_add_pos2_onto_pos1(&gSprites[gBankSpriteIds[gActiveBank]]); - gSprites[gBankSpriteIds[gActiveBank]].data0 = 50; - gSprites[gBankSpriteIds[gActiveBank]].data2 = -40; - gSprites[gBankSpriteIds[gActiveBank]].data4 = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; + gSprites[gBankSpriteIds[gActiveBank]].data[0] = 50; + gSprites[gBankSpriteIds[gActiveBank]].data[2] = -40; + gSprites[gBankSpriteIds[gActiveBank]].data[4] = gSprites[gBankSpriteIds[gActiveBank]].pos1.y; gSprites[gBankSpriteIds[gActiveBank]].callback = sub_80A6EEC; - gSprites[gBankSpriteIds[gActiveBank]].data5 = gActiveBank; + gSprites[gBankSpriteIds[gActiveBank]].data[5] = gActiveBank; StoreSpriteCallbackInData6(&gSprites[gBankSpriteIds[gActiveBank]], sub_805CC00); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 1); @@ -1499,17 +1499,17 @@ static void sub_816AA80(u8 bank) GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); - gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; - gSprites[gUnknown_03005D7C[bank]].data2 = bank; + gSprites[gUnknown_03005D7C[bank]].data[1] = gBankSpriteIds[bank]; + gSprites[gUnknown_03005D7C[bank]].data[2] = bank; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = species; + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = species; gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); gSprites[gBankSpriteIds[bank]].invisible = TRUE; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gUnknown_03005D7C[bank]].data0 = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); + gSprites[gUnknown_03005D7C[bank]].data[0] = DoPokeballSendOutAnimation(0, POKEBALL_PLAYER_SENDOUT); } static void sub_816AC04(u8 taskId) diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 8ab9b541a..813d6d71b 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -332,7 +332,7 @@ static u16 BattlePalaceGetTargetRetValue(void) void sub_805D714(struct Sprite *sprite) { - u8 spriteId = sprite->data1; + u8 spriteId = sprite->data[1]; if (!gSprites[spriteId].affineAnimEnded) return; @@ -367,7 +367,7 @@ void sub_805D7AC(struct Sprite *sprite) { if (!(gUnknown_020243FC & 1)) { - sprite->pos2.x += sprite->data0; + sprite->pos2.x += sprite->data[0]; if (sprite->pos2.x == 0) { if (sprite->pos2.y != 0) @@ -1134,7 +1134,7 @@ void sub_805EB9C(u8 affineMode) } } -#define tBank data0 +#define tBank data[0] void LoadAndCreateEnemyShadowSprites(void) { @@ -1144,13 +1144,13 @@ void LoadAndCreateEnemyShadowSprites(void) bank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankPosition(bank, 0), GetBankPosition(bank, 1) + 29, 0xC8); - gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data0 = bank; + gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data[0] = bank; if (IsDoubleBattle()) { bank = GetBankByIdentity(IDENTITY_OPPONENT_MON2); gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, GetBankPosition(bank, 0), GetBankPosition(bank, 1) + 29, 0xC8); - gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data0 = bank; + gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data[0] = bank; } } diff --git a/src/battle_interface.c b/src/battle_interface.c index 240c64862..63813a424 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -927,7 +927,7 @@ u8 CreateBankHealthboxSprites(u8 bank) data6 = 2; } gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2; - gSprites[healthboxSpriteId_2].data5 = healthboxSpriteId_1; + gSprites[healthboxSpriteId_2].data[5] = healthboxSpriteId_1; gSprites[healthboxSpriteId_2].callback = sub_8072924; } else @@ -939,7 +939,7 @@ u8 CreateBankHealthboxSprites(u8 bank) gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2; - gSprites[healthboxSpriteId_2].data5 = healthboxSpriteId_1; + gSprites[healthboxSpriteId_2].data[5] = healthboxSpriteId_1; gSprites[healthboxSpriteId_2].oam.tileNum += 32; gSprites[healthboxSpriteId_2].callback = sub_8072924; @@ -952,7 +952,7 @@ u8 CreateBankHealthboxSprites(u8 bank) gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2; - gSprites[healthboxSpriteId_2].data5 = healthboxSpriteId_1; + gSprites[healthboxSpriteId_2].data[5] = healthboxSpriteId_1; gSprites[healthboxSpriteId_2].oam.tileNum += 32; gSprites[healthboxSpriteId_2].callback = sub_8072924; @@ -968,14 +968,14 @@ u8 CreateBankHealthboxSprites(u8 bank) CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void*)(OBJ_VRAM0 + unkSpritePtr->oam.tileNum * 32), 64); - gSprites[healthboxSpriteId_1].data5 = unkSpriteId; - gSprites[healthboxSpriteId_1].data6 = bank; + gSprites[healthboxSpriteId_1].data[5] = unkSpriteId; + gSprites[healthboxSpriteId_1].data[6] = bank; gSprites[healthboxSpriteId_1].invisible = 1; gSprites[healthboxSpriteId_2].invisible = 1; - unkSpritePtr->data5 = healthboxSpriteId_1; - unkSpritePtr->data6 = data6; + unkSpritePtr->data[5] = healthboxSpriteId_1; + unkSpritePtr->data[6] = data6; unkSpritePtr->invisible = 1; return healthboxSpriteId_1; @@ -994,7 +994,7 @@ u8 CreateSafariPlayerHealthboxSprites(void) gSprites[healthboxSpriteId_2].oam.tileNum += 64; gSprites[healthboxSpriteId_1].oam.affineParam = healthboxSpriteId_2; - gSprites[healthboxSpriteId_2].data5 = healthboxSpriteId_1; + gSprites[healthboxSpriteId_2].data[5] = healthboxSpriteId_1; gSprites[healthboxSpriteId_2].callback = sub_8072924; @@ -1008,9 +1008,9 @@ static const u8 *GetHealthboxElementGfxPtr(u8 elementId) static void sub_80728B4(struct Sprite *sprite) { - u8 var = sprite->data5; + u8 var = sprite->data[5]; - switch (sprite->data6) + switch (sprite->data[6]) { case 0: sprite->pos1.x = gSprites[var].pos1.x + 16; @@ -1033,7 +1033,7 @@ static void sub_80728B4(struct Sprite *sprite) static void sub_8072924(struct Sprite *sprite) { - u8 otherSpriteId = sprite->data5; + u8 otherSpriteId = sprite->data[5]; sprite->pos1.x = gSprites[otherSpriteId].pos1.x + 64; sprite->pos1.y = gSprites[otherSpriteId].pos1.y; @@ -1054,14 +1054,14 @@ void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, void SetHealthboxSpriteInvisible(u8 healthboxSpriteId) { gSprites[healthboxSpriteId].invisible = 1; - gSprites[gSprites[healthboxSpriteId].data5].invisible = 1; + gSprites[gSprites[healthboxSpriteId].data[5]].invisible = 1; gSprites[gSprites[healthboxSpriteId].oam.affineParam].invisible = 1; } void SetHealthboxSpriteVisible(u8 healthboxSpriteId) { gSprites[healthboxSpriteId].invisible = 0; - gSprites[gSprites[healthboxSpriteId].data5].invisible = 0; + gSprites[gSprites[healthboxSpriteId].data[5]].invisible = 0; gSprites[gSprites[healthboxSpriteId].oam.affineParam].invisible = 0; } @@ -1074,7 +1074,7 @@ static void UpdateSpritePos(u8 spriteId, s16 x, s16 y) void DestoryHealthboxSprite(u8 healthboxSpriteId) { DestroySprite(&gSprites[gSprites[healthboxSpriteId].oam.affineParam]); - DestroySprite(&gSprites[gSprites[healthboxSpriteId].data5]); + DestroySprite(&gSprites[gSprites[healthboxSpriteId].data[5]]); DestroySprite(&gSprites[healthboxSpriteId]); } @@ -1091,7 +1091,7 @@ void UpdateOamPriorityInAllHealthboxes(u8 priority) { u8 healthboxSpriteId_1 = gHealthBoxesIds[i]; u8 healthboxSpriteId_2 = gSprites[gHealthBoxesIds[i]].oam.affineParam; - u8 healthboxSpriteId_3 = gSprites[gHealthBoxesIds[i]].data5; + u8 healthboxSpriteId_3 = gSprites[gHealthBoxesIds[i]].data[5]; gSprites[healthboxSpriteId_1].oam.priority = priority; gSprites[healthboxSpriteId_2].oam.priority = priority; @@ -1156,7 +1156,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl) windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, xPos, 3, 2, &windowId); spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * 32; - if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER) + if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER) { objVram = (void*)(OBJ_VRAM0); if (!IsDoubleBattle()) @@ -1180,7 +1180,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent) u8 text[32]; void *objVram; - if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER && !IsDoubleBattle()) + if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER && !IsDoubleBattle()) { spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * 32; if (maxOrCurrent != HP_CURRENT) // singles, max @@ -1213,7 +1213,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent) u8 bank; memcpy(text, sUnknown_0832C3C4, sizeof(sUnknown_0832C3C4)); - bank = gSprites[healthboxSpriteId].data6; + bank = gSprites[healthboxSpriteId].data[6]; if (IsDoubleBattle() == TRUE || GetBankSide(bank) == SIDE_OPPONENT) { UpdateHpTextInHealthboxInDoubles(healthboxSpriteId, value, maxOrCurrent); @@ -1223,7 +1223,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent) u32 var; u8 i; - if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER) + if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER) { if (maxOrCurrent == HP_CURRENT) var = 29; @@ -1258,11 +1258,11 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 u8 text[32]; void *objVram; - if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER) + if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER) { - if (gBattleSpritesDataPtr->bankData[gSprites[healthboxSpriteId].data6].hpNumbersNoBars) // don't print text if only bars are visible + if (gBattleSpritesDataPtr->bankData[gSprites[healthboxSpriteId].data[6]].hpNumbersNoBars) // don't print text if only bars are visible { - spriteTileNum = gSprites[gSprites[healthboxSpriteId].data5].oam.tileNum * 32; + spriteTileNum = gSprites[gSprites[healthboxSpriteId].data[5]].oam.tileNum * 32; objVram = (void*)(OBJ_VRAM0) + spriteTileNum; if (maxOrCurrent != HP_CURRENT) // doubles, max hp @@ -1292,7 +1292,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 u8 bank; memcpy(text, sUnknown_0832C3D8, sizeof(sUnknown_0832C3D8)); - bank = gSprites[healthboxSpriteId].data6; + bank = gSprites[healthboxSpriteId].data[6]; if (gBattleSpritesDataPtr->bankData[bank].hpNumbersNoBars) // don't print text if only bars are visible { @@ -1304,7 +1304,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 if (maxOrCurrent == HP_CURRENT) var = 0; - r7 = gSprites[healthboxSpriteId].data5; + r7 = gSprites[healthboxSpriteId].data[5]; txtPtr = ConvertIntToDecimalStringN(text + 6, value, STR_CONV_MODE_RIGHT_ALIGN, 3); if (!maxOrCurrent) StringCopy(txtPtr, gText_Slash); @@ -1354,7 +1354,7 @@ static void sub_80730D4(u8 healthboxSpriteId, struct Pokemon *mon) u8 i, var, nature, healthboxSpriteId_2; memcpy(text, sUnknown_0832C3C4, sizeof(sUnknown_0832C3C4)); - barFontGfx = &gMonSpritesGfxPtr->barFontGfx[0x520 + (GetBankIdentity(gSprites[healthboxSpriteId].data6) * 384)]; + barFontGfx = &gMonSpritesGfxPtr->barFontGfx[0x520 + (GetBankIdentity(gSprites[healthboxSpriteId].data[6]) * 384)]; var = 5; nature = GetNature(mon); StringCopy(text + 6, gNatureNamePointers[nature]); @@ -1385,7 +1385,7 @@ static void sub_80730D4(u8 healthboxSpriteId, struct Pokemon *mon) barFontGfx += 0x20; } - healthboxSpriteId_2 = gSprites[healthboxSpriteId].data5; + healthboxSpriteId_2 = gSprites[healthboxSpriteId].data[5]; ConvertIntToDecimalStringN(text + 6, gBattleStruct->field_7C, STR_CONV_MODE_RIGHT_ALIGN, 2); ConvertIntToDecimalStringN(text + 9, gBattleStruct->field_7B, STR_CONV_MODE_RIGHT_ALIGN, 2); text[5] = CHAR_SPACE; @@ -1434,7 +1434,7 @@ void SwapHpBarsWithHpText(void) if (noBars == TRUE) // bars to text { - spriteId = gSprites[gHealthBoxesIds[i]].data5; + spriteId = gSprites[gHealthBoxesIds[i]].data[5]; CpuFill32(0, (void*)(OBJ_VRAM0 + gSprites[spriteId].oam.tileNum * 32), 0x100); UpdateHpTextInHealthboxInDoubles(gHealthBoxesIds[i], GetMonData(&gPlayerParty[gBattlePartyID[i]], MON_DATA_HP), HP_CURRENT); @@ -1457,7 +1457,7 @@ void SwapHpBarsWithHpText(void) } else { - spriteId = gSprites[gHealthBoxesIds[i]].data5; + spriteId = gSprites[gHealthBoxesIds[i]].data[5]; CpuFill32(0, (void *)(OBJ_VRAM0 + gSprites[spriteId].oam.tileNum * 32), 0x100); UpdateHpTextInHealthboxInDoubles(gHealthBoxesIds[i], GetMonData(&gEnemyParty[gBattlePartyID[i]], MON_DATA_HP), HP_CURRENT); @@ -1472,7 +1472,7 @@ void SwapHpBarsWithHpText(void) UpdateHealthboxAttribute(gHealthBoxesIds[i], &gEnemyParty[gBattlePartyID[i]], HEALTHBOX_NICK); } } - gSprites[gHealthBoxesIds[i]].data7 ^= 1; + gSprites[gHealthBoxesIds[i]].data[7] ^= 1; } } } @@ -1524,7 +1524,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar barSpriteId = CreateSprite(&sStatusSummaryBarSpriteTemplates[isOpponent], bar_X, bar_Y, 10); SetSubspriteTables(&gSprites[barSpriteId], sStatusSummaryBar_SubspriteTable); gSprites[barSpriteId].pos2.x = bar_pos2_X; - gSprites[barSpriteId].data0 = bar_data0; + gSprites[barSpriteId].data[0] = bar_data0; if (isOpponent) { @@ -1549,22 +1549,22 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar gSprites[ballIconSpritesIds[i]].pos2.y = 0; } - gSprites[ballIconSpritesIds[i]].data0 = barSpriteId; + gSprites[ballIconSpritesIds[i]].data[0] = barSpriteId; if (!isOpponent) { gSprites[ballIconSpritesIds[i]].pos1.x += 10 * i + 24; - gSprites[ballIconSpritesIds[i]].data1 = i * 7 + 10; + gSprites[ballIconSpritesIds[i]].data[1] = i * 7 + 10; gSprites[ballIconSpritesIds[i]].pos2.x = 120; } else { gSprites[ballIconSpritesIds[i]].pos1.x -= 10 * (5 - i) + 24; - gSprites[ballIconSpritesIds[i]].data1 = (6 - i) * 7 + 10; + gSprites[ballIconSpritesIds[i]].data[1] = (6 - i) * 7 + 10; gSprites[ballIconSpritesIds[i]].pos2.x = -120; } - gSprites[ballIconSpritesIds[i]].data2 = isOpponent; + gSprites[ballIconSpritesIds[i]].data[2] = isOpponent; } if (GetBankSide(bank) == SIDE_PLAYER) @@ -1576,7 +1576,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar if (partyInfo[i].hp == 0xFFFF) // empty slot or an egg { gSprites[ballIconSpritesIds[i]].oam.tileNum += 1; - gSprites[ballIconSpritesIds[i]].data7 = 1; + gSprites[ballIconSpritesIds[i]].data[7] = 1; } else if (partyInfo[i].hp == 0) // fainted mon { @@ -1595,7 +1595,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar if (partyInfo[j].hp == 0xFFFF) // empty slot or an egg { gSprites[ballIconSpritesIds[var]].oam.tileNum += 1; - gSprites[ballIconSpritesIds[var]].data7 = 1; + gSprites[ballIconSpritesIds[var]].data[7] = 1; var--; continue; } @@ -1624,7 +1624,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar if (partyInfo[i].hp == 0xFFFF) // empty slot or an egg { gSprites[ballIconSpritesIds[var]].oam.tileNum += 1; - gSprites[ballIconSpritesIds[var]].data7 = 1; + gSprites[ballIconSpritesIds[var]].data[7] = 1; } else if (partyInfo[i].hp == 0) // fainted mon { @@ -1644,7 +1644,7 @@ u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 ar if (partyInfo[j].hp == 0xFFFF) // empty slot or an egg { gSprites[ballIconSpritesIds[i]].oam.tileNum += 1; - gSprites[ballIconSpritesIds[i]].data7 = 1; + gSprites[ballIconSpritesIds[i]].data[7] = 1; i++; continue; } @@ -1714,21 +1714,21 @@ void sub_8073C30(u8 taskId) { if (GetBankSide(bank) != SIDE_PLAYER) { - gSprites[sp[5 - i]].data1 = 7 * i; - gSprites[sp[5 - i]].data3 = 0; - gSprites[sp[5 - i]].data4 = 0; + gSprites[sp[5 - i]].data[1] = 7 * i; + gSprites[sp[5 - i]].data[3] = 0; + gSprites[sp[5 - i]].data[4] = 0; gSprites[sp[5 - i]].callback = sub_8074158; } else { - gSprites[sp[i]].data1 = 7 * i; - gSprites[sp[i]].data3 = 0; - gSprites[sp[i]].data4 = 0; + gSprites[sp[i]].data[1] = 7 * i; + gSprites[sp[i]].data[3] = 0; + gSprites[sp[i]].data[4] = 0; gSprites[sp[i]].callback = sub_8074158; } } - gSprites[r10].data0 /= 2; - gSprites[r10].data1 = 0; + gSprites[r10].data[0] /= 2; + gSprites[r10].data[1] = 0; gSprites[r10].callback = sub_8074090; SetSubspriteTables(&gSprites[r10], sUnknown_0832C2CC); gTasks[taskId].func = sub_8073E08; @@ -1831,17 +1831,17 @@ static void sub_8073F98(u8 taskId) static void SpriteCB_StatusSummaryBar(struct Sprite *sprite) { if (sprite->pos2.x != 0) - sprite->pos2.x += sprite->data0; + sprite->pos2.x += sprite->data[0]; } static void sub_8074090(struct Sprite *sprite) { - sprite->data1 += 32; - if (sprite->data0 > 0) - sprite->pos2.x += sprite->data1 >> 4; + sprite->data[1] += 32; + if (sprite->data[0] > 0) + sprite->pos2.x += sprite->data[1] >> 4; else - sprite->pos2.x -= sprite->data1 >> 4; - sprite->data1 &= 0xF; + sprite->pos2.x -= sprite->data[1] >> 4; + sprite->data[1] &= 0xF; } static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite) @@ -1850,16 +1850,16 @@ static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite) u16 var2; s8 pan; - if (sprite->data1 > 0) + if (sprite->data[1] > 0) { - sprite->data1--; + sprite->data[1]--; return; } - var1 = sprite->data2; - var2 = sprite->data3; + var1 = sprite->data[2]; + var2 = sprite->data[3]; var2 += 56; - sprite->data3 = var2 & 0xFFF0; + sprite->data[3] = var2 & 0xFFF0; if (var1 != 0) { @@ -1880,7 +1880,7 @@ static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite) if (var1 != 0) pan = PAN_SIDE_PLAYER; - if (sprite->data7 != 0) + if (sprite->data[7] != 0) PlaySE2WithPanning(SE_TB_KARA, pan); else PlaySE1WithPanning(SE_TB_KON, pan); @@ -1894,15 +1894,15 @@ static void sub_8074158(struct Sprite *sprite) u8 var1; u16 var2; - if (sprite->data1 > 0) + if (sprite->data[1] > 0) { - sprite->data1--; + sprite->data[1]--; return; } - var1 = sprite->data2; - var2 = sprite->data3; + var1 = sprite->data[2]; + var2 = sprite->data[3]; var2 += 56; - sprite->data3 = var2 & 0xFFF0; + sprite->data[3] = var2 & 0xFFF0; if (var1 != 0) sprite->pos2.x += var2 >> 4; else @@ -1917,7 +1917,7 @@ static void sub_8074158(struct Sprite *sprite) static void SpriteCB_StatusSummaryBallsOnSwitchout(struct Sprite *sprite) { - u8 barSpriteId = sprite->data0; + u8 barSpriteId = sprite->data[0]; sprite->pos2.x = gSprites[barSpriteId].pos2.x; sprite->pos2.y = gSprites[barSpriteId].pos2.y; @@ -1964,7 +1964,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon) spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * 32; - if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER) + if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER) { sub_8075198((void*)(0x6010040 + spriteTileNum), windowTileData, 6); ptr = (void*)(OBJ_VRAM0); @@ -1991,13 +1991,13 @@ static void TryAddPokeballIconToHealthbox(u8 healthboxSpriteId, bool8 noStatus) if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) return; - bank = gSprites[healthboxSpriteId].data6; + bank = gSprites[healthboxSpriteId].data[6]; if (GetBankSide(bank) == SIDE_PLAYER) return; if (!GetSetPokedexFlag(SpeciesToNationalPokedexNum(GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES)), FLAG_GET_CAUGHT)) return; - healthboxSpriteId_2 = gSprites[healthboxSpriteId].data5; + healthboxSpriteId_2 = gSprites[healthboxSpriteId].data[5]; if (noStatus) CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_70), (void*)(OBJ_VRAM0 + (gSprites[healthboxSpriteId_2].oam.tileNum + 8) * 32), 32); @@ -2014,8 +2014,8 @@ static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId) s16 tileNumAdder; u8 statusPalId; - bank = gSprites[healthboxSpriteId].data6; - healthboxSpriteId_2 = gSprites[healthboxSpriteId].data5; + bank = gSprites[healthboxSpriteId].data[6]; + healthboxSpriteId_2 = gSprites[healthboxSpriteId].data[5]; if (GetBankSide(bank) == SIDE_PLAYER) { status = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_STATUS); @@ -2178,12 +2178,12 @@ static void UpdateLeftNoOfBallsTextOnHealthbox(u8 healthboxSpriteId) void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId) { s32 maxHp, currHp; - u8 bank = gSprites[healthboxSpriteId].data6; + u8 bank = gSprites[healthboxSpriteId].data[6]; if (elementId == HEALTHBOX_ALL && !IsDoubleBattle()) GetBankSide(bank); // pointless function call - if (GetBankSide(gSprites[healthboxSpriteId].data6) == SIDE_PLAYER) + if (GetBankSide(gSprites[healthboxSpriteId].data[6]) == SIDE_PLAYER) { u8 isDoubles; @@ -2308,7 +2308,7 @@ static void sub_8074B9C(u8 bank, u8 whichBar) } for (i = 0; i < 6; i++) { - u8 healthboxSpriteId_2 = gSprites[gBattleSpritesDataPtr->battleBars[bank].healthboxSpriteId].data5; + u8 healthboxSpriteId_2 = gSprites[gBattleSpritesDataPtr->battleBars[bank].healthboxSpriteId].data[5]; if (i < 2) CpuCopy32(GetHealthboxElementGfxPtr(barElementId) + array[i] * 32, (void*)(OBJ_VRAM0 + (gSprites[healthboxSpriteId_2].oam.tileNum + 2 + i) * 32), 32); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d9b35c053..f91a52480 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6782,8 +6782,8 @@ static bool8 sub_804F344(void) return (gBattle_BG2_X != 0x1A0); } -#define sDestroy data0 -#define sSavedLvlUpBoxXPosition data1 +#define sDestroy data[0] +#define sSavedLvlUpBoxXPosition data[1] static void PutMonIconOnLvlUpBox(void) { diff --git a/src/berry_blender.c b/src/berry_blender.c index aa333ebaf..a6144a35d 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1002,35 +1002,35 @@ static void sub_807FAC8(void) static void sub_807FD08(struct Sprite* sprite) { - sprite->data1 += sprite->data6; - sprite->data2 -= sprite->data4; - sprite->data2 += sprite->data7; - sprite->data0 += sprite->data7; - sprite->data4--; + sprite->data[1] += sprite->data[6]; + sprite->data[2] -= sprite->data[4]; + sprite->data[2] += sprite->data[7]; + sprite->data[0] += sprite->data[7]; + sprite->data[4]--; - if (sprite->data0 < sprite->data2) + if (sprite->data[0] < sprite->data[2]) { - sprite->data3 = sprite->data4 = sprite->data3 - 1; + sprite->data[3] = sprite->data[4] = sprite->data[3] - 1; - if (++sprite->data5 > 3) + if (++sprite->data[5] > 3) DestroySprite(sprite); else PlaySE(SE_TB_KARA); } - sprite->pos1.x = sprite->data1; - sprite->pos1.y = sprite->data2; + sprite->pos1.x = sprite->data[1]; + sprite->pos1.y = sprite->data[2]; } static void sub_807FD64(struct Sprite* sprite, s16 a2, s16 a3, s16 a4, s16 a5, s16 a6) { - sprite->data0 = a3; - sprite->data1 = a2; - sprite->data2 = a3; - sprite->data3 = a4; - sprite->data4 = 10; - sprite->data5 = 0; - sprite->data6 = a5; - sprite->data7 = a6; + sprite->data[0] = a3; + sprite->data[1] = a2; + sprite->data[2] = a3; + sprite->data[3] = a4; + sprite->data[4] = 10; + sprite->data[5] = 0; + sprite->data[6] = a5; + sprite->data[7] = a6; sprite->callback = sub_807FD08; } @@ -2909,10 +2909,10 @@ static void BerryBlender_SetBackgroundsPos(void) static void sub_8082E3C(struct Sprite* sprite) { - sprite->data2 += sprite->data0; - sprite->data3 += sprite->data1; - sprite->pos2.x = sprite->data2 / 8; - sprite->pos2.y = sprite->data3 / 8; + sprite->data[2] += sprite->data[0]; + sprite->data[3] += sprite->data[1]; + sprite->pos2.x = sprite->data[2] / 8; + sprite->pos2.y = sprite->data[3] / 8; if (sprite->animEnded) DestroySprite(sprite); @@ -2935,8 +2935,8 @@ static void sub_8082E84(void) y = gSineTable[(rand & 0xFF)] / 4; spriteId = CreateSprite(&sUnknown_08339BE0, x + 120, y + 80, 1); - gSprites[spriteId].data0 = 16 - (Random() % 32); - gSprites[spriteId].data1 = 16 - (Random() % 32); + gSprites[spriteId].data[0] = 16 - (Random() % 32); + gSprites[spriteId].data[1] = 16 - (Random() % 32); gSprites[spriteId].callback = sub_8082E3C; } @@ -2944,8 +2944,8 @@ static void sub_8082E84(void) static void sub_8082F68(struct Sprite* sprite) { - sprite->data0++; - sprite->pos2.y = -(sprite->data0 / 3); + sprite->data[0]++; + sprite->pos2.y = -(sprite->data[0] / 3); if (sprite->animEnded) DestroySprite(sprite); @@ -2953,8 +2953,8 @@ static void sub_8082F68(struct Sprite* sprite) static void sub_8082F9C(struct Sprite* sprite) { - sprite->data0++; - sprite->pos2.y = -(sprite->data0 * 2); + sprite->data[0]++; + sprite->pos2.y = -(sprite->data[0] * 2); if (sprite->pos2.y < -12) sprite->pos2.y = -12; @@ -2970,68 +2970,68 @@ static void Blender_SetBankBerryData(u8 bank, u16 itemId) static void sub_8083010(struct Sprite* sprite) { - switch (sprite->data0) + switch (sprite->data[0]) { case 0: - sprite->data1 += 8; - if (sprite->data1 > 88) + sprite->data[1] += 8; + if (sprite->data[1] > 88) { - sprite->data1 = 88; - sprite->data0++; + sprite->data[1] = 88; + sprite->data[0]++; PlaySE(SE_KON); } break; case 1: - sprite->data2 += 1; - if (sprite->data2 > 20) + sprite->data[2] += 1; + if (sprite->data[2] > 20) { - sprite->data0++; - sprite->data2 = 0; + sprite->data[0]++; + sprite->data[2] = 0; } break; case 2: - sprite->data1 += 4; - if (sprite->data1 > 176) + sprite->data[1] += 4; + if (sprite->data[1] > 176) { - if (++sprite->data3 == 3) + if (++sprite->data[3] == 3) { DestroySprite(sprite); CreateSprite(&sUnknown_08339C60, 120, -20, 2); } else { - sprite->data0 = 0; - sprite->data1 = -16; - StartSpriteAnim(sprite, sprite->data3); + sprite->data[0] = 0; + sprite->data[1] = -16; + StartSpriteAnim(sprite, sprite->data[3]); } } break; } - sprite->pos2.y = sprite->data1; + sprite->pos2.y = sprite->data[1]; } static void sub_80830C0(struct Sprite* sprite) { - switch (sprite->data0) + switch (sprite->data[0]) { case 0: - sprite->data1 += 8; - if (sprite->data1 > 92) + sprite->data[1] += 8; + if (sprite->data[1] > 92) { - sprite->data1 = 92; - sprite->data0++; + sprite->data[1] = 92; + sprite->data[0]++; PlaySE(SE_PIN); } break; case 1: - sprite->data2 += 1; - if (sprite->data2 > 20) - sprite->data0++; + sprite->data[2] += 1; + if (sprite->data[2] > 20) + sprite->data[0]++; break; case 2: - sprite->data1 += 4; - if (sprite->data1 > 176) + sprite->data[1] += 4; + if (sprite->data[1] > 176) { sBerryBlenderData->mainState++; DestroySprite(sprite); @@ -3039,7 +3039,7 @@ static void sub_80830C0(struct Sprite* sprite) break; } - sprite->pos2.y = sprite->data1; + sprite->pos2.y = sprite->data[1]; } static void sub_8083140(u16 a0, u16 a1) diff --git a/src/decoration.c b/src/decoration.c index 8093825f4..e4c84d0b9 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1302,7 +1302,7 @@ void sub_8128060(u8 taskId) void ConfigureCameraObjectForPlacingDecoration(struct PlaceDecorationGraphicsDataBuffer *data, u8 decor) { - sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data0; + sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data[0]; gUnknown_03005DD0.unk4 = gpu_pal_decompress_alloc_tag_and_upload(data, decor); gSprites[gUnknown_03005DD0.unk4].oam.priority = 1; gSprites[gUnknown_03005DD0.unk4].callback = sub_81292D0; @@ -1383,8 +1383,8 @@ void sub_812826C(u8 taskId) void sub_81283BC(u8 taskId) { gTasks[taskId].data[10] = 0; - gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 1; - gSprites[sDecor_CameraSpriteObjectIdx2].data7 = 1; + gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 1; + gSprites[sDecor_CameraSpriteObjectIdx2].data[7] = 1; sub_8128DE0(); sub_8128950(taskId); } @@ -1392,8 +1392,8 @@ void sub_81283BC(u8 taskId) void sub_8128414(u8 taskId) { gTasks[taskId].data[10] = 0; - gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 1; - gSprites[sDecor_CameraSpriteObjectIdx2].data7 = 1; + gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 1; + gSprites[sDecor_CameraSpriteObjectIdx2].data[7] = 1; sub_8128DE0(); StringExpandPlaceholders(gStringVar4, gText_CancelDecorating); DisplayItemMessageOnField(taskId, gStringVar4, sub_8128B80); @@ -1769,8 +1769,8 @@ bool8 sub_8128DB4(void) void sub_8128DE0(void) { sDecorationLastDirectionMoved = 0; - gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0; - gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = 0; } void sub_8128E18(u8 taskId) @@ -1778,7 +1778,7 @@ void sub_8128E18(u8 taskId) s16 *data; data = gTasks[taskId].data; - if (!gSprites[sDecor_CameraSpriteObjectIdx1].data4) + if (!gSprites[sDecor_CameraSpriteObjectIdx1].data[4]) { if (data[10] == 1) { @@ -1792,29 +1792,29 @@ void sub_8128E18(u8 taskId) if ((gMain.heldKeys & 0x0F0) == DPAD_UP) { sDecorationLastDirectionMoved = DIR_SOUTH; - gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0; - gSprites[sDecor_CameraSpriteObjectIdx1].data3 = -2; + gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = -2; data[1]--; } if ((gMain.heldKeys & 0x0F0) == DPAD_DOWN) { sDecorationLastDirectionMoved = DIR_NORTH; - gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 0; - gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 2; + gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = 2; data[1]++; } if ((gMain.heldKeys & 0x0F0) == DPAD_LEFT) { sDecorationLastDirectionMoved = DIR_WEST; - gSprites[sDecor_CameraSpriteObjectIdx1].data2 = -2; - gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = -2; + gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = 0; data[0]--; } if ((gMain.heldKeys & 0x0F0) == DPAD_RIGHT) { sDecorationLastDirectionMoved = DIR_EAST; - gSprites[sDecor_CameraSpriteObjectIdx1].data2 = 2; - gSprites[sDecor_CameraSpriteObjectIdx1].data3 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data[2] = 2; + gSprites[sDecor_CameraSpriteObjectIdx1].data[3] = 0; data[0]++; } if (!sub_8128DB4() || !sub_8128D10(taskId)) @@ -1824,8 +1824,8 @@ void sub_8128E18(u8 taskId) } if (sDecorationLastDirectionMoved) { - gSprites[sDecor_CameraSpriteObjectIdx1].data4++; - gSprites[sDecor_CameraSpriteObjectIdx1].data4 &= 7; + gSprites[sDecor_CameraSpriteObjectIdx1].data[4]++; + gSprites[sDecor_CameraSpriteObjectIdx1].data[4] &= 7; } if (!data[10]) { @@ -1843,7 +1843,7 @@ void sub_8128E18(u8 taskId) void sub_8128FD8(u8 taskId) { sub_8197434(0, 1); - gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0; gTasks[taskId].data[10] = 0; gTasks[taskId].func = sub_8128E18; } @@ -1954,20 +1954,20 @@ void SetDecorSelectionBoxOamAttributes(u8 decorShape) void sub_81292D0(struct Sprite *sprite) { - sprite->data2 = 0; - sprite->data3 = 0; - sprite->data4 = 0; - sprite->data5 = 0; - sprite->data6 = 0; - sprite->data7 = 0; + sprite->data[2] = 0; + sprite->data[3] = 0; + sprite->data[4] = 0; + sprite->data[5] = 0; + sprite->data[6] = 0; + sprite->data[7] = 0; sprite->callback = sub_81292E8; } void sub_81292E8(struct Sprite *sprite) { - if (sprite->data7 == 0) + if (sprite->data[7] == 0) { - if (sprite->data6 < 15) + if (sprite->data[6] < 15) { sprite->invisible = FALSE; } @@ -1975,8 +1975,8 @@ void sub_81292E8(struct Sprite *sprite) { sprite->invisible = TRUE; } - sprite->data6 ++; - sprite->data6 &= 0x1F; + sprite->data[6] ++; + sprite->data[6] &= 0x1F; } else { @@ -2248,7 +2248,7 @@ bool8 sub_81299AC(u8 taskId) void SetUpPuttingAwayDecorationPlayerAvatar(void) { player_get_direction_lower_nybble(); - sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data0; + sDecor_CameraSpriteObjectIdx1 = gSprites[gUnknown_03005DD0.unk4].data[0]; sub_812A39C(); gUnknown_03005DD0.unk4 = CreateSprite(&gUnknown_085A7404, 0x78, 0x50, 0); if (gSaveBlock2Ptr->playerGender == MALE) @@ -2299,7 +2299,7 @@ void sub_8129ABC(u8 taskId) void sub_8129B34(u8 taskId) { sub_8197434(0, 1); - gSprites[sDecor_CameraSpriteObjectIdx1].data7 = 0; + gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0; gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE; gSprites[sDecor_CameraSpriteObjectIdx1].callback = sub_812A36C; gSprites[sDecor_CameraSpriteObjectIdx2].pos1.x = 0x88; @@ -2719,9 +2719,9 @@ void sub_812A334(void) void sub_812A36C(struct Sprite *sprite) { - sprite->data0 ++; - sprite->data0 &= 0x1F; - if (sprite->data0 > 15) + sprite->data[0] ++; + sprite->data[0] &= 0x1F; + if (sprite->data[0] > 15) { sprite->invisible = TRUE; } diff --git a/src/egg_hatch.c b/src/egg_hatch.c index d9d77d2e9..7fba0cd00 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -709,16 +709,16 @@ static void CB2_EggHatch_1(void) static void SpriteCB_Egg_0(struct Sprite* sprite) { - if (++sprite->data0 > 20) + if (++sprite->data[0] > 20) { sprite->callback = SpriteCB_Egg_1; - sprite->data0 = 0; + sprite->data[0] = 0; } else { - sprite->data1 = (sprite->data1 + 20) & 0xFF; - sprite->pos2.x = Sin(sprite->data1, 1); - if (sprite->data0 == 15) + sprite->data[1] = (sprite->data[1] + 20) & 0xFF; + sprite->pos2.x = Sin(sprite->data[1], 1); + if (sprite->data[0] == 15) { PlaySE(SE_BOWA); StartSpriteAnim(sprite, 1); @@ -729,19 +729,19 @@ static void SpriteCB_Egg_0(struct Sprite* sprite) static void SpriteCB_Egg_1(struct Sprite* sprite) { - if (++sprite->data2 > 30) + if (++sprite->data[2] > 30) { - if (++sprite->data0 > 20) + if (++sprite->data[0] > 20) { sprite->callback = SpriteCB_Egg_2; - sprite->data0 = 0; - sprite->data2 = 0; + sprite->data[0] = 0; + sprite->data[2] = 0; } else { - sprite->data1 = (sprite->data1 + 20) & 0xFF; - sprite->pos2.x = Sin(sprite->data1, 2); - if (sprite->data0 == 15) + sprite->data[1] = (sprite->data[1] + 20) & 0xFF; + sprite->pos2.x = Sin(sprite->data[1], 2); + if (sprite->data[0] == 15) { PlaySE(SE_BOWA); StartSpriteAnim(sprite, 2); @@ -752,30 +752,30 @@ static void SpriteCB_Egg_1(struct Sprite* sprite) static void SpriteCB_Egg_2(struct Sprite* sprite) { - if (++sprite->data2 > 30) + if (++sprite->data[2] > 30) { - if (++sprite->data0 > 38) + if (++sprite->data[0] > 38) { u16 species; sprite->callback = SpriteCB_Egg_3; - sprite->data0 = 0; + sprite->data[0] = 0; species = GetMonData(&gPlayerParty[sEggHatchData->eggPartyID], MON_DATA_SPECIES); gSprites[sEggHatchData->pokeSpriteID].pos2.x = 0; gSprites[sEggHatchData->pokeSpriteID].pos2.y = 0; } else { - sprite->data1 = (sprite->data1 + 20) & 0xFF; - sprite->pos2.x = Sin(sprite->data1, 2); - if (sprite->data0 == 15) + sprite->data[1] = (sprite->data[1] + 20) & 0xFF; + sprite->pos2.x = Sin(sprite->data[1], 2); + if (sprite->data[0] == 15) { PlaySE(SE_BOWA); StartSpriteAnim(sprite, 2); CreateRandomEggShardSprite(); CreateRandomEggShardSprite(); } - if (sprite->data0 == 30) + if (sprite->data[0] == 30) PlaySE(SE_BOWA); } } @@ -783,60 +783,60 @@ static void SpriteCB_Egg_2(struct Sprite* sprite) static void SpriteCB_Egg_3(struct Sprite* sprite) { - if (++sprite->data0 > 50) + if (++sprite->data[0] > 50) { sprite->callback = SpriteCB_Egg_4; - sprite->data0 = 0; + sprite->data[0] = 0; } } static void SpriteCB_Egg_4(struct Sprite* sprite) { s16 i; - if (sprite->data0 == 0) + if (sprite->data[0] == 0) BeginNormalPaletteFade(-1, -1, 0, 0x10, 0xFFFF); - if (sprite->data0 < 4u) + if (sprite->data[0] < 4u) { for (i = 0; i <= 3; i++) CreateRandomEggShardSprite(); } - sprite->data0++; + sprite->data[0]++; if (!gPaletteFade.active) { PlaySE(SE_TAMAGO); sprite->invisible = 1; sprite->callback = SpriteCB_Egg_5; - sprite->data0 = 0; + sprite->data[0] = 0; } } static void SpriteCB_Egg_5(struct Sprite* sprite) { - if (sprite->data0 == 0) + if (sprite->data[0] == 0) { gSprites[sEggHatchData->pokeSpriteID].invisible = 0; StartSpriteAffineAnim(&gSprites[sEggHatchData->pokeSpriteID], 1); } - if (sprite->data0 == 8) + if (sprite->data[0] == 8) BeginNormalPaletteFade(-1, -1, 0x10, 0, 0xFFFF); - if (sprite->data0 <= 9) + if (sprite->data[0] <= 9) gSprites[sEggHatchData->pokeSpriteID].pos1.y -= 1; - if (sprite->data0 > 40) + if (sprite->data[0] > 40) sprite->callback = SpriteCallbackDummy; - sprite->data0++; + sprite->data[0]++; } static void SpriteCB_EggShard(struct Sprite* sprite) { - sprite->data4 += sprite->data1; - sprite->data5 += sprite->data2; + sprite->data[4] += sprite->data[1]; + sprite->data[5] += sprite->data[2]; - sprite->pos2.x = sprite->data4 / 256; - sprite->pos2.y = sprite->data5 / 256; + sprite->pos2.x = sprite->data[4] / 256; + sprite->pos2.y = sprite->data[5] / 256; - sprite->data2 += sprite->data3; + sprite->data[2] += sprite->data[3]; - if (sprite->pos1.y + sprite->pos2.y > sprite->pos1.y + 20 && sprite->data2 > 0) + if (sprite->pos1.y + sprite->pos2.y > sprite->pos1.y + 20 && sprite->data[2] > 0) DestroySprite(sprite); } @@ -854,9 +854,9 @@ static void CreateRandomEggShardSprite(void) static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 spriteAnimIndex) { u8 spriteID = CreateSprite(&sSpriteTemplate_EggShard, x, y, 4); - gSprites[spriteID].data1 = data1; - gSprites[spriteID].data2 = data2; - gSprites[spriteID].data3 = data3; + gSprites[spriteID].data[1] = data1; + gSprites[spriteID].data[2] = data2; + gSprites[spriteID].data[3] = data3; StartSpriteAnim(&gSprites[spriteID], spriteAnimIndex); } diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c index eca5d4bdc..09c351b17 100644 --- a/src/evolution_graphics.c +++ b/src/evolution_graphics.c @@ -112,18 +112,18 @@ static void SpriteCB_PreEvoSparkleSet1(struct Sprite* sprite) { u8 matrixNum; - sprite->pos1.y = 88 - (sprite->data7 * sprite->data7) / 80; - sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5) / 4; - sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5); - sprite->data6 += 4; - if (sprite->data7 & 1) - sprite->data5--; - sprite->data7++; + sprite->pos1.y = 88 - (sprite->data[7] * sprite->data[7]) / 80; + sprite->pos2.y = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4; + sprite->pos2.x = Cos((u8)(sprite->data[6]), sprite->data[5]); + sprite->data[6] += 4; + if (sprite->data[7] & 1) + sprite->data[5]--; + sprite->data[7]++; if (sprite->pos2.y > 0) sprite->subpriority = 1; else sprite->subpriority = 20; - matrixNum = sprite->data5 / 4 + 20; + matrixNum = sprite->data[5] / 4 + 20; if (matrixNum > 31) matrixNum = 31; sprite->oam.matrixNum = matrixNum; @@ -137,9 +137,9 @@ static void CreatePreEvoSparkleSet1(u8 arg0) u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 88, 0); if (spriteID != MAX_SPRITES) { - gSprites[spriteID].data5 = 48; - gSprites[spriteID].data6 = arg0; - gSprites[spriteID].data7 = 0; + gSprites[spriteID].data[5] = 48; + gSprites[spriteID].data[6] = arg0; + gSprites[spriteID].data[7] = 0; gSprites[spriteID].oam.affineMode = 1; gSprites[spriteID].oam.matrixNum = 31; gSprites[spriteID].callback = SpriteCB_PreEvoSparkleSet1; @@ -150,11 +150,11 @@ static void SpriteCB_PreEvoSparkleSet2(struct Sprite* sprite) { if (sprite->pos1.y < 88) { - sprite->pos1.y = 8 + (sprite->data7 * sprite->data7) / 5; - sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5) / 4; - sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5); - sprite->data5 = 8 + Sin((u8)(sprite->data7 * 4), 40); - sprite->data7++; + sprite->pos1.y = 8 + (sprite->data[7] * sprite->data[7]) / 5; + sprite->pos2.y = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4; + sprite->pos2.x = Cos((u8)(sprite->data[6]), sprite->data[5]); + sprite->data[5] = 8 + Sin((u8)(sprite->data[7] * 4), 40); + sprite->data[7]++; } else DestroySprite(sprite); @@ -165,9 +165,9 @@ static void CreatePreEvoSparkleSet2(u8 arg0) u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 8, 0); if (spriteID != MAX_SPRITES) { - gSprites[spriteID].data5 = 8; - gSprites[spriteID].data6 = arg0; - gSprites[spriteID].data7 = 0; + gSprites[spriteID].data[5] = 8; + gSprites[spriteID].data[6] = arg0; + gSprites[spriteID].data[7] = 0; gSprites[spriteID].oam.affineMode = 1; gSprites[spriteID].oam.matrixNum = 25; gSprites[spriteID].subpriority = 1; @@ -177,12 +177,12 @@ static void CreatePreEvoSparkleSet2(u8 arg0) static void SpriteCB_PostEvoSparkleSet1(struct Sprite* sprite) { - if (sprite->data5 > 8) + if (sprite->data[5] > 8) { - sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5); - sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5); - sprite->data5 -= sprite->data3; - sprite->data6 += 4; + sprite->pos2.y = Sin((u8)(sprite->data[6]), sprite->data[5]); + sprite->pos2.x = Cos((u8)(sprite->data[6]), sprite->data[5]); + sprite->data[5] -= sprite->data[3]; + sprite->data[6] += 4; } else DestroySprite(sprite); @@ -193,10 +193,10 @@ static void CreatePostEvoSparkleSet1(u8 arg0, u8 arg1) u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0); if (spriteID != MAX_SPRITES) { - gSprites[spriteID].data3 = arg1; - gSprites[spriteID].data5 = 120; - gSprites[spriteID].data6 = arg0; - gSprites[spriteID].data7 = 0; + gSprites[spriteID].data[3] = arg1; + gSprites[spriteID].data[5] = 120; + gSprites[spriteID].data[6] = arg0; + gSprites[spriteID].data[7] = 0; gSprites[spriteID].oam.affineMode = 1; gSprites[spriteID].oam.matrixNum = 31; gSprites[spriteID].subpriority = 1; @@ -206,29 +206,29 @@ static void CreatePostEvoSparkleSet1(u8 arg0, u8 arg1) static void SpriteCB_PostEvoSparkleSet2(struct Sprite* sprite) { - if (!(sprite->data7 & 3)) + if (!(sprite->data[7] & 3)) sprite->pos1.y++; - if (sprite->data6 < 128) + if (sprite->data[6] < 128) { u8 matrixNum; - sprite->pos2.y = -Sin((u8)(sprite->data6), sprite->data5); - sprite->pos1.x = 120 + (sprite->data3 * sprite->data7) / 3; - sprite->data6++; - matrixNum = 31 - (sprite->data6 * 12 / 128); - if (sprite->data6 > 64) + sprite->pos2.y = -Sin((u8)(sprite->data[6]), sprite->data[5]); + sprite->pos1.x = 120 + (sprite->data[3] * sprite->data[7]) / 3; + sprite->data[6]++; + matrixNum = 31 - (sprite->data[6] * 12 / 128); + if (sprite->data[6] > 64) sprite->subpriority = 1; else { sprite->invisible = 0; sprite->subpriority = 20; - if (sprite->data6 > 112 && sprite->data6 & 1) + if (sprite->data[6] > 112 && sprite->data[6] & 1) sprite->invisible = 1; } if (matrixNum < 20) matrixNum = 20; sprite->oam.matrixNum = matrixNum; - sprite->data7++; + sprite->data[7]++; } else DestroySprite(sprite); @@ -239,9 +239,9 @@ static void CreatePostEvoSparkleSet2(u8 arg0) u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0); if (spriteID != MAX_SPRITES) { - gSprites[spriteID].data3 = 3 - (Random() % 7); - gSprites[spriteID].data5 = 48 + (Random() & 0x3F); - gSprites[spriteID].data7 = 0; + gSprites[spriteID].data[3] = 3 - (Random() % 7); + gSprites[spriteID].data[5] = 48 + (Random() & 0x3F); + gSprites[spriteID].data[7] = 0; gSprites[spriteID].oam.affineMode = 1; gSprites[spriteID].oam.matrixNum = 31; gSprites[spriteID].subpriority = 20; diff --git a/src/field_map_obj.c b/src/field_map_obj.c index dfdeb63a3..97df5682b 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -30,7 +30,7 @@ bool8 FieldObjectCB2_##name(struct MapObject *, struct Sprite *);\ void FieldObjectCB_##name(struct Sprite *sprite)\ {\ - FieldObjectStep(&gMapObjects[sprite->data0], sprite, FieldObjectCB2_##name);\ + FieldObjectStep(&gMapObjects[sprite->data[0]], sprite, FieldObjectCB2_##name);\ }\ bool8 FieldObjectCB2_##name(struct MapObject *mapObject, struct Sprite *sprite)\ {\ @@ -42,11 +42,11 @@ extern bool8 (*const (table)[])(struct MapObject *, struct Sprite *);\ bool8 FieldObjectCB2_##name(struct MapObject *, struct Sprite *);\ void FieldObjectCB_##name(struct Sprite *sprite)\ {\ - FieldObjectStep(&gMapObjects[sprite->data0], sprite, FieldObjectCB2_##name);\ + FieldObjectStep(&gMapObjects[sprite->data[0]], sprite, FieldObjectCB2_##name);\ }\ bool8 FieldObjectCB2_##name(struct MapObject *mapObject, struct Sprite *sprite)\ {\ - return (table)[sprite->data1](mapObject, sprite);\ + return (table)[sprite->data[1]](mapObject, sprite);\ } #define field_object_path(idx, table, sub, path, catch, coord)\ @@ -655,7 +655,7 @@ static u8 SpawnFieldObjectInternal(struct MapObjectTemplate *mapObjectTemplate, sprite->pos1.y += 16 + sprite->centerToCornerVecY; sprite->oam.paletteNum = paletteSlot; sprite->coordOffsetEnabled = TRUE; - sprite->data0 = mapObjectId; + sprite->data[0] = mapObjectId; mapObject->spriteId = spriteId; mapObject->mapobj_bit_12 = graphicsInfo->inanimate; if (!mapObject->mapobj_bit_12) @@ -813,8 +813,8 @@ u8 sprite_new(u8 graphicsId, u8 a1, s16 x, s16 y, u8 z, u8 direction) sprite->oam.paletteNum -= 16; } sprite->coordOffsetEnabled = TRUE; - sprite->data0 = a1; - sprite->data1 = z; + sprite->data[0] = a1; + sprite->data[1] = z; if (graphicsInfo->paletteSlot == 10) { npc_load_two_palettes__and_record(graphicsInfo->paletteTag1, graphicsInfo->paletteSlot); @@ -1003,7 +1003,7 @@ static void sub_808E1B8(u8 mapObjectId, s16 x, s16 y) } sprite->oam.paletteNum = paletteSlot; sprite->coordOffsetEnabled = TRUE; - sprite->data0 = mapObjectId; + sprite->data[0] = mapObjectId; mapObject->spriteId = spriteId; if (!mapObject->mapobj_bit_12 && mapObject->animPattern != 0x0b) { @@ -1463,7 +1463,7 @@ u8 AddCameraObject(u8 linkedSpriteId) spriteId = CreateSprite(&gUnknown_084975D4, 0, 0, 4); gSprites[spriteId].invisible = TRUE; - gSprites[spriteId].data0 = linkedSpriteId; + gSprites[spriteId].data[0] = linkedSpriteId; return spriteId; } @@ -1472,15 +1472,15 @@ void ObjectCB_CameraObject(struct Sprite *sprite) void (*callbacks[ARRAY_COUNT(gUnknown_084975EC)])(struct Sprite *); memcpy(callbacks, gUnknown_084975EC, sizeof gUnknown_084975EC); - callbacks[sprite->data1](sprite); + callbacks[sprite->data[1]](sprite); } /*static*/ void CameraObject_0(struct Sprite *sprite) { - sprite->pos1.x = gSprites[sprite->data0].pos1.x; - sprite->pos1.y = gSprites[sprite->data0].pos1.y; + sprite->pos1.x = gSprites[sprite->data[0]].pos1.x; + sprite->pos1.y = gSprites[sprite->data[0]].pos1.y; sprite->invisible = TRUE; - sprite->data1 = 1; + sprite->data[1] = 1; CameraObject_1(sprite); } @@ -1489,20 +1489,20 @@ void ObjectCB_CameraObject(struct Sprite *sprite) s16 x; s16 y; - y = gSprites[sprite->data0].pos1.y; - x = gSprites[sprite->data0].pos1.x; - sprite->data2 = x - sprite->pos1.x; - sprite->data3 = y - sprite->pos1.y; + y = gSprites[sprite->data[0]].pos1.y; + x = gSprites[sprite->data[0]].pos1.x; + sprite->data[2] = x - sprite->pos1.x; + sprite->data[3] = y - sprite->pos1.y; sprite->pos1.x = x; sprite->pos1.y = y; } /*static*/ void CameraObject_2(struct Sprite *sprite) { - sprite->pos1.x = gSprites[sprite->data0].pos1.x; - sprite->pos1.y = gSprites[sprite->data0].pos1.y; - sprite->data2 = 0; - sprite->data3 = 0; + sprite->pos1.x = gSprites[sprite->data[0]].pos1.x; + sprite->pos1.y = gSprites[sprite->data[0]].pos1.y; + sprite->data[2] = 0; + sprite->data[3] = 0; } static struct Sprite *FindCameraObject(void) @@ -1526,7 +1526,7 @@ void CameraObjectReset1(void) cameraObject = FindCameraObject(); if (cameraObject != NULL) { - cameraObject->data1 = 0; + cameraObject->data[1] = 0; cameraObject->callback(cameraObject); } } @@ -1538,7 +1538,7 @@ void CameraObjectSetFollowedObjectId(u8 objectId) cameraObject = FindCameraObject(); if (cameraObject != NULL) { - cameraObject->data0 = objectId; + cameraObject->data[0] = objectId; CameraObjectReset1(); } } @@ -1552,12 +1552,12 @@ u8 CameraObjectGetFollowedObjectId(void) { return MAX_SPRITES; } - return cameraObject->data0; + return cameraObject->data[0]; } void CameraObjectReset2(void) { - FindCameraObject()->data1 = 2; + FindCameraObject()->data[1] = 2; } u8 CopySprite(struct Sprite *sprite, s16 x, s16 y, u8 subpriority) @@ -1818,14 +1818,14 @@ field_object_step(GoRandomDirections, gUnknown_0850D6F4) bool8 sub_808F44C(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_808F460(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -1836,7 +1836,7 @@ bool8 sub_808F48C(struct MapObject *mapObject, struct Sprite *sprite) return FALSE; } SetFieldObjectStepTimer(sprite, gUnknown_0850D6DC[Random() & 0x03]); - sprite->data1 = 3; + sprite->data[1] = 3; return TRUE; } @@ -1844,7 +1844,7 @@ bool8 sub_808F4C8(struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -1858,10 +1858,10 @@ bool8 sub_808F4E8(struct MapObject *mapObject, struct Sprite *sprite) memcpy(directions, gUnknown_0850D710, sizeof directions); chosenDirection = directions[Random() & 0x03]; FieldObjectSetDirection(mapObject, chosenDirection); - sprite->data1 = 5; + sprite->data[1] = 5; if (npc_block_way__next_tile(mapObject, chosenDirection)) { - sprite->data1 = 1; + sprite->data[1] = 1; } return TRUE; } @@ -1870,7 +1870,7 @@ bool8 sub_808F534(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetGoSpeed0AnimId(mapObject->placeholder18)); mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 6; + sprite->data[1] = 6; return TRUE; } @@ -1879,7 +1879,7 @@ bool8 sub_808F564(struct MapObject *mapObject, struct Sprite *sprite) if (FieldObjectExecRegularAnim(mapObject, sprite)) { mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 1; + sprite->data[1] = 1; } return FALSE; } @@ -2140,14 +2140,14 @@ field_object_step(LookRandomDirections, gUnknown_0850D740) bool8 sub_808F988(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_808F99C(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2157,7 +2157,7 @@ bool8 sub_808F9C8(struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6DC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2166,7 +2166,7 @@ bool8 sub_808FA0C(struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2184,7 +2184,7 @@ bool8 sub_808FA3C(struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x03]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2193,14 +2193,14 @@ field_object_step(RandomlyGoNorthOrSouth, gUnknown_0850D754) bool8 sub_808FAC8(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_808FADC(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2211,7 +2211,7 @@ bool8 sub_808FB08(struct MapObject *mapObject, struct Sprite *sprite) return FALSE; } SetFieldObjectStepTimer(sprite, gUnknown_0850D6DC[Random() & 0x03]); - sprite->data1 = 3; + sprite->data[1] = 3; return TRUE; } @@ -2219,7 +2219,7 @@ bool8 sub_808FB44(struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2233,10 +2233,10 @@ bool8 sub_808FB64(struct MapObject *mapObject, struct Sprite *sprite) memcpy(directions, gUnknown_0850D770, sizeof directions); direction = directions[Random() & 0x01]; FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 5; + sprite->data[1] = 5; if (npc_block_way__next_tile(mapObject, direction)) { - sprite->data1 = 1; + sprite->data[1] = 1; } return TRUE; } @@ -2245,7 +2245,7 @@ bool8 sub_808FBB0(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetGoSpeed0AnimId(mapObject->placeholder18)); mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 6; + sprite->data[1] = 6; return TRUE; } @@ -2254,7 +2254,7 @@ bool8 sub_808FBE0(struct MapObject *mapObject, struct Sprite *sprite) if (FieldObjectExecRegularAnim(mapObject, sprite)) { mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 1; + sprite->data[1] = 1; } return FALSE; } @@ -2264,14 +2264,14 @@ field_object_step(RandomlyGoEastOrWest, gUnknown_0850D774) bool8 sub_808FC4C(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_808FC60(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2282,7 +2282,7 @@ bool8 sub_808FC8C(struct MapObject *mapObject, struct Sprite *sprite) return FALSE; } SetFieldObjectStepTimer(sprite, gUnknown_0850D6DC[Random() & 0x03]); - sprite->data1 = 3; + sprite->data[1] = 3; return TRUE; } @@ -2290,7 +2290,7 @@ bool8 sub_808FCC8(struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2304,10 +2304,10 @@ bool8 sub_808FCE8(struct MapObject *mapObject, struct Sprite *sprite) memcpy(directions, gUnknown_0850D790, sizeof directions); direction = directions[Random() & 0x01]; FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 5; + sprite->data[1] = 5; if (npc_block_way__next_tile(mapObject, direction)) { - sprite->data1 = 1; + sprite->data[1] = 1; } return TRUE; } @@ -2316,7 +2316,7 @@ bool8 sub_808FD34(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetGoSpeed0AnimId(mapObject->placeholder18)); mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 6; + sprite->data[1] = 6; return TRUE; } @@ -2325,7 +2325,7 @@ bool8 sub_808FD64(struct MapObject *mapObject, struct Sprite *sprite) if (FieldObjectExecRegularAnim(mapObject, sprite)) { mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 1; + sprite->data[1] = 1; } return FALSE; } @@ -2336,7 +2336,7 @@ bool8 sub_808FDD0(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2344,7 +2344,7 @@ bool8 sub_808FDFC(struct MapObject *mapObject, struct Sprite *sprite) { if (FieldObjectExecRegularAnim(mapObject, sprite)) { - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } return FALSE; @@ -2362,17 +2362,17 @@ void FieldObjectCB_BerryTree(struct Sprite *sprite) { struct MapObject *mapObject; - mapObject = &gMapObjects[sprite->data0]; - if (!(sprite->data7 & 0x0001)) + mapObject = &gMapObjects[sprite->data[0]]; + if (!(sprite->data[7] & 0x0001)) { get_berry_tree_graphics(mapObject, sprite); - sprite->data7 |= 0x0001; + sprite->data[7] |= 0x0001; } FieldObjectStep(mapObject, sprite, FieldObjectCB2_BerryTree); } static bool8 FieldObjectCB2_BerryTree(struct MapObject *mapObject, struct Sprite *sprite) { - return gUnknown_0850D7A0[sprite->data1](mapObject, sprite); + return gUnknown_0850D7A0[sprite->data[1]](mapObject, sprite); } bool8 do_berry_tree_growth_sparkle_1 (struct MapObject *mapObject, struct Sprite *sprite) @@ -2385,7 +2385,7 @@ bool8 do_berry_tree_growth_sparkle_1 (struct MapObject *mapObject, struct Sprite berryStage = GetStageByBerryTreeId(mapObject->trainerRange_berryTreeId); if (berryStage == 0) { - if (!(sprite->data7 & 0x0004) && sprite->animNum == 4) + if (!(sprite->data[7] & 0x0004) && sprite->animNum == 4) { gFieldEffectArguments[0] = mapObject->coords2.x; gFieldEffectArguments[1] = mapObject->coords2.y; @@ -2401,12 +2401,12 @@ bool8 do_berry_tree_growth_sparkle_1 (struct MapObject *mapObject, struct Sprite berryStage --; if (sprite->animNum != berryStage) { - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } get_berry_tree_graphics(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, 0x39); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2414,7 +2414,7 @@ bool8 sub_808FF48 (struct MapObject *mapObject, struct Sprite *sprite) { if (FieldObjectExecRegularAnim(mapObject, sprite)) { - sprite->data1 = 0; + sprite->data[1] = 0; return TRUE; } return FALSE; @@ -2423,9 +2423,9 @@ bool8 sub_808FF48 (struct MapObject *mapObject, struct Sprite *sprite) bool8 do_berry_tree_growth_sparkle_2 (struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 3; - sprite->data2 = 0; - sprite->data7 |= 0x0002; + sprite->data[1] = 3; + sprite->data[2] = 0; + sprite->data[7] |= 0x0002; gFieldEffectArguments[0] = mapObject->coords2.x; gFieldEffectArguments[1] = mapObject->coords2.y; gFieldEffectArguments[2] = sprite->subpriority - 1; @@ -2436,14 +2436,14 @@ bool8 do_berry_tree_growth_sparkle_2 (struct MapObject *mapObject, struct Sprite bool8 sub_808FFB4 (struct MapObject *mapObject, struct Sprite *sprite) { - sprite->data2 ++; - mapObject->mapobj_bit_13 = (sprite->data2 & 0x02) >> 1; + sprite->data[2] ++; + mapObject->mapobj_bit_13 = (sprite->data[2] & 0x02) >> 1; sprite->animPaused = TRUE; - if (sprite->data2 > 64) + if (sprite->data[2] > 64) { get_berry_tree_graphics(mapObject, sprite); - sprite->data1 = 4; - sprite->data2 = 0; + sprite->data[1] = 4; + sprite->data[2] = 0; return TRUE; } return FALSE; @@ -2451,13 +2451,13 @@ bool8 sub_808FFB4 (struct MapObject *mapObject, struct Sprite *sprite) bool8 sub_8090004 (struct MapObject *mapObject, struct Sprite *sprite) { - sprite->data2 ++; - mapObject->mapobj_bit_13 = (sprite->data2 & 0x02) >> 1; + sprite->data[2] ++; + mapObject->mapobj_bit_13 = (sprite->data[2] & 0x02) >> 1; sprite->animPaused = TRUE; - if (sprite->data2 > 64) + if (sprite->data[2] > 64) { - sprite->data1 = 0; - sprite->data7 &= ~0x0002; + sprite->data[1] = 0; + sprite->data[7] &= ~0x0002; return TRUE; } return FALSE; @@ -2468,14 +2468,14 @@ field_object_step(RandomlyLookNorthOrSouth, gUnknown_0850D7B4) bool8 sub_8090094 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_80900A8 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2485,7 +2485,7 @@ bool8 sub_80900D4 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6DC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2494,7 +2494,7 @@ bool8 sub_8090118 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2512,7 +2512,7 @@ bool8 sub_8090148 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x01]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2521,14 +2521,14 @@ field_object_step(RandomlyLookEastOrWest, gUnknown_0850D7C8) bool8 sub_80901D4 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_80901E8 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2538,7 +2538,7 @@ bool8 sub_8090214 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6DC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2547,7 +2547,7 @@ bool8 sub_8090258 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2565,7 +2565,7 @@ bool8 sub_8090288 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x01]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2574,14 +2574,14 @@ field_object_step(RandomlyLookNorthOrWest, gUnknown_0850D7DC) bool8 sub_8090314 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_8090328 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2591,7 +2591,7 @@ bool8 sub_8090354 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6EC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2600,7 +2600,7 @@ bool8 sub_8090398 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2618,7 +2618,7 @@ bool8 sub_80903C8 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x01]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2627,14 +2627,14 @@ field_object_step(RandomlyLookNorthOrEast, gUnknown_0850D7F4) bool8 sub_8090454 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_8090468 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2644,7 +2644,7 @@ bool8 sub_8090494 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6EC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2653,7 +2653,7 @@ bool8 sub_80904D8 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2671,7 +2671,7 @@ bool8 sub_8090508 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x01]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2680,14 +2680,14 @@ field_object_step(RandomlyLookSouthOrWest, gUnknown_0850D80C) bool8 sub_8090594 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_80905A8 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2697,7 +2697,7 @@ bool8 sub_80905D4 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6EC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2706,7 +2706,7 @@ bool8 sub_8090618 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2724,7 +2724,7 @@ bool8 sub_8090648 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x01]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2733,14 +2733,14 @@ field_object_step(RandomlyLookSouthOrEast, gUnknown_0850D824) bool8 sub_80906D4 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_80906E8 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2750,7 +2750,7 @@ bool8 sub_8090714 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6EC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2759,7 +2759,7 @@ bool8 sub_8090758 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2777,7 +2777,7 @@ bool8 sub_8090788 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x01]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2786,14 +2786,14 @@ field_object_step(RandomlyLookNorthOrSouthOrWest, gUnknown_0850D83C) bool8 sub_8090814 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_8090828 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2803,7 +2803,7 @@ bool8 sub_8090854 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6EC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2812,7 +2812,7 @@ bool8 sub_8090898 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2830,7 +2830,7 @@ bool8 sub_80908C8 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x03]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2839,14 +2839,14 @@ field_object_step(RandomlyLookNorthOrSouthOrEast, gUnknown_0850D854) bool8 sub_8090954 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_8090968 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2856,7 +2856,7 @@ bool8 sub_8090994 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6EC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2865,7 +2865,7 @@ bool8 sub_80909D8 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2883,7 +2883,7 @@ bool8 sub_8090A08 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x03]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2892,14 +2892,14 @@ field_object_step(RandomlyLookNorthOrEastOrWest, gUnknown_0850D86C) bool8 sub_8090A94 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_8090AA8 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2909,7 +2909,7 @@ bool8 sub_8090AD4 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6EC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2918,7 +2918,7 @@ bool8 sub_8090B18 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2936,7 +2936,7 @@ bool8 sub_8090B48 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x03]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2945,14 +2945,14 @@ field_object_step(RandomlyLookSouthOrEastOrWest, gUnknown_0850D884) bool8 sub_8090BD4 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_8090BE8 (struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -2962,7 +2962,7 @@ bool8 sub_8090C14 (struct MapObject *mapObject, struct Sprite *sprite) { SetFieldObjectStepTimer(sprite, gUnknown_0850D6EC[Random() & 0x03]); mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -2971,7 +2971,7 @@ bool8 sub_8090C58 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 4; + sprite->data[1] = 4; return TRUE; } return FALSE; @@ -2989,7 +2989,7 @@ bool8 sub_8090C88 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[Random() & 0x03]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -2999,7 +2999,7 @@ bool8 sub_8090D14 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3008,7 +3008,7 @@ bool8 sub_8090D40 (struct MapObject *mapObject, struct Sprite *sprite) if (FieldObjectExecRegularAnim(mapObject, sprite)) { SetFieldObjectStepTimer(sprite, 48); - sprite->data1 = 2; + sprite->data[1] = 2; } return FALSE; } @@ -3017,7 +3017,7 @@ bool8 sub_8090D64 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -3034,7 +3034,7 @@ bool8 sub_8090D90 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[mapObject->mapobj_unk_18]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 0; + sprite->data[1] = 0; return TRUE; } @@ -3044,7 +3044,7 @@ bool8 sub_8090E18 (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3053,7 +3053,7 @@ bool8 sub_8090E44 (struct MapObject *mapObject, struct Sprite *sprite) if (FieldObjectExecRegularAnim(mapObject, sprite)) { SetFieldObjectStepTimer(sprite, 48); - sprite->data1 = 2; + sprite->data[1] = 2; } return FALSE; } @@ -3062,7 +3062,7 @@ bool8 sub_8090E68 (struct MapObject *mapObject, struct Sprite *sprite) { if (RunFieldObjectStepTimer(sprite) || FieldObjectIsTrainerAndCloseToPlayer(mapObject)) { - sprite->data1 = 3; + sprite->data[1] = 3; } return FALSE; } @@ -3079,7 +3079,7 @@ bool8 sub_8090E94 (struct MapObject *mapObject, struct Sprite *sprite) direction = directions[mapObject->mapobj_unk_18]; } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 0; + sprite->data[1] = 0; return TRUE; } @@ -3088,7 +3088,7 @@ field_object_step(AlternatelyGoInOppositeDirections, gUnknown_0850D8CC) bool8 sub_8090F1C (struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3102,7 +3102,7 @@ bool8 sub_8090F30 (struct MapObject *mapObject, struct Sprite *sprite) direction = GetOppositeDirection(direction); } FieldObjectSetDirection(mapObject, direction); - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3131,7 +3131,7 @@ bool8 sub_8090F68 (struct MapObject *mapObject, struct Sprite *sprite) } FieldObjectSetRegularAnim(mapObject, sprite, animId); mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 3; + sprite->data[1] = 3; return TRUE; } @@ -3140,7 +3140,7 @@ bool8 sub_8091020 (struct MapObject *mapObject, struct Sprite *sprite) if (FieldObjectExecRegularAnim(mapObject, sprite)) { mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 1; + sprite->data[1] = 1; } return FALSE; } @@ -3148,7 +3148,7 @@ bool8 sub_8091020 (struct MapObject *mapObject, struct Sprite *sprite) bool8 sub_8091048(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3177,7 +3177,7 @@ bool8 MoveFieldObjectInNextDirectionInSequence(struct MapObject *mapObject, stru } FieldObjectSetRegularAnim(mapObject, sprite, animId); mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3186,7 +3186,7 @@ bool8 sub_8091110(struct MapObject *mapObject, struct Sprite *sprite) if (FieldObjectExecRegularAnim(mapObject, sprite)) { mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 1; + sprite->data[1] = 1; } return FALSE; } @@ -3225,7 +3225,7 @@ bool8 mss_npc_reset_oampriv3_1_unk2_unk3(struct MapObject *mapObject, struct Spr { mapObject->mapobj_unk_21 = player_get_direction_lower_nybble(); } - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3243,7 +3243,7 @@ bool8 sub_8091F20(struct MapObject *mapObject, struct Sprite *sprite) if (FieldObjectExecRegularAnim(mapObject, sprite)) { mapObject->mapobj_bit_1 = FALSE; - sprite->data1 = 1; + sprite->data[1] = 1; } return FALSE; } @@ -3257,7 +3257,7 @@ bool8 sub_8091F4C(struct MapObject *mapObject, struct Sprite *sprite, u8 playerD { FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(state_to_direction(gUnknown_085055CD[mapObject->animPattern], mapObject->mapobj_unk_21, playerDirection))); mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3278,7 +3278,7 @@ bool8 sub_8091F94(struct MapObject *mapObject, struct Sprite *sprite, u8 playerD FieldObjectMoveDestCoords(mapObject, direction, &x, &y); FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } } @@ -3293,7 +3293,7 @@ bool8 sub_8091F94(struct MapObject *mapObject, struct Sprite *sprite, u8 playerD FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); } mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3312,7 +3312,7 @@ bool8 sub_80920A4(struct MapObject *mapObject, struct Sprite *sprite, u8 playerD FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); } mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3331,7 +3331,7 @@ bool8 sub_809215C(struct MapObject *mapObject, struct Sprite *sprite, u8 playerD FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); } mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3350,7 +3350,7 @@ bool8 sub_8092214(struct MapObject *mapObject, struct Sprite *sprite, u8 playerD FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); } mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3362,7 +3362,7 @@ bool8 cph_IM_DIFFERENT(struct MapObject *mapObject, struct Sprite *sprite, u8 pl direction = state_to_direction(gUnknown_085055CD[mapObject->animPattern], mapObject->mapobj_unk_21, direction); FieldObjectSetRegularAnim(mapObject, sprite, sub_80934BC(direction)); mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3381,7 +3381,7 @@ bool8 sub_8092314(struct MapObject *mapObject, struct Sprite *sprite, u8 playerD FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); } mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3402,7 +3402,7 @@ bool8 oac_hopping(struct MapObject *mapObject, struct Sprite *sprite, u8 playerD FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(direction)); } mapObject->mapobj_bit_1 = TRUE; - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } @@ -3423,15 +3423,15 @@ void FieldObjectCB_TreeDisguise(struct Sprite *sprite) { struct MapObject *mapObject; - mapObject = &gMapObjects[sprite->data0]; - if (mapObject->mapobj_unk_21 == 0 || (mapObject->mapobj_unk_21 == 1 && !sprite->data7)) + mapObject = &gMapObjects[sprite->data[0]]; + if (mapObject->mapobj_unk_21 == 0 || (mapObject->mapobj_unk_21 == 1 && !sprite->data[7])) { FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gFieldEffectArguments[0], (u8 *)&gFieldEffectArguments[1], (u8 *)&gFieldEffectArguments[2]); mapObject->mapobj_unk_1A = FieldEffectStart(FLDEFF_TREE_DISGUISE); mapObject->mapobj_unk_21 = 1; - sprite->data7 ++; + sprite->data[7] ++; } - FieldObjectStep(&gMapObjects[sprite->data0], sprite, sub_80925AC); + FieldObjectStep(&gMapObjects[sprite->data[0]], sprite, sub_80925AC); } bool8 sub_80925AC(struct MapObject *mapObject, struct Sprite *sprite) @@ -3444,15 +3444,15 @@ void FieldObjectCB_MountainDisguise(struct Sprite *sprite) { struct MapObject *mapObject; - mapObject = &gMapObjects[sprite->data0]; - if (mapObject->mapobj_unk_21 == 0 || (mapObject->mapobj_unk_21 == 1 && !sprite->data7)) + mapObject = &gMapObjects[sprite->data[0]]; + if (mapObject->mapobj_unk_21 == 0 || (mapObject->mapobj_unk_21 == 1 && !sprite->data[7])) { FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gFieldEffectArguments[0], (u8 *)&gFieldEffectArguments[1], (u8 *)&gFieldEffectArguments[2]); mapObject->mapobj_unk_1A = FieldEffectStart(FLDEFF_MOUNTAIN_DISGUISE); mapObject->mapobj_unk_21 = 1; - sprite->data7 ++; + sprite->data[7] ++; } - FieldObjectStep(&gMapObjects[sprite->data0], sprite, sub_80925AC); + FieldObjectStep(&gMapObjects[sprite->data[0]], sprite, sub_80925AC); } extern bool8 (*const gUnknown_0850DA9C[])(struct MapObject *, struct Sprite *); @@ -3460,19 +3460,19 @@ bool8 sub_809268C(struct MapObject *, struct Sprite *); void FieldObjectCB_Hidden1(struct Sprite *sprite) { - if (!sprite->data7) + if (!sprite->data[7]) { - gMapObjects[sprite->data0].mapobj_bit_26 = TRUE; + gMapObjects[sprite->data[0]].mapobj_bit_26 = TRUE; sprite->subspriteMode = 2; sprite->oam.priority = 3; - sprite->data7 ++; + sprite->data[7] ++; } - FieldObjectStep(&gMapObjects[sprite->data0], sprite, sub_809268C); + FieldObjectStep(&gMapObjects[sprite->data[0]], sprite, sub_809268C); } bool8 sub_809268C(struct MapObject *mapObject, struct Sprite *sprite) { - return gUnknown_0850DA9C[sprite->data1](mapObject, sprite); + return gUnknown_0850DA9C[sprite->data[1]](mapObject, sprite); } bool8 sub_80926AC (struct MapObject *mapObject, struct Sprite *sprite) @@ -3484,7 +3484,7 @@ bool8 sub_80926B8 (struct MapObject *mapObject, struct Sprite *sprite) { if (FieldObjectExecRegularAnim(mapObject, sprite)) { - sprite->data1 = 0; + sprite->data[1] = 0; } return FALSE; } @@ -3495,7 +3495,7 @@ bool8 sub_8092718(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetStepInPlaceDelay16AnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3505,7 +3505,7 @@ bool8 sub_8092788(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetStepInPlaceDelay32AnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3515,7 +3515,7 @@ bool8 sub_80927F8(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetStepInPlaceDelay8AnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3525,7 +3525,7 @@ bool8 sub_8092868(struct MapObject *mapObject, struct Sprite *sprite) { npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetStepInPlaceDelay4AnimId(mapObject->mapobj_unk_18)); - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } @@ -3536,14 +3536,14 @@ bool8 sub_80928D8(struct MapObject *mapObject, struct Sprite *sprite) npc_reset(mapObject, sprite); FieldObjectSetRegularAnim(mapObject, sprite, GetFaceDirectionAnimId(mapObject->mapobj_unk_18)); mapObject->mapobj_bit_13 = TRUE; - sprite->data1 = 1; + sprite->data[1] = 1; return TRUE; } bool8 sub_809290C(struct MapObject *mapObject, struct Sprite *sprite) { if (FieldObjectExecRegularAnim(mapObject, sprite)) { - sprite->data1 = 2; + sprite->data[1] = 2; return TRUE; } return FALSE; @@ -3561,7 +3561,7 @@ void npc_reset(struct MapObject *mapObject, struct Sprite *sprite) mapObject->mapobj_bit_6 = FALSE; mapObject->mapobj_bit_7 = FALSE; mapObject->mapobj_unk_1C = 0xFF; - sprite->data1 = 0; + sprite->data[1] = 0; } #define dirn2anim(name, table)\ @@ -3680,7 +3680,7 @@ void npc_set_running_behaviour_etc(struct MapObject *mapObject, u8 animPattern) mapObject->mapobj_unk_21 = 0; mapObject->animId = 0; gSprites[mapObject->spriteId].callback = gUnknown_08505438[animPattern]; - gSprites[mapObject->spriteId].data1 = 0; + gSprites[mapObject->spriteId].data[1] = 0; } dirn2anim(npc_running_behaviour_by_direction, gUnknown_0850DB53) @@ -3811,7 +3811,7 @@ bool8 sub_8092E9C(u8 localId, u8 mapNum, u8 mapGroup) { u8 mapObjectId; - if (!TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId) && gSprites[gMapObjects[mapObjectId].spriteId].data7 & 0x02) + if (!TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId) && gSprites[gMapObjects[mapObjectId].spriteId].data[7] & 0x02) { return TRUE; } @@ -3824,7 +3824,7 @@ void sub_8092EF0(u8 localId, u8 mapNum, u8 mapGroup) if (!TryGetFieldObjectIdByLocalIdAndMap(localId, mapNum, mapGroup, &mapObjectId)) { - gSprites[gMapObjects[mapObjectId].spriteId].data7 |= 0x04; + gSprites[gMapObjects[mapObjectId].spriteId].data[7] |= 0x04; } } @@ -3975,7 +3975,7 @@ bool8 FieldObjectSetSpecialAnim(struct MapObject *mapObject, u8 specialAnimId) mapObject->mapobj_unk_1C = specialAnimId; mapObject->mapobj_bit_6 = TRUE; mapObject->mapobj_bit_7 = FALSE; - gSprites[mapObject->spriteId].data2 = 0; + gSprites[mapObject->spriteId].data[2] = 0; return FALSE; } @@ -3998,8 +3998,8 @@ void FieldObjectClearAnim(struct MapObject *mapObject) mapObject->mapobj_unk_1C = 0xFF; mapObject->mapobj_bit_6 = FALSE; mapObject->mapobj_bit_7 = FALSE; - gSprites[mapObject->spriteId].data1 = 0; - gSprites[mapObject->spriteId].data2 = 0; + gSprites[mapObject->spriteId].data[1] = 0; + gSprites[mapObject->spriteId].data[2] = 0; } u8 FieldObjectCheckIfSpecialAnimFinishedOrInactive(struct MapObject *mapObject) @@ -4137,7 +4137,7 @@ static u32 state_to_direction(u8 a0, u32 a1, u32 a2) static void FieldObjectExecSpecialAnim(struct MapObject *mapObject, struct Sprite *sprite) { - if (gUnknown_0850DC50[mapObject->mapobj_unk_1C][sprite->data2](mapObject, sprite)) + if (gUnknown_0850DC50[mapObject->mapobj_unk_1C][sprite->data[2]](mapObject, sprite)) { mapObject->mapobj_bit_7 = TRUE; } @@ -4145,10 +4145,10 @@ static void FieldObjectExecSpecialAnim(struct MapObject *mapObject, struct Sprit bool8 FieldObjectExecRegularAnim(struct MapObject *mapObject, struct Sprite *sprite) { - if (gUnknown_0850DC50[mapObject->mapobj_unk_1C][sprite->data2](mapObject, sprite)) + if (gUnknown_0850DC50[mapObject->mapobj_unk_1C][sprite->data[2]](mapObject, sprite)) { mapObject->mapobj_unk_1C = 0xFF; - sprite->data2 = 0; + sprite->data[2] = 0; return TRUE; } return FALSE; @@ -4157,7 +4157,7 @@ bool8 FieldObjectExecRegularAnim(struct MapObject *mapObject, struct Sprite *spr void FieldObjectSetRegularAnim(struct MapObject *mapObject, struct Sprite *sprite, u8 animId) { mapObject->mapobj_unk_1C = animId; - sprite->data2 = 0; + sprite->data[2] = 0; } // file boundary? @@ -4168,7 +4168,7 @@ void an_look_any(struct MapObject *mapObject, struct Sprite *sprite, u8 directio npc_coords_shift_still(mapObject); obj_npc_animation_step(mapObject, sprite, get_go_image_anim_num(mapObject->mapobj_unk_18)); sprite->animPaused = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; } bool8 sub_8093950(struct MapObject *mapObject, struct Sprite *sprite) @@ -4212,7 +4212,7 @@ void npc_apply_direction(struct MapObject *mapObject, struct Sprite *sprite, u8 sprite->animPaused = TRUE; } mapObject->mapobj_bit_2 = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; } void do_go_anim(struct MapObject *mapObject, struct Sprite *sprite, u8 direction, u8 speed) @@ -4255,7 +4255,7 @@ void sub_8093AF0(struct MapObject *mapObject, struct Sprite *sprite, u8 directio sub_80976DC(sprite, direction); sprite->animPaused = FALSE; mapObject->mapobj_bit_2 = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; } void sub_8093B60(struct MapObject *mapObject, struct Sprite *sprite, u8 direction) @@ -4287,7 +4287,7 @@ bool8 name##_2(struct MapObject *mapObject, struct Sprite *sprite)\ {\ if (fn2(mapObject, sprite))\ {\ - sprite->data2 = 2;\ + sprite->data[2] = 2;\ return TRUE;\ }\ return FALSE;\ @@ -4323,7 +4323,7 @@ void sub_8093FC4(struct MapObject *mapObject, struct Sprite *sprite, u8 directio sub_8092F88(direction, &x, &y, displacements[speed], displacements[speed]); npc_coords_shift(mapObject, mapObject->coords2.x + x, mapObject->coords2.y + y); sub_809783C(sprite, direction, speed, a5); - sprite->data2 = 1; + sprite->data[2] = 1; sprite->animPaused = 0; mapObject->mapobj_bit_2 = 1; mapObject->mapobj_bit_4 = 1; @@ -4345,11 +4345,11 @@ u8 sub_80940C4(struct MapObject *mapObject, struct Sprite *sprite, u8 callback(s memcpy(displacements, gUnknown_0850DFC2, sizeof gUnknown_0850DFC2); result = callback(sprite); - if (result == 1 && displacements[sprite->data4] != 0) + if (result == 1 && displacements[sprite->data[4]] != 0) { x = 0; y = 0; - sub_8092F88(mapObject->placeholder18, &x, &y, displacements[sprite->data4], displacements[sprite->data4]); + sub_8092F88(mapObject->placeholder18, &x, &y, displacements[sprite->data[4]], displacements[sprite->data[4]]); npc_coords_shift(mapObject, mapObject->coords2.x + x, mapObject->coords2.y + y); mapObject->mapobj_bit_2 = TRUE; mapObject->mapobj_bit_4 = TRUE; @@ -4418,7 +4418,7 @@ bool8 name##_2(struct MapObject *mapObject, struct Sprite *sprite)\ if (fn2(mapObject, sprite))\ {\ mapObject->mapobj_bit_22 = FALSE;\ - sprite->data2 = 2;\ + sprite->data[2] = 2;\ return TRUE;\ }\ return FALSE;\ @@ -4431,15 +4431,15 @@ maybe_shadow_1_macro(sub_8094338, maybe_shadow_1, sub_80941B0, DIR_EAST, 2, 0) void sub_8094390(struct Sprite *sprite, u16 duration) { - sprite->data2 = 1; - sprite->data3 = duration; + sprite->data[2] = 1; + sprite->data[3] = duration; } bool8 sub_8094398(struct MapObject *mapObject, struct Sprite *sprite) { - if (-- sprite->data3 == 0) + if (-- sprite->data[3] == 0) { - sprite->data2 = 2; + sprite->data[2] = 2; return TRUE; } return FALSE; @@ -4468,15 +4468,15 @@ void sub_8094554(struct MapObject *mapObject, struct Sprite *sprite, u8 directio FieldObjectSetDirection(mapObject, direction); npc_apply_anim_looping(mapObject, sprite, animNum); sprite->animPaused = FALSE; - sprite->data2 = 1; - sprite->data3 = duration; + sprite->data[2] = 1; + sprite->data[3] = duration; } bool8 sub_809459C(struct MapObject *mapObject, struct Sprite *sprite) { - if (-- sprite->data3 == 0) + if (-- sprite->data[3] == 0) { - sprite->data2 = 2; + sprite->data[2] = 2; sprite->animPaused = TRUE; return TRUE; } @@ -4485,7 +4485,7 @@ bool8 sub_809459C(struct MapObject *mapObject, struct Sprite *sprite) bool8 sub_80945C4(struct MapObject *mapObject, struct Sprite *sprite) { - if (sprite->data3 & 1) + if (sprite->data[3] & 1) { sprite->animDelayCounter ++; } @@ -4539,7 +4539,7 @@ void npc_set_direction_and_anim__an_proceed(struct MapObject *mapObject, struct { obj_anim_image_set_and_seek(sprite, animNum, 0); FieldObjectSetDirection(mapObject, direction); - sprite->data2 = 1; + sprite->data[2] = 1; } bool8 sub_8094DAC(struct MapObject *mapObject, struct Sprite *sprite) @@ -4552,7 +4552,7 @@ bool8 sub_8094DC4(struct MapObject *mapObject, struct Sprite *sprite) { if (sub_80979BC(sprite)) { - sprite->data2 = 2; + sprite->data[2] = 2; return TRUE; } return FALSE; @@ -4575,7 +4575,7 @@ bool8 name##_2(struct MapObject *mapObject, struct Sprite *sprite)\ {\ if (sub_80941C8(mapObject, sprite))\ {\ - sprite->data2 = 2;\ + sprite->data[2] = 2;\ mapObject->mapobj_bit_5 = FALSE;\ return TRUE;\ }\ @@ -4595,7 +4595,7 @@ bool8 sub_8094F38(struct MapObject *mapObject, struct Sprite *sprite) { an_look_any(mapObject, sprite, sub_8092AF8(mapObject->coords2.x, mapObject->coords2.y, gMapObjects[mapObjectId].coords2.x, gMapObjects[mapObjectId].coords2.y)); } - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -4607,21 +4607,21 @@ bool8 sub_8094F94(struct MapObject *mapObject, struct Sprite *sprite) { an_look_any(mapObject, sprite, GetOppositeDirection(sub_8092AF8(mapObject->coords2.x, mapObject->coords2.y, gMapObjects[mapObjectId].coords2.x, gMapObjects[mapObjectId].coords2.y))); } - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } bool8 sub_8094FF8(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_9 = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } bool8 sub_8095008(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_9 = FALSE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -4653,42 +4653,42 @@ bool8 sub_8095450(struct MapObject *mapObject, struct Sprite *sprite) bool8 sub_8095460(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_25 = FALSE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } bool8 sub_8095470(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_25 = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } bool8 sub_8095480(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_12 = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } bool8 sub_8095490(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_12 = GetFieldObjectGraphicsInfo(mapObject->graphicsId)->inanimate; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } bool8 sub_80954BC(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_13 = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } bool8 sub_80954CC(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_13 = FALSE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -4696,7 +4696,7 @@ bool8 do_exclamation_mark_bubble_1(struct MapObject *mapObject, struct Sprite *s { FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gFieldEffectArguments[0], (u8 *)&gFieldEffectArguments[1], (u8 *)&gFieldEffectArguments[2]); FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON_1); - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -4704,7 +4704,7 @@ bool8 do_exclamation_mark_bubble_2(struct MapObject *mapObject, struct Sprite *s { FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gFieldEffectArguments[0], (u8 *)&gFieldEffectArguments[1], (u8 *)&gFieldEffectArguments[2]); FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON_2); - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -4712,7 +4712,7 @@ bool8 do_heart_bubble(struct MapObject *mapObject, struct Sprite *sprite) { FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gFieldEffectArguments[0], (u8 *)&gFieldEffectArguments[1], (u8 *)&gFieldEffectArguments[2]); FieldEffectStart(FLDEFF_HEART_ICON); - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -4725,11 +4725,11 @@ bool8 sub_8095548(struct MapObject *mapObject, struct Sprite *sprite) } if (mapObject->animPattern != 0x39 && mapObject->animPattern != 0x3A) { - sprite->data2 = 2; + sprite->data[2] = 2; return TRUE; } sub_8155D78(mapObject); - sprite->data2 = 1; + sprite->data[2] = 1; return sub_809558C(mapObject, sprite); } @@ -4737,7 +4737,7 @@ bool8 sub_809558C(struct MapObject *mapObject, struct Sprite *sprite) { if (sub_8155DA0(mapObject)) { - sprite->data2 = 2; + sprite->data[2] = 2; return TRUE; } return FALSE; @@ -4746,7 +4746,7 @@ bool8 sub_809558C(struct MapObject *mapObject, struct Sprite *sprite) bool8 sub_80955AC(struct MapObject *mapObject, struct Sprite *sprite) { obj_anim_image_set_and_seek(sprite, 1, 0); - sprite->data2 = 1; + sprite->data[2] = 1; return FALSE; } @@ -4755,7 +4755,7 @@ bool8 sub_80955C8(struct MapObject *mapObject, struct Sprite *sprite) if (sub_80979BC(sprite)) { SetFieldObjectStepTimer(sprite, 32); - sprite->data2 = 2; + sprite->data[2] = 2; } return FALSE; } @@ -4766,7 +4766,7 @@ bool8 sub_80955EC(struct MapObject *mapObject, struct Sprite *sprite) if (RunFieldObjectStepTimer(sprite)) { mapObject->mapobj_bit_13 = TRUE; - sprite->data2 = 3; + sprite->data[2] = 3; } return FALSE; } @@ -4774,7 +4774,7 @@ bool8 sub_80955EC(struct MapObject *mapObject, struct Sprite *sprite) bool8 sub_8095628(struct MapObject *mapObject, struct Sprite *sprite) { obj_anim_image_set_and_seek(sprite, 1, 0); - sprite->data2 = 1; + sprite->data[2] = 1; return FALSE; } @@ -4783,7 +4783,7 @@ bool8 sub_8095644(struct MapObject *mapObject, struct Sprite *sprite) if (sub_80979BC(sprite)) { SetFieldObjectStepTimer(sprite, 32); - sprite->data2 = 2; + sprite->data[2] = 2; } return FALSE; } @@ -4794,7 +4794,7 @@ bool8 sub_8095668(struct MapObject *mapObject, struct Sprite *sprite) if (RunFieldObjectStepTimer(sprite)) { mapObject->mapobj_bit_13 = TRUE; - sprite->data2 = 3; + sprite->data[2] = 3; } return FALSE; } @@ -4802,14 +4802,14 @@ bool8 sub_8095668(struct MapObject *mapObject, struct Sprite *sprite) bool8 sub_80956A4(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_26 = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } bool8 sub_80956B4(struct MapObject *mapObject, struct Sprite *sprite) { mapObject->mapobj_bit_26 = FALSE; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -4856,7 +4856,7 @@ bool8 name##_2(struct MapObject *mapObject, struct Sprite *sprite)\ if (fn2(mapObject, sprite))\ {\ sprite->affineAnimPaused = TRUE;\ - sprite->data2 = 2;\ + sprite->data[2] = 2;\ return TRUE;\ }\ return FALSE;\ @@ -4873,7 +4873,7 @@ static void sub_80958C0(struct MapObject *mapObject, struct Sprite *sprite, u8 d npc_coords_shift_still(mapObject); obj_npc_animation_step(mapObject, sprite, sub_80929FC(direction)); sprite->animPaused = TRUE; - sprite->data2 = 1; + sprite->data[2] = 1; } bool8 sub_8095900(struct MapObject *mapObject, struct Sprite *sprite) @@ -4941,7 +4941,7 @@ bool8 sub_8095B0C(struct MapObject *mapObject, struct Sprite *sprite) bool8 sub_8095B44(struct MapObject *mapObject, struct Sprite *sprite) { sub_8095AF0(mapObject, sprite); - sprite->data2 = 1; + sprite->data[2] = 1; return sub_8095B64(mapObject, sprite); } @@ -4949,7 +4949,7 @@ bool8 sub_8095B64(struct MapObject *mapObject, struct Sprite *sprite) { if (sub_8095B0C(mapObject, sprite)) { - sprite->data2 = 2; + sprite->data[2] = 2; return TRUE; } return FALSE; @@ -5017,7 +5017,7 @@ an_walk_any_2_macro(sub_8096428, sub_8096330, npc_obj_ministep_stop_on_arrival, bool8 sub_8096468(struct MapObject *mapObject, struct Sprite *sprite) { sub_8097FA4(mapObject); - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -5025,7 +5025,7 @@ bool8 sub_809647C(struct MapObject *mapObject, struct Sprite *sprite) { sub_8098044(mapObject->mapobj_unk_1B); sprite->pos2.y = 0; - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } @@ -5034,7 +5034,7 @@ bool8 sub_8096494(struct MapObject *mapObject, struct Sprite *sprite) if (sprite->pos2.y == 0) { sub_8098044(mapObject->mapobj_unk_1B); - sprite->data2 = 1; + sprite->data[2] = 1; return TRUE; } return FALSE; diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index bc7177bd7..af1f9813a 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -580,9 +580,9 @@ static void Task_Hof_SetMonDisplayTask(u8 taskId) gTasks[taskId].func = Task_Hof_DisplayMon; } -#define tDestinationX data1 -#define tDestinationY data2 -#define tSpecies data7 +#define tDestinationX data[1] +#define tDestinationY data[2] +#define tSpecies data[7] static void Task_Hof_DisplayMon(u8 taskId) { @@ -613,7 +613,7 @@ static void Task_Hof_DisplayMon(u8 taskId) spriteId = sub_818D3E4(currMon->species, currMon->tid, currMon->personality, 1, xPos, yPos, currMonId, 0xFFFF); gSprites[spriteId].tDestinationX = field4; gSprites[spriteId].tDestinationY = field6; - gSprites[spriteId].data0 = 0; + gSprites[spriteId].data[0] = 0; gSprites[spriteId].tSpecies = currMon->species; gSprites[spriteId].callback = SpriteCB_GetOnScreenAndAnimate; gTasks[taskId].tMonSpriteId(currMonId) = spriteId; @@ -1404,13 +1404,13 @@ static void sub_81751A4(struct Sprite* sprite) u8 tableID; sprite->pos2.y++; - sprite->pos2.y += sprite->data1; + sprite->pos2.y += sprite->data[1]; - tableID = sprite->data0; + tableID = sprite->data[0]; rand = (Random() % 4) + 8; sprite->pos2.x = rand * gSineTable[tableID] / 256; - sprite->data0 += 4; + sprite->data[0] += 4; } } @@ -1428,9 +1428,9 @@ static bool8 sub_81751FC(void) StartSpriteAnim(sprite, Random() % 17); if (Random() & 3) - sprite->data1 = 0; + sprite->data[1] = 0; else - sprite->data1 = 1; + sprite->data[1] = 1; return FALSE; } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index e9cd3e215..e806245a9 100755 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -937,7 +937,7 @@ void sub_81C0704(u8 taskId) gUnknown_0203CF1C->unk40D3 = sub_81C45F4(&gUnknown_0203CF1C->currentMon, &data[1]); if (gUnknown_0203CF1C->unk40D3 == 0xFF) return; - gSprites[gUnknown_0203CF1C->unk40D3].data2 = 1; + gSprites[gUnknown_0203CF1C->unk40D3].data[2] = 1; sub_81C0E24(); data[1] = 0; break; @@ -952,7 +952,7 @@ void sub_81C0704(u8 taskId) sub_81C2524(); break; case 12: - gSprites[gUnknown_0203CF1C->unk40D3].data2 = 0; + gSprites[gUnknown_0203CF1C->unk40D3].data[2] = 0; break; default: if (sub_81221EC() == 0 && FuncIsActiveTask(sub_81C20F0) == 0) diff --git a/src/region_map.c b/src/region_map.c index 8c8f64df9..a91119420 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1332,9 +1332,9 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag) gRegionMap->cursorSprite->pos1.x = 8 * gRegionMap->cursorPosX + 4; gRegionMap->cursorSprite->pos1.y = 8 * gRegionMap->cursorPosY + 4; } - gRegionMap->cursorSprite->data1 = 2; - gRegionMap->cursorSprite->data2 = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101; - gRegionMap->cursorSprite->data3 = TRUE; + gRegionMap->cursorSprite->data[1] = 2; + gRegionMap->cursorSprite->data[2] = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101; + gRegionMap->cursorSprite->data[3] = TRUE; } } @@ -1350,12 +1350,12 @@ static void FreeRegionMapCursorSprite(void) void sub_8124268(void) { - gRegionMap->cursorSprite->data3 = TRUE; + gRegionMap->cursorSprite->data[3] = TRUE; } void sub_8124278(void) { - gRegionMap->cursorSprite->data3 = FALSE; + gRegionMap->cursorSprite->data[3] = FALSE; } void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag) @@ -1429,17 +1429,17 @@ static void RegionMapPlayerIconSpriteCallback_Zoomed(struct Sprite *sprite) { sprite->pos2.x = -2 * gRegionMap->scrollX; sprite->pos2.y = -2 * gRegionMap->scrollY; - sprite->data0 = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY; - sprite->data1 = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX; - if (sprite->data0 < -8 || sprite->data0 > 0xa8 || sprite->data1 < -8 || sprite->data1 > 0xf8) + sprite->data[0] = sprite->pos1.y + sprite->pos2.y + sprite->centerToCornerVecY; + sprite->data[1] = sprite->pos1.x + sprite->pos2.x + sprite->centerToCornerVecX; + if (sprite->data[0] < -8 || sprite->data[0] > 0xa8 || sprite->data[1] < -8 || sprite->data[1] > 0xf8) { - sprite->data2 = FALSE; + sprite->data[2] = FALSE; } else { - sprite->data2 = TRUE; + sprite->data[2] = TRUE; } - if (sprite->data2 == TRUE) + if (sprite->data[2] == TRUE) { RegionMapPlayerIconSpriteCallback(sprite); } @@ -1458,9 +1458,9 @@ static void RegionMapPlayerIconSpriteCallback(struct Sprite *sprite) { if (gRegionMap->blinkPlayerIcon) { - if (++sprite->data7 > 16) + if (++sprite->data[7] > 16) { - sprite->data7 = 0; + sprite->data[7] = 0; sprite->invisible = sprite->invisible ? FALSE : TRUE; } } @@ -1790,7 +1790,7 @@ static void sub_8124AD4(void) shape += 3; } StartSpriteAnim(&gSprites[spriteId], shape); - gSprites[spriteId].data0 = i; + gSprites[spriteId].data[0] = i; } canFlyFlag++; } @@ -1820,7 +1820,7 @@ static void sub_8124BE4(void) gSprites[spriteId].oam.size = 1; gSprites[spriteId].callback = sub_8124CBC; StartSpriteAnim(&gSprites[spriteId], 6); - gSprites[spriteId].data0 = mapSecId; + gSprites[spriteId].data[0] = mapSecId; } } } @@ -1828,17 +1828,17 @@ static void sub_8124BE4(void) static void sub_8124CBC(struct Sprite *sprite) { - if (gUnknown_0203A148->regionMap.mapSecId == sprite->data0) + if (gUnknown_0203A148->regionMap.mapSecId == sprite->data[0]) { - if (++sprite->data1 > 16) + if (++sprite->data[1] > 16) { - sprite->data1 = 0; + sprite->data[1] = 0; sprite->invisible = sprite->invisible ? FALSE : TRUE; } } else { - sprite->data1 = 16; + sprite->data[1] = 16; sprite->invisible = FALSE; } } diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 962ea0f6e..4ad1971fd 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -263,8 +263,8 @@ static void CreateBankSprite(u8 bank) gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankPosition(bank, 2), posY, sub_80A82E4(bank)); gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES); + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES); StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_CASTFORM) @@ -278,7 +278,7 @@ static void CreateBankSprite(u8 bank) sub_80A82E4(0)); gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gBankSpriteIds[bank]].data0 = bank; + gSprites[gBankSpriteIds[bank]].data[0] = bank; } else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0) { @@ -288,7 +288,7 @@ static void CreateBankSprite(u8 bank) sub_80A82E4(0)); gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gBankSpriteIds[bank]].data0 = bank; + gSprites[gBankSpriteIds[bank]].data[0] = bank; } else { @@ -299,8 +299,8 @@ static void CreateBankSprite(u8 bank) gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, GetBankPosition(bank, 2), posY, sub_80A82E4(bank)); gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank; gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy; - gSprites[gBankSpriteIds[bank]].data0 = bank; - gSprites[gBankSpriteIds[bank]].data2 = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES); + gSprites[gBankSpriteIds[bank]].data[0] = bank; + gSprites[gBankSpriteIds[bank]].data[2] = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES); StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]); if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_CASTFORM) diff --git a/src/sprite.c b/src/sprite.c index daa019019..9db61d2e9 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -168,14 +168,7 @@ static const struct Sprite sDummySprite = .animPaused = 0, .affineAnimPaused = 0, .animLoopCounter = 0, - .data0 = 0, - .data1 = 0, - .data2 = 0, - .data3 = 0, - .data4 = 0, - .data5 = 0, - .data6 = 0, - .data7 = 0, + .data = {0, 0, 0, 0, 0, 0, 0}, .inUse = 0, .coordOffsetEnabled = 0, .invisible = 0, @@ -1075,7 +1068,7 @@ void BeginAffineAnim(struct Sprite *sprite) ApplyAffineAnimFrame(matrixNum, &frameCmd); sAffineAnimStates[matrixNum].delayCounter = frameCmd.duration; if (sprite->flags_f) - obj_update_pos2(sprite, sprite->data6, sprite->data7); + obj_update_pos2(sprite, sprite->data[6], sprite->data[7]); } } @@ -1101,7 +1094,7 @@ void ContinueAffineAnim(struct Sprite *sprite) sAffineAnimCmdFuncs[funcIndex](matrixNum, sprite); } if (sprite->flags_f) - obj_update_pos2(sprite, sprite->data6, sprite->data7); + obj_update_pos2(sprite, sprite->data[6], sprite->data[7]); } } @@ -1197,8 +1190,8 @@ u8 GetSpriteMatrixNum(struct Sprite *sprite) void sub_8007E18(struct Sprite* sprite, s16 a2, s16 a3) { - sprite->data6 = a2; - sprite->data7 = a3; + sprite->data[6] = a2; + sprite->data[7] = a3; sprite->flags_f = 1; } diff --git a/src/starter_choose.c b/src/starter_choose.c index 8cf3cfefa..6be362caf 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -170,20 +170,20 @@ void CB2_ChooseStarter(void) // Create hand sprite spriteId = CreateSprite(&sSpriteTemplate_Hand, 120, 56, 2); - gSprites[spriteId].data0 = taskId; + gSprites[spriteId].data[0] = taskId; // Create three Pokeball sprites spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[0][0], sPokeballCoords[0][1], 2); - gSprites[spriteId].data0 = taskId; - gSprites[spriteId].data1 = 0; + gSprites[spriteId].data[0] = taskId; + gSprites[spriteId].data[1] = 0; spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[1][0], sPokeballCoords[1][1], 2); - gSprites[spriteId].data0 = taskId; - gSprites[spriteId].data1 = 1; + gSprites[spriteId].data[0] = taskId; + gSprites[spriteId].data[1] = 1; spriteId = CreateSprite(&sSpriteTemplate_PokeBall, sPokeballCoords[2][0], sPokeballCoords[2][1], 2); - gSprites[spriteId].data0 = taskId; - gSprites[spriteId].data1 = 2; + gSprites[spriteId].data[0] = taskId; + gSprites[spriteId].data[1] = 2; sStarterChooseWindowId = 0xFF; } @@ -363,15 +363,15 @@ static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y) static void sub_81346DC(struct Sprite *sprite) { - sprite->pos1.x = gUnknown_085B1E28[gTasks[sprite->data0].tStarterSelection][0]; - sprite->pos1.y = gUnknown_085B1E28[gTasks[sprite->data0].tStarterSelection][1]; - sprite->pos2.y = Sin(sprite->data1, 8); - sprite->data1 = (u8)(sprite->data1) + 4; + sprite->pos1.x = gUnknown_085B1E28[gTasks[sprite->data[0]].tStarterSelection][0]; + sprite->pos1.y = gUnknown_085B1E28[gTasks[sprite->data[0]].tStarterSelection][1]; + sprite->pos2.y = Sin(sprite->data[1], 8); + sprite->data[1] = (u8)(sprite->data[1]) + 4; } static void sub_813473C(struct Sprite *sprite) { - if (gTasks[sprite->data0].tStarterSelection == sprite->data1) + if (gTasks[sprite->data[0]].tStarterSelection == sprite->data[1]) StartSpriteAnimIfDifferent(sprite, 1); else StartSpriteAnimIfDifferent(sprite, 0);