More work on item related functions (#44)

* decompile sub_8091290

* decompile sub_80912c8

* rename functions / struct field

* more names

* decompile 80913A0

* decompile GetItemMove

* decompile sub_80913E0

* rename function

* decompile CanSellItem function

* rename inventory struct

* add some item check functions

* fix renaming stuff

* this file shouldnt have been here

* forgot merge conflict

* decompile more item functions

* rename some stuff

* fix HM/TM naming

* Update src/code_801AFA4.c

Use enum value for USED_TM

* Fix incorrect value

* decompile sub_80915F4

* decompile HasGummiItem

* decompiled another function and renamed stuff

* decompile 2 smaller functions

* more functions

* more decompiling and renaming

* redo change that was undone in the merge
This commit is contained in:
Dennis
2021-07-12 21:10:32 +02:00
committed by GitHub
parent 2104c4f762
commit da7b30612f
22 changed files with 386 additions and 560 deletions

View File

@@ -35,6 +35,12 @@ struct ItemSlot_ALT
u8 unk2;
};
struct unkStruct_80915F4
{
u16 unk0;
u16 unk2;
};
enum ItemType
{
ITEM_TYPE_THROWABLE,
@@ -311,8 +317,12 @@ enum ItemID {
ITEM_ID_G_MACHINE_6,
ITEM_ID_G_MACHINE_7,
ITEM_ID_G_MACHINE_8,
NUMBER_OF_ITEM_IDS
};
#define NUMBER_OF_GUMMIS 18
#define INVENTORY_SIZE 20
void LoadItemParameters(void);
struct TeamInventory *GetMoneyItemsInfo(void);
void InitializeMoneyItems(void);
@@ -336,5 +346,7 @@ void ConvertMoneyItemToMoney();
void AddToTeamMoney(s32 amount);
u32 GetMoneyValue(struct ItemSlot* slot);
u16 GetItemMove(u8 index);
bool8 IsGummiItem(u8);
void xxx_init_unk230_substruct(u8);
#endif

View File

@@ -18,7 +18,7 @@ struct PokemonStruct
u8 fillD[0x10 - 0xD];
u8 unk10;
u8 fill11[0x14 - 0x11];
u16 unk14;
/* 0x14 */ u16 IQ;
/* 0x16 */ u16 pokeHP; // HP
/* 0x18 */ u8 pokeAtt; // attack
/* 0x19 */ u8 pokeSPAtt; // sp attack
@@ -144,7 +144,7 @@ u8 GetUnk12(s16 index);
s16 GetPokemonEvolveFrom(s16 index);
u16 GetPokemonAttSpatt(s16 index, u32 r1);
u16 GetPokemonDefSpdef(s16 index, u32 r1);
u8 GetPokemonType(s32 index, u32 typeIndex);;
u8 GetPokemonType(s32 index, u32 typeIndex);
u8 GetPokemonAbility(s16 index, u32 abilityIndex);
s16 GetDexInternalNo(s16 index, u32 r1);
s16 GetBaseRecruit(s16 index);

View File

@@ -9,8 +9,8 @@ struct subStruct_203B460
struct TeamInventory
{
struct ItemSlot teamItems[20];
u16 unk50[0xF0];
struct ItemSlot teamItems[INVENTORY_SIZE];
u16 teamStorage[NUMBER_OF_ITEM_IDS];
struct subStruct_203B460 unk230[8]; // this is probably actually the same struct as ItemSlot_ALT (see sub_80919FC)
struct subStruct_203B460 unk250[4]; // TODO: idk if this is identical struct or not.. Ghidra says sizes are same
/* 0x260 */ s32 teamMoney;