1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 14:20:11 +00:00

Fix some non matchings in actors and parameter (#540)

* Fix some non matchings in actors and parameter

- `EnTuboTrap_HandleImpact` from `z_en_tubo_trap.c` (fully matching)
- `func_80ADA35C` from `z_en_po_sisters.c` (fully matching)
- `func_80B0B81C` from `z_en_stream.c` (fully matching)
- `Item_Give` from `z_parameter.c` (1 non matching left)

* Rectify bss ordering comment
This commit is contained in:
Roman971 2020-12-18 01:12:22 +01:00 committed by GitHub
parent 0376242365
commit 83e53bbaf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 53 additions and 2110 deletions

View file

@ -524,8 +524,6 @@ void func_80ADA2BC(EnPoSisters* this, GlobalContext* globalCtx) {
this->actionFunc = func_80ADBF58;
}
#ifdef NON_MATCHING
// Single register swap
void func_80ADA35C(EnPoSisters* this, GlobalContext* globalCtx) {
f32 targetY;
Player* player = PLAYER;
@ -538,11 +536,11 @@ void func_80ADA35C(EnPoSisters* this, GlobalContext* globalCtx) {
targetY = 832.0f;
}
Math_SmoothScaleMaxF(&this->actor.posRot.pos.y, targetY, 0.5f, 3.0f);
if (this->unk_196 == 0) {
if (!this->unk_196) {
this->unk_196 = 32;
}
if (this->unk_196 != 0U) { // U improves codegen from missing move + regalloc to just regalloc
this->unk_196 -= 1U;
if (this->unk_196 != 0) {
this->unk_196--;
}
this->actor.posRot.pos.y += (2.0f + 0.5f * Math_Rand_ZeroOne()) * Math_Sins(this->unk_196 * 0x800);
if (this->unk_22E.a == 255 && this->actionFunc != func_80ADA8C0 && this->actionFunc != func_80ADA7F0) {
@ -553,9 +551,6 @@ void func_80ADA35C(EnPoSisters* this, GlobalContext* globalCtx) {
}
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Po_Sisters/func_80ADA35C.s")
#endif
void func_80ADA4A8(EnPoSisters* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);

View file

@ -52,34 +52,35 @@ void EnStream_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnStream_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
#ifdef NON_MATCHING
// regalloc differences, checks if the player is range of the vortex
// Checks if the player is in range of the vortex
s32 func_80B0B81C(Vec3f* vortexPosRot, Vec3f* playerPosRot, Vec3f* posDifference, f32 vortexYScale) {
s32 ret = 0;
f32 smallConstant = 28;
f32 lowerBounds = 0 * vortexYScale * 50;
f32 upperBounds = 160 * vortexYScale * 50;
f32 smallConstant = 28.0f;
f32 upperBounds = 160 * vortexYScale * 50.0f;
f32 lowerBounds = 0 * vortexYScale * 50.0f;
f32 xzDist;
f32 range;
posDifference->x = playerPosRot->x - vortexPosRot->x;
posDifference->y = playerPosRot->y - vortexPosRot->y;
posDifference->z = playerPosRot->z - vortexPosRot->z;
xzDist = sqrtf(SQ(posDifference->x) + SQ(posDifference->z));
if (lowerBounds <= posDifference->y && posDifference->y <= upperBounds) {
posDifference->y = posDifference->y - lowerBounds;
if (xzDist <= (((75 - smallConstant) * (posDifference->y / (upperBounds - lowerBounds))) + 28)) {
posDifference->y -= lowerBounds;
range = ((75.0f - smallConstant) * (posDifference->y / (upperBounds - lowerBounds))) + 28.0f;
if (xzDist <= range) {
ret = 1;
}
}
if ((posDifference->y <= lowerBounds) && (xzDist <= 28)) {
if ((posDifference->y <= lowerBounds) && (xzDist <= 28.0f)) {
ret = 2;
}
return ret;
}
#else
s32 func_80B0B81C(Vec3f* vortexPos, Vec3f* playerPos, Vec3f* posDifference, f32 vortexYScale);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Stream/func_80B0B81C.s")
#endif
void EnStream_SuckPlayer(EnStream* this, GlobalContext* globalCtx) {
Player* player = PLAYER;

View file

@ -156,10 +156,9 @@ void EnTuboTrap_SpawnEffectsInWater(EnTuboTrap* this, GlobalContext* globalCtx)
}
}
#ifdef NON_MATCHING
void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) {
s32 pad;
Player* player = PLAYER;
Player* player2 = PLAYER;
if ((this->actor.bgCheckFlags & 0x20) && (this->actor.waterY > 15.0f)) {
EnTuboTrap_SpawnEffectsInWater(this, globalCtx);
@ -194,7 +193,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) {
if (this->collider.base.at == &player->actor) {
EnTuboTrap_SpawnEffectsOnLand(this, globalCtx);
Audio_PlaySoundAtPosition(globalCtx, &this->actor.posRot.pos, 40, NA_SE_EV_POT_BROKEN);
Audio_PlaySoundAtPosition(globalCtx, &player->actor.posRot.pos, 40, NA_SE_PL_BODY_HIT);
Audio_PlaySoundAtPosition(globalCtx, &player2->actor.posRot.pos, 40, NA_SE_PL_BODY_HIT);
EnTuboTrap_DropCollectible(this, globalCtx);
Actor_Kill(&this->actor);
return;
@ -209,9 +208,6 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, GlobalContext* globalCtx) {
return;
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Tubo_Trap/EnTuboTrap_HandleImpact.s")
#endif
void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) {
Player* player = PLAYER;