From 9158d035af3ab866c62b7825ad332b74191d5ef2 Mon Sep 17 00:00:00 2001 From: Doesnty Date: Wed, 2 Aug 2017 14:18:39 -0500 Subject: Improve battle_4 --- include/battle.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/battle.h') diff --git a/include/battle.h b/include/battle.h index 4b2542017..495432259 100644 --- a/include/battle.h +++ b/include/battle.h @@ -220,12 +220,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; -- cgit v1.2.3 From 4f36e317f9d2489e7c192f2a70c44a087e7d1998 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Wed, 23 Aug 2017 15:55:01 +0200 Subject: name labels --- include/battle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/battle.h') diff --git a/include/battle.h b/include/battle.h index 9d8092197..669f65d0a 100644 --- a/include/battle.h +++ b/include/battle.h @@ -782,7 +782,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); -- cgit v1.2.3 From c2d448767c6de4c9028454f279c8e43d2ecb174c Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 7 Oct 2017 16:33:02 -0700 Subject: Finish decompiling party_menu, and remove its asm/ file --- include/battle.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/battle.h') diff --git a/include/battle.h b/include/battle.h index 47cb7cf8e..86e15ad49 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 -- cgit v1.2.3 From f9282b737e5ac72ad9e946e6bf5441852abad0f8 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sun, 29 Oct 2017 02:06:11 -0400 Subject: use BAD_MEMSET macro for battle files. --- include/battle.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include/battle.h') 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 -- cgit v1.2.3 From 2f99edc6fd21d0af1bb05fae55302a46c744ffa6 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 3 Nov 2017 02:43:41 -0400 Subject: NotInBattle --- include/battle.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'include/battle.h') diff --git a/include/battle.h b/include/battle.h index 2b268c3c8..95dba4897 100644 --- a/include/battle.h +++ b/include/battle.h @@ -692,20 +692,21 @@ extern u8 ewram[]; // 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) \ +// 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. +#define BAD_MEMSET(data, c, size, var, dest) \ { \ - ptr = (u8 *)data; \ + dest = (u8 *)data; \ for(var = 0; var < (u32)size; var++) \ - ptr[var] = c; \ + dest[var] = c; \ } \ -// TODO: Try to combine these macros. -#define BAD_MEMSET_REVERSE(data, ptr2, size, var, ptr) \ +#define BAD_MEMCPY(data, dest, size, var, src) \ { \ - ptr = (u8 *)data; \ + src = (u8 *)data; \ for(var = 0; var < (u32)size; var++) \ - ptr2[var] = ptr[var]; \ + dest[var] = src[var]; \ } \ typedef void (*BattleCmdFunc)(void); -- cgit v1.2.3 From 67ea254871134d850e013ee72bd4275b40e8091b Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 3 Nov 2017 19:09:40 -0400 Subject: BG_CHAR_ADDR and BG_SCREEN_ADDR recast fixes --- include/battle.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/battle.h') diff --git a/include/battle.h b/include/battle.h index 95dba4897..9adcaaf95 100644 --- a/include/battle.h +++ b/include/battle.h @@ -748,7 +748,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 -- cgit v1.2.3 From b4c6e0560a7b1310cc08b93ea04935d4fbb7c3de Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 4 Nov 2017 22:42:28 -0400 Subject: BAD_MEM macros to MEM_ALT --- include/battle.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/battle.h') diff --git a/include/battle.h b/include/battle.h index 9adcaaf95..dc9ac93cc 100644 --- a/include/battle.h +++ b/include/battle.h @@ -694,15 +694,18 @@ extern u8 ewram[]; // 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. -#define BAD_MEMSET(data, c, size, var, dest) \ +// 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 BAD_MEMCPY(data, dest, size, var, src) \ +#define MEMCPY_ALT(data, dest, size, var, src) \ { \ src = (u8 *)data; \ for(var = 0; var < (u32)size; var++) \ -- cgit v1.2.3