name some trainer card related functions

This commit is contained in:
garak 2019-05-14 10:49:07 -04:00 committed by huderlem
parent 188f2aa29e
commit daecd5ec40
12 changed files with 40 additions and 40 deletions

View File

@ -1372,4 +1372,4 @@ SlateportCity_Text_1DF28C: @ 81DF28C
.string "That's a really great idea!\p" .string "That's a really great idea!\p"
.string "After all, a tough TRAINER is\n" .string "After all, a tough TRAINER is\n"
.string "the perfect fit for the BATTLE TENT!\p" .string "the perfect fit for the BATTLE TENT!\p"
.string "Give it your best effort!$" .string "Give it your best effort!$"

View File

@ -9,4 +9,4 @@
#define MAP_SCRIPT_ON_DIVE_WARP 6 #define MAP_SCRIPT_ON_DIVE_WARP 6
#define MAP_SCRIPT_ON_RETURN_TO_FIELD 7 #define MAP_SCRIPT_ON_RETURN_TO_FIELD 7
#endif // GUARD_CONSTANTS_MAP_SCRIPTS_H #endif // GUARD_CONSTANTS_MAP_SCRIPTS_H

View File

@ -26,4 +26,4 @@
#define TRAINER_HILL_PLAYER_STATUS_ECARD_SCANNED 1 #define TRAINER_HILL_PLAYER_STATUS_ECARD_SCANNED 1
#define TRAINER_HILL_PLAYER_STATUS_NORMAL 2 #define TRAINER_HILL_PLAYER_STATUS_NORMAL 2
#endif #endif

View File

@ -434,7 +434,7 @@ extern const u8 gPPUpGetMask[];
extern const u8 gPPUpSetMask[]; extern const u8 gPPUpSetMask[];
extern const u8 gPPUpAddMask[]; extern const u8 gPPUpAddMask[];
extern const u8 gStatStageRatios[][2]; extern const u8 gStatStageRatios[][2];
extern const u16 gUnknown_08329D54[]; extern const u16 gFacilityClassPicsByIndex[];
extern const struct SpriteTemplate gUnknown_08329D98[]; extern const struct SpriteTemplate gUnknown_08329D98[];
extern const s8 gNatureStatTable[][5]; extern const s8 gNatureStatTable[][5];

View File

@ -23,6 +23,6 @@ void LoadMonIconPalette(u16 species);
void sub_80D328C(struct Sprite *sprite); void sub_80D328C(struct Sprite *sprite);
void sub_80D3014(struct Sprite *sprite); void sub_80D3014(struct Sprite *sprite);
void sub_80D32C8(struct Sprite *sprite, u8 animNum); void sub_80D32C8(struct Sprite *sprite, u8 animNum);
u8 sub_80D30A0(u16 species); u8 GetMonIconPaletteIndexFromSpecies(u16 species);
#endif // GUARD_POKEMON_ICON_H #endif // GUARD_POKEMON_ICON_H

View File

@ -49,4 +49,4 @@ void CreateDecorationShop1Menu(const u16 *);
void CreateDecorationShop2Menu(const u16 *); void CreateDecorationShop2Menu(const u16 *);
void CB2_ExitSellMenu(void); void CB2_ExitSellMenu(void);
#endif // GUARD_SHOP_H #endif // GUARD_SHOP_H

View File

@ -2012,4 +2012,4 @@ void sub_8197184(u32 windowId, u32 destOffset, u32 paletteId)
void sub_81971C4(u32 windowId, u32 tileOffset, u32 paletteId) void sub_81971C4(u32 windowId, u32 tileOffset, u32 paletteId)
{ {
DrawMatchCallTextBoxBorder(windowId, tileOffset, paletteId); DrawMatchCallTextBoxBorder(windowId, tileOffset, paletteId);
} }

View File

@ -1879,7 +1879,7 @@ static const u16 sDeoxysBaseStats[] =
90, // Sp.Defense 90, // Sp.Defense
}; };
const u16 gUnknown_08329D54[] = const u16 gFacilityClassPicsByIndex[] =
{ {
FACILITY_CLASS_COOLTRAINER_M, FACILITY_CLASS_BLACK_BELT, FACILITY_CLASS_CAMPER, FACILITY_CLASS_COOLTRAINER_M, FACILITY_CLASS_BLACK_BELT, FACILITY_CLASS_CAMPER,
FACILITY_CLASS_YOUNGSTER, FACILITY_CLASS_PSYCHIC_M, FACILITY_CLASS_BUG_CATCHER, FACILITY_CLASS_YOUNGSTER, FACILITY_CLASS_PSYCHIC_M, FACILITY_CLASS_BUG_CATCHER,
@ -2711,7 +2711,7 @@ u16 sub_8068B48(void)
arrId = gLinkPlayers[linkId].trainerId & 7; arrId = gLinkPlayers[linkId].trainerId & 7;
arrId |= gLinkPlayers[linkId].gender << 3; arrId |= gLinkPlayers[linkId].gender << 3;
return FacilityClassToPicIndex(gUnknown_08329D54[arrId]); return FacilityClassToPicIndex(gFacilityClassPicsByIndex[arrId]);
} }
u16 sub_8068BB0(void) u16 sub_8068BB0(void)
@ -2726,7 +2726,7 @@ u16 sub_8068BB0(void)
arrId = gLinkPlayers[linkId].trainerId & 7; arrId = gLinkPlayers[linkId].trainerId & 7;
arrId |= gLinkPlayers[linkId].gender << 3; arrId |= gLinkPlayers[linkId].gender << 3;
return gFacilityClassToTrainerClass[gUnknown_08329D54[arrId]]; return gFacilityClassToTrainerClass[gFacilityClassPicsByIndex[arrId]];
} }
void CreateObedientEnemyMon(void) void CreateObedientEnemyMon(void)

View File

@ -1223,7 +1223,7 @@ u8 GetValidMonIconPalIndex(u16 species)
return gMonIconPaletteIndices[species]; return gMonIconPaletteIndices[species];
} }
u8 sub_80D30A0(u16 species) u8 GetMonIconPaletteIndexFromSpecies(u16 species)
{ {
return gMonIconPaletteIndices[species]; return gMonIconPaletteIndices[species];
} }

View File

@ -1164,4 +1164,4 @@ u32 sub_81C91AC(struct UnknownInnerStruct_81C81D4 *a0, const struct BgTemplate *
a0->downArrow = NULL; a0->downArrow = NULL;
return 1; return 1;
} }
} }

View File

@ -1230,4 +1230,4 @@ void CreateDecorationShop2Menu(const u16 *itemsForSale)
CreateShopMenu(MART_TYPE_DECOR2); CreateShopMenu(MART_TYPE_DECOR2);
SetShopItemsForSale(itemsForSale); SetShopItemsForSale(itemsForSale);
SetShopMenuCallback(EnableBothScriptContexts); SetShopMenuCallback(EnableBothScriptContexts);
} }

View File

@ -106,7 +106,7 @@ static void sub_80C438C(u8);
static void sub_80C4FF0(void); static void sub_80C4FF0(void);
static void sub_80C4550(u16*); static void sub_80C4550(u16*);
static void sub_80C45C0(u16*); static void sub_80C45C0(u16*);
static void sub_80C4630(void); static void TrainerCard_PrintStarsAndBadgesOnCard(void);
static void PrintTimeOnCard(void); static void PrintTimeOnCard(void);
static void sub_80C4918(void); static void sub_80C4918(void);
static bool8 sub_80C4940(void); static bool8 sub_80C4940(void);
@ -117,7 +117,7 @@ static bool8 HasAllFrontierSymbols(void);
static u8 GetRubyTrainerStars(struct TrainerCard*); static u8 GetRubyTrainerStars(struct TrainerCard*);
static u16 GetCaughtMonsCount(void); static u16 GetCaughtMonsCount(void);
static void SetPlayerCardData(struct TrainerCard*, u8); static void SetPlayerCardData(struct TrainerCard*, u8);
static void sub_80C3020(struct TrainerCard*); static void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard*);
static u8 VersionToCardType(u8); static u8 VersionToCardType(u8);
static void SetDataFromTrainerCard(void); static void SetDataFromTrainerCard(void);
static void HandleGpuRegs(void); static void HandleGpuRegs(void);
@ -141,7 +141,7 @@ static void PrintBerryCrushStringOnCard(void);
static void PrintPokeblockStringOnCard(void); static void PrintPokeblockStringOnCard(void);
static void PrintUnionStringOnCard(void); static void PrintUnionStringOnCard(void);
static void PrintContestStringOnCard(void); static void PrintContestStringOnCard(void);
static void sub_80C4140(void); static void TrainerCard_PrintPokemonIconsOnCard(void);
static void PrintBattleFacilityStringOnCard(void); static void PrintBattleFacilityStringOnCard(void);
static void sub_80C42A4(void); static void sub_80C42A4(void);
static void PrintAllVariableNumsOnCardPage2(void); static void PrintAllVariableNumsOnCardPage2(void);
@ -179,17 +179,17 @@ static const u16 gEmeraldTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_c
static const u16 gFireRedTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars_fr.gbapal"); static const u16 gFireRedTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars_fr.gbapal");
static const u16 gEmeraldTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars.gbapal"); static const u16 gEmeraldTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars.gbapal");
static const u16 gFireRedTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars_fr.gbapal"); static const u16 gFireRedTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars_fr.gbapal");
static const u16 gUnknown_0856F4AC[] = INCBIN_U16("graphics/trainer_card/female_bg.gbapal"); static const u16 sEmeraldTrainerCardFemaleBackground_Pal[] = INCBIN_U16("graphics/trainer_card/female_bg.gbapal");
static const u16 gUnknown_0856F4CC[] = INCBIN_U16("graphics/trainer_card/female_bg_fr.gbapal"); static const u16 sFireRedTrainerCardFemaleBackground_Pal[] = INCBIN_U16("graphics/trainer_card/female_bg_fr.gbapal");
static const u16 gUnknown_0856F4EC[] = INCBIN_U16("graphics/trainer_card/badges.gbapal"); static const u16 sEmeraldTrainerCardBadges_Pal[] = INCBIN_U16("graphics/trainer_card/badges.gbapal");
static const u16 gUnknown_0856F50C[] = INCBIN_U16("graphics/trainer_card/badges_fr.gbapal"); static const u16 sFireRedTrainerCardBadges_Pal[] = INCBIN_U16("graphics/trainer_card/badges_fr.gbapal");
static const u16 gUnknown_0856F52C[] = INCBIN_U16("graphics/trainer_card/gold.gbapal"); static const u16 gUnknown_0856F52C[] = INCBIN_U16("graphics/trainer_card/gold.gbapal");
static const u16 gUnknown_0856F54C[] = INCBIN_U16("graphics/trainer_card/stickers_fr1.gbapal"); static const u16 gUnknown_0856F54C[] = INCBIN_U16("graphics/trainer_card/stickers_fr1.gbapal");
static const u16 gUnknown_0856F56C[] = INCBIN_U16("graphics/trainer_card/stickers_fr2.gbapal"); static const u16 gUnknown_0856F56C[] = INCBIN_U16("graphics/trainer_card/stickers_fr2.gbapal");
static const u16 gUnknown_0856F58C[] = INCBIN_U16("graphics/trainer_card/stickers_fr3.gbapal"); static const u16 gUnknown_0856F58C[] = INCBIN_U16("graphics/trainer_card/stickers_fr3.gbapal");
static const u16 gUnknown_0856F5AC[] = INCBIN_U16("graphics/trainer_card/stickers_fr4.gbapal"); static const u16 gUnknown_0856F5AC[] = INCBIN_U16("graphics/trainer_card/stickers_fr4.gbapal");
static const u32 gUnknown_0856F5CC[] = INCBIN_U32("graphics/trainer_card/badges.4bpp.lz"); static const u32 sEmeraldTrainerCardBadges_Tile[] = INCBIN_U32("graphics/trainer_card/badges.4bpp.lz");
static const u32 gUnknown_0856F814[] = INCBIN_U32("graphics/trainer_card/badges_fr.4bpp.lz"); static const u32 sFireRedTrainerCardBadges_Tile[] = INCBIN_U32("graphics/trainer_card/badges_fr.4bpp.lz");
static const struct BgTemplate gUnknown_0856FAB4[4] = static const struct BgTemplate gUnknown_0856FAB4[4] =
{ {
@ -376,7 +376,7 @@ static void sub_80C2760(u8 taskId)
sData->var_0++; sData->var_0++;
break; break;
case 6: case 6:
sub_80C4630(); TrainerCard_PrintStarsAndBadgesOnCard();
sData->var_0++; sData->var_0++;
break; break;
case 7: case 7:
@ -528,9 +528,9 @@ static bool8 LoadCardGfx(void)
break; break;
case 3: case 3:
if (sData->cardType != CARD_TYPE_FRLG) if (sData->cardType != CARD_TYPE_FRLG)
LZ77UnCompWram(gUnknown_0856F5CC, sData->var_13A8); LZ77UnCompWram(sEmeraldTrainerCardBadges_Tile, sData->var_13A8);
else else
LZ77UnCompWram(gUnknown_0856F814, sData->var_13A8); LZ77UnCompWram(sFireRedTrainerCardBadges_Tile, sData->var_13A8);
break; break;
case 4: case 4:
if (sData->cardType != CARD_TYPE_FRLG) if (sData->cardType != CARD_TYPE_FRLG)
@ -722,7 +722,7 @@ static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType)
} }
} }
static void sub_80C3020(struct TrainerCard *trainerCard) static void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *trainerCard)
{ {
memset(trainerCard, 0, sizeof(struct TrainerCard)); memset(trainerCard, 0, sizeof(struct TrainerCard));
trainerCard->version = GAME_VERSION; trainerCard->version = GAME_VERSION;
@ -733,9 +733,9 @@ static void sub_80C3020(struct TrainerCard *trainerCard)
trainerCard->stars++; trainerCard->stars++;
if (trainerCard->gender == FEMALE) if (trainerCard->gender == FEMALE)
trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId % 8) + 8]; trainerCard->var_4F = gFacilityClassPicsByIndex[(trainerCard->trainerId % 8) + 8];
else else
trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8]; trainerCard->var_4F = gFacilityClassPicsByIndex[trainerCard->trainerId % 8];
} }
void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard)
@ -749,9 +749,9 @@ void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard)
trainerCard->stars++; trainerCard->stars++;
if (trainerCard->gender == FEMALE) if (trainerCard->gender == FEMALE)
trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId % 8) + 8]; trainerCard->var_4F = gFacilityClassPicsByIndex[(trainerCard->trainerId % 8) + 8];
else else
trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8]; trainerCard->var_4F = gFacilityClassPicsByIndex[trainerCard->trainerId % 8];
} }
void CopyTrainerCardData(struct TrainerCard *dst, u16 *src, u8 gameVersion) void CopyTrainerCardData(struct TrainerCard *dst, u16 *src, u8 gameVersion)
@ -938,7 +938,7 @@ static bool8 PrintStringsOnCardPage2(void)
PrintContestStringOnCard(); PrintContestStringOnCard();
break; break;
case 6: case 6:
sub_80C4140(); TrainerCard_PrintPokemonIconsOnCard();
PrintBattleFacilityStringOnCard(); PrintBattleFacilityStringOnCard();
break; break;
case 7: case 7:
@ -1300,7 +1300,7 @@ static void PrintBattleFacilityStringOnCard(void)
} }
} }
static void sub_80C4140(void) static void TrainerCard_PrintPokemonIconsOnCard(void)
{ {
u8 i; u8 i;
u8 buffer[] = {0x05, 0x06, 0x07, 0x08, 0x09, 0x0a}; u8 buffer[] = {0x05, 0x06, 0x07, 0x08, 0x09, 0x0a};
@ -1312,7 +1312,7 @@ static void sub_80C4140(void)
{ {
if (sData->trainerCard.monSpecies[i]) if (sData->trainerCard.monSpecies[i])
{ {
u8 monSpecies = sub_80D30A0(sData->trainerCard.monSpecies[i]); u8 monSpecies = GetMonIconPaletteIndexFromSpecies(sData->trainerCard.monSpecies[i]);
WriteSequenceToBgTilemapBuffer(3, 16 * i + 224, buffer2[i] + 3, 15, 4, 4, buffer[monSpecies], 1); WriteSequenceToBgTilemapBuffer(3, 16 * i + 224, buffer2[i] + 3, 15, 4, 4, buffer[monSpecies], 1);
} }
} }
@ -1392,16 +1392,16 @@ static u8 SetCardBgsAndPals(void)
if (sData->cardType != CARD_TYPE_FRLG) if (sData->cardType != CARD_TYPE_FRLG)
{ {
LoadPalette(gEmeraldTrainerCardStarPals[sData->trainerCard.stars], 0, 96); LoadPalette(gEmeraldTrainerCardStarPals[sData->trainerCard.stars], 0, 96);
LoadPalette(gUnknown_0856F4EC, 48, 32); LoadPalette(sEmeraldTrainerCardBadges_Pal, 48, 32);
if (sData->trainerCard.gender) if (sData->trainerCard.gender)
LoadPalette(gUnknown_0856F4AC, 16, 32); LoadPalette(sEmeraldTrainerCardFemaleBackground_Pal, 16, 32);
} }
else else
{ {
LoadPalette(gFireRedTrainerCardStarPals[sData->trainerCard.stars], 0, 96); LoadPalette(gFireRedTrainerCardStarPals[sData->trainerCard.stars], 0, 96);
LoadPalette(gUnknown_0856F50C, 48, 32); LoadPalette(sFireRedTrainerCardBadges_Pal, 48, 32);
if (sData->trainerCard.gender) if (sData->trainerCard.gender)
LoadPalette(gUnknown_0856F4CC, 16, 32); LoadPalette(sFireRedTrainerCardFemaleBackground_Pal, 16, 32);
} }
LoadPalette(gUnknown_0856F52C, 64, 32); LoadPalette(gUnknown_0856F52C, 64, 32);
break; break;
@ -1458,7 +1458,7 @@ static void sub_80C45C0(u16* ptr)
static const u8 gUnknown_0856FB78[] = {7, 7}; static const u8 gUnknown_0856FB78[] = {7, 7};
static void sub_80C4630(void) static void TrainerCard_PrintStarsAndBadgesOnCard(void)
{ {
s16 i, x; s16 i, x;
u16 tileNum = 192; u16 tileNum = 192;
@ -1684,7 +1684,7 @@ static bool8 sub_80C4C1C(struct Task* task)
sub_80C438C(2); sub_80C438C(2);
sub_80C4550(sData->var_EF8); sub_80C4550(sData->var_EF8);
sub_80C45C0(sData->var_598); sub_80C45C0(sData->var_598);
sub_80C4630(); TrainerCard_PrintStarsAndBadgesOnCard();
} }
sub_80C438C(1); sub_80C438C(1);
sData->var_8 ^= 1; sData->var_8 ^= 1;
@ -1764,7 +1764,7 @@ void ShowPlayerTrainerCard(void (*callback)(void))
sData->isLink = FALSE; sData->isLink = FALSE;
sData->language = GAME_LANGUAGE; sData->language = GAME_LANGUAGE;
sub_80C3020(&sData->trainerCard); TrainerCard_GenerateCardForLinkPlayer(&sData->trainerCard);
SetMainCallback2(CB2_InitTrainerCard); SetMainCallback2(CB2_InitTrainerCard);
} }