summaryrefslogtreecommitdiff
path: root/include/battle.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/battle.h')
-rw-r--r--include/battle.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/include/battle.h b/include/battle.h
index 47cb7cf8e..dc9ac93cc 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -19,6 +19,8 @@
#define BATTLE_TYPE_LEGENDARY 0x2000
#define BATTLE_TYPE_REGI 0x4000
+#define BATTLE_TYPE_LINK_DOUBLE (BATTLE_TYPE_MULTI | BATTLE_TYPE_TRAINER | BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE)
+
#define BATTLE_WON 0x1
#define BATTLE_LOST 0x2
#define BATTLE_DREW 0x3
@@ -243,12 +245,11 @@ struct BattleStruct /* 0x2000000 */
/*0x16001*/ u8 turnEffectsBank;
/*0x16002*/ u8 animTurn;
/*0x16003*/ u8 scriptingActive;
- /*0x16004*/ u8 wrappedMove1[4];
- /*0x16008*/ u8 wrappedMove2[4];
+ /*0x16004*/ u8 wrappedMove[8];
/*0x1600C*/ u8 cmd49StateTracker;
/*0x1600D*/ u8 unk1600D;
/*0x1600E*/ u8 turncountersTracker;
- /*0x1600F*/ u8 cmd23StateTracker;
+ /*0x1600F*/ u8 atk23StateTracker;
/*0x16010*/ u8 moveTarget[4];
/*0x16014*/ u8 unk16014;
/*0x16015*/ u8 unk16015;
@@ -685,6 +686,32 @@ extern u8 ewram[];
#define ewram17840 (*(struct Struct2017840 *) (ewram + 0x17840))
#define ewram17000 ((u32 *) (ewram + 0x17100))
+// used in many battle files, it seems as though Hisashi Sogabe wrote
+// some sort of macro to replace the use of actually calling memset.
+// Perhaps it was thought calling memset was much slower?
+
+// The compiler wont allow us to locally declare ptr in this macro; some
+// functions that invoke this macro will not match without this egregeous
+// assumption about the variable names, so in order to avoid this assumption,
+// we opt to pass the variables themselves, even though it is likely that
+// Sogabe assumed the variables were named src and dest. Trust me: I tried to
+// avoid assuming variable names, but the ROM just will not match without the
+// assumptions. Therefore, these macros are bad practice, but I'm putting them
+// here anyway.
+#define MEMSET_ALT(data, c, size, var, dest) \
+{ \
+ dest = (u8 *)data; \
+ for(var = 0; var < (u32)size; var++) \
+ dest[var] = c; \
+} \
+
+#define MEMCPY_ALT(data, dest, size, var, src) \
+{ \
+ src = (u8 *)data; \
+ for(var = 0; var < (u32)size; var++) \
+ dest[var] = src[var]; \
+} \
+
typedef void (*BattleCmdFunc)(void);
struct funcStack
@@ -724,7 +751,6 @@ void EmitEffectivenessSound(u8 a, u16 sound); //0x2B
void Emitcmd44(u8 a, u16 sound); //0x2C
void EmitFaintingCry(u8 a); //0x2D
void EmitIntroSlide(u8 a, u8 b); //0x2E
-void Emitcmd48(u8 a, u8 *b, u8 c); //0x30
void Emitcmd49(u8 a); //0x31
void EmitSpriteInvisibility(u8 a, u8 b); //0x33
void EmitBattleAnimation(u8 a, u8 b, u16 c); //0x34
@@ -796,7 +822,7 @@ void BattleTurnPassed(void);
// asm/battle_2.o
void sub_8012324(void);
void sub_8012FBC(u8, u8);
-u8 b_first_side(u8, u8, u8);
+u8 GetWhoStrikesFirst(u8, u8, u8);
void TurnValuesCleanUp(u8);
void SpecialStatusesClear(void);
void sub_80138F0(void);