From b97f79cb72d8ad52b5750179058b3a7e97bf81f5 Mon Sep 17 00:00:00 2001 From: Adrienn Tindall <33725376+adrienntindall@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:52:55 -0500 Subject: [PATCH 1/4] Update Consts, Remove "Data" notation --- docs/bugs_and_glitches.md | 2 +- include/battle/ov16_0223DF00.h | 228 ++--- include/constants/battle.h | 8 +- include/field_battle_data_transfer.h | 4 +- include/game_records.h | 2 +- include/overlay021/struct_ov21_021D0D80.h | 2 +- include/overlay021/struct_ov21_021D3208.h | 2 +- include/overlay021/struct_ov21_021D3320.h | 2 +- include/overlay088/struct_ov88_0223C370.h | 2 +- include/overlay094/ov94_022414B8.h | 2 +- include/rtc.h | 10 +- include/string_template.h | 4 +- include/struct_decls/pokedexdata_decl.h | 2 +- include/struct_defs/battle_system.h | 12 +- include/struct_defs/struct_0202FAA8.h | 2 +- include/struct_defs/struct_0203E0FC.h | 2 +- include/struct_defs/struct_0203E274.h | 2 +- include/struct_defs/struct_0207AE68_t.h | 2 +- include/struct_defs/trainer_data.h | 4 +- include/trainer_data.h | 14 +- include/unk_0202631C.h | 84 +- include/unk_0202CC64.h | 2 +- include/unk_0206AFE0.h | 138 +-- include/unk_0207A274.h | 2 +- include/unk_0207AE68.h | 2 +- include/unk_0209747C.h | 2 +- .../scripts/subscripts/subscript_pursuit.s | 4 +- .../subscripts/subscript_switch_pokemon.s | 2 +- src/battle/battle_controller.c | 16 +- src/battle/battle_display.c | 30 +- src/battle/battle_io.c | 4 +- src/battle/battle_lib.c | 12 +- src/battle/battle_script.c | 68 +- src/battle/ov16_0223B140.c | 162 ++-- src/battle/ov16_0223DF00.c | 918 +++++++++--------- src/battle/trainer_ai/trainer_ai.c | 8 +- src/enc_effects.c | 2 +- src/encounter.c | 32 +- src/field_battle_data_transfer.c | 70 +- src/field_menu.c | 2 +- src/game_records.c | 2 +- src/overlay005/ov5_021F77A8.c | 2 +- src/overlay005/save_info_window.c | 2 +- src/overlay006/ov6_02240C9C.c | 10 +- src/overlay006/ov6_02246A30.c | 4 +- src/overlay010/ov10_0221F800.c | 16 +- src/overlay013/ov13_0221FC20.c | 2 +- src/overlay021/ov21_021DC9BC.c | 4 +- src/overlay021/pokedex_sort.c | 28 +- src/overlay028/ov28_022561C0.c | 2 +- src/overlay062/ov62_02237D24.c | 4 +- src/overlay062/ov62_02241204.c | 4 +- src/overlay062/ov62_02248408.c | 8 +- src/overlay065/ov65_0222DCE0.c | 2 +- src/overlay066/ov66_0222DDF0.c | 2 +- src/overlay081/ov81_021D1610.c | 2 +- src/overlay094/ov94_022414B8.c | 6 +- src/overlay097/ov97_0222AE60.c | 2 +- src/overlay097/ov97_0222C174.c | 2 +- src/overlay104/ov104_0222DCE0.c | 8 +- src/overlay104/ov104_0223A0C4.c | 2 +- src/overlay104/ov104_0223A7F4.c | 2 +- src/overlay104/ov104_0223AF58.c | 2 +- src/overlay104/ov104_0223B6F4.c | 2 +- src/overlay104/ov104_0223BCBC.c | 2 +- src/rtc.c | 52 +- src/scrcmd.c | 24 +- src/scrcmd_system_flags.c | 4 +- src/script_manager.c | 2 +- src/string_template.c | 8 +- src/trainer_data.c | 48 +- src/unk_0202631C.c | 168 ++-- src/unk_0202CC64.c | 2 +- src/unk_0202F180.c | 2 +- src/unk_0202F1D4.c | 4 +- src/unk_020474B8.c | 4 +- src/unk_0204AEE8.c | 2 +- src/unk_0204C500.c | 2 +- src/unk_020553DC.c | 2 +- src/unk_0206AFE0.c | 4 +- src/unk_0206CCB0.c | 14 +- src/unk_0207A274.c | 4 +- src/unk_0207A6DC.c | 28 +- src/unk_0207AE68.c | 4 +- src/unk_0208BA78.c | 2 +- src/unk_020933F8.c | 4 +- src/unk_0209747C.c | 4 +- src/unk_020998EC.c | 2 +- 88 files changed, 1189 insertions(+), 1191 deletions(-) diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md index 84f8d63341..641f4198fd 100644 --- a/docs/bugs_and_glitches.md +++ b/docs/bugs_and_glitches.md @@ -73,7 +73,7 @@ or Uproar is in effect. **Fix:** Edit [`res/battle/res/scripts/subscript_pursuit.s`](https://github.com/pret/pokeplatinum/blob/main/res/battle/scripts/subscripts/subscript_pursuit.s) ```diff - UpdateVar OPCODE_ADD, BTLVAR_FAINTED_MON, BATTLER_ENEMY_SLOT_1 + UpdateVar OPCODE_ADD, BTLVAR_FAINTED_MON, BATTLER_ENEMY_1 UpdateVar OPCODE_RIGHT_SHIFT, BTLVAR_CALC_TEMP, 0x00000001 CompareVarToValue OPCODE_NEQ, BTLVAR_CALC_TEMP, 0x00000000, _208 - // BUG: Acid Rain (see docs/bugs_and_glitches.md) diff --git a/include/battle/ov16_0223DF00.h b/include/battle/ov16_0223DF00.h index 76a7b507e2..e035a4fd5d 100644 --- a/include/battle/ov16_0223DF00.h +++ b/include/battle/ov16_0223DF00.h @@ -40,7 +40,7 @@ #define ENEMY_IN_SLOT_RIGHT 0 #define ENEMY_IN_SLOT_LEFT 2 -BgConfig *BattleSystem_BGL(BattleSystem *param0); +BgConfig *BattleSystem_BGL(BattleSystem *battleSys); /** * @brief Get one of the allocated windows for the battle display. @@ -50,11 +50,11 @@ BgConfig *BattleSystem_BGL(BattleSystem *param0); * @return */ Window *BattleSystem_Window(BattleSystem *battleSys, int idx); -u32 BattleSystem_BattleType(BattleSystem *param0); -BattleContext *BattleSystem_Context(BattleSystem *param0); -BattlerData *BattleSystem_BattlerData(BattleSystem *param0, int param1); -int BattleSystem_MaxBattlers(BattleSystem *param0); -Party *BattleSystem_Party(BattleSystem *param0, int param1); +u32 BattleSystem_BattleType(BattleSystem *battleSys); +BattleContext *BattleSystem_Context(BattleSystem *battleSys); +BattlerData *BattleSystem_BattlerData(BattleSystem *battleSys, int param1); +int BattleSystem_MaxBattlers(BattleSystem *battleSys); +Party *BattleSystem_Party(BattleSystem *battleSys, int param1); /** * @brief Get the party count for a particular battler. @@ -84,31 +84,31 @@ int BattleSystem_PartyCount(BattleSystem *battleSys, int battler); * @return Pointer to the Pokemon struct in that battler's party slot. */ Pokemon *BattleSystem_PartyPokemon(BattleSystem *battleSys, int battler, int slot); -UnkStruct_02007768 *ov16_0223E000(BattleSystem *param0); -UnkStruct_ov12_0221FCDC *ov16_0223E008(BattleSystem *param0); -SpriteRenderer *ov16_0223E010(BattleSystem *param0); -SpriteGfxHandler *ov16_0223E018(BattleSystem *param0); -UnkStruct_ov16_02268520 *ov16_0223E020(BattleSystem *param0, int param1); -UnkStruct_ov16_02268A14 *ov16_0223E02C(BattleSystem *param0); -PartyGauge *ov16_0223E034(BattleSystem *param0, enum PartyGaugeSide param1); -void ov16_0223E040(BattleSystem *param0, enum PartyGaugeSide param1, PartyGauge *param2); -UnkStruct_0200C440 *ov16_0223E04C(BattleSystem *param0); -UnkStruct_0200C440 *ov16_0223E054(BattleSystem *param0); -MessageLoader *BattleSystem_MessageLoader(BattleSystem *param0); -MessageLoader *ov16_0223E060(BattleSystem *param0); -PaletteData *BattleSystem_PaletteSys(BattleSystem *param0); -PokedexData *ov16_0223E068(BattleSystem *param0); -u8 *ov16_0223E06C(BattleSystem *param0); -u8 *ov16_0223E074(BattleSystem *param0); -u16 *ov16_0223E080(BattleSystem *param0); -u16 *ov16_0223E08C(BattleSystem *param0); -u16 *ov16_0223E098(BattleSystem *param0); -u16 *ov16_0223E0A4(BattleSystem *param0); -u16 *ov16_0223E0B0(BattleSystem *param0); -u16 *ov16_0223E0BC(BattleSystem *param0); -UnkStruct_ov16_0223E0C8 *ov16_0223E0C8(BattleSystem *param0); -StringTemplate *BattleSystem_StringTemplate(BattleSystem *param0); -Strbuf *ov16_0223E0D4(BattleSystem *param0); +UnkStruct_02007768 *ov16_0223E000(BattleSystem *battleSys); +UnkStruct_ov12_0221FCDC *ov16_0223E008(BattleSystem *battleSys); +SpriteRenderer *ov16_0223E010(BattleSystem *battleSys); +SpriteGfxHandler *ov16_0223E018(BattleSystem *battleSys); +UnkStruct_ov16_02268520 *ov16_0223E020(BattleSystem *battleSys, int param1); +UnkStruct_ov16_02268A14 *ov16_0223E02C(BattleSystem *battleSys); +PartyGauge *ov16_0223E034(BattleSystem *battleSys, enum PartyGaugeSide param1); +void ov16_0223E040(BattleSystem *battleSys, enum PartyGaugeSide param1, PartyGauge *param2); +UnkStruct_0200C440 *ov16_0223E04C(BattleSystem *battleSys); +UnkStruct_0200C440 *ov16_0223E054(BattleSystem *battleSys); +MessageLoader *BattleSystem_MessageLoader(BattleSystem *battleSys); +MessageLoader *ov16_0223E060(BattleSystem *battleSys); +PaletteData *BattleSystem_PaletteSys(BattleSystem *battleSys); +Pokedex *BattleSystem_GetPokedex(BattleSystem *battleSys); +u8 *ov16_0223E06C(BattleSystem *battleSys); +u8 *ov16_0223E074(BattleSystem *battleSys); +u16 *ov16_0223E080(BattleSystem *battleSys); +u16 *ov16_0223E08C(BattleSystem *battleSys); +u16 *ov16_0223E098(BattleSystem *battleSys); +u16 *ov16_0223E0A4(BattleSystem *battleSys); +u16 *ov16_0223E0B0(BattleSystem *battleSys); +u16 *ov16_0223E0BC(BattleSystem *battleSys); +UnkStruct_ov16_0223E0C8 *ov16_0223E0C8(BattleSystem *battleSys); +StringTemplate *BattleSystem_StringTemplate(BattleSystem *battleSys); +Strbuf *ov16_0223E0D4(BattleSystem *battleSys); /** * @brief Get the trainer ID for a particular battler. @@ -118,7 +118,7 @@ Strbuf *ov16_0223E0D4(BattleSystem *param0); * @return The battler's trainer ID */ u16 Battler_TrainerID(BattleSystem *battleSys, int battler); -TrainerData *BattleSystem_TrainerData(BattleSystem *param0, int param1); +Trainer *BattleSystem_GetTrainer(BattleSystem *battleSys, int param1); /** * @brief Get the trainer info for a particular battler. @@ -128,9 +128,9 @@ TrainerData *BattleSystem_TrainerData(BattleSystem *param0, int param1); * @return The trainer info for the requested battler. */ TrainerInfo *BattleSystem_TrainerInfo(BattleSystem *battleSys, int battler); -Bag *BattleSystem_Bag(BattleSystem *param0); -BagCursor *BattleSystem_BagCursor(BattleSystem *param0); -u32 ov16_0223E1B4(BattleSystem *param0, int param1); +Bag *BattleSystem_Bag(BattleSystem *battleSys); +BagCursor *BattleSystem_BagCursor(BattleSystem *battleSys); +u32 BattleSystem_GetTrainerGender(BattleSystem *battleSys, int param1); /** * @brief Get a battler of a particular type. @@ -140,10 +140,10 @@ u32 ov16_0223E1B4(BattleSystem *param0, int param1); * @return ID of the battler of the given type. */ int BattleSystem_BattlerOfType(BattleSystem *battleSys, int type); -u8 BattleSystem_BattlerSlot(BattleSystem *param0, int param1); -u8 Battler_Side(BattleSystem *param0, int param1); -void *ov16_0223E220(BattleSystem *param0); -PCBoxes *ov16_0223E228(BattleSystem *param0); +u8 BattleSystem_BattlerSlot(BattleSystem *battleSys, int param1); +u8 Battler_Side(BattleSystem *battleSys, int param1); +void *ov16_0223E220(BattleSystem *battleSys); +PCBoxes *ov16_0223E228(BattleSystem *battleSys); /** * @brief Get the terrain type for the battle. @@ -152,9 +152,9 @@ PCBoxes *ov16_0223E228(BattleSystem *param0); * @return The battle's terrain. */ enum Terrain BattleSystem_Terrain(BattleSystem *battleSys); -int ov16_0223E240(BattleSystem *param0); -int BattleSystem_MapHeader(BattleSystem *param0); -int BattleSystem_Partner(BattleSystem *param0, int param1); +int ov16_0223E240(BattleSystem *battleSys); +int BattleSystem_MapHeader(BattleSystem *battleSys); +int BattleSystem_Partner(BattleSystem *battleSys, int param1); /** * @brief Get the battler who is an enemy of the input attacker and occupies @@ -181,7 +181,7 @@ int BattleSystem_EnemyInSlot(BattleSystem *battleSys, int attacker, int slot); * @return TRUE if the item has an effect; FALSE otherwise */ BOOL BattleSystem_UseBagItem(BattleSystem *battleSys, int battler, int partySlot, int moveSlot, int item); -u32 BattleSystem_BattleStatus(BattleSystem *param0); +u32 BattleSystem_BattleStatus(BattleSystem *battleSys); /** * @brief Get the time of day. @@ -190,14 +190,14 @@ u32 BattleSystem_BattleStatus(BattleSystem *param0); * @return The time of day (e.g., morning, day, night) */ enum Time BattleSystem_Time(BattleSystem *battleSys); -int ov16_0223EC04(BattleSystem *param0); -u8 ov16_0223EC58(BattleSystem *param0, int param1, u8 param2); +int ov16_0223EC04(BattleSystem *battleSys); +u8 ov16_0223EC58(BattleSystem *battleSys, int param1, u8 param2); u16 ov16_0223ECC4(FieldBattleDTO *param0, int *param1, int *param2); -u8 ov16_0223ED60(BattleSystem *param0); -u8 ov16_0223ED6C(BattleSystem *param0); -int BattleSystem_NumSafariBalls(BattleSystem *param0); -void BattleSystem_SetSafariBalls(BattleSystem *param0, int param1); -Options *ov16_0223EDA4(BattleSystem *param0); +u8 ov16_0223ED60(BattleSystem *battleSys); +u8 ov16_0223ED6C(BattleSystem *battleSys); +int BattleSystem_NumSafariBalls(BattleSystem *battleSys); +void BattleSystem_SetSafariBalls(BattleSystem *battleSys, int param1); +Options *ov16_0223EDA4(BattleSystem *battleSys); /** * @brief Check if battle animations are turned on. @@ -206,73 +206,73 @@ Options *ov16_0223EDA4(BattleSystem *param0); * @return TRUE if battle animations are enabled, FALSE if not. */ BOOL BattleSystem_AnimationsOn(BattleSystem *battleSys); -int ov16_0223EDE0(BattleSystem *param0); -u8 BattleSystem_TextSpeed(BattleSystem *param0); -int BattleSystem_Ruleset(BattleSystem *param0); -PokemonAnimationSys *ov16_0223EE28(BattleSystem *param0); -ChatotCry *BattleSystem_ChatotVoice(BattleSystem *param0, int param1); -void ov16_0223EE70(BattleSystem *param0); -void ov16_0223EF2C(BattleSystem *param0, int param1, int param2); -void ov16_0223EF48(BattleSystem *param0, Pokemon *param1); -void ov16_0223EF68(BattleSystem *param0, Pokemon *param1); -void ov16_0223EF8C(BattleSystem *param0); -u8 *ov16_0223F1E8(BattleSystem *param0); -u16 *ov16_0223F1F0(BattleSystem *param0); -int ov16_0223F1F8(BattleSystem *param0); -u16 *ov16_0223F204(BattleSystem *param0); -u16 *ov16_0223F210(BattleSystem *param0); -int BattleSystem_FieldWeather(BattleSystem *param0); -u8 ov16_0223F228(BattleSystem *param0); -void ov16_0223F234(BattleSystem *param0, u8 param1); -int ov16_0223F240(BattleSystem *param0); -void ov16_0223F24C(BattleSystem *param0, int param1); -void ov16_0223F268(BattleSystem *param0); +int ov16_0223EDE0(BattleSystem *battleSys); +u8 BattleSystem_TextSpeed(BattleSystem *battleSys); +int BattleSystem_Ruleset(BattleSystem *battleSys); +PokemonAnimationSys *BattleSystem_GetPokemonAnimationSystem(BattleSystem *battleSys); +ChatotCry *BattleSystem_ChatotVoice(BattleSystem *battleSys, int param1); +void ov16_0223EE70(BattleSystem *battleSys); +void ov16_0223EF2C(BattleSystem *battleSys, int param1, int param2); +void ov16_0223EF48(BattleSystem *battleSys, Pokemon *param1); +void ov16_0223EF68(BattleSystem *battleSys, Pokemon *param1); +void ov16_0223EF8C(BattleSystem *battleSys); +u8 *ov16_0223F1E8(BattleSystem *battleSys); +u16 *ov16_0223F1F0(BattleSystem *battleSys); +int ov16_0223F1F8(BattleSystem *battleSys); +u16 *ov16_0223F204(BattleSystem *battleSys); +u16 *ov16_0223F210(BattleSystem *battleSys); +int BattleSystem_FieldWeather(BattleSystem *battleSys); +u8 ov16_0223F228(BattleSystem *battleSys); +void ov16_0223F234(BattleSystem *battleSys, u8 param1); +int ov16_0223F240(BattleSystem *battleSys); +void ov16_0223F24C(BattleSystem *battleSys, int param1); +void ov16_0223F268(BattleSystem *battleSys); void BattleSystem_SetCommandSelectionFlags(BattleSystem *battleSys, int flags); -void ov16_0223F290(BattleSystem *param0, int param1); -void *Battle_WaitDial(BattleSystem *param0); -void Battle_SetWaitDial(BattleSystem *param0, void *param1); -UnkStruct_ov16_0223E0C8 *ov16_0223F2AC(BattleSystem *param0, int param1); +void ov16_0223F290(BattleSystem *battleSys, int param1); +void *Battle_WaitDial(BattleSystem *battleSys); +void Battle_SetWaitDial(BattleSystem *battleSys, void *param1); +UnkStruct_ov16_0223E0C8 *ov16_0223F2AC(BattleSystem *battleSys, int param1); u8 *ov16_0223F2B8(UnkStruct_ov16_0223E0C8 *param0, int param1); void ov16_0223F2CC(UnkStruct_ov16_0223E0C8 *param0, int param1, int param2); void ov16_0223F2E4(UnkStruct_ov16_0223E0C8 *param0, int param1, int param2); void ov16_0223F2FC(UnkStruct_ov16_0223E0C8 *param0, int param1, int param2); -void ov16_0223F314(BattleSystem *param0, int param1); -void ov16_0223F320(BattleSystem *param0, u8 *param1); -void ov16_0223F32C(BattleSystem *param0, u8 *param1); -void ov16_0223F338(BattleSystem *param0, u8 param1); -void ov16_0223F344(BattleSystem *param0, u8 param1); -void ov16_0223F350(BattleSystem *param0, u8 param1); -void *ov16_0223F35C(BattleSystem *param0, int param1); -void ov16_0223F36C(BattleSystem *param0); -void ov16_0223F3BC(BattleSystem *param0); -void ov16_0223F3EC(BattleSystem *param0); -void ov16_0223F414(BattleSystem *param0); -u8 BattleSystem_ResultMask(BattleSystem *param0); -void BattleSystem_SetResultFlag(BattleSystem *param0, u8 param1); -u8 ov16_0223F450(BattleSystem *param0); -void BattleSystem_SetRedHPSoundFlag(BattleSystem *param0, u8 param1); -u8 ov16_0223F47C(BattleSystem *param0); -void ov16_0223F48C(BattleSystem *param0, u8 param1); -void ov16_0223F4B0(BattleSystem *param0, int param1); -u16 BattleSystem_RandNext(BattleSystem *param0); -u32 ov16_0223F4E8(BattleSystem *param0); -void ov16_0223F4F4(BattleSystem *param0, u32 param1); -void BattleSystem_Record(BattleSystem *param0, int param1, u8 param2); -BOOL ov16_0223F530(BattleSystem *param0, int param1, u8 *param2); -u8 ov16_0223F58C(BattleSystem *param0, u8 *param1); -void ov16_0223F638(BattleSystem *param0, u16 param1, u8 *param2); -u16 ov16_0223F6E4(BattleSystem *param0); -int ov16_0223F6F0(BattleSystem *param0, u16 param1); -u16 BattleSystem_TrainerItems(BattleSystem *param0, int param1, int param2); -u32 BattleSystem_RecordingStopped(BattleSystem *param0); +void ov16_0223F314(BattleSystem *battleSys, int param1); +void ov16_0223F320(BattleSystem *battleSys, u8 *param1); +void ov16_0223F32C(BattleSystem *battleSys, u8 *param1); +void ov16_0223F338(BattleSystem *battleSys, u8 param1); +void ov16_0223F344(BattleSystem *battleSys, u8 param1); +void ov16_0223F350(BattleSystem *battleSys, u8 param1); +void *ov16_0223F35C(BattleSystem *battleSys, int param1); +void ov16_0223F36C(BattleSystem *battleSys); +void ov16_0223F3BC(BattleSystem *battleSys); +void ov16_0223F3EC(BattleSystem *battleSys); +void ov16_0223F414(BattleSystem *battleSys); +u8 BattleSystem_ResultMask(BattleSystem *battleSys); +void BattleSystem_SetResultFlag(BattleSystem *battleSys, u8 param1); +u8 ov16_0223F450(BattleSystem *battleSys); +void BattleSystem_SetRedHPSoundFlag(BattleSystem *battleSys, u8 param1); +u8 ov16_0223F47C(BattleSystem *battleSys); +void ov16_0223F48C(BattleSystem *battleSys, u8 param1); +void ov16_0223F4B0(BattleSystem *battleSys, int param1); +u16 BattleSystem_RandNext(BattleSystem *battleSys); +u32 ov16_0223F4E8(BattleSystem *battleSys); +void ov16_0223F4F4(BattleSystem *battleSys, u32 param1); +void BattleSystem_Record(BattleSystem *battleSys, int param1, u8 param2); +BOOL ov16_0223F530(BattleSystem *battleSys, int param1, u8 *param2); +u8 ov16_0223F58C(BattleSystem *battleSys, u8 *param1); +void ov16_0223F638(BattleSystem *battleSys, u16 param1, u8 *param2); +u16 ov16_0223F6E4(BattleSystem *battleSys); +int ov16_0223F6F0(BattleSystem *battleSys, u16 param1); +u16 BattleSystem_TrainerItems(BattleSystem *battleSys, int param1, int param2); +u32 BattleSystem_RecordingStopped(BattleSystem *battleSys); void BattleSystem_SetStopRecording(BattleSystem *battleSys, int flag); -BOOL ov16_0223F7A4(BattleSystem *param0); +BOOL ov16_0223F7A4(BattleSystem *battleSys); void BattleSystem_ShowStopPlaybackButton(BattleSystem *battleSys); -u8 BattleSystem_RecordedChatter(BattleSystem *param0, int param1); -void ov16_0223F858(BattleSystem *param0, u8 *param1); -void ov16_0223F87C(BattleSystem *param0, u8 *param1); -void ov16_0223F8AC(BattleSystem *param0, Sprite **param1); -void BattleSystem_SetGaugePriority(BattleSystem *param0, int param1); +u8 BattleSystem_RecordedChatter(BattleSystem *battleSys, int param1); +void ov16_0223F858(BattleSystem *battleSys, u8 *param1); +void ov16_0223F87C(BattleSystem *battleSys, u8 *param1); +void ov16_0223F8AC(BattleSystem *battleSys, Sprite **param1); +void BattleSystem_SetGaugePriority(BattleSystem *battleSys, int param1); /** * @brief Calculate the money penalty for losing a battle. @@ -284,8 +284,8 @@ void BattleSystem_SetGaugePriority(BattleSystem *param0, int param1); * @return The total amount of money to be deducted from the player */ u32 BattleSystem_CalcMoneyPenalty(Party *party, TrainerInfo *trainerInfo); -void BattleSystem_DexFlagSeen(BattleSystem *param0, int param1); -void ov16_0223F9A0(BattleSystem *param0, int param1); +void BattleSystem_DexFlagSeen(BattleSystem *battleSys, int param1); +void ov16_0223F9A0(BattleSystem *battleSys, int param1); /** * @brief Checks if the player has previously caught a member of this species. @@ -297,7 +297,7 @@ void ov16_0223F9A0(BattleSystem *param0, int param1); */ BOOL BattleSystem_CaughtSpecies(BattleSystem *battleSys, int species); void Battle_SetDefaultBlend(void); -u8 ov16_0223F9FC(BattleSystem *param0, int param1, int param2, int param3, int param4); +u8 ov16_0223F9FC(BattleSystem *battleSys, int param1, int param2, int param3, int param4); /** * @brief Print a BattleMessage to the main text display window. @@ -309,6 +309,6 @@ u8 ov16_0223F9FC(BattleSystem *param0, int param1, int param2, int param3, int p * @return */ u8 BattleMessage_Print(BattleSystem *battleSys, MessageLoader *msgLoader, BattleMessage *battleMsg, int renderDelay); -u8 BattleMessage_PrintToWindow(BattleSystem *param0, Window *param1, MessageLoader *param2, BattleMessage *param3, int param4, int param5, int param6, int param7, int param8); +u8 BattleMessage_PrintToWindow(BattleSystem *battleSys, Window *param1, MessageLoader *param2, BattleMessage *param3, int param4, int param5, int param6, int param7, int param8); #endif // POKEPLATINUM_OV16_0223DF00_H diff --git a/include/constants/battle.h b/include/constants/battle.h index f82f078f41..14c32faf56 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -100,10 +100,10 @@ enum BattlerBootState { * * PLAYER_SLOT_1 PLAYER_SLOT_2 */ -#define BATTLER_PLAYER_SLOT_1 0 -#define BATTLER_ENEMY_SLOT_1 1 -#define BATTLER_PLAYER_SLOT_2 2 -#define BATTLER_ENEMY_SLOT_2 3 +#define BATTLER_PLAYER_1 0 +#define BATTLER_ENEMY_1 1 +#define BATTLER_PLAYER_2 2 +#define BATTLER_ENEMY_2 3 #define BATTLER_NONE 0xFF #define BATTLER_TYPE_SOLO_PLAYER 0 diff --git a/include/field_battle_data_transfer.h b/include/field_battle_data_transfer.h index 1067b76cfd..935a4a1e58 100644 --- a/include/field_battle_data_transfer.h +++ b/include/field_battle_data_transfer.h @@ -35,11 +35,11 @@ typedef struct FieldBattleDTO { Party *parties[MAX_BATTLERS]; int resultMask; int trainerIDs[MAX_BATTLERS]; - TrainerData trainerData[MAX_BATTLERS]; + Trainer trainer[MAX_BATTLERS]; TrainerInfo *trainerInfo[MAX_BATTLERS]; Bag *bag; BagCursor *bagCursor; - PokedexData *pokedex; + Pokedex *pokedex; PCBoxes *pcBoxes; ChatotCry *chatotCries[MAX_BATTLERS]; PoketchData *poketchData; diff --git a/include/game_records.h b/include/game_records.h index 7ead5bedf1..4e3c7bdc97 100644 --- a/include/game_records.h +++ b/include/game_records.h @@ -37,6 +37,6 @@ u32 GameRecords_AddToRecordValue(GameRecords *records, int id, u32 toAdd); u32 GameRecords_GetRecordValue(GameRecords *records, int id); void GameRecords_IncrementTrainerScore(GameRecords *records, int scoreID); u32 GameRecords_GetTrainerScore(GameRecords *records); -void GameRecords_IncrementTrainerScoreOnCatch(GameRecords *records, const PokedexData *pokedex, const u16 species); +void GameRecords_IncrementTrainerScoreOnCatch(GameRecords *records, const Pokedex *pokedex, const u16 species); #endif // POKEPLATINUM_GAME_RECORDS_H diff --git a/include/overlay021/struct_ov21_021D0D80.h b/include/overlay021/struct_ov21_021D0D80.h index d030460fa2..93088fe1f2 100644 --- a/include/overlay021/struct_ov21_021D0D80.h +++ b/include/overlay021/struct_ov21_021D0D80.h @@ -7,7 +7,7 @@ #include "trainer_info.h" typedef struct { - const PokedexData *unk_00; + const Pokedex *unk_00; const TrainerInfo *unk_04; int timeOfDay; BOOL fullmoonIslandVisible; diff --git a/include/overlay021/struct_ov21_021D3208.h b/include/overlay021/struct_ov21_021D3208.h index af1a3624c8..2eaaa10b6e 100644 --- a/include/overlay021/struct_ov21_021D3208.h +++ b/include/overlay021/struct_ov21_021D3208.h @@ -6,7 +6,7 @@ #include "trainer_info.h" typedef struct { - const PokedexData *dexData; + const Pokedex *dexData; const TrainerInfo *unk_04; int timeOfDay; BOOL fullmoonIslandVisible; diff --git a/include/overlay021/struct_ov21_021D3320.h b/include/overlay021/struct_ov21_021D3320.h index 73e93ba8be..cfc0adb7d6 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -9,7 +9,7 @@ #include "strbuf.h" typedef struct { - const PokedexData *dexData; + const Pokedex *dexData; SortedPokedex sortedPokedex; int isNationalDex; BOOL isNationalDexUnlocked; diff --git a/include/overlay088/struct_ov88_0223C370.h b/include/overlay088/struct_ov88_0223C370.h index c815c1c272..9db9769533 100644 --- a/include/overlay088/struct_ov88_0223C370.h +++ b/include/overlay088/struct_ov88_0223C370.h @@ -25,7 +25,7 @@ typedef struct { Options *unk_18; Journal *unk_1C; GameRecords *records; - PokedexData *unk_24; + Pokedex *unk_24; int unk_28; int unk_2C; int unk_30; diff --git a/include/overlay094/ov94_022414B8.h b/include/overlay094/ov94_022414B8.h index 6d72f03625..2983da4e77 100644 --- a/include/overlay094/ov94_022414B8.h +++ b/include/overlay094/ov94_022414B8.h @@ -31,7 +31,7 @@ u16 *ov94_Pokedex_Alphabetical(int heapID, int unused, int *pokedexLength); u8 *ov94_02242548(int param0); void ov94_022425A8(UnkStruct_ov94_0223BA88 *param0, UnkStruct_ov94_0223FD4C *param1); ListMenu *ov94_022426A8(UnkStruct_ov94_0223FD4C *param0, StringList **param1, Window *param2, MessageLoader *param3); -ListMenu *ov94_022427C0(UnkStruct_ov94_0223FD4C *param0, StringList **param1, Window *param2, MessageLoader *param3, MessageLoader *param4, UnkStruct_ov94_0223FD4C_sub3 *param5, PokedexData *param6); +ListMenu *ov94_022427C0(UnkStruct_ov94_0223FD4C *param0, StringList **param1, Window *param2, MessageLoader *param3, MessageLoader *param4, UnkStruct_ov94_0223FD4C_sub3 *param5, Pokedex *param6); ListMenu *ov94_02242840(StringList **param0, Window *param1, MessageLoader *param2); ListMenu *ov94_022428B0(StringList **param0, Window *param1, MessageLoader *param2, int param3); void ov94_02242934(UnkStruct_ov94_0223BA88_sub3 *param0, int param1, int param2); diff --git a/include/rtc.h b/include/rtc.h index 29cd3f6474..59fb437f16 100644 --- a/include/rtc.h +++ b/include/rtc.h @@ -4,11 +4,11 @@ #include enum TimeOfDay { - TOD_MORNING = 0, - TOD_DAY = 1, - TOD_TWILIGHT = 2, - TOD_NIGHT = 3, - TOD_LATE_NIGHT = 4, + TIMEOFDAY_MORNING = 0, + TIMEOFDAY_DAY = 1, + TIMEOFDAY_TWILIGHT = 2, + TIMEOFDAY_NIGHT = 3, + TIMEOFDAY_LATE_NIGHT = 4, }; void InitRTC(void); diff --git a/include/string_template.h b/include/string_template.h index 15d434943d..2a2ba7fb6f 100644 --- a/include/string_template.h +++ b/include/string_template.h @@ -65,10 +65,10 @@ void StringTemplate_SetLocationName(StringTemplate *template, u32 idx, u32 locat void StringTemplate_SetPoketchAppName(StringTemplate *template, u32 idx, u32 app); void StringTemplate_SetTrainerClassName(StringTemplate *template, u32 idx, u32 trainerClass); void StringTemplate_SetTrainerClassNameWithArticle(StringTemplate *template, u32 idx, u32 trainerClass); -void StringTemplate_SetTrainerClassNameBattle(StringTemplate *template, u32 idx, TrainerData *trainerData); +void StringTemplate_SetTrainerClassNameBattle(StringTemplate *template, u32 idx, Trainer *trainer); void StringTemplate_SetTrainerName(StringTemplate *template, u32 idx, u32 trainerID); void StringTemplate_SetFrontierTrainerName(StringTemplate *template, u32 idx, u32 trainerID); -void StringTemplate_SetTrainerNameBattle(StringTemplate *template, u32 idx, TrainerData *trainerData); +void StringTemplate_SetTrainerNameBattle(StringTemplate *template, u32 idx, Trainer *trainer); void StringTemplate_SetUndergroundItemName(StringTemplate *template, u32 idx, u32 item); void StringTemplate_SetUndergroundItemNameWithArticle(StringTemplate *template, u32 idx, u32 item); void StringTemplate_SetUndergroundTrapName(StringTemplate *template, u32 idx, u32 trap); diff --git a/include/struct_decls/pokedexdata_decl.h b/include/struct_decls/pokedexdata_decl.h index 22106827ae..a8cb4775c7 100644 --- a/include/struct_decls/pokedexdata_decl.h +++ b/include/struct_decls/pokedexdata_decl.h @@ -1,6 +1,6 @@ #ifndef POKEPLATINUM_POKEDEXDATA_DECL_H #define POKEPLATINUM_POKEDEXDATA_DECL_H -typedef struct PokedexData PokedexData; +typedef struct Pokedex Pokedex; #endif // POKEPLATINUM_POKEDEXDATA_DECL_H diff --git a/include/struct_defs/battle_system.h b/include/struct_defs/battle_system.h index f29a0c0424..b788deebd3 100644 --- a/include/struct_defs/battle_system.h +++ b/include/struct_defs/battle_system.h @@ -57,22 +57,22 @@ struct BattleSystem { BattleContext *battleCtx; BattlerData *battlers[MAX_BATTLERS]; int maxBattlers; - TrainerInfo *trainerInfo[4]; + TrainerInfo *trainerInfo[MAX_BATTLERS]; Bag *unk_58; BagCursor *unk_5C; - PokedexData *pokedex; + Pokedex *pokedex; PCBoxes *pcBoxes; - Party *parties[4]; - ChatotCry *unk_78[4]; + Party *parties[MAX_BATTLERS]; + ChatotCry *unk_78[MAX_BATTLERS]; UnkStruct_02007768 *unk_88; UnkStruct_ov12_0221FCDC *unk_8C; SpriteRenderer *unk_90; SpriteGfxHandler *unk_94; PoketchData *poketchData; UnkStruct_0206D140 *unk_9C; - u16 trainerIDs[4]; + u16 trainerIDs[MAX_BATTLERS]; u8 unk_A8[4]; - TrainerData trainers[4]; + Trainer trainers[MAX_BATTLERS]; UnkStruct_ov16_02268520 unk_17C[2]; UnkStruct_ov16_02268A14 *unk_198; PartyGauge *unk_19C[2]; diff --git a/include/struct_defs/struct_0202FAA8.h b/include/struct_defs/struct_0202FAA8.h index cdd3d5d65a..1af308b10e 100644 --- a/include/struct_defs/struct_0202FAA8.h +++ b/include/struct_defs/struct_0202FAA8.h @@ -7,7 +7,7 @@ typedef struct { u32 unk_00; int unk_04; int unk_08[4]; - TrainerData unk_18[4]; + Trainer unk_18[4]; int unk_E8; int unk_EC; int unk_F0; diff --git a/include/struct_defs/struct_0203E0FC.h b/include/struct_defs/struct_0203E0FC.h index c60d96fef9..307a8a0248 100644 --- a/include/struct_defs/struct_0203E0FC.h +++ b/include/struct_defs/struct_0203E0FC.h @@ -21,7 +21,7 @@ typedef struct { SystemData *unk_04; Party *unk_08; PCBoxes *unk_0C; - PokedexData *unk_10; + Pokedex *unk_10; UnkStruct_0202B370 *unk_14; UnkStruct_0202C878 *unk_18; TrainerInfo *unk_1C; diff --git a/include/struct_defs/struct_0203E274.h b/include/struct_defs/struct_0203E274.h index 9d8e44f098..8991cebd90 100644 --- a/include/struct_defs/struct_0203E274.h +++ b/include/struct_defs/struct_0203E274.h @@ -6,7 +6,7 @@ typedef struct { int unk_00; BOOL unk_04; - const PokedexData *unk_08; + const Pokedex *unk_08; } UnkStruct_0203E274; #endif // POKEPLATINUM_STRUCT_0203E274_H diff --git a/include/struct_defs/struct_0207AE68_t.h b/include/struct_defs/struct_0207AE68_t.h index 0d2aa9063e..e93597e072 100644 --- a/include/struct_defs/struct_0207AE68_t.h +++ b/include/struct_defs/struct_0207AE68_t.h @@ -42,7 +42,7 @@ struct UnkStruct_0207AE68_t { PokemonSummary *unk_3C; void *unk_40; PokemonAnimationSys *unk_44; - PokedexData *unk_48; + Pokedex *unk_48; Bag *unk_4C; GameRecords *records; PoketchData *poketchData; diff --git a/include/struct_defs/trainer_data.h b/include/struct_defs/trainer_data.h index 8987614325..bc2a7a0e07 100644 --- a/include/struct_defs/trainer_data.h +++ b/include/struct_defs/trainer_data.h @@ -17,7 +17,7 @@ enum TrainerDataType { /** * @brief Trainer data encapsulation. Contains all trainer-level data needed to instantiate a trainer battle. */ -typedef struct TrainerData { +typedef struct Trainer { u8 type; //< The data type of the trainer; controls which TrainerMon struct is used for the party. u8 class; //< The trainer's class, e.g. "Youngster" or "Gym Leader." u8 sprite; //< Which sprite ID the trainer uses. @@ -33,7 +33,7 @@ typedef struct TrainerData { Sentence winMsg; //< The message to display if the trainer wins. Sentence loseMsg; //< The message to display if the trainer loses. -} TrainerData; +} Trainer; #define MAX_DV 255 diff --git a/include/trainer_data.h b/include/trainer_data.h index 4e3876ef8e..4e4a38813d 100644 --- a/include/trainer_data.h +++ b/include/trainer_data.h @@ -23,7 +23,7 @@ enum TrainerDataParam { }; /** - * @brief Initialize the TrainerData structs within the FieldBattleDTO struct. + * @brief Initialize the Trainer structs within the FieldBattleDTO struct. * * This routine is responsible for loading the name of a trainer and building * their party from the data archives. @@ -32,7 +32,7 @@ enum TrainerDataParam { * @param save Save data; used to pull out the rival's name, if needed. * @param heapID Heap on which to allocate message bank access. */ -void TrainerData_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID); +void Trainer_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID); /** * @brief Get a parameter for the given trainer ID from the data archive. @@ -41,7 +41,7 @@ void TrainerData_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID * @param paramID ID of the data field to be retrieved. * @return Value of the trainer's data field in the archive. */ -u32 TrainerData_LoadParam(int trainerID, enum TrainerDataParam paramID); +u32 Trainer_LoadParam(int trainerID, enum TrainerDataParam paramID); /** * @brief Check if the given trainer has a message of the specified type. @@ -51,7 +51,7 @@ u32 TrainerData_LoadParam(int trainerID, enum TrainerDataParam paramID); * @param heapID Heap on which to allocate archive access. * @return TRUE if the trainer has a message of the given type; FALSE if not. */ -BOOL TrainerData_HasMessageType(int trainerID, enum TrainerMessageType msgType, int heapID); +BOOL Trainer_HasMessageType(int trainerID, enum TrainerMessageType msgType, int heapID); /** * @brief Load the trainer's message of a given type into the provided Strbuf. @@ -63,7 +63,7 @@ BOOL TrainerData_HasMessageType(int trainerID, enum TrainerMessageType msgType, * @param[out] strbuf Strbuf which will contain the result message. * @param heapID Heap on which to allocate archive access. */ -void TrainerData_LoadMessage(int trainerID, enum TrainerMessageType msgType, Strbuf *strbuf, int heapID); +void Trainer_LoadMessage(int trainerID, enum TrainerMessageType msgType, Strbuf *strbuf, int heapID); /** * @brief Load data for the requested trainer. @@ -71,7 +71,7 @@ void TrainerData_LoadMessage(int trainerID, enum TrainerMessageType msgType, Str * @param trainerID ID of the trainer to be loaded. * @param[out] trdata Struct which will contain the loaded trainer data. */ -void TrainerData_Load(int trainerID, TrainerData *trdata); +void Trainer_Load(int trainerID, Trainer *trdata); /** * @brief Load data for the requested trainer's party. @@ -83,7 +83,7 @@ void TrainerData_Load(int trainerID, TrainerData *trdata); * @param trainerID ID of the trainer whose party is to be loaded. * @param[out] trparty Struct which will contain the loaded trainer party data. */ -void TrainerData_LoadParty(int trainerID, void *trparty); +void Trainer_LoadParty(int trainerID, void *trparty); /** * @brief Get the gender for a particular trainer class. diff --git a/include/unk_0202631C.h b/include/unk_0202631C.h index 0253fcdfec..16192b811d 100644 --- a/include/unk_0202631C.h +++ b/include/unk_0202631C.h @@ -7,47 +7,47 @@ #include "savedata.h" int Pokedex_SaveSize(void); -PokedexData *sub_02026324(u32 param0); -void Pokedex_Copy(const PokedexData *src, PokedexData *dest); -void Pokedex_Init(PokedexData *param0); -u16 sub_02026DD0(const PokedexData *param0); -u16 Pokedex_CountSeenNational(const PokedexData *pokedex); -u16 Pokedex_CountSeen(const PokedexData *pokedex); -u16 sub_02026E64(const PokedexData *param0); -u16 Pokedex_CountSeenSinnoh(const PokedexData *pokedex); -BOOL sub_02026EF4(const PokedexData *param0); -BOOL sub_02026F0C(const PokedexData *param0); -u16 sub_02026F20(const PokedexData *param0); -u16 sub_02026F58(const PokedexData *param0); -BOOL Pokedex_HasCaughtSpecies(const PokedexData *pokedex, u16 species); -BOOL Pokedex_HasSeenSpecies(const PokedexData *pokedex, u16 species); -u32 sub_0202702C(const PokedexData *param0, u8 param1); -u32 sub_02027058(const PokedexData *param0, u16 param1, int param2); -u32 sub_020270AC(const PokedexData *param0, int param1); -u32 sub_020270DC(const PokedexData *param0); -u32 sub_020270F8(const PokedexData *param0, int param1); -u32 sub_02027130(const PokedexData *param0); -u32 sub_02027154(const PokedexData *param0, int param1); -u32 sub_0202718C(const PokedexData *param0); -u32 sub_020271B0(const PokedexData *param0, int param1); -u32 sub_020271E8(const PokedexData *param0); -u32 sub_02027208(const PokedexData *param0, int param1); -u32 sub_02027240(const PokedexData *param0); -u32 sub_02027264(const PokedexData *param0, int param1); -u32 sub_02027288(const PokedexData *param0); -void sub_020272A4(PokedexData *param0, Pokemon *param1); -void sub_0202736C(PokedexData *param0, Pokemon *param1); -void sub_02027454(PokedexData *param0); -BOOL Pokedex_IsNationalDexObtained(const PokedexData *pokedex); -BOOL sub_02027494(const PokedexData *param0); -void sub_020274B0(PokedexData *param0); -BOOL sub_020274D0(const PokedexData *param0, u16 param1, u32 param2); -void sub_02027508(PokedexData *param0); -BOOL sub_02027514(const PokedexData *param0); -BOOL Pokedex_IsObtained(const PokedexData *pokedex); -void Pokedex_FlagObtained(PokedexData *param0); -PokedexData *SaveData_Pokedex(SaveData *saveData); -u32 sub_0202756C(const PokedexData *param0, int param1, int param2); -u32 sub_020276C8(const PokedexData *param0, int param1); +Pokedex *Pokedex_New(u32 param0); +void Pokedex_Copy(const Pokedex *src, Pokedex *dest); +void Pokedex_Init(Pokedex *param0); +u16 sub_02026DD0(const Pokedex *param0); +u16 Pokedex_CountSeenNational(const Pokedex *pokedex); +u16 Pokedex_CountSeen(const Pokedex *pokedex); +u16 sub_02026E64(const Pokedex *param0); +u16 Pokedex_CountSeenSinnoh(const Pokedex *pokedex); +BOOL sub_02026EF4(const Pokedex *param0); +BOOL sub_02026F0C(const Pokedex *param0); +u16 sub_02026F20(const Pokedex *param0); +u16 sub_02026F58(const Pokedex *param0); +BOOL Pokedex_HasCaughtSpecies(const Pokedex *pokedex, u16 species); +BOOL Pokedex_HasSeenSpecies(const Pokedex *pokedex, u16 species); +u32 sub_0202702C(const Pokedex *param0, u8 param1); +u32 sub_02027058(const Pokedex *param0, u16 param1, int param2); +u32 sub_020270AC(const Pokedex *param0, int param1); +u32 sub_020270DC(const Pokedex *param0); +u32 sub_020270F8(const Pokedex *param0, int param1); +u32 sub_02027130(const Pokedex *param0); +u32 sub_02027154(const Pokedex *param0, int param1); +u32 sub_0202718C(const Pokedex *param0); +u32 sub_020271B0(const Pokedex *param0, int param1); +u32 sub_020271E8(const Pokedex *param0); +u32 sub_02027208(const Pokedex *param0, int param1); +u32 sub_02027240(const Pokedex *param0); +u32 sub_02027264(const Pokedex *param0, int param1); +u32 sub_02027288(const Pokedex *param0); +void sub_020272A4(Pokedex *param0, Pokemon *param1); +void sub_0202736C(Pokedex *param0, Pokemon *param1); +void sub_02027454(Pokedex *param0); +BOOL Pokedex_IsNationalDexObtained(const Pokedex *pokedex); +BOOL sub_02027494(const Pokedex *param0); +void sub_020274B0(Pokedex *param0); +BOOL sub_020274D0(const Pokedex *param0, u16 param1, u32 param2); +void sub_02027508(Pokedex *param0); +BOOL sub_02027514(const Pokedex *param0); +BOOL Pokedex_IsObtained(const Pokedex *pokedex); +void Pokedex_FlagObtained(Pokedex *param0); +Pokedex *SaveData_Pokedex(SaveData *saveData); +u32 sub_0202756C(const Pokedex *param0, int param1, int param2); +u32 sub_020276C8(const Pokedex *param0, int param1); #endif // POKEPLATINUM_UNK_0202631C_H diff --git a/include/unk_0202CC64.h b/include/unk_0202CC64.h index 29b7633b45..c3f3d41883 100644 --- a/include/unk_0202CC64.h +++ b/include/unk_0202CC64.h @@ -7,7 +7,7 @@ int ChatotCry_SaveSize(void); void ChatotCry_Init(ChatotCry *param0); -ChatotCry *AllocateAndInitializeChatotCryData(int param0); +ChatotCry *ChatotCry_New(int param0); ChatotCry *GetChatotCryDataFromSave(SaveData *param0); BOOL IsChatotCryDataValid(const ChatotCry *param0); void ResetChatotCryDataStatus(ChatotCry *param0); diff --git a/include/unk_0206AFE0.h b/include/unk_0206AFE0.h index cfd3015fed..52a93c4818 100644 --- a/include/unk_0206AFE0.h +++ b/include/unk_0206AFE0.h @@ -11,76 +11,76 @@ enum HiddenLocations { HL_SEABREAKPATH = 3, }; -BOOL sub_0206B024(VarsFlags *param0, u16 param1); -u16 sub_0206B034(VarsFlags *param0); -BOOL sub_0206B044(VarsFlags *param0, u16 param1); -u16 sub_0206B054(VarsFlags *param0); -u16 sub_0206B064(VarsFlags *param0); -u16 sub_0206B08C(VarsFlags *param0); -u16 sub_0206B0B4(VarsFlags *param0); -BOOL sub_0206B0C4(VarsFlags *param0, u16 param1); -void VsSeeker_Reset(VarsFlags *param0); -u16 VsSeeker_GetBattery(VarsFlags *param0); -BOOL VsSeeker_SetBattery(VarsFlags *param0, u16 param1); -u16 VsSeeker_GetActiveStepCount(VarsFlags *param0); -BOOL VsSeeker_SetActiveStepCount(VarsFlags *param0, u16 param1); -void sub_0206B144(VarsFlags *param0, int param1); -BOOL sub_0206B16C(VarsFlags *param0, int param1); -void sub_0206B1B0(VarsFlags *param0, int param1); -void sub_0206B1D8(VarsFlags *param0, int param1); +BOOL sub_0206B024(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B034(VarsFlags *varsFlags); +BOOL sub_0206B044(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B054(VarsFlags *varsFlags); +u16 sub_0206B064(VarsFlags *varsFlags); +u16 VarsFlags_GetProfessorAssistantStarterSpecies(VarsFlags *varsFlags); +u16 sub_0206B0B4(VarsFlags *varsFlags); +BOOL sub_0206B0C4(VarsFlags *varsFlags, u16 param1); +void VsSeeker_Reset(VarsFlags *varsFlags); +u16 VsSeeker_GetBattery(VarsFlags *varsFlags); +BOOL VsSeeker_SetBattery(VarsFlags *varsFlags, u16 param1); +u16 VsSeeker_GetActiveStepCount(VarsFlags *varsFlags); +BOOL VsSeeker_SetActiveStepCount(VarsFlags *varsFlags, u16 param1); +void sub_0206B144(VarsFlags *varsFlags, int param1); +BOOL sub_0206B16C(VarsFlags *varsFlags, int param1); +void sub_0206B1B0(VarsFlags *varsFlags, int param1); +void sub_0206B1D8(VarsFlags *varsFlags, int param1); BOOL VarFlags_HiddenLocationsUnlocked(VarsFlags *varsFlags, int hiddenLocation); -BOOL sub_0206B218(VarsFlags *param0); -u16 sub_0206B228(VarsFlags *param0); -BOOL sub_0206B238(VarsFlags *param0); -u16 sub_0206B260(VarsFlags *param0); -BOOL sub_0206B270(VarsFlags *param0, u16 param1); -void sub_0206B280(VarsFlags *param0, u32 param1); -u32 sub_0206B2A4(VarsFlags *param0); -void sub_0206B2C8(VarsFlags *param0); +BOOL sub_0206B218(VarsFlags *varsFlags); +u16 sub_0206B228(VarsFlags *varsFlags); +BOOL sub_0206B238(VarsFlags *varsFlags); +u16 sub_0206B260(VarsFlags *varsFlags); +BOOL sub_0206B270(VarsFlags *varsFlags, u16 param1); +void sub_0206B280(VarsFlags *varsFlags, u32 param1); +u32 sub_0206B2A4(VarsFlags *varsFlags); +void sub_0206B2C8(VarsFlags *varsFlags); void sub_0206B2E4(SaveData *param0, u16 param1); -u16 sub_0206B314(VarsFlags *param0); -BOOL sub_0206B324(VarsFlags *param0, u16 param1); -void sub_0206B334(SaveData *param0); -u16 sub_0206B354(VarsFlags *param0); -BOOL sub_0206B364(VarsFlags *param0, u16 param1); -u16 sub_0206B374(VarsFlags *param0); -BOOL sub_0206B384(VarsFlags *param0, u16 param1); -u16 sub_0206B394(VarsFlags *param0); -BOOL sub_0206B3A4(VarsFlags *param0, u16 param1); -BOOL sub_0206B3B4(VarsFlags *param0); -u16 sub_0206B3DC(VarsFlags *param0); -u16 sub_0206B3EC(VarsFlags *param0); -BOOL sub_0206B3FC(VarsFlags *param0, u16 param1); -u16 sub_0206B40C(VarsFlags *param0); -BOOL sub_0206B41C(VarsFlags *param0, u16 param1); -u16 sub_0206B42C(VarsFlags *param0); -BOOL sub_0206B43C(VarsFlags *param0, u16 param1); -u16 sub_0206B44C(VarsFlags *param0); -void sub_0206B45C(VarsFlags *param0, u16 param1); -void sub_0206B46C(VarsFlags *param0, u16 param1); -u16 sub_0206B47C(VarsFlags *param0); -void sub_0206B48C(VarsFlags *param0, u16 param1); -void sub_0206B514(SaveData *param0); -void sub_0206B558(VarsFlags *param0, u16 param1); -u16 sub_0206B588(VarsFlags *param0); -u16 sub_0206B598(VarsFlags *param0); -u16 sub_0206B5A8(VarsFlags *param0); -u16 sub_0206B5B8(VarsFlags *param0); -u16 sub_0206B5C8(VarsFlags *param0); -u16 sub_0206B5D8(VarsFlags *param0); -void sub_0206B5E8(VarsFlags *param0, u16 param1); -u16 sub_0206B5F8(VarsFlags *param0); -void sub_0206B608(VarsFlags *param0, u16 param1); -u16 sub_0206B618(VarsFlags *param0); -void sub_0206B628(VarsFlags *param0, u16 param1); -void sub_0206B638(VarsFlags *param0, u16 param1); -void sub_0206B648(VarsFlags *param0, u16 param1); -void sub_0206B658(VarsFlags *param0, u16 param1); -void sub_0206B668(VarsFlags *param0, u16 param1); -void sub_0206B678(VarsFlags *param0, u16 param1); -void sub_0206B688(VarsFlags *param0, u16 param1, u16 param2); -u16 sub_0206B6DC(VarsFlags *param0); -void sub_0206B6EC(VarsFlags *param0, u16 param1); -u16 sub_0206B6FC(VarsFlags *param0); +u16 sub_0206B314(VarsFlags *varsFlags); +BOOL sub_0206B324(VarsFlags *varsFlags, u16 param1); +void sub_0206B334(SaveData *varsFlags); +u16 sub_0206B354(VarsFlags *varsFlags); +BOOL sub_0206B364(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B374(VarsFlags *varsFlags); +BOOL sub_0206B384(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B394(VarsFlags *varsFlags); +BOOL sub_0206B3A4(VarsFlags *varsFlags, u16 param1); +BOOL sub_0206B3B4(VarsFlags *varsFlags); +u16 sub_0206B3DC(VarsFlags *varsFlags); +u16 sub_0206B3EC(VarsFlags *varsFlags); +BOOL sub_0206B3FC(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B40C(VarsFlags *varsFlags); +BOOL sub_0206B41C(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B42C(VarsFlags *varsFlags); +BOOL sub_0206B43C(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B44C(VarsFlags *varsFlags); +void sub_0206B45C(VarsFlags *varsFlags, u16 param1); +void sub_0206B46C(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B47C(VarsFlags *varsFlags); +void sub_0206B48C(VarsFlags *varsFlags, u16 param1); +void sub_0206B514(SaveData *varsFlags); +void sub_0206B558(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B588(VarsFlags *varsFlags); +u16 sub_0206B598(VarsFlags *varsFlags); +u16 sub_0206B5A8(VarsFlags *varsFlags); +u16 sub_0206B5B8(VarsFlags *varsFlags); +u16 sub_0206B5C8(VarsFlags *varsFlags); +u16 sub_0206B5D8(VarsFlags *varsFlags); +void sub_0206B5E8(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B5F8(VarsFlags *varsFlags); +void sub_0206B608(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B618(VarsFlags *varsFlags); +void sub_0206B628(VarsFlags *varsFlags, u16 param1); +void sub_0206B638(VarsFlags *varsFlags, u16 param1); +void sub_0206B648(VarsFlags *varsFlags, u16 param1); +void sub_0206B658(VarsFlags *varsFlags, u16 param1); +void sub_0206B668(VarsFlags *varsFlags, u16 param1); +void sub_0206B678(VarsFlags *varsFlags, u16 param1); +void sub_0206B688(VarsFlags *varsFlags, u16 param1, u16 param2); +u16 sub_0206B6DC(VarsFlags *varsFlags); +void sub_0206B6EC(VarsFlags *varsFlags, u16 param1); +u16 sub_0206B6FC(VarsFlags *varsFlags); #endif // POKEPLATINUM_UNK_0206AFE0_H diff --git a/include/unk_0207A274.h b/include/unk_0207A274.h index 014c3bd556..9fccabebbf 100644 --- a/include/unk_0207A274.h +++ b/include/unk_0207A274.h @@ -6,7 +6,7 @@ #include "savedata.h" u32 sub_0207A274(SaveData *param0); -u32 sub_0207A280(const PokedexData *param0); +u32 sub_0207A280(const Pokedex *param0); u32 sub_0207A294(u32 param0, u32 param1); #endif // POKEPLATINUM_UNK_0207A274_H diff --git a/include/unk_0207AE68.h b/include/unk_0207AE68.h index 2be7d3cb0d..870f2fa888 100644 --- a/include/unk_0207AE68.h +++ b/include/unk_0207AE68.h @@ -11,7 +11,7 @@ #include "pokemon.h" #include "poketch_data.h" -UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, PokedexData *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11); +UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11); BOOL sub_0207B0D0(UnkStruct_0207AE68 *param0); void sub_0207B0E0(UnkStruct_0207AE68 *param0); diff --git a/include/unk_0209747C.h b/include/unk_0209747C.h index 419af6a73f..baf36194d4 100644 --- a/include/unk_0209747C.h +++ b/include/unk_0209747C.h @@ -23,7 +23,7 @@ void sub_02097540(const UnkStruct_0209747C *param0, Sentence *param1); u32 sub_02097550(const UnkStruct_0209747C *param0); u32 sub_02097554(const UnkStruct_0209747C *param0); int sub_02097558(const UnkStruct_0209747C *param0); -const PokedexData *sub_0209755C(const UnkStruct_0209747C *param0); +const Pokedex *sub_0209755C(const UnkStruct_0209747C *param0); const UnkStruct_02014EC4 *sub_02097560(const UnkStruct_0209747C *param0); BOOL sub_02097564(const UnkStruct_0209747C *param0); BOOL sub_02097568(const UnkStruct_0209747C *param0); diff --git a/res/battle/scripts/subscripts/subscript_pursuit.s b/res/battle/scripts/subscripts/subscript_pursuit.s index 69b7ad33a9..e0ca7bf8bf 100644 --- a/res/battle/scripts/subscripts/subscript_pursuit.s +++ b/res/battle/scripts/subscripts/subscript_pursuit.s @@ -99,7 +99,7 @@ _176: _184: UpdateVar OPCODE_FLAG_OFF, BTLVAR_BATTLE_CTX_STATUS, SYSCTL_MOVE_HIT UpdateVarFromVar OPCODE_SET, BTLVAR_SCRIPT_TEMP, BTLVAR_FAINTED_MON - UpdateVar OPCODE_SET, BTLVAR_FAINTED_MON, BATTLER_PLAYER_SLOT_1 + UpdateVar OPCODE_SET, BTLVAR_FAINTED_MON, BATTLER_PLAYER_1 UpdateVarFromVar OPCODE_SET, BTLVAR_CALC_TEMP, BTLVAR_BATTLE_CTX_STATUS_2 UpdateVar OPCODE_RIGHT_SHIFT, BTLVAR_CALC_TEMP, 0x0000001C UpdateVar OPCODE_FLAG_OFF, BTLVAR_BATTLE_CTX_STATUS_2, SYSCTL_PAYOUT_EXP @@ -109,7 +109,7 @@ _208: Call BATTLE_SUBSCRIPT_GRANT_EXP _215: - UpdateVar OPCODE_ADD, BTLVAR_FAINTED_MON, BATTLER_ENEMY_SLOT_1 + UpdateVar OPCODE_ADD, BTLVAR_FAINTED_MON, BATTLER_ENEMY_1 UpdateVar OPCODE_RIGHT_SHIFT, BTLVAR_CALC_TEMP, 0x00000001 CompareVarToValue OPCODE_NEQ, BTLVAR_CALC_TEMP, 0x00000000, _208 // BUG: Acid Rain (see docs/bugs_and_glitches.md) diff --git a/res/battle/scripts/subscripts/subscript_switch_pokemon.s b/res/battle/scripts/subscripts/subscript_switch_pokemon.s index b8f75aab17..45270275a6 100644 --- a/res/battle/scripts/subscripts/subscript_switch_pokemon.s +++ b/res/battle/scripts/subscripts/subscript_switch_pokemon.s @@ -42,7 +42,7 @@ _045: HealthbarSlideIn BTLSCR_SWITCHED_MON Wait Call BATTLE_SUBSCRIPT_HAZARDS_CHECK - CompareVarToValue OPCODE_GT, BTLVAR_FAINTED_MON, BATTLER_ENEMY_SLOT_2, _079 + CompareVarToValue OPCODE_GT, BTLVAR_FAINTED_MON, BATTLER_ENEMY_2, _079 UpdateVarFromVar OPCODE_FLAG_INDEX, BTLVAR_SCRIPT_TEMP, BTLVAR_FAINTED_MON UpdateVar OPCODE_LEFT_SHIFT, BTLVAR_SCRIPT_TEMP, 24 CompareVarToVar OPCODE_FLAG_NOT, BTLVAR_BATTLE_CTX_STATUS, BTLVAR_SCRIPT_TEMP, _079 diff --git a/src/battle/battle_controller.c b/src/battle/battle_controller.c index 12396e74e1..6b251d5d7a 100644 --- a/src/battle/battle_controller.c +++ b/src/battle/battle_controller.c @@ -488,10 +488,10 @@ static void BattleController_CommandSelectionInput(BattleSystem *battleSys, Batt BattleIO_StopGaugeAnimation(battleSys, i); battleCtx->curCommandState[i] = BATTLE_CONTROL_GET_BATTLE_MON; battleCtx->curCommandState[BattleSystem_Partner(battleSys, i)] = BATTLE_CONTROL_GET_BATTLE_MON; - } else if ((battleType & BATTLE_TYPE_DOUBLES) && i == BATTLER_PLAYER_SLOT_2) { + } else if ((battleType & BATTLE_TYPE_DOUBLES) && i == BATTLER_PLAYER_2) { BattleIO_StopGaugeAnimation(battleSys, i); - battleCtx->curCommandState[BATTLER_PLAYER_SLOT_1] = BATTLE_CONTROL_GET_BATTLE_MON; - battleCtx->curCommandState[BATTLER_PLAYER_SLOT_2] = BATTLE_CONTROL_GET_BATTLE_MON; + battleCtx->curCommandState[BATTLER_PLAYER_1] = BATTLE_CONTROL_GET_BATTLE_MON; + battleCtx->curCommandState[BATTLER_PLAYER_2] = BATTLE_CONTROL_GET_BATTLE_MON; } break; @@ -728,13 +728,13 @@ static void BattleController_CalcTurnOrder(BattleSystem *battleSys, BattleContex } } else { // If the player decided to Run using either of their mons, process that first. - if (battleCtx->battlerActions[BATTLER_PLAYER_SLOT_1][BATTLE_ACTION_SELECTED_COMMAND] == PLAYER_INPUT_RUN) { - battler = BATTLER_PLAYER_SLOT_1; + if (battleCtx->battlerActions[BATTLER_PLAYER_1][BATTLE_ACTION_SELECTED_COMMAND] == PLAYER_INPUT_RUN) { + battler = BATTLER_PLAYER_1; order = 5; } - if (battleCtx->battlerActions[BATTLER_PLAYER_SLOT_2][BATTLE_ACTION_SELECTED_COMMAND] == PLAYER_INPUT_RUN) { - battler = BATTLER_PLAYER_SLOT_2; + if (battleCtx->battlerActions[BATTLER_PLAYER_2][BATTLE_ACTION_SELECTED_COMMAND] == PLAYER_INPUT_RUN) { + battler = BATTLER_PLAYER_2; order = 5; } } @@ -4266,7 +4266,7 @@ static BOOL BattleController_CheckBattleOver(BattleSystem *battleSys, BattleCont // a link battle. if ((battleResult == BATTLE_RESULT_WIN && (battleType & BATTLE_TYPE_TRAINER) && (battleType & BATTLE_TYPE_LINK) == FALSE) || (battleResult == BATTLE_RESULT_WIN && (battleType & BATTLE_TYPE_FRONTIER) && (battleType & BATTLE_TYPE_LINK) == FALSE)) { - TrainerData *trainer = BattleSystem_TrainerData(battleSys, 1); + Trainer *trainer = BattleSystem_GetTrainer(battleSys, BATTLER_ENEMY_1); switch (trainer->class) { case TRAINER_CLASS_LEADER_ROARK: diff --git a/src/battle/battle_display.c b/src/battle/battle_display.c index 1877999348..be91e73f0c 100644 --- a/src/battle/battle_display.c +++ b/src/battle/battle_display.c @@ -553,11 +553,9 @@ void ov16_0225D360(BattleSystem *param0, BattlerData *param1, UnkStruct_ov16_022 v0->unk_0C = 0; } else { { - TrainerData *v1; - - v1 = BattleSystem_TrainerData(param0, param1->battler); + Trainer *trainer = BattleSystem_GetTrainer(param0, param1->battler); v0->unk_0B = 0; - v0->unk_0C = sub_020788D0(ov16_02264768(param0, param1->battler, v1->class)); + v0->unk_0C = sub_020788D0(ov16_02264768(param0, param1->battler, trainer->class)); } } @@ -1549,7 +1547,7 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) sub_02007DEC(v0->unk_08, 44, 0); sub_02007DEC(v0->unk_08, 45, 0); sub_02007DEC(v0->unk_08, 0, v0->unk_14); - PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, ov16_0223EE28(v0->unk_00), v0->unk_08, v0->unk_16, v0->unk_13, 0, v0->unk_11); + PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_08, v0->unk_16, v0->unk_13, 0, v0->unk_11); { u8 v4; @@ -1591,7 +1589,7 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) if (sub_020080C0(v0->unk_08, 0) <= v0->unk_14) { sub_02007DEC(v0->unk_08, 0, v0->unk_14); - PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, ov16_0223EE28(v0->unk_00), v0->unk_08, v0->unk_16, v0->unk_13, 0, v0->unk_11); + PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_08, v0->unk_16, v0->unk_13, 0, v0->unk_11); { u8 v5; @@ -1609,7 +1607,7 @@ static void ov16_0225E4E8(SysTask *param0, void *param1) } break; case 3: - if ((sub_020160F4(ov16_0223EE28(v0->unk_00), v0->unk_11) == 1) && (sub_02007C24(v0->unk_08) == 0)) { + if ((sub_020160F4(BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_11) == 1) && (sub_02007C24(v0->unk_08) == 0)) { if (v0->unk_28) { { UnkStruct_ov16_02265BBC v6; @@ -1675,7 +1673,7 @@ static void ov16_0225E894(SysTask *param0, void *param1) sub_02007DEC(v0->unk_08, 44, 0); sub_02007DEC(v0->unk_08, 45, 0); sub_02007DEC(v0->unk_08, 1, v0->unk_14); - PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, ov16_0223EE28(v0->unk_00), v0->unk_08, v0->unk_16, v0->unk_13, 0, v0->unk_11); + PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_08, v0->unk_16, v0->unk_13, 0, v0->unk_11); { u8 v4; @@ -1691,7 +1689,7 @@ static void ov16_0225E894(SysTask *param0, void *param1) } break; case 3: - if ((sub_020160F4(ov16_0223EE28(v0->unk_00), v0->unk_11) == 1) && (sub_02007C24(v0->unk_08) == 0)) { + if ((sub_020160F4(BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_11) == 1) && (sub_02007C24(v0->unk_08) == 0)) { if (v0->unk_28) { { UnkStruct_ov16_02265BBC v5; @@ -1854,7 +1852,7 @@ static void ov16_0225EA80(SysTask *param0, void *param1) } } - PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, ov16_0223EE28(v0->unk_00), v0->unk_04->unk_20, v0->unk_86, v0->unk_84, 0, v0->unk_81); + PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_04->unk_20, v0->unk_86, v0->unk_84, 0, v0->unk_81); sub_020086FC(v0->unk_04->unk_20, 16, 0, 0, Unk_ov16_0226F1AE[v0->unk_8E]); v0->unk_83 = 5; @@ -1883,7 +1881,7 @@ static void ov16_0225EA80(SysTask *param0, void *param1) } } - PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, ov16_0223EE28(v0->unk_00), v0->unk_04->unk_20, v0->unk_86, v0->unk_84, 0, v0->unk_81); + PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_04->unk_20, v0->unk_86, v0->unk_84, 0, v0->unk_81); sub_020086FC(v0->unk_04->unk_20, 16, 0, 1, Unk_ov16_0226F1AE[v0->unk_8E]); v0->unk_83 = 5; @@ -1899,7 +1897,7 @@ static void ov16_0225EA80(SysTask *param0, void *param1) } break; case 6: - if ((sub_020160F4(ov16_0223EE28(v0->unk_00), v0->unk_81) == 1) && (sub_02007C24(v0->unk_04->unk_20) == 0)) { + if ((sub_020160F4(BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_81) == 1) && (sub_02007C24(v0->unk_04->unk_20) == 0)) { ov12_0223783C(v0->unk_04->unk_84); v0->unk_04->unk_84 = NULL; ov12_02236428(v0->unk_08); @@ -2048,7 +2046,7 @@ static void ov16_0225F0C0(SysTask *param0, void *param1) } } - PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, ov16_0223EE28(v0->unk_00), v0->unk_04->unk_20, v0->unk_86, v0->unk_84, 0, v0->unk_81); + PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_04->unk_20, v0->unk_86, v0->unk_84, 0, v0->unk_81); sub_020086FC(v0->unk_04->unk_20, 16, 0, 0, Unk_ov16_0226F1AE[v0->unk_8E]); v0->unk_83 = 5; } else if (sub_020080C0(v0->unk_04->unk_20, 12) >= 0x100) { @@ -2076,7 +2074,7 @@ static void ov16_0225F0C0(SysTask *param0, void *param1) } } - PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, ov16_0223EE28(v0->unk_00), v0->unk_04->unk_20, v0->unk_86, v0->unk_84, 0, v0->unk_81); + PokeSprite_LoadAnimation(v0->unk_04->unk_1A0, BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_04->unk_20, v0->unk_86, v0->unk_84, 0, v0->unk_81); sub_020086FC(v0->unk_04->unk_20, 16, 0, 1, Unk_ov16_0226F1AE[v0->unk_8E]); v0->unk_83 = 5; } else { @@ -2091,7 +2089,7 @@ static void ov16_0225F0C0(SysTask *param0, void *param1) } break; case 6: - if ((sub_020160F4(ov16_0223EE28(v0->unk_00), v0->unk_81) == 1) && (sub_02007C24(v0->unk_04->unk_20) == 0)) { + if ((sub_020160F4(BattleSystem_GetPokemonAnimationSystem(v0->unk_00), v0->unk_81) == 1) && (sub_02007C24(v0->unk_04->unk_20) == 0)) { ov12_0223783C(v0->unk_0C); ov12_02236428(v0->unk_08); @@ -2925,7 +2923,7 @@ static void ov16_022604C8(SysTask *param0, void *param1) break; case 1: v10.tags = 0; - v10.id = 1226 + ov16_0223E1B4(v0->unk_00, 0); + v10.id = 1226 + BattleSystem_GetTrainerGender(v0->unk_00, 0); v0->unk_35 = BattleMessage_Print(v0->unk_00, v9, &v10, BattleSystem_TextSpeed(v0->unk_00)); v0->unk_0A = 2; break; diff --git a/src/battle/battle_io.c b/src/battle/battle_io.c index 55d80d7a6d..99d94b8c62 100644 --- a/src/battle/battle_io.c +++ b/src/battle/battle_io.c @@ -1663,8 +1663,8 @@ static void PartyGaugeData_New(BattleSystem *battleSys, BattleContext *battleCtx || ((battleType & BATTLE_TYPE_TAG) && Battler_Side(battleSys, battler)) // either of the two opponents on the enemy side || ((battleType == BATTLE_TYPE_TRAINER_WITH_AI_PARTNER) && Battler_Side(battleSys, battler)) // either of the two opponents on the enemy side || battleType == BATTLE_TYPE_FRONTIER_WITH_AI_PARTNER) { // frontier, AI partner - if (BattleSystem_BattlerSlot(battleSys, battler) == BATTLER_PLAYER_SLOT_2 - || BattleSystem_BattlerSlot(battleSys, battler) == BATTLER_ENEMY_SLOT_2) { + if (BattleSystem_BattlerSlot(battleSys, battler) == BATTLER_PLAYER_2 + || BattleSystem_BattlerSlot(battleSys, battler) == BATTLER_ENEMY_2) { battler1 = battler; battler2 = BattleSystem_Partner(battleSys, battler); } else { diff --git a/src/battle/battle_lib.c b/src/battle/battle_lib.c index d103fbe5eb..07613998d9 100644 --- a/src/battle/battle_lib.c +++ b/src/battle/battle_lib.c @@ -1890,7 +1890,7 @@ BOOL BattleSystem_CheckTrainerMessage(BattleSystem *battleSys, BattleContext *ba case CHECK_TRMSG_FIRST_DAMAGE: if (battleCtx->battleMons[BATTLER_THEM].timesDamaged == 1 && (battleCtx->battleStatusMask2 & SYSCTL_FIRST_DAMAGE_MSG_SHOWN) == FALSE - && TrainerData_HasMessageType(trID, TRMSG_FIRST_DAMAGE, HEAP_ID_BATTLE)) { + && Trainer_HasMessageType(trID, TRMSG_FIRST_DAMAGE, HEAP_ID_BATTLE)) { battleCtx->battleStatusMask2 |= SYSCTL_FIRST_DAMAGE_MSG_SHOWN; battleCtx->msgTemp = TRMSG_FIRST_DAMAGE; return TRUE; @@ -1902,7 +1902,7 @@ BOOL BattleSystem_CheckTrainerMessage(BattleSystem *battleSys, BattleContext *ba case CHECK_TRMSG_ACTIVE_BATTLER_HALF_HP: if ((battleCtx->battleMons[BATTLER_THEM].trainerMessageFlags & TRMSG_ACTIVE_BATTLER_HALF_HP_FLAG) == FALSE && battleCtx->battleMons[BATTLER_THEM].curHP <= battleCtx->battleMons[BATTLER_THEM].maxHP / 2 - && TrainerData_HasMessageType(trID, TRMSG_ACTIVE_BATTLER_HALF_HP, HEAP_ID_BATTLE)) { + && Trainer_HasMessageType(trID, TRMSG_ACTIVE_BATTLER_HALF_HP, HEAP_ID_BATTLE)) { battleCtx->battleMons[BATTLER_THEM].trainerMessageFlags |= TRMSG_ACTIVE_BATTLER_HALF_HP_FLAG; battleCtx->msgTemp = TRMSG_ACTIVE_BATTLER_HALF_HP; return TRUE; @@ -1924,7 +1924,7 @@ BOOL BattleSystem_CheckTrainerMessage(BattleSystem *battleSys, BattleContext *ba } } - if (alive == 1 && TrainerData_HasMessageType(trID, TRMSG_LAST_BATTLER, HEAP_ID_BATTLE)) { + if (alive == 1 && Trainer_HasMessageType(trID, TRMSG_LAST_BATTLER, HEAP_ID_BATTLE)) { battleCtx->battleMons[BATTLER_THEM].trainerMessageFlags |= TRMSG_LAST_BATTLER_FLAG; battleCtx->msgTemp = TRMSG_LAST_BATTLER; return TRUE; @@ -1949,7 +1949,7 @@ BOOL BattleSystem_CheckTrainerMessage(BattleSystem *battleSys, BattleContext *ba if (alive == 1 && battleCtx->battleMons[BATTLER_THEM].curHP <= battleCtx->battleMons[BATTLER_THEM].maxHP / 2 - && TrainerData_HasMessageType(trID, TRMSG_LAST_BATTLER_HALF_HP, HEAP_ID_BATTLE)) { + && Trainer_HasMessageType(trID, TRMSG_LAST_BATTLER_HALF_HP, HEAP_ID_BATTLE)) { battleCtx->battleMons[BATTLER_THEM].trainerMessageFlags |= TRMSG_LAST_BATTLER_HALF_HP_FLAG; battleCtx->msgTemp = TRMSG_LAST_BATTLER_HALF_HP; return TRUE; @@ -2025,8 +2025,8 @@ void BattleContext_InitCounters(BattleSystem *battleSys, BattleContext *battleCt int battleType = BattleSystem_BattleType(battleSys); if ((battleType & BATTLE_TYPE_DOUBLES) == FALSE) { - battleCtx->battlersSwitchingMask |= FlagIndex(BATTLER_PLAYER_SLOT_2); - battleCtx->battlersSwitchingMask |= FlagIndex(BATTLER_ENEMY_SLOT_2); + battleCtx->battlersSwitchingMask |= FlagIndex(BATTLER_PLAYER_2); + battleCtx->battlersSwitchingMask |= FlagIndex(BATTLER_ENEMY_2); } battleCtx->safariCatchStage = 6; diff --git a/src/battle/battle_script.c b/src/battle/battle_script.c index fab08a5ee7..e1280e70d6 100644 --- a/src/battle/battle_script.c +++ b/src/battle/battle_script.c @@ -693,8 +693,8 @@ static BOOL BtlCmd_PokemonSlideIn(BattleSystem *battleSys, BattleContext *battle } } - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_1); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_2); break; case BTLSCR_ENEMY: @@ -714,8 +714,8 @@ static BOOL BtlCmd_PokemonSlideIn(BattleSystem *battleSys, BattleContext *battle battlerData = BattleSystem_BattlerData(battleSys, battleCtx->attacker); if ((battlerData->battlerType & BATTLER_TYPE_SOLO_ENEMY) == FALSE) { - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_1); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_2); } else { BattleSystem_ClearSideExpGain(battleCtx, battleCtx->attacker); BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, battleCtx->attacker); @@ -729,8 +729,8 @@ static BOOL BtlCmd_PokemonSlideIn(BattleSystem *battleSys, BattleContext *battle battlerData = BattleSystem_BattlerData(battleSys, battleCtx->defender); if ((battlerData->battlerType & BATTLER_TYPE_SOLO_ENEMY) == FALSE) { - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_1); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_2); } else { BattleSystem_ClearSideExpGain(battleCtx, battleCtx->defender); BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, battleCtx->defender); @@ -744,8 +744,8 @@ static BOOL BtlCmd_PokemonSlideIn(BattleSystem *battleSys, BattleContext *battle battlerData = BattleSystem_BattlerData(battleSys, battleCtx->switchedMon); if ((battlerData->battlerType & BATTLER_TYPE_SOLO_ENEMY) == FALSE) { - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_1); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_2); } else { BattleSystem_ClearSideExpGain(battleCtx, battleCtx->switchedMon); BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, battleCtx->switchedMon); @@ -799,8 +799,8 @@ static BOOL BtlCmd_PokemonSendOut(BattleSystem *battleSys, BattleContext *battle } } - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_1); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_2); break; case BTLSCR_ENEMY: @@ -820,8 +820,8 @@ static BOOL BtlCmd_PokemonSendOut(BattleSystem *battleSys, BattleContext *battle battlerData = BattleSystem_BattlerData(battleSys, battleCtx->attacker); if ((battlerData->battlerType & BATTLER_TYPE_SOLO_ENEMY) == FALSE) { - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_1); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_2); } else { BattleSystem_ClearSideExpGain(battleCtx, battleCtx->attacker); BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, battleCtx->attacker); @@ -835,8 +835,8 @@ static BOOL BtlCmd_PokemonSendOut(BattleSystem *battleSys, BattleContext *battle battlerData = BattleSystem_BattlerData(battleSys, battleCtx->defender); if ((battlerData->battlerType & BATTLER_TYPE_SOLO_ENEMY) == FALSE) { - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_1); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_2); } else { BattleSystem_ClearSideExpGain(battleCtx, battleCtx->defender); BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, battleCtx->defender); @@ -850,8 +850,8 @@ static BOOL BtlCmd_PokemonSendOut(BattleSystem *battleSys, BattleContext *battle battlerData = BattleSystem_BattlerData(battleSys, battleCtx->switchedMon); if ((battlerData->battlerType & BATTLER_TYPE_SOLO_ENEMY) == FALSE) { - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); - BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_1); + BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, BATTLER_ENEMY_2); } else { BattleSystem_ClearSideExpGain(battleCtx, battleCtx->switchedMon); BattleSystem_FlagBattlerExpGain(battleSys, battleCtx, battleCtx->switchedMon); @@ -2748,7 +2748,7 @@ static BOOL BtlCmd_SwitchAndUpdateMon(BattleSystem *battleSys, BattleContext *ba BattleSystem_SwitchSlots(battleSys, battleCtx, battler, battleCtx->selectedPartySlot[battler]); // cache the enemy's current HP (used for force-out moves like Whirlwind?) - battleCtx->hpTemp = battleCtx->battleMons[BATTLER_ENEMY_SLOT_1].curHP; + battleCtx->hpTemp = battleCtx->battleMons[BATTLER_ENEMY_1].curHP; BattleSystem_UpdateAfterSwitch(battleSys, battleCtx, battler); @@ -3876,44 +3876,44 @@ static u32 BattleScript_CalcPrizeMoney(BattleSystem *battleSys, BattleContext *b u8 lastLevel = 0; void *rawParty = Heap_AllocFromHeap(HEAP_ID_BATTLE, sizeof(TrainerMonWithMovesAndItem) * MAX_PARTY_SIZE); - TrainerData trdata; - TrainerData_Load(battleSys->trainerIDs[battler], &trdata); - TrainerData_LoadParty(battleSys->trainerIDs[battler], rawParty); + Trainer trainer; + Trainer_Load(battleSys->trainerIDs[battler], &trainer); + Trainer_LoadParty(battleSys->trainerIDs[battler], rawParty); - switch (trdata.type) { + switch (trainer.type) { default: case TRDATATYPE_BASE: { TrainerMonBase *party = (TrainerMonBase *)rawParty; - lastLevel = party[trdata.partySize - 1].level; + lastLevel = party[trainer.partySize - 1].level; break; } case TRDATATYPE_WITH_MOVES: { TrainerMonWithMoves *party = (TrainerMonWithMoves *)rawParty; - lastLevel = party[trdata.partySize - 1].level; + lastLevel = party[trainer.partySize - 1].level; break; } case TRDATATYPE_WITH_ITEM: { TrainerMonWithItem *party = (TrainerMonWithItem *)rawParty; - lastLevel = party[trdata.partySize - 1].level; + lastLevel = party[trainer.partySize - 1].level; break; } case TRDATATYPE_WITH_MOVES_AND_ITEM: { TrainerMonWithMovesAndItem *party = (TrainerMonWithMovesAndItem *)rawParty; - lastLevel = party[trdata.partySize - 1].level; + lastLevel = party[trainer.partySize - 1].level; break; } } u32 prize; if ((battleSys->battleType & BATTLE_TYPE_TAG) || battleSys->battleType == BATTLE_TYPE_TRAINER_WITH_AI_PARTNER) { - prize = lastLevel * 4 * battleCtx->prizeMoneyMul * sTrainerClassPrizeMul[trdata.class]; + prize = lastLevel * 4 * battleCtx->prizeMoneyMul * sTrainerClassPrizeMul[trainer.class]; } else if (battleSys->battleType & 0x2) { - prize = lastLevel * 4 * battleCtx->prizeMoneyMul * 2 * sTrainerClassPrizeMul[trdata.class]; + prize = lastLevel * 4 * battleCtx->prizeMoneyMul * 2 * sTrainerClassPrizeMul[trainer.class]; } else { - prize = lastLevel * 4 * battleCtx->prizeMoneyMul * sTrainerClassPrizeMul[trdata.class]; + prize = lastLevel * 4 * battleCtx->prizeMoneyMul * sTrainerClassPrizeMul[trainer.class]; } Heap_FreeToHeap(rawParty); @@ -3936,10 +3936,10 @@ static BOOL BtlCmd_PayPrizeMoney(BattleSystem *battleSys, BattleContext *battleC u32 money; if (battleSys->resultMask == BATTLE_RESULT_WIN) { - money = BattleScript_CalcPrizeMoney(battleSys, battleCtx, BATTLER_ENEMY_SLOT_1); + money = BattleScript_CalcPrizeMoney(battleSys, battleCtx, BATTLER_ENEMY_1); if ((battleSys->battleType & BATTLE_TYPE_TAG) || battleSys->battleType == BATTLE_TYPE_TRAINER_WITH_AI_PARTNER) { - money += BattleScript_CalcPrizeMoney(battleSys, battleCtx, BATTLER_ENEMY_SLOT_2); + money += BattleScript_CalcPrizeMoney(battleSys, battleCtx, BATTLER_ENEMY_2); } TrainerInfo_GiveMoney(BattleSystem_TrainerInfo(battleSys, BATTLER_US), money); @@ -9110,7 +9110,7 @@ static BOOL BtlCmd_CheckBlackOut(BattleSystem *battleSys, BattleContext *battleC // first condition here does not match as an AND of NEQs, must be a NOT of an OR of EQs if (!(battleType == BATTLE_TYPE_TRAINER_WITH_AI_PARTNER || battleType == BATTLE_TYPE_AI_PARTNER) || Battler_Side(battleSys, battler) != BATTLER_US - || BattleSystem_BattlerSlot(battleSys, battler) != BATTLER_PLAYER_SLOT_2) { + || BattleSystem_BattlerSlot(battleSys, battler) != BATTLER_PLAYER_2) { for (i = 0; i < Party_GetCurrentCount(party2); i++) { mon = Party_GetPokemonBySlotIndex(party2, i); @@ -9958,8 +9958,8 @@ static void BattleScript_GetExpTask(SysTask *task, void *inData) // Declare victory if all wild mons have been defeated if ((battleType & BATTLE_TYPE_TRAINER) == FALSE - && data->battleCtx->battleMons[BATTLER_ENEMY_SLOT_1].curHP - + data->battleCtx->battleMons[BATTLER_ENEMY_SLOT_2].curHP + && data->battleCtx->battleMons[BATTLER_ENEMY_1].curHP + + data->battleCtx->battleMons[BATTLER_ENEMY_2].curHP == 0 && Pokemon_GetValue(mon, MON_DATA_CURRENT_HP, NULL) && data->battleCtx->expJinglePlayed == FALSE) { @@ -10777,7 +10777,7 @@ static void BattleScript_CatchMonTask(SysTask *param0, void *param1) v12.unk_08 = v5; v12.unk_0C = 5; v12.unk_10 = BattleSystem_PartyPokemon(v2->battleSys, v1, v2->battleCtx->selectedPartySlot[v1]); - v12.unk_14 = sub_0207A280(ov16_0223E068(v2->battleSys)); + v12.unk_14 = sub_0207A280(BattleSystem_GetPokedex(v2->battleSys)); v2->tmpPtr[1] = sub_0201EE9C(); v2->tmpPtr[0] = ov21_021E8D48(&v12); v2->seqNum = 13; diff --git a/src/battle/ov16_0223B140.c b/src/battle/ov16_0223B140.c index 9b72a0b86c..c92ffd8078 100644 --- a/src/battle/ov16_0223B140.c +++ b/src/battle/ov16_0223B140.c @@ -342,7 +342,7 @@ void ov16_0223B430(BattleSystem *param0) v0 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_BG, 5); v1 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, 5); - param0->unk_198 = ov16_022687C8(v0, v1, param0, ov16_0223E1B4(param0, ov16_0223F6E4(param0)), param0->unk_1BC); + param0->unk_198 = ov16_022687C8(v0, v1, param0, BattleSystem_GetTrainerGender(param0, ov16_0223F6E4(param0)), param0->unk_1BC); Font_InitManager(FONT_SUBSCREEN, 5); @@ -561,7 +561,7 @@ static void ov16_0223B790(OverlayManager *param0) NARC *v6 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_BG, 5); NARC *v7 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, 5); - v0->unk_198 = ov16_022687C8(v6, v7, v0, ov16_0223E1B4(v0, ov16_0223F6E4(v0)), v0->unk_1BC); + v0->unk_198 = ov16_022687C8(v6, v7, v0, BattleSystem_GetTrainerGender(v0, ov16_0223F6E4(v0)), v0->unk_1BC); NARC_dtor(v6); NARC_dtor(v7); @@ -698,118 +698,118 @@ static int ov16_0223BBD0(OverlayManager *param0) static void ov16_0223BCB4(OverlayManager *param0) { - BattleSystem *v0 = OverlayManager_Data(param0); + BattleSystem *battleSystem = OverlayManager_Data(param0); FieldBattleDTO *v1 = OverlayManager_Args(param0); - int v2; + int battlerId; - v1->seed = v0->unk_2448; - v1->battleStatusMask = v0->battleStatusMask; + v1->seed = battleSystem->unk_2448; + v1->battleStatusMask = battleSystem->battleStatusMask; - if ((v0->battleStatusMask & 0x10) == 0) { + if ((battleSystem->battleStatusMask & 0x10) == 0) { sub_0202F8AC(v1); } - if (v0->overlayFlags != 0) { - BattleSystem_LoadFightOverlay(v0, 0); + if (battleSystem->overlayFlags != 0) { + BattleSystem_LoadFightOverlay(battleSystem, 0); } sub_0200F344(0, 0x0); sub_0200F344(1, 0x0); - ov16_0223EE70(v0); - - if (v0->resultMask != 0x4) { - ov16_0223EF68(v0, Party_GetPokemonBySlotIndex(v0->parties[1], 0)); - } - - for (v2 = 0; v2 < 4; v2++) { - Party_cpy(v0->parties[v2], v1->parties[v2]); - Heap_FreeToHeap(v0->parties[v2]); - TrainerInfo_Copy(v0->trainerInfo[v2], v1->trainerInfo[v2]); - Heap_FreeToHeap(v0->trainerInfo[v2]); - } - - sub_02015760(v0->unk_1AC); - Bag_Copy(v0->unk_58, v1->bag); - Heap_FreeToHeap(v0->unk_58); - Pokedex_Copy(v0->pokedex, v1->pokedex); - Heap_FreeToHeap(v0->pokedex); - - v1->pcBoxes = v0->pcBoxes; - v1->bagCursor = v0->unk_5C; - v1->subscreenCursorOn = v0->unk_1BC; - v1->poketchData = v0->poketchData; - v1->unk_10C = v0->unk_9C; - v1->countSafariBalls = v0->safariBalls; - v1->resultMask = v0->resultMask & (0xc0 ^ 0xff); - v1->caughtBattlerIdx = v0->unk_2438; - v1->leveledUpMonsMask = BattleContext_Get(v0, v0->battleCtx, 4, NULL); - v1->battleRecords.totalTurns += BattleContext_Get(v0, v0->battleCtx, 3, NULL); - v1->battleRecords.totalFainted += (BattleContext_Get(v0, v0->battleCtx, 6, 0) + BattleContext_Get(v0, v0->battleCtx, 6, 2)); - v1->battleRecords.totalDamage += (BattleContext_Get(v0, v0->battleCtx, 7, 0) + BattleContext_Get(v0, v0->battleCtx, 7, 2)); - v1->totalTurnsElapsed = BattleContext_Get(v0, v0->battleCtx, 3, NULL); - v1->unk_19C = v0->unk_2474_0; - - for (v2 = 0; v2 < 4; v2++) { - Heap_FreeToHeap(v0->unk_1CC[v2].unk_00); - } - - Heap_FreeToHeap(v0->msgBuffer); - PaletteData_FreeBuffer(v0->unk_28, 0); - PaletteData_FreeBuffer(v0->unk_28, 1); - PaletteData_FreeBuffer(v0->unk_28, 2); - PaletteData_FreeBuffer(v0->unk_28, 3); - PaletteData_Free(v0->unk_28); - MessageLoader_Free(v0->unk_0C); - MessageLoader_Free(v0->unk_10); - StringTemplate_Free(v0->strFormatter); - sub_02015FB8(v0->unk_1C4); + ov16_0223EE70(battleSystem); + + if (battleSystem->resultMask != 0x4) { + ov16_0223EF68(battleSystem, Party_GetPokemonBySlotIndex(battleSystem->parties[1], 0)); + } + + for (battlerId = 0; battlerId < MAX_BATTLERS; battlerId++) { + Party_cpy(battleSystem->parties[battlerId], v1->parties[battlerId]); + Heap_FreeToHeap(battleSystem->parties[battlerId]); + TrainerInfo_Copy(battleSystem->trainerInfo[battlerId], v1->trainerInfo[battlerId]); + Heap_FreeToHeap(battleSystem->trainerInfo[battlerId]); + } + + sub_02015760(battleSystem->unk_1AC); + Bag_Copy(battleSystem->unk_58, v1->bag); + Heap_FreeToHeap(battleSystem->unk_58); + Pokedex_Copy(battleSystem->pokedex, v1->pokedex); + Heap_FreeToHeap(battleSystem->pokedex); + + v1->pcBoxes = battleSystem->pcBoxes; + v1->bagCursor = battleSystem->unk_5C; + v1->subscreenCursorOn = battleSystem->unk_1BC; + v1->poketchData = battleSystem->poketchData; + v1->unk_10C = battleSystem->unk_9C; + v1->countSafariBalls = battleSystem->safariBalls; + v1->resultMask = battleSystem->resultMask & (0xc0 ^ 0xff); + v1->caughtBattlerIdx = battleSystem->unk_2438; + v1->leveledUpMonsMask = BattleContext_Get(battleSystem, battleSystem->battleCtx, 4, NULL); + v1->battleRecords.totalTurns += BattleContext_Get(battleSystem, battleSystem->battleCtx, 3, NULL); + v1->battleRecords.totalFainted += (BattleContext_Get(battleSystem, battleSystem->battleCtx, 6, 0) + BattleContext_Get(battleSystem, battleSystem->battleCtx, 6, 2)); + v1->battleRecords.totalDamage += (BattleContext_Get(battleSystem, battleSystem->battleCtx, 7, 0) + BattleContext_Get(battleSystem, battleSystem->battleCtx, 7, 2)); + v1->totalTurnsElapsed = BattleContext_Get(battleSystem, battleSystem->battleCtx, 3, NULL); + v1->unk_19C = battleSystem->unk_2474_0; + + for (battlerId = 0; battlerId < 4; battlerId++) { + Heap_FreeToHeap(battleSystem->unk_1CC[battlerId].unk_00); + } + + Heap_FreeToHeap(battleSystem->msgBuffer); + PaletteData_FreeBuffer(battleSystem->unk_28, 0); + PaletteData_FreeBuffer(battleSystem->unk_28, 1); + PaletteData_FreeBuffer(battleSystem->unk_28, 2); + PaletteData_FreeBuffer(battleSystem->unk_28, 3); + PaletteData_Free(battleSystem->unk_28); + MessageLoader_Free(battleSystem->unk_0C); + MessageLoader_Free(battleSystem->unk_10); + StringTemplate_Free(battleSystem->strFormatter); + sub_02015FB8(battleSystem->unk_1C4); sub_020141E4(); - ov12_0221FDF4(v0->unk_8C); - BattleContext_Free(v0->battleCtx); + ov12_0221FDF4(battleSystem->unk_8C); + BattleContext_Free(battleSystem->battleCtx); - for (v2 = 0; v2 < v0->maxBattlers; v2++) { - ov16_0225C104(v0, v0->battlers[v2], v0->unk_23F9); + for (battlerId = 0; battlerId < battleSystem->maxBattlers; battlerId++) { + ov16_0225C104(battleSystem, battleSystem->battlers[battlerId], battleSystem->unk_23F9); } - sub_02007B6C(v0->unk_88); + sub_02007B6C(battleSystem->unk_88); - if (v0->unk_23F9 != 2) { - ov16_0223B3E4(v0); + if (battleSystem->unk_23F9 != 2) { + ov16_0223B3E4(battleSystem); } RenderControlFlags_SetCanABSpeedUpPrint(0); RenderControlFlags_SetAutoScrollFlags(0); RenderControlFlags_SetSpeedUpOnTouch(0); - Windows_Delete(v0->windows, 3); - Heap_FreeToHeap(v0->unk_04); - Heap_FreeToHeap(v0->unk_21C); - Heap_FreeToHeap(v0->unk_220); - sub_0200C560(v0->unk_1A4); + Windows_Delete(battleSystem->windows, 3); + Heap_FreeToHeap(battleSystem->unk_04); + Heap_FreeToHeap(battleSystem->unk_21C); + Heap_FreeToHeap(battleSystem->unk_220); + sub_0200C560(battleSystem->unk_1A4); Font_Free(FONT_SUBSCREEN); - SysTask_Done(v0->unk_1C); - SysTask_Done(v0->unk_20); + SysTask_Done(battleSystem->unk_1C); + SysTask_Done(battleSystem->unk_20); sub_0201E530(); - ov16_0223CE20(v0->unk_00); + ov16_0223CE20(battleSystem->unk_00); - LCRNG_SetSeed(v0->unk_2430); + LCRNG_SetSeed(battleSystem->unk_2430); - if (ov16_0223F450(v0)) { + if (ov16_0223F450(battleSystem)) { Sound_StopEffect(1796, 0); } - sub_0201DCF0(v0->cellTransferState); + sub_0201DCF0(battleSystem->cellTransferState); - if (BattleSystem_RecordingStopped(v0)) { + if (BattleSystem_RecordingStopped(battleSystem)) { sub_0200500C(127); } - if (v0->playbackStopButton) { - ov16_0226E174(v0->playbackStopButton); + if (battleSystem->playbackStopButton) { + ov16_0226E174(battleSystem->playbackStopButton); } - Heap_FreeToHeap(v0); + Heap_FreeToHeap(battleSystem); Overlay_UnloadByID(FS_OVERLAY_ID(overlay11)); Overlay_UnloadByID(FS_OVERLAY_ID(overlay12)); @@ -1084,7 +1084,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) param0->unk_58 = Bag_New(5); Bag_Copy(param1->bag, param0->unk_58); - param0->pokedex = sub_02026324(5); + param0->pokedex = Pokedex_New(5); Pokedex_Copy(param1->pokedex, param0->pokedex); param0->pcBoxes = param1->pcBoxes; @@ -1110,7 +1110,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) for (v0 = 0; v0 < 4; v0++) { param0->trainerIDs[v0] = param1->trainerIDs[v0]; - param0->trainers[v0] = param1->trainerData[v0]; + param0->trainers[v0] = param1->trainer[v0]; } param0->battleCtx = BattleContext_New(param0); diff --git a/src/battle/ov16_0223DF00.c b/src/battle/ov16_0223DF00.c index 177da54b91..d8531760c3 100644 --- a/src/battle/ov16_0223DF00.c +++ b/src/battle/ov16_0223DF00.c @@ -73,161 +73,161 @@ #include "unk_0202F1D4.h" #include "unk_0206CCB0.h" -BgConfig *BattleSystem_BGL(BattleSystem *param0); -u32 BattleSystem_BattleType(BattleSystem *param0); -BattleContext *BattleSystem_Context(BattleSystem *param0); -BattlerData *BattleSystem_BattlerData(BattleSystem *param0, int param1); -int BattleSystem_MaxBattlers(BattleSystem *param0); -Party *BattleSystem_Party(BattleSystem *param0, int param1); +BgConfig *BattleSystem_BGL(BattleSystem *battleSystem); +u32 BattleSystem_BattleType(BattleSystem *battleSystem); +BattleContext *BattleSystem_Context(BattleSystem *battleSystem); +BattlerData *BattleSystem_BattlerData(BattleSystem *battleSystem, int param1); +int BattleSystem_MaxBattlers(BattleSystem *battleSystem); +Party *BattleSystem_Party(BattleSystem *battleSystem, int param1); int BattleSystem_PartyCount(BattleSystem *battleSys, int battler); Pokemon *BattleSystem_PartyPokemon(BattleSystem *battleSys, int battler, int slot); -UnkStruct_02007768 *ov16_0223E000(BattleSystem *param0); -UnkStruct_ov12_0221FCDC *ov16_0223E008(BattleSystem *param0); -SpriteRenderer *ov16_0223E010(BattleSystem *param0); -SpriteGfxHandler *ov16_0223E018(BattleSystem *param0); -UnkStruct_ov16_02268520 *ov16_0223E020(BattleSystem *param0, int param1); -UnkStruct_ov16_02268A14 *ov16_0223E02C(BattleSystem *param0); -UnkStruct_0200C440 *ov16_0223E04C(BattleSystem *param0); -UnkStruct_0200C440 *ov16_0223E054(BattleSystem *param0); -MessageLoader *BattleSystem_MessageLoader(BattleSystem *param0); -MessageLoader *ov16_0223E060(BattleSystem *param0); -PaletteData *BattleSystem_PaletteSys(BattleSystem *param0); -PokedexData *ov16_0223E068(BattleSystem *param0); -u8 *ov16_0223E06C(BattleSystem *param0); -u8 *ov16_0223E074(BattleSystem *param0); -u16 *ov16_0223E080(BattleSystem *param0); -u16 *ov16_0223E08C(BattleSystem *param0); -u16 *ov16_0223E098(BattleSystem *param0); -u16 *ov16_0223E0A4(BattleSystem *param0); -u16 *ov16_0223E0B0(BattleSystem *param0); -u16 *ov16_0223E0BC(BattleSystem *param0); -UnkStruct_ov16_0223E0C8 *ov16_0223E0C8(BattleSystem *param0); -StringTemplate *BattleSystem_StringTemplate(BattleSystem *param0); -Strbuf *ov16_0223E0D4(BattleSystem *param0); -u16 Battler_TrainerID(BattleSystem *param0, int param1); -TrainerData *BattleSystem_TrainerData(BattleSystem *param0, int param1); +UnkStruct_02007768 *ov16_0223E000(BattleSystem *battleSystem); +UnkStruct_ov12_0221FCDC *ov16_0223E008(BattleSystem *battleSystem); +SpriteRenderer *ov16_0223E010(BattleSystem *battleSystem); +SpriteGfxHandler *ov16_0223E018(BattleSystem *battleSystem); +UnkStruct_ov16_02268520 *ov16_0223E020(BattleSystem *battleSystem, int param1); +UnkStruct_ov16_02268A14 *ov16_0223E02C(BattleSystem *battleSystem); +UnkStruct_0200C440 *ov16_0223E04C(BattleSystem *battleSystem); +UnkStruct_0200C440 *ov16_0223E054(BattleSystem *battleSystem); +MessageLoader *BattleSystem_MessageLoader(BattleSystem *battleSystem); +MessageLoader *ov16_0223E060(BattleSystem *battleSystem); +PaletteData *BattleSystem_PaletteSys(BattleSystem *battleSystem); +Pokedex *BattleSystem_GetPokedex(BattleSystem *battleSystem); +u8 *ov16_0223E06C(BattleSystem *battleSystem); +u8 *ov16_0223E074(BattleSystem *battleSystem); +u16 *ov16_0223E080(BattleSystem *battleSystem); +u16 *ov16_0223E08C(BattleSystem *battleSystem); +u16 *ov16_0223E098(BattleSystem *battleSystem); +u16 *ov16_0223E0A4(BattleSystem *battleSystem); +u16 *ov16_0223E0B0(BattleSystem *battleSystem); +u16 *ov16_0223E0BC(BattleSystem *battleSystem); +UnkStruct_ov16_0223E0C8 *ov16_0223E0C8(BattleSystem *battleSystem); +StringTemplate *BattleSystem_StringTemplate(BattleSystem *battleSystem); +Strbuf *ov16_0223E0D4(BattleSystem *battleSystem); +u16 Battler_TrainerID(BattleSystem *battleSystem, int param1); +Trainer *BattleSystem_GetTrainer(BattleSystem *battleSystem, int param1); TrainerInfo *BattleSystem_TrainerInfo(BattleSystem *battleSys, int battler); -Bag *BattleSystem_Bag(BattleSystem *param0); -BagCursor *BattleSystem_BagCursor(BattleSystem *param0); -u32 ov16_0223E1B4(BattleSystem *param0, int param1); +Bag *BattleSystem_Bag(BattleSystem *battleSystem); +BagCursor *BattleSystem_BagCursor(BattleSystem *battleSystem); +u32 BattleSystem_GetTrainerGender(BattleSystem *battleSystem, int param1); int BattleSystem_BattlerOfType(BattleSystem *battleSys, int type); u8 BattleSystem_BattlerSlot(BattleSystem *battleSys, int battler); -u8 Battler_Side(BattleSystem *param0, int param1); -void *ov16_0223E220(BattleSystem *param0); -PCBoxes *ov16_0223E228(BattleSystem *param0); +u8 Battler_Side(BattleSystem *battleSystem, int param1); +void *ov16_0223E220(BattleSystem *battleSystem); +PCBoxes *ov16_0223E228(BattleSystem *battleSystem); enum Terrain BattleSystem_Terrain(BattleSystem *battleSys); -int ov16_0223E240(BattleSystem *param0); -int BattleSystem_MapHeader(BattleSystem *param0); +int ov16_0223E240(BattleSystem *battleSystem); +int BattleSystem_MapHeader(BattleSystem *battleSystem); int BattleSystem_Partner(BattleSystem *battleSys, int battler); int BattleSystem_EnemyInSlot(BattleSystem *battleSys, int attacker, int slot); BOOL BattleSystem_UseBagItem(BattleSystem *battleSys, int battler, int partySlot, int moveSlot, int item); -u32 ov16_0223EBEC(BattleSystem *param0); +u32 ov16_0223EBEC(BattleSystem *battleSystem); enum Time BattleSystem_Time(BattleSystem *battleSys); -int ov16_0223EC04(BattleSystem *param0); -u8 ov16_0223EC58(BattleSystem *param0, int param1, u8 param2); +int ov16_0223EC04(BattleSystem *battleSystem); +u8 ov16_0223EC58(BattleSystem *battleSystem, int param1, u8 param2); u16 ov16_0223ECC4(FieldBattleDTO *param0, int *param1, int *param2); -u8 ov16_0223ED60(BattleSystem *param0); -u8 ov16_0223ED6C(BattleSystem *param0); -int BattleSystem_NumSafariBalls(BattleSystem *param0); -void BattleSystem_SetSafariBalls(BattleSystem *param0, int param1); -Options *ov16_0223EDA4(BattleSystem *param0); +u8 ov16_0223ED60(BattleSystem *battleSystem); +u8 ov16_0223ED6C(BattleSystem *battleSystem); +int BattleSystem_NumSafariBalls(BattleSystem *battleSystem); +void BattleSystem_SetSafariBalls(BattleSystem *battleSystem, int param1); +Options *ov16_0223EDA4(BattleSystem *battleSystem); BOOL BattleSystem_AnimationsOn(BattleSystem *battleSys); -int ov16_0223EDE0(BattleSystem *param0); -u8 BattleSystem_TextSpeed(BattleSystem *param0); -int BattleSystem_Ruleset(BattleSystem *param0); -PokemonAnimationSys *ov16_0223EE28(BattleSystem *param0); -ChatotCry *BattleSystem_ChatotVoice(BattleSystem *param0, int param1); -void ov16_0223EE70(BattleSystem *param0); -void ov16_0223EF2C(BattleSystem *param0, int param1, int param2); -void ov16_0223EF48(BattleSystem *param0, Pokemon *param1); -void ov16_0223EF68(BattleSystem *param0, Pokemon *param1); -void ov16_0223EF8C(BattleSystem *param0); -u8 *ov16_0223F1E8(BattleSystem *param0); -u16 *ov16_0223F1F0(BattleSystem *param0); -int ov16_0223F1F8(BattleSystem *param0); -u16 *ov16_0223F204(BattleSystem *param0); -u16 *ov16_0223F210(BattleSystem *param0); -int BattleSystem_FieldWeather(BattleSystem *param0); -u8 ov16_0223F228(BattleSystem *param0); -void ov16_0223F234(BattleSystem *param0, u8 param1); -int ov16_0223F240(BattleSystem *param0); -void ov16_0223F24C(BattleSystem *param0, int param1); -void ov16_0223F268(BattleSystem *param0); +int ov16_0223EDE0(BattleSystem *battleSystem); +u8 BattleSystem_TextSpeed(BattleSystem *battleSystem); +int BattleSystem_Ruleset(BattleSystem *battleSystem); +PokemonAnimationSys *BattleSystem_GetPokemonAnimationSystem(BattleSystem *battleSystem); +ChatotCry *BattleSystem_ChatotVoice(BattleSystem *battleSystem, int param1); +void ov16_0223EE70(BattleSystem *battleSystem); +void ov16_0223EF2C(BattleSystem *battleSystem, int param1, int param2); +void ov16_0223EF48(BattleSystem *battleSystem, Pokemon *param1); +void ov16_0223EF68(BattleSystem *battleSystem, Pokemon *param1); +void ov16_0223EF8C(BattleSystem *battleSystem); +u8 *ov16_0223F1E8(BattleSystem *battleSystem); +u16 *ov16_0223F1F0(BattleSystem *battleSystem); +int ov16_0223F1F8(BattleSystem *battleSystem); +u16 *ov16_0223F204(BattleSystem *battleSystem); +u16 *ov16_0223F210(BattleSystem *battleSystem); +int BattleSystem_FieldWeather(BattleSystem *battleSystem); +u8 ov16_0223F228(BattleSystem *battleSystem); +void ov16_0223F234(BattleSystem *battleSystem, u8 param1); +int ov16_0223F240(BattleSystem *battleSystem); +void ov16_0223F24C(BattleSystem *battleSystem, int param1); +void ov16_0223F268(BattleSystem *battleSystem); void BattleSystem_SetCommandSelectionFlags(BattleSystem *battleSys, int flags); -void ov16_0223F290(BattleSystem *param0, int param1); -void *Battle_WaitDial(BattleSystem *param0); -void Battle_SetWaitDial(BattleSystem *param0, void *param1); +void ov16_0223F290(BattleSystem *battleSystem, int param1); +void *Battle_WaitDial(BattleSystem *battleSystem); +void Battle_SetWaitDial(BattleSystem *battleSystem, void *param1); u8 *ov16_0223F2B8(UnkStruct_ov16_0223E0C8 *param0, int param1); void ov16_0223F2CC(UnkStruct_ov16_0223E0C8 *param0, int param1, int param2); void ov16_0223F2E4(UnkStruct_ov16_0223E0C8 *param0, int param1, int param2); void ov16_0223F2FC(UnkStruct_ov16_0223E0C8 *param0, int param1, int param2); -void ov16_0223F314(BattleSystem *param0, int param1); -void ov16_0223F320(BattleSystem *param0, u8 *param1); -void ov16_0223F32C(BattleSystem *param0, u8 *param1); -void ov16_0223F338(BattleSystem *param0, u8 param1); -void ov16_0223F344(BattleSystem *param0, u8 param1); -void ov16_0223F350(BattleSystem *param0, u8 param1); -void ov16_0223F36C(BattleSystem *param0); -void ov16_0223F3BC(BattleSystem *param0); -void ov16_0223F3EC(BattleSystem *param0); -void ov16_0223F414(BattleSystem *param0); -u8 BattleSystem_ResultMask(BattleSystem *param0); -void BattleSystem_SetResultFlag(BattleSystem *param0, u8 param1); -u8 ov16_0223F450(BattleSystem *param0); -void BattleSystem_SetRedHPSoundFlag(BattleSystem *param0, u8 param1); -u8 ov16_0223F47C(BattleSystem *param0); -void ov16_0223F48C(BattleSystem *param0, u8 param1); -void ov16_0223F4B0(BattleSystem *param0, int param1); -u16 BattleSystem_RandNext(BattleSystem *param0); -u32 ov16_0223F4E8(BattleSystem *param0); -void ov16_0223F4F4(BattleSystem *param0, u32 param1); -void BattleSystem_Record(BattleSystem *param0, int param1, u8 param2); -BOOL ov16_0223F530(BattleSystem *param0, int param1, u8 *param2); -u8 ov16_0223F58C(BattleSystem *param0, u8 *param1); -void ov16_0223F638(BattleSystem *param0, u16 param1, u8 *param2); -u16 ov16_0223F6E4(BattleSystem *param0); -int ov16_0223F6F0(BattleSystem *param0, u16 param1); -u16 BattleSystem_TrainerItems(BattleSystem *param0, int param1, int param2); -u32 BattleSystem_RecordingStopped(BattleSystem *param0); +void ov16_0223F314(BattleSystem *battleSystem, int param1); +void ov16_0223F320(BattleSystem *battleSystem, u8 *param1); +void ov16_0223F32C(BattleSystem *battleSystem, u8 *param1); +void ov16_0223F338(BattleSystem *battleSystem, u8 param1); +void ov16_0223F344(BattleSystem *battleSystem, u8 param1); +void ov16_0223F350(BattleSystem *battleSystem, u8 param1); +void ov16_0223F36C(BattleSystem *battleSystem); +void ov16_0223F3BC(BattleSystem *battleSystem); +void ov16_0223F3EC(BattleSystem *battleSystem); +void ov16_0223F414(BattleSystem *battleSystem); +u8 BattleSystem_ResultMask(BattleSystem *battleSystem); +void BattleSystem_SetResultFlag(BattleSystem *battleSystem, u8 param1); +u8 ov16_0223F450(BattleSystem *battleSystem); +void BattleSystem_SetRedHPSoundFlag(BattleSystem *battleSystem, u8 param1); +u8 ov16_0223F47C(BattleSystem *battleSystem); +void ov16_0223F48C(BattleSystem *battleSystem, u8 param1); +void ov16_0223F4B0(BattleSystem *battleSystem, int param1); +u16 BattleSystem_RandNext(BattleSystem *battleSystem); +u32 ov16_0223F4E8(BattleSystem *battleSystem); +void ov16_0223F4F4(BattleSystem *battleSystem, u32 param1); +void BattleSystem_Record(BattleSystem *battleSystem, int param1, u8 param2); +BOOL ov16_0223F530(BattleSystem *battleSystem, int param1, u8 *param2); +u8 ov16_0223F58C(BattleSystem *battleSystem, u8 *param1); +void ov16_0223F638(BattleSystem *battleSystem, u16 param1, u8 *param2); +u16 ov16_0223F6E4(BattleSystem *battleSystem); +int ov16_0223F6F0(BattleSystem *battleSystem, u16 param1); +u16 BattleSystem_TrainerItems(BattleSystem *battleSystem, int param1, int param2); +u32 BattleSystem_RecordingStopped(BattleSystem *battleSystem); void BattleSystem_SetStopRecording(BattleSystem *battleSys, int flag); -BOOL ov16_0223F7A4(BattleSystem *param0); -void BattleSystem_ShowStopPlaybackButton(BattleSystem *param0); -u8 BattleSystem_RecordedChatter(BattleSystem *param0, int param1); -void ov16_0223F858(BattleSystem *param0, u8 *param1); -void ov16_0223F87C(BattleSystem *param0, u8 *param1); -void ov16_0223F8AC(BattleSystem *param0, Sprite **param1); -void BattleSystem_SetGaugePriority(BattleSystem *param0, int param1); +BOOL ov16_0223F7A4(BattleSystem *battleSystem); +void BattleSystem_ShowStopPlaybackButton(BattleSystem *battleSystem); +u8 BattleSystem_RecordedChatter(BattleSystem *battleSystem, int param1); +void ov16_0223F858(BattleSystem *battleSystem, u8 *param1); +void ov16_0223F87C(BattleSystem *battleSystem, u8 *param1); +void ov16_0223F8AC(BattleSystem *battleSystem, Sprite **param1); +void BattleSystem_SetGaugePriority(BattleSystem *battleSystem, int param1); u32 BattleSystem_CalcMoneyPenalty(Party *party, TrainerInfo *trainerInfo); -void BattleSystem_DexFlagSeen(BattleSystem *param0, int param1); -void ov16_0223F9A0(BattleSystem *param0, int param1); +void BattleSystem_DexFlagSeen(BattleSystem *battleSystem, int param1); +void ov16_0223F9A0(BattleSystem *battleSystem, int param1); BOOL BattleSystem_CaughtSpecies(BattleSystem *battleSys, int species); void Battle_SetDefaultBlend(void); -u8 ov16_0223F9FC(BattleSystem *param0, int param1, int param2, int param3, int param4); -u8 BattleMessage_PrintToWindow(BattleSystem *param0, Window *param1, MessageLoader *param2, BattleMessage *param3, int param4, int param5, int param6, int param7, int param8); +u8 ov16_0223F9FC(BattleSystem *battleSystem, int param1, int param2, int param3, int param4); +u8 BattleMessage_PrintToWindow(BattleSystem *battleSystem, Window *param1, MessageLoader *param2, BattleMessage *param3, int param4, int param5, int param6, int param7, int param8); static void BattleMessage_CheckSide(BattleSystem *battleSys, BattleMessage *battleMsg); static void BattleMessage_FillFormatBuffers(BattleSystem *battleSys, BattleMessage *battleMsg); static void BattleMessage_Format(BattleSystem *battleSys, MessageLoader *msgLoader, BattleMessage *battleMsg); static BOOL BattleMessage_Callback(TextPrinterTemplate *param0, u16 param1); -static void BattleMessage_Nickname(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_MoveName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_ItemName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_Number(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_NumberDigits(BattleSystem *param0, u32 param1, int param2, int param3); -static void BattleMessage_TypeName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_AbilityName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_StatName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_StatusName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_PokemonName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_PoffinName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_FlavorName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_TrainerClassName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_TrainerName(BattleSystem *param0, u32 param1, int param2); -static void BattleMessage_PCBoxName(BattleSystem *param0, u32 param1, int param2); +static void BattleMessage_Nickname(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_MoveName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_ItemName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_Number(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_NumberDigits(BattleSystem *battleSystem, u32 param1, int param2, int param3); +static void BattleMessage_TypeName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_AbilityName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_StatName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_StatusName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_PokemonName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_PoffinName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_FlavorName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_TrainerClassName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_TrainerName(BattleSystem *battleSystem, u32 param1, int param2); +static void BattleMessage_PCBoxName(BattleSystem *battleSystem, u32 param1, int param2); static u8 ov16_0223F6D4(u8 *param0, u8 *param1, u16 *param2); -BgConfig *BattleSystem_BGL(BattleSystem *param0) +BgConfig *BattleSystem_BGL(BattleSystem *battleSystem) { - return param0->unk_04; + return battleSystem->unk_04; } Window *BattleSystem_Window(BattleSystem *battleSys, int idx) @@ -255,14 +255,14 @@ int BattleSystem_MaxBattlers(BattleSystem *battleSys) return battleSys->maxBattlers; } -Party *BattleSystem_Party(BattleSystem *param0, int param1) +Party *BattleSystem_Party(BattleSystem *battleSystem, int param1) { - if ((param0->battleType & 0x8) || ((param0->battleType & 0x10) && (BattleSystem_BattlerSlot(param0, param1) & 0x1))) { - return param0->parties[param1]; - } else if (param0->battleType & 0x2) { - return param0->parties[param1 & 1]; + if ((battleSystem->battleType & 0x8) || ((battleSystem->battleType & 0x10) && (BattleSystem_BattlerSlot(battleSystem, param1) & 0x1))) { + return battleSystem->parties[param1]; + } else if (battleSystem->battleType & 0x2) { + return battleSystem->parties[param1 & 1]; } else { - return param0->parties[param1]; + return battleSystem->parties[param1]; } } @@ -282,7 +282,7 @@ int BattleSystem_PartyCount(BattleSystem *battleSys, int battler) Pokemon *BattleSystem_PartyPokemon(BattleSystem *battleSys, int battler, int slot) { if ((battleSys->battleType & BATTLE_TYPE_2vs2) - || ((battleSys->battleType & BATTLE_TYPE_TAG) && (BattleSystem_BattlerSlot(battleSys, battler) & BATTLER_ENEMY_SLOT_1))) { + || ((battleSys->battleType & BATTLE_TYPE_TAG) && (BattleSystem_BattlerSlot(battleSys, battler) & BATTLER_ENEMY_1))) { return Party_GetPokemonBySlotIndex(battleSys->parties[battler], slot); } @@ -293,129 +293,129 @@ Pokemon *BattleSystem_PartyPokemon(BattleSystem *battleSys, int battler, int slo return Party_GetPokemonBySlotIndex(battleSys->parties[battler], slot); } -UnkStruct_02007768 *ov16_0223E000(BattleSystem *param0) +UnkStruct_02007768 *ov16_0223E000(BattleSystem *battleSystem) { - return param0->unk_88; + return battleSystem->unk_88; } -UnkStruct_ov12_0221FCDC *ov16_0223E008(BattleSystem *param0) +UnkStruct_ov12_0221FCDC *ov16_0223E008(BattleSystem *battleSystem) { - return param0->unk_8C; + return battleSystem->unk_8C; } -SpriteRenderer *ov16_0223E010(BattleSystem *param0) +SpriteRenderer *ov16_0223E010(BattleSystem *battleSystem) { - return param0->unk_90; + return battleSystem->unk_90; } -SpriteGfxHandler *ov16_0223E018(BattleSystem *param0) +SpriteGfxHandler *ov16_0223E018(BattleSystem *battleSystem) { - return param0->unk_94; + return battleSystem->unk_94; } -UnkStruct_ov16_02268520 *ov16_0223E020(BattleSystem *param0, int param1) +UnkStruct_ov16_02268520 *ov16_0223E020(BattleSystem *battleSystem, int param1) { - return ¶m0->unk_17C[param1]; + return &battleSystem->unk_17C[param1]; } -UnkStruct_ov16_02268A14 *ov16_0223E02C(BattleSystem *param0) +UnkStruct_ov16_02268A14 *ov16_0223E02C(BattleSystem *battleSystem) { - return param0->unk_198; + return battleSystem->unk_198; } -PartyGauge *ov16_0223E034(BattleSystem *param0, enum PartyGaugeSide param1) +PartyGauge *ov16_0223E034(BattleSystem *battleSystem, enum PartyGaugeSide param1) { - return param0->unk_19C[param1]; + return battleSystem->unk_19C[param1]; } -void ov16_0223E040(BattleSystem *param0, enum PartyGaugeSide param1, PartyGauge *param2) +void ov16_0223E040(BattleSystem *battleSystem, enum PartyGaugeSide param1, PartyGauge *param2) { - param0->unk_19C[param1] = param2; + battleSystem->unk_19C[param1] = param2; } -UnkStruct_0200C440 *ov16_0223E04C(BattleSystem *param0) +UnkStruct_0200C440 *ov16_0223E04C(BattleSystem *battleSystem) { - return param0->unk_1A4; + return battleSystem->unk_1A4; } -UnkStruct_0200C440 *ov16_0223E054(BattleSystem *param0) +UnkStruct_0200C440 *ov16_0223E054(BattleSystem *battleSystem) { - return param0->unk_1A8; + return battleSystem->unk_1A8; } -MessageLoader *BattleSystem_MessageLoader(BattleSystem *param0) +MessageLoader *BattleSystem_MessageLoader(BattleSystem *battleSystem) { - return param0->unk_0C; + return battleSystem->unk_0C; } -MessageLoader *ov16_0223E060(BattleSystem *param0) +MessageLoader *ov16_0223E060(BattleSystem *battleSystem) { - return param0->unk_10; + return battleSystem->unk_10; } -PaletteData *BattleSystem_PaletteSys(BattleSystem *param0) +PaletteData *BattleSystem_PaletteSys(BattleSystem *battleSystem) { - return param0->unk_28; + return battleSystem->unk_28; } -PokedexData *ov16_0223E068(BattleSystem *param0) +Pokedex *BattleSystem_GetPokedex(BattleSystem *battleSystem) { - return param0->pokedex; + return battleSystem->pokedex; } -u8 *ov16_0223E06C(BattleSystem *param0) +u8 *ov16_0223E06C(BattleSystem *battleSystem) { - return ¶m0->unk_224[0]; + return &battleSystem->unk_224[0]; } -u8 *ov16_0223E074(BattleSystem *param0) +u8 *ov16_0223E074(BattleSystem *battleSystem) { - return ¶m0->unk_1224[0]; + return &battleSystem->unk_1224[0]; } -u16 *ov16_0223E080(BattleSystem *param0) +u16 *ov16_0223E080(BattleSystem *battleSystem) { - return ¶m0->unk_23E4; + return &battleSystem->unk_23E4; } -u16 *ov16_0223E08C(BattleSystem *param0) +u16 *ov16_0223E08C(BattleSystem *battleSystem) { - return ¶m0->unk_23E6; + return &battleSystem->unk_23E6; } -u16 *ov16_0223E098(BattleSystem *param0) +u16 *ov16_0223E098(BattleSystem *battleSystem) { - return ¶m0->unk_23E8; + return &battleSystem->unk_23E8; } -u16 *ov16_0223E0A4(BattleSystem *param0) +u16 *ov16_0223E0A4(BattleSystem *battleSystem) { - return ¶m0->unk_23EA; + return &battleSystem->unk_23EA; } -u16 *ov16_0223E0B0(BattleSystem *param0) +u16 *ov16_0223E0B0(BattleSystem *battleSystem) { - return ¶m0->unk_23EC; + return &battleSystem->unk_23EC; } -u16 *ov16_0223E0BC(BattleSystem *param0) +u16 *ov16_0223E0BC(BattleSystem *battleSystem) { - return ¶m0->unk_23EE; + return &battleSystem->unk_23EE; } -UnkStruct_ov16_0223E0C8 *ov16_0223E0C8(BattleSystem *param0) +UnkStruct_ov16_0223E0C8 *ov16_0223E0C8(BattleSystem *battleSystem) { - return ¶m0->unk_1CC[0]; + return &battleSystem->unk_1CC[0]; } -StringTemplate *BattleSystem_StringTemplate(BattleSystem *param0) +StringTemplate *BattleSystem_StringTemplate(BattleSystem *battleSystem) { - return param0->strFormatter; + return battleSystem->strFormatter; } -Strbuf *ov16_0223E0D4(BattleSystem *param0) +Strbuf *ov16_0223E0D4(BattleSystem *battleSystem) { - return param0->msgBuffer; + return battleSystem->msgBuffer; } u16 Battler_TrainerID(BattleSystem *battleSys, int battler) @@ -432,14 +432,14 @@ u16 Battler_TrainerID(BattleSystem *battleSys, int battler) return battleSys->trainerIDs[battler]; } -TrainerData *BattleSystem_TrainerData(BattleSystem *param0, int param1) +Trainer *BattleSystem_GetTrainer(BattleSystem *battleSystem, int param1) { - if ((param0->battleType & 0x8) || ((param0->battleType & 0x10) && (BattleSystem_BattlerSlot(param0, param1) & 0x1))) { - return ¶m0->trainers[param1]; - } else if (param0->battleType & 0x2) { - return ¶m0->trainers[param1 & 1]; + if ((battleSystem->battleType & 0x8) || ((battleSystem->battleType & 0x10) && (BattleSystem_BattlerSlot(battleSystem, param1) & 0x1))) { + return &battleSystem->trainers[param1]; + } else if (battleSystem->battleType & 0x2) { + return &battleSystem->trainers[param1 & 1]; } else { - return ¶m0->trainers[param1]; + return &battleSystem->trainers[param1]; } } @@ -458,19 +458,19 @@ TrainerInfo *BattleSystem_TrainerInfo(BattleSystem *battleSys, int battler) return battleSys->trainerInfo[battler]; } -Bag *BattleSystem_Bag(BattleSystem *param0) +Bag *BattleSystem_Bag(BattleSystem *battleSystem) { - return param0->unk_58; + return battleSystem->unk_58; } -BagCursor *BattleSystem_BagCursor(BattleSystem *param0) +BagCursor *BattleSystem_BagCursor(BattleSystem *battleSystem) { - return param0->unk_5C; + return battleSystem->unk_5C; } -u32 ov16_0223E1B4(BattleSystem *param0, int param1) +u32 BattleSystem_GetTrainerGender(BattleSystem *battleSystem, int param1) { - return TrainerInfo_Gender(param0->trainerInfo[param1]); + return TrainerInfo_Gender(battleSystem->trainerInfo[param1]); } int BattleSystem_BattlerOfType(BattleSystem *battleSys, int type) @@ -491,19 +491,19 @@ u8 BattleSystem_BattlerSlot(BattleSystem *battleSys, int battler) return Battler_Type(battleSys->battlers[battler]); } -u8 Battler_Side(BattleSystem *param0, int param1) +u8 Battler_Side(BattleSystem *battleSystem, int param1) { - return Battler_Type(param0->battlers[param1]) & 1; + return Battler_Type(battleSystem->battlers[param1]) & 1; } -void *ov16_0223E220(BattleSystem *param0) +void *ov16_0223E220(BattleSystem *battleSystem) { - return param0->unk_1AC; + return battleSystem->unk_1AC; } -PCBoxes *ov16_0223E228(BattleSystem *param0) +PCBoxes *ov16_0223E228(BattleSystem *battleSystem) { - return param0->pcBoxes; + return battleSystem->pcBoxes; } enum Terrain BattleSystem_Terrain(BattleSystem *battleSys) @@ -515,14 +515,14 @@ enum Terrain BattleSystem_Terrain(BattleSystem *battleSys) return battleSys->terrain; } -int ov16_0223E240(BattleSystem *param0) +int ov16_0223E240(BattleSystem *battleSystem) { - return param0->unk_2400; + return battleSystem->unk_2400; } -int BattleSystem_MapHeader(BattleSystem *param0) +int BattleSystem_MapHeader(BattleSystem *battleSystem) { - return param0->unk_2404; + return battleSystem->unk_2404; } int BattleSystem_Partner(BattleSystem *battleSys, int battler) @@ -901,18 +901,18 @@ enum Time BattleSystem_Time(BattleSystem *battleSys) return battleSys->time; } -int ov16_0223EC04(BattleSystem *param0) +int ov16_0223EC04(BattleSystem *battleSystem) { int v0; - switch (param0->unk_2400) { + switch (battleSystem->unk_2400) { case 0: case 1: case 2: case 3: case 4: case 5: - switch (param0->time) { + switch (battleSystem->time) { case 0: case 1: v0 = 0; @@ -934,19 +934,19 @@ int ov16_0223EC04(BattleSystem *param0) return v0; } -u8 ov16_0223EC58(BattleSystem *param0, int param1, u8 param2) +u8 ov16_0223EC58(BattleSystem *battleSystem, int param1, u8 param2) { u16 v0; - if ((BattleSystem_BattlerSlot(param0, param1) == 4) && ((param0->battleType & 0x8) == 0)) { - if (param0->battleType & 0x4) { - if ((param2 & FlagIndex(BattleSystem_Partner(param0, param1))) == 0) { + if ((BattleSystem_BattlerSlot(battleSystem, param1) == 4) && ((battleSystem->battleType & 0x8) == 0)) { + if (battleSystem->battleType & 0x4) { + if ((param2 & FlagIndex(BattleSystem_Partner(battleSystem, param1))) == 0) { return 1; } } else { - v0 = BattleContext_Get(param0, param0->battleCtx, 12, 0) & 0xffff; + v0 = BattleContext_Get(battleSystem, battleSystem->battleCtx, 12, 0) & 0xffff; - if (((BattleContext_Get(param0, param0->battleCtx, 8, 0) == 14) && (v0 > 16)) || (param2 & FlagIndex(0))) { + if (((BattleContext_Get(battleSystem, battleSystem->battleCtx, 8, 0) == 14) && (v0 > 16)) || (param2 & FlagIndex(0))) { return 0; } else { return 1; @@ -988,30 +988,30 @@ u16 ov16_0223ECC4(FieldBattleDTO *param0, int *param1, int *param2) return v1; } -u8 ov16_0223ED60(BattleSystem *param0) +u8 ov16_0223ED60(BattleSystem *battleSystem) { - return param0->unk_23F8; + return battleSystem->unk_23F8; } -u8 ov16_0223ED6C(BattleSystem *param0) +u8 ov16_0223ED6C(BattleSystem *battleSystem) { - GF_ASSERT(param0->battleCtx != NULL); - return BattleContext_Get(param0, param0->battleCtx, 5, NULL); + GF_ASSERT(battleSystem->battleCtx != NULL); + return BattleContext_Get(battleSystem, battleSystem->battleCtx, 5, NULL); } -int BattleSystem_NumSafariBalls(BattleSystem *param0) +int BattleSystem_NumSafariBalls(BattleSystem *battleSystem) { - return param0->safariBalls; + return battleSystem->safariBalls; } -void BattleSystem_SetSafariBalls(BattleSystem *param0, int param1) +void BattleSystem_SetSafariBalls(BattleSystem *battleSystem, int param1) { - param0->safariBalls = param1; + battleSystem->safariBalls = param1; } -Options *ov16_0223EDA4(BattleSystem *param0) +Options *ov16_0223EDA4(BattleSystem *battleSystem) { - return param0->unk_1B0; + return battleSystem->unk_1B0; } BOOL BattleSystem_AnimationsOn(BattleSystem *battleSys) @@ -1024,57 +1024,57 @@ BOOL BattleSystem_AnimationsOn(BattleSystem *battleSys) return Options_BattleScene(battleSys->unk_1B0) == OPTIONS_BATTLE_SCENE_ON; } -int ov16_0223EDE0(BattleSystem *param0) +int ov16_0223EDE0(BattleSystem *battleSystem) { - return Options_Frame(param0->unk_1B0); + return Options_Frame(battleSystem->unk_1B0); } -u8 BattleSystem_TextSpeed(BattleSystem *param0) +u8 BattleSystem_TextSpeed(BattleSystem *battleSystem) { - if ((param0->battleType & 0x4) && ((param0->battleStatusMask & 0x10) == 0)) { + if ((battleSystem->battleType & 0x4) && ((battleSystem->battleStatusMask & 0x10) == 0)) { return 1; } - return Options_TextFrameDelay(param0->unk_1B0); + return Options_TextFrameDelay(battleSystem->unk_1B0); } -int BattleSystem_Ruleset(BattleSystem *param0) +int BattleSystem_Ruleset(BattleSystem *battleSystem) { - return Options_BattleStyle(param0->unk_1B0); + return Options_BattleStyle(battleSystem->unk_1B0); } -PokemonAnimationSys *ov16_0223EE28(BattleSystem *param0) +PokemonAnimationSys *BattleSystem_GetPokemonAnimationSystem(BattleSystem *battleSystem) { - return param0->unk_1C4; + return battleSystem->unk_1C4; } -ChatotCry *BattleSystem_ChatotVoice(BattleSystem *param0, int param1) +ChatotCry *BattleSystem_ChatotVoice(BattleSystem *battleSystem, int param1) { - if ((param0->battleType & 0x8) || ((param0->battleType & 0x10) && (BattleSystem_BattlerSlot(param0, param1) & 0x1))) { - return param0->unk_78[param1]; - } else if (param0->battleType & 0x2) { - return param0->unk_78[param1 & 1]; + if ((battleSystem->battleType & 0x8) || ((battleSystem->battleType & 0x10) && (BattleSystem_BattlerSlot(battleSystem, param1) & 0x1))) { + return battleSystem->unk_78[param1]; + } else if (battleSystem->battleType & 0x2) { + return battleSystem->unk_78[param1 & 1]; } else { - return param0->unk_78[param1]; + return battleSystem->unk_78[param1]; } } -void ov16_0223EE70(BattleSystem *param0) +void ov16_0223EE70(BattleSystem *battleSystem) { int v0, v1; Pokemon *v2; u16 v3; - if (param0->battleType & (0x4 | 0x80 | 0x20 | 0x200)) { + if (battleSystem->battleType & (0x4 | 0x80 | 0x20 | 0x200)) { return; } - for (v0 = 0; v0 < BattleSystem_PartyCount(param0, 0); v0++) { - v2 = BattleSystem_PartyPokemon(param0, 0, v0); + for (v0 = 0; v0 < BattleSystem_PartyCount(battleSystem, 0); v0++) { + v2 = BattleSystem_PartyPokemon(battleSystem, 0, v0); v3 = Pokemon_GetValue(v2, MON_DATA_SPECIES_EGG, NULL); - if ((v3 == SPECIES_BURMY) && (param0->unk_2414[0] & FlagIndex(v0))) { - switch (BattleSystem_Terrain(param0)) { + if ((v3 == SPECIES_BURMY) && (battleSystem->unk_2414[0] & FlagIndex(v0))) { + switch (BattleSystem_Terrain(battleSystem)) { default: case TERRAIN_GRASS: v1 = 0; @@ -1108,37 +1108,37 @@ void ov16_0223EE70(BattleSystem *param0) } } -void ov16_0223EF2C(BattleSystem *param0, int param1, int param2) +void ov16_0223EF2C(BattleSystem *battleSystem, int param1, int param2) { - param0->unk_2414[param1] |= FlagIndex(param2); + battleSystem->unk_2414[param1] |= FlagIndex(param2); } -void ov16_0223EF48(BattleSystem *param0, Pokemon *param1) +void ov16_0223EF48(BattleSystem *battleSystem, Pokemon *param1) { - if (param0->poketchData) { - PoketchData_PokemonHistoryEnqueue(param0->poketchData, Pokemon_GetBoxPokemon(param1)); + if (battleSystem->poketchData) { + PoketchData_PokemonHistoryEnqueue(battleSystem->poketchData, Pokemon_GetBoxPokemon(param1)); } } -void ov16_0223EF68(BattleSystem *param0, Pokemon *param1) +void ov16_0223EF68(BattleSystem *battleSystem, Pokemon *param1) { - sub_0206D160(param0->unk_9C, param1, param0->resultMask, param0->unk_241E, 5); + sub_0206D160(battleSystem->unk_9C, param1, battleSystem->resultMask, battleSystem->unk_241E, 5); } -void ov16_0223EF8C(BattleSystem *param0) +void ov16_0223EF8C(BattleSystem *battleSystem) { NNSG2dImageProxy *v0; int v1, v2, v3, v4, v5, v6; u8 *v7; - param0->unk_21C = Heap_AllocFromHeap(5, 0x10000); - param0->unk_220 = Heap_AllocFromHeap(5, 0x200); + battleSystem->unk_21C = Heap_AllocFromHeap(5, 0x10000); + battleSystem->unk_220 = Heap_AllocFromHeap(5, 0x200); - MI_CpuCopy32((void *)(HW_BG_VRAM + 0x10000), param0->unk_21C, 0x10000); - MI_CpuCopy32(PaletteData_GetUnfadedBuffer(param0->unk_28, 0), param0->unk_220, HW_BG_PLTT_SIZE); + MI_CpuCopy32((void *)(HW_BG_VRAM + 0x10000), battleSystem->unk_21C, 0x10000); + MI_CpuCopy32(PaletteData_GetUnfadedBuffer(battleSystem->unk_28, 0), battleSystem->unk_220, HW_BG_PLTT_SIZE); v7 = G2_GetOBJCharPtr(); - v0 = SpriteActor_ImageProxy(param0->unk_17C[1].unk_00->unk_00); + v0 = SpriteActor_ImageProxy(battleSystem->unk_17C[1].unk_00->unk_00); v7 += v0->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]; for (v2 = 20; v2 < 20 + 8; v2++) { @@ -1162,14 +1162,14 @@ void ov16_0223EF8C(BattleSystem *param0) } if (v5) { - param0->unk_21C[v2 * 0x800 + v1 * 0x40 + v6] = v5 + 0x70; + battleSystem->unk_21C[v2 * 0x800 + v1 * 0x40 + v6] = v5 + 0x70; } } } } v7 = G2_GetOBJCharPtr(); - v0 = SpriteActor_ImageProxy(param0->unk_17C[0].unk_00->unk_00); + v0 = SpriteActor_ImageProxy(battleSystem->unk_17C[0].unk_00->unk_00); v7 += v0->vramLocation.baseAddrOfVram[NNS_G2D_VRAM_TYPE_2DMAIN]; for (v6 = 0; v6 < 0x40 * 32; v6++) { @@ -1180,7 +1180,7 @@ void ov16_0223EF8C(BattleSystem *param0) } if (v5) { - param0->unk_21C[19 * 0x800 + v6] = v5 + 0x70; + battleSystem->unk_21C[19 * 0x800 + v6] = v5 + 0x70; } } @@ -1197,41 +1197,41 @@ void ov16_0223EF8C(BattleSystem *param0) } if (v5) { - param0->unk_21C[v2 * 0x800 + v1 * 0x40 + v6] = v5 + 0x70; + battleSystem->unk_21C[v2 * 0x800 + v1 * 0x40 + v6] = v5 + 0x70; } } } } - Bg_LoadTiles(param0->unk_04, 3, param0->unk_21C, 0x10000, 0); + Bg_LoadTiles(battleSystem->unk_04, 3, battleSystem->unk_21C, 0x10000, 0); - ov16_02268700(¶m0->unk_17C[0]); - ov16_02268700(¶m0->unk_17C[1]); + ov16_02268700(&battleSystem->unk_17C[0]); + ov16_02268700(&battleSystem->unk_17C[1]); } -u8 *ov16_0223F1E8(BattleSystem *param0) +u8 *ov16_0223F1E8(BattleSystem *battleSystem) { - return param0->unk_21C; + return battleSystem->unk_21C; } -u16 *ov16_0223F1F0(BattleSystem *param0) +u16 *ov16_0223F1F0(BattleSystem *battleSystem) { - return param0->unk_220; + return battleSystem->unk_220; } -int ov16_0223F1F8(BattleSystem *param0) +int ov16_0223F1F8(BattleSystem *battleSystem) { - return param0->unk_2424; + return battleSystem->unk_2424; } -u16 *ov16_0223F204(BattleSystem *param0) +u16 *ov16_0223F204(BattleSystem *battleSystem) { - return ¶m0->unk_2224[0]; + return &battleSystem->unk_2224[0]; } -u16 *ov16_0223F210(BattleSystem *param0) +u16 *ov16_0223F210(BattleSystem *battleSystem) { - return ¶m0->unk_2304[0]; + return &battleSystem->unk_2304[0]; } int BattleSystem_FieldWeather(BattleSystem *battleSys) @@ -1239,37 +1239,37 @@ int BattleSystem_FieldWeather(BattleSystem *battleSys) return battleSys->fieldWeather; } -u8 ov16_0223F228(BattleSystem *param0) +u8 ov16_0223F228(BattleSystem *battleSystem) { - return param0->unk_241D; + return battleSystem->unk_241D; } -void ov16_0223F234(BattleSystem *param0, u8 param1) +void ov16_0223F234(BattleSystem *battleSystem, u8 param1) { - param0->unk_241D = param1; + battleSystem->unk_241D = param1; } -int ov16_0223F240(BattleSystem *param0) +int ov16_0223F240(BattleSystem *battleSystem) { - return param0->unk_242C; + return battleSystem->unk_242C; } -void ov16_0223F24C(BattleSystem *param0, int param1) +void ov16_0223F24C(BattleSystem *battleSystem, int param1) { - if (param0->battleStatusMask & 0x10) { + if (battleSystem->battleStatusMask & 0x10) { return; } - GameRecords_IncrementRecordValue(param0->records, param1); + GameRecords_IncrementRecordValue(battleSystem->records, param1); } -void ov16_0223F268(BattleSystem *param0) +void ov16_0223F268(BattleSystem *battleSystem) { - if (param0->battleStatusMask & 0x10) { + if (battleSystem->battleStatusMask & 0x10) { return; } - GameRecords_IncrementTrainerScore(param0->records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); + GameRecords_IncrementTrainerScore(battleSystem->records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); } void BattleSystem_SetCommandSelectionFlags(BattleSystem *battleSys, int flags) @@ -1277,24 +1277,24 @@ void BattleSystem_SetCommandSelectionFlags(BattleSystem *battleSys, int flags) battleSys->commandSelectionFlags = flags; } -void ov16_0223F290(BattleSystem *param0, int param1) +void ov16_0223F290(BattleSystem *battleSystem, int param1) { - param0->unk_2440 = param1; + battleSystem->unk_2440 = param1; } -void *Battle_WaitDial(BattleSystem *param0) +void *Battle_WaitDial(BattleSystem *battleSystem) { - return param0->unk_1B8; + return battleSystem->unk_1B8; } -void Battle_SetWaitDial(BattleSystem *param0, void *param1) +void Battle_SetWaitDial(BattleSystem *battleSystem, void *param1) { - param0->unk_1B8 = param1; + battleSystem->unk_1B8 = param1; } -UnkStruct_ov16_0223E0C8 *ov16_0223F2AC(BattleSystem *param0, int param1) +UnkStruct_ov16_0223E0C8 *ov16_0223F2AC(BattleSystem *battleSystem, int param1) { - return ¶m0->unk_1CC[param1]; + return &battleSystem->unk_1CC[param1]; } u8 *ov16_0223F2B8(UnkStruct_ov16_0223E0C8 *param0, int param1) @@ -1321,64 +1321,64 @@ void ov16_0223F2FC(UnkStruct_ov16_0223E0C8 *param0, int param1, int param2) param0[param1].unk_0C = param2; } -void ov16_0223F314(BattleSystem *param0, int param1) +void ov16_0223F314(BattleSystem *battleSystem, int param1) { - param0->unk_23F9 = param1; + battleSystem->unk_23F9 = param1; } -void ov16_0223F320(BattleSystem *param0, u8 *param1) +void ov16_0223F320(BattleSystem *battleSystem, u8 *param1) { - param0->unk_23F0 = param1; + battleSystem->unk_23F0 = param1; } -void ov16_0223F32C(BattleSystem *param0, u8 *param1) +void ov16_0223F32C(BattleSystem *battleSystem, u8 *param1) { - param0->unk_23F4 = param1; + battleSystem->unk_23F4 = param1; } -void ov16_0223F338(BattleSystem *param0, u8 param1) +void ov16_0223F338(BattleSystem *battleSystem, u8 param1) { - param0->unk_23F0[0] = param1; + battleSystem->unk_23F0[0] = param1; } -void ov16_0223F344(BattleSystem *param0, u8 param1) +void ov16_0223F344(BattleSystem *battleSystem, u8 param1) { - param0->unk_23F4[0] = param1; + battleSystem->unk_23F4[0] = param1; } -void ov16_0223F350(BattleSystem *param0, u8 param1) +void ov16_0223F350(BattleSystem *battleSystem, u8 param1) { - param0->unk_23FA = param1; + battleSystem->unk_23FA = param1; } -void *ov16_0223F35C(BattleSystem *param0, int param1) +void *ov16_0223F35C(BattleSystem *battleSystem, int param1) { - return ov16_02263B08(param0->battlers[param1]); + return ov16_02263B08(battleSystem->battlers[param1]); } -void ov16_0223F36C(BattleSystem *param0) +void ov16_0223F36C(BattleSystem *battleSystem) { int v0; Healthbar *v1; - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - v1 = ov16_02263B08(param0->battlers[v0]); + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + v1 = ov16_02263B08(battleSystem->battlers[v0]); - v1->battleSys = param0; - v1->type = Healthbar_Type(Battler_Type(param0->battlers[v0]), BattleSystem_BattleType(param0)); + v1->battleSys = battleSystem; + v1->type = Healthbar_Type(Battler_Type(battleSystem->battlers[v0]), BattleSystem_BattleType(battleSystem)); ov16_022672C4(v1); Healthbar_Enable(v1, 0); } } -void ov16_0223F3BC(BattleSystem *param0) +void ov16_0223F3BC(BattleSystem *battleSystem) { int v0; Healthbar *v1; - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - v1 = ov16_02263B08(param0->battlers[v0]); + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + v1 = ov16_02263B08(battleSystem->battlers[v0]); if (v1->curHP) { Healthbar_Enable(v1, 1); @@ -1386,120 +1386,120 @@ void ov16_0223F3BC(BattleSystem *param0) } } -void ov16_0223F3EC(BattleSystem *param0) +void ov16_0223F3EC(BattleSystem *battleSystem) { int v0; Healthbar *v1; - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - v1 = ov16_02263B08(param0->battlers[v0]); + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + v1 = ov16_02263B08(battleSystem->battlers[v0]); Healthbar_Enable(v1, 0); } } -void ov16_0223F414(BattleSystem *param0) +void ov16_0223F414(BattleSystem *battleSystem) { int v0; Healthbar *v1; - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - v1 = ov16_02263B08(param0->battlers[v0]); + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + v1 = ov16_02263B08(battleSystem->battlers[v0]); ov16_02267360(v1); } } -u8 BattleSystem_ResultMask(BattleSystem *param0) +u8 BattleSystem_ResultMask(BattleSystem *battleSystem) { - return param0->resultMask; + return battleSystem->resultMask; } -void BattleSystem_SetResultFlag(BattleSystem *param0, u8 param1) +void BattleSystem_SetResultFlag(BattleSystem *battleSystem, u8 param1) { - param0->resultMask = param1; + battleSystem->resultMask = param1; } -u8 ov16_0223F450(BattleSystem *param0) +u8 ov16_0223F450(BattleSystem *battleSystem) { - return param0->unk_23FB_3; + return battleSystem->unk_23FB_3; } -void BattleSystem_SetRedHPSoundFlag(BattleSystem *param0, u8 param1) +void BattleSystem_SetRedHPSoundFlag(BattleSystem *battleSystem, u8 param1) { - param0->unk_23FB_3 = param1; + battleSystem->unk_23FB_3 = param1; } -u8 ov16_0223F47C(BattleSystem *param0) +u8 ov16_0223F47C(BattleSystem *battleSystem) { - return param0->unk_23FB_5; + return battleSystem->unk_23FB_5; } -void ov16_0223F48C(BattleSystem *param0, u8 param1) +void ov16_0223F48C(BattleSystem *battleSystem, u8 param1) { GF_ASSERT(param1 < 15); - param0->unk_23FB_5 = param1; + battleSystem->unk_23FB_5 = param1; } -void ov16_0223F4B0(BattleSystem *param0, int param1) +void ov16_0223F4B0(BattleSystem *battleSystem, int param1) { - param0->unk_2438 = param1; + battleSystem->unk_2438 = param1; } -u16 BattleSystem_RandNext(BattleSystem *param0) +u16 BattleSystem_RandNext(BattleSystem *battleSystem) { - param0->unk_2444 = param0->unk_2444 * 1103515245L + 24691; - return (u16)(param0->unk_2444 / 65536L); + battleSystem->unk_2444 = battleSystem->unk_2444 * 1103515245L + 24691; + return (u16)(battleSystem->unk_2444 / 65536L); } -u32 ov16_0223F4E8(BattleSystem *param0) +u32 ov16_0223F4E8(BattleSystem *battleSystem) { - return param0->unk_2448; + return battleSystem->unk_2448; } -void ov16_0223F4F4(BattleSystem *param0, u32 param1) +void ov16_0223F4F4(BattleSystem *battleSystem, u32 param1) { - param0->unk_2448 = param1; + battleSystem->unk_2448 = param1; } -void BattleSystem_Record(BattleSystem *param0, int param1, u8 param2) +void BattleSystem_Record(BattleSystem *battleSystem, int param1, u8 param2) { - if (((param0->battleStatusMask & 0x10) == 0) && (param0->unk_245C[param1] < 0x400)) { - sub_0202F868(param1, param0->unk_245C[param1], param2); - param0->unk_245C[param1]++; + if (((battleSystem->battleStatusMask & 0x10) == 0) && (battleSystem->unk_245C[param1] < 0x400)) { + sub_0202F868(param1, battleSystem->unk_245C[param1], param2); + battleSystem->unk_245C[param1]++; } } -BOOL ov16_0223F530(BattleSystem *param0, int param1, u8 *param2) +BOOL ov16_0223F530(BattleSystem *battleSystem, int param1, u8 *param2) { BOOL v0; *param2 = 0xff; - if ((param0->battleStatusMask & 0x10) && (param0->unk_245C[param1] < 0x400)) { - *param2 = sub_0202F884(param1, param0->unk_245C[param1]); - param0->unk_245C[param1]++; + if ((battleSystem->battleStatusMask & 0x10) && (battleSystem->unk_245C[param1] < 0x400)) { + *param2 = sub_0202F884(param1, battleSystem->unk_245C[param1]); + battleSystem->unk_245C[param1]++; v0 = 0; - } else if ((param0->battleStatusMask & 0x10) && (param0->unk_245C[param1] >= 0x400)) { + } else if ((battleSystem->battleStatusMask & 0x10) && (battleSystem->unk_245C[param1] >= 0x400)) { v0 = 1; } return v0; } -u8 ov16_0223F58C(BattleSystem *param0, u8 *param1) +u8 ov16_0223F58C(BattleSystem *battleSystem, u8 *param1) { u8 v0, v1; u8 v2 = 0; - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - if (param0->unk_245C[v0] != param0->unk_244C[v0]) { + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + if (battleSystem->unk_245C[v0] != battleSystem->unk_244C[v0]) { param1[v2++] = v0; - param1[v2++] = param0->unk_245C[v0] - param0->unk_244C[v0]; + param1[v2++] = battleSystem->unk_245C[v0] - battleSystem->unk_244C[v0]; - for (v1 = 0; v1 < param0->unk_245C[v0] - param0->unk_244C[v0]; v1++) { - param1[v2++] = sub_0202F884(v0, param0->unk_244C[v0] + v1); + for (v1 = 0; v1 < battleSystem->unk_245C[v0] - battleSystem->unk_244C[v0]; v1++) { + param1[v2++] = sub_0202F884(v0, battleSystem->unk_244C[v0] + v1); } - param0->unk_244C[v0] = param0->unk_245C[v0]; + battleSystem->unk_244C[v0] = battleSystem->unk_245C[v0]; } } @@ -1507,18 +1507,18 @@ u8 ov16_0223F58C(BattleSystem *param0, u8 *param1) return v2; } -void ov16_0223F638(BattleSystem *param0, u16 param1, u8 *param2) +void ov16_0223F638(BattleSystem *battleSystem, u16 param1, u8 *param2) { int v0; u8 v1; u8 v2; u8 v3 = 0; - if ((param0->battleType & 0x4) == 0) { + if ((battleSystem->battleType & 0x4) == 0) { return; } - if (param0->unk_23F8) { + if (battleSystem->unk_23F8) { return; } @@ -1527,10 +1527,10 @@ void ov16_0223F638(BattleSystem *param0, u16 param1, u8 *param2) v2 = ov16_0223F6D4(param2, &v3, ¶m1); for (v0 = 0; v0 < v2; v0++) { - sub_0202F868(v1, param0->unk_2454[v1] + v0, ov16_0223F6D4(param2, &v3, ¶m1)); + sub_0202F868(v1, battleSystem->unk_2454[v1] + v0, ov16_0223F6D4(param2, &v3, ¶m1)); } - param0->unk_2454[v1] += v2; + battleSystem->unk_2454[v1] += v2; } } @@ -1540,24 +1540,24 @@ static u8 ov16_0223F6D4(u8 *param0, u8 *param1, u16 *param2) return param0[param1[0]++]; } -u16 ov16_0223F6E4(BattleSystem *param0) +u16 ov16_0223F6E4(BattleSystem *battleSystem) { - return param0->unk_2442; + return battleSystem->unk_2442; } -int ov16_0223F6F0(BattleSystem *param0, u16 param1) +int ov16_0223F6F0(BattleSystem *battleSystem, u16 param1) { - return param0->unk_2464[param1]; + return battleSystem->unk_2464[param1]; } -u16 BattleSystem_TrainerItems(BattleSystem *param0, int param1, int param2) +u16 BattleSystem_TrainerItems(BattleSystem *battleSystem, int param1, int param2) { - return param0->trainers[param1].items[param2]; + return battleSystem->trainers[param1].items[param2]; } -u32 BattleSystem_RecordingStopped(BattleSystem *param0) +u32 BattleSystem_RecordingStopped(BattleSystem *battleSystem) { - return param0->unk_2474_0; + return battleSystem->unk_2474_0; } void BattleSystem_SetStopRecording(BattleSystem *battleSys, int flag) @@ -1577,9 +1577,9 @@ void BattleSystem_SetStopRecording(BattleSystem *battleSys, int flag) return; } -BOOL ov16_0223F7A4(BattleSystem *param0) +BOOL ov16_0223F7A4(BattleSystem *battleSystem) { - if (((param0->battleStatusMask & 0x10) == 0) || (param0->unk_2474_0) || (BattleContext_Get(param0, param0->battleCtx, 13, 0) == 43) || (BattleContext_Get(param0, param0->battleCtx, 14, 0) == 43)) { + if (((battleSystem->battleStatusMask & 0x10) == 0) || (battleSystem->unk_2474_0) || (BattleContext_Get(battleSystem, battleSystem->battleCtx, 13, 0) == 43) || (BattleContext_Get(battleSystem, battleSystem->battleCtx, 14, 0) == 43)) { return 0; } @@ -1596,27 +1596,27 @@ void BattleSystem_ShowStopPlaybackButton(BattleSystem *battleSys) battleSys->playbackStopButton = ov16_0226E148(battleSys); } -u8 BattleSystem_RecordedChatter(BattleSystem *param0, int param1) +u8 BattleSystem_RecordedChatter(BattleSystem *battleSystem, int param1) { - if ((param0->battleType & 0x8) || ((param0->battleType & 0x10) && (BattleSystem_BattlerSlot(param0, param1) & 0x1))) { - return param0->unk_247C[param1]; - } else if (param0->battleType & 0x2) { - return param0->unk_247C[param1 & 1]; + if ((battleSystem->battleType & 0x8) || ((battleSystem->battleType & 0x10) && (BattleSystem_BattlerSlot(battleSystem, param1) & 0x1))) { + return battleSystem->unk_247C[param1]; + } else if (battleSystem->battleType & 0x2) { + return battleSystem->unk_247C[param1 & 1]; } else { - return param0->unk_247C[param1]; + return battleSystem->unk_247C[param1]; } } -void ov16_0223F858(BattleSystem *param0, u8 *param1) +void ov16_0223F858(BattleSystem *battleSystem, u8 *param1) { int v0; - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - param1[Battler_Type(param0->battlers[v0])] = v0; + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + param1[Battler_Type(battleSystem->battlers[v0])] = v0; } } -void ov16_0223F87C(BattleSystem *param0, u8 *param1) +void ov16_0223F87C(BattleSystem *battleSystem, u8 *param1) { int v0; @@ -1624,12 +1624,12 @@ void ov16_0223F87C(BattleSystem *param0, u8 *param1) param1[v0] = 0xff; } - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - param1[v0] = Battler_Type(param0->battlers[v0]); + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + param1[v0] = Battler_Type(battleSystem->battlers[v0]); } } -void ov16_0223F8AC(BattleSystem *param0, Sprite **param1) +void ov16_0223F8AC(BattleSystem *battleSystem, Sprite **param1) { int v0; @@ -1637,18 +1637,18 @@ void ov16_0223F8AC(BattleSystem *param0, Sprite **param1) param1[v0] = NULL; } - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - param1[v0] = ov16_02263AFC(param0->battlers[v0]); + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + param1[v0] = ov16_02263AFC(battleSystem->battlers[v0]); } } -void BattleSystem_SetGaugePriority(BattleSystem *param0, int param1) +void BattleSystem_SetGaugePriority(BattleSystem *battleSystem, int param1) { int v0; Healthbar *v1; - for (v0 = 0; v0 < param0->maxBattlers; v0++) { - v1 = ov16_02263B08(param0->battlers[v0]); + for (v0 = 0; v0 < battleSystem->maxBattlers; v0++) { + v1 = ov16_02263B08(battleSystem->battlers[v0]); ov16_022675D8(v1, param1); } } @@ -1678,43 +1678,43 @@ u32 BattleSystem_CalcMoneyPenalty(Party *party, TrainerInfo *trainerInfo) return penalty; } -void BattleSystem_DexFlagSeen(BattleSystem *param0, int param1) +void BattleSystem_DexFlagSeen(BattleSystem *battleSystem, int param1) { int v0; Pokemon *v1; int v2; - v0 = Battler_Type(param0->battlers[param1]); - v2 = BattleContext_Get(param0, param0->battleCtx, 2, param1); - v1 = BattleSystem_PartyPokemon(param0, param1, v2); + v0 = Battler_Type(battleSystem->battlers[param1]); + v2 = BattleContext_Get(battleSystem, battleSystem->battleCtx, 2, param1); + v1 = BattleSystem_PartyPokemon(battleSystem, param1, v2); - if ((param0->battleType & (0x4 | 0x80)) == 0) { - if ((v0 & 0x1) || (param0->battleType == (0x2 | 0x8 | 0x40)) || (param0->battleType == ((0x2 | 0x1) | 0x8 | 0x40))) { - sub_020272A4(param0->pokedex, v1); + if ((battleSystem->battleType & (0x4 | 0x80)) == 0) { + if ((v0 & 0x1) || (battleSystem->battleType == (0x2 | 0x8 | 0x40)) || (battleSystem->battleType == ((0x2 | 0x1) | 0x8 | 0x40))) { + sub_020272A4(battleSystem->pokedex, v1); } } if (((v0 & 0x1) == 0) && (Pokemon_GetValue(v1, MON_DATA_SPECIES_EGG, NULL) == 412)) { - sub_0202736C(param0->pokedex, v1); + sub_0202736C(battleSystem->pokedex, v1); } } -void ov16_0223F9A0(BattleSystem *param0, int param1) +void ov16_0223F9A0(BattleSystem *battleSystem, int param1) { int v0; - v0 = Battler_Type(param0->battlers[param1]); + v0 = Battler_Type(battleSystem->battlers[param1]); - if ((param0->battleType & (0x4 | 0x80)) == 0) { + if ((battleSystem->battleType & (0x4 | 0x80)) == 0) { if (v0 & 0x1) { { Pokemon *v1; int v2; - v2 = BattleContext_Get(param0, param0->battleCtx, 2, param1); - v1 = BattleSystem_PartyPokemon(param0, param1, v2); + v2 = BattleContext_Get(battleSystem, battleSystem->battleCtx, 2, param1); + v1 = BattleSystem_PartyPokemon(battleSystem, param1, v2); - sub_0202736C(param0->pokedex, v1); + sub_0202736C(battleSystem->pokedex, v1); } } } @@ -1730,20 +1730,20 @@ void Battle_SetDefaultBlend(void) G2_BlendNone(); } -u8 ov16_0223F9FC(BattleSystem *param0, int param1, int param2, int param3, int param4) +u8 ov16_0223F9FC(BattleSystem *battleSystem, int param1, int param2, int param3, int param4) { - Window *v0 = BattleSystem_Window(param0, 0); + Window *v0 = BattleSystem_Window(battleSystem, 0); int v1; - if (param0->battleType & 0x80) { + if (battleSystem->battleType & 0x80) { if (param1 == 10000) { { Strbuf *v2; if (param3 == 100) { - v2 = sub_02014B34(¶m0->trainers[param2].winMsg, 5); + v2 = sub_02014B34(&battleSystem->trainers[param2].winMsg, 5); } else { - v2 = sub_02014B34(¶m0->trainers[param2].loseMsg, 5); + v2 = sub_02014B34(&battleSystem->trainers[param2].loseMsg, 5); } Window_FillTilemap(v0, 0xff); @@ -1765,7 +1765,7 @@ u8 ov16_0223F9FC(BattleSystem *param0, int param1, int param2, int param3, int p } for (v7 = 0; v7 < 4; v7++) { - if (TrainerInfo_GameCode(param0->trainerInfo[v7]) == 0) { + if (TrainerInfo_GameCode(battleSystem->trainerInfo[v7]) == 0) { break; } } @@ -1787,9 +1787,9 @@ u8 ov16_0223F9FC(BattleSystem *param0, int param1, int param2, int param3, int p } } } else { - TrainerData_LoadMessage(param1, param3, param0->msgBuffer, 5); + Trainer_LoadMessage(param1, param3, battleSystem->msgBuffer, 5); Window_FillTilemap(v0, 0xff); - v1 = Text_AddPrinterWithParams(v0, FONT_MESSAGE, param0->msgBuffer, 0, 0, param4, BattleMessage_Callback); + v1 = Text_AddPrinterWithParams(v0, FONT_MESSAGE, battleSystem->msgBuffer, 0, 0, param4, BattleMessage_Callback); } return v1; @@ -1808,25 +1808,25 @@ u8 BattleMessage_Print(BattleSystem *battleSys, MessageLoader *msgLoader, Battle return Text_AddPrinterWithParams(textWindow, FONT_MESSAGE, battleSys->msgBuffer, 0, 0, renderDelay, BattleMessage_Callback); } -u8 BattleMessage_PrintToWindow(BattleSystem *param0, Window *param1, MessageLoader *param2, BattleMessage *param3, int param4, int param5, int param6, int param7, int param8) +u8 BattleMessage_PrintToWindow(BattleSystem *battleSystem, Window *param1, MessageLoader *param2, BattleMessage *param3, int param4, int param5, int param6, int param7, int param8) { int v0; - BattleMessage_CheckSide(param0, param3); - BattleMessage_FillFormatBuffers(param0, param3); - BattleMessage_Format(param0, param2, param3); + BattleMessage_CheckSide(battleSystem, param3); + BattleMessage_FillFormatBuffers(battleSystem, param3); + BattleMessage_Format(battleSystem, param2, param3); if (param6 & 0x1) { Window_FillTilemap(param1, 0xff); } if (param6 & 0x2) { - v0 = param7 - Font_CalcStrbufWidth(FONT_SYSTEM, param0->msgBuffer, 0); + v0 = param7 - Font_CalcStrbufWidth(FONT_SYSTEM, battleSystem->msgBuffer, 0); } else { v0 = 0; } - return Text_AddPrinterWithParams(param1, FONT_SYSTEM, param0->msgBuffer, param4 + v0, param5, param8, BattleMessage_Callback); + return Text_AddPrinterWithParams(param1, FONT_SYSTEM, battleSystem->msgBuffer, param4 + v0, param5, param8, BattleMessage_Callback); } /** @@ -2336,95 +2336,95 @@ static void BattleMessage_FillFormatBuffers(BattleSystem *battleSys, BattleMessa } } -static void BattleMessage_Nickname(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_Nickname(BattleSystem *battleSystem, u32 param1, int param2) { Pokemon *v0; - v0 = BattleSystem_PartyPokemon(param0, param2 & 0xff, (param2 & 0xff00) >> 8); - StringTemplate_SetNickname(param0->strFormatter, param1, &v0->box); + v0 = BattleSystem_PartyPokemon(battleSystem, param2 & 0xff, (param2 & 0xff00) >> 8); + StringTemplate_SetNickname(battleSystem->strFormatter, param1, &v0->box); } -static void BattleMessage_MoveName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_MoveName(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetMoveName(param0->strFormatter, param1, param2); + StringTemplate_SetMoveName(battleSystem->strFormatter, param1, param2); } -static void BattleMessage_ItemName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_ItemName(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetItemName(param0->strFormatter, param1, param2); + StringTemplate_SetItemName(battleSystem->strFormatter, param1, param2); } -static void BattleMessage_Number(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_Number(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetNumber(param0->strFormatter, param1, param2, 5, 0, 1); + StringTemplate_SetNumber(battleSystem->strFormatter, param1, param2, 5, 0, 1); } -static void BattleMessage_NumberDigits(BattleSystem *param0, u32 param1, int param2, int param3) +static void BattleMessage_NumberDigits(BattleSystem *battleSystem, u32 param1, int param2, int param3) { if (param3) { - StringTemplate_SetNumber(param0->strFormatter, param1, param2, param3, 1, 1); + StringTemplate_SetNumber(battleSystem->strFormatter, param1, param2, param3, 1, 1); } else { - StringTemplate_SetNumber(param0->strFormatter, param1, param2, 5, 1, 1); + StringTemplate_SetNumber(battleSystem->strFormatter, param1, param2, 5, 1, 1); } } -static void BattleMessage_TypeName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_TypeName(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetPokemonTypeName(param0->strFormatter, param1, param2); + StringTemplate_SetPokemonTypeName(battleSystem->strFormatter, param1, param2); } -static void BattleMessage_AbilityName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_AbilityName(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetAbilityName(param0->strFormatter, param1, param2); + StringTemplate_SetAbilityName(battleSystem->strFormatter, param1, param2); } -static void BattleMessage_StatName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_StatName(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetPokemonStatName(param0->strFormatter, param1, param2); + StringTemplate_SetPokemonStatName(battleSystem->strFormatter, param1, param2); } -static void BattleMessage_StatusName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_StatusName(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetStatusConditionName(param0->strFormatter, param1, param2); + StringTemplate_SetStatusConditionName(battleSystem->strFormatter, param1, param2); } -static void BattleMessage_PokemonName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_PokemonName(BattleSystem *battleSystem, u32 param1, int param2) { Pokemon *v0; - v0 = BattleSystem_PartyPokemon(param0, param2 & 0xff, (param2 & 0xff00) >> 8); - StringTemplate_SetSpeciesName(param0->strFormatter, param1, &v0->box); + v0 = BattleSystem_PartyPokemon(battleSystem, param2 & 0xff, (param2 & 0xff00) >> 8); + StringTemplate_SetSpeciesName(battleSystem->strFormatter, param1, &v0->box); } -static void BattleMessage_PoffinName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_PoffinName(BattleSystem *battleSystem, u32 param1, int param2) { return; } -static void BattleMessage_FlavorName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_FlavorName(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetFlavorName(param0->strFormatter, param1, param2); + StringTemplate_SetFlavorName(battleSystem->strFormatter, param1, param2); } -static void BattleMessage_TrainerClassName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_TrainerClassName(BattleSystem *battleSystem, u32 param1, int param2) { - TrainerData *v0; + Trainer *v0; - v0 = BattleSystem_TrainerData(param0, param2); - StringTemplate_SetTrainerClassNameBattle(param0->strFormatter, param1, v0); + v0 = BattleSystem_GetTrainer(battleSystem, param2); + StringTemplate_SetTrainerClassNameBattle(battleSystem->strFormatter, param1, v0); } -static void BattleMessage_TrainerName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_TrainerName(BattleSystem *battleSystem, u32 param1, int param2) { - TrainerData *v0; + Trainer *v0; - v0 = BattleSystem_TrainerData(param0, param2); - StringTemplate_SetTrainerNameBattle(param0->strFormatter, param1, v0); + v0 = BattleSystem_GetTrainer(battleSystem, param2); + StringTemplate_SetTrainerNameBattle(battleSystem->strFormatter, param1, v0); } -static void BattleMessage_PCBoxName(BattleSystem *param0, u32 param1, int param2) +static void BattleMessage_PCBoxName(BattleSystem *battleSystem, u32 param1, int param2) { - StringTemplate_SetPCBoxName(param0->strFormatter, param1, param0->pcBoxes, param2); + StringTemplate_SetPCBoxName(battleSystem->strFormatter, param1, battleSystem->pcBoxes, param2); } /** diff --git a/src/battle/trainer_ai/trainer_ai.c b/src/battle/trainer_ai/trainer_ai.c index 5366c99842..ebd48686c8 100644 --- a/src/battle/trainer_ai/trainer_ai.c +++ b/src/battle/trainer_ai/trainer_ai.c @@ -3478,11 +3478,11 @@ static BOOL AI_OnlyIneffectiveMoves(BattleSystem *battleSys, BattleContext *batt // "Player" consts here refer to the AI's perspective. if (BattleSystem_BattleType(battleSys) & BATTLE_TYPE_DOUBLES) { - defender1 = BATTLER_PLAYER_SLOT_1; - defender2 = BATTLER_PLAYER_SLOT_2; + defender1 = BATTLER_PLAYER_1; + defender2 = BATTLER_PLAYER_2; } else { - defender1 = BATTLER_PLAYER_SLOT_1; - defender2 = BATTLER_PLAYER_SLOT_1; + defender1 = BATTLER_PLAYER_1; + defender2 = BATTLER_PLAYER_1; } // Check all of this mon's attacking moves for immunities. If any of our moves can deal damage to diff --git a/src/enc_effects.c b/src/enc_effects.c index 84c4bfd384..e04c921652 100644 --- a/src/enc_effects.c +++ b/src/enc_effects.c @@ -127,7 +127,7 @@ static u32 EncEffects_GetEffectPair(const FieldBattleDTO *dto) u32 battleType = dto->battleType; if (battleType & BATTLE_TYPE_TRAINER) { - u32 trainerEffect = EncEffects_TrainerClassEffect(dto->trainerData[1].class); + u32 trainerEffect = EncEffects_TrainerClassEffect(dto->trainer[1].class); if (battleType & BATTLE_TYPE_FRONTIER) { if (trainerEffect == ENCEFF_FRONTIER_BRAIN) { diff --git a/src/encounter.c b/src/encounter.c index bdb0be7235..25e1379b00 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -585,7 +585,7 @@ void Encounter_NewFatefulVsSpeciesAtLevel(FieldTask *taskMan, u16 species, u8 le ov6_022420D4(fieldSystem, species, level, dto); BOOL tmp = TRUE; - Pokemon *wildMon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_ENEMY_SLOT_1], 0); + Pokemon *wildMon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_ENEMY_1], 0); Pokemon_SetValue(wildMon, MON_DATA_FATEFUL_ENCOUNTER, &tmp); if (isLegendary) { @@ -667,11 +667,11 @@ void Encounter_NewVsFirstBattle(FieldTask *task, int trainerID, int heapID, int FieldBattleDTO_Init(dto, fieldSystem); dto->battleStatusMask = BATTLE_STATUS_FIRST_BATTLE; - dto->trainerIDs[BATTLER_ENEMY_SLOT_1] = trainerID; - dto->trainerIDs[BATTLER_ENEMY_SLOT_2] = 0; - dto->trainerIDs[BATTLER_PLAYER_SLOT_2] = 0; + dto->trainerIDs[BATTLER_ENEMY_1] = trainerID; + dto->trainerIDs[BATTLER_ENEMY_2] = 0; + dto->trainerIDs[BATTLER_PLAYER_2] = 0; - TrainerData_Encounter(dto, fieldSystem->saveData, heapID); + Trainer_Encounter(dto, fieldSystem->saveData, heapID); GameRecords_IncrementRecordValue(SaveData_GetGameRecordsPtr(fieldSystem->saveData), RECORD_TRAINER_BATTLES_FOUGHT); StartEncounter(task, dto, EncEffects_CutInEffect(dto), EncEffects_BGM(dto), resultMaskPtr); } @@ -761,11 +761,11 @@ void Encounter_NewVsTrainer(FieldTask *taskMan, int enemyTrainer1ID, int enemyTr dto->battleStatusMask |= BATTLE_STATUS_DISTORTION; } - dto->trainerIDs[BATTLER_ENEMY_SLOT_1] = enemyTrainer1ID; - dto->trainerIDs[BATTLER_ENEMY_SLOT_2] = enemyTrainer2ID; - dto->trainerIDs[BATTLER_PLAYER_SLOT_2] = partnerTrainerID; + dto->trainerIDs[BATTLER_ENEMY_1] = enemyTrainer1ID; + dto->trainerIDs[BATTLER_ENEMY_2] = enemyTrainer2ID; + dto->trainerIDs[BATTLER_PLAYER_2] = partnerTrainerID; - TrainerData_Encounter(dto, fieldSystem->saveData, heapID); + Trainer_Encounter(dto, fieldSystem->saveData, heapID); GameRecords_IncrementRecordValue(SaveData_GetGameRecordsPtr(fieldSystem->saveData), RECORD_TRAINER_BATTLES_FOUGHT); StartEncounter(taskMan, dto, EncEffects_CutInEffect(dto), EncEffects_BGM(dto), resultMaskPtr); } @@ -819,10 +819,10 @@ void Encounter_NewVsWiFi(FieldTask *task, int param1, int normalizedLevel, int w } else { battleType = BATTLE_TYPE_FRONTIER_DOUBLES | BATTLE_TYPE_LINK | BATTLE_TYPE_2vs2; dto = FieldBattleDTO_New(HEAP_ID_FIELDMAP, battleType); - dto->trainerIDs[BATTLER_ENEMY_SLOT_1] = 1; - dto->trainerIDs[BATTLER_ENEMY_SLOT_2] = 2; + dto->trainerIDs[BATTLER_ENEMY_1] = 1; + dto->trainerIDs[BATTLER_ENEMY_2] = 2; - TrainerData_Encounter(dto, fieldSystem->saveData, HEAP_ID_FIELDMAP); + Trainer_Encounter(dto, fieldSystem->saveData, HEAP_ID_FIELDMAP); v5 = (UnkEnum_0202F510_14); } @@ -909,7 +909,7 @@ static void UpdateGameRecords(FieldSystem *fieldSystem, FieldBattleDTO *dto) } else if (resultMask == BATTLE_RESULT_CAPTURED_MON) { // BUG: This always chooses slot 1 of a double-wild battle when the player has an AI partner, // rather than choosing the Pokemon that was actually captured. - caughtMon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_ENEMY_SLOT_1], 0); + caughtMon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_ENEMY_1], 0); if (sub_0207A294(0, Pokemon_GetValue(caughtMon, MON_DATA_SPECIES, NULL))) { GameRecords_IncrementTrainerScore(SaveData_GetGameRecordsPtr(fieldSystem->saveData), TRAINER_SCORE_EVENT_CAPTURED_REGIONAL_MON); @@ -923,7 +923,7 @@ static void UpdateGameRecords(FieldSystem *fieldSystem, FieldBattleDTO *dto) } } else if ((battleType & BATTLE_TYPE_SAFARI) || (battleType & BATTLE_TYPE_PAL_PARK)) { if (resultMask == BATTLE_RESULT_CAPTURED_MON) { - caughtMon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_ENEMY_SLOT_1], 0); + caughtMon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_ENEMY_1], 0); if (sub_0207A294(0, Pokemon_GetValue(caughtMon, MON_DATA_SPECIES, NULL))) { GameRecords_IncrementTrainerScore(SaveData_GetGameRecordsPtr(fieldSystem->saveData), TRAINER_SCORE_EVENT_CAPTURED_REGIONAL_MON); @@ -975,7 +975,7 @@ static void UpdateJournal(FieldSystem *fieldSystem, FieldBattleDTO *dto) } } else if ((battleType & BATTLE_TYPE_TRAINER) || (battleType & BATTLE_TYPE_TAG)) { if (resultMask == BATTLE_RESULT_WIN) { - sub_0202C720(fieldSystem->journal, fieldSystem->location->mapId, dto->trainerIDs[BATTLER_ENEMY_SLOT_1], HEAP_ID_FIELDMAP); + sub_0202C720(fieldSystem->journal, fieldSystem->location->mapId, dto->trainerIDs[BATTLER_ENEMY_1], HEAP_ID_FIELDMAP); } } } @@ -991,7 +991,7 @@ void Encounter_NewVsGiratinaOrigin(FieldTask *task, u16 species, u8 level, int * ov6_022420D4(fieldSystem, species, level, dto); - Pokemon *wildMon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_ENEMY_SLOT_1], 0); + Pokemon *wildMon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_ENEMY_1], 0); Pokemon_SetGiratinaOriginForm(wildMon); if (isLegendary) { diff --git a/src/field_battle_data_transfer.c b/src/field_battle_data_transfer.c index 9e6175bc7c..072d82c67d 100644 --- a/src/field_battle_data_transfer.c +++ b/src/field_battle_data_transfer.c @@ -80,13 +80,13 @@ FieldBattleDTO *FieldBattleDTO_New(enum HeapId heapID, u32 battleType) for (i = 0; i < MAX_BATTLERS; i++) { dto->trainerIDs[i] = 0; - MI_CpuClear32(&dto->trainerData[i], sizeof(TrainerData)); + MI_CpuClear32(&dto->trainer[i], sizeof(Trainer)); } dto->background = BACKGROUND_PLAIN; dto->terrain = TERRAIN_MAX; dto->mapLabelTextID = pl_msg_00000433_00000; - dto->timeOfDay = TOD_MORNING; + dto->timeOfDay = TIMEOFDAY_MORNING; dto->mapEvolutionMethod = 0; dto->visitedContestHall = TRUE; dto->metBebe = TRUE; @@ -101,11 +101,11 @@ FieldBattleDTO *FieldBattleDTO_New(enum HeapId heapID, u32 battleType) } for (i = 0; i < MAX_BATTLERS; i++) { - dto->chatotCries[i] = AllocateAndInitializeChatotCryData(heapID); + dto->chatotCries[i] = ChatotCry_New(heapID); } dto->bag = Bag_New(heapID); - dto->pokedex = sub_02026324(heapID); + dto->pokedex = Pokedex_New(heapID); dto->options = Options_New(heapID); dto->unk_10C = sub_0206D140(heapID); dto->bagCursor = NULL; @@ -164,21 +164,21 @@ FieldBattleDTO *FieldBattleDTO_NewCatchingTutorial(enum HeapId heapID, const Fie strbuf = Strbuf_Init(TRAINER_NAME_LEN + 1, heapID); MessageLoader_GetStrbuf(msgLoader, TrainerInfo_Gender(trainerInfo) ^ 1, strbuf); - TrainerInfo_SetName(dto->trainerInfo[BATTLER_PLAYER_SLOT_1], Strbuf_GetData(strbuf)); + TrainerInfo_SetName(dto->trainerInfo[BATTLER_PLAYER_1], Strbuf_GetData(strbuf)); Strbuf_Free(strbuf); MessageLoader_Free(msgLoader); - TrainerInfo_SetGender(dto->trainerInfo[BATTLER_PLAYER_SLOT_1], TrainerInfo_Gender(trainerInfo) ^ 1); + TrainerInfo_SetGender(dto->trainerInfo[BATTLER_PLAYER_1], TrainerInfo_Gender(trainerInfo) ^ 1); SetBackgroundAndTerrain(dto, fieldSystem); Options_Copy(options, dto->options); dto->timeOfDay = FieldSystem_GetTimeOfDay(fieldSystem); Bag_TryAddItem(dto->bag, ITEM_POKE_BALL, 20, heapID); mon = Pokemon_New(heapID); - Pokemon_InitWith(mon, sub_0206B08C(SaveData_GetVarsFlags(fieldSystem->saveData)), 5, 32, FALSE, 0, OTID_NOT_SHINY, 0); - Party_AddPokemon(dto->parties[BATTLER_PLAYER_SLOT_1], mon); + Pokemon_InitWith(mon, VarsFlags_GetProfessorAssistantStarterSpecies(SaveData_GetVarsFlags(fieldSystem->saveData)), 5, 32, FALSE, 0, OTID_NOT_SHINY, 0); + Party_AddPokemon(dto->parties[BATTLER_PLAYER_1], mon); Pokemon_InitWith(mon, SPECIES_BIDOOF, 2, 32, FALSE, 0, OTID_NOT_SHINY, 0); - Party_AddPokemon(dto->parties[BATTLER_ENEMY_SLOT_1], mon); + Party_AddPokemon(dto->parties[BATTLER_ENEMY_1], mon); Heap_FreeToHeap(mon); dto->pcBoxes = SaveData_PCBoxes(fieldSystem->saveData); @@ -247,7 +247,7 @@ void FieldBattleDTO_InitFromGameState(FieldBattleDTO *dto, const FieldSystem *fi TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(save); Party *party = Party_GetFromSavedata(save); Bag *bag = SaveData_GetBag(save); - PokedexData *pokedex = SaveData_Pokedex(save); + Pokedex *pokedex = SaveData_Pokedex(save); ChatotCry *chatotCry = GetChatotCryDataFromSave(save); Options *options = SaveData_Options(save); FieldOverworldState *fieldOverworldState = SaveData_GetFieldOverworldState(save); @@ -263,12 +263,12 @@ void FieldBattleDTO_InitFromGameState(FieldBattleDTO *dto, const FieldSystem *fi dto->timeOfDay = TimeOfDayForHour(gameTime->time.hour); } - FieldBattleDTO_CopyTrainerInfoToBattler(dto, trainerInfo, BATTLER_PLAYER_SLOT_1); - FieldBattleDTO_CopyPartyToBattler(dto, party, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_CopyTrainerInfoToBattler(dto, trainerInfo, BATTLER_PLAYER_1); + FieldBattleDTO_CopyPartyToBattler(dto, party, BATTLER_PLAYER_1); Bag_Copy(bag, dto->bag); Pokedex_Copy(pokedex, dto->pokedex); Options_Copy(options, dto->options); - FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_1); dto->pcBoxes = SaveData_PCBoxes(save); dto->mapLabelTextID = MapHeader_GetMapLabelTextID(mapHeaderID); @@ -300,17 +300,17 @@ void FieldBattleDTO_InitWithNormalizedMonLevels(FieldBattleDTO *dto, const Field TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); Party *party = Party_GetFromSavedata(fieldSystem->saveData); Bag *bag = SaveData_GetBag(fieldSystem->saveData); - PokedexData *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); ChatotCry *chatotCry = GetChatotCryDataFromSave(fieldSystem->saveData); Options *options = SaveData_Options(fieldSystem->saveData); dto->background = BACKGROUND_INDOORS_1; dto->terrain = TERRAIN_BUILDING; - FieldBattleDTO_CopyTrainerInfoToBattler(dto, trainerInfo, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_CopyTrainerInfoToBattler(dto, trainerInfo, BATTLER_PLAYER_1); Pokemon *mon = Pokemon_New(HEAP_ID_FIELDMAP); - Party_InitWithCapacity(dto->parties[BATTLER_PLAYER_SLOT_1], Party_GetCurrentCount(party)); + Party_InitWithCapacity(dto->parties[BATTLER_PLAYER_1], Party_GetCurrentCount(party)); for (i = 0; i < Party_GetCurrentCount(party); i++) { Pokemon_Copy(Party_GetPokemonBySlotIndex(party, i), mon); @@ -320,14 +320,14 @@ void FieldBattleDTO_InitWithNormalizedMonLevels(FieldBattleDTO *dto, const Field Pokemon_CalcLevelAndStats(mon); } - FieldBattleDTO_AddPokemonToBattler(dto, mon, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_AddPokemonToBattler(dto, mon, BATTLER_PLAYER_1); } Heap_FreeToHeap(mon); Bag_Copy(bag, dto->bag); Pokedex_Copy(pokedex, dto->pokedex); Options_Copy(options, dto->options); - FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_1); dto->pcBoxes = SaveData_PCBoxes(fieldSystem->saveData); dto->timeOfDay = FieldSystem_GetTimeOfDay(fieldSystem); @@ -348,7 +348,7 @@ void FieldBattleDTO_InitWithPartyOrder(FieldBattleDTO *dto, const FieldSystem *f { TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); Bag *bag = SaveData_GetBag(fieldSystem->saveData); - PokedexData *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); ChatotCry *chatotCry = GetChatotCryDataFromSave(fieldSystem->saveData); Options *options = SaveData_Options(fieldSystem->saveData); const BattleRegulation *regulation = fieldSystem->unk_B0; @@ -358,10 +358,10 @@ void FieldBattleDTO_InitWithPartyOrder(FieldBattleDTO *dto, const FieldSystem *f dto->background = BACKGROUND_INDOORS_1; dto->terrain = TERRAIN_BUILDING; - FieldBattleDTO_CopyTrainerInfoToBattler(dto, trainerInfo, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_CopyTrainerInfoToBattler(dto, trainerInfo, BATTLER_PLAYER_1); if (partyOrder == NULL) { - FieldBattleDTO_CopyPartyToBattler(dto, party, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_CopyPartyToBattler(dto, party, BATTLER_PLAYER_1); } else { int numToCopy = 0; for (i = 0; i < MAX_PARTY_SIZE; i++) { @@ -371,13 +371,13 @@ void FieldBattleDTO_InitWithPartyOrder(FieldBattleDTO *dto, const FieldSystem *f } if (numToCopy == 0) { - FieldBattleDTO_CopyPartyToBattler(dto, party, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_CopyPartyToBattler(dto, party, BATTLER_PLAYER_1); } else { mon = Pokemon_New(HEAP_ID_FIELDMAP); - Party_InitWithCapacity(dto->parties[BATTLER_PLAYER_SLOT_1], numToCopy); + Party_InitWithCapacity(dto->parties[BATTLER_PLAYER_1], numToCopy); for (i = 0; i < numToCopy; i++) { Pokemon_Copy(Party_GetPokemonBySlotIndex(party, partyOrder[i] - 1), mon); - FieldBattleDTO_AddPokemonToBattler(dto, mon, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_AddPokemonToBattler(dto, mon, BATTLER_PLAYER_1); } Heap_FreeToHeap(mon); @@ -393,7 +393,7 @@ void FieldBattleDTO_InitWithPartyOrder(FieldBattleDTO *dto, const FieldSystem *f Bag_Copy(bag, dto->bag); Pokedex_Copy(pokedex, dto->pokedex); Options_Copy(options, dto->options); - FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_SLOT_1); + FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_1); dto->pcBoxes = SaveData_PCBoxes(fieldSystem->saveData); dto->timeOfDay = FieldSystem_GetTimeOfDay(fieldSystem); @@ -410,9 +410,9 @@ void FieldBattleDTO_InitWithPartyOrder(FieldBattleDTO *dto, const FieldSystem *f int unionAppearance = TrainerInfo_Appearance(trainerInfo); int unionGender = TrainerInfo_Gender(trainerInfo); - dto->trainerData[BATTLER_PLAYER_SLOT_1].class = sub_0205CA14(unionGender, unionAppearance, 1); - CharCode_Copy(dto->trainerData[BATTLER_PLAYER_SLOT_1].name, TrainerInfo_Name(dto->trainerInfo[BATTLER_PLAYER_SLOT_1])); - dto->trainerData[BATTLER_PLAYER_SLOT_2] = dto->trainerData[BATTLER_PLAYER_SLOT_1]; + dto->trainer[BATTLER_PLAYER_1].class = sub_0205CA14(unionGender, unionAppearance, 1); + CharCode_Copy(dto->trainer[BATTLER_PLAYER_1].name, TrainerInfo_Name(dto->trainerInfo[BATTLER_PLAYER_1])); + dto->trainer[BATTLER_PLAYER_2] = dto->trainer[BATTLER_PLAYER_1]; } else { FieldBattleDTO_CopyPlayerInfoToTrainerData(dto); } @@ -428,11 +428,11 @@ void FieldBattleDTO_UpdateFieldSystem(const FieldBattleDTO *dto, FieldSystem *fi TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); Party *party = Party_GetFromSavedata(fieldSystem->saveData); Bag *bag = SaveData_GetBag(fieldSystem->saveData); - PokedexData *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); u16 *fieldSysSafariBalls = FieldOverworldState_GetSafariBallCount(SaveData_GetFieldOverworldState(fieldSystem->saveData)); - TrainerInfo_Copy(dto->trainerInfo[BATTLER_PLAYER_SLOT_1], trainerInfo); - Party_cpy(dto->parties[BATTLER_PLAYER_SLOT_1], party); + TrainerInfo_Copy(dto->trainerInfo[BATTLER_PLAYER_1], trainerInfo); + Party_cpy(dto->parties[BATTLER_PLAYER_1], party); Bag_Copy(dto->bag, bag); Pokedex_Copy(dto->pokedex, pokedex); @@ -444,7 +444,7 @@ void FieldBattleDTO_UpdatePokedex(const FieldBattleDTO *dto, FieldSystem *fieldS TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); Party *party = Party_GetFromSavedata(fieldSystem->saveData); Bag *bag = SaveData_GetBag(fieldSystem->saveData); - PokedexData *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); Pokedex_Copy(dto->pokedex, pokedex); } @@ -554,7 +554,7 @@ BOOL CheckPlayerDidNotCaptureWildMon(u32 battleResult) void FieldBattleDTO_CopyPlayerInfoToTrainerData(FieldBattleDTO *dto) { - dto->trainerData[BATTLER_PLAYER_SLOT_1].class = TrainerInfo_Gender(dto->trainerInfo[BATTLER_PLAYER_SLOT_1]); - CharCode_Copy(dto->trainerData[BATTLER_PLAYER_SLOT_1].name, TrainerInfo_Name(dto->trainerInfo[BATTLER_PLAYER_SLOT_1])); - dto->trainerData[BATTLER_PLAYER_SLOT_2] = dto->trainerData[BATTLER_PLAYER_SLOT_1]; + dto->trainer[BATTLER_PLAYER_1].class = TrainerInfo_Gender(dto->trainerInfo[BATTLER_PLAYER_1]); + CharCode_Copy(dto->trainer[BATTLER_PLAYER_1].name, TrainerInfo_Name(dto->trainerInfo[BATTLER_PLAYER_1])); + dto->trainer[BATTLER_PLAYER_2] = dto->trainer[BATTLER_PLAYER_1]; } diff --git a/src/field_menu.c b/src/field_menu.c index e394741610..517aca8ca4 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -941,7 +941,7 @@ static BOOL FieldMenu_Pokedex(FieldTask *taskMan) FieldSystem *fieldSystem; FieldMenu *menu; UnkStruct_ov21_021D0D80 *v2; - PokedexData *v3; + Pokedex *v3; TrainerInfo *v4; VarsFlags *v5; diff --git a/src/game_records.c b/src/game_records.c index 2b86b58cb9..940cb9b12b 100644 --- a/src/game_records.c +++ b/src/game_records.c @@ -407,7 +407,7 @@ u32 GameRecords_GetTrainerScore(GameRecords *records) return GameRecords_GetRecordValue(records, RECORD_TRAINER_SCORE); } -void GameRecords_IncrementTrainerScoreOnCatch(GameRecords *records, const PokedexData *pokedex, const u16 species) +void GameRecords_IncrementTrainerScoreOnCatch(GameRecords *records, const Pokedex *pokedex, const u16 species) { if (!Pokedex_HasCaughtSpecies(pokedex, species)) { GameRecords_IncrementTrainerScore(records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); diff --git a/src/overlay005/ov5_021F77A8.c b/src/overlay005/ov5_021F77A8.c index 25a233c615..bfd918e3ab 100644 --- a/src/overlay005/ov5_021F77A8.c +++ b/src/overlay005/ov5_021F77A8.c @@ -90,7 +90,7 @@ BOOL ScrCmd_337(ScriptContext *param0) { u16 v0 = FieldSystem_TryGetVar(param0->fieldSystem, ScriptContext_ReadHalfWord(param0)); u16 *v1 = FieldSystem_GetVarPointer(param0->fieldSystem, ScriptContext_ReadHalfWord(param0)); - PokedexData *v2 = SaveData_Pokedex(param0->fieldSystem->saveData); + Pokedex *v2 = SaveData_Pokedex(param0->fieldSystem->saveData); *v1 = Pokedex_HasSeenSpecies(v2, v0); return 0; diff --git a/src/overlay005/save_info_window.c b/src/overlay005/save_info_window.c index 5fe0abdb22..360a4876e0 100644 --- a/src/overlay005/save_info_window.c +++ b/src/overlay005/save_info_window.c @@ -51,7 +51,7 @@ static void SaveInfo_SetValues(SaveInfo *saveInfo, const FieldSystem *fieldSyste { SaveData *saveData = fieldSystem->saveData; Location *curLocation = FieldOverworldState_GetPlayerLocation(SaveData_GetFieldOverworldState(saveData)); - PokedexData *pokedex = SaveData_Pokedex(saveData); + Pokedex *pokedex = SaveData_Pokedex(saveData); saveInfo->mapLabelTextID = MapHeader_GetMapLabelTextID(curLocation->mapId); diff --git a/src/overlay006/ov6_02240C9C.c b/src/overlay006/ov6_02240C9C.c index 186c3890fd..2a5ad881ab 100644 --- a/src/overlay006/ov6_02240C9C.c +++ b/src/overlay006/ov6_02240C9C.c @@ -180,10 +180,10 @@ void WildEncounters_ReplaceTimedEncounters(const WildEncounters *encounterData, { int timeOfDay = GetTimeOfDay(); - if (timeOfDay == TOD_DAY || timeOfDay == TOD_TWILIGHT) { + if (timeOfDay == TIMEOFDAY_DAY || timeOfDay == TIMEOFDAY_TWILIGHT) { *timedSlot1 = encounterData->dayEncounters[0]; *timedSlot2 = encounterData->dayEncounters[1]; - } else if (timeOfDay == TOD_NIGHT || timeOfDay == TOD_LATE_NIGHT) { + } else if (timeOfDay == TIMEOFDAY_NIGHT || timeOfDay == TIMEOFDAY_LATE_NIGHT) { *timedSlot1 = encounterData->nightEncounters[0]; *timedSlot2 = encounterData->nightEncounters[1]; } @@ -339,7 +339,7 @@ BOOL ov6_02240D5C(FieldSystem *fieldSystem) } else { { battleParams->trainerIDs[2] = sub_0206B034(SaveData_GetVarsFlags(fieldSystem->saveData)); - TrainerData_Encounter(battleParams, fieldSystem->saveData, 11); + Trainer_Encounter(battleParams, fieldSystem->saveData, 11); } v7 = ov6_0224174C(fieldSystem, firstPartyMon, battleParams, v13, &encounterFieldParams); } @@ -526,7 +526,7 @@ BOOL ov6_022411C8(FieldSystem *fieldSystem, FieldTask *param1) v8 = ov6_02241674(fieldSystem, firstPartyMon, battleParams, encounterData, v12, &encounterFieldParams, &v9); } else { battleParams->trainerIDs[2] = sub_0206B034(SaveData_GetVarsFlags(fieldSystem->saveData)); - TrainerData_Encounter(battleParams, fieldSystem->saveData, 11); + Trainer_Encounter(battleParams, fieldSystem->saveData, 11); v8 = ov6_0224174C(fieldSystem, firstPartyMon, battleParams, v12, &encounterFieldParams); } } else if (encounterType == ENCOUNTER_TYPE_SURF) { @@ -656,7 +656,7 @@ BOOL ov6_022413E4(FieldSystem *fieldSystem, FieldBattleDTO **battleParams) } else { { (*battleParams)->trainerIDs[2] = sub_0206B034(SaveData_GetVarsFlags(fieldSystem->saveData)); - TrainerData_Encounter(*battleParams, fieldSystem->saveData, 11); + Trainer_Encounter(*battleParams, fieldSystem->saveData, 11); } v6 = ov6_0224174C(fieldSystem, firstPartyMon, *battleParams, v12, &encounterFieldParams); } diff --git a/src/overlay006/ov6_02246A30.c b/src/overlay006/ov6_02246A30.c index f22f66e322..b55dde9804 100644 --- a/src/overlay006/ov6_02246A30.c +++ b/src/overlay006/ov6_02246A30.c @@ -144,13 +144,13 @@ static BOOL ov6_02246AB0(FieldSystem *fieldSystem) static BOOL ov6_02246AC8(FieldSystem *fieldSystem) { - PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); return sub_02026F0C(v0); } static BOOL ov6_02246AD8(FieldSystem *fieldSystem) { - PokedexData *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); return Pokedex_IsObtained(pokedex); } diff --git a/src/overlay010/ov10_0221F800.c b/src/overlay010/ov10_0221F800.c index a9178422eb..1fb65d6a99 100644 --- a/src/overlay010/ov10_0221F800.c +++ b/src/overlay010/ov10_0221F800.c @@ -2407,7 +2407,7 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) v5 = param0->unk_2A - 1; if (MapHeader_IsUnionRoom(param0->unk_00->mapHeaderID) == 1) { - v3 = TrainerClass_Gender(param0->unk_00->trainerData[v6 ^ 1].class); + v3 = TrainerClass_Gender(param0->unk_00->trainer[v6 ^ 1].class); v1 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * 8); Strbuf_ToChars(param0->unk_14[sub_020362F4(v6 ^ 1)], v1, 8); @@ -2416,7 +2416,7 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) } else { switch (sub_0203895C()) { case 1: - v3 = TrainerClass_Gender(param0->unk_00->trainerData[v6 ^ 1].class); + v3 = TrainerClass_Gender(param0->unk_00->trainer[v6 ^ 1].class); v1 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * 8); Strbuf_ToChars(param0->unk_14[sub_020362F4(v6 ^ 1)], v1, 8); @@ -2425,7 +2425,7 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) Heap_FreeToHeap(v1); break; case 2: - v3 = TrainerClass_Gender(param0->unk_00->trainerData[v6 ^ 1].class); + v3 = TrainerClass_Gender(param0->unk_00->trainer[v6 ^ 1].class); v1 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * 8); Strbuf_ToChars(param0->unk_14[sub_020362F4(v6 ^ 1)], v1, 8); @@ -2434,7 +2434,7 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) Heap_FreeToHeap(v1); break; case 3: - v3 = TrainerClass_Gender(param0->unk_00->trainerData[v6 ^ 1].class); + v3 = TrainerClass_Gender(param0->unk_00->trainer[v6 ^ 1].class); v1 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * 8); Strbuf_ToChars(param0->unk_14[sub_020362F4(v6 ^ 1)], v1, 8); @@ -2447,14 +2447,14 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) v2 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * 8); if (ov10_02220AD0() == 1) { - v3 = TrainerClass_Gender(param0->unk_00->trainerData[1].class); - v4 = TrainerClass_Gender(param0->unk_00->trainerData[3].class); + v3 = TrainerClass_Gender(param0->unk_00->trainer[1].class); + v4 = TrainerClass_Gender(param0->unk_00->trainer[3].class); Strbuf_ToChars(param0->unk_14[1], v1, 8); Strbuf_ToChars(param0->unk_14[3], v2, 8); } else { - v3 = TrainerClass_Gender(param0->unk_00->trainerData[0].class); - v4 = TrainerClass_Gender(param0->unk_00->trainerData[2].class); + v3 = TrainerClass_Gender(param0->unk_00->trainer[0].class); + v4 = TrainerClass_Gender(param0->unk_00->trainer[2].class); Strbuf_ToChars(param0->unk_14[0], v1, 8); Strbuf_ToChars(param0->unk_14[2], v2, 8); diff --git a/src/overlay013/ov13_0221FC20.c b/src/overlay013/ov13_0221FC20.c index cc82c9dc40..5bcd8e52aa 100644 --- a/src/overlay013/ov13_0221FC20.c +++ b/src/overlay013/ov13_0221FC20.c @@ -1601,7 +1601,7 @@ static u8 ov13_022217A4(UnkStruct_ov13_022213F0 *param0) int v2; v2 = BattleSystem_Partner(param0->unk_00->unk_08, param0->unk_00->unk_28); - StringTemplate_SetTrainerNameBattle(param0->unk_1FA8, 0, BattleSystem_TrainerData(param0->unk_00->unk_08, v2)); + StringTemplate_SetTrainerNameBattle(param0->unk_1FA8, 0, BattleSystem_GetTrainer(param0->unk_00->unk_08, v2)); } StringTemplate_Format(param0->unk_1FA8, param0->unk_1FAC, v1); Strbuf_Free(v1); diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index ce71debb09..aa27e3f873 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -296,10 +296,10 @@ static int PokedexEncounters_PopulateEncounterCollection(UnkStruct_ov21_021E6A68 param0->unk_08 = encounterCollection; - if (v0->unk_00->timeOfDay == TOD_MORNING) { + if (v0->unk_00->timeOfDay == TIMEOFDAY_MORNING) { v0->encounterTime = ENCTIME_MORNING; } else { - if ((v0->unk_00->timeOfDay == TOD_DAY) || (v0->unk_00->timeOfDay == TOD_TWILIGHT)) { + if ((v0->unk_00->timeOfDay == TIMEOFDAY_DAY) || (v0->unk_00->timeOfDay == TIMEOFDAY_TWILIGHT)) { v0->encounterTime = ENCTIME_DAY; } else { v0->encounterTime = ENCTIME_NIGHT; diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c index 82731c33fa..e9aa210f8a 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/pokedex_sort.c @@ -74,17 +74,17 @@ enum PokedexDataSortIndex { PDSI_NUMSORTS }; -static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const PokedexData *dexData, const u16 *fullDex, int pokedexLength); -static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const PokedexData *dexData); -static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const PokedexData *dexData, const u16 *encounteredPokedex, int caughtStatusLength); +static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const Pokedex *dexData, const u16 *fullDex, int pokedexLength); +static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const Pokedex *dexData); +static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const Pokedex *dexData, const u16 *encounteredPokedex, int caughtStatusLength); static void PopulateDisplayPokedex_Blanks(SortedPokedex *sortedPokedex, const u16 *fullDex, int pokedexLength); static void PopulateDisplayPokedex(SortedPokedex *sortedPokedex); static void NumEncounteredAndCaught(SortedPokedex *sortedPokedex, int *caughtStatusLength, int *numCaught); static u16 *PokedexFromNARC(int heapID, int pokedexSort, int *pokedexLength); -static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData); -static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData); -static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData); -static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData); +static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData); +static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData); +static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData); +static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData); void PokedexSort_PopulatePokedexStatus(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int heapID) { @@ -653,7 +653,7 @@ u32 ov21_021D3998(const UnkStruct_ov21_021D3320 *param0) return param0->unk_1758; } -static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const PokedexData *dexData, const u16 *fullDex, int pokedexLength) +static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const Pokedex *dexData, const u16 *fullDex, int pokedexLength) { *caughtStatusLength = 0; @@ -665,7 +665,7 @@ static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, co } } -static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const PokedexData *dexData) +static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const Pokedex *dexData) { int dexIndex2; @@ -691,7 +691,7 @@ static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u } } -static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const PokedexData *dexData, const u16 *encounteredPokedex, int caughtStatusLength) +static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const Pokedex *dexData, const u16 *encounteredPokedex, int caughtStatusLength) { sortedPokedex->caughtStatusLength = 0; @@ -749,7 +749,7 @@ static u16 *PokedexFromNARC(int heapID, int pokedexSort, int *pokedexLength) return pokedexFromFile; } -static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData) +static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData) { u16 *pokedexFromFile; int pokedexLength; @@ -789,7 +789,7 @@ static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting } } -static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData) +static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData) { u16 *pokedexFromFile; int pokedexLength; @@ -839,7 +839,7 @@ static void FilterByName(int filterName, u16 *resultingPokedex, int *numResultin } } -static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData) +static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData) { u16 *pokedexFromFile; int pokedexLength; @@ -913,7 +913,7 @@ static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResultin } } -static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const PokedexData *dexData) +static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData) { u16 *pokedexFromFile; int pokedexLength; diff --git a/src/overlay028/ov28_022561C0.c b/src/overlay028/ov28_022561C0.c index cba4ccbffd..105146cd92 100644 --- a/src/overlay028/ov28_022561C0.c +++ b/src/overlay028/ov28_022561C0.c @@ -632,7 +632,7 @@ static void ov28_02256914(UnkStruct_ov28_02256210 *param0, const UnkStruct_ov28_ s64 v0 = ov28_02257468(param1); if ((v0 > 0) && (v0 <= NATIONAL_DEX_COUNT)) { - PokedexData *v1; + Pokedex *v1; u16 v2; v1 = SaveData_Pokedex(PoketchSystem_GetSaveData(param0->poketchSys)); diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index 86a579927b..41dabf9785 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -1472,7 +1472,7 @@ static BOOL ov62_02239984(UnkStruct_0208C06C *param0, int param1) int v7; int v8 = 0; BOOL v9; - PokedexData *v10 = SaveData_Pokedex(param0->unk_830); + Pokedex *v10 = SaveData_Pokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { v9 = Pokedex_HasSeenSpecies(v10, v1[v7]); @@ -1516,7 +1516,7 @@ static void ov62_02239A0C(UnkStruct_0208C06C *param0, int param1) int v5; int v6 = 0; BOOL v7; - PokedexData *v8 = SaveData_Pokedex(param0->unk_830); + Pokedex *v8 = SaveData_Pokedex(param0->unk_830); v4->unk_1D4.unk_00 = 0; diff --git a/src/overlay062/ov62_02241204.c b/src/overlay062/ov62_02241204.c index 83db14ef1c..a42f1d39ea 100644 --- a/src/overlay062/ov62_02241204.c +++ b/src/overlay062/ov62_02241204.c @@ -1516,7 +1516,7 @@ static BOOL ov62_02242748 (UnkStruct_0208C06C * param0, int param1) int v7; int v8 = 0; BOOL v9; - PokedexData * v10 = SaveData_Pokedex(param0->unk_830); + Pokedex * v10 = SaveData_Pokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { v9 = Pokedex_HasSeenSpecies(v10, v1[v7]); @@ -1560,7 +1560,7 @@ static void ov62_022427D0 (UnkStruct_0208C06C * param0, int param1) int v5; int v6 = 0; BOOL v7; - PokedexData * v8 = SaveData_Pokedex(param0->unk_830); + Pokedex * v8 = SaveData_Pokedex(param0->unk_830); v4->unk_4C8.unk_00 = 0; diff --git a/src/overlay062/ov62_02248408.c b/src/overlay062/ov62_02248408.c index 000c2dadd0..e93bdaf3a5 100644 --- a/src/overlay062/ov62_02248408.c +++ b/src/overlay062/ov62_02248408.c @@ -43,23 +43,23 @@ void ov62_02248408(BattleRecording *param0, FieldBattleDTO *param1, int param2) for (v4 = 0; v4 < v2; v4++) { for (v10 = 8 - 1; v10 > -1; v10--) { - if (param1->trainerData[v4].name[v10] == 0xffff) { + if (param1->trainer[v4].name[v10] == 0xffff) { break; } } if (v10 == -1) { ov62_0224856C(v7, param2); - Strbuf_ToChars(v7, param1->trainerData[v4].name, 8); + Strbuf_ToChars(v7, param1->trainer[v4].name, 8); continue; } Strbuf_Clear(v6); - Strbuf_CopyChars(v6, param1->trainerData[v4].name); + Strbuf_CopyChars(v6, param1->trainer[v4].name); if (Font_AreAllCharsValid(FONT_SYSTEM, v6, v7) == 0) { ov62_0224856C(v7, param2); - Strbuf_ToChars(v7, param1->trainerData[v4].name, 8); + Strbuf_ToChars(v7, param1->trainer[v4].name, 8); continue; } } diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index 76ee88bec3..b73ab0459c 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -1793,7 +1793,7 @@ static int ov65_0222F490 (UnkStruct_ov65_0222EBE0 * param0, int param1) static void ov65_0222F4C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) { TrainerInfo * v0 = SaveData_GetTrainerInfo(param0->unk_160); - PokedexData * v1 = SaveData_Pokedex(param0->unk_160); + Pokedex * v1 = SaveData_Pokedex(param0->unk_160); Party * v2 = Party_GetFromSavedata(param0->unk_160); UnkStruct_0202C878 * v3 = sub_0202C878(param0->unk_160); int v4, v5; diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index 72e8904c3b..95667184ac 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -2310,7 +2310,7 @@ static void ov66_0222F7C8(UnkStruct_ov66_0222F6C4 *param0, SaveData *param1, u32 TrainerInfo *v0; Party *v1; UnkStruct_0202C878 *v2; - PokedexData *v3; + Pokedex *v3; GameTime *v4; { diff --git a/src/overlay081/ov81_021D1610.c b/src/overlay081/ov81_021D1610.c index 3d61a8616b..17ae4c571f 100644 --- a/src/overlay081/ov81_021D1610.c +++ b/src/overlay081/ov81_021D1610.c @@ -339,7 +339,7 @@ static void ov81_021D1AD4(UnkStruct_ov81_021D1610 *param0, Window *param1) v2 = Strbuf_Length(v3); Strbuf_Free(v3); - if (TrainerData_LoadParam(v0.unk_00_1, 1) == 63) { + if (Trainer_LoadParam(v0.unk_00_1, 1) == 63) { v3 = MessageLoader_GetNewStrbuf(param0->unk_50, 61); StringTemplate_SetRivalName(param0->unk_54, 1, param0->unk_4C); StringTemplate_Format(param0->unk_54, param0->unk_58, v3); diff --git a/src/overlay094/ov94_022414B8.c b/src/overlay094/ov94_022414B8.c index 512803b570..f5072891e2 100644 --- a/src/overlay094/ov94_022414B8.c +++ b/src/overlay094/ov94_022414B8.c @@ -78,7 +78,7 @@ static int ov94_02242040(UnkStruct_ov94_0223FD4C *param0); static int ov94_02242068(UnkStruct_ov94_0223FD4C *param0); static int ov94_0224208C(UnkStruct_ov94_0223FD4C *param0); static void ov94_02242668(UnkStruct_ov94_0223BA88 *param0, UnkStruct_ov94_0223FD4C *param1); -static int ov94_02242718(StringList **param0, MessageLoader *param1, MessageLoader *param2, u16 *param3, u8 *param4, int param5, int param6, PokedexData *param7); +static int ov94_02242718(StringList **param0, MessageLoader *param1, MessageLoader *param2, u16 *param3, u8 *param4, int param5, int param6, Pokedex *param7); static TextColor ov94_022421E8(int param0, u32 param1); static int (*Unk_ov94_0224695C[])(UnkStruct_ov94_0223FD4C *) = { @@ -1124,7 +1124,7 @@ static u16 Unk_ov94_02246928[] = { 0x1ED }; -static int ov94_02242718(StringList **param0, MessageLoader *param1, MessageLoader *param2, u16 *param3, u8 *param4, int param5, int param6, PokedexData *param7) +static int ov94_02242718(StringList **param0, MessageLoader *param1, MessageLoader *param2, u16 *param3, u8 *param4, int param5, int param6, Pokedex *param7) { int v0, v1, v2 = 0; int v3 = Unk_ov94_02246928[param6 + 1] - Unk_ov94_02246928[param6]; @@ -1167,7 +1167,7 @@ static int ov94_02242718(StringList **param0, MessageLoader *param1, MessageLoad return v2 + 1; } -ListMenu *ov94_022427C0(UnkStruct_ov94_0223FD4C *param0, StringList **param1, Window *param2, MessageLoader *param3, MessageLoader *param4, UnkStruct_ov94_0223FD4C_sub3 *param5, PokedexData *param6) +ListMenu *ov94_022427C0(UnkStruct_ov94_0223FD4C *param0, StringList **param1, Window *param2, MessageLoader *param3, MessageLoader *param4, UnkStruct_ov94_0223FD4C_sub3 *param5, Pokedex *param6) { ListMenuTemplate v0; int v1, v2, v3; diff --git a/src/overlay097/ov97_0222AE60.c b/src/overlay097/ov97_0222AE60.c index a11125d4e0..adee8d2469 100644 --- a/src/overlay097/ov97_0222AE60.c +++ b/src/overlay097/ov97_0222AE60.c @@ -82,7 +82,7 @@ typedef struct { typedef struct { BgConfig *unk_00; SaveData *unk_04; - PokedexData *unk_08; + Pokedex *unk_08; TrainerInfo *unk_0C; PlayTime *playTime; MysteryGift *unk_14; diff --git a/src/overlay097/ov97_0222C174.c b/src/overlay097/ov97_0222C174.c index 2e7f12dd03..8a84c22448 100644 --- a/src/overlay097/ov97_0222C174.c +++ b/src/overlay097/ov97_0222C174.c @@ -349,7 +349,7 @@ typedef struct { int unk_00; BgConfig *unk_04; SaveData *unk_08; - PokedexData *unk_0C; + Pokedex *unk_0C; TrainerInfo *unk_10; Options *unk_14; Window unk_18; diff --git a/src/overlay104/ov104_0222DCE0.c b/src/overlay104/ov104_0222DCE0.c index 6859013e27..db43e60f73 100644 --- a/src/overlay104/ov104_0222DCE0.c +++ b/src/overlay104/ov104_0222DCE0.c @@ -444,15 +444,15 @@ void ov104_0222E284(FieldBattleDTO *param0, UnkStruct_ov104_0223A348_sub1 *param Pokemon *v1; param0->trainerIDs[param3] = param1->unk_00; - param0->trainerData[param3].class = param1->unk_04; + param0->trainer[param3].class = param1->unk_04; - CharCode_Copy(¶m0->trainerData[param3].name[0], ¶m1->unk_08[0]); + CharCode_Copy(¶m0->trainer[param3].name[0], ¶m1->unk_08[0]); v0 = (Sentence *)¶m1->unk_20[0]; - param0->trainerData[param3].winMsg = *v0; + param0->trainer[param3].winMsg = *v0; v0 = (Sentence *)¶m1->unk_28[0]; - param0->trainerData[param3].loseMsg = *v0; + param0->trainer[param3].loseMsg = *v0; return; } diff --git a/src/overlay104/ov104_0223A0C4.c b/src/overlay104/ov104_0223A0C4.c index f741ba11b6..ff9461adb0 100644 --- a/src/overlay104/ov104_0223A0C4.c +++ b/src/overlay104/ov104_0223A0C4.c @@ -945,7 +945,7 @@ FieldBattleDTO *ov104_0223A580(UnkStruct_0204AFC4 *param0, UnkStruct_ov104_02230 ov104_0223A6AC(v3, &(param0->unk_78[0]), param0->unk_0E, 1, param0->unk_04); for (v0 = 0; v0 < 4; v0++) { - v3->trainerData[v0].aiMask = (0x1 | 0x2 | 0x4); + v3->trainer[v0].aiMask = (0x1 | 0x2 | 0x4); } switch (param0->unk_0F) { diff --git a/src/overlay104/ov104_0223A7F4.c b/src/overlay104/ov104_0223A7F4.c index ac64826735..974e054ef7 100644 --- a/src/overlay104/ov104_0223A7F4.c +++ b/src/overlay104/ov104_0223A7F4.c @@ -383,7 +383,7 @@ FieldBattleDTO *ov104_0223ABA0(UnkStruct_ov104_0223ADA0 *param0, UnkStruct_ov104 Party_InitWithCapacity(v4->parties[1], ov104_0223AA74(param0->unk_04, 0)); for (v0 = 0; v0 < 4; v0++) { - v4->trainerData[v0].aiMask = ov104_0223AEE4(param0); + v4->trainer[v0].aiMask = ov104_0223AEE4(param0); } v5 = Pokemon_New(11); diff --git a/src/overlay104/ov104_0223AF58.c b/src/overlay104/ov104_0223AF58.c index 345762b293..d1ac9a07f3 100644 --- a/src/overlay104/ov104_0223AF58.c +++ b/src/overlay104/ov104_0223AF58.c @@ -1622,7 +1622,7 @@ FieldBattleDTO *ov104_0223B250(UnkStruct_ov104_0223B5C0 *param0, UnkStruct_ov104 v2 = ov104_0223B604(param0, v6, v7); for (v1 = 0; v1 < 4; v1++) { - v8->trainerData[v1].aiMask = v2; + v8->trainer[v1].aiMask = v2; } ov104_0223B518(¶m0->unk_290[v6], v7, param0->unk_18[v6], ¶m0->unk_268[v6], v5, 11, 180); diff --git a/src/overlay104/ov104_0223B6F4.c b/src/overlay104/ov104_0223B6F4.c index a4f05770f7..ab60517ac8 100644 --- a/src/overlay104/ov104_0223B6F4.c +++ b/src/overlay104/ov104_0223B6F4.c @@ -206,7 +206,7 @@ FieldBattleDTO *ov104_0223B810(UnkStruct_ov104_0223BA10 *param0, UnkStruct_ov104 Party_InitWithCapacity(v5->parties[1], ov104_0223B7DC(param0->unk_10, 0)); for (v0 = 0; v0 < 4; v0++) { - v5->trainerData[v0].aiMask = ov104_0223BB10(param0); + v5->trainer[v0].aiMask = ov104_0223BB10(param0); } v6 = Pokemon_New(11); diff --git a/src/overlay104/ov104_0223BCBC.c b/src/overlay104/ov104_0223BCBC.c index eceec063cc..50dcca5677 100644 --- a/src/overlay104/ov104_0223BCBC.c +++ b/src/overlay104/ov104_0223BCBC.c @@ -217,7 +217,7 @@ FieldBattleDTO *ov104_0223BDD8(UnkStruct_ov104_0223BFFC *param0, UnkStruct_ov104 Party_InitWithCapacity(v5->parties[1], ov104_0223BDA4(param0->unk_10, 0)); for (v0 = 0; v0 < 4; v0++) { - v5->trainerData[v0].aiMask = ov104_0223C0D0(param0); + v5->trainer[v0].aiMask = ov104_0223C0D0(param0); } v6 = Pokemon_New(11); diff --git a/src/rtc.c b/src/rtc.c index 4951d2b717..b0125a9806 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -123,8 +123,8 @@ int DayNumberForDate(const RTCDate *date) BOOL IsNight(void) { switch (GetTimeOfDay()) { - case TOD_LATE_NIGHT: - case TOD_NIGHT: + case TIMEOFDAY_LATE_NIGHT: + case TIMEOFDAY_NIGHT: return 1; } @@ -142,30 +142,30 @@ enum TimeOfDay GetTimeOfDay(void) enum TimeOfDay TimeOfDayForHour(int hour) { static const u8 lookup[24] = { - TOD_LATE_NIGHT, - TOD_LATE_NIGHT, - TOD_LATE_NIGHT, - TOD_LATE_NIGHT, - TOD_MORNING, - TOD_MORNING, - TOD_MORNING, - TOD_MORNING, - TOD_MORNING, - TOD_MORNING, - TOD_DAY, - TOD_DAY, - TOD_DAY, - TOD_DAY, - TOD_DAY, - TOD_DAY, - TOD_DAY, - TOD_TWILIGHT, - TOD_TWILIGHT, - TOD_TWILIGHT, - TOD_NIGHT, - TOD_NIGHT, - TOD_NIGHT, - TOD_NIGHT, + TIMEOFDAY_LATE_NIGHT, + TIMEOFDAY_LATE_NIGHT, + TIMEOFDAY_LATE_NIGHT, + TIMEOFDAY_LATE_NIGHT, + TIMEOFDAY_MORNING, + TIMEOFDAY_MORNING, + TIMEOFDAY_MORNING, + TIMEOFDAY_MORNING, + TIMEOFDAY_MORNING, + TIMEOFDAY_MORNING, + TIMEOFDAY_DAY, + TIMEOFDAY_DAY, + TIMEOFDAY_DAY, + TIMEOFDAY_DAY, + TIMEOFDAY_DAY, + TIMEOFDAY_DAY, + TIMEOFDAY_DAY, + TIMEOFDAY_TWILIGHT, + TIMEOFDAY_TWILIGHT, + TIMEOFDAY_TWILIGHT, + TIMEOFDAY_NIGHT, + TIMEOFDAY_NIGHT, + TIMEOFDAY_NIGHT, + TIMEOFDAY_NIGHT, }; GF_ASSERT(0 <= hour && hour < 24); diff --git a/src/scrcmd.c b/src/scrcmd.c index 56f89d9a5c..e26d98cc66 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -4829,7 +4829,7 @@ static BOOL ScrCmd_0E6(ScriptContext *ctx) u16 v5 = ScriptContext_GetVar(ctx); u16 v6 = ScriptContext_GetVar(ctx); - TrainerData_LoadMessage(v5, v6, *v2, 11); + Trainer_LoadMessage(v5, v6, *v2, 11); Window_FillTilemap(FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_WINDOW), SCRIPT_MANAGER_STR_TEMPLATE); *v4 = FieldMessage_Print(FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_WINDOW), *v2, SaveData_Options(ctx->fieldSystem->saveData), SCRIPT_MANAGER_WINDOW); @@ -4974,7 +4974,7 @@ static BOOL ScrCmd_11D(ScriptContext *ctx) static BOOL ScrCmd_11E(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = Pokedex_CountSeenSinnoh(v0); @@ -4983,7 +4983,7 @@ static BOOL ScrCmd_11E(ScriptContext *ctx) static BOOL ScrCmd_11F(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = sub_02026E64(v0); @@ -4992,7 +4992,7 @@ static BOOL ScrCmd_11F(ScriptContext *ctx) static BOOL ScrCmd_120(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = Pokedex_CountSeenNational(v0); @@ -5001,7 +5001,7 @@ static BOOL ScrCmd_120(ScriptContext *ctx) static BOOL ScrCmd_121(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = sub_02026DD0(v0); @@ -5017,7 +5017,7 @@ static BOOL ScrCmd_122(ScriptContext *ctx) static BOOL ScrCmd_123(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); const TrainerInfo *v1 = SaveData_GetTrainerInfo(ctx->fieldSystem->saveData); u8 v2 = ScriptContext_ReadByte(ctx); u16 *v3 = ScriptContext_GetVarPointer(ctx); @@ -6237,7 +6237,7 @@ static BOOL ScrCmd_1D6(ScriptContext *ctx) static BOOL ScrCmd_1E8(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = 0; @@ -6251,7 +6251,7 @@ static BOOL ScrCmd_1E8(ScriptContext *ctx) static BOOL ScrCmd_1E9(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = 0; @@ -6467,7 +6467,7 @@ static BOOL ScrCmd_214(ScriptContext *ctx) static BOOL ScrCmd_218(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); u16 v2, v3, v4, v5; @@ -6769,7 +6769,7 @@ static BOOL ScrCmd_24D(ScriptContext *ctx) static void sub_020451B4(FieldSystem *fieldSystem, u16 param1) { - PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); Pokemon *v1 = Pokemon_New(32); Pokemon_Init(v1); @@ -6888,7 +6888,7 @@ static BOOL ScrCmd_263(ScriptContext *ctx) int v3; int v4 = Party_GetCurrentCount(v1); Pokemon *v5; - PokedexData *v6 = SaveData_Pokedex(ctx->fieldSystem->saveData); + Pokedex *v6 = SaveData_Pokedex(ctx->fieldSystem->saveData); for (v2 = 0; v2 < v4; v2++) { v5 = Party_GetPokemonBySlotIndex(v1, v2); @@ -7241,7 +7241,7 @@ static BOOL ScrCmd_282(ScriptContext *ctx) static BOOL ScrCmd_284(ScriptContext *ctx) { - const PokedexData *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = sub_020270DC(v0); diff --git a/src/scrcmd_system_flags.c b/src/scrcmd_system_flags.c index fe27bbfe28..e10db73b9c 100644 --- a/src/scrcmd_system_flags.c +++ b/src/scrcmd_system_flags.c @@ -18,7 +18,7 @@ BOOL ScrCmd_CheckPokedexAcquired(ScriptContext *ctx) { - const PokedexData *pokedex = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *pokedex = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *destVar = ScriptContext_GetVarPointer(ctx); *destVar = Pokedex_IsObtained(pokedex); return FALSE; @@ -26,7 +26,7 @@ BOOL ScrCmd_CheckPokedexAcquired(ScriptContext *ctx) BOOL ScrCmd_GivePokedex(ScriptContext *ctx) { - PokedexData *pokedex = SaveData_Pokedex(ctx->fieldSystem->saveData); + Pokedex *pokedex = SaveData_Pokedex(ctx->fieldSystem->saveData); Pokedex_FlagObtained(pokedex); return FALSE; } diff --git a/src/script_manager.c b/src/script_manager.c index e114a546f9..bc077399d8 100644 --- a/src/script_manager.c +++ b/src/script_manager.c @@ -552,7 +552,7 @@ int Script_GetTrainerBattlerIndex(u16 scriptID) BOOL Script_IsTrainerDoubleBattle(u16 trainerID) { - return TrainerData_LoadParam(trainerID, TRDATA_BATTLE_TYPE) != BATTLE_TYPE_SINGLES; + return Trainer_LoadParam(trainerID, TRDATA_BATTLE_TYPE) != BATTLE_TYPE_SINGLES; } BOOL Script_IsTrainerDefeated(FieldSystem *fieldSystem, u16 trainerID) diff --git a/src/string_template.c b/src/string_template.c index 6904080935..48bc2d9eae 100644 --- a/src/string_template.c +++ b/src/string_template.c @@ -318,12 +318,12 @@ void StringTemplate_SetTrainerClassNameWithArticle(StringTemplate *template, u32 SetArgFromArchive(template, idx, trainerClass, message_bank_trainer_class_names_with_articles); } -void StringTemplate_SetTrainerClassNameBattle(StringTemplate *template, u32 idx, TrainerData *trainerData) +void StringTemplate_SetTrainerClassNameBattle(StringTemplate *template, u32 idx, Trainer *trainer) { MessageLoader *loader = InitMessageLoader(message_bank_trainer_class_names, template->heapID); if (loader) { - MessageLoader_GetStrbuf(loader, trainerData->class, template->templateBuf); + MessageLoader_GetStrbuf(loader, trainer->class, template->templateBuf); SetStringTemplateArg(template, idx, template->templateBuf, NULL); MessageLoader_Free(loader); } @@ -339,9 +339,9 @@ void StringTemplate_SetFrontierTrainerName(StringTemplate *template, u32 idx, u3 SetArgFromArchive(template, idx, trainerID, message_bank_frontier_trainer_names); } -void StringTemplate_SetTrainerNameBattle(StringTemplate *template, u32 idx, TrainerData *trainerData) +void StringTemplate_SetTrainerNameBattle(StringTemplate *template, u32 idx, Trainer *trainer) { - Strbuf_CopyChars(template->templateBuf, trainerData->name); + Strbuf_CopyChars(template->templateBuf, trainer->name); SetStringTemplateArg(template, idx, template->templateBuf, NULL); } diff --git a/src/trainer_data.c b/src/trainer_data.c index e9f784703d..1f3f8bda3b 100644 --- a/src/trainer_data.c +++ b/src/trainer_data.c @@ -24,9 +24,9 @@ static void TrainerData_BuildParty(FieldBattleDTO *dto, int battler, int heapID); -void TrainerData_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID) +void Trainer_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID) { - TrainerData trdata; + Trainer trdata; MessageLoader *msgLoader = MessageLoader_Init(MESSAGE_LOADER_NARC_HANDLE, NARC_INDEX_MSGDATA__PL_MSG, 618, heapID); const charcode_t *rivalName = MiscSaveBlock_RivalName(SaveData_MiscSaveBlockConst(save)); @@ -35,14 +35,14 @@ void TrainerData_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID continue; } - TrainerData_Load(dto->trainerIDs[i], &trdata); - dto->trainerData[i] = trdata; + Trainer_Load(dto->trainerIDs[i], &trdata); + dto->trainer[i] = trdata; if (trdata.class == TRAINER_CLASS_RIVAL) { - CharCode_Copy(dto->trainerData[i].name, rivalName); + CharCode_Copy(dto->trainer[i].name, rivalName); } else { Strbuf *trainerName = MessageLoader_GetNewStrbuf(msgLoader, dto->trainerIDs[i]); - Strbuf_ToChars(trainerName, dto->trainerData[i].name, TRAINER_NAME_LEN + 1); + Strbuf_ToChars(trainerName, dto->trainer[i].name, TRAINER_NAME_LEN + 1); Strbuf_Free(trainerName); } @@ -53,12 +53,12 @@ void TrainerData_Encounter(FieldBattleDTO *dto, const SaveData *save, int heapID MessageLoader_Free(msgLoader); } -u32 TrainerData_LoadParam(int trainerID, enum TrainerDataParam paramID) +u32 Trainer_LoadParam(int trainerID, enum TrainerDataParam paramID) { u32 result; - TrainerData trdata; + Trainer trdata; - TrainerData_Load(trainerID, &trdata); + Trainer_Load(trainerID, &trdata); switch (paramID) { case TRDATA_TYPE: @@ -96,7 +96,7 @@ u32 TrainerData_LoadParam(int trainerID, enum TrainerDataParam paramID) return result; } -BOOL TrainerData_HasMessageType(int trainerID, enum TrainerMessageType msgType, int heapID) +BOOL Trainer_HasMessageType(int trainerID, enum TrainerMessageType msgType, int heapID) { NARC *narc; // must declare up here to match u16 offset, data[2]; @@ -125,7 +125,7 @@ BOOL TrainerData_HasMessageType(int trainerID, enum TrainerMessageType msgType, return result; } -void TrainerData_LoadMessage(int trainerID, enum TrainerMessageType msgType, Strbuf *strbuf, int heapID) +void Trainer_LoadMessage(int trainerID, enum TrainerMessageType msgType, Strbuf *strbuf, int heapID) { NARC *narc; // must declare up here to match u16 offset, data[2]; @@ -152,12 +152,12 @@ void TrainerData_LoadMessage(int trainerID, enum TrainerMessageType msgType, Str } } -void TrainerData_Load(int trainerID, TrainerData *trdata) +void Trainer_Load(int trainerID, Trainer *trdata) { NARC_ReadWholeMemberByIndexPair(trdata, NARC_INDEX_POKETOOL__TRAINER__TRDATA, trainerID); } -void TrainerData_LoadParty(int trainerID, void *trparty) +void Trainer_LoadParty(int trainerID, void *trparty) { NARC_ReadWholeMemberByIndexPair(trparty, NARC_INDEX_POKETOOL__TRAINER__TRPOKE, trainerID); } @@ -190,24 +190,24 @@ static void TrainerData_BuildParty(FieldBattleDTO *dto, int battler, int heapID) buf = Heap_AllocFromHeap(heapID, sizeof(TrainerMonWithMovesAndItem) * MAX_PARTY_SIZE); mon = Pokemon_New(heapID); - TrainerData_LoadParty(dto->trainerIDs[battler], buf); + Trainer_LoadParty(dto->trainerIDs[battler], buf); // determine which magic gender-specific modifier to use for the RNG function - genderMod = TrainerClass_Gender(dto->trainerData[battler].class) == GENDER_FEMALE + genderMod = TrainerClass_Gender(dto->trainer[battler].class) == GENDER_FEMALE ? 120 : 136; - switch (dto->trainerData[battler].type) { + switch (dto->trainer[battler].type) { case TRDATATYPE_BASE: { TrainerMonBase *trmon = (TrainerMonBase *)buf; - for (i = 0; i < dto->trainerData[battler].partySize; i++) { + for (i = 0; i < dto->trainer[battler].partySize; i++) { u16 species = trmon[i].species & 0x3FF; u8 form = (trmon[i].species & 0xFC00) >> 10; rnd = trmon[i].dv + trmon[i].level + species + dto->trainerIDs[battler]; LCRNG_SetSeed(rnd); - for (j = 0; j < dto->trainerData[battler].class; j++) { + for (j = 0; j < dto->trainer[battler].class; j++) { rnd = LCRNG_Next(); } @@ -225,14 +225,14 @@ static void TrainerData_BuildParty(FieldBattleDTO *dto, int battler, int heapID) case TRDATATYPE_WITH_MOVES: { TrainerMonWithMoves *trmon = (TrainerMonWithMoves *)buf; - for (i = 0; i < dto->trainerData[battler].partySize; i++) { + for (i = 0; i < dto->trainer[battler].partySize; i++) { u16 species = trmon[i].species & 0x3FF; u8 form = (trmon[i].species & 0xFC00) >> 10; rnd = trmon[i].dv + trmon[i].level + species + dto->trainerIDs[battler]; LCRNG_SetSeed(rnd); - for (j = 0; j < dto->trainerData[battler].class; j++) { + for (j = 0; j < dto->trainer[battler].class; j++) { rnd = LCRNG_Next(); } @@ -255,14 +255,14 @@ static void TrainerData_BuildParty(FieldBattleDTO *dto, int battler, int heapID) case TRDATATYPE_WITH_ITEM: { TrainerMonWithItem *trmon = (TrainerMonWithItem *)buf; - for (i = 0; i < dto->trainerData[battler].partySize; i++) { + for (i = 0; i < dto->trainer[battler].partySize; i++) { u16 species = trmon[i].species & 0x3FF; u8 form = (trmon[i].species & 0xFC00) >> 10; rnd = trmon[i].dv + trmon[i].level + species + dto->trainerIDs[battler]; LCRNG_SetSeed(rnd); - for (j = 0; j < dto->trainerData[battler].class; j++) { + for (j = 0; j < dto->trainer[battler].class; j++) { rnd = LCRNG_Next(); } @@ -281,14 +281,14 @@ static void TrainerData_BuildParty(FieldBattleDTO *dto, int battler, int heapID) case TRDATATYPE_WITH_MOVES_AND_ITEM: { TrainerMonWithMovesAndItem *trmon = (TrainerMonWithMovesAndItem *)buf; - for (i = 0; i < dto->trainerData[battler].partySize; i++) { + for (i = 0; i < dto->trainer[battler].partySize; i++) { u16 species = trmon[i].species & 0x3FF; u8 form = (trmon[i].species & 0xFC00) >> 10; rnd = trmon[i].dv + trmon[i].level + species + dto->trainerIDs[battler]; LCRNG_SetSeed(rnd); - for (j = 0; j < dto->trainerData[battler].class; j++) { + for (j = 0; j < dto->trainer[battler].class; j++) { rnd = LCRNG_Next(); } diff --git a/src/unk_0202631C.c b/src/unk_0202631C.c index 699193005f..6b6480c2b0 100644 --- a/src/unk_0202631C.c +++ b/src/unk_0202631C.c @@ -18,7 +18,7 @@ #define UNOWN_COUNT 28 #define BYTE_SLOTS 16 -typedef struct PokedexData { +typedef struct Pokedex { u32 magic; u32 caughtPokemon[BYTE_SLOTS]; u32 seenPokemon[BYTE_SLOTS]; @@ -38,29 +38,29 @@ typedef struct PokedexData { u8 unk_320; u8 unk_321; u16 unk_322; -} PokedexData; +} Pokedex; int Pokedex_SaveSize(void) { - return sizeof(PokedexData); + return sizeof(Pokedex); } -PokedexData *sub_02026324(u32 param0) +Pokedex *Pokedex_New(u32 param0) { - PokedexData *v0; + Pokedex *v0; - v0 = Heap_AllocFromHeap(param0, sizeof(PokedexData)); + v0 = Heap_AllocFromHeap(param0, sizeof(Pokedex)); Pokedex_Init(v0); return v0; } -void Pokedex_Copy(const PokedexData *src, PokedexData *dest) +void Pokedex_Copy(const Pokedex *src, Pokedex *dest) { - MI_CpuCopy8(src, dest, sizeof(PokedexData)); + MI_CpuCopy8(src, dest, sizeof(Pokedex)); } -static inline void CheckPokedexIntegrity(const PokedexData *param0) +static inline void CheckPokedexIntegrity(const Pokedex *param0) { GF_ASSERT(param0->magic == 3203386110); } @@ -110,17 +110,17 @@ static inline void inline_020267B8(u8 *param0, u8 param1, u16 param2) param0[param2 >> 2] |= param1 << ((param2 & 3) * 2); } -static inline void Write_SeenSpecies(PokedexData *param0, u16 species) +static inline void Write_SeenSpecies(Pokedex *param0, u16 species) { WriteBit((u8 *)param0->seenPokemon, species); } -static inline void Write_CaughtSpecies(PokedexData *param0, u16 species) +static inline void Write_CaughtSpecies(Pokedex *param0, u16 species) { WriteBit((u8 *)param0->caughtPokemon, species); } -static void sub_02026360(PokedexData *param0, u8 param1, u8 param2, u16 param3) +static void sub_02026360(Pokedex *param0, u8 param1, u8 param2, u16 param3) { if (param2 == 0) { inline_02026360((u8 *)param0->recordedGenders[1], param1, param3); @@ -129,7 +129,7 @@ static void sub_02026360(PokedexData *param0, u8 param1, u8 param2, u16 param3) inline_02026360((u8 *)param0->recordedGenders[param2], param1, param3); } -static void sub_020263D8(PokedexData *param0, u8 param1, u8 param2, u16 param3) +static void sub_020263D8(Pokedex *param0, u8 param1, u8 param2, u16 param3) { GF_ASSERT(param1 <= 2); @@ -140,29 +140,29 @@ static void sub_020263D8(PokedexData *param0, u8 param1, u8 param2, u16 param3) sub_02026360(param0, param1, param2, param3); } -static inline BOOL CheckSeenMask(const PokedexData *pokedex, u16 species) +static inline BOOL CheckSeenMask(const Pokedex *pokedex, u16 species) { return ReadBit((const u8 *)pokedex->seenPokemon, species); } -static inline BOOL CheckCaughtMask(const PokedexData *pokedex, u16 species) +static inline BOOL CheckCaughtMask(const Pokedex *pokedex, u16 species) { return ReadBit((const u8 *)pokedex->caughtPokemon, species); } -static inline u8 inline_02026BAC(const PokedexData *param0, u16 param1, u8 param2) +static inline u8 inline_02026BAC(const Pokedex *param0, u16 param1, u8 param2) { return ReadBit((const u8 *)param0->recordedGenders[param2], param1); } -static inline void inline_0202736C_1(PokedexData *param0, u16 param1, u32 param2) +static inline void inline_0202736C_1(Pokedex *param0, u16 param1, u32 param2) { if (param1 == SPECIES_SPINDA) { param0->unk_104 = param2; } } -static int sub_02026400(const PokedexData *param0) +static int sub_02026400(const Pokedex *param0) { int v0; @@ -175,7 +175,7 @@ static int sub_02026400(const PokedexData *param0) return v0; } -static BOOL sub_02026418(const PokedexData *param0, u8 param1) +static BOOL sub_02026418(const Pokedex *param0, u8 param1) { int v0; @@ -188,7 +188,7 @@ static BOOL sub_02026418(const PokedexData *param0, u8 param1) return 0; } -static void sub_0202643C(PokedexData *param0, int param1) +static void sub_0202643C(Pokedex *param0, int param1) { int v0; @@ -203,7 +203,7 @@ static void sub_0202643C(PokedexData *param0, int param1) } } -static int sub_02026464(const PokedexData *param0, u32 param1) +static int sub_02026464(const Pokedex *param0, u32 param1) { u32 v0; u32 v1; @@ -240,7 +240,7 @@ static int sub_02026464(const PokedexData *param0, u32 param1) return 2; } -static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_02026514(const Pokedex *param0, u32 param1, u8 param2) { u32 v0; u32 v1; @@ -281,7 +281,7 @@ static BOOL sub_02026514(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_020265E8(PokedexData *param0, u32 param1, int param2) +static void sub_020265E8(Pokedex *param0, u32 param1, int param2) { int v0; u8 *v1; @@ -318,7 +318,7 @@ static void sub_020265E8(PokedexData *param0, u32 param1, int param2) } } -static int sub_020266F8(const PokedexData *param0, u32 param1) +static int sub_020266F8(const Pokedex *param0, u32 param1) { u32 v0; int v1; @@ -347,7 +347,7 @@ static int sub_020266F8(const PokedexData *param0, u32 param1) return v1; } -static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_02026754(const Pokedex *param0, u32 param1, u8 param2) { u32 v0; int v1; @@ -376,7 +376,7 @@ static BOOL sub_02026754(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_020267B8(PokedexData *param0, u32 param1, int param2) +static void sub_020267B8(Pokedex *param0, u32 param1, int param2) { int v0; u8 *v1; @@ -409,7 +409,7 @@ static void sub_02026834(u32 *param0, u8 param1, u8 param2) param0[16 - 1] |= (param1 << v0); } -static void sub_02026850(PokedexData *param0, u8 param1, u8 param2) +static void sub_02026850(Pokedex *param0, u8 param1, u8 param2) { GF_ASSERT(param2 < 4); GF_ASSERT(param1 <= 15); @@ -429,7 +429,7 @@ static inline u32 inline_0202688C(const u32 *param0, u8 param1) return v1; } -static u32 sub_0202688C(const PokedexData *param0, u8 param1) +static u32 sub_0202688C(const Pokedex *param0, u8 param1) { u32 v0; @@ -442,7 +442,7 @@ static u32 sub_0202688C(const PokedexData *param0, u8 param1) return v0; } -static u32 sub_020268B8(const PokedexData *param0) +static u32 sub_020268B8(const Pokedex *param0) { int v0; @@ -455,7 +455,7 @@ static u32 sub_020268B8(const PokedexData *param0) return v0; } -static BOOL sub_020268D8(const PokedexData *param0, u32 param1) +static BOOL sub_020268D8(const Pokedex *param0, u32 param1) { int v0; @@ -468,7 +468,7 @@ static BOOL sub_020268D8(const PokedexData *param0, u32 param1) return 0; } -static void sub_020268FC(PokedexData *param0, u16 param1, Pokemon *param2) +static void sub_020268FC(Pokedex *param0, u16 param1, Pokemon *param2) { u8 v0 = Pokemon_GetValue(param2, MON_DATA_FORM, NULL); u32 v1; @@ -481,7 +481,7 @@ static void sub_020268FC(PokedexData *param0, u16 param1, Pokemon *param2) } } -static void sub_0202693C(PokedexData *param0) +static void sub_0202693C(Pokedex *param0) { int v0; @@ -503,7 +503,7 @@ static inline void inline_02026A00(u32 *param0, u32 param1, u32 param2) (*param0) |= (param2 << (param1 * 3)); } -static int sub_02026958(const PokedexData *param0, u32 param1) +static int sub_02026958(const Pokedex *param0, u32 param1) { u32 v0; int v1, v2; @@ -529,7 +529,7 @@ static int sub_02026958(const PokedexData *param0, u32 param1) return v2; } -static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) +static BOOL sub_020269A4(const Pokedex *param0, u32 param1, u8 param2) { int v0; u32 v1; @@ -554,7 +554,7 @@ static BOOL sub_020269A4(const PokedexData *param0, u32 param1, u8 param2) return 0; } -static void sub_02026A00(PokedexData *param0, u32 param1, int param2) +static void sub_02026A00(Pokedex *param0, u32 param1, int param2) { int v0; @@ -571,7 +571,7 @@ static void sub_02026A00(PokedexData *param0, u32 param1, int param2) } } -static void sub_02026A60(PokedexData *param0, u16 param1, Pokemon *param2) +static void sub_02026A60(Pokedex *param0, u16 param1, Pokemon *param2) { int v0; @@ -616,7 +616,7 @@ static void sub_02026A60(PokedexData *param0, u16 param1, Pokemon *param2) } } -static void sub_02026B88(PokedexData *param0, u16 param1, u32 param2) +static void sub_02026B88(Pokedex *param0, u16 param1, u32 param2) { int v0; int v1; @@ -631,7 +631,7 @@ static void sub_02026B88(PokedexData *param0, u16 param1, u32 param2) param0->recordedLanguages[v0] |= 1 << v1; } -static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) +static u32 sub_02026BAC(const Pokedex *param0, u16 param1, int param2) { u32 v0, v1; u32 v2; @@ -661,12 +661,12 @@ static u32 sub_02026BAC(const PokedexData *param0, u16 param1, int param2) return v2; } -static inline int inline_020270AC(const PokedexData *param0, int param1) +static inline int inline_020270AC(const Pokedex *param0, int param1) { return param0->unk_10C[param1]; } -static int sub_02026C24(const PokedexData *param0, u32 param1, int param2) +static int sub_02026C24(const Pokedex *param0, u32 param1, int param2) { const u8 *v0; @@ -691,7 +691,7 @@ static int sub_02026C24(const PokedexData *param0, u32 param1, int param2) return ReadBit(v0, param2 + 1); } -static int sub_02026CCC(const PokedexData *param0, u32 param1, int param2) +static int sub_02026CCC(const Pokedex *param0, u32 param1, int param2) { GF_ASSERT(param1 == 479); GF_ASSERT(param2 < 6); @@ -699,7 +699,7 @@ static int sub_02026CCC(const PokedexData *param0, u32 param1, int param2) return inline_02026958(param0->unk_31C, param2); } -static int sub_02026CFC(const PokedexData *param0, u32 param1, int param2) +static int sub_02026CFC(const Pokedex *param0, u32 param1, int param2) { const u8 *v0; @@ -749,9 +749,9 @@ static BOOL sub_02026D68(u16 param0) return 1; } -void Pokedex_Init(PokedexData *param0) +void Pokedex_Init(Pokedex *param0) { - memset(param0, 0, sizeof(PokedexData)); + memset(param0, 0, sizeof(Pokedex)); param0->magic = 3203386110; param0->nationalDexObtained = FALSE; @@ -769,7 +769,7 @@ void Pokedex_Init(PokedexData *param0) sub_0202693C(param0); } -u16 sub_02026DD0(const PokedexData *param0) +u16 sub_02026DD0(const Pokedex *param0) { int v0; int v1; @@ -786,7 +786,7 @@ u16 sub_02026DD0(const PokedexData *param0) return v1; } -u16 Pokedex_CountSeenNational(const PokedexData *pokedex) +u16 Pokedex_CountSeenNational(const Pokedex *pokedex) { int i; CheckPokedexIntegrity(pokedex); @@ -802,7 +802,7 @@ u16 Pokedex_CountSeenNational(const PokedexData *pokedex) return seenCount; } -u16 Pokedex_CountSeen(const PokedexData *pokedex) +u16 Pokedex_CountSeen(const Pokedex *pokedex) { if (Pokedex_IsNationalDexObtained(pokedex)) { return Pokedex_CountSeenNational(pokedex); @@ -811,7 +811,7 @@ u16 Pokedex_CountSeen(const PokedexData *pokedex) return Pokedex_CountSeenSinnoh(pokedex); } -u16 sub_02026E64(const PokedexData *param0) +u16 sub_02026E64(const Pokedex *param0) { int v0; int v1; @@ -830,7 +830,7 @@ u16 sub_02026E64(const PokedexData *param0) return v1; } -u16 Pokedex_CountSeenSinnoh(const PokedexData *pokedex) +u16 Pokedex_CountSeenSinnoh(const Pokedex *pokedex) { int i; @@ -846,7 +846,7 @@ u16 Pokedex_CountSeenSinnoh(const PokedexData *pokedex) return seenCount; } -BOOL sub_02026EF4(const PokedexData *param0) +BOOL sub_02026EF4(const Pokedex *param0) { u16 v0; @@ -859,7 +859,7 @@ BOOL sub_02026EF4(const PokedexData *param0) return 0; } -BOOL sub_02026F0C(const PokedexData *param0) +BOOL sub_02026F0C(const Pokedex *param0) { u16 v0; @@ -872,7 +872,7 @@ BOOL sub_02026F0C(const PokedexData *param0) return 0; } -u16 sub_02026F20(const PokedexData *param0) +u16 sub_02026F20(const Pokedex *param0) { int v0; u16 v1; @@ -890,7 +890,7 @@ u16 sub_02026F20(const PokedexData *param0) return v1; } -u16 sub_02026F58(const PokedexData *param0) +u16 sub_02026F58(const Pokedex *param0) { int v0; u16 v1; @@ -913,7 +913,7 @@ u16 sub_02026F58(const PokedexData *param0) return v1; } -BOOL Pokedex_HasCaughtSpecies(const PokedexData *pokedex, u16 species) +BOOL Pokedex_HasCaughtSpecies(const Pokedex *pokedex, u16 species) { CheckPokedexIntegrity(pokedex); @@ -928,7 +928,7 @@ BOOL Pokedex_HasCaughtSpecies(const PokedexData *pokedex, u16 species) } } -BOOL Pokedex_HasSeenSpecies(const PokedexData *pokedex, u16 species) +BOOL Pokedex_HasSeenSpecies(const Pokedex *pokedex, u16 species) { CheckPokedexIntegrity(pokedex); @@ -939,7 +939,7 @@ BOOL Pokedex_HasSeenSpecies(const PokedexData *pokedex, u16 species) return CheckSeenMask(pokedex, species); } -u32 sub_0202702C(const PokedexData *param0, u8 param1) +u32 sub_0202702C(const Pokedex *param0, u8 param1) { u32 v0; @@ -957,7 +957,7 @@ u32 sub_0202702C(const PokedexData *param0, u8 param1) return v0; } -u32 sub_02027058(const PokedexData *param0, u16 species, int param2) +u32 sub_02027058(const Pokedex *param0, u16 species, int param2) { CheckPokedexIntegrity(param0); @@ -972,7 +972,7 @@ u32 sub_02027058(const PokedexData *param0, u16 species, int param2) return sub_02026BAC(param0, species, param2); } -u32 sub_020270AC(const PokedexData *param0, int param1) +u32 sub_020270AC(const Pokedex *param0, int param1) { CheckPokedexIntegrity(param0); @@ -983,13 +983,13 @@ u32 sub_020270AC(const PokedexData *param0, int param1) return inline_020270AC(param0, param1); } -u32 sub_020270DC(const PokedexData *param0) +u32 sub_020270DC(const Pokedex *param0) { CheckPokedexIntegrity(param0); return sub_02026400(param0); } -u32 sub_020270F8(const PokedexData *param0, int param1) +u32 sub_020270F8(const Pokedex *param0, int param1) { CheckPokedexIntegrity(param0); @@ -1000,13 +1000,13 @@ u32 sub_020270F8(const PokedexData *param0, int param1) return sub_02026C24(param0, 422, param1); } -u32 sub_02027130(const PokedexData *param0) +u32 sub_02027130(const Pokedex *param0) { CheckPokedexIntegrity(param0); return sub_02026464(param0, 422); } -u32 sub_02027154(const PokedexData *param0, int param1) +u32 sub_02027154(const Pokedex *param0, int param1) { CheckPokedexIntegrity(param0); @@ -1017,13 +1017,13 @@ u32 sub_02027154(const PokedexData *param0, int param1) return sub_02026C24(param0, 423, param1); } -u32 sub_0202718C(const PokedexData *param0) +u32 sub_0202718C(const Pokedex *param0) { CheckPokedexIntegrity(param0); return sub_02026464(param0, 423); } -u32 sub_020271B0(const PokedexData *param0, int param1) +u32 sub_020271B0(const Pokedex *param0, int param1) { CheckPokedexIntegrity(param0); @@ -1034,13 +1034,13 @@ u32 sub_020271B0(const PokedexData *param0, int param1) return sub_02026CFC(param0, 412, param1); } -u32 sub_020271E8(const PokedexData *param0) +u32 sub_020271E8(const Pokedex *param0) { CheckPokedexIntegrity(param0); return sub_020266F8(param0, 412); } -u32 sub_02027208(const PokedexData *param0, int param1) +u32 sub_02027208(const Pokedex *param0, int param1) { CheckPokedexIntegrity(param0); @@ -1051,25 +1051,25 @@ u32 sub_02027208(const PokedexData *param0, int param1) return sub_02026CFC(param0, 413, param1); } -u32 sub_02027240(const PokedexData *param0) +u32 sub_02027240(const Pokedex *param0) { CheckPokedexIntegrity(param0); return sub_020266F8(param0, 413); } -u32 sub_02027264(const PokedexData *param0, int param1) +u32 sub_02027264(const Pokedex *param0, int param1) { CheckPokedexIntegrity(param0); return sub_0202688C(param0, param1); } -u32 sub_02027288(const PokedexData *param0) +u32 sub_02027288(const Pokedex *param0) { CheckPokedexIntegrity(param0); return sub_020268B8(param0); } -void sub_020272A4(PokedexData *param0, Pokemon *pokemon) +void sub_020272A4(Pokedex *param0, Pokemon *pokemon) { u16 species = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); u32 v1 = Pokemon_GetValue(pokemon, MON_DATA_PERSONALITY, NULL); @@ -1097,7 +1097,7 @@ void sub_020272A4(PokedexData *param0, Pokemon *pokemon) Write_SeenSpecies(param0, species); } -void sub_0202736C(PokedexData *param0, Pokemon *param1) +void sub_0202736C(Pokedex *param0, Pokemon *param1) { u16 species = Pokemon_GetValue(param1, MON_DATA_SPECIES, NULL); u32 v1 = Pokemon_GetValue(param1, MON_DATA_LANGUAGE, NULL); @@ -1129,31 +1129,31 @@ void sub_0202736C(PokedexData *param0, Pokemon *param1) Write_SeenSpecies(param0, species); } -void sub_02027454(PokedexData *param0) +void sub_02027454(Pokedex *param0) { CheckPokedexIntegrity(param0); param0->nationalDexObtained = 1; } -BOOL Pokedex_IsNationalDexObtained(const PokedexData *pokedex) +BOOL Pokedex_IsNationalDexObtained(const Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); return pokedex->nationalDexObtained; } -BOOL Pokedex_CanDetectForms(const PokedexData *param0) +BOOL Pokedex_CanDetectForms(const Pokedex *param0) { CheckPokedexIntegrity(param0); return param0->canDetectForms; } -void Pokedex_TurnOnFormDetection(PokedexData *param0) +void Pokedex_TurnOnFormDetection(Pokedex *param0) { CheckPokedexIntegrity(param0); param0->canDetectForms = 1; } -BOOL sub_020274D0(const PokedexData *param0, u16 species, u32 param2) +BOOL sub_020274D0(const Pokedex *param0, u16 species, u32 param2) { int speciesInt; @@ -1167,35 +1167,35 @@ BOOL sub_020274D0(const PokedexData *param0, u16 species, u32 param2) return param0->recordedLanguages[speciesInt] & (1 << param2); } -void sub_02027508(PokedexData *param0) +void sub_02027508(Pokedex *param0) { param0->unk_319 = 1; } -BOOL sub_02027514(const PokedexData *param0) +BOOL sub_02027514(const Pokedex *param0) { return param0->unk_319; } -BOOL Pokedex_IsObtained(const PokedexData *pokedex) +BOOL Pokedex_IsObtained(const Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); return pokedex->pokedexObtained; } -void Pokedex_FlagObtained(PokedexData *pokedex) +void Pokedex_FlagObtained(Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); pokedex->pokedexObtained = TRUE; } -PokedexData *SaveData_Pokedex(SaveData *saveData) +Pokedex *SaveData_Pokedex(SaveData *saveData) { - PokedexData *pokedex = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_POKEDEX); + Pokedex *pokedex = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_POKEDEX); return pokedex; } -u32 sub_0202756C(const PokedexData *param0, int species, int param2) +u32 sub_0202756C(const Pokedex *param0, int species, int param2) { CheckPokedexIntegrity(param0); @@ -1252,7 +1252,7 @@ u32 sub_0202756C(const PokedexData *param0, int species, int param2) return 0; } -u32 sub_020276C8(const PokedexData *pokedex, int species) +u32 sub_020276C8(const Pokedex *pokedex, int species) { CheckPokedexIntegrity(pokedex); diff --git a/src/unk_0202CC64.c b/src/unk_0202CC64.c index 438698647e..9b0428ca68 100644 --- a/src/unk_0202CC64.c +++ b/src/unk_0202CC64.c @@ -19,7 +19,7 @@ void ChatotCry_Init(ChatotCry *param0) param0->exists = FALSE; } -ChatotCry *AllocateAndInitializeChatotCryData(int param0) +ChatotCry *ChatotCry_New(int param0) { ChatotCry *v0 = Heap_AllocFromHeap(param0, sizeof(ChatotCry)); diff --git a/src/unk_0202F180.c b/src/unk_0202F180.c index 2990a4e922..0911f612dd 100644 --- a/src/unk_0202F180.c +++ b/src/unk_0202F180.c @@ -14,7 +14,7 @@ void sub_0202F180(SaveData *param0, const Pokemon *param1) { if (Pokemon_GetValue((Pokemon *)param1, MON_DATA_IS_EGG, NULL) == 0) { - PokedexData *v0 = SaveData_Pokedex(param0); + Pokedex *v0 = SaveData_Pokedex(param0); GameRecords_IncrementTrainerScoreOnCatch(SaveData_GetGameRecordsPtr(param0), v0, Pokemon_GetValue((Pokemon *)param1, MON_DATA_SPECIES, NULL)); sub_0202736C(v0, (Pokemon *)param1); diff --git a/src/unk_0202F1D4.c b/src/unk_0202F1D4.c index 2083d72766..64f8be95e6 100644 --- a/src/unk_0202F1D4.c +++ b/src/unk_0202F1D4.c @@ -478,7 +478,7 @@ void sub_0202F8AC(FieldBattleDTO *param0) for (v0 = 0; v0 < 4; v0++) { v2->unk_08[v0] = param0->trainerIDs[v0]; - v2->unk_18[v0] = param0->trainerData[v0]; + v2->unk_18[v0] = param0->trainer[v0]; if (param0->systemVersion[v0] == 0) { v2->unk_114[v0] = 0x140; @@ -565,7 +565,7 @@ void sub_0202FAFC(FieldBattleDTO *param0, SaveData *param1) for (v0 = 0; v0 < 4; v0++) { param0->trainerIDs[v0] = v1->unk_00.unk_08[v0]; - param0->trainerData[v0] = v1->unk_00.unk_18[v0]; + param0->trainer[v0] = v1->unk_00.unk_18[v0]; param0->systemVersion[v0] = v1->unk_00.unk_114[v0]; param0->unk_178[v0] = v1->unk_00.unk_134[v0]; diff --git a/src/unk_020474B8.c b/src/unk_020474B8.c index 7c38d1702d..1a1f08c2fc 100644 --- a/src/unk_020474B8.c +++ b/src/unk_020474B8.c @@ -312,7 +312,7 @@ BOOL ScrCmd_0DD(ScriptContext *param0) { StringTemplate **v0 = FieldSystem_GetScriptMemberPtr(param0->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); u8 v1 = ScriptContext_ReadByte(param0); - u16 v2 = sub_0206B08C(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); + u16 v2 = VarsFlags_GetProfessorAssistantStarterSpecies(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); Strbuf *v3 = sub_02047998(v2, 4); StringTemplate_SetStrbuf(*v0, v1, v3, 0, 1, GAME_LANGUAGE); @@ -546,7 +546,7 @@ BOOL ScrCmd_342(ScriptContext *param0) { StringTemplate **v0 = FieldSystem_GetScriptMemberPtr(param0->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); u8 v1 = ScriptContext_ReadByte(param0); - u16 v2 = sub_0206B08C(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); + u16 v2 = VarsFlags_GetProfessorAssistantStarterSpecies(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); StringTemplate_SetSpeciesNameWithArticleByID(*v0, v1, v2); return 0; diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index a92dd87db8..5d14513ca3 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -106,7 +106,7 @@ StringTemplate *sub_0204AEE8(SaveData *param0, u16 param1, u16 param2, u8 param3 u8 v0; u16 v1; Strbuf *v2, *v3; - PokedexData *v4; + Pokedex *v4; StringTemplate *v5; MessageLoader *v6; diff --git a/src/unk_0204C500.c b/src/unk_0204C500.c index 751c348b9b..8c88dafee5 100644 --- a/src/unk_0204C500.c +++ b/src/unk_0204C500.c @@ -64,7 +64,7 @@ BOOL ScrCmd_255(ScriptContext *param0) PCBoxes *v1 = SaveData_PCBoxes(param0->fieldSystem->saveData); Pokemon *v2 = Pokemon_New(32); TrainerInfo *v3 = SaveData_GetTrainerInfo(param0->fieldSystem->saveData); - PokedexData *v4 = SaveData_Pokedex(param0->fieldSystem->saveData); + Pokedex *v4 = SaveData_Pokedex(param0->fieldSystem->saveData); BOOL v5; int v6; diff --git a/src/unk_020553DC.c b/src/unk_020553DC.c index 4f76e5c83d..0fb83bef6a 100644 --- a/src/unk_020553DC.c +++ b/src/unk_020553DC.c @@ -283,7 +283,7 @@ static void sub_020555CC(FieldSystem *fieldSystem, int param1, int *param2, int u16 sub_0205560C(int param0) { - u8 v0 = (u8)TrainerData_LoadParam(param0, 1); + u8 v0 = (u8)Trainer_LoadParam(param0, 1); u16 i, v1 = 1101; for (i = 0; i < 79; i++) { diff --git a/src/unk_0206AFE0.c b/src/unk_0206AFE0.c index 2b86eb7b78..940ff4fbfa 100644 --- a/src/unk_0206AFE0.c +++ b/src/unk_0206AFE0.c @@ -21,7 +21,7 @@ static u16 sub_0206B010(VarsFlags *param0, u16 param1); BOOL sub_0206B044(VarsFlags *param0, u16 param1); u16 sub_0206B054(VarsFlags *param0); u16 sub_0206B064(VarsFlags *param0); -u16 sub_0206B08C(VarsFlags *param0); +u16 VarsFlags_GetProfessorAssistantStarterSpecies(VarsFlags *param0); void sub_0206B558(VarsFlags *param0, u16 param1); void sub_0206B514(SaveData *param0); static u8 sub_0206B4A4(VarsFlags *param0); @@ -90,7 +90,7 @@ u16 sub_0206B064(VarsFlags *param0) return v0; } -u16 sub_0206B08C(VarsFlags *param0) +u16 VarsFlags_GetProfessorAssistantStarterSpecies(VarsFlags *param0) { u16 v0; u16 v1 = sub_0206B010(param0, (0 + (((0 + VARS_START) + 32) + 16))); diff --git a/src/unk_0206CCB0.c b/src/unk_0206CCB0.c index 05b75c4d37..456915a18e 100644 --- a/src/unk_0206CCB0.c +++ b/src/unk_0206CCB0.c @@ -770,7 +770,7 @@ static int sub_0206D2E0(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D320(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D140 *v1 = ov6_02246498(param1); return Pokedex_HasSeenSpecies(v0, v1->unk_06); @@ -961,7 +961,7 @@ static int sub_0206D644(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D6A8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D644 *v1 = (UnkStruct_0206D644 *)ov6_02246498(param1); return Pokedex_HasSeenSpecies(v0, v1->unk_00); @@ -1022,7 +1022,7 @@ static int sub_0206D75C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D7A4(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - PokedexData *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); UnkStruct_0206D75C *v1 = (UnkStruct_0206D75C *)ov6_02246498(param1); return Pokedex_HasSeenSpecies(v0, v1->unk_00); @@ -2754,7 +2754,7 @@ static int sub_0206F01C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr { Strbuf *v0; u16 v1, v2, v3; - const PokedexData *v4 = SaveData_Pokedex(fieldSystem->saveData); + const Pokedex *v4 = SaveData_Pokedex(fieldSystem->saveData); v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 1)) + 1; @@ -2803,7 +2803,7 @@ static Strbuf *sub_0206F0D8(u16 param0, u32 param1) static BOOL sub_0206F100(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - const PokedexData *pokedex = SaveData_Pokedex(fieldSystem->saveData); + const Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); if (Pokedex_IsObtained(pokedex) == TRUE) { return TRUE; @@ -2849,7 +2849,7 @@ static int sub_0206F160(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr Pokemon *v3; Party *v4; TrainerInfo *v5 = SaveData_GetTrainerInfo(fieldSystem->saveData); - PokedexData *v6 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *v6 = SaveData_Pokedex(fieldSystem->saveData); v4 = Party_GetFromSavedata(fieldSystem->saveData); v3 = Party_GetPokemonBySlotIndex(v4, sub_0205E1B4(fieldSystem->saveData)); @@ -2881,7 +2881,7 @@ static int sub_0206F160(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206F260(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - const PokedexData *pokedex = SaveData_Pokedex(fieldSystem->saveData); + const Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); if (Pokedex_IsObtained(pokedex) == TRUE) { return TRUE; diff --git a/src/unk_0207A274.c b/src/unk_0207A274.c index 1e5fd45de0..c634b13646 100644 --- a/src/unk_0207A274.c +++ b/src/unk_0207A274.c @@ -11,13 +11,13 @@ u32 sub_0207A274(SaveData *param0) { - PokedexData *v0; + Pokedex *v0; v0 = SaveData_Pokedex(param0); return sub_0207A280(v0); } -u32 sub_0207A280(const PokedexData *param0) +u32 sub_0207A280(const Pokedex *param0) { BOOL v0; diff --git a/src/unk_0207A6DC.c b/src/unk_0207A6DC.c index b6442d07ca..0b09c5d5b1 100644 --- a/src/unk_0207A6DC.c +++ b/src/unk_0207A6DC.c @@ -151,7 +151,7 @@ static int sub_0207A76C(void) static int sub_0207A774(void) { - return sizeof(TrainerData); + return sizeof(Trainer); } static u8 *sub_0207A778(int param0, void *param1, int param2) @@ -170,9 +170,9 @@ static u8 *sub_0207A798(int param0, void *param1, int param2) UnkStruct_0207A778 *v0 = param1; if (v0->unk_00->battleType & BATTLE_TYPE_FRONTIER) { - return (u8 *)&v0->unk_00->trainerData[param0 * 2]; + return (u8 *)&v0->unk_00->trainer[param0 * 2]; } else { - return (u8 *)&v0->unk_00->trainerData[param0]; + return (u8 *)&v0->unk_00->trainer[param0]; } } @@ -201,13 +201,13 @@ static u8 *sub_0207A7D4(int param0, void *param1, int param2) static u8 *sub_0207A7F4(int param0, void *param1, int param2) { UnkStruct_0207A778 *v0 = param1; - return (u8 *)&v0->unk_00->trainerData[1]; + return (u8 *)&v0->unk_00->trainer[1]; } static u8 *sub_0207A7FC(int param0, void *param1, int param2) { UnkStruct_0207A778 *v0 = param1; - return (u8 *)&v0->unk_00->trainerData[3]; + return (u8 *)&v0->unk_00->trainer[3]; } static u8 *sub_0207A804(int param0, void *param1, int param2) @@ -347,14 +347,14 @@ static void sub_0207A9BC(int param0, int param1, void *param2, void *param3) BOOL sub_0207A9CC(UnkStruct_0207A778 *param0) { - TrainerData *v0; + Trainer *v0; if (CommSys_SendRingRemainingSize() != 264) { return 0; } - v0 = (TrainerData *)¶m0->unk_20[0]; - *v0 = param0->unk_00->trainerData[0]; + v0 = (Trainer *)¶m0->unk_20[0]; + *v0 = param0->unk_00->trainer[0]; return 1; } @@ -369,7 +369,7 @@ BOOL sub_0207A9F8(UnkStruct_0207A778 *param0) return 0; } - return CommSys_SendDataHuge(26, (void *)¶m0->unk_20[0], sizeof(TrainerData)); + return CommSys_SendDataHuge(26, (void *)¶m0->unk_20[0], sizeof(Trainer)); } static void sub_0207AA28(int param0, int param1, void *param2, void *param3) @@ -490,14 +490,14 @@ static void sub_0207AB8C(int param0, int param1, void *param2, void *param3) BOOL sub_0207AB9C(UnkStruct_0207A778 *param0, int param1) { - TrainerData *v0; + Trainer *v0; if (CommSys_SendRingRemainingSize() != 264) { return 0; } - v0 = (TrainerData *)¶m0->unk_20[0]; - *v0 = param0->unk_00->trainerData[param1]; + v0 = (Trainer *)¶m0->unk_20[0]; + *v0 = param0->unk_00->trainer[param1]; return 1; } @@ -513,9 +513,9 @@ BOOL sub_0207ABD0(UnkStruct_0207A778 *param0, int param1, int param2) } if (param1 == 1) { - return CommSys_SendDataHuge(29, (void *)¶m0->unk_20[0], sizeof(TrainerData)); + return CommSys_SendDataHuge(29, (void *)¶m0->unk_20[0], sizeof(Trainer)); } else { - return CommSys_SendDataHuge(30, (void *)¶m0->unk_20[0], sizeof(TrainerData)); + return CommSys_SendDataHuge(30, (void *)¶m0->unk_20[0], sizeof(Trainer)); } } diff --git a/src/unk_0207AE68.c b/src/unk_0207AE68.c index 95fa2d8231..243afd717c 100644 --- a/src/unk_0207AE68.c +++ b/src/unk_0207AE68.c @@ -60,7 +60,7 @@ #include "constdata/const_020F410C.h" -UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, PokedexData *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11); +UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11); static void sub_0207B0A0(SysTask *param0, void *param1); BOOL sub_0207B0D0(UnkStruct_0207AE68 *param0); void sub_0207B0E0(UnkStruct_0207AE68 *param0); @@ -90,7 +90,7 @@ static const u8 Unk_020F0A2C[] = { 0x8 }; -UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, PokedexData *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11) +UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11) { UnkStruct_0207AE68 *v0; ArchivedSprite v1; diff --git a/src/unk_0208BA78.c b/src/unk_0208BA78.c index 5e277bd158..f37581a4bb 100644 --- a/src/unk_0208BA78.c +++ b/src/unk_0208BA78.c @@ -288,7 +288,7 @@ static BOOL sub_0208BC8C(UnkStruct_0208BC3C *param0, int param1) sub_0200544C(1, 127); sub_02005464(1); - if (sub_0208BE80(param0->unk_10->trainerData[1].class) == 1) { + if (sub_0208BE80(param0->unk_10->trainer[1].class) == 1) { sub_02004550(5, 1202, 1); } else { sub_02004550(5, 1119, 1); diff --git a/src/unk_020933F8.c b/src/unk_020933F8.c index bdc402d9ee..58a3a0ff14 100644 --- a/src/unk_020933F8.c +++ b/src/unk_020933F8.c @@ -439,7 +439,7 @@ UnkStruct_02095C48 *sub_02093800(const UnkStruct_02093800 *param0) } for (v2 = 0; v2 < 4; v2++) { - v0->unk_14C[v2] = AllocateAndInitializeChatotCryData(20); + v0->unk_14C[v2] = ChatotCry_New(20); } CopyChatotCryData(v0->unk_14C[0], param0->unk_20); @@ -1641,7 +1641,7 @@ void sub_02094C44(UnkStruct_02095C48 *param0, SaveData *param1, u32 param2, Jour { int v6; - PokedexData *v7; + Pokedex *v7; v7 = SaveData_Pokedex(param0->unk_1970); diff --git a/src/unk_0209747C.c b/src/unk_0209747C.c index 0b4d0df9db..0943792c62 100644 --- a/src/unk_0209747C.c +++ b/src/unk_0209747C.c @@ -26,7 +26,7 @@ struct UnkStruct_0209747C_t { u8 unk_04; u8 unk_05; int unk_08; - const PokedexData *unk_0C; + const Pokedex *unk_0C; const UnkStruct_02014EC4 *unk_10; Sentence unk_14; u16 unk_1C[2]; @@ -133,7 +133,7 @@ int sub_02097558(const UnkStruct_0209747C *param0) return param0->unk_08; } -const PokedexData *sub_0209755C(const UnkStruct_0209747C *param0) +const Pokedex *sub_0209755C(const UnkStruct_0209747C *param0) { return param0->unk_0C; } diff --git a/src/unk_020998EC.c b/src/unk_020998EC.c index e3f0a36bf0..caf4654969 100644 --- a/src/unk_020998EC.c +++ b/src/unk_020998EC.c @@ -3229,7 +3229,7 @@ static inline BOOL inline_02099BF4(const UnkStruct_020998EC *param0, u32 param1) static u32 sub_02099980(UnkStruct_020998EC *param0, const u16 *param1, u32 param2, u16 *param3) { - const PokedexData *v0; + const Pokedex *v0; u32 v1, v2; v2 = 0; From b5f552698826a36a2aba61c62af6c35a877735ca Mon Sep 17 00:00:00 2001 From: Adrienn Tindall <33725376+adrienntindall@users.noreply.github.com> Date: Tue, 14 Jan 2025 07:03:54 -0500 Subject: [PATCH 2/4] Fix Merge Errors --- include/field_battle_data_transfer.h | 2 +- include/overlay021/struct_ov21_021D0D80.h | 4 +- include/overlay025/poketch_system.h | 4 +- include/party.h | 2 +- include/pokedex_data.h | 86 +++---- include/poketch_data.h | 60 ++--- include/struct_defs/battle_system.h | 2 +- include/struct_defs/struct_0207AE68_t.h | 2 +- include/unk_0207AE68.h | 2 +- .../journal_display/journal_printer.c | 2 +- src/battle/ov16_0223B140.c | 24 +- src/battle/ov16_0223DF00.c | 14 +- src/catching_show.c | 2 +- src/encounter.c | 2 +- src/field_battle_data_transfer.c | 18 +- src/field_comm_manager.c | 2 +- src/field_menu.c | 68 +++--- src/overlay005/ov5_021DDAE4.c | 4 +- src/overlay005/ov5_021EA714.c | 24 +- src/overlay005/ov5_021F6454.c | 2 +- src/overlay005/save_info_window.c | 4 +- src/overlay006/ov6_02240C9C.c | 6 +- src/overlay006/ov6_02242984.c | 2 +- src/overlay010/ov10_0221F800.c | 16 +- src/overlay021/ov21_021D0D80.c | 16 +- src/overlay021/pokedex_sort.c | 4 +- src/overlay023/ov23_0223E140.c | 2 +- src/overlay023/ov23_022521F0.c | 2 +- src/overlay025/ov25_02254560.c | 16 +- src/overlay025/poketch_system.c | 22 +- src/overlay028/ov28_022561C0.c | 2 +- src/overlay031/ov31_022561C0.c | 18 +- src/overlay036/ov36_022561C0.c | 10 +- src/overlay045/ov45_022561C0.c | 10 +- src/overlay047/ov47_022561C0.c | 8 +- src/overlay049/ov49_022561C0.c | 8 +- src/overlay050/ov50_022561C0.c | 12 +- src/overlay054/ov54_022561C0.c | 10 +- src/overlay066/ov66_0222DDF0.c | 2 +- src/overlay097/ov97_0222AE60.c | 6 +- src/overlay097/ov97_0222C174.c | 4 +- src/overlay118/ov118_021D0D80.c | 2 +- src/party.c | 2 +- src/pokedex_data.c | 172 +++++++------- src/poketch_data.c | 218 +++++++++--------- src/savedata/save_table.c | 2 +- src/scrcmd.c | 20 +- src/scrcmd_system_flags.c | 2 +- src/unk_0202F1D4.c | 2 +- src/unk_0203D1B8.c | 6 +- src/unk_02046C7C.c | 2 +- src/unk_02048DD8.c | 4 +- src/unk_0204AEE8.c | 2 +- src/unk_0204B830.c | 8 +- src/unk_02052C6C.c | 2 +- src/unk_020683F4.c | 2 +- src/unk_0206CCB0.c | 22 +- src/unk_02071D40.c | 4 +- src/unk_0207A274.c | 2 +- src/unk_0207A6DC.c | 4 +- src/unk_0207AE68.c | 10 +- src/unk_020933F8.c | 6 +- src/unk_0209747C.c | 2 +- 63 files changed, 499 insertions(+), 503 deletions(-) diff --git a/include/field_battle_data_transfer.h b/include/field_battle_data_transfer.h index 4b2c278271..81ffcf9cf1 100644 --- a/include/field_battle_data_transfer.h +++ b/include/field_battle_data_transfer.h @@ -42,7 +42,7 @@ typedef struct FieldBattleDTO { Pokedex *pokedex; PCBoxes *pcBoxes; ChatotCry *chatotCries[MAX_BATTLERS]; - PoketchData *poketchData; + Poketch *poketch; UnkStruct_0202C878 *unk_104; Options *options; UnkStruct_0206D140 *unk_10C; diff --git a/include/overlay021/struct_ov21_021D0D80.h b/include/overlay021/struct_ov21_021D0D80.h index 93088fe1f2..932ee891ad 100644 --- a/include/overlay021/struct_ov21_021D0D80.h +++ b/include/overlay021/struct_ov21_021D0D80.h @@ -7,8 +7,8 @@ #include "trainer_info.h" typedef struct { - const Pokedex *unk_00; - const TrainerInfo *unk_04; + const Pokedex *pokedex; + const TrainerInfo *trainerInfo; int timeOfDay; BOOL fullmoonIslandVisible; BOOL newmoonIslandVisible; diff --git a/include/overlay025/poketch_system.h b/include/overlay025/poketch_system.h index 05baa63223..4db20f8487 100644 --- a/include/overlay025/poketch_system.h +++ b/include/overlay025/poketch_system.h @@ -110,7 +110,7 @@ struct PoketchSystem { NNSG2dOamManagerInstance *oamManager; SaveData *saveData; - PoketchData *poketchData; + Poketch *poketch; FieldSystem *fieldSystem; enum ButtonDir buttonDir; }; @@ -135,7 +135,7 @@ void ov25_02254518(const PoketchSystem *poketchSys, PoketchButtonManager *button BOOL PoketchSystem_IsPlayerMoving(const PoketchSystem *poketchSys); BOOL PoketchSystem_PedometerUpdated(const PoketchSystem *poketchSys); FieldSystem *PoketchSystem_GetFieldSystem(const PoketchSystem *poketchSys); -PoketchData *PoketchSystem_GetPoketchData(const PoketchSystem *poketchSys); +Poketch *PoketchSystem_GetPoketchData(const PoketchSystem *poketchSys); SaveData *PoketchSystem_GetSaveData(const PoketchSystem *poketchSys); int PoketchSystem_GetBorderColor(const PoketchSystem *poketchSys); diff --git a/include/party.h b/include/party.h index b0406f5b42..74f2fcf93f 100644 --- a/include/party.h +++ b/include/party.h @@ -17,7 +17,7 @@ int Party_GetCurrentCount(const Party *party); Pokemon *Party_GetPokemonBySlotIndex(const Party *party, int slot); void sub_0207A128(Party *party, int slot, Pokemon *param2); BOOL Party_SwapSlots(Party *party, int slotA, int slotB); -void Party_cpy(const Party *src, Party *dest); +void Party_Copy(const Party *src, Party *dest); BOOL Party_HasSpecies(const Party *party, int species); Party *Party_GetFromSavedata(SaveData *party); diff --git a/include/pokedex_data.h b/include/pokedex_data.h index beedad7084..a0ec36ff88 100644 --- a/include/pokedex_data.h +++ b/include/pokedex_data.h @@ -6,48 +6,48 @@ #include "pokemon.h" #include "savedata.h" -int PokedexData_SaveSize(void); -PokedexData *PokedexData_Alloc(u32 heapID); -void PokedexData_Copy(const PokedexData *src, PokedexData *dest); -void PokedexData_Init(PokedexData *pokedexData); -u16 PokedexData_CountCaught_National(const PokedexData *pokedexData); -u16 PokedexData_CountSeen_National(const PokedexData *pokedexData); -u16 PokedexData_CountSeen(const PokedexData *pokedexData); -u16 PokedexData_CountCaught_Local(const PokedexData *pokedexData); -u16 PokedexData_CountSeen_Local(const PokedexData *pokedexData); -BOOL PokedexData_NationalDexCompleted(const PokedexData *pokedexData); -BOOL PokedexData_LocalDexCompleted(const PokedexData *pokedexData); -u16 PokedexData_NumCaught_National(const PokedexData *pokedexData); -u16 PokedexData_NumCaught_Local(const PokedexData *pokedexData); -BOOL PokedexData_HasCaughtSpecies(const PokedexData *pokedexData, u16 species); -BOOL PokedexData_HasSeenSpecies(const PokedexData *pokedexData, u16 species); -u32 PokedexData_GetForm_Spinda(const PokedexData *pokedexData, u8 formIndex); -u32 PokedexData_DisplayedGender(const PokedexData *pokedexData, u16 species, int displaySecondary); -u32 PokedexData_GetForm_Unown(const PokedexData *pokedexData, int formIndex); -u32 PokedexData_NumFormsSeen_Unown(const PokedexData *pokedexData); -u32 PokedexData_GetForm_Shellos(const PokedexData *pokedexData, int formIndex); -u32 PokedexData_NumFormsSeen_Shellos(const PokedexData *pokedexData); -u32 PokedexData_GetForm_Gastrodon(const PokedexData *pokedexData, int formIndex); -u32 PokedexData_NumFormsSeen_Gastrodon(const PokedexData *pokedexData); -u32 PokedexData_GetForm_Burmy(const PokedexData *pokedexData, int formIndex); -u32 PokedexData_NumFormsSeen_Burmy(const PokedexData *pokedexData); -u32 PokedexData_GetForm_Wormadam(const PokedexData *pokedexData, int formIndex); -u32 PokedexData_NumFormsSeen_Wormadam(const PokedexData *pokedexData); -u32 PokedexData_GetForm_Deoxys(const PokedexData *pokedexData, int formIndex); -u32 PokedexData_NumFormsSeen_Deoxys(const PokedexData *pokedexData); -void PokedexData_Encounter(PokedexData *pokedexData, Pokemon *pokemon); -void PokedexData_Capture(PokedexData *pokedexData, Pokemon *pokemon); -void PokedexData_ObtainNationalDex(PokedexData *pokedexData); -BOOL PokedexData_IsNationalDexObtained(const PokedexData *pokedexData); -BOOL PokedexData_CanDetectForms(const PokedexData *pokedexData); -void PokedexData_TurnOnFormDetection(PokedexData *pokedexData); -BOOL PokedexData_IsLanguageObtained(const PokedexData *pokedexData, u16 species, u32 languageIndex); -void PokedexData_TurnOnLanguageDetection(PokedexData *pokedexData); -BOOL PokedexData_CanDetectLanguages(const PokedexData *pokedexData); -BOOL PokedexData_IsObtained(const PokedexData *pokedexData); -void PokedexData_ObtainPokedex(PokedexData *pokedexData); -PokedexData *SaveData_PokedexData(SaveData *saveData); -u32 PokedexData_GetDisplayForm(const PokedexData *pokedexData, int species, int formIndex); -u32 PokedexData_NumFormsSeen(const PokedexData *pokedexData, int species); +int Pokedex_SaveSize(void); +Pokedex *Pokedex_New(u32 heapID); +void Pokedex_Copy(const Pokedex *src, Pokedex *dest); +void Pokedex_Init(Pokedex *pokedex); +u16 Pokedex_CountCaught_National(const Pokedex *pokedex); +u16 Pokedex_CountSeen_National(const Pokedex *pokedex); +u16 Pokedex_CountSeen(const Pokedex *pokedex); +u16 PokedexData_CountCaught_Local(const Pokedex *pokedex); +u16 PokedexData_CountSeen_Local(const Pokedex *pokedex); +BOOL PokedexData_NationalDexCompleted(const Pokedex *pokedex); +BOOL PokedexData_LocalDexCompleted(const Pokedex *pokedex); +u16 PokedexData_NumCaught_National(const Pokedex *pokedex); +u16 PokedexData_NumCaught_Local(const Pokedex *pokedex); +BOOL PokedexData_HasCaughtSpecies(const Pokedex *pokedex, u16 species); +BOOL PokedexData_HasSeenSpecies(const Pokedex *pokedex, u16 species); +u32 PokedexData_GetForm_Spinda(const Pokedex *pokedex, u8 formIndex); +u32 PokedexData_DisplayedGender(const Pokedex *pokedex, u16 species, int displaySecondary); +u32 PokedexData_GetForm_Unown(const Pokedex *pokedex, int formIndex); +u32 PokedexData_NumFormsSeen_Unown(const Pokedex *pokedex); +u32 PokedexData_GetForm_Shellos(const Pokedex *pokedex, int formIndex); +u32 PokedexData_NumFormsSeen_Shellos(const Pokedex *pokedex); +u32 PokedexData_GetForm_Gastrodon(const Pokedex *pokedex, int formIndex); +u32 PokedexData_NumFormsSeen_Gastrodon(const Pokedex *pokedex); +u32 PokedexData_GetForm_Burmy(const Pokedex *pokedex, int formIndex); +u32 PokedexData_NumFormsSeen_Burmy(const Pokedex *pokedex); +u32 PokedexData_GetForm_Wormadam(const Pokedex *pokedex, int formIndex); +u32 PokedexData_NumFormsSeen_Wormadam(const Pokedex *pokedex); +u32 PokedexData_GetForm_Deoxys(const Pokedex *pokedex, int formIndex); +u32 PokedexData_NumFormsSeen_Deoxys(const Pokedex *pokedex); +void Pokedex_Encounter(Pokedex *pokedex, Pokemon *pokemon); +void PokedexData_Capture(Pokedex *pokedex, Pokemon *pokemon); +void PokedexData_ObtainNationalDex(Pokedex *pokedex); +BOOL PokedexData_IsNationalDexObtained(const Pokedex *pokedex); +BOOL PokedexData_CanDetectForms(const Pokedex *pokedex); +void PokedexData_TurnOnFormDetection(Pokedex *pokedex); +BOOL PokedexData_IsLanguageObtained(const Pokedex *pokedex, u16 species, u32 languageIndex); +void PokedexData_TurnOnLanguageDetection(Pokedex *pokedex); +BOOL PokedexData_CanDetectLanguages(const Pokedex *pokedex); +BOOL Pokedex_IsObtained(const Pokedex *pokedex); +void PokedexData_ObtainPokedex(Pokedex *pokedex); +Pokedex *SaveData_Pokedex(SaveData *saveData); +u32 Pokedex_GetDisplayForm(const Pokedex *pokedex, int species, int formIndex); +u32 PokedexData_NumFormsSeen(const Pokedex *pokedex, int species); #endif // POKEPLATINUM_POKEDEX_DATA_H diff --git a/include/poketch_data.h b/include/poketch_data.h index e94a0c9dd5..7732f564a7 100644 --- a/include/poketch_data.h +++ b/include/poketch_data.h @@ -28,7 +28,7 @@ enum PoketchScreenColor { /** * @brief All of the Poketch's internally tracked data including settings, registered apps, and the data for some apps (eg. pedometer, alarm clock). */ -typedef struct PoketchData { +typedef struct Poketch { u8 poketchEnabled : 1; u8 pedometerEnabled : 1; //!< Whether or not the pedometer is registered and will take step count updates. u8 dotArtModifiedByPlayer : 1; //!< Whether or not the dot art data has ever been modified by the user. This flag can never be set to FALSE. @@ -67,106 +67,106 @@ typedef struct PoketchData { u16 icon; u32 form; } pokemonHistoryQueue[POKETCH_POKEMONHISTORY_MAX]; //!< The pokemon to display in the Pokemon History app -} PoketchData; +} Poketch; int Poketch_SaveSize(void); -void Poketch_Init(PoketchData *poketchData); +void Poketch_Init(Poketch *poketch); -void PoketchData_Enable(PoketchData *poketchData); +void PoketchData_Enable(Poketch *poketch); -BOOL PoketchData_IsEnabled(PoketchData *poketchData); +BOOL PoketchData_IsEnabled(Poketch *poketch); -BOOL PoketchData_IsAppRegistered(PoketchData *poketchData, enum PoketchAppID appID); +BOOL PoketchData_IsAppRegistered(Poketch *poketch, enum PoketchAppID appID); -BOOL PoketchData_RegisterApp(PoketchData *poketchData, enum PoketchAppID appID); +BOOL PoketchData_RegisterApp(Poketch *poketch, enum PoketchAppID appID); -enum PoketchAppID PoketchData_CurrentAppID(const PoketchData *poketchData); +enum PoketchAppID PoketchData_CurrentAppID(const Poketch *poketch); /** * Sets the current Poketch app to the next registered app, skipping unregistered App IDs and wrapping around if necessary. */ -int PoketchData_IncrementAppID(PoketchData *poketchData); +int PoketchData_IncrementAppID(Poketch *poketch); /** * Sets the current Poketch app to the previous registered app, skipping unregistered App IDs and wrapping around if necessary. */ -int PoketchData_DecrementAppID(PoketchData *poketchData); +int PoketchData_DecrementAppID(Poketch *poketch); -u32 PoketchData_CurrentScreenColor(const PoketchData *poketchData); +u32 PoketchData_CurrentScreenColor(const Poketch *poketch); /** * Sets the Poketch's color setting with values from the PoketchScreenColor enum above. * This function asserts that the given value is less than POKETCH_SCREEN_COLOR_MAX. */ -void PoketchData_SetScreenColor(PoketchData *poketchData, u32 screenColor); +void PoketchData_SetScreenColor(Poketch *poketch, u32 screenColor); -u32 PoketchData_StepCount(const PoketchData *poketchData); +u32 PoketchData_StepCount(const Poketch *poketch); /** * Overwrites the current step count. This function will not do anything unless the Pedometer app is registered. */ -void PoketchData_SetStepCount(PoketchData *poketchData, u32 value); +void PoketchData_SetStepCount(Poketch *poketch, u32 value); -BOOL PoketchData_IsAlarmSet(const PoketchData *poketchData); +BOOL PoketchData_IsAlarmSet(const Poketch *poketch); -void PoketchData_AlarmTime(const PoketchData *poketchData, u32 *hour, u32 *minute); +void PoketchData_AlarmTime(const Poketch *poketch, u32 *hour, u32 *minute); -void PoketchData_SetAlarm(PoketchData *poketchData, BOOL enabled, u32 hour, u32 minute); +void PoketchData_SetAlarm(Poketch *poketch, BOOL enabled, u32 hour, u32 minute); /** * Marks the given date on the Calendar app as highlighted. * Passing this function a new month will change the month on the calendar and clear all days except the given one. */ -void PoketchData_SetCalendarMark(PoketchData *poketchData, u32 month, u32 day); +void PoketchData_SetCalendarMark(Poketch *poketch, u32 month, u32 day); /** * Clears the mark on the given date on the Calendar app. * Passing this function a new month will change the month on the calendar and clear every day. */ -void PoketchData_ClearCalendarMark(PoketchData *poketchData, u32 month, u32 day); +void PoketchData_ClearCalendarMark(Poketch *poketch, u32 month, u32 day); -BOOL PoketchData_CalendarMarked(const PoketchData *poketchData, u32 month, u32 day); +BOOL PoketchData_CalendarMarked(const Poketch *poketch, u32 month, u32 day); /** * Sets the location of a map marker. Asserts that index is less than POKETCH_MAPMARKER_COUNT. */ -void PoketchData_SetMapMarker(PoketchData *poketchData, int index, u8 x, u8 y); +void PoketchData_SetMapMarker(Poketch *poketch, int index, u8 x, u8 y); /** * Gets the location of a map marker. Asserts that index is less than POKETCH_MAPMARKER_COUNT. */ -void PoketchData_MapMarkerPos(const PoketchData *poketchData, int index, u8 *x, u8 *y); +void PoketchData_MapMarkerPos(const Poketch *poketch, int index, u8 *x, u8 *y); /** * Checks whether or not the Dot Art data has been modified at any point. * This will return FALSE until PoketchData_ModifyDotArtData is called, at which point it will always return TRUE. */ -BOOL PoketchData_DotArtModified(const PoketchData *poketchData); +BOOL PoketchData_DotArtModified(const Poketch *poketch); -void PoketchData_CopyDotArtData(const PoketchData *poketchData, u8 *dst); +void PoketchData_CopyDotArtData(const Poketch *poketch, u8 *dst); -void PoketchData_ModifyDotArtData(PoketchData *poketchData, const u8 *src); +void PoketchData_ModifyDotArtData(Poketch *poketch, const u8 *src); /** * Adds a new Pokemon to the end of the Pokemon History list. */ -void PoketchData_PokemonHistoryEnqueue(PoketchData *poketchData, const BoxPokemon *boxPokemon); +void PoketchData_PokemonHistoryEnqueue(Poketch *poketch, const BoxPokemon *boxPokemon); -int PoketchData_PokemonHistorySize(const PoketchData *poketchData); +int PoketchData_PokemonHistorySize(const Poketch *poketch); /** * Gets the species and icon info of a given index in the Pokemon History. * This function asserts that index is less than POKETCH_POKEMONHISTORY_MAX. */ -void PoketchData_PokemonHistorySpeciesAndIcon(const PoketchData *poketchData, int index, int *species, int *icon); +void PoketchData_PokemonHistorySpeciesAndIcon(const Poketch *poketch, int index, int *species, int *icon); /** * Gets the form info of a given index in the pokemon history. * This function asserts that index is less than POKETCH_POKEMONHISTORY_MAX. */ -u32 PoketchData_PokemonHistoryForm(const PoketchData *poketchData, int index); +u32 PoketchData_PokemonHistoryForm(const Poketch *poketch, int index); -PoketchData *SaveData_PoketchData(SaveData *saveData); +Poketch *SaveData_PoketchData(SaveData *saveData); #endif // POKEPLATINUM_POKETCH_DATA_H diff --git a/include/struct_defs/battle_system.h b/include/struct_defs/battle_system.h index b788deebd3..732c7e52f6 100644 --- a/include/struct_defs/battle_system.h +++ b/include/struct_defs/battle_system.h @@ -68,7 +68,7 @@ struct BattleSystem { UnkStruct_ov12_0221FCDC *unk_8C; SpriteRenderer *unk_90; SpriteGfxHandler *unk_94; - PoketchData *poketchData; + Poketch *poketch; UnkStruct_0206D140 *unk_9C; u16 trainerIDs[MAX_BATTLERS]; u8 unk_A8[4]; diff --git a/include/struct_defs/struct_0207AE68_t.h b/include/struct_defs/struct_0207AE68_t.h index e93597e072..4d1fe2d840 100644 --- a/include/struct_defs/struct_0207AE68_t.h +++ b/include/struct_defs/struct_0207AE68_t.h @@ -45,7 +45,7 @@ struct UnkStruct_0207AE68_t { Pokedex *unk_48; Bag *unk_4C; GameRecords *records; - PoketchData *poketchData; + Poketch *poketch; void *unk_58; int unk_5C; u16 unk_60; diff --git a/include/unk_0207AE68.h b/include/unk_0207AE68.h index 870f2fa888..f68be04d1e 100644 --- a/include/unk_0207AE68.h +++ b/include/unk_0207AE68.h @@ -11,7 +11,7 @@ #include "pokemon.h" #include "poketch_data.h" -UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11); +UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, Poketch *poketch, int param9, int param10, int param11); BOOL sub_0207B0D0(UnkStruct_0207AE68 *param0); void sub_0207B0E0(UnkStruct_0207AE68 *param0); diff --git a/src/applications/journal_display/journal_printer.c b/src/applications/journal_display/journal_printer.c index 25ec294a39..7179eea8e9 100644 --- a/src/applications/journal_display/journal_printer.c +++ b/src/applications/journal_display/journal_printer.c @@ -344,7 +344,7 @@ static void JournalPrinter_PrintTrainerEvent(JournalManager *journalManager, Win strLength = Strbuf_Length(name); Strbuf_Free(name); - if (TrainerData_LoadParam(journalEntryTrainer.trainerID, TRDATA_CLASS) == TRAINER_CLASS_RIVAL) { + if (Trainer_LoadParam(journalEntryTrainer.trainerID, TRDATA_CLASS) == TRAINER_CLASS_RIVAL) { name = MessageLoader_GetNewStrbuf(journalManager->loader, journal_entries_rival_name); StringTemplate_SetRivalName(journalManager->template, 1, journalManager->saveData); StringTemplate_Format(journalManager->template, journalManager->strbuf, name); diff --git a/src/battle/ov16_0223B140.c b/src/battle/ov16_0223B140.c index 963a0346cc..f7695bedbe 100644 --- a/src/battle/ov16_0223B140.c +++ b/src/battle/ov16_0223B140.c @@ -268,7 +268,7 @@ BOOL Battle_Main(OverlayManager *param0, int *param1) if (v2) { Heap_Create(3, 73, 0x30000); v4 = Party_GetPokemonBySlotIndex(v0->parties[0], v1); - v0->unk_170 = sub_0207AE68(v0->parties[0], v4, v2, v0->options, v0->visitedContestHall, v0->pokedex, v0->bag, v0->records, v0->poketchData, v3, 0x1 | 0x2, 73); + v0->unk_170 = sub_0207AE68(v0->parties[0], v4, v2, v0->options, v0->visitedContestHall, v0->pokedex, v0->bag, v0->records, v0->poketch, v3, 0x1 | 0x2, 73); *param1 = 14; } else { *param1 = 15; @@ -722,7 +722,7 @@ static void ov16_0223BCB4(OverlayManager *param0) } for (battlerId = 0; battlerId < MAX_BATTLERS; battlerId++) { - Party_cpy(battleSystem->parties[battlerId], v1->parties[battlerId]); + Party_Copy(battleSystem->parties[battlerId], v1->parties[battlerId]); Heap_FreeToHeap(battleSystem->parties[battlerId]); TrainerInfo_Copy(battleSystem->trainerInfo[battlerId], v1->trainerInfo[battlerId]); Heap_FreeToHeap(battleSystem->trainerInfo[battlerId]); @@ -736,7 +736,7 @@ static void ov16_0223BCB4(OverlayManager *param0) v1->pcBoxes = battleSystem->pcBoxes; v1->bagCursor = battleSystem->unk_5C; v1->subscreenCursorOn = battleSystem->unk_1BC; - v1->poketchData = battleSystem->poketchData; + v1->poketch = battleSystem->poketch; v1->unk_10C = battleSystem->unk_9C; v1->countSafariBalls = battleSystem->safariBalls; v1->resultMask = battleSystem->resultMask & (0xc0 ^ 0xff); @@ -1091,7 +1091,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) param0->unk_1B4 = param1->unk_124; param0->unk_5C = param1->bagCursor; param0->unk_1BC = param1->subscreenCursorOn; - param0->poketchData = param1->poketchData; + param0->poketch = param1->poketch; param0->unk_2420 = param1->mapEvolutionMethod; param0->unk_9C = param1->unk_10C; param0->safariBalls = param1->countSafariBalls; @@ -1149,7 +1149,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) for (v0 = 0; v0 < 4; v0++) { ov16_02263730(param0, param0->battlers[v0]); - Party_cpy(param1->parties[v0], param0->parties[v0]); + Party_Copy(param1->parties[v0], param0->parties[v0]); } for (v0 = 0; v0 < param0->maxBattlers; v0++) { @@ -1176,7 +1176,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) for (v0 = 0; v0 < 4; v0++) { ov16_02263730(param0, param0->battlers[v0]); - Party_cpy(param1->parties[v0], param0->parties[v0]); + Party_Copy(param1->parties[v0], param0->parties[v0]); } for (v0 = 0; v0 < param0->maxBattlers; v0++) { @@ -1203,7 +1203,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) param0->maxBattlers = v0; for (v0 = 0; v0 < 4; v0++) { - Party_cpy(param1->parties[v0], param0->parties[v0]); + Party_Copy(param1->parties[v0], param0->parties[v0]); } for (v0 = 0; v0 < param0->maxBattlers; v0++) { @@ -1234,7 +1234,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) param0->maxBattlers = v0; for (v0 = 0; v0 < 4; v0++) { - Party_cpy(param1->parties[v0], param0->parties[v0]); + Party_Copy(param1->parties[v0], param0->parties[v0]); for (v1 = 0; v1 < Party_GetCurrentCount(param0->parties[v0]); v1++) { v3 = Party_GetPokemonBySlotIndex(param0->parties[v0], v1); @@ -1263,7 +1263,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) param0->maxBattlers = v0; for (v0 = 0; v0 < 4; v0++) { - Party_cpy(param1->parties[v0], param0->parties[v0]); + Party_Copy(param1->parties[v0], param0->parties[v0]); } for (v0 = 0; v0 < param0->maxBattlers; v0++) { @@ -1301,7 +1301,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) param0->maxBattlers = v0; for (v0 = 0; v0 < 4; v0++) { - Party_cpy(param1->parties[v0], param0->parties[v0]); + Party_Copy(param1->parties[v0], param0->parties[v0]); } for (v0 = 0; v0 < param0->maxBattlers; v0++) { @@ -1329,7 +1329,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) param0->maxBattlers = v0; for (v0 = 0; v0 < 4; v0++) { - Party_cpy(param1->parties[v0], param0->parties[v0]); + Party_Copy(param1->parties[v0], param0->parties[v0]); } for (v0 = 0; v0 < param0->maxBattlers; v0++) { @@ -1363,7 +1363,7 @@ static void ov16_0223C2C0(BattleSystem *param0, FieldBattleDTO *param1) param0->maxBattlers = v0; for (v0 = 0; v0 < 4; v0++) { - Party_cpy(param1->parties[v0], param0->parties[v0]); + Party_Copy(param1->parties[v0], param0->parties[v0]); for (v1 = 0; v1 < Party_GetCurrentCount(param0->parties[v0]); v1++) { v3 = Party_GetPokemonBySlotIndex(param0->parties[v0], v1); diff --git a/src/battle/ov16_0223DF00.c b/src/battle/ov16_0223DF00.c index a089a6a0da..389b4c4569 100644 --- a/src/battle/ov16_0223DF00.c +++ b/src/battle/ov16_0223DF00.c @@ -1115,8 +1115,8 @@ void ov16_0223EF2C(BattleSystem *battleSystem, int param1, int param2) void ov16_0223EF48(BattleSystem *battleSystem, Pokemon *param1) { - if (battleSystem->poketchData) { - PoketchData_PokemonHistoryEnqueue(battleSystem->poketchData, Pokemon_GetBoxPokemon(param1)); + if (battleSystem->poketch) { + PoketchData_PokemonHistoryEnqueue(battleSystem->poketch, Pokemon_GetBoxPokemon(param1)); } } @@ -1688,14 +1688,14 @@ void BattleSystem_DexFlagSeen(BattleSystem *battleSystem, int param1) v2 = BattleContext_Get(battleSystem, battleSystem->battleCtx, 2, param1); v1 = BattleSystem_PartyPokemon(battleSystem, param1, v2); - if ((param0->battleType & (0x4 | 0x80)) == 0) { - if ((v0 & 0x1) || (param0->battleType == (0x2 | 0x8 | 0x40)) || (param0->battleType == ((0x2 | 0x1) | 0x8 | 0x40))) { - PokedexData_Encounter(param0->pokedex, v1); + if ((battleSystem->battleType & (0x4 | 0x80)) == 0) { + if ((v0 & 0x1) || (battleSystem->battleType == (0x2 | 0x8 | 0x40)) || (battleSystem->battleType == ((0x2 | 0x1) | 0x8 | 0x40))) { + Pokedex_Encounter(battleSystem->pokedex, v1); } } if (((v0 & 0x1) == 0) && (Pokemon_GetValue(v1, MON_DATA_SPECIES_EGG, NULL) == 412)) { - PokedexData_Capture(param0->pokedex, v1); + PokedexData_Capture(battleSystem->pokedex, v1); } } @@ -1714,7 +1714,7 @@ void ov16_0223F9A0(BattleSystem *battleSystem, int param1) v2 = BattleContext_Get(battleSystem, battleSystem->battleCtx, 2, param1); v1 = BattleSystem_PartyPokemon(battleSystem, param1, v2); - PokedexData_Capture(param0->pokedex, v1); + PokedexData_Capture(battleSystem->pokedex, v1); } } } diff --git a/src/catching_show.c b/src/catching_show.c index cc254078b5..695adee7cc 100644 --- a/src/catching_show.c +++ b/src/catching_show.c @@ -273,7 +273,7 @@ static FieldBattleDTO *SetupBattleDTO(FieldSystem *fieldSystem, CatchingShow *ca FieldBattleDTO_Init(dto, fieldSystem); sub_0202F000(v2, catchingShow->currentEncounterIndex, mon); - FieldBattleDTO_AddPokemonToBattler(dto, mon, BATTLER_ENEMY_SLOT_1); + FieldBattleDTO_AddPokemonToBattler(dto, mon, BATTLER_ENEMY_1); Heap_FreeToHeap(mon); return dto; diff --git a/src/encounter.c b/src/encounter.c index 3429f62801..04512a3d33 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -966,7 +966,7 @@ static void UpdateJournal(FieldSystem *fieldSystem, FieldBattleDTO *dto) } } else if ((battleType & BATTLE_TYPE_TRAINER) || (battleType & BATTLE_TYPE_TAG)) { if (resultMask == BATTLE_RESULT_WIN) { - JournalEntry_CreateAndSaveEventTrainer(fieldSystem->journalEntry, fieldSystem->location->mapId, dto->trainerIDs[BATTLER_ENEMY_SLOT_1], HEAP_ID_FIELDMAP); + JournalEntry_CreateAndSaveEventTrainer(fieldSystem->journalEntry, fieldSystem->location->mapId, dto->trainerIDs[BATTLER_ENEMY_1], HEAP_ID_FIELDMAP); } } } diff --git a/src/field_battle_data_transfer.c b/src/field_battle_data_transfer.c index ce33ad0a9a..292a862387 100644 --- a/src/field_battle_data_transfer.c +++ b/src/field_battle_data_transfer.c @@ -224,7 +224,7 @@ void FieldBattleDTO_AddPokemonToBattler(FieldBattleDTO *dto, Pokemon *src, int b void FieldBattleDTO_CopyPartyToBattler(FieldBattleDTO *dto, const Party *src, int battler) { GF_ASSERT(battler < MAX_BATTLERS); - Party_cpy(src, dto->parties[battler]); + Party_Copy(src, dto->parties[battler]); } void FieldBattleDTO_CopyTrainerInfoToBattler(FieldBattleDTO *dto, const TrainerInfo *src, int battler) @@ -262,7 +262,7 @@ void FieldBattleDTO_InitFromGameState(FieldBattleDTO *dto, const FieldSystem *fi FieldBattleDTO_CopyTrainerInfoToBattler(dto, trainerInfo, BATTLER_PLAYER_1); FieldBattleDTO_CopyPartyToBattler(dto, party, BATTLER_PLAYER_1); Bag_Copy(bag, dto->bag); - PokedexData_Copy(pokedex, dto->pokedex); + Pokedex_Copy(pokedex, dto->pokedex); Options_Copy(options, dto->options); FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_1); @@ -274,7 +274,7 @@ void FieldBattleDTO_InitFromGameState(FieldBattleDTO *dto, const FieldSystem *fi dto->fieldWeather = FieldOverworldState_GetWeather(fieldOverworldState); dto->bagCursor = bagCursor; dto->subscreenCursorOn = subscreenCursorOn; - dto->poketchData = SaveData_PoketchData(save); + dto->poketch = SaveData_PoketchData(save); dto->unk_104 = sub_0202C878(save); dto->records = SaveData_GetGameRecordsPtr(save); dto->journalEntry = journalEntry; @@ -321,7 +321,7 @@ void FieldBattleDTO_InitWithNormalizedMonLevels(FieldBattleDTO *dto, const Field Heap_FreeToHeap(mon); Bag_Copy(bag, dto->bag); - PokedexData_Copy(pokedex, dto->pokedex); + Pokedex_Copy(pokedex, dto->pokedex); Options_Copy(options, dto->options); FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_1); @@ -329,7 +329,7 @@ void FieldBattleDTO_InitWithNormalizedMonLevels(FieldBattleDTO *dto, const Field dto->timeOfDay = FieldSystem_GetTimeOfDay(fieldSystem); dto->bagCursor = fieldSystem->unk_98; dto->subscreenCursorOn = fieldSystem->battleSubscreenCursorOn; - dto->poketchData = SaveData_PoketchData(fieldSystem->saveData); + dto->poketch = SaveData_PoketchData(fieldSystem->saveData); dto->unk_104 = sub_0202C878(fieldSystem->saveData); dto->records = SaveData_GetGameRecordsPtr(fieldSystem->saveData); dto->journalEntry = fieldSystem->journalEntry; @@ -387,7 +387,7 @@ void FieldBattleDTO_InitWithPartyOrder(FieldBattleDTO *dto, const FieldSystem *f } Bag_Copy(bag, dto->bag); - PokedexData_Copy(pokedex, dto->pokedex); + Pokedex_Copy(pokedex, dto->pokedex); Options_Copy(options, dto->options); FieldBattleDTO_CopyChatotCryToBattler(dto, chatotCry, BATTLER_PLAYER_1); @@ -428,9 +428,9 @@ void FieldBattleDTO_UpdateFieldSystem(const FieldBattleDTO *dto, FieldSystem *fi u16 *fieldSysSafariBalls = FieldOverworldState_GetSafariBallCount(SaveData_GetFieldOverworldState(fieldSystem->saveData)); TrainerInfo_Copy(dto->trainerInfo[BATTLER_PLAYER_1], trainerInfo); - Party_cpy(dto->parties[BATTLER_PLAYER_1], party); + Party_Copy(dto->parties[BATTLER_PLAYER_1], party); Bag_Copy(dto->bag, bag); - PokedexData_Copy(dto->pokedex, pokedex); + Pokedex_Copy(dto->pokedex, pokedex); *fieldSysSafariBalls = dto->countSafariBalls; } @@ -442,7 +442,7 @@ void FieldBattleDTO_UpdatePokedex(const FieldBattleDTO *dto, FieldSystem *fieldS Bag *bag = SaveData_GetBag(fieldSystem->saveData); Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); - PokedexData_Copy(dto->pokedex, pokedex); + Pokedex_Copy(dto->pokedex, pokedex); } static const enum Terrain sTerrainForBackground[] = { diff --git a/src/field_comm_manager.c b/src/field_comm_manager.c index 17b50517fc..93d65acebf 100644 --- a/src/field_comm_manager.c +++ b/src/field_comm_manager.c @@ -436,7 +436,7 @@ static void sub_02059C2C(BOOL param0, const Party *party) { if (party) { sFieldCommMan->party = Party_New(11); - Party_cpy(party, sFieldCommMan->party); + Party_Copy(party, sFieldCommMan->party); } if (param0) { diff --git a/src/field_menu.c b/src/field_menu.c index d9befd76c0..b5e120dbb8 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -360,7 +360,7 @@ static u32 sub_0203ABD0(FieldSystem *fieldSystem) { u32 v0 = 0; - if (PokedexData_IsObtained(SaveData_PokedexData(fieldSystem->saveData)) == FALSE) { + if (Pokedex_IsObtained(SaveData_Pokedex(fieldSystem->saveData)) == FALSE) { v0 |= 0x1; } @@ -942,24 +942,24 @@ static BOOL FieldMenu_Pokedex(FieldTask *taskMan) FieldSystem *fieldSystem; FieldMenu *menu; UnkStruct_ov21_021D0D80 *v2; - Pokedex *v3; - TrainerInfo *v4; - VarsFlags *v5; + Pokedex *pokedex; + TrainerInfo *trainerInfo; + VarsFlags *varsFlags; fieldSystem = FieldTask_GetFieldSystem(taskMan); menu = FieldTask_GetEnv(taskMan); v2 = Heap_AllocFromHeap(11, sizeof(UnkStruct_ov21_021D0D80)); - v3 = SaveData_PokedexData(fieldSystem->saveData); - v4 = SaveData_GetTrainerInfo(fieldSystem->saveData); - v5 = SaveData_GetVarsFlags(fieldSystem->saveData); + pokedex = SaveData_Pokedex(fieldSystem->saveData); + trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); + varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData); - v2->unk_00 = v3; - v2->unk_04 = v4; + v2->pokedex = pokedex; + v2->trainerInfo = trainerInfo; v2->timeOfDay = FieldSystem_GetTimeOfDay(fieldSystem); - v2->fullmoonIslandVisible = VarFlags_HiddenLocationsUnlocked(v5, HL_FULLMOONISLAND); - v2->newmoonIslandVisible = VarFlags_HiddenLocationsUnlocked(v5, HL_NEWMOONISLAND); - v2->springPathVisible = VarFlags_HiddenLocationsUnlocked(v5, HL_SPRINGPATH); - v2->seabreakPathVisible = VarFlags_HiddenLocationsUnlocked(v5, HL_SEABREAKPATH); + v2->fullmoonIslandVisible = VarFlags_HiddenLocationsUnlocked(varsFlags, HL_FULLMOONISLAND); + v2->newmoonIslandVisible = VarFlags_HiddenLocationsUnlocked(varsFlags, HL_NEWMOONISLAND); + v2->springPathVisible = VarFlags_HiddenLocationsUnlocked(varsFlags, HL_SPRINGPATH); + v2->seabreakPathVisible = VarFlags_HiddenLocationsUnlocked(varsFlags, HL_SEABREAKPATH); v2->unk_1C = fieldSystem->unk_B4; sub_0203E0AC(fieldSystem, v2); @@ -1032,25 +1032,25 @@ BOOL sub_0203B7C0(FieldTask *taskMan) switch (partyMan->unk_23) { case 1: { - PokemonSummary *v3 = Heap_AllocFromHeap(11, sizeof(PokemonSummary)); - - v3->monData = Party_GetFromSavedata(fieldSystem->saveData); - v3->options = SaveData_Options(fieldSystem->saveData); - v3->dataType = 1; - v3->pos = partyMan->unk_22; - v3->max = (u8)Party_GetCurrentCount(v3->monData); - v3->move = 0; - v3->mode = 0; - v3->specialRibbons = sub_0202D79C(fieldSystem->saveData); - v3->dexMode = sub_0207A274(fieldSystem->saveData); - v3->showContest = PokemonSummaryScreen_ShowContestData(fieldSystem->saveData); - v3->chatotCry = NULL; - - PokemonSummaryScreen_FlagVisiblePages(v3, Unk_020EA02C); - PokemonSummaryScreen_SetPlayerProfile(v3, SaveData_GetTrainerInfo(fieldSystem->saveData)); - sub_0203D334(fieldSystem, v3); - - menu->unk_25C = v3; + PokemonSummary *summary = Heap_AllocFromHeap(11, sizeof(PokemonSummary)); + + summary->monData = Party_GetFromSavedata(fieldSystem->saveData); + summary->options = SaveData_Options(fieldSystem->saveData); + summary->dataType = 1; + summary->pos = partyMan->unk_22; + summary->max = (u8)Party_GetCurrentCount(summary->monData); + summary->move = 0; + summary->mode = 0; + summary->specialRibbons = sub_0202D79C(fieldSystem->saveData); + summary->dexMode = sub_0207A274(fieldSystem->saveData); + summary->showContest = PokemonSummaryScreen_ShowContestData(fieldSystem->saveData); + summary->chatotCry = NULL; + + PokemonSummaryScreen_FlagVisiblePages(summary, Unk_020EA02C); + PokemonSummaryScreen_SetPlayerProfile(summary, SaveData_GetTrainerInfo(fieldSystem->saveData)); + sub_0203D334(fieldSystem, summary); + + menu->unk_25C = summary; sub_0203B674(menu, sub_0203C1C8); } break; case 4: { @@ -1930,9 +1930,9 @@ static void FieldMenu_EvolveInit(FieldTask *taskMan) v4 = Party_GetPokemonBySlotIndex(v3, v2->unk_00); if (v2->unk_01 == 0) { - v5 = sub_0207AE68(v3, v4, v2->unk_04, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_PokedexData(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v2->unk_08, 0x1, 73); + v5 = sub_0207AE68(v3, v4, v2->unk_04, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_Pokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v2->unk_08, 0x1, 73); } else { - v5 = sub_0207AE68(v3, v4, v2->unk_04, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_PokedexData(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v2->unk_08, NULL, 73); + v5 = sub_0207AE68(v3, v4, v2->unk_04, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_Pokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v2->unk_08, NULL, 73); } { diff --git a/src/overlay005/ov5_021DDAE4.c b/src/overlay005/ov5_021DDAE4.c index cce5fa1013..d70f265615 100644 --- a/src/overlay005/ov5_021DDAE4.c +++ b/src/overlay005/ov5_021DDAE4.c @@ -40,11 +40,11 @@ static BOOL ov5_021DDAE4(FieldTask *param0) break; case 2: if (ov24_02253DB4(fieldSystem->bgConfig)) { - PoketchData *poketchData = SaveData_PoketchData(fieldSystem->saveData); + Poketch *poketch = SaveData_PoketchData(fieldSystem->saveData); Overlay_UnloadByID(FS_OVERLAY_ID(overlay24)); Overlay_LoadByID(FS_OVERLAY_ID(overlay25), 2); - PoketchData_Enable(poketchData); + PoketchData_Enable(poketch); PoketchSystem_Create(fieldSystem, &fieldSystem->unk_04->poketchSys, fieldSystem->saveData, fieldSystem->bgConfig, sub_0200A914(1)); v1->unk_00++; } diff --git a/src/overlay005/ov5_021EA714.c b/src/overlay005/ov5_021EA714.c index 378c67decc..c84d1fb3f3 100644 --- a/src/overlay005/ov5_021EA714.c +++ b/src/overlay005/ov5_021EA714.c @@ -25,11 +25,11 @@ void ov5_021EA714(FieldSystem *fieldSystem, enum PoketchEventID eventID, u32 dum void ov5_021EA728(FieldSystem *fieldSystem) { - PoketchData *poketchData = SaveData_PoketchData(fieldSystem->saveData); - VarsFlags *v1 = SaveData_GetVarsFlags(fieldSystem->saveData); + Poketch *poketch = SaveData_PoketchData(fieldSystem->saveData); + VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData); - if (PoketchData_IsEnabled(poketchData) - && (SystemFlag_CheckPoketchHidden(v1) == 0)) { + if (PoketchData_IsEnabled(poketch) + && (SystemFlag_CheckPoketchHidden(varsFlags) == 0)) { Overlay_LoadByID(FS_OVERLAY_ID(overlay25), 2); PoketchSystem_Create(fieldSystem, &fieldSystem->unk_04->poketchSys, fieldSystem->saveData, fieldSystem->bgConfig, sub_0200A914(1)); } else { @@ -40,11 +40,11 @@ void ov5_021EA728(FieldSystem *fieldSystem) void ov5_021EA790(FieldSystem *fieldSystem) { - PoketchData *poketchData = SaveData_PoketchData(fieldSystem->saveData); - VarsFlags *v1 = SaveData_GetVarsFlags(fieldSystem->saveData); + Poketch *poketch = SaveData_PoketchData(fieldSystem->saveData); + VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData); - if (PoketchData_IsEnabled(poketchData) - && (SystemFlag_CheckPoketchHidden(v1) == 0)) { + if (PoketchData_IsEnabled(poketch) + && (SystemFlag_CheckPoketchHidden(varsFlags) == 0)) { PoketchSystem_StartShutdown(fieldSystem->unk_04->poketchSys); } else { ov24_02253DA4(fieldSystem->bgConfig); @@ -53,11 +53,11 @@ void ov5_021EA790(FieldSystem *fieldSystem) u8 ov5_021EA7CC(FieldSystem *fieldSystem) { - PoketchData *poketchData = SaveData_PoketchData(fieldSystem->saveData); - VarsFlags *v1 = SaveData_GetVarsFlags(fieldSystem->saveData); + Poketch *poketch = SaveData_PoketchData(fieldSystem->saveData); + VarsFlags *varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData); - if (PoketchData_IsEnabled(poketchData) - && (SystemFlag_CheckPoketchHidden(v1) == 0)) { + if (PoketchData_IsEnabled(poketch) + && (SystemFlag_CheckPoketchHidden(varsFlags) == 0)) { if (PoketchSystem_IsSystemShutdown(fieldSystem->unk_04->poketchSys)) { fieldSystem->unk_04->poketchSys = NULL; Overlay_UnloadByID(FS_OVERLAY_ID(overlay25)); diff --git a/src/overlay005/ov5_021F6454.c b/src/overlay005/ov5_021F6454.c index 41d70f257e..5f6fd7fe19 100644 --- a/src/overlay005/ov5_021F6454.c +++ b/src/overlay005/ov5_021F6454.c @@ -676,7 +676,7 @@ BOOL ScrCmd_304(ScriptContext *param0) v4 = Party_GetPokemonBySlotIndex(v5, v7); Pokemon_SetRotomForm(v4, v10, v8); - PokedexData_Capture(SaveData_PokedexData(fieldSystem->saveData), v4); + PokedexData_Capture(SaveData_Pokedex(fieldSystem->saveData), v4); return 0; } diff --git a/src/overlay005/save_info_window.c b/src/overlay005/save_info_window.c index 00dd6a7da2..344350d48c 100644 --- a/src/overlay005/save_info_window.c +++ b/src/overlay005/save_info_window.c @@ -55,8 +55,8 @@ static void SaveInfo_SetValues(SaveInfo *saveInfo, const FieldSystem *fieldSyste saveInfo->mapLabelTextID = MapHeader_GetMapLabelTextID(curLocation->mapId); - if (PokedexData_IsObtained(pokedex)) { - saveInfo->pokedexCount = PokedexData_CountSeen(pokedex); + if (Pokedex_IsObtained(pokedex)) { + saveInfo->pokedexCount = Pokedex_CountSeen(pokedex); } else { saveInfo->pokedexCount = 0; } diff --git a/src/overlay006/ov6_02240C9C.c b/src/overlay006/ov6_02240C9C.c index d0f15a2919..70511f983b 100644 --- a/src/overlay006/ov6_02240C9C.c +++ b/src/overlay006/ov6_02240C9C.c @@ -325,7 +325,7 @@ BOOL ov6_02240D5C(FieldSystem *fieldSystem) v13[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_PokedexData(FieldSystem_GetSaveData(fieldSystem))); + BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_Pokedex(FieldSystem_GetSaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v13[2].species, &v13[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v13[0].species, &v13[1].species); @@ -513,7 +513,7 @@ BOOL ov6_022411C8(FieldSystem *fieldSystem, FieldTask *param1) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_PokedexData(FieldSystem_GetSaveData(fieldSystem))); + BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_Pokedex(FieldSystem_GetSaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); @@ -642,7 +642,7 @@ BOOL ov6_022413E4(FieldSystem *fieldSystem, FieldBattleDTO **battleParams) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_PokedexData(FieldSystem_GetSaveData(fieldSystem))); + BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_Pokedex(FieldSystem_GetSaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); diff --git a/src/overlay006/ov6_02242984.c b/src/overlay006/ov6_02242984.c index f463b14120..9985dbcc1a 100644 --- a/src/overlay006/ov6_02242984.c +++ b/src/overlay006/ov6_02242984.c @@ -42,7 +42,7 @@ int ov6_02242984(FieldSystem *fieldSystem) v2[i] = encounterData->grassEncounters.encounters[i].species; } - BOOL v1 = PokedexData_IsNationalDexObtained(SaveData_PokedexData(FieldSystem_GetSaveData(fieldSystem))); + BOOL v1 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(FieldSystem_GetSaveData(fieldSystem))); ov6_02242F74(sub_0202D814(sub_0202D834(fieldSystem->saveData), 1), v1, fieldSystem->location->mapId, &v2[6], &v2[7]); WildEncounters_ReplaceTimedEncounters(encounterData, &v2[2], &v2[3]); diff --git a/src/overlay010/ov10_0221F800.c b/src/overlay010/ov10_0221F800.c index caf88dc69d..e802dee00b 100644 --- a/src/overlay010/ov10_0221F800.c +++ b/src/overlay010/ov10_0221F800.c @@ -2407,7 +2407,7 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) battleResult = param0->unk_2A - 1; if (MapHeader_IsUnionRoom(param0->unk_00->mapHeaderID) == 1) { - opponentGender1 = TrainerClass_Gender(param0->unk_00->trainerData[v6 ^ 1].class); + opponentGender1 = TrainerClass_Gender(param0->unk_00->trainer[v6 ^ 1].class); opponentName1 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * (TRAINER_NAME_LEN + 1)); Strbuf_ToChars(param0->unk_14[sub_020362F4(v6 ^ 1)], opponentName1, TRAINER_NAME_LEN + 1); @@ -2416,7 +2416,7 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) } else { switch (sub_0203895C()) { case 1: - opponentGender1 = TrainerClass_Gender(param0->unk_00->trainerData[v6 ^ 1].class); + opponentGender1 = TrainerClass_Gender(param0->unk_00->trainer[v6 ^ 1].class); opponentName1 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * (TRAINER_NAME_LEN + 1)); Strbuf_ToChars(param0->unk_14[sub_020362F4(v6 ^ 1)], opponentName1, TRAINER_NAME_LEN + 1); @@ -2425,7 +2425,7 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) Heap_FreeToHeap(opponentName1); break; case 2: - opponentGender1 = TrainerClass_Gender(param0->unk_00->trainerData[v6 ^ 1].class); + opponentGender1 = TrainerClass_Gender(param0->unk_00->trainer[v6 ^ 1].class); opponentName1 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * (TRAINER_NAME_LEN + 1)); Strbuf_ToChars(param0->unk_14[sub_020362F4(v6 ^ 1)], opponentName1, TRAINER_NAME_LEN + 1); @@ -2434,7 +2434,7 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) Heap_FreeToHeap(opponentName1); break; case 3: - opponentGender1 = TrainerClass_Gender(param0->unk_00->trainerData[v6 ^ 1].class); + opponentGender1 = TrainerClass_Gender(param0->unk_00->trainer[v6 ^ 1].class); opponentName1 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * (TRAINER_NAME_LEN + 1)); Strbuf_ToChars(param0->unk_14[sub_020362F4(v6 ^ 1)], opponentName1, TRAINER_NAME_LEN + 1); @@ -2447,14 +2447,14 @@ static void ov10_022227A4(UnkStruct_ov10_0221F800 *param0) opponentName2 = Heap_AllocFromHeap(param0->unk_24, sizeof(u16) * (TRAINER_NAME_LEN + 1)); if (ov10_02220AD0() == 1) { - opponentGender1 = TrainerClass_Gender(param0->unk_00->trainerData[1].class); - opponentGender2 = TrainerClass_Gender(param0->unk_00->trainerData[3].class); + opponentGender1 = TrainerClass_Gender(param0->unk_00->trainer[1].class); + opponentGender2 = TrainerClass_Gender(param0->unk_00->trainer[3].class); Strbuf_ToChars(param0->unk_14[1], opponentName1, TRAINER_NAME_LEN + 1); Strbuf_ToChars(param0->unk_14[3], opponentName2, TRAINER_NAME_LEN + 1); } else { - opponentGender1 = TrainerClass_Gender(param0->unk_00->trainerData[0].class); - opponentGender2 = TrainerClass_Gender(param0->unk_00->trainerData[2].class); + opponentGender1 = TrainerClass_Gender(param0->unk_00->trainer[0].class); + opponentGender2 = TrainerClass_Gender(param0->unk_00->trainer[2].class); Strbuf_ToChars(param0->unk_14[0], opponentName1, TRAINER_NAME_LEN + 1); Strbuf_ToChars(param0->unk_14[2], opponentName2, TRAINER_NAME_LEN + 1); diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 8a14073fc3..019b2e0fb0 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -133,12 +133,8 @@ int ov21_021D0D80(OverlayManager *param0, int *param1) v1 = OverlayManager_Args(param0); - { - u32 v4; - - v4 = PokedexData_GetDisplayForm(v1->unk_00, 487, 0); - Pokedex_SetupGiratina(v4); - } + u32 form = Pokedex_GetDisplayForm(v1->pokedex, 487, 0); + Pokedex_SetupGiratina(form); SetMainCallback(ov21_021D0F04, v0); DisableHBlank(); @@ -149,8 +145,8 @@ int ov21_021D0D80(OverlayManager *param0, int *param1) ov21_021D12B0(37); - v2.unk_00 = v1->unk_00; - v2.unk_04 = v1->unk_04; + v2.pokedex = v1->pokedex; + v2.trainerInfo = v1->trainerInfo; v2.timeOfDay = v1->timeOfDay; v2.fullmoonIslandVisible = v1->fullmoonIslandVisible; v2.seabreakPathVisible = v1->seabreakPathVisible; @@ -317,8 +313,8 @@ UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 v0->unk_1D6C = ov21_021D3FE0(param0); v0->unk_1D70 = ov21_021D3FE0(param0); - v2.dexData = param1->unk_00; - v2.unk_04 = param1->unk_04; + v2.dexData = param1->pokedex; + v2.unk_04 = param1->trainerInfo; v2.timeOfDay = param1->timeOfDay; v2.fullmoonIslandVisible = param1->fullmoonIslandVisible; v2.newmoonIslandVisible = param1->newmoonIslandVisible; diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c index 4586ec3c38..eb1aad134d 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/pokedex_sort.c @@ -227,7 +227,7 @@ u32 ov21_021D33BC(const UnkStruct_ov21_021D3320 *param0, int param1) u32 ov21_021D33D4(const UnkStruct_ov21_021D3320 *param0, u32 species) { - return PokedexData_GetDisplayForm(param0->dexData, species, 0); + return Pokedex_GetDisplayForm(param0->dexData, species, 0); } u32 ov21_021D33E0(const UnkStruct_ov21_021D3320 *param0, int param1) @@ -253,7 +253,7 @@ u32 ov21_021D3404(const UnkStruct_ov21_021D3320 *param0, int param1) u32 ov21_021D3410(const UnkStruct_ov21_021D3320 *param0, u32 param1, int param2) { - return PokedexData_GetDisplayForm(param0->dexData, param1, param2); + return Pokedex_GetDisplayForm(param0->dexData, param1, param2); } u32 ov21_021D341C(const UnkStruct_ov21_021D3320 *param0, u32 param1) diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index 18b8bf0a3a..9d7839ed2f 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -1780,7 +1780,7 @@ static int ov23_0223F970(UnkStruct_ov23_02256EB0 *param0) SaveData *v0 = FieldSystem_GetSaveData(Unk_ov23_02257740->fieldSystem); UndergroundData *v1 = sub_020298B0(v0); BOOL v2 = TrainerInfo_ID(SaveData_GetTrainerInfo(v0)) % 2; - BOOL v3 = PokedexData_IsNationalDexObtained(SaveData_PokedexData(v0)); + BOOL v3 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(v0)); int v4 = 0; if (v3) { diff --git a/src/overlay023/ov23_022521F0.c b/src/overlay023/ov23_022521F0.c index a5e935e502..08a3797b58 100644 --- a/src/overlay023/ov23_022521F0.c +++ b/src/overlay023/ov23_022521F0.c @@ -133,7 +133,7 @@ static void ov23_022522F0(UnkStruct_ov23_02250CD4 *param0, int param1) int v1, v2, v3, v4, v5; SaveData *v6 = FieldSystem_GetSaveData(param0->fieldSystem); UndergroundData *v7 = sub_020298B0(v6); - BOOL v8 = PokedexData_IsNationalDexObtained(SaveData_PokedexData(v6)); + BOOL v8 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(v6)); MATH_InitRand16(&v0, sub_02028930(v7) + param1); diff --git a/src/overlay025/ov25_02254560.c b/src/overlay025/ov25_02254560.c index 08ded5f2c6..e07b78f6ae 100644 --- a/src/overlay025/ov25_02254560.c +++ b/src/overlay025/ov25_02254560.c @@ -162,8 +162,8 @@ static void ov25_02254684(UnkStruct_ov25_02254560 *param0) void ov25_022546B8(u32 param0, u32 param1) { UnkStruct_ov25_02254560 *v0 = ov25_02254418(); - PoketchData *poketchData = PoketchSystem_GetPoketchData(v0->poketchSys); - u32 v2 = PoketchData_CurrentScreenColor(poketchData); + Poketch *poketch = PoketchSystem_GetPoketchData(v0->poketchSys); + u32 v2 = PoketchData_CurrentScreenColor(poketch); GXS_LoadBGPltt(&v0->unk_200[v2 * 32], param0 * 0x20, 0x20); GXS_LoadOBJPltt(&v0->unk_200[v2 * 32], param1, 0x20); @@ -172,8 +172,8 @@ void ov25_022546B8(u32 param0, u32 param1) void ov25_022546F0(u32 param0, u32 param1) { UnkStruct_ov25_02254560 *v0 = ov25_02254418(); - PoketchData *poketchData = PoketchSystem_GetPoketchData(v0->poketchSys); - u32 v2 = PoketchData_CurrentScreenColor(poketchData); + Poketch *poketch = PoketchSystem_GetPoketchData(v0->poketchSys); + u32 v2 = PoketchData_CurrentScreenColor(poketch); GXS_LoadBGPltt(&v0->unk_200[v2 * 32 + 16], 0, 0x20); GXS_LoadOBJPltt(&v0->unk_200[v2 * 32 + 16], 0, 0x20); @@ -182,8 +182,8 @@ void ov25_022546F0(u32 param0, u32 param1) void ov25_02254728(u16 *param0) { UnkStruct_ov25_02254560 *v0 = ov25_02254418(); - PoketchData *poketchData = PoketchSystem_GetPoketchData(v0->poketchSys); - u32 v2 = PoketchData_CurrentScreenColor(poketchData); + Poketch *poketch = PoketchSystem_GetPoketchData(v0->poketchSys); + u32 v2 = PoketchData_CurrentScreenColor(poketch); MI_CpuCopy16(&v0->unk_200[v2 * 32], param0, 0x20); } @@ -604,8 +604,8 @@ static void ov25_02254DE0(UnkStruct_ov25_02254560 *param0, UnkStruct_ov25_02254D static void ov25_02254E84(UnkStruct_ov25_02254560 *param0, u32 param1) { - PoketchData *poketchData = PoketchSystem_GetPoketchData(param0->poketchSys); - u32 v2 = PoketchData_CurrentScreenColor(poketchData); + Poketch *poketch = PoketchSystem_GetPoketchData(param0->poketchSys); + u32 v2 = PoketchData_CurrentScreenColor(poketch); ov25_02254728(param0->unk_400); diff --git a/src/overlay025/poketch_system.c b/src/overlay025/poketch_system.c index 4b1dec3440..5b47427b49 100644 --- a/src/overlay025/poketch_system.c +++ b/src/overlay025/poketch_system.c @@ -129,7 +129,7 @@ void PoketchSystem_Create(FieldSystem *fieldSystem, PoketchSystem **poketchSys, new_system->fieldSystem = fieldSystem; new_system->saveData = saveData; - new_system->poketchData = SaveData_PoketchData(saveData); + new_system->poketch = SaveData_PoketchData(saveData); new_system->bgl = bgl; new_system->oamManager = oamManager; @@ -166,13 +166,13 @@ void PoketchSystem_SendEvent(PoketchSystem *poketchSys, enum PoketchEventID even poketchSys->playerMoving = TRUE; break; case POKETCH_EVENT_PEDOMETER: { - u32 step_count = PoketchData_StepCount(poketchSys->poketchData); + u32 step_count = PoketchData_StepCount(poketchSys->poketch); if (++step_count > POKETCH_PEDOMETER_MAX) { step_count = 0; } - PoketchData_SetStepCount(poketchSys->poketchData, step_count); + PoketchData_SetStepCount(poketchSys->poketch, step_count); poketchSys->pedometerUpdated = TRUE; } break; case POKETCH_EVENT_SAVE: @@ -278,7 +278,7 @@ static void PoketchEvent_InitApp(PoketchSystem *poketchSys) break; case 1: if (ov25_022547F4(poketchSys->unk_1C, 0)) { - u32 app_ID = PoketchData_CurrentAppID(poketchSys->poketchData); + u32 app_ID = PoketchData_CurrentAppID(poketchSys->poketch); PoketchSystem_LoadApp(poketchSys, app_ID); PoketchSystem_InitApp(poketchSys, app_ID); @@ -325,9 +325,9 @@ static void PoketchEvent_UpdateApp(PoketchSystem *poketchSys) if (ov25_02254800(poketchSys->unk_1C)) { if (poketchSys->buttonDir == BUTTON_UP) { - poketchSys->unk_20.unk_00 = PoketchData_DecrementAppID(poketchSys->poketchData); + poketchSys->unk_20.unk_00 = PoketchData_DecrementAppID(poketchSys->poketch); } else { - poketchSys->unk_20.unk_00 = PoketchData_IncrementAppID(poketchSys->poketchData); + poketchSys->unk_20.unk_00 = PoketchData_IncrementAppID(poketchSys->poketch); } if (poketchSys->skipApp) { @@ -367,9 +367,9 @@ static void PoketchEvent_UpdateApp(PoketchSystem *poketchSys) case 4: if (poketchSys->buttonState == BUTTON_MANAGER_STATE_TAP || poketchSys->buttonState == BUTTON_MANAGER_STATE_TIMER0) { if (poketchSys->buttonDir == BUTTON_UP) { - poketchSys->unk_20.unk_00 = PoketchData_DecrementAppID(poketchSys->poketchData); + poketchSys->unk_20.unk_00 = PoketchData_DecrementAppID(poketchSys->poketch); } else { - poketchSys->unk_20.unk_00 = PoketchData_IncrementAppID(poketchSys->poketchData); + poketchSys->unk_20.unk_00 = PoketchData_IncrementAppID(poketchSys->poketch); } poketchSys->appSkipTimer = 30; @@ -395,7 +395,7 @@ static void PoketchEvent_OnAppChange(PoketchSystem *poketchSys) u32 v0; poketchSys->unk_06 = 1; - v0 = PoketchData_CurrentAppID(poketchSys->poketchData); + v0 = PoketchData_CurrentAppID(poketchSys->poketch); PoketchSystem_LoadApp(poketchSys, v0); PoketchSystem_InitApp(poketchSys, v0); @@ -741,9 +741,9 @@ FieldSystem *PoketchSystem_GetFieldSystem(const PoketchSystem *poketchSys) return poketchSys->fieldSystem; } -PoketchData *PoketchSystem_GetPoketchData(const PoketchSystem *poketchSys) +Poketch *PoketchSystem_GetPoketchData(const PoketchSystem *poketchSys) { - return poketchSys->poketchData; + return poketchSys->poketch; } SaveData *PoketchSystem_GetSaveData(const PoketchSystem *poketchSys) diff --git a/src/overlay028/ov28_022561C0.c b/src/overlay028/ov28_022561C0.c index 837353a872..a845eb8565 100644 --- a/src/overlay028/ov28_022561C0.c +++ b/src/overlay028/ov28_022561C0.c @@ -635,7 +635,7 @@ static void ov28_02256914(UnkStruct_ov28_02256210 *param0, const UnkStruct_ov28_ Pokedex *v1; u16 v2; - v1 = SaveData_PokedexData(PoketchSystem_GetSaveData(param0->poketchSys)); + v1 = SaveData_Pokedex(PoketchSystem_GetSaveData(param0->poketchSys)); if (PokedexData_IsNationalDexObtained(v1)) { v2 = v0; diff --git a/src/overlay031/ov31_022561C0.c b/src/overlay031/ov31_022561C0.c index 6bf8af7f10..3dee70e56b 100644 --- a/src/overlay031/ov31_022561C0.c +++ b/src/overlay031/ov31_022561C0.c @@ -34,8 +34,8 @@ static BOOL ov31_02256228(UnkStruct_ov31_02256228 *param0, PoketchSystem *poketc static void ov31_02256268(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1); static inline u8 inline_ov31_02256298(const u8 *param0, int param1); static inline void inline_ov31_022562EC(u8 *param0, int param1, int param2); -static void ov31_02256298(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1, PoketchData *poketchData); -static void ov31_022562EC(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1, PoketchData *poketchData); +static void ov31_02256298(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1, Poketch *poketch); +static void ov31_022562EC(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1, Poketch *poketch); static void ov31_0225635C(UnkStruct_ov31_02256554_1 *param0); static void ov31_02256384(UnkStruct_ov31_02256228 *param0); static void ov31_022563B0(void *param0); @@ -90,10 +90,10 @@ static BOOL ov31_02256228(UnkStruct_ov31_02256228 *param0, PoketchSystem *poketc static void ov31_02256268(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1) { - PoketchData *poketchData = PoketchSystem_GetPoketchData(param0->poketchSys); + Poketch *poketch = PoketchSystem_GetPoketchData(param0->poketchSys); - if (PoketchData_DotArtModified(poketchData)) { - ov31_02256298(param0, param1, poketchData); + if (PoketchData_DotArtModified(poketch)) { + ov31_02256298(param0, param1, poketch); } else { ov31_0225635C(param1); } @@ -109,11 +109,11 @@ static inline void inline_ov31_022562EC(u8 *param0, int param1, int param2) param0[(param1 / 4)] |= ((param2 & 3) << ((param1 & 3) * 2)); } -static void ov31_02256298(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1, PoketchData *poketchData) +static void ov31_02256298(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1, Poketch *poketch) { int v0, v1, v2; - PoketchData_CopyDotArtData(poketchData, param0->unk_1F4); + PoketchData_CopyDotArtData(poketch, param0->unk_1F4); v2 = 0; @@ -124,7 +124,7 @@ static void ov31_02256298(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_022565 } } -static void ov31_022562EC(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1, PoketchData *poketchData) +static void ov31_022562EC(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_02256554_1 *param1, Poketch *poketch) { int v0, v1, v2; @@ -138,7 +138,7 @@ static void ov31_022562EC(UnkStruct_ov31_02256228 *param0, UnkStruct_ov31_022565 } } - PoketchData_ModifyDotArtData(poketchData, param0->unk_1F4); + PoketchData_ModifyDotArtData(poketch, param0->unk_1F4); } static void ov31_0225635C(UnkStruct_ov31_02256554_1 *param0) diff --git a/src/overlay036/ov36_022561C0.c b/src/overlay036/ov36_022561C0.c index d6e7a1aefe..ef83e3224a 100644 --- a/src/overlay036/ov36_022561C0.c +++ b/src/overlay036/ov36_022561C0.c @@ -22,7 +22,7 @@ typedef struct { PoketchSystem *poketchSys; PoketchButtonManager *buttonManager; u32 unk_18; - PoketchData *poketchData; + Poketch *poketch; } UnkStruct_ov36_0225621C; static void NitroStaticInit(void); @@ -71,9 +71,9 @@ static BOOL ov36_0225621C(UnkStruct_ov36_0225621C *param0, PoketchSystem *poketc }; param0->poketchSys = poketchSys; - param0->poketchData = PoketchSystem_GetPoketchData(poketchSys); + param0->poketch = PoketchSystem_GetPoketchData(poketchSys); param0->unk_04.unk_04 = 1; - param0->unk_04.unk_00 = PoketchData_StepCount(param0->poketchData); + param0->unk_04.unk_00 = PoketchData_StepCount(param0->poketch); if (ov36_02256404(&(param0->unk_0C), &(param0->unk_04), param2)) { param0->unk_00 = 0; @@ -181,7 +181,7 @@ static BOOL ov36_02256330(UnkStruct_ov36_0225621C *param0) } if (PoketchSystem_PedometerUpdated(param0->poketchSys)) { - v0->unk_00 = PoketchData_StepCount(param0->poketchData); + v0->unk_00 = PoketchData_StepCount(param0->poketch); ov36_0225653C(param0->unk_0C, 3); break; } @@ -201,7 +201,7 @@ static BOOL ov36_02256330(UnkStruct_ov36_0225621C *param0) v0->unk_04 = 1; v0->unk_00 = 0; - PoketchData_SetStepCount(param0->poketchData, 0); + PoketchData_SetStepCount(param0->poketch, 0); ov36_0225653C(param0->unk_0C, 2); ov36_0225653C(param0->unk_0C, 3); diff --git a/src/overlay045/ov45_022561C0.c b/src/overlay045/ov45_022561C0.c index d730464e97..d020ac3c57 100644 --- a/src/overlay045/ov45_022561C0.c +++ b/src/overlay045/ov45_022561C0.c @@ -23,7 +23,7 @@ typedef struct { UnkStruct_ov45_022566EC_1 unk_03; UnkStruct_ov45_022566EC *unk_08; PoketchSystem *poketchSys; - PoketchData *poketchData; + Poketch *poketch; PoketchButtonManager *buttonManager; u32 unk_18; u32 unk_1C; @@ -117,10 +117,10 @@ static BOOL ov45_0225621C(UnkStruct_ov45_022561D4 *param0, PoketchSystem *poketc }; u32 v1, v2; - param0->poketchData = PoketchSystem_GetPoketchData(poketchSys); - param0->unk_03.unk_00 = PoketchData_IsAlarmSet(param0->poketchData); + param0->poketch = PoketchSystem_GetPoketchData(poketchSys); + param0->unk_03.unk_00 = PoketchData_IsAlarmSet(param0->poketch); - PoketchData_AlarmTime(param0->poketchData, &v1, &v2); + PoketchData_AlarmTime(param0->poketch, &v1, &v2); param0->unk_03.unk_03 = v1; param0->unk_03.unk_04 = v2; @@ -258,7 +258,7 @@ static BOOL ov45_022563C0(UnkStruct_ov45_022561D4 *param0) if ((param0->unk_1C == 1) && (param0->unk_18 == 0)) { param0->unk_03.unk_00 = 1; ov45_022562C0(¶m0->unk_03); - PoketchData_SetAlarm(param0->poketchData, 1, param0->unk_03.unk_03, param0->unk_03.unk_04); + PoketchData_SetAlarm(param0->poketch, 1, param0->unk_03.unk_03, param0->unk_03.unk_04); ov45_02256918(param0->unk_08, 2); param0->unk_1C = 0; param0->unk_01++; diff --git a/src/overlay047/ov47_022561C0.c b/src/overlay047/ov47_022561C0.c index 9ebade8bc5..640c602a10 100644 --- a/src/overlay047/ov47_022561C0.c +++ b/src/overlay047/ov47_022561C0.c @@ -27,7 +27,7 @@ typedef struct { UnkStruct_ov47_02256634_1 unk_04; UnkStruct_ov47_02256634 *unk_70; PoketchSystem *poketchSys; - PoketchData *poketchData; + Poketch *poketch; UnkStruct_0206C638 *unk_7C[6]; u8 unk_94[6]; u8 unk_9A; @@ -75,13 +75,13 @@ static BOOL ov47_0225621C(UnkStruct_ov47_0225621C *param0, PoketchSystem *poketc { int v0; - param0->poketchData = PoketchSystem_GetPoketchData(poketchSys); + param0->poketch = PoketchSystem_GetPoketchData(poketchSys); for (v0 = 0; v0 < 6; v0++) { param0->unk_04.unk_0C[v0].unk_03 = 1; param0->unk_04.unk_0C[v0].unk_02 = v0; - PoketchData_MapMarkerPos(param0->poketchData, v0, &(param0->unk_04.unk_0C[v0].unk_00), &(param0->unk_04.unk_0C[v0].unk_01)); + PoketchData_MapMarkerPos(param0->poketch, v0, &(param0->unk_04.unk_0C[v0].unk_00), &(param0->unk_04.unk_0C[v0].unk_01)); param0->unk_04.unk_0C[v0].unk_00 += 16; param0->unk_04.unk_0C[v0].unk_01 += 16; @@ -129,7 +129,7 @@ static void ov47_0225634C(UnkStruct_ov47_0225621C *param0) int v0; for (v0 = 0; v0 < 6; v0++) { - PoketchData_SetMapMarker(param0->poketchData, v0, (param0->unk_04.unk_0C[v0].unk_00 - 16), (param0->unk_04.unk_0C[v0].unk_01 - 16)); + PoketchData_SetMapMarker(param0->poketch, v0, (param0->unk_04.unk_0C[v0].unk_00 - 16), (param0->unk_04.unk_0C[v0].unk_01 - 16)); } ov47_02256670(param0->unk_70); diff --git a/src/overlay049/ov49_022561C0.c b/src/overlay049/ov49_022561C0.c index 551acbff97..694e5c5af4 100644 --- a/src/overlay049/ov49_022561C0.c +++ b/src/overlay049/ov49_022561C0.c @@ -22,7 +22,7 @@ typedef struct { UnkStruct_ov49_022563D4_1 unk_04; UnkStruct_ov49_022563D4 *unk_08; PoketchSystem *poketchSys; - PoketchData *poketchData; + Poketch *poketch; } UnkStruct_ov49_0225621C; static void NitroStaticInit(void); @@ -63,8 +63,8 @@ static BOOL ov49_022561D4(void **param0, PoketchSystem *poketchSys, BgConfig *pa static BOOL ov49_0225621C(UnkStruct_ov49_0225621C *param0, PoketchSystem *poketchSys, BgConfig *param2, u32 param3) { - param0->poketchData = PoketchSystem_GetPoketchData(poketchSys); - param0->unk_04.unk_00 = PoketchData_CurrentScreenColor(param0->poketchData); + param0->poketch = PoketchSystem_GetPoketchData(poketchSys); + param0->unk_04.unk_00 = PoketchData_CurrentScreenColor(param0->poketch); param0->unk_03 = param0->unk_04.unk_00; if (ov49_022563D4(&(param0->unk_08), &(param0->unk_04), param2)) { @@ -178,7 +178,7 @@ static BOOL ov49_02256348(UnkStruct_ov49_0225621C *param0) if (v2 != param0->unk_03) { param0->unk_04.unk_00 = v2; param0->unk_03 = v2; - PoketchData_SetScreenColor(param0->poketchData, v2); + PoketchData_SetScreenColor(param0->poketch, v2); return 1; } } diff --git a/src/overlay050/ov50_022561C0.c b/src/overlay050/ov50_022561C0.c index cb669d7c6c..c19d2fc6a8 100644 --- a/src/overlay050/ov50_022561C0.c +++ b/src/overlay050/ov50_022561C0.c @@ -23,7 +23,7 @@ typedef struct { UnkStruct_ov50_02256510_1 unk_04; UnkStruct_ov50_02256510 *unk_90; PoketchSystem *poketchSys; - PoketchData *poketchData; + Poketch *poketch; PoketchButtonManager *buttonManager; u32 unk_A0; u32 unk_A4; @@ -112,7 +112,7 @@ static BOOL ov50_0225621C(UnkStruct_ov50_022561D4 *param0, PoketchSystem *poketc RTCDate v1; GetCurrentDate(&v1); - param0->poketchData = PoketchSystem_GetPoketchData(poketchSys); + param0->poketch = PoketchSystem_GetPoketchData(poketchSys); ov50_022562AC(&(param0->unk_04), param0, &v1); param0->unk_A8 = param0->unk_04.unk_0C[0].unk_02; @@ -168,7 +168,7 @@ static void ov50_022562AC(UnkStruct_ov50_02256510_1 *param0, UnkStruct_ov50_0225 for (v1 = 0; v1 < (param0->unk_04); v1++) { param0->unk_0C[v1].unk_00 = v1 + 1; - param0->unk_0C[v1].unk_03 = PoketchData_CalendarMarked(param1->poketchData, param0->unk_00, v1 + 1); + param0->unk_0C[v1].unk_03 = PoketchData_CalendarMarked(param1->poketch, param0->unk_00, v1 + 1); param0->unk_0C[v1].unk_02 = v2 + v1; } } @@ -260,10 +260,10 @@ static BOOL ov50_02256418(UnkStruct_ov50_022561D4 *param0) if ((param0->unk_A4 >= param0->unk_A8) && (param0->unk_A4 <= param0->unk_AC)) { int v0 = (param0->unk_A4 - param0->unk_A8); - if (PoketchData_CalendarMarked(param0->poketchData, param0->unk_04.unk_00, v0 + 1)) { - PoketchData_ClearCalendarMark(param0->poketchData, param0->unk_04.unk_00, v0 + 1); + if (PoketchData_CalendarMarked(param0->poketch, param0->unk_04.unk_00, v0 + 1)) { + PoketchData_ClearCalendarMark(param0->poketch, param0->unk_04.unk_00, v0 + 1); } else { - PoketchData_SetCalendarMark(param0->poketchData, param0->unk_04.unk_00, v0 + 1); + PoketchData_SetCalendarMark(param0->poketch, param0->unk_04.unk_00, v0 + 1); } param0->unk_04.unk_0C[v0].unk_03 ^= 1; diff --git a/src/overlay054/ov54_022561C0.c b/src/overlay054/ov54_022561C0.c index fc053809c7..e5c20cdeed 100644 --- a/src/overlay054/ov54_022561C0.c +++ b/src/overlay054/ov54_022561C0.c @@ -115,15 +115,15 @@ static BOOL ov54_0225621C(UnkStruct_ov54_0225621C *param0, PoketchSystem *poketc ((48 + 40 * 0) - (48 / 2)), ((48 + 40 * 0) + (48 / 2)) } }; - PoketchData *poketchData; + Poketch *poketch; int v2; - poketchData = PoketchSystem_GetPoketchData(poketchSys); - param0->unk_04.unk_90 = PoketchData_PokemonHistorySize(poketchData); + poketch = PoketchSystem_GetPoketchData(poketchSys); + param0->unk_04.unk_90 = PoketchData_PokemonHistorySize(poketch); for (v2 = 0; v2 < param0->unk_04.unk_90; v2++) { - PoketchData_PokemonHistorySpeciesAndIcon(poketchData, v2, &(param0->unk_04.unk_00[v2].unk_00), &(param0->unk_04.unk_00[v2].unk_08)); - param0->unk_04.unk_00[v2].unk_04 = PoketchData_PokemonHistoryForm(poketchData, v2); + PoketchData_PokemonHistorySpeciesAndIcon(poketch, v2, &(param0->unk_04.unk_00[v2].unk_00), &(param0->unk_04.unk_00[v2].unk_08)); + param0->unk_04.unk_00[v2].unk_04 = PoketchData_PokemonHistoryForm(poketch, v2); } if (ov54_0225642C(&(param0->unk_98), &(param0->unk_04), param2)) { diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index 7c71370dad..2d7f6a9a19 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -2311,7 +2311,7 @@ static void ov66_0222F7C8(UnkStruct_ov66_0222F6C4 *param0, SaveData *param1, u32 { v0 = SaveData_GetTrainerInfo(param1); v1 = Party_GetFromSavedata(param1); - v3 = SaveData_PokedexData(param1); + v3 = SaveData_Pokedex(param1); v2 = sub_0202C878(param1); v4 = SaveData_GetGameTime(param1); } diff --git a/src/overlay097/ov97_0222AE60.c b/src/overlay097/ov97_0222AE60.c index 3dfb561205..adab601bdb 100644 --- a/src/overlay097/ov97_0222AE60.c +++ b/src/overlay097/ov97_0222AE60.c @@ -598,7 +598,7 @@ static BOOL ov97_0222B5C0(void *param0, int param1, UnkStruct_ov97_02237808 *par ov97_0222B53C(param2->unk_10, v5, v4, v7, 19, 16 * 3); if (v6->unk_4C) { - ov97_0222B590(v4, PokedexData_CountSeen(v6->unk_08)); + ov97_0222B590(v4, Pokedex_CountSeen(v6->unk_08)); ov97_0222B53C(param2->unk_10, v5, v4, v7, 18, 16 * 4); } @@ -987,9 +987,9 @@ static int ov97_0222BD70(OverlayManager *param0, int *param1) v0->unk_11C = FX32_ONE * 0; v0->unk_120 = FX32_ONE * 0; v0->unk_0C = SaveData_GetTrainerInfo(v0->unk_04); - v0->unk_08 = SaveData_PokedexData(v0->unk_04); + v0->unk_08 = SaveData_Pokedex(v0->unk_04); v0->playTime = SaveData_GetPlayTime(v0->unk_04); - v0->unk_4C = PokedexData_IsObtained(v0->unk_08); + v0->unk_4C = Pokedex_IsObtained(v0->unk_08); v0->unk_50 = TrainerInfo_BadgeCount(v0->unk_0C); v0->unk_12C = 15; diff --git a/src/overlay097/ov97_0222C174.c b/src/overlay097/ov97_0222C174.c index 6f900df319..98d347b35a 100644 --- a/src/overlay097/ov97_0222C174.c +++ b/src/overlay097/ov97_0222C174.c @@ -681,7 +681,7 @@ static int ov97_0222C6F8(OverlayManager *param0, int *param1) v0->unk_04 = BgConfig_New(v0->unk_00); v0->unk_08 = ((ApplicationArgs *)OverlayManager_Args(param0))->saveData; v0->unk_10 = SaveData_GetTrainerInfo(v0->unk_08); - v0->unk_0C = SaveData_PokedexData(v0->unk_08); + v0->unk_0C = SaveData_Pokedex(v0->unk_08); v0->unk_14 = SaveData_Options(v0->unk_08); ov97_02237694(v0->unk_00); @@ -707,7 +707,7 @@ static int ov97_0222C78C(OverlayManager *param0, int *param1) case UnkEnum_ov97_0222C78C_00: ov97_0222C254(v0); - if (PokedexData_IsObtained(v0->unk_0C) == FALSE) { + if (Pokedex_IsObtained(v0->unk_0C) == FALSE) { ov97_02237790(1, UnkEnum_ov97_0222C78C_01, param1, UnkEnum_ov97_0222C78C_13); } else { *param1 = UnkEnum_ov97_0222C78C_02; diff --git a/src/overlay118/ov118_021D0D80.c b/src/overlay118/ov118_021D0D80.c index d4f73e26cd..dbd275d8a8 100644 --- a/src/overlay118/ov118_021D0D80.c +++ b/src/overlay118/ov118_021D0D80.c @@ -93,7 +93,7 @@ int ov118_021D0DBC(GameWindowLayout *param0) break; } - PokedexData_Capture(SaveData_PokedexData(FieldSystem_GetSaveData(param0->unk_5A4->unk_1C)), v1); + PokedexData_Capture(SaveData_Pokedex(FieldSystem_GetSaveData(param0->unk_5A4->unk_1C)), v1); } v0->unk_00++; break; diff --git a/src/party.c b/src/party.c index 158f318909..e5037b0f15 100644 --- a/src/party.c +++ b/src/party.c @@ -125,7 +125,7 @@ BOOL Party_SwapSlots(Party *party, int slotA, int slotB) return FALSE; } -void Party_cpy(const Party *src, Party *dest) +void Party_Copy(const Party *src, Party *dest) { *dest = *src; } diff --git a/src/pokedex_data.c b/src/pokedex_data.c index a28c4572b1..1716a92253 100644 --- a/src/pokedex_data.c +++ b/src/pokedex_data.c @@ -36,7 +36,7 @@ static const u16 sExcludedMonsLocal[] = {}; #define DEOXYS_COUNT 4 #define ROTOM_COUNT 6 -typedef struct PokedexData { +typedef struct Pokedex { u32 magic; u32 caughtPokemon[DEX_SIZE_U32]; u32 seenPokemon[DEX_SIZE_U32]; @@ -55,27 +55,27 @@ typedef struct PokedexData { u32 rotomFormsSeen; u8 shayminFormsSeen; u8 giratinaFormsSeen; -} PokedexData; +} Pokedex; -int PokedexData_SaveSize(void) +int Pokedex_SaveSize(void) { - return sizeof(PokedexData); + return sizeof(Pokedex); } -PokedexData *PokedexData_Alloc(u32 heapID) +Pokedex *Pokedex_New(u32 heapID) { - PokedexData *pokedexData = Heap_AllocFromHeap(heapID, sizeof(PokedexData)); - PokedexData_Init(pokedexData); + Pokedex *pokedexData = Heap_AllocFromHeap(heapID, sizeof(Pokedex)); + Pokedex_Init(pokedexData); return pokedexData; } -void PokedexData_Copy(const PokedexData *src, PokedexData *dest) +void Pokedex_Copy(const Pokedex *src, Pokedex *dest) { - MI_CpuCopy8(src, dest, sizeof(PokedexData)); + MI_CpuCopy8(src, dest, sizeof(Pokedex)); } -static inline void CheckPokedexIntegrity(const PokedexData *pokedexData) +static inline void CheckPokedexIntegrity(const Pokedex *pokedexData) { GF_ASSERT(pokedexData->magic == MAGIC_NUMBER); } @@ -125,17 +125,17 @@ static inline void SetBit_3Forms(u8 *array, u8 value, u16 bitIndex) array[bitIndex >> 2] |= value << ((bitIndex & 0x03) * 2); } -static inline void Write_SeenSpecies(PokedexData *pokedexData, u16 species) +static inline void Write_SeenSpecies(Pokedex *pokedexData, u16 species) { ActivateBit_2Forms((u8 *)pokedexData->seenPokemon, species); } -static inline void Write_CaughtSpecies(PokedexData *pokedexData, u16 species) +static inline void Write_CaughtSpecies(Pokedex *pokedexData, u16 species) { ActivateBit_2Forms((u8 *)pokedexData->caughtPokemon, species); } -static void SetBit_Gender(PokedexData *pokedexData, u8 gender, u8 isSeen, u16 bitIndex) +static void SetBit_Gender(Pokedex *pokedexData, u8 gender, u8 isSeen, u16 bitIndex) { if (isSeen == FALSE) { SetBit_2Forms((u8 *)pokedexData->recordedGenders[1], gender, bitIndex); @@ -144,7 +144,7 @@ static void SetBit_Gender(PokedexData *pokedexData, u8 gender, u8 isSeen, u16 bi SetBit_2Forms((u8 *)pokedexData->recordedGenders[isSeen], gender, bitIndex); } -static void UpdateGender(PokedexData *pokedexData, u8 gender, u8 isSeen, u16 bitIndex) +static void UpdateGender(Pokedex *pokedexData, u8 gender, u8 isSeen, u16 bitIndex) { GF_ASSERT(gender <= GENDER_NONE); @@ -155,29 +155,29 @@ static void UpdateGender(PokedexData *pokedexData, u8 gender, u8 isSeen, u16 bit SetBit_Gender(pokedexData, gender, isSeen, bitIndex); } -static inline BOOL SpeciesSeen(const PokedexData *pokedexData, u16 species) +static inline BOOL SpeciesSeen(const Pokedex *pokedexData, u16 species) { return ReadBit_2Forms((const u8 *)pokedexData->seenPokemon, species); } -static inline BOOL SpeciesCaught(const PokedexData *pokedexData, u16 species) +static inline BOOL SpeciesCaught(const Pokedex *pokedexData, u16 species) { return ReadBit_2Forms((const u8 *)pokedexData->caughtPokemon, species); } -static inline u8 GetGender(const PokedexData *pokedexData, u16 species, u8 bitIndex) +static inline u8 GetGender(const Pokedex *pokedexData, u16 species, u8 bitIndex) { return ReadBit_2Forms((const u8 *)pokedexData->recordedGenders[bitIndex], species); } -static inline void SetForm_Spinda(PokedexData *pokedexData, u16 species, u32 personality) +static inline void SetForm_Spinda(Pokedex *pokedexData, u16 species, u32 personality) { if (species == SPECIES_SPINDA) { pokedexData->spindaForm = personality; } } -static int NumFormsSeen_Unown(const PokedexData *pokedexData) +static int NumFormsSeen_Unown(const Pokedex *pokedexData) { int formIndex; @@ -190,7 +190,7 @@ static int NumFormsSeen_Unown(const PokedexData *pokedexData) return formIndex; } -static BOOL UnownFormSeen(const PokedexData *pokedexData, u8 form) +static BOOL UnownFormSeen(const Pokedex *pokedexData, u8 form) { for (int formIndex = 0; formIndex < UNOWN_COUNT; formIndex++) { if (pokedexData->unownFormsSeen[formIndex] == form) { @@ -201,7 +201,7 @@ static BOOL UnownFormSeen(const PokedexData *pokedexData, u8 form) return FALSE; } -static void SetUnownForm(PokedexData *pokedexData, int form) +static void SetUnownForm(Pokedex *pokedexData, int form) { if (UnownFormSeen(pokedexData, form)) { return; @@ -214,7 +214,7 @@ static void SetUnownForm(PokedexData *pokedexData, int form) } } -static int NumFormsSeen_TwoForms(const PokedexData *pokedexData, u32 species) +static int NumFormsSeen_TwoForms(const Pokedex *pokedexData, u32 species) { GF_ASSERT((species == SPECIES_SHELLOS) || (species == SPECIES_GASTRODON) || (species == SPECIES_SHAYMIN) || (species == SPECIES_GIRATINA)); @@ -248,7 +248,7 @@ static int NumFormsSeen_TwoForms(const PokedexData *pokedexData, u32 species) return 2; } -static BOOL FormSeen_TwoForms(const PokedexData *pokedexData, u32 species, u8 form) +static BOOL FormSeen_TwoForms(const Pokedex *pokedexData, u32 species, u8 form) { GF_ASSERT((species == SPECIES_SHELLOS) || (species == SPECIES_GASTRODON) || (species == SPECIES_SHAYMIN) || (species == SPECIES_GIRATINA)); @@ -285,7 +285,7 @@ static BOOL FormSeen_TwoForms(const PokedexData *pokedexData, u32 species, u8 fo return FALSE; } -static void UpdateForms_TwoForms(PokedexData *pokedexData, u32 species, int form) +static void UpdateForms_TwoForms(Pokedex *pokedexData, u32 species, int form) { GF_ASSERT((species == SPECIES_SHELLOS) || (species == SPECIES_GASTRODON) || (species == SPECIES_SHAYMIN) || (species == SPECIES_GIRATINA)); @@ -320,7 +320,7 @@ static void UpdateForms_TwoForms(PokedexData *pokedexData, u32 species, int form } } -static int NumFormsSeen_ThreeForms(const PokedexData *pokedexData, u32 species) +static int NumFormsSeen_ThreeForms(const Pokedex *pokedexData, u32 species) { GF_ASSERT((species == SPECIES_BURMY) || (species == SPECIES_WORMADAM)); @@ -347,7 +347,7 @@ static int NumFormsSeen_ThreeForms(const PokedexData *pokedexData, u32 species) return formIndex; } -static BOOL FormSeen_ThreeForms(const PokedexData *pokedexData, u32 species, u8 form) +static BOOL FormSeen_ThreeForms(const Pokedex *pokedexData, u32 species, u8 form) { GF_ASSERT((species == SPECIES_BURMY) || (species == SPECIES_WORMADAM)); @@ -373,7 +373,7 @@ static BOOL FormSeen_ThreeForms(const PokedexData *pokedexData, u32 species, u8 return FALSE; } -static void UpdateForms_ThreeForms(PokedexData *pokedexData, u32 species, int form) +static void UpdateForms_ThreeForms(Pokedex *pokedexData, u32 species, int form) { GF_ASSERT((species == SPECIES_BURMY) || (species == SPECIES_WORMADAM)); @@ -404,7 +404,7 @@ static void WriteBit_Deoxys(u32 *array, u8 value, u8 bitIndex) array[DEX_SIZE_U32 - 1] |= (value << bitOffset); } -static void UpdateFormArray_Deoxys(PokedexData *pokedexData, u8 form, u8 bitIndex) +static void UpdateFormArray_Deoxys(Pokedex *pokedexData, u8 form, u8 bitIndex) { // Deoxys forms are currently stored in spare bits in these arrays // This will want to be changed when modding to avoid overlapping references @@ -425,7 +425,7 @@ static inline u32 ReadBit_Deoxys(const u32 *array, u8 bitIndex) return (array[DEX_SIZE_U32 - 1] >> bitOffset) & 0x0F; } -static u32 GetForm_Deoxys(const PokedexData *pokedexData, u8 formIndex) +static u32 GetForm_Deoxys(const Pokedex *pokedexData, u8 formIndex) { // Deoxys forms are currently stored in spare bits in these arrays // This will want to be changed when modding to avoid overlapping references @@ -440,7 +440,7 @@ static u32 GetForm_Deoxys(const PokedexData *pokedexData, u8 formIndex) return form; } -static u32 NumFormsSeen_Deoxys(const PokedexData *pokedexData) +static u32 NumFormsSeen_Deoxys(const Pokedex *pokedexData) { int formIndex; @@ -453,7 +453,7 @@ static u32 NumFormsSeen_Deoxys(const PokedexData *pokedexData) return formIndex; } -static BOOL FormSeen_Deoxys(const PokedexData *pokedexData, u32 form) +static BOOL FormSeen_Deoxys(const Pokedex *pokedexData, u32 form) { for (int formIndex = 0; formIndex < DEOXYS_COUNT; formIndex++) { if (GetForm_Deoxys(pokedexData, formIndex) == form) { @@ -464,7 +464,7 @@ static BOOL FormSeen_Deoxys(const PokedexData *pokedexData, u32 form) return FALSE; } -static void UpdateForms_Deoxys(PokedexData *pokedexData, u16 species, Pokemon *pokemon) +static void UpdateForms_Deoxys(Pokedex *pokedexData, u16 species, Pokemon *pokemon) { u8 form = Pokemon_GetValue(pokemon, MON_DATA_FORM, NULL); @@ -476,7 +476,7 @@ static void UpdateForms_Deoxys(PokedexData *pokedexData, u16 species, Pokemon *p } } -static void InitDeoxys(PokedexData *pokedexData) +static void InitDeoxys(Pokedex *pokedexData) { for (int formIndex = 0; formIndex < DEOXYS_COUNT; formIndex++) { UpdateFormArray_Deoxys(pokedexData, 0x0F, formIndex); @@ -496,7 +496,7 @@ static inline void SetBit_Rotom(u32 *formArray, u32 formIndex, u32 form) (*formArray) |= (form << (formIndex * 3)); } -static int NumFormsSeen_Rotom(const PokedexData *pokedexData, u32 species) +static int NumFormsSeen_Rotom(const Pokedex *pokedexData, u32 species) { GF_ASSERT(species == SPECIES_ROTOM); @@ -521,7 +521,7 @@ static int NumFormsSeen_Rotom(const PokedexData *pokedexData, u32 species) return numFormsSeen; } -static BOOL FormSeen_Rotom(const PokedexData *pokedexData, u32 species, u8 form) +static BOOL FormSeen_Rotom(const Pokedex *pokedexData, u32 species, u8 form) { GF_ASSERT(species == SPECIES_ROTOM); @@ -543,7 +543,7 @@ static BOOL FormSeen_Rotom(const PokedexData *pokedexData, u32 species, u8 form) return FALSE; } -static void UpdateForms_Rotom(PokedexData *pokedexData, u32 species, int form) +static void UpdateForms_Rotom(Pokedex *pokedexData, u32 species, int form) { int numFormsSeen; @@ -560,7 +560,7 @@ static void UpdateForms_Rotom(PokedexData *pokedexData, u32 species, int form) } } -static void UpdateForm(PokedexData *pokedexData, u16 species, Pokemon *pokemon) +static void UpdateForm(Pokedex *pokedexData, u16 species, Pokemon *pokemon) { int form; @@ -603,7 +603,7 @@ static void UpdateForm(PokedexData *pokedexData, u16 species, Pokemon *pokemon) } } -static void UpdateLanguage(PokedexData *pokedexData, u16 species, u32 language) +static void UpdateLanguage(Pokedex *pokedexData, u16 species, u32 language) { int bitIndex = species; int languageIndex = PokedexLanguage_LanguageToIndex(language); @@ -615,7 +615,7 @@ static void UpdateLanguage(PokedexData *pokedexData, u16 species, u32 language) pokedexData->recordedLanguages[bitIndex] |= 1 << languageIndex; } -static u32 GetDisplayGender(const PokedexData *pokedexData, u16 species, int displaySecondary) +static u32 GetDisplayGender(const Pokedex *pokedexData, u16 species, int displaySecondary) { u32 defaultGender, secondaryGender; u32 displayGender; @@ -645,12 +645,12 @@ static u32 GetDisplayGender(const PokedexData *pokedexData, u16 species, int dis return displayGender; } -static inline int GetForm_Unown(const PokedexData *pokedexData, int formIndex) +static inline int GetForm_Unown(const Pokedex *pokedexData, int formIndex) { return pokedexData->unownFormsSeen[formIndex]; } -static int GetForm_TwoForms(const PokedexData *pokedexData, u32 species, int formIndex) +static int GetForm_TwoForms(const Pokedex *pokedexData, u32 species, int formIndex) { const u8 *formArray; @@ -675,7 +675,7 @@ static int GetForm_TwoForms(const PokedexData *pokedexData, u32 species, int for return ReadBit_2Forms(formArray, formIndex + 1); } -static int GetForm_Rotom(const PokedexData *pokedexData, u32 species, int formIndex) +static int GetForm_Rotom(const Pokedex *pokedexData, u32 species, int formIndex) { GF_ASSERT(species == SPECIES_ROTOM); GF_ASSERT(formIndex < ROTOM_COUNT); @@ -683,7 +683,7 @@ static int GetForm_Rotom(const PokedexData *pokedexData, u32 species, int formIn return ReadBit_Rotom(pokedexData->rotomFormsSeen, formIndex); } -static int GetForm_3Forms(const PokedexData *pokedexData, u32 species, int formIndex) +static int GetForm_3Forms(const Pokedex *pokedexData, u32 species, int formIndex) { const u8 *formArray; @@ -726,9 +726,9 @@ static BOOL CountsForDexCompletion_Local(u16 species) return included; } -void PokedexData_Init(PokedexData *pokedexData) +void Pokedex_Init(Pokedex *pokedexData) { - memset(pokedexData, 0, sizeof(PokedexData)); + memset(pokedexData, 0, sizeof(Pokedex)); pokedexData->magic = MAGIC_NUMBER; pokedexData->nationalDexObtained = FALSE; @@ -746,7 +746,7 @@ void PokedexData_Init(PokedexData *pokedexData) InitDeoxys(pokedexData); } -u16 PokedexData_CountCaught_National(const PokedexData *pokedexData) +u16 Pokedex_CountCaught_National(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); @@ -761,7 +761,7 @@ u16 PokedexData_CountCaught_National(const PokedexData *pokedexData) return caughtCount; } -u16 PokedexData_CountSeen_National(const PokedexData *pokedex) +u16 Pokedex_CountSeen_National(const Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); @@ -776,16 +776,16 @@ u16 PokedexData_CountSeen_National(const PokedexData *pokedex) return seenCount; } -u16 PokedexData_CountSeen(const PokedexData *pokedex) +u16 Pokedex_CountSeen(const Pokedex *pokedex) { if (PokedexData_IsNationalDexObtained(pokedex)) { - return PokedexData_CountSeen_National(pokedex); + return Pokedex_CountSeen_National(pokedex); } return PokedexData_CountSeen_Local(pokedex); } -u16 PokedexData_CountCaught_Local(const PokedexData *pokedexData) +u16 PokedexData_CountCaught_Local(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); @@ -802,7 +802,7 @@ u16 PokedexData_CountCaught_Local(const PokedexData *pokedexData) return caughtCount; } -u16 PokedexData_CountSeen_Local(const PokedexData *pokedex) +u16 PokedexData_CountSeen_Local(const Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); @@ -817,7 +817,7 @@ u16 PokedexData_CountSeen_Local(const PokedexData *pokedex) return seenCount; } -BOOL PokedexData_NationalDexCompleted(const PokedexData *pokedexData) +BOOL PokedexData_NationalDexCompleted(const Pokedex *pokedexData) { u16 numCaught = PokedexData_NumCaught_National(pokedexData); @@ -828,7 +828,7 @@ BOOL PokedexData_NationalDexCompleted(const PokedexData *pokedexData) return FALSE; } -BOOL PokedexData_LocalDexCompleted(const PokedexData *pokedexData) +BOOL PokedexData_LocalDexCompleted(const Pokedex *pokedexData) { u16 numCaught = PokedexData_NumCaught_Local(pokedexData); @@ -839,7 +839,7 @@ BOOL PokedexData_LocalDexCompleted(const PokedexData *pokedexData) return FALSE; } -u16 PokedexData_NumCaught_National(const PokedexData *pokedexData) +u16 PokedexData_NumCaught_National(const Pokedex *pokedexData) { int species; u16 numCaught = 0; @@ -855,7 +855,7 @@ u16 PokedexData_NumCaught_National(const PokedexData *pokedexData) return numCaught; } -u16 PokedexData_NumCaught_Local(const PokedexData *pokedexData) +u16 PokedexData_NumCaught_Local(const Pokedex *pokedexData) { int species; u16 numCaught = 0; @@ -872,7 +872,7 @@ u16 PokedexData_NumCaught_Local(const PokedexData *pokedexData) return numCaught; } -BOOL PokedexData_HasCaughtSpecies(const PokedexData *pokedex, u16 species) +BOOL PokedexData_HasCaughtSpecies(const Pokedex *pokedex, u16 species) { CheckPokedexIntegrity(pokedex); @@ -887,7 +887,7 @@ BOOL PokedexData_HasCaughtSpecies(const PokedexData *pokedex, u16 species) } } -BOOL PokedexData_HasSeenSpecies(const PokedexData *pokedex, u16 species) +BOOL PokedexData_HasSeenSpecies(const Pokedex *pokedex, u16 species) { CheckPokedexIntegrity(pokedex); @@ -898,7 +898,7 @@ BOOL PokedexData_HasSeenSpecies(const PokedexData *pokedex, u16 species) return SpeciesSeen(pokedex, species); } -u32 PokedexData_GetForm_Spinda(const PokedexData *pokedexData, u8 formIndex) +u32 PokedexData_GetForm_Spinda(const Pokedex *pokedexData, u8 formIndex) { CheckPokedexIntegrity(pokedexData); @@ -915,7 +915,7 @@ u32 PokedexData_GetForm_Spinda(const PokedexData *pokedexData, u8 formIndex) return form; } -u32 PokedexData_DisplayedGender(const PokedexData *pokedexData, u16 species, int displaySecondary) +u32 PokedexData_DisplayedGender(const Pokedex *pokedexData, u16 species, int displaySecondary) { CheckPokedexIntegrity(pokedexData); @@ -930,7 +930,7 @@ u32 PokedexData_DisplayedGender(const PokedexData *pokedexData, u16 species, int return GetDisplayGender(pokedexData, species, displaySecondary); } -u32 PokedexData_GetForm_Unown(const PokedexData *pokedexData, int formIndex) +u32 PokedexData_GetForm_Unown(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -941,13 +941,13 @@ u32 PokedexData_GetForm_Unown(const PokedexData *pokedexData, int formIndex) return GetForm_Unown(pokedexData, formIndex); } -u32 PokedexData_NumFormsSeen_Unown(const PokedexData *pokedexData) +u32 PokedexData_NumFormsSeen_Unown(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_Unown(pokedexData); } -u32 PokedexData_GetForm_Shellos(const PokedexData *pokedexData, int formIndex) +u32 PokedexData_GetForm_Shellos(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -958,13 +958,13 @@ u32 PokedexData_GetForm_Shellos(const PokedexData *pokedexData, int formIndex) return GetForm_TwoForms(pokedexData, SPECIES_SHELLOS, formIndex); } -u32 PokedexData_NumFormsSeen_Shellos(const PokedexData *pokedexData) +u32 PokedexData_NumFormsSeen_Shellos(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_TwoForms(pokedexData, SPECIES_SHELLOS); } -u32 PokedexData_GetForm_Gastrodon(const PokedexData *pokedexData, int formIndex) +u32 PokedexData_GetForm_Gastrodon(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -975,13 +975,13 @@ u32 PokedexData_GetForm_Gastrodon(const PokedexData *pokedexData, int formIndex) return GetForm_TwoForms(pokedexData, SPECIES_GASTRODON, formIndex); } -u32 PokedexData_NumFormsSeen_Gastrodon(const PokedexData *pokedexData) +u32 PokedexData_NumFormsSeen_Gastrodon(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_TwoForms(pokedexData, SPECIES_GASTRODON); } -u32 PokedexData_GetForm_Burmy(const PokedexData *pokedexData, int formIndex) +u32 PokedexData_GetForm_Burmy(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -992,13 +992,13 @@ u32 PokedexData_GetForm_Burmy(const PokedexData *pokedexData, int formIndex) return GetForm_3Forms(pokedexData, SPECIES_BURMY, formIndex); } -u32 PokedexData_NumFormsSeen_Burmy(const PokedexData *pokedexData) +u32 PokedexData_NumFormsSeen_Burmy(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_ThreeForms(pokedexData, SPECIES_BURMY); } -u32 PokedexData_GetForm_Wormadam(const PokedexData *pokedexData, int formIndex) +u32 PokedexData_GetForm_Wormadam(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -1009,25 +1009,25 @@ u32 PokedexData_GetForm_Wormadam(const PokedexData *pokedexData, int formIndex) return GetForm_3Forms(pokedexData, SPECIES_WORMADAM, formIndex); } -u32 PokedexData_NumFormsSeen_Wormadam(const PokedexData *pokedexData) +u32 PokedexData_NumFormsSeen_Wormadam(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_ThreeForms(pokedexData, SPECIES_WORMADAM); } -u32 PokedexData_GetForm_Deoxys(const PokedexData *pokedexData, int formIndex) +u32 PokedexData_GetForm_Deoxys(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); return GetForm_Deoxys(pokedexData, formIndex); } -u32 PokedexData_NumFormsSeen_Deoxys(const PokedexData *pokedexData) +u32 PokedexData_NumFormsSeen_Deoxys(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_Deoxys(pokedexData); } -void PokedexData_Encounter(PokedexData *pokedexData, Pokemon *pokemon) +void Pokedex_Encounter(Pokedex *pokedexData, Pokemon *pokemon) { u16 species = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); u32 personality = Pokemon_GetValue(pokemon, MON_DATA_PERSONALITY, NULL); @@ -1054,7 +1054,7 @@ void PokedexData_Encounter(PokedexData *pokedexData, Pokemon *pokemon) Write_SeenSpecies(pokedexData, species); } -void PokedexData_Capture(PokedexData *pokedexData, Pokemon *pokemon) +void PokedexData_Capture(Pokedex *pokedexData, Pokemon *pokemon) { u16 species = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); u32 language = Pokemon_GetValue(pokemon, MON_DATA_LANGUAGE, NULL); @@ -1085,31 +1085,31 @@ void PokedexData_Capture(PokedexData *pokedexData, Pokemon *pokemon) Write_SeenSpecies(pokedexData, species); } -void PokedexData_ObtainNationalDex(PokedexData *pokedexData) +void PokedexData_ObtainNationalDex(Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); pokedexData->nationalDexObtained = TRUE; } -BOOL PokedexData_IsNationalDexObtained(const PokedexData *pokedex) +BOOL PokedexData_IsNationalDexObtained(const Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); return pokedex->nationalDexObtained; } -BOOL PokedexData_CanDetectForms(const PokedexData *pokedexData) +BOOL PokedexData_CanDetectForms(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return pokedexData->canDetectForms; } -void PokedexData_TurnOnFormDetection(PokedexData *pokedexData) +void PokedexData_TurnOnFormDetection(Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); pokedexData->canDetectForms = TRUE; } -BOOL PokedexData_IsLanguageObtained(const PokedexData *pokedexData, u16 species, u32 languageIndex) +BOOL PokedexData_IsLanguageObtained(const Pokedex *pokedexData, u16 species, u32 languageIndex) { int bitIndex; @@ -1123,35 +1123,35 @@ BOOL PokedexData_IsLanguageObtained(const PokedexData *pokedexData, u16 species, return pokedexData->recordedLanguages[bitIndex] & (1 << languageIndex); } -void PokedexData_TurnOnLanguageDetection(PokedexData *pokedexData) +void PokedexData_TurnOnLanguageDetection(Pokedex *pokedexData) { pokedexData->canDetectLanguages = TRUE; } -BOOL PokedexData_CanDetectLanguages(const PokedexData *pokedexData) +BOOL PokedexData_CanDetectLanguages(const Pokedex *pokedexData) { return pokedexData->canDetectLanguages; } -BOOL PokedexData_IsObtained(const PokedexData *pokedex) +BOOL Pokedex_IsObtained(const Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); return pokedex->pokedexObtained; } -void PokedexData_ObtainPokedex(PokedexData *pokedex) +void PokedexData_ObtainPokedex(Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); pokedex->pokedexObtained = TRUE; } -PokedexData *SaveData_PokedexData(SaveData *saveData) +Pokedex *SaveData_Pokedex(SaveData *saveData) { - PokedexData *pokedex = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_POKEDEX); + Pokedex *pokedex = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_POKEDEX); return pokedex; } -u32 PokedexData_GetDisplayForm(const PokedexData *pokedexData, int species, int formIndex) +u32 Pokedex_GetDisplayForm(const Pokedex *pokedexData, int species, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -1208,7 +1208,7 @@ u32 PokedexData_GetDisplayForm(const PokedexData *pokedexData, int species, int return 0; } -u32 PokedexData_NumFormsSeen(const PokedexData *pokedex, int species) +u32 PokedexData_NumFormsSeen(const Pokedex *pokedex, int species) { CheckPokedexIntegrity(pokedex); diff --git a/src/poketch_data.c b/src/poketch_data.c index 05650c230e..ad40c3a565 100644 --- a/src/poketch_data.c +++ b/src/poketch_data.c @@ -11,7 +11,7 @@ int Poketch_SaveSize(void) { - return sizeof(PoketchData); + return sizeof(Poketch); } static const struct { @@ -26,68 +26,68 @@ static const struct { { 184, 152 } }; -void Poketch_Init(PoketchData *poketchData) +void Poketch_Init(Poketch *poketch) { int i; for (i = 0; i < POKETCH_REGISTRY_SIZE; i++) { - poketchData->appRegistry[i] = 0; + poketch->appRegistry[i] = 0; } - poketchData->appCount = 0; - poketchData->appIndex = 0; - poketchData->poketchEnabled = 0; - poketchData->screenColor = 0; - poketchData->pedometerEnabled = 0; - poketchData->stepCount = 0; - poketchData->alarmSet = 0; - poketchData->alarmHour = 0; - poketchData->alarmMinute = 0; - poketchData->calendarMonth = 1; - poketchData->calendarMarkBitmap = 0; + poketch->appCount = 0; + poketch->appIndex = 0; + poketch->poketchEnabled = 0; + poketch->screenColor = 0; + poketch->pedometerEnabled = 0; + poketch->stepCount = 0; + poketch->alarmSet = 0; + poketch->alarmHour = 0; + poketch->alarmMinute = 0; + poketch->calendarMonth = 1; + poketch->calendarMarkBitmap = 0; for (i = 0; i < POKETCH_MAPMARKER_COUNT; i++) { - poketchData->markMapPositions[i].x = sDefaultMapMarkers[i].x; - poketchData->markMapPositions[i].y = sDefaultMapMarkers[i].y; + poketch->markMapPositions[i].x = sDefaultMapMarkers[i].x; + poketch->markMapPositions[i].y = sDefaultMapMarkers[i].y; } for (i = 0; i < POKETCH_POKEMONHISTORY_MAX; i++) { - poketchData->pokemonHistoryQueue[i].species = 0; - poketchData->pokemonHistoryQueue[i].icon = 0; - poketchData->pokemonHistoryQueue[i].form = 0; + poketch->pokemonHistoryQueue[i].species = 0; + poketch->pokemonHistoryQueue[i].icon = 0; + poketch->pokemonHistoryQueue[i].form = 0; } - poketchData->dotArtModifiedByPlayer = 0; - PoketchData_RegisterApp(poketchData, POKETCH_APPID_DIGITALWATCH); + poketch->dotArtModifiedByPlayer = 0; + PoketchData_RegisterApp(poketch, POKETCH_APPID_DIGITALWATCH); } -void PoketchData_Enable(PoketchData *poketchData) +void PoketchData_Enable(Poketch *poketch) { - poketchData->poketchEnabled = 1; + poketch->poketchEnabled = 1; } -BOOL PoketchData_IsEnabled(PoketchData *poketchData) +BOOL PoketchData_IsEnabled(Poketch *poketch) { - return poketchData->poketchEnabled; + return poketch->poketchEnabled; } -BOOL PoketchData_IsAppRegistered(PoketchData *poketchData, enum PoketchAppID appID) +BOOL PoketchData_IsAppRegistered(Poketch *poketch, enum PoketchAppID appID) { - return poketchData->appRegistry[appID]; + return poketch->appRegistry[appID]; } -BOOL PoketchData_RegisterApp(PoketchData *poketchData, enum PoketchAppID appID) +BOOL PoketchData_RegisterApp(Poketch *poketch, enum PoketchAppID appID) { BOOL appRegistered = FALSE; GF_ASSERT(appID >= 0 && appID < POKETCH_APPID_MAX); - if (poketchData->appCount < POKETCH_APPID_MAX && poketchData->appRegistry[appID] == 0) { - poketchData->appRegistry[appID] = 1; - poketchData->appCount++; + if (poketch->appCount < POKETCH_APPID_MAX && poketch->appRegistry[appID] == 0) { + poketch->appRegistry[appID] = 1; + poketch->appCount++; if (appID == POKETCH_APPID_PEDOMETER) { - poketchData->pedometerEnabled = 1; + poketch->pedometerEnabled = 1; } appRegistered = TRUE; @@ -96,190 +96,190 @@ BOOL PoketchData_RegisterApp(PoketchData *poketchData, enum PoketchAppID appID) return appRegistered; } -enum PoketchAppID PoketchData_CurrentAppID(const PoketchData *poketchData) +enum PoketchAppID PoketchData_CurrentAppID(const Poketch *poketch) { - return poketchData->appIndex; + return poketch->appIndex; } -int PoketchData_IncrementAppID(PoketchData *poketchData) +int PoketchData_IncrementAppID(Poketch *poketch) { - int nextIndex = poketchData->appIndex; + int nextIndex = poketch->appIndex; while (TRUE) { if (++nextIndex >= POKETCH_APPID_MAX) { nextIndex = 0; } - if (nextIndex == poketchData->appIndex) { + if (nextIndex == poketch->appIndex) { break; } - if (poketchData->appRegistry[nextIndex]) { + if (poketch->appRegistry[nextIndex]) { break; } } - poketchData->appIndex = nextIndex; + poketch->appIndex = nextIndex; - return poketchData->appIndex; + return poketch->appIndex; } -int PoketchData_DecrementAppID(PoketchData *poketchData) +int PoketchData_DecrementAppID(Poketch *poketch) { - int prevIndex = poketchData->appIndex; + int prevIndex = poketch->appIndex; while (TRUE) { if (--prevIndex < 0) { prevIndex = POKETCH_APPID_MAX - 1; } - if (prevIndex == poketchData->appIndex) { + if (prevIndex == poketch->appIndex) { break; } - if (poketchData->appRegistry[prevIndex]) { + if (poketch->appRegistry[prevIndex]) { break; } } - poketchData->appIndex = prevIndex; + poketch->appIndex = prevIndex; - return poketchData->appIndex; + return poketch->appIndex; } -u32 PoketchData_CurrentScreenColor(const PoketchData *poketchData) +u32 PoketchData_CurrentScreenColor(const Poketch *poketch) { - GF_ASSERT(poketchData); - return poketchData->screenColor; + GF_ASSERT(poketch); + return poketch->screenColor; } -void PoketchData_SetScreenColor(PoketchData *poketchData, u32 screenColor) +void PoketchData_SetScreenColor(Poketch *poketch, u32 screenColor) { - GF_ASSERT(poketchData); + GF_ASSERT(poketch); GF_ASSERT(screenColor < POKETCH_SCREEN_COLOR_MAX); - poketchData->screenColor = screenColor; + poketch->screenColor = screenColor; } -u32 PoketchData_StepCount(const PoketchData *poketchData) +u32 PoketchData_StepCount(const Poketch *poketch) { - return poketchData->stepCount; + return poketch->stepCount; } -void PoketchData_SetStepCount(PoketchData *poketchData, u32 value) +void PoketchData_SetStepCount(Poketch *poketch, u32 value) { - if (poketchData->pedometerEnabled) { - poketchData->stepCount = value; + if (poketch->pedometerEnabled) { + poketch->stepCount = value; } } -BOOL PoketchData_IsAlarmSet(const PoketchData *poketchData) +BOOL PoketchData_IsAlarmSet(const Poketch *poketch) { - return poketchData->alarmSet; + return poketch->alarmSet; } -void PoketchData_AlarmTime(const PoketchData *poketchData, u32 *hour, u32 *minute) +void PoketchData_AlarmTime(const Poketch *poketch, u32 *hour, u32 *minute) { - *hour = poketchData->alarmHour; - *minute = poketchData->alarmMinute; + *hour = poketch->alarmHour; + *minute = poketch->alarmMinute; } -void PoketchData_SetAlarm(PoketchData *poketchData, BOOL enable, u32 hour, u32 minute) +void PoketchData_SetAlarm(Poketch *poketch, BOOL enable, u32 hour, u32 minute) { - poketchData->alarmSet = enable; - poketchData->alarmHour = hour; - poketchData->alarmMinute = minute; + poketch->alarmSet = enable; + poketch->alarmHour = hour; + poketch->alarmMinute = minute; } -void PoketchData_SetCalendarMark(PoketchData *poketchData, u32 month, u32 day) +void PoketchData_SetCalendarMark(Poketch *poketch, u32 month, u32 day) { - if (poketchData->calendarMonth == month) { - poketchData->calendarMarkBitmap |= (1 << (day - 1)); + if (poketch->calendarMonth == month) { + poketch->calendarMarkBitmap |= (1 << (day - 1)); } else { - poketchData->calendarMonth = month; - poketchData->calendarMarkBitmap = (1 << (day - 1)); + poketch->calendarMonth = month; + poketch->calendarMarkBitmap = (1 << (day - 1)); } } -void PoketchData_ClearCalendarMark(PoketchData *poketchData, u32 month, u32 day) +void PoketchData_ClearCalendarMark(Poketch *poketch, u32 month, u32 day) { - if (poketchData->calendarMonth == month) { - poketchData->calendarMarkBitmap &= ~(1 << (day - 1)); + if (poketch->calendarMonth == month) { + poketch->calendarMarkBitmap &= ~(1 << (day - 1)); } else { - poketchData->calendarMonth = month; - poketchData->calendarMarkBitmap = 0; + poketch->calendarMonth = month; + poketch->calendarMarkBitmap = 0; } } -BOOL PoketchData_CalendarMarked(const PoketchData *poketchData, u32 month, u32 day) +BOOL PoketchData_CalendarMarked(const Poketch *poketch, u32 month, u32 day) { - if (poketchData->calendarMonth == month) { - return (poketchData->calendarMarkBitmap >> (day - 1)) & 1; + if (poketch->calendarMonth == month) { + return (poketch->calendarMarkBitmap >> (day - 1)) & 1; } return FALSE; } -void PoketchData_SetMapMarker(PoketchData *poketchData, int index, u8 x, u8 y) +void PoketchData_SetMapMarker(Poketch *poketch, int index, u8 x, u8 y) { GF_ASSERT(index < POKETCH_MAPMARKER_COUNT); - poketchData->markMapPositions[index].x = x; - poketchData->markMapPositions[index].y = y; + poketch->markMapPositions[index].x = x; + poketch->markMapPositions[index].y = y; } -void PoketchData_MapMarkerPos(const PoketchData *poketchData, int index, u8 *x, u8 *y) +void PoketchData_MapMarkerPos(const Poketch *poketch, int index, u8 *x, u8 *y) { GF_ASSERT(index < POKETCH_MAPMARKER_COUNT); - *x = poketchData->markMapPositions[index].x; - *y = poketchData->markMapPositions[index].y; + *x = poketch->markMapPositions[index].x; + *y = poketch->markMapPositions[index].y; } -BOOL PoketchData_DotArtModified(const PoketchData *poketchData) +BOOL PoketchData_DotArtModified(const Poketch *poketch) { - return poketchData->dotArtModifiedByPlayer; + return poketch->dotArtModifiedByPlayer; } -void PoketchData_CopyDotArtData(const PoketchData *poketchData, u8 *dst) +void PoketchData_CopyDotArtData(const Poketch *poketch, u8 *dst) { - if (poketchData->dotArtModifiedByPlayer) { - MI_CpuCopy8(poketchData->dotArtData, dst, POKETCH_DOTART_SIZE_BYTES); + if (poketch->dotArtModifiedByPlayer) { + MI_CpuCopy8(poketch->dotArtData, dst, POKETCH_DOTART_SIZE_BYTES); } } -void PoketchData_ModifyDotArtData(PoketchData *poketchData, const u8 *src) +void PoketchData_ModifyDotArtData(Poketch *poketch, const u8 *src) { - MI_CpuCopy8(src, poketchData->dotArtData, POKETCH_DOTART_SIZE_BYTES); - poketchData->dotArtModifiedByPlayer = TRUE; + MI_CpuCopy8(src, poketch->dotArtData, POKETCH_DOTART_SIZE_BYTES); + poketch->dotArtModifiedByPlayer = TRUE; } -void PoketchData_PokemonHistoryEnqueue(PoketchData *poketchData, const BoxPokemon *boxPokemon) +void PoketchData_PokemonHistoryEnqueue(Poketch *poketch, const BoxPokemon *boxPokemon) { - int index = PoketchData_PokemonHistorySize(poketchData); + int index = PoketchData_PokemonHistorySize(poketch); // Shift all entries one index up if (index >= POKETCH_POKEMONHISTORY_MAX) { for (int i = 0; i < (POKETCH_POKEMONHISTORY_MAX - 1); i++) { - poketchData->pokemonHistoryQueue[i] = poketchData->pokemonHistoryQueue[i + 1]; + poketch->pokemonHistoryQueue[i] = poketch->pokemonHistoryQueue[i + 1]; } index = POKETCH_POKEMONHISTORY_MAX - 1; } // Add new entry to end of the list - poketchData->pokemonHistoryQueue[index].species = BoxPokemon_GetValue((BoxPokemon *)boxPokemon, MON_DATA_SPECIES, NULL); - poketchData->pokemonHistoryQueue[index].icon = BoxPokemon_IconFormOffset(boxPokemon); - poketchData->pokemonHistoryQueue[index].form = BoxPokemon_GetValue((BoxPokemon *)boxPokemon, MON_DATA_FORM, NULL); + poketch->pokemonHistoryQueue[index].species = BoxPokemon_GetValue((BoxPokemon *)boxPokemon, MON_DATA_SPECIES, NULL); + poketch->pokemonHistoryQueue[index].icon = BoxPokemon_IconFormOffset(boxPokemon); + poketch->pokemonHistoryQueue[index].form = BoxPokemon_GetValue((BoxPokemon *)boxPokemon, MON_DATA_FORM, NULL); } -int PoketchData_PokemonHistorySize(const PoketchData *poketchData) +int PoketchData_PokemonHistorySize(const Poketch *poketch) { int size; for (size = 0; size < POKETCH_POKEMONHISTORY_MAX; size++) { - if (poketchData->pokemonHistoryQueue[size].species == 0) { + if (poketch->pokemonHistoryQueue[size].species == 0) { return size; } } @@ -287,24 +287,24 @@ int PoketchData_PokemonHistorySize(const PoketchData *poketchData) return size; } -void PoketchData_PokemonHistorySpeciesAndIcon(const PoketchData *poketchData, int index, int *species, int *icon) +void PoketchData_PokemonHistorySpeciesAndIcon(const Poketch *poketch, int index, int *species, int *icon) { GF_ASSERT(index < POKETCH_POKEMONHISTORY_MAX); - GF_ASSERT(poketchData->pokemonHistoryQueue[index].species); + GF_ASSERT(poketch->pokemonHistoryQueue[index].species); - *species = poketchData->pokemonHistoryQueue[index].species; - *icon = poketchData->pokemonHistoryQueue[index].icon; + *species = poketch->pokemonHistoryQueue[index].species; + *icon = poketch->pokemonHistoryQueue[index].icon; } -u32 PoketchData_PokemonHistoryForm(const PoketchData *poketchData, int index) +u32 PoketchData_PokemonHistoryForm(const Poketch *poketch, int index) { GF_ASSERT(index < POKETCH_POKEMONHISTORY_MAX); - GF_ASSERT(poketchData->pokemonHistoryQueue[index].species); + GF_ASSERT(poketch->pokemonHistoryQueue[index].species); - return poketchData->pokemonHistoryQueue[index].form; + return poketch->pokemonHistoryQueue[index].form; } -PoketchData *SaveData_PoketchData(SaveData *saveData) +Poketch *SaveData_PoketchData(SaveData *saveData) { return SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_POKETCH); } diff --git a/src/savedata/save_table.c b/src/savedata/save_table.c index 11f6a2ee4f..46816319c8 100644 --- a/src/savedata/save_table.c +++ b/src/savedata/save_table.c @@ -53,7 +53,7 @@ const SaveTableEntry gSaveTable[] = { { SAVE_TABLE_ENTRY_VARS_FLAGS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)VarsFlags_SaveSize, (SaveEntryInitFunc)VarsFlags_Init }, { SAVE_TABLE_ENTRY_POKETCH, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Poketch_SaveSize, (SaveEntryInitFunc)Poketch_Init }, { SAVE_TABLE_ENTRY_FIELD_PLAYER_STATE, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)FieldOverworldState_Size, (SaveEntryInitFunc)FieldOverworldState_Init }, - { SAVE_TABLE_ENTRY_POKEDEX, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)PokedexData_SaveSize, (SaveEntryInitFunc)PokedexData_Init }, + { SAVE_TABLE_ENTRY_POKEDEX, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Pokedex_SaveSize, (SaveEntryInitFunc)Pokedex_Init }, { SAVE_TABLE_ENTRY_DAYCARE, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Daycare_SaveSize, (SaveEntryInitFunc)Daycare_Init }, { SAVE_TABLE_ENTRY_PAL_PAD, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)PalPad_SaveSize, (SaveEntryInitFunc)PalPad_Init }, { SAVE_TABLE_ENTRY_MISC, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)MiscSaveBlock_SaveSize, (SaveEntryInitFunc)MiscSaveBlock_Init }, diff --git a/src/scrcmd.c b/src/scrcmd.c index ffe401dbd9..7dedb81e56 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -4996,7 +4996,7 @@ static BOOL ScrCmd_120(ScriptContext *ctx) const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); - *v1 = PokedexData_CountSeen_National(v0); + *v1 = Pokedex_CountSeen_National(v0); return 0; } @@ -5005,7 +5005,7 @@ static BOOL ScrCmd_121(ScriptContext *ctx) const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); - *v1 = PokedexData_CountCaught_National(v0); + *v1 = Pokedex_CountCaught_National(v0); return 0; } @@ -5180,10 +5180,10 @@ static BOOL ScrCmd_131(ScriptContext *ctx) static BOOL ScrCmd_132(ScriptContext *ctx) { - PoketchData *poketchData = SaveData_PoketchData(ctx->fieldSystem->saveData); + Poketch *poketch = SaveData_PoketchData(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); - *v1 = PoketchData_IsEnabled(poketchData); + *v1 = PoketchData_IsEnabled(poketch); return 0; } @@ -6565,13 +6565,13 @@ static BOOL ScrCmd_22A(ScriptContext *ctx) static BOOL ScrCmd_22B(ScriptContext *ctx) { - PokedexData_TurnOnLanguageDetection(SaveData_PokedexData(ctx->fieldSystem->saveData)); + PokedexData_TurnOnLanguageDetection(SaveData_Pokedex(ctx->fieldSystem->saveData)); return 0; } static BOOL ScrCmd_22C(ScriptContext *ctx) { - PokedexData_TurnOnFormDetection(SaveData_PokedexData(ctx->fieldSystem->saveData)); + PokedexData_TurnOnFormDetection(SaveData_Pokedex(ctx->fieldSystem->saveData)); return 0; } @@ -6583,10 +6583,10 @@ static BOOL ScrCmd_22D(ScriptContext *ctx) *v1 = 0; if (v0 == 1) { - PokedexData_ObtainNationalDex(SaveData_PokedexData(ctx->fieldSystem->saveData)); + PokedexData_ObtainNationalDex(SaveData_Pokedex(ctx->fieldSystem->saveData)); TrainerInfo_GiveNationalDex(SaveData_GetTrainerInfo(ctx->fieldSystem->saveData)); } else if (v0 == 2) { - *v1 = PokedexData_IsNationalDexObtained(SaveData_PokedexData(ctx->fieldSystem->saveData)); + *v1 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(ctx->fieldSystem->saveData)); } else { GF_ASSERT(FALSE); } @@ -6773,7 +6773,7 @@ static void sub_020451B4(FieldSystem *fieldSystem, u16 param1) Pokemon_Init(v1); Pokemon_InitWith(v1, param1, 50, 32, FALSE, 0, OTID_NOT_SET, 0); - PokedexData_Encounter(v0, v1); + Pokedex_Encounter(v0, v1); Heap_FreeToHeap(v1); return; @@ -8333,7 +8333,7 @@ static BOOL ScrCmd_328(ScriptContext *ctx) v5 = Party_GetPokemonBySlotIndex(v1, v3); if ((Pokemon_GetValue(v5, MON_DATA_IS_EGG, NULL) == 0) && (Pokemon_GetValue(v5, MON_DATA_SPECIES, NULL) == SPECIES_GIRATINA)) { - PokedexData_Capture(SaveData_PokedexData(fieldSystem->saveData), v5); + PokedexData_Capture(SaveData_Pokedex(fieldSystem->saveData), v5); } } } diff --git a/src/scrcmd_system_flags.c b/src/scrcmd_system_flags.c index 69de1924d9..114155e7c0 100644 --- a/src/scrcmd_system_flags.c +++ b/src/scrcmd_system_flags.c @@ -20,7 +20,7 @@ BOOL ScrCmd_CheckPokedexAcquired(ScriptContext *ctx) { const Pokedex *pokedex = SaveData_Pokedex(ctx->fieldSystem->saveData); u16 *destVar = ScriptContext_GetVarPointer(ctx); - *destVar = PokedexData_IsObtained(pokedex); + *destVar = Pokedex_IsObtained(pokedex); return FALSE; } diff --git a/src/unk_0202F1D4.c b/src/unk_0202F1D4.c index 390512e54a..42ec41a14f 100644 --- a/src/unk_0202F1D4.c +++ b/src/unk_0202F1D4.c @@ -561,7 +561,7 @@ void sub_0202FAFC(FieldBattleDTO *param0, SaveData *param1) param0->resultMask = BATTLE_IN_PROGRESS; param0->leveledUpMonsMask = 0; - PokedexData_Copy(SaveData_PokedexData(param1), param0->pokedex); + Pokedex_Copy(SaveData_Pokedex(param1), param0->pokedex); for (v0 = 0; v0 < 4; v0++) { param0->trainerIDs[v0] = v1->unk_00.unk_08[v0]; diff --git a/src/unk_0203D1B8.c b/src/unk_0203D1B8.c index b44cde924c..874cc56e95 100644 --- a/src/unk_0203D1B8.c +++ b/src/unk_0203D1B8.c @@ -979,7 +979,7 @@ static void sub_0203DB38(UnkStruct_ov88_0223C370 *param0, FieldSystem *fieldSyst param0->unk_0C = SaveData_SaveTable(fieldSystem->saveData, 9); param0->unk_14 = sub_0202C878(fieldSystem->saveData); param0->unk_18 = SaveData_Options(fieldSystem->saveData); - param0->unk_24 = SaveData_PokedexData(fieldSystem->saveData); + param0->unk_24 = SaveData_Pokedex(fieldSystem->saveData); param0->unk_30 = sub_0207A274(fieldSystem->saveData); param0->unk_10 = fieldSystem->saveData; param0->unk_1C = fieldSystem->journalEntry; @@ -1075,7 +1075,7 @@ BOOL sub_0203DBF0(FieldTask *param0) if ((v4 = sub_02076B94(NULL, v2->unk_04.unk_40, 1, v3, &v5)) != 0) { Heap_Create(3, 26, 0x30000); - v2->unk_60 = sub_0207AE68(NULL, v2->unk_04.unk_40, v4, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_PokedexData(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v5, 0x4, 26); + v2->unk_60 = sub_0207AE68(NULL, v2->unk_04.unk_40, v4, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_Pokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v5, 0x4, 26); v2->unk_00 = 6; } else { v2->unk_00 = 7; @@ -1366,7 +1366,7 @@ void sub_0203E0FC(FieldSystem *fieldSystem, int param1) v0->unk_04 = SaveData_GetSystemData(fieldSystem->saveData); v0->unk_08 = SaveData_SaveTable(fieldSystem->saveData, 2); v0->unk_0C = SaveData_PCBoxes(fieldSystem->saveData); - v0->unk_10 = SaveData_PokedexData(fieldSystem->saveData); + v0->unk_10 = SaveData_Pokedex(fieldSystem->saveData); v0->unk_14 = sub_0202B370(fieldSystem->saveData); v0->unk_18 = sub_0202C878(fieldSystem->saveData); v0->unk_1C = SaveData_GetTrainerInfo(fieldSystem->saveData); diff --git a/src/unk_02046C7C.c b/src/unk_02046C7C.c index 0eac6b747c..d0928965be 100644 --- a/src/unk_02046C7C.c +++ b/src/unk_02046C7C.c @@ -107,7 +107,7 @@ BOOL ScrCmd_0FA(ScriptContext *param0) v8.unk_01 = v4; v8.unk_02 = v6; v8.unk_03 = SystemFlag_CheckGameCompleted(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); - v8.unk_04 = PokedexData_IsNationalDexObtained(SaveData_PokedexData(param0->fieldSystem->saveData)); + v8.unk_04 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(param0->fieldSystem->saveData)); v8.unk_05 = v7; v8.unk_08 = v1; v8.unk_0C = v0; diff --git a/src/unk_02048DD8.c b/src/unk_02048DD8.c index b34401ef9c..f5eb314c93 100644 --- a/src/unk_02048DD8.c +++ b/src/unk_02048DD8.c @@ -319,8 +319,8 @@ static BOOL sub_02049348(FieldSystem *fieldSystem) static BOOL sub_02049358(FieldSystem *fieldSystem) { - PoketchData *poketchData = SaveData_PoketchData(fieldSystem->saveData); - return PoketchData_IsEnabled(poketchData); + Poketch *poketch = SaveData_PoketchData(fieldSystem->saveData); + return PoketchData_IsEnabled(poketch); } static BOOL sub_02049368(FieldSystem *fieldSystem) diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index 162d127451..d2e7c7f801 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -112,7 +112,7 @@ StringTemplate *sub_0204AEE8(SaveData *param0, u16 param1, u16 param2, u8 param3 v2 = Strbuf_Init(12 + 2, 4); v3 = Strbuf_Init(2, 4); - v4 = SaveData_PokedexData(param0); + v4 = SaveData_Pokedex(param0); v6 = MessageLoader_Init(1, 26, 412, 4); v5 = StringTemplate_New(18 + 1, 12 + 2, 4); diff --git a/src/unk_0204B830.c b/src/unk_0204B830.c index dde7bed166..675a8a9bcf 100644 --- a/src/unk_0204B830.c +++ b/src/unk_0204B830.c @@ -712,18 +712,18 @@ static void sub_0204C428(UnkStruct_0204B830 *param0, u16 *param1, u16 *param2) static BOOL sub_0204C458(FieldSystem *fieldSystem, void *param1) { - PoketchData *poketchData = SaveData_PoketchData(fieldSystem->saveData); + Poketch *poketch = SaveData_PoketchData(fieldSystem->saveData); UnkUnion_0204C4D0 *v1 = sub_0204B844(fieldSystem); - return PoketchData_IsEnabled(poketchData); + return PoketchData_IsEnabled(poketch); } static void sub_0204C474(FieldSystem *fieldSystem, void *param1) { - PoketchData *poketchData = SaveData_PoketchData(fieldSystem->saveData); + Poketch *poketch = SaveData_PoketchData(fieldSystem->saveData); UnkUnion_0204C4D0 *v1 = sub_0204B844(fieldSystem); - PoketchData_RegisterApp(poketchData, v1->val6.unk_00); + PoketchData_RegisterApp(poketch, v1->val6.unk_00); } static void sub_0204C494(UnkStruct_0204B830 *param0, u16 *param1, u16 *param2) diff --git a/src/unk_02052C6C.c b/src/unk_02052C6C.c index c3383954b4..e18e336989 100644 --- a/src/unk_02052C6C.c +++ b/src/unk_02052C6C.c @@ -192,7 +192,7 @@ void sub_02052E58(FieldTask *param0) v5->unk_04.playTime = SaveData_GetPlayTime(fieldSystem->saveData); v5->unk_10.unk_00 = TrainerInfo_Gender(SaveData_GetTrainerInfo(fieldSystem->saveData)); v5->unk_10.unk_04 = SystemFlag_CheckGameCompleted(v3); - v5->unk_10.unk_08 = SaveData_PokedexData(fieldSystem->saveData); + v5->unk_10.unk_08 = SaveData_Pokedex(fieldSystem->saveData); if (SystemFlag_CheckGameCompleted(v3) == 0) { sub_02055C2C(fieldSystem); diff --git a/src/unk_020683F4.c b/src/unk_020683F4.c index ccccbfd6a8..9300be8a49 100644 --- a/src/unk_020683F4.c +++ b/src/unk_020683F4.c @@ -1065,7 +1065,7 @@ static u32 sub_02069130(const UnkStruct_020684D0 *param0) return -1; } - if (PokedexData_IsNationalDexObtained(SaveData_PokedexData(param0->fieldSystem->saveData)) == FALSE) { + if (PokedexData_IsNationalDexObtained(SaveData_Pokedex(param0->fieldSystem->saveData)) == FALSE) { return -1; } diff --git a/src/unk_0206CCB0.c b/src/unk_0206CCB0.c index bfc4aeb272..c5c6555f1d 100644 --- a/src/unk_0206CCB0.c +++ b/src/unk_0206CCB0.c @@ -814,7 +814,7 @@ static BOOL sub_0206D3C0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param return 1; } - return PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_00); + return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206D3E4(FieldSystem *fieldSystem, int param1) @@ -935,7 +935,7 @@ static int sub_0206D5B0(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D5F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206D5B0 *v0 = (UnkStruct_0206D5B0 *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_00); + return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D60C(FieldSystem *fieldSystem, Pokemon *param1) @@ -1092,7 +1092,7 @@ static BOOL sub_0206D8F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D8B0 *v0 = (UnkStruct_0206D8B0 *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_00); + return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D90C(TVBroadcast *fieldSystem, Pokemon *param1, u16 param2) @@ -1171,7 +1171,7 @@ static BOOL sub_0206DA50(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D9F4 *v0 = (UnkStruct_0206D9F4 *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_00); + return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206DA6C(UnkStruct_0206DA6C *param0, const TrainerInfo *param1) @@ -1304,7 +1304,7 @@ static BOOL sub_0206DC3C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206DBE8 *v0 = (UnkStruct_0206DBE8 *)ov6_02246498(param1); - if (PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_02) == 0) { + if (PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_02) == 0) { return 0; } @@ -1341,7 +1341,7 @@ static int sub_0206DC9C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206DD1C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206DC9C *v0 = (UnkStruct_0206DC9C *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_00); + return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206DD38(FieldSystem *fieldSystem, u32 param1, u32 param2, u32 param3) @@ -1682,7 +1682,7 @@ static BOOL sub_0206E248(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206E1C0 *v0 = ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_00); + return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E264(FieldSystem *fieldSystem, u16 param1) @@ -1742,7 +1742,7 @@ static int sub_0206E300(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E37C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E300 *v0 = ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_00.unk_02); + return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00.unk_02); } void sub_0206E398(FieldSystem *fieldSystem, u16 param1) @@ -1776,7 +1776,7 @@ static int sub_0206E3C8(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E3F8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E3C8 *v0 = ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_PokedexData(fieldSystem->saveData), v0->unk_00); + return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E414(FieldSystem *fieldSystem, u16 param1) @@ -2805,7 +2805,7 @@ static BOOL sub_0206F100(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { const Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); - if (PokedexData_IsObtained(pokedex) == TRUE) { + if (Pokedex_IsObtained(pokedex) == TRUE) { return TRUE; } else { return FALSE; @@ -2883,7 +2883,7 @@ static BOOL sub_0206F260(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { const Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); - if (PokedexData_IsObtained(pokedex) == TRUE) { + if (Pokedex_IsObtained(pokedex) == TRUE) { return TRUE; } else { return FALSE; diff --git a/src/unk_02071D40.c b/src/unk_02071D40.c index 4789f8f062..f7e7177014 100644 --- a/src/unk_02071D40.c +++ b/src/unk_02071D40.c @@ -63,7 +63,7 @@ void sub_02071D40(const u8 param0, const u8 param1, const u8 param2, const u8 pa sub_02072014(param0, GAME_VERSION, v3, param2, TrainerInfo_RegionCode(v0), param5); } - sub_02072038(TrainerInfo_ID_LowHalf(v0), TrainerInfo_Gender(v0), TrainerInfo_Name(v0), TrainerInfo_Money(v0), PokedexData_CountSeen(SaveData_PokedexData(fieldSystem->saveData)), PokedexData_IsObtained(SaveData_PokedexData(fieldSystem->saveData)), GameRecords_GetTrainerScore(v1), param5); + sub_02072038(TrainerInfo_ID_LowHalf(v0), TrainerInfo_Gender(v0), TrainerInfo_Name(v0), TrainerInfo_Money(v0), Pokedex_CountSeen(SaveData_Pokedex(fieldSystem->saveData)), Pokedex_IsObtained(SaveData_Pokedex(fieldSystem->saveData)), GameRecords_GetTrainerScore(v1), param5); { RTCDate v4; @@ -140,7 +140,7 @@ u8 sub_02071F28(FieldSystem *fieldSystem) v0++; } - if (PokedexData_NationalDexCompleted(SaveData_PokedexData(v1))) { + if (PokedexData_NationalDexCompleted(SaveData_Pokedex(v1))) { v0++; } diff --git a/src/unk_0207A274.c b/src/unk_0207A274.c index 7bb970a9b0..64cb36777c 100644 --- a/src/unk_0207A274.c +++ b/src/unk_0207A274.c @@ -13,7 +13,7 @@ u32 sub_0207A274(SaveData *param0) { Pokedex *v0; - v0 = SaveData_PokedexData(param0); + v0 = SaveData_Pokedex(param0); return sub_0207A280(v0); } diff --git a/src/unk_0207A6DC.c b/src/unk_0207A6DC.c index 0b09c5d5b1..13829af300 100644 --- a/src/unk_0207A6DC.c +++ b/src/unk_0207A6DC.c @@ -387,7 +387,7 @@ BOOL sub_0207AA38(UnkStruct_0207A778 *param0) } v0 = (Party *)¶m0->unk_20[0]; - Party_cpy(param0->unk_00->parties[0], v0); + Party_Copy(param0->unk_00->parties[0], v0); return 1; } @@ -534,7 +534,7 @@ BOOL sub_0207AC28(UnkStruct_0207A778 *param0, int param1) } v0 = (Party *)¶m0->unk_20[0]; - Party_cpy(param0->unk_00->parties[param1], v0); + Party_Copy(param0->unk_00->parties[param1], v0); return 1; } diff --git a/src/unk_0207AE68.c b/src/unk_0207AE68.c index 0f64e29ba2..f091ab43de 100644 --- a/src/unk_0207AE68.c +++ b/src/unk_0207AE68.c @@ -60,7 +60,7 @@ #include "constdata/const_020F410C.h" -UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11); +UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, Poketch *poketch, int param9, int param10, int param11); static void sub_0207B0A0(SysTask *param0, void *param1); BOOL sub_0207B0D0(UnkStruct_0207AE68 *param0); void sub_0207B0E0(UnkStruct_0207AE68 *param0); @@ -90,7 +90,7 @@ static const u8 Unk_020F0A2C[] = { 0x8 }; -UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, PoketchData *poketchData, int param9, int param10, int param11) +UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Options *param3, int param4, Pokedex *param5, Bag *param6, GameRecords *records, Poketch *poketch, int param9, int param10, int param11) { UnkStruct_0207AE68 *v0; ArchivedSprite v1; @@ -149,7 +149,7 @@ UnkStruct_0207AE68 *sub_0207AE68(Party *param0, Pokemon *param1, int param2, Opt v0->unk_48 = param5; v0->unk_4C = param6; v0->records = records; - v0->poketchData = poketchData; + v0->poketch = poketch; v0->unk_78 = param9; v0->unk_7C = param10; @@ -412,7 +412,7 @@ static void sub_0207B180(UnkStruct_0207AE68 *param0) PokedexData_Capture(param0->unk_48, param0->unk_28); GameRecords_IncrementRecordValue(param0->records, RECORD_UNK_012); GameRecords_IncrementTrainerScore(param0->records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); - PoketchData_PokemonHistoryEnqueue(param0->poketchData, Pokemon_GetBoxPokemon(param0->unk_28)); + PoketchData_PokemonHistoryEnqueue(param0->poketch, Pokemon_GetBoxPokemon(param0->unk_28)); if (Pokemon_GetValue(param0->unk_28, MON_DATA_HAS_NICKNAME, NULL) == 0) { Pokemon_SetValue(param0->unk_28, MON_DATA_SPECIES_NAME, NULL); @@ -742,7 +742,7 @@ static void sub_0207C028(UnkStruct_0207AE68 *param0) PokedexData_Capture(param0->unk_48, v1); GameRecords_IncrementRecordValue(param0->records, RECORD_UNK_012); GameRecords_IncrementTrainerScore(param0->records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); - PoketchData_PokemonHistoryEnqueue(param0->poketchData, Pokemon_GetBoxPokemon(v1)); + PoketchData_PokemonHistoryEnqueue(param0->poketch, Pokemon_GetBoxPokemon(v1)); Heap_FreeToHeap(v1); Bag_TryRemoveItem(param0->unk_4C, ITEM_POKE_BALL, 1, param0->unk_5C); } diff --git a/src/unk_020933F8.c b/src/unk_020933F8.c index 233b06b9c0..36cc16462b 100644 --- a/src/unk_020933F8.c +++ b/src/unk_020933F8.c @@ -1623,10 +1623,10 @@ void sub_02094C44(UnkStruct_02095C48 *param0, SaveData *param1, u32 param2, Jour } int i; - Pokedex *v7 = SaveData_PokedexData(param0->unk_1970); - + Pokedex *pokedex = SaveData_Pokedex(param0->unk_1970); + for (i = param0->unk_00.unk_117; i < 4; i++) { - PokedexData_Encounter(v7, param0->unk_00.unk_00[i]); + Pokedex_Encounter(pokedex, param0->unk_00.unk_00[i]); } } else { sub_0202F134(param0->unk_1970, param0->unk_00.unk_10F, param0->unk_00.unk_118[param0->unk_00.unk_113].unk_08); diff --git a/src/unk_0209747C.c b/src/unk_0209747C.c index 74ae4674f3..3874a15788 100644 --- a/src/unk_0209747C.c +++ b/src/unk_0209747C.c @@ -39,7 +39,7 @@ UnkStruct_0209747C *sub_0209747C(u32 param0, u32 param1, SaveData *param2, u32 p v0->unk_00 = param0; v0->unk_01 = param1; - v0->unk_0C = SaveData_PokedexData(param2); + v0->unk_0C = SaveData_Pokedex(param2); v0->unk_10 = sub_02014EC4(param2); v0->unk_04 = SystemFlag_CheckGameCompleted(SaveData_GetVarsFlags(param2)); v0->unk_05 = 0; From 5a7b4091dd919b7f314ed85dfd3a6deb01cbaef6 Mon Sep 17 00:00:00 2001 From: Adrienn Tindall <33725376+adrienntindall@users.noreply.github.com> Date: Tue, 14 Jan 2025 07:37:32 -0500 Subject: [PATCH 3/4] More pokedex documentation --- asm/macros/scrcmd.inc | 2 +- include/overlay005/ov5_021F77A8.h | 16 +-- include/overlay021/struct_ov21_021D3208.h | 2 +- include/overlay021/struct_ov21_021D3320.h | 2 +- include/pokedex_data.h | 66 ++++----- .../scripts/scripts_pokemon_mansion_office.s | 4 +- src/battle/ov16_0223DF00.c | 6 +- src/field_battle_data_transfer.c | 10 +- src/field_menu.c | 8 +- src/game_records.c | 2 +- src/overlay005/ov5_021F6454.c | 2 +- src/overlay005/ov5_021F77A8.c | 43 +++--- src/overlay005/save_info_window.c | 2 +- src/overlay006/ov6_02240C9C.c | 6 +- src/overlay006/ov6_02242984.c | 2 +- src/overlay006/ov6_02246A30.c | 31 ++-- src/overlay021/ov21_021D0D80.c | 2 +- src/overlay021/pokedex_sort.c | 92 ++++++------ src/overlay023/ov23_0223E140.c | 8 +- src/overlay023/ov23_022521F0.c | 8 +- src/overlay028/ov28_022561C0.c | 8 +- src/overlay062/ov62_02237D24.c | 8 +- src/overlay062/ov62_02241204.c | 8 +- src/overlay065/ov65_0222DCE0.c | 4 +- src/overlay066/ov66_0222DDF0.c | 4 +- src/overlay094/ov94_022414B8.c | 8 +- src/overlay097/ov97_0222AE60.c | 4 +- src/overlay097/ov97_0222C174.c | 2 +- src/overlay118/ov118_021D0D80.c | 2 +- src/pokedex_data.c | 134 +++++++++--------- src/scrcmd.c | 54 +++---- src/scrcmd_system_flags.c | 6 +- src/unk_0202F180.c | 12 +- src/unk_0202F1D4.c | 20 +-- src/unk_0203D1B8.c | 6 +- src/unk_02046C7C.c | 2 +- src/unk_0204AEE8.c | 6 +- src/unk_0204C500.c | 2 +- src/unk_02052C6C.c | 2 +- src/unk_020683F4.c | 2 +- src/unk_0206CCB0.c | 70 ++++----- src/unk_02071D40.c | 50 +++---- src/unk_0207A274.c | 4 +- src/unk_0207AE68.c | 4 +- src/unk_020933F8.c | 2 +- src/unk_0209747C.c | 10 +- src/unk_020998EC.c | 6 +- tools/scripts/make_pokedex_data.py | 4 +- 48 files changed, 374 insertions(+), 384 deletions(-) diff --git a/asm/macros/scrcmd.inc b/asm/macros/scrcmd.inc index 3648bc40b3..9f52354040 100644 --- a/asm/macros/scrcmd.inc +++ b/asm/macros/scrcmd.inc @@ -4475,7 +4475,7 @@ .short \arg0 .endm - .macro ScrCmd_337 arg0, arg1 + .macro ScrCmd_HasSeenSpecies arg0, arg1 .short 823 .short \arg0 .short \arg1 diff --git a/include/overlay005/ov5_021F77A8.h b/include/overlay005/ov5_021F77A8.h index 178384370a..bc3f2b8dca 100644 --- a/include/overlay005/ov5_021F77A8.h +++ b/include/overlay005/ov5_021F77A8.h @@ -3,13 +3,13 @@ #include "field_script_context.h" -BOOL ScrCmd_337(ScriptContext *param0); -BOOL ScrCmd_2E5(ScriptContext *param0); -BOOL ScrCmd_2E9(ScriptContext *param0); -BOOL ScrCmd_2EA(ScriptContext *param0); -BOOL ScrCmd_2EB(ScriptContext *param0); -BOOL ScrCmd_2E6(ScriptContext *param0); -BOOL ScrCmd_2EC(ScriptContext *param0); -BOOL ScrCmd_2ED(ScriptContext *param0); +BOOL ScrCmd_HasSeenSpecies(ScriptContext *ctx); +BOOL ScrCmd_2E5(ScriptContext *ctx); +BOOL ScrCmd_2E9(ScriptContext *ctx); +BOOL ScrCmd_2EA(ScriptContext *ctx); +BOOL ScrCmd_2EB(ScriptContext *ctx); +BOOL ScrCmd_2E6(ScriptContext *ctx); +BOOL ScrCmd_2EC(ScriptContext *ctx); +BOOL ScrCmd_2ED(ScriptContext *ctx); #endif // POKEPLATINUM_OV5_021F77A8_H diff --git a/include/overlay021/struct_ov21_021D3208.h b/include/overlay021/struct_ov21_021D3208.h index 2eaaa10b6e..d907daa13a 100644 --- a/include/overlay021/struct_ov21_021D3208.h +++ b/include/overlay021/struct_ov21_021D3208.h @@ -6,7 +6,7 @@ #include "trainer_info.h" typedef struct { - const Pokedex *dexData; + const Pokedex *pokedex; const TrainerInfo *unk_04; int timeOfDay; BOOL fullmoonIslandVisible; diff --git a/include/overlay021/struct_ov21_021D3320.h b/include/overlay021/struct_ov21_021D3320.h index cfc0adb7d6..1d925172b8 100644 --- a/include/overlay021/struct_ov21_021D3320.h +++ b/include/overlay021/struct_ov21_021D3320.h @@ -9,7 +9,7 @@ #include "strbuf.h" typedef struct { - const Pokedex *dexData; + const Pokedex *pokedex; SortedPokedex sortedPokedex; int isNationalDex; BOOL isNationalDexUnlocked; diff --git a/include/pokedex_data.h b/include/pokedex_data.h index a0ec36ff88..983b556deb 100644 --- a/include/pokedex_data.h +++ b/include/pokedex_data.h @@ -13,41 +13,41 @@ void Pokedex_Init(Pokedex *pokedex); u16 Pokedex_CountCaught_National(const Pokedex *pokedex); u16 Pokedex_CountSeen_National(const Pokedex *pokedex); u16 Pokedex_CountSeen(const Pokedex *pokedex); -u16 PokedexData_CountCaught_Local(const Pokedex *pokedex); -u16 PokedexData_CountSeen_Local(const Pokedex *pokedex); -BOOL PokedexData_NationalDexCompleted(const Pokedex *pokedex); -BOOL PokedexData_LocalDexCompleted(const Pokedex *pokedex); -u16 PokedexData_NumCaught_National(const Pokedex *pokedex); -u16 PokedexData_NumCaught_Local(const Pokedex *pokedex); -BOOL PokedexData_HasCaughtSpecies(const Pokedex *pokedex, u16 species); -BOOL PokedexData_HasSeenSpecies(const Pokedex *pokedex, u16 species); -u32 PokedexData_GetForm_Spinda(const Pokedex *pokedex, u8 formIndex); -u32 PokedexData_DisplayedGender(const Pokedex *pokedex, u16 species, int displaySecondary); -u32 PokedexData_GetForm_Unown(const Pokedex *pokedex, int formIndex); -u32 PokedexData_NumFormsSeen_Unown(const Pokedex *pokedex); -u32 PokedexData_GetForm_Shellos(const Pokedex *pokedex, int formIndex); -u32 PokedexData_NumFormsSeen_Shellos(const Pokedex *pokedex); -u32 PokedexData_GetForm_Gastrodon(const Pokedex *pokedex, int formIndex); -u32 PokedexData_NumFormsSeen_Gastrodon(const Pokedex *pokedex); -u32 PokedexData_GetForm_Burmy(const Pokedex *pokedex, int formIndex); -u32 PokedexData_NumFormsSeen_Burmy(const Pokedex *pokedex); -u32 PokedexData_GetForm_Wormadam(const Pokedex *pokedex, int formIndex); -u32 PokedexData_NumFormsSeen_Wormadam(const Pokedex *pokedex); -u32 PokedexData_GetForm_Deoxys(const Pokedex *pokedex, int formIndex); -u32 PokedexData_NumFormsSeen_Deoxys(const Pokedex *pokedex); +u16 Pokedex_CountCaught_Local(const Pokedex *pokedex); +u16 Pokedex_CountSeen_Local(const Pokedex *pokedex); +BOOL Pokedex_NationalDexCompleted(const Pokedex *pokedex); +BOOL Pokedex_LocalDexCompleted(const Pokedex *pokedex); +u16 Pokedex_NumCaught_National(const Pokedex *pokedex); +u16 Pokedex_NumCaught_Local(const Pokedex *pokedex); +BOOL Pokedex_HasCaughtSpecies(const Pokedex *pokedex, u16 species); +BOOL Pokedex_HasSeenSpecies(const Pokedex *pokedex, u16 species); +u32 Pokedex_GetForm_Spinda(const Pokedex *pokedex, u8 formIndex); +u32 Pokedex_DisplayedGender(const Pokedex *pokedex, u16 species, int displaySecondary); +u32 Pokedex_GetForm_Unown(const Pokedex *pokedex, int formIndex); +u32 Pokedex_NumFormsSeen_Unown(const Pokedex *pokedex); +u32 Pokedex_GetForm_Shellos(const Pokedex *pokedex, int formIndex); +u32 Pokedex_NumFormsSeen_Shellos(const Pokedex *pokedex); +u32 Pokedex_GetForm_Gastrodon(const Pokedex *pokedex, int formIndex); +u32 Pokedex_NumFormsSeen_Gastrodon(const Pokedex *pokedex); +u32 Pokedex_GetForm_Burmy(const Pokedex *pokedex, int formIndex); +u32 Pokedex_NumFormsSeen_Burmy(const Pokedex *pokedex); +u32 Pokedex_GetForm_Wormadam(const Pokedex *pokedex, int formIndex); +u32 Pokedex_NumFormsSeen_Wormadam(const Pokedex *pokedex); +u32 Pokedex_GetForm_Deoxys(const Pokedex *pokedex, int formIndex); +u32 Pokedex_NumFormsSeen_Deoxys(const Pokedex *pokedex); void Pokedex_Encounter(Pokedex *pokedex, Pokemon *pokemon); -void PokedexData_Capture(Pokedex *pokedex, Pokemon *pokemon); -void PokedexData_ObtainNationalDex(Pokedex *pokedex); -BOOL PokedexData_IsNationalDexObtained(const Pokedex *pokedex); -BOOL PokedexData_CanDetectForms(const Pokedex *pokedex); -void PokedexData_TurnOnFormDetection(Pokedex *pokedex); -BOOL PokedexData_IsLanguageObtained(const Pokedex *pokedex, u16 species, u32 languageIndex); -void PokedexData_TurnOnLanguageDetection(Pokedex *pokedex); -BOOL PokedexData_CanDetectLanguages(const Pokedex *pokedex); +void Pokedex_Capture(Pokedex *pokedex, Pokemon *pokemon); +void Pokedex_ObtainNationalDex(Pokedex *pokedex); +BOOL Pokedex_IsNationalDexObtained(const Pokedex *pokedex); +BOOL Pokedex_CanDetectForms(const Pokedex *pokedex); +void Pokedex_TurnOnFormDetection(Pokedex *pokedex); +BOOL Pokedex_IsLanguageObtained(const Pokedex *pokedex, u16 species, u32 languageIndex); +void Pokedex_TurnOnLanguageDetection(Pokedex *pokedex); +BOOL Pokedex_CanDetectLanguages(const Pokedex *pokedex); BOOL Pokedex_IsObtained(const Pokedex *pokedex); -void PokedexData_ObtainPokedex(Pokedex *pokedex); -Pokedex *SaveData_Pokedex(SaveData *saveData); +void Pokedex_ObtainPokedex(Pokedex *pokedex); +Pokedex *SaveData_GetPokedex(SaveData *saveData); u32 Pokedex_GetDisplayForm(const Pokedex *pokedex, int species, int formIndex); -u32 PokedexData_NumFormsSeen(const Pokedex *pokedex, int species); +u32 Pokedex_NumFormsSeen(const Pokedex *pokedex, int species); #endif // POKEPLATINUM_POKEDEX_DATA_H diff --git a/res/field/scripts/scripts_pokemon_mansion_office.s b/res/field/scripts/scripts_pokemon_mansion_office.s index a35da68957..4a477656dc 100644 --- a/res/field/scripts/scripts_pokemon_mansion_office.s +++ b/res/field/scripts/scripts_pokemon_mansion_office.s @@ -305,9 +305,9 @@ _0399: _03C2: Message 20 GoToIfSet 251, _0408 - ScrCmd_337 0x1EA, 0x800C + ScrCmd_HasSeenSpecies SPECIES_MANAPHY, 0x800C GoToIfEq 0x800C, 1, _03FC - ScrCmd_208 0x1EA, 0 + ScrCmd_208 SPECIES_MANAPHY, 0 WaitABPress ScrCmd_209 SetFlag 251 diff --git a/src/battle/ov16_0223DF00.c b/src/battle/ov16_0223DF00.c index 389b4c4569..ee2b52a75a 100644 --- a/src/battle/ov16_0223DF00.c +++ b/src/battle/ov16_0223DF00.c @@ -1695,7 +1695,7 @@ void BattleSystem_DexFlagSeen(BattleSystem *battleSystem, int param1) } if (((v0 & 0x1) == 0) && (Pokemon_GetValue(v1, MON_DATA_SPECIES_EGG, NULL) == 412)) { - PokedexData_Capture(battleSystem->pokedex, v1); + Pokedex_Capture(battleSystem->pokedex, v1); } } @@ -1714,7 +1714,7 @@ void ov16_0223F9A0(BattleSystem *battleSystem, int param1) v2 = BattleContext_Get(battleSystem, battleSystem->battleCtx, 2, param1); v1 = BattleSystem_PartyPokemon(battleSystem, param1, v2); - PokedexData_Capture(battleSystem->pokedex, v1); + Pokedex_Capture(battleSystem->pokedex, v1); } } } @@ -1722,7 +1722,7 @@ void ov16_0223F9A0(BattleSystem *battleSystem, int param1) BOOL BattleSystem_CaughtSpecies(BattleSystem *battleSys, int species) { - return PokedexData_HasCaughtSpecies(battleSys->pokedex, species); + return Pokedex_HasCaughtSpecies(battleSys->pokedex, species); } void Battle_SetDefaultBlend(void) diff --git a/src/field_battle_data_transfer.c b/src/field_battle_data_transfer.c index 292a862387..e78642fe93 100644 --- a/src/field_battle_data_transfer.c +++ b/src/field_battle_data_transfer.c @@ -243,7 +243,7 @@ void FieldBattleDTO_InitFromGameState(FieldBattleDTO *dto, const FieldSystem *fi TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(save); Party *party = Party_GetFromSavedata(save); Bag *bag = SaveData_GetBag(save); - Pokedex *pokedex = SaveData_Pokedex(save); + Pokedex *pokedex = SaveData_GetPokedex(save); ChatotCry *chatotCry = GetChatotCryDataFromSave(save); Options *options = SaveData_Options(save); FieldOverworldState *fieldOverworldState = SaveData_GetFieldOverworldState(save); @@ -296,7 +296,7 @@ void FieldBattleDTO_InitWithNormalizedMonLevels(FieldBattleDTO *dto, const Field TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); Party *party = Party_GetFromSavedata(fieldSystem->saveData); Bag *bag = SaveData_GetBag(fieldSystem->saveData); - Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); ChatotCry *chatotCry = GetChatotCryDataFromSave(fieldSystem->saveData); Options *options = SaveData_Options(fieldSystem->saveData); @@ -344,7 +344,7 @@ void FieldBattleDTO_InitWithPartyOrder(FieldBattleDTO *dto, const FieldSystem *f { TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); Bag *bag = SaveData_GetBag(fieldSystem->saveData); - Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); ChatotCry *chatotCry = GetChatotCryDataFromSave(fieldSystem->saveData); Options *options = SaveData_Options(fieldSystem->saveData); const BattleRegulation *regulation = fieldSystem->unk_B0; @@ -424,7 +424,7 @@ void FieldBattleDTO_UpdateFieldSystem(const FieldBattleDTO *dto, FieldSystem *fi TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); Party *party = Party_GetFromSavedata(fieldSystem->saveData); Bag *bag = SaveData_GetBag(fieldSystem->saveData); - Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); u16 *fieldSysSafariBalls = FieldOverworldState_GetSafariBallCount(SaveData_GetFieldOverworldState(fieldSystem->saveData)); TrainerInfo_Copy(dto->trainerInfo[BATTLER_PLAYER_1], trainerInfo); @@ -440,7 +440,7 @@ void FieldBattleDTO_UpdatePokedex(const FieldBattleDTO *dto, FieldSystem *fieldS TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); Party *party = Party_GetFromSavedata(fieldSystem->saveData); Bag *bag = SaveData_GetBag(fieldSystem->saveData); - Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); Pokedex_Copy(dto->pokedex, pokedex); } diff --git a/src/field_menu.c b/src/field_menu.c index b5e120dbb8..454dd1a594 100644 --- a/src/field_menu.c +++ b/src/field_menu.c @@ -360,7 +360,7 @@ static u32 sub_0203ABD0(FieldSystem *fieldSystem) { u32 v0 = 0; - if (Pokedex_IsObtained(SaveData_Pokedex(fieldSystem->saveData)) == FALSE) { + if (Pokedex_IsObtained(SaveData_GetPokedex(fieldSystem->saveData)) == FALSE) { v0 |= 0x1; } @@ -949,7 +949,7 @@ static BOOL FieldMenu_Pokedex(FieldTask *taskMan) fieldSystem = FieldTask_GetFieldSystem(taskMan); menu = FieldTask_GetEnv(taskMan); v2 = Heap_AllocFromHeap(11, sizeof(UnkStruct_ov21_021D0D80)); - pokedex = SaveData_Pokedex(fieldSystem->saveData); + pokedex = SaveData_GetPokedex(fieldSystem->saveData); trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); varsFlags = SaveData_GetVarsFlags(fieldSystem->saveData); @@ -1930,9 +1930,9 @@ static void FieldMenu_EvolveInit(FieldTask *taskMan) v4 = Party_GetPokemonBySlotIndex(v3, v2->unk_00); if (v2->unk_01 == 0) { - v5 = sub_0207AE68(v3, v4, v2->unk_04, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_Pokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v2->unk_08, 0x1, 73); + v5 = sub_0207AE68(v3, v4, v2->unk_04, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_GetPokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v2->unk_08, 0x1, 73); } else { - v5 = sub_0207AE68(v3, v4, v2->unk_04, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_Pokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v2->unk_08, NULL, 73); + v5 = sub_0207AE68(v3, v4, v2->unk_04, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_GetPokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v2->unk_08, NULL, 73); } { diff --git a/src/game_records.c b/src/game_records.c index 2aca82fd73..095d20beee 100644 --- a/src/game_records.c +++ b/src/game_records.c @@ -409,7 +409,7 @@ u32 GameRecords_GetTrainerScore(GameRecords *records) void GameRecords_IncrementTrainerScoreOnCatch(GameRecords *records, const Pokedex *pokedex, const u16 species) { - if (!PokedexData_HasCaughtSpecies(pokedex, species)) { + if (!Pokedex_HasCaughtSpecies(pokedex, species)) { GameRecords_IncrementTrainerScore(records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); } } diff --git a/src/overlay005/ov5_021F6454.c b/src/overlay005/ov5_021F6454.c index 5f6fd7fe19..fe5accd9c3 100644 --- a/src/overlay005/ov5_021F6454.c +++ b/src/overlay005/ov5_021F6454.c @@ -676,7 +676,7 @@ BOOL ScrCmd_304(ScriptContext *param0) v4 = Party_GetPokemonBySlotIndex(v5, v7); Pokemon_SetRotomForm(v4, v10, v8); - PokedexData_Capture(SaveData_Pokedex(fieldSystem->saveData), v4); + Pokedex_Capture(SaveData_GetPokedex(fieldSystem->saveData), v4); return 0; } diff --git a/src/overlay005/ov5_021F77A8.c b/src/overlay005/ov5_021F77A8.c index f89313b601..53ed8032e0 100644 --- a/src/overlay005/ov5_021F77A8.c +++ b/src/overlay005/ov5_021F77A8.c @@ -86,48 +86,47 @@ static void ov5_021F819C(ListMenu *param0, u32 param1, u8 param2); static void ov5_021F81A8(SysTask *param0, void *param1); static void ov5_021F8250(UnkStruct_ov5_021F7ED8 *param0); -BOOL ScrCmd_337(ScriptContext *param0) +BOOL ScrCmd_HasSeenSpecies(ScriptContext *ctx) { - u16 v0 = FieldSystem_TryGetVar(param0->fieldSystem, ScriptContext_ReadHalfWord(param0)); - u16 *v1 = FieldSystem_GetVarPointer(param0->fieldSystem, ScriptContext_ReadHalfWord(param0)); - Pokedex *v2 = SaveData_Pokedex(param0->fieldSystem->saveData); + u16 species = FieldSystem_TryGetVar(ctx->fieldSystem, ScriptContext_ReadHalfWord(ctx)); + u16 *seen = FieldSystem_GetVarPointer(ctx->fieldSystem, ScriptContext_ReadHalfWord(ctx)); - *v1 = PokedexData_HasSeenSpecies(v2, v0); + *seen = Pokedex_HasSeenSpecies(SaveData_GetPokedex(ctx->fieldSystem->saveData), species); return 0; } -BOOL ScrCmd_2E5(ScriptContext *param0) +BOOL ScrCmd_2E5(ScriptContext *ctx) { Pokemon *v0; - u16 v1 = ScriptContext_GetVar(param0); - u16 v2 = ScriptContext_GetVar(param0); - u16 *v3 = ScriptContext_GetVarPointer(param0); + u16 v1 = ScriptContext_GetVar(ctx); + u16 v2 = ScriptContext_GetVar(ctx); + u16 *v3 = ScriptContext_GetVarPointer(ctx); - v0 = Party_GetPokemonBySlotIndex(Party_GetFromSavedata(param0->fieldSystem->saveData), v1); + v0 = Party_GetPokemonBySlotIndex(Party_GetFromSavedata(ctx->fieldSystem->saveData), v1); *v3 = ov5_021F7B60(v0, v2); return 0; } -BOOL ScrCmd_2E9(ScriptContext *param0) +BOOL ScrCmd_2E9(ScriptContext *ctx) { - u16 v0 = ScriptContext_GetVar(param0); - u16 v1 = ScriptContext_GetVar(param0); - u16 v2 = ScriptContext_GetVar(param0); + u16 v0 = ScriptContext_GetVar(ctx); + u16 v1 = ScriptContext_GetVar(ctx); + u16 v2 = ScriptContext_GetVar(ctx); - sub_02054988(Party_GetFromSavedata(param0->fieldSystem->saveData), v0, v1, v2); + sub_02054988(Party_GetFromSavedata(ctx->fieldSystem->saveData), v0, v1, v2); return 0; } -BOOL ScrCmd_2EA(ScriptContext *param0) +BOOL ScrCmd_2EA(ScriptContext *ctx) { int v0; u8 v1, v2, v3, v4; Bag *v5; - u16 v6 = ScriptContext_GetVar(param0); - u16 *v7 = ScriptContext_GetVarPointer(param0); + u16 v6 = ScriptContext_GetVar(ctx); + u16 *v7 = ScriptContext_GetVarPointer(ctx); - v5 = SaveData_GetBag(param0->fieldSystem->saveData); + v5 = SaveData_GetBag(ctx->fieldSystem->saveData); for (v0 = 0; v0 < (NELEMS(sTeachableMoves)); v0++) { if (v6 == sTeachableMoves[v0].moveID) { @@ -174,14 +173,14 @@ BOOL ScrCmd_2EA(ScriptContext *param0) return 0; } -BOOL ScrCmd_2EB(ScriptContext *param0) +BOOL ScrCmd_2EB(ScriptContext *ctx) { int v0; u8 v1, v2, v3, v4; Bag *v5; - u16 v6 = ScriptContext_GetVar(param0); + u16 v6 = ScriptContext_GetVar(ctx); - v5 = SaveData_GetBag(param0->fieldSystem->saveData); + v5 = SaveData_GetBag(ctx->fieldSystem->saveData); for (v0 = 0; v0 < (NELEMS(sTeachableMoves)); v0++) { if (v6 == sTeachableMoves[v0].moveID) { diff --git a/src/overlay005/save_info_window.c b/src/overlay005/save_info_window.c index 344350d48c..2a3baa25dd 100644 --- a/src/overlay005/save_info_window.c +++ b/src/overlay005/save_info_window.c @@ -51,7 +51,7 @@ static void SaveInfo_SetValues(SaveInfo *saveInfo, const FieldSystem *fieldSyste { SaveData *saveData = fieldSystem->saveData; Location *curLocation = FieldOverworldState_GetPlayerLocation(SaveData_GetFieldOverworldState(saveData)); - Pokedex *pokedex = SaveData_Pokedex(saveData); + Pokedex *pokedex = SaveData_GetPokedex(saveData); saveInfo->mapLabelTextID = MapHeader_GetMapLabelTextID(curLocation->mapId); diff --git a/src/overlay006/ov6_02240C9C.c b/src/overlay006/ov6_02240C9C.c index 70511f983b..73f11fc93f 100644 --- a/src/overlay006/ov6_02240C9C.c +++ b/src/overlay006/ov6_02240C9C.c @@ -325,7 +325,7 @@ BOOL ov6_02240D5C(FieldSystem *fieldSystem) v13[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_Pokedex(FieldSystem_GetSaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_IsNationalDexObtained(SaveData_GetPokedex(FieldSystem_GetSaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v13[2].species, &v13[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v13[0].species, &v13[1].species); @@ -513,7 +513,7 @@ BOOL ov6_022411C8(FieldSystem *fieldSystem, FieldTask *param1) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_Pokedex(FieldSystem_GetSaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_IsNationalDexObtained(SaveData_GetPokedex(FieldSystem_GetSaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); @@ -642,7 +642,7 @@ BOOL ov6_022413E4(FieldSystem *fieldSystem, FieldBattleDTO **battleParams) v12[i].minLevel = encounterData->grassEncounters.encounters[i].level; } - BOOL nationalDexObtained = PokedexData_IsNationalDexObtained(SaveData_Pokedex(FieldSystem_GetSaveData(fieldSystem))); + BOOL nationalDexObtained = Pokedex_IsNationalDexObtained(SaveData_GetPokedex(FieldSystem_GetSaveData(fieldSystem))); WildEncounters_ReplaceTimedEncounters(encounterData, &v12[2].species, &v12[3].species); WildEncounters_ReplaceRadarEncounters(fieldSystem, encounterData, &v12[0].species, &v12[1].species); diff --git a/src/overlay006/ov6_02242984.c b/src/overlay006/ov6_02242984.c index 9985dbcc1a..10e1c2130a 100644 --- a/src/overlay006/ov6_02242984.c +++ b/src/overlay006/ov6_02242984.c @@ -42,7 +42,7 @@ int ov6_02242984(FieldSystem *fieldSystem) v2[i] = encounterData->grassEncounters.encounters[i].species; } - BOOL v1 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(FieldSystem_GetSaveData(fieldSystem))); + BOOL v1 = Pokedex_IsNationalDexObtained(SaveData_GetPokedex(FieldSystem_GetSaveData(fieldSystem))); ov6_02242F74(sub_0202D814(sub_0202D834(fieldSystem->saveData), 1), v1, fieldSystem->location->mapId, &v2[6], &v2[7]); WildEncounters_ReplaceTimedEncounters(encounterData, &v2[2], &v2[3]); diff --git a/src/overlay006/ov6_02246A30.c b/src/overlay006/ov6_02246A30.c index 704de32fc6..00b29fa8de 100644 --- a/src/overlay006/ov6_02246A30.c +++ b/src/overlay006/ov6_02246A30.c @@ -97,45 +97,39 @@ static BOOL ov6_02246A34(FieldSystem *fieldSystem) static BOOL ov6_02246A38(FieldSystem *fieldSystem) { - VarsFlags *v0 = SaveData_GetVarsFlags(fieldSystem->saveData); - return SystemFlag_HandleFirstArrivalToZone(v0, HANDLE_FLAG_CHECK, FIRST_ARRIVAL_JUBILIFE_CITY); + return SystemFlag_HandleFirstArrivalToZone(SaveData_GetVarsFlags(fieldSystem->saveData), HANDLE_FLAG_CHECK, FIRST_ARRIVAL_JUBILIFE_CITY); } static BOOL ov6_02246A4C(FieldSystem *fieldSystem) { - VarsFlags *v0 = SaveData_GetVarsFlags(fieldSystem->saveData); - return SystemFlag_HandleFirstArrivalToZone(v0, HANDLE_FLAG_CHECK, FIRST_ARRIVAL_FLOAROMA_TOWN); + return SystemFlag_HandleFirstArrivalToZone(SaveData_GetVarsFlags(fieldSystem->saveData), HANDLE_FLAG_CHECK, FIRST_ARRIVAL_FLOAROMA_TOWN); } static BOOL ov6_02246A60(FieldSystem *fieldSystem) { - VarsFlags *v0 = SaveData_GetVarsFlags(fieldSystem->saveData); - return SystemFlag_HandleFirstArrivalToZone(v0, HANDLE_FLAG_CHECK, FIRST_ARRIVAL_OREBURGH_CITY); + return SystemFlag_HandleFirstArrivalToZone(SaveData_GetVarsFlags(fieldSystem->saveData), HANDLE_FLAG_CHECK, FIRST_ARRIVAL_OREBURGH_CITY); } static BOOL ov6_02246A74(FieldSystem *fieldSystem) { - VarsFlags *v0 = SaveData_GetVarsFlags(fieldSystem->saveData); - return SystemFlag_HandleFirstArrivalToZone(v0, HANDLE_FLAG_CHECK, FIRST_ARRIVAL_ETERNA_CITY); + return SystemFlag_HandleFirstArrivalToZone(SaveData_GetVarsFlags(fieldSystem->saveData), HANDLE_FLAG_CHECK, FIRST_ARRIVAL_ETERNA_CITY); } static BOOL ov6_02246A88(FieldSystem *fieldSystem) { - VarsFlags *v0 = SaveData_GetVarsFlags(fieldSystem->saveData); - return SystemFlag_HandleFirstArrivalToZone(v0, HANDLE_FLAG_CHECK, FIRST_ARRIVAL_HEARTHOME_CITY); + return SystemFlag_HandleFirstArrivalToZone(SaveData_GetVarsFlags(fieldSystem->saveData), HANDLE_FLAG_CHECK, FIRST_ARRIVAL_HEARTHOME_CITY); } static BOOL ov6_02246A9C(FieldSystem *fieldSystem) { - VarsFlags *v0 = SaveData_GetVarsFlags(fieldSystem->saveData); - return SystemFlag_HandleFirstArrivalToZone(v0, HANDLE_FLAG_CHECK, FIRST_ARRIVAL_FIGHT_AREA); + return SystemFlag_HandleFirstArrivalToZone(SaveData_GetVarsFlags(fieldSystem->saveData), HANDLE_FLAG_CHECK, FIRST_ARRIVAL_FIGHT_AREA); } static BOOL ov6_02246AB0(FieldSystem *fieldSystem) { - TrainerInfo *v0 = SaveData_GetTrainerInfo(fieldSystem->saveData); + TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); - if (TrainerInfo_BadgeCount(v0) >= 5) { + if (TrainerInfo_BadgeCount(trainerInfo) >= 5) { return 1; } else { return 0; @@ -144,20 +138,17 @@ static BOOL ov6_02246AB0(FieldSystem *fieldSystem) static BOOL ov6_02246AC8(FieldSystem *fieldSystem) { - Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); - return PokedexData_LocalDexCompleted(v0); + return Pokedex_LocalDexCompleted(SaveData_GetPokedex(fieldSystem->saveData)); } static BOOL ov6_02246AD8(FieldSystem *fieldSystem) { - Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); - return Pokedex_IsObtained(pokedex); + return Pokedex_IsObtained(SaveData_GetPokedex(fieldSystem->saveData)); } static BOOL ov6_02246AE8(FieldSystem *fieldSystem) { - VarsFlags *v0 = SaveData_GetVarsFlags(fieldSystem->saveData); - return SystemFlag_CheckGameCompleted(v0); + return SystemFlag_CheckGameCompleted(SaveData_GetVarsFlags(fieldSystem->saveData)); } static int ov6_02246AF8(FieldSystem *fieldSystem, u8 *param1) diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 019b2e0fb0..c276a25647 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -313,7 +313,7 @@ UnkStruct_ov21_021D0F60 *ov21_021D0F60(int param0, const UnkStruct_ov21_021D0D80 v0->unk_1D6C = ov21_021D3FE0(param0); v0->unk_1D70 = ov21_021D3FE0(param0); - v2.dexData = param1->pokedex; + v2.pokedex = param1->pokedex; v2.unk_04 = param1->trainerInfo; v2.timeOfDay = param1->timeOfDay; v2.fullmoonIslandVisible = param1->fullmoonIslandVisible; diff --git a/src/overlay021/pokedex_sort.c b/src/overlay021/pokedex_sort.c index eb1aad134d..38a389902a 100644 --- a/src/overlay021/pokedex_sort.c +++ b/src/overlay021/pokedex_sort.c @@ -74,17 +74,17 @@ enum PokedexDataSortIndex { PDSI_NUMSORTS }; -static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const Pokedex *dexData, const u16 *fullDex, int pokedexLength); -static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const Pokedex *dexData); -static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const Pokedex *dexData, const u16 *encounteredPokedex, int caughtStatusLength); +static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const Pokedex *pokedex, const u16 *fullDex, int pokedexLength); +static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const Pokedex *pokedex); +static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const Pokedex *pokedex, const u16 *encounteredPokedex, int caughtStatusLength); static void PopulateDisplayPokedex_Blanks(SortedPokedex *sortedPokedex, const u16 *fullDex, int pokedexLength); static void PopulateDisplayPokedex(SortedPokedex *sortedPokedex); static void NumEncounteredAndCaught(SortedPokedex *sortedPokedex, int *caughtStatusLength, int *numCaught); static u16 *PokedexFromNARC(int heapID, int pokedexSort, int *pokedexLength); -static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData); -static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData); -static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData); -static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData); +static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *pokedex); +static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *pokedex); +static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *pokedex); +static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *pokedex); void PokedexSort_PopulatePokedexStatus(UnkStruct_ov21_021D3320 *param0, UnkStruct_ov21_021D3208 *param1, int heapID) { @@ -98,10 +98,10 @@ void PokedexSort_PopulatePokedexStatus(UnkStruct_ov21_021D3320 *param0, UnkStruc memset(param0, 0, sizeof(UnkStruct_ov21_021D3320)); - param0->dexData = param1->dexData; + param0->pokedex = param1->pokedex; param0->timeOfDay = param1->timeOfDay; - if (PokedexData_IsNationalDexObtained(param0->dexData)) { + if (Pokedex_IsNationalDexObtained(param0->pokedex)) { param0->isNationalDexUnlocked = TRUE; } else { param0->isNationalDexUnlocked = FALSE; @@ -171,7 +171,7 @@ u32 ov21_021D334C(const UnkStruct_ov21_021D3320 *param0, int param1, int param2) { u32 v0; - v0 = PokedexData_DisplayedGender(param0->dexData, param1, param2); + v0 = Pokedex_DisplayedGender(param0->pokedex, param1, param2); return v0; } @@ -180,7 +180,7 @@ u32 ov21_021D335C(const UnkStruct_ov21_021D3320 *param0, int param1) int v0; GF_ASSERT(param1 < 28); - v0 = PokedexData_GetForm_Unown(param0->dexData, param1); + v0 = Pokedex_GetForm_Unown(param0->pokedex, param1); return v0; } @@ -190,7 +190,7 @@ u32 ov21_021D3374(const UnkStruct_ov21_021D3320 *param0, int param1) u32 v0; GF_ASSERT(param1 < 2); - v0 = PokedexData_GetForm_Shellos(param0->dexData, param1); + v0 = Pokedex_GetForm_Shellos(param0->pokedex, param1); return v0; } @@ -201,7 +201,7 @@ u32 ov21_021D338C(const UnkStruct_ov21_021D3320 *param0, int param1) GF_ASSERT(param1 < 2); - v0 = PokedexData_GetForm_Gastrodon(param0->dexData, param1); + v0 = Pokedex_GetForm_Gastrodon(param0->pokedex, param1); return v0; } @@ -211,7 +211,7 @@ u32 ov21_021D33A4(const UnkStruct_ov21_021D3320 *param0, int param1) GF_ASSERT(param1 < 3); - v0 = PokedexData_GetForm_Burmy(param0->dexData, param1); + v0 = Pokedex_GetForm_Burmy(param0->pokedex, param1); return v0; } @@ -221,13 +221,13 @@ u32 ov21_021D33BC(const UnkStruct_ov21_021D3320 *param0, int param1) GF_ASSERT(param1 < 3); - v0 = PokedexData_GetForm_Wormadam(param0->dexData, param1); + v0 = Pokedex_GetForm_Wormadam(param0->pokedex, param1); return v0; } u32 ov21_021D33D4(const UnkStruct_ov21_021D3320 *param0, u32 species) { - return Pokedex_GetDisplayForm(param0->dexData, species, 0); + return Pokedex_GetDisplayForm(param0->pokedex, species, 0); } u32 ov21_021D33E0(const UnkStruct_ov21_021D3320 *param0, int param1) @@ -243,27 +243,27 @@ u32 ov21_021D33E0(const UnkStruct_ov21_021D3320 *param0, int param1) u32 ov21_021D33F8(const UnkStruct_ov21_021D3320 *param0) { - return PokedexData_GetForm_Spinda(param0->dexData, 0); + return Pokedex_GetForm_Spinda(param0->pokedex, 0); } u32 ov21_021D3404(const UnkStruct_ov21_021D3320 *param0, int param1) { - return PokedexData_GetForm_Deoxys(param0->dexData, param1); + return Pokedex_GetForm_Deoxys(param0->pokedex, param1); } u32 ov21_021D3410(const UnkStruct_ov21_021D3320 *param0, u32 param1, int param2) { - return Pokedex_GetDisplayForm(param0->dexData, param1, param2); + return Pokedex_GetDisplayForm(param0->pokedex, param1, param2); } u32 ov21_021D341C(const UnkStruct_ov21_021D3320 *param0, u32 param1) { - return PokedexData_NumFormsSeen(param0->dexData, param1); + return Pokedex_NumFormsSeen(param0->pokedex, param1); } BOOL PokedexSort_IsNationalUnlocked(const UnkStruct_ov21_021D3320 *param0) { - return PokedexData_IsNationalDexObtained(param0->dexData); + return Pokedex_IsNationalDexObtained(param0->pokedex); } void ov21_021D3434(UnkStruct_ov21_021D3320 *param0, u32 param1) @@ -311,13 +311,13 @@ BOOL PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filter if (isNationalDex == FALSE) { fullDex = PokedexFromNARC(heapID, PDSI_SINNOH, &fullDexLength); - FilterUnencountered(encounteredPokedex, &caughtStatusLength, param0->dexData, fullDex, fullDexLength); + FilterUnencountered(encounteredPokedex, &caughtStatusLength, param0->pokedex, fullDex, fullDexLength); } else { fullDex = PokedexFromNARC(heapID, PDSI_NATIONAL, &fullDexLength); - FilterUnencountered(encounteredPokedex, &caughtStatusLength, param0->dexData, fullDex, fullDexLength); + FilterUnencountered(encounteredPokedex, &caughtStatusLength, param0->pokedex, fullDex, fullDexLength); } - DexSortOrder(sortOrder, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + DexSortOrder(sortOrder, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->pokedex); memcpy(encounteredPokedex, resultingPokedex, sizeof(u16) * numResulting); caughtStatusLength = numResulting; @@ -326,7 +326,7 @@ BOOL PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filter numResulting = 0; do { - FilterByName(filterName, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + FilterByName(filterName, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->pokedex); if (numResulting == 0) { dexExists = FALSE; @@ -339,7 +339,7 @@ BOOL PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filter memset(resultingPokedex, 0, sizeof(u16) * numResulting); numResulting = 0; - FilterByType(filterType1, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + FilterByType(filterType1, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->pokedex); if (numResulting == 0) { dexExists = FALSE; @@ -352,7 +352,7 @@ BOOL PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filter memset(resultingPokedex, 0, sizeof(u16) * numResulting); numResulting = 0; - FilterByType(filterType2, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + FilterByType(filterType2, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->pokedex); if (numResulting == 0) { dexExists = FALSE; @@ -365,7 +365,7 @@ BOOL PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filter memset(resultingPokedex, 0, sizeof(u16) * numResulting); numResulting = 0; - FilterByForm(filterForm, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->dexData); + FilterByForm(filterForm, resultingPokedex, &numResulting, encounteredPokedex, caughtStatusLength, heapID, param0->pokedex); if (numResulting == 0) { dexExists = FALSE; @@ -378,7 +378,7 @@ BOOL PokedexSort_Sort(UnkStruct_ov21_021D3320 *param0, int sortOrder, int filter memset(resultingPokedex, 0, sizeof(u16) * numResulting); numResulting = 0; - UpdateCaughtStatus(¶m0->sortedPokedex, param0->dexData, encounteredPokedex, caughtStatusLength); + UpdateCaughtStatus(¶m0->sortedPokedex, param0->pokedex, encounteredPokedex, caughtStatusLength); if ((sortOrder != SO_NUMERICAL) || (filterName != FN_NONE) || (filterType1 != FT_NONE) || (filterType2 != FT_NONE) || (filterForm != FF_NONE)) { isFiltered = TRUE; @@ -620,16 +620,16 @@ BOOL ov21_021D392C(const UnkStruct_ov21_021D3320 *param0, int param1) { int species = PokedexSort_CurrentSpecies(param0); - if (PokedexData_CanDetectLanguages(param0->dexData) == 0) { + if (Pokedex_CanDetectLanguages(param0->pokedex) == 0) { return FALSE; } - return PokedexData_IsLanguageObtained(param0->dexData, species, param1); + return Pokedex_IsLanguageObtained(param0->pokedex, species, param1); } BOOL PokedexSort_CanDetectForms(const UnkStruct_ov21_021D3320 *param0) { - return PokedexData_CanDetectForms(param0->dexData); + return Pokedex_CanDetectForms(param0->pokedex); } void ov21_021D3960(UnkStruct_ov21_021D3320 *param0) @@ -653,19 +653,19 @@ u32 ov21_021D3998(const UnkStruct_ov21_021D3320 *param0) return param0->unk_1758; } -static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const Pokedex *dexData, const u16 *fullDex, int pokedexLength) +static void FilterUnencountered(u16 *encounteredDex, int *caughtStatusLength, const Pokedex *pokedex, const u16 *fullDex, int pokedexLength) { *caughtStatusLength = 0; for (int species = 0; species < pokedexLength; species++) { - if (PokedexData_HasSeenSpecies(dexData, fullDex[species])) { + if (Pokedex_HasSeenSpecies(pokedex, fullDex[species])) { encounteredDex[*caughtStatusLength] = fullDex[species]; (*caughtStatusLength)++; } } } -static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const Pokedex *dexData) +static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u16 *pokedex1, int dexLen1, const u16 *pokedex2, int dexLen2, BOOL keepUncaught, const Pokedex *pokedex) { int dexIndex2; @@ -677,7 +677,7 @@ static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u if (keepUncaught == TRUE) { break; } else { - if (PokedexData_HasCaughtSpecies(dexData, pokedex1[dexIndex1])) { + if (Pokedex_HasCaughtSpecies(pokedex, pokedex1[dexIndex1])) { break; } } @@ -691,12 +691,12 @@ static void IntersectPokedexes(u16 *resultingPokedex, int *numResulting, const u } } -static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const Pokedex *dexData, const u16 *encounteredPokedex, int caughtStatusLength) +static void UpdateCaughtStatus(SortedPokedex *sortedPokedex, const Pokedex *pokedex, const u16 *encounteredPokedex, int caughtStatusLength) { sortedPokedex->caughtStatusLength = 0; for (int dexIndex = 0; dexIndex < caughtStatusLength; dexIndex++) { - if (PokedexData_HasCaughtSpecies(dexData, encounteredPokedex[dexIndex])) { + if (Pokedex_HasCaughtSpecies(pokedex, encounteredPokedex[dexIndex])) { sortedPokedex->caughtStatusArray[sortedPokedex->caughtStatusLength].caughtStatus = CS_CAUGHT; } else { sortedPokedex->caughtStatusArray[sortedPokedex->caughtStatusLength].caughtStatus = CS_ENCOUNTERED; @@ -749,7 +749,7 @@ static u16 *PokedexFromNARC(int heapID, int pokedexSort, int *pokedexLength) return pokedexFromFile; } -static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData) +static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *pokedex) { u16 *pokedexFromFile; int pokedexLength; @@ -781,7 +781,7 @@ static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting } if (pokedexFromFile != NULL) { - IntersectPokedexes(resultingPokedex, numResulting, pokedexFromFile, pokedexLength, encounteredPokedex, caughtStatusLength, keepUncaught, dexData); + IntersectPokedexes(resultingPokedex, numResulting, pokedexFromFile, pokedexLength, encounteredPokedex, caughtStatusLength, keepUncaught, pokedex); Heap_FreeToHeap(pokedexFromFile); } else { memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); @@ -789,7 +789,7 @@ static void DexSortOrder(int sortOrder, u16 *resultingPokedex, int *numResulting } } -static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData) +static void FilterByName(int filterName, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *pokedex) { u16 *pokedexFromFile; int pokedexLength; @@ -831,7 +831,7 @@ static void FilterByName(int filterName, u16 *resultingPokedex, int *numResultin } if (pokedexFromFile != NULL) { - IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, dexData); + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, pokedex); Heap_FreeToHeap(pokedexFromFile); } else { memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); @@ -839,7 +839,7 @@ static void FilterByName(int filterName, u16 *resultingPokedex, int *numResultin } } -static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData) +static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *pokedex) { u16 *pokedexFromFile; int pokedexLength; @@ -905,7 +905,7 @@ static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResultin } if (pokedexFromFile != NULL) { - IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, FALSE, dexData); + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, FALSE, pokedex); Heap_FreeToHeap(pokedexFromFile); } else { memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); @@ -913,7 +913,7 @@ static void FilterByType(int typeFilter, u16 *resultingPokedex, int *numResultin } } -static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *dexData) +static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResulting, const u16 *encounteredPokedex, int caughtStatusLength, int heapID, const Pokedex *pokedex) { u16 *pokedexFromFile; int pokedexLength; @@ -970,7 +970,7 @@ static void FilterByForm(int filterForm, u16 *resultingPokedex, int *numResultin } if (pokedexFromFile != NULL) { - IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, dexData); + IntersectPokedexes(resultingPokedex, numResulting, encounteredPokedex, caughtStatusLength, pokedexFromFile, pokedexLength, TRUE, pokedex); Heap_FreeToHeap(pokedexFromFile); } else { memcpy(resultingPokedex, encounteredPokedex, (sizeof(u16)) * caughtStatusLength); diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index 9d7839ed2f..b3567f33d1 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -1777,10 +1777,10 @@ static BOOL ov23_0223F838(int param0, int param1, int param2) static int ov23_0223F970(UnkStruct_ov23_02256EB0 *param0) { - SaveData *v0 = FieldSystem_GetSaveData(Unk_ov23_02257740->fieldSystem); - UndergroundData *v1 = sub_020298B0(v0); - BOOL v2 = TrainerInfo_ID(SaveData_GetTrainerInfo(v0)) % 2; - BOOL v3 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(v0)); + SaveData *saveData = FieldSystem_GetSaveData(Unk_ov23_02257740->fieldSystem); + UndergroundData *v1 = sub_020298B0(saveData); + BOOL v2 = TrainerInfo_ID(SaveData_GetTrainerInfo(saveData)) % 2; + BOOL v3 = Pokedex_IsNationalDexObtained(SaveData_GetPokedex(saveData)); int v4 = 0; if (v3) { diff --git a/src/overlay023/ov23_022521F0.c b/src/overlay023/ov23_022521F0.c index 08a3797b58..919511996f 100644 --- a/src/overlay023/ov23_022521F0.c +++ b/src/overlay023/ov23_022521F0.c @@ -131,9 +131,9 @@ static void ov23_022522F0(UnkStruct_ov23_02250CD4 *param0, int param1) { MATHRandContext16 v0; int v1, v2, v3, v4, v5; - SaveData *v6 = FieldSystem_GetSaveData(param0->fieldSystem); - UndergroundData *v7 = sub_020298B0(v6); - BOOL v8 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(v6)); + SaveData *saveData = FieldSystem_GetSaveData(param0->fieldSystem); + UndergroundData *v7 = sub_020298B0(saveData); + BOOL natdexObtained = Pokedex_IsNationalDexObtained(SaveData_GetPokedex(saveData)); MATH_InitRand16(&v0, sub_02028930(v7) + param1); @@ -154,7 +154,7 @@ static void ov23_022522F0(UnkStruct_ov23_02250CD4 *param0, int param1) param0->unk_274[v5] = v1; param0->unk_279[v5] = sub_0205742C(v1); - if ((v8 == 0) && (1 == sub_0205747C(v1))) { + if ((natdexObtained == 0) && (1 == sub_0205747C(v1))) { v5--; continue; } diff --git a/src/overlay028/ov28_022561C0.c b/src/overlay028/ov28_022561C0.c index a845eb8565..8faf11eda3 100644 --- a/src/overlay028/ov28_022561C0.c +++ b/src/overlay028/ov28_022561C0.c @@ -632,18 +632,18 @@ static void ov28_02256914(UnkStruct_ov28_02256210 *param0, const UnkStruct_ov28_ s64 v0 = ov28_02257468(param1); if ((v0 > 0) && (v0 <= NATIONAL_DEX_COUNT)) { - Pokedex *v1; + Pokedex *pokedex; u16 v2; - v1 = SaveData_Pokedex(PoketchSystem_GetSaveData(param0->poketchSys)); + pokedex = SaveData_GetPokedex(PoketchSystem_GetSaveData(param0->poketchSys)); - if (PokedexData_IsNationalDexObtained(v1)) { + if (Pokedex_IsNationalDexObtained(pokedex)) { v2 = v0; } else { v2 = Pokemon_NationalDexNumber((u16)v0); } - if (v2 > 0 && v2 <= NATIONAL_DEX_COUNT && PokedexData_HasSeenSpecies(v1, v2)) { + if (v2 > 0 && v2 <= NATIONAL_DEX_COUNT && Pokedex_HasSeenSpecies(pokedex, v2)) { ov25_02254444(v2, 0); } } diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index f8b42f1f3f..f646a4899b 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -1472,10 +1472,10 @@ static BOOL ov62_02239984(UnkStruct_0208C06C *param0, int param1) int v7; int v8 = 0; BOOL v9; - Pokedex *v10 = SaveData_Pokedex(param0->unk_830); + Pokedex *pokedex = SaveData_GetPokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { - v9 = PokedexData_HasSeenSpecies(v10, v1[v7]); + v9 = Pokedex_HasSeenSpecies(pokedex, v1[v7]); if (v9 == 0) { v1[v7] = 0xFFFF; @@ -1516,12 +1516,12 @@ static void ov62_02239A0C(UnkStruct_0208C06C *param0, int param1) int v5; int v6 = 0; BOOL v7; - Pokedex *v8 = SaveData_Pokedex(param0->unk_830); + Pokedex *v8 = SaveData_GetPokedex(param0->unk_830); v4->unk_1D4.unk_00 = 0; for (v5 = v2; v5 < v3; v5++) { - v7 = PokedexData_HasSeenSpecies(v8, v0[v5]); + v7 = Pokedex_HasSeenSpecies(v8, v0[v5]); if (v7 == 0) { v0[v5] = 0xFFFF; diff --git a/src/overlay062/ov62_02241204.c b/src/overlay062/ov62_02241204.c index 6af7a7ef39..d0f2141fed 100644 --- a/src/overlay062/ov62_02241204.c +++ b/src/overlay062/ov62_02241204.c @@ -1516,10 +1516,10 @@ static BOOL ov62_02242748 (UnkStruct_0208C06C * param0, int param1) int v7; int v8 = 0; BOOL v9; - Pokedex * v10 = SaveData_Pokedex(param0->unk_830); + Pokedex * v10 = SaveData_GetPokedex(param0->unk_830); for (v7 = v3; v7 < v4; v7++) { - v9 = PokedexData_HasSeenSpecies(v10, v1[v7]); + v9 = Pokedex_HasSeenSpecies(v10, v1[v7]); if (v9 == 0) { v1[v7] = 0xFFFF; @@ -1560,12 +1560,12 @@ static void ov62_022427D0 (UnkStruct_0208C06C * param0, int param1) int v5; int v6 = 0; BOOL v7; - Pokedex * v8 = SaveData_Pokedex(param0->unk_830); + Pokedex * v8 = SaveData_GetPokedex(param0->unk_830); v4->unk_4C8.unk_00 = 0; for (v5 = v2; v5 < v3; v5++) { - v7 = PokedexData_HasSeenSpecies(v8, v0[v5]); + v7 = Pokedex_HasSeenSpecies(v8, v0[v5]); if (v7 == 0) { v0[v5] = 0xFFFF; diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index c824a9d567..d1ce99f935 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -1795,7 +1795,7 @@ static int ov65_0222F490 (UnkStruct_ov65_0222EBE0 * param0, int param1) static void ov65_0222F4C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) { TrainerInfo * v0 = SaveData_GetTrainerInfo(param0->unk_160); - Pokedex * v1 = SaveData_Pokedex(param0->unk_160); + Pokedex * v1 = SaveData_GetPokedex(param0->unk_160); Party * v2 = Party_GetFromSavedata(param0->unk_160); UnkStruct_0202C878 * v3 = sub_0202C878(param0->unk_160); int v4, v5; @@ -1813,7 +1813,7 @@ static void ov65_0222F4C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) param0->unk_04->unk_00.unk_18 = TrainerInfo_GameCode(v0); param0->unk_04->unk_00.unk_19 = TrainerInfo_RegionCode(v0); - param0->unk_04->unk_00.unk_1A = PokedexData_IsNationalDexObtained(v1); + param0->unk_04->unk_00.unk_1A = Pokedex_IsNationalDexObtained(v1); param0->unk_04->unk_00.unk_1B = 29; ov65_02232E70(param0, param1); diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index 2d7f6a9a19..511e9cfbdb 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -2311,7 +2311,7 @@ static void ov66_0222F7C8(UnkStruct_ov66_0222F6C4 *param0, SaveData *param1, u32 { v0 = SaveData_GetTrainerInfo(param1); v1 = Party_GetFromSavedata(param1); - v3 = SaveData_Pokedex(param1); + v3 = SaveData_GetPokedex(param1); v2 = sub_0202C878(param1); v4 = SaveData_GetGameTime(param1); } @@ -2354,7 +2354,7 @@ static void ov66_0222F7C8(UnkStruct_ov66_0222F6C4 *param0, SaveData *param1, u32 param0->unk_20.unk_3A = ov66_02230C0C(param0->unk_20.unk_3A); param0->unk_20.unk_3C = sub_0202C8C0(v2); param0->unk_20.unk_3E = sub_0202C8C4(v2); - param0->unk_20.unk_3F = PokedexData_IsNationalDexObtained(v3); + param0->unk_20.unk_3F = Pokedex_IsNationalDexObtained(v3); param0->unk_20.unk_40 = TrainerInfo_IsMainStoryCleared(v0); param0->unk_20.unk_41 = 0xff; param0->unk_20.unk_43 = 0; diff --git a/src/overlay094/ov94_022414B8.c b/src/overlay094/ov94_022414B8.c index 71c9d0fd9a..f9457e3b4c 100644 --- a/src/overlay094/ov94_022414B8.c +++ b/src/overlay094/ov94_022414B8.c @@ -1134,12 +1134,12 @@ static int ov94_02242718(StringList **param0, MessageLoader *param1, MessageLoad for (v0 = 0; v0 < v3; v0++) { if (v4) { - if (PokedexData_HasSeenSpecies(param7, param3[v1 + v0])) { + if (Pokedex_HasSeenSpecies(param7, param3[v1 + v0])) { v2++; } } else { if (param4[param3[v1 + v0]]) { - if (PokedexData_HasSeenSpecies(param7, param3[v1 + v0])) { + if (Pokedex_HasSeenSpecies(param7, param3[v1 + v0])) { v2++; } } @@ -1150,12 +1150,12 @@ static int ov94_02242718(StringList **param0, MessageLoader *param1, MessageLoad for (v0 = 0; v0 < v3; v0++) { if (v4) { - if (PokedexData_HasSeenSpecies(param7, param3[v1 + v0])) { + if (Pokedex_HasSeenSpecies(param7, param3[v1 + v0])) { StringList_AddFromMessageBank(*param0, param1, param3[v1 + v0], param3[v1 + v0]); } } else { if (param4[param3[v1 + v0]]) { - if (PokedexData_HasSeenSpecies(param7, param3[v1 + v0])) { + if (Pokedex_HasSeenSpecies(param7, param3[v1 + v0])) { StringList_AddFromMessageBank(*param0, param1, param3[v1 + v0], param3[v1 + v0]); } } diff --git a/src/overlay097/ov97_0222AE60.c b/src/overlay097/ov97_0222AE60.c index adab601bdb..f8f516fc0a 100644 --- a/src/overlay097/ov97_0222AE60.c +++ b/src/overlay097/ov97_0222AE60.c @@ -237,7 +237,7 @@ static void ov97_0222AF1C(UnkStruct_0222AE60 *param0) SetGBACartridgeVersion(v0); - if (PokedexData_IsNationalDexObtained(param0->unk_08) == FALSE) { + if (Pokedex_IsNationalDexObtained(param0->unk_08) == FALSE) { return; } @@ -987,7 +987,7 @@ static int ov97_0222BD70(OverlayManager *param0, int *param1) v0->unk_11C = FX32_ONE * 0; v0->unk_120 = FX32_ONE * 0; v0->unk_0C = SaveData_GetTrainerInfo(v0->unk_04); - v0->unk_08 = SaveData_Pokedex(v0->unk_04); + v0->unk_08 = SaveData_GetPokedex(v0->unk_04); v0->playTime = SaveData_GetPlayTime(v0->unk_04); v0->unk_4C = Pokedex_IsObtained(v0->unk_08); v0->unk_50 = TrainerInfo_BadgeCount(v0->unk_0C); diff --git a/src/overlay097/ov97_0222C174.c b/src/overlay097/ov97_0222C174.c index 98d347b35a..46aa676753 100644 --- a/src/overlay097/ov97_0222C174.c +++ b/src/overlay097/ov97_0222C174.c @@ -681,7 +681,7 @@ static int ov97_0222C6F8(OverlayManager *param0, int *param1) v0->unk_04 = BgConfig_New(v0->unk_00); v0->unk_08 = ((ApplicationArgs *)OverlayManager_Args(param0))->saveData; v0->unk_10 = SaveData_GetTrainerInfo(v0->unk_08); - v0->unk_0C = SaveData_Pokedex(v0->unk_08); + v0->unk_0C = SaveData_GetPokedex(v0->unk_08); v0->unk_14 = SaveData_Options(v0->unk_08); ov97_02237694(v0->unk_00); diff --git a/src/overlay118/ov118_021D0D80.c b/src/overlay118/ov118_021D0D80.c index dbd275d8a8..e05dc986cc 100644 --- a/src/overlay118/ov118_021D0D80.c +++ b/src/overlay118/ov118_021D0D80.c @@ -93,7 +93,7 @@ int ov118_021D0DBC(GameWindowLayout *param0) break; } - PokedexData_Capture(SaveData_Pokedex(FieldSystem_GetSaveData(param0->unk_5A4->unk_1C)), v1); + Pokedex_Capture(SaveData_GetPokedex(FieldSystem_GetSaveData(param0->unk_5A4->unk_1C)), v1); } v0->unk_00++; break; diff --git a/src/pokedex_data.c b/src/pokedex_data.c index 1716a92253..d622d33718 100644 --- a/src/pokedex_data.c +++ b/src/pokedex_data.c @@ -218,7 +218,7 @@ static int NumFormsSeen_TwoForms(const Pokedex *pokedexData, u32 species) { GF_ASSERT((species == SPECIES_SHELLOS) || (species == SPECIES_GASTRODON) || (species == SPECIES_SHAYMIN) || (species == SPECIES_GIRATINA)); - if (PokedexData_HasSeenSpecies(pokedexData, species) == FALSE) { + if (Pokedex_HasSeenSpecies(pokedexData, species) == FALSE) { return 0; } @@ -252,7 +252,7 @@ static BOOL FormSeen_TwoForms(const Pokedex *pokedexData, u32 species, u8 form) { GF_ASSERT((species == SPECIES_SHELLOS) || (species == SPECIES_GASTRODON) || (species == SPECIES_SHAYMIN) || (species == SPECIES_GIRATINA)); - if (PokedexData_HasSeenSpecies(pokedexData, species) == FALSE) { + if (Pokedex_HasSeenSpecies(pokedexData, species) == FALSE) { return FALSE; } @@ -324,7 +324,7 @@ static int NumFormsSeen_ThreeForms(const Pokedex *pokedexData, u32 species) { GF_ASSERT((species == SPECIES_BURMY) || (species == SPECIES_WORMADAM)); - if (PokedexData_HasSeenSpecies(pokedexData, species) == FALSE) { + if (Pokedex_HasSeenSpecies(pokedexData, species) == FALSE) { return 0; } @@ -351,7 +351,7 @@ static BOOL FormSeen_ThreeForms(const Pokedex *pokedexData, u32 species, u8 form { GF_ASSERT((species == SPECIES_BURMY) || (species == SPECIES_WORMADAM)); - if (PokedexData_HasSeenSpecies(pokedexData, species) == FALSE) { + if (Pokedex_HasSeenSpecies(pokedexData, species) == FALSE) { return FALSE; } @@ -500,7 +500,7 @@ static int NumFormsSeen_Rotom(const Pokedex *pokedexData, u32 species) { GF_ASSERT(species == SPECIES_ROTOM); - if (PokedexData_HasSeenSpecies(pokedexData, species) == FALSE) { + if (Pokedex_HasSeenSpecies(pokedexData, species) == FALSE) { return 0; } @@ -525,7 +525,7 @@ static BOOL FormSeen_Rotom(const Pokedex *pokedexData, u32 species, u8 form) { GF_ASSERT(species == SPECIES_ROTOM); - if (PokedexData_HasSeenSpecies(pokedexData, species) == FALSE) { + if (Pokedex_HasSeenSpecies(pokedexData, species) == FALSE) { return FALSE; } @@ -753,7 +753,7 @@ u16 Pokedex_CountCaught_National(const Pokedex *pokedexData) int species; int caughtCount = 0; for (species = 1; species <= NATIONAL_DEX_COUNT; species++) { - if (PokedexData_HasCaughtSpecies(pokedexData, species) == TRUE) { + if (Pokedex_HasCaughtSpecies(pokedexData, species) == TRUE) { caughtCount++; } } @@ -768,7 +768,7 @@ u16 Pokedex_CountSeen_National(const Pokedex *pokedex) int species; int seenCount = 0; for (species = 1; species <= NATIONAL_DEX_COUNT; species++) { - if (PokedexData_HasSeenSpecies(pokedex, species) == TRUE) { + if (Pokedex_HasSeenSpecies(pokedex, species) == TRUE) { seenCount++; } } @@ -778,21 +778,21 @@ u16 Pokedex_CountSeen_National(const Pokedex *pokedex) u16 Pokedex_CountSeen(const Pokedex *pokedex) { - if (PokedexData_IsNationalDexObtained(pokedex)) { + if (Pokedex_IsNationalDexObtained(pokedex)) { return Pokedex_CountSeen_National(pokedex); } - return PokedexData_CountSeen_Local(pokedex); + return Pokedex_CountSeen_Local(pokedex); } -u16 PokedexData_CountCaught_Local(const Pokedex *pokedexData) +u16 Pokedex_CountCaught_Local(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); int species; int caughtCount = 0; for (species = 1; species <= NATIONAL_DEX_COUNT; species++) { - if (PokedexData_HasCaughtSpecies(pokedexData, species) == TRUE) { + if (Pokedex_HasCaughtSpecies(pokedexData, species) == TRUE) { if (Pokemon_SinnohDexNumber(species) != 0) { caughtCount++; } @@ -802,14 +802,14 @@ u16 PokedexData_CountCaught_Local(const Pokedex *pokedexData) return caughtCount; } -u16 PokedexData_CountSeen_Local(const Pokedex *pokedex) +u16 Pokedex_CountSeen_Local(const Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); int species; int seenCount = 0; for (species = 1; species <= NATIONAL_DEX_COUNT; species++) { - if (PokedexData_HasSeenSpecies(pokedex, species) == TRUE && Pokemon_SinnohDexNumber(species) != 0) { + if (Pokedex_HasSeenSpecies(pokedex, species) == TRUE && Pokemon_SinnohDexNumber(species) != 0) { seenCount++; } } @@ -817,9 +817,9 @@ u16 PokedexData_CountSeen_Local(const Pokedex *pokedex) return seenCount; } -BOOL PokedexData_NationalDexCompleted(const Pokedex *pokedexData) +BOOL Pokedex_NationalDexCompleted(const Pokedex *pokedexData) { - u16 numCaught = PokedexData_NumCaught_National(pokedexData); + u16 numCaught = Pokedex_NumCaught_National(pokedexData); if (numCaught >= NATIONAL_DEX_GOAL) { return TRUE; @@ -828,9 +828,9 @@ BOOL PokedexData_NationalDexCompleted(const Pokedex *pokedexData) return FALSE; } -BOOL PokedexData_LocalDexCompleted(const Pokedex *pokedexData) +BOOL Pokedex_LocalDexCompleted(const Pokedex *pokedexData) { - u16 numCaught = PokedexData_NumCaught_Local(pokedexData); + u16 numCaught = Pokedex_NumCaught_Local(pokedexData); if (numCaught >= LOCAL_DEX_GOAL) { return TRUE; @@ -839,13 +839,13 @@ BOOL PokedexData_LocalDexCompleted(const Pokedex *pokedexData) return FALSE; } -u16 PokedexData_NumCaught_National(const Pokedex *pokedexData) +u16 Pokedex_NumCaught_National(const Pokedex *pokedexData) { int species; u16 numCaught = 0; for (species = 1; species <= NATIONAL_DEX_COUNT; species++) { - if (PokedexData_HasCaughtSpecies(pokedexData, species) == TRUE) { + if (Pokedex_HasCaughtSpecies(pokedexData, species) == TRUE) { if (CountsForDexCompletion_National(species) == TRUE) { numCaught++; } @@ -855,13 +855,13 @@ u16 PokedexData_NumCaught_National(const Pokedex *pokedexData) return numCaught; } -u16 PokedexData_NumCaught_Local(const Pokedex *pokedexData) +u16 Pokedex_NumCaught_Local(const Pokedex *pokedexData) { int species; u16 numCaught = 0; for (species = 1; species <= NATIONAL_DEX_COUNT; species++) { - if (PokedexData_HasSeenSpecies(pokedexData, species) == TRUE) { + if (Pokedex_HasSeenSpecies(pokedexData, species) == TRUE) { if (Pokemon_SinnohDexNumber(species) != 0 && CountsForDexCompletion_Local(species) == TRUE) { numCaught++; @@ -872,7 +872,7 @@ u16 PokedexData_NumCaught_Local(const Pokedex *pokedexData) return numCaught; } -BOOL PokedexData_HasCaughtSpecies(const Pokedex *pokedex, u16 species) +BOOL Pokedex_HasCaughtSpecies(const Pokedex *pokedex, u16 species) { CheckPokedexIntegrity(pokedex); @@ -887,7 +887,7 @@ BOOL PokedexData_HasCaughtSpecies(const Pokedex *pokedex, u16 species) } } -BOOL PokedexData_HasSeenSpecies(const Pokedex *pokedex, u16 species) +BOOL Pokedex_HasSeenSpecies(const Pokedex *pokedex, u16 species) { CheckPokedexIntegrity(pokedex); @@ -898,7 +898,7 @@ BOOL PokedexData_HasSeenSpecies(const Pokedex *pokedex, u16 species) return SpeciesSeen(pokedex, species); } -u32 PokedexData_GetForm_Spinda(const Pokedex *pokedexData, u8 formIndex) +u32 Pokedex_GetForm_Spinda(const Pokedex *pokedexData, u8 formIndex) { CheckPokedexIntegrity(pokedexData); @@ -915,7 +915,7 @@ u32 PokedexData_GetForm_Spinda(const Pokedex *pokedexData, u8 formIndex) return form; } -u32 PokedexData_DisplayedGender(const Pokedex *pokedexData, u16 species, int displaySecondary) +u32 Pokedex_DisplayedGender(const Pokedex *pokedexData, u16 species, int displaySecondary) { CheckPokedexIntegrity(pokedexData); @@ -930,7 +930,7 @@ u32 PokedexData_DisplayedGender(const Pokedex *pokedexData, u16 species, int dis return GetDisplayGender(pokedexData, species, displaySecondary); } -u32 PokedexData_GetForm_Unown(const Pokedex *pokedexData, int formIndex) +u32 Pokedex_GetForm_Unown(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -941,13 +941,13 @@ u32 PokedexData_GetForm_Unown(const Pokedex *pokedexData, int formIndex) return GetForm_Unown(pokedexData, formIndex); } -u32 PokedexData_NumFormsSeen_Unown(const Pokedex *pokedexData) +u32 Pokedex_NumFormsSeen_Unown(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_Unown(pokedexData); } -u32 PokedexData_GetForm_Shellos(const Pokedex *pokedexData, int formIndex) +u32 Pokedex_GetForm_Shellos(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -958,13 +958,13 @@ u32 PokedexData_GetForm_Shellos(const Pokedex *pokedexData, int formIndex) return GetForm_TwoForms(pokedexData, SPECIES_SHELLOS, formIndex); } -u32 PokedexData_NumFormsSeen_Shellos(const Pokedex *pokedexData) +u32 Pokedex_NumFormsSeen_Shellos(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_TwoForms(pokedexData, SPECIES_SHELLOS); } -u32 PokedexData_GetForm_Gastrodon(const Pokedex *pokedexData, int formIndex) +u32 Pokedex_GetForm_Gastrodon(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -975,13 +975,13 @@ u32 PokedexData_GetForm_Gastrodon(const Pokedex *pokedexData, int formIndex) return GetForm_TwoForms(pokedexData, SPECIES_GASTRODON, formIndex); } -u32 PokedexData_NumFormsSeen_Gastrodon(const Pokedex *pokedexData) +u32 Pokedex_NumFormsSeen_Gastrodon(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_TwoForms(pokedexData, SPECIES_GASTRODON); } -u32 PokedexData_GetForm_Burmy(const Pokedex *pokedexData, int formIndex) +u32 Pokedex_GetForm_Burmy(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -992,13 +992,13 @@ u32 PokedexData_GetForm_Burmy(const Pokedex *pokedexData, int formIndex) return GetForm_3Forms(pokedexData, SPECIES_BURMY, formIndex); } -u32 PokedexData_NumFormsSeen_Burmy(const Pokedex *pokedexData) +u32 Pokedex_NumFormsSeen_Burmy(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_ThreeForms(pokedexData, SPECIES_BURMY); } -u32 PokedexData_GetForm_Wormadam(const Pokedex *pokedexData, int formIndex) +u32 Pokedex_GetForm_Wormadam(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); @@ -1009,19 +1009,19 @@ u32 PokedexData_GetForm_Wormadam(const Pokedex *pokedexData, int formIndex) return GetForm_3Forms(pokedexData, SPECIES_WORMADAM, formIndex); } -u32 PokedexData_NumFormsSeen_Wormadam(const Pokedex *pokedexData) +u32 Pokedex_NumFormsSeen_Wormadam(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_ThreeForms(pokedexData, SPECIES_WORMADAM); } -u32 PokedexData_GetForm_Deoxys(const Pokedex *pokedexData, int formIndex) +u32 Pokedex_GetForm_Deoxys(const Pokedex *pokedexData, int formIndex) { CheckPokedexIntegrity(pokedexData); return GetForm_Deoxys(pokedexData, formIndex); } -u32 PokedexData_NumFormsSeen_Deoxys(const Pokedex *pokedexData) +u32 Pokedex_NumFormsSeen_Deoxys(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return NumFormsSeen_Deoxys(pokedexData); @@ -1054,7 +1054,7 @@ void Pokedex_Encounter(Pokedex *pokedexData, Pokemon *pokemon) Write_SeenSpecies(pokedexData, species); } -void PokedexData_Capture(Pokedex *pokedexData, Pokemon *pokemon) +void Pokedex_Capture(Pokedex *pokedexData, Pokemon *pokemon) { u16 species = Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL); u32 language = Pokemon_GetValue(pokemon, MON_DATA_LANGUAGE, NULL); @@ -1085,31 +1085,31 @@ void PokedexData_Capture(Pokedex *pokedexData, Pokemon *pokemon) Write_SeenSpecies(pokedexData, species); } -void PokedexData_ObtainNationalDex(Pokedex *pokedexData) +void Pokedex_ObtainNationalDex(Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); pokedexData->nationalDexObtained = TRUE; } -BOOL PokedexData_IsNationalDexObtained(const Pokedex *pokedex) +BOOL Pokedex_IsNationalDexObtained(const Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); return pokedex->nationalDexObtained; } -BOOL PokedexData_CanDetectForms(const Pokedex *pokedexData) +BOOL Pokedex_CanDetectForms(const Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); return pokedexData->canDetectForms; } -void PokedexData_TurnOnFormDetection(Pokedex *pokedexData) +void Pokedex_TurnOnFormDetection(Pokedex *pokedexData) { CheckPokedexIntegrity(pokedexData); pokedexData->canDetectForms = TRUE; } -BOOL PokedexData_IsLanguageObtained(const Pokedex *pokedexData, u16 species, u32 languageIndex) +BOOL Pokedex_IsLanguageObtained(const Pokedex *pokedexData, u16 species, u32 languageIndex) { int bitIndex; @@ -1123,12 +1123,12 @@ BOOL PokedexData_IsLanguageObtained(const Pokedex *pokedexData, u16 species, u32 return pokedexData->recordedLanguages[bitIndex] & (1 << languageIndex); } -void PokedexData_TurnOnLanguageDetection(Pokedex *pokedexData) +void Pokedex_TurnOnLanguageDetection(Pokedex *pokedexData) { pokedexData->canDetectLanguages = TRUE; } -BOOL PokedexData_CanDetectLanguages(const Pokedex *pokedexData) +BOOL Pokedex_CanDetectLanguages(const Pokedex *pokedexData) { return pokedexData->canDetectLanguages; } @@ -1139,13 +1139,13 @@ BOOL Pokedex_IsObtained(const Pokedex *pokedex) return pokedex->pokedexObtained; } -void PokedexData_ObtainPokedex(Pokedex *pokedex) +void Pokedex_ObtainPokedex(Pokedex *pokedex) { CheckPokedexIntegrity(pokedex); pokedex->pokedexObtained = TRUE; } -Pokedex *SaveData_Pokedex(SaveData *saveData) +Pokedex *SaveData_GetPokedex(SaveData *saveData) { Pokedex *pokedex = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_POKEDEX); return pokedex; @@ -1157,33 +1157,33 @@ u32 Pokedex_GetDisplayForm(const Pokedex *pokedexData, int species, int formInde switch (species) { case SPECIES_UNOWN: - if (formIndex < PokedexData_NumFormsSeen_Unown(pokedexData)) { - return PokedexData_GetForm_Unown(pokedexData, formIndex); + if (formIndex < Pokedex_NumFormsSeen_Unown(pokedexData)) { + return Pokedex_GetForm_Unown(pokedexData, formIndex); } break; case SPECIES_SHELLOS: - if (formIndex < PokedexData_NumFormsSeen_Shellos(pokedexData)) { - return PokedexData_GetForm_Shellos(pokedexData, formIndex); + if (formIndex < Pokedex_NumFormsSeen_Shellos(pokedexData)) { + return Pokedex_GetForm_Shellos(pokedexData, formIndex); } break; case SPECIES_GASTRODON: - if (formIndex < PokedexData_NumFormsSeen_Gastrodon(pokedexData)) { - return PokedexData_GetForm_Gastrodon(pokedexData, formIndex); + if (formIndex < Pokedex_NumFormsSeen_Gastrodon(pokedexData)) { + return Pokedex_GetForm_Gastrodon(pokedexData, formIndex); } break; case SPECIES_BURMY: - if (formIndex < PokedexData_NumFormsSeen_Burmy(pokedexData)) { - return PokedexData_GetForm_Burmy(pokedexData, formIndex); + if (formIndex < Pokedex_NumFormsSeen_Burmy(pokedexData)) { + return Pokedex_GetForm_Burmy(pokedexData, formIndex); } break; case SPECIES_WORMADAM: - if (formIndex < PokedexData_NumFormsSeen_Wormadam(pokedexData)) { - return PokedexData_GetForm_Wormadam(pokedexData, formIndex); + if (formIndex < Pokedex_NumFormsSeen_Wormadam(pokedexData)) { + return Pokedex_GetForm_Wormadam(pokedexData, formIndex); } break; case SPECIES_DEOXYS: - if (formIndex < PokedexData_NumFormsSeen_Deoxys(pokedexData)) { - return PokedexData_GetForm_Deoxys(pokedexData, formIndex); + if (formIndex < Pokedex_NumFormsSeen_Deoxys(pokedexData)) { + return Pokedex_GetForm_Deoxys(pokedexData, formIndex); } break; case SPECIES_SHAYMIN: @@ -1208,23 +1208,23 @@ u32 Pokedex_GetDisplayForm(const Pokedex *pokedexData, int species, int formInde return 0; } -u32 PokedexData_NumFormsSeen(const Pokedex *pokedex, int species) +u32 Pokedex_NumFormsSeen(const Pokedex *pokedex, int species) { CheckPokedexIntegrity(pokedex); switch (species) { case SPECIES_UNOWN: - return PokedexData_NumFormsSeen_Unown(pokedex); + return Pokedex_NumFormsSeen_Unown(pokedex); case SPECIES_SHELLOS: - return PokedexData_NumFormsSeen_Shellos(pokedex); + return Pokedex_NumFormsSeen_Shellos(pokedex); case SPECIES_GASTRODON: - return PokedexData_NumFormsSeen_Gastrodon(pokedex); + return Pokedex_NumFormsSeen_Gastrodon(pokedex); case SPECIES_BURMY: - return PokedexData_NumFormsSeen_Burmy(pokedex); + return Pokedex_NumFormsSeen_Burmy(pokedex); case SPECIES_WORMADAM: - return PokedexData_NumFormsSeen_Wormadam(pokedex); + return Pokedex_NumFormsSeen_Wormadam(pokedex); case SPECIES_DEOXYS: - return PokedexData_NumFormsSeen_Deoxys(pokedex); + return Pokedex_NumFormsSeen_Deoxys(pokedex); case SPECIES_SHAYMIN: return NumFormsSeen_TwoForms(pokedex, SPECIES_SHAYMIN); case SPECIES_GIRATINA: diff --git a/src/scrcmd.c b/src/scrcmd.c index 7dedb81e56..26d8f78b68 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1589,7 +1589,7 @@ const ScrCmdFunc Unk_020EAC58[] = { ScrCmd_334, ScrCmd_335, ScrCmd_336, - ScrCmd_337, + ScrCmd_HasSeenSpecies, ScrCmd_338, ScrCmd_339, ScrCmd_33A, @@ -4975,25 +4975,25 @@ static BOOL ScrCmd_11D(ScriptContext *ctx) static BOOL ScrCmd_11E(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); - *v1 = PokedexData_CountSeen_Local(v0); + *v1 = Pokedex_CountSeen_Local(v0); return 0; } static BOOL ScrCmd_11F(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); - *v1 = PokedexData_CountCaught_Local(v0); + *v1 = Pokedex_CountCaught_Local(v0); return 0; } static BOOL ScrCmd_120(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = Pokedex_CountSeen_National(v0); @@ -5002,7 +5002,7 @@ static BOOL ScrCmd_120(ScriptContext *ctx) static BOOL ScrCmd_121(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = Pokedex_CountCaught_National(v0); @@ -5018,17 +5018,17 @@ static BOOL ScrCmd_122(ScriptContext *ctx) static BOOL ScrCmd_123(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); const TrainerInfo *v1 = SaveData_GetTrainerInfo(ctx->fieldSystem->saveData); u8 v2 = ScriptContext_ReadByte(ctx); u16 *v3 = ScriptContext_GetVarPointer(ctx); u16 v4; if (v2 == 0) { - v4 = PokedexData_NumCaught_Local(v0); + v4 = Pokedex_NumCaught_Local(v0); *v3 = sub_0205E078(v4, SystemFlag_HandleFirstArrivalToZone(SaveData_GetVarsFlags(ctx->fieldSystem->saveData), HANDLE_FLAG_CHECK, FIRST_ARRIVAL_ETERNA_CITY)); } else { - v4 = PokedexData_NumCaught_National(v0); + v4 = Pokedex_NumCaught_National(v0); *v3 = sub_0205E0E4(v4, TrainerInfo_Gender(v1)); } @@ -6238,12 +6238,12 @@ static BOOL ScrCmd_1D6(ScriptContext *ctx) static BOOL ScrCmd_1E8(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = 0; - if (PokedexData_LocalDexCompleted(v0) == 1) { + if (Pokedex_LocalDexCompleted(v0) == 1) { *v1 = 1; } @@ -6252,12 +6252,12 @@ static BOOL ScrCmd_1E8(ScriptContext *ctx) static BOOL ScrCmd_1E9(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); *v1 = 0; - if (PokedexData_NationalDexCompleted(v0) == 1) { + if (Pokedex_NationalDexCompleted(v0) == 1) { *v1 = 1; } @@ -6466,16 +6466,16 @@ static BOOL ScrCmd_214(ScriptContext *ctx) static BOOL ScrCmd_218(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); u16 v2, v3, v4, v5; - v2 = PokedexData_CountSeen_Local(v0); + v2 = Pokedex_CountSeen_Local(v0); v3 = LCRNG_Next() % v2; *v1 = 25; for (v4 = 1, v5 = 0; v4 <= NATIONAL_DEX_COUNT; v4++) { - if (PokedexData_HasSeenSpecies(v0, v4) == TRUE && Pokemon_SinnohDexNumber(v4) != FALSE) { + if (Pokedex_HasSeenSpecies(v0, v4) == TRUE && Pokemon_SinnohDexNumber(v4) != FALSE) { if (v5 == v3) { *v1 = v4; break; @@ -6565,13 +6565,13 @@ static BOOL ScrCmd_22A(ScriptContext *ctx) static BOOL ScrCmd_22B(ScriptContext *ctx) { - PokedexData_TurnOnLanguageDetection(SaveData_Pokedex(ctx->fieldSystem->saveData)); + Pokedex_TurnOnLanguageDetection(SaveData_GetPokedex(ctx->fieldSystem->saveData)); return 0; } static BOOL ScrCmd_22C(ScriptContext *ctx) { - PokedexData_TurnOnFormDetection(SaveData_Pokedex(ctx->fieldSystem->saveData)); + Pokedex_TurnOnFormDetection(SaveData_GetPokedex(ctx->fieldSystem->saveData)); return 0; } @@ -6583,10 +6583,10 @@ static BOOL ScrCmd_22D(ScriptContext *ctx) *v1 = 0; if (v0 == 1) { - PokedexData_ObtainNationalDex(SaveData_Pokedex(ctx->fieldSystem->saveData)); + Pokedex_ObtainNationalDex(SaveData_GetPokedex(ctx->fieldSystem->saveData)); TrainerInfo_GiveNationalDex(SaveData_GetTrainerInfo(ctx->fieldSystem->saveData)); } else if (v0 == 2) { - *v1 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(ctx->fieldSystem->saveData)); + *v1 = Pokedex_IsNationalDexObtained(SaveData_GetPokedex(ctx->fieldSystem->saveData)); } else { GF_ASSERT(FALSE); } @@ -6768,7 +6768,7 @@ static BOOL ScrCmd_24D(ScriptContext *ctx) static void sub_020451B4(FieldSystem *fieldSystem, u16 param1) { - Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *v0 = SaveData_GetPokedex(fieldSystem->saveData); Pokemon *v1 = Pokemon_New(32); Pokemon_Init(v1); @@ -6887,7 +6887,7 @@ static BOOL ScrCmd_263(ScriptContext *ctx) int v3; int v4 = Party_GetCurrentCount(v1); Pokemon *v5; - Pokedex *v6 = SaveData_Pokedex(ctx->fieldSystem->saveData); + Pokedex *v6 = SaveData_GetPokedex(ctx->fieldSystem->saveData); for (v2 = 0; v2 < v4; v2++) { v5 = Party_GetPokemonBySlotIndex(v1, v2); @@ -6896,7 +6896,7 @@ static BOOL ScrCmd_263(ScriptContext *ctx) if (v3 == SPECIES_DEOXYS) { Pokemon_SetValue(v5, MON_DATA_FORM, &v0); Pokemon_CalcLevelAndStats(v5); - PokedexData_Capture(v6, v5); + Pokedex_Capture(v6, v5); } } @@ -7240,10 +7240,10 @@ static BOOL ScrCmd_282(ScriptContext *ctx) static BOOL ScrCmd_284(ScriptContext *ctx) { - const Pokedex *v0 = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *v0 = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *v1 = ScriptContext_GetVarPointer(ctx); - *v1 = PokedexData_NumFormsSeen_Unown(v0); + *v1 = Pokedex_NumFormsSeen_Unown(v0); return 0; } @@ -8333,7 +8333,7 @@ static BOOL ScrCmd_328(ScriptContext *ctx) v5 = Party_GetPokemonBySlotIndex(v1, v3); if ((Pokemon_GetValue(v5, MON_DATA_IS_EGG, NULL) == 0) && (Pokemon_GetValue(v5, MON_DATA_SPECIES, NULL) == SPECIES_GIRATINA)) { - PokedexData_Capture(SaveData_Pokedex(fieldSystem->saveData), v5); + Pokedex_Capture(SaveData_GetPokedex(fieldSystem->saveData), v5); } } } diff --git a/src/scrcmd_system_flags.c b/src/scrcmd_system_flags.c index 114155e7c0..668d058f64 100644 --- a/src/scrcmd_system_flags.c +++ b/src/scrcmd_system_flags.c @@ -18,7 +18,7 @@ BOOL ScrCmd_CheckPokedexAcquired(ScriptContext *ctx) { - const Pokedex *pokedex = SaveData_Pokedex(ctx->fieldSystem->saveData); + const Pokedex *pokedex = SaveData_GetPokedex(ctx->fieldSystem->saveData); u16 *destVar = ScriptContext_GetVarPointer(ctx); *destVar = Pokedex_IsObtained(pokedex); return FALSE; @@ -26,8 +26,8 @@ BOOL ScrCmd_CheckPokedexAcquired(ScriptContext *ctx) BOOL ScrCmd_GivePokedex(ScriptContext *ctx) { - Pokedex *pokedex = SaveData_Pokedex(ctx->fieldSystem->saveData); - PokedexData_ObtainPokedex(pokedex); + Pokedex *pokedex = SaveData_GetPokedex(ctx->fieldSystem->saveData); + Pokedex_ObtainPokedex(pokedex); return FALSE; } diff --git a/src/unk_0202F180.c b/src/unk_0202F180.c index 7f0a7a0feb..7aaaae0c2b 100644 --- a/src/unk_0202F180.c +++ b/src/unk_0202F180.c @@ -11,13 +11,13 @@ #include "poketch_data.h" #include "savedata.h" -void sub_0202F180(SaveData *param0, const Pokemon *param1) +void sub_0202F180(SaveData *saveData, const Pokemon *pokemon) { - if (Pokemon_GetValue((Pokemon *)param1, MON_DATA_IS_EGG, NULL) == 0) { - Pokedex *v0 = SaveData_Pokedex(param0); + if (Pokemon_GetValue((Pokemon *)pokemon, MON_DATA_IS_EGG, NULL) == 0) { + Pokedex *pokedex = SaveData_GetPokedex(saveData); - GameRecords_IncrementTrainerScoreOnCatch(SaveData_GetGameRecordsPtr(param0), v0, Pokemon_GetValue((Pokemon *)param1, MON_DATA_SPECIES, NULL)); - PokedexData_Capture(v0, (Pokemon *)param1); - PoketchData_PokemonHistoryEnqueue(SaveData_PoketchData(param0), (const BoxPokemon *)param1); + GameRecords_IncrementTrainerScoreOnCatch(SaveData_GetGameRecordsPtr(saveData), pokedex, Pokemon_GetValue((Pokemon *)pokemon, MON_DATA_SPECIES, NULL)); + Pokedex_Capture(pokedex, (Pokemon *)pokemon); + PoketchData_PokemonHistoryEnqueue(SaveData_PoketchData(saveData), (const BoxPokemon *)pokemon); } } diff --git a/src/unk_0202F1D4.c b/src/unk_0202F1D4.c index 42ec41a14f..4a1e97cb95 100644 --- a/src/unk_0202F1D4.c +++ b/src/unk_0202F1D4.c @@ -537,7 +537,7 @@ BOOL sub_0202FAC0(void) return 1; } -void sub_0202FAFC(FieldBattleDTO *param0, SaveData *param1) +void sub_0202FAFC(FieldBattleDTO *param0, SaveData *saveData) { int v0; UnkStruct_0202F298 *v1 = &Unk_021C07A4->unk_E8; @@ -561,7 +561,7 @@ void sub_0202FAFC(FieldBattleDTO *param0, SaveData *param1) param0->resultMask = BATTLE_IN_PROGRESS; param0->leveledUpMonsMask = 0; - Pokedex_Copy(SaveData_Pokedex(param1), param0->pokedex); + Pokedex_Copy(SaveData_GetPokedex(saveData), param0->pokedex); for (v0 = 0; v0 < 4; v0++) { param0->trainerIDs[v0] = v1->unk_00.unk_08[v0]; @@ -575,7 +575,7 @@ void sub_0202FAFC(FieldBattleDTO *param0, SaveData *param1) param0->unk_194[v0] = v1->unk_00.unk_14C[v0]; } - Options_Copy(SaveData_Options(param1), param0->options); + Options_Copy(SaveData_Options(saveData), param0->options); param0->options->frame = v1->unk_1BE8.frame; if (param0->options->frame >= 20) { @@ -583,23 +583,23 @@ void sub_0202FAFC(FieldBattleDTO *param0, SaveData *param1) } } -static void sub_0202FCE8(const Party *param0, UnkStruct_0202FD30 *param1) +static void sub_0202FCE8(const Party *party, UnkStruct_0202FD30 *param1) { int v0; Pokemon *v1; MI_CpuClear8(param1, sizeof(UnkStruct_0202FD30)); - param1->unk_00 = Party_GetCapacity(param0); - param1->unk_02 = Party_GetCurrentCount(param0); + param1->unk_00 = Party_GetCapacity(party); + param1->unk_02 = Party_GetCurrentCount(party); for (v0 = 0; v0 < param1->unk_02; v0++) { - v1 = Party_GetPokemonBySlotIndex(param0, v0); + v1 = Party_GetPokemonBySlotIndex(party, v0); sub_02078B40(v1, ¶m1->unk_04[v0]); } } -static void sub_0202FD30(UnkStruct_0202FD30 *param0, Party *param1) +static void sub_0202FD30(UnkStruct_0202FD30 *param0, Party *party) { int v0; Pokemon *v1; @@ -607,12 +607,12 @@ static void sub_0202FD30(UnkStruct_0202FD30 *param0, Party *param1) v1 = Pokemon_New(11); - Party_InitWithCapacity(param1, param0->unk_00); + Party_InitWithCapacity(party, param0->unk_00); for (v0 = 0; v0 < param0->unk_02; v0++) { sub_02078E0C(¶m0->unk_04[v0], v1); Pokemon_SetValue(v1, MON_DATA_MAIL_ID, &v2); - Party_AddPokemon(param1, v1); + Party_AddPokemon(party, v1); } Heap_FreeToHeap(v1); diff --git a/src/unk_0203D1B8.c b/src/unk_0203D1B8.c index 874cc56e95..514a0f2a13 100644 --- a/src/unk_0203D1B8.c +++ b/src/unk_0203D1B8.c @@ -979,7 +979,7 @@ static void sub_0203DB38(UnkStruct_ov88_0223C370 *param0, FieldSystem *fieldSyst param0->unk_0C = SaveData_SaveTable(fieldSystem->saveData, 9); param0->unk_14 = sub_0202C878(fieldSystem->saveData); param0->unk_18 = SaveData_Options(fieldSystem->saveData); - param0->unk_24 = SaveData_Pokedex(fieldSystem->saveData); + param0->unk_24 = SaveData_GetPokedex(fieldSystem->saveData); param0->unk_30 = sub_0207A274(fieldSystem->saveData); param0->unk_10 = fieldSystem->saveData; param0->unk_1C = fieldSystem->journalEntry; @@ -1075,7 +1075,7 @@ BOOL sub_0203DBF0(FieldTask *param0) if ((v4 = sub_02076B94(NULL, v2->unk_04.unk_40, 1, v3, &v5)) != 0) { Heap_Create(3, 26, 0x30000); - v2->unk_60 = sub_0207AE68(NULL, v2->unk_04.unk_40, v4, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_Pokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v5, 0x4, 26); + v2->unk_60 = sub_0207AE68(NULL, v2->unk_04.unk_40, v4, SaveData_Options(fieldSystem->saveData), PokemonSummaryScreen_ShowContestData(fieldSystem->saveData), SaveData_GetPokedex(fieldSystem->saveData), SaveData_GetBag(fieldSystem->saveData), SaveData_GetGameRecordsPtr(fieldSystem->saveData), SaveData_PoketchData(fieldSystem->saveData), v5, 0x4, 26); v2->unk_00 = 6; } else { v2->unk_00 = 7; @@ -1366,7 +1366,7 @@ void sub_0203E0FC(FieldSystem *fieldSystem, int param1) v0->unk_04 = SaveData_GetSystemData(fieldSystem->saveData); v0->unk_08 = SaveData_SaveTable(fieldSystem->saveData, 2); v0->unk_0C = SaveData_PCBoxes(fieldSystem->saveData); - v0->unk_10 = SaveData_Pokedex(fieldSystem->saveData); + v0->unk_10 = SaveData_GetPokedex(fieldSystem->saveData); v0->unk_14 = sub_0202B370(fieldSystem->saveData); v0->unk_18 = sub_0202C878(fieldSystem->saveData); v0->unk_1C = SaveData_GetTrainerInfo(fieldSystem->saveData); diff --git a/src/unk_02046C7C.c b/src/unk_02046C7C.c index d0928965be..203e9a3ce1 100644 --- a/src/unk_02046C7C.c +++ b/src/unk_02046C7C.c @@ -107,7 +107,7 @@ BOOL ScrCmd_0FA(ScriptContext *param0) v8.unk_01 = v4; v8.unk_02 = v6; v8.unk_03 = SystemFlag_CheckGameCompleted(SaveData_GetVarsFlags(param0->fieldSystem->saveData)); - v8.unk_04 = PokedexData_IsNationalDexObtained(SaveData_Pokedex(param0->fieldSystem->saveData)); + v8.unk_04 = Pokedex_IsNationalDexObtained(SaveData_GetPokedex(param0->fieldSystem->saveData)); v8.unk_05 = v7; v8.unk_08 = v1; v8.unk_0C = v0; diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index d2e7c7f801..64a430617a 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -106,13 +106,13 @@ StringTemplate *sub_0204AEE8(SaveData *param0, u16 param1, u16 param2, u8 param3 u8 v0; u16 v1; Strbuf *v2, *v3; - Pokedex *v4; + Pokedex *pokedex; StringTemplate *v5; MessageLoader *v6; v2 = Strbuf_Init(12 + 2, 4); v3 = Strbuf_Init(2, 4); - v4 = SaveData_Pokedex(param0); + pokedex = SaveData_GetPokedex(param0); v6 = MessageLoader_Init(1, 26, 412, 4); v5 = StringTemplate_New(18 + 1, 12 + 2, 4); @@ -121,7 +121,7 @@ StringTemplate *sub_0204AEE8(SaveData *param0, u16 param1, u16 param2, u8 param3 for (v0 = 0; v0 < 18; v0++) { v1 = sub_02078824(v0); - if (PokedexData_HasSeenSpecies(v4, v1)) { + if (Pokedex_HasSeenSpecies(pokedex, v1)) { MessageLoader_GetStrbuf(v6, v1, v2); StringTemplate_SetStrbuf(v5, (*param4) + 1, v2, param2, param3, GAME_LANGUAGE); (*param4)++; diff --git a/src/unk_0204C500.c b/src/unk_0204C500.c index fee911d308..6a9b5379ed 100644 --- a/src/unk_0204C500.c +++ b/src/unk_0204C500.c @@ -66,7 +66,7 @@ BOOL ScrCmd_255(ScriptContext *param0) PCBoxes *v1 = SaveData_PCBoxes(param0->fieldSystem->saveData); Pokemon *v2 = Pokemon_New(32); TrainerInfo *v3 = SaveData_GetTrainerInfo(param0->fieldSystem->saveData); - Pokedex *v4 = SaveData_Pokedex(param0->fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(param0->fieldSystem->saveData); BOOL v5; int v6; diff --git a/src/unk_02052C6C.c b/src/unk_02052C6C.c index e18e336989..be7707f2d9 100644 --- a/src/unk_02052C6C.c +++ b/src/unk_02052C6C.c @@ -192,7 +192,7 @@ void sub_02052E58(FieldTask *param0) v5->unk_04.playTime = SaveData_GetPlayTime(fieldSystem->saveData); v5->unk_10.unk_00 = TrainerInfo_Gender(SaveData_GetTrainerInfo(fieldSystem->saveData)); v5->unk_10.unk_04 = SystemFlag_CheckGameCompleted(v3); - v5->unk_10.unk_08 = SaveData_Pokedex(fieldSystem->saveData); + v5->unk_10.unk_08 = SaveData_GetPokedex(fieldSystem->saveData); if (SystemFlag_CheckGameCompleted(v3) == 0) { sub_02055C2C(fieldSystem); diff --git a/src/unk_020683F4.c b/src/unk_020683F4.c index 9300be8a49..741f75923b 100644 --- a/src/unk_020683F4.c +++ b/src/unk_020683F4.c @@ -1065,7 +1065,7 @@ static u32 sub_02069130(const UnkStruct_020684D0 *param0) return -1; } - if (PokedexData_IsNationalDexObtained(SaveData_Pokedex(param0->fieldSystem->saveData)) == FALSE) { + if (Pokedex_IsNationalDexObtained(SaveData_GetPokedex(param0->fieldSystem->saveData)) == FALSE) { return -1; } diff --git a/src/unk_0206CCB0.c b/src/unk_0206CCB0.c index c5c6555f1d..f545a09bfc 100644 --- a/src/unk_0206CCB0.c +++ b/src/unk_0206CCB0.c @@ -770,10 +770,10 @@ static int sub_0206D2E0(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D320(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); UnkStruct_0206D140 *v1 = ov6_02246498(param1); - return PokedexData_HasSeenSpecies(v0, v1->unk_06); + return Pokedex_HasSeenSpecies(pokedex, v1->unk_06); } void sub_0206D340(FieldSystem *fieldSystem, BOOL param1, u16 param2, Pokemon *param3) @@ -814,7 +814,7 @@ static BOOL sub_0206D3C0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param return 1; } - return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206D3E4(FieldSystem *fieldSystem, int param1) @@ -935,7 +935,7 @@ static int sub_0206D5B0(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D5F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206D5B0 *v0 = (UnkStruct_0206D5B0 *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D60C(FieldSystem *fieldSystem, Pokemon *param1) @@ -961,10 +961,10 @@ static int sub_0206D644(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D6A8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); UnkStruct_0206D644 *v1 = (UnkStruct_0206D644 *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(v0, v1->unk_00); + return Pokedex_HasSeenSpecies(pokedex, v1->unk_00); } void sub_0206D6C8(FieldSystem *fieldSystem, int param1, int param2) @@ -1022,17 +1022,17 @@ static int sub_0206D75C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206D7A4(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - Pokedex *v0 = SaveData_Pokedex(fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); UnkStruct_0206D75C *v1 = (UnkStruct_0206D75C *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(v0, v1->unk_00); + return Pokedex_HasSeenSpecies(pokedex, v1->unk_00); } void sub_0206D7C4(FieldSystem *fieldSystem) { u32 v0, v1, v2, v3; u8 v4, v5; - Pokemon *v6; + Pokemon *pokemon; UnkUnion_0206D1B8 v7; Party *v8; UnkStruct_0206D8B0 *v9 = &v7.val11; @@ -1044,10 +1044,10 @@ void sub_0206D7C4(FieldSystem *fieldSystem) v4 = Party_GetCurrentCount(v8); for (v5 = 0; v5 < v4; v5++) { - v6 = Party_GetPokemonBySlotIndex(v8, v5); + pokemon = Party_GetPokemonBySlotIndex(v8, v5); - if (Pokemon_GetValue(v6, MON_DATA_IS_EGG, NULL) == 0) { - v3 = Pokemon_GetValue(v6, MON_DATA_GENDER, NULL); + if (Pokemon_GetValue(pokemon, MON_DATA_IS_EGG, NULL) == 0) { + v3 = Pokemon_GetValue(pokemon, MON_DATA_GENDER, NULL); if (v3 == 0) { v0 = 1; @@ -1061,12 +1061,12 @@ void sub_0206D7C4(FieldSystem *fieldSystem) if (v2 == 0) { if ((v0 == 1) && (v1 == 0)) { - v6 = Party_FindFirstHatchedMon(Party_GetFromSavedata(fieldSystem->saveData)); - sub_0206CE38(v6, &v9->unk_00, &v9->unk_02, &v9->unk_03, &v9->unk_04); + pokemon = Party_FindFirstHatchedMon(Party_GetFromSavedata(fieldSystem->saveData)); + sub_0206CE38(pokemon, &v9->unk_00, &v9->unk_02, &v9->unk_03, &v9->unk_04); sub_0206CD70(fieldSystem, 2, 16, v9); } else if ((v0 == 0) && (v1 == 1)) { - v6 = Party_FindFirstHatchedMon(Party_GetFromSavedata(fieldSystem->saveData)); - sub_0206CE38(v6, &v9->unk_00, &v9->unk_02, &v9->unk_03, &v9->unk_04); + pokemon = Party_FindFirstHatchedMon(Party_GetFromSavedata(fieldSystem->saveData)); + sub_0206CE38(pokemon, &v9->unk_00, &v9->unk_02, &v9->unk_03, &v9->unk_04); sub_0206CD70(fieldSystem, 2, 16, v9); } } @@ -1092,7 +1092,7 @@ static BOOL sub_0206D8F0(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D8B0 *v0 = (UnkStruct_0206D8B0 *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206D90C(TVBroadcast *fieldSystem, Pokemon *param1, u16 param2) @@ -1171,7 +1171,7 @@ static BOOL sub_0206DA50(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206D9F4 *v0 = (UnkStruct_0206D9F4 *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_00); } static void sub_0206DA6C(UnkStruct_0206DA6C *param0, const TrainerInfo *param1) @@ -1304,7 +1304,7 @@ static BOOL sub_0206DC3C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206DBE8 *v0 = (UnkStruct_0206DBE8 *)ov6_02246498(param1); - if (PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_02) == 0) { + if (Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_02) == 0) { return 0; } @@ -1341,7 +1341,7 @@ static int sub_0206DC9C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206DD1C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206DC9C *v0 = (UnkStruct_0206DC9C *)ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206DD38(FieldSystem *fieldSystem, u32 param1, u32 param2, u32 param3) @@ -1682,7 +1682,7 @@ static BOOL sub_0206E248(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param { UnkStruct_0206E1C0 *v0 = ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E264(FieldSystem *fieldSystem, u16 param1) @@ -1742,7 +1742,7 @@ static int sub_0206E300(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E37C(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E300 *v0 = ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00.unk_02); + return Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_00.unk_02); } void sub_0206E398(FieldSystem *fieldSystem, u16 param1) @@ -1776,7 +1776,7 @@ static int sub_0206E3C8(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206E3F8(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { UnkStruct_0206E3C8 *v0 = ov6_02246498(param1); - return PokedexData_HasSeenSpecies(SaveData_Pokedex(fieldSystem->saveData), v0->unk_00); + return Pokedex_HasSeenSpecies(SaveData_GetPokedex(fieldSystem->saveData), v0->unk_00); } void sub_0206E414(FieldSystem *fieldSystem, u16 param1) @@ -2754,12 +2754,12 @@ static int sub_0206F01C(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr { Strbuf *v0; u16 v1, v2, v3; - const Pokedex *v4 = SaveData_Pokedex(fieldSystem->saveData); + const Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 1)) + 1; for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { - if (PokedexData_HasSeenSpecies(v4, v1) == TRUE) { + if (Pokedex_HasSeenSpecies(pokedex, v1) == TRUE) { v3 = v1; break; } @@ -2803,7 +2803,7 @@ static Strbuf *sub_0206F0D8(u16 param0, u32 param1) static BOOL sub_0206F100(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - const Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); + const Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); if (Pokedex_IsObtained(pokedex) == TRUE) { return TRUE; @@ -2846,21 +2846,21 @@ static int sub_0206F160(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr { Strbuf *v0; u16 v1, v2; - Pokemon *v3; - Party *v4; - TrainerInfo *v5 = SaveData_GetTrainerInfo(fieldSystem->saveData); - Pokedex *v6 = SaveData_Pokedex(fieldSystem->saveData); + Pokemon *pokemon; + Party *party; + TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(fieldSystem->saveData); + Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); - v4 = Party_GetFromSavedata(fieldSystem->saveData); - v3 = Party_GetPokemonBySlotIndex(v4, sub_0205E1B4(fieldSystem->saveData)); + party = Party_GetFromSavedata(fieldSystem->saveData); + pokemon = Party_GetPokemonBySlotIndex(party, sub_0205E1B4(fieldSystem->saveData)); - sub_0206CE74(param1, 0, Pokemon_GetValue(v3, MON_DATA_SPECIES, NULL), Pokemon_GetValue(v3, MON_DATA_GENDER, NULL), TrainerInfo_RegionCode(v5), TrainerInfo_GameCode(v5)); + sub_0206CE74(param1, 0, Pokemon_GetValue(pokemon, MON_DATA_SPECIES, NULL), Pokemon_GetValue(pokemon, MON_DATA_GENDER, NULL), TrainerInfo_RegionCode(trainerInfo), TrainerInfo_GameCode(trainerInfo)); StringTemplate_SetContestAccessoryName(param1, 1, (LCRNG_Next() % 100)); v1 = (LCRNG_Next() % (NATIONAL_DEX_COUNT - 2) + 1); for (v2 = 1; v2 <= NATIONAL_DEX_COUNT; v2++) { - if (PokedexData_HasSeenSpecies(v6, v1) == TRUE) { + if (Pokedex_HasSeenSpecies(pokedex, v1) == TRUE) { v0 = sub_0206F0D8(v1, 4); StringTemplate_SetStrbuf(param1, 2, v0, 0, 1, GAME_LANGUAGE); Strbuf_Free(v0); @@ -2881,7 +2881,7 @@ static int sub_0206F160(FieldSystem *fieldSystem, StringTemplate *param1, UnkStr static BOOL sub_0206F260(FieldSystem *fieldSystem, UnkStruct_ov6_022465F4 *param1) { - const Pokedex *pokedex = SaveData_Pokedex(fieldSystem->saveData); + const Pokedex *pokedex = SaveData_GetPokedex(fieldSystem->saveData); if (Pokedex_IsObtained(pokedex) == TRUE) { return TRUE; diff --git a/src/unk_02071D40.c b/src/unk_02071D40.c index f7e7177014..4bdab8e85b 100644 --- a/src/unk_02071D40.c +++ b/src/unk_02071D40.c @@ -46,13 +46,13 @@ static BOOL sub_02072230(FieldTask *param0); void sub_02071D40(const u8 param0, const u8 param1, const u8 param2, const u8 param3, FieldSystem *fieldSystem, TrainerCard *param5) { - TrainerInfo *v0; - GameRecords *v1; - SaveData *v2; + TrainerInfo *trainerInfo; + GameRecords *gameRecords; + SaveData *saveData; - v2 = FieldSystem_GetSaveData(fieldSystem); - v0 = SaveData_GetTrainerInfo(v2); - v1 = SaveData_GetGameRecordsPtr(v2); + saveData = FieldSystem_GetSaveData(fieldSystem); + trainerInfo = SaveData_GetTrainerInfo(saveData); + gameRecords = SaveData_GetGameRecordsPtr(saveData); param5->unk_05 = param3; @@ -60,10 +60,10 @@ void sub_02071D40(const u8 param0, const u8 param1, const u8 param2, const u8 pa u8 v3; v3 = sub_02071F28(fieldSystem); - sub_02072014(param0, GAME_VERSION, v3, param2, TrainerInfo_RegionCode(v0), param5); + sub_02072014(param0, GAME_VERSION, v3, param2, TrainerInfo_RegionCode(trainerInfo), param5); } - sub_02072038(TrainerInfo_ID_LowHalf(v0), TrainerInfo_Gender(v0), TrainerInfo_Name(v0), TrainerInfo_Money(v0), Pokedex_CountSeen(SaveData_Pokedex(fieldSystem->saveData)), Pokedex_IsObtained(SaveData_Pokedex(fieldSystem->saveData)), GameRecords_GetTrainerScore(v1), param5); + sub_02072038(TrainerInfo_ID_LowHalf(trainerInfo), TrainerInfo_Gender(trainerInfo), TrainerInfo_Name(trainerInfo), TrainerInfo_Money(trainerInfo), Pokedex_CountSeen(SaveData_GetPokedex(fieldSystem->saveData)), Pokedex_IsObtained(SaveData_GetPokedex(fieldSystem->saveData)), GameRecords_GetTrainerScore(gameRecords), param5); { RTCDate v4; @@ -71,7 +71,7 @@ void sub_02071D40(const u8 param0, const u8 param1, const u8 param2, const u8 pa RTCTime v6; PlayTime *playTime; - playTime = SaveData_GetPlayTime(v2); + playTime = SaveData_GetPlayTime(saveData); sub_02055BF4(fieldSystem, &v4, &v6); sub_02055C10(fieldSystem, &v5, &v6); @@ -83,15 +83,15 @@ void sub_02071D40(const u8 param0, const u8 param1, const u8 param2, const u8 pa UnkStruct_0202C834 *v12; v12 = sub_0202C834(fieldSystem->saveData); - v8 = GameRecords_GetRecordValue(v1, RECORD_UNK_091) + GameRecords_GetRecordValue(v1, RECORD_UNK_019) + GameRecords_GetRecordValue(v1, RECORD_UNK_024) + GameRecords_GetRecordValue(v1, RECORD_UNK_020) + GameRecords_GetRecordValue(v1, RECORD_UNK_025) + GameRecords_GetRecordValue(v1, RECORD_UNK_032); - v9 = GameRecords_GetRecordValue(v1, RECORD_UNK_021) + GameRecords_GetRecordValue(v1, RECORD_UNK_026); - v10 = GameRecords_GetRecordValue(v1, RECORD_UNK_022) + GameRecords_GetRecordValue(v1, RECORD_UNK_027); - v11 = GameRecords_GetRecordValue(v1, RECORD_UNK_019) + GameRecords_GetRecordValue(v1, RECORD_UNK_024); + v8 = GameRecords_GetRecordValue(gameRecords, RECORD_UNK_091) + GameRecords_GetRecordValue(gameRecords, RECORD_UNK_019) + GameRecords_GetRecordValue(gameRecords, RECORD_UNK_024) + GameRecords_GetRecordValue(gameRecords, RECORD_UNK_020) + GameRecords_GetRecordValue(gameRecords, RECORD_UNK_025) + GameRecords_GetRecordValue(gameRecords, RECORD_UNK_032); + v9 = GameRecords_GetRecordValue(gameRecords, RECORD_UNK_021) + GameRecords_GetRecordValue(gameRecords, RECORD_UNK_026); + v10 = GameRecords_GetRecordValue(gameRecords, RECORD_UNK_022) + GameRecords_GetRecordValue(gameRecords, RECORD_UNK_027); + v11 = GameRecords_GetRecordValue(gameRecords, RECORD_UNK_019) + GameRecords_GetRecordValue(gameRecords, RECORD_UNK_024); sub_02072120(v8, v9, v10, v11, sub_0202C840(v12), param5); } - sub_0207216C(v0, fieldSystem, param5); + sub_0207216C(trainerInfo, fieldSystem, param5); { int v13, v14 = 0; @@ -123,24 +123,24 @@ void sub_02071F20(TrainerCard *param0) u8 sub_02071F28(FieldSystem *fieldSystem) { u8 v0; - SaveData *v1; - GameRecords *v2; - VarsFlags *v3; + SaveData *saveData; + GameRecords *gameRecords; + VarsFlags *varsFlags; SecretBaseRecord *v4; UnkStruct_0203068C *v5; - v1 = FieldSystem_GetSaveData(fieldSystem); - v2 = SaveData_GetGameRecordsPtr(v1); - v3 = SaveData_GetVarsFlags(v1); - v4 = SaveData_SecretBaseRecord(v1); - v5 = sub_0203068C(v1); + saveData = FieldSystem_GetSaveData(fieldSystem); + gameRecords = SaveData_GetGameRecordsPtr(saveData); + varsFlags = SaveData_GetVarsFlags(saveData); + v4 = SaveData_SecretBaseRecord(saveData); + v5 = sub_0203068C(saveData); v0 = 0; - if (SystemFlag_CheckGameCompleted(v3)) { + if (SystemFlag_CheckGameCompleted(varsFlags)) { v0++; } - if (PokedexData_NationalDexCompleted(SaveData_Pokedex(v1))) { + if (Pokedex_NationalDexCompleted(SaveData_GetPokedex(saveData))) { v0++; } @@ -148,7 +148,7 @@ u8 sub_02071F28(FieldSystem *fieldSystem) v0++; } - if (SystemFlag_CheckContestMaster(v3, 0) || SystemFlag_CheckContestMaster(v3, 1) || SystemFlag_CheckContestMaster(v3, 3) || SystemFlag_CheckContestMaster(v3, 4) || SystemFlag_CheckContestMaster(v3, 2)) { + if (SystemFlag_CheckContestMaster(varsFlags, 0) || SystemFlag_CheckContestMaster(varsFlags, 1) || SystemFlag_CheckContestMaster(varsFlags, 3) || SystemFlag_CheckContestMaster(varsFlags, 4) || SystemFlag_CheckContestMaster(varsFlags, 2)) { v0++; } diff --git a/src/unk_0207A274.c b/src/unk_0207A274.c index 64cb36777c..42a5e0f283 100644 --- a/src/unk_0207A274.c +++ b/src/unk_0207A274.c @@ -13,7 +13,7 @@ u32 sub_0207A274(SaveData *param0) { Pokedex *v0; - v0 = SaveData_Pokedex(param0); + v0 = SaveData_GetPokedex(param0); return sub_0207A280(v0); } @@ -21,7 +21,7 @@ u32 sub_0207A280(const Pokedex *param0) { BOOL v0; - v0 = PokedexData_IsNationalDexObtained(param0); + v0 = Pokedex_IsNationalDexObtained(param0); if (v0 == 1) { return 1; diff --git a/src/unk_0207AE68.c b/src/unk_0207AE68.c index f091ab43de..632053ac69 100644 --- a/src/unk_0207AE68.c +++ b/src/unk_0207AE68.c @@ -409,7 +409,7 @@ static void sub_0207B180(UnkStruct_0207AE68 *param0) case 12: if (Text_IsPrinterActive(param0->unk_65) == 0) { if (--param0->unk_66 == 0) { - PokedexData_Capture(param0->unk_48, param0->unk_28); + Pokedex_Capture(param0->unk_48, param0->unk_28); GameRecords_IncrementRecordValue(param0->records, RECORD_UNK_012); GameRecords_IncrementTrainerScore(param0->records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); PoketchData_PokemonHistoryEnqueue(param0->poketch, Pokemon_GetBoxPokemon(param0->unk_28)); @@ -739,7 +739,7 @@ static void sub_0207C028(UnkStruct_0207AE68 *param0) Pokemon_CalcLevelAndStats(v1); Party_AddPokemon(param0->unk_24, v1); - PokedexData_Capture(param0->unk_48, v1); + Pokedex_Capture(param0->unk_48, v1); GameRecords_IncrementRecordValue(param0->records, RECORD_UNK_012); GameRecords_IncrementTrainerScore(param0->records, TRAINER_SCORE_EVENT_CAUGHT_SPECIES); PoketchData_PokemonHistoryEnqueue(param0->poketch, Pokemon_GetBoxPokemon(v1)); diff --git a/src/unk_020933F8.c b/src/unk_020933F8.c index 36cc16462b..1495fbb08d 100644 --- a/src/unk_020933F8.c +++ b/src/unk_020933F8.c @@ -1623,7 +1623,7 @@ void sub_02094C44(UnkStruct_02095C48 *param0, SaveData *param1, u32 param2, Jour } int i; - Pokedex *pokedex = SaveData_Pokedex(param0->unk_1970); + Pokedex *pokedex = SaveData_GetPokedex(param0->unk_1970); for (i = param0->unk_00.unk_117; i < 4; i++) { Pokedex_Encounter(pokedex, param0->unk_00.unk_00[i]); diff --git a/src/unk_0209747C.c b/src/unk_0209747C.c index 3874a15788..91cb5a4a24 100644 --- a/src/unk_0209747C.c +++ b/src/unk_0209747C.c @@ -33,19 +33,19 @@ struct UnkStruct_0209747C_t { u16 unk_20[2]; }; -UnkStruct_0209747C *sub_0209747C(u32 param0, u32 param1, SaveData *param2, u32 param3) +UnkStruct_0209747C *sub_0209747C(u32 param0, u32 param1, SaveData *saveData, u32 param3) { UnkStruct_0209747C *v0 = Heap_AllocFromHeap(param3, sizeof(UnkStruct_0209747C)); v0->unk_00 = param0; v0->unk_01 = param1; - v0->unk_0C = SaveData_Pokedex(param2); - v0->unk_10 = sub_02014EC4(param2); - v0->unk_04 = SystemFlag_CheckGameCompleted(SaveData_GetVarsFlags(param2)); + v0->unk_0C = SaveData_GetPokedex(saveData); + v0->unk_10 = sub_02014EC4(saveData); + v0->unk_04 = SystemFlag_CheckGameCompleted(SaveData_GetVarsFlags(saveData)); v0->unk_05 = 0; v0->unk_02 = 1; v0->unk_03 = 0; - v0->unk_08 = Options_Frame(SaveData_Options(param2)); + v0->unk_08 = Options_Frame(SaveData_Options(saveData)); if (param0 == 2) { sub_02014A9C(&v0->unk_14, 3); diff --git a/src/unk_020998EC.c b/src/unk_020998EC.c index a85759b878..177f39f02b 100644 --- a/src/unk_020998EC.c +++ b/src/unk_020998EC.c @@ -3229,14 +3229,14 @@ static inline BOOL inline_02099BF4(const UnkStruct_020998EC *param0, u32 param1) static u32 sub_02099980(UnkStruct_020998EC *param0, const u16 *param1, u32 param2, u16 *param3) { - const Pokedex *v0; + const Pokedex *pokedex; u32 v1, v2; v2 = 0; - v0 = sub_0209755C(param0->unk_00); + pokedex = sub_0209755C(param0->unk_00); for (v1 = 0; v1 < param2; v1++) { - if (PokedexData_HasSeenSpecies(v0, param1[v1])) { + if (Pokedex_HasSeenSpecies(pokedex, param1[v1])) { inline_02099980(param0, param1[v1]); *param3++ = param1[v1]; v2++; diff --git a/tools/scripts/make_pokedex_data.py b/tools/scripts/make_pokedex_data.py index 8b3b9ef13c..c354d12b76 100644 --- a/tools/scripts/make_pokedex_data.py +++ b/tools/scripts/make_pokedex_data.py @@ -114,8 +114,8 @@ def DataSize(num): # sinnoh dex order with open(source_dir / 'sinnoh_pokedex.json') as data_file: - dexData = json.load(data_file) - for mon in dexData: + pokedex = json.load(data_file) + for mon in pokedex: if mon not in ['SPECIES_EGG', 'SPECIES_BAD_EGG', 'SPECIES_NONE', 'SPECIES_ARCEUS']: binData[12] = binData[12] + PokemonSpecies[mon].value.to_bytes(2, 'little') From 69425c07e7a274f7eb8f36cd71e3a1ca9f7d96a8 Mon Sep 17 00:00:00 2001 From: Adrienn Tindall <33725376+adrienntindall@users.noreply.github.com> Date: Tue, 14 Jan 2025 08:17:01 -0500 Subject: [PATCH 4/4] run make format --- include/constants/battle.h | 10 +++++----- src/battle/ov16_0223B140.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index 14c32faf56..daf5c43152 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -100,11 +100,11 @@ enum BattlerBootState { * * PLAYER_SLOT_1 PLAYER_SLOT_2 */ -#define BATTLER_PLAYER_1 0 -#define BATTLER_ENEMY_1 1 -#define BATTLER_PLAYER_2 2 -#define BATTLER_ENEMY_2 3 -#define BATTLER_NONE 0xFF +#define BATTLER_PLAYER_1 0 +#define BATTLER_ENEMY_1 1 +#define BATTLER_PLAYER_2 2 +#define BATTLER_ENEMY_2 3 +#define BATTLER_NONE 0xFF #define BATTLER_TYPE_SOLO_PLAYER 0 #define BATTLER_TYPE_SOLO_ENEMY 1 diff --git a/src/battle/ov16_0223B140.c b/src/battle/ov16_0223B140.c index f7695bedbe..8da3eab2b5 100644 --- a/src/battle/ov16_0223B140.c +++ b/src/battle/ov16_0223B140.c @@ -727,7 +727,7 @@ static void ov16_0223BCB4(OverlayManager *param0) TrainerInfo_Copy(battleSystem->trainerInfo[battlerId], v1->trainerInfo[battlerId]); Heap_FreeToHeap(battleSystem->trainerInfo[battlerId]); } - + sub_02015760(battleSystem->unk_1AC); Bag_Copy(battleSystem->unk_58, v1->bag); Heap_FreeToHeap(battleSystem->unk_58);