From a85ca78e68db190d139f61c959a4aea8803aa76b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 11 Jun 2020 16:02:17 -0400 Subject: More pokemon.s method names; annotate species imms in FUN_02068C00 --- include/pokemon.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 68cc0d59..71c1fb67 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -99,7 +99,7 @@ #define MON_DATA_SPEED 166 #define MON_DATA_SPATK 167 #define MON_DATA_SPDEF 168 -#define MON_DATA_SEAL_TYPES_MAYBE 169 +#define MON_DATA_SEAL_STRUCT 169 #define MON_DATA_SEAL_COORDS 170 #define MON_DATA_SPECIES_EXISTS 171 #define MON_DATA_SANITY_CHECK_172 172 @@ -381,9 +381,28 @@ struct Pokemon { int GetMonBaseStat_HandleFormeConversion(int species, int form, int stat_id); int GetMonBaseStat(int species, int stat_id); -int GetMonExpByLevel(int species, int level); +int GetMonExpBySpeciesAndLevel(int species, int level); void LoadGrowthTable(int species, int * table); int GetExpByGrowthRateAndLevel(int rate, int level); int CalcLevelBySpeciesAndExp(int species, int experience); +void CreateMon(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId, ...); +void CreateBoxMon(struct BoxPokemon * boxPokemon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId, ...); +void CreateMonWithNatureGenderLetter(struct Pokemon * pokemon, u16 species, u8 level, u8 nature, u8 gender, u8 letter); + +#ifndef IN_POKEMON_C +u32 GetMonData(); +u32 GetMonDataEncrypted(); +u32 GetBoxMonData(); +u32 GetBoxMonDataEncrypted(); +#else +u32 GetMonData(struct Pokemon * pokemon, u32 attr, void * ptr); +u32 GetMonDataEncrypted(struct Pokemon * pokemon, u32 attr, void * ptr); +u32 GetBoxMonData(struct BoxPokemon * pokemon, u32 attr, void * ptr); +u32 GetBoxMonDataEncrypted(struct BoxPokemon * pokemon, u32 attr, void * ptr); +#endif +void SetMonData(struct Pokemon * pokemon, u32 attr, void * ptr); +void SetBoxMonData(struct BoxPokemon * pokemon, u32 attr, void * ptr); +void AddMonData(struct Pokemon * pokemon, u32 attr, u32 amount); +void AddBoxMonData(struct Pokemon * pokemon, u32 attr, u32 amount); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From 1dd706599353a285534398ccdc34a9ef8bc6e549 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 12 Jun 2020 09:00:45 -0400 Subject: pokemon.c through TryDecryptMon --- include/global.h | 2 + include/pokemon.h | 128 +++++++++++++++++++++++++++++------------------------- 2 files changed, 70 insertions(+), 60 deletions(-) (limited to 'include') diff --git a/include/global.h b/include/global.h index 2f31fa3d..bffce9f0 100644 --- a/include/global.h +++ b/include/global.h @@ -27,4 +27,6 @@ enum GameLanguage { extern void ErrorHandling(void); +#define GF_ASSERT(expr) do {if (!(expr)) ErrorHandling();} while (0) + #endif //GUARD_GLOBAL_H diff --git a/include/pokemon.h b/include/pokemon.h index 71c1fb67..410e4bc5 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -103,13 +103,17 @@ #define MON_DATA_SEAL_COORDS 170 #define MON_DATA_SPECIES_EXISTS 171 #define MON_DATA_SANITY_CHECK_172 172 -#define MON_DATA_SANITY_CHECK_173 173 +#define MON_DATA_SPECIES2 173 #define MON_DATA_IVS_WORD 174 #define MON_DATA_IS_FEMALE 175 #define MON_DATA_TYPE_1 176 #define MON_DATA_TYPE_2 177 #define MON_DATA_SPECIES_NAME 178 +#define MON_MALE 0 +#define MON_FEMALE 254 +#define MON_GENDER_UNKNOWN 255 + // TODO: Identify the rest of these enum BaseStat { BASE_HP = 0, @@ -202,69 +206,69 @@ typedef enum GameLanguage OriginLanguage; typedef enum { ARCEUS_NORMAL = 0, - ARCEUS_FIST = 8, - ARCEUS_SKY = 16, - ARCEUS_TOXIC = 24, - ARCEUS_EARTH = 32, - ARCEUS_STONE = 40, - ARCEUS_INSECT = 48, - ARCEUS_SPOOKY = 56, - ARCEUS_IRON = 64, - ARCEUS_FLAME = 72, - ARCEUS_SPLASH = 80, - ARCEUS_MEADOW = 88, - ARCEUS_ZAP = 96, - ARCEUS_MIND = 104, - ARCEUS_ICICLE = 112, - ARCEUS_DRACO = 120, - ARCEUS_DREAD = 128, + ARCEUS_FIST = 1, + ARCEUS_SKY = 2, + ARCEUS_TOXIC = 3, + ARCEUS_EARTH = 4, + ARCEUS_STONE = 5, + ARCEUS_INSECT = 6, + ARCEUS_SPOOKY = 7, + ARCEUS_IRON = 8, + ARCEUS_FLAME = 9, + ARCEUS_SPLASH = 10, + ARCEUS_MEADOW = 11, + ARCEUS_ZAP = 12, + ARCEUS_MIND = 13, + ARCEUS_ICICLE = 14, + ARCEUS_DRACO = 15, + ARCEUS_DREAD = 16, BURMY_PLANT = 0, - BURMY_SANDY = 8, - BURMY_TRASH = 16, + BURMY_SANDY = 1, + BURMY_TRASH = 2, DEOXYS_NORMAL = 0, - DEOXYS_ATTACK = 8, - DEOXYS_DEFENSE = 16, - DEOXYS_SPEED = 24, + DEOXYS_ATTACK = 1, + DEOXYS_DEFENSE = 2, + DEOXYS_SPEED = 3, GIRATINA_ALTERED = 0, - GIRATINA_ORIGIN = 8, + GIRATINA_ORIGIN = 1, ROTOM_NORMAL = 0, - ROTOM_HEAT = 8, - ROTOM_WASH = 16, - ROTOM_FROST = 24, - ROTOM_FAN = 32, - ROTOM_MOW = 40, + ROTOM_HEAT = 1, + ROTOM_WASH = 2, + ROTOM_FROST = 3, + ROTOM_FAN = 4, + ROTOM_MOW = 5, SHAYMIN_LAND = 0, - SHAYMIN_SKY = 8, + SHAYMIN_SKY = 1, SHELLOS_WEST = 0, - SHELLOS_EAST = 8, + SHELLOS_EAST = 1, UNOWN_A = 0, - UNOWN_B = 8, - UNOWN_C = 16, - UNOWN_D = 24, - UNOWN_E = 32, - UNOWN_F = 40, - UNOWN_G = 48, - UNOWN_H = 56, - UNOWN_I = 64, - UNOWN_J = 72, - UNOWN_K = 80, - UNOWN_L = 88, - UNOWN_M = 96, - UNOWN_N = 104, - UNOWN_O = 112, - UNOWN_P = 120, - UNOWN_Q = 128, - UNOWN_R = 136, - UNOWN_S = 144, - UNOWN_T = 152, - UNOWN_U = 160, - UNOWN_V = 168, - UNOWN_W = 176, - UNOWN_X = 184, - UNOWN_Y = 192, - UNOWN_Z = 200, - UNOWN_EXCLAMATION_MARK = 208, - UNOWN_QUESTION_MARK = 216 + UNOWN_B = 1, + UNOWN_C = 2, + UNOWN_D = 3, + UNOWN_E = 4, + UNOWN_F = 5, + UNOWN_G = 6, + UNOWN_H = 7, + UNOWN_I = 8, + UNOWN_J = 9, + UNOWN_K = 10, + UNOWN_L = 11, + UNOWN_M = 12, + UNOWN_N = 13, + UNOWN_O = 14, + UNOWN_P = 15, + UNOWN_Q = 16, + UNOWN_R = 17, + UNOWN_S = 18, + UNOWN_T = 19, + UNOWN_U = 20, + UNOWN_V = 21, + UNOWN_W = 22, + UNOWN_X = 23, + UNOWN_Y = 24, + UNOWN_Z = 25, + UNOWN_EXCLAMATION_MARK = 26, + UNOWN_QUESTION_MARK = 27 } AlternateForms; // Structs @@ -341,18 +345,17 @@ typedef union { } PokemonDataBlock; struct BoxPokemon { - /* 0x000 */ u32 personalityValue; + /* 0x000 */ u32 pid; /* 0x004 */ u16 no_encrypt:1; u16 control_4_1:1; u16 control_4_2:1; u16 Unused:13; // Might be used for validity checks /* 0x006 */ u16 checksum; // Stored checksum of pokemon - /* 0x008 */ PokemonDataBlock box[4]; + /* 0x008 */ PokemonDataBlock substructs[4]; }; struct PartyPokemon { - /* 0x000 */ struct BoxPokemon box; /* 0x088 */ u8 slp:3; u8 psn:1; u8 brn:1; @@ -379,6 +382,11 @@ struct Pokemon { /* 0x088 */ struct PartyPokemon party; }; // size: 0xEC +void ZeroMonData(struct Pokemon * pokemon); +void ZeroBoxMonData(struct BoxPokemon * boxmon); +u32 SizeOfStructPokemon(void); +struct Pokemon * AllocMonZeroed(u32 heap_id); +BOOL TryDecryptMon(struct Pokemon * mon); int GetMonBaseStat_HandleFormeConversion(int species, int form, int stat_id); int GetMonBaseStat(int species, int stat_id); int GetMonExpBySpeciesAndLevel(int species, int level); -- cgit v1.2.3 From 5dcce3a7303e45667967689361513cb2920be3f4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 12 Jun 2020 12:50:21 -0400 Subject: through GenPersonalityByGenderAndNature --- include/global.h | 3 +++ include/math_util.h | 6 ++++++ include/pokemon.h | 49 ++++++++++++++++++++++++++++++++++--------------- include/seals.h | 12 ++++++++++++ 4 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 include/math_util.h create mode 100644 include/seals.h (limited to 'include') diff --git a/include/global.h b/include/global.h index bffce9f0..35d0c3aa 100644 --- a/include/global.h +++ b/include/global.h @@ -29,4 +29,7 @@ extern void ErrorHandling(void); #define GF_ASSERT(expr) do {if (!(expr)) ErrorHandling();} while (0) +extern const enum GameLanguage gGameLanguage; +extern const enum GameVersion gGameVersion; + #endif //GUARD_GLOBAL_H diff --git a/include/math_util.h b/include/math_util.h new file mode 100644 index 00000000..f7169956 --- /dev/null +++ b/include/math_util.h @@ -0,0 +1,6 @@ +#ifndef POKEDIAMOND_MATH_UTIL_H +#define POKEDIAMOND_MATH_UTIL_H + +u16 rand_LC(void); + +#endif //POKEDIAMOND_MATH_UTIL_H diff --git a/include/pokemon.h b/include/pokemon.h index 410e4bc5..d5ab1fd9 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -6,6 +6,7 @@ // Enums #include "constants/species.h" +#include "seals.h" #define MON_DATA_PERSONALITY 0 #define MON_DATA_IS_ENCRYPTED 1 @@ -110,9 +111,16 @@ #define MON_DATA_TYPE_2 177 #define MON_DATA_SPECIES_NAME 178 -#define MON_MALE 0 -#define MON_FEMALE 254 -#define MON_GENDER_UNKNOWN 255 +#define MON_RATIO_MALE 0 +#define MON_RATIO_FEMALE 254 +#define MON_RATIO_UNKNOWN 255 + +enum MonGender +{ + MON_MALE = 0, + MON_FEMALE = 1, + MON_GENDERLESS = 2 +}; // TODO: Identify the rest of these enum BaseStat { @@ -136,7 +144,7 @@ enum BaseStat { BASE_ITEM_2, BASE_GENDER_RATIO, BASE_EGG_CYCLES, - BASE_FIRENDSHIP, + BASE_FRIENDSHIP, BASE_GROWTH_RATE, BASE_EGG_GROUP_1, GASE_EGG_GROUP_2, @@ -346,8 +354,8 @@ typedef union { struct BoxPokemon { /* 0x000 */ u32 pid; - /* 0x004 */ u16 no_encrypt:1; - u16 control_4_1:1; + /* 0x004 */ u16 party_lock:1; + u16 box_lock:1; u16 control_4_2:1; u16 Unused:13; // Might be used for validity checks /* 0x006 */ u16 checksum; // Stored checksum of pokemon @@ -373,7 +381,7 @@ struct PartyPokemon /* 0x096 */ u16 speed; /* 0x098 */ u16 spatk; /* 0x09A */ u16 spdef; - /* 0x09C */ u8 seal_something[0x38]; // a struct? + /* 0x09C */ struct SealStruct seal_something; // a struct? /* 0x0D4 */ u8 sealCoords[0x18]; // u8 pairs? }; @@ -387,15 +395,24 @@ void ZeroBoxMonData(struct BoxPokemon * boxmon); u32 SizeOfStructPokemon(void); struct Pokemon * AllocMonZeroed(u32 heap_id); BOOL TryDecryptMon(struct Pokemon * mon); -int GetMonBaseStat_HandleFormeConversion(int species, int form, int stat_id); -int GetMonBaseStat(int species, int stat_id); -int GetMonExpBySpeciesAndLevel(int species, int level); +BOOL TryEncryptMon(struct Pokemon * mon, BOOL decrypt_result); +BOOL TryDecryptBoxMon(struct BoxPokemon * mon); +BOOL TryEncryptBoxMon(struct BoxPokemon * mon, BOOL decrypt_result); +void CreateMon(struct Pokemon * pokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId, ...); +void CreateBoxMon(struct BoxPokemon * boxPokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId, ...); +void CreateMonWithNature(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 nature); +void CreateMonWithGenderNatureLetter(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 gender, u8 nature, u8 letter); +u8 GetNatureFromPersonality(u32 pid); +u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); +u32 GenPersonalityByGenderAndNature(u16 species, u8 gender, u8 nature); +void CalcMonStats(struct Pokemon * pokemon); +u32 GetBoxMonGenderEncrypted(struct BoxPokemon * boxmon); +int GetMonBaseStat_HandleFormeConversion(int species, int form, enum BaseStat stat_id); +u32 GetMonBaseStat(int species, enum BaseStat stat_id); +u32 GetMonExpBySpeciesAndLevel(int species, int level); void LoadGrowthTable(int species, int * table); int GetExpByGrowthRateAndLevel(int rate, int level); int CalcLevelBySpeciesAndExp(int species, int experience); -void CreateMon(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId, ...); -void CreateBoxMon(struct BoxPokemon * boxPokemon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId, ...); -void CreateMonWithNatureGenderLetter(struct Pokemon * pokemon, u16 species, u8 level, u8 nature, u8 gender, u8 letter); #ifndef IN_POKEMON_C u32 GetMonData(); @@ -408,8 +425,10 @@ u32 GetMonDataEncrypted(struct Pokemon * pokemon, u32 attr, void * ptr); u32 GetBoxMonData(struct BoxPokemon * pokemon, u32 attr, void * ptr); u32 GetBoxMonDataEncrypted(struct BoxPokemon * pokemon, u32 attr, void * ptr); #endif -void SetMonData(struct Pokemon * pokemon, u32 attr, void * ptr); -void SetBoxMonData(struct BoxPokemon * pokemon, u32 attr, void * ptr); +void SetMonData(struct Pokemon * pokemon, u32 attr, const void * ptr); +void SetMonDataEncrypted(struct Pokemon * pokemon, u32 attr, const void * ptr); +void SetBoxMonData(struct BoxPokemon * pokemon, u32 attr, const void * ptr); +void SetBoxMonDataEncrypted(struct BoxPokemon * pokemon, u32 attr, const void * ptr); void AddMonData(struct Pokemon * pokemon, u32 attr, u32 amount); void AddBoxMonData(struct Pokemon * pokemon, u32 attr, u32 amount); diff --git a/include/seals.h b/include/seals.h new file mode 100644 index 00000000..89808176 --- /dev/null +++ b/include/seals.h @@ -0,0 +1,12 @@ +#ifndef POKEDIAMOND_SEALS_H +#define POKEDIAMOND_SEALS_H + +struct SealStruct +{ + // TODO: define + u8 filler_00[0x38]; +}; + +struct SealStruct * CreateNewSealsObject(u32 heap_id); + +#endif //POKEDIAMOND_SEALS_H -- cgit v1.2.3 From e15304cdb698c9350e4d4e80ca2a4076b9b44d6c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 12 Jun 2020 14:02:09 -0400 Subject: through CalcMonStats --- include/pokemon.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index d5ab1fd9..3f5660e9 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -398,14 +398,19 @@ BOOL TryDecryptMon(struct Pokemon * mon); BOOL TryEncryptMon(struct Pokemon * mon, BOOL decrypt_result); BOOL TryDecryptBoxMon(struct BoxPokemon * mon); BOOL TryEncryptBoxMon(struct BoxPokemon * mon, BOOL decrypt_result); -void CreateMon(struct Pokemon * pokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId, ...); -void CreateBoxMon(struct BoxPokemon * boxPokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId, ...); +void CreateMon(struct Pokemon * pokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId); +void CreateBoxMon(struct BoxPokemon * boxPokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId); void CreateMonWithNature(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 nature); void CreateMonWithGenderNatureLetter(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 gender, u8 nature, u8 letter); -u8 GetNatureFromPersonality(u32 pid); -u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); u32 GenPersonalityByGenderAndNature(u16 species, u8 gender, u8 nature); +void CreateMonWithFixedIVs(struct Pokemon * pokemon, int species, int level, int ivs, int personality); +void CalcMonLevelAndStats(struct Pokemon * pokemon); void CalcMonStats(struct Pokemon * pokemon); +u32 CalcMonLevelEncrypted(struct Pokemon * pokemon); +u8 GetBoxMonNature(struct BoxPokemon * boxmon); +u8 GetMonNature(struct Pokemon * mon); +u8 GetNatureFromPersonality(u32 pid); +u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); u32 GetBoxMonGenderEncrypted(struct BoxPokemon * boxmon); int GetMonBaseStat_HandleFormeConversion(int species, int form, enum BaseStat stat_id); u32 GetMonBaseStat(int species, enum BaseStat stat_id); @@ -416,17 +421,13 @@ int CalcLevelBySpeciesAndExp(int species, int experience); #ifndef IN_POKEMON_C u32 GetMonData(); -u32 GetMonDataEncrypted(); u32 GetBoxMonData(); -u32 GetBoxMonDataEncrypted(); #else u32 GetMonData(struct Pokemon * pokemon, u32 attr, void * ptr); -u32 GetMonDataEncrypted(struct Pokemon * pokemon, u32 attr, void * ptr); u32 GetBoxMonData(struct BoxPokemon * pokemon, u32 attr, void * ptr); -u32 GetBoxMonDataEncrypted(struct BoxPokemon * pokemon, u32 attr, void * ptr); #endif +void SetMonDataInternal(struct Pokemon * pokemon, u32 attr, const void * ptr); void SetMonData(struct Pokemon * pokemon, u32 attr, const void * ptr); -void SetMonDataEncrypted(struct Pokemon * pokemon, u32 attr, const void * ptr); void SetBoxMonData(struct BoxPokemon * pokemon, u32 attr, const void * ptr); void SetBoxMonDataEncrypted(struct BoxPokemon * pokemon, u32 attr, const void * ptr); void AddMonData(struct Pokemon * pokemon, u32 attr, u32 amount); -- cgit v1.2.3 From 2d8d454dfe8691f4cd1077c50ab6f3c286c28ce1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 12 Jun 2020 14:21:06 -0400 Subject: through GetBoxMonData --- include/pokemon.h | 11 ++--------- include/seals.h | 3 +++ 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 3f5660e9..e2a32e83 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -356,7 +356,7 @@ struct BoxPokemon { /* 0x000 */ u32 pid; /* 0x004 */ u16 party_lock:1; u16 box_lock:1; - u16 control_4_2:1; + u16 checksum_fail:1; u16 Unused:13; // Might be used for validity checks /* 0x006 */ u16 checksum; // Stored checksum of pokemon /* 0x008 */ PokemonDataBlock substructs[4]; @@ -364,14 +364,7 @@ struct BoxPokemon { struct PartyPokemon { - /* 0x088 */ u8 slp:3; - u8 psn:1; - u8 brn:1; - u8 frz:1; - u8 prz:1; - u8 tox:1; - /* 0x089 */ u8 unk89; - /* 0x08A */ u8 filler8A[2]; + /* 0x088 */ u32 status; // slp:3, psn:1, brn:1, frz:1, prz:1, tox:1, ... /* 0x08C */ u8 level; /* 0x08D */ u8 capsule; /* 0x08E */ u16 hp; diff --git a/include/seals.h b/include/seals.h index 89808176..fc0fc449 100644 --- a/include/seals.h +++ b/include/seals.h @@ -9,4 +9,7 @@ struct SealStruct struct SealStruct * CreateNewSealsObject(u32 heap_id); +void CopySealsObject(struct SealStruct *, struct SealStruct *); +void FUN_02029C74(u8 *, u8 *); + #endif //POKEDIAMOND_SEALS_H -- cgit v1.2.3 From 0747fe684c46d010d8917c4257dd1f1a52241385 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 12 Jun 2020 20:54:34 -0400 Subject: GetBoxMonDataInternal --- include/constants/abilities.h | 129 ++++++++++++++++++++++++++++++++++++++++++ include/move_data.h | 6 ++ include/pokemon.h | 123 +++++++++++++++++++++++++++++++++------- include/proto.h | 13 +++++ include/string_util.h | 3 + include/text.h | 6 ++ 6 files changed, 259 insertions(+), 21 deletions(-) create mode 100644 include/constants/abilities.h create mode 100644 include/move_data.h create mode 100644 include/proto.h create mode 100644 include/text.h (limited to 'include') diff --git a/include/constants/abilities.h b/include/constants/abilities.h new file mode 100644 index 00000000..f107e623 --- /dev/null +++ b/include/constants/abilities.h @@ -0,0 +1,129 @@ +#ifndef POKEDIAMOND_CONSTANTS_ABILITIES_H +#define POKEDIAMOND_CONSTANTS_ABILITIES_H + +#define ABILITY_NONE 0 +#define ABILITY_STENCH 1 +#define ABILITY_DRIZZLE 2 +#define ABILITY_SPEED_BOOST 3 +#define ABILITY_BATTLE_ARMOR 4 +#define ABILITY_STURDY 5 +#define ABILITY_DAMP 6 +#define ABILITY_LIMBER 7 +#define ABILITY_SAND_VEIL 8 +#define ABILITY_STATIC 9 +#define ABILITY_VOLT_ABSORB 10 +#define ABILITY_WATER_ABSORB 11 +#define ABILITY_OBLIVIOUS 12 +#define ABILITY_CLOUD_NINE 13 +#define ABILITY_COMPOUND_EYES 14 +#define ABILITY_INSOMNIA 15 +#define ABILITY_COLOR_CHANGE 16 +#define ABILITY_IMMUNITY 17 +#define ABILITY_FLASH_FIRE 18 +#define ABILITY_SHIELD_DUST 19 +#define ABILITY_OWN_TEMPO 20 +#define ABILITY_SUCTION_CUPS 21 +#define ABILITY_INTIMIDATE 22 +#define ABILITY_SHADOW_TAG 23 +#define ABILITY_ROUGH_SKIN 24 +#define ABILITY_WONDER_GUARD 25 +#define ABILITY_LEVITATE 26 +#define ABILITY_EFFECT_SPORE 27 +#define ABILITY_SYNCHRONIZE 28 +#define ABILITY_CLEAR_BODY 29 +#define ABILITY_NATURAL_CURE 30 +#define ABILITY_LIGHTNING_ROD 31 +#define ABILITY_SERENE_GRACE 32 +#define ABILITY_SWIFT_SWIM 33 +#define ABILITY_CHLOROPHYLL 34 +#define ABILITY_ILLUMINATE 35 +#define ABILITY_TRACE 36 +#define ABILITY_HUGE_POWER 37 +#define ABILITY_POISON_POINT 38 +#define ABILITY_INNER_FOCUS 39 +#define ABILITY_MAGMA_ARMOR 40 +#define ABILITY_WATER_VEIL 41 +#define ABILITY_MAGNET_PULL 42 +#define ABILITY_SOUNDPROOF 43 +#define ABILITY_RAIN_DISH 44 +#define ABILITY_SAND_STREAM 45 +#define ABILITY_PRESSURE 46 +#define ABILITY_THICK_FAT 47 +#define ABILITY_EARLY_BIRD 48 +#define ABILITY_FLAME_BODY 49 +#define ABILITY_RUN_AWAY 50 +#define ABILITY_KEEN_EYE 51 +#define ABILITY_HYPER_CUTTER 52 +#define ABILITY_PICKUP 53 +#define ABILITY_TRUANT 54 +#define ABILITY_HUSTLE 55 +#define ABILITY_CUTE_CHARM 56 +#define ABILITY_PLUS 57 +#define ABILITY_MINUS 58 +#define ABILITY_FORECAST 59 +#define ABILITY_STICKY_HOLD 60 +#define ABILITY_SHED_SKIN 61 +#define ABILITY_GUTS 62 +#define ABILITY_MARVEL_SCALE 63 +#define ABILITY_LIQUID_OOZE 64 +#define ABILITY_OVERGROW 65 +#define ABILITY_BLAZE 66 +#define ABILITY_TORRENT 67 +#define ABILITY_SWARM 68 +#define ABILITY_ROCK_HEAD 69 +#define ABILITY_DROUGHT 70 +#define ABILITY_ARENA_TRAP 71 +#define ABILITY_VITAL_SPIRIT 72 +#define ABILITY_WHITE_SMOKE 73 +#define ABILITY_PURE_POWER 74 +#define ABILITY_SHELL_ARMOR 75 +#define ABILITY_AIR_LOCK 76 +#define ABILITY_TANGLED_FEET 77 +#define ABILITY_MOTOR_DRIVE 78 +#define ABILITY_RIVALRY 79 +#define ABILITY_STEADFAST 80 +#define ABILITY_SNOW_CLOAK 81 +#define ABILITY_GLUTTONY 82 +#define ABILITY_ANGER_POINT 83 +#define ABILITY_UNBURDEN 84 +#define ABILITY_HEATPROOF 85 +#define ABILITY_SIMPLE 86 +#define ABILITY_DRY_SKIN 87 +#define ABILITY_DOWNLOAD 88 +#define ABILITY_IRON_FIST 89 +#define ABILITY_POISON_HEAL 90 +#define ABILITY_ADAPTABILITY 91 +#define ABILITY_SKILL_LINK 92 +#define ABILITY_HYDRATION 93 +#define ABILITY_SOLAR_POWER 94 +#define ABILITY_QUICK_FEET 95 +#define ABILITY_NORMALIZE 96 +#define ABILITY_SNIPER 97 +#define ABILITY_MAGIC_GUARD 98 +#define ABILITY_NO_GUARD 99 +#define ABILITY_STALL 100 +#define ABILITY_TECHNICIAN 101 +#define ABILITY_LEAF_GUARD 102 +#define ABILITY_KLUTZ 103 +#define ABILITY_MOLD_BREAKER 104 +#define ABILITY_SUPER_LUCK 105 +#define ABILITY_AFTERMATH 106 +#define ABILITY_ANTICIPATION 107 +#define ABILITY_FOREWARN 108 +#define ABILITY_UNAWARE 109 +#define ABILITY_TINTED_LENS 110 +#define ABILITY_FILTER 111 +#define ABILITY_SLOW_START 112 +#define ABILITY_SCRAPPY 113 +#define ABILITY_STORM_DRAIN 114 +#define ABILITY_ICE_BODY 115 +#define ABILITY_SOLID_ROCK 116 +#define ABILITY_SNOW_WARNING 117 +#define ABILITY_HONEY_GATHER 118 +#define ABILITY_FRISK 119 +#define ABILITY_RECKLESS 120 +#define ABILITY_MULTITYPE 121 +#define ABILITY_FLOWER_GIFT 122 +#define ABILITY_BAD_DREAMS 123 + +#endif //POKEDIAMOND_CONSTANTS_ABILITIES_H diff --git a/include/move_data.h b/include/move_data.h new file mode 100644 index 00000000..d4e3c128 --- /dev/null +++ b/include/move_data.h @@ -0,0 +1,6 @@ +#ifndef POKEDIAMOND_MOVE_DATA_H +#define POKEDIAMOND_MOVE_DATA_H + +u32 FUN_0206AB30(u16 move, u8 ppUp); + +#endif //POKEDIAMOND_MOVE_DATA_H diff --git a/include/pokemon.h b/include/pokemon.h index e2a32e83..7cc5ef5d 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -9,9 +9,9 @@ #include "seals.h" #define MON_DATA_PERSONALITY 0 -#define MON_DATA_IS_ENCRYPTED 1 -#define MON_DATA_CONTROL_4_1 2 -#define MON_DATA_CONTROL_4_2 3 +#define MON_DATA_PARTY_LOCK 1 +#define MON_DATA_BOX_LOCK 2 +#define MON_DATA_CHECKSUM_FAILED 3 #define MON_DATA_CHECKSUM 4 #define MON_DATA_SPECIES 5 #define MON_DATA_HELD_ITEM 6 @@ -34,7 +34,34 @@ #define MON_DATA_TOUGH 23 #define MON_DATA_SHEEN 24 #define MON_DATA_SINNOH_CHAMP_RIBBON 25 -// TODO: ribbon flags through 53 +#define MON_DATA_SINNOH_RIBBON_26 26 +#define MON_DATA_SINNOH_RIBBON_27 27 +#define MON_DATA_SINNOH_RIBBON_28 28 +#define MON_DATA_SINNOH_RIBBON_29 29 +#define MON_DATA_SINNOH_RIBBON_30 30 +#define MON_DATA_SINNOH_RIBBON_31 31 +#define MON_DATA_SINNOH_RIBBON_32 32 +#define MON_DATA_SINNOH_RIBBON_33 33 +#define MON_DATA_SINNOH_RIBBON_34 34 +#define MON_DATA_SINNOH_RIBBON_35 35 +#define MON_DATA_SINNOH_RIBBON_36 36 +#define MON_DATA_SINNOH_RIBBON_37 37 +#define MON_DATA_SINNOH_RIBBON_38 38 +#define MON_DATA_SINNOH_RIBBON_39 39 +#define MON_DATA_SINNOH_RIBBON_40 40 +#define MON_DATA_SINNOH_RIBBON_41 41 +#define MON_DATA_SINNOH_RIBBON_42 42 +#define MON_DATA_SINNOH_RIBBON_43 43 +#define MON_DATA_SINNOH_RIBBON_44 44 +#define MON_DATA_SINNOH_RIBBON_45 45 +#define MON_DATA_SINNOH_RIBBON_46 46 +#define MON_DATA_SINNOH_RIBBON_47 47 +#define MON_DATA_SINNOH_RIBBON_48 48 +#define MON_DATA_SINNOH_RIBBON_49 49 +#define MON_DATA_SINNOH_RIBBON_50 50 +#define MON_DATA_SINNOH_RIBBON_51 51 +#define MON_DATA_SINNOH_RIBBON_52 52 +#define MON_DATA_SINNOH_RIBBON_53 53 #define MON_DATA_MOVE1 54 #define MON_DATA_MOVE2 55 #define MON_DATA_MOVE3 56 @@ -60,7 +87,37 @@ #define MON_DATA_IS_EGG 76 #define MON_DATA_HAS_NICKNAME 77 #define MON_DATA_COOL_RIBBON 78 -// TODO: ribbon flags through 109 +#define MON_DATA_HOENN_RIBBON_79 79 +#define MON_DATA_HOENN_RIBBON_80 80 +#define MON_DATA_HOENN_RIBBON_81 81 +#define MON_DATA_HOENN_RIBBON_82 82 +#define MON_DATA_HOENN_RIBBON_83 83 +#define MON_DATA_HOENN_RIBBON_84 84 +#define MON_DATA_HOENN_RIBBON_85 85 +#define MON_DATA_HOENN_RIBBON_86 86 +#define MON_DATA_HOENN_RIBBON_87 87 +#define MON_DATA_HOENN_RIBBON_88 88 +#define MON_DATA_HOENN_RIBBON_89 89 +#define MON_DATA_HOENN_RIBBON_90 90 +#define MON_DATA_HOENN_RIBBON_91 91 +#define MON_DATA_HOENN_RIBBON_92 92 +#define MON_DATA_HOENN_RIBBON_93 93 +#define MON_DATA_HOENN_RIBBON_94 94 +#define MON_DATA_HOENN_RIBBON_95 95 +#define MON_DATA_HOENN_RIBBON_96 96 +#define MON_DATA_HOENN_RIBBON_97 97 +#define MON_DATA_HOENN_RIBBON_98 98 +#define MON_DATA_HOENN_RIBBON_99 99 +#define MON_DATA_HOENN_RIBBON_100 100 +#define MON_DATA_HOENN_RIBBON_101 101 +#define MON_DATA_HOENN_RIBBON_102 102 +#define MON_DATA_HOENN_RIBBON_103 103 +#define MON_DATA_HOENN_RIBBON_104 104 +#define MON_DATA_HOENN_RIBBON_105 105 +#define MON_DATA_HOENN_RIBBON_106 106 +#define MON_DATA_HOENN_RIBBON_107 107 +#define MON_DATA_HOENN_RIBBON_108 108 +#define MON_DATA_HOENN_RIBBON_109 109 #define MON_DATA_FATEFUL_ENCOUNTER 110 #define MON_DATA_GENDER 111 #define MON_DATA_FORME 112 @@ -73,7 +130,27 @@ #define MON_DATA_NICKNAME_3 119 // ??? #define MON_DATA_UNK_120 120 #define MON_DATA_GAME_VERSION 121 -// TODO: ribbon flags 122-142 +#define MON_DATA_SINNOH_RIBBON_122 122 +#define MON_DATA_SINNOH_RIBBON_123 123 +#define MON_DATA_SINNOH_RIBBON_124 124 +#define MON_DATA_SINNOH_RIBBON_125 125 +#define MON_DATA_SINNOH_RIBBON_126 126 +#define MON_DATA_SINNOH_RIBBON_127 127 +#define MON_DATA_SINNOH_RIBBON_128 128 +#define MON_DATA_SINNOH_RIBBON_129 129 +#define MON_DATA_SINNOH_RIBBON_130 130 +#define MON_DATA_SINNOH_RIBBON_131 131 +#define MON_DATA_SINNOH_RIBBON_132 132 +#define MON_DATA_SINNOH_RIBBON_133 133 +#define MON_DATA_SINNOH_RIBBON_134 134 +#define MON_DATA_SINNOH_RIBBON_135 135 +#define MON_DATA_SINNOH_RIBBON_136 136 +#define MON_DATA_SINNOH_RIBBON_137 137 +#define MON_DATA_SINNOH_RIBBON_138 138 +#define MON_DATA_SINNOH_RIBBON_139 139 +#define MON_DATA_SINNOH_RIBBON_140 140 +#define MON_DATA_SINNOH_RIBBON_141 141 +#define MON_DATA_SINNOH_RIBBON_142 142 #define MON_DATA_OT_NAME 143 #define MON_DATA_OT_NAME_2 144 // ??? #define MON_DATA_EGG_MET_YEAR 145 @@ -103,10 +180,10 @@ #define MON_DATA_SEAL_STRUCT 169 #define MON_DATA_SEAL_COORDS 170 #define MON_DATA_SPECIES_EXISTS 171 -#define MON_DATA_SANITY_CHECK_172 172 +#define MON_DATA_SANITY_IS_EGG 172 #define MON_DATA_SPECIES2 173 #define MON_DATA_IVS_WORD 174 -#define MON_DATA_IS_FEMALE 175 +#define MON_DATA_UNK_175 175 #define MON_DATA_TYPE_1 176 #define MON_DATA_TYPE_2 177 #define MON_DATA_SPECIES_NAME 178 @@ -115,6 +192,9 @@ #define MON_RATIO_FEMALE 254 #define MON_RATIO_UNKNOWN 255 +#define POKEMON_NAME_LENGTH 10 +#define OT_NAME_LENGTH 7 + enum MonGender { MON_MALE = 0, @@ -317,7 +397,7 @@ typedef struct { /* 0x10 */ u32 hpIV:5, atkIV:5, defIV:5, spdIV:5, spatkIV:5, spdefIV:5, isEgg:1, isNicknamed:1; // TODO: Finish HoennRibbonSet /* 0x14 */ u32 ribbonFlags; // cool, ... - /* 0x18 */ u8 fatefulEncounter:1, female:1, genderless:1, alternateForm:5; + /* 0x18 */ u8 fatefulEncounter:1, gender:2, alternateForm:5; /* 0x19 */ u8 HGSS_shinyLeaves; // TODO: Turn into bitfield /* 0x1A */ u16 Unused; /* 0x1C */ u16 Platinum_EggLocation; @@ -326,10 +406,10 @@ typedef struct { typedef struct { /* 0x00 */ u16 nickname[11]; - /* 0x1A */ u8 Unused; - /* 0x1B */ u8 originGame; + /* 0x16 */ u8 Unused; + /* 0x17 */ u8 originGame; // TODO: Finish SinnohRibbonSet2 - /* 0x1C */ u32 sinnohRibbons2; // cool, ... + /* 0x18 */ u64 sinnohRibbons2; // cool, ... } PokemonDataBlockC; typedef struct { @@ -340,7 +420,8 @@ typedef struct { /* 0x18 */ u16 DP_MetLocation; /* 0x1A */ u8 pokerus; /* 0x1B */ u8 pokeball; - /* 0x1C */ u8 flags; + /* 0x1C */ u8 metLevel:7; + u8 metGender:1; /* 0x1D */ u8 encounterType; /* 0x1E */ u16 HGSS_Pokeball; } PokemonDataBlockD; @@ -416,14 +497,14 @@ int CalcLevelBySpeciesAndExp(int species, int experience); u32 GetMonData(); u32 GetBoxMonData(); #else -u32 GetMonData(struct Pokemon * pokemon, u32 attr, void * ptr); -u32 GetBoxMonData(struct BoxPokemon * pokemon, u32 attr, void * ptr); +u32 GetMonData(struct Pokemon * pokemon, int attr, void * ptr); +u32 GetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); #endif -void SetMonDataInternal(struct Pokemon * pokemon, u32 attr, const void * ptr); -void SetMonData(struct Pokemon * pokemon, u32 attr, const void * ptr); -void SetBoxMonData(struct BoxPokemon * pokemon, u32 attr, const void * ptr); -void SetBoxMonDataEncrypted(struct BoxPokemon * pokemon, u32 attr, const void * ptr); -void AddMonData(struct Pokemon * pokemon, u32 attr, u32 amount); -void AddBoxMonData(struct Pokemon * pokemon, u32 attr, u32 amount); +void SetMonDataInternal(struct Pokemon * pokemon, int attr, const void * ptr); +void SetMonData(struct Pokemon * pokemon, int attr, const void * ptr); +void SetBoxMonData(struct BoxPokemon * pokemon, int attr, const void * ptr); +void SetBoxMonDataEncrypted(struct BoxPokemon * pokemon, int attr, const void * ptr); +void AddMonData(struct Pokemon * pokemon, int attr, u32 amount); +void AddBoxMonData(struct Pokemon * pokemon, int attr, u32 amount); #endif //POKEDIAMOND_POKEMON_H diff --git a/include/proto.h b/include/proto.h new file mode 100644 index 00000000..37655429 --- /dev/null +++ b/include/proto.h @@ -0,0 +1,13 @@ +#ifndef POKEDIAMOND_PROTO_H +#define POKEDIAMOND_PROTO_H + +// For homeless function declarations + +u16 * FUN_0200AA50(u16 species, u32 heap_id); +void FUN_02021A74(u16 * dest, u16 * src); +void FUN_02021A20(void * ptr); +void FUN_02021E28(u16 * dest, u16 * src); +u32 FUN_0206E7B8(u16 item, u32 a1, u32 a2); +u32 GetArceusTypeByPlate(u16 plate); + +#endif //POKEDIAMOND_PROTO_H diff --git a/include/string_util.h b/include/string_util.h index 53d4e5f4..e9079229 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -7,6 +7,9 @@ #include "global.h" +#define EOS 0xFFFF +#define NON_DIGIT 0xE2 + enum PrintingMode { NORMAL, PAD_SPACE, diff --git a/include/text.h b/include/text.h new file mode 100644 index 00000000..cec36a30 --- /dev/null +++ b/include/text.h @@ -0,0 +1,6 @@ +#ifndef POKEDIAMOND_TEXT_H +#define POKEDIAMOND_TEXT_H + +void GetSpeciesName(u16 species, u32 heap_id, u16 * dest); + +#endif //POKEDIAMOND_TEXT_H -- cgit v1.2.3 From e81dfc98e26bece01763110254648d7c20cb198d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 11:26:10 -0400 Subject: through SetBoxMonDataInternal --- include/pokemon.h | 14 +++++++------- include/proto.h | 1 + include/seals.h | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 7cc5ef5d..451c7d1b 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -125,9 +125,9 @@ #define MON_DATA_RESERVED_114 114 // Plat #define MON_DATA_UNUSED_115 115 #define MON_DATA_NICKNAME 116 -#define MON_DATA_UNUSED_117 117 -#define MON_DATA_NICKNAME_2 118 // ??? -#define MON_DATA_NICKNAME_3 119 // ??? +#define MON_DATA_NICKNAME_2 117 +#define MON_DATA_NICKNAME_3 118 // ??? +#define MON_DATA_NICKNAME_4 119 // ??? #define MON_DATA_UNK_120 120 #define MON_DATA_GAME_VERSION 121 #define MON_DATA_SINNOH_RIBBON_122 122 @@ -500,10 +500,10 @@ u32 GetBoxMonData(); u32 GetMonData(struct Pokemon * pokemon, int attr, void * ptr); u32 GetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); #endif -void SetMonDataInternal(struct Pokemon * pokemon, int attr, const void * ptr); -void SetMonData(struct Pokemon * pokemon, int attr, const void * ptr); -void SetBoxMonData(struct BoxPokemon * pokemon, int attr, const void * ptr); -void SetBoxMonDataEncrypted(struct BoxPokemon * pokemon, int attr, const void * ptr); +void SetMonDataInternal(struct Pokemon * pokemon, int attr, void * ptr); +void SetMonData(struct Pokemon * pokemon, int attr, void * ptr); +void SetBoxMonDataInternal(struct BoxPokemon * pokemon, int attr, void * ptr); +void SetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); void AddMonData(struct Pokemon * pokemon, int attr, u32 amount); void AddBoxMonData(struct Pokemon * pokemon, int attr, u32 amount); diff --git a/include/proto.h b/include/proto.h index 37655429..c8f50d33 100644 --- a/include/proto.h +++ b/include/proto.h @@ -7,6 +7,7 @@ u16 * FUN_0200AA50(u16 species, u32 heap_id); void FUN_02021A74(u16 * dest, u16 * src); void FUN_02021A20(void * ptr); void FUN_02021E28(u16 * dest, u16 * src); +void FUN_02021EF0(const u16 * src, u16 * dest, u32 count); u32 FUN_0206E7B8(u16 item, u32 a1, u32 a2); u32 GetArceusTypeByPlate(u16 plate); diff --git a/include/seals.h b/include/seals.h index fc0fc449..8fda23b9 100644 --- a/include/seals.h +++ b/include/seals.h @@ -9,7 +9,7 @@ struct SealStruct struct SealStruct * CreateNewSealsObject(u32 heap_id); -void CopySealsObject(struct SealStruct *, struct SealStruct *); -void FUN_02029C74(u8 *, u8 *); +void CopySealsObject(const struct SealStruct *, struct SealStruct *); +void FUN_02029C74(const u8 *, u8 *); #endif //POKEDIAMOND_SEALS_H -- cgit v1.2.3 From 3646495249e8e553fb0335ffd287f979499204ce Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 12:30:58 -0400 Subject: Through AddBoxMonData --- include/move_data.h | 2 +- include/pokemon.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/move_data.h b/include/move_data.h index d4e3c128..975bcf8d 100644 --- a/include/move_data.h +++ b/include/move_data.h @@ -1,6 +1,6 @@ #ifndef POKEDIAMOND_MOVE_DATA_H #define POKEDIAMOND_MOVE_DATA_H -u32 FUN_0206AB30(u16 move, u8 ppUp); +int FUN_0206AB30(u16 move, u8 ppUp); #endif //POKEDIAMOND_MOVE_DATA_H diff --git a/include/pokemon.h b/include/pokemon.h index 451c7d1b..d2166c22 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -504,7 +504,8 @@ void SetMonDataInternal(struct Pokemon * pokemon, int attr, void * ptr); void SetMonData(struct Pokemon * pokemon, int attr, void * ptr); void SetBoxMonDataInternal(struct BoxPokemon * pokemon, int attr, void * ptr); void SetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); -void AddMonData(struct Pokemon * pokemon, int attr, u32 amount); -void AddBoxMonData(struct Pokemon * pokemon, int attr, u32 amount); +void AddMonData(struct Pokemon * pokemon, int attr, int amount); +void AddMonDataInternal(struct Pokemon * pokemon, int attr, int amount); +void AddBoxMonData(struct BoxPokemon * pokemon, int attr, int amount); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From f93a6043eb52c63d1a64a3e9f10c113d4e5acc02 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 12:53:41 -0400 Subject: Through GetMonBaseStat --- include/pokemon.h | 100 +++++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index d2166c22..b7642f74 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -220,7 +220,7 @@ enum BaseStat { BASE_SPEED_YIELD, BASE_SPATK_YIELD, BASE_SPDEF_YIELD, - BASE_ITEM_1 = 16, + BASE_ITEM_1, BASE_ITEM_2, BASE_GENDER_RATIO, BASE_EGG_CYCLES, @@ -233,42 +233,45 @@ enum BaseStat { BASE_GREAT_MARSH_RATE, BASE_COLOR, BASE_FLIP, + BASE_UNKNOWN_29, + BASE_UNKNOWN_30, + BASE_UNKNOWN_31, + BASE_UNKNOWN_32, }; struct BaseStats { - u8 hp; - u8 atk; - u8 def; - u8 speed; - u8 spatk; - u8 spdef; - u8 types[2]; - u8 catchRate; - u8 expYield; - u16 hp_yield:2; - u16 atk_yield:2; - u16 def_yield:2; - u16 speed_yield:2; - u16 spatk_yield:2; - u16 spdef_yield:2; - u16 unkB_4:2; - u16 padding_B_6:2; - u16 item1; - u16 item2; - u8 genderRatio; - u8 eggCycles; - u8 friendship; - u8 growthRate; - u8 eggGroups[2]; - u8 abilities[2]; - u8 greatMarshRate; - u8 color:7; - u8 flip:1; - u8 padding_1A[2]; - u32 unk1C; - u32 unk20; - u32 unk24; - u32 unk28; + /* 0x00 */ u8 hp; + /* 0x01 */ u8 atk; + /* 0x02 */ u8 def; + /* 0x03 */ u8 speed; + /* 0x04 */ u8 spatk; + /* 0x05 */ u8 spdef; + /* 0x06 */ u8 types[2]; + /* 0x08 */ u8 catchRate; + /* 0x09 */ u8 expYield; + /* 0x0A */ u16 hp_yield:2; + u16 atk_yield:2; + u16 def_yield:2; + u16 speed_yield:2; + /* 0x0B */ u16 spatk_yield:2; + u16 spdef_yield:2; + u16 padding_B_4:4; + /* 0x0C */ u16 item1; + /* 0x0E */ u16 item2; + /* 0x10 */ u8 genderRatio; + /* 0x11 */ u8 eggCycles; + /* 0x12 */ u8 friendship; + /* 0x13 */ u8 growthRate; + /* 0x14 */ u8 eggGroups[2]; + /* 0x16 */ u8 abilities[2]; + /* 0x18 */ u8 greatMarshRate; + /* 0x19 */ u8 color:7; + u8 flip:1; + u8 padding_1A[2]; + /* 0x1C */ u32 unk1C; + /* 0x20 */ u32 unk20; + /* 0x24 */ u32 unk24; + /* 0x28 */ u32 unk28; }; typedef enum { @@ -480,6 +483,18 @@ u32 GenPersonalityByGenderAndNature(u16 species, u8 gender, u8 nature); void CreateMonWithFixedIVs(struct Pokemon * pokemon, int species, int level, int ivs, int personality); void CalcMonLevelAndStats(struct Pokemon * pokemon); void CalcMonStats(struct Pokemon * pokemon); +#ifndef IN_POKEMON_C +u32 GetMonData(); +u32 GetBoxMonData(); +#else +u32 GetMonData(struct Pokemon * pokemon, int attr, void * ptr); +u32 GetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); +#endif +void SetMonData(struct Pokemon * pokemon, int attr, void * ptr); +void SetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); +void AddMonData(struct Pokemon * pokemon, int attr, int amount); +struct BaseStats * AllocAndLoadMonPersonal(int species, u32 heap_id); + u32 CalcMonLevelEncrypted(struct Pokemon * pokemon); u8 GetBoxMonNature(struct BoxPokemon * boxmon); u8 GetMonNature(struct Pokemon * mon); @@ -487,25 +502,10 @@ u8 GetNatureFromPersonality(u32 pid); u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); u32 GetBoxMonGenderEncrypted(struct BoxPokemon * boxmon); int GetMonBaseStat_HandleFormeConversion(int species, int form, enum BaseStat stat_id); -u32 GetMonBaseStat(int species, enum BaseStat stat_id); +int GetMonBaseStat(int species, enum BaseStat stat_id); u32 GetMonExpBySpeciesAndLevel(int species, int level); void LoadGrowthTable(int species, int * table); int GetExpByGrowthRateAndLevel(int rate, int level); int CalcLevelBySpeciesAndExp(int species, int experience); -#ifndef IN_POKEMON_C -u32 GetMonData(); -u32 GetBoxMonData(); -#else -u32 GetMonData(struct Pokemon * pokemon, int attr, void * ptr); -u32 GetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); -#endif -void SetMonDataInternal(struct Pokemon * pokemon, int attr, void * ptr); -void SetMonData(struct Pokemon * pokemon, int attr, void * ptr); -void SetBoxMonDataInternal(struct BoxPokemon * pokemon, int attr, void * ptr); -void SetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); -void AddMonData(struct Pokemon * pokemon, int attr, int amount); -void AddMonDataInternal(struct Pokemon * pokemon, int attr, int amount); -void AddBoxMonData(struct BoxPokemon * pokemon, int attr, int amount); - #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From 321da97e6fdd66192484ca9aa60581b69fb3e7a4 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 13:49:41 -0400 Subject: Through ModifyStatByNature --- include/filesystem.h | 1 + include/pokemon.h | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/filesystem.h b/include/filesystem.h index 37f73bb0..6b5a16d6 100644 --- a/include/filesystem.h +++ b/include/filesystem.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_FILESYSTEM_H #include "nitro/types.h" +#include "FS_file.h" typedef struct NARC { diff --git a/include/pokemon.h b/include/pokemon.h index b7642f74..3e277ee1 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -471,10 +471,10 @@ void ZeroMonData(struct Pokemon * pokemon); void ZeroBoxMonData(struct BoxPokemon * boxmon); u32 SizeOfStructPokemon(void); struct Pokemon * AllocMonZeroed(u32 heap_id); -BOOL TryDecryptMon(struct Pokemon * mon); -BOOL TryEncryptMon(struct Pokemon * mon, BOOL decrypt_result); -BOOL TryDecryptBoxMon(struct BoxPokemon * mon); -BOOL TryEncryptBoxMon(struct BoxPokemon * mon, BOOL decrypt_result); +BOOL AcquireMonLock(struct Pokemon * mon); +BOOL ReleaseMonLock(struct Pokemon * mon, BOOL decrypt_result); +BOOL AcquireBoxMonLock(struct BoxPokemon * mon); +BOOL ReleaseBoxMonLock(struct BoxPokemon * mon, BOOL decrypt_result); void CreateMon(struct Pokemon * pokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId); void CreateBoxMon(struct BoxPokemon * boxPokemon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId); void CreateMonWithNature(struct Pokemon * pokemon, u16 species, u8 level, u8 fixedIv, u8 nature); @@ -494,18 +494,20 @@ void SetMonData(struct Pokemon * pokemon, int attr, void * ptr); void SetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); void AddMonData(struct Pokemon * pokemon, int attr, int amount); struct BaseStats * AllocAndLoadMonPersonal(int species, u32 heap_id); +int GetMonBaseStat_HandleFormeConversion(int species, int form, enum BaseStat stat_id); +int GetMonBaseStat(int species, enum BaseStat stat_id); +u32 GetMonExpBySpeciesAndLevel(int species, int level); +void LoadGrowthTable(int growthRate, u32 * table); +u32 GetExpByGrowthRateAndLevel(int rate, int level); +int CalcMonLevel(struct Pokemon * pokemon); +int CalcBoxMonLevel(struct BoxPokemon * boxmon); +int CalcLevelBySpeciesAndExp(u16 species, u32 experience); +int CalcLevelBySpeciesAndExp_PreloadedPersonal(struct BaseStats * personal, u16 species, u32 experience); -u32 CalcMonLevelEncrypted(struct Pokemon * pokemon); u8 GetBoxMonNature(struct BoxPokemon * boxmon); u8 GetMonNature(struct Pokemon * mon); u8 GetNatureFromPersonality(u32 pid); u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); u32 GetBoxMonGenderEncrypted(struct BoxPokemon * boxmon); -int GetMonBaseStat_HandleFormeConversion(int species, int form, enum BaseStat stat_id); -int GetMonBaseStat(int species, enum BaseStat stat_id); -u32 GetMonExpBySpeciesAndLevel(int species, int level); -void LoadGrowthTable(int species, int * table); -int GetExpByGrowthRateAndLevel(int rate, int level); -int CalcLevelBySpeciesAndExp(int species, int experience); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From 01eea396ed25500e15752d7edfe76cb1031bee60 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 15:07:54 -0400 Subject: through CalcShininessByOtIdAndPersonality --- include/constants/items.h | 448 ++++++++++++++++++++++++++++++++++++++++++++++ include/pokemon.h | 2 +- 2 files changed, 449 insertions(+), 1 deletion(-) create mode 100644 include/constants/items.h (limited to 'include') diff --git a/include/constants/items.h b/include/constants/items.h new file mode 100644 index 00000000..98c3dd97 --- /dev/null +++ b/include/constants/items.h @@ -0,0 +1,448 @@ +#ifndef POKEDIAMOND_CONSTANTS_ITEMS_H +#define POKEDIAMOND_CONSTANTS_ITEMS_H + +#define ITEM_NONE 0 +#define ITEM_MASTER_BALL 1 +#define ITEM_ULTRA_BALL 2 +#define ITEM_GREAT_BALL 3 +#define ITEM_POKE_BALL 4 +#define ITEM_SAFARI_BALL 5 +#define ITEM_NET_BALL 6 +#define ITEM_DIVE_BALL 7 +#define ITEM_NEST_BALL 8 +#define ITEM_REPEAT_BALL 9 +#define ITEM_TIMER_BALL 10 +#define ITEM_LUXURY_BALL 11 +#define ITEM_PREMIER_BALL 12 +#define ITEM_DUSK_BALL 13 +#define ITEM_HEAL_BALL 14 +#define ITEM_QUICK_BALL 15 +#define ITEM_CHERISH_BALL 16 +#define ITEM_POTION 17 +#define ITEM_ANTIDOTE 18 +#define ITEM_BURN_HEAL 19 +#define ITEM_ICE_HEAL 20 +#define ITEM_AWAKENING 21 +#define ITEM_PARLYZ_HEAL 22 +#define ITEM_FULL_RESTORE 23 +#define ITEM_MAX_POTION 24 +#define ITEM_HYPER_POTION 25 +#define ITEM_SUPER_POTION 26 +#define ITEM_FULL_HEAL 27 +#define ITEM_REVIVE 28 +#define ITEM_MAX_REVIVE 29 +#define ITEM_FRESH_WATER 30 +#define ITEM_SODA_POP 31 +#define ITEM_LEMONADE 32 +#define ITEM_MOOMOO_MILK 33 +#define ITEM_ENERGYPOWDER 34 +#define ITEM_ENERGY_ROOT 35 +#define ITEM_HEAL_POWDER 36 +#define ITEM_REVIVAL_HERB 37 +#define ITEM_ETHER 38 +#define ITEM_MAX_ETHER 39 +#define ITEM_ELIXIR 40 +#define ITEM_MAX_ELIXIR 41 +#define ITEM_LAVA_COOKIE 42 +#define ITEM_BERRY_JUICE 43 +#define ITEM_SACRED_ASH 44 +#define ITEM_HP_UP 45 +#define ITEM_PROTEIN 46 +#define ITEM_IRON 47 +#define ITEM_CARBOS 48 +#define ITEM_CALCIUM 49 +#define ITEM_RARE_CANDY 50 +#define ITEM_PP_UP 51 +#define ITEM_ZINC 52 +#define ITEM_PP_MAX 53 +#define ITEM_OLD_GATEAU 54 +#define ITEM_GUARD_SPEC_ 55 +#define ITEM_DIRE_HIT 56 +#define ITEM_X_ATTACK 57 +#define ITEM_X_DEFENSE 58 +#define ITEM_X_SPEED 59 +#define ITEM_X_ACCURACY 60 +#define ITEM_X_SPECIAL 61 +#define ITEM_X_SP__DEF 62 +#define ITEM_POKE_DOLL 63 +#define ITEM_FLUFFY_TAIL 64 +#define ITEM_BLUE_FLUTE 65 +#define ITEM_YELLOW_FLUTE 66 +#define ITEM_RED_FLUTE 67 +#define ITEM_BLACK_FLUTE 68 +#define ITEM_WHITE_FLUTE 69 +#define ITEM_SHOAL_SALT 70 +#define ITEM_SHOAL_SHELL 71 +#define ITEM_RED_SHARD 72 +#define ITEM_BLUE_SHARD 73 +#define ITEM_YELLOW_SHARD 74 +#define ITEM_GREEN_SHARD 75 +#define ITEM_SUPER_REPEL 76 +#define ITEM_MAX_REPEL 77 +#define ITEM_ESCAPE_ROPE 78 +#define ITEM_REPEL 79 +#define ITEM_SUN_STONE 80 +#define ITEM_MOON_STONE 81 +#define ITEM_FIRE_STONE 82 +#define ITEM_THUNDERSTONE 83 +#define ITEM_WATER_STONE 84 +#define ITEM_LEAF_STONE 85 +#define ITEM_TINYMUSHROOM 86 +#define ITEM_BIG_MUSHROOM 87 +#define ITEM_PEARL 88 +#define ITEM_BIG_PEARL 89 +#define ITEM_STARDUST 90 +#define ITEM_STAR_PIECE 91 +#define ITEM_NUGGET 92 +#define ITEM_HEART_SCALE 93 +#define ITEM_HONEY 94 +#define ITEM_GROWTH_MULCH 95 +#define ITEM_DAMP_MULCH 96 +#define ITEM_STABLE_MULCH 97 +#define ITEM_GOOEY_MULCH 98 +#define ITEM_ROOT_FOSSIL 99 +#define ITEM_CLAW_FOSSIL 100 +#define ITEM_HELIX_FOSSIL 101 +#define ITEM_DOME_FOSSIL 102 +#define ITEM_OLD_AMBER 103 +#define ITEM_ARMOR_FOSSIL 104 +#define ITEM_SKULL_FOSSIL 105 +#define ITEM_RARE_BONE 106 +#define ITEM_SHINY_STONE 107 +#define ITEM_DUSK_STONE 108 +#define ITEM_DAWN_STONE 109 +#define ITEM_OVAL_STONE 110 +#define ITEM_ODD_KEYSTONE 111 + +#define ITEM_ADAMANT_ORB 135 +#define ITEM_LUSTROUS_ORB 136 +#define ITEM_GRASS_MAIL 137 +#define ITEM_FLAME_MAIL 138 +#define ITEM_BUBBLE_MAIL 139 +#define ITEM_BLOOM_MAIL 140 +#define ITEM_TUNNEL_MAIL 141 +#define ITEM_STEEL_MAIL 142 +#define ITEM_HEART_MAIL 143 +#define ITEM_SNOW_MAIL 144 +#define ITEM_SPACE_MAIL 145 +#define ITEM_AIR_MAIL 146 +#define ITEM_MOSAIC_MAIL 147 +#define ITEM_BRICK_MAIL 148 +#define ITEM_CHERI_BERRY 149 +#define ITEM_CHESTO_BERRY 150 +#define ITEM_PECHA_BERRY 151 +#define ITEM_RAWST_BERRY 152 +#define ITEM_ASPEAR_BERRY 153 +#define ITEM_LEPPA_BERRY 154 +#define ITEM_ORAN_BERRY 155 +#define ITEM_PERSIM_BERRY 156 +#define ITEM_LUM_BERRY 157 +#define ITEM_SITRUS_BERRY 158 +#define ITEM_FIGY_BERRY 159 +#define ITEM_WIKI_BERRY 160 +#define ITEM_MAGO_BERRY 161 +#define ITEM_AGUAV_BERRY 162 +#define ITEM_IAPAPA_BERRY 163 +#define ITEM_RAZZ_BERRY 164 +#define ITEM_BLUK_BERRY 165 +#define ITEM_NANAB_BERRY 166 +#define ITEM_WEPEAR_BERRY 167 +#define ITEM_PINAP_BERRY 168 +#define ITEM_POMEG_BERRY 169 +#define ITEM_KELPSY_BERRY 170 +#define ITEM_QUALOT_BERRY 171 +#define ITEM_HONDEW_BERRY 172 +#define ITEM_GREPA_BERRY 173 +#define ITEM_TAMATO_BERRY 174 +#define ITEM_CORNN_BERRY 175 +#define ITEM_MAGOST_BERRY 176 +#define ITEM_RABUTA_BERRY 177 +#define ITEM_NOMEL_BERRY 178 +#define ITEM_SPELON_BERRY 179 +#define ITEM_PAMTRE_BERRY 180 +#define ITEM_WATMEL_BERRY 181 +#define ITEM_DURIN_BERRY 182 +#define ITEM_BELUE_BERRY 183 +#define ITEM_OCCA_BERRY 184 +#define ITEM_PASSHO_BERRY 185 +#define ITEM_WACAN_BERRY 186 +#define ITEM_RINDO_BERRY 187 +#define ITEM_YACHE_BERRY 188 +#define ITEM_CHOPLE_BERRY 189 +#define ITEM_KEBIA_BERRY 190 +#define ITEM_SHUCA_BERRY 191 +#define ITEM_COBA_BERRY 192 +#define ITEM_PAYAPA_BERRY 193 +#define ITEM_TANGA_BERRY 194 +#define ITEM_CHARTI_BERRY 195 +#define ITEM_KASIB_BERRY 196 +#define ITEM_HABAN_BERRY 197 +#define ITEM_COLBUR_BERRY 198 +#define ITEM_BABIRI_BERRY 199 +#define ITEM_CHILAN_BERRY 200 +#define ITEM_LIECHI_BERRY 201 +#define ITEM_GANLON_BERRY 202 +#define ITEM_SALAC_BERRY 203 +#define ITEM_PETAYA_BERRY 204 +#define ITEM_APICOT_BERRY 205 +#define ITEM_LANSAT_BERRY 206 +#define ITEM_STARF_BERRY 207 +#define ITEM_ENIGMA_BERRY 208 +#define ITEM_MICLE_BERRY 209 +#define ITEM_CUSTAP_BERRY 210 +#define ITEM_JABOCA_BERRY 211 +#define ITEM_ROWAP_BERRY 212 +#define ITEM_BRIGHTPOWDER 213 +#define ITEM_WHITE_HERB 214 +#define ITEM_MACHO_BRACE 215 +#define ITEM_EXP__SHARE 216 +#define ITEM_QUICK_CLAW 217 +#define ITEM_SOOTHE_BELL 218 +#define ITEM_MENTAL_HERB 219 +#define ITEM_CHOICE_BAND 220 +#define ITEM_KINGS_ROCK 221 +#define ITEM_SILVERPOWDER 222 +#define ITEM_AMULET_COIN 223 +#define ITEM_CLEANSE_TAG 224 +#define ITEM_SOUL_DEW 225 +#define ITEM_DEEPSEATOOTH 226 +#define ITEM_DEEPSEASCALE 227 +#define ITEM_SMOKE_BALL 228 +#define ITEM_EVERSTONE 229 +#define ITEM_FOCUS_BAND 230 +#define ITEM_LUCKY_EGG 231 +#define ITEM_SCOPE_LENS 232 +#define ITEM_METAL_COAT 233 +#define ITEM_LEFTOVERS 234 +#define ITEM_DRAGON_SCALE 235 +#define ITEM_LIGHT_BALL 236 +#define ITEM_SOFT_SAND 237 +#define ITEM_HARD_STONE 238 +#define ITEM_MIRACLE_SEED 239 +#define ITEM_BLACKGLASSES 240 +#define ITEM_BLACK_BELT 241 +#define ITEM_MAGNET 242 +#define ITEM_MYSTIC_WATER 243 +#define ITEM_SHARP_BEAK 244 +#define ITEM_POISON_BARB 245 +#define ITEM_NEVERMELTICE 246 +#define ITEM_SPELL_TAG 247 +#define ITEM_TWISTEDSPOON 248 +#define ITEM_CHARCOAL 249 +#define ITEM_DRAGON_FANG 250 +#define ITEM_SILK_SCARF 251 +#define ITEM_UPGRADE 252 +#define ITEM_SHELL_BELL 253 +#define ITEM_SEA_INCENSE 254 +#define ITEM_LAX_INCENSE 255 +#define ITEM_LUCKY_PUNCH 256 +#define ITEM_METAL_POWDER 257 +#define ITEM_THICK_CLUB 258 +#define ITEM_STICK 259 +#define ITEM_RED_SCARF 260 +#define ITEM_BLUE_SCARF 261 +#define ITEM_PINK_SCARF 262 +#define ITEM_GREEN_SCARF 263 +#define ITEM_YELLOW_SCARF 264 +#define ITEM_WIDE_LENS 265 +#define ITEM_MUSCLE_BAND 266 +#define ITEM_WISE_GLASSES 267 +#define ITEM_EXPERT_BELT 268 +#define ITEM_LIGHT_CLAY 269 +#define ITEM_LIFE_ORB 270 +#define ITEM_POWER_HERB 271 +#define ITEM_TOXIC_ORB 272 +#define ITEM_FLAME_ORB 273 +#define ITEM_QUICK_POWDER 274 +#define ITEM_FOCUS_SASH 275 +#define ITEM_ZOOM_LENS 276 +#define ITEM_METRONOME 277 +#define ITEM_IRON_BALL 278 +#define ITEM_LAGGING_TAIL 279 +#define ITEM_DESTINY_KNOT 280 +#define ITEM_BLACK_SLUDGE 281 +#define ITEM_ICY_ROCK 282 +#define ITEM_SMOOTH_ROCK 283 +#define ITEM_HEAT_ROCK 284 +#define ITEM_DAMP_ROCK 285 +#define ITEM_GRIP_CLAW 286 +#define ITEM_CHOICE_SCARF 287 +#define ITEM_STICKY_BARB 288 +#define ITEM_POWER_BRACER 289 +#define ITEM_POWER_BELT 290 +#define ITEM_POWER_LENS 291 +#define ITEM_POWER_BAND 292 +#define ITEM_POWER_ANKLET 293 +#define ITEM_POWER_WEIGHT 294 +#define ITEM_SHED_SHELL 295 +#define ITEM_BIG_ROOT 296 +#define ITEM_CHOICE_SPECS 297 +#define ITEM_FLAME_PLATE 298 +#define ITEM_SPLASH_PLATE 299 +#define ITEM_ZAP_PLATE 300 +#define ITEM_MEADOW_PLATE 301 +#define ITEM_ICICLE_PLATE 302 +#define ITEM_FIST_PLATE 303 +#define ITEM_TOXIC_PLATE 304 +#define ITEM_EARTH_PLATE 305 +#define ITEM_SKY_PLATE 306 +#define ITEM_MIND_PLATE 307 +#define ITEM_INSECT_PLATE 308 +#define ITEM_STONE_PLATE 309 +#define ITEM_SPOOKY_PLATE 310 +#define ITEM_DRACO_PLATE 311 +#define ITEM_DREAD_PLATE 312 +#define ITEM_IRON_PLATE 313 +#define ITEM_ODD_INCENSE 314 +#define ITEM_ROCK_INCENSE 315 +#define ITEM_FULL_INCENSE 316 +#define ITEM_WAVE_INCENSE 317 +#define ITEM_ROSE_INCENSE 318 +#define ITEM_LUCK_INCENSE 319 +#define ITEM_PURE_INCENSE 320 +#define ITEM_PROTECTOR 321 +#define ITEM_ELECTIRIZER 322 +#define ITEM_MAGMARIZER 323 +#define ITEM_DUBIOUS_DISC 324 +#define ITEM_REAPER_CLOTH 325 +#define ITEM_RAZOR_CLAW 326 +#define ITEM_RAZOR_FANG 327 +#define ITEM_TM01 328 +#define ITEM_TM02 329 +#define ITEM_TM03 330 +#define ITEM_TM04 331 +#define ITEM_TM05 332 +#define ITEM_TM06 333 +#define ITEM_TM07 334 +#define ITEM_TM08 335 +#define ITEM_TM09 336 +#define ITEM_TM10 337 +#define ITEM_TM11 338 +#define ITEM_TM12 339 +#define ITEM_TM13 340 +#define ITEM_TM14 341 +#define ITEM_TM15 342 +#define ITEM_TM16 343 +#define ITEM_TM17 344 +#define ITEM_TM18 345 +#define ITEM_TM19 346 +#define ITEM_TM20 347 +#define ITEM_TM21 348 +#define ITEM_TM22 349 +#define ITEM_TM23 350 +#define ITEM_TM24 351 +#define ITEM_TM25 352 +#define ITEM_TM26 353 +#define ITEM_TM27 354 +#define ITEM_TM28 355 +#define ITEM_TM29 356 +#define ITEM_TM30 357 +#define ITEM_TM31 358 +#define ITEM_TM32 359 +#define ITEM_TM33 360 +#define ITEM_TM34 361 +#define ITEM_TM35 362 +#define ITEM_TM36 363 +#define ITEM_TM37 364 +#define ITEM_TM38 365 +#define ITEM_TM39 366 +#define ITEM_TM40 367 +#define ITEM_TM41 368 +#define ITEM_TM42 369 +#define ITEM_TM43 370 +#define ITEM_TM44 371 +#define ITEM_TM45 372 +#define ITEM_TM46 373 +#define ITEM_TM47 374 +#define ITEM_TM48 375 +#define ITEM_TM49 376 +#define ITEM_TM50 377 +#define ITEM_TM51 378 +#define ITEM_TM52 379 +#define ITEM_TM53 380 +#define ITEM_TM54 381 +#define ITEM_TM55 382 +#define ITEM_TM56 383 +#define ITEM_TM57 384 +#define ITEM_TM58 385 +#define ITEM_TM59 386 +#define ITEM_TM60 387 +#define ITEM_TM61 388 +#define ITEM_TM62 389 +#define ITEM_TM63 390 +#define ITEM_TM64 391 +#define ITEM_TM65 392 +#define ITEM_TM66 393 +#define ITEM_TM67 394 +#define ITEM_TM68 395 +#define ITEM_TM69 396 +#define ITEM_TM70 397 +#define ITEM_TM71 398 +#define ITEM_TM72 399 +#define ITEM_TM73 400 +#define ITEM_TM74 401 +#define ITEM_TM75 402 +#define ITEM_TM76 403 +#define ITEM_TM77 404 +#define ITEM_TM78 405 +#define ITEM_TM79 406 +#define ITEM_TM80 407 +#define ITEM_TM81 408 +#define ITEM_TM82 409 +#define ITEM_TM83 410 +#define ITEM_TM84 411 +#define ITEM_TM85 412 +#define ITEM_TM86 413 +#define ITEM_TM87 414 +#define ITEM_TM88 415 +#define ITEM_TM89 416 +#define ITEM_TM90 417 +#define ITEM_TM91 418 +#define ITEM_TM92 419 +#define ITEM_HM01 420 +#define ITEM_HM02 421 +#define ITEM_HM03 422 +#define ITEM_HM04 423 +#define ITEM_HM05 424 +#define ITEM_HM06 425 +#define ITEM_HM07 426 +#define ITEM_HM08 427 +#define ITEM_EXPLORER_KIT 428 +#define ITEM_LOOT_SACK 429 +#define ITEM_RULE_BOOK 430 +#define ITEM_POKE_RADAR 431 +#define ITEM_POINT_CARD 432 +#define ITEM_JOURNAL 433 +#define ITEM_SEAL_CASE 434 +#define ITEM_FASHION_CASE 435 +#define ITEM_SEAL_BAG 436 +#define ITEM_PAL_PAD 437 +#define ITEM_WORKS_KEY 438 +#define ITEM_OLD_CHARM 439 +#define ITEM_GALACTIC_KEY 440 +#define ITEM_RED_CHAIN 441 +#define ITEM_TOWN_MAP 442 +#define ITEM_VS__SEEKER 443 +#define ITEM_COIN_CASE 444 +#define ITEM_OLD_ROD 445 +#define ITEM_GOOD_ROD 446 +#define ITEM_SUPER_ROD 447 +#define ITEM_SPRAYDUCK 448 +#define ITEM_POFFIN_CASE 449 +#define ITEM_BICYCLE 450 +#define ITEM_SUITE_KEY 451 +#define ITEM_OAKS_LETTER 452 +#define ITEM_LUNAR_WING 453 +#define ITEM_MEMBER_CARD 454 +#define ITEM_AZURE_FLUTE 455 +#define ITEM_S_S__TICKET 456 +#define ITEM_CONTEST_PASS 457 +#define ITEM_MAGMA_STONE 458 +#define ITEM_PARCEL 459 +#define ITEM_COUPON_1 460 +#define ITEM_COUPON_2 461 +#define ITEM_COUPON_3 462 +#define ITEM_STORAGE_KEY 463 +#define ITEM_SECRETPOTION 464 + +#endif //POKEDIAMOND_CONSTANTS_ITEMS_H diff --git a/include/pokemon.h b/include/pokemon.h index 3e277ee1..db15ac14 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -507,7 +507,7 @@ int CalcLevelBySpeciesAndExp_PreloadedPersonal(struct BaseStats * personal, u16 u8 GetBoxMonNature(struct BoxPokemon * boxmon); u8 GetMonNature(struct Pokemon * mon); u8 GetNatureFromPersonality(u32 pid); +u8 GetBoxMonGender(struct BoxPokemon * boxmon); u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); -u32 GetBoxMonGenderEncrypted(struct BoxPokemon * boxmon); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From e8e76fcd320eea906d2746f0315bd0918bd40cb3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 16:30:14 -0400 Subject: Fix warnings --- include/pokemon.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index db15ac14..897b6731 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -494,8 +494,13 @@ void SetMonData(struct Pokemon * pokemon, int attr, void * ptr); void SetBoxMonData(struct BoxPokemon * pokemon, int attr, void * ptr); void AddMonData(struct Pokemon * pokemon, int attr, int amount); struct BaseStats * AllocAndLoadMonPersonal(int species, u32 heap_id); +int GetPersonalAttr(struct BaseStats * baseStats, enum BaseStat attr); +void FreeMonPersonal(struct BaseStats * personal); int GetMonBaseStat_HandleFormeConversion(int species, int form, enum BaseStat stat_id); int GetMonBaseStat(int species, enum BaseStat stat_id); +u8 GetPercentProgressTowardsNextLevel(struct Pokemon * pokemon); +u32 CalcMonExpToNextLevel(struct Pokemon * pokemon); +u32 GetMonBaseExperienceAtCurrentLevel(struct Pokemon * pokemon); u32 GetMonExpBySpeciesAndLevel(int species, int level); void LoadGrowthTable(int growthRate, u32 * table); u32 GetExpByGrowthRateAndLevel(int rate, int level); @@ -503,11 +508,13 @@ int CalcMonLevel(struct Pokemon * pokemon); int CalcBoxMonLevel(struct BoxPokemon * boxmon); int CalcLevelBySpeciesAndExp(u16 species, u32 experience); int CalcLevelBySpeciesAndExp_PreloadedPersonal(struct BaseStats * personal, u16 species, u32 experience); - u8 GetBoxMonNature(struct BoxPokemon * boxmon); u8 GetMonNature(struct Pokemon * mon); u8 GetNatureFromPersonality(u32 pid); +void MonApplyFriendshipMod(struct Pokemon * pokemon, u32 kind, u32 location); +u8 GetMonGender(struct Pokemon * pokemon); u8 GetBoxMonGender(struct BoxPokemon * boxmon); u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); +u8 MonIsShiny(struct Pokemon * pokemon); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From 1539bc21bce1ad6c80bd7ead5a9658ea6f2182e3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 17:08:36 -0400 Subject: GenerateShinyPersonality --- include/pokemon.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 897b6731..6d2c8cf7 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -516,5 +516,6 @@ u8 GetMonGender(struct Pokemon * pokemon); u8 GetBoxMonGender(struct BoxPokemon * boxmon); u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); u8 MonIsShiny(struct Pokemon * pokemon); +u32 GenerateShinyPersonality(u32 otid); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From a17f767a50a874e3d0ebb6b38a8b5c4a81062bd5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 18:23:31 -0400 Subject: through FUN_02068C00 --- include/pokemon.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 6d2c8cf7..7c358370 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -467,6 +467,17 @@ struct Pokemon { /* 0x088 */ struct PartyPokemon party; }; // size: 0xEC +struct SomeDrawPokemonStruct +{ + u16 unk0; + u16 unk2; + u16 unk4; + u16 unk6; + u8 unk8; + u8 filler_9[3]; + u32 unkC; +}; + void ZeroMonData(struct Pokemon * pokemon); void ZeroBoxMonData(struct BoxPokemon * boxmon); u32 SizeOfStructPokemon(void); @@ -517,5 +528,7 @@ u8 GetBoxMonGender(struct BoxPokemon * boxmon); u8 GetGenderBySpeciesAndPersonality(u16 species, u32 pid); u8 MonIsShiny(struct Pokemon * pokemon); u32 GenerateShinyPersonality(u32 otid); +void FUN_02068B70(struct SomeDrawPokemonStruct * spC, struct BoxPokemon * boxmon, u8 sp10); +void FUN_02068C00(struct SomeDrawPokemonStruct * spC, int species, u8 gender, u8 sp10, u8 shiny, u8 forme, u32 personality); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From b98a4f3b8a0a8665ace6cc8c1065992bb848b8ec Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 19:35:11 -0400 Subject: through FUN_02068E88 --- include/pokemon.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 7c358370..d4df2bce 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -530,5 +530,8 @@ u8 MonIsShiny(struct Pokemon * pokemon); u32 GenerateShinyPersonality(u32 otid); void FUN_02068B70(struct SomeDrawPokemonStruct * spC, struct BoxPokemon * boxmon, u8 sp10); void FUN_02068C00(struct SomeDrawPokemonStruct * spC, int species, u8 gender, u8 sp10, u8 shiny, u8 forme, u32 personality); +u8 FUN_02068E14(struct Pokemon * pokemon, u32 a1); +u8 FUN_02068E1C(struct BoxPokemon * boxmon, u32 a1); +u8 FUN_02068E88(int species, u8 gender, u32 a2, u8 forme, u32 pid); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From d716e7b851b9949689985eedb24dfa2bc8619496 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 19:49:55 -0400 Subject: through FUN_02069010 --- include/pokemon.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index d4df2bce..5ba57915 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -533,5 +533,6 @@ void FUN_02068C00(struct SomeDrawPokemonStruct * spC, int species, u8 gender, u8 u8 FUN_02068E14(struct Pokemon * pokemon, u32 a1); u8 FUN_02068E1C(struct BoxPokemon * boxmon, u32 a1); u8 FUN_02068E88(int species, u8 gender, u32 a2, u8 forme, u32 pid); +int FUN_0206AA30(int a0); #endif //POKEDIAMOND_POKEMON_H -- cgit v1.2.3 From c5eb6d2669cdb27cc9f5ad35fae73577edf8aac6 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 13 Jun 2020 21:04:04 -0400 Subject: through FUN_020690E8 --- include/pokemon.h | 21 +++++++++++++++++++++ include/proto.h | 3 +++ 2 files changed, 24 insertions(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 5ba57915..66ad03f2 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -478,6 +478,27 @@ struct SomeDrawPokemonStruct u32 unkC; }; +struct PokeanmSub +{ + s8 unk0; + u8 unk1; +}; + +struct Pokeanm +{ + struct PokeanmSub unk0[4]; + u8 unk8[20]; +}; + +struct UnkStruct_02069038 +{ + u16 unk0; + u16 unk2; + u8 unk4; + u8 padding; + struct Pokeanm anim; +}; + void ZeroMonData(struct Pokemon * pokemon); void ZeroBoxMonData(struct BoxPokemon * boxmon); u32 SizeOfStructPokemon(void); diff --git a/include/proto.h b/include/proto.h index c8f50d33..3a6081b4 100644 --- a/include/proto.h +++ b/include/proto.h @@ -2,6 +2,7 @@ #define POKEDIAMOND_PROTO_H // For homeless function declarations +struct UnkStruct_02069038; u16 * FUN_0200AA50(u16 species, u32 heap_id); void FUN_02021A74(u16 * dest, u16 * src); @@ -10,5 +11,7 @@ void FUN_02021E28(u16 * dest, u16 * src); void FUN_02021EF0(const u16 * src, u16 * dest, u32 count); u32 FUN_0206E7B8(u16 item, u32 a1, u32 a2); u32 GetArceusTypeByPlate(u16 plate); +int FUN_02014C3C(u8); +void FUN_02014C54(int, int, struct UnkStruct_02069038 *, u8); #endif //POKEDIAMOND_PROTO_H -- cgit v1.2.3 From 7a7bce2bc77bf7886916787cb09f6d39704818c3 Mon Sep 17 00:00:00 2001 From: red031000 Date: Sun, 14 Jun 2020 17:32:24 +0100 Subject: arm7 OS_spinLock --- include/nitro/MI_dma_shared.h | 37 +++++++++++++++++++++++++++++++++++++ include/nitro/OS_spinLock_shared.h | 24 ++++++++++++++++++++++++ include/nitro/dma.h | 25 ------------------------- include/nitro/mmap_shared.h | 2 ++ 4 files changed, 63 insertions(+), 25 deletions(-) create mode 100644 include/nitro/MI_dma_shared.h create mode 100644 include/nitro/OS_spinLock_shared.h delete mode 100644 include/nitro/dma.h (limited to 'include') diff --git a/include/nitro/MI_dma_shared.h b/include/nitro/MI_dma_shared.h new file mode 100644 index 00000000..e839417a --- /dev/null +++ b/include/nitro/MI_dma_shared.h @@ -0,0 +1,37 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include MI_dma.h from the specific proc's lib + */ + +#ifndef GUARD_DMA_SHARED_H +#define GUARD_DMA_SHARED_H + +#define REG_ADDR_DMA0SAD 0x040000b0 + +#define DMA_DEST_INC 0x0000 +#define DMA_DEST_DEC 0x0020 +#define DMA_DEST_FIXED 0x0040 +#define DMA_DEST_RELOAD 0x0060 +#define DMA_SRC_INC 0x0000 +#define DMA_SRC_DEC 0x0080 +#define DMA_SRC_FIXED 0x0100 +#define DMA_REPEAT 0x0200 +#define DMA_16BIT 0x0000 +#define DMA_32BIT 0x0400 +#define DMA_DREQ_ON 0x0800 +#define DMA_START_NOW 0x0000 +#define DMA_START_VBLANK 0x1000 +#define DMA_START_HBLANK 0x2000 +#define DMA_START_SPECIAL 0x3000 +#define DMA_START_MASK 0x3000 +#define DMA_INTR_ENABLE 0x4000 +#define DMA_ENABLE 0x8000 + +#endif diff --git a/include/nitro/OS_spinLock_shared.h b/include/nitro/OS_spinLock_shared.h new file mode 100644 index 00000000..31f0be32 --- /dev/null +++ b/include/nitro/OS_spinLock_shared.h @@ -0,0 +1,24 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include OS_spinLock.h from the specific proc's lib + */ + +#ifndef POKEDIAMOND_OS_SPINLOCK_SHARED_H +#define POKEDIAMOND_OS_SPINLOCK_SHARED_H + +#include "nitro/types.h" + +typedef volatile struct OSLockWord { + u32 lockFlag; + u16 ownerID; + u16 extension; +} OSLockWord; + +#endif //POKEDIAMOND_OS_SPINLOCK_SHARED_H diff --git a/include/nitro/dma.h b/include/nitro/dma.h deleted file mode 100644 index 32944cb3..00000000 --- a/include/nitro/dma.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef GUARD_DMA_H -#define GUARD_DMA_H - -#define REG_ADDR_DMA0SAD 0x040000b0 - -#define DMA_DEST_INC 0x0000 -#define DMA_DEST_DEC 0x0020 -#define DMA_DEST_FIXED 0x0040 -#define DMA_DEST_RELOAD 0x0060 -#define DMA_SRC_INC 0x0000 -#define DMA_SRC_DEC 0x0080 -#define DMA_SRC_FIXED 0x0100 -#define DMA_REPEAT 0x0200 -#define DMA_16BIT 0x0000 -#define DMA_32BIT 0x0400 -#define DMA_DREQ_ON 0x0800 -#define DMA_START_NOW 0x0000 -#define DMA_START_VBLANK 0x1000 -#define DMA_START_HBLANK 0x2000 -#define DMA_START_SPECIAL 0x3000 -#define DMA_START_MASK 0x3000 -#define DMA_INTR_ENABLE 0x4000 -#define DMA_ENABLE 0x8000 - -#endif diff --git a/include/nitro/mmap_shared.h b/include/nitro/mmap_shared.h index 587887bb..f7ba4fb4 100644 --- a/include/nitro/mmap_shared.h +++ b/include/nitro/mmap_shared.h @@ -20,6 +20,8 @@ #define HW_WM_BOOT_BUF (HW_MAIN_MEM + 0x007ffc40) #define HW_ARENA_INFO_BUF (HW_MAIN_MEM + 0x007ffda0) +#define HW_CTRDG_LOCK_BUF (HW_MAIN_MEM + 0x007fffe8) +#define HW_INIT_LOCK_BUF (HW_MAIN_MEM + 0x007ffff0) #define HW_MAIN_MEM_MAIN_END (HW_MAIN_MEM + HW_MAIN_MEM_MAIN_SIZE) #endif //POKEDIAMOND_MMAP_SHARED_H -- cgit v1.2.3 From d6543eb215c80769469bf352330aa9d6387f859a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 14 Jun 2020 12:45:27 -0400 Subject: GetMonEvolution --- include/pokemon.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ include/proto.h | 5 +++++ 2 files changed, 52 insertions(+) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 66ad03f2..83630d39 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -362,6 +362,37 @@ typedef enum { UNOWN_QUESTION_MARK = 27 } AlternateForms; +typedef enum EvoMethod +{ + EVO_NONE = 0, + EVO_FRIENDSHIP, + EVO_FRIENDSHIP_DAY, + EVO_FRIENDSHIP_NIGHT, + EVO_LEVEL, + EVO_TRADE, + EVO_TRADE_ITEM, + EVO_STONE, + EVO_LEVEL_ATK_GT_DEF, + EVO_LEVEL_ATK_EQ_DEF, + EVO_LEVEL_ATK_LT_DEF, + EVO_LEVEL_PID_LO, + EVO_LEVEL_PID_HI, + EVO_LEVEL_NINJASK, + EVO_LEVEL_SHEDINJA, + EVO_BEAUTY, + EVO_STONE_MALE, + EVO_STONE_FEMALE, + EVO_ITEM_DAY, + EVO_ITEM_NIGHT, + EVO_HAS_MOVE, + EVO_OTHER_PARTY_MON, + EVO_LEVEL_MALE, + EVO_LEVEL_FEMALE, + EVO_CORONET, + EVO_ETERNA, + EVO_ROUTE217, +} EvoMethod; + // Structs typedef struct { @@ -499,6 +530,22 @@ struct UnkStruct_02069038 struct Pokeanm anim; }; +struct Evolution +{ + u16 method; + u16 param; + u16 target; +}; + +#define PARTY_SIZE 6 + +struct PlayerParty +{ + u32 maxCount; + u32 curCount; + struct Pokemon mons[PARTY_SIZE]; +}; + void ZeroMonData(struct Pokemon * pokemon); void ZeroBoxMonData(struct BoxPokemon * boxmon); u32 SizeOfStructPokemon(void); diff --git a/include/proto.h b/include/proto.h index 3a6081b4..d9a5ec2a 100644 --- a/include/proto.h +++ b/include/proto.h @@ -2,7 +2,10 @@ #define POKEDIAMOND_PROTO_H // For homeless function declarations + +// Declare these here so that we don't have to include pokemon.h struct UnkStruct_02069038; +struct PlayerParty; u16 * FUN_0200AA50(u16 species, u32 heap_id); void FUN_02021A74(u16 * dest, u16 * src); @@ -13,5 +16,7 @@ u32 FUN_0206E7B8(u16 item, u32 a1, u32 a2); u32 GetArceusTypeByPlate(u16 plate); int FUN_02014C3C(u8); void FUN_02014C54(int, int, struct UnkStruct_02069038 *, u8); +u32 IsNighttime(void); // is day or night +u32 PartyHasMon(struct PlayerParty *, u16); #endif //POKEDIAMOND_PROTO_H -- cgit v1.2.3 From 654acf33f071db80179fa556097f5663ca4dc311 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 14 Jun 2020 14:00:44 -0400 Subject: through FUN_020697D4 --- include/constants/moves.h | 473 ++++++++++++++++++++++++++++++++++++++++++++++ include/move_data.h | 1 + 2 files changed, 474 insertions(+) create mode 100644 include/constants/moves.h (limited to 'include') diff --git a/include/constants/moves.h b/include/constants/moves.h new file mode 100644 index 00000000..e25c16c9 --- /dev/null +++ b/include/constants/moves.h @@ -0,0 +1,473 @@ +#ifndef POKEDIAMOND_CONSTANTS_MOVES_H +#define POKEDIAMOND_CONSTANTS_MOVES_H + +#define MOVE_NONE 0 +#define MOVE_POUND 1 +#define MOVE_KARATE_CHOP 2 +#define MOVE_DOUBLE_SLAP 3 +#define MOVE_COMET_PUNCH 4 +#define MOVE_MEGA_PUNCH 5 +#define MOVE_PAY_DAY 6 +#define MOVE_FIRE_PUNCH 7 +#define MOVE_ICE_PUNCH 8 +#define MOVE_THUNDER_PUNCH 9 +#define MOVE_SCRATCH 10 +#define MOVE_VISE_GRIP 11 +#define MOVE_GUILLOTINE 12 +#define MOVE_RAZOR_WIND 13 +#define MOVE_SWORDS_DANCE 14 +#define MOVE_CUT 15 +#define MOVE_GUST 16 +#define MOVE_WING_ATTACK 17 +#define MOVE_WHIRLWIND 18 +#define MOVE_FLY 19 +#define MOVE_BIND 20 +#define MOVE_SLAM 21 +#define MOVE_VINE_WHIP 22 +#define MOVE_STOMP 23 +#define MOVE_DOUBLE_KICK 24 +#define MOVE_MEGA_KICK 25 +#define MOVE_JUMP_KICK 26 +#define MOVE_ROLLING_KICK 27 +#define MOVE_SAND_ATTACK 28 +#define MOVE_HEADBUTT 29 +#define MOVE_HORN_ATTACK 30 +#define MOVE_FURY_ATTACK 31 +#define MOVE_HORN_DRILL 32 +#define MOVE_TACKLE 33 +#define MOVE_BODY_SLAM 34 +#define MOVE_WRAP 35 +#define MOVE_TAKE_DOWN 36 +#define MOVE_THRASH 37 +#define MOVE_DOUBLE_EDGE 38 +#define MOVE_TAIL_WHIP 39 +#define MOVE_POISON_STING 40 +#define MOVE_TWINEEDLE 41 +#define MOVE_PIN_MISSILE 42 +#define MOVE_LEER 43 +#define MOVE_BITE 44 +#define MOVE_GROWL 45 +#define MOVE_ROAR 46 +#define MOVE_SING 47 +#define MOVE_SUPERSONIC 48 +#define MOVE_SONIC_BOOM 49 +#define MOVE_DISABLE 50 +#define MOVE_ACID 51 +#define MOVE_EMBER 52 +#define MOVE_FLAMETHROWER 53 +#define MOVE_MIST 54 +#define MOVE_WATER_GUN 55 +#define MOVE_HYDRO_PUMP 56 +#define MOVE_SURF 57 +#define MOVE_ICE_BEAM 58 +#define MOVE_BLIZZARD 59 +#define MOVE_PSYBEAM 60 +#define MOVE_BUBBLE_BEAM 61 +#define MOVE_AURORA_BEAM 62 +#define MOVE_HYPER_BEAM 63 +#define MOVE_PECK 64 +#define MOVE_DRILL_PECK 65 +#define MOVE_SUBMISSION 66 +#define MOVE_LOW_KICK 67 +#define MOVE_COUNTER 68 +#define MOVE_SEISMIC_TOSS 69 +#define MOVE_STRENGTH 70 +#define MOVE_ABSORB 71 +#define MOVE_MEGA_DRAIN 72 +#define MOVE_LEECH_SEED 73 +#define MOVE_GROWTH 74 +#define MOVE_RAZOR_LEAF 75 +#define MOVE_SOLAR_BEAM 76 +#define MOVE_POISON_POWDER 77 +#define MOVE_STUN_SPORE 78 +#define MOVE_SLEEP_POWDER 79 +#define MOVE_PETAL_DANCE 80 +#define MOVE_STRING_SHOT 81 +#define MOVE_DRAGON_RAGE 82 +#define MOVE_FIRE_SPIN 83 +#define MOVE_THUNDER_SHOCK 84 +#define MOVE_THUNDERBOLT 85 +#define MOVE_THUNDER_WAVE 86 +#define MOVE_THUNDER 87 +#define MOVE_ROCK_THROW 88 +#define MOVE_EARTHQUAKE 89 +#define MOVE_FISSURE 90 +#define MOVE_DIG 91 +#define MOVE_TOXIC 92 +#define MOVE_CONFUSION 93 +#define MOVE_PSYCHIC 94 +#define MOVE_HYPNOSIS 95 +#define MOVE_MEDITATE 96 +#define MOVE_AGILITY 97 +#define MOVE_QUICK_ATTACK 98 +#define MOVE_RAGE 99 +#define MOVE_TELEPORT 100 +#define MOVE_NIGHT_SHADE 101 +#define MOVE_MIMIC 102 +#define MOVE_SCREECH 103 +#define MOVE_DOUBLE_TEAM 104 +#define MOVE_RECOVER 105 +#define MOVE_HARDEN 106 +#define MOVE_MINIMIZE 107 +#define MOVE_SMOKESCREEN 108 +#define MOVE_CONFUSE_RAY 109 +#define MOVE_WITHDRAW 110 +#define MOVE_DEFENSE_CURL 111 +#define MOVE_BARRIER 112 +#define MOVE_LIGHT_SCREEN 113 +#define MOVE_HAZE 114 +#define MOVE_REFLECT 115 +#define MOVE_FOCUS_ENERGY 116 +#define MOVE_BIDE 117 +#define MOVE_METRONOME 118 +#define MOVE_MIRROR_MOVE 119 +#define MOVE_SELF_DESTRUCT 120 +#define MOVE_EGG_BOMB 121 +#define MOVE_LICK 122 +#define MOVE_SMOG 123 +#define MOVE_SLUDGE 124 +#define MOVE_BONE_CLUB 125 +#define MOVE_FIRE_BLAST 126 +#define MOVE_WATERFALL 127 +#define MOVE_CLAMP 128 +#define MOVE_SWIFT 129 +#define MOVE_SKULL_BASH 130 +#define MOVE_SPIKE_CANNON 131 +#define MOVE_CONSTRICT 132 +#define MOVE_AMNESIA 133 +#define MOVE_KINESIS 134 +#define MOVE_SOFT_BOILED 135 +#define MOVE_HIGH_JUMP_KICK 136 +#define MOVE_GLARE 137 +#define MOVE_DREAM_EATER 138 +#define MOVE_POISON_GAS 139 +#define MOVE_BARRAGE 140 +#define MOVE_LEECH_LIFE 141 +#define MOVE_LOVELY_KISS 142 +#define MOVE_SKY_ATTACK 143 +#define MOVE_TRANSFORM 144 +#define MOVE_BUBBLE 145 +#define MOVE_DIZZY_PUNCH 146 +#define MOVE_SPORE 147 +#define MOVE_FLASH 148 +#define MOVE_PSYWAVE 149 +#define MOVE_SPLASH 150 +#define MOVE_ACID_ARMOR 151 +#define MOVE_CRABHAMMER 152 +#define MOVE_EXPLOSION 153 +#define MOVE_FURY_SWIPES 154 +#define MOVE_BONEMERANG 155 +#define MOVE_REST 156 +#define MOVE_ROCK_SLIDE 157 +#define MOVE_HYPER_FANG 158 +#define MOVE_SHARPEN 159 +#define MOVE_CONVERSION 160 +#define MOVE_TRI_ATTACK 161 +#define MOVE_SUPER_FANG 162 +#define MOVE_SLASH 163 +#define MOVE_SUBSTITUTE 164 +#define MOVE_STRUGGLE 165 +#define MOVE_SKETCH 166 +#define MOVE_TRIPLE_KICK 167 +#define MOVE_THIEF 168 +#define MOVE_SPIDER_WEB 169 +#define MOVE_MIND_READER 170 +#define MOVE_NIGHTMARE 171 +#define MOVE_FLAME_WHEEL 172 +#define MOVE_SNORE 173 +#define MOVE_CURSE 174 +#define MOVE_FLAIL 175 +#define MOVE_CONVERSION_2 176 +#define MOVE_AEROBLAST 177 +#define MOVE_COTTON_SPORE 178 +#define MOVE_REVERSAL 179 +#define MOVE_SPITE 180 +#define MOVE_POWDER_SNOW 181 +#define MOVE_PROTECT 182 +#define MOVE_MACH_PUNCH 183 +#define MOVE_SCARY_FACE 184 +#define MOVE_FEINT_ATTACK 185 +#define MOVE_SWEET_KISS 186 +#define MOVE_BELLY_DRUM 187 +#define MOVE_SLUDGE_BOMB 188 +#define MOVE_MUD_SLAP 189 +#define MOVE_OCTAZOOKA 190 +#define MOVE_SPIKES 191 +#define MOVE_ZAP_CANNON 192 +#define MOVE_FORESIGHT 193 +#define MOVE_DESTINY_BOND 194 +#define MOVE_PERISH_SONG 195 +#define MOVE_ICY_WIND 196 +#define MOVE_DETECT 197 +#define MOVE_BONE_RUSH 198 +#define MOVE_LOCK_ON 199 +#define MOVE_OUTRAGE 200 +#define MOVE_SANDSTORM 201 +#define MOVE_GIGA_DRAIN 202 +#define MOVE_ENDURE 203 +#define MOVE_CHARM 204 +#define MOVE_ROLLOUT 205 +#define MOVE_FALSE_SWIPE 206 +#define MOVE_SWAGGER 207 +#define MOVE_MILK_DRINK 208 +#define MOVE_SPARK 209 +#define MOVE_FURY_CUTTER 210 +#define MOVE_STEEL_WING 211 +#define MOVE_MEAN_LOOK 212 +#define MOVE_ATTRACT 213 +#define MOVE_SLEEP_TALK 214 +#define MOVE_HEAL_BELL 215 +#define MOVE_RETURN 216 +#define MOVE_PRESENT 217 +#define MOVE_FRUSTRATION 218 +#define MOVE_SAFEGUARD 219 +#define MOVE_PAIN_SPLIT 220 +#define MOVE_SACRED_FIRE 221 +#define MOVE_MAGNITUDE 222 +#define MOVE_DYNAMIC_PUNCH 223 +#define MOVE_MEGAHORN 224 +#define MOVE_DRAGON_BREATH 225 +#define MOVE_BATON_PASS 226 +#define MOVE_ENCORE 227 +#define MOVE_PURSUIT 228 +#define MOVE_RAPID_SPIN 229 +#define MOVE_SWEET_SCENT 230 +#define MOVE_IRON_TAIL 231 +#define MOVE_METAL_CLAW 232 +#define MOVE_VITAL_THROW 233 +#define MOVE_MORNING_SUN 234 +#define MOVE_SYNTHESIS 235 +#define MOVE_MOONLIGHT 236 +#define MOVE_HIDDEN_POWER 237 +#define MOVE_CROSS_CHOP 238 +#define MOVE_TWISTER 239 +#define MOVE_RAIN_DANCE 240 +#define MOVE_SUNNY_DAY 241 +#define MOVE_CRUNCH 242 +#define MOVE_MIRROR_COAT 243 +#define MOVE_PSYCH_UP 244 +#define MOVE_EXTREME_SPEED 245 +#define MOVE_ANCIENT_POWER 246 +#define MOVE_SHADOW_BALL 247 +#define MOVE_FUTURE_SIGHT 248 +#define MOVE_ROCK_SMASH 249 +#define MOVE_WHIRLPOOL 250 +#define MOVE_BEAT_UP 251 +#define MOVE_FAKE_OUT 252 +#define MOVE_UPROAR 253 +#define MOVE_STOCKPILE 254 +#define MOVE_SPIT_UP 255 +#define MOVE_SWALLOW 256 +#define MOVE_HEAT_WAVE 257 +#define MOVE_HAIL 258 +#define MOVE_TORMENT 259 +#define MOVE_FLATTER 260 +#define MOVE_WILL_O_WISP 261 +#define MOVE_MEMENTO 262 +#define MOVE_FACADE 263 +#define MOVE_FOCUS_PUNCH 264 +#define MOVE_SMELLING_SALTS 265 +#define MOVE_FOLLOW_ME 266 +#define MOVE_NATURE_POWER 267 +#define MOVE_CHARGE 268 +#define MOVE_TAUNT 269 +#define MOVE_HELPING_HAND 270 +#define MOVE_TRICK 271 +#define MOVE_ROLE_PLAY 272 +#define MOVE_WISH 273 +#define MOVE_ASSIST 274 +#define MOVE_INGRAIN 275 +#define MOVE_SUPERPOWER 276 +#define MOVE_MAGIC_COAT 277 +#define MOVE_RECYCLE 278 +#define MOVE_REVENGE 279 +#define MOVE_BRICK_BREAK 280 +#define MOVE_YAWN 281 +#define MOVE_KNOCK_OFF 282 +#define MOVE_ENDEAVOR 283 +#define MOVE_ERUPTION 284 +#define MOVE_SKILL_SWAP 285 +#define MOVE_IMPRISON 286 +#define MOVE_REFRESH 287 +#define MOVE_GRUDGE 288 +#define MOVE_SNATCH 289 +#define MOVE_SECRET_POWER 290 +#define MOVE_DIVE 291 +#define MOVE_ARM_THRUST 292 +#define MOVE_CAMOUFLAGE 293 +#define MOVE_TAIL_GLOW 294 +#define MOVE_LUSTER_PURGE 295 +#define MOVE_MIST_BALL 296 +#define MOVE_FEATHER_DANCE 297 +#define MOVE_TEETER_DANCE 298 +#define MOVE_BLAZE_KICK 299 +#define MOVE_MUD_SPORT 300 +#define MOVE_ICE_BALL 301 +#define MOVE_NEEDLE_ARM 302 +#define MOVE_SLACK_OFF 303 +#define MOVE_HYPER_VOICE 304 +#define MOVE_POISON_FANG 305 +#define MOVE_CRUSH_CLAW 306 +#define MOVE_BLAST_BURN 307 +#define MOVE_HYDRO_CANNON 308 +#define MOVE_METEOR_MASH 309 +#define MOVE_ASTONISH 310 +#define MOVE_WEATHER_BALL 311 +#define MOVE_AROMATHERAPY 312 +#define MOVE_FAKE_TEARS 313 +#define MOVE_AIR_CUTTER 314 +#define MOVE_OVERHEAT 315 +#define MOVE_ODOR_SLEUTH 316 +#define MOVE_ROCK_TOMB 317 +#define MOVE_SILVER_WIND 318 +#define MOVE_METAL_SOUND 319 +#define MOVE_GRASS_WHISTLE 320 +#define MOVE_TICKLE 321 +#define MOVE_COSMIC_POWER 322 +#define MOVE_WATER_SPOUT 323 +#define MOVE_SIGNAL_BEAM 324 +#define MOVE_SHADOW_PUNCH 325 +#define MOVE_EXTRASENSORY 326 +#define MOVE_SKY_UPPERCUT 327 +#define MOVE_SAND_TOMB 328 +#define MOVE_SHEER_COLD 329 +#define MOVE_MUDDY_WATER 330 +#define MOVE_BULLET_SEED 331 +#define MOVE_AERIAL_ACE 332 +#define MOVE_ICICLE_SPEAR 333 +#define MOVE_IRON_DEFENSE 334 +#define MOVE_BLOCK 335 +#define MOVE_HOWL 336 +#define MOVE_DRAGON_CLAW 337 +#define MOVE_FRENZY_PLANT 338 +#define MOVE_BULK_UP 339 +#define MOVE_BOUNCE 340 +#define MOVE_MUD_SHOT 341 +#define MOVE_POISON_TAIL 342 +#define MOVE_COVET 343 +#define MOVE_VOLT_TACKLE 344 +#define MOVE_MAGICAL_LEAF 345 +#define MOVE_WATER_SPORT 346 +#define MOVE_CALM_MIND 347 +#define MOVE_LEAF_BLADE 348 +#define MOVE_DRAGON_DANCE 349 +#define MOVE_ROCK_BLAST 350 +#define MOVE_SHOCK_WAVE 351 +#define MOVE_WATER_PULSE 352 +#define MOVE_DOOM_DESIRE 353 +#define MOVE_PSYCHO_BOOST 354 +#define MOVE_ROOST 355 +#define MOVE_GRAVITY 356 +#define MOVE_MIRACLE_EYE 357 +#define MOVE_WAKE_UP_SLAP 358 +#define MOVE_HAMMER_ARM 359 +#define MOVE_GYRO_BALL 360 +#define MOVE_HEALING_WISH 361 +#define MOVE_BRINE 362 +#define MOVE_NATURAL_GIFT 363 +#define MOVE_FEINT 364 +#define MOVE_PLUCK 365 +#define MOVE_TAILWIND 366 +#define MOVE_ACUPRESSURE 367 +#define MOVE_METAL_BURST 368 +#define MOVE_U_TURN 369 +#define MOVE_CLOSE_COMBAT 370 +#define MOVE_PAYBACK 371 +#define MOVE_ASSURANCE 372 +#define MOVE_EMBARGO 373 +#define MOVE_FLING 374 +#define MOVE_PSYCHO_SHIFT 375 +#define MOVE_TRUMP_CARD 376 +#define MOVE_HEAL_BLOCK 377 +#define MOVE_WRING_OUT 378 +#define MOVE_POWER_TRICK 379 +#define MOVE_GASTRO_ACID 380 +#define MOVE_LUCKY_CHANT 381 +#define MOVE_ME_FIRST 382 +#define MOVE_COPYCAT 383 +#define MOVE_POWER_SWAP 384 +#define MOVE_GUARD_SWAP 385 +#define MOVE_PUNISHMENT 386 +#define MOVE_LAST_RESORT 387 +#define MOVE_WORRY_SEED 388 +#define MOVE_SUCKER_PUNCH 389 +#define MOVE_TOXIC_SPIKES 390 +#define MOVE_HEART_SWAP 391 +#define MOVE_AQUA_RING 392 +#define MOVE_MAGNET_RISE 393 +#define MOVE_FLARE_BLITZ 394 +#define MOVE_FORCE_PALM 395 +#define MOVE_AURA_SPHERE 396 +#define MOVE_ROCK_POLISH 397 +#define MOVE_POISON_JAB 398 +#define MOVE_DARK_PULSE 399 +#define MOVE_NIGHT_SLASH 400 +#define MOVE_AQUA_TAIL 401 +#define MOVE_SEED_BOMB 402 +#define MOVE_AIR_SLASH 403 +#define MOVE_X_SCISSOR 404 +#define MOVE_BUG_BUZZ 405 +#define MOVE_DRAGON_PULSE 406 +#define MOVE_DRAGON_RUSH 407 +#define MOVE_POWER_GEM 408 +#define MOVE_DRAIN_PUNCH 409 +#define MOVE_VACUUM_WAVE 410 +#define MOVE_FOCUS_BLAST 411 +#define MOVE_ENERGY_BALL 412 +#define MOVE_BRAVE_BIRD 413 +#define MOVE_EARTH_POWER 414 +#define MOVE_SWITCHEROO 415 +#define MOVE_GIGA_IMPACT 416 +#define MOVE_NASTY_PLOT 417 +#define MOVE_BULLET_PUNCH 418 +#define MOVE_AVALANCHE 419 +#define MOVE_ICE_SHARD 420 +#define MOVE_SHADOW_CLAW 421 +#define MOVE_THUNDER_FANG 422 +#define MOVE_ICE_FANG 423 +#define MOVE_FIRE_FANG 424 +#define MOVE_SHADOW_SNEAK 425 +#define MOVE_MUD_BOMB 426 +#define MOVE_PSYCHO_CUT 427 +#define MOVE_ZEN_HEADBUTT 428 +#define MOVE_MIRROR_SHOT 429 +#define MOVE_FLASH_CANNON 430 +#define MOVE_ROCK_CLIMB 431 +#define MOVE_DEFOG 432 +#define MOVE_TRICK_ROOM 433 +#define MOVE_DRACO_METEOR 434 +#define MOVE_DISCHARGE 435 +#define MOVE_LAVA_PLUME 436 +#define MOVE_LEAF_STORM 437 +#define MOVE_POWER_WHIP 438 +#define MOVE_ROCK_WRECKER 439 +#define MOVE_CROSS_POISON 440 +#define MOVE_GUNK_SHOT 441 +#define MOVE_IRON_HEAD 442 +#define MOVE_MAGNET_BOMB 443 +#define MOVE_STONE_EDGE 444 +#define MOVE_CAPTIVATE 445 +#define MOVE_STEALTH_ROCK 446 +#define MOVE_GRASS_KNOT 447 +#define MOVE_CHATTER 448 +#define MOVE_JUDGMENT 449 +#define MOVE_BUG_BITE 450 +#define MOVE_CHARGE_BEAM 451 +#define MOVE_WOOD_HAMMER 452 +#define MOVE_AQUA_JET 453 +#define MOVE_ATTACK_ORDER 454 +#define MOVE_DEFEND_ORDER 455 +#define MOVE_HEAL_ORDER 456 +#define MOVE_HEAD_SMASH 457 +#define MOVE_DOUBLE_HIT 458 +#define MOVE_ROAR_OF_TIME 459 +#define MOVE_SPACIAL_REND 460 +#define MOVE_LUNAR_DANCE 461 +#define MOVE_CRUSH_GRIP 462 +#define MOVE_MAGMA_STORM 463 +#define MOVE_DARK_VOID 464 +#define MOVE_SEED_FLARE 465 +#define MOVE_OMINOUS_WIND 466 +#define MOVE_SHADOW_FORCE 467 + +#endif //POKEDIAMOND_CONSTANTS_MOVES_H diff --git a/include/move_data.h b/include/move_data.h index 975bcf8d..8da864b0 100644 --- a/include/move_data.h +++ b/include/move_data.h @@ -2,5 +2,6 @@ #define POKEDIAMOND_MOVE_DATA_H int FUN_0206AB30(u16 move, u8 ppUp); +u32 FUN_0206AB18(u16 move, u32 attr); #endif //POKEDIAMOND_MOVE_DATA_H -- cgit v1.2.3 From c734347a8fed09aff1aacaad89eb7db831a00a3c Mon Sep 17 00:00:00 2001 From: red031000 Date: Sun, 14 Jun 2020 21:47:39 +0100 Subject: arm7 OS_interrupt --- include/nitro/OS_interrupt_shared.h | 9 +++ include/nitro/OS_thread_shared.h | 116 ++++++++++++++++++++++++++++++++++++ include/nitro/consts_shared.h | 1 + include/nitro/registers_shared.h | 17 ++++++ 4 files changed, 143 insertions(+) create mode 100644 include/nitro/OS_thread_shared.h create mode 100644 include/nitro/registers_shared.h (limited to 'include') diff --git a/include/nitro/OS_interrupt_shared.h b/include/nitro/OS_interrupt_shared.h index 97bed8b1..9b5974e5 100644 --- a/include/nitro/OS_interrupt_shared.h +++ b/include/nitro/OS_interrupt_shared.h @@ -17,4 +17,13 @@ typedef u32 OSIrqMask; +typedef void (*OSIrqFunction) (void); + +typedef struct +{ + void (*func) (void *); + u32 enable; + void* arg; +} OSIrqCallbackInfo; + #endif //POKEDIAMOND_OS_INTERRUPT_SHARED_H diff --git a/include/nitro/OS_thread_shared.h b/include/nitro/OS_thread_shared.h new file mode 100644 index 00000000..28d8a503 --- /dev/null +++ b/include/nitro/OS_thread_shared.h @@ -0,0 +1,116 @@ +#ifndef POKEDIAMOND_OS_THREAD_SHARED_H +#define POKEDIAMOND_OS_THREAD_SHARED_H + +#include "nitro/types.h" + +typedef struct OSiAlarm OSAlarm; + +typedef struct _OSThread OSThread; + +typedef struct _OSThreadQueue OSThreadQueue; +typedef struct _OSThreadLink OSThreadLink; +typedef struct _OSMutexQueue OSMutexQueue; +typedef struct _OSMutexLink OSMutexLink; +typedef struct OSMutex OSMutex; + +struct _OSThreadQueue +{ + OSThread *head; + OSThread *tail; +}; + +struct _OSThreadLink +{ + OSThread *prev; + OSThread *next; +}; + +struct _OSMutexQueue +{ + OSMutex *head; + OSMutex *tail; +}; + +struct _OSMutexLink +{ + OSMutex *next; + OSMutex *prev; +}; + +typedef struct OSThreadInfo { + u16 isNeedRescheduling; + u16 irqDepth; + OSThread* current; + OSThread* list; + void* switchCallback; // type: OSSwitchThreadCallback +} OSThreadInfo; + +typedef enum { + OS_THREAD_STATE_WAITING = 0, + OS_THREAD_STATE_READY = 1, + OS_THREAD_STATE_TERMINATED = 2 +} OSThreadState; + +typedef void (*OSSwitchThreadCallback) (OSThread *from, OSThread *to); + +typedef void (*OSThreadDestructor) (void *); + +struct _OSThread +{ + OSContext context; + OSThreadState state; + OSThread *next; + u32 id; + u32 priority; + void *profiler; + + OSThreadQueue *queue; + OSThreadLink link; + + OSMutex *mutex; + OSMutexQueue mutexQueue; + + u32 stackTop; + u32 stackBottom; + u32 stackWarningOffset; + + OSThreadQueue joinQueue; + + void *specific[3]; + OSAlarm *alarmForSleep; + OSThreadDestructor destructor; + void *userParameter; + + u32 systemErrno; +}; + +extern OSThreadInfo OSi_ThreadInfo; + +static inline OSThreadInfo *OS_GetThreadInfo(void) +{ + return &OSi_ThreadInfo; +} + +static inline BOOL OS_IsThreadRunnable(const OSThread *thread) +{ + return thread->state == OS_THREAD_STATE_READY; +} + +static inline void OS_InitThreadQueue(OSThreadQueue * queue) +{ + queue->head = queue->tail = NULL; +} + +static inline OSThread *OS_GetCurrentThread(void) +{ + return OS_GetThreadInfo()->current; +} + +static inline void OS_SetCurrentThread(OSThread *thread) +{ + OS_GetThreadInfo()->current = thread; +} + +#define OSi_GetCurrentThread() (*OSi_CurrentThreadPtr) + +#endif //POKEDIAMOND_OS_THREAD_SHARED_H diff --git a/include/nitro/consts_shared.h b/include/nitro/consts_shared.h index 151212d1..b6342172 100644 --- a/include/nitro/consts_shared.h +++ b/include/nitro/consts_shared.h @@ -15,6 +15,7 @@ #include "nitro/types.h" #include "nitro/mmap_shared.h" +#include "nitro/registers_shared.h" //Shared Consts diff --git a/include/nitro/registers_shared.h b/include/nitro/registers_shared.h new file mode 100644 index 00000000..60152ab0 --- /dev/null +++ b/include/nitro/registers_shared.h @@ -0,0 +1,17 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +#ifndef POKEDIAMOND_REGISTERS_SHARED_H +#define POKEDIAMOND_REGISTERS_SHARED_H + +#include "nitro/types.h" + +#define reg_OS_IME (*(REGType16v *)0x4000208) +#define reg_OS_IE (*(REGType32v *)0x4000210) +#define reg_OS_IF (*(REGType32v *)0x4000214) + +#endif //POKEDIAMOND_REGISTERS_SHARED_H -- cgit v1.2.3 From 8ce183851366b01c1bda5b2272f95e27ae7ef2fd Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 14 Jun 2020 17:03:39 -0400 Subject: through FUN_02069CF4 --- include/constants/sinnoh_dex.h | 158 +++++++++++++++++++++++++++++++++++++++++ include/party.h | 19 +++++ include/pokemon.h | 9 --- include/proto.h | 1 - 4 files changed, 177 insertions(+), 10 deletions(-) create mode 100644 include/constants/sinnoh_dex.h create mode 100644 include/party.h (limited to 'include') diff --git a/include/constants/sinnoh_dex.h b/include/constants/sinnoh_dex.h new file mode 100644 index 00000000..555ced8b --- /dev/null +++ b/include/constants/sinnoh_dex.h @@ -0,0 +1,158 @@ +#ifndef POKEDIAMOND_CONSTANTS_SINNOH_DEX_H +#define POKEDIAMOND_CONSTANTS_SINNOH_DEX_H + +#define SINNOH_DEX_ARCEUS 0 +#define SINNOH_DEX_TURTWIG 1 +#define SINNOH_DEX_GROTLE 2 +#define SINNOH_DEX_TORTERRA 3 +#define SINNOH_DEX_CHIMCHAR 4 +#define SINNOH_DEX_MONFERNO 5 +#define SINNOH_DEX_INFERNAPE 6 +#define SINNOH_DEX_PIPLUP 7 +#define SINNOH_DEX_PRINPLUP 8 +#define SINNOH_DEX_EMPOLEON 9 +#define SINNOH_DEX_STARLY 10 +#define SINNOH_DEX_STARAVIA 11 +#define SINNOH_DEX_STARAPTOR 12 +#define SINNOH_DEX_BIDOOF 13 +#define SINNOH_DEX_BIBAREL 14 +#define SINNOH_DEX_KRICKETOT 15 +#define SINNOH_DEX_KRICKETUNE 16 +#define SINNOH_DEX_SHINX 17 +#define SINNOH_DEX_LUXIO 18 +#define SINNOH_DEX_LUXRAY 19 +#define SINNOH_DEX_ABRA 20 +#define SINNOH_DEX_KADABRA 21 +#define SINNOH_DEX_ALAKAZAM 22 +#define SINNOH_DEX_MAGIKARP 23 +#define SINNOH_DEX_GYARADOS 24 +#define SINNOH_DEX_BUDEW 25 +#define SINNOH_DEX_ROSELIA 26 +#define SINNOH_DEX_ROSERADE 27 +#define SINNOH_DEX_ZUBAT 28 +#define SINNOH_DEX_GOLBAT 29 +#define SINNOH_DEX_CROBAT 30 +#define SINNOH_DEX_GEODUDE 31 +#define SINNOH_DEX_GRAVELER 32 +#define SINNOH_DEX_GOLEM 33 +#define SINNOH_DEX_ONIX 34 +#define SINNOH_DEX_STEELIX 35 +#define SINNOH_DEX_CRANIDOS 36 +#define SINNOH_DEX_RAMPARDOS 37 +#define SINNOH_DEX_SHIELDON 38 +#define SINNOH_DEX_BASTIODON 39 +#define SINNOH_DEX_MACHOP 40 +#define SINNOH_DEX_MACHOKE 41 +#define SINNOH_DEX_MACHAMP 42 +#define SINNOH_DEX_PSYDUCK 43 +#define SINNOH_DEX_GOLDUCK 44 +#define SINNOH_DEX_BURMY 45 +#define SINNOH_DEX_WORMADAM 46 +#define SINNOH_DEX_MOTHIM 47 +#define SINNOH_DEX_WURMPLE 48 +#define SINNOH_DEX_SILCOON 49 +#define SINNOH_DEX_BEAUTIFLY 50 +#define SINNOH_DEX_CASCOON 51 +#define SINNOH_DEX_DUSTOX 52 +#define SINNOH_DEX_COMBEE 53 +#define SINNOH_DEX_VESPIQUEN 54 +#define SINNOH_DEX_PACHIRISU 55 +#define SINNOH_DEX_BUIZEL 56 +#define SINNOH_DEX_FLOATZEL 57 +#define SINNOH_DEX_CHERUBI 58 +#define SINNOH_DEX_CHERRIM 59 +#define SINNOH_DEX_SHELLOS 60 +#define SINNOH_DEX_GASTRODON 61 +#define SINNOH_DEX_HERACROSS 62 +#define SINNOH_DEX_AIPOM 63 +#define SINNOH_DEX_AMBIPOM 64 +#define SINNOH_DEX_DRIFLOON 65 +#define SINNOH_DEX_DRIFBLIM 66 +#define SINNOH_DEX_BUNEARY 67 +#define SINNOH_DEX_LOPUNNY 68 +#define SINNOH_DEX_GASTLY 69 +#define SINNOH_DEX_HAUNTER 70 +#define SINNOH_DEX_GENGAR 71 +#define SINNOH_DEX_MISDREAVUS 72 +#define SINNOH_DEX_MISMAGIUS 73 +#define SINNOH_DEX_MURKROW 74 +#define SINNOH_DEX_HONCHKROW 75 +#define SINNOH_DEX_GLAMEOW 76 +#define SINNOH_DEX_PURUGLY 77 +#define SINNOH_DEX_GOLDEEN 78 +#define SINNOH_DEX_SEAKING 79 +#define SINNOH_DEX_BARBOACH 80 +#define SINNOH_DEX_WHISCASH 81 +#define SINNOH_DEX_CHINGLING 82 +#define SINNOH_DEX_CHIMECHO 83 +#define SINNOH_DEX_STUNKY 84 +#define SINNOH_DEX_SKUNTANK 85 +#define SINNOH_DEX_MEDITITE 86 +#define SINNOH_DEX_MEDICHAM 87 +#define SINNOH_DEX_BRONZOR 88 +#define SINNOH_DEX_BRONZONG 89 +#define SINNOH_DEX_PONYTA 90 +#define SINNOH_DEX_RAPIDASH 91 +#define SINNOH_DEX_BONSLY 92 +#define SINNOH_DEX_SUDOWOODO 93 +#define SINNOH_DEX_MIME_JR 94 +#define SINNOH_DEX_MR_MIME 95 +#define SINNOH_DEX_HAPPINY 96 +#define SINNOH_DEX_CHANSEY 97 +#define SINNOH_DEX_BLISSEY 98 +#define SINNOH_DEX_CLEFFA 99 +#define SINNOH_DEX_CLEFAIRY 100 +#define SINNOH_DEX_CLEFABLE 101 +#define SINNOH_DEX_CHATOT 102 +#define SINNOH_DEX_PICHU 103 +#define SINNOH_DEX_PIKACHU 104 +#define SINNOH_DEX_RAICHU 105 +#define SINNOH_DEX_HOOTHOOT 106 +#define SINNOH_DEX_NOCTOWL 107 +#define SINNOH_DEX_SPIRITOMB 108 +#define SINNOH_DEX_GIBLE 109 +#define SINNOH_DEX_GABITE 110 +#define SINNOH_DEX_GARCHOMP 111 +#define SINNOH_DEX_MUNCHLAX 112 +#define SINNOH_DEX_SNORLAX 113 +#define SINNOH_DEX_UNOWN 114 +#define SINNOH_DEX_RIOLU 115 +#define SINNOH_DEX_LUCARIO 116 +#define SINNOH_DEX_WOOPER 117 +#define SINNOH_DEX_QUAGSIRE 118 +#define SINNOH_DEX_WINGULL 119 +#define SINNOH_DEX_PELIPPER 120 +#define SINNOH_DEX_GIRAFARIG 121 +#define SINNOH_DEX_HIPPOPOTAS 122 +#define SINNOH_DEX_HIPPOWDON 123 +#define SINNOH_DEX_AZURILL 124 +#define SINNOH_DEX_MARILL 125 +#define SINNOH_DEX_AZUMARILL 126 +#define SINNOH_DEX_SKORUPI 127 +#define SINNOH_DEX_DRAPION 128 +#define SINNOH_DEX_CROAGUNK 129 +#define SINNOH_DEX_TOXICROAK 130 +#define SINNOH_DEX_CARNIVINE 131 +#define SINNOH_DEX_REMORAID 132 +#define SINNOH_DEX_OCTILLERY 133 +#define SINNOH_DEX_FINNEON 134 +#define SINNOH_DEX_LUMINEON 135 +#define SINNOH_DEX_TENTACOOL 136 +#define SINNOH_DEX_TENTACRUEL 137 +#define SINNOH_DEX_FEEBAS 138 +#define SINNOH_DEX_MILOTIC 139 +#define SINNOH_DEX_MANTYKE 140 +#define SINNOH_DEX_MANTINE 141 +#define SINNOH_DEX_SNOVER 142 +#define SINNOH_DEX_ABOMASNOW 143 +#define SINNOH_DEX_SNEASEL 144 +#define SINNOH_DEX_WEAVILE 145 +#define SINNOH_DEX_UXIE 146 +#define SINNOH_DEX_MESPRIT 147 +#define SINNOH_DEX_AZELF 148 +#define SINNOH_DEX_DIALGA 149 +#define SINNOH_DEX_PALKIA 150 +#define SINNOH_DEX_MANAPHY 151 +#define SINNOH_DEX_COUNT SINNOH_DEX_MANAPHY + +#endif //POKEDIAMOND_CONSTANTS_SINNOH_DEX_H diff --git a/include/party.h b/include/party.h new file mode 100644 index 00000000..b6065a3f --- /dev/null +++ b/include/party.h @@ -0,0 +1,19 @@ +#ifndef POKEDIAMOND_PARTY_H +#define POKEDIAMOND_PARTY_H + +#include "pokemon.h" + +#define PARTY_SIZE 6 + +struct PlayerParty +{ + u32 maxCount; + u32 curCount; + struct Pokemon mons[PARTY_SIZE]; +}; + +BOOL PartyHasMon(struct PlayerParty * party_p, u16 species); +int GetPartyCount(struct PlayerParty * party_p); +struct Pokemon * GetPartyMonByIndex(struct PlayerParty * party_p, int idx); + +#endif //POKEDIAMOND_PARTY_H diff --git a/include/pokemon.h b/include/pokemon.h index 83630d39..166a1c7e 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -537,15 +537,6 @@ struct Evolution u16 target; }; -#define PARTY_SIZE 6 - -struct PlayerParty -{ - u32 maxCount; - u32 curCount; - struct Pokemon mons[PARTY_SIZE]; -}; - void ZeroMonData(struct Pokemon * pokemon); void ZeroBoxMonData(struct BoxPokemon * boxmon); u32 SizeOfStructPokemon(void); diff --git a/include/proto.h b/include/proto.h index d9a5ec2a..d26b7750 100644 --- a/include/proto.h +++ b/include/proto.h @@ -17,6 +17,5 @@ u32 GetArceusTypeByPlate(u16 plate); int FUN_02014C3C(u8); void FUN_02014C54(int, int, struct UnkStruct_02069038 *, u8); u32 IsNighttime(void); // is day or night -u32 PartyHasMon(struct PlayerParty *, u16); #endif //POKEDIAMOND_PROTO_H -- cgit v1.2.3 From 925f63ba7497576698c14f0598113294d19b37d9 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 14 Jun 2020 18:09:26 -0400 Subject: through FUN_0206A054 --- include/constants/pokemon.h | 410 ++++++++++++++++++++++++++++++++++++++++++++ include/pokemon.h | 321 +--------------------------------- include/proto.h | 7 +- 3 files changed, 418 insertions(+), 320 deletions(-) create mode 100644 include/constants/pokemon.h (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h new file mode 100644 index 00000000..41ae10fe --- /dev/null +++ b/include/constants/pokemon.h @@ -0,0 +1,410 @@ +#ifndef POKEDIAMOND_CONSTANTS_POKEMON_H +#define POKEDIAMOND_CONSTANTS_POKEMON_H + + +// Pokemon types +#define TYPE_NONE 255 +#define TYPE_NORMAL 0 +#define TYPE_FIGHTING 1 +#define TYPE_FLYING 2 +#define TYPE_POISON 3 +#define TYPE_GROUND 4 +#define TYPE_ROCK 5 +#define TYPE_BUG 6 +#define TYPE_GHOST 7 +#define TYPE_STEEL 8 +#define TYPE_MYSTERY 9 +#define TYPE_FIRE 10 +#define TYPE_WATER 11 +#define TYPE_GRASS 12 +#define TYPE_ELECTRIC 13 +#define TYPE_PSYCHIC 14 +#define TYPE_ICE 15 +#define TYPE_DRAGON 16 +#define TYPE_DARK 17 +#define NUMBER_OF_MON_TYPES 18 + +// Pokemon egg groups +#define EGG_GROUP_NONE 0 +#define EGG_GROUP_MONSTER 1 +#define EGG_GROUP_WATER_1 2 +#define EGG_GROUP_BUG 3 +#define EGG_GROUP_FLYING 4 +#define EGG_GROUP_FIELD 5 +#define EGG_GROUP_FAIRY 6 +#define EGG_GROUP_GRASS 7 +#define EGG_GROUP_HUMAN_LIKE 8 +#define EGG_GROUP_WATER_3 9 +#define EGG_GROUP_MINERAL 10 +#define EGG_GROUP_AMORPHOUS 11 +#define EGG_GROUP_WATER_2 12 +#define EGG_GROUP_DITTO 13 +#define EGG_GROUP_DRAGON 14 +#define EGG_GROUP_UNDISCOVERED 15 + +#define EGG_GROUPS_PER_MON 2 + +// Pokemon natures +#define NATURE_HARDY 0 +#define NATURE_LONELY 1 +#define NATURE_BRAVE 2 +#define NATURE_ADAMANT 3 +#define NATURE_NAUGHTY 4 +#define NATURE_BOLD 5 +#define NATURE_DOCILE 6 +#define NATURE_RELAXED 7 +#define NATURE_IMPISH 8 +#define NATURE_LAX 9 +#define NATURE_TIMID 10 +#define NATURE_HASTY 11 +#define NATURE_SERIOUS 12 +#define NATURE_JOLLY 13 +#define NATURE_NAIVE 14 +#define NATURE_MODEST 15 +#define NATURE_MILD 16 +#define NATURE_QUIET 17 +#define NATURE_BASHFUL 18 +#define NATURE_RASH 19 +#define NATURE_CALM 20 +#define NATURE_GENTLE 21 +#define NATURE_SASSY 22 +#define NATURE_CAREFUL 23 +#define NATURE_QUIRKY 24 + +// Pokemon Stats +#define STAT_HP 0 +#define STAT_ATK 1 +#define STAT_DEF 2 +#define STAT_SPEED 3 +#define STAT_SPATK 4 +#define STAT_SPDEF 5 +#define STAT_ACC 6 // Only in battles. +#define STAT_EVASION 7 // Only in battles. + +#define NUM_EV_STATS NUM_STATS - 1 // excludes HP +#define NUM_BATTLE_STATS NUM_STATS + 2 // includes Accuracy and Evasion + +// Shiny odds +#define SHINY_ODDS 8 // Actual probability is SHINY_ODDS/65536 + + +#define MON_DATA_PERSONALITY 0 +#define MON_DATA_PARTY_LOCK 1 +#define MON_DATA_BOX_LOCK 2 +#define MON_DATA_CHECKSUM_FAILED 3 +#define MON_DATA_CHECKSUM 4 +#define MON_DATA_SPECIES 5 +#define MON_DATA_HELD_ITEM 6 +#define MON_DATA_OTID 7 +#define MON_DATA_EXPERIENCE 8 +#define MON_DATA_FRIENDSHIP 9 +#define MON_DATA_ABILITY 10 +#define MON_DATA_MARKINGS 11 +#define MON_DATA_GAME_LANGUAGE 12 +#define MON_DATA_HP_EV 13 +#define MON_DATA_ATK_EV 14 +#define MON_DATA_DEF_EV 15 +#define MON_DATA_SPEED_EV 16 +#define MON_DATA_SPATK_EV 17 +#define MON_DATA_SPDEF_EV 18 +#define MON_DATA_COOL 19 +#define MON_DATA_BEAUTY 20 +#define MON_DATA_CUTE 21 +#define MON_DATA_SMART 22 +#define MON_DATA_TOUGH 23 +#define MON_DATA_SHEEN 24 +#define MON_DATA_SINNOH_CHAMP_RIBBON 25 +#define MON_DATA_SINNOH_RIBBON_26 26 +#define MON_DATA_SINNOH_RIBBON_27 27 +#define MON_DATA_SINNOH_RIBBON_28 28 +#define MON_DATA_SINNOH_RIBBON_29 29 +#define MON_DATA_SINNOH_RIBBON_30 30 +#define MON_DATA_SINNOH_RIBBON_31 31 +#define MON_DATA_SINNOH_RIBBON_32 32 +#define MON_DATA_SINNOH_RIBBON_33 33 +#define MON_DATA_SINNOH_RIBBON_34 34 +#define MON_DATA_SINNOH_RIBBON_35 35 +#define MON_DATA_SINNOH_RIBBON_36 36 +#define MON_DATA_SINNOH_RIBBON_37 37 +#define MON_DATA_SINNOH_RIBBON_38 38 +#define MON_DATA_SINNOH_RIBBON_39 39 +#define MON_DATA_SINNOH_RIBBON_40 40 +#define MON_DATA_SINNOH_RIBBON_41 41 +#define MON_DATA_SINNOH_RIBBON_42 42 +#define MON_DATA_SINNOH_RIBBON_43 43 +#define MON_DATA_SINNOH_RIBBON_44 44 +#define MON_DATA_SINNOH_RIBBON_45 45 +#define MON_DATA_SINNOH_RIBBON_46 46 +#define MON_DATA_SINNOH_RIBBON_47 47 +#define MON_DATA_SINNOH_RIBBON_48 48 +#define MON_DATA_SINNOH_RIBBON_49 49 +#define MON_DATA_SINNOH_RIBBON_50 50 +#define MON_DATA_SINNOH_RIBBON_51 51 +#define MON_DATA_SINNOH_RIBBON_52 52 +#define MON_DATA_SINNOH_RIBBON_53 53 +#define MON_DATA_MOVE1 54 +#define MON_DATA_MOVE2 55 +#define MON_DATA_MOVE3 56 +#define MON_DATA_MOVE4 57 +#define MON_DATA_MOVE1PP 58 +#define MON_DATA_MOVE2PP 59 +#define MON_DATA_MOVE3PP 60 +#define MON_DATA_MOVE4PP 61 +#define MON_DATA_MOVE1PPUP 62 +#define MON_DATA_MOVE2PPUP 63 +#define MON_DATA_MOVE3PPUP 64 +#define MON_DATA_MOVE4PPUP 65 +#define MON_DATA_MOVE1MAXPP 66 +#define MON_DATA_MOVE2MAXPP 67 +#define MON_DATA_MOVE3MAXPP 68 +#define MON_DATA_MOVE4MAXPP 69 +#define MON_DATA_HP_IV 70 +#define MON_DATA_ATK_IV 71 +#define MON_DATA_DEF_IV 72 +#define MON_DATA_SPEED_IV 73 +#define MON_DATA_SPATK_IV 74 +#define MON_DATA_SPDEF_IV 75 +#define MON_DATA_IS_EGG 76 +#define MON_DATA_HAS_NICKNAME 77 +#define MON_DATA_COOL_RIBBON 78 +#define MON_DATA_HOENN_RIBBON_79 79 +#define MON_DATA_HOENN_RIBBON_80 80 +#define MON_DATA_HOENN_RIBBON_81 81 +#define MON_DATA_HOENN_RIBBON_82 82 +#define MON_DATA_HOENN_RIBBON_83 83 +#define MON_DATA_HOENN_RIBBON_84 84 +#define MON_DATA_HOENN_RIBBON_85 85 +#define MON_DATA_HOENN_RIBBON_86 86 +#define MON_DATA_HOENN_RIBBON_87 87 +#define MON_DATA_HOENN_RIBBON_88 88 +#define MON_DATA_HOENN_RIBBON_89 89 +#define MON_DATA_HOENN_RIBBON_90 90 +#define MON_DATA_HOENN_RIBBON_91 91 +#define MON_DATA_HOENN_RIBBON_92 92 +#define MON_DATA_HOENN_RIBBON_93 93 +#define MON_DATA_HOENN_RIBBON_94 94 +#define MON_DATA_HOENN_RIBBON_95 95 +#define MON_DATA_HOENN_RIBBON_96 96 +#define MON_DATA_HOENN_RIBBON_97 97 +#define MON_DATA_HOENN_RIBBON_98 98 +#define MON_DATA_HOENN_RIBBON_99 99 +#define MON_DATA_HOENN_RIBBON_100 100 +#define MON_DATA_HOENN_RIBBON_101 101 +#define MON_DATA_HOENN_RIBBON_102 102 +#define MON_DATA_HOENN_RIBBON_103 103 +#define MON_DATA_HOENN_RIBBON_104 104 +#define MON_DATA_HOENN_RIBBON_105 105 +#define MON_DATA_HOENN_RIBBON_106 106 +#define MON_DATA_HOENN_RIBBON_107 107 +#define MON_DATA_HOENN_RIBBON_108 108 +#define MON_DATA_HOENN_RIBBON_109 109 +#define MON_DATA_FATEFUL_ENCOUNTER 110 +#define MON_DATA_GENDER 111 +#define MON_DATA_FORME 112 +#define MON_DATA_RESERVED_113 113 // HGSS +#define MON_DATA_RESERVED_114 114 // Plat +#define MON_DATA_UNUSED_115 115 +#define MON_DATA_NICKNAME 116 +#define MON_DATA_NICKNAME_2 117 +#define MON_DATA_NICKNAME_3 118 // ??? +#define MON_DATA_NICKNAME_4 119 // ??? +#define MON_DATA_UNK_120 120 +#define MON_DATA_GAME_VERSION 121 +#define MON_DATA_SINNOH_RIBBON_122 122 +#define MON_DATA_SINNOH_RIBBON_123 123 +#define MON_DATA_SINNOH_RIBBON_124 124 +#define MON_DATA_SINNOH_RIBBON_125 125 +#define MON_DATA_SINNOH_RIBBON_126 126 +#define MON_DATA_SINNOH_RIBBON_127 127 +#define MON_DATA_SINNOH_RIBBON_128 128 +#define MON_DATA_SINNOH_RIBBON_129 129 +#define MON_DATA_SINNOH_RIBBON_130 130 +#define MON_DATA_SINNOH_RIBBON_131 131 +#define MON_DATA_SINNOH_RIBBON_132 132 +#define MON_DATA_SINNOH_RIBBON_133 133 +#define MON_DATA_SINNOH_RIBBON_134 134 +#define MON_DATA_SINNOH_RIBBON_135 135 +#define MON_DATA_SINNOH_RIBBON_136 136 +#define MON_DATA_SINNOH_RIBBON_137 137 +#define MON_DATA_SINNOH_RIBBON_138 138 +#define MON_DATA_SINNOH_RIBBON_139 139 +#define MON_DATA_SINNOH_RIBBON_140 140 +#define MON_DATA_SINNOH_RIBBON_141 141 +#define MON_DATA_SINNOH_RIBBON_142 142 +#define MON_DATA_OT_NAME 143 +#define MON_DATA_OT_NAME_2 144 // ??? +#define MON_DATA_EGG_MET_YEAR 145 +#define MON_DATA_EGG_MET_MONTH 146 +#define MON_DATA_EGG_MET_DAY 147 +#define MON_DATA_MET_YEAR 148 +#define MON_DATA_MET_MONTH 149 +#define MON_DATA_MET_DAY 150 +#define MON_DATA_EGG_MET_LOCATION 151 +#define MON_DATA_MET_LOCATION 152 +#define MON_DATA_POKERUS 153 +#define MON_DATA_POKEBALL 154 +#define MON_DATA_MET_LEVEL 155 +#define MON_DATA_MET_GENDER 156 +#define MON_DATA_ENCOUNTER_TYPE 157 +#define MON_DATA_RESERVED_158 158 // HGSS +#define MON_DATA_STATUS 159 +#define MON_DATA_LEVEL 160 +#define MON_DATA_CAPSULE 161 +#define MON_DATA_HP 162 +#define MON_DATA_MAXHP 163 +#define MON_DATA_ATK 164 +#define MON_DATA_DEF 165 +#define MON_DATA_SPEED 166 +#define MON_DATA_SPATK 167 +#define MON_DATA_SPDEF 168 +#define MON_DATA_SEAL_STRUCT 169 +#define MON_DATA_SEAL_COORDS 170 +#define MON_DATA_SPECIES_EXISTS 171 +#define MON_DATA_SANITY_IS_EGG 172 +#define MON_DATA_SPECIES2 173 +#define MON_DATA_IVS_WORD 174 +#define MON_DATA_UNK_175 175 +#define MON_DATA_TYPE_1 176 +#define MON_DATA_TYPE_2 177 +#define MON_DATA_SPECIES_NAME 178 + +#define MON_RATIO_MALE 0 +#define MON_RATIO_FEMALE 254 +#define MON_RATIO_UNKNOWN 255 + +#define POKEMON_NAME_LENGTH 10 +#define OT_NAME_LENGTH 7 + +enum MonGender +{ + MON_MALE = 0, + MON_FEMALE = 1, + MON_GENDERLESS = 2 +}; + +// TODO: Identify the rest of these +enum BaseStat { + BASE_HP = 0, + BASE_ATK, + BASE_DEF, + BASE_SPEED, + BASE_SPATK, + BASE_SPDEF, + BASE_TYPE1, + BASE_TYPE2, + BASE_CATCH_RATE, + BASE_EXP_YIELD, + BASE_HP_YIELD, + BASE_ATK_YIELD, + BASE_DEF_YIELD, + BASE_SPEED_YIELD, + BASE_SPATK_YIELD, + BASE_SPDEF_YIELD, + BASE_ITEM_1, + BASE_ITEM_2, + BASE_GENDER_RATIO, + BASE_EGG_CYCLES, + BASE_FRIENDSHIP, + BASE_GROWTH_RATE, + BASE_EGG_GROUP_1, + GASE_EGG_GROUP_2, + BASE_ABILITY_1, + BASE_ABILITY_2, + BASE_GREAT_MARSH_RATE, + BASE_COLOR, + BASE_FLIP, + BASE_UNKNOWN_29, + BASE_UNKNOWN_30, + BASE_UNKNOWN_31, + BASE_UNKNOWN_32, +}; + +typedef enum { + EGG = 0, + EVENT = 0, + HATCHED = 0, + PAL_PARK = 0, + TALL_GRASS = 2, + DIALGA_GAME_EVENT = 4, + PALKIA_GAME_EVENT = 4, + CAVE = 5, + HALL_OF_ORIGIN = 5, + SURFING = 7, + FISHING = 7, + BUILDING = 9, + SAFARI_ZONE = 10, + STARTER = 12, + FOSSIL = 12, + GIFT_EEVEE = 12 +} EncounterType; + +typedef enum GameLanguage OriginLanguage; + +typedef enum { + ARCEUS_NORMAL = 0, + ARCEUS_FIST = 1, + ARCEUS_SKY = 2, + ARCEUS_TOXIC = 3, + ARCEUS_EARTH = 4, + ARCEUS_STONE = 5, + ARCEUS_INSECT = 6, + ARCEUS_SPOOKY = 7, + ARCEUS_IRON = 8, + ARCEUS_FLAME = 9, + ARCEUS_SPLASH = 10, + ARCEUS_MEADOW = 11, + ARCEUS_ZAP = 12, + ARCEUS_MIND = 13, + ARCEUS_ICICLE = 14, + ARCEUS_DRACO = 15, + ARCEUS_DREAD = 16, + BURMY_PLANT = 0, + BURMY_SANDY = 1, + BURMY_TRASH = 2, + DEOXYS_NORMAL = 0, + DEOXYS_ATTACK = 1, + DEOXYS_DEFENSE = 2, + DEOXYS_SPEED = 3, + GIRATINA_ALTERED = 0, + GIRATINA_ORIGIN = 1, + ROTOM_NORMAL = 0, + ROTOM_HEAT = 1, + ROTOM_WASH = 2, + ROTOM_FROST = 3, + ROTOM_FAN = 4, + ROTOM_MOW = 5, + SHAYMIN_LAND = 0, + SHAYMIN_SKY = 1, + SHELLOS_WEST = 0, + SHELLOS_EAST = 1, + UNOWN_A = 0, + UNOWN_B = 1, + UNOWN_C = 2, + UNOWN_D = 3, + UNOWN_E = 4, + UNOWN_F = 5, + UNOWN_G = 6, + UNOWN_H = 7, + UNOWN_I = 8, + UNOWN_J = 9, + UNOWN_K = 10, + UNOWN_L = 11, + UNOWN_M = 12, + UNOWN_N = 13, + UNOWN_O = 14, + UNOWN_P = 15, + UNOWN_Q = 16, + UNOWN_R = 17, + UNOWN_S = 18, + UNOWN_T = 19, + UNOWN_U = 20, + UNOWN_V = 21, + UNOWN_W = 22, + UNOWN_X = 23, + UNOWN_Y = 24, + UNOWN_Z = 25, + UNOWN_EXCLAMATION_MARK = 26, + UNOWN_QUESTION_MARK = 27 +} AlternateForms; + +#endif //POKEDIAMOND_CONSTANTS_POKEMON_H diff --git a/include/pokemon.h b/include/pokemon.h index 166a1c7e..7b990263 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -7,237 +7,7 @@ #include "constants/species.h" #include "seals.h" - -#define MON_DATA_PERSONALITY 0 -#define MON_DATA_PARTY_LOCK 1 -#define MON_DATA_BOX_LOCK 2 -#define MON_DATA_CHECKSUM_FAILED 3 -#define MON_DATA_CHECKSUM 4 -#define MON_DATA_SPECIES 5 -#define MON_DATA_HELD_ITEM 6 -#define MON_DATA_OTID 7 -#define MON_DATA_EXPERIENCE 8 -#define MON_DATA_FRIENDSHIP 9 -#define MON_DATA_ABILITY 10 -#define MON_DATA_MARKINGS 11 -#define MON_DATA_GAME_LANGUAGE 12 -#define MON_DATA_HP_EV 13 -#define MON_DATA_ATK_EV 14 -#define MON_DATA_DEF_EV 15 -#define MON_DATA_SPEED_EV 16 -#define MON_DATA_SPATK_EV 17 -#define MON_DATA_SPDEF_EV 18 -#define MON_DATA_COOL 19 -#define MON_DATA_BEAUTY 20 -#define MON_DATA_CUTE 21 -#define MON_DATA_SMART 22 -#define MON_DATA_TOUGH 23 -#define MON_DATA_SHEEN 24 -#define MON_DATA_SINNOH_CHAMP_RIBBON 25 -#define MON_DATA_SINNOH_RIBBON_26 26 -#define MON_DATA_SINNOH_RIBBON_27 27 -#define MON_DATA_SINNOH_RIBBON_28 28 -#define MON_DATA_SINNOH_RIBBON_29 29 -#define MON_DATA_SINNOH_RIBBON_30 30 -#define MON_DATA_SINNOH_RIBBON_31 31 -#define MON_DATA_SINNOH_RIBBON_32 32 -#define MON_DATA_SINNOH_RIBBON_33 33 -#define MON_DATA_SINNOH_RIBBON_34 34 -#define MON_DATA_SINNOH_RIBBON_35 35 -#define MON_DATA_SINNOH_RIBBON_36 36 -#define MON_DATA_SINNOH_RIBBON_37 37 -#define MON_DATA_SINNOH_RIBBON_38 38 -#define MON_DATA_SINNOH_RIBBON_39 39 -#define MON_DATA_SINNOH_RIBBON_40 40 -#define MON_DATA_SINNOH_RIBBON_41 41 -#define MON_DATA_SINNOH_RIBBON_42 42 -#define MON_DATA_SINNOH_RIBBON_43 43 -#define MON_DATA_SINNOH_RIBBON_44 44 -#define MON_DATA_SINNOH_RIBBON_45 45 -#define MON_DATA_SINNOH_RIBBON_46 46 -#define MON_DATA_SINNOH_RIBBON_47 47 -#define MON_DATA_SINNOH_RIBBON_48 48 -#define MON_DATA_SINNOH_RIBBON_49 49 -#define MON_DATA_SINNOH_RIBBON_50 50 -#define MON_DATA_SINNOH_RIBBON_51 51 -#define MON_DATA_SINNOH_RIBBON_52 52 -#define MON_DATA_SINNOH_RIBBON_53 53 -#define MON_DATA_MOVE1 54 -#define MON_DATA_MOVE2 55 -#define MON_DATA_MOVE3 56 -#define MON_DATA_MOVE4 57 -#define MON_DATA_MOVE1PP 58 -#define MON_DATA_MOVE2PP 59 -#define MON_DATA_MOVE3PP 60 -#define MON_DATA_MOVE4PP 61 -#define MON_DATA_MOVE1PPUP 62 -#define MON_DATA_MOVE2PPUP 63 -#define MON_DATA_MOVE3PPUP 64 -#define MON_DATA_MOVE4PPUP 65 -#define MON_DATA_MOVE1MAXPP 66 -#define MON_DATA_MOVE2MAXPP 67 -#define MON_DATA_MOVE3MAXPP 68 -#define MON_DATA_MOVE4MAXPP 69 -#define MON_DATA_HP_IV 70 -#define MON_DATA_ATK_IV 71 -#define MON_DATA_DEF_IV 72 -#define MON_DATA_SPEED_IV 73 -#define MON_DATA_SPATK_IV 74 -#define MON_DATA_SPDEF_IV 75 -#define MON_DATA_IS_EGG 76 -#define MON_DATA_HAS_NICKNAME 77 -#define MON_DATA_COOL_RIBBON 78 -#define MON_DATA_HOENN_RIBBON_79 79 -#define MON_DATA_HOENN_RIBBON_80 80 -#define MON_DATA_HOENN_RIBBON_81 81 -#define MON_DATA_HOENN_RIBBON_82 82 -#define MON_DATA_HOENN_RIBBON_83 83 -#define MON_DATA_HOENN_RIBBON_84 84 -#define MON_DATA_HOENN_RIBBON_85 85 -#define MON_DATA_HOENN_RIBBON_86 86 -#define MON_DATA_HOENN_RIBBON_87 87 -#define MON_DATA_HOENN_RIBBON_88 88 -#define MON_DATA_HOENN_RIBBON_89 89 -#define MON_DATA_HOENN_RIBBON_90 90 -#define MON_DATA_HOENN_RIBBON_91 91 -#define MON_DATA_HOENN_RIBBON_92 92 -#define MON_DATA_HOENN_RIBBON_93 93 -#define MON_DATA_HOENN_RIBBON_94 94 -#define MON_DATA_HOENN_RIBBON_95 95 -#define MON_DATA_HOENN_RIBBON_96 96 -#define MON_DATA_HOENN_RIBBON_97 97 -#define MON_DATA_HOENN_RIBBON_98 98 -#define MON_DATA_HOENN_RIBBON_99 99 -#define MON_DATA_HOENN_RIBBON_100 100 -#define MON_DATA_HOENN_RIBBON_101 101 -#define MON_DATA_HOENN_RIBBON_102 102 -#define MON_DATA_HOENN_RIBBON_103 103 -#define MON_DATA_HOENN_RIBBON_104 104 -#define MON_DATA_HOENN_RIBBON_105 105 -#define MON_DATA_HOENN_RIBBON_106 106 -#define MON_DATA_HOENN_RIBBON_107 107 -#define MON_DATA_HOENN_RIBBON_108 108 -#define MON_DATA_HOENN_RIBBON_109 109 -#define MON_DATA_FATEFUL_ENCOUNTER 110 -#define MON_DATA_GENDER 111 -#define MON_DATA_FORME 112 -#define MON_DATA_RESERVED_113 113 // HGSS -#define MON_DATA_RESERVED_114 114 // Plat -#define MON_DATA_UNUSED_115 115 -#define MON_DATA_NICKNAME 116 -#define MON_DATA_NICKNAME_2 117 -#define MON_DATA_NICKNAME_3 118 // ??? -#define MON_DATA_NICKNAME_4 119 // ??? -#define MON_DATA_UNK_120 120 -#define MON_DATA_GAME_VERSION 121 -#define MON_DATA_SINNOH_RIBBON_122 122 -#define MON_DATA_SINNOH_RIBBON_123 123 -#define MON_DATA_SINNOH_RIBBON_124 124 -#define MON_DATA_SINNOH_RIBBON_125 125 -#define MON_DATA_SINNOH_RIBBON_126 126 -#define MON_DATA_SINNOH_RIBBON_127 127 -#define MON_DATA_SINNOH_RIBBON_128 128 -#define MON_DATA_SINNOH_RIBBON_129 129 -#define MON_DATA_SINNOH_RIBBON_130 130 -#define MON_DATA_SINNOH_RIBBON_131 131 -#define MON_DATA_SINNOH_RIBBON_132 132 -#define MON_DATA_SINNOH_RIBBON_133 133 -#define MON_DATA_SINNOH_RIBBON_134 134 -#define MON_DATA_SINNOH_RIBBON_135 135 -#define MON_DATA_SINNOH_RIBBON_136 136 -#define MON_DATA_SINNOH_RIBBON_137 137 -#define MON_DATA_SINNOH_RIBBON_138 138 -#define MON_DATA_SINNOH_RIBBON_139 139 -#define MON_DATA_SINNOH_RIBBON_140 140 -#define MON_DATA_SINNOH_RIBBON_141 141 -#define MON_DATA_SINNOH_RIBBON_142 142 -#define MON_DATA_OT_NAME 143 -#define MON_DATA_OT_NAME_2 144 // ??? -#define MON_DATA_EGG_MET_YEAR 145 -#define MON_DATA_EGG_MET_MONTH 146 -#define MON_DATA_EGG_MET_DAY 147 -#define MON_DATA_MET_YEAR 148 -#define MON_DATA_MET_MONTH 149 -#define MON_DATA_MET_DAY 150 -#define MON_DATA_EGG_MET_LOCATION 151 -#define MON_DATA_MET_LOCATION 152 -#define MON_DATA_POKERUS 153 -#define MON_DATA_POKEBALL 154 -#define MON_DATA_MET_LEVEL 155 -#define MON_DATA_MET_GENDER 156 -#define MON_DATA_ENCOUNTER_TYPE 157 -#define MON_DATA_RESERVED_158 158 // HGSS -#define MON_DATA_STATUS 159 -#define MON_DATA_LEVEL 160 -#define MON_DATA_CAPSULE 161 -#define MON_DATA_HP 162 -#define MON_DATA_MAXHP 163 -#define MON_DATA_ATK 164 -#define MON_DATA_DEF 165 -#define MON_DATA_SPEED 166 -#define MON_DATA_SPATK 167 -#define MON_DATA_SPDEF 168 -#define MON_DATA_SEAL_STRUCT 169 -#define MON_DATA_SEAL_COORDS 170 -#define MON_DATA_SPECIES_EXISTS 171 -#define MON_DATA_SANITY_IS_EGG 172 -#define MON_DATA_SPECIES2 173 -#define MON_DATA_IVS_WORD 174 -#define MON_DATA_UNK_175 175 -#define MON_DATA_TYPE_1 176 -#define MON_DATA_TYPE_2 177 -#define MON_DATA_SPECIES_NAME 178 - -#define MON_RATIO_MALE 0 -#define MON_RATIO_FEMALE 254 -#define MON_RATIO_UNKNOWN 255 - -#define POKEMON_NAME_LENGTH 10 -#define OT_NAME_LENGTH 7 - -enum MonGender -{ - MON_MALE = 0, - MON_FEMALE = 1, - MON_GENDERLESS = 2 -}; - -// TODO: Identify the rest of these -enum BaseStat { - BASE_HP = 0, - BASE_ATK, - BASE_DEF, - BASE_SPEED, - BASE_SPATK, - BASE_SPDEF, - BASE_TYPE1, - BASE_TYPE2, - BASE_CATCH_RATE, - BASE_EXP_YIELD, - BASE_HP_YIELD, - BASE_ATK_YIELD, - BASE_DEF_YIELD, - BASE_SPEED_YIELD, - BASE_SPATK_YIELD, - BASE_SPDEF_YIELD, - BASE_ITEM_1, - BASE_ITEM_2, - BASE_GENDER_RATIO, - BASE_EGG_CYCLES, - BASE_FRIENDSHIP, - BASE_GROWTH_RATE, - BASE_EGG_GROUP_1, - GASE_EGG_GROUP_2, - BASE_ABILITY_1, - BASE_ABILITY_2, - BASE_GREAT_MARSH_RATE, - BASE_COLOR, - BASE_FLIP, - BASE_UNKNOWN_29, - BASE_UNKNOWN_30, - BASE_UNKNOWN_31, - BASE_UNKNOWN_32, -}; +#include "constants/pokemon.h" struct BaseStats { /* 0x00 */ u8 hp; @@ -274,94 +44,6 @@ struct BaseStats { /* 0x28 */ u32 unk28; }; -typedef enum { - EGG = 0, - EVENT = 0, - HATCHED = 0, - PAL_PARK = 0, - TALL_GRASS = 2, - DIALGA_GAME_EVENT = 4, - PALKIA_GAME_EVENT = 4, - CAVE = 5, - HALL_OF_ORIGIN = 5, - SURFING = 7, - FISHING = 7, - BUILDING = 9, - SAFARI_ZONE = 10, - STARTER = 12, - FOSSIL = 12, - GIFT_EEVEE = 12 -} EncounterType; - -typedef enum GameLanguage OriginLanguage; - -typedef enum { - ARCEUS_NORMAL = 0, - ARCEUS_FIST = 1, - ARCEUS_SKY = 2, - ARCEUS_TOXIC = 3, - ARCEUS_EARTH = 4, - ARCEUS_STONE = 5, - ARCEUS_INSECT = 6, - ARCEUS_SPOOKY = 7, - ARCEUS_IRON = 8, - ARCEUS_FLAME = 9, - ARCEUS_SPLASH = 10, - ARCEUS_MEADOW = 11, - ARCEUS_ZAP = 12, - ARCEUS_MIND = 13, - ARCEUS_ICICLE = 14, - ARCEUS_DRACO = 15, - ARCEUS_DREAD = 16, - BURMY_PLANT = 0, - BURMY_SANDY = 1, - BURMY_TRASH = 2, - DEOXYS_NORMAL = 0, - DEOXYS_ATTACK = 1, - DEOXYS_DEFENSE = 2, - DEOXYS_SPEED = 3, - GIRATINA_ALTERED = 0, - GIRATINA_ORIGIN = 1, - ROTOM_NORMAL = 0, - ROTOM_HEAT = 1, - ROTOM_WASH = 2, - ROTOM_FROST = 3, - ROTOM_FAN = 4, - ROTOM_MOW = 5, - SHAYMIN_LAND = 0, - SHAYMIN_SKY = 1, - SHELLOS_WEST = 0, - SHELLOS_EAST = 1, - UNOWN_A = 0, - UNOWN_B = 1, - UNOWN_C = 2, - UNOWN_D = 3, - UNOWN_E = 4, - UNOWN_F = 5, - UNOWN_G = 6, - UNOWN_H = 7, - UNOWN_I = 8, - UNOWN_J = 9, - UNOWN_K = 10, - UNOWN_L = 11, - UNOWN_M = 12, - UNOWN_N = 13, - UNOWN_O = 14, - UNOWN_P = 15, - UNOWN_Q = 16, - UNOWN_R = 17, - UNOWN_S = 18, - UNOWN_T = 19, - UNOWN_U = 20, - UNOWN_V = 21, - UNOWN_W = 22, - UNOWN_X = 23, - UNOWN_Y = 24, - UNOWN_Z = 25, - UNOWN_EXCLAMATION_MARK = 26, - UNOWN_QUESTION_MARK = 27 -} AlternateForms; - typedef enum EvoMethod { EVO_NONE = 0, @@ -592,6 +274,7 @@ void FUN_02068C00(struct SomeDrawPokemonStruct * spC, int species, u8 gender, u8 u8 FUN_02068E14(struct Pokemon * pokemon, u32 a1); u8 FUN_02068E1C(struct BoxPokemon * boxmon, u32 a1); u8 FUN_02068E88(int species, u8 gender, u32 a2, u8 forme, u32 pid); +u32 GetArceusTypeByHeldItemEffect(u16 plate); int FUN_0206AA30(int a0); #endif //POKEDIAMOND_POKEMON_H diff --git a/include/proto.h b/include/proto.h index d26b7750..8c35cca5 100644 --- a/include/proto.h +++ b/include/proto.h @@ -6,6 +6,7 @@ // Declare these here so that we don't have to include pokemon.h struct UnkStruct_02069038; struct PlayerParty; +struct BoxPokemon; u16 * FUN_0200AA50(u16 species, u32 heap_id); void FUN_02021A74(u16 * dest, u16 * src); @@ -13,9 +14,13 @@ void FUN_02021A20(void * ptr); void FUN_02021E28(u16 * dest, u16 * src); void FUN_02021EF0(const u16 * src, u16 * dest, u32 count); u32 FUN_0206E7B8(u16 item, u32 a1, u32 a2); -u32 GetArceusTypeByPlate(u16 plate); int FUN_02014C3C(u8); void FUN_02014C54(int, int, struct UnkStruct_02069038 *, u8); u32 IsNighttime(void); // is day or night +int FUN_02005F14(int); +void FUN_02005E80(int); +void FUN_02005E90(int, int, int, int); +void FUN_020056AC(int, int, int, int, int); +void FUN_020808AC(struct BoxPokemon *, int, int, int, int); #endif //POKEDIAMOND_PROTO_H -- cgit v1.2.3 From 62e926d5217f1f4cd8efd610e7d38374535836e1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 14 Jun 2020 21:18:07 -0400 Subject: through FUN_0206A998 --- include/global.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/global.h b/include/global.h index 35d0c3aa..67744d42 100644 --- a/include/global.h +++ b/include/global.h @@ -5,6 +5,8 @@ #include "function_target.h" #include "nitro.h" +#define NELEMS(a) (sizeof(a) / sizeof(*(a))) + enum GameVersion { VERSION_SAPPHIRE = 1, VERSION_RUBY = 2, -- cgit v1.2.3 From c2f8c12c6f92c2e43e117c9a156ebe58120e0a80 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 15 Jun 2020 08:55:45 -0400 Subject: Finish pokemon.c --- include/proto.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/proto.h b/include/proto.h index 8c35cca5..24ddff07 100644 --- a/include/proto.h +++ b/include/proto.h @@ -7,6 +7,15 @@ struct UnkStruct_02069038; struct PlayerParty; struct BoxPokemon; +struct SaveBlock2; +struct String +{ + u16 len; + u16 pos; + u32 magic; + u16 unk8; + u16 data[0]; +}; u16 * FUN_0200AA50(u16 species, u32 heap_id); void FUN_02021A74(u16 * dest, u16 * src); @@ -23,4 +32,11 @@ void FUN_02005E90(int, int, int, int); void FUN_020056AC(int, int, int, int, int); void FUN_020808AC(struct BoxPokemon *, int, int, int, int); +struct String * FUN_020239A0(struct SaveBlock2 *, u32 heap_id); +u32 FUN_020239BC(struct SaveBlock2 *); +u32 FUN_020239CC(struct SaveBlock2 *); +struct String * FUN_020219F4(u32 count, u32 heap_id); +int FUN_02021CE0(struct String *, struct String *); +int FUN_0206AE00(int x); + #endif //POKEDIAMOND_PROTO_H -- cgit v1.2.3 From 9e33176367974197195a9c9f8e58ede7569d665d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 15 Jun 2020 10:14:29 -0400 Subject: Resolve compiler warnings --- include/constants/global.h | 7 ++++++ include/constants/pokemon.h | 3 --- include/global.h | 1 + include/pokemon.h | 53 +++++++++++++++++++++++++++++++++++++++++++++ include/proto.h | 21 +----------------- include/save_block_2.h | 18 +++++++++++++++ include/string16.h | 17 +++++++++++++++ 7 files changed, 97 insertions(+), 23 deletions(-) create mode 100644 include/constants/global.h create mode 100644 include/save_block_2.h create mode 100644 include/string16.h (limited to 'include') diff --git a/include/constants/global.h b/include/constants/global.h new file mode 100644 index 00000000..28d4b206 --- /dev/null +++ b/include/constants/global.h @@ -0,0 +1,7 @@ +#ifndef POKEDIAMOND_CONSTANTS_GLOBAL_H +#define POKEDIAMOND_CONSTANTS_GLOBAL_H + +#define POKEMON_NAME_LENGTH 10 +#define OT_NAME_LENGTH 7 + +#endif //POKEDIAMOND_CONSTANTS_GLOBAL_H diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 41ae10fe..9accbad1 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -272,9 +272,6 @@ #define MON_RATIO_FEMALE 254 #define MON_RATIO_UNKNOWN 255 -#define POKEMON_NAME_LENGTH 10 -#define OT_NAME_LENGTH 7 - enum MonGender { MON_MALE = 0, diff --git a/include/global.h b/include/global.h index 67744d42..2574c437 100644 --- a/include/global.h +++ b/include/global.h @@ -4,6 +4,7 @@ #include "config.h" #include "function_target.h" #include "nitro.h" +#include "constants/global.h" #define NELEMS(a) (sizeof(a) / sizeof(*(a))) diff --git a/include/pokemon.h b/include/pokemon.h index 7b990263..8e2eec3d 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -8,6 +8,8 @@ #include "constants/species.h" #include "seals.h" #include "constants/pokemon.h" +#include "string16.h" +#include "save_block_2.h" struct BaseStats { /* 0x00 */ u8 hp; @@ -180,6 +182,8 @@ struct Pokemon { /* 0x088 */ struct PartyPokemon party; }; // size: 0xEC +#include "party.h" + struct SomeDrawPokemonStruct { u16 unk0; @@ -276,5 +280,54 @@ u8 FUN_02068E1C(struct BoxPokemon * boxmon, u32 a1); u8 FUN_02068E88(int species, u8 gender, u32 a2, u8 forme, u32 pid); u32 GetArceusTypeByHeldItemEffect(u16 plate); int FUN_0206AA30(int a0); +void FUN_02068B68(struct SomeDrawPokemonStruct * spC, struct Pokemon * pokemon, u8 sp10); +void FUN_02068FE0(struct SomeDrawPokemonStruct * a0, u16 a1, int a2); +void FUN_02069010(void * dest, int a1); +void FUN_02069038(u32 a0, u32 a1, u32 a2, s32 a3, u32 a4, u32 a5, u32 a6); +void FUN_020690AC(struct SomeDrawPokemonStruct * a0, u32 a1); +u32 FUN_020690C4(void); +u32 FUN_020690C8(void); +u8 FUN_020690CC(struct Pokemon * pokemon); +struct BoxPokemon * FUN_020690E4(struct Pokemon * pokemon); +u16 GetMonEvolution(struct PlayerParty * party, struct Pokemon * pokemon, u32 context, u32 usedItem, u32 * method_ret); +u16 ReadFromPersonalPmsNarc(u16 species); +u16 GetEggSpecies(u16 species); +BOOL FUN_020690E8(struct Pokemon * pokemon); +u32 FUN_02069698(struct Pokemon * pokemon, u16 move); +void FUN_02069708(struct Pokemon * pokemon, u16 move); +void FUN_02069718(struct BoxPokemon * boxmon, u16 move); +void FUN_020697CC(struct Pokemon * pokemon, u16 move, u8 slot); +u32 FUN_02069818(struct Pokemon * pokemon, u32 * r5, u16 * sp0); +void FUN_020698E0(struct Pokemon * pokemon, int slot1, int slot2); +void FUN_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2); +void FUN_020699A4(struct Pokemon * pokemon, u32 slot); +void FUN_02069A64(struct BoxPokemon * src, struct Pokemon * dest); +u8 FUN_02069AEC(struct PlayerParty * party); +u16 FUN_02069B40(u16 species); +u16 FUN_02069B60(u16 sinnoh_dex); +void FUN_02069B88(struct Pokemon * src, struct Pokemon * dest); +void FUN_02069BA0(struct Pokemon * src, struct BoxPokemon * dest); +void FUN_02069BB4(struct BoxPokemon * src, struct BoxPokemon * dest); +s8 FUN_02069BC8(struct Pokemon * pokemon, int flavor); +int FUN_02069BFC(u16 species, u32 forme, u16 * dest); +void FUN_02069C4C(struct PlayerParty * party); +void FUN_02069D50(struct PlayerParty * party, int r5); +void FUN_02069DC8(struct PlayerParty * party); +BOOL FUN_02069E74(struct Pokemon * pokemon); +BOOL FUN_02069E94(struct Pokemon * pokemon); +void FUN_02069EC4(struct Pokemon * pokemon); +void FUN_02069FB0(u32 r7, u32 r5, u32 r4, u32 r6, u32 sp18, u32 sp1C, u32 sp20); +void FUN_0206A014(struct Pokemon * pokemon, u32 a1, u32 pokeball, u32 a3, u32 encounterType, u32 a5); +void FUN_0206A094(struct Pokemon * pokemon, u32 a1, u32 a2); +BOOL FUN_0206A13C(struct Pokemon * pokemon, u32 a1); +void FUN_0206A1C4(struct Pokemon * pokemon); +void FUN_0206A23C(struct Pokemon * r5, u32 personality); +int LowestFlagNo(u32 mask); +BOOL IsPokemonLegendaryOrMythical(u16 species); +u16 GetLegendaryMon(u32 idx); +BOOL FUN_0206A998(struct Pokemon * pokemon); +BOOL FUN_0206A9AC(struct BoxPokemon * boxmon, struct SaveBlock2 * sb2, u32 heap_id); +void FUN_0206AA84(struct Pokemon * pokemon); +void FUN_0206AAB4(struct BoxPokemon * boxmon); #endif //POKEDIAMOND_POKEMON_H diff --git a/include/proto.h b/include/proto.h index 24ddff07..6f022d90 100644 --- a/include/proto.h +++ b/include/proto.h @@ -3,19 +3,7 @@ // For homeless function declarations -// Declare these here so that we don't have to include pokemon.h -struct UnkStruct_02069038; -struct PlayerParty; -struct BoxPokemon; -struct SaveBlock2; -struct String -{ - u16 len; - u16 pos; - u32 magic; - u16 unk8; - u16 data[0]; -}; +#include "pokemon.h" // for struct definitions u16 * FUN_0200AA50(u16 species, u32 heap_id); void FUN_02021A74(u16 * dest, u16 * src); @@ -32,11 +20,4 @@ void FUN_02005E90(int, int, int, int); void FUN_020056AC(int, int, int, int, int); void FUN_020808AC(struct BoxPokemon *, int, int, int, int); -struct String * FUN_020239A0(struct SaveBlock2 *, u32 heap_id); -u32 FUN_020239BC(struct SaveBlock2 *); -u32 FUN_020239CC(struct SaveBlock2 *); -struct String * FUN_020219F4(u32 count, u32 heap_id); -int FUN_02021CE0(struct String *, struct String *); -int FUN_0206AE00(int x); - #endif //POKEDIAMOND_PROTO_H diff --git a/include/save_block_2.h b/include/save_block_2.h new file mode 100644 index 00000000..38e11de4 --- /dev/null +++ b/include/save_block_2.h @@ -0,0 +1,18 @@ +#ifndef POKEDIAMOND_SAVE_BLOCK_2_H +#define POKEDIAMOND_SAVE_BLOCK_2_H + +struct SaveBlock2 +{ + u16 playerName[OT_NAME_LENGTH + 1]; + u32 playerId; + u8 filler_14[4]; + u8 gender; + u8 padding[3]; + // TODO: finish this struct +}; + +struct String * FUN_020239A0(struct SaveBlock2 *, u32 heap_id); +u32 FUN_020239BC(struct SaveBlock2 *); +u32 FUN_020239CC(struct SaveBlock2 *); + +#endif //POKEDIAMOND_SAVE_BLOCK_2_H diff --git a/include/string16.h b/include/string16.h new file mode 100644 index 00000000..7092c641 --- /dev/null +++ b/include/string16.h @@ -0,0 +1,17 @@ +#ifndef POKEDIAMOND_STRING16_H +#define POKEDIAMOND_STRING16_H + +struct String +{ + u16 len; + u16 pos; + u32 magic; + u16 unk8; + u16 data[1]; +}; + +struct String * FUN_020219F4(u32 count, u32 heap_id); +int FUN_02021CE0(struct String *, struct String *); +int FUN_0206AE00(int x); + +#endif //POKEDIAMOND_STRING16_H -- cgit v1.2.3 From 55f80230851c779c39c75e50e63686b2e515c8c1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 15 Jun 2020 12:52:32 -0400 Subject: Decompile party.s --- include/MWC_string.h | 8 ++++++++ include/global.h | 2 ++ include/party.h | 19 ++++++++++--------- include/pokemon.h | 12 ++++++++++-- include/proto.h | 1 + 5 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 include/MWC_string.h (limited to 'include') diff --git a/include/MWC_string.h b/include/MWC_string.h new file mode 100644 index 00000000..d2980fb6 --- /dev/null +++ b/include/MWC_string.h @@ -0,0 +1,8 @@ +#ifndef GUARD_MWC_STRING_H +#define GUARD_MWC_STRING_H + +#include "nitro/types.h" + +void * memset(void *, int, u32); + +#endif //GUARD_MWC_STRING_H diff --git a/include/global.h b/include/global.h index 2574c437..88ca58ff 100644 --- a/include/global.h +++ b/include/global.h @@ -2,6 +2,8 @@ #define GUARD_GLOBAL_H #include "config.h" + +#include "MWC_string.h" #include "function_target.h" #include "nitro.h" #include "constants/global.h" diff --git a/include/party.h b/include/party.h index b6065a3f..eca62239 100644 --- a/include/party.h +++ b/include/party.h @@ -3,17 +3,18 @@ #include "pokemon.h" -#define PARTY_SIZE 6 - -struct PlayerParty -{ - u32 maxCount; - u32 curCount; - struct Pokemon mons[PARTY_SIZE]; -}; - BOOL PartyHasMon(struct PlayerParty * party_p, u16 species); int GetPartyCount(struct PlayerParty * party_p); struct Pokemon * GetPartyMonByIndex(struct PlayerParty * party_p, int idx); +u32 FUN_0206B8A4(void); +struct PlayerParty * FUN_0206B8AC(u32 heap_id); +void FUN_0206B8C0(struct PlayerParty * party); +void FUN_0206B8CC(struct PlayerParty * party, int count); +BOOL FUN_0206B900(struct PlayerParty * party, struct Pokemon * pokemon); +BOOL FUN_0206B938(struct PlayerParty * party, int pos); +void FUN_0206B9DC(struct PlayerParty * party, int pos, struct Pokemon * pokemon); +BOOL FUN_0206BA38(struct PlayerParty * party, int pos1, int pos2); +void FUN_0206BAD0(struct PlayerParty * src, struct PlayerParty * dest); +struct PlayerParty * FUN_0206BB1C(void * ptr); #endif //POKEDIAMOND_PARTY_H diff --git a/include/pokemon.h b/include/pokemon.h index 8e2eec3d..01a03763 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -182,8 +182,6 @@ struct Pokemon { /* 0x088 */ struct PartyPokemon party; }; // size: 0xEC -#include "party.h" - struct SomeDrawPokemonStruct { u16 unk0; @@ -223,6 +221,15 @@ struct Evolution u16 target; }; +#define PARTY_SIZE 6 + +struct PlayerParty +{ + int maxCount; + int curCount; + struct Pokemon mons[PARTY_SIZE]; +}; + void ZeroMonData(struct Pokemon * pokemon); void ZeroBoxMonData(struct BoxPokemon * boxmon); u32 SizeOfStructPokemon(void); @@ -289,6 +296,7 @@ u32 FUN_020690C4(void); u32 FUN_020690C8(void); u8 FUN_020690CC(struct Pokemon * pokemon); struct BoxPokemon * FUN_020690E4(struct Pokemon * pokemon); + u16 GetMonEvolution(struct PlayerParty * party, struct Pokemon * pokemon, u32 context, u32 usedItem, u32 * method_ret); u16 ReadFromPersonalPmsNarc(u16 species); u16 GetEggSpecies(u16 species); diff --git a/include/proto.h b/include/proto.h index 6f022d90..2e7d19b3 100644 --- a/include/proto.h +++ b/include/proto.h @@ -19,5 +19,6 @@ void FUN_02005E80(int); void FUN_02005E90(int, int, int, int); void FUN_020056AC(int, int, int, int, int); void FUN_020808AC(struct BoxPokemon *, int, int, int, int); +void * FUN_02022610(void *, int); #endif //POKEDIAMOND_PROTO_H -- cgit v1.2.3 From 424076d3a557419bc548346c7625931cc09a34b2 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 16 Jun 2020 08:26:08 -0400 Subject: Decompile move table access routines --- include/constants/moves.h | 2 ++ include/move_data.h | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/constants/moves.h b/include/constants/moves.h index e25c16c9..bd658c17 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -470,4 +470,6 @@ #define MOVE_OMINOUS_WIND 466 #define MOVE_SHADOW_FORCE 467 +#define NUM_MOVES MOVE_SHADOW_FORCE + #endif //POKEDIAMOND_CONSTANTS_MOVES_H diff --git a/include/move_data.h b/include/move_data.h index 8da864b0..5267bfb1 100644 --- a/include/move_data.h +++ b/include/move_data.h @@ -1,7 +1,26 @@ #ifndef POKEDIAMOND_MOVE_DATA_H #define POKEDIAMOND_MOVE_DATA_H -int FUN_0206AB30(u16 move, u8 ppUp); -u32 FUN_0206AB18(u16 move, u32 attr); +struct WazaTbl +{ + u16 unk0; + u8 unk2; + u8 unk3; + u8 unk4; + u8 unk5; + u8 pp; + u8 unk7; + u16 unk8; + s8 unkA; + u8 unkB; + u8 unkC; + u8 unkD; + u8 padding[2]; +}; + +void LoadAllWazaTbl(struct WazaTbl * dest); +u8 WazaGetMaxPp(u16 move, u8 ppUp); +u32 GetWazaAttr(u16 move, u32 attr); +u32 GetAttrFromWazaTbl(struct WazaTbl * wazaTbl, u32 attr); #endif //POKEDIAMOND_MOVE_DATA_H -- cgit v1.2.3 From 28b7cf28c73879c406324f14df424fd7f46e9c14 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 18 Jun 2020 13:53:34 -0400 Subject: Implement o2narc; decompile base stats and movelearns to json --- include/constants/items.h | 105 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) (limited to 'include') diff --git a/include/constants/items.h b/include/constants/items.h index 98c3dd97..433532a4 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -445,4 +445,109 @@ #define ITEM_STORAGE_KEY 463 #define ITEM_SECRETPOTION 464 +#define TM_FOCUS_PUNCH ITEM_TM01 +#define TM_DRAGON_CLAW ITEM_TM02 +#define TM_WATER_PULSE ITEM_TM03 +#define TM_CALM_MIND ITEM_TM04 +#define TM_ROAR ITEM_TM05 +#define TM_TOXIC ITEM_TM06 +#define TM_HAIL ITEM_TM07 +#define TM_BULK_UP ITEM_TM08 +#define TM_BULLET_SEED ITEM_TM09 +#define TM_HIDDEN_POWER ITEM_TM10 +#define TM_SUNNY_DAY ITEM_TM11 +#define TM_TAUNT ITEM_TM12 +#define TM_ICE_BEAM ITEM_TM13 +#define TM_BLIZZARD ITEM_TM14 +#define TM_HYPER_BEAM ITEM_TM15 +#define TM_LIGHT_SCREEN ITEM_TM16 +#define TM_PROTECT ITEM_TM17 +#define TM_RAIN_DANCE ITEM_TM18 +#define TM_GIGA_DRAIN ITEM_TM19 +#define TM_SAFEGUARD ITEM_TM20 +#define TM_FRUSTRATION ITEM_TM21 +#define TM_SOLARBEAM ITEM_TM22 +#define TM_IRON_TAIL ITEM_TM23 +#define TM_THUNDERBOLT ITEM_TM24 +#define TM_THUNDER ITEM_TM25 +#define TM_EARTHQUAKE ITEM_TM26 +#define TM_RETURN ITEM_TM27 +#define TM_DIG ITEM_TM28 +#define TM_PSYCHIC ITEM_TM29 +#define TM_SHADOW_BALL ITEM_TM30 +#define TM_BRICK_BREAK ITEM_TM31 +#define TM_DOUBLE_TEAM ITEM_TM32 +#define TM_REFLECT ITEM_TM33 +#define TM_SHOCK_WAVE ITEM_TM34 +#define TM_FLAMETHROWER ITEM_TM35 +#define TM_SLUDGE_BOMB ITEM_TM36 +#define TM_SANDSTORM ITEM_TM37 +#define TM_FIRE_BLAST ITEM_TM38 +#define TM_ROCK_TOMB ITEM_TM39 +#define TM_AERIAL_ACE ITEM_TM40 +#define TM_TORMENT ITEM_TM41 +#define TM_FACADE ITEM_TM42 +#define TM_SECRET_POWER ITEM_TM43 +#define TM_REST ITEM_TM44 +#define TM_ATTRACT ITEM_TM45 +#define TM_THIEF ITEM_TM46 +#define TM_STEEL_WING ITEM_TM47 +#define TM_SKILL_SWAP ITEM_TM48 +#define TM_SNATCH ITEM_TM49 +#define TM_OVERHEAT ITEM_TM50 +#define TM_ROOST ITEM_TM51 +#define TM_FOCUS_BLAST ITEM_TM52 +#define TM_ENERGY_BALL ITEM_TM53 +#define TM_FALSE_SWIPE ITEM_TM54 +#define TM_BRINE ITEM_TM55 +#define TM_FLING ITEM_TM56 +#define TM_CHARGE_BEAM ITEM_TM57 +#define TM_ENDURE ITEM_TM58 +#define TM_DRAGON_PULSE ITEM_TM59 +#define TM_DRAIN_PUNCH ITEM_TM60 +#define TM_WILL_O_WISP ITEM_TM61 +#define TM_SILVER_WIND ITEM_TM62 +#define TM_EMBARGO ITEM_TM63 +#define TM_EXPLOSION ITEM_TM64 +#define TM_SHADOW_CLAW ITEM_TM65 +#define TM_PAYBACK ITEM_TM66 +#define TM_RECYCLE ITEM_TM67 +#define TM_GIGA_IMPACT ITEM_TM68 +#define TM_ROCK_POLISH ITEM_TM69 +#define TM_FLASH ITEM_TM70 +#define TM_STONE_EDGE ITEM_TM71 +#define TM_AVALANCHE ITEM_TM72 +#define TM_THUNDER_WAVE ITEM_TM73 +#define TM_GYRO_BALL ITEM_TM74 +#define TM_SWORDS_DANCE ITEM_TM75 +#define TM_STEALTH_ROCK ITEM_TM76 +#define TM_PSYCH_UP ITEM_TM77 +#define TM_CAPTIVATE ITEM_TM78 +#define TM_DARK_PULSE ITEM_TM79 +#define TM_ROCK_SLIDE ITEM_TM80 +#define TM_X_SCISSOR ITEM_TM81 +#define TM_SLEEP_TALK ITEM_TM82 +#define TM_NATURAL_GIFT ITEM_TM83 +#define TM_POISON_JAB ITEM_TM84 +#define TM_DREAM_EATER ITEM_TM85 +#define TM_GRASS_KNOT ITEM_TM86 +#define TM_SWAGGER ITEM_TM87 +#define TM_PLUCK ITEM_TM88 +#define TM_U_TURN ITEM_TM89 +#define TM_SUBSTITUTE ITEM_TM90 +#define TM_FLASH_CANNON ITEM_TM91 +#define TM_TRICK_ROOM ITEM_TM92 +#define HM_CUT ITEM_HM01 +#define HM_FLY ITEM_HM02 +#define HM_SURF ITEM_HM03 +#define HM_STRENGTH ITEM_HM04 +#define HM_DEFOG ITEM_HM05 +#define HM_WHIRLPOOL ITEM_HM05 +#define HM_ROCK_SMASH ITEM_HM06 +#define HM_WATERFALL ITEM_HM07 +#define HM_ROCK_CLIMB ITEM_HM08 + +#define NUM_TMS 92 +#define NUM_HMS 8 + #endif //POKEDIAMOND_CONSTANTS_ITEMS_H -- cgit v1.2.3 From 2f6c94828b62df2c6715e998731558bfba6218b7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 18 Jun 2020 15:03:34 -0400 Subject: evo tables to JSON --- include/constants/pokemon.h | 31 +++++++++++++++++++++++++++++++ include/pokemon.h | 31 ------------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 9accbad1..5c8c32d4 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -404,4 +404,35 @@ typedef enum { UNOWN_QUESTION_MARK = 27 } AlternateForms; +typedef enum EvoMethod +{ + EVO_NONE = 0, + EVO_FRIENDSHIP, + EVO_FRIENDSHIP_DAY, + EVO_FRIENDSHIP_NIGHT, + EVO_LEVEL, + EVO_TRADE, + EVO_TRADE_ITEM, + EVO_STONE, + EVO_LEVEL_ATK_GT_DEF, + EVO_LEVEL_ATK_EQ_DEF, + EVO_LEVEL_ATK_LT_DEF, + EVO_LEVEL_PID_LO, + EVO_LEVEL_PID_HI, + EVO_LEVEL_NINJASK, + EVO_LEVEL_SHEDINJA, + EVO_BEAUTY, + EVO_STONE_MALE, + EVO_STONE_FEMALE, + EVO_ITEM_DAY, + EVO_ITEM_NIGHT, + EVO_HAS_MOVE, + EVO_OTHER_PARTY_MON, + EVO_LEVEL_MALE, + EVO_LEVEL_FEMALE, + EVO_CORONET, + EVO_ETERNA, + EVO_ROUTE217, +} EvoMethod; + #endif //POKEDIAMOND_CONSTANTS_POKEMON_H diff --git a/include/pokemon.h b/include/pokemon.h index 01a03763..2387ef78 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -46,37 +46,6 @@ struct BaseStats { /* 0x28 */ u32 unk28; }; -typedef enum EvoMethod -{ - EVO_NONE = 0, - EVO_FRIENDSHIP, - EVO_FRIENDSHIP_DAY, - EVO_FRIENDSHIP_NIGHT, - EVO_LEVEL, - EVO_TRADE, - EVO_TRADE_ITEM, - EVO_STONE, - EVO_LEVEL_ATK_GT_DEF, - EVO_LEVEL_ATK_EQ_DEF, - EVO_LEVEL_ATK_LT_DEF, - EVO_LEVEL_PID_LO, - EVO_LEVEL_PID_HI, - EVO_LEVEL_NINJASK, - EVO_LEVEL_SHEDINJA, - EVO_BEAUTY, - EVO_STONE_MALE, - EVO_STONE_FEMALE, - EVO_ITEM_DAY, - EVO_ITEM_NIGHT, - EVO_HAS_MOVE, - EVO_OTHER_PARTY_MON, - EVO_LEVEL_MALE, - EVO_LEVEL_FEMALE, - EVO_CORONET, - EVO_ETERNA, - EVO_ROUTE217, -} EvoMethod; - // Structs typedef struct { -- cgit v1.2.3 From 4a3964f678de6cde21f55511ef06ecb48fcf3e19 Mon Sep 17 00:00:00 2001 From: Kaz Date: Thu, 18 Jun 2020 16:06:37 -0400 Subject: Decompile (gflib?) math_util file. --- include/math_util.h | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/math_util.h b/include/math_util.h index f7169956..f66f8a07 100644 --- a/include/math_util.h +++ b/include/math_util.h @@ -1,6 +1,38 @@ #ifndef POKEDIAMOND_MATH_UTIL_H #define POKEDIAMOND_MATH_UTIL_H +#include "fx.h" -u16 rand_LC(void); +/* + * Trigonometric functions + */ +s32 Sin(u16 degrees); +s32 Cos(u16 degrees); +s32 Sin_Wrap(u16 degrees); +s32 Cos_Wrap(u16 degrees); +u16 MathUtil_0201B9A0(u16 x); +s32 Sin32(s32 degrees); + +/* + * Random number generators + */ +u32 GetLCRNGSeed(); +void SetLCRNGSeed(u32 seed); +u16 LCRandom(void); + +u32 PRandom(u32 seed); + +void SetMTRNGSeed(u32 seed); +u32 MTRandom(void); + +/* + * Nitro FX specific functions + */ +void MTX22_2DAffine(struct Mtx22 * mtx, u16 radians, fx32 x, fx32 y, u8 type); + +/* + * Vector functions + */ +s32 CircularDistance(s32 x1, s32 y1, s32 x2, s32 y2); +s32 MathUtil_0201BC84(u16 arg0, s32 arg1); #endif //POKEDIAMOND_MATH_UTIL_H -- cgit v1.2.3 From 5d533911cd08d174d2e3f716b78e9ebe0746a722 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 18 Jun 2020 19:37:11 -0400 Subject: MOVEATTR enums; silence return value warning --- include/move_data.h | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/move_data.h b/include/move_data.h index 5267bfb1..a970e1bf 100644 --- a/include/move_data.h +++ b/include/move_data.h @@ -3,24 +3,39 @@ struct WazaTbl { - u16 unk0; + u16 effect; u8 unk2; - u8 unk3; - u8 unk4; - u8 unk5; + u8 power; + u8 type; + u8 accuracy; u8 pp; - u8 unk7; + u8 effectChance; u16 unk8; - s8 unkA; + s8 priority; u8 unkB; u8 unkC; - u8 unkD; + u8 contestType; u8 padding[2]; }; +typedef enum MoveAttr { + MOVEATTR_EFFECT = 0, + MOVEATTR_UNK1, + MOVEATTR_POWER, + MOVEATTR_TYPE, + MOVEATTR_ACCURACY, + MOVEATTR_PP, + MOVEATTR_EFFECT_CHANCE, + MOVEATTR_UNK7, + MOVEATTR_PRIORTY, + MOVEATTR_UNK9, + MOVEATTR_UNK10, + MOVEATTR_CONTEST_TYPE, +} MoveAttr; + void LoadAllWazaTbl(struct WazaTbl * dest); u8 WazaGetMaxPp(u16 move, u8 ppUp); -u32 GetWazaAttr(u16 move, u32 attr); -u32 GetAttrFromWazaTbl(struct WazaTbl * wazaTbl, u32 attr); +u32 GetWazaAttr(u16 move, MoveAttr attr); +u32 GetAttrFromWazaTbl(struct WazaTbl * wazaTbl, MoveAttr attr); #endif //POKEDIAMOND_MOVE_DATA_H -- cgit v1.2.3 From d57baf0c2231303622ade07a3ea1df2d795fd73c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 19 Jun 2020 10:06:32 -0400 Subject: nutdata.c --- include/constants/items.h | 2 ++ include/itemtool.h | 24 ++++++++++++++++++++++++ include/msg_data.h | 20 ++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 include/itemtool.h create mode 100644 include/msg_data.h (limited to 'include') diff --git a/include/constants/items.h b/include/constants/items.h index 433532a4..a7fcc32f 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -128,7 +128,9 @@ #define ITEM_AIR_MAIL 146 #define ITEM_MOSAIC_MAIL 147 #define ITEM_BRICK_MAIL 148 + #define ITEM_CHERI_BERRY 149 +#define FIRST_BERRY_IDX ITEM_CHERI_BERRY #define ITEM_CHESTO_BERRY 150 #define ITEM_PECHA_BERRY 151 #define ITEM_RAWST_BERRY 152 diff --git a/include/itemtool.h b/include/itemtool.h new file mode 100644 index 00000000..525e68f9 --- /dev/null +++ b/include/itemtool.h @@ -0,0 +1,24 @@ +#ifndef POKEDIAMOND_ITEMTOOL_H +#define POKEDIAMOND_ITEMTOOL_H + +#include "global.h" +#include "constants/items.h" + +// Berries (nutdata) + +struct NutData +{ + u16 unk0; + u8 unk2; + u8 unk3; + u8 unk4; + u8 unk5; + u8 unk6; + u8 unk7; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; +}; + +#endif //POKEDIAMOND_ITEMTOOL_H diff --git a/include/msg_data.h b/include/msg_data.h new file mode 100644 index 00000000..debacc79 --- /dev/null +++ b/include/msg_data.h @@ -0,0 +1,20 @@ +#ifndef POKEDIAMOND_MSG_DATA_H +#define POKEDIAMOND_MSG_DATA_H + +struct MsgData +{ + u16 unk0; + u16 unk2; + u16 unk4; + u16 unk6; + union { + u16 * raw; + NARC * narc; + } data; +}; + +struct MsgData * NewMsgDataFromNarc(u32 type, u32 narcId, u32 msgId, u32 heapno); +u16 * FUN_0200A914(struct MsgData *, u32); +void DestroyMsgData(struct MsgData *); + +#endif //POKEDIAMOND_MSG_DATA_H -- cgit v1.2.3 From 6f0dba80ac2ba1b5571d551ceca24c89a332fa14 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 19 Jun 2020 10:44:15 -0400 Subject: Name growth rates in personal.json --- include/constants/pokemon.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 5c8c32d4..4a2647d6 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -435,4 +435,14 @@ typedef enum EvoMethod EVO_ROUTE217, } EvoMethod; +enum GrowthRate +{ + GROWTH_MEDIUM_FAST = 0, + GROWTH_ERRATIC, + GROWTH_FLUCTUATING, + GROWTH_MEDIUM_SLOW, + GROWTH_FAST, + GROWTH_SLOW, +}; + #endif //POKEDIAMOND_CONSTANTS_POKEMON_H -- cgit v1.2.3 From 73d7f3cc5eb19168234ef82a18dc0d235e699401 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 19 Jun 2020 10:58:09 -0400 Subject: Define gender ratio as floats in personal.json --- include/constants/pokemon.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 4a2647d6..1af59830 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -269,9 +269,15 @@ #define MON_DATA_SPECIES_NAME 178 #define MON_RATIO_MALE 0 +#define MON_RATIO_EIGHTH 31 +#define MON_RATIO_QUARTER 63 +#define MON_RATIO_HALF 127 +#define MON_RATIO_THREEQUARTER 191 #define MON_RATIO_FEMALE 254 #define MON_RATIO_UNKNOWN 255 +#define GENDER_RATIO(frac) ( (frac) <= 1 ? (u8)((frac) * 254.75) : 255 ) + enum MonGender { MON_MALE = 0, -- cgit v1.2.3 From e19270f9b3523dfe68b5010e7735fc7896e568d7 Mon Sep 17 00:00:00 2001 From: red031000 Date: Fri, 19 Jun 2020 19:07:34 +0100 Subject: arm7 OS_thread --- include/nitro/OS_alarm_shared.h | 35 +++++++++++++++++++ include/nitro/OS_mutex_shared.h | 26 ++++++++++++++ include/nitro/OS_systemWork_shared.h | 66 ++++++++++++++++++++++++++++++++++++ include/nitro/OS_thread_shared.h | 12 +++++++ include/nitro/OS_tick_shared.h | 24 +++++++++++++ include/nitro/consts_shared.h | 8 +++++ include/nitro/mmap_shared.h | 3 ++ 7 files changed, 174 insertions(+) create mode 100644 include/nitro/OS_alarm_shared.h create mode 100644 include/nitro/OS_mutex_shared.h create mode 100644 include/nitro/OS_systemWork_shared.h create mode 100644 include/nitro/OS_tick_shared.h (limited to 'include') diff --git a/include/nitro/OS_alarm_shared.h b/include/nitro/OS_alarm_shared.h new file mode 100644 index 00000000..fe549351 --- /dev/null +++ b/include/nitro/OS_alarm_shared.h @@ -0,0 +1,35 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include OS_alarm.h from the specific proc's lib + */ + +#ifndef POKEDIAMOND_OS_ALARM_SHARED_H +#define POKEDIAMOND_OS_ALARM_SHARED_H + +#include "nitro/types.h" +#include "nitro/OS_tick_shared.h" + +typedef void (*OSAlarmHandler) (void *); + +struct OSiAlarm +{ + OSAlarmHandler handler; + void *arg; + + u32 tag; + OSTick fire; + OSAlarm *prev; + OSAlarm *next; + + OSTick period; + OSTick start; +}; + +#endif //POKEDIAMOND_OS_ALARM_SHARED_H diff --git a/include/nitro/OS_mutex_shared.h b/include/nitro/OS_mutex_shared.h new file mode 100644 index 00000000..e3c93e47 --- /dev/null +++ b/include/nitro/OS_mutex_shared.h @@ -0,0 +1,26 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include OS_mutex.h from the specific proc's lib + */ + +#ifndef POKEDIAMOND_OS_MUTEX_SHARED_H +#define POKEDIAMOND_OS_MUTEX_SHARED_H + +#include "nitro/OS_thread_shared.h" +#include "nitro/types.h" + +struct OSMutex { + OSThreadQueue queue; + OSThread *thread; + s32 count; + OSMutexLink link; +}; + +#endif //POKEDIAMOND_OS_MUTEX_SHARED_H diff --git a/include/nitro/OS_systemWork_shared.h b/include/nitro/OS_systemWork_shared.h new file mode 100644 index 00000000..54321015 --- /dev/null +++ b/include/nitro/OS_systemWork_shared.h @@ -0,0 +1,66 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include consts.h from the specific proc's lib + */ + +#ifndef POKEDIAMOND_OS_SYSTEMWORK_SHARED_H +#define POKEDIAMOND_OS_SYSTEMWORK_SHARED_H + +#include "nitro/types.h" +#include "nitro/mmap_shared.h" +#include "nitro/OS_thread_shared.h" +#include "nitro/OS_spinLock_shared.h" + +typedef struct { + u8 bootCheckInfo[0x20]; // 000-01f: 32byte boot check info + u32 resetParameter; // 020-023: 4byte reset parameter + u8 padding5[0x8]; // 024-02c: (8byte) + u32 romBaseOffset; // 02c-02f: 4byte ROM offset of own program + u8 cartridgeModuleInfo[12]; // 030-03b: 12byte cartridge module info + u32 vblankCount; // 03c-03f: 4byte V-Blank Count + u8 wmBootBuf[0x40]; // 040-07f: 64byte WM multiboot buffer + u8 nvramUserInfo[0x100]; // 080-17f: 256bytes NVRAM user info + u8 isd_reserved1[0x20]; // 180-19f: 32bytes ISDebugger reserved + u8 arenaInfo[0x48]; // 1a0-1e7: 72byte Arena information + u8 real_time_clock[8]; // 1e8-1ef: 8bytes RTC + u32 dmaClearBuf[4]; // 1f0-1ff: 16bytes DMA clear information buffer (for ARM9-TEG) + u8 rom_header[0x160]; // 200-35f: 352bytes ROM registration area info storage buffer + u8 isd_reserved2[32]; // 360-37f: 32bytes ISDebugger reserved + u32 pxiSignalParam[2]; // 380-387: 8bytes Param for PXI Signal + u32 pxiHandleChecker[2]; // 388-38f: 8bytes Flag for PXI Command Handler Installed + u32 mic_last_address; // 390-393: 4bytes MIC latest sampling result storage address + u16 mic_sampling_data; // 394-395: 2bytes MIC sampling result + u16 wm_callback_control; // 396-397: 2bytes Parameter for WM callback synchronization + u16 wm_rssi_pool; // 398-399: 2bytes Random number source depends on WM received signal intensity + u8 padding3[2]; // 39a-39b: (2bytes) + u32 component_param; // 39c-39f: 4bytes Parameter for Component synchronization + OSThreadInfo *threadinfo_mainp; // 3a0-3a3: 4bytes Verify that the pointer to ARM9 thread information is initial value 0 + OSThreadInfo *threadinfo_subp; // 3a4-3a7: 4bytes Verify that the pointer to ARM7 thread information is initial value 0 + u16 button_XY; // 3a8-3a9: 2bytes XY button information storage location + u8 touch_panel[4]; // 3aa-3ad: 4bytes Touch Screen information storage location + u16 autoloadSync; // 3ae-3af: 2bytes autoload sync between processors + u32 lockIDFlag_mainp[2]; // 3b0-3b7: 8bytes lockID management flag (ARM9) + u32 lockIDFlag_subp[2]; // 3b8-3bf: 8bytes lockID management flag (ARM7) + struct OSLockWord lock_VRAM_C; // 3c0-3c7: 8bytes C - lock buffer + struct OSLockWord lock_VRAM_D; // 3c8-3cf: 8bytes VRAM-D - lock buffer + struct OSLockWord lock_WRAM_BLOCK0; // 3d0-3d7: 8bytes Block0 - lock buffer + struct OSLockWord lock_WRAM_BLOCK1; // 3d8-3df: 8bytes CPU internal work RAM - Block1 - lock buffer + struct OSLockWord lock_CARD; // 3e0-3e7: 8bytes Game Card - lock buffer + struct OSLockWord lock_CARTRIDGE; // 3e8-3ef: 8bytes DS Pak - lock buffer + struct OSLockWord lock_INIT; // 3f0-3f7: 8bytes Initialization lock buffer + u16 mmem_checker_mainp; // 3f8-3f9: 2bytes MainMomory Size Checker for Main processor + u16 mmem_checker_subp; // 3fa-3fb: 2bytes MainMomory Size Checker for Sub processor + u8 padding4[2]; // 3fc-3fd: (2bytes) + u16 command_area; // 3fe-3ff: 2bytes Command Area +} OSSystemWork; //0x027FFC00 + +#define OS_GetSystemWork() ((OSSystemWork *)HW_MAIN_MEM_SYSTEM) + +#endif //POKEDIAMOND_OS_SYSTEMWORK_SHARED_H diff --git a/include/nitro/OS_thread_shared.h b/include/nitro/OS_thread_shared.h index 28d8a503..a0cce54d 100644 --- a/include/nitro/OS_thread_shared.h +++ b/include/nitro/OS_thread_shared.h @@ -1,3 +1,15 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include OS_thread.h from the specific proc's lib + */ + #ifndef POKEDIAMOND_OS_THREAD_SHARED_H #define POKEDIAMOND_OS_THREAD_SHARED_H diff --git a/include/nitro/OS_tick_shared.h b/include/nitro/OS_tick_shared.h new file mode 100644 index 00000000..e6d6d3b3 --- /dev/null +++ b/include/nitro/OS_tick_shared.h @@ -0,0 +1,24 @@ +/* + * NOTE: + * This file is shared between ARM9 and ARM7 + * DO NOT PUT PROC SPECIFIC CODE IN HERE + * Thank You! + */ + +/* + * DO NOT INCLUDE THIS FILE DIRECTLY + * Include OS_tick.h from the specific proc's lib + */ + +#ifndef POKEDIAMOND_OS_TICK_SHARED_H +#define POKEDIAMOND_OS_TICK_SHARED_H + +#include "nitro/types.h" + +typedef u64 OSTick; + +#define OS_SYSTEM_CLOCK HW_SYSTEM_CLOCK + +#define OS_MilliSecondsToTicks(msec) ((OSTick)(((OS_SYSTEM_CLOCK/1000) * (u64)(msec)) / 64)) + +#endif //POKEDIAMOND_OS_TICK_SHARED_H diff --git a/include/nitro/consts_shared.h b/include/nitro/consts_shared.h index b6342172..26cc2fca 100644 --- a/include/nitro/consts_shared.h +++ b/include/nitro/consts_shared.h @@ -30,6 +30,14 @@ #define OSi_InRange(targ, a, b) ((u32)(a) <= (u32)(targ) && (u32)(targ) < (u32)(b)) #define OSi_OFFSET(n, a) (((u32) (n)) & ((a) - 1)) +#define OS_THREAD_SPECIFIC_MAX 0x03 + +#define OS_THREAD_LAUNCHER_PRIORITY 0x10 +#define OS_THREAD_PRIORITY_MIN 0x00 +#define OS_THREAD_PRIORITY_MAX 0x1F + +#define HW_SYSTEM_CLOCK 33514000 + #define OSi_GetArenaInfo() (*(OSArenaInfo*)HW_ARENA_INFO_BUF) #endif //POKEDIAMOND_CONSTS_SHARED_H diff --git a/include/nitro/mmap_shared.h b/include/nitro/mmap_shared.h index f7ba4fb4..60c0c1cb 100644 --- a/include/nitro/mmap_shared.h +++ b/include/nitro/mmap_shared.h @@ -18,6 +18,9 @@ #define HW_MAIN_MEM_MAIN_SIZE 0x003E0000 #define HW_MAIN_MEM_SHARED_SIZE 0x00001000 +#define HW_WRAM 0x037F8000 + +#define HW_MAIN_MEM_SYSTEM (HW_MAIN_MEM + 0x007ffc00) #define HW_WM_BOOT_BUF (HW_MAIN_MEM + 0x007ffc40) #define HW_ARENA_INFO_BUF (HW_MAIN_MEM + 0x007ffda0) #define HW_CTRDG_LOCK_BUF (HW_MAIN_MEM + 0x007fffe8) -- cgit v1.2.3