-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename some 'sub_' functions #115
Conversation
also seemingly located the party healing function
Adds names to many unnamed functions for readability. Also adds names to a couple structs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contributions! I've got some feedback to make sure that the function names match the general style of the repository.
include/pokemon.h
Outdated
u32 unk_00; | ||
u8 level; //!< The pokemons level | ||
u8 unk_05; | ||
u16 unk_06; | ||
u16 unk_08; | ||
u16 unk_0A; | ||
u16 unk_0C; | ||
u16 unk_0E; | ||
u16 unk_10; | ||
u16 unk_12; | ||
u32 status; | ||
u8 level; | ||
u8 mail; | ||
u16 hp; | ||
u16 maxHP; | ||
u16 attack; | ||
u16 defense; | ||
u16 speed; | ||
u16 spAtk; | ||
u16 spDef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, maintain the Doxygen comments on struct fields (and add them, if possible).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I'm sorry I'm fairly new to this and thought that was an excited comment, I'll try to add some. What does it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-added there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Doxygen comments are for whenever we want to generate documentation, similar to Javadoc or Sphinx: https://www.doxygen.nl/
include/unk_02092494.h
Outdated
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this function do? Process
is a bit generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it, it does kind of a bunch with cases but basically sets or processes the setting of box pokemon trainer info and met location
static BOOL IsBoxPokemonInfectedWithPokerus(BoxPokemon *boxMon); | ||
static BOOL CanBoxPokemonSpreadPokerus(BoxPokemon *boxMon); | ||
static void InitializeBoxPokemonAfterCapture(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); | ||
static void PostCaptureBoxPokemonProcessing(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); | ||
static BOOL CanBoxPokemonLearnTM(BoxPokemon *boxMon, u8 tmID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static BOOL IsBoxPokemonInfectedWithPokerus(BoxPokemon *boxMon); | |
static BOOL CanBoxPokemonSpreadPokerus(BoxPokemon *boxMon); | |
static void InitializeBoxPokemonAfterCapture(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); | |
static void PostCaptureBoxPokemonProcessing(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); | |
static BOOL CanBoxPokemonLearnTM(BoxPokemon *boxMon, u8 tmID); | |
static BOOL BoxPokemon_InfectedWithPokerus(BoxPokemon *boxMon); | |
static BOOL BoxPokemon_CanSpreadPokerus(BoxPokemon *boxMon); | |
static void BoxPokemon_InitAfterCatch(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); | |
static void BoxPokemon_UpdateAfterCatch(BoxPokemon *boxMon, TrainerInfo *param1, int monPokeball, int param3, int param4, int param5); | |
static BOOL BoxPokemon_LearnsTM(BoxPokemon *boxMon, u8 tmID); |
src/unk_02006224.c
Outdated
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just delete these, their declarations should be included by the header.
src/unk_0202CC64.c
Outdated
typedef struct ChatotCryData_t { | ||
BOOL unk_00; | ||
s8 unk_04[1000]; | ||
} UnkStruct_0202CC84; | ||
} ChatotCryData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this struct transparent.
@@ -13,25 +13,25 @@ | |||
#include "pokemon.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file related to the Summary Screen?
ProcessBoxPokemonWithTrainerInfo is now UpdateBoxMonStatusAndTrainerInfo and all params are labeled
I'll look more at this later, thank you for reviewing! |
@@ -1,7 +1,7 @@ | |||
#ifndef POKEPLATINUM_STRUCT_02013A04_T_H | |||
#define POKEPLATINUM_STRUCT_02013A04_T_H | |||
|
|||
struct UnkStruct_02013A04_t { | |||
struct ResourceMetadata_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking on this one since it's short and a good example.
In an earlier file include/struct_decls/struct_02013A04_decl.h
, we have this typedef:
typedef struct ResourceMetadata_t ResourceMetadata;
The general style we're using for the gen4 projects is to merge these together and make the struct definition transparent. So, we'd instead have the single file with this:
typedef struct ResourceMetadata {
const void * unk_00;
u32 unk_04;
} ResourceMetadata;
Then remove the includes for the previous file:
#include "struct_decls/struct_02013A04_decl.h"
And, finally, delete the decl file.
I've added a few comments as I've been trying to improve readability of the code, but my main goal has been to rename the functions from 'sub_XXXXXXXX' to a descriptive name. On my machine the rom builds successfully and runs.