summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2022-02-12 20:00:08 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2022-02-12 20:03:27 +0100
commitb69a6d223c72bc4b88fef1527225d06854219f34 (patch)
treec6c018bb7e10d4e8a326f057283a91661ecaccf8 /src
parentd6c79aa26346afc85bcfa724d3c086fb06c888dc (diff)
Rename movement functions
Diffstat (limited to 'src')
-rw-r--r--src/collision.c82
-rw-r--r--src/coord.c12
-rw-r--r--src/enemy/acroBandits.c4
-rw-r--r--src/enemy/armos.c2
-rw-r--r--src/enemy/ballChainSoldier.c19
-rw-r--r--src/enemy/beetle.c10
-rw-r--r--src/enemy/bladeTrap.c4
-rw-r--r--src/enemy/bobomb.c5
-rw-r--r--src/enemy/bombarossa.c2
-rw-r--r--src/enemy/bowMoblin.c2
-rw-r--r--src/enemy/businessScrub.c16
-rw-r--r--src/enemy/businessScrubPrologue.c4
-rw-r--r--src/enemy/chaser.c7
-rw-r--r--src/enemy/chuchu.c26
-rw-r--r--src/enemy/chuchuBoss.c3
-rw-r--r--src/enemy/cuccoAggr.c26
-rw-r--r--src/enemy/cuccoChickAggr.c4
-rw-r--r--src/enemy/curtain.c2
-rw-r--r--src/enemy/darkNut.c33
-rw-r--r--src/enemy/doorMimic.c1
-rw-r--r--src/enemy/enemy50.c4
-rw-r--r--src/enemy/eyegore.c4
-rw-r--r--src/enemy/fallingBoulder.c4
-rw-r--r--src/enemy/fireballGuy.c2
-rw-r--r--src/enemy/flyingSkull.c2
-rw-r--r--src/enemy/ghini.c6
-rw-r--r--src/enemy/gibdo.c10
-rw-r--r--src/enemy/helmasaur.c12
-rw-r--r--src/enemy/keaton.c4
-rw-r--r--src/enemy/keese.c3
-rw-r--r--src/enemy/lakitu.c2
-rw-r--r--src/enemy/lakituCloud.c9
-rw-r--r--src/enemy/leever.c2
-rw-r--r--src/enemy/likeLike.c2
-rw-r--r--src/enemy/madderpillar.c2
-rw-r--r--src/enemy/miniFireballGuy.c2
-rw-r--r--src/enemy/miniSlime.c2
-rw-r--r--src/enemy/moldorm.c2
-rw-r--r--src/enemy/moldworm.c2
-rw-r--r--src/enemy/mulldozer.c6
-rw-r--r--src/enemy/octorok.c2
-rw-r--r--src/enemy/octorokBoss.c14
-rw-r--r--src/enemy/octorokGolden.c4
-rw-r--r--src/enemy/peahat.c12
-rw-r--r--src/enemy/pesto.c2
-rw-r--r--src/enemy/puffstool.c2
-rw-r--r--src/enemy/rockChuchu.c2
-rw-r--r--src/enemy/rollobite.c9
-rw-r--r--src/enemy/rope.c2
-rw-r--r--src/enemy/ropeGolden.c2
-rw-r--r--src/enemy/rupeeLike.c2
-rw-r--r--src/enemy/scissorsBeetle.c4
-rw-r--r--src/enemy/sensorBladeTrap.c7
-rw-r--r--src/enemy/slime.c2
-rw-r--r--src/enemy/sluggula.c2
-rw-r--r--src/enemy/spark.c2
-rw-r--r--src/enemy/spearMoblin.c6
-rw-r--r--src/enemy/spikedBeetle.c6
-rw-r--r--src/enemy/spinyBeetle.c2
-rw-r--r--src/enemy/spinyChuchu.c4
-rw-r--r--src/enemy/stalfos.c10
-rw-r--r--src/enemy/tektite.c2
-rw-r--r--src/enemy/tektiteGolden.c2
-rw-r--r--src/enemy/vaatiArm.c2
-rw-r--r--src/enemy/vaatiEyesMacro.c2
-rw-r--r--src/enemy/vaatiRebornEnemy.c6
-rw-r--r--src/enemy/vaatiTransfigured.c2
-rw-r--r--src/enemy/vaatiWrath.c2
-rw-r--r--src/enemy/wisp.c2
-rw-r--r--src/enemy/wizzrobeWind.c2
-rw-r--r--src/movement.c2039
-rw-r--r--src/npc/castleMaid.c2
-rw-r--r--src/npc/cow.c2
-rw-r--r--src/npc/dog.c2
-rw-r--r--src/npc/kid.c2
-rw-r--r--src/npc/npc23.c2
-rw-r--r--src/npc/npc5.c27
-rw-r--r--src/npc/townsperson.c2
-rw-r--r--src/npcUtils.c14
-rw-r--r--src/object/bakerOven.c2
-rw-r--r--src/object/itemOnGround.c4
-rw-r--r--src/object/lightableSwitch.c5
-rw-r--r--src/object/lilypadLarge.c2
-rw-r--r--src/object/objectB2.c2
-rw-r--r--src/object/rupee.c2
-rw-r--r--src/object/smallIceBlock.c2
-rw-r--r--src/projectile/arrowProjectile.c4
-rw-r--r--src/projectile/boneProjectile.c10
-rw-r--r--src/projectile/cannonballProjectile.c11
-rw-r--r--src/projectile/dekuSeedProjectile.c19
-rw-r--r--src/projectile/dirtBallProjectile.c2
-rw-r--r--src/projectile/fireProjectile.c8
-rw-r--r--src/projectile/guardLineOfSight.c2
-rw-r--r--src/projectile/gyorgMaleEnergyProjectile.c10
-rw-r--r--src/projectile/iceProjectile.c8
-rw-r--r--src/projectile/lakituLightning.c8
-rw-r--r--src/projectile/mandiblesProjectile.c2
-rw-r--r--src/projectile/moblinSpear.c4
-rw-r--r--src/projectile/octorokBossProjectile.c6
-rw-r--r--src/projectile/rockProjectile.c10
-rw-r--r--src/projectile/spikedRollers.c5
-rw-r--r--src/projectile/torchTrapProjectile.c9
-rw-r--r--src/projectile/v2Projectile.c7
-rw-r--r--src/projectile/v3ElectricProjectile.c7
-rw-r--r--src/projectile/v3HandProjectile.c8
-rw-r--r--src/projectile/v3TennisBallProjectile.c12
-rw-r--r--src/projectile/windProjectile.c8
-rw-r--r--src/projectile/winder.c2
108 files changed, 2091 insertions, 648 deletions
diff --git a/src/collision.c b/src/collision.c
index bb8c3551..649055cf 100644
--- a/src/collision.c
+++ b/src/collision.c
@@ -13,18 +13,18 @@ extern u8 gCollidableCount;
extern u8 gUnk_080B3740[];
typedef struct {
- u8 _0;
- u8 _1;
- u8 _2;
- u8 _3;
- u8 _4;
- u8 _5;
- s8 _6;
- u8 _7;
- u8 _8;
- u8 _9;
- u8 _a;
- u8 _b;
+ /*0x00*/ u8 orgKnockbackSpeed;
+ /*0x01*/ u8 orgIframes;
+ /*0x02*/ u8 orgKnockbackDuration;
+ /*0x03*/ u8 tgtDamage;
+ /*0x04*/ u8 orgConfusedTime;
+ /*0x05*/ u8 tgtKnockbackSpeed;
+ /*0x06*/ s8 tgtIframes;
+ /*0x07*/ u8 tgtKnockbackDuration;
+ /*0x08*/ u8 orgDamage;
+ /*0x09*/ u8 tgtConfusedTime;
+ /*0x0a*/ u8 _a;
+ /*0x0b*/ u8 _b;
} ColSettings;
extern ColSettings gCollisionMtx[173 * 34];
@@ -362,7 +362,7 @@ s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
} else {
org->knockbackDuration = 0x10;
org->iframes = -20;
- org->field_0x46 = 640;
+ org->knockbackSpeed = 640;
}
return 1;
}
@@ -374,7 +374,7 @@ s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
if (x << 24 <= 0) {
tgt->field_0x1d = 0;
tgt->subAction = 2;
- tgt->field_0x46 = 0;
+ tgt->knockbackSpeed = 0;
}
}
} else {
@@ -399,7 +399,7 @@ s32 sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
org->health = sub_08017874(org, tgt);
org->knockbackDuration = 12;
org->iframes = 30;
- org->field_0x46 = 384;
+ org->knockbackSpeed = 384;
if (tgt->iframes == 0)
tgt->iframes = -1;
return 1;
@@ -416,7 +416,7 @@ s32 sub_08017C40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
}
org->knockbackDuration = 12;
org->iframes = 16;
- org->field_0x46 = 640;
+ org->knockbackSpeed = 640;
if (tgt->iframes == 0)
tgt->iframes = -1;
return 1;
@@ -432,7 +432,7 @@ s32 sub_08017CBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
tgt->knockbackDuration = 12;
tgt->iframes = 16;
tgt->confusedTime = -16;
- tgt->field_0x46 = 768;
+ tgt->knockbackSpeed = 768;
if (org->iframes == 0)
org->iframes = -1;
}
@@ -444,7 +444,7 @@ s32 sub_08017D28(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
org->field_0x7a.HWORD = 600;
org->knockbackDuration = 12;
org->iframes = 16;
- org->field_0x46 = 640;
+ org->knockbackSpeed = 640;
if (tgt->iframes == 0)
tgt->iframes = -1;
return 1;
@@ -484,7 +484,7 @@ int sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
gPlayerEntity.iframes = 12;
gPlayerEntity.knockbackDuration = 16;
gPlayerEntity.knockbackDirection = DirectionTurnAround(direction);
- gPlayerEntity.field_0x46 = 640;
+ gPlayerEntity.knockbackSpeed = 640;
}
if (tgt->iframes == 0)
tgt->iframes = -1;
@@ -493,7 +493,7 @@ int sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
s32 sub_08017E88(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
org->knockbackDuration = 2;
- org->field_0x46 = 640;
+ org->knockbackSpeed = 640;
if (tgt->iframes == 0)
tgt->iframes = -1;
return 1;
@@ -509,11 +509,11 @@ s32 sub_08017EB0(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
tgt->damage = temp;
gPlayerEntity.knockbackDuration = 12;
gPlayerEntity.iframes = 16;
- gPlayerEntity.field_0x46 = 384;
+ gPlayerEntity.knockbackSpeed = 384;
} else if (org->kind == PLAYER_ITEM && org->id == 5) {
org->knockbackDuration = 8;
org->iframes = -6;
- org->field_0x46 = 384;
+ org->knockbackSpeed = 384;
gPlayerEntity.iframes = 0x80;
}
if (tgt->iframes == 0)
@@ -608,10 +608,10 @@ s32 sub_080180E8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
if (DirectionNormalize(tgt->direction - v3) <= 0x18) {
org->knockbackDuration = 12;
org->iframes = -16;
- org->field_0x46 = 640;
+ org->knockbackSpeed = 640;
tgt->knockbackDuration = 12;
tgt->iframes = -16;
- tgt->field_0x46 = 768;
+ tgt->knockbackSpeed = 768;
sub_08017940(org, tgt);
return 1;
}
@@ -700,27 +700,27 @@ s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
}
if (!temp) {
u32 tmp2;
- org->field_0x46 = 16 * settings->_0;
- org->iframes = settings->_1;
+ org->knockbackSpeed = 16 * settings->orgKnockbackSpeed;
+ org->iframes = settings->orgIframes;
if (org->iframes == 0)
org->iframes = -1;
- org->knockbackDuration = settings->_2;
- tgt->damage = settings->_3;
+ org->knockbackDuration = settings->orgKnockbackDuration;
+ tgt->damage = settings->tgtDamage;
tmp2 = 0xFF;
- if (settings->_3 != 0)
+ if (settings->tgtDamage != 0)
org->health = sub_08017874(org, tgt);
- if (settings->_4 > org->confusedTime)
- org->confusedTime = settings->_4;
- tgt->field_0x46 = 16 * settings->_5;
- tgt->iframes = settings->_6;
- if (settings->_6 == 0)
+ if (settings->orgConfusedTime > org->confusedTime)
+ org->confusedTime = settings->orgConfusedTime;
+ tgt->knockbackSpeed = 16 * settings->tgtKnockbackSpeed;
+ tgt->iframes = settings->tgtIframes;
+ if (settings->tgtIframes == 0)
tgt->iframes = -1;
- tgt->knockbackDuration = settings->_7;
- tmp2 &= org->damage = settings->_8;
+ tgt->knockbackDuration = settings->tgtKnockbackDuration;
+ tmp2 &= org->damage = settings->orgDamage;
if (tmp2 != 0)
tgt->health = sub_08017874(tgt, org);
- if (settings->_9 > tgt->confusedTime)
- tgt->confusedTime = settings->_9;
+ if (settings->tgtConfusedTime > tgt->confusedTime)
+ tgt->confusedTime = settings->tgtConfusedTime;
}
if (settings->_a & 1)
sub_08017940(org, tgt);
@@ -735,13 +735,13 @@ s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
parent->knockbackDuration = tgt->knockbackDuration;
if (parent->confusedTime == 0)
parent->confusedTime = tgt->confusedTime;
- parent->field_0x46 = tgt->field_0x46;
+ parent->knockbackSpeed = tgt->knockbackSpeed;
parent->field_0x4c = org;
}
}
if (org->kind == PLAYER_ITEM) {
if (org->id == 1) {
- if (settings->_8) {
+ if (settings->orgDamage) {
sub_080179EC(org, tgt);
}
} else if (org->id == 4) {
@@ -749,7 +749,7 @@ s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
sub_08017A90(org, tgt);
}
} else if (org->id == 3) {
- if (settings->_9) {
+ if (settings->tgtConfusedTime) {
SoundReqClipped(tgt, SFX_HIT);
}
} else if (org->id == 5) {
diff --git a/src/coord.c b/src/coord.c
index 14f4684a..30b6aa81 100644
--- a/src/coord.c
+++ b/src/coord.c
@@ -86,21 +86,21 @@ u32 sub_0806F3E4(Entity* ent) {
return 0;
switch (gPlayerState.field_0x1d) {
case 1:
- ent->field_0x46 += 64;
+ ent->knockbackSpeed += 64;
break;
case 2:
- ent->field_0x46 += 128;
+ ent->knockbackSpeed += 128;
break;
case 3:
- ent->field_0x46 += 192;
+ ent->knockbackSpeed += 192;
break;
}
- if (ent->field_0x46 > 0x500)
- ent->field_0x46 = 0x500;
+ if (ent->knockbackSpeed > 0x500)
+ ent->knockbackSpeed = 0x500;
p = &gUnk_08126EE4[gPlayerEntity.animationState & 0xE];
tmp_ent.x.HALF.HI = p[0] + gPlayerEntity.x.HALF.HI;
tmp_ent.y.HALF.HI = p[1] + gPlayerEntity.y.HALF.HI;
- LinearMoveDirection(ent, ent->field_0x46, GetFacingDirection(ent, &tmp_ent));
+ LinearMoveDirection(ent, ent->knockbackSpeed, GetFacingDirection(ent, &tmp_ent));
if (sub_0800419C(&tmp_ent, ent, 4, 4)) {
u32 state = ent->field_0x1c & 0xF;
if (state == 2) {
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c
index 685effd6..7b92aec0 100644
--- a/src/enemy/acroBandits.c
+++ b/src/enemy/acroBandits.c
@@ -400,7 +400,7 @@ void sub_08032008(Entity* this) {
if (this->direction & 0xf)
this->spriteSettings.flipX = (this->direction >> 4 ^ 1);
- ProcessMovement(this);
+ ProcessMovement0(this);
} else {
if (this->field_0x76.HALF.HI == 0) {
if (EntityWithinDistance(this, parent->x.HALF.HI, parent->y.HALF.HI, 1) == 0) {
@@ -457,7 +457,7 @@ void sub_08032160(Entity* this) {
}
void sub_080321E8(Entity* this) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
if (sub_080044EC(this, 0x2000) == 0)
this->action = 8;
diff --git a/src/enemy/armos.c b/src/enemy/armos.c
index 4ba4c511..df7a0705 100644
--- a/src/enemy/armos.c
+++ b/src/enemy/armos.c
@@ -331,7 +331,7 @@ void sub_080309E8(ArmosEntity* this) {
}
void sub_08030A04(ArmosEntity* this) {
- ProcessMovement(super);
+ ProcessMovement0(super);
if ((super->frame & 1) != 0) {
super->frame = super->frame & 0xfe;
EnqueueSFX(SFX_101);
diff --git a/src/enemy/ballChainSoldier.c b/src/enemy/ballChainSoldier.c
index 99a0ac81..f29df68c 100644
--- a/src/enemy/ballChainSoldier.c
+++ b/src/enemy/ballChainSoldier.c
@@ -23,15 +23,14 @@ const u8 gUnk_080D0724[];
const u16 gUnk_080D0728[];
const u16 gUnk_080D0730[];
-extern u32 sub_0804A044(Entity*, Entity*, u32);
-extern void sub_0803E86C(BallChainSoldierEntity*);
-extern void sub_0803E9A4(BallChainSoldierEntity*);
-extern bool32 sub_0803E9D4(BallChainSoldierEntity*);
-extern void sub_0803E8CC(BallChainSoldierEntity*);
-extern void sub_0803E92C(BallChainSoldierEntity*);
-extern bool32 sub_0803EA64(BallChainSoldierEntity*);
-extern void sub_0803E94C(BallChainSoldierEntity*, u32);
-extern bool32 sub_0803EAD0(BallChainSoldierEntity*, u32);
+void sub_0803E86C(BallChainSoldierEntity*);
+void sub_0803E9A4(BallChainSoldierEntity*);
+bool32 sub_0803E9D4(BallChainSoldierEntity*);
+void sub_0803E8CC(BallChainSoldierEntity*);
+void sub_0803E92C(BallChainSoldierEntity*);
+bool32 sub_0803EA64(BallChainSoldierEntity*);
+void sub_0803E94C(BallChainSoldierEntity*, u32);
+bool32 sub_0803EAD0(BallChainSoldierEntity*, u32);
void BallChainSoldier(Entity* this) {
EnemyFunctionHandler(this, (EntityActionArray)BallChainSoldier_Functions);
@@ -92,7 +91,7 @@ void sub_0803E61C(BallChainSoldierEntity* this) {
sub_0803E9A4(this);
if (sub_0803E9D4(this) == 0) {
if (super->knockbackDuration == 0) {
- if (ProcessMovement(super) == 0) {
+ if (ProcessMovement0(super) == 0) {
sub_0803E86C(this);
return;
}
diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c
index abe8f8a8..207cf1c7 100644
--- a/src/enemy/beetle.c
+++ b/src/enemy/beetle.c
@@ -8,8 +8,6 @@
#include "enemy.h"
#include "functions.h"
-extern u32 PlayerInRange(Entity*, u32, u32);
-
u32 sub_08021D00(Entity*);
void sub_08021D44(Entity* this, u32 direction);
@@ -114,7 +112,7 @@ void sub_080218CC(Entity* this) {
GetNextFrame(this);
if (this->frame & 1) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
if (sub_080044EC(this, 0x1c00) == 0)
this->frameDuration = 1;
}
@@ -184,7 +182,7 @@ void sub_08021A64(Entity* this) {
}
sub_08021D44(this, tmp);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
}
}
@@ -206,7 +204,7 @@ void sub_08021AD8(Entity* this) {
this->direction = (u8)tmp;
EnqueueSFX(SFX_PLY_JUMP);
}
- sub_080AEFE0(this);
+ ProcessMovement2(this);
if (!GravityUpdate(this, 0x1800))
this->frameDuration = 1;
}
@@ -265,7 +263,7 @@ void sub_08021B64(Entity* this) {
void sub_08021C58(Entity* this) {
GetNextFrame(this);
if (this->frame & 1) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
if (GravityUpdate(this, 0x1800) == 0)
this->frameDuration = 1;
}
diff --git a/src/enemy/bladeTrap.c b/src/enemy/bladeTrap.c
index 3af99a33..f5531def 100644
--- a/src/enemy/bladeTrap.c
+++ b/src/enemy/bladeTrap.c
@@ -10,13 +10,11 @@
#include "room.h"
#include "functions.h"
-extern void sub_080A2CC0(Entity*, void*, void*);
-
void BladeTrap(Entity* this) {
if (this->action == 0) {
this->action = 1;
this->child = GetCurrentRoomProperty(this->type);
- sub_080A2CC0(this, &this->child, &this->field_0x74);
+ sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD);
}
if (!(this->direction & 0x80)) {
LinearMoveUpdate(this);
diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c
index 03c072a4..42c3d2b1 100644
--- a/src/enemy/bobomb.c
+++ b/src/enemy/bobomb.c
@@ -11,9 +11,6 @@
#include "object.h"
#include "functions.h"
-extern void sub_08078930(Entity*);
-extern void sub_08078954(Entity*);
-
void sub_0802CB68(Entity*);
void sub_0802CBC4(Entity*);
void sub_0802CC18(Entity*);
@@ -161,7 +158,7 @@ void sub_0802C8D8(Entity* this) {
void sub_0802C91C(Entity* this) {
GetNextFrame(this);
- ProcessMovement(this);
+ ProcessMovement0(this);
if (this->field_0x82.HALF.LO) {
if (this->collisions) {
sub_0800417E(this, this->collisions);
diff --git a/src/enemy/bombarossa.c b/src/enemy/bombarossa.c
index 05784a06..f3455a21 100644
--- a/src/enemy/bombarossa.c
+++ b/src/enemy/bombarossa.c
@@ -14,8 +14,6 @@ typedef struct {
void (*const Bombarossa_Functions[])(Entity*);
const s8 gUnk_080CEB50[];
-extern void sub_080A2CC0(Entity*, void*, void*);
-
void sub_0803350C(BombarossaEntity* this);
void Bombarossa(Entity* this) {
diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c
index e6ace018..b65f1ea3 100644
--- a/src/enemy/bowMoblin.c
+++ b/src/enemy/bowMoblin.c
@@ -365,7 +365,7 @@ void sub_0803C6DC(BowMoblinEntity* this) {
super->speed = tmp;
}
- ProcessMovement(super);
+ ProcessMovement0(super);
GetNextFrame(super);
}
diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c
index 01422aff..b473854c 100644
--- a/src/enemy/businessScrub.c
+++ b/src/enemy/businessScrub.c
@@ -14,18 +14,18 @@
#include "game.h"
#include "item.h"
-bool32 sub_0802915C(Entity*);
-bool32 sub_080291DC(Entity*);
-void sub_0802922C(Entity*);
void sub_08028E9C(Entity*);
-void sub_08028FFC(Entity*);
-void sub_0802925C(Entity*);
-void sub_080290E0(Entity*, u32);
+void sub_08028EDC(Entity*);
bool32 sub_08028F98(Entity*, u32);
-void sub_08029078(Entity*);
bool32 sub_08028FDC(Entity*);
+void sub_08028FFC(Entity*);
+void sub_08029078(Entity*);
+void sub_080290E0(Entity*, u32);
void sub_080290FC(Entity*);
-void sub_08028EDC(Entity*);
+bool32 sub_0802915C(Entity*);
+bool32 sub_080291DC(Entity*);
+void sub_0802922C(Entity*);
+void sub_0802925C(Entity*);
extern const struct SalesOffering gUnk_080CC954[];
extern const u8 gUnk_080CC9C0[];
diff --git a/src/enemy/businessScrubPrologue.c b/src/enemy/businessScrubPrologue.c
index a523a27c..036c4e19 100644
--- a/src/enemy/businessScrubPrologue.c
+++ b/src/enemy/businessScrubPrologue.c
@@ -12,6 +12,7 @@ typedef struct {
u32 unk_84;
} BusinessScrubPrologueEntity;
+extern void sub_080954AC(Entity*, u32);
extern u16 script_BusinessScrubIntro[];
void (*const BusinessScrubPrologue_Functions[])(Entity*);
@@ -20,9 +21,6 @@ const u8 gUnk_080D1A38[];
const s8 gUnk_080D1A3E[];
const u16 gUnk_080D1A4E[];
-extern void sub_08095C48(Entity* this);
-extern void sub_080954AC(Entity*, u32);
-
void sub_08046030(BusinessScrubPrologueEntity*, u32);
bool32 sub_08045F54(BusinessScrubPrologueEntity*, u32);
void sub_08045FF0(BusinessScrubPrologueEntity*);
diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c
index dbbf7a77..16a61b2a 100644
--- a/src/enemy/chaser.c
+++ b/src/enemy/chaser.c
@@ -8,12 +8,7 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080012DC(Entity*);
-extern u32 sub_0804A024(Entity*, u32, u32);
-extern bool32 sub_080AF038(Entity*);
-
extern void (*const gUnk_080012C8[])(Entity*);
-
extern void (*const Chaser_Functions[])(Entity*);
extern void (*const gUnk_080CD298[])(Entity*);
@@ -54,7 +49,7 @@ void sub_0802B56C(Entity* this) {
this->speed = 0x40;
}
- if (sub_080AF038(this)) {
+ if (ProcessMovement12(this)) {
if (this->animIndex != 1) {
InitializeAnimation(this, 1);
}
diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c
index bba9b073..6b01d0a9 100644
--- a/src/enemy/chuchu.c
+++ b/src/enemy/chuchu.c
@@ -9,14 +9,6 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080012DC(Entity*);
-extern void sub_08001318(Entity*);
-extern void sub_080043A8(Entity*);
-extern u32 sub_08049F1C(Entity*, Entity*, u32);
-extern u32 PlayerInRange(Entity*, u32, u32);
-extern void sub_0804AA1C(Entity*);
-extern void sub_080AF160(Entity*);
-
extern Entity* gUnk_020000B0;
void sub_0801F328(Entity*);
@@ -200,7 +192,7 @@ void sub_0801F12C(Entity* this) {
if ((this->field_0xf++ & 7) == 0) {
this->direction = sub_08049F84(this, 1);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
if (--this->actionDelay == 0) {
if (PlayerInRange(this, 1, 0x38)) {
@@ -222,7 +214,7 @@ void sub_0801F1B0(Entity* this) {
this->hitType = 90;
EnqueueSFX(SFX_12B);
}
- sub_080AEFE0(this);
+ ProcessMovement2(this);
if (GravityUpdate(this, 0x4000) == 0)
GetNextFrame(this);
} else {
@@ -257,7 +249,7 @@ void sub_0801F270(Entity* this) {
this->direction = sub_08049F84(this, 1);
}
- sub_080AF160(this);
+ ProcessMovement5(this);
GetNextFrame(this);
if (sub_0801FBD0(this))
return;
@@ -405,7 +397,7 @@ void sub_0801F508(Entity* this) {
if (tmp == 4) {
this->direction = sub_08049F84(this, 1);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
}
}
@@ -418,7 +410,7 @@ void sub_0801F584(Entity* this) {
this->hitType = 91;
EnqueueSFX(SFX_12B);
}
- sub_080AEFE0(this);
+ ProcessMovement2(this);
if (GravityUpdate(this, 0x4000) == 0)
GetNextFrame(this);
@@ -464,7 +456,7 @@ void sub_0801F688(Entity* this) {
if (sub_0801FBD0(this) || this->field_0x82.HALF.HI) {
this->direction = sub_08049F84(this, 1);
- sub_080AF160(this);
+ ProcessMovement5(this);
GetNextFrame(this);
} else {
sub_0801F748(this);
@@ -583,7 +575,7 @@ void sub_0801F8C0(Entity* this) {
if (tmp == 4) {
this->direction = GetFacingDirection(this, gUnk_020000B0);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
}
}
@@ -595,7 +587,7 @@ void sub_0801F940(Entity* this) {
this->frame ^= 1;
EnqueueSFX(SFX_12B);
}
- sub_080AEFE0(this);
+ ProcessMovement2(this);
if (GravityUpdate(this, 0x4000) == 0)
GetNextFrame(this);
} else {
@@ -635,7 +627,7 @@ void sub_0801F9E0(Entity* this) {
void sub_0801FA30(Entity* this) {
if (sub_0801FBD0(this)) {
this->direction = sub_08049F84(this, 1);
- sub_080AF160(this);
+ ProcessMovement5(this);
GetNextFrame(this);
} else if (sub_08049FDC(this, 1) == 0) {
this->action = 9;
diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c
index ce00dd10..c910f882 100644
--- a/src/enemy/chuchuBoss.c
+++ b/src/enemy/chuchuBoss.c
@@ -6,8 +6,7 @@
*/
#include "enemy.h"
-
-void sub_08027870(Entity*);
+#include "functions.h"
extern void (*const ChuchuBoss_Functions[])(Entity*);
extern void (*const gUnk_080CC1B0[])(Entity*);
diff --git a/src/enemy/cuccoAggr.c b/src/enemy/cuccoAggr.c
index 3678b7a6..24c8555a 100644
--- a/src/enemy/cuccoAggr.c
+++ b/src/enemy/cuccoAggr.c
@@ -30,16 +30,16 @@ const u16 gUnk_080CF828[];
const s8 gCuccoAggrFxHorizontalOffsets[];
const u8 gCuccoAggrFx[];
-extern void sub_080391B4(CuccoAggrEntity* this);
-extern void sub_08039218(CuccoAggrEntity* this);
-extern void CuccoAggr_CreateFx(CuccoAggrEntity* this);
-extern void sub_08039120(CuccoAggrEntity* this);
-extern void sub_08039140(CuccoAggrEntity* this);
-extern void sub_0803901C(CuccoAggrEntity* this);
-extern void sub_08039298(CuccoAggrEntity* this);
-extern void sub_080390F8(CuccoAggrEntity* this);
-extern void sub_080390C0(CuccoAggrEntity* this);
-extern bool32 CuccoAggr_IsOutsideScroll(CuccoAggrEntity* this);
+void sub_080391B4(CuccoAggrEntity* this);
+void sub_08039218(CuccoAggrEntity* this);
+void CuccoAggr_CreateFx(CuccoAggrEntity* this);
+void sub_08039120(CuccoAggrEntity* this);
+void sub_08039140(CuccoAggrEntity* this);
+void sub_0803901C(CuccoAggrEntity* this);
+void sub_08039298(CuccoAggrEntity* this);
+void sub_080390F8(CuccoAggrEntity* this);
+void sub_080390C0(CuccoAggrEntity* this);
+bool32 CuccoAggr_IsOutsideScroll(CuccoAggrEntity* this);
void CuccoAggr(Entity* this) {
u32 index = sub_080012DC(this);
@@ -122,7 +122,7 @@ void sub_08038E18(CuccoAggrEntity* this) {
super->spritePriority.b1 = 1;
super->spritePriority.b0 = 4;
super->direction = Random() & 0x1f;
- ProcessMovement(super);
+ ProcessMovement0(super);
UpdateSpriteForCollisionLayer(super);
}
}
@@ -148,7 +148,7 @@ void sub_08038ED0(CuccoAggrEntity* this) {
}
void sub_08038EE0(CuccoAggrEntity* this) {
- ProcessMovement(super);
+ ProcessMovement0(super);
GetNextFrame(super);
sub_08039298(this);
if (GravityUpdate(super, 0x1C00) == 0) {
@@ -172,7 +172,7 @@ void sub_08038F20(CuccoAggrEntity* this) {
void sub_08038F44(CuccoAggrEntity* this) {
super->direction = GetFacingDirection(&gPlayerEntity, super);
sub_080390F8(this);
- ProcessMovement(super);
+ ProcessMovement0(super);
sub_080044EC(super, 0x1800);
GetNextFrame(super);
sub_08039298(this);
diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c
index 4ecbee1e..2099cd13 100644
--- a/src/enemy/cuccoChickAggr.c
+++ b/src/enemy/cuccoChickAggr.c
@@ -56,7 +56,7 @@ void sub_08022988(Entity* this) {
EnqueueSFX(SFX_VO_CHEEP);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
if (GravityUpdate(this, 0x2000) == 0) {
if (--this->actionDelay == 0) {
sub_08022A88(this);
@@ -92,7 +92,7 @@ void sub_08022A40(Entity* this) {
this->frameIndex = 1;
}
- ProcessMovement(this);
+ ProcessMovement0(this);
if (GravityUpdate(this, 0x2000) == 0) {
if (--this->actionDelay == 0) {
sub_08022A88(this);
diff --git a/src/enemy/curtain.c b/src/enemy/curtain.c
index 4f35dc2a..af8c22d0 100644
--- a/src/enemy/curtain.c
+++ b/src/enemy/curtain.c
@@ -13,7 +13,7 @@ void Curtain_OnTick(Entity* this) {
}
void Curtain_OnCollision(Entity* this) {
- if (this->field_0x46) {
+ if (this->knockbackSpeed != 0) {
this->action = 2;
this->flags &= ~ENT_COLLIDE;
this->spritePriority.b0 = 7;
diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c
index db9e4983..6c1b0238 100644
--- a/src/enemy/darkNut.c
+++ b/src/enemy/darkNut.c
@@ -14,26 +14,23 @@ typedef struct {
} PACKED stuct_080CAB14;
void sub_08021218(Entity*, u32, u32);
-void sub_08021588(Entity*);
-void sub_080213D0(Entity*, u32);
+void sub_0802124C(Entity*);
+u32 sub_08021274(u32, u32);
void sub_08021390(Entity*);
-void sub_0802159C(Entity*);
-void sub_0804AA1C(Entity*);
+void sub_080213B0(Entity*);
+void sub_080213D0(Entity*, u32);
void sub_080213F0(Entity*);
+void sub_08021400(Entity*);
+void sub_08021414(Entity*);
+void sub_08021424(Entity*);
u32 sub_080214FC(Entity*);
void sub_08021540(Entity*);
+void sub_08021588(Entity*);
+void sub_0802159C(Entity*);
void sub_08021600(Entity*);
-void sub_080213B0(Entity*);
-u32 PlayerInRange(Entity*, u32, u32);
-u32 sub_0802169C(Entity*, Entity*);
-void sub_0802124C(Entity*);
void sub_08021644(Entity*);
-void sub_08021414(Entity*);
-void sub_08021400(Entity*);
-u32 sub_08021274(u32, u32);
u32 sub_08021664(Entity*, Entity*);
-u32 sub_0804A044(Entity*, Entity*, u32);
-void sub_08021424(Entity*);
+u32 sub_0802169C(Entity*, Entity*);
extern Entity* gUnk_020000B0;
@@ -157,7 +154,7 @@ void sub_08020DD4(Entity* this) {
} else {
if (--this->actionDelay == 0)
sub_08021540(this);
- ProcessMovement(this);
+ ProcessMovement0(this);
UpdateAnimationSingleFrame(this);
}
}
@@ -191,7 +188,7 @@ void sub_08020E98(Entity* this) {
sub_08021218(this, 7, this->animationState);
} else {
this->direction = GetFacingDirection(gUnk_020000B0, this);
- if (ProcessMovement(this) == 0) {
+ if (ProcessMovement0(this) == 0) {
this->action = 8;
sub_08021218(this, 7, this->animationState);
} else {
@@ -205,7 +202,7 @@ void sub_08020E98(Entity* this) {
sub_08021414(this);
} else {
this->direction = GetFacingDirection(this, gUnk_020000B0);
- ProcessMovement(this);
+ ProcessMovement0(this);
sub_0802124C(this);
sub_08021644(this);
}
@@ -324,7 +321,7 @@ void sub_080210E4(Entity* this) {
}
sub_08021644(this);
- if ((this->frame & 0x10) && (!ProcessMovement(this) || (this->child && (this->child->bitfield & 0x80)))) {
+ if ((this->frame & 0x10) && (!ProcessMovement0(this) || (this->child && (this->child->bitfield & 0x80)))) {
sub_080213D0(this, 0);
} else {
if (--this->field_0x76.HWORD == 0)
@@ -519,7 +516,7 @@ void sub_08021424(Entity* this) {
sub_080212B0(this);
} else {
this->direction = CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, x, y);
- if (!ProcessMovement(this)) {
+ if (!ProcessMovement0(this)) {
sub_080212B0(this);
} else {
UpdateAnimationSingleFrame(this);
diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c
index 6b84ef18..f340affa 100644
--- a/src/enemy/doorMimic.c
+++ b/src/enemy/doorMimic.c
@@ -9,7 +9,6 @@
#include "enemy.h"
#include "functions.h"
-extern void sub_08049CF4(Entity*);
void sub_080221C0(Entity*);
typedef struct {
diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c
index 284ba85a..98f80480 100644
--- a/src/enemy/enemy50.c
+++ b/src/enemy/enemy50.c
@@ -273,7 +273,7 @@ void Enemy50_Action6(Enemy50Entity* this) {
sub_08004596(super, GetFacingDirection(super, gUnk_020000B0));
}
sub_0803F66C(this);
- sub_080AEFB4(super);
+ ProcessMovement1(super);
} else {
super->action = 7;
super->actionDelay = 0x1e;
@@ -316,7 +316,7 @@ void Enemy50_Action9(Enemy50Entity* this) {
super->animationState = 0xff;
super->iframes = -0xc;
super->knockbackDuration = 0x14;
- super->field_0x46 = 0x180;
+ super->knockbackSpeed = 0x180;
super->knockbackDirection = gPlayerEntity.animationState << 2 ^ 0x10;
sub_08041128(this);
sub_0803F6EC(this);
diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c
index 79c31cbc..5869b6f8 100644
--- a/src/enemy/eyegore.c
+++ b/src/enemy/eyegore.c
@@ -451,7 +451,7 @@ void sub_08031250(EyegoreEntity* this) {
super->y.HALF.HI = this->unk_76;
this->unk_79 = tmp2 | this->unk_79;
}
- if (((this->unk_79 & 0x80) == 0) && (ProcessMovement(super) == 0)) {
+ if (((this->unk_79 & 0x80) == 0) && (ProcessMovement0(super) == 0)) {
if ((this->unk_78 & 0x80) != 0) {
this->unk_78 = 0x82;
} else {
@@ -459,7 +459,7 @@ void sub_08031250(EyegoreEntity* this) {
}
}
} else {
- ProcessMovement(super);
+ ProcessMovement0(super);
}
}
diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c
index 5c483e4b..4928bf84 100644
--- a/src/enemy/fallingBoulder.c
+++ b/src/enemy/fallingBoulder.c
@@ -17,8 +17,6 @@ extern const u16 gUnk_080CD568[];
extern const u8 gUnk_080CD580[];
extern const s16 gUnk_080CD58C[];
-extern void sub_080AEFB4(Entity*);
-
void FallingBoulder(Entity* this) {
EnemyFunctionHandler(this, FallingBoulder_Functions);
}
@@ -115,7 +113,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E
y = gRoomControls.origin_y + gRoomControls.height - this->y.HALF.HI;
if (y >= 5) {
- sub_080AEFB4(this);
+ ProcessMovement1(this);
} else {
LinearMoveUpdate(this);
if (this->z.HALF.HI - y > 0x38) {
diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c
index df3f3686..43ceb90c 100644
--- a/src/enemy/fireballGuy.c
+++ b/src/enemy/fireballGuy.c
@@ -52,7 +52,7 @@ void sub_080453E8(Entity* this) {
}
void sub_08045430(Entity* this) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
GetNextFrame(this);
if (GravityUpdate(this, 0x1800) == 0)
sub_08045524(this);
diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c
index b9529a51..0a76c266 100644
--- a/src/enemy/flyingSkull.c
+++ b/src/enemy/flyingSkull.c
@@ -221,7 +221,7 @@ void sub_0803A080(FlyingSkullEntity* this) {
void sub_0803A09C(FlyingSkullEntity* this) {
GetNextFrame(super);
- sub_080AEFE0(super);
+ ProcessMovement2(super);
if (super->collisions) {
sub_0803A0E0(this);
diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c
index 4baf2fdf..a7870e07 100644
--- a/src/enemy/ghini.c
+++ b/src/enemy/ghini.c
@@ -231,7 +231,7 @@ void Ghini_Action6(GhiniEntity* this) {
sub_08004596(super, GetFacingDirection(super, gUnk_020000B0));
}
sub_0803F66C(this);
- sub_080AEFB4(super);
+ ProcessMovement1(super);
GetNextFrame(super);
} else {
super->action = 7;
@@ -274,7 +274,7 @@ void Ghini_Action9(GhiniEntity* this) {
super->animationState = 0xff;
super->iframes = -0xc;
super->knockbackDuration = 0x14;
- super->field_0x46 = 0x180;
+ super->knockbackSpeed = 0x180;
super->knockbackDirection = gPlayerEntity.animationState << 2 ^ 0x10;
sub_0803F51C(this);
sub_0803F6EC(this);
@@ -311,7 +311,7 @@ void sub_0803F58C(GhiniEntity* this) {
s32 yBefore;
yBefore = super->y.WORD;
- sub_080AEFB4(super);
+ ProcessMovement1(super);
yAfter = super->y.WORD;
super->y.WORD = yAfter - (yAfter - yBefore) / 2;
}
diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c
index b05ca9de..9c29dd4e 100644
--- a/src/enemy/gibdo.c
+++ b/src/enemy/gibdo.c
@@ -120,7 +120,7 @@ void sub_080375A4(GibdoEntity* this) {
sub_08037794(this);
} else {
UpdateAnimationSingleFrame(super);
- if (ProcessMovement(super) == 0) {
+ if (ProcessMovement0(super) == 0) {
if (!(--super->field_0xf)) {
sub_080379BC(this);
}
@@ -148,7 +148,7 @@ void sub_08037624(GibdoEntity* this) {
} else {
UpdateAnimationSingleFrame(super);
UpdateAnimationSingleFrame(super);
- if (ProcessMovement(super) == 0) {
+ if (ProcessMovement0(super) == 0) {
if (!(--super->field_0xf)) {
sub_080379BC(this);
}
@@ -170,7 +170,7 @@ void sub_08037690(GibdoEntity* this) {
} else {
if ((super->frame & 1) != 0) {
super->hitType = 0x27;
- ProcessMovement(super);
+ ProcessMovement0(super);
}
}
}
@@ -359,7 +359,7 @@ void sub_08037A58(GibdoEntity* this) {
super->iframes = 0xf4;
super->knockbackDirection = DirectionFromAnimationState(super->animationState) ^ 0x10;
super->knockbackDuration = 8;
- super->field_0x46 = 0x180;
+ super->knockbackSpeed = 0x180;
this->field_0x76 = 0x3c;
InitAnimationForceUpdate(super, super->animationState + 0x10);
}
@@ -370,7 +370,7 @@ void sub_08037ACC(GibdoEntity* this) {
gPlayerEntity.iframes = 0x1e;
gPlayerEntity.knockbackDirection = DirectionFromAnimationState(super->animationState);
gPlayerEntity.knockbackDuration = 4;
- gPlayerEntity.field_0x46 = 0x180;
+ gPlayerEntity.knockbackSpeed = 0x180;
}
// Damage player maybe?
diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c
index 8abdbdb3..2c593691 100644
--- a/src/enemy/helmasaur.c
+++ b/src/enemy/helmasaur.c
@@ -189,7 +189,7 @@ void sub_0802BE18(Entity* this) {
}
void sub_0802BE48(Entity* this) {
- if (!sub_080AEFE0(this)) {
+ if (!ProcessMovement2(this)) {
sub_0802C218(this);
InitScreenShake(8, 0);
} else {
@@ -208,7 +208,7 @@ void sub_0802BE80(Entity* this) {
}
if (this->speed > 0) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
sub_0802C18C(this);
} else {
sub_0802C1C0(this);
@@ -218,7 +218,7 @@ void sub_0802BE80(Entity* this) {
void sub_0802BEBC(Entity* this) {
this->direction ^= 0x10;
- sub_080AEFE0(this);
+ ProcessMovement2(this);
this->direction ^= 0x10;
if (!sub_080044EC(this, Q_16_16(0.125))) {
sub_0802C1C0(this);
@@ -240,7 +240,7 @@ void sub_0802BEEC(Entity* this) {
}
void sub_0802BF3C(Entity* this) {
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
if (--this->actionDelay == 0) {
u32 sprite;
@@ -322,7 +322,7 @@ bool32 sub_0802C06C(Entity* this) {
for (i = 0; i < 8; i++) {
x += xdiff;
y += ydiff;
- if (sub_080AE4CC(layer, x, y, 0))
+ if (IsTileCollision(layer, x, y, 0))
return FALSE;
}
@@ -342,7 +342,7 @@ bool32 sub_0802C0E8(Entity* this) {
u8* layer = this->collisionLayer == 2 ? gUnk_0200D654 : gUnk_02027EB4;
u32 ret = FALSE;
if (!sub_0806FC24(TILE(x, y), 9)) {
- if (sub_080AE4CC(layer, x, y, 0)) {
+ if (IsTileCollision(layer, x, y, 0)) {
ret = 1;
} else {
ret = 0;
diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c
index 2e13814b..340a9be5 100644
--- a/src/enemy/keaton.c
+++ b/src/enemy/keaton.c
@@ -74,7 +74,7 @@ void sub_0803248C(Entity* this) {
if (this->actionDelay == 0) {
sub_08032650(this);
}
- if (ProcessMovement(this) == 0) {
+ if (ProcessMovement0(this) == 0) {
this->actionDelay = 1;
}
UpdateAnimationSingleFrame(this);
@@ -126,7 +126,7 @@ void sub_08032574(Entity* this) {
return;
}
- if (--this->field_0x76.HWORD == 0 || !sub_080AEFE0(this)) {
+ if (--this->field_0x76.HWORD == 0 || !ProcessMovement2(this)) {
sub_0803275C(this);
return;
}
diff --git a/src/enemy/keese.c b/src/enemy/keese.c
index f555faa7..63b5b78d 100644
--- a/src/enemy/keese.c
+++ b/src/enemy/keese.c
@@ -10,7 +10,6 @@
extern void GenericKnockback2(Entity*);
extern void Keese_StartFly(Entity*);
-extern void sub_080AEFB4(Entity*);
extern void sub_08021F24(Entity*);
extern void (*const Keese_Functions[])(Entity*);
@@ -83,7 +82,7 @@ void Keese_Fly(Entity* this) {
if (this->frame & 0x80) {
sub_08021F24(this);
} else {
- sub_080AEFB4(this);
+ ProcessMovement1(this);
}
this->spriteOffsetY = gKeeseSpriteOffsets[this->frame];
}
diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c
index 837dcd39..70145906 100644
--- a/src/enemy/lakitu.c
+++ b/src/enemy/lakitu.c
@@ -271,7 +271,7 @@ void sub_0803CAD0(Entity* this) {
this->direction =
CalculateDirectionTo(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74.HWORD, this->field_0x76.HWORD);
- sub_080AEFE0(this);
+ ProcessMovement2(this);
}
}
diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c
index 48605900..dda0a902 100644
--- a/src/enemy/lakituCloud.c
+++ b/src/enemy/lakituCloud.c
@@ -13,17 +13,12 @@
#include "effects.h"
#include "enemy.h"
-extern u32 GetNextFunction(Entity*);
-
extern void (*const LakituCloud_Functions[6])(Entity*);
extern void (*const gUnk_080D0430[3])(Entity*);
extern void (*const gUnk_080D043C[3])(Entity*);
-extern void SoundReqClipped(Entity*, u32);
-extern void sub_0803CE14(Entity*);
-extern void sub_0803CE3C(Entity*);
-extern void sub_08079D84(void);
-extern void sub_080A2CC0(Entity*, Entity**, u16*);
+void sub_0803CE14(Entity*);
+void sub_0803CE3C(Entity*);
void LakituCloud(Entity* this) {
LakituCloud_Functions[GetNextFunction(this)](this);
diff --git a/src/enemy/leever.c b/src/enemy/leever.c
index 405cf0dc..776ec72b 100644
--- a/src/enemy/leever.c
+++ b/src/enemy/leever.c
@@ -180,7 +180,7 @@ void Leever_Move(Entity* this) {
}
}
- ProcessMovement(this);
+ ProcessMovement0(this);
}
// clang-format off
diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c
index 97fbdb3d..4ddac95d 100644
--- a/src/enemy/likeLike.c
+++ b/src/enemy/likeLike.c
@@ -122,7 +122,7 @@ void sub_08027EFC(Entity* this) {
this->field_0x82.HALF.LO = this->direction;
this->actionDelay = 8;
}
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
} else {
this->action = 6;
diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c
index 0ce445ff..37708cc4 100644
--- a/src/enemy/madderpillar.c
+++ b/src/enemy/madderpillar.c
@@ -450,7 +450,7 @@ void sub_0802A098(Entity* this) {
}
uVar1 = this->x.HALF.HI;
uVar2 = this->y.HALF.HI;
- ProcessMovement(this);
+ ProcessMovement0(this);
if (sub_08029F48(this)) {
sub_08029E0C(this);
sub_08029EEC(this);
diff --git a/src/enemy/miniFireballGuy.c b/src/enemy/miniFireballGuy.c
index ab5ee505..0f847151 100644
--- a/src/enemy/miniFireballGuy.c
+++ b/src/enemy/miniFireballGuy.c
@@ -48,7 +48,7 @@ void sub_08045618(Entity* this) {
}
void sub_08045654(Entity* this) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
GetNextFrame(this);
if (GravityUpdate(this, 0x1800) == 0) {
sub_08045678(this);
diff --git a/src/enemy/miniSlime.c b/src/enemy/miniSlime.c
index 7b00fe62..7c82d1d6 100644
--- a/src/enemy/miniSlime.c
+++ b/src/enemy/miniSlime.c
@@ -88,7 +88,7 @@ void sub_080452FC(Entity* this) {
}
void sub_08045374(Entity* this) {
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
if (--this->actionDelay == 0)
this->action = 1;
diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c
index a2513c45..7a5ab69c 100644
--- a/src/enemy/moldorm.c
+++ b/src/enemy/moldorm.c
@@ -101,7 +101,7 @@ void sub_08022D40(Entity* this) {
}
} else {
sub_08022F14(this);
- ProcessMovement(this);
+ ProcessMovement0(this);
if (this->collisions) {
sub_0800417E(this, this->collisions);
diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c
index d97af3f2..b6099372 100644
--- a/src/enemy/moldworm.c
+++ b/src/enemy/moldworm.c
@@ -219,7 +219,7 @@ void sub_08023398(Entity* this) {
} else {
int prevX = this->x.WORD;
int prevY = this->y.WORD;
- ProcessMovement(this);
+ ProcessMovement0(this);
if (this->x.WORD == prevX && this->y.WORD == prevY) {
this->field_0x7c.BYTES.byte0--;
}
diff --git a/src/enemy/mulldozer.c b/src/enemy/mulldozer.c
index 5c7595db..6a6a79de 100644
--- a/src/enemy/mulldozer.c
+++ b/src/enemy/mulldozer.c
@@ -159,11 +159,11 @@ void Mulldozer_Action5(MulldozerEntity* this) {
sub_080332A8(this);
}
sub_080331E8(this);
- ProcessMovement(super);
+ ProcessMovement0(super);
}
void Mulldozer_Action6(MulldozerEntity* this) {
- ProcessMovement(super);
+ ProcessMovement0(super);
sub_08032F48(this);
if (--super->field_0xf == 0) {
super->field_0xf = 2;
@@ -206,7 +206,7 @@ void sub_08032F64(MulldozerEntity* this) {
sub_08032F24(this);
}
sub_08032F48(this);
- ProcessMovement(super);
+ ProcessMovement0(super);
}
void sub_08032F90(MulldozerEntity* this) {
diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c
index f90c0fac..5ee3c12a 100644
--- a/src/enemy/octorok.c
+++ b/src/enemy/octorok.c
@@ -113,7 +113,7 @@ void Octorok_Idle(Entity* this) {
}
void Octorok_Move(Entity* this) {
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
if (--this->actionDelay == 0) {
if (Octorok_FacesPlayer(this) && gOctorokSpitChanceModifier[this->type] <= (Random() & 3)) {
diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c
index 11f58d13..9198342b 100644
--- a/src/enemy/octorokBoss.c
+++ b/src/enemy/octorokBoss.c
@@ -239,7 +239,7 @@ void OctorokBoss_Hit_SubAction1(Entity* this) {
3;
#endif
this->speed = 0x100;
- ProcessMovement(this);
+ ProcessMovement0(this);
} else {
// Freeze
if (this->type2 == 0) {
@@ -784,7 +784,7 @@ void OctorokBoss_Action1_WaitForTurn(Entity* this) {
GET_ATTACK_WAIT_TURNS(this)--;
OctorokBoss_ResetToSubAction0(this);
} else {
- if (ProcessMovement(this) == 0) {
+ if (ProcessMovement0(this) == 0) {
GET_TIMER(this) = 0;
}
}
@@ -802,7 +802,7 @@ void OctorokBoss_Action1_ChargeAttack(Entity* this) {
bool32 knockbackCondition;
if (GET_TIMER(this) == 0) {
- ProcessMovement(this);
+ ProcessMovement0(this);
knockbackCondition = 0;
if ((this->direction != 0) && (this->direction != 0x10)) {
knockbackCondition = ((u32)this->collisions & 0xee00) != 0;
@@ -812,7 +812,7 @@ void OctorokBoss_Action1_ChargeAttack(Entity* this) {
}
if (knockbackCondition != 0) {
this->knockbackDuration = 0x20;
- this->field_0x46 = 0x200;
+ this->knockbackSpeed = 0x200;
this->knockbackDirection = this->direction ^ 0x10;
GET_HELPER(this)->fallingStonesTimer += 0x3c;
OctorokBoss_SetAttackTimer(this);
@@ -1068,7 +1068,7 @@ void OctorokBoss_Burning_SubAction0(Entity* this) {
}
void OctorokBoss_Burning_SubAction1(Entity* this) {
- ProcessMovement(this);
+ ProcessMovement0(this);
if (this->collisions != 0) {
this->subAction = 2;
GET_HELPER(this)->targetAngle = GET_ANGLE_HI(this);
@@ -1079,7 +1079,7 @@ void OctorokBoss_Burning_SubAction1(Entity* this) {
GET_HELPER(this)->targetAngle = -GET_HELPER(this)->targetAngle ^ 0x80;
}
this->knockbackDuration = 0x18;
- this->field_0x46 = 0x200;
+ this->knockbackSpeed = 0x200;
this->knockbackDirection = this->direction ^ 0x10;
GET_HELPER(this)->fallingStonesTimer += 0x1e;
InitScreenShake(0x1e, 0);
@@ -1099,7 +1099,7 @@ void OctorokBoss_Burning_SubAction2(Entity* this) {
this->subAction = 1;
this->direction = ((u8)-GET_ANGLE_HI(this) ^ 0x80) >> 3;
this->collisions = 0;
- ProcessMovement(this);
+ ProcessMovement0(this);
} else {
if ((u8)(GET_HELPER(this)->targetAngle - GET_ANGLE_HI(this)) >= 0x81) {
GET_ANGLE(this) -= GET_ANGULAR_VEL(this);
diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c
index ab16e2fb..8f72e7a7 100644
--- a/src/enemy/octorokGolden.c
+++ b/src/enemy/octorokGolden.c
@@ -64,7 +64,7 @@ void sub_08037D0C(Entity* this) {
}
UpdateAnimationVariableFrames(this, 2);
- if (ProcessMovement(this) == 0) {
+ if (ProcessMovement0(this) == 0) {
sub_08037E14(this);
} else if (--this->actionDelay == 0) {
sub_08037E14(this);
@@ -116,7 +116,7 @@ void sub_08037E14(Entity* this) {
ptr = gUnk_080CF498 + (dir >> 2);
x = this->x.HALF.HI + *ptr;
y = this->y.HALF.HI + *(ptr + 1);
- if (sub_080AE4CC(layer, x, y, 0)) {
+ if (IsTileCollision(layer, x, y, 0)) {
this->direction = Random() & 0x18;
} else {
this->direction = dir;
diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c
index b3d20e85..3f85d704 100644
--- a/src/enemy/peahat.c
+++ b/src/enemy/peahat.c
@@ -171,7 +171,7 @@ void Peahat_Fly(Entity* this) {
}
}
- sub_080AEFE0(this);
+ ProcessMovement2(this);
GetNextFrame(this);
}
@@ -205,7 +205,7 @@ void Peahat_ChargeTarget(Entity* this) {
if ((gRoomTransition.frameCount & 3) == 0)
sub_08004596(this, GetFacingDirection(this, gUnk_020000B0));
}
- sub_080AEFE0(this);
+ ProcessMovement2(this);
} else {
sub_080205F8(this);
}
@@ -223,7 +223,7 @@ void Peahat_ChargeEnd(Entity* this) {
if (this->actionDelay & 1)
this->speed -= 8;
- sub_080AEFE0(this);
+ ProcessMovement2(this);
UpdateAnimationVariableFrames(this, 4);
}
}
@@ -241,7 +241,7 @@ void Peahat_Stunned(Entity* this) {
if (this->direction == 0xff)
this->direction = this->knockbackDirection;
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
break;
case PeahatAnimation_SlicedPropeller:
@@ -307,7 +307,7 @@ void Peahat_Hop(Entity* this) {
if (this->frame & 1) {
sub_0800442E(this);
} else {
- ProcessMovement(this);
+ ProcessMovement0(this);
}
}
@@ -324,7 +324,7 @@ void Peahat_Takeoff(Entity* this) {
sub_0800442E(this);
} else {
GravityUpdate(this, 0x1c00);
- ProcessMovement(this);
+ ProcessMovement0(this);
}
}
diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c
index 26439e36..9fa20418 100644
--- a/src/enemy/pesto.c
+++ b/src/enemy/pesto.c
@@ -548,7 +548,7 @@ void sub_08024940(Entity* this) {
}
}
- sub_080AEFB4(this);
+ ProcessMovement1(this);
GetNextFrame(this);
}
diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c
index f5b8b158..54e0f92d 100644
--- a/src/enemy/puffstool.c
+++ b/src/enemy/puffstool.c
@@ -582,7 +582,7 @@ void sub_08025C2C(Entity* this) {
bool32 sub_08025C44(Entity* this) {
if ((this->frame & 1) == 0) {
- return ProcessMovement(this);
+ return ProcessMovement0(this);
} else {
return FALSE;
}
diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c
index a1508d95..d8707764 100644
--- a/src/enemy/rockChuchu.c
+++ b/src/enemy/rockChuchu.c
@@ -87,7 +87,7 @@ void sub_08022390(Entity* this) {
}
if (this->field_0xf == 0) {
- ProcessMovement(this);
+ ProcessMovement0(this);
} else {
this->field_0xf = this->field_0xf - 1;
}
diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c
index 4db8a577..d0d22bc9 100644
--- a/src/enemy/rollobite.c
+++ b/src/enemy/rollobite.c
@@ -21,7 +21,6 @@ void sub_08020A7C(Entity*);
bool32 Rollobite_TryToHoleUp(Entity*);
bool32 Rollobite_IsRolledUp(Entity*);
-extern void sub_080AE7E8(Entity*, u32, u32, u32);
extern void sub_08078930(Entity*);
void Rollobite(Entity* this) {
@@ -61,8 +60,8 @@ void Rollobite_OnKnockback(Entity* this) {
this->knockbackDuration = 0;
} else if (Rollobite_IsRolledUp(this)) {
this->knockbackDuration--;
- sub_080AE58C(this, this->knockbackDirection, 10);
- sub_080AE7E8(this, this->field_0x46, this->knockbackDirection, 10);
+ CalculateEntityTileCollisions(this, this->knockbackDirection, 10);
+ ProcessMovementInternal(this, this->knockbackSpeed, this->knockbackDirection, 10);
} else {
GenericKnockback(this);
}
@@ -124,7 +123,7 @@ void Rollobite_Walk(Entity* this) {
GetNextFrame(this);
if (this->frame & 0x1) {
this->frame &= ~0x1;
- if (!ProcessMovement(this))
+ if (!ProcessMovement0(this))
this->actionDelay = 1;
}
@@ -192,7 +191,7 @@ void Rollobite_RolledUp(Entity* this) {
EnqueueSFX(SFX_104);
if ((this->direction & 0x80) == 0)
- sub_080AEFE0(this);
+ ProcessMovement2(this);
}
}
diff --git a/src/enemy/rope.c b/src/enemy/rope.c
index c5caac37..a26c1088 100644
--- a/src/enemy/rope.c
+++ b/src/enemy/rope.c
@@ -180,5 +180,5 @@ u32 sub_0803163C(Entity* this) {
h = this->field_0x7a.HWORD;
}
this->speed = h;
- return ProcessMovement(this);
+ return ProcessMovement0(this);
}
diff --git a/src/enemy/ropeGolden.c b/src/enemy/ropeGolden.c
index 881d1e36..ca3a57c7 100644
--- a/src/enemy/ropeGolden.c
+++ b/src/enemy/ropeGolden.c
@@ -69,7 +69,7 @@ void sub_0803827C(Entity* this) {
}
}
UpdateAnimationVariableFrames(this, 0x2);
- if (ProcessMovement(this) == 0) {
+ if (ProcessMovement0(this) == 0) {
sub_080383AC(this);
} else {
if (!(--this->actionDelay)) {
diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c
index c285f0c0..2ae953e7 100644
--- a/src/enemy/rupeeLike.c
+++ b/src/enemy/rupeeLike.c
@@ -145,7 +145,7 @@ void sub_080294D4(Entity* this) {
sub_08004596(this, GetFacingDirection(this, &gPlayerEntity));
sub_0802969C(this);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
sub_080296C8(this);
} else {
this->action = 6;
diff --git a/src/enemy/scissorsBeetle.c b/src/enemy/scissorsBeetle.c
index 9c78d925..41f84df0 100644
--- a/src/enemy/scissorsBeetle.c
+++ b/src/enemy/scissorsBeetle.c
@@ -155,7 +155,7 @@ void sub_08038B08(ScissorsBeetleEntity* this) {
}
void sub_08038B64(ScissorsBeetleEntity* this) {
- ProcessMovement(super);
+ ProcessMovement0(super);
UpdateAnimationSingleFrame(super);
if (--super->field_0xf == 0) {
super->field_0xf = 2;
@@ -165,7 +165,7 @@ void sub_08038B64(ScissorsBeetleEntity* this) {
void sub_08038B90(ScissorsBeetleEntity* this) {
UpdateAnimationSingleFrame(super);
- ProcessMovement(super);
+ ProcessMovement0(super);
sub_0800445C(super);
}
diff --git a/src/enemy/sensorBladeTrap.c b/src/enemy/sensorBladeTrap.c
index d3e28c2f..7ca53a62 100644
--- a/src/enemy/sensorBladeTrap.c
+++ b/src/enemy/sensorBladeTrap.c
@@ -9,7 +9,6 @@
#include "functions.h"
extern u32 sub_0804A024(Entity*, u32, u32);
-extern bool32 sub_080AF038(Entity*);
extern u8 gUnk_02027EB4[];
extern u8 gUnk_0200D654[];
@@ -61,7 +60,7 @@ void sub_0802BA18(Entity* this) {
}
void sub_0802BA8C(Entity* this) {
- if (!sub_080AF038(this)) {
+ if (!ProcessMovement12(this)) {
sub_0802BB10(this);
} else {
switch (this->direction >> 3) {
@@ -86,7 +85,7 @@ void sub_0802BA8C(Entity* this) {
}
void sub_0802BAFC(Entity* this) {
- if (!sub_080AF038(this)) {
+ if (!ProcessMovement12(this)) {
this->action = 1;
}
}
@@ -101,7 +100,7 @@ void sub_0802BB10(Entity* this) {
bool32 sub_0802BB2C(Entity* this, u32 param_2) {
u8* layer = this->collisionLayer == 2 ? gUnk_0200D654 : gUnk_02027EB4;
const s8* ptr = &gUnk_080CD3DC[param_2 >> 2];
- return sub_080AE4CC(layer, this->x.HALF.HI + ptr[0], this->y.HALF.HI + ptr[1], 0);
+ return IsTileCollision(layer, this->x.HALF.HI + ptr[0], this->y.HALF.HI + ptr[1], 0);
}
// clang-format off
diff --git a/src/enemy/slime.c b/src/enemy/slime.c
index b496288d..7857c3d6 100644
--- a/src/enemy/slime.c
+++ b/src/enemy/slime.c
@@ -78,7 +78,7 @@ void sub_08045018(Entity* this) {
}
void sub_08045088(Entity* this) {
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
if (--this->actionDelay == 0) {
this->action = 1;
diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c
index 460da1b8..e6b5eb87 100644
--- a/src/enemy/sluggula.c
+++ b/src/enemy/sluggula.c
@@ -76,7 +76,7 @@ void sub_08023C5C(Entity* this) {
}
void sub_08023C8C(Entity* this) {
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
sub_08023E54(this);
if (--this->actionDelay == 0) {
diff --git a/src/enemy/spark.c b/src/enemy/spark.c
index 7f467944..f6f9325d 100644
--- a/src/enemy/spark.c
+++ b/src/enemy/spark.c
@@ -55,7 +55,7 @@ void sub_0802B35C(Entity* this) {
bool32 is_head;
GetNextFrame(this);
- ProcessMovement(this);
+ ProcessMovement0(this);
is_head = this->type == 0;
if (this->collisions == 0) {
if (--this->field_0xf == 0) {
diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c
index 6c3110cb..a402319a 100644
--- a/src/enemy/spearMoblin.c
+++ b/src/enemy/spearMoblin.c
@@ -235,7 +235,7 @@ void sub_08028528(Entity* this) {
}
if (0x20 < this->field_0x7a.HALF.HI) {
- ProcessMovement(this);
+ ProcessMovement0(this);
}
GetNextFrame(this);
@@ -370,7 +370,7 @@ void sub_08028858(Entity* this) {
this->speed = 0;
}
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
}
@@ -383,7 +383,7 @@ void sub_080288C0(Entity* this) {
if (ent && (ent->bitfield & 0x80)) {
this->knockbackDirection = ent->knockbackDirection;
this->iframes = -ent->iframes;
- this->field_0x46 = ent->field_0x46;
+ this->knockbackSpeed = ent->knockbackSpeed;
this->knockbackDuration = ent->knockbackDuration;
ent->knockbackDuration = 0;
}
diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c
index 8b10fb17..e0dedef5 100644
--- a/src/enemy/spikedBeetle.c
+++ b/src/enemy/spikedBeetle.c
@@ -94,7 +94,7 @@ void sub_0802B744(Entity* this) {
this->action = 2;
this->actionDelay = 0x1e;
} else {
- if (!ProcessMovement(this)) {
+ if (!ProcessMovement0(this)) {
this->actionDelay = 1;
}
}
@@ -127,7 +127,7 @@ void sub_0802B7FC(Entity* this) {
}
void sub_0802B820(Entity* this) {
- if (!sub_080AEFE0(this)) {
+ if (!ProcessMovement2(this)) {
this->actionDelay = 1;
}
GetNextFrame(this);
@@ -152,7 +152,7 @@ void sub_0802B880(Entity* this) {
}
void sub_0802B8B0(Entity* this) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
switch (sub_080044EC(this, 0x1800)) {
case 0:
this->action = 7;
diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c
index 3c5fcbcc..1049ffa4 100644
--- a/src/enemy/spinyBeetle.c
+++ b/src/enemy/spinyBeetle.c
@@ -325,7 +325,7 @@ void sub_08033D78(SpinyBeetleEntity* this) {
break;
default:
if (sub_080002E0(tile, super->collisionLayer) - 1 > 0x3e)
- ProcessMovement(super);
+ ProcessMovement0(super);
break;
}
}
diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c
index 27a07827..5fad3258 100644
--- a/src/enemy/spinyChuchu.c
+++ b/src/enemy/spinyChuchu.c
@@ -175,7 +175,7 @@ void sub_080226EC(Entity* this) {
this->direction = sub_08049F84(this, 1);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
}
GetNextFrame(this);
@@ -224,7 +224,7 @@ void sub_0802281C(Entity* this) {
void sub_08022854(Entity* this) {
GetNextFrame(this);
if (this->frame & 1) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
if (GravityUpdate(this, Q_8_8(24.0)) == 0) {
this->action = 7;
this->hitType = 0x5c;
diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c
index 2e6205d8..2751cd5b 100644
--- a/src/enemy/stalfos.c
+++ b/src/enemy/stalfos.c
@@ -188,7 +188,7 @@ void Stalfos_Action2(StalfosEntity* this) {
void Stalfos_Action3(StalfosEntity* this) {
if (sub_08039758(this) == 0) {
- if (ProcessMovement(super)) {
+ if (ProcessMovement0(super)) {
UpdateAnimationSingleFrame(super);
if (--this->unk_78 == 0) {
sub_0803998C(this);
@@ -201,7 +201,7 @@ void Stalfos_Action3(StalfosEntity* this) {
}
void Stalfos_Action4(StalfosEntity* this) {
- sub_080AEFE0(super);
+ ProcessMovement2(super);
if (GravityUpdate(super, 0x1800) == 0) {
sub_0803998C(this);
this->unk_7c = 0x5a;
@@ -210,7 +210,7 @@ void Stalfos_Action4(StalfosEntity* this) {
}
void Stalfos_Action5(StalfosEntity* this) {
- sub_080AEFE0(super);
+ ProcessMovement2(super);
GravityUpdate(super, 0x1800);
if (super->zVelocity < 0) {
super->action = 6;
@@ -260,7 +260,7 @@ void Stalfos_Action9(StalfosEntity* this) {
}
void Stalfos_Action11(StalfosEntity* this) {
- sub_080AEFE0(super);
+ ProcessMovement2(super);
UpdateAnimationSingleFrame(super);
if (--this->unk_78 == 0) {
sub_08039AD4(this);
@@ -365,7 +365,7 @@ void sub_0803992C(StalfosEntity* this) {
super->speed = 0xe0;
super->direction = super->animationState << 3;
this->unk_78 = (u16)gUnk_080CF900[Random() & 0xf];
- sub_080AE58C(super, super->direction, 0);
+ CalculateEntityTileCollisions(super, super->direction, 0);
if ((gUnk_080CF910[super->animationState] & super->collisions) != 0) {
InitAnimationForceUpdate(super, super->animationState);
} else {
diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c
index c833daa1..67fb91a6 100644
--- a/src/enemy/tektite.c
+++ b/src/enemy/tektite.c
@@ -116,7 +116,7 @@ void sub_0802F300(Entity* this) {
u32 rand;
GetNextFrame(this);
- ProcessMovement(this);
+ ProcessMovement0(this);
temp = this->z.HALF.HI;
rand = Random() & 0xf;
diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c
index 2fd5458f..22d7c260 100644
--- a/src/enemy/tektiteGolden.c
+++ b/src/enemy/tektiteGolden.c
@@ -104,7 +104,7 @@ void sub_08038048(Entity* this) {
u32 rand;
UpdateAnimationVariableFrames(this, 2);
- ProcessMovement(this);
+ ProcessMovement0(this);
temp = this->z.HALF.HI;
rand = Random() & 0xf;
diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c
index 4ced8ccc..d58da091 100644
--- a/src/enemy/vaatiArm.c
+++ b/src/enemy/vaatiArm.c
@@ -698,7 +698,7 @@ void sub_08042EF4(Entity* this) {
}
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
entity->direction = this->direction;
- ProcessMovement(entity);
+ ProcessMovement0(entity);
}
}
diff --git a/src/enemy/vaatiEyesMacro.c b/src/enemy/vaatiEyesMacro.c
index 8a6a8c31..7d84c1a5 100644
--- a/src/enemy/vaatiEyesMacro.c
+++ b/src/enemy/vaatiEyesMacro.c
@@ -246,7 +246,7 @@ void sub_0802F04C(Entity* this) {
oldX = this->x.HALF.HI;
oldY = this->y.HALF.HI;
- if (ProcessMovement(this) == 0) {
+ if (ProcessMovement0(this) == 0) {
sub_0802EFB8(this);
return;
}
diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c
index d810aa25..a84dfcbc 100644
--- a/src/enemy/vaatiRebornEnemy.c
+++ b/src/enemy/vaatiRebornEnemy.c
@@ -9,8 +9,6 @@
#include "area.h"
#include "functions.h"
-extern void sub_080AEFB4(Entity*);
-
void VaatiRebornEnemyType0PreAction(Entity*);
void VaatiRebornEnemyType1PreAction(Entity*);
void VaatiRebornEnemyType0Action0(Entity*);
@@ -218,7 +216,7 @@ void VaatiRebornEnemyType0Action1(Entity* this) {
this->y.HALF.HI--;
}
}
- sub_080AEFB4(this);
+ ProcessMovement1(this);
}
}
UpdateAnimationSingleFrame(this);
@@ -416,7 +414,7 @@ void VaatiRebornEnemyType0Action5(Entity* this) {
}
if (this->field_0x86.HALF.HI != 0) {
- sub_080AEFB4(this);
+ ProcessMovement1(this);
}
UpdateAnimationSingleFrame(this);
}
diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c
index a9abc3d9..6de1a8ae 100644
--- a/src/enemy/vaatiTransfigured.c
+++ b/src/enemy/vaatiTransfigured.c
@@ -249,7 +249,7 @@ void VaatiTransfiguredType0Action1(Entity* this) {
}
}
if (this->field_0x80.HALF.LO != 0xff) {
- ProcessMovement(this);
+ ProcessMovement0(this);
}
UpdateAnimationSingleFrame(this);
}
diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c
index 5ad9dd16..38115022 100644
--- a/src/enemy/vaatiWrath.c
+++ b/src/enemy/vaatiWrath.c
@@ -248,7 +248,7 @@ void VaatiWrathType0Action3(Entity* this) {
sub_08042004(this);
UpdateAnimationSingleFrame(this);
- ProcessMovement(this);
+ ProcessMovement0(this);
roomY = gRoomControls.origin_y;
bound = roomY + 0x90;
diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c
index 540ad1f9..94943d52 100644
--- a/src/enemy/wisp.c
+++ b/src/enemy/wisp.c
@@ -105,7 +105,7 @@ void sub_080336A8(Entity* this) {
} else if (this->collisions != 0) {
sub_0800417E(this, this->collisions);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
GetNextFrame(this);
}
diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c
index 68c883d9..adb291e6 100644
--- a/src/enemy/wizzrobeWind.c
+++ b/src/enemy/wizzrobeWind.c
@@ -261,7 +261,7 @@ void sub_0802F9C8(WizzrobeEntity* this) {
}
} else {
if (super->type2 != 0) {
- ProcessMovement(super);
+ ProcessMovement0(super);
if (super->collisions != 0) {
super->flags &= 0x7f;
this->timer1 = 0x28;
diff --git a/src/movement.c b/src/movement.c
index 36d2fd2a..afe81525 100644
--- a/src/movement.c
+++ b/src/movement.c
@@ -6,7 +6,7 @@
#include "asm.h"
#include "item.h"
#include "coord.h"
-#include "coord.h"
+#include "functions.h"
/** Collisions. */
typedef enum {
@@ -29,245 +29,1781 @@ typedef enum {
COL_EAST_ANY = 0xe000,
} Collisions;
-extern u8* GetLayerByIndex(u32);
-
extern u8 gExitList_RoyalValley_ForestMaze[];
extern u8 gUnk_08135190[];
extern u8 gUnk_08134FBC[];
extern u8 gUnk_08135048[];
extern u8 gUnk_0813A76C[];
-extern const u16 gUnk_08133918[];
-extern const u16 gUnk_08133938[];
-extern const u16 gUnk_08133958[];
-extern const u16 gUnk_08133978[];
-extern const u16 gUnk_08133998[];
-extern const u16 gUnk_081339B8[];
-extern const u16 gUnk_081339D8[];
-extern const u16 gUnk_081339F8[];
-extern u32 (*const gUnk_08133A18[])(u32, u32);
-extern const u8 gUnk_08133A40[];
-extern const u8 gUnk_08133A5A[];
-extern const u8 gUnk_08133A67[];
-extern u32 (*const gUnk_08133F48[])(Entity*, u32, u32, u32);
-
-u32 sub_080AE4CC(u8*, s32, s32, s32);
-void sub_080AE58C(Entity*, u32, u32);
-u32 sub_080AE7E8(Entity*, u32, s32, s32);
+bool32 IsTileCollision(u8*, s32, s32, u32);
+void CalculateEntityTileCollisions(Entity*, u32, u32);
+bool32 ProcessMovementInternal(Entity*, s32, s32, u32);
bool32 sub_080AF0C8(Entity*);
-u32 sub_080AE3E4(void) {
- return 0;
+/** The type of the movement/collision? that is done. */
+typedef enum {
+ CollisionType0, // Normal/common? Used by most enemies and NPCs.
+ CollisionType1, // chaser, enemy50, fallingBoulder, ghini, keese, pesto, sensorBladeTrap, vaatiRebornEnemy,
+ // playerItem10, playerItem13
+ CollisionType2, // acroBandits, beetle, chuchu, fireballGuy, flyingSkull, helmasaur, keaton, lakitu,
+ // miniFireballGuy, peahat, rollobite, spikedBeetle, spinyChuchu, stalfos, itemOnGround,
+ // smallIceBlock, flyingPot, object1F
+ CollisionType3, // arrowProjectile, boneProjectile, cannonballProjectile, deekuSeedProjectile, fireProjectile,
+ // gyorgMaleEnergyProjectile, iceProjectile, lakituLightning, mandiblesProjectile, rockProjectile,
+ // spikedRollers, torchTrapProjectile, v2Projectile, v3ElectricProjectile, v3HandProjectile,
+ // v3TennisBallProjectile, windProjectile
+ CollisionType4, // lilypadLarge
+ CollisionType5, // chuchu
+ CollisionType6, // npc5
+ CollisionType7, // not used?
+ CollisionType8, // not used?
+ CollisionType9, // not used?
+ CollisionType10, // playerItem13, rollobite
+ CollisionType11, // not used?
+ CollisionType12, // chaser, sensorBladeTrap
+} CollisionType;
+
+/** The collision function that is evaluated for a tile depending on the x/y position of the entity in the tile. */
+typedef enum {
+ FilledNone = 0,
+ FilledAll = 1,
+ FilledNorthWest = 2,
+ FilledNorthEast = 3,
+ FilledSouthWest = 4,
+ FilledSouthEast = 5,
+ FilledSouth = 6,
+ FilledNorth = 7,
+ FilledWest = 8,
+ FilledEast = 9
+} TileFilled;
+
+bool32 MoveNorth(Entity*, s32, s32, u32);
+bool32 MoveNorthEast(Entity*, s32, s32, u32);
+bool32 MoveEast(Entity*, s32, s32, u32);
+bool32 MoveSouthEast(Entity*, s32, s32, u32);
+bool32 MoveSouth(Entity*, s32, s32, u32);
+bool32 MoveSouthWest(Entity*, s32, s32, u32);
+bool32 MoveWest(Entity*, s32, s32, u32);
+bool32 MoveNorthWest(Entity*, s32, s32, u32);
+
+/** Empty */
+bool32 TileCollisionFunction0(s32 x, s32 y) {
+ return FALSE;
}
-u32 sub_080AE3E8(void) {
- return 1;
+/** Fully filled */
+bool32 TileCollisionFunction1(s32 x, s32 y) {
+ return TRUE;
}
-u32 sub_080AE3EC(u32 param_1, u32 param_2) {
- return gUnk_08133918[param_2 & 0xf] >> (param_1 & 0xf) & 1;
+/** Diagonal North West filled*/
+bool32 TileCollisionFunction2(s32 x, s32 y) {
+ static const u16 gUnk_08133918[] = {
+ /*
+ 0b1000000000000000,
+ 0b1100000000000000,
+ 0b1110000000000000,
+ 0b1111000000000000,
+ 0b1111100000000000,
+ 0b1111110000000000,
+ 0b1111111000000000,
+ 0b1111111100000000,
+ 0b1111111110000000,
+ 0b1111111111000000,
+ 0b1111111111100000,
+ 0b1111111111110000,
+ 0b1111111111111000,
+ 0b1111111111111100,
+ 0b1111111111111110,
+ 0b1111111111111111,
+ */
+ 32768, 49152, 57344, 61440, 63488, 64512, 65024, 65280, 65408, 65472, 65504, 65520, 65528, 65532, 65534, 65535,
+ };
+
+ return gUnk_08133918[y & 0xf] >> (x & 0xf) & 1;
}
-u32 sub_080AE408(u32 param_1, u32 param_2) {
- return gUnk_08133938[param_2 & 0xf] >> (param_1 & 0xf) & 1;
+/** Diagonal North East filled*/
+bool32 TileCollisionFunction3(s32 x, s32 y) {
+ static const u16 gUnk_08133938[] = {
+ /*
+ 0b1,
+ 0b11,
+ 0b111,
+ 0b1111,
+ 0b11111,
+ 0b111111,
+ 0b1111111,
+ 0b11111111,
+ 0b111111111,
+ 0b1111111111,
+ 0b11111111111,
+ 0b111111111111,
+ 0b1111111111111,
+ 0b11111111111111,
+ 0b111111111111111,
+ 0b1111111111111111,
+ */
+ 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535,
+ };
+ return gUnk_08133938[y & 0xf] >> (x & 0xf) & 1;
}
-u32 sub_080AE424(u32 param_1, u32 param_2) {
- return gUnk_08133958[param_2 & 0xf] >> (param_1 & 0xf) & 1;
+/** Diagonal South West filled*/
+bool32 TileCollisionFunction4(s32 x, s32 y) {
+ static const u16 gUnk_08133958[] = {
+ /*
+ 0b1111111111111111,
+ 0b1111111111111110,
+ 0b1111111111111100,
+ 0b1111111111111000,
+ 0b1111111111110000,
+ 0b1111111111100000,
+ 0b1111111111000000,
+ 0b1111111110000000,
+ 0b1111111100000000,
+ 0b1111111000000000,
+ 0b1111110000000000,
+ 0b1111100000000000,
+ 0b1111000000000000,
+ 0b1110000000000000,
+ 0b1100000000000000,
+ 0b1000000000000000,
+ */
+ 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768,
+ };
+ return gUnk_08133958[y & 0xf] >> (x & 0xf) & 1;
}
-u32 sub_080AE440(u32 param_1, u32 param_2) {
- return gUnk_08133978[param_2 & 0xf] >> (param_1 & 0xf) & 1;
+/** Diagonal South East filled*/
+bool32 TileCollisionFunction5(s32 x, s32 y) {
+ static const u16 gUnk_08133978[] = {
+ /*
+ 0b1111111111111111,
+ 0b111111111111111,
+ 0b11111111111111,
+ 0b1111111111111,
+ 0b111111111111,
+ 0b11111111111,
+ 0b1111111111,
+ 0b111111111,
+ 0b11111111,
+ 0b1111111,
+ 0b111111,
+ 0b11111,
+ 0b1111,
+ 0b111,
+ 0b11,
+ 0b1,
+ */
+ 65535, 32767, 16383, 8191, 4095, 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1,
+ };
+ return gUnk_08133978[y & 0xf] >> (x & 0xf) & 1;
}
-u32 sub_080AE45C(u32 param_1, u32 param_2) {
- return gUnk_08133998[param_2 & 0xf] >> (param_1 & 0xf) & 1;
+/** 3/8 South filled */
+bool32 TileCollisionFunction6(s32 x, s32 y) {
+ static const u16 gUnk_08133998[] = {
+ /*
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b0,
+ 0b0,
+ 0b0,
+ 0b0,
+ 0b0,
+ 0b0,
+ */
+ 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 0, 0, 0, 0, 0, 0,
+ };
+
+ return gUnk_08133998[y & 0xf] >> (x & 0xf) & 1;
}
-u32 sub_080AE478(u32 param_1, u32 param_2) {
- return gUnk_081339B8[param_2 & 0xf] >> (param_1 & 0xf) & 1;
+/** 3/8 North filled */
+bool32 TileCollisionFunction7(s32 x, s32 y) {
+ static const u16 gUnk_081339B8[] = {
+ /*
+ 0b0,
+ 0b0,
+ 0b0,
+ 0b0,
+ 0b0,
+ 0b0,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ 0b1111111111111111,
+ */
+ 0, 0, 0, 0, 0, 0, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535,
+ };
+ return gUnk_081339B8[y & 0xf] >> (x & 0xf) & 1;
}
-u32 sub_080AE494(u32 param_1, u32 param_2) {
- return gUnk_081339D8[param_2 & 0xf] >> (param_1 & 0xf) & 1;
+/** 3/8 West filled */
+bool32 TileCollisionFunction8(s32 x, s32 y) {
+ static const u16 gUnk_081339D8[] = {
+ /*
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ 0b1111111111000000,
+ */
+ 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472, 65472,
+ };
+ return gUnk_081339D8[y & 0xf] >> (x & 0xf) & 1;
}
-u32 sub_080AE4B0(u32 param_1, u32 param_2) {
- return gUnk_081339F8[param_2 & 0xf] >> (param_1 & 0xf) & 1;
+/** 3/8 East filled */
+bool32 TileCollisionFunction9(s32 x, s32 y) {
+ static const u16 gUnk_081339F8[] = {
+ /*
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ 0b1111111111,
+ */
+ 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,
+ };
+ return gUnk_081339F8[y & 0xf] >> (x & 0xf) & 1;
}
-bool32 sub_080AE4CC(u8* layer, s32 param_2, s32 param_3, s32 param_4) {
- u32 tmp = layer[TILE(param_2, param_3)];
- if (tmp == 0) {
- if (param_4 == 4) {
+bool32 IsTileCollision(u8* layer, s32 x, s32 y, u32 collisionType) {
+ static bool32 (*const tileCollisionFunctions[])(s32, s32) = {
+ TileCollisionFunction0, TileCollisionFunction1, TileCollisionFunction2, TileCollisionFunction3,
+ TileCollisionFunction4, TileCollisionFunction5, TileCollisionFunction6, TileCollisionFunction7,
+ TileCollisionFunction8, TileCollisionFunction9,
+ };
+
+ u32 tileType = layer[TILE(x, y)];
+ if (tileType == 0) {
+ if (collisionType == 4) {
return TRUE;
} else {
return FALSE;
}
} else {
- if (tmp <= 0xf) {
+ if (tileType < 0x10) {
+ static const u8 collisionLookup[] = {
+ 0xff, FilledAll, FilledNone, FilledNone, 0xff, FilledAll, FilledNone, FilledAll, FilledAll,
+ FilledAll, 0xff, FilledAll, 0xff, FilledAll, FilledAll, FilledAll, FilledAll, FilledAll,
+ FilledNone, FilledAll, 0xff, FilledAll, FilledAll, FilledAll, 0xff, FilledAll,
+ };
- if (gUnk_08133A40[param_4 * 2 + ((tmp + 1) >> 4)] == 0) {
+ if (collisionLookup[collisionType * 2 + ((tileType + 1) >> 4)] == FilledNone) {
return FALSE;
}
- if (gUnk_08133A40[param_4 * 2 + ((tmp + 1) >> 4)] == 1) {
+ if (collisionLookup[collisionType * 2 + ((tileType + 1) >> 4)] == FilledAll) {
return TRUE;
}
- if ((param_3 & 8) == 0) {
- tmp = (u32)(layer[TILE(param_2, param_3)]);
- tmp >>= 2;
+ // Calculation for 0xff in previous lookup.
+ if ((y & 8) == 0) {
+ tileType = layer[TILE(x, y)];
+ tileType >>= 2;
}
- if ((param_2 & 8) == 0) {
- tmp >>= 1;
+ if ((x & 8) == 0) {
+ tileType >>= 1;
}
- return tmp & 1;
-
+ return tileType & 1;
} else {
- if (tmp == 0xff) {
- return gUnk_08133A18[gUnk_08133A5A[param_4]](param_2, param_3);
+ if (tileType == 0xff) {
+ static const u8 collisionFunctionLookup[] = {
+ FilledAll, FilledAll, FilledAll, FilledNone, FilledAll, FilledAll, FilledAll,
+ FilledAll, FilledAll, FilledAll, FilledAll, FilledAll, FilledAll,
+ };
+ return tileCollisionFunctions[collisionFunctionLookup[collisionType]](x, y);
} else {
- if (tmp > 0x6f) {
+ static const u8 collisionFunctionLookup[] = {
+ /* collisionType: 0 */
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 1 */
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 2 */
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 3 */
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 4 */
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 5 */
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 6 */
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledSouth,
+ FilledNorth,
+ FilledWest,
+ FilledEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 7 */
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 8 */
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 9 */
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 10 */
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 11 */
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /* collisionType: 12 */
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNorthWest,
+ FilledNorthEast,
+ FilledSouthWest,
+ FilledSouthEast,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledNone,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ FilledAll,
+ /**/
+ FilledNone,
+ };
+ if (tileType > 0x6f) {
return TRUE;
}
- return gUnk_08133A18[gUnk_08133A67[param_4 * 0x60 + tmp - 0x10]](param_2, param_3);
+
+ return tileCollisionFunctions[collisionFunctionLookup[collisionType * 0x60 + tileType - 0x10]](x, y);
+ // return tileCollisionFunctions[collisionFunctionLookup[collisionType][tileType - 0x10]](x, y);
}
}
}
return FALSE;
}
-NONMATCH("asm/non_matching/movement/sub_080AE58C.inc", void sub_080AE58C(Entity* this, u32 param_2, u32 param_3)) {
+ASM_FUNC("asm/non_matching/movement/CalculateEntityTileCollisions.inc",
+ void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionType))
+/*NONMATCH("asm/non_matching/movement/CalculateEntityTileCollisions.inc",
+ void CalculateEntityTileCollisions(Entity* this, u32 direction, u32 collisionType)) {
u8* layer;
- u32 uVar2;
- s32 iVar3;
- u32 uVar4;
- u32 uVar5;
- u32 uVar6;
- u32 uVar7;
- s32 iVar8;
- s32 iVar9;
- u32 uVar10;
- u32 uVar11;
- Hitbox* pHVar12;
- s32 iVar13;
- u16 uVar14;
- s32 iVar15;
-
- layer = GetLayerByIndex(this->collisionLayer);
- layer += 0x2004;
- iVar8 = this->hitbox->offset_x + this->x.HALF.HI;
- iVar9 = this->hitbox->offset_y + this->y.HALF.HI;
- uVar2 = this->hitbox->unk2[0];
- uVar10 = this->hitbox->unk2[1];
- if ((param_2 & 0xf) != 0) {
- if (0xf >= param_2) {
- iVar15 = iVar8 + uVar2;
- iVar3 = sub_080AE4CC(layer, iVar15, iVar9, param_3);
- uVar2 = sub_080AE4CC(layer, iVar15, iVar9 + uVar10, param_3);
- uVar10 = sub_080AE4CC(layer, iVar15, iVar9 - uVar10, param_3);
- uVar2 = ((iVar3 << 1 | uVar2) << 1 | uVar10) << 6;
+
+ u32 colResult;
+
+ s32 xMin;
+ s32 xVar1;
+ s32 xVar2;
+
+ s32 yMin;
+ s32 yVar1;
+ s32 yVar2;
+
+ bool32 col1;
+ bool32 col2;
+ bool32 col3;
+ bool32 col4;
+ bool32 col5;
+ bool32 col6;
+
+ u32 hitboxUnkX;
+ u32 hitboxUnkY;
+
+ layer = GetLayerByIndex(this->collisionLayer)->_2004;
+ xMin = this->x.HALF.HI + this->hitbox->offset_x;
+ yMin = this->y.HALF.HI + this->hitbox->offset_y;
+ hitboxUnkX = this->hitbox->unk2[0];
+ hitboxUnkY = this->hitbox->unk2[1];
+ if ((direction & 0xf) != 0) {
+ if (0xf >= direction) {
+ col1 = IsTileCollision(layer, xMin + hitboxUnkX, yMin, collisionType);
+ col2 = IsTileCollision(layer, xMin + hitboxUnkX, yMin + hitboxUnkY, collisionType);
+ col3 = IsTileCollision(layer, xMin + hitboxUnkX, yMin - hitboxUnkY, collisionType);
+ colResult = ((col1 << 1 | col2) << 1 | col3) << 6;
} else {
- iVar15 = iVar8 - uVar2;
- iVar3 = sub_080AE4CC(layer, iVar15, iVar9, param_3);
- uVar2 = sub_080AE4CC(layer, iVar15, iVar9 + uVar10, param_3);
- uVar2 = iVar3 << 1 | uVar2;
- iVar13 = iVar9 - uVar10;
- uVar10 = sub_080AE4CC(layer, iVar15, iVar13, param_3);
- uVar2 = (uVar2 << 1 | uVar10) << 2;
+ col1 = IsTileCollision(layer, xMin - hitboxUnkX, yMin, collisionType);
+ col2 = IsTileCollision(layer, xMin - hitboxUnkX, yMin + hitboxUnkY, collisionType);
+ colResult = col1 << 1 | col2;
+ col3 = IsTileCollision(layer, xMin - hitboxUnkX, yMin - hitboxUnkY, collisionType);
+ colResult = (colResult << 1 | col3) << 2;
}
} else {
- iVar15 = iVar8 + uVar2;
- iVar3 = sub_080AE4CC(layer, iVar15, iVar9, param_3);
- uVar11 = sub_080AE4CC(layer, iVar15, iVar9 + uVar10, param_3);
- iVar13 = iVar9 - uVar10;
- uVar4 = sub_080AE4CC(layer, iVar15, iVar13, param_3);
- iVar15 = iVar8 - uVar2;
- uVar5 = sub_080AE4CC(layer, iVar15, iVar9, param_3);
- uVar2 = sub_080AE4CC(layer, iVar15, iVar9 + uVar10, param_3);
- uVar2 = (((iVar3 << 1 | uVar11) << 1 | uVar4) << 2 | uVar5) << 1 | uVar2;
- uVar10 = sub_080AE4CC(layer, iVar15, iVar13, param_3);
- uVar2 = (uVar2 << 1 | uVar10) << 2;
- }
- uVar10 = this->hitbox->unk2[2];
- uVar11 = this->hitbox->unk2[3];
- if (((param_2 - 8) & 0xf) == 0) {
- iVar15 = iVar9 + uVar11;
- uVar4 = sub_080AE4CC(layer, iVar8, iVar15, param_3);
- uVar5 = sub_080AE4CC(layer, iVar8 + uVar10, iVar15, param_3);
- iVar3 = iVar8 - uVar10;
- uVar6 = sub_080AE4CC(layer, iVar3, iVar15, param_3);
- iVar9 -= uVar11;
- uVar7 = sub_080AE4CC(layer, iVar8, iVar9, param_3);
- uVar11 = sub_080AE4CC(layer, iVar8 + uVar10, iVar9, param_3);
- uVar11 = ((((uVar2 | uVar4) << 1 | uVar5) << 1 | uVar6) << 2 | uVar7) << 1 | uVar11;
- uVar2 = sub_080AE4CC(layer, iVar3, iVar9, param_3);
- this->collisions = ((uVar11 << 1 | uVar2) << 1);
+ col1 = IsTileCollision(layer, xMin + hitboxUnkX, yMin, collisionType);
+ col2 = IsTileCollision(layer, xMin + hitboxUnkX, yMin + hitboxUnkY, collisionType);
+ col3 = IsTileCollision(layer, xMin + hitboxUnkX, yMin - hitboxUnkY, collisionType);
+ col4 = IsTileCollision(layer, xMin - hitboxUnkX, yMin, collisionType);
+ col5 = IsTileCollision(layer, xMin - hitboxUnkX, yMin + hitboxUnkY, collisionType);
+ colResult = (((col1 << 1 | col2) << 1 | col3) << 2 | col4) << 1 | col5;
+ col6 = IsTileCollision(layer, xMin - hitboxUnkX, yMin - hitboxUnkY, collisionType);
+ colResult = (colResult << 1 | col6) << 2;
+ }
+
+ hitboxUnkX = this->hitbox->unk2[2];
+ hitboxUnkY = this->hitbox->unk2[3];
+
+ if (((direction - 8) & 0xf) == 0) {
+ col1 = IsTileCollision(layer, xMin, yMin + hitboxUnkY, collisionType);
+ col2 = IsTileCollision(layer, xMin + hitboxUnkX, yMin + hitboxUnkY, collisionType);
+ col3 = IsTileCollision(layer, xMin - hitboxUnkX, yMin + hitboxUnkY, collisionType);
+ yMin -= hitboxUnkY;
+ col4 = IsTileCollision(layer, xMin, yMin, collisionType);
+ col5 = IsTileCollision(layer, xMin + hitboxUnkX, yMin, collisionType);
+ colResult = ((((colResult | col1) << 1 | col2) << 1 | col3) << 2 | col4) << 1 | col5;
+ col6 = IsTileCollision(layer, xMin - hitboxUnkX, yMin, collisionType);
+ this->collisions = ((colResult << 1 | col6) << 1);
} else {
- if (param_2 - 8 < 0x10) {
- iVar9 += uVar11;
- uVar11 = sub_080AE4CC(layer, iVar8, iVar9, param_3);
- uVar4 = sub_080AE4CC(layer, iVar8 + uVar10, iVar9, param_3);
- uVar10 = sub_080AE4CC(layer, iVar8 - uVar10, iVar9, param_3);
- this->collisions = ((((uVar2 | uVar11) << 1 | uVar4) << 1 | uVar10) << 5);
+ if (direction - 8 < 0x10) {
+ yMin += hitboxUnkY;
+ col1 = IsTileCollision(layer, xMin, yMin, collisionType);
+ col2 = IsTileCollision(layer, xMin + hitboxUnkX, yMin, collisionType);
+ col3 = IsTileCollision(layer, xMin - hitboxUnkX, yMin, collisionType);
+ this->collisions = ((((colResult | col1) << 1 | col2) << 1 | col3) << 5);
} else {
- iVar9 -= uVar11;
- uVar4 = sub_080AE4CC(layer, iVar8, iVar9, param_3);
- uVar11 = sub_080AE4CC(layer, iVar8 + uVar10, iVar9, param_3);
- uVar11 = (uVar2 << 4 | uVar4) << 1 | uVar11;
- iVar3 = iVar8 - uVar10;
- uVar2 = sub_080AE4CC(layer, iVar3, iVar9, param_3);
- this->collisions = ((uVar11 << 1 | uVar2) << 1);
+ yMin -= hitboxUnkY;
+ col1 = IsTileCollision(layer, xMin, yMin, collisionType);
+ col2 = IsTileCollision(layer, xMin + hitboxUnkX, yMin, collisionType);
+ col6 = (colResult << 4 | col1) << 1 | col2;
+ colResult = IsTileCollision(layer, xMin - hitboxUnkX, yMin, collisionType);
+ this->collisions = ((col6 << 1 | colResult) << 1);
}
}
}
-END_NONMATCH
+END_NONMATCH*/
-u32 sub_080AE7E8(Entity* param_1, u32 param_2, s32 param_3, s32 param_4) {
- return gUnk_08133F48[param_3](param_1, param_2, param_3 << 3, param_4);
+bool32 ProcessMovementInternal(Entity* this, s32 radius, s32 direction, u32 collisionType) {
+ static bool32 (*const gDirectionalMovementFunctions[])(Entity*, s32, s32, u32) = {
+ MoveNorth,
+ /**/
+ MoveNorthEast,
+ MoveNorthEast,
+ MoveNorthEast,
+ MoveNorthEast,
+ MoveNorthEast,
+ MoveNorthEast,
+ MoveNorthEast,
+ /**/
+ MoveEast,
+ /**/
+ MoveSouthEast,
+ MoveSouthEast,
+ MoveSouthEast,
+ MoveSouthEast,
+ MoveSouthEast,
+ MoveSouthEast,
+ MoveSouthEast,
+ /**/
+ MoveSouth,
+ /**/
+ MoveSouthWest,
+ MoveSouthWest,
+ MoveSouthWest,
+ MoveSouthWest,
+ MoveSouthWest,
+ MoveSouthWest,
+ MoveSouthWest,
+ /**/
+ MoveWest,
+ /**/
+ MoveNorthWest,
+ MoveNorthWest,
+ MoveNorthWest,
+ MoveNorthWest,
+ MoveNorthWest,
+ MoveNorthWest,
+ MoveNorthWest,
+ };
+ return gDirectionalMovementFunctions[direction](this, radius, direction << 3, collisionType);
}
-bool32 sub_080AE800(Entity* this, s32 radius, s32 angle, u32 param_4) {
- s32 tmpX = 0;
- s32 tmpY = 0;
+bool32 MoveNorth(Entity* this, s32 radius, s32 angle, u32 collisionType) {
+ s32 moveA = 0;
+ s32 moveB = 0;
if ((this->collisions & COL_NORTH_ANY) != COL_NONE) {
if ((this->collisions & COL_NORTH_ANY) == COL_NORTH_WEST) {
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
- tmpX = radius * 0x100;
- this->x.WORD += tmpX;
- sub_080AE58C(this, 4, param_4);
+ moveA = radius * 0x100;
+ this->x.WORD += moveA;
+ CalculateEntityTileCollisions(this, DirectionNorthEast, collisionType);
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
- tmpY = gSineTable[0x40] * radius;
- tmpX = radius * 0x100;
- this->y.WORD -= tmpY;
+ moveB = gSineTable[0x40] * radius;
+ moveA = radius * 0x100;
+ this->y.WORD -= moveB;
}
}
} else {
if ((this->collisions & COL_NORTH_ANY) == COL_NORTH_EAST) {
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
- tmpX = radius * 0x100;
- this->x.WORD += radius * -0x100;
- sub_080AE58C(this, 0x1c, param_4);
+ moveA = radius * 0x100;
+ this->x.WORD -= moveA;
+ CalculateEntityTileCollisions(this, DirectionNorthWest, collisionType);
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
- tmpY = gSineTable[0x40] * radius;
- tmpX = radius * 0x100;
- this->y.WORD -= tmpY;
+ moveB = gSineTable[0x40] * radius;
+ moveA = radius * 0x100;
+ this->y.WORD -= moveB;
}
}
}
}
} else {
- tmpX = gSineTable[0x40] * radius;
- this->y.WORD -= tmpX;
+ moveA = gSineTable[0x40] * radius;
+ this->y.WORD -= moveA;
}
- if ((tmpX + 0x3333U < 0x6666) && (tmpY + 0x3333U < 0x6666)) {
+ if (((moveA >= -0x3333) && (moveA < 0x3333)) && ((moveB >= -0x3333) && (moveB < 0x3333))) {
return FALSE;
} else {
return TRUE;
}
}
-NONMATCH("asm/non_matching/movement/sub_080AE8D8.inc",
- bool32 sub_080AE8D8(Entity* this, s32 radius, s32 angle, u32 param_4)) {
+ASM_FUNC("asm/non_matching/movement/MoveNorthEast.inc",
+ bool32 MoveNorthEast(Entity* this, s32 radius, s32 angle, u32 collisionType))
+/*NONMATCH("asm/non_matching/movement/MoveNorthEast.inc",
+ bool32 MoveNorthEast(Entity* this, s32 radius, s32 angle, u32 collisionType)) {
s32 moveA = 0;
s32 moveB = 0;
if (((this->collisions & COL_NORTH_ANY) == COL_NONE) || ((this->collisions & COL_EAST_ANY) == COL_NONE)) {
@@ -280,12 +1816,12 @@ NONMATCH("asm/non_matching/movement/sub_080AE8D8.inc",
if ((this->collisions & COL_NORTH_ANY) == COL_NORTH_WEST) {
moveA = radius * 0x100;
this->x.WORD += moveA;
- sub_080AE58C(this, 4, param_4);
+ CalculateEntityTileCollisions(this, DirectionNorthEast, collisionType);
} else {
if ((this->collisions & COL_EAST_ANY) == COL_EAST_NORTH) {
moveA = radius * 0x100;
this->y.WORD -= moveA;
- sub_080AE58C(this, 4, param_4);
+ CalculateEntityTileCollisions(this, DirectionNorthEast, collisionType);
}
}
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
@@ -304,9 +1840,9 @@ NONMATCH("asm/non_matching/movement/sub_080AE8D8.inc",
return TRUE;
}
}
-END_NONMATCH
+END_NONMATCH*/
-bool32 sub_080AE9CC(Entity* this, s32 radius, s32 angle, u32 param_4) {
+bool32 MoveEast(Entity* this, s32 radius, s32 angle, u32 collisionType) {
s32 moveA = 0;
s32 moveB = 0;
if ((this->collisions & COL_EAST_ANY) != COL_NONE) {
@@ -314,7 +1850,7 @@ bool32 sub_080AE9CC(Entity* this, s32 radius, s32 angle, u32 param_4) {
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->y.WORD += moveA;
- sub_080AE58C(this, 0xc, param_4);
+ CalculateEntityTileCollisions(this, DirectionSouthEast, collisionType);
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
@@ -324,8 +1860,8 @@ bool32 sub_080AE9CC(Entity* this, s32 radius, s32 angle, u32 param_4) {
if ((this->collisions & COL_EAST_ANY) == COL_EAST_NORTH) {
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
moveA = radius * 0x100;
- this->y.WORD = this->y.WORD -= moveA;
- sub_080AE58C(this, 4, param_4);
+ this->y.WORD -= moveA;
+ CalculateEntityTileCollisions(this, DirectionNorthEast, collisionType);
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
@@ -344,8 +1880,10 @@ bool32 sub_080AE9CC(Entity* this, s32 radius, s32 angle, u32 param_4) {
}
}
-NONMATCH("asm/non_matching/movement/sub_080AEAC0.inc",
- bool32 sub_080AEAC0(Entity* this, s32 radius, s32 angle, u32 param_4)) {
+ASM_FUNC("asm/non_matching/movement/MoveSouthEast.inc",
+ bool32 MoveSouthEast(Entity* this, s32 radius, s32 angle, u32 collisionType))
+/*NONMATCH("asm/non_matching/movement/MoveSouthEast.inc",
+ bool32 MoveSouthEast(Entity* this, s32 radius, s32 angle, u32 collisionType)) {
s32 moveA = 0;
s32 moveB = 0;
if (((this->collisions & COL_SOUTH_ANY) == COL_NONE) || ((this->collisions & COL_EAST_ANY) == COL_NONE)) {
@@ -358,11 +1896,11 @@ NONMATCH("asm/non_matching/movement/sub_080AEAC0.inc",
if ((this->collisions & COL_SOUTH_ANY) == COL_SOUTH_WEST) {
moveA = radius * 0x100;
this->x.WORD += moveA;
- sub_080AE58C(this, 0xc, param_4);
+ CalculateEntityTileCollisions(this, DirectionSouthEast, collisionType);
} else if ((this->collisions & COL_EAST_ANY) == COL_EAST_SOUTH) {
moveA = radius * 0x100;
this->y.WORD += moveA;
- sub_080AE58C(this, 0xc, param_4);
+ CalculateEntityTileCollisions(this, DirectionSouthEast, collisionType);
}
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
@@ -380,9 +1918,9 @@ NONMATCH("asm/non_matching/movement/sub_080AEAC0.inc",
return TRUE;
}
}
-END_NONMATCH
+END_NONMATCH*/
-bool32 sub_080AEBB4(Entity* this, s32 radius, s32 angle, u32 param_4) {
+bool32 MoveSouth(Entity* this, s32 radius, s32 angle, u32 collisionType) {
s32 moveA = 0;
s32 moveB = 0;
@@ -391,7 +1929,7 @@ bool32 sub_080AEBB4(Entity* this, s32 radius, s32 angle, u32 param_4) {
if ((this->collisions & COL_EAST_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->x.WORD += moveA;
- sub_080AE58C(this, 0xc, param_4);
+ CalculateEntityTileCollisions(this, DirectionSouthEast, collisionType);
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveB;
@@ -402,7 +1940,7 @@ bool32 sub_080AEBB4(Entity* this, s32 radius, s32 angle, u32 param_4) {
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->x.WORD -= moveA;
- sub_080AE58C(this, 0x14, param_4);
+ CalculateEntityTileCollisions(this, DirectionSouthWest, collisionType);
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveB = gSineTable[angle + 0x40] * radius;
this->y.WORD -= moveB;
@@ -421,8 +1959,10 @@ bool32 sub_080AEBB4(Entity* this, s32 radius, s32 angle, u32 param_4) {
}
}
-NONMATCH("asm/non_matching/movement/sub_080AECAC.inc",
- bool32 sub_080AECAC(Entity* this, s32 radius, s32 angle, u32 param_4)) {
+ASM_FUNC("asm/non_matching/movement/MoveSouthWest.inc",
+ bool32 MoveSouthWest(Entity* this, s32 radius, s32 angle, u32 collisionType))
+/*NONMATCH("asm/non_matching/movement/MoveSouthWest.inc",
+ bool32 MoveSouthWest(Entity* this, s32 radius, s32 angle, u32 collisionType)) {
s32 moveA = 0;
s32 moveB = 0;
if (((this->collisions & COL_SOUTH_ANY) == COL_NONE) || ((this->collisions & COL_WEST_ANY) == COL_NONE)) {
@@ -435,12 +1975,12 @@ NONMATCH("asm/non_matching/movement/sub_080AECAC.inc",
if ((this->collisions & COL_SOUTH_ANY) == COL_SOUTH_EAST) {
moveB = radius * 0x100;
this->x.WORD -= moveB;
- sub_080AE58C(this, 0x14, param_4);
+ CalculateEntityTileCollisions(this, DirectionSouthWest, collisionType);
} else {
if ((this->collisions & COL_WEST_ANY) == COL_WEST_SOUTH) {
moveB = radius * 0x100;
this->y.WORD += moveB;
- sub_080AE58C(this, 0x14, param_4);
+ CalculateEntityTileCollisions(this, DirectionSouthWest, collisionType);
}
}
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
@@ -459,9 +1999,9 @@ NONMATCH("asm/non_matching/movement/sub_080AECAC.inc",
return TRUE;
}
}
-END_NONMATCH
+END_NONMATCH*/
-bool32 sub_080AEDA0(Entity* this, s32 radius, s32 angle, u32 param_4) {
+bool32 MoveWest(Entity* this, s32 radius, s32 angle, u32 collisionType) {
s32 moveA = 0;
s32 moveB = 0;
@@ -471,7 +2011,8 @@ bool32 sub_080AEDA0(Entity* this, s32 radius, s32 angle, u32 param_4) {
if ((this->collisions & COL_SOUTH_ANY) == COL_NONE) {
moveA = radius * 0x100;
this->y.WORD += moveA;
- sub_080AE58C(this, 0x1c, param_4);
+ CalculateEntityTileCollisions(this, DirectionNorthWest,
+ collisionType); // @bug? Should this calculate for DirectionSouthWest?
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
@@ -481,8 +2022,8 @@ bool32 sub_080AEDA0(Entity* this, s32 radius, s32 angle, u32 param_4) {
if ((this->collisions & COL_WEST_ANY) == COL_WEST_NORTH) {
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
moveA = radius * 0x100;
- this->y.WORD = this->y.WORD + radius * -0x100;
- sub_080AE58C(this, 0x1c, param_4);
+ this->y.WORD -= moveA;
+ CalculateEntityTileCollisions(this, DirectionNorthWest, collisionType);
if ((this->collisions & COL_WEST_ANY) == COL_NONE) {
moveB = gSineTable[angle] * radius;
this->x.WORD += moveB;
@@ -502,8 +2043,10 @@ bool32 sub_080AEDA0(Entity* this, s32 radius, s32 angle, u32 param_4) {
}
}
-NONMATCH("asm/non_matching/movement/sub_080AEE94.inc",
- bool32 sub_080AEE94(Entity* this, s32 radius, s32 angle, u32 param_4)) {
+ASM_FUNC("asm/non_matching/movement/MoveNorthWest.inc",
+ bool32 MoveNorthWest(Entity* this, s32 radius, s32 angle, u32 collisionType))
+/*NONMATCH("asm/non_matching/movement/MoveNorthWest.inc",
+ bool32 MoveNorthWest(Entity* this, s32 radius, s32 angle, u32 collisionType)) {
s32 moveA = 0;
s32 moveB = 0;
u32 colNorthAny = (this->collisions & COL_NORTH_ANY);
@@ -518,12 +2061,12 @@ NONMATCH("asm/non_matching/movement/sub_080AEE94.inc",
if (colNorthAny == COL_NORTH_EAST) {
moveA = radius * 0x100;
this->x.WORD -= moveA;
- sub_080AE58C(this, 0x1c, param_4);
+ CalculateEntityTileCollisions(this, DirectionNorthWest, collisionType);
} else {
if (colWestAny == COL_WEST_NORTH) {
moveA = radius * 0x100;
this->y.WORD -= moveA;
- sub_080AE58C(this, 0x1c, param_4);
+ CalculateEntityTileCollisions(this, DirectionNorthWest, collisionType);
}
}
if ((this->collisions & COL_NORTH_ANY) == COL_NONE) {
@@ -542,88 +2085,88 @@ NONMATCH("asm/non_matching/movement/sub_080AEE94.inc",
return TRUE;
}
}
-END_NONMATCH
+END_NONMATCH*/
-u32 ProcessMovement(Entity* this) {
- u32 result;
+bool32 ProcessMovement0(Entity* this) {
+ bool32 result;
if ((this->direction & 0x80) == 0) {
- sub_080AE58C(this, this->direction, 0);
- result = sub_080AE7E8(this, this->speed, this->direction, 0);
+ CalculateEntityTileCollisions(this, this->direction, 0);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 0);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-u32 sub_080AEFB4(Entity* this) {
- u32 result;
+bool32 ProcessMovement1(Entity* this) {
+ bool32 result;
if ((this->direction & 0x80) == 0) {
- sub_080AE58C(this, this->direction, 1);
- result = sub_080AE7E8(this, this->speed, this->direction, 1);
+ CalculateEntityTileCollisions(this, this->direction, 1);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 1);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-u32 sub_080AEFE0(Entity* this) {
- u32 result;
+bool32 ProcessMovement2(Entity* this) {
+ bool32 result;
if ((this->direction & 0x80) == 0) {
- sub_080AE58C(this, this->direction, 2);
- result = sub_080AE7E8(this, this->speed, this->direction, 2);
+ CalculateEntityTileCollisions(this, this->direction, 2);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 2);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-u32 sub_080AF00C(Entity* this) {
- u32 result;
+bool32 ProcessMovement10(Entity* this) {
+ bool32 result;
if ((this->direction & 0x80) == 0) {
- sub_080AE58C(this, this->direction, 10);
- result = sub_080AE7E8(this, this->speed, this->direction, 10);
+ CalculateEntityTileCollisions(this, this->direction, 10);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 10);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-u32 sub_080AF038(Entity* this) {
- u32 result;
+bool32 ProcessMovement12(Entity* this) {
+ bool32 result;
if ((this->direction & 0x80) == 0) {
- sub_080AE58C(this, (u32)this->direction, 0xc);
- result = sub_080AE7E8(this, (s32)this->speed, this->direction, 0xc);
+ CalculateEntityTileCollisions(this, this->direction, 12);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 12);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-u32 sub_080AF064(Entity* this, u32 param_2, u32 param_3) {
- u32 result;
+bool32 ProcessMovement0_custom(Entity* this, u32 direction, u32 speed) {
+ bool32 result;
- if ((param_2 & 0x80) == 0) {
- sub_080AE58C(this, param_2, 0);
- result = sub_080AE7E8(this, param_3, param_2, 0);
+ if ((direction & 0x80) == 0) {
+ CalculateEntityTileCollisions(this, direction, 0);
+ result = ProcessMovementInternal(this, speed, direction, 0);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-u32 sub_080AF090(Entity* this) {
- u32 result;
+bool32 ProcessMovement3(Entity* this) {
+ bool32 result;
if (((this->direction & 0x80) == 0) && (sub_080AF0C8(this) == 0)) {
- sub_080AE58C(this, (u32)this->direction, 3);
- result = sub_080AE7E8(this, (s32)this->speed, this->direction, 3);
+ CalculateEntityTileCollisions(this, this->direction, 3);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 3);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
@@ -659,68 +2202,68 @@ bool32 sub_080AF0C8(Entity* this) {
return FALSE;
}
-u32 sub_080AF134(Entity* this) {
- u32 result;
+bool32 ProcessMovement4(Entity* this) {
+ bool32 result;
if ((this->direction & 0x80) == 0) {
- sub_080AE58C(this, this->direction, 4);
- result = sub_080AE7E8(this, this->speed, this->direction, 4);
+ CalculateEntityTileCollisions(this, this->direction, 4);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 4);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-u32 sub_080AF160(Entity* this) {
- u32 result;
+bool32 ProcessMovement5(Entity* this) {
+ bool32 result;
if ((this->direction & 0x80) == 0) {
- sub_080AE58C(this, this->direction, 5);
- result = sub_080AE7E8(this, this->speed, this->direction, 5);
+ CalculateEntityTileCollisions(this, this->direction, 5);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 5);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
void Knockback1(Entity* this) {
this->knockbackDuration--;
- sub_080AE58C(this, this->knockbackDirection, 2);
- sub_080AE7E8(this, this->field_0x46, this->knockbackDirection, 2);
+ CalculateEntityTileCollisions(this, this->knockbackDirection, 2);
+ ProcessMovementInternal(this, this->knockbackSpeed, this->knockbackDirection, 2);
}
void Knockback2(Entity* this) {
this->knockbackDuration--;
- sub_080AE58C(this, this->knockbackDirection, 1);
- sub_080AE7E8(this, this->field_0x46, this->knockbackDirection, 1);
+ CalculateEntityTileCollisions(this, this->knockbackDirection, 1);
+ ProcessMovementInternal(this, this->knockbackSpeed, this->knockbackDirection, 1);
}
-u32 sub_080AF1EC(Entity* this) {
- u32 result;
+bool32 ProcessMovement6(Entity* this) {
+ bool32 result;
if ((this->direction & 0x80) == 0) {
- sub_080AE58C(this, this->direction, 6);
- result = sub_080AE7E8(this, this->speed, this->direction, 6);
+ CalculateEntityTileCollisions(this, this->direction, 6);
+ result = ProcessMovementInternal(this, this->speed, this->direction, 6);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-u32 sub_080AF218(Entity* this, u32 param_2, u32 param_3) {
- u32 result;
+bool32 ProcessMovement6_custom(Entity* this, u32 direction, u32 speed) {
+ bool32 result;
- if ((param_2 & 0x80) == 0) {
- sub_080AE58C(this, param_2, 6);
- result = sub_080AE7E8(this, param_3, param_2, 6);
+ if ((direction & 0x80) == 0) {
+ CalculateEntityTileCollisions(this, direction, 6);
+ result = ProcessMovementInternal(this, speed, direction, 6);
} else {
- result = 0;
+ result = FALSE;
}
return result;
}
-void sub_080AF244(Entity* param_1, u32 param_2, u32 param_3) {
- sub_080AE7E8(param_1, param_2, param_3, 2);
+void ProcessMovementInternal2(Entity* this, u32 direction, u32 speed) {
+ ProcessMovementInternal(this, direction, speed, 2);
}
void sub_080AF250(s32 param_1) {
diff --git a/src/npc/castleMaid.c b/src/npc/castleMaid.c
index 81483829..b846a04a 100644
--- a/src/npc/castleMaid.c
+++ b/src/npc/castleMaid.c
@@ -155,7 +155,7 @@ void sub_080646A4(Entity* this, ScriptExecutionContext* context) {
}
context->postScriptActions |= 0x2;
- ProcessMovement(this);
+ ProcessMovement0(this);
x = this->x.HALF.HI;
diff = x - (s16)this->field_0x6c.HWORD;
if (diff > 0x10) {
diff --git a/src/npc/cow.c b/src/npc/cow.c
index 5f0bcc0a..481877ab 100644
--- a/src/npc/cow.c
+++ b/src/npc/cow.c
@@ -87,7 +87,7 @@ void sub_08069068(Entity* ent) {
InitAnimationForceUpdate(ent, ent->animationState + 4);
}
- ProcessMovement(ent);
+ ProcessMovement0(ent);
UpdateAnimationSingleFrame(ent);
{
diff --git a/src/npc/dog.c b/src/npc/dog.c
index 111b27e0..525a0539 100644
--- a/src/npc/dog.c
+++ b/src/npc/dog.c
@@ -136,7 +136,7 @@ void sub_08069D54(Entity* this) {
this->actionDelay -= 1;
if (this->actionDelay != 0) {
UpdateAnimationSingleFrame(this);
- ProcessMovement(this);
+ ProcessMovement0(this);
collisions = this->collisions;
if (this->x.HALF.HI < this->field_0x6e.HWORD) {
diff --git a/src/npc/kid.c b/src/npc/kid.c
index 011327db..0375b162 100644
--- a/src/npc/kid.c
+++ b/src/npc/kid.c
@@ -364,7 +364,7 @@ NONMATCH("asm/non_matching/kid/sub_08062948.inc", void sub_08062948(Entity* this
InitializeAnimation(this, uVar3);
this->field_0x80.HALF.LO = (u16)this->animIndex;
}
- ProcessMovement(this);
+ ProcessMovement0(this);
iVar4 = this->x.HALF.HI - this->field_0x6c.HALF.LO;
if (0x10 < iVar4) {
this->x.HALF.HI = this->field_0x6c.HALF.LO + 0x10;
diff --git a/src/npc/npc23.c b/src/npc/npc23.c
index 9630e18a..9f64b7bb 100644
--- a/src/npc/npc23.c
+++ b/src/npc/npc23.c
@@ -76,7 +76,7 @@ void sub_080663D4(Entity* this) {
InitializeAnimation(this, (this->direction >> 3) + 4);
this->subAction = this->subAction + 1;
}
- ProcessMovement(this);
+ ProcessMovement0(this);
}
sub_08078B48();
GetNextFrame(this);
diff --git a/src/npc/npc5.c b/src/npc/npc5.c
index 08eaa441..7a72f32e 100644
--- a/src/npc/npc5.c
+++ b/src/npc/npc5.c
@@ -42,7 +42,6 @@ u32 PointInsideRadius(s32, s32, s32);
extern u8 gUnk_0200D654[];
extern u8 gUnk_02027EB4[];
-extern u32 sub_080AF1EC(Entity*);
u32 sub_080611D4(Entity*);
extern u32 sub_08079FD4(Entity*, u32);
extern void sub_08016AD2(Entity*);
@@ -395,7 +394,7 @@ NONMATCH("asm/non_matching/npc5/sub_08061170.inc", bool32 sub_08061170(Entity* t
u32 tmp;
UpdateAnimationSingleFrame(this);
- if (sub_080AF1EC(this) == 0) {
+ if (ProcessMovement6(this) == 0) {
direction = sub_080611D4(this);
if (direction != 0xff) {
this->action = 6;
@@ -636,7 +635,7 @@ void sub_08061464(Entity* this, u32 param_a, u32 param_b) {
bool32 sub_08061630(Entity* this, s32 x, s32 y, s32 param) {
u32 param_y = y;
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
- while (!sub_080AE4CC(layer, x, y, 6)) {
+ while (!IsTileCollision(layer, x, y, 6)) {
if (sub_08061A74(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = x;
((UnkHeap*)this->myHeap)->unk_8 = param_y;
@@ -653,7 +652,7 @@ bool32 sub_08061630(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_080616A8(Entity* this, s32 x, s32 y, s32 param) {
u32 param_y = y;
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
- while (!sub_080AE4CC(layer, x, y, 6)) {
+ while (!IsTileCollision(layer, x, y, 6)) {
if (sub_08061A1C(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = x;
((UnkHeap*)this->myHeap)->unk_8 = param_y;
@@ -670,7 +669,7 @@ bool32 sub_080616A8(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061720(Entity* this, s32 x, s32 y, s32 param) {
u32 param_x = x;
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
- while (!sub_080AE4CC(layer, x, y, 6)) {
+ while (!IsTileCollision(layer, x, y, 6)) {
if (sub_080619F0(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = param_x;
((UnkHeap*)this->myHeap)->unk_8 = y;
@@ -687,7 +686,7 @@ bool32 sub_08061720(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061798(Entity* this, s32 x, s32 y, s32 param) {
u32 param_x = x;
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
- while (!sub_080AE4CC(layer, x, y, 6)) {
+ while (!IsTileCollision(layer, x, y, 6)) {
if (sub_08061A48(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = param_x;
((UnkHeap*)this->myHeap)->unk_8 = y;
@@ -704,7 +703,7 @@ bool32 sub_08061798(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061810(Entity* this, s32 x, s32 y, s32 param) {
u32 param_y = y;
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
- while (!sub_080AE4CC(layer, x, y, 6)) {
+ while (!IsTileCollision(layer, x, y, 6)) {
if (sub_08061A74(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = x;
((UnkHeap*)this->myHeap)->unk_8 = param_y;
@@ -721,7 +720,7 @@ bool32 sub_08061810(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061888(Entity* this, s32 x, s32 y, s32 param) {
u32 param_y = y;
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
- while (!sub_080AE4CC(layer, x, y, 6)) {
+ while (!IsTileCollision(layer, x, y, 6)) {
if (sub_08061A1C(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = x;
((UnkHeap*)this->myHeap)->unk_8 = param_y;
@@ -738,7 +737,7 @@ bool32 sub_08061888(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061900(Entity* this, s32 x, s32 y, s32 param) {
u32 param_x = x;
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
- while (!sub_080AE4CC(layer, x, y, 6)) {
+ while (!IsTileCollision(layer, x, y, 6)) {
if (sub_080619F0(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = param_x;
((UnkHeap*)this->myHeap)->unk_8 = y;
@@ -755,7 +754,7 @@ bool32 sub_08061900(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_08061978(Entity* this, s32 x, s32 y, s32 param) {
u32 param_x = x;
u8* layer = (this->collisionLayer == 2) ? gUnk_0200D654 : gUnk_02027EB4;
- while (!sub_080AE4CC(layer, x, y, 6)) {
+ while (!IsTileCollision(layer, x, y, 6)) {
if (sub_08061A48(layer, x, y, param)) {
((UnkHeap*)this->myHeap)->unk_7 = param_x;
((UnkHeap*)this->myHeap)->unk_8 = y;
@@ -771,7 +770,7 @@ bool32 sub_08061978(Entity* this, s32 x, s32 y, s32 param) {
bool32 sub_080619F0(u8* layer, s32 x, s32 y, s32 param) {
while (param <= y) {
- if (sub_080AE4CC(layer, x, y, 6) != 0) {
+ if (IsTileCollision(layer, x, y, 6) != 0) {
return FALSE;
}
y -= 8;
@@ -781,7 +780,7 @@ bool32 sub_080619F0(u8* layer, s32 x, s32 y, s32 param) {
bool32 sub_08061A1C(u8* layer, s32 x, s32 y, s32 param) {
while (param >= x) {
- if (sub_080AE4CC(layer, x, y, 6) != 0) {
+ if (IsTileCollision(layer, x, y, 6) != 0) {
return FALSE;
}
x += 8;
@@ -791,7 +790,7 @@ bool32 sub_08061A1C(u8* layer, s32 x, s32 y, s32 param) {
bool32 sub_08061A48(u8* layer, s32 x, s32 y, s32 param) {
while (param >= y) {
- if (sub_080AE4CC(layer, x, y, 6) != 0) {
+ if (IsTileCollision(layer, x, y, 6) != 0) {
return FALSE;
}
y += 8;
@@ -801,7 +800,7 @@ bool32 sub_08061A48(u8* layer, s32 x, s32 y, s32 param) {
bool32 sub_08061A74(u8* layer, s32 x, s32 y, s32 param) {
while (param <= x) {
- if (sub_080AE4CC(layer, x, y, 6) != 0) {
+ if (IsTileCollision(layer, x, y, 6) != 0) {
return FALSE;
}
x -= 8;
diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c
index 8cfd33c1..f888ea21 100644
--- a/src/npc/townsperson.c
+++ b/src/npc/townsperson.c
@@ -190,7 +190,7 @@ void sub_08061E90(Entity* this, ScriptExecutionContext* context) {
if (animIndex != this->animIndex) {
InitializeAnimation(this, animIndex);
}
- ProcessMovement(this);
+ ProcessMovement0(this);
iVar4 = this->x.HALF.HI - *(s16*)&this->field_0x6a.HWORD;
if (0x10 < iVar4) {
this->x.HALF.HI = this->field_0x6a.HWORD + 0x10;
diff --git a/src/npcUtils.c b/src/npcUtils.c
index a430d135..bf609c86 100644
--- a/src/npcUtils.c
+++ b/src/npcUtils.c
@@ -130,7 +130,7 @@ void sub_0806EE04(Entity* ent, void* a2, u32 a3) {
ent->child = a2;
ent->field_0x3c = a3;
ent->hitType = 0;
- ent->field_0x46 = 0;
+ ent->knockbackSpeed = 0;
ent->field_0x16 = 0;
}
@@ -141,7 +141,7 @@ u32 sub_0806EE20(Entity* ent) {
if (ent->child)
return gUnk_08114EFC[ent->field_0x16](ent);
} else {
- ent->field_0x46 = 8;
+ ent->knockbackSpeed = 8;
v3 = GetFacingDirection(ent, &gPlayerEntity);
ent->knockbackDirection = sub_0806F5A4(v3);
}
@@ -154,8 +154,8 @@ u32 sub_0806EE70(Entity* ent) {
u32 result;
u16 xy[2];
- if (++ent->field_0x46 > 8) {
- ent->field_0x46 = 0;
+ if (++ent->knockbackSpeed > 8) {
+ ent->knockbackSpeed = 0;
sub_0806EF14(ent);
}
LinearMoveUpdate(ent);
@@ -172,7 +172,7 @@ u32 sub_0806EE70(Entity* ent) {
}
u32 sub_0806EED0(Entity* ent) {
- if (!--ent->field_0x46)
+ if (!--ent->knockbackSpeed)
return sub_0806EF74(ent, 2);
return 0;
}
@@ -214,13 +214,13 @@ u32 sub_0806EFAC(Entity* ent, u16* a2) {
u32 sub_0806EFBC(Entity* ent, u16* a2) {
ent->field_0x16 = 1;
- ent->field_0x46 = 8;
+ ent->knockbackSpeed = 8;
return 0;
}
u32 sub_0806EFCC(Entity* ent, u16* a2) {
ent->field_0x16 = 2;
- ent->field_0x46 = a2[1];
+ ent->knockbackSpeed = a2[1];
return 0;
}
diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c
index cdc65c3a..fd2b80aa 100644
--- a/src/object/bakerOven.c
+++ b/src/object/bakerOven.c
@@ -65,7 +65,7 @@ void sub_0809CD0C(Entity* this) {
gPlayerEntity.iframes = 16;
gPlayerEntity.knockbackDirection = 16;
gPlayerEntity.knockbackDuration = 12;
- gPlayerEntity.field_0x46 = 16;
+ gPlayerEntity.knockbackSpeed = 16;
}
}
}
diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c
index 054f7411..49503916 100644
--- a/src/object/itemOnGround.c
+++ b/src/object/itemOnGround.c
@@ -203,7 +203,7 @@ void sub_080811D8(Entity* this) {
void sub_080811EC(Entity* this) {
if (this->field_0x68.HALF.HI != 6) {
- sub_080AEFE0(this);
+ ProcessMovement2(this);
} else {
LinearMoveUpdate(this);
}
@@ -389,7 +389,7 @@ void sub_08081500(Entity* this) {
UpdateSpriteForCollisionLayer(this);
}
- sub_080AEFE0(this);
+ ProcessMovement2(this);
}
}
}
diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c
index 13dae7bc..aac89cb2 100644
--- a/src/object/lightableSwitch.c
+++ b/src/object/lightableSwitch.c
@@ -6,11 +6,6 @@
#include "flags.h"
#include "functions.h"
-extern void sub_0809EB30(Entity*);
-extern void sub_0809EAD8(Entity*);
-extern void sub_0809EABC(Entity*);
-extern void sub_080A2CC0(Entity*, Entity**, u16*);
-
extern void (*const gUnk_081243B4[])(Entity*);
extern void (*const gUnk_081243BC[])(Entity*);
extern void (*const gUnk_081243C4[])(Entity*);
diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c
index 5f5a426c..6d326946 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -114,7 +114,7 @@ void sub_08085A44(LilypadLargeEntity* this) {
}
}
sub_08085EFC(this);
- sub_080AF134(super);
+ ProcessMovement4(super);
sub_08085F1C(this);
}
diff --git a/src/object/objectB2.c b/src/object/objectB2.c
index fc5b4a85..bd2c58b5 100644
--- a/src/object/objectB2.c
+++ b/src/object/objectB2.c
@@ -22,7 +22,7 @@ void ObjectB2(Entity* this) {
}
this->speed = this->parent->speed;
LinearMoveUpdate(this);
- if (sub_080AE4CC((u8*)this->child, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) {
+ if (IsTileCollision((u8*)this->child, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) {
DeleteThisEntity();
}
if (this->speed < 0x41) {
diff --git a/src/object/rupee.c b/src/object/rupee.c
index f4119600..583cf0f0 100644
--- a/src/object/rupee.c
+++ b/src/object/rupee.c
@@ -37,7 +37,7 @@ void sub_08086A28(Entity* ent) {
if (iVar1 == 0) {
ent->action = 2;
}
- ProcessMovement(ent);
+ ProcessMovement0(ent);
CopyPosition(ent, ent->child);
}
}
diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c
index 63542a02..c491a16b 100644
--- a/src/object/smallIceBlock.c
+++ b/src/object/smallIceBlock.c
@@ -205,7 +205,7 @@ bool32 sub_0809953C(SmallIceBlockEntity* this) {
if (uVar3 != 0) {
return 0;
}
- sub_080AEFE0(super);
+ ProcessMovement2(super);
sub_0800445C(super);
if (super->actionDelay != 0) {
super->speed += 0x10;
diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c
index 7f6079f7..91567d8b 100644
--- a/src/projectile/arrowProjectile.c
+++ b/src/projectile/arrowProjectile.c
@@ -3,8 +3,6 @@
#include "functions.h"
#include "object.h"
-extern s32 sub_080AF090(Entity*);
-
extern void (*const gArrowProjectile[])(Entity*);
extern void (*const gArrowProjectileActions[])(Entity*);
@@ -78,7 +76,7 @@ void ArrowProjectile_Action2(Entity* this) {
} else if (--this->actionDelay == 0) {
DeleteThisEntity();
}
- sub_080AF090(this);
+ ProcessMovement3(this);
}
void ArrowProjectile_Action3(Entity* this) {
diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c
index 33677de2..3f9858a9 100644
--- a/src/projectile/boneProjectile.c
+++ b/src/projectile/boneProjectile.c
@@ -2,10 +2,6 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
-extern void sub_08016AD2(Entity*);
-
extern void (*const BoneProjectile_Functions[])(Entity*);
extern void (*const BoneProjectile_Actions[])(Entity*);
@@ -36,9 +32,9 @@ void BoneProjectile_Init(Entity* this) {
void BoneProjectile_Action1(Entity* this) {
GetNextFrame(this);
- sub_080AF090(this);
+ ProcessMovement3(this);
if (this->collisions == 0) {
- if (IsProjectileOffScreen(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
sub_08016AD2(this);
@@ -54,7 +50,7 @@ void BoneProjectile_Action1(Entity* this) {
void BoneProjectile_Action2(Entity* this) {
GetNextFrame(this);
- sub_080AF090(this);
+ ProcessMovement3(this);
if (GravityUpdate(this, 0x1800) == 0) {
this->action = 3;
COLLISION_OFF(this);
diff --git a/src/projectile/cannonballProjectile.c b/src/projectile/cannonballProjectile.c
index 5e07dfc4..acf5ccd7 100644
--- a/src/projectile/cannonballProjectile.c
+++ b/src/projectile/cannonballProjectile.c
@@ -1,11 +1,6 @@
#include "entity.h"
#include "enemy.h"
-
-extern void CreateItemOnGround(Entity*);
-extern s32 sub_080AF090(Entity*);
-extern void sub_080043A8(Entity*);
-extern void CreateChestSpawner(Entity*);
-extern u32 IsColliding(Entity*, Entity*);
+#include "functions.h"
extern void (*const CannonballProjectile_Functions[])(Entity*);
extern void (*const CannonballProjectile_Actions[])(Entity*);
@@ -44,7 +39,7 @@ void CannonballProjectile_Init(Entity* this) {
void CannonballProjectile_Action1(Entity* this) {
GetNextFrame(this);
- if (sub_080AF090(this) == 0) {
+ if (ProcessMovement3(this) == 0) {
CreateFx(this, FX_DEATH, 0);
DeleteThisEntity();
}
@@ -53,7 +48,7 @@ void CannonballProjectile_Action1(Entity* this) {
void CannonballProjectile_Action2(Entity* this) {
GetNextFrame(this);
- sub_080AF090(this);
+ ProcessMovement3(this);
if ((sub_080AB634(this) == 0) && (this->collisions != 0)) {
CreateFx(this, FX_DEATH, 0);
DeleteThisEntity();
diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c
index 3afad118..785504ed 100644
--- a/src/projectile/dekuSeedProjectile.c
+++ b/src/projectile/dekuSeedProjectile.c
@@ -2,11 +2,6 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
-extern void sub_08016AD2(Entity*);
-extern u32 IsColliding(Entity*, Entity*);
-
extern void (*const DekuSeedProjectile_Functions[])(Entity*);
extern void (*const DekuSeedProjectile_Actions[])(Entity*);
@@ -54,8 +49,8 @@ void DekuSeedProjectile_Action1(Entity* this) {
Entity* parent;
GetNextFrame(this);
- if (sub_080AF090(this) != 0) {
- if (IsProjectileOffScreen(this) != 0) {
+ if (ProcessMovement3(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
sub_08016AD2(this);
@@ -75,20 +70,20 @@ void DekuSeedProjectile_Action1(Entity* this) {
this->knockbackDirection = -this->direction;
this->bitfield = 0x80;
this->knockbackDuration = 0xc;
- this->field_0x46 = 0;
+ this->knockbackSpeed = 0;
parent->iframes = 0x10;
parent->knockbackDirection = this->direction;
parent->bitfield = 0xc2;
parent->knockbackDuration = 0xc;
- parent->field_0x46 = 0;
+ parent->knockbackSpeed = 0;
}
}
}
void DekuSeedProjectile_Action2(Entity* this) {
GetNextFrame(this);
- if (sub_080AF090(this) != 0) {
- if (IsProjectileOffScreen(this) != 0) {
+ if (ProcessMovement3(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
if (--this->actionDelay == 0) {
@@ -112,7 +107,7 @@ void DekuSeedProjectile_Action3(Entity* this) {
void DekuSeedProjectile_Action4(Entity* this) {
GetNextFrame(this);
- sub_080AF090(this);
+ ProcessMovement3(this);
switch (sub_080044EC(this, 0x2800)) {
case 0:
DeleteThisEntity();
diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c
index 03769bb0..bda5e1a2 100644
--- a/src/projectile/dirtBallProjectile.c
+++ b/src/projectile/dirtBallProjectile.c
@@ -28,7 +28,7 @@ void DirtBallProjectile_OnTick(Entity* this) {
}
void sub_080A881C(Entity* this) {
- this->field_0x46 = 0;
+ this->knockbackSpeed = 0;
if (this->type == 0) {
this->parent->child = NULL;
if (this->bitfield == 0x80) {
diff --git a/src/projectile/fireProjectile.c b/src/projectile/fireProjectile.c
index c44a9b89..80fed65b 100644
--- a/src/projectile/fireProjectile.c
+++ b/src/projectile/fireProjectile.c
@@ -3,10 +3,6 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
-extern void sub_08016AD2(Entity*);
-
extern void (*const FireProjectile_Actions[])(Entity*);
void FireProjectile(Entity* this) {
@@ -52,8 +48,8 @@ void FireProjectile_Action1(Entity* this) {
void FireProjectile_Action2(Entity* this) {
GetNextFrame(this);
- if (sub_080AF090(this) != 0) {
- if (IsProjectileOffScreen(this) != 0) {
+ if (ProcessMovement3(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
sub_08016AD2(this);
diff --git a/src/projectile/guardLineOfSight.c b/src/projectile/guardLineOfSight.c
index e38ace8c..1dcdcaaf 100644
--- a/src/projectile/guardLineOfSight.c
+++ b/src/projectile/guardLineOfSight.c
@@ -62,7 +62,7 @@ void GuardLineOfSight(Entity* this) {
DeleteThisEntity();
}
LinearMoveUpdate(this);
- if (sub_080AE4CC(gUnk_02027EB4, this->x.HALF.HI, this->y.HALF.HI, 2) != 0) {
+ if (IsTileCollision(gUnk_02027EB4, this->x.HALF.HI, this->y.HALF.HI, 2)) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/gyorgMaleEnergyProjectile.c b/src/projectile/gyorgMaleEnergyProjectile.c
index f654133e..6a98e185 100644
--- a/src/projectile/gyorgMaleEnergyProjectile.c
+++ b/src/projectile/gyorgMaleEnergyProjectile.c
@@ -2,9 +2,7 @@
#include "enemy.h"
#include "coord.h"
#include "player.h"
-
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
+#include "functions.h"
extern void (*const GyorgMaleEnergyProjectile_Functions[])(Entity*);
extern void (*const GyorgMaleEnergyProjectile_Actions[])(Entity*);
@@ -72,9 +70,9 @@ void GyorgMaleEnergyProjectile_Action1(Entity* this) {
}
void GyorgMaleEnergyProjectile_Action2(Entity* this) {
- sub_080AF090(this);
+ ProcessMovement3(this);
GetNextFrame(this);
- if (IsProjectileOffScreen(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
if (--this->actionDelay == 0) {
@@ -86,7 +84,7 @@ void GyorgMaleEnergyProjectile_Action2(Entity* this) {
}
void GyorgMaleEnergyProjectile_Action3(Entity* this) {
- sub_080AF090(this);
+ ProcessMovement3(this);
GetNextFrame(this);
if ((this->frame & 0x80) != 0) {
DeleteThisEntity();
diff --git a/src/projectile/iceProjectile.c b/src/projectile/iceProjectile.c
index 52364a53..0f845d8e 100644
--- a/src/projectile/iceProjectile.c
+++ b/src/projectile/iceProjectile.c
@@ -3,10 +3,6 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
-extern void sub_08016AD2(Entity*);
-
extern void (*const IceProjectile_Actions[])(Entity*);
void IceProjectile(Entity* this) {
@@ -54,8 +50,8 @@ void IceProjectile_Action1(Entity* this) {
void IceProjectile_Action2(Entity* this) {
GetNextFrame(this);
- if (sub_080AF090(this) != 0) {
- if (IsProjectileOffScreen(this) != 0) {
+ if (ProcessMovement3(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
sub_08016AD2(this);
diff --git a/src/projectile/lakituLightning.c b/src/projectile/lakituLightning.c
index e6bb2cef..1f366e0f 100644
--- a/src/projectile/lakituLightning.c
+++ b/src/projectile/lakituLightning.c
@@ -1,8 +1,6 @@
#include "entity.h"
#include "enemy.h"
-
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
+#include "functions.h"
extern void (*const LakituLightning_Functions[])(Entity*);
extern void (*const LakituLightning_Actions[])(Entity*);
@@ -33,12 +31,12 @@ void LakituLightning_Init(Entity* this) {
void LakituLightning_Action1(Entity* this) {
GetNextFrame(this);
- sub_080AF090(this);
+ ProcessMovement3(this);
if ((this->collisions != 0) || (--this->actionDelay == 0)) {
CreateFx(this, FX_BLUE_EFC, 0);
DeleteThisEntity();
}
- if (IsProjectileOffScreen(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c
index 9d44a724..3dd794c3 100644
--- a/src/projectile/mandiblesProjectile.c
+++ b/src/projectile/mandiblesProjectile.c
@@ -46,7 +46,7 @@ void sub_080A9EBC(Entity* this) {
case 4:
this->field_0xf = 0;
ModHealth(-2);
- sub_080AF090(this);
+ ProcessMovement3(this);
UpdateAnimationSingleFrame(this);
break;
case 3:
diff --git a/src/projectile/moblinSpear.c b/src/projectile/moblinSpear.c
index a9c806e4..d2816076 100644
--- a/src/projectile/moblinSpear.c
+++ b/src/projectile/moblinSpear.c
@@ -28,7 +28,7 @@ void sub_080A832C(Entity* this) {
if (this->bitfield == 0x80) {
this->iframes = 0x10;
this->knockbackDuration = 0xc;
- this->field_0x46 = 0x180;
+ this->knockbackSpeed = 0x180;
this->parent->bitfield = this->bitfield;
}
tmp = this->iframes;
@@ -38,7 +38,7 @@ void sub_080A832C(Entity* this) {
this->parent->iframes = -tmp;
}
this->parent->knockbackDuration = this->knockbackDuration;
- this->parent->field_0x46 = this->field_0x46;
+ this->parent->knockbackSpeed = this->knockbackSpeed;
this->parent->knockbackDirection = this->knockbackDirection;
this->knockbackDuration = 0;
}
diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c
index 49d4b40f..659f748c 100644
--- a/src/projectile/octorokBossProjectile.c
+++ b/src/projectile/octorokBossProjectile.c
@@ -103,7 +103,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
this->parent->iframes = 0x1e;
if (this->parent->field_0x7c.BYTES.byte0 != 0) {
this->parent->knockbackDuration = 0x18;
- this->parent->field_0x46 = 0x200;
+ this->parent->knockbackSpeed = 0x200;
this->parent->knockbackDirection = this->direction >> 3;
}
SoundReq(SFX_BOSS_HIT);
@@ -113,7 +113,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
UpdateAnimationSingleFrame(this);
this->field_0x78.HWORD--;
LinearMoveAngle(this, this->speed, this->direction);
- sub_080AE58C(this, this->direction >> 3, 0);
+ CalculateEntityTileCollisions(this, this->direction >> 3, 0);
if ((this->collisions & 0xee00) != 0) {
this->direction = -this->direction;
}
@@ -150,7 +150,7 @@ void OctorokBossProjectile_Action1(Entity* this) {
}
GetNextFrame(this);
if (GravityUpdate(this, 0x1800) != 0) {
- sub_080AE58C(this, this->direction >> 3, 0);
+ CalculateEntityTileCollisions(this, this->direction >> 3, 0);
if (this->collisions == 0) {
LinearMoveAngle(this, (s32)this->speed, (u32)this->direction);
} else {
diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c
index 66e8388f..53266767 100644
--- a/src/projectile/rockProjectile.c
+++ b/src/projectile/rockProjectile.c
@@ -2,10 +2,6 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
-extern void sub_08016AD2(Entity*);
-
extern void (*const RockProjectile_Functions[])(Entity*);
extern void (*const RockProjectile_Actions[])(Entity*);
@@ -37,8 +33,8 @@ void RockProjectile_Init(Entity* this) {
void RockProjectile_Action1(Entity* this) {
GetNextFrame(this);
- if (sub_080AF090(this) != 0) {
- if (IsProjectileOffScreen(this) != 0) {
+ if (ProcessMovement3(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
sub_08016AD2(this);
@@ -63,7 +59,7 @@ void RockProjectile_Action2(Entity* this) {
void RockProjectile_Action3(Entity* this) {
GetNextFrame(this);
- sub_080AF090(this);
+ ProcessMovement3(this);
switch (sub_080044EC(this, 0x2800)) {
case 0:
DeleteEntity(this);
diff --git a/src/projectile/spikedRollers.c b/src/projectile/spikedRollers.c
index 6c68133b..5a9c63bb 100644
--- a/src/projectile/spikedRollers.c
+++ b/src/projectile/spikedRollers.c
@@ -1,5 +1,6 @@
#define NENT_DEPRECATED
#include "entity.h"
+#include "functions.h"
typedef struct {
Entity base;
@@ -11,8 +12,6 @@ typedef struct {
u16 speed2;
} SpikedRollersEntity;
-extern s32 sub_080AF090(Entity*);
-
static void (*const SpikedRollers_Actions[])(SpikedRollersEntity*);
static const u8 gSpikedRollersOffsets[];
@@ -49,7 +48,7 @@ void sub_080ABA74(SpikedRollersEntity* this) {
void sub_080ABAE0(SpikedRollersEntity* this) {
s32 diff, unk_0x6c;
- sub_080AF090(super);
+ ProcessMovement3(super);
if (super->type2 == 0) {
diff = super->x.HALF.HI - this->x2;
diff --git a/src/projectile/torchTrapProjectile.c b/src/projectile/torchTrapProjectile.c
index 046d8062..5ff167c0 100644
--- a/src/projectile/torchTrapProjectile.c
+++ b/src/projectile/torchTrapProjectile.c
@@ -2,9 +2,6 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
-
extern void (*const TorchTrapProjectile_Functions[])(Entity*);
extern void (*const TorchTrapProjectile_Actions[])(Entity*);
@@ -31,7 +28,7 @@ void TorchTrapProjectile_Action1(Entity* this) {
if (this->actionDelay != 0) {
this->actionDelay -= 1;
} else {
- if (sub_080AF090(this) == 0) {
+ if (ProcessMovement3(this) == 0) {
LinearMoveUpdate(this);
} else {
this->action = 2;
@@ -41,11 +38,11 @@ void TorchTrapProjectile_Action1(Entity* this) {
void TorchTrapProjectile_Action2(Entity* this) {
GetNextFrame(this);
- sub_080AF090(this);
+ ProcessMovement3(this);
if (this->collisions != 0) {
DeleteThisEntity();
}
- if (IsProjectileOffScreen(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c
index fc863d53..e329945c 100644
--- a/src/projectile/v2Projectile.c
+++ b/src/projectile/v2Projectile.c
@@ -10,11 +10,6 @@ extern void (*const gUnk_0812A7F8[])(Entity*);
extern void (*const gUnk_0812A800[])(Entity*);
extern void (*const gUnk_0812A808[])(Entity*);
-extern void SoundReqClipped(Entity*, u32);
-extern void sub_08079D84(void);
-
-extern s32 sub_080AF090(Entity*);
-
void V2Projectile(Entity* this) {
V2Projectile_Functions[GetNextFunction(this)](this);
}
@@ -108,7 +103,7 @@ void sub_080ABD44(Entity* this) {
this->action = 2;
InitializeAnimation(this, 1);
}
- sub_080AF090(this);
+ ProcessMovement3(this);
GetNextFrame(this);
}
diff --git a/src/projectile/v3ElectricProjectile.c b/src/projectile/v3ElectricProjectile.c
index e83e68f7..c52258cd 100644
--- a/src/projectile/v3ElectricProjectile.c
+++ b/src/projectile/v3ElectricProjectile.c
@@ -4,9 +4,6 @@
#include "coord.h"
#include "functions.h"
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
-
extern void (*const V3ElectricProjectile_Functions[])(Entity*);
extern void (*const V3ElectricProjectile_Actions[])(Entity*);
static const u16 projectileSpeeds[];
@@ -98,12 +95,12 @@ void V3ElectricProjectile_Action2(Entity* this) {
if (this->z.HALF.HI < -6) {
this->z.HALF.HI += 3;
}
- sub_080AF090(this);
+ ProcessMovement3(this);
if (this->collisions != 0) {
DeleteThisEntity();
}
GetNextFrame(this);
- if (IsProjectileOffScreen(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
if (this->actionDelay < 0x1e) {
diff --git a/src/projectile/v3HandProjectile.c b/src/projectile/v3HandProjectile.c
index d308b7d9..4d4c55bf 100644
--- a/src/projectile/v3HandProjectile.c
+++ b/src/projectile/v3HandProjectile.c
@@ -1,9 +1,7 @@
#include "entity.h"
#include "enemy.h"
#include "player.h"
-
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
+#include "functions.h"
extern void (*const V3HandProjectile_Functions[])(Entity*);
@@ -21,12 +19,12 @@ void V3HandProjectile_OnTick(Entity* this) {
if (this->z.HALF.HI < -6) {
this->z.HALF.HI += 2;
}
- sub_080AF090(this);
+ ProcessMovement3(this);
if (this->collisions != 0) {
DeleteThisEntity();
}
GetNextFrame(this);
- if (IsProjectileOffScreen(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/v3TennisBallProjectile.c b/src/projectile/v3TennisBallProjectile.c
index b25cbf48..455f67af 100644
--- a/src/projectile/v3TennisBallProjectile.c
+++ b/src/projectile/v3TennisBallProjectile.c
@@ -1,8 +1,6 @@
#include "entity.h"
#include "enemy.h"
-
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
+#include "functions.h"
extern void (*const V3TennisBallProjectile_Functions[])(Entity*);
extern void (*const V3TennisBallProjectile_Actions[])(Entity*);
@@ -55,21 +53,21 @@ void V3TennisBallProjectile_Init(Entity* this) {
}
void V3TennisBallProjectile_Action1(Entity* this) {
- sub_080AF090(this);
+ ProcessMovement3(this);
GetNextFrame(this);
- if (IsProjectileOffScreen(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
}
void V3TennisBallProjectile_Action2(Entity* this) {
- sub_080AF090(this);
+ ProcessMovement3(this);
if (this->collisions != 0) {
DeleteThisEntity();
}
GetNextFrame(this);
sub_080ACB90(this);
- if (IsProjectileOffScreen(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/windProjectile.c b/src/projectile/windProjectile.c
index b5b1133b..96211f1b 100644
--- a/src/projectile/windProjectile.c
+++ b/src/projectile/windProjectile.c
@@ -2,10 +2,6 @@
#include "enemy.h"
#include "functions.h"
-extern s32 sub_080AF090(Entity*);
-extern s32 IsProjectileOffScreen(Entity*);
-extern void sub_08016AD2(Entity*);
-
extern void (*const WindProjectile_Actions[])(Entity*);
void WindProjectile(Entity* this) {
@@ -58,8 +54,8 @@ void WindProjectile_Action1(Entity* this) {
void WindProjectile_Action2(Entity* this) {
GetNextFrame(this);
- if (sub_080AF090(this) != 0) {
- if (IsProjectileOffScreen(this) != 0) {
+ if (ProcessMovement3(this) != 0) {
+ if (IsProjectileOffScreen(this)) {
DeleteEntity(this);
} else {
sub_08016AD2(this);
diff --git a/src/projectile/winder.c b/src/projectile/winder.c
index 56962f4e..bbc49d0d 100644
--- a/src/projectile/winder.c
+++ b/src/projectile/winder.c
@@ -50,7 +50,7 @@ void Winder_Init(Entity* this) {
void sub_080AB950(Entity* this) {
if (this->type == 0) {
u8 dir;
- ProcessMovement(this);
+ ProcessMovement0(this);
dir = this->direction >> 3;
if (((gUnk_0812A6C4)[dir] & this->collisions) || sub_080AB9FC(this, this->direction)) {
this->direction = gUnk_0812A6BC[(Random() & 0x1) + (dir << 1)];