match func_i5_8018A544 and cleanup func_i6_8019EE60 (#132)

This commit is contained in:
inspectredc 2024-02-17 00:55:40 +00:00 committed by GitHub
parent 2bd47f5bfd
commit 324115177e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 48 deletions

View File

@ -486,9 +486,6 @@ void func_i5_8018A474(Actor* actor) {
}
}
#ifdef NON_MATCHING
// Regalloc
// https://decomp.me/scratch/0X1gk
void func_i5_8018A544(Actor* actor) {
f32 temp_fv0;
f32 temp_fv1;
@ -508,9 +505,8 @@ void func_i5_8018A544(Actor* actor) {
if (actor->scale == 1.0f) {
if (actor->health >= 10) {
func_8007A6F0(&actor->obj.pos, 0x1903400F);
var_v0 = actor->iwork[0];
if (var_v0) {
actor->iwork[actor->iwork[1]] = 0;
if ((Actor*) actor->iwork[0] != NULL) {
((Actor*) actor->iwork[0])->iwork[actor->iwork[1]] = 0;
}
func_8007A900(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f, 0xFF, 8, 1);
if (Rand_ZeroOne() < 0.3f) {
@ -527,9 +523,8 @@ void func_i5_8018A544(Actor* actor) {
func_8007A900(actor->obj.pos.x, actor->obj.pos.y, actor->obj.pos.z, 8.0f, 0xFF, 8, 1);
Object_Kill(&actor->obj, actor->sfxPos);
var_v0 = actor->iwork[0];
if (var_v0) {
actor->iwork[actor->iwork[1]] = 0;
if ((Actor*) actor->iwork[0] != NULL) {
((Actor*) actor->iwork[0])->iwork[actor->iwork[1]] = 0;
}
}
}
@ -579,11 +574,11 @@ void func_i5_8018A544(Actor* actor) {
temp_fv1 = actor->scale * 314.0f;
if (actor->vel.x != 0.0f) {
var_v0 = (actor->vel.x > 0) ? 1 : (actor->vel.x == 0.0f) ? 0 : -1;
var_v0 = SIGN_OF(actor->vel.x);
actor->obj.rot.x += ((sqrtf(SQ(actor->vel.x) + SQ(actor->vel.z)) * 360.0f) / temp_fv1) * (f32) var_v0;
} else {
var_v0 = (actor->vel.z > 0) ? 1 : (actor->vel.z == 0.0f) ? 0 : -1;
var_v0 = SIGN_OF(actor->vel.z);
actor->obj.rot.x += ((sqrtf(SQ(actor->vel.x) + SQ(actor->vel.z)) * 360.0f) / temp_fv1) * (f32) var_v0;
}
@ -591,13 +586,10 @@ void func_i5_8018A544(Actor* actor) {
if (actor->obj.rot.y >= 180.0f) {
actor->obj.rot.y -= 180.0f;
}
if (actor->obj.rot.y < 0.0f) {
if (actor->obj.rot.y < 0) {
actor->obj.rot.y += 180.0f;
}
}
#else
#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_i5/fox_ti/func_i5_8018A544.s")
#endif
void func_i5_8018AABC(Actor* actor) {
if (actor->scale != 1.0f) {

View File

@ -2125,52 +2125,55 @@ void func_i6_8019EE60(Player* player) {
}
break;
case 725:
if (gTeamShields[2] != -1) {
if (gTeamShields[2] == 0) {
switch (gTeamShields[2]) {
case 0:
Radio_PlayMessage(gMsg_ID_20345, RCID_ROB64);
break;
}
} else {
Radio_PlayMessage(gMsg_ID_20333, RCID_ROB64);
break;
}
if (gHitCount >= 100) {
Radio_PlayMessage(gMsg_ID_2305, RCID_SLIPPY);
} else {
func_80048AC0(2);
case -1:
Radio_PlayMessage(gMsg_ID_20333, RCID_ROB64);
break;
default:
if (gHitCount >= 100) {
Radio_PlayMessage(gMsg_ID_2305, RCID_SLIPPY);
} else {
func_80048AC0(2);
}
break;
}
break;
case 872:
if (gTeamShields[3] != -1) {
if (gTeamShields[3] == 0) {
switch (gTeamShields[3]) {
case 0:
Radio_PlayMessage(gMsg_ID_20344, RCID_ROB64);
break;
}
} else {
Radio_PlayMessage(gMsg_ID_20332, RCID_ROB64);
break;
}
if (gHitCount >= 100) {
Radio_PlayMessage(gMsg_ID_20261, RCID_PEPPY);
} else {
func_80048AC0(3);
case -1:
Radio_PlayMessage(gMsg_ID_20332, RCID_ROB64);
break;
default:
if (gHitCount >= 100) {
Radio_PlayMessage(gMsg_ID_20261, RCID_PEPPY);
} else {
func_80048AC0(3);
}
break;
}
break;
case 1018:
if (gTeamShields[1] != -1) {
if (gTeamShields[1] == 0) {
switch (gTeamShields[1]) {
case 0:
Radio_PlayMessage(gMsg_ID_20340, RCID_ROB64);
break;
}
} else {
Radio_PlayMessage(gMsg_ID_20331, RCID_ROB64);
break;
}
if (gHitCount >= 100) {
Radio_PlayMessage(gMsg_ID_20262, RCID_FALCO);
} else {
func_80048AC0(1);
case -1:
Radio_PlayMessage(gMsg_ID_20331, RCID_ROB64);
break;
default:
if (gHitCount >= 100) {
Radio_PlayMessage(gMsg_ID_20262, RCID_FALCO);
} else {
func_80048AC0(1);
}
break;
}
break;
case 1163: