diff options
| author | notyourav <65437533+notyourav@users.noreply.github.com> | 2021-12-27 19:58:02 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-27 19:58:02 -0800 |
| commit | 4fa53c17a0f43554ca4d6d62b35a467dc71a95d3 (patch) | |
| tree | d8e34e483d16e867005814dc5211b1abb6679a69 /src | |
| parent | 2b45a8c992da0836893bc1a859bfc1d17dff0c0a (diff) | |
| parent | 5fa3e5f1fcba867a747f2b8acf344508a8905a46 (diff) | |
Merge pull request #222 from hatal175/moblinspear
Decompile MoblinSpear_Action1
Diffstat (limited to 'src')
| -rw-r--r-- | src/projectile/moblinSpear.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/projectile/moblinSpear.c b/src/projectile/moblinSpear.c index f31459cc..09decdd6 100644 --- a/src/projectile/moblinSpear.c +++ b/src/projectile/moblinSpear.c @@ -49,11 +49,16 @@ void MoblinSpear_Init(Entity* this) { } } -NONMATCH("asm/non_matching/moblinSpear/MoblinSpear_Action1.inc", void MoblinSpear_Action1(Entity* this)) { +void MoblinSpear_Action1(Entity* this) { u8 frames; Entity* parent; u32 tmp; - const HitboxChange* a; + + // const HitboxChange* a; + // TODO: Copying a members using HitboxChange members addresses them directly using [r2, 0x1] + // while the assembly increases the pointer after every copy. + // Not sure how to make this more readable. + const u8* a; parent = this->parent; if (parent == NULL) { @@ -63,15 +68,14 @@ NONMATCH("asm/non_matching/moblinSpear/MoblinSpear_Action1.inc", void MoblinSpea DeleteThisEntity(); } frames = parent->frame * 4; - a = &gUnk_0812966C[frames / 4]; - this->hitbox->offset_x = a->offsetX; - // TODO offset used to increase a pointer is already increated here? + a = (u8*)&gUnk_0812966C[frames / 4]; + this->hitbox->offset_x = *a++; if (parent->frameSpriteSettings == 0x40) { this->hitbox->offset_x = -this->hitbox->offset_x; } - this->hitbox->offset_y = a->offsetY; - this->hitbox->width = a->width; - this->hitbox->height = a->height; + this->hitbox->offset_y = *a++; + this->hitbox->width = *a++; + this->hitbox->height = *a++; if (parent->field_0x43 != 0) { if ((this->flags & ENT_COLLIDE) != 0) { COLLISION_OFF(this); @@ -82,7 +86,6 @@ NONMATCH("asm/non_matching/moblinSpear/MoblinSpear_Action1.inc", void MoblinSpea } } } -END_NONMATCH void (*const MoblinSpear_Functions[])(Entity*) = { MoblinSpear_OnTick, sub_080A832C, DeleteEntity, DeleteEntity, DeleteEntity, |
