From 551339599934103779bc81b4f258a5d611cf4f80 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 23 Jul 2017 23:56:42 +0200 Subject: start decompiling battle_3 git sucks --- include/battle.h | 112 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 98 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 12faee537..92e2242b7 100644 --- a/include/battle.h +++ b/include/battle.h @@ -179,7 +179,7 @@ struct BattleStruct /* 0x2000000 */ /*0x16008*/ u8 wrappedMove2[4]; /*0x1600C*/ u8 cmd49StateTracker; /*0x1600D*/ u8 unk1600D; - /*0x1600E*/ u8 unk1600E; + /*0x1600E*/ u8 turncountersTracker; /*0x1600F*/ u8 cmd23StateTracker; /*0x16010*/ u8 moveTarget[4]; /*0x16014*/ u8 unk16014; @@ -327,7 +327,84 @@ struct BattleStruct /* 0x2000000 */ /*0x160CA*/ u8 synchroniseEffect; /*0x160CB*/ u8 linkPlayerIndex; /*0x160CC*/ u16 usedHeldItems[4]; - u8 filler2[0x72E]; + /*0x160D4*/ u8 unk160D4; + /*0x160D5*/ u8 unk160D5; + /*0x160D6*/ u8 unk160D6; + /*0x160D7*/ u8 unk160D7; + /*0x160D8*/ u8 unk160D8; + /*0x160D9*/ u8 unk160D9; + /*0x160DA*/ u8 unk160DA; + /*0x160DB*/ u8 unk160DB; + /*0x160DC*/ u8 unk160DC; + /*0x160DD*/ u8 unk160DD; + /*0x160DE*/ u8 unk160DE; + /*0x160DF*/ u8 unk160DF; + /*0x160E0*/ u8 unk160E0; + /*0x160E1*/ u8 unk160E1; + /*0x160E2*/ u8 unk160E2; + /*0x160E3*/ u8 unk160E3; + /*0x160E4*/ u8 unk160E4; + /*0x160E5*/ u8 unk160E5; + /*0x160E6*/ u8 unk160E6; + /*0x160E7*/ u8 unk160E7; + /*0x160E8*/ u8 unk160E8; + /*0x160E9*/ u8 unk160E9; + /*0x160EA*/ u8 unk160EA; + /*0x160EB*/ u8 unk160EB; + /*0x160EC*/ u8 unk160EC; + /*0x160ED*/ u8 unk160ED; + /*0x160EE*/ u8 unk160EE; + /*0x160EF*/ u8 unk160EF; + /*0x160F0*/ u8 unk160F0; + /*0x160F1*/ u8 unk160F1; + /*0x160F2*/ u8 unk160F2; + /*0x160F3*/ u8 unk160F3; + /*0x160F4*/ u8 unk160F4; + /*0x160F5*/ u8 unk160F5; + /*0x160F6*/ u8 unk160F6; + /*0x160F7*/ u8 unk160F7; + /*0x160F8*/ u8 unk160F8; + /*0x160F9*/ u8 unk160F9; + /*0x160FA*/ u8 unk160FA; + /*0x160FB*/ u8 unk160FB; + /*0x160FC*/ u8 turnSideTracker; + /*0x160FD*/ u8 unk160FD; + /*0x160FE*/ u8 unk160FE; + /*0x160FF*/ u8 unk160FF; + /*0x16100*/ u8 unk16100; + /*0x16101*/ u8 unk16101; + /*0x16102*/ u8 unk16102; + /*0x16103*/ u8 unk16103; + /*0x16104*/ u8 unk16104; + /*0x16105*/ u8 unk16105; + /*0x16106*/ u8 unk16106; + /*0x16107*/ u8 unk16107; + /*0x16108*/ u8 unk16108; + /*0x16109*/ u8 unk16109; + /*0x1610A*/ u8 unk1610A; + /*0x1610B*/ u8 unk1610B; + /*0x1610C*/ u8 unk1610C; + /*0x1610D*/ u8 unk1610D; + /*0x1610E*/ u8 unk1610E; + /*0x1610F*/ u8 unk1610F; + /*0x16110*/ u8 unk16110; + /*0x16111*/ u8 unk16111; + /*0x16112*/ u8 unk16112; + /*0x16113*/ u8 unk16113; + /*0x16114*/ u8 unk16114; + /*0x16115*/ u8 unk16115; + /*0x16116*/ u8 unk16116; + /*0x16117*/ u8 unk16117; + /*0x16118*/ u8 unk16118; + /*0x16119*/ u8 unk16119; + /*0x1611A*/ u8 unk1611A; + /*0x1611B*/ u8 unk1611B; + /*0x1611C*/ u8 unk1611C; + /*0x1611D*/ u8 unk1611D; + /*0x1611E*/ u8 unk1611E; + /*0x1611F*/ u8 unk1611F; + + //u8 filler2[0x72E]; /* 0x16A00 */ struct UnkBattleStruct1 unk_2016A00_2; }; @@ -532,15 +609,16 @@ extern struct Struct20238C8 gUnknown_020238C8; // TODO: move ewram to global.h extern u8 ewram[]; -#define BATTLE_STRUCT ((struct BattleStruct *) (ewram + 0x00000)) -#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(ewram + 0x16800)) -#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 BATTLE_STRUCT ((struct BattleStruct *) (ewram + 0x00000)) +#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(ewram + 0x16800)) +#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_BATTLESCRIPTS_STACK ((struct scriptsStack *) (ewram + 0x17110)) +#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)) struct funcStack { @@ -548,6 +626,12 @@ struct funcStack u8 size; }; +struct scriptsStack +{ + u8* ptr[8]; + u8 size; +}; + extern u8 gBattleTextBuff1[]; //function declarations of buffer emits @@ -650,14 +734,14 @@ void TurnValuesCleanUp(u8); void SpecialStatusesClear(void); void sub_80138F0(void); void sub_80155A4(); -void CancelMultiTurnMoves(u8); +void CancelMultiTurnMoves(u8 bank); void PrepareStringBattle(); void sub_80156DC(); void sub_80157C4(u8 index); // asm/battle_3.o -u8 sub_8015A98(u8, u8, u8); -u8 UpdateTurnCounters(); +u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check); +u8 UpdateTurnCounters(void); u8 TurnBasedEffects(); u8 sub_80170DC(); u8 sub_80173A4(); -- cgit v1.2.3 From 7b5f9c3d5e63dbb83d43515f16b718a1579e1624 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 24 Jul 2017 18:24:06 +0200 Subject: a loop problem --- include/battle.h | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 92e2242b7..0aadd148f 100644 --- a/include/battle.h +++ b/include/battle.h @@ -105,6 +105,18 @@ #define SIDE_STATUS_MIST (1 << 8) #define SIDE_STATUS_SPIKES_DAMAGED (1 << 9) +#define ABILITYEFFECT_ENDTURN 0x1 +#define ABILITYEFFECT_CONTACT 0x4 +#define ABILITYEFFECT_IMMUNITY 0x5 +#define ABILITYEFFECT_SYNCHRONIZE 0x7 +#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8 +#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC +#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD +#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10 +#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11 +#define ABILITYEFFECT_COUNT_ON_FIELD 0x12 +#define ABILITYEFFECT_CHECK_ON_FIELD 0x13 + #define MAX_TRAINER_ITEMS 4 #define MAX_MON_MOVES 4 #define MAX_BANKS_BATTLE 4 @@ -172,7 +184,9 @@ struct BattleStruct /* 0x2000000 */ u8 filler0[0x15DDE]; /*0x15DDE*/ u8 unk15DDE; /*0x15DDF*/ u8 unk15DDF; - /*0x15DE0*/ u8 filler15DE0[0x222]; + /*0x15DE0*/ u8 filler15DE0[0x220]; + /*0x16000*/ u8 turnEffectsTracker; + /*0x16001*/ u8 turnEffectsBank; /*0x16002*/ u8 animTurn; /*0x16003*/ u8 scriptingActive; /*0x16004*/ u8 wrappedMove1[4]; @@ -403,7 +417,7 @@ struct BattleStruct /* 0x2000000 */ /*0x1611D*/ u8 unk1611D; /*0x1611E*/ u8 unk1611E; /*0x1611F*/ u8 unk1611F; - + //u8 filler2[0x72E]; /* 0x16A00 */ struct UnkBattleStruct1 unk_2016A00_2; }; @@ -593,7 +607,7 @@ struct WishFutureKnock u8 wishCounter[MAX_BANKS_BATTLE]; u8 wishUserID[MAX_BANKS_BATTLE]; u8 weatherDuration; - u8 knockedOffPokes[2]; + u16 knockedOffPokes; }; extern struct UnkBattleStruct1 unk_2016A00; @@ -745,8 +759,8 @@ u8 UpdateTurnCounters(void); u8 TurnBasedEffects(); u8 sub_80170DC(); u8 sub_80173A4(); -u8 AbilityBattleEffects(u8, u8, u8, u8, u16); -u8 ItemBattleEffects(); +u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 move); +u8 ItemBattleEffects(u8 caseID, u8 bank, bool8 moveTurn); // asm/battle_4.o void AI_CalcDmg(u8, u8); -- cgit v1.2.3 From d101fa39be37634689bd06713ba117b827f2c7c4 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 25 Jul 2017 17:09:47 +0200 Subject: attack canceller troubles --- include/battle.h | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 0aadd148f..a7ea7c6da 100644 --- a/include/battle.h +++ b/include/battle.h @@ -35,7 +35,10 @@ #define STATUS_PARALYSIS 0x40 #define STATUS_TOXIC_POISON 0x80 +#define STATUS_ANY ((STATUS_SLEEP | STATUS_POISON | STATUS_BURN | STATUS_FREEZE | STATUS_PARALYSIS | STATUS_TOXIC_POISON)) + #define STATUS2_CONFUSION 0x00000007 +#define STATUS2_FLINCHED 0x00000008 #define STATUS2_UPROAR 0x00000070 #define STATUS2_BIDE 0x00000300 //two bits 0x100 0x200 #define STATUS2_LOCK_CONFUSE 0x00000C00 @@ -87,7 +90,7 @@ #define HITMARKER_IGNORE_ON_AIR 0x00010000 #define HITMARKER_IGNORE_UNDERGROUND 0x00020000 #define HITMARKER_IGNORE_UNDERWATER 0x00040000 -#define HITMARKER_x80000 0x00080000 +#define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000 #define HITMARKER_x100000 0x00100000 #define HITMARKER_x400000 0x00400000 #define HITMARKER_x800000 0x00800000 @@ -117,6 +120,17 @@ #define ABILITYEFFECT_COUNT_ON_FIELD 0x12 #define ABILITYEFFECT_CHECK_ON_FIELD 0x13 +#define MOVESTATUS_MISSED (1 << 0) +#define MOVESTATUS_SUPEREFFECTIVE (1 << 1) +#define MOVESTATUS_NOTVERYEFFECTIVE (1 << 2) +#define MOVESTATUS_NOTAFFECTED (1 << 3) +#define MOVESTATUS_ONEHITKO (1 << 4) +#define MOVESTATUS_FAILED (1 << 5) +#define MOVESTATUS_ENDURED (1 << 6) +#define MOVESTATUS_HUNGON (1 << 7) + +#define MOVESTATUS_NOEFFECT ((MOVESTATUS_MISSED | MOVESTATUS_NOTAFFECTED | MOVESTATUS_FAILED)) + #define MAX_TRAINER_ITEMS 4 #define MAX_MON_MOVES 4 #define MAX_BANKS_BATTLE 4 @@ -262,7 +276,7 @@ struct BattleStruct /* 0x2000000 */ /*0x16056*/ u8 moneyMultiplier; /*0x16057*/ u8 unk16057; /*0x16058*/ u8 unk16058; - /*0x16059*/ u8 unk16059; + /*0x16059*/ u8 sub80173A4_Tracker; /*0x1605A*/ u8 unk1605A; /*0x1605B*/ u8 unk1605B; /*0x1605C*/ u16 exp; @@ -283,10 +297,7 @@ struct BattleStruct /* 0x2000000 */ /*0x1608A*/ u8 unk1608A; /*0x1608B*/ u8 unk1608B; /*0x1608C*/ u8 ChosenMoveID[4]; - /*0x16090*/ u8 unk16090; - /*0x16091*/ u8 unk16091; - /*0x16092*/ u8 unk16092; - /*0x16093*/ u8 unk16093; + /*0x16090*/ s32 bideDmg; /*0x16094*/ u8 unk16094; /*0x16095*/ u8 unk16095; /*0x16096*/ u8 unk16096; @@ -360,7 +371,7 @@ struct BattleStruct /* 0x2000000 */ /*0x160E4*/ u8 unk160E4; /*0x160E5*/ u8 unk160E5; /*0x160E6*/ u8 unk160E6; - /*0x160E7*/ u8 unk160E7; + /*0x160E7*/ u8 atkCancellerTracker; /*0x160E8*/ u8 unk160E8; /*0x160E9*/ u8 unk160E9; /*0x160EA*/ u8 unk160EA; @@ -401,8 +412,8 @@ struct BattleStruct /* 0x2000000 */ /*0x1610D*/ u8 unk1610D; /*0x1610E*/ u8 unk1610E; /*0x1610F*/ u8 unk1610F; - /*0x16110*/ u8 unk16110; - /*0x16111*/ u8 unk16111; + /*0x16110*/ u8 sub80170DC_Tracker; + /*0x16111*/ u8 sub80170DC_Bank; /*0x16112*/ u8 unk16112; /*0x16113*/ u8 unk16113; /*0x16114*/ u8 unk16114; -- cgit v1.2.3 From 6f52c5238ccd0dad9a465102c950aa77cc7730c4 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 25 Jul 2017 22:07:49 -0500 Subject: decompile the two remaining functions of berry_tag_screen.c --- include/item_menu.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/item_menu.h b/include/item_menu.h index 6950ed0ff..29618f347 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -3,6 +3,17 @@ #include "string_util.h" +struct PocketScrollState +{ + u8 cursorPos; + u8 scrollTop; + u8 numSlots; + u8 cursorMax; +}; + +extern struct PocketScrollState gBagPocketScrollStates[]; +extern struct ItemSlot *gCurrentBagPocketItemSlots; + void ResetBagScrollPositions(void); void ClearBag(void); void sub_80A3E0C(void); -- cgit v1.2.3 From 1416c0c79d9fd6903f1d13f2a7740df4bad100d3 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Wed, 26 Jul 2017 18:23:41 +0200 Subject: the ultimate challenge --- include/battle.h | 18 ++++++++++++++++-- include/pokemon.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index a7ea7c6da..44b7c048a 100644 --- a/include/battle.h +++ b/include/battle.h @@ -74,6 +74,8 @@ #define STATUS3_MUDSPORT 0x10000 #define STATUS3_WATERSPORT 0x20000 #define STATUS3_UNDERWATER 0x40000 +#define STATUS3_INTIMIDATE_POKES 0x80000 +#define STATUS3_TRACE 0x100000 #define STATUS3_SEMI_INVULNERABLE ((STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER)) @@ -108,18 +110,29 @@ #define SIDE_STATUS_MIST (1 << 8) #define SIDE_STATUS_SPIKES_DAMAGED (1 << 9) +#define ABILITYEFFECT_ON_SWITCHIN 0x0 #define ABILITYEFFECT_ENDTURN 0x1 +#define ABILITYEFFECT_MOVES_BLOCK 0x2 +#define ABILITYEFFECT_ABSORBING 0x3 #define ABILITYEFFECT_CONTACT 0x4 #define ABILITYEFFECT_IMMUNITY 0x5 +#define ABILITYEFFECT_FORECAST 0x6 #define ABILITYEFFECT_SYNCHRONIZE 0x7 #define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8 +#define ABILITYEFFECT_INTIMIDATE1 0x9 +#define ABILITYEFFECT_INTIMIDATE2 0xA +#define ABILITYEFFECT_TRACE 0xB #define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC #define ABILITYEFFECT_CHECK_BANK_SIDE 0xD +#define ABILITYEFFECT_FIELD_SPORT 0xE +#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK 0xF #define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10 #define ABILITYEFFECT_COUNT_BANK_SIDE 0x11 #define ABILITYEFFECT_COUNT_ON_FIELD 0x12 #define ABILITYEFFECT_CHECK_ON_FIELD 0x13 +#define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0))) + #define MOVESTATUS_MISSED (1 << 0) #define MOVESTATUS_SUPEREFFECTIVE (1 << 1) #define MOVESTATUS_NOTVERYEFFECTIVE (1 << 2) @@ -361,7 +374,7 @@ struct BattleStruct /* 0x2000000 */ /*0x160DA*/ u8 unk160DA; /*0x160DB*/ u8 unk160DB; /*0x160DC*/ u8 unk160DC; - /*0x160DD*/ u8 unk160DD; + /*0x160DD*/ u8 intimidateBank; /*0x160DE*/ u8 unk160DE; /*0x160DF*/ u8 unk160DF; /*0x160E0*/ u8 unk160E0; @@ -644,6 +657,7 @@ extern u8 ewram[]; #define ewram17800 ((struct Struct2017800 *) (ewram + 0x17800)) #define ewram17810 ((struct Struct2017810 *) (ewram + 0x17810)) #define ewram17840 (*(struct Struct2017840 *) (ewram + 0x17840)) +#define ewram17000 ((u32 *) (ewram + 0x17100)) struct funcStack { @@ -767,7 +781,7 @@ void sub_80157C4(u8 index); // asm/battle_3.o u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check); u8 UpdateTurnCounters(void); -u8 TurnBasedEffects(); +u8 TurnBasedEffects(void); u8 sub_80170DC(); u8 sub_80173A4(); u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 move); diff --git a/include/pokemon.h b/include/pokemon.h index be6ccfe74..242d62029 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -408,6 +408,7 @@ struct BattleMove u8 pad[3]; }; +#define FLAG_MAKES_CONTACT 0x1 #define FLAG_PROTECT_AFFECTED 0x2 #define FLAG_MAGICCOAT_AFFECTED 0x4 #define FLAG_SNATCH_AFFECTED 0x8 -- cgit v1.2.3 From dddca2951a2619d98e5008473408a83d69d8c99e Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 28 Jul 2017 18:02:08 +0200 Subject: IBE matches --- include/battle.h | 8 +++++--- include/pokemon.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 44b7c048a..0f1a5f26b 100644 --- a/include/battle.h +++ b/include/battle.h @@ -34,7 +34,9 @@ #define STATUS_FREEZE 0x20 #define STATUS_PARALYSIS 0x40 #define STATUS_TOXIC_POISON 0x80 +#define STATUS_TOXIC_COUNTER 0xF00 +#define STATUS_PSN_ANY ((STATUS_POISON | STATUS_TOXIC_POISON)) #define STATUS_ANY ((STATUS_SLEEP | STATUS_POISON | STATUS_BURN | STATUS_FREEZE | STATUS_PARALYSIS | STATUS_TOXIC_POISON)) #define STATUS2_CONFUSION 0x00000007 @@ -597,9 +599,9 @@ struct SpecialStatus u8 flag40 : 1; u8 focusBanded : 1; u8 field1[3]; - u32 moveturnLostHP; - u32 moveturnLostHP_physical; - u32 moveturnLostHP_special; + s32 moveturnLostHP; + s32 moveturnLostHP_physical; + s32 moveturnLostHP_special; u8 moveturnPhysicalBank; u8 moveturnSpecialBank; u8 field12; diff --git a/include/pokemon.h b/include/pokemon.h index 242d62029..21173d503 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -412,6 +412,7 @@ struct BattleMove #define FLAG_PROTECT_AFFECTED 0x2 #define FLAG_MAGICCOAT_AFFECTED 0x4 #define FLAG_SNATCH_AFFECTED 0x8 +#define FLAG_KINGSROCK_AFFECTED 0x20 struct PokemonStorage { -- cgit v1.2.3 From 3d0adf41579297b670238259f1b73046267a68be Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 28 Jul 2017 19:24:11 +0200 Subject: Unreferenced move merger --- include/battle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 0f1a5f26b..d68c8280e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -106,6 +106,7 @@ #define SIDE_STATUS_REFLECT (1 << 0) #define SIDE_STATUS_LIGHTSCREEN (1 << 1) +#define SIDE_STATUS_X4 (1 << 2) #define SIDE_STATUS_SPIKES (1 << 4) #define SIDE_STATUS_SAFEGUARD (1 << 5) #define SIDE_STATUS_FUTUREATTACK (1 << 6) @@ -614,8 +615,7 @@ struct sideTimer u8 lightscreenTimer; //0x1 u8 mistTimer; //0x2 u8 field3; //0x3 - u8 field4; //0x4 - u8 field5; //0x5 + u16 field4; //0x4 u8 spikesAmount; //0x6 u8 safeguardTimer; //0x7 u8 followmeTimer; //0x8 -- cgit v1.2.3 From 6785868132dbebc8dd9fa95cc47189ccd7b8d3b7 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 28 Jul 2017 23:42:03 +0200 Subject: last function IsPokeDisobedient --- include/battle.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index d68c8280e..4b2542017 100644 --- a/include/battle.h +++ b/include/battle.h @@ -96,6 +96,7 @@ #define HITMARKER_IGNORE_UNDERWATER 0x00040000 #define HITMARKER_UNABLE_TO_USE_MOVE 0x00080000 #define HITMARKER_x100000 0x00100000 +#define HITMARKER_x200000 0x00200000 #define HITMARKER_x400000 0x00400000 #define HITMARKER_x800000 0x00800000 #define HITMARKER_GRUDGE 0x01000000 @@ -661,6 +662,8 @@ extern u8 ewram[]; #define ewram17840 (*(struct Struct2017840 *) (ewram + 0x17840)) #define ewram17000 ((u32 *) (ewram + 0x17100)) +typedef void (*BattleCmdFunc)(void); + struct funcStack { void* ptr[8]; -- cgit v1.2.3 From bba94787f73662b21703d105603da6d1f40a442c Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 31 Jul 2017 16:11:41 +0200 Subject: battle message decompiled --- include/battle.h | 11 ++++++++++- include/battle_message.h | 5 +++-- include/data2.h | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/battle.h b/include/battle.h index 4b2542017..9d8092197 100644 --- a/include/battle.h +++ b/include/battle.h @@ -19,6 +19,15 @@ #define BATTLE_TYPE_LEGENDARY 0x2000 #define BATTLE_TYPE_REGI 0x4000 +#define BATTLE_WON 0x1 +#define BATTLE_LOST 0x2 +#define BATTLE_DREW 0x3 +#define BATTLE_RAN 0x4 +#define BATTLE_PLAYER_TELEPORTED 0x5 +#define BATTLE_POKE_FLED 0x6 +#define BATTLE_CAUGHT 0x7 +#define BATTLE_OPPONENT_TELEPORTED 0xA + #define AI_ACTION_DONE 0x0001 #define AI_ACTION_FLEE 0x0002 #define AI_ACTION_WATCH 0x0004 @@ -327,7 +336,7 @@ struct BattleStruct /* 0x2000000 */ /*0x1609D*/ u8 unk1609D; /*0x1609E*/ u8 unk1609E; /*0x1609F*/ u8 unk1609F; - /*0x160A0*/ u8 unk160a0; + /*0x160A0*/ u8 stringMoveType; /*0x160A1*/ u8 animTargetsHit; /*0x160A2*/ u8 expGetterBank; /*0x160A3*/ u8 unk160A3; diff --git a/include/battle_message.h b/include/battle_message.h index da57333a5..d115e5357 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -1,7 +1,8 @@ #ifndef GUARD_BATTLE_MESSAGE_H #define GUARD_BATTLE_MESSAGE_H -void StrCpyDecodeToDisplayedStringBattle(const u8 *); -void StrCpyDecodeBattle(const u8 *, u8 *); +void BufferStringBattle(u16 stringID); +u32 StrCpyDecodeToDisplayedStringBattle(const u8* src); +u32 StrCpyDecodeBattle(const u8* src, u8* dst); #endif // GUARD_BATTLE_MESSAGE_H diff --git a/include/data2.h b/include/data2.h index 9dd26fd5f..2837a4451 100644 --- a/include/data2.h +++ b/include/data2.h @@ -45,6 +45,8 @@ extern const u8 gTrainerClassNames[][13]; extern const struct Trainer gTrainers[]; extern u8 gSpeciesNames[][11]; extern u8 gMoveNames[][13]; +extern const u8 gAbilityNames[][13]; +extern const u8 gTypeNames[][7]; extern const struct UnknownStructD2 gUnknown_081F9674; extern const u8 gUnknown_081F96C8[]; extern struct CompressedSpriteSheet gUnknown_081FAEA4; -- cgit v1.2.3 From d413187fa82e19ceea5ff1b2437891329781a814 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 1 Aug 2017 11:07:23 +0200 Subject: start decompiling egg hatch --- include/decompress.h | 2 +- include/pokemon.h | 2 +- include/sprite.h | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/decompress.h b/include/decompress.h index 07d69301f..84c1f29c0 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -10,7 +10,7 @@ void LoadCompressedObjectPicOverrideBuffer(const struct CompressedSpriteSheet *a void LoadCompressedObjectPalette(const struct CompressedSpritePalette *a); void LoadCompressedObjectPaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer); void DecompressPicFromTable_2(const struct CompressedSpriteSheet *a, u8 b, u8 c, void *d, void *e, s32 f); -void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g); +void HandleLoadSpecialPokePic(const struct CompressedSpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 pid); void LoadSpecialPokePic(const struct CompressedSpriteSheet *spriteSheet, u32 b, u32 c, u32 d, void *dest, s32 species, u32 g, u32 h); void Unused_LZDecompressWramIndirect(const void **src, void *dest); diff --git a/include/pokemon.h b/include/pokemon.h index 21173d503..2cc8e9ac4 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -542,7 +542,7 @@ union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u32 GetMonData(); u32 GetBoxMonData(); -void SetMonData(struct Pokemon *mon, s32 field, const u8 *data); +void SetMonData(struct Pokemon *mon, s32 field, const void *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); diff --git a/include/sprite.h b/include/sprite.h index 733231eb5..5682a7c1d 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -204,14 +204,14 @@ struct Sprite /*0x3A*/ s16 data6; /*0x3C*/ s16 data7; - /*0x3E*/ u16 inUse:1; - u16 coordOffsetEnabled:1; - u16 invisible:1; - u16 flags_3:1; - u16 flags_4:1; - u16 flags_5:1; - u16 flags_6:1; - u16 flags_7:1; + /*0x3E*/ u16 inUse:1; //1 + u16 coordOffsetEnabled:1; //2 + u16 invisible:1; //4 + u16 flags_3:1; //8 + u16 flags_4:1; //0x10 + u16 flags_5:1; //0x20 + u16 flags_6:1; //0x40 + u16 flags_7:1; //0x80 /*0x3F*/ u16 hFlip:1; u16 vFlip:1; u16 animBeginning:1; -- cgit v1.2.3 From f246b05d996dba1249393e9219f0c32337feac02 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 1 Aug 2017 12:47:03 +0200 Subject: finish up egg hatch, make it compile --- include/pokemon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/pokemon.h b/include/pokemon.h index 2cc8e9ac4..21173d503 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -542,7 +542,7 @@ union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u32 GetMonData(); u32 GetBoxMonData(); -void SetMonData(struct Pokemon *mon, s32 field, const void *data); +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); -- cgit v1.2.3 From 00abce98dba72f1119b41e5f7f9b186fb30dbf64 Mon Sep 17 00:00:00 2001 From: golemgalvanize Date: Sun, 13 Aug 2017 20:05:42 -0400 Subject: decompile intro_credits_graphics.s (#381) * Update * Update * Update * update * intro_credits_graphics * decompiled up to sub_80cb438 * decompiled up to sub_80CB7EC * decompiled up to sub_80cbc8c * decompiled up to sub_80CC408 * decompiled up to sub_80CCD24 * fixed it up a little * more fixes * Update ld_script.txt * Delete battle_anim_80CA710.c * Update battle_anim_80CA710.s reverted --- include/intro_credits_graphics.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index 5abb2381b..2718d2f9f 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -10,15 +10,16 @@ extern const struct SpritePalette gIntro2SpritePalettes[]; extern const struct CompressedSpriteSheet gUnknown_08416E24; extern const struct CompressedSpriteSheet gUnknown_08416E34; -void load_intro_part2_graphics(/*TODO: arg types*/); -void sub_8148C78(/*TODO: arg types*/); +void load_intro_part2_graphics(u8 a); +void sub_8148C78(u8 a); void sub_8148CB0(u8); void sub_8148E90(u8); -u8 sub_8148EC0(/*TODO: arg types*/); -void sub_8149020(/*TODO: arg types*/); -u8 intro_create_brendan_sprite(/*TODO: arg types*/); -u8 intro_create_may_sprite(/*TODO: arg types*/); -u8 intro_create_latios_sprite(/*TODO: arg types*/); -u8 intro_create_latias_sprite(/*TODO: arg types*/); +u8 sub_8148EC0(u8 a, u16 b, u16 c, u16 d); +void sub_8148F3C(u8); +void sub_8149020(u8); +u8 intro_create_brendan_sprite(s16 a, s16 b); +u8 intro_create_may_sprite(s16 a, s16 b); +u8 intro_create_latios_sprite(s16 a, s16 b); +u8 intro_create_latias_sprite(s16 a, s16 b); #endif // GUARD_INTRO_CREDITS_GRAPHICS_H -- cgit v1.2.3