2019-01-09 03:51:19 +01:00
|
|
|
#include "global.h"
|
|
|
|
#include "scanline_effect.h"
|
|
|
|
#include "palette.h"
|
|
|
|
#include "task.h"
|
|
|
|
#include "main.h"
|
|
|
|
#include "window.h"
|
|
|
|
#include "alloc.h"
|
|
|
|
#include "link.h"
|
|
|
|
#include "bg.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include "constants/songs.h"
|
|
|
|
#include "overworld.h"
|
|
|
|
#include "menu.h"
|
|
|
|
#include "text.h"
|
2019-01-19 18:14:59 +01:00
|
|
|
#include "constants/flags.h"
|
|
|
|
#include "event_data.h"
|
|
|
|
#include "constants/game_stat.h"
|
2019-01-19 23:04:33 +01:00
|
|
|
#include "constants/battle_frontier.h"
|
2019-01-19 18:14:59 +01:00
|
|
|
#include "money.h"
|
|
|
|
#include "string_util.h"
|
|
|
|
#include "trainer_card.h"
|
|
|
|
#include "gpu_regs.h"
|
|
|
|
#include "international_string_util.h"
|
|
|
|
#include "pokedex.h"
|
|
|
|
#include "graphics.h"
|
|
|
|
#include "pokemon_icon.h"
|
2019-01-19 23:04:33 +01:00
|
|
|
#include "script_pokemon_util_80F87D8.h"
|
2019-01-09 03:51:19 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
//external functions
|
|
|
|
extern u8 sub_80D30A0(u16);
|
|
|
|
extern void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 bTone);
|
|
|
|
extern void TintPalette_SepiaTone(u16 *palette, u16 count);
|
|
|
|
|
|
|
|
//gfx
|
2019-01-09 03:51:19 +01:00
|
|
|
extern const u32 gUnknown_08DD2AE0[];
|
|
|
|
extern const u32 gUnknown_08DD21B0[];
|
|
|
|
extern const u32 gUnknown_08DD2D30[];
|
|
|
|
extern const u32 gUnknown_08DD2010[];
|
|
|
|
extern const u32 gUnknown_08DD2B78[];
|
|
|
|
extern const u32 gUnknown_08DD228C[];
|
|
|
|
extern const u32 gUnknown_08DD2E5C[];
|
|
|
|
extern const u32 gUnknown_0856F5CC[];
|
|
|
|
extern const u32 gUnknown_0856F814[];
|
|
|
|
extern const u32 gEmeraldTrainerCard_Gfx[];
|
|
|
|
extern const u32 gFireRedTrainerCard_Gfx[];
|
|
|
|
extern const u32 gUnknown_0856F018[];
|
|
|
|
extern const u32 gUnknown_08DD1F78[];
|
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
//strings
|
|
|
|
extern const u8 gText_WaitingTrainerFinishReading[];
|
|
|
|
extern const u8 gText_TrainerCardName[];
|
|
|
|
extern const u8 gText_TrainerCardIDNo[];
|
|
|
|
extern const u8 gText_TrainerCardMoney[];
|
|
|
|
extern const u8 gText_PokedollarVar1[];
|
|
|
|
extern const u8 gText_EmptyString6[];
|
|
|
|
extern const u8 gText_TrainerCardPokedex[];
|
|
|
|
extern const u8 gText_TrainerCardTime[];
|
|
|
|
extern const u8 gText_Colon2[];
|
|
|
|
extern const u8 gText_Var1sTrainerCard[];
|
|
|
|
extern const u8 gText_HallOfFameDebut[];
|
|
|
|
extern const u8 gText_WinsLosses[];
|
|
|
|
extern const u8 gText_PokemonTrades[];
|
|
|
|
extern const u8 gText_BerryCrush[];
|
|
|
|
extern const u8 gText_UnionTradesAndBattles[];
|
|
|
|
extern const u8 gText_Var1DarkGreyShadowLightGrey[];
|
|
|
|
extern const u8 gText_PokeblocksWithFriends[];
|
|
|
|
extern const u8 gText_WonContestsWFriends[];
|
|
|
|
extern const u8 gText_WSlashStraightSlash[];
|
|
|
|
extern const u8 gText_Var1DarkLightGreyBP[];
|
|
|
|
extern const u8 gText_BattleTower[];
|
|
|
|
extern const u8 gText_BattlePtsWon[];
|
|
|
|
|
|
|
|
//const rom data to be moved from data/trainer_card.s to this file
|
|
|
|
extern const struct BgTemplate gUnknown_0856FAB4[4];
|
|
|
|
extern const struct WindowTemplate gUnknown_0856FAC4[];
|
|
|
|
extern const u8 gUnknown_0856FB0C[];
|
|
|
|
extern const u8* gUnknown_0856FB40[];
|
|
|
|
extern const u8 gUnknown_0856FB48[];
|
|
|
|
extern const u8 gUnknown_0856FB4A[];
|
|
|
|
extern const u8 gUnknown_0856FB4C[];
|
|
|
|
extern const u8 gUnknown_0856FB55[];
|
|
|
|
extern const u8 gUnknown_0856FB57[];
|
|
|
|
extern const u8 gUnknown_0856FB0F[];
|
|
|
|
extern const u8* gUnknown_0856FB5C[];
|
|
|
|
extern const u8 gUnknown_0856FB68[6];
|
|
|
|
extern const u8 gUnknown_0856FB6E[6];
|
|
|
|
extern const u8 gUnknown_0856FB74[4];
|
|
|
|
extern const u8 gUnknown_0856F54C[];
|
|
|
|
extern const u8 gUnknown_0856F56C[];
|
|
|
|
extern const u8 gUnknown_0856F58C[];
|
|
|
|
extern const u8 gUnknown_0856F5AC[];
|
|
|
|
extern const u8 gUnknown_0856F4EC[];
|
|
|
|
extern const u8 gUnknown_0856F4AC[];
|
|
|
|
extern const u8 gUnknown_0856F50C[];
|
|
|
|
extern const u8 gUnknown_0856F4CC[];
|
|
|
|
extern const u8 gUnknown_0856F52C[];
|
|
|
|
extern const u8* gEmeraldTrainerCardStarPals[];
|
|
|
|
extern const u8* gFireRedTrainerCardStarPals[];
|
|
|
|
extern const u8 gUnknown_0856FB78[];
|
|
|
|
extern bool8 (*const gUnknown_0856FB28[])(struct Task *);
|
|
|
|
|
|
|
|
//this file's functions
|
2019-01-09 03:51:19 +01:00
|
|
|
/*static*/ void sub_80C2690(void);
|
|
|
|
/*static*/ void sub_80C26D4(void);
|
|
|
|
/*static*/ void sub_80C48C8(void);
|
|
|
|
/*static*/ void sub_80C2710(void);
|
|
|
|
/*static*/ void sub_80C2728(u8 task);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ bool8 PrintAllOnCardPage1(void);
|
2019-01-09 03:51:19 +01:00
|
|
|
/*static*/ void sub_80C438C(u8);
|
|
|
|
/*static*/ void sub_80C4FF0(void);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ void sub_80C4550(u16*);
|
|
|
|
/*static*/ void sub_80C45C0(u16*);
|
2019-01-09 03:51:19 +01:00
|
|
|
/*static*/ void sub_80C4630(void);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ void PrintTimeOnCard(void);
|
2019-01-09 03:51:19 +01:00
|
|
|
/*static*/ void sub_80C4918(void);
|
|
|
|
/*static*/ bool8 sub_80C4940(void);
|
|
|
|
/*static*/ bool8 sub_80C2AD8(void);
|
|
|
|
/*static*/ void sub_80C2C80(void);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ u32 GetCappedGameStat(u8 statId, u32 maxValue);
|
|
|
|
/*static*/ bool8 HasAllFrontierSymbols(void);
|
2019-01-19 18:14:59 +01:00
|
|
|
/*static*/ u32 sub_80C2E40(void);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ u8 sub_80C2E84(struct TrainerCard*);
|
|
|
|
/*static*/ u16 GetCaughtMonsCount(void);
|
|
|
|
/*static*/ void SetPlayerCardData(struct TrainerCard*, u8);
|
2019-01-19 18:14:59 +01:00
|
|
|
/*static*/ void sub_80C3020(struct TrainerCard*);
|
|
|
|
/*static*/ u8 sub_80C4FCC(u8);
|
|
|
|
/*static*/ void sub_80C3190(void);
|
|
|
|
/*static*/ void sub_80C3278(void);
|
|
|
|
/*static*/ void sub_80C334C(void);
|
|
|
|
/*static*/ void sub_80C3388(void);
|
|
|
|
/*static*/ void sub_80C3404(void);
|
|
|
|
/*static*/ void sub_80C3414(void);
|
|
|
|
/*static*/ void sub_80C4EE4(void);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ void PrintNameOnCard(void);
|
|
|
|
/*static*/ void PrintIdOnCard(void);
|
|
|
|
/*static*/ void PrintMoneyOnCard(void);
|
|
|
|
/*static*/ void PrintPokedexOnCard(void);
|
|
|
|
/*static*/ void PrintProfilePhraseOnCard(void);
|
|
|
|
/*static*/ bool8 PrintStringsOnCardPage2(void);
|
2019-01-19 18:14:59 +01:00
|
|
|
/*static*/ void sub_80C3B50(void);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ void PrintHofDebutStringOnCard(void);
|
|
|
|
/*static*/ void PrintWinsLossesStringOnCard(void);
|
|
|
|
/*static*/ void PrintTradesStringOnCard(void);
|
|
|
|
/*static*/ void PrintBerryCrushStringOnCard(void);
|
|
|
|
/*static*/ void PrintPokeblockStringOnCard(void);
|
|
|
|
/*static*/ void PrintUnionStringOnCard(void);
|
|
|
|
/*static*/ void PrintContestStringOnCard(void);
|
2019-01-19 18:14:59 +01:00
|
|
|
/*static*/ void sub_80C4140(void);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ void PrintBattleFacilityStringOnCard(void);
|
2019-01-19 18:14:59 +01:00
|
|
|
/*static*/ void sub_80C42A4(void);
|
2019-01-19 23:04:33 +01:00
|
|
|
/*static*/ void PrintAllVariableNumsOnCardPage2(void);
|
|
|
|
/*static*/ void PrintNameOnCard2(void);
|
|
|
|
/*static*/ void PrintHofTimeOnCard(void);
|
|
|
|
/*static*/ void PrintLinkResultsNumsOnCard(void);
|
|
|
|
/*static*/ void PrintTradesNumOnCard(void);
|
|
|
|
/*static*/ void PrintBerryCrushNumOnCard(void);
|
|
|
|
/*static*/ void PrintUnionNumOnCard(void);
|
|
|
|
/*static*/ void PrintPokeblocksNumOnCard(void);
|
|
|
|
/*static*/ void PrintContestNumOnCard(void);
|
|
|
|
/*static*/ void PrintBattleFacilityNumsOnCard(void);
|
2019-01-19 18:14:59 +01:00
|
|
|
/*static*/ void sub_80C3C34(u8 top, const u8* str1, u8* str2, const u8* color);
|
|
|
|
/*static*/ void sub_80C4330(void);
|
|
|
|
/*static*/ u8 sub_80C43A8(void);
|
|
|
|
/*static*/ void sub_80C474C(void);
|
|
|
|
/*static*/ void sub_80C4960(u8);
|
|
|
|
/*static*/ bool8 sub_80C4998(struct Task* task);
|
|
|
|
/*static*/ bool8 sub_80C49D8(struct Task* task);
|
|
|
|
/*static*/ void sub_80C32EC(u16);
|
2019-01-19 23:04:33 +01:00
|
|
|
void sub_80C41D8(void);
|
2019-01-09 03:51:19 +01:00
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
extern struct UnknownStruct
|
|
|
|
{
|
2019-01-09 03:51:19 +01:00
|
|
|
u8 var_0;
|
|
|
|
u8 var_1;
|
|
|
|
u8 var_2;
|
2019-01-19 18:14:59 +01:00
|
|
|
u8 var_3;
|
|
|
|
u8 var_4;
|
2019-01-09 03:51:19 +01:00
|
|
|
u8 var_5;
|
2019-01-19 18:14:59 +01:00
|
|
|
u8 var_6;
|
|
|
|
u8 var_7;
|
|
|
|
u8 var_8;
|
2019-01-09 03:51:19 +01:00
|
|
|
u8 var_9;
|
2019-01-19 18:14:59 +01:00
|
|
|
u8 var_A;
|
|
|
|
u8 var_B;
|
|
|
|
u8 var_C;
|
|
|
|
u8 var_D;
|
|
|
|
u8 var_E;
|
|
|
|
u8 var_F;
|
|
|
|
u8 var_10;
|
|
|
|
u8 badgeCount[8];
|
|
|
|
u8 var_19[0xD];
|
|
|
|
u8 var_26[0xD];
|
|
|
|
u8 var_33[0xD];
|
|
|
|
u8 var_40[0xD];
|
|
|
|
u8 var_4D[0x46];
|
|
|
|
u8 var_93[0x46];
|
|
|
|
u8 var_D9[0x8C];
|
|
|
|
u8 var_165[0x46];
|
|
|
|
u8 var_1AB[0x8C];
|
|
|
|
u8 var_237[0x8C];
|
|
|
|
u8 var_2C3[0x8C];
|
|
|
|
u8 var_34F[0x46];
|
|
|
|
u8 var_395[0x46];
|
|
|
|
u8 var_3DB[0x46];
|
|
|
|
u8 var_421[0x47];
|
|
|
|
u16 var_468[0x60];
|
|
|
|
s8 var_528;
|
2019-01-09 03:51:19 +01:00
|
|
|
u8 var_529;
|
|
|
|
u8 var_52A;
|
|
|
|
u8 var_52B;
|
|
|
|
u16 var_52C;
|
|
|
|
void (*callback2)(void);
|
2019-01-19 18:14:59 +01:00
|
|
|
struct TrainerCard var_534;
|
2019-01-19 23:04:33 +01:00
|
|
|
u16 var_598[0x4B0 / 2];
|
2019-01-09 03:51:19 +01:00
|
|
|
u8 var_A48[0x4B0];
|
2019-01-19 23:04:33 +01:00
|
|
|
u16 var_EF8[0x4B0 / 2];
|
2019-01-09 03:51:19 +01:00
|
|
|
u8 var_13A8[0x400];
|
|
|
|
u8 var_17A8[0x200];
|
2019-01-19 18:14:59 +01:00
|
|
|
u8 var_19A8[0x2300];
|
2019-01-19 23:04:33 +01:00
|
|
|
u16 var_3CA8[0x2000 / 2];
|
|
|
|
u16 var_5CA8[0x2000 / 2];
|
2019-01-19 18:14:59 +01:00
|
|
|
u16 var_7CA8;
|
|
|
|
u8 var_7CAA;
|
2019-01-09 03:51:19 +01:00
|
|
|
}* gUnknown_02039CE8;
|
|
|
|
|
|
|
|
void sub_80C2690(void)
|
|
|
|
{
|
|
|
|
LoadOam();
|
|
|
|
ProcessSpriteCopyRequests();
|
|
|
|
TransferPlttBuffer();
|
|
|
|
sub_80C48C8();
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_9)
|
2019-01-09 03:51:19 +01:00
|
|
|
DmaCopy16(3, &gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 0x140);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C26D4(void)
|
|
|
|
{
|
|
|
|
u16 backup;
|
|
|
|
u16 bgVOffset;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-09 03:51:19 +01:00
|
|
|
backup = REG_IME;
|
|
|
|
REG_IME = 0;
|
|
|
|
bgVOffset = gScanlineEffectRegBuffers[1][REG_VCOUNT & 0xFF];
|
|
|
|
REG_BG0VOFS = bgVOffset;
|
|
|
|
REG_IME = backup;
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C2710(void)
|
|
|
|
{
|
|
|
|
RunTasks();
|
2019-01-19 18:14:59 +01:00
|
|
|
AnimateSprites();
|
|
|
|
BuildOamBuffer();
|
|
|
|
UpdatePaletteFade();
|
2019-01-09 03:51:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C2728(u8 taskId)
|
|
|
|
{
|
|
|
|
SetMainCallback2(gUnknown_02039CE8->callback2);
|
|
|
|
FreeAllWindowBuffers();
|
|
|
|
Free(gUnknown_02039CE8);
|
|
|
|
gUnknown_02039CE8 = NULL;
|
|
|
|
DestroyTask(taskId);
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-09 03:51:19 +01:00
|
|
|
|
|
|
|
void sub_80C2760(u8 taskId)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
switch (gUnknown_02039CE8->var_0)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
case 0:
|
|
|
|
if (!IsDma3ManagerBusyWithBgCopy())
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
|
|
|
FillWindowPixelBuffer(1, 0);
|
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (PrintAllOnCardPage1())
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sub_80C438C(1);
|
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
FillWindowPixelBuffer(2, 0);
|
|
|
|
sub_80C4FF0();
|
|
|
|
sub_80C438C(2);
|
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
sub_80C4550(gUnknown_02039CE8->var_EF8);
|
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
sub_80C45C0(gUnknown_02039CE8->var_598);
|
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
sub_80C4630();
|
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
break;
|
|
|
|
case 7:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gWirelessCommType == 1 && gReceivedRemoteLinkPlayers == TRUE)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
|
|
|
sub_800E0E8();
|
|
|
|
CreateWirelessStatusIndicatorSprite(230, 150);
|
|
|
|
}
|
2019-01-19 18:14:59 +01:00
|
|
|
BlendPalettes(0xFFFFFFFF, 16, gUnknown_02039CE8->var_52C);
|
|
|
|
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, gUnknown_02039CE8->var_52C);
|
2019-01-09 03:51:19 +01:00
|
|
|
SetVBlankCallback(sub_80C2690);
|
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
break;
|
|
|
|
case 8:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!UpdatePaletteFade() && !IsDma3ManagerBusyWithBgCopy())
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
|
|
|
PlaySE(SE_RG_CARD3);
|
|
|
|
gUnknown_02039CE8->var_0 = 10;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 9:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!IsSEPlaying())
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0++;
|
|
|
|
break;
|
|
|
|
case 10:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_529)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintTimeOnCard();
|
2019-01-09 03:51:19 +01:00
|
|
|
sub_80C438C(1);
|
|
|
|
gUnknown_02039CE8->var_529 = 0;
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
|
|
|
if (gMain.newKeys & A_BUTTON)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
|
|
|
sub_80C4918();
|
|
|
|
PlaySE(SE_RG_CARD1);
|
|
|
|
gUnknown_02039CE8->var_0 = 12;
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
else if (gMain.newKeys & B_BUTTON)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE)
|
|
|
|
{
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0 = 15;
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-09 03:51:19 +01:00
|
|
|
else
|
|
|
|
{
|
2019-01-19 18:14:59 +01:00
|
|
|
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C);
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0 = 14;
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-09 03:51:19 +01:00
|
|
|
break;
|
|
|
|
case 12:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (sub_80C4940() && sub_8087598() != TRUE)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
|
|
|
PlaySE(SE_RG_CARD3);
|
|
|
|
gUnknown_02039CE8->var_0 = 11;
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
|
|
|
break;
|
2019-01-09 03:51:19 +01:00
|
|
|
case 11:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gMain.newKeys & B_BUTTON)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE)
|
|
|
|
{
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0 = 15;
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
|
|
|
else if (gReceivedRemoteLinkPlayers)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
2019-01-19 18:14:59 +01:00
|
|
|
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C);
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0 = 14;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sub_80C4918();
|
|
|
|
gUnknown_02039CE8->var_0 = 13;
|
2019-01-19 23:04:33 +01:00
|
|
|
PlaySE(SE_RG_CARD1);
|
2019-01-09 03:51:19 +01:00
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
|
|
|
else if (gMain.newKeys & A_BUTTON)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE)
|
|
|
|
{
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0 = 15;
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-09 03:51:19 +01:00
|
|
|
else
|
|
|
|
{
|
2019-01-19 18:14:59 +01:00
|
|
|
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C);
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0 = 14;
|
|
|
|
}
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
2019-01-09 03:51:19 +01:00
|
|
|
case 15:
|
|
|
|
sub_800AC34();
|
|
|
|
NewMenuHelpers_DrawDialogueFrame(0, 1);
|
|
|
|
AddTextPrinterParameterized(0, 1, gText_WaitingTrainerFinishReading, 0, 1, 255, 0);
|
|
|
|
CopyWindowToVram(0, 3);
|
|
|
|
gUnknown_02039CE8->var_0 = 16;
|
|
|
|
break;
|
|
|
|
case 16:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gReceivedRemoteLinkPlayers)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
2019-01-19 18:14:59 +01:00
|
|
|
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C);
|
2019-01-09 03:51:19 +01:00
|
|
|
gUnknown_02039CE8->var_0 = 14;
|
|
|
|
}
|
|
|
|
break;
|
2019-01-19 23:04:33 +01:00
|
|
|
case 14:
|
|
|
|
if (!UpdatePaletteFade())
|
2019-01-09 03:51:19 +01:00
|
|
|
sub_80C2728(taskId);
|
|
|
|
break;
|
|
|
|
case 13:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (sub_80C4940() && sub_8087598() != TRUE)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
|
|
|
gUnknown_02039CE8->var_0 = 10;
|
|
|
|
PlaySE(SE_RG_CARD3);
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
2019-01-09 03:51:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool8 sub_80C2AD8(void)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
switch (gUnknown_02039CE8->var_2)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
|
|
|
case 0:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A)
|
2019-01-09 03:51:19 +01:00
|
|
|
LZ77UnCompWram(gUnknown_08DD1F78, gUnknown_02039CE8->var_EF8);
|
|
|
|
else
|
|
|
|
LZ77UnCompWram(gUnknown_08DD2AE0, gUnknown_02039CE8->var_EF8);
|
|
|
|
break;
|
|
|
|
case 1:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A)
|
2019-01-09 03:51:19 +01:00
|
|
|
LZ77UnCompWram(gUnknown_08DD21B0, gUnknown_02039CE8->var_A48);
|
|
|
|
else
|
|
|
|
LZ77UnCompWram(gUnknown_08DD2D30, gUnknown_02039CE8->var_A48);
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_5)
|
2019-01-09 03:51:19 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A)
|
2019-01-09 03:51:19 +01:00
|
|
|
LZ77UnCompWram(gUnknown_08DD2010, gUnknown_02039CE8->var_598);
|
|
|
|
else
|
|
|
|
LZ77UnCompWram(gUnknown_08DD2B78, gUnknown_02039CE8->var_598);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A)
|
2019-01-09 03:51:19 +01:00
|
|
|
LZ77UnCompWram(gUnknown_08DD228C, gUnknown_02039CE8->var_598);
|
|
|
|
else
|
|
|
|
LZ77UnCompWram(gUnknown_08DD2E5C, gUnknown_02039CE8->var_598);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A)
|
2019-01-09 03:51:19 +01:00
|
|
|
LZ77UnCompWram(gUnknown_0856F5CC, gUnknown_02039CE8->var_13A8);
|
|
|
|
else
|
|
|
|
LZ77UnCompWram(gUnknown_0856F814, gUnknown_02039CE8->var_13A8);
|
|
|
|
break;
|
|
|
|
case 4:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A)
|
2019-01-09 03:51:19 +01:00
|
|
|
LZ77UnCompWram(gEmeraldTrainerCard_Gfx, gUnknown_02039CE8->var_19A8);
|
|
|
|
else
|
|
|
|
LZ77UnCompWram(gFireRedTrainerCard_Gfx, gUnknown_02039CE8->var_19A8);
|
|
|
|
break;
|
|
|
|
case 5:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A)
|
2019-01-09 03:51:19 +01:00
|
|
|
LZ77UnCompWram(gUnknown_0856F018, gUnknown_02039CE8->var_17A8);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
gUnknown_02039CE8->var_2 = 0;
|
2019-01-19 18:14:59 +01:00
|
|
|
return TRUE;
|
2019-01-09 03:51:19 +01:00
|
|
|
}
|
|
|
|
gUnknown_02039CE8->var_2++;
|
2019-01-19 18:14:59 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void sub_80C2C80(void)
|
|
|
|
{
|
|
|
|
switch (gMain.state)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_80C334C();
|
|
|
|
sub_80C3414();
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
DmaClear32(3, (void *)OAM, OAM_SIZE);
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
if (!gUnknown_02039CE8->var_52C)
|
|
|
|
DmaClear16(3, (void *)PLTT, PLTT_SIZE);
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
ResetSpriteData();
|
|
|
|
FreeAllSpritePalettes();
|
|
|
|
ResetPaletteFade();
|
|
|
|
gMain.state++;
|
|
|
|
case 4:
|
|
|
|
sub_80C3388();
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
sub_80C41D8();
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
if (sub_80C2AD8() == TRUE)
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
sub_80C4330();
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
sub_80C3278();
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
PrintAllVariableNumsOnCardPage2();
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
if (sub_80C43A8() == TRUE)
|
|
|
|
gMain.state++;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
sub_80C3404();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 GetCappedGameStat(u8 statId, u32 maxValue)
|
|
|
|
{
|
|
|
|
u32 statValue = GetGameStat(statId);
|
|
|
|
|
|
|
|
return min(maxValue, statValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool8 HasAllFrontierSymbols(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
u8 i;
|
2019-01-19 23:04:33 +01:00
|
|
|
for (i = 0; i < NUM_FRONTIER_FACILITIES; i++)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!FlagGet(FLAG_SYS_TOWER_SILVER + 2 * i) || !FlagGet(FLAG_SYS_TOWER_GOLD + 2 * i))
|
2019-01-19 18:14:59 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
return TRUE;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
u32 sub_80C2E40(void)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
u8 stars = 0;
|
|
|
|
|
|
|
|
if (GetGameStat(GAME_STAT_ENTERED_HOF))
|
|
|
|
stars++;
|
|
|
|
if (HasAllHoennMons())
|
|
|
|
stars++;
|
|
|
|
if (CountPlayerContestPaintings() > 4)
|
|
|
|
stars++;
|
|
|
|
if (HasAllFrontierSymbols())
|
|
|
|
stars++;
|
|
|
|
|
|
|
|
return stars;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
u8 sub_80C2E84(struct TrainerCard *trainerCard)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
u8 stars = 0;
|
2019-01-19 18:14:59 +01:00
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
if (trainerCard->hofDebutHours || trainerCard->hofDebutMinutes || trainerCard->hofDebutSeconds)
|
|
|
|
stars++;
|
|
|
|
if (trainerCard->caughtAllHoenn)
|
|
|
|
stars++;
|
2019-01-19 18:14:59 +01:00
|
|
|
if (trainerCard->battleTowerLosses > 49)
|
2019-01-19 23:04:33 +01:00
|
|
|
stars++;
|
|
|
|
if (trainerCard->hasAllPaintings)
|
|
|
|
stars++;
|
|
|
|
|
|
|
|
return stars;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void SetPlayerCardData(struct TrainerCard *trainerCard, u8 arg1)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
u32 playTime;
|
|
|
|
u8 i;
|
|
|
|
|
|
|
|
trainerCard->gender = gSaveBlock2Ptr->playerGender;
|
|
|
|
trainerCard->playTimeHours = gSaveBlock2Ptr->playTimeHours;
|
|
|
|
trainerCard->playTimeMinutes = gSaveBlock2Ptr->playTimeMinutes;
|
|
|
|
|
|
|
|
playTime = GetGameStat(GAME_STAT_FIRST_HOF_PLAY_TIME);
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!GetGameStat(GAME_STAT_ENTERED_HOF))
|
2019-01-19 18:14:59 +01:00
|
|
|
playTime = 0;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
trainerCard->hofDebutHours = playTime >> 16;
|
|
|
|
trainerCard->hofDebutMinutes = (playTime >> 8) & 0xFF;
|
|
|
|
trainerCard->hofDebutSeconds = playTime & 0xFF;
|
|
|
|
if ((playTime >> 16) > 999)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
trainerCard->hofDebutHours = 999;
|
|
|
|
trainerCard->hofDebutMinutes = 59;
|
|
|
|
trainerCard->hofDebutSeconds = 59;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
trainerCard->hasPokedex = FlagGet(FLAG_SYS_POKEDEX_GET);
|
2019-01-19 23:04:33 +01:00
|
|
|
trainerCard->caughtAllHoenn = HasAllHoennMons();
|
|
|
|
trainerCard->caughtMonsCount = GetCaughtMonsCount();
|
2019-01-19 18:14:59 +01:00
|
|
|
|
|
|
|
trainerCard->trainerId = (gSaveBlock2Ptr->playerTrainerId[1] << 8) | gSaveBlock2Ptr->playerTrainerId[0];
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
trainerCard->linkBattleWins = GetCappedGameStat(GAME_STAT_LINK_BATTLE_WINS, 9999);
|
|
|
|
trainerCard->linkBattleLosses = GetCappedGameStat(GAME_STAT_LINK_BATTLE_LOSSES, 9999);
|
|
|
|
|
|
|
|
trainerCard->pokemonTrades = GetCappedGameStat(GAME_STAT_POKEMON_TRADES, 0xFFFF);
|
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
trainerCard->money = GetMoney(&gSaveBlock1Ptr->money);
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
trainerCard->var_28[i] = gSaveBlock1Ptr->unk2BB0[i];
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
StringCopy(trainerCard->playerName, gSaveBlock2Ptr->playerName);
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
switch (arg1)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
trainerCard->battleTowerWins = 0;
|
|
|
|
trainerCard->battleTowerLosses = 0;
|
|
|
|
case 0:
|
2019-01-19 23:04:33 +01:00
|
|
|
trainerCard->contestsWithFriends = GetCappedGameStat(GAME_STAT_WON_LINK_CONTEST, 999);
|
|
|
|
trainerCard->pokeblocksWithFriends = GetCappedGameStat(GAME_STAT_POKEBLOCKS_WITH_FRIENDS, 0xFFFF);
|
|
|
|
if (CountPlayerContestPaintings() > 4)
|
|
|
|
trainerCard->hasAllPaintings = TRUE;
|
|
|
|
trainerCard->stars = sub_80C2E84(trainerCard);
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
trainerCard->battleTowerWins = 0;
|
|
|
|
trainerCard->battleTowerLosses = 0;
|
|
|
|
trainerCard->contestsWithFriends = 0;
|
|
|
|
trainerCard->pokeblocksWithFriends = 0;
|
2019-01-19 23:04:33 +01:00
|
|
|
trainerCard->hasAllPaintings = 0;
|
2019-01-19 18:14:59 +01:00
|
|
|
trainerCard->stars = 0;
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3020(struct TrainerCard *trainerCard)
|
|
|
|
{
|
|
|
|
memset(trainerCard, 0, sizeof(struct TrainerCard));
|
|
|
|
trainerCard->var_38 = 3;
|
2019-01-19 23:04:33 +01:00
|
|
|
SetPlayerCardData(trainerCard, 2);
|
|
|
|
trainerCard->var_60 = HasAllFrontierSymbols();
|
2019-01-19 18:14:59 +01:00
|
|
|
trainerCard->var_62 = gSaveBlock2Ptr->frontier.field_EBA;
|
2019-01-19 23:04:33 +01:00
|
|
|
if (trainerCard->var_60)
|
2019-01-19 18:14:59 +01:00
|
|
|
trainerCard->stars++;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (trainerCard->gender == FEMALE)
|
|
|
|
trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId % 8) + 8];
|
2019-01-19 18:14:59 +01:00
|
|
|
else
|
2019-01-19 23:04:33 +01:00
|
|
|
trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8];
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard)
|
|
|
|
{
|
|
|
|
memset(trainerCard, 0, 0x60);
|
|
|
|
trainerCard->var_38 = 3;
|
2019-01-19 23:04:33 +01:00
|
|
|
SetPlayerCardData(trainerCard, 2);
|
|
|
|
trainerCard->var_3A = HasAllFrontierSymbols();
|
2019-01-19 18:14:59 +01:00
|
|
|
*((u16*)&trainerCard->var_3C) = gSaveBlock2Ptr->frontier.field_EBA;
|
2019-01-19 23:04:33 +01:00
|
|
|
if (trainerCard->var_3A)
|
2019-01-19 18:14:59 +01:00
|
|
|
trainerCard->stars++;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (trainerCard->gender == FEMALE)
|
|
|
|
trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId % 8) + 8];
|
2019-01-19 18:14:59 +01:00
|
|
|
else
|
2019-01-19 23:04:33 +01:00
|
|
|
trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8];
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3120(struct TrainerCard *trainerCard, u16 *src, u8 gameVersion)
|
|
|
|
{
|
|
|
|
memset(trainerCard, 0, sizeof(struct TrainerCard));
|
|
|
|
trainerCard->var_38 = gameVersion;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
switch (sub_80C4FCC(gameVersion))
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
case 0:
|
2019-01-19 23:04:33 +01:00
|
|
|
memcpy(trainerCard, src, 0x60);
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
memcpy(trainerCard, src, 0x38);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
memcpy(trainerCard, src, 0x60);
|
|
|
|
trainerCard->var_3C = 0;
|
|
|
|
trainerCard->var_60 = src[29];
|
|
|
|
trainerCard->var_62 = src[30];
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3190(void)
|
|
|
|
{
|
|
|
|
u8 i;
|
|
|
|
u32 badgeFlag;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
gUnknown_02039CE8->var_A = 0;
|
|
|
|
gUnknown_02039CE8->var_B = 0;
|
|
|
|
gUnknown_02039CE8->var_C = 0;
|
|
|
|
gUnknown_02039CE8->var_D = 0;
|
|
|
|
gUnknown_02039CE8->var_E = 0;
|
|
|
|
gUnknown_02039CE8->var_F = 0;
|
|
|
|
gUnknown_02039CE8->var_10 = 0;
|
2019-01-19 23:04:33 +01:00
|
|
|
memset(gUnknown_02039CE8->badgeCount, 0, sizeof(gUnknown_02039CE8->badgeCount));
|
|
|
|
if (gUnknown_02039CE8->var_534.hasPokedex)
|
2019-01-19 18:14:59 +01:00
|
|
|
gUnknown_02039CE8->var_A++;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (gUnknown_02039CE8->var_534.hofDebutHours
|
|
|
|
|| gUnknown_02039CE8->var_534.hofDebutMinutes
|
|
|
|
|| gUnknown_02039CE8->var_534.hofDebutSeconds)
|
2019-01-19 18:14:59 +01:00
|
|
|
gUnknown_02039CE8->var_B++;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (gUnknown_02039CE8->var_534.linkBattleWins || gUnknown_02039CE8->var_534.linkBattleLosses)
|
2019-01-19 18:14:59 +01:00
|
|
|
gUnknown_02039CE8->var_C++;
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.pokemonTrades)
|
2019-01-19 18:14:59 +01:00
|
|
|
gUnknown_02039CE8->var_10++;
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.battleTowerWins || gUnknown_02039CE8->var_534.battleTowerLosses)
|
2019-01-19 18:14:59 +01:00
|
|
|
gUnknown_02039CE8->var_D++;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
i = 0;
|
|
|
|
badgeFlag = FLAG_BADGE01_GET;
|
|
|
|
while (1)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (FlagGet(badgeFlag))
|
2019-01-19 18:14:59 +01:00
|
|
|
gUnknown_02039CE8->badgeCount[i]++;
|
|
|
|
badgeFlag++;
|
|
|
|
i++;
|
|
|
|
if (badgeFlag > FLAG_BADGE08_GET)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3278(void)
|
|
|
|
{
|
|
|
|
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
|
|
|
|
ShowBg(0);
|
|
|
|
ShowBg(1);
|
|
|
|
ShowBg(2);
|
|
|
|
ShowBg(3);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_DARKEN);
|
|
|
|
SetGpuReg(REG_OFFSET_BLDY, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR);
|
|
|
|
SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ);
|
|
|
|
SetGpuReg(REG_OFFSET_WIN0V, 160);
|
|
|
|
SetGpuReg(REG_OFFSET_WIN0H, 240);
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gReceivedRemoteLinkPlayers)
|
2019-01-19 18:14:59 +01:00
|
|
|
EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL);
|
|
|
|
else
|
|
|
|
EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C32EC(u16 arg0)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
s8 quotient = (arg0 + 40) / 10;
|
|
|
|
|
|
|
|
if (quotient <= 4)
|
2019-01-19 18:14:59 +01:00
|
|
|
quotient = 0;
|
|
|
|
gUnknown_02039CE8->var_528 = quotient;
|
|
|
|
SetGpuReg(REG_OFFSET_BLDY, gUnknown_02039CE8->var_528);
|
|
|
|
SetGpuReg(REG_OFFSET_WIN0V, (gUnknown_02039CE8->var_7CA8 * 256) | (160 - gUnknown_02039CE8->var_7CA8));
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C334C(void)
|
|
|
|
{
|
|
|
|
SetVBlankCallback(NULL);
|
|
|
|
SetHBlankCallback(NULL);
|
|
|
|
SetGpuReg(REG_OFFSET_DISPCNT, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_BG0CNT, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_BG1CNT, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_BG2CNT, 0);
|
|
|
|
SetGpuReg(REG_OFFSET_BG3CNT, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3388(void)
|
|
|
|
{
|
|
|
|
ResetBgsAndClearDma3BusyFlags(0);
|
|
|
|
InitBgsFromTemplates(0, gUnknown_0856FAB4, ARRAY_COUNT(gUnknown_0856FAB4));
|
|
|
|
ChangeBgX(0, 0, 0);
|
|
|
|
ChangeBgY(0, 0, 0);
|
|
|
|
ChangeBgX(1, 0, 0);
|
|
|
|
ChangeBgY(1, 0, 0);
|
|
|
|
ChangeBgX(2, 0, 0);
|
|
|
|
ChangeBgY(2, 0, 0);
|
|
|
|
ChangeBgX(3, 0, 0);
|
|
|
|
ChangeBgY(3, 0, 0);
|
|
|
|
InitWindows(gUnknown_0856FAC4);
|
|
|
|
DeactivateAllTextPrinters();
|
|
|
|
sub_81973A4();
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3404(void)
|
|
|
|
{
|
|
|
|
SetMainCallback2(sub_80C2710);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3414(void)
|
|
|
|
{
|
|
|
|
ResetTasks();
|
|
|
|
ScanlineEffect_Stop();
|
|
|
|
CreateTask(sub_80C2760, 0);
|
|
|
|
sub_80C4EE4();
|
|
|
|
sub_80C3190();
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
bool8 PrintAllOnCardPage1(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
switch (gUnknown_02039CE8->var_1)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
case 0:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintNameOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintIdOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintMoneyOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintPokedexOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 4:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintTimeOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 5:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintProfilePhraseOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
gUnknown_02039CE8->var_1 = 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
gUnknown_02039CE8->var_1++;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
bool8 PrintStringsOnCardPage2(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
switch (gUnknown_02039CE8->var_1)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sub_80C3B50();
|
|
|
|
break;
|
|
|
|
case 1:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintHofDebutStringOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintWinsLossesStringOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintTradesStringOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 4:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintBerryCrushStringOnCard();
|
|
|
|
PrintPokeblockStringOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 5:
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintUnionStringOnCard();
|
|
|
|
PrintContestStringOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
sub_80C4140();
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintBattleFacilityStringOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
sub_80C42A4();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
gUnknown_02039CE8->var_1 = 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
gUnknown_02039CE8->var_1++;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintAllVariableNumsOnCardPage2(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
PrintNameOnCard2();
|
|
|
|
PrintHofTimeOnCard();
|
|
|
|
PrintLinkResultsNumsOnCard();
|
|
|
|
PrintTradesNumOnCard();
|
|
|
|
PrintBerryCrushNumOnCard();
|
|
|
|
PrintUnionNumOnCard();
|
|
|
|
PrintPokeblocksNumOnCard();
|
|
|
|
PrintContestNumOnCard();
|
|
|
|
PrintBattleFacilityNumsOnCard();
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintNameOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
u8 buffer[32];
|
|
|
|
u8* txtPtr;
|
|
|
|
txtPtr = StringCopy(buffer, gText_TrainerCardName);
|
|
|
|
StringCopy(txtPtr, gUnknown_02039CE8->var_534.playerName);
|
|
|
|
ConvertInternationalString(txtPtr, gUnknown_02039CE8->var_7CAA);
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A)
|
2019-01-19 18:14:59 +01:00
|
|
|
AddTextPrinterParameterized3(1, 1, 20, 28, gUnknown_0856FB0C, -1, buffer);
|
|
|
|
else
|
|
|
|
AddTextPrinterParameterized3(1, 1, 16, 33, gUnknown_0856FB0C, -1, buffer);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintIdOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
u8 buffer[32];
|
|
|
|
u8* txtPtr;
|
|
|
|
s32 xPos;
|
|
|
|
u32 top;
|
|
|
|
txtPtr = StringCopy(buffer, gText_TrainerCardIDNo);
|
|
|
|
ConvertIntToDecimalStringN(txtPtr, gUnknown_02039CE8->var_534.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5);
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
xPos = GetStringCenterAlignXOffset(1, buffer, 80) + 132;
|
2019-01-19 18:14:59 +01:00
|
|
|
top = 9;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xPos = GetStringCenterAlignXOffset(1, buffer, 96) + 120;
|
|
|
|
top = 9;
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
AddTextPrinterParameterized3(1, 1, xPos, top, gUnknown_0856FB0C, -1, buffer);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintMoneyOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
s32 xOffset;
|
|
|
|
u8 top;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (!gUnknown_02039CE8->var_52B)
|
2019-01-19 18:14:59 +01:00
|
|
|
AddTextPrinterParameterized3(1, 1, 20, 56, gUnknown_0856FB0C, -1, gText_TrainerCardMoney);
|
|
|
|
else
|
|
|
|
AddTextPrinterParameterized3(1, 1, 16, 57, gUnknown_0856FB0C, -1, gText_TrainerCardMoney);
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.money, 0, 6);
|
|
|
|
StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1);
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52B)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144);
|
|
|
|
top = 56;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128);
|
|
|
|
top = 57;
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-19 18:14:59 +01:00
|
|
|
AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
u16 GetCaughtMonsCount(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (IsNationalPokedexEnabled())
|
2019-01-19 18:14:59 +01:00
|
|
|
return GetNationalPokedexCount(FLAG_GET_CAUGHT);
|
2019-01-19 23:04:33 +01:00
|
|
|
else
|
|
|
|
return GetHoennPokedexCount(FLAG_GET_CAUGHT);
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintPokedexOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
s32 xOffset;
|
|
|
|
u8 top;
|
2019-01-19 23:04:33 +01:00
|
|
|
if (FlagGet(FLAG_SYS_POKEDEX_GET))
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52B)
|
2019-01-19 18:14:59 +01:00
|
|
|
AddTextPrinterParameterized3(1, 1, 20, 72, gUnknown_0856FB0C, -1, gText_TrainerCardPokedex);
|
|
|
|
else
|
|
|
|
AddTextPrinterParameterized3(1, 1, 16, 73, gUnknown_0856FB0C, -1,gText_TrainerCardPokedex);
|
2019-01-19 23:04:33 +01:00
|
|
|
StringCopy(ConvertIntToDecimalStringN(gStringVar4, gUnknown_02039CE8->var_534.caughtMonsCount, 0, 3), gText_EmptyString6);
|
|
|
|
if (!gUnknown_02039CE8->var_52B)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144);
|
|
|
|
top = 72;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128);
|
|
|
|
top = 73;
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-19 18:14:59 +01:00
|
|
|
AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintTimeOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
u16 hours;
|
|
|
|
u16 minutes;
|
|
|
|
s32 width;
|
|
|
|
u32 r7, r4, r10;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (!gUnknown_02039CE8->var_52B)
|
2019-01-19 18:14:59 +01:00
|
|
|
AddTextPrinterParameterized3(1, 1, 20, 88, gUnknown_0856FB0C, -1, gText_TrainerCardTime);
|
|
|
|
else
|
|
|
|
AddTextPrinterParameterized3(1, 1, 16, 89, gUnknown_0856FB0C, -1, gText_TrainerCardTime);
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (gUnknown_02039CE8->var_5)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
hours = gUnknown_02039CE8->var_534.playTimeHours;
|
2019-01-19 23:04:33 +01:00
|
|
|
minutes = gUnknown_02039CE8->var_534.playTimeMinutes;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hours = gSaveBlock2Ptr->playTimeHours;
|
|
|
|
minutes = gSaveBlock2Ptr->playTimeMinutes;
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (hours > 999)
|
2019-01-19 18:14:59 +01:00
|
|
|
hours = 999;
|
2019-01-19 23:04:33 +01:00
|
|
|
if (minutes > 59)
|
2019-01-19 18:14:59 +01:00
|
|
|
minutes = 59;
|
|
|
|
width = GetStringWidth(1, gText_Colon2, 0);
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (!gUnknown_02039CE8->var_52B)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
r7 = 144;
|
|
|
|
r4 = 88;
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-19 18:14:59 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
r7 = 128;
|
|
|
|
r4 = 89;
|
|
|
|
}
|
|
|
|
r10 = width + 30;
|
|
|
|
r7 -= r10;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
FillWindowPixelRect(1, 0, r7, r4, r10, 15);
|
|
|
|
ConvertIntToDecimalStringN(gStringVar4, hours, 1, 3);
|
|
|
|
AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4);
|
|
|
|
r7 += 18;
|
|
|
|
AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB40[gUnknown_02039CE8->var_7], -1, gText_Colon2);
|
|
|
|
r7 += width;
|
|
|
|
ConvertIntToDecimalStringN(gStringVar4, minutes, 2, 2);
|
|
|
|
AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintProfilePhraseOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_5)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB48[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_19);
|
|
|
|
AddTextPrinterParameterized3(1, 1, GetStringWidth(1, gUnknown_02039CE8->var_19, 0) + 14, gUnknown_0856FB48[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_26);
|
|
|
|
AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB4A[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_33);
|
|
|
|
AddTextPrinterParameterized3(1, 1, GetStringWidth(1, gUnknown_02039CE8->var_33, 0) + 14, gUnknown_0856FB4A[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_40);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintNameOnCard2(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
StringCopy(gUnknown_02039CE8->var_4D, gUnknown_02039CE8->var_534.playerName);
|
|
|
|
ConvertInternationalString(gUnknown_02039CE8->var_4D, gUnknown_02039CE8->var_7CAA);
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
StringCopy(gStringVar1, gUnknown_02039CE8->var_4D);
|
|
|
|
StringExpandPlaceholders(gUnknown_02039CE8->var_4D, gText_Var1sTrainerCard);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3B50(void)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52B)
|
2019-01-19 18:14:59 +01:00
|
|
|
AddTextPrinterParameterized3(1, 1, 136, 9, gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_4D);
|
|
|
|
else
|
|
|
|
AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, gUnknown_02039CE8->var_4D, 216), 9, gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_4D);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintHofTimeOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_B)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.hofDebutHours, 1, 3);
|
|
|
|
ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.hofDebutMinutes, 2, 2);
|
|
|
|
ConvertIntToDecimalStringN(gStringVar3, gUnknown_02039CE8->var_534.hofDebutSeconds, 2, 2);
|
2019-01-19 18:14:59 +01:00
|
|
|
StringExpandPlaceholders(gUnknown_02039CE8->var_93, gUnknown_0856FB4C);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C3C34(u8 top, const u8* str1, u8* str2, const u8* color)
|
|
|
|
{
|
|
|
|
AddTextPrinterParameterized3(1, 1, gUnknown_0856FB55[gUnknown_02039CE8->var_52B], top * 16 + 33, gUnknown_0856FB0C, -1, str1);
|
|
|
|
AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, str2, gUnknown_0856FB57[gUnknown_02039CE8->var_52B]), top * 16 + 33, color, -1, str2);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintHofDebutStringOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_B)
|
|
|
|
sub_80C3C34(0, gText_HallOfFameDebut, gUnknown_02039CE8->var_93, gUnknown_0856FB0F);
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintLinkResultsNumsOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_C)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
StringCopy(gUnknown_02039CE8->var_D9, gUnknown_0856FB5C[gUnknown_02039CE8->var_52A]);
|
|
|
|
ConvertIntToDecimalStringN(gUnknown_02039CE8->var_165, gUnknown_02039CE8->var_534.linkBattleWins, 0, 4);
|
|
|
|
ConvertIntToDecimalStringN(gUnknown_02039CE8->var_1AB, gUnknown_02039CE8->var_534.linkBattleLosses, 0, 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintWinsLossesStringOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_C)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
StringCopy(gStringVar1, gUnknown_02039CE8->var_165);
|
|
|
|
StringCopy(gStringVar2, gUnknown_02039CE8->var_1AB);
|
|
|
|
StringExpandPlaceholders(gStringVar4, gText_WinsLosses);
|
|
|
|
sub_80C3C34(1, gUnknown_02039CE8->var_D9, gStringVar4, gUnknown_0856FB0C);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintTradesNumOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_10)
|
2019-01-19 18:14:59 +01:00
|
|
|
ConvertIntToDecimalStringN(gUnknown_02039CE8->var_237, gUnknown_02039CE8->var_534.pokemonTrades, 1, 5);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintTradesStringOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_10)
|
2019-01-19 18:14:59 +01:00
|
|
|
sub_80C3C34(2, gText_PokemonTrades, gUnknown_02039CE8->var_237, gUnknown_0856FB0F);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintBerryCrushNumOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C)
|
2019-01-19 18:14:59 +01:00
|
|
|
ConvertIntToDecimalStringN(gUnknown_02039CE8->var_2C3, gUnknown_02039CE8->var_534.var_3C, 1, 5);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintBerryCrushStringOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C)
|
2019-01-19 18:14:59 +01:00
|
|
|
sub_80C3C34(4, gText_BerryCrush, gUnknown_02039CE8->var_2C3, gUnknown_0856FB0F);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintUnionNumOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40)
|
2019-01-19 18:14:59 +01:00
|
|
|
ConvertIntToDecimalStringN(gUnknown_02039CE8->var_34F, gUnknown_02039CE8->var_534.var_40, 1, 5);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintUnionStringOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40)
|
2019-01-19 18:14:59 +01:00
|
|
|
sub_80C3C34(3, gText_UnionTradesAndBattles, gUnknown_02039CE8->var_34F, gUnknown_0856FB0F);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintPokeblocksNumOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.pokeblocksWithFriends, 1, 5);
|
|
|
|
StringExpandPlaceholders(gUnknown_02039CE8->var_395, gText_Var1DarkGreyShadowLightGrey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintPokeblockStringOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends)
|
2019-01-19 18:14:59 +01:00
|
|
|
sub_80C3C34(3, gText_PokeblocksWithFriends, gUnknown_02039CE8->var_395, gUnknown_0856FB0F);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintContestNumOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends)
|
2019-01-19 18:14:59 +01:00
|
|
|
ConvertIntToDecimalStringN(gUnknown_02039CE8->var_3DB, gUnknown_02039CE8->var_534.contestsWithFriends, 1, 5);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintContestStringOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends)
|
2019-01-19 18:14:59 +01:00
|
|
|
sub_80C3C34(4, gText_WonContestsWFriends, gUnknown_02039CE8->var_3DB, gUnknown_0856FB0F);
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintBattleFacilityNumsOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
switch (gUnknown_02039CE8->var_52A)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
case 1:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_D)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.battleTowerWins, 1, 4);
|
|
|
|
ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.battleTowerLosses, 1, 4);
|
|
|
|
StringExpandPlaceholders(gUnknown_02039CE8->var_421, gText_WSlashStraightSlash);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.var_62)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.var_62, 1, 5);
|
|
|
|
StringExpandPlaceholders(gUnknown_02039CE8->var_421, gText_Var1DarkLightGreyBP);
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
2019-01-19 18:14:59 +01:00
|
|
|
case 0:
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void PrintBattleFacilityStringOnCard(void)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
switch (gUnknown_02039CE8->var_52A)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
case 1:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_D)
|
2019-01-19 18:14:59 +01:00
|
|
|
sub_80C3C34(5, gText_BattleTower, gUnknown_02039CE8->var_421, gUnknown_0856FB0C);
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.var_62)
|
2019-01-19 18:14:59 +01:00
|
|
|
sub_80C3C34(5, gText_BattlePtsWon, gUnknown_02039CE8->var_421, gUnknown_0856FB0F);
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
2019-01-19 18:14:59 +01:00
|
|
|
case 0:
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
|
|
|
}
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C4140(void)
|
|
|
|
{
|
|
|
|
u8 i;
|
|
|
|
u8 buffer[8];
|
|
|
|
u8 buffer2[8];
|
|
|
|
memcpy(buffer, gUnknown_0856FB68, sizeof(gUnknown_0856FB68));
|
|
|
|
memcpy(buffer2, gUnknown_0856FB6E, sizeof(gUnknown_0856FB6E));
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
if (!gUnknown_02039CE8->var_52A)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
for (i = 0; i < 6; i++)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.monSpecies[i])
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
u8 monSpecies = sub_80D30A0(gUnknown_02039CE8->var_534.monSpecies[i]);
|
|
|
|
WriteSequenceToBgTilemapBuffer(3, 16 * i + 224, buffer2[i] + 3, 15, 4, 4, buffer[monSpecies], 1);
|
|
|
|
}
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C41D8(void)
|
|
|
|
{
|
|
|
|
u8 i;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
CpuSet(gMonIconPalettes, gUnknown_02039CE8->var_468, 0x60);
|
2019-01-19 23:04:33 +01:00
|
|
|
switch (gUnknown_02039CE8->var_534.var_4E)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
case 0:
|
|
|
|
break;
|
2019-01-19 18:14:59 +01:00
|
|
|
case 1:
|
|
|
|
TintPalette_CustomTone(gUnknown_02039CE8->var_468, 96, 0, 0, 0);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
TintPalette_CustomTone(gUnknown_02039CE8->var_468, 96, 500, 330, 310);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
TintPalette_SepiaTone(gUnknown_02039CE8->var_468, 96);
|
2019-01-19 23:04:33 +01:00
|
|
|
break;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
LoadPalette(gUnknown_02039CE8->var_468, 80, 192);
|
2019-01-19 23:04:33 +01:00
|
|
|
|
|
|
|
for (i = 0; i < 6; i++)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.monSpecies[i])
|
2019-01-19 18:14:59 +01:00
|
|
|
LoadBgTiles(3, GetMonIconTiles(gUnknown_02039CE8->var_534.monSpecies[i], 0), 512, 16 * i + 32);
|
2019-01-19 23:04:33 +01:00
|
|
|
}
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C42A4(void)
|
|
|
|
{
|
|
|
|
u8 i;
|
|
|
|
u8 buffer[4];
|
|
|
|
memcpy(buffer, gUnknown_0856FB74, sizeof(gUnknown_0856FB74));
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_4C == 1)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
for (i = 0; i < 3; i++)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
u8 var_50 = gUnknown_02039CE8->var_534.var_50[i];
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.var_50[i])
|
2019-01-19 18:14:59 +01:00
|
|
|
WriteSequenceToBgTilemapBuffer(3, i * 4 + 320, i * 3 + 2, 2, 2, 2, buffer[var_50 - 1], 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C4330(void)
|
|
|
|
{
|
|
|
|
LoadPalette(gUnknown_0856F54C, 176, 32);
|
|
|
|
LoadPalette(gUnknown_0856F56C, 192, 32);
|
|
|
|
LoadPalette(gUnknown_0856F58C, 208, 32);
|
|
|
|
LoadPalette(gUnknown_0856F5AC, 224, 32);
|
|
|
|
LoadBgTiles(3, gUnknown_02039CE8->var_17A8, 1024, 128);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C438C(u8 windowId)
|
|
|
|
{
|
|
|
|
PutWindowTilemap(windowId);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
u8 sub_80C43A8(void)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
switch (gUnknown_02039CE8->var_3)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
LoadBgTiles(3, gUnknown_02039CE8->var_13A8, 1024, 0);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
LoadBgTiles(0, gUnknown_02039CE8->var_19A8, 6144, 0);
|
|
|
|
break;
|
|
|
|
case 2:
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_52A)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
LoadPalette(gEmeraldTrainerCardStarPals[gUnknown_02039CE8->var_534.stars], 0, 96);
|
|
|
|
LoadPalette(gUnknown_0856F4EC, 48, 32);
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.gender)
|
2019-01-19 18:14:59 +01:00
|
|
|
LoadPalette(gUnknown_0856F4AC, 16, 32);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
LoadPalette(gFireRedTrainerCardStarPals[gUnknown_02039CE8->var_534.stars], 0, 96);
|
|
|
|
LoadPalette(gUnknown_0856F50C, 48, 32);
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.gender)
|
2019-01-19 18:14:59 +01:00
|
|
|
LoadPalette(gUnknown_0856F4CC, 16, 32);
|
|
|
|
}
|
|
|
|
LoadPalette(gUnknown_0856F52C, 64, 32);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
SetBgTilemapBuffer(0, gUnknown_02039CE8->var_3CA8);
|
|
|
|
SetBgTilemapBuffer(2, gUnknown_02039CE8->var_5CA8);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32);
|
|
|
|
FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 32, 32);
|
|
|
|
FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 32, 32);
|
|
|
|
default:
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
gUnknown_02039CE8->var_3++;
|
2019-01-09 03:51:19 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-01-19 23:04:33 +01:00
|
|
|
void sub_80C4550(u16 *ptr)
|
|
|
|
{
|
|
|
|
s16 i, j;
|
|
|
|
u16 *dst = gUnknown_02039CE8->var_5CA8;
|
|
|
|
|
|
|
|
for (i = 0; i < 20; i++)
|
|
|
|
{
|
|
|
|
for (j = 0; j < 32; j++)
|
|
|
|
{
|
|
|
|
if (j < 30)
|
|
|
|
dst[32 * i + j] = ptr[30 * i + j];
|
|
|
|
else
|
|
|
|
dst[32 * i + j] = ptr[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CopyBgTilemapBufferToVram(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C45C0(u16* ptr)
|
|
|
|
{
|
|
|
|
s16 i, j;
|
|
|
|
u16 *dst = gUnknown_02039CE8->var_3CA8;
|
|
|
|
|
|
|
|
for (i = 0; i < 20; i++)
|
|
|
|
{
|
|
|
|
for (j = 0; j < 32; j++)
|
|
|
|
{
|
|
|
|
if (j < 30)
|
|
|
|
dst[32 * i + j] = ptr[30 * i + j];
|
|
|
|
else
|
|
|
|
dst[32 * i + j] = ptr[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CopyBgTilemapBufferToVram(0);
|
|
|
|
}
|
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
void sub_80C4630(void)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
s16 i, x;
|
|
|
|
u16 tileNum = 192;
|
|
|
|
u8 palNum = 3;
|
|
|
|
|
|
|
|
FillBgTilemapBufferRect(3, 143, 15, gUnknown_0856FB78[gUnknown_02039CE8->var_52B], gUnknown_02039CE8->var_534.stars, 1, 4);
|
|
|
|
if (!gUnknown_02039CE8->var_5)
|
|
|
|
{
|
|
|
|
x = 4;
|
|
|
|
for (i = 0; i < 8; i++, tileNum += 2, x += 3)
|
|
|
|
{
|
|
|
|
if (gUnknown_02039CE8->badgeCount[i])
|
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect(3, tileNum, x, 15, 1, 1, palNum);
|
|
|
|
FillBgTilemapBufferRect(3, tileNum + 1, x + 1, 15, 1, 1, palNum);
|
|
|
|
FillBgTilemapBufferRect(3, tileNum + 16, x, 16, 1, 1, palNum);
|
|
|
|
FillBgTilemapBufferRect(3, tileNum + 17, x + 1, 16, 1, 1, palNum);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CopyBgTilemapBufferToVram(3);
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C474C(void)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (!gUnknown_02039CE8->var_52A)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_10)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 1);
|
|
|
|
FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 1);
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.var_3C)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect(3, 141, 21, 13, 1, 1, 1);
|
|
|
|
FillBgTilemapBufferRect(3, 157, 21, 14, 1, 1, 1);
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.var_40)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect(3, 141, 27, 11, 1, 1, 1);
|
|
|
|
FillBgTilemapBufferRect(3, 157, 27, 12, 1, 1, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_10)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 0);
|
|
|
|
FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 0);
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_534.contestsWithFriends)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect(3, 141, 27, 13, 1, 1, 0);
|
|
|
|
FillBgTilemapBufferRect(3, 157, 27, 14, 1, 1, 0);
|
|
|
|
}
|
2019-01-19 23:04:33 +01:00
|
|
|
if (gUnknown_02039CE8->var_D)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
FillBgTilemapBufferRect(3, 141, 17, 15, 1, 1, 0);
|
|
|
|
FillBgTilemapBufferRect(3, 157, 17, 16, 1, 1, 0);
|
|
|
|
FillBgTilemapBufferRect(3, 140, 27, 15, 1, 1, 0);
|
|
|
|
FillBgTilemapBufferRect(3, 156, 27, 16, 1, 1, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CopyBgTilemapBufferToVram(3);
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C48C8(void)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (++gUnknown_02039CE8->var_6 > 60)
|
2019-01-19 18:14:59 +01:00
|
|
|
{
|
|
|
|
gUnknown_02039CE8->var_6 = 0;
|
|
|
|
gUnknown_02039CE8->var_7 ^= 1;
|
|
|
|
gUnknown_02039CE8->var_529 = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
u8 sub_80C4904(u8 cardId)
|
|
|
|
{
|
|
|
|
struct TrainerCard* trainerCards = gTrainerCards;
|
|
|
|
return trainerCards[cardId].stars;
|
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C4918(void)
|
|
|
|
{
|
|
|
|
u8 taskId = CreateTask(sub_80C4960, 0);
|
|
|
|
sub_80C4960(taskId);
|
|
|
|
SetHBlankCallback(sub_80C26D4);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool8 sub_80C4940(void)
|
|
|
|
{
|
2019-01-19 23:04:33 +01:00
|
|
|
if (FindTaskIdByFunc(sub_80C4960) == 0xFF)
|
2019-01-19 18:14:59 +01:00
|
|
|
return TRUE;
|
2019-01-19 23:04:33 +01:00
|
|
|
else
|
|
|
|
return FALSE;
|
2019-01-19 18:14:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void sub_80C4960(u8 taskId)
|
|
|
|
{
|
|
|
|
while(gUnknown_0856FB28[gTasks[taskId].data[0]](&gTasks[taskId]))
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool8 sub_80C4998(struct Task* task)
|
|
|
|
{
|
|
|
|
u32 i;
|
2019-01-19 23:04:33 +01:00
|
|
|
|
2019-01-19 18:14:59 +01:00
|
|
|
HideBg(1);
|
|
|
|
HideBg(3);
|
|
|
|
ScanlineEffect_Stop();
|
|
|
|
ScanlineEffect_Clear();
|
2019-01-19 23:04:33 +01:00
|
|
|
for (i = 0; i < 160; i++)
|
2019-01-19 18:14:59 +01:00
|
|
|
gScanlineEffectRegBuffers[1][i] = 0;
|
|
|
|
task->data[0]++;
|
|
|
|
return FALSE;
|
|
|
|
}
|