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

Matched EnPoRelay, DemoGt, one more in EnPoSisters, and cleanup BgBdanSwitch (#513)

* Darkmeiro decompilation

Bg_Gnd_Darkmeiro decompiled, matched, and documented.

* give this a shot

* fix conflict

* one more try

* could be useful

* whoops

* ZAP2 stuff

* ZAP why

* ZAP again

* more matchings, some cleanup

* small cleanup
This commit is contained in:
petrie911 2020-12-06 11:06:56 -06:00 committed by GitHub
parent 9d63626343
commit 756f6dc393
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 112 additions and 1288 deletions

View file

@ -69,7 +69,7 @@ static ColliderJntSphItemInit sJntSphItemsInit[] = {
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x39, 0x20, COLSHAPE_JNTSPH },
1,
&sJntSphItemsInit,
sJntSphItemsInit,
};
static InitChainEntry sInitChain[] = {
@ -82,22 +82,23 @@ static Vec3f D_8086E0E0 = { 0, 140.0f, 0 };
void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, u32 collision, DynaPolyMoveFlag flag) {
s16 pad1;
u32 local_c = 0;
ColHeader* colHeader = NULL;
s16 pad2;
DynaPolyInfo_SetActorMove(&this->actor, flag);
DynaPolyInfo_Alloc(collision, &local_c);
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, local_c);
if (this->dynaPolyId == 0x32) {
DynaPolyInfo_SetActorMove(&this->dyna, flag);
DynaPolyInfo_Alloc(collision, &colHeader);
this->dyna.dynaPolyId =
DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.dynaPolyId == 0x32) {
osSyncPrintf("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_bdan_switch.c", 325,
this->actor.id, this->actor.params);
this->dyna.actor.id, this->dyna.actor.params);
}
}
void func_8086D098(BgBdanSwitch* this, GlobalContext* globalCtx) {
Actor* actor = &this->actor;
Actor* actor = &this->dyna.actor;
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, actor, &sJntSphInit, &this->colliderItems);
Collider_SetJntSph(globalCtx, &this->collider, actor, &sJntSphInit, this->colliderItems);
}
void func_8086D0EC(BgBdanSwitch* this) {
@ -107,21 +108,21 @@ void func_8086D0EC(BgBdanSwitch* this) {
this->unk_1CC += 0xFA0;
}
switch (this->actor.params & 0xFF) {
switch (this->dyna.actor.params & 0xFF) {
case BLUE:
case YELLOW_HEAVY:
case YELLOW:
this->unk_1D4 = ((Math_Coss(this->unk_1CC) * 0.5f) + 8.833334f) * 0.012f;
this->unk_1D0 = ((Math_Coss(this->unk_1CC) * 0.5f) + 20.5f) * (this->unk_1C8 * 0.0050000004f);
this->actor.scale.y = this->unk_1C8 * 0.1f;
this->dyna.actor.scale.y = this->unk_1C8 * 0.1f;
break;
case YELLOW_TALL_1:
case YELLOW_TALL_2:
this->unk_1D4 = ((Math_Coss(this->unk_1CC) * 0.5f) + (43.0f / 6.0f)) * 0.0075000003f;
this->unk_1D0 = ((Math_Coss(this->unk_1CC) * 0.5f) + 20.5f) * (this->unk_1C8 * 0.0050000004f);
this->actor.scale.y = this->unk_1C8 * 0.1f;
this->dyna.actor.scale.y = this->unk_1C8 * 0.1f;
}
this->actor.shape.unk_08 = 1.2f / this->unk_1D0;
this->dyna.actor.shape.unk_08 = 1.2f / this->unk_1D0;
}
void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
@ -130,17 +131,17 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
s16 type;
s32 flag;
type = this->actor.params & 0xFF;
Actor_ProcessInitChain(&this->actor, sInitChain);
type = this->dyna.actor.params & 0xFF;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) {
this->actor.scale.z = 0.05f;
this->actor.scale.x = 0.05f;
this->dyna.actor.scale.z = 0.05f;
this->dyna.actor.scale.x = 0.05f;
} else {
this->actor.scale.z = 0.1f;
this->actor.scale.x = 0.1f;
this->dyna.actor.scale.z = 0.1f;
this->dyna.actor.scale.x = 0.1f;
}
this->actor.scale.y = 0.0f;
Actor_SetHeight(&this->actor, 10.0f);
this->dyna.actor.scale.y = 0.0f;
Actor_SetHeight(&this->dyna.actor, 10.0f);
switch (type) {
case BLUE:
@ -151,11 +152,11 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
case YELLOW_TALL_1:
case YELLOW_TALL_2:
func_8086D098(this, globalCtx);
this->actor.flags |= 1;
this->actor.unk_1F = 4;
this->dyna.actor.flags |= 1;
this->dyna.actor.unk_1F = 4;
}
flag = Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F);
flag = Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F);
switch (type) {
case BLUE:
@ -182,21 +183,22 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) {
}
break;
default:
osSyncPrintf("不正な ARG_DATA(arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_bg_bdan_switch.c", 454);
Actor_Kill(&this->actor);
osSyncPrintf("不正な ARG_DATA(arg_data 0x%04x)(%s %d)\n", this->dyna.actor.params, "../z_bg_bdan_switch.c",
454);
Actor_Kill(&this->dyna.actor);
return;
}
osSyncPrintf("(巨大魚ダンジョン 専用スイッチ)(arg_data 0x%04x)\n", this->actor.params);
osSyncPrintf("(巨大魚ダンジョン 専用スイッチ)(arg_data 0x%04x)\n", this->dyna.actor.params);
}
void BgBdanSwitch_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgBdanSwitch* this = THIS;
switch (this->actor.params & 0xFF) {
switch (this->dyna.actor.params & 0xFF) {
case BLUE:
case YELLOW_HEAVY:
case YELLOW:
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId);
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
break;
case YELLOW_TALL_1:
case YELLOW_TALL_2:
@ -208,22 +210,22 @@ void func_8086D4B4(BgBdanSwitch* this, GlobalContext* globalCtx) {
s32 pad;
s32 type;
if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) {
type = this->actor.params & 0xFF;
Flags_SetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F);
if (!Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) {
type = this->dyna.actor.params & 0xFF;
Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F);
if (type == BLUE || type == YELLOW_TALL_2) {
func_800806BC(globalCtx, &this->actor, 0x4807);
func_800806BC(globalCtx, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR);
} else {
func_800806BC(globalCtx, &this->actor, 0x4802);
func_800806BC(globalCtx, &this->dyna.actor, NA_SE_SY_CORRECT_CHIME);
}
}
}
void func_8086D548(BgBdanSwitch* this, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) {
Flags_UnsetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F);
if ((this->actor.params & 0xFF) == YELLOW_TALL_2) {
func_800806BC(globalCtx, &this->actor, 0x4807);
if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) {
Flags_UnsetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F);
if ((this->dyna.actor.params & 0xFF) == YELLOW_TALL_2) {
func_800806BC(globalCtx, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR);
}
}
}
@ -234,15 +236,15 @@ void func_8086D5C4(BgBdanSwitch* this) {
}
void func_8086D5E0(BgBdanSwitch* this, GlobalContext* globalCtx) {
switch (this->actor.params & 0xFF) {
switch (this->dyna.actor.params & 0xFF) {
case BLUE:
if (func_800435B4(&this->actor)) {
if (func_800435B4(&this->dyna)) {
func_8086D67C(this);
func_8086D4B4(this, globalCtx);
}
break;
case YELLOW:
if (func_8004356C(&this->actor)) {
if (func_8004356C(&this->dyna)) {
func_8086D67C(this);
func_8086D4B4(this, globalCtx);
}
@ -255,12 +257,12 @@ void func_8086D67C(BgBdanSwitch* this) {
}
void func_8086D694(BgBdanSwitch* this, GlobalContext* globalCtx) {
if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) {
if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) {
this->unk_1C8 -= 0.2f;
if (this->unk_1C8 <= 0.1f) {
func_8086D730(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
}
}
}
@ -272,9 +274,9 @@ void func_8086D730(BgBdanSwitch* this) {
}
void func_8086D754(BgBdanSwitch* this, GlobalContext* globalCtx) {
switch (this->actor.params & 0xFF) {
switch (this->dyna.actor.params & 0xFF) {
case BLUE:
if (!func_800435B4(&this->actor)) {
if (!func_800435B4(&this->dyna)) {
if (this->unk_1D8 <= 0) {
func_8086D7FC(this);
func_8086D548(this, globalCtx);
@ -284,7 +286,7 @@ void func_8086D754(BgBdanSwitch* this, GlobalContext* globalCtx) {
}
break;
case YELLOW:
if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) {
if (!Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) {
func_8086D7FC(this);
}
}
@ -298,7 +300,7 @@ void func_8086D80C(BgBdanSwitch* this, GlobalContext* globalCtx) {
this->unk_1C8 += 0.2f;
if (this->unk_1C8 >= 1.0f) {
func_8086D5C4(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
}
}
@ -308,7 +310,7 @@ void func_8086D86C(BgBdanSwitch* this) {
}
void func_8086D888(BgBdanSwitch* this, GlobalContext* globalCtx) {
if (func_8004356C(&this->actor)) {
if (func_8004356C(&this->dyna)) {
func_8086D8BC(this);
}
}
@ -321,8 +323,8 @@ void func_8086D8CC(BgBdanSwitch* this, GlobalContext* globalCtx) {
this->unk_1C8 -= 0.2f;
if (this->unk_1C8 <= 0.6f) {
func_8086D9F8(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
}
}
@ -332,12 +334,12 @@ void func_8086D944(BgBdanSwitch* this) {
}
void func_8086D95C(BgBdanSwitch* this, GlobalContext* globalCtx) {
if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) {
if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) {
this->unk_1C8 -= 0.2f;
if (this->unk_1C8 <= 0.1f) {
func_8086DB24(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
func_800AA000(this->dyna.actor.xyzDistFromLinkSq, 0x78, 0x14, 0xA);
}
}
}
@ -351,7 +353,7 @@ void func_8086D9F8(BgBdanSwitch* this) {
void func_8086DA1C(BgBdanSwitch* this, GlobalContext* globalCtx) {
Actor* heldActor = PLAYER->heldActor;
if (func_8004356C(&this->actor)) {
if (func_8004356C(&this->dyna)) {
if (heldActor != NULL && heldActor->id == ACTOR_EN_RU1) {
if (this->unk_1D8 <= 0) {
func_8086D944(this);
@ -375,7 +377,7 @@ void func_8086DAC4(BgBdanSwitch* this, GlobalContext* globalCtx) {
this->unk_1C8 += 0.2f;
if (this->unk_1C8 >= 1.0f) {
func_8086D86C(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
}
}
@ -393,7 +395,7 @@ void func_8086DB4C(BgBdanSwitch* this) {
}
void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) {
switch (this->actor.params & 0xFF) {
switch (this->dyna.actor.params & 0xFF) {
default:
return;
case YELLOW_TALL_1:
@ -418,11 +420,11 @@ void func_8086DC30(BgBdanSwitch* this) {
}
void func_8086DC48(BgBdanSwitch* this, GlobalContext* globalCtx) {
if ((func_8005B198() == this->actor.type) || (this->unk_1DA <= 0)) {
if ((func_8005B198() == this->dyna.actor.type) || (this->unk_1DA <= 0)) {
this->unk_1C8 -= 0.3f;
if (this->unk_1C8 <= 1.0f) {
func_8086DCCC(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
}
}
}
@ -433,9 +435,9 @@ void func_8086DCCC(BgBdanSwitch* this) {
}
void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) {
switch (this->actor.params & 0xFF) {
switch (this->dyna.actor.params & 0xFF) {
case YELLOW_TALL_1:
if (!Flags_GetSwitch(globalCtx, (this->actor.params >> 8) & 0x3F)) {
if (!Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) {
func_8086DDA8(this);
}
break;
@ -454,12 +456,12 @@ void func_8086DDA8(BgBdanSwitch* this) {
}
void func_8086DDC0(BgBdanSwitch* this, GlobalContext* globalCtx) {
if ((((this->actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->actor.type)) ||
if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.type)) ||
(this->unk_1DA <= 0)) {
this->unk_1C8 += 0.3f;
if (this->unk_1C8 >= 2.0f) {
func_8086DB4C(this);
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FOOT_SWITCH);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_FOOT_SWITCH);
}
}
}
@ -474,7 +476,7 @@ void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) {
}
this->actionFunc(this, globalCtx);
func_8086D0EC(this);
type = this->actor.params & 0xFF;
type = this->dyna.actor.params & 0xFF;
if (type != 3 && type != 4) {
this->unk_1D8 -= 1;
return;
@ -486,13 +488,14 @@ void BgBdanSwitch_Update(Actor* thisx, GlobalContext* globalCtx) {
this->collider.base.acFlags &= 0xFFFD;
this->unk_1DC = temp;
this->collider.list[0].dim.modelSphere.radius = this->unk_1D4 * 370.0f;
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, Gfx* dlist) {
func_800D1694(this->actor.posRot.pos.x, this->actor.posRot.pos.y + (this->actor.shape.unk_08 * this->unk_1D0),
this->actor.posRot.pos.z, &this->actor.shape.rot);
func_800D1694(this->dyna.actor.posRot.pos.x,
this->dyna.actor.posRot.pos.y + (this->dyna.actor.shape.unk_08 * this->unk_1D0),
this->dyna.actor.posRot.pos.z, &this->dyna.actor.shape.rot);
Matrix_Scale(this->unk_1D4, this->unk_1D0, this->unk_1D4, MTXMODE_APPLY);
Gfx_DrawDListOpa(globalCtx, dlist);
}
@ -500,18 +503,18 @@ void func_8086DF58(BgBdanSwitch* this, GlobalContext* globalCtx, Gfx* dlist) {
void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgBdanSwitch* this = THIS;
switch (this->actor.params & 0xFF) {
switch (this->dyna.actor.params & 0xFF) {
case YELLOW_HEAVY:
case YELLOW:
func_8086DF58(this, globalCtx, &D_060061A0);
func_8086DF58(this, globalCtx, D_060061A0);
break;
case YELLOW_TALL_1:
case YELLOW_TALL_2:
func_8086DF58(this, globalCtx, &D_060061A0);
func_8086DF58(this, globalCtx, D_060061A0);
func_800628A4(0, &this->collider);
Matrix_MultVec3f(&D_8086E0E0, &this->actor.posRot2);
Matrix_MultVec3f(&D_8086E0E0, &this->dyna.actor.posRot2.pos);
break;
case BLUE:
func_8086DF58(this, globalCtx, &D_06005A20);
func_8086DF58(this, globalCtx, D_06005A20);
}
}

View file

@ -18,13 +18,7 @@ struct BgBdanSwitch;
typedef void (*BgBdanSwitchActionFunc)(struct BgBdanSwitch*, GlobalContext*);
typedef struct BgBdanSwitch {
/* 0x0000 */ Actor actor;
/* 0x014C */ u32 dynaPolyId;
/* 0x0150 */ f32 unk_150;
/* 0x0154 */ f32 unk_154;
/* 0x0158 */ u32 unk_158;
/* 0x015C */ u32 unk_15C;
/* 0x0160 */ u8 unk_160;
/* 0x0000 */ DynaPolyActor dyna;
/* 0x0164 */ BgBdanSwitchActionFunc actionFunc;
/* 0x0168 */ ColliderJntSph collider;
/* 0x0188 */ ColliderJntSphItem colliderItems[1];

View file

@ -270,10 +270,9 @@ void func_8097E1D4(GlobalContext* globalCtx, Vec3f* arg1, s16 arg2) {
}
}
#ifdef NON_MATCHING
void func_8097E454(GlobalContext* globalCtx, Vec3f* spawnerPos, Vec3f* velocity, Vec3f* accel, f32 arg4, f32 scale,
s32 arg6, s32 arg7, s16 life) {
s32 pad2[4];
s32 pad2[3];
s16 increment;
s32 frames;
s32 i;
@ -283,8 +282,8 @@ void func_8097E454(GlobalContext* globalCtx, Vec3f* spawnerPos, Vec3f* velocity,
Vec3f pos;
if ((func_800C0D28(globalCtx) == 0) && (arg7 > 0) && (arg6 > 0)) {
frames = 0x10000 * (ABS((s32)globalCtx->gameplayFrames) % arg7);
phi_s0 = frames / arg6;
frames = (ABS((s32)globalCtx->gameplayFrames) % arg7);
phi_s0 = 0x10000 * frames / arg6;
increment = 0x10000 / arg6;
for (i = frames; i < arg6; i += arg7) {
@ -303,11 +302,6 @@ void func_8097E454(GlobalContext* globalCtx, Vec3f* spawnerPos, Vec3f* velocity,
}
}
}
#else
void func_8097E454(GlobalContext* globalCtx, Vec3f* spawnerPos, Vec3f* velocity, Vec3f* accel, f32 arg4, f32 scale,
s32 arg6, s32 arg7, s16 life);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Gt/func_8097E454.s")
#endif
u8 func_8097E69C(GlobalContext* globalCtx) {
if (globalCtx->csCtx.state == 0) {
@ -364,23 +358,20 @@ void func_8097E744(DemoGt* this, GlobalContext* globalCtx, u32 actionIdx) {
}
}
#ifdef NON_MATCHING
void func_8097E824(DemoGt* this, s32 arg1) {
s16 phi_a1;
s16 phi_a2;
s16 phi_a3;
f32 tempf1;
f32 tempf2;
Vec3f* pos = &this->dyna.actor.posRot.pos;
Vec3s* unk16C = &this->unk_16C;
s32 pad;
f32 tempf3;
f32 tempf2;
f32 tempf1;
f32 phi_f2;
f32 phi_f12;
f32 phi_f14;
Vec3f* pos = &this->dyna.actor.posRot.pos;
Vec3s* unk16C = &this->unk_16C;
if (arg1 == 1) {
phi_a1 = kREG(19) + 0x8000;
phi_a2 = kREG(20) + 0x8000;
@ -443,18 +434,14 @@ void func_8097E824(DemoGt* this, s32 arg1) {
unk16C->y += phi_a2;
unk16C->z += phi_a3;
tempf1 = Math_Coss(unk16C->x) * phi_f2;
tempf1 = Math_Coss(unk16C->x) * phi_f14;
tempf2 = Math_Coss(unk16C->y) * phi_f12;
tempf3 = Math_Coss(unk16C->z) * phi_f14;
tempf3 = Math_Coss(unk16C->z) * phi_f2;
pos->x += tempf1;
pos->y += tempf2;
pos->z += tempf3;
}
#else
void func_8097E824(DemoGt* this, s32 arg1);
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_Demo_Gt/func_8097E824.s")
#endif
void func_8097ED64(DemoGt* this, GlobalContext* globalCtx, s32 actionIdx) {
func_8097E744(this, globalCtx, actionIdx);

View file

@ -173,14 +173,11 @@ void EnPoRelay_Talk(EnPoRelay* this, GlobalContext* globalCtx) {
func_8002F974(&this->actor, NA_SE_EN_PO_FLY - SFX_FLAG);
}
#ifdef NON_MATCHING
// Single stack difference
void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { // saved, sp64
Player* player = PLAYER; // sp5C
Vec3f vec; // sp50
f32 rand;
f32 multiplier; // sp48
void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
Vec3f vec;
f32 speed;
f32 multiplier;
if (this->actionTimer != 0) {
this->actionTimer--;
@ -188,18 +185,18 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { // saved, sp64
if (this->actionTimer == 0 && Math_Rand_ZeroOne() < 0.03f) {
this->actionTimer = 32;
if (this->pathIndex < 23) {
rand = Math_Rand_ZeroOne() * 3.0f;
if (rand < 1.0f) {
speed = Math_Rand_ZeroOne() * 3.0f;
if (speed < 1.0f) {
multiplier = 1.0f;
} else if (rand < 2.0f) {
} else if (speed < 2.0f) {
multiplier = -1.0f;
} else {
multiplier = 0.0f;
}
speed = 30.0f * multiplier;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HONOTRAP,
Math_Coss(this->unk_19A) * (30.0f * multiplier) + this->actor.posRot.pos.x,
this->actor.posRot.pos.y,
Math_Sins(this->unk_19A) * (30.0f * multiplier) + this->actor.posRot.pos.z, 0,
Math_Coss(this->unk_19A) * speed + this->actor.posRot.pos.x, this->actor.posRot.pos.y,
Math_Sins(this->unk_19A) * speed + this->actor.posRot.pos.z, 0,
(this->unk_19A + 0x8000) - (0x2000 * multiplier), 0, 2);
}
}
@ -247,9 +244,6 @@ void EnPoRelay_Race(EnPoRelay* this, GlobalContext* globalCtx) { // saved, sp64
this->unk_19A = func_8002DAC0(&this->actor, &vec);
func_8002F974(&this->actor, NA_SE_EN_PO_AWAY - SFX_FLAG);
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Po_Relay/EnPoRelay_Race.s")
#endif
void EnPoRelay_EndRace(EnPoRelay* this, GlobalContext* globalCtx) {
Math_ApproxUpdateScaledS(&this->actor.shape.rot.y, -0x4000, 0x800);

View file

@ -770,8 +770,6 @@ void func_80ADAFC0(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80ADB17C(EnPoSisters* this, GlobalContext* globalCtx) {
Vec3s* vec;
this->unk_19A++;
if (this->unk_19A == 64) {
Flags_SetSwitch(globalCtx, this->actor.params);
@ -788,10 +786,9 @@ void func_80ADB17C(EnPoSisters* this, GlobalContext* globalCtx) {
func_80AD9240(this, 64 - this->unk_19A, &this->actor.posRot.pos);
}
if (this->unk_19A == 32) {
vec = &D_80ADD7A4[this->unk_194];
this->actor.posRot.pos.x = vec->x;
this->actor.posRot.pos.y = vec->y;
this->actor.posRot.pos.z = vec->z;
this->actor.posRot.pos.x = D_80ADD7A4[this->unk_194].x;
this->actor.posRot.pos.y = D_80ADD7A4[this->unk_194].y;
this->actor.posRot.pos.z = D_80ADD7A4[this->unk_194].z;
}
}
@ -1134,11 +1131,10 @@ void func_80ADC10C(EnPoSisters* this, GlobalContext* globalCtx) {
}
}
#ifdef NON_MATCHING
// Stack only
void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) {
EnPoSisters* this = THIS;
s32 pad;
EnPoSisters* this = THIS;
s16 temp;
if (this->collider.base.atFlags & 2) {
this->collider.base.atFlags &= ~2;
@ -1154,22 +1150,26 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80ADA35C(this, globalCtx);
}
Actor_MoveForward(&this->actor);
if (this->unk_199 & 0x10) {
func_8002E4B4(globalCtx, &this->actor, 20.0f, 20.0f, 0.0f, 5);
} else {
Vec3f vec;
UNK_TYPE sp34;
vec.x = this->actor.posRot.pos.x;
vec.y = this->actor.posRot.pos.y + 10.0f;
vec.z = this->actor.posRot.pos.z;
this->actor.groundY = func_8003C9A4(&globalCtx->colCtx, &this->actor.floorPoly, &sp34, &this->actor, &vec);
}
Collider_CylinderUpdate(&this->actor, &this->collider);
if (this->actionFunc == func_80ADA8C0 || this->actionFunc == func_80ADA7F0) {
this->unk_198++;
this->unk_198 = CLAMP_MAX(this->unk_198, 8);
} else if (this->actionFunc != func_80ADAFC0) {
this->unk_198 = CLAMP_MIN((s16)(this->unk_198 - 1), 1);
temp = this->unk_198 - 1;
this->unk_198 = CLAMP_MIN(temp, 1);
}
if (this->actionFunc == func_80ADA8C0) {
this->actor.flags |= 0x01000000;
@ -1189,9 +1189,6 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_Po_Sisters/EnPoSisters_Update.s")
#endif
void func_80ADC55C(EnPoSisters* this) {
s16 temp_var;

View file

@ -101,11 +101,11 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, GlobalContext* globalCtx
Flags_SetSwitch(globalCtx, this->actor.params >> 8 & 0x3F);
if (type == OBJLIGHTSWITCH_TYPE_1) {
func_800806BC(globalCtx, thisx, 0x4807);
func_800806BC(globalCtx, thisx, NA_SE_SY_TRE_BOX_APPEAR);
} else if (type == OBJLIGHTSWITCH_TYPE_BURN) {
func_800806BC(globalCtx, thisx, 0x4806);
func_800806BC(globalCtx, thisx, NA_SE_SY_ERROR);
} else {
func_800806BC(globalCtx, thisx, 0x4802);
func_800806BC(globalCtx, thisx, NA_SE_SY_CORRECT_CHIME);
}
}
}
@ -115,7 +115,7 @@ void ObjLightswitch_ClearSwitchFlag(ObjLightswitch* this, GlobalContext* globalC
Flags_UnsetSwitch(globalCtx, this->actor.params >> 8 & 0x3F);
if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_1) {
func_800806BC(globalCtx, &this->actor, 0x4807);
func_800806BC(globalCtx, &this->actor, NA_SE_SY_TRE_BOX_APPEAR);
}
}
}