summaryrefslogtreecommitdiff
path: root/include/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/global.h')
-rw-r--r--include/global.h157
1 files changed, 95 insertions, 62 deletions
diff --git a/include/global.h b/include/global.h
index f88203c90..ec636bb07 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];
@@ -428,41 +437,68 @@ struct MailStruct
/*0x20*/ u16 itemId;
};
-struct UnkMauvilleOldManStruct
+struct MauvilleManCommon
{
- u8 unk_2D94;
- u8 unk_2D95;
- /*0x2D96*/ u16 mauvilleOldMan_ecArray[6];
- /*0x2DA2*/ u16 mauvilleOldMan_ecArray2[6];
- /*0x2DAE*/ u8 playerName[8];
- /*0x2DB6*/ u8 filler_2DB6[0x3];
- /*0x2DB9*/ u8 playerTrainerId[4];
- u8 unk_2DBD;
+ u8 id;
+};
+
+struct MauvilleManBard
+{
+ /*0x00*/ u8 id;
+ /*0x02*/ u16 songLyrics[6];
+ /*0x0E*/ u16 temporaryLyrics[6];
+ /*0x1A*/ u8 playerName[8];
+ /*0x22*/ u8 filler_2DB6[0x3];
+ /*0x25*/ u8 playerTrainerId[4];
+ /*0x29*/ bool8 hasChangedSong;
+ /*0x2A*/ u8 language;
}; /*size = 0x2C*/
-struct UnkMauvilleOldManStruct2
+struct MauvilleManStoryteller
{
- u8 filler0;
- u8 unk1;
- u8 unk2;
- u16 mauvilleOldMan_ecArray[10];
- u8 mauvilleOldMan_ecArray2[12];
- u8 fillerF[0x2];
+ u8 id;
+ bool8 alreadyRecorded;
+ u8 filler2[2];
+ u8 gameStatIDs[4];
+ u8 trainerNames[4][7];
+ u8 statValues[4][4];
+ u8 language[4];
+};
+
+struct MauvilleManGiddy
+{
+ /*0x00*/ u8 id;
+ /*0x01*/ u8 taleCounter;
+ /*0x02*/ u8 questionNum;
+ /*0x04*/ u16 randomWords[10];
+ /*0x18*/ u8 questionList[8];
+ /*0x20*/ u8 language;
}; /*size = 0x2C*/
+struct MauvilleManHipster
+{
+ u8 id;
+ bool8 alreadySpoken;
+ u8 language;
+};
+
struct MauvilleOldManTrader
{
- u8 unk0;
- u8 unk1[4];
- u8 unk5[4][11];
- u8 unk31;
+ u8 id;
+ u8 decorIds[4];
+ u8 playerNames[4][11];
+ u8 alreadyTraded;
+ u8 language[4];
};
typedef union OldMan
{
- struct UnkMauvilleOldManStruct oldMan1;
- struct UnkMauvilleOldManStruct2 oldMan2;
+ struct MauvilleManCommon common;
+ struct MauvilleManBard bard;
+ struct MauvilleManGiddy giddy;
+ struct MauvilleManHipster hipster;
struct MauvilleOldManTrader trader;
+ struct MauvilleManStoryteller storyteller;
u8 filler[0x40];
} OldMan;
@@ -480,6 +516,8 @@ struct RecordMixing_UnknownStruct
u16 unk74[0x2];
};
+#define LINK_B_RECORDS_COUNT 5
+
struct LinkBattleRecord
{
u8 name[8];
@@ -489,6 +527,12 @@ struct LinkBattleRecord
u16 draws;
};
+struct LinkBattleRecords
+{
+ struct LinkBattleRecord entries[LINK_B_RECORDS_COUNT];
+ u8 languages[LINK_B_RECORDS_COUNT];
+};
+
struct RecordMixingGiftData
{
u8 unk0;
@@ -530,8 +574,6 @@ struct DaycareMon
u32 steps;
};
-#define DAYCARE_MON_COUNT 2
-
struct DayCare
{
struct DaycareMon mons[DAYCARE_MON_COUNT];
@@ -552,13 +594,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 +680,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 +702,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];
@@ -703,9 +738,7 @@ struct SaveBlock1
/*0x2e64*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff
/*0x2e90*/ struct ContestWinner contestWinners[13]; // 0 - 5 used in contest hall, 6 - 7 unused?, 8 - 12 museum
/*0x3030*/ struct DayCare daycare;
- /*0x3150*/ struct LinkBattleRecord linkBattleRecords[5];
- /*0x31A0*/ u8 unk_31A0;
- /*0x31A1*/ u8 filler_31A1[7];
+ /*0x3150*/ struct LinkBattleRecords linkBattleRecords;
/*0x31A8*/ u8 giftRibbons[52];
/*0x31DC*/ struct Roamer roamer;
/*0x31F8*/ struct EnigmaBerry enigmaBerry;