Files
mk64/src/code_802B0210.c
T
Tyler McGavran 84cb46c0e5 Update and add some header files (#205)
* Update header files for main, memory and math_util

* Required updating func_802A82E4 to keep the match

Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
2022-05-20 18:51:56 -07:00

2500 lines
80 KiB
C

#include <ultra64.h>
#include <macros.h>
#include <defines.h>
#include <actor_types.h>
#include "math_util.h"
#include "code_802B0210.h"
void func_802B0210(UnkActorInner *arg0, UnkActorInner *arg1) {
arg1->unk30 = arg0->unk30;
arg1->unk32 = arg0->unk32;
arg1->unk34 = arg0->unk34;
arg1->unk36 = arg0->unk36;
arg1->unk38 = arg0->unk38;
arg1->unk3A = arg0->unk3A;
arg1->unk3C = arg0->unk3C;
arg1->unk40 = arg0->unk40;
arg1->unk44 = arg0->unk44;
vec3f_copy(arg1->unk48, arg0->unk48);
vec3f_copy(arg1->unk54, arg0->unk54);
vec3f_copy(arg1->unk60, arg0->unk60);
}
void func_802B02B4(struct ShellActor *shell, s32 shellType) {
struct TripleShellParent *parent = &gActorList[shell->parentIndex];
parent->shellsAvailable--;
switch((s16)shell->shellId) {
case 0:
parent->shellIndices[0] = -1.0f;
break;
case 1:
parent->shellIndices[1] = -1.0f;
break;
case 2:
parent->shellIndices[2] = -1.0f;
break;
}
shell->flags = 0x8000; // bitflag
shell->rotAngle = 0;
shell->velocity[1] = 3.0f;
shell->someTimer = 60;
switch(shellType) {
case ACTOR_GREEN_SHELL:
shell->state = 5;
break;
case ACTOR_RED_SHELL:
shell->state = 7;
break;
}
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f64 D_802B9E80;
extern f64 D_802B9E88;
extern f64 D_802B9E90;
void func_802B039C(void *arg0) {
f32 temp_f6;
s32 temp_v0;
f32 phi_f6;
arg0->unk6 = 1;
arg0->unk_04 = 0xB4;
arg0->velocity = (random_int(0xC8) - 0x64) * D_802B9E80;
temp_v0 = random_int(0xC8);
temp_f6 = temp_v0;
phi_f6 = temp_f6;
if (temp_v0 < 0) {
phi_f6 = temp_f6 + 4294967296.0f;
}
arg0->unk28 = phi_f6 * D_802B9E88;
arg0->unk2C = (random_int(0xC8) - 0x64) * D_802B9E90;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B039C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_802B039C(void *); // extern
extern ? gActorList;
void func_802B0464(s16 arg0) {
s16 temp_s0;
void *temp_a0;
s16 phi_s0;
phi_s0 = arg0;
if (arg0 != -1) {
do {
temp_a0 = &gActorList + (phi_s0 * 0x70);
func_802B039C(temp_a0);
temp_s0 = temp_a0->unk14;
phi_s0 = temp_s0;
} while (temp_s0 != -1);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B0464.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_802B039C(void *); // extern
extern ? gActorList;
void func_802B04E8(s32 arg0, s16 arg1) {
s16 temp_s0;
void *temp_a0;
s16 phi_s0;
phi_s0 = arg1;
if (arg1 != -1) {
do {
temp_a0 = &gActorList + (phi_s0 * 0x70);
func_802B039C(temp_a0);
temp_s0 = temp_a0->unk12;
phi_s0 = temp_s0;
} while (temp_s0 != -1);
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B04E8.s")
#endif
void func_802B0570(struct BananaActor *banana) {
struct BananaBunchParent *temp_v0_2;
func_802B0464(banana->youngerIndex);
func_802B04E8(banana, banana->elderIndex);
if ((gPlayers[banana->playerId].unk_000 & 0x4000) != 0) {
func_800C9060(banana->playerId & 0xFF, 0x19019053);
}
banana->flags = -0x8000;
banana->unk_04 = 0x003C;
banana->state = 5;
banana->velocity[1] = 3.0f;
temp_v0_2 = &gActorList[banana->parentIndex];
temp_v0_2->bananaIndices[0] = -1;
temp_v0_2->bananaIndices[1] = -1;
temp_v0_2->bananaIndices[2] = -1;
temp_v0_2->bananaIndices[3] = -1;
temp_v0_2->bananaIndices[4] = -1;
}
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
void func_802B0648(struct BananaBunchParent *banana_bunch) {
s16 temp_v0;
s16 temp_v0_2;
s16 temp_v0_3;
s16 temp_v0_4;
s16 temp_v0_5;
s16 temp_v0_6;
s32 temp_lo;
s32 temp_lo_2;
s32 temp_lo_3;
s32 temp_lo_4;
s32 temp_lo_5;
void *phi_v1;
temp_v0 = banana_bunch->bananaIndices[4];
banana_bunch->bananasAvailable += -1;
if (temp_v0 != -1) {
temp_lo = temp_v0 * 0x70;
banana_bunch->bananaIndices[4] = -1;
phi_v1 = gActorList + temp_lo;
goto block_10;
}
temp_v0_2 = banana_bunch->bananaIndices[3];
if (temp_v0_2 != -1) {
temp_lo_2 = temp_v0_2 * 0x70;
banana_bunch->bananaIndices[3] = -1;
phi_v1 = gActorList + temp_lo_2;
goto block_10;
}
temp_v0_3 = banana_bunch->bananaIndices[2];
if (temp_v0_3 != -1) {
temp_lo_3 = temp_v0_3 * 0x70;
banana_bunch->bananaIndices[2] = -1;
phi_v1 = gActorList + temp_lo_3;
goto block_10;
}
temp_v0_4 = banana_bunch->bananaIndices[1];
if (temp_v0_4 != -1) {
temp_lo_4 = temp_v0_4 * 0x70;
banana_bunch->bananaIndices[1] = -1;
phi_v1 = gActorList + temp_lo_4;
goto block_10;
}
temp_v0_5 = banana_bunch->bananaIndices[0];
if (temp_v0_5 != -1) {
temp_lo_5 = temp_v0_5 * 0x70;
banana_bunch->bananaIndices[0] = -1;
phi_v1 = gActorList + temp_lo_5;
block_10:
temp_v0_6 = phi_v1->unk12;
phi_v1->unk6 = 1;
phi_v1->unk_04 = 0x00B4;
phi_v1->velocity = 0.0f;
phi_v1->unk2C = 0.0f;
phi_v1->unk28 = 1.5f;
if (temp_v0_6 != -1) {
(gActorList + (temp_v0_6 * 0x70))->unk14 = -1;
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B0648.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_802B64C4(f32 *, s16); /* extern */
? vec3f_set(f32, f32 *, ?, f32, f32); /* extern */
void func_802B0788(s16 arg0, struct BananaBunchParent *banana_bunch, Player *player) {
f32 sp34;
void *sp30;
f32 temp_f0;
f32 temp_f2;
s16 temp_a0;
s16 temp_a0_2;
s16 temp_a0_3;
s16 temp_a0_4;
s16 temp_a1;
s16 temp_a3;
s32 temp_lo;
s32 temp_lo_2;
s32 temp_lo_3;
s32 temp_lo_4;
s32 temp_lo_5;
void *phi_v0;
f32 phi_f12;
f32 phi_f0;
temp_a3 = banana_bunch->bananaIndices[4];
banana_bunch->bananasAvailable += -1;
if (temp_a3 != -1) {
temp_lo = temp_a3 * 0x70;
banana_bunch->bananaIndices[4] = -1;
phi_v0 = gActorList + temp_lo;
goto block_10;
}
temp_a0 = banana_bunch->bananaIndices[3];
if (temp_a0 != -1) {
temp_lo_2 = temp_a0 * 0x70;
banana_bunch->bananaIndices[3] = -1;
phi_v0 = gActorList + temp_lo_2;
goto block_10;
}
temp_a0_2 = banana_bunch->bananaIndices[2];
if (temp_a0_2 != -1) {
temp_lo_3 = temp_a0_2 * 0x70;
banana_bunch->bananaIndices[2] = -1;
phi_v0 = gActorList + temp_lo_3;
goto block_10;
}
temp_a0_3 = banana_bunch->bananaIndices[1];
if (temp_a0_3 != -1) {
temp_lo_4 = temp_a0_3 * 0x70;
banana_bunch->bananaIndices[1] = -1;
phi_v0 = gActorList + temp_lo_4;
goto block_10;
}
temp_a0_4 = banana_bunch->bananaIndices[0];
if (temp_a0_4 != -1) {
temp_lo_5 = temp_a0_4 * 0x70;
banana_bunch->bananaIndices[0] = -1;
phi_v0 = gActorList + temp_lo_5;
block_10:
temp_a1 = phi_v0->unk12;
phi_v0->unk6 = 1;
phi_v0->unk_04 = 0x001E;
if (temp_a1 != -1) {
(gActorList + (temp_a1 * 0x70))->unk14 = -1;
}
temp_f2 = player->unk_094;
if (temp_f2 < 2.0f) {
phi_f12 = 4.0f;
phi_f0 = (((f32) arg0 - 30.0f) / 20.0f) + 1.5f;
} else {
temp_f0 = (((f32) arg0 - 30.0f) / 20.0f) + 1.5f;
phi_f12 = (temp_f2 * 0.75f) + 4.5f + temp_f0;
phi_f0 = temp_f0;
}
sp30 = phi_v0;
vec3f_set(phi_f12, &sp34, 0, phi_f0, phi_f12);
func_802B64C4(&sp34, (s16) (player->unk_02E + player->unk_0C0));
sp30->velocity = sp34;
sp30->unk28 = sp38;
sp30->unk2C = sp3C;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B0788.s")
#endif
s32 func_802B09C0(s16 bananaId) {
struct BananaActor *banana;
if (bananaId == -1) {
return 0;
}
banana = (struct BananaActor*) &gActorList[bananaId];
if (banana->state == 2) {
return 1;
}
if (banana->state == 3) {
return 1;
}
return 0;
}
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_800C9060(s32, ?); /* extern */
? destroy_actor(struct BananaBunchParent *, s32); /* extern */
? func_802B0648(struct BananaBunchParent *); /* extern */
? func_802B0788(s16, struct BananaBunchParent *, Player *, Player *); /* extern */
s32 func_802B09C0(s16, s32); /* extern */
? func_802B2914(struct BananaBunchParent *, Player *, ?, Player *); /* extern */
void update_obj_banana_bunch(struct BananaBunchParent *banana_bunch) {
Player *sp2C;
struct Controller *sp28;
s32 sp24;
Player *temp_a3;
s16 temp_a0_2;
s16 temp_v1_2;
struct Controller *temp_v0;
struct BananaActor *temp_a0;
struct BananaActor *temp_a1;
struct BananaActor *temp_a2;
struct BananaActor *temp_a3_2;
struct BananaActor *temp_t0;
u16 temp_t9;
u16 temp_v1;
s32 phi_v1;
s32 phi_v1_2;
s32 phi_v1_3;
s32 phi_v1_4;
s32 phi_v1_5;
temp_t9 = (u16) banana_bunch->state;
temp_a3 = &gPlayers[banana_bunch->playerId];
switch (temp_t9) {
case 0:
func_802B2914(banana_bunch, temp_a3, 0, temp_a3);
banana_bunch->unk_04 = 4;
banana_bunch->state = 1;
banana_bunch->bananasAvailable = 1;
return;
case 1:
banana_bunch->unk_04 += -1;
if (banana_bunch->unk_04 == 0) {
func_802B2914(banana_bunch, temp_a3, 1, temp_a3);
banana_bunch->unk_04 = 4;
banana_bunch->state = 2;
banana_bunch->bananasAvailable += 1;
return;
}
default:
return;
case 2:
banana_bunch->unk_04 += -1;
if (banana_bunch->unk_04 == 0) {
func_802B2914(banana_bunch, temp_a3, 2, temp_a3);
banana_bunch->unk_04 = 4;
banana_bunch->state = 3;
banana_bunch->bananasAvailable += 1;
return;
}
break;
case 3:
banana_bunch->unk_04 += -1;
if (banana_bunch->unk_04 == 0) {
func_802B2914(banana_bunch, temp_a3, 3, temp_a3);
banana_bunch->unk_04 = 4;
banana_bunch->state = 4;
banana_bunch->bananasAvailable += 1;
return;
}
break;
case 4:
banana_bunch->unk_04 += -1;
if (banana_bunch->unk_04 == 0) {
func_802B2914(banana_bunch, temp_a3, 4, temp_a3);
banana_bunch->unk_04 = 4;
banana_bunch->state = 5;
banana_bunch->bananasAvailable += 1;
return;
}
break;
case 5:
banana_bunch->state = 6;
temp_a0 = &gActorList[banana_bunch->bananaIndices[0]];
temp_a0->flags |= 0x5000;
temp_a1 = &gActorList[banana_bunch->bananaIndices[1]];
temp_a1->flags |= 0x5000;
temp_a2 = &gActorList[banana_bunch->bananaIndices[2]];
temp_a2->flags |= 0x5000;
temp_a3_2 = &gActorList[banana_bunch->bananaIndices[3]];
temp_a3_2->flags |= 0x5000;
temp_t0 = &gActorList[banana_bunch->bananaIndices[4]];
temp_t0->flags |= 0x5000;
return;
case 6:
sp2C = temp_a3;
sp24 = 0;
phi_v1 = sp24;
if (func_802B09C0(banana_bunch->bananaIndices[0]) == 1) {
phi_v1 = 1;
}
sp2C = temp_a3;
sp24 = phi_v1;
phi_v1_2 = phi_v1;
if (func_802B09C0(banana_bunch->bananaIndices[1], 1) == 1) {
phi_v1_2 = phi_v1 + 1;
}
sp2C = temp_a3;
sp24 = phi_v1_2;
phi_v1_3 = phi_v1_2;
if (func_802B09C0(banana_bunch->bananaIndices[2], 1) == 1) {
phi_v1_3 = phi_v1_2 + 1;
}
sp2C = temp_a3;
sp24 = phi_v1_3;
phi_v1_4 = phi_v1_3;
if (func_802B09C0(banana_bunch->bananaIndices[3], 1) == 1) {
phi_v1_4 = phi_v1_3 + 1;
}
sp2C = temp_a3;
sp24 = phi_v1_4;
phi_v1_5 = phi_v1_4;
if (func_802B09C0(banana_bunch->bananaIndices[4], 1) == 1) {
phi_v1_5 = phi_v1_4 + 1;
}
if (phi_v1_5 == 0) {
sp2C = temp_a3;
destroy_actor(banana_bunch, 1);
temp_a3->unk_00C &= 0xFFFBFFFF;
return;
}
if (((temp_a3->unk_000 & 0x4000) != 0) && (temp_v0 = &gControllers[banana_bunch->playerId], temp_v1 = temp_v0->buttonPressed, ((temp_v1 & 0x2000) != 0))) {
temp_v0->buttonPressed = temp_v1 & 0xDFFF;
sp2C = temp_a3;
sp28 = temp_v0;
func_800C9060(((s32) (temp_a3 - gPlayerOne) / 3544) & 0xFF, 0x19008012);
temp_a0_2 = temp_v0->rawStickY;
if (temp_a0_2 >= 0x1F) {
temp_v1_2 = temp_v0->rawStickX;
if ((temp_v1_2 < 0x28) && (temp_v1_2 >= -0x27)) {
func_802B0788(temp_a0_2, banana_bunch, temp_a3, temp_a3);
return;
}
}
func_802B0648(banana_bunch);
}
break;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_banana_bunch.s")
#endif
s32 func_802B0E14(s16 arg0) {
struct ShellActor *temp;
if (arg0 < 0) {
return 0;
}
temp = (struct ShellActor*) &gActorList[arg0];
if (temp->type == 7) {
if (temp->state == 4) {
return 1;
}
return 0;
}
if (temp->state == 6) {
return 1;
}
return 0;
}
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_8000ED80(s32); /* extern */
? func_8000EDC8(s32); /* extern */
? func_800C9060(u8, ?); /* extern */
? func_800C90F4(u8, s32); /* extern */
? destroy_actor(struct TripleShellParent *); /* extern */
s32 func_802B0E14(s16, s16); /* extern */
s32 func_802B19EC(struct TripleShellParent *, Player *, s16, ?); /* extern */
? func_802B64C4(f32 *, s16); /* extern */
void update_obj_triple_shell(struct TripleShellParent *actor, s16 arg1) {
s16 sp4E;
struct ShellActor *sp44;
f32 sp40;
f32 sp3C;
f32 sp38;
s16 sp32;
Player *sp28;
Player *temp_v1_3;
Player *temp_v1_5;
Player *temp_v1_7;
f32 *temp_a0;
f32 *temp_a0_2;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
s16 temp_t0;
s16 temp_t8;
s16 temp_v0;
s16 temp_v1_2;
s16 temp_v1_4;
s16 temp_v1_6;
s32 temp_v1;
struct Controller *temp_v0_5;
struct ShellActor *temp_v0_2;
struct ShellActor *temp_v0_3;
struct ShellActor *temp_v0_4;
struct ShellActor *temp_v0_6;
struct ShellActor *temp_v0_7;
struct ShellActor *temp_v0_8;
u16 temp_t9;
s16 phi_v1;
s16 phi_v1_2;
s16 phi_v1_3;
temp_v0 = actor->rotVelocity;
temp_t9 = (u16) actor->state;
temp_t8 = actor->rotAngle + temp_v0;
temp_t0 = actor->playerId;
actor->rotAngle = temp_t8;
temp_v1 = temp_t8 & 0xFFFF;
switch (temp_t9) {
case 0:
sp4E = temp_t0;
if (func_802B19EC(actor, &gPlayers[temp_t0], arg1, 0) != -1) {
func_800C9060(temp_t0 & 0xFF, 0x19008012);
actor->shellsAvailable += 1;
}
actor->state = 1;
return;
case 1:
if (temp_v0 > 0) {
if (temp_v1 >= 0xD556) {
sp4E = temp_t0;
if (func_802B19EC(actor, &gPlayers[temp_t0], arg1, 1) != -1) {
func_800C9060(temp_t0 & 0xFF, 0x19008012);
actor->shellsAvailable += 1;
}
actor->state = 2;
return;
}
} else {
if (temp_v1 < 0x2AAA) {
sp4E = temp_t0;
if (func_802B19EC(actor, &gPlayers[temp_t0], arg1, 1) != -1) {
func_800C9060(temp_t0 & 0xFF, 0x19008012);
actor->shellsAvailable += 1;
}
actor->state = 2;
return;
}
default:
return;
}
break;
case 2:
if (temp_v0 > 0) {
if ((temp_v1 >= 0x2AAB) && (temp_v1 < 0x31C7)) {
sp4E = temp_t0;
if (func_802B19EC(actor, &gPlayers[temp_t0], arg1, 2) != -1) {
func_800C9060(temp_t0 & 0xFF, 0x19008012);
actor->shellsAvailable += 1;
}
actor->state = 3;
return;
}
} else if ((temp_v1 < 0xD555) && (temp_v1 >= 0xCE39)) {
sp4E = temp_t0;
if (func_802B19EC(actor, &gPlayers[temp_t0], arg1, 2) != -1) {
func_800C9060(temp_t0 & 0xFF, 0x19008012);
actor->shellsAvailable += 1;
}
actor->state = 3;
return;
}
break;
case 3:
actor->state = 4;
temp_v0_2 = &gActorList[(s16) (s32) actor->shellIndices[0]];
temp_v0_2->flags |= 0x4000;
temp_v0_3 = &gActorList[(s16) (s32) actor->shellIndices[1]];
temp_v0_3->flags |= 0x4000;
temp_v0_4 = &gActorList[(s16) (s32) actor->shellIndices[2]];
temp_v0_4->flags |= 0x4000;
return;
case 4:
sp4E = temp_t0;
sp32 = 0;
phi_v1 = sp32;
if (func_802B0E14((s16) (s32) actor->shellIndices[0], arg1) == 1) {
phi_v1 = 1;
} else {
actor->shellIndices[0] = -1.0f;
}
sp4E = temp_t0;
sp32 = phi_v1;
phi_v1_2 = phi_v1;
if (func_802B0E14((s16) (s32) actor->shellIndices[1]) == 1) {
phi_v1_2 = (s16) (phi_v1 + 1);
} else {
actor->shellIndices[1] = -1.0f;
}
sp4E = temp_t0;
sp32 = phi_v1_2;
phi_v1_3 = phi_v1_2;
if (func_802B0E14((s16) (s32) actor->shellIndices[2]) == 1) {
phi_v1_3 = (s16) (phi_v1_2 + 1);
} else {
actor->shellIndices[2] = -1.0f;
}
if (phi_v1_3 == 0) {
destroy_actor(actor);
return;
}
temp_v0_5 = &gControllers[actor->playerId];
if ((temp_v0_5->buttonPressed & 0x2000) != 0) {
actor->unk_08 += 1.0f;
temp_v0_5->buttonPressed &= 0xDFFF;
}
if (actor->unk_08 > 0.0f) {
temp_f0 = actor->shellIndices[0];
if ((temp_f0 > 0.0f) && ((temp_v0_6 = &gActorList[(s16) (s32) temp_f0], temp_v1_2 = temp_v0_6->rotAngle, temp_a0 = &sp38, ((temp_v1_2 < 0x38E) != 0)) || (temp_v1_2 >= -0x38D))) {
temp_v1_3 = &gPlayers[temp_t0];
sp38 = 0.0f;
sp3C = 0.0f;
sp40 = 8.0f;
sp28 = temp_v1_3;
sp44 = temp_v0_6;
func_802B64C4(temp_a0, (s16) (temp_v1_3->unk_02E + temp_v1_3->unk_0C0));
temp_v0_6->velocity[0] = sp38;
temp_v0_6->velocity[1] = sp3C;
temp_v0_6->state = 2;
temp_v0_6->parentIndex = 0x001E;
temp_v0_6->velocity[2] = sp40;
func_800C9060(actor->unk15, 0x19008004);
func_800C90F4(actor->unk15, (temp_v1_3->characterId * 0x10) + 0x29008000);
if (actor->type == 0x0016) {
func_8000ED80((s32) actor->shellIndices[0]);
} else {
func_8000EDC8((s32) actor->shellIndices[0]);
}
actor->shellIndices[0] = -1.0f;
actor->shellsAvailable += -1;
actor->unk_08 -= 1.0f;
return;
}
temp_f0_2 = actor->shellIndices[1];
if ((temp_f0_2 > 0.0f) && ((temp_v0_7 = &gActorList[(s16) (s32) temp_f0_2], temp_v1_4 = temp_v0_7->rotAngle, ((temp_v1_4 < 0xAA1) != 0)) || (temp_v1_4 >= 0x38F))) {
temp_v1_5 = &gPlayers[temp_t0];
sp38 = 0.0f;
sp3C = 0.0f;
sp40 = 8.0f;
sp28 = temp_v1_5;
sp44 = temp_v0_7;
func_802B64C4(&sp38, (s16) (temp_v1_5->unk_02E + temp_v1_5->unk_0C0));
sp44->velocity[0] = sp38;
sp44->velocity[1] = sp3C;
sp44->state = 2;
sp44->parentIndex = 0x001E;
sp44->velocity[2] = sp40;
func_800C90F4(actor->unk15, (sp28->characterId * 0x10) + 0x29008000);
func_800C9060(actor->unk15, 0x19008004);
if (actor->type == 0x0016) {
func_8000ED80((s32) actor->shellIndices[1]);
} else {
func_8000EDC8((s32) actor->shellIndices[1]);
}
actor->shellIndices[1] = -1.0f;
actor->shellsAvailable += -1;
actor->unk_08 -= 1.0f;
return;
}
temp_f0_3 = actor->shellIndices[2];
if ((temp_f0_3 > 0.0f) && ((temp_v0_8 = &gActorList[(s16) (s32) temp_f0_3], temp_v1_6 = temp_v0_8->rotAngle, temp_a0_2 = &sp38, ((temp_v1_6 < -0x38E) != 0)) || (temp_v1_6 >= -0x71B))) {
temp_v1_7 = &gPlayers[temp_t0];
sp38 = 0.0f;
sp3C = 0.0f;
sp40 = 8.0f;
sp28 = temp_v1_7;
sp44 = temp_v0_8;
func_802B64C4(temp_a0_2, (s16) (temp_v1_7->unk_02E + temp_v1_7->unk_0C0));
temp_v0_8->velocity[0] = sp38;
temp_v0_8->velocity[1] = sp3C;
temp_v0_8->state = 2;
temp_v0_8->parentIndex = 0x001E;
temp_v0_8->velocity[2] = sp40;
func_800C9060(actor->unk15, 0x19008004);
func_800C90F4(actor->unk15, (temp_v1_7->characterId * 0x10) + 0x29008000);
if (actor->type == 0x0016) {
func_8000ED80((s32) actor->shellIndices[2]);
} else {
func_8000EDC8((s32) actor->shellIndices[2]);
}
actor->shellIndices[2] = -1.0f;
actor->shellsAvailable += -1;
actor->unk_08 -= 1.0f;
}
}
break;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_triple_shell.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8029EC88(? *, ? *, ? *, ?); // extern
extern ? gActorList;
extern ? D_802B9140;
extern ? D_802B914C;
extern ? D_802B9154;
s16 func_802B17F4(void *arg0) {
? sp34;
? sp2C;
? sp20;
s16 temp_v0;
void *temp_v1;
sp34.unk0 = D_802B9140.unk0;
sp34.unk4 = D_802B9140.unk4;
sp34.unk8 = D_802B9140.unk8;
sp2C.unk0 = D_802B914C.unk0;
sp2C.unk4 = D_802B914C.unk4;
sp20.unk0 = D_802B9154.unk0;
sp20.unk4 = D_802B9154.unk4;
sp20.unk8 = D_802B9154.unk8;
temp_v0 = func_8029EC88(&sp20, &sp2C, &sp34, 0xE);
if (temp_v0 < 0) {
return temp_v0;
}
temp_v1 = (temp_v0 * 0x70) + &gActorList;
temp_v1->unk6 = 0;
temp_v1->rot = (arg0 - gPlayerOne) / 0xDD8;
arg0->unkC = arg0->unkC | 0x40000;
return temp_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B17F4.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8029EC88(? *, ? *, ? *, s16); // extern
extern ? gActorList;
extern ? D_802B9160;
extern ? D_802B916C;
extern ? D_802B9174;
s16 func_802B18E4(s32 arg0, s16 arg1) {
? sp34;
? sp2C;
? sp20;
s16 temp_v0;
void *temp_v1;
sp34.unk0 = D_802B9160.unk0;
sp34.unk4 = D_802B9160.unk4;
sp34.unk8 = D_802B9160.unk8;
sp2C.unk0 = D_802B916C.unk0;
sp2C.unk4 = D_802B916C.unk4;
sp20.unk0 = D_802B9174.unk0;
sp20.unk4 = D_802B9174.unk4;
sp20.unk8 = D_802B9174.unk8;
temp_v0 = func_8029EC88(&sp20, &sp2C, &sp34, arg1);
if (temp_v0 < 0) {
return temp_v0;
}
temp_v1 = (temp_v0 * 0x70) + &gActorList;
temp_v1->unk6 = 0;
temp_v1->rot = 0x5B0;
temp_v1->unk12 = -0x8000;
temp_v1->unk14 = (arg0 - gPlayerOne) / 0xDD8;
temp_v1->unk_04 = 0;
temp_v1->unk_08 = 0.0f;
return temp_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B18E4.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
s16 func_8029EC88(f32 *, ? *, ? *, s16); /* extern */
? func_802AD950(void *, f32, s32, s32, f32, f32, f32, f32); /* extern */
? func_802B4E30(void *); /* extern */
? func_802B63B8(f32 *, f32 *); /* extern */
static ? D_802B9180; /* unable to generate initializer */
static ? D_802B918C; /* unable to generate initializer */
s32 func_802B19EC(struct TripleShellParent *arg0, Player *player, s16 arg2, u16 arg3) {
? sp54;
? sp4C;
f32 sp48;
f32 sp44;
f32 sp40;
f32 *temp_a0;
f32 *temp_a0_2;
f32 *temp_a1;
s16 temp_v0;
s32 temp_t3;
void *temp_s0;
sp54.unk0 = (s32) D_802B9180.unk0;
sp54.unk4 = (s32) D_802B9180.unk4;
sp54.unk8 = (s32) D_802B9180.unk8;
temp_a1 = player->unk_174;
temp_a0 = &sp40;
sp4C.unk0 = (s32) D_802B918C.unk0;
sp4C.unk4 = (u16) D_802B918C.unk4;
sp40 = 0.0f;
sp44 = -temp_a1->unk-104;
sp48 = temp_a1->unk-104 - 4.0f;
func_802B63B8(temp_a0, temp_a1);
temp_a0_2 = &sp40;
sp40 = 0.0f + player->pos[0];
sp44 += player->pos[1];
sp48 += player->pos[2];
temp_v0 = func_8029EC88(temp_a0_2, &sp4C, &sp54, arg2);
if (temp_v0 < 0) {
arg0->shellIndices[arg3] = -1.0f;
return -1;
}
temp_t3 = temp_v0 * 7;
sp40 = player->pos[0];
temp_s0 = (temp_t3 * 0x10) + gActorList;
sp44 = player->pos[1];
sp48 = player->pos[2];
func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48);
func_802B4E30(temp_s0);
temp_s0->unk2 = -0x7000;
switch (arg2) { /* irregular */
case 7:
temp_s0->unk6 = 4;
break;
case 8:
temp_s0->unk6 = 6;
break;
}
temp_s0->rot = 0;
temp_s0->unk12 = -0x8000;
temp_s0->unk14 = (s16) ((s32) (player - gPlayerOne) / 3544);
temp_s0->unk_04 = (s16) ((s32) (arg0 - gActorList) / 112);
temp_s0->unk_08 = (f32) arg3;
arg0->shellIndices[arg3] = (f32) ((s32) (temp_s0 - gActorList) / 112);
return 1;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B19EC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8029EC88(f32 *, ? *, ? *, ?); // extern
? func_802AD950(void *, f32, s32, s32, f32, f32, f32, f32); // extern
? func_802B4E30(void *); // extern
? func_802B63B8(f32 *, s32); // extern
extern ? gActorList;
extern ? D_802B9194;
extern ? D_802B91A0;
s16 func_802B1C9C(void *arg0) {
? sp54;
? sp4C;
f32 sp48;
f32 sp44;
f32 sp40;
s16 sp3E;
f32 *temp_a0;
s16 temp_v0;
s16 temp_v1;
s32 temp_t8;
void *temp_s0;
sp54.unk0 = D_802B9194.unk0;
sp54.unk4 = D_802B9194.unk4;
sp54.unk8 = D_802B9194.unk8;
sp4C.unk0 = D_802B91A0.unk0;
sp4C.unk4 = D_802B91A0.unk4;
sp40 = 0.0f;
sp44 = -arg0->unk70;
sp48 = arg0->unk70 - 4.0f;
func_802B63B8(&sp40, arg0 + 0x174);
temp_a0 = &sp40;
sp40 = 0.0f + arg0->unk14;
sp44 += arg0->pos;
sp48 += arg0->unk1C;
temp_v0 = func_8029EC88(temp_a0, &sp4C, &sp54, 7);
temp_v1 = temp_v0;
if (temp_v0 < 0) {
return temp_v0;
}
temp_t8 = temp_v1 * 7;
sp40 = arg0->unk14;
temp_s0 = (temp_t8 * 0x10) + &gActorList;
sp44 = arg0->pos;
sp48 = arg0->unk1C;
sp3E = temp_v1;
func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48);
func_802B4E30(temp_s0);
temp_s0->unk6 = 0;
temp_s0->rot = 0;
temp_s0->unk12 = -0x8000;
temp_s0->unk14 = (arg0 - gPlayerOne) / 0xDD8;
return sp3E;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B1C9C.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8029EC88(f32 *, ? *, ? *, ?); // extern
? func_802AD950(void *, f32, s32, s32, f32, f32, f32, f32); // extern
? func_802B4E30(void *); // extern
? func_802B63B8(f32 *, s32); // extern
extern ? gActorList;
extern ? D_802B91A8;
extern ? D_802B91B4;
s16 func_802B1E48(void *arg0) {
? sp54;
? sp4C;
f32 sp48;
f32 sp44;
f32 sp40;
s16 sp3E;
f32 *temp_a0;
s16 temp_v0;
s16 temp_v1;
s32 temp_t8;
void *temp_s0;
sp54.unk0 = D_802B91A8.unk0;
sp54.unk4 = D_802B91A8.unk4;
sp54.unk8 = D_802B91A8.unk8;
sp4C.unk0 = D_802B91B4.unk0;
sp4C.unk4 = D_802B91B4.unk4;
sp40 = 0.0f;
sp44 = -arg0->unk70;
sp48 = arg0->unk70 - 4.0f;
func_802B63B8(&sp40, arg0 + 0x174);
temp_a0 = &sp40;
sp40 = 0.0f + arg0->unk14;
sp44 += arg0->pos;
sp48 += arg0->unk1C;
temp_v0 = func_8029EC88(temp_a0, &sp4C, &sp54, 8);
temp_v1 = temp_v0;
if (temp_v0 < 0) {
return temp_v0;
}
temp_t8 = temp_v1 * 7;
sp40 = arg0->unk14;
temp_s0 = (temp_t8 * 0x10) + &gActorList;
sp44 = arg0->pos;
sp48 = arg0->unk1C;
sp3E = temp_v1;
func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, sp40, sp44, sp48);
func_802B4E30(temp_s0);
temp_s0->unk6 = 0;
temp_s0->rot = 0;
temp_s0->unk12 = arg0->unk2E - 0x8000;
temp_s0->unk14 = (arg0 - gPlayerOne) / 0xDD8;
return sp3E;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B1E48.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_802B1E48(); // extern
extern ? gActorList;
void func_802B1FFC(void) {
*(&gActorList + (func_802B1E48() * 0x70)) = 0x2A;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B1FFC.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_800C9060(s32, ?, u16); /* extern */
? destroy_actor(struct BananaActor *); /* extern */
? func_8029FDC8(f32, struct BananaActor *); /* extern */
? func_802ADDC8(f32, UnkActorInner *, UnkActorInner *, f32, f32, f32, f32); /* extern */
? func_802B4E30(struct BananaActor *); /* extern */
? func_802B64C4(f32 *, s16); /* extern */
? vec3f_set(f32, f32 *, ?, f32, f32); /* extern */
extern s16 D_8015F6E8;
extern s16 D_8015F6EA;
extern s16 D_8015F6EE;
extern s16 D_8015F6F0;
extern s16 D_8015F6F2;
extern struct Controller *gControllerOne;
static f32 D_802B9EE0 = 0.2f;
static f32 D_802B9EE4 = 0.15f;
static f32 D_802B9EE8 = 0.2f;
static f32 D_802B9EEC = 0.2f;
static f32 D_802B9EF0 = 0.3f;
void update_obj_banana(struct BananaActor *banana) {
Player *sp88;
struct Actor *sp84;
struct Controller *sp80;
f32 sp7C;
f32 sp78;
f32 sp74;
f32 sp70;
f32 sp6C;
f32 sp68;
f32 sp48;
f32 sp44;
f32 sp40;
f32 sp3C;
f32 sp38;
f32 sp34;
Player *temp_v0;
f32 temp_f0;
f32 temp_f0_10;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f0_5;
f32 temp_f0_6;
f32 temp_f0_7;
f32 temp_f0_8;
f32 temp_f0_9;
f32 temp_f10;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f12_3;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f14_4;
f32 temp_f14_5;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f16_3;
f32 temp_f18;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f2_4;
f32 temp_f2_5;
s16 temp_a0;
s16 temp_v0_2;
struct Actor *temp_v0_3;
u16 temp_a2;
u16 temp_t9;
f32 phi_f6;
UnkActorInner *phi_f14;
struct Controller *phi_v1;
f32 phi_f12;
f32 phi_f8;
UnkActorInner *phi_f14_2;
temp_t9 = (u16) banana->state;
temp_v0 = &gPlayers[banana->playerId];
switch (temp_t9) {
case 0:
temp_f2 = temp_v0->pos[0] - banana->pos[0];
temp_f14 = temp_v0->pos[1] - banana->pos[1];
sp48 = temp_f2;
temp_f16 = temp_v0->pos[2] - banana->pos[2];
sp44 = temp_f14;
sp88 = temp_v0;
sp40 = temp_f16;
temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14) + (temp_f16 * temp_f16)) / 10.0f;
phi_f14 = (bitwise UnkActorInner *) temp_f14;
if (temp_f12 == 0.0f) {
temp_f0 = D_802B9EE0;
banana->pos[0] = temp_v0->pos[0] + temp_f0;
banana->pos[1] = temp_v0->pos[1] + temp_f0;
phi_f6 = temp_v0->pos[2] + temp_f0;
} else {
temp_f14_2 = temp_f14 / temp_f12;
banana->pos[0] = temp_v0->pos[0] - (temp_f2 / temp_f12);
banana->pos[1] = (temp_v0->pos[1] - temp_f14_2) - 2.0f;
phi_f6 = temp_v0->pos[2] - (temp_f16 / temp_f12);
phi_f14 = (bitwise UnkActorInner *) temp_f14_2;
}
banana->pos[2] = phi_f6;
sp88 = temp_v0;
func_802ADDC8(temp_f12, phi_f14, &banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
func_802B4E30(banana);
if ((temp_v0->unk_000 & 0x4000) != 0) {
if (D_800DC51C != 0) {
phi_v1 = gControllerOne;
} else {
phi_v1 = &gControllers[banana->playerId];
}
temp_a2 = phi_v1->buttonDepressed;
if ((temp_a2 & 0x2000) != 0) {
phi_v1->buttonDepressed = temp_a2 & 0xDFFF;
banana->state = 1;
banana->unk_04 = 0x00B4;
temp_v0->unk_00C &= 0xFFFBFFFF;
sp80 = phi_v1;
sp88 = temp_v0;
func_800C9060(((s32) (temp_v0 - gPlayerOne) / 3544) & 0xFF, 0x19008012, temp_a2);
temp_f0_2 = (f32) phi_v1->rawStickY;
if (temp_f0_2 > 30.0f) {
temp_a0 = phi_v1->rawStickX;
if ((temp_a0 < 0xA) && (temp_a0 >= -9)) {
temp_f2_2 = temp_v0->unk_094;
temp_f0_3 = ((temp_f0_2 - 30.0f) / 20.0f) + 0.5f;
if (temp_f2_2 < 2.0f) {
phi_f12 = 4.0f;
} else {
phi_f12 = (temp_f2_2 * 0.75f) + 3.5f + temp_f0_3;
}
sp88 = temp_v0;
vec3f_set(phi_f12, &sp68, 0, temp_f0_3, phi_f12);
func_802B64C4(&sp68, (s16) (sp88->unk_02E + sp88->unk_0C0));
banana->velocity[0] = sp68;
banana->velocity[1] = sp6C;
banana->velocity[2] = sp70;
return;
}
}
banana->velocity[0] = 0.0f;
banana->velocity[2] = 0.0f;
banana->velocity[1] = 1.5f;
return;
}
} else {
default:
return;
}
break;
case 1:
temp_v0_2 = banana->unk_04;
if (temp_v0_2 != 0) {
banana->unk_04 = temp_v0_2 - 1;
if (banana->unk_04 == 0) {
banana->flags &= 0xEFFF;
}
}
temp_f0_4 = banana->velocity[1];
banana->pos[0] += banana->velocity[0];
banana->pos[2] += banana->velocity[2];
if (temp_f0_4 > -1.0f) {
banana->velocity[1] = temp_f0_4 - D_802B9EE4;
}
temp_f12_2 = banana->pos[2];
banana->pos[1] += banana->velocity[1];
if ((temp_f12_2 < (f32) D_8015F6F2) || ((f32) D_8015F6F0 < temp_f12_2) || (temp_f0_5 = banana->pos[0], (temp_f0_5 < (f32) D_8015F6EA)) || ((f32) D_8015F6E8 < temp_f0_5) || (temp_f2_3 = banana->pos[1], (temp_f2_3 < (f32) D_8015F6EE))) {
func_8029FDC8(temp_f12_2, banana);
return;
}
func_802ADDC8(temp_f12_2, &banana->unk30, (bitwise UnkActorInner *) (banana->boundingBoxSize + 1.0f), temp_f0_5, temp_f2_3, temp_f12_2);
banana->unk30.unk34 = 1;
if (((1U & 0xFFFF) != 0) && (banana->unk30.unk44 < 0.0f)) {
sp74 = -banana->unk30.unk60[0];
sp78 = -banana->unk30.unk60[1];
sp7C = -banana->unk30.unk60[2];
temp_f0_6 = banana->unk30.unk44;
banana->pos[0] += sp74 * temp_f0_6;
banana->pos[1] += sp78 * temp_f0_6;
banana->flags &= 0xEFFF;
banana->state = 4;
banana->pos[2] += sp7C * temp_f0_6;
return;
}
break;
case 2:
sp68 = 0.0f;
sp6C = 0.0f;
sp70 = -5.0f;
sp88 = temp_v0;
func_802B64C4(&sp68, (s16) (temp_v0->unk_02E + temp_v0->unk_0C0));
temp_f18 = sp68 + sp88->pos[0];
temp_f0_7 = sp6C + sp88->pos[1];
temp_f10 = sp70 + sp88->pos[2];
sp34 = temp_f10;
temp_f2_4 = temp_f18 - banana->pos[0];
sp3C = temp_f18;
sp38 = temp_f0_7;
temp_f14_3 = temp_f0_7 - banana->pos[1];
sp48 = temp_f2_4;
temp_f16_2 = temp_f10 - banana->pos[2];
sp44 = temp_f14_3;
sp40 = temp_f16_2;
temp_f0_8 = sqrtf((temp_f2_4 * temp_f2_4) + (temp_f14_3 * temp_f14_3) + (temp_f16_2 * temp_f16_2));
if (temp_f0_8 == 0.0f) {
temp_f0_9 = D_802B9EE8;
banana->pos[0] = sp88->pos[0] + temp_f0_9;
banana->pos[1] = sp88->pos[1] + temp_f0_9;
banana->pos[2] = sp88->pos[2] + temp_f0_9;
} else {
banana->pos[0] = sp68 + (temp_f18 - (temp_f2_4 / temp_f0_8));
banana->pos[1] = (sp38 - (temp_f14_3 / temp_f0_8)) - 2.0f;
banana->pos[2] = sp34 - (temp_f16_2 / temp_f0_8);
}
func_802ADDC8((bitwise f32) &banana->unk30, (bitwise UnkActorInner *) (banana->boundingBoxSize + 1.0f), (bitwise UnkActorInner *) banana->pos[0], banana->pos[1], banana->pos[2]);
func_802B4E30(banana);
return;
case 3:
temp_v0_3 = &gActorList[banana->elderIndex];
temp_f2_5 = temp_v0_3->pos[0] - banana->pos[0];
temp_f14_4 = temp_v0_3->pos[1] - banana->pos[1];
sp48 = temp_f2_5;
temp_f16_3 = temp_v0_3->pos[2] - banana->pos[2];
sp44 = temp_f14_4;
sp84 = temp_v0_3;
sp40 = temp_f16_3;
temp_f12_3 = sqrtf((temp_f2_5 * temp_f2_5) + (temp_f14_4 * temp_f14_4) + (temp_f16_3 * temp_f16_3)) / 5.0f;
phi_f14_2 = (bitwise UnkActorInner *) temp_f14_4;
if (temp_f12_3 == 0.0f) {
temp_f0_10 = D_802B9EEC;
banana->pos[0] = temp_v0_3->pos[0] + temp_f0_10;
banana->pos[1] = temp_v0_3->pos[1] + temp_f0_10;
phi_f8 = temp_v0_3->pos[2] + temp_f0_10;
} else {
temp_f14_5 = temp_f14_4 / temp_f12_3;
banana->pos[0] = temp_v0_3->pos[0] - (temp_f2_5 / temp_f12_3);
banana->pos[1] = (temp_v0_3->pos[1] - temp_f14_5) - 2.0f;
phi_f8 = temp_v0_3->pos[2] - (temp_f16_3 / temp_f12_3);
phi_f14_2 = (bitwise UnkActorInner *) temp_f14_5;
}
banana->pos[2] = phi_f8;
func_802ADDC8(temp_f12_3, phi_f14_2, &banana->unk30, banana->boundingBoxSize + 1.0f, banana->pos[0], banana->pos[1], banana->pos[2]);
func_802B4E30(banana);
return;
case 5:
banana->velocity[1] -= D_802B9EF0;
if (banana->velocity[1] < -5.0f) {
banana->velocity[1] = -5.0f;
}
banana->unk_04 += -1;
banana->pos[1] += banana->velocity[1];
banana->playerId += 0x16C;
banana->elderIndex += -0x5B0;
banana->youngerIndex += 0x38E;
if (banana->unk_04 == 0) {
destroy_actor(banana);
return;
}
break;
case 4:
banana->flags |= 0xC000;
banana->flags &= 0xEFFF;
break;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_banana.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_800C9060(s32, ?, Player **, s32); /* extern */
s16 func_8029EC88(f32 *, s16 *, f32 *, ?); /* extern */
? func_802AD950(void *, f32, s32, s32, f32, f32, f32, f32); /* extern */
? func_802B4E30(void *); /* extern */
? func_802B63B8(f32 *, f32 *); /* extern */
void func_802B2914(struct BananaBunchParent *banana_bunch, Player *player, s16 bananaId) {
s16 sp6E;
f32 sp68;
f32 sp64;
f32 sp60;
s16 sp5C;
s16 sp5A;
s16 sp58;
f32 sp54;
f32 sp50;
f32 sp4C;
f32 *temp_a0;
f32 *temp_a2;
s16 *temp_a1;
s16 temp_t6;
s16 temp_v0;
s32 temp_lo;
void *temp_s0;
struct BananaActor *phi_v0;
sp4C = 0.0f;
sp50 = -player->boundingBoxSize;
sp54 = -(player->boundingBoxSize + 4.0f);
func_802B63B8(&sp4C, player->unk_174);
temp_a0 = &sp4C;
temp_a1 = &sp58;
temp_a2 = &sp60;
sp4C += player->pos[0];
sp50 += player->pos[1];
sp54 += player->pos[2];
sp60 = player->unk_034[0];
sp64 = player->unk_034[1];
sp58 = 0;
sp5A = 0;
sp5C = 0;
sp68 = player->unk_034[2];
temp_v0 = func_8029EC88(temp_a0, temp_a1, temp_a2, 6);
temp_t6 = temp_v0;
if (temp_v0 >= 0) {
temp_lo = temp_t6 * 0x70;
sp4C = player->pos[0];
sp50 = player->pos[1];
temp_s0 = gActorList + temp_lo;
sp54 = player->pos[2];
sp6E = temp_t6;
func_802AD950(temp_s0 + 0x30, temp_s0->unkC + 1.0f, temp_s0->pos, temp_s0->unk1C, temp_s0->unk20, sp4C, sp50, sp54);
func_802B4E30(temp_s0);
temp_s0->unk2 = -0x7000;
temp_s0->rot = (s16) ((s32) (player - gPlayerOne) / 3544);
temp_s0->unk_08 = (s16) ((s32) (banana_bunch - gActorList) / 112);
temp_s0->unk14 = -1;
temp_s0->unk_04 = 0x0014;
temp_s0->unkA = bananaId;
switch (bananaId) {
case 0:
temp_s0->unk6 = 2;
banana_bunch->bananaIndices[0] = sp6E;
temp_s0->unk12 = -1;
break;
case 1:
temp_s0->unk6 = 3;
banana_bunch->bananaIndices[1] = sp6E;
temp_s0->unk12 = (s16) banana_bunch->bananaIndices[0];
phi_v0 = &gActorList[banana_bunch->bananaIndices[0]];
block_8:
phi_v0->youngerIndex = sp6E;
break;
case 2:
temp_s0->unk6 = 3;
banana_bunch->bananaIndices[2] = sp6E;
temp_s0->unk12 = (s16) banana_bunch->bananaIndices[1];
phi_v0 = &gActorList[banana_bunch->bananaIndices[1]];
goto block_8;
case 3:
temp_s0->unk6 = 3;
banana_bunch->bananaIndices[3] = sp6E;
temp_s0->unk12 = (s16) banana_bunch->bananaIndices[2];
phi_v0 = &gActorList[banana_bunch->bananaIndices[2]];
goto block_8;
case 4:
temp_s0->unk6 = 3;
banana_bunch->bananaIndices[4] = sp6E;
temp_s0->unk12 = (s16) banana_bunch->bananaIndices[3];
phi_v0 = &gActorList[banana_bunch->bananaIndices[3]];
goto block_8;
}
if ((player->unk_000 & 0x4000) != 0) {
func_800C9060(((s32) (player - gPlayerOne) / 3544) & 0xFF, 0x19008012, &gPlayerOne, 0xDD8);
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B2914.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8029EC88(f32 *, s16 *, f32 *, ?); // extern
? func_802B63B8(f32 *, void *); // extern
extern ? gActorList;
s16 func_802B2C40(void *arg0) {
f32 sp40;
f32 sp3C;
f32 sp38;
s16 sp34;
s16 sp32;
s16 sp30;
f32 sp2C;
f32 sp28;
f32 sp24;
f32 *temp_a0;
f32 *temp_a2;
s16 *temp_a1;
s16 temp_v0;
void *temp_v1;
sp24 = 0.0f;
sp28 = -arg0->unk70;
sp2C = -(arg0->unk70 + 4.0f);
func_802B63B8(&sp24, arg0 + 0x174);
temp_a0 = &sp24;
temp_a1 = &sp30;
temp_a2 = &sp38;
sp24 += arg0->unk14;
sp28 += arg0->pos;
sp2C += arg0->unk1C;
sp38 = arg0->unk34;
sp3C = arg0->unk38;
sp30 = 0;
sp32 = 0;
sp34 = 0;
sp40 = arg0->unk3C;
temp_v0 = func_8029EC88(temp_a0, temp_a1, temp_a2, 0xD);
if (temp_v0 < 0) {
return temp_v0;
}
temp_v1 = (temp_v0 * 0x70) + &gActorList;
temp_v1->unk6 = 0;
temp_v1->velocity = (arg0 - gPlayerOne) / 0xDD8;
arg0->unkC = arg0->unkC | 0x40000;
return temp_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B2C40.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s16 func_8029EC88(f32 *, s16 *, f32 *, ?); // extern
? func_802B63B8(f32 *, void *); // extern
extern ? gActorList;
s16 func_802B2D70(void *arg0) {
f32 sp44;
f32 sp40;
f32 sp3C;
s16 sp38;
s16 sp36;
s16 sp34;
f32 sp30;
f32 sp2C;
f32 sp28;
s32 sp20;
f32 *temp_a0;
f32 *temp_a2;
s16 *temp_a1;
s16 temp_v0;
s32 temp_t0;
void *temp_v1;
temp_t0 = ((arg0 - gPlayerOne) / 0xDD8) & 0xFFFF;
if (temp_t0 >= 8) {
return -1;
}
sp28 = 0.0f;
sp2C = -arg0->unk70;
sp20 = temp_t0;
sp30 = -(arg0->unk70 + 4.0f);
func_802B63B8(&sp28, arg0 + 0x174);
temp_a0 = &sp28;
temp_a1 = &sp34;
temp_a2 = &sp3C;
sp28 += arg0->unk14;
sp2C += arg0->pos;
sp30 += arg0->unk1C;
sp3C = arg0->unk34;
sp40 = arg0->unk38;
sp34 = 0;
sp36 = 0;
sp38 = 0;
sp44 = arg0->unk3C;
temp_v0 = func_8029EC88(temp_a0, temp_a1, temp_a2, 6);
if (temp_v0 < 0) {
return temp_v0;
}
temp_v1 = (temp_v0 * 0x70) + &gActorList;
temp_v1->rot = temp_t0;
temp_v1->unk6 = 0;
temp_v1->unk_04 = 0x14;
arg0->unkC = arg0->unkC | 0x40000;
return temp_v0;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B2D70.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_8009E5BC(); // extern
? func_800CAB4C(s32); // extern
extern ? gGfxPools;
extern ? gPlayers;
void func_802B2EBC(u16 *arg0) {
u16 *temp_a2;
void *temp_v0;
u16 *phi_a2;
? *phi_v1;
void *phi_a0;
void *phi_a1;
void *phi_v0;
func_8009E5BC();
temp_a2 = arg0;
phi_a2 = temp_a2;
if ((*temp_a2 & 0x4000) != 0) {
arg0 = temp_a2;
func_800CAB4C(((temp_a2 - gPlayerOne) / 0xDD8) & 0xFF);
phi_a2 = arg0;
}
phi_v1 = &gPlayers;
phi_a0 = &gPlayers + 0xDD8;
phi_a1 = &gPlayers + 0x1BB0;
phi_v0 = &gPlayers + 0x2988;
do {
if (phi_a2 != phi_v1) {
phi_v1->unkC = phi_v1->unkC | 0x4000;
}
phi_v1 += 0x3760;
if (phi_a2 != phi_a0) {
phi_a0->unkC = phi_a0->unkC | 0x4000;
}
phi_a0 += 0x3760;
if (phi_a2 != phi_a1) {
phi_a1->unkC = phi_a1->unkC | 0x4000;
}
if (phi_a2 != phi_v0) {
phi_v0->unkC = phi_v0->unkC | 0x4000;
}
temp_v0 = phi_v0 + 0x3760;
phi_a1 += 0x3760;
phi_v0 = temp_v0;
} while (temp_v0 != (&gGfxPools + 0x2978));
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B2EBC.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit bd0364fa19633bd6201f8007e2d0a7ed87825909
? func_8007AC9C(s32); /* extern */
? func_802B17F4(); /* extern */
? func_802B18E4(?); /* extern */
? func_802B1C9C(); /* extern */
? func_802B1E48(); /* extern */
? func_802B1FFC(); /* extern */
? func_802B2C40(); /* extern */
? func_802B2D70(); /* extern */
? func_802B2EBC(); /* extern */
void func_802B2FA0(Player *player) {
s32 sp1C;
s16 temp_t9;
sp1C = (player - gPlayerOne) / 3544;
temp_t9 = player->rot;
switch (temp_t9) {
case 3:
func_802B1C9C();
break;
case 5:
func_802B1E48();
break;
case 7:
func_802B1FFC();
break;
case 1:
func_802B2D70();
break;
case 2:
func_802B17F4();
break;
case 12:
player->unk_00C |= 0x200;
break;
case 13:
player->unk_00C |= 0x200;
break;
case 14:
player->unk_00C |= 0x200;
break;
case 15:
player->unk_00C |= 0x200;
break;
case 11:
player->unk_00C |= 0x800;
break;
case 10:
player->unk_00C |= 0x2000;
break;
case 8:
func_802B2EBC();
break;
case 9:
func_802B2C40();
break;
case 4:
func_802B18E4(0x15);
break;
case 6:
func_802B18E4(0x16);
break;
}
func_8007AC9C(sp1C);
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B2FA0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
s32 func_800910E4(? *); // extern
? func_802B2FA0(? *); // extern
extern ? *gControllerSix;
extern ? *gControllerSeven;
extern ? *gControllerEight;
extern ? gControllers;
extern ? gPlayers;
void func_802B30EC(void) {
? *temp_s2;
u16 temp_v0;
u16 temp_v0_2;
? *phi_s0;
? *phi_s1;
? *phi_s2;
phi_s0 = &gPlayers;
phi_s2 = &gControllers;
do {
phi_s1 = phi_s2;
if (func_800910E4(phi_s0) == 0) {
temp_v0 = phi_s0->unk0;
if ((temp_v0 & 0x100) != 0) {
if (((phi_s0 - gPlayerTwo) / 0xDD8) == 0) {
phi_s1 = gControllerSix;
} else if (((phi_s0 - gPlayerThree) / 0xDD8) == 0) {
phi_s1 = gControllerSeven;
} else if (((phi_s0 - gPlayerOne) / 0xDD8) == 0) {
phi_s1 = gControllerEight;
}
}
if (((temp_v0 & 0x4000) != 0) && (phi_s0->rot != 0) && ((temp_v0 & 0x2000) == 0)) {
temp_v0_2 = phi_s1->unk6;
if ((temp_v0_2 & 0x2000) != 0) {
phi_s1->unk6 = temp_v0_2 & ~0x2000;
func_802B2FA0(phi_s0);
}
}
}
temp_s2 = phi_s2 + 0x10;
phi_s0 += 0xDD8;
phi_s2 = temp_s2;
} while (temp_s2 != (&gControllers + 0x40));
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B30EC.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_8000EDC8(s32); /* extern */
? func_800C9060(u8, ?); /* extern */
? func_800C90F4(u8, s32); /* extern */
? func_800C98B8(f32 *, f32 *, ?); /* extern */
? destroy_actor(f32, struct ShellActor *); /* extern */
? func_8029FDC8(f32, struct ShellActor *); /* extern */
f32 func_802ABE30(f32, f32, f32, u16); /* extern */
? func_802AC098(UnkActorInner *, f32 *); /* extern */
? func_802AD950(UnkActorInner *, ?, f32, f32, f32, f32, f32, f32); /* extern */
? func_802B0210(UnkActorInner *, UnkActorInner *); /* extern */
? func_802B4E30(struct ShellActor *); /* extern */
? func_802B63B8(f32 *, f32 *, f32 *); /* extern */
? func_802B64C4(f32 *, s16); /* extern */
extern s16 D_8015F6E8;
extern s16 D_8015F6EA;
extern s16 D_8015F6EE;
extern s16 D_8015F6F0;
extern s16 D_8015F6F2;
static f32 D_802B9F5C = 1.2f;
static f32 D_802B9F60 = 1.2f;
static f32 D_802B9F64 = 0.3f;
void update_obj_green_shell(struct ShellActor *shell) {
f32 sp80;
f32 sp7C;
f32 sp78;
f32 sp74;
f32 sp70;
f32 sp6C;
f32 sp54;
UnkActorInner *sp34;
Player *temp_s1;
Player *temp_s1_2;
Player *temp_s1_4;
UnkActorInner *temp_a0;
f32 *temp_s1_3;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f12;
f32 temp_f14;
f32 temp_f2;
f32 temp_f2_2;
s16 temp_t4;
s16 temp_v0_2;
s16 temp_v0_3;
struct Controller *temp_v0;
struct ShellActor *temp_v0_4;
u16 temp_t3;
u16 temp_v1;
f32 phi_f2;
f32 phi_f2_2;
temp_f2 = shell->pos[2];
temp_f0 = shell->pos[0];
temp_f12 = shell->pos[1];
if ((temp_f2 < (f32) D_8015F6F2) || ((f32) D_8015F6F0 < temp_f2) || (temp_f0 < (f32) D_8015F6EA) || ((f32) D_8015F6E8 < temp_f0) || (temp_f12 < (f32) D_8015F6EE)) {
func_8029FDC8(temp_f12, shell);
}
temp_t3 = (u16) shell->state;
shell->rotVelocity += 0x71C;
switch (temp_t3) {
case 0:
temp_s1 = &gPlayers[shell->playerId];
func_802B0210(&temp_s1->unk_110, &shell->unk30);
sp6C = 0.0f;
sp70 = temp_s1->boundingBoxSize;
sp74 = -(temp_s1->boundingBoxSize + shell->boundingBoxSize + 2.0f);
func_802B63B8(&sp6C, temp_s1->unk_174);
shell->pos[0] = sp6C + temp_s1->pos[0];
temp_f14 = temp_s1->pos[1] - sp70;
shell->pos[2] = sp74 + temp_s1->pos[2];
sp54 = temp_f14;
temp_f0_2 = func_802ABE30(shell->pos[0], temp_f14, shell->pos[2], temp_s1->unk_110.unk3A);
temp_f2_2 = temp_f14 - temp_f0_2;
if ((temp_f2_2 < 5.0f) && (temp_f2_2 > -5.0f)) {
shell->pos[1] = shell->boundingBoxSize + temp_f0_2;
} else {
shell->pos[1] = temp_f14;
}
if ((temp_s1->unk_000 & 0x4000) != 0) {
temp_v0 = &gControllers[shell->playerId];
temp_v1 = temp_v0->buttonDepressed;
if ((temp_v1 & 0x2000) != 0) {
temp_v0->buttonDepressed = temp_v1 & 0xDFFF;
if (temp_v0->rawStickY < -0x2D) {
temp_f0_3 = temp_s1->unk_094;
phi_f2 = 8.0f;
if (temp_f0_3 > 8.0f) {
phi_f2 = temp_f0_3 * D_802B9F5C;
}
sp6C = 0.0f;
sp70 = 0.0f;
sp74 = -phi_f2;
func_802B64C4(&sp6C, (s16) (temp_s1->unk_02E + temp_s1->unk_0C0));
shell->velocity[0] = sp6C;
shell->velocity[1] = sp70;
shell->state = 2;
shell->velocity[2] = sp74;
func_800C9060(shell->unk15, 0x19008004);
func_800C90F4(shell->unk15, (temp_s1->characterId * 0x10) + 0x29008000);
func_8000EDC8((s32) (shell - gActorList) / 112);
return;
}
shell->state = 1;
if (temp_s1->unk_0C0 > 0) {
shell->rotAngle = 0x78E3;
return;
}
shell->rotAngle = -0x78E4;
return;
}
}
default:
return;
case 1:
temp_v0_2 = shell->rotAngle;
temp_s1_2 = &gPlayers[shell->playerId];
if (temp_v0_2 > 0) {
shell->rotAngle = temp_v0_2 - 0xE38;
if (shell->rotAngle < 0) {
shell->state = 2;
shell->parentIndex = 0x001E;
func_800C9060(shell->unk15, 0x19008004);
func_800C90F4(shell->unk15, (temp_s1_2->characterId * 0x10) + 0x29008000);
func_8000EDC8((s32) (shell - gActorList) / 112);
}
} else {
shell->rotAngle = temp_v0_2 + 0xE38;
if (shell->rotAngle > 0) {
shell->state = 2;
shell->parentIndex = 0x001E;
func_800C9060(shell->unk15, 0x19008004);
func_800C90F4(shell->unk15, (temp_s1_2->characterId * 0x10) + 0x29008000);
func_8000EDC8((s32) (shell - gActorList) / 112);
}
}
if (shell->state == 2) {
temp_f0_4 = temp_s1_2->unk_094;
phi_f2_2 = 8.0f;
if (temp_f0_4 > 8.0f) {
phi_f2_2 = temp_f0_4 * D_802B9F60;
}
sp6C = 0.0f;
sp70 = 0.0f;
sp74 = phi_f2_2;
func_802B64C4(&sp6C, (s16) (temp_s1_2->unk_02E + temp_s1_2->unk_0C0));
shell->velocity[0] = sp6C;
shell->velocity[1] = sp70;
shell->velocity[2] = sp74;
return;
}
sp6C = sins((u16) shell->rotAngle) * 6.0f;
sp70 = shell->boundingBoxSize - temp_s1_2->boundingBoxSize;
sp74 = coss((u16) shell->rotAngle) * 6.0f;
func_802B63B8(&sp6C, temp_s1_2->unk_174);
shell->pos[0] = sp6C + temp_s1_2->pos[0];
shell->pos[1] = sp70 + temp_s1_2->pos[1];
shell->pos[2] = sp74 + temp_s1_2->pos[2];
return;
case 2:
temp_v0_3 = shell->parentIndex;
if (temp_v0_3 > 0) {
shell->parentIndex = temp_v0_3 - 1;
if (shell->parentIndex == 0) {
shell->flags &= 0xEFFF;
}
}
shell->velocity[1] -= 0.5f;
if (shell->velocity[1] < -2.0f) {
shell->velocity[1] = -2.0f;
}
temp_a0 = &shell->unk30;
sp78 = shell->pos[0];
sp7C = shell->pos[1];
sp80 = shell->pos[2];
shell->pos[0] += shell->velocity[0];
shell->pos[1] += shell->velocity[1];
shell->pos[2] += shell->velocity[2];
sp34 = temp_a0;
func_802AD950(temp_a0, 0x40800000, shell->pos[0], shell->pos[1], shell->pos[2], sp78, sp7C, sp80);
func_802B4E30(shell);
temp_s1_3 = shell->velocity;
if ((shell->unk30.unk3C < 0.0f) || (shell->unk30.unk40 < 0.0f)) {
func_802AC098(temp_a0, temp_s1_3);
func_800C98B8(shell->pos, temp_s1_3, 0x19008054);
shell->flags |= 0x80;
return;
}
break;
case 4:
temp_v0_4 = &gActorList[shell->parentIndex];
temp_s1_4 = &gPlayers[shell->playerId];
if (temp_v0_4->type != 0x0015) {
func_8029FDC8((bitwise f32) shell);
return;
}
temp_t4 = shell->rotAngle + temp_v0_4->rotVelocity;
shell->rotAngle = temp_t4;
sp6C = sins(temp_t4 & 0xFFFF) * 8.0f;
sp70 = shell->boundingBoxSize - temp_s1_4->boundingBoxSize;
sp74 = coss((u16) shell->rotAngle) * 8.0f;
func_802B63B8((bitwise f32 *) 8.0f, &sp6C, temp_s1_4->unk_174);
sp78 = shell->pos[0];
sp7C = shell->pos[1];
sp80 = shell->pos[2];
shell->pos[0] = sp6C + temp_s1_4->pos[0];
shell->pos[1] = sp70 + temp_s1_4->pos[1];
shell->pos[2] = sp74 + temp_s1_4->pos[2];
func_802AD950(&shell->unk30, 0x40800000, shell->pos[0], shell->pos[1], shell->pos[2], sp78, sp7C, sp80);
func_802B4E30(shell);
return;
case 5:
shell->velocity[1] -= D_802B9F64;
if (shell->velocity[1] < -5.0f) {
shell->velocity[1] = -5.0f;
}
shell->parentIndex += -1;
shell->rotAngle += 0x5B0;
shell->pos[1] += shell->velocity[1];
if (shell->parentIndex == 0) {
destroy_actor(-5.0f, shell);
}
break;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_green_shell.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_802AD950(UnkActorInner *, f32, f32, f32, f32, f32, f32, f32); /* extern */
? func_802B4E30(struct ShellActor *); /* extern */
extern u16 D_80164430;
extern s32 D_80164490;
void func_802B3B44(struct ShellActor *shell) {
f32 spAC;
f32 spA8;
f32 spA4;
f32 sp70;
f32 sp6C;
f32 sp68;
f32 sp60;
f32 sp5C;
f32 sp58;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f10;
f32 temp_f12;
f32 temp_f12_2;
f32 temp_f12_3;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f16_3;
f32 temp_f18;
f32 temp_f18_2;
f32 temp_f18_3;
f32 temp_f20;
f32 temp_f22;
f32 temp_f22_2;
f32 temp_f24;
f32 temp_f26;
f32 temp_f28;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
s32 temp_a1;
s32 temp_a3;
s32 temp_t1;
u16 temp_t0;
u16 temp_v1;
void *temp_v0;
void *temp_v0_2;
void *temp_v0_3;
s16 phi_a2;
f32 phi_f2;
f32 phi_f14;
f32 phi_f16;
temp_v1 = (u16) shell->rotAngle;
temp_t1 = D_80164490;
temp_v0 = temp_t1 + (temp_v1 * 8);
temp_t0 = D_80164430;
temp_a1 = temp_v1 + 1;
temp_a3 = temp_a1 & 0xFFFF;
temp_f2 = (f32) temp_v0->unk0;
temp_f12 = (f32) temp_v0->unk2;
temp_f28 = (f32) temp_v0->unk_04;
phi_a2 = temp_a1 & 0xFFFF;
if (temp_a3 >= (s32) temp_t0) {
phi_a2 = (temp_a3 - temp_t0) & 0xFFFF;
}
temp_f0 = shell->pos[0];
temp_f16 = shell->pos[1];
temp_f18 = shell->pos[2];
temp_f20 = temp_f2 - temp_f0;
temp_f22 = temp_f12 - temp_f16;
temp_v0_2 = temp_t1 + (phi_a2 * 8);
temp_f24 = temp_f28 - temp_f18;
sp60 = temp_f0;
sp5C = temp_f16;
sp58 = temp_f18;
temp_f14 = (temp_f20 * temp_f20) + (temp_f22 * temp_f22) + (temp_f24 * temp_f24);
if (temp_f14 > 400.0f) {
temp_f0_2 = (f32) temp_v0_2->unk0 - sp60;
temp_f2_2 = (f32) temp_v0_2->unk2 - sp5C;
temp_f12_2 = (f32) temp_v0_2->unk_04 - sp58;
if (((temp_f0_2 * temp_f0_2) + (temp_f2_2 * temp_f2_2) + (temp_f12_2 * temp_f12_2)) < temp_f14) {
shell->rotAngle = phi_a2;
return;
}
temp_f18_2 = sqrtf(temp_f14) * 4.0f;
temp_f22_2 = temp_f22 / temp_f18_2;
temp_f2_3 = shell->velocity[0] + (temp_f20 / temp_f18_2);
temp_f10 = temp_f2_3 * temp_f2_3;
spAC = temp_f2_3;
temp_f14_2 = shell->velocity[1] + temp_f22_2;
spA8 = temp_f14_2;
temp_f16_2 = shell->velocity[2] + (temp_f24 / temp_f18_2);
spA4 = temp_f16_2;
temp_f0_3 = sqrtf(temp_f10 + (temp_f14_2 * temp_f14_2) + (temp_f16_2 * temp_f16_2));
phi_f2 = temp_f2_3;
phi_f14 = temp_f14_2;
phi_f16 = temp_f16_2;
if (temp_f0_3 > 6.0f) {
temp_f12_3 = temp_f0_3 / 6.0f;
phi_f2 = temp_f2_3 / temp_f12_3;
phi_f14 = temp_f14_2 / temp_f12_3;
phi_f16 = temp_f16_2 / temp_f12_3;
}
shell->velocity[0] = phi_f2;
shell->velocity[1] = phi_f14;
shell->velocity[2] = phi_f16;
sp68 = shell->pos[0];
sp6C = shell->pos[1];
sp70 = shell->pos[2];
shell->pos[0] += phi_f2;
shell->pos[1] += phi_f14;
shell->pos[2] += phi_f16;
func_802AD950(&shell->unk30, 4.0f, shell->pos[0], shell->pos[1], shell->pos[2], sp68, sp6C, sp70);
func_802B4E30(shell);
return;
}
temp_v0_3 = temp_t1 + (phi_a2 * 8);
if (temp_f14 > 5.0f) {
shell->pos[0] = temp_f2;
shell->pos[2] = temp_f28;
shell->rotAngle = phi_a2;
shell->pos[1] = shell->boundingBoxSize + temp_f12;
return;
}
temp_f16_3 = (f32) temp_v0_3->unk0;
temp_f18_3 = (f32) temp_v0_3->unk2;
temp_f26 = (f32) temp_v0_3->unk_04;
shell->pos[0] = (temp_f2 + temp_f16_3) * 0.5f;
shell->pos[1] = ((temp_f12 + temp_f18_3) * 0.5f) + shell->boundingBoxSize;
shell->pos[2] = (temp_f28 + temp_f26) * 0.5f;
shell->velocity[0] = (temp_f16_3 - temp_f2) * 0.5f;
shell->velocity[1] = (temp_f18_3 - temp_f12) * 0.5f;
shell->velocity[2] = (temp_f26 - temp_f28) * 0.5f;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B3B44.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_8029FDC8(f32, f32, struct ShellActor *, ?); /* extern */
? func_802AD950(f32, f32, UnkActorInner *, ?, f32, f32, f32, f32, f32, f32); /* extern */
? func_802B4104(struct ShellActor *); /* extern */
? func_802B4E30(struct ShellActor *); /* extern */
void func_802B3E7C(struct ShellActor *shell, Player *player) {
f32 sp44;
f32 sp40;
f32 sp38;
f32 sp34;
f32 sp30;
f32 temp_f12;
f32 temp_f14;
f32 temp_f2;
f32 phi_f2;
f32 phi_f14;
temp_f2 = player->pos[0] - shell->pos[0];
temp_f14 = player->pos[2] - shell->pos[2];
sp44 = temp_f2;
sp40 = temp_f14;
temp_f12 = sqrtf((temp_f2 * temp_f2) + (temp_f14 * temp_f14)) / 8.0f;
if (temp_f12 == 0.0f) {
phi_f2 = 0.0f;
phi_f14 = 0.0f;
} else {
phi_f2 = temp_f2 / temp_f12;
phi_f14 = temp_f14 / temp_f12;
}
sp30 = shell->pos[0];
sp34 = shell->pos[1];
sp38 = shell->pos[2];
shell->velocity[0] = phi_f2;
shell->velocity[2] = phi_f14;
shell->pos[0] += phi_f2;
shell->pos[1] -= 2.0f;
shell->velocity[1] = -2.0f;
shell->pos[2] += phi_f14;
if (player->unk_0BC & 0x80000000) {
func_8029FDC8(temp_f12, phi_f14, shell, 0x40800000);
return;
}
func_802AD950(temp_f12, phi_f14, &shell->unk30, 0x40800000, shell->pos[0], shell->pos[1], shell->pos[2], sp30, sp34, sp38);
func_802B4E30(shell);
func_802B4104(shell);
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B3E7C.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
f32 func_802B51E8(void *, f32 *); /* extern */
extern ? gPlayerBalloonCount;
static f32 D_802B9F68 = 2.5e7f;
s16 func_802B3FD0(Player *player, struct ShellActor *shell) {
f32 temp_f0;
s32 temp_s1;
Player *phi_s0;
s32 phi_s1;
f32 phi_f20;
s16 phi_fp;
phi_s0 = gPlayers;
phi_s1 = 0;
phi_f20 = D_802B9F68;
phi_fp = -1;
do {
if (((phi_s0->unk_000 & 0x8000) != 0) && (phi_s0 != player) && (*(&gPlayerBalloonCount + (phi_s1 * 2)) >= 0)) {
temp_f0 = func_802B51E8(phi_s0 + 0x14, shell->pos);
if (temp_f0 < phi_f20) {
phi_fp = (s16) ((s32) (phi_s0 - gPlayerOne) / 3544);
phi_f20 = temp_f0;
}
}
temp_s1 = phi_s1 + 1;
phi_s0 += 0xDD8;
phi_s1 = temp_s1;
} while (temp_s1 != 4);
return phi_fp;
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B3FD0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
? func_800C98B8(void *, void *, ?); // extern
? func_8029FDC8(void *); // extern
void func_802B4104(void *arg0) {
f32 temp_f0;
f32 temp_f0_2;
if ((arg0->unk3C < 0.0f) && ((temp_f0 = arg0->unk_04C, (temp_f0 < 0.25f)) || (temp_f0 > -0.25f))) {
func_8029FDC8(arg0);
func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19008054);
arg0->unk2 = arg0->unk2 | 0x80;
return;
}
if ((arg0->unk40 < 0.0f) && ((temp_f0_2 = arg0->unk58, (temp_f0_2 < 0.25f)) || (temp_f0_2 < -0.25f))) {
func_8029FDC8(arg0);
func_800C98B8(arg0 + 0x18, arg0 + 0x24, 0x19008054);
arg0->unk2 = arg0->unk2 | 0x80;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/func_802B4104.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
? func_8000ED80(s32); /* extern */
? func_8000EE10(s32); /* extern */
? func_800C9060(u8, ?); /* extern */
? func_800C90F4(u8, s32); /* extern */
? func_800C9D80(f32 *, f32 *, ?); /* extern */
? destroy_actor(f32, struct ShellActor *); /* extern */
? func_8029FDC8(f32, struct ShellActor *); /* extern */
f32 func_802ABE30(f32, f32, f32, u16); /* extern */
? func_802AD950(UnkActorInner *, ?, f32, f32, f32, f32, f32, f32); /* extern */
? func_802B0210(UnkActorInner *, UnkActorInner *); /* extern */
? func_802B3B44(struct ShellActor *); /* extern */
? func_802B3E7C(struct ShellActor *, Player *); /* extern */
s16 func_802B3FD0(Player *, struct ShellActor *); /* extern */
? func_802B4104(struct ShellActor *); /* extern */
? func_802B4E30(struct ShellActor *); /* extern */
? func_802B63B8(f32 *, f32 *); /* extern */
? func_802B64C4(f32 *, s16); /* extern */
extern s16 D_8015F6E8;
extern s16 D_8015F6EA;
extern s16 D_8015F6EE;
extern s16 D_8015F6F0;
extern s16 D_8015F6F2;
extern u16 D_80164430;
extern ? D_80164438;
extern struct Controller *gControllerOne;
extern s16 gPlayerPositionLUT;
static f32 D_802B9F94 = 1.2f;
static f32 D_802B9F98 = 40000.0f;
static f32 D_802B9F9C = 0.3f;
static f32 D_802B9FA0 = 40000.0f;
void update_obj_red_blue_shell(struct ShellActor *shell) {
f32 sp94;
f32 sp90;
f32 sp8C;
f32 sp68;
s16 sp56;
f32 sp40;
f32 sp3C;
f32 sp38;
Player *temp_s1;
Player *temp_s1_2;
Player *temp_s1_3;
Player *temp_s1_4;
Player *temp_s1_5;
Player *temp_s1_6;
f32 *temp_a0;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f12;
f32 temp_f14;
f32 temp_f2;
f32 temp_f2_2;
f32 temp_f2_3;
f32 temp_f2_4;
f32 temp_f2_5;
s16 temp_t6;
s16 temp_v0;
s16 temp_v0_2;
s16 temp_v0_3;
s16 temp_v0_4;
s16 temp_v0_5;
s16 temp_v0_6;
struct TripleShellParent *temp_v0_7;
u16 temp_t4;
u16 temp_v1;
u16 temp_v1_2;
u16 temp_v1_3;
u16 temp_v1_4;
struct Controller *phi_v0;
f32 phi_f0;
s16 phi_v0_2;
s16 phi_v0_3;
s16 phi_v0_4;
temp_f2 = shell->pos[2];
temp_f0 = shell->pos[0];
temp_f12 = shell->pos[1];
sp56 = shell->type;
if ((temp_f2 < (f32) D_8015F6F2) || ((f32) D_8015F6F0 < temp_f2) || (temp_f0 < (f32) D_8015F6EA) || ((f32) D_8015F6E8 < temp_f0) || (temp_f12 < (f32) D_8015F6EE)) {
func_8029FDC8(temp_f12, shell);
}
temp_t4 = (u16) shell->state;
shell->rotVelocity += 0x71C;
switch (temp_t4) {
case 0:
temp_s1 = &gPlayers[shell->playerId];
func_802B0210(&temp_s1->unk_110, &shell->unk30);
sp8C = 0.0f;
sp90 = temp_s1->boundingBoxSize;
sp94 = -(temp_s1->boundingBoxSize + shell->boundingBoxSize + 2.0f);
func_802B63B8(&sp8C, temp_s1->unk_174);
shell->pos[0] = sp8C + temp_s1->pos[0];
temp_f14 = temp_s1->pos[1] - sp90;
shell->pos[2] = sp94 + temp_s1->pos[2];
sp68 = temp_f14;
temp_f0_2 = func_802ABE30(shell->pos[0], temp_f14, shell->pos[2], temp_s1->unk_110.unk3A);
temp_f2_2 = temp_f14 - temp_f0_2;
if ((temp_f2_2 < 5.0f) && (temp_f2_2 > -5.0f)) {
shell->pos[1] = shell->boundingBoxSize + temp_f0_2;
} else {
shell->pos[1] = temp_f14;
}
if ((temp_s1->unk_000 & 0x4000) != 0) {
if (D_800DC51C != 0) {
goto block_16;
}
phi_v0 = &gControllers[shell->playerId];
} else {
block_16:
phi_v0 = gControllerOne;
}
temp_v1 = phi_v0->buttonDepressed;
if ((temp_v1 & 0x2000) != 0) {
phi_v0->buttonDepressed = temp_v1 & 0xDFFF;
shell->state = 1;
if (temp_s1->unk_0C0 > 0) {
shell->rotAngle = 0x78E3;
return;
}
shell->rotAngle = -0x78E4;
return;
}
default:
return;
case 1:
temp_v0 = shell->rotAngle;
temp_s1_2 = &gPlayers[shell->playerId];
if (temp_v0 > 0) {
shell->rotAngle = temp_v0 - 0x71C;
if (shell->rotAngle < 0) {
shell->state = 2;
func_800C9060(shell->unk15, 0x19008004);
func_800C90F4(shell->unk15, (temp_s1_2->characterId * 0x10) + 0x29008000);
if (sp56 == 8) {
func_8000ED80((s32) (shell - gActorList) / 112);
} else {
func_8000EE10((s32) (shell - gActorList) / 112);
func_800C9D80(shell->pos, shell->velocity, 0x51018008);
}
}
} else {
shell->rotAngle = temp_v0 + 0x71C;
if (shell->rotAngle > 0) {
shell->state = 2;
func_800C9060(shell->unk15, 0x19008004);
func_800C90F4(shell->unk15, (temp_s1_2->characterId * 0x10) + 0x29008000);
if (sp56 == 8) {
func_8000ED80((s32) (shell - gActorList) / 112);
} else {
func_8000EE10((s32) (shell - gActorList) / 112);
func_800C9D80(shell->pos, shell->velocity, 0x51018008);
}
}
}
if (shell->state == 2) {
shell->parentIndex = 0x001E;
temp_f2_3 = temp_s1_2->unk_094;
phi_f0 = 8.0f;
if (temp_f2_3 > 8.0f) {
phi_f0 = temp_f2_3 * D_802B9F94;
}
sp94 = phi_f0;
temp_a0 = &sp8C;
sp8C = 0.0f;
sp90 = 0.0f;
func_802B64C4(temp_a0, (s16) (temp_s1_2->unk_02E + temp_s1_2->unk_0C0));
shell->velocity[0] = sp8C;
shell->velocity[1] = sp90;
shell->velocity[2] = sp94;
return;
}
sp8C = sins((u16) shell->rotAngle) * 8.0f;
sp90 = shell->boundingBoxSize - temp_s1_2->boundingBoxSize;
sp94 = coss((u16) shell->rotAngle) * 8.0f;
func_802B63B8(&sp8C, temp_s1_2->unk_174);
shell->pos[0] = sp8C + temp_s1_2->pos[0];
shell->pos[1] = sp90 + temp_s1_2->pos[1];
shell->pos[2] = sp94 + temp_s1_2->pos[2];
return;
case 2:
shell->parentIndex += -1;
temp_s1_3 = &gPlayers[shell->playerId];
if (shell->parentIndex == 0) {
shell->flags &= 0xEFFF;
if (shell->type == 0x002A) {
shell->state = 8;
shell->parentIndex = gPlayerPositionLUT;
shell->unk_08 = 1000.0f;
temp_v1_2 = D_80164430;
temp_v0_2 = *(&D_80164438 + (((s32) (temp_s1_3 - gPlayerOne) / 3544) * 2)) + 8;
phi_v0_2 = temp_v0_2;
if ((s32) temp_v1_2 < temp_v0_2) {
phi_v0_2 = (s16) (temp_v0_2 - temp_v1_2);
}
shell->rotAngle = phi_v0_2;
} else if (gModeSelection == (s32) 3) {
shell->unk_08 = 1000.0f;
shell->parentIndex = func_802B3FD0(temp_s1_3, shell);
if (shell->parentIndex < 0) {
shell->flags = -0x8000;
shell->rotAngle = 0;
shell->parentIndex = 0x003C;
shell->state = 7;
shell->velocity[1] = 3.0f;
} else {
shell->state = 3;
}
} else {
temp_v0_3 = temp_s1_3->currentRank;
if (temp_v0_3 == 0) {
shell->state = 4;
shell->parentIndex = 0x0258;
temp_v1_3 = D_80164430;
temp_v0_4 = *(&D_80164438 + (((s32) (temp_s1_3 - gPlayerOne) / 3544) * 2)) + 8;
phi_v0_3 = temp_v0_4;
if ((s32) temp_v1_3 < temp_v0_4) {
phi_v0_3 = (s16) (temp_v0_4 - temp_v1_3);
}
shell->rotAngle = phi_v0_3;
} else if (temp_v0_3 >= 5) {
shell->state = 5;
shell->unk_08 = 1000.0f;
temp_v1_4 = D_80164430;
temp_v0_5 = *(&D_80164438 + (((s32) (temp_s1_3 - gPlayerOne) / 3544) * 2)) + 8;
phi_v0_4 = temp_v0_5;
if ((s32) temp_v1_4 < temp_v0_5) {
phi_v0_4 = (s16) (temp_v0_5 - temp_v1_4);
}
shell->rotAngle = phi_v0_4;
shell->parentIndex = (&gPlayerPositionLUT)[temp_s1_3->currentRank].unk-2;
} else {
shell->state = 3;
shell->unk_08 = 1000.0f;
shell->parentIndex = (&gPlayerPositionLUT)[temp_s1_3->currentRank].unk-2;
}
}
}
shell->velocity[1] = (f32) ((f64) shell->velocity[1] - 0.5);
if (shell->velocity[1] < -2.0f) {
shell->velocity[1] = -2.0f;
}
sp38 = shell->pos[0];
sp3C = shell->pos[1];
sp40 = shell->pos[2];
shell->pos[0] += shell->velocity[0];
shell->pos[1] += shell->velocity[1];
shell->pos[2] += shell->velocity[2];
func_802AD950(&shell->unk30, 0x40800000, shell->pos[0], shell->pos[1], shell->pos[2], sp38, sp3C, sp40);
func_802B4E30(shell);
func_802B4104(shell);
return;
case 3:
func_802B3E7C(shell, &gPlayers[shell->parentIndex]);
return;
case 4:
func_802B3B44(shell);
temp_v0_6 = shell->parentIndex;
if (temp_v0_6 == 0) {
if ((shell->flags & 0xF) == 0) {
func_8029FDC8((bitwise f32) shell);
return;
}
shell->parentIndex = temp_v0_6 - 1;
return;
}
break;
case 5:
func_802B3B44(shell);
temp_s1_4 = &gPlayers[shell->parentIndex];
temp_f0_3 = temp_s1_4->pos[0] - shell->pos[0];
temp_f2_4 = temp_s1_4->pos[2] - shell->pos[2];
if (((temp_f0_3 * temp_f0_3) + (temp_f2_4 * temp_f2_4)) < D_802B9F98) {
shell->state = 3;
return;
}
break;
case 6:
temp_v0_7 = &gActorList[shell->parentIndex];
temp_s1_5 = &gPlayers[shell->playerId];
if (temp_v0_7->type != 0x0016) {
func_8029FDC8((bitwise f32) shell);
return;
}
temp_t6 = shell->rotAngle + temp_v0_7->rotVelocity;
shell->rotAngle = temp_t6;
sp8C = sins(temp_t6 & 0xFFFF) * 8.0f;
sp90 = shell->boundingBoxSize - temp_s1_5->boundingBoxSize;
sp94 = coss((u16) shell->rotAngle) * 8.0f;
func_802B63B8(&sp8C, temp_s1_5->unk_174);
sp38 = shell->pos[0];
sp3C = shell->pos[1];
sp40 = shell->pos[2];
shell->pos[0] = sp8C + temp_s1_5->pos[0];
shell->pos[1] = sp90 + temp_s1_5->pos[1];
shell->pos[2] = sp94 + temp_s1_5->pos[2];
func_802AD950(&shell->unk30, 0x40800000, shell->pos[0], shell->pos[1], shell->pos[2], sp38, sp3C, sp40);
func_802B4E30(shell);
return;
case 7:
shell->velocity[1] -= D_802B9F9C;
if (shell->velocity[1] < -5.0f) {
shell->velocity[1] = -5.0f;
}
shell->parentIndex += -1;
shell->rotAngle += 0x5B0;
shell->pos[1] += shell->velocity[1];
if (shell->parentIndex == 0) {
destroy_actor(-5.0f, shell);
return;
}
break;
case 8:
func_802B3B44(shell);
shell->parentIndex = gPlayerPositionLUT;
temp_s1_6 = &gPlayers[gPlayerPositionLUT];
temp_f0_4 = temp_s1_6->pos[0] - shell->pos[0];
temp_f2_5 = temp_s1_6->pos[2] - shell->pos[2];
if (((temp_f0_4 * temp_f0_4) + (temp_f2_5 * temp_f2_5)) < D_802B9FA0) {
shell->state = 9;
return;
}
break;
case 9:
func_802B3E7C(shell, &gPlayers[shell->parentIndex]);
break;
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_802B0210/update_obj_red_blue_shell.s")
#endif
void func_802B4E30(struct Actor *arg0) {
if ((arg0->unk30.unk44 < 0.0f) && (arg0->unk30.unk34 == 1)) {
arg0->pos[0] -= (arg0->unk30.unk60[0] * arg0->unk30.unk44);
arg0->pos[1] -= (arg0->unk30.unk60[1] * arg0->unk30.unk44);
arg0->pos[2] -= (arg0->unk30.unk60[2] * arg0->unk30.unk44);
}
if ((arg0->unk30.unk3C < 0.0f) && (arg0->unk30.unk30 == 1)) {
arg0->pos[0] -= (arg0->unk30.unk48[0] * arg0->unk30.unk3C);
arg0->pos[1] -= (arg0->unk30.unk48[1] * arg0->unk30.unk3C);
arg0->pos[2] -= (arg0->unk30.unk48[2] * arg0->unk30.unk3C);
}
if ((arg0->unk30.unk40 < 0.0f) && (arg0->unk30.unk32 == 1)) {
arg0->pos[0] -= (arg0->unk30.unk54[0] * arg0->unk30.unk40);
arg0->pos[1] -= (arg0->unk30.unk54[1] * arg0->unk30.unk40);
arg0->pos[2] -= (arg0->unk30.unk54[2] * arg0->unk30.unk40);
}
}