summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2022-03-17 19:13:56 -0700
committertheo3 <arisstephenson2@gmail.com>2022-03-17 19:16:43 -0700
commitef470547e04f2cbc50b98d6578932f1188d25dbd (patch)
tree4a5e5bffb8ea301bd15b8bda4627c48ccf052cce /src
parent33579844948ca5c2ed9e1e353fba8b9571f7104d (diff)
cleanup
Diffstat (limited to 'src')
-rw-r--r--src/affine.c2
-rw-r--r--src/code_0805EC04.c26
-rw-r--r--src/collision.c2
-rw-r--r--src/color.c2
-rw-r--r--src/coord.c16
-rw-r--r--src/enemy/acroBandits.c14
-rw-r--r--src/enemy/armos.c12
-rw-r--r--src/enemy/ballChainSoldier.c2
-rw-r--r--src/enemy/beetle.c8
-rw-r--r--src/enemy/bobomb.c4
-rw-r--r--src/enemy/bombPeahat.c10
-rw-r--r--src/enemy/businessScrub.c8
-rw-r--r--src/enemy/businessScrubPrologue.c10
-rw-r--r--src/enemy/chaser.c2
-rw-r--r--src/enemy/chuchu.c34
-rw-r--r--src/enemy/cuccoAggr.c4
-rw-r--r--src/enemy/curtain.c4
-rw-r--r--src/enemy/darkNut.c26
-rw-r--r--src/enemy/doorMimic.c4
-rw-r--r--src/enemy/enemy4D.c2
-rw-r--r--src/enemy/enemy50.c4
-rw-r--r--src/enemy/enemy64.c2
-rw-r--r--src/enemy/enemyE.c2
-rw-r--r--src/enemy/eyegore.c12
-rw-r--r--src/enemy/flyingSkull.c4
-rw-r--r--src/enemy/ghini.c2
-rw-r--r--src/enemy/gibdo.c4
-rw-r--r--src/enemy/gleerok.c10
-rw-r--r--src/enemy/gyorgFemaleEye.c6
-rw-r--r--src/enemy/gyorgMale.c6
-rw-r--r--src/enemy/gyorgMaleEye.c4
-rw-r--r--src/enemy/helmasaur.c4
-rw-r--r--src/enemy/keaton.c2
-rw-r--r--src/enemy/keese.c2
-rw-r--r--src/enemy/lakitu.c6
-rw-r--r--src/enemy/leever.c4
-rw-r--r--src/enemy/madderpillar.c4
-rw-r--r--src/enemy/mazaalBracelet.c42
-rw-r--r--src/enemy/mazaalHead.c4
-rw-r--r--src/enemy/moldworm.c2
-rw-r--r--src/enemy/octorok.c6
-rw-r--r--src/enemy/octorokBoss.c14
-rw-r--r--src/enemy/octorokGolden.c2
-rw-r--r--src/enemy/peahat.c4
-rw-r--r--src/enemy/puffstool.c4
-rw-r--r--src/enemy/rollobite.c10
-rw-r--r--src/enemy/rope.c2
-rw-r--r--src/enemy/rupeeLike.c4
-rw-r--r--src/enemy/scissorsBeetle.c2
-rw-r--r--src/enemy/sluggula.c4
-rw-r--r--src/enemy/spinyBeetle.c2
-rw-r--r--src/enemy/spinyChuchu.c8
-rw-r--r--src/enemy/stalfos.c2
-rw-r--r--src/enemy/tektite.c8
-rw-r--r--src/enemy/tektiteGolden.c8
-rw-r--r--src/enemy/vaatiArm.c2
-rw-r--r--src/enemy/vaatiBall.c2
-rw-r--r--src/enemy/vaatiProjectile.c2
-rw-r--r--src/enemy/vaatiRebornEnemy.c6
-rw-r--r--src/enemy/vaatiTransfigured.c8
-rw-r--r--src/enemy/vaatiTransfiguredEye.c6
-rw-r--r--src/enemy/vaatiWrath.c8
-rw-r--r--src/enemy/vaatiWrathEye.c8
-rw-r--r--src/enemy/wallMaster.c6
-rw-r--r--src/enemy/wallMaster2.c4
-rw-r--r--src/enemy/waterDrop.c2
-rw-r--r--src/entity.c29
-rw-r--r--src/game.c2
-rw-r--r--src/interrupts.c4
-rw-r--r--src/item/itemBomb.c6
-rw-r--r--src/item/itemBoomerang.c4
-rw-r--r--src/item/itemBow.c10
-rw-r--r--src/item/itemDebug.c4
-rw-r--r--src/item/itemGustJar.c22
-rw-r--r--src/item/itemJarEmpty.c4
-rw-r--r--src/item/itemLantern.c8
-rw-r--r--src/item/itemMoleMitts.c6
-rw-r--r--src/item/itemOcarina.c4
-rw-r--r--src/item/itemPacciCane.c4
-rw-r--r--src/item/itemPegasusBoots.c12
-rw-r--r--src/item/itemRocsCape.c4
-rw-r--r--src/item/itemShield.c4
-rw-r--r--src/item/itemSword.c6
-rw-r--r--src/item/itemTryPickupObject.c4
-rw-r--r--src/manager/manager1A.c4
-rw-r--r--src/menu/kinstone_menu.c4
-rw-r--r--src/npc/beedle.c2
-rw-r--r--src/npc/bladeBrothers.c6
-rw-r--r--src/npc/brocco.c2
-rw-r--r--src/npc/castorWildsStatue.c2
-rw-r--r--src/npc/cat.c8
-rw-r--r--src/npc/cucco.c2
-rw-r--r--src/npc/dog.c4
-rw-r--r--src/npc/drLeft.c2
-rw-r--r--src/npc/festari.c2
-rw-r--r--src/npc/goronMerchant.c4
-rw-r--r--src/npc/gregal.c2
-rw-r--r--src/npc/mailbox.c2
-rw-r--r--src/npc/mama.c2
-rw-r--r--src/npc/minishEzlo.c2
-rw-r--r--src/npc/npc5.c16
-rw-r--r--src/npc/npc9.c2
-rw-r--r--src/npc/pina.c2
-rw-r--r--src/npc/rem.c16
-rw-r--r--src/npc/smith.c2
-rw-r--r--src/npc/townMinish.c2
-rw-r--r--src/npc/vaatiReborn.c4
-rw-r--r--src/npc/zelda.c2
-rw-r--r--src/npcUtils.c2
-rw-r--r--src/object/angryStatue.c2
-rw-r--r--src/object/beanstalk.c10
-rw-r--r--src/object/bigIceBlock.c4
-rw-r--r--src/object/bigPushableLever.c2
-rw-r--r--src/object/bigVortex.c2
-rw-r--r--src/object/bird.c2
-rw-r--r--src/object/bollard.c4
-rw-r--r--src/object/bossDoor.c2
-rw-r--r--src/object/chestSpawner.c2
-rw-r--r--src/object/crenelBeanSprout.c8
-rw-r--r--src/object/deathFx.c6
-rw-r--r--src/object/eyeSwitch.c4
-rw-r--r--src/object/ezloCap.c6
-rw-r--r--src/object/fan.c2
-rw-r--r--src/object/figurineDevice.c4
-rw-r--r--src/object/frozenWaterElement.c6
-rw-r--r--src/object/gentariCurtains.c4
-rw-r--r--src/object/greatFairy.c12
-rw-r--r--src/object/heartContainer.c2
-rw-r--r--src/object/jailBars.c12
-rw-r--r--src/object/lavaPlatform.c6
-rw-r--r--src/object/lilypadLarge.c12
-rw-r--r--src/object/lilypadSmall.c2
-rw-r--r--src/object/litArea.c4
-rw-r--r--src/object/macroBook.c8
-rw-r--r--src/object/macroPlayer.c4
-rw-r--r--src/object/minecart.c4
-rw-r--r--src/object/mineralWaterSource.c7
-rw-r--r--src/object/object15.c2
-rw-r--r--src/object/object1E.c2
-rw-r--r--src/object/object20.c2
-rw-r--r--src/object/object21.c2
-rw-r--r--src/object/object2B.c2
-rw-r--r--src/object/object36.c4
-rw-r--r--src/object/object3D.c4
-rw-r--r--src/object/object3E.c2
-rw-r--r--src/object/object43.c2
-rw-r--r--src/object/object44.c2
-rw-r--r--src/object/object49.c2
-rw-r--r--src/object/object4B.c8
-rw-r--r--src/object/object61.c2
-rw-r--r--src/object/object64.c8
-rw-r--r--src/object/object66.c2
-rw-r--r--src/object/object67.c12
-rw-r--r--src/object/object6A.c12
-rw-r--r--src/object/object86.c6
-rw-r--r--src/object/object9B.c2
-rw-r--r--src/object/objectA2.c2
-rw-r--r--src/object/objectAF.c2
-rw-r--r--src/object/objectB3.c2
-rw-r--r--src/object/objectC1.c2
-rw-r--r--src/object/objectOnPillar.c4
-rw-r--r--src/object/objectOnSpinyBeetle.c2
-rw-r--r--src/object/octorokBossObject.c6
-rw-r--r--src/object/playerClone.c2
-rw-r--r--src/object/pot.c8
-rw-r--r--src/object/pullableLever.c2
-rw-r--r--src/object/pullableMushroom.c28
-rw-r--r--src/object/pushableLever.c2
-rw-r--r--src/object/pushableRock.c4
-rw-r--r--src/object/pushableStatue.c2
-rw-r--r--src/object/smallIceBlock.c4
-rw-r--r--src/object/smoke.c2
-rw-r--r--src/object/specialFx.c8
-rw-r--r--src/player.c53
-rw-r--r--src/playerItem/playerItem11.c2
-rw-r--r--src/playerItem/playerItem12.c4
-rw-r--r--src/playerItem/playerItem3.c2
-rw-r--r--src/playerItem/playerItemBomb.c4
-rw-r--r--src/playerItem/playerItemBottle.c3
-rw-r--r--src/playerItem/playerItemGustJar.c6
-rw-r--r--src/playerItem/playerItemLantern.c3
-rw-r--r--src/playerItem/playerItemPacciCane.c2
-rw-r--r--src/playerUtils.c79
-rw-r--r--src/projectile/dekuSeedProjectile.c2
-rw-r--r--src/projectile/dirtBallProjectile.c6
-rw-r--r--src/projectile/fireProjectile.c2
-rw-r--r--src/projectile/gleerokProjectile.c4
-rw-r--r--src/projectile/gyorgMaleEnergyProjectile.c2
-rw-r--r--src/projectile/iceProjectile.c2
-rw-r--r--src/projectile/mandiblesProjectile.c2
-rw-r--r--src/projectile/mazaalEnergyBeam.c2
-rw-r--r--src/projectile/moblinSpear.c4
-rw-r--r--src/projectile/spiderWeb.c10
-rw-r--r--src/projectile/v1EyeLaser.c2
-rw-r--r--src/projectile/v1FireProjectile.c4
-rw-r--r--src/projectile/v2Projectile.c2
-rw-r--r--src/projectile/windProjectile.c2
-rw-r--r--src/script.c10
-rw-r--r--src/subtask2.c2
199 files changed, 603 insertions, 603 deletions
diff --git a/src/affine.c b/src/affine.c
index f0e2549b..00ee3c32 100644
--- a/src/affine.c
+++ b/src/affine.c
@@ -55,7 +55,7 @@ void CopyOAM(void) {
void DrawEntities(void) {
void (*fn)(void);
- gOAMControls._0[6] = gRoomTransition.field_0x2c[3] ? 15 : 0;
+ gOAMControls._0[6] = gRoomTransition.field_0x2c[2] ? 15 : 0;
gOAMControls._4 = gRoomControls.aff_x + gRoomControls.scroll_x;
gOAMControls._6 = gRoomControls.aff_y + gRoomControls.scroll_y;
gOAMControls.field_0x1++;
diff --git a/src/code_0805EC04.c b/src/code_0805EC04.c
index 37996780..42f1403a 100644
--- a/src/code_0805EC04.c
+++ b/src/code_0805EC04.c
@@ -32,7 +32,7 @@ void sub_0805EC60(Entity* this) {
}
}
-ASM_FUNC("asm/non_matching/sub_0805EC9C.inc", bool32 sub_0805EC9C(Entity* ent, u32 param_2, u32 param_3, u32 param_4))
+ASM_FUNC("asm/non_matching/SetAffineInfo.inc", bool32 SetAffineInfo(Entity* ent, u32 param_2, u32 param_3, u32 param_4))
void sub_0805ECEC(int param_1, u32 param_2, u32 param_3, u32 param_4) {
u16* temp;
@@ -45,46 +45,46 @@ void sub_0805ECEC(int param_1, u32 param_2, u32 param_3, u32 param_4) {
temp[2] = param_4;
}
-void sub_0805ED14(u32 param_1) {
+void InitPlayerMacro(u32 param_1) {
gPlayerState.field_0x9c = param_1;
gPlayerState.field_0x98 = 0;
gPlayerState.field_0x9a = 0;
}
-ASM_FUNC("asm/non_matching/code_0805EC04/sub_0805ED30.inc", void sub_0805ED30())
+ASM_FUNC("asm/non_matching/code_0805EC04/UpdatePlayerInput.inc", void UpdatePlayerInput())
-u32 sub_0805EE04(u32 param_1) {
- u32 result = (s32) - (param_1 & 0x200) >> 0x1f & 0x1000;
- if ((param_1 & 0x100) != 0) {
+u32 ConvInputToState(u32 keys) {
+ u32 result = (s32) - (keys & 0x200) >> 0x1f & 0x1000;
+ if (keys & R_BUTTON) {
result |= 0x20;
result |= 0x8000;
result |= 0x80;
}
- if ((param_1 & 1) != 0) {
+ if (keys & A_BUTTON) {
result |= 0x8;
result |= 0x41;
}
- if ((param_1 & 2) != 0) {
+ if (keys & B_BUTTON) {
result |= 0x10;
result |= 0x2;
}
- if ((param_1 & 0x10) != 0) {
+ if (keys & DPAD_RIGHT) {
result |= 0x100;
}
- if ((param_1 & 0x20) != 0) {
+ if (keys & DPAD_LEFT) {
result |= 0x200;
}
- if ((param_1 & 0x40) != 0) {
+ if (keys & DPAD_UP) {
result |= 0x400;
}
- if ((param_1 & 0x80) != 0) {
+ if (keys & DPAD_DOWN) {
result |= 0x800;
}
return result;
}
void sub_0805EE88(void) {
- if ((gRoomTransition.field_0x2c[3] != 0) && ((gRoomTransition.frameCount & 3) == 0)) {
+ if ((gRoomTransition.field_0x2c[2] != 0) && ((gRoomTransition.frameCount & 3) == 0)) {
LoadPaletteGroup((((u32)gRoomTransition.frameCount & 0xc) >> 2) + 0x2f);
}
}
diff --git a/src/collision.c b/src/collision.c
index 9832b61c..52bd8d27 100644
--- a/src/collision.c
+++ b/src/collision.c
@@ -370,7 +370,7 @@ s32 sub_08017B1C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if ((tgt->field_0x3a & 4) != 0) {
if (tgt->field_0x1d) {
- s32 x = tgt->field_0x1d = tgt->field_0x1d - gPlayerState.field_0x1d;
+ s32 x = tgt->field_0x1d = tgt->field_0x1d - gPlayerState.gustJarSpeed;
if (x << 24 <= 0) {
tgt->field_0x1d = 0;
tgt->subAction = 2;
diff --git a/src/color.c b/src/color.c
index 6e243a88..301e5613 100644
--- a/src/color.c
+++ b/src/color.c
@@ -47,7 +47,7 @@ void sub_0801D000(u32 a1) {
tmp = 0;
}
- roomTransition->field_0x2c[3] = tmp;
+ roomTransition->field_0x2c[2] = tmp;
if (a1) {
CleanUpObjPalettes();
sub_0801CFD0(0xf);
diff --git a/src/coord.c b/src/coord.c
index 61cfb199..629f700a 100644
--- a/src/coord.c
+++ b/src/coord.c
@@ -20,7 +20,6 @@ extern const u16 gUnk_080047F6[];
u32 sub_0806F58C(Entity*, Entity*);
u32 sub_0806FCA0(Entity*, Entity*);
-void UnloadHitbox(Entity*);
extern u32 sub_08007DD6(u32, const u16*);
u32 PointInsideRadius(s32 x, s32 y, s32 radius);
extern void sub_0806FEE8(struct_gUnk_020000C0_1*, u32, u32, u32);
@@ -61,7 +60,7 @@ bool32 sub_0806F3E4(Entity* ent) {
if ((gPlayerState.field_0x1c & 0x7F) != 1)
return 0;
- switch (gPlayerState.field_0x1d) {
+ switch (gPlayerState.gustJarSpeed) {
case 1:
ent->knockbackSpeed += 64;
break;
@@ -329,12 +328,12 @@ void sub_0806FA90(Entity* source, Entity* target, s32 offsetX, s32 offsetY) {
PositionRelative(source, target, Q_16_16(offsetX), Q_16_16(offsetY));
}
-void SortEntityAbove(Entity* param_1, Entity* param_2) {
- param_2->spritePriority.b0 = gSpriteSortAboveTable[param_1->spritePriority.b0];
+void SortEntityAbove(Entity* below_ent, Entity* above_ent) {
+ above_ent->spritePriority.b0 = gSpriteSortAboveTable[below_ent->spritePriority.b0];
}
-void SortEntityBelow(Entity* param_1, Entity* param_2) {
- param_2->spritePriority.b0 = gSpriteSortBelowTable[param_1->spritePriority.b0];
+void SortEntityBelow(Entity* above_ent, Entity* below_ent) {
+ below_ent->spritePriority.b0 = gSpriteSortBelowTable[above_ent->spritePriority.b0];
}
void sub_0806FB00(Entity* ent, u32 param_1, u32 param_2, u32 param_3) {
@@ -380,9 +379,10 @@ void sub_0806FBB4(Entity* ent) {
}
}
-void AllocMutableHitbox(Entity* ent) {
+void* AllocMutableHitbox(Entity* ent) {
UnloadHitbox(ent);
ent->hitbox = zMalloc(sizeof(Hitbox3D));
+ return ent->hitbox;
}
void UnloadHitbox(Entity* ent) {
@@ -538,7 +538,7 @@ u32 LoadExtraSpriteData(Entity* ent, const SpriteLoadData* data) {
return 1;
}
-void sub_0806FE84(Entity* ent) {
+void UnloadOBJPalette2(Entity* ent) {
u32 index;
u32 spriteAnimation = ent->spriteAnimation[2];
ent->spriteAnimation[2] = 0;
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c
index 0edf6d34..34d0ea7c 100644
--- a/src/enemy/acroBandits.c
+++ b/src/enemy/acroBandits.c
@@ -155,7 +155,7 @@ void sub_08031B48(Entity* this) {
this->frame = 0;
COLLISION_ON(this);
} else {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 0x3;
this->actionDelay = gUnk_080CE5B0[Random() & 7];
InitializeAnimation(this, 1);
@@ -188,7 +188,7 @@ void sub_08031B98(Entity* this) {
void sub_08031C1C(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = '\x01';
this->actionDelay = gUnk_080CE5B8[Random() & 7];
this->spriteSettings.draw = 0;
@@ -199,7 +199,7 @@ void sub_08031C58(Entity* this) {
Entity *a, *b;
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (gEntCount < 0x43) {
u32 tmp = Random();
tmp &= 3;
@@ -274,7 +274,7 @@ void sub_08031DA0(Entity* this) {
}
void sub_08031DC4(Entity* this) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->actionDelay = 0xb4;
this->spriteSettings.draw = 0;
@@ -360,7 +360,7 @@ void sub_08031F54(Entity* this) {
void sub_08031FB0(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) && (this->parent || --this->actionDelay == 0)) {
+ if ((this->frame & ANIM_DONE) && (this->parent || --this->actionDelay == 0)) {
this->action = 4;
this->direction = sub_08049F84(this, 1);
*(u8*)&this->field_0x76 = 0;
@@ -469,7 +469,7 @@ void sub_08032204(Entity* this) {
this->frame = 0;
this->frameDuration = (Random() & 0x30) + 30;
} else {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 9;
InitializeAnimation(this, 13);
}
@@ -478,7 +478,7 @@ void sub_08032204(Entity* this) {
void sub_08032248(Entity* this) {
if (GravityUpdate(this, Q_8_8(24.0)) == 0) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
((Entity*)this->field_0x7c.WORD)->actionDelay--;
DeleteEntity(this);
diff --git a/src/enemy/armos.c b/src/enemy/armos.c
index 829e195d..0fd596a2 100644
--- a/src/enemy/armos.c
+++ b/src/enemy/armos.c
@@ -113,7 +113,7 @@ void sub_080301D4(ArmosEntity* this) {
void sub_08030240(ArmosEntity* this) {
if (super->animIndex == 6) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
GetNextFrame(super);
}
}
@@ -188,8 +188,8 @@ void sub_08030338(ArmosEntity* this) {
EnqueueSFX(SFX_12A);
return;
}
- bVar2 = super->frame & 0x80;
- if ((super->frame & 0x80) != 0) {
+ bVar2 = super->frame & ANIM_DONE;
+ if ((super->frame & ANIM_DONE) != 0) {
if (this->unk_80 != 2) {
super->action = 3;
super->animationState = 0xff;
@@ -244,7 +244,7 @@ NONMATCH("asm/non_matching/armos/sub_080304BC.inc", void sub_080304BC(ArmosEntit
u32 tmp;
sub_080309A8(this);
- tmp = super->frame & 0x80;
+ tmp = super->frame & ANIM_DONE;
if (tmp != 0) {
sub_08030580(this);
} else {
@@ -267,7 +267,7 @@ void sub_080304F4(ArmosEntity* this) {
}
void sub_08030524(ArmosEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
sub_080309A8(this);
} else if (super->frame == 1) {
super->frame = 0;
@@ -277,7 +277,7 @@ void sub_08030524(ArmosEntity* this) {
void sub_08030554(ArmosEntity* this) {
sub_080309A8(this);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
sub_080309C8(this, (u32)super->animationState);
sub_080306C4(this);
diff --git a/src/enemy/ballChainSoldier.c b/src/enemy/ballChainSoldier.c
index f29df68c..9e1ef699 100644
--- a/src/enemy/ballChainSoldier.c
+++ b/src/enemy/ballChainSoldier.c
@@ -150,7 +150,7 @@ void sub_0803E71C(BallChainSoldierEntity* this) {
}
void sub_0803E75C(BallChainSoldierEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
UpdateAnimationSingleFrame(super);
} else {
if (--super->actionDelay == 0) {
diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c
index 207cf1c7..25e104c8 100644
--- a/src/enemy/beetle.c
+++ b/src/enemy/beetle.c
@@ -117,7 +117,7 @@ void sub_080218CC(Entity* this) {
this->frameDuration = 1;
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = (Random() & 0x38) + 8;
this->field_0xf = 1;
@@ -209,7 +209,7 @@ void sub_08021AD8(Entity* this) {
this->frameDuration = 1;
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = 20;
((u8*)&this->field_0x86)[0] = 60;
@@ -268,7 +268,7 @@ void sub_08021C58(Entity* this) {
this->frameDuration = 1;
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = 60;
this->field_0xf = 1;
@@ -280,7 +280,7 @@ void sub_08021C58(Entity* this) {
}
void sub_08021CD0(Entity* this) {
- if ((this->frame & 0x80) == 0)
+ if ((this->frame & ANIM_DONE) == 0)
GetNextFrame(this);
if (sub_08049F84(this, 1) == 0xff)
diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c
index 42c3d2b1..7e214b63 100644
--- a/src/enemy/bobomb.c
+++ b/src/enemy/bobomb.c
@@ -245,7 +245,7 @@ void sub_0802CAF8(Entity* this) {
EnqueueSFX(SFX_104);
}
sub_0802CC18(this);
- sub_08078930(this);
+ RegisterCarryEntity(this);
if (this->field_0xf && this->z.HALF.HI == 0) {
this->field_0xf = 0;
COLLISION_ON(this);
@@ -286,7 +286,7 @@ void sub_0802CBC4(Entity* this) {
if (this->field_0x82.HALF.HI) {
sub_08079184();
}
- sub_08078954(this);
+ FreeCarryEntity(this);
ent = CreateObjectWithParent(this, OBJECT_20, 0, 0);
if (ent) {
diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c
index 5a1a80f3..5c327b91 100644
--- a/src/enemy/bombPeahat.c
+++ b/src/enemy/bombPeahat.c
@@ -289,7 +289,7 @@ void sub_0802AB40(Entity* this) {
#endif
void sub_0802AC08(Entity* this) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->subAction = 0;
this->actionDelay = 0x40;
@@ -470,7 +470,7 @@ void sub_0802AED4(Entity* this) {
}
} else {
if (!sub_0800442E(this)) {
- sub_08078930(this);
+ RegisterCarryEntity(this);
}
}
if (this->type2 != 0 && this->field_0x80.HALF.HI) {
@@ -535,7 +535,7 @@ NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entit
this->field_0x82.HWORD ^= 0x8000;
}
tmp = 0x130 - (this->field_0x82.HWORD & 0xf0);
- sub_0805EC9C(this, tmp, tmp, 0);
+ SetAffineInfo(this, tmp, tmp, 0);
}
if (this->field_0xf & flag) {
this->palette.b.b0 = this->palette.b.b4;
@@ -572,7 +572,7 @@ void sub_0802B048(Entity* this) {
this->field_0xf = 0x50;
this->field_0x82.HWORD = 0;
this->spriteRendering.b0 = 3;
- sub_0805EC9C(this, 0x100, 0x100, 0);
+ SetAffineInfo(this, 0x100, 0x100, 0);
}
} else {
if (this->field_0xf) {
@@ -587,7 +587,7 @@ void sub_0802B048(Entity* this) {
this->spriteSettings.draw = 0;
COLLISION_ON(this);
this->field_0x7a.HALF.HI = 0;
- sub_08078954(this);
+ FreeCarryEntity(this);
if (this->parent->next) {
this->parent->field_0x80.HALF.HI = 0;
}
diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c
index 6c71441d..8283894b 100644
--- a/src/enemy/businessScrub.c
+++ b/src/enemy/businessScrub.c
@@ -112,7 +112,7 @@ void sub_08028A74(Entity* this) {
switch (this->subAction) {
case 0:
unk = 1;
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->subAction = 1;
this->actionDelay = 0x3c;
this->field_0xf = 0x10;
@@ -150,7 +150,7 @@ void sub_08028A74(Entity* this) {
break;
case 3:
unk = 2;
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->subAction = 4;
this->actionDelay = 0x50;
sub_080290E0(this, 1);
@@ -189,7 +189,7 @@ void sub_08028BC4(Entity* this) {
switch (this->subAction) {
case 0:
if (this->actionDelay == 0) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->subAction = 1;
sub_08028FDC(this);
sub_080290E0(this, 5);
@@ -200,7 +200,7 @@ void sub_08028BC4(Entity* this) {
}
break;
case 1:
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 4;
this->subAction = 0;
this->actionDelay = 0x1e;
diff --git a/src/enemy/businessScrubPrologue.c b/src/enemy/businessScrubPrologue.c
index 036c4e19..f87040f3 100644
--- a/src/enemy/businessScrubPrologue.c
+++ b/src/enemy/businessScrubPrologue.c
@@ -100,7 +100,7 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) {
switch (super->subAction) {
case 0:
r6 = 1;
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->subAction = 1;
super->actionDelay = 0x3c;
super->field_0xf = 0x10;
@@ -133,7 +133,7 @@ void sub_08045CE0(BusinessScrubPrologueEntity* this) {
break;
case 3:
r6 = 2;
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->subAction = 4;
super->actionDelay = 0x50;
sub_08046030(this, 1);
@@ -170,7 +170,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) {
switch (super->subAction) {
case 0:
if (super->actionDelay == 0) {
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->subAction = 1;
sub_08045F98(this);
sub_08046030(this, 5);
@@ -181,7 +181,7 @@ void sub_08045E14(BusinessScrubPrologueEntity* this) {
}
break;
case 1:
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->action = 5;
super->subAction = 0;
sub_08046030(this, 0);
@@ -222,7 +222,7 @@ void sub_08045EDC(BusinessScrubPrologueEntity* this) {
super->frame &= 0xfe;
sub_080954AC(super, this->unk_84);
EnqueueSFX(SFX_18D);
- } else if (super->frame & 0x80) {
+ } else if (super->frame & ANIM_DONE) {
super->action = 5;
super->subAction = 0;
sub_08046030(this, 1);
diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c
index 16a61b2a..24dca7cf 100644
--- a/src/enemy/chaser.c
+++ b/src/enemy/chaser.c
@@ -64,7 +64,7 @@ void sub_0802B56C(Entity* this) {
void sub_0802B5C8(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->actionDelay = 30;
InitializeAnimation(this, 0);
diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c
index 8521f64b..9f23dd3b 100644
--- a/src/enemy/chuchu.c
+++ b/src/enemy/chuchu.c
@@ -155,7 +155,7 @@ void Chuchu_OnDeath(Entity* this) {
}
void Chuchu_OnConfused(Entity* this) {
- if ((this->frame & 0x80) == 0)
+ if ((this->frame & ANIM_DONE) == 0)
GetNextFrame(this);
GenericConfused(this);
}
@@ -173,7 +173,7 @@ void nullsub_4(Entity* this) {
void sub_0801F0C8(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
this->actionDelay = (Random() & 3) + 0xc;
this->field_0xf = Random();
@@ -221,7 +221,7 @@ void sub_0801F1B0(Entity* this) {
GetNextFrame(this);
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
sub_0801F328(this);
} else {
@@ -240,7 +240,7 @@ void sub_0801F228(Entity* this) {
void sub_0801F250(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_0801F360(this);
}
@@ -267,7 +267,7 @@ void sub_0801F270(Entity* this) {
void sub_0801F2CC(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
@@ -277,7 +277,7 @@ void sub_0801F2CC(Entity* this) {
void sub_0801F2F8(Entity* this) {
GravityUpdate(this, 0x1800);
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_0801F340(this);
sub_0804AA1C(this);
}
@@ -362,7 +362,7 @@ void sub_0801F48C(Entity* this) {
void sub_0801F494(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
@@ -418,7 +418,7 @@ void sub_0801F584(Entity* this) {
GetNextFrame(this);
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
this->field_0x82.HALF.HI = 0;
sub_0801F730(this);
@@ -440,7 +440,7 @@ void sub_0801F61C(Entity* this) {
void sub_0801F638(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 8;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
@@ -465,7 +465,7 @@ void sub_0801F688(Entity* this) {
void sub_0801F6CC(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
@@ -475,7 +475,7 @@ void sub_0801F6CC(Entity* this) {
void sub_0801F6F8(Entity* this) {
GravityUpdate(this, 0x1800);
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 4;
this->speed = 0x20;
sub_0804AA1C(this);
@@ -538,7 +538,7 @@ void sub_0801F7FC(Entity* this) {
void sub_0801F840(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_0801FB14(this);
COLLISION_ON(this);
this->spritePriority.b0 = 4;
@@ -594,7 +594,7 @@ void sub_0801F940(Entity* this) {
GetNextFrame(this);
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (sub_0801FBD0(this)) {
sub_0801FAE0(this);
} else {
@@ -614,7 +614,7 @@ void sub_0801F9C4(Entity* this) {
void sub_0801F9E0(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 8;
this->field_0xf = 30;
this->direction = sub_08049F84(this, 1);
@@ -639,7 +639,7 @@ void sub_0801FA30(Entity* this) {
void sub_0801FA78(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->spriteSettings.draw = 0;
InitializeAnimation(this, 4);
@@ -650,7 +650,7 @@ void sub_0801FA78(Entity* this) {
void sub_0801FAAC(Entity* this) {
GravityUpdate(this, 0x1800);
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_0801FB14(this);
this->speed = 0x20;
sub_0804AA1C(this);
@@ -705,7 +705,7 @@ void sub_0801FB68(Entity* this) {
}
u32 sub_0801FBD0(Entity* this) {
- if (sub_080B1AA8(this) == 0x10) {
+ if (GetTileUnderEntity(this) == 0x10) {
return 1;
} else {
return 0;
diff --git a/src/enemy/cuccoAggr.c b/src/enemy/cuccoAggr.c
index 24c8555a..28b32be5 100644
--- a/src/enemy/cuccoAggr.c
+++ b/src/enemy/cuccoAggr.c
@@ -164,7 +164,7 @@ void sub_08038F20(CuccoAggrEntity* this) {
sub_08039298(this);
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_0803901C(this);
}
}
@@ -328,7 +328,7 @@ void CuccoAggr_CreateFx(CuccoAggrEntity* this) {
void sub_08039298(CuccoAggrEntity* this) {
if (super->type2 == 0) {
- sub_08078930(super);
+ RegisterCarryEntity(super);
}
}
diff --git a/src/enemy/curtain.c b/src/enemy/curtain.c
index af8c22d0..0a0d342c 100644
--- a/src/enemy/curtain.c
+++ b/src/enemy/curtain.c
@@ -49,7 +49,7 @@ void sub_08048268(Entity* this) {
}
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->actionDelay = 0;
InitializeAnimation(this, 0);
}
@@ -58,7 +58,7 @@ void sub_08048268(Entity* this) {
void sub_08048294(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
SetLocalFlag(0x72);
InitializeAnimation(this, 1);
diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c
index 6c1b0238..7fae4b0b 100644
--- a/src/enemy/darkNut.c
+++ b/src/enemy/darkNut.c
@@ -141,7 +141,7 @@ void sub_08020D9C(Entity* this) {
void sub_08020DB4(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_08021390(this);
}
@@ -161,7 +161,7 @@ void sub_08020DD4(Entity* this) {
void sub_08020E28(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_080213B0(this);
}
@@ -170,14 +170,14 @@ void sub_08020E48(Entity* this) {
sub_080213F0(this);
} else {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_080213B0(this);
}
}
void sub_08020E78(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_08021390(this);
}
@@ -211,7 +211,7 @@ void sub_08020E98(Entity* this) {
void sub_08020F28(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_08021400(this);
}
@@ -241,7 +241,7 @@ void sub_08020F48(Entity* this) {
}
void sub_08020FAC(Entity* this) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (this->field_0x7a.HALF.LO) {
this->field_0x7a.HALF.LO--;
} else {
@@ -264,7 +264,7 @@ void sub_08020FE4(Entity* this) {
void sub_08021010(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->hitType = 0x56;
sub_080213F0(this);
}
@@ -280,7 +280,7 @@ void sub_08021038(Entity* this) {
EnqueueSFX(SFX_10E);
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_08021588(this);
if (this->field_0x7c.BYTES.byte0) {
this->field_0x7c.BYTES.byte0--;
@@ -300,7 +300,7 @@ void sub_080210A8(Entity* this) {
this->frame = 0;
sub_08021588(this);
EnqueueSFX(SFX_15D);
- } else if (this->frame & 0x80) {
+ } else if (this->frame & ANIM_DONE) {
sub_08021390(this);
}
}
@@ -330,7 +330,7 @@ void sub_080210E4(Entity* this) {
}
void sub_08021170(Entity* this) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (this->field_0x7a.HALF.HI) {
this->field_0x7a.HALF.HI--;
} else {
@@ -346,7 +346,7 @@ void sub_080211A0(Entity* this) {
sub_08021390(this);
} else {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_080213B0(this);
}
}
@@ -357,7 +357,7 @@ void sub_080211D0(Entity* this)
UpdateAnimationSingleFrame(this);
sub_0802159C(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_08021390(this);
}
@@ -365,7 +365,7 @@ void sub_080211F4(Entity* this) {
UpdateAnimationSingleFrame(this);
sub_08021600(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
sub_08021390(this);
}
diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c
index f340affa..540ae972 100644
--- a/src/enemy/doorMimic.c
+++ b/src/enemy/doorMimic.c
@@ -75,7 +75,7 @@ void sub_080220D8(Entity* this) {
void sub_080220F0(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
const PosOffset* off;
u32 i;
@@ -107,7 +107,7 @@ void sub_08022174(Entity* this) {
void sub_08022198(Entity* this) {
sub_0800445C(this);
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->actionDelay = 0x5a;
}
diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c
index e8165957..9c13ceaf 100644
--- a/src/enemy/enemy4D.c
+++ b/src/enemy/enemy4D.c
@@ -207,7 +207,7 @@ void Enemy4D_Action6(Enemy4DEntity* this) {
}
void Enemy4D_Action7(Enemy4DEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
UpdateAnimationSingleFrame(super);
} else {
if (--super->actionDelay == 0) {
diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c
index 98f80480..2811e901 100644
--- a/src/enemy/enemy50.c
+++ b/src/enemy/enemy50.c
@@ -223,7 +223,7 @@ void Enemy50_Action2(Enemy50Entity* this) {
void Enemy50_Action3(Enemy50Entity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->flags |= 0x80;
this->unk_7c = this->unk_80 * ((Random() & 0x30) + 0x3c) + 0x78;
sub_08041128(this);
@@ -292,7 +292,7 @@ void Enemy50_Action7(Enemy50Entity* this) {
void Enemy50_Action8(Enemy50Entity* this) {
sub_0803F738(this);
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 9;
this->unk_78 = 0;
InitializeAnimation(super, 4);
diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c
index 8fde9fbc..919a569b 100644
--- a/src/enemy/enemy64.c
+++ b/src/enemy/enemy64.c
@@ -54,7 +54,7 @@ void Enemy64(Enemy64Entity* this) {
super->subAction = 0;
}
Enemy64_Actions[super->action](this);
- sub_0805EC9C(super, 0xaa, 0xaa, this->unk_78);
+ SetAffineInfo(super, 0xaa, 0xaa, this->unk_78);
super->animationState = -(this->unk_78 >> 8);
sub_080499F0(this);
this->unk_7d = super->spriteSettings.draw;
diff --git a/src/enemy/enemyE.c b/src/enemy/enemyE.c
index f0428d37..957c953b 100644
--- a/src/enemy/enemyE.c
+++ b/src/enemy/enemyE.c
@@ -54,7 +54,7 @@ void sub_08023000(Entity* this, int frames) {
tmp *= -1;
this->spriteRendering.b0 = 3;
- sub_0805EC9C(this, tmp, 0x80, 0);
+ SetAffineInfo(this, tmp, 0x80, 0);
}
// clang-format off
diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c
index 26b22f65..aae204a2 100644
--- a/src/enemy/eyegore.c
+++ b/src/enemy/eyegore.c
@@ -196,7 +196,7 @@ void Eyegore_Action3(EyegoreEntity* this) {
super->spriteOffsetX = gUnk_080CE2BC[--super->actionDelay & 3];
} else {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->flags |= ENT_COLLIDE;
super->animationState = 2;
sub_08030E58(this);
@@ -214,7 +214,7 @@ void Eyegore_Action4(EyegoreEntity* this) {
sub_08030E3C(this);
break;
case 2:
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->animationState = this->unk_7f;
InitializeAnimation(super, super->animationState + 4);
}
@@ -227,7 +227,7 @@ void Eyegore_Action4(EyegoreEntity* this) {
break;
default:
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
InitializeAnimation(super, super->animationState);
if ((this->unk_79 & 0x80) != 0) {
super->action = 5;
@@ -252,7 +252,7 @@ void Eyegore_Action5(EyegoreEntity* this) {
sub_08030E3C(this);
break;
case 2:
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->animationState = this->unk_7f;
InitializeAnimation(super, super->animationState + 4);
}
@@ -261,7 +261,7 @@ void Eyegore_Action5(EyegoreEntity* this) {
}
break;
default:
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
InitializeAnimation(super, super->animationState);
if (sub_08049FDC(super, 1)) {
sub_08030E58(this);
@@ -280,7 +280,7 @@ void Eyegore_Action5(EyegoreEntity* this) {
void Eyegore_Action6(EyegoreEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 2;
}
}
diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c
index 261efa49..262781bb 100644
--- a/src/enemy/flyingSkull.c
+++ b/src/enemy/flyingSkull.c
@@ -20,7 +20,7 @@ void (*const gUnk_080CFBD4[])(FlyingSkullEntity*);
const s8 gUnk_080CFBE4[4];
extern s32 sub_080012DC(Entity*);
-extern void sub_08078930(Entity*);
+extern void RegisterCarryEntity(Entity*);
void sub_0803A100(FlyingSkullEntity* this);
void sub_0803A0E0(FlyingSkullEntity* this);
@@ -130,7 +130,7 @@ void sub_08039DD8(FlyingSkullEntity* this) {
sub_0803A0E0(this);
}
- sub_08078930(super);
+ RegisterCarryEntity(super);
} else {
if ((gPlayerState.flags & PL_MINISH) == 0) {
Entity* ent = &gPlayerEntity;
diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c
index a7870e07..7bd4179b 100644
--- a/src/enemy/ghini.c
+++ b/src/enemy/ghini.c
@@ -250,7 +250,7 @@ void Ghini_Action7(GhiniEntity* this) {
void Ghini_Action8(GhiniEntity* this) {
sub_0803F738(this);
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 9;
super->flags |= 0x80;
this->unk_78 = 0;
diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c
index 9c29dd4e..4e18f26e 100644
--- a/src/enemy/gibdo.c
+++ b/src/enemy/gibdo.c
@@ -164,7 +164,7 @@ void sub_08037624(GibdoEntity* this) {
void sub_08037690(GibdoEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
this->field_0x77 = 0x14;
sub_08037794(this);
} else {
@@ -196,7 +196,7 @@ void sub_080376D0(GibdoEntity* this) {
void sub_0803773C(GibdoEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
sub_08037794(this);
}
}
diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c
index fb2777e4..50ae9126 100644
--- a/src/enemy/gleerok.c
+++ b/src/enemy/gleerok.c
@@ -549,7 +549,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) == 0)
+ if ((super->frame & ANIM_DONE) == 0)
return;
enemy = CreateEnemy(GLEEROK, 6);
@@ -569,7 +569,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
GetNextFrame(super);
- if ((super->frame & 0x80) == 0)
+ if ((super->frame & ANIM_DONE) == 0)
return;
enemy = CreateEnemy(GLEEROK, 3);
@@ -998,7 +998,7 @@ void sub_0802E0B8(GleerokEntity* this) {
void sub_0802E1D0(GleerokEntity* this) {
Gleerok_HeapStruct* heap = this->unk_84;
- if (!(super->frame & 0x80)) {
+ if (!(super->frame & ANIM_DONE)) {
GetNextFrame(super);
}
if (super->frame & 0x3f) {
@@ -1144,7 +1144,7 @@ void sub_0802E448(GleerokEntity* this) {
void sub_0802E4C0(GleerokEntity* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
if (super->action != 2) {
this->unk_74 = 0;
this->unk_75 = 8;
@@ -1220,7 +1220,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
r7 += heap->ent2->actionDelay;
} else {
if (super->iframes == 0) {
- if ((super->animIndex != (heap->filler[0x15] >> 3) + 0x2f) || (super->frame & 0x80) != 0) {
+ if ((super->animIndex != (heap->filler[0x15] >> 3) + 0x2f) || (super->frame & ANIM_DONE) != 0) {
r7 = (heap->filler[0x15] >> 3) + 0x28;
}
} else {
diff --git a/src/enemy/gyorgFemaleEye.c b/src/enemy/gyorgFemaleEye.c
index 84d1aa3b..6ddb4f65 100644
--- a/src/enemy/gyorgFemaleEye.c
+++ b/src/enemy/gyorgFemaleEye.c
@@ -125,7 +125,7 @@ void sub_08048B2C(GyorgFemaleEyeEntity* this) {
void sub_08048B84(GyorgFemaleEyeEntity* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->action = 3;
super->flags |= ENT_COLLIDE;
super->hitType = 0x1E;
@@ -155,7 +155,7 @@ void sub_08048BB0(GyorgFemaleEyeEntity* this) {
SoundReq(SFX_ITEM_GLOVES_KNOCKBACK);
}
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->hitType = 0x1E;
InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]);
UpdateAnimationVariableFrames(super, 7);
@@ -176,7 +176,7 @@ void sub_08048BB0(GyorgFemaleEyeEntity* this) {
void sub_08048CEC(GyorgFemaleEyeEntity* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->action = 1;
InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]);
}
diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c
index f9ca7d8c..e0af39c7 100644
--- a/src/enemy/gyorgMale.c
+++ b/src/enemy/gyorgMale.c
@@ -106,7 +106,7 @@ void GyorgMale(GyorgMaleEntity* this) {
}
gUnk_080D1AFC[super->action](this);
if (super->action != 7) {
- sub_0805EC9C(super, 0xaa, 0xaa, this->unk_78);
+ SetAffineInfo(super, 0xaa, 0xaa, this->unk_78);
}
super->animationState = -(this->unk_78 >> 8);
sub_08048004(this);
@@ -986,7 +986,7 @@ void sub_08047BF0(GyorgMaleEntity* this) {
}
}
}
- sub_0805EC9C(super, 0xAA, 0xAA, this->unk_78);
+ SetAffineInfo(super, 0xAA, 0xAA, this->unk_78);
}
void sub_08047D24(GyorgMaleEntity* this) {
@@ -1005,7 +1005,7 @@ void sub_08047D24(GyorgMaleEntity* this) {
} else {
sub_08047E58(this);
}
- sub_0805EC9C(super, this->unk_7e, this->unk_7e, this->unk_78);
+ SetAffineInfo(super, this->unk_7e, this->unk_7e, this->unk_78);
}
}
diff --git a/src/enemy/gyorgMaleEye.c b/src/enemy/gyorgMaleEye.c
index a7586c44..4e9128f3 100644
--- a/src/enemy/gyorgMaleEye.c
+++ b/src/enemy/gyorgMaleEye.c
@@ -79,7 +79,7 @@ void GyorgMaleEye_Init(GyorgMaleEyeEntity* this) {
void GyorgMaleEye_Action1(GyorgMaleEyeEntity* this) {
sub_08048F50(this);
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 2;
super->flags |= 0x80;
super->actionDelay = 0x2d;
@@ -98,7 +98,7 @@ void GyorgMaleEye_Action2(GyorgMaleEyeEntity* this) {
void GyorgMaleEye_Action3(GyorgMaleEyeEntity* this) {
sub_08048F50(this);
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c
index 2c593691..5d34065a 100644
--- a/src/enemy/helmasaur.c
+++ b/src/enemy/helmasaur.c
@@ -79,7 +79,7 @@ void sub_0802BC74(Entity* this) {
sub_0802C1C0(this);
this->subAction = 1;
this->field_0x1d = 60;
- this->animationState = (gPlayerEntity.animationState >> 1) ^ 2;
+ this->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
InitializeAnimation(this, this->animationState);
}
@@ -92,7 +92,7 @@ void sub_0802BCA8(Entity* this) {
Entity* ent;
this->action = 7;
- this->actionDelay = 0x5a;
+ this->actionDelay = 90;
this->zVelocity = Q_16_16(1.5);
this->hitType = 0x19;
this->field_0x3a = this->field_0x3a & 0xfb;
diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c
index 340a9be5..09564cd3 100644
--- a/src/enemy/keaton.c
+++ b/src/enemy/keaton.c
@@ -85,7 +85,7 @@ void sub_0803248C(Entity* this) {
void sub_080324CC(Entity* this) {
if (sub_080325E8(this) == 0) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_080326FC(this);
sub_08032740(this);
}
diff --git a/src/enemy/keese.c b/src/enemy/keese.c
index 63b5b78d..bbc2bac6 100644
--- a/src/enemy/keese.c
+++ b/src/enemy/keese.c
@@ -79,7 +79,7 @@ void Keese_Fly(Entity* this) {
this->field_0x7a.HWORD--;
}
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_08021F24(this);
} else {
ProcessMovement1(this);
diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c
index 70145906..971ffd09 100644
--- a/src/enemy/lakitu.c
+++ b/src/enemy/lakitu.c
@@ -152,7 +152,7 @@ void Lakitu_Hide(Entity* this) {
void Lakitu_EndHide(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = IDLE;
this->actionDelay = 0x3c;
@@ -180,7 +180,7 @@ void Lakitu_Idle(Entity* this) {
void Lakitu_BeginHide(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->spriteSettings.draw = 0;
@@ -191,7 +191,7 @@ void Lakitu_BeginHide(Entity* this) {
void Lakitu_Lightning(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (!(this->frame & 0x80)) {
+ if (!(this->frame & ANIM_DONE)) {
return;
}
diff --git a/src/enemy/leever.c b/src/enemy/leever.c
index 4226da39..3e53a53a 100644
--- a/src/enemy/leever.c
+++ b/src/enemy/leever.c
@@ -85,7 +85,7 @@ void Leever_Idle(Entity* this) {
void Leever_DigUp(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
if (this->type == LeeverForm_Red) {
this->field_0x74.HWORD = 180;
@@ -113,7 +113,7 @@ void Leever_Attack(Entity* this) {
void Leever_DigDown(Entity* this) {
Leever_Move(this);
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->actionDelay = 0xf0;
this->spriteSettings.draw = FALSE;
diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c
index cdad77e6..26ed3023 100644
--- a/src/enemy/madderpillar.c
+++ b/src/enemy/madderpillar.c
@@ -277,7 +277,7 @@ void sub_08029D14(Entity* this) {
}
} else {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 4;
this->actionDelay = 0x78;
this->hitType = 0x6c;
@@ -299,7 +299,7 @@ void sub_08029D78(Entity* this) {
void sub_08029DAC(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 6;
this->parent->field_0x76.HALF.HI = 1;
InitializeAnimation(this, this->animationState + 8);
diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c
index 5d3a04b8..786039df 100644
--- a/src/enemy/mazaalBracelet.c
+++ b/src/enemy/mazaalBracelet.c
@@ -238,7 +238,7 @@ void sub_0803A364(Entity* this) {
break;
case 4:
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->subAction = 5;
}
break;
@@ -261,7 +261,7 @@ void sub_0803A364(Entity* this) {
break;
case 7:
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->subAction = 8;
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
@@ -270,7 +270,7 @@ void sub_0803A364(Entity* this) {
break;
case 8:
sub_0803B55C(this);
- if ((this->child->frame & 0x80) == 0) {
+ if ((this->child->frame & ANIM_DONE) == 0) {
return;
}
uVar1 = 9;
@@ -286,7 +286,7 @@ void sub_0803A364(Entity* this) {
break;
case 10:
sub_0803B55C(this);
- if ((this->child->frame & 0x80) != 0) {
+ if ((this->child->frame & ANIM_DONE) != 0) {
this->subAction = 0xb;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
@@ -294,7 +294,7 @@ void sub_0803A364(Entity* this) {
break;
case 0xb:
GetNextFrame(this);
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
return;
}
if (this->type2 != 0) {
@@ -365,7 +365,7 @@ void sub_0803A60C(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 6;
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
@@ -482,7 +482,7 @@ void sub_0803A814(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
sub_0803B55C(this);
- if ((this->child->frame & 0x80) != 0) {
+ if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0xe;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
@@ -497,7 +497,7 @@ void sub_0803A86C(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
COLLISION_ON(this);
sub_0803B59C(this);
}
@@ -619,7 +619,7 @@ void sub_0803AB10(Entity* this) {
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
LinearMoveUpdate(this);
sub_0803B55C(this);
- if ((this->child->frame & 0x80) != 0) {
+ if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0x15;
this->actionDelay = 0xf;
}
@@ -649,7 +649,7 @@ void sub_0803ABB4(Entity* this) {
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
sub_0803B55C(this);
- if ((this->child->frame & 0x80) != 0) {
+ if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0x17;
COLLISION_ON(this);
this->speed = 0x180;
@@ -768,7 +768,7 @@ void sub_0803ADF4(Entity* this) {
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 0x1c;
this->actionDelay = 0x1e;
this->spriteSettings.draw = 0;
@@ -803,7 +803,7 @@ void sub_0803AEC4(Entity* this) {
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
COLLISION_ON(this);
sub_0803B59C(this);
}
@@ -818,7 +818,7 @@ void sub_0803AF18(Entity* this) {
void sub_0803AF50(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 0x20;
this->spriteSettings.draw = 0;
InitAnimationForceUpdate(this->child, 8);
@@ -827,7 +827,7 @@ void sub_0803AF50(Entity* this) {
void sub_0803AF7C(Entity* this) {
sub_0803B55C(this);
- if ((this->child->frame & 0x80) != 0) {
+ if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0x21;
this->actionDelay = 0xf;
}
@@ -892,7 +892,7 @@ void sub_0803B074(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
sub_0803B55C(this);
- if ((this->child->frame & 0x80) != 0) {
+ if ((this->child->frame & ANIM_DONE) != 0) {
this->action = 0x27;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 4);
@@ -903,7 +903,7 @@ void sub_0803B074(Entity* this) {
void sub_0803B0D4(Entity* this) {
UpdateAnimationSingleFrame(this);
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
COLLISION_ON(this);
sub_0803B59C(this);
}
@@ -938,7 +938,7 @@ void sub_0803B144(Entity* this) {
void sub_0803B17C(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 0x2b;
COLLISION_ON(this);
this->hitType = 0x18;
@@ -951,7 +951,7 @@ void sub_0803B1B8(Entity* this) {
Entity* temp;
u16 val;
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
GetNextFrame(this);
UpdateAnimationSingleFrame(this->child);
}
@@ -994,7 +994,7 @@ void sub_0803B2D0(Entity* this) {
Entity* entity;
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 0x2d;
this->spriteSettings.draw = 0;
entity = *(Entity**)&this->field_0x74;
@@ -1009,7 +1009,7 @@ void sub_0803B30C(Entity* this) {
Entity* entity;
entity = *(Entity**)&this->field_0x74;
- if ((entity->frame & 0x80) != 0) {
+ if ((entity->frame & ANIM_DONE) != 0) {
this->action = 0x2e;
sub_0803B8E8(this, 0x13);
InitializeAnimation(entity, 0);
@@ -1064,7 +1064,7 @@ void sub_0803B3F4(Entity* this) {
index = ((this->parent->field_0xf >> 4) + 3);
this->z.HALF.HI = ptr[(index + (u32)this->type * 2) & 7] + 4;
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->hitType = 0x17;
if (this->type == 0) {
this->hitbox = (Hitbox*)&gUnk_080FD35C;
diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c
index add39f8b..feee0839 100644
--- a/src/enemy/mazaalHead.c
+++ b/src/enemy/mazaalHead.c
@@ -757,7 +757,7 @@ void sub_08034B0C(Entity* this) {
this->actionDelay--;
} else {
GetNextFrame(this);
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
return;
}
this->action = 2;
@@ -789,7 +789,7 @@ void sub_08034B38(Entity* this) {
void sub_08034BA0(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->parent->field_0x7c.HALF.HI = 0xff;
DeleteEntity(this);
}
diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c
index b6099372..03f29e2a 100644
--- a/src/enemy/moldworm.c
+++ b/src/enemy/moldworm.c
@@ -170,7 +170,7 @@ void sub_08023288(Entity* this) {
void sub_08023330(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 4;
this->actionDelay = 0x19;
COLLISION_ON(this);
diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c
index 5ee3c12a..a205d1d6 100644
--- a/src/enemy/octorok.c
+++ b/src/enemy/octorok.c
@@ -94,7 +94,7 @@ void sub_0801EB9C(Entity* this) {
void Octorok_Initialize(Entity* this) {
sub_0804A720(this);
if (this->type == 2) {
- this->animationState = this->type;
+ this->animationState = 2;
} else {
this->animationState = Random() & 3;
}
@@ -141,13 +141,13 @@ void Octorok_ShootNut(Entity* this) {
}
}
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
Octorok_Pause(this);
}
void Octorok_Pause(Entity* this) {
this->action = 1;
- this->actionDelay = (Random() & 0x38) + 0x18;
+ this->actionDelay = (Random() & 0x38) + 24;
}
void Octorok_Turn(Entity* this) {
diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c
index b4fbc73a..49ca9525 100644
--- a/src/enemy/octorokBoss.c
+++ b/src/enemy/octorokBoss.c
@@ -125,7 +125,7 @@ void OctorokBoss_Hit(OctorokBossEntity* this) {
sub_08078B48();
}
sub_0800445C(super);
- sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
+ SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
}
void OctorokBoss_Hit_SubAction0(OctorokBossEntity* this) {
@@ -327,7 +327,7 @@ void OctorokBoss_Intro(OctorokBossEntity* this) {
gUnk_02034490.unk0 = 1;
sub_08036F60(this);
OctorokBoss_Intro_SubActions[super->subAction](this);
- sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
+ SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
}
void OctorokBoss_Intro_SubAction0(OctorokBossEntity* this) {
@@ -475,7 +475,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
sub_08036914(super, angle, radius);
this->angle.HALF.HI = ((OctorokBossEntity*)super->parent)->angle.HALF.HI +
OctorokBoss_LegAngleOffset2[super->type - 1] + this->timer;
- sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
+ SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
break;
case TAIL:
@@ -522,7 +522,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
sub_080369D0(this, GET_TAIL_RADIUS(this), 4);
}
super->bitfield = 0;
- sub_0805EC9C(super, this->unk_76, this->unk_74, -this->angle.HWORD ^ 0x8000);
+ SetAffineInfo(super, this->unk_76, this->unk_74, -this->angle.HWORD ^ 0x8000);
break;
case MOUTH:
@@ -546,7 +546,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
sub_08036914(super, angle, radius);
this->angle.HALF.HI = ((OctorokBossEntity*)super->parent)->angle.HALF.HI;
- sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
+ SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
sub_0800445C(super);
}
break;
@@ -562,7 +562,7 @@ void OctorokBoss_Action1(OctorokBossEntity* this) {
}
}
OctorokBoss_Action1_SubActions[super->subAction](this);
- sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
+ SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
break;
}
}
@@ -905,7 +905,7 @@ void OctorokBoss_Burning(OctorokBossEntity* this) {
CreateProjectileWithParent(super, OCTOROK_BOSS_PROJECTILE, 3);
}
}
- sub_0805EC9C(super, this->unk_76, this->unk_74, this->angle.HWORD);
+ SetAffineInfo(super, this->unk_76, this->unk_74, this->angle.HWORD);
}
void OctorokBoss_Burning_SubAction0(OctorokBossEntity* this) {
diff --git a/src/enemy/octorokGolden.c b/src/enemy/octorokGolden.c
index 9f38b9c7..4bdac449 100644
--- a/src/enemy/octorokGolden.c
+++ b/src/enemy/octorokGolden.c
@@ -90,7 +90,7 @@ void sub_08037D54(Entity* this) {
EnqueueSFX(SFX_124);
}
}
- } else if (this->frame & 0x80) {
+ } else if (this->frame & ANIM_DONE) {
if (--this->actionDelay == 0) {
this->action = 1;
this->field_0xf = 0x3c;
diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c
index 3f85d704..c6051ba0 100644
--- a/src/enemy/peahat.c
+++ b/src/enemy/peahat.c
@@ -289,7 +289,7 @@ void Peahat_Recover(Entity* this) {
void Peahat_Hop(Entity* this) {
GetNextFrame(this);
if (--this->actionDelay == 0) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 9;
this->zVelocity = Q_16_16(1.5);
this->animationState = PeahatAnimation_NewPropeller;
@@ -313,7 +313,7 @@ void Peahat_Hop(Entity* this) {
void Peahat_Takeoff(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->hitType = 0x70;
this->field_0x82.HALF.LO = 1;
diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c
index 94111c8f..18838cf6 100644
--- a/src/enemy/puffstool.c
+++ b/src/enemy/puffstool.c
@@ -237,7 +237,7 @@ void sub_080253D4(Entity* this) {
void sub_0802541C(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
this->field_0xf = 1;
this->zVelocity = Q_16_16(2);
@@ -270,7 +270,7 @@ void sub_0802547C(Entity* this) {
void sub_080254B4(Entity* this) {
GravityUpdate(this, Q_16_16(0.125));
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (this->z.HALF.HI == 0) {
if (this->cutsceneBeh.HWORD == 0) {
this->hitType = 0x82;
diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c
index d0d22bc9..c9beaa52 100644
--- a/src/enemy/rollobite.c
+++ b/src/enemy/rollobite.c
@@ -21,7 +21,7 @@ void sub_08020A7C(Entity*);
bool32 Rollobite_TryToHoleUp(Entity*);
bool32 Rollobite_IsRolledUp(Entity*);
-extern void sub_08078930(Entity*);
+extern void RegisterCarryEntity(Entity*);
void Rollobite(Entity* this) {
EnemyFunctionHandler(this, Rollobite_Functions);
@@ -175,7 +175,7 @@ void Rollobite_Turn(Entity* this) {
void Rollobite_RolledUp(Entity* this) {
u32 unk;
- if ((this->frame & 0x80) == 0)
+ if ((this->frame & ANIM_DONE) == 0)
GetNextFrame(this);
unk = sub_080044EC(this, 0x2800);
@@ -185,7 +185,7 @@ void Rollobite_RolledUp(Entity* this) {
this->action = 5;
InitializeAnimation(this, this->animationState + 12);
}
- sub_08078930(this);
+ RegisterCarryEntity(this);
} else {
if (unk == 1)
EnqueueSFX(SFX_104);
@@ -197,7 +197,7 @@ void Rollobite_RolledUp(Entity* this) {
void Rollobite_Unroll(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
COLLISION_ON(this);
this->speed = 0x100;
this->hitType = 34;
@@ -206,7 +206,7 @@ void Rollobite_Unroll(Entity* this) {
InitializeAnimation(this, this->animationState);
} else {
if ((this->frame & 1) == 0)
- sub_08078930(this);
+ RegisterCarryEntity(this);
}
}
diff --git a/src/enemy/rope.c b/src/enemy/rope.c
index 48a59799..8d728a03 100644
--- a/src/enemy/rope.c
+++ b/src/enemy/rope.c
@@ -174,7 +174,7 @@ void sub_08031600(Entity* this) {
u32 sub_0803163C(Entity* this) {
u32 h;
- if (sub_080B1AA8(this) == 0x13) {
+ if (GetTileUnderEntity(this) == 0x13) {
h = this->field_0x7a.HWORD / 2;
} else {
h = this->field_0x7a.HWORD;
diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c
index 903ddc0b..720243ed 100644
--- a/src/enemy/rupeeLike.c
+++ b/src/enemy/rupeeLike.c
@@ -122,7 +122,7 @@ void sub_08029474(Entity* this) {
u32 bVar1;
sub_080296C8(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
this->actionDelay = 8;
bVar1 = GetFacingDirection(this, &gPlayerEntity);
@@ -196,7 +196,7 @@ void sub_08029610(Entity* this) {
void sub_08029630(Entity* this) {
sub_080296C8(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->field_0x80.HALF.HI = 1;
this->child->spriteSettings.draw = FALSE;
sub_080297F0(this);
diff --git a/src/enemy/scissorsBeetle.c b/src/enemy/scissorsBeetle.c
index 41f84df0..28ce9d57 100644
--- a/src/enemy/scissorsBeetle.c
+++ b/src/enemy/scissorsBeetle.c
@@ -142,7 +142,7 @@ void sub_08038B08(ScissorsBeetleEntity* this) {
}
UpdateAnimationSingleFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->action = 4;
this->unk_82 = 3;
super->actionDelay = 0x32;
diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c
index e6b5eb87..5405cf71 100644
--- a/src/enemy/sluggula.c
+++ b/src/enemy/sluggula.c
@@ -134,7 +134,7 @@ void sub_08023CE0(Entity* this) {
default:
GetNextFrame(this);
if (this->frame) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
Entity* ent = CreateEnemy(SLUGGULA, 1);
if (ent) {
sub_0804A4E4(this, ent);
@@ -157,7 +157,7 @@ void sub_08023E10(Entity* this) {
}
GetNextFrame(this);
- if (this->frame & 0x80)
+ if (this->frame & ANIM_DONE)
DeleteEntity(this);
}
diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c
index 6ab1efcd..cbdfe52e 100644
--- a/src/enemy/spinyBeetle.c
+++ b/src/enemy/spinyBeetle.c
@@ -171,7 +171,7 @@ void sub_08033A7C(SpinyBeetleEntity* this) {
}
GetNextFrame(super);
- if ((super->frame & 0x80) == 0)
+ if ((super->frame & ANIM_DONE) == 0)
return;
super->action = 3;
diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c
index 784d1a2e..7d49e0d2 100644
--- a/src/enemy/spinyChuchu.c
+++ b/src/enemy/spinyChuchu.c
@@ -181,7 +181,7 @@ void sub_080226EC(Entity* this) {
void sub_08022780(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 4;
InitializeAnimation(this, 3);
EnqueueSFX(SFX_194);
@@ -201,7 +201,7 @@ void sub_080227AC(Entity* this) {
this->hitType = 0x5c;
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->field_0xf = gUnk_080CBA60[Random() & 3];
InitializeAnimation(this, 0);
@@ -211,7 +211,7 @@ void sub_080227AC(Entity* this) {
void sub_0802281C(Entity* this) {
GravityUpdate(this, Q_8_8(24.0));
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->speed = 0x20;
InitializeAnimation(this, 0);
@@ -234,7 +234,7 @@ void sub_08022854(Entity* this) {
void sub_0802289C(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->speed = 0x20;
this->field_0x80.HALF.HI = 0x78;
diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c
index 2751cd5b..67f6b6e1 100644
--- a/src/enemy/stalfos.c
+++ b/src/enemy/stalfos.c
@@ -269,7 +269,7 @@ void Stalfos_Action11(StalfosEntity* this) {
void Stalfos_Action12(StalfosEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->type2 == 1) {
sub_0803998C(this);
DeleteEntity(super->child);
diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c
index ddeb53d2..db461a94 100644
--- a/src/enemy/tektite.c
+++ b/src/enemy/tektite.c
@@ -97,7 +97,7 @@ void sub_0802F284(Entity* this) {
if (this->actionDelay != 0) {
this->actionDelay--;
} else if (this->field_0xf != 0) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = 0x10;
this->field_0xf = this->type;
@@ -105,7 +105,7 @@ void sub_0802F284(Entity* this) {
sub_0802F45C(this);
InitializeAnimation(this, 2);
}
- } else if (this->frame & 0x80) {
+ } else if (this->frame & ANIM_DONE) {
this->field_0xf = 0x40;
InitializeAnimation(this, 1);
}
@@ -137,7 +137,7 @@ void sub_0802F300(Entity* this) {
return;
} else if (this->collisions != 0) {
sub_0800417E(this, this->collisions);
- } else if ((sub_080B1AA8(this) & 0xf0) == 0x50) {
+ } else if ((GetTileUnderEntity(this) & 0xf0) == 0x50) {
this->direction = (this->direction + 0x10) & 0x1f;
}
@@ -167,7 +167,7 @@ void sub_0802F3F4(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if ((*(u8*)&this->field_0x7c.HALF.LO < 2) && ((this->type % 2) != 0)) {
this->action = 2;
this->actionDelay = 0x10;
diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c
index b35f8f2c..af71db25 100644
--- a/src/enemy/tektiteGolden.c
+++ b/src/enemy/tektiteGolden.c
@@ -85,7 +85,7 @@ void sub_08037Fe0(Entity* this) {
if (this->actionDelay != 0) {
this->actionDelay--;
} else if (this->field_0xf != 0) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
this->actionDelay = 6;
this->field_0xf = 0;
@@ -93,7 +93,7 @@ void sub_08037Fe0(Entity* this) {
sub_08038168(this);
InitializeAnimation(this, 2);
}
- } else if (this->frame & 0x80) {
+ } else if (this->frame & ANIM_DONE) {
this->field_0xf = 0x40;
InitializeAnimation(this, 1);
}
@@ -116,7 +116,7 @@ void sub_08038048(Entity* this) {
return;
} else if (this->collisions != 0) {
sub_0800417E(this, this->collisions);
- } else if ((sub_080B1AA8(this) & 0xf0) == 0x50) {
+ } else if ((GetTileUnderEntity(this) & 0xf0) == 0x50) {
this->direction = (this->direction + 0x10) & 0x1f;
}
@@ -141,7 +141,7 @@ void sub_08038048(Entity* this) {
void sub_08038110(Entity* this) {
UpdateAnimationVariableFrames(this, 2);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (this->field_0x80.HALF.LO < 5) {
this->action = 2;
this->actionDelay = 8;
diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c
index e4b6e5e4..d9f17946 100644
--- a/src/enemy/vaatiArm.c
+++ b/src/enemy/vaatiArm.c
@@ -713,7 +713,7 @@ void sub_08042FD8(Entity* this) {
this->frame = 0;
}
} else {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (--this->field_0xf == 0) {
this->subAction = 8;
this->actionDelay = 0x3c;
diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c
index 222e1dd4..fa72f6f8 100644
--- a/src/enemy/vaatiBall.c
+++ b/src/enemy/vaatiBall.c
@@ -162,7 +162,7 @@ void sub_08044868(Entity* this) {
if (this->field_0x82.HALF.HI) {
switch (this->field_0x74.HALF.LO) {
case 0:
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->field_0x74.HALF.LO = 1;
this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10);
this->speed = 0x180;
diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c
index 9c875dd0..320e4bf3 100644
--- a/src/enemy/vaatiProjectile.c
+++ b/src/enemy/vaatiProjectile.c
@@ -153,7 +153,7 @@ void VaatiProjectileFunction0Action2(Entity* this) {
}
void VaatiProjectileFunction0Action3(Entity* this) {
- if (this->child->frame & 0x80) {
+ if (this->child->frame & ANIM_DONE) {
if (--this->z.HALF.HI <= -0x18) {
this->action = 4;
this->actionDelay = (Random() & 0xf) + 0xf;
diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c
index a84dfcbc..07639d76 100644
--- a/src/enemy/vaatiRebornEnemy.c
+++ b/src/enemy/vaatiRebornEnemy.c
@@ -235,7 +235,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) {
}
break;
case 1:
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->field_0x74.HALF.LO = 2;
this->spriteSettings.draw = 0;
this->actionDelay = 0x10;
@@ -260,7 +260,7 @@ void VaatiRebornEnemyType0Action2(Entity* this) {
}
break;
case 3:
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->spriteSettings.draw = 1;
if (4 < this->field_0x80.HALF.HI) {
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
@@ -318,7 +318,7 @@ void VaatiRebornEnemyType0Action3(Entity* this) {
}
break;
case 2:
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->field_0x74.HALF.LO = 3;
InitAnimationForceUpdate(this, 0);
}
diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c
index 7ca2f6d7..7149ea69 100644
--- a/src/enemy/vaatiTransfigured.c
+++ b/src/enemy/vaatiTransfigured.c
@@ -675,7 +675,7 @@ void VaatiTransfiguredType2Action1(Entity* this) {
}
break;
case 1:
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->field_0x74.HALF.LO = 0;
this->field_0xf = (Random() & 0x7f) + 0x17;
InitAnimationForceUpdate(this, 0);
@@ -790,7 +790,7 @@ void VaatiTransfiguredType5Action1(Entity* this) {
this->field_0x80.HALF.LO = 0;
this->spriteSettings.draw = 0;
} else {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->frame &= ~0x80;
if (gEntCount < 0x47) {
sub_08040648(this, this->type, 1);
@@ -814,13 +814,13 @@ void VaatiTransfiguredType5Action2(Entity* this) {
}
if (this->field_0x80.HALF.LO == 0) {
if (this->parent->parent->action != 6) {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->field_0x80.HALF.LO += 1;
InitializeAnimation(this, 3);
}
}
} else {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c
index cd42c7a3..457b294d 100644
--- a/src/enemy/vaatiTransfiguredEye.c
+++ b/src/enemy/vaatiTransfiguredEye.c
@@ -129,7 +129,7 @@ void VaatiTransfiguredEyeFunction0Action0(Entity* this) {
void VaatiTransfiguredEyeFunction0Action1(Entity* this) {
sub_08045A28(this);
if (this->field_0x82.HALF.LO == 0) {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
if (this->type != 0) {
COLLISION_ON(this);
}
@@ -169,7 +169,7 @@ void VaatiTransfiguredEyeFunction0Action2(Entity* this) {
void VaatiTransfiguredEyeFunction0Action3(Entity* this) {
sub_08045A28(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 2;
if (this->type != 0) {
if (this->actionDelay == 0) {
@@ -187,7 +187,7 @@ void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
sub_08045A28(this);
if (this->field_0xf == 0) {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->field_0xf = 0x20;
}
} else {
diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c
index af31d2f8..2d8c3619 100644
--- a/src/enemy/vaatiWrath.c
+++ b/src/enemy/vaatiWrath.c
@@ -365,7 +365,7 @@ void VaatiWrathType0Action6(Entity* this) {
type1->frame &= 0xfd;
}
} else {
- if ((type1->frame & 0x80) != 0) {
+ if ((type1->frame & ANIM_DONE) != 0) {
sub_0804235C(this);
}
}
@@ -546,7 +546,7 @@ void VaatiWrathType0ActionC(Entity* this) {
entity->frame &= 0xfe;
InitAnimationForceUpdate(this, 9);
} else {
- if (entity->frame & 0x80) {
+ if (entity->frame & ANIM_DONE) {
sub_0804235C(this);
}
}
@@ -617,7 +617,7 @@ void sub_08041BE8(Entity* this) {
void sub_08041CD0(Entity* this) {
GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (this->actionDelay != 0) {
this->actionDelay--;
} else {
@@ -964,7 +964,7 @@ u32 sub_080422C0(Entity* this, u32 unk1) {
type1->frame &= 0xfb;
InitAnimationForceUpdate(this, 3);
} else {
- if (type1->frame & 0x80) {
+ if (type1->frame & ANIM_DONE) {
InitAnimationForceUpdate(this, 0);
type1->subAction = 0;
InitializeAnimation(type1, 0xc);
diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c
index 690d8ee6..784be12b 100644
--- a/src/enemy/vaatiWrathEye.c
+++ b/src/enemy/vaatiWrathEye.c
@@ -56,7 +56,7 @@ void VaatiWrathEyeAction0(Entity* this) {
void VaatiWrathEyeAction1(Entity* this) {
sub_080485D8(this);
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 2;
InitializeAnimation(this, 1);
}
@@ -105,7 +105,7 @@ void VaatiWrathEyeAction4(Entity* this) {
}
} else {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 5;
this->actionDelay = 0;
}
@@ -137,7 +137,7 @@ void VaatiWrathEyeAction6(Entity* this) {
InitializeAnimation(this, 6);
}
} else {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 7;
this->actionDelay = 120;
this->field_0xf = 0;
@@ -193,7 +193,7 @@ void VaatiWrathEyeAction8(Entity* this) {
void VaatiWrathEyeAction9(Entity* this) {
sub_080485FC(this);
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 4;
this->actionDelay = 1;
this->parent->field_0x7a.HALF.HI = (this->parent->field_0x7a.HALF.HI & 0xf) | (1 << this->type);
diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c
index 7f08b67e..b9377a19 100644
--- a/src/enemy/wallMaster.c
+++ b/src/enemy/wallMaster.c
@@ -112,7 +112,7 @@ void sub_0802A610(Entity* this) {
GetNextFrame(this);
sub_0802A7D0(this);
- flags = this->frame & 0x80;
+ flags = this->frame & ANIM_DONE;
if (flags) {
this->action = 4;
this->actionDelay = 0x1e;
@@ -154,7 +154,7 @@ void sub_0802A69C(Entity* this) {
/* sigh... */
GetNextFrame(this);
- flags = this->frame & 0x80;
+ flags = this->frame & ANIM_DONE;
if (flags) {
this->action = 6;
this->actionDelay = 0x1e;
@@ -193,7 +193,7 @@ void sub_0802A78C(Entity* this) {
void sub_0802A7D0(Entity* this) {
u32 unk = gUnk_080CD0B0[(this->field_0x7c.BYTES.byte1++ >> 3) & 7] + 0x100;
- sub_0805EC9C(this, unk, unk, 0);
+ SetAffineInfo(this, unk, unk, 0);
}
// clang-format off
void (*const WallMaster_Functions[])(Entity*) = {
diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c
index 3ee61f51..989097fe 100644
--- a/src/enemy/wallMaster2.c
+++ b/src/enemy/wallMaster2.c
@@ -131,7 +131,7 @@ void sub_0802CE68(Entity* this) {
}
sub_0802CFD8(this);
GetNextFrame(this);
- frames = this->frame & 0x80;
+ frames = this->frame & ANIM_DONE;
if (frames) {
this->action = 4;
this->actionDelay = 30;
@@ -169,7 +169,7 @@ ASM_FUNC("asm/non_matching/wallMaster2/sub_0802CF8C.inc", void sub_0802CF8C(Enti
void sub_0802CFD8(Entity* this) {
u32 unk = gUnk_080CD740[(this->field_0x7a.HALF.LO++ >> 3) & 7];
- sub_0805EC9C(this, (s16)this->field_0x74.HWORD + unk, 0x100 + unk, this->field_0x76.HWORD);
+ SetAffineInfo(this, (s16)this->field_0x74.HWORD + unk, 0x100 + unk, this->field_0x76.HWORD);
}
// clang-format off
diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c
index 39c329a2..629c54cd 100644
--- a/src/enemy/waterDrop.c
+++ b/src/enemy/waterDrop.c
@@ -56,7 +56,7 @@ void sub_0802A2B4(Entity* this) {
void sub_0802A2FC(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteEntity(this);
} else if (this->frame & 1) {
COLLISION_OFF(this);
diff --git a/src/entity.c b/src/entity.c
index 4bd014e5..d696050c 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -9,15 +9,14 @@ extern u8 gUnk_081091F8[];
extern u8 gUnk_081091EE[];
extern u8 gUpdateVisibleTiles;
extern Manager gUnk_02033290;
-void sub_0805ED30(void);
+void UpdatePlayerInput(void);
void ClearHitboxList(void);
void sub_0805EE88(void);
void ClearAllDeletedEntities(void);
void DeleteAllEntities(void);
void sub_0805E98C(void);
-extern void sub_0806FE84(Entity*);
+extern void UnloadOBJPalette2(Entity*);
extern void sub_08017744(Entity*);
-extern void UnloadHitbox(Entity*);
extern void sub_0804AA1C(Entity*);
void ClearDeletedEntity(Entity*);
@@ -64,8 +63,8 @@ void sub_0805E248(void) {
gUpdateVisibleTiles = 0;
}
-void sub_0805E374(Entity* e) {
- u8 r3 = gRoomTransition.player_status.field_0x24[8];
+void SetDefaultPriorityForKind(Entity* e) {
+ u8 r3 = gRoomTransition.entity_update_type;
u8* array = gUnk_081091F8;
if (r3 != 2) {
@@ -201,7 +200,7 @@ void UpdateEntities(void) {
gRoomVars.filler1[0] = gRoomVars.field_0x4;
gRoomVars.field_0x4 = 0;
- sub_0805ED30();
+ UpdatePlayerInput();
UpdatePriority();
ClearHitboxList();
sub_0806F0A4();
@@ -232,7 +231,7 @@ void EraseAllEntities(void) {
}
extern Entity gUnk_030015A0[0x48];
-extern Entity gUnk_03003BE0;
+extern Entity gCarryEntities;
NONMATCH("asm/non_matching/GetEmptyEntity.inc", Entity* GetEmptyEntity()) {
u8 flags_ip;
@@ -263,7 +262,7 @@ NONMATCH("asm/non_matching/GetEmptyEntity.inc", Entity* GetEmptyEntity()) {
ClearDeletedEntity(ptr);
return ptr;
}
- } while (++ptr < &gUnk_03003BE0);
+ } while (++ptr < &gCarryEntities);
flags_ip = 0;
rv = NULL;
@@ -343,9 +342,9 @@ void DeleteEntity(Entity* ent) {
if (ent->next) {
UnloadGFXSlots(ent);
UnloadOBJPalette(ent);
- sub_0806FE84(ent);
+ UnloadOBJPalette2(ent);
sub_080788E0(ent);
- sub_08078954(ent);
+ FreeCarryEntity(ent);
sub_0805EC60(ent);
sub_08017744(ent);
ReleaseTransitionManager(ent);
@@ -437,15 +436,15 @@ void ReleaseTransitionManager(void* mgr) {
}
}
-extern Entity gUnk_020369F0;
+extern LinkedList gEntityListsBackup;
void sub_0805E958(void) {
- MemCopy(&gEntityLists, &gUnk_020369F0, 0x48);
+ MemCopy(&gEntityLists, &gEntityListsBackup, 0x48);
sub_0805E98C();
}
void sub_0805E974(void) {
- MemCopy(&gUnk_020369F0, &gEntityLists, 0x48);
+ MemCopy(&gEntityListsBackup, &gEntityLists, 0x48);
}
void sub_0805E98C(void) {
@@ -479,7 +478,7 @@ void DeleteSleepingEntities(void) {
list = &gEntityLists[0];
do {
- for (ent = list->first; (u32)ent != (u32)list; ent = next) {
+ for (ent = list->first; (intptr_t)ent != (intptr_t)list; ent = next) {
next = ent->next;
if (ent->flags & ENT_DELETED)
DeleteEntityAny(ent);
@@ -501,7 +500,7 @@ void AppendEntityToList(Entity* entity, u32 listIndex) {
} else {
gManagerCount++;
}
- sub_0805E374(entity);
+ SetDefaultPriorityForKind(entity);
}
void PrependEntityToList(Entity* entity, u32 listIndex) {
diff --git a/src/game.c b/src/game.c
index be7e224b..b4465752 100644
--- a/src/game.c
+++ b/src/game.c
@@ -407,7 +407,7 @@ static void GameMain_ChangeRoom(void) {
sub_0801855C();
}
#elif defined(DEMO_JP)
- if (gRoomTransition.field_0x2c[5])
+ if (gRoomTransition.field_0x2c[4])
CheckAreaDiscovery();
if (gArea.inventoryGfxIdx != 0xff) {
sub_0801855C();
diff --git a/src/interrupts.c b/src/interrupts.c
index 5115c45a..c52df16b 100644
--- a/src/interrupts.c
+++ b/src/interrupts.c
@@ -14,7 +14,7 @@ extern u8 gUnk_03003DE0;
extern u8 gUnk_03000C30;
extern u8 gUpdateVisibleTiles;
-extern Entity gUnk_03003BE0;
+extern Entity gCarryEntities;
extern Entity* gPlayerClones[3];
extern u16 gUnk_080B2CD8[];
@@ -334,7 +334,7 @@ void sub_080171F0(void) {
gPlayerState.mobility = 0;
gPlayerState.speed_modifier = 0;
gPlayerState.field_0xaa = 0;
- MemClear(&gUnk_03003BE0, 0x8c);
+ MemClear(&gCarryEntities, 0x8c);
gPlayerEntity.spriteOffsetY = gPlayerState.field_0x3f;
gPlayerState.field_0x3f = 0;
sub_0807B0C8();
diff --git a/src/item/itemBomb.c b/src/item/itemBomb.c
index 96d8585e..5f20f8d7 100644
--- a/src/item/itemBomb.c
+++ b/src/item/itemBomb.c
@@ -29,7 +29,7 @@ void sub_08075FF8(ItemBehavior* this, u32 arg1) {
}
maxBombs = this->behaviorID == 7 ? 3 : 1;
if (maxBombs > bombCount) {
- entity = CreatePlayerBomb(this, 2);
+ entity = CreatePlayerItemWithParent(this, 2);
if (entity != NULL) {
tmp = &gUnk_0811BDAC[gPlayerEntity.animationState & 6];
// TODO fix array access
@@ -41,8 +41,8 @@ void sub_08075FF8(ItemBehavior* this, u32 arg1) {
}
}
}
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
-// TODO arg1 type not yet known, called by sub_080761C0 and sub_080762D8
+// TODO arg1 type not yet known, called by ItemPickupCheck and sub_080762D8
ASM_FUNC("asm/non_matching/itemBomb/sub_08076088.inc", void sub_08076088(ItemBehavior* this, void* arg1))
diff --git a/src/item/itemBoomerang.c b/src/item/itemBoomerang.c
index eb6c67cc..9e402d00 100644
--- a/src/item/itemBoomerang.c
+++ b/src/item/itemBoomerang.c
@@ -15,7 +15,7 @@ void sub_08075D2C(ItemBehavior* this, u32 arg1) {
sub_08077D38(this, arg1);
gPlayerState.field_0x3[1] |= 8;
} else {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
@@ -30,5 +30,5 @@ void sub_08075D88(ItemBehavior* this, u32 arg1) {
return;
}
}
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
diff --git a/src/item/itemBow.c b/src/item/itemBow.c
index 87e4544d..bc8244f9 100644
--- a/src/item/itemBow.c
+++ b/src/item/itemBow.c
@@ -16,7 +16,7 @@ void sub_08075DF4(ItemBehavior* this, u32 arg1) {
sub_08077D38(this, arg1);
gPlayerState.field_0x1f[2] = 1;
} else {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
@@ -39,7 +39,7 @@ void sub_08075E40(ItemBehavior* this, u32 arg1) {
}
}
gPlayerState.field_0x1f[2] = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
void sub_08075EC0(ItemBehavior* this, u32 arg1) {
@@ -51,7 +51,7 @@ void sub_08075EC0(ItemBehavior* this, u32 arg1) {
if (iVar2 != 0 && arrowCount != 0) {
if (((gPlayerState.field_0x3[1] & 0x80) != 0) || (gPlayerState.field_0x1f[2] == 0)) {
gPlayerState.field_0x1f[2] = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
} else {
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
@@ -70,7 +70,7 @@ void sub_08075F38(ItemBehavior* this, u32 arg1) {
}
} else {
gPlayerState.field_0x1f[2] = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
@@ -86,5 +86,5 @@ void sub_08075F84(ItemBehavior* this, u32 arg1) {
}
}
gPlayerState.field_0x1f[2] = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
diff --git a/src/item/itemDebug.c b/src/item/itemDebug.c
index f8790cde..deec580d 100644
--- a/src/item/itemDebug.c
+++ b/src/item/itemDebug.c
@@ -1,9 +1,9 @@
#include "item.h"
extern Entity* sub_08077BD4(ItemBehavior*);
-extern void sub_08077E78(ItemBehavior*, u32);
+extern void DeletePlayerItem(ItemBehavior*, u32);
void ItemDebug(ItemBehavior* beh, u32 arg1) {
sub_08077BD4(beh);
- sub_08077E78(beh, arg1);
+ DeletePlayerItem(beh, arg1);
}
diff --git a/src/item/itemGustJar.c b/src/item/itemGustJar.c
index 7393229f..ea3cd42d 100644
--- a/src/item/itemGustJar.c
+++ b/src/item/itemGustJar.c
@@ -18,12 +18,12 @@ void sub_08076DF4(ItemBehavior* this, u32 arg1) {
this->field_0x5[5] = gPlayerEntity.animationState;
this->field_0x5[4] |= 0x80;
this->field_0x5[4]++;
- gPlayerState.field_0x1d = 1;
+ gPlayerState.gustJarSpeed = 1;
*(u32*)&gPlayerEntity.field_0x74 = 0;
gPlayerState.field_0x1c = 1;
sub_08077BB8(this);
} else {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
@@ -31,7 +31,7 @@ void sub_08076E60(ItemBehavior* this, u32 arg1) {
Entity* playerItem;
if ((gPlayerState.field_0x1c & 0xf) == 0) {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
if ((this->field_0x5[9] & 0x80) != 0) {
this->stateID = 2;
@@ -48,18 +48,18 @@ void sub_08076E60(ItemBehavior* this, u32 arg1) {
void sub_08076EC8(ItemBehavior* this, u32 arg1) {
if ((gPlayerState.field_0x1c & 0xf) == 0) {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
return;
}
if (sub_08077EFC(this)) {
u32 val;
if (this->field_0x5[2] > 0xef) {
- gPlayerState.field_0x1d = 3;
+ gPlayerState.gustJarSpeed = 3;
} else if (++this->field_0x5[2] > 0x77) {
- gPlayerState.field_0x1d = 2;
+ gPlayerState.gustJarSpeed = 2;
} else {
- gPlayerState.field_0x1d = 1;
+ gPlayerState.gustJarSpeed = 1;
}
if (gPlayerEntity.subAction == 0x1b) {
@@ -93,7 +93,7 @@ void sub_08076F64(ItemBehavior* this, u32 arg1) {
if (this->field_0x5[3]) {
this->field_0x5[3] = 0;
this->field_0x5[2] = 0;
- gPlayerState.field_0x1d = 1;
+ gPlayerState.gustJarSpeed = 1;
player = &gPlayerEntity;
*(u32*)&player->field_0x74 = 0;
gPlayerState.field_0x1c = 1;
@@ -137,7 +137,7 @@ void sub_08076F64(ItemBehavior* this, u32 arg1) {
if (this->field_0x5[9] & 1) {
gPlayerState.field_0x1c = 5;
gPlayerEntity.field_0x70.WORD = 0;
- if (gPlayerState.field_0x1d) {
+ if (gPlayerState.gustJarSpeed) {
CreatePlayerItem(0x11, 0, 0, 0);
}
}
@@ -157,7 +157,7 @@ void sub_08076F64(ItemBehavior* this, u32 arg1) {
case 7:
sub_08077DF4(this, 0x514);
gPlayerState.field_0x1c = 3;
- gPlayerState.field_0x1d = 0;
+ gPlayerState.gustJarSpeed = 0;
break;
case 1:
case 2:
@@ -169,7 +169,7 @@ void sub_08076F64(ItemBehavior* this, u32 arg1) {
case0:
gPlayerState.field_0x1c = 0;
gPlayerEntity.field_0x70.WORD = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
break;
}
}
diff --git a/src/item/itemJarEmpty.c b/src/item/itemJarEmpty.c
index 11a27fcc..c50dee06 100644
--- a/src/item/itemJarEmpty.c
+++ b/src/item/itemJarEmpty.c
@@ -62,7 +62,7 @@ void sub_08077640(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= ENT_COLLIDE;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
@@ -70,6 +70,6 @@ void sub_0807766C(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerEntity.flags |= ENT_COLLIDE;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
diff --git a/src/item/itemLantern.c b/src/item/itemLantern.c
index e4aabd31..c05b8d01 100644
--- a/src/item/itemLantern.c
+++ b/src/item/itemLantern.c
@@ -27,7 +27,7 @@ void sub_08075A0C(ItemBehavior* this, u32 arg1) {
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
gPlayerState.flags &= ~PL_USE_LANTERN;
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
} else {
this->field_0x5[4] |= 0x80;
sub_08077D38(this, arg1);
@@ -79,7 +79,7 @@ void sub_08075B54(ItemBehavior* this, u32 arg1) {
if (!(((sub_08077F10(this) == 0) && (itemSlot < 2)) || (gPlayerState.jump_status != 0))) {
ForceEquipItem(ITEM_LANTERN_OFF, itemSlot);
gPlayerState.flags &= ~PL_USE_LANTERN;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
SoundReq(SFX_ITEM_LANTERN_OFF);
} else {
if (((gPlayerState.queued_action != PLAYER_ROLL) && (gPlayerEntity.frameIndex < 0x37)) &&
@@ -100,8 +100,8 @@ void sub_08075B54(ItemBehavior* this, u32 arg1) {
}
sub_08077DF4(this, 0x60c);
bVar1 = (8 >> (arg1));
- gPlayerState.field_0xa = bVar1 | gPlayerState.field_0xa;
- gPlayerState.keepFacing = bVar1 | gPlayerState.keepFacing;
+ gPlayerState.field_0xa |= bVar1;
+ gPlayerState.keepFacing |= bVar1;
}
}
}
diff --git a/src/item/itemMoleMitts.c b/src/item/itemMoleMitts.c
index 355f69df..610c718f 100644
--- a/src/item/itemMoleMitts.c
+++ b/src/item/itemMoleMitts.c
@@ -41,7 +41,7 @@ void sub_08077130(ItemBehavior* this, u32 arg1) {
this->stateID = 1;
}
} else {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
gPlayerState.field_0x3c[1] = 0;
}
}
@@ -51,7 +51,7 @@ void sub_080771C8(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
gPlayerState.field_0x3c[1] = 0;
} else {
if (((this->field_0x5[9] & 0x20) != 0) && (this->field_0x5[3] == 0xff)) {
@@ -94,7 +94,7 @@ void sub_08077448(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((this->field_0x5[9] & 0x80) != 0) {
gPlayerState.field_0x3c[1] = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
diff --git a/src/item/itemOcarina.c b/src/item/itemOcarina.c
index fff83945..a536d2d7 100644
--- a/src/item/itemOcarina.c
+++ b/src/item/itemOcarina.c
@@ -15,7 +15,7 @@ void ItemOcarina(ItemBehavior* this, u32 arg1) {
void OcarinaUse(ItemBehavior* this, u32 arg1) {
if (gPlayerState.queued_action == PLAYER_ROLL) {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
} else {
this->field_0x5[4] |= 0xf;
gPlayerEntity.animationState = 0x04;
@@ -44,7 +44,7 @@ NONMATCH("asm/non_matching/ocarina/OcarinaUpdate.inc", void OcarinaUpdate(ItemBe
gUnk_02034490.unk0 = 0;
CreateBird();
ResetPlayerEventPriority();
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
END_NONMATCH
diff --git a/src/item/itemPacciCane.c b/src/item/itemPacciCane.c
index 4ea479f5..ada5d308 100644
--- a/src/item/itemPacciCane.c
+++ b/src/item/itemPacciCane.c
@@ -18,10 +18,10 @@ void sub_08076C98(ItemBehavior* beh, u32 arg1) {
void sub_08076CBC(ItemBehavior* beh, u32 arg1) {
if ((beh->field_0x5[9] & 0x80) != 0) {
- sub_08077E78(beh, arg1);
+ DeletePlayerItem(beh, arg1);
} else {
if ((beh->field_0x5[9] & 0x40) != 0) {
- CreatePlayerBomb(beh, 0x12);
+ CreatePlayerItemWithParent(beh, 0x12);
}
UpdateItemAnim(beh);
}
diff --git a/src/item/itemPegasusBoots.c b/src/item/itemPegasusBoots.c
index b361f0fe..2a32cfd9 100644
--- a/src/item/itemPegasusBoots.c
+++ b/src/item/itemPegasusBoots.c
@@ -26,7 +26,7 @@ void ItemPegasusBoots(ItemBehavior* this, u32 arg1) {
if (gPlayerEntity.field_0x7a.HWORD != 0) {
gPlayerState.dash_state = 0;
gPlayerState.field_0xe = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
} else {
bVar1 = this->field_0x5[2] - 1;
this->field_0x5[2] = bVar1;
@@ -78,7 +78,7 @@ void sub_080768F8(ItemBehavior* this, u32 arg1) {
} else {
gPlayerState.dash_state = 0;
gPlayerState.field_0xe = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
@@ -95,7 +95,7 @@ void sub_08076964(ItemBehavior* this, u32 arg1) {
if ((++gPlayerState.dash_state) == 0x1e) {
if ((gPlayerState.flags & PL_FLAGS2) != 0) {
gPlayerState.dash_state = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
return;
}
gPlayerState.dash_state = 0x40;
@@ -105,7 +105,7 @@ void sub_08076964(ItemBehavior* this, u32 arg1) {
(gPlayerState.skills & SKILL_DASH_ATTACK) != 0) {
gPlayerState.field_0xab = 3;
sub_08077DF4(this, 0x298);
- bombEntity = CreatePlayerBomb(this, 0xc);
+ bombEntity = CreatePlayerItemWithParent(this, 0xc);
if (bombEntity != NULL) {
if (ItemIsSword(gSave.stats.itemButtons[SLOT_A]) != 0) {
uVar3 = gSave.stats.itemButtons[SLOT_A];
@@ -127,7 +127,7 @@ void sub_08076964(ItemBehavior* this, u32 arg1) {
}
}
gPlayerState.dash_state = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
void sub_08076A88(ItemBehavior* this, u32 arg1) {
@@ -170,5 +170,5 @@ void sub_08076A88(ItemBehavior* this, u32 arg1) {
}
}
gPlayerState.dash_state = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
diff --git a/src/item/itemRocsCape.c b/src/item/itemRocsCape.c
index 3c94d851..486fc90e 100644
--- a/src/item/itemRocsCape.c
+++ b/src/item/itemRocsCape.c
@@ -55,7 +55,7 @@ void ItemRocsCape(ItemBehavior* this, u32 arg1) {
}
}
}
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
void sub_08076758(ItemBehavior* this, u32 arg1) {
@@ -84,6 +84,6 @@ void sub_08076758(ItemBehavior* this, u32 arg1) {
}
}
} else {
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
diff --git a/src/item/itemShield.c b/src/item/itemShield.c
index 6c5a0866..d8cd9ace 100644
--- a/src/item/itemShield.c
+++ b/src/item/itemShield.c
@@ -30,7 +30,7 @@ void sub_08076D34(ItemBehavior* beh, u32 arg1) {
}
} else {
gPlayerState.field_0x3[0] = 0;
- sub_08077E78(beh, arg1);
+ DeletePlayerItem(beh, arg1);
}
}
@@ -40,6 +40,6 @@ void sub_08076D94(ItemBehavior* beh, u32 arg1) {
UpdateItemAnim(beh);
} else {
gPlayerState.field_0x3[0] = 0;
- sub_08077E78(beh, arg1);
+ DeletePlayerItem(beh, arg1);
}
}
diff --git a/src/item/itemSword.c b/src/item/itemSword.c
index cce1e02f..f55a1275 100644
--- a/src/item/itemSword.c
+++ b/src/item/itemSword.c
@@ -107,7 +107,7 @@ void sub_080754B8(ItemBehavior* this, u32 arg1) {
if (gPlayerEntity.frameSpriteSettings & 1) {
iVar1 = sub_0807B014();
if (iVar1 && FindEntityByID(PLAYER_ITEM, PLAYER_ITEM_SWORD_BEAM1, 2) == 0) {
- CreatePlayerBomb(this, 0xf);
+ CreatePlayerItemWithParent(this, 0xf);
if (iVar1 == 0xf) {
gPlayerState.field_0xab = 5;
} else {
@@ -228,7 +228,7 @@ void sub_08075738(ItemBehavior* this, u32 arg1) {
} else {
if (((((gPlayerEntity.frameSpriteSettings & 1) != 0) && ((gPlayerState.sword_state & 0x80) == 0)) &&
((gPlayerState.skills & SKILL_FOURSWORD) != 0))) {
- Entity* bombEnt = CreatePlayerBomb(this, 0x14);
+ Entity* bombEnt = CreatePlayerItemWithParent(this, 0x14);
if (bombEnt) {
bombEnt->animationState = (gPlayerEntity.animationState & 6) | 0x80;
}
@@ -313,5 +313,5 @@ void sub_080759B8(ItemBehavior* this, u32 arg1) {
gPlayerState.flags &= ~PL_SWORD_THRUST;
gPlayerState.sword_state = 0;
gPlayerState.item = NULL;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
diff --git a/src/item/itemTryPickupObject.c b/src/item/itemTryPickupObject.c
index 1eb0c3e2..c4addc70 100644
--- a/src/item/itemTryPickupObject.c
+++ b/src/item/itemTryPickupObject.c
@@ -9,7 +9,7 @@ void ItemTryPickupObject(ItemBehavior* this, u32 arg1) {
gUnk_0811BDB4[this->stateID](this, arg1);
}
-ASM_FUNC("asm/non_matching/itemTryPickupObject/sub_080761C0.inc", void sub_080761C0(ItemBehavior* this, u32 arg1))
+ASM_FUNC("asm/non_matching/itemTryPickupObject/ItemPickupCheck.inc", void ItemPickupCheck(ItemBehavior* this, u32 arg1))
void sub_080762C4(ItemBehavior* this, u32 arg1, u8 arg2, u32 arg3) {
this->field_0x18 = arg1;
@@ -61,6 +61,6 @@ void sub_0807660C(ItemBehavior* this, u32 arg1) {
UpdateItemAnim(this);
if ((--this->field_0x5[2] == 0xff) || (gPlayerState.field_0x0[1] == 0)) {
gPlayerState.field_0x0[1] = 0;
- sub_08077E78(this, arg1);
+ DeletePlayerItem(this, arg1);
}
}
diff --git a/src/manager/manager1A.c b/src/manager/manager1A.c
index 92a56415..ae167838 100644
--- a/src/manager/manager1A.c
+++ b/src/manager/manager1A.c
@@ -137,8 +137,8 @@ u32 sub_0805B1CC(Manager1A* this) {
u32 re = 0;
if (CheckPlayerProximity(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) {
if ((gPlayerState.flags & PL_DROWNING) && (gPlayerState.flags & PL_BUSY)) {
- gPlayerState.flags |= PL_FLAGS8000;
- } else if (gPlayerState.flags & PL_FLAGS8000) {
+ gPlayerState.flags |= PL_PIT_IS_EXIT;
+ } else if (gPlayerState.flags & PL_PIT_IS_EXIT) {
re = 1;
}
}
diff --git a/src/menu/kinstone_menu.c b/src/menu/kinstone_menu.c
index 45850f4d..2643eb57 100644
--- a/src/menu/kinstone_menu.c
+++ b/src/menu/kinstone_menu.c
@@ -80,7 +80,7 @@ void Subtask_KinstoneMenu(void) {
KinstoneMenu_Type3, KinstoneMenu_Type4, KinstoneMenu_Type5,
};
#if !(defined(DEMO_USA) || defined(DEMO_JP))
- gRoomTransition.player_status.field_0x24[8] = 2;
+ gRoomTransition.entity_update_type = 2;
FlushSprites();
kinstoneMenuTypes[gMenu.menuType]();
sub_080A3B74();
@@ -90,7 +90,7 @@ void Subtask_KinstoneMenu(void) {
UpdateEntities();
DrawEntities();
CopyOAM();
- gRoomTransition.player_status.field_0x24[8] = 0;
+ gRoomTransition.entity_update_type = 0;
#endif
}
diff --git a/src/npc/beedle.c b/src/npc/beedle.c
index ee5a33ac..ab3d2bae 100644
--- a/src/npc/beedle.c
+++ b/src/npc/beedle.c
@@ -67,7 +67,7 @@ void sub_0806336C(Entity* this) {
void sub_08063390(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
InitializeAnimation(this, GetAnimationState(this));
sub_08078778(this);
diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c
index e916f2c1..a8ab63b5 100644
--- a/src/npc/bladeBrothers.c
+++ b/src/npc/bladeBrothers.c
@@ -53,7 +53,7 @@ void sub_08068A1C(Entity* this) {
int offset;
this->type2 = this->type;
- if (gRoomTransition.player_status.field_0x24[8] != 0) {
+ if (gRoomTransition.entity_update_type != 0) {
offset = 6;
bVar1 = 3;
@@ -105,7 +105,7 @@ void sub_08068AA4(Entity* this) {
}
void sub_08068ADC(Entity* this) {
- if (gRoomTransition.player_status.field_0x24[8] == 2) {
+ if (gRoomTransition.entity_update_type == 2) {
GetNextFrame(this);
}
sub_0806FD3C(this);
@@ -146,7 +146,7 @@ void sub_08068B84(Entity* this) {
if (p = this->actionDelay, gUnk_08111618[p]) {
ForceEquipItem(gUnk_08111618[this->actionDelay], 0);
}
- sub_0805ED14(gUnk_081115EC[this->actionDelay]);
+ InitPlayerMacro(gUnk_081115EC[this->actionDelay]);
}
void sub_08068BB4(Entity* this) {
diff --git a/src/npc/brocco.c b/src/npc/brocco.c
index 176f1e42..3ee53bcd 100644
--- a/src/npc/brocco.c
+++ b/src/npc/brocco.c
@@ -47,7 +47,7 @@ void sub_08063584(Entity* this) {
if (this->field_0xf != 0) {
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->field_0xf = 0;
}
}
diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c
index 189c10c0..9d5e8567 100644
--- a/src/npc/castorWildsStatue.c
+++ b/src/npc/castorWildsStatue.c
@@ -32,7 +32,7 @@ void CastorWildsStatue(Entity* this) {
}
void sub_080673C0(Entity* this) {
- if (gRoomTransition.player_status.field_0x24[8] != 0) {
+ if (gRoomTransition.entity_update_type != 0) {
this->action = 3;
} else {
this->action = 1;
diff --git a/src/npc/cat.c b/src/npc/cat.c
index 9de7337d..8ff4860d 100644
--- a/src/npc/cat.c
+++ b/src/npc/cat.c
@@ -102,7 +102,7 @@ void sub_080678AC(Entity* this) {
sub_08067AAC(this);
} else {
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
sub_08067B34(this);
}
}
@@ -137,7 +137,7 @@ void sub_08067904(Entity* this) {
void sub_0806797C(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_08067B08(this);
}
}
@@ -166,7 +166,7 @@ void sub_08067A0C(Entity* this) {
u8 tmp;
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (sub_08067D20(this) != 0) {
sub_08067B80(this, 5);
this->actionDelay = this->actionDelay + 0x14;
@@ -186,7 +186,7 @@ void sub_08067A0C(Entity* this) {
void sub_08067A78(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_08067AAC(this);
}
}
diff --git a/src/npc/cucco.c b/src/npc/cucco.c
index 73b17303..254fbcbb 100644
--- a/src/npc/cucco.c
+++ b/src/npc/cucco.c
@@ -78,7 +78,7 @@ void Cucco_Idle(Entity* this) {
InitAnimationForceUpdate(this, (Random() & 1) + 2);
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 1;
this->subAction = 0;
}
diff --git a/src/npc/dog.c b/src/npc/dog.c
index b5924d68..e54e6477 100644
--- a/src/npc/dog.c
+++ b/src/npc/dog.c
@@ -119,7 +119,7 @@ void sub_08069D00(Entity* this) {
this->field_0x6a.HALF.HI = 8;
sub_0806A028(this);
if (0x1f < this->animIndex) {
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
return;
}
this->field_0x6a.HALF.HI = 8;
@@ -197,7 +197,7 @@ void sub_08069E50(Entity* this) {
sub_0806A028(this);
UpdateAnimationSingleFrame(this);
if (this->animIndex > 0x1f) {
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
return;
}
this->field_0x6a.HALF.HI = 8;
diff --git a/src/npc/drLeft.c b/src/npc/drLeft.c
index d4798164..ba3005a6 100644
--- a/src/npc/drLeft.c
+++ b/src/npc/drLeft.c
@@ -40,7 +40,7 @@ void sub_0806BFD8(Entity* this) {
}
void sub_0806C00C(Entity* this, ScriptExecutionContext* context) {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
context->condition = 1;
} else {
context->condition = 0;
diff --git a/src/npc/festari.c b/src/npc/festari.c
index 2af31802..8dbc8274 100644
--- a/src/npc/festari.c
+++ b/src/npc/festari.c
@@ -45,7 +45,7 @@ void sub_0805FE48(Entity* this) {
}
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
switch (this->animIndex) {
case 8:
case 10:
diff --git a/src/npc/goronMerchant.c b/src/npc/goronMerchant.c
index a0d29023..9a0cf266 100644
--- a/src/npc/goronMerchant.c
+++ b/src/npc/goronMerchant.c
@@ -25,7 +25,7 @@ void GoronMerchant(Entity* this) {
}
void sub_08069584(Entity* this) {
- if (gRoomTransition.player_status.field_0x24[8] != 0) {
+ if (gRoomTransition.entity_update_type != 0) {
this->action = 3;
} else {
this->action = 1;
@@ -59,7 +59,7 @@ void sub_080695E8(Entity* this) {
}
void sub_0806961C(Entity* this) {
- if (gRoomTransition.player_status.field_0x24[8] == 2) {
+ if (gRoomTransition.entity_update_type == 2) {
UpdateAnimationSingleFrame(this);
}
sub_0806FD3C(this);
diff --git a/src/npc/gregal.c b/src/npc/gregal.c
index d503f209..7dfd3ada 100644
--- a/src/npc/gregal.c
+++ b/src/npc/gregal.c
@@ -97,7 +97,7 @@ void sub_0806CC08(Entity* this) {
}
void sub_0806CCB4(Entity* this, ScriptExecutionContext* context) {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
context->condition = 1;
} else {
context->condition = 0;
diff --git a/src/npc/mailbox.c b/src/npc/mailbox.c
index 755e0b2c..1f7c7835 100644
--- a/src/npc/mailbox.c
+++ b/src/npc/mailbox.c
@@ -40,7 +40,7 @@ void sub_08063220(Entity* this) {
void sub_08063254(Entity* this, u32 unused) {
sub_08063280(this, unused);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 3;
MessageFromTarget(0);
}
diff --git a/src/npc/mama.c b/src/npc/mama.c
index 57290d94..210bce90 100644
--- a/src/npc/mama.c
+++ b/src/npc/mama.c
@@ -61,7 +61,7 @@ void Mama_Head(Entity* this) {
void sub_0806C4A8(Entity* this, ScriptExecutionContext* context) {
s32 tmp;
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
tmp = GetAnimationState(this);
if (tmp < 0) {
tmp = 3;
diff --git a/src/npc/minishEzlo.c b/src/npc/minishEzlo.c
index 5216a19f..d501f60f 100644
--- a/src/npc/minishEzlo.c
+++ b/src/npc/minishEzlo.c
@@ -34,7 +34,7 @@ void sub_0806305C(Entity* this) {
this->spriteRendering.b0 = 3;
*(u32*)&this->field_0x6c = 0x100;
this->field_0x70.WORD = 0x100;
- sub_0805EC9C(this, 0x100, 0x100, 0x0);
+ SetAffineInfo(this, 0x100, 0x100, 0x0);
InitAnimationForceUpdate(this, 0x10);
this->field_0x80.HWORD = 0x10;
SoundReq(SFX_PLY_SHRINKING);
diff --git a/src/npc/npc5.c b/src/npc/npc5.c
index 2f8ae154..574527d4 100644
--- a/src/npc/npc5.c
+++ b/src/npc/npc5.c
@@ -270,7 +270,7 @@ void sub_08060D78(Entity* this) {
void sub_08060DD0(Entity* this) {
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 1;
sub_08060E70(this, 0);
}
@@ -296,7 +296,7 @@ void sub_08060DFC(Entity* this) {
void sub_08060E34(Entity* this) {
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 2;
this->animationState = DirectionToAnimationState(GetFacingDirection(this, &gPlayerEntity)) * 2;
sub_08060E70(this, 8);
@@ -323,7 +323,7 @@ void sub_08060E94(Entity* this) {
void sub_08060EDC(Entity* this) {
s32 tmp;
- if (((u32)this->animIndex - 0x20 < 0x10) && ((this->frame & 0x80) == 0)) {
+ if (((u32)this->animIndex - 0x20 < 0x10) && ((this->frame & ANIM_DONE) == 0)) {
UpdateAnimationSingleFrame(this);
} else {
tmp = GetFacingDirection(this, &gPlayerEntity) + this->animationState * -4;
@@ -337,7 +337,7 @@ void sub_08060EDC(Entity* this) {
}
} else {
if ((this->animationState & 1) == 0) {
- if (((this->frame & 0x80) != 0) && (0xf >= (u32)this->animIndex - 0x20)) {
+ if (((this->frame & ANIM_DONE) != 0) && (0xf >= (u32)this->animIndex - 0x20)) {
sub_08060E70(this, 0);
} else {
sub_08060E94(this);
@@ -528,7 +528,7 @@ u32 sub_08061230(Entity* this) {
}
} else {
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
return 1;
}
((UnkHeap*)this->myHeap)->unk_0 &= 0xfe;
@@ -551,7 +551,7 @@ void sub_08061358(Entity* this) {
switch (this->subAction) {
case 0:
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
return;
}
this->subAction = 1;
@@ -576,7 +576,7 @@ void sub_08061358(Entity* this) {
break;
case 2:
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
return;
}
this->animationState = ((this->frame & 0x18) >> 2);
@@ -914,7 +914,7 @@ void sub_08061B58(Entity* this) {
this->action = 1;
InitAnimationForceUpdate(this, 2);
}
- if (gRoomTransition.player_status.field_0x24[8] == 2) {
+ if (gRoomTransition.entity_update_type == 2) {
UpdateAnimationSingleFrame(this);
}
sub_0806FD3C(this);
diff --git a/src/npc/npc9.c b/src/npc/npc9.c
index df8cc07e..6e1ff9f6 100644
--- a/src/npc/npc9.c
+++ b/src/npc/npc9.c
@@ -29,7 +29,7 @@ void sub_08062B14(Entity* this) {
void sub_08062B48(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
MessageFromTarget(0xa01); // invalid
this->action++;
}
diff --git a/src/npc/pina.c b/src/npc/pina.c
index d4eea09e..e1ea0e4b 100644
--- a/src/npc/pina.c
+++ b/src/npc/pina.c
@@ -49,7 +49,7 @@ void sub_08063AC0(Entity* this) {
if (this->field_0xf != 0) {
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->field_0xf = 0;
}
}
diff --git a/src/npc/rem.c b/src/npc/rem.c
index 3353060d..2315efbd 100644
--- a/src/npc/rem.c
+++ b/src/npc/rem.c
@@ -73,7 +73,7 @@ void sub_0806A410(Entity* this) {
}
break;
case 1:
- if (((this->frame & 0x80) != 0)) {
+ if (((this->frame & ANIM_DONE) != 0)) {
sub_0806A9B0(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
}
break;
@@ -88,14 +88,14 @@ void sub_0806A458(Entity* this) {
}
break;
case 1:
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->subAction = 2;
InitializeAnimation(this, 10);
ClearLocalFlag(0x62);
}
break;
case 2:
- if (((this->frame & 0x80) != 0)) {
+ if (((this->frame & ANIM_DONE) != 0)) {
this->action = 1;
this->subAction = 0;
this->actionDelay = 0x3c;
@@ -108,7 +108,7 @@ void sub_0806A458(Entity* this) {
void sub_0806A4CC(Entity* this) {
switch (this->subAction) {
case 0:
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
if ((u8)(this->animIndex - 8) < 2) {
this->subAction = 1;
this->field_0x6a.HWORD = 1;
@@ -120,7 +120,7 @@ void sub_0806A4CC(Entity* this) {
}
break;
case 1:
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->subAction = 2;
InitializeAnimation(this, GetAnimationState(this));
}
@@ -143,7 +143,7 @@ void sub_0806A550(Entity* this) {
gActiveScriptInfo.syncFlags |= 0x100;
SoundReq(SFX_CHEST_OPEN);
}
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 5;
this->subAction = 0;
InitializeAnimation(this, 0xd);
@@ -157,7 +157,7 @@ void nullsub_503(Entity* this) {
void sub_0806A5C0(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
InitializeAnimation(this, (Random() & 3) + 4);
}
}
@@ -301,7 +301,7 @@ void sub_0806A890(Entity* this) {
SetDefaultPriority(this, PRIO_MESSAGE);
}
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/npc/smith.c b/src/npc/smith.c
index 02f9c472..ae4394dd 100644
--- a/src/npc/smith.c
+++ b/src/npc/smith.c
@@ -104,7 +104,7 @@ void sub_080661B0(Entity* this) {
void sub_080661BC(Entity* this) {
if (this->animIndex == 0xc) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->field_0x80.HWORD = GetAnimationState(this) + 8;
InitAnimationForceUpdate(this, this->field_0x80.HWORD);
}
diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c
index 7f7ffa88..93914b00 100644
--- a/src/npc/townMinish.c
+++ b/src/npc/townMinish.c
@@ -70,7 +70,7 @@ void sub_0806AC3C(Entity* this) {
if (!(this->field_0x68.HALF.HI & 7)) {
this->animationState = sub_0806F5B0(this->field_0x68.HALF.HI);
- InitializeAnimation(this, (this->animationState / 2) ^ 2);
+ InitializeAnimation(this, AnimationStateFlip90(this->animationState / 2));
}
}
diff --git a/src/npc/vaatiReborn.c b/src/npc/vaatiReborn.c
index fb59284e..5209022d 100644
--- a/src/npc/vaatiReborn.c
+++ b/src/npc/vaatiReborn.c
@@ -130,7 +130,7 @@ void VaatiRebornAction1(Entity* this) {
}
break;
case 1:
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->subAction = 2;
ChangeObjPalette(this, 0x13f);
InitAnimationForceUpdate(this, this->subAction - 1);
@@ -153,7 +153,7 @@ void VaatiRebornAction1(Entity* this) {
}
break;
case 3:
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
SetRoomFlag(0);
DeleteThisEntity();
}
diff --git a/src/npc/zelda.c b/src/npc/zelda.c
index 46187a72..0b67a4a8 100644
--- a/src/npc/zelda.c
+++ b/src/npc/zelda.c
@@ -152,7 +152,7 @@ void sub_08066E80(Entity* this, ScriptExecutionContext* context) {
break;
case 4:
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
gActiveScriptInfo.flags |= 1;
return;
}
diff --git a/src/npcUtils.c b/src/npcUtils.c
index 3c042b23..2bd9564a 100644
--- a/src/npcUtils.c
+++ b/src/npcUtils.c
@@ -178,7 +178,7 @@ u32 sub_0806EED0(Entity* ent) {
}
u32 sub_0806EEF4(Entity* ent) {
- if (ent->frame & 0x80)
+ if (ent->frame & ANIM_DONE)
return sub_0806EF74(ent, 1);
return 0;
}
diff --git a/src/object/angryStatue.c b/src/object/angryStatue.c
index 097f4626..d3fbe01d 100644
--- a/src/object/angryStatue.c
+++ b/src/object/angryStatue.c
@@ -55,7 +55,7 @@ void AngryStatue_Action2(Entity* this) {
EnqueueSFX(SFX_EC);
}
- } else if ((this->frame & 0x80) != 0) {
+ } else if ((this->frame & ANIM_DONE) != 0) {
this->action = 1;
InitializeAnimation(this, this->type);
}
diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c
index 729d0fe0..5dace1cc 100644
--- a/src/object/beanstalk.c
+++ b/src/object/beanstalk.c
@@ -169,7 +169,7 @@ void Beanstalk_Action1Type0(BeanstalkEntity* this) {
void Beanstalk_Action1Type0SubAction0(BeanstalkEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->actionDelay < 2) {
super->actionDelay++;
} else {
@@ -186,7 +186,7 @@ void Beanstalk_Action1Type0SubAction1(BeanstalkEntity* this) {
SoundReq(SFX_198);
}
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
Entity* entity = CreateObject(BEANSTALK, 1, 0);
super->child = entity;
if (entity != NULL) {
@@ -228,7 +228,7 @@ void Beanstalk_Action1Type2(BeanstalkEntity* this) {
super->actionDelay = 0;
}
}
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->child = CreateObject(BEANSTALK, 3, 0);
if (super->child != NULL) {
super->child->x.HALF.HI = super->x.HALF.HI;
@@ -242,7 +242,7 @@ void Beanstalk_Action1Type2(BeanstalkEntity* this) {
}
void Beanstalk_Action1Type4(BeanstalkEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
GetNextFrame(super);
}
}
@@ -290,7 +290,7 @@ void Beanstalk_Action1Type7(BeanstalkEntity* this) {
super->actionDelay = 0;
}
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
InitializeAnimation(super, (super->type2 - 1) * 3 + 1);
}
break;
diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c
index 09407bc4..79df9f91 100644
--- a/src/object/bigIceBlock.c
+++ b/src/object/bigIceBlock.c
@@ -87,7 +87,7 @@ void BigIceBlock_Action2(BigIceBlockEntity* this) {
super->actionDelay += 1;
}
tmp = gUnk_081237B0[super->actionDelay >> 5];
- sub_0805EC9C(super, 0x100, tmp, 0);
+ SetAffineInfo(super, 0x100, tmp, 0);
if (super->type != 1) {
if (super->type != 2) {
SetFlag(this->unk_86);
@@ -114,7 +114,7 @@ void sub_08099880(BigIceBlockEntity* this) {
sub_08099C18(this);
}
uVar4 = (0x3c - super->actionDelay) * 0x20 + 0x100;
- sub_0805EC9C(super, 0x100, uVar4, 0);
+ SetAffineInfo(super, 0x100, uVar4, 0);
sub_0806FCF4(super, uVar4, 2, 0);
obj = CreateObject(SPECIAL_FX, 0x11, 0x40);
if (obj != NULL) {
diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c
index 5c36d40b..23aa475f 100644
--- a/src/object/bigPushableLever.c
+++ b/src/object/bigPushableLever.c
@@ -70,7 +70,7 @@ void BigPushableLever_Idle(BigPushableLeverEntity* this) {
void BigPushableLever_Pushing(BigPushableLeverEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->type2 == 0) {
SetFlag(this->pushedFlag);
} else {
diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c
index 69260c5b..323cbf0b 100644
--- a/src/object/bigVortex.c
+++ b/src/object/bigVortex.c
@@ -91,7 +91,7 @@ void sub_08098E3C(Entity* this) {
InitAnimationForceUpdate(this, this->type);
}
temp = &gUnk_08123690[this->type & 2];
- sub_0805EC9C(this, temp[0], temp[1], 0);
+ SetAffineInfo(this, temp[0], temp[1], 0);
UpdateAnimationSingleFrame(this);
}
diff --git a/src/object/bird.c b/src/object/bird.c
index cafe1262..f16d46b5 100644
--- a/src/object/bird.c
+++ b/src/object/bird.c
@@ -131,7 +131,7 @@ void sub_0809D178(Entity* this) {
UpdateSpriteForCollisionLayer(this);
this->frame = 0x80;
}
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
InitializeAnimation(this, Random() & 3);
this->frameDuration = (Random() & 0xf) + 0x10;
this->spriteSettings.flipX = FALSE;
diff --git a/src/object/bollard.c b/src/object/bollard.c
index 3a7d13b7..1c6a8bda 100644
--- a/src/object/bollard.c
+++ b/src/object/bollard.c
@@ -59,7 +59,7 @@ void sub_0808B2CC(BollardEntity* this) {
void sub_0808B324(BollardEntity* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_0808B42C(this);
}
}
@@ -80,7 +80,7 @@ void sub_0808B344(BollardEntity* this) {
void sub_0808B38C(BollardEntity* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_0808B41C(this);
}
}
diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c
index 5b1bd36d..0d1844e1 100644
--- a/src/object/bossDoor.c
+++ b/src/object/bossDoor.c
@@ -93,7 +93,7 @@ void BossDoor_Action1(BossDoorEntity* this) {
}
void BossDoor_Action2(BossDoorEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
if ((gRoomTransition.frameCount & 3) == 0) {
SoundReq(SFX_185);
}
diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c
index a7890edb..a7072aa7 100644
--- a/src/object/chestSpawner.c
+++ b/src/object/chestSpawner.c
@@ -162,7 +162,7 @@ void ChestSpawner_Type2Action3(ChestSpawnerEntity* this) {
void ChestSpawner_Type2Action4(ChestSpawnerEntity* this) {
sub_0800445C(super);
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (--super->field_0xf == 0) {
if (super->actionDelay == 0x18) {
super->action = 6;
diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c
index 13652224..52fe70db 100644
--- a/src/object/crenelBeanSprout.c
+++ b/src/object/crenelBeanSprout.c
@@ -133,7 +133,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
u32 tmp;
if ((super->type & 1) != 0) {
if (super->type == 3) {
- sub_08078930(super);
+ RegisterCarryEntity(super);
sub_0800445C(super);
} else {
PositionRelative(super->parent, super, -0x1c0000, -0x280000);
@@ -159,7 +159,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
super->spriteRendering.b3 = parent->spriteRendering.b3;
super->spriteOrientation.flipY = parent->spriteOrientation.flipY;
}
- sub_0805EC9C(super, 0xcc, 0xcc, 0);
+ SetAffineInfo(super, 0xcc, 0xcc, 0);
} else {
gPlayerState.mobility |= 0x80;
gPlayerState.heldObject = 5;
@@ -177,7 +177,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) {
gUnk_0200AF00.unk_2f = 0;
}
PositionRelative(&gPlayerEntity, super, 0, 0x10000);
- if (sub_080B1AA8(super) == 0x19) {
+ if (GetTileUnderEntity(super) == 0x19) {
sub_0807BA8C(0xdc, super->collisionLayer);
sub_08096A78(this);
}
@@ -228,7 +228,7 @@ void CrenelBeanSprout_Action2SubAction3(CrenelBeanSproutEntity* this) {
void CrenelBeanSprout_Action3(CrenelBeanSproutEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action++;
InitializeAnimation(super, 10);
}
diff --git a/src/object/deathFx.c b/src/object/deathFx.c
index 4fe5ccb9..dee32ccc 100644
--- a/src/object/deathFx.c
+++ b/src/object/deathFx.c
@@ -49,7 +49,7 @@ void DeathFx_Action0(DeathFxObject* this) {
tmp = super->actionDelay;
super->actionDelay = 0;
}
- sub_0805EC9C(super, tmp, tmp, 0);
+ SetAffineInfo(super, tmp, tmp, 0);
LoadSwapGFX(super, 4, 0);
InitAnimationForceUpdate(super, 0);
SoundReq(SFX_BOSS_EXPLODE);
@@ -80,7 +80,7 @@ void DeathFx_Action0(DeathFxObject* this) {
void DeathFx_Action1(DeathFxObject* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_08081790(this);
DeathFx_Delete(this);
} else {
@@ -92,7 +92,7 @@ void DeathFx_Action1(DeathFxObject* this) {
void DeathFx_Action2(DeathFxObject* this) {
UpdateAnimationSingleFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
DeathFx_Delete(this);
} else {
if ((super->frame & 1) != 0) {
diff --git a/src/object/eyeSwitch.c b/src/object/eyeSwitch.c
index 125e68fe..769a2cdf 100644
--- a/src/object/eyeSwitch.c
+++ b/src/object/eyeSwitch.c
@@ -56,7 +56,7 @@ void sub_08088718(EyeSwitchEntity* this) {
void sub_08088760(EyeSwitchEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
this->unk70 = super->actionDelay << 1;
InitializeAnimation(super, super->animationState + 4);
@@ -78,7 +78,7 @@ void sub_08088790(EyeSwitchEntity* this) {
void sub_080887D8(EyeSwitchEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 1;
COLLISION_ON(super);
InitializeAnimation(super, super->animationState);
diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c
index e36a09cf..1a0d8894 100644
--- a/src/object/ezloCap.c
+++ b/src/object/ezloCap.c
@@ -152,7 +152,7 @@ void EzloCap_Type1Action1(EzloCapEntity* this) {
}
}
}
- } else if ((super->frame & 0x80) != 0) {
+ } else if ((super->frame & ANIM_DONE) != 0) {
super->actionDelay = Random() & 3;
if (super->actionDelay != 0) {
super->spriteSettings.flipX = Random() & 1;
@@ -203,7 +203,7 @@ void sub_08082C5C(EzloCapEntity* this) {
}
break;
case 2:
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
InitAnimationForceUpdate(super, gUnk_0811F18C[Random() & 3] + (Random() & 3));
return;
}
@@ -292,7 +292,7 @@ void EzloCap_ScriptedAction2(EzloCapEntity* this) {
void EzloCap_ScriptedAction3(EzloCapEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 1;
super->subAction = 0;
super->spriteOffsetX = 0;
diff --git a/src/object/fan.c b/src/object/fan.c
index 890689e9..d372ff5c 100644
--- a/src/object/fan.c
+++ b/src/object/fan.c
@@ -81,7 +81,7 @@ void Fan_Action2(FanEntity* this) {
void Fan_Action3(FanEntity* this) {
sub_0809F08C(this);
sub_0809EE44(this);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
sub_0809EE34(this);
}
}
diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c
index 3ae836d1..df7dbdc5 100644
--- a/src/object/figurineDevice.c
+++ b/src/object/figurineDevice.c
@@ -197,7 +197,7 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) {
GetNextFrame(super);
switch (this->unk_7a) {
case 0:
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
this->unk_7a = 1;
super->actionDelay = 0x28;
ChangeObjPalette(super, gUnk_08120AA8[super->type2]);
@@ -207,7 +207,7 @@ void FigurineDevice_Action3(FigurineDeviceEntity* this) {
break;
case 1:
- if (((super->frame & 0x80) != 0) && (--super->actionDelay == 0)) {
+ if (((super->frame & ANIM_DONE) != 0) && (--super->actionDelay == 0)) {
this->unk_7a = 2;
SetRoomFlag(2);
MenuFadeIn(7, super->field_0xf);
diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c
index c0019201..7d3bd4c7 100644
--- a/src/object/frozenWaterElement.c
+++ b/src/object/frozenWaterElement.c
@@ -47,12 +47,12 @@ void sub_0809BECC(FrozenWaterElementEntity* this) {
super->frameIndex = 0;
super->spriteRendering.b0 = 3;
sub_0809C0A8(this);
- sub_0805EC9C(super, 0xcc, 0xcc, 0);
+ SetAffineInfo(super, 0xcc, 0xcc, 0);
}
}
void sub_0809BF1C(FrozenWaterElementEntity* this) {
- sub_0805EC9C(super, 0xcc, 0xcc, 0);
+ SetAffineInfo(super, 0xcc, 0xcc, 0);
if (CheckFlags(OUGONTEKI_G)) {
Entity* obj = CreateObject(OBJECT_90, 0, 0);
if (obj != NULL) {
@@ -88,7 +88,7 @@ void sub_0809BF74(FrozenWaterElementEntity* this) {
if (this->unk_74 < 0x78) {
tmp2 = ((0x78 - this->unk_74) << 5);
tmp2 += 0xcc;
- sub_0805EC9C(super, ((0x78 - this->unk_74) << 4) + 0xcc, tmp2, 0);
+ SetAffineInfo(super, ((0x78 - this->unk_74) << 4) + 0xcc, tmp2, 0);
sub_0806FCF4(super, tmp2, 8, 0);
super->spriteOffsetY += 8;
}
diff --git a/src/object/gentariCurtains.c b/src/object/gentariCurtains.c
index e3ff7b3a..eed470dc 100644
--- a/src/object/gentariCurtains.c
+++ b/src/object/gentariCurtains.c
@@ -27,7 +27,7 @@ void sub_080921F0(GentariCurtainEntity* this);
void sub_08092214(GentariCurtainEntity* this);
extern Entity gUnk_030011E8[7];
-extern Entity gUnk_03003BE0;
+extern Entity gCarryEntities;
void GentariCurtain(Entity* this) {
static void (*const actionFuncs[])(GentariCurtainEntity*) = {
@@ -76,7 +76,7 @@ void sub_0809214C(GentariCurtainEntity* this) {
void sub_08092164(GentariCurtainEntity* this) {
UpdateAnimationSingleFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 3;
SetTile(this->tileIndex, this->tile, 1);
SetTile(this->tileIndex2, this->tile2, 1);
diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c
index a03d9344..ffbfe2a6 100644
--- a/src/object/greatFairy.c
+++ b/src/object/greatFairy.c
@@ -173,7 +173,7 @@ void GreatFairy_WingsInit(Entity* this) {
gScreen.controls.layerFXControl = 0xF40;
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 8);
this->speed = 1024;
- sub_0805EC9C(this, 1024, 256, 0);
+ SetAffineInfo(this, 1024, 256, 0);
}
void GreatFairy_WingsUpdate(Entity* this) {
@@ -184,7 +184,7 @@ void GreatFairy_WingsUpdate(Entity* this) {
gRoomVars.animFlags |= 32;
gActiveScriptInfo.syncFlags |= 4;
} else {
- sub_0805EC9C(this, this->speed, 256, 0);
+ SetAffineInfo(this, this->speed, 256, 0);
}
}
@@ -273,7 +273,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) {
this->actionDelay = 90;
this->speed = 4096;
this->spriteRendering.b0 = 3;
- sub_0805EC9C(this, 256, 256, 0);
+ SetAffineInfo(this, 256, 256, 0);
}
}
@@ -285,7 +285,7 @@ void GreatFairy_MiniAffineUpdate(Entity* this) {
sub_0805EC60(this);
} else {
this->speed -= 24;
- sub_0805EC9C(this, 256, this->speed >> 4, 0);
+ SetAffineInfo(this, 256, this->speed >> 4, 0);
}
}
@@ -304,7 +304,7 @@ void GreatFairy_DropletInit(Entity* this) {
void GreatFairy_DropletUpdate(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteEntity(this);
}
}
@@ -370,7 +370,7 @@ void GreatFairy_EnergyInit(Entity* this) {
void GreatFairy_EnergyUpdate(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteEntity(this);
}
}
diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c
index a81709c4..421990cb 100644
--- a/src/object/heartContainer.c
+++ b/src/object/heartContainer.c
@@ -47,7 +47,7 @@ static void sub_0808E714(Entity* this) {
int var0 = 0x400 - this->field_0xf * 8;
if (var0 > 0x100) {
this->field_0xf++;
- sub_0805EC9C(this, var0, var0, 0);
+ SetAffineInfo(this, var0, var0, 0);
} else {
this->action = 3;
this->field_0x3c |= 0x10;
diff --git a/src/object/jailBars.c b/src/object/jailBars.c
index 9983eb1c..3a4abc9b 100644
--- a/src/object/jailBars.c
+++ b/src/object/jailBars.c
@@ -5,7 +5,7 @@
#include "sound.h"
#include "functions.h"
-extern void sub_080A0960(Entity*, u32);
+static void SetJailBarTiles(Entity*, u32);
extern void (*const gUnk_08124950[])(Entity*);
extern u16 gUnk_08124960[];
@@ -18,11 +18,11 @@ void JailBars(Entity* this) {
void sub_080A08C4(Entity* this) {
if (CheckFlags(this->field_0x86.HWORD) == 0) {
this->action = 1;
- sub_080A0960(this, 0);
+ SetJailBarTiles(this, 0);
} else {
this->action = 3;
InitializeAnimation(this, 1);
- sub_080A0960(this, 1);
+ SetJailBarTiles(this, 1);
}
this->spriteSettings.draw = 3; // ???
this->collisionLayer = 1;
@@ -32,14 +32,14 @@ void sub_080A08C4(Entity* this) {
void sub_080A0910(Entity* this) {
if (CheckFlags(this->field_0x86.HWORD) != 0) {
this->action = 2;
- sub_080A0960(this, 1);
+ SetJailBarTiles(this, 1);
SoundReq(SFX_10B);
}
}
void sub_080A0938(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
InitializeAnimation(this, 1);
}
@@ -48,7 +48,7 @@ void sub_080A0938(Entity* this) {
void nullsub_127(Entity* this) {
}
-void sub_080A0960(Entity* this, u32 arg1) {
+static void SetJailBarTiles(Entity* this, u32 arg1) {
u16* puVar1;
puVar1 = gUnk_08124960;
diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c
index 8576cfa8..56338844 100644
--- a/src/object/lavaPlatform.c
+++ b/src/object/lavaPlatform.c
@@ -95,7 +95,7 @@ void LavaPlatform_Type0Action2(LavaPlatformEntity* this) {
(super->child)->spriteOffsetY = 0;
InitializeAnimation(super->child, super->child->animationState);
CreateFx(super, FX_LAVA_SPLASH_HUGE, 0);
- } else if ((super->zVelocity < 0x18000) && ((super->frame & 0x80) == 0)) {
+ } else if ((super->zVelocity < 0x18000) && ((super->frame & ANIM_DONE) == 0)) {
UpdateAnimationSingleFrame(super);
}
}
@@ -169,7 +169,7 @@ void LavaPlatform_Type1Action4(LavaPlatformEntity* this) {
}
if (this->timer < 0x8d) {
GetNextFrame(super);
- tmp = super->frame & 0x80;
+ tmp = super->frame & ANIM_DONE;
if (tmp) {
// Platform sank
super->action = 5;
@@ -216,7 +216,7 @@ void LavaPlatform_Type1Action6(LavaPlatformEntity* this) {
super->flags |= ENT_COLLIDE;
super->hitType = 0xac;
} else {
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
sub_0809264C(this);
if (tmp) {
gPlayerState.field_0x3f = 0xfd;
diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c
index d7f653df..a7fd4209 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -124,7 +124,7 @@ void sub_08085A98(LilypadLargeEntity* this) {
sub_08085F1C(this);
if (0x7fffff < (u32)this->unk_78.WORD) {
this->unk_78.WORD -= 0x20000;
- sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
+ SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
if (sub_080B1A8C(super, 0, 0x18) != 0x11) {
super->subAction = 2;
@@ -148,7 +148,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
if (GravityUpdate(super, 0x2000) != 0) {
if ((u32)this->unk_78.WORD < 0x1200000) {
this->unk_78.WORD += 0x100000;
- sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
+ SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
gPlayerEntity.y.HALF.HI = (super->y.HALF.HI + super->z.HALF.HI) - this->unk_74;
if (gArea.locationIndex == 0x1b) {
@@ -159,7 +159,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
}
} else {
ResetCollisionLayer(super);
- if (sub_080B1AA8(super) == 0xd) {
+ if (GetTileUnderEntity(super) == 0xd) {
ResetCollisionLayer(&gPlayerEntity);
sub_08085CDC(this);
super->direction = GetFacingDirection(&gPlayerEntity, super);
@@ -181,7 +181,7 @@ void sub_08085B40(LilypadLargeEntity* this) {
super->actionDelay |= 0x80;
this->unk_70 = 0;
this->unk_6c = 0;
- if (sub_080B1AA8(super) == 0xd) {
+ if (GetTileUnderEntity(super) == 0xd) {
super->action = 4;
}
}
@@ -214,7 +214,7 @@ void sub_08085C5C(LilypadLargeEntity* this) {
void sub_08085CDC(LilypadLargeEntity* this) {
this->unk_78.WORD += 0x100000;
if (this->unk_78.WORD_U < 0x4000000) {
- sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
+ SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
} else {
DeleteThisEntity();
}
@@ -381,5 +381,5 @@ void sub_08085F48(LilypadLargeEntity* this) {
}
}
}
- sub_0805EC9C(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
+ SetAffineInfo(super, this->unk_78.HALF_U.HI, this->unk_78.HALF_U.HI, this->unk_7c.HALF_U.HI);
}
diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c
index c8cf76f1..ce03ff99 100644
--- a/src/object/lilypadSmall.c
+++ b/src/object/lilypadSmall.c
@@ -59,5 +59,5 @@ static void sub_08097B24(Entity* this) {
temp2 = ++this->field_0xf;
temp = temp3[(temp2 >> 5) & 7];
- sub_0805EC9C(this, temp, temp, 0);
+ SetAffineInfo(this, temp, temp, 0);
}
diff --git a/src/object/litArea.c b/src/object/litArea.c
index 06d50198..f042209e 100644
--- a/src/object/litArea.c
+++ b/src/object/litArea.c
@@ -19,7 +19,7 @@ void LitArea(Entity* this) {
this->actionDelay = 2;
this->field_0x68.HWORD = 0xfffe;
this->field_0x6a.HWORD = 0x80;
- sub_0805EC9C(this, 0x80, 0x80, 0);
+ SetAffineInfo(this, 0x80, 0x80, 0);
} else {
if (--this->actionDelay == 0) {
this->actionDelay = 2;
@@ -30,7 +30,7 @@ void LitArea(Entity* this) {
if (0x88 < this->field_0x6a.HWORD) {
this->field_0x68.HWORD = 0xffff;
}
- sub_0805EC9C(this, this->field_0x6a.HWORD, this->field_0x6a.HWORD, 0);
+ SetAffineInfo(this, this->field_0x6a.HWORD, this->field_0x6a.HWORD, 0);
}
}
gScreen.lcd.displayControl |= DISPCNT_OBJWIN_ON;
diff --git a/src/object/macroBook.c b/src/object/macroBook.c
index 462dfea1..b63bfc37 100644
--- a/src/object/macroBook.c
+++ b/src/object/macroBook.c
@@ -44,7 +44,7 @@ void MacroBook_Init(MacroBookEntity* this) {
super->spriteOffsetY = -4;
super->spritePriority.b0 = 7;
super->spriteRendering.b3 = 3;
- sub_0805EC9C(super, this->unk80, this->unk80, 0);
+ SetAffineInfo(super, this->unk80, this->unk80, 0);
UpdateSpriteForCollisionLayer(super);
InitAnimationForceUpdate(super, super->field_0xf);
sub_0809A958(this);
@@ -56,7 +56,7 @@ void MacroBook_Action1(MacroBookEntity* this) {
if (super->actionDelay) {
super->actionDelay--;
} else {
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->field_0xf == 3) {
super->action = 2;
super->actionDelay = 90;
@@ -83,7 +83,7 @@ void MacroBook_Action2(MacroBookEntity* this) {
super->action = 1;
super->actionDelay = 0;
} else {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
return;
}
super->action = 3;
@@ -117,7 +117,7 @@ void MacroBook_Action3(MacroBookEntity* this) {
if (super->actionDelay) {
this->unk80 += 8;
super->x.WORD += 0x400;
- sub_0805EC9C(super, this->unk80, this->unk80, 0);
+ SetAffineInfo(super, this->unk80, this->unk80, 0);
} else {
sub_0809AA9C(this, super->child, 0);
sub_0809AA9C(this, &gPlayerEntity, 1);
diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c
index 37cf06ce..4adcb573 100644
--- a/src/object/macroPlayer.c
+++ b/src/object/macroPlayer.c
@@ -111,7 +111,7 @@ void MacroPlayer_Type0_Init(MacroPlayerEntity* this) {
super->z.HALF.HI = 0xff50;
this->unk6a = 4;
super->spriteRendering.b0 = 3;
- sub_0805EC9C(super, 4, 4, 0);
+ SetAffineInfo(super, 4, 4, 0);
ptr = gUnk_02018EB0;
*(Entity**)&ptr[0x14] = super;
ChangeObjPalette(super, sub_0807A094(0));
@@ -125,7 +125,7 @@ void MacroPlayer_Type0_Init(MacroPlayerEntity* this) {
void sub_0808CC88(MacroPlayerEntity* this) {
if (this->unk6a < 0x400) {
this->unk6a += 4;
- sub_0805EC9C(super, this->unk6a, this->unk6a, 0);
+ SetAffineInfo(super, this->unk6a, this->unk6a, 0);
sub_0806FCF4(super, this->unk6a, 8, 2);
}
}
diff --git a/src/object/minecart.c b/src/object/minecart.c
index 5b2538f2..7370c28b 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -146,7 +146,7 @@ void sub_080919AC(Entity* this) {
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
if (iVar2 == 0) {
this->direction = DirectionTurnAround(this->direction);
- this->animationState = this->animationState ^ 2;
+ this->animationState = AnimationStateFlip90(this->animationState);
} else {
switch (uVar3) {
case 0x64:
@@ -177,7 +177,7 @@ void sub_080919AC(Entity* this) {
case 0x6d:
case 0x6e:
case 0x6f:
- if (uVar3 == sub_080B1AA8(this)) {
+ if (uVar3 == GetTileUnderEntity(this)) {
sub_08091C0C(this);
gPlayerEntity.animationState = this->animationState << 1;
return;
diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c
index 1ffcd585..e4b438d4 100644
--- a/src/object/mineralWaterSource.c
+++ b/src/object/mineralWaterSource.c
@@ -1,5 +1,4 @@
-#include "global.h"
-#include "entity.h"
+#include "object.h"
extern void (*MineralWaterSourceActionFuncs[])(Entity*);
@@ -12,8 +11,6 @@ typedef struct {
extern UnkStruct_MineralWater MineralWaterSourceParameters[];
-extern bool32 AllocMutableHitbox(Entity*);
-
void MineralWaterSource(Entity* this) {
MineralWaterSourceActionFuncs[this->action](this);
}
@@ -21,7 +18,7 @@ void MineralWaterSource(Entity* this) {
void MineralWaterSource_Init(Entity* this) {
UnkStruct_MineralWater* unknownParameters;
- if (!AllocMutableHitbox(this)) {
+ if (AllocMutableHitbox(this) == NULL) {
return;
}
diff --git a/src/object/object15.c b/src/object/object15.c
index 25bfe1f5..43b03d0b 100644
--- a/src/object/object15.c
+++ b/src/object/object15.c
@@ -34,7 +34,7 @@ void Object15_Action1(Entity* this) {
DeleteThisEntity();
}
} else {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/object/object1E.c b/src/object/object1E.c
index 48991a92..1356bdd0 100644
--- a/src/object/object1E.c
+++ b/src/object/object1E.c
@@ -72,7 +72,7 @@ END_NONMATCH
void sub_080875F4(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
if (this->type2 != 0) {
diff --git a/src/object/object20.c b/src/object/object20.c
index 1cfb4c2c..9474f662 100644
--- a/src/object/object20.c
+++ b/src/object/object20.c
@@ -48,7 +48,7 @@ void sub_08087824(Entity* this) {
void sub_08087888(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
} else {
if (this->frame < 5) {
diff --git a/src/object/object21.c b/src/object/object21.c
index 6641b14c..f25e1a50 100644
--- a/src/object/object21.c
+++ b/src/object/object21.c
@@ -38,7 +38,7 @@ void Object21(Object21Entity* this) {
} else {
if (super->animIndex == 0xa) {
InitializeAnimation(super, 0xd);
- } else if ((super->frame & 0x80) != 0) {
+ } else if ((super->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/object/object2B.c b/src/object/object2B.c
index 747bf241..efd23de9 100644
--- a/src/object/object2B.c
+++ b/src/object/object2B.c
@@ -17,6 +17,6 @@ void Object2B(Entity* object) {
DeleteThisEntity();
} else {
int position = 0x120 - parent->z.HALF.HI;
- sub_0805EC9C(object, position, position, parent->field_0x7c.HALF_U.HI);
+ SetAffineInfo(object, position, position, parent->field_0x7c.HALF_U.HI);
}
}
diff --git a/src/object/object36.c b/src/object/object36.c
index 83150e0f..94dae2b3 100644
--- a/src/object/object36.c
+++ b/src/object/object36.c
@@ -69,7 +69,7 @@ void sub_0808BBE0(Object36Entity* this) {
diff /= 0x10;
super->spriteOffsetY = gUnk_08121474[diff];
ptr = &gUnk_0812144C[diff * 2];
- sub_0805EC9C(super, ptr[0], ptr[1], 0);
+ SetAffineInfo(super, ptr[0], ptr[1], 0);
} else {
super->bitfield &= 0x7f;
}
@@ -119,7 +119,7 @@ void sub_0808BD14(Object36Entity* this) {
if (super->field_0xf != 0) {
super->field_0xf -= 8;
- sub_0805EC9C(super, 0x200 - super->field_0xf, 0x200 - super->field_0xf, 0);
+ SetAffineInfo(super, 0x200 - super->field_0xf, 0x200 - super->field_0xf, 0);
}
if (super->bitfield == 0x93) {
super->direction = GetFacingDirection(super, &gPlayerEntity);
diff --git a/src/object/object3D.c b/src/object/object3D.c
index 0416ac2c..05514818 100644
--- a/src/object/object3D.c
+++ b/src/object/object3D.c
@@ -74,7 +74,7 @@ void Object3D_Action1(Object3DEntity* this) {
super->actionDelay = 0x1e;
super->field_0xf = 0xff;
super->spriteRendering.b0 = 3;
- sub_0805EC9C(super, 0x100, 0x100, 0);
+ SetAffineInfo(super, 0x100, 0x100, 0);
gArea.field_0x10 = 1;
SetFade(5, 8);
}
@@ -108,7 +108,7 @@ void Object3D_Action2(Object3DEntity* this) {
if (0x80 < super->field_0xf) {
super->field_0xf -= 8;
}
- sub_0805EC9C(super, super->field_0xf, super->field_0xf, 0);
+ SetAffineInfo(super, super->field_0xf, super->field_0xf, 0);
} else {
gArea.filler3[0]++;
gArea.field_0x10 = 0;
diff --git a/src/object/object3E.c b/src/object/object3E.c
index 672c428e..c950452e 100644
--- a/src/object/object3E.c
+++ b/src/object/object3E.c
@@ -191,7 +191,7 @@ void Object3E_Type7(Object3EEntity* this) {
super->spritePriority.b0 = 7;
super->spriteRendering.alphaBlend = 1;
super->frameIndex = super->type2;
- sub_0805EC9C(super, (1 - super->type2) * 0x200 + 0x100, 0xffffff40, 0);
+ SetAffineInfo(super, (1 - super->type2) * 0x200 + 0x100, 0xffffff40, 0);
}
}
diff --git a/src/object/object43.c b/src/object/object43.c
index fdf67abc..b8d9edea 100644
--- a/src/object/object43.c
+++ b/src/object/object43.c
@@ -197,7 +197,7 @@ void Object43_Action3(Object43Entity* this) {
void Object43_Action4(Object43Entity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/object/object44.c b/src/object/object44.c
index 0753c7f4..b73c0bca 100644
--- a/src/object/object44.c
+++ b/src/object/object44.c
@@ -51,7 +51,7 @@ void sub_0808E298(Entity* this) {
void sub_0808E318(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
sub_0808E354(this, 0x343);
DeleteThisEntity();
} else {
diff --git a/src/object/object49.c b/src/object/object49.c
index aaecd05b..1b74b298 100644
--- a/src/object/object49.c
+++ b/src/object/object49.c
@@ -111,7 +111,7 @@ void sub_0808F244(Entity* this) {
}
static void sub_0808F2B0(Entity* this) {
- sub_0805EC9C(this, *(u32*)&this->field_0x74, *(u32*)&this->field_0x78, this->field_0x70.WORD);
+ SetAffineInfo(this, *(u32*)&this->field_0x74, *(u32*)&this->field_0x78, this->field_0x70.WORD);
}
void sub_0808F2C0(Entity* this) {
diff --git a/src/object/object4B.c b/src/object/object4B.c
index 7e76e856..b7dbc6ab 100644
--- a/src/object/object4B.c
+++ b/src/object/object4B.c
@@ -48,7 +48,7 @@ void Object4B_Action1(Object4BEntity* this) {
void Object4B_Action2(Object4BEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action++;
super->spritePriority.b1 = 3;
InitializeAnimation(super, 2);
@@ -80,12 +80,12 @@ void Object4B_Action4(Object4BEntity* this) {
}
if ((super->y.HALF.HI - gRoomControls.origin_y) < 0x231) {
super->y.HALF.HI = gRoomControls.origin_y + 0x230;
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action++;
super->actionDelay = 0x78;
InitializeAnimation(super, 2);
}
- } else if ((super->frame & 0x80) != 0) {
+ } else if ((super->frame & ANIM_DONE) != 0) {
super->zVelocity = 0x20000;
InitializeAnimation(super, 3);
SoundReq(SFX_12B);
@@ -102,7 +102,7 @@ void Object4B_Action5(Object4BEntity* this) {
void Object4B_Action6(Object4BEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action++;
super->actionDelay = 0x3c;
InitializeAnimation(super, 1);
diff --git a/src/object/object61.c b/src/object/object61.c
index 4c72c0d9..5756afdd 100644
--- a/src/object/object61.c
+++ b/src/object/object61.c
@@ -124,7 +124,7 @@ void Object61_Action1Type0(Object61Entity* this) {
super->spriteOrientation.flipY = gPlayerEntity.spriteOrientation.flipY;
super->spriteRendering.b3 = gPlayerEntity.spriteRendering.b3;
sub_0806FCF4(super, this->unk_72, 10, 2);
- sub_0805EC9C(super, this->unk_6e, this->unk_72, 0);
+ SetAffineInfo(super, this->unk_6e, this->unk_72, 0);
sub_0806FEBC(&gPlayerEntity, 1, super);
}
diff --git a/src/object/object64.c b/src/object/object64.c
index a536c556..d1d6f62e 100644
--- a/src/object/object64.c
+++ b/src/object/object64.c
@@ -67,7 +67,7 @@ void sub_08093EAC(Object64Entity* this) {
void sub_08093ED0(Object64Entity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
DeleteEntity(super);
}
}
@@ -80,7 +80,7 @@ void sub_08093EF0(Object64Entity* this) {
return;
}
GetNextFrame(super);
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
return;
}
object = CreateObject(OBJECT_64, 1, 0);
@@ -100,7 +100,7 @@ void sub_08093EF0(Object64Entity* this) {
CopyPosition(super, object);
}
}
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
return;
}
if (super->parent == &gPlayerEntity) {
@@ -111,7 +111,7 @@ void sub_08093EF0(Object64Entity* this) {
break;
case 2:
GetNextFrame(super);
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
return;
}
DeleteThisEntity();
diff --git a/src/object/object66.c b/src/object/object66.c
index 02f31e6c..bd82c084 100644
--- a/src/object/object66.c
+++ b/src/object/object66.c
@@ -27,7 +27,7 @@ void Object66(Entity* this) {
iVar2 = 0x100 - 2 * (parent->z.HALF.HI + 0x40);
iVar4 = 0x200 - 4 * (parent->z.HALF.HI + 0x40);
}
- sub_0805EC9C(this, iVar2, iVar4, 0);
+ SetAffineInfo(this, iVar2, iVar4, 0);
} else {
DeleteThisEntity();
}
diff --git a/src/object/object67.c b/src/object/object67.c
index 05218223..f36636f8 100644
--- a/src/object/object67.c
+++ b/src/object/object67.c
@@ -27,8 +27,6 @@ void sub_08094570(Object67Entity*);
void sub_08094660(Object67Entity*);
void sub_08094708(Object67Entity*, u32, u32);
-extern bool32 AllocMutableHitbox(Entity*);
-
void Object67(Entity* this) {
static void (*const actionFuncs[])(Object67Entity*) = {
sub_08094148, sub_08094398, sub_08094424, sub_08094540, sub_08094570,
@@ -135,7 +133,7 @@ void sub_08094148(Object67Entity* this) {
this->unk84.HALF.HI = 0x100;
}
- if (AllocMutableHitbox(super)) {
+ if (AllocMutableHitbox(super) != NULL) {
super->hitbox->offset_x = gUnk_080FD2E8.offset_x;
super->hitbox->offset_y = gUnk_080FD2E8.offset_y;
super->hitbox->unk2[0] = gUnk_080FD2E8.unk2[0];
@@ -181,7 +179,7 @@ void sub_08094398(Object67Entity* this) {
this->unk7c = 600;
super->action = 2;
}
- sub_0805EC9C(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
+ SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
} else {
if ((((GenericEntity*)super->child)->field_0x78.HALF.HI & 0x80) == 0) {
DeleteThisEntity();
@@ -224,7 +222,7 @@ void sub_08094424(Object67Entity* this) {
} else {
sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->actionDelay);
sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->field_0xf);
- sub_0805EC9C(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
+ SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
}
if (super->hitbox != NULL) {
@@ -241,7 +239,7 @@ void sub_08094540(Object67Entity* this) {
super->action = 4;
this->unk7c = 2;
}
- sub_0805EC9C(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
+ SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
}
void sub_08094570(Object67Entity* this) {
@@ -275,7 +273,7 @@ void sub_08094570(Object67Entity* this) {
}
sub_0806FCF4(super, this->unk80.HALF.HI, 0x20, super->actionDelay);
sub_0806FCF4(super, this->unk84.HALF.HI, 0x20, super->field_0xf);
- sub_0805EC9C(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
+ SetAffineInfo(super, this->unk80.HALF_U.HI, this->unk84.HALF_U.HI, 0);
}
if (super->hitbox != NULL) {
diff --git a/src/object/object6A.c b/src/object/object6A.c
index 9ae71669..79670b5a 100644
--- a/src/object/object6A.c
+++ b/src/object/object6A.c
@@ -327,7 +327,7 @@ void sub_08094E30(Object6AEntity* this) {
super->zVelocity = 0;
SetDefaultPriority(super, PRIO_PLAYER_EVENT);
InitializeAnimation(super, 0);
- if (sub_080B1AA8(super) == 13) {
+ if (GetTileUnderEntity(super) == 13) {
super->action = 3;
}
break;
@@ -344,7 +344,7 @@ void sub_08094E30(Object6AEntity* this) {
break;
case 2:
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
DeleteThisEntity();
}
break;
@@ -548,9 +548,9 @@ void sub_08095288(Object6AEntity* this) {
if (super->subAction != 0) {
if ((u32)sub_080044EC(super, 0x1800) <= 1) {
super->subAction = 0;
- sub_0805EC9C(super, 0x100, 0x100, 0xC000);
+ SetAffineInfo(super, 0x100, 0x100, 0xC000);
} else {
- sub_0805EC9C(super, 0x100, 0x100, super->actionDelay << 8);
+ SetAffineInfo(super, 0x100, 0x100, super->actionDelay << 8);
super->actionDelay += 10;
LinearMoveUpdate(super);
}
@@ -770,7 +770,7 @@ void sub_0809577C(Object6AEntity* this) {
InitializeAnimation(super, 1);
}
GetNextFrame(super);
- if (super->frame & 0x80)
+ if (super->frame & ANIM_DONE)
DeleteThisEntity();
}
@@ -951,7 +951,7 @@ void sub_08095B48(Object6AEntity* this) {
p = super->parent;
if (p != NULL) {
if ((p->frame & 0x40) == 0) {
- if (p->frame & 0x80) {
+ if (p->frame & ANIM_DONE) {
DeleteThisEntity();
return;
}
diff --git a/src/object/object86.c b/src/object/object86.c
index 57151a05..bdaa2811 100644
--- a/src/object/object86.c
+++ b/src/object/object86.c
@@ -31,7 +31,7 @@ void sub_08099E10(Entity* this) {
this->frame = 0;
sub_08099ECC(this);
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 2;
InitializeAnimation(this, 1);
}
@@ -40,7 +40,7 @@ void sub_08099E10(Entity* this) {
void sub_08099E58(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->frame &= ~0x80;
this->actionDelay++;
if (this->actionDelay == 3) {
@@ -70,5 +70,5 @@ void sub_08099ECC(Entity* this) {
CopyPosition(this, &gPlayerEntity);
gPlayerState.queued_action = PLAYER_FALL;
gPlayerState.field_0x38 = 0;
- gPlayerState.flags |= PL_FLAGS8000;
+ gPlayerState.flags |= PL_PIT_IS_EXIT;
}
diff --git a/src/object/object9B.c b/src/object/object9B.c
index 1f88aefa..82b7eebf 100644
--- a/src/object/object9B.c
+++ b/src/object/object9B.c
@@ -25,7 +25,7 @@ void sub_0809E7C0(Entity* this) {
void sub_0809E7E0(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteThisEntity();
}
}
diff --git a/src/object/objectA2.c b/src/object/objectA2.c
index e529794c..8091c484 100644
--- a/src/object/objectA2.c
+++ b/src/object/objectA2.c
@@ -74,7 +74,7 @@ void sub_0809F374(Entity* this) {
}
void sub_0809F3E8(Entity* this) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->action = 3;
InitializeAnimation(this, 2);
}
diff --git a/src/object/objectAF.c b/src/object/objectAF.c
index 8aa2c9ed..cd7ebe6a 100644
--- a/src/object/objectAF.c
+++ b/src/object/objectAF.c
@@ -40,7 +40,7 @@ void sub_080A05F4(Entity* this) {
void sub_080A0624(Entity* this) {
GetNextFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteThisEntity();
}
}
diff --git a/src/object/objectB3.c b/src/object/objectB3.c
index 770d4e27..de0313ee 100644
--- a/src/object/objectB3.c
+++ b/src/object/objectB3.c
@@ -75,7 +75,7 @@ void sub_080A0AF0(Entity* this) {
ExecuteScriptForEntity(this, NULL);
GetNextFrame(this);
if (this->animIndex == 5) {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/object/objectC1.c b/src/object/objectC1.c
index 780c1c78..ed045a6d 100644
--- a/src/object/objectC1.c
+++ b/src/object/objectC1.c
@@ -101,7 +101,7 @@ void ObjectC1_Action8(ObjectC1Entity* this) {
if ((gMessage.doTextBox & 0x7f) != 0) {
return;
}
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->action = 1;
gPlayerEntity.flags = this->unk_69;
gPlayerEntity.spriteSettings.draw = this->unk_68;
diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c
index 5582f707..0433a93d 100644
--- a/src/object/objectOnPillar.c
+++ b/src/object/objectOnPillar.c
@@ -99,7 +99,7 @@ void ObjectOnPillar_Action1(ObjectOnPillarEntity* this) {
if (sub_08097008(this)) {
super->action = 3;
} else {
- sub_08078930(super);
+ RegisterCarryEntity(super);
}
}
}
@@ -211,7 +211,7 @@ void sub_080970F4(ObjectOnPillarEntity* this) {
bool32 sub_08097144(ObjectOnPillarEntity* this) {
LinearMoveUpdate(super);
sub_0800445C(super);
- if (sub_080B1AA8(super) == 0x19) {
+ if (GetTileUnderEntity(super) == 0x19) {
super->spriteOffsetY = 2;
}
if ((--this->unk_76 == 0) && sub_08097194(this) == FALSE) {
diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c
index e986348f..faba73b0 100644
--- a/src/object/objectOnSpinyBeetle.c
+++ b/src/object/objectOnSpinyBeetle.c
@@ -120,7 +120,7 @@ void ObjectOnSpinyBeetle_Action1(ObjectOnSpinyBeetleEntity* this) {
}
} else {
sub_08098918(this);
- sub_08078930(super);
+ RegisterCarryEntity(super);
}
} else {
sub_080989C0(this);
diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c
index ef2f279a..f1fbb022 100644
--- a/src/object/octorokBossObject.c
+++ b/src/object/octorokBossObject.c
@@ -111,7 +111,7 @@ void OctorokBossObject_Init(Entity* this) {
((-(u32)this->parent->field_0x7a.HALF.HI << 0x18) >> 0x18) +
(u32)gUnk_0812388C[(u32)this->type2 * 2 + 1],
(u32)gUnk_0812388C[(u32)this->type2 * 2]);
- sub_0805EC9C(this, this->field_0x76.HWORD, this->field_0x74.HWORD, this->field_0x7a.HWORD);
+ SetAffineInfo(this, this->field_0x76.HWORD, this->field_0x74.HWORD, this->field_0x7a.HWORD);
InitializeAnimation(this, 7);
break;
case 7:
@@ -239,8 +239,8 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc",
this->field_0x76.HWORD -= 0x20;
this->field_0x74.HWORD -= 0x20;
}
- sub_0805EC9C(this, (u32)this->field_0x76.HWORD, (u32)(u16)this->field_0x74.HWORD,
- (u32)(u16)this->field_0x7a.HWORD);
+ SetAffineInfo(this, (u32)this->field_0x76.HWORD, (u32)(u16)this->field_0x74.HWORD,
+ (u32)(u16)this->field_0x7a.HWORD);
} else {
*(int*)&this->field_0x78 -= 1;
}
diff --git a/src/object/playerClone.c b/src/object/playerClone.c
index eee252ae..b8a94abc 100644
--- a/src/object/playerClone.c
+++ b/src/object/playerClone.c
@@ -98,7 +98,7 @@ void PlayerClone_Action2(PlayerCloneEntity* this) {
if (gPlayerEntity.iframes >= 1) {
gPlayerState.chargeState.action = 1;
} else {
- sub_080B1AA8(super);
+ GetTileUnderEntity(super);
sub_08084B1C(this);
super->x.HALF.HI = gPlayerEntity.x.HALF.HI + this->unk78;
super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->unk7a;
diff --git a/src/object/pot.c b/src/object/pot.c
index 239d0732..22ee8ce0 100644
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -16,7 +16,7 @@ extern void (*const gUnk_0811F090[])(Entity*);
extern void (*const gUnk_0811F0A8[])(Entity*);
extern void (*const gUnk_0811F0C4[])(Entity*);
-extern void sub_08078930(Entity*);
+extern void RegisterCarryEntity(Entity*);
extern void sub_08016A6C(Entity*);
void Pot(Entity* this) {
@@ -94,7 +94,7 @@ void sub_08082310(Entity* this) {
DeleteThisEntity();
break;
default:
- if (sub_080B1AA8(this) == 13) {
+ if (GetTileUnderEntity(this) == 13) {
CreateFx(this, FX_FALL_DOWN, 0);
} else if (tileType == 0x4005) {
gPlayerState.field_0xab = 4;
@@ -104,7 +104,7 @@ void sub_08082310(Entity* this) {
break;
}
} else {
- sub_08078930(this);
+ RegisterCarryEntity(this);
}
break;
}
@@ -194,7 +194,7 @@ void sub_08082614(Entity* this) {
break;
default:
SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer);
- sub_08078930(this);
+ RegisterCarryEntity(this);
break;
}
}
diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c
index 35088834..98b62c82 100644
--- a/src/object/pullableLever.c
+++ b/src/object/pullableLever.c
@@ -92,7 +92,7 @@ void PullableLever_HandleInit(PullableLeverEntity* this) {
}
void PullableLever_HandleAction1(PullableLeverEntity* this) {
- sub_08078930(super);
+ RegisterCarryEntity(super);
if (this->pullLength != 0) {
super->direction = super->type2 << 3;
LinearMoveUpdate(super);
diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c
index ff7bff42..0c0e5796 100644
--- a/src/object/pullableMushroom.c
+++ b/src/object/pullableMushroom.c
@@ -162,7 +162,7 @@ void sub_0808ACEC(PullableMushroomEntity* this) {
default:
super->field_0xf = 0;
super->actionDelay = 0;
- sub_08078930(super);
+ RegisterCarryEntity(super);
break;
}
}
@@ -171,7 +171,7 @@ void sub_0808ADA0(PullableMushroomEntity* this) {
if ((sub_0808B1F0(this, super->child) < 8) || (super->child == NULL)) {
super->subAction += 1;
super->actionDelay = 2;
- super->flags |= 0x80;
+ super->flags |= ENT_COLLIDE;
super->animationState ^= 2;
super->spritePriority.b0 = 4;
} else {
@@ -182,9 +182,9 @@ void sub_0808ADA0(PullableMushroomEntity* this) {
void sub_0808ADF0(PullableMushroomEntity* this) {
if (super->animationState + 0xd == super->animIndex) {
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
super->subAction = 0;
- super->flags |= 0x80;
+ super->flags |= ENT_COLLIDE;
} else {
GetNextFrame(super);
}
@@ -199,7 +199,7 @@ void sub_0808ADF0(PullableMushroomEntity* this) {
SoundReq(SFX_12E);
} else {
GetNextFrame(super);
- if (((super->frame & 0x80) != 0) && (--super->actionDelay == 0xff)) {
+ if (((super->frame & ANIM_DONE) != 0) && (--super->actionDelay == 0xff)) {
InitializeAnimation(super, super->animationState + 0xd);
}
}
@@ -245,7 +245,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
} else {
super->actionDelay = 1;
this->unk_7c = 1;
- super->animationState = gPlayerEntity.animationState >> 1 ^ 2;
+ super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
super->direction = (super->animationState << 3);
super->flags &= 0x7f;
super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
@@ -264,7 +264,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) {
void sub_0808AFD4(PullableMushroomEntity* this) {
super->action = 1;
super->subAction = 1;
- (super->child)->direction = super->direction ^ 0x10;
+ (super->child)->direction = DirectionTurnAround(super->direction);
SoundReq(SFX_130);
}
@@ -278,9 +278,9 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) {
if ((((gPlayerState.field_0x1c & 0xf) != 1) || ((super->bitfield & 0x7f) != 0x13)) && (super->type == 1)) {
(super->parent)->action = 1;
(super->parent)->subAction = 1;
- super->direction = super->parent->direction ^ 0x10;
- super->parent->flags &= 0x7f;
- super->flags &= 0x7f;
+ super->direction = DirectionTurnAround(super->parent->direction);
+ super->parent->flags &= ~ENT_COLLIDE;
+ super->flags &= ~ENT_COLLIDE;
super->action = 1;
SoundReq(SFX_130);
}
@@ -288,7 +288,7 @@ void PullableMushroom_Action3(PullableMushroomEntity* this) {
void sub_0808B05C(PullableMushroomEntity* this) {
if (super->type == 0) {
- super->animationState = gPlayerEntity.animationState >> 1 ^ 2;
+ super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1);
super->direction = super->animationState << 3;
super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
super->flags &= 0x7f;
@@ -346,7 +346,7 @@ void sub_0808B168(PullableMushroomEntity* this, u32 param_2) {
Entity* pEVar6;
if (param_2 != 0) {
- iVar2 = (super->animationState ^ 2) * 2;
+ iVar2 = AnimationStateFlip90(super->animationState) * 2;
pcVar5 = (gUnk_081211F4 + iVar2);
pcVar3 = pcVar5 + 1;
pEVar5 = super->parent;
@@ -356,11 +356,11 @@ void sub_0808B168(PullableMushroomEntity* this, u32 param_2) {
pEVar6 = &gPlayerEntity;
pEVar5 = super->parent;
pcVar5 = (gUnk_081211FC + super->animationState * 2);
- pcVar3 = (gUnk_081211F4 + 1 + (super->animationState ^ 2) * 2);
+ pcVar3 = (gUnk_081211F4 + 1 + AnimationStateFlip90(super->animationState) * 2);
} else {
pEVar6 = super->parent;
pEVar5 = &gPlayerEntity;
- pcVar5 = (gUnk_081211F4 + (super->animationState ^ 2) * 2);
+ pcVar5 = (gUnk_081211F4 + AnimationStateFlip90(super->animationState) * 2);
pcVar3 = (gUnk_081211FC + 1 + super->animationState * 2);
}
}
diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c
index 503f75d2..c546d23e 100644
--- a/src/object/pushableLever.c
+++ b/src/object/pushableLever.c
@@ -69,7 +69,7 @@ void PushableLever_Idle(PushableLeverEntity* this) {
void PushableLever_Pushing(PushableLeverEntity* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) != 0) {
+ if ((super->frame & ANIM_DONE) != 0) {
if (super->type2 == 0) {
SetFlag(this->pushedFlag);
} else {
diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c
index 75a9733e..20c84f43 100644
--- a/src/object/pushableRock.c
+++ b/src/object/pushableRock.c
@@ -75,13 +75,13 @@ void PushableRock_Action2(PushableRockEntity* this) {
super->speed = PushableRock_Speeds[super->frame & 0xf];
LinearMoveUpdate(super);
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
super->action = 0;
}
}
void PushableRock_Action3(PushableRockEntity* this) {
- if ((super->frame & 0x80) == 0) {
+ if ((super->frame & ANIM_DONE) == 0) {
GetNextFrame(super);
} else {
super->spritePriority.b0 = 7;
diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c
index c47ebfba..fd8de005 100644
--- a/src/object/pushableStatue.c
+++ b/src/object/pushableStatue.c
@@ -83,7 +83,7 @@ void PushableStatue_Action1(PushableStatueEntity* this) {
break;
}
} else {
- sub_08078930(super);
+ RegisterCarryEntity(super);
}
}
}
diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c
index 3ffedb89..11994ed5 100644
--- a/src/object/smallIceBlock.c
+++ b/src/object/smallIceBlock.c
@@ -137,7 +137,7 @@ void SmallIceBlock_Action3(SmallIceBlockEntity* this) {
} else {
super->actionDelay++;
}
- sub_0805EC9C(super, 0x100, gUnk_08123748[super->actionDelay >> 5], 0);
+ SetAffineInfo(super, 0x100, gUnk_08123748[super->actionDelay >> 5], 0);
if (super->type == 1) {
CreateGroundItemWithFlags(super, ITEM_SMALL_KEY, 0, this->unk_86);
SoundReq(SFX_SECRET);
@@ -162,7 +162,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
if (super->actionDelay == 0x30) {
SetTile(this->unk_6c, this->unk_70, super->collisionLayer);
}
- sub_0805EC9C(super, 0x100, (0x3c - super->actionDelay) * 0x20 + 0x100, 0);
+ SetAffineInfo(super, 0x100, (0x3c - super->actionDelay) * 0x20 + 0x100, 0);
if ((super->actionDelay & 1) != 0) {
obj = CreateObject(SPECIAL_FX, 0x11, 0x40);
if (obj != NULL) {
diff --git a/src/object/smoke.c b/src/object/smoke.c
index 7fed0867..4ce9b8c4 100644
--- a/src/object/smoke.c
+++ b/src/object/smoke.c
@@ -44,7 +44,7 @@ void sub_0808A484(Entity* this) {
void sub_0808A4D0(Entity* this) {
GetNextFrame(this);
LinearMoveUpdate(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
DeleteEntity(this);
}
}
diff --git a/src/object/specialFx.c b/src/object/specialFx.c
index dcd3a25a..c5262d9c 100644
--- a/src/object/specialFx.c
+++ b/src/object/specialFx.c
@@ -187,7 +187,7 @@ void sub_080845B8(SpecialFxObject* this) {
void sub_080845DC(SpecialFxObject* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
DeleteThisEntity();
}
}
@@ -202,7 +202,7 @@ void sub_080845F8(SpecialFxObject* this) {
void sub_08084630(SpecialFxObject* this) {
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
if ((super->type2 & 1) && (super->child != 0)) {
((GenericEntity*)super->child)->field_0x6a.HWORD--;
if (this->unk_68 != 0) {
@@ -254,7 +254,7 @@ void sub_080846B0(SpecialFxObject* this) {
void sub_0808471C(SpecialFxObject* this) {
static const s8 gUnk_0811FB08[] = { -8, -8, 8, -8, -8, 8, 8, 8 };
GetNextFrame(super);
- if (super->frame & 0x80) {
+ if (super->frame & ANIM_DONE) {
u32 i;
for (i = 0; i < 4; i++) {
Entity* fx = CreateFx(super, 0x24, 0);
@@ -280,7 +280,7 @@ void sub_08084784(SpecialFxObject* this) {
void sub_08084798(SpecialFxObject* this) {
GetNextFrame(super);
- if ((super->frame & 0x80) || !super->child->next) {
+ if ((super->frame & ANIM_DONE) || !super->child->next) {
DeleteThisEntity();
}
}
diff --git a/src/player.c b/src/player.c
index f209e891..60257988 100644
--- a/src/player.c
+++ b/src/player.c
@@ -653,12 +653,14 @@ static void PlayerFallInit(Entity* this) {
static void PlayerFallUpdate(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
- if ((gSave.stats.health != 0) && (gPlayerState.flags & PL_FLAGS8000)) {
+ if (this->frame & ANIM_DONE) {
+ if ((gSave.stats.health != 0) && (gPlayerState.flags & PL_PIT_IS_EXIT)) {
+ // pit leads to another room
gPlayerState.flags &= ~(PL_BUSY | PL_DROWNING);
this->spriteSettings.draw = 0;
} else {
- gPlayerState.flags &= ~(PL_DROWNING | PL_FLAGS8000);
+ // stay in this room
+ gPlayerState.flags &= ~(PL_DROWNING | PL_PIT_IS_EXIT);
RespawnPlayer();
gPlayerState.field_0xa = 0;
this->iframes = 32;
@@ -850,7 +852,7 @@ static void sub_08071038(Entity* this) {
if (RunQueuedAction() || (gMessage.doTextBox & 0x7f))
return;
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->child = NULL;
this->knockbackDuration = 0;
this->iframes = 248;
@@ -1016,7 +1018,7 @@ static void sub_080712F0(Entity* this) {
if ((gPlayerState.flags & PL_MINISH) != 0) {
if (--this->actionDelay == 0)
temp = TRUE;
- } else if ((this->frame & 0x80) != 0) {
+ } else if ((this->frame & ANIM_DONE) != 0) {
if (this->animIndex != 0xce)
gPlayerState.animation = 0x2ce;
else
@@ -1167,7 +1169,7 @@ static void PortalShrinkInit(Entity* this) {
this->spriteRendering.b0 = 3;
*(u32*)&this->field_0x80.HWORD = 0x100;
*(u32*)&this->cutsceneBeh = 0x100;
- sub_0805EC9C(this, 0x100, 0x100, 0);
+ SetAffineInfo(this, 0x100, 0x100, 0);
gPlayerState.animation = 0x2c3;
gPlayerState.flags |= PL_MINISH;
SoundReq(SFX_PLY_SHRINKING);
@@ -1244,7 +1246,7 @@ void PortalShrinkUpdate(Entity* this) {
break;
}
- sub_0805EC9C(this, *(u32*)&this->field_0x80, *(u32*)&this->cutsceneBeh, 0);
+ SetAffineInfo(this, *(u32*)&this->field_0x80, *(u32*)&this->cutsceneBeh, 0);
UpdateAnimationSingleFrame(this);
}
@@ -1352,7 +1354,7 @@ static void sub_0807193C(Entity* this) {
Entity* child;
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->subAction++;
child = CreateObjectWithParent(this, EZLO_CAP, 0, 0);
this->child = child;
@@ -1407,7 +1409,7 @@ static void sub_08071990(Entity* this) {
static void sub_08071A4C(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
reset_priority();
sub_0807921C();
}
@@ -1495,6 +1497,7 @@ static void sub_08071B60(Entity* this) {
this->type = 0;
this->knockbackDuration = 0;
PlayerWaitForScroll(this);
+ // Final push?
this->field_0xf = 6;
if ((gPlayerState.flags & PL_MINISH) == 0) {
gPlayerState.animation = 0x104;
@@ -1559,7 +1562,7 @@ static void PlayerMinishDieInit(Entity* this) {
static void sub_08071CAC(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
u32 temp;
if ((gPlayerState.flags & PL_MINISH) == 0)
temp = (gPlayerState.flags & PL_NO_CAP) ? 0x45a : 0x2bd;
@@ -1688,7 +1691,7 @@ static void PlayerEmptyBottleInit(Entity* this) {
Entity* ent;
ResetPlayer();
- ent = CreatePlayerBomb((ItemBehavior*)this, 0xe);
+ ent = CreatePlayerItemWithParent((ItemBehavior*)this, 0xe);
if (ent != NULL) {
ent->field_0x68.HALF.LO = gPlayerState.field_0x38;
this->subAction++;
@@ -1709,7 +1712,7 @@ static void PlayerEmptyBottleInit(Entity* this) {
static void PlayerEmptyBottleUpdate(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
gPlayerState.item = NULL;
sub_0807921C();
}
@@ -1796,7 +1799,7 @@ static void sub_08072098(Entity* this) {
return;
else
;
- else if ((this->frame & 0x80) == 0)
+ else if ((this->frame & ANIM_DONE) == 0)
return;
if (this->health != 0)
@@ -1869,7 +1872,7 @@ static void sub_08072214(Entity* this) {
this->subAction = 1;
this->speed = PULL_SPEED;
this->actionDelay = gPlayerState.field_0x38;
- this->direction = Direction8FromAnimationState(AnimationStateTurnAround(this->animationState));
+ this->direction = Direction8FromAnimationState(AnimationStateFlip180(this->animationState));
if ((gPlayerState.flags & PL_NO_CAP) == 0) {
gPlayerState.animation = 0x34c;
} else {
@@ -2006,7 +2009,7 @@ static void PlayerRoomTransition(Entity* this) {
static void sub_080724DC(Entity* this) {
this->knockbackDuration = 0;
DeleteClones();
- if (sub_080B1AA8(this) != 0x29) {
+ if (GetTileUnderEntity(this) != 0x29) {
if ((gPlayerState.field_0x82[7] == 0) && (gPlayerState.swim_state != 0)) {
sub_0807AE20(this);
}
@@ -2164,10 +2167,10 @@ static void PlayerRollUpdate(Entity* this) {
if (this->frame & 0x40) {
sub_08077698(this);
}
- if ((this->frame & 0x80) || (gPlayerState.field_0x3[1] != 0)) {
+ if ((this->frame & ANIM_DONE) || (gPlayerState.field_0x3[1] != 0)) {
ResetPlayerAnimationAndAction();
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
gPlayerState.flags &= ~(PL_MOLDWORM_RELEASED | PL_ROLLING);
}
UpdateAnimationSingleFrame(this);
@@ -2232,7 +2235,7 @@ static void PlayerInHoleInit(Entity* this) {
}
static void PlayerInHoleUpdate(Entity* this) {
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
if (this->actionDelay == 1) {
this->subAction = 3;
this->actionDelay = 0x28;
@@ -2648,7 +2651,7 @@ static void sub_080731D8(Entity* this) {
static void sub_080732D0(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (sub_080B1AA8(this) != 40) {
+ if (GetTileUnderEntity(this) != 40) {
this->direction = DirectionNorth;
LinearMoveUpdate(this);
} else {
@@ -3043,7 +3046,7 @@ static void sub_080739EC(Entity* this) {
}
void sub_08073A94(Entity* this) {
- if ((this->frame & 0x80) || this->knockbackDuration != 0) {
+ if ((this->frame & ANIM_DONE) || this->knockbackDuration != 0) {
sub_08073B60(this);
}
if (gPlayerEntity.z.WORD != 0) {
@@ -3288,7 +3291,7 @@ static void sub_08074018(Entity* this) {
*(u32*)&this->cutsceneBeh -= 32;
else
this->subAction++;
- sub_0805EC9C(this, *(u32*)&this->field_0x80, *(u32*)&this->cutsceneBeh, 0);
+ SetAffineInfo(this, *(u32*)&this->field_0x80, *(u32*)&this->cutsceneBeh, 0);
UpdateAnimationSingleFrame(this);
}
@@ -3976,7 +3979,7 @@ void sub_08074F8C(Entity* this) {
this->frame = 0;
gActiveScriptInfo.syncFlags |= 4;
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->field_0x68.HALF.LO++;
this->actionDelay = 8;
this->animationState = IdleSouth;
@@ -4064,7 +4067,7 @@ void sub_0807513C(Entity* this) {
SoundReq(SFX_14B);
SoundReq(SFX_PLY_VO6);
}
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->field_0x68.HALF.LO++;
this->actionDelay = 60;
}
@@ -4079,7 +4082,7 @@ void sub_0807518C(Entity* this) {
void sub_080751B4(Entity* this) {
UpdateAnimationSingleFrame(this);
- if (this->frame & 0x80) {
+ if (this->frame & ANIM_DONE) {
this->animationState = IdleSouth;
this->subAction = 1;
this->field_0x68.HALF.LO = 0;
@@ -4130,7 +4133,7 @@ void sub_0807529C(Entity* this) {
void sub_080752AC(Entity* this, ScriptExecutionContext* ctx) {
LinearMoveUpdate(this);
if (!ctx->unk_18) {
- if (sub_080B1AA8(this) != 41) {
+ if (GetTileUnderEntity(this) != 41) {
ctx->unk_18 = 1;
ctx->unk_19 = 6;
}
diff --git a/src/playerItem/playerItem11.c b/src/playerItem/playerItem11.c
index d8f3a3a7..72b5a702 100644
--- a/src/playerItem/playerItem11.c
+++ b/src/playerItem/playerItem11.c
@@ -55,7 +55,7 @@ void sub_08018CBC(Entity* this) {
this->spriteIndex = 0xa6;
this->palette.raw = 0x33;
this->spriteVramOffset = 0;
- this->type = gPlayerState.field_0x1d - 1;
+ this->type = gPlayerState.gustJarSpeed - 1;
this->actionDelay = gUnk_080B3DE0[this->type * 2];
this->damage = gUnk_080B3DE0[this->type * 2 + 1];
this->hurtType = 0x1b;
diff --git a/src/playerItem/playerItem12.c b/src/playerItem/playerItem12.c
index 170c107e..cadb27f0 100644
--- a/src/playerItem/playerItem12.c
+++ b/src/playerItem/playerItem12.c
@@ -109,7 +109,7 @@ void sub_080701F8(Entity* this) {
}
if (sub_080B1BA4(COORD_TO_TILE(this), gPlayerEntity.collisionLayer, 0x80) == 0) {
if (sub_080040D8(this, &gUnk_08003E44, this->x.HALF.HI, this->y.HALF.HI) == 0) {
- if (sub_080B1AA8(this) == 0x19) {
+ if (GetTileUnderEntity(this) == 0x19) {
this->action = 4;
COLLISION_OFF(this);
this->x.HALF.HI = (this->x.HALF.HI & 0xfff0) | 8;
@@ -132,7 +132,7 @@ void sub_080701F8(Entity* this) {
void sub_0807037C(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/playerItem/playerItem3.c b/src/playerItem/playerItem3.c
index 81f89bfc..a461e043 100644
--- a/src/playerItem/playerItem3.c
+++ b/src/playerItem/playerItem3.c
@@ -34,7 +34,7 @@ void PlayerItem3(Entity* this) {
} else {
this->field_0x86.HWORD -= 0x2000;
}
- sub_0805EC9C(this, 0x100, 0x100, this->field_0x86.HWORD);
+ SetAffineInfo(this, 0x100, 0x100, this->field_0x86.HWORD);
}
this->field_0xf--;
diff --git a/src/playerItem/playerItemBomb.c b/src/playerItem/playerItemBomb.c
index c7bdd7cb..93ae9547 100644
--- a/src/playerItem/playerItemBomb.c
+++ b/src/playerItem/playerItemBomb.c
@@ -24,7 +24,7 @@ void PlayerItemBomb(Entity* this) {
this->field_0xf = 0x50;
*(u32*)&this->field_0x68 = 0;
this->spriteRendering.b0 = 3;
- sub_0805EC9C(this, 0x100, 0x100, 0);
+ SetAffineInfo(this, 0x100, 0x100, 0);
}
} else {
if (this->field_0xf != 0) {
@@ -37,7 +37,7 @@ void PlayerItemBomb(Entity* this) {
this->actionDelay = 0x0f;
this->spriteSettings.draw = 0;
sub_0805EC60(this);
- sub_08078954(this);
+ FreeCarryEntity(this);
CreateObjectWithParent(this, 0x20, 0, 0);
sub_0801B418(this);
} else {
diff --git a/src/playerItem/playerItemBottle.c b/src/playerItem/playerItemBottle.c
index 14ee8449..015b6119 100644
--- a/src/playerItem/playerItemBottle.c
+++ b/src/playerItem/playerItemBottle.c
@@ -14,7 +14,6 @@ void PlayerItemBottle_UseOther(Entity*);
void PlayerItemBottle_Init(Entity*);
extern u32 SetBottleContents(u32 itemID, u32 bottleIndex);
-extern bool32 AllocMutableHitbox(Entity*);
extern void sub_0801B9F0(Entity* this);
void PlayerItemBottle(Entity* this) {
@@ -37,7 +36,7 @@ void PlayerItemBottle_Init(Entity* this) {
this->field_0x6e.HALF.HI = bottleType;
switch (bottleType) {
case ITEM_BOTTLE_EMPTY:
- if (AllocMutableHitbox(this) == 0) {
+ if (AllocMutableHitbox(this) == NULL) {
return;
}
COLLISION_ON(this);
diff --git a/src/playerItem/playerItemGustJar.c b/src/playerItem/playerItemGustJar.c
index f5d9e0f0..df29a22e 100644
--- a/src/playerItem/playerItemGustJar.c
+++ b/src/playerItem/playerItemGustJar.c
@@ -41,7 +41,7 @@ void PlayerItemGustJar_Init(Entity* this) {
void PlayerItemGustJar_Action1(Entity* this) {
sub_080ADC84(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 2;
sub_080ADCA0(this, 0);
} else {
@@ -78,7 +78,7 @@ void PlayerItemGustJar_Action2(Entity* this) {
this->frameDuration = 0x7f;
}
- switch (gPlayerState.field_0x1d) {
+ switch (gPlayerState.gustJarSpeed) {
case 3:
sub_080ADCDC(this, 3);
this->palette.b.b0 = 0;
@@ -132,7 +132,7 @@ void PlayerItemGustJar_Action3(Entity* this) {
}
void PlayerItemGustJar_Action4(Entity* this) {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->spriteSettings.draw = 0;
} else {
UpdateAnimationSingleFrame(this);
diff --git a/src/playerItem/playerItemLantern.c b/src/playerItem/playerItemLantern.c
index 00b2f9c6..077fa405 100644
--- a/src/playerItem/playerItemLantern.c
+++ b/src/playerItem/playerItemLantern.c
@@ -4,7 +4,6 @@
extern void (*const gUnk_080FEEA8[])(Entity*);
-extern bool32 AllocMutableHitbox(Entity*);
void sub_08054AC8(Entity*);
void PlayerItemLantern(Entity* this) {
@@ -22,7 +21,7 @@ void sub_08054A60(Entity* this) {
this->field_0x3c = 7;
this->flags2 = -0x80;
this->animationState = gPlayerEntity.animationState & 0xe;
- if (AllocMutableHitbox(this) == FALSE) {
+ if (AllocMutableHitbox(this) == NULL) {
DeleteThisEntity();
}
sub_0801766C(this);
diff --git a/src/playerItem/playerItemPacciCane.c b/src/playerItem/playerItemPacciCane.c
index dc36a6fd..3a1d7540 100644
--- a/src/playerItem/playerItemPacciCane.c
+++ b/src/playerItem/playerItemPacciCane.c
@@ -29,7 +29,7 @@ void PlayerItemPacciCane_Action1(Entity* this) {
u32 playerFrame;
u32 frameIndex;
u32 flipX;
- if (((gPlayerEntity.frame & 0x80) != 0) || (this != gPlayerState.item)) {
+ if (((gPlayerEntity.frame & ANIM_DONE) != 0) || (this != gPlayerState.item)) {
if (this == gPlayerState.item) {
gPlayerState.item = NULL;
}
diff --git a/src/playerUtils.c b/src/playerUtils.c
index b68fef08..3d2cb0e8 100644
--- a/src/playerUtils.c
+++ b/src/playerUtils.c
@@ -17,7 +17,7 @@
extern void sub_080752E8(ItemBehavior* behavior, u32 arg1); // item.c
extern void sub_0800857C(Entity*);
-extern void sub_0805E374(Entity*);
+extern void SetDefaultPriorityForKind(Entity*);
extern void DoPlayerAction(Entity*);
extern Entity* sub_0805E744();
extern void sub_0809D738(Entity*);
@@ -44,7 +44,7 @@ bool32 sub_080778CC();
ItemBehavior* sub_0807794C(u32);
u32 sub_080789A8(void);
ItemBehavior* sub_080779EC(u32);
-void sub_08077E78(ItemBehavior*, u32);
+void DeletePlayerItem(ItemBehavior*, u32);
void sub_08077AEC(void);
bool32 sub_08079E90(u32);
void sub_08079258(void);
@@ -251,7 +251,7 @@ ItemBehavior* sub_08077A48(s32 param_1) {
u32 tmp = gPlayerState.jump_status & 0x20;
if ((((gPlayerState.jump_status & 0x20) == 0)) &&
(gUnk_0811BE48[param_1].unk0[1] >= gUnk_03000B80[0].field_0x5[4])) {
- sub_08077E78(gUnk_03000B80, 0);
+ DeletePlayerItem(gUnk_03000B80, 0);
gPlayerState.field_0x0[1] = tmp;
gPlayerState.field_0x1c = tmp;
gPlayerState.sword_state = tmp;
@@ -288,7 +288,7 @@ ItemBehavior* sub_08077AC8(void) {
void sub_08077AEC(void) {
u32 slot;
- sub_08077E78(gUnk_03000B80 + 3, 3);
+ DeletePlayerItem(gUnk_03000B80 + 3, 3);
gPlayerState.flags &= ~PL_USE_LANTERN;
slot = IsItemEquipped(ITEM_LANTERN_ON);
if (slot != 2) {
@@ -305,7 +305,7 @@ void ResetPlayer() {
u32 index = 0;
ItemBehavior* ptr = gUnk_03000B80;
do {
- sub_08077E78(ptr, index);
+ DeletePlayerItem(ptr, index);
ptr++;
index++;
} while (index <= 2);
@@ -355,7 +355,7 @@ Entity* sub_08077BD4(ItemBehavior* beh) {
if (sub_08077C94(beh, gUnk_0811BE48[beh->behaviorID].unk0[3]) != 0) {
return NULL;
} else {
- return CreatePlayerBomb(beh, gUnk_0811BE48[beh->behaviorID].unk0[3]);
+ return CreatePlayerItemWithParent(beh, gUnk_0811BE48[beh->behaviorID].unk0[3]);
}
}
@@ -368,11 +368,11 @@ Entity* sub_08077C0C(ItemBehavior* beh, u32 arg1) {
if (sub_08077C94(beh, bVar1) != 0) {
return NULL;
} else {
- return CreatePlayerBomb(beh, bVar1);
+ return CreatePlayerItemWithParent(beh, bVar1);
}
}
-Entity* CreatePlayerBomb(ItemBehavior* beh, u32 subtype) {
+Entity* CreatePlayerItemWithParent(ItemBehavior* beh, u32 subtype) {
Entity* pEVar1;
pEVar1 = CreatePlayerItem(subtype, 0, 0, beh->behaviorID);
@@ -512,7 +512,7 @@ void sub_08077E54(ItemBehavior* beh) {
beh->field_0x5[9] = gPlayerEntity.frame;
}
-void sub_08077E78(ItemBehavior* arg0, u32 bits) {
+void DeletePlayerItem(ItemBehavior* arg0, u32 bits) {
u32 not ;
if (bits == 0) {
@@ -569,7 +569,7 @@ bool32 sub_08077F24(ItemBehavior* beh, u32 arg1) {
void sub_08077F50(ItemBehavior* beh, u32 arg1) {
sub_08079184();
- sub_08077E78(beh, arg1);
+ DeletePlayerItem(beh, arg1);
}
u32 sub_08077F64(ItemBehavior* arg0, u32 unk) {
@@ -586,15 +586,17 @@ u32 sub_08077F64(ItemBehavior* arg0, u32 unk) {
void sub_08077F84(void) {
Entity* obj;
- if (((gPlayerEntity.collisionLayer & 2) == 0) &&
- GetTileTypeByPos(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 0xc, 2) - 0x343U < 4) {
- sub_0807AA80(&gPlayerEntity);
- gPlayerState.jump_status |= 8;
- obj = CreateObject(OBJECT_44, 0, 0);
- if (obj != NULL) {
- obj->x = gPlayerEntity.x;
- obj->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0xc;
- gPlayerEntity.y.HALF.HI -= 0xc;
+ if ((gPlayerEntity.collisionLayer & 2) == 0) {
+ u32 tile = GetTileTypeByPos(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 12, 2);
+ if (tile == 0x343 || tile == 0x344 || tile == 0x345 || tile == 0x346) {
+ sub_0807AA80(&gPlayerEntity);
+ gPlayerState.jump_status |= 8;
+ obj = CreateObject(OBJECT_44, 0, 0);
+ if (obj != NULL) {
+ obj->x = gPlayerEntity.x;
+ obj->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0xc;
+ gPlayerEntity.y.HALF.HI -= 0xc;
+ }
}
}
}
@@ -615,11 +617,11 @@ NONMATCH("asm/non_matching/playerUtils/sub_08078008.inc", bool32 sub_08078008(Ch
} else {
swordType = gSave.stats.itemButtons[0];
}
- if (swordType - 1 < 2) {
+ if (swordType == 1 || swordType == 2) {
swordType = 0;
}
if ((swordType != 0) && ((gPlayerState.sword_state & 0x20) != 0)) {
- if (++state->preChargeTimer > 0x14) {
+ if (++state->preChargeTimer > 20) {
state->preChargeTimer = 10;
state->action = 3;
state->swordType = swordType;
@@ -634,7 +636,7 @@ END_NONMATCH
bool32 sub_08078070(ChargeState* state) {
if ((gPlayerState.sword_state & 0x20) != 0) {
if ((gPlayerState.skills & SKILL_FAST_SPLIT) != SKILL_NONE) {
- state->chargeTimer += 0xc;
+ state->chargeTimer += 12;
} else {
state->chargeTimer += 6;
}
@@ -643,7 +645,7 @@ bool32 sub_08078070(ChargeState* state) {
state->action = 4;
SoundReq(SFX_ITEM_SWORD_CHARGE_FINISH);
} else {
- if (Mod(state->chargeTimer, 0x14) == 0) {
+ if (Mod(state->chargeTimer, 20) == 0) {
SoundReq(SFX_ITEM_SWORD_CHARGE);
}
}
@@ -665,7 +667,8 @@ bool32 sub_080780E0(ChargeState* state) {
}
bool32 sub_08078108(ChargeState* state) {
- if (--state->chargeTimer * 0x10000 < 0) {
+ state->chargeTimer -= 1;
+ if (state->chargeTimer < 0) {
state->chargeTimer = 0;
state->action = 2;
}
@@ -673,7 +676,8 @@ bool32 sub_08078108(ChargeState* state) {
}
bool32 sub_08078124(ChargeState* state) {
- if ((state->chargeTimer -= 0x10) * 0x10000 < 0) {
+ state->chargeTimer -= 0x10;
+ if (state->chargeTimer < 0) {
state->chargeTimer = 0;
state->action = 2;
}
@@ -681,7 +685,8 @@ bool32 sub_08078124(ChargeState* state) {
}
bool32 sub_08078140(ChargeState* info) {
- if (--info->preChargeTimer * 0x1000000 < 0) {
+ info->preChargeTimer -= 1;
+ if (info->preChargeTimer < 0) {
info->preChargeTimer = 0;
info->action = 0;
return TRUE;
@@ -819,9 +824,9 @@ s32 sub_08078904(Entity* entity) {
return -1;
}
-ASM_FUNC("asm/non_matching/playerUtils/sub_08078930.inc", void sub_08078930(Entity* a))
+ASM_FUNC("asm/non_matching/playerUtils/RegisterCarryEntity.inc", void RegisterCarryEntity(Entity* a))
-ASM_FUNC("asm/non_matching/playerUtils/sub_08078954.inc", void sub_08078954(Entity* a))
+ASM_FUNC("asm/non_matching/playerUtils/FreeCarryEntity.inc", void FreeCarryEntity(Entity* a))
ASM_FUNC("asm/non_matching/playerUtils/sub_080789A8.inc", u32 sub_080789A8())
@@ -836,7 +841,7 @@ void CreateEzloHint(u32 hintId, u32 hintHeight) {
gRoomTransition.hint_idx = hintId;
#if defined(EU) || defined(JP)
// TODO what fields of the room transition are switched in these variants?
- gRoomTransition.field_0x2c[8] = hintHeight;
+ gRoomTransition.field_0x2c[7] = hintHeight;
#else
gRoomTransition.hint_height = hintHeight;
#endif
@@ -889,7 +894,7 @@ void sub_08078B48(void) {
gPlayerState.field_0x82[8] = 2;
}
-void sub_08078C24(void) {
+void ClearPlayerState(void) {
gPlayerState.field_0x0[0] = 0;
gPlayerState.field_0x0[1] = 0;
gPlayerState.jump_status = 0;
@@ -1080,7 +1085,7 @@ void sub_0807921C(void) {
PL_MOLDWORM_RELEASED | PL_PARACHUTE);
ResolvePlayerAnimation();
SetPlayerActionNormal();
- sub_0805E374(&gPlayerEntity);
+ SetDefaultPriorityForKind(&gPlayerEntity);
}
void sub_08079258(void) {
@@ -1096,7 +1101,7 @@ void sub_08079258(void) {
~(PL_BUSY | PL_DROWNING | PL_DISABLE_ITEMS | PL_IN_HOLE | PL_MOLDWORM_RELEASED | PL_PARACHUTE);
gPlayerState.swim_state = 0;
gPlayerState.queued_action = 0;
- sub_0805E374(&gPlayerEntity);
+ SetDefaultPriorityForKind(&gPlayerEntity);
}
void sub_080792BC(s32 speed, u32 direction, u32 field_0x38) {
@@ -1187,7 +1192,7 @@ bool32 sub_08079D48(void) {
return TRUE;
} else {
if (!sub_08008B22()) {
- if (!sub_08007DD6((u16)sub_080B1AA8(&gPlayerEntity), gUnk_0811C268)) {
+ if (!sub_08007DD6((u16)GetTileUnderEntity(&gPlayerEntity), gUnk_0811C268)) {
return TRUE;
}
}
@@ -1256,7 +1261,7 @@ bool32 sub_08079F48(u32 param_1, u32 param_2) {
bool32 sub_08079F8C(void) {
if ((gPlayerState.flags &
(PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_FROZEN | PL_FALLING | PL_DISABLE_ITEMS |
- PL_FLAGS8000 | PL_IN_MINECART | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_FLAGS2000000 | PL_CLIMBING)) != 0 ||
+ PL_PIT_IS_EXIT | PL_IN_MINECART | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_FLAGS2000000 | PL_CLIMBING)) != 0 ||
gPlayerState.field_0x3c[0] != 0 || gPlayerEntity.action == 3 || gPlayerEntity.action == 0xb) {
return FALSE;
} else {
@@ -2008,15 +2013,15 @@ void sub_0807C810(void) {
}
void CloneMapData(void) {
- gRoomTransition.field_0x2c[1] = 1;
+ gRoomTransition.field_0x2c[0] = 1;
MemCopy(&gMapBottom.mapData, &gMapBottom.mapDataClone, 0x2000);
MemCopy(&gMapTop.mapData, &gMapTop.mapDataClone, 0x2000);
}
void sub_0807C898(void) {
- gRoomTransition.field_0x2c[1] = 2;
+ gRoomTransition.field_0x2c[0] = 2;
LoadRoomGfx();
- gRoomTransition.field_0x2c[1] = 0;
+ gRoomTransition.field_0x2c[0] = 0;
}
ASM_FUNC("asm/non_matching/playerUtils/sub_0807C8B0.inc", void sub_0807C8B0())
diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c
index 785504ed..94eb1e59 100644
--- a/src/projectile/dekuSeedProjectile.c
+++ b/src/projectile/dekuSeedProjectile.c
@@ -100,7 +100,7 @@ void DekuSeedProjectile_Action2(Entity* this) {
void DekuSeedProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c
index 81970ad1..843bdafa 100644
--- a/src/projectile/dirtBallProjectile.c
+++ b/src/projectile/dirtBallProjectile.c
@@ -81,7 +81,7 @@ void DirtBallProjectile_Action1(Entity* this) {
break;
case 1:
this->z.HALF.HI += Q_8_8(1.0 / 16.0 - 1.0 / 128.0);
- sub_08078954(this->child);
+ FreeCarryEntity(this->child);
CopyPosition(this, this->child);
if ((0xf < (u8)(this->actionDelay++ + 1)) && (entity = this->child, entity->actionDelay == 0)) {
if ((this->actionDelay & 2) != 0) {
@@ -117,7 +117,7 @@ void DirtBallProjectile_Action2(Entity* this) {
if (entity->next == NULL) {
DeleteThisEntity();
}
- sub_08078954(entity);
+ FreeCarryEntity(entity);
CopyPosition(this, entity);
}
if (sub_080044EC(this, 0x2800) != 1) {
@@ -159,7 +159,7 @@ void DirtBallProjectile_Action2(Entity* this) {
void DirtBallProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/fireProjectile.c b/src/projectile/fireProjectile.c
index 80fed65b..85c06766 100644
--- a/src/projectile/fireProjectile.c
+++ b/src/projectile/fireProjectile.c
@@ -63,7 +63,7 @@ void FireProjectile_Action2(Entity* this) {
void FireProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c
index 43cf8ae4..8346d260 100644
--- a/src/projectile/gleerokProjectile.c
+++ b/src/projectile/gleerokProjectile.c
@@ -120,7 +120,7 @@ void GleerokProjectile_Action2(Entity* this) {
sub_080A90D8(this);
}
} else {
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 3;
COLLISION_OFF(this);
InitializeAnimation(this, 0x53);
@@ -130,7 +130,7 @@ void GleerokProjectile_Action2(Entity* this) {
void GleerokProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/gyorgMaleEnergyProjectile.c b/src/projectile/gyorgMaleEnergyProjectile.c
index 6a98e185..69c0aa73 100644
--- a/src/projectile/gyorgMaleEnergyProjectile.c
+++ b/src/projectile/gyorgMaleEnergyProjectile.c
@@ -86,7 +86,7 @@ void GyorgMaleEnergyProjectile_Action2(Entity* this) {
void GyorgMaleEnergyProjectile_Action3(Entity* this) {
ProcessMovement3(this);
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/iceProjectile.c b/src/projectile/iceProjectile.c
index 0f845d8e..2b5b6b34 100644
--- a/src/projectile/iceProjectile.c
+++ b/src/projectile/iceProjectile.c
@@ -65,7 +65,7 @@ void IceProjectile_Action2(Entity* this) {
void IceProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c
index f828070b..1bc2c36e 100644
--- a/src/projectile/mandiblesProjectile.c
+++ b/src/projectile/mandiblesProjectile.c
@@ -131,7 +131,7 @@ void MandiblesProjectile_Action3(Entity* this) {
this->field_0xf -= 1;
} else {
UpdateAnimationSingleFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 4;
this->field_0x82.HALF.LO = 3;
this->field_0xf = 0x40;
diff --git a/src/projectile/mazaalEnergyBeam.c b/src/projectile/mazaalEnergyBeam.c
index 6e284ccf..095f8e45 100644
--- a/src/projectile/mazaalEnergyBeam.c
+++ b/src/projectile/mazaalEnergyBeam.c
@@ -40,7 +40,7 @@ void MazaalEnergyBeam_Action1(Entity* this) {
void MazaalEnergyBeam_Action2(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/projectile/moblinSpear.c b/src/projectile/moblinSpear.c
index d2816076..9d84ccbf 100644
--- a/src/projectile/moblinSpear.c
+++ b/src/projectile/moblinSpear.c
@@ -1,7 +1,7 @@
#include "entity.h"
#include "enemy.h"
+#include "coord.h"
-extern bool32 AllocMutableHitbox(Entity*);
typedef struct {
s8 offsetX;
s8 offsetY;
@@ -44,7 +44,7 @@ void sub_080A832C(Entity* this) {
}
void MoblinSpear_Init(Entity* this) {
- if (AllocMutableHitbox(this) != 0) {
+ if (AllocMutableHitbox(this) != NULL) {
this->action = 1;
}
}
diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c
index 9d173880..93951fad 100644
--- a/src/projectile/spiderWeb.c
+++ b/src/projectile/spiderWeb.c
@@ -69,7 +69,7 @@ void sub_080AA78C(Entity* this) {
animationState = (gPlayerEntity.animationState >> 1);
if (animationState != this->type) {
this->field_0x3a &= 0xfb;
- if ((animationState ^ 2) != this->type) {
+ if (AnimationStateFlip90(animationState) != this->type) {
return;
}
this->iframes = 0xe2;
@@ -85,7 +85,7 @@ void sub_080AA78C(Entity* this) {
this->frame &= 0xef;
EnqueueSFX(SFX_100);
}
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
sub_080AAAA8(this);
}
} else {
@@ -111,7 +111,7 @@ void SpiderWeb_Init(Entity* this) {
}
void SpiderWeb_Action1(Entity* this) {
- if ((this->frame & 0x80) == 0) {
+ if ((this->frame & ANIM_DONE) == 0) {
UpdateAnimationSingleFrame(this);
}
sub_080AA9E0(this);
@@ -145,7 +145,7 @@ void SpiderWeb_SubAction0(Entity* this) {
InitAnimationForceUpdate(this, this->type + 4);
}
if ((entity->animationState >> 1 == this->type) && (gPlayerState.framestate == PL_STATE_PULL) &&
- ((gPlayerState.heldObject & 2) != 0) && ((gPlayerEntity.frame & 2) != 0) && ((this->frame & 0x80) == 0)) {
+ ((gPlayerState.heldObject & 2) != 0) && ((gPlayerEntity.frame & 2) != 0) && ((this->frame & ANIM_DONE) == 0)) {
UpdateAnimationSingleFrame(this);
if ((this->frame & 1) != 0) {
entity->x.HALF.HI = gUnk_0812A06C[entity->animationState] + entity->x.HALF.HI;
@@ -195,7 +195,7 @@ void sub_080AA9E0(Entity* this) {
this->spritePriority.b0 = ptr->b0;
this->direction = ptr->direction;
if (ptr->b0 == 5) {
- sub_08078930(this);
+ RegisterCarryEntity(this);
}
}
diff --git a/src/projectile/v1EyeLaser.c b/src/projectile/v1EyeLaser.c
index 2f746396..19966321 100644
--- a/src/projectile/v1EyeLaser.c
+++ b/src/projectile/v1EyeLaser.c
@@ -34,7 +34,7 @@ void V1EyeLaser_Init(Entity* this) {
void V1EyeLaser_Action1(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 2;
InitializeAnimation(this, 1);
sub_080AB758(this);
diff --git a/src/projectile/v1FireProjectile.c b/src/projectile/v1FireProjectile.c
index a441e225..8c2e0729 100644
--- a/src/projectile/v1FireProjectile.c
+++ b/src/projectile/v1FireProjectile.c
@@ -85,7 +85,7 @@ void V1FireProjectile_Action1(Entity* this) {
void V1FireProjectile_Action2(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
this->action = 3;
COLLISION_OFF(this);
InitializeAnimation(this, 0x53);
@@ -94,7 +94,7 @@ void V1FireProjectile_Action2(Entity* this) {
void V1FireProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c
index e329945c..3733945d 100644
--- a/src/projectile/v2Projectile.c
+++ b/src/projectile/v2Projectile.c
@@ -124,7 +124,7 @@ void sub_080ABD70(Entity* this) {
SetTileType(0x6d, this->field_0x74.HWORD, 2);
}
}
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteThisEntity();
}
}
diff --git a/src/projectile/windProjectile.c b/src/projectile/windProjectile.c
index 96211f1b..8232bf91 100644
--- a/src/projectile/windProjectile.c
+++ b/src/projectile/windProjectile.c
@@ -69,7 +69,7 @@ void WindProjectile_Action2(Entity* this) {
void WindProjectile_Action3(Entity* this) {
GetNextFrame(this);
- if ((this->frame & 0x80) != 0) {
+ if ((this->frame & ANIM_DONE) != 0) {
DeleteEntity(this);
}
}
diff --git a/src/script.c b/src/script.c
index f08b600e..a6a4e36c 100644
--- a/src/script.c
+++ b/src/script.c
@@ -1634,8 +1634,8 @@ void EquipItem(Entity* entity, ScriptExecutionContext* context) {
ForceEquipItem(item, slot);
}
-void sub_0807F29C(Entity* entity, ScriptExecutionContext* context) {
- sub_0805ED14((void*)context->intVariable);
+void SetInputMacro(Entity* entity, ScriptExecutionContext* context) {
+ InitPlayerMacro((void*)context->intVariable);
}
void sub_0807F2A8(Entity* entity, ScriptExecutionContext* context) {
@@ -1646,8 +1646,8 @@ void sub_0807F2A8(Entity* entity, ScriptExecutionContext* context) {
}
}
-void WaitForFrameHiBit(Entity* entity, ScriptExecutionContext* context) {
- if ((entity->frame & 0x80) != 0) {
+void WaitForAnimDone(Entity* entity, ScriptExecutionContext* context) {
+ if ((entity->frame & ANIM_DONE) != 0) {
gActiveScriptInfo.flags |= 1;
} else {
gActiveScriptInfo.commandSize = 0;
@@ -1655,7 +1655,7 @@ void WaitForFrameHiBit(Entity* entity, ScriptExecutionContext* context) {
}
void WaitForPlayerFrameHiBit(Entity* entity, ScriptExecutionContext* context) {
- if ((gPlayerEntity.frame & 0x80) != 0) {
+ if ((gPlayerEntity.frame & ANIM_DONE) != 0) {
gActiveScriptInfo.flags |= 1;
} else {
gActiveScriptInfo.commandSize = 0;
diff --git a/src/subtask2.c b/src/subtask2.c
index 2ac69033..47542862 100644
--- a/src/subtask2.c
+++ b/src/subtask2.c
@@ -378,7 +378,7 @@ void Subtask_Init(void) {
ResetPaletteTable(0);
gGFXSlots.unk0 = 1;
gUI.nextToLoad = 2;
- gRoomTransition.field_0x2c[4] = 1;
+ gRoomTransition.field_0x2c[3] = 1;
}
}