Match sub_800543C and sub_800545C

This commit is contained in:
Kermalis
2023-08-18 11:20:19 -04:00
parent ad5ec244aa
commit 710638ad7a
3 changed files with 29 additions and 71 deletions

View File

@@ -5,77 +5,6 @@
.text
thumb_func_start sub_800543C
sub_800543C:
push {r4,r5,lr}
sub sp, 0x8
ldr r5, [sp, 0x14]
ldr r4, [sp, 0x18]
lsls r4, 24
lsrs r4, 24
ldr r1, [r1, 0x4]
str r5, [sp]
str r4, [sp, 0x4]
bl sub_800545C
add sp, 0x8
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_800543C
thumb_func_start sub_800545C
sub_800545C:
push {r4-r7,lr}
adds r4, r0, 0
adds r6, r1, 0
adds r7, r2, 0
adds r5, r3, 0
ldr r0, [sp, 0x18]
lsls r0, 24
movs r2, 0
movs r3, 0x80
lsls r3, 8
strh r3, [r4]
cmp r0, 0
beq _08005482
movs r0, 0x80
lsls r0, 5
adds r1, r0, 0
adds r0, r3, 0
orrs r0, r1
strh r0, [r4]
_08005482:
strh r2, [r4, 0x2]
ldr r0, [sp, 0x14]
strh r0, [r4, 0x4]
strh r2, [r4, 0xC]
strh r2, [r4, 0xE]
strh r5, [r4, 0x1C]
ldr r0, _080054B8
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, [r6, 0x4]
lsls r0, r7, 2
adds r0, r1
ldr r0, [r0]
ldr r0, [r0]
str r0, [r4, 0x28]
str r0, [r4, 0x2C]
ldr r0, [r6]
str r0, [r4, 0x34]
str r2, [r4, 0x30]
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080054B8: .4byte 0x0000ffff
thumb_func_end sub_800545C
thumb_func_start sub_80054BC
sub_80054BC:
push {r4,lr}

View File

@@ -103,5 +103,6 @@ void sub_8005180(void);
void sub_8005304(void);
void sub_80053AC(struct Entity_Sub28 *, struct Dungeon_Sub17B44 *, u32, u32, u32, u32, bool8);
void sub_80053D0(struct Entity_Sub28 *, struct Dungeon_Sub17B44_Sub4 *, u32, u32, u32, u32, bool8);
void sub_800543C(struct Entity_Sub28 *, struct Dungeon_Sub17B44 *, u32, u32, u32, bool8);
#endif // GUARD_SPRITE_H

View File

@@ -19,6 +19,7 @@ extern struct unkStruct_20266B0 *gUnknown_203B074;
extern void nullsub_3(s32, s32);
void RegisterSpriteParts_80052BC(struct UnkSpriteMem *);
void sub_800545C(struct Entity_Sub28 *, struct Dungeon_Sub17B44_Sub4 *, u32, u32, u32, bool8);
void InitSprites(void)
{
@@ -911,4 +912,31 @@ void sub_80053D0(struct Entity_Sub28 *a0, struct Dungeon_Sub17B44_Sub4 *a1, u32
a0->unk34 = a1->unk0;
a0->unk38 = a1->unkC;
a0->unk30 = a1->unk10;
}
void sub_800543C(struct Entity_Sub28 *a0, struct Dungeon_Sub17B44 *a1, u32 a2, u32 a3, u32 spriteAnimIndex, bool8 a5)
{
sub_800545C(a0, a1->unk4, a2, a3, spriteAnimIndex, a5);
}
void sub_800545C(struct Entity_Sub28 *a0, struct Dungeon_Sub17B44_Sub4 *a1, u32 a2, u32 a3, u32 spriteAnimIndex, bool8 a5)
{
a0->unk0 = 0x8000;
if (a5)
a0->unk0 |= 0x1000;
a0->spriteAnimationCounter = 0;
a0->spriteAnimationIndex = spriteAnimIndex;
a0->spritePosOffset.x = 0;
a0->spritePosOffset.y = 0;
a0->unk1C = a3;
a0->spriteIndexForEntity = 0xFFFF;
a0->spriteIndexForEntity2 = 0xFFFF;
a0->unk14 = 0;
a0->unk18 = 0;
a0->spriteAnimationCounter2 = 0;
a0->spriteBaseForDirection = a1->unk4[a2][0];
a0->spriteGlobalIndex = a0->spriteBaseForDirection;
a0->unk34 = a1->unk0;
a0->unk30 = 0;
}