diff --git a/include/data/pokeicon_palettes.h b/include/data/pokeicon_palettes.h new file mode 100644 index 0000000000..e9ee57e610 --- /dev/null +++ b/include/data/pokeicon_palettes.h @@ -0,0 +1,598 @@ +#include "constants/species.h" + +enum { + ICON_EGG = SPECIES_EGG, + ICON_MANAPHY_EGG, + ICON_DEOXYS_ATTACK, + ICON_DEOXYS_DEFENSE, + ICON_DEOXYS_SPEED, + ICON_UNOWN_A, + ICON_UNOWN_B, + ICON_UNOWN_C, + ICON_UNOWN_D, + ICON_UNOWN_E, + ICON_UNOWN_F, + ICON_UNOWN_G, + ICON_UNOWN_H, + ICON_UNOWN_I, + ICON_UNOWN_J, + ICON_UNOWN_K, + ICON_UNOWN_L, + ICON_UNOWN_M, + ICON_UNOWN_N, + ICON_UNOWN_O, + ICON_UNOWN_P, + ICON_UNOWN_Q, + ICON_UNOWN_R, + ICON_UNOWN_S, + ICON_UNOWN_T, + ICON_UNOWN_U, + ICON_UNOWN_V, + ICON_UNOWN_W, + ICON_UNOWN_X, + ICON_UNOWN_Y, + ICON_UNOWN_Z, + ICON_UNOWN_EXC, + ICON_UNOWN_QUE, + ICON_BURMY_SANDY, + ICON_BURMY_TRASH, + ICON_WORMADAM_SANDY, + ICON_WORMADAM_TRASH, + ICON_SHELLOS_EAST_SEA, + ICON_GASTRODON_EAST_SEA, + ICON_GIRATINA_ORIGIN, + ICON_SHAYMIN_SKY, + ICON_ROTOM_HEAT, + ICON_ROTOM_WASH, + ICON_ROTOM_FROST, + ICON_ROTOM_FAN, + ICON_ROTOM_MOW, +}; + +/** + * @brief This table defines which index of the shared palette file is used + * for the icons used by Pokemon in PC boxes, the party list, etc. Alternate + * forms are listed after the full National Dex using a custom ordering. + */ +const u8 sPokemonIconPaletteIndex[] = { + [SPECIES_NONE] = 0, + [SPECIES_BULBASAUR] = 1, + [SPECIES_IVYSAUR] = 1, + [SPECIES_VENUSAUR] = 1, + [SPECIES_CHARMANDER] = 0, + [SPECIES_CHARMELEON] = 0, + [SPECIES_CHARIZARD] = 0, + [SPECIES_SQUIRTLE] = 0, + [SPECIES_WARTORTLE] = 2, + [SPECIES_BLASTOISE] = 2, + [SPECIES_CATERPIE] = 1, + [SPECIES_METAPOD] = 1, + [SPECIES_BUTTERFREE] = 0, + [SPECIES_WEEDLE] = 1, + [SPECIES_KAKUNA] = 2, + [SPECIES_BEEDRILL] = 2, + [SPECIES_PIDGEY] = 0, + [SPECIES_PIDGEOTTO] = 0, + [SPECIES_PIDGEOT] = 0, + [SPECIES_RATTATA] = 2, + [SPECIES_RATICATE] = 1, + [SPECIES_SPEAROW] = 0, + [SPECIES_FEAROW] = 0, + [SPECIES_EKANS] = 2, + [SPECIES_ARBOK] = 2, + [SPECIES_PIKACHU] = 2, + [SPECIES_RAICHU] = 0, + [SPECIES_SANDSHREW] = 2, + [SPECIES_SANDSLASH] = 2, + [SPECIES_NIDORAN_F] = 2, + [SPECIES_NIDORINA] = 2, + [SPECIES_NIDOQUEEN] = 2, + [SPECIES_NIDORAN_M] = 2, + [SPECIES_NIDORINO] = 2, + [SPECIES_NIDOKING] = 2, + [SPECIES_CLEFAIRY] = 0, + [SPECIES_CLEFABLE] = 0, + [SPECIES_VULPIX] = 2, + [SPECIES_NINETALES] = 1, + [SPECIES_JIGGLYPUFF] = 0, + [SPECIES_WIGGLYTUFF] = 0, + [SPECIES_ZUBAT] = 2, + [SPECIES_GOLBAT] = 2, + [SPECIES_ODDISH] = 1, + [SPECIES_GLOOM] = 0, + [SPECIES_VILEPLUME] = 0, + [SPECIES_PARAS] = 0, + [SPECIES_PARASECT] = 0, + [SPECIES_VENONAT] = 0, + [SPECIES_VENOMOTH] = 2, + [SPECIES_DIGLETT] = 2, + [SPECIES_DUGTRIO] = 2, + [SPECIES_MEOWTH] = 1, + [SPECIES_PERSIAN] = 1, + [SPECIES_PSYDUCK] = 1, + [SPECIES_GOLDUCK] = 2, + [SPECIES_MANKEY] = 1, + [SPECIES_PRIMEAPE] = 2, + [SPECIES_GROWLITHE] = 0, + [SPECIES_ARCANINE] = 0, + [SPECIES_POLIWAG] = 0, + [SPECIES_POLIWHIRL] = 0, + [SPECIES_POLIWRATH] = 0, + [SPECIES_ABRA] = 2, + [SPECIES_KADABRA] = 2, + [SPECIES_ALAKAZAM] = 2, + [SPECIES_MACHOP] = 0, + [SPECIES_MACHOKE] = 2, + [SPECIES_MACHAMP] = 0, + [SPECIES_BELLSPROUT] = 1, + [SPECIES_WEEPINBELL] = 1, + [SPECIES_VICTREEBEL] = 1, + [SPECIES_TENTACOOL] = 2, + [SPECIES_TENTACRUEL] = 2, + [SPECIES_GEODUDE] = 1, + [SPECIES_GRAVELER] = 1, + [SPECIES_GOLEM] = 1, + [SPECIES_PONYTA] = 0, + [SPECIES_RAPIDASH] = 0, + [SPECIES_SLOWPOKE] = 0, + [SPECIES_SLOWBRO] = 0, + [SPECIES_MAGNEMITE] = 0, + [SPECIES_MAGNETON] = 0, + [SPECIES_FARFETCHD] = 1, + [SPECIES_DODUO] = 2, + [SPECIES_DODRIO] = 2, + [SPECIES_SEEL] = 2, + [SPECIES_DEWGONG] = 2, + [SPECIES_GRIMER] = 2, + [SPECIES_MUK] = 2, + [SPECIES_SHELLDER] = 2, + [SPECIES_CLOYSTER] = 2, + [SPECIES_GASTLY] = 2, + [SPECIES_HAUNTER] = 2, + [SPECIES_GENGAR] = 2, + [SPECIES_ONIX] = 2, + [SPECIES_DROWZEE] = 2, + [SPECIES_HYPNO] = 1, + [SPECIES_KRABBY] = 2, + [SPECIES_KINGLER] = 2, + [SPECIES_VOLTORB] = 0, + [SPECIES_ELECTRODE] = 0, + [SPECIES_EXEGGCUTE] = 0, + [SPECIES_EXEGGUTOR] = 1, + [SPECIES_CUBONE] = 1, + [SPECIES_MAROWAK] = 1, + [SPECIES_HITMONLEE] = 2, + [SPECIES_HITMONCHAN] = 2, + [SPECIES_LICKITUNG] = 1, + [SPECIES_KOFFING] = 2, + [SPECIES_WEEZING] = 2, + [SPECIES_RHYHORN] = 1, + [SPECIES_RHYDON] = 1, + [SPECIES_CHANSEY] = 0, + [SPECIES_TANGELA] = 0, + [SPECIES_KANGASKHAN] = 1, + [SPECIES_HORSEA] = 0, + [SPECIES_SEADRA] = 0, + [SPECIES_GOLDEEN] = 0, + [SPECIES_SEAKING] = 0, + [SPECIES_STARYU] = 2, + [SPECIES_STARMIE] = 2, + [SPECIES_MR_MIME] = 0, + [SPECIES_SCYTHER] = 1, + [SPECIES_JYNX] = 2, + [SPECIES_ELECTABUZZ] = 1, + [SPECIES_MAGMAR] = 0, + [SPECIES_PINSIR] = 2, + [SPECIES_TAUROS] = 2, + [SPECIES_MAGIKARP] = 0, + [SPECIES_GYARADOS] = 0, + [SPECIES_LAPRAS] = 2, + [SPECIES_DITTO] = 2, + [SPECIES_EEVEE] = 2, + [SPECIES_VAPOREON] = 0, + [SPECIES_JOLTEON] = 0, + [SPECIES_FLAREON] = 0, + [SPECIES_PORYGON] = 0, + [SPECIES_OMANYTE] = 0, + [SPECIES_OMASTAR] = 0, + [SPECIES_KABUTO] = 2, + [SPECIES_KABUTOPS] = 2, + [SPECIES_AERODACTYL] = 0, + [SPECIES_SNORLAX] = 1, + [SPECIES_ARTICUNO] = 0, + [SPECIES_ZAPDOS] = 0, + [SPECIES_MOLTRES] = 0, + [SPECIES_DRATINI] = 0, + [SPECIES_DRAGONAIR] = 0, + [SPECIES_DRAGONITE] = 2, + [SPECIES_MEWTWO] = 2, + [SPECIES_MEW] = 0, + [SPECIES_CHIKORITA] = 1, + [SPECIES_BAYLEEF] = 1, + [SPECIES_MEGANIUM] = 1, + [SPECIES_CYNDAQUIL] = 1, + [SPECIES_QUILAVA] = 1, + [SPECIES_TYPHLOSION] = 1, + [SPECIES_TOTODILE] = 2, + [SPECIES_CROCONAW] = 2, + [SPECIES_FERALIGATR] = 2, + [SPECIES_SENTRET] = 2, + [SPECIES_FURRET] = 2, + [SPECIES_HOOTHOOT] = 2, + [SPECIES_NOCTOWL] = 2, + [SPECIES_LEDYBA] = 0, + [SPECIES_LEDIAN] = 0, + [SPECIES_SPINARAK] = 1, + [SPECIES_ARIADOS] = 0, + [SPECIES_CROBAT] = 2, + [SPECIES_CHINCHOU] = 2, + [SPECIES_LANTURN] = 0, + [SPECIES_PICHU] = 0, + [SPECIES_CLEFFA] = 0, + [SPECIES_IGGLYBUFF] = 1, + [SPECIES_TOGEPI] = 2, + [SPECIES_TOGETIC] = 2, + [SPECIES_NATU] = 0, + [SPECIES_XATU] = 0, + [SPECIES_MAREEP] = 2, + [SPECIES_FLAAFFY] = 0, + [SPECIES_AMPHAROS] = 0, + [SPECIES_BELLOSSOM] = 1, + [SPECIES_MARILL] = 2, + [SPECIES_AZUMARILL] = 2, + [SPECIES_SUDOWOODO] = 1, + [SPECIES_POLITOED] = 1, + [SPECIES_HOPPIP] = 1, + [SPECIES_SKIPLOOM] = 1, + [SPECIES_JUMPLUFF] = 2, + [SPECIES_AIPOM] = 2, + [SPECIES_SUNKERN] = 1, + [SPECIES_SUNFLORA] = 1, + [SPECIES_YANMA] = 1, + [SPECIES_WOOPER] = 0, + [SPECIES_QUAGSIRE] = 0, + [SPECIES_ESPEON] = 2, + [SPECIES_UMBREON] = 2, + [SPECIES_MURKROW] = 2, + [SPECIES_SLOWKING] = 0, + [SPECIES_MISDREAVUS] = 0, + [SPECIES_UNOWN] = 0, + [SPECIES_WOBBUFFET] = 0, + [SPECIES_GIRAFARIG] = 1, + [SPECIES_PINECO] = 0, + [SPECIES_FORRETRESS] = 2, + [SPECIES_DUNSPARCE] = 2, + [SPECIES_GLIGAR] = 2, + [SPECIES_STEELIX] = 0, + [SPECIES_SNUBBULL] = 0, + [SPECIES_GRANBULL] = 2, + [SPECIES_QWILFISH] = 0, + [SPECIES_SCIZOR] = 0, + [SPECIES_SHUCKLE] = 1, + [SPECIES_HERACROSS] = 2, + [SPECIES_SNEASEL] = 0, + [SPECIES_TEDDIURSA] = 0, + [SPECIES_URSARING] = 2, + [SPECIES_SLUGMA] = 0, + [SPECIES_MAGCARGO] = 0, + [SPECIES_SWINUB] = 2, + [SPECIES_PILOSWINE] = 2, + [SPECIES_CORSOLA] = 0, + [SPECIES_REMORAID] = 0, + [SPECIES_OCTILLERY] = 0, + [SPECIES_DELIBIRD] = 0, + [SPECIES_MANTINE] = 2, + [SPECIES_SKARMORY] = 0, + [SPECIES_HOUNDOUR] = 0, + [SPECIES_HOUNDOOM] = 0, + [SPECIES_KINGDRA] = 0, + [SPECIES_PHANPY] = 0, + [SPECIES_DONPHAN] = 0, + [SPECIES_PORYGON2] = 0, + [SPECIES_STANTLER] = 2, + [SPECIES_SMEARGLE] = 1, + [SPECIES_TYROGUE] = 2, + [SPECIES_HITMONTOP] = 2, + [SPECIES_SMOOCHUM] = 1, + [SPECIES_ELEKID] = 1, + [SPECIES_MAGBY] = 1, + [SPECIES_MILTANK] = 1, + [SPECIES_BLISSEY] = 1, + [SPECIES_RAIKOU] = 0, + [SPECIES_ENTEI] = 2, + [SPECIES_SUICUNE] = 0, + [SPECIES_LARVITAR] = 1, + [SPECIES_PUPITAR] = 0, + [SPECIES_TYRANITAR] = 1, + [SPECIES_LUGIA] = 0, + [SPECIES_HO_OH] = 1, + [SPECIES_CELEBI] = 1, + [SPECIES_TREECKO] = 1, + [SPECIES_GROVYLE] = 0, + [SPECIES_SCEPTILE] = 1, + [SPECIES_TORCHIC] = 0, + [SPECIES_COMBUSKEN] = 0, + [SPECIES_BLAZIKEN] = 0, + [SPECIES_MUDKIP] = 0, + [SPECIES_MARSHTOMP] = 0, + [SPECIES_SWAMPERT] = 0, + [SPECIES_POOCHYENA] = 2, + [SPECIES_MIGHTYENA] = 2, + [SPECIES_ZIGZAGOON] = 2, + [SPECIES_LINOONE] = 2, + [SPECIES_WURMPLE] = 0, + [SPECIES_SILCOON] = 2, + [SPECIES_BEAUTIFLY] = 0, + [SPECIES_CASCOON] = 2, + [SPECIES_DUSTOX] = 1, + [SPECIES_LOTAD] = 1, + [SPECIES_LOMBRE] = 1, + [SPECIES_LUDICOLO] = 1, + [SPECIES_SEEDOT] = 1, + [SPECIES_NUZLEAF] = 1, + [SPECIES_SHIFTRY] = 0, + [SPECIES_TAILLOW] = 2, + [SPECIES_SWELLOW] = 2, + [SPECIES_WINGULL] = 0, + [SPECIES_PELIPPER] = 0, + [SPECIES_RALTS] = 1, + [SPECIES_KIRLIA] = 1, + [SPECIES_GARDEVOIR] = 1, + [SPECIES_SURSKIT] = 2, + [SPECIES_MASQUERAIN] = 0, + [SPECIES_SHROOMISH] = 1, + [SPECIES_BRELOOM] = 1, + [SPECIES_SLAKOTH] = 2, + [SPECIES_VIGOROTH] = 2, + [SPECIES_SLAKING] = 1, + [SPECIES_NINCADA] = 1, + [SPECIES_NINJASK] = 1, + [SPECIES_SHEDINJA] = 1, + [SPECIES_WHISMUR] = 0, + [SPECIES_LOUDRED] = 2, + [SPECIES_EXPLOUD] = 2, + [SPECIES_MAKUHITA] = 2, + [SPECIES_HARIYAMA] = 1, + [SPECIES_AZURILL] = 2, + [SPECIES_NOSEPASS] = 0, + [SPECIES_SKITTY] = 0, + [SPECIES_DELCATTY] = 2, + [SPECIES_SABLEYE] = 2, + [SPECIES_MAWILE] = 2, + [SPECIES_ARON] = 2, + [SPECIES_LAIRON] = 2, + [SPECIES_AGGRON] = 2, + [SPECIES_MEDITITE] = 0, + [SPECIES_MEDICHAM] = 0, + [SPECIES_ELECTRIKE] = 1, + [SPECIES_MANECTRIC] = 0, + [SPECIES_PLUSLE] = 0, + [SPECIES_MINUN] = 0, + [SPECIES_VOLBEAT] = 0, + [SPECIES_ILLUMISE] = 2, + [SPECIES_ROSELIA] = 0, + [SPECIES_GULPIN] = 1, + [SPECIES_SWALOT] = 2, + [SPECIES_CARVANHA] = 0, + [SPECIES_SHARPEDO] = 0, + [SPECIES_WAILMER] = 2, + [SPECIES_WAILORD] = 0, + [SPECIES_NUMEL] = 1, + [SPECIES_CAMERUPT] = 0, + [SPECIES_TORKOAL] = 1, + [SPECIES_SPOINK] = 0, + [SPECIES_GRUMPIG] = 2, + [SPECIES_SPINDA] = 1, + [SPECIES_TRAPINCH] = 1, + [SPECIES_VIBRAVA] = 1, + [SPECIES_FLYGON] = 1, + [SPECIES_CACNEA] = 1, + [SPECIES_CACTURNE] = 1, + [SPECIES_SWABLU] = 0, + [SPECIES_ALTARIA] = 0, + [SPECIES_ZANGOOSE] = 0, + [SPECIES_SEVIPER] = 2, + [SPECIES_LUNATONE] = 1, + [SPECIES_SOLROCK] = 0, + [SPECIES_BARBOACH] = 0, + [SPECIES_WHISCASH] = 0, + [SPECIES_CORPHISH] = 0, + [SPECIES_CRAWDAUNT] = 0, + [SPECIES_BALTOY] = 1, + [SPECIES_CLAYDOL] = 0, + [SPECIES_LILEEP] = 2, + [SPECIES_CRADILY] = 0, + [SPECIES_ANORITH] = 0, + [SPECIES_ARMALDO] = 0, + [SPECIES_FEEBAS] = 2, + [SPECIES_MILOTIC] = 0, + [SPECIES_CASTFORM] = 0, + [SPECIES_KECLEON] = 1, + [SPECIES_SHUPPET] = 0, + [SPECIES_BANETTE] = 0, + [SPECIES_DUSKULL] = 0, + [SPECIES_DUSCLOPS] = 0, + [SPECIES_TROPIUS] = 1, + [SPECIES_CHIMECHO] = 0, + [SPECIES_ABSOL] = 0, + [SPECIES_WYNAUT] = 0, + [SPECIES_SNORUNT] = 2, + [SPECIES_GLALIE] = 0, + [SPECIES_SPHEAL] = 2, + [SPECIES_SEALEO] = 2, + [SPECIES_WALREIN] = 0, + [SPECIES_CLAMPERL] = 0, + [SPECIES_HUNTAIL] = 0, + [SPECIES_GOREBYSS] = 0, + [SPECIES_RELICANTH] = 1, + [SPECIES_LUVDISC] = 0, + [SPECIES_BAGON] = 2, + [SPECIES_SHELGON] = 2, + [SPECIES_SALAMENCE] = 0, + [SPECIES_BELDUM] = 0, + [SPECIES_METANG] = 0, + [SPECIES_METAGROSS] = 0, + [SPECIES_REGIROCK] = 2, + [SPECIES_REGICE] = 2, + [SPECIES_REGISTEEL] = 0, + [SPECIES_LATIAS] = 0, + [SPECIES_LATIOS] = 2, + [SPECIES_KYOGRE] = 2, + [SPECIES_GROUDON] = 0, + [SPECIES_RAYQUAZA] = 1, + [SPECIES_JIRACHI] = 0, + [SPECIES_DEOXYS] = 0, + [SPECIES_TURTWIG] = 1, + [SPECIES_GROTLE] = 1, + [SPECIES_TORTERRA] = 1, + [SPECIES_CHIMCHAR] = 1, + [SPECIES_MONFERNO] = 0, + [SPECIES_INFERNAPE] = 0, + [SPECIES_PIPLUP] = 2, + [SPECIES_PRINPLUP] = 2, + [SPECIES_EMPOLEON] = 0, + [SPECIES_STARLY] = 0, + [SPECIES_STARAVIA] = 0, + [SPECIES_STARAPTOR] = 0, + [SPECIES_BIDOOF] = 2, + [SPECIES_BIBAREL] = 2, + [SPECIES_KRICKETOT] = 0, + [SPECIES_KRICKETUNE] = 0, + [SPECIES_SHINX] = 0, + [SPECIES_LUXIO] = 0, + [SPECIES_LUXRAY] = 0, + [SPECIES_BUDEW] = 1, + [SPECIES_ROSERADE] = 0, + [SPECIES_CRANIDOS] = 0, + [SPECIES_RAMPARDOS] = 0, + [SPECIES_SHIELDON] = 1, + [SPECIES_BASTIODON] = 1, + [SPECIES_BURMY] = 1, + [SPECIES_WORMADAM] = 1, + [SPECIES_MOTHIM] = 0, + [SPECIES_COMBEE] = 0, + [SPECIES_VESPIQUEN] = 0, + [SPECIES_PACHIRISU] = 0, + [SPECIES_BUIZEL] = 0, + [SPECIES_FLOATZEL] = 0, + [SPECIES_CHERUBI] = 1, + [SPECIES_CHERRIM] = 0, + [SPECIES_SHELLOS] = 0, + [SPECIES_GASTRODON] = 0, + [SPECIES_AMBIPOM] = 2, + [SPECIES_DRIFLOON] = 2, + [SPECIES_DRIFBLIM] = 2, + [SPECIES_BUNEARY] = 2, + [SPECIES_LOPUNNY] = 2, + [SPECIES_MISMAGIUS] = 0, + [SPECIES_HONCHKROW] = 1, + [SPECIES_GLAMEOW] = 0, + [SPECIES_PURUGLY] = 2, + [SPECIES_CHINGLING] = 0, + [SPECIES_STUNKY] = 2, + [SPECIES_SKUNTANK] = 2, + [SPECIES_BRONZOR] = 0, + [SPECIES_BRONZONG] = 0, + [SPECIES_BONSLY] = 1, + [SPECIES_MIME_JR] = 0, + [SPECIES_HAPPINY] = 0, + [SPECIES_CHATOT] = 0, + [SPECIES_SPIRITOMB] = 0, + [SPECIES_GIBLE] = 0, + [SPECIES_GABITE] = 0, + [SPECIES_GARCHOMP] = 0, + [SPECIES_MUNCHLAX] = 2, + [SPECIES_RIOLU] = 2, + [SPECIES_LUCARIO] = 2, + [SPECIES_HIPPOPOTAS] = 1, + [SPECIES_HIPPOWDON] = 1, + [SPECIES_SKORUPI] = 0, + [SPECIES_DRAPION] = 2, + [SPECIES_CROAGUNK] = 0, + [SPECIES_TOXICROAK] = 0, + [SPECIES_CARNIVINE] = 1, + [SPECIES_FINNEON] = 0, + [SPECIES_LUMINEON] = 0, + [SPECIES_MANTYKE] = 0, + [SPECIES_SNOVER] = 1, + [SPECIES_ABOMASNOW] = 1, + [SPECIES_WEAVILE] = 0, + [SPECIES_MAGNEZONE] = 0, + [SPECIES_LICKILICKY] = 1, + [SPECIES_RHYPERIOR] = 0, + [SPECIES_TANGROWTH] = 2, + [SPECIES_ELECTIVIRE] = 1, + [SPECIES_MAGMORTAR] = 0, + [SPECIES_TOGEKISS] = 2, + [SPECIES_YANMEGA] = 1, + [SPECIES_LEAFEON] = 1, + [SPECIES_GLACEON] = 0, + [SPECIES_GLISCOR] = 2, + [SPECIES_MAMOSWINE] = 2, + [SPECIES_PORYGON_Z] = 0, + [SPECIES_GALLADE] = 1, + [SPECIES_PROBOPASS] = 0, + [SPECIES_DUSKNOIR] = 2, + [SPECIES_FROSLASS] = 2, + [SPECIES_ROTOM] = 0, + [SPECIES_UXIE] = 0, + [SPECIES_MESPRIT] = 0, + [SPECIES_AZELF] = 0, + [SPECIES_DIALGA] = 2, + [SPECIES_PALKIA] = 2, + [SPECIES_HEATRAN] = 0, + [SPECIES_REGIGIGAS] = 0, + [SPECIES_GIRATINA] = 0, + [SPECIES_CRESSELIA] = 0, + [SPECIES_PHIONE] = 0, + [SPECIES_MANAPHY] = 0, + [SPECIES_DARKRAI] = 0, + [SPECIES_SHAYMIN] = 1, + [SPECIES_ARCEUS] = 0, + [ICON_EGG] = 1, + [ICON_MANAPHY_EGG] = 2, + [ICON_DEOXYS_ATTACK] = 0, + [ICON_DEOXYS_DEFENSE] = 0, + [ICON_DEOXYS_SPEED] = 0, + [ICON_UNOWN_A] = 0, + [ICON_UNOWN_B] = 0, + [ICON_UNOWN_C] = 0, + [ICON_UNOWN_D] = 0, + [ICON_UNOWN_E] = 0, + [ICON_UNOWN_F] = 0, + [ICON_UNOWN_G] = 0, + [ICON_UNOWN_H] = 0, + [ICON_UNOWN_I] = 0, + [ICON_UNOWN_J] = 0, + [ICON_UNOWN_K] = 0, + [ICON_UNOWN_L] = 0, + [ICON_UNOWN_M] = 0, + [ICON_UNOWN_N] = 0, + [ICON_UNOWN_O] = 0, + [ICON_UNOWN_P] = 0, + [ICON_UNOWN_Q] = 0, + [ICON_UNOWN_R] = 0, + [ICON_UNOWN_S] = 0, + [ICON_UNOWN_T] = 0, + [ICON_UNOWN_U] = 0, + [ICON_UNOWN_V] = 0, + [ICON_UNOWN_W] = 0, + [ICON_UNOWN_X] = 0, + [ICON_UNOWN_Y] = 0, + [ICON_UNOWN_Z] = 0, + [ICON_UNOWN_EXC] = 0, + [ICON_UNOWN_QUE] = 0, + [ICON_BURMY_SANDY] = 1, + [ICON_BURMY_TRASH] = 0, + [ICON_WORMADAM_SANDY] = 1, + [ICON_WORMADAM_TRASH] = 0, + [ICON_SHELLOS_EAST_SEA] = 0, + [ICON_GASTRODON_EAST_SEA] = 0, + [ICON_GIRATINA_ORIGIN] = 0, + [ICON_SHAYMIN_SKY] = 1, + [ICON_ROTOM_HEAT] = 0, + [ICON_ROTOM_WASH] = 0, + [ICON_ROTOM_FROST] = 0, + [ICON_ROTOM_FAN] = 0, + [ICON_ROTOM_MOW] = 0, +}; diff --git a/include/pokemon.h b/include/pokemon.h index 140d76133a..ae80a388e6 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -1,5 +1,5 @@ -#ifndef POKEPLATINUM_UNK_02073C2C_H -#define POKEPLATINUM_UNK_02073C2C_H +#ifndef POKEPLATINUM_POKEMON_H +#define POKEPLATINUM_POKEMON_H #include "struct_decls/struct_02002F38_decl.h" #include "struct_decls/struct_02006C24_decl.h" @@ -870,4 +870,4 @@ BOOL Pokemon_SetBallSeal(int param0, Pokemon *mon, int heapID); void sub_02078B40(Pokemon *mon, UnkStruct_02078B40 *param1); void sub_02078E0C(UnkStruct_02078B40 *param0, Pokemon *mon); -#endif // POKEPLATINUM_UNK_02073C2C_H +#endif // POKEPLATINUM_POKEMON_H diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h new file mode 100644 index 0000000000..d49c3b323d --- /dev/null +++ b/include/pokemon_icon.h @@ -0,0 +1,122 @@ +#ifndef POKEPLATINUM_POKEMON_ICON_H +#define POKEPLATINUM_POKEMON_ICON_H + +#include "pokemon.h" + +/** + * @brief Get the index of the sprite-tiles file used for a given BoxPokemon. + * + * @param mon + * @return Index of the sprite-tiles file for this Pokemon in pl_poke_icon.narc + */ +u32 BoxPokemon_IconSpriteIndex(const BoxPokemon *mon); + +/** + * @brief Get the index of the sprite-tiles file used for a given Pokemon. + * + * @param mon + * @return Index of the sprite-tiles file for this Pokemon in pl_poke_icon.narc + */ +u32 Pokemon_IconSpriteIndex(Pokemon *mon); + +/** + * @brief Get the index of the sprite-tiles file used for a given combination + * of species+form and whether or not the Pokemon is in an egg. + * + * @param species + * @param isEgg + * @param form + * @return Index of the sprite-tiles file for the given tuple in pl_poke_icon.narc + */ +u32 PokeIconSpriteIndex(u32 species, u32 isEgg, u32 form); + +/** + * @brief Get the form offset for a given BoxPokemon's icon. + * + * In essence, this is just a nice wrapper around BoxPokemon_GetForm for species + * known to have alternate forms (visual or mechanical). + * + * @param mon + * @return Form offset + */ +u16 BoxPokemon_IconFormOffset(const BoxPokemon *mon); + +/** + * @brief Get the index of the palette used by a given combination of species+form + * and whether or not the Pokemon is in an egg. + * + * @param species + * @param form + * @param isEgg + * @return Index in the shared palette file for all Pokemon icons. + */ +const u8 PokeIconPaletteIndex(u32 species, u32 form, u32 isEgg); + +/** + * @brief Get the index of the palette used by a given BoxPokemon. + * + * @param mon + * @return Index in the shared palette file for all Pokemon icons. + */ +const u8 BoxPokemon_IconPaletteIndex(const BoxPokemon *mon); + +/** + * @brief Get the index of the palette used by a given Pokemon. + * + * @param mon + * @return Index in the shared palette file for all Pokemon icons. + */ +const u8 Pokemon_IconPaletteIndex(Pokemon *mon); + +/** + * @brief Get the file-index of the shared palettes file in pl_poke_icon.narc. + * + * @return File-index of the shared palettes file + */ +u32 PokeIconPalettesFileIndex(void); + +/** + * @brief Get the file-index of the shared cells file in pl_poke_icon.narc. + * + * @return File-index of the shared cells file + */ +u32 PokeIconCellsFileIndex(void); + +/** + * @brief Get the file-index of the shared 32K cells file in pl_poke_icon.narc. + * + * @return File-index of the shared cells file + */ +u32 PokeIcon32KCellsFileIndex(void); + +/** + * @brief Get the file-index of the shared 64K cells file in pl_poke_icon.narc. + * + * @return File-index of the shared cells file + */ +u32 PokeIcon64KCellsFileIndex(void); + +/** + * @brief Get the file-index of the shared animation file in pl_poke_icon.narc. + * + * @return File-index of the shared animation file + */ +u32 PokeIconAnimationFileIndex(void); + +/** + * @brief Get the file-index of the shared 32K animation file in + * pl_poke_icon.narc. + * + * @return File-index of the shared 32K animation file + */ +u32 PokeIcon32KAnimationFileIndex(void); + +/** + * @brief Get the file-index of the shared 64K animation file in + * pl_poke_icon.narc. + * + * @return File-index of the shared 64K animation file + */ +u32 PokeIcon64KAnimationFileIndex(void); + +#endif // POKEPLATINUM_POKEMON_ICON_H diff --git a/include/unk_02079D40.h b/include/unk_02079D40.h deleted file mode 100644 index a03f2148b4..0000000000 --- a/include/unk_02079D40.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef POKEPLATINUM_UNK_02079D40_H -#define POKEPLATINUM_UNK_02079D40_H - -#include "pokemon.h" - -u32 sub_02079D40(const BoxPokemon * param0); -u32 sub_02079D80(Pokemon * param0); -u32 sub_02079D8C(u32 param0, u32 param1, u32 param2); -u16 sub_02079E44(const BoxPokemon * param0); -const u8 sub_02079EDC(u32 param0, u32 param1, u32 param2); -const u8 sub_02079F84(const BoxPokemon * param0); -const u8 sub_02079FC4(Pokemon * param0); -u32 sub_02079FD0(void); -u32 sub_02079FD4(void); -u32 sub_02079FD8(void); -u32 sub_02079FDC(void); -u32 sub_02079FE0(void); -u32 sub_02079FE4(void); -u32 sub_02079FE8(void); - -#endif // POKEPLATINUM_UNK_02079D40_H diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index c52ad30d39..5a155022b0 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -291,7 +291,7 @@ Static main Object main.nef.p/src_move_table.c.o Object main.nef.p/src_trainer_data.c.o Object main.nef.p/src_unk_020797C8.c.o - Object main.nef.p/src_unk_02079D40.c.o + Object main.nef.p/src_pokemon_icon.c.o Object main.nef.p/src_party.c.o Object main.nef.p/src_unk_0207A274.c.o Object main.nef.p/src_unk_0207A2A8.c.o diff --git a/src/meson.build b/src/meson.build index 3ee6e2687f..c5edc9b635 100644 --- a/src/meson.build +++ b/src/meson.build @@ -277,7 +277,7 @@ pokeplatinum_c = files( 'pokemon.c', 'trainer_data.c', 'unk_020797C8.c', - 'unk_02079D40.c', + 'pokemon_icon.c', 'unk_0207A274.c', 'unk_0207A2A8.c', 'unk_0207A6DC.c', diff --git a/src/overlay010/ov10_0221F800.c b/src/overlay010/ov10_0221F800.c index 39473b5cd6..54fed26afe 100644 --- a/src/overlay010/ov10_0221F800.c +++ b/src/overlay010/ov10_0221F800.c @@ -72,7 +72,7 @@ #include "map_header.h" #include "pokemon.h" #include "trainer_data.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "item.h" #include "unk_0207D3B8.h" @@ -2033,13 +2033,13 @@ static void ov10_02221D14 (UnkStruct_ov10_0221FB28 * param0, Party * param1, u8 for (v1 = 0; v1 < 3; v1++) { if (v2 <= v1) { - param0->unk_214[v1 + param2].unk_00 = sub_02079D8C(0, 0, 0); + param0->unk_214[v1 + param2].unk_00 = PokeIconSpriteIndex(0, 0, 0); continue; } v0 = Party_GetPokemonBySlotIndex(param1, v1); - param0->unk_214[v1 + param2].unk_00 = sub_02079D80(v0); + param0->unk_214[v1 + param2].unk_00 = Pokemon_IconSpriteIndex(v0); param0->unk_214[v1 + param2].unk_04 = (u16)Pokemon_GetValue(v0, MON_DATA_SPECIES, NULL); if (param0->unk_214[v1 + param2].unk_04 == 0) { @@ -2111,7 +2111,7 @@ static void ov10_02221EEC (UnkStruct_ov10_0221FB28 * param0, u32 param1) sub_0200D3F4(param0->unk_198[param1 * 5 + v0], 0); } } else { - sub_0200D41C(param0->unk_198[param1 * 5 + 0], sub_02079EDC(param0->unk_214[param1].unk_04, param0->unk_214[param1].unk_11, param0->unk_214[param1].unk_0F)); + sub_0200D41C(param0->unk_198[param1 * 5 + 0], PokeIconPaletteIndex(param0->unk_214[param1].unk_04, param0->unk_214[param1].unk_11, param0->unk_214[param1].unk_0F)); sub_0200D364(param0->unk_198[param1 * 5 + 0], ov10_02221E84(param0, param1)); if (param0->unk_214[param1].unk_0A == 0) { @@ -2165,9 +2165,9 @@ static void ov10_022220B4 (UnkStruct_ov10_0221FB28 * param0) v1 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param0->unk_00->unk_24); - sub_0200CD0C(param0->unk_190, param0->unk_194, v1, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 47112); - sub_0200CE24(param0->unk_190, param0->unk_194, v1, sub_02079FD8(), 0, 47113); - sub_0200CE54(param0->unk_190, param0->unk_194, v1, sub_02079FE4(), 0, 47113); + sub_0200CD0C(param0->unk_190, param0->unk_194, v1, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 47112); + sub_0200CE24(param0->unk_190, param0->unk_194, v1, PokeIcon32KCellsFileIndex(), 0, 47113); + sub_0200CE54(param0->unk_190, param0->unk_194, v1, PokeIcon32KAnimationFileIndex(), 0, 47113); for (v0 = 0; v0 < 6; v0++) { sub_0200CC3C(param0->unk_190, param0->unk_194, v1, param0->unk_214[v0].unk_00, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47113 + v0); diff --git a/src/overlay013/ov13_02224500.c b/src/overlay013/ov13_02224500.c index 56e60af8a3..e567aa7966 100644 --- a/src/overlay013/ov13_02224500.c +++ b/src/overlay013/ov13_02224500.c @@ -16,7 +16,7 @@ #include "unk_0200C6E4.h" #include "gx_layers.h" #include "move_table.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "unk_0207C908.h" #include "item.h" @@ -255,15 +255,15 @@ static void ov13_02224588 (UnkStruct_ov13_022213F0 * param0) v2 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param0->unk_00->unk_0C); v0 = ov16_0223E010(param0->unk_00->unk_08); - sub_0200CDC4(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 45063); - sub_0200CE24(v0, param0->unk_1FB0, v2, sub_02079FD8(), 0, 45063); - sub_0200CE54(v0, param0->unk_1FB0, v2, sub_02079FE4(), 0, 45063); + sub_0200CDC4(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 45063); + sub_0200CE24(v0, param0->unk_1FB0, v2, PokeIcon32KCellsFileIndex(), 0, 45063); + sub_0200CE54(v0, param0->unk_1FB0, v2, PokeIcon32KAnimationFileIndex(), 0, 45063); for (v1 = 0; v1 < 6; v1++) { if (param0->unk_04[v1].unk_04 != 0) { - sub_0200CC3C(v0, param0->unk_1FB0, v2, sub_02079D80(param0->unk_04[v1].unk_00), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45063 + v1); + sub_0200CC3C(v0, param0->unk_1FB0, v2, Pokemon_IconSpriteIndex(param0->unk_04[v1].unk_00), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45063 + v1); } else { - sub_0200CC3C(v0, param0->unk_1FB0, v2, sub_02079D8C(0, 0, 0), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45063 + v1); + sub_0200CC3C(v0, param0->unk_1FB0, v2, PokeIconSpriteIndex(0, 0, 0), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45063 + v1); } } @@ -392,7 +392,7 @@ static void ov13_022249CC (UnkStruct_ov13_022213F0 * param0) continue; } - sub_0200D41C(param0->unk_1FB4[7 + v0], sub_02079EDC(param0->unk_04[v0].unk_04, param0->unk_04[v0].unk_2E, param0->unk_04[v0].unk_17_7)); + sub_0200D41C(param0->unk_1FB4[7 + v0], PokeIconPaletteIndex(param0->unk_04[v0].unk_04, param0->unk_04[v0].unk_2E, param0->unk_04[v0].unk_17_7)); } } diff --git a/src/overlay016/battle_script.c b/src/overlay016/battle_script.c index c3b5de54f4..1f78188004 100644 --- a/src/overlay016/battle_script.c +++ b/src/overlay016/battle_script.c @@ -78,7 +78,7 @@ #include "unk_020218BC.h" #include "unk_02022594.h" #include "unk_020797C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_0207A274.h" #include "unk_0208694C.h" #include "unk_0208C098.h" @@ -12249,14 +12249,14 @@ static void BattleScript_LoadPartyLevelUpIcon (BattleSystem * param0, BattleScri param1->cellActorData[0] = sub_0200CE6C(v1, v2, &Unk_ov16_0226E6C4); sub_0200D330(param1->cellActorData[0]); - sub_0200D888(v1, v2, 19, sub_02079D80(param2), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 20022); - sub_0200CD7C(v3, 2, v1, v2, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 20017); - sub_0200CE0C(v1, v2, 19, sub_02079FDC(), 0, 20014); - sub_0200CE3C(v1, v2, 19, sub_02079FE8(), 0, 20014); + sub_0200D888(v1, v2, 19, Pokemon_IconSpriteIndex(param2), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 20022); + sub_0200CD7C(v3, 2, v1, v2, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 20017); + sub_0200CE0C(v1, v2, 19, PokeIcon64KCellsFileIndex(), 0, 20014); + sub_0200CE3C(v1, v2, 19, PokeIcon64KAnimationFileIndex(), 0, 20014); param1->cellActorData[1] = sub_0200CE6C(v1, v2, &Unk_ov16_0226E6F8); - sub_02021F24(param1->cellActorData[1]->unk_00, sub_02079FC4(param2)); + sub_02021F24(param1->cellActorData[1]->unk_00, Pokemon_IconPaletteIndex(param2)); sub_0200D330(param1->cellActorData[1]); param1->tmpPtr[0] = sub_02012744(1, 5); diff --git a/src/overlay016/ov16_0226871C.c b/src/overlay016/ov16_0226871C.c index 5457ab5ac8..e7442e1c3a 100644 --- a/src/overlay016/ov16_0226871C.c +++ b/src/overlay016/ov16_0226871C.c @@ -62,7 +62,7 @@ #include "strbuf.h" #include "pokemon.h" #include "move_table.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_0207C908.h" #include "unk_0208C098.h" #include "overlay011/ov11_0221F800.h" @@ -2448,9 +2448,9 @@ static void ov16_0226A698 (UnkStruct_ov16_02268A14 * param0) v1 = ov16_0223E018(param0->unk_00); v5 = BattleSystem_PaletteSys(param0->unk_00); - sub_0200CD7C(v5, 3, v0, v1, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 20022); - sub_0200CE0C(v0, v1, 19, sub_02079FD8(), 0, 20021); - sub_0200CE3C(v0, v1, 19, sub_02079FE4(), 0, 20021); + sub_0200CD7C(v5, 3, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 20022); + sub_0200CE0C(v0, v1, 19, PokeIcon32KCellsFileIndex(), 0, 20021); + sub_0200CE3C(v0, v1, 19, PokeIcon32KAnimationFileIndex(), 0, 20021); } static void ov16_0226A718 (UnkStruct_ov16_02268A14 * param0) @@ -2522,7 +2522,7 @@ static CellActorData * ov16_0226A7A4 (UnkStruct_ov16_02268A14 * param0, Pokemon v0 = ov16_0223E010(param0->unk_00); v1 = ov16_0223E018(param0->unk_00); - sub_0200CBDC(v0, v1, 19, sub_02079D80(param1), 0, NNS_G2D_VRAM_TYPE_2DSUB, v2); + sub_0200CBDC(v0, v1, 19, Pokemon_IconSpriteIndex(param1), 0, NNS_G2D_VRAM_TYPE_2DSUB, v2); v3 = Unk_ov16_022704B0; v3.unk_14[0] = v2; @@ -2531,7 +2531,7 @@ static CellActorData * ov16_0226A7A4 (UnkStruct_ov16_02268A14 * param0, Pokemon v4 = sub_0200CE6C(v0, v1, &v3); sub_0200D500(v4, v3.unk_00, v3.unk_02, ((192 + 80) << FX32_SHIFT)); - sub_02021F24(v4->unk_00, sub_02079FC4(param1)); + sub_02021F24(v4->unk_00, Pokemon_IconPaletteIndex(param1)); { int v6 = 0; diff --git a/src/overlay017/ov17_02250744.c b/src/overlay017/ov17_02250744.c index 6a457bf6a6..e9aa441776 100644 --- a/src/overlay017/ov17_02250744.c +++ b/src/overlay017/ov17_02250744.c @@ -35,7 +35,7 @@ #include "strbuf.h" #include "unk_020279FC.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_020933F8.h" #include "unk_02094EDC.h" #include "overlay017/ov17_0223F118.h" @@ -407,20 +407,20 @@ void ov17_02250DB0 (UnkStruct_ov17_0224FCA0 * param0) v3 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, 24); - sub_0200CDC4(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33003); - sub_0200CE24(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, sub_02079FDC(), 0, 33002); - sub_0200CE54(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, sub_02079FE8(), 0, 33002); + sub_0200CDC4(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33003); + sub_0200CE24(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIcon64KCellsFileIndex(), 0, 33002); + sub_0200CE54(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIcon64KAnimationFileIndex(), 0, 33002); v0 = Unk_ov17_02254C5C; for (v2 = 0; v2 < 4; v2++) { - sub_0200D888(param0->unk_10.unk_18, param0->unk_10.unk_1C, 19, sub_02079D80(param0->unk_00->unk_00.unk_00[v2]), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 33002 + v2); + sub_0200D888(param0->unk_10.unk_18, param0->unk_10.unk_1C, 19, Pokemon_IconSpriteIndex(param0->unk_00->unk_00.unk_00[v2]), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 33002 + v2); v0.unk_14[0] = 33002 + v2; param0->unk_10.unk_128[v2] = sub_0200CE6C(param0->unk_10.unk_18, param0->unk_10.unk_1C, &v0); sub_0200D364(param0->unk_10.unk_128[v2], 1); - sub_02021F24(param0->unk_10.unk_128[v2]->unk_00, sub_02079FC4(param0->unk_00->unk_00.unk_00[v2])); + sub_02021F24(param0->unk_10.unk_128[v2]->unk_00, Pokemon_IconPaletteIndex(param0->unk_00->unk_00.unk_00[v2])); sub_0200D330(param0->unk_10.unk_128[v2]); } diff --git a/src/overlay019/ov19_021D79F8.c b/src/overlay019/ov19_021D79F8.c index 8fae8bec14..095811b5c8 100644 --- a/src/overlay019/ov19_021D79F8.c +++ b/src/overlay019/ov19_021D79F8.c @@ -25,7 +25,7 @@ #include "unk_020218BC.h" #include "pokemon.h" #include "unk_020797C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay019/ov19_021D0D80.h" #include "overlay019/ov19_021D61B0.h" #include "overlay019/ov19_021D79F8.h" @@ -437,7 +437,7 @@ static void ov19_021D813C (UnkStruct_ov19_021D8318 * param0, u32 param1) if (v3) { param0->unk_5814[v2] = v3; - param0->unk_57D8[v2] = sub_02079D40(v1); + param0->unk_57D8[v2] = BoxPokemon_IconSpriteIndex(v1); ov19_021DA744(param0->unk_58F0, param0->unk_CD8[v2], param0->unk_57D8[v2], ((4 * 4) * 0x20 + 0x80)); } } diff --git a/src/overlay019/ov19_021DA270.c b/src/overlay019/ov19_021DA270.c index 58f57a357e..5e100b83ea 100644 --- a/src/overlay019/ov19_021DA270.c +++ b/src/overlay019/ov19_021DA270.c @@ -16,7 +16,7 @@ #include "heap.h" #include "unk_020218BC.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay019/ov19_021D0D80.h" #include "overlay019/ov19_021D61B0.h" #include "overlay019/ov19_021DA270.h" @@ -30,9 +30,9 @@ BOOL ov19_021DA270 (UnkStruct_ov19_021DA384 * param0, UnkStruct_ov19_021D61B0 * param0->unk_48 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, 10); NNS_G2dInitImagePaletteProxy(&v0); - sub_0200716C(param0->unk_48, sub_02079FD0(), NNS_G2D_VRAM_TYPE_2DMAIN, 2 * 0x20, 10, &v0); + sub_0200716C(param0->unk_48, PokeIconPalettesFileIndex(), NNS_G2D_VRAM_TYPE_2DMAIN, 2 * 0x20, 10, &v0); - v2 = sub_020071EC(param0->unk_48, sub_02079FD0(), &v1, 10); + v2 = sub_020071EC(param0->unk_48, PokeIconPalettesFileIndex(), &v1, 10); if (v2) { BOOL v3; @@ -135,8 +135,8 @@ void ov19_021DA428 (UnkStruct_ov19_021DA384 * param0, BoxPokemon * param1, s32 p v2 = BoxPokemon_GetValue(param1, MON_DATA_SPECIES, NULL); v3 = BoxPokemon_GetValue(param1, MON_DATA_IS_EGG, NULL); v4 = BoxPokemon_GetValue(param1, MON_DATA_FORM, NULL); - param7->unk_28 = sub_02079D40((BoxPokemon *)param1); - param7->unk_2C = sub_02079EDC(v2, v4, v3); + param7->unk_28 = BoxPokemon_IconSpriteIndex((BoxPokemon *)param1); + param7->unk_2C = PokeIconPaletteIndex(v2, v4, v3); param7->unk_30 = BoxPokemon_GetValue(param1, MON_DATA_HELD_ITEM, NULL); param7->unk_2E = BoxPokemon_GetValue(param1, MON_DATA_11, NULL); @@ -173,7 +173,7 @@ void ov19_021DA548 (UnkStruct_ov19_021DA384 * param0, BoxPokemon * param1, u32 p ov19_021D783C(&v1, NULL, ov19_021D77D0(param0->unk_44), param0->unk_10, param0->unk_04, param7); param10->unk_28 = param3; - param10->unk_2C = sub_02079EDC(param2, v4, v3); + param10->unk_2C = PokeIconPaletteIndex(param2, v4, v3); param10->unk_30 = BoxPokemon_GetValue(param1, MON_DATA_HELD_ITEM, NULL); param10->unk_2E = BoxPokemon_GetValue(param1, MON_DATA_11, NULL); @@ -234,12 +234,12 @@ void ov19_021DA694 (UnkStruct_ov19_021DA384 * param0, UnkStruct_ov19_021DCD18 * u32 v1; NNSG2dCharacterData * v2; - if ((param1->unk_30 == 112) && (param1->unk_28 == sub_02079D8C(487, 0, 0))) { - param1->unk_28 = sub_02079D8C(487, 0, 1); - } else if ((param1->unk_30 != 112) && (param1->unk_28 == sub_02079D8C(487, 0, 1))) { - param1->unk_28 = sub_02079D8C(487, 0, 0); - } else if ((param2 == 1) && (param1->unk_28 == sub_02079D8C(492, 0, 1))) { - param1->unk_28 = sub_02079D8C(492, 0, 0); + if ((param1->unk_30 == 112) && (param1->unk_28 == PokeIconSpriteIndex(487, 0, 0))) { + param1->unk_28 = PokeIconSpriteIndex(487, 0, 1); + } else if ((param1->unk_30 != 112) && (param1->unk_28 == PokeIconSpriteIndex(487, 0, 1))) { + param1->unk_28 = PokeIconSpriteIndex(487, 0, 0); + } else if ((param2 == 1) && (param1->unk_28 == PokeIconSpriteIndex(492, 0, 1))) { + param1->unk_28 = PokeIconSpriteIndex(492, 0, 0); } else { return; } diff --git a/src/overlay019/ov19_021DEC04.c b/src/overlay019/ov19_021DEC04.c index fed3710a5c..1ac605012c 100644 --- a/src/overlay019/ov19_021DEC04.c +++ b/src/overlay019/ov19_021DEC04.c @@ -30,7 +30,7 @@ #include "unk_0201D670.h" #include "unk_020218BC.h" #include "strbuf.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay019/ov19_021D0D80.h" #include "overlay019/ov19_021D61B0.h" #include "overlay019/ov19_021DA270.h" @@ -141,7 +141,7 @@ void ov19_021DECE8 (UnkStruct_ov19_021DEC04 * param0, NARC * param1) sub_0200710C(param1, 130, param0->unk_0C, 6, 0, 0, 1, 10); sub_0200710C(param1, 131, param0->unk_0C, 7, 0, 0, 1, 10); sub_02007130(param1, 133, 4, 0, 0x20 * 4, 10); - sub_02006E84(19, sub_02079FD0(), 5, 4 * 0x20, 4 * 0x20, 10); + sub_02006E84(19, PokeIconPalettesFileIndex(), 5, 4 * 0x20, 4 * 0x20, 10); sub_02019690(4, 0x20, 0, 10); sub_02019CB8(param0->unk_0C, 4, 0x0, 0, 0, 32, 32, 17); @@ -682,9 +682,9 @@ static void ov19_021DF834 (UnkStruct_ov19_021DEC04 * param0) NNSG2dCharacterData * v4; if (ov19_021D5E34(param0->unk_08)) { - u32 v5 = 4 + sub_02079EDC(v1->unk_04, v1->unk_07, v1->unk_06); + u32 v5 = 4 + PokeIconPaletteIndex(v1->unk_04, v1->unk_07, v1->unk_06); - ov19_021DA744(param0->unk_14, param0->unk_E8, sub_02079D40(v3), sizeof(param0->unk_E8)); + ov19_021DA744(param0->unk_14, param0->unk_E8, BoxPokemon_IconSpriteIndex(v3), sizeof(param0->unk_E8)); NNS_G2dGetUnpackedCharacterData(param0->unk_E8, &v4); DC_FlushRange(v4->pRawData, (4 * 4) * 0x20); diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index d951020e51..d22fd668af 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -40,7 +40,7 @@ #include "unk_0201DBEC.h" #include "unk_020218BC.h" #include "strbuf.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_02098700.h" #include "unk_02098988.h" #include "overlay021/ov21_021D0D80.h" @@ -562,10 +562,10 @@ static void ov21_021E7904 (UnkStruct_ov21_021E7714 * param0, UnkStruct_ov21_021E v9 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param3); v8 = ov21_021D33D4(param2->unk_00, v5); - v1 = sub_02079D8C(v5, 0, v8); - v2 = sub_02079FD0(); - v3 = sub_02079FD4(); - v4 = sub_02079FE0(); + v1 = PokeIconSpriteIndex(v5, 0, v8); + v2 = PokeIconPalettesFileIndex(); + v3 = PokeIconCellsFileIndex(); + v4 = PokeIconAnimationFileIndex(); param0->unk_14[0] = sub_02009A4C(v0->unk_13C[0], v9, v1, 0, 8000, NNS_G2D_VRAM_TYPE_2DMAIN, param3); @@ -686,7 +686,7 @@ static void ov21_021E7B34 (UnkStruct_ov21_021E7714 * param0, UnkStruct_ov21_021E v1.unk_08.y = 64 << FX32_SHIFT; param0->unk_04 = sub_02021B90(&v1); - sub_02021EC4(param0->unk_04, sub_02079EDC(v6, v7, 0)); + sub_02021EC4(param0->unk_04, PokeIconPaletteIndex(v6, v7, 0)); } static void ov21_021E7CCC (UnkStruct_ov21_021E7714 * param0) diff --git a/src/overlay025/ov25_02255090.c b/src/overlay025/ov25_02255090.c index c202d4f60c..0851f74de2 100644 --- a/src/overlay025/ov25_02255090.c +++ b/src/overlay025/ov25_02255090.c @@ -13,7 +13,7 @@ #include "unk_0200D9E8.h" #include "heap.h" #include "unk_02018340.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay025/ov25_02254560.h" #include "overlay025/ov25_02255090.h" @@ -255,7 +255,7 @@ void ov25_02255360 (u32 param0) void * v0; NNSG2dPaletteData * v1; - v0 = sub_02006F88(19, sub_02079FD0(), &v1, 8); + v0 = sub_02006F88(19, PokeIconPalettesFileIndex(), &v1, 8); if (v0) { ov25_02255290(v1->pRawData, 4 * 0x10); diff --git a/src/overlay032/ov32_022561C0.c b/src/overlay032/ov32_022561C0.c index 823de3ace4..a8b2b5e2fe 100644 --- a/src/overlay032/ov32_022561C0.c +++ b/src/overlay032/ov32_022561C0.c @@ -15,7 +15,7 @@ #include "heap.h" #include "unk_02022594.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "overlay025/ov25_02253CE0.h" #include "overlay032/ov32_02256470.h" @@ -208,7 +208,7 @@ static void ov32_022563C8 (UnkStruct_ov32_02256470_1 * param0, Party * param1) v0 = Party_GetPokemonBySlotIndex(param1, v1); v2 = Pokemon_EnterDecryptionContext(v0); - param0->unk_04[v1].unk_00 = sub_02079D40((const BoxPokemon *)v0); + param0->unk_04[v1].unk_00 = BoxPokemon_IconSpriteIndex((const BoxPokemon *)v0); param0->unk_04[v1].unk_04 = Pokemon_GetValue(v0, MON_DATA_SPECIES, NULL); param0->unk_04[v1].unk_06 = Pokemon_GetValue(v0, MON_DATA_CURRENT_HP, NULL); param0->unk_04[v1].unk_08 = Pokemon_GetValue(v0, MON_DATA_MAX_HP, NULL); diff --git a/src/overlay032/ov32_02256470.c b/src/overlay032/ov32_02256470.c index d7c3b0325c..b04ebe3c59 100644 --- a/src/overlay032/ov32_02256470.c +++ b/src/overlay032/ov32_02256470.c @@ -21,7 +21,7 @@ #include "unk_0200D9E8.h" #include "heap.h" #include "unk_02018340.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "item.h" #include "overlay025/ov25_02253CE0.h" #include "overlay025/ov25_02254560.h" @@ -335,7 +335,7 @@ static void ov32_0225692C (UnkStruct_ov32_02256470 * param0, const UnkStruct_ov3 if ((param1->unk_04[v3].unk_06 == 0) || param1->unk_04[v3].unk_0C) { ov25_02255938(param0->unk_9C[v3], 1); } else { - u16 v4 = sub_02079EDC(param1->unk_04[v3].unk_04, param1->unk_04[v3].unk_0F, param1->unk_04[v3].unk_0E); + u16 v4 = PokeIconPaletteIndex(param1->unk_04[v3].unk_04, param1->unk_04[v3].unk_0F, param1->unk_04[v3].unk_0E); ov25_02255938(param0->unk_9C[v3], 2 + v4); } } diff --git a/src/overlay033/ov33_022561C0.c b/src/overlay033/ov33_022561C0.c index 8c584336da..824d168951 100644 --- a/src/overlay033/ov33_022561C0.c +++ b/src/overlay033/ov33_022561C0.c @@ -16,7 +16,7 @@ #include "unk_02022594.h" #include "unk_020244AC.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "overlay025/ov25_02253CE0.h" #include "overlay033/ov33_02256474.h" @@ -90,7 +90,7 @@ static BOOL ov33_0225621C (UnkStruct_ov33_0225621C * param0, UnkStruct_ov25_0225 if (Pokemon_GetValue(v1, MON_DATA_IS_EGG, NULL) == 0) { param0->unk_04.unk_04[v4].unk_04 = Pokemon_GetValue(v1, MON_DATA_SPECIES, NULL); param0->unk_04.unk_04[v4].unk_08 = Pokemon_GetValue(v1, MON_DATA_FORM, NULL); - param0->unk_04.unk_04[v4].unk_00 = sub_02079D40((const BoxPokemon *)v1); + param0->unk_04.unk_04[v4].unk_00 = BoxPokemon_IconSpriteIndex((const BoxPokemon *)v1); v3 = ov33_0225630C(Pokemon_GetValue(v1, MON_DATA_FRIENDSHIP, NULL)); switch (v3) { diff --git a/src/overlay033/ov33_02256474.c b/src/overlay033/ov33_02256474.c index 186db459e8..d4c6d675be 100644 --- a/src/overlay033/ov33_02256474.c +++ b/src/overlay033/ov33_02256474.c @@ -25,7 +25,7 @@ #include "unk_02018340.h" #include "unk_0201D15C.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay025/ov25_02253CE0.h" #include "overlay025/ov25_02254560.h" #include "overlay025/ov25_02255090.h" @@ -280,7 +280,7 @@ static void ov33_02256634 (UnkStruct_ov33_02256474 * param0, const UnkStruct_ov3 param0->unk_134[v5].unk_00 = ov25_02255810(param0->unk_30, &v2, ¶m0->unk_34); ov25_02255940(param0->unk_134[v5].unk_00, (4 * 4 * 2) * v5); - ov25_02255938(param0->unk_134[v5].unk_00, 1 + sub_02079EDC(param1->unk_04[v5].unk_04, param1->unk_04[v5].unk_08, 0)); + ov25_02255938(param0->unk_134[v5].unk_00, 1 + PokeIconPaletteIndex(param1->unk_04[v5].unk_04, param1->unk_04[v5].unk_08, 0)); v2.unk_0C = 0; param0->unk_134[v5].unk_04 = ov25_02255810(param0->unk_30, &v2, ¶m0->unk_48); diff --git a/src/overlay040/ov40_022561C0.c b/src/overlay040/ov40_022561C0.c index c7b85886da..28e7737799 100644 --- a/src/overlay040/ov40_022561C0.c +++ b/src/overlay040/ov40_022561C0.c @@ -17,7 +17,7 @@ #include "unk_02022594.h" #include "unk_020261E4.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay005/ov5_021E622C.h" #include "overlay025/ov25_02253CE0.h" #include "overlay040/ov40_0225645C.h" @@ -219,7 +219,7 @@ static void ov40_022563D0 (UnkStruct_ov40_0225645C_1 * param0, UnkStruct_0202631 v1 = sub_02026220(v0); v3 = BoxPokemon_EnterDecryptionContext(v1); - param0->unk_04[v2] = sub_02079D40(v1); + param0->unk_04[v2] = BoxPokemon_IconSpriteIndex(v1); param0->unk_1C[v2] = BoxPokemon_GetValue(v1, MON_DATA_SPECIES, NULL); param0->unk_20[v2] = BoxPokemon_GetValue(v1, MON_DATA_FORM, NULL); param0->unk_0C[v2] = ov5_021E6590(v0); diff --git a/src/overlay040/ov40_0225645C.c b/src/overlay040/ov40_0225645C.c index 8ff3af6aef..620649d2e5 100644 --- a/src/overlay040/ov40_0225645C.c +++ b/src/overlay040/ov40_0225645C.c @@ -19,7 +19,7 @@ #include "heap.h" #include "unk_02018340.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay025/ov25_02253CE0.h" #include "overlay025/ov25_02254560.h" #include "overlay025/ov25_02255090.h" @@ -373,7 +373,7 @@ static void ov40_02256808 (u32 param0, const UnkStruct_ov40_0225645C_1 * param1) u32 v0; u32 v1[3]; - v0 = sub_02079D8C(1, 1, 0); + v0 = PokeIconSpriteIndex(1, 1, 0); v1[0] = (param1->unk_00 > 0) ? param1->unk_04[0] : v0; v1[1] = (param1->unk_00 > 1) ? param1->unk_04[1] : v0; @@ -388,10 +388,10 @@ static void ov40_02256848 (UnkStruct_ov40_0225645C * param0, const UnkStruct_ov4 BOOL v1; for (v0 = 0; v0 < param1->unk_00; v0++) { - ov25_02255938(param0->unk_24[0 + v0], 1 + sub_02079EDC(param1->unk_1C[v0], param1->unk_20[v0], 0)); + ov25_02255938(param0->unk_24[0 + v0], 1 + PokeIconPaletteIndex(param1->unk_1C[v0], param1->unk_20[v0], 0)); } - ov25_02255938(param0->unk_24[2], 1 + sub_02079EDC(1, 0, 1)); + ov25_02255938(param0->unk_24[2], 1 + PokeIconPaletteIndex(1, 0, 1)); if (param1->unk_00 > 0) { if (PokemonPersonalData_GetFormValue(param1->unk_1C[0], param1->unk_20[0], 28)) { diff --git a/src/overlay044/ov44_022561C0.c b/src/overlay044/ov44_022561C0.c index ca618b2b7a..c4ecae8e03 100644 --- a/src/overlay044/ov44_022561C0.c +++ b/src/overlay044/ov44_022561C0.c @@ -16,7 +16,7 @@ #include "unk_0200D9E8.h" #include "heap.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "overlay005/ov5_021E622C.h" #include "overlay025/ov25_02253CE0.h" @@ -91,7 +91,7 @@ static BOOL ov44_0225621C (UnkStruct_ov44_0225621C * param0, UnkStruct_ov25_0225 continue; } - param0->unk_04.unk_00[v3] = sub_02079D40((const BoxPokemon *)v1); + param0->unk_04.unk_00[v3] = BoxPokemon_IconSpriteIndex((const BoxPokemon *)v1); param0->unk_04.unk_18[v3] = Pokemon_GetValue(v1, MON_DATA_SPECIES, NULL); param0->unk_04.unk_24[v3] = Pokemon_GetValue(v1, MON_DATA_FORM, NULL); param0->unk_48[v3] = (BoxPokemon *)v1; diff --git a/src/overlay044/ov44_022565BC.c b/src/overlay044/ov44_022565BC.c index 62bfc9b8a4..9c5c0b0413 100644 --- a/src/overlay044/ov44_022565BC.c +++ b/src/overlay044/ov44_022565BC.c @@ -18,7 +18,7 @@ #include "heap.h" #include "unk_02018340.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay025/ov25_02253CE0.h" #include "overlay025/ov25_02254560.h" #include "overlay025/ov25_02255090.h" @@ -339,7 +339,7 @@ static void ov44_02256954 (UnkStruct_ov44_022565BC * param0, u32 param1, u32 par ov25_022558C4(v0, v1); ov25_02255940(v0, param0->unk_64 + param2 * 16); - ov25_02255938(v0, 1 + sub_02079EDC(param3, param4, 0)); + ov25_02255938(v0, 1 + PokeIconPaletteIndex(param3, param4, 0)); } static void ov44_022569AC (UnkStruct_ov44_022565BC * param0) diff --git a/src/overlay053/ov53_02256420.c b/src/overlay053/ov53_02256420.c index 1247049743..d920926afb 100644 --- a/src/overlay053/ov53_02256420.c +++ b/src/overlay053/ov53_02256420.c @@ -18,7 +18,7 @@ #include "heap.h" #include "unk_02018340.h" #include "unk_0201D15C.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay025/ov25_02253CE0.h" #include "overlay025/ov25_02254560.h" #include "overlay025/ov25_02255090.h" @@ -154,10 +154,10 @@ static void ov53_02256568 (SysTask * param0, void * param1) const UnkStruct_ov53_02256420_1 * v1 = ov25_02255240(param1); if (v1->unk_00) { - u32 v2 = sub_02079D8C(v1->unk_00, 0, 0); + u32 v2 = PokeIconSpriteIndex(v1->unk_00, 0, 0); ov25_022553A0(v0->unk_AC, &v2, 1, 1); - ov25_02255938(v0->unk_24[0], 1 + sub_02079EDC(v1->unk_00, 0, 0)); + ov25_02255938(v0->unk_24[0], 1 + PokeIconPaletteIndex(v1->unk_00, 0, 0)); ov53_02256874(&(v0->unk_24[4]), v1->unk_04); } else { int v3; @@ -362,7 +362,7 @@ static void ov53_022566AC (UnkStruct_ov53_02256420 * param0, const UnkStruct_ov5 } for (v3 = 0; v3 < 4; v3++) { - param0->unk_8C[v3] = sub_02079D8C(((v2[v3]) ? v2[v3] : 1), 0, 0); + param0->unk_8C[v3] = PokeIconSpriteIndex(((v2[v3]) ? v2[v3] : 1), 0, 0); } ov25_022553A0(v1, param0->unk_8C, NELEMS(param0->unk_8C), 1); @@ -389,7 +389,7 @@ static void ov53_022566AC (UnkStruct_ov53_02256420 * param0, const UnkStruct_ov5 ov25_02255914(param0->unk_24[v5], 1); } } else { - ov25_02255938(param0->unk_24[0 + v3], 1 + sub_02079EDC(v2[v3], 0, 0)); + ov25_02255938(param0->unk_24[0 + v3], 1 + PokeIconPaletteIndex(v2[v3], 0, 0)); ov53_02256874(&(param0->unk_24[4 + v3 * 3]), (v3 == 0) ? param1->unk_04 : param1->unk_14[v3 - 1]); } } diff --git a/src/overlay054/ov54_0225642C.c b/src/overlay054/ov54_0225642C.c index 80a26935a0..1c2ee37487 100644 --- a/src/overlay054/ov54_0225642C.c +++ b/src/overlay054/ov54_0225642C.c @@ -22,7 +22,7 @@ #include "unk_02018340.h" #include "unk_0201D670.h" #include "strbuf.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay025/ov25_02254560.h" #include "overlay025/ov25_02255090.h" #include "overlay025/ov25_02255540.h" @@ -212,11 +212,11 @@ static void ov54_022565EC (UnkStruct_ov54_0225642C * param0, const UnkStruct_ov5 ov25_02255958(¶m0->unk_54, 12, 5, 6, 8); for (v1 = 0; v1 < param1->unk_90; v1++) { - param0->unk_68[v1] = sub_02079D8C(param1->unk_00[v1].unk_00, 0, param1->unk_00[v1].unk_08); + param0->unk_68[v1] = PokeIconSpriteIndex(param1->unk_00[v1].unk_00, 0, param1->unk_00[v1].unk_08); param0->unk_24[v1] = ov25_02255810(param0->unk_20, &v0[v1], ¶m0->unk_54); ov25_02255940(param0->unk_24[v1], v1 * 16); - ov25_02255938(param0->unk_24[v1], sub_02079EDC(param1->unk_00[v1].unk_00, param1->unk_00[v1].unk_08, 0)); + ov25_02255938(param0->unk_24[v1], PokeIconPaletteIndex(param1->unk_00[v1].unk_00, param1->unk_00[v1].unk_08, 0)); } for ( ; v1 < 12; v1++) { diff --git a/src/overlay062/ov62_02231690.c b/src/overlay062/ov62_02231690.c index 2f03f001da..9bef31e065 100644 --- a/src/overlay062/ov62_02231690.c +++ b/src/overlay062/ov62_02231690.c @@ -62,7 +62,7 @@ #include "unk_0202F1D4.h" #include "unk_02030A80.h" #include "unk_020393C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_0208B284.h" #include "overlay061/ov61_0222BC4C.h" #include "overlay062/ov62_0222F2C0.h" @@ -841,15 +841,15 @@ static void ov62_022320EC (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C v6 = param1->unk_14.unk_08; v7 = param1->unk_14.unk_14; - v4 = sub_0200CD7C(v7, 2, v5, v6, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); + v4 = sub_0200CD7C(v7, 2, v5, v6, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); { - int v9 = sub_02079FDC(); + int v9 = PokeIcon64KCellsFileIndex(); sub_0200CE0C(v5, v6, 19, v9, 0, 100000); } { - int v10 = sub_02079FE8(); + int v10 = PokeIcon64KAnimationFileIndex(); sub_0200CE3C(v5, v6, 19, v10, 0, 100000); } @@ -864,7 +864,7 @@ static void ov62_022320EC (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C return; } - v11 = sub_02079D8C(v1, v0, v3); + v11 = PokeIconSpriteIndex(v1, v0, v3); sub_0200D888(v5, v6, 19, v11, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); @@ -885,7 +885,7 @@ static void ov62_022320EC (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C v8.unk_14[5] = 0xffffffff; param0->unk_04 = sub_0200CE6C(param1->unk_14.unk_04, param1->unk_14.unk_08, &v8); - v2 = sub_02079EDC(v1, v3, v0); + v2 = PokeIconPaletteIndex(v1, v3, v0); sub_0200D430(param0->unk_04, v4 + v2); sub_0200D364(param0->unk_04, 1); @@ -2701,9 +2701,9 @@ void ov62_022339DC (UnkStruct_0208C06C * param0) v1 = param0->unk_14.unk_08; v2 = param0->unk_14.unk_14; - sub_0200CD7C(v2, 2, v0, v1, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); - sub_0200CE0C(v0, v1, 19, sub_02079FDC(), 0, 100000); - sub_0200CE3C(v0, v1, 19, sub_02079FE8(), 0, 100000); + sub_0200CD7C(v2, 2, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); + sub_0200CE0C(v0, v1, 19, PokeIcon64KCellsFileIndex(), 0, 100000); + sub_0200CE3C(v0, v1, 19, PokeIcon64KAnimationFileIndex(), 0, 100000); } void ov62_02233A44 (UnkStruct_0208C06C * param0) @@ -2743,7 +2743,7 @@ CellActorData * ov62_02233A7C (UnkStruct_0208C06C * param0, NARC * param1, int p return NULL; } - sub_0200D8E8(v1, v2, param1, sub_02079D8C(param3, param5, param4), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000 + param2); + sub_0200D8E8(v1, v2, param1, PokeIconSpriteIndex(param3, param5, param4), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000 + param2); v4.unk_00 = 0; v4.unk_02 = -48; @@ -2762,7 +2762,7 @@ CellActorData * ov62_02233A7C (UnkStruct_0208C06C * param0, NARC * param1, int p v4.unk_14[5] = 0xffffffff; v0 = sub_0200CE6C(v1, v2, &v4); - v5 = sub_02079EDC(param3, param4, param5); + v5 = PokeIconPaletteIndex(param3, param4, param5); sub_0200D430(v0, 4 + v5); sub_0200D364(v0, 1); @@ -3050,15 +3050,15 @@ static void ov62_02234000 (UnkStruct_ov62_02233F74 * param0, UnkStruct_0208C06C v11 = param1->unk_14.unk_08; v12 = param1->unk_14.unk_14; - sub_0200CD7C(v12, 2, v10, v11, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); + sub_0200CD7C(v12, 2, v10, v11, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); { - int v14 = sub_02079FDC(); + int v14 = PokeIcon64KCellsFileIndex(); sub_0200CE0C(v10, v11, 19, v14, 0, 100000); } { - int v15 = sub_02079FE8(); + int v15 = PokeIcon64KAnimationFileIndex(); sub_0200CE3C(v10, v11, 19, v15, 0, 100000); } @@ -3114,7 +3114,7 @@ static void ov62_02234000 (UnkStruct_ov62_02233F74 * param0, UnkStruct_0208C06C } v2 = v8[v0]; - v6 = sub_02079D8C(v1, 0, v2); + v6 = PokeIconSpriteIndex(v1, 0, v2); sub_0200D888(v10, v11, 19, v6, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000 + v3); @@ -3136,7 +3136,7 @@ static void ov62_02234000 (UnkStruct_ov62_02233F74 * param0, UnkStruct_0208C06C param0->unk_0C[v3] = sub_0200CE6C(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); - v5 = sub_02079EDC(v1, v2, 0); + v5 = PokeIconPaletteIndex(v1, v2, 0); sub_0200D430(param0->unk_0C[v3], 4 + v5); sub_0200D364(param0->unk_0C[v3], 1); sub_0200D330(param0->unk_0C[v3]); diff --git a/src/overlay062/ov62_02239D60.c b/src/overlay062/ov62_02239D60.c index 3a374aa726..9223dc4600 100644 --- a/src/overlay062/ov62_02239D60.c +++ b/src/overlay062/ov62_02239D60.c @@ -47,7 +47,7 @@ #include "unk_02030A80.h" #include "pokemon.h" #include "unk_020797C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_0208B284.h" #include "overlay061/ov61_0222AE60.h" #include "overlay061/ov61_0222B008.h" @@ -1082,9 +1082,9 @@ static void ov62_0223AE60 (UnkStruct_0208C06C * param0) v2 = param0->unk_14.unk_08; v3 = param0->unk_14.unk_14; - sub_0200CD7C(v3, 2, v1, v2, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); - sub_0200CE0C(v1, v2, 19, sub_02079FDC(), 0, 100000); - sub_0200CE3C(v1, v2, 19, sub_02079FE8(), 0, 100000); + sub_0200CD7C(v3, 2, v1, v2, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); + sub_0200CE0C(v1, v2, 19, PokeIcon64KCellsFileIndex(), 0, 100000); + sub_0200CE3C(v1, v2, 19, PokeIcon64KAnimationFileIndex(), 0, 100000); { int v5; @@ -1102,7 +1102,7 @@ static void ov62_0223AE60 (UnkStruct_0208C06C * param0) continue; } - sub_0200D888(v1, v2, 19, sub_02079D8C(v7, v9, v6), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000 + v5); + sub_0200D888(v1, v2, 19, PokeIconSpriteIndex(v7, v9, v6), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000 + v5); v4.unk_00 = 110 + ((v5 % 6) * 24); v4.unk_02 = 48 + ((v5 / 6) * 22); @@ -1121,7 +1121,7 @@ static void ov62_0223AE60 (UnkStruct_0208C06C * param0) v4.unk_14[5] = 0xffffffff; v0->unk_2B4[v5] = sub_0200CE6C(v1, v2, &v4); - v8 = sub_02079EDC(v7, v6, v9); + v8 = PokeIconPaletteIndex(v7, v6, v9); sub_0200D430(v0->unk_2B4[v5], 4 + v8); sub_0200D364(v0->unk_2B4[v5], 1); diff --git a/src/overlay075/ov75_021D0D80.c b/src/overlay075/ov75_021D0D80.c index 9a41c268f9..e46604c892 100644 --- a/src/overlay075/ov75_021D0D80.c +++ b/src/overlay075/ov75_021D0D80.c @@ -51,7 +51,7 @@ #include "strbuf.h" #include "unk_020279FC.h" #include "unk_020393C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay075/ov75_021D0D80.h" enum { @@ -902,9 +902,9 @@ static void ov75_021D1ADC (UnkStruct_ov75_021D1184 * param0) sub_0200A93C(param0->unk_00); } - sub_0200CC9C(param0->unk_A8, param0->unk_AC, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 0); - sub_0200CE0C(param0->unk_A8, param0->unk_AC, 19, sub_02079FD4(), 0, 0); - sub_0200CE3C(param0->unk_A8, param0->unk_AC, 19, sub_02079FE0(), 0, 0); + sub_0200CC9C(param0->unk_A8, param0->unk_AC, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 0); + sub_0200CE0C(param0->unk_A8, param0->unk_AC, 19, PokeIconCellsFileIndex(), 0, 0); + sub_0200CE3C(param0->unk_A8, param0->unk_AC, 19, PokeIconAnimationFileIndex(), 0, 0); for (v0 = 0; v0 < 3; v0++) { if (param0->unk_1C->unk_14[v0].val2 == 0xFFFF) { diff --git a/src/overlay076/ov76_0223B870.c b/src/overlay076/ov76_0223B870.c index fdf791c889..bce7b00ec9 100644 --- a/src/overlay076/ov76_0223B870.c +++ b/src/overlay076/ov76_0223B870.c @@ -52,7 +52,7 @@ #include "unk_02024220.h" #include "unk_0202C9F4.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_02097B18.h" #include "overlay012/ov12_02225864.h" #include "overlay076/ov76_0223B870.h" @@ -549,15 +549,15 @@ void ov76_0223C110 (UnkStruct_ov76_0223DE00 * param0) v1 = param0->unk_D4.unk_0C; v2 = param0->unk_D4.unk_14; - sub_0200CD7C(v2, 2, v0, v1, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 16000); + sub_0200CD7C(v2, 2, v0, v1, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 16000); { - int v3 = sub_02079FDC(); + int v3 = PokeIcon64KCellsFileIndex(); sub_0200CE0C(v0, v1, 19, v3, 0, 17000); } { - int v4 = sub_02079FE8(); + int v4 = PokeIcon64KAnimationFileIndex(); sub_0200CE3C(v0, v1, 19, v4, 0, 18000); } } @@ -575,7 +575,7 @@ void ov76_0223C188 (UnkStruct_ov76_0223DE00 * param0) for (v0 = 0; v0 < param0->unk_00->unk_00; v0++) { v5 = param0->unk_00->unk_04[v0]; - sub_0200D888(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, 19, sub_02079D80(v5), 0, NNS_G2D_VRAM_TYPE_2DMAIN, (v0 + 15000)); + sub_0200D888(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, 19, Pokemon_IconSpriteIndex(v5), 0, NNS_G2D_VRAM_TYPE_2DMAIN, (v0 + 15000)); v6.unk_00 = 0; v6.unk_02 = 0; @@ -598,7 +598,7 @@ void ov76_0223C188 (UnkStruct_ov76_0223DE00 * param0) v2 = Pokemon_GetValue(v5, MON_DATA_SPECIES, NULL); v1 = Pokemon_GetValue(v5, MON_DATA_IS_EGG, NULL); v4 = Pokemon_GetValue(v5, MON_DATA_FORM, NULL); - v3 = sub_02079EDC(v2, v4, v1); + v3 = PokeIconPaletteIndex(v2, v4, v1); sub_02021F24(param0->unk_2FC[v0]->unk_00, v3); sub_0200D364(param0->unk_2FC[v0], 1); diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index 654dea667e..ed3477162c 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -92,7 +92,7 @@ #include "unk_020507CC.h" #include "unk_0206AFE0.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "item.h" #include "unk_0207D3B8.h" @@ -354,7 +354,7 @@ static void ov88_0223B2F0 (NNSG2dCharacterData * param0, int param1, int param2, u8 * v0; GX_LoadOBJ(param0->pRawData, ((4 * 32 + 18) + param4 * (4 * 4)) * 0x20, ((4 * 4) * 0x20)); - sub_02021EF0(param5, sub_02079EDC(param1, param2, param3) + 10); + sub_02021EF0(param5, PokeIconPaletteIndex(param1, param2, param3) + 10); } static void ov88_0223B320 (UnkStruct_02095E80 * param0) @@ -540,7 +540,7 @@ static void ov88_0223B7A0 (Party * param0, int param1, UnkStruct_02095E80 * para for (v0 = 0; v0 < Party_GetCurrentCount(param0); v0++) { v1 = v0 + param1; - param2->unk_7E8[v1] = sub_02006F50(19, sub_02079D8C(param2->unk_6F4[v1].unk_00, param2->unk_6F4[v1].unk_05, param2->unk_6F4[v1].unk_06), 0, ¶m2->unk_818[v1], 26); + param2->unk_7E8[v1] = sub_02006F50(19, PokeIconSpriteIndex(param2->unk_6F4[v1].unk_00, param2->unk_6F4[v1].unk_05, param2->unk_6F4[v1].unk_06), 0, ¶m2->unk_818[v1], 26); DC_FlushRange(param2->unk_818[v1]->pRawData, 0x20 * 4 * 4); @@ -1277,7 +1277,7 @@ static void ov88_0223C66C (UnkStruct_02095E80 * param0, NARC * param1) sub_0200A328(param0->unk_334[1][0]); sub_0200A5C8(param0->unk_334[0][1]); sub_0200A5C8(param0->unk_334[1][1]); - sub_02006E84(19, sub_02079FD0(), 1, 10 * 0x20, 0x20 * 4, 26); + sub_02006E84(19, PokeIconPalettesFileIndex(), 1, 10 * 0x20, 0x20 * 4, 26); } static int ov88_0223C800 (int param0, Pokemon * param1, u8 * param2, UnkStruct_02008A90 * param3) diff --git a/src/overlay094/ov94_0223BCB0.c b/src/overlay094/ov94_0223BCB0.c index ad52242b88..427cb3c189 100644 --- a/src/overlay094/ov94_0223BCB0.c +++ b/src/overlay094/ov94_0223BCB0.c @@ -44,7 +44,7 @@ #include "unk_020279FC.h" #include "unk_02033200.h" #include "unk_020797C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_02099550.h" #include "overlay094/ov94_0223B140.h" #include "overlay094/ov94_0223BCB0.h" @@ -355,7 +355,7 @@ static void ov94_0223C0D4 (UnkStruct_ov94_0223FD4C * param0) int v4, v5, v6, v7; u16 * v8; - v2 = sub_02006F88(19, sub_02079FD0(), &v3, 62); + v2 = sub_02006F88(19, PokeIconPalettesFileIndex(), &v3, 62); DC_FlushRange(v3->pRawData, (3 * 16) * 2); GX_LoadOBJPltt(v3->pRawData, 3 * 0x20, (3 * 16) * 2); diff --git a/src/overlay094/ov94_0223FB48.c b/src/overlay094/ov94_0223FB48.c index 8921b3721b..0305714e1e 100644 --- a/src/overlay094/ov94_0223FB48.c +++ b/src/overlay094/ov94_0223FB48.c @@ -43,7 +43,7 @@ #include "unk_020393C8.h" #include "pokemon.h" #include "unk_020797C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "item.h" #include "overlay094/ov94_0223BCB0.h" @@ -1055,13 +1055,13 @@ static void ov94_02240DF8 (int param0, int param1, int param2, int param3, UnkSt u8 * v1; NNSG2dCharacterData * v2; - v1 = ov94_02240DD0(param5, sub_02079D8C(param0, param2, param1), &v2, 62); + v1 = ov94_02240DD0(param5, PokeIconSpriteIndex(param0, param2, param1), &v2, 62); MI_CpuCopyFast(v2->pRawData, param6->unk_0C, ((4 * 4) * 0x20)); param6->unk_00 = (12 + param3 * (4 * 4)) * 0x20; param6->unk_08 = param4; - param6->unk_04 = sub_02079EDC(param0, param1, param2) + 3; + param6->unk_04 = PokeIconPaletteIndex(param0, param1, param2) + 3; Heap_FreeToHeap(v1); } diff --git a/src/overlay097/ov97_02230410.c b/src/overlay097/ov97_02230410.c index 6cbad273b6..6caa5fadd4 100644 --- a/src/overlay097/ov97_02230410.c +++ b/src/overlay097/ov97_02230410.c @@ -65,7 +65,7 @@ #include "unk_020363E8.h" #include "unk_020366A0.h" #include "unk_020393C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay097/ov97_0222D04C.h" #include "overlay097/ov97_02232054.h" #include "overlay097/ov97_02237694.h" @@ -802,7 +802,7 @@ static void ov97_022310FC (UnkStruct_ov97_02230868 * param0) ov97_02237A74(); ov97_02237B0C(116, 26, 23, 25, 24, 0); - sub_02006E84(19, sub_02079FD0(), 1, 3 * 0x20, 0, param0->unk_00); + sub_02006E84(19, PokeIconPalettesFileIndex(), 1, 3 * 0x20, 0, param0->unk_00); } v2 = 1; @@ -820,12 +820,12 @@ static void ov97_022310FC (UnkStruct_ov97_02230868 * param0) } param0->unk_2E90[v1] = ov97_02237D14(0, param0->unk_2E90[v1], v0, 16, 10 + v1); - v3 = sub_02006F50(19, sub_02079D8C(v2, 0, 0), 0, &v4, param0->unk_00); + v3 = sub_02006F50(19, PokeIconSpriteIndex(v2, 0, 0), 0, &v4, param0->unk_00); DC_FlushRange(v4->pRawData, ((4 * 4) * 0x20)); GX_LoadOBJ(v4->pRawData, (0x64 + v1 * (4 * 4)) * 0x20, ((4 * 4) * 0x20)); - sub_02021E90(param0->unk_2E90[v1], sub_02079EDC(v2, 0, 0) + 3); + sub_02021E90(param0->unk_2E90[v1], PokeIconPaletteIndex(v2, 0, 0) + 3); Heap_FreeToHeap(v3); } } diff --git a/src/overlay097/ov97_02233B18.c b/src/overlay097/ov97_02233B18.c index 804bb01739..51a3f4ef4f 100644 --- a/src/overlay097/ov97_02233B18.c +++ b/src/overlay097/ov97_02233B18.c @@ -71,7 +71,7 @@ #include "unk_020279FC.h" #include "unk_0202EEC0.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "item.h" #include "unk_0209A74C.h" #include "overlay097/ov97_02235D18.h" @@ -547,7 +547,7 @@ static void ov97_02233FA4 (UnkStruct_ov97_02234A2C * param0) sub_0200A328(param0->unk_1D0[0]); sub_0200A5C8(param0->unk_1D0[1]); - sub_02006E84(19, sub_02079FD0(), 1, 8 * 0x20, 0, 78); + sub_02006E84(19, PokeIconPalettesFileIndex(), 1, 8 * 0x20, 0, 78); } static void ov97_022340B0 (UnkStruct_ov97_02234A2C * param0) @@ -660,12 +660,12 @@ static void ov97_02234278 (int param0, int param1, u32 param2, int param3, int p param0 = ov97_02236DD0(param0); v1 = GBASpeciesToDSFormId(param0, param2, param3); - v0 = ov97_022341B4(19, sub_02079D8C(param0, param1, v1), &v2, 78); + v0 = ov97_022341B4(19, PokeIconSpriteIndex(param0, param1, v1), &v2, 78); DC_FlushRange(v2->pRawData, ((4 * 4) * 0x20)); GX_LoadOBJ(v2->pRawData, (0x64 + param4 * (4 * 4)) * 0x20, ((4 * 4) * 0x20)); - sub_02021E90(param5, sub_02079EDC(param0, v1, param1) + 8); + sub_02021E90(param5, PokeIconPaletteIndex(param0, v1, param1) + 8); Heap_FreeToHeap(v0); } @@ -682,14 +682,14 @@ static void ov97_022342E4 (int param0, int param1, int param2, int param3, UnkSt param0 = 0; } - v0 = sub_02079D8C(param0, param1, param2); + v0 = PokeIconSpriteIndex(param0, param1, param2); ov97_022341EC(v0, &v1, param5, param6); MI_CpuCopyFast(v1->pRawData, v2->unk_0C, ((4 * 4) * 0x20)); v2->unk_00 = (0x64 + param3 * (4 * 4)) * 0x20; v2->unk_08 = param4; - v2->unk_04 = sub_02079EDC(param0, param2, param1) + 8; + v2->unk_04 = PokeIconPaletteIndex(param0, param2, param1) + 8; } else { v2->unk_08 = NULL; } diff --git a/src/overlay104/ov104_02231F74.c b/src/overlay104/ov104_02231F74.c index 2de49cc628..7c9353b75c 100644 --- a/src/overlay104/ov104_02231F74.c +++ b/src/overlay104/ov104_02231F74.c @@ -61,7 +61,7 @@ #include "unk_02025E08.h" #include "unk_020279FC.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_0207E0B8.h" #include "unk_0209B6F8.h" #include "overlay063/ov63_0222BE18.h" @@ -1192,9 +1192,9 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov104_0223F9AC = { void ov104_02232EC0 (UnkStruct_ov104_0223C4CC * param0) { - sub_0200CD7C(param0->unk_04, 2, param0->unk_34.unk_00, param0->unk_34.unk_04, 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 2000); - sub_0200CE0C(param0->unk_34.unk_00, param0->unk_34.unk_04, 19, sub_02079FD8(), 0, 2000); - sub_0200CE3C(param0->unk_34.unk_00, param0->unk_34.unk_04, 19, sub_02079FE4(), 0, 2000); + sub_0200CD7C(param0->unk_04, 2, param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 2000); + sub_0200CE0C(param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIcon32KCellsFileIndex(), 0, 2000); + sub_0200CE3C(param0->unk_34.unk_00, param0->unk_34.unk_04, 19, PokeIcon32KAnimationFileIndex(), 0, 2000); } void ov104_02232F28 (UnkStruct_ov104_0223C4CC * param0) @@ -1212,7 +1212,7 @@ CellActorData * ov104_02232F4C (UnkStruct_ov104_0223C4CC * param0, Pokemon * par GF_ASSERT(param2 < (2008 - 2000)); sub_0200D888( - param0->unk_34.unk_00, param0->unk_34.unk_04, 19, sub_02079D80(param1), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2000 + param2); + param0->unk_34.unk_00, param0->unk_34.unk_04, 19, Pokemon_IconSpriteIndex(param1), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2000 + param2); v1 = Unk_ov104_0223F9E0; @@ -1223,7 +1223,7 @@ CellActorData * ov104_02232F4C (UnkStruct_ov104_0223C4CC * param0, Pokemon * par v0 = sub_0200CE6C(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); - sub_02021F24(v0->unk_00, sub_02079FC4(param1)); + sub_02021F24(v0->unk_00, Pokemon_IconPaletteIndex(param1)); sub_0200D330(v0); return v0; diff --git a/src/overlay106/ov106_02243310.c b/src/overlay106/ov106_02243310.c index 0f86c45127..78d4f03606 100644 --- a/src/overlay106/ov106_02243310.c +++ b/src/overlay106/ov106_02243310.c @@ -19,7 +19,7 @@ #include "unk_0201F834.h" #include "gx_layers.h" #include "unk_020218BC.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay106/ov106_02243310.h" void ov106_02243310(UnkStruct_ov106_02243310 * param0, Pokemon * param1); @@ -56,10 +56,10 @@ void ov106_02243310 (UnkStruct_ov106_02243310 * param0, Pokemon * param1) param0->unk_1A0[0][3] = sub_02009918(param0->unk_190[3], 151, 13, 1, 0, 3, 98); v1 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, 98); - param0->unk_1A0[1][0] = sub_02009A4C(param0->unk_190[0], v1, sub_02079D80(param1), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 98); - param0->unk_1A0[1][1] = sub_020098B8(param0->unk_190[1], 19, sub_02079FD0(), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 3, 98); - param0->unk_1A0[1][2] = sub_02009BC4(param0->unk_190[2], v1, sub_02079FD8(), 0, 1, 2, 98); - param0->unk_1A0[1][3] = sub_02009BC4(param0->unk_190[3], v1, sub_02079FE4(), 0, 1, 3, 98); + param0->unk_1A0[1][0] = sub_02009A4C(param0->unk_190[0], v1, Pokemon_IconSpriteIndex(param1), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 98); + param0->unk_1A0[1][1] = sub_020098B8(param0->unk_190[1], 19, PokeIconPalettesFileIndex(), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 3, 98); + param0->unk_1A0[1][2] = sub_02009BC4(param0->unk_190[2], v1, PokeIcon32KCellsFileIndex(), 0, 1, 2, 98); + param0->unk_1A0[1][3] = sub_02009BC4(param0->unk_190[3], v1, PokeIcon32KAnimationFileIndex(), 0, 1, 3, 98); for (v0 = 0; v0 < 2; v0++) { sub_0200A328(param0->unk_1A0[v0][0]); diff --git a/src/overlay106/ov106_022435FC.c b/src/overlay106/ov106_022435FC.c index b7fd384ffd..804c3fe0f8 100644 --- a/src/overlay106/ov106_022435FC.c +++ b/src/overlay106/ov106_022435FC.c @@ -9,7 +9,7 @@ #include "heap.h" #include "unk_020218BC.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay106/ov106_02243310.h" #include "overlay106/ov106_022435FC.h" @@ -93,6 +93,6 @@ void ov106_022436B0 (UnkStruct_ov106_02243650 * param0, u32 param1) void ov106_022436CC (UnkStruct_ov106_02243650 * param0, Pokemon * param1) { - sub_02021F24(param0->unk_10, sub_02079FC4(param1)); + sub_02021F24(param0->unk_10, Pokemon_IconPaletteIndex(param1)); return; } diff --git a/src/overlay107/ov107_02249604.c b/src/overlay107/ov107_02249604.c index 93b530ca2d..8f404f1562 100644 --- a/src/overlay107/ov107_02249604.c +++ b/src/overlay107/ov107_02249604.c @@ -22,7 +22,7 @@ #include "unk_0201F834.h" #include "gx_layers.h" #include "unk_020218BC.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "item.h" #include "unk_0207E0B8.h" @@ -78,9 +78,9 @@ void ov107_02249604 (UnkStruct_ov107_02249954 * param0, Party * param1, u8 param v1 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, 100); - param0->unk_1A0[3][1] = sub_020098B8(param0->unk_190[1], 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 3, 100); - param0->unk_1A0[3][2] = sub_02009BC4(param0->unk_190[2], v1, sub_02079FD8(), 0, 3, 2, 100); - param0->unk_1A0[3][3] = sub_02009BC4(param0->unk_190[3], v1, sub_02079FE4(), 0, 3, 3, 100); + param0->unk_1A0[3][1] = sub_020098B8(param0->unk_190[1], 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 3, 100); + param0->unk_1A0[3][2] = sub_02009BC4(param0->unk_190[2], v1, PokeIcon32KCellsFileIndex(), 0, 3, 2, 100); + param0->unk_1A0[3][3] = sub_02009BC4(param0->unk_190[3], v1, PokeIcon32KAnimationFileIndex(), 0, 3, 3, 100); for (v0 = 0; v0 < 4; v0++) { if (v0 == 3) { @@ -93,7 +93,7 @@ void ov107_02249604 (UnkStruct_ov107_02249954 * param0, Party * param1, u8 param v2 = Party_GetPokemonBySlotIndex(param1, v0); } - param0->unk_1A0[3 + v0][0] = sub_02009A4C(param0->unk_190[0], v1, sub_02079D80(v2), 0, 3 + v0, NNS_G2D_VRAM_TYPE_2DMAIN, 100); + param0->unk_1A0[3 + v0][0] = sub_02009A4C(param0->unk_190[0], v1, Pokemon_IconSpriteIndex(v2), 0, 3 + v0, NNS_G2D_VRAM_TYPE_2DMAIN, 100); } NARC_dtor(v1); diff --git a/src/overlay107/ov107_02249B1C.c b/src/overlay107/ov107_02249B1C.c index c9c94dbed3..692d69e797 100644 --- a/src/overlay107/ov107_02249B1C.c +++ b/src/overlay107/ov107_02249B1C.c @@ -10,7 +10,7 @@ #include "unk_02005474.h" #include "heap.h" #include "unk_020218BC.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay104/ov104_0222DCE0.h" #include "overlay107/ov107_02249604.h" #include "overlay107/ov107_02249B1C.h" @@ -94,7 +94,7 @@ void ov107_02249BEC (UnkStruct_ov107_02249B8C * param0, u32 param1) void ov107_02249C08 (UnkStruct_ov107_02249B8C * param0, Pokemon * param1) { - sub_02021F24(param0->unk_04, sub_02079FC4(param1)); + sub_02021F24(param0->unk_04, Pokemon_IconPaletteIndex(param1)); return; } diff --git a/src/overlay108/ov108_02243030.c b/src/overlay108/ov108_02243030.c index ff4a45a9f5..99c7de2ebd 100644 --- a/src/overlay108/ov108_02243030.c +++ b/src/overlay108/ov108_02243030.c @@ -21,7 +21,7 @@ #include "unk_0201F834.h" #include "gx_layers.h" #include "unk_020218BC.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "unk_0207E0B8.h" #include "overlay108/ov108_02243030.h" @@ -190,9 +190,9 @@ static void ov108_02243360 (UnkStruct_ov108_02243030 * param0, Party * param1, P v2 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, 103); - param0->unk_1A0[3][1] = sub_020098B8(param0->unk_190[1], 19, sub_02079FD0(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 3, 103); - param0->unk_1A0[3][2] = sub_02009BC4(param0->unk_190[2], v2, sub_02079FD8(), 0, 3, 2, 103); - param0->unk_1A0[3][3] = sub_02009BC4(param0->unk_190[3], v2, sub_02079FE4(), 0, 3, 3, 103); + param0->unk_1A0[3][1] = sub_020098B8(param0->unk_190[1], 19, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 3, 103); + param0->unk_1A0[3][2] = sub_02009BC4(param0->unk_190[2], v2, PokeIcon32KCellsFileIndex(), 0, 3, 2, 103); + param0->unk_1A0[3][3] = sub_02009BC4(param0->unk_190[3], v2, PokeIcon32KAnimationFileIndex(), 0, 3, 3, 103); for (v3 = 0; v3 < (2 * 2); v3++) { if (v3 == 3) { @@ -208,8 +208,8 @@ static void ov108_02243360 (UnkStruct_ov108_02243030 * param0, Party * param1, P v1 = Party_GetPokemonBySlotIndex(param2, v3); } - param0->unk_1A0[3 + v3][0] = sub_02009A4C(param0->unk_190[0], v2, sub_02079D80(v0), 0, 3 + v3, NNS_G2D_VRAM_TYPE_2DMAIN, 103); - param0->unk_1A0[7 + v3][0] = sub_02009A4C(param0->unk_190[0], v2, sub_02079D80(v1), 0, 7 + v3, NNS_G2D_VRAM_TYPE_2DMAIN, 103); + param0->unk_1A0[3 + v3][0] = sub_02009A4C(param0->unk_190[0], v2, Pokemon_IconSpriteIndex(v0), 0, 3 + v3, NNS_G2D_VRAM_TYPE_2DMAIN, 103); + param0->unk_1A0[7 + v3][0] = sub_02009A4C(param0->unk_190[0], v2, Pokemon_IconSpriteIndex(v1), 0, 7 + v3, NNS_G2D_VRAM_TYPE_2DMAIN, 103); } NARC_dtor(v2); diff --git a/src/overlay108/ov108_0224351C.c b/src/overlay108/ov108_0224351C.c index 8237263cec..b0603736ef 100644 --- a/src/overlay108/ov108_0224351C.c +++ b/src/overlay108/ov108_0224351C.c @@ -9,7 +9,7 @@ #include "heap.h" #include "unk_020218BC.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "overlay108/ov108_02243030.h" #include "overlay108/ov108_0224351C.h" @@ -98,7 +98,7 @@ void ov108_022435F4 (UnkStruct_ov108_02243594 * param0, u32 param1) void ov108_02243610 (UnkStruct_ov108_02243594 * param0, Pokemon * param1) { - sub_02021F24(param0->unk_10, sub_02079FC4(param1)); + sub_02021F24(param0->unk_10, Pokemon_IconPaletteIndex(param1)); return; } diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c new file mode 100644 index 0000000000..678f51460b --- /dev/null +++ b/src/pokemon_icon.c @@ -0,0 +1,210 @@ +#include +#include + +#include "constants/pokemon.h" + +#include "pokemon.h" +#include "pokemon_icon.h" + +#include "data/pokeicon_palettes.h" + +enum { + POKEICON_SHARED_PALETTES = 0, + POKEICON_SHARED_ANIMATION, + POKEICON_SHARED_CELLS, + POKEICON_SHARED_32K_ANIMATION, + POKEICON_SHARED_32K_CELLS, + POKEICON_SHARED_64K_ANIMATION, + POKEICON_SHARED_64K_CELLS, + + POKEICON_ICON_TILES_START, +}; + +static inline u32 IconTilesIndex(u32 icon) +{ + return icon + POKEICON_ICON_TILES_START; +} + +u32 BoxPokemon_IconSpriteIndex(const BoxPokemon *mon) +{ + BOOL ctx = BoxPokemon_EnterDecryptionContext((BoxPokemon *)mon); + + u32 species = BoxPokemon_GetValue((BoxPokemon *)mon, MON_DATA_SPECIES, NULL); + BOOL isEgg = BoxPokemon_GetValue((BoxPokemon *)mon, MON_DATA_IS_EGG, NULL); + u32 form = BoxPokemon_IconFormOffset((BoxPokemon *)mon); + u32 index = PokeIconSpriteIndex(species, isEgg, form); + + BoxPokemon_ExitDecryptionContext((BoxPokemon *)mon, ctx); + return index; +} + +u32 Pokemon_IconSpriteIndex(Pokemon *mon) +{ + return BoxPokemon_IconSpriteIndex((const BoxPokemon *)Pokemon_GetBoxPokemon(mon)); +} + +u32 PokeIconSpriteIndex(u32 species, u32 isEgg, u32 form) +{ + if (isEgg == TRUE) { + if (species == SPECIES_MANAPHY) { + return IconTilesIndex(ICON_MANAPHY_EGG); + } + + return IconTilesIndex(ICON_EGG); + } + + form = Pokemon_SanitizeFormId(species, form); + + if (form != 0) { + if (species == SPECIES_DEOXYS) { + return IconTilesIndex(ICON_DEOXYS_ATTACK) + form - 1; + } + + if (species == SPECIES_UNOWN) { + return IconTilesIndex(ICON_UNOWN_B) + form - 1; + } + + if (species == SPECIES_BURMY) { + return IconTilesIndex(ICON_BURMY_SANDY) + form - 1; + } + + if (species == SPECIES_WORMADAM) { + return IconTilesIndex(ICON_WORMADAM_SANDY) + form - 1; + } + + if (species == SPECIES_SHELLOS) { + return IconTilesIndex(ICON_SHELLOS_EAST_SEA) + form - 1; + } + + if (species == SPECIES_GASTRODON) { + return IconTilesIndex(ICON_GASTRODON_EAST_SEA) + form - 1; + } + + if (species == SPECIES_GIRATINA) { + return IconTilesIndex(ICON_GIRATINA_ORIGIN) + form - 1; + } + + if (species == SPECIES_SHAYMIN) { + return IconTilesIndex(ICON_SHAYMIN_SKY) + form - 1; + } + + if (species == SPECIES_ROTOM) { + return IconTilesIndex(ICON_ROTOM_HEAT) + form - 1; + } + } + + if (species > NATIONAL_DEX_COUNT) { + species = SPECIES_NONE; + } + + return IconTilesIndex(species); +} + +u16 BoxPokemon_IconFormOffset(const BoxPokemon *mon) +{ + u32 speciesOrEgg = BoxPokemon_GetValue((BoxPokemon *)mon, MON_DATA_SPECIES_EGG, NULL); + + switch (speciesOrEgg) { + case SPECIES_UNOWN: + return BoxPokemon_GetForm((BoxPokemon *)mon); + case SPECIES_DEOXYS: + case SPECIES_BURMY: + case SPECIES_WORMADAM: + case SPECIES_SHELLOS: + case SPECIES_GASTRODON: + case SPECIES_GIRATINA: + case SPECIES_SHAYMIN: + case SPECIES_ROTOM: + return BoxPokemon_GetValue((BoxPokemon *)mon, MON_DATA_FORM, NULL); + } + + return 0; +} + +const u8 PokeIconPaletteIndex(u32 species, u32 form, u32 isEgg) +{ + if (isEgg == TRUE) { + if (species == SPECIES_MANAPHY) { + species = ICON_MANAPHY_EGG; + } else { + species = ICON_EGG; + } + } else if (species > NATIONAL_DEX_COUNT) { + species = SPECIES_NONE; + } else if (form != 0) { + if (species == SPECIES_DEOXYS) { + species = ICON_DEOXYS_ATTACK + form - 1; + } else if (species == SPECIES_UNOWN) { + species = ICON_UNOWN_A + form - 1; + } else if (species == SPECIES_BURMY) { + species = ICON_BURMY_SANDY + form - 1; + } else if (species == SPECIES_WORMADAM) { + species = ICON_WORMADAM_SANDY + form - 1; + } else if (species == SPECIES_SHELLOS) { + species = ICON_SHELLOS_EAST_SEA + form - 1; + } else if (species == SPECIES_GASTRODON) { + species = ICON_GASTRODON_EAST_SEA + form - 1; + } else if (species == SPECIES_GIRATINA) { + species = ICON_GIRATINA_ORIGIN + form - 1; + } else if (species == SPECIES_SHAYMIN) { + species = ICON_SHAYMIN_SKY + form - 1; + } else if (species == SPECIES_ROTOM) { + species = ICON_ROTOM_HEAT + form - 1; + } + } + + return sPokemonIconPaletteIndex[species]; +} + +const u8 BoxPokemon_IconPaletteIndex(const BoxPokemon *mon) +{ + BOOL ctx = BoxPokemon_EnterDecryptionContext((BoxPokemon *)mon); + + u32 form = BoxPokemon_IconFormOffset(mon); + u32 species = BoxPokemon_GetValue((BoxPokemon *)mon, MON_DATA_SPECIES, NULL); + u32 isEgg = BoxPokemon_GetValue((BoxPokemon *)mon, MON_DATA_IS_EGG, NULL); + + BoxPokemon_ExitDecryptionContext((BoxPokemon *)mon, ctx); + + return PokeIconPaletteIndex(species, form, isEgg); +} + +const u8 Pokemon_IconPaletteIndex(Pokemon *mon) +{ + return BoxPokemon_IconPaletteIndex((const BoxPokemon *)Pokemon_GetBoxPokemon(mon)); +} + +u32 PokeIconPalettesFileIndex(void) +{ + return POKEICON_SHARED_PALETTES; +} + +u32 PokeIconCellsFileIndex(void) +{ + return POKEICON_SHARED_CELLS; +} + +u32 PokeIcon32KCellsFileIndex(void) +{ + return POKEICON_SHARED_32K_CELLS; +} + +u32 PokeIcon64KCellsFileIndex(void) +{ + return POKEICON_SHARED_64K_CELLS; +} + +u32 PokeIconAnimationFileIndex(void) +{ + return POKEICON_SHARED_ANIMATION; +} + +u32 PokeIcon32KAnimationFileIndex(void) +{ + return POKEICON_SHARED_32K_ANIMATION; +} + +u32 PokeIcon64KAnimationFileIndex(void) +{ + return POKEICON_SHARED_64K_ANIMATION; +} diff --git a/src/unk_02028124.c b/src/unk_02028124.c index 856d52d66d..9bf7381d83 100644 --- a/src/unk_02028124.c +++ b/src/unk_02028124.c @@ -17,7 +17,7 @@ #include "trainer_info.h" #include "unk_02028124.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" static int sub_020284E8(UnkStruct_0202818C * param0, int param1); @@ -113,8 +113,8 @@ void sub_020281AC (UnkStruct_0202818C * param0, u8 param1, u8 param2, SaveData * v4 = Pokemon_GetValue(v10, MON_DATA_SPECIES, NULL); v6 = Pokemon_GetValue(v10, MON_DATA_IS_EGG, NULL); v7 = Pokemon_GetValue(v10, MON_DATA_FORM, NULL); - v5 = sub_02079D80(v10); - v2 = sub_02079EDC(v4, v7, v6); + v5 = Pokemon_IconSpriteIndex(v10); + v2 = PokeIconPaletteIndex(v4, v7, v6); param0->unk_18[v1].val1_0 = (u16)v5; param0->unk_18[v1].val1_12 = v2; @@ -122,7 +122,7 @@ void sub_020281AC (UnkStruct_0202818C * param0, u8 param1, u8 param2, SaveData * for (v3 = 0; v3 < NELEMS(Unk_020E5B0C); v3++) { if ((Unk_020E5B0C[v3].unk_02 == param0->unk_18[v1].val1_0) && (Unk_020E5B0C[v3].unk_06 == v7)) { param0->unk_18[v1].val1_0 = Unk_020E5B0C[v3].unk_00; - param0->unk_18[v1].val1_12 = sub_02079EDC(v4, 0, v6); + param0->unk_18[v1].val1_12 = PokeIconPaletteIndex(v4, 0, v6); param0->unk_1E |= Unk_020E5B0C[v3].unk_06 << (v1 * 5); break; } @@ -186,7 +186,7 @@ u16 sub_02028328 (const UnkStruct_0202818C * param0, u8 param1, u8 param2, u16 p for (v1 = 0; v1 < NELEMS(Unk_020E5B0C); v1++) { if ((Unk_020E5B0C[v1].unk_00 == v0.val1_0) && (Unk_020E5B0C[v1].unk_06 == ((param3 >> (param1 * 5)) & 0x1f))) { v0.val1_0 = Unk_020E5B0C[v1].unk_02; - v0.val1_12 = sub_02079EDC( + v0.val1_12 = PokeIconPaletteIndex( Unk_020E5B0C[v1].unk_04, Unk_020E5B0C[v1].unk_06, 0); break; } diff --git a/src/unk_02056720.c b/src/unk_02056720.c index 2ae4158a37..fb3abb4561 100644 --- a/src/unk_02056720.c +++ b/src/unk_02056720.c @@ -7,7 +7,7 @@ #include "unk_020244AC.h" #include "unk_02056720.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" typedef struct UnkStruct_02056B24_t { u8 unk_00_0 : 1; @@ -303,7 +303,7 @@ void sub_02056A48 (UnkStruct_02056B24 * param0, const BoxPokemon * param1) } param0->unk_B8[v0].unk_00 = BoxPokemon_GetValue((BoxPokemon *)param1, MON_DATA_SPECIES, NULL); - param0->unk_B8[v0].unk_02 = sub_02079E44(param1); + param0->unk_B8[v0].unk_02 = BoxPokemon_IconFormOffset(param1); param0->unk_B8[v0].unk_04 = BoxPokemon_GetValue((BoxPokemon *)param1, MON_DATA_FORM, NULL); } diff --git a/src/unk_02079D40.c b/src/unk_02079D40.c deleted file mode 100644 index 983e24eab0..0000000000 --- a/src/unk_02079D40.c +++ /dev/null @@ -1,748 +0,0 @@ -#include -#include - -#include "pokemon.h" - -#include "pokemon.h" -#include "unk_02079D40.h" - -const u8 Unk_020F0780[] = { - 0x0, - 0x1, - 0x1, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x1, - 0x1, - 0x0, - 0x1, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x2, - 0x1, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x0, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x0, - 0x0, - 0x2, - 0x1, - 0x0, - 0x0, - 0x2, - 0x2, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x1, - 0x1, - 0x1, - 0x2, - 0x1, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x0, - 0x2, - 0x0, - 0x1, - 0x1, - 0x1, - 0x2, - 0x2, - 0x1, - 0x1, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x1, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x1, - 0x1, - 0x1, - 0x2, - 0x2, - 0x1, - 0x2, - 0x2, - 0x1, - 0x1, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x1, - 0x2, - 0x1, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x1, - 0x1, - 0x1, - 0x1, - 0x1, - 0x1, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x0, - 0x0, - 0x1, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x1, - 0x2, - 0x2, - 0x0, - 0x0, - 0x2, - 0x0, - 0x0, - 0x1, - 0x2, - 0x2, - 0x1, - 0x1, - 0x1, - 0x1, - 0x2, - 0x2, - 0x1, - 0x1, - 0x1, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x2, - 0x2, - 0x2, - 0x0, - 0x0, - 0x2, - 0x0, - 0x0, - 0x1, - 0x2, - 0x0, - 0x0, - 0x2, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x1, - 0x2, - 0x2, - 0x1, - 0x1, - 0x1, - 0x1, - 0x1, - 0x0, - 0x2, - 0x0, - 0x1, - 0x0, - 0x1, - 0x0, - 0x1, - 0x1, - 0x1, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x2, - 0x0, - 0x2, - 0x0, - 0x2, - 0x1, - 0x1, - 0x1, - 0x1, - 0x1, - 0x1, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x1, - 0x1, - 0x1, - 0x2, - 0x0, - 0x1, - 0x1, - 0x2, - 0x2, - 0x1, - 0x1, - 0x1, - 0x1, - 0x0, - 0x2, - 0x2, - 0x2, - 0x1, - 0x2, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x0, - 0x1, - 0x2, - 0x0, - 0x0, - 0x2, - 0x0, - 0x1, - 0x0, - 0x1, - 0x0, - 0x2, - 0x1, - 0x1, - 0x1, - 0x1, - 0x1, - 0x1, - 0x0, - 0x0, - 0x0, - 0x2, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x2, - 0x0, - 0x0, - 0x0, - 0x2, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x2, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x1, - 0x0, - 0x0, - 0x1, - 0x1, - 0x1, - 0x1, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x1, - 0x1, - 0x1, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x2, - 0x2, - 0x0, - 0x1, - 0x0, - 0x2, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x2, - 0x1, - 0x1, - 0x0, - 0x2, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x1, - 0x1, - 0x0, - 0x0, - 0x1, - 0x0, - 0x2, - 0x1, - 0x0, - 0x2, - 0x1, - 0x1, - 0x0, - 0x2, - 0x2, - 0x0, - 0x1, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x2, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x1, - 0x2, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x1, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0 -}; - - -u32 sub_02079D40 (const BoxPokemon * param0) -{ - u32 v0; - u32 v1; - BOOL v2; - u32 v3; - u32 v4; - - v2 = BoxPokemon_EnterDecryptionContext((BoxPokemon *)param0); - v0 = BoxPokemon_GetValue((BoxPokemon *)param0, MON_DATA_SPECIES, NULL); - v4 = BoxPokemon_GetValue((BoxPokemon *)param0, MON_DATA_IS_EGG, NULL); - v3 = sub_02079E44((BoxPokemon *)param0); - v1 = sub_02079D8C(v0, v4, v3); - - BoxPokemon_ExitDecryptionContext((BoxPokemon *)param0, v2); - return v1; -} - -u32 sub_02079D80 (Pokemon * param0) -{ - return sub_02079D40((const BoxPokemon *)Pokemon_GetBoxPokemon(param0)); -} - -u32 sub_02079D8C (u32 param0, u32 param1, u32 param2) -{ - if (param1 == 1) { - if (param0 == 490) { - return 502; - } else { - return 501; - } - } - - param2 = Pokemon_SanitizeFormId(param0, param2); - - if (param2 != 0) { - if (param0 == 386) { - return 503 + param2 - 1; - } - - if (param0 == 201) { - return 507 + param2 - 1; - } - - if (param0 == 412) { - return 534 + param2 - 1; - } - - if (param0 == 413) { - return 536 + param2 - 1; - } - - if (param0 == 422) { - return 538 + param2 - 1; - } - - if (param0 == 423) { - return 539 + param2 - 1; - } - - if (param0 == 487) { - return 540 + param2 - 1; - } - - if (param0 == 492) { - return 541 + param2 - 1; - } - - if (param0 == 479) { - return 542 + param2 - 1; - } - } - - if (param0 > 493) { - param0 = 0; - } - - return 7 + param0; -} - -u16 sub_02079E44 (const BoxPokemon * param0) -{ - u32 v0; - - v0 = BoxPokemon_GetValue((BoxPokemon *)param0, MON_DATA_SPECIES_EGG, NULL); - - switch (v0) { - case 201: - return BoxPokemon_GetForm((BoxPokemon *)param0); - case 386: - case 412: - case 413: - case 422: - case 423: - case 487: - case 492: - case 479: - return BoxPokemon_GetValue((BoxPokemon *)param0, MON_DATA_FORM, NULL); - default: - return 0; - } - - return 0; -} - -const u8 sub_02079EDC (u32 param0, u32 param1, u32 param2) -{ - if (param2 == 1) { - if (param0 == 490) { - param0 = 495; - } else { - param0 = 494; - } - } else if (param0 > 493) { - param0 = 0; - } else if (param1 != 0) { - if (param0 == 386) { - param0 = 496 + param1 - 1; - } else if (param0 == 201) { - param0 = 499 + param1 - 1; - } else if (param0 == 412) { - param0 = 527 + param1 - 1; - } else if (param0 == 413) { - param0 = 529 + param1 - 1; - } else if (param0 == 422) { - param0 = 531 + param1 - 1; - } else if (param0 == 423) { - param0 = 532 + param1 - 1; - } else if (param0 == 487) { - param0 = 533 + param1 - 1; - } else if (param0 == 492) { - param0 = 534 + param1 - 1; - } else if (param0 == 479) { - param0 = 535 + param1 - 1; - } - } - - return Unk_020F0780[param0]; -} - -const u8 sub_02079F84 (const BoxPokemon * param0) -{ - BOOL v0; - u32 v1; - u32 v2; - u32 v3; - - v0 = BoxPokemon_EnterDecryptionContext((BoxPokemon *)param0); - v2 = sub_02079E44(param0); - v1 = BoxPokemon_GetValue((BoxPokemon *)param0, MON_DATA_SPECIES, NULL); - v3 = BoxPokemon_GetValue((BoxPokemon *)param0, MON_DATA_IS_EGG, NULL); - - BoxPokemon_ExitDecryptionContext((BoxPokemon *)param0, v0); - - return sub_02079EDC(v1, v2, v3); -} - -const u8 sub_02079FC4 (Pokemon * param0) -{ - return sub_02079F84((const BoxPokemon *)Pokemon_GetBoxPokemon(param0)); -} - -u32 sub_02079FD0 (void) -{ - return 0; -} - -u32 sub_02079FD4 (void) -{ - return 2; -} - -u32 sub_02079FD8 (void) -{ - return 4; -} - -u32 sub_02079FDC (void) -{ - return 6; -} - -u32 sub_02079FE0 (void) -{ - return 1; -} - -u32 sub_02079FE4 (void) -{ - return 3; -} - -u32 sub_02079FE8 (void) -{ - return 5; -} diff --git a/src/unk_02082C2C.c b/src/unk_02082C2C.c index b59dbb705f..db57cfefb9 100644 --- a/src/unk_02082C2C.c +++ b/src/unk_02082C2C.c @@ -23,7 +23,7 @@ #include "gx_layers.h" #include "unk_020218BC.h" #include "pokemon.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "party.h" #include "item.h" #include "unk_0207E0B8.h" @@ -82,7 +82,7 @@ void sub_02082CEC (UnkStruct_0207F248 * param0, u8 param1, u16 param2, u16 param param0->unk_704[param1].unk_16 = param2; param0->unk_704[param1].unk_18 = param3; - sub_0200D9B4(param0->unk_5A8, param0->unk_5AC, param4, sub_02079D80(v0), 0, 4 + param1); + sub_0200D9B4(param0->unk_5A8, param0->unk_5AC, param4, Pokemon_IconSpriteIndex(v0), 0, 4 + param1); v2 = Pokemon_GetValue(v0, MON_DATA_IS_EGG, NULL); @@ -92,7 +92,7 @@ void sub_02082CEC (UnkStruct_0207F248 * param0, u8 param1, u16 param2, u16 param v1.unk_08 = 0; v1.unk_0A = 0; v1.unk_0C = 0; - v1.unk_10 = sub_02079EDC(param0->unk_704[param1].unk_04, param0->unk_704[param1].unk_11, v2) + 3; + v1.unk_10 = PokeIconPaletteIndex(param0->unk_704[param1].unk_04, param0->unk_704[param1].unk_11, v2) + 3; v1.unk_14 = NNS_G2D_VRAM_TYPE_2DMAIN; v1.unk_18 = 0; v1.unk_1C = 0; @@ -117,7 +117,7 @@ void sub_02082DA8 (UnkStruct_0207F248 * param0, u8 param1) v3 = Pokemon_GetValue(v0, MON_DATA_FORM, NULL); v1 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, 12); v4 = NNS_G2dGetImageLocation(sub_02021F98(param0->unk_704[param1].unk_24), NNS_G2D_VRAM_TYPE_2DMAIN); - v5 = sub_0200723C(v1, sub_02079D80(v0), 0, 12, 1); + v5 = sub_0200723C(v1, Pokemon_IconSpriteIndex(v0), 0, 12, 1); v7 = NNS_G2dGetUnpackedCharacterData(v5, &v6); if (v7) { @@ -126,7 +126,7 @@ void sub_02082DA8 (UnkStruct_0207F248 * param0, u8 param1) } Heap_FreeToHeap(v5); - sub_0200D414(param0->unk_704[param1].unk_24, sub_02079EDC(v2, v3, 0) + 3); + sub_0200D414(param0->unk_704[param1].unk_24, PokeIconPaletteIndex(v2, v3, 0) + 3); NARC_dtor(v1); } diff --git a/src/unk_0208694C.c b/src/unk_0208694C.c index cbefa7d760..60849f45f5 100644 --- a/src/unk_0208694C.c +++ b/src/unk_0208694C.c @@ -65,7 +65,7 @@ #include "unk_020279FC.h" #include "pokemon.h" #include "unk_020797C8.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_0208694C.h" typedef struct { @@ -966,7 +966,7 @@ static void sub_02086B30 (NNSG2dCharacterData * param0, NNSG2dPaletteData * para GX_LoadOBJ(param0->pRawData, (21 * 32 + 31) * 0x20, 0x20 * 4 * 4); v0 = (u8 *)param1->pRawData; - GX_LoadOBJPltt((void *)(v0 + sub_02079EDC(param2, param3, 0) * 0x20), 6 * 0x20, 0x20); + GX_LoadOBJPltt((void *)(v0 + PokeIconPaletteIndex(param2, param3, 0) * 0x20), 6 * 0x20, 0x20); } static int sub_02086B64 (UnkStruct_020067E8 * param0, int * param1) @@ -1573,10 +1573,10 @@ static void sub_020877F4 (UnkStruct_02087A10 * param0, NARC * param1) param0->unk_328[0][3] = sub_02009BC4(param0->unk_318[3], param1, 14, 1, 0, 3, 18); if (param0->unk_00 == 1) { - param0->unk_518 = sub_02006F50(19, sub_02079D8C(param0->unk_04, 0, param0->unk_08), 0, ¶m0->unk_51C, 18); + param0->unk_518 = sub_02006F50(19, PokeIconSpriteIndex(param0->unk_04, 0, param0->unk_08), 0, ¶m0->unk_51C, 18); DC_FlushRange(param0->unk_51C, 0x20 * 4 * 4); - param0->unk_520 = sub_02006F88(19, sub_02079FD0(), ¶m0->unk_524, 18); + param0->unk_520 = sub_02006F88(19, PokeIconPalettesFileIndex(), ¶m0->unk_524, 18); DC_FlushRange(param0->unk_524, 0x20 * 4); } diff --git a/src/unk_0208EA44.c b/src/unk_0208EA44.c index 4a38589307..702dab59d1 100644 --- a/src/unk_0208EA44.c +++ b/src/unk_0208EA44.c @@ -17,7 +17,7 @@ #include "unk_020218BC.h" #include "pokemon.h" #include "move_table.h" -#include "unk_02079D40.h" +#include "pokemon_icon.h" #include "unk_0207C908.h" #include "unk_0208C324.h" #include "unk_0208EA44.h" @@ -665,19 +665,19 @@ void sub_0208F71C (UnkStruct_0208D7BC * param0) u32 v1; if (param0->unk_24C->unk_11 == 2) { - v1 = sub_02079D40(v0); + v1 = BoxPokemon_IconSpriteIndex(v0); } else { - v1 = sub_02079D80(v0); + v1 = Pokemon_IconSpriteIndex(v0); } sub_0200D948(param0->unk_414, param0->unk_418, 19, v1, 0, 11); - sub_0200D414(param0->unk_41C[19], sub_02079EDC(param0->unk_250.unk_0C, param0->unk_250.unk_4E, param0->unk_250.unk_50_28) + 7); + sub_0200D414(param0->unk_41C[19], PokeIconPaletteIndex(param0->unk_250.unk_0C, param0->unk_250.unk_4E, param0->unk_250.unk_50_28) + 7); sub_02021D0C(param0->unk_41C[19], (PokemonPersonalData_GetFormValue(param0->unk_250.unk_0C, param0->unk_250.unk_4E, 28) ^ 1)); } void sub_0208F7A4 (UnkStruct_0208D7BC * param0) { - sub_0200D97C(param0->unk_414, param0->unk_418, 19, sub_02079FD0(), 0, 5); + sub_0200D97C(param0->unk_414, param0->unk_418, 19, PokeIconPalettesFileIndex(), 0, 5); if (param0->unk_6A4 == 3) { sub_0200D494(param0->unk_41C[19], 24, 48);