summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/constants/items.h10
-rw-r--r--include/global.h74
-rw-r--r--include/item.h24
-rw-r--r--include/item_menu.h2
-rw-r--r--include/secret_base.h1
5 files changed, 67 insertions, 44 deletions
diff --git a/include/constants/items.h b/include/constants/items.h
index 8717ecbd5..4ca5cb7df 100644
--- a/include/constants/items.h
+++ b/include/constants/items.h
@@ -108,6 +108,8 @@
#define ITEM_064 100
#define ITEM_065 101
#define ITEM_066 102
+
+// Unusable
#define ITEM_TINY_MUSHROOM 103
#define ITEM_BIG_MUSHROOM 104
#define ITEM_069 105
@@ -126,6 +128,8 @@
#define ITEM_076 118
#define ITEM_077 119
#define ITEM_078 120
+
+// Mails
#define ITEM_ORANGE_MAIL 121
#define ITEM_HARBOR_MAIL 122
#define ITEM_GLITTER_MAIL 123
@@ -138,6 +142,8 @@
#define ITEM_DREAM_MAIL 130
#define ITEM_FAB_MAIL 131
#define ITEM_RETRO_MAIL 132
+
+// Berries
#define ITEM_CHERI_BERRY 133
#define ITEM_CHESTO_BERRY 134
#define ITEM_PECHA_BERRY 135
@@ -185,7 +191,7 @@
#define ITEM_0B1 177
#define ITEM_0B2 178
-// hold items
+// Battle Held items
#define ITEM_BRIGHT_POWDER 179
#define ITEM_WHITE_HERB 180
#define ITEM_MACHO_BRACE 181
@@ -261,6 +267,8 @@
#define ITEM_0FB 251
#define ITEM_0FC 252
#define ITEM_0FD 253
+
+// Contest held items
#define ITEM_RED_SCARF 254
#define ITEM_BLUE_SCARF 255
#define ITEM_PINK_SCARF 256
diff --git a/include/global.h b/include/global.h
index f88203c90..b0c3bed4a 100644
--- a/include/global.h
+++ b/include/global.h
@@ -43,9 +43,6 @@
#define PARTY_SIZE 6
-#define POKEMON_NAME_LENGTH 10
-#define OT_NAME_LENGTH 7
-
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
@@ -97,6 +94,31 @@ enum LanguageId
#define GAME_VERSION (VERSION_EMERALD)
#define GAME_LANGUAGE (LANGUAGE_ENGLISH)
+// capacities of various saveblock objects
+#define DAYCARE_MON_COUNT 2
+#define POKEBLOCKS_COUNT 40
+#define MAP_OBJECTS_COUNT 16
+#define BERRY_TREES_COUNT 128
+#define FLAGS_COUNT 300
+#define VARS_COUNT 256
+#define MAIL_COUNT 16
+#define SECRET_BASES_COUNT 20
+#define PC_ITEMS_COUNT 50
+#define BAG_ITEMS_COUNT 30
+#define BAG_KEYITEMS_COUNT 30
+#define BAG_POKEBALLS_COUNT 16
+#define BAG_TMHM_COUNT 64
+#define BAG_BERRIES_COUNT 46
+
+#define PYRAMID_BAG_ITEMS_COUNT 10
+
+// string lengths
+#define ITEM_NAME_LENGTH 14
+#define POKEMON_NAME_LENGTH 10
+#define OT_NAME_LENGTH 7
+#define PLAYER_NAME_LENGTH 8
+#define MAIL_WORDS_COUNT 9
+
enum
{
MALE,
@@ -129,15 +151,6 @@ enum
OPTIONS_BATTLE_STYLE_SET
};
-enum
-{
- BAG_ITEMS = 1,
- BAG_POKEBALLS,
- BAG_TMsHMs,
- BAG_BERRIES,
- BAG_KEYITEMS
-};
-
struct Coords16
{
s16 x;
@@ -209,11 +222,11 @@ struct BerryPickingResults // possibly used in the game itself? Size may be wron
u8 field_F;
};
+// two arrays for lvl50 and open level
struct PyramidBag
{
- u16 items_Lvl50[10];
- u16 items_OpenLvl[10];
- u8 quantity[10];
+ u16 itemId[2][PYRAMID_BAG_ITEMS_COUNT];
+ u8 quantity[2][PYRAMID_BAG_ITEMS_COUNT];
};
struct BerryCrush
@@ -223,8 +236,6 @@ struct BerryCrush
u32 unk;
};
-#define PLAYER_NAME_LENGTH 8
-
struct UnknownSaveBlock2Struct
{
u8 field_0;
@@ -303,7 +314,7 @@ struct SaveBlock2
/*0xE1A*/ u16 battlePyramidFloor; // possibly?
/*0xE1C*/ u8 field_E1C[16];
/*0xE2C*/ struct PyramidBag pyramidBag;
- /*0x???*/ u8 field_notSure[13];
+ /*0x???*/ u8 field_unkown[6];
/*0xE6E*/ u16 battleTentWinStreak;
/*0xE70*/ u8 field_E70[72];
/*0xEB8*/ u16 frontierBattlePoints;
@@ -417,8 +428,6 @@ struct EasyChatPair
u16 words[2];
}; /*size = 0x8*/
-#define MAIL_WORDS_COUNT 9
-
struct MailStruct
{
/*0x00*/ u16 words[MAIL_WORDS_COUNT];
@@ -530,8 +539,6 @@ struct DaycareMon
u32 steps;
};
-#define DAYCARE_MON_COUNT 2
-
struct DayCare
{
struct DaycareMon mons[DAYCARE_MON_COUNT];
@@ -552,13 +559,6 @@ struct RecordMixingDayCareMail
bool16 holdsItem[DAYCARE_MON_COUNT];
};
-#define POKEBLOCKS_COUNT 40
-#define MAP_OBJECTS_COUNT 16
-#define BERRY_TREES_COUNT 128
-#define FLAGS_COUNT 300
-#define VARS_COUNT 256
-#define MAIL_COUNT 16
-
enum
{
LILYCOVE_LADY_QUIZ,
@@ -645,16 +645,16 @@ struct SaveBlock1
/*0x32*/ u16 mapDataId;
/*0x34*/ u16 mapView[0x100];
/*0x234*/ u8 playerPartyCount;
- /*0x238*/ struct Pokemon playerParty[6];
+ /*0x238*/ struct Pokemon playerParty[PARTY_SIZE];
/*0x490*/ u32 money;
/*0x494*/ u16 coins;
/*0x496*/ u16 registeredItem; // registered for use with SELECT button
- /*0x498*/ struct ItemSlot pcItems[50];
- /*0x560*/ struct ItemSlot bagPocket_Items[30];
- /*0x5D8*/ struct ItemSlot bagPocket_KeyItems[30];
- /*0x650*/ struct ItemSlot bagPocket_PokeBalls[16];
- /*0x690*/ struct ItemSlot bagPocket_TMHM[64];
- /*0x790*/ struct ItemSlot bagPocket_Berries[46];
+ /*0x498*/ struct ItemSlot pcItems[PC_ITEMS_COUNT];
+ /*0x560*/ struct ItemSlot bagPocket_Items[BAG_ITEMS_COUNT];
+ /*0x5D8*/ struct ItemSlot bagPocket_KeyItems[BAG_KEYITEMS_COUNT];
+ /*0x650*/ struct ItemSlot bagPocket_PokeBalls[BAG_POKEBALLS_COUNT];
+ /*0x690*/ struct ItemSlot bagPocket_TMHM[BAG_TMHM_COUNT];
+ /*0x790*/ struct ItemSlot bagPocket_Berries[BAG_BERRIES_COUNT];
/*0x848*/ struct Pokeblock pokeblocks[POKEBLOCKS_COUNT];
/*0x988*/ u8 seen1[52];
/*0x9BC*/ u16 berryBlenderRecords[3];
@@ -667,7 +667,7 @@ struct SaveBlock1
/*0x139C*/ u16 vars[VARS_COUNT];
/*0x159C*/ u32 gameStats[NUM_GAME_STATS];
/*0x169C*/ struct BerryTree berryTrees[BERRY_TREES_COUNT];
- /*0x1A9C*/ struct SecretBaseRecord secretBases[20];
+ /*0x1A9C*/ struct SecretBaseRecord secretBases[SECRET_BASES_COUNT];
/*0x271C*/ u8 playerRoomDecor[12];
/*0x2728*/ u8 playerRoomDecorPos[12];
/*0x2734*/ u8 decorDesk[10];
diff --git a/include/item.h b/include/item.h
index 33d434f78..3153807c4 100644
--- a/include/item.h
+++ b/include/item.h
@@ -1,11 +1,21 @@
-#ifndef ITEM_H
-#define ITEM_H
+#ifndef GUARD_ITEM_H
+#define GUARD_ITEM_H
+
+enum
+{
+ ITEMS_POCKET,
+ BALLS_POCKET,
+ TMHM_POCKET,
+ BERRIES_POCKET,
+ KEYITEMS_POCKET,
+ POCKETS_COUNT
+};
typedef void (*ItemUseFunc)(u8);
struct Item
{
- u8 name[14];
+ u8 name[ITEM_NAME_LENGTH];
u16 itemId;
u16 price;
u8 holdEffect;
@@ -63,10 +73,14 @@ u16 itemid_get_market_price(u16 itemId);
u16 BagGetItemIdByPocketPosition(u8 pocketId, u16 pocketPos);
void sub_80D6FB4(struct BagPocket*);
void sub_80D6F64(struct BagPocket*);
-void sub_80D702C(struct ItemSlot*, s16, u16);
+void MoveItemSlotInList(struct ItemSlot* itemSlots, u32 a1, u32 a2);
u8 sub_80D6CE4();
bool8 itemid_is_unique(u16 itemId);
void sub_80D6E48(u8, u16);
void sub_80D6E84(void);
+void CompactPCItems(void);
+void SortBerriesOrTMHMs(struct BagPocket *bagPocket);
+void CompactItemsInBagPocket(struct BagPocket *bagPocket);
+const u8 *ItemId_GetName(u16 itemId);
-#endif // ITEM_H
+#endif // GUARD_ITEM_H
diff --git a/include/item_menu.h b/include/item_menu.h
index 68393c9ee..40c015a8e 100644
--- a/include/item_menu.h
+++ b/include/item_menu.h
@@ -55,7 +55,7 @@ void sub_81AAC14(void);
void sub_81AAC50(void);
void sub_81AAC70(void);
void bag_menu_mail_related(void);
-
void CB2_BagMenuFromStartMenu(void);
+u8 sub_81ABB2C(u8 pocketId);
#endif //GUARD_item_menu_H
diff --git a/include/secret_base.h b/include/secret_base.h
index b2502889c..3e8a80987 100644
--- a/include/secret_base.h
+++ b/include/secret_base.h
@@ -10,5 +10,6 @@ void sub_80E9578(void);
void sub_80E980C(void);
u8 *GetSecretBaseMapName(u8 *dest);
const u8 *GetSecretBaseTrainerLoseText(void);
+bool8 CurrentMapIsSecretBase(void);
#endif //GUARD_SECRET_BASE_H