summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-04-27 02:29:41 -0400
committerGitHub <noreply@github.com>2021-04-27 02:29:41 -0400
commit18f85b5cf0170717d303b59d5e043bcbb6f919a2 (patch)
treef08754c2095561faad4efcb8c0e73fc8fdd200c6 /include
parentd74017d25667f343d32a2674bfae0bfa970100d3 (diff)
parentbc9fc382547aadfb321c7c55571786d20c5e9663 (diff)
Merge pull request #1415 from GriffinRichards/doc-contestutil
Some Contest clean up
Diffstat (limited to 'include')
-rw-r--r--include/constants/contest.h16
-rw-r--r--include/contest.h16
-rw-r--r--include/contest_util.h4
-rw-r--r--include/graphics.h28
-rw-r--r--include/international_string_util.h2
5 files changed, 38 insertions, 28 deletions
diff --git a/include/constants/contest.h b/include/constants/contest.h
index 9eb6b26e4..28b02e9c0 100644
--- a/include/constants/contest.h
+++ b/include/constants/contest.h
@@ -22,7 +22,9 @@
#define CONTEST_TYPE_NPC_MASTER (CONTEST_RANK_MASTER + 1)
#define CONTEST_TYPE_LINK (CONTEST_RANK_LINK + 1)
-#define CONTEST_WINNER_ARTIST 0 // Winner shown by the artist, painting not necessarily saved
+// IDs below - 1 are indexes into gSaveBlock1Ptr->contestWinners[]
+// CONTEST_WINNER_ARTIST is for the winner of the most recent contest, and is not saved.
+#define CONTEST_WINNER_ARTIST 0
#define CONTEST_WINNER_HALL_1 1
#define CONTEST_WINNER_HALL_2 2
#define CONTEST_WINNER_HALL_3 3
@@ -30,8 +32,8 @@
#define CONTEST_WINNER_HALL_5 5
#define CONTEST_WINNER_HALL_6 6
#define NUM_CONTEST_HALL_WINNERS 6
-#define CONTEST_WINNER_7 7
-#define CONTEST_WINNER_8 8
+#define CONTEST_WINNER_HALL_UNUSED_1 7 // These two have data for gDefaultContestWinners
+#define CONTEST_WINNER_HALL_UNUSED_2 8 // but there are only 6 paintings in the Contest Hall
#define CONTEST_WINNER_MUSEUM_COOL 9
#define CONTEST_WINNER_MUSEUM_BEAUTY 10
#define CONTEST_WINNER_MUSEUM_CUTE 11
@@ -39,6 +41,14 @@
#define CONTEST_WINNER_MUSEUM_TOUGH 13
// NUM_CONTEST_WINNERS in constants/global.h
+#define MUSEUM_CONTEST_WINNERS_START (CONTEST_WINNER_MUSEUM_COOL - 1)
+
+#define CONTEST_SAVE_FOR_MUSEUM ((u8)-1)
+#define CONTEST_SAVE_FOR_ARTIST ((u8)-2)
+
+// The number of possible captions for a Contest painting, per category
+#define NUM_PAINTING_CAPTIONS 3
+
#define CANT_ENTER_CONTEST 0
#define CAN_ENTER_CONTEST_EQUAL_RANK 1
#define CAN_ENTER_CONTEST_HIGH_RANK 2
diff --git a/include/contest.h b/include/contest.h
index 1dd4340bd..9bac63eda 100644
--- a/include/contest.h
+++ b/include/contest.h
@@ -111,11 +111,11 @@ struct ContestPokemon
u32 otId;
};
-struct Shared1A004
+struct ContestTempSave
{
u16 cachedWindowPalettes[16][16]; // Saved palette data before a move happens?
- u16 unk18204[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferUnfaded
- u16 unk18604[PLTT_BUFFER_SIZE]; // Saved copy of gPlttBufferFaded
+ u16 cachedPlttBufferUnfaded[PLTT_BUFFER_SIZE];
+ u16 cachedPlttBufferFaded[PLTT_BUFFER_SIZE];
u8 savedJunk[0x800];
};
@@ -306,7 +306,7 @@ struct ContestResources
#define eUnzippedContestAudience_Gfx (gHeap + 0x18000)
#define eContestAudienceFrame2_Gfx (gHeap + 0x19000)
#define eContestDebugMode (gHeap[0x1a000])
-#define eUnknownHeap1A004 (*(struct Shared1A004 *)(gHeap + 0x1a004))
+#define eContestTempSave (*(struct ContestTempSave *)(gHeap + 0x1a004))
extern struct ContestPokemon gContestMons[CONTESTANT_COUNT];
extern s16 gContestMonRound1Points[CONTESTANT_COUNT];
@@ -326,8 +326,8 @@ extern u8 gHighestRibbonRank;
extern struct ContestResources *gContestResources;
extern u8 sContestBgCopyFlags;
extern struct ContestWinner gCurContestWinner;
-extern u8 gUnknown_02039F5C;
-extern u8 gUnknown_02039F5D;
+extern u8 gCurContestWinnerIsForArtist;
+extern u8 gCurContestWinnerSaveIdx;
extern u32 gContestRngValue;
// contest.c
@@ -351,8 +351,8 @@ s8 Contest_GetMoveExcitement(u16 move);
bool8 IsContestantAllowedToCombo(u8 contestant);
void Contest_PrintTextToBg0WindowAt(u32 windowId, u8 *currChar, s32 x, s32 y, s32 fontId);
void ResetContestLinkResults(void);
-bool8 sub_80DEDA8(u8 a);
-u8 sub_80DEFA8(u8 a, u8 b);
+bool8 SaveContestWinner(u8 rank);
+u8 GetContestWinnerSaveIdx(u8 rank, bool8 shift);
void ClearContestWinnerPicsInContestHall(void);
void StripPlayerAndMonNamesForLinkContest(struct ContestPokemon *mon, s32 language);
diff --git a/include/contest_util.h b/include/contest_util.h
index 76f9ae522..1e97d91d3 100644
--- a/include/contest_util.h
+++ b/include/contest_util.h
@@ -7,8 +7,8 @@ void StartContest(void);
void BufferContestantMonSpecies(void);
void ShowContestResults(void);
void ContestLinkTransfer(u8);
-void ShowContestWinnerPainting(void);
+void ShowContestPainting(void);
u16 GetContestRand(void);
-u8 CountPlayerContestPaintings(void);
+u8 CountPlayerMuseumPaintings(void);
#endif // GUARD_CONTEST_UTIL_H
diff --git a/include/graphics.h b/include/graphics.h
index 5a180ad2f..1f40cda01 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -4924,21 +4924,21 @@ extern const u32 gRouletteMultiplier_Gfx[];
// Contest util
extern const u32 gContestResults_Gfx[];
-extern const u32 gUnknown_08C19EEC[];
-extern const u32 gUnknown_08C1A000[];
-extern const u32 gUnknown_08C1A12C[];
+extern const u32 gContestResults_WinnerBanner_Tilemap[];
+extern const u32 gContestResults_Interface_Tilemap[];
+extern const u32 gContestResults_Bg_Tilemap[];
extern const u32 gContestResults_Pal[];
-extern const u16 gLinkContestResults_Tilemap[];
-extern const u16 gNormalContestResults_Tilemap[];
-extern const u16 gSuperContestResults_Tilemap[];
-extern const u16 gHyperContestResults_Tilemap[];
-extern const u16 gMasterContestResults_Tilemap[];
-extern const u16 gCoolContestResults_Tilemap[];
-extern const u16 gBeautyContestResults_Tilemap[];
-extern const u16 gCuteContestResults_Tilemap[];
-extern const u16 gSmartContestResults_Tilemap[];
-extern const u16 gToughContestResults_Tilemap[];
-extern const u16 gContestResults_Tilemap[];
+extern const u16 gContestResultsTitle_Link_Tilemap[];
+extern const u16 gContestResultsTitle_Normal_Tilemap[];
+extern const u16 gContestResultsTitle_Super_Tilemap[];
+extern const u16 gContestResultsTitle_Hyper_Tilemap[];
+extern const u16 gContestResultsTitle_Master_Tilemap[];
+extern const u16 gContestResultsTitle_Cool_Tilemap[];
+extern const u16 gContestResultsTitle_Beauty_Tilemap[];
+extern const u16 gContestResultsTitle_Cute_Tilemap[];
+extern const u16 gContestResultsTitle_Smart_Tilemap[];
+extern const u16 gContestResultsTitle_Tough_Tilemap[];
+extern const u16 gContestResultsTitle_Tilemap[];
// Trainer Card.
extern const u16 gHoennTrainerCard0Star_Pal[];
diff --git a/include/international_string_util.h b/include/international_string_util.h
index f76fc5be1..fe7e85b41 100644
--- a/include/international_string_util.h
+++ b/include/international_string_util.h
@@ -17,7 +17,7 @@ void CopyMonCategoryText(int dexNum, u8 *dest);
u8 *sub_81DB494(u8 *str, int fontId, const u8 *str2, int totalStringWidth);
void PadNameString(u8 *dest, u8 padChar);
void ConvertInternationalPlayerNameStripChar(u8 *, u8);
-void sub_81DB5AC(u8 *);
+void ConvertInternationalContestantName(u8 *);
int sub_81DB604(u8 *);
void sub_81DB620(int windowId, int columnStart, int rowStart, int numFillTiles, int numRows);