summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDizzyEggg <jajkodizzy@wp.pl>2017-09-28 15:34:21 +0200
committerDizzyEggg <jajkodizzy@wp.pl>2017-09-28 15:34:21 +0200
commitbc3b4b4d9ae6ab59c9ce3892b7d287ebd0ee13fa (patch)
tree752dcccf8dc4c049d85e1a3232b99f91d7411047 /include
parent69928d3904a610791d5e34e32364d9ee5f9392ee (diff)
battle 4 commands are decompiled
Diffstat (limited to 'include')
-rw-r--r--include/battle.h33
-rw-r--r--include/battle_controllers.h13
-rw-r--r--include/battle_message.h2
-rw-r--r--include/naming_screen.h12
-rw-r--r--include/pokedex.h1
-rw-r--r--include/pokemon_storage_system.h6
6 files changed, 50 insertions, 17 deletions
diff --git a/include/battle.h b/include/battle.h
index a0a50faf7..7b164caf4 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -205,6 +205,7 @@
#define WEATHER_SUN_ANY ((WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT))
#define WEATHER_HAIL (1 << 7)
#define WEATHER_HAIL_ANY ((WEATHER_HAIL))
+#define WEATHER_ANY ((WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY))
#define BATTLE_TERRAIN_GRASS 0
#define BATTLE_TERRAIN_LONG_GRASS 1
@@ -216,7 +217,9 @@
#define BATTLE_TERRAIN_CAVE 7
// array entries for battle communication
+#define MULTIUSE_STATE 0x0
#define CURSOR_POSITION 0x1
+#define TASK_ID 0x1 // task Id and cursor position share the same field
#define MOVE_EFFECT_BYTE 0x3
#define MULTISTRING_CHOOSER 0x5
#define MSG_DISPLAY 0x7
@@ -531,6 +534,9 @@ struct BattleResults
u8 unk4; // 0x4
u8 unk5_0:1; // 0x5
u8 unk5_1:1; // 0x5
+ u8 caughtMonBall:4; // 0x5
+ u8 unk5_6:1; // 0x5
+ u8 unk5_7:1; // 0x5
u16 poke1Species; // 0x6
u8 pokeString1[10]; // 0x8
u8 unk12;
@@ -542,10 +548,10 @@ struct BattleResults
u16 lastUsedMove; // 0x22
u16 opponentMove; // 0x24
u16 opponentSpecies; // 0x26
- u16 caughtPoke; // 0x28
- u8 caughtNick[10]; // 0x2A
+ u16 caughtMonSpecies; // 0x28
+ u8 caughtMonNick[10]; // 0x2A
u8 filler34[2];
- u8 unk36[10]; // usedBalls?
+ u8 catchAttempts[10]; // 0x36
};
extern struct BattleResults gBattleResults;
@@ -588,17 +594,7 @@ struct BattleStruct
u8 field_5C[4];
u8 field_60[4][3];
u8 field_6C;
- u8 field_6D;
- u8 field_6E;
- u8 field_6F;
- u8 field_70;
- u8 field_71;
- u8 field_72;
- u8 field_73;
- u8 field_74;
- u8 field_75;
- u8 field_76;
- u8 field_77;
+ u8 caughtMonNick[11];
u8 field_78;
u8 field_79;
u8 field_7A;
@@ -845,6 +841,7 @@ struct BattleScripting
u8 field_1D;
u8 atk6C_state;
u8 learnMoveState;
+ u8 field_20;
};
extern struct BattleScripting gBattleScripting;
@@ -862,6 +859,7 @@ void SwitchInClearStructs(void);
void sub_803BDA0(u8 bank);
void sub_803FA70(u8 bank);
void BattleMainCB2(void);
+void VBlankCB_Battle(void);
void ResetSentPokesToOpponentValue(void);
bool8 CanRunFromBattle(u8 bank);
bool8 IsRunningFromBattleImpossible(void);
@@ -892,8 +890,8 @@ u8 AtkCanceller_UnableToUseMove(void);
bool8 sub_80423F4(u8 bank, u8 r1, u8 r2);
u8 CastformDataTypeChange(u8 bank);
u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
-void b_call_bc_move_exec(const u8* BS_ptr);
-void b_push_move_exec(const u8* BS_ptr);
+void BattleScriptExecute(const u8* BS_ptr);
+void BattleScriptPushCursorAndCallback(const u8* BS_ptr);
u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn);
void sub_8045868(u8 bank);
void sub_80458B4(void);
@@ -905,9 +903,12 @@ void AI_CalcDmg(u8 bankAtk, u8 bankDef);
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
u8 AI_TypeCalc(u16 move, u16 species, u8 ability);
u8 BankGetTurnOrder(u8 bank);
+void SetMoveEffect(bool8 primary, u8 certain);
void BattleDestroyCursorAt(u8 cursorPosition);
void BattleCreateCursorAt(u8 cursorPosition);
void BufferMoveToLearnIntoBattleTextBuff2(void);
+void sub_8056A3C(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
+bool8 UproarWakeUpCheck(u8 bank);
// battle_5
void AdjustFriendshipOnBattleFaint(u8 bank);
diff --git a/include/battle_controllers.h b/include/battle_controllers.h
index bb58cb699..b2846d7cf 100644
--- a/include/battle_controllers.h
+++ b/include/battle_controllers.h
@@ -43,6 +43,7 @@ void EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
void EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, const u8* arg4);
void EmitLinkStandbyMsg(u8 bufferId, u8 arg1, u8 arg2);
void EmitTrainerSlide(u8 bufferId);
+void EmitTrainerSlideBack(u8 bufferId);
void EmitFaintingCry(u8 bufferId);
void Emit_x37(u8 bufferId, u8 arg1);
void EmitHitAnimation(u8 bufferId);
@@ -51,12 +52,22 @@ void EmitCmd49(u8 bufferId);
void EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
void EmitCmd13(u8 bufferId);
void EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
-void EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
#define RESET_ACTION_MOVE_SELECTION 0
#define RESET_ACTION_SELECTION 1
#define RESET_MOVE_SELECTION 2
+void EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
+
+#define BALL_NO_SHAKES 0
+#define BALL_1_SHAKE 1
+#define BALL_2_SHAKES 2
+#define BALL_3_SHAKES_FAIL 3
+#define BALL_3_SHAKES_SUCCESS 4
+#define BALL_TRAINER_BLOCK 5
+
+void EmitBallThrow(u8 bufferId, u8 caseId);
+
void MarkBufferBankForExecution(u8 bank);
#endif // GUARD_BATTLE_CONTROLLERS_H
diff --git a/include/battle_message.h b/include/battle_message.h
index 6e6616cf0..3bc7117bb 100644
--- a/include/battle_message.h
+++ b/include/battle_message.h
@@ -211,4 +211,6 @@ extern u8 gBattleTextBuff2[];
extern u8 gBattleTextBuff3[];
extern u8 gDisplayedStringBattle[];
+extern const u8* const gRefereeStringsTable[];
+
#endif // GUARD_BATTLE_MESSAGE_H
diff --git a/include/naming_screen.h b/include/naming_screen.h
new file mode 100644
index 000000000..55a8e75a3
--- /dev/null
+++ b/include/naming_screen.h
@@ -0,0 +1,12 @@
+#ifndef GUARD_NAMING_SCREEN_H
+#define GUARD_NAMING_SCREEN_H
+
+#define NAMING_SCREEN_PLAYER 0
+#define NAMING_SCREEN_BOX 1
+#define NAMING_SCREEN_CAUGHT_MON 2
+#define NAMING_SCREEN_3 3
+#define NAMING_SCREEN_WANDA 4
+
+void DoNamingScreen(u8 caseId, u8* dst, u16 monSpecies, u8 monGender, u32 monPersonality, void (*callback)(void));
+
+#endif // GUARD_NAMING_SCREEN_H
diff --git a/include/pokedex.h b/include/pokedex.h
index 15f819a2a..38aca0915 100644
--- a/include/pokedex.h
+++ b/include/pokedex.h
@@ -6,6 +6,7 @@ const u8 *GetPokemonCategory(u16);
u16 GetPokedexHeightWeight(u16 dexNum, u8 data);
u16 GetNationalPokedexCount(u8);
u16 GetHoennPokedexCount(u8);
+u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality);
enum
{
diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h
new file mode 100644
index 000000000..5216e8450
--- /dev/null
+++ b/include/pokemon_storage_system.h
@@ -0,0 +1,6 @@
+#ifndef GUARD_POKEMON_STORAGE_SYSTEM_H
+#define GUARD_POKEMON_STORAGE_SYSTEM_H
+
+u8* GetBoxNamePtr(u8 boxNumber);
+
+#endif // GUARD_POKEMON_STORAGE_SYSTEM_H