summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle.h57
-rw-r--r--include/field_effect.h8
-rw-r--r--include/field_fadetransition.h2
-rw-r--r--include/field_special_scene.h1
-rw-r--r--include/global.h19
-rw-r--r--include/mystery_event_script.h6
-rw-r--r--include/pokemon.h14
-rw-r--r--include/rom3.h9
-rw-r--r--include/rom4.h6
-rw-r--r--include/script.h2
-rw-r--r--include/util.h1
11 files changed, 78 insertions, 47 deletions
diff --git a/include/battle.h b/include/battle.h
index fb5077f6a..12faee537 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -21,8 +21,8 @@
#define AI_ACTION_DONE 0x0001
#define AI_ACTION_FLEE 0x0002
-#define AI_ACTION_WATCH 0x0004
-#define AI_ACTION_DO_NOT_ATTACK 0x0008
+#define AI_ACTION_WATCH 0x0004
+#define AI_ACTION_DO_NOT_ATTACK 0x0008
#define AI_ACTION_UNK5 0x0010
#define AI_ACTION_UNK6 0x0020
#define AI_ACTION_UNK7 0x0040
@@ -62,7 +62,7 @@
#define STATUS3_ON_AIR 0x40
#define STATUS3_UNDERGROUND 0x80
#define STATUS3_MINIMIZED 0x100
-#define STATUS3_ROOTED 0x400
+#define STATUS3_ROOTED 0x400
#define STATUS3_CHARGED_UP 0x200
#define STATUS3_YAWN 0x1800 //two bits
#define STATUS3_IMPRISIONED 0x2000
@@ -97,44 +97,33 @@
#define HITMARKER_FAINTED(bank) ((gBitTable[bank] << 0x1C))
#define HITMARKER_UNK(bank) ((0x10000000 << bank))
-#define SIDE_REFLECT 0x1
-#define SIDE_LIGHTSCREEN 0x2
-#define SIDE_SPIKES 0x10
-#define SIDE_SAFEGUARD 0x20
-#define SIDE_FUTUREATTACK 0x40
-#define SIDE_MIST 0x100
-#define SIDE_SPIKES_DMG_DONE 0x200
+#define SIDE_STATUS_REFLECT (1 << 0)
+#define SIDE_STATUS_LIGHTSCREEN (1 << 1)
+#define SIDE_STATUS_SPIKES (1 << 4)
+#define SIDE_STATUS_SAFEGUARD (1 << 5)
+#define SIDE_STATUS_FUTUREATTACK (1 << 6)
+#define SIDE_STATUS_MIST (1 << 8)
+#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9)
#define MAX_TRAINER_ITEMS 4
#define MAX_MON_MOVES 4
#define MAX_BANKS_BATTLE 4
-#define weather_rain 1
-#define weather_downpour 2
-#define weather_permament_rain 4
-#define WEATHER_RAINY ((weather_rain | weather_downpour | weather_permament_rain))
-
-#define weather_sandstorm 8
-#define weather_permament_sandstorm 0x10
-#define WEATHER_SANDSTORMY ((weather_sandstorm | weather_permament_sandstorm))
-
-#define weather_sun 0x20
-#define weather_permament_sun 0x40
-#define WEATHER_SUNNY ((weather_sun | weather_permament_sun))
-
-#define weather_hail 0x80
+#define WEATHER_RAIN_TEMPORARY (1 << 0)
+#define WEATHER_RAIN_DOWNPOUR (1 << 1)
+#define WEATHER_RAIN_PERMANENT (1 << 2)
+#define WEATHER_RAIN_ANY ((WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT))
+#define WEATHER_SANDSTORM_TEMPORARY (1 << 3)
+#define WEATHER_SANDSTORM_PERMANENT (1 << 4)
+#define WEATHER_SANDSTORM_ANY ((WEATHER_SANDSTORM_TEMPORARY | WEATHER_SANDSTORM_PERMANENT))
+#define WEATHER_SUN_TEMPORARY (1 << 5)
+#define WEATHER_SUN_PERMANENT (1 << 6)
+#define WEATHER_SUN_ANY ((WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT))
+#define WEATHER_HAIL (1 << 7)
// needed to match the hack that is get_item, thanks cam, someone else clean this up later.
extern u8 unk_2000000[];
-enum
-{
- WEATHER_SUN,
- WEATHER_RAIN,
- WEATHER_SANDSTORM,
- WEATHER_HAIL,
-};
-
struct Trainer
{
/*0x00*/ u8 partyFlags;
@@ -398,7 +387,7 @@ struct BattleResults
u16 caughtPoke; // 0x28
u8 caughtNick[10]; // 0x2A
u8 filler34[2];
- u8 unk36[10];
+ u8 unk36[10]; // usedBalls?
};
struct Struct2017800
@@ -548,10 +537,10 @@ extern u8 ewram[];
#define UNK_2016A00_STRUCT ((struct UnkBattleStruct1 *) (ewram + 0x16A00))
#define AI_STACK ((struct AI_Stack *) (ewram + 0x16C00))
#define AI_ARRAY_160CC ((struct SmallItemStruct *) (ewram + 0x160CC))
+#define B_FUNCTION_STACK ((struct funcStack *) (ewram + 0x17140))
#define ewram17800 ((struct Struct2017800 *) (ewram + 0x17800))
#define ewram17810 ((struct Struct2017810 *) (ewram + 0x17810))
#define ewram17840 (*(struct Struct2017840 *) (ewram + 0x17840))
-#define B_FUNCTION_STACK ((struct funcStack *)(0x02017140))
struct funcStack
{
diff --git a/include/field_effect.h b/include/field_effect.h
index bf80ca0dc..ea02c4131 100644
--- a/include/field_effect.h
+++ b/include/field_effect.h
@@ -130,6 +130,8 @@ void PokeballGlowEffect_5(struct Sprite *);
void PokeballGlowEffect_6(struct Sprite *);
void PokeballGlowEffect_7(struct Sprite *);
+void sub_8086748(void);
+
bool8 sub_80867AC(struct Task *);
bool8 sub_8086854(struct Task *);
bool8 sub_8086870(struct Task *);
@@ -138,6 +140,8 @@ bool8 sub_808699C(struct Task *);
bool8 sub_80869B8(struct Task *);
bool8 sub_80869F8(struct Task *);
+void sub_8086A2C(u8, u8);
+
bool8 sub_8086AA0(struct Task *);
bool8 sub_8086AC0(struct Task *);
bool8 sub_8086B30(struct Task *);
@@ -163,6 +167,8 @@ bool8 sub_8087124(struct Task *);
bool8 dive_2_unknown(struct Task *);
bool8 dive_3_unknown(struct Task *);
+void sub_80871B8(u8);
+
bool8 sub_808722C(struct Task *, struct MapObject *, struct Sprite *);
bool8 sub_8087264(struct Task *, struct MapObject *, struct Sprite *);
bool8 sub_8087298(struct Task *, struct MapObject *, struct Sprite *);
@@ -175,6 +181,8 @@ bool8 sub_80874FC(struct Task *, struct MapObject *, struct Sprite *);
bool8 sub_8087548(struct Task *, struct MapObject *, struct Sprite *);
bool8 sub_808759C(struct Task *, struct MapObject *, struct Sprite *);
+void sub_8087654(u8);
+
bool8 sub_80876C8(struct Task *, struct MapObject *, struct Sprite *);
bool8 sub_80876F8(struct Task *, struct MapObject *, struct Sprite *);
bool8 sub_8087774(struct Task *, struct MapObject *, struct Sprite *);
diff --git a/include/field_fadetransition.h b/include/field_fadetransition.h
index 764adfc9a..111dc92a6 100644
--- a/include/field_fadetransition.h
+++ b/include/field_fadetransition.h
@@ -16,7 +16,7 @@ void sub_8080B60(void);
void atk17_seteffectuser(void);
void sub_8080E28(void);
void sub_8080E44(void);
-int sub_8080E70(void);
+bool32 sub_8080E70(void);
void sub_8080E88(void);
void sub_8080E88();
void sp13E_warp_to_last_warp(void);
diff --git a/include/field_special_scene.h b/include/field_special_scene.h
index ef3f07120..d674f09df 100644
--- a/include/field_special_scene.h
+++ b/include/field_special_scene.h
@@ -9,5 +9,6 @@ void Task_Truck3(u8 taskId);
void Task_HandleTruckSequence(u8 taskId);
void ExecuteTruckSequence(void);
void EndTruckSequence(u8);
+void sub_80C791C(void);
#endif // GUARD_FIELD_SPECIAL_SCENE_H
diff --git a/include/global.h b/include/global.h
index 73f73093d..f076274cc 100644
--- a/include/global.h
+++ b/include/global.h
@@ -557,6 +557,20 @@ struct LinkBattleRecord
u16 draws;
};
+struct RecordMixingGiftData
+{
+ u8 unk0;
+ u8 quantity;
+ u16 itemId;
+ u8 filler4[8];
+};
+
+struct RecordMixingGift
+{
+ int checksum;
+ struct RecordMixingGiftData data;
+};
+
struct SaveBlock1 /* 0x02025734 */
{
/*0x00*/ struct Coords16 pos;
@@ -642,7 +656,7 @@ struct SaveBlock1 /* 0x02025734 */
/*0x3144*/ struct Roamer roamer;
/*0x3160*/ struct EnigmaBerry enigmaBerry;
/*0x3690*/ struct RamScript ramScript;
- /*0x3A7C*/ u8 filler_3A7C[0x10];
+ /*0x3A7C*/ struct RecordMixingGift recordMixingGift;
/*0x3A8C*/ u8 unk3A8C[52]; //pokedex related
};
@@ -674,7 +688,8 @@ struct SaveBlock2_Sub
/*0x0000, 0x00A8*/ u8 filler_000[0x3D8];
/*0x03D8, 0x0480*/ u16 var_480;
/*0x03DA, 0x0482*/ u16 var_482;
- /*0x03DC, 0x0484*/ u8 filler_3DC[0xD0];
+ /*0x03DC, 0x0484*/ u8 filler_3DC[0x14];
+ /*0x03F0, 0x0498*/ u8 ereaderTrainer[0xBC];
/*0x04AC, 0x0554*/ u8 var_4AC;
/*0x04AD, 0x0555*/ u8 var_4AD;
/*0x04AE, 0x0556*/ u8 var_4AE[2];
diff --git a/include/mystery_event_script.h b/include/mystery_event_script.h
index 766303588..ab23a8d00 100644
--- a/include/mystery_event_script.h
+++ b/include/mystery_event_script.h
@@ -1,8 +1,8 @@
#ifndef GUARD_MYSTERY_EVENT_SCRIPT_H
#define GUARD_MYSTERY_EVENT_SCRIPT_H
-u32 sub_812613C(u8 *);
-void sub_8126160(u32 val);
-u16 sub_8126338(void);
+u32 RunMysteryEventScript(u8 *);
+void SetMysteryEventScriptStatus(u32 val);
+u16 GetRecordMixingGift(void);
#endif // GUARD_MYSTERY_EVENT_SCRIPT_H
diff --git a/include/pokemon.h b/include/pokemon.h
index 9dd7ba06c..be6ccfe74 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -349,6 +349,18 @@ struct BattlePokemon
/*0x54*/ u32 otId;
};
+enum
+{
+ STAT_STAGE_HP, // 0
+ STAT_STAGE_ATK, // 1
+ STAT_STAGE_DEF, // 2
+ STAT_STAGE_SPEED, // 3
+ STAT_STAGE_SPATK, // 4
+ STAT_STAGE_SPDEF, // 5
+ STAT_STAGE_ACC, // 6
+ STAT_STAGE_EVASION, // 7
+};
+
struct BaseStats
{
/*0x00*/ u8 baseHP;
@@ -469,7 +481,9 @@ struct EvolutionData
struct Evolution evolutions[5];
};
+extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[PARTY_SIZE];
+extern u8 gEnemyPartyCount;
extern struct Pokemon gEnemyParty[PARTY_SIZE];
extern const u8 *const gItemEffectTable[];
extern const struct BaseStats gBaseStats[];
diff --git a/include/rom3.h b/include/rom3.h
index 6b1dacd9c..1fa55d11a 100644
--- a/include/rom3.h
+++ b/include/rom3.h
@@ -1,6 +1,8 @@
#ifndef GUARD_ROM3_H
#define GUARD_ROM3_H
+struct DisableStruct;
+
void sub_800B858(void);
void setup_poochyena_battle();
void sub_800B950(void);
@@ -24,15 +26,16 @@ void EmitFaintAnimation(u8 a);
void dp01_build_cmdbuf_x0B_B_B_B(u8 a);
void dp01_build_cmdbuf_x0C_C_C_C(u8 a);
void EmitBallThrowAnim(u8 a, u8 b);
-void EmitMoveAnimation(u8 a, u16 b, u8 c, u16 d, s32 e, u8 f, u8 *g);
+void EmitMoveAnimation(u8 a, u16 b, u8 c, u16 d, s32 e, u8 f, struct DisableStruct *g);
void EmitPrintString(u8 a, u16 b);
+void EmitPrintStringPlayerOnly(u8 a, u16 stringID);
void dp01_build_cmdbuf_x12_a_bb(u8 a, u8 b, u16 c);
void sub_800CBA4(u8 a, u8 b, u8 c, u8 *d);
void sub_800CBE0(u8 a, u8 *b);
void EmitChoosePokemon(u8 a, u8 b, u8 c, u8 d, u8 *e);
void dp01_build_cmdbuf_x17_17_17_17(u8 a);
-void EmitHealthBarUpdate(u8 a, s16 b);
-void EmitExpBarUpdate(u8 a, u8 b, s16 c);
+void EmitHealthBarUpdate(u8 a, u16 b);
+void EmitExpBarUpdate(u8 a, u8 b, u16 c);
void EmitStatusIconUpdate(u8 a, u32 b, u32 c);
void EmitStatusAnimation(u8 a, u8 b, u32 c);
void EmitStatusXor(u8 a, u8 b);
diff --git a/include/rom4.h b/include/rom4.h
index fabd25302..8d5b1bfa2 100644
--- a/include/rom4.h
+++ b/include/rom4.h
@@ -99,7 +99,7 @@ void sub_8053F0C(void);
void sub_8053F84(void);
void sub_8053FB0(u16);
// is_warp1_light_level_8_or_9
-// sub_8053FF8
+void sub_8053FF8(void);
bool8 sub_8054034(void);
void sub_8054044(void);
// sub_8054050
@@ -129,8 +129,8 @@ void CB2_NewGame(void);
void CB2_WhiteOut(void);
void CB2_LoadMap(void);
void CB2_LoadMap2(void);
-// sub_8054534
-// sub_8054588
+void sub_8054534(void);
+void sub_8054588(void);
void c2_80567AC(void);
void c2_exit_to_overworld_2_switch(void);
void c2_exit_to_overworld_2_local(void);
diff --git a/include/script.h b/include/script.h
index b3d888edf..2a738698c 100644
--- a/include/script.h
+++ b/include/script.h
@@ -25,7 +25,7 @@ void InitScriptContext(struct ScriptContext *ctx, void *cmdTable, void *cmdTable
u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr);
void SetupNativeScript(struct ScriptContext *ctx, void *ptr);
void StopScript(struct ScriptContext *ctx);
-u8 RunScript(struct ScriptContext *ctx);
+u8 RunScriptCommand(struct ScriptContext *ctx);
u8 ScriptPush(struct ScriptContext *ctx, const u8 *ptr);
const u8 *ScriptPop(struct ScriptContext *ctx);
void ScriptJump(struct ScriptContext *ctx, u8 *ptr);
diff --git a/include/util.h b/include/util.h
index 1851c2e82..cd50b75cc 100644
--- a/include/util.h
+++ b/include/util.h
@@ -9,5 +9,6 @@ extern const u32 gBitTable[];
u8 CreateInvisibleSpriteWithCallback(void (*)(struct Sprite *));
void StoreWordInTwoHalfwords(u16 *, u32);
void LoadWordFromTwoHalfwords(u16 *, u32 *);
+u16 CalcCRC16(u8 *data, int length);
#endif // GUARD_UTIL_H