summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gba/defines.h2
-rw-r--r--include/gba/m4a_internal.h10
-rw-r--r--include/global.h6
-rw-r--r--include/pokemon.h385
-rw-r--r--include/species.h391
-rw-r--r--include/sprite.h16
-rw-r--r--include/text.h2
-rw-r--r--include/text_window.h19
8 files changed, 817 insertions, 14 deletions
diff --git a/include/gba/defines.h b/include/gba/defines.h
index ea363109f..f3fa53496 100644
--- a/include/gba/defines.h
+++ b/include/gba/defines.h
@@ -75,4 +75,6 @@
#define RGB_BLACK RGB(0, 0, 0)
#define RGB_WHITE RGB(31, 31, 31)
+#define WIN_RANGE(a, b) (((a) << 8) | (b))
+
#endif // GUARD_GBA_DEFINES
diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h
index c09cde31f..6e202e7b8 100644
--- a/include/gba/m4a_internal.h
+++ b/include/gba/m4a_internal.h
@@ -45,8 +45,8 @@ struct WaveData
#define TONEDATA_TYPE_CGB 0x07
#define TONEDATA_TYPE_FIX 0x08
-#define TONEDATA_TYPE_SPL 0x40
-#define TONEDATA_TYPE_RHY 0x80
+#define TONEDATA_TYPE_SPL 0x40 // key split
+#define TONEDATA_TYPE_RHY 0x80 // rhythm
#define TONEDATA_P_S_PAN 0xc0
#define TONEDATA_P_S_PAM TONEDATA_P_S_PAN
@@ -241,9 +241,9 @@ struct MusicPlayerTrack
u8 wai;
u8 patP;
u8 repN;
- u8 gat;
+ u8 gateTime;
u8 key;
- u8 vel;
+ u8 velocity;
u8 run;
u8 keyM;
u8 pitM;
@@ -365,7 +365,7 @@ extern const u8 gNoiseTable[];
extern const struct PokemonCrySong gPokemonCrySongTemplate;
-extern const struct ToneData gUnknown_0842FC88;
+extern const struct ToneData voicegroup_842FC88;
extern char gNumMusicPlayers[];
extern char gMaxLines[];
diff --git a/include/global.h b/include/global.h
index 2f47e7ed0..8aba50d74 100644
--- a/include/global.h
+++ b/include/global.h
@@ -18,6 +18,12 @@ extern u8 gStringVar3[];
enum
{
+ VERSION_SAPPHIRE = 1,
+ VERSION_RUBY = 2,
+};
+
+enum
+{
MALE,
FEMALE
};
diff --git a/include/pokemon.h b/include/pokemon.h
new file mode 100644
index 000000000..b1ccf2704
--- /dev/null
+++ b/include/pokemon.h
@@ -0,0 +1,385 @@
+#ifndef GUARD_POKEMON_H
+#define GUARD_POKEMON_H
+
+#define MON_DATA_PERSONALITY 0
+#define MON_DATA_OT_ID 1
+#define MON_DATA_NICKNAME 2
+#define MON_DATA_LANGUAGE 3
+#define MON_DATA_SANITY_BIT1 4
+#define MON_DATA_SANITY_BIT2 5
+#define MON_DATA_SANITY_BIT3 6
+#define MON_DATA_OT_NAME 7
+#define MON_DATA_MARKINGS 8
+#define MON_DATA_CHECKSUM 9
+#define MON_DATA_10 10
+#define MON_DATA_SPECIES 11
+#define MON_DATA_HELD_ITEM 12
+#define MON_DATA_MOVE1 13
+#define MON_DATA_MOVE2 14
+#define MON_DATA_MOVE3 15
+#define MON_DATA_MOVE4 16
+#define MON_DATA_PP1 17
+#define MON_DATA_PP2 18
+#define MON_DATA_PP3 19
+#define MON_DATA_PP4 20
+#define MON_DATA_PP_BONUSES 21
+#define MON_DATA_COOL 22
+#define MON_DATA_BEAUTY 23
+#define MON_DATA_CUTE 24
+#define MON_DATA_EXP 25
+#define MON_DATA_HP_EV 26
+#define MON_DATA_ATK_EV 27
+#define MON_DATA_DEF_EV 28
+#define MON_DATA_SPD_EV 29
+#define MON_DATA_SPATK_EV 30
+#define MON_DATA_SPDEF_EV 31
+#define MON_DATA_FRIENDSHIP 32
+#define MON_DATA_SMART 33
+#define MON_DATA_POKERUS 34
+#define MON_DATA_MET_LOCATION 35
+#define MON_DATA_MET_LEVEL 36
+#define MON_DATA_MET_GAME 37
+#define MON_DATA_POKEBALL 38
+#define MON_DATA_HP_IV 39
+#define MON_DATA_ATK_IV 40
+#define MON_DATA_DEF_IV 41
+#define MON_DATA_SPD_IV 42
+#define MON_DATA_SPATK_IV 43
+#define MON_DATA_SPDEF_IV 44
+#define MON_DATA_IS_EGG 45
+#define MON_DATA_ALT_ABILITY 46
+#define MON_DATA_TOUGH 47
+#define MON_DATA_SHEEN 48
+#define MON_DATA_OT_GENDER 49
+#define MON_DATA_COOL_RIBBON 50
+#define MON_DATA_BEAUTY_RIBBON 51
+#define MON_DATA_CUTE_RIBBON 52
+#define MON_DATA_SMART_RIBBON 53
+#define MON_DATA_TOUGH_RIBBON 54
+#define MON_DATA_STATUS 55
+#define MON_DATA_LEVEL 56
+#define MON_DATA_HP 57
+#define MON_DATA_MAX_HP 58
+#define MON_DATA_ATK 59
+#define MON_DATA_DEF 60
+#define MON_DATA_SPD 61
+#define MON_DATA_SPATK 62
+#define MON_DATA_SPDEF 63
+#define MON_DATA_64 64
+#define MON_DATA_SPECIES2 65
+#define MON_DATA_IVS 66
+#define MON_DATA_CHAMPION_RIBBON 67
+#define MON_DATA_WINNING_RIBBON 68
+#define MON_DATA_VICTORY_RIBBON 69
+#define MON_DATA_ARTIST_RIBBON 70
+#define MON_DATA_EFFORT_RIBBON 71
+#define MON_DATA_GIFT_RIBBON_1 72
+#define MON_DATA_GIFT_RIBBON_2 73
+#define MON_DATA_GIFT_RIBBON_3 74
+#define MON_DATA_GIFT_RIBBON_4 75
+#define MON_DATA_GIFT_RIBBON_5 76
+#define MON_DATA_GIFT_RIBBON_6 77
+#define MON_DATA_GIFT_RIBBON_7 78
+#define MON_DATA_FATEFUL_ENCOUNTER 79
+#define MON_DATA_KNOWN_MOVES 80
+#define MON_DATA_RIBBON_COUNT 81
+#define MON_DATA_RIBBONS 82
+#define MON_DATA_83 83
+#define MON_DATA_ATK2 84
+#define MON_DATA_DEF2 85
+#define MON_DATA_SPD2 86
+#define MON_DATA_SPATK2 87
+#define MON_DATA_SPDEF2 88
+
+#define MON_MALE 0x00
+#define MON_FEMALE 0xFE
+#define MON_GENDERLESS 0xFF
+
+struct PokemonSubstruct0
+{
+ u16 species;
+ u16 heldItem;
+ u32 experience;
+ u8 ppBonuses;
+ u8 friendship;
+};
+
+struct PokemonSubstruct1
+{
+ u16 moves[4];
+ u8 pp[4];
+};
+
+struct PokemonSubstruct2
+{
+ u8 hpEV;
+ u8 attackEV;
+ u8 defenseEV;
+ u8 speedEV;
+ u8 spAttackEV;
+ u8 spDefenseEV;
+ u8 cool;
+ u8 beauty;
+ u8 cute;
+ u8 smart;
+ u8 tough;
+ u8 sheen;
+};
+
+struct PokemonSubstruct3
+{
+ u8 pokerus;
+ u8 metLocation;
+
+ u16 metLevel:7;
+ u16 metGame:4;
+ u16 pokeball:4;
+ u16 otGender:1;
+
+ u32 hpIV:5;
+ u32 attackIV:5;
+ u32 defenseIV:5;
+ u32 speedIV:5;
+ u32 spAttackIV:5;
+ u32 spDefenseIV:5;
+ u32 isEgg:1;
+ u32 altAbility:1;
+
+ u32 coolRibbon:3;
+ u32 beautyRibbon:3;
+ u32 cuteRibbon:3;
+ u32 smartRibbon:3;
+ u32 toughRibbon:3;
+ u32 championRibbon:1;
+ u32 winningRibbon:1;
+ u32 victoryRibbon:1;
+ u32 artistRibbon:1;
+ u32 effortRibbon:1;
+ u32 giftRibbon1:1;
+ u32 giftRibbon2:1;
+ u32 giftRibbon3:1;
+ u32 giftRibbon4:1;
+ u32 giftRibbon5:1;
+ u32 giftRibbon6:1;
+ u32 giftRibbon7:1;
+ u32 fatefulEncounter:5; // unused in Ruby/Sapphire, but the high bit must be set for Mew/Deoxys to obey in FR/LG/Emerald
+};
+
+union PokemonSubstruct
+{
+ struct PokemonSubstruct0 type0;
+ struct PokemonSubstruct1 type1;
+ struct PokemonSubstruct2 type2;
+ struct PokemonSubstruct3 type3;
+ u16 raw[6];
+};
+
+struct BoxPokemon
+{
+ u32 personality;
+ u32 otId;
+ u8 nickname[10];
+ u8 language;
+ u8 isBadEgg:1;
+ u8 sanity2:1;
+ u8 sanity3:1;
+ u8 unused:5;
+ u8 otName[7];
+ u8 markings;
+ u16 checksum;
+ u16 unknown;
+
+ union
+ {
+ u32 raw[12];
+ union PokemonSubstruct substructs[4];
+ } secure;
+};
+
+struct Pokemon
+{
+ struct BoxPokemon box;
+ u32 status;
+ u8 level;
+ u8 pokerus;
+ u16 hp;
+ u16 maxHP;
+ u16 attack;
+ u16 defense;
+ u16 speed;
+ u16 spAttack;
+ u16 spDefense;
+};
+
+struct UnknownPokemonStruct
+{
+ u16 species;
+ u16 heldItem;
+ u16 moves[4];
+ u8 level;
+ u8 ppBonuses;
+ u8 hpEV;
+ u8 attackEV;
+ u8 defenseEV;
+ u8 speedEV;
+ u8 spAttackEV;
+ u8 spDefenseEV;
+ u32 otId;
+ u32 hpIV:5;
+ u32 attackIV:5;
+ u32 defenseIV:5;
+ u32 speedIV:5;
+ u32 spAttackIV:5;
+ u32 spDefenseIV:5;
+ u32 gap:1;
+ u32 altAbility:1;
+ u32 personality;
+ u8 nickname[11];
+ u8 friendship;
+};
+
+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;
+ u8 hpStage; // not used
+ u8 attackStage;
+ u8 defenseStage;
+ u8 speedStage;
+ u8 spAttackStage;
+ u8 spDefenseStage;
+ u8 accuracyStage;
+ u8 evasionStage;
+ u8 ability;
+ u8 type1, type2;
+ u8 unknown;
+ u8 pp[4];
+ u16 hp;
+ u8 level;
+ u8 friendship;
+ u16 maxHP;
+ u16 item;
+ u8 nickname[11];
+ u8 unknown2;
+ u8 otName[8];
+ u32 unknown3;
+ u32 personality;
+ u32 status1;
+ u32 status2;
+ 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;
+};
+
+struct BattleMove
+{
+ u8 effect;
+ u8 power;
+ u8 type;
+ u8 accuracy;
+ u8 pp;
+ u8 secondaryEffectChance;
+ u8 target;
+ u8 priority;
+ u32 flags;
+};
+
+void ZeroBoxMonData(struct BoxPokemon *boxMon);
+void ZeroMonData(struct Pokemon *mon);
+void ZeroPlayerPartyMons(void);
+void ZeroEnemyPartyMons(void);
+void CreateMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
+void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
+void CreateMonWithNature(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 nature);
+void CreateMonWithGenderNatureLetter(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 gender, u8 nature, u8 unownLetter);
+void CreateMaleMon(struct Pokemon *mon, u16 species, u8 level);
+void CreateMonWithIVsPersonality(struct Pokemon *mon, u16 species, u8 level, u32 ivs, u32 personality);
+void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u32 otId);
+void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 evSpread);
+void sub_803ADE8(struct Pokemon *mon, struct UnknownPokemonStruct *src);
+void sub_803AF78(struct Pokemon *mon, struct UnknownPokemonStruct *dest);
+u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon);
+void CalculateMonStats(struct Pokemon *mon);
+void sub_803B4B4(struct Pokemon *src, struct Pokemon *dest);
+u8 GetLevelFromMonExp(struct Pokemon *mon);
+u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon);
+u16 GiveMoveToMon(struct Pokemon *mon, u16 move);
+u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
+u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move);
+void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot);
+void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot);
+void GiveMonInitialMoveset(struct Pokemon *mon);
+void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon);
+u16 sub_803B7C8(struct Pokemon *mon, u8 a2);
+void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move);
+void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
+
+u8 GetMonGender(struct Pokemon *mon);
+u8 GetBoxMonGender(struct BoxPokemon *boxMon);
+u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);
+void GetMonSpriteTemplate_803C56C(u16 species, u8 a2);
+void GetMonSpriteTemplate_803C5A0(u16 species, u8 a2);
+void EncryptBoxMon(struct BoxPokemon *boxMon);
+void DecryptBoxMon(struct BoxPokemon *boxMon);
+union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType);
+u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data);
+u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data);
+void SetMonData(struct Pokemon *mon, s32 field, u8 *data);
+void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const u8 *data);
+
+u8 GetNature(struct Pokemon *mon);
+u8 GetNatureFromPersonality(u32 personality);
+
+u16 nature_stat_mod(u8 nature, u16 n, u8 statIndex);
+
+#endif // GUARD_POKEMON_H
diff --git a/include/species.h b/include/species.h
new file mode 100644
index 000000000..1d663c145
--- /dev/null
+++ b/include/species.h
@@ -0,0 +1,391 @@
+#ifndef GUARD_SPECIES_H
+#define GUARD_SPECIES_H
+
+#define SPECIES_BULBASAUR 0x001
+#define SPECIES_IVYSAUR 0x002
+#define SPECIES_VENUSAUR 0x003
+#define SPECIES_CHARMANDER 0x004
+#define SPECIES_CHARMELEON 0x005
+#define SPECIES_CHARIZARD 0x006
+#define SPECIES_SQUIRTLE 0x007
+#define SPECIES_WARTORTLE 0x008
+#define SPECIES_BLASTOISE 0x009
+#define SPECIES_CATERPIE 0x00a
+#define SPECIES_METAPOD 0x00b
+#define SPECIES_BUTTERFREE 0x00c
+#define SPECIES_WEEDLE 0x00d
+#define SPECIES_KAKUNA 0x00e
+#define SPECIES_BEEDRILL 0x00f
+#define SPECIES_PIDGEY 0x010
+#define SPECIES_PIDGEOTTO 0x011
+#define SPECIES_PIDGEOT 0x012
+#define SPECIES_RATTATA 0x013
+#define SPECIES_RATICATE 0x014
+#define SPECIES_SPEAROW 0x015
+#define SPECIES_FEAROW 0x016
+#define SPECIES_EKANS 0x017
+#define SPECIES_ARBOK 0x018
+#define SPECIES_PIKACHU 0x019
+#define SPECIES_RAICHU 0x01a
+#define SPECIES_SANDSHREW 0x01b
+#define SPECIES_SANDSLASH 0x01c
+#define SPECIES_NIDORAN_F 0x01d
+#define SPECIES_NIDORINA 0x01e
+#define SPECIES_NIDOQUEEN 0x01f
+#define SPECIES_NIDORAN_M 0x020
+#define SPECIES_NIDORINO 0x021
+#define SPECIES_NIDOKING 0x022
+#define SPECIES_CLEFAIRY 0x023
+#define SPECIES_CLEFABLE 0x024
+#define SPECIES_VULPIX 0x025
+#define SPECIES_NINETALES 0x026
+#define SPECIES_JIGGLYPUFF 0x027
+#define SPECIES_WIGGLYTUFF 0x028
+#define SPECIES_ZUBAT 0x029
+#define SPECIES_GOLBAT 0x02a
+#define SPECIES_ODDISH 0x02b
+#define SPECIES_GLOOM 0x02c
+#define SPECIES_VILEPLUME 0x02d
+#define SPECIES_PARAS 0x02e
+#define SPECIES_PARASECT 0x02f
+#define SPECIES_VENONAT 0x030
+#define SPECIES_VENOMOTH 0x031
+#define SPECIES_DIGLETT 0x032
+#define SPECIES_DUGTRIO 0x033
+#define SPECIES_MEOWTH 0x034
+#define SPECIES_PERSIAN 0x035
+#define SPECIES_PSYDUCK 0x036
+#define SPECIES_GOLDUCK 0x037
+#define SPECIES_MANKEY 0x038
+#define SPECIES_PRIMEAPE 0x039
+#define SPECIES_GROWLITHE 0x03a
+#define SPECIES_ARCANINE 0x03b
+#define SPECIES_POLIWAG 0x03c
+#define SPECIES_POLIWHIRL 0x03d
+#define SPECIES_POLIWRATH 0x03e
+#define SPECIES_ABRA 0x03f
+#define SPECIES_KADABRA 0x040
+#define SPECIES_ALAKAZAM 0x041
+#define SPECIES_MACHOP 0x042
+#define SPECIES_MACHOKE 0x043
+#define SPECIES_MACHAMP 0x044
+#define SPECIES_BELLSPROUT 0x045
+#define SPECIES_WEEPINBELL 0x046
+#define SPECIES_VICTREEBEL 0x047
+#define SPECIES_TENTACOOL 0x048
+#define SPECIES_TENTACRUEL 0x049
+#define SPECIES_GEODUDE 0x04a
+#define SPECIES_GRAVELER 0x04b
+#define SPECIES_GOLEM 0x04c
+#define SPECIES_PONYTA 0x04d
+#define SPECIES_RAPIDASH 0x04e
+#define SPECIES_SLOWPOKE 0x04f
+#define SPECIES_SLOWBRO 0x050
+#define SPECIES_MAGNEMITE 0x051
+#define SPECIES_MAGNETON 0x052
+#define SPECIES_FARFETCHD 0x053
+#define SPECIES_DODUO 0x054
+#define SPECIES_DODRIO 0x055
+#define SPECIES_SEEL 0x056
+#define SPECIES_DEWGONG 0x057
+#define SPECIES_GRIMER 0x058
+#define SPECIES_MUK 0x059
+#define SPECIES_SHELLDER 0x05a
+#define SPECIES_CLOYSTER 0x05b
+#define SPECIES_GASTLY 0x05c
+#define SPECIES_HAUNTER 0x05d
+#define SPECIES_GENGAR 0x05e
+#define SPECIES_ONIX 0x05f
+#define SPECIES_DROWZEE 0x060
+#define SPECIES_HYPNO 0x061
+#define SPECIES_KRABBY 0x062
+#define SPECIES_KINGLER 0x063
+#define SPECIES_VOLTORB 0x064
+#define SPECIES_ELECTRODE 0x065
+#define SPECIES_EXEGGCUTE 0x066
+#define SPECIES_EXEGGUTOR 0x067
+#define SPECIES_CUBONE 0x068
+#define SPECIES_MAROWAK 0x069
+#define SPECIES_HITMONLEE 0x06a
+#define SPECIES_HITMONCHAN 0x06b
+#define SPECIES_LICKITUNG 0x06c
+#define SPECIES_KOFFING 0x06d
+#define SPECIES_WEEZING 0x06e
+#define SPECIES_RHYHORN 0x06f
+#define SPECIES_RHYDON 0x070
+#define SPECIES_CHANSEY 0x071
+#define SPECIES_TANGELA 0x072
+#define SPECIES_KANGASKHAN 0x073
+#define SPECIES_HORSEA 0x074
+#define SPECIES_SEADRA 0x075
+#define SPECIES_GOLDEEN 0x076
+#define SPECIES_SEAKING 0x077
+#define SPECIES_STARYU 0x078
+#define SPECIES_STARMIE 0x079
+#define SPECIES_MR_MIME 0x07a
+#define SPECIES_SCYTHER 0x07b
+#define SPECIES_JYNX 0x07c
+#define SPECIES_ELECTABUZZ 0x07d
+#define SPECIES_MAGMAR 0x07e
+#define SPECIES_PINSIR 0x07f
+#define SPECIES_TAUROS 0x080
+#define SPECIES_MAGIKARP 0x081
+#define SPECIES_GYARADOS 0x082
+#define SPECIES_LAPRAS 0x083
+#define SPECIES_DITTO 0x084
+#define SPECIES_EEVEE 0x085
+#define SPECIES_VAPOREON 0x086
+#define SPECIES_JOLTEON 0x087
+#define SPECIES_FLAREON 0x088
+#define SPECIES_PORYGON 0x089
+#define SPECIES_OMANYTE 0x08a
+#define SPECIES_OMASTAR 0x08b
+#define SPECIES_KABUTO 0x08c
+#define SPECIES_KABUTOPS 0x08d
+#define SPECIES_AERODACTYL 0x08e
+#define SPECIES_SNORLAX 0x08f
+#define SPECIES_ARTICUNO 0x090
+#define SPECIES_ZAPDOS 0x091
+#define SPECIES_MOLTRES 0x092
+#define SPECIES_DRATINI 0x093
+#define SPECIES_DRAGONAIR 0x094
+#define SPECIES_DRAGONITE 0x095
+#define SPECIES_MEWTWO 0x096
+#define SPECIES_MEW 0x097
+#define SPECIES_CHIKORITA 0x098
+#define SPECIES_BAYLEEF 0x099
+#define SPECIES_MEGANIUM 0x09a
+#define SPECIES_CYNDAQUIL 0x09b
+#define SPECIES_QUILAVA 0x09c
+#define SPECIES_TYPHLOSION 0x09d
+#define SPECIES_TOTODILE 0x09e
+#define SPECIES_CROCONAW 0x09f
+#define SPECIES_FERALIGATR 0x0a0
+#define SPECIES_SENTRET 0x0a1
+#define SPECIES_FURRET 0x0a2
+#define SPECIES_HOOTHOOT 0x0a3
+#define SPECIES_NOCTOWL 0x0a4
+#define SPECIES_LEDYBA 0x0a5
+#define SPECIES_LEDIAN 0x0a6
+#define SPECIES_SPINARAK 0x0a7
+#define SPECIES_ARIADOS 0x0a8
+#define SPECIES_CROBAT 0x0a9
+#define SPECIES_CHINCHOU 0x0aa
+#define SPECIES_LANTURN 0x0ab
+#define SPECIES_PICHU 0x0ac
+#define SPECIES_CLEFFA 0x0ad
+#define SPECIES_IGGLYBUFF 0x0ae
+#define SPECIES_TOGEPI 0x0af
+#define SPECIES_TOGETIC 0x0b0
+#define SPECIES_NATU 0x0b1
+#define SPECIES_XATU 0x0b2
+#define SPECIES_MAREEP 0x0b3
+#define SPECIES_FLAAFFY 0x0b4
+#define SPECIES_AMPHAROS 0x0b5
+#define SPECIES_BELLOSSOM 0x0b6
+#define SPECIES_MARILL 0x0b7
+#define SPECIES_AZUMARILL 0x0b8
+#define SPECIES_SUDOWOODO 0x0b9
+#define SPECIES_POLITOED 0x0ba
+#define SPECIES_HOPPIP 0x0bb
+#define SPECIES_SKIPLOOM 0x0bc
+#define SPECIES_JUMPLUFF 0x0bd
+#define SPECIES_AIPOM 0x0be
+#define SPECIES_SUNKERN 0x0bf
+#define SPECIES_SUNFLORA 0x0c0
+#define SPECIES_YANMA 0x0c1
+#define SPECIES_WOOPER 0x0c2
+#define SPECIES_QUAGSIRE 0x0c3
+#define SPECIES_ESPEON 0x0c4
+#define SPECIES_UMBREON 0x0c5
+#define SPECIES_MURKROW 0x0c6
+#define SPECIES_SLOWKING 0x0c7
+#define SPECIES_MISDREAVUS 0x0c8
+#define SPECIES_UNOWN 0x0c9
+#define SPECIES_WOBBUFFET 0x0ca
+#define SPECIES_GIRAFARIG 0x0cb
+#define SPECIES_PINECO 0x0cc
+#define SPECIES_FORRETRESS 0x0cd
+#define SPECIES_DUNSPARCE 0x0ce
+#define SPECIES_GLIGAR 0x0cf
+#define SPECIES_STEELIX 0x0d0
+#define SPECIES_SNUBBULL 0x0d1
+#define SPECIES_GRANBULL 0x0d2
+#define SPECIES_QWILFISH 0x0d3
+#define SPECIES_SCIZOR 0x0d4
+#define SPECIES_SHUCKLE 0x0d5
+#define SPECIES_HERACROSS 0x0d6
+#define SPECIES_SNEASEL 0x0d7
+#define SPECIES_TEDDIURSA 0x0d8
+#define SPECIES_URSARING 0x0d9
+#define SPECIES_SLUGMA 0x0da
+#define SPECIES_MAGCARGO 0x0db
+#define SPECIES_SWINUB 0x0dc
+#define SPECIES_PILOSWINE 0x0dd
+#define SPECIES_CORSOLA 0x0de
+#define SPECIES_REMORAID 0x0df
+#define SPECIES_OCTILLERY 0x0e0
+#define SPECIES_DELIBIRD 0x0e1
+#define SPECIES_MANTINE 0x0e2
+#define SPECIES_SKARMORY 0x0e3
+#define SPECIES_HOUNDOUR 0x0e4
+#define SPECIES_HOUNDOOM 0x0e5
+#define SPECIES_KINGDRA 0x0e6
+#define SPECIES_PHANPY 0x0e7
+#define SPECIES_DONPHAN 0x0e8
+#define SPECIES_PORYGON2 0x0e9
+#define SPECIES_STANTLER 0x0ea
+#define SPECIES_SMEARGLE 0x0eb
+#define SPECIES_TYROGUE 0x0ec
+#define SPECIES_HITMONTOP 0x0ed
+#define SPECIES_SMOOCHUM 0x0ee
+#define SPECIES_ELEKID 0x0ef
+#define SPECIES_MAGBY 0x0f0
+#define SPECIES_MILTANK 0x0f1
+#define SPECIES_BLISSEY 0x0f2
+#define SPECIES_RAIKOU 0x0f3
+#define SPECIES_ENTEI 0x0f4
+#define SPECIES_SUICUNE 0x0f5
+#define SPECIES_LARVITAR 0x0f6
+#define SPECIES_PUPITAR 0x0f7
+#define SPECIES_TYRANITAR 0x0f8
+#define SPECIES_LUGIA 0x0f9
+#define SPECIES_HO_OH 0x0fa
+#define SPECIES_CELEBI 0x0fb
+#define SPECIES_TREECKO 0x115
+#define SPECIES_GROVYLE 0x116
+#define SPECIES_SCEPTILE 0x117
+#define SPECIES_TORCHIC 0x118
+#define SPECIES_COMBUSKEN 0x119
+#define SPECIES_BLAZIKEN 0x11a
+#define SPECIES_MUDKIP 0x11b
+#define SPECIES_MARSHTOMP 0x11c
+#define SPECIES_SWAMPERT 0x11d
+#define SPECIES_POOCHYENA 0x11e
+#define SPECIES_MIGHTYENA 0x11f
+#define SPECIES_ZIGZAGOON 0x120
+#define SPECIES_LINOONE 0x121
+#define SPECIES_WURMPLE 0x122
+#define SPECIES_SILCOON 0x123
+#define SPECIES_BEAUTIFLY 0x124
+#define SPECIES_CASCOON 0x125
+#define SPECIES_DUSTOX 0x126
+#define SPECIES_LOTAD 0x127
+#define SPECIES_LOMBRE 0x128
+#define SPECIES_LUDICOLO 0x129
+#define SPECIES_SEEDOT 0x12a
+#define SPECIES_NUZLEAF 0x12b
+#define SPECIES_SHIFTRY 0x12c
+#define SPECIES_NINCADA 0x12d
+#define SPECIES_NINJASK 0x12e
+#define SPECIES_SHEDINJA 0x12f
+#define SPECIES_TAILLOW 0x130
+#define SPECIES_SWELLOW 0x131
+#define SPECIES_SHROOMISH 0x132
+#define SPECIES_BRELOOM 0x133
+#define SPECIES_SPINDA 0x134
+#define SPECIES_WINGULL 0x135
+#define SPECIES_PELIPPER 0x136
+#define SPECIES_SURSKIT 0x137
+#define SPECIES_MASQUERAIN 0x138
+#define SPECIES_WAILMER 0x139
+#define SPECIES_WAILORD 0x13a
+#define SPECIES_SKITTY 0x13b
+#define SPECIES_DELCATTY 0x13c
+#define SPECIES_KECLEON 0x13d
+#define SPECIES_BALTOY 0x13e
+#define SPECIES_CLAYDOL 0x13f
+#define SPECIES_NOSEPASS 0x140
+#define SPECIES_TORKOAL 0x141
+#define SPECIES_SABLEYE 0x142
+#define SPECIES_BARBOACH 0x143
+#define SPECIES_WHISCASH 0x144
+#define SPECIES_LUVDISC 0x145
+#define SPECIES_CORPHISH 0x146
+#define SPECIES_CRAWDAUNT 0x147
+#define SPECIES_FEEBAS 0x148
+#define SPECIES_MILOTIC 0x149
+#define SPECIES_CARVANHA 0x14a
+#define SPECIES_SHARPEDO 0x14b
+#define SPECIES_TRAPINCH 0x14c
+#define SPECIES_VIBRAVA 0x14d
+#define SPECIES_FLYGON 0x14e
+#define SPECIES_MAKUHITA 0x14f
+#define SPECIES_HARIYAMA 0x150
+#define SPECIES_ELECTRIKE 0x151
+#define SPECIES_MANECTRIC 0x152
+#define SPECIES_NUMEL 0x153
+#define SPECIES_CAMERUPT 0x154
+#define SPECIES_SPHEAL 0x155
+#define SPECIES_SEALEO 0x156
+#define SPECIES_WALREIN 0x157
+#define SPECIES_CACNEA 0x158
+#define SPECIES_CACTURNE 0x159
+#define SPECIES_SNORUNT 0x15a
+#define SPECIES_GLALIE 0x15b
+#define SPECIES_LUNATONE 0x15c
+#define SPECIES_SOLROCK 0x15d
+#define SPECIES_AZURILL 0x15e
+#define SPECIES_SPOINK 0x15f
+#define SPECIES_GRUMPIG 0x160
+#define SPECIES_PLUSLE 0x161
+#define SPECIES_MINUN 0x162
+#define SPECIES_MAWILE 0x163
+#define SPECIES_MEDITITE 0x164
+#define SPECIES_MEDICHAM 0x165
+#define SPECIES_SWABLU 0x166
+#define SPECIES_ALTARIA 0x167
+#define SPECIES_WYNAUT 0x168
+#define SPECIES_DUSKULL 0x169
+#define SPECIES_DUSCLOPS 0x16a
+#define SPECIES_ROSELIA 0x16b
+#define SPECIES_SLAKOTH 0x16c
+#define SPECIES_VIGOROTH 0x16d
+#define SPECIES_SLAKING 0x16e
+#define SPECIES_GULPIN 0x16f
+#define SPECIES_SWALOT 0x170
+#define SPECIES_TROPIUS 0x171
+#define SPECIES_WHISMUR 0x172
+#define SPECIES_LOUDRED 0x173
+#define SPECIES_EXPLOUD 0x174
+#define SPECIES_CLAMPERL 0x175
+#define SPECIES_HUNTAIL 0x176
+#define SPECIES_GOREBYSS 0x177
+#define SPECIES_ABSOL 0x178
+#define SPECIES_SHUPPET 0x179
+#define SPECIES_BANETTE 0x17a
+#define SPECIES_SEVIPER 0x17b
+#define SPECIES_ZANGOOSE 0x17c
+#define SPECIES_RELICANTH 0x17d
+#define SPECIES_ARON 0x17e
+#define SPECIES_LAIRON 0x17f
+#define SPECIES_AGGRON 0x180
+#define SPECIES_CASTFORM 0x181
+#define SPECIES_VOLBEAT 0x182
+#define SPECIES_ILLUMISE 0x183
+#define SPECIES_LILEEP 0x184
+#define SPECIES_CRADILY 0x185
+#define SPECIES_ANORITH 0x186
+#define SPECIES_ARMALDO 0x187
+#define SPECIES_RALTS 0x188
+#define SPECIES_KIRLIA 0x189
+#define SPECIES_GARDEVOIR 0x18a
+#define SPECIES_BAGON 0x18b
+#define SPECIES_SHELGON 0x18c
+#define SPECIES_SALAMENCE 0x18d
+#define SPECIES_BELDUM 0x18e
+#define SPECIES_METANG 0x18f
+#define SPECIES_METAGROSS 0x190
+#define SPECIES_REGIROCK 0x191
+#define SPECIES_REGICE 0x192
+#define SPECIES_REGISTEEL 0x193
+#define SPECIES_KYOGRE 0x194
+#define SPECIES_GROUDON 0x195
+#define SPECIES_RAYQUAZA 0x196
+#define SPECIES_LATIAS 0x197
+#define SPECIES_LATIOS 0x198
+#define SPECIES_JIRACHI 0x199
+#define SPECIES_DEOXYS 0x19a
+#define SPECIES_CHIMECHO 0x19b
+
+#endif // GUARD_SPECIES_H
diff --git a/include/sprite.h b/include/sprite.h
index 10bd3a5f0..9b800a9ea 100644
--- a/include/sprite.h
+++ b/include/sprite.h
@@ -149,14 +149,14 @@ struct Sprite
u8 animLoopCounter;
// general purpose data fields
- u16 data0;
- u16 data1;
- u16 data2;
- u16 data3;
- u16 data4;
- u16 data5;
- u16 data6;
- u16 data7;
+ s16 data0;
+ s16 data1;
+ s16 data2;
+ s16 data3;
+ s16 data4;
+ s16 data5;
+ s16 data6;
+ s16 data7;
u16 inUse:1;
u16 coordOffsetEnabled:1;
diff --git a/include/text.h b/include/text.h
index 527a8939d..19c9b3040 100644
--- a/include/text.h
+++ b/include/text.h
@@ -152,7 +152,7 @@ u8 sub_80035AC(struct Window *win);
u8 sub_800374C(struct Window *win);
u8 sub_8003778(struct Window *win);
u8 sub_80037A0(struct Window *win);
-u8 sub_80037C8(struct Window *win, u8 lineLength);
+u32 sub_80037C8(struct Window *win, u8 lineLength);
void ClearWindowTextLines(struct Window *win);
u16 GetWindowTilemapEntry(struct Window *win, u8 x, u8 y);
void DrawWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom);
diff --git a/include/text_window.h b/include/text_window.h
new file mode 100644
index 000000000..63ca8915e
--- /dev/null
+++ b/include/text_window.h
@@ -0,0 +1,19 @@
+#ifndef GUARD_TEXT_WINDOW_H
+#define GUARD_TEXT_WINDOW_H
+
+#include "global.h"
+
+u16 SetTextWindowBaseTileNum(u16);
+void LoadTextWindowGraphics(struct Window *);
+void LoadTextWindowGraphics_OverridePalSlot(struct Window *, u8);
+void LoadTextWindowGraphics_OverrideFrameType(struct Window *, u8);
+void DrawTextWindow(struct Window *win, u8 left, u8 top, u8 right, u8 bottom);
+const struct FrameGraphics *GetTextWindowFrameGraphics(u8 frameType);
+u16 SetMessageBoxBaseTileNum(u16);
+void unref_sub_80651DC(struct Window *, u8 *);
+void DisplayMessageBox(struct Window *);
+void DrawStandardMessageBox(struct Window *win);
+void LoadMessageBoxTiles(struct Window *win);
+void sub_806536C(struct Window *win);
+
+#endif // GUARD_TEXT_WINDOW_H