summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/abilities.h86
-rw-r--r--include/battle.h19
-rw-r--r--include/fieldmap.h93
-rw-r--r--include/flag.h11
-rw-r--r--include/flags.h41
-rw-r--r--include/gba/m4a_internal.h2
-rw-r--r--include/gba/syscall.h12
-rw-r--r--include/global.h93
-rw-r--r--include/link.h2
-rw-r--r--include/pokemon.h135
-rw-r--r--include/sprite.h2
-rw-r--r--include/trainer.h19
-rw-r--r--include/var.h11
-rw-r--r--include/vars.h6
14 files changed, 411 insertions, 121 deletions
diff --git a/include/abilities.h b/include/abilities.h
new file mode 100644
index 000000000..36a7ab671
--- /dev/null
+++ b/include/abilities.h
@@ -0,0 +1,86 @@
+#ifndef GUARD_ABILITIES_H
+#define GUARD_ABILITIES_H
+
+enum
+{
+ ABILITY_NONE,
+ ABILITY_STENCH,
+ ABILITY_DRIZZLE,
+ ABILITY_SPEED_BOOST,
+ ABILITY_BATTLE_ARMOR,
+ ABILITY_STURDY,
+ ABILITY_DAMP,
+ ABILITY_LIMBER,
+ ABILITY_SAND_VEIL,
+ ABILITY_STATIC,
+ ABILITY_VOLT_ABSORB,
+ ABILITY_WATER_ABSORB,
+ ABILITY_OBLIVIOUS,
+ ABILITY_CLOUD_NINE,
+ ABILITY_COMPOUND_EYES,
+ ABILITY_INSOMNIA,
+ ABILITY_COLOR_CHANGE,
+ ABILITY_IMMUNITY,
+ ABILITY_FLASH_FIRE,
+ ABILITY_SHIELD_DUST,
+ ABILITY_OWN_TEMPO,
+ ABILITY_SUCTION_CUPS,
+ ABILITY_INTIMIDATE,
+ ABILITY_SHADOW_TAG,
+ ABILITY_ROUGH_SKIN,
+ ABILITY_WONDER_GUARD,
+ ABILITY_LEVITATE,
+ ABILITY_EFFECT_SPORE,
+ ABILITY_SYNCHRONIZE,
+ ABILITY_CLEAR_BODY,
+ ABILITY_NATURAL_CURE,
+ ABILITY_LIGHTNING_ROD,
+ ABILITY_SERENE_GRACE,
+ ABILITY_SWIFT_SWIM,
+ ABILITY_CHLOROPHYLL,
+ ABILITY_ILLUMINATE,
+ ABILITY_TRACE,
+ ABILITY_HUGE_POWER,
+ ABILITY_POISON_POINT,
+ ABILITY_INNER_FOCUS,
+ ABILITY_MAGMA_ARMOR,
+ ABILITY_WATER_VEIL,
+ ABILITY_MAGNET_PULL,
+ ABILITY_SOUNDPROOF,
+ ABILITY_RAIN_DISH,
+ ABILITY_SAND_STREAM,
+ ABILITY_PRESSURE,
+ ABILITY_THICK_FAT,
+ ABILITY_EARLY_BIRD,
+ ABILITY_FLAME_BODY,
+ ABILITY_RUN_AWAY,
+ ABILITY_KEEN_EYE,
+ ABILITY_HYPER_CUTTER,
+ ABILITY_PICKUP,
+ ABILITY_TRUANT,
+ ABILITY_HUSTLE,
+ ABILITY_CUTE_CHARM,
+ ABILITY_PLUS,
+ ABILITY_MINUS,
+ ABILITY_FORECAST,
+ ABILITY_STICKY_HOLD,
+ ABILITY_SHED_SKIN,
+ ABILITY_GUTS,
+ ABILITY_MARVEL_SCALE,
+ ABILITY_LIQUID_OOZE,
+ ABILITY_OVERGROW,
+ ABILITY_BLAZE,
+ ABILITY_TORRENT,
+ ABILITY_SWARM,
+ ABILITY_ROCK_HEAD,
+ ABILITY_DROUGHT,
+ ABILITY_ARENA_TRAP,
+ ABILITY_VITAL_SPIRIT,
+ ABILITY_WHITE_SMOKE,
+ ABILITY_PURE_POWER,
+ ABILITY_SHELL_ARMOR,
+ ABILITY_CACOPHONY,
+ ABILITY_AIR_LOCK
+};
+
+#endif // GUARD_ABILITIES_H
diff --git a/include/battle.h b/include/battle.h
new file mode 100644
index 000000000..06daeb081
--- /dev/null
+++ b/include/battle.h
@@ -0,0 +1,19 @@
+#ifndef GUARD_BATTLE_H
+#define GUARD_BATTLE_H
+
+struct Trainer
+{
+ /*0x00*/ u8 partyFlags;
+ /*0x01*/ u8 trainerClass;
+ /*0x02*/ u8 encounterMusic:7;
+ /*0x02*/ u8 gender:1;
+ /*0x03*/ u8 trainerPic;
+ /*0x04*/ u8 trainerName[12];
+ /*0x10*/ u16 items[4];
+ /*0x18*/ bool8 doubleBattle;
+ /*0x1C*/ u32 aiFlags;
+ /*0x20*/ u8 partySize;
+ /*0x24*/ void *party;
+};
+
+#endif // GUARD_BATTLE_H
diff --git a/include/fieldmap.h b/include/fieldmap.h
index 44f31d5a4..16a80955a 100644
--- a/include/fieldmap.h
+++ b/include/fieldmap.h
@@ -112,7 +112,7 @@ struct MapHeader
u8 name;
u8 cave;
u8 weather;
- u8 light;
+ /* 0x17 */ u8 light;
u8 filler_18;
u8 escapeRope;
u8 flags;
@@ -165,14 +165,78 @@ struct MapObject
/*0x0C*/ struct Coords16 coords1;
/*0x10*/ struct Coords16 coords2;
/*0x14*/ struct Coords16 coords3;
- /*0x18*/ u8 mapobj_unk_18;
+ /*0x18*/ u8 mapobj_unk_18:4;
+ /*0x18*/ u8 placeholder18:4;
/*0x19*/ u8 mapobj_unk_19;
/*0x1A*/ u8 mapobj_unk_1A;
/*0x1B*/ u8 mapobj_unk_1B;
/*0x1C*/ u8 mapobj_unk_1C;
/*0x1D*/ u8 trainerRange_berryTreeId;
/*0x1E*/ u8 mapobj_unk_1E;
- /*0x1E*/ u8 mapobj_unk_1F;
+ /*0x1F*/ u8 mapobj_unk_1F;
+ /*0x20*/ u8 mapobj_unk_20;
+ /*0x21*/ u8 mapobj_unk_21;
+ /*0x22*/ u8 mapobj_unk_22;
+ /*size = 0x24*/
+};
+
+// THIS IS NEEDED TO MAKE TRAINER_SEE.C MATCH, PLEASE DO NOT REMOVE UNLESS YOU FIX CHECKPATHBETWEENTRAINERANDPLAYER
+struct MapObject2
+{
+ /*0x00*/ u32 active:1;
+ u32 mapobj_bit_1:1;
+ u32 mapobj_bit_2:1;
+ u32 mapobj_bit_3:1;
+ u32 mapobj_bit_4:1;
+ u32 mapobj_bit_5:1;
+ u32 mapobj_bit_6:1;
+ u32 mapobj_bit_7:1;
+ /*0x01*/ u32 mapobj_bit_8:1;
+ u32 mapobj_bit_9:1;
+ u32 mapobj_bit_10:1;
+ u32 mapobj_bit_11:1;
+ u32 mapobj_bit_12:1;
+ u32 mapobj_bit_13:1;
+ u32 mapobj_bit_14:1;
+ u32 mapobj_bit_15:1;
+ /*0x02*/ u32 mapobj_bit_16:1;
+ u32 mapobj_bit_17:1;
+ u32 mapobj_bit_18:1;
+ u32 mapobj_bit_19:1;
+ u32 mapobj_bit_20:1;
+ u32 mapobj_bit_21:1;
+ u32 mapobj_bit_22:1;
+ u32 mapobj_bit_23:1;
+ /*0x03*/ u32 mapobj_bit_24:1;
+ u32 mapobj_bit_25:1;
+ u32 mapobj_bit_26:1;
+ u32 mapobj_bit_27:1;
+ u32 mapobj_bit_28:1;
+ u32 mapobj_bit_29:1;
+ u32 mapobj_bit_30:1;
+ u32 mapobj_bit_31:1;
+ /*0x04*/ u8 spriteId;
+ /*0x05*/ u8 graphicsId;
+ /*0x06*/ u8 animPattern;
+ /*0x07*/ u8 trainerType;
+ /*0x08*/ u8 localId;
+ /*0x09*/ u8 mapNum;
+ /*0x0A*/ u8 mapGroup;
+ /*0x0B*/ u8 mapobj_unk_0B_0:4;
+ u8 elevation:4;
+ /*0x0C*/ struct Coords16 coords1;
+ /*0x10*/ struct Coords16 coords2;
+ /*0x14*/ struct Coords16 coords3;
+ /*0x18*/ u8 mapobj_unk_18:4;
+ /*0x18*/ u8 placeholder18:4;
+ /*0x19*/ u8 mapobj_unk_19:4;
+ /*0x19*/ u8 mapobj_unk_19b:4;
+ /*0x1A*/ u8 mapobj_unk_1A;
+ /*0x1B*/ u8 mapobj_unk_1B;
+ /*0x1C*/ u8 mapobj_unk_1C;
+ /*0x1D*/ u8 trainerRange_berryTreeId;
+ /*0x1E*/ u8 mapobj_unk_1E;
+ /*0x1F*/ u8 mapobj_unk_1F;
/*0x20*/ u8 mapobj_unk_20;
/*0x21*/ u8 mapobj_unk_21;
/*size = 0x24*/
@@ -198,14 +262,25 @@ struct MapObjectGraphicsInfo
union AffineAnimCmd **affineAnims;
};
+#define PLAYER_AVATAR_FLAG_0 (1 << 0)
+#define PLAYER_AVATAR_FLAG_1 (1 << 1)
+#define PLAYER_AVATAR_FLAG_2 (1 << 2)
+#define PLAYER_AVATAR_FLAG_3 (1 << 3)
+#define PLAYER_AVATAR_FLAG_4 (1 << 4)
+#define PLAYER_AVATAR_FLAG_5 (1 << 5)
+#define PLAYER_AVATAR_FLAG_6 (1 << 6)
+#define PLAYER_AVATAR_FLAG_7 (1 << 7)
+
struct PlayerAvatar
{
- u8 bitfield;
- u8 bike;
- u8 running2;
- u8 running1;
- u8 spriteId;
- u8 mapObjectId;
+ /*0x00*/ u8 flags;
+ /*0x01*/ u8 bike;
+ /*0x02*/ u8 running2;
+ /*0x03*/ u8 running1;
+ /*0x04*/ u8 spriteId;
+ /*0x05*/ u8 mapObjectId;
+ /*0x06*/ u8 unk6;
+ /*0x07*/ u8 gender;
// TODO: rest of struct
};
diff --git a/include/flag.h b/include/flag.h
new file mode 100644
index 000000000..8f4c01b02
--- /dev/null
+++ b/include/flag.h
@@ -0,0 +1,11 @@
+#ifndef GUARD_FLAG_H
+#define GUARD_FLAG_H
+
+#include "flags.h"
+
+u8 *GetFlagPointer(u16 id);
+u8 FlagSet(u16 id);
+u8 FlagReset(u16 id);
+bool8 FlagGet(u16 id);
+
+#endif // GUARD_FLAG_H
diff --git a/include/flags.h b/include/flags.h
new file mode 100644
index 000000000..e2b14b16b
--- /dev/null
+++ b/include/flags.h
@@ -0,0 +1,41 @@
+#ifndef GUARD_FLAGS_H
+#define GUARD_FLAGS_H
+
+#define TRAINER_FLAG_START 0x500
+
+// SYSTEM FLAGS
+
+#define SYS_POKEMON_GET 0x800
+#define SYS_POKEDEX_GET 0x801
+#define SYS_POKENAV_GET 0x802
+
+// badges
+#define BADGE01_GET 0x807
+#define BADGE02_GET 0x808
+#define BADGE03_GET 0x809
+#define BADGE04_GET 0x80A
+#define BADGE05_GET 0x80B
+#define BADGE06_GET 0x80C
+#define BADGE07_GET 0x80D
+#define BADGE08_GET 0x80E
+
+#define SYS_USE_FLASH 0x828
+#define SYS_USE_STRENGTH 0x829
+#define SYS_WEATHER_CTRL 0x82A
+#define SYS_CYCLING_ROAD 0x82B
+#define SYS_SAFARI_MODE 0x82C
+#define SYS_CRUISE_MODE 0x82D
+
+#define SYS_POPWORD_INPUT 0x833
+#define SYS_MIX_RECORD 0x834
+
+#define SYS_RIBBON_GET 0x83B
+
+#define SYS_ENC_UP_ITEM 0x84D
+#define SYS_ENC_DOWN_ITEM 0x84E
+
+// SPECIAL FLAGS (unknown purpose)
+
+#define SPECIAL_FLAG_1 0x4001
+
+#endif // GUARD_FLAGS_H
diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h
index 84b448243..f5d44de99 100644
--- a/include/gba/m4a_internal.h
+++ b/include/gba/m4a_internal.h
@@ -365,7 +365,7 @@ extern const u8 gNoiseTable[];
extern const struct PokemonCrySong gPokemonCrySongTemplate;
-extern const struct ToneData voicegroup_842FC88;
+extern const struct ToneData voicegroup_pokemon_cry;
extern char gNumMusicPlayers[];
extern char gMaxLines[];
diff --git a/include/gba/syscall.h b/include/gba/syscall.h
index 3f41abba1..9576f7e99 100644
--- a/include/gba/syscall.h
+++ b/include/gba/syscall.h
@@ -17,6 +17,10 @@ void RegisterRamReset(u32 resetFlags);
void VBlankIntrWait(void);
+u16 Sqrt(u32 num);
+
+u16 ArcTan2(s16 x, s16 y);
+
#define CPU_SET_SRC_FIXED 0x01000000
#define CPU_SET_16BIT 0x00000000
#define CPU_SET_32BIT 0x04000000
@@ -29,4 +33,12 @@ void CpuFastSet(const void *src, void *dest, u32 control);
void ObjAffineSet(struct ObjAffineSrcData *src, void *dest, s32 count, s32 offset);
+void LZ77UnCompWram(const void *src, void *dest);
+
+void LZ77UnCompVram(const void *src, void *dest);
+
+void RLUnCompWram(const void *src, void *dest);
+
+void RLUnCompVram(const void *src, void *dest);
+
#endif // GUARD_GBA_SYSCALL_H
diff --git a/include/global.h b/include/global.h
index 1691b7776..b1bfa25ad 100644
--- a/include/global.h
+++ b/include/global.h
@@ -110,7 +110,7 @@ struct WarpData
struct ItemSlot
{
u16 itemId;
- u8 quantity;
+ u16 quantity;
};
struct Pokeblock
@@ -160,6 +160,15 @@ struct SB1_2EFC_Struct
u8 unknown[0x20];
};
+struct EasyChatPair
+{
+ u16 unk0_0:7;
+ u16 unk0_7:7;
+ u16 unk1_6:1;
+ u16 unk2;
+ u16 words[2];
+}; /*size = 0x8*/
+
struct SaveBlock1
{
/*0x00*/ struct Coords16 pos;
@@ -173,25 +182,25 @@ struct SaveBlock1
/*0x2F*/ u8 filler_2F;
/*0x30*/ u8 flashUsed;
/*0x32*/ u16 mapDataId;
- u16 mapView[0x100];
- u8 playerPartyCount;
- struct Pokemon playerParty[6];
- u32 money;
- u16 coins;
- u16 registeredItem; // registered for use with SELECT button
- struct ItemSlot pcItems[50];
- struct ItemSlot bagPocket_Items[20];
- struct ItemSlot bagPocket_KeyItems[20];
- struct ItemSlot bagPocket_PokeBalls[16];
- struct ItemSlot bagPocket_TMHM[64];
- struct ItemSlot bagPocket_Berries[46];
- struct Pokeblock pokeblocks[40];
- u8 unk938[52]; // pokedex related
- u16 berryBlenderRecords[3];
- u8 filler_972[0x6];
- u16 trainerRematchStepCounter;
- u8 trainerRematches[100];
- struct MapObject mapObjects[16];
+ /*0x34*/ u16 mapView[0x100];
+ /*0x234*/ u8 playerPartyCount;
+ /*0x238*/ struct Pokemon playerParty[6];
+ /*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[20];
+ /*0x5B0*/ struct ItemSlot bagPocket_KeyItems[20];
+ /*0x600*/ struct ItemSlot bagPocket_PokeBalls[16];
+ /*0x640*/ struct ItemSlot bagPocket_TMHM[64];
+ /*0x740*/ struct ItemSlot bagPocket_Berries[46];
+ /*0x7F8*/ struct Pokeblock pokeblocks[40];
+ /*0x938*/ u8 unk938[52]; // pokedex related
+ /*0x96C*/ u16 berryBlenderRecords[3];
+ /*0x972*/ u8 filler_972[0x6];
+ /*0x978*/ u16 trainerRematchStepCounter;
+ /*0x97A*/ u8 trainerRematches[100];
+ /*0x9E0*/ struct MapObject mapObjects[16];
/*0xC20*/ struct MapObjectTemplate mapObjectTemplates[64];
/*0x1220*/ u8 flags[0x120];
/*0x1340*/ u16 vars[0x100];
@@ -200,16 +209,16 @@ struct SaveBlock1
/*0x1A08*/ struct SecretBaseRecord secretBases[20];
/*0x2688*/ u8 playerRoomDecor[12];
/*0x2694*/ u8 playerRoomDecorPos[12];
- u8 decorDesk[10];
- u8 decorChair[10];
- u8 decorPlant[10];
- u8 decorOrnament[30];
- u8 decorMat[30];
- u8 decorPoster[10];
- u8 decorDoll[40];
- u8 decorCushion[10];
- u8 padding_2736[2];
- u8 tvShows[24][36]; // TODO: TV show struct
+ /*0x26A0*/ u8 decorDesk[10];
+ /*0x26AA*/ u8 decorChair[10];
+ /*0x26B4*/ u8 decorPlant[10];
+ /*0x26BE*/ u8 decorOrnament[30];
+ /*0x26DC*/ u8 decorMat[30];
+ /*0x26FA*/ u8 decorPoster[10];
+ /*0x2704*/ u8 decorDoll[40];
+ /*0x272C*/ u8 decorCushion[10];
+ /*0x2736*/ u8 padding_2736[2];
+ /*0x2738*/ u8 tvShows[24][36]; // TODO: TV show struct
/*0x2A98*/ u8 filler_2A98[0x64];
/*0x2AFC*/ u16 outbreakPokemonSpecies;
/*0x2AFE*/ u8 outbreakLocationMapNum;
@@ -219,17 +228,23 @@ struct SaveBlock1
/*0x2B04*/ u16 outbreakPokemonMoves[4];
/*0x2B0C*/ u8 unk2B0C;
/*0x2B0D*/ u8 outbreakPokemonProbability;
- /*0x2B0E*/ u8 filler_2B0E[0x2C8];
- /*0x2DD6*/ u16 feebasLocationSeed;
- /*0x2DD8*/ u8 filler_2DD8[0x124];
- struct SB1_2EFC_Struct sb1_2EFC_struct[5];
- u8 filler_2F9C[0x1A8];
+ /*0x2B0E*/ u8 filler_2B0E[0x2C6];
+ /*0x2DD4*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff
+ /*0x2DFC*/ u8 filler_2DFC[0x100];
+ /*0x2EFC*/ struct SB1_2EFC_Struct sb1_2EFC_struct[5];
+ /*0x2F9C*/ u8 filler_2F9C[0xA0];
+ /*0x303C*/ u8 filler_303C[0x38];
+ /*0x3074*/ u8 filler_3074[0x42];
+ /*0x30B6*/ u8 filler_30B6;
+ /*0x30B7*/ u8 filler_30B7[0x59];
+ /*0x3110*/ u8 giftRibbons[7];
+ /*0x3117*/ u8 filler_311B[0x2D];
/*0x3144*/ struct Roamer roamer;
/*0x3158*/ u8 filler_3158[0x8];
- struct EnigmaBerry enigmaBerry;
- struct RamScript ramScript;
- u8 filler_3A7C[0x10];
- u8 unk3A8C[52]; //pokedex related
+ /*0x3160*/ struct EnigmaBerry enigmaBerry;
+ /*0x3690*/ struct RamScript ramScript;
+ /*0x3A7C*/ u8 filler_3A7C[0x10];
+ /*0x3A8C*/ u8 unk3A8C[52]; //pokedex related
};
extern struct SaveBlock1 gSaveBlock1;
diff --git a/include/link.h b/include/link.h
index f857b6d19..550102fb9 100644
--- a/include/link.h
+++ b/include/link.h
@@ -154,7 +154,7 @@ u8 bitmask_all_link_players_but_self(void);
bool8 SendBlock(u8, void *, u16);
bool8 sub_8007E9C(u8);
bool8 sub_8007ECC(void);
-u8 GetBlockRecievedStatus(void);
+u8 GetBlockReceivedStatus(void);
void ResetBlockReceivedFlags(void);
void ResetBlockReceivedFlag(u8);
void sub_8007F4C(void);
diff --git a/include/pokemon.h b/include/pokemon.h
index 43ff1b500..450a8174f 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -242,80 +242,72 @@ struct UnknownPokemonStruct
struct BattlePokemon
{
- u16 species;
- u16 attack;
- u16 defense;
- u16 speed;
- u16 spAttack;
- u16 spDefense;
- u16 moves[4];
- u32 hpIV:5;
- u32 attackIV:5;
- u32 defenseIV:5;
- u32 speedIV:5;
- u32 spAttackIV:5;
- u32 spDefenseIV:5;
- u32 isEgg:1;
- u32 altAbility:1;
- s8 statStages[8];
- u8 ability;
- u8 type1, type2;
- u8 unknown;
- u8 pp[4];
- u16 hp;
- u8 level;
- u8 friendship;
- u16 maxHP;
- u16 item;
- u8 nickname[POKEMON_NAME_LENGTH + 1];
- u8 ppBonuses;
- u8 otName[8];
- u32 experience;
- u32 personality;
- u32 status1;
- u32 status2;
- u32 otId;
+ /* 0x00 */ u16 species;
+ /* 0x02 */ u16 attack;
+ /* 0x04 */ u16 defense;
+ /* 0x06 */ u16 speed;
+ /* 0x08 */ u16 spAttack;
+ /* 0x0A */ u16 spDefense;
+ /* 0x0C */ u16 moves[4];
+ /* 0x14 */ u32 hpIV:5;
+ /* 0x14 */ u32 attackIV:5;
+ /* 0x15 */ u32 defenseIV:5;
+ /* 0x15 */ u32 speedIV:5;
+ /* 0x16 */ u32 spAttackIV:5;
+ /* 0x17 */ u32 spDefenseIV:5;
+ /* 0x17 */ u32 isEgg:1;
+ /* 0x17 */ u32 altAbility:1;
+ /* 0x18 */ s8 statStages[8];
+ /* 0x20 */ u8 ability;
+ /* 0x21 */ u8 type1;
+ /* 0x22 */ u8 type2;
+ /* 0x23 */ u8 unknown;
+ /* 0x24 */ u8 pp[4];
+ /* 0x28 */ u16 hp;
+ /* 0x2A */ u8 level;
+ /* 0x2B */ u8 friendship;
+ /* 0x2C */ u16 maxHP;
+ /* 0x2E */ u16 item;
+ /* 0x30 */ u8 nickname[POKEMON_NAME_LENGTH + 1];
+ /* 0x3B */ u8 ppBonuses;
+ /* 0x3C */ u8 otName[8];
+ /* 0x44 */ u32 experience;
+ /* 0x48 */ u32 personality;
+ /* 0x4C */ u32 status1;
+ /* 0x50 */ u32 status2;
+ /* 0x54 */ u32 otId;
};
struct BaseStats
{
- u8 baseHP;
- u8 baseAttack;
- u8 baseDefense;
- u8 baseSpeed;
- u8 baseSpAttack;
- u8 baseSpDefense;
-
- u8 type1, type2;
-
- u8 catchRate;
-
- u8 expYield;
-
- u16 evYield_HP:2;
- u16 evYield_Attack:2;
- u16 evYield_Defense:2;
- u16 evYield_Speed:2;
- u16 evYield_SpAttack:2;
- u16 evYield_SpDefense:2;
-
- u16 item1, item2;
-
- u8 genderRatio;
-
- u8 eggCycles;
-
- u8 friendship;
-
- u8 growthRate;
-
- u8 eggGroup1, eggGroup2;
-
- u8 ability1, ability2;
-
- u8 safariZoneFleeRate;
-
- u8 bodyColor;
+ /* 0x00 */ u8 baseHP;
+ /* 0x01 */ u8 baseAttack;
+ /* 0x02 */ u8 baseDefense;
+ /* 0x03 */ u8 baseSpeed;
+ /* 0x04 */ u8 baseSpAttack;
+ /* 0x05 */ u8 baseSpDefense;
+ /* 0x06 */ u8 type1;
+ /* 0x07 */ u8 type2;
+ /* 0x08 */ u8 catchRate;
+ /* 0x09 */ u8 expYield;
+ /* 0x0A */ u16 evYield_HP:2;
+ /* 0x0A */ u16 evYield_Attack:2;
+ /* 0x0A */ u16 evYield_Defense:2;
+ /* 0x0A */ u16 evYield_Speed:2;
+ /* 0x0B */ u16 evYield_SpAttack:2;
+ /* 0x0B */ u16 evYield_SpDefense:2;
+ /* 0x0C */ u16 item1;
+ /* 0x0E */ u16 item2;
+ /* 0x10 */ u8 genderRatio;
+ /* 0x11 */ u8 eggCycles;
+ /* 0x12 */ u8 friendship;
+ /* 0x13 */ u8 growthRate;
+ /* 0x14 */ u8 eggGroup1;
+ /* 0x15 */ u8 eggGroup2;
+ /* 0x16 */ u8 ability1;
+ /* 0x17 */ u8 ability2;
+ /* 0x18 */ u8 safariZoneFleeRate;
+ /* 0x19 */ u8 bodyColor;
};
struct BattleMove
@@ -337,6 +329,9 @@ struct PokemonStorage
struct BoxPokemon boxes[14][30];
};
+extern struct Pokemon gPlayerParty[6];
+extern struct Pokemon gEnemyParty[6];
+
void ZeroBoxMonData(struct BoxPokemon *boxMon);
void ZeroMonData(struct Pokemon *mon);
void ZeroPlayerPartyMons(void);
diff --git a/include/sprite.h b/include/sprite.h
index 288b88518..2da099d59 100644
--- a/include/sprite.h
+++ b/include/sprite.h
@@ -193,7 +193,7 @@ extern struct Sprite gSprites[];
void ResetSpriteData(void);
void AnimateSprites(void);
void BuildOamBuffer(void);
-u8 CreateSprite(struct SpriteTemplate *template, u16 x, u16 y, u8 subpriority);
+u8 CreateSprite(struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
u8 CreateSpriteAtEnd(struct SpriteTemplate *template, u16 x, u16 y, u8 subpriority);
u8 CreateInvisibleSprite(void (*callback)(struct Sprite *));
u8 CreateSpriteAndAnimate(struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority);
diff --git a/include/trainer.h b/include/trainer.h
new file mode 100644
index 000000000..232cde608
--- /dev/null
+++ b/include/trainer.h
@@ -0,0 +1,19 @@
+#ifndef GUARD_TRAINER_H
+#define GUARD_TRAINER_H
+
+#define TRAINER_ENCOUNTER_MUSIC_MALE 0 // standard male encounter music
+#define TRAINER_ENCOUNTER_MUSIC_FEMALE 1 // standard female encounter music
+#define TRAINER_ENCOUNTER_MUSIC_GIRL 2 // used for male Tubers and Young Couples too
+#define TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS 3
+#define TRAINER_ENCOUNTER_MUSIC_INTENSE 4
+#define TRAINER_ENCOUNTER_MUSIC_COOL 5
+#define TRAINER_ENCOUNTER_MUSIC_AQUA 6
+#define TRAINER_ENCOUNTER_MUSIC_MAGMA 7
+#define TRAINER_ENCOUNTER_MUSIC_SWIMMER 8
+#define TRAINER_ENCOUNTER_MUSIC_TWINS 9 // used for other trainer classes too
+#define TRAINER_ENCOUNTER_MUSIC_ELITE_FOUR 10
+#define TRAINER_ENCOUNTER_MUSIC_HIKER 11 // used for other trainer classes too
+#define TRAINER_ENCOUNTER_MUSIC_INTERVIEWER 12
+#define TRAINER_ENCOUNTER_MUSIC_RICH 13 // Rich Boys and Gentlemen
+
+#endif // GUARD_TRAINER_H
diff --git a/include/var.h b/include/var.h
new file mode 100644
index 000000000..c76b8c411
--- /dev/null
+++ b/include/var.h
@@ -0,0 +1,11 @@
+#ifndef GUARD_VAR_H
+#define GUARD_VAR_H
+
+#include "vars.h"
+
+u16 *GetVarPointer(u16 id);
+u16 VarGet(u16 id);
+bool8 VarSet(u16 id, u16 value);
+u8 VarGetFieldObjectGraphicsId(u8 id);
+
+#endif // GUARD_VAR_H
diff --git a/include/vars.h b/include/vars.h
new file mode 100644
index 000000000..db6f097b7
--- /dev/null
+++ b/include/vars.h
@@ -0,0 +1,6 @@
+#ifndef GUARD_VARS_H
+#define GUARD_VARS_H
+
+#define VAR_REPEL_STEP_COUNT 0x4021
+
+#endif // GUARD_VARS_H