summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/constants/pokemon.h4
-rw-r--r--include/gba/defines.h1
-rw-r--r--include/menu_specialized.h60
-rw-r--r--include/pokenav.h16
4 files changed, 59 insertions, 22 deletions
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h
index 827725fc2..af5d0ea8a 100644
--- a/include/constants/pokemon.h
+++ b/include/constants/pokemon.h
@@ -270,7 +270,9 @@
#define FRIENDSHIP_EVENT_FAINT_FIELD_PSN 7
#define FRIENDSHIP_EVENT_FAINT_LARGE 8 // If opponent was >= 30 levels higher. See AdjustFriendshipOnBattleFaint
-#define MAX_FRIENDSHIP 0xFF
+#define MAX_FRIENDSHIP 255
+#define MAX_SHEEN 255
+#define MAX_CONDITION 255
#define MAX_PER_STAT_IVS 31
#define MAX_IV_MASK 31
diff --git a/include/gba/defines.h b/include/gba/defines.h
index ad06aaad2..c52d7ef4f 100644
--- a/include/gba/defines.h
+++ b/include/gba/defines.h
@@ -6,7 +6,6 @@
#define TRUE 1
#define FALSE 0
-#define BSS_DATA __attribute__((section(".bss")))
#define IWRAM_DATA __attribute__((section("iwram_data")))
#define EWRAM_DATA __attribute__((section("ewram_data")))
#define UNUSED __attribute__((unused))
diff --git a/include/menu_specialized.h b/include/menu_specialized.h
index c29110662..2f212b5d6 100644
--- a/include/menu_specialized.h
+++ b/include/menu_specialized.h
@@ -7,14 +7,24 @@
#include "pokemon.h"
#include "constants/berry.h"
-#define TAG_CONDITION_MON 100
-#define TAG_CONDITION_BALL 101
-#define TAG_CONDITION_CANCEL 102
-#define TAG_CONDITION_BALL_PLACEHOLDER 103
-#define TAG_CONDITION_SPARKLE 104
+enum {
+ TAG_CONDITION_MON = 100,
+ TAG_CONDITION_BALL,
+ TAG_CONDITION_CANCEL,
+ TAG_CONDITION_BALL_PLACEHOLDER,
+ TAG_CONDITION_SPARKLE,
+ TAG_CONDITION_MON_MARKINGS,
+ TAG_CONDITION_MARKINGS_MENU,
+ TAG_CONDITION_MARKINGS_MENU_2, // Used implicitly by CreateMonMarkingsMenuSprites
+};
+
#define MAX_CONDITION_SPARKLES 10
+// The number of extra sparkles shown on a Pokémon's condition screen.
+// All Pokémon start with 1, so the max here is MAX_CONDITION_SPARKLES - 1
+#define GET_NUM_CONDITION_SPARKLES(sheen)((sheen) != MAX_SHEEN) ? (sheen) / ((u32)MAX_SHEEN / (MAX_CONDITION_SPARKLES - 1) + 1) : MAX_CONDITION_SPARKLES - 1;
+
// Window IDs for the Player PC Mailbox
enum {
MAILBOXWIN_TITLE,
@@ -29,17 +39,35 @@ struct UnknownSubStruct_81D1ED4
u16 unk2;
};
+#define CONDITION_GRAPH_CENTER_X 155
+#define CONDITION_GRAPH_TOP_Y 56
+#define CONDITION_GRAPH_BOTTOM_Y 121
+#define CONDITION_GRAPH_HEIGHT (CONDITION_GRAPH_BOTTOM_Y - CONDITION_GRAPH_TOP_Y + 1)
+#define CONDITION_GRAPH_UNK_1 10
+#define CONDITION_GRAPH_UNK_2 9
+#define CONDITION_GRAPH_UNK 91
+
+// Equivalent to flavor and contest values, but in a different order.
+enum {
+ CONDITION_COOL,
+ CONDITION_TOUGH,
+ CONDITION_SMART,
+ CONDITION_CUTE,
+ CONDITION_BEAUTY,
+ CONDITION_COUNT
+};
+
struct ConditionGraph
{
- /*0x000*/ u8 stat[4][FLAVOR_COUNT];
- /*0x014*/ struct UnknownSubStruct_81D1ED4 unk14[4][FLAVOR_COUNT];
- /*0x064*/ struct UnknownSubStruct_81D1ED4 unk64[10][FLAVOR_COUNT];
- /*0x12C*/ struct UnknownSubStruct_81D1ED4 unk12C[FLAVOR_COUNT];
- /*0x140*/ u16 unk140[66][2];
- /*0x248*/ u16 unk248[66][2];
+ /*0x000*/ u8 conditions[4][CONDITION_COUNT];
+ /*0x014*/ struct UnknownSubStruct_81D1ED4 unk14[4][CONDITION_COUNT];
+ /*0x064*/ struct UnknownSubStruct_81D1ED4 unk64[CONDITION_GRAPH_UNK_1][CONDITION_COUNT];
+ /*0x12C*/ struct UnknownSubStruct_81D1ED4 unk12C[CONDITION_COUNT];
+ /*0x140*/ u16 scanlineRight[CONDITION_GRAPH_HEIGHT][2];
+ /*0x248*/ u16 scanlineLeft[CONDITION_GRAPH_HEIGHT][2];
/*0x350*/ u16 unk350;
/*0x352*/ u16 unk352;
- /*0x354*/ u8 unk354;
+ /*0x354*/ bool8 unk354;
/*0x355*/ u8 state;
};
@@ -49,13 +77,13 @@ u8 MailboxMenu_CreateList(struct PlayerPCItemPageStruct *page);
void MailboxMenu_AddScrollArrows(struct PlayerPCItemPageStruct *page);
void MailboxMenu_Free(void);
void MailboxMenu_RemoveWindow(u8 windowIdx);
-void InitConditionGraphData(struct ConditionGraph *graph);
+void ConditionGraph_Init(struct ConditionGraph *graph);
void sub_81D2108(struct ConditionGraph *graph);
void SetConditionGraphIOWindows(u8 bg);
void InitConditionGraphState(struct ConditionGraph *graph);
void sub_81D2230(struct ConditionGraph *graph);
bool8 SetupConditionGraphScanlineParams(struct ConditionGraph *graph);
-bool32 TransitionConditionGraph(struct ConditionGraph *graph);
+bool8 TransitionConditionGraph(struct ConditionGraph *graph);
void sub_81D2754(u8 *arg0, struct UnknownSubStruct_81D1ED4 *arg1);
void sub_81D1F84(struct ConditionGraph *graph, struct UnknownSubStruct_81D1ED4 *arg1, struct UnknownSubStruct_81D1ED4 *arg2);
void MoveRelearnerPrintText(u8 *str);
@@ -69,8 +97,8 @@ void GetConditionMenuMonConditions(struct ConditionGraph *graph, u8 *sheen, u16
void GetConditionMenuMonGfx(void *tilesDst, void *palDst, u16 boxId, u16 monId, u16 partyId, u16 numMons, bool8 excludesCancel);
bool8 MoveConditionMonOnscreen(s16 *x);
bool8 MoveConditionMonOffscreen(s16 *x);
-bool8 TryUpdateConditionMonTransitionOn(struct ConditionGraph *graph, s16 *x);
-bool8 TryUpdateConditionMonTransitionOff(struct ConditionGraph *graph, s16 *x);
+bool8 ConditionGraph_UpdateMonEnter(struct ConditionGraph *graph, s16 *x);
+bool8 ConditionGraph_UpdateMonExit(struct ConditionGraph *graph, s16 *x);
void LoadConditionMonPicTemplate(struct SpriteSheet *sheet, struct SpriteTemplate *template, struct SpritePalette *pal);
void LoadConditionSelectionIcons(struct SpriteSheet *sheets, struct SpriteTemplate * template, struct SpritePalette *pals);
void LoadConditionSparkle(struct SpriteSheet *sheet, struct SpritePalette *pal);
diff --git a/include/pokenav.h b/include/pokenav.h
index b1c73056d..445ce752b 100644
--- a/include/pokenav.h
+++ b/include/pokenav.h
@@ -256,6 +256,14 @@ enum PartyConditionFuncIds
PARTY_CONDITION_FUNC_CLOSE_MARKINGS,
};
+enum
+{
+ CONDITION_MON_0,
+ CONDITION_MON_1,
+ CONDITION_MON_2,
+ NUM_CONDITION_MONS
+};
+
#define POKENAV_MENU_FUNC_EXIT -1
enum
@@ -432,11 +440,11 @@ bool32 IsConditionMenuSearchMode(void);
struct ConditionGraph *GetConditionGraphDataPtr(void);
u16 GetConditionGraphCurrentMonIndex(void);
u16 GetMonListCount(void);
-u8 GetMonSheen(void);
-bool32 SetConditionGraphData(u8 arg0);
+u8 GetNumConditionMonSparkles(void);
+bool32 SetConditionGraphData(u8 mode);
u8 TryGetMonMarkId(void);
-u8 *GetConditionMonNameBuffer(u8 id);
-u8 *GetConditionMonLocationBuffer(u8 id);
+u8 *GetConditionMonNameText(u8 id);
+u8 *GetConditionMonLocationText(u8 id);
u16 GetConditionMonDataBuffer(void);
void *GetConditionMonPicGfx(u8 id);
void *GetConditionMonPal(u8 id);