-
Notifications
You must be signed in to change notification settings - Fork 66
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
Document pokemon.c and Pokemon data structs #47
Conversation
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 the future, try to separate out mass-renames as a separate commit from manual cleanup work. Makes these big reviews much more manageable, as I can just skim over those commits and focus on the meat of your changes.
Probably look at pret/pokeheartgold#213 on how to name functions. |
The list of renamed functions should also contain static functions as well. |
From the discussion in Discord:
|
|
because I'm not sure how to name a lot of these consistently, i made a list of all the functions in |
fc5b676
to
69e7b35
Compare
fd5292e
to
c563f45
Compare
There's still a lot of work to be done on this but there's also already too much here and I don't know how to split it up in a way that makes sense to read so I'm just PR'ing as is for now while I continue working on it.
Added Doxygen comments to most of the functions in
pokemon.h
and the structs.(Edit: There's been some more renames and a good few structural changes since initial PR)
Deleted Files
include/
struct_decls/
party_pokemon.h
struct_02075874_decl.h
struct_0207821C_decl.h
struct_0207821C_sub1_decl.h
struct_defs/
box_pokemon.h
party_pokemon.h
pokemon.h
pokemon_substruct_0.h
pokemon_substruct_1.h
pokemon_substruct_2.h
pokemon_substruct_3.h
struct_02075874.h
struct_0207821C.h
struct_0207821C_sub1.h
struct_0207825C.h
struct_0207825C_{1..23}.h
Renamed Files
include/
unk_02073C2C.h
->pokemon.h
src/
unk_02073C2C.c
->pokemon.c
Deleted Structs
UnkStruct_0207825C
UnkStruct_0207825C_{1..23}
Moved Structs
BoxPokemon
-> include/pokemon.hPartyPokemon
-> include/pokemon.hPokemon
-> include/pokemon.hPokemonSubstruct0
-> include/pokemon.h (renamedPokemonDataBlockA
)PokemonSubstruct1
-> include/pokemon.h (renamedPokemonDataBlockB
)PokemonSubstruct2
-> include/pokemon.h (renamedPokemonDataBlockC
)PokemonSubstruct3
-> include/pokemon.h (renamedPokemonDataBlockD
)UnkStruct_02075874
-> include/pokemon.h (renamedPokemonPersonalData
)UnkStruct_0207821C
-> src/pokemon.c (renamedPokemonEvolutionData
)UnkStruct_0207821C_sub1
-> src/pokemon.c (renamedPokemonEvolutionMethod
)Edited Structs,Enums,Constants,Globals
enum PokemonType
: replaces block of#define
senum PokemonStats
: IDs for mon stats (HP, Atk, etc.)enum PokemonGender
: IDs for mon genderenum PokemonDataParam
: used to be anonymous enumenum PokemonPersonalDataParam
: IDs for getting values fromPokemonPersonalData
funcsstruct UnkStruct_02078B40
: renamed fields, contains pokemon datastruct PokemonPersonalData
: Data shared across all mons of the same species/form (base stats, gender chance etc.)struct PokemonDataBlock{A/B/C/D}
: Boxed Pokemon data blocksunion PokemonDataBlock
: For array dataBlocks inBoxPokemon
struct BoxPokemon
: renamed all but one (unused/padding) fieldstruct PartyPokemon
: renamed fieldunk_04
->level
struct Pokemon
:static const s8 Unk_020F0695[][5]
->sNatureFlavorAffinities
: Mapping from pokemon natures to liked/disliked flavorsstruct PokemonEvolutionMethod
: Pokemon evolution methodstruct PokemonEvolutionData
: Data table for storing a pokemons possible evolution methodsstatic enum PokemonDataBlockID
: For getting data blocks from aBoxPokemon
static enum PokemonGenderRatio
: Special values for pokemon gender ratiostatic const s8 Unk_020F0618[][5]
->sNatureStatAffinities
: Mapping from pokemon natures to increased/decreased statsstatic const u16 Unk_020F0574[][2]
->sHeldItemChance
: Chances of a wild pokemon holding an itemu32 Unk_021BFB14
->gLCRNG_State
: State for the Linear Congruential RNGstatic u32 Unk_021BFB18[624]
->sMTRNG_State
: State for the Mersenne Twister RNGstatic int Unk_02100834
->sMTRNG_Size
: Size of Mersenne Twister Statestatic u32 Unk_02100838[2]
->sMTRNG_Xor
: Constants for Mersenne Twister RNGEdited Functions
sub_0201D608
->LCRNG_NextFrom
sub_0201D2D0
->LCRNG_GetSeed
sub_0201D2DC
->LCRNG_SetSeed
sub_0201D2E8
->LCRNG_Next
sub_0201D30C
->ARNG_Next
sub_0201D318
->MTRNG_SetSeed
sub_0201D35C
->MTRNG_Next
sub_0201D5D4
->EncryptData
-> (planned:sub_0201D600
->DecryptData
-> (planned:ZeroMonData
->Pokemon_Init
ZeroBoxMonData
->BoxPokemon_Init
PokemonStructSize
->Pokemon_StructSize
AllocMonZeroed
->Pokemon_New
sub_02073C88
->Pokemon_EnterDecryptionContext
sub_02073CD4
->Pokemon_ExitDecryptionContext
sub_02073D20
->BoxPokemon_EnterDecryptionContext
sub_02073D48
->BoxPokemon_ExitDecryptionContext
sub_02073D80
->sub_02073E18
-> moved (static)sub_02074044
->sub_02074088
->sub_02074128
->sub_02074158
->sub_0207418C
->Pokemon_CalcLevelAndStats
sub_020741B8
->Pokemon_CalcStats
GetMonData
->Pokemon_GetValue
sub_02074570
->BoxPokemon_GetValue
sub_02074B30
->Pokemon_SetValue
SetBoxMonData
->BoxPokemon_SetValue
sub_0207536C
->Pokemon_IncreaseValue
sub_02075874
->PokemonPersonalData_FromMonForm
sub_02075894
->PokemonPersonalData_FromMonSpecies
sub_020758B0
->PokemonPersonalData_GetValue
sub_020759B8
->PokemonPersonalData_Free
sub_020759CC
->PokemonPersonalData_GetFormValue
sub_020759F0
->PokemonPersonalData_GetSpeciesValue
sub_02075A10
->Pokemon_GetPercentToNextLevel
sub_02075A70
->Pokemon_GetExpToNextLevel
sub_02075A78
-> moved (static)sub_02075AAC
->Pokemon_GetCurrentLevelBaseExp
sub_02075AD0
->Pokemon_GetSpeciesBaseExpAt
sub_02075B38
->Pokemon_GetLevel
sub_02075B40
->BoxPokemon_GetLevel
sub_02075B78
->Pokemon_GetSpeciesLevelAt
sub_02075B9C
->PokemonPersonalData_GetLevelAt
sub_02075BCC
->Pokemon_GetNature
sub_02075BD4
->BoxPokemon_GetNature
GetNatureFromPersonality
->Pokemon_GetNatureOf
sub_02075C60
->Pokemon_GetStatAffinityOf
sub_02075C74
->sub_02075D6C
->Pokemon_GetGender
sub_02075D74
->BoxPokemon_GetGender
sub_02075DAC
->Pokemon_GetGenderOf
sub_02075DD0
->PokemonPersonalData_GetGenderOf
sub_02075E0C
->Pokemon_IsShiny
sub_02075E14
-> moved (static)sub_02075E38
->Pokemon_IsPersonalityShiny
sub_02075E64
->sub_02075EF4
->sub_02075F00
->sub_02075F0C
->sub_02075FB4
->SanitizeFormId
->Pokemon_SanitizeFormId
sub_020765AC
->sub_020765B8
->sub_020765C4
->sub_02076648
->sub_0207697C
->sub_02076994
->sub_02076AAC
->sub_02076AF0
->Pokemon_GetStructSize
sub_02076AF4
->BoxPokemon_GetStructSize
sub_02076AF8
->Pokemon_GetForm
sub_02076B00
->BoxPokemon_GetForm
sub_02076B10
->Pokemon_GetBoxPokemon
sub_02076B14
->sub_02076B94
->sub_02076F84
->sub_02076FD4
->sub_02077020
-> moved (static)sub_020770C4
->Pokemon_AddMove
sub_020770D4
-> moved (static)sub_02077134
->Pokemon_ReplaceMove
sub_02077144
-> moved (static)sub_020771F8
->Pokemon_ResetMoveSlot
sub_02077230
->Pokemon_SetMoveSlot
sub_02077238
-> moved (static)sub_0207727C
->sub_02077344
->Pokemon_SwapMoveSlots
sub_0207734C
->BoxPokemon_SwapMoveSlots
sub_02077408
->Pokemon_ClearMoveSlot
sub_0207749C
-> moved (static)sub_020774C8
->Pokemon_FromBoxPokemon
sub_02077550
->Party_GetMaxLevel
sub_020775A4
->sub_020775C4
->sub_020775EC
->Pokemon_Copy
sub_02077604
->BoxPokemon_Copy
sub_02077618
->BoxPokemon_FromPokemon
sub_0207762C
->Pokemon_GetFlavorAffinity
sub_02077634
-> moved (static)sub_02077648
->Pokemon_GetFlavorAffinityOf
sub_02077660
->Pokemon_LoadLevelUpMoveIdsOf
sub_020776B0
->sub_02077758
->sub_020777B4
->sub_0207782C
->sub_020778D8
->sub_020778E0
-> moved (static)sub_020778F8
->sub_02077900
-> moved (static)sub_02077928
->Pokemon_SetArceusForm
sub_02077930
->BoxPokemon_SetArceusForm
sub_02077988
->Pokemon_GetArceusTypeOf
sub_02077A00
->Pokemon_SetGiratinaForm
sub_02077A1C
->BoxPokemon_SetGiratinaForm
sub_02077A64
->Pokemon_SetGiratinaOriginForm
sub_02077A9C
->Party_SetGiratinaForm
SetShayminForm
->Pokemon_SetShayminForm
SetBoxShayminForm
->BoxPokemon_SetShayminForm
sub_02077B14
->Pokemon_CanShayminSkyForm
sub_02077B8C
->Party_SetShayminLandForm
sub_02077BD8
->Party_SetShayminForm
SetRotomForm
->Pokemon_SetRotomForm
sub_02077D28
->Pokemon_LoadLevelUpMovesOf
sub_02077D3C
->sub_02077DB4
->sub_02077E3C
->sub_02077E64
->sub_02077EA4
-> moved (static)sub_02077EE4
->sub_02077EF8
-> moved (static)sub_02077F0C
->sub_02077FB4
->Pokemon_CanLearnTM
sub_02077FBC
-> moved (static)sub_02077FE4
->Pokemon_CanFormLearnTM
sub_0207803C
->Pokemon_CalcAbility
sub_02078044
-> moved (static)sub_020780C4
->sub_020787CC
->Pokemon_GetFlagMaskOf
sub_020787EC
->Pokemon_GetLowestFlagIndex
sub_02078804
->sub_02078824
->sub_02078838
->sub_0207884C
->sub_020788D0
->sub_0207893C
->sub_0207896C
->sub_020789BC
->sub_020789F4
->sub_02078A4C
->sub_02078A80
->sub_02078AA4
->sub_02078AC8
->sub_02078AEC
->sub_02078B40
->sub_02078E0C
->sub_02073E18
->sub_020744E8
->Pokemon_GetDataInternal
sub_020745D0
->BoxPokemon_GetDataInternal
sub_02074BC0
->Pokemon_SetDataInternal
sub_02074CD8
->BoxPokemon_SetDataInternal
sub_020753F4
->Pokemon_IncreaseDataInternal
sub_02075454
->BoxPokemon_IncreaseDataInternal
sub_02075A78
->BoxPokemon_GetExpToNextLevel
sub_02075AE4
->Pokemon_LoadExperienceTableOf
sub_02075B00
->Pokemon_GetExpRateBaseExpAt
sub_02075C0C
->Pokemon_GetNatureStatValue
sub_02075E14
->BoxPokemon_IsShiny
inline Pokemon_InlineIsPersonalityShiny
sub_02076300
->sub_020767BC
->sub_02077020
->BoxPokemon_SetDefaultMoves
sub_020770D4
->BoxPokemon_AddMove
sub_02077144
->BoxPokemon_ReplaceMove
sub_02077238
->BoxPokemon_SetMoveSlot
sub_0207749C
->Pokemon_HasMove
sub_02077634
->BoxPokemon_GetFlavorAffinity
sub_020778E0
->sub_02077900
->sub_02077EA4
->sub_02077EF8
->sub_02077FBC
->BoxPokemon_CanLearnTM
sub_02078044
->BoxPokemon_CalcAbility
sub_020781F8
->PokemonPersonalData_LoadSpecies
sub_02078208
->PokemonPersonalData_LoadForm
sub_0207821C
->PokemonEvolutionData_LoadSpecies
sub_0207822C
->Pokemon_EncryptData
sub_02078234
->Pokemon_DecryptData
sub_0207823C
->Pokemon_GetDataChecksum
sub_0207825C
->BoxPokemon_GetDataBlock
sub_02078740
->Pokemon_GetFormNarcIndex
inline_020789BC
->inline Pokemon_GetLowestBitInverse