Skip to content

Commit

Permalink
add function names
Browse files Browse the repository at this point in the history
Adds names to many unnamed functions for readability. Also adds names to a couple structs.
  • Loading branch information
ecopsychologer committed Nov 17, 2023
1 parent d3a8296 commit 7941c4e
Show file tree
Hide file tree
Showing 51 changed files with 362 additions and 362 deletions.
2 changes: 1 addition & 1 deletion include/overlay006/battle_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef struct {
UnkStruct_0207D99C * unk_E4;
UnkStruct_02026324 * unk_E8;
PCBoxes * unk_EC;
UnkStruct_0202CC84 * unk_F0[4];
ChatotCryData * unk_F0[4];
UnkStruct_02056B24 * unk_100;
UnkStruct_0202C878 * unk_104;
UnkStruct_020279FC * unk_108;
Expand Down
2 changes: 1 addition & 1 deletion include/overlay016/ov16_0223DF00.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ int ov16_0223EDE0(BattleSystem * param0);
u8 BattleSystem_TextSpeed(BattleSystem * param0);
int BattleSystem_Ruleset(BattleSystem * param0);
UnkStruct_02015F84 * ov16_0223EE28(BattleSystem * param0);
UnkStruct_0202CC84 * BattleSystem_ChatotVoice(BattleSystem * param0, int param1);
ChatotCryData * 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);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay016/struct_ov16_02264408.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ typedef struct {
u32 unk_4C[4];
int unk_50;
UnkStruct_ov16_02264408_sub1 unk_54;
UnkStruct_0202CC84 * unk_6C;
ChatotCryData * unk_6C;
u8 * unk_70;
u16 * unk_74;
} UnkStruct_ov16_02264408;
Expand Down
20 changes: 10 additions & 10 deletions include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -764,10 +764,10 @@ int Pokemon_LoadLevelUpMoveIdsOf(int monSpecies, int monForm, u16 *monLevelUpMov

void Pokemon_ApplyPokerus(Party *party);
u8 Pokemon_HasPokerus(Party *party, u8 param1);
void sub_020777B4(Party *party, s32 param1);
void UpdatePokerusStatusInParty(Party *party, s32 param1);
void Pokemon_ValidatePokerus(Party *party);
BOOL sub_020778D8(Pokemon *mon);
BOOL sub_020778F8(Pokemon *mon);
BOOL IsPokemonInfectedWithPokerus(Pokemon *mon);
BOOL CanPokemonSpreadPokerus(Pokemon *mon);

/**
* @brief Sets Arceus' form based on its held item. Has no effect if the given Pokemon is not an Arceus
Expand Down Expand Up @@ -886,14 +886,14 @@ BOOL Pokemon_SetRotomForm(Pokemon *mon, int monForm, int moveSlot);
*/
void Pokemon_LoadLevelUpMovesOf(int monSpecies, int monForm, u16 *monLevelUpMoves);

void sub_02077D3C(UnkStruct_0202CC84 *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7);
void sub_02077DB4(UnkStruct_0202CC84 *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7, u8 param8);
BOOL sub_02077E3C(Pokemon *mon);
void sub_02077E64(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5);
void sub_02077EE4(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5);
void sub_02077F0C(Pokemon *mon, u32 param1, int param2);
void HandleChatotSpecialInteraction(ChatotCryData *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7);
void HandleChatotSpecialAction(ChatotCryData *param0, int param1, u16 monSpecies, int param3, int param4, int param5, int param6, int param7, u8 param8);
BOOL IsPokemonEligibleForAction(Pokemon *mon);
void InitializePokemonAfterCapture(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5);
void PostCapturePokemonProcessing(Pokemon *mon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5);
void AssignHeldItemToPokemon(Pokemon *mon, u32 param1, int param2);
BOOL Pokemon_CanLearnTM(Pokemon *mon, u8 tmID);
BOOL Pokemon_CanFormLearnTM(u16 monSpecies, int monForm, u8 tmID);
BOOL CanPokemonFormLearnTM(u16 monSpecies, int monForm, u8 tmID);

/**
* @brief Sets the ability of a Pokemon based on its species, form and peronsality value
Expand Down
2 changes: 1 addition & 1 deletion include/struct_decls/struct_0202CC84_decl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef POKEPLATINUM_STRUCT_0202CC84_DECL_H
#define POKEPLATINUM_STRUCT_0202CC84_DECL_H

typedef struct UnkStruct_0202CC84_t UnkStruct_0202CC84;
typedef struct ChatotCryData_t ChatotCryData;

#endif // POKEPLATINUM_STRUCT_0202CC84_DECL_H
2 changes: 1 addition & 1 deletion include/struct_defs/battle_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct BattleSystem {
UnkStruct_02026324 *pokedex;
PCBoxes *pcBoxes;
Party *parties[4];
UnkStruct_0202CC84 * unk_78[4];
ChatotCryData * unk_78[4];
UnkStruct_02007768 * unk_88;
UnkStruct_ov12_0221FCDC * unk_8C;
UnkStruct_0200C6E4 * unk_90;
Expand Down
12 changes: 6 additions & 6 deletions include/struct_defs/struct_02090800.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ typedef struct {
UnkStruct_0200B358 * unk_08;
Pokemon * unk_0C;
BOOL unk_10;
UnkStruct_02090800_sub1 unk_14;
UnkStruct_02090800_sub1 unk_1C;
UnkStruct_02090800_sub1 unk_24;
UnkStruct_02090800_sub1 unk_2C;
UnkStruct_02090800_sub1 unk_34;
} UnkStruct_02090800;
PokemonInfoDisplayStruct_sub1 unk_14;
PokemonInfoDisplayStruct_sub1 unk_1C;
PokemonInfoDisplayStruct_sub1 unk_24;
PokemonInfoDisplayStruct_sub1 unk_2C;
PokemonInfoDisplayStruct_sub1 unk_34;
} PokemonInfoDisplayStruct;

#endif // POKEPLATINUM_STRUCT_02090800_H
2 changes: 1 addition & 1 deletion include/struct_defs/struct_02090800_sub1.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
typedef struct {
int unk_00;
Strbuf* unk_04;
} UnkStruct_02090800_sub1;
} PokemonInfoDisplayStruct_sub1;

#endif // POKEPLATINUM_STRUCT_02090800_SUB1_H
2 changes: 1 addition & 1 deletion include/struct_defs/struct_02095E80_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct UnkStruct_02095E80_t {
int (* unk_226C)(UnkStruct_02095E80 *);
Party * unk_2270;
Party * unk_2274;
UnkStruct_0202CC84 * unk_2278;
ChatotCryData * unk_2278;
UnkStruct_02027F8C * unk_227C;
UnkStruct_02027F8C unk_2280;
int unk_2308;
Expand Down
2 changes: 1 addition & 1 deletion include/struct_defs/struct_02098D38.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef struct {
u32 unk_1C;
void * unk_20;
void * unk_24;
UnkStruct_0202CC84 * unk_28;
ChatotCryData * unk_28;
BOOL unk_2C;
} UnkStruct_02098D38;

Expand Down
2 changes: 1 addition & 1 deletion include/unk_02003B60.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <nnsys.h>

void sub_02003B60(UnkStruct_0202CC84 * param0, UnkStruct_020279FC * param1);
void sub_02003B60(ChatotCryData * param0, UnkStruct_020279FC * param1);
void sub_02003BD8(void);
void sub_02003D0C(int param0);
UnkStruct_02003D54 * sub_02003D54(void);
Expand Down
24 changes: 12 additions & 12 deletions include/unk_02006224.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

#include <nitro/spi.h>

BOOL sub_02006224(void);
BOOL sub_02006260(const UnkStruct_0202CC84 * param0);
BOOL sub_0200629C(const UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3);
void sub_02006350(void);
MICResult sub_0200637C(void);
MICResult sub_020063B8(void);
void sub_020063C0(UnkStruct_0202CC84 * param0);
void sub_020063D4(u8 param0);
BOOL sub_020063E4(UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3);
BOOL sub_02006438(UnkStruct_0202CC84 * param0, u32 param1, int param2, int param3, u8 param4);
int Sound_Chatter(UnkStruct_0202CC84 * param0);
BOOL sub_020064C8(int param0);
BOOL CheckMicRecordingStatus(void);
BOOL IsChatotCryStructReadyForProcessing(const ChatotCryData * param0);
BOOL ProcessAudioInput(const ChatotCryData * param0, u32 param1, int param2, int param3);
void ResetMicStatusFlags(void);
MICResult StartMicSampling(void);
MICResult StopMicSampling(void);
void StoreMicDataInChatotCryStruct(ChatotCryData * param0);
void SetMicProcessingFlag(u8 param0);
BOOL ProcessChatotCryStructWithAudioParams(ChatotCryData * param0, u32 param1, int param2, int param3);
BOOL ProcessChatotCryStructWithExtendedAudioParams(ChatotCryData * param0, u32 param1, int param2, int param3, u8 param4);
int Sound_Chatter(ChatotCryData * param0);
BOOL IsAudioParamValid(int param0);

#endif // POKEPLATINUM_UNK_02006224_H
20 changes: 10 additions & 10 deletions include/unk_0202CC64.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#include "struct_decls/struct_0202CC84_decl.h"
#include "struct_decls/struct_021C0794_decl.h"

int ChatotCry_SaveSize(void);
void ChatotCry_Init(UnkStruct_0202CC84 * param0);
UnkStruct_0202CC84 * sub_0202CC84(int param0);
UnkStruct_0202CC84 * sub_0202CC98(SaveData * param0);
BOOL sub_0202CCA4(const UnkStruct_0202CC84 * param0);
void sub_0202CCA8(UnkStruct_0202CC84 * param0);
const void * sub_0202CCB0(const UnkStruct_0202CC84 * param0);
void sub_0202CCB4(s8 * param0, const s8 * param1);
void sub_0202CCEC(UnkStruct_0202CC84 * param0, const s8 * param1);
void sub_0202CD3C(UnkStruct_0202CC84 * param0, const UnkStruct_0202CC84 * param1);
int GetSizeOfChatotCryData(void);
void ChatotCry_Init(ChatotCryData * param0);
ChatotCryData * AllocateAndInitializeChatotCryData(int param0);
ChatotCryData * GetChatotCryDataFromSave(SaveData * param0);
BOOL IsChatotCryDataValid(const ChatotCryData * param0);
void ResetChatotCryDataStatus(ChatotCryData * param0);
const void * GetChatotCryAudioBuffer(const ChatotCryData * param0);
void ProcessChatotCryAudioData(s8 * param0, const s8 * param1);
void StoreProcessedAudioInChatotCryData(ChatotCryData * param0, const s8 * param1);
void CopyChatotCryData(ChatotCryData * param0, const ChatotCryData * param1);

#endif // POKEPLATINUM_UNK_0202CC64_H
2 changes: 1 addition & 1 deletion include/unk_02051D8C.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void sub_020520A4(BattleParams * param0);
void sub_0205213C(BattleParams * param0, Pokemon * param1, int param2);
void sub_02052164(BattleParams * param0, const Party * param1, int param2);
void sub_02052184(BattleParams * param0, const TrainerInfo * param1, int param2);
void sub_020521A4(BattleParams * param0, const UnkStruct_0202CC84 * param1, int param2);
void sub_020521A4(BattleParams * param0, const ChatotCryData * param1, int param2);
void sub_020521B8(BattleParams * param0, const UnkStruct_0203CDB0 * param1, SaveData * param2, int param3, UnkStruct_0202B628 * param4, UnkStruct_0207D99C * param5, UnkStruct_0209C370 * param6);
void sub_02052314(BattleParams * param0, const UnkStruct_0203CDB0 * param1);
void sub_02052348(BattleParams * param0, const UnkStruct_0203CDB0 * param1, int param2);
Expand Down
6 changes: 3 additions & 3 deletions include/unk_02092494.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include "pokemon.h"
#include "struct_defs/struct_02090800.h"

UnkStruct_02090800 * sub_02092494(Pokemon * param0, BOOL param1, int param2);
void sub_0209282C(UnkStruct_02090800 * param0);
PokemonInfoDisplayStruct * sub_02092494(Pokemon * param0, BOOL param1, int param2);
void sub_0209282C(PokemonInfoDisplayStruct * param0);
void sub_0209304C(Pokemon * param0, TrainerInfo * param1, int param2, int param3, int param4);
void sub_0209305C(BoxPokemon * param0, TrainerInfo * param1, int param2, int param3, int param4);
void ProcessBoxPokemonWithTrainerInfo(BoxPokemon * param0, TrainerInfo * param1, int param2, int param3, int param4);

#endif // POKEPLATINUM_UNK_02092494_H
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void NitroMain (void)
Unk_02101D28.unk_10.unk_00 = -1;
Unk_02101D28.unk_10.unk_08 = sub_020244AC();

sub_02003B60(sub_0202CC98(Unk_02101D28.unk_10.unk_08), sub_02025E44(Unk_02101D28.unk_10.unk_08));
sub_02003B60(GetChatotCryDataFromSave(Unk_02101D28.unk_10.unk_08), sub_02025E44(Unk_02101D28.unk_10.unk_08));
sub_02022844();

if (sub_02038FFC(3) == DWC_INIT_RESULT_DESTROY_OTHER_SETTING) {
Expand Down
6 changes: 3 additions & 3 deletions src/overlay005/ov5_021E622C.c
Original file line number Diff line number Diff line change
Expand Up @@ -2041,8 +2041,8 @@ static void ov5_021E62C4 (Party * param0, int param1, UnkStruct_02026218 * param
Party_RemovePokemonBySlotIndex(param0, param1);

if (Party_HasSpecies(param0, 441) == 0) {
UnkStruct_0202CC84 * v7 = sub_0202CC98(param3);
sub_0202CCA8(v7);
ChatotCryData * v7 = GetChatotCryDataFromSave(param3);
ResetChatotCryDataStatus(v7);
}
}

Expand Down Expand Up @@ -2441,7 +2441,7 @@ static void ov5_021E6948 (Pokemon * param0, BoxPokemon * param1, BoxPokemon * pa
if (v7->unk_00[v0] != 0) {
for (v1 = 0; v1 < 100; v1++) {
if (v7->unk_00[v0] == Item_MoveForTMHM(328 + v1)) {
if (Pokemon_CanFormLearnTM(v3, v6, v1)) {
if (CanPokemonFormLearnTM(v3, v6, v1)) {
if (Pokemon_AddMove(param0, v7->unk_00[v0]) == 0xffff) {
Pokemon_ReplaceMove(param0, v7->unk_00[v0]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/overlay006/ov6_02240C9C.c
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ static BOOL ov6_02242514 (const int param0, const UnkStruct_ov6_022422D0 * param
}
}

sub_02077F0C(param2, param3->battleType, v0);
AssignHeldItemToPokemon(param2, param3->battleType, v0);

{
u8 v1;
Expand Down
2 changes: 1 addition & 1 deletion src/overlay006/ov6_02243258.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ static int ov6_02244228 (UnkStruct_ov6_02243FFC * param0)
param0->unk_00++;

{
sub_02077E3C(param0->unk_5C);
IsPokemonEligibleForAction(param0->unk_5C);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/overlay006/ov6_022489E4.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void ov6_02248D38 (int param0, int param1, void * param2, void * param3)
int v2;
u8 * v3;

v1 = ChatotCry_SaveSize();
v1 = GetSizeOfChatotCryData();
v3 = param2;
v2 = v3[v1];

Expand All @@ -311,7 +311,7 @@ BOOL ov6_02248D64 (UnkStruct_02095C48 * param0, int param1, void * param2)
int v1;
int v2;

v1 = ChatotCry_SaveSize();
v1 = GetSizeOfChatotCryData();
v0 = param0->unk_569;

if (param2 != NULL) {
Expand Down
4 changes: 2 additions & 2 deletions src/overlay012/ov12_0221FC20.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ typedef struct UnkStruct_ov12_02223178_t {
u8 unk_E8[4];
u32 unk_EC[4];
u32 unk_FC[4];
UnkStruct_0202CC84 * unk_10C;
ChatotCryData * unk_10C;
u8 * unk_110;
u16 * unk_114;
int unk_118;
Expand Down Expand Up @@ -3836,7 +3836,7 @@ static void ov12_022230D4 (UnkStruct_ov12_0221FCDC * param0)
v3 = param0->unk_BC->unk_D8[param0->unk_BC->unk_14];
v4 = param0->unk_BC->unk_E8[param0->unk_BC->unk_14];

sub_02077D3C(param0->unk_BC->unk_10C, v0, v3, v4, v1, v2, param0->unk_BC->unk_118, param0->unk_00);
HandleChatotSpecialInteraction(param0->unk_BC->unk_10C, v0, v3, v4, v1, v2, param0->unk_BC->unk_118, param0->unk_00);
}

static void ov12_02223134 (UnkStruct_ov12_0221FCDC * param0)
Expand Down
4 changes: 2 additions & 2 deletions src/overlay016/ov16_0223DF00.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int ov16_0223EDE0(BattleSystem * param0);
u8 BattleSystem_TextSpeed(BattleSystem * param0);
int BattleSystem_Ruleset(BattleSystem * param0);
UnkStruct_02015F84 * ov16_0223EE28(BattleSystem * param0);
UnkStruct_0202CC84 * BattleSystem_ChatotVoice(BattleSystem * param0, int param1);
ChatotCryData * 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);
Expand Down Expand Up @@ -1053,7 +1053,7 @@ UnkStruct_02015F84 * ov16_0223EE28 (BattleSystem * param0)
return param0->unk_1C4;
}

UnkStruct_0202CC84 * BattleSystem_ChatotVoice (BattleSystem * param0, int param1)
ChatotCryData * BattleSystem_ChatotVoice (BattleSystem * param0, int param1)
{
if ((param0->battleType & 0x8) || ((param0->battleType & 0x10) && (BattleSystem_BattlerSlot(param0, param1) & 0x1))) {
return param0->unk_78[param1];
Expand Down
2 changes: 1 addition & 1 deletion src/overlay016/ov16_0225177C.c
Original file line number Diff line number Diff line change
Expand Up @@ -6252,7 +6252,7 @@ void ov16_02259A5C (BattleSystem * param0, BattleContext * param1, Pokemon * par
v3 = param1->msgItemTemp;
}

sub_02077E64(param2, v0, v3, v1, v2, 5);
InitializePokemonAfterCapture(param2, v0, v3, v1, v2, 5);
}

u8 BattleContext_IOBufferVal (BattleContext *battleCtx, int battler)
Expand Down
Loading

0 comments on commit 7941c4e

Please sign in to comment.