Match sub_80053D0

This commit is contained in:
Kermalis
2023-08-18 10:32:15 -04:00
parent 79b3ea4ed6
commit ad5ec244aa
3 changed files with 35 additions and 66 deletions

View File

@@ -5,65 +5,6 @@
.text
thumb_func_start sub_80053D0
sub_80053D0:
push {r4-r7,lr}
adds r4, r0, 0
adds r5, r1, 0
adds r6, r2, 0
adds r7, r3, 0
ldr r0, [sp, 0x1C]
lsls r0, 24
movs r2, 0
movs r3, 0x80
lsls r3, 8
strh r3, [r4]
cmp r0, 0
beq _080053F6
movs r0, 0x80
lsls r0, 5
adds r1, r0, 0
adds r0, r3, 0
orrs r0, r1
strh r0, [r4]
_080053F6:
strh r2, [r4, 0x2]
ldr r0, [sp, 0x18]
strh r0, [r4, 0x4]
strh r2, [r4, 0xC]
strh r2, [r4, 0xE]
ldr r0, [sp, 0x14]
strh r0, [r4, 0x1C]
ldr r0, _08005438
strh r0, [r4, 0x20]
movs r0, 0x1
negs r0, r0
strh r0, [r4, 0x22]
str r2, [r4, 0x14]
str r2, [r4, 0x18]
strh r2, [r4, 0x6]
ldr r1, [r5, 0x4]
lsls r0, r6, 2
adds r0, r1
ldr r1, [r0]
lsls r0, r7, 2
adds r0, r1
ldr r0, [r0]
str r0, [r4, 0x28]
str r0, [r4, 0x2C]
ldr r0, [r5]
str r0, [r4, 0x34]
ldr r0, [r5, 0xC]
str r0, [r4, 0x38]
ldr r0, [r5, 0x10]
str r0, [r4, 0x30]
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08005438: .4byte 0x0000ffff
thumb_func_end sub_80053D0
thumb_func_start sub_800543C
sub_800543C:
push {r4,r5,lr}

View File

@@ -56,7 +56,11 @@ struct Entity_Sub28
/* 0x8 */ struct Position spritePos;
// Offset of the sprite from its position at the start of the animation. Changes alongside spritePos.
/* 0xC */ struct Position spritePosOffset;
u8 fill10[0x20 - 0x10];
u8 fill10[0x14 - 0x10];
u32 unk14;
u32 unk18;
u16 unk1C;
u8 fill1E[0x20 - 0x1E];
// The sprite index to display, among the Pokémon's possible sprites.
/* 0x20 */ u16 spriteIndexForEntity;
/* 0x22 */ u16 spriteIndexForEntity2;
@@ -64,17 +68,18 @@ struct Entity_Sub28
// Some kind of base sprite index depending on which way the Pokémon is facing.
// and which animation is playing (e.g., idle, moving).
// Compared to 0x20, 0x28 and 0x2C are much larger and could be global indexes among all sprites in the game.
/* 0x28 */ u16 spriteBaseForDirection;
u8 fill2A[0x2C - 0x2A];
/* 0x2C */ u16 spriteGlobalIndex;
u8 fill2E[0x3C - 0x2E];
/* 0x28 */ u32 spriteBaseForDirection;
/* 0x2C */ u32 spriteGlobalIndex;
u32 unk30;
u32 unk34;
u32 unk38;
};
// size: ?
struct Dungeon_Sub17B44_Sub4
{
u32 unk0;
u32 unk4;
u32 **unk4;
u8 fill8[0xC - 0x8];
u32 unkC;
u32 unk10;
@@ -97,6 +102,6 @@ void sub_8004E8C(struct unkStruct_2039DB0 *);
void sub_8005180(void);
void sub_8005304(void);
void sub_80053AC(struct Entity_Sub28 *, struct Dungeon_Sub17B44 *, u32, u32, u32, u32, bool8);
extern void sub_80053D0(struct Entity_Sub28 *a0, struct Dungeon_Sub17B44_Sub4 *a1, u32 a2, u32 a3, u32 a4, u32 spriteAnimIndex, bool8 a6);
void sub_80053D0(struct Entity_Sub28 *, struct Dungeon_Sub17B44_Sub4 *, u32, u32, u32, u32, bool8);
#endif // GUARD_SPRITE_H

View File

@@ -888,4 +888,27 @@ void sub_800533C(struct ax_pose **a0, struct UnkSpriteMem **a1, struct axdata1 *
void sub_80053AC(struct Entity_Sub28 *a0, struct Dungeon_Sub17B44 *a1, u32 a2, u32 a3, u32 a4, u32 spriteAnimIndex, bool8 a6)
{
sub_80053D0(a0, a1->unk4, a2, a3, a4, spriteAnimIndex, a6);
}
void sub_80053D0(struct Entity_Sub28 *a0, struct Dungeon_Sub17B44_Sub4 *a1, u32 a2, u32 direction, u32 a4, u32 spriteAnimIndex, bool8 a6)
{
a0->unk0 = 0x8000;
if (a6)
a0->unk0 |= 0x1000;
a0->spriteAnimationCounter = 0;
a0->spriteAnimationIndex = spriteAnimIndex;
a0->spritePosOffset.x = 0;
a0->spritePosOffset.y = 0;
a0->unk1C = a4;
a0->spriteIndexForEntity = 0xFFFF;
a0->spriteIndexForEntity2 = 0xFFFF;
a0->unk14 = 0;
a0->unk18 = 0;
a0->spriteAnimationCounter2 = 0;
a0->spriteBaseForDirection = a1->unk4[a2][direction];
a0->spriteGlobalIndex = a0->spriteBaseForDirection;
a0->unk34 = a1->unk0;
a0->unk38 = a1->unkC;
a0->unk30 = a1->unk10;
}