summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle.h168
-rw-r--r--include/blend_palette.h6
-rw-r--r--include/event_object_movement.h6
-rw-r--r--include/field_weather.h2
-rw-r--r--include/global.h2
-rw-r--r--include/malloc.h1
-rw-r--r--include/palette.h2
-rw-r--r--include/party_menu.h4
-rw-r--r--include/rotating_gate.h2
-rw-r--r--include/string_util.h2
-rw-r--r--include/text.h1
-rw-r--r--include/util.h1
12 files changed, 83 insertions, 114 deletions
diff --git a/include/battle.h b/include/battle.h
index 3e638c6ef..87aa2a45b 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -27,8 +27,8 @@
#define B_ACTION_SAFARI_POKEBLOCK 6
#define B_ACTION_SAFARI_GO_NEAR 7
#define B_ACTION_SAFARI_RUN 8
+#define B_ACTION_WALLY_THROW 9
// The exact purposes of these are unclear
-#define B_ACTION_WALLY_THROW 9
#define B_ACTION_EXEC_SCRIPT 10 // when executing an action
#define B_ACTION_CANCEL_PARTNER 12 // when choosing an action
#define B_ACTION_FINISHED 12 // when executing an action
@@ -128,42 +128,40 @@ struct UnknownFlags
struct DisableStruct
{
- /*0x00*/ u32 transformedMonPersonality;
- /*0x04*/ u16 disabledMove;
- /*0x06*/ u16 encoredMove;
- /*0x08*/ u8 protectUses;
- /*0x09*/ u8 stockpileCounter;
- /*0x0A*/ u8 substituteHP;
- /*0x0B*/ u8 disableTimer1:4;
- /*0x0B*/ u8 disableTimer2:4;
- /*0x0C*/ u8 encoredMovePos;
- /*0x0D*/ u8 unkD;
- /*0x0E*/ u8 encoreTimer1:4;
- /*0x0E*/ u8 encoreTimer2:4;
- /*0x0F*/ u8 perishSongTimer1:4;
- /*0x0F*/ u8 perishSongTimer2:4;
- /*0x10*/ u8 furyCutterCounter;
- /*0x11*/ u8 rolloutCounter1:4;
- /*0x11*/ u8 rolloutCounter2:4;
- /*0x12*/ u8 chargeTimer1:4;
- /*0x12*/ u8 chargeTimer2:4;
- /*0x13*/ u8 tauntTimer1:4;
- /*0x13*/ u8 tauntTimer2:4;
- /*0x14*/ u8 battlerPreventingEscape;
- /*0x15*/ u8 battlerWithSureHit;
- /*0x16*/ u8 isFirstTurn;
- /*0x17*/ u8 unk17;
- /*0x18*/ u8 truantCounter:1;
- /*0x18*/ u8 truantUnknownBit:1;
- /*0x18*/ u8 unk18_a_2:2;
- /*0x18*/ u8 unk18_b:4;
- /*0x19*/ u8 rechargeCounter;
- /*0x1A*/ u8 unk1A[2];
+ u32 transformedMonPersonality;
+ u16 disabledMove;
+ u16 encoredMove;
+ u8 protectUses;
+ u8 stockpileCounter;
+ u8 substituteHP;
+ u8 disableTimer:4;
+ u8 disableTimerStartValue:4;
+ u8 encoredMovePos;
+ u8 filler_D; // Unused field.
+ u8 encoreTimer:4;
+ u8 encoreTimerStartValue:4;
+ u8 perishSongTimer:4;
+ u8 perishSongTimerStartValue:4;
+ u8 furyCutterCounter;
+ u8 rolloutTimer:4;
+ u8 rolloutTimerStartValue:4;
+ u8 chargeTimer:4;
+ u8 chargeTimerStartValue:4;
+ u8 tauntTimer:4;
+ u8 tauntTimer2:4;
+ u8 battlerPreventingEscape;
+ u8 battlerWithSureHit;
+ u8 isFirstTurn;
+ u8 unk17;
+ u8 truantCounter:1;
+ u8 truantUnknownBit:1;
+ u8 unk18_a_2:2;
+ u8 unk18_b:4;
+ u8 rechargeTimer;
};
struct ProtectStruct
{
- /* field_0 */
u32 protected:1;
u32 endured:1;
u32 noValidMoves:1;
@@ -172,67 +170,54 @@ struct ProtectStruct
u32 stealMove:1;
u32 flag0Unknown:1;
u32 prlzImmobility:1;
- /* field_1 */
u32 confusionSelfDmg:1;
u32 targetNotAffected:1;
u32 chargingTurn:1;
- u32 fleeFlag:2; // for RunAway and Smoke Ball
+ u32 fleeFlag:2; // For RunAway and Smoke Ball.
u32 usedImprisionedMove:1;
u32 loveImmobility:1;
u32 usedDisabledMove:1;
- /* field_2 */
- u32 usedTauntedMove:1; // 0x1
- u32 flag2Unknown:1; // 0x2
- u32 flinchImmobility:1; // 0x4
- u32 notFirstStrike:1; // 0x8
- u32 flag_x10:1; // 0x10
- u32 flag_x20:1; // 0x20
- u32 flag_x40:1; // 0x40
- u32 flag_x80:1; // 0x80
- /* field_3 */
- u32 field3:8;
-
- /* field_4 */ u32 physicalDmg;
- /* field_8 */ u32 specialDmg;
- /* field_C */ u8 physicalBattlerId;
- /* field_D */ u8 specialBattlerId;
- /* field_E */ u16 fieldE;
+ u32 usedTauntedMove:1;
+ u32 flag2Unknown:1;
+ u32 flinchImmobility:1;
+ u32 notFirstStrike:1;
+ u32 flag_x10:1;
+ u32 physicalDmg;
+ u32 specialDmg;
+ u8 physicalBattlerId;
+ u8 specialBattlerId;
};
struct SpecialStatus
{
- u8 statLowered:1; // 0x1
- u8 lightningRodRedirected:1; // 0x2
- u8 restoredBattlerSprite: 1; // 0x4
- u8 intimidatedMon:1; // 0x8
- u8 traced:1; // 0x10
- u8 flag20:1;
+ u8 statLowered:1;
+ u8 lightningRodRedirected:1;
+ u8 restoredBattlerSprite: 1;
+ u8 intimidatedMon:1;
+ u8 traced:1;
+ u8 ppNotAffectedByPressure:1;
u8 flag40:1;
u8 focusBanded:1;
- u8 field1[3];
s32 dmg;
s32 physicalDmg;
s32 specialDmg;
u8 physicalBattlerId;
u8 specialBattlerId;
- u8 field12;
- u8 field13;
};
struct SideTimer
{
- /*0x00*/ u8 reflectTimer;
- /*0x01*/ u8 reflectBattlerId;
- /*0x02*/ u8 lightscreenTimer;
- /*0x03*/ u8 lightscreenBattlerId;
- /*0x04*/ u8 mistTimer;
- /*0x05*/ u8 mistBattlerId;
- /*0x06*/ u8 safeguardTimer;
- /*0x07*/ u8 safeguardBattlerId;
- /*0x08*/ u8 followmeTimer;
- /*0x09*/ u8 followmeTarget;
- /*0x0A*/ u8 spikesAmount;
- /*0x0B*/ u8 fieldB;
+ u8 reflectTimer;
+ u8 reflectBattlerId;
+ u8 lightscreenTimer;
+ u8 lightscreenBattlerId;
+ u8 mistTimer;
+ u8 mistBattlerId;
+ u8 safeguardTimer;
+ u8 safeguardBattlerId;
+ u8 followmeTimer;
+ u8 followmeTarget;
+ u8 spikesAmount;
};
struct WishFutureKnock
@@ -244,7 +229,7 @@ struct WishFutureKnock
u8 wishCounter[MAX_BATTLERS_COUNT];
u8 wishMonId[MAX_BATTLERS_COUNT];
u8 weatherDuration;
- u8 knockedOffPokes[2];
+ u8 knockedOffMons[2]; // Each battler is represented by a bit. The array entry is dependent on the battler's side.
};
struct AI_ThinkingStruct
@@ -317,7 +302,7 @@ struct BattleResults
u8 playerSwitchesCounter; // 0x2
u8 unk3; // 0x3
u8 unk4; // 0x4
- u8 unk5_0:1; // 0x5
+ u8 playerMonWasDamaged:1; // 0x5
u8 usedMasterBall:1; // 0x5
u8 caughtMonBall:4; // 0x5
u8 shinyWildMon:1; // 0x5
@@ -428,22 +413,14 @@ struct BattleStruct
u8 turnEffectsBattlerId;
u8 filler2;
u8 turnCountersTracker;
- u8 wrappedMove[8]; // ask gamefreak why they declared it that way
- u8 moveTarget[4];
+ u8 wrappedMove[MAX_BATTLERS_COUNT * 2]; // Leftover from Ruby's ewram access.
+ u8 moveTarget[MAX_BATTLERS_COUNT];
u8 expGetterMonId;
u8 field_11;
u8 wildVictorySong;
u8 dynamicMoveType;
- u8 wrappedBy[4];
- u16 assistPossibleMoves[5 * 4]; // 5 mons, each of them knowing 4 moves
- u8 field_40;
- u8 field_41;
- u8 field_42;
- u8 field_43;
- u8 field_44;
- u8 field_45;
- u8 field_46;
- u8 field_47;
+ u8 wrappedBy[MAX_BATTLERS_COUNT];
+ u16 assistPossibleMoves[PARTY_SIZE * 4]; // Each of mons can know max 4 moves.
u8 focusPunchBattlerId;
u8 battlerPreventingSwitchout;
u8 moneyMultiplier;
@@ -451,7 +428,6 @@ struct BattleStruct
u8 switchInAbilitiesCounter;
u8 faintedActionsState;
u8 faintedActionsBattlerId;
- u8 field_4F;
u16 expValue;
u8 field_52;
u8 sentInPokes;
@@ -460,7 +436,7 @@ struct BattleStruct
u8 monToSwitchIntoId[MAX_BATTLERS_COUNT];
u8 field_60[4][3];
u8 runTries;
- u8 caughtMonNick[11];
+ u8 caughtMonNick[POKEMON_NAME_LENGTH + 1];
u8 field_78;
u8 safariGoNearCounter;
u8 safariPkblThrowCounter;
@@ -487,15 +463,7 @@ struct BattleStruct
u8 wallyMovesState;
u8 wallyWaitFrames;
u8 wallyMoveFrames;
- u8 mirrorMoves[8]; // ask gamefreak why they declared it that way
- u8 field_A0;
- u8 field_A1;
- u8 field_A2;
- u8 field_A3;
- u8 field_A4;
- u8 field_A5;
- u8 field_A6;
- u8 field_A7;
+ u8 lastTakenMove[MAX_BATTLERS_COUNT * 2 * 2]; // Last move that a battler was hit with. This field seems to erroneously take 16 bytes instead of 8.
u16 hpOnSwitchout[2];
u32 savedBattleTypeFlags;
u8 abilityPreventingSwitchout;
@@ -504,7 +472,7 @@ struct BattleStruct
bool8 anyMonHasTransformed;
void (*savedCallback)(void);
u16 usedHeldItems[MAX_BATTLERS_COUNT];
- u8 chosenItem[4]; // why is this an u8?
+ u8 chosenItem[MAX_BATTLERS_COUNT]; // why is this an u8?
u8 AI_itemType[2];
u8 AI_itemFlags[2];
u16 choicedMove[MAX_BATTLERS_COUNT];
@@ -515,7 +483,7 @@ struct BattleStruct
u8 turnSideTracker;
u8 fillerDC[0xDF-0xDC];
u8 field_DF;
- u8 mirrorMoveArrays[32];
+ u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte]
u16 castformPalette[MAX_BATTLERS_COUNT][16];
u8 field_180;
u8 field_181;
diff --git a/include/blend_palette.h b/include/blend_palette.h
deleted file mode 100644
index a00847bc3..000000000
--- a/include/blend_palette.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef GUARD_BLEND_PALETTE_H
-#define GUARD_BLEND_PALETTE_H
-
-void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor);
-
-#endif // GUARD_BLEND_PALETTE_H
diff --git a/include/event_object_movement.h b/include/event_object_movement.h
index d43dd78ea..80b9f3fc0 100644
--- a/include/event_object_movement.h
+++ b/include/event_object_movement.h
@@ -80,6 +80,7 @@ struct LockedAnimEventObjects
};
extern const struct SpriteFrameImage gEventObjectPicTable_PechaBerryTree[];
+extern const u8 gReflectionEffectPaletteMap[];
void sub_808D438(void);
u8 GetMoveDirectionAnimNum(u8);
@@ -189,6 +190,10 @@ u8 GetMoveDirectionFasterAnimNum(u8);
u8 GetMoveDirectionFastestAnimNum(u8);
u8 GetLedgeJumpDirection(s16, s16, u8);
void CameraObjectSetFollowedObjectId(u8 objectId);
+u16 GetObjectPaletteTag(u8 palSlot);
+void UpdateEventObjectSpriteVisibility(struct Sprite *sprite, bool8 invisible);
+s16 sub_809773C(s16 a1);
+s16 sub_8097728(s16 a1);
void MovementType_None(struct Sprite *);
void MovementType_LookAround(struct Sprite *);
@@ -249,6 +254,7 @@ u8 GetSlideMovementAction(u32);
u8 GetJumpInPlaceMovementAction(u32);
u8 GetJumpMovementAction(u32);
u8 GetJump2MovementAction(u32);
+u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority);
u8 MovementType_WanderAround_Step0(struct EventObject *, struct Sprite *);
u8 MovementType_WanderAround_Step1(struct EventObject *, struct Sprite *);
diff --git a/include/field_weather.h b/include/field_weather.h
index 7ad8d21e7..a48361b8a 100644
--- a/include/field_weather.h
+++ b/include/field_weather.h
@@ -155,7 +155,7 @@ void sub_80AEDBC(void);
void SetSav1WeatherFromCurrMapHeader(void);
// ...
void DoCurrentWeather(void);
-void sub_8080750();
+void sub_8080750(void);
bool8 IsWeatherNotFadingIn(void);
bool8 IsWeatherChangeComplete(void);
diff --git a/include/global.h b/include/global.h
index 2c5ce3777..027065481 100644
--- a/include/global.h
+++ b/include/global.h
@@ -61,8 +61,6 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
-#define HEAP_SIZE 0x1C000
-
extern u8 gStringVar1[];
extern u8 gStringVar2[];
extern u8 gStringVar3[];
diff --git a/include/malloc.h b/include/malloc.h
index 6efa8fbef..c215f56c0 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -13,6 +13,7 @@
}
extern u8 gHeap[];
+
void *Alloc(u32 size);
void *AllocZeroed(u32 size);
void Free(void *pointer);
diff --git a/include/palette.h b/include/palette.h
index d14fa1fcd..c14e9f453 100644
--- a/include/palette.h
+++ b/include/palette.h
@@ -55,7 +55,7 @@ bool8 unref_sub_8073D3C(u32, u8, u8, u8, u16);
void unref_sub_8073D84(u8, u32 *);
void ResetPaletteStructByUid(u16);
void ResetPaletteStruct(u8);
-void ResetPaletteFadeControl();
+void ResetPaletteFadeControl(void);
void unref_sub_8074168(u16);
void unref_sub_8074194(u16);
void InvertPlttBuffer(u32);
diff --git a/include/party_menu.h b/include/party_menu.h
index b93b78544..170fcafc1 100644
--- a/include/party_menu.h
+++ b/include/party_menu.h
@@ -50,8 +50,8 @@ void sub_81B1370(u8 taskId);
void display_pokemon_menu_message(u8 windowId);
void sub_81B1F18(u8 taskId, u8 pokemonIdx, s8 a, s16 hp, TaskFunc func);
void sub_81B1B5C(void *a, u8 b);
-u8 sub_81B1BD4();
-void sub_81B8448();
+u8 sub_81B1BD4(void);
+void sub_81B8448(void);
void sub_81B8518(u8 unused);
u8 sub_81B1360(void);
void sub_81B8904(u8 arg0, void (*callback)(void));
diff --git a/include/rotating_gate.h b/include/rotating_gate.h
index 2ae26aa5b..fd86a6b04 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 RotatingGate_InitPuzzleAndGraphics();
+void RotatingGate_InitPuzzleAndGraphics(void);
u32 CheckForRotatingGatePuzzleCollision(u8, s16, s16);
bool32 CheckForRotatingGatePuzzleCollisionWithoutAnimation(u8, s16, s16);
diff --git a/include/string_util.h b/include/string_util.h
index f26646082..7b685fcea 100644
--- a/include/string_util.h
+++ b/include/string_util.h
@@ -24,7 +24,7 @@ u8 *ConvertUIntToDecimalStringN(u8 *dest, u32 value, enum StringConvertMode mode
u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n);
u8 *StringExpandPlaceholders(u8 *dest, const u8 *src);
u8 *StringBraille(u8 *dest, const u8 *src);
-u8 *GetExpandedPlaceholder(u32 id);
+const u8 *GetExpandedPlaceholder(u32 id);
u8 *StringFill(u8 *dest, u8 c, u16 n);
u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n);
u8 *StringFillWithTerminator(u8 *dest, u16 n);
diff --git a/include/text.h b/include/text.h
index e2120efa3..f677f2ced 100644
--- a/include/text.h
+++ b/include/text.h
@@ -76,6 +76,7 @@
#define CHAR_y 0xED
#define CHAR_z 0xEE
#define CHAR_SPECIAL_F7 0xF7
+#define CHAR_SPECIAL_F8 0xF8
#define CHAR_SPECIAL_F9 0xF9
#define CHAR_COLON 0xF0
#define CHAR_PROMPT_SCROLL 0xFA // waits for button press and scrolls dialog
diff --git a/include/util.h b/include/util.h
index 63887b13f..997c8f713 100644
--- a/include/util.h
+++ b/include/util.h
@@ -13,5 +13,6 @@ int CountTrailingZeroBits(u32 value);
u16 CalcCRC16(u8 *data, s32 length);
u16 CalcCRC16WithTable(u8 *data, u32 length);
u32 CalcByteArraySum(const u8* data, u32 length);
+void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor);
#endif // GUARD_UTIL_H