summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCameron Hall <camthesaxman@users.noreply.github.com>2017-12-11 12:45:08 -0600
committerGitHub <noreply@github.com>2017-12-11 12:45:08 -0600
commitc9f196cdfea08eefffd39ebc77a150f197e1250e (patch)
treeaf62f4a34588c3ad679249cfed757ac2a8eb075a /src
parent00896cb3b5813cb843e5e1abd4cbc9ff0ad3a632 (diff)
parent9525fdd54de805e8b45e23df6a57074e077c175d (diff)
Merge pull request #137 from camthesaxman/constants_headers
move constants to C headers
Diffstat (limited to 'src')
-rw-r--r--src/battle_2.c14
-rw-r--r--src/battle_ai_script_commands.c8
-rw-r--r--src/battle_ai_switch_items.c8
-rw-r--r--src/battle_controller_link_opponent.c2
-rw-r--r--src/battle_controller_link_partner.c2
-rw-r--r--src/battle_controller_opponent.c6
-rw-r--r--src/battle_controller_player.c6
-rw-r--r--src/battle_controller_player_partner.c2
-rw-r--r--src/battle_controller_recorded_opponent.c2
-rw-r--r--src/battle_controller_recorded_player.c2
-rw-r--r--src/battle_controller_safari.c2
-rw-r--r--src/battle_controller_wally.c6
-rw-r--r--src/battle_controllers.c4
-rw-r--r--src/battle_dome_cards.c2
-rw-r--r--src/battle_gfx_sfx_util.c6
-rw-r--r--src/battle_interface.c4
-rw-r--r--src/battle_message.c4
-rw-r--r--src/battle_script_commands.c14
-rw-r--r--src/battle_util.c12
-rw-r--r--src/battle_util2.c2
-rw-r--r--src/berry.c2
-rw-r--r--src/berry_blender.c10
-rwxr-xr-xsrc/braille_puzzles.c6
-rw-r--r--src/calculate_base_damage.c12
-rwxr-xr-xsrc/clear_save_data_screen.c2
-rw-r--r--src/daycare.c6
-rw-r--r--src/decompress.c2
-rw-r--r--src/decoration.c5
-rw-r--r--src/decoration_inventory.c1
-rw-r--r--src/egg_hatch.c6
-rw-r--r--src/event_data.c2
-rw-r--r--src/evolution_graphics.c2
-rw-r--r--src/evolution_scene.c5
-rw-r--r--src/field_poison.c2
-rwxr-xr-xsrc/field_special_scene.c4
-rw-r--r--src/hall_of_fame.c8
-rw-r--r--src/heal_location.c4
-rw-r--r--src/item.c2
-rw-r--r--src/lilycove_lady.c2
-rw-r--r--src/lottery_corner.c4
-rw-r--r--src/mail.c3
-rw-r--r--src/pokeball.c4
-rw-r--r--src/pokemon_1.c2
-rw-r--r--src/pokemon_2.c2
-rw-r--r--src/pokemon_3.c10
-rw-r--r--src/pokemon_size_record.c2
-rw-r--r--src/pokemon_storage_system.c2
-rwxr-xr-xsrc/pokemon_summary_screen.c8
-rw-r--r--src/region_map.c114
-rw-r--r--src/reshow_battle_screen.c2
-rw-r--r--src/roamer.c2
-rw-r--r--src/safari_zone.c2
-rw-r--r--src/save.c2
-rwxr-xr-xsrc/save_location.c83
-rw-r--r--src/secret_base.c57
-rw-r--r--src/sound.c2
-rw-r--r--src/starter_choose.c2
-rw-r--r--src/tv.c33
-rw-r--r--src/wild_encounter.c23
59 files changed, 281 insertions, 269 deletions
diff --git a/src/battle_2.c b/src/battle_2.c
index 006a5e467..52530f6b3 100644
--- a/src/battle_2.c
+++ b/src/battle_2.c
@@ -11,12 +11,12 @@
#include "palette.h"
#include "task.h"
#include "event_data.h"
-#include "species.h"
+#include "constants/species.h"
#include "berry.h"
#include "text.h"
#include "item.h"
-#include "items.h"
-#include "hold_effects.h"
+#include "constants/items.h"
+#include "constants/hold_effects.h"
#include "link.h"
#include "bg.h"
#include "dma3.h"
@@ -26,18 +26,18 @@
#include "m4a.h"
#include "window.h"
#include "random.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "battle_message.h"
#include "sprite.h"
#include "util.h"
#include "trig.h"
#include "battle_ai_script_commands.h"
-#include "battle_move_effects.h"
+#include "constants/battle_move_effects.h"
#include "battle_controllers.h"
#include "pokedex.h"
-#include "abilities.h"
-#include "moves.h"
+#include "constants/abilities.h"
+#include "constants/moves.h"
#include "trainer_classes.h"
#include "evolution_scene.h"
#include "roamer.h"
diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c
index ced8ba45f..44be0a4d9 100644
--- a/src/battle_ai_script_commands.c
+++ b/src/battle_ai_script_commands.c
@@ -2,12 +2,12 @@
#include "battle_ai_script_commands.h"
#include "pokemon.h"
#include "battle.h"
-#include "species.h"
-#include "abilities.h"
+#include "constants/species.h"
+#include "constants/abilities.h"
#include "random.h"
#include "item.h"
-#include "battle_move_effects.h"
-#include "moves.h"
+#include "constants/battle_move_effects.h"
+#include "constants/moves.h"
#include "util.h"
#define AIScriptRead32(ptr) ((ptr)[0] | (ptr)[1] << 8 | (ptr)[2] << 16 | (ptr)[3] << 24)
diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c
index 661fe0637..b3fccb17f 100644
--- a/src/battle_ai_switch_items.c
+++ b/src/battle_ai_switch_items.c
@@ -1,13 +1,13 @@
#include "global.h"
#include "battle.h"
#include "battle_controllers.h"
-#include "abilities.h"
-#include "moves.h"
+#include "constants/abilities.h"
+#include "constants/moves.h"
#include "pokemon.h"
-#include "species.h"
+#include "constants/species.h"
#include "random.h"
#include "util.h"
-#include "items.h"
+#include "constants/items.h"
#include "pokemon_item_effects.h"
extern u8 gActiveBank;
diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c
index 4795d2bd4..dd8582618 100644
--- a/src/battle_controller_link_opponent.c
+++ b/src/battle_controller_link_opponent.c
@@ -10,7 +10,7 @@
#include "link.h"
#include "util.h"
#include "main.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "window.h"
#include "m4a.h"
diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c
index fde364a55..9da468761 100644
--- a/src/battle_controller_link_partner.c
+++ b/src/battle_controller_link_partner.c
@@ -10,7 +10,7 @@
#include "link.h"
#include "util.h"
#include "main.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "window.h"
#include "m4a.h"
diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c
index 41458c023..0862e72a7 100644
--- a/src/battle_controller_opponent.c
+++ b/src/battle_controller_opponent.c
@@ -11,10 +11,10 @@
#include "util.h"
#include "main.h"
#include "item.h"
-#include "items.h"
-#include "songs.h"
+#include "constants/items.h"
+#include "constants/songs.h"
#include "sound.h"
-#include "moves.h"
+#include "constants/moves.h"
#include "window.h"
#include "m4a.h"
#include "palette.h"
diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c
index 9689d3719..e497dbfe2 100644
--- a/src/battle_controller_player.c
+++ b/src/battle_controller_player.c
@@ -10,10 +10,10 @@
#include "util.h"
#include "main.h"
#include "item.h"
-#include "items.h"
-#include "songs.h"
+#include "constants/items.h"
+#include "constants/songs.h"
#include "sound.h"
-#include "moves.h"
+#include "constants/moves.h"
#include "window.h"
#include "m4a.h"
#include "palette.h"
diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c
index 3ce12fac7..eb57297da 100644
--- a/src/battle_controller_player_partner.c
+++ b/src/battle_controller_player_partner.c
@@ -9,7 +9,7 @@
#include "link.h"
#include "util.h"
#include "main.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "window.h"
#include "m4a.h"
diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c
index a57b2c576..8e2f31879 100644
--- a/src/battle_controller_recorded_opponent.c
+++ b/src/battle_controller_recorded_opponent.c
@@ -11,7 +11,7 @@
#include "link.h"
#include "util.h"
#include "main.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "window.h"
#include "m4a.h"
diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c
index 86558d25c..f558fde87 100644
--- a/src/battle_controller_recorded_player.c
+++ b/src/battle_controller_recorded_player.c
@@ -10,7 +10,7 @@
#include "link.h"
#include "util.h"
#include "main.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "window.h"
#include "m4a.h"
diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c
index 2ec14cab5..db4670523 100644
--- a/src/battle_controller_safari.c
+++ b/src/battle_controller_safari.c
@@ -8,7 +8,7 @@
#include "link.h"
#include "util.h"
#include "main.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "window.h"
#include "m4a.h"
diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c
index 3b7e3e4af..446027944 100644
--- a/src/battle_controller_wally.c
+++ b/src/battle_controller_wally.c
@@ -10,10 +10,10 @@
#include "util.h"
#include "main.h"
#include "item.h"
-#include "items.h"
-#include "songs.h"
+#include "constants/items.h"
+#include "constants/songs.h"
#include "sound.h"
-#include "moves.h"
+#include "constants/moves.h"
#include "window.h"
#include "m4a.h"
#include "palette.h"
diff --git a/src/battle_controllers.c b/src/battle_controllers.c
index 2d373e876..c6d47e71e 100644
--- a/src/battle_controllers.c
+++ b/src/battle_controllers.c
@@ -6,10 +6,10 @@
#include "battle_ai_script_commands.h"
#include "battle_anim.h"
#include "pokemon.h"
-#include "species.h"
+#include "constants/species.h"
#include "recorded_battle.h"
#include "util.h"
-#include "abilities.h"
+#include "constants/abilities.h"
#include "battle_message.h"
extern u32 gBattleTypeFlags;
diff --git a/src/battle_dome_cards.c b/src/battle_dome_cards.c
index 9385417b4..d549856f2 100644
--- a/src/battle_dome_cards.c
+++ b/src/battle_dome_cards.c
@@ -4,7 +4,7 @@
#include "sprite.h"
#include "window.h"
#include "malloc.h"
-#include "species.h"
+#include "constants/species.h"
#include "palette.h"
#include "decompress.h"
#include "battle_dome_cards.h"
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c
index e9b31ae55..22be086f0 100644
--- a/src/battle_gfx_sfx_util.c
+++ b/src/battle_gfx_sfx_util.c
@@ -9,18 +9,18 @@
#include "random.h"
#include "util.h"
#include "pokemon.h"
-#include "moves.h"
+#include "constants/moves.h"
#include "task.h"
#include "sprite.h"
#include "sound.h"
#include "m4a.h"
-#include "species.h"
+#include "constants/species.h"
#include "decompress.h"
#include "data2.h"
#include "palette.h"
#include "blend_palette.h"
#include "contest.h"
-#include "songs.h"
+#include "constants/songs.h"
extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200];
extern u8 gActiveBank;
diff --git a/src/battle_interface.c b/src/battle_interface.c
index 63813a424..95f1a1111 100644
--- a/src/battle_interface.c
+++ b/src/battle_interface.c
@@ -8,13 +8,13 @@
#include "string_util.h"
#include "text.h"
#include "sound.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "decompress.h"
#include "task.h"
#include "util.h"
#include "gpu_regs.h"
#include "battle_message.h"
-#include "species.h"
+#include "constants/species.h"
#include "pokedex.h"
#include "palette.h"
#include "international_string_util.h"
diff --git a/src/battle_message.c b/src/battle_message.c
index cf5a55140..ec1cfd626 100644
--- a/src/battle_message.c
+++ b/src/battle_message.c
@@ -2,10 +2,10 @@
#include "battle.h"
#include "battle_message.h"
#include "battle_string_ids.h"
-#include "moves.h"
+#include "constants/moves.h"
#include "text.h"
#include "string_util.h"
-#include "items.h"
+#include "constants/items.h"
#include "event_data.h"
#include "link.h"
#include "item.h"
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c
index a9578395d..88d583c1f 100644
--- a/src/battle_script_commands.c
+++ b/src/battle_script_commands.c
@@ -1,22 +1,22 @@
#include "global.h"
#include "battle.h"
-#include "battle_move_effects.h"
+#include "constants/battle_move_effects.h"
#include "battle_message.h"
#include "battle_ai_script_commands.h"
#include "battle_scripts.h"
-#include "moves.h"
-#include "abilities.h"
+#include "constants/moves.h"
+#include "constants/abilities.h"
#include "item.h"
-#include "items.h"
-#include "hold_effects.h"
+#include "constants/items.h"
+#include "constants/hold_effects.h"
#include "util.h"
#include "pokemon.h"
#include "calculate_base_damage.h"
#include "random.h"
#include "battle_controllers.h"
#include "battle_interface.h"
-#include "species.h"
-#include "songs.h"
+#include "constants/species.h"
+#include "constants/songs.h"
#include "text.h"
#include "sound.h"
#include "pokedex.h"
diff --git a/src/battle_util.c b/src/battle_util.c
index e67d22d64..1a624641d 100644
--- a/src/battle_util.c
+++ b/src/battle_util.c
@@ -1,14 +1,14 @@
#include "global.h"
#include "battle.h"
-#include "abilities.h"
-#include "moves.h"
-#include "hold_effects.h"
+#include "constants/abilities.h"
+#include "constants/moves.h"
+#include "constants/hold_effects.h"
#include "pokemon.h"
-#include "species.h"
+#include "constants/species.h"
#include "item.h"
-#include "items.h"
+#include "constants/items.h"
#include "util.h"
-#include "battle_move_effects.h"
+#include "constants/battle_move_effects.h"
#include "battle_scripts.h"
#include "random.h"
#include "text.h"
diff --git a/src/battle_util2.c b/src/battle_util2.c
index 351bdff1d..538c1c641 100644
--- a/src/battle_util2.c
+++ b/src/battle_util2.c
@@ -4,7 +4,7 @@
#include "malloc.h"
#include "pokemon.h"
#include "event_data.h"
-#include "abilities.h"
+#include "constants/abilities.h"
#include "random.h"
#include "battle_scripts.h"
diff --git a/src/berry.c b/src/berry.c
index 5d833fb06..74b7090c0 100644
--- a/src/berry.c
+++ b/src/berry.c
@@ -2,7 +2,7 @@
#include "berry.h"
#include "main.h"
#include "item.h"
-#include "items.h"
+#include "constants/items.h"
#include "text.h"
#include "random.h"
#include "event_data.h"
diff --git a/src/berry_blender.c b/src/berry_blender.c
index 7c90391fa..b1d36e2d9 100644
--- a/src/berry_blender.c
+++ b/src/berry_blender.c
@@ -1,11 +1,13 @@
#include "global.h"
+#include "constants/game_stat.h"
+#include "overworld.h"
#include "berry_blender.h"
#include "bg.h"
#include "window.h"
#include "task.h"
#include "sprite.h"
#include "sound.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "m4a.h"
#include "bg.h"
#include "palette.h"
@@ -20,7 +22,7 @@
#include "item_menu_icons.h"
#include "berry.h"
#include "item.h"
-#include "items.h"
+#include "constants/items.h"
#include "string_util.h"
#include "international_string_util.h"
#include "random.h"
@@ -1066,7 +1068,7 @@ static void Blender_SetPlayerNamesLocal(u8 opponentsNum)
sBerryBlenderData->playersNo = 2;
StringCopy(gLinkPlayers[0].name, gSaveBlock2Ptr->playerName);
- if (!FlagGet(FLAG_340))
+ if (!FlagGet(FLAG_0x340))
StringCopy(gLinkPlayers[1].name, sBlenderOpponentsNames[BLENDER_MASTER]);
else
StringCopy(gLinkPlayers[1].name, sBlenderOpponentsNames[BLENDER_MISTER]);
@@ -1590,7 +1592,7 @@ static void sub_80808D4(void)
if (gSpecialVar_0x8004 == 1)
{
- if (!FlagGet(FLAG_340))
+ if (!FlagGet(FLAG_0x340))
sBerryBlenderData->field_120[0] = CreateTask(sub_8081224, 10);
else
sBerryBlenderData->field_120[0] = CreateTask(sUnknown_083399EC[0], 10);
diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c
index 85b2bc509..d6924de9f 100755
--- a/src/braille_puzzles.c
+++ b/src/braille_puzzles.c
@@ -1,12 +1,12 @@
#include "global.h"
#include "event_data.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "script.h"
-#include "species.h"
+#include "constants/species.h"
#include "task.h"
#include "field_effect.h"
-#include "flags.h"
+#include "constants/flags.h"
extern void MapGridSetMetatileIdAt(s32 x, s32 y, u16 metatileId); // fieldmap
extern void DrawWholeMapView(); // field_camera
diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c
index 89770b17a..d30599607 100644
--- a/src/calculate_base_damage.c
+++ b/src/calculate_base_damage.c
@@ -1,14 +1,14 @@
#include "global.h"
-#include "abilities.h"
+#include "constants/abilities.h"
#include "battle.h"
-#include "hold_effects.h"
+#include "constants/hold_effects.h"
#include "event_data.h"
#include "item.h"
-#include "items.h"
+#include "constants/items.h"
#include "pokemon.h"
-#include "species.h"
-#include "moves.h"
-#include "battle_move_effects.h"
+#include "constants/species.h"
+#include "constants/moves.h"
+#include "constants/battle_move_effects.h"
extern u32 gBattleTypeFlags;
extern struct BattlePokemon gBattleMons[4];
diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c
index d5e173ee8..d00944ac1 100755
--- a/src/clear_save_data_screen.c
+++ b/src/clear_save_data_screen.c
@@ -9,7 +9,7 @@
#include "gpu_regs.h"
#include "bg.h"
#include "text_window.h"
-#include "songs.h"
+#include "constants/songs.h"
extern u8 gText_ClearAllSaveData[];
extern u8 gText_ClearingData[];
diff --git a/src/daycare.c b/src/daycare.c
index 1c0548058..ce9952531 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -2,14 +2,14 @@
#include "pokemon.h"
#include "daycare.h"
#include "string_util.h"
-#include "species.h"
-#include "items.h"
+#include "constants/species.h"
+#include "constants/items.h"
#include "mail.h"
#include "pokemon_storage_system.h"
#include "event_data.h"
#include "random.h"
#include "main.h"
-#include "moves.h"
+#include "constants/moves.h"
#include "egg_hatch.h"
#include "text.h"
#include "menu.h"
diff --git a/src/decompress.c b/src/decompress.c
index e2ae6ce83..8e8827194 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -1,6 +1,6 @@
#include "global.h"
#include "decompress.h"
-#include "species.h"
+#include "constants/species.h"
#include "text.h"
#include "malloc.h"
#include "pokemon.h"
diff --git a/src/decoration.c b/src/decoration.c
index e4c84d0b9..987e628c5 100644
--- a/src/decoration.c
+++ b/src/decoration.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "constants/decorations.h"
#include "decompress.h"
#include "malloc.h"
#include "text.h"
@@ -8,7 +9,7 @@
#include "task.h"
#include "main.h"
#include "palette.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "overworld.h"
#include "fieldmap.h"
#include "metatile_behavior.h"
@@ -32,7 +33,7 @@
#include "tilesets.h"
#include "item_icon.h"
#include "trader.h"
-#include "map_object_constants.h"
+#include "constants/map_objects.h"
#include "decoration_inventory.h"
#include "decoration.h"
#include "graphics.h"
diff --git a/src/decoration_inventory.c b/src/decoration_inventory.c
index 03ab6c00c..308320206 100644
--- a/src/decoration_inventory.c
+++ b/src/decoration_inventory.c
@@ -1,6 +1,7 @@
// Includes
#include "global.h"
+#include "constants/decorations.h"
#include "decoration.h"
#include "decoration_inventory.h"
diff --git a/src/egg_hatch.c b/src/egg_hatch.c
index 3be64b37d..032607806 100644
--- a/src/egg_hatch.c
+++ b/src/egg_hatch.c
@@ -2,7 +2,7 @@
#include "pokemon.h"
#include "egg_hatch.h"
#include "pokedex.h"
-#include "items.h"
+#include "constants/items.h"
#include "script.h"
#include "decompress.h"
#include "task.h"
@@ -10,7 +10,7 @@
#include "main.h"
#include "event_data.h"
#include "sound.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "text.h"
#include "text_window.h"
#include "string_util.h"
@@ -23,7 +23,7 @@
#include "bg.h"
#include "m4a.h"
#include "window.h"
-#include "abilities.h"
+#include "constants/abilities.h"
#include "daycare.h"
#include "battle.h" // to get rid of later
diff --git a/src/event_data.c b/src/event_data.c
index e3742a147..9f1432f17 100644
--- a/src/event_data.c
+++ b/src/event_data.c
@@ -44,7 +44,7 @@ void ClearTempFieldEventData(void)
FlagClear(FLAG_SYS_ENC_DOWN_ITEM);
FlagClear(FLAG_SYS_USE_STRENGTH);
FlagClear(FLAG_SYS_CTRL_OBJ_DELETE);
- FlagClear(FLAG_SYS_UNKNOWN_880);
+ FlagClear(FLAG_0x880);
}
// probably had different flag splits at one point.
diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c
index 30aacec94..8d02eef91 100644
--- a/src/evolution_graphics.c
+++ b/src/evolution_graphics.c
@@ -6,7 +6,7 @@
#include "decompress.h"
#include "task.h"
#include "sound.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "palette.h"
// this file's functions
diff --git a/src/evolution_scene.c b/src/evolution_scene.c
index 452035b54..c17921b74 100644
--- a/src/evolution_scene.c
+++ b/src/evolution_scene.c
@@ -16,9 +16,9 @@
#include "m4a.h"
#include "menu.h"
#include "pokedex.h"
-#include "species.h"
+#include "constants/species.h"
#include "sound.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "overworld.h"
#include "battle_message.h"
#include "battle_string_ids.h"
@@ -52,6 +52,7 @@ extern u8 gBattleTerrain;
extern struct SpriteTemplate gUnknown_0202499C;
extern bool8 gAffineAnimsDisabled;
extern u16 gMoveToLearn;
+extern const u8 gSpeciesNames[][11];
extern u8 gBattleCommunication[];
#define sEvoCursorPos gBattleCommunication[1] // when learning a new move
diff --git a/src/field_poison.c b/src/field_poison.c
index d953ab29c..b83788210 100644
--- a/src/field_poison.c
+++ b/src/field_poison.c
@@ -1,7 +1,7 @@
#include "global.h"
#include "string_util.h"
#include "party_menu.h"
-#include "species.h"
+#include "constants/species.h"
#include "task.h"
#include "field_message_box.h"
#include "strings.h"
diff --git a/src/field_special_scene.c b/src/field_special_scene.c
index f92f342eb..d46ddeaa6 100755
--- a/src/field_special_scene.c
+++ b/src/field_special_scene.c
@@ -2,11 +2,11 @@
#include "task.h"
#include "sprite.h"
#include "field_map_obj.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "palette.h"
#include "script.h"
-#include "vars.h"
+#include "constants/vars.h"
#include "event_data.h"
#include "main.h"
diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c
index 9b421872c..52babe346 100644
--- a/src/hall_of_fame.c
+++ b/src/hall_of_fame.c
@@ -9,13 +9,13 @@
#include "gpu_regs.h"
#include "main.h"
#include "sound.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "decompress.h"
#include "save.h"
#include "window.h"
#include "bg.h"
-#include "species.h"
-#include "game_stat.h"
+#include "constants/species.h"
+#include "constants/game_stat.h"
#include "blend_palette.h"
#include "string_util.h"
#include "m4a.h"
@@ -24,6 +24,7 @@
#include "trig.h"
#include "random.h"
#include "event_data.h"
+#include "overworld.h"
struct HallofFameMon
{
@@ -57,6 +58,7 @@ extern struct MusicPlayerInfo gMPlay_BGM;
extern MainCallback gGameContinueCallback;
extern u32 gDamagedSaveSectors;
extern u8 gReservedSpritePaletteCount;
+extern const u8 gSpeciesNames[][11];
#define HALL_OF_FAME_MAX_TEAMS 50
diff --git a/src/heal_location.c b/src/heal_location.c
index efc534170..aa90fe1ae 100644
--- a/src/heal_location.c
+++ b/src/heal_location.c
@@ -1,10 +1,10 @@
// Includes
#include "global.h"
-#include "map_constants.h"
+#include "constants/maps.h"
#include "heal_location.h"
-#define HEAL_LOCATION(map, x, y) {MAP_GROUP_##map, MAP_ID_##map, x, y}
+#define HEAL_LOCATION(map, x, y) {MAP_GROUP(map), MAP_NUM(map), x, y}
// Static type declarations
diff --git a/src/item.c b/src/item.c
index 5cf9edf6c..931027e25 100644
--- a/src/item.c
+++ b/src/item.c
@@ -1,6 +1,6 @@
#include "global.h"
#include "item.h"
-#include "items.h"
+#include "constants/items.h"
#include "string_util.h"
#include "text.h"
#include "event_data.h"
diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c
index e18733e37..95270974a 100644
--- a/src/lilycove_lady.c
+++ b/src/lilycove_lady.c
@@ -11,7 +11,7 @@
#include "random.h"
#include "string_util.h"
#include "item.h"
-#include "items.h"
+#include "constants/items.h"
#include "item_menu.h"
#include "text.h"
#include "easy_chat.h"
diff --git a/src/lottery_corner.c b/src/lottery_corner.c
index c935dc852..2ded9c943 100644
--- a/src/lottery_corner.c
+++ b/src/lottery_corner.c
@@ -2,9 +2,9 @@
#include "lottery_corner.h"
#include "event_data.h"
#include "pokemon.h"
-#include "items.h"
+#include "constants/items.h"
#include "random.h"
-#include "species.h"
+#include "constants/species.h"
#include "string_util.h"
#include "text.h"
diff --git a/src/mail.c b/src/mail.c
index dddc06feb..877035fb6 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "constants/items.h"
#include "main.h"
#include "overworld.h"
#include "task.h"
@@ -14,7 +15,7 @@
#include "gpu_regs.h"
#include "bg.h"
#include "pokemon_icon.h"
-#include "species.h"
+#include "constants/species.h"
#include "malloc.h"
#include "easy_chat.h"
#include "mail_data.h"
diff --git a/src/pokeball.c b/src/pokeball.c
index 728145791..127ba8e9d 100644
--- a/src/pokeball.c
+++ b/src/pokeball.c
@@ -6,12 +6,12 @@
#include "battle_anim.h"
#include "task.h"
#include "sound.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "trig.h"
#include "main.h"
#include "m4a.h"
#include "decompress.h"
-#include "species.h"
+#include "constants/species.h"
#include "util.h"
#include "graphics.h"
diff --git a/src/pokemon_1.c b/src/pokemon_1.c
index 1c7c3b846..98a35454f 100644
--- a/src/pokemon_1.c
+++ b/src/pokemon_1.c
@@ -2,7 +2,7 @@
#include "pokemon.h"
#include "random.h"
#include "main.h"
-#include "items.h"
+#include "constants/items.h"
#include "string_util.h"
#include "text.h"
diff --git a/src/pokemon_2.c b/src/pokemon_2.c
index e9bf14a41..a4d00112b 100644
--- a/src/pokemon_2.c
+++ b/src/pokemon_2.c
@@ -4,7 +4,7 @@
#include "event_data.h"
#include "random.h"
#include "sprite.h"
-#include "species.h"
+#include "constants/species.h"
#include "text.h"
#include "string_util.h"
diff --git a/src/pokemon_3.c b/src/pokemon_3.c
index b89b00e8e..a419dd46e 100644
--- a/src/pokemon_3.c
+++ b/src/pokemon_3.c
@@ -1,25 +1,25 @@
#include "global.h"
#include "pokemon.h"
#include "main.h"
-#include "items.h"
+#include "constants/items.h"
#include "string_util.h"
#include "battle_message.h"
#include "rtc.h"
#include "item.h"
#include "battle.h"
-#include "species.h"
+#include "constants/species.h"
#include "link.h"
-#include "hold_effects.h"
+#include "constants/hold_effects.h"
#include "random.h"
#include "trainer_classes.h"
#include "trainer_ids.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
#include "m4a.h"
#include "task.h"
#include "sprite.h"
#include "text.h"
-#include "abilities.h"
+#include "constants/abilities.h"
#include "pokemon_animation.h"
#include "pokedex.h"
diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c
index ec0103bc7..fe3b3e8dd 100644
--- a/src/pokemon_size_record.c
+++ b/src/pokemon_size_record.c
@@ -1,7 +1,7 @@
#include "global.h"
#include "pokemon_size_record.h"
#include "event_data.h"
-#include "species.h"
+#include "constants/species.h"
#include "string_util.h"
#include "text.h"
#include "pokemon.h"
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c
index f82a52d38..bdf4427c7 100644
--- a/src/pokemon_storage_system.c
+++ b/src/pokemon_storage_system.c
@@ -1,7 +1,7 @@
#include "global.h"
#include "pokemon_storage_system.h"
#include "pokemon.h"
-#include "species.h"
+#include "constants/species.h"
#include "event_data.h"
#include "string_util.h"
#include "text.h"
diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c
index e806245a9..b00979945 100755
--- a/src/pokemon_summary_screen.c
+++ b/src/pokemon_summary_screen.c
@@ -3,17 +3,17 @@
#include "bg.h"
#include "decompress.h"
#include "item.h"
-#include "items.h"
+#include "constants/items.h"
#include "link.h"
#include "m4a.h"
#include "main.h"
#include "malloc.h"
-#include "moves.h"
+#include "constants/moves.h"
#include "palette.h"
#include "pokemon.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "sound.h"
-#include "species.h"
+#include "constants/species.h"
#include "sprite.h"
#include "unk_text_util.h"
#include "string_util.h"
diff --git a/src/region_map.c b/src/region_map.c
index a91119420..b7fc625ca 100644
--- a/src/region_map.c
+++ b/src/region_map.c
@@ -7,9 +7,9 @@
#include "palette.h"
#include "party_menu.h"
#include "trig.h"
-#include "map_constants.h"
+#include "constants/maps.h"
#include "overworld.h"
-#include "flags.h"
+#include "constants/flags.h"
#include "event_data.h"
#include "rom6.h"
#include "secret_base.h"
@@ -17,7 +17,7 @@
#include "international_string_util.h"
#include "strings.h"
#include "text_window.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "m4a.h"
#include "field_effect.h"
#include "region_map.h"
@@ -242,56 +242,56 @@ static const u16 Unknown_085A1D48[] = INCBIN_U16("graphics/pokenav/fly_target_ic
static const u8 gUnknown_085A1D68[] = INCBIN_U8("graphics/pokenav/fly_target_icons.4bpp.lz");
static const u8 gUnknown_085A1E3C[][3] = {
- {MAP_GROUP_LITTLEROOT_TOWN, MAP_ID_LITTLEROOT_TOWN, 1},
- {MAP_GROUP_OLDALE_TOWN, MAP_ID_OLDALE_TOWN, 14},
- {MAP_GROUP_DEWFORD_TOWN, MAP_ID_DEWFORD_TOWN, 15},
- {MAP_GROUP_LAVARIDGE_TOWN, MAP_ID_LAVARIDGE_TOWN, 16},
- {MAP_GROUP_FALLARBOR_TOWN, MAP_ID_FALLARBOR_TOWN, 17},
- {MAP_GROUP_VERDANTURF_TOWN, MAP_ID_VERDANTURF_TOWN, 18},
- {MAP_GROUP_PACIFIDLOG_TOWN, MAP_ID_PACIFIDLOG_TOWN, 19},
- {MAP_GROUP_PETALBURG_CITY, MAP_ID_PETALBURG_CITY, 3},
- {MAP_GROUP_SLATEPORT_CITY, MAP_ID_SLATEPORT_CITY, 4},
- {MAP_GROUP_MAUVILLE_CITY, MAP_ID_MAUVILLE_CITY, 5},
- {MAP_GROUP_RUSTBORO_CITY, MAP_ID_RUSTBORO_CITY, 6},
- {MAP_GROUP_FORTREE_CITY, MAP_ID_FORTREE_CITY, 7},
- {MAP_GROUP_LILYCOVE_CITY, MAP_ID_LILYCOVE_CITY, 8},
- {MAP_GROUP_MOSSDEEP_CITY, MAP_ID_MOSSDEEP_CITY, 9},
- {MAP_GROUP_SOOTOPOLIS_CITY, MAP_ID_SOOTOPOLIS_CITY, 10},
- {MAP_GROUP_EVER_GRANDE_CITY, MAP_ID_EVER_GRANDE_CITY, 11},
- {MAP_GROUP_ROUTE101, MAP_ID_ROUTE101, 0},
- {MAP_GROUP_ROUTE102, MAP_ID_ROUTE102, 0},
- {MAP_GROUP_ROUTE103, MAP_ID_ROUTE103, 0},
- {MAP_GROUP_ROUTE104, MAP_ID_ROUTE104, 0},
- {MAP_GROUP_ROUTE105, MAP_ID_ROUTE105, 0},
- {MAP_GROUP_ROUTE106, MAP_ID_ROUTE106, 0},
- {MAP_GROUP_ROUTE107, MAP_ID_ROUTE107, 0},
- {MAP_GROUP_ROUTE108, MAP_ID_ROUTE108, 0},
- {MAP_GROUP_ROUTE109, MAP_ID_ROUTE109, 0},
- {MAP_GROUP_ROUTE110, MAP_ID_ROUTE110, 0},
- {MAP_GROUP_ROUTE111, MAP_ID_ROUTE111, 0},
- {MAP_GROUP_ROUTE112, MAP_ID_ROUTE112, 0},
- {MAP_GROUP_ROUTE113, MAP_ID_ROUTE113, 0},
- {MAP_GROUP_ROUTE114, MAP_ID_ROUTE114, 0},
- {MAP_GROUP_ROUTE115, MAP_ID_ROUTE115, 0},
- {MAP_GROUP_ROUTE116, MAP_ID_ROUTE116, 0},
- {MAP_GROUP_ROUTE117, MAP_ID_ROUTE117, 0},
- {MAP_GROUP_ROUTE118, MAP_ID_ROUTE118, 0},
- {MAP_GROUP_ROUTE119, MAP_ID_ROUTE119, 0},
- {MAP_GROUP_ROUTE120, MAP_ID_ROUTE120, 0},
- {MAP_GROUP_ROUTE121, MAP_ID_ROUTE121, 0},
- {MAP_GROUP_ROUTE122, MAP_ID_ROUTE122, 0},
- {MAP_GROUP_ROUTE123, MAP_ID_ROUTE123, 0},
- {MAP_GROUP_ROUTE124, MAP_ID_ROUTE124, 0},
- {MAP_GROUP_ROUTE125, MAP_ID_ROUTE125, 0},
- {MAP_GROUP_ROUTE126, MAP_ID_ROUTE126, 0},
- {MAP_GROUP_ROUTE127, MAP_ID_ROUTE127, 0},
- {MAP_GROUP_ROUTE128, MAP_ID_ROUTE128, 0},
- {MAP_GROUP_ROUTE129, MAP_ID_ROUTE129, 0},
- {MAP_GROUP_ROUTE130, MAP_ID_ROUTE130, 0},
- {MAP_GROUP_ROUTE131, MAP_ID_ROUTE131, 0},
- {MAP_GROUP_ROUTE132, MAP_ID_ROUTE132, 0},
- {MAP_GROUP_ROUTE133, MAP_ID_ROUTE133, 0},
- {MAP_GROUP_ROUTE134, MAP_ID_ROUTE134, 0}
+ {MAP_GROUP(LITTLEROOT_TOWN), MAP_NUM(LITTLEROOT_TOWN), 1},
+ {MAP_GROUP(OLDALE_TOWN), MAP_NUM(OLDALE_TOWN), 14},
+ {MAP_GROUP(DEWFORD_TOWN), MAP_NUM(DEWFORD_TOWN), 15},
+ {MAP_GROUP(LAVARIDGE_TOWN), MAP_NUM(LAVARIDGE_TOWN), 16},
+ {MAP_GROUP(FALLARBOR_TOWN), MAP_NUM(FALLARBOR_TOWN), 17},
+ {MAP_GROUP(VERDANTURF_TOWN), MAP_NUM(VERDANTURF_TOWN), 18},
+ {MAP_GROUP(PACIFIDLOG_TOWN), MAP_NUM(PACIFIDLOG_TOWN), 19},
+ {MAP_GROUP(PETALBURG_CITY), MAP_NUM(PETALBURG_CITY), 3},
+ {MAP_GROUP(SLATEPORT_CITY), MAP_NUM(SLATEPORT_CITY), 4},
+ {MAP_GROUP(MAUVILLE_CITY), MAP_NUM(MAUVILLE_CITY), 5},
+ {MAP_GROUP(RUSTBORO_CITY), MAP_NUM(RUSTBORO_CITY), 6},
+ {MAP_GROUP(FORTREE_CITY), MAP_NUM(FORTREE_CITY), 7},
+ {MAP_GROUP(LILYCOVE_CITY), MAP_NUM(LILYCOVE_CITY), 8},
+ {MAP_GROUP(MOSSDEEP_CITY), MAP_NUM(MOSSDEEP_CITY), 9},
+ {MAP_GROUP(SOOTOPOLIS_CITY), MAP_NUM(SOOTOPOLIS_CITY), 10},
+ {MAP_GROUP(EVER_GRANDE_CITY), MAP_NUM(EVER_GRANDE_CITY), 11},
+ {MAP_GROUP(ROUTE101), MAP_NUM(ROUTE101), 0},
+ {MAP_GROUP(ROUTE102), MAP_NUM(ROUTE102), 0},
+ {MAP_GROUP(ROUTE103), MAP_NUM(ROUTE103), 0},
+ {MAP_GROUP(ROUTE104), MAP_NUM(ROUTE104), 0},
+ {MAP_GROUP(ROUTE105), MAP_NUM(ROUTE105), 0},
+ {MAP_GROUP(ROUTE106), MAP_NUM(ROUTE106), 0},
+ {MAP_GROUP(ROUTE107), MAP_NUM(ROUTE107), 0},
+ {MAP_GROUP(ROUTE108), MAP_NUM(ROUTE108), 0},
+ {MAP_GROUP(ROUTE109), MAP_NUM(ROUTE109), 0},
+ {MAP_GROUP(ROUTE110), MAP_NUM(ROUTE110), 0},
+ {MAP_GROUP(ROUTE111), MAP_NUM(ROUTE111), 0},
+ {MAP_GROUP(ROUTE112), MAP_NUM(ROUTE112), 0},
+ {MAP_GROUP(ROUTE113), MAP_NUM(ROUTE113), 0},
+ {MAP_GROUP(ROUTE114), MAP_NUM(ROUTE114), 0},
+ {MAP_GROUP(ROUTE115), MAP_NUM(ROUTE115), 0},
+ {MAP_GROUP(ROUTE116), MAP_NUM(ROUTE116), 0},
+ {MAP_GROUP(ROUTE117), MAP_NUM(ROUTE117), 0},
+ {MAP_GROUP(ROUTE118), MAP_NUM(ROUTE118), 0},
+ {MAP_GROUP(ROUTE119), MAP_NUM(ROUTE119), 0},
+ {MAP_GROUP(ROUTE120), MAP_NUM(ROUTE120), 0},
+ {MAP_GROUP(ROUTE121), MAP_NUM(ROUTE121), 0},
+ {MAP_GROUP(ROUTE122), MAP_NUM(ROUTE122), 0},
+ {MAP_GROUP(ROUTE123), MAP_NUM(ROUTE123), 0},
+ {MAP_GROUP(ROUTE124), MAP_NUM(ROUTE124), 0},
+ {MAP_GROUP(ROUTE125), MAP_NUM(ROUTE125), 0},
+ {MAP_GROUP(ROUTE126), MAP_NUM(ROUTE126), 0},
+ {MAP_GROUP(ROUTE127), MAP_NUM(ROUTE127), 0},
+ {MAP_GROUP(ROUTE128), MAP_NUM(ROUTE128), 0},
+ {MAP_GROUP(ROUTE129), MAP_NUM(ROUTE129), 0},
+ {MAP_GROUP(ROUTE130), MAP_NUM(ROUTE130), 0},
+ {MAP_GROUP(ROUTE131), MAP_NUM(ROUTE131), 0},
+ {MAP_GROUP(ROUTE132), MAP_NUM(ROUTE132), 0},
+ {MAP_GROUP(ROUTE133), MAP_NUM(ROUTE133), 0},
+ {MAP_GROUP(ROUTE134), MAP_NUM(ROUTE134), 0}
};
static const u8 *const gUnknown_085A1ED4[] = {
@@ -871,10 +871,10 @@ static void RegionMap_InitializeStateBasedOnPlayerLocation(void)
u16 xOnMap;
struct WarpData *storedWarp;
- if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_SS_TIDAL_CORRIDOR
- && (gSaveBlock1Ptr->location.mapNum == MAP_ID_SS_TIDAL_CORRIDOR
- || gSaveBlock1Ptr->location.mapNum == MAP_ID_SS_TIDAL_LOWER_DECK
- || gSaveBlock1Ptr->location.mapNum == MAP_ID_SS_TIDAL_ROOMS))
+ if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(SS_TIDAL_CORRIDOR)
+ && (gSaveBlock1Ptr->location.mapNum == MAP_NUM(SS_TIDAL_CORRIDOR)
+ || gSaveBlock1Ptr->location.mapNum == MAP_NUM(SS_TIDAL_LOWER_DECK)
+ || gSaveBlock1Ptr->location.mapNum == MAP_NUM(SS_TIDAL_ROOMS)))
{
RegionMap_InitializeStateBasedOnSSTidalLocation();
return;
diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c
index 4ad1971fd..a034ca089 100644
--- a/src/reshow_battle_screen.c
+++ b/src/reshow_battle_screen.c
@@ -10,7 +10,7 @@
#include "battle_controllers.h"
#include "link.h"
#include "sprite.h"
-#include "species.h"
+#include "constants/species.h"
#include "battle_interface.h"
extern u16 gBattle_BG0_X;
diff --git a/src/roamer.c b/src/roamer.c
index bce85dffd..fbd25bfad 100644
--- a/src/roamer.c
+++ b/src/roamer.c
@@ -2,7 +2,7 @@
#include "roamer.h"
#include "pokemon.h"
#include "random.h"
-#include "species.h"
+#include "constants/species.h"
#include "event_data.h"
enum
diff --git a/src/safari_zone.c b/src/safari_zone.c
index d3d40af28..19a26dad9 100644
--- a/src/safari_zone.c
+++ b/src/safari_zone.c
@@ -1,7 +1,7 @@
#include "global.h"
#include "safari_zone.h"
#include "event_data.h"
-#include "game_stat.h"
+#include "constants/game_stat.h"
#include "main.h"
#include "battle.h"
#include "string_util.h"
diff --git a/src/save.c b/src/save.c
index 528c67145..023ca6870 100644
--- a/src/save.c
+++ b/src/save.c
@@ -1,7 +1,7 @@
#include "global.h"
#include "gba/flash_internal.h"
#include "save.h"
-#include "game_stat.h"
+#include "constants/game_stat.h"
#include "task.h"
extern struct SaveSectionLocation gRamSaveSectionLocations[0xE];
diff --git a/src/save_location.c b/src/save_location.c
index 61a5fd30d..262aaf40c 100755
--- a/src/save_location.c
+++ b/src/save_location.c
@@ -1,9 +1,6 @@
#include "global.h"
#include "save_location.h"
-#include "map_constants.h"
-
-// used to make the list defines a little less ugly.
-#define MAP(name) ((MAP_GROUP_##name << 8) + (MAP_ID_##name))
+#include "constants/maps.h"
// specialSaveWarp flags
#define POKECENTER_SAVEWARP (1 << 1)
@@ -29,44 +26,44 @@ static bool32 IsCurMapInLocationList(const u16 *list)
// TODO: Not require a packed u16 array for these lists
static const u16 sSaveLocationPokeCenterList[] =
{
- MAP(OLDALE_TOWN_POKEMON_CENTER_1F),
- MAP(OLDALE_TOWN_POKEMON_CENTER_2F),
- MAP(DEWFORD_TOWN_POKEMON_CENTER_1F),
- MAP(DEWFORD_TOWN_POKEMON_CENTER_2F),
- MAP(LAVARIDGE_TOWN_POKEMON_CENTER_1F),
- MAP(LAVARIDGE_TOWN_POKEMON_CENTER_2F),
- MAP(FALLARBOR_TOWN_POKEMON_CENTER_1F),
- MAP(FALLARBOR_TOWN_POKEMON_CENTER_2F),
- MAP(VERDANTURF_TOWN_POKEMON_CENTER_1F),
- MAP(VERDANTURF_TOWN_POKEMON_CENTER_2F),
- MAP(PACIFIDLOG_TOWN_POKEMON_CENTER_1F),
- MAP(PACIFIDLOG_TOWN_POKEMON_CENTER_2F),
- MAP(PETALBURG_CITY_POKEMON_CENTER_1F),
- MAP(PETALBURG_CITY_POKEMON_CENTER_2F),
- MAP(SLATEPORT_CITY_POKEMON_CENTER_1F),
- MAP(SLATEPORT_CITY_POKEMON_CENTER_2F),
- MAP(MAUVILLE_CITY_POKEMON_CENTER_1F),
- MAP(MAUVILLE_CITY_POKEMON_CENTER_2F),
- MAP(RUSTBORO_CITY_POKEMON_CENTER_1F),
- MAP(RUSTBORO_CITY_POKEMON_CENTER_2F),
- MAP(FORTREE_CITY_POKEMON_CENTER_1F),
- MAP(FORTREE_CITY_POKEMON_CENTER_2F),
- MAP(LILYCOVE_CITY_POKEMON_CENTER_1F),
- MAP(LILYCOVE_CITY_POKEMON_CENTER_2F),
- MAP(MOSSDEEP_CITY_POKEMON_CENTER_1F),
- MAP(MOSSDEEP_CITY_POKEMON_CENTER_2F),
- MAP(SOOTOPOLIS_CITY_POKEMON_CENTER_1F),
- MAP(SOOTOPOLIS_CITY_POKEMON_CENTER_2F),
- MAP(EVER_GRANDE_CITY_POKEMON_CENTER_1F),
- MAP(EVER_GRANDE_CITY_POKEMON_CENTER_2F),
- MAP(EVER_GRANDE_CITY_POKEMON_LEAGUE_1F),
- MAP(EVER_GRANDE_CITY_POKEMON_LEAGUE_2F),
- MAP(BATTLE_FRONTIER_POKEMON_CENTER_1F),
- MAP(BATTLE_FRONTIER_POKEMON_CENTER_2F),
- MAP(SINGLE_BATTLE_COLOSSEUM),
- MAP(TRADE_CENTER),
- MAP(RECORD_CORNER),
- MAP(DOUBLE_BATTLE_COLOSSEUM),
+ MAP_OLDALE_TOWN_POKEMON_CENTER_1F,
+ MAP_OLDALE_TOWN_POKEMON_CENTER_2F,
+ MAP_DEWFORD_TOWN_POKEMON_CENTER_1F,
+ MAP_DEWFORD_TOWN_POKEMON_CENTER_2F,
+ MAP_LAVARIDGE_TOWN_POKEMON_CENTER_1F,
+ MAP_LAVARIDGE_TOWN_POKEMON_CENTER_2F,
+ MAP_FALLARBOR_TOWN_POKEMON_CENTER_1F,
+ MAP_FALLARBOR_TOWN_POKEMON_CENTER_2F,
+ MAP_VERDANTURF_TOWN_POKEMON_CENTER_1F,
+ MAP_VERDANTURF_TOWN_POKEMON_CENTER_2F,
+ MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_1F,
+ MAP_PACIFIDLOG_TOWN_POKEMON_CENTER_2F,
+ MAP_PETALBURG_CITY_POKEMON_CENTER_1F,
+ MAP_PETALBURG_CITY_POKEMON_CENTER_2F,
+ MAP_SLATEPORT_CITY_POKEMON_CENTER_1F,
+ MAP_SLATEPORT_CITY_POKEMON_CENTER_2F,
+ MAP_MAUVILLE_CITY_POKEMON_CENTER_1F,
+ MAP_MAUVILLE_CITY_POKEMON_CENTER_2F,
+ MAP_RUSTBORO_CITY_POKEMON_CENTER_1F,
+ MAP_RUSTBORO_CITY_POKEMON_CENTER_2F,
+ MAP_FORTREE_CITY_POKEMON_CENTER_1F,
+ MAP_FORTREE_CITY_POKEMON_CENTER_2F,
+ MAP_LILYCOVE_CITY_POKEMON_CENTER_1F,
+ MAP_LILYCOVE_CITY_POKEMON_CENTER_2F,
+ MAP_MOSSDEEP_CITY_POKEMON_CENTER_1F,
+ MAP_MOSSDEEP_CITY_POKEMON_CENTER_2F,
+ MAP_SOOTOPOLIS_CITY_POKEMON_CENTER_1F,
+ MAP_SOOTOPOLIS_CITY_POKEMON_CENTER_2F,
+ MAP_EVER_GRANDE_CITY_POKEMON_CENTER_1F,
+ MAP_EVER_GRANDE_CITY_POKEMON_CENTER_2F,
+ MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_1F,
+ MAP_EVER_GRANDE_CITY_POKEMON_LEAGUE_2F,
+ MAP_BATTLE_FRONTIER_POKEMON_CENTER_1F,
+ MAP_BATTLE_FRONTIER_POKEMON_CENTER_2F,
+ MAP_SINGLE_BATTLE_COLOSSEUM,
+ MAP_TRADE_CENTER,
+ MAP_RECORD_CORNER,
+ MAP_DOUBLE_BATTLE_COLOSSEUM,
0xFFFF,
};
@@ -77,7 +74,7 @@ static bool32 IsCurMapPokeCenter(void)
static const u16 sSaveLocationReloadLocList[] = // there's only 1 location, and it's presumed its for the save reload feature for battle tower
{
- MAP(BATTLE_TOWER_LOBBY),
+ MAP_BATTLE_FRONTIER_BATTLE_TOWER_LOBBY,
0xFFFF,
};
diff --git a/src/secret_base.c b/src/secret_base.c
index de2b7221a..6d66e6576 100644
--- a/src/secret_base.c
+++ b/src/secret_base.c
@@ -1,6 +1,7 @@
// Includes
#include "global.h"
+#include "constants/decorations.h"
#include "malloc.h"
#include "task.h"
#include "palette.h"
@@ -10,8 +11,8 @@
#include "menu_helpers.h"
#include "new_menu_helpers.h"
#include "menu_indicators.h"
-#include "map_constants.h"
-#include "songs.h"
+#include "constants/maps.h"
+#include "constants/songs.h"
#include "sound.h"
#include "overworld.h"
#include "fieldmap.h"
@@ -89,30 +90,30 @@ const struct {
};
const u8 gUnknown_0858CFE8[] = {
- MAP_ID_SECRET_BASE_RED_CAVE1, 0x00, 0x01, 0x03,
- MAP_ID_SECRET_BASE_RED_CAVE2, 0x00, 0x05, 0x09,
- MAP_ID_SECRET_BASE_RED_CAVE3, 0x00, 0x01, 0x03,
- MAP_ID_SECRET_BASE_RED_CAVE4, 0x00, 0x07, 0x0d,
- MAP_ID_SECRET_BASE_BROWN_CAVE1, 0x00, 0x02, 0x03,
- MAP_ID_SECRET_BASE_BROWN_CAVE2, 0x00, 0x09, 0x02,
- MAP_ID_SECRET_BASE_BROWN_CAVE3, 0x00, 0x0d, 0x04,
- MAP_ID_SECRET_BASE_BROWN_CAVE4, 0x00, 0x01, 0x02,
- MAP_ID_SECRET_BASE_BLUE_CAVE1, 0x00, 0x01, 0x03,
- MAP_ID_SECRET_BASE_BLUE_CAVE2, 0x00, 0x01, 0x02,
- MAP_ID_SECRET_BASE_BLUE_CAVE3, 0x00, 0x03, 0x0f,
- MAP_ID_SECRET_BASE_BLUE_CAVE4, 0x00, 0x03, 0x0e,
- MAP_ID_SECRET_BASE_YELLOW_CAVE1, 0x00, 0x09, 0x03,
- MAP_ID_SECRET_BASE_YELLOW_CAVE2, 0x00, 0x08, 0x07,
- MAP_ID_SECRET_BASE_YELLOW_CAVE3, 0x00, 0x03, 0x06,
- MAP_ID_SECRET_BASE_YELLOW_CAVE4, 0x00, 0x05, 0x09,
- MAP_ID_SECRET_BASE_TREE1, 0x00, 0x02, 0x03,
- MAP_ID_SECRET_BASE_TREE2, 0x00, 0x05, 0x06,
- MAP_ID_SECRET_BASE_TREE3, 0x00, 0x0f, 0x03,
- MAP_ID_SECRET_BASE_TREE4, 0x00, 0x04, 0x0a,
- MAP_ID_SECRET_BASE_SHRUB1, 0x00, 0x03, 0x03,
- MAP_ID_SECRET_BASE_SHRUB2, 0x00, 0x01, 0x02,
- MAP_ID_SECRET_BASE_SHRUB3, 0x00, 0x07, 0x08,
- MAP_ID_SECRET_BASE_SHRUB4, 0x00, 0x09, 0x06
+ MAP_NUM(SECRET_BASE_RED_CAVE1), 0x00, 0x01, 0x03,
+ MAP_NUM(SECRET_BASE_RED_CAVE2), 0x00, 0x05, 0x09,
+ MAP_NUM(SECRET_BASE_RED_CAVE3), 0x00, 0x01, 0x03,
+ MAP_NUM(SECRET_BASE_RED_CAVE4), 0x00, 0x07, 0x0d,
+ MAP_NUM(SECRET_BASE_BROWN_CAVE1), 0x00, 0x02, 0x03,
+ MAP_NUM(SECRET_BASE_BROWN_CAVE2), 0x00, 0x09, 0x02,
+ MAP_NUM(SECRET_BASE_BROWN_CAVE3), 0x00, 0x0d, 0x04,
+ MAP_NUM(SECRET_BASE_BROWN_CAVE4), 0x00, 0x01, 0x02,
+ MAP_NUM(SECRET_BASE_BLUE_CAVE1), 0x00, 0x01, 0x03,
+ MAP_NUM(SECRET_BASE_BLUE_CAVE2), 0x00, 0x01, 0x02,
+ MAP_NUM(SECRET_BASE_BLUE_CAVE3), 0x00, 0x03, 0x0f,
+ MAP_NUM(SECRET_BASE_BLUE_CAVE4), 0x00, 0x03, 0x0e,
+ MAP_NUM(SECRET_BASE_YELLOW_CAVE1), 0x00, 0x09, 0x03,
+ MAP_NUM(SECRET_BASE_YELLOW_CAVE2), 0x00, 0x08, 0x07,
+ MAP_NUM(SECRET_BASE_YELLOW_CAVE3), 0x00, 0x03, 0x06,
+ MAP_NUM(SECRET_BASE_YELLOW_CAVE4), 0x00, 0x05, 0x09,
+ MAP_NUM(SECRET_BASE_TREE1), 0x00, 0x02, 0x03,
+ MAP_NUM(SECRET_BASE_TREE2), 0x00, 0x05, 0x06,
+ MAP_NUM(SECRET_BASE_TREE3), 0x00, 0x0f, 0x03,
+ MAP_NUM(SECRET_BASE_TREE4), 0x00, 0x04, 0x0a,
+ MAP_NUM(SECRET_BASE_SHRUB1), 0x00, 0x03, 0x03,
+ MAP_NUM(SECRET_BASE_SHRUB2), 0x00, 0x01, 0x02,
+ MAP_NUM(SECRET_BASE_SHRUB3), 0x00, 0x07, 0x08,
+ MAP_NUM(SECRET_BASE_SHRUB4), 0x00, 0x09, 0x06
};
const struct MenuAction gUnknown_0858D048[] = {
@@ -360,7 +361,7 @@ void sub_80E8F9C(void)
s8 idx;
idx = sCurSecretBaseId / 10 * 4;
- warp1_set_2(MAP_GROUP_SECRET_BASE_RED_CAVE1, gUnknown_0858CFE8[idx], gUnknown_0858CFE8[idx + 1]);
+ warp1_set_2(MAP_GROUP(SECRET_BASE_RED_CAVE1), gUnknown_0858CFE8[idx], gUnknown_0858CFE8[idx + 1]);
}
void sub_80E8FD0(u8 taskId)
@@ -455,7 +456,7 @@ void sub_80E91F8(void)
bool8 CurrentMapIsSecretBase(void)
{
- if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_SECRET_BASE_RED_CAVE1 && (u8)gSaveBlock1Ptr->location.mapNum <= MAP_ID_SECRET_BASE_SHRUB4)
+ if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(SECRET_BASE_RED_CAVE1) && (u8)gSaveBlock1Ptr->location.mapNum <= MAP_NUM(SECRET_BASE_SHRUB4))
{
return TRUE;
}
diff --git a/src/sound.c b/src/sound.c
index a95511ece..086fede67 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -5,7 +5,7 @@
#include "m4a.h"
#include "main.h"
#include "pokemon.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "task.h"
struct Fanfare
diff --git a/src/starter_choose.c b/src/starter_choose.c
index 6be362caf..82f8f75f6 100644
--- a/src/starter_choose.c
+++ b/src/starter_choose.c
@@ -12,7 +12,7 @@
#include "decompress.h"
#include "menu.h"
#include "sound.h"
-#include "songs.h"
+#include "constants/songs.h"
#include "event_data.h"
#include "pokedex.h"
#include "data2.h"
diff --git a/src/tv.c b/src/tv.c
index 79e417f16..1605be29c 100644
--- a/src/tv.c
+++ b/src/tv.c
@@ -3,7 +3,7 @@
#include "global.h"
#include "rtc.h"
#include "overworld.h"
-#include "map_constants.h"
+#include "constants/maps.h"
#include "random.h"
#include "event_data.h"
#include "fieldmap.h"
@@ -14,12 +14,12 @@
#include "pokemon_storage_system.h"
#include "field_message_box.h"
#include "easy_chat.h"
-#include "species.h"
-#include "moves.h"
+#include "constants/species.h"
+#include "constants/moves.h"
#include "battle.h"
#include "battle_tower.h"
#include "contest.h"
-#include "items.h"
+#include "constants/items.h"
#include "item.h"
#include "link.h"
#include "main.h"
@@ -38,6 +38,9 @@
#include "secret_base.h"
#include "tv.h"
+extern const u8 gSpeciesNames[][11];
+extern const u8 gMoveNames[][13];
+
// Static type declarations
#define rbernoulli(num, den) TV_BernoulliTrial(0xFFFF * (num) / (den))
@@ -832,7 +835,7 @@ void UpdateTVScreensOnMap(int width, int height)
case 2:
break;
default:
- if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_LILYCOVE_CITY_COVE_LILY_MOTEL_1F && gSaveBlock1Ptr->location.mapNum == MAP_ID_LILYCOVE_CITY_COVE_LILY_MOTEL_1F)
+ if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(LILYCOVE_CITY_COVE_LILY_MOTEL_1F) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(LILYCOVE_CITY_COVE_LILY_MOTEL_1F))
{
SetTVMetatilesOnMap(width, height, 0x3);
}
@@ -1575,7 +1578,9 @@ void SaveRecordedItemPurchasesForTVShow(void)
TVShow *show;
u8 i;
- if (!(gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_TRAINER_HILL_LOBBY && gSaveBlock1Ptr->location.mapNum == MAP_ID_TRAINER_HILL_LOBBY) && !(gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_BATTLE_FRONTIER_MART && gSaveBlock1Ptr->location.mapNum == MAP_ID_BATTLE_FRONTIER_MART) && !rbernoulli(1, 3))
+ if (!(gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(TRAINER_HILL_ENTRANCE) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(TRAINER_HILL_ENTRANCE))
+ && !(gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(BATTLE_FRONTIER_MART) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(BATTLE_FRONTIER_MART))
+ && !rbernoulli(1, 3))
{
sCurTVShowSlot = FindEmptyTVSlotBeyondFirstFiveShowsOfArray(gSaveBlock1Ptr->tvShows);
if (sCurTVShowSlot != -1 && HasMixableShowAlreadyBeenSpawnedWithPlayerID(TVSHOW_SMART_SHOPPER, FALSE) != TRUE)
@@ -2959,13 +2964,13 @@ bool8 IsPriceDiscounted(u8 newsKind)
switch (newsKind)
{
case POKENEWS_SLATEPORT:
- if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_SLATEPORT_CITY && gSaveBlock1Ptr->location.mapNum == MAP_ID_SLATEPORT_CITY && gSpecialVar_LastTalked == 25)
+ if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(SLATEPORT_CITY) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(SLATEPORT_CITY) && gSpecialVar_LastTalked == 25)
{
return TRUE;
}
return FALSE;
case POKENEWS_LILYCOVE:
- if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP && gSaveBlock1Ptr->location.mapNum == MAP_ID_LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP)
+ if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(LILYCOVE_CITY_DEPARTMENT_STORE_ROOFTOP))
{
return TRUE;
}
@@ -3694,20 +3699,20 @@ u32 GetPlayerIDAsU32(void)
u8 CheckForBigMovieOrEmergencyNewsOnTV(void)
{
- if (gSaveBlock1Ptr->location.mapGroup != MAP_GROUP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F)
+ if (gSaveBlock1Ptr->location.mapGroup != MAP_GROUP(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F))
{
return 0;
}
if (gSaveBlock2Ptr->playerGender == MALE)
{
- if (gSaveBlock1Ptr->location.mapNum != MAP_ID_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F)
+ if (gSaveBlock1Ptr->location.mapNum != MAP_NUM(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F))
{
return 0;
}
}
else
{
- if (gSaveBlock1Ptr->location.mapNum != MAP_ID_LITTLEROOT_TOWN_MAYS_HOUSE_1F)
+ if (gSaveBlock1Ptr->location.mapNum != MAP_NUM(LITTLEROOT_TOWN_MAYS_HOUSE_1F))
{
return 0;
}
@@ -3725,11 +3730,11 @@ u8 CheckForBigMovieOrEmergencyNewsOnTV(void)
void GetMomOrDadStringForTVMessage(void)
{
- if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F)
+ if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F))
{
if (gSaveBlock2Ptr->playerGender == MALE)
{
- if (gSaveBlock1Ptr->location.mapNum == MAP_ID_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F)
+ if (gSaveBlock1Ptr->location.mapNum == MAP_NUM(LITTLEROOT_TOWN_BRENDANS_HOUSE_1F))
{
StringCopy(gStringVar1, gText_Mom);
VarSet(VAR_0x4003, 1);
@@ -3737,7 +3742,7 @@ void GetMomOrDadStringForTVMessage(void)
}
else
{
- if (gSaveBlock1Ptr->location.mapNum == MAP_ID_LITTLEROOT_TOWN_MAYS_HOUSE_1F)
+ if (gSaveBlock1Ptr->location.mapNum == MAP_NUM(LITTLEROOT_TOWN_MAYS_HOUSE_1F))
{
StringCopy(gStringVar1, gText_Mom);
VarSet(VAR_0x4003, 1);
diff --git a/src/wild_encounter.c b/src/wild_encounter.c
index 5d4e5a20f..705c4416c 100644
--- a/src/wild_encounter.c
+++ b/src/wild_encounter.c
@@ -1,23 +1,24 @@
#include "global.h"
#include "wild_encounter.h"
#include "pokemon.h"
-#include "species.h"
+#include "constants/species.h"
#include "metatile_behavior.h"
#include "fieldmap.h"
#include "random.h"
-#include "map_constants.h"
+#include "constants/maps.h"
#include "field_player_avatar.h"
-#include "abilities.h"
+#include "constants/abilities.h"
#include "event_data.h"
#include "safari_zone.h"
+#include "overworld.h"
#include "pokeblock.h"
#include "battle_setup.h"
#include "roamer.h"
-#include "game_stat.h"
+#include "constants/game_stat.h"
#include "tv.h"
#include "link.h"
#include "script.h"
-#include "items.h"
+#include "constants/items.h"
extern const u8 EventScript_RepelWoreOff[];
@@ -84,8 +85,8 @@ static bool8 CheckFeebas(void)
u8 route119Section = 0;
u16 waterTileNum;
- if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_ROUTE119
- && gSaveBlock1Ptr->location.mapNum == MAP_ID_ROUTE119)
+ if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ROUTE119)
+ && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ROUTE119))
{
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
x -= 7;
@@ -283,8 +284,8 @@ static u16 GetCurrentMapWildMonHeaderId(void)
if (gWildMonHeaders[i].mapGroup == gSaveBlock1Ptr->location.mapGroup &&
gWildMonHeaders[i].mapNum == gSaveBlock1Ptr->location.mapNum)
{
- if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP_ALTERING_CAVE &&
- gSaveBlock1Ptr->location.mapNum == MAP_ID_ALTERING_CAVE)
+ if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ALTERING_CAVE) &&
+ gSaveBlock1Ptr->location.mapNum == MAP_NUM(ALTERING_CAVE))
{
u16 alteringCaveId = VarGet(VAR_ALTERING_CAVE_WILD_SET);
if (alteringCaveId > 8)
@@ -513,8 +514,8 @@ static bool8 DoGlobalWildEncounterDiceRoll(void)
static bool8 AreLegendariesInSootopolisPreventingEncounters(void)
{
- if (gSaveBlock1Ptr->location.mapGroup != MAP_GROUP_SOOTOPOLIS_CITY
- || gSaveBlock1Ptr->location.mapNum != MAP_ID_SOOTOPOLIS_CITY)
+ if (gSaveBlock1Ptr->location.mapGroup != MAP_GROUP(SOOTOPOLIS_CITY)
+ || gSaveBlock1Ptr->location.mapNum != MAP_NUM(SOOTOPOLIS_CITY))
{
return FALSE;
}