Decompile all of battle_anim_utility_funcs

This commit is contained in:
Marcus Huderle 2018-11-19 09:28:55 -06:00
parent 963989d760
commit 72f0a079a9
35 changed files with 1137 additions and 3206 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2921,7 +2921,7 @@ SkyAttackEnd:
SkyAttackSetUp: SkyAttackSetUp:
monbg ANIM_DEF_PARTNER monbg ANIM_DEF_PARTNER
setalpha 12, 11 setalpha 12, 11
createvisualtask AnimTask_IsTargetPartner, 5, ARG_RET_ID createvisualtask AnimTask_GetTargetIsAttackerPartner, 5, ARG_RET_ID
jumpretfalse SkyAttackSetUpAgainstOpponent jumpretfalse SkyAttackSetUpAgainstOpponent
goto SkyAttackSetUpAgainstPartner goto SkyAttackSetUpAgainstPartner
SkyAttackSetUpAgainstOpponent: SkyAttackSetUpAgainstOpponent:
@ -3125,7 +3125,7 @@ Move_MACH_PUNCH:
loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_IMPACT
loadspritegfx ANIM_TAG_HANDS_AND_FEET loadspritegfx ANIM_TAG_HANDS_AND_FEET
monbg ANIM_ATK_PARTNER monbg ANIM_ATK_PARTNER
createvisualtask AnimTask_IsAttackerOpponentSide, 2 createvisualtask AnimTask_GetAttackerSide, 2
jumprettrue MachPunchAgainstPlayer jumprettrue MachPunchAgainstPlayer
fadetobg BG_HIGHSPEED_OPPONENT fadetobg BG_HIGHSPEED_OPPONENT
MachPunchContinue: MachPunchContinue:
@ -3385,7 +3385,7 @@ Move_MOONLIGHT:
Move_EXTREME_SPEED: Move_EXTREME_SPEED:
loadspritegfx ANIM_TAG_SPEED_DUST loadspritegfx ANIM_TAG_SPEED_DUST
loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_IMPACT
createvisualtask AnimTask_IsAttackerOpponentSide, 2 createvisualtask AnimTask_GetAttackerSide, 2
jumprettrue ExtremeSpeedAgainstPlayer jumprettrue ExtremeSpeedAgainstPlayer
fadetobg BG_HIGHSPEED_OPPONENT fadetobg BG_HIGHSPEED_OPPONENT
ExtremeSpeedContinue: ExtremeSpeedContinue:
@ -3871,13 +3871,13 @@ Move_CAMOUFLAGE:
monbg ANIM_ATK_PARTNER monbg ANIM_ATK_PARTNER
monbgprio_28 ANIM_ATTACKER monbgprio_28 ANIM_ATTACKER
setalpha 16, 0 setalpha 16, 0
createvisualtask sub_811675C, 5, 2, 3, 0, 14 createvisualtask AnimTask_SetCamouflageBlend, 5, 2, 3, 0, 14
delay 16 delay 16
createvisualtask sub_81136E8, 2, 4 createvisualtask sub_81136E8, 2, 4
playsewithpan SE_W185, SOUND_PAN_ATTACKER playsewithpan SE_W185, SOUND_PAN_ATTACKER
waitforvisualfinish waitforvisualfinish
delay 8 delay 8
createvisualtask sub_811675C, 5, 2, 0, 0, 0 createvisualtask AnimTask_SetCamouflageBlend, 5, 2, 0, 0, 0
waitforvisualfinish waitforvisualfinish
createvisualtask sub_81137E4, 2, 1 createvisualtask sub_81137E4, 2, 1
waitforvisualfinish waitforvisualfinish
@ -5518,7 +5518,7 @@ SolarBeamUnleash1:
Move_BLIZZARD: Move_BLIZZARD:
loadspritegfx ANIM_TAG_ICE_CRYSTALS loadspritegfx ANIM_TAG_ICE_CRYSTALS
monbg ANIM_DEF_PARTNER monbg ANIM_DEF_PARTNER
createvisualtask AnimTask_IsAttackerOpponentSide, 2 createvisualtask AnimTask_GetAttackerSide, 2
jumprettrue BlizzardAgainstPlayer jumprettrue BlizzardAgainstPlayer
fadetobg BG_HIGHSPEED_OPPONENT fadetobg BG_HIGHSPEED_OPPONENT
BlizzardContinue: BlizzardContinue:
@ -9158,7 +9158,7 @@ Move_SILVER_WIND:
monbgprio_29 monbgprio_29
delay 0 delay 0
createvisualtask sub_8116664, 10, 1, 0, 0, 4, RGB_BLACK createvisualtask sub_8116664, 10, 1, 0, 0, 4, RGB_BLACK
createvisualtask AnimTask_IsTargetOpponentSide, 2 createvisualtask AnimTask_GetTargetSide, 2
jumprettrue SilverWindOnPlayer jumprettrue SilverWindOnPlayer
fadetobg BG_BUG_OPPONENT fadetobg BG_BUG_OPPONENT
waitbgfadeout waitbgfadeout

View File

@ -660,7 +660,7 @@ struct MonSpritesGfx
u8 field_F4[0x80]; u8 field_F4[0x80];
u8 *barFontGfx; u8 *barFontGfx;
void *field_178; void *field_178;
void *field_17C; u16 *field_17C;
}; };
// All battle variables are declared in battle_main.c // All battle variables are declared in battle_main.c
@ -769,4 +769,17 @@ extern u8 gMultiUsePlayerCursor;
extern u8 gNumberOfMovesToChoose; extern u8 gNumberOfMovesToChoose;
extern u8 gUnknown_03005D7C[MAX_BATTLERS_COUNT]; extern u8 gUnknown_03005D7C[MAX_BATTLERS_COUNT];
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern u16 gBattle_WIN1H;
extern u16 gBattle_WIN1V;
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
#endif // GUARD_BATTLE_H #endif // GUARD_BATTLE_H

View File

@ -9,7 +9,7 @@ enum
BG_ANIM_SCREEN_SIZE, BG_ANIM_SCREEN_SIZE,
BG_ANIM_AREA_OVERFLOW_MODE, BG_ANIM_AREA_OVERFLOW_MODE,
BG_ANIM2, BG_ANIM2,
BG_ANIM3, BG_ANIM_CHAR_BASE_BLOCK,
BG_ANIM_PRIORITY, BG_ANIM_PRIORITY,
BG_ANIM_5, BG_ANIM_5,
BG_ANIM_6 BG_ANIM_6
@ -64,6 +64,7 @@ s8 BattleAnimAdjustPanning2(s8 pan);
s16 KeepPanInRange(s16 a); s16 KeepPanInRange(s16 a);
s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan); s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
void sub_80A4720(u16 a, u16 *b, u32 c, u8 d); void sub_80A4720(u16 a, u16 *b, u32 c, u8 d);
void sub_80A477C(bool8);
// battle_anim_80FE840.s // battle_anim_80FE840.s
void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value); void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value);
@ -87,6 +88,15 @@ void obj_id_set_rotscale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation);
void sub_80A6E14(struct Sprite *sprite); void sub_80A6E14(struct Sprite *sprite);
void sub_80A7270(u8 spriteId, u8 objMode); void sub_80A7270(u8 spriteId, u8 objMode);
void sub_80A73A0(u8 spriteId); void sub_80A73A0(u8 spriteId);
u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7);
u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4);
u8 sub_80A77AC(u8 a1);
s16 duplicate_obj_of_side_rel2move_in_transparent_mode(u8);
void obj_delete_but_dont_free_vram(struct Sprite*);
u8 sub_80A89C8(int, u8, int);
void sub_80A6D60(struct UnknownAnimStruct2*, const void*, u32);
void sub_80A6CC0(u32, const void*, u32);
void sub_80A6DAC(bool8);
enum enum
{ {
@ -127,6 +137,11 @@ u8 ItemIdToBallId(u16 itemId);
u8 LaunchBallStarsTask(u8 x, u8 y, u8 kindOfStars, u8 arg3, u8 ballId); u8 LaunchBallStarsTask(u8 x, u8 y, u8 kindOfStars, u8 arg3, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 arg2, u8 ballId); u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 arg2, u8 ballId);
// battle_anim_utility_funcs.s
void sub_8116EB4(u8);
u32 sub_811583C(s16);
u8 GetBattlerSpriteFinal_Y(u8, u16, u8); u8 GetBattlerSpriteFinal_Y(u8, u16, u8);
extern const struct OamData gUnknown_08524944; extern const struct OamData gUnknown_08524944;

View File

@ -239,7 +239,7 @@ struct Shared18000
struct ContestStruct_field_18 struct ContestStruct_field_18
{ {
u16 unk0; u16 species;
u16 unk2; u16 unk2;
u8 unk4_0:1; u8 unk4_0:1;
u8 unk5; u8 unk5;

View File

@ -565,12 +565,14 @@
#define WINOUT_WIN01_BG1 (1 << 1) #define WINOUT_WIN01_BG1 (1 << 1)
#define WINOUT_WIN01_BG2 (1 << 2) #define WINOUT_WIN01_BG2 (1 << 2)
#define WINOUT_WIN01_BG3 (1 << 3) #define WINOUT_WIN01_BG3 (1 << 3)
#define WINOUT_WIN01_BG_ALL (WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3)
#define WINOUT_WIN01_OBJ (1 << 4) #define WINOUT_WIN01_OBJ (1 << 4)
#define WINOUT_WIN01_CLR (1 << 5) #define WINOUT_WIN01_CLR (1 << 5)
#define WINOUT_WINOBJ_BG0 (1 << 8) #define WINOUT_WINOBJ_BG0 (1 << 8)
#define WINOUT_WINOBJ_BG1 (1 << 9) #define WINOUT_WINOBJ_BG1 (1 << 9)
#define WINOUT_WINOBJ_BG2 (1 << 10) #define WINOUT_WINOBJ_BG2 (1 << 10)
#define WINOUT_WINOBJ_BG3 (1 << 11) #define WINOUT_WINOBJ_BG3 (1 << 11)
#define WINOUT_WINOBJ_BG_ALL (WINOUT_WINOBJ_BG0 | WINOUT_WINOBJ_BG1 | WINOUT_WINOBJ_BG2 | WINOUT_WINOBJ_BG3)
#define WINOUT_WINOBJ_OBJ (1 << 12) #define WINOUT_WINOBJ_OBJ (1 << 12)
#define WINOUT_WINOBJ_CLR (1 << 13) #define WINOUT_WINOBJ_CLR (1 << 13)

View File

@ -4697,6 +4697,20 @@ extern const u32 gBattleAnimBackgroundTilemap_17[];
extern const u32 gBattleAnimBackgroundTilemap_20[]; extern const u32 gBattleAnimBackgroundTilemap_20[];
extern const u32 gBattleAnimBackgroundTilemap_21[]; extern const u32 gBattleAnimBackgroundTilemap_21[];
extern const u32 gUnknown_08C20668[];
extern const u32 gUnknown_08C20684[];
extern const u32 gBattleStatMask_Gfx[];
extern const u32 gBattleStatMask1_Tilemap[];
extern const u32 gBattleStatMask2_Tilemap[];
extern const u32 gBattleStatMask1_Pal[];
extern const u32 gBattleStatMask2_Pal[];
extern const u32 gBattleStatMask3_Pal[];
extern const u32 gBattleStatMask4_Pal[];
extern const u32 gBattleStatMask5_Pal[];
extern const u32 gBattleStatMask6_Pal[];
extern const u32 gBattleStatMask7_Pal[];
extern const u32 gBattleStatMask8_Pal[];
extern const u32 gUnknown_08D9A88C[]; extern const u32 gUnknown_08D9A88C[];
extern const u32 gContestMiscGfx[]; extern const u32 gContestMiscGfx[];
extern const u32 gContestAudienceGfx[]; extern const u32 gContestAudienceGfx[];

View File

@ -173,7 +173,7 @@ SECTIONS {
asm/dark.o(.text); asm/dark.o(.text);
asm/ground.o(.text); asm/ground.o(.text);
asm/normal.o(.text); asm/normal.o(.text);
asm/battle_anim_utility_funcs.o(.text); src/battle_anim_utility_funcs.o(.text);
asm/battle_intro.o(.text); asm/battle_intro.o(.text);
src/bike.o(.text); src/bike.o(.text);
src/easy_chat.o(.text); src/easy_chat.o(.text);

View File

@ -20,14 +20,6 @@
#define ANIM_SPRITE_INDEX_COUNT 8 #define ANIM_SPRITE_INDEX_COUNT 8
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern u16 gBattle_WIN1H;
extern u16 gBattle_WIN1V;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlayInfo_SE2; extern struct MusicPlayerInfo gMPlayInfo_SE2;
@ -1502,7 +1494,7 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo
else else
{ {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
gAnimBattlerSpecies[i] = gContestResources->field_18->unk0; gAnimBattlerSpecies[i] = gContestResources->field_18->species;
} }
if (!isMoveAnim) if (!isMoveAnim)
@ -1959,7 +1951,7 @@ void sub_80A438C(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
battlerSpriteId = gBattlerSpriteIds[battlerId]; battlerSpriteId = gBattlerSpriteIds[battlerId];
gBattle_BG1_X = -(gSprites[battlerSpriteId].pos1.x + gSprites[battlerSpriteId].pos2.x) + 0x20; gBattle_BG1_X = -(gSprites[battlerSpriteId].pos1.x + gSprites[battlerSpriteId].pos2.x) + 0x20;
if (IsContest() && IsSpeciesNotUnown(gContestResources->field_18->unk0)) if (IsContest() && IsSpeciesNotUnown(gContestResources->field_18->species))
gBattle_BG1_X--; gBattle_BG1_X--;
gBattle_BG1_Y = -(gSprites[battlerSpriteId].pos1.y + gSprites[battlerSpriteId].pos2.y) + 0x20; gBattle_BG1_Y = -(gSprites[battlerSpriteId].pos1.y + gSprites[battlerSpriteId].pos2.y) + 0x20;
@ -2017,7 +2009,7 @@ static void sub_80A46A0(void)
struct UnknownAnimStruct2 unknownStruct; struct UnknownAnimStruct2 unknownStruct;
u16 *ptr; u16 *ptr;
if (IsSpeciesNotUnown(gContestResources->field_18->unk0)) if (IsSpeciesNotUnown(gContestResources->field_18->species))
{ {
sub_80A6B30(&unknownStruct); sub_80A6B30(&unknownStruct);
ptr = unknownStruct.unk4; ptr = unknownStruct.unk4;

View File

@ -159,7 +159,7 @@ u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId)
if (shared19348.unk4_0) if (shared19348.unk4_0)
species = shared19348.unk2; species = shared19348.unk2;
else else
species = shared19348.unk0; species = shared19348.species;
} }
else else
{ {
@ -324,7 +324,7 @@ u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId)
if (shared19348.unk4_0) if (shared19348.unk4_0)
species = shared19348.unk2; species = shared19348.unk2;
else else
species = shared19348.unk0; species = shared19348.species;
} }
else else
{ {
@ -940,18 +940,18 @@ void sub_80A6BFC(struct UnknownAnimStruct2 *unk)
} }
} }
void sub_80A6C68(u32 arg0) void sub_80A6C68(u32 bgId)
{ {
struct UnknownAnimStruct2 unkStruct; struct UnknownAnimStruct2 unkStruct;
sub_80A6B90(&unkStruct, arg0); sub_80A6B90(&unkStruct, bgId);
CpuFill32(0, unkStruct.bgTiles, 0x2000); CpuFill32(0, unkStruct.bgTiles, 0x2000);
LoadBgTiles(unkStruct.bgId, unkStruct.bgTiles, 0x2000, unkStruct.tilesOffset); LoadBgTiles(unkStruct.bgId, unkStruct.bgTiles, 0x2000, unkStruct.tilesOffset);
FillBgTilemapBufferRect(unkStruct.bgId, 0, 0, 0, 0x20, 0x40, 0x11); FillBgTilemapBufferRect(unkStruct.bgId, 0, 0, 0, 0x20, 0x40, 0x11);
CopyBgTilemapBufferToVram(unkStruct.bgId); CopyBgTilemapBufferToVram(unkStruct.bgId);
} }
void sub_80A6CC0(u32 bgId, void *src, u32 tilesOffset) void sub_80A6CC0(u32 bgId, const void *src, u32 tilesOffset)
{ {
CpuFill32(0, gUnknown_0202305C, 0x2000); CpuFill32(0, gUnknown_0202305C, 0x2000);
LZDecompressWram(src, gUnknown_0202305C); LZDecompressWram(src, gUnknown_0202305C);
@ -1854,7 +1854,7 @@ u16 sub_80A7F18(u8 spriteId)
{ {
if (IsContest()) if (IsContest())
{ {
species = shared19348.unk0; species = shared19348.species;
return gMonBackPicCoords[species].y_offset; return gMonBackPicCoords[species].y_offset;
} }
else else
@ -2112,7 +2112,7 @@ s16 sub_80A861C(u8 battlerId, u8 a2)
} }
else else
{ {
species = shared19348.unk0; species = shared19348.species;
personality = shared19348.unk8; personality = shared19348.unk8;
} }
if (species == SPECIES_UNOWN) if (species == SPECIES_UNOWN)

View File

@ -17,8 +17,6 @@ extern const u8 *const gBattleAnims_StatusConditions[];
extern const struct OamData gUnknown_08524904; extern const struct OamData gUnknown_08524904;
extern const struct OamData gUnknown_08524A3C; extern const struct OamData gUnknown_08524A3C;
extern void sub_8116EB4(u8 taskId);
// This file's functions. // This file's functions.
static void sub_80A9DB4(u8 taskId); static void sub_80A9DB4(u8 taskId);
static void sub_80A9FD0(u8 taskId); static void sub_80A9FD0(u8 taskId);

View File

@ -131,7 +131,7 @@ void sub_8158D8C(u8 taskId)
if (IsContest()) if (IsContest())
{ {
if (gBattleAnimArgs[0] == ANIM_ATTACKER) if (gBattleAnimArgs[0] == ANIM_ATTACKER)
species = gContestResources->field_18->unk0; species = gContestResources->field_18->species;
else else
DestroyAnimVisualTask(taskId); // UB: function should return upon destroying task. DestroyAnimVisualTask(taskId); // UB: function should return upon destroying task.
} }
@ -177,7 +177,7 @@ void sub_8158E9C(u8 taskId)
if (IsContest()) if (IsContest())
{ {
if (gBattleAnimArgs[0] == ANIM_ATTACKER) if (gBattleAnimArgs[0] == ANIM_ATTACKER)
species = gContestResources->field_18->unk0; species = gContestResources->field_18->species;
else else
DestroyAnimVisualTask(taskId); // UB: function should return upon destroying task. DestroyAnimVisualTask(taskId); // UB: function should return upon destroying task.
} }
@ -281,7 +281,7 @@ void sub_81590B8(u8 taskId)
pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER); pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
if (IsContest()) if (IsContest())
species = gContestResources->field_18->unk0; species = gContestResources->field_18->species;
else else
species = gAnimBattlerSpecies[gBattleAnimAttacker]; species = gAnimBattlerSpecies[gBattleAnimAttacker];

File diff suppressed because it is too large Load Diff

View File

@ -22,9 +22,6 @@
#include "constants/battle_frontier.h" #include "constants/battle_frontier.h"
#include "constants/moves.h" #include "constants/moves.h"
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern const u32 gUnknown_08D854E8[]; extern const u32 gUnknown_08D854E8[];
extern const u16 gUnknown_08D855E8[]; extern const u16 gUnknown_08D855E8[];

View File

@ -31,11 +31,6 @@ struct BattleBackground
const void *palette; const void *palette;
}; };
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u8 GetCurrentMapBattleScene(void); extern u8 GetCurrentMapBattleScene(void);
// .rodata // .rodata

View File

@ -26,8 +26,6 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/trainers.h" #include "constants/trainers.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;

View File

@ -26,8 +26,6 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/trainers.h" #include "constants/trainers.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];

View File

@ -33,8 +33,6 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/trainers.h" #include "constants/trainers.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;

View File

@ -37,8 +37,6 @@
extern u8 gUnknown_0203CEE8; extern u8 gUnknown_0203CEE8;
extern u8 gUnknown_0203CEE9; extern u8 gUnknown_0203CEE9;
extern u8 gUnknown_0203CF00[]; extern u8 gUnknown_0203CF00[];
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;

View File

@ -26,8 +26,6 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/trainers.h" #include "constants/trainers.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];

View File

@ -28,8 +28,6 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/trainers.h" #include "constants/trainers.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;
extern u8 gUnknown_0203C7B4; extern u8 gUnknown_0203C7B4;

View File

@ -25,8 +25,6 @@
#include "constants/battle_anim.h" #include "constants/battle_anim.h"
#include "constants/songs.h" #include "constants/songs.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u32 gTransformedPersonalities[MAX_BATTLERS_COUNT]; extern u32 gTransformedPersonalities[MAX_BATTLERS_COUNT];
extern u8 gUnknown_0203C7B4; extern u8 gUnknown_0203C7B4;
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;

View File

@ -23,9 +23,6 @@
#include "constants/battle_anim.h" #include "constants/battle_anim.h"
#include "constants/songs.h" #include "constants/songs.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
extern void sub_81358F4(void); extern void sub_81358F4(void);

View File

@ -31,8 +31,6 @@
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/trainers.h" #include "constants/trainers.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern s32 gUnknown_0203CD70; extern s32 gUnknown_0203CD70;
extern struct UnusedControllerStruct gUnknown_02022D0C; extern struct UnusedControllerStruct gUnknown_02022D0C;

View File

@ -66,14 +66,6 @@ extern u16 GetFrontierBrainMonSpecies(u8);
extern void ReducePlayerPartyToThree(void); extern void ReducePlayerPartyToThree(void);
extern u8 gUnknown_0203CEF8[]; extern u8 gUnknown_0203CEF8[];
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
extern const u16 gBattleFrontierHeldItems[]; extern const u16 gBattleFrontierHeldItems[];
extern const struct FacilityMon gBattleFrontierMons[]; extern const struct FacilityMon gBattleFrontierMons[];

View File

@ -69,18 +69,6 @@ struct UnknownPokemonStruct4
/*0x1D*/ u8 language; /*0x1D*/ u8 language;
}; };
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern u16 gBattle_WIN1H;
extern u16 gBattle_WIN1V;
extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE1;
extern struct MusicPlayerInfo gMPlayInfo_SE2; extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern u8 gUnknown_0203CF00[]; extern u8 gUnknown_0203CF00[];

View File

@ -47,11 +47,6 @@
#include "battle_pike.h" #include "battle_pike.h"
#include "battle_pyramid.h" #include "battle_pyramid.h"
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern const u8* const gBattleScriptsForMoveEffects[]; extern const u8* const gBattleScriptsForMoveEffects[];

View File

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "battle.h"
#include "battle_transition.h" #include "battle_transition.h"
#include "bg.h" #include "bg.h"
#include "decompress.h" #include "decompress.h"
@ -56,9 +57,6 @@ struct StructRectangularSpiral
typedef bool8 (*TransitionStateFunc)(struct Task *task); typedef bool8 (*TransitionStateFunc)(struct Task *task);
typedef bool8 (*TransitionSpriteCallback)(struct Sprite *sprite); typedef bool8 (*TransitionSpriteCallback)(struct Sprite *sprite);
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern const struct OamData gEventObjectBaseOam_32x32; extern const struct OamData gEventObjectBaseOam_32x32;
extern void sub_80AC3D0(void); extern void sub_80AC3D0(void);

View File

@ -193,19 +193,6 @@ EWRAM_DATA struct ContestWinner gUnknown_02039F3C = {0};
u32 gContestRngValue; u32 gContestRngValue;
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern s16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
extern u16 gBattle_WIN0H;
extern u16 gBattle_WIN0V;
extern u16 gBattle_WIN1H;
extern u16 gBattle_WIN1V;
extern const u16 gUnknown_08587C30[]; extern const u16 gUnknown_08587C30[];
extern const struct BgTemplate gUnknown_08587F34[4]; extern const struct BgTemplate gUnknown_08587F34[4];
extern const struct WindowTemplate gUnknown_08587F44[]; extern const struct WindowTemplate gUnknown_08587F44[];
@ -638,7 +625,8 @@ void sub_80D8108(u8 taskId)
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;
case 1: case 1:
if ((gBattle_BG1_Y += 7) <= 160) (s16)gBattle_BG1_Y += 7;
if ((s16)gBattle_BG1_Y <= 160)
break; break;
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;
@ -1915,9 +1903,9 @@ void sub_80DA6B4(u8 taskId)
void sub_80DA700(u8 taskId) void sub_80DA700(u8 taskId)
{ {
gBattle_BG1_Y -= 7; gBattle_BG1_Y -= 7;
if (gBattle_BG1_Y < 0) if ((s16)gBattle_BG1_Y < 0)
gBattle_BG1_Y = 0; gBattle_BG1_Y = 0;
if (*(u16 *)&gBattle_BG1_Y == 0) // Why cast? if (gBattle_BG1_Y == 0) // Why cast?
{ {
gTasks[taskId].func = sub_80DA740; gTasks[taskId].func = sub_80DA740;
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;

View File

@ -41,15 +41,6 @@ struct EvoInfo
static EWRAM_DATA struct EvoInfo *sEvoStructPtr = NULL; static EWRAM_DATA struct EvoInfo *sEvoStructPtr = NULL;
static EWRAM_DATA u16 *sEvoMovingBgPtr = NULL; static EWRAM_DATA u16 *sEvoMovingBgPtr = NULL;
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
#define sEvoCursorPos gBattleCommunication[1] // when learning a new move #define sEvoCursorPos gBattleCommunication[1] // when learning a new move
#define sEvoGraphicsTaskID gBattleCommunication[2] #define sEvoGraphicsTaskID gBattleCommunication[2]

View File

@ -884,18 +884,18 @@ const u32 gBattleAnimSpritePalette_242[] = INCBIN_U32("graphics/battle_anims/spr
const u32 gBattleAnimSpriteSheet_243[] = INCBIN_U32("graphics/battle_anims/sprites/243.4bpp.lz"); const u32 gBattleAnimSpriteSheet_243[] = INCBIN_U32("graphics/battle_anims/sprites/243.4bpp.lz");
const u32 gBattleAnimSpritePalette_243[] = INCBIN_U32("graphics/battle_anims/sprites/243.gbapal.lz"); const u32 gBattleAnimSpritePalette_243[] = INCBIN_U32("graphics/battle_anims/sprites/243.gbapal.lz");
const u32 gUnknown_08C2D720[] = INCBIN_U32("graphics/battle_anims/masks/stat.4bpp.lz"); const u32 gBattleStatMask_Gfx[] = INCBIN_U32("graphics/battle_anims/masks/stat.4bpp.lz");
const u32 gUnknown_08C2D930[] = INCBIN_U32("graphics/battle_anims/masks/stat_tilemap_1.bin.lz"); const u32 gBattleStatMask1_Tilemap[] = INCBIN_U32("graphics/battle_anims/masks/stat_tilemap_1.bin.lz");
const u32 gUnknown_08C2DA4C[] = INCBIN_U32("graphics/battle_anims/masks/stat_tilemap_2.bin.lz"); const u32 gBattleStatMask2_Tilemap[] = INCBIN_U32("graphics/battle_anims/masks/stat_tilemap_2.bin.lz");
const u32 gUnknown_08C2DB68[] = INCBIN_U32("graphics/battle_anims/masks/stat1.gbapal.lz"); const u32 gBattleStatMask1_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat1.gbapal.lz");
const u32 gUnknown_08C2DB88[] = INCBIN_U32("graphics/battle_anims/masks/stat2.gbapal.lz"); const u32 gBattleStatMask2_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat2.gbapal.lz");
const u32 gUnknown_08C2DBA8[] = INCBIN_U32("graphics/battle_anims/masks/stat3.gbapal.lz"); const u32 gBattleStatMask3_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat3.gbapal.lz");
const u32 gUnknown_08C2DBC8[] = INCBIN_U32("graphics/battle_anims/masks/stat4.gbapal.lz"); const u32 gBattleStatMask4_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat4.gbapal.lz");
const u32 gUnknown_08C2DBE8[] = INCBIN_U32("graphics/battle_anims/masks/stat5.gbapal.lz"); const u32 gBattleStatMask5_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat5.gbapal.lz");
const u32 gUnknown_08C2DC08[] = INCBIN_U32("graphics/battle_anims/masks/stat6.gbapal.lz"); const u32 gBattleStatMask6_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat6.gbapal.lz");
const u32 gUnknown_08C2DC28[] = INCBIN_U32("graphics/battle_anims/masks/stat7.gbapal.lz"); const u32 gBattleStatMask7_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat7.gbapal.lz");
const u32 gUnknown_08C2DC48[] = INCBIN_U32("graphics/battle_anims/masks/stat8.gbapal.lz"); const u32 gBattleStatMask8_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat8.gbapal.lz");
const u32 gUnknown_08C2DC68[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.4bpp.lz"); const u32 gUnknown_08C2DC68[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.4bpp.lz");
const u32 gUnknown_08C2DDA4[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.gbapal.lz"); const u32 gUnknown_08C2DDA4[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.gbapal.lz");

View File

@ -16,15 +16,6 @@
#include "battle_anim.h" #include "battle_anim.h"
#include "data2.h" #include "data2.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
extern const union AnimCmd * const * const gMonAnimationsSpriteAnimsPtrTable[]; extern const union AnimCmd * const * const gMonAnimationsSpriteAnimsPtrTable[];
extern void SetMultiuseSpriteTemplateToTrainerBack(u16 backPicId, u8 battlerPosition); extern void SetMultiuseSpriteTemplateToTrainerBack(u16 backPicId, u8 battlerPosition);

View File

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "battle.h"
#include "data2.h" #include "data2.h"
#include "task.h" #include "task.h"
#include "trig.h" #include "trig.h"
@ -7,15 +8,6 @@
static void CopyValue16Bit(void); static void CopyValue16Bit(void);
static void CopyValue32Bit(void); static void CopyValue32Bit(void);
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
// EWRAM vars // EWRAM vars
// Per-scanline register values. // Per-scanline register values.

View File

@ -1,4 +1,5 @@
#include "global.h" #include "global.h"
#include "battle.h"
#include "title_screen.h" #include "title_screen.h"
#include "sprite.h" #include "sprite.h"
#include "gba/m4a_internal.h" #include "gba/m4a_internal.h"
@ -37,8 +38,6 @@
#define A_B_START_SELECT (A_BUTTON | B_BUTTON | START_BUTTON | SELECT_BUTTON) #define A_B_START_SELECT (A_BUTTON | B_BUTTON | START_BUTTON | SELECT_BUTTON)
extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_BGM;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
// this file's functions // this file's functions
static void MainCB2(void); static void MainCB2(void);

View File

@ -381,8 +381,7 @@ gUnknown_0203A0F8: @ 203A0F8
gUnknown_0203A100: @ 203A100 gUnknown_0203A100: @ 203A100
.space 0x10 .space 0x10
gUnknown_0203A110: @ 203A110 .include "src/battle_anim_utility_funcs.o"
.space 0x4
gUnknown_0203A114: @ 203A114 gUnknown_0203A114: @ 203A114
.space 0x4 .space 0x4