summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle.h22
-rw-r--r--include/pokemon.h6
2 files changed, 26 insertions, 2 deletions
diff --git a/include/battle.h b/include/battle.h
index f973849b7..2b268c3c8 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -686,6 +686,28 @@ 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.
+#define BAD_MEMSET(data, c, size, var, ptr) \
+{ \
+ ptr = (u8 *)data; \
+ for(var = 0; var < (u32)size; var++) \
+ ptr[var] = c; \
+} \
+
+// TODO: Try to combine these macros.
+#define BAD_MEMSET_REVERSE(data, ptr2, size, var, ptr) \
+{ \
+ ptr = (u8 *)data; \
+ for(var = 0; var < (u32)size; var++) \
+ ptr2[var] = ptr[var]; \
+} \
+
typedef void (*BattleCmdFunc)(void);
struct funcStack
diff --git a/include/pokemon.h b/include/pokemon.h
index 572862b8f..7fc8e181f 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -541,11 +541,13 @@ union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality,
// but they are not used since some code erroneously omits the third arg.
// 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, const void *dataArg);
+// void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg);
u32 GetMonData();
u32 GetBoxMonData();
+void SetMonData();
+void SetBoxMonData();
-void SetMonData(struct Pokemon *mon, s32 field, const u8 *data);
-void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const u8 *data);
void CopyMon(void *dest, void *src, size_t size);
u8 GiveMonToPlayer(struct Pokemon *mon);
u8 SendMonToPC(struct Pokemon *mon);