clean up include and add ewram for pokemon.c

This commit is contained in:
Seth Barberee 2024-12-06 16:03:33 -08:00
parent 456dfec6b0
commit fd1e3ad981
17 changed files with 28 additions and 45 deletions

View File

@ -81,6 +81,8 @@ OpenedFile *GetDialogueSpriteDataPtr(s32 index);
s32 GetUnownIndex(s16 index);
void GenerateHiddenPower(HiddenPower *);
s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *);
s32 sub_808E400(s32 _species, s16* _a2, bool32 _bodySizeCheck, bool32 _shedinjaCheck);
void sub_808E490(Move* a1, s32 species);
void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 *, PokemonStruct1 *, s32);
void WritePoke1Bits(DataSerializer *, PokemonStruct1 *pokemon);
void ReadPoke1Bits(DataSerializer *, PokemonStruct1 *);
@ -96,10 +98,13 @@ PokemonStruct1 * sub_808D434(s16 species, s32 param_2);
s32 GetFriendSum_808D480(void);
bool8 sub_808D4B0(void);
bool8 sub_808D500(void);
// pokemon.s
extern s32 GetUnitSum_808D544(s32 *);
extern s32 sub_808D580(s32 *);
s32 GetUnitSum_808D544(s32 *);
s32 sub_808D580(s32 *);
bool8 ComparePokemonNames(s16, s16);
void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level);
const u8* DecompressMoveID(const u8* a1, u16* moveID);
bool8 sub_808DA44(s32, u32);
static inline bool8 PokemonFlag1(PokemonStruct1 *mon)
{

View File

@ -3,12 +3,8 @@
#include "pokemon.h"
bool8 ComparePokemonNames(s16, s16);
// NOTE: this is kept separate since TransferOrbAction needs index to be s32
// and I haven't had the time to fix matching
void CopyCyanMonsterNametoBuffer(u8 *buffer, s16 index);
void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level);
const u8* DecompressMoveID(const u8* a1, u16* moveID);
bool8 sub_808DA44(s32, u32);
#endif // GUARD_POKEMON_MID_H

View File

@ -7,7 +7,7 @@
#include "gulpin_shop.h"
#include "memory.h"
#include "moves.h"
#include "pokemon_mid.h"
#include "pokemon.h"
static EWRAM_DATA_2 unkStruct_203B22C *sUnknown_203B22C = {0};

View File

@ -3,7 +3,6 @@
#include "code_800D090.h"
#include "code_8023868.h"
#include "pokemon.h"
#include "pokemon_mid.h"
#include "structs/str_text.h"
#include "text_util.h"
@ -172,4 +171,4 @@ UNUSED static PokemonStruct1 *sub_80243E8(void)
sub_80922B4(nameBuffer, pokeStruct->name, POKEMON_NAME_LENGTH);
sprintfStatic(buffer, sUnknown_80DC9A4, nameBuffer);
return pokeStruct;
}
}

View File

@ -26,7 +26,7 @@
#include "code_803E668.h"
#include "dungeon_engine.h"
#include "dungeon_map_access.h"
#include "pokemon_mid.h"
#include "pokemon.h"
#include "weather.h"
#include "moves.h"
#include "code_8094F88.h"

View File

@ -1,5 +1,5 @@
#include "global.h"
#include "pokemon_mid.h"
#include "pokemon.h"
#include "dungeon_util.h"
#include "code_8069D4C.h"

View File

@ -21,7 +21,6 @@
#include "move_effects_target.h"
#include "moves.h"
#include "pokemon.h"
#include "pokemon_mid.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "text_util.h"

View File

@ -18,7 +18,6 @@
#include "game_options.h"
#include "dungeon_items.h"
#include "status.h"
#include "pokemon_mid.h"
#include "pokemon.h"
#include "random.h"
#include "targeting.h"

View File

@ -54,8 +54,6 @@ extern bool8 sub_806AA0C(s32, u32);
extern bool8 sub_8083660(DungeonPos *param_1);
extern bool8 sub_803D930(u32);
extern void sub_8072B78(Entity *pokemon, Entity *target, s16 id);
extern s32 sub_808E400(s32 _species, s16* _a2, bool32 bodySizeCheck, bool32 shedinjaCheck);
void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); // TODO: change to s32
void sub_8071B48(void)
{

View File

@ -8,7 +8,6 @@
#include "dungeon_util.h"
#include "moves.h"
#include "pokemon_mid.h"
#include "pokemon_mid.h"
#include "status_checks_1.h"
#include "structs/dungeon_entity.h"
#include "structs/map.h"

View File

@ -5,7 +5,7 @@
#include "dungeon.h"
#include "memory.h"
#include "moves.h"
#include "pokemon_mid.h"
#include "pokemon.h"
#include "random.h"
#include "save.h"
#include "text_util.h"
@ -468,4 +468,4 @@ void sub_8095824(DataSerializer * a, unkStruct_203B480 *b)
void sub_80958E4(u32 *a, u32 b)
{
*a = b;
}
}

View File

@ -16,7 +16,7 @@
#include "menu_input.h"
#include "moves.h"
#include "pokemon_3.h"
#include "pokemon_mid.h"
#include "pokemon.h"
#include "text.h"
EWRAM_DATA_2 unkStruct_203B27C *gUnknown_203B27C = {0};

View File

@ -2,7 +2,6 @@
#include "globaldata.h"
#include "code_802F204.h"
#include "pokemon.h"
#include "pokemon_mid.h"
#include "rescue_team_info.h"
#include "friend_area.h"
#include "input.h"

View File

@ -15,15 +15,15 @@
extern struct FileArchive gSystemFileArchive;
extern struct FileArchive gMonsterFileArchive;
EWRAM_DATA MonsterDataEntry *gMonsterParameters;
EWRAM_DATA OpenedFile *gMonsterParametersFile;
EWRAM_DATA SpriteOAM gShadowSprites[3]; // Shadow sprites of some kind
EWRAM_DATA unkStruct_203B45C gRecruitedPokemon;
EWRAM_DATA u16 gLevelCurrentPokeId;
EWRAM_DATA LevelData gLevelCurrentData[0x64];
static EWRAM_DATA MonsterDataEntry *gMonsterParameters = {0};
static EWRAM_DATA OpenedFile *gMonsterParametersFile = {0};
EWRAM_DATA SpriteOAM gShadowSprites[3] = {0}; // TODO: make static once pokemon_2.s is ded
static EWRAM_DATA unkStruct_203B45C gRecruitedPokemon = {0};
static EWRAM_DATA u16 gLevelCurrentPokeId = {0};
UNUSED static EWRAM_DATA u16 unused_data[3] = {0};
static EWRAM_DATA LevelData gLevelCurrentData[0x64] = {0};
EWRAM_DATA_2 unkStruct_203B45C *gRecruitedPokemonRef = {0};
extern void sub_808E490(Move* a1, s32 species);
struct unkStruct_8107654 {
s16 unk0;

View File

@ -5,7 +5,7 @@
#include "game_options.h"
#include "input.h"
#include "pokemon_mail.h"
#include "pokemon_mid.h"
#include "pokemon.h"
#include "pokemon_news2.h"
#include "memory.h"
#include "menu_input.h"

View File

@ -11,7 +11,7 @@
#include "memory.h"
#include "menu_input.h"
#include "pokemon_mail.h"
#include "pokemon_mid.h"
#include "pokemon.h"
#include "pokemon_news3.h"
#include "structs/str_802C39C.h"
#include "text.h"

View File

@ -276,19 +276,8 @@ gUnknown_202F3D0: /* 202F3D0 (sub_80867F4 - sub_8086854) */
gUnknown_202F3D8: /* 202F3D8 (sub_8085B4C - sub_8085B80) */
.space 0x8
gMonsterParameters: /* 202F3E0 (LoadMonsterParameters - IsPokemonDialogueSpriteAvail) */
.space 0x4
gMonsterParametersFile: /* 202F3E4 (LoadMonsterParameters) */
.space 0x4
gShadowSprites: /* 202F3E8 (InitShadowSprites - AddShadowSprite) */
.space 0x18
gRecruitedPokemon: /* 202F400 [used everywhere tbh] */
.space 0x90E8
gLevelCurrentPokeId: /* 20384E8 (LoadMonsterParameters - GetPokemonLevelData) */
.space 0x8
gLevelCurrentData: /* 20384F0 (GetPokemonLevelData) */
.space 0x4B0
.include "src/pokemon.o"
.include "src/items.o"
.include "src/rescue_team_info.o"
.space 0x4