summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle_anim.h2
-rw-r--r--include/battle_pyramid_bag.h54
-rw-r--r--include/constants/battle_ai.h28
-rw-r--r--include/constants/battle_frontier.h15
-rw-r--r--include/constants/battle_string_ids.h2
-rw-r--r--include/constants/contest.h17
-rw-r--r--include/constants/easy_chat.h2
-rwxr-xr-xinclude/constants/map_groups.h68
-rw-r--r--include/constants/metatile_labels.h2
-rw-r--r--include/constants/trainer_hill.h5
-rw-r--r--include/constants/tv.h53
-rw-r--r--include/contest.h16
-rw-r--r--include/contest_util.h4
-rw-r--r--include/data.h10
-rw-r--r--include/daycare.h2
-rwxr-xr-xinclude/ereader_helpers.h24
-rw-r--r--include/event_object_lock.h4
-rw-r--r--include/event_scripts.h26
-rw-r--r--include/gba/m4a_internal.h2
-rw-r--r--include/global.fieldmap.h16
-rw-r--r--include/global.h8
-rw-r--r--include/global.tv.h22
-rw-r--r--include/graphics.h28
-rw-r--r--include/international_string_util.h2
-rw-r--r--include/link.h2
-rw-r--r--include/list_menu.h2
-rw-r--r--include/mauville_old_man.h2
-rw-r--r--include/menu.h4
-rw-r--r--include/menu_helpers.h2
-rw-r--r--include/pokemon.h1
-rw-r--r--include/region_map.h2
-rw-r--r--include/strings.h7
-rw-r--r--include/tv.h30
33 files changed, 281 insertions, 183 deletions
diff --git a/include/battle_anim.h b/include/battle_anim.h
index 476480489..ad160e74d 100644
--- a/include/battle_anim.h
+++ b/include/battle_anim.h
@@ -143,7 +143,7 @@ void TranslateSpriteLinear(struct Sprite *sprite);
void AnimSpriteOnMonPos(struct Sprite *sprite);
void InitAnimLinearTranslationWithSpeedAndPos(struct Sprite *sprite);
void TranslateSpriteInCircleOverDuration(struct Sprite *sprite);
-void SetGreyscaleOrOriginalPalette(u16 palNum, bool8 restoreOriginal);
+void SetGrayscaleOrOriginalPalette(u16 palNum, bool8 restoreOriginal);
void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds);
bool8 RunAffineAnimFromTaskData(struct Task *task);
void AnimThrowProjectile(struct Sprite *sprite);
diff --git a/include/battle_pyramid_bag.h b/include/battle_pyramid_bag.h
index df111b939..de571714c 100644
--- a/include/battle_pyramid_bag.h
+++ b/include/battle_pyramid_bag.h
@@ -3,48 +3,72 @@
#include "list_menu.h"
-struct PyramidBagResources
+enum {
+ PYRAMIDBAG_LOC_FIELD,
+ PYRAMIDBAG_LOC_BATTLE,
+ PYRAMIDBAG_LOC_PARTY,
+ PYRAMIDBAG_LOC_CHOOSE_TOSS,
+ PYRAMIDBAG_LOC_PREV,
+};
+
+enum {
+ PBAG_SPRITE_BAG,
+ PBAG_SPRITE_ITEM_ICON,
+ PBAG_SPRITE_ITEM_ICON_ALT,
+ PBAG_SPRITE_SWAP_LINE_START, // Swap line consists of 8 sprites
+ PBAG_SPRITE_SWAP_LINE_2,
+ PBAG_SPRITE_SWAP_LINE_3,
+ PBAG_SPRITE_SWAP_LINE_4,
+ PBAG_SPRITE_SWAP_LINE_5,
+ PBAG_SPRITE_SWAP_LINE_6,
+ PBAG_SPRITE_SWAP_LINE_7,
+ PBAG_SPRITE_SWAP_LINE_END,
+ PBAG_SPRITE_COUNT
+};
+#define NUM_SWAP_LINE_SPRITES (1 + PBAG_SPRITE_SWAP_LINE_END - PBAG_SPRITE_SWAP_LINE_START)
+
+struct PyramidBagMenu
{
- void (*callback2)(void);
- u8 tilemapBuffer[0x800];
- u8 itemsSpriteIds[PYRAMID_BAG_ITEMS_COUNT + 1];
+ void (*exitCallback)(void);
+ u8 tilemapBuffer[BG_SCREEN_SIZE];
+ u8 spriteIds[PBAG_SPRITE_COUNT];
u8 windowIds[5];
- u8 unk814;
- u8 unk815;
+ u8 toSwapPos;
+ bool8 isAltIcon; // Two item icons loaded at a time. Tracks which to show next
u8 scrollIndicatorsTaskId;
const u8 *menuActionIds;
- u8 filler81C[0x820 - 0x81C];
+ u8 unused1[4];
u8 menuActionsCount;
u8 listMenuCount;
u8 listMenuMaxShown;
struct ListMenuItem bagListItems[PYRAMID_BAG_ITEMS_COUNT + 1];
u8 itemStrings[PYRAMID_BAG_ITEMS_COUNT + 1][ITEM_NAME_LENGTH + 10];
s16 state;
- u8 filler986[0x98C - 0x986];
+ u8 unused2[4];
};
-struct PyramidBagCursorData
+struct PyramidBagMenuState
{
void (*callback)(void);
- u8 unk4;
+ u8 location;
u16 cursorPosition;
u16 scrollPosition;
};
-extern struct PyramidBagResources *gPyramidBagResources;
-extern struct PyramidBagCursorData gPyramidBagCursorData;
+extern struct PyramidBagMenu *gPyramidBagMenu;
+extern struct PyramidBagMenuState gPyramidBagMenuState;
void InitBattlePyramidBagCursorPosition(void);
void CB2_PyramidBagMenuFromStartMenu(void);
void CB2_ReturnToPyramidBagMenu(void);
-void sub_81C5924(void);
-void sub_81C59BC(void);
+void UpdatePyramidBagList(void);
+void UpdatePyramidBagCursorPos(void);
void sub_81C4EFC(void);
void GoToBattlePyramidBagMenu(u8 a0, void (*callback)(void));
void Task_CloseBattlePyramidBagMessage(u8 taskId);
void TryStoreHeldItemsInPyramidBag(void);
void ChooseItemsToTossFromPyramidBag(void);
-void CloseBattlePyramidBagAndSetCallback(u8 taskId);
+void CloseBattlePyramidBag(u8 taskId);
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId));
#endif // GUARD_BATTLE_PYRAMID_BAG_H
diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h
index 4c3a45dc6..5ade58d50 100644
--- a/include/constants/battle_ai.h
+++ b/include/constants/battle_ai.h
@@ -29,24 +29,24 @@
#define AI_WEATHER_HAIL 3
// get_how_powerful_move_is
-#define MOVE_POWER_DISCOURAGED 0
+#define MOVE_POWER_OTHER 0
#define MOVE_NOT_MOST_POWERFUL 1
#define MOVE_MOST_POWERFUL 2
// script's table id to bit
-#define AI_SCRIPT_CHECK_BAD_MOVE (1 << 0)
-#define AI_SCRIPT_TRY_TO_FAINT (1 << 1)
-#define AI_SCRIPT_CHECK_VIABILITY (1 << 2)
-#define AI_SCRIPT_SETUP_FIRST_TURN (1 << 3)
-#define AI_SCRIPT_RISKY (1 << 4)
-#define AI_SCRIPT_PREFER_STRONGEST_MOVE (1 << 5)
-#define AI_SCRIPT_PREFER_BATON_PASS (1 << 6)
-#define AI_SCRIPT_DOUBLE_BATTLE (1 << 7)
-#define AI_SCRIPT_HP_AWARE (1 << 8)
-#define AI_SCRIPT_UNKNOWN (1 << 9)
+#define AI_SCRIPT_CHECK_BAD_MOVE (1 << 0)
+#define AI_SCRIPT_TRY_TO_FAINT (1 << 1)
+#define AI_SCRIPT_CHECK_VIABILITY (1 << 2)
+#define AI_SCRIPT_SETUP_FIRST_TURN (1 << 3)
+#define AI_SCRIPT_RISKY (1 << 4)
+#define AI_SCRIPT_PREFER_POWER_EXTREMES (1 << 5)
+#define AI_SCRIPT_PREFER_BATON_PASS (1 << 6)
+#define AI_SCRIPT_DOUBLE_BATTLE (1 << 7)
+#define AI_SCRIPT_HP_AWARE (1 << 8)
+#define AI_SCRIPT_TRY_SUNNY_DAY_START (1 << 9)
// 10 - 28 are not used
-#define AI_SCRIPT_ROAMING (1 << 29)
-#define AI_SCRIPT_SAFARI (1 << 30)
-#define AI_SCRIPT_FIRST_BATTLE (1 << 31)
+#define AI_SCRIPT_ROAMING (1 << 29)
+#define AI_SCRIPT_SAFARI (1 << 30)
+#define AI_SCRIPT_FIRST_BATTLE (1 << 31)
#endif // GUARD_CONSTANTS_BATTLE_AI_H
diff --git a/include/constants/battle_frontier.h b/include/constants/battle_frontier.h
index bbe6db81c..68c5a42ef 100644
--- a/include/constants/battle_frontier.h
+++ b/include/constants/battle_frontier.h
@@ -78,6 +78,21 @@
#define FRONTIER_MANIAC_MESSAGE_COUNT 3
+// Frontier TV Show
+#define FRONTIER_SHOW_TOWER_SINGLES 1
+#define FRONTIER_SHOW_TOWER_DOUBLES 2
+#define FRONTIER_SHOW_TOWER_MULTIS 3
+#define FRONTIER_SHOW_TOWER_LINK_MULTIS 4
+#define FRONTIER_SHOW_DOME_SINGLES 5
+#define FRONTIER_SHOW_DOME_DOUBLES 6
+#define FRONTIER_SHOW_FACTORY_SINGLES 7
+#define FRONTIER_SHOW_FACTORY_DOUBLES 8
+#define FRONTIER_SHOW_PIKE 9
+#define FRONTIER_SHOW_ARENA 10
+#define FRONTIER_SHOW_PALACE_SINGLES 11
+#define FRONTIER_SHOW_PALACE_DOUBLES 12
+#define FRONTIER_SHOW_PYRAMID 13
+
// Frontier Gambler
#define FRONTIER_GAMBLER_WAITING 0
#define FRONTIER_GAMBLER_PLACED_BET 1
diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h
index f22541272..c8d37aac6 100644
--- a/include/constants/battle_string_ids.h
+++ b/include/constants/battle_string_ids.h
@@ -502,7 +502,7 @@
#define B_MSG_TRANSFORMED 0
#define B_MSG_TRANSFORM_FAILED 1
-// gSubsituteUsedStringIds
+// gSubstituteUsedStringIds
#define B_MSG_SET_SUBSTITUTE 0
#define B_MSG_SUBSTITUTE_FAILED 1
diff --git a/include/constants/contest.h b/include/constants/contest.h
index 9eb6b26e4..775dcbe62 100644
--- a/include/constants/contest.h
+++ b/include/constants/contest.h
@@ -4,6 +4,7 @@
#define APPLAUSE_METER_SIZE 5
#define CONTEST_NUM_APPEALS 5
#define CONTEST_LAST_APPEAL (CONTEST_NUM_APPEALS - 1)
+#define MAX_CONTEST_MOVE_HEARTS 8
#define LINK_CONTEST_FLAG_IS_LINK (1 << 0)
#define LINK_CONTEST_FLAG_IS_WIRELESS (1 << 1)
@@ -22,7 +23,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 +33,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 +42,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/constants/easy_chat.h b/include/constants/easy_chat.h
index 069f17fcb..f98cedbb7 100644
--- a/include/constants/easy_chat.h
+++ b/include/constants/easy_chat.h
@@ -9,7 +9,7 @@
#define EASY_CHAT_TYPE_INTERVIEW 5
#define EASY_CHAT_TYPE_BARD_SONG 6
#define EASY_CHAT_TYPE_FAN_CLUB 7
-#define EASY_CHAT_TYPE_UNK_8 8
+#define EASY_CHAT_TYPE_DUMMY_SHOW 8
#define EASY_CHAT_TYPE_TRENDY_PHRASE 9
#define EASY_CHAT_TYPE_GABBY_AND_TY 10
#define EASY_CHAT_TYPE_CONTEST_INTERVIEW 11
diff --git a/include/constants/map_groups.h b/include/constants/map_groups.h
index c650600e8..eaf40a525 100755
--- a/include/constants/map_groups.h
+++ b/include/constants/map_groups.h
@@ -5,7 +5,7 @@
// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json
//
-// Map Group 0
+// gMapGroup_TownsAndRoutes
#define MAP_PETALBURG_CITY (0 | (0 << 8))
#define MAP_SLATEPORT_CITY (1 | (0 << 8))
#define MAP_MAUVILLE_CITY (2 | (0 << 8))
@@ -64,21 +64,21 @@
#define MAP_UNDERWATER_ROUTE105 (55 | (0 << 8))
#define MAP_UNDERWATER_ROUTE125 (56 | (0 << 8))
-// Map Group 1
+// gMapGroup_IndoorLittleroot
#define MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F (0 | (1 << 8))
#define MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_2F (1 | (1 << 8))
#define MAP_LITTLEROOT_TOWN_MAYS_HOUSE_1F (2 | (1 << 8))
#define MAP_LITTLEROOT_TOWN_MAYS_HOUSE_2F (3 | (1 << 8))
#define MAP_LITTLEROOT_TOWN_PROFESSOR_BIRCHS_LAB (4 | (1 << 8))
-// Map Group 2
+// gMapGroup_IndoorOldale
#define MAP_OLDALE_TOWN_HOUSE1 (0 | (2 << 8))
#define MAP_OLDALE_TOWN_HOUSE2 (1 | (2 << 8))
#define MAP_OLDALE_TOWN_POKEMON_CENTER_1F (2 | (2 << 8))
#define MAP_OLDALE_TOWN_POKEMON_CENTER_2F (3 | (2 << 8))
#define MAP_OLDALE_TOWN_MART (4 | (2 << 8))
-// Map Group 3
+// gMapGroup_IndoorDewford
#define MAP_DEWFORD_TOWN_HOUSE1 (0 | (3 << 8))
#define MAP_DEWFORD_TOWN_POKEMON_CENTER_1F (1 | (3 << 8))
#define MAP_DEWFORD_TOWN_POKEMON_CENTER_2F (2 | (3 << 8))
@@ -86,7 +86,7 @@
#define MAP_DEWFORD_TOWN_HALL (4 | (3 << 8))
#define MAP_DEWFORD_TOWN_HOUSE2 (5 | (3 << 8))
-// Map Group 4
+// gMapGroup_IndoorLavaridge
#define MAP_LAVARIDGE_TOWN_HERB_SHOP (0 | (4 << 8))
#define MAP_LAVARIDGE_TOWN_GYM_1F (1 | (4 << 8))
#define MAP_LAVARIDGE_TOWN_GYM_B1F (2 | (4 << 8))
@@ -95,7 +95,7 @@
#define MAP_LAVARIDGE_TOWN_POKEMON_CENTER_1F (5 | (4 << 8))
#define MAP_LAVARIDGE_TOWN_POKEMON_CENTER_2F (6 | (4 << 8))
-// Map Group 5
+// gMapGroup_IndoorFallarbor
#define MAP_FALLARBOR_TOWN_MART (0 | (5 << 8))
#define MAP_FALLARBOR_TOWN_BATTLE_TENT_LOBBY (1 | (5 << 8))
#define MAP_FALLARBOR_TOWN_BATTLE_TENT_CORRIDOR (2 | (5 << 8))
@@ -105,7 +105,7 @@
#define MAP_FALLARBOR_TOWN_COZMOS_HOUSE (6 | (5 << 8))
#define MAP_FALLARBOR_TOWN_MOVE_RELEARNERS_HOUSE (7 | (5 << 8))
-// Map Group 6
+// gMapGroup_IndoorVerdanturf
#define MAP_VERDANTURF_TOWN_BATTLE_TENT_LOBBY (0 | (6 << 8))
#define MAP_VERDANTURF_TOWN_BATTLE_TENT_CORRIDOR (1 | (6 << 8))
#define MAP_VERDANTURF_TOWN_BATTLE_TENT_BATTLE_ROOM (2 | (6 << 8))
@@ -116,7 +116,7 @@
#define MAP_VERDANTURF_TOWN_FRIENDSHIP_RATERS_HOUSE (7 | (6 << 8))
#define MAP_VERDANTURF_TOWN_HOUSE (8 | (6 << 8))
-// Map Group 7
+// gMapGroup_IndoorPacifidlog
#define MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_1F (0 | (7 << 8))
#define MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_2F (1 | (7 << 8))
#define MAP_PACIFIDLOG_TOWN_HOUSE1 (2 | (7 << 8))
@@ -125,7 +125,7 @@
#define MAP_PACIFIDLOG_TOWN_HOUSE4 (5 | (7 << 8))
#define MAP_PACIFIDLOG_TOWN_HOUSE5 (6 | (7 << 8))
-// Map Group 8
+// gMapGroup_IndoorPetalburg
#define MAP_PETALBURG_CITY_WALLYS_HOUSE (0 | (8 << 8))
#define MAP_PETALBURG_CITY_GYM (1 | (8 << 8))
#define MAP_PETALBURG_CITY_HOUSE1 (2 | (8 << 8))
@@ -134,7 +134,7 @@
#define MAP_PETALBURG_CITY_POKEMON_CENTER_2F (5 | (8 << 8))
#define MAP_PETALBURG_CITY_MART (6 | (8 << 8))
-// Map Group 9
+// gMapGroup_IndoorSlateport
#define MAP_SLATEPORT_CITY_STERNS_SHIPYARD_1F (0 | (9 << 8))
#define MAP_SLATEPORT_CITY_STERNS_SHIPYARD_2F (1 | (9 << 8))
#define MAP_SLATEPORT_CITY_BATTLE_TENT_LOBBY (2 | (9 << 8))
@@ -150,7 +150,7 @@
#define MAP_SLATEPORT_CITY_POKEMON_CENTER_2F (12 | (9 << 8))
#define MAP_SLATEPORT_CITY_MART (13 | (9 << 8))
-// Map Group 10
+// gMapGroup_IndoorMauville
#define MAP_MAUVILLE_CITY_GYM (0 | (10 << 8))
#define MAP_MAUVILLE_CITY_BIKE_SHOP (1 | (10 << 8))
#define MAP_MAUVILLE_CITY_HOUSE1 (2 | (10 << 8))
@@ -160,7 +160,7 @@
#define MAP_MAUVILLE_CITY_POKEMON_CENTER_2F (6 | (10 << 8))
#define MAP_MAUVILLE_CITY_MART (7 | (10 << 8))
-// Map Group 11
+// gMapGroup_IndoorRustboro
#define MAP_RUSTBORO_CITY_DEVON_CORP_1F (0 | (11 << 8))
#define MAP_RUSTBORO_CITY_DEVON_CORP_2F (1 | (11 << 8))
#define MAP_RUSTBORO_CITY_DEVON_CORP_3F (2 | (11 << 8))
@@ -179,7 +179,7 @@
#define MAP_RUSTBORO_CITY_FLAT2_3F (15 | (11 << 8))
#define MAP_RUSTBORO_CITY_HOUSE3 (16 | (11 << 8))
-// Map Group 12
+// gMapGroup_IndoorFortree
#define MAP_FORTREE_CITY_HOUSE1 (0 | (12 << 8))
#define MAP_FORTREE_CITY_GYM (1 | (12 << 8))
#define MAP_FORTREE_CITY_POKEMON_CENTER_1F (2 | (12 << 8))
@@ -191,7 +191,7 @@
#define MAP_FORTREE_CITY_HOUSE5 (8 | (12 << 8))
#define MAP_FORTREE_CITY_DECORATION_SHOP (9 | (12 << 8))
-// Map Group 13
+// gMapGroup_IndoorLilycove
#define MAP_LILYCOVE_CITY_COVE_LILY_MOTEL_1F (0 | (13 << 8))
#define MAP_LILYCOVE_CITY_COVE_LILY_MOTEL_2F (1 | (13 << 8))
#define MAP_LILYCOVE_CITY_LILYCOVE_MUSEUM_1F (2 | (13 << 8))
@@ -216,7 +216,7 @@
#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP (21 | (13 << 8))
#define MAP_LILYCOVE_CITY_DEPARTMENT_STORE_ELEVATOR (22 | (13 << 8))
-// Map Group 14
+// gMapGroup_IndoorMossdeep
#define MAP_MOSSDEEP_CITY_GYM (0 | (14 << 8))
#define MAP_MOSSDEEP_CITY_HOUSE1 (1 | (14 << 8))
#define MAP_MOSSDEEP_CITY_HOUSE2 (2 | (14 << 8))
@@ -231,7 +231,7 @@
#define MAP_MOSSDEEP_CITY_GAME_CORNER_1F (11 | (14 << 8))
#define MAP_MOSSDEEP_CITY_GAME_CORNER_B1F (12 | (14 << 8))
-// Map Group 15
+// gMapGroup_IndoorSootopolis
#define MAP_SOOTOPOLIS_CITY_GYM_1F (0 | (15 << 8))
#define MAP_SOOTOPOLIS_CITY_GYM_B1F (1 | (15 << 8))
#define MAP_SOOTOPOLIS_CITY_POKEMON_CENTER_1F (2 | (15 << 8))
@@ -248,7 +248,7 @@
#define MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_1F (13 | (15 << 8))
#define MAP_SOOTOPOLIS_CITY_MYSTERY_EVENTS_HOUSE_B1F (14 | (15 << 8))
-// Map Group 16
+// gMapGroup_IndoorEverGrande
#define MAP_EVER_GRANDE_CITY_SIDNEYS_ROOM (0 | (16 << 8))
#define MAP_EVER_GRANDE_CITY_PHOEBES_ROOM (1 | (16 << 8))
#define MAP_EVER_GRANDE_CITY_GLACIAS_ROOM (2 | (16 << 8))
@@ -265,33 +265,33 @@
#define MAP_EVER_GRANDE_CITY_POKEMON_CENTER_2F (13 | (16 << 8))
#define MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_2F (14 | (16 << 8))
-// Map Group 17
+// gMapGroup_IndoorRoute104
#define MAP_ROUTE104_MR_BRINEYS_HOUSE (0 | (17 << 8))
#define MAP_ROUTE104_PRETTY_PETAL_FLOWER_SHOP (1 | (17 << 8))
-// Map Group 18
+// gMapGroup_IndoorRoute111
#define MAP_ROUTE111_WINSTRATE_FAMILYS_HOUSE (0 | (18 << 8))
#define MAP_ROUTE111_OLD_LADYS_REST_STOP (1 | (18 << 8))
-// Map Group 19
+// gMapGroup_IndoorRoute112
#define MAP_ROUTE112_CABLE_CAR_STATION (0 | (19 << 8))
#define MAP_MT_CHIMNEY_CABLE_CAR_STATION (1 | (19 << 8))
-// Map Group 20
+// gMapGroup_IndoorRoute114
#define MAP_ROUTE114_FOSSIL_MANIACS_HOUSE (0 | (20 << 8))
#define MAP_ROUTE114_FOSSIL_MANIACS_TUNNEL (1 | (20 << 8))
#define MAP_ROUTE114_LANETTES_HOUSE (2 | (20 << 8))
-// Map Group 21
+// gMapGroup_IndoorRoute116
#define MAP_ROUTE116_TUNNELERS_REST_HOUSE (0 | (21 << 8))
-// Map Group 22
+// gMapGroup_IndoorRoute117
#define MAP_ROUTE117_POKEMON_DAY_CARE (0 | (22 << 8))
-// Map Group 23
+// gMapGroup_IndoorRoute121
#define MAP_ROUTE121_SAFARI_ZONE_ENTRANCE (0 | (23 << 8))
-// Map Group 24
+// gMapGroup_Dungeons
#define MAP_METEOR_FALLS_1F_1R (0 | (24 << 8))
#define MAP_METEOR_FALLS_1F_2R (1 | (24 << 8))
#define MAP_METEOR_FALLS_B1F_1R (2 | (24 << 8))
@@ -401,7 +401,7 @@
#define MAP_ALTERING_CAVE (106 | (24 << 8))
#define MAP_METEOR_FALLS_STEVENS_CAVE (107 | (24 << 8))
-// Map Group 25
+// gMapGroup_IndoorDynamic
#define MAP_SECRET_BASE_RED_CAVE1 (0 | (25 << 8))
#define MAP_SECRET_BASE_BROWN_CAVE1 (1 | (25 << 8))
#define MAP_SECRET_BASE_BLUE_CAVE1 (2 | (25 << 8))
@@ -464,7 +464,7 @@
#define MAP_BATTLE_PYRAMID_SQUARE16 (59 | (25 << 8))
#define MAP_UNION_ROOM (60 | (25 << 8))
-// Map Group 26
+// gMapGroup_SpecialArea
#define MAP_SAFARI_ZONE_NORTHWEST (0 | (26 << 8))
#define MAP_SAFARI_ZONE_NORTH (1 | (26 << 8))
#define MAP_SAFARI_ZONE_SOUTHWEST (2 | (26 << 8))
@@ -555,14 +555,14 @@
#define MAP_NAVEL_ROCK_BOTTOM (87 | (26 << 8))
#define MAP_TRAINER_HILL_ELEVATOR (88 | (26 << 8))
-// Map Group 27
+// gMapGroup_IndoorRoute104Prototype
#define MAP_ROUTE104_PROTOTYPE (0 | (27 << 8))
#define MAP_ROUTE104_PROTOTYPE_PRETTY_PETAL_FLOWER_SHOP (1 | (27 << 8))
-// Map Group 28
+// gMapGroup_IndoorRoute109
#define MAP_ROUTE109_SEASHORE_HOUSE (0 | (28 << 8))
-// Map Group 29
+// gMapGroup_IndoorRoute110
#define MAP_ROUTE110_TRICK_HOUSE_ENTRANCE (0 | (29 << 8))
#define MAP_ROUTE110_TRICK_HOUSE_END (1 | (29 << 8))
#define MAP_ROUTE110_TRICK_HOUSE_CORRIDOR (2 | (29 << 8))
@@ -577,18 +577,18 @@
#define MAP_ROUTE110_SEASIDE_CYCLING_ROAD_NORTH_ENTRANCE (11 | (29 << 8))
#define MAP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE (12 | (29 << 8))
-// Map Group 30
+// gMapGroup_IndoorRoute113
#define MAP_ROUTE113_GLASS_WORKSHOP (0 | (30 << 8))
-// Map Group 31
+// gMapGroup_IndoorRoute123
#define MAP_ROUTE123_BERRY_MASTERS_HOUSE (0 | (31 << 8))
-// Map Group 32
+// gMapGroup_IndoorRoute119
#define MAP_ROUTE119_WEATHER_INSTITUTE_1F (0 | (32 << 8))
#define MAP_ROUTE119_WEATHER_INSTITUTE_2F (1 | (32 << 8))
#define MAP_ROUTE119_HOUSE (2 | (32 << 8))
-// Map Group 33
+// gMapGroup_IndoorRoute124
#define MAP_ROUTE124_DIVING_TREASURE_HUNTERS_HOUSE (0 | (33 << 8))
#define MAP_GROUPS_COUNT 34
diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h
index 836ab6ef2..b5ef69046 100644
--- a/include/constants/metatile_labels.h
+++ b/include/constants/metatile_labels.h
@@ -42,6 +42,8 @@
#define METATILE_General_BlueCaveOpen 0x1B1
// gTileset_Building
+#define METATILE_Building_TV_Off 0x002
+#define METATILE_Building_TV_On 0x003
#define METATILE_Building_PC_Off 0x004
#define METATILE_Building_PC_On 0x005
diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h
index 27357e99c..0e802bba8 100644
--- a/include/constants/trainer_hill.h
+++ b/include/constants/trainer_hill.h
@@ -37,8 +37,9 @@
#define TRAINER_HILL_TEXT_PLAYER_WON 4
#define TRAINER_HILL_TEXT_AFTER 5
-#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * 2)
-#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * 2)
+#define TRAINER_HILL_TRAINERS_PER_FLOOR 2
+#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * TRAINER_HILL_TRAINERS_PER_FLOOR)
+#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * TRAINER_HILL_TRAINERS_PER_FLOOR)
// Values returned by TrainerHillGetChallengeStatus
#define TRAINER_HILL_PLAYER_STATUS_LOST 0
diff --git a/include/constants/tv.h b/include/constants/tv.h
index f7b091f49..095a6ddca 100644
--- a/include/constants/tv.h
+++ b/include/constants/tv.h
@@ -6,12 +6,22 @@
#define POKENEWS_GAME_CORNER 2
#define POKENEWS_LILYCOVE 3
#define POKENEWS_BLENDMASTER 4
+#define NUM_POKENEWS_TYPES 4 // Excludes NONE
+
+// TV shows are categorized as being in one of 3 groups
+// - TVGROUP_NORMAL, TV shows that can appear without Record Mixing
+// - TVGROUP_RECORD_MIX, TV shows that can only appear via Record Mixing
+// - TVGROUP_OUTBREAK, just contains TVSHOW_MASS_OUTBREAK
+// Each group was allotted 20 spaces arbitrarily, though none use all 20
#define TVSHOW_OFF_AIR 0
+
+// TVGROUP_NORMAL
+#define TVGROUP_NORMAL_START 1
#define TVSHOW_FAN_CLUB_LETTER 1
#define TVSHOW_RECENT_HAPPENINGS 2
#define TVSHOW_PKMN_FAN_CLUB_OPINIONS 3
-#define TVSHOW_UNKN_SHOWTYPE_04 4
+#define TVSHOW_DUMMY 4
#define TVSHOW_NAME_RATER_SHOW 5
#define TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE 6
#define TVSHOW_BRAVO_TRAINER_BATTLE_TOWER_PROFILE 7
@@ -20,7 +30,11 @@
#define TVSHOW_BATTLE_UPDATE 10
#define TVSHOW_FAN_CLUB_SPECIAL 11
#define TVSHOW_LILYCOVE_CONTEST_LADY 12
-// //
+//
+#define TVGROUP_NORMAL_END 20
+
+// TVGROUP_RECORD_MIX
+#define TVGROUP_RECORD_MIX_START 21
#define TVSHOW_POKEMON_TODAY_CAUGHT 21
#define TVSHOW_SMART_SHOPPER 22
#define TVSHOW_POKEMON_TODAY_FAILED 23
@@ -40,8 +54,22 @@
#define TVSHOW_NUMBER_ONE 37
#define TVSHOW_SECRET_BASE_SECRETS 38
#define TVSHOW_SAFARI_FAN_CLUB 39
-// //
-#define TVSHOW_MASS_OUTBREAK 41
+#define TVGROUP_RECORD_MIX_END 40
+
+// TVGROUP_OUTBREAK
+#define TVGROUP_OUTBREAK_START 41
+#define TVSHOW_MASS_OUTBREAK 41
+//
+#define TVGROUP_OUTBREAK_END 60
+
+// The first 5 elements of gSaveBlock1Ptr->tvShows are reserved
+// for TV shows from TVGROUP_NORMAL. The remainder are for TV
+// shows from TVGROUP_RECORD_MIX.
+#define NUM_NORMAL_TVSHOW_SLOTS 5
+
+#define PLAYERS_HOUSE_TV_NONE 0
+#define PLAYERS_HOUSE_TV_LATI 1
+#define PLAYERS_HOUSE_TV_MOVIE 2
// Number of ribbons to put Spot the Cuties on air
#define NUM_CUTIES_RIBBONS 4
@@ -221,4 +249,21 @@
#define CONTESTLADYLIVE_STATE_LOST 2
#define CONTESTLADYLIVE_STATE_LOST_BADLY 3
+// TV Show states for Smart Shopper
+#define SMARTSHOPPER_STATE_INTRO 0
+#define SMARTSHOPPER_STATE_CLERK_NORMAL 1
+#define SMARTSHOPPER_STATE_RAND_COMMENT_1 2
+#define SMARTSHOPPER_STATE_RAND_COMMENT_2 3
+#define SMARTSHOPPER_STATE_RAND_COMMENT_3 4
+#define SMARTSHOPPER_STATE_RAND_COMMENT_4 5
+#define SMARTSHOPPER_STATE_SECOND_ITEM 6
+#define SMARTSHOPPER_STATE_THIRD_ITEM 7
+#define SMARTSHOPPER_STATE_DURING_SALE 8
+#define SMARTSHOPPER_STATE_OUTRO_NORMAL 9
+#define SMARTSHOPPER_STATE_IS_VIP 10
+#define SMARTSHOPPER_STATE_CLERK_MAX 11
+#define SMARTSHOPPER_STATE_OUTRO_MAX 12
+
+#define SMARTSHOPPER_NUM_ITEMS 3
+
#endif //GUARD_CONSTANTS_TV_H
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/data.h b/include/data.h
index 2f8c44746..f94f55a8f 100644
--- a/include/data.h
+++ b/include/data.h
@@ -5,6 +5,12 @@
#define SPECIES_SHINY_TAG 500
+enum {
+ BATTLER_AFFINE_NORMAL,
+ BATTLER_AFFINE_EMERGE,
+ BATTLER_AFFINE_RETURN,
+};
+
struct MonCoords
{
// This would use a bitfield, but some function
@@ -87,9 +93,9 @@ extern const struct SpriteFrameImage gTrainerBackPicTable_Steven[];
extern const union AffineAnimCmd *const gAffineAnims_BattleSpritePlayerSide[];
extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[];
-extern const union AffineAnimCmd *const gUnknown_082FF6C0[];
+extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteContest[];
-extern const union AnimCmd *const gUnknown_082FF70C[];
+extern const union AnimCmd *const gAnims_MonPic[];
extern const struct MonCoords gMonFrontPicCoords[];
extern const struct CompressedSpriteSheet gMonStillFrontPicTable[];
extern const struct MonCoords gMonBackPicCoords[];
diff --git a/include/daycare.h b/include/daycare.h
index 7d6f2fb19..d6c0d4201 100644
--- a/include/daycare.h
+++ b/include/daycare.h
@@ -6,7 +6,7 @@
u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest);
u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest);
u8 CountPokemonInDaycare(struct DayCare *daycare);
-void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDayCareMail *daycareMail);
+void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *daycareMail);
void StoreSelectedPokemonInDaycare(void);
u16 TakePokemonFromDaycare(void);
void GetDaycareCost(void);
diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h
index 8dc3b907a..064b61ed7 100755
--- a/include/ereader_helpers.h
+++ b/include/ereader_helpers.h
@@ -5,30 +5,30 @@
struct EReaderTrainerHillTrainer
{
- u8 unk0;
- struct TrainerHillTrainer unk4;
- struct TrHillDisplay unk14C;
+ u8 trainerNum;
+ struct TrainerHillTrainer trainer;
+ struct TrHillDisplay display;
u32 checksum;
}; // size=0x274
struct EReaderTrainerHillSet
{
- u8 count;
+ u8 numTrainers;
u8 id;
- u16 dummy;
+ u16 dummy; // Only read in an assert.
u32 checksum;
- struct EReaderTrainerHillTrainer unk_8[6];
+ struct EReaderTrainerHillTrainer trainers[6];
u8 unk_ec0[40];
}; // size = 0xf00
-bool8 EReader_IsReceivedDataValid(struct EReaderTrainerHillSet *buffer);
-bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *arg0);
+bool8 ValidateTrainerHillData(struct EReaderTrainerHillSet *);
+bool32 TryWriteTrainerHill(struct EReaderTrainerHillSet *);
bool32 ReadTrainerHillAndValidate(void);
-int EReaderHandleTransfer(u8, u32, u32*, u32*);
-void sub_81D3F9C(void);
-void sub_81D3FAC(void);
+int EReaderHandleTransfer(u8, size_t, const void *, void *);
+void EReaderHelper_Timer3Callback(void);
+void EReaderHelper_SerialCallback(void);
void EReaderHelper_SaveRegsState(void);
void EReaderHelper_RestoreRegsState(void);
-void sub_81D4238(void);
+void EReaderHelper_ClearSendRecvMgr(void);
#endif // GUARD_EREADER_HELPERS_H
diff --git a/include/event_object_lock.h b/include/event_object_lock.h
index 9d31a25fd..0b1f5f098 100644
--- a/include/event_object_lock.h
+++ b/include/event_object_lock.h
@@ -2,9 +2,9 @@
#define GUARD_EVENT_OBJECT_LOCK_H
bool8 IsFreezePlayerFinished(void);
-void ScriptFreezeObjectEvents(void);
bool8 IsFreezeSelectedObjectAndPlayerFinished(void);
-void LockSelectedObjectEvent(void);
+void FreezeObjects_WaitForPlayer(void);
+void FreezeObjects_WaitForPlayerAndSelected(void);
void FreezeForApproachingTrainers(void);
bool8 IsFreezeObjectAndPlayerFinished(void);
void ScriptUnfreezeObjectEvents(void);
diff --git a/include/event_scripts.h b/include/event_scripts.h
index 925b4389d..3340da6f5 100644
--- a/include/event_scripts.h
+++ b/include/event_scripts.h
@@ -108,19 +108,19 @@ extern const u8 gTVPokemonTodaySuccessfulText08[];
extern const u8 gTVPokemonTodaySuccessfulText09[];
extern const u8 gTVPokemonTodaySuccessfulText10[];
extern const u8 gTVPokemonTodaySuccessfulText11[];
-extern const u8 gTVTodaysSmartShopperText00[];
-extern const u8 gTVTodaysSmartShopperText01[];
-extern const u8 gTVTodaysSmartShopperText02[];
-extern const u8 gTVTodaysSmartShopperText03[];
-extern const u8 gTVTodaysSmartShopperText04[];
-extern const u8 gTVTodaysSmartShopperText05[];
-extern const u8 gTVTodaysSmartShopperText06[];
-extern const u8 gTVTodaysSmartShopperText07[];
-extern const u8 gTVTodaysSmartShopperText08[];
-extern const u8 gTVTodaysSmartShopperText09[];
-extern const u8 gTVTodaysSmartShopperText10[];
-extern const u8 gTVTodaysSmartShopperText11[];
-extern const u8 gTVTodaysSmartShopperText12[];
+extern const u8 SmartShopper_Text_Intro[];
+extern const u8 SmartShopper_Text_ClerkNormal[];
+extern const u8 SmartShopper_Text_RandomComment1[];
+extern const u8 SmartShopper_Text_RandomComment2[];
+extern const u8 SmartShopper_Text_RandomComment3[];
+extern const u8 SmartShopper_Text_RandomComment4[];
+extern const u8 SmartShopper_Text_SecondItem[];
+extern const u8 SmartShopper_Text_ThirdItem[];
+extern const u8 SmartShopper_Text_DuringSale[];
+extern const u8 SmartShopper_Text_OutroNormal[];
+extern const u8 SmartShopper_Text_IsVIP[];
+extern const u8 SmartShopper_Text_ClerkMax[];
+extern const u8 SmartShopper_Text_OutroMax[];
extern const u8 gTVWorldOfMastersText00[];
extern const u8 gTVWorldOfMastersText01[];
extern const u8 gTVWorldOfMastersText02[];
diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h
index 2d0e1bb1c..2ccbb18f5 100644
--- a/include/gba/m4a_internal.h
+++ b/include/gba/m4a_internal.h
@@ -447,7 +447,7 @@ void SetPokemonCryPitch(s16 val);
void SetPokemonCryLength(u16 val);
void SetPokemonCryRelease(u8 val);
void SetPokemonCryProgress(u32 val);
-int IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo);
+bool32 IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo);
void SetPokemonCryChorus(s8 val);
void SetPokemonCryStereo(u32 val);
void SetPokemonCryPriority(u8 val);
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index a3d99ee21..6bafa9747 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -142,19 +142,15 @@ struct MapHeader
/* 0x16 */ u8 weather;
/* 0x17 */ u8 mapType;
/* 0x18 */ u8 filler_18[2];
- /* 0x1A */ u8 flags;
+ // fields correspond to the arguments in the map_header_flags macro
+ /* 0x1A */ bool8 allowCycling:1;
+ bool8 allowEscaping:1; // Escape Rope and Dig
+ bool8 allowRunning:1;
+ bool8 showMapName:5; // the last 4 bits are unused
+ // but the 5 bit sized bitfield is required to match
/* 0x1B */ u8 battleType;
};
-// Flags for gMapHeader.flags, as defined in the map_header_flags macro
-#define MAP_ALLOW_CYCLING (1 << 0)
-#define MAP_ALLOW_ESCAPING (1 << 1) // Escape Rope and Dig
-#define MAP_ALLOW_RUNNING (1 << 2)
-#define MAP_SHOW_MAP_NAME (1 << 3)
-#define UNUSED_MAP_FLAGS (1 << 4 | 1 << 5 | 1 << 6 | 1 << 7)
-
-#define SHOW_MAP_NAME_ENABLED ((gMapHeader.flags & (MAP_SHOW_MAP_NAME | UNUSED_MAP_FLAGS)) == MAP_SHOW_MAP_NAME)
-
struct ObjectEvent
{
diff --git a/include/global.h b/include/global.h
index 19605ca57..e4c11f9ef 100644
--- a/include/global.h
+++ b/include/global.h
@@ -727,7 +727,7 @@ struct ContestWinner
u8 contestRank;
};
-struct DayCareMail
+struct DaycareMail
{
struct MailStruct message;
u8 OT_name[PLAYER_NAME_LENGTH + 1];
@@ -739,7 +739,7 @@ struct DayCareMail
struct DaycareMon
{
struct BoxPokemon mon;
- struct DayCareMail mail;
+ struct DaycareMail mail;
u32 steps;
};
@@ -750,9 +750,9 @@ struct DayCare
u8 stepCounter;
};
-struct RecordMixingDayCareMail
+struct RecordMixingDaycareMail
{
- struct DayCareMail mail[DAYCARE_MON_COUNT];
+ struct DaycareMail mail[DAYCARE_MON_COUNT];
u32 numDaycareMons;
bool16 holdsItem[DAYCARE_MON_COUNT];
};
diff --git a/include/global.tv.h b/include/global.tv.h
index 64e6a984e..2bc7dda99 100644
--- a/include/global.tv.h
+++ b/include/global.tv.h
@@ -1,13 +1,15 @@
#ifndef GUARD_GLOBAL_TV_H
#define GUARD_GLOBAL_TV_H
+#include "constants/tv.h"
+
typedef union // size = 0x24
{
// Common
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
- /*0x02*/ u8 pad02[26];
+ /*0x02*/ u8 data[26];
/*0x1C*/ u8 srcTrainerId3Lo;
/*0x1D*/ u8 srcTrainerId3Hi;
/*0x1E*/ u8 srcTrainerId2Lo;
@@ -22,7 +24,7 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
- /*0x02*/ u8 pad02[34];
+ /*0x02*/ u8 data[34];
} commonInit;
// Local shows
@@ -40,7 +42,7 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
- /*0x02*/ u16 var02;
+ /*0x02*/ u16 species;
/*0x04*/ u16 words[6];
/*0x10*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
/*0x18*/ u8 language;
@@ -62,16 +64,16 @@ typedef union // size = 0x24
/*0x1C*/ u16 words[4];
} fanclubOpinions;
- // TVSHOW_UNKN_SHOWTYPE_04 (dummied out)
+ // TVSHOW_DUMMY
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 words[2];
- /*0x06*/ u16 var06;
+ /*0x06*/ u16 species;
/*0x08*/ u8 pad_08[3];
- /*0x0b*/ u8 string_0b[12];
+ /*0x0b*/ u8 name[12];
/*0x17*/ u8 language;
- } unkShow04;
+ } dummy;
// TVSHOW_NAME_RATER_SHOW
struct {
@@ -212,8 +214,8 @@ typedef union // size = 0x24
/*0x02*/ u8 priceReduced;
/*0x03*/ u8 language;
/*0x04*/ u8 pad04[2];
- /*0x06*/ u16 itemIds[3];
- /*0x0C*/ u16 itemAmounts[3];
+ /*0x06*/ u16 itemIds[SMARTSHOPPER_NUM_ITEMS];
+ /*0x0C*/ u16 itemAmounts[SMARTSHOPPER_NUM_ITEMS];
/*0x12*/ u8 shopLocation;
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} smartshopperShow;
@@ -401,7 +403,7 @@ typedef union // size = 0x24
/*0x08*/ u16 species3;
/*0x0a*/ u16 species4;
/*0x0c*/ u8 language;
- /*0x0d*/ u8 facility;
+ /*0x0d*/ u8 facilityAndMode;
/*0x0e*/ u8 filler_0e[5];
/*0x13*/ u8 playerName[PLAYER_NAME_LENGTH + 1];
} frontier;
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);
diff --git a/include/link.h b/include/link.h
index 3b621e6c1..407dbabb9 100644
--- a/include/link.h
+++ b/include/link.h
@@ -323,7 +323,7 @@ extern bool8 gSavedLinkPlayerCount;
extern u8 gSavedMultiplayerId;
extern struct LinkTestBGInfo gLinkTestBGInfo;
extern void (*gLinkCallback)(void);
-extern bool8 gShouldAdvanceLinkState;
+extern u8 gShouldAdvanceLinkState;
extern u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS];
extern u8 gBlockRequestType;
extern u8 gLastSendQueueCount;
diff --git a/include/list_menu.h b/include/list_menu.h
index 0a54a069a..1c18f3dff 100644
--- a/include/list_menu.h
+++ b/include/list_menu.h
@@ -31,7 +31,7 @@ struct ListMenuTemplate
{
const struct ListMenuItem *items;
void (* moveCursorFunc)(s32 itemIndex, bool8 onInit, struct ListMenu *list);
- void (* itemPrintFunc)(u8 windowId, s32 itemId, u8 y);
+ void (* itemPrintFunc)(u8 windowId, u32 itemId, u8 y);
u16 totalItems;
u16 maxShowed;
u8 windowId;
diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h
index 29c66a992..603d585da 100644
--- a/include/mauville_old_man.h
+++ b/include/mauville_old_man.h
@@ -7,7 +7,7 @@ void SetMauvilleOldMan(void);
u8 GetCurrentMauvilleOldMan(void);
void ScrSpecial_SetMauvilleOldManObjEventGfx(void);
u8 sub_81201C8(void);
-void sub_8120B70(OldMan *dest);
+void SanitizeMauvilleOldManForRuby(OldMan *dest);
void sub_8120670(void);
void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 r1, u32 r6);
void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 unused, u32 a2);
diff --git a/include/menu.h b/include/menu.h
index c9d8e374d..07e00eb73 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -90,8 +90,8 @@ void *malloc_and_decompress(const void *src, u32 *sizeOut);
u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode);
void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress);
void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8);
-void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8);
-u8 sub_8199944(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos);
+void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8);
+u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos);
u8 ChangeListMenuCursorPosition(s8 deltaX, s8 deltaY);
u8 GetStartMenuWindowId(void);
void ListMenuLoadStdPalAt(u8, u8);
diff --git a/include/menu_helpers.h b/include/menu_helpers.h
index c4401354b..9909437a2 100644
--- a/include/menu_helpers.h
+++ b/include/menu_helpers.h
@@ -29,7 +29,7 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1);
u8 GetLRKeysPressed(void);
u8 GetLRKeysPressedAndHeld(void);
bool8 sub_8122148(u16 itemId);
-bool8 itemid_80BF6D8_mail_related(u16 itemId);
+bool8 IsWritingMailAllowed(u16 itemId);
bool8 MenuHelpers_LinkSomething(void);
bool8 MenuHelpers_CallLinkSomething(void);
void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, u8 maxUsedSlotsCount);
diff --git a/include/pokemon.h b/include/pokemon.h
index 82cdefeac..3565bd966 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -258,7 +258,6 @@ extern const u8 gFacilityClassToPicIndex[];
extern const u8 gFacilityClassToTrainerClass[];
extern const struct BaseStats gBaseStats[];
extern const u8 *const gItemEffectTable[];
-extern const struct Evolution gEvolutionTable[][EVOS_PER_MON];
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
extern const u16 *const gLevelUpLearnsets[];
extern const u8 gPPUpGetMask[];
diff --git a/include/region_map.h b/include/region_map.h
index 97364abd8..02d711afa 100644
--- a/include/region_map.h
+++ b/include/region_map.h
@@ -111,7 +111,7 @@ void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y);
void CB2_OpenFlyMap(void);
bool8 IsRegionMapZoomed(void);
void TrySetPlayerIconBlink(void);
-void sub_8123030(u16 color, u32 coeff);
+void BlendRegionMap(u16 color, u32 coeff);
void SetRegionMapDataForZoom(void);
extern const struct RegionMapLocation gRegionMapEntries[];
diff --git a/include/strings.h b/include/strings.h
index 8880f3a5c..9b3be0538 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -596,7 +596,7 @@ extern const u8 gText_TooImportantToToss[];
extern const u8 gText_ConfirmTossItems[];
extern const u8 gText_MoveVar1Where[];
-extern const u8 gText_ColorLightShadowDarkGrey[];
+extern const u8 gText_ColorLightShadowDarkGray[];
extern const u8 gText_ColorBlue[];
extern const u8 gText_Friend[];
extern const u8 gText_Tristan[];
@@ -982,7 +982,8 @@ extern const u8 gText_RibbonsVar1[];
extern const u8 gText_OneDash[];
extern const u8 gText_TwoDashes[];
-extern const u8 *const gReturnToXStringsTable2[];
+extern const u8 *const gBagMenu_ReturnToStrings[];
+extern const u8 *const gPyramidBagMenu_ReturnToStrings[];
extern const u8 gText_NumPlayerLink[];
extern const u8 gText_ConfirmLinkWhenPlayersReady[];
@@ -2511,7 +2512,7 @@ extern const u8 gText_MatchCallMay_Intro1[];
extern const u8 gText_MatchCallMay_Intro2[];
// Contest Link
-extern const u8 gText_ColorDarkGrey[];
+extern const u8 gText_ColorDarkGray[];
extern const u8 gText_CommunicationStandby[];
extern const u8 gText_AnnouncingResults[];
extern const u8 gText_PreliminaryResults[];
diff --git a/include/tv.h b/include/tv.h
index f94c5b7e5..30cd13326 100644
--- a/include/tv.h
+++ b/include/tv.h
@@ -1,13 +1,10 @@
#ifndef GUARD_TV_H
#define GUARD_TV_H
-#define SLOT_MACHINE 0
-#define ROULETTE 1
-
extern u8 *const gTVStringVarPtrs[3];
void ClearTVShowData(void);
-void sub_80EE184(void);
+void TryPutBreakingNewsOnAir(void);
void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove);
void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility);
void DoTVShow(void);
@@ -23,41 +20,37 @@ void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx);
void TryPutSpotTheCutiesOnAir(struct Pokemon *pokemon, u8 ribbonMonDataIdx);
u32 GetPlayerIDAsU32(void);
bool8 GetPriceReduction(u8 newsKind);
-void sub_80F14F8(TVShow *shows);
+void SanitizeTVShowLocationsForRuby(TVShow *shows);
size_t CountDigits(int value);
u8 GetRibbonCount(struct Pokemon *pokemon);
void AlertTVThatPlayerPlayedSlotMachine(u16 nCoinsSpent);
void AlertTVThatPlayerPlayedRoulette(u16 nCoinsSpent);
-void AlertTVOfNewCoinTotal(u16 nCoinsPaidOut);
+void TryPutFindThatGamerOnAir(u16 nCoinsPaidOut);
void TryPutSecretBaseSecretsOnAir(void);
void TryPutTodaysRivalTrainerOnAir(void);
void TryPutTrendWatcherOnAir(const u16 *words);
-void sub_80EDA80(void);
void ReceivePokeNewsData(void *src, u32 size, u8 masterIdx);
-void sub_80F0BB8(void);
+void DeactivateAllNormalTVShows(void);
void RecordFishingAttemptForTV(bool8 caughtFish);
void IncrementDailySlotsUses(void);
void IncrementDailyRouletteUses(void);
void IncrementDailyWildBattles(void);
void IncrementDailyBerryBlender(void);
-void sub_80F1208(TVShow *shows);
-void sub_80EE44C(u8 nMonsCaught, u8 nPkblkUsed);
-void sub_80F14F8(TVShow *shows);
-size_t sub_80EF370(int value);
+void SanitizeTVShowsForRuby(TVShow *shows);
+void TryPutSafariFanClubOnAir(u8 nMonsCaught, u8 nPkblkUsed);
bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language);
void SetPokemonAnglerSpecies(u16 species);
void UpdateTVShowsPerDay(u16 days);
-void PutPokemonTodayCaughtOnAir(void);
-void TV_PutSecretBaseVisitOnTheAir(void);
+void TryPutPokemonTodayOnAir(void);
+void TryPutSecretBaseVisitOnAir(void);
void PutBattleUpdateOnTheAir(u8 opponentLinkPlayerId, u16 move, u16 speciesPlayer, u16 speciesOpponent);
void BravoTrainerPokemonProfile_BeforeInterview1(u16 move);
void InterviewBefore(void);
void InterviewAfter(void);
void UpdateTVScreensOnMap(int, int);
-void TV_PrintIntToStringVar(u8 varIdx, int value);
-void SaveRecordedItemPurchasesForTVShow(void);
+void ConvertIntToDecimalString(u8 varIdx, int value);
+void TryPutSmartShopperOnAir(void);
bool8 ShouldAirFrontierTVShow(void);
-void sub_80EE8C8(u16 winStreak, u8 facilityAndMode);
void BravoTrainerPokemonProfile_BeforeInterview2(u8 contestStandingPlace);
void ContestLiveUpdates_Init(u8 round1Placing);
void ContestLiveUpdates_SetRound2Placing(u8 round2Placing);
@@ -65,5 +58,8 @@ void ContestLiveUpdates_SetWinnerAppealFlag(u8 flag);
void ContestLiveUpdates_SetWinnerMoveUsed(u16 move);
void ContestLiveUpdates_SetLoserData(u8 flag, u8 loser);
void ResetGabbyAndTy(void);
+u8 CheckForPlayersHouseNews(void);
+bool8 IsGabbyAndTyShowOnTheAir(void);
+void TryPutTrainerFanClubOnAir(void);
#endif //GUARD_TV_H