diff options
| author | theo3 <arisstephenson2@gmail.com> | 2023-12-30 17:13:42 -0800 |
|---|---|---|
| committer | theo3 <arisstephenson2@gmail.com> | 2023-12-30 17:13:42 -0800 |
| commit | fb9f59fbbbd1ec2db3a3e757a3dab9a0e563520c (patch) | |
| tree | 0c091f4a07d0e8b188db3336eb84ac25064f2618 /src | |
| parent | 37723f560798698a2a17d0b29ee7baca1a8cb1c7 (diff) | |
label BounceUpdate asm
Diffstat (limited to 'src')
51 files changed, 96 insertions, 96 deletions
diff --git a/src/collision.c b/src/collision.c index 7fb08ca4..5fe00c99 100644 --- a/src/collision.c +++ b/src/collision.c @@ -580,7 +580,7 @@ CollisionResult sub_08017F40(Entity* org, Entity* tgt, u32 direction, ColSetting org->health = 0; } } else if (tgt->kind == ENEMY && org == &gPlayerEntity) { - sub_08004484(tgt, org); + CalcCollisionStaticEntity(tgt, org); } return RESULT_NO_COLLISION; } @@ -670,14 +670,14 @@ CollisionResult sub_08018168(Entity* org, Entity* tgt, u32 direction, ColSetting org->health = 0; } } else if ((tgt->kind == ENEMY) && (org == &gPlayerEntity)) { - sub_08004484(tgt, &gPlayerEntity); + CalcCollisionStaticEntity(tgt, &gPlayerEntity); } return RESULT_NO_COLLISION; } CollisionResult sub_08018228(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) { if (org == &gPlayerEntity && PlayerCanBeMoved()) - sub_08004484(tgt, org); + CalcCollisionStaticEntity(tgt, org); return RESULT_NO_COLLISION; } @@ -716,7 +716,7 @@ CollisionResult sub_080182A8(Entity* org, Entity* tgt, u32 direction, ColSetting CollisionResult CollisionDefault(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) { u32 confused = 0; if (tgt->confusedTime && tgt->kind == ENEMY && org == &gPlayerEntity) { - sub_08004484(tgt, org); + CalcCollisionStaticEntity(tgt, org); confused = 1; } if ((org->kind == PLAYER_ITEM && org->id == PL_ITEM_SHIELD) && diff --git a/src/common.c b/src/common.c index 10e200c0..83d194ca 100644 --- a/src/common.c +++ b/src/common.c @@ -216,15 +216,15 @@ static void StoreKeyInput(Input* input, u32 keyInput) { u32 difference = keyInput & ~heldKeys; input->newKeys = difference; if (keyInput == heldKeys) { - if (--input->unk7 == 0) { - input->unk7 = 4; - input->unk4 = keyInput; + if (--input->menuScrollTimer == 0) { + input->menuScrollTimer = 4; + input->menuScrollKeys = keyInput; } else { - input->unk4 = 0; + input->menuScrollKeys = 0; } } else { - input->unk7 = 20; - input->unk4 = difference; + input->menuScrollTimer = 20; + input->menuScrollKeys = difference; } input->heldKeys = keyInput; } diff --git a/src/debug.c b/src/debug.c index 399dcf71..6edbf3ee 100644 --- a/src/debug.c +++ b/src/debug.c @@ -73,7 +73,7 @@ void sub_0805FA98(void) { MessageInitialize(); break; default: - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { case DPAD_LEFT: iVar1 = -1; break; diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index 58457d1d..e80b7eb3 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -509,7 +509,7 @@ void AcroBandit_Type1Action6(Entity* this) { void AcroBandit_Type1Action7(Entity* this) { ProcessMovement2(this); - if (sub_080044EC(this, 0x2000) == 0) + if (BounceUpdate(this, Q_8_8(32.0)) == BOUNCE_DONE_ALL) this->action = 8; } diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index 451d9aea..3fd4457b 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -114,7 +114,7 @@ void sub_080218CC(Entity* this) { GetNextFrame(this); if (this->frame & 1) { ProcessMovement2(this); - if (sub_080044EC(this, 0x1c00) == 0) + if (BounceUpdate(this, Q_8_8(28.0)) == BOUNCE_DONE_ALL) this->frameDuration = 1; } diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index ad7ceff0..234b032e 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -242,7 +242,7 @@ void sub_0802CAF8(Entity* this) { if (--this->timer == 0) { sub_0802CBC4(this); } else { - if (this->field_0x80.HALF.HI && sub_080044EC(this, 0x2800) == 1) { + if (this->field_0x80.HALF.HI && BounceUpdate(this, Q_8_8(40.0)) == BOUNCE_INIT_NEXT) { EnqueueSFX(SFX_PLACE_OBJ); } sub_0802CC18(this); diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index ab856221..79a83a7f 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -462,7 +462,7 @@ void sub_0802AEBC(Entity* this) { void sub_0802AED4(Entity* this) { GetNextFrame(this); if (this->field_0x80.HALF.HI < 2) { - if (sub_080044EC(this, 0x2800) == 1) { + if (BounceUpdate(this, Q_8_8(40.0)) == BOUNCE_INIT_NEXT) { this->field_0x80.HALF.HI++; } } else { @@ -661,7 +661,7 @@ void sub_0802B1BC(Entity* this) { #endif void sub_0802B204(Entity* this) { - if (sub_080044EC(this, 0x2800) == 1) { + if (BounceUpdate(this, Q_8_8(40.0)) == BOUNCE_INIT_NEXT) { Entity* ent = CreateEnemy(BOBOMB, 1); if (ent != NULL) { CopyPosition(this, ent); diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 82de5555..c2c62822 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -704,7 +704,7 @@ void sub_0801FB68(Entity* this) { } u32 sub_0801FBD0(Entity* this) { - if (GetTileUnderEntity(this) == 0x10) { + if (GetActTile(this) == 0x10) { return 1; } else { return 0; diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c index d9ae589f..6e059ed7 100644 --- a/src/enemy/cloudPiranha.c +++ b/src/enemy/cloudPiranha.c @@ -178,7 +178,7 @@ void CloudPiranha_Action3(CloudPiranhaEntity* this) { void CloudPiranha_Action4(CloudPiranhaEntity* this) { Entity* effect; sub_080387F0(this); - if (sub_080044EC(super, 0x1800) == 1) { + if (BounceUpdate(super, Q_8_8(24.0)) == BOUNCE_INIT_NEXT) { super->action = 1; super->hitType = 0x72; super->timer = 1; diff --git a/src/enemy/cuccoAggr.c b/src/enemy/cuccoAggr.c index c14a4464..5bd8cae2 100644 --- a/src/enemy/cuccoAggr.c +++ b/src/enemy/cuccoAggr.c @@ -171,7 +171,7 @@ void sub_08038F44(CuccoAggrEntity* this) { super->direction = GetFacingDirection(&gPlayerEntity, super); sub_080390F8(this); ProcessMovement0(super); - sub_080044EC(super, 0x1800); + BounceUpdate(super, Q_8_8(24.0)); GetNextFrame(super); sub_08039298(this); if (--this->unk_78 == 0) { diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 5f9f5ce2..40666e63 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -81,7 +81,7 @@ void sub_0802C334(Entity* this) { } GetNextFrame(this); this->field_0x7c.HALF.HI = COORD_TO_TILE(this); - if (sub_080044EC(this, *(u32*)&this->cutsceneBeh) == 1) { + if (BounceUpdate(this, *(u32*)&this->cutsceneBeh) == BOUNCE_INIT_NEXT) { EnqueueSFX(0x14c); COLLISION_ON(this); this->field_0x7a.HWORD = 0xc; diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 122ac212..01eb1fab 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -218,7 +218,7 @@ void sub_0802BEBC(Entity* this) { this->direction ^= DirectionSouth; ProcessMovement2(this); this->direction ^= DirectionSouth; - if (!sub_080044EC(this, Q_16_16(0.125))) { + if (BounceUpdate(this, Q_16_16(0.125)) == BOUNCE_DONE_ALL) { sub_0802C1C0(this); } } diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index a6ba87da..18634e49 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -232,7 +232,7 @@ void Peahat_ChargeEnd(Entity* this) { void Peahat_Stunned(Entity* this) { switch (this->animationState) { default: - if (sub_080044EC(this, 0x1800) == 0) { + if (BounceUpdate(this, Q_8_8(24.0)) == BOUNCE_DONE_ALL) { this->action = 6; this->timer = 240; this->subtimer = 10; diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index e064cfeb..c33b7aa4 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -181,16 +181,16 @@ void Rollobite_RolledUp(Entity* this) { if ((this->frame & ANIM_DONE) == 0) GetNextFrame(this); - unk = sub_080044EC(this, 0x2800); + unk = BounceUpdate(this, Q_8_8(40.0)); - if (unk == 0) { + if (unk == BOUNCE_DONE_ALL) { if (--this->timer == 0) { this->action = 5; InitializeAnimation(this, this->animationState + 12); } RegisterCarryEntity(this); } else { - if (unk == 1) + if (unk == BOUNCE_INIT_NEXT) EnqueueSFX(SFX_PLACE_OBJ); if (!(this->direction & DIR_NOT_MOVING_CHECK)) diff --git a/src/enemy/rope.c b/src/enemy/rope.c index 098d4b89..590e0f5f 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -196,7 +196,7 @@ void sub_08031600(Entity* this) { u32 sub_0803163C(Entity* this) { u32 h; - if (GetTileUnderEntity(this) == 0x13) { + if (GetActTile(this) == 0x13) { h = this->field_0x7a.HWORD / 2; } else { h = this->field_0x7a.HWORD; diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index 6cb42502..1508beab 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -153,12 +153,12 @@ void sub_0802B880(Entity* this) { void sub_0802B8B0(Entity* this) { ProcessMovement2(this); - switch (sub_080044EC(this, 0x1800)) { - case 0: + switch (BounceUpdate(this, Q_8_8(24.0))) { + case BOUNCE_DONE_ALL: this->action = 7; this->timer = 150; /* fallthrough */ - case 1: + case BOUNCE_INIT_NEXT: EnqueueSFX(SFX_12B); break; } diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index 02a1c4ba..3d4d077c 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -141,7 +141,7 @@ void sub_0802F300(Entity* this) { temp = this->z.HALF.HI; rand = Random() & 0xf; - if (sub_080044EC(this, this->field_0x80.HWORD) == 1) { + if (BounceUpdate(this, this->field_0x80.HWORD) == BOUNCE_INIT_NEXT) { this->action = 3; this->subAction = 0; if (this->type != 0) { @@ -158,7 +158,7 @@ void sub_0802F300(Entity* this) { return; } else if (this->collisions != COL_NONE) { sub_0800417E(this, this->collisions); - } else if ((GetTileUnderEntity(this) & 0xf0) == 0x50) { + } else if ((GetActTile(this) & 0xf0) == 0x50) { this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest); } diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index fa967d18..86c9f155 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -127,7 +127,7 @@ void sub_08038048(Entity* this) { temp = this->z.HALF.HI; rand = Random() & 0xf; - if (sub_080044EC(this, 0x3000) == 1) { + if (BounceUpdate(this, Q_8_8(48.0)) == BOUNCE_INIT_NEXT) { this->action = 3; this->subAction = 0; this->timer = 20; @@ -135,7 +135,7 @@ void sub_08038048(Entity* this) { return; } else if (this->collisions != COL_NONE) { sub_0800417E(this, this->collisions); - } else if ((GetTileUnderEntity(this) & 0xf0) == 0x50) { + } else if ((GetActTile(this) & 0xf0) == 0x50) { this->direction = (this->direction + 0x10) & (0x3 | DirectionNorthWest); } diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index 57b830d6..7e351588 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -265,8 +265,8 @@ void VaatiTransfiguredType0Action3(Entity* this) { switch (this->field_0x80.HALF.LO) { case 0: - uVar4 = sub_080044EC(this, 0x2800); - if (uVar4 != 1) + uVar4 = BounceUpdate(this, Q_8_8(40.0)); + if (uVar4 != BOUNCE_INIT_NEXT) break; this->field_0x80.HALF.LO = 1; this->timer = 192; diff --git a/src/fileselect.c b/src/fileselect.c index 7e4d9108..cf275fe1 100644 --- a/src/fileselect.c +++ b/src/fileselect.c @@ -1145,7 +1145,7 @@ void sub_080610B8(void) { default: uVar6 = 0; tmp4 = 0; - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { case DPAD_UP: tmp4 = -1; break; diff --git a/src/manager/enemyInteractionManager.c b/src/manager/enemyInteractionManager.c index 0c8428d7..cd393b31 100644 --- a/src/manager/enemyInteractionManager.c +++ b/src/manager/enemyInteractionManager.c @@ -66,14 +66,14 @@ void EnemyInteractionManager_Action1(EnemyInteractionManager* this) { for (i = 0; i < n; i++) { tmp = this->d.enemies[i]; for (j = i + 1; j < super->timer; j++) { - sub_08004484(tmp, this->d.enemies[j]); + CalcCollisionStaticEntity(tmp, this->d.enemies[j]); } } } else { for (i = 0; i < n; i++) { tmp = this->d.enemies[i]; for (j = i + 1; j < super->timer; j++) { - sub_08004484(this->d.enemies[j], tmp); + CalcCollisionStaticEntity(this->d.enemies[j], tmp); } } } diff --git a/src/menu/figurineMenu.c b/src/menu/figurineMenu.c index f8732c15..f76389fd 100644 --- a/src/menu/figurineMenu.c +++ b/src/menu/figurineMenu.c @@ -180,7 +180,7 @@ void FigurineMenu0_ViewFigurineAfterDrawing(void) { s32 t; infoY = gFigurineMenu.unk1f; - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { case B_BUTTON: case START_BUTTON: FigurineMenu_ExitMenu(); @@ -219,7 +219,7 @@ void FigurineMenu1_ViewAllFigurines(void) { infoY = gFigurineMenu.unk1f; figurineIndex = gFigurineMenu.figure_idx; - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { case B_BUTTON: case START_BUTTON: SetMenuType(3); diff --git a/src/menu/kinstoneMenu.c b/src/menu/kinstoneMenu.c index cfc0473a..446cd71c 100644 --- a/src/menu/kinstoneMenu.c +++ b/src/menu/kinstoneMenu.c @@ -194,7 +194,7 @@ void KinstoneMenu_Type1(void) { return; } tmp3 = menu->unk28; - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { case DPAD_LEFT: case DPAD_UP: tmp3--; diff --git a/src/menu/pauseMenu.c b/src/menu/pauseMenu.c index 6b1d0cef..ab90f23b 100644 --- a/src/menu/pauseMenu.c +++ b/src/menu/pauseMenu.c @@ -404,7 +404,7 @@ void PauseMenu_ItemMenu_Update(void) { } break; default: - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { case DPAD_UP: menuSlot = entry->up; break; @@ -710,7 +710,7 @@ void sub_080A56A0(void) { gMenu.field_0xc = gUnk_08128C00; ptr = &gUnk_08128C14[gMenu.field_0x3]; uVar2 = 0xff; - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { case DPAD_UP: uVar2 = ptr->unk0; break; diff --git a/src/message.c b/src/message.c index 87d6e461..08bad90c 100644 --- a/src/message.c +++ b/src/message.c @@ -408,7 +408,7 @@ u16 RunTextCommand(TextRender* this) { gMessage.unk = this->curToken.param; break; case 6: - ptr = &gMessage.field_0xc; + ptr = &gMessage.flags; tmp3 = this->curToken.param; tmp3 &= 0x1f; WriteBit(ptr, tmp3); diff --git a/src/npc/phonograph.c b/src/npc/phonograph.c index 469dddb5..dc1061d8 100644 --- a/src/npc/phonograph.c +++ b/src/npc/phonograph.c @@ -62,10 +62,10 @@ void sub_0806E964(PhonographEntity* this, ScriptExecutionContext* context) { sub_0806EABC(this); } - if (gInput.unk4 & (DPAD_UP | DPAD_DOWN)) { + if (gInput.menuScrollKeys & (DPAD_UP | DPAD_DOWN)) { s32 val2, val3; s32 val = this->unk_68; - if (gInput.unk4 & DPAD_UP) { + if (gInput.menuScrollKeys & DPAD_UP) { val++; } else { val--; @@ -148,8 +148,8 @@ void sub_0806E964(PhonographEntity* this, ScriptExecutionContext* context) { if (val > val2) { val = 1; } - } else if (gInput.unk4 & (DPAD_UP | DPAD_DOWN)) { - if (gInput.unk4 & DPAD_UP) { + } else if (gInput.menuScrollKeys & (DPAD_UP | DPAD_DOWN)) { + if (gInput.menuScrollKeys & DPAD_UP) { val++; } else { val--; diff --git a/src/npcUtils.c b/src/npcUtils.c index b0c111fe..79d572a4 100644 --- a/src/npcUtils.c +++ b/src/npcUtils.c @@ -321,7 +321,7 @@ void CollideFollowers(void) { continue; if ((nextEnt->followerFlag & 1) == 0) continue; - sub_08004484(currentEntity, nextEnt); + CalcCollisionStaticEntity(currentEntity, nextEnt); } } } diff --git a/src/object/bird.c b/src/object/bird.c index 485c0695..95761443 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -132,7 +132,7 @@ void Bird_Type1_Action1_Subaction0(BirdEntity* this) { void Bird_Type1_Action1_Subaction1(BirdEntity* this) { Entity* fx; - if (sub_080044EC(super, 0x1800) < 2) { + if (BounceUpdate(super, Q_8_8(24.0)) < BOUNCE_AIRBORNE) { super->type = 2; super->action = 1; super->z.WORD = 0; diff --git a/src/object/book.c b/src/object/book.c index 4ebd3f7d..5ab73149 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -139,7 +139,7 @@ void Book_Action2(BookEntity* this) { void Book_Action3(BookEntity* this) { Entity* fx; - if (sub_080044EC(super, 0x2800) != 1) { + if (BounceUpdate(super, Q_8_8(40.0)) != BOUNCE_INIT_NEXT) { return; } diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c index 7480ba07..31946da4 100644 --- a/src/object/crenelBeanSprout.c +++ b/src/object/crenelBeanSprout.c @@ -175,7 +175,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) { gUnk_0200AF00.rActionPlayerState = R_ACTION_NONE; } PositionRelative(&gPlayerEntity, super, 0, 0x10000); - if (GetTileUnderEntity(super) == 0x19) { + if (GetActTile(super) == 0x19) { RestorePrevTileEntity(0xdc, super->collisionLayer); sub_08096A78(this); } diff --git a/src/object/cutsceneMiscObject.c b/src/object/cutsceneMiscObject.c index 44fc603f..0cc769f1 100644 --- a/src/object/cutsceneMiscObject.c +++ b/src/object/cutsceneMiscObject.c @@ -332,7 +332,7 @@ void CutsceneMiscObject_Type5(CutsceneMiscObjectEntity* this) { super->zVelocity = 0; SetEntityPriority(super, PRIO_PLAYER_EVENT); InitializeAnimation(super, 0); - if (GetTileUnderEntity(super) == 13) { + if (GetActTile(super) == 13) { super->action = 3; } break; @@ -551,7 +551,7 @@ void CutsceneMiscObject_Type11(CutsceneMiscObjectEntity* this) { InitAnimationForceUpdate(super, 0); } if (super->subAction != 0) { - if ((u32)sub_080044EC(super, 0x1800) <= 1) { + if ((u32)BounceUpdate(super, Q_8_8(24.0)) <= BOUNCE_INIT_NEXT) { super->subAction = 0; SetAffineInfo(super, 0x100, 0x100, 0xC000); } else { diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c index 86c09f1d..d0e918ac 100644 --- a/src/object/figurineDevice.c +++ b/src/object/figurineDevice.c @@ -260,9 +260,9 @@ void FigurineDevice_Action4(FigurineDeviceEntity* this) { tmp = 1; } #ifdef JP - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { #else - switch (gInput.unk4 & 0xfffffeff) { + switch (gInput.menuScrollKeys & ~R_BUTTON) { #endif case DPAD_UP: FigurineDevice_ChangeShellAmount(this, tmp); @@ -275,7 +275,7 @@ void FigurineDevice_Action4(FigurineDeviceEntity* this) { sub_080882A8(this); } #else - switch (gInput.unk4) { + switch (gInput.menuScrollKeys) { case DPAD_UP: FigurineDevice_ChangeShellAmount(this, 1); break; diff --git a/src/object/graveyardKey.c b/src/object/graveyardKey.c index bef307ed..e9c217ba 100644 --- a/src/object/graveyardKey.c +++ b/src/object/graveyardKey.c @@ -125,7 +125,7 @@ void GraveyardKey_Action2(Entity* this, const struct_gUnk_08123FB0* param_2) { u8 type; LinearMoveUpdate(this); - if (sub_080044EC(this, param_2->unk14) < 2) { + if (BounceUpdate(this, param_2->unk14) < BOUNCE_AIRBORNE) { if (this->timer) { this->timer--; this->zVelocity = param_2->unk14 << 3; diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index 5c46e2dd..2d2c1fe9 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -437,7 +437,7 @@ u32 sub_080814C0(ItemOnGroundEntity* this) { void sub_08081500(ItemOnGroundEntity* this) { if (this->unk_68 == 0) { - u32 var0 = sub_080044EC(super, 0x2800); + u32 var0 = BounceUpdate(super, Q_8_8(40.0)); if (var0 == 0) { this->unk_68 = 1; } else { diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c index 8a5a40b1..7a6e7653 100644 --- a/src/object/keyStealingTakkuri.c +++ b/src/object/keyStealingTakkuri.c @@ -164,7 +164,7 @@ void KeyStealingTakkuri_Type5_Init(KeyStealingTakkuriEntity* this) { void KeyStealingTakkuri_Type5_Action1(KeyStealingTakkuriEntity* this) { LinearMoveUpdate(super); - if (sub_080044EC(super, 0x2000) < 2) { + if (BounceUpdate(super, Q_8_8(32.0)) < BOUNCE_AIRBORNE) { if (super->timer != 0) { super->timer--; super->zVelocity = Q_16_16(1.0); diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index 5571ca47..5d6a6fc5 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -387,7 +387,7 @@ void sub_08085B40(LilypadLargeEntity* this) { } } else { ResetCollisionLayer(super); - if (GetTileUnderEntity(super) == 0xd) { + if (GetActTile(super) == 0xd) { ResetCollisionLayer(&gPlayerEntity); LilypadLarge_Action4(this); super->direction = GetFacingDirection(&gPlayerEntity, super); @@ -409,7 +409,7 @@ void sub_08085B40(LilypadLargeEntity* this) { super->timer |= 0x80; this->unk_70 = 0; this->unk_6c = 0; - if (GetTileUnderEntity(super) == 0xd) { + if (GetActTile(super) == 0xd) { super->action = 4; } } diff --git a/src/object/mask.c b/src/object/mask.c index e6934e5a..26539e87 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -130,7 +130,7 @@ void Mask_Action2(MaskEntity* this) { CreateRandomItemDrop(super, 3); } else { - sub_080044EC(super, this->unk_78); + BounceUpdate(super, this->unk_78); if (super->z.HALF.HI == 0) { super->timer++; diff --git a/src/object/minecart.c b/src/object/minecart.c index 73cf2e51..fb53ac7d 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -200,7 +200,7 @@ void Minecart_Action3(MinecartEntity* this) { case 0x6d: case 0x6e: case 0x6f: - if (uVar3 == GetTileUnderEntity(super)) { + if (uVar3 == GetActTile(super)) { Minecart_Action4(this); gPlayerEntity.animationState = super->animationState << 1; return; @@ -222,7 +222,7 @@ void Minecart_Action3(MinecartEntity* this) { void Minecart_Action4(MinecartEntity* this) { sub_08004168(super); CopyPosition(super, &gPlayerEntity); - switch (GetTileUnderEntity(super)) { + switch (GetActTile(super)) { case 0x67: if (super->direction == DirectionWest) { super->direction = DirectionNorth; diff --git a/src/object/objectA2.c b/src/object/objectA2.c index 4f9c55cb..08f90505 100644 --- a/src/object/objectA2.c +++ b/src/object/objectA2.c @@ -52,7 +52,7 @@ void ObjectA2_Action1(Entity* this) { LinearMoveUpdate(this); #ifndef EU if (gSaveHeader->language < 2) { - if (sub_080044EC(this, 0x2000) < 2) { + if (BounceUpdate(this, Q_8_8(32.0)) < BOUNCE_AIRBORNE) { this->z.WORD = 0; this->action = 2; InitializeAnimation(this, 1); @@ -62,15 +62,15 @@ void ObjectA2_Action1(Entity* this) { } } else { #endif - switch (sub_080044EC(this, 0x2000)) { + switch (BounceUpdate(this, Q_8_8(32.0))) { default: this->timer++; break; - case 0: + case BOUNCE_DONE_ALL: this->action = 2; InitializeAnimation(this, 1); // fall through - case 1: + case BOUNCE_INIT_NEXT: this->timer = 0; sub_0809F448(this); SoundReq(SFX_186); diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c index 6f3381dc..773ab378 100644 --- a/src/object/objectOnPillar.c +++ b/src/object/objectOnPillar.c @@ -209,7 +209,7 @@ void sub_080970F4(ObjectOnPillarEntity* this) { bool32 sub_08097144(ObjectOnPillarEntity* this) { LinearMoveUpdate(super); sub_0800445C(super); - if (GetTileUnderEntity(super) == 0x19) { + if (GetActTile(super) == 0x19) { super->spriteOffsetY = 2; } if ((--this->unk_76 == 0) && sub_08097194(this) == FALSE) { diff --git a/src/object/playerClone.c b/src/object/playerClone.c index 56a3c8bf..21bb818b 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -110,7 +110,7 @@ void PlayerClone_Action2(PlayerCloneEntity* this) { if (gPlayerEntity.iframes >= 1) { gPlayerState.chargeState.action = 1; } else { - GetTileUnderEntity(super); + GetActTile(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 93bc1995..255b3e36 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -26,7 +26,7 @@ typedef struct { } PotEntity; void Pot_Action5(PotEntity*); -static void sub_08082850(PotEntity*, Entity*); +static void BreakPot(PotEntity*, Entity*); void sub_08082608(PotEntity* this); void Pot_Init(PotEntity* this); void Pot_Action1(PotEntity* this); @@ -129,13 +129,13 @@ void Pot_Action1(PotEntity* this) { DeleteThisEntity(); break; default: - if (GetTileUnderEntity(super) == 13) { + if (GetActTile(super) == 13) { CreateFx(super, FX_FALL_DOWN, 0); } else if (tileType == 0x4005) { gPlayerState.lastSwordMove = SWORD_MOVE_BREAK_POT; SetTile((u16)this->unk_70, COORD_TO_TILE(super), super->collisionLayer); } - sub_08082850(this, NULL); + BreakPot(this, NULL); break; } } else { @@ -182,7 +182,7 @@ void sub_0808259C(PotEntity* this) { CreateFx(super, FX_LAVA_SPLASH, 0); break; default: - sub_08082850(this, &gPlayerEntity); + BreakPot(this, &gPlayerEntity); return; } @@ -228,7 +228,7 @@ void Pot_Action4(PotEntity* this) { switch (tileType) { case 0x71: case 0x72: - sub_08082850(this, NULL); + BreakPot(this, NULL); break; default: SetTile(0x4000, COORD_TO_TILE(super), super->collisionLayer); @@ -269,7 +269,7 @@ void sub_08082778(PotEntity* this) { } if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (super->contactFlags & 0x7F) != 0x13) { - sub_08082850(this, NULL); + BreakPot(this, NULL); } else { sub_0806F3E4(super); } @@ -277,7 +277,7 @@ void sub_08082778(PotEntity* this) { void sub_080827F8(PotEntity* this) { if (gPlayerState.field_0x1c == 0) { - sub_08082850(this, NULL); + BreakPot(this, NULL); } } @@ -285,7 +285,7 @@ void nullsub_512(PotEntity* this) { } void sub_08082818(PotEntity* this) { - sub_08082850(this, NULL); + BreakPot(this, NULL); } void Pot_Action5(PotEntity* this) { @@ -294,11 +294,11 @@ void Pot_Action5(PotEntity* this) { } if (GravityUpdate(super, Q_8_8(32.0)) == 0) { - sub_08082850(this, NULL); + BreakPot(this, NULL); } } -static void sub_08082850(PotEntity* this, Entity* parent) { +static void BreakPot(PotEntity* this, Entity* parent) { u32 parameter = sub_0808288C(super, super->type, this->unk_7d, super->type2); Entity* fxEntity = CreateFx(super, FX_POT_SHATTER, parameter); if (fxEntity) { diff --git a/src/object/rupee.c b/src/object/rupee.c index fe38b3ad..edf3799b 100644 --- a/src/object/rupee.c +++ b/src/object/rupee.c @@ -46,7 +46,7 @@ void Rupee_Action_1(Entity* this) { if (this->child->next == NULL) { this->action = 2; } else { - if (sub_080044EC(this, 10240) == 0) { + if (BounceUpdate(this, Q_8_8(40.0)) == BOUNCE_DONE_ALL) { this->action = 2; } ProcessMovement0(this); diff --git a/src/player.c b/src/player.c index c50cfcf2..414a675d 100644 --- a/src/player.c +++ b/src/player.c @@ -1974,7 +1974,7 @@ static void PlayerRoomTransition(Entity* this) { static void sub_080724DC(Entity* this) { this->knockbackDuration = 0; DeleteClones(); - if (GetTileUnderEntity(this) != 0x29) { + if (GetActTile(this) != 0x29) { if ((gPlayerState.remainingDiveTime == 0) && (gPlayerState.swim_state != 0)) { PlayerUpdateSwimming(this); } @@ -2618,7 +2618,7 @@ static void PlayerUseStairs(Entity* this) { static void sub_080732D0(Entity* this) { UpdateAnimationSingleFrame(this); - if (GetTileUnderEntity(this) != 40) { + if (GetActTile(this) != 40) { this->direction = DirectionNorth; LinearMoveUpdate(this); } else { @@ -4105,7 +4105,7 @@ void sub_0807529C(Entity* this) { void sub_080752AC(Entity* this, ScriptExecutionContext* ctx) { LinearMoveUpdate(this); if (!ctx->unk_18) { - if (GetTileUnderEntity(this) != 41) { + if (GetActTile(this) != 41) { ctx->unk_18 = 1; ctx->unk_19 = 6; } diff --git a/src/playerItem/playerItemHeldObject.c b/src/playerItem/playerItemHeldObject.c index 5f454d37..ddecc171 100644 --- a/src/playerItem/playerItemHeldObject.c +++ b/src/playerItem/playerItemHeldObject.c @@ -137,7 +137,7 @@ void PlayerItemHeldObject_SubAction2(PlayerItemHeldObjectEntity* this) { (child->base).x = super->x; (child->base).y = super->y; (child->base).z = super->z; - tile = GetTileUnderEntity(super); + tile = GetActTile(super); switch (tile) { case 0xd: case 0x10: diff --git a/src/playerItem/playerItemPacciCaneProjectile.c b/src/playerItem/playerItemPacciCaneProjectile.c index 0aec528a..0a42549f 100644 --- a/src/playerItem/playerItemPacciCaneProjectile.c +++ b/src/playerItem/playerItemPacciCaneProjectile.c @@ -128,7 +128,7 @@ void PlayerItemPacciCaneProjectile_Action1(PlayerItemPacciCaneProjectileEntity* } if (sub_080B1BA4(COORD_TO_TILE(super), gPlayerEntity.collisionLayer, 0x80) == 0) { if (sub_080040D8(super, &gUnk_08003E44, super->x.HALF.HI, super->y.HALF.HI) == 0) { - if (GetTileUnderEntity(super) == 0x19) { + if (GetActTile(super) == 0x19) { super->action = 4; COLLISION_OFF(super); super->x.HALF.HI = (super->x.HALF.HI & 0xfff0) | 8; diff --git a/src/playerUtils.c b/src/playerUtils.c index 412d7142..27374038 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -2349,7 +2349,7 @@ bool32 sub_08079D48(void) { return TRUE; } else { if (!PlayerCheckNEastTile()) { - if (!sub_08007DD6((u16)GetTileUnderEntity(&gPlayerEntity), gUnk_0811C268)) { + if (!sub_08007DD6((u16)GetActTile(&gPlayerEntity), gUnk_0811C268)) { return TRUE; } } diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c index 5593b602..3b8382ca 100644 --- a/src/projectile/boneProjectile.c +++ b/src/projectile/boneProjectile.c @@ -71,7 +71,7 @@ void BoneProjectile_Action3(Entity* this) { this->spriteSettings.draw ^= 1; LinearMoveUpdate(this); GetNextFrame(this); - if (sub_080044EC(this, 0x1800) == 0) { + if (BounceUpdate(this, Q_8_8(24.0)) == BOUNCE_DONE_ALL) { DeleteEntity(this); } } diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c index 59189ac3..3ab18bd0 100644 --- a/src/projectile/dekuSeedProjectile.c +++ b/src/projectile/dekuSeedProjectile.c @@ -116,11 +116,11 @@ void DekuSeedProjectile_Action3(Entity* this) { void DekuSeedProjectile_Action4(Entity* this) { GetNextFrame(this); ProcessMovement3(this); - switch (sub_080044EC(this, 0x2800)) { - case 0: + switch (BounceUpdate(this, Q_8_8(40.0))) { + case BOUNCE_DONE_ALL: DeleteThisEntity(); return; - case 1: + case BOUNCE_INIT_NEXT: COLLISION_OFF(this); this->speed = 0x120; diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c index d1205188..7afb43f8 100644 --- a/src/projectile/dirtBallProjectile.c +++ b/src/projectile/dirtBallProjectile.c @@ -133,7 +133,7 @@ void DirtBallProjectile_Action2(Entity* this) { FreeCarryEntity(entity); CopyPosition(this, entity); } - if (sub_080044EC(this, 0x2800) != 1) { + if (BounceUpdate(this, Q_8_8(40.0)) != BOUNCE_INIT_NEXT) { return; } diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c index 786fe69a..e82a8fce 100644 --- a/src/projectile/rockProjectile.c +++ b/src/projectile/rockProjectile.c @@ -67,11 +67,11 @@ void RockProjectile_Action2(Entity* this) { void RockProjectile_Action3(Entity* this) { GetNextFrame(this); ProcessMovement3(this); - switch (sub_080044EC(this, 0x2800)) { - case 0: + switch (BounceUpdate(this, Q_8_8(40.0))) { + case BOUNCE_DONE_ALL: DeleteEntity(this); return; - case 1: + case BOUNCE_INIT_NEXT: COLLISION_OFF(this); this->speed = 0x120; if (sub_0800442E(this) != 0) { |
