battle 7 is decompiled
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "battle_script_commands.h"
|
||||
#include "battle_2.h"
|
||||
#include "battle_ai_switch_items.h"
|
||||
#include "battle_gfx_sfx_util.h"
|
||||
|
||||
/*
|
||||
Banks are a name given to what could be called a 'battlerId' or 'monControllerId'.
|
||||
@@ -670,7 +671,7 @@ struct BattleStruct
|
||||
u8 fillerDC[0xDF-0xDC];
|
||||
u8 field_DF;
|
||||
u8 mirrorMoveArrays[32];
|
||||
u16 castformPalette[4][16];
|
||||
u16 castformPalette[BATTLE_BANKS_COUNT][16];
|
||||
u8 field_180;
|
||||
u8 field_181;
|
||||
u8 field_182;
|
||||
@@ -807,6 +808,18 @@ extern struct BattleStruct* gBattleStruct;
|
||||
#define B_ANIM_SUBSTITUTE_TO_MON 0x5
|
||||
#define B_ANIM_MON_TO_SUBSTITUTE 0x6
|
||||
|
||||
// status animation table
|
||||
#define B_ANIM_STATUS_PSN 0x0
|
||||
#define B_ANIM_STATUS_CONFUSION 0x1
|
||||
#define B_ANIM_STATUS_BRN 0x2
|
||||
#define B_ANIM_STATUS_INFATUATION 0x3
|
||||
#define B_ANIM_STATUS_SLP 0x4
|
||||
#define B_ANIM_STATUS_PRZ 0x5
|
||||
#define B_ANIM_STATUS_FRZ 0x6
|
||||
#define B_ANIM_STATUS_CURSED 0x7
|
||||
#define B_ANIM_STATUS_NIGHTMARE 0x8
|
||||
#define B_ANIM_STATUS_WRAPPED 0x9
|
||||
|
||||
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
|
||||
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
|
||||
#define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit
|
||||
@@ -864,43 +877,6 @@ void AdjustFriendshipOnBattleFaint(u8 bank);
|
||||
void sub_80571DC(u8 bank, u8 arg1);
|
||||
u32 sub_805725C(u8 bank);
|
||||
|
||||
// battle 7
|
||||
void AllocateBattleSpritesData(void);
|
||||
void FreeBattleSpritesData(void);
|
||||
void AllocateMonSpritesGfx(void);
|
||||
void FreeMonSpritesGfx(void);
|
||||
void BattleMusicStop(void);
|
||||
void sub_805E990(struct Pokemon *mon, u8 bank);
|
||||
void sub_805EF14(void);
|
||||
bool8 BattleInitAllSprites(u8 *state1, u8 *state2);
|
||||
void sub_805E350(void);
|
||||
bool8 BattleLoadAllHealthBoxesGfx(u8 state);
|
||||
void LoadAndCreateEnemyShadowSprites(void);
|
||||
void SetBankEnemyShadowSpriteCallback(u8 bank, u16 species);
|
||||
void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank);
|
||||
void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank);
|
||||
void BattleLoadSubstituteSpriteGfx(u8 bank, bool8 arg1);
|
||||
void nullsub_24(u16 arg0);
|
||||
void nullsub_25(u8 arg0);
|
||||
void ClearTemporarySpeciesSpriteData(u8 bank, bool8 dontClearSubstitute);
|
||||
void sub_805D714(struct Sprite *sprite);
|
||||
void DecompressTrainerBackPic(u16 backPicId, u8 bank);
|
||||
void DecompressTrainerFrontPic(u16 frontPicId, u8 bank);
|
||||
void FreeTrainerFrontPicPalette(u16 frontPicId);
|
||||
void sub_805D7AC(struct Sprite *sprite);
|
||||
bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn);
|
||||
void sub_805EB9C(u8 arg0);
|
||||
void sub_805E394(void);
|
||||
void TrySetBehindSubstituteSpriteBit(u8 bank, u16 move);
|
||||
void DoStatusAnimation(bool8 isStatus2, u32 status);
|
||||
void DoSpecialBattleAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId);
|
||||
bool8 DoBattleAnimationFromTable(u8 active, u8 atkBank, u8 defBank, u8 tableId, u16 argument);
|
||||
void CopyBattleSpriteInvisibility(u8 bank);
|
||||
u16 ChooseMoveAndTargetInBattlePalace(void);
|
||||
void LoadBattleBarGfx(u8 arg0);
|
||||
bool8 mplay_80342A4(u8 bank);
|
||||
void sub_805EEE0(u8 bank);
|
||||
|
||||
enum
|
||||
{
|
||||
BACK_PIC_BRENDAN,
|
||||
@@ -921,7 +897,7 @@ u8 GetBankByIdentity(u8 bank);
|
||||
struct BattleSpriteInfo
|
||||
{
|
||||
u16 invisible : 1; // 0x1
|
||||
u16 flag_x2 : 1; // 0x2
|
||||
u16 lowHpSong : 1; // 0x2
|
||||
u16 behindSubstitute : 1; // 0x4
|
||||
u16 flag_x8 : 1; // 0x8
|
||||
u16 hpNumbersNoBars : 1; // 0x10
|
||||
@@ -930,7 +906,7 @@ struct BattleSpriteInfo
|
||||
|
||||
struct BattleAnimationInfo
|
||||
{
|
||||
u16 field; // to fill up later
|
||||
u16 animArg; // to fill up later
|
||||
u8 field_2;
|
||||
u8 field_3;
|
||||
u8 field_4;
|
||||
@@ -972,7 +948,7 @@ struct BattleHealthboxInfo
|
||||
u8 animationState;
|
||||
u8 field_5;
|
||||
u8 field_6;
|
||||
u8 field_7;
|
||||
u8 shadowSpriteId;
|
||||
u8 field_8;
|
||||
u8 field_9;
|
||||
u8 field_A;
|
||||
@@ -1012,8 +988,11 @@ struct MonSpritesGfx
|
||||
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
|
||||
void* sprites[4];
|
||||
struct SpriteTemplate templates[4];
|
||||
u8 field_74[0x100];
|
||||
u8 *fontPixels;
|
||||
struct SpriteFrameImage field_74[4][4];
|
||||
u8 field_F4[0x80];
|
||||
u8 *barFontGfx;
|
||||
void *field_178;
|
||||
void *field_17C;
|
||||
};
|
||||
|
||||
extern struct BattleSpritesGfx* gMonSpritesGfx;
|
||||
|
||||
@@ -92,7 +92,11 @@ u8 sub_80A6D94(void);
|
||||
u8 sub_80A8364(u8);
|
||||
void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*));
|
||||
void oamt_add_pos2_onto_pos1(struct Sprite *sprite);
|
||||
u8 sub_80A6138(u8 bank);
|
||||
u8 GetBankSpriteDefault_Y(u8 bank);
|
||||
u8 sub_80A82E4(u8 bank);
|
||||
u8 GetSubstituteSpriteDefault_Y(u8 bank);
|
||||
|
||||
// battle_anim_80A9C70.s
|
||||
void LaunchStatusAnimation(u8 bank, u8 statusAnimId);
|
||||
|
||||
#endif // GUARD_BATTLE_ANIM_H
|
||||
|
||||
49
include/battle_gfx_sfx_util.h
Normal file
49
include/battle_gfx_sfx_util.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef GUARD_BATTLE_GFX_SFX_UTIL
|
||||
#define GUARD_BATTLE_GFX_SFX_UTIL
|
||||
|
||||
void AllocateBattleSpritesData(void);
|
||||
void FreeBattleSpritesData(void);
|
||||
void sub_805D714(struct Sprite *sprite);
|
||||
void sub_805D770(struct Sprite *sprite, bool8 arg1);
|
||||
void sub_805D7AC(struct Sprite *sprite);
|
||||
void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status);
|
||||
bool8 TryHandleLaunchBattleTableAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId, u16 argument);
|
||||
void InitAndLaunchSpecialAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId);
|
||||
bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn);
|
||||
bool8 mplay_80342A4(u8 bank);
|
||||
void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank);
|
||||
void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank);
|
||||
void nullsub_23(void);
|
||||
void nullsub_24(u16 species);
|
||||
void DecompressTrainerFrontPic(u16 frontPicId, u8 bank);
|
||||
void DecompressTrainerBackPic(u16 backPicId, u8 bank);
|
||||
void nullsub_25(u8 arg0);
|
||||
void FreeTrainerFrontPicPalette(u16 frontPicId);
|
||||
void sub_805DFFC(void);
|
||||
bool8 BattleLoadAllHealthBoxesGfx(u8 state);
|
||||
void LoadBattleBarGfx(u8 arg0);
|
||||
bool8 BattleInitAllSprites(u8 *state1, u8 *bank);
|
||||
void ClearSpritesHealthboxAnimData(void);
|
||||
void CopyAllBattleSpritesInvisibilities(void);
|
||||
void CopyBattleSpriteInvisibility(u8 bank);
|
||||
void HandleSpeciesGfxDataChange(u8 bankAtk, u8 bankDef, bool8 notTransform);
|
||||
void BattleLoadSubstituteOrMonSpriteGfx(u8 bank, bool8 loadMonSprite);
|
||||
void LoadBattleMonGfxAndAnimate(u8 bank, bool8 loadMonSprite, u8 spriteId);
|
||||
void TrySetBehindSubstituteSpriteBit(u8 bank, u16 move);
|
||||
void ClearBehindSubstituteBit(u8 bank);
|
||||
void HandleLowHpMusicChange(struct Pokemon *mon, u8 bank);
|
||||
void BattleStopLowHpSound(void);
|
||||
u8 GetMonHPBarLevel(struct Pokemon *mon);
|
||||
void sub_805EAE8(void);
|
||||
void sub_805EB9C(u8 affineMode);
|
||||
void LoadAndCreateEnemyShadowSprites(void);
|
||||
void SpriteCB_SetInvisible(struct Sprite *sprite);
|
||||
void SetBankEnemyShadowSpriteCallback(u8 bank, u16 species);
|
||||
void EnemyShadowCallbackToSetInvisible(u8 bank);
|
||||
void sub_805EF14(void);
|
||||
void ClearTemporarySpeciesSpriteData(u8 bank, bool8 dontClearSubstitute);
|
||||
void AllocateMonSpritesGfx(void);
|
||||
void FreeMonSpritesGfx(void);
|
||||
bool32 ShouldPlayNormalPokeCry(struct Pokemon *mon);
|
||||
|
||||
#endif // GUARD_BATTLE_GFX_SFX_UTIL
|
||||
@@ -15,6 +15,15 @@ enum
|
||||
EXP_BAR
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HP_BAR_EMPTY,
|
||||
HP_BAR_RED,
|
||||
HP_BAR_YELLOW,
|
||||
HP_BAR_GREEN,
|
||||
HP_BAR_FULL,
|
||||
};
|
||||
|
||||
#define TAG_HEALTHBOX_PLAYER1_TILE 0xD6FF
|
||||
#define TAG_HEALTHBOX_PLAYER2_TILE 0xD700
|
||||
#define TAG_HEALTHBOX_OPPONENT1_TILE 0xD701
|
||||
|
||||
@@ -20,6 +20,12 @@ struct ContestStruct_field_18
|
||||
{
|
||||
// unknown size
|
||||
u16 field_0;
|
||||
u16 field_2;
|
||||
u16 field_4;
|
||||
u16 field_6;
|
||||
u32 field_8;
|
||||
u32 field_C;
|
||||
u32 field_10;
|
||||
};
|
||||
|
||||
struct ContestResources
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "sprite.h"
|
||||
|
||||
extern u8 gDecompressionBuffer[0x4000];
|
||||
|
||||
void LZDecompressWram(const void *src, void *dest);
|
||||
void LZDecompressVram(const void *src, void *dest);
|
||||
|
||||
|
||||
@@ -612,8 +612,8 @@ u32 CanMonLearnTMHM(struct Pokemon *, u8);
|
||||
u32 CanSpeciesLearnTMHM(u16 species, u8 tm);
|
||||
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
|
||||
void ClearBattleMonForms(void);
|
||||
const u8 *pokemon_get_pal(struct Pokemon *mon);
|
||||
const u8 *species_and_otid_get_pal(u16, u32, u32);
|
||||
const u8 *GetMonFrontSpritePal(struct Pokemon *mon);
|
||||
const u8 *GetFrontSpritePalFromSpeciesAndPersonality(u16, u32, u32);
|
||||
const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32);
|
||||
bool8 IsOtherTrainer(u32, u8 *);
|
||||
void SetWildMonHeldItem(void);
|
||||
|
||||
Reference in New Issue
Block a user