diff options
Diffstat (limited to 'include')
34 files changed, 486 insertions, 72 deletions
diff --git a/include/battle.h b/include/battle.h index d93860094..d4cb53689 100644..100755 --- a/include/battle.h +++ b/include/battle.h @@ -28,8 +28,82 @@ #define AI_ACTION_UNK7 0x0040 #define AI_ACTION_UNK8 0x0080 +#define STATUS_SLEEP 0x7 +#define STATUS_POISON 0x8 +#define STATUS_BURN 0x10 +#define STATUS_FREEZE 0x20 +#define STATUS_PARALYSIS 0x40 +#define STATUS_TOXIC_POISON 0x80 + +#define STATUS2_CONFUSION 0x00000007 +#define STATUS2_UPROAR 0x00000070 +#define STATUS2_LOCK_CONFUSE 0x00000C00 +#define STATUS2_MULTIPLETURNS 0x00001000 +#define STATUS2_WRAPPED 0x0000E000 +#define STATUS2_FOCUS_ENERGY 0x00100000 +#define STATUS2_TRANSFORMED 0x00200000 +#define STATUS2_RECHARGE 0x00400000 +#define STATUS2_RAGE 0x00800000 +#define STATUS2_SUBSTITUTE 0x01000000 +#define STATUS2_ESCAPE_PREVENTION 0x04000000 +#define STATUS2_NIGHTMARE 0x08000000 +#define STATUS2_CURSED 0x10000000 +#define STATUS2_FORESIGHT 0x20000000 + +#define STATUS3_LEECHSEED_RECEIVER 0x3 //two bits for the bank that gets hp +#define STATUS3_LEECHSEED 0x4 +#define STATUS3_ALWAYS_HITS 0x18 //two bits +#define STATUS3_PERISH_SONG 0x20 +#define STATUS3_ON_AIR 0x40 +#define STATUS3_UNDERGROUND 0x80 +#define STATUS3_MINIMIZED 0x100 +#define STATUS3_CHARGED_UP 0x200 +#define STATUS3_ROOTED 0x400 +#define STATUS3_GRUDGE 0x4000 +#define STATUS3_CANT_SCORE_A_CRIT 0x8000 +#define STATUS3_MUDSPORT 0x10000 +#define STATUS3_WATERSPORT 0x20000 +#define STATUS3_UNDERWATER 0x40000 + +#define HITMARKER_x20 0x0000020 +#define HITMARKER_DESTINYBOND 0x0000040 +#define HITMARKER_NO_ANIMATIONS 0x0000080 +#define HITMARKER_IGNORE_SUBSTITUTE 0x0000100 +#define HITMARKER_NO_ATTACKSTRING 0x0000200 +#define HITMARKER_ATTACKSTRING_PRINTED 0x0000400 +#define HITMARKER_NO_PPDEDUCT 0x0000800 +#define HITMARKER_IGNORE_SAFEGUARD 0x0002000 +#define HITMARKER_SYNCHRONISE_EFFECT 0x0004000 +#define HITMARKER_IGNORE_ON_AIR 0x0010000 +#define HITMARKER_IGNORE_UNDERGROUND 0x0020000 +#define HITMARKER_IGNORE_UNDERWATER 0x0040000 +#define HITMARKER_x80000 0x0080000 +#define HITMARKER_x100000 0x0100000 +#define HITMARKER_x400000 0x0400000 +#define HITMARKER_x800000 0x0800000 +#define HITMARKER_GRUDGE 0x1000000 +#define HITMARKER_OBEYS 0x2000000 +#define HITMARKER_FAINTED(bank) ((gBitTable[bank] << 0x1C)) +#define HITMARKER_UNK(bank) ((0x10000000 << bank)) + #define MAX_TRAINER_ITEMS 4 #define MAX_MON_MOVES 4 +#define MAX_BANKS_BATTLE 4 + +#define weather_rain 1 +#define weather_downpour 2 +#define weather_permament_rain 4 +#define WEATHER_RAINY ((weather_rain | weather_downpour | weather_permament_rain)) + +#define weather_sandstorm 8 +#define weather_permament_sandstorm 0x10 +#define WEATHER_SANDSTORMY ((weather_sandstorm | weather_permament_sandstorm)) + +#define weather_sun 0x20 +#define weather_permament_sun 0x40 +#define WEATHER_SUNNY ((weather_sun | weather_permament_sun)) + +#define weather_hail 0x80 // needed to match the hack that is get_item, thanks cam, someone else clean this up later. extern u8 unk_2000000[]; @@ -85,79 +159,247 @@ struct AI_ThinkingStruct /* 0x2016800 */ /* 0x18 */ u8 simulatedRNG[4]; }; -struct SmallBattleStruct1 -{ - u8 unk1; - u8 unk2; - u8 unk3; - u8 unk4; - // unknown size -}; - -struct SmallItemStruct -{ - u8 itemLocal[2][3]; -}; - struct BattleStruct /* 0x2000000 */ { u8 filler0[0x15DDE]; /*0x15DDE*/ u8 unk15DDE; /*0x15DDF*/ u8 unk15DDF; - /*0x15DE0*/ u8 filler15DE0[0x23C]; // 0xAF off? - struct SmallBattleStruct1 unk; - u8 filler1[0x68]; - /* 0x16089 */ u8 safariFleeRate; - u8 filler1_2[0x42]; - /* 0x160CB */ u8 linkPlayerIndex; - /* 0x160CC */ struct SmallItemStruct item; + /*0x15DE0*/ u8 filler15DE0[0x222]; + /*0x16002*/ u8 AnimTurn; + /*0x16003*/ u8 ScriptingActive; + /*0x16004*/ u8 WrappedMove1[4]; + /*0x16008*/ u8 WrappedMove2[4]; + /*0x1600C*/ u8 cmd49StateTracker; + /*0x1600D*/ u8 unk1600D; + /*0x1600E*/ u8 unk1600E; + /*0x1600F*/ u8 atk23StateTracker; + /*0x16010*/ u8 unk16010; + /*0x16011*/ u8 unk16011; + /*0x16012*/ u8 unk16012; + /*0x16013*/ u8 unk16013; + /*0x16014*/ u8 unk16014; + /*0x16015*/ u8 unk16015; + /*0x16016*/ u8 unk16016; + /*0x16017*/ u8 unk16017; + /*0x16018*/ u8 expGetterID; + /*0x16019*/ u8 unk16019; + /*0x1601A*/ u8 unk1601A; + /*0x1601B*/ u8 wildVictorySong; + /*0x1601C*/ u8 DynamicMoveType; + /*0x1601D*/ u8 unk1601D; + /*0x1601E*/ u8 statChanger; + /*0x1601F*/ u8 DmgMultiplier; + /*0x16020*/ u8 WrappedBy[4]; + /*0x16024*/ u8 unk16024; + /*0x16025*/ u8 unk16025; + /*0x16026*/ u8 unk16026; + /*0x16027*/ u8 unk16027; + /*0x16028*/ u8 unk16028; + /*0x16029*/ u8 unk16029; + /*0x1602A*/ u8 unk1602A; + /*0x1602B*/ u8 unk1602B; + /*0x1602C*/ u8 unk1602C; + /*0x1602D*/ u8 unk1602D; + /*0x1602E*/ u8 unk1602E; + /*0x1602F*/ u8 unk1602F; + /*0x16030*/ u8 unk16030; + /*0x16031*/ u8 unk16031; + /*0x16032*/ u8 unk16032; + /*0x16033*/ u8 unk16033; + /*0x16034*/ u8 unk16034; + /*0x16035*/ u8 unk16035; + /*0x16036*/ u8 unk16036; + /*0x16037*/ u8 unk16037; + /*0x16038*/ u8 unk16038; + /*0x16039*/ u8 unk16039; + /*0x1603A*/ u8 unk1603A; + /*0x1603B*/ u8 unk1603B; + /*0x1603C*/ u8 unk1603C; + /*0x1603D*/ u8 unk1603D; + /*0x1603E*/ u8 unk1603E; + /*0x1603F*/ u8 unk1603F; + /*0x16040*/ u8 unk16040; + /*0x16041*/ u8 unk16041; + /*0x16042*/ u8 unk16042; + /*0x16043*/ u8 unk16043; + /*0x16044*/ u8 unk16044; + /*0x16045*/ u8 unk16045; + /*0x16046*/ u8 unk16046; + /*0x16047*/ u8 unk16047; + /*0x16048*/ u8 unk16048; + /*0x16049*/ u8 unk16049; + /*0x1604A*/ u8 unk1604A; + /*0x1604B*/ u8 unk1604B; + /*0x1604C*/ u8 unk1604C; + /*0x1604D*/ u8 unk1604D; + /*0x1604E*/ u8 unk1604E; + /*0x1604F*/ u8 unk1604F; + /*0x16050*/ u8 unk16050; + /*0x16051*/ u8 unk16051; + /*0x16052*/ u8 unk16052; + /*0x16053*/ u8 unk16053; + /*0x16054*/ u8 unk16054; + /*0x16055*/ u8 unk16055; + /*0x16056*/ u8 unk16056; + /*0x16057*/ u8 unk16057; + /*0x16058*/ u8 unk16058; + /*0x16059*/ u8 unk16059; + /*0x1605A*/ u8 unk1605A; + /*0x1605B*/ u8 unk1605B; + /*0x1605C*/ u16 exp; + /*0x1605E*/ u8 unk1605E; + /*0x1605F*/ u8 sentInPokes; + /*0x16060*/ u8 unk16060[4]; + /*0x16064*/ u8 unk16064; + /*0x16065*/ u8 unk16065; + /*0x16066*/ u8 unk16066; + /*0x16067*/ u8 unk16067; + /*0x16068*/ u8 unk16068; + /*0x16069*/ u8 unk16069; + /*0x1606A*/ u8 unk1606A; + /*0x1606B*/ u8 unk1606B; + /*0x1606C*/ u8 unk1606C; + /*0x1606D*/ u8 unk1606D; + /*0x1606E*/ u8 unk1606E; + /*0x1606F*/ u8 unk1606F; + /*0x16070*/ u8 unk16070; + /*0x16071*/ u8 unk16071; + /*0x16072*/ u8 unk16072; + /*0x16073*/ u8 unk16073; + /*0x16074*/ u8 unk16074; + /*0x16075*/ u8 unk16075; + /*0x16076*/ u8 unk16076; + /*0x16077*/ u8 unk16077; + /*0x16078*/ u8 unk16078; + /*0x16079*/ u8 unk16079; + /*0x1607A*/ u8 unk1607A; + /*0x1607B*/ u8 unk1607B; + /*0x1607C*/ u8 unk1607C; + /*0x1607D*/ u8 unk1607D; + /*0x1607E*/ u8 unk1607E; + /*0x1607F*/ u8 unk1607F; + /*0x16080*/ u8 unk16080; + /*0x16081*/ u8 unk16081; + /*0x16082*/ u8 unk16082; + /*0x16083*/ u8 unk16083; + /*0x16084*/ u8 unk16084; + /*0x16085*/ u8 unk16085; + /*0x16086*/ u8 unk16086; + /*0x16087*/ u8 unk16087; + /*0x16088*/ u8 safariFleeRate; + /*0x16089*/ u8 unk16089; + /*0x1608A*/ u8 unk1608A; + /*0x1608B*/ u8 unk1608B; + /*0x1608C*/ u8 ChosenMoveID[4]; + /*0x16090*/ u8 unk16090; + /*0x16091*/ u8 unk16091; + /*0x16092*/ u8 unk16092; + /*0x16093*/ u8 unk16093; + /*0x16094*/ u8 unk16094; + /*0x16095*/ u8 unk16095; + /*0x16096*/ u8 unk16096; + /*0x16097*/ u8 unk16097; + /*0x16098*/ u8 unk16098; + /*0x16099*/ u8 unk16099; + /*0x1609A*/ u8 unk1609a; + /*0x1609B*/ u8 unk1609b; + /*0x1609C*/ u8 unk1609C; + /*0x1609D*/ u8 unk1609D; + /*0x1609E*/ u8 unk1609E; + /*0x1609F*/ u8 unk1609F; + /*0x160A0*/ u8 unk160a0; + /*0x160A1*/ u8 AnimTargetsHit; + /*0x160A2*/ u8 expGetterBank; + /*0x160A3*/ u8 unk160A3; + /*0x160A4*/ u8 AnimArg1; + /*0x160A5*/ u8 AnimArg2; + /*0x160A6*/ u8 unk160A6; + /*0x160A7*/ u8 unk160A7; + /*0x160A8*/ u8 unk160A8; + /*0x160A9*/ u8 unk160A9; + /*0x160AA*/ u8 unk160Aa; + /*0x160AB*/ u8 unk160Ab; + /*0x160AC*/ u8 unk160AC; + /*0x160AD*/ u8 unk160AD; + /*0x160AE*/ u8 unk160AE; + /*0x160AF*/ u8 unk160AF; + /*0x160B0*/ u8 unk160B0; + /*0x160B1*/ u8 unk160B1; + /*0x160B2*/ u8 unk160B2; + /*0x160B3*/ u8 unk160B3; + /*0x160B4*/ u8 unk160B4; + /*0x160B5*/ u8 unk160B5; + /*0x160B6*/ u8 unk160B6; + /*0x160B7*/ u8 unk160B7; + /*0x160B8*/ u8 unk160B8; + /*0x160B9*/ u8 unk160B9; + /*0x160BA*/ u8 unk160Ba; + /*0x160BB*/ u8 unk160Bb; + /*0x160BC*/ u8 unk160BC; + /*0x160BD*/ u8 unk160BD; + /*0x160BE*/ u8 unk160BE; + /*0x160BF*/ u8 unk160BF; + /*0x160C0*/ u8 unk160C0; + /*0x160C1*/ u8 unk160C1; + /*0x160C2*/ u8 unk160C2; + /*0x160C3*/ u8 unk160C3; + /*0x160C4*/ u8 unk160C4; + /*0x160C5*/ u8 unk160C5; + /*0x160C6*/ u8 unk160C6; + /*0x160C7*/ u8 unk160C7; + /*0x160C8*/ u8 unk160C8; + /*0x160C9*/ u8 unk160C9; + /*0x160CA*/ u8 SynchroniseEffect; + /*0x160CB*/ u8 linkPlayerIndex; + /*0x160CC*/ u16 UsedHeldItems[4]; u8 filler2[0x72E]; - /* 0x16800 */ struct AI_ThinkingStruct ai; /* 0x2016800 */ - u8 filler1681C[0x1E4]; /* 0x16A00 */ struct UnkBattleStruct1 unk_2016A00_2; }; -struct UnkBattleStruct4 +struct DisableStruct { /*0x00*/ u8 filler0[0x3]; - /*0x04*/ u16 unk4; - /*0x06*/ u16 unk6; - /*0x08*/ u8 unk8; - /*0x09*/ u8 unk9; - /*0x0A*/ u8 unkA; + /*0x04*/ u16 DisabledMove; + /*0x06*/ u16 EncoredMove; + /*0x08*/ u8 ProtectUses; + /*0x09*/ u8 StockpileCounter; + /*0x0A*/ u8 SubstituteHP; u8 fillerB[4]; u8 unkF_0:4; u8 unkF_4:4; u8 filler10[3]; /*0x13*/ u8 taunt:4; /*0x13*/ u8 unkC:4; - /*0x14*/ u8 unk14; - /*0x15*/ u8 unk15; - /*0x16*/ u8 unk16; - /*0x17*/ u8 filler17[0x4]; + /*0x14*/ u8 BankPreventingEscape; + /*0x15*/ u8 BankWithSureHit; + /*0x16*/ u8 IsFirstTurn; + /*0x17*/ u8 unk17; + /*0x18*/ u8 TruantCounter; + /*0x19*/ u8 RechargeCounter; + /*0x1A*/ u8 unk1A[2]; }; -struct Struct30042E0 +struct BattleResults { - u8 unk0; - u8 unk1; - u8 unk2; - u8 unk3; - u8 unk4; - u8 unk5_0:1; - u8 unk5_1:1; - u16 unk6; - u8 unk8[10]; + u8 PlayerFaintCounter; // 0x0 + u8 OpponentFaintCounter; // 0x1 + u8 unk2; // 0x2 + u8 unk3; // 0x3 + u8 unk4; // 0x4 + u8 unk5_0:1; // 0x5 + u8 unk5_1:1; // 0x5 + u16 Poke1Species; // 0x6 + u8 PokeString1[10]; // 0x8 u8 unk12; - u8 unk13; - u8 unk14[10]; + u8 BattleTurnCounter; // 0x13 + u8 PokeString2[10]; // 0x14 u8 filler1E[2]; - u16 unk20; - u16 unk22; - u16 unk24; - u16 unk26; - u16 unk28; - u8 unk2A[10]; + u16 LastOpponentSpecies; // 0x20 + u16 LastUsedMove; // 0x22 + u16 OpponentMove; // 0x24 + u16 OpponentSpecies; // 0x26 + u16 CaughtPoke; // 0x28 + u8 CaughtNick[10]; // 0x2A u8 filler34[2]; u8 unk36[10]; }; @@ -183,6 +425,7 @@ struct Struct2017810 u8 unk0_6:1; u8 unk0_7:1; u8 unk1_0:1; + u8 unk1_1:5; u8 unk2; u8 unk3; u8 unk4; @@ -208,8 +451,95 @@ struct Struct20238C8 u8 unk0_7:1; }; +struct ProtectStruct +{ + /*field0*/ + u32 Protected:1; + u32 Endured:1; + u32 OnlyStruggle:1; + u32 HelpingHand:1; + u32 BounceMove:1; + u32 StealMove:1; + u32 Flag0Unknown:1; + u32 PrlzImmobility:1; + /*field1*/ + u32 ConfusionSelfDmg:1; + u32 NotEffective:1; + u32 ChargingTurn:1; + u32 FleeFlag:2; //for RunAway and Smoke Ball + u32 UsedImprisionedMove:1; + u32 LoveImmobility:1; + u32 UsedDisabledMove:1; + /*field2*/ + u32 UsedTauntedMove:1; + u32 Flag2Unknown:1; + u32 FlinchImmobility:1; + u32 NotFirstStrike:1; + u32 Free : 4; + /*field3*/ + u32 field3 : 8; + u32 PhysicalDmg; + u32 SpecialDmg; + u8 PhysicalBank; + u8 SpecialBank; + u16 fieldE; +}; + +struct SpecialStatus +{ + u8 statLowered : 1; + u8 lightningRodRedirected : 1; + u8 restoredBankSprite: 1; + u8 intimidatedPoke : 1; + u8 traced : 1; + u8 flag20 : 1; + u8 flag40 : 1; + u8 focusBanded : 1; + u8 field1[3]; + u32 moveturnLostHP; + u32 moveturnlostHP_physical; + u32 moveturnLostHP_special; + u8 moveturnPhysicalBank; + u8 moveturnSpecialBank; + u8 field12; + u8 field13; +}; + +struct sideTimer +{ + u8 reflectTimer; + u8 reflectBank; + u8 lightscreenTimer; + u8 lightscreenBank; + u8 mistTimer; + u8 mistBank; + u8 safeguardTimer; + u8 safeguardBank; + u8 followmeTimer; + u8 followmeTarget; + u8 spikesAmount; + u8 fieldB; +}; + +struct WishFutureKnock +{ + u8 futureSightCounter[MAX_BANKS_BATTLE]; + u8 futureSightAttacker[MAX_BANKS_BATTLE]; + s32 futureSightDmg[MAX_BANKS_BATTLE]; + u16 futureSightMove[MAX_BANKS_BATTLE]; + u8 wishCounter[MAX_BANKS_BATTLE]; + u8 wishUserBank[MAX_BANKS_BATTLE]; + u8 weatherDuration; + u8 knockedOffPokes[2]; +}; + extern struct UnkBattleStruct1 unk_2016A00; -extern struct UnkBattleStruct4 gDisableStructs[]; +extern struct DisableStruct gDisableStructs[MAX_BANKS_BATTLE]; +extern struct BattleResults gBattleResults; +extern struct ProtectStruct gProtectStructs[MAX_BANKS_BATTLE]; +extern struct SpecialStatus gSpecialStatuses[MAX_BANKS_BATTLE]; +extern struct sideTimer gSideTimer[2]; +extern struct WishFutureKnock gWishFutureKnock; extern struct AI_ThinkingStruct gAIThinkingSpace; extern struct Struct20238C8 gUnknown_020238C8; @@ -225,6 +555,8 @@ extern u8 ewram[]; #define ewram17810 ((struct Struct2017810 *) (ewram + 0x17810)) #define ewram17840 (*(struct Struct2017840 *) (ewram + 0x17840)) +extern u8 gBattleTextBuff1[]; + // asm/battle_1.o void sub_800D6D4(); void sub_800D74C(); @@ -260,7 +592,6 @@ void sub_8010800(void); void sub_8010824(void); void sub_8010874(void); void bc_8012FAC(void); -void bc_load_battlefield(void); void sub_8011384(void); void bc_801333C(void); void bc_battle_begin_message(void); @@ -297,8 +628,8 @@ u8 AbilityBattleEffects(u8, u8, u8, u8, u16); u8 sub_801A02C(); // asm/battle_4.o -void sub_801CAF8(u8, u8); -void move_effectiveness_something(u16, u8, u8); +void AI_CalcDmg(u8, u8); +void TypeCalc(u16, u8, u8); // asm/battle_5.o void nullsub_91(void); @@ -308,6 +639,7 @@ void c3_0802FDF4(u8); void sub_802E3E4(u8, int); void nullsub_8(u8); void sub_802E414(void); +void sub_802E424(void); // asm/battle_7.o void move_anim_start_t4(u8 a, u8 b, u8 c, u8 d); diff --git a/include/data/field_map_obj/anim_func_ptrs.h b/include/data/field_map_obj/anim_func_ptrs.h index 63575727d..63575727d 100755..100644 --- a/include/data/field_map_obj/anim_func_ptrs.h +++ b/include/data/field_map_obj/anim_func_ptrs.h diff --git a/include/data/field_map_obj/base_oam.h b/include/data/field_map_obj/base_oam.h index 8595f97e7..8595f97e7 100755..100644 --- a/include/data/field_map_obj/base_oam.h +++ b/include/data/field_map_obj/base_oam.h diff --git a/include/data/field_map_obj/berry_tree_graphics_tables.h b/include/data/field_map_obj/berry_tree_graphics_tables.h index 53a0fd482..53a0fd482 100755..100644 --- a/include/data/field_map_obj/berry_tree_graphics_tables.h +++ b/include/data/field_map_obj/berry_tree_graphics_tables.h diff --git a/include/data/field_map_obj/callback_subroutine_pointers.h b/include/data/field_map_obj/callback_subroutine_pointers.h index d24a47184..d24a47184 100755..100644 --- a/include/data/field_map_obj/callback_subroutine_pointers.h +++ b/include/data/field_map_obj/callback_subroutine_pointers.h diff --git a/include/data/field_map_obj/field_effect_object_template_pointers.h b/include/data/field_map_obj/field_effect_object_template_pointers.h index 8e19747ce..8e19747ce 100755..100644 --- a/include/data/field_map_obj/field_effect_object_template_pointers.h +++ b/include/data/field_map_obj/field_effect_object_template_pointers.h diff --git a/include/data/field_map_obj/field_effect_objects.h b/include/data/field_map_obj/field_effect_objects.h index dc8a38542..dc8a38542 100755..100644 --- a/include/data/field_map_obj/field_effect_objects.h +++ b/include/data/field_map_obj/field_effect_objects.h diff --git a/include/data/field_map_obj/map_object_anims.h b/include/data/field_map_obj/map_object_anims.h index 0d6e299ee..0d6e299ee 100755..100644 --- a/include/data/field_map_obj/map_object_anims.h +++ b/include/data/field_map_obj/map_object_anims.h diff --git a/include/data/field_map_obj/map_object_graphics_info.h b/include/data/field_map_obj/map_object_graphics_info.h index 818c5b90c..818c5b90c 100755..100644 --- a/include/data/field_map_obj/map_object_graphics_info.h +++ b/include/data/field_map_obj/map_object_graphics_info.h diff --git a/include/data/field_map_obj/map_object_graphics_info_pointers.h b/include/data/field_map_obj/map_object_graphics_info_pointers.h index c36827709..c36827709 100755..100644 --- a/include/data/field_map_obj/map_object_graphics_info_pointers.h +++ b/include/data/field_map_obj/map_object_graphics_info_pointers.h diff --git a/include/data/field_map_obj/map_object_pic_tables.h b/include/data/field_map_obj/map_object_pic_tables.h index 37d579512..37d579512 100755..100644 --- a/include/data/field_map_obj/map_object_pic_tables.h +++ b/include/data/field_map_obj/map_object_pic_tables.h diff --git a/include/data/field_map_obj/map_object_subsprites.h b/include/data/field_map_obj/map_object_subsprites.h index f928db88a..f928db88a 100755..100644 --- a/include/data/field_map_obj/map_object_subsprites.h +++ b/include/data/field_map_obj/map_object_subsprites.h diff --git a/include/data2.h b/include/data2.h index 2289969b8..9dd26fd5f 100644 --- a/include/data2.h +++ b/include/data2.h @@ -53,4 +53,14 @@ extern const struct SpriteTemplate gSpriteTemplate_81FAF0C; extern void *const gUnknown_081FAF4C[]; extern struct BattleMove gBattleMoves[]; +// data/graphics/trainers/front_pic_coords.inc +extern const struct MonCoords gTrainerFrontPicCoords[]; + +// data/graphics/trainers/front_pic_table.inc +extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; + +// data/graphics/trainers/front_pic_palette_table.inc +extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; + + #endif // GUARD_DATA2_H diff --git a/include/decoration.h b/include/decoration.h index 2595d491a..7a6d8ef5a 100644..100755 --- a/include/decoration.h +++ b/include/decoration.h @@ -274,7 +274,7 @@ extern const u8 *const gUnknown_083EC5E4[]; extern const u8 *const gUnknown_083EC624[]; extern u8 gUnknown_020388F7[]; extern const struct MenuAction2 gUnknown_083EC604[]; -extern const struct MenuAction3 gUnknown_083EC634[]; +extern const struct YesNoFuncTable gUnknown_083EC634[]; extern const u8 gUnknown_083EC65A[]; extern const u8 gUnknown_083EC97C[]; extern const u8 gUnknown_083EC984[]; diff --git a/include/field_camera.h b/include/field_camera.h index 9021b579e..4ce207541 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -11,6 +11,8 @@ struct CameraSomething s32 unk14; }; +extern struct Camera gUnknown_0202E844; + void move_tilemap_camera_to_upper_left_corner(void); void sub_8057A58(void); void sub_8057B14(u16 *a, u16 *b); diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h index 32438a9ad..a1dd53a2b 100755..100644 --- a/include/field_effect_helpers.h +++ b/include/field_effect_helpers.h @@ -26,5 +26,6 @@ void sub_8126BC4(u8 unk_1B, u8 r6, s16 x, s16 y); void sub_8127ED0(u8, u8); void sub_8127F28(u8, u8, s16); u8 sub_8128124(u8 id); +void ash(s16, s16, u16, u8); #endif // GUARD_FIELD_EFFECT_HELPERS_H diff --git a/include/field_map_obj.h b/include/field_map_obj.h index 6595a51ca..6595a51ca 100755..100644 --- a/include/field_map_obj.h +++ b/include/field_map_obj.h diff --git a/include/field_special_scene.h b/include/field_special_scene.h index 5841d6bce..ef3f07120 100644 --- a/include/field_special_scene.h +++ b/include/field_special_scene.h @@ -8,6 +8,6 @@ void Task_Truck2(u8 taskId); void Task_Truck3(u8 taskId); void Task_HandleTruckSequence(u8 taskId); void ExecuteTruckSequence(void); -void EndTruckSequence(void); +void EndTruckSequence(u8); #endif // GUARD_FIELD_SPECIAL_SCENE_H diff --git a/include/field_tasks.h b/include/field_tasks.h index 53e704395..761d69ada 100644 --- a/include/field_tasks.h +++ b/include/field_tasks.h @@ -1,6 +1,12 @@ #ifndef GUARD_FIELD_TASKS_H #define GUARD_FIELD_TASKS_H +struct MetatileOffset { + s8 x; + s8 y; + u16 tileId; +}; + void SetUpFieldTasks(); void ActivatePerStepCallback(u8); void ResetFieldTasksArgs(void); diff --git a/include/global.h b/include/global.h index e90fcdd0f..0f5bcde6d 100644 --- a/include/global.h +++ b/include/global.h @@ -43,6 +43,17 @@ fndec\ #define min(a, b) (a >= b ? a : b) #define max(a, b) (a <= b ? a : b) +// why does GF hate 2d arrays +#define MULTI_DIM_ARR(x, dim, y) ((x) * dim + (y)) + +// dim access enums +enum +{ + B_8 = 1, + B_16 = 2, + B_32 = 4 +}; + enum { VERSION_SAPPHIRE = 1, diff --git a/include/graphics.h b/include/graphics.h index c3fe20996..36b11fd0a 100644..100755 --- a/include/graphics.h +++ b/include/graphics.h @@ -2435,4 +2435,12 @@ extern const u8 gMonFrontPic_UnownQuestionMark[]; extern const u8 gMonBackPic_UnownQuestionMark[]; extern const u8 gMonIcon_UnownQuestionMark[]; +// src/pokeblock.c +extern const u8 gMenuPokeblock_Gfx[]; +extern const u8 gMenuPokeblock_Tilemap[]; +extern const u8 gMenuPokeblock_Pal[]; + +extern const u8 gMenuPokeblockDevice_Gfx[]; +extern const u8 gMenuPokeblockDevice_Pal[]; + #endif // GUARD_GRAPHICS_H diff --git a/include/item_use.h b/include/item_use.h index b35389ee8..61a3b4f7a 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -1,6 +1,8 @@ #ifndef GUARD_ITEM_USE_H #define GUARD_ITEM_USE_H +extern u16 gScriptItemId; + void ItemUseOnFieldCB_Bike(u8); void ItemUseOnFieldCB_Rod(u8); void ItemUseOnFieldCB_Itemfinder(u8); diff --git a/include/menu.h b/include/menu.h index 9eeebce60..9b48ab79b 100644..100755 --- a/include/menu.h +++ b/include/menu.h @@ -15,12 +15,6 @@ struct MenuAction2 void (*func)(u8); }; -struct MenuAction3 -{ - void (*func1)(u8); - void (*func2)(u8); -}; - extern const struct MenuAction gMenuYesNoItems[]; extern struct Window gMenuWindow; @@ -65,7 +59,7 @@ void sub_807274C(u8, u8, u8, u8, const struct MenuAction[], u8, u32); s8 sub_80727CC(void); u8 sub_807288C(u8); void PrintMenuItems(u8, u8, u8, const struct MenuAction[]); -void PrintMenuItemsReordered(u8, u8, u8, const struct MenuAction[], u8*); +void PrintMenuItemsReordered(u8, u8, u8, const struct MenuAction[], const u8*); void InitYesNoMenu(u8, u8, u8); void DisplayYesNoMenu(u8, u8, u32); s8 ProcessMenuInputNoWrap_(void); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index 0e39a3732..1df5053e7 100644..100755 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -24,5 +24,7 @@ void BuyMenuFreeMemory(void); void sub_80F98DC(int); void sub_80F996C(u8); void LoadScrollIndicatorPalette(void); +void sub_80F98A4(u8); +void StartVerticalScrollIndicators(u8); #endif // GUARD_MENU_HELPERS_H diff --git a/include/player_pc.h b/include/player_pc.h index f2446ebdf..8debeda88 100644 --- a/include/player_pc.h +++ b/include/player_pc.h @@ -1,10 +1,6 @@ #ifndef GUARD_PLAYER_PC_H #define GUARD_PLAYER_PC_H -// general task defines -#define TASK gTasks[taskId] -#define FUNC func - // local task defines #define PAGE_INDEX data[0] #define ITEMS_ABOVE_TOP data[1] diff --git a/include/pokeblock.h b/include/pokeblock.h index b925894db..0d8e965e4 100755 --- a/include/pokeblock.h +++ b/include/pokeblock.h @@ -1,11 +1,35 @@ #ifndef GUARD_POKEBLOCK_H #define GUARD_POKEBLOCK_H +struct YesNoCBTable { + void (*yesFunc)(void); + void (*noFunc)(void); +}; + +enum { + PBLOCK_CLR_BLACK, + PBLOCK_CLR_RED, + PBLOCK_CLR_BLUE, + PBLOCK_CLR_PINK, + PBLOCK_CLR_GREEN, + PBLOCK_CLR_YELLOW +}; + +extern u8 ewram[]; +extern u8 gUnknown_02039244; +extern u8 gUnknown_02039248[4]; +extern u8 gUnknown_0203924C; +extern const u8 *gUnknown_03000758; + void sub_810B96C(void); +u8 sub_810BA50(s16, s16, u8); +u8 sub_810C9B0(struct Pokeblock *); +s16 sub_810CA9C(const struct Pokeblock *, u8); +u8 sub_810C9E8(struct Pokeblock *); void sub_810BA7C(u8); void ClearPokeblocks(void); -void sub_810CA6C(s32); +bool8 sub_810CA6C(u8); +s16 sub_810CAE4(u8, const struct Pokeblock *); u8 sub_810CB68(u8, u8*); -s16 sub_810CAE4(u8, struct Pokeblock *); #endif // GUARD_POKEBLOCK_H diff --git a/include/rom4.h b/include/rom4.h index eac4d29a2..803a38162 100644 --- a/include/rom4.h +++ b/include/rom4.h @@ -23,6 +23,7 @@ struct UCoords32 }; extern struct UCoords32 gUnknown_0821664C[]; +extern void (*gFieldCallback)(void); // sub_8052F5C void flag_var_implications_of_teleport_(void); @@ -102,7 +103,7 @@ void sub_8053FB0(u16); // sub_8054034 // sub_8054044 // sub_8054050 -// sub_80540D0 +void sub_80540D0(s16 *, u16 *); void sub_8054164(void); u8 get_map_light_level_by_bank_and_number(s8 mapGroup, s8 mapNum); // get_map_light_level_from_warp diff --git a/include/rotating_gate.h b/include/rotating_gate.h index 6f4f38a9a..50a838953 100644 --- a/include/rotating_gate.h +++ b/include/rotating_gate.h @@ -2,7 +2,7 @@ #define GUARD_ROTATING_GATE_H void RotatingGatePuzzleCameraUpdate(s16, s16); -void sub_80C8080(); +void RotatingGate_InitPuzzleAndGraphics(); u32 CheckForRotatingGatePuzzleCollision(u8, s16, s16); #endif // GUARD_ROTATING_GATE_H diff --git a/include/secret_base.h b/include/secret_base.h index 3ca5ab182..3ea75ce27 100644 --- a/include/secret_base.h +++ b/include/secret_base.h @@ -10,6 +10,7 @@ u8 sub_80BC050(); void sub_80BC300(); const u8 sub_80BCCA4(u8); u8 *sub_80BCCE8(void); +void sub_80BCF1C(u8); void sub_80BD674(void *, u32, u8); #endif // GUARD_SECRET_BASE_H diff --git a/include/strings.h b/include/strings.h index 89a78e478..89a78e478 100644..100755 --- a/include/strings.h +++ b/include/strings.h diff --git a/include/task.h b/include/task.h index 6c6efdf4f..a71577ee3 100644 --- a/include/task.h +++ b/include/task.h @@ -1,6 +1,10 @@ #ifndef GUARD_TASK_H #define GUARD_TASK_H +// general task defines +#define TASK gTasks[taskId] +#define FUNC func + typedef void (*TaskFunc)(u8 taskId); struct Task diff --git a/include/text.h b/include/text.h index 6e32de6dd..cf413644b 100644 --- a/include/text.h +++ b/include/text.h @@ -6,6 +6,7 @@ #define CHAR_QUESTION_MARK 0xAC #define CHAR_PERIOD 0xAD #define CHAR_HYPHEN 0xAE +#define CHAR_ELLIPSIS 0xB0 #define CHAR_MALE 0xB5 #define CHAR_FEMALE 0xB6 #define CHAR_COMMA 0xB8 diff --git a/include/use_pokeblock.h b/include/use_pokeblock.h new file mode 100644 index 000000000..41cf66665 --- /dev/null +++ b/include/use_pokeblock.h @@ -0,0 +1,10 @@ +// +// Created by Scott Norton on 6/28/17. +// + +#ifndef POKERUBY_USE_POKEBLOCK_H +#define POKERUBY_USE_POKEBLOCK_H + +void sub_8136130(struct Pokeblock *, MainCallback); + +#endif //POKERUBY_USE_POKEBLOCK_H diff --git a/include/vars.h b/include/vars.h index f31ebde84..e08f344d4 100755 --- a/include/vars.h +++ b/include/vars.h @@ -1,7 +1,16 @@ #ifndef GUARD_VARS_H #define GUARD_VARS_H +#define VAR_0x4001 0x4001 +#define VAR_0x4002 0x4002 #define VAR_0x4003 0x4003 +#define VAR_0x4004 0x4004 +#define VAR_0x4005 0x4005 +#define VAR_0x4006 0x4006 +#define VAR_0x4007 0x4007 +#define VAR_0x4008 0x4008 +#define VAR_0x4009 0x4009 +#define VAR_0x400A 0x400A #define VAR_0x401F 0x401F #define VAR_RECYCLE_GOODS 0x4020 #define VAR_REPEL_STEP_COUNT 0x4021 |