From 62c4379a217d10ea0224f31d83c89177be119822 Mon Sep 17 00:00:00 2001 From: Meowsy Date: Mon, 17 Dec 2018 12:28:11 -0500 Subject: [PATCH 1/8] Remove magic numbers. --- src/battle_script_commands.c | 2 +- src/pokemon.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 475b16c98..f1e7143dc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8648,7 +8648,7 @@ static void atkAE_healpartystatus(void) u16 species = GetMonData(&party[i], MON_DATA_SPECIES2); u8 abilityBit = GetMonData(&party[i], MON_DATA_ALT_ABILITY); - if (species != 0 && species != SPECIES_EGG) + if (species != SPECIES_NONE && species != SPECIES_EGG) { u8 ability; diff --git a/src/pokemon.c b/src/pokemon.c index 8e32479a1..50f0a1ac2 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5935,13 +5935,13 @@ u16 HoennToNationalOrder(u16 hoennNum) u16 SpeciesToCryId(u16 species) { - if (species <= 250) + if (species <= SPECIES_CELEBI - 1) return species; - if (species < 276) + if (species < SPECIES_TREECKO - 1) return 200; - return gSpeciesIdToCryId[species - 276]; + return gSpeciesIdToCryId[species - (SPECIES_TREECKO - 1)]; } void sub_806D544(u16 species, u32 personality, u8 *dest) From e92245ab0693b8dac48e0a4b9445015572a5091f Mon Sep 17 00:00:00 2001 From: Meowsy Date: Mon, 17 Dec 2018 12:29:35 -0500 Subject: [PATCH 2/8] Add macros to simplify defining front animations and still pics. --- src/data/pokemon_graphics/front_anims.h | 885 +++++++++--------- .../pokemon_graphics/still_front_pic_table.h | 884 ++++++++--------- 2 files changed, 887 insertions(+), 882 deletions(-) diff --git a/src/data/pokemon_graphics/front_anims.h b/src/data/pokemon_graphics/front_anims.h index 0e7b75bde..8a42eb5c9 100644 --- a/src/data/pokemon_graphics/front_anims.h +++ b/src/data/pokemon_graphics/front_anims.h @@ -1,4 +1,4 @@ - + const union AnimCmd gAnimCmd_NONE_1[] = { ANIMCMD_FRAME(0, 30), @@ -6946,446 +6946,449 @@ const union AnimCmd *const gAnims_UNOWN_QMARK[] ={ gAnimCmd_UNOWN_QMARK_1, }; +#define ANIM_CMD(name) [SPECIES_##name] = gAnims_##name +#define ANIM_CMD_FULL(name, anims) [SPECIES_##name] = anims + const union AnimCmd* const * const gMonAnimationsSpriteAnimsPtrTable[] = { - gAnims_NONE, - gAnims_BULBASAUR, - gAnims_IVYSAUR, - gAnims_VENUSAUR, - gAnims_CHARMANDER, - gAnims_CHARMELEON, - gAnims_CHARIZARD, - gAnims_SQUIRTLE, - gAnims_WARTORTLE, - gAnims_BLASTOISE, - gAnims_CATERPIE, - gAnims_METAPOD, - gAnims_BUTTERFREE, - gAnims_WEEDLE, - gAnims_KAKUNA, - gAnims_BEEDRILL, - gAnims_PIDGEY, - gAnims_PIDGEOTTO, - gAnims_PIDGEOT, - gAnims_RATTATA, - gAnims_RATICATE, - gAnims_SPEAROW, - gAnims_FEAROW, - gAnims_EKANS, - gAnims_ARBOK, - gAnims_PIKACHU, - gAnims_RAICHU, - gAnims_SANDSHREW, - gAnims_SANDSLASH, - gAnims_NIDORAN_F, - gAnims_NIDORINA, - gAnims_NIDOQUEEN, - gAnims_NIDORAN_M, - gAnims_NIDORINO, - gAnims_NIDOKING, - gAnims_CLEFAIRY, - gAnims_CLEFABLE, - gAnims_VULPIX, - gAnims_NINETALES, - gAnims_JIGGLYPUFF, - gAnims_WIGGLYTUFF, - gAnims_ZUBAT, - gAnims_GOLBAT, - gAnims_ODDISH, - gAnims_GLOOM, - gAnims_VILEPLUME, - gAnims_PARAS, - gAnims_PARASECT, - gAnims_VENONAT, - gAnims_VENOMOTH, - gAnims_DIGLETT, - gAnims_DUGTRIO, - gAnims_MEOWTH, - gAnims_PERSIAN, - gAnims_PSYDUCK, - gAnims_GOLDUCK, - gAnims_MANKEY, - gAnims_PRIMEAPE, - gAnims_GROWLITHE, - gAnims_ARCANINE, - gAnims_POLIWAG, - gAnims_POLIWHIRL, - gAnims_POLIWRATH, - gAnims_ABRA, - gAnims_KADABRA, - gAnims_ALAKAZAM, - gAnims_MACHOP, - gAnims_MACHOKE, - gAnims_MACHAMP, - gAnims_BELLSPROUT, - gAnims_WEEPINBELL, - gAnims_VICTREEBEL, - gAnims_TENTACOOL, - gAnims_TENTACRUEL, - gAnims_GEODUDE, - gAnims_GRAVELER, - gAnims_GOLEM, - gAnims_PONYTA, - gAnims_RAPIDASH, - gAnims_SLOWPOKE, - gAnims_SLOWBRO, - gAnims_MAGNEMITE, - gAnims_MAGNETON, - gAnims_FARFETCHD, - gAnims_DODUO, - gAnims_DODRIO, - gAnims_SEEL, - gAnims_DEWGONG, - gAnims_GRIMER, - gAnims_MUK, - gAnims_SHELLDER, - gAnims_CLOYSTER, - gAnims_GASTLY, - gAnims_HAUNTER, - gAnims_GENGAR, - gAnims_ONIX, - gAnims_DROWZEE, - gAnims_HYPNO, - gAnims_KRABBY, - gAnims_KINGLER, - gAnims_VOLTORB, - gAnims_ELECTRODE, - gAnims_EXEGGCUTE, - gAnims_EXEGGUTOR, - gAnims_CUBONE, - gAnims_MAROWAK, - gAnims_HITMONLEE, - gAnims_HITMONCHAN, - gAnims_LICKITUNG, - gAnims_KOFFING, - gAnims_WEEZING, - gAnims_RHYHORN, - gAnims_RHYDON, - gAnims_CHANSEY, - gAnims_TANGELA, - gAnims_KANGASKHAN, - gAnims_HORSEA, - gAnims_SEADRA, - gAnims_GOLDEEN, - gAnims_SEAKING, - gAnims_STARYU, - gAnims_STARMIE, - gAnims_MR_MIME, - gAnims_SCYTHER, - gAnims_JYNX, - gAnims_ELECTABUZZ, - gAnims_MAGMAR, - gAnims_PINSIR, - gAnims_TAUROS, - gAnims_MAGIKARP, - gAnims_GYARADOS, - gAnims_LAPRAS, - gAnims_DITTO, - gAnims_EEVEE, - gAnims_VAPOREON, - gAnims_JOLTEON, - gAnims_FLAREON, - gAnims_PORYGON, - gAnims_OMANYTE, - gAnims_OMASTAR, - gAnims_KABUTO, - gAnims_KABUTOPS, - gAnims_AERODACTYL, - gAnims_SNORLAX, - gAnims_ARTICUNO, - gAnims_ZAPDOS, - gAnims_MOLTRES, - gAnims_DRATINI, - gAnims_DRAGONAIR, - gAnims_DRAGONITE, - gAnims_MEWTWO, - gAnims_MEW, - gAnims_CHIKORITA, - gAnims_BAYLEEF, - gAnims_MEGANIUM, - gAnims_CYNDAQUIL, - gAnims_QUILAVA, - gAnims_TYPHLOSION, - gAnims_TOTODILE, - gAnims_CROCONAW, - gAnims_FERALIGATR, - gAnims_SENTRET, - gAnims_FURRET, - gAnims_HOOTHOOT, - gAnims_NOCTOWL, - gAnims_LEDYBA, - gAnims_LEDIAN, - gAnims_SPINARAK, - gAnims_ARIADOS, - gAnims_CROBAT, - gAnims_CHINCHOU, - gAnims_LANTURN, - gAnims_PICHU, - gAnims_CLEFFA, - gAnims_IGGLYBUFF, - gAnims_TOGEPI, - gAnims_TOGETIC, - gAnims_NATU, - gAnims_XATU, - gAnims_MAREEP, - gAnims_FLAAFFY, - gAnims_AMPHAROS, - gAnims_BELLOSSOM, - gAnims_MARILL, - gAnims_AZUMARILL, - gAnims_SUDOWOODO, - gAnims_POLITOED, - gAnims_HOPPIP, - gAnims_SKIPLOOM, - gAnims_JUMPLUFF, - gAnims_AIPOM, - gAnims_SUNKERN, - gAnims_SUNFLORA, - gAnims_YANMA, - gAnims_WOOPER, - gAnims_QUAGSIRE, - gAnims_ESPEON, - gAnims_UMBREON, - gAnims_MURKROW, - gAnims_SLOWKING, - gAnims_MISDREAVUS, - gAnims_UNOWN, - gAnims_WOBBUFFET, - gAnims_GIRAFARIG, - gAnims_PINECO, - gAnims_FORRETRESS, - gAnims_DUNSPARCE, - gAnims_GLIGAR, - gAnims_STEELIX, - gAnims_SNUBBULL, - gAnims_GRANBULL, - gAnims_QWILFISH, - gAnims_SCIZOR, - gAnims_SHUCKLE, - gAnims_HERACROSS, - gAnims_SNEASEL, - gAnims_TEDDIURSA, - gAnims_URSARING, - gAnims_SLUGMA, - gAnims_MAGCARGO, - gAnims_SWINUB, - gAnims_PILOSWINE, - gAnims_CORSOLA, - gAnims_REMORAID, - gAnims_OCTILLERY, - gAnims_DELIBIRD, - gAnims_MANTINE, - gAnims_SKARMORY, - gAnims_HOUNDOUR, - gAnims_HOUNDOOM, - gAnims_KINGDRA, - gAnims_PHANPY, - gAnims_DONPHAN, - gAnims_PORYGON2, - gAnims_STANTLER, - gAnims_SMEARGLE, - gAnims_TYROGUE, - gAnims_HITMONTOP, - gAnims_SMOOCHUM, - gAnims_ELEKID, - gAnims_MAGBY, - gAnims_MILTANK, - gAnims_BLISSEY, - gAnims_RAIKOU, - gAnims_ENTEI, - gAnims_SUICUNE, - gAnims_LARVITAR, - gAnims_PUPITAR, - gAnims_TYRANITAR, - gAnims_LUGIA, - gAnims_HO_OH, - gAnims_CELEBI, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_OLD_UNOWN_B, - gAnims_TREECKO, - gAnims_GROVYLE, - gAnims_SCEPTILE, - gAnims_TORCHIC, - gAnims_COMBUSKEN, - gAnims_BLAZIKEN, - gAnims_MUDKIP, - gAnims_MARSHTOMP, - gAnims_SWAMPERT, - gAnims_POOCHYENA, - gAnims_MIGHTYENA, - gAnims_ZIGZAGOON, - gAnims_LINOONE, - gAnims_WURMPLE, - gAnims_SILCOON, - gAnims_BEAUTIFLY, - gAnims_CASCOON, - gAnims_DUSTOX, - gAnims_LOTAD, - gAnims_LOMBRE, - gAnims_LUDICOLO, - gAnims_SEEDOT, - gAnims_NUZLEAF, - gAnims_SHIFTRY, - gAnims_NINCADA, - gAnims_NINJASK, - gAnims_SHEDINJA, - gAnims_TAILLOW, - gAnims_SWELLOW, - gAnims_SHROOMISH, - gAnims_BRELOOM, - gAnims_SPINDA, - gAnims_WINGULL, - gAnims_PELIPPER, - gAnims_SURSKIT, - gAnims_MASQUERAIN, - gAnims_WAILMER, - gAnims_WAILORD, - gAnims_SKITTY, - gAnims_DELCATTY, - gAnims_KECLEON, - gAnims_BALTOY, - gAnims_CLAYDOL, - gAnims_NOSEPASS, - gAnims_TORKOAL, - gAnims_SABLEYE, - gAnims_BARBOACH, - gAnims_WHISCASH, - gAnims_LUVDISC, - gAnims_CORPHISH, - gAnims_CRAWDAUNT, - gAnims_FEEBAS, - gAnims_MILOTIC, - gAnims_CARVANHA, - gAnims_SHARPEDO, - gAnims_TRAPINCH, - gAnims_VIBRAVA, - gAnims_FLYGON, - gAnims_MAKUHITA, - gAnims_HARIYAMA, - gAnims_ELECTRIKE, - gAnims_MANECTRIC, - gAnims_NUMEL, - gAnims_CAMERUPT, - gAnims_SPHEAL, - gAnims_SEALEO, - gAnims_WALREIN, - gAnims_CACNEA, - gAnims_CACTURNE, - gAnims_SNORUNT, - gAnims_GLALIE, - gAnims_LUNATONE, - gAnims_SOLROCK, - gAnims_AZURILL, - gAnims_SPOINK, - gAnims_GRUMPIG, - gAnims_PLUSLE, - gAnims_MINUN, - gAnims_MAWILE, - gAnims_MEDITITE, - gAnims_MEDICHAM, - gAnims_SWABLU, - gAnims_ALTARIA, - gAnims_WYNAUT, - gAnims_DUSKULL, - gAnims_DUSCLOPS, - gAnims_ROSELIA, - gAnims_SLAKOTH, - gAnims_VIGOROTH, - gAnims_SLAKING, - gAnims_GULPIN, - gAnims_SWALOT, - gAnims_TROPIUS, - gAnims_WHISMUR, - gAnims_LOUDRED, - gAnims_EXPLOUD, - gAnims_CLAMPERL, - gAnims_HUNTAIL, - gAnims_GOREBYSS, - gAnims_ABSOL, - gAnims_SHUPPET, - gAnims_BANETTE, - gAnims_SEVIPER, - gAnims_ZANGOOSE, - gAnims_RELICANTH, - gAnims_ARON, - gAnims_LAIRON, - gAnims_AGGRON, - gAnims_CASTFORM, - gAnims_VOLBEAT, - gAnims_ILLUMISE, - gAnims_LILEEP, - gAnims_CRADILY, - gAnims_ANORITH, - gAnims_ARMALDO, - gAnims_RALTS, - gAnims_KIRLIA, - gAnims_GARDEVOIR, - gAnims_BAGON, - gAnims_SHELGON, - gAnims_SALAMENCE, - gAnims_BELDUM, - gAnims_METANG, - gAnims_METAGROSS, - gAnims_REGIROCK, - gAnims_REGICE, - gAnims_REGISTEEL, - gAnims_KYOGRE, - gAnims_GROUDON, - gAnims_RAYQUAZA, - gAnims_LATIAS, - gAnims_LATIOS, - gAnims_JIRACHI, - gAnims_DEOXYS, - gAnims_CHIMECHO, - gAnims_EGG, - gAnims_UNOWN_B, - gAnims_UNOWN_C, - gAnims_UNOWN_D, - gAnims_UNOWN_E, - gAnims_UNOWN_F, - gAnims_UNOWN_G, - gAnims_UNOWN_H, - gAnims_UNOWN_I, - gAnims_UNOWN_J, - gAnims_UNOWN_K, - gAnims_UNOWN_L, - gAnims_UNOWN_M, - gAnims_UNOWN_N, - gAnims_UNOWN_O, - gAnims_UNOWN_P, - gAnims_UNOWN_Q, - gAnims_UNOWN_R, - gAnims_UNOWN_S, - gAnims_UNOWN_T, - gAnims_UNOWN_U, - gAnims_UNOWN_V, - gAnims_UNOWN_W, - gAnims_UNOWN_X, - gAnims_UNOWN_Y, - gAnims_UNOWN_Z, - gAnims_UNOWN_EMARK, - gAnims_UNOWN_QMARK, + ANIM_CMD(NONE), + ANIM_CMD(BULBASAUR), + ANIM_CMD(IVYSAUR), + ANIM_CMD(VENUSAUR), + ANIM_CMD(CHARMANDER), + ANIM_CMD(CHARMELEON), + ANIM_CMD(CHARIZARD), + ANIM_CMD(SQUIRTLE), + ANIM_CMD(WARTORTLE), + ANIM_CMD(BLASTOISE), + ANIM_CMD(CATERPIE), + ANIM_CMD(METAPOD), + ANIM_CMD(BUTTERFREE), + ANIM_CMD(WEEDLE), + ANIM_CMD(KAKUNA), + ANIM_CMD(BEEDRILL), + ANIM_CMD(PIDGEY), + ANIM_CMD(PIDGEOTTO), + ANIM_CMD(PIDGEOT), + ANIM_CMD(RATTATA), + ANIM_CMD(RATICATE), + ANIM_CMD(SPEAROW), + ANIM_CMD(FEAROW), + ANIM_CMD(EKANS), + ANIM_CMD(ARBOK), + ANIM_CMD(PIKACHU), + ANIM_CMD(RAICHU), + ANIM_CMD(SANDSHREW), + ANIM_CMD(SANDSLASH), + ANIM_CMD(NIDORAN_F), + ANIM_CMD(NIDORINA), + ANIM_CMD(NIDOQUEEN), + ANIM_CMD(NIDORAN_M), + ANIM_CMD(NIDORINO), + ANIM_CMD(NIDOKING), + ANIM_CMD(CLEFAIRY), + ANIM_CMD(CLEFABLE), + ANIM_CMD(VULPIX), + ANIM_CMD(NINETALES), + ANIM_CMD(JIGGLYPUFF), + ANIM_CMD(WIGGLYTUFF), + ANIM_CMD(ZUBAT), + ANIM_CMD(GOLBAT), + ANIM_CMD(ODDISH), + ANIM_CMD(GLOOM), + ANIM_CMD(VILEPLUME), + ANIM_CMD(PARAS), + ANIM_CMD(PARASECT), + ANIM_CMD(VENONAT), + ANIM_CMD(VENOMOTH), + ANIM_CMD(DIGLETT), + ANIM_CMD(DUGTRIO), + ANIM_CMD(MEOWTH), + ANIM_CMD(PERSIAN), + ANIM_CMD(PSYDUCK), + ANIM_CMD(GOLDUCK), + ANIM_CMD(MANKEY), + ANIM_CMD(PRIMEAPE), + ANIM_CMD(GROWLITHE), + ANIM_CMD(ARCANINE), + ANIM_CMD(POLIWAG), + ANIM_CMD(POLIWHIRL), + ANIM_CMD(POLIWRATH), + ANIM_CMD(ABRA), + ANIM_CMD(KADABRA), + ANIM_CMD(ALAKAZAM), + ANIM_CMD(MACHOP), + ANIM_CMD(MACHOKE), + ANIM_CMD(MACHAMP), + ANIM_CMD(BELLSPROUT), + ANIM_CMD(WEEPINBELL), + ANIM_CMD(VICTREEBEL), + ANIM_CMD(TENTACOOL), + ANIM_CMD(TENTACRUEL), + ANIM_CMD(GEODUDE), + ANIM_CMD(GRAVELER), + ANIM_CMD(GOLEM), + ANIM_CMD(PONYTA), + ANIM_CMD(RAPIDASH), + ANIM_CMD(SLOWPOKE), + ANIM_CMD(SLOWBRO), + ANIM_CMD(MAGNEMITE), + ANIM_CMD(MAGNETON), + ANIM_CMD(FARFETCHD), + ANIM_CMD(DODUO), + ANIM_CMD(DODRIO), + ANIM_CMD(SEEL), + ANIM_CMD(DEWGONG), + ANIM_CMD(GRIMER), + ANIM_CMD(MUK), + ANIM_CMD(SHELLDER), + ANIM_CMD(CLOYSTER), + ANIM_CMD(GASTLY), + ANIM_CMD(HAUNTER), + ANIM_CMD(GENGAR), + ANIM_CMD(ONIX), + ANIM_CMD(DROWZEE), + ANIM_CMD(HYPNO), + ANIM_CMD(KRABBY), + ANIM_CMD(KINGLER), + ANIM_CMD(VOLTORB), + ANIM_CMD(ELECTRODE), + ANIM_CMD(EXEGGCUTE), + ANIM_CMD(EXEGGUTOR), + ANIM_CMD(CUBONE), + ANIM_CMD(MAROWAK), + ANIM_CMD(HITMONLEE), + ANIM_CMD(HITMONCHAN), + ANIM_CMD(LICKITUNG), + ANIM_CMD(KOFFING), + ANIM_CMD(WEEZING), + ANIM_CMD(RHYHORN), + ANIM_CMD(RHYDON), + ANIM_CMD(CHANSEY), + ANIM_CMD(TANGELA), + ANIM_CMD(KANGASKHAN), + ANIM_CMD(HORSEA), + ANIM_CMD(SEADRA), + ANIM_CMD(GOLDEEN), + ANIM_CMD(SEAKING), + ANIM_CMD(STARYU), + ANIM_CMD(STARMIE), + ANIM_CMD(MR_MIME), + ANIM_CMD(SCYTHER), + ANIM_CMD(JYNX), + ANIM_CMD(ELECTABUZZ), + ANIM_CMD(MAGMAR), + ANIM_CMD(PINSIR), + ANIM_CMD(TAUROS), + ANIM_CMD(MAGIKARP), + ANIM_CMD(GYARADOS), + ANIM_CMD(LAPRAS), + ANIM_CMD(DITTO), + ANIM_CMD(EEVEE), + ANIM_CMD(VAPOREON), + ANIM_CMD(JOLTEON), + ANIM_CMD(FLAREON), + ANIM_CMD(PORYGON), + ANIM_CMD(OMANYTE), + ANIM_CMD(OMASTAR), + ANIM_CMD(KABUTO), + ANIM_CMD(KABUTOPS), + ANIM_CMD(AERODACTYL), + ANIM_CMD(SNORLAX), + ANIM_CMD(ARTICUNO), + ANIM_CMD(ZAPDOS), + ANIM_CMD(MOLTRES), + ANIM_CMD(DRATINI), + ANIM_CMD(DRAGONAIR), + ANIM_CMD(DRAGONITE), + ANIM_CMD(MEWTWO), + ANIM_CMD(MEW), + ANIM_CMD(CHIKORITA), + ANIM_CMD(BAYLEEF), + ANIM_CMD(MEGANIUM), + ANIM_CMD(CYNDAQUIL), + ANIM_CMD(QUILAVA), + ANIM_CMD(TYPHLOSION), + ANIM_CMD(TOTODILE), + ANIM_CMD(CROCONAW), + ANIM_CMD(FERALIGATR), + ANIM_CMD(SENTRET), + ANIM_CMD(FURRET), + ANIM_CMD(HOOTHOOT), + ANIM_CMD(NOCTOWL), + ANIM_CMD(LEDYBA), + ANIM_CMD(LEDIAN), + ANIM_CMD(SPINARAK), + ANIM_CMD(ARIADOS), + ANIM_CMD(CROBAT), + ANIM_CMD(CHINCHOU), + ANIM_CMD(LANTURN), + ANIM_CMD(PICHU), + ANIM_CMD(CLEFFA), + ANIM_CMD(IGGLYBUFF), + ANIM_CMD(TOGEPI), + ANIM_CMD(TOGETIC), + ANIM_CMD(NATU), + ANIM_CMD(XATU), + ANIM_CMD(MAREEP), + ANIM_CMD(FLAAFFY), + ANIM_CMD(AMPHAROS), + ANIM_CMD(BELLOSSOM), + ANIM_CMD(MARILL), + ANIM_CMD(AZUMARILL), + ANIM_CMD(SUDOWOODO), + ANIM_CMD(POLITOED), + ANIM_CMD(HOPPIP), + ANIM_CMD(SKIPLOOM), + ANIM_CMD(JUMPLUFF), + ANIM_CMD(AIPOM), + ANIM_CMD(SUNKERN), + ANIM_CMD(SUNFLORA), + ANIM_CMD(YANMA), + ANIM_CMD(WOOPER), + ANIM_CMD(QUAGSIRE), + ANIM_CMD(ESPEON), + ANIM_CMD(UMBREON), + ANIM_CMD(MURKROW), + ANIM_CMD(SLOWKING), + ANIM_CMD(MISDREAVUS), + ANIM_CMD(UNOWN), + ANIM_CMD(WOBBUFFET), + ANIM_CMD(GIRAFARIG), + ANIM_CMD(PINECO), + ANIM_CMD(FORRETRESS), + ANIM_CMD(DUNSPARCE), + ANIM_CMD(GLIGAR), + ANIM_CMD(STEELIX), + ANIM_CMD(SNUBBULL), + ANIM_CMD(GRANBULL), + ANIM_CMD(QWILFISH), + ANIM_CMD(SCIZOR), + ANIM_CMD(SHUCKLE), + ANIM_CMD(HERACROSS), + ANIM_CMD(SNEASEL), + ANIM_CMD(TEDDIURSA), + ANIM_CMD(URSARING), + ANIM_CMD(SLUGMA), + ANIM_CMD(MAGCARGO), + ANIM_CMD(SWINUB), + ANIM_CMD(PILOSWINE), + ANIM_CMD(CORSOLA), + ANIM_CMD(REMORAID), + ANIM_CMD(OCTILLERY), + ANIM_CMD(DELIBIRD), + ANIM_CMD(MANTINE), + ANIM_CMD(SKARMORY), + ANIM_CMD(HOUNDOUR), + ANIM_CMD(HOUNDOOM), + ANIM_CMD(KINGDRA), + ANIM_CMD(PHANPY), + ANIM_CMD(DONPHAN), + ANIM_CMD(PORYGON2), + ANIM_CMD(STANTLER), + ANIM_CMD(SMEARGLE), + ANIM_CMD(TYROGUE), + ANIM_CMD(HITMONTOP), + ANIM_CMD(SMOOCHUM), + ANIM_CMD(ELEKID), + ANIM_CMD(MAGBY), + ANIM_CMD(MILTANK), + ANIM_CMD(BLISSEY), + ANIM_CMD(RAIKOU), + ANIM_CMD(ENTEI), + ANIM_CMD(SUICUNE), + ANIM_CMD(LARVITAR), + ANIM_CMD(PUPITAR), + ANIM_CMD(TYRANITAR), + ANIM_CMD(LUGIA), + ANIM_CMD(HO_OH), + ANIM_CMD(CELEBI), + ANIM_CMD(OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_C, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_D, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_E, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_F, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_G, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_H, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_I, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_J, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_K, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_L, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_M, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_N, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_O, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_P, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_Q, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_R, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_S, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_T, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_U, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_V, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_W, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_X, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_Y, gAnims_OLD_UNOWN_B), + ANIM_CMD_FULL(OLD_UNOWN_Z, gAnims_OLD_UNOWN_B), + ANIM_CMD(TREECKO), + ANIM_CMD(GROVYLE), + ANIM_CMD(SCEPTILE), + ANIM_CMD(TORCHIC), + ANIM_CMD(COMBUSKEN), + ANIM_CMD(BLAZIKEN), + ANIM_CMD(MUDKIP), + ANIM_CMD(MARSHTOMP), + ANIM_CMD(SWAMPERT), + ANIM_CMD(POOCHYENA), + ANIM_CMD(MIGHTYENA), + ANIM_CMD(ZIGZAGOON), + ANIM_CMD(LINOONE), + ANIM_CMD(WURMPLE), + ANIM_CMD(SILCOON), + ANIM_CMD(BEAUTIFLY), + ANIM_CMD(CASCOON), + ANIM_CMD(DUSTOX), + ANIM_CMD(LOTAD), + ANIM_CMD(LOMBRE), + ANIM_CMD(LUDICOLO), + ANIM_CMD(SEEDOT), + ANIM_CMD(NUZLEAF), + ANIM_CMD(SHIFTRY), + ANIM_CMD(NINCADA), + ANIM_CMD(NINJASK), + ANIM_CMD(SHEDINJA), + ANIM_CMD(TAILLOW), + ANIM_CMD(SWELLOW), + ANIM_CMD(SHROOMISH), + ANIM_CMD(BRELOOM), + ANIM_CMD(SPINDA), + ANIM_CMD(WINGULL), + ANIM_CMD(PELIPPER), + ANIM_CMD(SURSKIT), + ANIM_CMD(MASQUERAIN), + ANIM_CMD(WAILMER), + ANIM_CMD(WAILORD), + ANIM_CMD(SKITTY), + ANIM_CMD(DELCATTY), + ANIM_CMD(KECLEON), + ANIM_CMD(BALTOY), + ANIM_CMD(CLAYDOL), + ANIM_CMD(NOSEPASS), + ANIM_CMD(TORKOAL), + ANIM_CMD(SABLEYE), + ANIM_CMD(BARBOACH), + ANIM_CMD(WHISCASH), + ANIM_CMD(LUVDISC), + ANIM_CMD(CORPHISH), + ANIM_CMD(CRAWDAUNT), + ANIM_CMD(FEEBAS), + ANIM_CMD(MILOTIC), + ANIM_CMD(CARVANHA), + ANIM_CMD(SHARPEDO), + ANIM_CMD(TRAPINCH), + ANIM_CMD(VIBRAVA), + ANIM_CMD(FLYGON), + ANIM_CMD(MAKUHITA), + ANIM_CMD(HARIYAMA), + ANIM_CMD(ELECTRIKE), + ANIM_CMD(MANECTRIC), + ANIM_CMD(NUMEL), + ANIM_CMD(CAMERUPT), + ANIM_CMD(SPHEAL), + ANIM_CMD(SEALEO), + ANIM_CMD(WALREIN), + ANIM_CMD(CACNEA), + ANIM_CMD(CACTURNE), + ANIM_CMD(SNORUNT), + ANIM_CMD(GLALIE), + ANIM_CMD(LUNATONE), + ANIM_CMD(SOLROCK), + ANIM_CMD(AZURILL), + ANIM_CMD(SPOINK), + ANIM_CMD(GRUMPIG), + ANIM_CMD(PLUSLE), + ANIM_CMD(MINUN), + ANIM_CMD(MAWILE), + ANIM_CMD(MEDITITE), + ANIM_CMD(MEDICHAM), + ANIM_CMD(SWABLU), + ANIM_CMD(ALTARIA), + ANIM_CMD(WYNAUT), + ANIM_CMD(DUSKULL), + ANIM_CMD(DUSCLOPS), + ANIM_CMD(ROSELIA), + ANIM_CMD(SLAKOTH), + ANIM_CMD(VIGOROTH), + ANIM_CMD(SLAKING), + ANIM_CMD(GULPIN), + ANIM_CMD(SWALOT), + ANIM_CMD(TROPIUS), + ANIM_CMD(WHISMUR), + ANIM_CMD(LOUDRED), + ANIM_CMD(EXPLOUD), + ANIM_CMD(CLAMPERL), + ANIM_CMD(HUNTAIL), + ANIM_CMD(GOREBYSS), + ANIM_CMD(ABSOL), + ANIM_CMD(SHUPPET), + ANIM_CMD(BANETTE), + ANIM_CMD(SEVIPER), + ANIM_CMD(ZANGOOSE), + ANIM_CMD(RELICANTH), + ANIM_CMD(ARON), + ANIM_CMD(LAIRON), + ANIM_CMD(AGGRON), + ANIM_CMD(CASTFORM), + ANIM_CMD(VOLBEAT), + ANIM_CMD(ILLUMISE), + ANIM_CMD(LILEEP), + ANIM_CMD(CRADILY), + ANIM_CMD(ANORITH), + ANIM_CMD(ARMALDO), + ANIM_CMD(RALTS), + ANIM_CMD(KIRLIA), + ANIM_CMD(GARDEVOIR), + ANIM_CMD(BAGON), + ANIM_CMD(SHELGON), + ANIM_CMD(SALAMENCE), + ANIM_CMD(BELDUM), + ANIM_CMD(METANG), + ANIM_CMD(METAGROSS), + ANIM_CMD(REGIROCK), + ANIM_CMD(REGICE), + ANIM_CMD(REGISTEEL), + ANIM_CMD(KYOGRE), + ANIM_CMD(GROUDON), + ANIM_CMD(RAYQUAZA), + ANIM_CMD(LATIAS), + ANIM_CMD(LATIOS), + ANIM_CMD(JIRACHI), + ANIM_CMD(DEOXYS), + ANIM_CMD(CHIMECHO), + ANIM_CMD(EGG), + ANIM_CMD(UNOWN_B), + ANIM_CMD(UNOWN_C), + ANIM_CMD(UNOWN_D), + ANIM_CMD(UNOWN_E), + ANIM_CMD(UNOWN_F), + ANIM_CMD(UNOWN_G), + ANIM_CMD(UNOWN_H), + ANIM_CMD(UNOWN_I), + ANIM_CMD(UNOWN_J), + ANIM_CMD(UNOWN_K), + ANIM_CMD(UNOWN_L), + ANIM_CMD(UNOWN_M), + ANIM_CMD(UNOWN_N), + ANIM_CMD(UNOWN_O), + ANIM_CMD(UNOWN_P), + ANIM_CMD(UNOWN_Q), + ANIM_CMD(UNOWN_R), + ANIM_CMD(UNOWN_S), + ANIM_CMD(UNOWN_T), + ANIM_CMD(UNOWN_U), + ANIM_CMD(UNOWN_V), + ANIM_CMD(UNOWN_W), + ANIM_CMD(UNOWN_X), + ANIM_CMD(UNOWN_Y), + ANIM_CMD(UNOWN_Z), + ANIM_CMD(UNOWN_EMARK), + ANIM_CMD(UNOWN_QMARK), }; diff --git a/src/data/pokemon_graphics/still_front_pic_table.h b/src/data/pokemon_graphics/still_front_pic_table.h index a345a3d43..308a872b4 100644 --- a/src/data/pokemon_graphics/still_front_pic_table.h +++ b/src/data/pokemon_graphics/still_front_pic_table.h @@ -1,446 +1,448 @@ +#define STILL_FRONT_PIC(species, frontpic) [SPECIES_##species] = {frontpic, 0x800, SPECIES_##species} + const struct CompressedSpriteSheet gMonStillFrontPicTable[] = -{ //.data .size .tag - gMonStillFrontPic_CircledQuestionMark, 0x800, 0, - gMonStillFrontPic_Bulbasaur, 0x800, 1, - gMonStillFrontPic_Ivysaur, 0x800, 2, - gMonStillFrontPic_Venusaur, 0x800, 3, - gMonStillFrontPic_Charmander, 0x800, 4, - gMonStillFrontPic_Charmeleon, 0x800, 5, - gMonStillFrontPic_Charizard, 0x800, 6, - gMonStillFrontPic_Squirtle, 0x800, 7, - gMonStillFrontPic_Wartortle, 0x800, 8, - gMonStillFrontPic_Blastoise, 0x800, 9, - gMonStillFrontPic_Caterpie, 0x800, 10, - gMonStillFrontPic_Metapod, 0x800, 11, - gMonStillFrontPic_Butterfree, 0x800, 12, - gMonStillFrontPic_Weedle, 0x800, 13, - gMonStillFrontPic_Kakuna, 0x800, 14, - gMonStillFrontPic_Beedrill, 0x800, 15, - gMonStillFrontPic_Pidgey, 0x800, 16, - gMonStillFrontPic_Pidgeotto, 0x800, 17, - gMonStillFrontPic_Pidgeot, 0x800, 18, - gMonStillFrontPic_Rattata, 0x800, 19, - gMonStillFrontPic_Raticate, 0x800, 20, - gMonStillFrontPic_Spearow, 0x800, 21, - gMonStillFrontPic_Fearow, 0x800, 22, - gMonStillFrontPic_Ekans, 0x800, 23, - gMonStillFrontPic_Arbok, 0x800, 24, - gMonStillFrontPic_Pikachu, 0x800, 25, - gMonStillFrontPic_Raichu, 0x800, 26, - gMonStillFrontPic_Sandshrew, 0x800, 27, - gMonStillFrontPic_Sandslash, 0x800, 28, - gMonStillFrontPic_NidoranF, 0x800, 29, - gMonStillFrontPic_Nidorina, 0x800, 30, - gMonStillFrontPic_Nidoqueen, 0x800, 31, - gMonStillFrontPic_NidoranM, 0x800, 32, - gMonStillFrontPic_Nidorino, 0x800, 33, - gMonStillFrontPic_Nidoking, 0x800, 34, - gMonStillFrontPic_Clefairy, 0x800, 35, - gMonStillFrontPic_Clefable, 0x800, 36, - gMonStillFrontPic_Vulpix, 0x800, 37, - gMonStillFrontPic_Ninetales, 0x800, 38, - gMonStillFrontPic_Jigglypuff, 0x800, 39, - gMonStillFrontPic_Wigglytuff, 0x800, 40, - gMonStillFrontPic_Zubat, 0x800, 41, - gMonStillFrontPic_Golbat, 0x800, 42, - gMonStillFrontPic_Oddish, 0x800, 43, - gMonStillFrontPic_Gloom, 0x800, 44, - gMonStillFrontPic_Vileplume, 0x800, 45, - gMonStillFrontPic_Paras, 0x800, 46, - gMonStillFrontPic_Parasect, 0x800, 47, - gMonStillFrontPic_Venonat, 0x800, 48, - gMonStillFrontPic_Venomoth, 0x800, 49, - gMonStillFrontPic_Diglett, 0x800, 50, - gMonStillFrontPic_Dugtrio, 0x800, 51, - gMonStillFrontPic_Meowth, 0x800, 52, - gMonStillFrontPic_Persian, 0x800, 53, - gMonStillFrontPic_Psyduck, 0x800, 54, - gMonStillFrontPic_Golduck, 0x800, 55, - gMonStillFrontPic_Mankey, 0x800, 56, - gMonStillFrontPic_Primeape, 0x800, 57, - gMonStillFrontPic_Growlithe, 0x800, 58, - gMonStillFrontPic_Arcanine, 0x800, 59, - gMonStillFrontPic_Poliwag, 0x800, 60, - gMonStillFrontPic_Poliwhirl, 0x800, 61, - gMonStillFrontPic_Poliwrath, 0x800, 62, - gMonStillFrontPic_Abra, 0x800, 63, - gMonStillFrontPic_Kadabra, 0x800, 64, - gMonStillFrontPic_Alakazam, 0x800, 65, - gMonStillFrontPic_Machop, 0x800, 66, - gMonStillFrontPic_Machoke, 0x800, 67, - gMonStillFrontPic_Machamp, 0x800, 68, - gMonStillFrontPic_Bellsprout, 0x800, 69, - gMonStillFrontPic_Weepinbell, 0x800, 70, - gMonStillFrontPic_Victreebel, 0x800, 71, - gMonStillFrontPic_Tentacool, 0x800, 72, - gMonStillFrontPic_Tentacruel, 0x800, 73, - gMonStillFrontPic_Geodude, 0x800, 74, - gMonStillFrontPic_Graveler, 0x800, 75, - gMonStillFrontPic_Golem, 0x800, 76, - gMonStillFrontPic_Ponyta, 0x800, 77, - gMonStillFrontPic_Rapidash, 0x800, 78, - gMonStillFrontPic_Slowpoke, 0x800, 79, - gMonStillFrontPic_Slowbro, 0x800, 80, - gMonStillFrontPic_Magnemite, 0x800, 81, - gMonStillFrontPic_Magneton, 0x800, 82, - gMonStillFrontPic_Farfetchd, 0x800, 83, - gMonStillFrontPic_Doduo, 0x800, 84, - gMonStillFrontPic_Dodrio, 0x800, 85, - gMonStillFrontPic_Seel, 0x800, 86, - gMonStillFrontPic_Dewgong, 0x800, 87, - gMonStillFrontPic_Grimer, 0x800, 88, - gMonStillFrontPic_Muk, 0x800, 89, - gMonStillFrontPic_Shellder, 0x800, 90, - gMonStillFrontPic_Cloyster, 0x800, 91, - gMonStillFrontPic_Gastly, 0x800, 92, - gMonStillFrontPic_Haunter, 0x800, 93, - gMonStillFrontPic_Gengar, 0x800, 94, - gMonStillFrontPic_Onix, 0x800, 95, - gMonStillFrontPic_Drowzee, 0x800, 96, - gMonStillFrontPic_Hypno, 0x800, 97, - gMonStillFrontPic_Krabby, 0x800, 98, - gMonStillFrontPic_Kingler, 0x800, 99, - gMonStillFrontPic_Voltorb, 0x800, 100, - gMonStillFrontPic_Electrode, 0x800, 101, - gMonStillFrontPic_Exeggcute, 0x800, 102, - gMonStillFrontPic_Exeggutor, 0x800, 103, - gMonStillFrontPic_Cubone, 0x800, 104, - gMonStillFrontPic_Marowak, 0x800, 105, - gMonStillFrontPic_Hitmonlee, 0x800, 106, - gMonStillFrontPic_Hitmonchan, 0x800, 107, - gMonStillFrontPic_Lickitung, 0x800, 108, - gMonStillFrontPic_Koffing, 0x800, 109, - gMonStillFrontPic_Weezing, 0x800, 110, - gMonStillFrontPic_Rhyhorn, 0x800, 111, - gMonStillFrontPic_Rhydon, 0x800, 112, - gMonStillFrontPic_Chansey, 0x800, 113, - gMonStillFrontPic_Tangela, 0x800, 114, - gMonStillFrontPic_Kangaskhan, 0x800, 115, - gMonStillFrontPic_Horsea, 0x800, 116, - gMonStillFrontPic_Seadra, 0x800, 117, - gMonStillFrontPic_Goldeen, 0x800, 118, - gMonStillFrontPic_Seaking, 0x800, 119, - gMonStillFrontPic_Staryu, 0x800, 120, - gMonStillFrontPic_Starmie, 0x800, 121, - gMonStillFrontPic_Mrmime, 0x800, 122, - gMonStillFrontPic_Scyther, 0x800, 123, - gMonStillFrontPic_Jynx, 0x800, 124, - gMonStillFrontPic_Electabuzz, 0x800, 125, - gMonStillFrontPic_Magmar, 0x800, 126, - gMonStillFrontPic_Pinsir, 0x800, 127, - gMonStillFrontPic_Tauros, 0x800, 128, - gMonStillFrontPic_Magikarp, 0x800, 129, - gMonStillFrontPic_Gyarados, 0x800, 130, - gMonStillFrontPic_Lapras, 0x800, 131, - gMonStillFrontPic_Ditto, 0x800, 132, - gMonStillFrontPic_Eevee, 0x800, 133, - gMonStillFrontPic_Vaporeon, 0x800, 134, - gMonStillFrontPic_Jolteon, 0x800, 135, - gMonStillFrontPic_Flareon, 0x800, 136, - gMonStillFrontPic_Porygon, 0x800, 137, - gMonStillFrontPic_Omanyte, 0x800, 138, - gMonStillFrontPic_Omastar, 0x800, 139, - gMonStillFrontPic_Kabuto, 0x800, 140, - gMonStillFrontPic_Kabutops, 0x800, 141, - gMonStillFrontPic_Aerodactyl, 0x800, 142, - gMonStillFrontPic_Snorlax, 0x800, 143, - gMonStillFrontPic_Articuno, 0x800, 144, - gMonStillFrontPic_Zapdos, 0x800, 145, - gMonStillFrontPic_Moltres, 0x800, 146, - gMonStillFrontPic_Dratini, 0x800, 147, - gMonStillFrontPic_Dragonair, 0x800, 148, - gMonStillFrontPic_Dragonite, 0x800, 149, - gMonStillFrontPic_Mewtwo, 0x800, 150, - gMonStillFrontPic_Mew, 0x800, 151, +{ + STILL_FRONT_PIC(NONE, gMonStillFrontPic_CircledQuestionMark), + STILL_FRONT_PIC(BULBASAUR, gMonStillFrontPic_Bulbasaur), + STILL_FRONT_PIC(IVYSAUR, gMonStillFrontPic_Ivysaur), + STILL_FRONT_PIC(VENUSAUR, gMonStillFrontPic_Venusaur), + STILL_FRONT_PIC(CHARMANDER, gMonStillFrontPic_Charmander), + STILL_FRONT_PIC(CHARMELEON, gMonStillFrontPic_Charmeleon), + STILL_FRONT_PIC(CHARIZARD, gMonStillFrontPic_Charizard), + STILL_FRONT_PIC(SQUIRTLE, gMonStillFrontPic_Squirtle), + STILL_FRONT_PIC(WARTORTLE, gMonStillFrontPic_Wartortle), + STILL_FRONT_PIC(BLASTOISE, gMonStillFrontPic_Blastoise), + STILL_FRONT_PIC(CATERPIE, gMonStillFrontPic_Caterpie), + STILL_FRONT_PIC(METAPOD, gMonStillFrontPic_Metapod), + STILL_FRONT_PIC(BUTTERFREE, gMonStillFrontPic_Butterfree), + STILL_FRONT_PIC(WEEDLE, gMonStillFrontPic_Weedle), + STILL_FRONT_PIC(KAKUNA, gMonStillFrontPic_Kakuna), + STILL_FRONT_PIC(BEEDRILL, gMonStillFrontPic_Beedrill), + STILL_FRONT_PIC(PIDGEY, gMonStillFrontPic_Pidgey), + STILL_FRONT_PIC(PIDGEOTTO, gMonStillFrontPic_Pidgeotto), + STILL_FRONT_PIC(PIDGEOT, gMonStillFrontPic_Pidgeot), + STILL_FRONT_PIC(RATTATA, gMonStillFrontPic_Rattata), + STILL_FRONT_PIC(RATICATE, gMonStillFrontPic_Raticate), + STILL_FRONT_PIC(SPEAROW, gMonStillFrontPic_Spearow), + STILL_FRONT_PIC(FEAROW, gMonStillFrontPic_Fearow), + STILL_FRONT_PIC(EKANS, gMonStillFrontPic_Ekans), + STILL_FRONT_PIC(ARBOK, gMonStillFrontPic_Arbok), + STILL_FRONT_PIC(PIKACHU, gMonStillFrontPic_Pikachu), + STILL_FRONT_PIC(RAICHU, gMonStillFrontPic_Raichu), + STILL_FRONT_PIC(SANDSHREW, gMonStillFrontPic_Sandshrew), + STILL_FRONT_PIC(SANDSLASH, gMonStillFrontPic_Sandslash), + STILL_FRONT_PIC(NIDORAN_F, gMonStillFrontPic_NidoranF), + STILL_FRONT_PIC(NIDORINA, gMonStillFrontPic_Nidorina), + STILL_FRONT_PIC(NIDOQUEEN, gMonStillFrontPic_Nidoqueen), + STILL_FRONT_PIC(NIDORAN_M, gMonStillFrontPic_NidoranM), + STILL_FRONT_PIC(NIDORINO, gMonStillFrontPic_Nidorino), + STILL_FRONT_PIC(NIDOKING, gMonStillFrontPic_Nidoking), + STILL_FRONT_PIC(CLEFAIRY, gMonStillFrontPic_Clefairy), + STILL_FRONT_PIC(CLEFABLE, gMonStillFrontPic_Clefable), + STILL_FRONT_PIC(VULPIX, gMonStillFrontPic_Vulpix), + STILL_FRONT_PIC(NINETALES, gMonStillFrontPic_Ninetales), + STILL_FRONT_PIC(JIGGLYPUFF, gMonStillFrontPic_Jigglypuff), + STILL_FRONT_PIC(WIGGLYTUFF, gMonStillFrontPic_Wigglytuff), + STILL_FRONT_PIC(ZUBAT, gMonStillFrontPic_Zubat), + STILL_FRONT_PIC(GOLBAT, gMonStillFrontPic_Golbat), + STILL_FRONT_PIC(ODDISH, gMonStillFrontPic_Oddish), + STILL_FRONT_PIC(GLOOM, gMonStillFrontPic_Gloom), + STILL_FRONT_PIC(VILEPLUME, gMonStillFrontPic_Vileplume), + STILL_FRONT_PIC(PARAS, gMonStillFrontPic_Paras), + STILL_FRONT_PIC(PARASECT, gMonStillFrontPic_Parasect), + STILL_FRONT_PIC(VENONAT, gMonStillFrontPic_Venonat), + STILL_FRONT_PIC(VENOMOTH, gMonStillFrontPic_Venomoth), + STILL_FRONT_PIC(DIGLETT, gMonStillFrontPic_Diglett), + STILL_FRONT_PIC(DUGTRIO, gMonStillFrontPic_Dugtrio), + STILL_FRONT_PIC(MEOWTH, gMonStillFrontPic_Meowth), + STILL_FRONT_PIC(PERSIAN, gMonStillFrontPic_Persian), + STILL_FRONT_PIC(PSYDUCK, gMonStillFrontPic_Psyduck), + STILL_FRONT_PIC(GOLDUCK, gMonStillFrontPic_Golduck), + STILL_FRONT_PIC(MANKEY, gMonStillFrontPic_Mankey), + STILL_FRONT_PIC(PRIMEAPE, gMonStillFrontPic_Primeape), + STILL_FRONT_PIC(GROWLITHE, gMonStillFrontPic_Growlithe), + STILL_FRONT_PIC(ARCANINE, gMonStillFrontPic_Arcanine), + STILL_FRONT_PIC(POLIWAG, gMonStillFrontPic_Poliwag), + STILL_FRONT_PIC(POLIWHIRL, gMonStillFrontPic_Poliwhirl), + STILL_FRONT_PIC(POLIWRATH, gMonStillFrontPic_Poliwrath), + STILL_FRONT_PIC(ABRA, gMonStillFrontPic_Abra), + STILL_FRONT_PIC(KADABRA, gMonStillFrontPic_Kadabra), + STILL_FRONT_PIC(ALAKAZAM, gMonStillFrontPic_Alakazam), + STILL_FRONT_PIC(MACHOP, gMonStillFrontPic_Machop), + STILL_FRONT_PIC(MACHOKE, gMonStillFrontPic_Machoke), + STILL_FRONT_PIC(MACHAMP, gMonStillFrontPic_Machamp), + STILL_FRONT_PIC(BELLSPROUT, gMonStillFrontPic_Bellsprout), + STILL_FRONT_PIC(WEEPINBELL, gMonStillFrontPic_Weepinbell), + STILL_FRONT_PIC(VICTREEBEL, gMonStillFrontPic_Victreebel), + STILL_FRONT_PIC(TENTACOOL, gMonStillFrontPic_Tentacool), + STILL_FRONT_PIC(TENTACRUEL, gMonStillFrontPic_Tentacruel), + STILL_FRONT_PIC(GEODUDE, gMonStillFrontPic_Geodude), + STILL_FRONT_PIC(GRAVELER, gMonStillFrontPic_Graveler), + STILL_FRONT_PIC(GOLEM, gMonStillFrontPic_Golem), + STILL_FRONT_PIC(PONYTA, gMonStillFrontPic_Ponyta), + STILL_FRONT_PIC(RAPIDASH, gMonStillFrontPic_Rapidash), + STILL_FRONT_PIC(SLOWPOKE, gMonStillFrontPic_Slowpoke), + STILL_FRONT_PIC(SLOWBRO, gMonStillFrontPic_Slowbro), + STILL_FRONT_PIC(MAGNEMITE, gMonStillFrontPic_Magnemite), + STILL_FRONT_PIC(MAGNETON, gMonStillFrontPic_Magneton), + STILL_FRONT_PIC(FARFETCHD, gMonStillFrontPic_Farfetchd), + STILL_FRONT_PIC(DODUO, gMonStillFrontPic_Doduo), + STILL_FRONT_PIC(DODRIO, gMonStillFrontPic_Dodrio), + STILL_FRONT_PIC(SEEL, gMonStillFrontPic_Seel), + STILL_FRONT_PIC(DEWGONG, gMonStillFrontPic_Dewgong), + STILL_FRONT_PIC(GRIMER, gMonStillFrontPic_Grimer), + STILL_FRONT_PIC(MUK, gMonStillFrontPic_Muk), + STILL_FRONT_PIC(SHELLDER, gMonStillFrontPic_Shellder), + STILL_FRONT_PIC(CLOYSTER, gMonStillFrontPic_Cloyster), + STILL_FRONT_PIC(GASTLY, gMonStillFrontPic_Gastly), + STILL_FRONT_PIC(HAUNTER, gMonStillFrontPic_Haunter), + STILL_FRONT_PIC(GENGAR, gMonStillFrontPic_Gengar), + STILL_FRONT_PIC(ONIX, gMonStillFrontPic_Onix), + STILL_FRONT_PIC(DROWZEE, gMonStillFrontPic_Drowzee), + STILL_FRONT_PIC(HYPNO, gMonStillFrontPic_Hypno), + STILL_FRONT_PIC(KRABBY, gMonStillFrontPic_Krabby), + STILL_FRONT_PIC(KINGLER, gMonStillFrontPic_Kingler), + STILL_FRONT_PIC(VOLTORB, gMonStillFrontPic_Voltorb), + STILL_FRONT_PIC(ELECTRODE, gMonStillFrontPic_Electrode), + STILL_FRONT_PIC(EXEGGCUTE, gMonStillFrontPic_Exeggcute), + STILL_FRONT_PIC(EXEGGUTOR, gMonStillFrontPic_Exeggutor), + STILL_FRONT_PIC(CUBONE, gMonStillFrontPic_Cubone), + STILL_FRONT_PIC(MAROWAK, gMonStillFrontPic_Marowak), + STILL_FRONT_PIC(HITMONLEE, gMonStillFrontPic_Hitmonlee), + STILL_FRONT_PIC(HITMONCHAN, gMonStillFrontPic_Hitmonchan), + STILL_FRONT_PIC(LICKITUNG, gMonStillFrontPic_Lickitung), + STILL_FRONT_PIC(KOFFING, gMonStillFrontPic_Koffing), + STILL_FRONT_PIC(WEEZING, gMonStillFrontPic_Weezing), + STILL_FRONT_PIC(RHYHORN, gMonStillFrontPic_Rhyhorn), + STILL_FRONT_PIC(RHYDON, gMonStillFrontPic_Rhydon), + STILL_FRONT_PIC(CHANSEY, gMonStillFrontPic_Chansey), + STILL_FRONT_PIC(TANGELA, gMonStillFrontPic_Tangela), + STILL_FRONT_PIC(KANGASKHAN, gMonStillFrontPic_Kangaskhan), + STILL_FRONT_PIC(HORSEA, gMonStillFrontPic_Horsea), + STILL_FRONT_PIC(SEADRA, gMonStillFrontPic_Seadra), + STILL_FRONT_PIC(GOLDEEN, gMonStillFrontPic_Goldeen), + STILL_FRONT_PIC(SEAKING, gMonStillFrontPic_Seaking), + STILL_FRONT_PIC(STARYU, gMonStillFrontPic_Staryu), + STILL_FRONT_PIC(STARMIE, gMonStillFrontPic_Starmie), + STILL_FRONT_PIC(MR_MIME, gMonStillFrontPic_Mrmime), + STILL_FRONT_PIC(SCYTHER, gMonStillFrontPic_Scyther), + STILL_FRONT_PIC(JYNX, gMonStillFrontPic_Jynx), + STILL_FRONT_PIC(ELECTABUZZ, gMonStillFrontPic_Electabuzz), + STILL_FRONT_PIC(MAGMAR, gMonStillFrontPic_Magmar), + STILL_FRONT_PIC(PINSIR, gMonStillFrontPic_Pinsir), + STILL_FRONT_PIC(TAUROS, gMonStillFrontPic_Tauros), + STILL_FRONT_PIC(MAGIKARP, gMonStillFrontPic_Magikarp), + STILL_FRONT_PIC(GYARADOS, gMonStillFrontPic_Gyarados), + STILL_FRONT_PIC(LAPRAS, gMonStillFrontPic_Lapras), + STILL_FRONT_PIC(DITTO, gMonStillFrontPic_Ditto), + STILL_FRONT_PIC(EEVEE, gMonStillFrontPic_Eevee), + STILL_FRONT_PIC(VAPOREON, gMonStillFrontPic_Vaporeon), + STILL_FRONT_PIC(JOLTEON, gMonStillFrontPic_Jolteon), + STILL_FRONT_PIC(FLAREON, gMonStillFrontPic_Flareon), + STILL_FRONT_PIC(PORYGON, gMonStillFrontPic_Porygon), + STILL_FRONT_PIC(OMANYTE, gMonStillFrontPic_Omanyte), + STILL_FRONT_PIC(OMASTAR, gMonStillFrontPic_Omastar), + STILL_FRONT_PIC(KABUTO, gMonStillFrontPic_Kabuto), + STILL_FRONT_PIC(KABUTOPS, gMonStillFrontPic_Kabutops), + STILL_FRONT_PIC(AERODACTYL, gMonStillFrontPic_Aerodactyl), + STILL_FRONT_PIC(SNORLAX, gMonStillFrontPic_Snorlax), + STILL_FRONT_PIC(ARTICUNO, gMonStillFrontPic_Articuno), + STILL_FRONT_PIC(ZAPDOS, gMonStillFrontPic_Zapdos), + STILL_FRONT_PIC(MOLTRES, gMonStillFrontPic_Moltres), + STILL_FRONT_PIC(DRATINI, gMonStillFrontPic_Dratini), + STILL_FRONT_PIC(DRAGONAIR, gMonStillFrontPic_Dragonair), + STILL_FRONT_PIC(DRAGONITE, gMonStillFrontPic_Dragonite), + STILL_FRONT_PIC(MEWTWO, gMonStillFrontPic_Mewtwo), + STILL_FRONT_PIC(MEW, gMonStillFrontPic_Mew), // Gen II - gMonStillFrontPic_Chikorita, 0x800, 152, - gMonStillFrontPic_Bayleef, 0x800, 153, - gMonStillFrontPic_Meganium, 0x800, 154, - gMonStillFrontPic_Cyndaquil, 0x800, 155, - gMonStillFrontPic_Quilava, 0x800, 156, - gMonStillFrontPic_Typhlosion, 0x800, 157, - gMonStillFrontPic_Totodile, 0x800, 158, - gMonStillFrontPic_Croconaw, 0x800, 159, - gMonStillFrontPic_Feraligatr, 0x800, 160, - gMonStillFrontPic_Sentret, 0x800, 161, - gMonStillFrontPic_Furret, 0x800, 162, - gMonStillFrontPic_Hoothoot, 0x800, 163, - gMonStillFrontPic_Noctowl, 0x800, 164, - gMonStillFrontPic_Ledyba, 0x800, 165, - gMonStillFrontPic_Ledian, 0x800, 166, - gMonStillFrontPic_Spinarak, 0x800, 167, - gMonStillFrontPic_Ariados, 0x800, 168, - gMonStillFrontPic_Crobat, 0x800, 169, - gMonStillFrontPic_Chinchou, 0x800, 170, - gMonStillFrontPic_Lanturn, 0x800, 171, - gMonStillFrontPic_Pichu, 0x800, 172, - gMonStillFrontPic_Cleffa, 0x800, 173, - gMonStillFrontPic_Igglybuff, 0x800, 174, - gMonStillFrontPic_Togepi, 0x800, 175, - gMonStillFrontPic_Togetic, 0x800, 176, - gMonStillFrontPic_Natu, 0x800, 177, - gMonStillFrontPic_Xatu, 0x800, 178, - gMonStillFrontPic_Mareep, 0x800, 179, - gMonStillFrontPic_Flaaffy, 0x800, 180, - gMonStillFrontPic_Ampharos, 0x800, 181, - gMonStillFrontPic_Bellossom, 0x800, 182, - gMonStillFrontPic_Marill, 0x800, 183, - gMonStillFrontPic_Azumarill, 0x800, 184, - gMonStillFrontPic_Sudowoodo, 0x800, 185, - gMonStillFrontPic_Politoed, 0x800, 186, - gMonStillFrontPic_Hoppip, 0x800, 187, - gMonStillFrontPic_Skiploom, 0x800, 188, - gMonStillFrontPic_Jumpluff, 0x800, 189, - gMonStillFrontPic_Aipom, 0x800, 190, - gMonStillFrontPic_Sunkern, 0x800, 191, - gMonStillFrontPic_Sunflora, 0x800, 192, - gMonStillFrontPic_Yanma, 0x800, 193, - gMonStillFrontPic_Wooper, 0x800, 194, - gMonStillFrontPic_Quagsire, 0x800, 195, - gMonStillFrontPic_Espeon, 0x800, 196, - gMonStillFrontPic_Umbreon, 0x800, 197, - gMonStillFrontPic_Murkrow, 0x800, 198, - gMonStillFrontPic_Slowking, 0x800, 199, - gMonStillFrontPic_Misdreavus, 0x800, 200, - gMonStillFrontPic_UnownA, 0x800, 201, - gMonStillFrontPic_Wobbuffet, 0x800, 202, - gMonStillFrontPic_Girafarig, 0x800, 203, - gMonStillFrontPic_Pineco, 0x800, 204, - gMonStillFrontPic_Forretress, 0x800, 205, - gMonStillFrontPic_Dunsparce, 0x800, 206, - gMonStillFrontPic_Gligar, 0x800, 207, - gMonStillFrontPic_Steelix, 0x800, 208, - gMonStillFrontPic_Snubbull, 0x800, 209, - gMonStillFrontPic_Granbull, 0x800, 210, - gMonStillFrontPic_Qwilfish, 0x800, 211, - gMonStillFrontPic_Scizor, 0x800, 212, - gMonStillFrontPic_Shuckle, 0x800, 213, - gMonStillFrontPic_Heracross, 0x800, 214, - gMonStillFrontPic_Sneasel, 0x800, 215, - gMonStillFrontPic_Teddiursa, 0x800, 216, - gMonStillFrontPic_Ursaring, 0x800, 217, - gMonStillFrontPic_Slugma, 0x800, 218, - gMonStillFrontPic_Magcargo, 0x800, 219, - gMonStillFrontPic_Swinub, 0x800, 220, - gMonStillFrontPic_Piloswine, 0x800, 221, - gMonStillFrontPic_Corsola, 0x800, 222, - gMonStillFrontPic_Remoraid, 0x800, 223, - gMonStillFrontPic_Octillery, 0x800, 224, - gMonStillFrontPic_Delibird, 0x800, 225, - gMonStillFrontPic_Mantine, 0x800, 226, - gMonStillFrontPic_Skarmory, 0x800, 227, - gMonStillFrontPic_Houndour, 0x800, 228, - gMonStillFrontPic_Houndoom, 0x800, 229, - gMonStillFrontPic_Kingdra, 0x800, 230, - gMonStillFrontPic_Phanpy, 0x800, 231, - gMonStillFrontPic_Donphan, 0x800, 232, - gMonStillFrontPic_Porygon2, 0x800, 233, - gMonStillFrontPic_Stantler, 0x800, 234, - gMonStillFrontPic_Smeargle, 0x800, 235, - gMonStillFrontPic_Tyrogue, 0x800, 236, - gMonStillFrontPic_Hitmontop, 0x800, 237, - gMonStillFrontPic_Smoochum, 0x800, 238, - gMonStillFrontPic_Elekid, 0x800, 239, - gMonStillFrontPic_Magby, 0x800, 240, - gMonStillFrontPic_Miltank, 0x800, 241, - gMonStillFrontPic_Blissey, 0x800, 242, - gMonStillFrontPic_Raikou, 0x800, 243, - gMonStillFrontPic_Entei, 0x800, 244, - gMonStillFrontPic_Suicune, 0x800, 245, - gMonStillFrontPic_Larvitar, 0x800, 246, - gMonStillFrontPic_Pupitar, 0x800, 247, - gMonStillFrontPic_Tyranitar, 0x800, 248, - gMonStillFrontPic_Lugia, 0x800, 249, - gMonStillFrontPic_HoOh, 0x800, 250, - gMonStillFrontPic_Celebi, 0x800, 251, + STILL_FRONT_PIC(CHIKORITA, gMonStillFrontPic_Chikorita), + STILL_FRONT_PIC(BAYLEEF, gMonStillFrontPic_Bayleef), + STILL_FRONT_PIC(MEGANIUM, gMonStillFrontPic_Meganium), + STILL_FRONT_PIC(CYNDAQUIL, gMonStillFrontPic_Cyndaquil), + STILL_FRONT_PIC(QUILAVA, gMonStillFrontPic_Quilava), + STILL_FRONT_PIC(TYPHLOSION, gMonStillFrontPic_Typhlosion), + STILL_FRONT_PIC(TOTODILE, gMonStillFrontPic_Totodile), + STILL_FRONT_PIC(CROCONAW, gMonStillFrontPic_Croconaw), + STILL_FRONT_PIC(FERALIGATR, gMonStillFrontPic_Feraligatr), + STILL_FRONT_PIC(SENTRET, gMonStillFrontPic_Sentret), + STILL_FRONT_PIC(FURRET, gMonStillFrontPic_Furret), + STILL_FRONT_PIC(HOOTHOOT, gMonStillFrontPic_Hoothoot), + STILL_FRONT_PIC(NOCTOWL, gMonStillFrontPic_Noctowl), + STILL_FRONT_PIC(LEDYBA, gMonStillFrontPic_Ledyba), + STILL_FRONT_PIC(LEDIAN, gMonStillFrontPic_Ledian), + STILL_FRONT_PIC(SPINARAK, gMonStillFrontPic_Spinarak), + STILL_FRONT_PIC(ARIADOS, gMonStillFrontPic_Ariados), + STILL_FRONT_PIC(CROBAT, gMonStillFrontPic_Crobat), + STILL_FRONT_PIC(CHINCHOU, gMonStillFrontPic_Chinchou), + STILL_FRONT_PIC(LANTURN, gMonStillFrontPic_Lanturn), + STILL_FRONT_PIC(PICHU, gMonStillFrontPic_Pichu), + STILL_FRONT_PIC(CLEFFA, gMonStillFrontPic_Cleffa), + STILL_FRONT_PIC(IGGLYBUFF, gMonStillFrontPic_Igglybuff), + STILL_FRONT_PIC(TOGEPI, gMonStillFrontPic_Togepi), + STILL_FRONT_PIC(TOGETIC, gMonStillFrontPic_Togetic), + STILL_FRONT_PIC(NATU, gMonStillFrontPic_Natu), + STILL_FRONT_PIC(XATU, gMonStillFrontPic_Xatu), + STILL_FRONT_PIC(MAREEP, gMonStillFrontPic_Mareep), + STILL_FRONT_PIC(FLAAFFY, gMonStillFrontPic_Flaaffy), + STILL_FRONT_PIC(AMPHAROS, gMonStillFrontPic_Ampharos), + STILL_FRONT_PIC(BELLOSSOM, gMonStillFrontPic_Bellossom), + STILL_FRONT_PIC(MARILL, gMonStillFrontPic_Marill), + STILL_FRONT_PIC(AZUMARILL, gMonStillFrontPic_Azumarill), + STILL_FRONT_PIC(SUDOWOODO, gMonStillFrontPic_Sudowoodo), + STILL_FRONT_PIC(POLITOED, gMonStillFrontPic_Politoed), + STILL_FRONT_PIC(HOPPIP, gMonStillFrontPic_Hoppip), + STILL_FRONT_PIC(SKIPLOOM, gMonStillFrontPic_Skiploom), + STILL_FRONT_PIC(JUMPLUFF, gMonStillFrontPic_Jumpluff), + STILL_FRONT_PIC(AIPOM, gMonStillFrontPic_Aipom), + STILL_FRONT_PIC(SUNKERN, gMonStillFrontPic_Sunkern), + STILL_FRONT_PIC(SUNFLORA, gMonStillFrontPic_Sunflora), + STILL_FRONT_PIC(YANMA, gMonStillFrontPic_Yanma), + STILL_FRONT_PIC(WOOPER, gMonStillFrontPic_Wooper), + STILL_FRONT_PIC(QUAGSIRE, gMonStillFrontPic_Quagsire), + STILL_FRONT_PIC(ESPEON, gMonStillFrontPic_Espeon), + STILL_FRONT_PIC(UMBREON, gMonStillFrontPic_Umbreon), + STILL_FRONT_PIC(MURKROW, gMonStillFrontPic_Murkrow), + STILL_FRONT_PIC(SLOWKING, gMonStillFrontPic_Slowking), + STILL_FRONT_PIC(MISDREAVUS, gMonStillFrontPic_Misdreavus), + STILL_FRONT_PIC(UNOWN, gMonStillFrontPic_UnownA), + STILL_FRONT_PIC(WOBBUFFET, gMonStillFrontPic_Wobbuffet), + STILL_FRONT_PIC(GIRAFARIG, gMonStillFrontPic_Girafarig), + STILL_FRONT_PIC(PINECO, gMonStillFrontPic_Pineco), + STILL_FRONT_PIC(FORRETRESS, gMonStillFrontPic_Forretress), + STILL_FRONT_PIC(DUNSPARCE, gMonStillFrontPic_Dunsparce), + STILL_FRONT_PIC(GLIGAR, gMonStillFrontPic_Gligar), + STILL_FRONT_PIC(STEELIX, gMonStillFrontPic_Steelix), + STILL_FRONT_PIC(SNUBBULL, gMonStillFrontPic_Snubbull), + STILL_FRONT_PIC(GRANBULL, gMonStillFrontPic_Granbull), + STILL_FRONT_PIC(QWILFISH, gMonStillFrontPic_Qwilfish), + STILL_FRONT_PIC(SCIZOR, gMonStillFrontPic_Scizor), + STILL_FRONT_PIC(SHUCKLE, gMonStillFrontPic_Shuckle), + STILL_FRONT_PIC(HERACROSS, gMonStillFrontPic_Heracross), + STILL_FRONT_PIC(SNEASEL, gMonStillFrontPic_Sneasel), + STILL_FRONT_PIC(TEDDIURSA, gMonStillFrontPic_Teddiursa), + STILL_FRONT_PIC(URSARING, gMonStillFrontPic_Ursaring), + STILL_FRONT_PIC(SLUGMA, gMonStillFrontPic_Slugma), + STILL_FRONT_PIC(MAGCARGO, gMonStillFrontPic_Magcargo), + STILL_FRONT_PIC(SWINUB, gMonStillFrontPic_Swinub), + STILL_FRONT_PIC(PILOSWINE, gMonStillFrontPic_Piloswine), + STILL_FRONT_PIC(CORSOLA, gMonStillFrontPic_Corsola), + STILL_FRONT_PIC(REMORAID, gMonStillFrontPic_Remoraid), + STILL_FRONT_PIC(OCTILLERY, gMonStillFrontPic_Octillery), + STILL_FRONT_PIC(DELIBIRD, gMonStillFrontPic_Delibird), + STILL_FRONT_PIC(MANTINE, gMonStillFrontPic_Mantine), + STILL_FRONT_PIC(SKARMORY, gMonStillFrontPic_Skarmory), + STILL_FRONT_PIC(HOUNDOUR, gMonStillFrontPic_Houndour), + STILL_FRONT_PIC(HOUNDOOM, gMonStillFrontPic_Houndoom), + STILL_FRONT_PIC(KINGDRA, gMonStillFrontPic_Kingdra), + STILL_FRONT_PIC(PHANPY, gMonStillFrontPic_Phanpy), + STILL_FRONT_PIC(DONPHAN, gMonStillFrontPic_Donphan), + STILL_FRONT_PIC(PORYGON2, gMonStillFrontPic_Porygon2), + STILL_FRONT_PIC(STANTLER, gMonStillFrontPic_Stantler), + STILL_FRONT_PIC(SMEARGLE, gMonStillFrontPic_Smeargle), + STILL_FRONT_PIC(TYROGUE, gMonStillFrontPic_Tyrogue), + STILL_FRONT_PIC(HITMONTOP, gMonStillFrontPic_Hitmontop), + STILL_FRONT_PIC(SMOOCHUM, gMonStillFrontPic_Smoochum), + STILL_FRONT_PIC(ELEKID, gMonStillFrontPic_Elekid), + STILL_FRONT_PIC(MAGBY, gMonStillFrontPic_Magby), + STILL_FRONT_PIC(MILTANK, gMonStillFrontPic_Miltank), + STILL_FRONT_PIC(BLISSEY, gMonStillFrontPic_Blissey), + STILL_FRONT_PIC(RAIKOU, gMonStillFrontPic_Raikou), + STILL_FRONT_PIC(ENTEI, gMonStillFrontPic_Entei), + STILL_FRONT_PIC(SUICUNE, gMonStillFrontPic_Suicune), + STILL_FRONT_PIC(LARVITAR, gMonStillFrontPic_Larvitar), + STILL_FRONT_PIC(PUPITAR, gMonStillFrontPic_Pupitar), + STILL_FRONT_PIC(TYRANITAR, gMonStillFrontPic_Tyranitar), + STILL_FRONT_PIC(LUGIA, gMonStillFrontPic_Lugia), + STILL_FRONT_PIC(HO_OH, gMonStillFrontPic_HoOh), + STILL_FRONT_PIC(CELEBI, gMonStillFrontPic_Celebi), // Empty slots - gMonStillFrontPic_DoubleQuestionMark, 0x800, 252, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 253, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 254, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 255, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 256, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 257, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 258, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 259, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 260, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 261, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 262, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 263, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 264, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 265, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 266, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 267, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 268, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 269, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 270, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 271, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 272, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 273, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 274, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 275, - gMonStillFrontPic_DoubleQuestionMark, 0x800, 276, + STILL_FRONT_PIC(OLD_UNOWN_B, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_C, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_D, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_E, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_F, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_G, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_H, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_I, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_J, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_K, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_L, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_M, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_N, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_O, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_P, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_Q, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_R, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_S, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_T, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_U, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_V, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_W, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_X, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_Y, gMonStillFrontPic_DoubleQuestionMark), + STILL_FRONT_PIC(OLD_UNOWN_Z, gMonStillFrontPic_DoubleQuestionMark), // Gen III - gMonStillFrontPic_Treecko, 0x800, 277, - gMonStillFrontPic_Grovyle, 0x800, 278, - gMonStillFrontPic_Sceptile, 0x800, 279, - gMonStillFrontPic_Torchic, 0x800, 280, - gMonStillFrontPic_Combusken, 0x800, 281, - gMonStillFrontPic_Blaziken, 0x800, 282, - gMonStillFrontPic_Mudkip, 0x800, 283, - gMonStillFrontPic_Marshtomp, 0x800, 284, - gMonStillFrontPic_Swampert, 0x800, 285, - gMonStillFrontPic_Poochyena, 0x800, 286, - gMonStillFrontPic_Mightyena, 0x800, 287, - gMonStillFrontPic_Zigzagoon, 0x800, 288, - gMonStillFrontPic_Linoone, 0x800, 289, - gMonStillFrontPic_Wurmple, 0x800, 290, - gMonStillFrontPic_Silcoon, 0x800, 291, - gMonStillFrontPic_Beautifly, 0x800, 292, - gMonStillFrontPic_Cascoon, 0x800, 293, - gMonStillFrontPic_Dustox, 0x800, 294, - gMonStillFrontPic_Lotad, 0x800, 295, - gMonStillFrontPic_Lombre, 0x800, 296, - gMonStillFrontPic_Ludicolo, 0x800, 297, - gMonStillFrontPic_Seedot, 0x800, 298, - gMonStillFrontPic_Nuzleaf, 0x800, 299, - gMonStillFrontPic_Shiftry, 0x800, 300, - gMonStillFrontPic_Nincada, 0x800, 301, - gMonStillFrontPic_Ninjask, 0x800, 302, - gMonStillFrontPic_Shedinja, 0x800, 303, - gMonStillFrontPic_Taillow, 0x800, 304, - gMonStillFrontPic_Swellow, 0x800, 305, - gMonStillFrontPic_Shroomish, 0x800, 306, - gMonStillFrontPic_Breloom, 0x800, 307, - gMonStillFrontPic_Spinda, 0x800, 308, - gMonStillFrontPic_Wingull, 0x800, 309, - gMonStillFrontPic_Pelipper, 0x800, 310, - gMonStillFrontPic_Surskit, 0x800, 311, - gMonStillFrontPic_Masquerain, 0x800, 312, - gMonStillFrontPic_Wailmer, 0x800, 313, - gMonStillFrontPic_Wailord, 0x800, 314, - gMonStillFrontPic_Skitty, 0x800, 315, - gMonStillFrontPic_Delcatty, 0x800, 316, - gMonStillFrontPic_Kecleon, 0x800, 317, - gMonStillFrontPic_Baltoy, 0x800, 318, - gMonStillFrontPic_Claydol, 0x800, 319, - gMonStillFrontPic_Nosepass, 0x800, 320, - gMonStillFrontPic_Torkoal, 0x800, 321, - gMonStillFrontPic_Sableye, 0x800, 322, - gMonStillFrontPic_Barboach, 0x800, 323, - gMonStillFrontPic_Whiscash, 0x800, 324, - gMonStillFrontPic_Luvdisc, 0x800, 325, - gMonStillFrontPic_Corphish, 0x800, 326, - gMonStillFrontPic_Crawdaunt, 0x800, 327, - gMonStillFrontPic_Feebas, 0x800, 328, - gMonStillFrontPic_Milotic, 0x800, 329, - gMonStillFrontPic_Carvanha, 0x800, 330, - gMonStillFrontPic_Sharpedo, 0x800, 331, - gMonStillFrontPic_Trapinch, 0x800, 332, - gMonStillFrontPic_Vibrava, 0x800, 333, - gMonStillFrontPic_Flygon, 0x800, 334, - gMonStillFrontPic_Makuhita, 0x800, 335, - gMonStillFrontPic_Hariyama, 0x800, 336, - gMonStillFrontPic_Electrike, 0x800, 337, - gMonStillFrontPic_Manectric, 0x800, 338, - gMonStillFrontPic_Numel, 0x800, 339, - gMonStillFrontPic_Camerupt, 0x800, 340, - gMonStillFrontPic_Spheal, 0x800, 341, - gMonStillFrontPic_Sealeo, 0x800, 342, - gMonStillFrontPic_Walrein, 0x800, 343, - gMonStillFrontPic_Cacnea, 0x800, 344, - gMonStillFrontPic_Cacturne, 0x800, 345, - gMonStillFrontPic_Snorunt, 0x800, 346, - gMonStillFrontPic_Glalie, 0x800, 347, - gMonStillFrontPic_Lunatone, 0x800, 348, - gMonStillFrontPic_Solrock, 0x800, 349, - gMonStillFrontPic_Azurill, 0x800, 350, - gMonStillFrontPic_Spoink, 0x800, 351, - gMonStillFrontPic_Grumpig, 0x800, 352, - gMonStillFrontPic_Plusle, 0x800, 353, - gMonStillFrontPic_Minun, 0x800, 354, - gMonStillFrontPic_Mawile, 0x800, 355, - gMonStillFrontPic_Meditite, 0x800, 356, - gMonStillFrontPic_Medicham, 0x800, 357, - gMonStillFrontPic_Swablu, 0x800, 358, - gMonStillFrontPic_Altaria, 0x800, 359, - gMonStillFrontPic_Wynaut, 0x800, 360, - gMonStillFrontPic_Duskull, 0x800, 361, - gMonStillFrontPic_Dusclops, 0x800, 362, - gMonStillFrontPic_Roselia, 0x800, 363, - gMonStillFrontPic_Slakoth, 0x800, 364, - gMonStillFrontPic_Vigoroth, 0x800, 365, - gMonStillFrontPic_Slaking, 0x800, 366, - gMonStillFrontPic_Gulpin, 0x800, 367, - gMonStillFrontPic_Swalot, 0x800, 368, - gMonStillFrontPic_Tropius, 0x800, 369, - gMonStillFrontPic_Whismur, 0x800, 370, - gMonStillFrontPic_Loudred, 0x800, 371, - gMonStillFrontPic_Exploud, 0x800, 372, - gMonStillFrontPic_Clamperl, 0x800, 373, - gMonStillFrontPic_Huntail, 0x800, 374, - gMonStillFrontPic_Gorebyss, 0x800, 375, - gMonStillFrontPic_Absol, 0x800, 376, - gMonStillFrontPic_Shuppet, 0x800, 377, - gMonStillFrontPic_Banette, 0x800, 378, - gMonStillFrontPic_Seviper, 0x800, 379, - gMonStillFrontPic_Zangoose, 0x800, 380, - gMonStillFrontPic_Relicanth, 0x800, 381, - gMonStillFrontPic_Aron, 0x800, 382, - gMonStillFrontPic_Lairon, 0x800, 383, - gMonStillFrontPic_Aggron, 0x800, 384, - gMonStillFrontPic_Castform, 0x800, 385, - gMonStillFrontPic_Volbeat, 0x800, 386, - gMonStillFrontPic_Illumise, 0x800, 387, - gMonStillFrontPic_Lileep, 0x800, 388, - gMonStillFrontPic_Cradily, 0x800, 389, - gMonStillFrontPic_Anorith, 0x800, 390, - gMonStillFrontPic_Armaldo, 0x800, 391, - gMonStillFrontPic_Ralts, 0x800, 392, - gMonStillFrontPic_Kirlia, 0x800, 393, - gMonStillFrontPic_Gardevoir, 0x800, 394, - gMonStillFrontPic_Bagon, 0x800, 395, - gMonStillFrontPic_Shelgon, 0x800, 396, - gMonStillFrontPic_Salamence, 0x800, 397, - gMonStillFrontPic_Beldum, 0x800, 398, - gMonStillFrontPic_Metang, 0x800, 399, - gMonStillFrontPic_Metagross, 0x800, 400, - gMonStillFrontPic_Regirock, 0x800, 401, - gMonStillFrontPic_Regice, 0x800, 402, - gMonStillFrontPic_Registeel, 0x800, 403, - gMonStillFrontPic_Kyogre, 0x800, 404, - gMonStillFrontPic_Groudon, 0x800, 405, - gMonStillFrontPic_Rayquaza, 0x800, 406, - gMonStillFrontPic_Latias, 0x800, 407, - gMonStillFrontPic_Latios, 0x800, 408, - gMonStillFrontPic_Jirachi, 0x800, 409, - gMonStillFrontPic_Deoxys, 0x800, 410, - gMonStillFrontPic_Chimecho, 0x800, 411, - gMonStillFrontPic_Egg, 0x800, 412, - gMonStillFrontPic_UnownB, 0x800, 413, - gMonStillFrontPic_UnownC, 0x800, 414, - gMonStillFrontPic_UnownD, 0x800, 415, - gMonStillFrontPic_UnownE, 0x800, 416, - gMonStillFrontPic_UnownF, 0x800, 417, - gMonStillFrontPic_UnownG, 0x800, 418, - gMonStillFrontPic_UnownH, 0x800, 419, - gMonStillFrontPic_UnownI, 0x800, 420, - gMonStillFrontPic_UnownJ, 0x800, 421, - gMonStillFrontPic_UnownK, 0x800, 422, - gMonStillFrontPic_UnownL, 0x800, 423, - gMonStillFrontPic_UnownM, 0x800, 424, - gMonStillFrontPic_UnownN, 0x800, 425, - gMonStillFrontPic_UnownO, 0x800, 426, - gMonStillFrontPic_UnownP, 0x800, 427, - gMonStillFrontPic_UnownQ, 0x800, 428, - gMonStillFrontPic_UnownR, 0x800, 429, - gMonStillFrontPic_UnownS, 0x800, 430, - gMonStillFrontPic_UnownT, 0x800, 431, - gMonStillFrontPic_UnownU, 0x800, 432, - gMonStillFrontPic_UnownV, 0x800, 433, - gMonStillFrontPic_UnownW, 0x800, 434, - gMonStillFrontPic_UnownX, 0x800, 435, - gMonStillFrontPic_UnownY, 0x800, 436, - gMonStillFrontPic_UnownZ, 0x800, 437, - gMonStillFrontPic_UnownExclamationMark, 0x800, 438, - gMonStillFrontPic_UnownQuestionMark, 0x800, 439, + STILL_FRONT_PIC(TREECKO, gMonStillFrontPic_Treecko), + STILL_FRONT_PIC(GROVYLE, gMonStillFrontPic_Grovyle), + STILL_FRONT_PIC(SCEPTILE, gMonStillFrontPic_Sceptile), + STILL_FRONT_PIC(TORCHIC, gMonStillFrontPic_Torchic), + STILL_FRONT_PIC(COMBUSKEN, gMonStillFrontPic_Combusken), + STILL_FRONT_PIC(BLAZIKEN, gMonStillFrontPic_Blaziken), + STILL_FRONT_PIC(MUDKIP, gMonStillFrontPic_Mudkip), + STILL_FRONT_PIC(MARSHTOMP, gMonStillFrontPic_Marshtomp), + STILL_FRONT_PIC(SWAMPERT, gMonStillFrontPic_Swampert), + STILL_FRONT_PIC(POOCHYENA, gMonStillFrontPic_Poochyena), + STILL_FRONT_PIC(MIGHTYENA, gMonStillFrontPic_Mightyena), + STILL_FRONT_PIC(ZIGZAGOON, gMonStillFrontPic_Zigzagoon), + STILL_FRONT_PIC(LINOONE, gMonStillFrontPic_Linoone), + STILL_FRONT_PIC(WURMPLE, gMonStillFrontPic_Wurmple), + STILL_FRONT_PIC(SILCOON, gMonStillFrontPic_Silcoon), + STILL_FRONT_PIC(BEAUTIFLY, gMonStillFrontPic_Beautifly), + STILL_FRONT_PIC(CASCOON, gMonStillFrontPic_Cascoon), + STILL_FRONT_PIC(DUSTOX, gMonStillFrontPic_Dustox), + STILL_FRONT_PIC(LOTAD, gMonStillFrontPic_Lotad), + STILL_FRONT_PIC(LOMBRE, gMonStillFrontPic_Lombre), + STILL_FRONT_PIC(LUDICOLO, gMonStillFrontPic_Ludicolo), + STILL_FRONT_PIC(SEEDOT, gMonStillFrontPic_Seedot), + STILL_FRONT_PIC(NUZLEAF, gMonStillFrontPic_Nuzleaf), + STILL_FRONT_PIC(SHIFTRY, gMonStillFrontPic_Shiftry), + STILL_FRONT_PIC(NINCADA, gMonStillFrontPic_Nincada), + STILL_FRONT_PIC(NINJASK, gMonStillFrontPic_Ninjask), + STILL_FRONT_PIC(SHEDINJA, gMonStillFrontPic_Shedinja), + STILL_FRONT_PIC(TAILLOW, gMonStillFrontPic_Taillow), + STILL_FRONT_PIC(SWELLOW, gMonStillFrontPic_Swellow), + STILL_FRONT_PIC(SHROOMISH, gMonStillFrontPic_Shroomish), + STILL_FRONT_PIC(BRELOOM, gMonStillFrontPic_Breloom), + STILL_FRONT_PIC(SPINDA, gMonStillFrontPic_Spinda), + STILL_FRONT_PIC(WINGULL, gMonStillFrontPic_Wingull), + STILL_FRONT_PIC(PELIPPER, gMonStillFrontPic_Pelipper), + STILL_FRONT_PIC(SURSKIT, gMonStillFrontPic_Surskit), + STILL_FRONT_PIC(MASQUERAIN, gMonStillFrontPic_Masquerain), + STILL_FRONT_PIC(WAILMER, gMonStillFrontPic_Wailmer), + STILL_FRONT_PIC(WAILORD, gMonStillFrontPic_Wailord), + STILL_FRONT_PIC(SKITTY, gMonStillFrontPic_Skitty), + STILL_FRONT_PIC(DELCATTY, gMonStillFrontPic_Delcatty), + STILL_FRONT_PIC(KECLEON, gMonStillFrontPic_Kecleon), + STILL_FRONT_PIC(BALTOY, gMonStillFrontPic_Baltoy), + STILL_FRONT_PIC(CLAYDOL, gMonStillFrontPic_Claydol), + STILL_FRONT_PIC(NOSEPASS, gMonStillFrontPic_Nosepass), + STILL_FRONT_PIC(TORKOAL, gMonStillFrontPic_Torkoal), + STILL_FRONT_PIC(SABLEYE, gMonStillFrontPic_Sableye), + STILL_FRONT_PIC(BARBOACH, gMonStillFrontPic_Barboach), + STILL_FRONT_PIC(WHISCASH, gMonStillFrontPic_Whiscash), + STILL_FRONT_PIC(LUVDISC, gMonStillFrontPic_Luvdisc), + STILL_FRONT_PIC(CORPHISH, gMonStillFrontPic_Corphish), + STILL_FRONT_PIC(CRAWDAUNT, gMonStillFrontPic_Crawdaunt), + STILL_FRONT_PIC(FEEBAS, gMonStillFrontPic_Feebas), + STILL_FRONT_PIC(MILOTIC, gMonStillFrontPic_Milotic), + STILL_FRONT_PIC(CARVANHA, gMonStillFrontPic_Carvanha), + STILL_FRONT_PIC(SHARPEDO, gMonStillFrontPic_Sharpedo), + STILL_FRONT_PIC(TRAPINCH, gMonStillFrontPic_Trapinch), + STILL_FRONT_PIC(VIBRAVA, gMonStillFrontPic_Vibrava), + STILL_FRONT_PIC(FLYGON, gMonStillFrontPic_Flygon), + STILL_FRONT_PIC(MAKUHITA, gMonStillFrontPic_Makuhita), + STILL_FRONT_PIC(HARIYAMA, gMonStillFrontPic_Hariyama), + STILL_FRONT_PIC(ELECTRIKE, gMonStillFrontPic_Electrike), + STILL_FRONT_PIC(MANECTRIC, gMonStillFrontPic_Manectric), + STILL_FRONT_PIC(NUMEL, gMonStillFrontPic_Numel), + STILL_FRONT_PIC(CAMERUPT, gMonStillFrontPic_Camerupt), + STILL_FRONT_PIC(SPHEAL, gMonStillFrontPic_Spheal), + STILL_FRONT_PIC(SEALEO, gMonStillFrontPic_Sealeo), + STILL_FRONT_PIC(WALREIN, gMonStillFrontPic_Walrein), + STILL_FRONT_PIC(CACNEA, gMonStillFrontPic_Cacnea), + STILL_FRONT_PIC(CACTURNE, gMonStillFrontPic_Cacturne), + STILL_FRONT_PIC(SNORUNT, gMonStillFrontPic_Snorunt), + STILL_FRONT_PIC(GLALIE, gMonStillFrontPic_Glalie), + STILL_FRONT_PIC(LUNATONE, gMonStillFrontPic_Lunatone), + STILL_FRONT_PIC(SOLROCK, gMonStillFrontPic_Solrock), + STILL_FRONT_PIC(AZURILL, gMonStillFrontPic_Azurill), + STILL_FRONT_PIC(SPOINK, gMonStillFrontPic_Spoink), + STILL_FRONT_PIC(GRUMPIG, gMonStillFrontPic_Grumpig), + STILL_FRONT_PIC(PLUSLE, gMonStillFrontPic_Plusle), + STILL_FRONT_PIC(MINUN, gMonStillFrontPic_Minun), + STILL_FRONT_PIC(MAWILE, gMonStillFrontPic_Mawile), + STILL_FRONT_PIC(MEDITITE, gMonStillFrontPic_Meditite), + STILL_FRONT_PIC(MEDICHAM, gMonStillFrontPic_Medicham), + STILL_FRONT_PIC(SWABLU, gMonStillFrontPic_Swablu), + STILL_FRONT_PIC(ALTARIA, gMonStillFrontPic_Altaria), + STILL_FRONT_PIC(WYNAUT, gMonStillFrontPic_Wynaut), + STILL_FRONT_PIC(DUSKULL, gMonStillFrontPic_Duskull), + STILL_FRONT_PIC(DUSCLOPS, gMonStillFrontPic_Dusclops), + STILL_FRONT_PIC(ROSELIA, gMonStillFrontPic_Roselia), + STILL_FRONT_PIC(SLAKOTH, gMonStillFrontPic_Slakoth), + STILL_FRONT_PIC(VIGOROTH, gMonStillFrontPic_Vigoroth), + STILL_FRONT_PIC(SLAKING, gMonStillFrontPic_Slaking), + STILL_FRONT_PIC(GULPIN, gMonStillFrontPic_Gulpin), + STILL_FRONT_PIC(SWALOT, gMonStillFrontPic_Swalot), + STILL_FRONT_PIC(TROPIUS, gMonStillFrontPic_Tropius), + STILL_FRONT_PIC(WHISMUR, gMonStillFrontPic_Whismur), + STILL_FRONT_PIC(LOUDRED, gMonStillFrontPic_Loudred), + STILL_FRONT_PIC(EXPLOUD, gMonStillFrontPic_Exploud), + STILL_FRONT_PIC(CLAMPERL, gMonStillFrontPic_Clamperl), + STILL_FRONT_PIC(HUNTAIL, gMonStillFrontPic_Huntail), + STILL_FRONT_PIC(GOREBYSS, gMonStillFrontPic_Gorebyss), + STILL_FRONT_PIC(ABSOL, gMonStillFrontPic_Absol), + STILL_FRONT_PIC(SHUPPET, gMonStillFrontPic_Shuppet), + STILL_FRONT_PIC(BANETTE, gMonStillFrontPic_Banette), + STILL_FRONT_PIC(SEVIPER, gMonStillFrontPic_Seviper), + STILL_FRONT_PIC(ZANGOOSE, gMonStillFrontPic_Zangoose), + STILL_FRONT_PIC(RELICANTH, gMonStillFrontPic_Relicanth), + STILL_FRONT_PIC(ARON, gMonStillFrontPic_Aron), + STILL_FRONT_PIC(LAIRON, gMonStillFrontPic_Lairon), + STILL_FRONT_PIC(AGGRON, gMonStillFrontPic_Aggron), + STILL_FRONT_PIC(CASTFORM, gMonStillFrontPic_Castform), + STILL_FRONT_PIC(VOLBEAT, gMonStillFrontPic_Volbeat), + STILL_FRONT_PIC(ILLUMISE, gMonStillFrontPic_Illumise), + STILL_FRONT_PIC(LILEEP, gMonStillFrontPic_Lileep), + STILL_FRONT_PIC(CRADILY, gMonStillFrontPic_Cradily), + STILL_FRONT_PIC(ANORITH, gMonStillFrontPic_Anorith), + STILL_FRONT_PIC(ARMALDO, gMonStillFrontPic_Armaldo), + STILL_FRONT_PIC(RALTS, gMonStillFrontPic_Ralts), + STILL_FRONT_PIC(KIRLIA, gMonStillFrontPic_Kirlia), + STILL_FRONT_PIC(GARDEVOIR, gMonStillFrontPic_Gardevoir), + STILL_FRONT_PIC(BAGON, gMonStillFrontPic_Bagon), + STILL_FRONT_PIC(SHELGON, gMonStillFrontPic_Shelgon), + STILL_FRONT_PIC(SALAMENCE, gMonStillFrontPic_Salamence), + STILL_FRONT_PIC(BELDUM, gMonStillFrontPic_Beldum), + STILL_FRONT_PIC(METANG, gMonStillFrontPic_Metang), + STILL_FRONT_PIC(METAGROSS, gMonStillFrontPic_Metagross), + STILL_FRONT_PIC(REGIROCK, gMonStillFrontPic_Regirock), + STILL_FRONT_PIC(REGICE, gMonStillFrontPic_Regice), + STILL_FRONT_PIC(REGISTEEL, gMonStillFrontPic_Registeel), + STILL_FRONT_PIC(KYOGRE, gMonStillFrontPic_Kyogre), + STILL_FRONT_PIC(GROUDON, gMonStillFrontPic_Groudon), + STILL_FRONT_PIC(RAYQUAZA, gMonStillFrontPic_Rayquaza), + STILL_FRONT_PIC(LATIAS, gMonStillFrontPic_Latias), + STILL_FRONT_PIC(LATIOS, gMonStillFrontPic_Latios), + STILL_FRONT_PIC(JIRACHI, gMonStillFrontPic_Jirachi), + STILL_FRONT_PIC(DEOXYS, gMonStillFrontPic_Deoxys), + STILL_FRONT_PIC(CHIMECHO, gMonStillFrontPic_Chimecho), + STILL_FRONT_PIC(EGG, gMonStillFrontPic_Egg), + STILL_FRONT_PIC(UNOWN_B, gMonStillFrontPic_UnownB), + STILL_FRONT_PIC(UNOWN_C, gMonStillFrontPic_UnownC), + STILL_FRONT_PIC(UNOWN_D, gMonStillFrontPic_UnownD), + STILL_FRONT_PIC(UNOWN_E, gMonStillFrontPic_UnownE), + STILL_FRONT_PIC(UNOWN_F, gMonStillFrontPic_UnownF), + STILL_FRONT_PIC(UNOWN_G, gMonStillFrontPic_UnownG), + STILL_FRONT_PIC(UNOWN_H, gMonStillFrontPic_UnownH), + STILL_FRONT_PIC(UNOWN_I, gMonStillFrontPic_UnownI), + STILL_FRONT_PIC(UNOWN_J, gMonStillFrontPic_UnownJ), + STILL_FRONT_PIC(UNOWN_K, gMonStillFrontPic_UnownK), + STILL_FRONT_PIC(UNOWN_L, gMonStillFrontPic_UnownL), + STILL_FRONT_PIC(UNOWN_M, gMonStillFrontPic_UnownM), + STILL_FRONT_PIC(UNOWN_N, gMonStillFrontPic_UnownN), + STILL_FRONT_PIC(UNOWN_O, gMonStillFrontPic_UnownO), + STILL_FRONT_PIC(UNOWN_P, gMonStillFrontPic_UnownP), + STILL_FRONT_PIC(UNOWN_Q, gMonStillFrontPic_UnownQ), + STILL_FRONT_PIC(UNOWN_R, gMonStillFrontPic_UnownR), + STILL_FRONT_PIC(UNOWN_S, gMonStillFrontPic_UnownS), + STILL_FRONT_PIC(UNOWN_T, gMonStillFrontPic_UnownT), + STILL_FRONT_PIC(UNOWN_U, gMonStillFrontPic_UnownU), + STILL_FRONT_PIC(UNOWN_V, gMonStillFrontPic_UnownV), + STILL_FRONT_PIC(UNOWN_W, gMonStillFrontPic_UnownW), + STILL_FRONT_PIC(UNOWN_X, gMonStillFrontPic_UnownX), + STILL_FRONT_PIC(UNOWN_Y, gMonStillFrontPic_UnownY), + STILL_FRONT_PIC(UNOWN_Z, gMonStillFrontPic_UnownZ), + STILL_FRONT_PIC(UNOWN_EMARK, gMonStillFrontPic_UnownExclamationMark), + STILL_FRONT_PIC(UNOWN_QMARK, gMonStillFrontPic_UnownQuestionMark), }; From c04ce0ee64c4bffa4f01ca7aaa1b608b40357711 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 17 Dec 2018 21:56:34 -0600 Subject: [PATCH 3/8] Decompile battle_anim_effects_2.c --- asm/battle_anim_effects_2.s | 7544 ----------------------------------- data/battle_anim_scripts.s | 6 +- include/battle_anim.h | 6 + include/graphics.h | 8 + include/math_util.h | 14 + ld_script.txt | 4 +- src/battle_anim_effects_1.c | 10 +- src/battle_anim_effects_2.c | 3845 ++++++++++++++++++ src/effects_2.c | 1197 ------ 9 files changed, 3884 insertions(+), 8750 deletions(-) delete mode 100644 asm/battle_anim_effects_2.s create mode 100755 include/math_util.h create mode 100755 src/battle_anim_effects_2.c delete mode 100644 src/effects_2.c diff --git a/asm/battle_anim_effects_2.s b/asm/battle_anim_effects_2.s deleted file mode 100644 index 75b50f90f..000000000 --- a/asm/battle_anim_effects_2.s +++ /dev/null @@ -1,7544 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_8103448 -sub_8103448: @ 8103448 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r5, =gBattleAnimArgs - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x8] - strh r0, [r4, 0x32] - ldrh r0, [r5, 0xA] - strh r0, [r4, 0x34] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x36] - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - ldr r1, =sub_80A6450 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103448 - - thumb_func_start sub_8103498 -sub_8103498: @ 8103498 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _081034B4 - ldr r0, =gBattleAnimAttacker - b _081034B6 - .pool -_081034B4: - ldr r0, =gBattleAnimTarget -_081034B6: - ldrb r0, [r0] - adds r1, r4, 0 - bl sub_810310C - movs r0, 0 - strh r0, [r4, 0x2E] - strh r0, [r4, 0x30] - ldr r0, =sub_81034D8 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103498 - - thumb_func_start sub_81034D8 -sub_81034D8: @ 81034D8 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _0810350A - cmp r0, 0x1 - bgt _081034EE - cmp r0, 0 - beq _081034F4 - b _08103538 -_081034EE: - cmp r0, 0x2 - beq _08103524 - b _08103538 -_081034F4: - ldrh r0, [r1, 0x26] - subs r0, 0x3 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _08103538 - b _0810351C -_0810350A: - ldrh r0, [r1, 0x26] - adds r0, 0x3 - strh r0, [r1, 0x26] - ldrh r0, [r1, 0x30] - subs r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _08103538 -_0810351C: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - b _08103538 -_08103524: - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - bne _08103538 - adds r0, r1, 0 - bl DestroyAnimSprite -_08103538: - pop {r0} - bx r0 - thumb_func_end sub_81034D8 - - thumb_func_start sub_810353C -sub_810353C: @ 810353C - push {r4,lr} - adds r4, r0, 0 - ldr r3, =gSprites - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r4, 0x30] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x30] - movs r0, 0x2E - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _0810357A - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - strh r2, [r0, 0x24] - adds r0, r4, 0 - bl move_anim_8074EE0 -_0810357A: - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810353C - - thumb_func_start sub_810358C -sub_810358C: @ 810358C - push {r4-r6,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - adds r0, r1 - ldrb r6, [r0] - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _081035E4 - ldr r0, =gBattleAnimArgs - ldrh r1, [r5, 0x20] - ldrh r2, [r0] - subs r1, r2 - strh r1, [r5, 0x20] - adds r1, r0, 0 - b _081035EE - .pool -_081035E4: - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r2, [r5, 0x20] - adds r0, r2 - strh r0, [r5, 0x20] -_081035EE: - ldrh r0, [r1, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r5, 0x30] - strh r6, [r5, 0x32] - ldr r0, =sub_810353C - str r0, [r5, 0x1C] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810358C - - thumb_func_start sub_8103620 -sub_8103620: @ 8103620 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl InitAnimSpritePos - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x38] - ldr r0, =WaitAnimForDuration - str r0, [r4, 0x1C] - ldr r1, =sub_8103658 - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103620 - - thumb_func_start sub_8103658 -sub_8103658: @ 8103658 - push {lr} - ldrh r1, [r0, 0x30] - strh r1, [r0, 0x2E] - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x32] - ldrh r1, [r0, 0x22] - adds r1, 0xF - strh r1, [r0, 0x36] - ldr r1, =StartAnimLinearTranslation - str r1, [r0, 0x1C] - ldr r1, =sub_8103680 - bl StoreSpriteCallbackInData6 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103658 - - thumb_func_start sub_8103680 -sub_8103680: @ 8103680 - push {lr} - adds r1, r0, 0 - ldrh r2, [r1, 0x38] - movs r3, 0x38 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _08103696 - adds r0, r1, 0 - bl DestroyAnimSprite - b _0810369A -_08103696: - subs r0, r2, 0x1 - strh r0, [r1, 0x38] -_0810369A: - pop {r0} - bx r0 - thumb_func_end sub_8103680 - - thumb_func_start sub_81036A0 -sub_81036A0: @ 81036A0 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r0, [r0] - movs r1, 0 - bl sub_80A7270 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81036DC - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81036A0 - - thumb_func_start sub_81036DC -sub_81036DC: @ 81036DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r1, r0, r1 - ldrb r4, [r1] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _08103718 - ldr r1, =gTasks - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - negs r0, r0 - lsls r0, 16 - lsrs r3, r0, 16 - adds r6, r2, 0 - b _08103726 - .pool -_08103718: - ldr r2, =gTasks - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - adds r0, r2 - ldrh r3, [r0, 0x8] - adds r6, r1, 0 -_08103726: - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - bl obj_id_set_rotscale - ldr r1, =gTasks - adds r0, r6, r5 - lsls r0, 3 - adds r1, r0, r1 - movs r2, 0xA - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08103760 - ldrh r0, [r1, 0x8] - adds r0, 0xB0 - strh r0, [r1, 0x8] - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x26] - adds r1, 0x1 - b _0810378A - .pool -_08103760: - cmp r0, 0x1 - bne _08103776 - ldrh r0, [r1, 0xE] - adds r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1E - bne _081037D0 - movs r0, 0x2 - b _081037CE -_08103776: - ldrh r0, [r1, 0x8] - subs r0, 0xB0 - strh r0, [r1, 0x8] - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrh r1, [r0, 0x26] - subs r1, 0x1 -_0810378A: - strh r1, [r0, 0x26] - adds r0, r4, 0 - bl sub_80A73A0 - ldr r0, =gTasks - adds r1, r6, r5 - lsls r1, 3 - adds r1, r0 - movs r3, 0x8 - ldrsh r2, [r1, r3] - movs r0, 0xF2 - lsls r0, 4 - cmp r2, r0 - beq _081037AA - cmp r2, 0 - bne _081037D0 -_081037AA: - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0x2 - bne _081037CC - adds r0, r4, 0 - bl sub_80A7344 - adds r0, r5, 0 - bl DestroyAnimVisualTask - b _081037D0 - .pool -_081037CC: - adds r0, r2, 0x1 -_081037CE: - strh r0, [r1, 0xA] -_081037D0: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81036DC - - thumb_func_start sub_81037D8 -sub_81037D8: @ 81037D8 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_80A6838 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _08103804 - ldr r0, =gBattleAnimArgs - ldrh r1, [r4, 0x20] - ldrh r2, [r0] - subs r1, r2 - strh r1, [r4, 0x20] - adds r5, r0, 0 - b _08103810 - .pool -_08103804: - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - adds r5, r1, 0 -_08103810: - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0810384C - adds r3, r4, 0 - adds r3, 0x3F - ldrb r0, [r3] - movs r1, 0x1 - adds r2, r0, 0 - orrs r2, r1 - strb r2, [r3] - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _08103860 - movs r0, 0x2 - orrs r2, r0 - strb r2, [r3] - b _08103860 - .pool -_0810384C: - movs r2, 0x4 - ldrsh r0, [r5, r2] - cmp r0, 0 - beq _08103860 - adds r2, r4, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] -_08103860: - ldr r0, =sub_80A67D8 - str r0, [r4, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81037D8 - - thumb_func_start sub_810387C -sub_810387C: @ 810387C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl InitAnimSpritePos - ldr r0, =sub_80A67BC - str r0, [r4, 0x1C] - ldr r1, =sub_81038A0 - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810387C - - thumb_func_start sub_81038A0 -sub_81038A0: @ 81038A0 - push {lr} - movs r1, 0x6 - strh r1, [r0, 0x2E] - ldrh r1, [r0, 0x20] - strh r1, [r0, 0x32] - ldrh r1, [r0, 0x22] - subs r1, 0x20 - strh r1, [r0, 0x36] - ldr r1, =StartAnimLinearTranslation - str r1, [r0, 0x1C] - ldr r1, =DestroyAnimSprite - bl StoreSpriteCallbackInData6 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81038A0 - - thumb_func_start sub_81038C8 -sub_81038C8: @ 81038C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r5, r0, 0 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _081038EC - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] - b _0810390E - .pool -_081038EC: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0810390E - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] - ldrh r0, [r1, 0x2] - negs r0, r0 - strh r0, [r1, 0x2] - ldrh r0, [r1, 0x6] - negs r0, r0 - strh r0, [r1, 0x6] -_0810390E: - adds r0, r5, 0 - movs r1, 0x1 - bl InitAnimSpritePos - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - ldr r6, =gBattleAnimArgs - lsrs r0, 24 - ldrh r1, [r6, 0x4] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r6, 0x6] - adds r0, r2 - lsls r0, 16 - lsrs r0, 16 - adds r7, r0, 0 - ldrh r1, [r5, 0x20] - mov r2, r8 - lsls r0, r2, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r5, 0x22] - lsls r1, r7, 16 - asrs r1, 16 - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl ArcTan2Neg - lsls r0, 16 - movs r1, 0xF0 - lsls r1, 24 - adds r0, r1 - lsrs r4, r0, 16 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _08103980 - ldr r2, =0xffffa000 - adds r0, r4, r2 - lsls r0, 16 - lsrs r4, r0, 16 -_08103980: - movs r3, 0x80 - lsls r3, 1 - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - ldrh r0, [r6, 0x8] - strh r0, [r5, 0x2E] - mov r0, r8 - strh r0, [r5, 0x32] - strh r7, [r5, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r5, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81038C8 - - thumb_func_start sub_81039CC -sub_81039CC: @ 81039CC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - subs r1, r0, 0x1 - strh r1, [r3, 0x2E] - lsls r0, 16 - cmp r0, 0 - bgt _081039F6 - ldr r2, =gTasks - movs r0, 0x3C - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0xA] - subs r1, 0x1 - strh r1, [r0, 0xA] - adds r0, r3, 0 - bl DestroySprite -_081039F6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81039CC - - thumb_func_start sub_8103A00 -sub_8103A00: @ 8103A00 - push {r4,lr} - adds r2, r0, 0 - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r3, 0x2E - ldrsh r1, [r2, r3] - movs r3, 0x12 - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _08103A34 - ldrh r0, [r2, 0x34] - ldrh r1, [r2, 0x38] - adds r0, r1 - strh r0, [r2, 0x38] - ldrh r0, [r2, 0x36] - ldrh r3, [r2, 0x3A] - adds r0, r3 - b _08103A42 - .pool -_08103A34: - ldrh r0, [r2, 0x38] - ldrh r1, [r2, 0x34] - subs r0, r1 - strh r0, [r2, 0x38] - ldrh r0, [r2, 0x3A] - ldrh r1, [r2, 0x36] - subs r0, r1 -_08103A42: - strh r0, [r2, 0x3A] - ldrh r0, [r2, 0x38] - ldrh r1, [r2, 0x30] - adds r3, r0, r1 - strh r3, [r2, 0x30] - ldrh r0, [r2, 0x3A] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - ldrh r1, [r4, 0x16] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103A66 - lsls r0, r3, 16 - lsrs r0, 24 - negs r0, r0 - b _08103A6A -_08103A66: - lsls r0, r3, 16 - lsrs r0, 24 -_08103A6A: - strh r0, [r2, 0x24] - ldrh r1, [r4, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103A7E - ldrh r0, [r2, 0x32] - lsrs r0, 8 - negs r0, r0 - b _08103A82 -_08103A7E: - ldrh r0, [r2, 0x32] - lsrs r0, 8 -_08103A82: - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x2E] - subs r1, r0, 0x1 - strh r1, [r2, 0x2E] - lsls r0, 16 - cmp r0, 0 - bgt _08103A98 - movs r0, 0x1E - strh r0, [r2, 0x2E] - ldr r0, =sub_81039CC - str r0, [r2, 0x1C] -_08103A98: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103A00 - - thumb_func_start sub_8103AA4 -sub_8103AA4: @ 8103AA4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r7, r0, 0 - movs r0, 0x3C - ldrsh r1, [r7, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTasks - adds r6, r0, r1 - ldrh r2, [r6, 0x16] - movs r1, 0x2 - negs r1, r1 - adds r0, r1, 0 - ands r0, r2 - ldrh r3, [r7, 0x30] - adds r2, r0, r3 - strh r2, [r7, 0x30] - ldrh r0, [r6, 0x18] - ands r1, r0 - ldrh r0, [r7, 0x32] - adds r1, r0 - strh r1, [r7, 0x32] - ldrh r1, [r6, 0x16] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103AEC - lsls r0, r2, 16 - lsrs r0, 24 - negs r0, r0 - b _08103AF0 - .pool -_08103AEC: - lsls r0, r2, 16 - lsrs r0, 24 -_08103AF0: - strh r0, [r7, 0x24] - ldrh r1, [r6, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103B04 - ldrh r0, [r7, 0x32] - lsrs r0, 8 - negs r0, r0 - b _08103B08 -_08103B04: - ldrh r0, [r7, 0x32] - lsrs r0, 8 -_08103B08: - strh r0, [r7, 0x26] - ldrh r0, [r7, 0x2E] - subs r1, r0, 0x1 - strh r1, [r7, 0x2E] - lsls r0, 16 - cmp r0, 0 - bgt _08103BD4 - movs r4, 0 - movs r0, 0x8 - strh r0, [r7, 0x2E] - movs r0, 0x4 - strh r0, [r6, 0x12] - movs r0, 0x80 - lsls r0, 5 - bl sub_8151624 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x20] - adds r2, r0, r1 - strh r2, [r7, 0x20] - ldrh r0, [r7, 0x26] - ldrh r3, [r7, 0x22] - adds r0, r3 - strh r0, [r7, 0x22] - strh r4, [r7, 0x26] - strh r4, [r7, 0x24] - ldrh r3, [r6, 0x1E] - movs r0, 0x1E - ldrsh r1, [r6, r0] - lsls r0, r2, 16 - asrs r0, 16 - cmp r1, r0 - blt _08103B52 - subs r0, r3, r2 - b _08103B54 -_08103B52: - subs r0, r2, r3 -_08103B54: - lsls r0, 24 - lsrs r4, r0, 16 - ldrh r3, [r6, 0x20] - movs r0, 0x20 - ldrsh r1, [r6, r0] - ldrh r2, [r7, 0x22] - movs r6, 0x22 - ldrsh r0, [r7, r6] - cmp r1, r0 - blt _08103B6C - subs r0, r3, r2 - b _08103B6E -_08103B6C: - subs r0, r2, r3 -_08103B6E: - lsls r0, 24 - lsrs r0, 16 - mov r8, r0 - movs r0, 0 - strh r0, [r7, 0x32] - strh r0, [r7, 0x30] - strh r0, [r7, 0x3A] - strh r0, [r7, 0x38] - lsls r0, r4, 16 - asrs r0, 16 - lsls r5, 16 - asrs r5, 16 - adds r1, r5, 0 - bl sub_8151534 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - movs r6, 0xE0 - lsls r6, 1 - adds r0, r6, 0 - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - strh r0, [r7, 0x34] - mov r1, r8 - lsls r0, r1, 16 - asrs r0, 16 - adds r1, r5, 0 - bl sub_8151534 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - adds r0, r6, 0 - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - strh r0, [r7, 0x36] - ldr r0, =sub_8103A00 - str r0, [r7, 0x1C] -_08103BD4: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103AA4 - - thumb_func_start sub_8103BE4 -sub_8103BE4: @ 8103BE4 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08103C02 - adds r0, r2, 0 - bl DestroyAnimVisualTask -_08103C02: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103BE4 - - thumb_func_start sub_8103C0C -sub_8103C0C: @ 8103C0C - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x8] - subs r1, r0, 0x1 - strh r1, [r5, 0x8] - lsls r0, 16 - cmp r0, 0 - bgt _08103CE0 - ldr r0, =gUnknown_085933B0 - movs r2, 0x1A - ldrsh r1, [r5, r2] - movs r3, 0x1C - ldrsh r2, [r5, r3] - ldrb r3, [r5, 0xC] - ldrb r4, [r5, 0xA] - subs r3, r4 - lsls r3, 24 - lsrs r3, 24 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - lsls r0, 4 - add r0, r12 - lsls r0, 2 - ldr r1, =gSprites - adds r6, r0, r1 - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _08103C6C - cmp r0, 0x2 - beq _08103C82 - b _08103C90 - .pool -_08103C6C: - ldrb r2, [r6, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x18 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x57 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x3] - b _08103C90 -_08103C82: - ldrb r0, [r6, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r6, 0x3] -_08103C90: - ldr r3, =gTasks - lsls r2, r7, 2 - adds r2, r7 - lsls r2, 3 - adds r4, r2, r3 - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0x14] - subs r0, r1 - strh r0, [r6, 0x2E] - strh r7, [r6, 0x3C] - movs r1, 0xA - ldrsh r0, [r4, r1] - adds r0, 0xD - lsls r0, 1 - adds r0, r2 - adds r3, 0x8 - adds r0, r3 - mov r2, r12 - strh r2, [r0] - ldrh r0, [r4, 0xE] - strh r0, [r4, 0x8] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - movs r0, 0x3F - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x9A - bl PlaySE12WithPanning - movs r3, 0xA - ldrsh r0, [r4, r3] - cmp r0, 0x2 - ble _08103CE0 - ldr r0, =sub_8103BE4 - str r0, [r4] -_08103CE0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103C0C - - thumb_func_start sub_8103CF0 -sub_8103CF0: @ 8103CF0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0 - mov r9, r0 - movs r5, 0 - mov r0, sp - mov r1, r9 - strh r1, [r0] - mov r4, sp - adds r4, 0x2 - strh r1, [r4] - bl IsContest - lsls r0, 24 - mov r10, r4 - cmp r0, 0 - beq _08103D5C - ldr r1, =gTasks - lsls r2, r7, 2 - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x10] - ldr r3, =gBattleAnimArgs - ldrh r0, [r3] - negs r0, r0 - strh r0, [r3] - ldrh r1, [r3, 0x4] - movs r0, 0x1 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _08103D54 - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strh r0, [r3, 0x4] - b _08103DB6 - .pool -_08103D54: - movs r0, 0x1 - orrs r0, r1 - strh r0, [r3, 0x4] - b _08103DB6 -_08103D5C: - ldr r1, =gBattlerPositions - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - movs r3, 0x1 - adds r0, r3, 0 - ands r0, r1 - lsls r2, r7, 2 - mov r8, r2 - cmp r0, 0 - bne _08103DB6 - ldr r1, =gTasks - adds r0, r2, r7 - lsls r0, 3 - adds r0, r1 - strh r3, [r0, 0x10] - ldr r2, =gBattleAnimArgs - ldrh r0, [r2] - negs r0, r0 - strh r0, [r2] - ldrh r0, [r2, 0x2] - negs r0, r0 - strh r0, [r2, 0x2] - ldrh r1, [r2, 0x4] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - beq _08103DB0 - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - b _08103DB4 - .pool -_08103DB0: - movs r0, 0x1 - orrs r0, r1 -_08103DB4: - strh r0, [r2, 0x4] -_08103DB6: - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0 - bl GetBattlerSpriteCoord - ldr r1, =gTasks - mov r3, r8 - adds r4, r3, r7 - lsls r4, 3 - adds r4, r1 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1A] - adds r6, r0, 0 - ldrb r0, [r5] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x1C] - mov r9, r0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08103E20 - ldr r4, =gBattleAnimTarget - ldrb r1, [r4] - movs r0, 0x2 - eors r0, r1 - bl IsBattlerSpriteVisible - lsls r0, 24 - cmp r0, 0 - beq _08103E20 - ldrb r0, [r4] - movs r1, 0 - mov r2, sp - mov r3, r10 - bl SetAverageBattlerPositions - b _08103E42 - .pool -_08103E20: - mov r5, sp - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - mov r1, r10 - strh r0, [r1] -_08103E42: - mov r4, sp - ldr r0, =gTasks - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - mov r2, sp - ldr r3, =gBattleAnimArgs - ldrh r0, [r3] - ldrh r2, [r2] - adds r0, r2 - strh r0, [r1, 0x1E] - strh r0, [r4] - ldrh r0, [r3, 0x2] - mov r3, r10 - ldrh r3, [r3] - adds r0, r3 - strh r0, [r1, 0x20] - mov r1, r10 - strh r0, [r1] - mov r0, sp - ldrh r2, [r0] - movs r3, 0 - ldrsh r0, [r0, r3] - adds r1, r6, 0 - cmp r0, r1 - blt _08103E88 - subs r0, r2, r1 - b _08103E8A - .pool -_08103E88: - subs r0, r1, r2 -_08103E8A: - lsls r0, 16 - lsrs r0, 16 - lsls r4, r0, 16 - asrs r4, 16 - ldr r5, =gBattleAnimArgs - ldrh r1, [r5, 0x4] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - lsls r0, 16 - asrs r0, 16 - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - ldr r2, =gTasks - mov r3, r8 - adds r1, r3, r7 - lsls r1, 3 - adds r6, r1, r2 - strh r0, [r6, 0x12] - movs r1, 0x12 - ldrsh r0, [r6, r1] - movs r1, 0x80 - bl sub_8151534 - strh r0, [r6, 0x14] - ldrh r0, [r5, 0x4] - strh r0, [r6, 0x16] - mov r2, r10 - ldrh r1, [r2] - movs r3, 0 - ldrsh r0, [r2, r3] - mov r4, r9 - cmp r0, r4 - blt _08103F08 - subs r4, r1, r4 - lsls r4, 16 - asrs r4, 16 - movs r1, 0x12 - ldrsh r0, [r6, r1] - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - movs r1, 0x2 - negs r1, r1 - ands r1, r0 - strh r1, [r6, 0x18] - b _08103F28 - .pool -_08103F08: - subs r4, r1 - lsls r4, 16 - asrs r4, 16 - movs r2, 0x12 - ldrsh r0, [r6, r2] - bl sub_8151624 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl sub_8151534 - movs r1, 0x1 - orrs r0, r1 - strh r0, [r6, 0x18] -_08103F28: - ldr r1, =gTasks - mov r3, r8 - adds r0, r3, r7 - lsls r0, 3 - adds r5, r0, r1 - ldr r4, =gBattleAnimArgs - ldrh r0, [r4, 0x6] - strh r0, [r5, 0xE] - ldrh r1, [r4, 0x8] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08103F78 - movs r0, 0x80 - eors r0, r1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _08103FA0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSubpriority - lsls r0, 24 - lsrs r0, 24 - ldr r2, =0x0000ffc0 - adds r1, r2, 0 - ldrh r4, [r4, 0x8] - adds r1, r4 - adds r0, r1 - b _08103FB0 - .pool -_08103F78: - lsls r0, r1, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _08103FA0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSubpriority - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0x0000ffc0 - adds r1, r3, 0 - ldrh r4, [r4, 0x8] - adds r1, r4 - adds r0, r1 - b _08103FB0 - .pool -_08103FA0: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSubpriority - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x8] - subs r0, r1 -_08103FB0: - strh r0, [r5, 0xC] - ldr r0, =gTasks - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - movs r3, 0xC - ldrsh r0, [r1, r3] - cmp r0, 0x2 - bgt _08103FC8 - movs r0, 0x3 - strh r0, [r1, 0xC] -_08103FC8: - ldr r0, =sub_8103C0C - str r0, [r1] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103CF0 - - thumb_func_start sub_8103FE8 -sub_8103FE8: @ 8103FE8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl InitAnimSpritePos - ldr r0, =gUnknown_085934A0 - ldrh r0, [r0, 0x2] - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r0, 20 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4, 0x2E] - ldr r0, =sub_8104018 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103FE8 - - thumb_func_start sub_8104018 -sub_8104018: @ 8104018 - push {r4-r7,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0810407C - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r5, [r4, 0x2E] - ldr r1, =gPlttBufferFaded - adds r0, r5, 0 - adds r0, 0x8 - lsls r0, 1 - adds r0, r1 - ldrh r7, [r0] - adds r6, r1, 0 - adds r1, r5, 0 - adds r1, 0x9 - lsls r0, r5, 1 - adds r0, r6 - adds r2, r0, 0 - adds r2, 0x10 - movs r3, 0x7 - lsls r1, 1 - adds r1, r6 -_08104050: - ldrh r0, [r1] - strh r0, [r2] - adds r1, 0x2 - adds r2, 0x2 - subs r3, 0x1 - cmp r3, 0 - bge _08104050 - adds r0, r5, 0 - adds r0, 0xF - lsls r0, 1 - adds r0, r6 - strh r7, [r0] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x18 - bne _0810407C - adds r0, r4, 0 - bl DestroyAnimSprite -_0810407C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104018 - - thumb_func_start sub_8104088 -sub_8104088: @ 8104088 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x1 - bl InitAnimSpritePos - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - ldr r4, =gBattleAnimArgs - lsrs r0, 24 - ldrh r1, [r4, 0x6] - adds r0, r1 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _081040CC - ldrh r0, [r4, 0x4] - negs r0, r0 - strh r0, [r4, 0x4] -_081040CC: - lsls r0, r6, 16 - asrs r0, 16 - ldrh r1, [r4, 0x4] - adds r0, r1 - lsls r0, 16 - ldrh r1, [r5, 0x20] - lsrs r6, r0, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r5, 0x22] - lsls r1, r7, 16 - asrs r1, 16 - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - bl ArcTan2Neg - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 24 - adds r0, r1 - lsrs r0, 16 - movs r3, 0x80 - lsls r3, 1 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0 - adds r2, r3, 0 - bl sub_80A73E0 - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x2E] - strh r6, [r5, 0x32] - strh r7, [r5, 0x36] - ldr r0, =sub_80A7000 - str r0, [r5, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104088 - - thumb_func_start sub_810413C -sub_810413C: @ 810413C - ldr r1, =0x0000fff0 - strh r1, [r0, 0x32] - ldrh r1, [r0, 0x22] - adds r1, 0x8 - strh r1, [r0, 0x22] - ldr r1, =sub_8104154 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_810413C - - thumb_func_start sub_8104154 -sub_8104154: @ 8104154 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x80 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _08104178 - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] -_08104178: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x5 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7E - ble _081041B8 - movs r0, 0 - strh r0, [r4, 0x30] - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _081041B8 - adds r0, r4, 0 - bl DestroyAnimSprite -_081041B8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104154 - - thumb_func_start sub_81041C4 -sub_81041C4: @ 81041C4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl InitAnimSpritePos - movs r0, 0x14 - strh r0, [r4, 0x2E] - ldr r5, =gBattleAnimTarget - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r4, 0x1C] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =sub_810421C - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81041C4 - - thumb_func_start sub_810421C -sub_810421C: @ 810421C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xA6 - bl PlaySE12WithPanning - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - movs r2, 0 - movs r1, 0x7 - adds r0, r4, 0 - adds r0, 0x3C -_08104250: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _08104250 - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x7 - ands r0, r1 - ldr r2, =0x0000fff4 - adds r1, r2, 0 - subs r1, r0 - strh r1, [r4, 0x3A] - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA0 - bl __umodsi3 - adds r0, 0xA0 - strh r0, [r4, 0x3C] - ldr r0, =sub_81042A0 - str r0, [r4, 0x1C] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810421C - - thumb_func_start sub_81042A0 -sub_81042A0: @ 81042A0 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - ldrh r2, [r4, 0x2E] - adds r0, r1, r2 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r2, r0, 24 - strh r2, [r4, 0x24] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081042BE - negs r0, r2 - strh r0, [r4, 0x24] -_081042BE: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x3A - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x8 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7E - ble _081042FE - movs r0, 0 - strh r0, [r4, 0x30] - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _081042FE - adds r0, r4, 0 - bl DestroyAnimSprite -_081042FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81042A0 - - thumb_func_start sub_8104304 -sub_8104304: @ 8104304 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl InitAnimSpritePos - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _08104322 - ldrh r0, [r4, 0x22] - adds r0, 0x10 - strh r0, [r4, 0x22] -_08104322: - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0xC] - strh r0, [r4, 0x34] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldr r0, =sub_80A62EC - str r0, [r4, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - ldr r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104304 - - thumb_func_start sub_8104364 -sub_8104364: @ 8104364 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - movs r7, 0x20 - ldr r4, =0x0000ffe0 - movs r0, 0x10 - mov r8, r0 - ldr r6, =0x0000fff0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08104390 - adds r7, r4, 0 - movs r4, 0x20 - mov r8, r6 - movs r6, 0x10 - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim -_08104390: - lsls r0, r7, 16 - asrs r0, 16 - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x20] - lsls r0, r4, 16 - asrs r0, 16 - ldrh r1, [r5, 0x22] - adds r0, r1 - strh r0, [r5, 0x22] - movs r0, 0x6 - strh r0, [r5, 0x2E] - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - add r0, r8 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, r6 - strh r0, [r5, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r5, 0x1C] - ldr r1, =sub_81043F8 - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104364 - - thumb_func_start sub_81043F8 -sub_81043F8: @ 81043F8 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0810440E - adds r0, r2, 0 - bl DestroyAnimSprite -_0810440E: - pop {r0} - bx r0 - thumb_func_end sub_81043F8 - - thumb_func_start sub_8104414 -sub_8104414: @ 8104414 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - movs r0, 0x20 - mov r8, r0 - ldr r4, =0x0000ffe0 - movs r2, 0x10 - mov r9, r2 - ldr r6, =0x0000fff0 - ldr r7, =gBattleAnimArgs - ldrh r1, [r7] - movs r2, 0 - ldrsh r0, [r7, r2] - cmp r0, 0 - beq _08104448 - mov r8, r4 - movs r4, 0x20 - mov r9, r6 - movs r6, 0x10 - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartSpriteAnim -_08104448: - mov r0, r8 - lsls r1, r0, 16 - asrs r1, 16 - ldrh r2, [r5, 0x20] - adds r1, r2 - strh r1, [r5, 0x20] - lsls r0, r4, 16 - asrs r0, 16 - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - movs r0, 0x6 - strh r0, [r5, 0x2E] - strh r1, [r5, 0x30] - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - add r0, r9 - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - strh r0, [r5, 0x34] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, r6 - strh r0, [r5, 0x36] - adds r0, r5, 0 - bl InitAnimLinearTranslation - ldrh r0, [r7] - strh r0, [r5, 0x38] - ldrh r0, [r5, 0x2E] - strh r0, [r5, 0x3A] - ldr r0, =sub_81044BC - str r0, [r5, 0x1C] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104414 - - thumb_func_start sub_81044BC -sub_81044BC: @ 81044BC - push {r4,lr} - adds r4, r0, 0 - bl TranslateAnimLinear - lsls r0, 24 - cmp r0, 0 - beq _08104520 - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08104520 - adds r0, r4, 0 - movs r1, 0 - bl SeekSpriteAnim - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r2, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x2 - strh r0, [r4, 0x24] - ldr r0, =0x0000fffe - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - eors r0, r1 - strh r0, [r4, 0x32] - strh r2, [r4, 0x36] - strh r2, [r4, 0x34] - ldr r0, =sub_8104530 - str r0, [r4, 0x1C] -_08104520: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81044BC - - thumb_func_start sub_8104530 -sub_8104530: @ 8104530 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08104548 - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x26] - negs r0, r0 - strh r0, [r4, 0x26] -_08104548: - ldrh r0, [r4, 0x34] - movs r1, 0x1 - eors r0, r1 - movs r1, 0 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x33 - bne _0810458A - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x36] - strh r1, [r4, 0x34] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x38] - movs r1, 0x1 - eors r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - ldr r0, =sub_8104594 - str r0, [r4, 0x1C] -_0810458A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104530 - - thumb_func_start sub_8104594 -sub_8104594: @ 8104594 - push {r4,lr} - adds r4, r0, 0 - bl TranslateAnimLinear - lsls r0, 24 - cmp r0, 0 - beq _081045A8 - adds r0, r4, 0 - bl DestroyAnimSprite -_081045A8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8104594 - - thumb_func_start sub_81045B0 -sub_81045B0: @ 81045B0 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r0, 0x1 - bl GetAnimBattlerSpriteId - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_80A7270 - adds r0, r4, 0 - movs r1, 0xD0 - movs r2, 0xD0 - movs r3, 0 - bl obj_id_set_rotscale - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r0, 0x10 - movs r1, 0 - bl sub_80A750C - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x50 - strh r1, [r0, 0x8] - ldr r1, =sub_8104614 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81045B0 - - thumb_func_start sub_8104614 -sub_8104614: @ 8104614 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - subs r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _08104664 - movs r0, 0x1 - bl GetAnimBattlerSpriteId - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_80A7344 - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - adds r0, 0x10 - movs r1, 0x1 - bl sub_80A750C - adds r0, r5, 0 - bl DestroyAnimVisualTask -_08104664: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104614 - - thumb_func_start sub_8104674 -sub_8104674: @ 8104674 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0x8] - movs r1, 0 - bl sub_80A7270 - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x10] - strh r5, [r4, 0x12] - strh r5, [r4, 0x14] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSubpriority - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x16] - ldr r0, =sub_81046CC - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104674 - - thumb_func_start sub_81046CC -sub_81046CC: @ 81046CC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _081046E6 - b _081047F6 -_081046E6: - lsls r0, 2 - ldr r1, =_081046F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081046F8: - .4byte _08104710 - .4byte _08104758 - .4byte _0810478E - .4byte _08104794 - .4byte _081047A4 - .4byte _081047D8 -_08104710: - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08104720 - cmp r0, 0x3 - beq _08104720 - cmp r0, 0x6 - bne _08104728 -_08104720: - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8104800 -_08104728: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x10] - adds r0, 0x28 - strh r0, [r4, 0x10] - ldrb r0, [r4, 0x8] - movs r1, 0x10 - ldrsh r2, [r4, r1] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x8] - bl sub_80A7E6C - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _081047F6 - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - b _081047D0 -_08104758: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081047F6 - movs r2, 0x12 - ldrsh r1, [r4, r2] - cmp r1, 0x3 - bne _0810476E - strh r0, [r4, 0xC] - strh r1, [r4, 0xA] - b _081047F6 -_0810476E: - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r2, 0x80 - lsls r2, 1 - strh r2, [r4, 0x10] - ldrb r0, [r4, 0x8] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x8] - bl sub_80A7E6C - movs r0, 0x2 - strh r0, [r4, 0xA] - b _081047F6 -_0810478E: - movs r0, 0 - strh r0, [r4, 0xA] - b _081047F6 -_08104794: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _081047F6 - b _081047CC -_081047A4: - ldrh r0, [r4, 0xC] - adds r0, 0x2 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x10] - subs r0, 0x50 - strh r0, [r4, 0x10] - ldrb r0, [r4, 0x8] - movs r1, 0x10 - ldrsh r2, [r4, r1] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x8] - bl sub_80A7E6C - movs r2, 0xC - ldrsh r0, [r4, r2] - cmp r0, 0x20 - bne _081047F6 -_081047CC: - movs r0, 0 - strh r0, [r4, 0xC] -_081047D0: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _081047F6 -_081047D8: - ldrb r0, [r4, 0x8] - bl sub_80A7344 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x26] - adds r0, r5, 0 - bl DestroyAnimVisualTask -_081047F6: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81046CC - - thumb_func_start sub_8104800 -sub_8104800: @ 8104800 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0 - bl duplicate_obj_of_side_rel2move_in_transparent_mode - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r0, 16 - asrs r4, r0, 16 - cmp r4, 0 - blt _081048DA - bl AllocOamMatrix - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0xFF - bne _08104844 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl obj_delete_but_dont_free_vram - b _081048DA - .pool -_08104844: - ldr r5, =gSprites - lsls r3, r4, 4 - adds r3, r4 - lsls r3, 2 - adds r4, r3, r5 - ldrb r1, [r4, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x3 - orrs r0, r1 - strb r0, [r4, 0x1] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - movs r0, 0x1F - ands r6, r0 - lsls r2, r6, 1 - ldrb r1, [r4, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, 0x3] - ldrb r0, [r7, 0x16] - ldrb r1, [r7, 0xE] - subs r0, r1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - ldrh r0, [r7, 0xE] - adds r0, 0x1 - strh r0, [r7, 0xE] - ldrh r0, [r7, 0x14] - adds r0, 0x1 - strh r0, [r7, 0x14] - movs r0, 0x10 - strh r0, [r4, 0x2E] - mov r0, r9 - strh r0, [r4, 0x30] - movs r0, 0x6 - strh r0, [r4, 0x32] - adds r5, 0x1C - adds r3, r5 - ldr r0, =sub_81048F0 - str r0, [r3] - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 - movs r1, 0x10 - ldrsh r2, [r7, r1] - adds r1, r2, 0 - movs r3, 0 - bl obj_id_set_rotscale - ldrb r0, [r4, 0x1] - movs r3, 0x4 - negs r3, r3 - ands r3, r0 - movs r0, 0x1 - orrs r3, r0 - strb r3, [r4, 0x1] - lsrs r1, r3, 6 - ldrb r2, [r4, 0x3] - lsrs r2, 6 - lsls r3, 30 - lsrs r3, 30 - adds r0, r4, 0 - bl CalcCenterToCornerVec -_081048DA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104800 - - thumb_func_start sub_81048F0 -sub_81048F0: @ 81048F0 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _0810492E - ldr r3, =gTasks - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x30 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - adds r0, r4, 0 - bl obj_delete_but_dont_free_vram -_0810492E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81048F0 - - thumb_func_start sub_8104938 -sub_8104938: @ 8104938 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldr r5, =gBattleAnimArgs - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08104964 - adds r0, r2, 0 - bl DestroyAnimVisualTask - b _0810498A - .pool -_08104964: - ldrb r0, [r5] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r2, 0 - strh r1, [r4, 0x8] - strh r2, [r4, 0xA] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0xC] - strh r2, [r4, 0xE] - strh r2, [r4, 0x10] - ldr r2, =gUnknown_085935E8 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_8104998 - str r0, [r4] -_0810498A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104938 - - thumb_func_start sub_8104998 -sub_8104998: @ 8104998 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0xA - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _08104A00 - cmp r5, 0x1 - bgt _081049C0 - cmp r5, 0 - beq _081049CA - b _08104AA8 - .pool -_081049C0: - cmp r5, 0x2 - beq _08104A34 - cmp r5, 0x3 - beq _08104A64 - b _08104AA8 -_081049CA: - adds r0, r4, 0 - bl sub_80A7D34 - ldrh r2, [r4, 0x10] - adds r2, 0x3 - strh r2, [r4, 0x10] - ldr r3, =gSprites - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r1, [r0, 0x26] - adds r1, r2 - strh r1, [r0, 0x26] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _08104AA8 - strh r5, [r4, 0xE] - b _08104A5C - .pool -_08104A00: - adds r0, r4, 0 - bl sub_80A7D34 - ldr r2, =gSprites - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x10] - ldrh r2, [r0, 0x26] - adds r1, r2 - strh r1, [r0, 0x26] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _08104AA8 - movs r0, 0 - strh r0, [r4, 0xE] - b _08104A5C - .pool -_08104A34: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _08104A5C - ldr r2, =gSprites - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x2 - strh r1, [r0, 0x26] - ldrh r0, [r4, 0x10] - subs r0, 0x2 - strh r0, [r4, 0x10] - b _08104AA8 - .pool -_08104A5C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - b _08104AA8 -_08104A64: - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _08104AA8 - ldrh r0, [r4, 0xC] - subs r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - cmp r0, 0 - bne _08104A9C - ldr r2, =gSprites - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x26] - adds r0, r6, 0 - bl DestroyAnimVisualTask - b _08104AA8 - .pool -_08104A9C: - ldrb r1, [r4, 0x8] - ldr r2, =gUnknown_085935E8 - adds r0, r4, 0 - bl sub_80A7CFC - strh r5, [r4, 0xA] -_08104AA8: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104998 - - thumb_func_start sub_8104AB4 -sub_8104AB4: @ 8104AB4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08593608 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_8104AF0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104AB4 - - thumb_func_start sub_8104AF0 -sub_8104AF0: @ 8104AF0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _08104B10 - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08104B10: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104AF0 - - thumb_func_start sub_8104B1C -sub_8104B1C: @ 8104B1C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _08104B50 - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r4, 0x20] - movs r0, 0x40 - b _08104B6A - .pool -_08104B50: - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x20 - strh r0, [r4, 0x20] - ldr r0, =0x0000ffc0 -_08104B6A: - strh r0, [r4, 0x30] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - strh r0, [r4, 0x22] - movs r0, 0x34 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x32] - strh r1, [r4, 0x34] - strh r1, [r4, 0x36] - ldr r1, =DestroyAnimSprite - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A656C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104B1C - - thumb_func_start sub_8104BAC -sub_8104BAC: @ 8104BAC - push {r4-r6,lr} - adds r6, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08104BC8 - ldr r0, =gBattleAnimAttacker - b _08104BCA - .pool -_08104BC8: - ldr r0, =gBattleAnimTarget -_08104BCA: - ldrb r5, [r0] - adds r0, r5, 0 - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08104BE4 - ldr r1, =gBattleAnimArgs - movs r2, 0x2 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x2] -_08104BE4: - adds r0, r5, 0 - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - ldr r4, =gBattleAnimArgs - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r6, 0x20] - adds r0, r5, 0 - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r4, [r4, 0x4] - adds r0, r4 - strh r0, [r6, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bgt _08104C16 - movs r0, 0x8 - strh r0, [r6, 0x22] -_08104C16: - ldr r1, =move_anim_8074EE0 - adds r0, r6, 0 - bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A67BC - str r0, [r6, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104BAC - - thumb_func_start sub_8104C38 -sub_8104C38: @ 8104C38 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - strh r1, [r4, 0x8] - strh r0, [r4, 0xA] - ldr r2, =gUnknown_085936A4 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_8104C78 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104C38 - - thumb_func_start sub_8104C78 -sub_8104C78: @ 8104C78 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _08104C98 - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08104C98: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104C78 - - thumb_func_start sub_8104CA4 -sub_8104CA4: @ 8104CA4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r4, r1, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - strh r0, [r4, 0x8] - strh r2, [r4, 0xA] - movs r0, 0x4 - strh r0, [r4, 0xC] - movs r0, 0x7 - strh r0, [r4, 0xE] - movs r0, 0x3 - strh r0, [r4, 0x10] - ldr r3, =gSprites - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x12] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x14] - strh r2, [r4, 0x16] - strh r2, [r4, 0x18] - movs r0, 0x2 - strh r0, [r4, 0x1A] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08104D0E - movs r1, 0xC - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0xC] -_08104D0E: - ldr r0, =sub_8104D28 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104CA4 - - thumb_func_start sub_8104D28 -sub_8104D28: @ 8104D28 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r3, r0, r1 - ldrh r0, [r3, 0x16] - adds r0, 0x1 - strh r0, [r3, 0x16] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08104D8E - movs r0, 0 - strh r0, [r3, 0x16] - ldrh r0, [r3, 0x18] - adds r0, 0x1 - strh r0, [r3, 0x18] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08104D78 - ldr r2, =gSprites - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x1A] - ldrh r2, [r0, 0x22] - adds r1, r2 - b _08104D8C - .pool -_08104D78: - ldr r2, =gSprites - movs r5, 0x8 - ldrsh r1, [r3, r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - ldrh r2, [r3, 0x1A] - subs r1, r2 -_08104D8C: - strh r1, [r0, 0x22] -_08104D8E: - movs r1, 0xA - ldrsh r0, [r3, r1] - cmp r0, 0x1 - beq _08104DDC - cmp r0, 0x1 - bgt _08104DA4 - cmp r0, 0 - beq _08104DAA - b _08104E6C - .pool -_08104DA4: - cmp r0, 0x2 - beq _08104E0C - b _08104E6C -_08104DAA: - ldr r2, =gSprites - movs r5, 0x8 - ldrsh r1, [r3, r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0xC] - ldrh r2, [r0, 0x20] - adds r1, r2 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0xE] - subs r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08104E6C - movs r0, 0xE - strh r0, [r3, 0xE] - movs r0, 0x1 - strh r0, [r3, 0xA] - b _08104E6C - .pool -_08104DDC: - ldr r2, =gSprites - movs r5, 0x8 - ldrsh r1, [r3, r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x20] - ldrh r2, [r3, 0xC] - subs r1, r2 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0xE] - subs r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _08104E6C - movs r0, 0x7 - strh r0, [r3, 0xE] - movs r0, 0x2 - strh r0, [r3, 0xA] - b _08104E6C - .pool -_08104E0C: - ldr r2, =gSprites - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0xC] - ldrh r5, [r0, 0x20] - adds r1, r5 - strh r1, [r0, 0x20] - ldrh r0, [r3, 0xE] - subs r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _08104E6C - ldrh r0, [r3, 0x10] - subs r0, 0x1 - strh r0, [r3, 0x10] - lsls r0, 16 - cmp r0, 0 - beq _08104E48 - movs r0, 0x7 - strh r0, [r3, 0xE] - strh r1, [r3, 0xA] - b _08104E6C - .pool -_08104E48: - ldrh r1, [r3, 0x18] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08104E66 - movs r0, 0x8 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x22] - ldrh r2, [r3, 0x1A] - subs r1, r2 - strh r1, [r0, 0x22] -_08104E66: - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08104E6C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8104D28 - - thumb_func_start sub_8104E74 -sub_8104E74: @ 8104E74 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r5, r1, r0 - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - bl GetBattlerYCoordWithElevation - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - movs r1, 0 - strh r0, [r5, 0x8] - movs r0, 0x4 - strh r0, [r5, 0xA] - strh r1, [r5, 0xC] - strh r1, [r5, 0xE] - strh r1, [r5, 0x10] - strh r1, [r5, 0x12] - ldrb r0, [r4] - bl sub_80A861C - strh r0, [r5, 0x26] - ldrb r0, [r4] - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08104ED4 - ldr r0, =gBattle_BG1_X - ldrh r0, [r0] - strh r0, [r5, 0x14] - ldr r0, =0x04000014 - b _08104EDC - .pool -_08104ED4: - ldr r0, =gBattle_BG2_X - ldrh r0, [r0] - strh r0, [r5, 0x14] - ldr r0, =0x04000018 -_08104EDC: - str r0, [sp] - ldrh r0, [r5, 0x8] - adds r1, r0, 0 - subs r1, 0x40 - lsls r2, r1, 16 - lsls r0, 16 - cmp r2, r0 - bgt _08104F1A - ldr r4, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r6, r4, r0 -_08104EF4: - asrs r3, r2, 16 - cmp r3, 0 - blt _08104F0C - lsls r1, r3, 1 - adds r2, r1, r4 - ldrh r0, [r5, 0x14] - adds r0, 0xF0 - strh r0, [r2] - adds r1, r6 - ldrh r0, [r5, 0x14] - adds r0, 0xF0 - strh r0, [r1] -_08104F0C: - adds r0, r3, 0x1 - lsls r2, r0, 16 - asrs r1, r2, 16 - movs r3, 0x8 - ldrsh r0, [r5, r3] - cmp r1, r0 - ble _08104EF4 -_08104F1A: - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl ScanlineEffect_SetParams - ldr r0, =sub_8104F54 - str r0, [r5] - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104E74 - - thumb_func_start sub_8104F54 -sub_8104F54: @ 8104F54 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r3, r0, r1 - movs r1, 0x10 - ldrsh r0, [r3, r1] - cmp r0, 0 - beq _08104F78 - cmp r0, 0x1 - beq _08104F8E - b _0810500E - .pool -_08104F78: - ldrh r0, [r3, 0x12] - adds r0, 0x1 - strh r0, [r3, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _0810500E - ldrh r0, [r3, 0x10] - adds r0, 0x1 - strh r0, [r3, 0x10] - b _0810500E -_08104F8E: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0810500E - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r1, [r3, 0xE] - movs r0, 0x3 - ands r0, r1 - strh r0, [r3, 0xC] - ldrh r0, [r3, 0x8] - subs r0, r1 - strh r0, [r3, 0x12] - movs r2, 0xC - ldrsh r1, [r3, r2] - cmp r1, 0x1 - beq _08104FC4 - cmp r1, 0x1 - ble _08104FCC - cmp r1, 0x2 - beq _08104FC8 - cmp r1, 0x3 - beq _08104FC8 - b _08104FCC -_08104FC4: - subs r0, 0x2 - b _08104FCA -_08104FC8: - adds r0, 0x1 -_08104FCA: - strh r0, [r3, 0x12] -_08104FCC: - movs r1, 0x12 - ldrsh r0, [r3, r1] - cmp r0, 0 - blt _08104FF0 - ldr r2, =gScanlineEffectRegBuffers - lsls r0, 1 - adds r0, r2 - ldrh r1, [r3, 0x14] - strh r1, [r0] - movs r1, 0x12 - ldrsh r0, [r3, r1] - lsls r0, 1 - movs r1, 0xF0 - lsls r1, 3 - adds r2, r1 - adds r0, r2 - ldrh r1, [r3, 0x14] - strh r1, [r0] -_08104FF0: - ldrh r0, [r3, 0xE] - adds r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x26 - ldrsh r1, [r3, r2] - cmp r0, r1 - blt _0810500E - ldr r1, =gScanlineEffect - movs r0, 0x3 - strb r0, [r1, 0x15] - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0810500E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104F54 - - thumb_func_start sub_810501C -sub_810501C: @ 810501C - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =gBattleAnimTarget - ldrb r0, [r6] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x10 - movs r5, 0 - strh r0, [r4, 0x20] - ldrb r0, [r6] - bl GetBattlerYCoordWithElevation - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - strh r0, [r4, 0x22] - strh r5, [r4, 0x2E] - strh r5, [r4, 0x30] - strh r5, [r4, 0x32] - movs r0, 0x10 - strh r0, [r4, 0x34] - strh r5, [r4, 0x36] - ldrb r0, [r6] - movs r1, 0 - bl sub_80A861C - adds r0, 0x2 - strh r0, [r4, 0x38] - movs r0, 0x3F - bl BattleAnimAdjustPanning - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x3A] - ldr r0, =sub_8105078 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810501C - - thumb_func_start sub_8105078 -sub_8105078: @ 8105078 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2E - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _081050DC - cmp r1, 0x1 - bgt _0810508E - cmp r1, 0 - beq _08105094 - b _081051BC -_0810508E: - cmp r1, 0x2 - beq _0810516E - b _081051BC -_08105094: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081050BE - strh r1, [r4, 0x32] - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_081050BE: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081051BC - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r2] - b _08105166 -_081050DC: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08105122 - ldrh r2, [r4, 0x32] - movs r3, 0x32 - ldrsh r1, [r4, r3] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - bge _08105122 - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x22] - subs r0, 0x1 - strh r0, [r4, 0x22] - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08105122 - ldrh r1, [r4, 0x3A] - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl PlaySE12WithPanning -_08105122: - ldrh r0, [r4, 0x34] - ldrh r2, [r4, 0x36] - adds r1, r0, r2 - strh r1, [r4, 0x36] - lsls r0, r1, 16 - asrs r2, r0, 16 - cmp r2, 0x1F - ble _08105136 - movs r0, 0x40 - b _08105144 -_08105136: - movs r0, 0x20 - negs r0, r0 - cmp r2, r0 - bgt _08105150 - movs r2, 0x40 - negs r2, r2 - adds r0, r2, 0 -_08105144: - subs r0, r1 - strh r0, [r4, 0x36] - movs r3, 0x34 - ldrsh r0, [r4, r3] - negs r0, r0 - strh r0, [r4, 0x34] -_08105150: - ldrh r0, [r4, 0x36] - movs r2, 0 - strh r0, [r4, 0x24] - movs r0, 0x38 - ldrsh r1, [r4, r0] - movs r3, 0x32 - ldrsh r0, [r4, r3] - cmp r1, r0 - bne _081051BC - strh r2, [r4, 0x30] - strh r2, [r4, 0x32] -_08105166: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _081051BC -_0810516E: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0810519A - movs r0, 0 - strh r0, [r4, 0x32] - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsrs r1, r2, 2 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0810519A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _081051BC - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - bl DestroyAnimSprite -_081051BC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8105078 - - thumb_func_start sub_81051C4 -sub_81051C4: @ 81051C4 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - movs r5, 0 - mov r0, sp - strh r5, [r0] - mov r1, sp - adds r1, 0x2 - strh r5, [r1] - ldr r0, =gBattleAnimArgs - movs r3, 0x4 - ldrsh r2, [r0, r3] - adds r7, r1, 0 - adds r1, r0, 0 - cmp r2, 0 - bne _081051F0 - ldr r0, =gBattleAnimAttacker - b _081051F2 - .pool -_081051F0: - ldr r0, =gBattleAnimTarget -_081051F2: - ldrb r5, [r0] - ldrb r1, [r1, 0x6] - movs r0, 0x1 - adds r4, r0, 0 - eors r4, r1 - bl IsDoubleBattle - lsls r0, 24 - cmp r0, 0 - beq _0810526A - movs r1, 0x2 - adds r0, r5, 0 - eors r0, r1 - bl IsBattlerSpriteVisible - lsls r0, 24 - cmp r0, 0 - beq _0810526A - adds r0, r5, 0 - adds r1, r4, 0 - mov r2, sp - adds r3, r7, 0 - bl SetAverageBattlerPositions - cmp r4, 0 - bne _08105230 - adds r0, r5, 0 - movs r1, 0 - b _08105234 - .pool -_08105230: - adds r0, r5, 0 - movs r1, 0x2 -_08105234: - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r5, 0 - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _08105260 - ldr r2, =gBattleAnimArgs - mov r0, sp - ldrh r1, [r0] - subs r1, r4 - ldrh r0, [r2] - subs r1, r0 - subs r0, r1 - strh r0, [r2] - b _0810526A - .pool -_08105260: - ldr r1, =gBattleAnimArgs - mov r0, sp - ldrh r0, [r0] - subs r0, r4 - strh r0, [r1] -_0810526A: - ldr r1, =sub_80A77C8 - str r1, [r6, 0x1C] - adds r0, r6, 0 - bl _call_via_r1 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81051C4 - - thumb_func_start sub_8105284 -sub_8105284: @ 8105284 - push {r4,lr} - adds r4, r0, 0 - bl TranslateAnimLinear - lsls r0, 24 - cmp r0, 0 - beq _0810529E - adds r0, r4, 0 - bl FreeSpriteOamMatrix - adds r0, r4, 0 - bl DestroyAnimSprite -_0810529E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8105284 - - thumb_func_start sub_81052A4 -sub_81052A4: @ 81052A4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r5, r0, 0 - movs r6, 0 - mov r0, sp - strh r6, [r0] - mov r1, sp - adds r1, 0x2 - strh r6, [r1] - ldr r0, =gBattleAnimArgs - movs r2, 0xA - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _081052DC - ldr r0, =gBattleAnimAttacker - ldrb r7, [r0] - ldr r0, =gBattleAnimTarget - b _081052E2 - .pool -_081052DC: - ldr r0, =gBattleAnimTarget - ldrb r7, [r0] - ldr r0, =gBattleAnimAttacker -_081052E2: - ldrb r0, [r0] - mov r8, r0 - ldr r0, =gBattleAnimArgs - movs r3, 0xC - ldrsh r0, [r0, r3] - cmp r0, 0 - bne _08105308 - movs r0, 0 - mov r10, r0 - movs r1, 0x1 - str r1, [sp, 0x4] - b _08105310 - .pool -_08105308: - movs r2, 0x2 - mov r10, r2 - movs r3, 0x3 - str r3, [sp, 0x4] -_08105310: - adds r0, r7, 0 - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0810536C - adds r0, r7, 0 - mov r1, r10 - bl GetBattlerSpriteCoord - lsls r0, 24 - ldr r1, =gBattleAnimArgs - lsrs r0, 24 - ldrh r1, [r1] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - movs r0, 0x2 - mov r4, r8 - eors r4, r0 - adds r0, r4, 0 - bl IsBattlerSpriteVisible - lsls r0, 24 - cmp r0, 0 - beq _0810535C - ldr r2, =gSprites - ldr r0, =gBattlerSpriteIds - adds r0, r4, r0 - b _081053EA - .pool -_0810535C: - ldr r2, =gSprites - ldr r0, =gBattlerSpriteIds - add r0, r8 - b _081053EA - .pool -_0810536C: - adds r0, r7, 0 - mov r1, r10 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleAnimArgs - ldrh r1, [r1] - subs r0, r1 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _081053E4 - movs r0, 0x2 - adds r4, r7, 0 - eors r4, r0 - adds r0, r4, 0 - bl IsBattlerSpriteVisible - lsls r0, 24 - cmp r0, 0 - beq _081053E4 - ldr r3, =gSprites - ldr r2, =gBattlerSpriteIds - adds r0, r7, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r6, r0, r3 - adds r2, r4, r2 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0, r3 - movs r0, 0x20 - ldrsh r1, [r6, r0] - movs r3, 0x20 - ldrsh r0, [r2, r3] - cmp r1, r0 - bge _081053E0 - adds r0, r2, 0 - adds r0, 0x43 - ldrb r0, [r0] - adds r0, 0x1 - b _081053FA - .pool -_081053E0: - adds r0, r6, 0 - b _081053F4 -_081053E4: - ldr r2, =gSprites - ldr r0, =gBattlerSpriteIds - adds r0, r7, r0 -_081053EA: - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 -_081053F4: - adds r0, 0x43 - ldrb r0, [r0] - subs r0, 0x1 -_081053FA: - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - adds r0, r7, 0 - ldr r1, [sp, 0x4] - bl GetBattlerSpriteCoord - lsls r0, 24 - ldr r4, =gBattleAnimArgs - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0810544C - movs r1, 0x2 - mov r0, r8 - eors r0, r1 - bl IsBattlerSpriteVisible - lsls r0, 24 - cmp r0, 0 - beq _0810544C - ldrb r1, [r4, 0xC] - mov r0, r8 - mov r2, sp - mov r3, sp - adds r3, 0x2 - bl SetAverageBattlerPositions - b _0810546C - .pool -_0810544C: - mov r4, sp - mov r0, r8 - mov r1, r10 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - mov r0, r8 - ldr r1, [sp, 0x4] - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - mov r2, sp - strh r0, [r2, 0x2] -_0810546C: - mov r0, r8 - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _08105490 - mov r3, sp - mov r2, sp - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x6] - ldrh r2, [r2] - adds r0, r2 - strh r0, [r3] - adds r2, r1, 0 - b _0810549E - .pool -_08105490: - mov r3, sp - mov r0, sp - ldr r2, =gBattleAnimArgs - ldrh r0, [r0] - ldrh r1, [r2, 0x6] - subs r0, r1 - strh r0, [r3] -_0810549E: - ldrh r1, [r2, 0x8] - mov r3, sp - ldrh r3, [r3, 0x2] - adds r1, r3 - mov r0, sp - strh r1, [r0, 0x2] - mov r3, r9 - strh r3, [r5, 0x30] - strh r3, [r5, 0x20] - strh r6, [r5, 0x34] - strh r6, [r5, 0x22] - ldrh r0, [r0] - strh r0, [r5, 0x32] - strh r1, [r5, 0x36] - ldrh r0, [r2] - strh r0, [r5, 0x2E] - adds r0, r5, 0 - bl InitAnimLinearTranslation - ldr r1, =sub_8105284 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81052A4 - - thumb_func_start sub_81054E8 -sub_81054E8: @ 81054E8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =0x000027db - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0810550E - lsls r0, 20 - ldr r1, =0x01010000 - adds r0, r1 - lsrs r0, 16 - ldr r1, =gBattleAnimArgs - ldrb r2, [r1, 0xA] - ldrh r3, [r1, 0x8] - movs r1, 0xF - bl BlendPalette -_0810550E: - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - ldr r1, =sub_80A77C8 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81054E8 - - thumb_func_start sub_8105538 -sub_8105538: @ 8105538 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - bl InitAnimSpritePos - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - movs r1, 0xA0 - cmp r0, 0 - beq _08105554 - ldr r1, =0x0000ff60 -_08105554: - movs r0, 0xE0 - lsls r0, 2 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x4] - strh r0, [r4, 0x3C] - ldr r0, =sub_810557C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105538 - - thumb_func_start sub_810557C -sub_810557C: @ 810557C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x2E] - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - subs r1, r0 - movs r5, 0 - strh r1, [r4, 0x26] - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - subs r2, 0x20 - strh r2, [r4, 0x2E] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - movs r1, 0xA0 - cmp r0, 0 - beq _081055AC - ldr r1, =0x0000ff60 -_081055AC: - lsls r0, r1, 16 - asrs r0, 16 - ldrh r1, [r4, 0x30] - adds r0, r1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x26] - movs r2, 0x26 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _081055E0 - ldrh r2, [r4, 0x22] - adds r0, r1, r2 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x26] - strh r5, [r4, 0x24] - strh r5, [r4, 0x2E] - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - ldr r0, =sub_81055F4 - str r0, [r4, 0x1C] -_081055E0: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810557C - - thumb_func_start sub_81055F4 -sub_81055F4: @ 81055F4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r1, r0, 0x1 - strh r1, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _08105612 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldr r0, =sub_810561C - str r0, [r4, 0x1C] -_08105612: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81055F4 - - thumb_func_start sub_810561C -sub_810561C: @ 810561C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _08105682 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r0, 0 - strh r0, [r4, 0x2E] - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08105668 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - ldr r0, =sub_8105694 - b _08105680 - .pool -_08105668: - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x20 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - ldr r0, =sub_810571C -_08105680: - str r0, [r4, 0x1C] -_08105682: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810561C - - thumb_func_start sub_8105694 -sub_8105694: @ 8105694 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x26] - subs r0, 0x2 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _081056CA - movs r0, 0x10 - strh r0, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x30] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x2E] - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_81056D4 - str r0, [r4, 0x1C] -_081056CA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105694 - - thumb_func_start sub_81056D4 -sub_81056D4: @ 81056D4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _08105712 - ldrh r1, [r4, 0x2E] - subs r1, 0x1 - strh r1, [r4, 0x2E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08105712 - ldr r0, =sub_810571C - str r0, [r4, 0x1C] -_08105712: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81056D4 - - thumb_func_start sub_810571C -sub_810571C: @ 810571C - push {lr} - adds r3, r0, 0 - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08105754 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r1, 0x3C - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _08105750 - ldr r0, =sub_810575C - b _08105752 - .pool -_08105750: - ldr r0, =DestroyAnimSprite -_08105752: - str r0, [r3, 0x1C] -_08105754: - pop {r0} - bx r0 - .pool - thumb_func_end sub_810571C - - thumb_func_start sub_810575C -sub_810575C: @ 810575C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810575C - - thumb_func_start sub_810577C -sub_810577C: @ 810577C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x8] - ldr r2, =gUnknown_085938B0 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_81057B8 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810577C - - thumb_func_start sub_81057B8 -sub_81057B8: @ 81057B8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - adds r0, r4, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _08105802 - ldr r2, =gSprites - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r3, [r0, 0x26] - movs r0, 0x8 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - adds r0, r5, 0 - bl DestroyAnimVisualTask -_08105802: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81057B8 - - thumb_func_start sub_8105810 -sub_8105810: @ 8105810 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r4, r1, r0 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r0, 0x3 - strh r0, [r4, 0x20] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _08105850 - ldr r0, =0x0000ffff - strh r0, [r4, 0x22] - movs r0, 0x8 - b _08105856 - .pool -_08105850: - movs r0, 0x1 - strh r0, [r4, 0x22] - ldr r0, =0x0000fff8 -_08105856: - strh r0, [r4, 0x24] - movs r0, 0x1 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_8105878 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105810 - - thumb_func_start sub_8105878 -sub_8105878: @ 8105878 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r3, r0, r1 - movs r0, 0x8 - ldrsh r4, [r3, r0] - cmp r4, 0x1 - beq _081058CC - cmp r4, 0x1 - bgt _081058A0 - cmp r4, 0 - beq _081058AA - b _08105992 - .pool -_081058A0: - cmp r4, 0x2 - beq _08105948 - cmp r4, 0x3 - beq _08105962 - b _08105992 -_081058AA: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x24] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - strh r4, [r3, 0xA] - strh r4, [r3, 0xC] - strh r4, [r3, 0xE] - b _0810595A - .pool -_081058CC: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08105992 - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - ands r0, r4 - lsls r0, 16 - cmp r0, 0 - beq _08105904 - ldr r2, =gSprites - movs r4, 0x26 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - adds r1, 0x6 - b _08105916 - .pool -_08105904: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - subs r1, 0x6 -_08105916: - strh r1, [r0, 0x24] - ldrh r0, [r3, 0xE] - adds r0, 0x1 - strh r0, [r3, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _08105992 - ldrh r1, [r3, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810595A - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - subs r0, 0x6 - strh r0, [r1, 0x24] - b _0810595A - .pool -_08105948: - ldrh r0, [r3, 0x20] - subs r0, 0x1 - strh r0, [r3, 0x20] - lsls r0, 16 - cmp r0, 0 - beq _0810595A - movs r0, 0 - strh r0, [r3, 0x8] - b _08105992 -_0810595A: - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _08105992 -_08105962: - ldr r2, =gSprites - movs r4, 0x26 - ldrsh r1, [r3, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x22] - ldrh r4, [r0, 0x24] - adds r1, r4 - strh r1, [r0, 0x24] - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08105992 - adds r0, r5, 0 - bl DestroyAnimVisualTask -_08105992: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105878 - - thumb_func_start sub_810599C -sub_810599C: @ 810599C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r0, 0x1 - strh r0, [r4, 0x10] - movs r0, 0xE - strh r0, [r4, 0x22] - movs r0, 0x2 - strh r0, [r4, 0x24] - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_81059E0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810599C - - thumb_func_start sub_81059E0 -sub_81059E0: @ 81059E0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08105AA6 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x10 - ldrsh r1, [r4, r3] - cmp r0, r1 - ble _08105AA6 - strh r2, [r4, 0xA] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08105A3C - ldr r3, =gSprites - movs r6, 0x26 - ldrsh r1, [r4, r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - b _08105A52 - .pool -_08105A3C: - ldr r3, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 -_08105A52: - strb r1, [r0] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - movs r6, 0x22 - ldrsh r1, [r4, r6] - cmp r0, r1 - blt _08105AA6 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - movs r6, 0x24 - ldrsh r1, [r4, r6] - cmp r0, r1 - bge _08105A88 - strh r2, [r4, 0xA] - strh r2, [r4, 0xC] - strh r2, [r4, 0xE] - b _08105AA6 - .pool -_08105A88: - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - adds r0, r5, 0 - bl DestroyAnimVisualTask -_08105AA6: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81059E0 - - thumb_func_start sub_8105AAC -sub_8105AAC: @ 8105AAC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - movs r1, 0x4 - strh r1, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - strh r0, [r4, 0x10] - strh r0, [r4, 0x12] - strh r0, [r4, 0x14] - strh r0, [r4, 0x16] - strh r0, [r4, 0x18] - strh r0, [r4, 0x22] - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x24] - ldrb r0, [r5] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_8105B08 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105AAC - - thumb_func_start sub_8105B08 -sub_8105B08: @ 8105B08 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x18 - ldrsh r2, [r4, r0] - cmp r2, 0x1 - beq _08105B74 - cmp r2, 0x1 - bgt _08105B30 - cmp r2, 0 - beq _08105B36 - b _08105B90 - .pool -_08105B30: - cmp r2, 0x2 - beq _08105B8C - b _08105B90 -_08105B36: - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _08105B90 - strh r2, [r4, 0x10] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - movs r1, 0x1 - ands r0, r1 - strh r0, [r4, 0x12] - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08105B90 - movs r1, 0x16 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08105B6E - strh r2, [r4, 0x14] - movs r0, 0x1 - strh r0, [r4, 0x18] - b _08105B90 -_08105B6E: - movs r0, 0x2 - strh r0, [r4, 0x18] - b _08105B90 -_08105B74: - movs r1, 0 - strh r1, [r4, 0x12] - ldrh r0, [r4, 0x10] - adds r0, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _08105B90 - strh r2, [r4, 0x16] - strh r1, [r4, 0x18] - b _08105B90 -_08105B8C: - movs r0, 0x1 - strh r0, [r4, 0x12] -_08105B90: - movs r2, 0x8 - ldrsh r5, [r4, r2] - cmp r5, 0 - beq _08105B9E - cmp r5, 0x1 - beq _08105C34 - b _08105C42 -_08105B9E: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _08105C42 - strh r5, [r4, 0xA] - ldr r0, =gUnknown_085938DC - movs r3, 0x24 - ldrsh r1, [r4, r3] - movs r3, 0x26 - ldrsh r2, [r4, r3] - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _08105C42 - ldr r0, =gSprites - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - strh r6, [r1, 0x2E] - movs r0, 0xD - strh r0, [r1, 0x30] - ldr r2, =gUnknown_085938F4 - movs r3, 0xC - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0x24] - movs r3, 0xC - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r2, 0x1 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - strh r0, [r1, 0x26] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _08105C42 - strh r5, [r4, 0xC] - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _08105C42 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _08105C42 - .pool -_08105C34: - movs r1, 0x22 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08105C42 - adds r0, r6, 0 - bl DestroyAnimVisualTask -_08105C42: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8105B08 - - thumb_func_start sub_8105C48 -sub_8105C48: @ 8105C48 - push {r4,lr} - adds r3, r0, 0 - ldr r4, =gTasks - movs r0, 0x2E - ldrsh r1, [r3, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - movs r2, 0x1 - ldrb r1, [r0, 0x12] - ands r1, r2 - lsls r1, 2 - mov r0, r12 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - adds r0, r3, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08105CAA - movs r0, 0x30 - ldrsh r1, [r3, r0] - lsls r1, 1 - movs r0, 0x2E - ldrsh r2, [r3, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r0, r4, 0 - adds r0, 0x8 - adds r1, r0 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r3, 0 - bl DestroySprite -_08105CAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105C48 - - thumb_func_start sub_8105CB4 -sub_8105CB4: @ 8105CB4 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x000027de - bl IndexOfSpritePaletteTag - mov r1, sp - strb r0, [r1] - movs r4, 0x1 - ldr r0, =0x00002710 - adds r5, r0, 0 -_08105CCC: - subs r0, r5, r4 - lsls r0, 16 - lsrs r0, 16 - bl AllocSpritePalette - mov r2, sp - adds r1, r2, r4 - strb r0, [r1] - adds r4, 0x1 - cmp r4, 0x2 - ble _08105CCC - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - adds r1, r0, 0 - ldr r0, =gMonSpritesGfxPtr - ldr r0, [r0] - movs r2, 0xBE - lsls r2, 1 - adds r0, r2 - str r1, [r0] - ldr r0, =gBattleAnimSpritePalette_206 - bl LZDecompressWram - movs r4, 0 -_08105D00: - ldr r5, =gMonSpritesGfxPtr - ldr r0, [r5] - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - lsls r1, r4, 6 - ldr r0, [r0] - adds r0, r1 - mov r2, sp - adds r1, r2, r4 - ldrb r1, [r1] - lsls r1, 20 - movs r2, 0x80 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - movs r2, 0x20 - bl LoadPalette - adds r4, 0x1 - cmp r4, 0x2 - ble _08105D00 - ldr r0, [r5] - movs r4, 0xBE - lsls r4, 1 - adds r0, r4 - ldr r0, [r0] - bl Free - ldr r0, [r5] - adds r0, r4 - movs r1, 0 - str r1, [r0] - adds r0, r6, 0 - bl DestroyAnimVisualTask - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105CB4 - - thumb_func_start sub_8105D60 -sub_8105D60: @ 8105D60 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r5, =gUnknown_08593950 - movs r4, 0x2 -_08105D6A: - ldrh r0, [r5] - bl FreeSpritePaletteByTag - adds r5, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _08105D6A - adds r0, r6, 0 - bl DestroyAnimVisualTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105D60 - - thumb_func_start sub_8105D88 -sub_8105D88: @ 8105D88 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsls r2, 24 - lsrs r3, r2, 24 - movs r0, 0x1 - ands r3, r0 - negs r0, r3 - orrs r0, r3 - asrs r0, 31 - movs r3, 0x20 - ands r0, r3 - ldrh r4, [r5, 0x4] - lsls r3, r4, 22 - lsrs r3, 22 - lsrs r1, 22 - adds r0, r1 - adds r3, r0 - ldr r1, =0x000003ff - adds r0, r1, 0 - ands r3, r0 - ldr r0, =0xfffffc00 - ands r0, r4 - orrs r0, r3 - strh r0, [r5, 0x4] - ldr r0, =gUnknown_08593950 - lsrs r2, 25 - lsls r2, 1 - adds r2, r0 - ldrh r0, [r2] - bl IndexOfSpritePaletteTag - lsls r0, 4 - ldrb r2, [r5, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105D88 - - thumb_func_start sub_8105DE8 -sub_8105DE8: @ 8105DE8 - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0 - bl InitAnimSpritePos - ldr r6, =gBattleAnimAttacker - ldrb r0, [r6] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _08105E08 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_08105E08: - ldr r4, =gBattleAnimArgs - ldrh r0, [r4, 0x8] - strh r0, [r5, 0x2E] - ldrb r0, [r6] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x4] - adds r0, r1 - strh r0, [r5, 0x32] - ldrb r0, [r6] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x6] - adds r0, r1 - strh r0, [r5, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r5, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - ldrb r1, [r4, 0xA] - ldrb r2, [r4, 0xC] - adds r0, r5, 0 - bl sub_8105D88 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105DE8 - - thumb_func_start sub_8105E60 -sub_8105E60: @ 8105E60 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08105E7A - adds r0, r4, 0 - movs r1, 0 - bl InitAnimSpritePos -_08105E7A: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x8 - bl Sin - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x32] - lsls r0, r2, 16 - asrs r0, 24 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x7 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - subs r2, 0x80 - strh r2, [r4, 0x32] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x3C - bne _08105EAA - adds r0, r4, 0 - bl DestroyAnimSprite -_08105EAA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8105E60 - - thumb_func_start sub_8105EB0 -sub_8105EB0: @ 8105EB0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - bl IsContest - lsls r0, 24 - movs r6, 0xF0 - cmp r0, 0 - beq _08105EC4 - movs r6, 0x98 -_08105EC4: - movs r5, 0 - ldr r1, =gBattle_WIN0H - strh r6, [r1] - ldr r4, =gBattle_WIN0V - movs r0, 0xA0 - strh r0, [r4] - ldrh r1, [r1] - movs r0, 0x40 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - ldr r1, =0x00003f1f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0x50 - movs r1, 0xC8 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0x10 - bl SetGpuReg - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - strh r5, [r0, 0x8] - strh r6, [r0, 0xA] - ldr r1, =sub_8105F30 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105EB0 - - thumb_func_start sub_8105F30 -sub_8105F30: @ 8105F30 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r3, r1, r2 - ldrh r0, [r3, 0x8] - adds r4, r0, 0 - adds r4, 0xD - strh r4, [r3, 0x8] - ldrh r0, [r3, 0xA] - adds r2, r0, 0 - subs r2, 0xD - strh r2, [r3, 0xA] - lsls r1, r4, 16 - lsls r0, r2, 16 - cmp r1, r0 - blt _08105F70 - ldr r0, =gBattle_WIN0H - movs r1, 0 - strh r1, [r0] - ldr r0, =sub_8105F84 - str r0, [r3] - b _08105F78 - .pool -_08105F70: - ldr r1, =gBattle_WIN0H - lsls r0, r4, 8 - orrs r2, r0 - strh r2, [r1] -_08105F78: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105F30 - - thumb_func_start sub_8105F84 -sub_8105F84: @ 8105F84 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0x1C] - adds r0, 0x1 - movs r4, 0 - strh r0, [r1, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _08105FD8 - movs r0, 0x88 - strh r0, [r1, 0x1E] - movs r0, 0x50 - movs r1, 0x88 - bl SetGpuReg - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl sub_80A75AC - ldr r2, =0x00007fff - movs r1, 0x10 - bl BlendPalettes - b _0810600C - .pool -_08105FD8: - cmp r0, 0x4 - ble _0810600C - ldr r0, =gBattle_WIN0H - strh r4, [r0] - ldr r0, =gBattle_WIN0V - strh r4, [r0] - ldr r4, =0x00003f3f - movs r0, 0x48 - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x4A - adds r1, r4, 0 - bl SetGpuReg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0810600C: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105F84 - - thumb_func_start sub_8106020 -sub_8106020: @ 8106020 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - movs r0, 0x1 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0810607C - movs r0, 0x1 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08593988 - adds r0, r5, 0 - bl sub_80A7CFC - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - movs r1, 0x4 - strh r1, [r0, 0x24] - b _081060A4 - .pool -_0810607C: - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r4, r0, r1 - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - adds r0, r5, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081060A4 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r6, 0 - bl DestroyAnimVisualTask -_081060A4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106020 - - thumb_func_start sub_81060B0 -sub_81060B0: @ 81060B0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0810610C - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_08593988 - adds r0, r5, 0 - bl sub_80A7CFC - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - movs r1, 0x4 - strh r1, [r0, 0x24] - b _08106134 - .pool -_0810610C: - ldr r1, =gSprites - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r4, r0, r1 - ldrh r0, [r4, 0x24] - negs r0, r0 - strh r0, [r4, 0x24] - adds r0, r5, 0 - bl sub_80A7D34 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08106134 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r6, 0 - bl DestroyAnimVisualTask -_08106134: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81060B0 - - thumb_func_start sub_8106140 -sub_8106140: @ 8106140 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl InitAnimSpritePos - movs r0, 0x5F - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - ldr r5, =gBattleAnimTarget - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x36] - adds r0, r4, 0 - bl InitAnimLinearTranslation - ldr r0, =sub_810618C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106140 - - thumb_func_start sub_810618C -sub_810618C: @ 810618C - push {r4,lr} - adds r4, r0, 0 - bl TranslateAnimLinear - lsls r0, 24 - cmp r0, 0 - bne _081061B6 - movs r1, 0x38 - ldrsh r0, [r4, r1] - movs r1, 0xE - bl Sin - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x38] - adds r0, 0x4 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - b _081061BC -_081061B6: - adds r0, r4, 0 - bl DestroyAnimSprite -_081061BC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810618C - - thumb_func_start sub_81061C4 -sub_81061C4: @ 81061C4 - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081061E8 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x32] - adds r0, r2, 0x1 - strh r0, [r4, 0x2E] - b _08106244 - .pool -_081061E8: - ldrh r0, [r4, 0x30] - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - cmp r0, 0x64 - ble _08106236 - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_08106236: - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x78 - ble _08106244 - adds r0, r4, 0 - bl DestroyAnimSprite -_08106244: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81061C4 - - thumb_func_start sub_810624C -sub_810624C: @ 810624C - push {lr} - ldr r2, =gBattleAnimArgs - ldrh r1, [r2] - strh r1, [r0, 0x20] - movs r1, 0xA0 - strh r1, [r0, 0x22] - ldrh r1, [r2, 0x4] - strh r1, [r0, 0x2E] - ldrh r1, [r2, 0x2] - strh r1, [r0, 0x30] - ldr r1, =WaitAnimForDuration - str r1, [r0, 0x1C] - ldr r1, =sub_810627C - bl StoreSpriteCallbackInData6 - pop {r0} - bx r0 - .pool - thumb_func_end sub_810624C - - thumb_func_start sub_810627C -sub_810627C: @ 810627C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - lsls r0, 16 - lsrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r1, 0x4 - bl Sin - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x26] - ldrh r1, [r4, 0x22] - adds r0, r1 - lsls r0, 16 - asrs r5, r0, 16 - cmp r5, 0x48 - bgt _081062E2 - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - cmp r5, 0x40 - bgt _081062E2 - adds r0, r4, 0 - bl DestroyAnimSprite -_081062E2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_810627C - - thumb_func_start sub_81062E8 -sub_81062E8: @ 81062E8 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x3 - bl SetAnimBgAttribute - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl SetAnimBgAttribute - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0810632A - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetAnimBgAttribute -_0810632A: - ldr r0, =gBattle_BG1_X - movs r1, 0 - strh r1, [r0] - ldr r4, =gBattle_BG1_Y - strh r1, [r4] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C232E0 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r1, =gUnknown_08C23D78 - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - ldr r0, =gUnknown_08C23D50 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81063A8 - str r1, [r0] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81062E8 - - thumb_func_start sub_81063A8 -sub_81063A8: @ 81063A8 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x20 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _081063C6 - b _081064F0 -_081063C6: - lsls r0, 2 - ldr r1, =_081063D8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081063D8: - .4byte _081063EC - .4byte _08106430 - .4byte _08106452 - .4byte _08106496 - .4byte _081064BC -_081063EC: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _081064F0 - strh r5, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - adds r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081064F0 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x1E] - b _081064F0 -_08106430: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8D - bne _081064F0 - movs r0, 0x10 - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - b _081064F0 -_08106452: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _081064F0 - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - subs r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _081064F0 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r1, [r4, 0x1E] - b _081064F0 -_08106496: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x20] - adds r1, 0x1 - strh r1, [r0, 0x20] - b _081064F0 - .pool -_081064BC: - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _081064D0 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl SetAnimBgAttribute -_081064D0: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - adds r0, r4, 0 - bl DestroyAnimVisualTask -_081064F0: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81063A8 - - thumb_func_start sub_81064F8 -sub_81064F8: @ 81064F8 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl SetAnimBgAttribute - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0810653A - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetAnimBgAttribute -_0810653A: - ldr r0, =gBattle_BG1_X - movs r1, 0 - strh r1, [r0] - ldr r4, =gBattle_BG1_Y - strh r1, [r4] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - mov r0, sp - bl sub_80A6B30 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _08106578 - ldr r1, =gBattleAnimBackgroundTilemap_ScaryFaceContest - b _0810658A - .pool -_08106578: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0810659C - ldr r1, =gBattleAnimBackgroundTilemap_ScaryFacePlayer -_0810658A: - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - b _081065A6 - .pool -_0810659C: - ldr r1, =gBattleAnimBackgroundTilemap_ScaryFaceOpponent - mov r0, sp - movs r2, 0 - bl sub_80A6D60 -_081065A6: - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C249F8 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C249D0 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81065EC - str r1, [r0] - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81064F8 - - thumb_func_start sub_81065EC -sub_81065EC: @ 81065EC - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x20 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _0810660A - b _08106730 -_0810660A: - lsls r0, 2 - ldr r1, =_0810661C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0810661C: - .4byte _08106630 - .4byte _08106674 - .4byte _08106696 - .4byte _081066DA - .4byte _081066FC -_08106630: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _08106730 - strh r5, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - adds r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0xE - bne _08106730 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x1E] - b _08106730 -_08106674: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _08106730 - movs r0, 0xE - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - b _08106730 -_08106696: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _08106730 - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - subs r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _08106730 - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r1, [r4, 0x1E] - b _08106730 -_081066DA: - mov r0, sp - bl sub_80A6B30 - movs r0, 0x1 - bl sub_80A6C68 - movs r0, 0x2 - bl sub_80A6C68 - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] -_081066FC: - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _08106710 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl SetAnimBgAttribute -_08106710: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08106730: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81065EC - - thumb_func_start sub_810673C -sub_810673C: @ 810673C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - adds r2, r4, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - ldrb r0, [r5] - bl GetBattlerSubpriority - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x3C] - ldr r1, =sub_810679C - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810673C - - thumb_func_start sub_810679C -sub_810679C: @ 810679C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - subs r0, 0x40 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x7F - bhi _081067B2 - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - b _081067B6 -_081067B2: - ldrh r0, [r4, 0x3C] - subs r0, 0x1 -_081067B6: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - bl Sin - strh r0, [r4, 0x24] - movs r2, 0x30 - ldrsh r0, [r4, r2] - ldrh r1, [r4, 0x34] - lsls r1, 16 - asrs r1, 24 - bl Cos - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x9 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r3, 0x38 - ldrsh r2, [r4, r3] - cmp r2, 0 - beq _08106828 - cmp r2, 0x1 - bne _08106858 - ldr r1, =0xfffffc00 - adds r0, r1, 0 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r4, 0x32] - ldr r3, =0xffffff00 - adds r0, r3, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08106858 - movs r0, 0x2 - strh r0, [r4, 0x38] - b _08106868 - .pool -_08106828: - movs r3, 0x80 - lsls r3, 3 - adds r0, r3, 0 - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - movs r3, 0x80 - lsls r3, 1 - adds r0, r3, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x2E - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _08106858 - strh r2, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x38] -_08106858: - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _08106868 - adds r0, r4, 0 - bl DestroyAnimSprite -_08106868: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810679C - - thumb_func_start sub_8106878 -sub_8106878: @ 8106878 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r4, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl Sin - strh r0, [r5, 0x2E] - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x7 - bl Cos - strh r0, [r5, 0x30] - ldr r0, =sub_81068CC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106878 - - thumb_func_start sub_81068CC -sub_81068CC: @ 81068CC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - ldrh r3, [r2, 0x26] - adds r0, r3 - strh r0, [r2, 0x26] - movs r1, 0x20 - ldrsh r0, [r2, r1] - movs r3, 0x24 - ldrsh r1, [r2, r3] - adds r0, r1 - adds r0, 0x10 - movs r1, 0x88 - lsls r1, 1 - cmp r0, r1 - bhi _0810690A - movs r0, 0x22 - ldrsh r1, [r2, r0] - movs r3, 0x26 - ldrsh r0, [r2, r3] - adds r1, r0 - cmp r1, 0xA0 - bgt _0810690A - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _08106910 -_0810690A: - adds r0, r2, 0 - bl DestroyAnimSprite -_08106910: - pop {r0} - bx r0 - thumb_func_end sub_81068CC - - thumb_func_start sub_8106914 -sub_8106914: @ 8106914 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - ldrh r3, [r2, 0x26] - adds r0, r3 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x34] - adds r1, r0, 0x1 - strh r1, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x32 - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _08106940 - adds r0, r2, 0 - bl DestroyAnimSprite -_08106940: - pop {r0} - bx r0 - thumb_func_end sub_8106914 - - thumb_func_start sub_8106944 -sub_8106944: @ 8106944 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r4, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0xA - bl Sin - strh r0, [r5, 0x2E] - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x7 - bl Cos - strh r0, [r5, 0x30] - ldrh r0, [r4, 0x2] - strh r0, [r5, 0x32] - ldr r0, =sub_8106914 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106944 - - thumb_func_start sub_810699C -sub_810699C: @ 810699C - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081069B2 - adds r0, r2, 0 - bl DestroyAnimSprite -_081069B2: - pop {r0} - bx r0 - thumb_func_end sub_810699C - - thumb_func_start sub_81069B8 -sub_81069B8: @ 81069B8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl InitAnimSpritePos - ldr r0, =sub_810699C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81069B8 - - thumb_func_start sub_81069D0 -sub_81069D0: @ 81069D0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081069EE - ldr r0, =gBattleAnimArgs - ldrh r1, [r0] - ldrh r2, [r4, 0x20] - adds r1, r2 - strh r1, [r4, 0x20] - ldrh r0, [r0, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_081069EE: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r5, r0, 1 - movs r0, 0xFF - ands r5, r0 - adds r0, r5, 0 - movs r1, 0x50 - bl Sin - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4F - bgt _08106A32 - adds r0, r5, 0 - movs r1, 0x50 - bl Cos - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - lsls r0, 16 - asrs r0, 24 - adds r1, r0 - strh r1, [r4, 0x26] -_08106A32: - movs r0, 0x2E - ldrsh r2, [r4, r0] - cmp r2, 0x5A - ble _08106A50 - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] -_08106A50: - cmp r2, 0x64 - ble _08106A5A - adds r0, r4, 0 - bl DestroyAnimSprite -_08106A5A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81069D0 - - thumb_func_start sub_8106A64 -sub_8106A64: @ 8106A64 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r1, 0x5 - bl Sin - strh r0, [r4, 0x24] - movs r1, 0x38 - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x14 - ble _08106ABA - adds r1, r0, 0 - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_08106ABA: - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x1E - ble _08106AC8 - adds r0, r4, 0 - bl DestroyAnimSprite -_08106AC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8106A64 - - thumb_func_start sub_8106AD0 -sub_8106AD0: @ 8106AD0 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106AF4 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x32] - adds r0, r2, 0x1 - strh r0, [r4, 0x2E] - b _08106B48 - .pool -_08106AF4: - ldrh r0, [r4, 0x30] - ldrh r2, [r4, 0x36] - adds r0, r2 - movs r5, 0 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl Sin - adds r2, r0, 0 - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x34] - adds r0, 0x3 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x34] - cmp r0, 0x46 - ble _08106B48 - ldr r0, =sub_8106A64 - str r0, [r4, 0x1C] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r1, [r4, 0x22] - adds r0, r2, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x24] - strh r5, [r4, 0x26] - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xB4 - bl __umodsi3 - strh r0, [r4, 0x34] -_08106B48: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106AD0 - - thumb_func_start sub_8106B54 -sub_8106B54: @ 8106B54 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106B8E - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSubpriority - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r4, 0x32] -_08106B8E: - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x2E] - adds r0, r2 - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsls r1, r0, 2 - adds r0, r1, 0 - cmp r1, 0 - bge _08106BA4 - adds r0, 0xFF -_08106BA4: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _08106BB6 - movs r0, 0 - strh r0, [r4, 0x30] -_08106BB6: - movs r0, 0x30 - ldrsh r2, [r4, r0] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _08106BC4 - adds r0, 0x3 -_08106BC4: - asrs r0, 2 - movs r1, 0x1E - subs r1, r0 - adds r0, r2, 0 - bl Cos - strh r0, [r4, 0x24] - movs r0, 0x30 - ldrsh r2, [r4, r0] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _08106BE0 - adds r0, 0x7 -_08106BE0: - asrs r0, 3 - movs r1, 0xA - subs r1, r0 - adds r0, r2, 0 - bl Sin - strh r0, [r4, 0x26] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0x80 - ble _08106C04 - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0 - ble _08106C04 - ldr r0, =0x0000ffff - strh r0, [r4, 0x32] -_08106C04: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106C18 - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0 - bge _08106C18 - movs r0, 0x1 - strh r0, [r4, 0x32] -_08106C18: - ldrh r0, [r4, 0x34] - adds r1, r0, 0x1 - strh r1, [r4, 0x34] - subs r0, 0x9 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x46 - bls _08106C5C - movs r0, 0x2E - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - b _08106C6A - .pool -_08106C5C: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_08106C6A: - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x5A - ble _08106C78 - adds r0, r4, 0 - bl DestroyAnimSprite -_08106C78: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8106B54 - - thumb_func_start sub_8106C80 -sub_8106C80: @ 8106C80 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106CB4 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - ldrb r1, [r1, 0x4] - adds r0, r4, 0 - bl StartSpriteAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _08106CC8 - .pool -_08106CB4: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08106CC8 - adds r0, r4, 0 - bl DestroyAnimSprite -_08106CC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8106C80 - - thumb_func_start sub_8106CD0 -sub_8106CD0: @ 8106CD0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =gBattleAnimArgs - movs r2, 0x4 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08106CEC - adds r0, r5, 0 - bl DestroyAnimSprite - b _08106D50 - .pool -_08106CEC: - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _08106CFC - ldr r4, =gBattleAnimAttacker - b _08106CFE - .pool -_08106CFC: - ldr r4, =gBattleAnimTarget -_08106CFE: - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r0, =gBattleAnimArgs - movs r2, 0x2 - ldrsh r1, [r0, r2] - adds r2, r0, 0 - cmp r1, 0 - bne _08106D34 - ldrh r0, [r5, 0x20] - adds r0, 0x20 - b _08106D38 - .pool -_08106D34: - ldrh r0, [r5, 0x20] - subs r0, 0x20 -_08106D38: - strh r0, [r5, 0x20] - ldrh r0, [r2, 0x4] - strh r0, [r5, 0x2E] - ldrh r1, [r2, 0x2] - strh r1, [r5, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r5, 0 - bl StartSpriteAnim - ldr r0, =sub_8106D5C - str r0, [r5, 0x1C] -_08106D50: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106CD0 - - thumb_func_start sub_8106D5C -sub_8106D5C: @ 8106D5C - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08106D8C - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - cmp r0, 0 - beq _08106D86 - ldrh r1, [r2, 0x30] - lsls r1, 24 - lsrs r1, 24 - adds r0, r2, 0 - bl StartSpriteAnim - b _08106D8C -_08106D86: - adds r0, r2, 0 - bl DestroyAnimSprite -_08106D8C: - pop {r0} - bx r0 - thumb_func_end sub_8106D5C - - thumb_func_start sub_8106D90 -sub_8106D90: @ 8106D90 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - ldr r2, =gUnknown_08593B98 - adds r0, r4, 0 - bl sub_80A7CFC - ldr r0, =sub_8106DD4 - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106D90 - - thumb_func_start sub_8106DD4 -sub_8106DD4: @ 8106DD4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - bl sub_80A7D34 - lsls r0, 24 - cmp r0, 0 - bne _08106DF4 - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08106DF4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106DD4 - - thumb_func_start sub_8106E00 -sub_8106E00: @ 8106E00 - push {r4-r7,lr} - adds r5, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08106E1C - ldr r0, =gBattleAnimAttacker - b _08106E1E - .pool -_08106E1C: - ldr r0, =gBattleAnimTarget -_08106E1E: - ldrb r6, [r0] - adds r0, r6, 0 - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08106E38 - ldr r1, =gBattleAnimArgs - movs r2, 0x2 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x2] -_08106E38: - adds r0, r6, 0 - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - ldr r7, =gBattleAnimArgs - lsrs r0, 24 - ldrh r3, [r7, 0x2] - adds r0, r3 - movs r4, 0 - strh r0, [r5, 0x20] - adds r0, r6, 0 - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r7, 0x4] - adds r0, r1 - strh r0, [r5, 0x22] - strh r4, [r5, 0x2E] - ldrh r1, [r5, 0x20] - lsls r1, 3 - strh r1, [r5, 0x30] - lsls r0, 3 - strh r0, [r5, 0x32] - movs r2, 0x2 - ldrsh r0, [r7, r2] - lsls r0, 3 - cmp r0, 0 - bge _08106E78 - adds r0, 0x7 -_08106E78: - asrs r0, 3 - strh r0, [r5, 0x34] - movs r3, 0x4 - ldrsh r0, [r7, r3] - lsls r0, 3 - cmp r0, 0 - bge _08106E88 - adds r0, 0x7 -_08106E88: - asrs r0, 3 - strh r0, [r5, 0x36] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - movs r3, 0x6 - ldrsh r0, [r7, r3] - lsls r0, 4 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - ldr r0, =sub_8106EC8 - str r0, [r5, 0x1C] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106E00 - - thumb_func_start sub_8106EC8 -sub_8106EC8: @ 8106EC8 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x34] - ldrh r1, [r2, 0x30] - adds r0, r1 - strh r0, [r2, 0x30] - ldrh r1, [r2, 0x36] - ldrh r3, [r2, 0x32] - adds r1, r3 - strh r1, [r2, 0x32] - lsls r0, 16 - asrs r0, 19 - strh r0, [r2, 0x20] - lsls r1, 16 - asrs r1, 19 - strh r1, [r2, 0x22] - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - ble _08106EFC - adds r0, r2, 0 - bl DestroyAnimSprite -_08106EFC: - pop {r0} - bx r0 - thumb_func_end sub_8106EC8 - - thumb_func_start sub_8106F00 -sub_8106F00: @ 8106F00 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08106F22 - ldr r0, =gBattleAnimArgs - ldrh r1, [r0] - movs r0, 0x78 - subs r0, r1 - strh r0, [r4, 0x30] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_08106F22: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x30 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08106F40 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - adds r0, 0x10 - movs r1, 0 - bl sub_80A750C -_08106F40: - movs r0, 0x2E - ldrsh r1, [r4, r0] - movs r2, 0x30 - ldrsh r0, [r4, r2] - adds r0, 0x50 - cmp r1, r0 - bne _08106F54 - adds r0, r4, 0 - bl DestroyAnimSprite -_08106F54: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106F00 - - thumb_func_start sub_8106F60 -sub_8106F60: @ 8106F60 - push {r4-r6,lr} - adds r6, r0, 0 - movs r1, 0x2E - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08106F8E - movs r5, 0x78 - strh r5, [r6, 0x20] - ldr r4, =gBattleAnimArgs - movs r2, 0 - ldrsh r0, [r4, r2] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - subs r0, 0xF - strh r0, [r6, 0x22] - ldrb r1, [r4, 0x2] - adds r0, r6, 0 - bl StartSpriteAnim - strh r5, [r6, 0x38] - ldrh r0, [r4, 0x4] - strh r0, [r6, 0x34] -_08106F8E: - ldrh r0, [r6, 0x2E] - adds r0, 0x1 - movs r5, 0 - strh r0, [r6, 0x2E] - movs r1, 0x2E - ldrsh r0, [r6, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r6, 0x30] - movs r2, 0x2E - ldrsh r0, [r6, r2] - lsls r4, r0, 1 - adds r4, r0 - ldrh r0, [r6, 0x34] - adds r4, r0 - movs r2, 0xFF - ldrh r0, [r6, 0x3A] - adds r0, 0xA - movs r1, 0xFF - ands r0, r1 - strh r0, [r6, 0x3A] - ands r4, r2 - adds r0, r4, 0 - movs r1, 0x64 - bl Cos - strh r0, [r6, 0x24] - adds r0, r4, 0 - movs r1, 0xA - bl Sin - adds r4, r0, 0 - movs r1, 0x3A - ldrsh r0, [r6, r1] - movs r1, 0x4 - bl Cos - ldrh r2, [r6, 0x30] - adds r4, r2 - adds r0, r4 - strh r0, [r6, 0x26] - movs r0, 0x2E - ldrsh r1, [r6, r0] - movs r2, 0x38 - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _0810700A - ldr r0, =sub_8107018 - str r0, [r6, 0x1C] - strh r5, [r6, 0x2E] - adds r0, r6, 0 - bl oamt_add_pos2_onto_pos1 - movs r0, 0x5 - strh r0, [r6, 0x32] - strh r5, [r6, 0x36] - strh r5, [r6, 0x34] - adds r0, r6, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim -_0810700A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8106F60 - - thumb_func_start sub_8107018 -sub_8107018: @ 8107018 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - ble _08107032 - movs r0, 0 - strh r0, [r1, 0x2E] - ldr r0, =sub_810703C - str r0, [r1, 0x1C] -_08107032: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8107018 - - thumb_func_start sub_810703C -sub_810703C: @ 810703C - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x34] - adds r0, r1, r2 - strh r0, [r4, 0x34] - strh r0, [r4, 0x26] - adds r1, 0x1 - strh r1, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x30 - ble _08107066 - lsls r0, r1, 16 - cmp r0, 0 - ble _08107066 - ldrh r0, [r4, 0x36] - subs r1, r0, 0x5 - strh r1, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x36] -_08107066: - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _08107098 - movs r2, 0x32 - ldrsh r1, [r4, r2] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r0, r4, 0 - bl DestroyAnimSprite -_08107098: - movs r1, 0x36 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bne _081070A6 - adds r0, r4, 0 - bl DestroyAnimSprite -_081070A6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810703C - - thumb_func_start sub_81070AC -sub_81070AC: @ 81070AC - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081070F8 - ldr r4, =gBattleAnimAttacker - ldrb r1, [r4] - movs r0, 0x2 - eors r0, r1 - bl IsBattlerSpriteVisible - lsls r0, 24 - cmp r0, 0 - beq _081070F8 - ldrb r0, [r4] - adds r2, r5, 0 - adds r2, 0x20 - adds r3, r5, 0 - adds r3, 0x22 - movs r1, 0 - bl SetAverageBattlerPositions - ldrh r0, [r5, 0x22] - adds r0, 0x28 - strh r0, [r5, 0x22] - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - b _08107118 - .pool -_081070F8: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x28 - strh r0, [r5, 0x22] -_08107118: - movs r0, 0xD - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x22] - subs r0, 0x48 - strh r0, [r5, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r5, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81070AC - - thumb_func_start AnimTask_IsFuryCutterHitRight -AnimTask_IsFuryCutterHitRight: @ 8107144 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gBattleAnimArgs - ldr r1, =gAnimDisableStructPtr - ldr r1, [r1] - ldrb r2, [r1, 0x10] - movs r1, 0x1 - ands r1, r2 - strh r1, [r3, 0xE] - bl DestroyAnimVisualTask - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_IsFuryCutterHitRight - - thumb_func_start AnimTask_GetFuryCutterHitCount -AnimTask_GetFuryCutterHitCount: @ 8107168 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gBattleAnimArgs - ldr r1, =gAnimDisableStructPtr - ldr r1, [r1] - ldrb r1, [r1, 0x10] - strh r1, [r2, 0xE] - bl DestroyAnimVisualTask - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_GetFuryCutterHitCount - - .align 2, 0 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index ca338ac9b..bc04e3993 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -2987,7 +2987,7 @@ Move_FLASH: end Move_SPLASH: - createvisualtask sub_8104938, 2, 0, 3 + createvisualtask AnimTask_Splash, 2, 0, 3 delay 8 loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 38, 3 waitforvisualfinish @@ -3066,7 +3066,7 @@ Move_SKETCH: createsprite gUnknown_085936D4, ANIM_TARGET, 2 waitforvisualfinish clearmonbg ANIM_TARGET - createvisualtask sub_8104938, 2, 0, 2 + createvisualtask AnimTask_Splash, 2, 0, 2 loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 38, 2 end @@ -4008,7 +4008,7 @@ Move_TEETER_DANCE: Move_MUD_SPORT: loadspritegfx ANIM_TAG_MUD_SAND - createvisualtask sub_8104938, 2, 0, 6 + createvisualtask AnimTask_Splash, 2, 0, 6 delay 24 createsprite gUnknown_085971E4, ANIM_TARGET, 2, 0, -4, -16 createsprite gUnknown_085971E4, ANIM_TARGET, 2, 0, 4, -12 diff --git a/include/battle_anim.h b/include/battle_anim.h index e6540630a..4a88aaa8f 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -138,6 +138,12 @@ void sub_80A70C0(struct Sprite *sprite); void TranslateMonBGUntil(struct Sprite *sprite); void TranslateSpriteOverDuration(struct Sprite *sprite); void sub_80A77C8(struct Sprite *sprite); +void sub_80A7000(struct Sprite *sprite); +void sub_80A62EC(struct Sprite *sprite); +void sub_80A750C(u16 a1, bool8 a2); +void sub_80A7CFC(struct Task *task, u8 a2, const void *a3); +bool8 sub_80A7D34(struct Task *task); +void sub_80A78AC(struct Sprite *sprite); enum { diff --git a/include/graphics.h b/include/graphics.h index 33a26068b..a7ee286b8 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4372,6 +4372,9 @@ extern const u32 gBattleAnimSpriteSheet_280[]; extern const u32 gBattleAnimSpriteSheet_281[]; extern const u32 gBattleAnimSpriteSheet_282[]; extern const u32 gBattleAnimSpriteSheet_283[]; +extern const u32 gBattleAnimBackgroundTilemap_ScaryFacePlayer[]; +extern const u32 gBattleAnimBackgroundTilemap_ScaryFaceOpponent[]; +extern const u32 gBattleAnimBackgroundTilemap_ScaryFaceContest[]; extern const u32 gBattleAnimSpriteSheet_284[]; extern const u32 gBattleAnimSpriteSheet_285[]; @@ -4584,10 +4587,15 @@ extern const u32 gBattleAnimSpritePalette_209[]; extern const u32 gBattleAnimSpritePalette_210[]; extern const u32 gBattleAnimSpritePalette_211[]; extern const u32 gBattleAnimSpritePalette_215[]; +extern const u32 gUnknown_08C249D0[]; +extern const u32 gUnknown_08C249F8[]; extern const u32 gBattleAnimSpritePalette_216[]; extern const u32 gBattleAnimSpritePalette_217[]; extern const u32 gBattleAnimSpritePalette_218[]; extern const u32 gBattleAnimSpritePalette_219[]; +extern const u32 gUnknown_08C232E0; +extern const u32 gUnknown_08C23D50; +extern const u32 gUnknown_08C23D78; extern const u32 gBattleAnimSpritePalette_220[]; extern const u32 gBattleAnimSpritePalette_221[]; extern const u32 gBattleAnimSpritePalette_222[]; diff --git a/include/math_util.h b/include/math_util.h new file mode 100755 index 000000000..6b0d42460 --- /dev/null +++ b/include/math_util.h @@ -0,0 +1,14 @@ +#ifndef GUARD_MATH_UTIL_H +#define GUARD_MATH_UTIL_H + +s16 sub_8151534(s16 x, s16 y); +s16 sub_8151550(u8 s, s16 x, s16 y); +s32 sub_8151574(s32 x, s32 y); +s16 sub_81515B0(s16 x, s16 y); +s16 sub_81515D4(u8 s, s16 x, s16 y); +s32 sub_81515FC(s32 x, s32 y); +s16 sub_8151624(s16 y); +s16 sub_815163C(u8 s, s16 y); +s32 sub_815165C(s32 y); + +#endif // GUARD_MATH_UTIL_H diff --git a/ld_script.txt b/ld_script.txt index fcf362aa1..4fcd17bce 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -158,7 +158,7 @@ SECTIONS { asm/contest_link_80FC4F4.o(.text); src/item_use.o(.text); src/battle_anim_effects_1.o(.text); - asm/battle_anim_effects_2.o(.text); + src/battle_anim_effects_2.o(.text); asm/water.o(.text); src/fire.o(.text); src/electric.o(.text); @@ -484,7 +484,7 @@ SECTIONS { src/rotating_gate.o(.rodata); src/item_use.o(.rodata); src/battle_anim_effects_1.o(.rodata); - src/effects_2.o(.rodata); + src/battle_anim_effects_2.o(.rodata); src/water.o(.rodata); src/fire.o(.rodata); src/electric.o(.rodata); diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 78e0608e1..9b43092bc 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -1,9 +1,15 @@ #include "global.h" +#include "alloc.h" #include "battle_anim.h" #include "battle_interface.h" +#include "decompress.h" #include "gpu_regs.h" +#include "graphics.h" +#include "main.h" +#include "math_util.h" #include "palette.h" #include "random.h" +#include "scanline_effect.h" #include "sound.h" #include "trig.h" #include "util.h" @@ -2795,7 +2801,6 @@ void sub_80FF698(struct Sprite* sprite) switch (sprite->data[0]) { case 0: - { if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) gBattleAnimArgs[0] *= -1; @@ -2804,9 +2809,7 @@ void sub_80FF698(struct Sprite* sprite) sprite->invisible = 1; sprite->data[0]++; break; - } case 1: - { sprite->invisible = 0; if (sprite->affineAnimEnded) { @@ -2819,7 +2822,6 @@ void sub_80FF698(struct Sprite* sprite) break; } } - } } void sub_80FF768(struct Sprite* sprite) diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c new file mode 100755 index 000000000..ba2ee3723 --- /dev/null +++ b/src/battle_anim_effects_2.c @@ -0,0 +1,3845 @@ +#include "global.h" +#include "alloc.h" +#include "battle_anim.h" +#include "battle_interface.h" +#include "decompress.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "main.h" +#include "math_util.h" +#include "palette.h" +#include "random.h" +#include "scanline_effect.h" +#include "sound.h" +#include "trig.h" +#include "util.h" +#include "constants/rgb.h" +#include "constants/songs.h" + +extern void sub_8108C94(struct Sprite *); +extern void sub_810310C(u8, struct Sprite *); + +void sub_8103448(struct Sprite *); +void sub_8103498(struct Sprite *); +void sub_810358C(struct Sprite *); +void sub_8103620(struct Sprite *); +void sub_81037D8(struct Sprite *); +void sub_810387C(struct Sprite *); +void AnimSonicBoomProjectile(struct Sprite *); +void sub_8103AA4(struct Sprite *); +void sub_8103FE8(struct Sprite *); +void sub_8104088(struct Sprite *); +void sub_810413C(struct Sprite *); +void sub_81041C4(struct Sprite *); +void sub_8104304(struct Sprite *); +void sub_8104364(struct Sprite *); +void sub_8104414(struct Sprite *); +void sub_8104B1C(struct Sprite *); +void sub_8104BAC(struct Sprite *); +void sub_810501C(struct Sprite *); +void sub_81051C4(struct Sprite *); +void sub_81052A4(struct Sprite *); +void sub_81054E8(struct Sprite *); +void sub_8105538(struct Sprite *); +void sub_8105C48(struct Sprite *); +void sub_8105DE8(struct Sprite *); +void sub_8105E60(struct Sprite *); +void sub_8106140(struct Sprite *); +void sub_81061C4(struct Sprite *); +void sub_810624C(struct Sprite *); +void AnimOrbitFast(struct Sprite *); +void AnimOrbitScatter(struct Sprite *); +void sub_8106944(struct Sprite *); +void sub_81069B8(struct Sprite *); +void sub_81069D0(struct Sprite *); +void sub_8106AD0(struct Sprite *); +void sub_8106B54(struct Sprite *); +void sub_8106C80(struct Sprite *); +void sub_8106CD0(struct Sprite *); +void sub_8106E00(struct Sprite *); +void sub_8106F00(struct Sprite *); +void sub_8106F60(struct Sprite *); +void sub_81070AC(struct Sprite *); +static void sub_81034D8(struct Sprite *); +static void sub_8103658(struct Sprite *); +static void sub_8103680(struct Sprite *); +static void sub_81036DC(u8); +static void sub_81038A0(struct Sprite *); +static void sub_8104018(struct Sprite *); +static void sub_8104154(struct Sprite *); +static void sub_810421C(struct Sprite *); +static void sub_81042A0(struct Sprite *); +static void sub_81043F8(struct Sprite *); +static void sub_81044BC(struct Sprite *); +static void sub_8104530(struct Sprite *); +static void sub_8104594(struct Sprite *); +static void sub_8104614(u8); +static void sub_81046CC(u8); +static void sub_8104800(struct Task *, u8); +static void sub_81048F0(struct Sprite *); +static void AnimTask_SplashStep(u8); +static void sub_8104AF0(u8); +static void sub_8104C78(u8); +static void sub_8104D28(u8); +static void sub_8104F54(u8); +static void sub_8105078(struct Sprite *); +static void sub_810557C(struct Sprite *); +static void sub_81055F4(struct Sprite *); +static void sub_810561C(struct Sprite *); +static void sub_8105694(struct Sprite *); +static void sub_81056D4(struct Sprite *); +static void sub_810571C(struct Sprite *); +static void sub_810575C(struct Sprite *); +static void sub_81057B8(u8); +static void sub_8105878(u8); +static void sub_81059E0(u8); +static void sub_8105B08(u8); +static void sub_8105F30(u8); +static void sub_8105F84(u8); +static void sub_810618C(struct Sprite *); +static void sub_810627C(struct Sprite *); +static void sub_81063A8(u8); +static void sub_81065EC(u8); +static void AnimOrbitFastStep(struct Sprite *); +static void AnimOrbitScatterStep(struct Sprite *); +static void sub_8106D5C(struct Sprite *); +static void sub_8106DD4(u8); +static void sub_8106EC8(struct Sprite *); +static void sub_8107018(struct Sprite *); +static void sub_810703C(struct Sprite *); + +const struct SpriteTemplate gUnknown_08593264 = +{ + .tileTag = ANIM_TAG_FINGER, + .paletteTag = ANIM_TAG_FINGER, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8103448, +}; + +const union AnimCmd gUnknown_0859327C[] = +{ + ANIMCMD_FRAME(4, 1), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593284[] = +{ + gUnknown_0859327C, +}; + +const struct SpriteTemplate gUnknown_08593288 = +{ + .tileTag = ANIM_TAG_MUSIC_NOTES, + .paletteTag = ANIM_TAG_MUSIC_NOTES, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8103498, +}; + +const struct SpriteTemplate gUnknown_085932A0 = +{ + .tileTag = 0, + .paletteTag = 0, + .oam = &gDummyOamData, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_810358C, +}; + +extern const union AffineAnimCmd *const gUnknown_08597060[]; +const struct SpriteTemplate gUnknown_085932B8 = +{ + .tileTag = ANIM_TAG_CLAMP, + .paletteTag = ANIM_TAG_CLAMP, + .oam = &gUnknown_08524A9C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08597060, + .callback = sub_8103620, +}; + +const union AnimCmd gUnknown_085932D0[] = +{ + ANIMCMD_FRAME(0, 9), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085932E4[] = +{ + gUnknown_085932D0, +}; + +const union AffineAnimCmd gUnknown_085932E8[] = +{ + AFFINEANIMCMD_FRAME(0x50, 0x50, 0, 0), + AFFINEANIMCMD_FRAME(0x9, 0x9, 0, 18), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_08593300[] = +{ + gUnknown_085932E8, +}; + +const struct SpriteTemplate gUnknown_08593304 = +{ + .tileTag = ANIM_TAG_UNUSED_EXPLOSION, + .paletteTag = ANIM_TAG_UNUSED_EXPLOSION, + .oam = &gUnknown_08524974, + .anims = gUnknown_085932E4, + .images = NULL, + .affineAnims = gUnknown_08593300, + .callback = sub_80A77C8, +}; + +const union AnimCmd gUnknown_0859331C[] = +{ + ANIMCMD_FRAME(0, 3, .hFlip = TRUE), + ANIMCMD_FRAME(8, 3, .hFlip = TRUE), + ANIMCMD_FRAME(16, 3, .hFlip = TRUE), + ANIMCMD_FRAME(24, 3, .hFlip = TRUE), + ANIMCMD_FRAME(32, 3, .hFlip = TRUE), + ANIMCMD_FRAME(40, 3, .hFlip = TRUE), + ANIMCMD_FRAME(48, 3, .hFlip = TRUE), + ANIMCMD_LOOP(1), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593340[] = +{ + gUnknown_0859331C, +}; + +const struct SpriteTemplate gUnknown_08593344 = +{ + .tileTag = ANIM_TAG_ALERT, + .paletteTag = ANIM_TAG_ALERT, + .oam = &gUnknown_08524934, + .anims = gUnknown_08593340, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81037D8, +}; + +const union AffineAnimCmd gUnknown_0859335C[] = +{ + AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0x14, 0x0, 0, 12), + AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 32), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_0859337C[] = +{ + gUnknown_0859335C, +}; + +const struct SpriteTemplate gBattleAnimSpriteTemplate_8593380 = +{ + .tileTag = ANIM_TAG_SWORD, + .paletteTag = ANIM_TAG_SWORD, + .oam = &gUnknown_08524ADC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_0859337C, + .callback = sub_810387C, +}; + +const struct SpriteTemplate gSonicBoomSpriteTemplate = +{ + .tileTag = ANIM_TAG_AIR_WAVE, + .paletteTag = ANIM_TAG_AIR_WAVE, + .oam = &gUnknown_08524B14, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSonicBoomProjectile, +}; + +const struct SpriteTemplate gUnknown_085933B0 = +{ + .tileTag = ANIM_TAG_AIR_WAVE, + .paletteTag = ANIM_TAG_AIR_WAVE, + .oam = &gUnknown_08524A54, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8103AA4, +}; + +const union AffineAnimCmd gUnknown_085933C8[] = +{ + AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 0), + AFFINEANIMCMD_FRAME(0x7, 0x7, 0, -56), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085933E0[] = +{ + AFFINEANIMCMD_FRAME(0x5, 0x5, 0, 10), + AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10), + AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10), + AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10), + AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10), + AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10), + AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_08593420[] = +{ + gUnknown_085933C8, +}; + +const union AffineAnimCmd *const gUnknown_08593424[] = +{ + gUnknown_085933E0, +}; + +const struct SpriteTemplate gSupersonicWaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_GOLD_RING, + .paletteTag = ANIM_TAG_GOLD_RING, + .oam = &gUnknown_08524A14, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593420, + .callback = TranslateAnimSpriteToTargetMonLocation, +}; + +const struct SpriteTemplate gScreechWaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_RING, + .paletteTag = ANIM_TAG_PURPLE_RING, + .oam = &gUnknown_08524A14, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593420, + .callback = TranslateAnimSpriteToTargetMonLocation, +}; + +const struct SpriteTemplate gUnknown_08593458 = +{ + .tileTag = ANIM_TAG_METAL_SOUND_WAVES, + .paletteTag = ANIM_TAG_METAL_SOUND_WAVES, + .oam = &gUnknown_08524A1C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593420, + .callback = TranslateAnimSpriteToTargetMonLocation, +}; + +const struct SpriteTemplate gUnknown_08593470 = +{ + .tileTag = ANIM_TAG_BLUE_RING_2, + .paletteTag = ANIM_TAG_BLUE_RING_2, + .oam = &gUnknown_08524A14, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593424, + .callback = sub_8108C94, +}; + +const struct SpriteTemplate gUnknown_08593488 = +{ + .tileTag = ANIM_TAG_LARGE_FRESH_EGG, + .paletteTag = ANIM_TAG_LARGE_FRESH_EGG, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A78AC, +}; + +const struct SpriteTemplate gUnknown_085934A0 = +{ + .tileTag = ANIM_TAG_UNUSED_VOID_LINES, + .paletteTag = ANIM_TAG_UNUSED_VOID_LINES, + .oam = &gUnknown_08524A3C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8103FE8, +}; + +const union AnimCmd gUnknown_085934B8[] = +{ + ANIMCMD_FRAME(8, 1), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085934C0[] = +{ + gUnknown_085934B8, +}; + +const union AffineAnimCmd gUnknown_085934C4[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x0, 10, 1), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085934D4[] = +{ + gUnknown_085934C4, +}; + +const struct SpriteTemplate gUnknown_085934D8 = +{ + .tileTag = ANIM_TAG_COIN, + .paletteTag = ANIM_TAG_COIN, + .oam = &gUnknown_0852496C, + .anims = gUnknown_085934C0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8104088, +}; + +const struct SpriteTemplate gUnknown_085934F0 = +{ + .tileTag = ANIM_TAG_COIN, + .paletteTag = ANIM_TAG_COIN, + .oam = &gUnknown_0852496C, + .anims = gUnknown_085934C0, + .images = NULL, + .affineAnims = gUnknown_085934D4, + .callback = sub_810413C, +}; + +const union AffineAnimCmd gUnknown_08593508[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x0, 20, 1), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_08593518[] = +{ + gUnknown_08593508, +}; + +const struct SpriteTemplate gUnknown_0859351C = +{ + .tileTag = ANIM_TAG_SEED, + .paletteTag = ANIM_TAG_SEED, + .oam = &gUnknown_0852496C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593518, + .callback = sub_81041C4, +}; + +const union AffineAnimCmd gUnknown_08593534[] = +{ + AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0x4, 0x0, 0, 40), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_0859354C[] = +{ + gUnknown_08593534, +}; + +const struct SpriteTemplate gUnknown_08593550 = +{ + .tileTag = ANIM_TAG_GUST, + .paletteTag = ANIM_TAG_GUST, + .oam = &gUnknown_085249BC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_0859354C, + .callback = sub_8104304, +}; + +const union AnimCmd gUnknown_08593568[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 20), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_08593578[] = +{ + ANIMCMD_FRAME(0, 3, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(16, 3, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(32, 20, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593588[] = +{ + gUnknown_08593568, + gUnknown_08593578, +}; + +const struct SpriteTemplate gUnknown_08593590 = +{ + .tileTag = ANIM_TAG_CUT, + .paletteTag = ANIM_TAG_CUT, + .oam = &gUnknown_08524A34, + .anims = gUnknown_08593588, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8104364, +}; + +const union AnimCmd gUnknown_085935A8[] = +{ + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(16, 2), + ANIMCMD_FRAME(32, 1), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_085935B8[] = +{ + ANIMCMD_FRAME(0, 2, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(16, 2, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(32, 1, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085935C8[] = +{ + gUnknown_085935A8, + gUnknown_085935B8, +}; + +const struct SpriteTemplate gUnknown_085935D0 = +{ + .tileTag = ANIM_TAG_CUT, + .paletteTag = ANIM_TAG_CUT, + .oam = &gUnknown_08524A34, + .anims = gUnknown_085935C8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8104414, +}; + +const union AffineAnimCmd gUnknown_085935E8[] = +{ + AFFINEANIMCMD_FRAME(-6, 4, 0, 8), + AFFINEANIMCMD_FRAME(10, -10, 0, 8), + AFFINEANIMCMD_FRAME(-4, 6, 0, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_08593608[] = +{ + AFFINEANIMCMD_FRAME(-4, -5, 0, 12), + AFFINEANIMCMD_FRAME(0, 0, 0, 24), + AFFINEANIMCMD_FRAME(4, 5, 0, 12), + AFFINEANIMCMD_END, +}; + +const union AnimCmd gUnknown_08593628[] = +{ + ANIMCMD_FRAME(0, 4, .hFlip = TRUE), + ANIMCMD_FRAME(4, 40, .hFlip = TRUE), + ANIMCMD_FRAME(8, 4, .hFlip = TRUE), + ANIMCMD_FRAME(12, 4, .hFlip = TRUE), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_0859363C[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(4, 40), + ANIMCMD_FRAME(8, 4), + ANIMCMD_FRAME(12, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593650[] = +{ + gUnknown_08593628, + gUnknown_0859363C, +}; + +const struct SpriteTemplate gUnknown_08593658 = +{ + .tileTag = ANIM_TAG_BREATH, + .paletteTag = ANIM_TAG_BREATH, + .oam = &gUnknown_0852490C, + .anims = gUnknown_08593650, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8104B1C, +}; + +const union AffineAnimCmd gUnknown_08593670[] = +{ + AFFINEANIMCMD_FRAME(0xB, 0xB, 0, 8), + AFFINEANIMCMD_FRAME(0xFFF5, 0xFFF5, 0, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_08593688[] = +{ + gUnknown_08593670, +}; + +const struct SpriteTemplate gUnknown_0859368C = +{ + .tileTag = ANIM_TAG_ANGER, + .paletteTag = ANIM_TAG_ANGER, + .oam = &gUnknown_0852496C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593688, + .callback = sub_8104BAC, +}; + +const union AffineAnimCmd gUnknown_085936A4[] = +{ + AFFINEANIMCMD_FRAME(-10, 9, 0, 7), + AFFINEANIMCMD_FRAME(20, -20, 0, 7), + AFFINEANIMCMD_FRAME(-20, 20, 0, 7), + AFFINEANIMCMD_FRAME(10, -9, 0, 7), + AFFINEANIMCMD_LOOP(2), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085936D4 = +{ + .tileTag = ANIM_TAG_PENCIL, + .paletteTag = ANIM_TAG_PENCIL, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_810501C, +}; + +const struct SpriteTemplate gUnknown_085936EC = +{ + .tileTag = ANIM_TAG_SNORE_Z, + .paletteTag = ANIM_TAG_SNORE_Z, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A7938, +}; + +const union AnimCmd gUnknown_08593704[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(16, 5), + ANIMCMD_FRAME(32, 5), + ANIMCMD_FRAME(48, 5), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593718[] = +{ + gUnknown_08593704, +}; +//* +const struct SpriteTemplate gBattleAnimSpriteTemplate_859371C = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_EXPLOSION, + .oam = &gUnknown_08524914, + .anims = gUnknown_08593718, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const union AffineAnimCmd gUnknown_08593734[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 2), + AFFINEANIMCMD_FRAME(0x0, 0x0, 8, 4), + AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 2), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_08593754[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_08593764[] = +{ + AFFINEANIMCMD_FRAME(0xFFF8, 0x4, 0, 8), + AFFINEANIMCMD_LOOP(0), + AFFINEANIMCMD_FRAME(0x10, 0xFFF8, 0, 8), + AFFINEANIMCMD_FRAME(0xFFF0, 0x8, 0, 8), + AFFINEANIMCMD_LOOP(1), + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 15), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085937A4[] = +{ + gUnknown_08593734, + gUnknown_08593754, + gUnknown_08593764, +}; +//* +const struct SpriteTemplate gUnknown_085937B0 = +{ + .tileTag = ANIM_TAG_BREAKING_EGG, + .paletteTag = ANIM_TAG_BREAKING_EGG, + .oam = &gUnknown_08524AF4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085937A4, + .callback = sub_8105538, +}; + +const union AffineAnimCmd gUnknown_085937C8[] = +{ + AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0), + AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 30), + AFFINEANIMCMD_END_ALT(1), +}; + +const union AffineAnimCmd gUnknown_085937E0[] = +{ + AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0), + AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 15), + AFFINEANIMCMD_END_ALT(1), +}; + +const union AffineAnimCmd gUnknown_085937F8[] = +{ + AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0), + AFFINEANIMCMD_FRAME(0xB, 0xB, 0, 45), + AFFINEANIMCMD_END_ALT(1), +}; + +const union AffineAnimCmd *const gUnknown_08593810[] = +{ + gUnknown_085937C8, + gUnknown_085937E0, +}; + +const union AffineAnimCmd *const gUnknown_08593818[] = +{ + gUnknown_085937F8, +}; + +const struct SpriteTemplate gUnknown_0859381C = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_THIN_RING, + .oam = &gUnknown_085249DC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593810, + .callback = sub_80A77C8, +}; +//* +const union AffineAnimCmd gUnknown_08593834[] = +{ + AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), + AFFINEANIMCMD_FRAME(0xFFF0, 0xFFF0, 0, 30), + AFFINEANIMCMD_END_ALT(1), +}; + +const union AffineAnimCmd *const gUnknown_0859384C[] = +{ + gUnknown_08593834, +}; + +const struct SpriteTemplate gUnknown_08593850 = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_THIN_RING, + .oam = &gUnknown_08524AFC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_0859384C, + .callback = sub_80A77C8, +}; + +const struct SpriteTemplate gUnknown_08593868 = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_THIN_RING, + .oam = &gUnknown_08524AFC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593810, + .callback = sub_81051C4, +}; + +const struct SpriteTemplate gUnknown_08593880 = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_THIN_RING, + .oam = &gUnknown_08524AFC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593818, + .callback = sub_81052A4, +}; + +const struct SpriteTemplate gBattleAnimSpriteTemplate_8593898 = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_THIN_RING, + .oam = &gUnknown_08524AFC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593810, + .callback = sub_81054E8, +}; + +const union AffineAnimCmd gUnknown_085938B0[] = +{ + AFFINEANIMCMD_FRAME(96, -13, 0, 8), + AFFINEANIMCMD_END, +}; + +const union AnimCmd gUnknown_085938C0[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(4, 3), + ANIMCMD_FRAME(8, 3), + ANIMCMD_FRAME(4, 3), + ANIMCMD_FRAME(0, 3), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085938D8[] = +{ + gUnknown_085938C0, +}; + +const struct SpriteTemplate gUnknown_085938DC = +{ + .tileTag = ANIM_TAG_SPEED_DUST, + .paletteTag = ANIM_TAG_SPEED_DUST, + .oam = &gUnknown_0852490C, + .anims = gUnknown_085938D8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8105C48, +}; + +const s8 gUnknown_085938F4[][2] = +{ + {30, 28}, + {-20, 24}, + {16, 26}, + {-10, 28}, +}; + +const union AnimCmd gUnknown_085938FC[] = +{ + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(16, 6), + ANIMCMD_FRAME(32, 15), + ANIMCMD_FRAME(16, 6), + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(16, 6, .hFlip = TRUE), + ANIMCMD_FRAME(32, 15, .hFlip = TRUE), + ANIMCMD_FRAME(16, 6, .hFlip = TRUE), + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(16, 6), + ANIMCMD_FRAME(32, 15), + ANIMCMD_FRAME(16, 6), + ANIMCMD_FRAME(0, 6), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593934[] = +{ + gUnknown_085938FC, +}; + +const struct SpriteTemplate gUnknown_08593938 = +{ + .tileTag = ANIM_TAG_BELL, + .paletteTag = ANIM_TAG_BELL, + .oam = &gUnknown_08524914, + .anims = gUnknown_08593934, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const u16 gUnknown_08593950[] = +{ + ANIM_TAG_MUSIC_NOTES_2, + ANIM_SPRITES_START - 1, + ANIM_SPRITES_START - 2, +}; + +const struct SpriteTemplate gUnknown_08593958 = +{ + .tileTag = ANIM_TAG_MUSIC_NOTES_2, + .paletteTag = ANIM_TAG_MUSIC_NOTES_2, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8105DE8, +}; + +const struct SpriteTemplate gUnknown_08593970 = +{ + .tileTag = ANIM_TAG_MAGENTA_HEART, + .paletteTag = ANIM_TAG_MAGENTA_HEART, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8105E60, +}; + +const union AffineAnimCmd gUnknown_08593988[] = +{ + AFFINEANIMCMD_FRAME(0x000A, 0xFFF3, 0x00, 0x0A), + AFFINEANIMCMD_FRAME(0xFFF6, 0x000D, 0x00, 0x0A), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085939A0 = +{ + .tileTag = ANIM_TAG_RED_HEART, + .paletteTag = ANIM_TAG_RED_HEART, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8106140, +}; + +const struct SpriteTemplate gBattleAnimSpriteTemplate_85939B8 = +{ + .tileTag = ANIM_TAG_RED_HEART, + .paletteTag = ANIM_TAG_RED_HEART, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81061C4, +}; + +const struct SpriteTemplate gUnknown_085939D0 = +{ + .tileTag = ANIM_TAG_RED_HEART, + .paletteTag = ANIM_TAG_RED_HEART, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_810624C, +}; + +const union AffineAnimCmd gUnknown_085939E8[] = +{ + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(0x8, 0x8, 0, 1), + AFFINEANIMCMD_JUMP(1), +}; + +const union AffineAnimCmd *const gUnknown_08593A00[] = +{ + gUnknown_085939E8, +}; + +const struct SpriteTemplate gHiddenPowerOrbSpriteTemplate = +{ + .tileTag = ANIM_TAG_RED_ORB, + .paletteTag = ANIM_TAG_RED_ORB, + .oam = &gUnknown_0852496C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593A00, + .callback = AnimOrbitFast, +}; + +const struct SpriteTemplate gHiddenPowerOrbScatterSpriteTemplate = +{ + .tileTag = ANIM_TAG_RED_ORB, + .paletteTag = ANIM_TAG_RED_ORB, + .oam = &gUnknown_085249CC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593A00, + .callback = AnimOrbitScatter, +}; + +const union AffineAnimCmd gUnknown_08593A34[] = +{ + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(0x8, 0x8, 0, 1), + AFFINEANIMCMD_JUMP(1), +}; + +const union AffineAnimCmd *const gUnknown_08593A4C[] = +{ + gUnknown_08593A34, +}; + +const struct SpriteTemplate gUnknown_08593A50 = +{ + .tileTag = ANIM_TAG_RED_ORB_2, + .paletteTag = ANIM_TAG_RED_ORB_2, + .oam = &gUnknown_085249C4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593A4C, + .callback = sub_8106944, +}; + +const union AnimCmd gUnknown_08593A68[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(8, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(0, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593A80[] = +{ + gUnknown_08593A68, +}; + +const struct SpriteTemplate gUnknown_08593A84 = +{ + .tileTag = ANIM_TAG_EYE_SPARKLE, + .paletteTag = ANIM_TAG_EYE_SPARKLE, + .oam = &gUnknown_0852490C, + .anims = gUnknown_08593A80, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81069B8, +}; + +const union AnimCmd gUnknown_08593A9C[] = +{ + ANIMCMD_FRAME(0, 24), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593AA4[] = +{ + gUnknown_08593A9C, +}; + +const struct SpriteTemplate gUnknown_08593AA8 = +{ + .tileTag = ANIM_TAG_ANGEL, + .paletteTag = ANIM_TAG_ANGEL, + .oam = &gUnknown_08524914, + .anims = gUnknown_08593AA4, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81069D0, +}; + +const struct SpriteTemplate gUnknown_08593AC0 = +{ + .tileTag = ANIM_TAG_PINK_HEART, + .paletteTag = ANIM_TAG_PINK_HEART, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8106AD0, +}; + +const union AnimCmd gUnknown_08593AD8[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_08593AE0[] = +{ + ANIMCMD_FRAME(16, 3), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd *const gUnknown_08593AE8[] = +{ + gUnknown_08593AD8, + gUnknown_08593AE0, +}; + +const struct SpriteTemplate gUnknown_08593AF0 = +{ + .tileTag = ANIM_TAG_DEVIL, + .paletteTag = ANIM_TAG_DEVIL, + .oam = &gUnknown_08524914, + .anims = gUnknown_08593AE8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8106B54, +}; + +const union AnimCmd gUnknown_08593B08[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(16, 4), + ANIMCMD_FRAME(32, 4), + ANIMCMD_FRAME(48, 4), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_08593B1C[] = +{ + ANIMCMD_FRAME(0, 4, .hFlip = TRUE), + ANIMCMD_FRAME(16, 4, .hFlip = TRUE), + ANIMCMD_FRAME(32, 4, .hFlip = TRUE), + ANIMCMD_FRAME(48, 4, .hFlip = TRUE), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593B30[] = +{ + gUnknown_08593B08, + gUnknown_08593B1C, +}; + +const struct SpriteTemplate gUnknown_08593B38 = +{ + .tileTag = ANIM_TAG_SWIPE, + .paletteTag = ANIM_TAG_SWIPE, + .oam = &gUnknown_08524914, + .anims = gUnknown_08593B30, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8106C80, +}; + +const union AnimCmd gUnknown_08593B50[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(16, 8), + ANIMCMD_FRAME(32, 8), + ANIMCMD_FRAME(16, 8), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_08593B64[] = +{ + ANIMCMD_FRAME(16, 8, .hFlip = TRUE), + ANIMCMD_FRAME(32, 8, .hFlip = TRUE), + ANIMCMD_FRAME(16, 8, .hFlip = TRUE), + ANIMCMD_FRAME(0, 8, .hFlip = TRUE), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_08593B78[] = +{ + gUnknown_08593B50, + gUnknown_08593B64, +}; + +const struct SpriteTemplate gUnknown_08593B80 = +{ + .tileTag = ANIM_TAG_MOVEMENT_WAVES, + .paletteTag = ANIM_TAG_MOVEMENT_WAVES, + .oam = &gUnknown_08524914, + .anims = gUnknown_08593B78, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8106CD0, +}; + +const union AffineAnimCmd gUnknown_08593B98[] = +{ + AFFINEANIMCMD_FRAME(-12, 8, 0, 4), + AFFINEANIMCMD_FRAME(20, -20, 0, 4), + AFFINEANIMCMD_FRAME(-8, 12, 0, 4), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gBattleAnimSpriteTemplate_8593BB8 = +{ + .tileTag = ANIM_TAG_JAGGED_MUSIC_NOTE, + .paletteTag = ANIM_TAG_JAGGED_MUSIC_NOTE, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8106E00, +}; + +const union AffineAnimCmd gUnknown_08593BD0[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 5), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_08593BE0[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 16), + AFFINEANIMCMD_END_ALT(1), +}; + +const union AffineAnimCmd gUnknown_08593BF0[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x0, 8, 16), + AFFINEANIMCMD_END_ALT(1), +}; + +const union AffineAnimCmd *const gUnknown_08593C00[] = +{ + gUnknown_08593BD0, + gUnknown_08593BE0, + gUnknown_08593BF0, +}; + +extern const union AnimCmd *const gUnknown_08592FCC[]; +const struct SpriteTemplate gUnknown_08593C0C = +{ + .tileTag = ANIM_TAG_MUSIC_NOTES_2, + .paletteTag = ANIM_TAG_MUSIC_NOTES_2, + .oam = &gUnknown_0852496C, + .anims = gUnknown_08592FCC, + .images = NULL, + .affineAnims = gUnknown_08593C00, + .callback = sub_8106F60, +}; + +const struct SpriteTemplate gUnknown_08593C24 = +{ + .tileTag = ANIM_TAG_MUSIC_NOTES_2, + .paletteTag = ANIM_TAG_MUSIC_NOTES_2, + .oam = &gUnknown_0852496C, + .anims = gUnknown_08592FCC, + .images = NULL, + .affineAnims = gUnknown_08593C00, + .callback = sub_8106F00, +}; + +const union AffineAnimCmd gUnknown_08593C3C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_08593C4C[] = +{ + AFFINEANIMCMD_FRAME(0x200, 0x100, 0, 0), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_08593C5C[] = +{ + gUnknown_08593C3C, + gUnknown_08593C4C, +}; + +const struct SpriteTemplate gUnknown_08593C64 = +{ + .tileTag = ANIM_TAG_GUARD_RING, + .paletteTag = ANIM_TAG_GUARD_RING, + .oam = &gUnknown_08524B1C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08593C5C, + .callback = sub_81070AC, +}; + +void sub_8103448(struct Sprite *sprite) +{ + sub_80A6838(sprite); + sub_80A6864(sprite, gBattleAnimArgs[0]); + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[2] = gBattleAnimArgs[4]; + sprite->data[3] = gBattleAnimArgs[5]; + sprite->data[4] = gBattleAnimArgs[3]; + StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + sprite->callback = sub_80A6450; + sprite->callback(sprite); +} + +void sub_8103498(struct Sprite *sprite) +{ + u8 battler; + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + sub_810310C(battler, sprite); + sprite->data[0] = 0; + sprite->data[1] = 0; + sprite->callback = sub_81034D8; +} + +static void sub_81034D8(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos2.y -= 3; + if (++sprite->data[1] == 6) + sprite->data[0]++; + break; + case 1: + sprite->pos2.y += 3; + if (--sprite->data[1] == 0) + sprite->data[0]++; + break; + case 2: + if (++sprite->data[1] == 64) + DestroyAnimSprite(sprite); + break; + } +} + +static void sub_810353C(struct Sprite *sprite) +{ + s16 temp; + gSprites[sprite->data[2]].pos2.x += sprite->data[1]; + temp = sprite->data[1]; + sprite->data[1] = -temp; + if (sprite->data[0] == 0) + { + gSprites[sprite->data[2]].pos2.x = 0; + move_anim_8074EE0(sprite); + } + + sprite->data[0]--; +} + +void sub_810358C(struct Sprite *sprite) +{ + u8 spriteId; + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + spriteId = gBattlerSpriteIds[gBattleAnimTarget]; + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos1.x -= gBattleAnimArgs[0]; + else + sprite->pos1.x += gBattleAnimArgs[0]; + + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = gBattleAnimArgs[3]; + sprite->data[2] = spriteId; + sprite->callback = sub_810353C; + sprite->invisible = 1; +} + +void sub_8103620(struct Sprite *sprite) +{ + InitAnimSpritePos(sprite, 1); + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = gBattleAnimArgs[3]; + sprite->data[5] = gBattleAnimArgs[4]; + sprite->callback = WaitAnimForDuration; + StoreSpriteCallbackInData6(sprite, sub_8103658); +} + +static void sub_8103658(struct Sprite *sprite) +{ + sprite->data[0] = sprite->data[1]; + sprite->data[2] = sprite->pos1.x; + sprite->data[4] = sprite->pos1.y + 15; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, sub_8103680); +} + +static void sub_8103680(struct Sprite *sprite) +{ + if (sprite->data[5] == 0) + DestroyAnimSprite(sprite); + else + sprite->data[5]--; +} + +void sub_81036A0(u8 taskId) +{ + sub_80A7270(gBattlerSpriteIds[gBattleAnimAttacker], 0); + gTasks[taskId].func = sub_81036DC; +} + +static void sub_81036DC(u8 taskId) +{ + u8 spriteId = gBattlerSpriteIds[gBattleAnimAttacker]; + s16 rotation; + if (GetBattlerSide(gBattleAnimAttacker) == 0) + rotation = -gTasks[taskId].data[0]; + else + rotation = gTasks[taskId].data[0]; + + obj_id_set_rotscale(spriteId, 0x100, 0x100, rotation); + if (gTasks[taskId].data[1] == 0) + { + gTasks[taskId].data[0] += 0xB0; + gSprites[spriteId].pos2.y++; + } + else if (gTasks[taskId].data[1] == 1) + { + if (++gTasks[taskId].data[3] == 30) + gTasks[taskId].data[1] = 2; + + return; + } + else + { + gTasks[taskId].data[0] -= 0xB0; + gSprites[spriteId].pos2.y--; + } + + sub_80A73A0(spriteId); + if (gTasks[taskId].data[0] == 0xF20 || gTasks[taskId].data[0] == 0) + { + if (gTasks[taskId].data[1] == 2) + { + sub_80A7344(spriteId); + DestroyAnimVisualTask(taskId); + } + else + { + gTasks[taskId].data[1]++; + } + } +} + +void sub_81037D8(struct Sprite *sprite) +{ + sub_80A6838(sprite); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos1.x -= gBattleAnimArgs[0]; + else + sprite->pos1.x += gBattleAnimArgs[0]; + + sprite->pos1.y += gBattleAnimArgs[1]; + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + sprite->hFlip = 1; + if (gBattleAnimArgs[2]) + sprite->vFlip = 1; + } + else + { + if (gBattleAnimArgs[2]) + sprite->vFlip = 1; + } + + sprite->callback = sub_80A67D8; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void sub_810387C(struct Sprite *sprite) +{ + InitAnimSpritePos(sprite, 0); + sprite->callback = sub_80A67BC; + StoreSpriteCallbackInData6(sprite, sub_81038A0); +} + +static void sub_81038A0(struct Sprite *sprite) +{ + sprite->data[0] = 6; + sprite->data[2] = sprite->pos1.x; + sprite->data[4] = sprite->pos1.y - 32; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +// Moves a projectile towards the target mon. The sprite is rotated to be pointing +// in the same direction it's moving. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: target x pixel offset +// arg 3: target y pixel offset +// arg 4: duration +void AnimSonicBoomProjectile(struct Sprite *sprite) +{ + s16 targetXPos; + s16 targetYPos; + u16 rotation; + + if (IsContest()) + { + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + } + else if (GetBattlerSide(gBattleAnimAttacker) != 0) + { + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + gBattleAnimArgs[1] = -gBattleAnimArgs[1]; + gBattleAnimArgs[3] = -gBattleAnimArgs[3]; + } + + InitAnimSpritePos(sprite, 1); + targetXPos = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; + targetYPos = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + rotation = ArcTan2Neg(targetXPos - sprite->pos1.x, targetYPos - sprite->pos1.y); + rotation += 0xF000; + if (IsContest()) + rotation -= 0x6000; + + sub_80A73E0(sprite, 0, 0x100, 0x100, rotation); + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[2] = targetXPos; + sprite->data[4] = targetYPos; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +static void sub_81039CC(struct Sprite *sprite) +{ + if (sprite->data[0]-- <= 0) + { + gTasks[sprite->data[7]].data[1]--; + DestroySprite(sprite); + } +} + +static void sub_8103A00(struct Sprite *sprite) +{ + struct Task* task = &gTasks[sprite->data[7]]; + if (sprite->data[0] > task->data[5]) + { + sprite->data[5] += sprite->data[3]; + sprite->data[6] += sprite->data[4]; + } + else + { + sprite->data[5] -= sprite->data[3]; + sprite->data[6] -= sprite->data[4]; + } + + sprite->data[1] += sprite->data[5]; + sprite->data[2] += sprite->data[6]; + if (1 & task->data[7]) + sprite->pos2.x = ((u16)sprite->data[1] >> 8) * -1; + else + sprite->pos2.x = (u16)sprite->data[1] >> 8; + + if (1 & task->data[8]) + sprite->pos2.y = ((u16)sprite->data[2] / 256u) * -1; + else + sprite->pos2.y = (u16)sprite->data[2] / 256u; + + if (sprite->data[0]-- <= 0) + { + sprite->data[0] = 30; + sprite->callback = sub_81039CC; + } +} + +void sub_8103AA4(struct Sprite *sprite) +{ + s16 a; + s16 b; + s16 c; + + struct Task* task = &gTasks[sprite->data[7]]; + sprite->data[1] += (-2 & task->data[7]); + sprite->data[2] += (-2 & task->data[8]); + if (1 & task->data[7]) + sprite->pos2.x = ((u16)sprite->data[1] >> 8) * -1; + else + sprite->pos2.x = (u16)sprite->data[1] >> 8; + + if (1 & task->data[8]) + sprite->pos2.y = ((u16)sprite->data[2] / 256u) * -1; + else + sprite->pos2.y = (u16)sprite->data[2] / 256u; + + if (sprite->data[0]-- <= 0) + { + sprite->data[0] = 8; + task->data[5] = 4; + a = sub_8151624(0x1000); + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + if (task->data[11] >= sprite->pos1.x) + b = (task->data[11] - sprite->pos1.x) << 8; + else + b = (sprite->pos1.x - task->data[11]) << 8; + + if (task->data[12] >= sprite->pos1.y) + c = (task->data[12] - sprite->pos1.y) << 8; + else + c = (sprite->pos1.y - task->data[12]) << 8; + + sprite->data[2] = 0; + sprite->data[1] = 0; + sprite->data[6] = 0; + sprite->data[5] = 0; + sprite->data[3] = sub_8151534(sub_8151534(b, a), sub_8151624(0x1C0)); + sprite->data[4] = sub_8151534(sub_8151534(c, a), sub_8151624(0x1C0)); + sprite->callback = sub_8103A00; + } +} + +static void sub_8103BE4(u8 taskId) +{ + if (gTasks[taskId].data[1] == 0) + DestroyAnimVisualTask(taskId); +} + +static void sub_8103C0C(u8 taskId) +{ + if (gTasks[taskId].data[0]-- <= 0) + { + u8 spriteId; + struct Sprite *sprite; + spriteId = CreateSprite(&gUnknown_085933B0, gTasks[taskId].data[9], gTasks[taskId].data[10], gTasks[taskId].data[2] - gTasks[taskId].data[1]); + sprite = &gSprites[spriteId]; + switch (gTasks[taskId].data[4]) + { + case 1: + sprite->oam.matrixNum |= 24; + break; + case 2: + sprite->oam.matrixNum = 8; + break; + } + + sprite->data[0] = gTasks[taskId].data[5] - gTasks[taskId].data[6]; + sprite->data[7] = taskId; + gTasks[taskId].data[gTasks[taskId].data[1] + 13] = spriteId; + gTasks[taskId].data[0] = gTasks[taskId].data[3]; + gTasks[taskId].data[1]++; + PlaySE12WithPanning(SE_W059B, BattleAnimAdjustPanning(-63)); + if (gTasks[taskId].data[1] > 2) + gTasks[taskId].func = sub_8103BE4; + } +} + +void sub_8103CF0(u8 taskId) +{ + s16 r9 = 0; + s16 r6 = 0; + s16 sp1 = 0; + s16 sp2 = 0; + s16 r4; + + if (IsContest()) + { + gTasks[taskId].data[4] = 2; + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + if (gBattleAnimArgs[2] & 1) + gBattleAnimArgs[2] &= ~1; + else + gBattleAnimArgs[2] |= 1; + } + else + { + if ((gBattlerPositions[gBattleAnimTarget] & 1) == 0) + { + gTasks[taskId].data[4] = 1; + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + gBattleAnimArgs[1] = -gBattleAnimArgs[1]; + if (gBattleAnimArgs[2] & 1) + gBattleAnimArgs[2] &= ~1; + else + gBattleAnimArgs[2] |= 1; + } + } + + r6 = gTasks[taskId].data[9] = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + r9 = gTasks[taskId].data[10] = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + && IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimTarget))) + { + SetAverageBattlerPositions(gBattleAnimTarget, 0, &sp1, &sp2); + } + else + { + sp1 = GetBattlerSpriteCoord(gBattleAnimTarget, 0); + sp2 = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + } + + sp1 = gTasks[taskId].data[11] = sp1 + gBattleAnimArgs[0]; + sp2 = gTasks[taskId].data[12] = sp2 + gBattleAnimArgs[1]; + if (sp1 >= r6) + r4 = sp1 - r6; + else + r4 = r6 - sp1; + + gTasks[taskId].data[5] = sub_8151534(r4, sub_8151624(gBattleAnimArgs[2] & ~1)); + gTasks[taskId].data[6] = sub_8151534(gTasks[taskId].data[5], 0x80); + gTasks[taskId].data[7] = gBattleAnimArgs[2]; + if (sp2 >= r9) + { + r4 = sp2 - r9; + gTasks[taskId].data[8] = sub_8151534(r4, sub_8151624(gTasks[taskId].data[5])) & ~1; + } + else + { + r4 = r9 - sp2; + gTasks[taskId].data[8] = sub_8151534(r4, sub_8151624(gTasks[taskId].data[5])) | 1; + } + + gTasks[taskId].data[3] = gBattleAnimArgs[3]; + if (gBattleAnimArgs[4] & 0x80) + { + gBattleAnimArgs[4] ^= 0x80; + if (gBattleAnimArgs[4] >= 64) + { + u16 var = sub_80A82E4(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64); + gTasks[taskId].data[2] = var; + } + else + { + u16 var = sub_80A82E4(gBattleAnimTarget) - gBattleAnimArgs[4]; + gTasks[taskId].data[2] = var; + } + } + else + { + if (gBattleAnimArgs[4] >= 64) + { + u16 var = sub_80A82E4(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64); + gTasks[taskId].data[2] = var; + } + else + { + u16 var = sub_80A82E4(gBattleAnimTarget) - gBattleAnimArgs[4]; + gTasks[taskId].data[2] = var; + } + } + + if (gTasks[taskId].data[2] < 3) + gTasks[taskId].data[2] = 3; + + gTasks[taskId].func = sub_8103C0C; +} + +void sub_8103FE8(struct Sprite *sprite) +{ + InitAnimSpritePos(sprite, 0); + sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(gUnknown_085934A0.paletteTag) << 4); + sprite->callback = sub_8104018; +} + +#ifdef NONMATCHING +static void sub_8104018(struct Sprite *sprite) +{ + u16 r7; + u16 r5; + int i; + if (++sprite->data[1] == 2) + { + sprite->data[1] = 0; + r5 = sprite->data[0]; + r7 = gPlttBufferFaded[8 + r5]; + for (i = 0; i < 8; i++) + { + gPlttBufferFaded[i + r5 + 8] = gPlttBufferFaded[i + r5 + 9]; + } + gPlttBufferFaded[r5 + 15] = r7; + + if (++sprite->data[2] == 24) + DestroyAnimSprite(sprite); + } +} +#else +NAKED +static void sub_8104018(struct Sprite *sprite) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + adds r4, r0, 0\n\ + ldrh r0, [r4, 0x30]\n\ + adds r0, 0x1\n\ + strh r0, [r4, 0x30]\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x2\n\ + bne _0810407C\n\ + movs r0, 0\n\ + strh r0, [r4, 0x30]\n\ + ldrh r5, [r4, 0x2E]\n\ + ldr r1, =gPlttBufferFaded\n\ + adds r0, r5, 0\n\ + adds r0, 0x8\n\ + lsls r0, 1\n\ + adds r0, r1 \n\ + ldrh r7, [r0]\n\ + adds r6, r1, 0\n\ + adds r1, r5, 0\n\ + adds r1, 0x9\n\ + lsls r0, r5, 1\n\ + adds r0, r6\n\ + adds r2, r0, 0\n\ + adds r2, 0x10\n\ + movs r3, 0x7\n\ + lsls r1, 1\n\ + adds r1, r6\n\ +_08104050:\n\ + ldrh r0, [r1]\n\ + strh r0, [r2]\n\ + adds r1, 0x2\n\ + adds r2, 0x2\n\ + subs r3, 0x1\n\ + cmp r3, 0\n\ + bge _08104050\n\ + adds r0, r5, 0\n\ + adds r0, 0xF\n\ + lsls r0, 1\n\ + adds r0, r6\n\ + strh r7, [r0]\n\ + ldrh r0, [r4, 0x32]\n\ + adds r0, 0x1\n\ + strh r0, [r4, 0x32]\n\ + lsls r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x18\n\ + bne _0810407C\n\ + adds r0, r4, 0\n\ + bl DestroyAnimSprite\n\ +_0810407C:\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ +.syntax divided\n"); +} +#endif + +void sub_8104088(struct Sprite *sprite) +{ + s16 r6; + s16 r7; + u16 var; + + InitAnimSpritePos(sprite, 1); + r6 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + r7 = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + + r6 += gBattleAnimArgs[2]; + var = ArcTan2Neg(r6 - sprite->pos1.x, r7 - sprite->pos1.y); + var += 0xC000; + sub_80A73E0(sprite, 0, 0x100, 0x100, var); + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[2] = r6; + sprite->data[4] = r7; + sprite->callback = sub_80A7000; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void sub_810413C(struct Sprite *sprite) +{ + sprite->data[2] = -16; + sprite->pos1.y += 8; + sprite->callback = sub_8104154; +} + +static void sub_8104154(struct Sprite *sprite) +{ + sprite->data[0] += 0x80; + sprite->pos2.x = sprite->data[0] >> 8; + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + sprite->pos2.x = -sprite->pos2.x; + + sprite->pos2.y = Sin(sprite->data[1], sprite->data[2]); + sprite->data[1] += 5; + if (sprite->data[1] > 126) + { + sprite->data[1] = 0; + sprite->data[2] /= 2; + if (++sprite->data[3] == 2) + DestroyAnimSprite(sprite); + } +} + +void sub_81041C4(struct Sprite *sprite) +{ + InitAnimSpritePos(sprite, 1); + sprite->data[0] = 20; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->callback = StartAnimLinearTranslation; + sprite->affineAnimPaused = 1; + StoreSpriteCallbackInData6(sprite, sub_810421C); +} + +static void sub_810421C(struct Sprite *sprite) +{ + int i; + u16 rand; + s16* ptr; + PlaySE12WithPanning(SE_W030, BattleAnimAdjustPanning(63)); + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + ptr = &sprite->data[7]; + for (i = 0; i < 8; i++) + ptr[i - 7] = 0; + + rand = Random2(); + sprite->data[6] = 0xFFF4 - (rand & 7); + rand = Random2(); + sprite->data[7] = (rand % 0xA0) + 0xA0; + sprite->callback = sub_81042A0; + sprite->affineAnimPaused = 0; +} + +static void sub_81042A0(struct Sprite *sprite) +{ + sprite->data[0] += sprite->data[7]; + sprite->pos2.x = sprite->data[0] >> 8; + if (sprite->data[7] & 1) + sprite->pos2.x = -sprite->pos2.x; + + sprite->pos2.y = Sin(sprite->data[1], sprite->data[6]); + sprite->data[1] += 8; + if (sprite->data[1] > 126) + { + sprite->data[1] = 0; + sprite->data[2] /= 2; + if (++sprite->data[3] == 1) + DestroyAnimSprite(sprite); + } +} + +void sub_8104304(struct Sprite *sprite) +{ + InitAnimSpritePos(sprite, 0); + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + sprite->pos1.y += 16; + + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[2] = gBattleAnimArgs[5]; + sprite->data[3] = gBattleAnimArgs[6]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->callback = sub_80A62EC; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->callback(sprite); +} + +void sub_8104364(struct Sprite *sprite) +{ + s16 r7 = 32; + s16 r4 = -32; + s16 xDiff = 16; + s16 yDiff = -16; + if (gBattleAnimArgs[0]) + { + r7 = r4; + r4 = 32; + xDiff = yDiff; + yDiff = 16; + StartSpriteAnim(sprite, 1); + } + + sprite->pos1.x += r7; + sprite->pos1.y += r4; + sprite->data[0] = 6; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + xDiff; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + yDiff; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, sub_81043F8); +} + +static void sub_81043F8(struct Sprite *sprite) +{ + if (sprite->animEnded == 1) + DestroyAnimSprite(sprite); +} + +void sub_8104414(struct Sprite *sprite) +{ + s16 r8 = 32; + s16 r4 = -32; + s16 xDiff = 16; + s16 yDiff = -16; + if (gBattleAnimArgs[0] != 0) + { + r8 = r4; + r4 = 32; + xDiff = yDiff; + yDiff = 16; + StartSpriteAnim(sprite, gBattleAnimArgs[0]); + } + + sprite->pos1.x += r8; + sprite->pos1.y += r4; + sprite->data[0] = 6; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + xDiff; + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + yDiff; + InitAnimLinearTranslation(sprite); + sprite->data[5] = gBattleAnimArgs[0]; + sprite->data[6] = sprite->data[0]; + sprite->callback = sub_81044BC; +} + +static void sub_81044BC(struct Sprite *sprite) +{ + if (TranslateAnimLinear(sprite) && sprite->animEnded == 1) + { + SeekSpriteAnim(sprite, 0); + sprite->animPaused = 1; + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.x = 2; + sprite->pos2.y = -2; + sprite->data[0] = sprite->data[6]; + sprite->data[1] ^= 1; + sprite->data[2] ^= 1; + sprite->data[4] = 0; + sprite->data[3] = 0; + sprite->callback = sub_8104530; + } +} + +static void sub_8104530(struct Sprite *sprite) +{ + if (sprite->data[3]) + { + sprite->pos2.x = -sprite->pos2.x; + sprite->pos2.y = -sprite->pos2.y; + } + + sprite->data[3] ^= 1; + if (++sprite->data[4] == 51) + { + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data[4] = 0; + sprite->data[3] = 0; + sprite->animPaused = 0; + StartSpriteAnim(sprite, sprite->data[5] ^ 1); + sprite->callback = sub_8104594; + } +} + +static void sub_8104594(struct Sprite *sprite) +{ + if (TranslateAnimLinear(sprite)) + DestroyAnimSprite(sprite); +} + +void sub_81045B0(u8 taskId) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + sub_80A7270(spriteId, 1); + obj_id_set_rotscale(spriteId, 0xD0, 0xD0, 0); + sub_80A750C(gSprites[spriteId].oam.paletteNum + 16, 0); + gTasks[taskId].data[0] = 80; + gTasks[taskId].func = sub_8104614; +} + +static void sub_8104614(u8 taskId) +{ + if (--gTasks[taskId].data[0] == -1) + { + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + sub_80A7344(spriteId); + sub_80A750C(gSprites[spriteId].oam.paletteNum + 16, 1); + DestroyAnimVisualTask(taskId); + } +} + +void sub_8104674(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->data[0] = spriteId; + sub_80A7270(spriteId, 0); + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[4] = 0x100; + task->data[5] = 0; + task->data[6] = 0; + task->data[7] = sub_80A82E4(gBattleAnimAttacker); + task->func = sub_81046CC; +} + +static void sub_81046CC(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + switch (task->data[1]) + { + case 0: + if (task->data[2] == 0 || task->data[2] == 3 || task->data[2] == 6) + sub_8104800(task, taskId); + task->data[2]++; + task->data[4] += 0x28; + obj_id_set_rotscale(task->data[0], task->data[4], task->data[4], 0); + sub_80A7E6C(task->data[0]); + if (task->data[2] == 32) + { + task->data[5]++; + task->data[1]++; + } + break; + case 1: + if (task->data[6] == 0) + { + if (task->data[5] == 3) + { + task->data[2] = 0; + task->data[1] = 3; + } + else + { + task->data[2] = 0; + task->data[3] = 0; + task->data[4] = 0x100; + obj_id_set_rotscale(task->data[0], task->data[4], task->data[4], 0); + sub_80A7E6C(task->data[0]); + task->data[1] = 2; + } + } + break; + case 2: + task->data[1] = 0; + break; + case 3: + if (++task->data[2] > 32) + { + task->data[2] = 0; + task->data[1]++; + } + break; + case 4: + task->data[2] += 2; + task->data[4] -= 0x50; + obj_id_set_rotscale(task->data[0], task->data[4], task->data[4], 0); + sub_80A7E6C(task->data[0]); + if (task->data[2] == 32) + { + task->data[2] = 0; + task->data[1]++; + } + break; + case 5: + sub_80A7344(task->data[0]); + gSprites[task->data[15]].pos2.y = 0; + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_8104800(struct Task* task, u8 taskId) +{ + u16 matrixNum; + s16 spriteId = duplicate_obj_of_side_rel2move_in_transparent_mode(0); + if (spriteId >= 0) + { + if ((matrixNum = AllocOamMatrix()) == 0xFF) + { + obj_delete_but_dont_free_vram(&gSprites[spriteId]); + } + else + { + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; + gSprites[spriteId].affineAnimPaused = TRUE; + gSprites[spriteId].oam.matrixNum = matrixNum; + gSprites[spriteId].subpriority = task->data[7] - task->data[3]; + task->data[3]++; + task->data[6]++; + gSprites[spriteId].data[0] = 16; + gSprites[spriteId].data[1] = taskId; + gSprites[spriteId].data[2] = 6; + gSprites[spriteId].callback = sub_81048F0; + obj_id_set_rotscale(spriteId, task->data[4], task->data[4], 0); + gSprites[spriteId].oam.affineMode = 1; + CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); + } + } +} + +static void sub_81048F0(struct Sprite *sprite) +{ + if (--sprite->data[0] == 0) + { + gTasks[sprite->data[1]].data[sprite->data[2]]--; + FreeOamMatrix(sprite->oam.matrixNum); + obj_delete_but_dont_free_vram(sprite); + } +} + +// Task to facilitate expanding and hopping effect seen in Splash. +// arg 0: anim battler +// arg 1: num hops +void AnimTask_Splash(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + if (gBattleAnimArgs[1] == 0) + { + DestroyAnimVisualTask(taskId); + } + else + { + u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + task->data[0] = spriteId; + task->data[1] = 0; + task->data[2] = gBattleAnimArgs[1]; + task->data[3] = 0; + task->data[4] = 0; + sub_80A7CFC(task, spriteId, &gUnknown_085935E8); + task->func = AnimTask_SplashStep; + } +} + +static void AnimTask_SplashStep(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + switch (task->data[1]) + { + case 0: + sub_80A7D34(task); + task->data[4] += 3; + gSprites[task->data[0]].pos2.y += task->data[4]; + if (++task->data[3] > 7) + { + task->data[3] = 0; + task->data[1]++; + } + break; + case 1: + sub_80A7D34(task); + gSprites[task->data[0]].pos2.y += task->data[4]; + if (++task->data[3] > 7) + { + task->data[3] = 0; + task->data[1]++; + } + break; + case 2: + if (task->data[4] != 0) + { + gSprites[task->data[0]].pos2.y -= 2; + task->data[4] -= 2; + } + else + task->data[1]++; + break; + case 3: + if (!sub_80A7D34(task)) + { + if (--task->data[2] == 0) + { + gSprites[task->data[0]].pos2.y = 0; + DestroyAnimVisualTask(taskId); + } + else + { + sub_80A7CFC(task, task->data[0], &gUnknown_085935E8); + task->data[1] = 0; + } + } + break; + } +} + +void sub_8104AB4(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + sub_80A7CFC(task, spriteId, &gUnknown_08593608); + task->func = sub_8104AF0; +} + +static void sub_8104AF0(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + if (!sub_80A7D34(task)) + DestroyAnimVisualTask(taskId); +} + +void sub_8104B1C(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) == 0) + { + StartSpriteAnim(sprite, 0); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + 32; + sprite->data[1] = 64; + } + else + { + StartSpriteAnim(sprite, 1); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) - 32; + sprite->data[1] = -64; + } + + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[0] = 52; + sprite->data[2] = 0; + sprite->data[3] = 0; + sprite->data[4] = 0; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->callback = sub_80A656C; +} + +void sub_8104BAC(struct Sprite *sprite) +{ + u8 battler; + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + if (GetBattlerSide(battler) == B_SIDE_OPPONENT) + gBattleAnimArgs[1] *= -1; + + sprite->pos1.x = GetBattlerSpriteCoord(battler, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[2]; + if (sprite->pos1.y < 8) + sprite->pos1.y = 8; + + StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + sprite->callback = sub_80A67BC; +} + +// left/right movements +void sub_8104C38(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->data[0] = spriteId; + task->data[1] = 0; + sub_80A7CFC(task, spriteId, &gUnknown_085936A4); + task->func = sub_8104C78; +} + +static void sub_8104C78(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + if (!sub_80A7D34(task)) + DestroyAnimVisualTask(taskId); +} + +// up/down movements +void sub_8104CA4(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + task->data[0] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->data[1] = 0; + task->data[2] = 4; + task->data[3] = 7; + task->data[4] = 3; + task->data[5] = gSprites[task->data[0]].pos1.x; + task->data[6] = gSprites[task->data[0]].pos1.y; + task->data[7] = 0; + task->data[8] = 0; + task->data[9] = 2; + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + task->data[2] *= -1; + + task->func = sub_8104D28; +} + +static void sub_8104D28(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + if (++task->data[7] > 2) + { + task->data[7] = 0; + task->data[8]++; + if (task->data[8] & 1) + gSprites[task->data[0]].pos1.y += task->data[9]; + else + gSprites[task->data[0]].pos1.y -= task->data[9]; + } + switch (task->data[1]) + { + case 0: + gSprites[task->data[0]].pos1.x += task->data[2]; + if (--task->data[3] == 0) + { + task->data[3] = 14; + task->data[1] = 1; + } + break; + case 1: + gSprites[task->data[0]].pos1.x -= task->data[2]; + if (--task->data[3] == 0) + { + task->data[3] = 7; + task->data[1] = 2; + } + break; + case 2: + gSprites[task->data[0]].pos1.x += task->data[2]; + if (--task->data[3] == 0) + { + if (--task->data[4] != 0) + { + task->data[3] = 7; + task->data[1] = 0; + } + else + { + if ((task->data[8] & 1) != 0) + gSprites[task->data[0]].pos1.y -= task->data[9]; + + DestroyAnimVisualTask(taskId); + } + } + break; + } +} + +void sub_8104E74(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + struct ScanlineEffectParams params; + + s16 i; + task->data[0] = GetBattlerYCoordWithElevation(gBattleAnimTarget) + 32; + task->data[1] = 4; + task->data[2] = 0; + task->data[3] = 0; + task->data[4] = 0; + task->data[5] = 0; + task->data[15] = sub_80A861C(gBattleAnimTarget, 0); + + if (sub_80A8364(gBattleAnimTarget) == 1) + { + task->data[6] = gBattle_BG1_X; + params.dmaDest = (u16 *)REG_ADDR_BG1HOFS; + } + else + { + task->data[6] = gBattle_BG2_X; + params.dmaDest = (u16 *)REG_ADDR_BG2HOFS; + } + + for (i = task->data[0] - 0x40; i <= task->data[0]; i++) + { + if (i >= 0) + { + gScanlineEffectRegBuffers[0][i] = task->data[6] + 0xF0; + gScanlineEffectRegBuffers[1][i] = task->data[6] + 0xF0; + } + } + + params.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; + params.initState = 1; + params.unused9 = 0; + ScanlineEffect_SetParams(params); + task->func = sub_8104F54; +} + +static void sub_8104F54(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + + switch (task->data[4]) + { + case 0: + if (++task->data[5] > 20) + task->data[4]++; + break; + case 1: + if (++task->data[1] > 3) + { + task->data[1] = 0; + task->data[2] = task->data[3] & 3; + task->data[5] = task->data[0] - task->data[3]; + switch (task->data[2]) + { + case 0: + break; + case 1: + task->data[5] -= 2; + break; + case 2: + task->data[5] += 1; + break; + case 3: + task->data[5] += 1; + break; + } + + if (task->data[5] >= 0) + { + gScanlineEffectRegBuffers[0][task->data[5]] = task->data[6]; + gScanlineEffectRegBuffers[1][task->data[5]] = task->data[6]; + } + + if (++task->data[3] >= task->data[15]) + { + gScanlineEffect.state = 3; + DestroyAnimVisualTask(taskId); + } + } + break; + } +} + +void sub_810501C(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) - 16; + sprite->pos1.y = GetBattlerYCoordWithElevation(gBattleAnimTarget) + 16; + sprite->data[0] = 0; + sprite->data[1] = 0; + sprite->data[2] = 0; + sprite->data[3] = 16; + sprite->data[4] = 0; + sprite->data[5] = sub_80A861C(gBattleAnimTarget, 0) + 2; + sprite->data[6] = BattleAnimAdjustPanning(63); + sprite->callback = sub_8105078; +} + +static void sub_8105078(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (++sprite->data[2] > 1) + { + sprite->data[2] = 0; + sprite->invisible = !sprite->invisible; + } + if (++sprite->data[1] > 16) + { + sprite->invisible = 0; + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[1] > 3 && sprite->data[2] < sprite->data[5]) + { + sprite->data[1] = 0; + sprite->pos1.y -= 1; + sprite->data[2]++; + if (sprite->data[2] % 10 == 0) + PlaySE12WithPanning(SE_W166, sprite->data[6]); + } + sprite->data[4] += sprite->data[3]; + if (sprite->data[4] > 31) + { + sprite->data[4] = 0x40 - sprite->data[4]; + sprite->data[3] *= -1; + } + else if (sprite->data[4] <= -32) + { + sprite->data[4] = -0x40 - sprite->data[4]; + sprite->data[3] *= -1; + } + sprite->pos2.x = sprite->data[4]; + if (sprite->data[5] == sprite->data[2]) + { + sprite->data[1] = 0; + sprite->data[2] = 0; + sprite->data[0]++; + } + break; + case 2: + if (++sprite->data[2] > 1) + { + sprite->data[2] = 0; + sprite->invisible = !sprite->invisible; + } + if (++sprite->data[1] > 16) + { + sprite->invisible = 0; + DestroyAnimSprite(sprite); + } + break; + } +} + +void sub_81051C4(struct Sprite *sprite) +{ + u8 battler = 0; + u16 sp0 = 0; + u16 sp1 = 0; + u8 r4; + + if (gBattleAnimArgs[2] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + r4 = gBattleAnimArgs[3] ^ 1; + if (IsDoubleBattle() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler))) + { + SetAverageBattlerPositions(battler, r4, &sp0, &sp1); + if (r4 == 0) + r4 = GetBattlerSpriteCoord(battler, 0); + else + r4 = GetBattlerSpriteCoord(battler, 2); + + if (GetBattlerSide(battler) != B_SIDE_PLAYER) + gBattleAnimArgs[0] -= (sp0 - r4) - gBattleAnimArgs[0]; // This is weird. + else + gBattleAnimArgs[0] = sp0 - r4; + } + + sprite->callback = sub_80A77C8; + sprite->callback(sprite); +} + +void sub_8105284(struct Sprite *sprite) +{ + if (TranslateAnimLinear(sprite)) + { + FreeSpriteOamMatrix(sprite); + DestroyAnimSprite(sprite); + } +} + +void sub_81052A4(struct Sprite *sprite) +{ + u16 r9 = 0; + u16 r6 = 0; + s16 sp0 = 0; + s16 sp1 = 0; + u8 sp4; + u8 battler1; + u8 battler2; + u8 r10; + + if (gBattleAnimArgs[5] == 0) + { + battler1 = gBattleAnimAttacker; + battler2 = gBattleAnimTarget; + } + else + { + battler1 = gBattleAnimTarget; + battler2 = gBattleAnimAttacker; + } + + if (!gBattleAnimArgs[6]) + { + r10 = 0; + sp4 = 1; + } + else + { + r10 = 2; + sp4 = 3; + } + + if (GetBattlerSide(battler1) != B_SIDE_PLAYER) + { + r9 = GetBattlerSpriteCoord(battler1, r10) + gBattleAnimArgs[0]; + if (IsBattlerSpriteVisible(BATTLE_PARTNER(battler2))) + sprite->subpriority = gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battler2)]].subpriority - 1; + else + sprite->subpriority = gSprites[gBattlerSpriteIds[battler2]].subpriority - 1; + } + else + { + r9 = GetBattlerSpriteCoord(battler1, r10) - gBattleAnimArgs[0]; + if (!IsContest() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler1))) + { + if (gSprites[gBattlerSpriteIds[battler1]].pos1.x < gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battler1)]].pos1.x) + sprite->subpriority = gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battler1)]].subpriority + 1; + else + sprite->subpriority = gSprites[gBattlerSpriteIds[battler1]].subpriority - 1; + } + else + { + sprite->subpriority = gSprites[gBattlerSpriteIds[battler1]].subpriority - 1; + } + + } + + r6 = GetBattlerSpriteCoord(battler1, sp4) + gBattleAnimArgs[1]; + if (!IsContest() && IsBattlerSpriteVisible(BATTLE_PARTNER(battler2))) + { + SetAverageBattlerPositions(battler2, gBattleAnimArgs[6], &sp0, &sp1); + } + else + { + sp0 = GetBattlerSpriteCoord(battler2, r10); + sp1 = GetBattlerSpriteCoord(battler2, sp4); + } + + if (GetBattlerSide(battler2)) + sp0 += gBattleAnimArgs[3]; + else + sp0 -= gBattleAnimArgs[3]; + + sp1 += gBattleAnimArgs[4]; + sprite->pos1.x = sprite->data[1] = r9; + sprite->pos1.y = sprite->data[3] = r6; + sprite->data[2] = sp0; + sprite->data[4] = sp1; + sprite->data[0] = gBattleAnimArgs[0]; + InitAnimLinearTranslation(sprite); + sprite->callback = sub_8105284; + sprite->callback(sprite); +} + +void sub_81054E8(struct Sprite *sprite) +{ + u8 index = IndexOfSpritePaletteTag(ANIM_TAG_THIN_RING); + if (index != 0xFF) + { + BlendPalette(((index << 20) + 0x1010000) >> 16, 15, gBattleAnimArgs[5], gBattleAnimArgs[4]); + } + + StartSpriteAffineAnim(sprite, 1); + sprite->callback = sub_80A77C8; + sprite->callback(sprite); +} + +void sub_8105538(struct Sprite *sprite) +{ + s16 r1; + InitAnimSpritePos(sprite, 0); + r1 = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? -160 : 160; + sprite->data[0] = 0x380; + sprite->data[1] = r1; + sprite->data[7] = gBattleAnimArgs[2]; + sprite->callback = sub_810557C; +} + +static void sub_810557C(struct Sprite *sprite) +{ + s16 add; + sprite->pos2.y -= (sprite->data[0] >> 8); + sprite->pos2.x = sprite->data[1] >> 8; + sprite->data[0] -= 32; + add = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? -160 : 160; + sprite->data[1] += add; + if (sprite->pos2.y > 0) + { + sprite->pos1.y += sprite->pos2.y; + sprite->pos1.x += sprite->pos2.x; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data[0] = 0; + StartSpriteAffineAnim(sprite, 1); + sprite->callback = sub_81055F4; + } +} + +static void sub_81055F4(struct Sprite *sprite) +{ + if (sprite->data[0]++ > 19) + { + StartSpriteAffineAnim(sprite, 2); + sprite->callback = sub_810561C; + } +} + +static void sub_810561C(struct Sprite *sprite) +{ + if (sprite->affineAnimEnded) + { + StartSpriteAffineAnim(sprite, 1); + sprite->data[0] = 0; + if (sprite->data[7] == 0) + { + sprite->oam.tileNum += 16; + sprite->callback = sub_8105694; + } + else + { + sprite->oam.tileNum += 32; + sprite->callback = sub_810571C; + } + } +} + +static void sub_8105694(struct Sprite *sprite) +{ + sprite->pos2.y -= 2; + if (++sprite->data[0] == 9) + { + sprite->data[0] = 16; + sprite->data[1] = 0; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND((u16)sprite->data[0], 0)); + sprite->callback = sub_81056D4; + } +} + +static void sub_81056D4(struct Sprite *sprite) +{ + if (sprite->data[1]++ % 3 == 0) + { + sprite->data[0]--; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[0], 16 - sprite->data[0])); + if (sprite->data[0] == 0) + sprite->callback = sub_810571C; + } +} + +static void sub_810571C(struct Sprite *sprite) +{ + if ((u16)gBattleAnimArgs[7] == 0xFFFF) + { + sprite->invisible = 1; + if (sprite->data[7] == 0) + sprite->callback = sub_810575C; + else + sprite->callback = DestroyAnimSprite; + } +} + +static void sub_810575C(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimSprite(sprite); +} + +void sub_810577C(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->data[0] = spriteId; + sub_80A7CFC(task, spriteId, &gUnknown_085938B0); + task->func = sub_81057B8; +} + +static void sub_81057B8(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + if (!sub_80A7D34(task)) + { + gSprites[task->data[0]].pos2.y = 0; + gSprites[task->data[0]].invisible = 1; + DestroyAnimVisualTask(taskId); + } +} + +void sub_8105810(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[12] = 3; + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + { + task->data[13] = 0xFFFF; + task->data[14] = 8; + } + else + { + task->data[13] = 1; + task->data[14] = -8; + } + + task->data[15] = GetAnimBattlerSpriteId(ANIM_TARGET); + task->func = sub_8105878; +} + +static void sub_8105878(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + gSprites[task->data[15]].pos2.x += task->data[14]; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[0]++; + break; + case 1: + if (++task->data[1] > 1) + { + task->data[1] = 0; + task->data[2]++; + if (task->data[2] & 1) + gSprites[task->data[15]].pos2.x += 6; + else + gSprites[task->data[15]].pos2.x -= 6; + + if (++task->data[3] > 4) + { + if (task->data[2] & 1) + gSprites[task->data[15]].pos2.x -= 6; + + task->data[0]++; + } + } + break; + case 2: + if (--task->data[12] != 0) + task->data[0] = 0; + else + task->data[0]++; + break; + case 3: + gSprites[task->data[15]].pos2.x += task->data[13]; + if (gSprites[task->data[15]].pos2.x == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_810599C(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[4] = 1; + task->data[13] = 14; + task->data[14] = 2; + task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->func = sub_81059E0; +} + +static void sub_81059E0(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + if (task->data[0] == 0 && ++task->data[1] > task->data[4]) + { + task->data[1] = 0; + if (++task->data[2] & 1) + gSprites[task->data[15]].invisible = 0; + else + gSprites[task->data[15]].invisible = 1; + + if (++task->data[3] >= task->data[13]) + { + if (++task->data[4] < task->data[14]) + { + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + } + else + { + gSprites[task->data[15]].invisible = 0; + DestroyAnimVisualTask(taskId); + } + } + } +} + +void sub_8105AAC(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + task->data[0] = 0; + task->data[1] = 4; + task->data[2] = 0; + task->data[3] = 0; + task->data[4] = 0; + task->data[5] = 0; + task->data[6] = 0; + task->data[7] = 0; + task->data[8] = 0; + task->data[13] = 0; + task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_ATTACKER); + task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, ANIM_TARGET); + task->func = sub_8105B08; +} + +static void sub_8105B08(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + switch (task->data[8]) + { + case 0: + if (++task->data[4] > 1) + { + task->data[4] = 0; + task->data[5] = (task->data[5] + 1) & 1; + if (++task->data[6] > 20) + { + if (task->data[7] == 0) + { + task->data[6] = 0; + task->data[8] = 1; + } + else + task->data[8] = 2; + } + } + break; + case 1: + task->data[5] = 0; + if (++task->data[4] > 20) + { + task->data[7] = 1; + task->data[8] = 0; + } + break; + case 2: + task->data[5] = 1; + break; + } + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 4) + { + u8 spriteId; + task->data[1] = 0; + spriteId = CreateSprite(&gUnknown_085938DC, task->data[14], task->data[15], 0); + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].data[0] = taskId; + gSprites[spriteId].data[1] = 13; + gSprites[spriteId].pos2.x = gUnknown_085938F4[task->data[2]][0]; + gSprites[spriteId].pos2.y = gUnknown_085938F4[task->data[2]][1]; + task->data[13]++; + if (++task->data[2] > 3) + { + task->data[2] = 0; + if (++task->data[3] > 5) + task->data[0]++; + } + } + } + break; + case 1: + if (task->data[13] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_8105C48(struct Sprite *sprite) +{ + sprite->invisible = gTasks[sprite->data[0]].data[5]; + if (sprite->animEnded) + { + gTasks[sprite->data[0]].data[sprite->data[1]]--; + DestroySprite(sprite); + } +} + +void sub_8105CB4(u8 taskId) +{ + int i; + u8 paletteNums[3]; + + paletteNums[0] = IndexOfSpritePaletteTag(ANIM_TAG_MUSIC_NOTES_2); + for (i = 1; i < 3; i++) + paletteNums[i] = AllocSpritePalette(ANIM_SPRITES_START - i); + + gMonSpritesGfxPtr->field_17C = AllocZeroed(0x2000); + LZDecompressWram(gBattleAnimSpritePalette_206, gMonSpritesGfxPtr->field_17C); + for (i = 0; i < 3; i++) + LoadPalette(&gMonSpritesGfxPtr->field_17C[i * 32], (u16)((paletteNums[i] << 4) + 0x100), 32); + + FREE_AND_SET_NULL(gMonSpritesGfxPtr->field_17C); + DestroyAnimVisualTask(taskId); +} + +void sub_8105D60(u8 taskId) +{ + int i; + for (i = 0; i < 3; i++) + FreeSpritePaletteByTag(gUnknown_08593950[i]); + + DestroyAnimVisualTask(taskId); +} + +static void sub_8105D88(struct Sprite *sprite, u8 a, u8 b) +{ + u8 tile; + tile = (b & 1); + tile = ((-tile | tile) >> 31) & 32; + sprite->oam.tileNum += tile + (a << 2); + sprite->oam.paletteNum = IndexOfSpritePaletteTag(gUnknown_08593950[b >> 1]); +} + +void sub_8105DE8(struct Sprite *sprite) +{ + InitAnimSpritePos(sprite, 0); + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[2]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + gBattleAnimArgs[3]; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sub_8105D88(sprite, gBattleAnimArgs[5], gBattleAnimArgs[6]); +} + +void sub_8105E60(struct Sprite *sprite) +{ + if (++sprite->data[0] == 1) + InitAnimSpritePos(sprite, 0); + + sprite->pos2.x = Sin(sprite->data[1], 8); + sprite->pos2.y = sprite->data[2] >> 8; + sprite->data[1] = (sprite->data[1] + 7) & 0xFF; + sprite->data[2] -= 0x80; + if (sprite->data[0] == 60) + DestroyAnimSprite(sprite); +} + +void sub_8105EB0(u8 taskId) +{ + u16 win0h = IsContest() ? 0x98 : 0xF0; + u16 win0v = 0; + + gBattle_WIN0H = win0h; + gBattle_WIN0V = 0xA0; + SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); + SetGpuReg(REG_OFFSET_WININ, 0x3F1F); + SetGpuReg(REG_OFFSET_WINOUT, 0x3F3F); + SetGpuReg(REG_OFFSET_BLDCNT, 0xC8); + SetGpuReg(REG_OFFSET_BLDY, 0x10); + gTasks[taskId].data[0] = win0v; + gTasks[taskId].data[1] = win0h; + gTasks[taskId].func = sub_8105F30; +} + +static void sub_8105F30(u8 taskId) +{ + gTasks[taskId].data[0] += 13; + gTasks[taskId].data[1] -= 13; + if (gTasks[taskId].data[0] >= gTasks[taskId].data[1]) + { + gBattle_WIN0H = 0; + gTasks[taskId].func = sub_8105F84; + } + else + { + gBattle_WIN0H = gTasks[taskId].data[1] | (gTasks[taskId].data[0] << 8); + } +} + +static void sub_8105F84(u8 taskId) +{ + if (++gTasks[taskId].data[10] == 5) + { + gTasks[taskId].data[11] = 0x88; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_LIGHTEN); + BlendPalettes(sub_80A75AC(1, 0, 0, 0, 0, 0, 0), 16, RGB(31, 31, 31)); + } + else if (gTasks[taskId].data[10] > 4) + { + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + DestroyAnimVisualTask(taskId); + } +} + +void sub_8106020(u8 taskId) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + if (++gTasks[taskId].data[0] == 1) + { + sub_80A7CFC(&gTasks[taskId], GetAnimBattlerSpriteId(1), &gUnknown_08593988); + gSprites[spriteId].pos2.x = 4; + } + else + { + gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; + if (!sub_80A7D34(&gTasks[taskId])) + { + gSprites[spriteId].pos2.x = 0; + gSprites[spriteId].pos2.y = 0; + DestroyAnimVisualTask(taskId); + } + } +} + +void sub_81060B0(u8 taskId) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + if (++gTasks[taskId].data[0] == 1) + { + sub_80A7CFC(&gTasks[taskId], GetAnimBattlerSpriteId(0), &gUnknown_08593988); + gSprites[spriteId].pos2.x = 4; + } + else + { + gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; + if (!sub_80A7D34(&gTasks[taskId])) + { + gSprites[spriteId].pos2.x = 0; + gSprites[spriteId].pos2.y = 0; + DestroyAnimVisualTask(taskId); + } + } +} + +void sub_8106140(struct Sprite *sprite) +{ + InitAnimSpritePos(sprite, 1); + sprite->data[0] = 95; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + InitAnimLinearTranslation(sprite); + sprite->callback = sub_810618C; +} + +static void sub_810618C(struct Sprite *sprite) +{ + if (!TranslateAnimLinear(sprite)) + { + sprite->pos2.y += Sin(sprite->data[5], 14); + sprite->data[5] = (sprite->data[5] + 4) & 0xFF; + } + else + { + DestroyAnimSprite(sprite); + } +} + +void sub_81061C4(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + sprite->data[1] = gBattleAnimArgs[0]; + sprite->data[2] = gBattleAnimArgs[1]; + sprite->data[0]++; + } + else + { + sprite->data[4] += sprite->data[1]; + sprite->pos2.x = sprite->data[4] >> 8; + sprite->pos2.y = Sin(sprite->data[3], sprite->data[2]); + sprite->data[3] = (sprite->data[3] + 3) & 0xFF; + if (sprite->data[3] > 100) + sprite->invisible = sprite->data[3] % 2; + + if (sprite->data[3] > 120) + DestroyAnimSprite(sprite); + } +} + +void sub_810624C(struct Sprite *sprite) +{ + sprite->pos1.x = gBattleAnimArgs[0]; + sprite->pos1.y = 160; + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = gBattleAnimArgs[1]; + sprite->callback = WaitAnimForDuration; + StoreSpriteCallbackInData6(sprite, sub_810627C); +} + +static void sub_810627C(struct Sprite *sprite) +{ + s16 y; + sprite->data[2] += sprite->data[1]; + sprite->pos2.y = -((u16)sprite->data[2] >> 8); + sprite->pos2.x = Sin(sprite->data[3], 4); + sprite->data[3] = (sprite->data[3] + 3) & 0xFF; + y = sprite->pos1.y + sprite->pos2.y; + if (y <= 72) + { + sprite->invisible = sprite->data[3] % 2; + if (y <= 64) + DestroyAnimSprite(sprite); + } +} + +void sub_81062E8(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 3); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + sub_80A6B30(&unknownStruct); + sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C232E0, unknownStruct.tilesOffset); + sub_80A6D60(&unknownStruct, &gUnknown_08C23D78, 0); + LoadCompressedPalette(&gUnknown_08C23D50, unknownStruct.unk8 << 4, 32); + gTasks[taskId].func = sub_81063A8; +} + +static void sub_81063A8(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + switch (gTasks[taskId].data[12]) + { + case 0: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]++; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 16) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 1: + if (++gTasks[taskId].data[11] == 141) + { + gTasks[taskId].data[11] = 16; + gTasks[taskId].data[12]++; + } + break; + case 2: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]--; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 0) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 3: + sub_80A6B30(&unknownStruct); + sub_80A6C68(unknownStruct.bgId); + gTasks[taskId].data[12]++; + break; + case 4: + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_81064F8(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + sub_80A6B30(&unknownStruct); + if (IsContest()) + sub_80A6D60(&unknownStruct, &gBattleAnimBackgroundTilemap_ScaryFaceContest, 0); + else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT) + sub_80A6D60(&unknownStruct, &gBattleAnimBackgroundTilemap_ScaryFacePlayer, 0); + else + sub_80A6D60(&unknownStruct, &gBattleAnimBackgroundTilemap_ScaryFaceOpponent, 0); + + sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C249F8, unknownStruct.tilesOffset); + LoadCompressedPalette(&gUnknown_08C249D0, unknownStruct.unk8 << 4, 32); + gTasks[taskId].func = sub_81065EC; +} + +static void sub_81065EC(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + switch (gTasks[taskId].data[12]) + { + case 0: + if (++gTasks[taskId].data[10] == 2) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]++; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 14) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 1: + if (++gTasks[taskId].data[11] == 21) + { + gTasks[taskId].data[11] = 14; + gTasks[taskId].data[12]++; + } + break; + case 2: + if (++gTasks[taskId].data[10] == 2) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]--; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 0) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 3: + sub_80A6B30(&unknownStruct); + sub_80A6C68(1); + sub_80A6C68(2); + gTasks[taskId].data[12]++; + // fall through + case 4: + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + DestroyAnimVisualTask(taskId); + break; + } +} + +// Orbits a sphere in an ellipse around the mon. +// Used by MOVE_HIDDEN_POWER +// arg 0: duration +// arg 1: initial wave offset +void AnimOrbitFast(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->affineAnimPaused = 1; + sprite->data[0] = gBattleAnimArgs[0]; + sprite->data[1] = gBattleAnimArgs[1]; + sprite->data[7] = sub_80A82E4(gBattleAnimAttacker); + sprite->callback = AnimOrbitFastStep; + sprite->callback(sprite); +} + +static void AnimOrbitFastStep(struct Sprite *sprite) +{ + if ((u16)(sprite->data[1] - 64) < 128) + sprite->subpriority = sprite->data[7] + 1; + else + sprite->subpriority = sprite->data[7] - 1; + + sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8); + sprite->pos2.y = Cos(sprite->data[1], sprite->data[3] >> 8); + sprite->data[1] = (sprite->data[1] + 9) & 0xFF; + switch (sprite->data[5]) + { + case 1: + sprite->data[2] -= 0x400; + sprite->data[3] -= 0x100; + if (++sprite->data[4] == sprite->data[0]) + { + sprite->data[5] = 2; + return; + } + break; + case 0: + sprite->data[2] += 0x400; + sprite->data[3] += 0x100; + if (++sprite->data[4] == sprite->data[0]) + { + sprite->data[4] = 0; + sprite->data[5] = 1; + } + break; + } + + if ((u16)gBattleAnimArgs[7] == 0xFFFF) + DestroyAnimSprite(sprite); +} + +// Moves orbs away from the mon, based on where they are in their orbit. +// Used in MOVE_HIDDEN_POWER. +// arg 0: initial wave offset +void AnimOrbitScatter(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[0] = Sin(gBattleAnimArgs[0], 10); + sprite->data[1] = Cos(gBattleAnimArgs[0], 7); + sprite->callback = AnimOrbitScatterStep; +} + +static void AnimOrbitScatterStep(struct Sprite *sprite) +{ + sprite->pos2.x += sprite->data[0]; + sprite->pos2.y += sprite->data[1]; + if (sprite->pos1.x + sprite->pos2.x + 16 > 272u || sprite->pos1.y + sprite->pos2.y > 160 || sprite->pos1.y + sprite->pos2.y < -16) + DestroyAnimSprite(sprite); +} + +static void sub_8106914(struct Sprite *sprite) +{ + sprite->pos2.x += sprite->data[0]; + sprite->pos2.y += sprite->data[1]; + if (sprite->data[3]++ >= sprite->data[2]) + DestroyAnimSprite(sprite); +} + +void sub_8106944(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[0] = Sin(gBattleAnimArgs[0], 10); + sprite->data[1] = Cos(gBattleAnimArgs[0], 7); + sprite->data[2] = gBattleAnimArgs[1]; + sprite->callback = sub_8106914; +} + +static void sub_810699C(struct Sprite *sprite) +{ + if (sprite->animEnded) + DestroyAnimSprite(sprite); +} + +void sub_81069B8(struct Sprite *sprite) +{ + InitAnimSpritePos(sprite, 1); + sprite->callback = sub_810699C; +} + +void sub_81069D0(struct Sprite *sprite) +{ + s16 var0; + if (!sprite->data[0]) + { + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + } + + sprite->data[0]++; + var0 = (sprite->data[0] * 10) & 0xFF; + sprite->pos2.x = Sin(var0, 80) >> 8; + if (sprite->data[0] < 80) + sprite->pos2.y = (sprite->data[0] / 2) + (Cos(var0, 80) >> 8); + + if (sprite->data[0] > 90) + { + sprite->data[2]++; + sprite->pos2.x -= sprite->data[2] / 2; + } + + if (sprite->data[0] > 100) + DestroyAnimSprite(sprite); +} + +static void sub_8106A64(struct Sprite *sprite) +{ + sprite->data[5]++; + sprite->pos2.x = Sin(sprite->data[3], 5); + sprite->pos2.y = sprite->data[5] / 2; + sprite->data[3] = (sprite->data[3] + 3) & 0xFF; + if (sprite->data[5] > 20) + sprite->invisible = sprite->data[5] % 2; + + if (sprite->data[5] > 30) + DestroyAnimSprite(sprite); +} + +void sub_8106AD0(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + sprite->data[1] = gBattleAnimArgs[0]; + sprite->data[2] = gBattleAnimArgs[1]; + sprite->data[0]++; + } + else + { + sprite->data[4] += sprite->data[1]; + sprite->pos2.x = sprite->data[4] >> 8; + sprite->pos2.y = Sin(sprite->data[3], sprite->data[2]); + sprite->data[3] = (sprite->data[3] + 3) & 0xFF; + if (sprite->data[3] > 70) + { + sprite->callback = sub_8106A64; + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->data[3] = Random2() % 180; + } + } +} + +void sub_8106B54(struct Sprite *sprite) +{ + if (sprite->data[3] == 0) + { + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + StartSpriteAnim(sprite, 0); + sprite->subpriority = sub_80A82E4(gBattleAnimTarget) - 1; + sprite->data[2] = 1; + } + sprite->data[0] += sprite->data[2]; + sprite->data[1] = (sprite->data[0] * 4) % 256; + if (sprite->data[1] < 0) + sprite->data[1] = 0; + sprite->pos2.x = Cos(sprite->data[1], 30 - sprite->data[0] / 4); + sprite->pos2.y = Sin(sprite->data[1], 10 - sprite->data[0] / 8); + if (sprite->data[1] > 128 && sprite->data[2] > 0) + sprite->data[2] = -1; + if (sprite->data[1] == 0 && sprite->data[2] < 0) + sprite->data[2] = 1; + sprite->data[3]++; + if (sprite->data[3] < 10 || sprite->data[3] > 80) + sprite->invisible = sprite->data[0] % 2; + else + sprite->invisible = FALSE; + if (sprite->data[3] > 90) + DestroyAnimSprite(sprite); +} + +void sub_8106C80(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + StartSpriteAnim(sprite, gBattleAnimArgs[2]); + sprite->data[0]++; + } + else if (sprite->animEnded) + { + DestroyAnimSprite(sprite); + } +} + +void sub_8106CD0(struct Sprite *sprite) +{ + if (!gBattleAnimArgs[2]) + { + DestroyAnimSprite(sprite); + } + else + { + if (!gBattleAnimArgs[0]) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + } + + if (!gBattleAnimArgs[1]) + sprite->pos1.x += 32; + else + sprite->pos1.x -= 32; + + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = gBattleAnimArgs[1]; + StartSpriteAnim(sprite, sprite->data[1]); + sprite->callback = sub_8106D5C; + } +} + +static void sub_8106D5C(struct Sprite *sprite) +{ + if (sprite->animEnded) + { + if (--sprite->data[0]) + StartSpriteAnim(sprite, sprite->data[1]); + else + DestroyAnimSprite(sprite); + } +} + +void sub_8106D90(u8 taskId) +{ + u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + + sub_80A7CFC(&gTasks[taskId], spriteId, gUnknown_08593B98); + gTasks[taskId].func = sub_8106DD4; +} + +static void sub_8106DD4(u8 taskId) +{ + if (!sub_80A7D34(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); +} + +void sub_8106E00(struct Sprite *sprite) +{ + int var1; + u8 battler = !gBattleAnimArgs[0] ? gBattleAnimAttacker : gBattleAnimTarget; + + if (GetBattlerSide(battler) == B_SIDE_OPPONENT) + gBattleAnimArgs[1] *= -1; + + sprite->pos1.x = GetBattlerSpriteCoord(battler, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[2]; + sprite->data[0] = 0; + sprite->data[1] = (u16)sprite->pos1.x << 3; + sprite->data[2] = (u16)sprite->pos1.y << 3; + + var1 = gBattleAnimArgs[1] << 3; + if (var1 < 0) + var1 += 7; + sprite->data[3] = var1 >> 3; + + var1 = gBattleAnimArgs[2] << 3; + if (var1 < 0) + var1 += 7; + sprite->data[4] = var1 >> 3; + + sprite->oam.tileNum += gBattleAnimArgs[3] * 16; + sprite->callback = sub_8106EC8; +} + +static void sub_8106EC8(struct Sprite *sprite) +{ + sprite->data[1] += sprite->data[3]; + sprite->data[2] += sprite->data[4]; + sprite->pos1.x = sprite->data[1] >> 3; + sprite->pos1.y = sprite->data[2] >> 3; + if (++sprite->data[0] > 16) + DestroyAnimSprite(sprite); +} + +void sub_8106F00(struct Sprite *sprite) +{ + if (!sprite->data[0]) + { + sprite->data[1] = 120 - gBattleAnimArgs[0]; + sprite->invisible = 1; + } + + if (++sprite->data[0] == sprite->data[1]) + sub_80A750C(sprite->oam.paletteNum + 16, 0); + + if (sprite->data[0] == sprite->data[1] + 80) + DestroyAnimSprite(sprite); +} + +void sub_8106F60(struct Sprite *sprite) +{ + int index; + int var2; + + if (!sprite->data[0]) + { + sprite->pos1.x = 120; + sprite->pos1.y = (gBattleAnimArgs[0] + (((u16)gBattleAnimArgs[0]) >> 31)) / 2 - 15; + + StartSpriteAnim(sprite, gBattleAnimArgs[1]); + + sprite->data[5] = 120; + sprite->data[3] = gBattleAnimArgs[2]; + } + + sprite->data[0]++; + + sprite->data[1] = (sprite->data[0] + ((u16)sprite->data[0] >> 31)) / 2; + index = ((sprite->data[0] * 3) + (u16)sprite->data[3]); + var2 = 0xFF; + sprite->data[6] = (sprite->data[6] + 10) & 0xFF; + + index &= var2; + sprite->pos2.x = Cos(index, 100); + + sprite->pos2.y = sprite->data[1] + Sin(index, 10) + Cos(sprite->data[6], 4); + + if (sprite->data[0] > sprite->data[5]) + { + sprite->callback = sub_8107018; + + sprite->data[0] = 0; + oamt_add_pos2_onto_pos1(sprite); + sprite->data[2] = 5; + sprite->data[4] = 0; + sprite->data[3] = 0; + + StartSpriteAffineAnim(sprite, 1); + } +} + +static void sub_8107018(struct Sprite *sprite) +{ + if (++sprite->data[0] > 10) + { + sprite->data[0] = 0; + sprite->callback = sub_810703C; + } +} + +static void sub_810703C(struct Sprite *sprite) +{ + sprite->data[3] += sprite->data[2]; + sprite->pos2.y = sprite->data[3]; + + sprite->data[2]++; + + if (sprite->data[3] > 48 && sprite->data[2] > 0) + { + sprite->data[2] = sprite->data[4] - 5; + sprite->data[4]++; + } + + if (sprite->data[4] > 3) + { + int var1 = sprite->data[2]; + sprite->invisible = var1 - (((s32)(var1 + ((u32)var1 >> 31)) >> 1) << 1); + DestroyAnimSprite(sprite); + } + + if (sprite->data[4] == 4) + { + DestroyAnimSprite(sprite); + } +} + +void sub_81070AC(struct Sprite *sprite) +{ + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) + { + SetAverageBattlerPositions(gBattleAnimAttacker, 0, &sprite->pos1.x, &sprite->pos1.y); + sprite->pos1.y += 40; + + StartSpriteAffineAnim(sprite, 1); + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 40; + } + + sprite->data[0] = 13; + sprite->data[2] = sprite->pos1.x; + sprite->data[4] = sprite->pos1.y - 72; + + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void AnimTask_IsFuryCutterHitRight(u8 taskId) +{ + gBattleAnimArgs[7] = gAnimDisableStructPtr->furyCutterCounter & 1; + DestroyAnimVisualTask(taskId); +} + +void AnimTask_GetFuryCutterHitCount(u8 taskId) +{ + gBattleAnimArgs[7] = gAnimDisableStructPtr->furyCutterCounter; + DestroyAnimVisualTask(taskId); +} diff --git a/src/effects_2.c b/src/effects_2.c deleted file mode 100644 index 82336be5c..000000000 --- a/src/effects_2.c +++ /dev/null @@ -1,1197 +0,0 @@ -#include "global.h" -#include "battle_anim.h" -#include "constants/rgb.h" - -extern void sub_8103448(struct Sprite *); -extern void sub_8103498(struct Sprite *); -extern void sub_810358C(struct Sprite *); -extern void sub_8103620(struct Sprite *); -extern void sub_80A77C8(struct Sprite *); -extern void sub_81037D8(struct Sprite *); -extern void sub_810387C(struct Sprite *); -extern void sub_81038C8(struct Sprite *); -extern void sub_8103AA4(struct Sprite *); -extern void TranslateAnimSpriteToTargetMonLocation(struct Sprite *); -extern void sub_8108C94(struct Sprite *); -extern void sub_80A78AC(struct Sprite *); -extern void sub_8103FE8(struct Sprite *); -extern void sub_8104088(struct Sprite *); -extern void sub_810413C(struct Sprite *); -extern void sub_81041C4(struct Sprite *); -extern void sub_8104304(struct Sprite *); -extern void sub_8104364(struct Sprite *); -extern void sub_8104414(struct Sprite *); -extern void sub_8104B1C(struct Sprite *); -extern void sub_8104BAC(struct Sprite *); -extern void sub_810501C(struct Sprite *); -extern void sub_80A7938(struct Sprite *); -extern void sub_8105538(struct Sprite *); -extern void sub_81051C4(struct Sprite *); -extern void sub_81052A4(struct Sprite *); -extern void sub_81054E8(struct Sprite *); -extern void sub_8105C48(struct Sprite *); -extern void sub_8105DE8(struct Sprite *); -extern void sub_8105E60(struct Sprite *); -extern void sub_8106140(struct Sprite *); -extern void sub_81061C4(struct Sprite *); -extern void sub_810624C(struct Sprite *); -extern void sub_810673C(struct Sprite *); -extern void sub_8106878(struct Sprite *); -extern void sub_8106944(struct Sprite *); -extern void sub_81069B8(struct Sprite *); -extern void sub_81069D0(struct Sprite *); -extern void sub_8106AD0(struct Sprite *); -extern void sub_8106B54(struct Sprite *); -extern void sub_8106C80(struct Sprite *); -extern void sub_8106CD0(struct Sprite *); -extern void sub_8106E00(struct Sprite *); -extern void sub_8106F60(struct Sprite *); -extern void sub_8106F00(struct Sprite *); -extern void sub_81070AC(struct Sprite *); - -const struct SpriteTemplate gUnknown_08593264 = -{ - .tileTag = ANIM_TAG_FINGER, - .paletteTag = ANIM_TAG_FINGER, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8103448, -}; - -const union AnimCmd gUnknown_0859327C[] = -{ - ANIMCMD_FRAME(4, 1), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593284[] = -{ - gUnknown_0859327C, -}; - -const struct SpriteTemplate gUnknown_08593288 = -{ - .tileTag = ANIM_TAG_MUSIC_NOTES, - .paletteTag = ANIM_TAG_MUSIC_NOTES, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8103498, -}; - -const struct SpriteTemplate gUnknown_085932A0 = -{ - .tileTag = 0, - .paletteTag = 0, - .oam = &gDummyOamData, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810358C, -}; - -extern const union AffineAnimCmd *const gUnknown_08597060[]; -const struct SpriteTemplate gUnknown_085932B8 = -{ - .tileTag = ANIM_TAG_CLAMP, - .paletteTag = ANIM_TAG_CLAMP, - .oam = &gUnknown_08524A9C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08597060, - .callback = sub_8103620, -}; - -const union AnimCmd gUnknown_085932D0[] = -{ - ANIMCMD_FRAME(0, 9), - ANIMCMD_FRAME(16, 3), - ANIMCMD_FRAME(32, 3), - ANIMCMD_FRAME(48, 3), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085932E4[] = -{ - gUnknown_085932D0, -}; - -const union AffineAnimCmd gUnknown_085932E8[] = -{ - AFFINEANIMCMD_FRAME(0x50, 0x50, 0, 0), - AFFINEANIMCMD_FRAME(0x9, 0x9, 0, 18), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_08593300[] = -{ - gUnknown_085932E8, -}; - -const struct SpriteTemplate gUnknown_08593304 = -{ - .tileTag = ANIM_TAG_UNUSED_EXPLOSION, - .paletteTag = ANIM_TAG_UNUSED_EXPLOSION, - .oam = &gUnknown_08524974, - .anims = gUnknown_085932E4, - .images = NULL, - .affineAnims = gUnknown_08593300, - .callback = sub_80A77C8, -}; - -const union AnimCmd gUnknown_0859331C[] = -{ - ANIMCMD_FRAME(0, 3, .hFlip = TRUE), - ANIMCMD_FRAME(8, 3, .hFlip = TRUE), - ANIMCMD_FRAME(16, 3, .hFlip = TRUE), - ANIMCMD_FRAME(24, 3, .hFlip = TRUE), - ANIMCMD_FRAME(32, 3, .hFlip = TRUE), - ANIMCMD_FRAME(40, 3, .hFlip = TRUE), - ANIMCMD_FRAME(48, 3, .hFlip = TRUE), - ANIMCMD_LOOP(1), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593340[] = -{ - gUnknown_0859331C, -}; - -const struct SpriteTemplate gUnknown_08593344 = -{ - .tileTag = ANIM_TAG_ALERT, - .paletteTag = ANIM_TAG_ALERT, - .oam = &gUnknown_08524934, - .anims = gUnknown_08593340, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81037D8, -}; - -const union AffineAnimCmd gUnknown_0859335C[] = -{ - AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(0x14, 0x0, 0, 12), - AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 32), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_0859337C[] = -{ - gUnknown_0859335C, -}; - -const struct SpriteTemplate gBattleAnimSpriteTemplate_8593380 = -{ - .tileTag = ANIM_TAG_SWORD, - .paletteTag = ANIM_TAG_SWORD, - .oam = &gUnknown_08524ADC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_0859337C, - .callback = sub_810387C, -}; - -const struct SpriteTemplate gSonicBoomSpriteTemplate = -{ - .tileTag = ANIM_TAG_AIR_WAVE, - .paletteTag = ANIM_TAG_AIR_WAVE, - .oam = &gUnknown_08524B14, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81038C8, -}; - -const struct SpriteTemplate gUnknown_085933B0 = -{ - .tileTag = ANIM_TAG_AIR_WAVE, - .paletteTag = ANIM_TAG_AIR_WAVE, - .oam = &gUnknown_08524A54, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8103AA4, -}; - -const union AffineAnimCmd gUnknown_085933C8[] = -{ - AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 0), - AFFINEANIMCMD_FRAME(0x7, 0x7, 0, -56), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085933E0[] = -{ - AFFINEANIMCMD_FRAME(0x5, 0x5, 0, 10), - AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10), - AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10), - AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10), - AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10), - AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 10), - AFFINEANIMCMD_FRAME(0xA, 0xA, 0, 10), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_08593420[] = -{ - gUnknown_085933C8, -}; - -const union AffineAnimCmd *const gUnknown_08593424[] = -{ - gUnknown_085933E0, -}; - -const struct SpriteTemplate gSupersonicWaveSpriteTemplate = -{ - .tileTag = ANIM_TAG_GOLD_RING, - .paletteTag = ANIM_TAG_GOLD_RING, - .oam = &gUnknown_08524A14, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593420, - .callback = TranslateAnimSpriteToTargetMonLocation, -}; - -const struct SpriteTemplate gScreechWaveSpriteTemplate = -{ - .tileTag = ANIM_TAG_PURPLE_RING, - .paletteTag = ANIM_TAG_PURPLE_RING, - .oam = &gUnknown_08524A14, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593420, - .callback = TranslateAnimSpriteToTargetMonLocation, -}; - -const struct SpriteTemplate gUnknown_08593458 = -{ - .tileTag = ANIM_TAG_METAL_SOUND_WAVES, - .paletteTag = ANIM_TAG_METAL_SOUND_WAVES, - .oam = &gUnknown_08524A1C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593420, - .callback = TranslateAnimSpriteToTargetMonLocation, -}; - -const struct SpriteTemplate gUnknown_08593470 = -{ - .tileTag = ANIM_TAG_BLUE_RING_2, - .paletteTag = ANIM_TAG_BLUE_RING_2, - .oam = &gUnknown_08524A14, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593424, - .callback = sub_8108C94, -}; - -const struct SpriteTemplate gUnknown_08593488 = -{ - .tileTag = ANIM_TAG_LARGE_FRESH_EGG, - .paletteTag = ANIM_TAG_LARGE_FRESH_EGG, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A78AC, -}; - -const struct SpriteTemplate gUnknown_085934A0 = -{ - .tileTag = ANIM_TAG_UNUSED_VOID_LINES, - .paletteTag = ANIM_TAG_UNUSED_VOID_LINES, - .oam = &gUnknown_08524A3C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8103FE8, -}; - -const union AnimCmd gUnknown_085934B8[] = -{ - ANIMCMD_FRAME(8, 1), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085934C0[] = -{ - gUnknown_085934B8, -}; - -const union AffineAnimCmd gUnknown_085934C4[] = -{ - AFFINEANIMCMD_FRAME(0x0, 0x0, 10, 1), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085934D4[] = -{ - gUnknown_085934C4, -}; - -const struct SpriteTemplate gUnknown_085934D8 = -{ - .tileTag = ANIM_TAG_COIN, - .paletteTag = ANIM_TAG_COIN, - .oam = &gUnknown_0852496C, - .anims = gUnknown_085934C0, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8104088, -}; - -const struct SpriteTemplate gUnknown_085934F0 = -{ - .tileTag = ANIM_TAG_COIN, - .paletteTag = ANIM_TAG_COIN, - .oam = &gUnknown_0852496C, - .anims = gUnknown_085934C0, - .images = NULL, - .affineAnims = gUnknown_085934D4, - .callback = sub_810413C, -}; - -const union AffineAnimCmd gUnknown_08593508[] = -{ - AFFINEANIMCMD_FRAME(0x0, 0x0, 20, 1), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_08593518[] = -{ - gUnknown_08593508, -}; - -const struct SpriteTemplate gUnknown_0859351C = -{ - .tileTag = ANIM_TAG_SEED, - .paletteTag = ANIM_TAG_SEED, - .oam = &gUnknown_0852496C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593518, - .callback = sub_81041C4, -}; - -const union AffineAnimCmd gUnknown_08593534[] = -{ - AFFINEANIMCMD_FRAME(0x10, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(0x4, 0x0, 0, 40), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_0859354C[] = -{ - gUnknown_08593534, -}; - -const struct SpriteTemplate gUnknown_08593550 = -{ - .tileTag = ANIM_TAG_GUST, - .paletteTag = ANIM_TAG_GUST, - .oam = &gUnknown_085249BC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_0859354C, - .callback = sub_8104304, -}; - -const union AnimCmd gUnknown_08593568[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_FRAME(16, 3), - ANIMCMD_FRAME(32, 20), - ANIMCMD_END, -}; - -const union AnimCmd gUnknown_08593578[] = -{ - ANIMCMD_FRAME(0, 3, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(16, 3, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(32, 20, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593588[] = -{ - gUnknown_08593568, - gUnknown_08593578, -}; - -const struct SpriteTemplate gUnknown_08593590 = -{ - .tileTag = ANIM_TAG_CUT, - .paletteTag = ANIM_TAG_CUT, - .oam = &gUnknown_08524A34, - .anims = gUnknown_08593588, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8104364, -}; - -const union AnimCmd gUnknown_085935A8[] = -{ - ANIMCMD_FRAME(0, 2), - ANIMCMD_FRAME(16, 2), - ANIMCMD_FRAME(32, 1), - ANIMCMD_END, -}; - -const union AnimCmd gUnknown_085935B8[] = -{ - ANIMCMD_FRAME(0, 2, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(16, 2, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(32, 1, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085935C8[] = -{ - gUnknown_085935A8, - gUnknown_085935B8, -}; - -const struct SpriteTemplate gUnknown_085935D0 = -{ - .tileTag = ANIM_TAG_CUT, - .paletteTag = ANIM_TAG_CUT, - .oam = &gUnknown_08524A34, - .anims = gUnknown_085935C8, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8104414, -}; - -const union AffineAnimCmd gUnknown_085935E8[] = -{ - AFFINEANIMCMD_FRAME(-6, 4, 0, 8), - AFFINEANIMCMD_FRAME(10, -10, 0, 8), - AFFINEANIMCMD_FRAME(-4, 6, 0, 8), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_08593608[] = -{ - AFFINEANIMCMD_FRAME(-4, -5, 0, 12), - AFFINEANIMCMD_FRAME(0, 0, 0, 24), - AFFINEANIMCMD_FRAME(4, 5, 0, 12), - AFFINEANIMCMD_END, -}; - -const union AnimCmd gUnknown_08593628[] = -{ - ANIMCMD_FRAME(0, 4, .hFlip = TRUE), - ANIMCMD_FRAME(4, 40, .hFlip = TRUE), - ANIMCMD_FRAME(8, 4, .hFlip = TRUE), - ANIMCMD_FRAME(12, 4, .hFlip = TRUE), - ANIMCMD_END, -}; - -const union AnimCmd gUnknown_0859363C[] = -{ - ANIMCMD_FRAME(0, 4), - ANIMCMD_FRAME(4, 40), - ANIMCMD_FRAME(8, 4), - ANIMCMD_FRAME(12, 4), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593650[] = -{ - gUnknown_08593628, - gUnknown_0859363C, -}; - -const struct SpriteTemplate gUnknown_08593658 = -{ - .tileTag = ANIM_TAG_BREATH, - .paletteTag = ANIM_TAG_BREATH, - .oam = &gUnknown_0852490C, - .anims = gUnknown_08593650, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8104B1C, -}; - -const union AffineAnimCmd gUnknown_08593670[] = -{ - AFFINEANIMCMD_FRAME(0xB, 0xB, 0, 8), - AFFINEANIMCMD_FRAME(0xFFF5, 0xFFF5, 0, 8), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_08593688[] = -{ - gUnknown_08593670, -}; - -const struct SpriteTemplate gUnknown_0859368C = -{ - .tileTag = ANIM_TAG_ANGER, - .paletteTag = ANIM_TAG_ANGER, - .oam = &gUnknown_0852496C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593688, - .callback = sub_8104BAC, -}; - -const union AffineAnimCmd gUnknown_085936A4[] = -{ - AFFINEANIMCMD_FRAME(-10, 9, 0, 7), - AFFINEANIMCMD_FRAME(20, -20, 0, 7), - AFFINEANIMCMD_FRAME(-20, 20, 0, 7), - AFFINEANIMCMD_FRAME(10, -9, 0, 7), - AFFINEANIMCMD_LOOP(2), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085936D4 = -{ - .tileTag = ANIM_TAG_PENCIL, - .paletteTag = ANIM_TAG_PENCIL, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810501C, -}; - -const struct SpriteTemplate gUnknown_085936EC = -{ - .tileTag = ANIM_TAG_SNORE_Z, - .paletteTag = ANIM_TAG_SNORE_Z, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A7938, -}; - -const union AnimCmd gUnknown_08593704[] = -{ - ANIMCMD_FRAME(0, 5), - ANIMCMD_FRAME(16, 5), - ANIMCMD_FRAME(32, 5), - ANIMCMD_FRAME(48, 5), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593718[] = -{ - gUnknown_08593704, -}; -//* -const struct SpriteTemplate gBattleAnimSpriteTemplate_859371C = -{ - .tileTag = ANIM_TAG_EXPLOSION, - .paletteTag = ANIM_TAG_EXPLOSION, - .oam = &gUnknown_08524914, - .anims = gUnknown_08593718, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A77C8, -}; - -const union AffineAnimCmd gUnknown_08593734[] = -{ - AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 2), - AFFINEANIMCMD_FRAME(0x0, 0x0, 8, 4), - AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 2), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_08593754[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_08593764[] = -{ - AFFINEANIMCMD_FRAME(0xFFF8, 0x4, 0, 8), - AFFINEANIMCMD_LOOP(0), - AFFINEANIMCMD_FRAME(0x10, 0xFFF8, 0, 8), - AFFINEANIMCMD_FRAME(0xFFF0, 0x8, 0, 8), - AFFINEANIMCMD_LOOP(1), - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 15), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085937A4[] = -{ - gUnknown_08593734, - gUnknown_08593754, - gUnknown_08593764, -}; -//* -const struct SpriteTemplate gUnknown_085937B0 = -{ - .tileTag = ANIM_TAG_BREAKING_EGG, - .paletteTag = ANIM_TAG_BREAKING_EGG, - .oam = &gUnknown_08524AF4, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085937A4, - .callback = sub_8105538, -}; - -const union AffineAnimCmd gUnknown_085937C8[] = -{ - AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0), - AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 30), - AFFINEANIMCMD_END_ALT(1), -}; - -const union AffineAnimCmd gUnknown_085937E0[] = -{ - AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0), - AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 15), - AFFINEANIMCMD_END_ALT(1), -}; - -const union AffineAnimCmd gUnknown_085937F8[] = -{ - AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0), - AFFINEANIMCMD_FRAME(0xB, 0xB, 0, 45), - AFFINEANIMCMD_END_ALT(1), -}; - -const union AffineAnimCmd *const gUnknown_08593810[] = -{ - gUnknown_085937C8, - gUnknown_085937E0, -}; - -const union AffineAnimCmd *const gUnknown_08593818[] = -{ - gUnknown_085937F8, -}; - -const struct SpriteTemplate gUnknown_0859381C = -{ - .tileTag = ANIM_TAG_THIN_RING, - .paletteTag = ANIM_TAG_THIN_RING, - .oam = &gUnknown_085249DC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593810, - .callback = sub_80A77C8, -}; -//* -const union AffineAnimCmd gUnknown_08593834[] = -{ - AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), - AFFINEANIMCMD_FRAME(0xFFF0, 0xFFF0, 0, 30), - AFFINEANIMCMD_END_ALT(1), -}; - -const union AffineAnimCmd *const gUnknown_0859384C[] = -{ - gUnknown_08593834, -}; - -const struct SpriteTemplate gUnknown_08593850 = -{ - .tileTag = ANIM_TAG_THIN_RING, - .paletteTag = ANIM_TAG_THIN_RING, - .oam = &gUnknown_08524AFC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_0859384C, - .callback = sub_80A77C8, -}; - -const struct SpriteTemplate gUnknown_08593868 = -{ - .tileTag = ANIM_TAG_THIN_RING, - .paletteTag = ANIM_TAG_THIN_RING, - .oam = &gUnknown_08524AFC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593810, - .callback = sub_81051C4, -}; - -const struct SpriteTemplate gUnknown_08593880 = -{ - .tileTag = ANIM_TAG_THIN_RING, - .paletteTag = ANIM_TAG_THIN_RING, - .oam = &gUnknown_08524AFC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593818, - .callback = sub_81052A4, -}; - -const struct SpriteTemplate gBattleAnimSpriteTemplate_8593898 = -{ - .tileTag = ANIM_TAG_THIN_RING, - .paletteTag = ANIM_TAG_THIN_RING, - .oam = &gUnknown_08524AFC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593810, - .callback = sub_81054E8, -}; - -const union AffineAnimCmd gUnknown_085938B0[] = -{ - AFFINEANIMCMD_FRAME(96, -13, 0, 8), - AFFINEANIMCMD_END, -}; - -const union AnimCmd gUnknown_085938C0[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_FRAME(4, 3), - ANIMCMD_FRAME(8, 3), - ANIMCMD_FRAME(4, 3), - ANIMCMD_FRAME(0, 3), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085938D8[] = -{ - gUnknown_085938C0, -}; - -const struct SpriteTemplate gUnknown_085938DC = -{ - .tileTag = ANIM_TAG_SPEED_DUST, - .paletteTag = ANIM_TAG_SPEED_DUST, - .oam = &gUnknown_0852490C, - .anims = gUnknown_085938D8, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8105C48, -}; - -const s8 gUnknown_085938F4[][2] = -{ - {30, 28}, - {-20, 24}, - {16, 26}, - {-10, 28}, -}; - -const union AnimCmd gUnknown_085938FC[] = -{ - ANIMCMD_FRAME(0, 6), - ANIMCMD_FRAME(16, 6), - ANIMCMD_FRAME(32, 15), - ANIMCMD_FRAME(16, 6), - ANIMCMD_FRAME(0, 6), - ANIMCMD_FRAME(16, 6, .hFlip = TRUE), - ANIMCMD_FRAME(32, 15, .hFlip = TRUE), - ANIMCMD_FRAME(16, 6, .hFlip = TRUE), - ANIMCMD_FRAME(0, 6), - ANIMCMD_FRAME(16, 6), - ANIMCMD_FRAME(32, 15), - ANIMCMD_FRAME(16, 6), - ANIMCMD_FRAME(0, 6), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593934[] = -{ - gUnknown_085938FC, -}; - -const struct SpriteTemplate gUnknown_08593938 = -{ - .tileTag = ANIM_TAG_BELL, - .paletteTag = ANIM_TAG_BELL, - .oam = &gUnknown_08524914, - .anims = gUnknown_08593934, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A77C8, -}; - -const u16 gUnknown_08593950[] = -{ - 10206, - 9999, - 9998, - 0, -}; - -const struct SpriteTemplate gUnknown_08593958 = -{ - .tileTag = ANIM_TAG_MUSIC_NOTES_2, - .paletteTag = ANIM_TAG_MUSIC_NOTES_2, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8105DE8, -}; - -const struct SpriteTemplate gUnknown_08593970 = -{ - .tileTag = ANIM_TAG_MAGENTA_HEART, - .paletteTag = ANIM_TAG_MAGENTA_HEART, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8105E60, -}; - -const union AffineAnimCmd gUnknown_08593988[] = -{ - AFFINEANIMCMD_FRAME(0x000A, 0xFFF3, 0x00, 0x0A), - AFFINEANIMCMD_FRAME(0xFFF6, 0x000D, 0x00, 0x0A), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085939A0 = -{ - .tileTag = ANIM_TAG_RED_HEART, - .paletteTag = ANIM_TAG_RED_HEART, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8106140, -}; - -const struct SpriteTemplate gBattleAnimSpriteTemplate_85939B8 = -{ - .tileTag = ANIM_TAG_RED_HEART, - .paletteTag = ANIM_TAG_RED_HEART, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81061C4, -}; - -const struct SpriteTemplate gUnknown_085939D0 = -{ - .tileTag = ANIM_TAG_RED_HEART, - .paletteTag = ANIM_TAG_RED_HEART, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_810624C, -}; - -const union AffineAnimCmd gUnknown_085939E8[] = -{ - AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), - AFFINEANIMCMD_FRAME(0x8, 0x8, 0, 1), - AFFINEANIMCMD_JUMP(1), -}; - -const union AffineAnimCmd *const gUnknown_08593A00[] = -{ - gUnknown_085939E8, -}; - -const struct SpriteTemplate gHiddenPowerOrbSpriteTemplate = -{ - .tileTag = ANIM_TAG_RED_ORB, - .paletteTag = ANIM_TAG_RED_ORB, - .oam = &gUnknown_0852496C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593A00, - .callback = sub_810673C, -}; - -const struct SpriteTemplate gHiddenPowerOrbScatterSpriteTemplate = -{ - .tileTag = ANIM_TAG_RED_ORB, - .paletteTag = ANIM_TAG_RED_ORB, - .oam = &gUnknown_085249CC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593A00, - .callback = sub_8106878, -}; - -const union AffineAnimCmd gUnknown_08593A34[] = -{ - AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), - AFFINEANIMCMD_FRAME(0x8, 0x8, 0, 1), - AFFINEANIMCMD_JUMP(1), -}; - -const union AffineAnimCmd *const gUnknown_08593A4C[] = -{ - gUnknown_08593A34, -}; - -const struct SpriteTemplate gUnknown_08593A50 = -{ - .tileTag = ANIM_TAG_RED_ORB_2, - .paletteTag = ANIM_TAG_RED_ORB_2, - .oam = &gUnknown_085249C4, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593A4C, - .callback = sub_8106944, -}; - -const union AnimCmd gUnknown_08593A68[] = -{ - ANIMCMD_FRAME(0, 4), - ANIMCMD_FRAME(4, 4), - ANIMCMD_FRAME(8, 4), - ANIMCMD_FRAME(4, 4), - ANIMCMD_FRAME(0, 4), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593A80[] = -{ - gUnknown_08593A68, -}; - -const struct SpriteTemplate gUnknown_08593A84 = -{ - .tileTag = ANIM_TAG_EYE_SPARKLE, - .paletteTag = ANIM_TAG_EYE_SPARKLE, - .oam = &gUnknown_0852490C, - .anims = gUnknown_08593A80, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81069B8, -}; - -const union AnimCmd gUnknown_08593A9C[] = -{ - ANIMCMD_FRAME(0, 24), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593AA4[] = -{ - gUnknown_08593A9C, -}; - -const struct SpriteTemplate gUnknown_08593AA8 = -{ - .tileTag = ANIM_TAG_ANGEL, - .paletteTag = ANIM_TAG_ANGEL, - .oam = &gUnknown_08524914, - .anims = gUnknown_08593AA4, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81069D0, -}; - -const struct SpriteTemplate gUnknown_08593AC0 = -{ - .tileTag = ANIM_TAG_PINK_HEART, - .paletteTag = ANIM_TAG_PINK_HEART, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8106AD0, -}; - -const union AnimCmd gUnknown_08593AD8[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_08593AE0[] = -{ - ANIMCMD_FRAME(16, 3), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd *const gUnknown_08593AE8[] = -{ - gUnknown_08593AD8, - gUnknown_08593AE0, -}; - -const struct SpriteTemplate gUnknown_08593AF0 = -{ - .tileTag = ANIM_TAG_DEVIL, - .paletteTag = ANIM_TAG_DEVIL, - .oam = &gUnknown_08524914, - .anims = gUnknown_08593AE8, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8106B54, -}; - -const union AnimCmd gUnknown_08593B08[] = -{ - ANIMCMD_FRAME(0, 4), - ANIMCMD_FRAME(16, 4), - ANIMCMD_FRAME(32, 4), - ANIMCMD_FRAME(48, 4), - ANIMCMD_END, -}; - -const union AnimCmd gUnknown_08593B1C[] = -{ - ANIMCMD_FRAME(0, 4, .hFlip = TRUE), - ANIMCMD_FRAME(16, 4, .hFlip = TRUE), - ANIMCMD_FRAME(32, 4, .hFlip = TRUE), - ANIMCMD_FRAME(48, 4, .hFlip = TRUE), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593B30[] = -{ - gUnknown_08593B08, - gUnknown_08593B1C, -}; - -const struct SpriteTemplate gUnknown_08593B38 = -{ - .tileTag = ANIM_TAG_SWIPE, - .paletteTag = ANIM_TAG_SWIPE, - .oam = &gUnknown_08524914, - .anims = gUnknown_08593B30, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8106C80, -}; - -const union AnimCmd gUnknown_08593B50[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_FRAME(16, 8), - ANIMCMD_FRAME(32, 8), - ANIMCMD_FRAME(16, 8), - ANIMCMD_END, -}; - -const union AnimCmd gUnknown_08593B64[] = -{ - ANIMCMD_FRAME(16, 8, .hFlip = TRUE), - ANIMCMD_FRAME(32, 8, .hFlip = TRUE), - ANIMCMD_FRAME(16, 8, .hFlip = TRUE), - ANIMCMD_FRAME(0, 8, .hFlip = TRUE), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_08593B78[] = -{ - gUnknown_08593B50, - gUnknown_08593B64, -}; - -const struct SpriteTemplate gUnknown_08593B80 = -{ - .tileTag = ANIM_TAG_MOVEMENT_WAVES, - .paletteTag = ANIM_TAG_MOVEMENT_WAVES, - .oam = &gUnknown_08524914, - .anims = gUnknown_08593B78, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8106CD0, -}; - -const union AffineAnimCmd gUnknown_08593B98[] = -{ - AFFINEANIMCMD_FRAME(-12, 8, 0, 4), - AFFINEANIMCMD_FRAME(20, -20, 0, 4), - AFFINEANIMCMD_FRAME(-8, 12, 0, 4), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gBattleAnimSpriteTemplate_8593BB8 = -{ - .tileTag = ANIM_TAG_JAGGED_MUSIC_NOTE, - .paletteTag = ANIM_TAG_JAGGED_MUSIC_NOTE, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8106E00, -}; - -const union AffineAnimCmd gUnknown_08593BD0[] = -{ - AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 5), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_08593BE0[] = -{ - AFFINEANIMCMD_FRAME(0x0, 0x0, -8, 16), - AFFINEANIMCMD_END_ALT(1), -}; - -const union AffineAnimCmd gUnknown_08593BF0[] = -{ - AFFINEANIMCMD_FRAME(0x0, 0x0, 8, 16), - AFFINEANIMCMD_END_ALT(1), -}; - -const union AffineAnimCmd *const gUnknown_08593C00[] = -{ - gUnknown_08593BD0, - gUnknown_08593BE0, - gUnknown_08593BF0, -}; - -extern const union AnimCmd *const gUnknown_08592FCC[]; -const struct SpriteTemplate gUnknown_08593C0C = -{ - .tileTag = ANIM_TAG_MUSIC_NOTES_2, - .paletteTag = ANIM_TAG_MUSIC_NOTES_2, - .oam = &gUnknown_0852496C, - .anims = gUnknown_08592FCC, - .images = NULL, - .affineAnims = gUnknown_08593C00, - .callback = sub_8106F60, -}; - -const struct SpriteTemplate gUnknown_08593C24 = -{ - .tileTag = ANIM_TAG_MUSIC_NOTES_2, - .paletteTag = ANIM_TAG_MUSIC_NOTES_2, - .oam = &gUnknown_0852496C, - .anims = gUnknown_08592FCC, - .images = NULL, - .affineAnims = gUnknown_08593C00, - .callback = sub_8106F00, -}; - -const union AffineAnimCmd gUnknown_08593C3C[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_08593C4C[] = -{ - AFFINEANIMCMD_FRAME(0x200, 0x100, 0, 0), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_08593C5C[] = -{ - gUnknown_08593C3C, - gUnknown_08593C4C, -}; - -const struct SpriteTemplate gUnknown_08593C64 = -{ - .tileTag = ANIM_TAG_GUARD_RING, - .paletteTag = ANIM_TAG_GUARD_RING, - .oam = &gUnknown_08524B1C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_08593C5C, - .callback = sub_81070AC, -}; From c74468fd11b551e1babf18a4d320e114fe495bd8 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 17 Dec 2018 22:08:08 -0600 Subject: [PATCH 4/8] Document a bunch of battle anim stuff --- asm/battle_anim_815A0D4.s | 128 +++---- asm/dark.s | 12 +- asm/flying.s | 10 +- asm/ice.s | 8 +- asm/psychic.s | 28 +- asm/water.s | 18 +- data/battle_anim_scripts.s | 58 +-- include/battle.h | 2 +- include/battle_anim.h | 44 +-- include/contest.h | 1 - src/battle_anim.c | 4 +- src/battle_anim_80A5C6C.c | 323 ++++++++-------- src/battle_anim_80A9C70.c | 2 +- src/battle_anim_80D51AC.c | 16 +- src/battle_anim_8170478.c | 16 +- src/battle_anim_effects_1.c | 116 +++--- src/battle_anim_effects_2.c | 425 ++++++++++++---------- src/battle_anim_utility_funcs.c | 2 +- src/battle_controller_link_opponent.c | 6 +- src/battle_controller_link_partner.c | 6 +- src/battle_controller_opponent.c | 6 +- src/battle_controller_player.c | 6 +- src/battle_controller_player_partner.c | 8 +- src/battle_controller_recorded_opponent.c | 8 +- src/battle_controller_recorded_player.c | 8 +- src/battle_controller_wally.c | 2 +- src/battle_gfx_sfx_util.c | 6 +- src/bug.c | 8 +- src/contest.c | 2 +- src/dragon.c | 10 +- src/electric.c | 137 ++++--- src/fight.c | 10 +- src/fire.c | 18 +- src/ghost.c | 20 +- src/ground.c | 2 +- src/normal.c | 16 +- src/poison.c | 2 +- src/reshow_battle_screen.c | 8 +- src/rock.c | 6 +- 39 files changed, 769 insertions(+), 739 deletions(-) diff --git a/asm/battle_anim_815A0D4.s b/asm/battle_anim_815A0D4.s index 394bc7104..84f7a7883 100644 --- a/asm/battle_anim_815A0D4.s +++ b/asm/battle_anim_815A0D4.s @@ -253,7 +253,7 @@ _0815A2B2: adds r0, r5, 0 movs r1, 0 adds r2, r3, 0 - bl sub_80A73E0 + bl TrySetSpriteRotScale ldr r0, =gBattleAnimArgs ldrh r0, [r0, 0x4] strh r0, [r5, 0x2E] @@ -879,7 +879,7 @@ _0815A7AC: sub_815A7B0: @ 815A7B0 push {r4,r5,lr} adds r4, r0, 0 - bl sub_80A6838 + bl SetSpriteCoordsToAnimAttackerCoords ldr r5, =gBattleAnimArgs movs r0, 0 ldrsh r1, [r5, r0] @@ -889,7 +889,7 @@ sub_815A7B0: @ 815A7B0 ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x22] - ldr r0, =sub_80A67D8 + ldr r0, =RunStoredCallbackWhenAnimEnds str r0, [r4, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r4, 0 @@ -909,7 +909,7 @@ sub_815A7EC: @ 815A7EC cmp r0, 0 bne _0815A84C adds r0, r4, 0 - bl sub_80A6838 + bl SetSpriteCoordsToAnimAttackerCoords ldr r5, =gBattleAnimArgs movs r2, 0 ldrsh r1, [r5, r2] @@ -2050,7 +2050,7 @@ _0815B138: lsrs r1, 24 ldr r2, =gUnknown_085CE2A0 adds r0, r6, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldrh r0, [r6, 0xA] adds r0, 0x1 strh r0, [r6, 0xA] @@ -2059,7 +2059,7 @@ _0815B138: .pool _0815B160: adds r0, r6, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 lsrs r0, 24 cmp r0, 0 @@ -2326,7 +2326,7 @@ _0815B35C: lsrs r1, 24 ldr r2, =gUnknown_085CE350 adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -2334,7 +2334,7 @@ _0815B35C: .pool _0815B37C: adds r0, r4, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 cmp r0, 0 bne _0815B38E @@ -2385,7 +2385,7 @@ _0815B3BE: strh r0, [r5, 0x22] adds r0, r6, 0 movs r1, 0 - bl sub_80A7270 + bl PrepareBattlerSpriteForRotScale movs r0, 0x80 lsls r0, 1 strh r0, [r5, 0x30] @@ -2405,7 +2405,7 @@ _0815B3F4: ldrsh r2, [r5, r0] adds r0, r6, 0 movs r3, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r5, 0x34] adds r0, 0x1 strh r0, [r5, 0x34] @@ -2429,7 +2429,7 @@ _0815B424: ldrsh r2, [r5, r0] adds r0, r6, 0 movs r3, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r5, 0x34] adds r0, 0x1 strh r0, [r5, 0x34] @@ -2450,7 +2450,7 @@ _0815B424: orrs r1, r2 strb r1, [r0] adds r0, r6, 0 - bl sub_80A7344 + bl ResetSpriteRotScale _0815B46C: ldrh r0, [r5, 0x2E] adds r0, 0x1 @@ -2734,7 +2734,7 @@ sub_815B65C: @ 815B65C lsrs r1, 24 ldr r2, =gUnknown_085CE3B8 adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -2742,7 +2742,7 @@ sub_815B65C: @ 815B65C .pool _0815B69C: adds r0, r4, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 cmp r0, 0 bne _0815B6AE @@ -2776,7 +2776,7 @@ sub_815B6B4: @ 815B6B4 lsrs r1, 24 ldr r2, =gUnknown_085CE3E0 adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -2784,7 +2784,7 @@ sub_815B6B4: @ 815B6B4 .pool _0815B6F4: adds r0, r4, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 cmp r0, 0 bne _0815B706 @@ -2874,7 +2874,7 @@ sub_815B778: @ 815B778 lsrs r1, 24 ldr r2, =gUnknown_085CE430 adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -2882,7 +2882,7 @@ sub_815B778: @ 815B778 .pool _0815B7B8: adds r0, r4, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 cmp r0, 0 bne _0815B7CA @@ -4278,7 +4278,7 @@ sub_815C3A8: @ 815C3A8 lsrs r1, 24 ldr r2, =gUnknown_085CE4B0 adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @@ -4286,7 +4286,7 @@ sub_815C3A8: @ 815C3A8 .pool _0815C3E8: adds r0, r4, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 cmp r0, 0 bne _0815C3FA @@ -4452,7 +4452,7 @@ _0815C528: lsls r0, 24 lsrs r0, 24 movs r1, 0 - bl sub_80A7270 + bl PrepareBattlerSpriteForRotScale ldr r0, =sub_815C548 str r0, [r4] _0815C538: @@ -4513,11 +4513,11 @@ _0815C57C: lsls r2, 1 ldrh r3, [r4, 0xC] adds r1, r2, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 - bl sub_80A73A0 + bl SetBattlerSpriteYOffsetFromRotation ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] @@ -4553,11 +4553,11 @@ _0815C5D0: lsls r2, 1 ldrh r3, [r4, 0xC] adds r1, r2, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 - bl sub_80A73A0 + bl SetBattlerSpriteYOffsetFromRotation ldrh r1, [r4, 0xA] adds r1, 0x1 strh r1, [r4, 0xA] @@ -4596,11 +4596,11 @@ _0815C628: lsls r2, 1 ldrh r3, [r4, 0xC] adds r1, r2, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 - bl sub_80A73A0 + bl SetBattlerSpriteYOffsetFromRotation ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] @@ -4630,7 +4630,7 @@ _0815C698: ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 - bl sub_80A7344 + bl ResetSpriteRotScale adds r0, r5, 0 bl DestroyAnimVisualTask _0815C6A8: @@ -4763,7 +4763,7 @@ sub_815C770: @ 815C770 lsrs r0, 24 strh r0, [r4, 0x26] movs r1, 0 - bl sub_80A7270 + bl PrepareBattlerSpriteForRotScale ldr r0, =sub_815C7C4 str r0, [r4] pop {r4} @@ -4907,7 +4907,7 @@ _0815C8C8: ldrh r0, [r7, 0x26] lsls r0, 24 lsrs r0, 24 - bl sub_80A7344 + bl ResetSpriteRotScale adds r0, r4, 0 bl DestroyAnimVisualTask b _0815C950 @@ -4919,11 +4919,11 @@ _0815C8DA: lsls r2, 1 ldrh r3, [r7, 0xC] adds r1, r2, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r7, 0x26] lsls r0, 24 lsrs r0, 24 - bl sub_80A73A0 + bl SetBattlerSpriteYOffsetFromRotation ldr r2, =gSprites movs r0, 0x26 ldrsh r1, [r7, r0] @@ -5121,7 +5121,7 @@ _0815CA5E: strh r5, [r6, 0x1C] adds r0, r5, 0 movs r1, 0 - bl sub_80A7270 + bl PrepareBattlerSpriteForRotScale mov r2, r8 movs r3, 0x2 ldrsh r0, [r2, r3] @@ -5145,9 +5145,9 @@ _0815CAA8: adds r0, r5, 0 movs r1, 0xE0 movs r3, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale adds r0, r5, 0 - bl sub_80A7E6C + bl SetBattlerSpriteYOffsetFromYScale lsls r2, r5, 4 b _0815CB08 _0815CAC0: @@ -5164,9 +5164,9 @@ _0815CACA: _0815CAD2: adds r0, r5, 0 movs r1, 0xD0 - bl obj_id_set_rotscale + bl SetSpriteRotScale adds r0, r5, 0 - bl sub_80A7E6C + bl SetBattlerSpriteYOffsetFromYScale bl IsContest lsls r0, 24 cmp r0, 0 @@ -5230,7 +5230,7 @@ _0815CB50: cmp r0, 0xD bne _0815CB78 adds r0, r5, 0 - bl sub_80A7344 + bl ResetSpriteRotScale ldr r1, =gSprites lsls r0, r5, 4 adds r0, r5 @@ -5588,14 +5588,14 @@ sub_815CDFC: @ 815CDFC _0815CE36: ldr r0, =gBattleAnimAttacker ldrb r0, [r0] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority subs r0, 0x1 b _0815CE52 .pool _0815CE48: ldr r0, =gBattleAnimAttacker ldrb r0, [r0] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority adds r0, 0x1 _0815CE52: adds r1, r4, 0 @@ -6034,7 +6034,7 @@ sub_815D1BC: @ 815D1BC str r4, [sp] adds r0, r6, 0 movs r1, 0x1 - bl sub_80A73E0 + bl TrySetSpriteRotScale ldrh r0, [r5, 0x20] adds r0, 0x1 strh r0, [r5, 0x20] @@ -6569,7 +6569,7 @@ sub_815D64C: @ 815D64C strh r1, [r4, 0x26] ldr r2, =gUnknown_085CE5F0 adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldr r0, =sub_815D694 str r0, [r4] pop {r4} @@ -6638,7 +6638,7 @@ _0815D708: adds r0, r4 lsls r0, 3 adds r0, r6 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 cmp r0, 0 bne _0815D720 @@ -6731,7 +6731,7 @@ sub_815D7B4: @ 815D7B4 adds r4, r0, 0 ldrh r6, [r4, 0x20] ldrh r5, [r4, 0x22] - bl sub_80A6838 + bl SetSpriteCoordsToAnimAttackerCoords ldr r0, =gBattleAnimArgs ldrb r1, [r0] adds r0, r4, 0 @@ -6810,7 +6810,7 @@ sub_815D804: @ 815D804 cmp r0, 0x3 ble _0815D86A adds r0, r5, 0 - bl move_anim_8074EE0 + bl DestroySpriteAndMatrix _0815D86A: pop {r4,r5} pop {r0} @@ -7393,7 +7393,7 @@ _0815DCEA: lsrs r0, 24 strh r0, [r5, 0x12] adds r0, r4, 0 - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x14] @@ -7406,7 +7406,7 @@ _0815DCEA: strh r1, [r5, 0x26] ldr r2, =gUnknown_085CE74C adds r0, r5, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldr r0, =sub_815DD48 str r0, [r5] pop {r4,r5} @@ -7454,7 +7454,7 @@ _0815DD82: bl sub_815DDE0 _0815DD92: adds r0, r4, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 @@ -7476,7 +7476,7 @@ _0815DDB4: lsrs r1, 24 ldr r2, =gUnknown_085CE74C adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData b _0815DDDA .pool _0815DDCC: @@ -8395,7 +8395,7 @@ _0815E4EE: ldrsh r6, [r7, r1] mov r1, r8 ldrb r0, [r1] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority adds r3, r0, 0 subs r3, 0x5 lsls r3, 24 @@ -8834,7 +8834,7 @@ _0815E85C: strh r1, [r4, 0x26] ldr r2, =gUnknown_085CE87C adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldr r0, =sub_815E898 str r0, [r4] _0815E884: @@ -8891,7 +8891,7 @@ _0815E8F0: strh r1, [r0, 0x24] _0815E8F2: adds r0, r4, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 @@ -8919,7 +8919,7 @@ _0815E8F2: lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085CE87C - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData strh r5, [r4, 0xA] strh r5, [r4, 0xC] b _0815E94E @@ -10075,7 +10075,7 @@ AnimTask_MonToSubstitute: @ 815F20C bne _0815F254 adds r0, r5, 0 movs r1, 0 - bl sub_80A7270 + bl PrepareBattlerSpriteForRotScale movs r0, 0x80 lsls r0, 1 strh r0, [r4, 0xA] @@ -10097,7 +10097,7 @@ _0815F254: ldrsh r2, [r4, r0] adds r0, r5, 0 movs r3, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r4, 0xE] adds r0, 0x1 strh r0, [r4, 0xE] @@ -10108,7 +10108,7 @@ _0815F254: movs r0, 0 strh r0, [r4, 0xE] adds r0, r5, 0 - bl sub_80A7344 + bl ResetSpriteRotScale ldr r1, =gSprites lsls r0, r5, 4 adds r0, r5 @@ -10367,7 +10367,7 @@ sub_815F48C: @ 815F48C cmp r0, 0 bne _0815F4B8 ldrb r0, [r4] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority subs r0, 0x2 adds r1, r5, 0 adds r1, 0x43 @@ -10377,7 +10377,7 @@ sub_815F48C: @ 815F48C .pool _0815F4B8: ldrb r0, [r4] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority adds r0, 0x2 adds r1, r5, 0 adds r1, 0x43 @@ -10566,7 +10566,7 @@ sub_815F620: @ 815F620 cmp r7, 0 bne _0815F66E movs r0, 0x1 - bl duplicate_obj_of_side_rel2move_in_transparent_mode + bl CloneBattlerSpriteWithBlend lsls r0, 16 lsrs r1, r0, 16 mov r10, r1 @@ -10574,7 +10574,7 @@ sub_815F620: @ 815F620 cmp r6, 0 blt _0815F66E movs r0, 0x1 - bl duplicate_obj_of_side_rel2move_in_transparent_mode + bl CloneBattlerSpriteWithBlend lsls r0, 16 lsrs r1, r0, 16 mov r9, r1 @@ -11038,7 +11038,7 @@ _0815F9F4: ldrh r6, [r0] ldr r0, =gBattleAnimAttacker ldrb r0, [r0] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority lsls r0, 24 lsrs r4, r0, 24 movs r7, 0 @@ -12329,7 +12329,7 @@ _081604DA: b _081604E8 _081604E2: adds r0, r4, 0 - bl move_anim_8074EE0 + bl DestroySpriteAndMatrix _081604E8: pop {r4} pop {r0} @@ -12403,7 +12403,7 @@ sub_8160544: @ 8160544 strh r1, [r4, 0x26] ldr r2, =gUnknown_085CE9C8 adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldr r0, =sub_816058C str r0, [r4] pop {r4} @@ -12472,7 +12472,7 @@ _08160600: adds r0, r4 lsls r0, 3 adds r0, r6 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 cmp r0, 0 bne _08160618 diff --git a/asm/dark.s b/asm/dark.s index e4373723d..d3f44db0b 100644 --- a/asm/dark.s +++ b/asm/dark.s @@ -447,7 +447,7 @@ sub_8113A58: @ 8113A58 cmp r0, 0 bne _08113A8A adds r0, r3, 0 - bl move_anim_8074EE0 + bl DestroySpriteAndMatrix _08113A8A: pop {r0} bx r0 @@ -581,7 +581,7 @@ sub_8113B90: @ 8113B90 cmp r0, 0 beq _08113BA4 adds r0, r4, 0 - bl move_anim_8074EE0 + bl DestroySpriteAndMatrix _08113BA4: pop {r4} pop {r0} @@ -1684,7 +1684,7 @@ sub_81144BC: @ 81144BC ldrb r1, [r1, 0x4] adds r0, r4, 0 bl StartSpriteAnim - ldr r0, =sub_80A67D8 + ldr r0, =RunStoredCallbackWhenAnimEnds str r0, [r4, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r4, 0 @@ -1895,7 +1895,7 @@ _0811465C: bne _08114708 adds r0, r1, 0 movs r1, 0 - bl sub_80A750C + bl SetGreyscaleOrOriginalPalette b _08114714 .pool _08114708: @@ -1984,7 +1984,7 @@ _08114776: bne _081147B8 adds r0, r1, 0 movs r1, 0x1 - bl sub_80A750C + bl SetGreyscaleOrOriginalPalette _081147B8: movs r0, 0x8 ldrsh r1, [r4, r0] @@ -2159,7 +2159,7 @@ _0811492E: adds r0, 0x10 ldr r1, =gBattleAnimArgs ldrb r1, [r1, 0x2] - bl sub_80A750C + bl SetGreyscaleOrOriginalPalette _0811494A: adds r0, r5, 0 bl DestroyAnimVisualTask diff --git a/asm/flying.s b/asm/flying.s index b981b4306..dd6ca32ae 100644 --- a/asm/flying.s +++ b/asm/flying.s @@ -201,7 +201,7 @@ _0810DFC8: strh r0, [r6, 0x36] adds r0, r6, 0 bl InitAnimLinearTranslation - ldr r0, =sub_80A67BC + ldr r0, =RunStoredCallbackWhenAffineAnimEnds str r0, [r6, 0x1C] ldr r1, =sub_810E028 adds r0, r6, 0 @@ -2056,7 +2056,7 @@ _0810EE42: str r0, [sp] adds r0, r5, 0 movs r1, 0 - bl sub_80A73E0 + bl TrySetSpriteRotScale ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] @@ -2085,7 +2085,7 @@ _0810EE92: ldrsh r3, [r5, r0] str r1, [sp] adds r0, r5, 0 - bl sub_80A73E0 + bl TrySetSpriteRotScale ldrb r1, [r5, 0x3] lsls r1, 26 lsrs r1, 27 @@ -2409,7 +2409,7 @@ sub_810F084: @ 810F084 mov r0, r8 movs r1, 0x1 adds r2, r3, 0 - bl sub_80A73E0 + bl TrySetSpriteRotScale ldr r0, =sub_810F140 mov r2, r8 str r0, [r2, 0x1C] @@ -2456,7 +2456,7 @@ sub_810F140: @ 810F140 bge _0810F180 _0810F17A: adds r0, r2, 0 - bl move_anim_8074EE0 + bl DestroySpriteAndMatrix _0810F180: pop {r0} bx r0 diff --git a/asm/ice.s b/asm/ice.s index 3202213b4..3187d3110 100644 --- a/asm/ice.s +++ b/asm/ice.s @@ -355,7 +355,7 @@ sub_810B8AC: @ 810B8AC ldr r1, =DestroyAnimSprite adds r0, r4, 0 bl StoreSpriteCallbackInData6 - ldr r1, =sub_80A634C + ldr r1, =TranslateSpriteInGrowingCircleOverDuration str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 @@ -466,7 +466,7 @@ _0810B9C6: ldr r1, =sub_810B9E8 adds r0, r4, 0 bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A67BC + ldr r0, =RunStoredCallbackWhenAffineAnimEnds str r0, [r4, 0x1C] pop {r4,r5} pop {r0} @@ -501,7 +501,7 @@ sub_810B9E8: @ 810B9E8 cmp r0, 0x14 bne _0810BA1E adds r0, r3, 0 - bl move_anim_8074EE0 + bl DestroySpriteAndMatrix _0810BA1E: pop {r0} bx r0 @@ -2816,7 +2816,7 @@ sub_810CD1C: @ 810CD1C adds r0, r4, 0 movs r1, 0x1 bl StartSpriteAnim - ldr r0, =sub_80A67D8 + ldr r0, =RunStoredCallbackWhenAnimEnds str r0, [r4, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r4, 0 diff --git a/asm/psychic.s b/asm/psychic.s index ef1915241..0a39ea856 100644 --- a/asm/psychic.s +++ b/asm/psychic.s @@ -535,7 +535,7 @@ _0810F618: cmp r0, 0 beq _0810F62C adds r0, r4, 0 - bl move_anim_8074EE0 + bl DestroySpriteAndMatrix _0810F62C: pop {r4-r6} pop {r0} @@ -589,7 +589,7 @@ _0810F692: ldr r1, =DestroyAnimSprite adds r0, r5, 0 bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A67D8 + ldr r0, =RunStoredCallbackWhenAnimEnds str r0, [r5, 0x1C] pop {r4,r5} pop {r0} @@ -656,7 +656,7 @@ _0810F722: ldr r1, =sub_810F740 adds r0, r5, 0 bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A67D8 + ldr r0, =RunStoredCallbackWhenAnimEnds str r0, [r5, 0x1C] pop {r4-r7} pop {r0} @@ -760,7 +760,7 @@ sub_810F7D4: @ 810F7D4 strh r1, [r4, 0x8] ldr r2, =gUnknown_0859675C adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldr r0, =sub_810F810 str r0, [r4] pop {r4} @@ -779,7 +779,7 @@ sub_810F810: @ 810F810 lsls r0, 3 ldr r1, =gTasks adds r0, r1 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData lsls r0, 24 cmp r0, 0 bne _0810F830 @@ -823,7 +823,7 @@ _0810F870: ldrb r1, [r4, 0x8] ldr r2, =gUnknown_0859677C adds r0, r4, 0 - bl sub_80A7CFC + bl PrepareAffineAnimInTaskData ldr r0, =sub_810F898 str r0, [r4] pop {r4} @@ -852,7 +852,7 @@ sub_810F898: @ 810F898 .pool _0810F8BC: adds r0, r4, 0 - bl sub_80A7D34 + bl RunAffineAnimFromTaskData ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] @@ -907,7 +907,7 @@ _0810F900: lsls r1, 1 strh r1, [r0, 0x20] ldrb r0, [r4, 0x8] - bl sub_80A7344 + bl ResetSpriteRotScale adds r0, r5, 0 bl DestroyAnimVisualTask _0810F936: @@ -1805,7 +1805,7 @@ sub_8110034: @ 8110034 _0811006C: ldr r1, =gBattleAnimArgs ldrb r0, [r1] - bl duplicate_obj_of_side_rel2move_in_transparent_mode + bl CloneBattlerSpriteWithBlend lsls r0, 16 lsrs r1, r0, 16 mov r9, r1 @@ -1860,7 +1860,7 @@ _08110094: lsls r2, 1 adds r1, r2, 0 movs r3, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrb r3, [r4, 0x1] lsrs r1, r3, 6 ldrb r2, [r4, 0x3] @@ -1942,14 +1942,14 @@ _08110166: ldrsh r2, [r4, r1] adds r1, r2, 0 movs r3, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x22] lsls r1, 24 lsrs r1, 24 - bl sub_80A7EC0 + bl SetBattlerSpriteYOffsetFromOtherYScale movs r2, 0xA ldrsh r0, [r4, r2] cmp r0, 0x30 @@ -1980,14 +1980,14 @@ _081101B8: ldrsh r2, [r4, r1] adds r1, r2, 0 movs r3, 0 - bl obj_id_set_rotscale + bl SetSpriteRotScale ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x22] lsls r1, 24 lsrs r1, 24 - bl sub_80A7EC0 + bl SetBattlerSpriteYOffsetFromOtherYScale movs r2, 0xA ldrsh r0, [r4, r2] cmp r0, 0 diff --git a/asm/water.s b/asm/water.s index ece2359cb..693aceddd 100644 --- a/asm/water.s +++ b/asm/water.s @@ -315,7 +315,7 @@ sub_8107408: @ 8107408 negs r1, r1 ands r1, r2 strb r1, [r3] - ldr r1, =sub_80A67D8 + ldr r1, =RunStoredCallbackWhenAnimEnds str r1, [r0, 0x1C] ldr r1, =sub_8107430 bl StoreSpriteCallbackInData6 @@ -331,7 +331,7 @@ sub_8107430: @ 8107430 strh r1, [r0, 0x2E] ldr r1, =WaitAnimForDuration str r1, [r0, 0x1C] - ldr r1, =move_anim_8074EE0 + ldr r1, =DestroySpriteAndMatrix bl StoreSpriteCallbackInData6 pop {r0} bx r0 @@ -711,7 +711,7 @@ sub_8107730: @ 8107730 ldr r6, =0x0000fff6 strh r6, [r4, 0x26] ldrb r0, [r7] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority lsls r0, 24 lsrs r5, r0, 24 bl IsContest @@ -1906,7 +1906,7 @@ sub_81080E4: @ 81080E4 lsls r0, 24 lsrs r0, 24 movs r1, 0 - bl sub_80A7270 + bl PrepareBattlerSpriteForRotScale ldr r0, =sub_8108140 str r0, [r4] pop {r4} @@ -2026,7 +2026,7 @@ _08108222: ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 - bl sub_80A7E6C + bl SetBattlerSpriteYOffsetFromYScale ldr r2, =gSprites movs r0, 0x26 ldrsh r1, [r4, r0] @@ -2166,7 +2166,7 @@ _08108320: ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 - bl sub_80A7344 + bl ResetSpriteRotScale movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 @@ -2286,7 +2286,7 @@ sub_8108408: @ 8108408 lsrs r6, r0, 24 movs r5, 0xAC ldrb r0, [r4] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority subs r0, 0x1 lsls r0, 24 lsrs r0, 24 @@ -3517,7 +3517,7 @@ _08108DE2: strh r0, [r4, 0x30] ldr r0, =gBattleAnimAttacker ldrb r0, [r0] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority subs r0, 0x1 adds r1, r4, 0 adds r1, 0x43 @@ -3572,7 +3572,7 @@ _08108E58: strh r0, [r4, 0x30] ldr r0, =gBattleAnimAttacker ldrb r0, [r0] - bl GetBattlerSubpriority + bl GetBattlerSpriteSubpriority subs r0, 0x1 adds r1, r4, 0 adds r1, 0x43 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index bc04e3993..014aa2048 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1326,7 +1326,7 @@ Move_SWORDS_DANCE: setalpha 12, 8 playsewithpan SE_W014, SOUND_PAN_ATTACKER createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 16, 6, 1, 4 - createsprite gBattleAnimSpriteTemplate_8593380, ANIM_ATTACKER, 2, 0, 0 + createsprite gSwordsDanceBladeSpriteTemplate, ANIM_ATTACKER, 2, 0, 0 delay 22 createvisualtask sub_8115D94, 2, ANIM_TAG_SWORD, 2, 2, RGB(18, 31, 31), 16, 0, 0 waitforvisualfinish @@ -1712,10 +1712,10 @@ Frustration_Strongest: waitforvisualfinish delay 20 playsewithpan SE_W207B, SOUND_PAN_ATTACKER - createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28 waitforvisualfinish playsewithpan SE_W207B, SOUND_PAN_ATTACKER - createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28 waitforvisualfinish delay 10 createvisualtask AnimTask_SwayMon, 5, 0, 16, 6144, 8, ANIM_ATTACKER @@ -1748,7 +1748,7 @@ Frustration_Strong: waitforvisualfinish delay 20 playsewithpan SE_W207B, SOUND_PAN_ATTACKER - createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28 waitforvisualfinish delay 5 createvisualtask sub_815C3A8, 5 @@ -1769,7 +1769,7 @@ Frustration_Strong: goto Frustration_Continue Frustration_Medium: playsewithpan SE_W207B, SOUND_PAN_ATTACKER - createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28 waitforvisualfinish delay 5 createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 4 @@ -1843,8 +1843,8 @@ Move_VICE_GRIP: monbg ANIM_DEF_PARTNER setalpha 12, 8 playsewithpan SE_W011, SOUND_PAN_TARGET - createsprite gUnknown_08593590, ANIM_ATTACKER, 2, 0 - createsprite gUnknown_08593590, ANIM_ATTACKER, 2, 1 + createsprite gViceGripSpriteTemplate, ANIM_ATTACKER, 2, 0 + createsprite gViceGripSpriteTemplate, ANIM_ATTACKER, 2, 1 delay 9 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 1, 0, 0, 1, 2 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 5, 1 @@ -1861,8 +1861,8 @@ Move_GUILLOTINE: fadetobgfromset BG_GUILLOTINE_OPPONENT, BG_GUILLOTINE_PLAYER, BG_GUILLOTINE_CONTESTS waitbgfadein playsewithpan SE_W011, SOUND_PAN_TARGET - createsprite gUnknown_085935D0, ANIM_ATTACKER, 2, 0 - createsprite gUnknown_085935D0, ANIM_ATTACKER, 2, 1 + createsprite gGuillotineSpriteTemplate, ANIM_ATTACKER, 2, 0 + createsprite gGuillotineSpriteTemplate, ANIM_ATTACKER, 2, 1 createvisualtask sub_8116620, 10, 4, 2, 0, 16, RGB_BLACK delay 9 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 23, 1 @@ -2750,10 +2750,10 @@ Move_RAGE: monbg ANIM_TARGET setalpha 12, 8 createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_ATTACKER, RGB_RED, 10, 0, 2 - createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, -20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, -20, -28 playsewithpan SE_W207B, SOUND_PAN_ATTACKER delay 20 - createsprite gUnknown_0859368C, ANIM_ATTACKER, 2, 0, 20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, -28 playsewithpan SE_W207B, SOUND_PAN_ATTACKER waitforvisualfinish createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 6 @@ -2803,7 +2803,7 @@ Move_DOUBLE_TEAM: Move_MINIMIZE: setalpha 10, 8 - createvisualtask sub_8104674, 2 + createvisualtask AnimTask_Minimize, 2 loopsewithpan SE_W107, SOUND_PAN_ATTACKER, 34, 3 waitforvisualfinish blendoff @@ -2872,8 +2872,8 @@ Move_KINESIS: playsewithpan SE_W060, SOUND_PAN_ATTACKER call SetPsychicBackground createsprite gUnknown_085966DC, ANIM_ATTACKER, 20 - createsprite gUnknown_08593344, ANIM_ATTACKER, 19, 32, -8, 0 - createsprite gUnknown_08593344, ANIM_ATTACKER, 19, 32, 16, 1 + createsprite gKinesisZapEnergySpriteTemplate, ANIM_ATTACKER, 19, 32, -8, 0 + createsprite gKinesisZapEnergySpriteTemplate, ANIM_ATTACKER, 19, 32, 16, 1 loopsewithpan SE_W109, SOUND_PAN_ATTACKER, 21, 2 delay 60 playsewithpan SE_W146, SOUND_PAN_ATTACKER @@ -3278,17 +3278,17 @@ Move_FALSE_SWIPE: Move_SWAGGER: loadspritegfx ANIM_TAG_BREATH loadspritegfx ANIM_TAG_ANGER - createvisualtask sub_8104AB4, 2 + createvisualtask AnimTask_GrowAndShrink, 2 playsewithpan SE_W207, SOUND_PAN_ATTACKER waitforvisualfinish - createsprite gUnknown_08593658, ANIM_ATTACKER, 2 + createsprite gBreathPuffSpriteTemplate, ANIM_ATTACKER, 2 loopsewithpan SE_W207, SOUND_PAN_ATTACKER, 4, 2 waitforvisualfinish delay 24 - createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, -20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, -20, -28 playsewithpan SE_W207B, SOUND_PAN_TARGET delay 12 - createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, 20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, 20, -28 playsewithpan SE_W207B, SOUND_PAN_TARGET waitforvisualfinish end @@ -3496,10 +3496,10 @@ Move_TORMENT: createvisualtask sub_815AFF0, 2 waitforvisualfinish createvisualtask AnimTask_BlendMonInAndOut, 2, ANIM_TARGET, RGB_RED, 10, 1, 1 - createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, -20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, -20, -28 playsewithpan SE_W207B, SOUND_PAN_TARGET delay 20 - createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, 20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, 20, -28 playsewithpan SE_W207B, SOUND_PAN_TARGET end @@ -3606,11 +3606,11 @@ Move_TAUNT: loopsewithpan SE_W039, SOUND_PAN_ATTACKER, 16, 2 waitforvisualfinish delay 8 - createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, -20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, -20, -28 playsewithpan SE_W207B, SOUND_PAN_TARGET waitforvisualfinish delay 12 - createsprite gUnknown_0859368C, ANIM_TARGET, 2, 1, 20, -28 + createsprite gAngerMarkSpriteTemplate, ANIM_TARGET, 2, 1, 20, -28 playsewithpan SE_W207B, SOUND_PAN_TARGET end @@ -4381,10 +4381,10 @@ Move_HOWL: Move_BULK_UP: loadspritegfx ANIM_TAG_BREATH - createvisualtask sub_8104AB4, 2 + createvisualtask AnimTask_GrowAndShrink, 2 playsewithpan SE_W207, SOUND_PAN_ATTACKER waitforvisualfinish - createsprite gUnknown_08593658, ANIM_ATTACKER, 2 + createsprite gBreathPuffSpriteTemplate, ANIM_ATTACKER, 2 loopsewithpan SE_W207, SOUND_PAN_ATTACKER, 4, 2 waitforvisualfinish end @@ -5386,7 +5386,7 @@ IceBeam1: Move_WITHDRAW: playsewithpan SE_W029, SOUND_PAN_ATTACKER - createvisualtask sub_81036A0, 5 + createvisualtask AnimTask_Withdraw, 5 waitforvisualfinish end @@ -7509,9 +7509,9 @@ RazorWindContinue: RazorWindSetUp: loadspritegfx ANIM_TAG_GUST playsewithpan SE_W016, SOUND_PAN_ATTACKER - createsprite gUnknown_08593550, ANIM_ATTACKER, 2, 32, 0, 16, 16, 0, 7, 40 - createsprite gUnknown_08593550, ANIM_ATTACKER, 2, 32, 0, 16, 16, 85, 7, 40 - createsprite gUnknown_08593550, ANIM_ATTACKER, 2, 32, 0, 16, 16, 170, 7, 40 + createsprite gRazorWindTornadoSpriteTemplate, ANIM_ATTACKER, 2, 32, 0, 16, 16, 0, 7, 40 + createsprite gRazorWindTornadoSpriteTemplate, ANIM_ATTACKER, 2, 32, 0, 16, 16, 85, 7, 40 + createsprite gRazorWindTornadoSpriteTemplate, ANIM_ATTACKER, 2, 32, 0, 16, 16, 170, 7, 40 waitforvisualfinish playsewithpan SE_W016B, SOUND_PAN_ATTACKER goto RazorWindContinue @@ -7546,7 +7546,7 @@ Move_DISABLE: playsewithpan SE_W197, SOUND_PAN_ATTACKER createsprite gUnknown_0853EE84, ANIM_ATTACKER, 13, 24, -16 waitforvisualfinish - createvisualtask sub_81045B0, 5 + createvisualtask AnimTask_GrowAndGreyscale, 5 loopsewithpan SE_W020, SOUND_PAN_TARGET, 15, 4 waitforvisualfinish delay 1 diff --git a/include/battle.h b/include/battle.h index c06bdaad5..52c4ee8ae 100644 --- a/include/battle.h +++ b/include/battle.h @@ -623,7 +623,7 @@ struct BattleHealthboxInfo u8 battlerBounceSpriteId; u8 animationState; u8 field_5; - u8 field_6; + u8 matrixNum; u8 shadowSpriteId; u8 field_8; u8 field_9; diff --git a/include/battle_anim.h b/include/battle_anim.h index 4a88aaa8f..cdeb60e69 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -76,8 +76,8 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId); // battle_anim_80A5C6C.s void sub_80A6450(struct Sprite *sprite); void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y); -void move_anim_8074EE0(struct Sprite *sprite); -void sub_80A656C(struct Sprite *sprite); +void DestroySpriteAndMatrix(struct Sprite *sprite); +void TranslateAnimLinearSimple(struct Sprite *sprite); void InitAnimSpritePos(struct Sprite *sprite, u8 a2); void sub_80A6980(struct Sprite *sprite, bool8 a2); void StartAnimLinearTranslation(struct Sprite *sprite); @@ -88,11 +88,11 @@ void sub_80A8EE4(struct Sprite *sprite); u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId); void sub_80A6FD4(struct Sprite *sprite); u16 ArcTan2Neg(s16 a, s16 b); -void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation); -void sub_80A67BC(struct Sprite *sprite); +void TrySetSpriteRotScale(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation); +void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite); void sub_80A66DC(struct Sprite *sprite); -void sub_80A6838(struct Sprite *sprite); -void sub_80A67D8(struct Sprite *sprite); +void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite); +void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite); void sub_80A6864(struct Sprite *sprite, s16 a2); s16 sub_80A861C(u8 battlerId, u8 a2); u8 GetBattlerYCoordWithElevation(u8 battlerId); @@ -101,32 +101,32 @@ void sub_80A7938(struct Sprite *sprite); void InitAnimLinearTranslation(struct Sprite *sprite); void sub_80A6F98(struct Sprite *sprite); u8 sub_80A8328(u8 battlerId); -void *sub_80A8050(s16 bottom, s16 top); -void sub_80A8048(s16 *bottom, s16 *top, const void *ptr); +void *LoadPointerFromVars(s16 bottom, s16 top); +void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void sub_80A8278(void); void sub_80A6B30(struct UnknownAnimStruct2*); void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1); -u8 GetBattlerSubpriority(u8 battlerId); +u8 GetBattlerSpriteSubpriority(u8 battlerId); bool8 TranslateAnimArc(struct Sprite *sprite); void sub_80A6630(struct Sprite *sprite); void sub_80A6680(struct Sprite *sprite); -void sub_80A7344(u8 spriteId); -void obj_id_set_rotscale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); +void ResetSpriteRotScale(u8 spriteId); +void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); void InitSpriteDataForLinearTranslation(struct Sprite *sprite); -void sub_80A7270(u8 spriteId, u8 objMode); -void sub_80A73A0(u8 spriteId); +void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode); +void SetBattlerSpriteYOffsetFromRotation(u8 spriteId); u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4); u8 sub_80A77AC(u8 a1); -s16 duplicate_obj_of_side_rel2move_in_transparent_mode(u8); +s16 CloneBattlerSpriteWithBlend(u8); void obj_delete_but_dont_free_vram(struct Sprite*); u8 sub_80A89C8(int, u8, int); void sub_80A6D60(struct UnknownAnimStruct2*, const void*, u32); void sub_80A6CC0(u32, const void*, u32); void sub_80A6DAC(bool8); -void sub_80A634C(struct Sprite *); +void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *); void sub_80A653C(struct Sprite *); -void sub_80A7E6C(u8 spriteId); +void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); u8 sub_80A80C8(struct Task *task); void sub_80A8EE4(struct Sprite *); @@ -139,10 +139,10 @@ void TranslateMonBGUntil(struct Sprite *sprite); void TranslateSpriteOverDuration(struct Sprite *sprite); void sub_80A77C8(struct Sprite *sprite); void sub_80A7000(struct Sprite *sprite); -void sub_80A62EC(struct Sprite *sprite); -void sub_80A750C(u16 a1, bool8 a2); -void sub_80A7CFC(struct Task *task, u8 a2, const void *a3); -bool8 sub_80A7D34(struct Task *task); +void TranslateSpriteInCircleOverDuration(struct Sprite *sprite); +void SetGreyscaleOrOriginalPalette(u16 a1, bool8 a2); +void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds); +bool8 RunAffineAnimFromTaskData(struct Task *task); void sub_80A78AC(struct Sprite *sprite); enum @@ -150,8 +150,8 @@ enum BATTLER_COORD_X, BATTLER_COORD_Y, BATTLER_COORD_X_2, - BATTLER_COORD_3, - BATTLER_COORD_4, + BATTLER_COORD_Y_PIC_OFFSET, + BATTLER_COORD_Y_PIC_OFFSET_DEFAULT, }; u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId); diff --git a/include/contest.h b/include/contest.h index c205737ee..6ce563b46 100644 --- a/include/contest.h +++ b/include/contest.h @@ -416,7 +416,6 @@ extern struct ContestResources *gContestResources; #define eContestAI (gContestResources->field_C) #define shared19328 (*gContestResources->field_10) #define shared19338 (*gContestResources->field_14) -#define shared19348 (*gContestResources->field_18) #define shared15800 (gHeap + 0x18000) #define shared18000 (*(struct Shared18000 *)(gHeap + 0x1a000)) diff --git a/src/battle_anim.c b/src/battle_anim.c index c3fa2e2aa..88c548208 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1656,7 +1656,7 @@ static void ScriptCmd_createsprite(void) else argVar *= -1; - subpriority = GetBattlerSubpriority(gBattleAnimTarget) + (s8)(argVar); + subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (s8)(argVar); } else { @@ -1665,7 +1665,7 @@ static void ScriptCmd_createsprite(void) else argVar *= -1; - subpriority = GetBattlerSubpriority(gBattleAnimAttacker) + (s8)(argVar); + subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + (s8)(argVar); } if (subpriority < 3) diff --git a/src/battle_anim_80A5C6C.c b/src/battle_anim_80A5C6C.c index c4cf1600b..28196a345 100644 --- a/src/battle_anim_80A5C6C.c +++ b/src/battle_anim_80A5C6C.c @@ -40,18 +40,17 @@ void sub_80A7144(struct Sprite *sprite); void sub_80A791C(struct Sprite *sprite); void sub_80A8DFC(struct Sprite *sprite); void sub_80A8E88(struct Sprite *sprite); -void sub_80A7E6C(u8 spriteId); -u16 sub_80A7F18(u8 spriteId); +void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); +u16 GetBattlerYDeltaFromSpriteId(u8 spriteId); void AnimTask_BlendMonInAndOutSetup(struct Task *task); void sub_80A7AFC(u8 taskId); void sub_80A8CAC(u8 taskId); void AnimTask_BlendMonInAndOutStep(u8 taskId); bool8 sub_80A7238(void); -u8 GetBattlerSubpriority(u8 battlerId); void sub_80A8D78(struct Task *task, u8 taskId); // EWRAM vars -EWRAM_DATA static union AffineAnimCmd *gUnknown_02038444 = NULL; +EWRAM_DATA static union AffineAnimCmd *gAnimTaskAffineAnim = NULL; // Const rom data static const struct UCoords8 sBattlerCoords[][4] = @@ -124,8 +123,7 @@ static const struct SpriteSheet sUnknown_08525FC0[] = { gMiscBlank_Gfx, 0x800, 55126, }, }; -// code -u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId) +u8 GetBattlerSpriteCoord(u8 battlerId, u8 coordType) { u8 retVal; u16 species; @@ -133,11 +131,11 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId) if (IsContest()) { - if (attributeId == BATTLER_COORD_3 && battlerId == 3) - attributeId = BATTLER_COORD_Y; + if (coordType == BATTLER_COORD_Y_PIC_OFFSET && battlerId == 3) + coordType = BATTLER_COORD_Y; } - switch (attributeId) + switch (coordType) { case BATTLER_COORD_X: case BATTLER_COORD_X_2: @@ -146,15 +144,15 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId) case BATTLER_COORD_Y: retVal = sBattlerCoords[IS_DOUBLE_BATTLE()][GetBattlerPosition(battlerId)].y; break; - case BATTLER_COORD_3: - case BATTLER_COORD_4: + case BATTLER_COORD_Y_PIC_OFFSET: + case BATTLER_COORD_Y_PIC_OFFSET_DEFAULT: default: if (IsContest()) { - if (shared19348.unk4_0) - species = shared19348.unk2; + if (gContestResources->field_18->unk4_0) + species = gContestResources->field_18->unk2; else - species = shared19348.species; + species = gContestResources->field_18->species; } else { @@ -175,7 +173,7 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId) species = spriteInfo[battlerId].transformSpecies; } } - if (attributeId == BATTLER_COORD_3) + if (coordType == BATTLER_COORD_Y_PIC_OFFSET) retVal = GetBattlerSpriteFinal_Y(battlerId, species, TRUE); else retVal = GetBattlerSpriteFinal_Y(battlerId, species, FALSE); @@ -199,10 +197,10 @@ u8 GetBattlerYDelta(u8 battlerId, u16 species) { if (IsContest()) { - if (shared19348.unk4_0) - personality = shared19348.unk10; + if (gContestResources->field_18->unk4_0) + personality = gContestResources->field_18->unk10; else - personality = shared19348.unk8; + personality = gContestResources->field_18->unk8; } else { @@ -307,19 +305,19 @@ u8 GetBattlerSpriteFinal_Y(u8 battlerId, u16 species, bool8 a3) return y; } -u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId) +u8 GetBattlerSpriteCoord2(u8 battlerId, u8 coordType) { u16 species; struct BattleSpriteInfo *spriteInfo; - if (attributeId == BATTLER_COORD_3 || attributeId == BATTLER_COORD_4) + if (coordType == BATTLER_COORD_Y_PIC_OFFSET || coordType == BATTLER_COORD_Y_PIC_OFFSET_DEFAULT) { if (IsContest()) { - if (shared19348.unk4_0) - species = shared19348.unk2; + if (gContestResources->field_18->unk4_0) + species = gContestResources->field_18->unk2; else - species = shared19348.species; + species = gContestResources->field_18->species; } else { @@ -329,20 +327,20 @@ u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId) else species = spriteInfo[battlerId].transformSpecies; } - if (attributeId == BATTLER_COORD_3) + if (coordType == BATTLER_COORD_Y_PIC_OFFSET) return GetBattlerSpriteFinal_Y(battlerId, species, TRUE); else return GetBattlerSpriteFinal_Y(battlerId, species, FALSE); } else { - return GetBattlerSpriteCoord(battlerId, attributeId); + return GetBattlerSpriteCoord(battlerId, coordType); } } u8 GetBattlerSpriteDefault_Y(u8 battlerId) { - return GetBattlerSpriteCoord(battlerId, BATTLER_COORD_4); + return GetBattlerSpriteCoord(battlerId, BATTLER_COORD_Y_PIC_OFFSET_DEFAULT); } u8 GetSubstituteSpriteDefault_Y(u8 battlerId) @@ -386,11 +384,11 @@ u8 GetBattlerYCoordWithElevation(u8 battlerId) return y; } -u8 GetAnimBattlerSpriteId(u8 which) +u8 GetAnimBattlerSpriteId(u8 animBattler) { u8 *sprites; - if (which == ANIM_ATTACKER) + if (animBattler == ANIM_ATTACKER) { if (IsBattlerSpritePresent(gBattleAnimAttacker)) { @@ -402,7 +400,7 @@ u8 GetAnimBattlerSpriteId(u8 which) return 0xff; } } - else if (which == ANIM_TARGET) + else if (animBattler == ANIM_TARGET) { if (IsBattlerSpritePresent(gBattleAnimTarget)) { @@ -414,7 +412,7 @@ u8 GetAnimBattlerSpriteId(u8 which) return 0xff; } } - else if (which == ANIM_ATK_PARTNER) + else if (animBattler == ANIM_ATK_PARTNER) { if (!IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) return 0xff; @@ -442,7 +440,7 @@ void SetCallbackToStoredInData6(struct Sprite *sprite) sprite->callback = (void (*)(struct Sprite *))callback; } -void sub_80A62EC(struct Sprite *sprite) +void TranslateSpriteInCircleOverDuration(struct Sprite *sprite) { if (sprite->data[3]) { @@ -461,7 +459,7 @@ void sub_80A62EC(struct Sprite *sprite) } } -void sub_80A634C(struct Sprite *sprite) +void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *sprite) { if (sprite->data[3]) { @@ -570,7 +568,7 @@ void TranslateSpriteOverDuration(struct Sprite *sprite) } } -void sub_80A656C(struct Sprite *sprite) +void TranslateAnimLinearSimple(struct Sprite *sprite) { if (sprite->data[0] > 0) { @@ -665,7 +663,7 @@ void sub_80A66DC(struct Sprite *sprite) } } -void move_anim_8074EE0(struct Sprite *sprite) +void DestroySpriteAndMatrix(struct Sprite *sprite) { FreeSpriteOamMatrix(sprite); DestroyAnimSprite(sprite); @@ -683,16 +681,16 @@ void sub_80A6760(struct Sprite *sprite) void sub_80A67A4(struct Sprite *sprite) { ResetPaletteStructByUid(sprite->data[5]); - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } -void sub_80A67BC(struct Sprite *sprite) +void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite) { if (sprite->affineAnimEnded) SetCallbackToStoredInData6(sprite); } -void sub_80A67D8(struct Sprite *sprite) +void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite) { if (sprite->animEnded) SetCallbackToStoredInData6(sprite); @@ -712,31 +710,31 @@ void sub_80A6814(u8 taskId) DestroyAnimVisualTask(taskId); } -void sub_80A6838(struct Sprite *sprite) +void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite) { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } -void sub_80A6864(struct Sprite *sprite, s16 a2) +void sub_80A6864(struct Sprite *sprite, s16 xOffset) { - u16 v1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - u16 v2 = GetBattlerSpriteCoord(gBattleAnimTarget, 0); + u16 attackerX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + u16 targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); - if (v1 > v2) + if (attackerX > targetX) { - sprite->pos1.x -= a2; + sprite->pos1.x -= xOffset; } - else if (v1 < v2) + else if (attackerX < targetX) { - sprite->pos1.x += a2; + sprite->pos1.x += xOffset; } else { - if (GetBattlerSide(gBattleAnimAttacker) != 0) - sprite->pos1.x -= a2; + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos1.x -= xOffset; else - sprite->pos1.x += a2; + sprite->pos1.x += xOffset; } } @@ -779,24 +777,24 @@ void sub_80A6980(struct Sprite *sprite, bool8 a2) { if (!a2) { - sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimTarget, 0); - sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimTarget, 1); + sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_X); + sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_Y); } sub_80A6864(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; } -void InitAnimSpritePos(struct Sprite *sprite, u8 a2) +void InitAnimSpritePos(struct Sprite *sprite, u8 respectMonPicOffsets) { - if (!a2) + if (!respectMonPicOffsets) { - sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, 0); - sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, 1); + sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_X); + sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_Y); } else { - sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, 3); + sprite->pos1.x = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord2(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } sub_80A6864(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; @@ -1208,7 +1206,7 @@ void sub_80A718C(struct Sprite *sprite) sprite->callback(sprite); } -void obj_id_set_rotscale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation) +void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation) { int i; struct ObjAffineSrcData src; @@ -1242,7 +1240,7 @@ bool8 sub_80A7238(void) } } -void sub_80A7270(u8 spriteId, u8 objMode) +void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode) { u8 battlerId = gSprites[spriteId].data[0]; @@ -1251,32 +1249,34 @@ void sub_80A7270(u8 spriteId, u8 objMode) gSprites[spriteId].oam.objMode = objMode; gSprites[spriteId].affineAnimPaused = TRUE; if (!IsContest() && !gSprites[spriteId].oam.affineMode) - gSprites[spriteId].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[battlerId].field_6; - gSprites[spriteId].oam.affineMode = 3; + gSprites[spriteId].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[battlerId].matrixNum; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE; CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); } -void sub_80A7344(u8 spriteId) +void ResetSpriteRotScale(u8 spriteId) { - obj_id_set_rotscale(spriteId, 0x100, 0x100, 0); - gSprites[spriteId].oam.affineMode = 1; + SetSpriteRotScale(spriteId, 0x100, 0x100, 0); + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; gSprites[spriteId].oam.objMode = 0; gSprites[spriteId].affineAnimPaused = FALSE; CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); } -void sub_80A73A0(u8 spriteId) +// Sets the sprite's y offset equal to the y displacement caused by the +// matrix's rotation. +void SetBattlerSpriteYOffsetFromRotation(u8 spriteId) { - u16 matrix = gSprites[spriteId].oam.matrixNum; - s16 c = gOamMatrices[matrix].c; - + u16 matrixNum = gSprites[spriteId].oam.matrixNum; + // The "c" component of the battler sprite matrix contains the sine of the rotation angle divided by some scale amount. + s16 c = gOamMatrices[matrixNum].c; if (c < 0) c = -c; + gSprites[spriteId].pos2.y = c >> 3; } -// related to obj_id_set_rotscale -void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation) +void TrySetSpriteRotScale(struct Sprite *sprite, bool8 recalcCenterVector, s16 xScale, s16 yScale, u16 rotation) { int i; struct ObjAffineSrcData src; @@ -1285,7 +1285,7 @@ void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 ro if (sprite->oam.affineMode & 1) { sprite->affineAnimPaused = TRUE; - if (a2) + if (recalcCenterVector) CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); src.xScale = xScale; src.yScale = yScale; @@ -1303,7 +1303,7 @@ void sub_80A73E0(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 ro void sub_80A749C(struct Sprite *sprite) { - sub_80A73E0(sprite, TRUE, 0x100, 0x100, 0); + TrySetSpriteRotScale(sprite, TRUE, 0x100, 0x100, 0); sprite->affineAnimPaused = FALSE; CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); } @@ -1319,32 +1319,32 @@ u16 ArcTan2Neg(s16 a, s16 b) return -var; } -void sub_80A750C(u16 a1, bool8 a2) +void SetGreyscaleOrOriginalPalette(u16 paletteNum, bool8 restoreOriginalColor) { int i; - struct PlttData *c; - struct PlttData *c2; + struct PlttData *originalColor; + struct PlttData *destColor; u16 average; - a1 *= 0x10; + paletteNum *= 16; - if (!a2) + if (!restoreOriginalColor) { - for (i = 0; i < 0x10; i++) + for (i = 0; i < 16; i++) { - c = (struct PlttData *)&gPlttBufferUnfaded[a1 + i]; - average = c->r + c->g + c->b; + originalColor = (struct PlttData *)&gPlttBufferUnfaded[paletteNum + i]; + average = originalColor->r + originalColor->g + originalColor->b; average /= 3; - c2 = (struct PlttData *)&gPlttBufferFaded[a1 + i]; - c2->r = average; - c2->g = average; - c2->b = average; + destColor = (struct PlttData *)&gPlttBufferFaded[paletteNum + i]; + destColor->r = average; + destColor->g = average; + destColor->b = average; } } else { - CpuCopy32(&gPlttBufferUnfaded[a1], &gPlttBufferFaded[a1], 0x20); + CpuCopy32(&gPlttBufferUnfaded[paletteNum], &gPlttBufferFaded[paletteNum], 32); } } @@ -1479,7 +1479,7 @@ void sub_80A77C8(struct Sprite *sprite) } else if (sprite->animEnded || sprite->affineAnimEnded) { - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } } @@ -1494,7 +1494,7 @@ void sub_80A77C8(struct Sprite *sprite) void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) { bool8 v1; - u8 attributeId; + u8 coordType; if (!(gBattleAnimArgs[5] & 0xff00)) v1 = TRUE; @@ -1502,9 +1502,9 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) v1 = FALSE; if (!(gBattleAnimArgs[5] & 0xff)) - attributeId = BATTLER_COORD_3; + coordType = BATTLER_COORD_Y_PIC_OFFSET; else - attributeId = BATTLER_COORD_Y; + coordType = BATTLER_COORD_Y; InitAnimSpritePos(sprite, v1); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -1512,7 +1512,7 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, attributeId) + gBattleAnimArgs[3]; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, coordType) + gBattleAnimArgs[3]; sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -1544,7 +1544,7 @@ void sub_80A7938(struct Sprite *sprite) if (!gBattleAnimArgs[6]) { r4 = TRUE; - attributeId = BATTLER_COORD_3; + attributeId = BATTLER_COORD_Y_PIC_OFFSET; } else { @@ -1571,19 +1571,19 @@ void sub_80A7938(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -s16 duplicate_obj_of_side_rel2move_in_transparent_mode(u8 whichBattler) +s16 CloneBattlerSpriteWithBlend(u8 animBattler) { u16 i; - u8 spriteId = GetAnimBattlerSpriteId(whichBattler); + u8 spriteId = GetAnimBattlerSpriteId(animBattler); - if (spriteId != 0xff) + if (spriteId != 0xFF) { for (i = 0; i < MAX_SPRITES; i++) { if (!gSprites[i].inUse) { gSprites[i] = gSprites[spriteId]; - gSprites[i].oam.objMode = 1; + gSprites[i].oam.objMode = ST_OAM_OBJ_BLEND; gSprites[i].invisible = FALSE; return i; } @@ -1730,49 +1730,49 @@ void sub_80A7CB4(u8 task) AnimTask_BlendMonInAndOutSetup(&gTasks[task]); } -void sub_80A7CFC(struct Task *task, u8 a2, const void *a3) +void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds) { task->data[7] = 0; task->data[8] = 0; task->data[9] = 0; - task->data[15] = a2; + task->data[15] = spriteId; task->data[10] = 0x100; task->data[11] = 0x100; task->data[12] = 0; - sub_80A8048(&task->data[13], &task->data[14], a3); - sub_80A7270(a2, 0); + StorePointerInVars(&task->data[13], &task->data[14], affineAnimCmds); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); } -bool8 sub_80A7D34(struct Task *task) +bool8 RunAffineAnimFromTaskData(struct Task *task) { - gUnknown_02038444 = sub_80A8050(task->data[13], task->data[14]) + (task->data[7] << 3); - switch (gUnknown_02038444->type) + gAnimTaskAffineAnim = LoadPointerFromVars(task->data[13], task->data[14]) + (task->data[7] << 3); + switch (gAnimTaskAffineAnim->type) { default: - if (!gUnknown_02038444->frame.duration) + if (!gAnimTaskAffineAnim->frame.duration) { - task->data[10] = gUnknown_02038444->frame.xScale; - task->data[11] = gUnknown_02038444->frame.yScale; - task->data[12] = gUnknown_02038444->frame.rotation; + task->data[10] = gAnimTaskAffineAnim->frame.xScale; + task->data[11] = gAnimTaskAffineAnim->frame.yScale; + task->data[12] = gAnimTaskAffineAnim->frame.rotation; task->data[7]++; - gUnknown_02038444++; + gAnimTaskAffineAnim++; } - task->data[10] += gUnknown_02038444->frame.xScale; - task->data[11] += gUnknown_02038444->frame.yScale; - task->data[12] += gUnknown_02038444->frame.rotation; - obj_id_set_rotscale(task->data[15], task->data[10], task->data[11], task->data[12]); - sub_80A7E6C(task->data[15]); - if (++task->data[8] >= gUnknown_02038444->frame.duration) + task->data[10] += gAnimTaskAffineAnim->frame.xScale; + task->data[11] += gAnimTaskAffineAnim->frame.yScale; + task->data[12] += gAnimTaskAffineAnim->frame.rotation; + SetSpriteRotScale(task->data[15], task->data[10], task->data[11], task->data[12]); + SetBattlerSpriteYOffsetFromYScale(task->data[15]); + if (++task->data[8] >= gAnimTaskAffineAnim->frame.duration) { task->data[8] = 0; task->data[7]++; } break; case AFFINEANIMCMDTYPE_JUMP: - task->data[7] = gUnknown_02038444->jump.target; + task->data[7] = gAnimTaskAffineAnim->jump.target; break; case AFFINEANIMCMDTYPE_LOOP: - if (gUnknown_02038444->loop.count) + if (gAnimTaskAffineAnim->loop.count) { if (task->data[9]) { @@ -1784,7 +1784,7 @@ bool8 sub_80A7D34(struct Task *task) } else { - task->data[9] = gUnknown_02038444->loop.count; + task->data[9] = gAnimTaskAffineAnim->loop.count; } if (!task->data[7]) { @@ -1793,8 +1793,8 @@ bool8 sub_80A7D34(struct Task *task) for (;;) { task->data[7]--; - gUnknown_02038444--; - if (gUnknown_02038444->type == AFFINEANIMCMDTYPE_LOOP) + gAnimTaskAffineAnim--; + if (gAnimTaskAffineAnim->type == AFFINEANIMCMDTYPE_LOOP) { task->data[7]++; return TRUE; @@ -1807,36 +1807,40 @@ bool8 sub_80A7D34(struct Task *task) break; case AFFINEANIMCMDTYPE_END: gSprites[task->data[15]].pos2.y = 0; - sub_80A7344(task->data[15]); + ResetSpriteRotScale(task->data[15]); return FALSE; } return TRUE; } -void sub_80A7E6C(u8 spriteId) +// Sets the sprite's y offset equal to the y displacement caused by the +// matrix's scale in the y dimension. +void SetBattlerSpriteYOffsetFromYScale(u8 spriteId) { - int var = 0x40 - sub_80A7F18(spriteId) * 2; + int var = 64 - GetBattlerYDeltaFromSpriteId(spriteId) * 2; u16 matrix = gSprites[spriteId].oam.matrixNum; int var2 = (var << 8) / gOamMatrices[matrix].d; - if (var2 > 0x80) - var2 = 0x80; + if (var2 > 128) + var2 = 128; gSprites[spriteId].pos2.y = (var - var2) / 2; } -void sub_80A7EC0(u8 spriteId, u8 spriteId2) +// Sets the sprite's y offset equal to the y displacement caused by another sprite +// matrix's scale in the y dimension. +void SetBattlerSpriteYOffsetFromOtherYScale(u8 spriteId, u8 otherSpriteId) { - int var = 0x40 - sub_80A7F18(spriteId2) * 2; + int var = 64 - GetBattlerYDeltaFromSpriteId(otherSpriteId) * 2; u16 matrix = gSprites[spriteId].oam.matrixNum; int var2 = (var << 8) / gOamMatrices[matrix].d; - if (var2 > 0x80) - var2 = 0x80; + if (var2 > 128) + var2 = 128; gSprites[spriteId].pos2.y = (var - var2) / 2; } -u16 sub_80A7F18(u8 spriteId) +u16 GetBattlerYDeltaFromSpriteId(u8 spriteId) { struct BattleSpriteInfo *spriteInfo; u8 battlerId = gSprites[spriteId].data[0]; @@ -1849,7 +1853,7 @@ u16 sub_80A7F18(u8 spriteId) { if (IsContest()) { - species = shared19348.species; + species = gContestResources->field_18->species; return gMonBackPicCoords[species].y_offset; } else @@ -1883,18 +1887,18 @@ u16 sub_80A7F18(u8 spriteId) } } } - return 0x40; + return 64; } -void sub_80A8048(s16 *bottom, s16 *top, const void *ptr) +void StorePointerInVars(s16 *lo, s16 *hi, const void *ptr) { - *bottom = ((intptr_t) ptr) & 0xffff; - *top = (((intptr_t) ptr) >> 16) & 0xffff; + *lo = ((intptr_t) ptr) & 0xffff; + *hi = (((intptr_t) ptr) >> 16) & 0xffff; } -void *sub_80A8050(s16 bottom, s16 top) +void *LoadPointerFromVars(s16 lo, s16 hi) { - return (void *)((u16)bottom | ((u16)top << 16)); + return (void *)((u16)lo | ((u16)hi << 16)); } void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7) @@ -1924,9 +1928,9 @@ u8 sub_80A80C8(struct Task *task) task->data[9] = task->data[13]; task->data[10] = task->data[14]; } - obj_id_set_rotscale(task->data[15], task->data[9], task->data[10], 0); + SetSpriteRotScale(task->data[15], task->data[9], task->data[10], 0); if (task->data[8]) - sub_80A7E6C(task->data[15]); + SetBattlerSpriteYOffsetFromYScale(task->data[15]); else gSprites[task->data[15]].pos2.y = 0; return task->data[8]; @@ -1968,16 +1972,16 @@ void sub_80A8278(void) { if (IsBattlerSpriteVisible(i)) { - gSprites[gBattlerSpriteIds[i]].subpriority = GetBattlerSubpriority(i); + gSprites[gBattlerSpriteIds[i]].subpriority = GetBattlerSpriteSubpriority(i); gSprites[gBattlerSpriteIds[i]].oam.priority = 2; } } } -u8 GetBattlerSubpriority(u8 battlerId) +u8 GetBattlerSpriteSubpriority(u8 battlerId) { u8 position; - u8 ret; + u8 subpriority; if (IsContest()) { @@ -1990,15 +1994,16 @@ u8 GetBattlerSubpriority(u8 battlerId) { position = GetBattlerPosition(battlerId); if (position == B_POSITION_PLAYER_LEFT) - ret = 30; + subpriority = 30; else if (position == B_POSITION_PLAYER_RIGHT) - ret = 20; + subpriority = 20; else if (position == B_POSITION_OPPONENT_LEFT) - ret = 40; + subpriority = 40; else - ret = 50; + subpriority = 50; } - return ret; + + return subpriority; } u8 sub_80A8328(u8 battlerId) @@ -2100,15 +2105,15 @@ s16 sub_80A861C(u8 battlerId, u8 a2) if (IsContest()) { - if (shared19348.unk4_0) + if (gContestResources->field_18->unk4_0) { - species = shared19348.unk2; - personality = shared19348.unk10; + species = gContestResources->field_18->unk2; + personality = gContestResources->field_18->unk10; } else { - species = shared19348.species; - personality = shared19348.unk8; + species = gContestResources->field_18->species; + personality = gContestResources->field_18->unk8; } if (species == SPECIES_UNOWN) { @@ -2270,7 +2275,7 @@ u8 sub_80A89C8(int battlerId, u8 spriteId, int species) void sub_80A8A6C(struct Sprite *sprite) { - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker)) { sprite->pos1.x -= gBattleAnimArgs[0]; @@ -2286,7 +2291,7 @@ void sub_80A8A6C(struct Sprite *sprite) sprite->data[1] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[4]; sprite->data[5] = gBattleAnimArgs[5]; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); sprite->callback = sub_80A66DC; } @@ -2307,19 +2312,19 @@ void sub_80A8AEC(struct Sprite *sprite) sprite->data[3] = gBattleAnimArgs[4]; sprite->data[5] = gBattleAnimArgs[5]; StartSpriteAnim(sprite, gBattleAnimArgs[6]); - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); sprite->callback = sub_80A66DC; } void sub_80A8B64(struct Sprite *sprite) { - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker)) sprite->pos1.x -= gBattleAnimArgs[0]; else sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -2339,7 +2344,7 @@ void sub_80A8BC4(u8 taskId) dest = (task->data[4] + 0x10) * 0x10; src = (gSprites[task->data[0]].oam.paletteNum + 0x10) * 0x10; - task->data[6] = GetBattlerSubpriority(gBattleAnimAttacker); + task->data[6] = GetBattlerSpriteSubpriority(gBattleAnimAttacker); if (task->data[6] == 20 || task->data[6] == 40) task->data[6] = 2; else @@ -2384,7 +2389,7 @@ void sub_80A8CAC(u8 taskId) void sub_80A8D78(struct Task *task, u8 taskId) { - s16 spriteId = duplicate_obj_of_side_rel2move_in_transparent_mode(0); + s16 spriteId = CloneBattlerSpriteWithBlend(0); if (spriteId >= 0) { gSprites[spriteId].oam.priority = task->data[6]; @@ -2410,7 +2415,7 @@ void sub_80A8DFC(struct Sprite *sprite) void sub_80A8E30(struct Sprite *sprite) { sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_3); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); if (!GetBattlerSide(gBattleAnimAttacker)) sprite->data[0] = 5; else diff --git a/src/battle_anim_80A9C70.c b/src/battle_anim_80A9C70.c index f1245a032..2eea276a1 100644 --- a/src/battle_anim_80A9C70.c +++ b/src/battle_anim_80A9C70.c @@ -175,7 +175,7 @@ static void sub_80A9E78(struct Sprite *sprite) void sub_80A9EF4(u8 taskId) { s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - 32; - s16 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_3) - 36; + s16 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) - 36; u8 spriteId; if (IsContest()) diff --git a/src/battle_anim_80D51AC.c b/src/battle_anim_80D51AC.c index 51be7bbe9..34eee7376 100644 --- a/src/battle_anim_80D51AC.c +++ b/src/battle_anim_80D51AC.c @@ -834,7 +834,7 @@ void AnimTask_ScaleMonAndRestore(u8 taskId) { u8 spriteId; spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[3]); - sub_80A7270(spriteId, gBattleAnimArgs[4]); + PrepareBattlerSpriteForRotScale(spriteId, gBattleAnimArgs[4]); gTasks[taskId].data[0] = gBattleAnimArgs[0]; gTasks[taskId].data[1] = gBattleAnimArgs[1]; gTasks[taskId].data[2] = gBattleAnimArgs[2]; @@ -851,7 +851,7 @@ void AnimTask_ScaleMonAndRestoreStep(u8 taskId) gTasks[taskId].data[10] += gTasks[taskId].data[0]; gTasks[taskId].data[11] += gTasks[taskId].data[1]; spriteId = gTasks[taskId].data[4]; - obj_id_set_rotscale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[11], 0); + SetSpriteRotScale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[11], 0); if (--gTasks[taskId].data[2] == 0) { if (gTasks[taskId].data[3] > 0) @@ -863,7 +863,7 @@ void AnimTask_ScaleMonAndRestoreStep(u8 taskId) } else { - sub_80A7344(spriteId); + ResetSpriteRotScale(spriteId); DestroyAnimVisualTask(taskId); return; } @@ -874,7 +874,7 @@ void sub_80D6134(u8 taskId) { u8 spriteId; spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]); - sub_80A7270(spriteId, 0); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); gTasks[taskId].data[1] = 0; gTasks[taskId].data[2] = gBattleAnimArgs[0]; if (gBattleAnimArgs[3] != 1) @@ -918,7 +918,7 @@ void sub_80D622C(u8 taskId) { u8 spriteId; spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]); - sub_80A7270(spriteId, 0); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); gTasks[taskId].data[1] = 0; gTasks[taskId].data[2] = gBattleAnimArgs[0]; if (gBattleAnimArgs[2] == 0) @@ -955,17 +955,17 @@ void sub_80D622C(u8 taskId) void sub_80D6308(u8 taskId) { gTasks[taskId].data[3] += gTasks[taskId].data[4]; - obj_id_set_rotscale(gTasks[taskId].data[5], 0x100, 0x100, gTasks[taskId].data[3]); + SetSpriteRotScale(gTasks[taskId].data[5], 0x100, 0x100, gTasks[taskId].data[3]); if (gTasks[taskId].data[7]) { - sub_80A73A0(gTasks[taskId].data[5]); + SetBattlerSpriteYOffsetFromRotation(gTasks[taskId].data[5]); } if (++gTasks[taskId].data[1] >= gTasks[taskId].data[2]) { switch (gTasks[taskId].data[6]) { case 1: - sub_80A7344(gTasks[taskId].data[5]); + ResetSpriteRotScale(gTasks[taskId].data[5]); case 0: default: DestroyAnimVisualTask(taskId); diff --git a/src/battle_anim_8170478.c b/src/battle_anim_8170478.c index a570e1bfa..34898899c 100755 --- a/src/battle_anim_8170478.c +++ b/src/battle_anim_8170478.c @@ -604,19 +604,19 @@ void sub_8170B04(u8 taskId) switch (gTasks[taskId].data[0]) { case 0: - sub_80A7270(spriteId, 0); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); gTasks[taskId].data[10] = 0x100; gTasks[taskId].data[0]++; break; case 1: gTasks[taskId].data[10] += 0x30; - obj_id_set_rotscale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[10], 0); - sub_80A7E6C(spriteId); + SetSpriteRotScale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[10], 0); + SetBattlerSpriteYOffsetFromYScale(spriteId); if (gTasks[taskId].data[10] >= 0x2D0) gTasks[taskId].data[0]++; break; case 2: - sub_80A7344(spriteId); + ResetSpriteRotScale(spriteId); gSprites[spriteId].invisible = 1; DestroyAnimVisualTask(taskId); break; @@ -756,7 +756,7 @@ void sub_8170F2C(u8 taskId) } ballId = ItemIdToBallId(gLastUsedItem); - subpriority = GetBattlerSubpriority(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) + 1; + subpriority = GetBattlerSpriteSubpriority(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) + 1; spriteId = CreateSprite(&gBallSpriteTemplates[ballId], x + 32, y | 80, subpriority); gSprites[spriteId].data[0] = 34; gSprites[spriteId].data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 0); @@ -862,7 +862,7 @@ static void sub_8171240(struct Sprite *sprite) switch (gTasks[taskId].data[0]) { case 0: - sub_80A7270(spriteId, 0); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); gTasks[taskId].data[10] = 256; gUnknown_030062DC = 28; gUnknown_030062E4 = (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y) - (sprite->pos1.y + sprite->pos2.y); @@ -872,14 +872,14 @@ static void sub_8171240(struct Sprite *sprite) break; case 1: gTasks[taskId].data[10] += 0x20; - obj_id_set_rotscale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[10], 0); + SetSpriteRotScale(spriteId, gTasks[taskId].data[10], gTasks[taskId].data[10], 0); gTasks[taskId].data[3] += gTasks[taskId].data[2]; gSprites[spriteId].pos2.y = -gTasks[taskId].data[3] >> 8; if (gTasks[taskId].data[10] >= 0x480) gTasks[taskId].data[0]++; break; case 2: - sub_80A7344(spriteId); + ResetSpriteRotScale(spriteId); gSprites[spriteId].invisible = 1; gTasks[taskId].data[0]++; break; diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 9b43092bc..3b1b49e34 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -2226,7 +2226,7 @@ void sub_80FE8E0(struct Sprite* sprite) sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); sprite->callback = StartAnimLinearTranslation; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } void sub_80FE930(struct Sprite* sprite) @@ -2263,9 +2263,9 @@ static void sub_80FE9E4(struct Sprite* sprite) else { if (sprite->data[5] > 0x7F) - sprite->subpriority = GetBattlerSubpriority(gBattleAnimTarget) + 1; + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1; else - sprite->subpriority = GetBattlerSubpriority(gBattleAnimTarget) + 6; + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 6; sprite->pos2.x += Sin(sprite->data[5], 5); sprite->pos2.y += Cos(sprite->data[5], 14); @@ -2284,7 +2284,7 @@ void sub_80FEA58(u8 taskId) gBattleAnimArgs[1] = 0; gBattleAnimArgs[2] = 80; gBattleAnimArgs[3] = 0; - CreateSpriteAndAnimate(&gUnknown_08592210, 0, 0, GetBattlerSubpriority(gBattleAnimTarget) + 1); + CreateSpriteAndAnimate(&gUnknown_08592210, 0, 0, GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1); } if (gTasks[taskId].data[1] == 15) @@ -2471,9 +2471,9 @@ static void sub_80FEECC(struct Sprite* sprite) sprite->pos2.x += Sin(sprite->data[5], 32); sprite->pos2.y += Cos(sprite->data[5], -5); if ((u16)(sprite->data[5] - 0x40) < 0x80) - sprite->subpriority = GetBattlerSubpriority(gBattleAnimAttacker) - 1; + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1; else - sprite->subpriority = GetBattlerSubpriority(gBattleAnimAttacker) + 1; + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + 1; sprite->data[5] = (sprite->data[5] + 5) & 0xFF; } @@ -2737,7 +2737,7 @@ void sub_80FF458(u8 taskId) } else { - sub_80A7270(spriteId, 1); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND); gTasks[taskId].data[14] = gSprites[spriteId].oam.priority; gSprites[spriteId].oam.priority = sub_80A8328(gBattleAnimTarget); spriteId = GetAnimBattlerSpriteId(ANIM_DEF_PARTNER); @@ -2759,8 +2759,8 @@ static void sub_80FF53C(u8 taskId) gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; gTasks[taskId].data[11] += 16; - obj_id_set_rotscale(spriteId, gTasks[taskId].data[11], gTasks[taskId].data[11], 0); - sub_80A7E6C(spriteId); + SetSpriteRotScale(spriteId, gTasks[taskId].data[11], gTasks[taskId].data[11], 0); + SetBattlerSpriteYOffsetFromYScale(spriteId); if (--gTasks[taskId].data[1] == 0) { gTasks[taskId].data[0] = 0; @@ -2775,7 +2775,7 @@ static void sub_80FF5CC(u8 taskId) if (gTasks[taskId].data[0] == 0) { u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); - sub_80A7344(spriteId); + ResetSpriteRotScale(spriteId); gSprites[spriteId].pos2.x = 0; gSprites[spriteId].pos2.y = 0; gSprites[spriteId].oam.priority = gTasks[taskId].data[14]; @@ -3207,7 +3207,7 @@ void sub_80FFFC0(u8 taskId) { struct Task *task = &gTasks[taskId]; - task->data[4] = GetBattlerSubpriority(gBattleAnimTarget) - 1; + task->data[4] = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 1; task->data[6] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); task->data[7] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); task->data[10] = sub_80A861C(gBattleAnimTarget, 1); @@ -3531,7 +3531,7 @@ static void sub_810074C(struct Sprite* sprite) return; } - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } void sub_81007C4(u8 taskId) @@ -3615,7 +3615,7 @@ void sub_8100898(struct Sprite* sprite) if (IsContest()) c -= 0x8000; - sub_80A73E0(sprite, 0, 0x100, 0x100, c); + TrySetSpriteRotScale(sprite, 0, 0x100, 0x100, c); sprite->callback = sub_81009A0; } } @@ -3632,7 +3632,7 @@ static void sub_81009A0(struct Sprite* sprite) } else { - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } } @@ -3655,7 +3655,7 @@ void sub_81009F8(struct Sprite* sprite) sprite->pos1.y += gBattleAnimArgs[1]; } - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -3678,7 +3678,7 @@ void sub_8100A94(struct Sprite* sprite) sprite->data[3] = gBattleAnimArgs[4]; sprite->data[5] = gBattleAnimArgs[5]; StartSpriteAffineAnim(sprite, gBattleAnimArgs[6]); - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); sprite->callback = sub_80A66DC; } @@ -4026,7 +4026,7 @@ static void sub_8101298(struct Sprite* sprite, int unk1, int unk2) void sub_810130C(struct Sprite* sprite) { if (!gBattleAnimArgs[2]) - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); sub_80A6864(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; @@ -4034,7 +4034,7 @@ void sub_810130C(struct Sprite* sprite) sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[4]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A656C; + sprite->callback = TranslateAnimLinearSimple; } void sub_810135C(struct Sprite* sprite) @@ -4071,13 +4071,13 @@ void sub_810135C(struct Sprite* sprite) sprite->data[1] = gBattleAnimArgs[3]; sprite->data[2] = gBattleAnimArgs[4]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A656C; + sprite->callback = TranslateAnimLinearSimple; } void sub_8101440(struct Sprite* sprite) { - sub_80A6838(sprite); - if (GetBattlerSide(gBattleAnimAttacker) == 0) + SetSpriteCoordsToAnimAttackerCoords(sprite); + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) { sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; @@ -4107,7 +4107,7 @@ static void sub_81014A0(struct Sprite* sprite) void sub_81014F4(struct Sprite* sprite) { - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) { sprite->pos1.x += gBattleAnimArgs[0]; @@ -4132,7 +4132,7 @@ static void sub_8101560(struct Sprite* sprite) sprite->data[4] += sprite->data[3] * 2; sprite->data[0] += sprite->data[1]; if (++sprite->data[1] > 60) - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } void sub_81015AC(struct Sprite* sprite) @@ -4349,14 +4349,14 @@ static void sub_81019E8(struct Sprite* sprite) if (sprite->data[0] == 0) { sprite->data[3] = gBattlerSpriteIds[gBattleAnimAttacker]; - sub_80A7270(sprite->data[3], 0); + PrepareBattlerSpriteForRotScale(sprite->data[3], ST_OAM_OBJ_NORMAL); sprite->data[4] = (sprite->data[6] = GetBattlerSide(gBattleAnimAttacker)) ? 0x300 : 0xFFFFFD00; sprite->data[5] = 0; } sprite->data[5] += sprite->data[4]; - obj_id_set_rotscale(sprite->data[3], 0x100, 0x100, sprite->data[5]); - sub_80A73A0(sprite->data[3]); + SetSpriteRotScale(sprite->data[3], 0x100, 0x100, sprite->data[5]); + SetBattlerSpriteYOffsetFromRotation(sprite->data[3]); if (++sprite->data[0] > 3) { sprite->data[0] = 0; @@ -4402,11 +4402,11 @@ static void sub_8101AE8(struct Sprite* sprite) } sprite->data[5] += sprite->data[4]; - obj_id_set_rotscale(sprite->data[3], 0x100, 0x100, sprite->data[5]); - sub_80A73A0(sprite->data[3]); + SetSpriteRotScale(sprite->data[3], 0x100, 0x100, sprite->data[5]); + SetBattlerSpriteYOffsetFromRotation(sprite->data[3]); if (++sprite->data[0] > 2) { - sub_80A7344(sprite->data[3]); + ResetSpriteRotScale(sprite->data[3]); sprite->callback = sub_8101B84; } } @@ -4432,13 +4432,13 @@ static void sub_8101BA0(struct Sprite *sprite) sprite->data[3] = GetBattlerSide(gBattleAnimAttacker); sprite->data[4] = (sprite->data[3] != B_SIDE_PLAYER) ? 0x200 : -0x200; sprite->data[5] = 0; - sub_80A7270(sprite->data[2], 0); + PrepareBattlerSpriteForRotScale(sprite->data[2], ST_OAM_OBJ_NORMAL); sprite->data[0]++; // fall through case 1: sprite->data[5] += sprite->data[4]; - obj_id_set_rotscale(sprite->data[2], 0x100, 0x100, sprite->data[5]); - sub_80A73A0(sprite->data[2]); + SetSpriteRotScale(sprite->data[2], 0x100, 0x100, sprite->data[5]); + SetBattlerSpriteYOffsetFromRotation(sprite->data[2]); if (++sprite->data[1] > 3) { sprite->data[1] = 0; @@ -4448,11 +4448,11 @@ static void sub_8101BA0(struct Sprite *sprite) break; case 2: sprite->data[5] += sprite->data[4]; - obj_id_set_rotscale(sprite->data[2], 0x100, 0x100, sprite->data[5]); - sub_80A73A0(sprite->data[2]); + SetSpriteRotScale(sprite->data[2], 0x100, 0x100, sprite->data[5]); + SetBattlerSpriteYOffsetFromRotation(sprite->data[2]); if (++sprite->data[1] > 3) { - sub_80A7344(sprite->data[2]); + ResetSpriteRotScale(sprite->data[2]); DestroyAnimSprite(sprite); } break; @@ -4514,7 +4514,7 @@ static void sub_8101D2C(u8 taskId) task->data[3] = 8; task->data[4] = 0; task->data[5] = (task->data[1] == 0) ? -0xC0 : 0xC0; - sub_80A7270(task->data[0], 0); + PrepareBattlerSpriteForRotScale(task->data[0], ST_OAM_OBJ_NORMAL); task->data[2]++; } break; @@ -4522,8 +4522,8 @@ static void sub_8101D2C(u8 taskId) if (task->data[3]) { task->data[4] += task->data[5]; - obj_id_set_rotscale(task->data[0], 0x100, 0x100, task->data[4]); - sub_80A73A0(task->data[0]); + SetSpriteRotScale(task->data[0], 0x100, 0x100, task->data[4]); + SetBattlerSpriteYOffsetFromRotation(task->data[0]); task->data[3]--; } else @@ -4594,13 +4594,13 @@ static void sub_8101EEC(u8 taskId) if (task->data[3]) { task->data[4] -= task->data[5]; - obj_id_set_rotscale(task->data[0], 0x100, 0x100, task->data[4]); - sub_80A73A0(task->data[0]); + SetSpriteRotScale(task->data[0], 0x100, 0x100, task->data[4]); + SetBattlerSpriteYOffsetFromRotation(task->data[0]); task->data[3]--; } else { - sub_80A7344(task->data[0]); + ResetSpriteRotScale(task->data[0]); DestroyAnimVisualTask(taskId); } } @@ -4621,7 +4621,7 @@ void sub_8101F40(struct Sprite* sprite) sprite->data[0] = 0; sprite->data[1] = 0; StoreSpriteCallbackInData6(sprite, sub_810208C); - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; } void sub_8101FA8(struct Sprite* sprite) @@ -4629,7 +4629,7 @@ void sub_8101FA8(struct Sprite* sprite) sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + 0xFFD0; sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); StoreSpriteCallbackInData6(sprite, sub_8102044); - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; } void sub_8101FF0(struct Sprite* sprite) @@ -4916,7 +4916,7 @@ void sub_81025C0(u8 taskId) gTasks[taskId].data[9] = 15; b = sub_80A76C4(1, 1, 1, 1); c = a | b; - sub_80A8048(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void*)c); + StorePointerInVars(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void*)c); b = b | (0x10000 << IndexOfSpritePaletteTag(ANIM_TAG_MOON)); d = IndexOfSpritePaletteTag(ANIM_TAG_GREEN_SPARKLE); BeginNormalPaletteFade((0x10000 << d) | b, 0, 0, 16, RGB(27, 29, 31)); @@ -4991,7 +4991,7 @@ void sub_81026A8(u8 taskId) case 2: if (++task->data[1] > 30) { - BeginNormalPaletteFade((u32)sub_80A8050(task->data[14], task->data[15]), 0, 16, 0, RGB(27, 29, 31)); + BeginNormalPaletteFade((u32)LoadPointerFromVars(task->data[14], task->data[15]), 0, 16, 0, RGB(27, 29, 31)); task->data[0]++; } break; @@ -5082,7 +5082,7 @@ void sub_81029B4(u8 taskId) BlendPalette(r3, 16, 11, RGB(0, 0, 0)); task->data[3] = 0; i = 0; - while (i < 2 && (obj = duplicate_obj_of_side_rel2move_in_transparent_mode(0)) >= 0) + while (i < 2 && (obj = CloneBattlerSpriteWithBlend(0)) >= 0) { gSprites[obj].oam.paletteNum = task->data[1]; gSprites[obj].data[0] = 0; @@ -5140,7 +5140,7 @@ static void sub_8102B3C(struct Sprite* sprite) void sub_8102BCC(struct Sprite* sprite) { StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; } void sub_8102BE8(u8 taskId) @@ -5185,7 +5185,7 @@ void sub_8102CD4(struct Sprite* sprite) u8 index; u8 a; u8 b; - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); StartSpriteAnim(sprite, gBattleAnimArgs[0]); if ((index = IndexOfSpritePaletteTag(gUnknown_08593020[gBattleAnimArgs[1]][0])) != 0xFF) sprite->oam.paletteNum = index; @@ -5244,7 +5244,7 @@ static void sub_8102DE4(struct Sprite* sprite) if ((u32)((c + 16) << 16) > (0x110) << 16 || a < -16 || a > 0x80) { - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } else { @@ -5298,7 +5298,7 @@ static void sub_8102F40(struct Sprite* sprite) } if (++sprite->data[0] == 48) - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } void sub_8102FB8(struct Sprite* sprite) @@ -5325,7 +5325,7 @@ void sub_8103028(struct Sprite* sprite) { s16 xDiff; u8 index; - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); sprite->pos1.y += 8; StartSpriteAnim(sprite, gBattleAnimArgs[1]); index = IndexOfSpritePaletteTag(gUnknown_08593020[gBattleAnimArgs[2]][0]); @@ -5387,7 +5387,7 @@ void sub_8103164(struct Sprite* sprite) sprite->data[1] = a + 2; StartSpriteAnim(sprite, a); StoreSpriteCallbackInData6(sprite, sub_81031D0); - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; } static void sub_81031D0(struct Sprite* sprite) @@ -5396,7 +5396,7 @@ static void sub_81031D0(struct Sprite* sprite) { StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StartSpriteAnim(sprite, sprite->data[1]); - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; } } @@ -5411,7 +5411,7 @@ void sub_8103208(struct Sprite* sprite) sub_810310C(battler, sprite); sprite->data[0] = 0; StoreSpriteCallbackInData6(sprite, sub_8103250); - sprite->callback = sub_80A67BC; + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } static void sub_8103250(struct Sprite* sprite) @@ -5419,8 +5419,8 @@ static void sub_8103250(struct Sprite* sprite) if (++sprite->data[0] > 16) { StartSpriteAffineAnim(sprite, 1); - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); - sprite->callback = sub_80A67BC; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } } @@ -5443,7 +5443,7 @@ void sub_8103284(struct Sprite* sprite) sprite->data[3] = sprite->subpriority + 4; sprite->data[4] = 0; StoreSpriteCallbackInData6(sprite, sub_8103300); - sprite->callback = sub_80A67BC; + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } static void sub_8103300(struct Sprite* sprite) @@ -5511,7 +5511,7 @@ static void sub_81033F0(struct Sprite* sprite) sprite->data[1] = 0; StartSpriteAnim(sprite, sprite->data[0]); StoreSpriteCallbackInData6(sprite, sub_810342C); - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; } } diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index ba2ee3723..244823d13 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -23,19 +23,19 @@ void sub_8103448(struct Sprite *); void sub_8103498(struct Sprite *); void sub_810358C(struct Sprite *); void sub_8103620(struct Sprite *); -void sub_81037D8(struct Sprite *); -void sub_810387C(struct Sprite *); +void Anim_KinesisZapEnergy(struct Sprite *); +void Anim_SwordsDanceBlade(struct Sprite *); void AnimSonicBoomProjectile(struct Sprite *); void sub_8103AA4(struct Sprite *); void sub_8103FE8(struct Sprite *); void sub_8104088(struct Sprite *); void sub_810413C(struct Sprite *); void sub_81041C4(struct Sprite *); -void sub_8104304(struct Sprite *); -void sub_8104364(struct Sprite *); -void sub_8104414(struct Sprite *); -void sub_8104B1C(struct Sprite *); -void sub_8104BAC(struct Sprite *); +void Anim_RazorWindTornado(struct Sprite *); +void Anim_ViceGripPincer(struct Sprite *); +void Anim_GuillotinePincer(struct Sprite *); +void Anim_BreathPuff(struct Sprite *); +void Anim_AngerMark(struct Sprite *); void sub_810501C(struct Sprite *); void sub_81051C4(struct Sprite *); void sub_81052A4(struct Sprite *); @@ -63,22 +63,22 @@ void sub_81070AC(struct Sprite *); static void sub_81034D8(struct Sprite *); static void sub_8103658(struct Sprite *); static void sub_8103680(struct Sprite *); -static void sub_81036DC(u8); -static void sub_81038A0(struct Sprite *); +static void AnimTask_WithdrawStep(u8); +static void Anim_SwordsDanceBladeStep(struct Sprite *); static void sub_8104018(struct Sprite *); static void sub_8104154(struct Sprite *); static void sub_810421C(struct Sprite *); static void sub_81042A0(struct Sprite *); -static void sub_81043F8(struct Sprite *); -static void sub_81044BC(struct Sprite *); -static void sub_8104530(struct Sprite *); -static void sub_8104594(struct Sprite *); -static void sub_8104614(u8); -static void sub_81046CC(u8); -static void sub_8104800(struct Task *, u8); -static void sub_81048F0(struct Sprite *); +static void Anim_ViceGripPincerStep(struct Sprite *); +static void Anim_GuillotinePincerStep1(struct Sprite *); +static void Anim_GuillotinePincerStep2(struct Sprite *); +static void Anim_GuillotinePincerStep3(struct Sprite *); +static void AnimTask_GrowAndGreyscaleStep(u8); +static void AnimTask_MinimizeStep1(u8); +static void CreateMinimizeSprite(struct Task *, u8); +static void ClonedMinizeSprite_Step(struct Sprite *); static void AnimTask_SplashStep(u8); -static void sub_8104AF0(u8); +static void AnimTask_GrowAndShrinkStep(u8); static void sub_8104C78(u8); static void sub_8104D28(u8); static void sub_8104F54(u8); @@ -219,7 +219,7 @@ const union AnimCmd *const gUnknown_08593340[] = gUnknown_0859331C, }; -const struct SpriteTemplate gUnknown_08593344 = +const struct SpriteTemplate gKinesisZapEnergySpriteTemplate = { .tileTag = ANIM_TAG_ALERT, .paletteTag = ANIM_TAG_ALERT, @@ -227,7 +227,7 @@ const struct SpriteTemplate gUnknown_08593344 = .anims = gUnknown_08593340, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81037D8, + .callback = Anim_KinesisZapEnergy, }; const union AffineAnimCmd gUnknown_0859335C[] = @@ -243,7 +243,7 @@ const union AffineAnimCmd *const gUnknown_0859337C[] = gUnknown_0859335C, }; -const struct SpriteTemplate gBattleAnimSpriteTemplate_8593380 = +const struct SpriteTemplate gSwordsDanceBladeSpriteTemplate = { .tileTag = ANIM_TAG_SWORD, .paletteTag = ANIM_TAG_SWORD, @@ -251,7 +251,7 @@ const struct SpriteTemplate gBattleAnimSpriteTemplate_8593380 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gUnknown_0859337C, - .callback = sub_810387C, + .callback = Anim_SwordsDanceBlade, }; const struct SpriteTemplate gSonicBoomSpriteTemplate = @@ -449,7 +449,7 @@ const union AffineAnimCmd *const gUnknown_0859354C[] = gUnknown_08593534, }; -const struct SpriteTemplate gUnknown_08593550 = +const struct SpriteTemplate gRazorWindTornadoSpriteTemplate = { .tileTag = ANIM_TAG_GUST, .paletteTag = ANIM_TAG_GUST, @@ -457,7 +457,7 @@ const struct SpriteTemplate gUnknown_08593550 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gUnknown_0859354C, - .callback = sub_8104304, + .callback = Anim_RazorWindTornado, }; const union AnimCmd gUnknown_08593568[] = @@ -482,7 +482,7 @@ const union AnimCmd *const gUnknown_08593588[] = gUnknown_08593578, }; -const struct SpriteTemplate gUnknown_08593590 = +const struct SpriteTemplate gViceGripSpriteTemplate = { .tileTag = ANIM_TAG_CUT, .paletteTag = ANIM_TAG_CUT, @@ -490,7 +490,7 @@ const struct SpriteTemplate gUnknown_08593590 = .anims = gUnknown_08593588, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8104364, + .callback = Anim_ViceGripPincer, }; const union AnimCmd gUnknown_085935A8[] = @@ -515,7 +515,7 @@ const union AnimCmd *const gUnknown_085935C8[] = gUnknown_085935B8, }; -const struct SpriteTemplate gUnknown_085935D0 = +const struct SpriteTemplate gGuillotineSpriteTemplate = { .tileTag = ANIM_TAG_CUT, .paletteTag = ANIM_TAG_CUT, @@ -523,10 +523,10 @@ const struct SpriteTemplate gUnknown_085935D0 = .anims = gUnknown_085935C8, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8104414, + .callback = Anim_GuillotinePincer, }; -const union AffineAnimCmd gUnknown_085935E8[] = +const union AffineAnimCmd gSplashEffectAffineAnimCmds[] = { AFFINEANIMCMD_FRAME(-6, 4, 0, 8), AFFINEANIMCMD_FRAME(10, -10, 0, 8), @@ -534,7 +534,7 @@ const union AffineAnimCmd gUnknown_085935E8[] = AFFINEANIMCMD_END, }; -const union AffineAnimCmd gUnknown_08593608[] = +const union AffineAnimCmd gGrowAndShrinkAffineAnimCmds[] = { AFFINEANIMCMD_FRAME(-4, -5, 0, 12), AFFINEANIMCMD_FRAME(0, 0, 0, 24), @@ -566,7 +566,7 @@ const union AnimCmd *const gUnknown_08593650[] = gUnknown_0859363C, }; -const struct SpriteTemplate gUnknown_08593658 = +const struct SpriteTemplate gBreathPuffSpriteTemplate = { .tileTag = ANIM_TAG_BREATH, .paletteTag = ANIM_TAG_BREATH, @@ -574,7 +574,7 @@ const struct SpriteTemplate gUnknown_08593658 = .anims = gUnknown_08593650, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8104B1C, + .callback = Anim_BreathPuff, }; const union AffineAnimCmd gUnknown_08593670[] = @@ -589,7 +589,7 @@ const union AffineAnimCmd *const gUnknown_08593688[] = gUnknown_08593670, }; -const struct SpriteTemplate gUnknown_0859368C = +const struct SpriteTemplate gAngerMarkSpriteTemplate = { .tileTag = ANIM_TAG_ANGER, .paletteTag = ANIM_TAG_ANGER, @@ -597,7 +597,7 @@ const struct SpriteTemplate gUnknown_0859368C = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gUnknown_08593688, - .callback = sub_8104BAC, + .callback = Anim_AngerMark, }; const union AffineAnimCmd gUnknown_085936A4[] = @@ -1256,14 +1256,14 @@ const struct SpriteTemplate gUnknown_08593C64 = void sub_8103448(struct Sprite *sprite) { - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); sub_80A6864(sprite, gBattleAnimArgs[0]); sprite->pos1.y += gBattleAnimArgs[1]; sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[4]; sprite->data[3] = gBattleAnimArgs[5]; sprite->data[4] = gBattleAnimArgs[3]; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); sprite->callback = sub_80A6450; sprite->callback(sprite); } @@ -1312,7 +1312,7 @@ static void sub_810353C(struct Sprite *sprite) if (sprite->data[0] == 0) { gSprites[sprite->data[2]].pos2.x = 0; - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } sprite->data[0]--; @@ -1339,7 +1339,7 @@ void sub_810358C(struct Sprite *sprite) void sub_8103620(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitAnimSpritePos(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[2]; sprite->data[1] = gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[4]; @@ -1364,25 +1364,28 @@ static void sub_8103680(struct Sprite *sprite) sprite->data[5]--; } -void sub_81036A0(u8 taskId) +// Rotates the attacking mon sprite downwards and then back upwards to its original position. +// No args. +void AnimTask_Withdraw(u8 taskId) { - sub_80A7270(gBattlerSpriteIds[gBattleAnimAttacker], 0); - gTasks[taskId].func = sub_81036DC; + PrepareBattlerSpriteForRotScale(gBattlerSpriteIds[gBattleAnimAttacker], ST_OAM_OBJ_NORMAL); + gTasks[taskId].func = AnimTask_WithdrawStep; } -static void sub_81036DC(u8 taskId) +static void AnimTask_WithdrawStep(u8 taskId) { u8 spriteId = gBattlerSpriteIds[gBattleAnimAttacker]; s16 rotation; - if (GetBattlerSide(gBattleAnimAttacker) == 0) + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) rotation = -gTasks[taskId].data[0]; else rotation = gTasks[taskId].data[0]; - obj_id_set_rotscale(spriteId, 0x100, 0x100, rotation); + SetSpriteRotScale(spriteId, 0x100, 0x100, rotation); if (gTasks[taskId].data[1] == 0) { gTasks[taskId].data[0] += 0xB0; + // this y position update gets overwritten by SetBattlerSpriteYOffsetFromRotation() gSprites[spriteId].pos2.y++; } else if (gTasks[taskId].data[1] == 1) @@ -1395,15 +1398,16 @@ static void sub_81036DC(u8 taskId) else { gTasks[taskId].data[0] -= 0xB0; + // this y position update gets overwritten by SetBattlerSpriteYOffsetFromRotation() gSprites[spriteId].pos2.y--; } - sub_80A73A0(spriteId); + SetBattlerSpriteYOffsetFromRotation(spriteId); if (gTasks[taskId].data[0] == 0xF20 || gTasks[taskId].data[0] == 0) { if (gTasks[taskId].data[1] == 2) { - sub_80A7344(spriteId); + ResetSpriteRotScale(spriteId); DestroyAnimVisualTask(taskId); } else @@ -1413,9 +1417,13 @@ static void sub_81036DC(u8 taskId) } } -void sub_81037D8(struct Sprite *sprite) +// Animates a "zap of energy" used in KINESIS. +// arg 0: x pixel offset +// arg 1: y pixel offset +// arg 2: vertical flip +void Anim_KinesisZapEnergy(struct Sprite *sprite) { - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) sprite->pos1.x -= gBattleAnimArgs[0]; else @@ -1434,18 +1442,21 @@ void sub_81037D8(struct Sprite *sprite) sprite->vFlip = 1; } - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -void sub_810387C(struct Sprite *sprite) +// Animates a sword that rises into the air after a brief pause. +// arg 0: x pixel offset +// arg 1: y pixel offset +void Anim_SwordsDanceBlade(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 0); - sprite->callback = sub_80A67BC; - StoreSpriteCallbackInData6(sprite, sub_81038A0); + InitAnimSpritePos(sprite, FALSE); + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; + StoreSpriteCallbackInData6(sprite, Anim_SwordsDanceBladeStep); } -static void sub_81038A0(struct Sprite *sprite) +static void Anim_SwordsDanceBladeStep(struct Sprite *sprite) { sprite->data[0] = 6; sprite->data[2] = sprite->pos1.x; @@ -1478,7 +1489,7 @@ void AnimSonicBoomProjectile(struct Sprite *sprite) gBattleAnimArgs[3] = -gBattleAnimArgs[3]; } - InitAnimSpritePos(sprite, 1); + InitAnimSpritePos(sprite, TRUE); targetXPos = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; targetYPos = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; rotation = ArcTan2Neg(targetXPos - sprite->pos1.x, targetYPos - sprite->pos1.y); @@ -1486,7 +1497,7 @@ void AnimSonicBoomProjectile(struct Sprite *sprite) if (IsContest()) rotation -= 0x6000; - sub_80A73E0(sprite, 0, 0x100, 0x100, rotation); + TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation); sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = targetXPos; sprite->data[4] = targetYPos; @@ -1621,11 +1632,11 @@ static void sub_8103C0C(u8 taskId) void sub_8103CF0(u8 taskId) { - s16 r9 = 0; - s16 r6 = 0; - s16 sp1 = 0; - s16 sp2 = 0; - s16 r4; + s16 attackerY = 0; + s16 attackerX = 0; + s16 targetX = 0; + s16 targetY = 0; + s16 xDiff, yDiff; if (IsContest()) { @@ -1650,38 +1661,38 @@ void sub_8103CF0(u8 taskId) } } - r6 = gTasks[taskId].data[9] = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); - r9 = gTasks[taskId].data[10] = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + attackerX = gTasks[taskId].data[9] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X); + attackerY = gTasks[taskId].data[10] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y); if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimTarget))) { - SetAverageBattlerPositions(gBattleAnimTarget, 0, &sp1, &sp2); + SetAverageBattlerPositions(gBattleAnimTarget, 0, &targetX, &targetY); } else { - sp1 = GetBattlerSpriteCoord(gBattleAnimTarget, 0); - sp2 = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + targetX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + targetY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y); } - sp1 = gTasks[taskId].data[11] = sp1 + gBattleAnimArgs[0]; - sp2 = gTasks[taskId].data[12] = sp2 + gBattleAnimArgs[1]; - if (sp1 >= r6) - r4 = sp1 - r6; + targetX = gTasks[taskId].data[11] = targetX + gBattleAnimArgs[0]; + targetY = gTasks[taskId].data[12] = targetY + gBattleAnimArgs[1]; + if (targetX >= attackerX) + xDiff = targetX - attackerX; else - r4 = r6 - sp1; + xDiff = attackerX - targetX; - gTasks[taskId].data[5] = sub_8151534(r4, sub_8151624(gBattleAnimArgs[2] & ~1)); + gTasks[taskId].data[5] = sub_8151534(xDiff, sub_8151624(gBattleAnimArgs[2] & ~1)); gTasks[taskId].data[6] = sub_8151534(gTasks[taskId].data[5], 0x80); gTasks[taskId].data[7] = gBattleAnimArgs[2]; - if (sp2 >= r9) + if (targetY >= attackerY) { - r4 = sp2 - r9; - gTasks[taskId].data[8] = sub_8151534(r4, sub_8151624(gTasks[taskId].data[5])) & ~1; + yDiff = targetY - attackerY; + gTasks[taskId].data[8] = sub_8151534(yDiff, sub_8151624(gTasks[taskId].data[5])) & ~1; } else { - r4 = r9 - sp2; - gTasks[taskId].data[8] = sub_8151534(r4, sub_8151624(gTasks[taskId].data[5])) | 1; + yDiff = attackerY - targetY; + gTasks[taskId].data[8] = sub_8151534(yDiff, sub_8151624(gTasks[taskId].data[5])) | 1; } gTasks[taskId].data[3] = gBattleAnimArgs[3]; @@ -1690,12 +1701,12 @@ void sub_8103CF0(u8 taskId) gBattleAnimArgs[4] ^= 0x80; if (gBattleAnimArgs[4] >= 64) { - u16 var = sub_80A82E4(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64); + u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64); gTasks[taskId].data[2] = var; } else { - u16 var = sub_80A82E4(gBattleAnimTarget) - gBattleAnimArgs[4]; + u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) - gBattleAnimArgs[4]; gTasks[taskId].data[2] = var; } } @@ -1703,12 +1714,12 @@ void sub_8103CF0(u8 taskId) { if (gBattleAnimArgs[4] >= 64) { - u16 var = sub_80A82E4(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64); + u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64); gTasks[taskId].data[2] = var; } else { - u16 var = sub_80A82E4(gBattleAnimTarget) - gBattleAnimArgs[4]; + u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) - gBattleAnimArgs[4]; gTasks[taskId].data[2] = var; } } @@ -1721,7 +1732,7 @@ void sub_8103CF0(u8 taskId) void sub_8103FE8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 0); + InitAnimSpritePos(sprite, FALSE); sprite->data[0] = 0x100 + (IndexOfSpritePaletteTag(gUnknown_085934A0.paletteTag) << 4); sprite->callback = sub_8104018; } @@ -1817,7 +1828,7 @@ void sub_8104088(struct Sprite *sprite) s16 r7; u16 var; - InitAnimSpritePos(sprite, 1); + InitAnimSpritePos(sprite, TRUE); r6 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); r7 = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -1826,7 +1837,7 @@ void sub_8104088(struct Sprite *sprite) r6 += gBattleAnimArgs[2]; var = ArcTan2Neg(r6 - sprite->pos1.x, r7 - sprite->pos1.y); var += 0xC000; - sub_80A73E0(sprite, 0, 0x100, 0x100, var); + TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, var); sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = r6; sprite->data[4] = r7; @@ -1861,10 +1872,10 @@ static void sub_8104154(struct Sprite *sprite) void sub_81041C4(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitAnimSpritePos(sprite, TRUE); sprite->data[0] = 20; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->callback = StartAnimLinearTranslation; sprite->affineAnimPaused = 1; StoreSpriteCallbackInData6(sprite, sub_810421C); @@ -1910,9 +1921,17 @@ static void sub_81042A0(struct Sprite *sprite) } } -void sub_8104304(struct Sprite *sprite) +// Moves a tornado in a circlular motion. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: wave amplitude +// arg 3: unused +// arg 4: initial wave offset +// arg 5: wave period (higher means faster wave) +// arg 6: duration +void Anim_RazorWindTornado(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 0); + InitAnimSpritePos(sprite, FALSE); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) sprite->pos1.y += 16; @@ -1921,72 +1940,76 @@ void sub_8104304(struct Sprite *sprite) sprite->data[2] = gBattleAnimArgs[5]; sprite->data[3] = gBattleAnimArgs[6]; sprite->data[4] = gBattleAnimArgs[3]; - sprite->callback = sub_80A62EC; + sprite->callback = TranslateSpriteInCircleOverDuration; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); sprite->callback(sprite); } -void sub_8104364(struct Sprite *sprite) +// Animates a single pincer line that extends towards the center of the target mon. +// arg 0: invert +void Anim_ViceGripPincer(struct Sprite *sprite) { - s16 r7 = 32; - s16 r4 = -32; - s16 xDiff = 16; - s16 yDiff = -16; + s16 startXOffset = 32; + s16 startYOffset = -32; + s16 endXOffset = 16; + s16 endYOffset = -16; if (gBattleAnimArgs[0]) { - r7 = r4; - r4 = 32; - xDiff = yDiff; - yDiff = 16; + startXOffset = -32; + startYOffset = 32; + endXOffset = -16; + endYOffset = 16; StartSpriteAnim(sprite, 1); } - sprite->pos1.x += r7; - sprite->pos1.y += r4; + sprite->pos1.x += startXOffset; + sprite->pos1.y += startYOffset; sprite->data[0] = 6; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + xDiff; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + yDiff; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + endXOffset; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + endYOffset; sprite->callback = StartAnimLinearTranslation; - StoreSpriteCallbackInData6(sprite, sub_81043F8); + StoreSpriteCallbackInData6(sprite, Anim_ViceGripPincerStep); } -static void sub_81043F8(struct Sprite *sprite) +static void Anim_ViceGripPincerStep(struct Sprite *sprite) { - if (sprite->animEnded == 1) + if (sprite->animEnded) DestroyAnimSprite(sprite); } -void sub_8104414(struct Sprite *sprite) +// Animates a single pincer line that extends towards the center of the target mon, and then back out. +// arg 0: animation id +void Anim_GuillotinePincer(struct Sprite *sprite) { - s16 r8 = 32; - s16 r4 = -32; - s16 xDiff = 16; - s16 yDiff = -16; - if (gBattleAnimArgs[0] != 0) + s16 startXOffset = 32; + s16 startYOffset = -32; + s16 endXOffset = 16; + s16 endYOffset = -16; + if (gBattleAnimArgs[0]) { - r8 = r4; - r4 = 32; - xDiff = yDiff; - yDiff = 16; + startXOffset = -32; + startYOffset = 32; + endXOffset = -16; + endYOffset = 16; StartSpriteAnim(sprite, gBattleAnimArgs[0]); } - sprite->pos1.x += r8; - sprite->pos1.y += r4; + sprite->pos1.x += startXOffset; + sprite->pos1.y += startYOffset; sprite->data[0] = 6; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + xDiff; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + endXOffset; sprite->data[3] = sprite->pos1.y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + yDiff; + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + endYOffset; InitAnimLinearTranslation(sprite); sprite->data[5] = gBattleAnimArgs[0]; sprite->data[6] = sprite->data[0]; - sprite->callback = sub_81044BC; + sprite->callback = Anim_GuillotinePincerStep1; } -static void sub_81044BC(struct Sprite *sprite) +static void Anim_GuillotinePincerStep1(struct Sprite *sprite) { - if (TranslateAnimLinear(sprite) && sprite->animEnded == 1) + if (TranslateAnimLinear(sprite) && sprite->animEnded) { SeekSpriteAnim(sprite, 0); sprite->animPaused = 1; @@ -1999,11 +2022,11 @@ static void sub_81044BC(struct Sprite *sprite) sprite->data[2] ^= 1; sprite->data[4] = 0; sprite->data[3] = 0; - sprite->callback = sub_8104530; + sprite->callback = Anim_GuillotinePincerStep2; } } -static void sub_8104530(struct Sprite *sprite) +static void Anim_GuillotinePincerStep2(struct Sprite *sprite) { if (sprite->data[3]) { @@ -2020,65 +2043,71 @@ static void sub_8104530(struct Sprite *sprite) sprite->data[3] = 0; sprite->animPaused = 0; StartSpriteAnim(sprite, sprite->data[5] ^ 1); - sprite->callback = sub_8104594; + sprite->callback = Anim_GuillotinePincerStep3; } } -static void sub_8104594(struct Sprite *sprite) +static void Anim_GuillotinePincerStep3(struct Sprite *sprite) { if (TranslateAnimLinear(sprite)) DestroyAnimSprite(sprite); } -void sub_81045B0(u8 taskId) +// Scales up the target mon sprite, and sets the palette to greyscale. +// Used in MOVE_DISABLE. +// No args. +void AnimTask_GrowAndGreyscale(u8 taskId) { u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); - sub_80A7270(spriteId, 1); - obj_id_set_rotscale(spriteId, 0xD0, 0xD0, 0); - sub_80A750C(gSprites[spriteId].oam.paletteNum + 16, 0); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND); + SetSpriteRotScale(spriteId, 0xD0, 0xD0, 0); + SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, FALSE); gTasks[taskId].data[0] = 80; - gTasks[taskId].func = sub_8104614; + gTasks[taskId].func = AnimTask_GrowAndGreyscaleStep; } -static void sub_8104614(u8 taskId) +static void AnimTask_GrowAndGreyscaleStep(u8 taskId) { if (--gTasks[taskId].data[0] == -1) { u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); - sub_80A7344(spriteId); - sub_80A750C(gSprites[spriteId].oam.paletteNum + 16, 1); + ResetSpriteRotScale(spriteId); + SetGreyscaleOrOriginalPalette(gSprites[spriteId].oam.paletteNum + 16, TRUE); DestroyAnimVisualTask(taskId); } } -void sub_8104674(u8 taskId) +// Shrinks and grows the attacking mon several times. Also creates transparent versions of the +// mon's sprite while it is shrinking. +// No args. +void AnimTask_Minimize(u8 taskId) { struct Task* task = &gTasks[taskId]; u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[0] = spriteId; - sub_80A7270(spriteId, 0); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); task->data[1] = 0; task->data[2] = 0; task->data[3] = 0; task->data[4] = 0x100; task->data[5] = 0; task->data[6] = 0; - task->data[7] = sub_80A82E4(gBattleAnimAttacker); - task->func = sub_81046CC; + task->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker); + task->func = AnimTask_MinimizeStep1; } -static void sub_81046CC(u8 taskId) +static void AnimTask_MinimizeStep1(u8 taskId) { struct Task* task = &gTasks[taskId]; switch (task->data[1]) { case 0: if (task->data[2] == 0 || task->data[2] == 3 || task->data[2] == 6) - sub_8104800(task, taskId); + CreateMinimizeSprite(task, taskId); task->data[2]++; task->data[4] += 0x28; - obj_id_set_rotscale(task->data[0], task->data[4], task->data[4], 0); - sub_80A7E6C(task->data[0]); + SetSpriteRotScale(task->data[0], task->data[4], task->data[4], 0); + SetBattlerSpriteYOffsetFromYScale(task->data[0]); if (task->data[2] == 32) { task->data[5]++; @@ -2098,8 +2127,8 @@ static void sub_81046CC(u8 taskId) task->data[2] = 0; task->data[3] = 0; task->data[4] = 0x100; - obj_id_set_rotscale(task->data[0], task->data[4], task->data[4], 0); - sub_80A7E6C(task->data[0]); + SetSpriteRotScale(task->data[0], task->data[4], task->data[4], 0); + SetBattlerSpriteYOffsetFromYScale(task->data[0]); task->data[1] = 2; } } @@ -2117,8 +2146,8 @@ static void sub_81046CC(u8 taskId) case 4: task->data[2] += 2; task->data[4] -= 0x50; - obj_id_set_rotscale(task->data[0], task->data[4], task->data[4], 0); - sub_80A7E6C(task->data[0]); + SetSpriteRotScale(task->data[0], task->data[4], task->data[4], 0); + SetBattlerSpriteYOffsetFromYScale(task->data[0]); if (task->data[2] == 32) { task->data[2] = 0; @@ -2126,17 +2155,17 @@ static void sub_81046CC(u8 taskId) } break; case 5: - sub_80A7344(task->data[0]); + ResetSpriteRotScale(task->data[0]); gSprites[task->data[15]].pos2.y = 0; DestroyAnimVisualTask(taskId); break; } } -static void sub_8104800(struct Task* task, u8 taskId) +static void CreateMinimizeSprite(struct Task* task, u8 taskId) { u16 matrixNum; - s16 spriteId = duplicate_obj_of_side_rel2move_in_transparent_mode(0); + s16 spriteId = CloneBattlerSpriteWithBlend(ANIM_ATTACKER); if (spriteId >= 0) { if ((matrixNum = AllocOamMatrix()) == 0xFF) @@ -2155,15 +2184,15 @@ static void sub_8104800(struct Task* task, u8 taskId) gSprites[spriteId].data[0] = 16; gSprites[spriteId].data[1] = taskId; gSprites[spriteId].data[2] = 6; - gSprites[spriteId].callback = sub_81048F0; - obj_id_set_rotscale(spriteId, task->data[4], task->data[4], 0); + gSprites[spriteId].callback = ClonedMinizeSprite_Step; + SetSpriteRotScale(spriteId, task->data[4], task->data[4], 0); gSprites[spriteId].oam.affineMode = 1; CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode); } } } -static void sub_81048F0(struct Sprite *sprite) +static void ClonedMinizeSprite_Step(struct Sprite *sprite) { if (--sprite->data[0] == 0) { @@ -2191,7 +2220,7 @@ void AnimTask_Splash(u8 taskId) task->data[2] = gBattleAnimArgs[1]; task->data[3] = 0; task->data[4] = 0; - sub_80A7CFC(task, spriteId, &gUnknown_085935E8); + PrepareAffineAnimInTaskData(task, spriteId, gSplashEffectAffineAnimCmds); task->func = AnimTask_SplashStep; } } @@ -2202,7 +2231,7 @@ static void AnimTask_SplashStep(u8 taskId) switch (task->data[1]) { case 0: - sub_80A7D34(task); + RunAffineAnimFromTaskData(task); task->data[4] += 3; gSprites[task->data[0]].pos2.y += task->data[4]; if (++task->data[3] > 7) @@ -2212,7 +2241,7 @@ static void AnimTask_SplashStep(u8 taskId) } break; case 1: - sub_80A7D34(task); + RunAffineAnimFromTaskData(task); gSprites[task->data[0]].pos2.y += task->data[4]; if (++task->data[3] > 7) { @@ -2230,7 +2259,7 @@ static void AnimTask_SplashStep(u8 taskId) task->data[1]++; break; case 3: - if (!sub_80A7D34(task)) + if (!RunAffineAnimFromTaskData(task)) { if (--task->data[2] == 0) { @@ -2239,7 +2268,7 @@ static void AnimTask_SplashStep(u8 taskId) } else { - sub_80A7CFC(task, task->data[0], &gUnknown_085935E8); + PrepareAffineAnimInTaskData(task, task->data[0], gSplashEffectAffineAnimCmds); task->data[1] = 0; } } @@ -2247,49 +2276,59 @@ static void AnimTask_SplashStep(u8 taskId) } } -void sub_8104AB4(u8 taskId) +// Grows, pauses, then shrinks the attacking mon. +// Used by MOVE_SWAGGER and MOVE_BULK_UP +// No args. +void AnimTask_GrowAndShrink(u8 taskId) { struct Task* task = &gTasks[taskId]; u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); - sub_80A7CFC(task, spriteId, &gUnknown_08593608); - task->func = sub_8104AF0; + PrepareAffineAnimInTaskData(task, spriteId, gGrowAndShrinkAffineAnimCmds); + task->func = AnimTask_GrowAndShrinkStep; } -static void sub_8104AF0(u8 taskId) +static void AnimTask_GrowAndShrinkStep(u8 taskId) { struct Task* task = &gTasks[taskId]; - if (!sub_80A7D34(task)) + if (!RunAffineAnimFromTaskData(task)) DestroyAnimVisualTask(taskId); } -void sub_8104B1C(struct Sprite *sprite) +// Animates a little puff of the mon's breath. +// Used by MOVE_SWAGGER and MOVE_BULK_UP +// No args. +void Anim_BreathPuff(struct Sprite *sprite) { - if (GetBattlerSide(gBattleAnimAttacker) == 0) + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) { StartSpriteAnim(sprite, 0); - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + 32; + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + 32; sprite->data[1] = 64; } else { StartSpriteAnim(sprite, 1); - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) - 32; + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - 32; sprite->data[1] = -64; } - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[0] = 52; sprite->data[2] = 0; sprite->data[3] = 0; sprite->data[4] = 0; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A656C; + sprite->callback = TranslateAnimLinearSimple; } -void sub_8104BAC(struct Sprite *sprite) +// Animates an "angry" mark above a mon's head. +// arg 0: target mon (0 = attacker, 1 = target) +// arg 1: x pixel offset +// arg 2: y pixel offset +void Anim_AngerMark(struct Sprite *sprite) { u8 battler; - if (gBattleAnimArgs[0] == 0) + if (!gBattleAnimArgs[0]) battler = gBattleAnimAttacker; else battler = gBattleAnimTarget; @@ -2297,13 +2336,13 @@ void sub_8104BAC(struct Sprite *sprite) if (GetBattlerSide(battler) == B_SIDE_OPPONENT) gBattleAnimArgs[1] *= -1; - sprite->pos1.x = GetBattlerSpriteCoord(battler, 2) + gBattleAnimArgs[1]; - sprite->pos1.y = GetBattlerSpriteCoord(battler, 3) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2]; if (sprite->pos1.y < 8) sprite->pos1.y = 8; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); - sprite->callback = sub_80A67BC; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } // left/right movements @@ -2313,14 +2352,14 @@ void sub_8104C38(u8 taskId) u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[0] = spriteId; task->data[1] = 0; - sub_80A7CFC(task, spriteId, &gUnknown_085936A4); + PrepareAffineAnimInTaskData(task, spriteId, gUnknown_085936A4); task->func = sub_8104C78; } static void sub_8104C78(u8 taskId) { struct Task* task = &gTasks[taskId]; - if (!sub_80A7D34(task)) + if (!RunAffineAnimFromTaskData(task)) DestroyAnimVisualTask(taskId); } @@ -2697,7 +2736,7 @@ void sub_81054E8(struct Sprite *sprite) void sub_8105538(struct Sprite *sprite) { s16 r1; - InitAnimSpritePos(sprite, 0); + InitAnimSpritePos(sprite, FALSE); r1 = GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER ? -160 : 160; sprite->data[0] = 0x380; sprite->data[1] = r1; @@ -2801,14 +2840,14 @@ void sub_810577C(u8 taskId) struct Task* task = &gTasks[taskId]; u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); task->data[0] = spriteId; - sub_80A7CFC(task, spriteId, &gUnknown_085938B0); + PrepareAffineAnimInTaskData(task, spriteId, gUnknown_085938B0); task->func = sub_81057B8; } static void sub_81057B8(u8 taskId) { struct Task* task = &gTasks[taskId]; - if (!sub_80A7D34(task)) + if (!RunAffineAnimFromTaskData(task)) { gSprites[task->data[0]].pos2.y = 0; gSprites[task->data[0]].invisible = 1; @@ -3059,7 +3098,7 @@ static void sub_8105D88(struct Sprite *sprite, u8 a, u8 b) void sub_8105DE8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 0); + InitAnimSpritePos(sprite, FALSE); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; @@ -3074,7 +3113,7 @@ void sub_8105DE8(struct Sprite *sprite) void sub_8105E60(struct Sprite *sprite) { if (++sprite->data[0] == 1) - InitAnimSpritePos(sprite, 0); + InitAnimSpritePos(sprite, FALSE); sprite->pos2.x = Sin(sprite->data[1], 8); sprite->pos2.y = sprite->data[2] >> 8; @@ -3142,13 +3181,13 @@ void sub_8106020(u8 taskId) u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); if (++gTasks[taskId].data[0] == 1) { - sub_80A7CFC(&gTasks[taskId], GetAnimBattlerSpriteId(1), &gUnknown_08593988); + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(1), gUnknown_08593988); gSprites[spriteId].pos2.x = 4; } else { gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; - if (!sub_80A7D34(&gTasks[taskId])) + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) { gSprites[spriteId].pos2.x = 0; gSprites[spriteId].pos2.y = 0; @@ -3162,13 +3201,13 @@ void sub_81060B0(u8 taskId) u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); if (++gTasks[taskId].data[0] == 1) { - sub_80A7CFC(&gTasks[taskId], GetAnimBattlerSpriteId(0), &gUnknown_08593988); + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(0), gUnknown_08593988); gSprites[spriteId].pos2.x = 4; } else { gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; - if (!sub_80A7D34(&gTasks[taskId])) + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) { gSprites[spriteId].pos2.x = 0; gSprites[spriteId].pos2.y = 0; @@ -3179,7 +3218,7 @@ void sub_81060B0(u8 taskId) void sub_8106140(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitAnimSpritePos(sprite, TRUE); sprite->data[0] = 95; sprite->data[1] = sprite->pos1.x; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); @@ -3424,7 +3463,7 @@ void AnimOrbitFast(struct Sprite *sprite) sprite->affineAnimPaused = 1; sprite->data[0] = gBattleAnimArgs[0]; sprite->data[1] = gBattleAnimArgs[1]; - sprite->data[7] = sub_80A82E4(gBattleAnimAttacker); + sprite->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker); sprite->callback = AnimOrbitFastStep; sprite->callback(sprite); } @@ -3511,7 +3550,7 @@ static void sub_810699C(struct Sprite *sprite) void sub_81069B8(struct Sprite *sprite) { - InitAnimSpritePos(sprite, 1); + InitAnimSpritePos(sprite, TRUE); sprite->callback = sub_810699C; } @@ -3586,7 +3625,7 @@ void sub_8106B54(struct Sprite *sprite) sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.y += gBattleAnimArgs[1]; StartSpriteAnim(sprite, 0); - sprite->subpriority = sub_80A82E4(gBattleAnimTarget) - 1; + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 1; sprite->data[2] = 1; } sprite->data[0] += sprite->data[2]; @@ -3669,13 +3708,13 @@ void sub_8106D90(u8 taskId) { u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - sub_80A7CFC(&gTasks[taskId], spriteId, gUnknown_08593B98); + PrepareAffineAnimInTaskData(&gTasks[taskId], spriteId, gUnknown_08593B98); gTasks[taskId].func = sub_8106DD4; } static void sub_8106DD4(u8 taskId) { - if (!sub_80A7D34(&gTasks[taskId])) + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) DestroyAnimVisualTask(taskId); } @@ -3726,7 +3765,7 @@ void sub_8106F00(struct Sprite *sprite) } if (++sprite->data[0] == sprite->data[1]) - sub_80A750C(sprite->oam.paletteNum + 16, 0); + SetGreyscaleOrOriginalPalette(sprite->oam.paletteNum + 16, 0); if (sprite->data[0] == sprite->data[1] + 80) DestroyAnimSprite(sprite); diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index 85ff692b3..f99b1aeac 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -236,7 +236,7 @@ static void sub_81169F8(u8 taskId) } else { - task->data[6] = duplicate_obj_of_side_rel2move_in_transparent_mode(task->data[0]); + task->data[6] = CloneBattlerSpriteWithBlend(task->data[0]); if (task->data[6] >= 0) { gSprites[task->data[6]].oam.priority = task->data[0] ? 1 : 2; diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 32a9e926a..e81035fc7 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1136,7 +1136,7 @@ static void LinkOpponentHandleLoadMonSprite(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), - GetBattlerSubpriority(gActiveBattler)); + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; @@ -1170,7 +1170,7 @@ static void sub_8066494(u8 battlerId, bool8 dontClearSubstituteBit) &gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), - GetBattlerSubpriority(battlerId)); + GetBattlerSpriteSubpriority(battlerId)); gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; @@ -1302,7 +1302,7 @@ static void LinkOpponentHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, - GetBattlerSubpriority(gActiveBattler)); + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index e4cc0ac34..533ec39de 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1024,7 +1024,7 @@ static void LinkPartnerHandleLoadMonSprite(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), - GetBattlerSubpriority(gActiveBattler)); + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; @@ -1055,7 +1055,7 @@ static void sub_814CC98(u8 battlerId, bool8 dontClearSubstituteBit) &gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), - GetBattlerSubpriority(battlerId)); + GetBattlerSpriteSubpriority(battlerId)); gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; @@ -1143,7 +1143,7 @@ static void LinkPartnerHandleDrawTrainerPic(void) DecompressTrainerBackPic(trainerPicId, gActiveBattler); SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, (8 - gTrainerBackPicCoords[trainerPicId].coords) * 4 + 80, GetBattlerSubpriority(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, (8 - gTrainerBackPicCoords[trainerPicId].coords) * 4 + 80, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 516e7192a..30aa3217b 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1128,7 +1128,7 @@ static void OpponentHandleLoadMonSprite(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), - GetBattlerSubpriority(gActiveBattler)); + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; @@ -1163,7 +1163,7 @@ static void sub_80613DC(u8 battlerId, bool8 dontClearSubstituteBit) gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), - GetBattlerSubpriority(battlerId)); + GetBattlerSpriteSubpriority(battlerId)); gSprites[gBattlerSpriteIds[battlerId]].data[0] = battlerId; gSprites[gBattlerSpriteIds[battlerId]].data[2] = species; @@ -1293,7 +1293,7 @@ static void OpponentHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, - GetBattlerSubpriority(gActiveBattler)); + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index e0e618918..2d8fba63a 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2200,7 +2200,7 @@ static void sub_805B258(u8 battlerId, bool8 dontClearSubstituteBit) &gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), - GetBattlerSubpriority(battlerId)); + GetBattlerSpriteSubpriority(battlerId)); gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; @@ -2314,7 +2314,7 @@ static void PlayerHandleDrawTrainerPic(void) trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender); DecompressTrainerFrontPic(trainerPicId, gActiveBattler); SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSubpriority(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; @@ -2329,7 +2329,7 @@ static void PlayerHandleDrawTrainerPic(void) { DecompressTrainerBackPic(trainerPicId, gActiveBattler); SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSubpriority(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 2e8a4a079..22018add4 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1211,7 +1211,7 @@ static void PlayerPartnerHandleLoadMonSprite(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), - GetBattlerSubpriority(gActiveBattler)); + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; @@ -1242,7 +1242,7 @@ static void sub_81BD0E4(u8 battlerId, bool8 dontClearSubstituteBit) &gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), - GetBattlerSubpriority(battlerId)); + GetBattlerSpriteSubpriority(battlerId)); gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; @@ -1322,7 +1322,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void) { DecompressTrainerBackPic(trainerPicId, gActiveBattler); SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSubpriority(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; @@ -1333,7 +1333,7 @@ static void PlayerPartnerHandleDrawTrainerPic(void) { DecompressTrainerFrontPic(trainerPicId, gActiveBattler); SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSubpriority(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 52c147c1f..1cf780264 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1119,9 +1119,7 @@ static void RecordedOpponentHandleLoadMonSprite(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), - GetBattlerSubpriority(gActiveBattler)); - - + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; @@ -1154,7 +1152,7 @@ static void sub_81885D8(u8 battlerId, bool8 dontClearSubstituteBit) gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), - GetBattlerSubpriority(battlerId)); + GetBattlerSpriteSubpriority(battlerId)); gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; @@ -1251,7 +1249,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, (8 - gTrainerFrontPicCoords[trainerPicId].coords) * 4 + 40, - GetBattlerSubpriority(gActiveBattler)); + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2; diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index b11be2e47..a788d6be3 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1105,7 +1105,7 @@ static void RecordedPlayerHandleLoadMonSprite(void) gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(gActiveBattler, 2), GetBattlerSpriteDefault_Y(gActiveBattler), - GetBattlerSubpriority(gActiveBattler)); + GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = -240; gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; @@ -1136,7 +1136,7 @@ static void sub_818BA6C(u8 battlerId, bool8 dontClearSubstituteBit) &gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), - GetBattlerSubpriority(battlerId)); + GetBattlerSpriteSubpriority(battlerId)); gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; @@ -1236,7 +1236,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) trainerPicId = PlayerGenderToFrontTrainerPicId(gSaveBlock2Ptr->playerGender); DecompressTrainerFrontPic(trainerPicId, gActiveBattler); SetMultiuseSpriteTemplateToTrainerFront(trainerPicId, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSubpriority(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicId].tag); gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; @@ -1250,7 +1250,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) { DecompressTrainerBackPic(trainerPicId, gActiveBattler); SetMultiuseSpriteTemplateToTrainerBack(trainerPicId, GetBattlerPosition(gActiveBattler)); - gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSubpriority(gActiveBattler)); + gBattlerSpriteIds[gActiveBattler] = CreateSprite(&gMultiuseSpriteTemplate, xPos, yPos, GetBattlerSpriteSubpriority(gActiveBattler)); gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler; gSprites[gBattlerSpriteIds[gActiveBattler]].pos2.x = 240; diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 2d5eb69fd..c0b496e47 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1464,7 +1464,7 @@ static void sub_816AA80(u8 battlerId) gBattlerSpriteIds[battlerId] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battlerId, 2), GetBattlerSpriteDefault_Y(battlerId), - GetBattlerSubpriority(battlerId)); + GetBattlerSpriteSubpriority(battlerId)); gSprites[gUnknown_03005D7C[battlerId]].data[1] = gBattlerSpriteIds[battlerId]; gSprites[gUnknown_03005D7C[battlerId]].data[2] = battlerId; diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 8d7ed2dce..f53a6281d 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -1097,14 +1097,14 @@ void sub_805EB9C(u8 affineMode) if (IsBattlerSpritePresent(i)) { gSprites[gBattlerSpriteIds[i]].oam.affineMode = affineMode; - if (affineMode == 0) + if (affineMode == ST_OAM_AFFINE_OFF) { - gBattleSpritesDataPtr->healthBoxesData[i].field_6 = gSprites[gBattlerSpriteIds[i]].oam.matrixNum; + gBattleSpritesDataPtr->healthBoxesData[i].matrixNum = gSprites[gBattlerSpriteIds[i]].oam.matrixNum; gSprites[gBattlerSpriteIds[i]].oam.matrixNum = 0; } else { - gSprites[gBattlerSpriteIds[i]].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[i].field_6; + gSprites[gBattlerSpriteIds[i]].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[i].matrixNum; } } } diff --git a/src/bug.c b/src/bug.c index 59b31b37d..535e8946a 100644 --- a/src/bug.c +++ b/src/bug.c @@ -395,7 +395,7 @@ void AnimTranslateStinger(struct Sprite *sprite) lVarY = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; rot = ArcTan2Neg(lVarX - sprite->pos1.x, lVarY - sprite->pos1.y); rot += 0xC000; - sub_80A73E0(sprite, FALSE, 0x100, 0x100, rot); + TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rot); sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = lVarX; @@ -458,7 +458,7 @@ static void AnimMissileArcStep(struct Sprite *sprite) u16 rotation = ArcTan2Neg(sprite->pos1.x + sprite->pos2.x - x2, sprite->pos1.y + sprite->pos2.y - y2); rotation += 0xC000; - sub_80A73E0(sprite, FALSE, 0x100, 0x100, rotation); + TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation); for (i = 0; i < 8; i++) data[i] = tempData[i]; @@ -479,6 +479,6 @@ void sub_8110994(struct Sprite *sprite) sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + 18; } - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); - sprite->callback = sub_80A67BC; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } diff --git a/src/contest.c b/src/contest.c index 201a7472e..3d74109cb 100644 --- a/src/contest.c +++ b/src/contest.c @@ -2520,7 +2520,7 @@ u8 sub_80DB174(u16 species, u32 otId, u32 personality, u32 index) spriteId = CreateSprite(&gMultiuseSpriteTemplate, 0x70, GetBattlerSpriteFinal_Y(2, species, FALSE), 30); gSprites[spriteId].oam.paletteNum = 2; gSprites[spriteId].oam.priority = 2; - gSprites[spriteId].subpriority = GetBattlerSubpriority(2); + gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(2); gSprites[spriteId].callback = SpriteCallbackDummy; gSprites[spriteId].data[0] = gSprites[spriteId].oam.paletteNum; gSprites[spriteId].data[2] = species; diff --git a/src/dragon.c b/src/dragon.c index 49f1b57c8..156d10ce1 100644 --- a/src/dragon.c +++ b/src/dragon.c @@ -208,13 +208,13 @@ void sub_8113064(struct Sprite *sprite) sprite->data[3] = gBattleAnimArgs[4]; sprite->data[5] = gBattleAnimArgs[5]; sprite->invisible = 1; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); sprite->callback = sub_80A66DC; } static void sub_8113100(struct Sprite *sprite) { - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) @@ -235,7 +235,7 @@ static void sub_8113100(struct Sprite *sprite) sprite->data[0] = gBattleAnimArgs[4]; sprite->callback = StartAnimLinearTranslation; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } void sub_81131B4(struct Sprite *sprite) @@ -253,8 +253,8 @@ void sub_81131B4(struct Sprite *sprite) sub_80A6864(sprite, gBattleAnimArgs[1]); sprite->pos1.y += gBattleAnimArgs[2]; - sprite->callback = sub_80A67D8; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + sprite->callback = RunStoredCallbackWhenAnimEnds; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } void sub_8113224(struct Sprite *sprite) diff --git a/src/electric.c b/src/electric.c index 4a0c5525e..5d772e042 100644 --- a/src/electric.c +++ b/src/electric.c @@ -5,7 +5,6 @@ #include "constants/songs.h" #include "sound.h" -extern void sub_80A62EC(struct Sprite *); extern void sub_810E2C8(struct Sprite *); extern bool8 sub_810B614(struct Task *task, u8 taskId); extern void TranslateAnimSpriteToTargetMonLocation(struct Sprite *); @@ -487,13 +486,13 @@ static void sub_810A214(struct Sprite *sprite) static void sub_810A258(struct Sprite *sprite) { if (sprite->affineAnimEnded) - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } static void sub_810A274(struct Sprite *sprite) { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { @@ -509,65 +508,55 @@ static void sub_810A274(struct Sprite *sprite) sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[4]; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); - sprite->callback = sub_80A62EC; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); + sprite->callback = TranslateSpriteInCircleOverDuration; } static void sub_810A308(struct Sprite *sprite) { - u8 slot; + u8 battler; u32 matrixNum; s16 sineVal; switch (gBattleAnimArgs[4]) { case 0: - slot = gBattleAnimAttacker; + battler = gBattleAnimAttacker; break; case 1: default: - slot = gBattleAnimTarget; + battler = gBattleAnimTarget; break; case 2: - if (!IsBattlerSpriteVisible(gBattleAnimAttacker ^ 2)) - { - slot = gBattleAnimAttacker; - } + if (!IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) + battler = gBattleAnimAttacker; else - { - slot = gBattleAnimAttacker ^ 2; - } + battler = BATTLE_PARTNER(gBattleAnimAttacker); break; case 3: - if (IsBattlerSpriteVisible(gBattleAnimAttacker ^ 2)) - { - slot = gBattleAnimTarget ^ 2; - } + if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) + battler = BATTLE_PARTNER(gBattleAnimTarget); else - { - slot = gBattleAnimTarget; - } + battler = gBattleAnimTarget; break; } if (gBattleAnimArgs[5] == 0) { - sprite->pos1.x = GetBattlerSpriteCoord(slot, 0); - sprite->pos1.y = GetBattlerSpriteCoord(slot, 1); + sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X); + sprite->pos1.y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y); } else { - sprite->pos1.x = GetBattlerSpriteCoord(slot, 2); - sprite->pos1.y = GetBattlerSpriteCoord(slot, 3); + sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET); } sprite->pos2.x = (gSineTable[gBattleAnimArgs[0]] * gBattleAnimArgs[1]) >> 8; sprite->pos2.y = (gSineTable[gBattleAnimArgs[0] + 64] * gBattleAnimArgs[1]) >> 8; if (gBattleAnimArgs[6] & 1) - { - sprite->oam.priority = sub_80A8328(slot) + 1; - } + sprite->oam.priority = sub_80A8328(battler) + 1; matrixNum = sprite->oam.matrixNum; sineVal = gSineTable[gBattleAnimArgs[2]]; @@ -585,9 +574,9 @@ static void sub_810A46C(struct Sprite *sprite) InitAnimSpritePos(sprite, 1); sprite->data[0] = gBattleAnimArgs[3]; sprite->data[1] = sprite->pos1.x; - sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[3] = sprite->pos1.y; - sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); InitAnimLinearTranslation(sprite); sprite->data[5] = gBattleAnimArgs[2]; sprite->data[6] = gBattleAnimArgs[5]; @@ -627,8 +616,8 @@ static void sub_810A5BC(struct Sprite *sprite) if (IsContest() || GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) gBattleAnimArgs[1] = -gBattleAnimArgs[1]; - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[1]; - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[2]; + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[2]; sprite->data[3] = gBattleAnimArgs[0]; sprite->data[4] = gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[3]; @@ -637,19 +626,19 @@ static void sub_810A5BC(struct Sprite *sprite) static void sub_810A628(struct Sprite *sprite) { - u8 bank; + u8 battler; sprite->data[0] = gBattleAnimArgs[3]; if (gBattleAnimArgs[7] & 0x8000) - bank = gBattleAnimTarget; + battler = gBattleAnimTarget; else - bank = gBattleAnimAttacker; + battler = gBattleAnimAttacker; - if (IsContest() || GetBattlerSide(bank) == B_SIDE_PLAYER) + if (IsContest() || GetBattlerSide(battler) == B_SIDE_PLAYER) gBattleAnimArgs[0] = -gBattleAnimArgs[0]; - sprite->pos1.x = GetBattlerSpriteCoord(bank, 2) + gBattleAnimArgs[0]; - sprite->pos1.y = GetBattlerSpriteCoord(bank, 3) + gBattleAnimArgs[1]; + sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[1]; sprite->data[4] = gBattleAnimArgs[7] & 0x7FFF; sprite->data[5] = gBattleAnimArgs[2]; @@ -658,7 +647,7 @@ static void sub_810A628(struct Sprite *sprite) sprite->oam.tileNum += gBattleAnimArgs[6] * 4; sprite->callback = sub_810A6EC; - sub_810A6EC(sprite); + sprite->callback(sprite); } static void sub_810A6EC(struct Sprite *sprite) @@ -1015,13 +1004,13 @@ void sub_810AAFC(u8 taskId) if (!gBattleAnimArgs[0]) { - task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + task->data[15] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } else { - task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - task->data[15] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + task->data[15] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); } task->data[6] = gBattleAnimArgs[1]; @@ -1061,7 +1050,7 @@ void sub_810AB78(u8 taskId) InitAnimLinearTranslation(sprite); StoreSpriteCallbackInData6(sprite, sub_810ACC0); - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; if (++task->data[9] > 15) task->data[9] = 0; @@ -1101,43 +1090,43 @@ static void sub_810ACD8(struct Sprite *sprite) { if (!gBattleAnimArgs[0]) { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } else { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); } - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); - sprite->callback = sub_80A67BC; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } static void sub_810AD30(struct Sprite *sprite) { if (!gBattleAnimArgs[0]) { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); } else { - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); } sprite->pos2.x = gBattleAnimArgs[1]; sprite->pos2.y = gBattleAnimArgs[2]; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; } static void sub_810AD98(struct Sprite *sprite) { StartSpriteAffineAnim(sprite, 1); - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); sprite->data[6] = GetAnimBattlerSpriteId(0); sprite->data[7] = 16; @@ -1159,7 +1148,7 @@ static void sub_810ADF8(struct Sprite *sprite) sprite->pos1.x += sprite->data[7]; gSprites[sprite->data[6]].pos2.x += sprite->data[7]; if ((u16)(sprite->pos1.x + 80) > 400) - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } } @@ -1171,7 +1160,7 @@ void sub_810AE5C(u8 taskId) { case 0: task->data[15] = GetAnimBattlerSpriteId(0); - task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) { task->data[14] = -32; @@ -1230,14 +1219,14 @@ void sub_810AFCC(u8 taskId) switch (gBattleAnimArgs[0]) { case 0: - task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - task->data[5] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + task->data[5] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); task->data[4] = (task->data[1] * 128) + 120; break; case 4: task->data[3] = 120 - (task->data[1] * 128); - task->data[5] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); - task->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) - (task->data[1] * 32); + task->data[5] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + task->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - (task->data[1] * 32); break; default: if ((gBattleAnimArgs[0] & 1) != 0) @@ -1337,14 +1326,14 @@ static void sub_810B23C(struct Sprite *sprite) switch (sprite->data[0]) { case 0: - sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); StartSpriteAffineAnim(sprite, 2); sprite->data[0]++; break; case 1: if (sprite->affineAnimEnded) - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } } @@ -1355,10 +1344,10 @@ void sub_810B29C(u8 taskId) switch (task->data[0]) { case 0: - task->data[6] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); - task->data[7] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[6] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); + task->data[7] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); task->data[8] = 4; - task->data[10] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + task->data[10] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); task->data[9] = (task->data[10] - task->data[6]) / 5; task->data[4] = 7; task->data[5] = -1; @@ -1479,15 +1468,15 @@ void sub_810B55C(u8 taskId) switch (task->data[0]) { case 0: - task->data[15] = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 32; + task->data[15] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 32; task->data[14] = task->data[15]; while (task->data[14] > 16) { task->data[14] -= 32; } - task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); - task->data[12] = GetBattlerSubpriority(gBattleAnimTarget) - 2; + task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + task->data[12] = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 2; task->data[0]++; break; case 1: diff --git a/src/fight.c b/src/fight.c index c9000fae4..fb1c01b78 100644 --- a/src/fight.c +++ b/src/fight.c @@ -828,7 +828,7 @@ static void sub_810D6A8(struct Sprite *sprite) sprite->data[4] = GetBattlerSpriteCoord(sprite->data[7], 3); InitAnimLinearTranslation(sprite); - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); sprite->callback = sub_80A6F98; } } @@ -839,7 +839,7 @@ void sub_810D714(struct Sprite *sprite) sprite->pos1.y = 120; sprite->data[0] = gBattleAnimArgs[3]; - sub_80A8048(&sprite->data[4], &sprite->data[5], (void *)(sprite->pos1.y << 8)); + StorePointerInVars(&sprite->data[4], &sprite->data[5], (void *)(sprite->pos1.y << 8)); sprite->data[6] = gBattleAnimArgs[1]; sprite->oam.tileNum += gBattleAnimArgs[2] * 4; @@ -853,9 +853,9 @@ static void sub_810D770(struct Sprite *sprite) if (sprite->data[0] != 0) { - var0 = sub_80A8050(sprite->data[4], sprite->data[5]); + var0 = LoadPointerFromVars(sprite->data[4], sprite->data[5]); var0 -= sprite->data[6]; - sub_80A8048(&sprite->data[4], &sprite->data[5], var0); + StorePointerInVars(&sprite->data[4], &sprite->data[5], var0); var0 = (void *)(((intptr_t)var0) >> 8); sprite->pos1.y = (intptr_t)var0; @@ -978,7 +978,7 @@ void sub_810DA10(struct Sprite *sprite) StartSpriteAnim(sprite, 1); } - sprite->callback = sub_80A67D8; + sprite->callback = RunStoredCallbackWhenAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } diff --git a/src/fire.c b/src/fire.c index 44ae9d320..18ec7b95c 100644 --- a/src/fire.c +++ b/src/fire.c @@ -466,7 +466,7 @@ static void sub_8108EC8(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); - sprite->callback = sub_80A634C; + sprite->callback = TranslateSpriteInGrowingCircleOverDuration; sprite->callback(sprite); } @@ -479,13 +479,13 @@ static void sub_8108F08(struct Sprite *sprite) sprite->data[1] = gBattleAnimArgs[2]; sprite->data[2] = gBattleAnimArgs[3]; - sprite->callback = sub_80A656C; + sprite->callback = TranslateAnimLinearSimple; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } static void sub_8108F4C(struct Sprite *sprite) { - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker)) { @@ -538,12 +538,12 @@ static void sub_8109028(struct Sprite *sprite) } if (sprite->data[0] == sprite->data[1]) - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } static void sub_8109064(struct Sprite *sprite) { - sub_80A6838(sprite); + SetSpriteCoordsToAnimAttackerCoords(sprite); if (GetBattlerSide(gBattleAnimAttacker)) { @@ -588,7 +588,7 @@ static void sub_81090D8(struct Sprite *sprite) } else { - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); } } @@ -779,7 +779,7 @@ void sub_8109460(u8 taskId) // initialize animation task for Move_ERUPTION? task->data[5] = GetBattlerSide(gBattleAnimAttacker); task->data[6] = 0; - sub_80A7270(task->data[15], 0); + PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); task->func = sub_81094D0; } @@ -816,7 +816,7 @@ static void sub_81094D0(u8 taskId) // animate Move_ERUPTION? if(!sub_80A80C8(task)) { - sub_80A7E6C(task->data[15]); + SetBattlerSpriteYOffsetFromYScale(task->data[15]); gSprites[task->data[15]].pos2.x = 0; task->data[1] = 0; @@ -879,7 +879,7 @@ static void sub_81094D0(u8 taskId) // animate Move_ERUPTION? if (!sub_80A80C8(task)) { gSprites[task->data[15]].pos1.y = task->data[4]; - sub_80A7344(task->data[15]); + ResetSpriteRotScale(task->data[15]); task->data[2] = 0; task->data[0]++; diff --git a/src/ghost.c b/src/ghost.c index 3135004da..d4f6512a8 100644 --- a/src/ghost.c +++ b/src/ghost.c @@ -342,8 +342,8 @@ void sub_811188C(u8 taskId) SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0x10)); spriteId = GetAnimBattlerSpriteId(0); - sub_80A7270(spriteId, 1); - obj_id_set_rotscale(spriteId, 128, 128, 0); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND); + SetSpriteRotScale(spriteId, 128, 128, 0); gSprites[spriteId].invisible = FALSE; gTasks[taskId].data[0] = 128; gTasks[taskId].data[1] = *gBattleAnimArgs; @@ -381,11 +381,11 @@ static void sub_811196C(u8 taskId) gTasks[taskId].data[0] += 8; if (gTasks[taskId].data[0] <= 0xFF) { - obj_id_set_rotscale(spriteId, gTasks[taskId].data[0], gTasks[taskId].data[0], 0); + SetSpriteRotScale(spriteId, gTasks[taskId].data[0], gTasks[taskId].data[0], 0); } else { - sub_80A7344(spriteId); + ResetSpriteRotScale(spriteId); DestroyAnimVisualTask(taskId); SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); @@ -454,7 +454,7 @@ static void AnimShadowBallStep(struct Sprite *sprite) sprite->data[0] += 1; break; case 3: - move_anim_8074EE0(sprite); + DestroySpriteAndMatrix(sprite); break; } } @@ -510,7 +510,7 @@ void sub_8111C50(u8 taskId) struct Task *task; task = &gTasks[taskId]; - task->data[0] = duplicate_obj_of_side_rel2move_in_transparent_mode(1); + task->data[0] = CloneBattlerSpriteWithBlend(1); if (task->data[0] < 0) { DestroyAnimVisualTask(taskId); @@ -536,7 +536,7 @@ void sub_8111C50(u8 taskId) gSprites[task->data[0]].data[3] = 0; gSprites[task->data[0]].data[4] = 0; StoreSpriteCallbackInData6(&gSprites[task->data[0]], SpriteCallbackDummy); - gSprites[task->data[0]].callback = sub_80A656C; + gSprites[task->data[0]].callback = TranslateAnimLinearSimple; task->func = sub_8111D78; } @@ -602,7 +602,7 @@ static void sub_8111E78(u8 taskId) } else { - task->data[0] = duplicate_obj_of_side_rel2move_in_transparent_mode(1); + task->data[0] = CloneBattlerSpriteWithBlend(1); if (task->data[0] < 0) { FreeSpritePaletteByTag(0x2771); @@ -1171,7 +1171,7 @@ void sub_8112C6C(u8 taskId) task->data[11] = (sub_80A861C(gBattleAnimAttacker, 1) / 2) + 8; task->data[7] = 0; task->data[5] = sub_80A8328(gBattleAnimAttacker); - task->data[6] = GetBattlerSubpriority(gBattleAnimAttacker) - 2; + task->data[6] = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 2; task->data[3] = 0; task->data[4] = 16; SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); @@ -1322,6 +1322,6 @@ static void sub_8112FB8(struct Sprite *sprite) gSprites[sprite->data[5]].pos2.x = 0; gSprites[sprite->data[5]].pos2.y = 0; gSprites[sprite->data[5]].pos1.y -= 8; - sprite->callback = move_anim_8074EE0; + sprite->callback = DestroySpriteAndMatrix; } } diff --git a/src/ground.c b/src/ground.c index 6cb7b8557..77acd3919 100644 --- a/src/ground.c +++ b/src/ground.c @@ -221,7 +221,7 @@ void AnimDirtScatter(struct Sprite *sprite) sprite->data[2] = targetXPos + xOffset; sprite->data[4] = targetYPos + yOffset; sprite->callback = StartAnimLinearTranslation; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } // Moves a particle of dirt in the Mud Sport animation. diff --git a/src/normal.c b/src/normal.c index 3de8b1157..e20f74588 100644 --- a/src/normal.c +++ b/src/normal.c @@ -410,8 +410,8 @@ void sub_81159B4(struct Sprite *sprite) sprite->data[3] = 40; sprite->data[4] = 112; sprite->data[5] = 0; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); - sprite->callback = sub_80A634C; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); + sprite->callback = TranslateSpriteInGrowingCircleOverDuration; sprite->callback(sprite); } @@ -884,7 +884,7 @@ void sub_8116388(struct Sprite *sprite) else sub_80A6980(sprite, TRUE); - sprite->callback = sub_80A67BC; + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -897,7 +897,7 @@ static void sub_81163D0(struct Sprite *sprite) sub_80A6980(sprite, TRUE); sprite->data[0] = gBattleAnimArgs[4]; - sprite->callback = sub_80A67BC; + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; StoreSpriteCallbackInData6(sprite, sub_810E2C8); } @@ -923,8 +923,8 @@ void sub_8116458(struct Sprite *sprite) sprite->pos2.x += (Random2() % 48) - 24; sprite->pos2.y += (Random2() % 24) - 12; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); - sprite->callback = sub_80A67BC; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } void sub_81164F0(struct Sprite *sprite) @@ -935,8 +935,8 @@ void sub_81164F0(struct Sprite *sprite) sprite->pos2.x = gBattleAnimArgs[1]; sprite->pos2.y = gBattleAnimArgs[2]; StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]); - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); - sprite->callback = sub_80A67BC; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); + sprite->callback = RunStoredCallbackWhenAffineAnimEnds; } void sub_8116560(struct Sprite *sprite) diff --git a/src/poison.c b/src/poison.c index efa89ec13..c52299e3a 100644 --- a/src/poison.c +++ b/src/poison.c @@ -258,7 +258,7 @@ void sub_810DCD0(struct Sprite *sprite) static void sub_810DD24(struct Sprite *sprite) { - sub_80A656C(sprite); + TranslateAnimLinearSimple(sprite); sprite->data[1] -= sprite->data[5]; sprite->data[2] -= sprite->data[6]; diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 1a5221616..06d2af5b7 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -226,7 +226,7 @@ static void CreateBattlerSprite(u8 battler) return; SetMultiuseSpriteTemplateToPokemon(GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES), GetBattlerPosition(battler)); - gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, 2), posY, GetBattlerSubpriority(battler)); + gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, 2), posY, GetBattlerSpriteSubpriority(battler)); gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler; gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battler]].data[0] = battler; @@ -241,7 +241,7 @@ static void CreateBattlerSprite(u8 battler) SetMultiuseSpriteTemplateToTrainerBack(gSaveBlock2Ptr->playerGender, GetBattlerPosition(B_POSITION_PLAYER_LEFT)); gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, 0x50, (8 - gTrainerBackPicCoords[gSaveBlock2Ptr->playerGender].coords) * 4 + 80, - GetBattlerSubpriority(0)); + GetBattlerSpriteSubpriority(0)); gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler; gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battler]].data[0] = battler; @@ -251,7 +251,7 @@ static void CreateBattlerSprite(u8 battler) SetMultiuseSpriteTemplateToTrainerBack(TRAINER_BACK_PIC_WALLY, GetBattlerPosition(0)); gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, 0x50, (8 - gTrainerBackPicCoords[TRAINER_BACK_PIC_WALLY].coords) * 4 + 80, - GetBattlerSubpriority(0)); + GetBattlerSpriteSubpriority(0)); gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler; gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battler]].data[0] = battler; @@ -262,7 +262,7 @@ static void CreateBattlerSprite(u8 battler) return; SetMultiuseSpriteTemplateToPokemon(GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES), GetBattlerPosition(battler)); - gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, 2), posY, GetBattlerSubpriority(battler)); + gBattlerSpriteIds[battler] = CreateSprite(&gMultiuseSpriteTemplate, GetBattlerSpriteCoord(battler, 2), posY, GetBattlerSpriteSubpriority(battler)); gSprites[gBattlerSpriteIds[battler]].oam.paletteNum = battler; gSprites[gBattlerSpriteIds[battler]].callback = SpriteCallbackDummy; gSprites[gBattlerSpriteIds[battler]].data[0] = battler; diff --git a/src/rock.c b/src/rock.c index 3b8e505d8..20d4ea738 100644 --- a/src/rock.c +++ b/src/rock.c @@ -340,7 +340,7 @@ static void sub_8110A70(struct Sprite *sprite) sprite->data[3] = 32; sprite->data[4] = -24; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); sprite->callback = sub_80A6450; sprite->callback(sprite); } @@ -367,8 +367,8 @@ void sub_8110AB4(struct Sprite *sprite) sprite->data[3] = 0; sprite->data[4] = 0; - sprite->callback = sub_80A656C; - StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + sprite->callback = TranslateAnimLinearSimple; + StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } void sub_8110B38(struct Sprite *sprite) From 9ca27f1332dd2c700292cfdcefc5c9412847fc0e Mon Sep 17 00:00:00 2001 From: Meowsy Date: Tue, 18 Dec 2018 09:20:43 -0500 Subject: [PATCH 5/8] Document return value. --- src/pokemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pokemon.c b/src/pokemon.c index 50f0a1ac2..004dac0d5 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5939,7 +5939,7 @@ u16 SpeciesToCryId(u16 species) return species; if (species < SPECIES_TREECKO - 1) - return 200; + return SPECIES_UNOWN - 1; return gSpeciesIdToCryId[species - (SPECIES_TREECKO - 1)]; } From d6b31346c3441d4d99f1fbf7d4c4de8573450872 Mon Sep 17 00:00:00 2001 From: Meowsy Date: Tue, 18 Dec 2018 09:35:31 -0500 Subject: [PATCH 6/8] Additional SPECIES_* documentation. --- src/battle_factory.c | 8 ++++---- src/battle_main.c | 4 ++-- src/battle_tent.c | 7 ++++--- src/hall_of_fame.c | 2 +- src/tv.c | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/battle_factory.c b/src/battle_factory.c index a693acfb6..801b33ba7 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -526,7 +526,7 @@ static void sub_81A67EC(void) } var_40 = sub_81A6F70(factoryBattleMode, factoryLvlMode); - currSpecies = 0; + currSpecies = SPECIES_NONE; i = 0; while (i != PARTY_SIZE) { @@ -546,7 +546,7 @@ static void sub_81A67EC(void) break; if (species[j] == gFacilityTrainerMons[monSetId].species) { - if (currSpecies == 0) + if (currSpecies == SPECIES_NONE) currSpecies = gFacilityTrainerMons[monSetId].species; else break; @@ -561,7 +561,7 @@ static void sub_81A67EC(void) if (heldItems[j] != 0 && heldItems[j] == gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]) { if (gFacilityTrainerMons[monSetId].species == currSpecies) - currSpecies = 0; + currSpecies = SPECIES_NONE; break; } } @@ -579,7 +579,7 @@ static void sub_81A67EC(void) static void sub_81A6A08(void) { u8 i; - u8 typesCount[18]; + u8 typesCount[NUMBER_OF_MON_TYPES]; u8 usedType[2]; gFacilityTrainerMons = gBattleFrontierMons; diff --git a/src/battle_main.c b/src/battle_main.c index 9b7f58023..d9256d622 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2122,12 +2122,12 @@ static void sub_8038B94(u8 taskId) if (species != SPECIES_EGG && hp != 0 && status == 0) r7 |= 1 << i * 2; - if (species == 0) + if (species == SPECIES_NONE) continue; if (hp != 0 && (species == SPECIES_EGG || status != 0)) r7 |= 2 << i * 2; - if (species == 0) + if (species == SPECIES_NONE) continue; if (species != SPECIES_EGG && hp == 0) r7 |= 3 << i * 2; diff --git a/src/battle_tent.c b/src/battle_tent.c index d66c093e9..c358deaa5 100644 --- a/src/battle_tent.c +++ b/src/battle_tent.c @@ -13,6 +13,7 @@ #include "string_util.h" #include "constants/items.h" #include "constants/region_map_sections.h" +#include "constants/species.h" // This file's functions. static void sub_81B99D4(void); @@ -292,7 +293,7 @@ static void sub_81B9EC0(void) heldItems[i] = 0; } gFacilityTrainerMons = gSlateportBattleTentMons; - currSpecies = 0; + currSpecies = SPECIES_NONE; i = 0; while (i != PARTY_SIZE) { @@ -305,7 +306,7 @@ static void sub_81B9EC0(void) break; if (species[j] == gFacilityTrainerMons[monSetId].species) { - if (currSpecies == 0) + if (currSpecies == SPECIES_NONE) currSpecies = gFacilityTrainerMons[monSetId].species; else break; @@ -320,7 +321,7 @@ static void sub_81B9EC0(void) if (heldItems[j] != 0 && heldItems[j] == gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]) { if (gFacilityTrainerMons[monSetId].species == currSpecies) - currSpecies = 0; + currSpecies = SPECIES_NONE; break; } } diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index ad5673036..f7792e935 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -497,7 +497,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId) for (i = 0; i < HALL_OF_FAME_MAX_TEAMS; i++, lastSavedTeam++) { - if (lastSavedTeam->mon[0].species == 0) + if (lastSavedTeam->mon[0].species == SPECIES_NONE) break; } if (i >= HALL_OF_FAME_MAX_TEAMS) diff --git a/src/tv.c b/src/tv.c index 0d6e12279..267520095 100644 --- a/src/tv.c +++ b/src/tv.c @@ -3231,7 +3231,7 @@ u16 TV_GetSomeOtherSpeciesAlreadySeenByPlayer(u16 passedSpecies) initSpecies = species; while (GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_GET_SEEN) != TRUE || species == passedSpecies) { - if (species == 1) + if (species == SPECIES_NONE + 1) { species = NUM_SPECIES - 1; } From d2b5a0e83f83d126caf8a9df785ca3cda0149369 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Tue, 18 Dec 2018 10:08:03 -0600 Subject: [PATCH 7/8] Convert battle_anim_815A0D4 data to .c --- data/battle_anim_815A0D4.s | 510 ------------ graphics/unknown/unknown_85CE55C.pal | 19 + ld_script.txt | 3 +- src/battle_anim_815A0D4.c | 1092 ++++++++++++++++++++++++++ 4 files changed, 1113 insertions(+), 511 deletions(-) delete mode 100644 data/battle_anim_815A0D4.s create mode 100755 graphics/unknown/unknown_85CE55C.pal create mode 100755 src/battle_anim_815A0D4.c diff --git a/data/battle_anim_815A0D4.s b/data/battle_anim_815A0D4.s deleted file mode 100644 index 208436f4c..000000000 --- a/data/battle_anim_815A0D4.s +++ /dev/null @@ -1,510 +0,0 @@ -#include "constants/battle_anim.h" - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gUnknown_085CE004:: @ 85CE004 - .2byte 0x0000, 0x0004, 0x0010, 0x0004 - .2byte 0x0020, 0x0004, 0x0030, 0x0004 - .2byte 0x0040, 0x0004, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE01C:: @ 85CE01C - .4byte gUnknown_085CE004 - - .align 2 -gUnknown_085CE020:: @ 85CE020 - spr_template ANIM_TAG_SCRATCH, ANIM_TAG_SCRATCH, gUnknown_08524A34, gUnknown_085CE01C, NULL, gDummySpriteAffineAnimTable, sub_80A77C8 - - .align 2 -gUnknown_085CE038:: @ 85CE038 - spr_template ANIM_TAG_BLACK_SMOKE, ANIM_TAG_BLACK_SMOKE, gUnknown_08524934, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A0D4 - - .align 2 -gUnknown_085CE050:: @ 85CE050 - spr_template ANIM_TAG_BLACK_BALL, ANIM_TAG_BLACK_BALL, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80A78AC - - .align 2 -gUnknown_085CE068:: @ 85CE068 - .2byte 0x0000, 0x0028, 0x0010, 0x0008 - .2byte 0x0020, 0x0028, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE078:: @ 85CE078 - .4byte gUnknown_085CE068 - - .align 2 -gUnknown_085CE07C:: @ 85CE07C - spr_template ANIM_TAG_OPENING_EYE, ANIM_TAG_OPENING_EYE, gUnknown_08524914, gUnknown_085CE078, NULL, gDummySpriteAffineAnimTable, sub_80A77C8 - - .align 2 -gUnknown_085CE094:: - spr_template ANIM_TAG_ROUND_WHITE_HALO, ANIM_TAG_ROUND_WHITE_HALO, gUnknown_08524A3C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A1B0 - - .align 2 -gUnknown_085CE0AC:: - spr_template ANIM_TAG_TEAL_ALERT, ANIM_TAG_TEAL_ALERT, gUnknown_08524974, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A254 - - .align 2 -gUnknown_085CE0C4:: @ 85CE0C4 - .2byte 0x0180, 0x0180, 0x0000, 0x0000 - .2byte 0xffe0, 0x0018, 0x0500, 0x0000 - .2byte 0x0018, 0xffe0, 0x0500, 0x0000 - .2byte 0x7ffe, 0x0001, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE0E4:: @ 85CE0E4 - .2byte 0x0030, 0x0030, 0x0000, 0x0000 - .2byte 0x0020, 0x0020, 0x0600, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE0FC:: @ 85CE0FC - .4byte gUnknown_085CE0C4 - .4byte gUnknown_085CE0E4 - - .align 2 -gUnknown_085CE104:: @ 85CE104 - spr_template ANIM_TAG_EYE, ANIM_TAG_EYE, gUnknown_08524AFC, gDummySpriteAnimTable, NULL, gUnknown_085CE0FC, sub_815A2F0 - - .align 2 -gUnknown_085CE11C:: @ 85CE11C - spr_template ANIM_TAG_SPIKES, ANIM_TAG_SPIKES, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A6C4 - - .align 2 -gUnknown_085CE134:: @ 85CE134 - .2byte 0x0000, 0x0003, 0x0010, 0x0003 - .2byte 0x0020, 0x0003, 0x0030, 0x0003 - .2byte 0x0040, 0x0003, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE14C:: @ 85CE14C - .4byte gUnknown_085CE134 - - .align 2 -gUnknown_085CE150:: @ 85CE150 - spr_template ANIM_TAG_LEER, ANIM_TAG_LEER, gUnknown_08524914, gUnknown_085CE14C, NULL, gDummySpriteAffineAnimTable, sub_815A7B0 - - .align 2 -gUnknown_085CE168:: @ 85CE168 - .2byte 0x0000, 0x0003, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE170:: @ 85CE170 - .4byte gUnknown_085CE168 - - .align 2 -gUnknown_085CE174:: @ 85CE174 - .2byte 0xfff9, 0xfff9, 0x10fd, 0x0000 - .2byte 0x0007, 0x0007, 0x1003, 0x0000 - .2byte 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE18C:: @ 85CE18C - .4byte gUnknown_085CE174 - - .align 2 -gUnknown_085CE190:: @ 85CE190 - spr_template ANIM_TAG_LETTER_Z, ANIM_TAG_LETTER_Z, gUnknown_08524974, gUnknown_085CE170, NULL, gUnknown_085CE18C, sub_815A7EC - - .align 2 -gUnknown_085CE1A8:: @ 85CE1A8 - .2byte 0x0000, 0x0008, 0x0010, 0x0010, 0x0020, 0x0004, 0x0030, 0x0004, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE1BC:: @ 85CE1BC - .4byte gUnknown_085CE1A8 - - .align 2 -gUnknown_085CE1C0:: @ 85CE1C0 - .2byte 0x0200, 0x0200, 0x0000, 0x0000 - .2byte 0xffe0, 0xffe0, 0x0800, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE1D8:: @ 85CE1D8 - .4byte gUnknown_085CE1C0 - - .align 2 -gUnknown_085CE1DC:: @ 85CE1DC - spr_template ANIM_TAG_FANG_ATTACK, ANIM_TAG_FANG_ATTACK, gUnknown_085249D4, gUnknown_085CE1BC, NULL, gUnknown_085CE1D8, sub_815A8AC - - .align 2 -gUnknown_085CE1F4:: @ 85CE1F4 - .2byte 0x0000, 0x0180, 0x0000, 0x0000 - .2byte 0x0010, 0x0000, 0x1400, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE20C:: @ 85CE20C - .2byte 0x0140, 0x0180, 0x0000, 0x0000 - .2byte 0xfff0, 0x0000, 0x1300, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE224:: @ 85CE224 - .4byte gUnknown_085CE1F4 - .4byte gUnknown_085CE20C - - .align 2 -gUnknown_085CE22C:: @ 85CE22C - spr_template ANIM_TAG_SPOTLIGHT, ANIM_TAG_SPOTLIGHT, gUnknown_085249DC, gDummySpriteAnimTable, NULL, gUnknown_085CE224, sub_815A934 - - .align 2 -gUnknown_085CE244:: - spr_template ANIM_TAG_TAG_HAND, ANIM_TAG_TAG_HAND, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815AAA4 - - .align 2 -gUnknown_085CE25C:: - spr_template ANIM_TAG_TAG_HAND, ANIM_TAG_TAG_HAND, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815ABD0 - - .align 2 -gUnknown_085CE274:: @ 85CE274 - .2byte 0x0000, 0x0002, 0x0008, 0x0002 - .2byte 0x0010, 0x0002, 0xfffe, 0x0000 - - .align 2 -gUnknown_085CE284:: @ 85CE284 - .4byte gUnknown_085CE274 - - .align 2 -gUnknown_085CE288:: @ 85CE288 - spr_template ANIM_TAG_RAPID_SPIN, ANIM_TAG_RAPID_SPIN, gUnknown_08524934, gUnknown_085CE284, NULL, gDummySpriteAffineAnimTable, sub_815ACD0 - - .align 2 -gUnknown_085CE2A0:: @ 85CE2A0 - .2byte 0xfff4, 0x0008, 0x0400, 0x0000, 0x0014, 0xffec, 0x0400, 0x0000, 0xfff8, 0x000c, 0x0400, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE2C0:: @ 85CE2C0 - .2byte 0x0000, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE2C8:: @ 85CE2C8 - .4byte gUnknown_085CE2C0 - - .align 2 -gUnknown_085CE2CC:: @ 85CE2CC - .2byte 0x0000, 0x0000, 0x2805, 0x0000, 0x0000, 0x0000, 0x0a0a, 0x0000, 0x0000, 0x0000, 0x0a0f, 0x0000, 0x0000, 0x0000, 0x2814, 0x0000 - .2byte 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE2F4:: @ 85CE2F4 - .4byte gUnknown_085CE2CC - - .align 2 -gUnknown_085CE2F8:: @ 85CE2F8 - spr_template ANIM_TAG_TRI_FORCE_TRIANGLE, ANIM_TAG_TRI_FORCE_TRIANGLE, gUnknown_085249DC, gUnknown_085CE2C8, NULL, gUnknown_085CE2F4, sub_815B27C - - .align 2 -gUnknown_085CE310:: @ 85CE310 - .2byte 0x0000, 0x0003, 0x0010, 0x0003, 0x0020, 0x0003, 0x0030, 0x0003, 0x0020, 0x0043, 0x0010, 0x0043, 0x0000, 0x0043, 0xfffd, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_085CE334:: @ 85CE334 - .4byte gUnknown_085CE310 - - .align 2 -gUnknown_085CE338:: @ 85CE338 - spr_template ANIM_TAG_ECLIPSING_ORB, ANIM_TAG_ECLIPSING_ORB, gUnknown_08524914, gUnknown_085CE334, NULL, gDummySpriteAffineAnimTable, sub_80A77C8 - - .align 2 -gUnknown_085CE350:: @ 85CE350 - .2byte 0xfff4, 0x0014, 0x0800, 0x0000, 0x000c, 0xffec, 0x0800, 0x0000, 0x7ffd, 0x0002, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE370:: @ 85CE370 - spr_template ANIM_TAG_POKEBALL, ANIM_TAG_POKEBALL, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815B394 - - .align 2 -gUnknown_085CE388:: @ 85CE388 - spr_template ANIM_TAG_GOLD_STARS, ANIM_TAG_GOLD_STARS, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815B49C - - .align 2 -gUnknown_085CE3A0:: @ 85CE3A0 - spr_template ANIM_TAG_GOLD_STARS, ANIM_TAG_GOLD_STARS, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815B570 - - .align 2 -gUnknown_085CE3B8:: @ 85CE3B8 - .2byte 0x0008, 0xfff8, 0x0c00, 0x0000, 0xfff0, 0x0010, 0x0c00, 0x0000, 0x0008, 0xfff8, 0x0c00, 0x0000, 0x7ffd, 0x0001, 0x0000, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE3E0:: @ 85CE3E0 - .2byte 0x0000, 0x0006, 0x1400, 0x0000, 0x0000, 0x0000, 0x1400, 0x0000, 0x0000, 0xffee, 0x0600, 0x0000, 0xffee, 0xffee, 0x0300, 0x0000 - .2byte 0x0000, 0x0000, 0x0f00, 0x0000, 0x0004, 0x0004, 0x0d00, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE418:: @ 85CE418 - spr_template ANIM_TAG_BLUE_ORB, ANIM_TAG_BLUE_ORB, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815B70C - - .align 2 -gUnknown_085CE430:: @ 85CE430 - .2byte 0x0000, 0x0006, 0x1400, 0x0000, 0x0000, 0x0000, 0x1400, 0x0000, 0x0007, 0xffe2, 0x0600, 0x0000, 0x0000, 0x0000, 0x1400, 0x0000 - .2byte 0xfffe, 0x0003, 0x1400, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE460:: @ 85CE460 - .byte 0xe8, 0x18, 0xfc, 0x00 - - .align 2 -gUnknown_085CE464:: @ 85CE464 - .2byte 0x0000, 0x0006, 0x0004, 0x0006, 0xfffe, 0x0000 - - .align 2 -gUnknown_085CE470:: @ 85CE470 - .2byte 0x0008, 0x0006, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE478:: @ 85CE478 - .2byte 0x000c, 0x0006, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE480:: @ 85CE480 - .4byte gUnknown_085CE464 - .4byte gUnknown_085CE470 - .4byte gUnknown_085CE478 - - .align 2 -gUnknown_085CE48C:: @ 85CE48C - spr_template ANIM_TAG_GREEN_STAR, ANIM_TAG_GREEN_STAR, gUnknown_0852490C, gUnknown_085CE480, NULL, gDummySpriteAffineAnimTable, sub_815BE04 - - .align 2 -gUnknown_085CE4A4:: @ 85CE4A4 - .byte 0x78, 0x50, 0x28, 0x00 - - .align 2 -gUnknown_085CE4A8:: @ 85CE4A8 - .2byte 0x0000, 0x0000, 0x0032, 0x0000 - - .align 2 -gUnknown_085CE4B0:: @ 85CE4B0 - .2byte 0x0000, 0xfff1, 0x0700, 0x0000, 0x0000, 0x000f, 0x0700, 0x0000, 0x7ffd, 0x0002, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE4D0:: @ 85CE4D0 - spr_template ANIM_TAG_ANGER, ANIM_TAG_ANGER, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815C400 - - .align 2 -gUnknown_085CE4E8:: @ 85CE4E8 - .2byte 0x0000, 0x0008, 0x0001, 0x0008, 0x0002, 0x0008, 0x0003, 0x0008, 0x0003, 0x0088, 0x0002, 0x0088, 0x0000, 0x0088, 0x0001, 0x0088 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_085CE50C:: @ 85CE50C - .2byte 0x0000, 0x0048, 0x0001, 0x0048, 0x0002, 0x0048, 0x0003, 0x0048, 0x0003, 0x00c8, 0x0002, 0x00c8, 0x0000, 0x00c8, 0x0001, 0x00c8 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_085CE530:: @ 85CE530 - .2byte 0x0000, 0x0008, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE538:: @ 85CE538 - .4byte gUnknown_085CE4E8 - .4byte gUnknown_085CE50C - .4byte gUnknown_085CE530 - - .align 2 -gUnknown_085CE544:: @ 85CE544 - spr_template ANIM_TAG_PINK_PETAL, ANIM_TAG_PINK_PETAL, gUnknown_08524904, gUnknown_085CE538, NULL, gDummySpriteAffineAnimTable, sub_815C6B0 - - .align 2 -gUnknown_085CE55C:: @ 85CE55C - .byte 0x0c, 0x18, 0x10, 0x16, 0x13, 0x13, 0x15, 0x10, 0x17, 0x0c, 0x16, 0x07, 0x13, 0x04, 0x10, 0x01, 0x0b, 0x00, 0x06, 0x01, 0x04, 0x04, 0x01, 0x07, 0x00, 0x0c, 0x02, 0x11, 0x04, 0x13, 0x08, 0x16 - - .align 2 -gUnknown_085CE57C:: @ 85CE57C - .2byte 0x0000, 0x0005, 0x0004, 0x0009, 0x0008, 0x0005, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE58C:: @ 85CE58C - .4byte gUnknown_085CE57C - - .align 2 -gUnknown_085CE590:: @ 85CE590 - spr_template ANIM_TAG_PAIN_SPLIT, ANIM_TAG_PAIN_SPLIT, gUnknown_0852490C, gUnknown_085CE58C, NULL, gDummySpriteAffineAnimTable, sub_815C95C -gUnknown_085CE5A8:: - spr_template ANIM_TAG_CONFETTI, ANIM_TAG_CONFETTI, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815CB88 -gUnknown_085CE5C0:: - spr_template ANIM_TAG_SPOTLIGHT, ANIM_TAG_SPOTLIGHT, gUnknown_085249DC, gDummySpriteAnimTable, NULL, gUnknown_085CE224, sub_815CC94 -gBattleAnimSpriteTemplate_85CE5D8:: - spr_template ANIM_TAG_BLUE_ORB, ANIM_TAG_BLUE_ORB, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815CDB4 - - .align 2 -gUnknown_085CE5F0:: @ 85CE5F0 - .2byte 0x0010, 0x0000, 0x0400, 0x0000, 0x0000, 0xfffd, 0x1000, 0x0000, 0x0004, 0x0000, 0x0400, 0x0000, 0x0000, 0x0000, 0x1800, 0x0000 - .2byte 0xfffb, 0x0003, 0x1000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE620:: @ 85CE620 - .2byte 0x0080, 0x0080, 0x0000, 0x0000, 0xfff8, 0xfff8, 0x0800, 0x0000, 0x0008, 0x0008, 0x0800, 0x0000, 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE640:: @ 85CE640 - .2byte 0x00c0, 0x00c0, 0x0000, 0x0000, 0x0008, 0x0008, 0x0800, 0x0000, 0xfff8, 0xfff8, 0x0800, 0x0000, 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE660:: @ 85CE660 - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x0008, 0x0008, 0x0800, 0x0000, 0xfff8, 0xfff8, 0x0800, 0x0000, 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE680:: @ 85CE680 - .4byte gUnknown_085CE620 - .4byte gUnknown_085CE640 - .4byte gUnknown_085CE660 - - .align 2 -gUnknown_085CE68C:: @ 85CE68C - spr_template ANIM_TAG_PINK_CLOUD, ANIM_TAG_PINK_CLOUD, gUnknown_08524974, gDummySpriteAnimTable, NULL, gUnknown_085CE680, sub_815D7B4 - - .align 2 -gUnknown_085CE6A4:: @ 85CE6A4 - .2byte 0x0080, 0x0080, 0x0000, 0x0000, 0xfffc, 0xfffa, 0x1000, 0x0000, 0x0004, 0x0006, 0x1000, 0x0000, 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE6C4:: @ 85CE6C4 - .2byte 0x00c0, 0x00c0, 0x0000, 0x0000, 0x0004, 0x0006, 0x1000, 0x0000, 0xfffc, 0xfffa, 0x1000, 0x0000, 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE6E4:: @ 85CE6E4 - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x0004, 0x0006, 0x1000, 0x0000, 0xfffc, 0xfffa, 0x1000, 0x0000, 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE704:: @ 85CE704 - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x0008, 0x000a, 0x1e00, 0x0000, 0xfff8, 0xfff6, 0x1000, 0x0000, 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE724:: @ 85CE724 - .4byte gUnknown_085CE6A4 - .4byte gUnknown_085CE6C4 - .4byte gUnknown_085CE6E4 - .4byte gUnknown_085CE704 - - .align 2 -gUnknown_085CE734:: @ 85CE734 - spr_template ANIM_TAG_PINK_CLOUD, ANIM_TAG_PINK_CLOUD, gUnknown_085249D4, gDummySpriteAnimTable, NULL, gUnknown_085CE724, sub_815D870 - - .align 2 -gUnknown_085CE74C:: @ 85CE74C - .2byte 0xfff0, 0x0010, 0x0600, 0x0000, 0x0010, 0xfff0, 0x0c00, 0x0000, 0xfff0, 0x0010, 0x0600, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE76C:: @ 85CE76C - spr_template ANIM_TAG_SWEAT_DROP, ANIM_TAG_SWEAT_DROP, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815DEBC - - .align 2 -gUnknown_085CE784:: @ 85CE784 - .byte 0x3c, 0x07, 0xbc, 0x16, 0x5b, 0x22, 0xdb, 0x2d, 0x5a, 0x3d, 0xfa, 0x48, 0x79, 0x54, 0x19, 0x64, 0x19, 0x5c, 0x19, 0x50, 0x19, 0x40, 0x19, 0x34, 0x1a, 0x28, 0x1a, 0x18, 0x1a, 0x0c, 0x1b, 0x00 - .byte 0x3b, 0x00, 0xbb, 0x00, 0x3b, 0x01, 0x9b, 0x01, 0x1c, 0x02, 0x7c, 0x02, 0xfc, 0x02, 0x7d, 0x03 - - .align 2 -gUnknown_085CE7B4:: @ 85CE7B4 - .2byte 0x0000, 0x0003, 0x0010, 0x0003, 0xfffe, 0x0000 - - .align 2 -gUnknown_085CE7C0:: @ 85CE7C0 - .2byte 0x0020, 0x0003, 0x0030, 0x0003, 0xfffe, 0x0000 - - .align 2 -gUnknown_085CE7CC:: @ 85CE7CC - .4byte gUnknown_085CE7B4 - .4byte gUnknown_085CE7C0 - - .align 2 -gUnknown_085CE7D4:: @ 85CE7D4 - spr_template ANIM_TAG_NOISE_LINE, ANIM_TAG_NOISE_LINE, gUnknown_08524914, gUnknown_085CE7CC, NULL, gDummySpriteAffineAnimTable, sub_815E01C - - .align 2 -gUnknown_085CE7EC:: @ 85CE7EC - spr_template ANIM_TAG_SMALL_RED_EYE, ANIM_TAG_SMALL_RED_EYE, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815E404 -gUnknown_085CE804:: - spr_template ANIM_TAG_PAW_PRINT, ANIM_TAG_PAW_PRINT, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815E444 - - .align 2 -gUnknown_085CE81C:: @ 85CE81C - .2byte 0x0000, 0x0000, 0x18fc, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE82C:: @ 85CE82C - .2byte 0x0100, 0x0100, 0x00c0, 0x0000, 0x0000, 0x0000, 0x1804, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE844:: @ 85CE844 - .4byte gUnknown_085CE81C - .4byte gUnknown_085CE82C - - .align 2 -gUnknown_085CE84C:: @ 85CE84C - spr_template ANIM_TAG_RED_BALL, ANIM_TAG_RED_BALL, gUnknown_08524974, gDummySpriteAnimTable, NULL, gUnknown_085CE844, SpriteCallbackDummy - - .align 2 -gUnknown_085CE864:: - spr_template ANIM_TAG_TAG_HAND, ANIM_TAG_TAG_HAND, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815E6D8 - - .align 2 -gUnknown_085CE87C:: @ 85CE87C - .2byte 0x0000, 0xfff0, 0x0600, 0x0000, 0x0000, 0x0010, 0x0600, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE894:: @ 85CE894 - spr_template ANIM_TAG_SMELLINGSALT_EFFECT, ANIM_TAG_SMELLINGSALT_EFFECT, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815E954 -gUnknown_085CE8AC:: - spr_template ANIM_TAG_TAG_HAND, ANIM_TAG_TAG_HAND, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815EA14 -gUnknown_085CE8C4:: - spr_template ANIM_TAG_MAGNIFYING_GLASS, ANIM_TAG_MAGNIFYING_GLASS, gUnknown_08524A34, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815EE84 -gUnknown_085CE8DC:: - spr_template ANIM_TAG_GOLD_STARS, ANIM_TAG_GOLD_STARS, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815F18C -gUnknown_085CE8F4:: - spr_template ANIM_TAG_GOLD_STARS, ANIM_TAG_GOLD_STARS, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_81061C4 -gUnknown_085CE90C:: - spr_template ANIM_TAG_X_SIGN, ANIM_TAG_X_SIGN, gUnknown_0852491C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815F48C -gUnknown_085CE924:: - spr_template ANIM_TAG_ITEM_BAG, ANIM_TAG_ITEM_BAG, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815FE80 - - .align 2 -gUnknown_085CE93C:: @ 85CE93C - .2byte 0x0000, 0x0004, 0x0040, 0x0004, 0xffff, 0x0000 - - .align 2 -gUnknown_085CE948:: @ 85CE948 - .4byte gUnknown_085CE93C - - .align 2 -gUnknown_085CE94C:: @ 85CE94C - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x08fc, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE964:: @ 85CE964 - .2byte 0xff00, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0804, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE97C:: @ 85CE97C - .4byte gUnknown_085CE94C - .4byte gUnknown_085CE964 - - .align 2 -gUnknown_085CE984:: @ 85CE984 - spr_template ANIM_TAG_SLAM_HIT_2, ANIM_TAG_SLAM_HIT_2, gUnknown_0852497C, gUnknown_085CE948, NULL, gUnknown_085CE97C, sub_8160338 - - .align 2 -gUnknown_085CE99C:: @ 85CE99C - .2byte 0x0000, 0x0000, 0x40fc, 0x0000, 0x7ffe, 0x0000, 0x0000, 0x0000 - - .align 2 -gUnknown_085CE9AC:: @ 85CE9AC - .4byte gUnknown_085CE99C - - .align 2 -gUnknown_085CE9B0:: @ 85CE9B0 - spr_template ANIM_TAG_RECYCLE, ANIM_TAG_RECYCLE, gUnknown_08524A9C, gDummySpriteAnimTable, NULL, gUnknown_085CE9AC, sub_81603A8 - - .align 2 -gUnknown_085CE9C8:: @ 85CE9C8 - .2byte 0x0000, 0x0010, 0x0400, 0x0000, 0xfffe, 0x0000, 0x0800, 0x0000, 0x0000, 0x0004, 0x0400, 0x0000, 0x0000, 0x0000, 0x1800, 0x0000 - .2byte 0x0001, 0xfffb, 0x1000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - diff --git a/graphics/unknown/unknown_85CE55C.pal b/graphics/unknown/unknown_85CE55C.pal new file mode 100755 index 000000000..1d83a2018 --- /dev/null +++ b/graphics/unknown/unknown_85CE55C.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +98 0 49 +131 131 41 +156 197 32 +172 0 32 +189 0 24 +180 197 8 +156 0 8 +131 65 0 +90 0 0 +49 65 0 +32 0 8 +8 197 8 +0 0 24 +16 65 32 +32 197 32 +65 131 41 diff --git a/ld_script.txt b/ld_script.txt index 4fcd17bce..4b56d0f4b 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -224,6 +224,7 @@ SECTIONS { src/battle_anim_sound_tasks.o(.text); src/battle_controller_safari.o(.text); src/fldeff_sweetscent.o(.text); + src/battle_anim_815A0D4.o(.text); asm/battle_anim_815A0D4.o(.text); src/learn_move.o(.text); src/fldeff_softboiled.o(.text); @@ -538,7 +539,7 @@ SECTIONS { data/field_effect_helpers.o(.rodata); src/contest_ai.o(.rodata); src/battle_controller_safari.o(.rodata); - data/battle_anim_815A0D4.o(.rodata); + src/battle_anim_815A0D4.o(.rodata); src/learn_move.o(.rodata); src/roamer.o(.rodata); src/battle_tower.o(.rodata); diff --git a/src/battle_anim_815A0D4.c b/src/battle_anim_815A0D4.c new file mode 100755 index 000000000..46de0d09d --- /dev/null +++ b/src/battle_anim_815A0D4.c @@ -0,0 +1,1092 @@ +#include "global.h" +#include "battle.h" +#include "battle_anim.h" +#include "bg.h" +#include "contest.h" +#include "data2.h" +#include "decompress.h" +#include "dma3.h" +#include "gpu_regs.h" +#include "alloc.h" +#include "palette.h" +#include "pokemon_icon.h" +#include "sprite.h" +#include "task.h" +#include "trig.h" +#include "util.h" +#include "constants/battle_anim.h" +#include "constants/species.h" + +void sub_815A0D4(struct Sprite *); +void sub_815A1B0(struct Sprite *); +void sub_815A254(struct Sprite *); +void sub_815A2F0(struct Sprite *); +void sub_815A6C4(struct Sprite *); +void sub_815A7B0(struct Sprite *); +void sub_815A7EC(struct Sprite *); +void sub_815A8AC(struct Sprite *); +void sub_815A934(struct Sprite *); +void sub_815AAA4(struct Sprite *); +void sub_815ABD0(struct Sprite *); +void sub_815ACD0(struct Sprite *); +void sub_815B27C(struct Sprite *); +void sub_815B394(struct Sprite *); +void sub_815B49C(struct Sprite *); +void sub_815B570(struct Sprite *); +void sub_815B70C(struct Sprite *); +void sub_815BE04(struct Sprite *); +void sub_815C400(struct Sprite *); +void sub_815C6B0(struct Sprite *); +void sub_815C95C(struct Sprite *); +void sub_815CB88(struct Sprite *); +void sub_815CC94(struct Sprite *); +void sub_815CDB4(struct Sprite *); +void sub_815D7B4(struct Sprite *); +void sub_815D870(struct Sprite *); +void sub_815DEBC(struct Sprite *); +void sub_815E01C(struct Sprite *); +void sub_815E404(struct Sprite *); +void sub_815E444(struct Sprite *); +void sub_815E6D8(struct Sprite *); +void sub_815E954(struct Sprite *); +void sub_815EA14(struct Sprite *); +void sub_815EE84(struct Sprite *); +void sub_815F18C(struct Sprite *); +void sub_815F48C(struct Sprite *); +void sub_815FE80(struct Sprite *); +void sub_81061C4(struct Sprite *); +void sub_8160338(struct Sprite *); +void sub_81603A8(struct Sprite *); + +const union AnimCmd gUnknown_085CE004[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(16, 4), + ANIMCMD_FRAME(32, 4), + ANIMCMD_FRAME(48, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE01C[] = +{ + gUnknown_085CE004, +}; + +const struct SpriteTemplate gUnknown_085CE020 = +{ + .tileTag = ANIM_TAG_SCRATCH, + .paletteTag = ANIM_TAG_SCRATCH, + .oam = &gUnknown_08524A34, + .anims = gUnknown_085CE01C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const struct SpriteTemplate gUnknown_085CE038 = +{ + .tileTag = ANIM_TAG_BLACK_SMOKE, + .paletteTag = ANIM_TAG_BLACK_SMOKE, + .oam = &gUnknown_08524934, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A0D4, +}; + +const struct SpriteTemplate gUnknown_085CE050 = +{ + .tileTag = ANIM_TAG_BLACK_BALL, + .paletteTag = ANIM_TAG_BLACK_BALL, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A78AC, +}; + +const union AnimCmd gUnknown_085CE068[] = +{ + ANIMCMD_FRAME(0, 40), + ANIMCMD_FRAME(16, 8), + ANIMCMD_FRAME(32, 40), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE078[] = +{ + gUnknown_085CE068, +}; + +const struct SpriteTemplate gUnknown_085CE07C = +{ + .tileTag = ANIM_TAG_OPENING_EYE, + .paletteTag = ANIM_TAG_OPENING_EYE, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE078, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const struct SpriteTemplate gUnknown_085CE094 = +{ + .tileTag = ANIM_TAG_ROUND_WHITE_HALO, + .paletteTag = ANIM_TAG_ROUND_WHITE_HALO, + .oam = &gUnknown_08524A3C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A1B0, +}; + +const struct SpriteTemplate gUnknown_085CE0AC = +{ + .tileTag = ANIM_TAG_TEAL_ALERT, + .paletteTag = ANIM_TAG_TEAL_ALERT, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A254, +}; + +const union AffineAnimCmd gUnknown_085CE0C4[] = +{ + AFFINEANIMCMD_FRAME(0x180, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(-0x20, 0x18, 0, 5), + AFFINEANIMCMD_FRAME(0x18, -0x20, 0, 5), + AFFINEANIMCMD_JUMP(1), +}; + +const union AffineAnimCmd gUnknown_085CE0E4[] = +{ + AFFINEANIMCMD_FRAME(0x30, 0x30, 0, 0), + AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 6), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE0FC[] = +{ + gUnknown_085CE0C4, + gUnknown_085CE0E4, +}; + +const struct SpriteTemplate gUnknown_085CE104 = +{ + .tileTag = ANIM_TAG_EYE, + .paletteTag = ANIM_TAG_EYE, + .oam = &gUnknown_08524AFC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE0FC, + .callback = sub_815A2F0, +}; + +const struct SpriteTemplate gUnknown_085CE11C = +{ + .tileTag = ANIM_TAG_SPIKES, + .paletteTag = ANIM_TAG_SPIKES, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A6C4, +}; + +const union AnimCmd gUnknown_085CE134[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_FRAME(64, 3), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE14C[] = +{ + gUnknown_085CE134, +}; + +const struct SpriteTemplate gUnknown_085CE150 = +{ + .tileTag = ANIM_TAG_LEER, + .paletteTag = ANIM_TAG_LEER, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE14C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A7B0, +}; + +const union AnimCmd gUnknown_085CE168[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE170[] = +{ + gUnknown_085CE168, +}; + +const union AffineAnimCmd gUnknown_085CE174[] = +{ + AFFINEANIMCMD_FRAME(-7, -7, -3, 16), + AFFINEANIMCMD_FRAME(7, 7, 3, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE18C[] = +{ + gUnknown_085CE174, +}; + +const struct SpriteTemplate gUnknown_085CE190 = +{ + .tileTag = ANIM_TAG_LETTER_Z, + .paletteTag = ANIM_TAG_LETTER_Z, + .oam = &gUnknown_08524974, + .anims = gUnknown_085CE170, + .images = NULL, + .affineAnims = gUnknown_085CE18C, + .callback = sub_815A7EC, +}; + +const union AnimCmd gUnknown_085CE1A8[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(16, 16), + ANIMCMD_FRAME(32, 4), + ANIMCMD_FRAME(48, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE1BC[] = +{ + gUnknown_085CE1A8, +}; + +const union AffineAnimCmd gUnknown_085CE1C0[] = +{ + AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), + AFFINEANIMCMD_FRAME(-0x20, -0x20, 0, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE1D8[] = +{ + gUnknown_085CE1C0, +}; + +const struct SpriteTemplate gUnknown_085CE1DC = +{ + .tileTag = ANIM_TAG_FANG_ATTACK, + .paletteTag = ANIM_TAG_FANG_ATTACK, + .oam = &gUnknown_085249D4, + .anims = gUnknown_085CE1BC, + .images = NULL, + .affineAnims = gUnknown_085CE1D8, + .callback = sub_815A8AC, +}; + +const union AffineAnimCmd gUnknown_085CE1F4[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(0x10, 0x0, 0, 20), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE20C[] = +{ + AFFINEANIMCMD_FRAME(0x140, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(-0x10, 0x0, 0, 19), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE224[] = +{ + gUnknown_085CE1F4, + gUnknown_085CE20C, +}; + +const struct SpriteTemplate gUnknown_085CE22C = +{ + .tileTag = ANIM_TAG_SPOTLIGHT, + .paletteTag = ANIM_TAG_SPOTLIGHT, + .oam = &gUnknown_085249DC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE224, + .callback = sub_815A934, +}; + +const struct SpriteTemplate gUnknown_085CE244 = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815AAA4, +}; + +const struct SpriteTemplate gUnknown_085CE25C = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815ABD0, +}; + +const union AnimCmd gUnknown_085CE274[] = +{ + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(8, 2), + ANIMCMD_FRAME(16, 2), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd *const gUnknown_085CE284[] = +{ + gUnknown_085CE274, +}; + +const struct SpriteTemplate gUnknown_085CE288 = +{ + .tileTag = ANIM_TAG_RAPID_SPIN, + .paletteTag = ANIM_TAG_RAPID_SPIN, + .oam = &gUnknown_08524934, + .anims = gUnknown_085CE284, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815ACD0, +}; + +const union AffineAnimCmd gUnknown_085CE2A0[] = +{ + AFFINEANIMCMD_FRAME(-12, 8, 0, 4), + AFFINEANIMCMD_FRAME(20, -20, 0, 4), + AFFINEANIMCMD_FRAME(-8, 12, 0, 4), + AFFINEANIMCMD_END, +}; + +const union AnimCmd gUnknown_085CE2C0[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE2C8[] = +{ + gUnknown_085CE2C0, +}; + +const union AffineAnimCmd gUnknown_085CE2CC[] = +{ + AFFINEANIMCMD_FRAME(0, 0, 5, 40), + AFFINEANIMCMD_FRAME(0, 0, 10, 10), + AFFINEANIMCMD_FRAME(0, 0, 15, 10), + AFFINEANIMCMD_FRAME(0, 0, 20, 40), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE2F4[] = +{ + gUnknown_085CE2CC, +}; + +const struct SpriteTemplate gUnknown_085CE2F8 = +{ + .tileTag = ANIM_TAG_TRI_FORCE_TRIANGLE, + .paletteTag = ANIM_TAG_TRI_FORCE_TRIANGLE, + .oam = &gUnknown_085249DC, + .anims = gUnknown_085CE2C8, + .images = NULL, + .affineAnims = gUnknown_085CE2F4, + .callback = sub_815B27C, +}; + +const union AnimCmd gUnknown_085CE310[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_FRAME(32, 3, .hFlip = TRUE), + ANIMCMD_FRAME(16, 3, .hFlip = TRUE), + ANIMCMD_FRAME(0, 3, .hFlip = TRUE), + ANIMCMD_LOOP(1), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE334[] = +{ + gUnknown_085CE310, +}; + +const struct SpriteTemplate gUnknown_085CE338 = +{ + .tileTag = ANIM_TAG_ECLIPSING_ORB, + .paletteTag = ANIM_TAG_ECLIPSING_ORB, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE334, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const union AffineAnimCmd gUnknown_085CE350[] = +{ + AFFINEANIMCMD_FRAME(-12, 20, 0, 8), + AFFINEANIMCMD_FRAME(12, -20, 0, 8), + AFFINEANIMCMD_LOOP(2), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE370 = +{ + .tileTag = ANIM_TAG_POKEBALL, + .paletteTag = ANIM_TAG_POKEBALL, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B394, +}; + +const struct SpriteTemplate gUnknown_085CE388 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B49C, +}; + +const struct SpriteTemplate gUnknown_085CE3A0 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B570, +}; + +const union AffineAnimCmd gUnknown_085CE3B8[] = +{ + AFFINEANIMCMD_FRAME(8, -8, 0, 12), + AFFINEANIMCMD_FRAME(-16, 16, 0, 12), + AFFINEANIMCMD_FRAME(8, -8, 0, 12), + AFFINEANIMCMD_LOOP(1), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE3E0[] = +{ + AFFINEANIMCMD_FRAME(0, 6, 0, 20), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(0, -18, 0, 6), + AFFINEANIMCMD_FRAME(-18, -18, 0, 3), + AFFINEANIMCMD_FRAME(0, 0, 0, 15), + AFFINEANIMCMD_FRAME(4, 4, 0, 13), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE418 = +{ + .tileTag = ANIM_TAG_BLUE_ORB, + .paletteTag = ANIM_TAG_BLUE_ORB, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B70C, +}; + +const union AffineAnimCmd gUnknown_085CE430[] = +{ + AFFINEANIMCMD_FRAME(0, 6, 0, 20), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(7, -30, 0, 6), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(-2, 3, 0, 20), + AFFINEANIMCMD_END, +}; + +const s8 gUnknown_085CE460[] = +{ + 0xE8, + 0x18, + 0xFC, + 0x00, +}; + +const union AnimCmd gUnknown_085CE464[] = +{ + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(4, 6), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE470[] = +{ + ANIMCMD_FRAME(8, 6), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_085CE478[] = +{ + ANIMCMD_FRAME(12, 6), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE480[] = +{ + gUnknown_085CE464, + gUnknown_085CE470, + gUnknown_085CE478, +}; + +const struct SpriteTemplate gUnknown_085CE48C = +{ + .tileTag = ANIM_TAG_GREEN_STAR, + .paletteTag = ANIM_TAG_GREEN_STAR, + .oam = &gUnknown_0852490C, + .anims = gUnknown_085CE480, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815BE04, +}; + +const s8 gUnknown_085CE4A4[] = +{ + 0x78, + 0x50, + 0x28, + 0x00, +}; + +const u8 gUnknown_085CE4A8[] = +{ + 0, + 0, + 0, + 0, + 50, +}; + +const union AffineAnimCmd gUnknown_085CE4B0[] = +{ + AFFINEANIMCMD_FRAME(0, -15, 0, 7), + AFFINEANIMCMD_FRAME(0, 15, 0, 7), + AFFINEANIMCMD_LOOP(2), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE4D0 = +{ + .tileTag = ANIM_TAG_ANGER, + .paletteTag = ANIM_TAG_ANGER, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C400, +}; + +const union AnimCmd gUnknown_085CE4E8[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(1, 8), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(3, 8), + ANIMCMD_FRAME(3, 8, .vFlip = TRUE), + ANIMCMD_FRAME(2, 8, .vFlip = TRUE), + ANIMCMD_FRAME(0, 8, .vFlip = TRUE), + ANIMCMD_FRAME(1, 8, .vFlip = TRUE), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE50C[] = +{ + ANIMCMD_FRAME(0, 8, .hFlip = TRUE), + ANIMCMD_FRAME(1, 8, .hFlip = TRUE), + ANIMCMD_FRAME(2, 8, .hFlip = TRUE), + ANIMCMD_FRAME(3, 8, .hFlip = TRUE), + ANIMCMD_FRAME(3, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(2, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(0, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(1, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE530[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE538[] = +{ + gUnknown_085CE4E8, + gUnknown_085CE50C, + gUnknown_085CE530, +}; + +const struct SpriteTemplate gUnknown_085CE544 = +{ + .tileTag = ANIM_TAG_PINK_PETAL, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gUnknown_08524904, + .anims = gUnknown_085CE538, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C6B0, +}; + +const u16 gUnknown_085CE55C[] = INCBIN_U16("graphics/unknown/unknown_85CE55C.gbapal"); + +const union AnimCmd gUnknown_085CE57C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(4, 9), + ANIMCMD_FRAME(8, 5), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE58C[] = +{ + gUnknown_085CE57C, +}; + +const struct SpriteTemplate gUnknown_085CE590 = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_PAIN_SPLIT, + .oam = &gUnknown_0852490C, + .anims = gUnknown_085CE58C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C95C, +}; + +const struct SpriteTemplate gUnknown_085CE5A8 = +{ + .tileTag = ANIM_TAG_CONFETTI, + .paletteTag = ANIM_TAG_CONFETTI, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815CB88, +}; + +const struct SpriteTemplate gUnknown_085CE5C0 = +{ + .tileTag = ANIM_TAG_SPOTLIGHT, + .paletteTag = ANIM_TAG_SPOTLIGHT, + .oam = &gUnknown_085249DC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE224, + .callback = sub_815CC94, +}; + +const struct SpriteTemplate gBattleAnimSpriteTemplate_85CE5D8 = +{ + .tileTag = ANIM_TAG_BLUE_ORB, + .paletteTag = ANIM_TAG_BLUE_ORB, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815CDB4, +}; + +const union AffineAnimCmd gUnknown_085CE5F0[] = +{ + AFFINEANIMCMD_FRAME(16, 0, 0, 4), + AFFINEANIMCMD_FRAME(0, -3, 0, 16), + AFFINEANIMCMD_FRAME(4, 0, 0, 4), + AFFINEANIMCMD_FRAME(0, 0, 0, 24), + AFFINEANIMCMD_FRAME(-5, 3, 0, 16), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE620[] = +{ + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE640[] = +{ + AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE660[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE680[] = +{ + gUnknown_085CE620, + gUnknown_085CE640, + gUnknown_085CE660, +}; + +const struct SpriteTemplate gUnknown_085CE68C = +{ + .tileTag = ANIM_TAG_PINK_CLOUD, + .paletteTag = ANIM_TAG_PINK_CLOUD, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE680, + .callback = sub_815D7B4, +}; + +const union AffineAnimCmd gUnknown_085CE6A4[] = +{ + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE6C4[] = +{ + AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE6E4[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE704[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(8, 10, 0, 30), + AFFINEANIMCMD_FRAME(-8, -10, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE724[] = +{ + gUnknown_085CE6A4, + gUnknown_085CE6C4, + gUnknown_085CE6E4, + gUnknown_085CE704, +}; + +const struct SpriteTemplate gUnknown_085CE734 = +{ + .tileTag = ANIM_TAG_PINK_CLOUD, + .paletteTag = ANIM_TAG_PINK_CLOUD, + .oam = &gUnknown_085249D4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE724, + .callback = sub_815D870, +}; + +const union AffineAnimCmd gUnknown_085CE74C[] = +{ + AFFINEANIMCMD_FRAME(-16, 16, 0, 6), + AFFINEANIMCMD_FRAME(16, -16, 0, 12), + AFFINEANIMCMD_FRAME(-16, 16, 0, 6), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE76C = +{ + .tileTag = ANIM_TAG_SWEAT_DROP, + .paletteTag = ANIM_TAG_SWEAT_DROP, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815DEBC, +}; + +const u16 gUnknown_085CE784[] = INCBIN_U16("graphics/battle_anims/sprites/effect.gbapal"); + +const union AnimCmd gUnknown_085CE7B4[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE7C0[] = +{ + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd *const gUnknown_085CE7CC[] = +{ + gUnknown_085CE7B4, + gUnknown_085CE7C0, +}; + +const struct SpriteTemplate gUnknown_085CE7D4 = +{ + .tileTag = ANIM_TAG_NOISE_LINE, + .paletteTag = ANIM_TAG_NOISE_LINE, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE7CC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E01C, +}; + +const struct SpriteTemplate gUnknown_085CE7EC = +{ + .tileTag = ANIM_TAG_SMALL_RED_EYE, + .paletteTag = ANIM_TAG_SMALL_RED_EYE, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E404, +}; + +const struct SpriteTemplate gUnknown_085CE804 = +{ + .tileTag = ANIM_TAG_PAW_PRINT, + .paletteTag = ANIM_TAG_PAW_PRINT, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E444, +}; + +const union AffineAnimCmd gUnknown_085CE81C[] = +{ + AFFINEANIMCMD_FRAME(0, 0, -4, 24), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE82C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, -64, 0), + AFFINEANIMCMD_FRAME(0, 0, 4, 24), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE844[] = +{ + gUnknown_085CE81C, + gUnknown_085CE82C, +}; + +const struct SpriteTemplate gUnknown_085CE84C = +{ + .tileTag = ANIM_TAG_RED_BALL, + .paletteTag = ANIM_TAG_RED_BALL, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE844, + .callback = SpriteCallbackDummy, +}; + +const struct SpriteTemplate gUnknown_085CE864 = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E6D8, +}; + +const union AffineAnimCmd gUnknown_085CE87C[] = +{ + AFFINEANIMCMD_FRAME(0, -16, 0, 6), + AFFINEANIMCMD_FRAME(0, 16, 0, 6), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE894 = +{ + .tileTag = ANIM_TAG_SMELLINGSALT_EFFECT, + .paletteTag = ANIM_TAG_SMELLINGSALT_EFFECT, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E954, +}; + +const struct SpriteTemplate gUnknown_085CE8AC = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815EA14, +}; + +const struct SpriteTemplate gUnknown_085CE8C4 = +{ + .tileTag = ANIM_TAG_MAGNIFYING_GLASS, + .paletteTag = ANIM_TAG_MAGNIFYING_GLASS, + .oam = &gUnknown_08524A34, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815EE84, +}; + +const struct SpriteTemplate gUnknown_085CE8DC = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815F18C, +}; + +const struct SpriteTemplate gUnknown_085CE8F4 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81061C4, +}; + +const struct SpriteTemplate gUnknown_085CE90C = +{ + .tileTag = ANIM_TAG_X_SIGN, + .paletteTag = ANIM_TAG_X_SIGN, + .oam = &gUnknown_0852491C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815F48C, +}; + +const struct SpriteTemplate gUnknown_085CE924 = +{ + .tileTag = ANIM_TAG_ITEM_BAG, + .paletteTag = ANIM_TAG_ITEM_BAG, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815FE80, +}; + +const union AnimCmd gUnknown_085CE93C[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE948[] = +{ + gUnknown_085CE93C, +}; + +const union AffineAnimCmd gUnknown_085CE94C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, -4, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE964[] = +{ + AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, 4, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE97C[] = +{ + gUnknown_085CE94C, + gUnknown_085CE964, +}; + +const struct SpriteTemplate gUnknown_085CE984 = +{ + .tileTag = ANIM_TAG_SLAM_HIT_2, + .paletteTag = ANIM_TAG_SLAM_HIT_2, + .oam = &gUnknown_0852497C, + .anims = gUnknown_085CE948, + .images = NULL, + .affineAnims = gUnknown_085CE97C, + .callback = sub_8160338, +}; + +const union AffineAnimCmd gUnknown_085CE99C[] = +{ + AFFINEANIMCMD_FRAME(0, 0, -4, 64), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE9AC[] = +{ + gUnknown_085CE99C, +}; + +const struct SpriteTemplate gUnknown_085CE9B0 = +{ + .tileTag = ANIM_TAG_RECYCLE, + .paletteTag = ANIM_TAG_RECYCLE, + .oam = &gUnknown_08524A9C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE9AC, + .callback = sub_81603A8, +}; + +const union AffineAnimCmd gUnknown_085CE9C8[] = +{ + AFFINEANIMCMD_FRAME(0, 16, 0, 4), + AFFINEANIMCMD_FRAME(-2, 0, 0, 8), + AFFINEANIMCMD_FRAME(0, 4, 0, 4), + AFFINEANIMCMD_FRAME(0, 0, 0, 24), + AFFINEANIMCMD_FRAME(1, -5, 0, 16), + AFFINEANIMCMD_END, +}; From b2ac3b6d6f06ed4a2d64af90e97796c66bcdeb5f Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Tue, 18 Dec 2018 19:03:26 -0600 Subject: [PATCH 8/8] Decompile most of battle_anim_effects_3.c --- asm/battle_anim_815A0D4.s | 12488 ---------------------------------- asm/battle_anim_effects_3.s | 1632 +++++ include/battle_anim.h | 6 + include/graphics.h | 13 +- include/scanline_effect.h | 1 + ld_script.txt | 6 +- src/battle_anim_80A5C6C.c | 2 +- src/battle_anim_815A0D4.c | 1092 --- src/battle_anim_effects_3.c | 4889 +++++++++++++ src/graphics.c | 6 +- 10 files changed, 6543 insertions(+), 13592 deletions(-) delete mode 100644 asm/battle_anim_815A0D4.s create mode 100644 asm/battle_anim_effects_3.s delete mode 100755 src/battle_anim_815A0D4.c create mode 100755 src/battle_anim_effects_3.c diff --git a/asm/battle_anim_815A0D4.s b/asm/battle_anim_815A0D4.s deleted file mode 100644 index 84f7a7883..000000000 --- a/asm/battle_anim_815A0D4.s +++ /dev/null @@ -1,12488 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_815A0D4 -sub_815A0D4: @ 815A0D4 - push {lr} - adds r2, r0, 0 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r3, [r2, 0x20] - adds r0, r3 - strh r0, [r2, 0x20] - ldrh r0, [r1, 0x2] - ldrh r3, [r2, 0x22] - adds r0, r3 - strh r0, [r2, 0x22] - movs r3, 0x6 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0815A0FC - ldrh r0, [r1, 0x4] - b _0815A100 - .pool -_0815A0FC: - ldrh r0, [r1, 0x4] - negs r0, r0 -_0815A100: - strh r0, [r2, 0x2E] - ldrh r0, [r1, 0x8] - strh r0, [r2, 0x30] - ldr r0, =sub_815A114 - str r0, [r2, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A0D4 - - thumb_func_start sub_815A114 -sub_815A114: @ 815A114 - push {lr} - adds r3, r0, 0 - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - ble _0815A154 - ldrh r1, [r3, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r3, 0x24] - ldrh r0, [r3, 0x2E] - adds r1, r0 - strh r1, [r3, 0x32] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - b _0815A15A -_0815A154: - adds r0, r3, 0 - bl DestroyAnimSprite -_0815A15A: - pop {r0} - bx r0 - thumb_func_end sub_815A114 - - thumb_func_start sub_815A160 -sub_815A160: @ 815A160 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =gBattleAnimTarget - ldrb r0, [r6] - movs r1, 0x2 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 8 - movs r0, 0x80 - lsls r0, 12 - adds r4, r0 - asrs r4, 16 - ldrb r0, [r6] - movs r1, 0x3 - bl GetBattlerSpriteCoord - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 8 - movs r0, 0x80 - lsls r0, 12 - adds r1, r0 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_807521C - adds r0, r5, 0 - bl DestroyAnimVisualTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A160 - - thumb_func_start sub_815A1B0 -sub_815A1B0: @ 815A1B0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5A - strh r0, [r4, 0x2E] - ldr r0, =WaitAnimForDuration - str r0, [r4, 0x1C] - movs r0, 0x7 - strh r0, [r4, 0x30] - ldr r1, =sub_815A1F4 - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r0, [r4, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A1B0 - - thumb_func_start sub_815A1F4 -sub_815A1F4: @ 815A1F4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0815A228 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A234 - str r0, [r4, 0x1C] -_0815A228: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A1F4 - - thumb_func_start sub_815A234 -sub_815A234: @ 815A234 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815A234 - - thumb_func_start sub_815A254 -sub_815A254: @ 815A254 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A6980 - ldrh r0, [r5, 0x20] - subs r0, r7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r5, 0x22] - subs r1, r6 - lsls r1, 16 - asrs r1, 16 - bl ArcTan2Neg - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 23 - adds r0, r1 - lsrs r4, r0, 16 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815A2B2 - movs r1, 0x80 - lsls r1, 7 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0815A2B2: - movs r3, 0x80 - lsls r3, 1 - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - adds r2, r3, 0 - bl TrySetSpriteRotScale - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - strh r7, [r5, 0x32] - strh r6, [r5, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r5, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A254 - - thumb_func_start sub_815A2F0 -sub_815A2F0: @ 815A2F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x4 - strh r0, [r4, 0x2E] - ldr r0, =sub_815A31C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A2F0 - - thumb_func_start sub_815A31C -sub_815A31C: @ 815A31C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815A342 - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - b _0815A346 -_0815A342: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 -_0815A346: - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - beq _0815A354 - cmp r0, 0x4 - bne _0815A35C -_0815A354: - ldrh r0, [r4, 0x30] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x30] -_0815A35C: - ldrh r0, [r4, 0x32] - adds r1, r0, 0x1 - strh r1, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x46 - ble _0815A3A0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r0, 0 - strh r0, [r4, 0x32] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A3AC - str r0, [r4, 0x1C] -_0815A3A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A31C - - thumb_func_start sub_815A3AC -sub_815A3AC: @ 815A3AC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x32] - adds r1, r0, 0x1 - strh r1, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _0815A3E8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r3, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815A3E8 - ldr r0, =sub_815A3F0 - str r0, [r3, 0x1C] -_0815A3E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A3AC - - thumb_func_start sub_815A3F0 -sub_815A3F0: @ 815A3F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bhi _0815A448 - lsls r0, 2 - ldr r1, =_0815A40C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815A40C: - .4byte _0815A428 - .4byte _0815A428 - .4byte _0815A432 - .4byte _0815A432 - .4byte _0815A440 - .4byte _0815A440 - .4byte _0815A448 -_0815A428: - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x24] - strh r1, [r4, 0x26] - b _0815A450 -_0815A432: - ldr r0, =0x0000ffff - strh r0, [r4, 0x24] - movs r0, 0 - b _0815A44E - .pool -_0815A440: - movs r0, 0 - strh r0, [r4, 0x24] - movs r0, 0x1 - b _0815A44E -_0815A448: - movs r0, 0 - strh r0, [r4, 0x24] - ldr r0, =0x0000ffff -_0815A44E: - strh r0, [r4, 0x26] -_0815A450: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0815A462 - strh r2, [r4, 0x34] -_0815A462: - ldrh r0, [r4, 0x36] - adds r1, r0, 0x1 - strh r1, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0815A48C - movs r0, 0x10 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x30] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x2E] - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_815A49C - str r0, [r4, 0x1C] -_0815A48C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A3F0 - - thumb_func_start sub_815A49C -sub_815A49C: @ 815A49C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815A4CC - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] -_0815A4CC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815A4E0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815A4E0: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0815A4FE - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite -_0815A4FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815A49C - - thumb_func_start sub_815A504 -sub_815A504: @ 815A504 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_815A52C - str r0, [r1] - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_815A504 - - thumb_func_start sub_815A52C -sub_815A52C: @ 815A52C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A6D94 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gTasks - lsls r5, r4, 2 - adds r1, r5, r4 - lsls r1, 3 - adds r1, r7 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815A59C - ldr r0, =gPlttBufferFaded - lsls r2, r6, 4 - adds r1, r2, 0 - adds r1, 0xB - lsls r1, 1 - adds r1, r0 - ldrh r3, [r1] - mov r8, r3 - movs r3, 0xA - mov r9, r7 - adds r7, r5, 0 - mov r12, r0 - adds r5, r2, 0 - lsls r0, r6, 5 - add r0, r12 - adds r2, r0, 0 - adds r2, 0x14 -_0815A57A: - ldrh r0, [r2] - strh r0, [r1] - subs r2, 0x2 - subs r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bgt _0815A57A - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r12 - movs r1, 0 - mov r2, r8 - strh r2, [r0] - adds r0, r7, r4 - lsls r0, 3 - add r0, r9 - strh r1, [r0, 0x12] -_0815A59C: - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0815A5AC - adds r0, r4, 0 - bl DestroyTask -_0815A5AC: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A52C - - thumb_func_start sub_815A5C8 -sub_815A5C8: @ 815A5C8 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_815A5F0 - str r0, [r1] - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_815A5C8 - - thumb_func_start sub_815A5F0 -sub_815A5F0: @ 815A5F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_80A6D94 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gTasks - mov r0, r8 - lsls r3, r0, 2 - adds r1, r3, r0 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815A692 - ldr r0, =gPlttBufferFaded - lsls r2, r7, 4 - adds r1, r2, 0 - adds r1, 0xB - lsls r1, 1 - adds r1, r0 - ldrh r6, [r1] - movs r4, 0xA - mov r10, r3 - mov r9, r0 - adds r5, r2, 0 - ldr r2, =gPlttBufferUnfaded - mov r12, r2 - lsls r0, r7, 5 - add r0, r9 - adds r3, r0, 0 - adds r3, 0x14 -_0815A644: - ldrh r0, [r3] - strh r0, [r1] - subs r3, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0815A644 - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r9 - strh r6, [r0] - adds r1, r5, 0 - adds r1, 0xB - lsls r1, 1 - add r1, r12 - ldrh r6, [r1] - movs r4, 0xA - lsls r0, r7, 5 - add r0, r12 - adds r2, r0, 0 - adds r2, 0x14 -_0815A66E: - ldrh r0, [r2] - strh r0, [r1] - subs r2, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0815A66E - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r12 - movs r1, 0 - strh r6, [r0] - mov r0, r10 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - strh r1, [r0, 0x12] -_0815A692: - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0815A6A2 - mov r0, r8 - bl DestroyTask -_0815A6A2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A5F0 - - thumb_func_start sub_815A6C4 -sub_815A6C4: @ 815A6C4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x1 - bl InitAnimSpritePos - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - mov r5, sp - adds r5, 0x2 - movs r1, 0 - mov r2, sp - adds r3, r5, 0 - bl SetAverageBattlerPositions - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815A6F8 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_0815A6F8: - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - mov r2, sp - ldrh r0, [r1, 0x4] - ldrh r2, [r2] - adds r0, r2 - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - ldrh r5, [r5] - adds r0, r5 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffce - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl InitAnimArcTranslation - ldr r0, =sub_815A73C - str r0, [r4, 0x1C] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A6C4 - - thumb_func_start sub_815A73C -sub_815A73C: @ 815A73C - push {r4,lr} - adds r4, r0, 0 - bl TranslateAnimArc - lsls r0, 24 - cmp r0, 0 - beq _0815A75E - movs r1, 0 - movs r0, 0x1E - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - ldr r0, =WaitAnimForDuration - str r0, [r4, 0x1C] - ldr r1, =sub_815A76C - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 -_0815A75E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A73C - - thumb_func_start sub_815A76C -sub_815A76C: @ 815A76C - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815A798 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] -_0815A798: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - bne _0815A7AC - adds r0, r3, 0 - bl DestroyAnimSprite -_0815A7AC: - pop {r0} - bx r0 - thumb_func_end sub_815A76C - - thumb_func_start sub_815A7B0 -sub_815A7B0: @ 815A7B0 - push {r4,r5,lr} - adds r4, r0, 0 - bl SetSpriteCoordsToAnimAttackerCoords - ldr r5, =gBattleAnimArgs - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =RunStoredCallbackWhenAnimEnds - str r0, [r4, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A7B0 - - thumb_func_start sub_815A7EC -sub_815A7EC: @ 815A7EC - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815A84C - adds r0, r4, 0 - bl SetSpriteCoordsToAnimAttackerCoords - ldr r5, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r5, r2] - adds r0, r4, 0 - bl sub_80A6864 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815A840 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815A830 - ldrh r0, [r5, 0x4] - b _0815A846 - .pool -_0815A830: - movs r1, 0x4 - ldrsh r0, [r5, r1] - negs r0, r0 - strh r0, [r4, 0x30] - movs r2, 0x6 - ldrsh r0, [r5, r2] - negs r0, r0 - b _0815A84A -_0815A840: - movs r1, 0x4 - ldrsh r0, [r5, r1] - negs r0, r0 -_0815A846: - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x6] -_0815A84A: - strh r0, [r4, 0x32] -_0815A84C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - movs r3, 0xFF - ldrh r1, [r4, 0x30] - ldrh r2, [r4, 0x34] - adds r1, r2 - strh r1, [r4, 0x34] - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r1, r2 - strh r1, [r4, 0x36] - movs r2, 0x34 - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - strh r1, [r4, 0x24] - ands r0, r3 - movs r1, 0x5 - bl Sin - movs r2, 0x36 - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF0 - bls _0815A8A4 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815A8A4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815A7EC - - thumb_func_start sub_815A8AC -sub_815A8AC: @ 815A8AC - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815A8C2 - adds r0, r2, 0 - bl DestroyAnimSprite -_0815A8C2: - pop {r0} - bx r0 - thumb_func_end sub_815A8AC - - thumb_func_start AnimTask_IsTargetPlayerSide -AnimTask_IsTargetPlayerSide: @ 815A8C8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815A8EC - ldr r1, =gBattleAnimArgs - movs r0, 0 - b _0815A8F0 - .pool -_0815A8EC: - ldr r1, =gBattleAnimArgs - movs r0, 0x1 -_0815A8F0: - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_IsTargetPlayerSide - - thumb_func_start AnimTask_IsHealingMove -AnimTask_IsHealingMove: @ 815A904 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gAnimMoveDmg - ldr r0, [r0] - cmp r0, 0 - ble _0815A920 - ldr r1, =gBattleAnimArgs - movs r0, 0 - b _0815A924 - .pool -_0815A920: - ldr r1, =gBattleAnimArgs - movs r0, 0x1 -_0815A924: - strh r0, [r1, 0xE] - adds r0, r2, 0 - bl DestroyAnimVisualTask - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_IsHealingMove - - thumb_func_start sub_815A934 -sub_815A934: @ 815A934 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x00001f3f - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =gBattle_WIN0H - movs r1, 0 - strh r1, [r0] - ldr r4, =gBattle_WIN0V - strh r1, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A9A0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A934 - - thumb_func_start sub_815A9A0 -sub_815A9A0: @ 815A9A0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bhi _0815AA60 - lsls r0, 2 - ldr r1, =_0815A9BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815A9BC: - .4byte _0815A9D4 - .4byte _0815A9F2 - .4byte _0815AA12 - .4byte _0815A9F2 - .4byte _0815AA32 - .4byte _0815AA42 -_0815A9D4: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815AA60 - b _0815AA3A -_0815A9F2: - ldrh r0, [r4, 0x30] - adds r0, 0x75 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _0815AA60 - movs r0, 0 - strh r0, [r4, 0x32] - b _0815AA3A -_0815AA12: - ldrh r0, [r4, 0x30] - subs r0, 0x75 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - bne _0815AA60 - movs r0, 0 - strh r0, [r4, 0x32] - b _0815AA3A -_0815AA32: - adds r0, r4, 0 - movs r1, 0x1 - bl ChangeSpriteAffineAnim -_0815AA3A: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815AA60 -_0815AA42: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815AA60 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815AA6C - str r0, [r4, 0x1C] -_0815AA60: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A9A0 - - thumb_func_start sub_815AA6C -sub_815AA6C: @ 815AA6C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AA6C - - thumb_func_start sub_815AAA4 -sub_815AAA4: @ 815AAA4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - movs r1, 0x6 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815AAD0 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0815AAD0: - ldrh r0, [r6] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r3, 0 - strh r0, [r5, 0x20] - ldrh r0, [r6, 0x2] - ldrh r4, [r5, 0x22] - adds r0, r4 - strh r0, [r5, 0x22] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815AB2C - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r5, 0x3] - ldr r0, =0x0000fff4 - strh r0, [r5, 0x24] - movs r0, 0x2 - b _0815AB32 - .pool -_0815AB2C: - movs r0, 0xC - strh r0, [r5, 0x24] - ldr r0, =0x0000fffe -_0815AB32: - strh r0, [r5, 0x30] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x2E] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0xFF - beq _0815AB46 - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x34] -_0815AB46: - ldr r0, =sub_815AB5C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AAA4 - - thumb_func_start sub_815AB5C -sub_815AB5C: @ 815AB5C - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815AB9A - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0815ABBA - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815ABBA - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xDE - bl PlaySE1WithPanning - b _0815ABBA -_0815AB9A: - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x30] - subs r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x24 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0815ABAC - negs r0, r0 -_0815ABAC: - cmp r0, 0xC - bne _0815ABBA - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - subs r0, r2, 0x1 - strh r0, [r4, 0x32] -_0815ABBA: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815ABC8 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815ABC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815AB5C - - thumb_func_start sub_815ABD0 -sub_815ABD0: @ 815ABD0 - push {lr} - ldrb r2, [r0, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r1, 0xFF - strh r1, [r0, 0x34] - bl sub_815AAA4 - pop {r0} - bx r0 - thumb_func_end sub_815ABD0 - - thumb_func_start sub_815ABEC -sub_815ABEC: @ 815ABEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815AC40 - ldr r1, =0x00001f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =gBattle_WIN1H - ldr r2, =0x000098f0 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =gBattle_WIN1V - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =gBattle_WIN0H - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =gBattle_WIN0V - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - b _0815AC70 - .pool -_0815AC40: - ldr r1, =0x00001f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =gBattle_WIN1H - movs r0, 0xF0 - strh r0, [r1] - ldr r4, =gBattle_WIN1V - ldr r1, =0x000078a0 - adds r0, r1, 0 - strh r0, [r4] - movs r0, 0x42 - movs r1, 0xF0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x46 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl SetGpuRegBits -_0815AC70: - adds r0, r5, 0 - bl DestroyAnimVisualTask - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ABEC - - thumb_func_start sub_815AC8C -sub_815AC8C: @ 815AC8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r0, =gBattle_WIN1H - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattle_WIN1V - strh r1, [r0] - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815ACB8 - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits -_0815ACB8: - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AC8C - - thumb_func_start sub_815ACD0 -sub_815ACD0: @ 815ACD0 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815ACEC - ldr r4, =gBattleAnimAttacker - b _0815ACEE - .pool -_0815ACEC: - ldr r4, =gBattleAnimTarget -_0815ACEE: - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x2] - adds r0, r6 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r2, =gBattleAnimArgs - ldrh r0, [r2, 0x4] - strh r0, [r5, 0x26] - movs r3, 0 - lsls r0, 16 - asrs r0, 16 - ldrh r4, [r2, 0x6] - movs r6, 0x6 - ldrsh r1, [r2, r6] - cmp r0, r1 - ble _0815AD26 - movs r3, 0x1 -_0815AD26: - strh r3, [r5, 0x2E] - movs r0, 0 - strh r0, [r5, 0x30] - ldrh r0, [r2, 0x8] - strh r0, [r5, 0x32] - ldrh r0, [r2, 0xA] - strh r0, [r5, 0x34] - strh r4, [r5, 0x36] - ldr r0, =sub_815AD4C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ACD0 - - thumb_func_start sub_815AD4C -sub_815AD4C: @ 815AD4C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r2, 0x30] - ldr r1, =gSineTable - movs r3, 0x30 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x34] - ldrh r3, [r2, 0x26] - adds r1, r0, r3 - strh r1, [r2, 0x26] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _0815AD98 - lsls r0, r1, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - bge _0815ADAA - adds r0, r2, 0 - bl DestroyAnimSprite - b _0815ADAA - .pool -_0815AD98: - lsls r0, r1, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - ble _0815ADAA - adds r0, r2, 0 - bl DestroyAnimSprite -_0815ADAA: - pop {r0} - bx r0 - thumb_func_end sub_815AD4C - - thumb_func_start sub_815ADB0 -sub_815ADB0: @ 815ADB0 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r5, r1, r0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815ADDC - ldr r4, =gBattleAnimAttacker - b _0815ADDE - .pool -_0815ADDC: - ldr r4, =gBattleAnimTarget -_0815ADDE: - ldrb r0, [r4] - bl GetBattlerYCoordWithElevation - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - bl sub_80A8364 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - adds r1, r0, 0 - adds r1, 0x24 - movs r2, 0 - strh r1, [r5, 0x8] - strh r1, [r5, 0xA] - subs r0, 0x21 - strh r0, [r5, 0xC] - cmp r0, 0 - bge _0815AE08 - strh r2, [r5, 0xC] -_0815AE08: - ldrh r0, [r5, 0x8] - strh r0, [r5, 0xE] - movs r0, 0x8 - strh r0, [r5, 0x10] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x12] - strh r2, [r5, 0x14] - strh r2, [r5, 0x16] - cmp r7, 0x1 - bne _0815AE30 - ldr r0, =gBattle_BG1_X - b _0815AE32 - .pool -_0815AE30: - ldr r0, =gBattle_BG2_X -_0815AE32: - ldrh r2, [r0] - strh r2, [r5, 0x18] - adds r3, r2, 0 - adds r3, 0xF0 - strh r3, [r5, 0x1A] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x1C] - movs r4, 0x4 - ldrsh r0, [r1, r4] - cmp r0, 0 - bne _0815AE54 - strh r3, [r5, 0x1E] - ldrh r3, [r5, 0x18] - b _0815AE58 - .pool -_0815AE54: - strh r2, [r5, 0x1E] - ldrh r3, [r5, 0x1A] -_0815AE58: - movs r0, 0 - strh r0, [r5, 0x26] - ldrh r1, [r5, 0xC] - lsls r2, r1, 16 - asrs r1, r2, 16 - movs r6, 0xE - ldrsh r0, [r5, r6] - cmp r1, r0 - bgt _0815AE8E - ldr r4, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r0, r4 - mov r12, r0 -_0815AE74: - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - add r1, r12 - strh r3, [r1] - adds r2, 0x1 - lsls r2, 16 - asrs r1, r2, 16 - movs r6, 0xE - ldrsh r0, [r5, r6] - cmp r1, r0 - ble _0815AE74 -_0815AE8E: - cmp r7, 0x1 - bne _0815AEA0 - ldr r0, =0x04000014 - b _0815AEA2 - .pool -_0815AEA0: - ldr r0, =0x04000018 -_0815AEA2: - str r0, [sp] - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl ScanlineEffect_SetParams - ldr r0, =sub_815AED8 - str r0, [r5] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ADB0 - - thumb_func_start sub_815AED8 -sub_815AED8: @ 815AED8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0xC] - movs r3, 0xC - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0815AF00 - strh r2, [r4, 0x8] -_0815AF00: - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815AF2C - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0xC] - movs r3, 0xC - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0815AF30 - strh r2, [r4, 0xA] - movs r0, 0x1 - strh r0, [r4, 0x26] - b _0815AF30 - .pool -_0815AF2C: - subs r0, r1, 0x1 - strh r0, [r4, 0x10] -_0815AF30: - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815AF5C - movs r0, 0 - strh r0, [r4, 0x14] - movs r1, 0 - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815AF4E - movs r1, 0x1 -_0815AF4E: - strh r1, [r4, 0x16] - cmp r1, 0 - beq _0815AF58 - ldrh r0, [r4, 0x18] - b _0815AF5A -_0815AF58: - ldrh r0, [r4, 0x1A] -_0815AF5A: - strh r0, [r4, 0x20] -_0815AF5C: - ldrh r1, [r4, 0x8] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - bge _0815AF90 - ldr r5, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0815AF72: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x20] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x20] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _0815AF72 -_0815AF90: - ldrh r1, [r4, 0xA] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - bgt _0815AFC4 - ldr r5, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0815AFA6: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x1E] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x1E] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _0815AFA6 -_0815AFC4: - movs r3, 0x26 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0815AFE0 - movs r1, 0x1C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815AFDA - ldr r1, =gScanlineEffect - movs r0, 0x3 - strb r0, [r1, 0x15] -_0815AFDA: - adds r0, r7, 0 - bl DestroyAnimVisualTask -_0815AFE0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AED8 - - thumb_func_start sub_815AFF0 -sub_815AFF0: @ 815AFF0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r5, 0 - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - ldr r6, =gBattleAnimAttacker - ldrb r0, [r6] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xC] - ldrb r0, [r6] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xE] - movs r0, 0x20 - strh r0, [r4, 0x10] - ldr r0, =0x0000ffec - strh r0, [r4, 0x12] - strh r5, [r4, 0x14] - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_815B054 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AFF0 - - thumb_func_start sub_815B054 -sub_815B054: @ 815B054 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x5 - bls _0815B074 - b _0815B22E -_0815B074: - lsls r0, 2 - ldr r1, =_0815B088 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815B088: - .4byte _0815B0A0 - .4byte _0815B160 - .4byte _0815B18E - .4byte _0815B1A2 - .4byte _0815B1B8 - .4byte _0815B220 -_0815B0A0: - movs r0, 0xC - ldrsh r2, [r6, r0] - ldrh r1, [r6, 0xA] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815B0B6 - movs r1, 0x10 - ldrsh r0, [r6, r1] - subs r0, r2, r0 - b _0815B0BC -_0815B0B6: - movs r1, 0x10 - ldrsh r0, [r6, r1] - adds r0, r2, r0 -_0815B0BC: - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r2, [r6, 0x12] - ldrh r0, [r6, 0xE] - adds r2, r0 - ldr r0, =gUnknown_08593114 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - ldrb r4, [r6, 0xA] - movs r3, 0x6 - subs r3, r4 - lsls r3, 24 - lsrs r3, 24 - bl CreateSprite - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xBA - bl PlaySE12WithPanning - cmp r4, 0x40 - beq _0815B120 - ldr r5, =gSprites - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r3, r1, r5 - ldrh r0, [r6, 0xA] - movs r2, 0x1 - ands r2, r0 - adds r3, 0x3F - ldrb r4, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r4 - orrs r0, r2 - strb r0, [r3] - adds r5, 0x1C - adds r1, r5 - ldr r0, =SpriteCallbackDummy - str r0, [r1] -_0815B120: - ldrh r1, [r6, 0xA] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0815B138 - ldrh r0, [r6, 0x10] - subs r0, 0x6 - strh r0, [r6, 0x10] - ldrh r0, [r6, 0x12] - subs r0, 0x6 - strh r0, [r6, 0x12] -_0815B138: - ldrh r1, [r6, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE2A0 - adds r0, r6, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r6, 0xA] - adds r0, 0x1 - strh r0, [r6, 0xA] - strh r4, [r6, 0x8] - b _0815B22E - .pool -_0815B160: - adds r0, r6, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0815B22E - movs r2, 0xA - ldrsh r1, [r6, r2] - cmp r1, 0x6 - bne _0815B180 - movs r0, 0x8 - strh r0, [r6, 0x14] - movs r0, 0x3 - strh r0, [r6, 0x8] - b _0815B22E -_0815B180: - cmp r1, 0x2 - bgt _0815B186 - movs r0, 0xA -_0815B186: - strh r0, [r6, 0x14] - movs r0, 0x2 - strh r0, [r6, 0x8] - b _0815B22E -_0815B18E: - ldrh r0, [r6, 0x14] - movs r2, 0x14 - ldrsh r1, [r6, r2] - cmp r1, 0 - beq _0815B19E - subs r0, 0x1 - strh r0, [r6, 0x14] - b _0815B22E -_0815B19E: - strh r1, [r6, 0x8] - b _0815B22E -_0815B1A2: - ldrh r1, [r6, 0x14] - movs r2, 0x14 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0815B1B2 - subs r0, r1, 0x1 - strh r0, [r6, 0x14] - b _0815B22E -_0815B1B2: - movs r0, 0x4 - strh r0, [r6, 0x8] - b _0815B22E -_0815B1B8: - movs r5, 0 - movs r7, 0 - ldr r3, =gSprites - movs r0, 0x1C - adds r0, r3 - mov r8, r0 -_0815B1C4: - lsls r0, r5, 4 - adds r0, r5 - lsls r4, r0, 2 - adds r0, r3, 0 - adds r0, 0x14 - adds r0, r4, r0 - ldr r1, [r0] - ldr r0, =gUnknown_08593114 - cmp r1, r0 - bne _0815B200 - adds r0, r4, r3 - strh r2, [r0, 0x2E] - movs r1, 0x6 - strh r1, [r0, 0x30] - movs r1, 0x2 - str r2, [sp] - str r3, [sp, 0x4] - bl StartSpriteAnim - mov r0, r8 - adds r1, r4, r0 - ldr r0, =sub_815B23C - str r0, [r1] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r2, [sp] - ldr r3, [sp, 0x4] - cmp r7, 0x6 - beq _0815B20A -_0815B200: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3F - bls _0815B1C4 -_0815B20A: - strh r7, [r6, 0x14] - movs r0, 0x5 - strh r0, [r6, 0x8] - b _0815B22E - .pool -_0815B220: - movs r1, 0x14 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815B22E - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0815B22E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815B054 - - thumb_func_start sub_815B23C -sub_815B23C: @ 815B23C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815B270 - ldr r3, =gTasks - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x2E - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815B270: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B23C - - thumb_func_start sub_815B27C -sub_815B27C: @ 815B27C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815B290 - adds r0, r5, 0 - movs r1, 0 - bl InitAnimSpritePos -_0815B290: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - bgt _0815B2C2 - ldrh r0, [r5, 0x2E] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815B2B4 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _0815B2C0 -_0815B2B4: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 -_0815B2C0: - strb r0, [r2] -_0815B2C2: - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x1E - ble _0815B2D8 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0815B2D8: - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3D - bne _0815B324 - ldr r1, =DestroyAnimSprite - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - ldrh r0, [r5, 0x24] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x24] - strh r1, [r5, 0x26] - movs r0, 0x14 - strh r0, [r5, 0x2E] - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r5, 0x1C] -_0815B324: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B27C - - thumb_func_start sub_815B338 -sub_815B338: @ 815B338 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815B35C - cmp r0, 0x1 - beq _0815B37C - b _0815B38E - .pool -_0815B35C: - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE350 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B38E - .pool -_0815B37C: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815B38E - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815B38E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B338 - - thumb_func_start sub_815B394 -sub_815B394: @ 815B394 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0815B3F4 - cmp r0, 0x1 - bgt _0815B3B4 - cmp r0, 0 - beq _0815B3BE - b _0815B496 -_0815B3B4: - cmp r0, 0x2 - beq _0815B424 - cmp r0, 0x3 - beq _0815B478 - b _0815B496 -_0815B3BE: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - adds r0, r6, 0 - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0x30] - strh r0, [r5, 0x32] - b _0815B46C - .pool -_0815B3F4: - ldrh r0, [r5, 0x30] - adds r0, 0x60 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - subs r0, 0x1A - strh r0, [r5, 0x32] - movs r2, 0x30 - ldrsh r1, [r5, r2] - movs r0, 0x32 - ldrsh r2, [r5, r0] - adds r0, r6, 0 - movs r3, 0 - bl SetSpriteRotScale - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815B424 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0815B424: - ldrh r0, [r5, 0x30] - adds r0, 0x60 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x30 - strh r0, [r5, 0x32] - movs r2, 0x30 - ldrsh r1, [r5, r2] - movs r0, 0x32 - ldrsh r2, [r5, r0] - adds r0, r6, 0 - movs r3, 0 - bl SetSpriteRotScale - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815B496 - movs r0, 0 - strh r0, [r5, 0x34] - ldr r1, =gSprites - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0 - bl ResetSpriteRotScale -_0815B46C: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0815B496 - .pool -_0815B478: - ldrh r0, [r5, 0x26] - subs r0, 0x6 - strh r0, [r5, 0x26] - movs r1, 0x22 - ldrsh r0, [r5, r1] - movs r2, 0x26 - ldrsh r1, [r5, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _0815B496 - adds r0, r5, 0 - bl DestroyAnimSprite -_0815B496: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815B394 - - thumb_func_start sub_815B49C -sub_815B49C: @ 815B49C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815B4BC - ldr r0, =0x0000fff0 - b _0815B4C0 - .pool -_0815B4BC: - movs r0, 0x80 - lsls r0, 1 -_0815B4C0: - strh r0, [r4, 0x20] - movs r0, 0 - strh r0, [r4, 0x22] - ldr r0, =sub_815B4D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B49C - - thumb_func_start sub_815B4D4 -sub_815B4D4: @ 815B4D4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x48 - strh r0, [r4, 0x2E] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815B4F8 - ldrh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 20 - b _0815B500 - .pool -_0815B4F8: - ldrh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 -_0815B500: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x10 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r5, r0, r1 - strh r5, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0815B54C - ldr r0, =gUnknown_085CE3A0 - ldrh r1, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x22] - adds r2, r5 - lsls r2, 16 - asrs r2, 16 - adds r3, r4, 0 - adds r3, 0x43 - ldrb r3, [r3] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - bl CreateSpriteAndAnimate -_0815B54C: - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - adds r0, 0x20 - movs r1, 0x98 - lsls r1, 1 - cmp r0, r1 - bls _0815B566 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815B566: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B4D4 - - thumb_func_start sub_815B570 -sub_815B570: @ 815B570 - push {r4,lr} - adds r4, r0, 0 - bl Random2 - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0815B58A - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x4 - b _0815B592 -_0815B58A: - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x5 -_0815B592: - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - bl Random2 - movs r1, 0x7 - ands r0, r1 - adds r1, r0, 0 - cmp r1, 0x3 - ble _0815B5B4 - negs r0, r1 - lsls r0, 24 - lsrs r0, 24 -_0815B5B4: - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_815B5D0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B570 - - thumb_func_start sub_815B5D0 -sub_815B5D0: @ 815B5D0 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - bgt _0815B612 - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0815B646 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r0, 0 - b _0815B644 -_0815B612: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x2 - bne _0815B628 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0815B628: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x3 - bne _0815B640 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0000ffff - strh r0, [r3, 0x30] -_0815B640: - ldrh r0, [r3, 0x30] - adds r0, 0x1 -_0815B644: - strh r0, [r3, 0x30] -_0815B646: - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x3C - ble _0815B654 - adds r0, r3, 0 - bl DestroySprite -_0815B654: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B5D0 - - thumb_func_start sub_815B65C -sub_815B65C: @ 815B65C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B69C - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE3B8 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B6AE - .pool -_0815B69C: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815B6AE - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815B6AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B65C - - thumb_func_start sub_815B6B4 -sub_815B6B4: @ 815B6B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B6F4 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE3E0 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B706 - .pool -_0815B6F4: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815B706 - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815B706: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B6B4 - - thumb_func_start sub_815B70C -sub_815B70C: @ 815B70C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815B71E - cmp r0, 0x1 - beq _0815B748 - b _0815B770 -_0815B71E: - adds r0, r4, 0 - movs r1, 0 - bl InitAnimSpritePos - movs r0, 0x90 - lsls r0, 4 - strh r0, [r4, 0x30] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815B770 - .pool -_0815B748: - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - subs r2, 0x60 - strh r2, [r4, 0x30] - movs r2, 0x22 - ldrsh r0, [r4, r2] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r2, 0x32 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _0815B770 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815B770: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815B70C - - thumb_func_start sub_815B778 -sub_815B778: @ 815B778 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B7B8 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE430 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B7CA - .pool -_0815B7B8: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815B7CA - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815B7CA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B778 - - thumb_func_start sub_815B7D0 -sub_815B7D0: @ 815B7D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r3, r1, 0 - cmp r0, 0x4 - bls _0815B7F6 - b _0815BAFC -_0815B7F6: - lsls r0, 2 - ldr r1, =_0815B808 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815B808: - .4byte _0815B81C - .4byte _0815B86C - .4byte _0815B8A8 - .4byte _0815BA44 - .4byte _0815BA82 -_0815B81C: - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815B844 - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0x1 - bl SetAnimBgAttribute - b _0815B84E - .pool -_0815B844: - movs r0, 0x2 - movs r1, 0x2 - movs r2, 0x1 - bl SetAnimBgAttribute -_0815B84E: - ldr r0, =gTasks - mov r6, r8 - lsls r1, r6, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =gBattleAnimArgs - ldrh r0, [r0] - strh r0, [r1, 0x1C] - b _0815BA26 - .pool -_0815B86C: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _0815B886 - b _0815BAFC -_0815B886: - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - ldrh r5, [r4, 0xA] - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - cmp r5, 0xF - beq _0815B8A6 - b _0815BAFC -_0815B8A6: - b _0815BA7A -_0815B8A8: - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - ldr r1, =gBattleAnimTarget - ldrb r1, [r1] - mov r2, r8 - lsls r4, r2, 2 - adds r2, r4, r2 - lsls r2, 3 - adds r2, r3 - ldrb r2, [r2, 0x1C] - bl HandleSpeciesGfxDataChange - ldrb r1, [r5] - mov r0, sp - bl sub_80A6BFC - bl IsContest - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - beq _0815B8E0 - movs r1, 0 - b _0815B8EA - .pool -_0815B8E0: - ldrb r0, [r5] - bl GetBattlerPosition - lsls r0, 24 - lsrs r1, r0, 24 -_0815B8EA: - ldr r0, =gMonSpritesGfxPtr - ldr r2, [r0] - lsls r0, r1, 2 - adds r2, 0x4 - adds r2, r0 - ldr r1, =gBattleMonForms - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r1, 11 - ldr r0, [r2] - adds r0, r1 - ldr r1, [sp] - ldr r2, =0x04000200 - bl CpuSet - ldr r1, [sp] - movs r2, 0x80 - lsls r2, 4 - mov r0, sp - ldrh r3, [r0, 0xA] - movs r0, 0x1 - bl LoadBgTiles - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815BA1C - ldr r5, =gContestResources - ldr r0, [r5] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl IsSpeciesNotUnown - adds r4, r0, 0 - ldr r0, [r5] - ldr r0, [r0, 0x18] - ldrh r0, [r0, 0x2] - bl IsSpeciesNotUnown - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0815B99C - ldr r6, [sp, 0x4] - movs r5, 0 - movs r0, 0x7 - mov r12, r0 - movs r7, 0 -_0815B950: - movs r4, 0 - adds r3, r7, r6 - mov r1, r12 - lsls r0, r1, 1 - adds r2, r0, r6 -_0815B95A: - ldrh r1, [r3] - ldrh r0, [r2] - strh r0, [r3] - strh r1, [r2] - adds r3, 0x2 - subs r2, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0815B95A - movs r2, 0x20 - add r12, r2 - adds r7, 0x40 - adds r5, 0x1 - cmp r5, 0x7 - ble _0815B950 - movs r5, 0 - movs r0, 0x80 - lsls r0, 3 - adds r3, r0, 0 -_0815B980: - adds r2, r5, 0x1 - lsls r0, r5, 6 - adds r1, r0, r6 - movs r4, 0x7 -_0815B988: - ldrh r0, [r1] - eors r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0815B988 - adds r5, r2, 0 - cmp r5, 0x7 - ble _0815B980 -_0815B99C: - ldr r0, =gContestResources - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0, 0x2] - bl IsSpeciesNotUnown - lsls r0, 24 - cmp r0, 0 - beq _0815B9EC - ldr r3, =gSprites - ldr r4, =gBattlerSpriteIds - ldr r2, =gBattleAnimAttacker - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF6C0 - b _0815BA06 - .pool -_0815B9EC: - ldr r3, =gSprites - ldr r4, =gBattlerSpriteIds - ldr r2, =gBattleAnimAttacker - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF694 -_0815BA06: - str r1, [r0] - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - bl StartSpriteAffineAnim -_0815BA1C: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 -_0815BA26: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815BAFC - .pool -_0815BA44: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815BAFC - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - ldrh r5, [r4, 0xA] - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - cmp r5, 0 - bne _0815BAFC -_0815BA7A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815BAFC -_0815BA82: - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815BAAC - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl SetAnimBgAttribute - b _0815BAB6 - .pool -_0815BAAC: - movs r0, 0x2 - movs r1, 0x2 - movs r2, 0 - bl SetAnimBgAttribute -_0815BAB6: - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815BAF6 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815BAF6 - ldr r0, =gTasks - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r6, 0x1C - ldrsh r0, [r1, r6] - cmp r0, 0 - bne _0815BAF6 - ldrb r0, [r4] - ldr r1, =gBattleSpritesDataPtr - ldr r1, [r1] - ldr r2, [r1] - lsls r1, r0, 2 - adds r1, r2 - ldrh r1, [r1, 0x2] - bl SetBattlerShadowSpriteCallback -_0815BAF6: - mov r0, r8 - bl DestroyAnimVisualTask -_0815BAFC: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B7D0 - - thumb_func_start sub_815BB18 -sub_815BB18: @ 815BB18 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gBattleAnimArgs - ldr r3, =gSprites - ldr r2, =gBattlerSpriteIds - ldr r1, =gBattleAnimAttacker - ldrb r1, [r1] - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - adds r1, 0x3E - ldrb r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r4, 0xE] - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB18 - - thumb_func_start sub_815BB58 -sub_815BB58: @ 815BB58 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - ldr r1, =gBattleAnimTarget - ldrb r1, [r1] - movs r2, 0x1 - bl HandleSpeciesGfxDataChange - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB58 - - thumb_func_start sub_815BB84 -sub_815BB84: @ 815BB84 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _0815BBA2 - b _0815BDF2 -_0815BBA2: - lsls r0, 2 - ldr r1, =_0815BBB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815BBB4: - .4byte _0815BBC8 - .4byte _0815BCB8 - .4byte _0815BD08 - .4byte _0815BD72 - .4byte _0815BDA6 -_0815BBC8: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl SetAnimBgAttribute - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815BC02 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetAnimBgAttribute -_0815BC02: - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C2A6EC - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815BC34 - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000ffc8 - b _0815BC5C - .pool -_0815BC34: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815BC58 - ldr r1, =gBattle_BG1_X - ldr r2, =0x0000ff79 - adds r0, r2, 0 - b _0815BC5E - .pool -_0815BC58: - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000fff6 -_0815BC5C: - adds r0, r3, 0 -_0815BC5E: - strh r0, [r1] - ldr r1, =gBattle_BG1_Y - movs r0, 0 - strh r0, [r1] - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2A634 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2A6D4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =gBattle_BG1_X - ldrh r0, [r0] - strh r0, [r1, 0x1C] - ldr r0, =gBattle_BG1_Y - ldrh r0, [r0] - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - b _0815BD8E - .pool -_0815BCB8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x10] - adds r1, r0, 0x1 - strh r1, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bgt _0815BCCE - b _0815BDF2 -_0815BCCE: - movs r0, 0 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0815BCE4 - movs r0, 0xC - strh r0, [r4, 0xA] -_0815BCE4: - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xC - bne _0815BDF2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815BDF2 -_0815BD08: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bge _0815BD20 - movs r0, 0 - strh r0, [r4, 0xA] -_0815BD20: - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815BDF2 - ldr r2, =gBattle_BG1_X - ldr r1, =gUnknown_085CE460 - movs r3, 0xC - ldrsh r0, [r4, r3] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x1C] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815BD6C - strh r0, [r4, 0x8] - b _0815BDF2 - .pool -_0815BD6C: - movs r0, 0x3 - strh r0, [r4, 0x8] - b _0815BDF2 -_0815BD72: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0xE] - adds r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815BDF2 - movs r0, 0 - strh r0, [r1, 0xE] - movs r0, 0x1 -_0815BD8E: - strh r0, [r1, 0x8] - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xE4 - bl PlaySE12WithPanning - b _0815BDF2 -_0815BDA6: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815BDC8 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl SetAnimBgAttribute -_0815BDC8: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - ldr r0, =gBattle_BG1_X - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattle_BG1_Y - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0815BDF2: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB84 - - thumb_func_start sub_815BE04 -sub_815BE04: @ 815BE04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - bl Random2 - lsls r0, 16 - movs r1, 0xFC - lsls r1, 14 - ands r1, r0 - lsrs r5, r1, 16 - adds r1, r5, 0 - cmp r1, 0x1F - ble _0815BE2E - movs r0, 0x20 - subs r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 -_0815BE2E: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, r5 - strh r0, [r7, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r7, 0x22] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r7, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r7, 0x32] - ldr r4, =gUnknown_085CE48C - movs r0, 0x20 - ldrsh r1, [r7, r0] - movs r0, 0x22 - ldrsh r2, [r7, r0] - adds r5, r7, 0 - adds r5, 0x43 - ldrb r3, [r5] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - bl CreateSprite - mov r9, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0x20 - ldrsh r1, [r7, r0] - movs r0, 0x22 - ldrsh r2, [r7, r0] - ldrb r3, [r5] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - bl CreateSprite - mov r8, r0 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r0, r9 - lsls r2, r0, 4 - add r2, r9 - lsls r2, 2 - ldr r1, =gSprites - mov r10, r1 - adds r5, r2, r1 - adds r0, r5, 0 - movs r1, 0x1 - str r2, [sp] - bl StartSpriteAnim - mov r0, r8 - lsls r6, r0, 4 - add r6, r8 - lsls r6, 2 - mov r1, r10 - adds r4, r6, r1 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnim - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r5, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x32] - ldrh r0, [r1] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x32] - ldr r0, =0x0000ffff - strh r0, [r5, 0x3C] - movs r0, 0x1 - negs r0, r0 - strh r0, [r4, 0x3C] - adds r5, 0x3E - ldrb r0, [r5] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5] - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r1 - strb r0, [r4] - movs r0, 0x1C - add r10, r0 - ldr r2, [sp] - add r2, r10 - ldr r0, =sub_815C050 - str r0, [r2] - add r6, r10 - str r0, [r6] - mov r1, r9 - strh r1, [r7, 0x3A] - mov r0, r8 - strh r0, [r7, 0x3C] - ldr r0, =sub_815BF44 - str r0, [r7, 0x1C] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BE04 - - thumb_func_start sub_815BF44 -sub_815BF44: @ 815BF44 - push {lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x32] - ldrh r0, [r3, 0x34] - adds r2, r0 - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r3, 0x26] - subs r1, r0 - strh r1, [r3, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x34] - movs r2, 0x36 - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815BF92 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - bge _0815BF92 - ldr r2, =gSprites - movs r0, 0x3A - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r0, [r3, 0x36] - adds r0, 0x1 - strh r0, [r3, 0x36] -_0815BF92: - movs r1, 0x36 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - bne _0815BFC6 - movs r2, 0x26 - ldrsh r1, [r3, r2] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0815BFC6 - ldr r2, =gSprites - movs r0, 0x3C - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r0, [r3, 0x36] - adds r0, 0x1 - strh r0, [r3, 0x36] -_0815BFC6: - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815BFE8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815BFF4 - str r0, [r3, 0x1C] -_0815BFE8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BF44 - - thumb_func_start sub_815BFF4 -sub_815BFF4: @ 815BFF4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =gSprites - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r6, r5, 0 - adds r6, 0x1C - adds r0, r3, r6 - ldr r2, [r0] - ldr r0, =SpriteCallbackDummy - cmp r2, r0 - bne _0815C040 - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldr r0, [r1] - cmp r0, r2 - bne _0815C040 - adds r0, r3, r5 - bl DestroySprite - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - adds r0, r4, 0 - bl DestroyAnimSprite -_0815C040: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BFF4 - - thumb_func_start sub_815C050 -sub_815C050: @ 815C050 - push {lr} - adds r3, r0, 0 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0815C09C - ldrh r2, [r3, 0x32] - ldrh r1, [r3, 0x34] - adds r2, r1 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r3, 0x26] - subs r0, r1 - strh r0, [r3, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x34] - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815C09C - mov r1, r12 - ldrb r0, [r1] - movs r1, 0x4 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r0, =SpriteCallbackDummy - str r0, [r3, 0x1C] -_0815C09C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C050 - - thumb_func_start sub_815C0A4 -sub_815C0A4: @ 815C0A4 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0x5 - bls _0815C0C2 - b _0815C396 -_0815C0C2: - lsls r0, 2 - ldr r1, =_0815C0D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815C0D4: - .4byte _0815C0EC - .4byte _0815C224 - .4byte _0815C2AC - .4byte _0815C2E2 - .4byte _0815C310 - .4byte _0815C34A -_0815C0EC: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000d03 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl SetAnimBgAttribute - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815C124 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetAnimBgAttribute -_0815C124: - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C2A6EC - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815C15C - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000ffc8 - adds r0, r3, 0 - b _0815C1CA - .pool -_0815C15C: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerPosition - lsls r0, 24 - lsrs r4, r0, 24 - bl IsDoubleBattle - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C1B4 - cmp r4, 0x1 - bne _0815C180 - ldr r1, =gBattle_BG1_X - ldr r2, =0x0000ff65 - adds r0, r2, 0 - strh r0, [r1] -_0815C180: - cmp r4, 0x3 - bne _0815C18C - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000ff8d - adds r0, r3, 0 - strh r0, [r1] -_0815C18C: - cmp r4, 0 - bne _0815C196 - ldr r1, =gBattle_BG1_X - movs r0, 0xE - strh r0, [r1] -_0815C196: - cmp r4, 0x2 - bne _0815C1CC - ldr r1, =gBattle_BG1_X - ldr r2, =0x0000ffec - b _0815C1C8 - .pool -_0815C1B4: - cmp r4, 0x1 - bne _0815C1C0 - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000ff79 - adds r0, r3, 0 - strh r0, [r1] -_0815C1C0: - cmp r4, 0 - bne _0815C1CC - ldr r1, =gBattle_BG1_X - ldr r2, =0x0000fff6 -_0815C1C8: - adds r0, r2, 0 -_0815C1CA: - strh r0, [r1] -_0815C1CC: - ldr r1, =gBattle_BG1_Y - movs r0, 0 - strh r0, [r1] - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2A634 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2A6D4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =gBattle_BG1_X - ldrh r0, [r0] - strh r0, [r1, 0x1C] - ldr r0, =gBattle_BG1_Y - ldrh r0, [r0] - strh r0, [r1, 0x1E] - b _0815C2A4 - .pool -_0815C224: - ldr r1, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0 - strh r0, [r5, 0xE] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C268 - ldr r2, =gBattle_BG1_X - ldr r1, =gUnknown_085CE4A4 - movs r3, 0xC - ldrsh r0, [r5, r3] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r5, [r5, 0x1C] - adds r0, r5 - b _0815C27A - .pool -_0815C268: - ldr r2, =gBattle_BG1_X - ldr r1, =gUnknown_085CE4A4 - movs r3, 0xC - ldrsh r0, [r5, r3] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r5, 0x1C] - subs r0, r1 -_0815C27A: - strh r0, [r2] - ldr r0, =gTasks - adds r1, r4, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815C2A4 - strh r0, [r1, 0x8] - b _0815C396 - .pool -_0815C2A4: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815C396 -_0815C2AC: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bgt _0815C2C6 - movs r0, 0x5 - strh r0, [r4, 0xA] -_0815C2C6: - ldrh r1, [r4, 0xA] - lsls r1, 8 - movs r0, 0x3 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bne _0815C396 - b _0815C302 -_0815C2E2: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r1, [r4, 0xE] - adds r1, 0x1 - strh r1, [r4, 0xE] - lsls r1, 16 - asrs r1, 16 - ldr r2, =gUnknown_085CE4A8 - movs r3, 0xC - ldrsh r0, [r4, r3] - adds r0, r2 - ldrb r0, [r0] - cmp r1, r0 - ble _0815C396 -_0815C302: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C396 - .pool -_0815C310: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - ble _0815C32A - movs r0, 0xD - strh r0, [r4, 0xA] -_0815C32A: - ldrh r1, [r4, 0xA] - lsls r1, 8 - movs r0, 0x3 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xD - bne _0815C396 - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0815C396 -_0815C34A: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815C36C - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl SetAnimBgAttribute -_0815C36C: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - ldr r0, =gBattle_BG1_X - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattle_BG1_Y - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r6, 0 - bl DestroyAnimVisualTask -_0815C396: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C0A4 - - thumb_func_start sub_815C3A8 -sub_815C3A8: @ 815C3A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815C3E8 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE4B0 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C3FA - .pool -_0815C3E8: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815C3FA - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815C3FA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815C3A8 - - thumb_func_start sub_815C400 -sub_815C400: @ 815C400 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _0815C41E - adds r0, r4, 0 - movs r1, 0 - bl InitAnimSpritePos - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815C472 -_0815C41E: - adds r0, 0x1 - strh r0, [r4, 0x2E] - cmp r1, 0x14 - ble _0815C472 - ldrh r0, [r4, 0x30] - adds r0, 0xA0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - adds r0, 0x80 - strh r0, [r4, 0x32] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815C450 - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - b _0815C456 - .pool -_0815C450: - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 -_0815C456: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - ble _0815C472 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815C472: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815C400 - - thumb_func_start sub_815C478 -sub_815C478: @ 815C478 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldr r5, =gBattleAnimArgs - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C4A4 - adds r0, r2, 0 - bl DestroyAnimVisualTask - b _0815C538 - .pool -_0815C4A4: - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _0815C4B0 - movs r0, 0 - strh r0, [r5, 0x4] -_0815C4B0: - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0x2 - ble _0815C4BC - movs r0, 0x2 - strh r0, [r5, 0x4] -_0815C4BC: - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - movs r0, 0x4 - ldrsh r1, [r5, r0] - lsls r1, 1 - movs r0, 0x8 - subs r0, r1 - strh r0, [r4, 0xE] - movs r1, 0x4 - ldrsh r0, [r5, r1] - lsls r0, 7 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4, 0x10] - ldrh r0, [r5, 0x4] - adds r0, 0x2 - strh r0, [r4, 0x12] - ldrh r0, [r5, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x14] - ldrb r0, [r5] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C508 - ldr r0, =gBattleAnimAttacker - b _0815C50A - .pool -_0815C508: - ldr r0, =gBattleAnimTarget -_0815C50A: - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C528 - movs r1, 0x10 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x10] - movs r1, 0x12 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x12] -_0815C528: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - ldr r0, =sub_815C548 - str r0, [r4] -_0815C538: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C478 - - thumb_func_start sub_815C548 -sub_815C548: @ 815C548 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r6, [r4, r0] - cmp r6, 0x1 - beq _0815C5D0 - cmp r6, 0x1 - bgt _0815C570 - cmp r6, 0 - beq _0815C57C - b _0815C6A8 - .pool -_0815C570: - cmp r6, 0x2 - beq _0815C628 - cmp r6, 0x3 - bne _0815C57A - b _0815C698 -_0815C57A: - b _0815C6A8 -_0815C57C: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl SetSpriteRotScale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl SetBattlerSpriteYOffsetFromRotation - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0815C6A8 - strh r6, [r4, 0xA] - b _0815C690 - .pool -_0815C5D0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - ldrh r2, [r4, 0x12] - subs r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0xC] - adds r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl SetSpriteRotScale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl SetBattlerSpriteYOffsetFromRotation - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - lsls r1, 16 - asrs r1, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - lsls r0, 1 - cmp r1, r0 - blt _0815C6A8 - movs r0, 0 - strh r0, [r4, 0xA] - b _0815C690 - .pool -_0815C628: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r0, 0x24] - adds r1, r2 - movs r5, 0 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl SetSpriteRotScale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl SetBattlerSpriteYOffsetFromRotation - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0815C6A8 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0815C690 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - strh r5, [r4, 0xA] - strh r5, [r4, 0x8] - b _0815C6A8 - .pool -_0815C690: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C6A8 -_0815C698: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl ResetSpriteRotScale - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815C6A8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815C548 - - thumb_func_start sub_815C6B0 -sub_815C6B0: @ 815C6B0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0815C6D4 - strh r0, [r4, 0x20] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - b _0815C6DE - .pool -_0815C6D4: - movs r0, 0xF0 - strh r0, [r4, 0x20] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - subs r0, 0x1E -_0815C6DE: - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrb r1, [r1, 0x2] - adds r0, r4, 0 - bl StartSpriteAnim - ldr r0, =sub_815C700 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C6B0 - - thumb_func_start sub_815C700 -sub_815C700: @ 815C700 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x3 - strh r0, [r4, 0x2E] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815C744 - ldrh r1, [r4, 0x20] - adds r1, 0x5 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - subs r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xF0 - ble _0815C732 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815C732: - ldrh r1, [r4, 0x2E] - movs r0, 0xFF - ands r0, r1 - movs r1, 0x10 - bl Sin - b _0815C768 - .pool -_0815C744: - ldrh r1, [r4, 0x20] - subs r1, 0x5 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - cmp r1, 0 - bge _0815C75C - adds r0, r4, 0 - bl DestroyAnimSprite -_0815C75C: - ldrh r1, [r4, 0x2E] - movs r0, 0xFF - ands r0, r1 - movs r1, 0x10 - bl Cos -_0815C768: - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815C700 - - thumb_func_start sub_815C770 -sub_815C770: @ 815C770 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r0, 0x20 - strh r0, [r4, 0x20] - movs r0, 0x40 - strh r0, [r4, 0x22] - movs r0, 0x80 - lsls r0, 4 - strh r0, [r4, 0x24] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - ldr r0, =sub_815C7C4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C770 - - thumb_func_start sub_815C7C4 -sub_815C7C4: @ 815C7C4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r7, r0, r1 - movs r1, 0x8 - ldrsh r0, [r7, r1] - mov r8, r0 - cmp r0, 0x1 - beq _0815C860 - cmp r0, 0x1 - bgt _0815C7F4 - cmp r0, 0 - beq _0815C7FC - b _0815C8DA - .pool -_0815C7F4: - mov r2, r8 - cmp r2, 0x2 - beq _0815C8C8 - b _0815C8DA -_0815C7FC: - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ldrh r1, [r7, 0xC] - adds r2, r0, r1 - strh r2, [r7, 0xC] - lsls r0, r2, 16 - asrs r0, 16 - ldrh r3, [r7, 0x24] - mov r8, r3 - movs r3, 0x24 - ldrsh r1, [r7, r3] - cmp r0, r1 - blt _0815C8DA - mov r0, r8 - subs r5, r0, r2 - lsls r5, 16 - asrs r5, 16 - adds r6, r1, 0 - lsls r6, 1 - adds r0, r5, 0 - adds r1, r6, 0 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - asrs r4, 16 - movs r1, 0x1 - ands r4, r1 - cmp r4, 0 - bne _0815C854 - lsls r0, 16 - asrs r0, 16 - mov r2, r8 - subs r0, r2, r0 - b _0815C8B2 -_0815C854: - lsls r0, 16 - asrs r0, 16 - mov r3, r8 - subs r0, r3 - strh r0, [r7, 0xC] - b _0815C8DA -_0815C860: - ldr r1, =0xfffffe00 - adds r0, r1, 0 - ldrh r2, [r7, 0xC] - adds r1, r0, r2 - strh r1, [r7, 0xC] - movs r3, 0xC - ldrsh r0, [r7, r3] - movs r2, 0x24 - ldrsh r6, [r7, r2] - cmn r0, r6 - bgt _0815C8DA - ldrh r3, [r7, 0x24] - mov r9, r3 - mov r0, r9 - subs r4, r0, r1 - lsls r4, 16 - asrs r4, 16 - lsls r6, 1 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r2, r0, 16 - mov r1, r8 - ands r1, r5 - lsls r0, r1, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _0815C8BC - lsls r0, r2, 16 - asrs r0, 16 - mov r2, r9 - subs r0, r2 -_0815C8B2: - strh r0, [r7, 0xC] - strh r1, [r7, 0x8] - b _0815C8DA - .pool -_0815C8BC: - lsls r0, r2, 16 - asrs r0, 16 - mov r3, r9 - subs r0, r3, r0 - strh r0, [r7, 0xC] - b _0815C8DA -_0815C8C8: - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl ResetSpriteRotScale - adds r0, r4, 0 - bl DestroyAnimVisualTask - b _0815C950 -_0815C8DA: - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r7, 0xC] - adds r1, r2, 0 - bl SetSpriteRotScale - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl SetBattlerSpriteYOffsetFromRotation - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0xC - ldrsh r0, [r7, r2] - cmp r0, 0 - bge _0815C90E - adds r0, 0x3F -_0815C90E: - asrs r0, 6 - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r7, 0xA] - adds r0, 0x1 - strh r0, [r7, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815C950 - ldrh r1, [r7, 0x20] - movs r3, 0x20 - ldrsh r0, [r7, r3] - cmp r0, 0 - beq _0815C94C - subs r0, r1, 0x1 - strh r0, [r7, 0x20] - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x22] - subs r0, r1 - strh r0, [r7, 0x24] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _0815C950 - movs r0, 0x10 - strh r0, [r7, 0x24] - b _0815C950 - .pool -_0815C94C: - movs r0, 0x2 - strh r0, [r7, 0x8] -_0815C950: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815C7C4 - - thumb_func_start sub_815C95C -sub_815C95C: @ 815C95C - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C9BC - ldr r6, =gBattleAnimArgs - movs r2, 0x4 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0815C990 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0815C990: - ldrh r0, [r6] - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x20] - ldrh r1, [r6, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r1, r2 - strh r0, [r5, 0x22] - movs r0, 0x80 - strh r0, [r5, 0x30] - movs r0, 0xC0 - lsls r0, 2 - strh r0, [r5, 0x32] - strh r1, [r5, 0x34] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0815CA1A - .pool -_0815C9BC: - ldrh r1, [r5, 0x30] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r5, 0x26] - adds r0, r2 - strh r0, [r5, 0x26] - movs r2, 0x36 - ldrsh r0, [r5, r2] - adds r4, r1, 0 - cmp r0, 0 - bne _0815C9FA - movs r0, 0x26 - ldrsh r1, [r5, r0] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmn r1, r0 - ble _0815C9FA - movs r0, 0x1 - strh r0, [r5, 0x36] - movs r1, 0x32 - ldrsh r0, [r5, r1] - negs r0, r0 - movs r1, 0x3 - bl __divsi3 - lsls r0, 1 - strh r0, [r5, 0x32] -_0815C9FA: - adds r0, r4, 0 - adds r0, 0xC0 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x80 - strh r0, [r5, 0x32] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815CA1A - adds r0, r5, 0 - bl DestroyAnimSprite -_0815CA1A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815C95C - - thumb_func_start sub_815CA20 -sub_815CA20: @ 815CA20 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _0815CB2C - ldr r0, =gBattleAnimArgs - movs r3, 0 - ldrsh r1, [r0, r3] - mov r8, r0 - cmp r1, 0 - bne _0815CA5C - ldr r0, =gBattleAnimAttacker - b _0815CA5E - .pool -_0815CA5C: - ldr r0, =gBattleAnimTarget -_0815CA5E: - ldrb r0, [r0] - strh r0, [r2, 0x1E] - mov r1, r8 - ldrb r0, [r1] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r4, r7, 2 - adds r0, r4, r7 - lsls r0, 3 - adds r6, r0, r1 - strh r5, [r6, 0x1C] - adds r0, r5, 0 - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - mov r2, r8 - movs r3, 0x2 - ldrsh r0, [r2, r3] - cmp r0, 0x1 - beq _0815CAC0 - cmp r0, 0x1 - bgt _0815CAA0 - cmp r0, 0 - beq _0815CAA8 - lsls r2, r5, 4 - b _0815CB08 - .pool -_0815CAA0: - cmp r0, 0x2 - beq _0815CACA - lsls r2, r5, 4 - b _0815CB08 -_0815CAA8: - movs r2, 0xA0 - lsls r2, 1 - adds r0, r5, 0 - movs r1, 0xE0 - movs r3, 0 - bl SetSpriteRotScale - adds r0, r5, 0 - bl SetBattlerSpriteYOffsetFromYScale - lsls r2, r5, 4 - b _0815CB08 -_0815CAC0: - movs r2, 0x98 - lsls r2, 1 - movs r3, 0xF0 - lsls r3, 4 - b _0815CAD2 -_0815CACA: - movs r2, 0x98 - lsls r2, 1 - movs r3, 0xF1 - lsls r3, 8 -_0815CAD2: - adds r0, r5, 0 - movs r1, 0xD0 - bl SetSpriteRotScale - adds r0, r5, 0 - bl SetBattlerSpriteYOffsetFromYScale - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815CAF8 - ldrb r0, [r6, 0x1E] - bl GetBattlerSide - lsls r0, 24 - lsls r2, r5, 4 - cmp r0, 0 - bne _0815CB08 -_0815CAF8: - ldr r0, =gSprites - lsls r2, r5, 4 - adds r1, r2, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x10 - strh r0, [r1, 0x26] -_0815CB08: - ldr r1, =gSprites - adds r0, r2, r5 - lsls r0, 2 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x24] - ldr r0, =gTasks - adds r1, r4, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815CB78 - .pool -_0815CB2C: - ldrb r5, [r2, 0x1C] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - movs r4, 0 - strh r0, [r2, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0815CB50 - strh r4, [r2, 0xC] - ldr r0, =gSprites - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x24] - negs r0, r0 - strh r0, [r1, 0x24] -_0815CB50: - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - bne _0815CB78 - adds r0, r5, 0 - bl ResetSpriteRotScale - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - strh r4, [r0, 0x24] - strh r4, [r0, 0x26] - adds r0, r7, 0 - bl DestroyAnimVisualTask -_0815CB78: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CA20 - - thumb_func_start sub_815CB88 -sub_815CB88: @ 815CB88 - push {r4,r5,lr} - adds r4, r0, 0 - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xC - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - bl Random2 - ldr r5, =0x000001ff - ands r5, r0 - bl Random2 - movs r1, 0xFF - ands r1, r0 - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0815CBE0 - movs r2, 0xBC - lsls r2, 3 - adds r0, r5, r2 - b _0815CBE8 - .pool -_0815CBE0: - movs r3, 0xBC - lsls r3, 3 - adds r0, r3, 0 - subs r0, r5 -_0815CBE8: - strh r0, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815CBFA - movs r2, 0x90 - lsls r2, 3 - adds r0, r1, r2 - b _0815CC02 -_0815CBFA: - movs r3, 0x90 - lsls r3, 3 - adds r0, r3, 0 - subs r0, r1 -_0815CC02: - strh r0, [r4, 0x30] - ldr r0, =gBattleAnimArgs - ldrh r0, [r0] - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - bne _0815CC1C - ldr r0, =0x0000fff8 - b _0815CC1E - .pool -_0815CC1C: - movs r0, 0xF8 -_0815CC1E: - strh r0, [r4, 0x20] - movs r0, 0x68 - strh r0, [r4, 0x22] - ldr r0, =sub_815CC34 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CB88 - - thumb_func_start sub_815CC34 -sub_815CC34: @ 815CC34 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815CC4C - ldrh r3, [r4, 0x2E] - lsls r0, r3, 16 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - b _0815CC56 -_0815CC4C: - ldrh r3, [r4, 0x2E] - lsls r1, r3, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 -_0815CC56: - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - adds r0, r3, 0 - subs r0, 0x16 - strh r0, [r4, 0x2E] - adds r1, r2, 0 - subs r1, 0x30 - strh r1, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0815CC7A - movs r0, 0 - strh r0, [r4, 0x2E] -_0815CC7A: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _0815CC8E - adds r0, r4, 0 - bl DestroyAnimSprite -_0815CC8E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815CC34 - - thumb_func_start sub_815CC94 -sub_815CC94: @ 815CC94 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x00001f3f - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =gBattle_WIN0H - movs r1, 0 - strh r1, [r0] - ldr r4, =gBattle_WIN0V - strh r1, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815CD0C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CC94 - - thumb_func_start sub_815CD0C -sub_815CD0C: @ 815CD0C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0815CD4A - cmp r0, 0x1 - bgt _0815CD22 - cmp r0, 0 - beq _0815CD2C - b _0815CDAA -_0815CD22: - cmp r0, 0x2 - beq _0815CD60 - cmp r0, 0x3 - beq _0815CD82 - b _0815CDAA -_0815CD2C: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815CDAA - b _0815CD7A -_0815CD4A: - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _0815CDAA - adds r0, r4, 0 - movs r1, 0x1 - bl ChangeSpriteAffineAnim - b _0815CD7A -_0815CD60: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815CDAA - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815CD7A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - b _0815CDAA -_0815CD82: - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite -_0815CDAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CD0C - - thumb_func_start sub_815CDB4 -sub_815CDB4: @ 815CDB4 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - ldr r1, =sub_815CDFC - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CDB4 - - thumb_func_start sub_815CDFC -sub_815CDFC: @ 815CDFC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - bl Sin - strh r0, [r4, 0x24] - movs r2, 0x30 - ldrsh r0, [r4, r2] - ldrh r1, [r4, 0x34] - lsls r1, 16 - asrs r1, 24 - bl Cos - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x9 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - lsls r1, r0, 16 - cmp r0, 0x3F - bls _0815CE36 - asrs r0, r1, 16 - cmp r0, 0xC3 - ble _0815CE48 -_0815CE36: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSpriteSubpriority - subs r0, 0x1 - b _0815CE52 - .pool -_0815CE48: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSpriteSubpriority - adds r0, 0x1 -_0815CE52: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r3, 0x38 - ldrsh r2, [r4, r3] - cmp r2, 0 - bne _0815CE98 - movs r1, 0x80 - lsls r1, 3 - adds r0, r1, 0 - ldrh r3, [r4, 0x32] - adds r0, r3 - strh r0, [r4, 0x32] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r3, [r4, 0x34] - adds r0, r3 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x2E - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _0815CEC8 - strh r2, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x38] - b _0815CEC8 - .pool -_0815CE98: - cmp r2, 0x1 - bne _0815CEC8 - ldr r1, =0xfffffc00 - adds r0, r1, 0 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r4, 0x32] - ldr r3, =0xffffff00 - adds r0, r3, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _0815CEC8 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815CEC8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CDFC - - thumb_func_start sub_815CED8 -sub_815CED8: @ 815CED8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - movs r0, 0 - bl GetAnimBattlerSpriteId - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815CF18 - movs r0, 0x1 - str r0, [sp, 0x1C] - ldr r0, =gContestResources - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldr r1, [r0, 0x10] - mov r9, r1 - ldr r2, [r0, 0xC] - mov r8, r2 - ldrh r6, [r0, 0x2] - movs r3, 0x14 - b _0815D058 - .pool -_0815CF18: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815CFC4 - movs r0, 0 - str r0, [sp, 0x1C] - ldr r6, =gBattlerPartyIndexes - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0 - bl GetMonData - mov r9, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - movs r1, 0x1 - bl GetMonData - mov r8, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815CFBC - adds r0, r2, 0 - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815CF9C - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - b _0815CFAA - .pool -_0815CF9C: - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 -_0815CFAA: - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815CFBE - .pool -_0815CFBC: - ldrh r6, [r1, 0x2] -_0815CFBE: - movs r1, 0x14 - mov r10, r1 - b _0815D05A -_0815CFC4: - movs r2, 0x1 - str r2, [sp, 0x1C] - ldr r6, =gBattlerPartyIndexes - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r7, =gEnemyParty - adds r0, r7 - movs r1, 0 - bl GetMonData - mov r9, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - movs r1, 0x1 - bl GetMonData - mov r8, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815D054 - adds r0, r2, 0 - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815D03C - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - b _0815D048 - .pool -_0815D03C: - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 -_0815D048: - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815D056 -_0815D054: - ldrh r6, [r1, 0x2] -_0815D056: - ldr r3, =0x0000ffec -_0815D058: - mov r10, r3 -_0815D05A: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl sub_80A8328 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - mov r2, r10 - lsls r1, r2, 16 - asrs r1, 16 - adds r4, r1 - lsls r4, 16 - asrs r4, 16 - lsrs r0, 24 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - str r0, [sp, 0x10] - movs r0, 0x1 - str r0, [sp, 0x14] - adds r0, r6, 0 - ldr r1, [sp, 0x1C] - movs r2, 0 - adds r3, r4, 0 - bl sub_80A8394 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gSprites - lsls r5, r6, 4 - adds r5, r6 - lsls r5, 2 - adds r5, r0 - movs r0, 0x3 - ands r7, r0 - lsls r7, 2 - mov r8, r7 - ldrb r0, [r5, 0x5] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r1, r0 - mov r2, r8 - orrs r1, r2 - strb r1, [r5, 0x5] - ldrb r2, [r5, 0x1] - adds r0, r4, 0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - strb r0, [r5, 0x1] - ldr r0, =0x00007fff - lsrs r1, 4 - lsls r1, 4 - movs r3, 0x80 - lsls r3, 1 - adds r2, r3, 0 - orrs r1, r2 - movs r2, 0x20 - bl FillPalette - ldrb r0, [r5, 0x5] - ands r4, r0 - mov r0, r8 - orrs r4, r0 - strb r4, [r5, 0x5] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gTasks - ldr r1, [sp, 0x18] - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - strh r6, [r4, 0x8] - ldr r0, =sub_815D160 - str r0, [r4] - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CED8 - - thumb_func_start sub_815D160 -sub_815D160: @ 815D160 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D1AE - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xA - bne _0815D1AE - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x1C] - strh r0, [r4, 0x1E] - ldr r0, =sub_815D1BC - str r0, [r4] -_0815D1AE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D160 - - thumb_func_start sub_815D1BC -sub_815D1BC: @ 815D1BC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r2, [r5, 0x8] - ldrh r0, [r5, 0x1C] - subs r0, 0x10 - movs r4, 0 - strh r0, [r5, 0x1C] - ldrh r0, [r5, 0x1E] - adds r0, 0x80 - strh r0, [r5, 0x1E] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r6, r0, r1 - ldrb r2, [r6, 0x1] - lsls r1, r2, 30 - lsrs r1, 30 - movs r0, 0x2 - orrs r1, r0 - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] - movs r0, 0x1C - ldrsh r2, [r5, r0] - movs r0, 0x1E - ldrsh r3, [r5, r0] - str r4, [sp] - adds r0, r6, 0 - movs r1, 0x1 - bl TrySetSpriteRotScale - ldrh r0, [r5, 0x20] - adds r0, 0x1 - strh r0, [r5, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815D22A - adds r0, r6, 0 - bl sub_80A749C - adds r0, r6, 0 - bl sub_80A8610 - ldr r0, =sub_80A6814 - str r0, [r5] -_0815D22A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D1BC - - thumb_func_start sub_815D240 -sub_815D240: @ 815D240 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r4, r1, r0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815D26C - ldr r0, =gBattleAnimAttacker - b _0815D26E - .pool -_0815D26C: - ldr r0, =gBattleAnimTarget -_0815D26E: - ldrb r5, [r0] - movs r6, 0 - strh r6, [r4, 0x8] - strh r6, [r4, 0xA] - strh r6, [r4, 0xC] - movs r0, 0x10 - strh r0, [r4, 0xE] - strh r6, [r4, 0x10] - strh r5, [r4, 0x12] - movs r0, 0x20 - strh r0, [r4, 0x14] - strh r6, [r4, 0x16] - movs r0, 0x18 - strh r0, [r4, 0x18] - adds r0, r5, 0 - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D2A0 - movs r1, 0x18 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x18] -_0815D2A0: - adds r0, r5, 0 - bl GetBattlerYCoordWithElevation - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x22 - strh r0, [r4, 0x22] - cmp r0, 0 - bge _0815D2B4 - strh r6, [r4, 0x22] -_0815D2B4: - ldrh r0, [r4, 0x22] - adds r0, 0x42 - strh r0, [r4, 0x24] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - adds r0, r5, 0 - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D304 - ldr r0, =0x04000014 - str r0, [sp] - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gBattle_BG1_X - ldrh r5, [r0] - ldr r0, =gBattle_BG1_Y - b _0815D316 - .pool -_0815D304: - ldr r0, =0x04000018 - str r0, [sp] - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gBattle_BG2_X - ldrh r5, [r0] - ldr r0, =gBattle_BG2_Y -_0815D316: - ldrh r3, [r0] - movs r7, 0 - movs r2, 0 - ldr r6, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r0, r6 - mov r12, r0 -_0815D326: - lsls r2, 16 - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r6 - strh r5, [r0] - add r1, r12 - strh r5, [r1] - adds r0, r2, 0x1 - lsls r0, 1 - adds r1, r0, r6 - strh r3, [r1] - add r0, r12 - strh r3, [r0] - lsls r0, r7, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - adds r2, 0x2 - lsls r2, 16 - lsrs r2, 16 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0x9F - ble _0815D326 - ldr r0, =0xa6600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl ScanlineEffect_SetParams - ldr r0, =sub_815D398 - str r0, [r4] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D240 - - thumb_func_start sub_815D398 -sub_815D398: @ 815D398 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r6, r0, r1 - ldrb r0, [r6, 0x12] - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D3D8 - ldr r0, =gBattle_BG1_X - ldrh r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gBattle_BG1_Y - b _0815D3E0 - .pool -_0815D3D8: - ldr r0, =gBattle_BG2_X - ldrh r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gBattle_BG2_Y -_0815D3E0: - ldrh r0, [r0] - str r0, [sp, 0x8] - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - bne _0815D3EE - b _0815D5CC -_0815D3EE: - cmp r0, 0x1 - bgt _0815D400 - cmp r0, 0 - beq _0815D40E - b _0815D63C - .pool -_0815D400: - cmp r0, 0x2 - bne _0815D406 - b _0815D5EC -_0815D406: - cmp r0, 0x3 - bne _0815D40C - b _0815D636 -_0815D40C: - b _0815D63C -_0815D40E: - movs r2, 0x24 - ldrsh r0, [r6, r2] - lsls r0, 17 - lsrs r5, r0, 16 - movs r3, 0 - str r3, [sp] - mov r9, r3 - movs r4, 0 - ldrh r0, [r6, 0xA] - adds r0, 0x2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r6, 0xA] - ldrh r7, [r6, 0xA] - mov r8, r7 - movs r0, 0x14 - ldrsh r1, [r6, r0] - movs r0, 0xFC - lsls r0, 3 - bl __divsi3 - strh r0, [r6, 0x1A] - movs r1, 0x16 - ldrsh r0, [r6, r1] - lsls r0, 1 - movs r2, 0x1A - ldrsh r1, [r6, r2] - bl __divsi3 - negs r0, r0 - strh r0, [r6, 0x1C] - ldrh r0, [r6, 0x16] - strh r0, [r6, 0x1E] - lsls r0, 16 - asrs r0, 21 - lsls r0, 16 - lsrs r7, r0, 16 - strh r7, [r6, 0x20] - ldrh r2, [r6, 0x24] - lsls r3, r2, 16 - mov r12, r3 - asrs r1, r3, 16 - movs r3, 0x22 - ldrsh r0, [r6, r3] - cmp r1, r0 - ble _0815D52E - ldr r0, =gScanlineEffect - mov r10, r0 - ldr r1, [sp, 0x4] - lsls r0, r1, 16 - asrs r0, 16 - str r0, [sp, 0x10] - ldr r2, [sp, 0x8] - lsls r0, r2, 16 - asrs r0, 16 - str r0, [sp, 0xC] -_0815D47E: - lsls r5, 16 - asrs r5, 16 - adds r2, r5, 0x1 - lsls r2, 1 - mov r3, r10 - ldrb r1, [r3, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - ldr r0, =gScanlineEffectRegBuffers - adds r2, r0 - lsls r4, 16 - asrs r4, 16 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - subs r0, r4, r0 - ldr r3, [sp, 0xC] - adds r0, r3, r0 - strh r0, [r2] - lsls r3, r5, 1 - mov r0, r10 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r3, r0 - ldr r1, =gScanlineEffectRegBuffers - adds r3, r1 - lsls r1, r7, 16 - asrs r1, 16 - ldr r2, [sp, 0x10] - adds r1, r2, r1 - mov r7, r8 - lsls r2, r7, 16 - asrs r2, 16 - lsls r0, r2, 1 - ldr r7, =gSineTable - adds r0, r7 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - adds r1, r0 - strh r1, [r3] - adds r2, 0xA - mov r8, r2 - movs r0, 0xFF - mov r1, r8 - ands r1, r0 - mov r8, r1 - ldrh r0, [r6, 0x1C] - ldrh r2, [r6, 0x1E] - adds r0, r2 - strh r0, [r6, 0x1E] - lsls r0, 16 - asrs r0, 21 - lsls r0, 16 - lsrs r7, r0, 16 - strh r7, [r6, 0x20] - adds r4, 0x1 - lsls r4, 16 - lsrs r4, 16 - subs r5, 0x2 - lsls r5, 16 - lsrs r5, 16 - ldr r3, [sp] - lsls r0, r3, 16 - asrs r0, 16 - ldrh r1, [r6, 0x14] - adds r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - str r2, [sp] - asrs r0, 21 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r0, =0xffff0000 - add r0, r12 - lsrs r2, r0, 16 - lsls r3, r2, 16 - mov r12, r3 - asrs r1, r3, 16 - movs r3, 0x22 - ldrsh r0, [r6, r3] - cmp r1, r0 - bgt _0815D47E -_0815D52E: - lsls r1, r2, 17 - cmp r1, 0 - blt _0815D55A - ldr r4, =gScanlineEffectRegBuffers - ldr r7, [sp, 0x4] - lsls r0, r7, 16 - asrs r0, 16 - adds r3, r0, 0 - adds r3, 0xF0 - movs r0, 0xF0 - lsls r0, 3 - adds r5, r4, r0 -_0815D546: - asrs r2, r1, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - adds r1, r5 - strh r3, [r1] - subs r2, 0x2 - lsls r1, r2, 16 - cmp r1, 0 - bge _0815D546 -_0815D55A: - ldrh r0, [r6, 0x14] - adds r0, 0x1 - strh r0, [r6, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _0815D5C2 - movs r0, 0x40 - strh r0, [r6, 0x14] - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815D594 - ldrh r0, [r6, 0xE] - subs r0, 0x1 - strh r0, [r6, 0xE] - b _0815D59A - .pool -_0815D594: - ldrh r0, [r6, 0x10] - adds r0, 0x1 - strh r0, [r6, 0x10] -_0815D59A: - ldrh r1, [r6, 0x10] - lsls r1, 8 - ldrh r0, [r6, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xE - ldrsh r1, [r6, r2] - cmp r1, 0 - bne _0815D63C - movs r3, 0x10 - ldrsh r0, [r6, r3] - cmp r0, 0x10 - bne _0815D63C - strh r1, [r6, 0xC] - strh r1, [r6, 0xE] - b _0815D62E -_0815D5C2: - ldrh r0, [r6, 0x18] - ldrh r7, [r6, 0x16] - adds r0, r7 - strh r0, [r6, 0x16] - b _0815D63C -_0815D5CC: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0815D63C - ldr r1, =gScanlineEffect - movs r0, 0x3 - strb r0, [r1, 0x15] - movs r0, 0 - strh r0, [r6, 0xC] - b _0815D62E - .pool -_0815D5EC: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815D602 - ldrh r0, [r6, 0xE] - adds r0, 0x1 - strh r0, [r6, 0xE] - b _0815D608 -_0815D602: - ldrh r0, [r6, 0x10] - subs r0, 0x1 - strh r0, [r6, 0x10] -_0815D608: - ldrh r1, [r6, 0x10] - lsls r1, 8 - ldrh r0, [r6, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xE - ldrsh r0, [r6, r1] - cmp r0, 0x10 - bne _0815D63C - movs r2, 0x10 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0815D63C - strh r0, [r6, 0xC] - strh r0, [r6, 0xE] -_0815D62E: - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _0815D63C -_0815D636: - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0815D63C: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815D398 - - thumb_func_start sub_815D64C -sub_815D64C: @ 815D64C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE5F0 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldr r0, =sub_815D694 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D64C - - thumb_func_start sub_815D694 -sub_815D694: @ 815D694 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r2, =gTasks - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - adds r1, r0, 0x1 - movs r5, 0 - strh r1, [r3, 0x8] - subs r0, 0x14 - lsls r0, 16 - lsrs r0, 16 - adds r6, r2, 0 - cmp r0, 0x16 - bhi _0815D6F8 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D708 - strh r5, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r5, 0x1 - ands r0, r5 - cmp r0, 0 - bne _0815D6F8 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - b _0815D708 - .pool -_0815D6F8: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] -_0815D708: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815D720 - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0815D720: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D694 - - thumb_func_start sub_815D72C -sub_815D72C: @ 815D72C - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r5, r2, 0 - adds r0, r3, 0 - ldr r4, [sp, 0x14] - ldr r6, [sp, 0x18] - lsls r1, 16 - lsrs r1, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 16 - lsrs r6, 16 - mov r2, r8 - strh r1, [r2, 0x20] - strh r5, [r2, 0x22] - lsls r1, 16 - asrs r1, 16 - lsls r2, r1, 4 - mov r3, r8 - strh r2, [r3, 0x36] - lsls r5, 16 - asrs r5, 16 - lsls r2, r5, 4 - strh r2, [r3, 0x38] - lsls r0, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 4 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - strh r0, [r1, 0x3A] - lsls r4, 16 - asrs r4, 16 - subs r4, r5 - lsls r4, 4 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - mov r2, r8 - strh r0, [r2, 0x3C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815D72C - - thumb_func_start sub_815D794 -sub_815D794: @ 815D794 - ldrh r1, [r0, 0x3A] - ldrh r2, [r0, 0x36] - adds r1, r2 - strh r1, [r0, 0x36] - ldrh r2, [r0, 0x3C] - ldrh r3, [r0, 0x38] - adds r2, r3 - strh r2, [r0, 0x38] - lsls r1, 16 - asrs r1, 20 - strh r1, [r0, 0x20] - lsls r2, 16 - asrs r2, 20 - strh r2, [r0, 0x22] - bx lr - thumb_func_end sub_815D794 - - thumb_func_start sub_815D7B4 -sub_815D7B4: @ 815D7B4 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldrh r6, [r4, 0x20] - ldrh r5, [r4, 0x22] - bl SetSpriteCoordsToAnimAttackerCoords - ldr r0, =gBattleAnimArgs - ldrb r1, [r0] - adds r0, r4, 0 - bl StartSpriteAffineAnim - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x22 - ldrsh r2, [r4, r0] - lsls r6, 16 - asrs r6, 16 - lsls r5, 16 - asrs r5, 16 - str r5, [sp] - movs r0, 0x40 - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r3, r6, 0 - bl sub_815D72C - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_815D804 - str r0, [r4, 0x1C] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D7B4 - - thumb_func_start sub_815D804 -sub_815D804: @ 815D804 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - movs r0, 0x2E - ldrsh r4, [r5, r0] - lsls r4, 3 - movs r0, 0xFF - ands r4, r0 - adds r0, r5, 0 - bl sub_815D794 - adds r0, r4, 0 - movs r1, 0x8 - bl Sin - strh r0, [r5, 0x26] - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3A - ble _0815D86A - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D86A - movs r0, 0 - strh r0, [r5, 0x30] - ldrh r1, [r5, 0x32] - adds r1, 0x1 - strh r1, [r5, 0x32] - movs r0, 0x1 - ands r1, r0 - adds r3, r5, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - ble _0815D86A - adds r0, r5, 0 - bl DestroySpriteAndMatrix -_0815D86A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815D804 - - thumb_func_start sub_815D870 -sub_815D870: @ 815D870 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - ldrh r0, [r6, 0x6] - strh r0, [r5, 0x2E] - ldrb r1, [r6] - adds r0, r5, 0 - bl StartSpriteAffineAnim - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815D896 - ldrh r0, [r6, 0x2] - negs r0, r0 - strh r0, [r6, 0x2] -_0815D896: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x4] - adds r0, r6 - strh r0, [r5, 0x22] - ldr r0, =sub_810E2C8 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D870 - - thumb_func_start sub_815D8D8 -sub_815D8D8: @ 815D8D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r2, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - subs r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x14 - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0815D95A - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815D95A - movs r2, 0x1A - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815D92C - ldrh r0, [r3, 0x10] - strh r0, [r3, 0x1A] - negs r0, r0 - strh r0, [r3, 0x10] - b _0815D92E - .pool -_0815D92C: - strh r7, [r3, 0x1A] -_0815D92E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0x1C - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0815D94A - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x1C] - negs r0, r0 - strh r0, [r1, 0x12] - b _0815D94E -_0815D94A: - movs r0, 0 - strh r0, [r1, 0x1C] -_0815D94E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0xA] -_0815D95A: - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldrh r6, [r4, 0x16] - ldrh r7, [r4, 0x18] - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - beq _0815D998 - ldr r3, =gSprites - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsrs r2, r6, 8 - ldrh r0, [r4, 0x1A] - subs r0, r2 - strh r0, [r1, 0x24] - adds r2, r3, 0 - b _0815D9AE - .pool -_0815D998: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - lsrs r1, r6, 8 - ldrh r4, [r4, 0x1A] - adds r1, r4 - strh r1, [r0, 0x24] -_0815D9AE: - mov r1, r12 - adds r0, r1, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815D9E0 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r2, r7, 8 - ldrh r0, [r4, 0x1C] - subs r0, r2 - b _0815D9F2 - .pool -_0815D9E0: - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r0, r7, 8 - ldrh r4, [r4, 0x1C] - adds r0, r4 -_0815D9F2: - strh r0, [r1, 0x26] - mov r2, r12 - adds r0, r2, r5 - lsls r0, 3 - add r0, r8 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - bgt _0815DA12 - adds r0, r5, 0 - bl DestroyTask - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_0815DA12: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D8D8 - - thumb_func_start sub_815DA20 -sub_815DA20: @ 815DA20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r7, 0 - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - subs r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x14 - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0815DAA6 - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815DAA6 - movs r2, 0x1A - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815DA78 - ldrh r0, [r3, 0x10] - strh r0, [r3, 0x1A] - negs r0, r0 - strh r0, [r3, 0x10] - b _0815DA7A - .pool -_0815DA78: - strh r7, [r3, 0x1A] -_0815DA7A: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0x1C - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0815DA96 - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x1C] - negs r0, r0 - strh r0, [r1, 0x12] - b _0815DA9A -_0815DA96: - movs r0, 0 - strh r0, [r1, 0x1C] -_0815DA9A: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0xA] -_0815DAA6: - lsls r3, r6, 2 - adds r0, r3, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldrh r2, [r4, 0xC] - ldr r1, =0x00007fff - adds r0, r1, 0 - ands r0, r2 - ldrh r2, [r4, 0x16] - adds r0, r2 - lsls r5, r0, 16 - lsrs r0, r5, 16 - mov r9, r0 - ldrh r0, [r4, 0xE] - ands r1, r0 - ldrh r2, [r4, 0x18] - adds r1, r2 - lsls r1, 16 - lsrs r7, r1, 16 - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r12, r3 - cmp r0, 0 - beq _0815DB00 - ldr r3, =gSprites - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsrs r2, r5, 24 - ldrh r0, [r4, 0x1A] - subs r0, r2 - strh r0, [r1, 0x24] - adds r2, r3, 0 - b _0815DB16 - .pool -_0815DB00: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - lsrs r1, r5, 24 - ldrh r4, [r4, 0x1A] - adds r1, r4 - strh r1, [r0, 0x24] -_0815DB16: - mov r1, r12 - adds r0, r1, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815DB48 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r2, r7, 8 - ldrh r0, [r4, 0x1C] - subs r0, r2 - b _0815DB5A - .pool -_0815DB48: - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r0, r7, 8 - ldrh r4, [r4, 0x1C] - adds r0, r4 -_0815DB5A: - strh r0, [r1, 0x26] - mov r2, r12 - adds r0, r2, r6 - lsls r0, 3 - mov r1, r8 - adds r2, r0, r1 - mov r0, r9 - strh r0, [r2, 0x16] - strh r7, [r2, 0x18] - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bgt _0815DB80 - movs r0, 0x1E - strh r0, [r2, 0x8] - movs r0, 0 - strh r0, [r2, 0x22] - ldr r0, =sub_815D8D8 - str r0, [r2] -_0815DB80: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DA20 - - thumb_func_start sub_815DB90 -sub_815DB90: @ 815DB90 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gTasks - mov r8, r0 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldr r1, =gBattlerSpriteIds - ldr r2, =gBattleAnimAttacker - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x26] - ldr r5, =gBattleAnimArgs - ldrh r0, [r5] - strh r0, [r4, 0x24] - ldrh r0, [r5] - strh r0, [r4, 0x8] - ldrh r0, [r5, 0xC] - strh r0, [r4, 0x22] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r0, 0 - beq _0815DBD4 - ldrh r0, [r4, 0x14] - ldr r3, =0xffff8000 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r4, 0x14] -_0815DBD4: - ldrb r0, [r2] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815DC04 - ldrh r0, [r5, 0x2] - strh r0, [r4, 0xC] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0xE] - mov r3, r8 - adds r4, r7, 0 - b _0815DC74 - .pool -_0815DC04: - movs r7, 0x2 - ldrsh r0, [r5, r7] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815DC20 - ldrh r1, [r5, 0x2] - ldr r0, =0x00007fff - ands r0, r1 - b _0815DC28 - .pool -_0815DC20: - ldrh r0, [r5, 0x2] - ldr r2, =0xffff8000 - adds r1, r2, 0 - orrs r0, r1 -_0815DC28: - strh r0, [r4, 0xC] - ldr r0, =gBattleAnimArgs - movs r3, 0x4 - ldrsh r1, [r0, r3] - movs r2, 0x80 - lsls r2, 8 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0815DC60 - ldr r3, =gTasks - lsls r4, r6, 2 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r3 - ldrh r2, [r5, 0x4] - ldr r0, =0x00007fff - ands r0, r2 - b _0815DC72 - .pool -_0815DC60: - ldr r3, =gTasks - lsls r4, r6, 2 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r3 - ldrh r2, [r5, 0x4] - ldr r7, =0xffff8000 - adds r0, r7, 0 - orrs r0, r2 -_0815DC72: - strh r0, [r1, 0xE] -_0815DC74: - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x18] - strh r1, [r0, 0x16] - ldrh r1, [r5, 0x8] - strh r1, [r0, 0x10] - ldrh r1, [r5, 0xA] - strh r1, [r0, 0x12] - ldr r1, =sub_815DA20 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DB90 - - thumb_func_start sub_815DCA4 -sub_815DCA4: @ 815DCA4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - ldr r4, =gBattleAnimArgs - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DCC4 - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0815DCC4: - movs r0, 0 - strh r0, [r5, 0x8] - strh r0, [r5, 0xA] - strh r0, [r5, 0xC] - ldrh r0, [r4, 0x2] - strh r0, [r5, 0xE] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DCE8 - ldr r0, =gBattleAnimAttacker - b _0815DCEA - .pool -_0815DCE8: - ldr r0, =gBattleAnimTarget -_0815DCEA: - ldrb r4, [r0] - adds r0, r4, 0 - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - adds r0, r4, 0 - bl GetBattlerSpriteSubpriority - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r5, 0x26] - ldr r2, =gUnknown_085CE74C - adds r0, r5, 0 - bl PrepareAffineAnimInTaskData - ldr r0, =sub_815DD48 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DCA4 - - thumb_func_start sub_815DD48 -sub_815DD48: @ 815DD48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815DD6C - cmp r0, 0x1 - beq _0815DDCC - b _0815DDDA - .pool -_0815DD6C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815DD82 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_815DDE0 -_0815DD82: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bne _0815DD92 - adds r0, r5, 0 - movs r1, 0 - bl sub_815DDE0 -_0815DD92: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0815DDDA - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0815DDB4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815DDDA -_0815DDB4: - strh r1, [r4, 0xA] - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE74C - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - b _0815DDDA - .pool -_0815DDCC: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DDDA - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815DDDA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815DD48 - - thumb_func_start sub_815DDE0 -sub_815DDE0: @ 815DDE0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r2, =gTasks - adds r4, r0, r2 - cmp r1, 0 - bne _0815DE08 - movs r1, 0x12 - movs r3, 0xEC - b _0815DE0C - .pool -_0815DE08: - movs r1, 0x1E - movs r3, 0x14 -_0815DE0C: - mov r2, sp - ldrh r0, [r4, 0x10] - subs r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x10] - subs r0, r1 - subs r0, 0x4 - strh r0, [r2, 0x2] - ldrh r0, [r4, 0x10] - adds r0, r1 - strh r0, [r2, 0x4] - ldrh r0, [r4, 0x10] - adds r0, r1 - adds r0, 0x4 - strh r0, [r2, 0x6] - add r2, sp, 0x8 - lsls r1, r3, 24 - asrs r1, 24 - ldrh r0, [r4, 0x12] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x12] - adds r0, r1 - adds r0, 0x6 - strh r0, [r2, 0x2] - movs r5, 0 - mov r8, r2 - ldr r7, =gSprites -_0815DE44: - lsls r0, r5, 1 - add r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0x1 - ands r0, r5 - lsls r0, 1 - add r0, r8 - movs r3, 0 - ldrsh r2, [r0, r3] - ldrb r3, [r4, 0x14] - subs r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085CE76C - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0815DE98 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r7 - movs r0, 0 - strh r0, [r1, 0x2E] - movs r0, 0x2 - cmp r5, 0x1 - bhi _0815DE86 - movs r2, 0x2 - negs r2, r2 - adds r0, r2, 0 -_0815DE86: - strh r0, [r1, 0x30] - ldr r0, =0x0000ffff - strh r0, [r1, 0x32] - strh r6, [r1, 0x34] - movs r0, 0x2 - strh r0, [r1, 0x36] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_0815DE98: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _0815DE44 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DDE0 - - thumb_func_start sub_815DEBC -sub_815DEBC: @ 815DEBC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x32] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - ble _0815DF02 - ldr r3, =gTasks - movs r0, 0x36 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x34 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815DF02: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DEBC - - thumb_func_start sub_815DF0C -sub_815DF0C: @ 815DF0C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r4, 0xA] - ldrb r0, [r1] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0xC] - ldr r0, =sub_815DF64 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DF0C - - thumb_func_start sub_815DF64 -sub_815DF64: @ 815DF64 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815DFB4 - ldrh r0, [r4, 0xC] - ldr r2, =gUnknown_085CE784 - movs r3, 0x8 - ldrsh r1, [r4, r3] - lsls r1, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0x10 - movs r2, 0x8 - bl BlendPalette - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - ble _0815DFA4 - movs r0, 0 - strh r0, [r4, 0x8] -_0815DFA4: - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - b _0815DFC6 - .pool -_0815DFB4: - ldrh r0, [r4, 0xC] - movs r1, 0x10 - movs r2, 0 - movs r3, 0 - bl BlendPalette - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815DFC6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815DF64 - - thumb_func_start sub_815DFCC -sub_815DFCC: @ 815DFCC - push {lr} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - movs r2, 0xD0 - lsls r2, 1 - ldr r1, =gBattleAnimAttacker - ldrb r3, [r1] - ldr r1, =gBattleAnimArgs - ldrb r1, [r1] - str r1, [sp] - movs r1, 0xA - str r1, [sp, 0x4] - movs r1, 0x2 - str r1, [sp, 0x8] - movs r1, 0x1E - str r1, [sp, 0xC] - ldr r1, =gUnknown_08C2DC68 - str r1, [sp, 0x10] - ldr r1, =gUnknown_08C2DDC4 - str r1, [sp, 0x14] - ldr r1, =gUnknown_08C2DDA4 - str r1, [sp, 0x18] - movs r1, 0 - bl sub_8117854 - add sp, 0x1C - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DFCC - - thumb_func_start sub_815E01C -sub_815E01C: @ 815E01C - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimAttacker - ldrb r0, [r6] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815E038 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_0815E038: - ldrb r0, [r6] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - ldr r4, =gBattleAnimArgs - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r6] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r5, 0x22] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815E080 - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] - ldr r0, =0x0000fd80 - strh r0, [r5, 0x30] - b _0815E0A8 - .pool -_0815E080: - cmp r0, 0x1 - bne _0815E09A - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] - strh r0, [r5, 0x30] - b _0815E0A8 -_0815E09A: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] -_0815E0A8: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815E0C8 - ldrh r0, [r5, 0x2E] - negs r0, r0 - strh r0, [r5, 0x2E] - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0815E0C8: - ldr r0, =sub_815E0DC - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E01C - - thumb_func_start sub_815E0DC -sub_815E0DC: @ 815E0DC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x3A] - adds r0, r1 - strh r0, [r2, 0x3A] - ldrh r1, [r2, 0x30] - ldrh r3, [r2, 0x3C] - adds r1, r3 - strh r1, [r2, 0x3C] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2, 0x24] - lsls r1, 16 - asrs r1, 24 - strh r1, [r2, 0x26] - ldrh r0, [r2, 0x38] - adds r0, 0x1 - strh r0, [r2, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xE - bne _0815E110 - adds r0, r2, 0 - bl DestroyAnimSprite -_0815E110: - pop {r0} - bx r0 - thumb_func_end sub_815E0DC - - thumb_func_start sub_815E114 -sub_815E114: @ 815E114 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - bl IsContest - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0815E144 - movs r0, 0x8 - strh r0, [r6, 0x12] - movs r0, 0x3 - strh r0, [r6, 0x14] - movs r0, 0x1 - strh r0, [r6, 0x16] - b _0815E14E - .pool -_0815E144: - movs r0, 0xC - strh r0, [r6, 0x12] - movs r0, 0x3 - strh r0, [r6, 0x14] - strh r1, [r6, 0x16] -_0815E14E: - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815E188 - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E17C - adds r0, 0x3 -_0815E17C: - asrs r0, 2 - adds r0, r4, r0 - b _0815E1AC - .pool -_0815E188: - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E1A8 - adds r0, 0x3 -_0815E1A8: - asrs r0, 2 - subs r0, r4, r0 -_0815E1AC: - strh r0, [r6, 0x1E] - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E1D0 - adds r0, 0x3 -_0815E1D0: - asrs r0, 2 - subs r0, r4, r0 - strh r0, [r6, 0x20] - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x22] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x24] - ldr r0, =sub_815E20C - str r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E114 - - thumb_func_start sub_815E20C -sub_815E20C: @ 815E20C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r1, [r5, r0] - cmp r1, 0 - beq _0815E238 - cmp r1, 0x1 - bne _0815E230 - b _0815E330 -_0815E230: - b _0815E33E - .pool -_0815E238: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0815E33E - strh r1, [r5, 0xA] - movs r1, 0x1E - ldrsh r0, [r5, r1] - movs r2, 0x20 - ldrsh r1, [r5, r2] - movs r3, 0x22 - ldrsh r2, [r5, r3] - movs r4, 0x24 - ldrsh r3, [r5, r4] - ldrb r4, [r5, 0x12] - str r4, [sp] - ldrb r4, [r5, 0xC] - str r4, [sp, 0x4] - add r4, sp, 0x10 - str r4, [sp, 0x8] - adds r4, 0x2 - str r4, [sp, 0xC] - bl sub_815E34C - movs r6, 0 - mov r8, r4 - ldr r4, =gSprites -_0815E272: - add r0, sp, 0x10 - movs r2, 0 - ldrsh r1, [r0, r2] - mov r3, r8 - movs r0, 0 - ldrsh r2, [r3, r0] - ldr r0, =gUnknown_085CE7EC - movs r3, 0x23 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _0815E306 - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815E2C6 - cmp r6, 0 - bne _0815E2B4 - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - negs r0, r0 - strh r0, [r1, 0x26] - strh r0, [r1, 0x24] - b _0815E2EE - .pool -_0815E2B4: - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x26] - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x24] - b _0815E2EE -_0815E2C6: - cmp r6, 0 - bne _0815E2DC - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r5, 0x14] - b _0815E2EC -_0815E2DC: - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x24] - ldrh r0, [r5, 0x14] - negs r0, r0 -_0815E2EC: - strh r0, [r1, 0x26] -_0815E2EE: - ldr r1, =gSprites - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x2E] - strh r7, [r0, 0x30] - movs r1, 0xA - strh r1, [r0, 0x32] - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] -_0815E306: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bls _0815E272 - ldrh r2, [r5, 0xC] - movs r3, 0xC - ldrsh r1, [r5, r3] - movs r4, 0x12 - ldrsh r0, [r5, r4] - cmp r1, r0 - bne _0815E324 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_0815E324: - adds r0, r2, 0x1 - strh r0, [r5, 0xC] - b _0815E33E - .pool -_0815E330: - movs r1, 0x1C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815E33E - adds r0, r7, 0 - bl DestroyAnimVisualTask -_0815E33E: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E20C - - thumb_func_start sub_815E34C -sub_815E34C: @ 815E34C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - ldr r6, [sp, 0x30] - mov r9, r6 - ldr r6, [sp, 0x34] - mov r10, r6 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - lsls r2, 16 - lsrs r2, 16 - adds r7, r2, 0 - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x4] - lsls r4, 24 - lsrs r6, r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - cmp r5, 0 - bne _0815E394 - mov r2, r9 - strh r0, [r2] - mov r6, r10 - strh r1, [r6] - b _0815E3F2 -_0815E394: - cmp r5, r6 - bcc _0815E3A2 - mov r0, r9 - strh r2, [r0] - mov r1, r10 - strh r3, [r1] - b _0815E3F2 -_0815E3A2: - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - mov r2, r12 - lsls r1, r2, 16 - asrs r1, 16 - lsls r5, r1, 8 - lsls r0, r7, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 8 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r5, r0 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - lsls r4, r1, 8 - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 8 - adds r1, r6, 0 - bl __divsi3 - mov r6, r8 - muls r6, r0 - adds r0, r6, 0 - adds r4, r0 - asrs r5, 8 - mov r0, r9 - strh r5, [r0] - asrs r4, 8 - mov r1, r10 - strh r4, [r1] -_0815E3F2: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E34C - - thumb_func_start sub_815E404 -sub_815E404: @ 815E404 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x24 - ble _0815E43A - ldr r3, =gTasks - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x30 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815E43A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E404 - - thumb_func_start sub_815E444 -sub_815E444: @ 815E444 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - ldr r1, =DestroyAnimSprite - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A70C0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E444 - - thumb_func_start sub_815E47C -sub_815E47C: @ 815E47C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - ldr r1, =gTasks - adds r7, r0, r1 - ldr r0, =gBattleAnimAttacker - mov r10, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x1E] - mov r1, r10 - ldrb r0, [r1] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x20] - ldr r0, =gBattleAnimTarget - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x22] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - mov r1, r8 - ldrb r0, [r1] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E4EE - adds r0, 0x3 -_0815E4EE: - asrs r0, 2 - adds r0, r4, r0 - strh r0, [r7, 0x24] - ldr r4, =gUnknown_085CE84C - movs r0, 0x1E - ldrsh r5, [r7, r0] - movs r1, 0x20 - ldrsh r6, [r7, r1] - mov r1, r8 - ldrb r0, [r1] - bl GetBattlerSpriteSubpriority - adds r3, r0, 0 - subs r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x26] - cmp r0, 0x40 - beq _0815E5B8 - ldr r4, =gSprites - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x10 - strh r1, [r0, 0x2E] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r7, 0x22] - strh r1, [r0, 0x32] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r7, 0x24] - strh r1, [r0, 0x36] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x38] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl InitAnimArcTranslation - mov r1, r10 - ldrb r0, [r1] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815E596 - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim -_0815E596: - ldr r0, =sub_815E5CC - str r0, [r7] - b _0815E5BE - .pool -_0815E5B8: - mov r0, r9 - bl DestroyAnimVisualTask -_0815E5BE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E47C - - thumb_func_start sub_815E5CC -sub_815E5CC: @ 815E5CC - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0815E634 - cmp r1, 0x1 - bgt _0815E5F4 - cmp r1, 0 - beq _0815E5FE - b _0815E6D2 - .pool -_0815E5F4: - cmp r1, 0x2 - beq _0815E658 - cmp r1, 0x3 - beq _0815E6CC - b _0815E6D2 -_0815E5FE: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E6D2 - strh r1, [r4, 0xA] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl TranslateAnimArc - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0815E6D2 - b _0815E6BE - .pool -_0815E634: - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl TranslateAnimArc - lsls r0, 24 - cmp r0, 0 - beq _0815E6D2 - movs r0, 0 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _0815E6BE - .pool -_0815E658: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E6D2 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r2, [r4, 0xC] - adds r2, 0x1 - strh r2, [r4, 0xC] - ldr r5, =gSprites - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x1 - ands r2, r0 - adds r1, 0x3E - lsls r2, 2 - ldrb r3, [r1] - subs r0, 0x6 - ands r0, r3 - orrs r0, r2 - strb r0, [r1] - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _0815E6D2 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite -_0815E6BE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815E6D2 - .pool -_0815E6CC: - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0815E6D2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815E5CC - - thumb_func_start sub_815E6D8 -sub_815E6D8: @ 815E6D8 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r0, r2] - adds r6, r0, 0 - cmp r1, 0 - bne _0815E6F4 - ldr r0, =gBattleAnimAttacker - b _0815E6F6 - .pool -_0815E6F4: - ldr r0, =gBattleAnimTarget -_0815E6F6: - ldrb r5, [r0] - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - adds r1, r6, 0 - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x3A] - movs r2, 0x2 - ldrsh r0, [r1, r2] - movs r1, 0x1 - cmp r0, 0 - bne _0815E724 - movs r3, 0x1 - negs r3, r3 - adds r1, r3, 0 -_0815E724: - strh r1, [r4, 0x3C] - adds r0, r5, 0 - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815E768 - ldrb r2, [r4, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80A861C - subs r0, 0x8 - b _0815E772 - .pool -_0815E768: - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80A861C - adds r0, 0x8 -_0815E772: - strh r0, [r4, 0x20] - ldr r0, =sub_815E784 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E6D8 - - thumb_func_start sub_815E784 -sub_815E784: @ 815E784 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - ldrsh r1, [r2, r0] - cmp r1, 0x1 - beq _0815E7CC - cmp r1, 0x1 - bgt _0815E79A - cmp r1, 0 - beq _0815E7A4 - b _0815E83C -_0815E79A: - cmp r1, 0x2 - beq _0815E7DC - cmp r1, 0x3 - beq _0815E802 - b _0815E83C -_0815E7A4: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E83C - strh r1, [r2, 0x30] - ldrh r0, [r2, 0x3C] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0815E83C - b _0815E7FA -_0815E7CC: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0815E83C - b _0815E7F6 -_0815E7DC: - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r1, 2 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815E83C -_0815E7F6: - movs r0, 0 - strh r0, [r2, 0x30] -_0815E7FA: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - b _0815E83C -_0815E802: - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0815E83C - ldrh r0, [r2, 0x3A] - subs r0, 0x1 - strh r0, [r2, 0x3A] - lsls r0, 16 - cmp r0, 0 - beq _0815E836 - movs r0, 0 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - b _0815E83C -_0815E836: - adds r0, r2, 0 - bl DestroyAnimSprite -_0815E83C: - pop {r0} - bx r0 - thumb_func_end sub_815E784 - - thumb_func_start sub_815E840 -sub_815E840: @ 815E840 - push {r4,lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r2, =gBattleAnimArgs - movs r3, 0 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0815E85C - adds r0, r1, 0 - bl DestroyAnimVisualTask - b _0815E884 - .pool -_0815E85C: - ldr r0, =gTasks - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r2, 0x2] - strh r0, [r4, 0x8] - ldrb r0, [r2] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE87C - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldr r0, =sub_815E898 - str r0, [r4] -_0815E884: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E840 - - thumb_func_start sub_815E898 -sub_815E898: @ 815E898 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E8F2 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815E8E0 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - b _0815E8F0 - .pool -_0815E8E0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe -_0815E8F0: - strh r1, [r0, 0x24] -_0815E8F2: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0815E94E - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - cmp r0, 0 - beq _0815E948 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE87C - bl PrepareAffineAnimInTaskData - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - b _0815E94E - .pool -_0815E948: - adds r0, r6, 0 - bl DestroyAnimVisualTask -_0815E94E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815E898 - - thumb_func_start sub_815E954 -sub_815E954: @ 815E954 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815E970 - ldr r4, =gBattleAnimAttacker - b _0815E972 - .pool -_0815E970: - ldr r4, =gBattleAnimTarget -_0815E972: - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - strh r0, [r5, 0x22] - movs r1, 0x22 - ldrsh r0, [r5, r1] - cmp r0, 0x7 - bgt _0815E996 - movs r0, 0x8 - strh r0, [r5, 0x22] -_0815E996: - movs r2, 0 - strh r2, [r5, 0x2E] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x30] - strh r2, [r5, 0x32] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x34] - ldr r0, =sub_815E9BC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E954 - - thumb_func_start sub_815E9BC -sub_815E9BC: @ 815E9BC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x30 - ldrsh r1, [r3, r2] - cmp r0, r1 - blt _0815EA10 - movs r0, 0 - strh r0, [r3, 0x2E] - ldrh r1, [r3, 0x32] - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - strh r1, [r3, 0x32] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - lsls r1, 2 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r2, 0x32 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _0815EA10 - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _0815EA10 - adds r0, r3, 0 - bl DestroyAnimSprite -_0815EA10: - pop {r0} - bx r0 - thumb_func_end sub_815E9BC - - thumb_func_start sub_815EA14 -sub_815EA14: @ 815EA14 - push {lr} - adds r3, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815EA44 - ldrb r2, [r3, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x3] - movs r0, 0x64 - strh r0, [r3, 0x20] - movs r0, 0x1 - b _0815EA4A - .pool -_0815EA44: - movs r0, 0x8C - strh r0, [r3, 0x20] - ldr r0, =0x0000ffff -_0815EA4A: - strh r0, [r3, 0x3C] - movs r0, 0x38 - strh r0, [r3, 0x22] - ldr r0, =sub_815EA60 - str r0, [r3, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EA14 - - thumb_func_start sub_815EA60 -sub_815EA60: @ 815EA60 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bls _0815EA6E - b _0815EC40 -_0815EA6E: - lsls r0, 2 - ldr r1, =_0815EA7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EA7C: - .4byte _0815EAA0 - .4byte _0815EAD2 - .4byte _0815EAE4 - .4byte _0815EB24 - .4byte _0815EB36 - .4byte _0815EB74 - .4byte _0815EBD8 - .4byte _0815EBF8 - .4byte _0815EC1E -_0815EAA0: - movs r3, 0x3C - ldrsh r0, [r4, r3] - lsls r0, 1 - ldrh r1, [r4, 0x22] - subs r1, r0 - strh r1, [r4, 0x22] - ldrh r2, [r4, 0x30] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _0815EAC2 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] -_0815EAC2: - adds r0, r2, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - beq _0815EAD0 - b _0815EC40 -_0815EAD0: - b _0815EC12 -_0815EAD2: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0815EAE2 - b _0815EC40 -_0815EAE2: - b _0815EC12 -_0815EAE4: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r3, 0x3C - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xC - beq _0815EB1C - b _0815EC40 -_0815EB1C: - b _0815EC12 - .pool -_0815EB24: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - beq _0815EB34 - b _0815EC40 -_0815EB34: - b _0815EC12 -_0815EB36: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x22] - subs r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xC - bne _0815EC40 - b _0815EC16 - .pool -_0815EB74: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r3, 0x3C - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xF - bne _0815EBC0 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] -_0815EBC0: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bne _0815EC40 - b _0815EC12 - .pool -_0815EBD8: - movs r3, 0x3C - ldrsh r0, [r4, r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - ldrh r0, [r4, 0x20] - adds r1, r0 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815EC40 - b _0815EC12 -_0815EBF8: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r0, 1 - ldrh r3, [r4, 0x20] - adds r0, r3 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0815EC40 -_0815EC12: - movs r0, 0 - strh r0, [r4, 0x30] -_0815EC16: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815EC40 -_0815EC1E: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815EC40 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815EC40: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815EA60 - - thumb_func_start sub_815EC48 -sub_815EC48: @ 815EC48 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x26] - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815ECD0 - bl IsDoubleBattle - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x1 - bne _0815ECB4 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _0815ECAC - strh r7, [r6, 0x24] - b _0815ECD4 - .pool -_0815ECAC: - ldr r0, =0x0000ffff - b _0815ECD2 - .pool -_0815ECB4: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815ECD0 - ldr r0, =0x0000ffff - b _0815ECD2 - .pool -_0815ECD0: - movs r0, 0x1 -_0815ECD2: - strh r0, [r6, 0x24] -_0815ECD4: - ldr r0, =sub_815ECE4 - str r0, [r6] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EC48 - - thumb_func_start sub_815ECE4 -sub_815ECE4: @ 815ECE4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r3, r0, r1 - movs r1, 0x8 - ldrsh r0, [r3, r1] - cmp r0, 0x8 - bls _0815ECFE - b _0815EE78 -_0815ECFE: - lsls r0, 2 - ldr r1, =_0815ED10 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815ED10: - .4byte _0815ED34 - .4byte _0815ED46 - .4byte _0815ED78 - .4byte _0815EDA8 - .4byte _0815EDCE - .4byte _0815EDF8 - .4byte _0815EE08 - .4byte _0815EE28 - .4byte _0815EE60 -_0815ED34: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - beq _0815ED44 - b _0815EE78 -_0815ED44: - b _0815EE50 -_0815ED46: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x24 - ldrsh r0, [r3, r2] - lsls r2, r0, 1 - adds r2, r0 - ldrh r0, [r1, 0x24] - subs r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _0815ED72 - b _0815EE78 -_0815ED72: - b _0815EE50 - .pool -_0815ED78: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x24 - ldrsh r2, [r3, r0] - lsls r0, r2, 1 - adds r0, r2 - ldrh r2, [r1, 0x24] - adds r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815EE78 - b _0815EE50 - .pool -_0815EDA8: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0815EE78 - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r1, [r3, 0xC] - movs r2, 0xC - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815EE54 - adds r0, r1, 0x1 - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0x8] - b _0815EE78 -_0815EDCE: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x24] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0815EE78 - b _0815EE50 - .pool -_0815EDF8: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815EE78 - b _0815EE50 -_0815EE08: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x24 - ldrsh r2, [r3, r0] - lsls r2, 2 - ldrh r0, [r1, 0x24] - subs r0, r2 - b _0815EE40 - .pool -_0815EE28: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x24 - ldrsh r0, [r3, r2] - lsls r0, 2 - ldrh r2, [r1, 0x24] - adds r0, r2 -_0815EE40: - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815EE78 -_0815EE50: - movs r0, 0 - strh r0, [r3, 0xA] -_0815EE54: - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _0815EE78 - .pool -_0815EE60: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0815EE78: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ECE4 - - thumb_func_start sub_815EE84 -sub_815EE84: @ 815EE84 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815EEA8 - adds r0, r4, 0 - movs r1, 0x1 - bl InitAnimSpritePos - ldr r0, =gBattleAnimAttacker - b _0815EEAA - .pool -_0815EEA8: - ldr r0, =gBattleAnimTarget -_0815EEAA: - ldrb r0, [r0] - strh r0, [r4, 0x3C] - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815EECE - ldrb r0, [r4, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r4, 0x3] -_0815EECE: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A8328 - movs r2, 0x3 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - adds r0, r1, 0 - ands r0, r3 - orrs r0, r2 - strb r0, [r4, 0x5] - ldrb r0, [r4, 0x1] - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r4, 0x1] - ldr r0, =sub_815EF08 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EE84 - - thumb_func_start sub_815EF08 -sub_815EF08: @ 815EF08 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _0815EF16 - b _0815F106 -_0815EF16: - lsls r0, 2 - ldr r1, =_0815EF24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EF24: - .4byte _0815EF38 - .4byte _0815F038 - .4byte _0815F0A0 - .4byte _0815F0B4 - .4byte _0815F100 -_0815EF38: - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x5 - bhi _0815EF68 - lsls r0, 2 - ldr r1, =_0815EF50 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EF50: - .4byte _0815EF6C - .4byte _0815EF88 - .4byte _0815EFAA - .4byte _0815EFC6 - .4byte _0815EF6C - .4byte _0815EFEC -_0815EF68: - movs r0, 0 - strh r0, [r4, 0x3A] -_0815EF6C: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - b _0815EFE0 -_0815EF88: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x4 - b _0815EFE6 -_0815EFAA: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - b _0815EFE0 -_0815EFC6: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 -_0815EFE0: - bl sub_80A861C - subs r0, 0x4 -_0815EFE6: - lsls r0, 16 - lsrs r1, r0, 16 - b _0815F00C -_0815EFEC: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r1, r0, 24 -_0815F00C: - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x4 - bne _0815F018 - movs r0, 0x18 - b _0815F022 -_0815F018: - cmp r0, 0x5 - bne _0815F020 - movs r0, 0x6 - b _0815F022 -_0815F020: - movs r0, 0xC -_0815F022: - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - strh r1, [r4, 0x36] - adds r0, r4, 0 - bl InitAnimLinearTranslation - b _0815F0F8 -_0815F038: - adds r0, r4, 0 - bl TranslateAnimLinear - lsls r0, 24 - cmp r0, 0 - beq _0815F106 - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x4 - beq _0815F070 - cmp r0, 0x5 - beq _0815F090 - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x2E] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0815F088 -_0815F070: - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x38] -_0815F088: - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - b _0815F106 -_0815F090: - movs r0, 0 - strh r0, [r4, 0x2E] - movs r1, 0x10 - strh r1, [r4, 0x30] - strh r0, [r4, 0x32] - movs r0, 0x3 - strh r0, [r4, 0x38] - b _0815F106 -_0815F0A0: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815F106 - movs r0, 0 - strh r0, [r4, 0x38] - b _0815F106 -_0815F0B4: - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F0C6 - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - b _0815F0CC -_0815F0C6: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_0815F0CC: - ldrh r1, [r4, 0x32] - lsls r1, 8 - ldrh r0, [r4, 0x30] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - bne _0815F106 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815F0F8: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0815F106 -_0815F100: - adds r0, r4, 0 - bl DestroyAnimSprite -_0815F106: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815EF08 - - thumb_func_start sub_815F10C -sub_815F10C: @ 815F10C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x38 - ldrsh r1, [r4, r2] - muls r0, r1 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - adds r5, r0, 0 - strh r5, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x38 - ldrsh r1, [r4, r2] - muls r0, r1 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - adds r3, r0, 0 - strh r3, [r4, 0x26] - ldrh r1, [r4, 0x38] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F16A - ldr r0, =gUnknown_085CE3A0 - ldrh r1, [r4, 0x20] - adds r1, r5 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x22] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x5 - bl CreateSprite -_0815F16A: - movs r0, 0x38 - ldrsh r1, [r4, r0] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0815F17C - adds r0, r4, 0 - bl DestroyAnimSprite -_0815F17C: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F10C - - thumb_func_start sub_815F18C -sub_815F18C: @ 815F18C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815F1B8 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815F1D0 -_0815F1B8: - ldr r2, =gBattleAnimArgs - ldrh r1, [r5, 0x20] - ldrh r0, [r2] - subs r0, r1, r0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - subs r1, r0 - b _0815F1DE - .pool -_0815F1D0: - ldr r2, =gBattleAnimArgs - ldrh r1, [r5, 0x20] - ldrh r0, [r2] - adds r0, r1, r0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - adds r1, r0 -_0815F1DE: - strh r1, [r5, 0x32] - adds r3, r2, 0 - ldrh r1, [r5, 0x22] - ldrh r2, [r3, 0x2] - adds r2, r1, r2 - strh r2, [r5, 0x30] - ldrh r0, [r3, 0x6] - adds r1, r0 - strh r1, [r5, 0x34] - ldrh r0, [r3, 0x8] - strh r0, [r5, 0x36] - ldrh r0, [r5, 0x2E] - strh r0, [r5, 0x20] - strh r2, [r5, 0x22] - ldr r0, =sub_815F10C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F18C - - thumb_func_start AnimTask_MonToSubstitute -AnimTask_MonToSubstitute: @ 815F20C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r5, r0, 24 - adds r2, r5, 0 - ldr r0, =gTasks - mov r9, r0 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r0, 3 - mov r8, r0 - mov r4, r8 - add r4, r9 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815F254 - adds r0, r5, 0 - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _0815F2A0 - .pool -_0815F254: - cmp r0, 0x1 - bne _0815F2AC - ldrh r0, [r4, 0xA] - adds r0, 0x60 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - subs r0, 0xD - strh r0, [r4, 0xC] - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r0, 0xC - ldrsh r2, [r4, r0] - adds r0, r5, 0 - movs r3, 0 - bl SetSpriteRotScale - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815F310 - movs r0, 0 - strh r0, [r4, 0xE] - adds r0, r5, 0 - bl ResetSpriteRotScale - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0815F2A0: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815F310 - .pool -_0815F2AC: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0 - bl LoadBattleMonGfxAndAnimate - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815F2EE - ldr r3, =gSprites - ldr r2, =gBattlerSpriteIds - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF6C0 - str r1, [r0] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - bl StartSpriteAffineAnim -_0815F2EE: - mov r4, r9 - adds r3, r7, 0 - ldr r5, =sub_815F330 - movs r1, 0xF - mov r2, r8 - adds r0, r4, r2 - adds r0, 0x26 - movs r2, 0 -_0815F2FE: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _0815F2FE - adds r0, r3, r6 - lsls r0, 3 - adds r0, r4 - str r5, [r0] -_0815F310: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_MonToSubstitute - - thumb_func_start sub_815F330 -sub_815F330: @ 815F330 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _0815F394 - cmp r5, 0x1 - bgt _0815F360 - cmp r5, 0 - beq _0815F36A - b _0815F482 - .pool -_0815F360: - cmp r5, 0x2 - beq _0815F400 - cmp r5, 0x3 - beq _0815F43C - b _0815F482 -_0815F36A: - ldr r0, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x0000ff38 - strh r0, [r1, 0x26] - movs r0, 0xC8 - strh r0, [r1, 0x24] - adds r1, 0x3E - ldrb r2, [r1] - subs r0, 0xCD - ands r0, r2 - strb r0, [r1] - strh r5, [r4, 0x1C] - b _0815F42E - .pool -_0815F394: - ldrh r1, [r4, 0x1C] - adds r1, 0x70 - movs r5, 0 - strh r1, [r4, 0x1C] - ldr r2, =gSprites - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r2 - lsls r1, 16 - asrs r1, 24 - ldrh r3, [r2, 0x26] - adds r1, r3 - strh r1, [r2, 0x26] - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _0815F3C4 - strh r5, [r2, 0x24] -_0815F3C4: - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - ble _0815F3CE - strh r5, [r2, 0x26] -_0815F3CE: - movs r3, 0x26 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0815F482 - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl PlaySE12WithPanning - ldr r1, =0xfffff800 - adds r0, r1, 0 - ldrh r2, [r4, 0x1C] - adds r0, r2 - strh r0, [r4, 0x1C] - b _0815F42E - .pool -_0815F400: - ldrh r0, [r4, 0x1C] - subs r0, 0x70 - strh r0, [r4, 0x1C] - lsls r0, 16 - cmp r0, 0 - bge _0815F410 - movs r0, 0 - strh r0, [r4, 0x1C] -_0815F410: - ldr r0, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r4, 0x1C] - lsls r2, 16 - asrs r2, 24 - ldrh r0, [r1, 0x26] - subs r0, r2 - strh r0, [r1, 0x26] - movs r3, 0x1C - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0815F482 -_0815F42E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815F482 - .pool -_0815F43C: - ldrh r0, [r4, 0x1C] - adds r0, 0x70 - strh r0, [r4, 0x1C] - ldr r2, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r2 - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r1, 0x26] - adds r0, r2 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - ble _0815F460 - movs r0, 0 - strh r0, [r1, 0x26] -_0815F460: - movs r3, 0x26 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0815F482 - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl PlaySE12WithPanning - adds r0, r6, 0 - bl DestroyAnimVisualTask -_0815F482: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F330 - - thumb_func_start sub_815F48C -sub_815F48C: @ 815F48C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815F4B8 - ldrb r0, [r4] - bl GetBattlerSpriteSubpriority - subs r0, 0x2 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r4, =0x0000ff70 - b _0815F4C8 - .pool -_0815F4B8: - ldrb r0, [r4] - bl GetBattlerSpriteSubpriority - adds r0, 0x2 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r4, =0x0000ffa0 -_0815F4C8: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - strh r4, [r5, 0x26] - ldr r0, =sub_815F4F0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F48C - - thumb_func_start sub_815F4F0 -sub_815F4F0: @ 815F4F0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _0815F4FE - b _0815F61A -_0815F4FE: - lsls r0, 2 - ldr r1, =_0815F50C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815F50C: - .4byte _0815F520 - .4byte _0815F544 - .4byte _0815F584 - .4byte _0815F5B4 - .4byte _0815F5E0 -_0815F520: - ldrh r0, [r4, 0x26] - adds r0, 0xA - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - blt _0815F61A - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl PlaySE12WithPanning - movs r0, 0 - strh r0, [r4, 0x26] - b _0815F5D8 -_0815F544: - ldrh r1, [r4, 0x30] - adds r1, 0x4 - movs r5, 0 - strh r1, [r4, 0x30] - ldr r2, =gSineTable - movs r3, 0x30 - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - negs r0, r0 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _0815F61A - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl PlaySE12WithPanning - strh r5, [r4, 0x30] - strh r5, [r4, 0x26] - b _0815F5D8 - .pool -_0815F584: - ldrh r1, [r4, 0x30] - adds r1, 0x6 - movs r3, 0 - strh r1, [r4, 0x30] - ldr r2, =gSineTable - movs r5, 0x30 - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _0815F61A - strh r3, [r4, 0x30] - strh r3, [r4, 0x26] - b _0815F5D8 - .pool -_0815F5B4: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815F61A - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xC0 - bl PlaySE12WithPanning - movs r0, 0 - strh r0, [r4, 0x30] -_0815F5D8: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815F61A -_0815F5E0: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815F61A - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x32] - adds r1, 0x1 - strh r1, [r4, 0x32] - movs r0, 0x1 - ands r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bne _0815F61A - adds r0, r4, 0 - bl DestroyAnimSprite -_0815F61A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815F4F0 - - thumb_func_start sub_815F620 -sub_815F620: @ 815F620 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl IsContest - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _0815F66E - movs r0, 0x1 - bl CloneBattlerSpriteWithBlend - lsls r0, 16 - lsrs r1, r0, 16 - mov r10, r1 - asrs r6, r0, 16 - cmp r6, 0 - blt _0815F66E - movs r0, 0x1 - bl CloneBattlerSpriteWithBlend - lsls r0, 16 - lsrs r1, r0, 16 - mov r9, r1 - asrs r1, r0, 16 - cmp r1, 0 - bge _0815F67C - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl obj_delete_but_dont_free_vram -_0815F66E: - mov r0, r8 - bl DestroyAnimVisualTask - b _0815F780 - .pool -_0815F67C: - ldr r4, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r0, r4 - ldrh r0, [r5, 0x24] - adds r0, 0x18 - strh r0, [r5, 0x24] - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r6, r0, r4 - ldrh r0, [r6, 0x24] - subs r0, 0x18 - strh r0, [r6, 0x24] - strh r7, [r5, 0x2E] - strh r7, [r6, 0x2E] - strh r7, [r5, 0x30] - strh r7, [r6, 0x30] - strh r7, [r5, 0x32] - strh r7, [r6, 0x32] - movs r0, 0x10 - strh r0, [r5, 0x34] - ldr r0, =0x0000fff0 - strh r0, [r6, 0x34] - strh r7, [r5, 0x36] - movs r0, 0x80 - strh r0, [r6, 0x36] - movs r0, 0x18 - strh r0, [r5, 0x38] - strh r0, [r6, 0x38] - mov r0, r8 - strh r0, [r5, 0x3A] - strh r0, [r6, 0x3A] - strh r7, [r5, 0x3C] - strh r7, [r6, 0x3C] - ldr r2, =gTasks - mov r1, r8 - lsls r3, r1, 2 - adds r0, r3, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - ldr r0, =gBattleSpritesDataPtr - ldr r1, [r0] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - adds r7, r4, 0 - mov r12, r3 - cmp r0, 0 - bne _0815F720 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - b _0815F736 - .pool -_0815F720: - adds r1, r5, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - adds r1, r6, 0 - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] -_0815F736: - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r4, r2, r7 - ldrb r1, [r4, 0x1] - movs r3, 0xD - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4, 0x1] - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r4, r1, r7 - ldrb r0, [r4, 0x1] - ands r3, r0 - strb r3, [r4, 0x1] - adds r3, r7, 0 - adds r3, 0x1C - adds r2, r3 - ldr r0, =sub_815F7C4 - str r0, [r2] - adds r1, r3 - str r0, [r1] - mov r0, r12 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - ldr r1, =sub_815F79C - str r1, [r0] -_0815F780: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F620 - - thumb_func_start sub_815F79C -sub_815F79C: @ 815F79C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815F7BA - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0815F7BA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F79C - - thumb_func_start sub_815F7C4 -sub_815F7C4: @ 815F7C4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815F80E - movs r0, 0 - strh r0, [r4, 0x30] - ldr r0, =gBattleSpritesDataPtr - ldr r1, [r0] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F80E - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r1, r2, 29 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0815F80E: - ldrh r0, [r4, 0x34] - ldrh r1, [r4, 0x36] - adds r0, r1 - movs r5, 0 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl Cos - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815F840 - cmp r0, 0x1 - beq _0815F858 - b _0815F896 - .pool -_0815F840: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - bne _0815F896 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815F896 -_0815F858: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - ble _0815F896 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x38] - subs r0, 0x2 - strh r0, [r4, 0x38] - lsls r0, 16 - cmp r0, 0 - bge _0815F896 - ldr r3, =gTasks - movs r2, 0x3C - ldrsh r1, [r4, r2] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl obj_delete_but_dont_free_vram -_0815F896: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F7C4 - - thumb_func_start AnimTask_GetReturnPowerLevel -AnimTask_GetReturnPowerLevel: @ 815F8A0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gBattleAnimArgs - movs r2, 0 - strh r2, [r3, 0xE] - ldr r1, =gAnimFriendship - ldrb r0, [r1] - ldrb r1, [r1] - adds r0, r1, 0 - subs r0, 0x3D - lsls r0, 24 - lsrs r0, 24 - adds r2, r1, 0 - cmp r0, 0x1E - bhi _0815F8C4 - movs r0, 0x1 - strh r0, [r3, 0xE] -_0815F8C4: - adds r0, r2, 0 - subs r0, 0x5C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6C - bhi _0815F8D4 - movs r0, 0x2 - strh r0, [r3, 0xE] -_0815F8D4: - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0xC8 - bls _0815F8E0 - movs r0, 0x3 - strh r0, [r3, 0xE] -_0815F8E0: - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_GetReturnPowerLevel - - thumb_func_start sub_815F8F4 -sub_815F8F4: @ 815F8F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bls _0815F91A - b _0815FE68 -_0815F91A: - lsls r0, 2 - ldr r1, =_0815F92C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815F92C: - .4byte _0815F940 - .4byte _0815F9F4 - .4byte _0815FBE8 - .4byte _0815FD08 - .4byte _0815FD8C -_0815F940: - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r2, r8 - lsls r4, r2, 2 - adds r0, r4, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r3, 0x80 - lsls r3, 4 - adds r0, r3, 0 - ldrh r1, [r6, 0xA] - adds r0, r1 - strh r0, [r6, 0xA] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815F998 - ldr r2, =gSprites - lsls r3, r7, 4 - adds r1, r3, r7 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] - b _0815F9B2 - .pool -_0815F998: - ldr r3, =gSprites - lsls r4, r7, 4 - adds r2, r4, r7 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r6, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 -_0815F9B2: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r4, r0, r1 - ldrb r0, [r4, 0xA] - strh r0, [r4, 0xA] - adds r1, r3, r7 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 14 - adds r0, r1 - movs r1, 0x98 - lsls r1, 17 - cmp r0, r1 - bhi _0815F9DE - b _0815FE68 -_0815F9DE: - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815FE68 - .pool -_0815F9F4: - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815FA28 - ldr r0, =gContestResources - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldr r2, [r0, 0x8] - mov r10, r2 - ldr r3, [r0, 0xC] - mov r9, r3 - ldrh r6, [r0] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSpriteSubpriority - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0 - b _0815FB4E - .pool -_0815FA28: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815FAC8 - ldr r7, =gBattlerPartyIndexes - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - movs r1, 0 - bl GetMonData - mov r10, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl GetMonData - mov r9, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815FA9C - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815FA9E - .pool -_0815FA9C: - ldrh r6, [r1, 0x2] -_0815FA9E: - movs r0, 0x1 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0 - movs r5, 0x88 - lsls r5, 1 - b _0815FB50 - .pool -_0815FAC8: - ldr r7, =gBattlerPartyIndexes - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gEnemyParty - adds r0, r5 - movs r1, 0 - bl GetMonData - mov r10, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl GetMonData - mov r9, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815FB2C - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815FB2E - .pool -_0815FB2C: - ldrh r6, [r1, 0x2] -_0815FB2E: - movs r0, 0x1 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0x1 -_0815FB4E: - ldr r5, =0x0000ffe0 -_0815FB50: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - lsls r3, r5, 16 - asrs r3, 16 - str r0, [sp] - str r4, [sp, 0x4] - mov r4, r10 - str r4, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - str r0, [sp, 0x10] - movs r0, 0 - str r0, [sp, 0x14] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0 - bl sub_80A8394 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gBattleSpritesDataPtr - ldr r1, [r0] - ldrb r0, [r4] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0815FBBA - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - orrs r0, r1 - ldr r3, =0x00007fff - movs r1, 0x10 - movs r2, 0x6 - bl BlendPalette -_0815FBBA: - ldr r0, =gTasks - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - strh r5, [r1, 0x26] - b _0815FD7E - .pool -_0815FBE8: - ldr r1, =gTasks - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r0, 3 - adds r6, r0, r1 - ldrh r0, [r6, 0x26] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x80 - lsls r1, 4 - adds r0, r1, 0 - ldrh r2, [r6, 0xA] - adds r0, r2 - strh r0, [r6, 0xA] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815FC40 - ldr r3, =gSprites - lsls r4, r5, 4 - adds r2, r4, r5 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r6, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 - b _0815FC56 - .pool -_0815FC40: - ldr r2, =gSprites - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] -_0815FC56: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r6, r0, r1 - ldrb r0, [r6, 0xA] - strh r0, [r6, 0xA] - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - movs r1, 0x24 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815FCD6 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815FCB4 - lsls r4, r5, 16 - asrs r4, 16 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bge _0815FCD6 - b _0815FCCA - .pool -_0815FCB4: - lsls r4, r5, 16 - asrs r4, 16 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _0815FCD6 -_0815FCCA: - ldrh r0, [r6, 0x24] - adds r0, 0x1 - strh r0, [r6, 0x24] - ldr r1, =gBattleAnimArgs - ldr r0, =0x0000ffff - strh r0, [r1, 0xE] -_0815FCD6: - lsls r0, r5, 16 - movs r2, 0x80 - lsls r2, 14 - adds r0, r2 - movs r1, 0x98 - lsls r1, 17 - cmp r0, r1 - bhi _0815FCE8 - b _0815FE68 -_0815FCE8: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0xA] - b _0815FD7E - .pool -_0815FD08: - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r3, r8 - lsls r4, r3, 2 - adds r0, r4, r3 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x26] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl sub_80A8610 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815FD60 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r5 - ldrh r0, [r1, 0x20] - negs r0, r0 - subs r0, 0x20 - strh r0, [r1, 0x24] - b _0815FD74 - .pool -_0815FD60: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r5 - ldrh r2, [r0, 0x20] - movs r4, 0x88 - lsls r4, 1 - adds r1, r4, 0 - subs r1, r2 - strh r1, [r0, 0x24] -_0815FD74: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 -_0815FD7E: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815FE68 - .pool -_0815FD8C: - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x80 - lsls r1, 4 - adds r0, r1, 0 - ldrh r3, [r2, 0xA] - adds r0, r3 - strh r0, [r2, 0xA] - ldr r0, =gBattleAnimAttacker - mov r10, r0 - ldrb r0, [r0] - str r2, [sp, 0x18] - bl GetBattlerSide - lsls r0, 24 - mov r9, r4 - ldr r2, [sp, 0x18] - cmp r0, 0 - bne _0815FE0C - ldr r1, =gSprites - lsls r5, r7, 4 - adds r0, r5, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r6, 0x24] - adds r0, r1 - strh r0, [r6, 0x24] - movs r2, 0x24 - ldrsh r4, [r6, r2] - movs r3, 0x20 - ldrsh r0, [r6, r3] - adds r4, r0 - mov r1, r10 - ldrb r0, [r1] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r3, r5, 0 - cmp r4, r0 - blt _0815FE44 - movs r2, 0 - strh r2, [r6, 0x24] - b _0815FE44 - .pool -_0815FE0C: - ldr r1, =gSprites - lsls r5, r7, 4 - adds r0, r5, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r1, [r2, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r6, 0x24] - subs r0, r1 - strh r0, [r6, 0x24] - movs r3, 0x24 - ldrsh r4, [r6, r3] - movs r1, 0x20 - ldrsh r0, [r6, r1] - adds r4, r0 - mov r2, r10 - ldrb r0, [r2] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r3, r5, 0 - cmp r4, r0 - bgt _0815FE44 - movs r4, 0 - strh r4, [r6, 0x24] -_0815FE44: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xA] - strh r1, [r0, 0xA] - ldr r1, =gSprites - adds r0, r3, r7 - lsls r0, 2 - adds r0, r1 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815FE68 - mov r0, r8 - bl DestroyAnimVisualTask -_0815FE68: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F8F4 - - thumb_func_start sub_815FE80 -sub_815FE80: @ 815FE80 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815FE92 - cmp r0, 0x1 - beq _0815FF3A - b _0815FFBC -_0815FE92: - ldr r0, =gBattleAnimArgs - movs r2, 0xE - ldrsh r1, [r0, r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0815FF2C - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7A - bl PlaySE12WithPanning - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - strh r0, [r4, 0x22] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815FFBC - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815FFBC - movs r0, 0x1 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - b _0815FFBC - .pool -_0815FF2C: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _0815FFBC -_0815FF3A: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x30] - adds r0, r2, 0x5 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0815FF6E - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r0, r2, 0 - subs r0, 0x7A - strh r0, [r4, 0x30] -_0815FF6E: - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815FF9C - ldrh r2, [r4, 0x32] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] - adds r1, r2, 0 - b _0815FFA8 - .pool -_0815FF9C: - ldrh r1, [r4, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] -_0815FFA8: - movs r0, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x2 - bne _0815FFBC - adds r0, r4, 0 - bl DestroyAnimSprite -_0815FFBC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815FE80 - - thumb_func_start sub_815FFC4 -sub_815FFC4: @ 815FFC4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x26 - ldrsh r0, [r0, r2] - adds r3, r1, 0 - cmp r0, 0x4 - bls _0815FFE0 - b _08160132 -_0815FFE0: - lsls r0, 2 - ldr r1, =_0815FFF4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815FFF4: - .4byte _08160008 - .4byte _08160058 - .4byte _081600B4 - .4byte _081600CC - .4byte _08160132 -_08160008: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0x6 - strh r0, [r1, 0x8] - cmp r5, r2 - ble _0816003E - negs r0, r0 - strh r0, [r1, 0x8] -_0816003E: - strh r5, [r1, 0xA] - strh r2, [r1, 0xC] - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08160150 - .pool -_08160058: - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0x8] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _081600A0 - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xC - ldrsh r1, [r2, r3] - b _08160126 - .pool -_081600A0: - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xC - ldrsh r1, [r2, r3] - cmp r0, r1 - bgt _08160150 - b _0816012A -_081600B4: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r2, 0x8 - ldrsh r1, [r0, r2] - negs r1, r1 - strh r1, [r0, 0x8] - ldrh r1, [r0, 0x26] - adds r1, 0x1 - strh r1, [r0, 0x26] - b _08160150 -_081600CC: - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0x8] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - bge _08160118 - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xA - ldrsh r1, [r2, r3] - cmp r0, r1 - bgt _08160150 - b _0816012A - .pool -_08160118: - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xA - ldrsh r1, [r2, r3] -_08160126: - cmp r0, r1 - blt _08160150 -_0816012A: - ldrh r0, [r2, 0x26] - adds r0, 0x1 - strh r0, [r2, 0x26] - b _08160150 -_08160132: - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x24] - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08160150: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815FFC4 - - thumb_func_start sub_8160164 -sub_8160164: @ 8160164 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r4, r1, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0xE] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _08160198 - movs r1, 0x1 -_08160198: - strh r1, [r4, 0x10] - ldr r2, =gSprites - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x14] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x12] - strh r5, [r4, 0x1A] - strh r5, [r4, 0x1E] - movs r0, 0x1 - strh r0, [r4, 0x1C] - strh r5, [r4, 0x20] - ldr r0, =sub_81601DC - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160164 - - thumb_func_start sub_81601DC -sub_81601DC: @ 81601DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08160284 - cmp r0, 0x1 - bgt _08160204 - cmp r0, 0 - beq _0816020A - b _081602DA - .pool -_08160204: - cmp r0, 0x2 - beq _081602D4 - b _081602DA -_0816020A: - ldrh r0, [r4, 0x1E] - adds r0, 0x8 - movs r2, 0xFF - ands r0, r2 - strh r0, [r4, 0x1E] - ldr r5, =gSprites - movs r6, 0xE - ldrsh r0, [r4, r6] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldr r3, =gSineTable - movs r6, 0x1E - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - strh r0, [r1, 0x24] - ldrh r0, [r4, 0x1A] - adds r0, 0x2 - ands r0, r2 - strh r0, [r4, 0x1A] - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - movs r6, 0x1A - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x10] - muls r0, r1 - ldrh r1, [r4, 0x12] - adds r0, r1 - strh r0, [r2, 0x20] - movs r6, 0x1A - ldrsh r0, [r4, r6] - cmp r0, 0 - bne _081602DA - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r4, 0x12] - strh r1, [r0, 0x20] - b _081602C4 - .pool -_08160284: - ldrh r0, [r4, 0x1E] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x1E] - ldr r3, =gSprites - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldr r2, =gSineTable - movs r5, 0x1E - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - strh r0, [r1, 0x24] - movs r6, 0x1E - ldrsh r2, [r4, r6] - cmp r2, 0 - bne _081602DA - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - strh r2, [r1, 0x24] -_081602C4: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081602DA - .pool -_081602D4: - adds r0, r2, 0 - bl DestroyAnimVisualTask -_081602DA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81601DC - - thumb_func_start sub_81602E0 -sub_81602E0: @ 81602E0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl Cos - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl Sin - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08160326 - adds r0, r4, 0 - bl DestroyAnimSprite -_08160326: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81602E0 - - thumb_func_start sub_8160338 -sub_8160338: @ 8160338 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0816037C - ldr r2, =gBattleAnimArgs - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =0x0000fff5 - strh r0, [r4, 0x2E] - movs r0, 0xC0 - strh r0, [r4, 0x30] - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - b _08160396 - .pool -_0816037C: - movs r0, 0xB - strh r0, [r4, 0x2E] - movs r0, 0xC0 - strh r0, [r4, 0x30] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_08160396: - ldr r0, =sub_81602E0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160338 - - thumb_func_start sub_81603A8 -sub_81603A8: @ 81603A8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - strh r0, [r5, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _081603D2 - movs r0, 0x10 - strh r0, [r5, 0x22] -_081603D2: - movs r0, 0 - strh r0, [r5, 0x3A] - movs r1, 0x10 - strh r1, [r5, 0x3C] - ldr r0, =sub_81603F4 - str r0, [r5, 0x1C] - lsls r1, 8 - movs r0, 0x52 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81603A8 - - thumb_func_start sub_81603F4 -sub_81603F4: @ 81603F4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0816046C - cmp r1, 0x1 - bgt _0816040A - cmp r1, 0 - beq _08160414 - b _081604E8 -_0816040A: - cmp r1, 0x2 - beq _08160482 - cmp r1, 0x3 - beq _081604E2 - b _081604E8 -_08160414: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081604E8 - strh r1, [r4, 0x2E] - ldrh r1, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816043E - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _0816044C - adds r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _0816044C -_0816043E: - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0816044C - subs r0, r2, 0x1 - strh r0, [r4, 0x3C] -_0816044C: - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081604E8 - b _081604DA -_0816046C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _081604E8 - strh r1, [r4, 0x2E] - strh r1, [r4, 0x30] - b _081604DA -_08160482: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081604E8 - movs r0, 0 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081604AE - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _081604BC - subs r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _081604BC -_081604AE: - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _081604BC - adds r0, r2, 0x1 - strh r0, [r4, 0x3C] -_081604BC: - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081604E8 -_081604DA: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - b _081604E8 -_081604E2: - adds r0, r4, 0 - bl DestroySpriteAndMatrix -_081604E8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81603F4 - - thumb_func_start AnimTask_GetWeather -AnimTask_GetWeather: @ 81604F0 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gBattleAnimArgs - movs r0, 0 - strh r0, [r2, 0xE] - ldr r0, =gWeatherMoveAnim - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08160514 - movs r0, 0x1 - b _08160536 - .pool -_08160514: - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08160520 - movs r0, 0x2 - b _08160536 -_08160520: - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0816052C - movs r0, 0x3 - b _08160536 -_0816052C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160538 - movs r0, 0x4 -_08160536: - strh r0, [r2, 0xE] -_08160538: - adds r0, r3, 0 - bl DestroyAnimVisualTask - pop {r0} - bx r0 - thumb_func_end AnimTask_GetWeather - - thumb_func_start sub_8160544 -sub_8160544: @ 8160544 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE9C8 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldr r0, =sub_816058C - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160544 - - thumb_func_start sub_816058C -sub_816058C: @ 816058C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r2, =gTasks - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - adds r1, r0, 0x1 - movs r5, 0 - strh r1, [r3, 0x8] - subs r0, 0x10 - lsls r0, 16 - lsrs r0, 16 - adds r6, r2, 0 - cmp r0, 0x16 - bhi _081605F0 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08160600 - strh r5, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r5, 0x1 - ands r0, r5 - cmp r0, 0 - bne _081605F0 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - b _08160600 - .pool -_081605F0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] -_08160600: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _08160618 - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08160618: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816058C - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_anim_effects_3.s b/asm/battle_anim_effects_3.s new file mode 100644 index 000000000..4b9466786 --- /dev/null +++ b/asm/battle_anim_effects_3.s @@ -0,0 +1,1632 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start AnimTask_GetReturnPowerLevel +AnimTask_GetReturnPowerLevel: @ 815F8A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gBattleAnimArgs + movs r2, 0 + strh r2, [r3, 0xE] + ldr r1, =gAnimFriendship + ldrb r0, [r1] + ldrb r1, [r1] + adds r0, r1, 0 + subs r0, 0x3D + lsls r0, 24 + lsrs r0, 24 + adds r2, r1, 0 + cmp r0, 0x1E + bhi _0815F8C4 + movs r0, 0x1 + strh r0, [r3, 0xE] +_0815F8C4: + adds r0, r2, 0 + subs r0, 0x5C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6C + bhi _0815F8D4 + movs r0, 0x2 + strh r0, [r3, 0xE] +_0815F8D4: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0xC8 + bls _0815F8E0 + movs r0, 0x3 + strh r0, [r3, 0xE] +_0815F8E0: + adds r0, r4, 0 + bl DestroyAnimVisualTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end AnimTask_GetReturnPowerLevel + + thumb_func_start sub_815F8F4 +sub_815F8F4: @ 815F8F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _0815F91A + b _0815FE68 +_0815F91A: + lsls r0, 2 + ldr r1, =_0815F92C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815F92C: + .4byte _0815F940 + .4byte _0815F9F4 + .4byte _0815FBE8 + .4byte _0815FD08 + .4byte _0815FD8C +_0815F940: + movs r0, 0 + bl GetAnimBattlerSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r2, r8 + lsls r4, r2, 2 + adds r0, r4, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r3, 0x80 + lsls r3, 4 + adds r0, r3, 0 + ldrh r1, [r6, 0xA] + adds r0, r1 + strh r0, [r6, 0xA] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815F998 + ldr r2, =gSprites + lsls r3, r7, 4 + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] + b _0815F9B2 + .pool +_0815F998: + ldr r3, =gSprites + lsls r4, r7, 4 + adds r2, r4, r7 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 +_0815F9B2: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + strh r0, [r4, 0xA] + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815F9DE + b _0815FE68 +_0815F9DE: + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815FE68 + .pool +_0815F9F4: + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815FA28 + ldr r0, =gContestResources + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldr r2, [r0, 0x8] + mov r10, r2 + ldr r3, [r0, 0xC] + mov r9, r3 + ldrh r6, [r0] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSpriteSubpriority + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + b _0815FB4E + .pool +_0815FA28: + ldr r4, =gBattleAnimAttacker + ldrb r0, [r4] + bl GetBattlerSide + lsls r0, 24 + cmp r0, 0 + bne _0815FAC8 + ldr r7, =gBattlerPartyIndexes + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + movs r1, 0 + bl GetMonData + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl GetMonData + mov r9, r0 + ldr r0, =gBattleSpritesDataPtr + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FA9C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FA9E + .pool +_0815FA9C: + ldrh r6, [r1, 0x2] +_0815FA9E: + movs r0, 0x1 + bl GetAnimBattlerSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + movs r5, 0x88 + lsls r5, 1 + b _0815FB50 + .pool +_0815FAC8: + ldr r7, =gBattlerPartyIndexes + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gEnemyParty + adds r0, r5 + movs r1, 0 + bl GetMonData + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl GetMonData + mov r9, r0 + ldr r0, =gBattleSpritesDataPtr + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FB2C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FB2E + .pool +_0815FB2C: + ldrh r6, [r1, 0x2] +_0815FB2E: + movs r0, 0x1 + bl GetAnimBattlerSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0x1 +_0815FB4E: + ldr r5, =0x0000ffe0 +_0815FB50: + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0x1 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + lsls r3, r5, 16 + asrs r3, 16 + str r0, [sp] + str r4, [sp, 0x4] + mov r4, r10 + str r4, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldr r4, =gBattleAnimAttacker + ldrb r0, [r4] + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0x14] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80A8394 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gBattleSpritesDataPtr + ldr r1, [r0] + ldrb r0, [r4] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0815FBBA + ldr r1, =gSprites + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r0, r1 + ldr r3, =0x00007fff + movs r1, 0x10 + movs r2, 0x6 + bl BlendPalette +_0815FBBA: + ldr r0, =gTasks + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r5, [r1, 0x26] + b _0815FD7E + .pool +_0815FBE8: + ldr r1, =gTasks + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r2, [r6, 0xA] + adds r0, r2 + strh r0, [r6, 0xA] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FC40 + ldr r3, =gSprites + lsls r4, r5, 4 + adds r2, r4, r5 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 + b _0815FC56 + .pool +_0815FC40: + ldr r2, =gSprites + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] +_0815FC56: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrb r0, [r6, 0xA] + strh r0, [r6, 0xA] + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x24 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815FCD6 + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + cmp r0, 0 + bne _0815FCB4 + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bge _0815FCD6 + b _0815FCCA + .pool +_0815FCB4: + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _0815FCD6 +_0815FCCA: + ldrh r0, [r6, 0x24] + adds r0, 0x1 + strh r0, [r6, 0x24] + ldr r1, =gBattleAnimArgs + ldr r0, =0x0000ffff + strh r0, [r1, 0xE] +_0815FCD6: + lsls r0, r5, 16 + movs r2, 0x80 + lsls r2, 14 + adds r0, r2 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815FCE8 + b _0815FE68 +_0815FCE8: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0xA] + b _0815FD7E + .pool +_0815FD08: + movs r0, 0 + bl GetAnimBattlerSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r3, r8 + lsls r4, r3, 2 + adds r0, r4, r3 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl sub_80A8610 + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FD60 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1, 0x20] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1, 0x24] + b _0815FD74 + .pool +_0815FD60: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r5 + ldrh r2, [r0, 0x20] + movs r4, 0x88 + lsls r4, 1 + adds r1, r4, 0 + subs r1, r2 + strh r1, [r0, 0x24] +_0815FD74: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 +_0815FD7E: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815FE68 + .pool +_0815FD8C: + movs r0, 0 + bl GetAnimBattlerSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r3, [r2, 0xA] + adds r0, r3 + strh r0, [r2, 0xA] + ldr r0, =gBattleAnimAttacker + mov r10, r0 + ldrb r0, [r0] + str r2, [sp, 0x18] + bl GetBattlerSide + lsls r0, 24 + mov r9, r4 + ldr r2, [sp, 0x18] + cmp r0, 0 + bne _0815FE0C + ldr r1, =gSprites + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r6, 0x24] + adds r0, r1 + strh r0, [r6, 0x24] + movs r2, 0x24 + ldrsh r4, [r6, r2] + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r4, r0 + mov r1, r10 + ldrb r0, [r1] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + blt _0815FE44 + movs r2, 0 + strh r2, [r6, 0x24] + b _0815FE44 + .pool +_0815FE0C: + ldr r1, =gSprites + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r1, [r2, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r6, 0x24] + subs r0, r1 + strh r0, [r6, 0x24] + movs r3, 0x24 + ldrsh r4, [r6, r3] + movs r1, 0x20 + ldrsh r0, [r6, r1] + adds r4, r0 + mov r2, r10 + ldrb r0, [r2] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + bgt _0815FE44 + movs r4, 0 + strh r4, [r6, 0x24] +_0815FE44: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xA] + strh r1, [r0, 0xA] + ldr r1, =gSprites + adds r0, r3, r7 + lsls r0, 2 + adds r0, r1 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815FE68 + mov r0, r8 + bl DestroyAnimVisualTask +_0815FE68: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F8F4 + + thumb_func_start sub_815FE80 +sub_815FE80: @ 815FE80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815FE92 + cmp r0, 0x1 + beq _0815FF3A + b _0815FFBC +_0815FE92: + ldr r0, =gBattleAnimArgs + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0815FF2C + movs r0, 0x3F + bl BattleAnimAdjustPanning + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7A + bl PlaySE12WithPanning + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0x1 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + strh r0, [r4, 0x22] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815FFBC + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815FFBC + movs r0, 0x1 + bl GetAnimBattlerSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + b _0815FFBC + .pool +_0815FF2C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0815FFBC +_0815FF3A: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl Sin + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x30] + adds r0, r2, 0x5 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _0815FF6E + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r2, 0 + subs r0, 0x7A + strh r0, [r4, 0x30] +_0815FF6E: + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + cmp r0, 0 + bne _0815FF9C + ldrh r2, [r4, 0x32] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + adds r1, r2, 0 + b _0815FFA8 + .pool +_0815FF9C: + ldrh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] +_0815FFA8: + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x2 + bne _0815FFBC + adds r0, r4, 0 + bl DestroyAnimSprite +_0815FFBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815FE80 + + thumb_func_start sub_815FFC4 +sub_815FFC4: @ 815FFC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x26 + ldrsh r0, [r0, r2] + adds r3, r1, 0 + cmp r0, 0x4 + bls _0815FFE0 + b _08160132 +_0815FFE0: + lsls r0, 2 + ldr r1, =_0815FFF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815FFF4: + .4byte _08160008 + .4byte _08160058 + .4byte _081600B4 + .4byte _081600CC + .4byte _08160132 +_08160008: + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x6 + strh r0, [r1, 0x8] + cmp r5, r2 + ble _0816003E + negs r0, r0 + strh r0, [r1, 0x8] +_0816003E: + strh r5, [r1, 0xA] + strh r2, [r1, 0xC] + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08160150 + .pool +_08160058: + ldr r1, =gBattlerSpriteIds + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _081600A0 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + b _08160126 + .pool +_081600A0: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A +_081600B4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r2, 0x8 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x26] + adds r1, 0x1 + strh r1, [r0, 0x26] + b _08160150 +_081600CC: + ldr r1, =gBattlerSpriteIds + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + bge _08160118 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A + .pool +_08160118: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] +_08160126: + cmp r0, r1 + blt _08160150 +_0816012A: + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + b _08160150 +_08160132: + ldr r1, =gBattlerSpriteIds + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x24] + adds r0, r4, 0 + bl DestroyAnimVisualTask +_08160150: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815FFC4 + + thumb_func_start sub_8160164 +sub_8160164: @ 8160164 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r4, r1, r0 + movs r0, 0 + bl GetAnimBattlerSpriteId + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0xE] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08160198 + movs r1, 0x1 +_08160198: + strh r1, [r4, 0x10] + ldr r2, =gSprites + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x14] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x12] + strh r5, [r4, 0x1A] + strh r5, [r4, 0x1E] + movs r0, 0x1 + strh r0, [r4, 0x1C] + strh r5, [r4, 0x20] + ldr r0, =sub_81601DC + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160164 + + thumb_func_start sub_81601DC +sub_81601DC: @ 81601DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08160284 + cmp r0, 0x1 + bgt _08160204 + cmp r0, 0 + beq _0816020A + b _081602DA + .pool +_08160204: + cmp r0, 0x2 + beq _081602D4 + b _081602DA +_0816020A: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r2, 0xFF + ands r0, r2 + strh r0, [r4, 0x1E] + ldr r5, =gSprites + movs r6, 0xE + ldrsh r0, [r4, r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r3, =gSineTable + movs r6, 0x1E + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x1A] + adds r0, 0x2 + ands r0, r2 + strh r0, [r4, 0x1A] + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + movs r6, 0x1A + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x10] + muls r0, r1 + ldrh r1, [r4, 0x12] + adds r0, r1 + strh r0, [r2, 0x20] + movs r6, 0x1A + ldrsh r0, [r4, r6] + cmp r0, 0 + bne _081602DA + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0x12] + strh r1, [r0, 0x20] + b _081602C4 + .pool +_08160284: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x1E] + ldr r3, =gSprites + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, =gSineTable + movs r5, 0x1E + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + movs r6, 0x1E + ldrsh r2, [r4, r6] + cmp r2, 0 + bne _081602DA + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + strh r2, [r1, 0x24] +_081602C4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081602DA + .pool +_081602D4: + adds r0, r2, 0 + bl DestroyAnimVisualTask +_081602DA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81601DC + + thumb_func_start sub_81602E0 +sub_81602E0: @ 81602E0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl Cos + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl Sin + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08160326 + adds r0, r4, 0 + bl DestroyAnimSprite +_08160326: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81602E0 + + thumb_func_start sub_8160338 +sub_8160338: @ 8160338 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + cmp r0, 0 + bne _0816037C + ldr r2, =gBattleAnimArgs + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =0x0000fff5 + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim + b _08160396 + .pool +_0816037C: + movs r0, 0xB + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_08160396: + ldr r0, =sub_81602E0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160338 + + thumb_func_start sub_81603A8 +sub_81603A8: @ 81603A8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =gBattleAnimAttacker + ldrb r0, [r4] + movs r1, 0x2 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _081603D2 + movs r0, 0x10 + strh r0, [r5, 0x22] +_081603D2: + movs r0, 0 + strh r0, [r5, 0x3A] + movs r1, 0x10 + strh r1, [r5, 0x3C] + ldr r0, =sub_81603F4 + str r0, [r5, 0x1C] + lsls r1, 8 + movs r0, 0x52 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81603A8 + + thumb_func_start sub_81603F4 +sub_81603F4: @ 81603F4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0816046C + cmp r1, 0x1 + bgt _0816040A + cmp r1, 0 + beq _08160414 + b _081604E8 +_0816040A: + cmp r1, 0x2 + beq _08160482 + cmp r1, 0x3 + beq _081604E2 + b _081604E8 +_08160414: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + strh r1, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816043E + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _0816044C + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _0816044C +_0816043E: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0816044C + subs r0, r2, 0x1 + strh r0, [r4, 0x3C] +_0816044C: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081604E8 + b _081604DA +_0816046C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _081604E8 + strh r1, [r4, 0x2E] + strh r1, [r4, 0x30] + b _081604DA +_08160482: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + movs r0, 0 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081604AE + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _081604BC + subs r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _081604BC +_081604AE: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _081604BC + adds r0, r2, 0x1 + strh r0, [r4, 0x3C] +_081604BC: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081604E8 +_081604DA: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + b _081604E8 +_081604E2: + adds r0, r4, 0 + bl DestroySpriteAndMatrix +_081604E8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81603F4 + + thumb_func_start AnimTask_GetWeather +AnimTask_GetWeather: @ 81604F0 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gBattleAnimArgs + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, =gWeatherMoveAnim + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08160514 + movs r0, 0x1 + b _08160536 + .pool +_08160514: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08160520 + movs r0, 0x2 + b _08160536 +_08160520: + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0816052C + movs r0, 0x3 + b _08160536 +_0816052C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160538 + movs r0, 0x4 +_08160536: + strh r0, [r2, 0xE] +_08160538: + adds r0, r3, 0 + bl DestroyAnimVisualTask + pop {r0} + bx r0 + thumb_func_end AnimTask_GetWeather + + thumb_func_start sub_8160544 +sub_8160544: @ 8160544 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =gBattleAnimArgs + ldrb r0, [r0] + bl GetAnimBattlerSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, =gUnknown_085CE9C8 + adds r0, r4, 0 + bl PrepareAffineAnimInTaskData + ldr r0, =sub_816058C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160544 + + thumb_func_start sub_816058C +sub_816058C: @ 816058C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r2, =gTasks + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + adds r1, r0, 0x1 + movs r5, 0 + strh r1, [r3, 0x8] + subs r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + adds r6, r2, 0 + cmp r0, 0x16 + bhi _081605F0 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08160600 + strh r5, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _081605F0 + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + b _08160600 + .pool +_081605F0: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] +_08160600: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + bl RunAffineAnimFromTaskData + lsls r0, 24 + cmp r0, 0 + bne _08160618 + adds r0, r4, 0 + bl DestroyAnimVisualTask +_08160618: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816058C + + .align 2, 0 @ Don't pad with nop. diff --git a/include/battle_anim.h b/include/battle_anim.h index cdeb60e69..b25822992 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -144,6 +144,11 @@ void SetGreyscaleOrOriginalPalette(u16 a1, bool8 a2); void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds); bool8 RunAffineAnimFromTaskData(struct Task *task); void sub_80A78AC(struct Sprite *sprite); +void sub_80A6BFC(struct UnknownAnimStruct2 *unk, u8 unused); +u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, u32 a10); +void sub_80A749C(struct Sprite *sprite); +void sub_80A6814(u8 taskId); +void sub_80A8610(struct Sprite *sprite); enum { @@ -185,6 +190,7 @@ u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, // battle_anim_utility_funcs.s void sub_8116EB4(u8); +void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u8 *arg8, const u8 *arg9, const u16 *palette); u32 UnpackSelectedBattleAnimPalettes(s16); diff --git a/include/graphics.h b/include/graphics.h index a7ee286b8..48e4532ac 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4154,6 +4154,8 @@ extern const u32 gBattleAnimSpriteSheet_050[]; extern const u32 gBattleAnimSpriteSheet_051[]; extern const u32 gBattleAnimSpriteSheet_052[]; extern const u32 gBattleAnimSpriteSheet_053[]; +extern const u32 gUnknown_08C2EA50[]; +extern const u32 gUnknown_08C2EA9C[]; extern const u32 gBattleAnimSpriteSheet_054[]; extern const u32 gBattleAnimSpriteSheet_055[]; extern const u32 gBattleAnimSpriteSheet_056[]; @@ -4619,6 +4621,9 @@ extern const u32 gBattleAnimSpritePalette_241[]; extern const u32 gBattleAnimSpritePalette_242[]; extern const u32 gBattleAnimSpritePalette_243[]; extern const u32 gBattleAnimSpritePalette_244[]; +extern const u8 gUnknown_08C2DC68[]; +extern const u16 gUnknown_08C2DDA4[]; +extern const u8 gUnknown_08C2DDC4[]; extern const u32 gBattleAnimSpritePalette_245[]; extern const u32 gBattleAnimSpritePalette_248[]; extern const u32 gBattleAnimSpritePalette_249[]; @@ -4697,6 +4702,9 @@ extern const u32 gBattleAnimBackgroundTilemap_07[]; extern const u32 gBattleAnimBackgroundTilemap_08[]; extern const u32 gBattleAnimBackgroundTilemap_09[]; extern const u32 gBattleAnimBackgroundTilemap_10[]; +extern const u32 gUnknown_08C2A634[]; +extern const u32 gUnknown_08C2A6D4[]; +extern const u32 gUnknown_08C2A6EC[]; extern const u32 gBattleAnimBackgroundTilemap_11[]; extern const u32 gBattleAnimBackgroundTilemap_12[]; extern const u32 gBattleAnimBackgroundTilemap_13[]; @@ -4757,9 +4765,4 @@ extern const u32 gCableCarDoor_Gfx[]; extern const u32 gCableCarCord_Gfx[]; extern const u16 gCableCar_Pal[]; -// Battle Anim -extern const u32 gUnknown_08C2DDA4[]; -extern const u32 gUnknown_08C2EA50[]; -extern const u32 gUnknown_08C2EA9C[]; - #endif //GUARD_GRAPHICS_H diff --git a/include/scanline_effect.h b/include/scanline_effect.h index eb837e7e2..5bd8b5546 100644 --- a/include/scanline_effect.h +++ b/include/scanline_effect.h @@ -3,6 +3,7 @@ // DMA control value to transfer a single 16-bit value at HBlank #define SCANLINE_EFFECT_DMACNT_16BIT (((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_INC | DMA_16BIT | DMA_DEST_RELOAD) << 16) | 1) +#define SCANLINE_EFFECT_DMACNT_32BIT (((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_INC | DMA_32BIT | DMA_DEST_RELOAD) << 16) | 1) #define SCANLINE_EFFECT_REG_BG0HOFS (REG_ADDR_BG0HOFS - REG_ADDR_BG0HOFS) #define SCANLINE_EFFECT_REG_BG0VOFS (REG_ADDR_BG0VOFS - REG_ADDR_BG0HOFS) diff --git a/ld_script.txt b/ld_script.txt index 4b56d0f4b..b8dcee092 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -224,8 +224,8 @@ SECTIONS { src/battle_anim_sound_tasks.o(.text); src/battle_controller_safari.o(.text); src/fldeff_sweetscent.o(.text); - src/battle_anim_815A0D4.o(.text); - asm/battle_anim_815A0D4.o(.text); + src/battle_anim_effects_3.o(.text); + asm/battle_anim_effects_3.o(.text); src/learn_move.o(.text); src/fldeff_softboiled.o(.text); src/decoration_inventory.o(.text); @@ -539,7 +539,7 @@ SECTIONS { data/field_effect_helpers.o(.rodata); src/contest_ai.o(.rodata); src/battle_controller_safari.o(.rodata); - src/battle_anim_815A0D4.o(.rodata); + src/battle_anim_effects_3.o(.rodata); src/learn_move.o(.rodata); src/roamer.o(.rodata); src/battle_tower.o(.rodata); diff --git a/src/battle_anim_80A5C6C.c b/src/battle_anim_80A5C6C.c index 28196a345..15a4d2b63 100644 --- a/src/battle_anim_80A5C6C.c +++ b/src/battle_anim_80A5C6C.c @@ -906,7 +906,7 @@ void sub_80A6B90(struct UnknownAnimStruct2 *unk, u32 arg1) } } -void sub_80A6BFC(struct UnknownAnimStruct2 *unk) +void sub_80A6BFC(struct UnknownAnimStruct2 *unk, u8 unused) { unk->bgTiles = gUnknown_0202305C; unk->unk4 = (u16 *)gUnknown_02023060; diff --git a/src/battle_anim_815A0D4.c b/src/battle_anim_815A0D4.c deleted file mode 100755 index 46de0d09d..000000000 --- a/src/battle_anim_815A0D4.c +++ /dev/null @@ -1,1092 +0,0 @@ -#include "global.h" -#include "battle.h" -#include "battle_anim.h" -#include "bg.h" -#include "contest.h" -#include "data2.h" -#include "decompress.h" -#include "dma3.h" -#include "gpu_regs.h" -#include "alloc.h" -#include "palette.h" -#include "pokemon_icon.h" -#include "sprite.h" -#include "task.h" -#include "trig.h" -#include "util.h" -#include "constants/battle_anim.h" -#include "constants/species.h" - -void sub_815A0D4(struct Sprite *); -void sub_815A1B0(struct Sprite *); -void sub_815A254(struct Sprite *); -void sub_815A2F0(struct Sprite *); -void sub_815A6C4(struct Sprite *); -void sub_815A7B0(struct Sprite *); -void sub_815A7EC(struct Sprite *); -void sub_815A8AC(struct Sprite *); -void sub_815A934(struct Sprite *); -void sub_815AAA4(struct Sprite *); -void sub_815ABD0(struct Sprite *); -void sub_815ACD0(struct Sprite *); -void sub_815B27C(struct Sprite *); -void sub_815B394(struct Sprite *); -void sub_815B49C(struct Sprite *); -void sub_815B570(struct Sprite *); -void sub_815B70C(struct Sprite *); -void sub_815BE04(struct Sprite *); -void sub_815C400(struct Sprite *); -void sub_815C6B0(struct Sprite *); -void sub_815C95C(struct Sprite *); -void sub_815CB88(struct Sprite *); -void sub_815CC94(struct Sprite *); -void sub_815CDB4(struct Sprite *); -void sub_815D7B4(struct Sprite *); -void sub_815D870(struct Sprite *); -void sub_815DEBC(struct Sprite *); -void sub_815E01C(struct Sprite *); -void sub_815E404(struct Sprite *); -void sub_815E444(struct Sprite *); -void sub_815E6D8(struct Sprite *); -void sub_815E954(struct Sprite *); -void sub_815EA14(struct Sprite *); -void sub_815EE84(struct Sprite *); -void sub_815F18C(struct Sprite *); -void sub_815F48C(struct Sprite *); -void sub_815FE80(struct Sprite *); -void sub_81061C4(struct Sprite *); -void sub_8160338(struct Sprite *); -void sub_81603A8(struct Sprite *); - -const union AnimCmd gUnknown_085CE004[] = -{ - ANIMCMD_FRAME(0, 4), - ANIMCMD_FRAME(16, 4), - ANIMCMD_FRAME(32, 4), - ANIMCMD_FRAME(48, 4), - ANIMCMD_FRAME(64, 4), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE01C[] = -{ - gUnknown_085CE004, -}; - -const struct SpriteTemplate gUnknown_085CE020 = -{ - .tileTag = ANIM_TAG_SCRATCH, - .paletteTag = ANIM_TAG_SCRATCH, - .oam = &gUnknown_08524A34, - .anims = gUnknown_085CE01C, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A77C8, -}; - -const struct SpriteTemplate gUnknown_085CE038 = -{ - .tileTag = ANIM_TAG_BLACK_SMOKE, - .paletteTag = ANIM_TAG_BLACK_SMOKE, - .oam = &gUnknown_08524934, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A0D4, -}; - -const struct SpriteTemplate gUnknown_085CE050 = -{ - .tileTag = ANIM_TAG_BLACK_BALL, - .paletteTag = ANIM_TAG_BLACK_BALL, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A78AC, -}; - -const union AnimCmd gUnknown_085CE068[] = -{ - ANIMCMD_FRAME(0, 40), - ANIMCMD_FRAME(16, 8), - ANIMCMD_FRAME(32, 40), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE078[] = -{ - gUnknown_085CE068, -}; - -const struct SpriteTemplate gUnknown_085CE07C = -{ - .tileTag = ANIM_TAG_OPENING_EYE, - .paletteTag = ANIM_TAG_OPENING_EYE, - .oam = &gUnknown_08524914, - .anims = gUnknown_085CE078, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A77C8, -}; - -const struct SpriteTemplate gUnknown_085CE094 = -{ - .tileTag = ANIM_TAG_ROUND_WHITE_HALO, - .paletteTag = ANIM_TAG_ROUND_WHITE_HALO, - .oam = &gUnknown_08524A3C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A1B0, -}; - -const struct SpriteTemplate gUnknown_085CE0AC = -{ - .tileTag = ANIM_TAG_TEAL_ALERT, - .paletteTag = ANIM_TAG_TEAL_ALERT, - .oam = &gUnknown_08524974, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A254, -}; - -const union AffineAnimCmd gUnknown_085CE0C4[] = -{ - AFFINEANIMCMD_FRAME(0x180, 0x180, 0, 0), - AFFINEANIMCMD_FRAME(-0x20, 0x18, 0, 5), - AFFINEANIMCMD_FRAME(0x18, -0x20, 0, 5), - AFFINEANIMCMD_JUMP(1), -}; - -const union AffineAnimCmd gUnknown_085CE0E4[] = -{ - AFFINEANIMCMD_FRAME(0x30, 0x30, 0, 0), - AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 6), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE0FC[] = -{ - gUnknown_085CE0C4, - gUnknown_085CE0E4, -}; - -const struct SpriteTemplate gUnknown_085CE104 = -{ - .tileTag = ANIM_TAG_EYE, - .paletteTag = ANIM_TAG_EYE, - .oam = &gUnknown_08524AFC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE0FC, - .callback = sub_815A2F0, -}; - -const struct SpriteTemplate gUnknown_085CE11C = -{ - .tileTag = ANIM_TAG_SPIKES, - .paletteTag = ANIM_TAG_SPIKES, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A6C4, -}; - -const union AnimCmd gUnknown_085CE134[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_FRAME(16, 3), - ANIMCMD_FRAME(32, 3), - ANIMCMD_FRAME(48, 3), - ANIMCMD_FRAME(64, 3), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE14C[] = -{ - gUnknown_085CE134, -}; - -const struct SpriteTemplate gUnknown_085CE150 = -{ - .tileTag = ANIM_TAG_LEER, - .paletteTag = ANIM_TAG_LEER, - .oam = &gUnknown_08524914, - .anims = gUnknown_085CE14C, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A7B0, -}; - -const union AnimCmd gUnknown_085CE168[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE170[] = -{ - gUnknown_085CE168, -}; - -const union AffineAnimCmd gUnknown_085CE174[] = -{ - AFFINEANIMCMD_FRAME(-7, -7, -3, 16), - AFFINEANIMCMD_FRAME(7, 7, 3, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE18C[] = -{ - gUnknown_085CE174, -}; - -const struct SpriteTemplate gUnknown_085CE190 = -{ - .tileTag = ANIM_TAG_LETTER_Z, - .paletteTag = ANIM_TAG_LETTER_Z, - .oam = &gUnknown_08524974, - .anims = gUnknown_085CE170, - .images = NULL, - .affineAnims = gUnknown_085CE18C, - .callback = sub_815A7EC, -}; - -const union AnimCmd gUnknown_085CE1A8[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_FRAME(16, 16), - ANIMCMD_FRAME(32, 4), - ANIMCMD_FRAME(48, 4), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE1BC[] = -{ - gUnknown_085CE1A8, -}; - -const union AffineAnimCmd gUnknown_085CE1C0[] = -{ - AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), - AFFINEANIMCMD_FRAME(-0x20, -0x20, 0, 8), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE1D8[] = -{ - gUnknown_085CE1C0, -}; - -const struct SpriteTemplate gUnknown_085CE1DC = -{ - .tileTag = ANIM_TAG_FANG_ATTACK, - .paletteTag = ANIM_TAG_FANG_ATTACK, - .oam = &gUnknown_085249D4, - .anims = gUnknown_085CE1BC, - .images = NULL, - .affineAnims = gUnknown_085CE1D8, - .callback = sub_815A8AC, -}; - -const union AffineAnimCmd gUnknown_085CE1F4[] = -{ - AFFINEANIMCMD_FRAME(0x0, 0x180, 0, 0), - AFFINEANIMCMD_FRAME(0x10, 0x0, 0, 20), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE20C[] = -{ - AFFINEANIMCMD_FRAME(0x140, 0x180, 0, 0), - AFFINEANIMCMD_FRAME(-0x10, 0x0, 0, 19), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE224[] = -{ - gUnknown_085CE1F4, - gUnknown_085CE20C, -}; - -const struct SpriteTemplate gUnknown_085CE22C = -{ - .tileTag = ANIM_TAG_SPOTLIGHT, - .paletteTag = ANIM_TAG_SPOTLIGHT, - .oam = &gUnknown_085249DC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE224, - .callback = sub_815A934, -}; - -const struct SpriteTemplate gUnknown_085CE244 = -{ - .tileTag = ANIM_TAG_TAG_HAND, - .paletteTag = ANIM_TAG_TAG_HAND, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815AAA4, -}; - -const struct SpriteTemplate gUnknown_085CE25C = -{ - .tileTag = ANIM_TAG_TAG_HAND, - .paletteTag = ANIM_TAG_TAG_HAND, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815ABD0, -}; - -const union AnimCmd gUnknown_085CE274[] = -{ - ANIMCMD_FRAME(0, 2), - ANIMCMD_FRAME(8, 2), - ANIMCMD_FRAME(16, 2), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd *const gUnknown_085CE284[] = -{ - gUnknown_085CE274, -}; - -const struct SpriteTemplate gUnknown_085CE288 = -{ - .tileTag = ANIM_TAG_RAPID_SPIN, - .paletteTag = ANIM_TAG_RAPID_SPIN, - .oam = &gUnknown_08524934, - .anims = gUnknown_085CE284, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815ACD0, -}; - -const union AffineAnimCmd gUnknown_085CE2A0[] = -{ - AFFINEANIMCMD_FRAME(-12, 8, 0, 4), - AFFINEANIMCMD_FRAME(20, -20, 0, 4), - AFFINEANIMCMD_FRAME(-8, 12, 0, 4), - AFFINEANIMCMD_END, -}; - -const union AnimCmd gUnknown_085CE2C0[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE2C8[] = -{ - gUnknown_085CE2C0, -}; - -const union AffineAnimCmd gUnknown_085CE2CC[] = -{ - AFFINEANIMCMD_FRAME(0, 0, 5, 40), - AFFINEANIMCMD_FRAME(0, 0, 10, 10), - AFFINEANIMCMD_FRAME(0, 0, 15, 10), - AFFINEANIMCMD_FRAME(0, 0, 20, 40), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE2F4[] = -{ - gUnknown_085CE2CC, -}; - -const struct SpriteTemplate gUnknown_085CE2F8 = -{ - .tileTag = ANIM_TAG_TRI_FORCE_TRIANGLE, - .paletteTag = ANIM_TAG_TRI_FORCE_TRIANGLE, - .oam = &gUnknown_085249DC, - .anims = gUnknown_085CE2C8, - .images = NULL, - .affineAnims = gUnknown_085CE2F4, - .callback = sub_815B27C, -}; - -const union AnimCmd gUnknown_085CE310[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_FRAME(16, 3), - ANIMCMD_FRAME(32, 3), - ANIMCMD_FRAME(48, 3), - ANIMCMD_FRAME(32, 3, .hFlip = TRUE), - ANIMCMD_FRAME(16, 3, .hFlip = TRUE), - ANIMCMD_FRAME(0, 3, .hFlip = TRUE), - ANIMCMD_LOOP(1), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE334[] = -{ - gUnknown_085CE310, -}; - -const struct SpriteTemplate gUnknown_085CE338 = -{ - .tileTag = ANIM_TAG_ECLIPSING_ORB, - .paletteTag = ANIM_TAG_ECLIPSING_ORB, - .oam = &gUnknown_08524914, - .anims = gUnknown_085CE334, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A77C8, -}; - -const union AffineAnimCmd gUnknown_085CE350[] = -{ - AFFINEANIMCMD_FRAME(-12, 20, 0, 8), - AFFINEANIMCMD_FRAME(12, -20, 0, 8), - AFFINEANIMCMD_LOOP(2), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE370 = -{ - .tileTag = ANIM_TAG_POKEBALL, - .paletteTag = ANIM_TAG_POKEBALL, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815B394, -}; - -const struct SpriteTemplate gUnknown_085CE388 = -{ - .tileTag = ANIM_TAG_GOLD_STARS, - .paletteTag = ANIM_TAG_GOLD_STARS, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815B49C, -}; - -const struct SpriteTemplate gUnknown_085CE3A0 = -{ - .tileTag = ANIM_TAG_GOLD_STARS, - .paletteTag = ANIM_TAG_GOLD_STARS, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815B570, -}; - -const union AffineAnimCmd gUnknown_085CE3B8[] = -{ - AFFINEANIMCMD_FRAME(8, -8, 0, 12), - AFFINEANIMCMD_FRAME(-16, 16, 0, 12), - AFFINEANIMCMD_FRAME(8, -8, 0, 12), - AFFINEANIMCMD_LOOP(1), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE3E0[] = -{ - AFFINEANIMCMD_FRAME(0, 6, 0, 20), - AFFINEANIMCMD_FRAME(0, 0, 0, 20), - AFFINEANIMCMD_FRAME(0, -18, 0, 6), - AFFINEANIMCMD_FRAME(-18, -18, 0, 3), - AFFINEANIMCMD_FRAME(0, 0, 0, 15), - AFFINEANIMCMD_FRAME(4, 4, 0, 13), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE418 = -{ - .tileTag = ANIM_TAG_BLUE_ORB, - .paletteTag = ANIM_TAG_BLUE_ORB, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815B70C, -}; - -const union AffineAnimCmd gUnknown_085CE430[] = -{ - AFFINEANIMCMD_FRAME(0, 6, 0, 20), - AFFINEANIMCMD_FRAME(0, 0, 0, 20), - AFFINEANIMCMD_FRAME(7, -30, 0, 6), - AFFINEANIMCMD_FRAME(0, 0, 0, 20), - AFFINEANIMCMD_FRAME(-2, 3, 0, 20), - AFFINEANIMCMD_END, -}; - -const s8 gUnknown_085CE460[] = -{ - 0xE8, - 0x18, - 0xFC, - 0x00, -}; - -const union AnimCmd gUnknown_085CE464[] = -{ - ANIMCMD_FRAME(0, 6), - ANIMCMD_FRAME(4, 6), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_085CE470[] = -{ - ANIMCMD_FRAME(8, 6), - ANIMCMD_END, -}; - -const union AnimCmd gUnknown_085CE478[] = -{ - ANIMCMD_FRAME(12, 6), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE480[] = -{ - gUnknown_085CE464, - gUnknown_085CE470, - gUnknown_085CE478, -}; - -const struct SpriteTemplate gUnknown_085CE48C = -{ - .tileTag = ANIM_TAG_GREEN_STAR, - .paletteTag = ANIM_TAG_GREEN_STAR, - .oam = &gUnknown_0852490C, - .anims = gUnknown_085CE480, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815BE04, -}; - -const s8 gUnknown_085CE4A4[] = -{ - 0x78, - 0x50, - 0x28, - 0x00, -}; - -const u8 gUnknown_085CE4A8[] = -{ - 0, - 0, - 0, - 0, - 50, -}; - -const union AffineAnimCmd gUnknown_085CE4B0[] = -{ - AFFINEANIMCMD_FRAME(0, -15, 0, 7), - AFFINEANIMCMD_FRAME(0, 15, 0, 7), - AFFINEANIMCMD_LOOP(2), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE4D0 = -{ - .tileTag = ANIM_TAG_ANGER, - .paletteTag = ANIM_TAG_ANGER, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815C400, -}; - -const union AnimCmd gUnknown_085CE4E8[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_FRAME(1, 8), - ANIMCMD_FRAME(2, 8), - ANIMCMD_FRAME(3, 8), - ANIMCMD_FRAME(3, 8, .vFlip = TRUE), - ANIMCMD_FRAME(2, 8, .vFlip = TRUE), - ANIMCMD_FRAME(0, 8, .vFlip = TRUE), - ANIMCMD_FRAME(1, 8, .vFlip = TRUE), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_085CE50C[] = -{ - ANIMCMD_FRAME(0, 8, .hFlip = TRUE), - ANIMCMD_FRAME(1, 8, .hFlip = TRUE), - ANIMCMD_FRAME(2, 8, .hFlip = TRUE), - ANIMCMD_FRAME(3, 8, .hFlip = TRUE), - ANIMCMD_FRAME(3, 8, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(2, 8, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(0, 8, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(1, 8, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_085CE530[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE538[] = -{ - gUnknown_085CE4E8, - gUnknown_085CE50C, - gUnknown_085CE530, -}; - -const struct SpriteTemplate gUnknown_085CE544 = -{ - .tileTag = ANIM_TAG_PINK_PETAL, - .paletteTag = ANIM_TAG_PINK_PETAL, - .oam = &gUnknown_08524904, - .anims = gUnknown_085CE538, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815C6B0, -}; - -const u16 gUnknown_085CE55C[] = INCBIN_U16("graphics/unknown/unknown_85CE55C.gbapal"); - -const union AnimCmd gUnknown_085CE57C[] = -{ - ANIMCMD_FRAME(0, 5), - ANIMCMD_FRAME(4, 9), - ANIMCMD_FRAME(8, 5), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE58C[] = -{ - gUnknown_085CE57C, -}; - -const struct SpriteTemplate gUnknown_085CE590 = -{ - .tileTag = ANIM_TAG_PAIN_SPLIT, - .paletteTag = ANIM_TAG_PAIN_SPLIT, - .oam = &gUnknown_0852490C, - .anims = gUnknown_085CE58C, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815C95C, -}; - -const struct SpriteTemplate gUnknown_085CE5A8 = -{ - .tileTag = ANIM_TAG_CONFETTI, - .paletteTag = ANIM_TAG_CONFETTI, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815CB88, -}; - -const struct SpriteTemplate gUnknown_085CE5C0 = -{ - .tileTag = ANIM_TAG_SPOTLIGHT, - .paletteTag = ANIM_TAG_SPOTLIGHT, - .oam = &gUnknown_085249DC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE224, - .callback = sub_815CC94, -}; - -const struct SpriteTemplate gBattleAnimSpriteTemplate_85CE5D8 = -{ - .tileTag = ANIM_TAG_BLUE_ORB, - .paletteTag = ANIM_TAG_BLUE_ORB, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815CDB4, -}; - -const union AffineAnimCmd gUnknown_085CE5F0[] = -{ - AFFINEANIMCMD_FRAME(16, 0, 0, 4), - AFFINEANIMCMD_FRAME(0, -3, 0, 16), - AFFINEANIMCMD_FRAME(4, 0, 0, 4), - AFFINEANIMCMD_FRAME(0, 0, 0, 24), - AFFINEANIMCMD_FRAME(-5, 3, 0, 16), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE620[] = -{ - AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), - AFFINEANIMCMD_FRAME(-8, -8, 0, 8), - AFFINEANIMCMD_FRAME(8, 8, 0, 8), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE640[] = -{ - AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), - AFFINEANIMCMD_FRAME(8, 8, 0, 8), - AFFINEANIMCMD_FRAME(-8, -8, 0, 8), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE660[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(8, 8, 0, 8), - AFFINEANIMCMD_FRAME(-8, -8, 0, 8), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE680[] = -{ - gUnknown_085CE620, - gUnknown_085CE640, - gUnknown_085CE660, -}; - -const struct SpriteTemplate gUnknown_085CE68C = -{ - .tileTag = ANIM_TAG_PINK_CLOUD, - .paletteTag = ANIM_TAG_PINK_CLOUD, - .oam = &gUnknown_08524974, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE680, - .callback = sub_815D7B4, -}; - -const union AffineAnimCmd gUnknown_085CE6A4[] = -{ - AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), - AFFINEANIMCMD_FRAME(-4, -6, 0, 16), - AFFINEANIMCMD_FRAME(4, 6, 0, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE6C4[] = -{ - AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), - AFFINEANIMCMD_FRAME(4, 6, 0, 16), - AFFINEANIMCMD_FRAME(-4, -6, 0, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE6E4[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(4, 6, 0, 16), - AFFINEANIMCMD_FRAME(-4, -6, 0, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE704[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(8, 10, 0, 30), - AFFINEANIMCMD_FRAME(-8, -10, 0, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE724[] = -{ - gUnknown_085CE6A4, - gUnknown_085CE6C4, - gUnknown_085CE6E4, - gUnknown_085CE704, -}; - -const struct SpriteTemplate gUnknown_085CE734 = -{ - .tileTag = ANIM_TAG_PINK_CLOUD, - .paletteTag = ANIM_TAG_PINK_CLOUD, - .oam = &gUnknown_085249D4, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE724, - .callback = sub_815D870, -}; - -const union AffineAnimCmd gUnknown_085CE74C[] = -{ - AFFINEANIMCMD_FRAME(-16, 16, 0, 6), - AFFINEANIMCMD_FRAME(16, -16, 0, 12), - AFFINEANIMCMD_FRAME(-16, 16, 0, 6), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE76C = -{ - .tileTag = ANIM_TAG_SWEAT_DROP, - .paletteTag = ANIM_TAG_SWEAT_DROP, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815DEBC, -}; - -const u16 gUnknown_085CE784[] = INCBIN_U16("graphics/battle_anims/sprites/effect.gbapal"); - -const union AnimCmd gUnknown_085CE7B4[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_FRAME(16, 3), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_085CE7C0[] = -{ - ANIMCMD_FRAME(32, 3), - ANIMCMD_FRAME(48, 3), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd *const gUnknown_085CE7CC[] = -{ - gUnknown_085CE7B4, - gUnknown_085CE7C0, -}; - -const struct SpriteTemplate gUnknown_085CE7D4 = -{ - .tileTag = ANIM_TAG_NOISE_LINE, - .paletteTag = ANIM_TAG_NOISE_LINE, - .oam = &gUnknown_08524914, - .anims = gUnknown_085CE7CC, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E01C, -}; - -const struct SpriteTemplate gUnknown_085CE7EC = -{ - .tileTag = ANIM_TAG_SMALL_RED_EYE, - .paletteTag = ANIM_TAG_SMALL_RED_EYE, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E404, -}; - -const struct SpriteTemplate gUnknown_085CE804 = -{ - .tileTag = ANIM_TAG_PAW_PRINT, - .paletteTag = ANIM_TAG_PAW_PRINT, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E444, -}; - -const union AffineAnimCmd gUnknown_085CE81C[] = -{ - AFFINEANIMCMD_FRAME(0, 0, -4, 24), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE82C[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, -64, 0), - AFFINEANIMCMD_FRAME(0, 0, 4, 24), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE844[] = -{ - gUnknown_085CE81C, - gUnknown_085CE82C, -}; - -const struct SpriteTemplate gUnknown_085CE84C = -{ - .tileTag = ANIM_TAG_RED_BALL, - .paletteTag = ANIM_TAG_RED_BALL, - .oam = &gUnknown_08524974, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE844, - .callback = SpriteCallbackDummy, -}; - -const struct SpriteTemplate gUnknown_085CE864 = -{ - .tileTag = ANIM_TAG_TAG_HAND, - .paletteTag = ANIM_TAG_TAG_HAND, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E6D8, -}; - -const union AffineAnimCmd gUnknown_085CE87C[] = -{ - AFFINEANIMCMD_FRAME(0, -16, 0, 6), - AFFINEANIMCMD_FRAME(0, 16, 0, 6), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE894 = -{ - .tileTag = ANIM_TAG_SMELLINGSALT_EFFECT, - .paletteTag = ANIM_TAG_SMELLINGSALT_EFFECT, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E954, -}; - -const struct SpriteTemplate gUnknown_085CE8AC = -{ - .tileTag = ANIM_TAG_TAG_HAND, - .paletteTag = ANIM_TAG_TAG_HAND, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815EA14, -}; - -const struct SpriteTemplate gUnknown_085CE8C4 = -{ - .tileTag = ANIM_TAG_MAGNIFYING_GLASS, - .paletteTag = ANIM_TAG_MAGNIFYING_GLASS, - .oam = &gUnknown_08524A34, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815EE84, -}; - -const struct SpriteTemplate gUnknown_085CE8DC = -{ - .tileTag = ANIM_TAG_GOLD_STARS, - .paletteTag = ANIM_TAG_GOLD_STARS, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815F18C, -}; - -const struct SpriteTemplate gUnknown_085CE8F4 = -{ - .tileTag = ANIM_TAG_GOLD_STARS, - .paletteTag = ANIM_TAG_GOLD_STARS, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81061C4, -}; - -const struct SpriteTemplate gUnknown_085CE90C = -{ - .tileTag = ANIM_TAG_X_SIGN, - .paletteTag = ANIM_TAG_X_SIGN, - .oam = &gUnknown_0852491C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815F48C, -}; - -const struct SpriteTemplate gUnknown_085CE924 = -{ - .tileTag = ANIM_TAG_ITEM_BAG, - .paletteTag = ANIM_TAG_ITEM_BAG, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815FE80, -}; - -const union AnimCmd gUnknown_085CE93C[] = -{ - ANIMCMD_FRAME(0, 4), - ANIMCMD_FRAME(64, 4), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE948[] = -{ - gUnknown_085CE93C, -}; - -const union AffineAnimCmd gUnknown_085CE94C[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(0, 0, -4, 8), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE964[] = -{ - AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(0, 0, 4, 8), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE97C[] = -{ - gUnknown_085CE94C, - gUnknown_085CE964, -}; - -const struct SpriteTemplate gUnknown_085CE984 = -{ - .tileTag = ANIM_TAG_SLAM_HIT_2, - .paletteTag = ANIM_TAG_SLAM_HIT_2, - .oam = &gUnknown_0852497C, - .anims = gUnknown_085CE948, - .images = NULL, - .affineAnims = gUnknown_085CE97C, - .callback = sub_8160338, -}; - -const union AffineAnimCmd gUnknown_085CE99C[] = -{ - AFFINEANIMCMD_FRAME(0, 0, -4, 64), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE9AC[] = -{ - gUnknown_085CE99C, -}; - -const struct SpriteTemplate gUnknown_085CE9B0 = -{ - .tileTag = ANIM_TAG_RECYCLE, - .paletteTag = ANIM_TAG_RECYCLE, - .oam = &gUnknown_08524A9C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE9AC, - .callback = sub_81603A8, -}; - -const union AffineAnimCmd gUnknown_085CE9C8[] = -{ - AFFINEANIMCMD_FRAME(0, 16, 0, 4), - AFFINEANIMCMD_FRAME(-2, 0, 0, 8), - AFFINEANIMCMD_FRAME(0, 4, 0, 4), - AFFINEANIMCMD_FRAME(0, 0, 0, 24), - AFFINEANIMCMD_FRAME(1, -5, 0, 16), - AFFINEANIMCMD_END, -}; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c new file mode 100755 index 000000000..5f65cb31f --- /dev/null +++ b/src/battle_anim_effects_3.c @@ -0,0 +1,4889 @@ +#include "global.h" +#include "alloc.h" +#include "battle.h" +#include "battle_anim.h" +#include "bg.h" +#include "contest.h" +#include "data2.h" +#include "decompress.h" +#include "dma3.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "palette.h" +#include "pokemon_icon.h" +#include "random.h" +#include "scanline_effect.h" +#include "sound.h" +#include "sprite.h" +#include "task.h" +#include "trig.h" +#include "util.h" +#include "constants/battle_anim.h" +#include "constants/rgb.h" +#include "constants/songs.h" +#include "constants/species.h" + +extern u8 sub_807521C(s16 x, s16 y, u8 a3); +extern void sub_810E2C8(struct Sprite *); + +extern const struct SpriteTemplate gUnknown_08593114; +extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; +extern const union AffineAnimCmd *const gUnknown_082FF694[]; + +void sub_815A0D4(struct Sprite *); +void sub_815A1B0(struct Sprite *); +void sub_815A254(struct Sprite *); +void sub_815A2F0(struct Sprite *); +void sub_815A6C4(struct Sprite *); +void sub_815A7B0(struct Sprite *); +void sub_815A7EC(struct Sprite *); +void sub_815A8AC(struct Sprite *); +void sub_815A934(struct Sprite *); +void sub_815AAA4(struct Sprite *); +void sub_815ABD0(struct Sprite *); +void sub_815ACD0(struct Sprite *); +void sub_815B27C(struct Sprite *); +void sub_815B394(struct Sprite *); +void sub_815B49C(struct Sprite *); +void sub_815B570(struct Sprite *); +void sub_815B70C(struct Sprite *); +void sub_815BE04(struct Sprite *); +void sub_815C400(struct Sprite *); +void sub_815C6B0(struct Sprite *); +void sub_815C95C(struct Sprite *); +void sub_815CB88(struct Sprite *); +void sub_815CC94(struct Sprite *); +void sub_815CDB4(struct Sprite *); +void sub_815D7B4(struct Sprite *); +void sub_815D870(struct Sprite *); +void sub_815DEBC(struct Sprite *); +void sub_815E01C(struct Sprite *); +void sub_815E404(struct Sprite *); +void sub_815E444(struct Sprite *); +void sub_815E6D8(struct Sprite *); +void sub_815E954(struct Sprite *); +void sub_815EA14(struct Sprite *); +void sub_815EE84(struct Sprite *); +void sub_815F18C(struct Sprite *); +void sub_815F48C(struct Sprite *); +void sub_815FE80(struct Sprite *); +void sub_81061C4(struct Sprite *); +void sub_8160338(struct Sprite *); +void sub_81603A8(struct Sprite *); +static void sub_815A114(struct Sprite *); +static void sub_815A1F4(struct Sprite *); +static void sub_815A234(struct Sprite *); +static void sub_815A31C(struct Sprite *); +static void sub_815A3AC(struct Sprite *); +static void sub_815A3F0(struct Sprite *); +static void sub_815A49C(struct Sprite *); +static void sub_815A52C(u8); +static void sub_815A5F0(u8); +static void sub_815A73C(struct Sprite *); +static void sub_815A76C(struct Sprite *); +static void sub_815A9A0(struct Sprite *); +static void sub_815AA6C(struct Sprite *); +static void sub_815AB5C(struct Sprite *); +static void sub_815AD4C(struct Sprite *); +static void sub_815AED8(u8); +static void sub_815B054(u8); +static void sub_815B23C(struct Sprite *); +static void sub_815B4D4(struct Sprite *); +static void sub_815B5D0(struct Sprite *); +static void sub_815BF44(struct Sprite *); +static void sub_815BFF4(struct Sprite *); +static void sub_815C050(struct Sprite *); +static void sub_815C548(u8); +static void sub_815C700(struct Sprite *); +static void sub_815C7C4(u8); +static void sub_815CC34(struct Sprite *); +static void sub_815CD0C(struct Sprite *); +static void sub_815CDFC(struct Sprite *); +static void sub_815D1BC(u8); +static void sub_815D398(u8); +static void sub_815D694(u8); +static void sub_815D804(struct Sprite *); +static void sub_815DD48(u8); +static void sub_815DDE0(u8, bool8); +static void sub_815DF64(u8); +static void sub_815E0DC(struct Sprite *); +static void sub_815E20C(u8); +static void sub_815E34C(s16, s16, s16, s16, u8, u8, s16 *, s16 *); +static void sub_815E5CC(u8); +static void sub_815E784(struct Sprite *); +static void sub_815E898(u8); +static void sub_815E9BC(struct Sprite *); +static void sub_815EA60(struct Sprite *); +static void sub_815ECE4(u8); +static void sub_815EF08(struct Sprite *); +static void sub_815F330(u8); +static void sub_815F4F0(struct Sprite *); +static void sub_815F79C(u8); +static void sub_815F7C4(struct Sprite *); + +const union AnimCmd gUnknown_085CE004[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(16, 4), + ANIMCMD_FRAME(32, 4), + ANIMCMD_FRAME(48, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE01C[] = +{ + gUnknown_085CE004, +}; + +const struct SpriteTemplate gUnknown_085CE020 = +{ + .tileTag = ANIM_TAG_SCRATCH, + .paletteTag = ANIM_TAG_SCRATCH, + .oam = &gUnknown_08524A34, + .anims = gUnknown_085CE01C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const struct SpriteTemplate gUnknown_085CE038 = +{ + .tileTag = ANIM_TAG_BLACK_SMOKE, + .paletteTag = ANIM_TAG_BLACK_SMOKE, + .oam = &gUnknown_08524934, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A0D4, +}; + +const struct SpriteTemplate gUnknown_085CE050 = +{ + .tileTag = ANIM_TAG_BLACK_BALL, + .paletteTag = ANIM_TAG_BLACK_BALL, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A78AC, +}; + +const union AnimCmd gUnknown_085CE068[] = +{ + ANIMCMD_FRAME(0, 40), + ANIMCMD_FRAME(16, 8), + ANIMCMD_FRAME(32, 40), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE078[] = +{ + gUnknown_085CE068, +}; + +const struct SpriteTemplate gUnknown_085CE07C = +{ + .tileTag = ANIM_TAG_OPENING_EYE, + .paletteTag = ANIM_TAG_OPENING_EYE, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE078, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const struct SpriteTemplate gUnknown_085CE094 = +{ + .tileTag = ANIM_TAG_ROUND_WHITE_HALO, + .paletteTag = ANIM_TAG_ROUND_WHITE_HALO, + .oam = &gUnknown_08524A3C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A1B0, +}; + +const struct SpriteTemplate gUnknown_085CE0AC = +{ + .tileTag = ANIM_TAG_TEAL_ALERT, + .paletteTag = ANIM_TAG_TEAL_ALERT, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A254, +}; + +const union AffineAnimCmd gUnknown_085CE0C4[] = +{ + AFFINEANIMCMD_FRAME(0x180, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(-0x20, 0x18, 0, 5), + AFFINEANIMCMD_FRAME(0x18, -0x20, 0, 5), + AFFINEANIMCMD_JUMP(1), +}; + +const union AffineAnimCmd gUnknown_085CE0E4[] = +{ + AFFINEANIMCMD_FRAME(0x30, 0x30, 0, 0), + AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 6), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE0FC[] = +{ + gUnknown_085CE0C4, + gUnknown_085CE0E4, +}; + +const struct SpriteTemplate gUnknown_085CE104 = +{ + .tileTag = ANIM_TAG_EYE, + .paletteTag = ANIM_TAG_EYE, + .oam = &gUnknown_08524AFC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE0FC, + .callback = sub_815A2F0, +}; + +const struct SpriteTemplate gUnknown_085CE11C = +{ + .tileTag = ANIM_TAG_SPIKES, + .paletteTag = ANIM_TAG_SPIKES, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A6C4, +}; + +const union AnimCmd gUnknown_085CE134[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_FRAME(64, 3), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE14C[] = +{ + gUnknown_085CE134, +}; + +const struct SpriteTemplate gUnknown_085CE150 = +{ + .tileTag = ANIM_TAG_LEER, + .paletteTag = ANIM_TAG_LEER, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE14C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A7B0, +}; + +const union AnimCmd gUnknown_085CE168[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE170[] = +{ + gUnknown_085CE168, +}; + +const union AffineAnimCmd gUnknown_085CE174[] = +{ + AFFINEANIMCMD_FRAME(-7, -7, -3, 16), + AFFINEANIMCMD_FRAME(7, 7, 3, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE18C[] = +{ + gUnknown_085CE174, +}; + +const struct SpriteTemplate gUnknown_085CE190 = +{ + .tileTag = ANIM_TAG_LETTER_Z, + .paletteTag = ANIM_TAG_LETTER_Z, + .oam = &gUnknown_08524974, + .anims = gUnknown_085CE170, + .images = NULL, + .affineAnims = gUnknown_085CE18C, + .callback = sub_815A7EC, +}; + +const union AnimCmd gUnknown_085CE1A8[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(16, 16), + ANIMCMD_FRAME(32, 4), + ANIMCMD_FRAME(48, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE1BC[] = +{ + gUnknown_085CE1A8, +}; + +const union AffineAnimCmd gUnknown_085CE1C0[] = +{ + AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), + AFFINEANIMCMD_FRAME(-0x20, -0x20, 0, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE1D8[] = +{ + gUnknown_085CE1C0, +}; + +const struct SpriteTemplate gUnknown_085CE1DC = +{ + .tileTag = ANIM_TAG_FANG_ATTACK, + .paletteTag = ANIM_TAG_FANG_ATTACK, + .oam = &gUnknown_085249D4, + .anims = gUnknown_085CE1BC, + .images = NULL, + .affineAnims = gUnknown_085CE1D8, + .callback = sub_815A8AC, +}; + +const union AffineAnimCmd gUnknown_085CE1F4[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(0x10, 0x0, 0, 20), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE20C[] = +{ + AFFINEANIMCMD_FRAME(0x140, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(-0x10, 0x0, 0, 19), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE224[] = +{ + gUnknown_085CE1F4, + gUnknown_085CE20C, +}; + +const struct SpriteTemplate gUnknown_085CE22C = +{ + .tileTag = ANIM_TAG_SPOTLIGHT, + .paletteTag = ANIM_TAG_SPOTLIGHT, + .oam = &gUnknown_085249DC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE224, + .callback = sub_815A934, +}; + +const struct SpriteTemplate gUnknown_085CE244 = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815AAA4, +}; + +const struct SpriteTemplate gUnknown_085CE25C = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815ABD0, +}; + +const union AnimCmd gUnknown_085CE274[] = +{ + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(8, 2), + ANIMCMD_FRAME(16, 2), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd *const gUnknown_085CE284[] = +{ + gUnknown_085CE274, +}; + +const struct SpriteTemplate gUnknown_085CE288 = +{ + .tileTag = ANIM_TAG_RAPID_SPIN, + .paletteTag = ANIM_TAG_RAPID_SPIN, + .oam = &gUnknown_08524934, + .anims = gUnknown_085CE284, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815ACD0, +}; + +const union AffineAnimCmd gUnknown_085CE2A0[] = +{ + AFFINEANIMCMD_FRAME(-12, 8, 0, 4), + AFFINEANIMCMD_FRAME(20, -20, 0, 4), + AFFINEANIMCMD_FRAME(-8, 12, 0, 4), + AFFINEANIMCMD_END, +}; + +const union AnimCmd gUnknown_085CE2C0[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE2C8[] = +{ + gUnknown_085CE2C0, +}; + +const union AffineAnimCmd gUnknown_085CE2CC[] = +{ + AFFINEANIMCMD_FRAME(0, 0, 5, 40), + AFFINEANIMCMD_FRAME(0, 0, 10, 10), + AFFINEANIMCMD_FRAME(0, 0, 15, 10), + AFFINEANIMCMD_FRAME(0, 0, 20, 40), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE2F4[] = +{ + gUnknown_085CE2CC, +}; + +const struct SpriteTemplate gUnknown_085CE2F8 = +{ + .tileTag = ANIM_TAG_TRI_FORCE_TRIANGLE, + .paletteTag = ANIM_TAG_TRI_FORCE_TRIANGLE, + .oam = &gUnknown_085249DC, + .anims = gUnknown_085CE2C8, + .images = NULL, + .affineAnims = gUnknown_085CE2F4, + .callback = sub_815B27C, +}; + +const union AnimCmd gUnknown_085CE310[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_FRAME(32, 3, .hFlip = TRUE), + ANIMCMD_FRAME(16, 3, .hFlip = TRUE), + ANIMCMD_FRAME(0, 3, .hFlip = TRUE), + ANIMCMD_LOOP(1), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE334[] = +{ + gUnknown_085CE310, +}; + +const struct SpriteTemplate gUnknown_085CE338 = +{ + .tileTag = ANIM_TAG_ECLIPSING_ORB, + .paletteTag = ANIM_TAG_ECLIPSING_ORB, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE334, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const union AffineAnimCmd gUnknown_085CE350[] = +{ + AFFINEANIMCMD_FRAME(-12, 20, 0, 8), + AFFINEANIMCMD_FRAME(12, -20, 0, 8), + AFFINEANIMCMD_LOOP(2), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE370 = +{ + .tileTag = ANIM_TAG_POKEBALL, + .paletteTag = ANIM_TAG_POKEBALL, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B394, +}; + +const struct SpriteTemplate gUnknown_085CE388 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B49C, +}; + +const struct SpriteTemplate gUnknown_085CE3A0 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B570, +}; + +const union AffineAnimCmd gUnknown_085CE3B8[] = +{ + AFFINEANIMCMD_FRAME(8, -8, 0, 12), + AFFINEANIMCMD_FRAME(-16, 16, 0, 12), + AFFINEANIMCMD_FRAME(8, -8, 0, 12), + AFFINEANIMCMD_LOOP(1), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE3E0[] = +{ + AFFINEANIMCMD_FRAME(0, 6, 0, 20), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(0, -18, 0, 6), + AFFINEANIMCMD_FRAME(-18, -18, 0, 3), + AFFINEANIMCMD_FRAME(0, 0, 0, 15), + AFFINEANIMCMD_FRAME(4, 4, 0, 13), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE418 = +{ + .tileTag = ANIM_TAG_BLUE_ORB, + .paletteTag = ANIM_TAG_BLUE_ORB, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B70C, +}; + +const union AffineAnimCmd gUnknown_085CE430[] = +{ + AFFINEANIMCMD_FRAME(0, 6, 0, 20), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(7, -30, 0, 6), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(-2, 3, 0, 20), + AFFINEANIMCMD_END, +}; + +const s8 gUnknown_085CE460[] = +{ + 0xE8, + 0x18, + 0xFC, + 0x00, +}; + +const union AnimCmd gUnknown_085CE464[] = +{ + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(4, 6), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE470[] = +{ + ANIMCMD_FRAME(8, 6), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_085CE478[] = +{ + ANIMCMD_FRAME(12, 6), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE480[] = +{ + gUnknown_085CE464, + gUnknown_085CE470, + gUnknown_085CE478, +}; + +const struct SpriteTemplate gUnknown_085CE48C = +{ + .tileTag = ANIM_TAG_GREEN_STAR, + .paletteTag = ANIM_TAG_GREEN_STAR, + .oam = &gUnknown_0852490C, + .anims = gUnknown_085CE480, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815BE04, +}; + +const s8 gUnknown_085CE4A4[] = +{ + 0x78, + 0x50, + 0x28, + 0x00, +}; + +const u8 gUnknown_085CE4A8[] = +{ + 0, + 0, + 0, + 0, + 50, +}; + +const union AffineAnimCmd gUnknown_085CE4B0[] = +{ + AFFINEANIMCMD_FRAME(0, -15, 0, 7), + AFFINEANIMCMD_FRAME(0, 15, 0, 7), + AFFINEANIMCMD_LOOP(2), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE4D0 = +{ + .tileTag = ANIM_TAG_ANGER, + .paletteTag = ANIM_TAG_ANGER, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C400, +}; + +const union AnimCmd gUnknown_085CE4E8[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(1, 8), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(3, 8), + ANIMCMD_FRAME(3, 8, .vFlip = TRUE), + ANIMCMD_FRAME(2, 8, .vFlip = TRUE), + ANIMCMD_FRAME(0, 8, .vFlip = TRUE), + ANIMCMD_FRAME(1, 8, .vFlip = TRUE), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE50C[] = +{ + ANIMCMD_FRAME(0, 8, .hFlip = TRUE), + ANIMCMD_FRAME(1, 8, .hFlip = TRUE), + ANIMCMD_FRAME(2, 8, .hFlip = TRUE), + ANIMCMD_FRAME(3, 8, .hFlip = TRUE), + ANIMCMD_FRAME(3, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(2, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(0, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(1, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE530[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE538[] = +{ + gUnknown_085CE4E8, + gUnknown_085CE50C, + gUnknown_085CE530, +}; + +const struct SpriteTemplate gUnknown_085CE544 = +{ + .tileTag = ANIM_TAG_PINK_PETAL, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gUnknown_08524904, + .anims = gUnknown_085CE538, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C6B0, +}; + +const u16 gUnknown_085CE55C[] = INCBIN_U16("graphics/unknown/unknown_85CE55C.gbapal"); + +const union AnimCmd gUnknown_085CE57C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(4, 9), + ANIMCMD_FRAME(8, 5), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE58C[] = +{ + gUnknown_085CE57C, +}; + +const struct SpriteTemplate gUnknown_085CE590 = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_PAIN_SPLIT, + .oam = &gUnknown_0852490C, + .anims = gUnknown_085CE58C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C95C, +}; + +const struct SpriteTemplate gUnknown_085CE5A8 = +{ + .tileTag = ANIM_TAG_CONFETTI, + .paletteTag = ANIM_TAG_CONFETTI, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815CB88, +}; + +const struct SpriteTemplate gUnknown_085CE5C0 = +{ + .tileTag = ANIM_TAG_SPOTLIGHT, + .paletteTag = ANIM_TAG_SPOTLIGHT, + .oam = &gUnknown_085249DC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE224, + .callback = sub_815CC94, +}; + +const struct SpriteTemplate gBattleAnimSpriteTemplate_85CE5D8 = +{ + .tileTag = ANIM_TAG_BLUE_ORB, + .paletteTag = ANIM_TAG_BLUE_ORB, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815CDB4, +}; + +const union AffineAnimCmd gUnknown_085CE5F0[] = +{ + AFFINEANIMCMD_FRAME(16, 0, 0, 4), + AFFINEANIMCMD_FRAME(0, -3, 0, 16), + AFFINEANIMCMD_FRAME(4, 0, 0, 4), + AFFINEANIMCMD_FRAME(0, 0, 0, 24), + AFFINEANIMCMD_FRAME(-5, 3, 0, 16), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE620[] = +{ + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE640[] = +{ + AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE660[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE680[] = +{ + gUnknown_085CE620, + gUnknown_085CE640, + gUnknown_085CE660, +}; + +const struct SpriteTemplate gUnknown_085CE68C = +{ + .tileTag = ANIM_TAG_PINK_CLOUD, + .paletteTag = ANIM_TAG_PINK_CLOUD, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE680, + .callback = sub_815D7B4, +}; + +const union AffineAnimCmd gUnknown_085CE6A4[] = +{ + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE6C4[] = +{ + AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE6E4[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE704[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(8, 10, 0, 30), + AFFINEANIMCMD_FRAME(-8, -10, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE724[] = +{ + gUnknown_085CE6A4, + gUnknown_085CE6C4, + gUnknown_085CE6E4, + gUnknown_085CE704, +}; + +const struct SpriteTemplate gUnknown_085CE734 = +{ + .tileTag = ANIM_TAG_PINK_CLOUD, + .paletteTag = ANIM_TAG_PINK_CLOUD, + .oam = &gUnknown_085249D4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE724, + .callback = sub_815D870, +}; + +const union AffineAnimCmd gUnknown_085CE74C[] = +{ + AFFINEANIMCMD_FRAME(-16, 16, 0, 6), + AFFINEANIMCMD_FRAME(16, -16, 0, 12), + AFFINEANIMCMD_FRAME(-16, 16, 0, 6), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE76C = +{ + .tileTag = ANIM_TAG_SWEAT_DROP, + .paletteTag = ANIM_TAG_SWEAT_DROP, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815DEBC, +}; + +const u16 gUnknown_085CE784[] = INCBIN_U16("graphics/battle_anims/sprites/effect.gbapal"); + +const union AnimCmd gUnknown_085CE7B4[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE7C0[] = +{ + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd *const gUnknown_085CE7CC[] = +{ + gUnknown_085CE7B4, + gUnknown_085CE7C0, +}; + +const struct SpriteTemplate gUnknown_085CE7D4 = +{ + .tileTag = ANIM_TAG_NOISE_LINE, + .paletteTag = ANIM_TAG_NOISE_LINE, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE7CC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E01C, +}; + +const struct SpriteTemplate gUnknown_085CE7EC = +{ + .tileTag = ANIM_TAG_SMALL_RED_EYE, + .paletteTag = ANIM_TAG_SMALL_RED_EYE, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E404, +}; + +const struct SpriteTemplate gUnknown_085CE804 = +{ + .tileTag = ANIM_TAG_PAW_PRINT, + .paletteTag = ANIM_TAG_PAW_PRINT, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E444, +}; + +const union AffineAnimCmd gUnknown_085CE81C[] = +{ + AFFINEANIMCMD_FRAME(0, 0, -4, 24), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE82C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, -64, 0), + AFFINEANIMCMD_FRAME(0, 0, 4, 24), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE844[] = +{ + gUnknown_085CE81C, + gUnknown_085CE82C, +}; + +const struct SpriteTemplate gUnknown_085CE84C = +{ + .tileTag = ANIM_TAG_RED_BALL, + .paletteTag = ANIM_TAG_RED_BALL, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE844, + .callback = SpriteCallbackDummy, +}; + +const struct SpriteTemplate gUnknown_085CE864 = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E6D8, +}; + +const union AffineAnimCmd gUnknown_085CE87C[] = +{ + AFFINEANIMCMD_FRAME(0, -16, 0, 6), + AFFINEANIMCMD_FRAME(0, 16, 0, 6), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE894 = +{ + .tileTag = ANIM_TAG_SMELLINGSALT_EFFECT, + .paletteTag = ANIM_TAG_SMELLINGSALT_EFFECT, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E954, +}; + +const struct SpriteTemplate gUnknown_085CE8AC = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815EA14, +}; + +const struct SpriteTemplate gUnknown_085CE8C4 = +{ + .tileTag = ANIM_TAG_MAGNIFYING_GLASS, + .paletteTag = ANIM_TAG_MAGNIFYING_GLASS, + .oam = &gUnknown_08524A34, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815EE84, +}; + +const struct SpriteTemplate gUnknown_085CE8DC = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815F18C, +}; + +const struct SpriteTemplate gUnknown_085CE8F4 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81061C4, +}; + +const struct SpriteTemplate gUnknown_085CE90C = +{ + .tileTag = ANIM_TAG_X_SIGN, + .paletteTag = ANIM_TAG_X_SIGN, + .oam = &gUnknown_0852491C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815F48C, +}; + +const struct SpriteTemplate gUnknown_085CE924 = +{ + .tileTag = ANIM_TAG_ITEM_BAG, + .paletteTag = ANIM_TAG_ITEM_BAG, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815FE80, +}; + +const union AnimCmd gUnknown_085CE93C[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE948[] = +{ + gUnknown_085CE93C, +}; + +const union AffineAnimCmd gUnknown_085CE94C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, -4, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE964[] = +{ + AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, 4, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE97C[] = +{ + gUnknown_085CE94C, + gUnknown_085CE964, +}; + +const struct SpriteTemplate gUnknown_085CE984 = +{ + .tileTag = ANIM_TAG_SLAM_HIT_2, + .paletteTag = ANIM_TAG_SLAM_HIT_2, + .oam = &gUnknown_0852497C, + .anims = gUnknown_085CE948, + .images = NULL, + .affineAnims = gUnknown_085CE97C, + .callback = sub_8160338, +}; + +const union AffineAnimCmd gUnknown_085CE99C[] = +{ + AFFINEANIMCMD_FRAME(0, 0, -4, 64), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE9AC[] = +{ + gUnknown_085CE99C, +}; + +const struct SpriteTemplate gUnknown_085CE9B0 = +{ + .tileTag = ANIM_TAG_RECYCLE, + .paletteTag = ANIM_TAG_RECYCLE, + .oam = &gUnknown_08524A9C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE9AC, + .callback = sub_81603A8, +}; + +const union AffineAnimCmd gUnknown_085CE9C8[] = +{ + AFFINEANIMCMD_FRAME(0, 16, 0, 4), + AFFINEANIMCMD_FRAME(-2, 0, 0, 8), + AFFINEANIMCMD_FRAME(0, 4, 0, 4), + AFFINEANIMCMD_FRAME(0, 0, 0, 24), + AFFINEANIMCMD_FRAME(1, -5, 0, 16), + AFFINEANIMCMD_END, +}; + +void sub_815A0D4(struct Sprite *sprite) +{ + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + + if (!gBattleAnimArgs[3]) + sprite->data[0] = gBattleAnimArgs[2]; + else + sprite->data[0] = -gBattleAnimArgs[2]; + + sprite->data[1] = gBattleAnimArgs[4]; + sprite->callback = sub_815A114; +} + +static void sub_815A114(struct Sprite *sprite) +{ + if (sprite->data[1] > 0) + { + sprite->pos2.x = sprite->data[2] >> 8; + sprite->data[2] += sprite->data[0]; + sprite->invisible ^= 1; + sprite->data[1]--; + } + else + { + DestroyAnimSprite(sprite); + } +} + +void sub_815A160(u8 taskId) +{ + sub_807521C( + GetBattlerSpriteCoord(gBattleAnimTarget, 2) + 8, + GetBattlerSpriteCoord(gBattleAnimTarget, 3) + 8, + 0); + DestroyAnimVisualTask(taskId); +} + +void sub_815A1B0(struct Sprite *sprite) +{ + sprite->data[0] = 90; + sprite->callback = WaitAnimForDuration; + sprite->data[1] = 7; + StoreSpriteCallbackInData6(sprite, sub_815A1F4); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[1], 16 - sprite->data[1])); +} + +static void sub_815A1F4(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[1], 16 - sprite->data[1])); + if (--sprite->data[1] < 0) + { + sprite->invisible = 1; + sprite->callback = sub_815A234; + } +} + +static void sub_815A234(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimSprite(sprite); +} + +void sub_815A254(struct Sprite *sprite) +{ + u16 rotation; + u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + + sub_80A6980(sprite, TRUE); + + rotation = ArcTan2Neg(sprite->pos1.x - x, sprite->pos1.y - y); + rotation += 0x6000; + if (IsContest()) + rotation += 0x4000; + + TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation); + + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[2] = x; + sprite->data[4] = y; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void sub_815A2F0(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + sprite->data[0] = 4; + sprite->callback = sub_815A31C; +} + +static void sub_815A31C(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[0], 16 - sprite->data[0])); + + if (sprite->data[1]) + sprite->data[0]--; + else + sprite->data[0]++; + + if (sprite->data[0] == 15 || sprite->data[0] == 4) + sprite->data[1] ^= 1; + + if (sprite->data[2]++ > 70) + { + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + StartSpriteAffineAnim(sprite, 1); + sprite->data[2] = 0; + sprite->invisible = 1; + sprite->affineAnimPaused = 1; + sprite->callback = sub_815A3AC; + } +} + +static void sub_815A3AC(struct Sprite *sprite) +{ + if (sprite->data[2]++ > 9) + { + sprite->invisible = 0; + sprite->affineAnimPaused = 0; + if (sprite->affineAnimEnded) + sprite->callback = sub_815A3F0; + } +} + +static void sub_815A3F0(struct Sprite *sprite) +{ + switch (sprite->data[3]) + { + case 0: + case 1: + sprite->pos2.x = 1; + sprite->pos2.y = 0; + break; + case 2: + case 3: + sprite->pos2.x = -1; + sprite->pos2.y = 0; + break; + case 4: + case 5: + sprite->pos2.x = 0; + sprite->pos2.y = 1; + break; + case 6: + default: + sprite->pos2.x = 0; + sprite->pos2.y = -1; + break; + } + + if (++sprite->data[3] > 7) + sprite->data[3] = 0; + + if (sprite->data[4]++ > 15) + { + sprite->data[0] = 16; + sprite->data[1] = 0; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[0], 0)); + sprite->callback = sub_815A49C; + } +} + +static void sub_815A49C(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[0], 16 - sprite->data[0])); + + if (sprite->data[1]++ > 1) + { + sprite->data[0]--; + sprite->data[1] = 0; + } + + if (sprite->data[0] == 0) + sprite->invisible = 1; + + if (sprite->data[0] < 0) + { + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimSprite(sprite); + } +} + +void sub_815A504(u8 taskId) +{ + gTasks[taskId].func = sub_815A52C; + gAnimVisualTaskCount--; +} + +static void sub_815A52C(u8 taskId) +{ + int i; + u16 lastColor; + u8 paletteIndex = sub_80A6D94(); + + if (++gTasks[taskId].data[5] == 4) + { + lastColor = gPlttBufferFaded[paletteIndex * 16 + 11]; + for (i = 10; i > 0; i--) + gPlttBufferFaded[paletteIndex * 16 + i + 1] = gPlttBufferFaded[paletteIndex * 16 + i]; + + gPlttBufferFaded[paletteIndex * 16 + 1] = lastColor; + gTasks[taskId].data[5] = 0; + } + + if ((u16)gBattleAnimArgs[7] == 0xFFFF) + DestroyTask(taskId); +} + +void sub_815A5C8(u8 taskId) +{ + gTasks[taskId].func = sub_815A5F0; + gAnimVisualTaskCount--; +} + +static void sub_815A5F0(u8 taskId) +{ + int i; + u16 lastColor; + u8 paletteIndex = sub_80A6D94(); + + if (++gTasks[taskId].data[5] == 4) + { + lastColor = gPlttBufferFaded[paletteIndex * 16 + 11]; + for (i = 10; i > 0; i--) + gPlttBufferFaded[paletteIndex * 16 + i + 1] = gPlttBufferFaded[paletteIndex * 16 + i]; + gPlttBufferFaded[paletteIndex * 16 + 1] = lastColor; + + lastColor = gPlttBufferUnfaded[paletteIndex * 16 + 11]; + for (i = 10; i > 0; i--) + gPlttBufferUnfaded[paletteIndex * 16 + i + 1] = gPlttBufferUnfaded[paletteIndex * 16 + i]; + gPlttBufferUnfaded[paletteIndex * 16 + 1] = lastColor; + + gTasks[taskId].data[5] = 0; + } + + if ((u16)gBattleAnimArgs[7] == 0xFFFF) + DestroyTask(taskId); +} + +void sub_815A6C4(struct Sprite *sprite) +{ + u16 x; + u16 y; + + InitAnimSpritePos(sprite, TRUE); + SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y); + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[2] = x + gBattleAnimArgs[2]; + sprite->data[4] = y + gBattleAnimArgs[3]; + sprite->data[5] = -50; + + InitAnimArcTranslation(sprite); + sprite->callback = sub_815A73C; +} + +static void sub_815A73C(struct Sprite *sprite) +{ + if (TranslateAnimArc(sprite)) + { + sprite->data[0] = 30; + sprite->data[1] = 0; + sprite->callback = WaitAnimForDuration; + StoreSpriteCallbackInData6(sprite, sub_815A76C); + } +} + +static void sub_815A76C(struct Sprite *sprite) +{ + if (sprite->data[1] & 1) + sprite->invisible ^= 1; + + if (++sprite->data[1] == 16) + DestroyAnimSprite(sprite); +} + +void sub_815A7B0(struct Sprite *sprite) +{ + SetSpriteCoordsToAnimAttackerCoords(sprite); + sub_80A6864(sprite, gBattleAnimArgs[0]); + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->callback = RunStoredCallbackWhenAnimEnds; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +// This is likely fakematching due to some strange type casting behavior. +void sub_815A7EC(struct Sprite *sprite) +{ + int var0; + int var1; + if (sprite->data[0] == 0) + { + SetSpriteCoordsToAnimAttackerCoords(sprite); + sub_80A6864(sprite, gBattleAnimArgs[0]); + if (!IsContest()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[2] = gBattleAnimArgs[3]; + } + else + { + var1 = -gBattleAnimArgs[2]; + sprite->data[1] = var1; + var1 = -gBattleAnimArgs[3]; + sprite->data[2] = var1; + } + } + else + { + var1 = -gBattleAnimArgs[2]; + sprite->data[1] = var1; + sprite->data[2] = gBattleAnimArgs[3]; + } + } + + sprite->data[0]++; + var0 = (sprite->data[0] * 20) & 0xFF; + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + sprite->pos2.x = (sprite->data[3] + (s32)((u32)sprite->data[3] >> 31)) >> 1; + sprite->pos2.y = Sin(var0 & 0xFF, 5) + ((s32)(sprite->data[4] + ((u32)sprite->data[4] >> 31)) >> 1); + + if ((u16)(sprite->pos1.x + sprite->pos2.x) > 240) + DestroyAnimSprite(sprite); +} + +void sub_815A8AC(struct Sprite *sprite) +{ + if (sprite->animEnded) + DestroyAnimSprite(sprite); +} + +void AnimTask_IsTargetPlayerSide(u8 taskId) +{ + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT) + gBattleAnimArgs[7] = 0; + else + gBattleAnimArgs[7] = 1; + + DestroyAnimVisualTask(taskId); +} + +void AnimTask_IsHealingMove(u8 taskId) +{ + if (gAnimMoveDmg > 0) + gBattleAnimArgs[7] = 0; + else + gBattleAnimArgs[7] = 1; + + DestroyAnimVisualTask(taskId); +} + +void sub_815A934(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); + + sub_80A6980(sprite, FALSE); + + sprite->oam.objMode = ST_OAM_OBJ_WINDOW; + sprite->invisible = 1; + sprite->callback = sub_815A9A0; +} + +static void sub_815A9A0(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->invisible = 0; + if (sprite->affineAnimEnded) + sprite->data[0]++; + break; + case 1: + case 3: + sprite->data[1] += 117; + sprite->pos2.x = sprite->data[1] >> 8; + if (++sprite->data[2] == 21) + { + sprite->data[2] = 0; + sprite->data[0]++; + } + break; + case 2: + sprite->data[1] -= 117; + sprite->pos2.x = sprite->data[1] >> 8; + if (++sprite->data[2] == 41) + { + sprite->data[2] = 0; + sprite->data[0]++; + } + break; + case 4: + ChangeSpriteAffineAnim(sprite, 1); + sprite->data[0]++; + break; + case 5: + if (sprite->affineAnimEnded) + { + sprite->invisible = 1; + sprite->callback = sub_815AA6C; + } + break; + } +} + +static void sub_815AA6C(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR); + SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) ^ DISPCNT_OBJWIN_ON); + DestroyAnimSprite(sprite); +} + +void sub_815AAA4(struct Sprite *sprite) +{ + if (gBattleAnimArgs[3] == 0) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + } + + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->oam.tileNum += 16; + + if (gBattleAnimArgs[2] == 0) + { + sprite->oam.matrixNum = 8; + sprite->pos2.x = -12; + sprite->data[1] = 2; + } + else + { + sprite->pos2.x = 12; + sprite->data[1] = -2; + } + + sprite->data[0] = gBattleAnimArgs[4]; + + if (sprite->data[3] != 255) + sprite->data[3] = gBattleAnimArgs[2]; + + sprite->callback = sub_815AB5C; +} + +static void sub_815AB5C(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->pos2.x += sprite->data[1]; + if (sprite->pos2.x == 0) + { + sprite->data[2]++; + if (sprite->data[3] == 0) + { + PlaySE1WithPanning(SE_W227, BattleAnimAdjustPanning(-64)); + } + } + } + else + { + sprite->pos2.x -= sprite->data[1]; + if (abs(sprite->pos2.x) == 12) + { + sprite->data[0]--; + sprite->data[2]--; + } + + } + + if (sprite->data[0] == 0) + DestroyAnimSprite(sprite); +} + +void sub_815ABD0(struct Sprite *sprite) +{ + sprite->oam.objMode = ST_OAM_OBJ_WINDOW; + sprite->data[3] = 255; + sub_815AAA4(sprite); +} + +void sub_815ABEC(u8 taskId) +{ + if (IsContest()) + { + SetGpuReg(REG_OFFSET_WININ, 0x1F3F); + gBattle_WIN1H = 0x98F0; + gBattle_WIN1V = 0x00A0; + SetGpuReg(REG_OFFSET_WIN1H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN1V, gBattle_WIN0V); + } + else + { + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ); + gBattle_WIN1H = 0x00F0; + gBattle_WIN1V = 0x78A0; + SetGpuReg(REG_OFFSET_WIN1H, 0x00F0); + SetGpuReg(REG_OFFSET_WIN1V, gBattle_WIN1V); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON); + } + + DestroyAnimVisualTask(taskId); +} + +void sub_815AC8C(u8 taskId) +{ + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + gBattle_WIN1H = 0; + gBattle_WIN1V = 0; + if (!IsContest()) + ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON); + + DestroyAnimVisualTask(taskId); +} + +void sub_815ACD0(struct Sprite *sprite) +{ + int var0; + if (gBattleAnimArgs[0] == 0) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + } + + sprite->pos2.y = gBattleAnimArgs[2]; + var0 = 0; + if (sprite->pos2.y > gBattleAnimArgs[3]) + var0 = 1; + + sprite->data[0] = var0; + sprite->data[1] = 0; + sprite->data[2] = gBattleAnimArgs[4]; + sprite->data[3] = gBattleAnimArgs[5]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->callback = sub_815AD4C; +} + +static void sub_815AD4C(struct Sprite *sprite) +{ + sprite->data[1] = (sprite->data[1] + sprite->data[2]) & 0xFF; + sprite->pos2.x = gSineTable[sprite->data[1]] >> 4; + sprite->pos2.y += sprite->data[3]; + + if (sprite->data[0]) + { + if (sprite->pos2.y < sprite->data[4]) + DestroyAnimSprite(sprite); + } + else + { + if (sprite->pos2.y > sprite->data[4]) + DestroyAnimSprite(sprite); + } +} + +void sub_815ADB0(u8 taskId) +{ + s16 var0; + u8 toBG2; + s16 var2; + int var3; + int var4; + s16 i; + struct ScanlineEffectParams scanlineParams; + struct Task *task = &gTasks[taskId]; + + if (!gBattleAnimArgs[0]) + { + var0 = GetBattlerYCoordWithElevation(gBattleAnimAttacker); + toBG2 = sub_80A8364(gBattleAnimAttacker); + } + else + { + var0 = GetBattlerYCoordWithElevation(gBattleAnimTarget); + toBG2 = sub_80A8364(gBattleAnimTarget); + } + + task->data[0] = var0 + 36; + task->data[1] = task->data[0]; + task->data[2] = var0 - 33; + if (task->data[2] < 0) + task->data[2] = 0; + + task->data[3] = task->data[0]; + task->data[4] = 8; + task->data[5] = gBattleAnimArgs[1]; + task->data[6] = 0; + task->data[7] = 0; + + if (toBG2 == 1) + { + var3 = gBattle_BG1_X; + task->data[8] = var3; + var4 = var3 + 240; + } + else + { + var3 = gBattle_BG2_X; + task->data[8] = var3; + var4 = var3 + 240; + } + + task->data[9] = var4; + task->data[10] = gBattleAnimArgs[2]; + + if (!gBattleAnimArgs[2]) + { + task->data[11] = var4; + var2 = task->data[8]; + } + else + { + task->data[11] = var3; + var2 = task->data[9]; + } + + task->data[15] = 0; + + i = task->data[2]; + while (i <= task->data[3]) + { + gScanlineEffectRegBuffers[0][i] = var2; + gScanlineEffectRegBuffers[1][i] = var2; + i++; + } + + if (toBG2 == 1) + scanlineParams.dmaDest = ®_BG1HOFS; + else + scanlineParams.dmaDest = ®_BG2HOFS; + + scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; + scanlineParams.initState = 1; + scanlineParams.unused9 = 0; + ScanlineEffect_SetParams(scanlineParams); + + task->func = sub_815AED8; +} + +static void sub_815AED8(u8 taskId) +{ + s16 i; + struct Task *task = &gTasks[taskId]; + + task->data[0] -= task->data[5]; + if (task->data[0] < task->data[2]) + task->data[0] = task->data[2]; + + if (task->data[4] == 0) + { + task->data[1] -= task->data[5]; + if (task->data[1] < task->data[2]) + { + task->data[1] = task->data[2]; + task->data[15] = 1; + } + } + else + { + task->data[4]--; + } + + if (++task->data[6] > 1) + { + task->data[6] = 0; + task->data[7] = task->data[7] == 0 ? 1 : 0; + + if (task->data[7]) + task->data[12] = task->data[8]; + else + task->data[12] = task->data[9]; + } + + i = task->data[0]; + while (i < task->data[1]) + { + gScanlineEffectRegBuffers[0][i] = task->data[12]; + gScanlineEffectRegBuffers[1][i] = task->data[12]; + i++; + } + + i = task->data[1]; + while (i <= task->data[3]) + { + gScanlineEffectRegBuffers[0][i] = task->data[11]; + gScanlineEffectRegBuffers[1][i] = task->data[11]; + i++; + } + + if (task->data[15]) + { + if (task->data[10]) + gScanlineEffect.state = 3; + + DestroyAnimVisualTask(taskId); + } +} + +void sub_815AFF0(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[4] = 32; + task->data[5] = -20; + task->data[6] = 0; + task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->func = sub_815B054; +} + +static void sub_815B054(u8 taskId) +{ + int var0, var1; + s16 x, y; + u16 i, j; + u8 spriteId; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + var0 = task->data[2]; + if (task->data[1] & 1) + { + var1 = task->data[4]; + x = var0 - var1; + } + else + { + var1 = task->data[4]; + x = var0 + var1; + } + + y = task->data[3] + task->data[5]; + spriteId = CreateSprite(&gUnknown_08593114, x, y, 6 - task->data[1]); + PlaySE12WithPanning(SE_W118, BattleAnimAdjustPanning(-64)); + + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].hFlip = task->data[1] & 1; + gSprites[spriteId].callback = SpriteCallbackDummy; + } + + if (task->data[1] & 1) + { + task->data[4] -= 6; + task->data[5] -= 6; + } + + PrepareAffineAnimInTaskData(task, task->data[15], gUnknown_085CE2A0); + task->data[1]++; + task->data[0] = 1; + break; + case 1: + if (!RunAffineAnimFromTaskData(task)) + { + if (task->data[1] == 6) + { + task->data[6] = 8; + task->data[0] = 3; + } + else + { + if (task->data[1] <= 2) + task->data[6] = 10; + else + task->data[6] = 0; + + task->data[0] = 2; + } + } + break; + case 2: + if (task->data[6] != 0) + task->data[6]--; + else + task->data[0] = 0; + break; + case 3: + if (task->data[6] != 0) + task->data[6]--; + else + task->data[0] = 4; + break; + case 4: + for (i = 0, j = 0; i < MAX_SPRITES; i++) + { + if (gSprites[i].template == &gUnknown_08593114) + { + gSprites[i].data[0] = taskId; + gSprites[i].data[1] = 6; + StartSpriteAnim(&gSprites[i], 2); + gSprites[i].callback = sub_815B23C; + + if (++j == 6) + break; + } + } + + task->data[6] = j; + task->data[0] = 5; + break; + case 5: + if (task->data[6] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_815B23C(struct Sprite *sprite) +{ + if (sprite->animEnded) + { + gTasks[sprite->data[0]].data[sprite->data[1]]--; + DestroySprite(sprite); + } +} + +void sub_815B27C(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + InitAnimSpritePos(sprite, FALSE); + + if (++sprite->data[0] < 40) + { + u16 var = sprite->data[0]; + if ((var & 1) == 0) + sprite->invisible = 1; + else + sprite->invisible = 0; + } + + if (sprite->data[0] > 30) + sprite->invisible = 0; + + if (sprite->data[0] == 61) + { + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->data[0] = 20; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->callback = StartAnimLinearTranslation; + } +} + +void sub_815B338(u8 taskId) +{ + switch (gTasks[taskId].data[0]) + { + case 0: + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(ANIM_ATTACKER), gUnknown_085CE350); + gTasks[taskId].data[0]++; + break; + case 1: + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815B394(struct Sprite *sprite) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + + switch (sprite->data[0]) + { + case 0: + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); + sprite->data[1] = 256; + sprite->data[2] = 256; + sprite->data[0]++; + break; + case 1: + sprite->data[1] += 96; + sprite->data[2] -= 26; + SetSpriteRotScale(spriteId, sprite->data[1], sprite->data[2], 0); + + if (++sprite->data[3] == 5) + sprite->data[0]++; + // fall through + case 2: + sprite->data[1] += 96; + sprite->data[2] += 48; + SetSpriteRotScale(spriteId, sprite->data[1], sprite->data[2], 0); + + if (++sprite->data[3] == 9) + { + sprite->data[3] = 0; + gSprites[spriteId].invisible = 1; + ResetSpriteRotScale(spriteId); + sprite->data[0]++; + } + break; + case 3: + sprite->pos2.y -= 6; + if (sprite->pos1.y + sprite->pos2.y < -32) + DestroyAnimSprite(sprite); + break; + } +} + +void sub_815B49C(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos1.x = -16; + else + sprite->pos1.x = 256; + + sprite->pos1.y = 0; + sprite->callback = sub_815B4D4; +} + +static void sub_815B4D4(struct Sprite *sprite) +{ + u32 newX; + + sprite->data[0] += 72; + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos2.x = sprite->data[0] >> 4; + else + sprite->pos2.x = -(sprite->data[0] >> 4); + + sprite->data[1] += 16; + sprite->pos2.y += sprite->data[1] >> 8; + + if (++sprite->data[2] % 3 == 0) + { + CreateSpriteAndAnimate( + &gUnknown_085CE3A0, + sprite->pos1.x + sprite->pos2.x, + sprite->pos1.y + sprite->pos2.y, + sprite->subpriority + 1); + } + + newX = sprite->pos1.x + sprite->pos2.x + 32; + if (newX > 304) + DestroyAnimSprite(sprite); +} + +void sub_815B570(struct Sprite *sprite) +{ + u8 rand; + s8 y; + + rand = Random2() & 3; + if (rand == 0) + sprite->oam.tileNum += 4; + else + sprite->oam.tileNum += 5; + + y = Random2() & 7; + if (y > 3) + y = -y; + + sprite->pos2.y = y; + sprite->callback = sub_815B5D0; +} + +static void sub_815B5D0(struct Sprite *sprite) +{ + if (++sprite->data[0] < 30) + { + if (++sprite->data[1] == 2) + { + sprite->invisible ^= 1; + sprite->data[1] = 0; + } + } + else + { + if (sprite->data[1] == 2) + sprite->invisible = 0; + + if (sprite->data[1] == 3) + { + sprite->invisible = 1; + sprite->data[1] = -1; + } + + sprite->data[1]++; + } + + if (sprite->data[0] > 60) + DestroySprite(sprite); +} + +void sub_815B65C(u8 taskId) +{ + if (!gTasks[taskId].data[0]) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(ANIM_ATTACKER), gUnknown_085CE3B8); + gTasks[taskId].data[0]++; + } + else + { + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + } +} + +void sub_815B6B4(u8 taskId) +{ + if (!gTasks[taskId].data[0]) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(ANIM_ATTACKER), gUnknown_085CE3E0); + gTasks[taskId].data[0]++; + } + else + { + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + } +} + +void sub_815B70C(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + InitAnimSpritePos(sprite, FALSE); + sprite->data[1] = 0x900; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[0]++; + break; + case 1: + sprite->pos2.y -= sprite->data[1] >> 8; + sprite->data[1] -= 96; + if (sprite->pos1.y + sprite->pos2.y > sprite->data[2]) + DestroyAnimSprite(sprite); + break; + } +} + +void sub_815B778(u8 taskId) +{ + if (!gTasks[taskId].data[0]) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(ANIM_ATTACKER), gUnknown_085CE430); + gTasks[taskId].data[0]++; + } + else + { + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + } +} + +void sub_815B7D0(u8 taskId) +{ + int i, j; + u8 position; + struct UnknownAnimStruct2 unknownStruct; + u8 *dest; + u8 *src; + u16 *unk4; + u16 stretch; + + switch (gTasks[taskId].data[0]) + { + case 0: + SetGpuReg(REG_OFFSET_MOSAIC, 0); + if (sub_80A8364(gBattleAnimAttacker) == 1) + SetAnimBgAttribute(1, BG_ANIM_MOSAIC, 1); + else + SetAnimBgAttribute(2, BG_ANIM_MOSAIC, 1); + + gTasks[taskId].data[10] = gBattleAnimArgs[0]; + gTasks[taskId].data[0]++; + break; + case 1: + if (gTasks[taskId].data[2]++ > 1) + { + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[1]++; + stretch = gTasks[taskId].data[1]; + SetGpuReg(REG_OFFSET_MOSAIC, (stretch << 4) | stretch); + if (stretch == 15) + gTasks[taskId].data[0]++; + } + break; + case 2: + HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10]); + sub_80A6BFC(&unknownStruct, gBattleAnimAttacker); + + if (IsContest()) + position = 0; + else + position = GetBattlerPosition(gBattleAnimAttacker); + + src = gMonSpritesGfxPtr->sprites[position] + (gBattleMonForms[gBattleAnimAttacker] << 11); + dest = unknownStruct.bgTiles; + CpuCopy32(src, dest, 0x800); + LoadBgTiles(1, unknownStruct.bgTiles, 0x800, unknownStruct.tilesOffset); + if (IsContest()) + { + if (IsSpeciesNotUnown(gContestResources->field_18->species) != IsSpeciesNotUnown(gContestResources->field_18->unk2)) + { + unk4 = (u16 *)unknownStruct.unk4; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 4; j++) + { + u16 temp = unk4[j + i * 0x20]; + unk4[j + i * 0x20] = unk4[(7 - j) + i * 0x20]; + unk4[(7 - j) + i * 0x20] = temp; + } + } + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 8; j++) + { + unk4[j + i * 0x20] ^= 0x400; + } + } + } + + if (IsSpeciesNotUnown(gContestResources->field_18->unk2)) + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF6C0; + else + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF694; + + StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0); + } + + gTasks[taskId].data[0]++; + break; + case 3: + if (gTasks[taskId].data[2]++ > 1) + { + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[1]--; + stretch = gTasks[taskId].data[1]; + SetGpuReg(REG_OFFSET_MOSAIC, (stretch << 4) | stretch); + + if (stretch == 0) + gTasks[taskId].data[0]++; + } + break; + case 4: + SetGpuReg(REG_OFFSET_MOSAIC, 0); + if (sub_80A8364(gBattleAnimAttacker) == 1) + SetAnimBgAttribute(1, BG_ANIM_MOSAIC, 0); + else + SetAnimBgAttribute(2, BG_ANIM_MOSAIC, 0); + + if (!IsContest()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + { + if (gTasks[taskId].data[10] == 0) + SetBattlerShadowSpriteCallback(gBattleAnimAttacker, gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].transformSpecies); + } + } + + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815BB18(u8 taskId) +{ + gBattleAnimArgs[7] = gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].invisible; + DestroyAnimVisualTask(taskId); +} + +void sub_815BB58(u8 taskId) +{ + HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, TRUE); + DestroyAnimVisualTask(taskId); +} + +void sub_815BB84(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + switch (gTasks[taskId].data[0]) + { + case 0: + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + sub_80A6B30(&unknownStruct); + sub_80A6D60(&unknownStruct, &gUnknown_08C2A6EC, 0); + if (IsContest()) + { + gBattle_BG1_X = -56; + gBattle_BG1_Y = 0; + } + else + { + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattle_BG1_X = -135; + else + gBattle_BG1_X = -10; + + gBattle_BG1_Y = 0; + } + + sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C2A634, unknownStruct.tilesOffset); + LoadCompressedPalette(&gUnknown_08C2A6D4, unknownStruct.unk8 << 4, 32); + + gTasks[taskId].data[10] = gBattle_BG1_X; + gTasks[taskId].data[11] = gBattle_BG1_Y; + + gTasks[taskId].data[0]++; + PlaySE12WithPanning(SE_W234, BattleAnimAdjustPanning(-64)); + break; + case 1: + if (gTasks[taskId].data[4]++ > 0) + { + gTasks[taskId].data[4] = 0; + if (++gTasks[taskId].data[1] > 12) + gTasks[taskId].data[1] = 12; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); + + if (gTasks[taskId].data[1] == 12) + gTasks[taskId].data[0]++; + } + break; + case 2: + if (--gTasks[taskId].data[1] < 0) + gTasks[taskId].data[1] = 0; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); + + if (!gTasks[taskId].data[1]) + { + gBattle_BG1_X = gUnknown_085CE460[gTasks[taskId].data[2]] + gTasks[taskId].data[10]; + if (++gTasks[taskId].data[2] == 4) + gTasks[taskId].data[0] = 4; + else + gTasks[taskId].data[0] = 3; + } + break; + case 3: + if (++gTasks[taskId].data[3] == 4) + { + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[0] = 1; + PlaySE12WithPanning(SE_W234, BattleAnimAdjustPanning(-64)); + } + break; + case 4: + sub_80A6B30(&unknownStruct); + sub_80A6C68(unknownStruct.bgId); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815BE04(struct Sprite *sprite) +{ + s16 xOffset; + u8 spriteId1; + u8 spriteId2; + + xOffset = Random2(); + xOffset &= 0x3F; + if (xOffset > 31) + xOffset = 32 - xOffset; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + xOffset; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 32; + sprite->data[1] = gBattleAnimArgs[0]; + sprite->data[2] = gBattleAnimArgs[1]; + + spriteId1 = CreateSprite(&gUnknown_085CE48C, sprite->pos1.x, sprite->pos1.y, sprite->subpriority + 1); + spriteId2 = CreateSprite(&gUnknown_085CE48C, sprite->pos1.x, sprite->pos1.y, sprite->subpriority + 1); + StartSpriteAnim(&gSprites[spriteId1], 1); + StartSpriteAnim(&gSprites[spriteId2], 2); + + gSprites[spriteId1].data[1] = gBattleAnimArgs[0]; + gSprites[spriteId1].data[2] = gBattleAnimArgs[1]; + gSprites[spriteId2].data[1] = gBattleAnimArgs[0]; + gSprites[spriteId2].data[2] = gBattleAnimArgs[1]; + gSprites[spriteId1].data[7] = -1; + gSprites[spriteId2].data[7] = -1; + gSprites[spriteId1].invisible = 1; + gSprites[spriteId2].invisible = 1; + gSprites[spriteId1].callback = sub_815C050; + gSprites[spriteId2].callback = sub_815C050; + + sprite->data[6] = spriteId1; + sprite->data[7] = spriteId2; + sprite->callback = sub_815BF44; +} + +static void sub_815BF44(struct Sprite *sprite) +{ + int var0; + s8 var1; + + var0 = (u16)sprite->data[2] + (u16)sprite->data[3]; + var1 = var0 >> 8; + sprite->pos2.y -= var1; + sprite->data[3] = var0 & 0xFF; + if (sprite->data[4] == 0 && sprite->pos2.y < -8) + { + gSprites[sprite->data[6]].invisible = 0; + sprite->data[4]++; + } + + if (sprite->data[4] == 1 && sprite->pos2.y < -16) + { + gSprites[sprite->data[7]].invisible = 0; + sprite->data[4]++; + } + + if (--sprite->data[1] == -1) + { + sprite->invisible = 1; + sprite->callback = sub_815BFF4; + } +} + +static void sub_815BFF4(struct Sprite *sprite) +{ + if (gSprites[sprite->data[6]].callback == SpriteCallbackDummy + && gSprites[sprite->data[7]].callback == SpriteCallbackDummy) + { + DestroySprite(&gSprites[sprite->data[6]]); + DestroySprite(&gSprites[sprite->data[7]]); + DestroyAnimSprite(sprite); + } +} + +static void sub_815C050(struct Sprite *sprite) +{ + u16 d2; + register u16 d3 asm("r1"); + int var0; + s8 var1; + + if (!sprite->invisible) + { + d2 = sprite->data[2]; + d3 = sprite->data[3]; + var0 = d2 + d3; + var1 = var0 >> 8; + sprite->pos2.y -= var1; + sprite->data[3] = var0 & 0xFF; + if (--sprite->data[1] == -1) + { + sprite->invisible = 1; + sprite->callback = SpriteCallbackDummy; + } + } +} + +void sub_815C0A4(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + switch (gTasks[taskId].data[0]) + { + case 0: + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(3, 13)); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + sub_80A6B30(&unknownStruct); + sub_80A6D60(&unknownStruct, &gUnknown_08C2A6EC, 0); + if (IsContest()) + { + gBattle_BG1_X = -56; + gBattle_BG1_Y = 0; + } + else + { + u8 position = GetBattlerPosition(gBattleAnimTarget); + if (IsDoubleBattle() == TRUE) + { + if (position == B_POSITION_OPPONENT_LEFT) + gBattle_BG1_X = -155; + if (position == B_POSITION_OPPONENT_RIGHT) + gBattle_BG1_X = -115; + if (position == B_POSITION_PLAYER_LEFT) + gBattle_BG1_X = 14; + if (position == B_POSITION_PLAYER_RIGHT) + gBattle_BG1_X = -20; + } + else + { + if (position == B_POSITION_OPPONENT_LEFT) + gBattle_BG1_X = -135; + if (position == B_POSITION_PLAYER_LEFT) + gBattle_BG1_X = -10; + } + + gBattle_BG1_Y = 0; + } + + sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C2A634, unknownStruct.tilesOffset); + LoadCompressedPalette(&gUnknown_08C2A6D4, unknownStruct.unk8 << 4, 32); + gTasks[taskId].data[10] = gBattle_BG1_X; + gTasks[taskId].data[11] = gBattle_BG1_Y; + gTasks[taskId].data[0]++; + break; + case 1: + gTasks[taskId].data[3] = 0; + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT) + gBattle_BG1_X = gTasks[taskId].data[10] + gUnknown_085CE4A4[gTasks[taskId].data[2]]; + else + gBattle_BG1_X = gTasks[taskId].data[10] - gUnknown_085CE4A4[gTasks[taskId].data[2]]; + + if (++gTasks[taskId].data[2] == 5) + gTasks[taskId].data[0] = 5; + else + gTasks[taskId].data[0]++; + break; + case 2: + if (--gTasks[taskId].data[1] <= 4) + gTasks[taskId].data[1] = 5; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(3, gTasks[taskId].data[1])); + if (gTasks[taskId].data[1] == 5) + gTasks[taskId].data[0]++; + break; + case 3: + if (++gTasks[taskId].data[3] > gUnknown_085CE4A8[gTasks[taskId].data[2]]) + gTasks[taskId].data[0]++; + break; + case 4: + if (++gTasks[taskId].data[1] > 13) + gTasks[taskId].data[1] = 13; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(3, gTasks[taskId].data[1])); + if (gTasks[taskId].data[1] == 13) + gTasks[taskId].data[0] = 1; + break; + case 5: + sub_80A6B30(&unknownStruct); + sub_80A6C68(unknownStruct.bgId); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815C3A8(u8 taskId) +{ + if (gTasks[taskId].data[0] == 0) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(0), gUnknown_085CE4B0); + gTasks[taskId].data[0]++; + } + else + { + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + } +} + +void sub_815C400(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + InitAnimSpritePos(sprite, 0); + sprite->data[0]++; + } + else if (sprite->data[0]++ > 20) + { + sprite->data[1] += 160; + sprite->data[2] += 128; + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos2.x = -(sprite->data[1] >> 8); + else + sprite->pos2.x = sprite->data[1] >> 8; + + sprite->pos2.y += sprite->data[2] >> 8; + if (sprite->pos2.y > 64) + DestroyAnimSprite(sprite); + } +} + +void sub_815C478(u8 taskId) +{ + u8 side; + struct Task *task = &gTasks[taskId]; + + if (!gBattleAnimArgs[1]) + { + DestroyAnimVisualTask(taskId); + return; + } + + if (gBattleAnimArgs[2] < 0) + gBattleAnimArgs[2] = 0; + if (gBattleAnimArgs[2] > 2) + gBattleAnimArgs[2] = 2; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 8 - (2 * gBattleAnimArgs[2]); + task->data[4] = 0x100 + (gBattleAnimArgs[2] * 128); + task->data[5] = gBattleAnimArgs[2] + 2; + task->data[6] = gBattleAnimArgs[1] - 1; + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + + if (!gBattleAnimArgs[0]) + side = GetBattlerSide(gBattleAnimAttacker); + else + side = GetBattlerSide(gBattleAnimTarget); + + if (side == B_SIDE_OPPONENT) + { + task->data[4] *= -1; + task->data[5] *= -1; + } + + PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); + task->func = sub_815C548; +} + +static void sub_815C548(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + gSprites[task->data[15]].pos2.x += task->data[5]; + task->data[2] -= task->data[4]; + SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); + SetBattlerSpriteYOffsetFromRotation(task->data[15]); + if (++task->data[1] >= task->data[3]) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 1: + gSprites[task->data[15]].pos2.x -= task->data[5]; + task->data[2] += task->data[4]; + SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); + SetBattlerSpriteYOffsetFromRotation(task->data[15]); + if (++task->data[1] >= task->data[3] * 2) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 2: + gSprites[task->data[15]].pos2.x += task->data[5]; + task->data[2] -= task->data[4]; + SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); + SetBattlerSpriteYOffsetFromRotation(task->data[15]); + if (++task->data[1] >= task->data[3]) + { + if (task->data[6]) + { + task->data[6]--; + task->data[1] = 0; + task->data[0] = 0; + } + else + { + task->data[0]++; + } + } + break; + case 3: + ResetSpriteRotScale(task->data[15]); + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815C6B0(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->pos1.x = 0; + sprite->pos1.y = gBattleAnimArgs[0]; + } + else + { + sprite->pos1.x = 240; + sprite->pos1.y = gBattleAnimArgs[0] - 30; + } + + sprite->data[2] = gBattleAnimArgs[2]; + StartSpriteAnim(sprite, gBattleAnimArgs[1]); + sprite->callback = sub_815C700; +} + +static void sub_815C700(struct Sprite *sprite) +{ + sprite->data[0] += 3; + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->pos1.x += 5; + sprite->pos1.y -= 1; + + if (sprite->pos1.x > 240) + DestroyAnimSprite(sprite); + + sprite->pos2.y = Sin(sprite->data[0] & 0xFF, 16); + } + else + { + sprite->pos1.x -= 5; + sprite->pos1.y += 1; + + if (sprite->pos1.x < 0) + DestroyAnimSprite(sprite); + + sprite->pos2.y = Cos(sprite->data[0] & 0xFF, 16); + } +} + +void sub_815C770(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[12] = 0x20; + task->data[13] = 0x40; + task->data[14] = 0x800; + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + + PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); + task->func = sub_815C7C4; +} + +static void sub_815C7C4(u8 taskId) +{ + int temp; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + task->data[2] += 0x200; + if (task->data[2] >= task->data[14]) + { + s16 diff = task->data[14] - task->data[2]; + s16 div = diff / (task->data[14] * 2); + s16 mod = diff % (task->data[14] * 2); + + if ((div & 1) == 0) + { + task->data[2] = task->data[14] - mod; + task->data[0] = 1; + } + else + { + task->data[2] = mod - task->data[14]; + } + } + break; + case 1: + task->data[2] -= 0x200; + if (task->data[2] <= -task->data[14]) + { + s16 diff = task->data[14] - task->data[2]; + s16 div = diff / (task->data[14] * 2); + s16 mod = diff % (task->data[14] * 2); + + if ((1 & div) == 0) + { + task->data[2] = mod - task->data[14]; + task->data[0] = 0; + } + else + { + task->data[2] = task->data[14] - mod; + } + } + break; + case 2: + ResetSpriteRotScale(task->data[15]); + DestroyAnimVisualTask(taskId); + return; + } + + SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); + SetBattlerSpriteYOffsetFromRotation(task->data[15]); + gSprites[task->data[15]].pos2.x = -(((temp = task->data[2]) >= 0 ? task->data[2] : temp + 63) >> 6); + + if (++task->data[1] > 8) + { + if (task->data[12]) + { + task->data[12]--; + task->data[14] -= task->data[13]; + if (task->data[14] < 16) + task->data[14] = 16; + } + else + { + task->data[0] = 2; + } + } +} + +void sub_815C95C(struct Sprite *sprite) +{ + if (!sprite->data[0]) + { + if (!gBattleAnimArgs[2]) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + } + + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[1] = 0x80; + sprite->data[2] = 0x300; + sprite->data[3] = gBattleAnimArgs[1]; + sprite->data[0]++; + } + else + { + sprite->pos2.x = sprite->data[1] >> 8; + sprite->pos2.y += sprite->data[2] >> 8; + if (sprite->data[4] == 0 && sprite->pos2.y > -sprite->data[3]) + { + sprite->data[4] = 1; + sprite->data[2] = (-sprite->data[2] / 3) * 2; + } + + sprite->data[1] += 192; + sprite->data[2] += 128; + if (sprite->animEnded) + DestroyAnimSprite(sprite); + } +} + +void sub_815CA20(u8 taskId) +{ + u8 spriteId; + + if (gTasks[taskId].data[0] == 0) + { + if (gBattleAnimArgs[0] == 0) + gTasks[taskId].data[11] = gBattleAnimAttacker; + else + gTasks[taskId].data[11] = gBattleAnimTarget; + + spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + gTasks[taskId].data[10] = spriteId; + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); + + switch (gBattleAnimArgs[1]) + { + case 0: + SetSpriteRotScale(spriteId, 0xE0, 0x140, 0); + SetBattlerSpriteYOffsetFromYScale(spriteId); + break; + case 1: + SetSpriteRotScale(spriteId, 0xD0, 0x130, 0xF00); + SetBattlerSpriteYOffsetFromYScale(spriteId); + if (IsContest() || GetBattlerSide(gTasks[taskId].data[11]) == B_SIDE_PLAYER) + gSprites[spriteId].pos2.y += 16; + break; + case 2: + SetSpriteRotScale(spriteId, 0xD0, 0x130, 0xF100); + SetBattlerSpriteYOffsetFromYScale(spriteId); + if (IsContest() || GetBattlerSide(gTasks[taskId].data[11]) == B_SIDE_PLAYER) + gSprites[spriteId].pos2.y += 16; + break; + } + + gSprites[spriteId].pos2.x = 2; + gTasks[taskId].data[0]++; + } + else + { + spriteId = gTasks[taskId].data[10]; + if (++gTasks[taskId].data[2] == 3) + { + gTasks[taskId].data[2] = 0; + gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; + } + + if (++gTasks[taskId].data[1] == 13) + { + ResetSpriteRotScale(spriteId); + gSprites[spriteId].pos2.x = 0; + gSprites[spriteId].pos2.y = 0; + DestroyAnimVisualTask(taskId); + } + } +} + +void sub_815CB88(struct Sprite *sprite) +{ + u8 tileOffset; + int rand1; + int rand2; + + tileOffset = Random2() % 12; + sprite->oam.tileNum += tileOffset; + rand1 = Random2() & 0x1FF; + rand2 = Random2() & 0xFF; + + if (rand1 & 1) + sprite->data[0] = 0x5E0 + rand1; + else + sprite->data[0] = 0x5E0 - rand1; + + if (rand2 & 1) + sprite->data[1] = 0x480 + rand2; + else + sprite->data[1] = 0x480 - rand2; + + sprite->data[2] = gBattleAnimArgs[0]; + if (sprite->data[2] == 0) + sprite->pos1.x = -8; + else + sprite->pos1.x = 248; + + sprite->pos1.y = 104; + sprite->callback = sub_815CC34; +} + +static void sub_815CC34(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->pos2.x += sprite->data[0] >> 8; + sprite->pos2.y -= sprite->data[1] >> 8; + } + else + { + sprite->pos2.x -= sprite->data[0] >> 8; + sprite->pos2.y -= sprite->data[1] >> 8; + } + + sprite->data[0] -= 22; + sprite->data[1] -= 48; + if (sprite->data[0] < 0) + sprite->data[0] = 0; + + if (++sprite->data[3] == 31) + DestroyAnimSprite(sprite); +} + +void sub_815CC94(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); + + sprite->data[0] = gBattleAnimArgs[2]; + sub_80A6980(sprite, FALSE); + sprite->oam.objMode = ST_OAM_OBJ_WINDOW; + sprite->invisible = 1; + sprite->callback = sub_815CD0C; +} + +static void sub_815CD0C(struct Sprite *sprite) +{ + switch (sprite->data[1]) + { + case 0: + sprite->invisible = 0; + if (sprite->affineAnimEnded) + sprite->data[1]++; + break; + case 1: + if (--sprite->data[0] == 0) + { + ChangeSpriteAffineAnim(sprite, 1); + sprite->data[1]++; + } + break; + case 2: + if (sprite->affineAnimEnded) + { + sprite->invisible = 1; + sprite->data[1]++; + } + break; + case 3: + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR); + SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) ^ DISPCNT_OBJWIN_ON); + DestroyAnimSprite(sprite); + break; + } +} + +void sub_815CDB4(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[0] = gBattleAnimArgs[0]; + sprite->data[1] = gBattleAnimArgs[1]; + sprite->callback = sub_815CDFC; + sprite->callback(sprite); +} + +static void sub_815CDFC(struct Sprite *sprite) +{ + sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8); + sprite->pos2.y = Cos(sprite->data[1], sprite->data[3] >> 8); + sprite->data[1] = (sprite->data[1] + 9) & 0xFF; + + if ((u16)sprite->data[1] < 64 || sprite->data[1] > 195) + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1; + else + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + 1; + + if (!sprite->data[5]) + { + sprite->data[2] += 0x400; + sprite->data[3] += 0x100; + sprite->data[4]++; + if (sprite->data[4] == sprite->data[0]) + { + sprite->data[4] = 0; + sprite->data[5] = 1; + } + } + else if (sprite->data[5] == 1) + { + sprite->data[2] -= 0x400; + sprite->data[3] -= 0x100; + sprite->data[4]++; + if (sprite->data[4] == sprite->data[0]) + DestroyAnimSprite(sprite); + } +} + + + +extern void sub_815D160(u8); + +void sub_815CED8(u8 taskId) +{ + u8 isBackPic; + u32 personality; + u32 otId; + u16 species; + s16 xOffset; + u32 priority; + u8 spriteId; + s16 coord1, coord2; + + GetAnimBattlerSpriteId(ANIM_ATTACKER); + if (IsContest()) + { + isBackPic = 1; + personality = gContestResources->field_18->unk10; + otId = gContestResources->field_18->unkC; + species = gContestResources->field_18->unk2; + xOffset = 20; + priority = sub_80A8328(gBattleAnimAttacker); + } + else + { + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + isBackPic = 0; + personality = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_PERSONALITY); + otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_OT_ID); + if (gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies == SPECIES_NONE) + { + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES); + else + species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES); + } + else + { + species = gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies; + } + + xOffset = 20; + priority = sub_80A8328(gBattleAnimAttacker); + } + else + { + isBackPic = 1; + personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_PERSONALITY); + otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_OT_ID); + if (gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies == SPECIES_NONE) + { + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES); + else + species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES); + } + else + { + species = gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies; + } + + xOffset = -20; + priority = sub_80A8328(gBattleAnimAttacker); + } + } + + coord1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + coord2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + spriteId = sub_80A8394(species, isBackPic, 0, coord1 + xOffset, coord2, 5, personality, otId, gBattleAnimTarget, 1); + + gSprites[spriteId].oam.priority = priority; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; + FillPalette(RGB(31, 31, 31), (gSprites[spriteId].oam.paletteNum << 4) + 0x100, 32); + gSprites[spriteId].oam.priority = priority; + SetGpuReg(REG_OFFSET_BLDCNT, 0x3F40); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); + + gTasks[taskId].data[0] = spriteId; + gTasks[taskId].func = sub_815D160; +} + +void sub_815D160(u8 taskId) +{ + if (gTasks[taskId].data[10]++ > 1) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[1]++; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); + if (gTasks[taskId].data[1] == 10) + { + gTasks[taskId].data[10] = 256; + gTasks[taskId].data[11] = 256; + gTasks[taskId].func = sub_815D1BC; + } + } +} + +static void sub_815D1BC(u8 taskId) +{ + u8 spriteId = gTasks[taskId].data[0]; + gTasks[taskId].data[10] -= 16; + gTasks[taskId].data[11] += 128; + gSprites[spriteId].oam.affineMode |= ST_OAM_AFFINE_DOUBLE_MASK; + TrySetSpriteRotScale(&gSprites[spriteId], TRUE, gTasks[taskId].data[10], gTasks[taskId].data[11], 0); + if (++gTasks[taskId].data[12] == 9) + { + sub_80A749C(&gSprites[spriteId]); + sub_80A8610(&gSprites[spriteId]); + gTasks[taskId].func = sub_80A6814; + } +} + +void sub_815D240(u8 taskId) +{ + u8 battler; + u16 bgX, bgY; + s16 y, i; + struct ScanlineEffectParams scanlineParams; + struct Task *task = &gTasks[taskId]; + + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 16; + task->data[4] = 0; + task->data[5] = battler; + task->data[6] = 32; + task->data[7] = 0; + task->data[8] = 24; + + if (GetBattlerSide(battler) == B_SIDE_OPPONENT) + task->data[8] *= -1; + + task->data[13] = GetBattlerYCoordWithElevation(battler) - 34; + if (task->data[13] < 0) + task->data[13] = 0; + + task->data[14] = task->data[13] + 66; + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + if (sub_80A8364(battler) == 1) + { + scanlineParams.dmaDest = ®_BG1HOFS; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + bgX = gBattle_BG1_X; + bgY = gBattle_BG1_Y; + } + else + { + scanlineParams.dmaDest = ®_BG2HOFS; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2); + bgX = gBattle_BG2_X; + bgY = gBattle_BG2_Y; + } + + for (y = 0, i = 0; y < 160; y++, i += 2) + { + gScanlineEffectRegBuffers[0][i] = bgX; + gScanlineEffectRegBuffers[1][i] = bgX; + gScanlineEffectRegBuffers[0][i + 1] = bgY; + gScanlineEffectRegBuffers[1][i + 1] = bgY; + } + + scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_32BIT; + scanlineParams.initState = 1; + scanlineParams.unused9 = 0; + ScanlineEffect_SetParams(scanlineParams); + task->func = sub_815D398; +} + +static void sub_815D398(u8 taskId) +{ + struct Task *task; + s16 var1; + s16 var2; + s16 bgX, bgY; + s16 offset; + s16 var0; + s16 i; + s16 sineIndex; + s16 var3; + + task = &gTasks[taskId]; + if (sub_80A8364(task->data[5]) == 1) + { + bgX = gBattle_BG1_X; + bgY = gBattle_BG1_Y; + } + else + { + bgX = gBattle_BG2_X; + bgY = gBattle_BG2_Y; + } + + switch (task->data[0]) + { + case 0: + offset = task->data[14] * 2; + var1 = 0; + var2 = 0; + i = 0; + task->data[1] = (task->data[1] + 2) & 0xFF; + sineIndex = task->data[1]; + task->data[9] = 0x7E0 / task->data[6]; + task->data[10] = -((task->data[7] * 2) / task->data[9]); + task->data[11] = task->data[7]; + var3 = task->data[11] >> 5; + task->data[12] = var3; + var0 = task->data[14]; + while (var0 > task->data[13]) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][offset + 1] = (i - var2) + bgY; + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][offset] = bgX + var3 + (gSineTable[sineIndex] >> 5); + sineIndex = (sineIndex + 10) & 0xFF; + task->data[11] += task->data[10]; + var3 = task->data[11] >> 5; + task->data[12] = var3; + + i++; + offset -= 2; + var1 += task->data[6]; + var2 = var1 >> 5; + var0--; + } + + var0 *= 2; + while (var0 >= 0) + { + gScanlineEffectRegBuffers[0][var0] = bgX + 240; + gScanlineEffectRegBuffers[1][var0] = bgX + 240; + var0 -= 2; + } + + if (++task->data[6] > 63) + { + task->data[6] = 64; + task->data[2]++; + if (task->data[2] & 1) + task->data[3]--; + else + task->data[4]++; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[3], task->data[4])); + if (task->data[3] == 0 && task->data[4] == 16) + { + task->data[2] = 0; + task->data[3] = 0; + task->data[0]++; + } + } + else + { + task->data[7] += task->data[8]; + } + break; + case 1: + if (++task->data[2] > 12) + { + gScanlineEffect.state = 3; + task->data[2] = 0; + task->data[0]++; + } + break; + case 2: + task->data[2]++; + if (task->data[2] & 1) + task->data[3]++; + else + task->data[4]--; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[3], task->data[4])); + if (task->data[3] == 16 && task->data[4] == 0) + { + task->data[2] = 0; + task->data[3] = 0; + task->data[0]++; + } + break; + case 3: + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815D64C(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + task->data[0] = 0; + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + PrepareAffineAnimInTaskData(&gTasks[taskId], task->data[15], gUnknown_085CE5F0); + task->func = sub_815D694; +} + +static void sub_815D694(u8 taskId) +{ + u16 var0; + + struct Task *task = &gTasks[taskId]; + var0 = task->data[0]; + task->data[0]++; + var0 -= 20; + if (var0 < 23) + { + if (++task->data[1] > 1) + { + task->data[1] = 0; + task->data[2]++; + if (task->data[2] & 1) + gSprites[task->data[15]].pos2.x = 1; + else + gSprites[task->data[15]].pos2.x = -1; + } + } + else + { + gSprites[task->data[15]].pos2.x = 0; + } + + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); +} + +void sub_815D72C(struct Sprite *sprite, s16 b, s16 c, s16 d, s16 e, u16 f) +{ + sprite->pos1.x = b; + sprite->pos1.y = c; + sprite->data[4] = b << 4; + sprite->data[5] = c << 4; + sprite->data[6] = ((d - b) << 4) / f; + sprite->data[7] = ((e - c) << 4) / f; +} + +void sub_815D794(struct Sprite *sprite) +{ + sprite->data[4] += sprite->data[6]; + sprite->data[5] += sprite->data[7]; + sprite->pos1.x = sprite->data[4] >> 4; + sprite->pos1.y = sprite->data[5] >> 4; +} + +void sub_815D7B4(struct Sprite *sprite) +{ + s16 x = sprite->pos1.x; + s16 y = sprite->pos1.y; + + SetSpriteCoordsToAnimAttackerCoords(sprite); + StartSpriteAffineAnim(sprite, gBattleAnimArgs[0]); + sub_815D72C(sprite, sprite->pos1.x, sprite->pos1.y, x, y, 64); + sprite->data[0] = 0; + sprite->callback = sub_815D804; +} + +static void sub_815D804(struct Sprite *sprite) +{ + int index; + + sprite->data[0]++; + index = (sprite->data[0] * 8) & 0xFF; + sub_815D794(sprite); + sprite->pos2.y = Sin(index, 8); + if (sprite->data[0] > 58) + { + if (++sprite->data[1] > 1) + { + sprite->data[1] = 0; + sprite->data[2]++; + sprite->invisible = sprite->data[2] & 1; + if (sprite->data[2] > 3) + DestroySpriteAndMatrix(sprite); + } + } +} + +void sub_815D870(struct Sprite *sprite) +{ + sprite->data[0] = gBattleAnimArgs[3]; + StartSpriteAffineAnim(sprite, gBattleAnimArgs[0]); + if (GetBattlerSide(gBattleAnimTarget) != B_SIDE_PLAYER) + gBattleAnimArgs[1] = -gBattleAnimArgs[1]; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; + sprite->callback = sub_810E2C8; +} + +static void sub_815D8D8(u8 taskId) +{ + u16 var0 = 0; + u16 var1 = 0; + + gTasks[taskId].data[0]--; + if ((gTasks[taskId].data[6] & 0x8000) && (--gTasks[taskId].data[1] == -1)) + { + if (gTasks[taskId].data[9] == 0) + { + gTasks[taskId].data[9] = gTasks[taskId].data[4]; + gTasks[taskId].data[4] = -gTasks[taskId].data[4]; + } + else + { + gTasks[taskId].data[9] = 0; + } + + if (gTasks[taskId].data[10] == 0) + { + gTasks[taskId].data[10] = gTasks[taskId].data[5]; + gTasks[taskId].data[5] = -gTasks[taskId].data[5]; + } + else + { + gTasks[taskId].data[10] = 0; + } + + gTasks[taskId].data[1] = gTasks[taskId].data[13]; + } + + var0 = gTasks[taskId].data[7]; + var1 = gTasks[taskId].data[8]; + if (gTasks[taskId].data[2] & 0x8000) + gSprites[gTasks[taskId].data[15]].pos2.x = gTasks[taskId].data[9] - (var0 >> 8); + else + gSprites[gTasks[taskId].data[15]].pos2.x = gTasks[taskId].data[9] + (var0 >> 8); + + if (gTasks[taskId].data[3] & 0x8000) + gSprites[gTasks[taskId].data[15]].pos2.y = gTasks[taskId].data[10] - (var1 >> 8); + else + gSprites[gTasks[taskId].data[15]].pos2.y = gTasks[taskId].data[10] + (var1 >> 8); + + if (gTasks[taskId].data[0] < 1) + { + DestroyTask(taskId); + gAnimVisualTaskCount--; + } +} + +static void sub_815DA20(u8 taskId) +{ + u16 var0 = 0; + u16 var1 = 0; + + gTasks[taskId].data[0]--; + if ((gTasks[taskId].data[6] & 0x8000) && (--gTasks[taskId].data[1] == -1)) + { + if (gTasks[taskId].data[9] == 0) + { + gTasks[taskId].data[9] = gTasks[taskId].data[4]; + gTasks[taskId].data[4] = -gTasks[taskId].data[4]; + } + else + { + gTasks[taskId].data[9] = var0; + } + + if (gTasks[taskId].data[10] == 0) + { + gTasks[taskId].data[10] = gTasks[taskId].data[5]; + gTasks[taskId].data[5] = -gTasks[taskId].data[5]; + } + else + { + gTasks[taskId].data[10] = 0; + } + + gTasks[taskId].data[1] = gTasks[taskId].data[13]; + } + + var0 = (gTasks[taskId].data[2] & 0x7FFF) + gTasks[taskId].data[7]; + var1 = (gTasks[taskId].data[3] & 0x7FFF) + gTasks[taskId].data[8]; + if (gTasks[taskId].data[2] & 0x8000) + gSprites[gTasks[taskId].data[15]].pos2.x = gTasks[taskId].data[9] - (var0 >> 8); + else + gSprites[gTasks[taskId].data[15]].pos2.x = gTasks[taskId].data[9] + (var0 >> 8); + + if (gTasks[taskId].data[3] & 0x8000) + gSprites[gTasks[taskId].data[15]].pos2.y = gTasks[taskId].data[10] - (var1 >> 8); + else + gSprites[gTasks[taskId].data[15]].pos2.y = gTasks[taskId].data[10] + (var1 >> 8); + + gTasks[taskId].data[7] = var0; + gTasks[taskId].data[8] = var1; + if (gTasks[taskId].data[0] < 1) + { + gTasks[taskId].data[0] = 30; + gTasks[taskId].data[13] = 0; + gTasks[taskId].func = sub_815D8D8; + } +} + +void sub_815DB90(u8 taskId) +{ + gTasks[taskId].data[15] = gBattlerSpriteIds[gBattleAnimAttacker]; + gTasks[taskId].data[14] = gBattleAnimArgs[0]; + gTasks[taskId].data[0] = gBattleAnimArgs[0]; + gTasks[taskId].data[13] = gBattleAnimArgs[6]; + if (gBattleAnimArgs[3]) + gTasks[taskId].data[6] = gTasks[taskId].data[6] | -0x8000; + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + gTasks[taskId].data[2] = gBattleAnimArgs[1]; + gTasks[taskId].data[3] = gBattleAnimArgs[2]; + } + else + { + if (gBattleAnimArgs[1] & 0x8000) + gTasks[taskId].data[2] = gBattleAnimArgs[1] & 0x7FFF; + else + gTasks[taskId].data[2] = gBattleAnimArgs[1] | -0x8000; + + if (gBattleAnimArgs[2] & 0x8000) + gTasks[taskId].data[3] = gBattleAnimArgs[2] & 0x7FFF; + else + gTasks[taskId].data[3] = gBattleAnimArgs[2] | -0x8000; + } + + gTasks[taskId].data[8] = 0; + gTasks[taskId].data[7] = 0; + gTasks[taskId].data[4] = gBattleAnimArgs[4]; + gTasks[taskId].data[5] = gBattleAnimArgs[5]; + gTasks[taskId].func = sub_815DA20; +} + +void sub_815DCA4(u8 taskId) +{ + u8 battler; + struct Task *task = &gTasks[taskId]; + + if (!gBattleAnimArgs[1]) + DestroyAnimVisualTask(taskId); + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = gBattleAnimArgs[1]; + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + task->data[4] = GetBattlerSpriteCoord(battler, 0); + task->data[5] = GetBattlerSpriteCoord(battler, 1); + task->data[6] = GetBattlerSpriteSubpriority(battler); + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + PrepareAffineAnimInTaskData(task, task->data[15], gUnknown_085CE74C); + task->func = sub_815DD48; +} + +static void sub_815DD48(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] == 6) + sub_815DDE0(taskId, TRUE); + + if (task->data[1] == 18) + sub_815DDE0(taskId, FALSE); + + if (!RunAffineAnimFromTaskData(task)) + { + if (--task->data[3] == 0) + { + task->data[0]++; + } + else + { + task->data[1] = 0; + PrepareAffineAnimInTaskData(task, task->data[15], gUnknown_085CE74C); + } + } + break; + case 1: + if (task->data[2] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_815DDE0(u8 taskId, bool8 arg1) +{ + u8 i; + s8 xOffset, yOffset; + struct Task *task; + s16 xCoords[4]; + s16 yCoords[2]; + + task = &gTasks[taskId]; + if (!arg1) + { + xOffset = 18; + yOffset = -20; + } + else + { + xOffset = 30; + yOffset = 20; + } + + xCoords[0] = task->data[4] - xOffset; + xCoords[1] = task->data[4] - xOffset - 4; + xCoords[2] = task->data[4] + xOffset; + xCoords[3] = task->data[4] + xOffset + 4; + yCoords[0] = task->data[5] + yOffset; + yCoords[1] = task->data[5] + yOffset + 6; + + for (i = 0; i < 4; i++) + { + u8 spriteId = CreateSprite(&gUnknown_085CE76C, xCoords[i], yCoords[i & 1], task->data[6] - 5); + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].data[0] = 0; + gSprites[spriteId].data[1] = i < 2 ? -2 : 2; + gSprites[spriteId].data[2] = -1; + gSprites[spriteId].data[3] = taskId; + gSprites[spriteId].data[4] = 2; + task->data[2]++; + } + } +} + +void sub_815DEBC(struct Sprite *sprite) +{ + sprite->pos1.x += sprite->data[1]; + sprite->pos1.y += sprite->data[2]; + if (++sprite->data[0] > 6) + { + gTasks[sprite->data[3]].data[sprite->data[4]]--; + DestroySprite(sprite); + } +} + +void sub_815DF0C(u8 taskId) +{ + u8 spriteId; + + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = gBattleAnimArgs[1]; + spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + gTasks[taskId].data[2] = 0x100 + gSprites[spriteId].oam.paletteNum * 16; + gTasks[taskId].func = sub_815DF64; +} + +static void sub_815DF64(u8 taskId) +{ + if (gTasks[taskId].data[1]) + { + BlendPalette(gTasks[taskId].data[2], 16, 8, gUnknown_085CE784[gTasks[taskId].data[0]]); + if (++gTasks[taskId].data[0] > 23) + gTasks[taskId].data[0] = 0; + + gTasks[taskId].data[1]--; + } + else + { + BlendPalette(gTasks[taskId].data[2], 16, 0, RGB(0, 0, 0)); + DestroyAnimVisualTask(taskId); + } +} + +void sub_815DFCC(u8 taskId) +{ + sub_8117854( + taskId, + 0, + 0x1A0, + gBattleAnimAttacker, + gBattleAnimArgs[0], + 10, + 2, + 30, + gUnknown_08C2DC68, + gUnknown_08C2DDC4, + gUnknown_08C2DDA4); +} + +void sub_815E01C(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + gBattleAnimArgs[1]; + if (gBattleAnimArgs[2] == 0) + { + sprite->data[0] = 640; + sprite->data[1] = -640; + } + else if (gBattleAnimArgs[2] == 1) + { + sprite->vFlip = 1; + sprite->data[0] = 640; + sprite->data[1] = 640; + } + else + { + StartSpriteAnim(sprite, 1); + sprite->data[0] = 640; + } + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + sprite->data[0] = -sprite->data[0]; + sprite->hFlip = 1; + } + + sprite->callback = sub_815E0DC; +} + +static void sub_815E0DC(struct Sprite *sprite) +{ + sprite->data[6] += sprite->data[0]; + sprite->data[7] += sprite->data[1]; + sprite->pos2.x = sprite->data[6] >> 8; + sprite->pos2.y = sprite->data[7] >> 8; + if (++sprite->data[5] == 14) + DestroyAnimSprite(sprite); +} + +void sub_815E114(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + if (IsContest()) + { + task->data[5] = 8; + task->data[6] = 3; + task->data[7] = 1; + } + else + { + task->data[5] = 12; + task->data[6] = 3; + task->data[7] = 0; + } + + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + sub_80A861C(gBattleAnimAttacker, 0) / 4; + else + task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) - sub_80A861C(gBattleAnimAttacker, 0) / 4; + + task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) - sub_80A861C(gBattleAnimAttacker, 0) / 4; + task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + task->func = sub_815E20C; +} + +static void sub_815E20C(u8 taskId) +{ + u8 i; + s16 x, y; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 3) + { + task->data[1] = 0; + sub_815E34C( + task->data[11], + task->data[12], + task->data[13], + task->data[14], + task->data[5], + task->data[2], + &x, + &y); + + for (i = 0; i < 2; i++) + { + u8 spriteId = CreateSprite(&gUnknown_085CE7EC, x, y, 35); + if (spriteId != MAX_SPRITES) + { + if (task->data[7] == 0) + { + if (i == 0) + gSprites[spriteId].pos2.x = gSprites[spriteId].pos2.y = -task->data[6]; + else + gSprites[spriteId].pos2.x = gSprites[spriteId].pos2.y = task->data[6]; + } + else + { + if (i == 0) + { + gSprites[spriteId].pos2.x = -task->data[6]; + gSprites[spriteId].pos2.y = task->data[6]; + } + else + { + gSprites[spriteId].pos2.x = task->data[6]; + gSprites[spriteId].pos2.y = -task->data[6]; + } + } + + gSprites[spriteId].data[0] = 0; + gSprites[spriteId].data[1] = taskId; + gSprites[spriteId].data[2] = 10; + task->data[10]++; + } + } + + if (task->data[2] == task->data[5]) + task->data[0]++; + + task->data[2]++; + } + break; + case 1: + if (task->data[10] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_815E34C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, s16 *x, s16 *y) +{ + int x2; + int y2; + + if (arg5 == 0) + { + *x = arg0; + *y = arg1; + return; + } + + if (arg5 >= arg4) + { + *x = arg2; + *y = arg3; + return; + } + + arg4--; + x2 = (arg0 << 8) + arg5 * (((arg2 - arg0) << 8) / arg4); + y2 = (arg1 << 8) + arg5 * (((arg3 - arg1) << 8) / arg4); + *x = x2 >> 8; + *y = y2 >> 8; +} + +void sub_815E404(struct Sprite *sprite) +{ + if (++sprite->data[0] > 36) + { + gTasks[sprite->data[1]].data[sprite->data[2]]--; + DestroySprite(sprite); + } +} + +void sub_815E444(struct Sprite *sprite) +{ + sprite->pos1.x = gBattleAnimArgs[0]; + sprite->pos1.y = gBattleAnimArgs[1]; + sprite->data[2] = gBattleAnimArgs[2]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->data[0] = gBattleAnimArgs[4]; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->callback = sub_80A70C0; +} + +void sub_815E47C(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + sub_80A861C(gBattleAnimTarget, 0) / 4; + task->data[15] = CreateSprite(&gUnknown_085CE84C, task->data[11], task->data[12], GetBattlerSpriteSubpriority(gBattleAnimTarget) - 5); + if (task->data[15] != MAX_SPRITES) + { + gSprites[task->data[15]].data[0] = 16; + gSprites[task->data[15]].data[2] = task->data[13]; + gSprites[task->data[15]].data[4] = task->data[14]; + gSprites[task->data[15]].data[5] = -32; + InitAnimArcTranslation(&gSprites[task->data[15]]); + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + StartSpriteAffineAnim(&gSprites[task->data[15]], 1); + + task->func = sub_815E5CC; + } + else + { + DestroyAnimVisualTask(taskId); + } +} + +static void sub_815E5CC(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 1) + { + task->data[1] = 0; + TranslateAnimArc(&gSprites[task->data[15]]); + if (++task->data[2] > 7) + task->data[0]++; + } + break; + case 1: + if (TranslateAnimArc(&gSprites[task->data[15]])) + { + task->data[1] = 0; + task->data[2] = 0; + task->data[0]++; + } + break; + case 2: + if (++task->data[1] > 1) + { + task->data[1] = 0; + task->data[2]++; + gSprites[task->data[15]].invisible = task->data[2] & 1; + if (task->data[2] == 16) + { + FreeOamMatrix(gSprites[task->data[15]].oam.matrixNum); + DestroySprite(&gSprites[task->data[15]]); + task->data[0]++; + } + } + break; + case 3: + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815E6D8(struct Sprite *sprite) +{ + u8 battler; + + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + sprite->oam.tileNum += 16; + sprite->data[6] = gBattleAnimArgs[2]; + sprite->data[7] = gBattleAnimArgs[1] == 0 ? -1 : 1; + sprite->pos1.y = GetBattlerSpriteCoord(battler, 3); + if (gBattleAnimArgs[1] == 0) + { + sprite->oam.matrixNum |= 0x8; + sprite->pos1.x = sub_80A861C(battler, 4) - 8; + } + else + { + sprite->pos1.x = sub_80A861C(battler, 5) + 8; + } + + sprite->callback = sub_815E784; +} + +static void sub_815E784(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (++sprite->data[1] > 1) + { + sprite->data[1] = 0; + sprite->pos2.x += sprite->data[7]; + if (++sprite->data[2] == 12) + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[1] == 8) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 2: + sprite->pos2.x -= sprite->data[7] * 4; + if (++sprite->data[1] == 6) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 3: + sprite->pos2.x += sprite->data[7] * 3; + if (++sprite->data[1] == 8) + { + if (--sprite->data[6]) + { + sprite->data[1] = 0; + sprite->data[0]--; + } + else + { + DestroyAnimSprite(sprite); + } + } + break; + } +} + +void sub_815E840(u8 taskId) +{ + if (gBattleAnimArgs[0] == 0) + { + DestroyAnimVisualTask(taskId); + } + else + { + gTasks[taskId].data[0] = gBattleAnimArgs[1]; + gTasks[taskId].data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + PrepareAffineAnimInTaskData(&gTasks[taskId], gTasks[taskId].data[15], gUnknown_085CE87C); + gTasks[taskId].func = sub_815E898; + } +} + +static void sub_815E898(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + if (++task->data[1] > 1) + { + task->data[1] = 0; + if (!(task->data[2] & 1)) + gSprites[task->data[15]].pos2.x = 2; + else + gSprites[task->data[15]].pos2.x = -2; + } + + if (!RunAffineAnimFromTaskData(task)) + { + gSprites[task->data[15]].pos2.x = 0; + if (--task->data[0]) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], gTasks[taskId].data[15], gUnknown_085CE87C); + task->data[1] = 0; + task->data[2] = 0; + } + else + { + DestroyAnimVisualTask(taskId); + } + } +} + +void sub_815E954(struct Sprite *sprite) +{ + if (gBattleAnimArgs[0] == 0) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = sub_80A861C(gBattleAnimAttacker, 2); + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->pos1.y = sub_80A861C(gBattleAnimTarget, 2); + } + + if (sprite->pos1.y < 8) + sprite->pos1.y = 8; + + sprite->data[0] = 0; + sprite->data[1] = gBattleAnimArgs[1]; + sprite->data[2] = 0; + sprite->data[3] = gBattleAnimArgs[2]; + sprite->callback = sub_815E9BC; +} + +static void sub_815E9BC(struct Sprite *sprite) +{ + if (++sprite->data[0] >= sprite->data[1]) + { + sprite->data[0] = 0; + sprite->data[2] = (sprite->data[2] + 1) & 1; + sprite->invisible = sprite->data[2]; + if (sprite->data[2] && --sprite->data[3] == 0) + DestroyAnimSprite(sprite); + } +} + +void sub_815EA14(struct Sprite *sprite) +{ + if (gBattleAnimArgs[0] == 0) + { + sprite->oam.matrixNum |= 0x8; + sprite->pos1.x = 100; + sprite->data[7] = 1; + } + else + { + sprite->pos1.x = 140; + sprite->data[7] = -1; + } + + sprite->pos1.y = 56; + sprite->callback = sub_815EA60; +} + +static void sub_815EA60(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos1.y -= sprite->data[7] * 2; + if (sprite->data[1] & 1) + sprite->pos1.x -= sprite->data[7] * 2; + + if (++sprite->data[1] == 9) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[1] == 4) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 2: + sprite->data[1]++; + sprite->pos1.y += sprite->data[7] * 3; + sprite->pos2.x = sprite->data[7] * (gSineTable[sprite->data[1] * 10] >> 3); + if (sprite->data[1] == 12) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 3: + if (++sprite->data[1] == 2) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 4: + sprite->data[1]++; + sprite->pos1.y -= sprite->data[7] * 3; + sprite->pos2.x = sprite->data[7] * (gSineTable[sprite->data[1] * 10] >> 3); + if (sprite->data[1] == 12) + sprite->data[0]++; + break; + case 5: + sprite->data[1]++; + sprite->pos1.y += sprite->data[7] * 3; + sprite->pos2.x = sprite->data[7] * (gSineTable[sprite->data[1] * 10] >> 3); + if (sprite->data[1] == 15) + sprite->oam.tileNum += 16; + + if (sprite->data[1] == 18) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 6: + sprite->pos1.x += sprite->data[7] * 6; + if (++sprite->data[1] == 9) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 7: + sprite->pos1.x += sprite->data[7] * 2; + if (++sprite->data[1] == 1) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 8: + sprite->pos1.x -= sprite->data[7] * 3; + if (++sprite->data[1] == 5) + DestroyAnimSprite(sprite); + break; + } +} + +void sub_815EC48(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + if (!IsContest()) + { + if (IsDoubleBattle() == TRUE) + { + int x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + int y = GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimAttacker), 0); + if (x > y) + task->data[14] = 1; + else + task->data[14] = -1; + } + else + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + task->data[14] = -1; + else + task->data[14] = 1; + } + } + else + { + task->data[14] = 1; + } + + task->func = sub_815ECE4; +} + +static void sub_815ECE4(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] == 13) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 1: + gSprites[task->data[15]].pos2.x -= task->data[14] * 3; + if (++task->data[1] == 6) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 2: + gSprites[task->data[15]].pos2.x += task->data[14] * 3; + if (++task->data[1] == 6) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 3: + if (++task->data[1] == 2) + { + task->data[1] = 0; + if (task->data[2] == 0) + { + task->data[2]++; + task->data[0] = 1; + } + else + { + task->data[0]++; + } + } + break; + case 4: + gSprites[task->data[15]].pos2.x += task->data[14]; + if (++task->data[1] == 3) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 5: + if (++task->data[1] == 6) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 6: + gSprites[task->data[15]].pos2.x -= task->data[14] * 4; + if (++task->data[1] == 5) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 7: + gSprites[task->data[15]].pos2.x += task->data[14] * 4; + if (++task->data[1] == 5) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 8: + gSprites[task->data[15]].pos2.x = 0; + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815EE84(struct Sprite *sprite) +{ + if (gBattleAnimArgs[0] == 0) + { + InitAnimSpritePos(sprite, TRUE); + sprite->data[7] = gBattleAnimAttacker; + } + else + { + sprite->data[7] = gBattleAnimTarget; + } + + if (GetBattlerSide(sprite->data[7]) == B_SIDE_OPPONENT) + sprite->oam.matrixNum = 8; + + sprite->oam.priority = sub_80A8328(sprite->data[7]); + sprite->oam.objMode = ST_OAM_OBJ_BLEND; + sprite->callback = sub_815EF08; +} + +static void sub_815EF08(struct Sprite *sprite) +{ + u16 x, y; + + switch (sprite->data[5]) + { + case 0: + switch (sprite->data[6]) + { + default: + sprite->data[6] = 0; + case 0: + case 4: + x = sub_80A861C(sprite->data[7], 5) - 4; + y = sub_80A861C(sprite->data[7], 3) - 4; + break; + case 1: + x = sub_80A861C(sprite->data[7], 5) - 4; + y = sub_80A861C(sprite->data[7], 2) + 4; + break; + case 2: + x = sub_80A861C(sprite->data[7], 4) + 4; + y = sub_80A861C(sprite->data[7], 3) - 4; + break; + case 3: + x = sub_80A861C(sprite->data[7], 4) + 4; + y = sub_80A861C(sprite->data[7], 2) - 4; + break; + case 5: + x = GetBattlerSpriteCoord(sprite->data[7], 2); + y = GetBattlerSpriteCoord(sprite->data[7], 3); + break; + } + + if (sprite->data[6] == 4) + sprite->data[0] = 24; + else if (sprite->data[6] == 5) + sprite->data[0] = 6; + else + sprite->data[0] = 12; + + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = x; + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = y; + InitAnimLinearTranslation(sprite); + sprite->data[5]++; + break; + case 1: + if (TranslateAnimLinear(sprite)) + { + switch (sprite->data[6]) + { + default: + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data[0] = 0; + sprite->data[5]++; + sprite->data[6]++; + break; + case 4: + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data[5] = 0; + sprite->data[6]++; + break; + case 5: + sprite->data[0] = 0; + sprite->data[1] = 16; + sprite->data[2] = 0; + sprite->data[5] = 3; + break; + } + } + break; + case 2: + if (++sprite->data[0] == 4) + sprite->data[5] = 0; + break; + case 3: + if (!(sprite->data[0] & 1)) + sprite->data[1]--; + else + sprite->data[2]++; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[1], sprite->data[2])); + if (++sprite->data[0] == 32) + { + sprite->invisible = 1; + sprite->data[5]++; + } + break; + case 4: + DestroyAnimSprite(sprite); + break; + } +} + +static void sub_815F10C(struct Sprite *sprite) +{ + sprite->pos2.x = ((sprite->data[2] - sprite->data[0]) * sprite->data[5]) / sprite->data[4]; + sprite->pos2.y = ((sprite->data[3] - sprite->data[1]) * sprite->data[5]) / sprite->data[4]; + if (!(sprite->data[5] & 1)) + { + CreateSprite( + &gUnknown_085CE3A0, + sprite->pos1.x + sprite->pos2.x, + sprite->pos1.y + sprite->pos2.y, 5); + } + + if (sprite->data[5] == sprite->data[4]) + DestroyAnimSprite(sprite); + + sprite->data[5]++; +} + +void sub_815F18C(struct Sprite *sprite) +{ + GetBattlerSpriteCoord(gBattleAnimTarget, 2); // unused local variable + GetBattlerSpriteCoord(gBattleAnimTarget, 3); // unused local variable + + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER || IsContest()) + { + sprite->data[0] = sprite->pos1.x - gBattleAnimArgs[0]; + sprite->data[2] = sprite->pos1.x - gBattleAnimArgs[2]; + } + else + { + sprite->data[0] = sprite->pos1.x + gBattleAnimArgs[0]; + sprite->data[2] = sprite->pos1.x + gBattleAnimArgs[2]; + } + + sprite->data[1] = sprite->pos1.y + gBattleAnimArgs[1]; + sprite->data[3] = sprite->pos1.y + gBattleAnimArgs[3]; + sprite->data[4] = gBattleAnimArgs[4]; + sprite->pos1.x = sprite->data[0]; + sprite->pos1.y = sprite->data[1]; + sprite->callback = sub_815F10C; +} + +void AnimTask_MonToSubstitute(u8 taskId) +{ + int i; + u8 spriteId = GetAnimBattlerSpriteId(0); + + if (gTasks[taskId].data[0] == 0) + { + PrepareBattlerSpriteForRotScale(spriteId, FALSE); + gTasks[taskId].data[1] = 0x100; + gTasks[taskId].data[2] = 0x100; + gTasks[taskId].data[0]++; + } + else if (gTasks[taskId].data[0] == 1) + { + gTasks[taskId].data[1] += 0x60; + gTasks[taskId].data[2] -= 0xD; + SetSpriteRotScale(spriteId, gTasks[taskId].data[1], gTasks[taskId].data[2], 0); + if (++gTasks[taskId].data[3] == 9) + { + gTasks[taskId].data[3] = 0; + ResetSpriteRotScale(spriteId); + gSprites[spriteId].invisible = 1; + gTasks[taskId].data[0]++; + } + } + else + { + LoadBattleMonGfxAndAnimate(gBattleAnimAttacker, 0, spriteId); + if (IsContest()) + { + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF6C0; + StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0); + } + + for (i = 0; i < 16; i++) + gTasks[taskId].data[i] = 0; + + gTasks[taskId].func = sub_815F330; + } +} + +static void sub_815F330(u8 taskId) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + + switch (gTasks[taskId].data[0]) + { + case 0: + gSprites[spriteId].pos2.y = -200; + gSprites[spriteId].pos2.x = 200; + gSprites[spriteId].invisible = 0; + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[0]++; + break; + case 1: + gTasks[taskId].data[10] += 112; + gSprites[spriteId].pos2.y += gTasks[taskId].data[10] >> 8; + if (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y >= -32) + gSprites[spriteId].pos2.x = 0; + + if (gSprites[spriteId].pos2.y > 0) + gSprites[spriteId].pos2.y = 0; + + if (gSprites[spriteId].pos2.y == 0) + { + PlaySE12WithPanning(SE_W145B, BattleAnimAdjustPanning(-64)); + gTasks[taskId].data[10] -= 0x800; + gTasks[taskId].data[0]++; + } + break; + case 2: + gTasks[taskId].data[10] -= 112; + if (gTasks[taskId].data[10] < 0) + gTasks[taskId].data[10] = 0; + + gSprites[spriteId].pos2.y -= gTasks[taskId].data[10] >> 8; + if (gTasks[taskId].data[10] == 0) + gTasks[taskId].data[0]++; + break; + case 3: + gTasks[taskId].data[10] += 112; + gSprites[spriteId].pos2.y += gTasks[taskId].data[10] >> 8; + if (gSprites[spriteId].pos2.y > 0) + gSprites[spriteId].pos2.y = 0; + + if (gSprites[spriteId].pos2.y == 0) + { + PlaySE12WithPanning(SE_W145B, BattleAnimAdjustPanning(-64)); + DestroyAnimVisualTask(taskId); + } + break; + } +} + +void sub_815F48C(struct Sprite *sprite) +{ + s16 y2; + + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + { + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 2; + y2 = -144; + } + else + { + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 2; + y2 = -96; + } + + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->pos2.y = y2; + sprite->callback = sub_815F4F0; +} + +static void sub_815F4F0(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos2.y += 10; + if (sprite->pos2.y >= 0) + { + PlaySE12WithPanning(SE_W166, BattleAnimAdjustPanning(63)); + sprite->pos2.y = 0; + sprite->data[0]++; + } + break; + case 1: + sprite->data[1] += 4; + sprite->pos2.y = -(gSineTable[sprite->data[1]] >> 3); + if (sprite->data[1] > 127) + { + PlaySE12WithPanning(SE_W166, BattleAnimAdjustPanning(63)); + sprite->data[1] = 0; + sprite->pos2.y = 0; + sprite->data[0]++; + } + break; + case 2: + sprite->data[1] += 6; + sprite->pos2.y = -(gSineTable[sprite->data[1]] >> 4); + if (sprite->data[1] > 127) + { + sprite->data[1] = 0; + sprite->pos2.y = 0; + sprite->data[0]++; + } + break; + case 3: + if (++sprite->data[1] > 8) + { + PlaySE12WithPanning(SE_W043, BattleAnimAdjustPanning(63)); + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 4: + if (++sprite->data[1] > 8) + { + sprite->data[1] = 0; + sprite->data[2]++; + sprite->invisible = sprite->data[2] & 1; + if (sprite->data[2] == 7) + DestroyAnimSprite(sprite); + } + break; + } +} + +void sub_815F620(u8 taskId) +{ + s16 spriteId1, spriteId2; + + if (IsContest()) + { + DestroyAnimVisualTask(taskId); + return; + } + + spriteId1 = CloneBattlerSpriteWithBlend(ANIM_TARGET); + if (spriteId1 < 0) + { + DestroyAnimVisualTask(taskId); + return; + } + + spriteId2 = CloneBattlerSpriteWithBlend(ANIM_TARGET); + if (spriteId2 < 0) + { + obj_delete_but_dont_free_vram(&gSprites[spriteId1]); + DestroyAnimVisualTask(taskId); + return; + } + + gSprites[spriteId2].pos2.x += 24; + gSprites[spriteId1].pos2.x -= 24; + gSprites[spriteId2].data[0] = 0; + gSprites[spriteId1].data[0] = 0; + gSprites[spriteId2].data[1] = 0; + gSprites[spriteId1].data[1] = 0; + gSprites[spriteId2].data[2] = 0; + gSprites[spriteId1].data[2] = 0; + gSprites[spriteId2].data[3] = 16; + gSprites[spriteId1].data[3] = -16; + gSprites[spriteId2].data[4] = 0; + gSprites[spriteId1].data[4] = 128; + gSprites[spriteId2].data[5] = 24; + gSprites[spriteId1].data[5] = 24; + gSprites[spriteId2].data[6] = taskId; + gSprites[spriteId1].data[6] = taskId; + gSprites[spriteId2].data[7] = 0; + gSprites[spriteId1].data[7] = 0; + gTasks[taskId].data[0] = 2; + + if (!gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].invisible) + { + gSprites[spriteId2].invisible = 0; + gSprites[spriteId1].invisible = 1; + } + else + { + gSprites[spriteId2].invisible = 1; + gSprites[spriteId1].invisible = 1; + } + + + gSprites[spriteId2].oam.objMode = ST_OAM_OBJ_NORMAL; + gSprites[spriteId1].oam.objMode = ST_OAM_OBJ_NORMAL; + gSprites[spriteId2].callback = sub_815F7C4; + gSprites[spriteId1].callback = sub_815F7C4; + gTasks[taskId].func = sub_815F79C; +} + +static void sub_815F79C(u8 taskId) +{ + if (gTasks[taskId].data[0] == 0) + DestroyAnimVisualTask(taskId); +} + +static void sub_815F7C4(struct Sprite *sprite) +{ + int zero = 0; + if (++sprite->data[1] > 1) + { + sprite->data[1] = 0; + if (!gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].invisible) + sprite->invisible ^= 1; + } + + sprite->data[4] = sprite->data[4] + sprite->data[3]; + sprite->data[4] &= 0xFF; + sprite->pos2.x = Cos(sprite->data[4], sprite->data[5]); + switch (sprite->data[0]) + { + case 0: + if (++sprite->data[2] == 60) + { + sprite->data[2] = 0; + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[2] > 0) + { + sprite->data[2] = 0; + sprite->data[5] -= 2; + if (sprite->data[5] < 0) + { + gTasks[sprite->data[6]].data[sprite->data[7]]--; + obj_delete_but_dont_free_vram(sprite); + } + } + break; + } +} diff --git a/src/graphics.c b/src/graphics.c index b2de074bc..c0deb2883 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -897,9 +897,9 @@ const u32 gBattleStatMask6_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat6 const u32 gBattleStatMask7_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat7.gbapal.lz"); const u32 gBattleStatMask8_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat8.gbapal.lz"); -const u32 gUnknown_08C2DC68[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.4bpp.lz"); -const u32 gUnknown_08C2DDA4[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.gbapal.lz"); -const u32 gUnknown_08C2DDC4[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.bin.lz"); +const u8 gUnknown_08C2DC68[] = INCBIN_U8("graphics/battle_anims/masks/cure_bubbles.4bpp.lz"); +const u16 gUnknown_08C2DDA4[] = INCBIN_U16("graphics/battle_anims/masks/cure_bubbles.gbapal.lz"); +const u8 gUnknown_08C2DDC4[] = INCBIN_U8("graphics/battle_anims/masks/cure_bubbles.bin.lz"); const u32 gBattleAnimSpritePalette_245[] = INCBIN_U32("graphics/battle_anims/sprites/245.gbapal.lz"); const u32 gBattleAnimSpriteSheet_245[] = INCBIN_U32("graphics/battle_anims/sprites/245.4bpp.lz");