Decompile battle_anim_8170478.c (#445)

This commit is contained in:
Marcus Huderle 2018-12-13 21:33:54 -06:00 committed by GitHub
parent 170b6ef449
commit 2c6849bee8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 2299 additions and 6031 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
gUnknown_030062DC
gUnknown_030062E0
gUnknown_030062E4

View file

@ -1,157 +0,0 @@
#include "constants/battle_anim.h"
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnknown_085E5088:: @ 85E5088
.byte 0x0a, 0x02, 0xfd, 0x00, 0x0f, 0x00, 0xfc, 0x00
.byte 0xf6, 0x02, 0xfc, 0x00
.align 2
gUnknown_085E5094:: @ 85E5094
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6ec
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6ed
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6ee
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6ef
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6f0
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6f1
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6f2
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6f3
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6f4
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6f5
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6f6
obj_tiles gBattleAnimSpriteSheet_Particles, 0x0100, 0xd6f7
.align 2
gUnknown_085E50F4:: @ 85E50F4
obj_pal gBattleAnimSpritePalette_136, 0xd6ec
obj_pal gBattleAnimSpritePalette_136, 0xd6ed
obj_pal gBattleAnimSpritePalette_136, 0xd6ee
obj_pal gBattleAnimSpritePalette_136, 0xd6ef
obj_pal gBattleAnimSpritePalette_136, 0xd6f0
obj_pal gBattleAnimSpritePalette_136, 0xd6f1
obj_pal gBattleAnimSpritePalette_136, 0xd6f2
obj_pal gBattleAnimSpritePalette_136, 0xd6f3
obj_pal gBattleAnimSpritePalette_136, 0xd6f4
obj_pal gBattleAnimSpritePalette_136, 0xd6f5
obj_pal gBattleAnimSpritePalette_136, 0xd6f6
obj_pal gBattleAnimSpritePalette_136, 0xd6f7
.align 2
gUnknown_085E5154:: @ 85E5154
.2byte 0x0000, 0x0001, 0x0001, 0x0001
.2byte 0x0002, 0x0001, 0x0000, 0x0041
.2byte 0x0002, 0x0001, 0x0001, 0x0001
.2byte 0xfffe, 0x0000
.align 2
gUnknown_085E5170:: @ 85E5170
.2byte 0x0003, 0x0001, 0xffff, 0x0000
.align 2
gUnknown_085E5178:: @ 85E5178
.2byte 0x0004, 0x0001, 0xffff, 0x0000
.align 2
gUnknown_085E5180:: @ 85E5180
.2byte 0x0005, 0x0001, 0xffff, 0x0000
.align 2
gUnknown_085E5188:: @ 85E5188
.2byte 0x0006, 0x0004, 0x0007, 0x0004
.2byte 0xfffe, 0x0000
.align 2
gUnknown_085E5194:: @ 85E5194
.2byte 0x0007, 0x0004, 0xffff, 0x0000
.align 2
gUnknown_085E519C:: @ 85E519C
.4byte gUnknown_085E5154
.4byte gUnknown_085E5170
.4byte gUnknown_085E5178
.4byte gUnknown_085E5180
.4byte gUnknown_085E5188
.4byte gUnknown_085E5194
.align 2
gUnknown_085E51B4:: @ 85E51B4
.byte 0x00, 0x00, 0x00, 0x05, 0x01, 0x02, 0x02, 0x03
.byte 0x05, 0x05, 0x04, 0x04
.align 2
gUnknown_085E51C0:: @ 85E51C0
.4byte sub_8171E50
.4byte sub_81723D4
.4byte sub_81721CC
.4byte sub_81722CC
.4byte sub_81726BC
.4byte sub_81721CC
.4byte sub_81720C8
.4byte sub_81722CC
.4byte sub_8172560
.4byte sub_8171FC4
.4byte sub_81723D4
.4byte sub_81727E8
.align 2
gUnknown_085E51F0:: @ 85E51F0
spr_template 0xd6ec, 0xd6ec, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6ed, 0xd6ed, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6ee, 0xd6ee, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6ef, 0xd6ef, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_085E5250:: @ 85E5250
spr_template 0xd6f0, 0xd6f0, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6f1, 0xd6f1, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6f2, 0xd6f2, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6f3, 0xd6f3, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6f4, 0xd6f4, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6f5, 0xd6f5, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6f6, 0xd6f6, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
spr_template 0xd6f7, 0xd6f7, gUnknown_08524904, gUnknown_085E519C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_085E5310:: @ 85E5310
.2byte 0x7adf, 0x7af0, 0x53d7, 0x3fff, 0x7297, 0x67f5, 0x7b2c, 0x2b7e
.2byte 0x431f, 0x7bdd, 0x2a3f, 0x293f, 0x0000, 0x0201, 0x0403, 0x0101
.2byte 0x0100, 0x0503, 0x0506, 0x0004
.align 2
gBattleAnimSpriteTemplate_85E5338:: @ 85E5338
spr_template ANIM_TAG_UNUSED_RED_BRICK, ANIM_TAG_UNUSED_RED_BRICK, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_817330C
.align 2
gUnknown_085E5350:: @ 8535350
.2byte 0x0040, 0x0001, 0xffff, 0x0000
.align 2
gUnknown_085E5358:: @ 8535358
.4byte gUnknown_085E5350
.align 2
spr_template ANIM_TAG_ROCKS, ANIM_TAG_ROCKS, gUnknown_08524914, gUnknown_085E5358, NULL, gDummySpriteAffineAnimTable, sub_817330C

View file

@ -599,8 +599,7 @@ struct BattleAnimationInfo
u8 field_9_x80:1;
u8 field_A;
u8 field_B;
u8 field_C;
u8 field_D;
s16 field_C;
u8 field_E;
u8 field_F;
};

View file

@ -131,6 +131,7 @@ void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a
u8 sub_80A80C8(struct Task *task);
void sub_80A8EE4(struct Sprite *);
void sub_80A67F4(struct Sprite *);
void sub_80A6D48(u32 bgId, const void *src);
enum
{
@ -168,8 +169,8 @@ void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId);
// battle_anim_8170478.s
u8 ItemIdToBallId(u16 itemId);
u8 LaunchBallStarsTask(u8 x, u8 y, u8 kindOfStars, u8 arg3, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 arg2, u8 ballId);
u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId);
// battle_anim_utility_funcs.s
void sub_8116EB4(u8);
@ -223,4 +224,7 @@ extern const struct OamData gUnknown_0852493C;
extern const struct OamData gUnknown_08524A5C;
extern const struct OamData gUnknown_08524A74;
extern const struct CompressedSpriteSheet gBattleAnimPicTable[];
extern const struct CompressedSpritePalette gBattleAnimPaletteTable[];
#endif // GUARD_BATTLE_ANIM_H

View file

@ -61,6 +61,12 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
// Extracts the upper 16 bits of a 32-bit number
#define HIHALF(n) (((n) & 0xFFFF0000) >> 16)
// Extracts the lower 16 bits of a 32-bit number
#define LOHALF(n) ((n) & 0xFFFF)
// There are many quirks in the source code which have overarching behavioral differences from
// a number of other files. For example, diploma.c seems to declare rodata before each use while
// other files declare out of order and must be at the beginning. There are also a number of

View file

@ -4233,6 +4233,7 @@ extern const u32 gBattleAnimSpriteSheet_132[];
extern const u32 gBattleAnimSpriteSheet_133[];
extern const u32 gBattleAnimSpriteSheet_134[];
extern const u32 gBattleAnimSpriteSheet_135[];
extern const u32 gBattleAnimSpriteSheet_Particles[];
extern const u32 gBattleAnimSpriteSheet_136[];
extern const u32 gBattleAnimSpriteSheet_137[];
extern const u32 gBattleAnimSpriteSheet_138[];
@ -4748,4 +4749,9 @@ extern const u32 gCableCarDoor_Gfx[];
extern const u32 gCableCarCord_Gfx[];
extern const u16 gCableCar_Pal[];
// Battle Anim
extern const u32 gUnknown_08C2DDA4[];
extern const u32 gUnknown_08C2EA50[];
extern const u32 gUnknown_08C2EA9C[];
#endif //GUARD_GRAPHICS_H

View file

@ -238,7 +238,7 @@ SECTIONS {
src/intro.o(.text);
src/reset_save_heap.o(.text);
src/field_region_map.o(.text);
asm/battle_anim_8170478.o(.text);
src/battle_anim_8170478.o(.text);
src/hall_of_fame.o(.text);
src/credits.o(.text);
src/lottery_corner.o(.text);
@ -549,7 +549,7 @@ SECTIONS {
src/player_pc.o(.rodata);
src/intro.o(.rodata);
src/field_region_map.o(.rodata);
data/battle_anim_8170478.o(.rodata);
src/battle_anim_8170478.o(.rodata);
src/hall_of_fame.o(.rodata);
src/credits.o(.rodata);
src/lottery_corner.o(.rodata);

View file

@ -26,8 +26,6 @@ extern struct MusicPlayerInfo gMPlayInfo_SE2;
extern const u16 gMovesWithQuietBGM[];
extern const u8 *const gBattleAnims_Moves[];
extern const struct CompressedSpriteSheet gBattleAnimPicTable[];
extern const struct CompressedSpritePalette gBattleAnimPaletteTable[];
extern const struct BattleAnimBackground gBattleAnimBackgroundTable[];
// this file's functions

2267
src/battle_anim_8170478.c Executable file

File diff suppressed because it is too large Load diff

View file

@ -250,12 +250,7 @@ static void BattleIntroSlide2(u8 taskId)
if (gTasks[taskId].data[1] == 4)
{
u16 *bg1Y = &gBattle_BG1_Y;
int cos = Cos2(gTasks[taskId].data[6]);
if (cos < 0)
cos += 0x1FF;
*bg1Y = (cos >> 9) - 8;
gBattle_BG1_Y = Cos2(gTasks[taskId].data[6]) / 512 - 8;
if (gTasks[taskId].data[6] < 180)
gTasks[taskId].data[6] += 4;
else

View file

@ -426,7 +426,7 @@ static void SpriteCB_TestBallThrow(struct Sprite *sprite)
sprite->pos2.y = 0;
sprite->data[5] = 0;
ballId = ItemIdToBallId(GetBattlerPokeballItemId(opponentBattler));
LaunchBallStarsTask(sprite->pos1.x, sprite->pos1.y - 5, 1, 0x1C, ballId);
AnimateBallOpenParticles(sprite->pos1.x, sprite->pos1.y - 5, 1, 0x1C, ballId);
sprite->data[0] = LaunchBallFadeMonTask(FALSE, opponentBattler, 14, ballId);
sprite->sBattler = opponentBattler;
sprite->data[7] = noOfShakes;
@ -737,7 +737,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite)
StartSpriteAnim(sprite, 1);
ballId = ItemIdToBallId(GetBattlerPokeballItemId(battlerId));
LaunchBallStarsTask(sprite->pos1.x, sprite->pos1.y - 5, 1, 0x1C, ballId);
AnimateBallOpenParticles(sprite->pos1.x, sprite->pos1.y - 5, 1, 0x1C, ballId);
sprite->data[0] = LaunchBallFadeMonTask(1, sprite->sBattler, 14, ballId);
sprite->callback = HandleBallAnimEnd;
@ -985,9 +985,9 @@ static void SpriteCB_OpponentMonSendOut(struct Sprite *sprite)
#undef sBattler
static u8 LaunchBallStarsTaskForPokeball(u8 x, u8 y, u8 kindOfStars, u8 d)
static u8 AnimateBallOpenParticlesForPokeball(u8 x, u8 y, u8 kindOfStars, u8 d)
{
return LaunchBallStarsTask(x, y, kindOfStars, d, BALL_POKE);
return AnimateBallOpenParticles(x, y, kindOfStars, d, BALL_POKE);
}
static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 battlerId, u32 arg2)
@ -1036,7 +1036,7 @@ static void sub_8076524(struct Sprite *sprite)
r5 = 0;
StartSpriteAnim(sprite, 1);
LaunchBallStarsTaskForPokeball(sprite->pos1.x, sprite->pos1.y - 5, sprite->oam.priority, r5);
AnimateBallOpenParticlesForPokeball(sprite->pos1.x, sprite->pos1.y - 5, sprite->oam.priority, r5);
sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, r4);
sprite->callback = sub_80765E0;
gSprites[r7].invisible = FALSE;
@ -1129,7 +1129,7 @@ static void sub_80767D4(struct Sprite *sprite)
r6 = 0;
StartSpriteAnim(sprite, 1);
LaunchBallStarsTaskForPokeball(sprite->pos1.x, sprite->pos1.y - 5, sprite->oam.priority, r6);
AnimateBallOpenParticlesForPokeball(sprite->pos1.x, sprite->pos1.y - 5, sprite->oam.priority, r6);
sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, r8, r5);
sprite->callback = sub_807687C;
StartSpriteAffineAnim(&gSprites[r7], 2);

View file

@ -45,12 +45,6 @@ struct SpeciesItem
u16 item;
};
// Extracts the upper 16 bits of a 32-bit number
#define HIHALF(n) (((n) & 0xFFFF0000) >> 16)
// Extracts the lower 16 bits of a 32-bit number
#define LOHALF(n) ((n) & 0xFFFF)
extern const struct OamData gUnknown_0831ACB0;
extern const struct OamData gUnknown_0831ACA8;
extern const struct SpriteFrameImage gUnknown_082FF3A8[];
@ -6707,12 +6701,6 @@ const u32 *GetMonFrontSpritePal(struct Pokemon *mon)
return GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality);
}
// Extracts the upper 16 bits of a 32-bit number
#define HIHALF(n) (((n) & 0xFFFF0000) >> 16)
// Extracts the lower 16 bits of a 32-bit number
#define LOHALF(n) ((n) & 0xFFFF)
const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality)
{
u32 shinyValue;

View file

@ -77,16 +77,7 @@ gDexCryScreenState: @ 30061EC
.include "save.o"
.include "battle_tower.o"
.include "intro.o"
gUnknown_030062DC: @ 30062DC
.space 0x4
gUnknown_030062E0: @ 30062E0
.space 0x4
gUnknown_030062E4: @ 30062E4
.space 0x4
.include "battle_anim_8170478.o"
.include "battle_factory_screen.o"
.include "apprentice.o"