summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKurausukun <lord.uber1@gmail.com>2020-12-10 23:30:52 -0500
committerKurausukun <lord.uber1@gmail.com>2020-12-10 23:30:52 -0500
commit58976ebaa8d73d174940f622ec36f22bcd2fd8a2 (patch)
treec27ab24ed83fdb16654b5814d681af487b119601 /include
parent32ae13f9b66ab1b01146e5746e9350f97f055526 (diff)
parent8d29f65c6c7f34aa53ae2e7ae3e4f34a95025602 (diff)
Merge remote-tracking branch 'upstream/master' into berry_crush
Diffstat (limited to 'include')
-rw-r--r--include/AgbRfu_LinkManager.h4
-rw-r--r--include/battle.h11
-rw-r--r--include/battle_message.h2
-rw-r--r--include/battle_tower.h4
-rw-r--r--include/constants/battle_pyramid.h10
-rw-r--r--include/constants/event_objects.h4
-rw-r--r--include/constants/flags.h4
-rw-r--r--include/constants/item_effects.h5
-rw-r--r--include/constants/items.h4
-rw-r--r--include/constants/pokemon.h44
-rw-r--r--include/data.h1
-rw-r--r--include/gba/m4a_internal.h92
-rw-r--r--include/global.fieldmap.h4
-rw-r--r--include/global.h10
-rw-r--r--include/graphics.h6
-rw-r--r--include/list_menu.h4
-rw-r--r--include/menu.h11
-rw-r--r--include/menu_specialized.h12
-rw-r--r--include/mon_markings.h4
-rw-r--r--include/pokemon.h4
-rw-r--r--include/pokenav.h198
-rw-r--r--include/trainer_hill.h26
22 files changed, 274 insertions, 190 deletions
diff --git a/include/AgbRfu_LinkManager.h b/include/AgbRfu_LinkManager.h
index 4e1a879c2..d4ef13183 100644
--- a/include/AgbRfu_LinkManager.h
+++ b/include/AgbRfu_LinkManager.h
@@ -176,8 +176,8 @@ typedef struct linkManagerTag
/* 0x024 */ VBL_TIMER nameAcceptTimer;
/* 0x030 */ VBL_TIMER linkRecoveryTimer;
/* 0x03c */ INIT_PARAM *init_param;
- /* 0x040 */ void (*LMAN_callback)(u8 msg, u8 paramCount);
- /* 0x044 */ void (*MSC_callback)(u16 REQ_commandID);
+ /* 0x040 */ void (*LMAN_callback)(u8, u8);
+ /* 0x044 */ void (*MSC_callback)(u16);
} LINK_MANAGER;
extern struct linkManagerTag lman;
diff --git a/include/battle.h b/include/battle.h
index 0f7a262ce..53a78024a 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -11,6 +11,7 @@
#include "battle_gfx_sfx_util.h"
#include "battle_util2.h"
#include "battle_bg.h"
+#include "pokeball.h"
#define GET_BATTLER_POSITION(battler) (gBattlerPositions[battler])
#define GET_BATTLER_SIDE(battler) (GetBattlerPosition(battler) & BIT_SIDE)
@@ -124,8 +125,8 @@ struct ProtectStruct
u32 flinchImmobility:1;
u32 notFirstStrike:1;
u32 palaceUnableToUseMove:1;
- s32 physicalDmg;
- s32 specialDmg;
+ u32 physicalDmg;
+ u32 specialDmg;
u8 physicalBattlerId;
u8 specialBattlerId;
};
@@ -254,8 +255,8 @@ struct BattleResults
u16 playerMon2Species; // 0x26
u16 caughtMonSpecies; // 0x28
u8 caughtMonNick[POKEMON_NAME_LENGTH + 1]; // 0x2A
- u8 filler35; // 0x35
- u8 catchAttempts[11]; // 0x36
+ u8 filler35; // 0x35
+ u8 catchAttempts[POKEBALL_COUNT - 1]; // 0x36 Doesn't include Master ball
};
struct BattleTv_Side
@@ -493,7 +494,7 @@ struct BattleScripting
u8 field_20;
u8 reshowMainState;
u8 reshowHelperState;
- u8 field_23;
+ u8 levelUpHP;
u8 windowsType; // 0 - normal, 1 - battle arena
u8 multiplayerId;
u8 specialTrainerBattleType;
diff --git a/include/battle_message.h b/include/battle_message.h
index af090a06c..011a1cb0c 100644
--- a/include/battle_message.h
+++ b/include/battle_message.h
@@ -145,7 +145,7 @@
{ \
textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \
textVar[1] = B_BUFF_STRING; \
- textVar[2] = (stringId & 0xFF); \
+ textVar[2] = stringId; \
textVar[3] = (stringId & 0xFF00) >> 8; \
textVar[4] = B_BUFF_EOS; \
}
diff --git a/include/battle_tower.h b/include/battle_tower.h
index 3bf2f004b..30649719b 100644
--- a/include/battle_tower.h
+++ b/include/battle_tower.h
@@ -43,7 +43,9 @@ extern const struct BattleFrontierTrainer gBattleFrontierTrainers[];
extern const struct FacilityMon gSlateportBattleTentMons[];
extern const struct BattleFrontierTrainer gSlateportBattleTentTrainers[];
-extern u16 gUnknown_03006298[];
+// Temporary storage for monIds of the opponent team
+// during team generation in battle factory and similar facilities.
+extern u16 gFrontierTempParty[];
extern const struct BattleFrontierTrainer *gFacilityTrainers;
extern const struct FacilityMon *gFacilityTrainerMons;
diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h
index 378197a4d..004df7155 100644
--- a/include/constants/battle_pyramid.h
+++ b/include/constants/battle_pyramid.h
@@ -7,6 +7,16 @@
#define FLOOR_WALKABLE_METATILE 0x28D
#define FLOOR_EXIT_METATILE 0x28E
+#define HINT_EXIT_DIRECTION 0
+#define HINT_REMAINING_ITEMS 1
+#define HINT_REMAINING_TRAINERS 2
+#define HINT_EXIT_SHORT_REMAINING_TRAINERS 3
+#define HINT_EXIT_SHORT_REMAINING_ITEMS 4
+#define HINT_EXIT_MEDIUM_REMAINING_TRAINERS 5
+#define HINT_EXIT_MEDIUM_REMAINING_ITEMS 6
+#define HINT_EXIT_FAR_REMAINING_TRAINERS 7
+#define HINT_EXIT_FAR_REMAINING_ITEMS 8
+
#define OBJ_TRAINERS 0
#define OBJ_ITEMS 1
diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h
index ca312e957..8e026ef2d 100644
--- a/include/constants/event_objects.h
+++ b/include/constants/event_objects.h
@@ -205,7 +205,7 @@
#define OBJ_EVENT_GFX_REGICE 201
#define OBJ_EVENT_GFX_REGISTEEL 202
#define OBJ_EVENT_GFX_SKITTY 203
-#define OBJ_EVENT_GFX_KECLEON_1 204
+#define OBJ_EVENT_GFX_KECLEON 204
#define OBJ_EVENT_GFX_KYOGRE_2 205
#define OBJ_EVENT_GFX_GROUDON_2 206
#define OBJ_EVENT_GFX_RAYQUAZA_2 207
@@ -213,7 +213,7 @@
#define OBJ_EVENT_GFX_PIKACHU 209
#define OBJ_EVENT_GFX_AZUMARILL 210
#define OBJ_EVENT_GFX_WINGULL 211
-#define OBJ_EVENT_GFX_KECLEON_2 212
+#define OBJ_EVENT_GFX_KECLEON_BRIDGE_SHADOW 212
#define OBJ_EVENT_GFX_TUBER_M_SWIMMING 213
#define OBJ_EVENT_GFX_AZURILL 214
#define OBJ_EVENT_GFX_MOM 215
diff --git a/include/constants/flags.h b/include/constants/flags.h
index a562b0670..9be269105 100644
--- a/include/constants/flags.h
+++ b/include/constants/flags.h
@@ -1012,7 +1012,7 @@
#define FLAG_HIDE_MOSSDEEP_CITY_STEVENS_HOUSE_STEVEN 0x3C7
#define FLAG_HIDE_MOSSDEEP_CITY_STEVENS_HOUSE_BELDUM_POKEBALL 0x3C8
#define FLAG_HIDE_FORTREE_CITY_KECLEON 0x3C9
-#define FLAG_HIDE_ROUTE_120_KECLEON_BRIDGE_INVISIBLE 0x3CA
+#define FLAG_HIDE_ROUTE_120_KECLEON_BRIDGE 0x3CA
#define FLAG_HIDE_LILYCOVE_CITY_RIVAL 0x3CB
#define FLAG_HIDE_ROUTE_120_STEVEN 0x3CC
#define FLAG_HIDE_SOOTOPOLIS_CITY_STEVEN 0x3CD
@@ -1023,7 +1023,7 @@
#define FLAG_HIDE_AQUA_HIDEOUT_B1F_ELECTRODE_2 0x3D2
#define FLAG_HIDE_OLDALE_TOWN_RIVAL 0x3D3
#define FLAG_HIDE_UNDERWATER_SEA_FLOOR_CAVERN_STOLEN_SUBMARINE 0x3D4
-#define FLAG_HIDE_ROUTE_120_KECLEON_BRIDGE_VISIBLE 0x3D5
+#define FLAG_HIDE_ROUTE_120_KECLEON_BRIDGE_SHADOW 0x3D5
#define FLAG_HIDE_ROUTE_120_KECLEON_1 0x3D6
#define FLAG_HIDE_RUSTURF_TUNNEL_WANDA 0x3D7
#define FLAG_HIDE_VERDANTURF_TOWN_WANDAS_HOUSE_WANDA 0x3D8
diff --git a/include/constants/item_effects.h b/include/constants/item_effects.h
index 49fcedc61..6e61c4d7f 100644
--- a/include/constants/item_effects.h
+++ b/include/constants/item_effects.h
@@ -51,6 +51,11 @@
// fields 6 and onwards are item-specific arguments
+// Special HP recovery amounts for ITEM4_HEAL_HP
+#define ITEM6_HEAL_FULL ((u8) -1)
+#define ITEM6_HEAL_HALF ((u8) -2)
+#define ITEM6_HEAL_LVL_UP ((u8) -3)
+
// Used for GetItemEffectType.
#define ITEM_EFFECT_X_ITEM 0
#define ITEM_EFFECT_RAISE_LEVEL 1
diff --git a/include/constants/items.h b/include/constants/items.h
index 9496a4c61..95c6aacfe 100644
--- a/include/constants/items.h
+++ b/include/constants/items.h
@@ -497,6 +497,10 @@
#define MAX_PC_ITEM_CAPACITY 999
#define MAX_BERRY_CAPACITY 999
+#define BAG_ITEM_CAPACITY_DIGITS 2
+#define BERRY_CAPACITY_DIGITS 3
+#define MAX_ITEM_DIGITS BERRY_CAPACITY_DIGITS
+
// Secondary IDs for rods
#define OLD_ROD 0
#define GOOD_ROD 1
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h
index 52eabe71b..4cf0bd4f0 100644
--- a/include/constants/pokemon.h
+++ b/include/constants/pokemon.h
@@ -239,12 +239,12 @@
#define UNOWN_FORM_COUNT 28
// Battle move flags
-#define FLAG_MAKES_CONTACT 0x1
-#define FLAG_PROTECT_AFFECTED 0x2
-#define FLAG_MAGICCOAT_AFFECTED 0x4
-#define FLAG_SNATCH_AFFECTED 0x8
-#define FLAG_MIRROR_MOVE_AFFECTED 0x10
-#define FLAG_KINGSROCK_AFFECTED 0x20
+#define FLAG_MAKES_CONTACT (1 << 0)
+#define FLAG_PROTECT_AFFECTED (1 << 1)
+#define FLAG_MAGICCOAT_AFFECTED (1 << 2)
+#define FLAG_SNATCH_AFFECTED (1 << 3)
+#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4)
+#define FLAG_KINGSROCK_AFFECTED (1 << 5)
// Growth rates
#define GROWTH_MEDIUM_FAST 0
@@ -268,22 +268,22 @@
#define F_SUMMARY_SCREEN_FLIP_SPRITE 0x80
-// Evolution type flags
-#define EVO_FRIENDSHIP 0x0001 // Pokémon levels up with friendship ≥ 220
-#define EVO_FRIENDSHIP_DAY 0x0002 // Pokémon levels up during the day with friendship ≥ 220
-#define EVO_FRIENDSHIP_NIGHT 0x0003 // Pokémon levels up at night with friendship ≥ 220
-#define EVO_LEVEL 0x0004 // Pokémon reaches the specified level
-#define EVO_TRADE 0x0005 // Pokémon is traded
-#define EVO_TRADE_ITEM 0x0006 // Pokémon is traded while it's holding the specified item
-#define EVO_ITEM 0x0007 // specified item is used on Pokémon
-#define EVO_LEVEL_ATK_GT_DEF 0x0008 // Pokémon reaches the specified level with attack > defense
-#define EVO_LEVEL_ATK_EQ_DEF 0x0009 // Pokémon reaches the specified level with attack = defense
-#define EVO_LEVEL_ATK_LT_DEF 0x000a // Pokémon reaches the specified level with attack < defense
-#define EVO_LEVEL_SILCOON 0x000b // Pokémon reaches the specified level with a Silcoon personality value
-#define EVO_LEVEL_CASCOON 0x000c // Pokémon reaches the specified level with a Cascoon personality value
-#define EVO_LEVEL_NINJASK 0x000d // Pokémon reaches the specified level (special value for Ninjask)
-#define EVO_LEVEL_SHEDINJA 0x000e // Pokémon reaches the specified level (special value for Shedinja)
-#define EVO_BEAUTY 0x000f // Pokémon levels up with beauty ≥ specified value
+// Evolution types
+#define EVO_FRIENDSHIP 1 // Pokémon levels up with friendship ≥ 220
+#define EVO_FRIENDSHIP_DAY 2 // Pokémon levels up during the day with friendship ≥ 220
+#define EVO_FRIENDSHIP_NIGHT 3 // Pokémon levels up at night with friendship ≥ 220
+#define EVO_LEVEL 4 // Pokémon reaches the specified level
+#define EVO_TRADE 5 // Pokémon is traded
+#define EVO_TRADE_ITEM 6 // Pokémon is traded while it's holding the specified item
+#define EVO_ITEM 7 // specified item is used on Pokémon
+#define EVO_LEVEL_ATK_GT_DEF 8 // Pokémon reaches the specified level with attack > defense
+#define EVO_LEVEL_ATK_EQ_DEF 9 // Pokémon reaches the specified level with attack = defense
+#define EVO_LEVEL_ATK_LT_DEF 10 // Pokémon reaches the specified level with attack < defense
+#define EVO_LEVEL_SILCOON 11 // Pokémon reaches the specified level with a Silcoon personality value
+#define EVO_LEVEL_CASCOON 12 // Pokémon reaches the specified level with a Cascoon personality value
+#define EVO_LEVEL_NINJASK 13 // Pokémon reaches the specified level (special value for Ninjask)
+#define EVO_LEVEL_SHEDINJA 14 // Pokémon reaches the specified level (special value for Shedinja)
+#define EVO_BEAUTY 15 // Pokémon levels up with beauty ≥ specified value
#define EVOS_PER_MON 5
diff --git a/include/data.h b/include/data.h
index 49b98663a..260c18152 100644
--- a/include/data.h
+++ b/include/data.h
@@ -2,7 +2,6 @@
#define GUARD_DATA_H
#include "constants/moves.h"
-#include "constants/species.h"
#define SPECIES_SHINY_TAG 500
diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h
index bdff1b865..e2836c6f6 100644
--- a/include/gba/m4a_internal.h
+++ b/include/gba/m4a_internal.h
@@ -140,13 +140,55 @@ struct SoundChannel
struct WaveData *wav;
u32 cp;
struct MusicPlayerTrack *track;
- void *pp;
- void *np;
- void *d4;
+ u32 pp;
+ u32 np;
+ u32 d4;
u16 xpi;
u16 xpc;
};
+#define MAX_DIRECTSOUND_CHANNELS 12
+
+#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer
+
+struct SoundInfo
+{
+ // This field is normally equal to ID_NUMBER but it is set to other
+ // values during sensitive operations for locking purposes.
+ // This field should be volatile but isn't. This could potentially cause
+ // race conditions.
+ u32 ident;
+
+ vu8 pcmDmaCounter;
+
+ // Direct Sound
+ u8 reverb;
+ u8 maxChans;
+ u8 masterVolume;
+ u8 freq;
+
+ u8 mode;
+ u8 c15;
+ u8 pcmDmaPeriod; // number of V-blanks per PCM DMA
+ u8 maxLines;
+ u8 gap[3];
+ s32 pcmSamplesPerVBlank;
+ s32 pcmFreq;
+ s32 divFreq;
+ struct CgbChannel *cgbChans;
+ u32 func;
+ u32 intp;
+ void (*CgbSound)(void);
+ void (*CgbOscOff)(u8);
+ u32 (*MidiKeyToCgbFreq)(u8, u8, u8);
+ u32 MPlayJumpTable;
+ u32 plynote;
+ u32 ExtVolPit;
+ u8 gap2[16];
+ struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS];
+ s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2];
+};
+
struct SongHeader
{
u8 trackCount;
@@ -270,7 +312,7 @@ struct MusicPlayerInfo
struct MusicPlayerTrack *tracks;
struct ToneData *tone;
u32 ident;
- void (*func)();
+ u32 func;
u32 intp;
};
@@ -292,47 +334,7 @@ struct Song
extern const struct MusicPlayer gMPlayTable[];
extern const struct Song gSongTable[];
-#define MAX_DIRECTSOUND_CHANNELS 12
-
-#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer
-
-struct SoundInfo
-{
- // This field is normally equal to ID_NUMBER but it is set to other
- // values during sensitive operations for locking purposes.
- // This field should be volatile but isn't. This could potentially cause
- // race conditions.
- u32 ident;
-
- vu8 pcmDmaCounter;
-
- // Direct Sound
- u8 reverb;
- u8 maxChans;
- u8 masterVolume;
- u8 freq;
- u8 mode;
- u8 c15;
- u8 pcmDmaPeriod; // number of V-blanks per PCM DMA
- u8 maxLines;
- u8 gap[3];
- s32 pcmSamplesPerVBlank;
- s32 pcmFreq;
- s32 divFreq;
- struct CgbChannel *cgbChans;
- void (*func)();
- u32 intp;
- void (*CgbSound)();
- void (*CgbOscOff)(u8);
- u32 (*MidiKeyToCgbFreq)(u8, u8, u8);
- void (**MPlayJumpTable)();
- void (*plynote)(u8, struct MusicPlayerInfo *, struct MusicPlayerTrack *);
- void (*ExtVolPit)(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
- u32 gap2[4];
- struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS];
- s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2];
-};
extern u8 gMPlayMemAccArea[];
@@ -446,7 +448,7 @@ void ply_tune(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_port(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_xcmd(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
void ply_endtie(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
-void ply_note(u8, struct MusicPlayerInfo *, struct MusicPlayerTrack *);
+void ply_note(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
// extended sound command handler functions
void ply_xxx(struct MusicPlayerInfo *, struct MusicPlayerTrack *);
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index 2729d2a20..c4d7be35d 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -214,8 +214,8 @@ struct ObjectEvent
struct ObjectEventGraphicsInfo
{
/*0x00*/ u16 tileTag;
- /*0x02*/ u16 paletteTag1;
- /*0x04*/ u16 paletteTag2;
+ /*0x02*/ u16 paletteTag;
+ /*0x04*/ u16 reflectionPaletteTag;
/*0x06*/ u16 size;
/*0x08*/ s16 width;
/*0x0A*/ s16 height;
diff --git a/include/global.h b/include/global.h
index 8c5167041..4ccd2be50 100644
--- a/include/global.h
+++ b/include/global.h
@@ -8,6 +8,7 @@
#include "constants/global.h"
#include "constants/flags.h"
#include "constants/vars.h"
+#include "constants/species.h"
// Prevent cross-jump optimization.
#define BLOCK_CROSS_JUMP asm("");
@@ -65,8 +66,6 @@
// Converts a Q24.8 fixed-point format number to a regular integer
#define Q_24_8_TO_INT(n) ((int)((n) >> 8))
-#define POKEMON_SLOTS_NUMBER 412
-
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
@@ -99,7 +98,7 @@
#define T2_READ_PTR(ptr) (void*) T2_READ_32(ptr)
// Macros for checking the joypad
-#define TEST_BUTTON(field, button) ((field) & (button))
+#define TEST_BUTTON(field, button) ({(field) & (button);})
#define JOY_NEW(button) TEST_BUTTON(gMain.newKeys, button)
#define JOY_HELD(button) TEST_BUTTON(gMain.heldKeys, button)
#define JOY_HELD_RAW(button) TEST_BUTTON(gMain.heldKeysRaw, button)
@@ -115,7 +114,7 @@
#define ROUND_BITS_TO_BYTES(numBits)(((numBits) / 8) + (((numBits) % 8) ? 1 : 0))
-#define DEX_FLAGS_NO (ROUND_BITS_TO_BYTES(POKEMON_SLOTS_NUMBER))
+#define DEX_FLAGS_NO (ROUND_BITS_TO_BYTES(NUM_SPECIES))
#define NUM_FLAG_BYTES (ROUND_BITS_TO_BYTES(FLAGS_COUNT))
struct Coords8
@@ -329,11 +328,12 @@ struct BattleDomeTrainer
};
#define DOME_TOURNAMENT_TRAINERS_COUNT 16
+#define BATTLE_TOWER_RECORD_COUNT 5
struct BattleFrontier
{
/*0x64C*/ struct EmeraldBattleTowerRecord towerPlayer;
- /*0x738*/ struct EmeraldBattleTowerRecord towerRecords[5]; // From record mixing.
+ /*0x738*/ struct EmeraldBattleTowerRecord towerRecords[BATTLE_TOWER_RECORD_COUNT]; // From record mixing.
/*0xBEB*/ struct BattleTowerInterview towerInterview;
/*0xBEC*/ struct BattleTowerEReaderTrainer ereaderTrainer;
/*0xCA8*/ u8 challengeStatus;
diff --git a/include/graphics.h b/include/graphics.h
index 32268d6db..936f95aa8 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -5014,4 +5014,10 @@ extern const u16 gPokenavMessageBox_Pal[];
extern const u32 gPokenavOptions_Gfx[];
extern const u16 gPokenavOptions_Pal[];
+// Object event pals
+extern const u16 gObjectEventPal_Brendan[];
+extern const u16 gObjectEventPal_May[];
+extern const u16 gObjectEventPal_RubySapphireBrendan[];
+extern const u16 gObjectEventPal_RubySapphireMay[];
+
#endif //GUARD_GRAPHICS_H
diff --git a/include/list_menu.h b/include/list_menu.h
index 4697ba5aa..0a54a069a 100644
--- a/include/list_menu.h
+++ b/include/list_menu.h
@@ -24,7 +24,7 @@ struct ListMenu;
struct ListMenuItem
{
const u8 *name;
- u32 id;
+ s32 id;
};
struct ListMenuTemplate
@@ -98,7 +98,7 @@ struct CursorStruct
extern struct ScrollArrowsTemplate gTempScrollArrowTemplate;
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
-u32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
+s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum);
u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow);
u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow);
s32 ListMenu_ProcessInput(u8 listTaskId);
diff --git a/include/menu.h b/include/menu.h
index 1bd800742..c9d8e374d 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -4,6 +4,7 @@
#include "task.h"
#include "text.h"
#include "window.h"
+#include "constants/pokemon.h"
#define MENU_NOTHING_CHOSEN -2
#define MENU_B_PRESSED -1
@@ -14,6 +15,14 @@
#define MENU_CURSOR_DELTA_LEFT -1
#define MENU_CURSOR_DELTA_RIGHT 1
+#define MENU_INFO_ICON_TYPE (NUMBER_OF_MON_TYPES + 1)
+#define MENU_INFO_ICON_POWER (NUMBER_OF_MON_TYPES + 2)
+#define MENU_INFO_ICON_ACCURACY (NUMBER_OF_MON_TYPES + 3)
+#define MENU_INFO_ICON_PP (NUMBER_OF_MON_TYPES + 4)
+#define MENU_INFO_ICON_EFFECT (NUMBER_OF_MON_TYPES + 5)
+#define MENU_INFO_ICON_BALL_RED (NUMBER_OF_MON_TYPES + 6)
+#define MENU_INFO_ICON_BALL_BLUE (NUMBER_OF_MON_TYPES + 7)
+
enum
{
SAVE_MENU_NAME,
@@ -61,7 +70,7 @@ u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 i
u8 Menu_GetCursorPos(void);
s8 Menu_ProcessInput(void);
s8 Menu_ProcessInputNoWrap(void);
-void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y);
+void BlitMenuInfoIcon(u8 winId, u8 a2, u16 x, u16 y);
void ResetTempTileDataBuffers(void);
void *DecompressAndCopyTileDataToVram(u8 bgId, const void *src, u32 size, u16 offset, u8 mode);
bool8 FreeTempTileDataBuffersIfPossible(void);
diff --git a/include/menu_specialized.h b/include/menu_specialized.h
index 242e1c6b2..987fca9fc 100644
--- a/include/menu_specialized.h
+++ b/include/menu_specialized.h
@@ -23,7 +23,7 @@ struct UnknownSubStruct_81D1ED4
struct ConditionGraph
{
- /*0x000*/ u8 unk0[4][FLAVOR_COUNT];
+ /*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];
@@ -32,7 +32,7 @@ struct ConditionGraph
/*0x350*/ u16 unk350;
/*0x352*/ u16 unk352;
/*0x354*/ u8 unk354;
- /*0x355*/ u8 unk355;
+ /*0x355*/ u8 state;
};
bool8 sub_81D1C44(u8 count);
@@ -41,12 +41,12 @@ u8 sub_81D1DC0(struct PlayerPCItemPageStruct *page);
void sub_81D1E90(struct PlayerPCItemPageStruct *page);
void sub_81D1EC0(void);
void sub_81D1D04(u8 a0);
-void sub_81D1ED4(struct ConditionGraph *graph);
+void InitConditionGraphData(struct ConditionGraph *graph);
void sub_81D2108(struct ConditionGraph *graph);
-void sub_81D21DC(u8 bg);
-void sub_81D20AC(struct ConditionGraph *graph);
+void SetConditionGraphIOWindows(u8 bg);
+void InitConditionGraphState(struct ConditionGraph *graph);
void sub_81D2230(struct ConditionGraph *graph);
-bool8 sub_81D20BC(struct ConditionGraph *graph);
+bool8 SetupConditionGraphScanlineParams(struct ConditionGraph *graph);
bool32 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);
diff --git a/include/mon_markings.h b/include/mon_markings.h
index 241b31e01..3cb04ad48 100644
--- a/include/mon_markings.h
+++ b/include/mon_markings.h
@@ -29,8 +29,8 @@ bool8 sub_811F960(void);
void sub_811FA90(void);
void sub_811FAA4(u8 markings, s16 x, s16 y);
void sub_811FAF8(void);
-bool8 sub_811FBA4(void);
-struct Sprite *sub_811FF94(u16 tileTag, u16 paletteTag, const u16 *palette);
+bool8 MonMarkingsMenuHandleInput(void);
+struct Sprite *CreateMonMarkingsSpriteWithPal(u16 tileTag, u16 paletteTag, const u16 *palette);
struct Sprite *sub_811FFB4(u16 tileTag, u16 paletteTag, const u16 *palette);
void sub_8120084(u8 markings, void *dest);
diff --git a/include/pokemon.h b/include/pokemon.h
index 81c17f545..a956b9c40 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -127,8 +127,8 @@ struct Unknown_806F160_Struct
u32 field_0_1:4;
u32 field_1:8;
u16 magic:8;
- u32 size:4;
- u16 field_3_1:4;
+ u32 field_3_0:4;
+ u32 field_3_1:4;
void *bytes;
u8 **byteArrays;
struct SpriteTemplate *templates;
diff --git a/include/pokenav.h b/include/pokenav.h
index ed4e5a906..3fc01ede3 100644
--- a/include/pokenav.h
+++ b/include/pokenav.h
@@ -27,17 +27,17 @@ struct PokenavListTemplate
struct PokenavMonList *monList;
struct PokenavMatchCallEntries *matchCallEntries;
} list;
- u16 unk4;
+ u16 count;
u16 unk6;
u8 unk8;
- u8 unk9;
- u8 unkA;
- u8 unkB;
- u8 unkC;
- u8 unkD;
- u8 unkE;
+ u8 item_X;
+ u8 windowWidth;
+ u8 listTop;
+ u8 maxShowed;
+ u8 fillValue;
+ u8 fontId;
union {
- void (*unk10_1)(struct PokenavMonList *, u8 *a1);
+ void (*printMonFunc)(struct PokenavMonList *item, u8 *dest);
void (*unk10_2)(struct PokenavMatchCallEntries *, u8 *a1);
} listFunc;
void (*unk14)(u16 a0, u32 a1, u32 a2);
@@ -45,9 +45,9 @@ struct PokenavListTemplate
struct PokenavSub18
{
- u16 unk0;
- u16 unk2;
- struct PokenavMonList unk4[TOTAL_BOXES_COUNT * IN_BOX_COUNT + PARTY_SIZE];
+ u16 listCount;
+ u16 currIndex;
+ struct PokenavMonList monData[TOTAL_BOXES_COUNT * IN_BOX_COUNT + PARTY_SIZE];
};
// Return values of LoopedTask functions.
@@ -65,6 +65,31 @@ enum
POKENAV_MODE_FORCE_CALL_EXIT, // Pokenav tutorial after calling Mr. Stone
};
+// TODO - refine these names
+enum Substructures
+{
+ POKENAV_SUBSTRUCT_MAIN_MENU,
+ POKENAV_SUBSTRUCT_MAIN_MENU_HANDLER,
+ POKENAV_SUBSTRUCT_MENU_ICONS,
+ POKENAV_SUBSTRUCT_REGION_MAP_STATE,
+ POKENAV_SUBSTRUCT_REGION_MAP_ZOOM,
+ POKENAV_SUBSTRUCT_MATCH_CALL_MAIN,
+ POKENAV_SUBSTRUCT_MATCH_CALL_OPEN,
+ POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS,
+ POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULT_LIST,
+ POKENAV_SUBSTRUCT_RIBBONS_MON_LIST,
+ POKENAV_SUBSTRUCT_RIBBONS_MON_MENU,
+ POKENAV_SUBSTRUCT_CONDITION_GRAPH,
+ POKENAV_SUBSTRUCT_MON_MARK_MENU,
+ POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_LIST,
+ POKENAV_SUBSTRUCT_RIBBONS_SUMMARY_MENU,
+ POKENAV_SUBSTRUCT_15, //unused
+ POKENAV_SUBSTRUCT_REGION_MAP,
+ POKENAV_SUBSTRUCT_MATCH_CALL_LIST,
+ POKENAV_SUBSTRUCT_MON_LIST,
+ POKENAV_SUBSTRUCT_COUNT,
+};
+
enum
{
POKENAV_GFX_MAIN_MENU,
@@ -97,12 +122,12 @@ enum
POKENAV_REGION_MAP,
POKENAV_CONDITION_PARTY,
POKENAV_CONDITION_SEARCH_RESULTS,
- POKENAV_MENU_9, // Condition
- POKENAV_MENU_A, // Condition
+ POKENAV_CONDITION_GRAPH_FROM_SEARCH, // opening condition graph from search list
+ POKENAV_RETURN_CONDITION_SEARCH, //return to search list from condition graph
POKENAV_MATCH_CALL,
POKENAV_RIBBONS_MON_LIST,
- POKENAV_MENU_D, // Ribbons
- POKENAV_MENU_E, // Ribbons
+ POKENAV_RIBBONS_SUMMARY_SCREEN,
+ POKENAV_RIBBONS_RETURN_TO_MON_LIST,
};
enum
@@ -207,7 +232,7 @@ enum
// Pokenav Function IDs
// Indices into the LoopedTask tables for each of the main Pokenav features
-enum
+enum RegionMapFuncIds
{
POKENAV_MENU_FUNC_NONE,
POKENAV_MENU_FUNC_MOVE_CURSOR,
@@ -220,6 +245,19 @@ enum
POKENAV_MENU_FUNC_OPEN_FEATURE,
};
+enum PartyConditionFuncIds
+{
+ PARTY_CONDITION_FUNC_NONE,
+ PARTY_CONDITION_FUNC_SLIDE_MON_IN,
+ PARTY_CONDITION_FUNC_RETURN,
+ PARTY_CONDITION_FUNC_NO_TRANSITION,
+ PARTY_CONDITION_FUNC_SLIDE_MON_OUT,
+ PARTY_CONDITION_FUNC_ADD_MARKINGS,
+ PARTY_CONDITION_FUNC_CLOSE_MARKINGS,
+};
+
+#define POKENAV_MENU_FUNC_EXIT -1
+
enum
{
POKENAV_MC_FUNC_NONE,
@@ -268,17 +306,17 @@ void SetPokenavVBlankCallback(void);
void SetVBlankCallback_(IntrCallback callback);
// pokenav_match_call_ui.c
-u32 GetSelectedMatchCall(void);
+u32 GetSelectedPokenavListIndex(void);
bool32 sub_81C8224(void);
int MatchCall_MoveCursorUp(void);
int MatchCall_MoveCursorDown(void);
int MatchCall_PageDown(void);
int MatchCall_PageUp(void);
-bool32 sub_81C8630(void);
+bool32 IsMonListLoopedTaskActive(void);
void ToggleMatchCallVerticalArrows(bool32 shouldHide);
void sub_81C8838(void);
void sub_81C877C(void);
-bool32 sub_81C8820(void);
+bool32 IsMatchCallListTaskActive(void);
void PrintCheckPageInfo(s16 a0);
u32 GetMatchCallListTopIndex(void);
void sub_81C87F0(void);
@@ -300,30 +338,30 @@ void MatchCall_GetNameAndDesc(u32 idx, const u8 **desc, const u8 **name);
// pokenav_main_menu.c
bool32 InitPokenavMainMenu(void);
void CopyPaletteIntoBufferUnfaded(const u16 *palette, u32 bufferOffset, u32 size);
-void sub_81C7850(u32 a0);
-u32 sub_81C786C(void);
+void RunMainMenuLoopedTask(u32 a0);
+u32 IsActiveMenuLoopTaskActive(void);
void LoadLeftHeaderGfxForIndex(u32 arg0);
-void sub_81C7FA0(u32 arg0, bool32 arg1, bool32 arg2);
+void ShowLeftHeaderGfx(u32 menugfxId, bool32 arg1, bool32 isOnRightSide);
void PokenavFadeScreen(s32 fadeType);
-bool32 sub_81C8010(void);
+bool32 AreLeftHeaderSpritesMoving(void);
void InitBgTemplates(const struct BgTemplate *templates, int count);
bool32 IsPaletteFadeActive(void);
void PrintHelpBarText(u32 textId);
bool32 WaitForHelpBar(void);
-void sub_81C78A0(void);
+void SlideMenuHeaderDown(void);
bool32 MainMenuLoopedTaskIsBusy(void);
-void sub_81C7FDC(void);
-void sub_81C79BC(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *palette);
+void SetLeftHeaderSpritesInvisibility(void);
+void PokenavCopyPalette(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *palette);
void sub_81C7B40(void);
struct Sprite *PauseSpinningPokenavSprite(void);
void ResumeSpinningPokenavSprite(void);
-void sub_81C7E14(u32 arg0);
-void sub_81C7FC4(u32 arg0, bool32 arg1);
-void sub_81C7880(void);
-void sub_81C7990(u32 a0, u16 a1);
+void UpdateRegionMapRightHeaderTiles(u32 arg0);
+void HideMainOrSubMenuLeftHeader(u32 id, bool32 onRightSide);
+void SlideMenuHeaderUp(void);
+void PokenavFillPalette(u32 palIndex, u16 fillValue);
u32 PokenavMainMenuLoopedTaskIsActive(void);
bool32 WaitForPokenavShutdownFade(void);
-void sub_81C7834(void *func1, void *func2);
+void SetActiveMenuLoopTasks(void *func1, void *func2);
void ShutdownPokenav(void);
// pokenav_menu_handler_1.c
@@ -345,7 +383,7 @@ bool32 OpenPokenavMenuNotInitial(void);
void CreateMenuHandlerLoopedTask(s32 ltIdx);
bool32 IsMenuHandlerLoopedTaskActive(void);
void FreeMenuHandlerSubstruct2(void);
-void sub_81CAADC(void);
+void ResetBldCnt_(void);
// pokenav_match_call_1.c
bool32 PokenavCallback_Init_MatchCall(void);
@@ -364,7 +402,7 @@ const u8 *GetMatchCallMessageText(int index, u8 *arg1);
u16 GetMatchCallOptionCursorPos(void);
u16 GetMatchCallOptionId(int arg0);
void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntries * arg0, u8 *str);
-u8 sub_81CB0C8(int rematchIndex);
+u8 GetMatchTableMapSectionId(int rematchIndex);
int GetIndexDeltaOfNextCheckPageDown(int index);
int GetIndexDeltaOfNextCheckPageUp(int index);
bool32 IsRematchEntryRegistered(int index);
@@ -385,60 +423,60 @@ void FreeRegionMapSubstruct1(void);
void FreeRegionMapSubstruct2(void);
// pokenav_conditions_1.c
-u32 PokenavCallback_Init_7(void);
-u32 PokenavCallback_Init_9(void);
-u32 sub_81CD070(void);
-void sub_81CD1C0(void);
-bool32 sub_81CD3C4(void);
-bool32 sub_81CDD5C(void);
-struct ConditionGraph *sub_81CDC70(void);
-u16 sub_81CDC60(void);
-u16 sub_81CDC50(void);
-u8 sub_81CDDB0(void);
-bool32 sub_81CD548(u8 arg0);
-u8 sub_81CDD7C(void);
-u8 *sub_81CDD04(u8 id);
-u8 *sub_81CDD24(u8 id);
-u16 sub_81CDD48(void);
-void *sub_81CDCB4(u8 id);
-void *sub_81CDCD4(u8 id);
+u32 PokenavCallback_Init_PartyCondition(void);
+u32 PokenavCallback_Init_ConditionGraphFromSearch(void);
+u32 GetPartyConditionCallback(void);
+void FreePartyConditionSubstruct1(void);
+bool32 LoadPartyConditionMenuGfx(void);
+bool32 IsConditionMenuSearchMode(void);
+struct ConditionGraph *GetConditionGraphDataPtr(void);
+u16 GetConditionGraphCurrentMonIndex(void);
+u16 GetMonListCount(void);
+u8 GetMonSheen(void);
+bool32 SetConditionGraphData(u8 arg0);
+u8 TryGetMonMarkId(void);
+u8 *GetConditionMonNameBuffer(u8 id);
+u8 *GetConditionMonLocationBuffer(u8 id);
+u16 GetConditionMonDataBuffer(void);
+void *GetConditionMonPicGfx(u8 id);
+void *GetConditionMonPal(u8 id);
// pokenav_conditions_2.c
-bool32 sub_81CDDD4(void);
-void sub_81CDE2C(s32);
-u32 sub_81CDE64(void);
-void sub_81CECA0(void);
-u8 sub_81CEF14(void);
+bool32 OpenPartyConditionMenu(void);
+void CreatePartyConditionLoopedTask(s32);
+u32 IsPartyConditionLoopedTaskActive(void);
+void FreePartyConditionSubstruct2(void);
+u8 GetMonMarkingsData(void);
// pokenav_conditions_3.c
-u32 PokenavCallback_Init_8(void);
-u32 PokenavCallback_Init_10(void);
-u32 sub_81CEFDC(void);
-void sub_81CEFF0(void);
-bool32 sub_81CF330(void);
-bool32 sub_81CF368(void);
-void sub_81CF3A0(s32);
-u32 sub_81CF3D0(void);
-void sub_81CF3F8(void);
+u32 PokenavCallback_Init_ConditionSearch(void);
+u32 PokenavCallback_Init_ReturnToMonSearchList(void);
+u32 GetConditionSearchResultsCallback(void);
+void FreeSearchResultSubstruct1(void);
+bool32 OpenConditionSearchResults(void);
+bool32 OpenConditionSearchListFromGraph(void);
+void CreateSearchResultsLoopedTask(s32);
+u32 IsSearchResultLoopedTaskActive(void);
+void FreeSearchResultSubstruct2(void);
// pokenav_ribbons_1.c
-u32 PokenavCallback_Init_12(void);
-u32 PokenavCallback_Init_14(void);
-u32 sub_81CFA34(void);
-void sub_81CFA48(void);
-bool32 sub_81CFDD0(void);
-bool32 sub_81CFE08(void);
-void sub_81CFE40(s32);
-u32 sub_81CFE70(void);
-void sub_81CFE98(void);
+u32 PokenavCallback_Init_MonRibbonList(void);
+u32 PokenavCallback_Init_RibbonsMonListFromSummary(void);
+u32 GetRibbonsMonListCallback(void);
+void FreeRibbonsMonList1(void);
+bool32 OpenRibbonsMonList(void);
+bool32 OpenRibbonsMonListFromRibbonsSummary(void);
+void CreateRibbonsMonListLoopedTask(s32);
+u32 IsRibbonsMonListLoopedTaskActive(void);
+void FreeRibbonsMonList2(void);
// pokenav_ribbons_2.c
-u32 PokenavCallback_Init_13(void);
-u32 sub_81D04A0(void);
-void sub_81D04B8(void);
-bool32 sub_81D0978(void);
-void sub_81D09B0(s32);
-u32 sub_81D09E0(void);
-void sub_81D09F4(void);
+u32 PokenavCallback_Init_RibbonsSummaryMenu(void);
+u32 GetRibbonsSummaryMenuCallback(void);
+void FreeRibbonsSummaryScreen1(void);
+bool32 OpenRibbonsSummaryMenu(void);
+void CreateRibbonsSummaryLoopedTask(s32);
+u32 IsRibbonsSummaryLoopedTaskActive(void);
+void FreeRibbonsSummaryScreen2(void);
#endif // GUARD_POKENAV_H
diff --git a/include/trainer_hill.h b/include/trainer_hill.h
index 3f0644248..94d29a7ca 100644
--- a/include/trainer_hill.h
+++ b/include/trainer_hill.h
@@ -8,10 +8,10 @@ struct TrainerHillTrainer
u8 name[HILL_TRAINER_NAME_LENGTH];
u8 facilityClass;
u32 unused;
- u16 speechBefore[6];
- u16 speechWin[6];
- u16 speechLose[6];
- u16 speechAfter[6];
+ u16 speechBefore[EASY_CHAT_BATTLE_WORDS_COUNT];
+ u16 speechWin[EASY_CHAT_BATTLE_WORDS_COUNT];
+ u16 speechLose[EASY_CHAT_BATTLE_WORDS_COUNT];
+ u16 speechAfter[EASY_CHAT_BATTLE_WORDS_COUNT];
struct BattleTowerPokemon mons[PARTY_SIZE];
};
@@ -23,11 +23,19 @@ struct TrHillRoomTrainers
struct TrHillDisplay
{
- u8 data[0x100];
- u16 unk3A0[16];
- u8 coords[2]; // x first 4 bits, y last 4 bits
- u8 direction; // array of 4 bits for each trainer
- u8 range; // array of 4 bits for each trainer
+ // Metatile data. Add 0x200 to the values in this array to get metatiles.
+ // This data then overwrites the metatiles in the map starting at (0,5)
+ u8 metatileData[0x100];
+ // Collision data. One bit for each tile in column-major order,
+ // so every array entry is one row. 1 = impassable, 0 = passable
+ u16 collisionData[16];
+ // Trainer coordinates, starting at (0,6). Format is 0bYYYYXXXX.
+ u8 coords[2];
+ // Trainer facing directions. Same as (DIR_* - 1).
+ // Effectively an array of nibbles, one for each trainer.
+ u8 direction;
+ // Trainer sight ranges. Effectively an array of nibbles, one for each trainer.
+ u8 range;
};
struct TrHillFloor