From b0223f691fcc83c18b6ba8df5140d907939b04cf Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Thu, 4 Apr 2019 23:53:06 +0200 Subject: [PATCH] Clean up data headers --- include/battle.h | 65 +-------------------- include/data.h | 60 ++++++++++++++++++- include/field_effect.h | 4 +- include/field_specials.h | 3 + include/pokemon_summary_screen.h | 2 + src/apprentice.c | 2 +- src/battle_ai_script_commands.c | 3 +- src/battle_anim_effects_3.c | 4 +- src/battle_anim_mons.c | 7 +-- src/battle_controller_link_opponent.c | 4 +- src/battle_controller_link_partner.c | 5 +- src/battle_controller_opponent.c | 4 +- src/battle_controller_player.c | 5 +- src/battle_controller_player_partner.c | 5 +- src/battle_controller_recorded_opponent.c | 4 +- src/battle_controller_recorded_player.c | 5 +- src/battle_controller_safari.c | 4 +- src/battle_controller_wally.c | 4 +- src/battle_dome.c | 5 +- src/battle_factory_screen.c | 2 +- src/battle_gfx_sfx_util.c | 12 +--- src/battle_interface.c | 5 +- src/battle_main.c | 2 +- src/battle_message.c | 3 +- src/battle_tower.c | 2 +- src/battle_util.c | 4 +- src/bike.c | 5 +- src/cable_club.c | 2 +- src/contest.c | 6 +- src/contest_link_80F57C4.c | 2 +- src/contest_painting.c | 5 +- src/data.c | 2 +- src/data/pokemon_graphics/footprint_table.h | 2 +- src/data/pokemon_graphics/front_pic_anims.h | 2 +- src/decompress.c | 10 ++-- src/easy_chat.c | 2 +- src/egg_hatch.c | 2 +- src/evolution_scene.c | 4 +- src/field_effect.c | 6 +- src/field_specials.c | 30 +++++----- src/frontier_util.c | 2 +- src/hall_of_fame.c | 2 +- src/item_menu.c | 2 +- src/item_use.c | 2 +- src/match_call.c | 2 +- src/menu_specialized.c | 2 +- src/move_relearner.c | 2 +- src/naming_screen.c | 2 +- src/party_menu.c | 2 +- src/pokeblock_feed.c | 9 ++- src/pokedex.c | 2 +- src/pokemon.c | 36 +++--------- src/pokemon_size_record.c | 2 +- src/pokemon_storage_system.c | 4 +- src/pokemon_summary_screen.c | 3 +- src/pokenav_match_call.c | 3 +- src/reshow_battle_screen.c | 8 +-- src/scanline_effect.c | 2 +- src/scrcmd.c | 2 +- src/script_pokemon_util_80F87D8.c | 2 +- src/shop.c | 2 +- src/smokescreen.c | 6 +- src/starter_choose.c | 2 +- src/trade.c | 6 +- src/trainer_pokemon_sprites.c | 17 +----- src/tv.c | 2 +- src/union_room.c | 2 +- src/use_pokeblock.c | 7 +-- 68 files changed, 173 insertions(+), 267 deletions(-) diff --git a/include/battle.h b/include/battle.h index 0274e4d9f..e3c37aa99 100644 --- a/include/battle.h +++ b/include/battle.h @@ -62,70 +62,12 @@ #define BATTLE_BUFFER_LINK_SIZE 0x1000 -struct TrainerMonNoItemDefaultMoves -{ - u16 iv; - u8 lvl; - u16 species; -}; - -struct TrainerMonItemDefaultMoves -{ - u16 iv; - u8 lvl; - u16 species; - u16 heldItem; -}; - -struct TrainerMonNoItemCustomMoves -{ - u16 iv; - u8 lvl; - u16 species; - u16 moves[4]; -}; - -struct TrainerMonItemCustomMoves -{ - u16 iv; - u8 lvl; - u16 species; - u16 heldItem; - u16 moves[4]; -}; - -union TrainerMonPtr -{ - const struct TrainerMonNoItemDefaultMoves *NoItemDefaultMoves; - const struct TrainerMonNoItemCustomMoves *NoItemCustomMoves; - const struct TrainerMonItemDefaultMoves *ItemDefaultMoves; - const struct TrainerMonItemCustomMoves *ItemCustomMoves; -}; - -struct Trainer -{ - /*0x00*/ u8 partyFlags; - /*0x01*/ u8 trainerClass; - /*0x02*/ u8 encounterMusic_gender; // last bit is gender - /*0x03*/ u8 trainerPic; - /*0x04*/ u8 trainerName[12]; - /*0x10*/ u16 items[4]; - /*0x18*/ bool8 doubleBattle; - /*0x1C*/ u32 aiFlags; - /*0x20*/ u8 partySize; - /*0x24*/ union TrainerMonPtr party; -}; - -extern const struct Trainer gTrainers[]; - -#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F)) - -struct UnknownFlags +struct ResourceFlags { u32 flags[4]; }; -#define UNKNOWN_FLAG_FLASH_FIRE 1 +#define RESOURCE_FLAG_FLASH_FIRE 1 struct DisableStruct { @@ -282,7 +224,7 @@ struct StatsArray struct BattleResources { struct SecretBaseRecord* secretBase; - struct UnknownFlags *flags; + struct ResourceFlags *flags; struct BattleScriptsStack* battleScriptsStack; struct BattleCallbacksStack* battleCallbackStack; struct StatsArray* beforeLvlUp; @@ -769,6 +711,5 @@ extern u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT]; extern u8 gMultiUsePlayerCursor; extern u8 gNumberOfMovesToChoose; extern u8 gUnknown_03005D7C[MAX_BATTLERS_COUNT]; -extern const u8 gTrainerClassNames[][13]; #endif // GUARD_BATTLE_H diff --git a/include/data.h b/include/data.h index a8ba573fe..f1a4caa6a 100644 --- a/include/data.h +++ b/include/data.h @@ -14,6 +14,62 @@ struct MonCoords u8 y_offset; }; +struct TrainerMonNoItemDefaultMoves +{ + u16 iv; + u8 lvl; + u16 species; +}; + +struct TrainerMonItemDefaultMoves +{ + u16 iv; + u8 lvl; + u16 species; + u16 heldItem; +}; + +struct TrainerMonNoItemCustomMoves +{ + u16 iv; + u8 lvl; + u16 species; + u16 moves[4]; +}; + +struct TrainerMonItemCustomMoves +{ + u16 iv; + u8 lvl; + u16 species; + u16 heldItem; + u16 moves[4]; +}; + +union TrainerMonPtr +{ + const struct TrainerMonNoItemDefaultMoves *NoItemDefaultMoves; + const struct TrainerMonNoItemCustomMoves *NoItemCustomMoves; + const struct TrainerMonItemDefaultMoves *ItemDefaultMoves; + const struct TrainerMonItemCustomMoves *ItemCustomMoves; +}; + +struct Trainer +{ + /*0x00*/ u8 partyFlags; + /*0x01*/ u8 trainerClass; + /*0x02*/ u8 encounterMusic_gender; // last bit is gender + /*0x03*/ u8 trainerPic; + /*0x04*/ u8 trainerName[12]; + /*0x10*/ u16 items[4]; + /*0x18*/ bool8 doubleBattle; + /*0x1C*/ u32 aiFlags; + /*0x20*/ u8 partySize; + /*0x24*/ union TrainerMonPtr party; +}; + +#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F)) + extern const u16 gUnknown_082FF1D8[]; extern const u32 gUnknown_082FF1F8[]; @@ -34,7 +90,7 @@ extern const union AffineAnimCmd *const gUnknown_082FF618[]; extern const union AffineAnimCmd *const gUnknown_082FF694[]; extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; -extern const union AnimCmd *const gPlayerMonSpriteAnimsTable[]; +extern const union AnimCmd *const gUnknown_082FF70C[]; extern const struct MonCoords gMonFrontPicCoords[]; extern const struct CompressedSpriteSheet gMonStillFrontPicTable[]; extern const struct MonCoords gMonBackPicCoords[]; @@ -52,7 +108,7 @@ extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; extern const u8 gEnemyMonElevation[NUM_SPECIES]; -extern const union AnimCmd *const *const gMonAnimationsSpriteAnimsPtrTable[]; +extern const union AnimCmd *const *const gMonFrontAnimsPtrTable[]; extern const struct CompressedSpriteSheet gMonFrontPicTable[]; extern const struct Trainer gTrainers[]; diff --git a/include/field_effect.h b/include/field_effect.h index 1f5f4ee29..0dbe600d3 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -1,9 +1,7 @@ #ifndef GUARD_FIELD_EFFECTS_H #define GUARD_FIELD_EFFECTS_H -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[2]; extern const struct SpritePalette gNewGameBirchObjectPaletteInfo; -extern const struct CompressedSpriteSheet gTrainerFrontPicTable[2]; extern const struct SpriteTemplate gNewGameBirchObjectTemplate; extern const struct OamData gNewGameBirchOamAttributes; @@ -53,4 +51,4 @@ void FreeResourcesAndDestroySprite(struct Sprite *sprite, u8 spriteId); u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority); void StartEscapeRopeFieldEffect(void); -#endif //GUARD_FIELD_EFFECTS_H +#endif // GUARD_FIELD_EFFECTS_H diff --git a/include/field_specials.h b/include/field_specials.h index 68b233074..b1a50c811 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -1,6 +1,9 @@ #ifndef GUARD_FIELD_SPECIALS_H #define GUARD_FIELD_SPECIALS_H +extern bool8 gBikeCyclingChallenge; +extern u8 gBikeCollisions; + u8 GetLeadMonIndex(void); u8 sub_813B260(void); u16 get_unknown_box_id(void); diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 19994b77f..20d881702 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -4,7 +4,9 @@ #include "main.h" extern u8 gLastViewedMonIndex; + extern const u8 *const gMoveDescriptionPointers[]; +extern const u8 *const gNatureNamePointers[]; void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)); void sub_81C4F98(u8, void(*)(void)); diff --git a/src/apprentice.c b/src/apprentice.c index 27ff8e36e..ac2bba48f 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -2,7 +2,7 @@ #include "apprentice.h" #include "battle.h" #include "battle_tower.h" -#include "data2.h" +#include "data.h" #include "event_data.h" #include "event_object_movement.h" #include "field_player_avatar.h" diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 61876e0de..5e832aba0 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -4,6 +4,7 @@ #include "battle_ai_script_commands.h" #include "battle_factory.h" #include "battle_setup.h" +#include "data.h" #include "item.h" #include "pokemon.h" #include "random.h" @@ -2217,7 +2218,7 @@ static void BattleAICmd_if_flash_fired(void) { u8 battlerId = BattleAI_GetWantedBattler(gAIScriptPtr[1]); - if (gBattleResources->flags->flags[battlerId] & UNKNOWN_FLAG_FLASH_FIRE) + if (gBattleResources->flags->flags[battlerId] & RESOURCE_FLAG_FLASH_FIRE) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); else gAIScriptPtr += 6; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index efa2620fd..ab765b8c1 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -4,7 +4,7 @@ #include "battle_anim.h" #include "bg.h" #include "contest.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "dma3.h" #include "gpu_regs.h" @@ -25,8 +25,6 @@ #include "constants/weather.h" extern const struct SpriteTemplate gUnknown_08593114; -extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; -extern const union AffineAnimCmd *const gUnknown_082FF694[]; void sub_815A0D4(struct Sprite *); void sub_815A1B0(struct Sprite *); diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 372377a0c..c6058204d 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -3,7 +3,7 @@ #include "battle_anim.h" #include "bg.h" #include "contest.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "dma3.h" #include "gpu_regs.h" @@ -27,11 +27,6 @@ #define IS_DOUBLE_BATTLE() ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) extern const struct OamData gUnknown_0852497C; -extern const struct MonCoords gMonFrontPicCoords[]; -extern const struct MonCoords gMonBackPicCoords[]; -extern const u8 gEnemyMonElevation[]; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; -extern const union AffineAnimCmd *gUnknown_082FF6C0[]; static void sub_80A6FB4(struct Sprite *sprite); static void sub_80A7144(struct Sprite *sprite); diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 23d469c27..3fb5da9dc 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -9,7 +9,7 @@ #include "battle_tower.h" #include "battle_tv.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "link.h" #include "main.h" #include "m4a.h" @@ -31,8 +31,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; - // this file's functions static void LinkOpponentHandleGetMonData(void); static void LinkOpponentHandleGetRawMonData(void); diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 22633c5bc..6fc73a604 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -9,7 +9,7 @@ #include "battle_tower.h" #include "battle_tv.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "link.h" #include "main.h" #include "m4a.h" @@ -29,9 +29,6 @@ #include "constants/trainers.h" #include "recorded_battle.h" -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; -extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; - // this file's functions static void LinkPartnerHandleGetMonData(void); static void LinkPartnerHandleGetRawMonData(void); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 7d940cb89..392811327 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -10,7 +10,7 @@ #include "battle_tower.h" #include "battle_tv.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "frontier_util.h" #include "item.h" #include "link.h" @@ -36,8 +36,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; - // this file's functions static void OpponentHandleGetMonData(void); static void OpponentHandleGetRawMonData(void); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index b377ecf64..3f5a777e4 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -9,7 +9,7 @@ #include "battle_setup.h" #include "battle_tv.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "item.h" #include "item_menu.h" #include "link.h" @@ -36,9 +36,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; -extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; - // this file's functions static void PlayerHandleGetMonData(void); static void PlayerHandleSetMonData(void); diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 2c53938c1..0ec21fd22 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -8,7 +8,7 @@ #include "battle_setup.h" #include "battle_tower.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "item_use.h" #include "link.h" #include "main.h" @@ -27,9 +27,6 @@ #include "constants/songs.h" #include "constants/trainers.h" -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; -extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; - // this file's functions static void PlayerPartnerHandleGetMonData(void); static void PlayerPartnerHandleGetRawMonData(void); diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index e43c5f8ae..69d840020 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -9,7 +9,7 @@ #include "battle_tower.h" #include "battle_tv.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "item_use.h" #include "link.h" #include "main.h" @@ -31,8 +31,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; - // this file's functions static void RecordedOpponentHandleGetMonData(void); static void RecordedOpponentHandleGetRawMonData(void); diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 412c49f17..95683225e 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -6,7 +6,7 @@ #include "battle_message.h" #include "battle_interface.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "item_use.h" #include "link.h" #include "main.h" @@ -27,9 +27,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; -extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; - // this file's functions static void RecordedPlayerHandleGetMonData(void); static void RecordedPlayerHandleGetRawMonData(void); diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index e9da16252..8f89e4cb5 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -5,7 +5,7 @@ #include "battle_interface.h" #include "battle_message.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "item_menu.h" #include "link.h" #include "main.h" @@ -23,8 +23,6 @@ #include "constants/battle_anim.h" #include "constants/songs.h" -extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; - // this file's functions static void SafariHandleGetMonData(void); static void SafariHandleGetRawMonData(void); diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index f1b783b21..a504f5a80 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -7,7 +7,7 @@ #include "battle_setup.h" #include "battle_tv.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "item.h" #include "item_menu.h" #include "link.h" @@ -31,8 +31,6 @@ #include "constants/songs.h" #include "constants/trainers.h" -extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; - // this file's functions static void WallyHandleGetMonData(void); static void WallyHandleGetRawMonData(void); diff --git a/src/battle_dome.c b/src/battle_dome.c index 1b7953180..95fce49a3 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -24,7 +24,7 @@ #include "menu.h" #include "sound.h" #include "pokemon_icon.h" -#include "data2.h" +#include "data.h" #include "international_string_util.h" #include "trainer_pokemon_sprites.h" #include "scanline_effect.h" @@ -59,9 +59,6 @@ struct UnkStruct_860DD10 u16 src; }; -// text -extern const u8 gTrainerClassNames[][13]; - // This file's functions. static u8 GetDomeTrainerMonIvs(u16 trainerId); static void SwapDomeTrainers(int id1, int id2, u16 *statsArray); diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 367c1401f..ac32651e2 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -17,7 +17,7 @@ #include "string_util.h" #include "international_string_util.h" #include "window.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "pokemon_summary_screen.h" #include "sound.h" diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 7c6b74304..d6b1b6dee 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -19,7 +19,7 @@ #include "m4a.h" #include "constants/species.h" #include "decompress.h" -#include "data2.h" +#include "data.h" #include "palette.h" #include "contest.h" #include "constants/songs.h" @@ -32,16 +32,8 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM; extern const u8 gUnknown_0831C604[]; extern const u8 * const gBattleAnims_General[]; extern const u8 * const gBattleAnims_Special[]; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; -extern const struct CompressedSpriteSheet gMonBackPicTable[]; -extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; -extern const struct CompressedSpriteSheet gTrainerBackPicTable[]; -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; -extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; -extern const union AnimCmd* const * const gMonAnimationsSpriteAnimsPtrTable[]; extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; -extern const u8 gEnemyMonElevation[]; // this file's functions static u8 sub_805D4A8(u16 move); @@ -932,7 +924,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform if (targetSpecies == SPECIES_CASTFORM) { - gSprites[gBattlerSpriteIds[battlerAtk]].anims = gMonAnimationsSpriteAnimsPtrTable[targetSpecies]; + gSprites[gBattlerSpriteIds[battlerAtk]].anims = gMonFrontAnimsPtrTable[targetSpecies]; LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[0]); LoadPalette(gBattleStruct->castformPalette[0] + gBattleMonForms[battlerDef] * 16, paletteOffset, 32); } diff --git a/src/battle_interface.c b/src/battle_interface.c index a8651f6cf..922437597 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -23,7 +23,8 @@ #include "battle_anim.h" #include "constants/battle_anim.h" #include "constants/rgb.h" -#include "data2.h" +#include "data.h" +#include "pokemon_summary_screen.h" struct TestingBar { @@ -157,8 +158,6 @@ enum HEALTHBOX_GFX_117, //unknown_D1300C }; -extern const u8 *const gNatureNamePointers[]; - // strings extern const u8 gText_Slash[]; extern const u8 gText_HighlightDarkGrey[]; diff --git a/src/battle_main.c b/src/battle_main.c index 92f12636d..7e564ce7f 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -13,7 +13,7 @@ #include "battle_tower.h" #include "berry.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "dma3.h" #include "event_data.h" diff --git a/src/battle_message.c b/src/battle_message.c index f93765b89..3fec571f4 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -5,7 +5,7 @@ #include "battle_message.h" #include "battle_setup.h" #include "battle_tower.h" -#include "data2.h" +#include "data.h" #include "event_data.h" #include "frontier_util.h" #include "international_string_util.h" @@ -38,7 +38,6 @@ struct BattleWindowText u8 shadowColor; }; -extern const u8 gTrainerClassNames[][13]; extern const u16 gUnknown_08D85620[]; // this file's functions diff --git a/src/battle_tower.c b/src/battle_tower.c index 46aab4bac..6f8e3e25f 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -18,7 +18,7 @@ #include "trainer_see.h" #include "new_game.h" #include "string_util.h" -#include "data2.h" +#include "data.h" #include "link.h" #include "field_message_box.h" #include "tv.h" diff --git a/src/battle_util.c b/src/battle_util.c index a7962b7f7..03f1482da 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2041,7 +2041,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA case ABILITY_FLASH_FIRE: if (moveType == TYPE_FIRE && !(gBattleMons[battler].status1 & STATUS1_FREEZE)) { - if (!(gBattleResources->flags->flags[battler] & UNKNOWN_FLAG_FLASH_FIRE)) + if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE)) { gBattleCommunication[MULTISTRING_CHOOSER] = 0; if (gProtectStructs[gBattlerAttacker].notFirstStrike) @@ -2049,7 +2049,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA else gBattlescriptCurrInstr = BattleScript_FlashFireBoost_PPLoss; - gBattleResources->flags->flags[battler] |= UNKNOWN_FLAG_FLASH_FIRE; + gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_FLASH_FIRE; effect = 2; } else diff --git a/src/bike.c b/src/bike.c index 530742bdf..7f84f350b 100644 --- a/src/bike.c +++ b/src/bike.c @@ -3,7 +3,7 @@ #include "event_object_movement.h" #include "field_player_avatar.h" #include "fieldmap.h" -#include "global.fieldmap.h" +#include "field_specials.h" #include "metatile_behavior.h" #include "overworld.h" #include "sound.h" @@ -11,9 +11,6 @@ #include "constants/map_types.h" #include "constants/songs.h" -extern bool8 gBikeCyclingChallenge; -extern u8 gBikeCollisions; - // this file's functions static void MovePlayerOnMachBike(u8, u16, u16); static u8 GetMachBikeTransition(u8 *); diff --git a/src/cable_club.c b/src/cable_club.c index fab187b07..303cc76d1 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -4,7 +4,7 @@ #include "battle_records.h" #include "battle_setup.h" #include "cable_club.h" -#include "data2.h" +#include "data.h" #include "event_data.h" #include "field_message_box.h" #include "field_specials.h" diff --git a/src/contest.c b/src/contest.c index 02d7038cf..b06335a1c 100644 --- a/src/contest.c +++ b/src/contest.c @@ -11,7 +11,7 @@ #include "battle.h" #include "battle_anim.h" #include "contest.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "graphics.h" #include "link.h" @@ -41,7 +41,7 @@ #include "contest_link_80FC4F4.h" #include "script_pokemon_util_80F87D8.h" #include "international_string_util.h" -#include "data2.h" +#include "data.h" #include "constants/rgb.h" #include "contest_ai.h" @@ -242,8 +242,6 @@ extern const u8 gText_Contest_Fear[]; extern const u8 gText_BDot[]; extern const u8 gText_CDot[]; extern const u8 *const gUnknown_08587E10[]; -extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; -extern const union AffineAnimCmd *const gUnknown_082FF694[]; extern const struct SpriteTemplate gSpriteTemplate_8587AD0; extern const struct SpriteTemplate gSpriteTemplate_8587B18[]; extern void (*const gContestEffectFuncs[])(void); diff --git a/src/contest_link_80F57C4.c b/src/contest_link_80F57C4.c index 59f41d72a..cf0e77c3c 100644 --- a/src/contest_link_80F57C4.c +++ b/src/contest_link_80F57C4.c @@ -6,6 +6,7 @@ #include "contest.h" #include "contest_link_80F57C4.h" #include "contest_link_80FC4F4.h" +#include "data.h" #include "decompress.h" #include "dma3.h" #include "event_data.h" @@ -86,7 +87,6 @@ struct ContestLink80F57C4 EWRAM_DATA struct ContestLink80F57C4 *gUnknown_0203A034 = NULL; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; extern const struct BgTemplate gUnknown_0858D888[4]; extern const struct WindowTemplate gUnknown_0858D898[]; extern const struct CompressedSpriteSheet gUnknown_0858D878[]; diff --git a/src/contest_painting.c b/src/contest_painting.c index 87598f2bd..b43923c7b 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -1,11 +1,12 @@ #include "global.h" #include "alloc.h" #include "battle.h" +#include "battle_gfx_sfx_util.h" #include "bg.h" #include "contest.h" #include "contest_painting.h" #include "contest_painting_effects.h" -#include "battle_gfx_sfx_util.h" +#include "data.h" #include "decompress.h" #include "gpu_regs.h" #include "international_string_util.h" @@ -44,8 +45,6 @@ static void VBlankCB_ContestPainting(void); static void sub_8130380(u8 *spritePixels, u16 *palette, u16 (*destColorBuffer)[64][64]); extern const u8 gUnknown_0827EA0C[]; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; -extern const struct CompressedSpriteSheet gMonBackPicTable[]; extern const u8 gContestCoolness[]; extern const u8 gContestBeauty[]; extern const u8 gContestCuteness[]; diff --git a/src/data.c b/src/data.c index b0d14d2af..7aebd63ed 100644 --- a/src/data.c +++ b/src/data.c @@ -284,7 +284,7 @@ static const union AnimCmd gUnknown_082FF704[] = ANIMCMD_END, }; -const union AnimCmd *const gPlayerMonSpriteAnimsTable[] = +const union AnimCmd *const gUnknown_082FF70C[] = { gUnknown_082FF6EC, gUnknown_082FF6F4, diff --git a/src/data/pokemon_graphics/footprint_table.h b/src/data/pokemon_graphics/footprint_table.h index 0128c08c0..86ca06790 100644 --- a/src/data/pokemon_graphics/footprint_table.h +++ b/src/data/pokemon_graphics/footprint_table.h @@ -1,4 +1,4 @@ -const u8 *const gMonFootprintTable[NUM_SPECIES] = +const u8 *const gMonFootprintTable[] = { [SPECIES_NONE] = gMonFootprint_Bulbasaur, [SPECIES_BULBASAUR] = gMonFootprint_Bulbasaur, diff --git a/src/data/pokemon_graphics/front_pic_anims.h b/src/data/pokemon_graphics/front_pic_anims.h index 8be6ed495..4c97af1a7 100644 --- a/src/data/pokemon_graphics/front_pic_anims.h +++ b/src/data/pokemon_graphics/front_pic_anims.h @@ -6948,7 +6948,7 @@ static const union AnimCmd *const sAnims_UNOWN_QMARK[] ={ #define ANIM_CMD(name) [SPECIES_##name] = sAnims_##name #define ANIM_CMD_FULL(name, anims) [SPECIES_##name] = anims -const union AnimCmd *const *const gMonAnimationsSpriteAnimsPtrTable[] = +const union AnimCmd *const *const gMonFrontAnimsPtrTable[] = { ANIM_CMD(NONE), ANIM_CMD(BULBASAUR), diff --git a/src/decompress.c b/src/decompress.c index 949b96990..46e4ef614 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -1,15 +1,13 @@ #include "global.h" -#include "decompress.h" -#include "constants/species.h" -#include "text.h" #include "alloc.h" +#include "data.h" +#include "decompress.h" #include "pokemon.h" +#include "text.h" +#include "constants/species.h" EWRAM_DATA ALIGNED(4) u8 gDecompressionBuffer[0x4000] = {0}; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; -extern const struct CompressedSpriteSheet gMonBackPicTable[]; - static void DuplicateDeoxysTiles(void *pointer, s32 species); void LZDecompressWram(const u32 *src, void *dest) diff --git a/src/easy_chat.c b/src/easy_chat.c index 4388592f7..b29a05bab 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -2,7 +2,7 @@ #include "alloc.h" #include "bard_music.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "dewford_trend.h" #include "dynamic_placeholder_text_util.h" diff --git a/src/egg_hatch.c b/src/egg_hatch.c index fc559e001..65601d64a 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -33,6 +33,7 @@ #include "naming_screen.h" #include "pokemon_storage_system.h" #include "field_screen_effect.h" +#include "data.h" #include "battle.h" // to get rid of later struct EggHatchData @@ -52,7 +53,6 @@ struct EggHatchData u8 textColor[3]; }; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; extern const u32 gUnknown_08331F60[]; // tilemap gameboy circle extern const u8 gText_HatchedFromEgg[]; extern const u8 gText_NickHatchPrompt[]; diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 8c4847b8d..4b8223b17 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -3,7 +3,7 @@ #include "battle.h" #include "battle_message.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "evolution_scene.h" #include "evolution_graphics.h" @@ -52,8 +52,6 @@ void (*gCB2_AfterEvolution)(void); #define sEvoCursorPos gBattleCommunication[1] // when learning a new move #define sEvoGraphicsTaskID gBattleCommunication[2] -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; - // this file's functions static void Task_EvolutionScene(u8 taskID); static void Task_TradeEvolutionScene(u8 taskID); diff --git a/src/field_effect.c b/src/field_effect.c index 93d7e5ef8..6fdf996f2 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -33,8 +33,6 @@ #define subsprite_table(ptr) {.subsprites = ptr, .subspriteCount = (sizeof ptr) / (sizeof(struct Subsprite))} -extern struct CompressedSpritePalette gMonPaletteTable[]; // GF made a mistake and did not extern it as const. - EWRAM_DATA s32 gFieldEffectArguments[8] = {0}; // Static type declarations @@ -237,7 +235,9 @@ static void Fldeff_MoveDeoxysRock_Step(u8 taskId); static IWRAM_DATA u8 sActiveList[32]; // External declarations - +extern struct CompressedSpritePalette gMonPaletteTable[]; // GF made a mistake and did not extern it as const. +extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; +extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; extern u8 *gFieldEffectScriptPointers[]; extern const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[]; diff --git a/src/field_specials.c b/src/field_specials.c index 20c2e6173..8bd990063 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -3,7 +3,7 @@ #include "battle.h" #include "battle_tower.h" #include "cable_club.h" -#include "data2.h" +#include "data.h" #include "decoration.h" #include "diploma.h" #include "event_data.h" @@ -59,20 +59,20 @@ EWRAM_DATA bool8 gBikeCyclingChallenge = FALSE; EWRAM_DATA u8 gBikeCollisions = 0; -EWRAM_DATA u32 gBikeCyclingTimer = 0; -EWRAM_DATA u8 gUnknown_0203AB5C = 0; -EWRAM_DATA u8 gUnknown_0203AB5D = 0; -EWRAM_DATA u8 gUnknown_0203AB5E = 0; -EWRAM_DATA u16 gUnknown_0203AB60 = 0; -EWRAM_DATA u16 gUnknown_0203AB62 = 0; -EWRAM_DATA struct ListMenuItem *gUnknown_0203AB64 = NULL; -EWRAM_DATA u16 gUnknown_0203AB68 = 0; -EWRAM_DATA u16 gUnknown_0203AB6A = 0; -EWRAM_DATA u8 gUnknown_0203AB6C = 0; -EWRAM_DATA u8 gUnknown_0203AB6D = 0; -EWRAM_DATA u8 gUnknown_0203AB6E = 0; -EWRAM_DATA u8 gUnknown_0203AB6F = 0; -EWRAM_DATA u32 gUnknown_0203AB70 = 0; +static EWRAM_DATA u32 gBikeCyclingTimer = 0; +static EWRAM_DATA u8 gUnknown_0203AB5C = 0; +static EWRAM_DATA u8 gUnknown_0203AB5D = 0; +static EWRAM_DATA u8 gUnknown_0203AB5E = 0; +static EWRAM_DATA u16 gUnknown_0203AB60 = 0; +static EWRAM_DATA u16 gUnknown_0203AB62 = 0; +static EWRAM_DATA struct ListMenuItem *gUnknown_0203AB64 = NULL; +static EWRAM_DATA u16 gUnknown_0203AB68 = 0; +static EWRAM_DATA u16 gUnknown_0203AB6A = 0; +static EWRAM_DATA u8 gUnknown_0203AB6C = 0; +static EWRAM_DATA u8 gUnknown_0203AB6D = 0; +static EWRAM_DATA u8 gUnknown_0203AB6E = 0; +static EWRAM_DATA u8 gUnknown_0203AB6F = 0; +static EWRAM_DATA u32 gUnknown_0203AB70 = 0; struct ListMenuTemplate gUnknown_030061D0; diff --git a/src/frontier_util.c b/src/frontier_util.c index bce7b926f..4dd8159cb 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -21,7 +21,7 @@ #include "apprentice.h" #include "pokedex.h" #include "recorded_battle.h" -#include "data2.h" +#include "data.h" #include "record_mixing.h" #include "strings.h" #include "alloc.h" diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 8eba90d96..fdf2020ff 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -32,7 +32,7 @@ #include "menu.h" #include "fldeff_misc.h" #include "trainer_pokemon_sprites.h" -#include "data2.h" +#include "data.h" #include "rom_81520A8.h" #include "constants/rgb.h" diff --git a/src/item_menu.c b/src/item_menu.c index 8edf6f279..c000b9563 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -8,7 +8,7 @@ #include "bg.h" #include "constants/items.h" #include "constants/songs.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "event_data.h" #include "event_object_movement.h" diff --git a/src/item_use.c b/src/item_use.c index 159ece398..8e28d48fd 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -7,7 +7,7 @@ #include "berry_powder.h" #include "bike.h" #include "coins.h" -#include "data2.h" +#include "data.h" #include "event_data.h" #include "event_object_movement.h" #include "fieldmap.h" diff --git a/src/match_call.c b/src/match_call.c index 641079ba9..35daacc3d 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -3,7 +3,7 @@ #include "battle.h" #include "battle_setup.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "event_data.h" #include "event_object_movement.h" #include "field_player_avatar.h" diff --git a/src/menu_specialized.c b/src/menu_specialized.c index b3f07fb46..3b73d3c06 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -2,7 +2,7 @@ #include "alloc.h" #include "battle_main.h" #include "contest_effect.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "gpu_regs.h" #include "graphics.h" diff --git a/src/move_relearner.c b/src/move_relearner.c index e148b9ace..0b0b4a5aa 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -3,7 +3,7 @@ #include "battle.h" #include "bg.h" #include "contest_effect.h" -#include "data2.h" +#include "data.h" #include "event_data.h" #include "field_screen_effect.h" #include "gpu_regs.h" diff --git a/src/naming_screen.c b/src/naming_screen.c index e43a259e7..ee68edbd0 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -21,7 +21,7 @@ #include "trig.h" #include "field_effect.h" #include "pokemon_icon.h" -#include "data2.h" +#include "data.h" #include "strings.h" #include "menu.h" #include "text_window.h" diff --git a/src/party_menu.c b/src/party_menu.c index 6233558ff..b1dd8b94a 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -10,7 +10,7 @@ #include "battle_pyramid_bag.h" #include "bg.h" #include "contest.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "easy_chat.h" #include "event_data.h" diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 59ba1b4dc..972ca4285 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -1,13 +1,14 @@ #include "global.h" -#include "battle.h" // to get rid of once gMonSpritesGfxPtr is put elsewhere +#include "alloc.h" +#include "battle.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "event_data.h" #include "gpu_regs.h" #include "graphics.h" +#include "item_menu.h" #include "main.h" -#include "alloc.h" #include "menu.h" #include "menu_helpers.h" #include "m4a.h" @@ -49,10 +50,8 @@ struct PokeblockFeedStruct u8 unused; }; -extern u16 gSpecialVar_ItemId; extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; extern const u16 gUnknown_0860F074[]; // this file's functions diff --git a/src/pokedex.c b/src/pokedex.c index cceb50ba1..8b18a0e73 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -1,7 +1,7 @@ #include "global.h" #include "battle_main.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "event_data.h" #include "gpu_regs.h" diff --git a/src/pokemon.c b/src/pokemon.c index a75701cb0..76a850d5a 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -9,6 +9,7 @@ #include "battle_pyramid.h" #include "battle_setup.h" #include "battle_tower.h" +#include "data.h" #include "event_data.h" #include "evolution_scene.h" #include "field_specials.h" @@ -51,29 +52,6 @@ struct SpeciesItem u16 item; }; -extern const struct SpriteFrameImage gUnknown_082FF3A8[]; -extern const struct SpriteFrameImage gUnknown_082FF3C8[]; -extern const struct SpriteFrameImage gUnknown_082FF3E8[]; -extern const struct SpriteFrameImage gUnknown_082FF408[]; -extern const struct SpriteFrameImage gTrainerBackPicTable_Brendan[]; -extern const struct SpriteFrameImage gTrainerBackPicTable_May[]; -extern const struct SpriteFrameImage gTrainerBackPicTable_Red[]; -extern const struct SpriteFrameImage gTrainerBackPicTable_Leaf[]; -extern const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireBrendan[]; -extern const struct SpriteFrameImage gTrainerBackPicTable_RubySapphireMay[]; -extern const struct SpriteFrameImage gTrainerBackPicTable_Wally[]; -extern const struct SpriteFrameImage gTrainerBackPicTable_Steven[]; -extern const union AffineAnimCmd *const gUnknown_082FF618[]; -extern const union AffineAnimCmd *const gUnknown_082FF694[]; -extern const union AnimCmd *gPlayerMonSpriteAnimsTable[]; -extern const union AnimCmd *const *const gMonAnimationsSpriteAnimsPtrTable[]; -extern const union AnimCmd *const *const gTrainerBackAnimsPtrTable[]; -extern const union AnimCmd *const *const gTrainerFrontAnimsPtrTable[]; -extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; -extern const struct CompressedSpritePalette gMonPaletteTable[]; -extern const struct CompressedSpritePalette gMonShinyPaletteTable[]; -extern const u8 gTrainerClassNames[][13]; - // this file's functions static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon); static union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType); @@ -3315,7 +3293,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de } // flash fire triggered - if ((gBattleResources->flags->flags[battlerIdAtk] & UNKNOWN_FLAG_FLASH_FIRE) && type == TYPE_FIRE) + if ((gBattleResources->flags->flags[battlerIdAtk] & RESOURCE_FLAG_FLASH_FIRE) && type == TYPE_FIRE) damage = (15 * damage) / 10; } @@ -3448,11 +3426,11 @@ void SetMultiuseSpriteTemplateToPokemon(u16 species, u8 battlerPosition) gMultiuseSpriteTemplate.paletteTag = species; if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT) - gMultiuseSpriteTemplate.anims = gPlayerMonSpriteAnimsTable; - else if (species > 500) - gMultiuseSpriteTemplate.anims = gMonAnimationsSpriteAnimsPtrTable[species - 500]; + gMultiuseSpriteTemplate.anims = gUnknown_082FF70C; + else if (species > SPECIES_SHINY_TAG) + gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[species - SPECIES_SHINY_TAG]; else - gMultiuseSpriteTemplate.anims = gMonAnimationsSpriteAnimsPtrTable[species]; + gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[species]; } void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition) @@ -6819,7 +6797,7 @@ static void sub_806F1FC(struct Unknown_806F160_Struct* structPtr) structPtr->frameImages[i * structPtr->field_0_0 + j].data = &structPtr->byteArrays[i][j * 0x800]; } structPtr->templates[i].images = &structPtr->frameImages[i * structPtr->field_0_0]; - structPtr->templates[i].anims = gPlayerMonSpriteAnimsTable; + structPtr->templates[i].anims = gUnknown_082FF70C; structPtr->templates[i].paletteTag = i; } } diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 98d83d8ce..f63e1ccba 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -1,4 +1,5 @@ #include "global.h" +#include "data.h" #include "event_data.h" #include "pokedex.h" #include "pokemon.h" @@ -45,7 +46,6 @@ static const u8 sGiftRibbonsMonDataIds[] = extern const u8 gText_DecimalPoint[]; extern const u8 gText_Marco[]; -extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; #define CM_PER_INCH 2.54 diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index fb1be0698..148be7c5c 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1,7 +1,7 @@ #include "global.h" #include "alloc.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "dma3.h" #include "dynamic_placeholder_text_util.h" @@ -463,8 +463,6 @@ EWRAM_DATA static u8 sMovingMonOrigBoxId = 0; EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sCanOnlyMove = 0; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; - // This file's functions. static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr); static void Cb2_EnterPSS(u8 boxOption); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 3a5b06d45..2ec088628 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -9,7 +9,7 @@ #include "bg.h" #include "contest.h" #include "contest_effect.h" -#include "data2.h" +#include "data.h" #include "daycare.h" #include "decompress.h" #include "dynamic_placeholder_text_util.h" @@ -164,7 +164,6 @@ static EWRAM_DATA struct PokemonSummaryScreenData EWRAM_DATA u8 gLastViewedMonIndex = 0; static EWRAM_DATA u8 sUnknown_0203CF21 = 0; ALIGNED(4) static EWRAM_DATA u8 sUnknownTaskId = 0; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; struct UnkStruct_61CC04 { diff --git a/src/pokenav_match_call.c b/src/pokenav_match_call.c index ce00401a9..1f621922d 100644 --- a/src/pokenav_match_call.c +++ b/src/pokenav_match_call.c @@ -1,13 +1,12 @@ #include "global.h" #include "battle_setup.h" +#include "data.h" #include "event_data.h" #include "string_util.h" #include "battle.h" #include "gym_leader_rematch.h" #include "match_call.h" -extern const u8 gTrainerClassNames[][13]; - // Static type declarations typedef struct MatchCallTextDataStruct { diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index dd177f884..b804d2591 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -15,9 +15,7 @@ #include "constants/trainers.h" #include "battle_interface.h" #include "battle_anim.h" -#include "data2.h" - -extern const union AnimCmd * const * const gMonAnimationsSpriteAnimsPtrTable[]; +#include "data.h" // this file's functions static void CB2_ReshowBattleScreenAfterMenu(void); @@ -233,7 +231,7 @@ static void CreateBattlerSprite(u8 battler) StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]); if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM) - gSprites[gBattlerSpriteIds[battler]].anims = gMonAnimationsSpriteAnimsPtrTable[SPECIES_CASTFORM]; + gSprites[gBattlerSpriteIds[battler]].anims = gMonFrontAnimsPtrTable[SPECIES_CASTFORM]; } else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && battler == B_POSITION_PLAYER_LEFT) { @@ -269,7 +267,7 @@ static void CreateBattlerSprite(u8 battler) StartSpriteAnim(&gSprites[gBattlerSpriteIds[battler]], gBattleMonForms[battler]); if (gBattleSpritesDataPtr->battlerData[battler].transformSpecies == SPECIES_CASTFORM) - gSprites[gBattlerSpriteIds[battler]].anims = gMonAnimationsSpriteAnimsPtrTable[SPECIES_CASTFORM]; + gSprites[gBattlerSpriteIds[battler]].anims = gMonFrontAnimsPtrTable[SPECIES_CASTFORM]; } gSprites[gBattlerSpriteIds[battler]].invisible = gBattleSpritesDataPtr->battlerData[battler].invisible; diff --git a/src/scanline_effect.c b/src/scanline_effect.c index a9ae9427b..0a4b0b8fd 100644 --- a/src/scanline_effect.c +++ b/src/scanline_effect.c @@ -1,6 +1,6 @@ #include "global.h" #include "battle.h" -#include "data2.h" +#include "data.h" #include "task.h" #include "trig.h" #include "scanline_effect.h" diff --git a/src/scrcmd.c b/src/scrcmd.c index 125a57c01..4dc494790 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -7,7 +7,7 @@ #include "contest.h" #include "contest_link_80F57C4.h" #include "contest_painting.h" -#include "data2.h" +#include "data.h" #include "decoration.h" #include "decoration_inventory.h" #include "event_data.h" diff --git a/src/script_pokemon_util_80F87D8.c b/src/script_pokemon_util_80F87D8.c index ece030395..2f32951ed 100755 --- a/src/script_pokemon_util_80F87D8.c +++ b/src/script_pokemon_util_80F87D8.c @@ -5,6 +5,7 @@ #include "contest.h" #include "contest_link_80F57C4.h" #include "contest_painting.h" +#include "data.h" #include "daycare.h" #include "decompress.h" #include "event_data.h" @@ -35,7 +36,6 @@ extern const u16 gEventObjectPalette8[]; extern const u16 gEventObjectPalette17[]; extern const u16 gEventObjectPalette33[]; extern const u16 gEventObjectPalette34[]; -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; static const u8 gUnknown_0858D8EC[] = { 3, 4, 5, 14 }; diff --git a/src/shop.c b/src/shop.c index 32caafb64..ab7f31c1f 100755 --- a/src/shop.c +++ b/src/shop.c @@ -1,6 +1,6 @@ #include "global.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "decoration.h" #include "decoration_inventory.h" diff --git a/src/smokescreen.c b/src/smokescreen.c index d9780bbb6..61e011451 100644 --- a/src/smokescreen.c +++ b/src/smokescreen.c @@ -1,11 +1,15 @@ #include "global.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "sprite.h" #include "util.h" static void sub_8075370(struct Sprite *); +extern const struct CompressedSpriteSheet gUnknown_0831C620; +extern const struct CompressedSpritePalette gUnknown_0831C628; +extern const struct SpriteTemplate gUnknown_0831C688; + u8 sub_807521C(s16 x, s16 y, u8 a3) { u8 mainSpriteId; diff --git a/src/starter_choose.c b/src/starter_choose.c index c3d636175..c3957e403 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -1,6 +1,6 @@ #include "global.h" #include "bg.h" -#include "data2.h" +#include "data.h" #include "decompress.h" #include "event_data.h" #include "gpu_regs.h" diff --git a/src/trade.c b/src/trade.c index 80c74d2cd..353ba4ce3 100644 --- a/src/trade.c +++ b/src/trade.c @@ -4,7 +4,7 @@ #include "battle_interface.h" #include "bg.h" #include "cable_club.h" -#include "data2.h" +#include "data.h" #include "daycare.h" #include "decompress.h" #include "event_data.h" @@ -1384,10 +1384,6 @@ static const u8 gUnknown_08339090[][2] = {0, 0} }; -// external to this file -extern const struct CompressedSpriteSheet gMonFrontPicTable[]; -extern const struct MonCoords gMonFrontPicCoords[]; - static bool8 sub_8077170(const void *a0, u32 a1) { if (gUnknown_02022C2C == 29) diff --git a/src/trainer_pokemon_sprites.c b/src/trainer_pokemon_sprites.c index 8172f09e6..6824e8747 100644 --- a/src/trainer_pokemon_sprites.c +++ b/src/trainer_pokemon_sprites.c @@ -6,21 +6,10 @@ #include "palette.h" #include "decompress.h" #include "trainer_pokemon_sprites.h" -#include "data2.h" +#include "data.h" #include "pokemon.h" #include "constants/trainers.h" -extern const struct CompressedSpriteSheet gMonFrontPicTable[NUM_SPECIES]; -extern const struct CompressedSpriteSheet gMonBackPicTable[NUM_SPECIES]; -extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; -extern const struct CompressedSpriteSheet gTrainerBackPicTable[]; -extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; -extern const union AffineAnimCmd *const gUnknown_082FF618[]; -extern const union AffineAnimCmd *const gUnknown_082FF694[]; -extern const union AnimCmd *const gPlayerMonSpriteAnimsTable[]; -extern const union AnimCmd *const *const gMonAnimationsSpriteAnimsPtrTable[NUM_SPECIES]; -extern const union AnimCmd *const *const gTrainerFrontAnimsPtrTable[]; - // Static type declarations struct PicData @@ -149,7 +138,7 @@ static void LoadPicPaletteBySlot(u16 species, u32 otId, u32 personality, u8 pale static void AssignSpriteAnimsTable(bool8 isTrainer) { if (!isTrainer) - sCreatingSpriteTemplate.anims = gPlayerMonSpriteAnimsTable; + sCreatingSpriteTemplate.anims = gUnknown_082FF70C; else sCreatingSpriteTemplate.anims = gTrainerFrontAnimsPtrTable[0]; } @@ -270,7 +259,7 @@ u16 CreatePicSprite2(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s1 images[j].size = 0x800; } sCreatingSpriteTemplate.tileTag = 0xFFFF; - sCreatingSpriteTemplate.anims = gMonAnimationsSpriteAnimsPtrTable[species]; + sCreatingSpriteTemplate.anims = gMonFrontAnimsPtrTable[species]; sCreatingSpriteTemplate.images = images; if (flags2 == 0x01) { diff --git a/src/tv.c b/src/tv.c index 17243a456..7b5252add 100644 --- a/src/tv.c +++ b/src/tv.c @@ -37,7 +37,7 @@ #include "decoration.h" #include "secret_base.h" #include "tv.h" -#include "data2.h" +#include "data.h" #include "constants/layouts.h" #include "constants/metatile_behaviors.h" diff --git a/src/union_room.c b/src/union_room.c index ea3658903..687efbf5e 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -32,7 +32,7 @@ #include "palette.h" #include "decompress.h" #include "start_menu.h" -#include "data2.h" +#include "data.h" #include "field_screen_effect.h" #include "script_pokemon_util_80F87D8.h" #include "international_string_util.h" diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index 4eaf60be4..f28b651cc 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -21,6 +21,8 @@ #include "menu.h" #include "gpu_regs.h" #include "graphics.h" +#include "pokemon_summary_screen.h" +#include "item_menu.h" struct UsePokeblockSubStruct { @@ -83,8 +85,6 @@ struct UsePokeblockStruct /*0x7FD0*/ struct UsePokeblockSubStruct info; }; -extern u16 gKeyRepeatStartDelay; - extern void sub_81D21DC(u8); // this file's functions @@ -133,7 +133,6 @@ void sub_8168168(struct Sprite *sprite); extern const struct BgTemplate gUnknown_085DFCCC[4]; extern const struct WindowTemplate gUnknown_085DFCDC[]; -extern u16 gSpecialVar_ItemId; extern const struct WindowTemplate sUsePokeblockYesNoWinTemplate[]; extern const u8* sContestStatNames[]; extern const u32 gUnknown_085DFCB0[]; @@ -152,8 +151,6 @@ extern const u8 gUnknown_085DFCC9[]; extern const struct SpritePalette gUnknown_085DFDB8; extern const struct SpriteTemplate gUnknown_085DFDA0; -extern const u8 *const gNatureNamePointers[]; - // ram variables EWRAM_DATA struct UsePokeblockSubStruct *gUnknown_0203BC90 = NULL; EWRAM_DATA void (*gUnknown_0203BC94)(void) = NULL;