label BounceUpdate asm

This commit is contained in:
theo3
2023-12-30 17:13:42 -08:00
parent 37723f5607
commit fb9f59fbbb
62 changed files with 230 additions and 198 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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);
}
+2 -2
View File
@@ -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 {
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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;
}
}
+1 -1
View File
@@ -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++;
+2 -2
View File
@@ -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;
+4 -4
View File
@@ -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);
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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;
+10 -10
View File
@@ -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) {
+1 -1
View File
@@ -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);