mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-06-09 04:40:35 -04:00
Add some more actor types, match a function (#191)
* Add some more actor types, match a function * Identify the boundBox member of the Player struct Note that while the `flag` members are signed, they should be understood as just a group of bits. Based on some googling around (see https://stackoverflow.com/a/11644749) the operation `thing.flag |= 0x8000` is NOT undefined behaviour, even though that is setting the sign bit. The numerical interpretation of the result as a signed number is implementation defined, while the actual operation acts on the bit representation of the number. Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
+6
-6
@@ -1119,7 +1119,7 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
||||
sp38 = temp_f0;
|
||||
sp94 = temp_f2;
|
||||
sp40 = temp_f2;
|
||||
sp90 = -player->unk_070;
|
||||
sp90 = -player->boundingBoxSize;
|
||||
func_802B63B8(sp48, temp_a0, &sp5C);
|
||||
sp80 = player->boundingBoxCorners[0].cornerX;
|
||||
sp84 = player->boundingBoxCorners[0].cornerY;
|
||||
@@ -1135,7 +1135,7 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
||||
sp34 = temp_f14;
|
||||
sp28 = temp_f2_2;
|
||||
sp94 = sp40;
|
||||
sp90 = -player->unk_070;
|
||||
sp90 = -player->boundingBoxSize;
|
||||
func_802B63B8(sp48, (bitwise f32 *) temp_f14, temp_a0_2, &sp5C);
|
||||
sp80 = player->boundingBoxCorners[1].cornerX;
|
||||
sp84 = player->boundingBoxCorners[1].cornerY;
|
||||
@@ -1149,7 +1149,7 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
||||
sp8C = (f32) (sp38 - 2.6);
|
||||
sp94 = temp_f12;
|
||||
sp40 = temp_f12;
|
||||
sp90 = -player->unk_070;
|
||||
sp90 = -player->boundingBoxSize;
|
||||
func_802B63B8(temp_f12, temp_a0_3, &sp5C);
|
||||
sp80 = player->boundingBoxCorners[2].cornerX;
|
||||
sp84 = player->boundingBoxCorners[2].cornerY;
|
||||
@@ -1161,7 +1161,7 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
||||
temp_a0_4 = &sp8C;
|
||||
sp8C = (f32) (sp28 + 2.6);
|
||||
sp94 = sp40;
|
||||
sp90 = -player->unk_070;
|
||||
sp90 = -player->boundingBoxSize;
|
||||
func_802B63B8((bitwise f32) temp_a0_4, &sp5C);
|
||||
sp80 = player->boundingBoxCorners[3].cornerX;
|
||||
sp84 = player->boundingBoxCorners[3].cornerY;
|
||||
@@ -3228,7 +3228,7 @@ void func_8002D268(Player *player, s32 arg1, s8 arg2, s8 arg3) {
|
||||
spF8 = temp_f4;
|
||||
spF8 = temp_f8 - D_800ED830;
|
||||
}
|
||||
func_802AD950(&player->unk_110, player->unk_070, spFC, spF8, spF4, player->rotX, player->rotY, player->rotZ);
|
||||
func_802AD950(&player->unk_110, player->boundingBoxSize, spFC, spF8, spF4, player->rotX, player->rotY, player->rotZ);
|
||||
player->unk_058 = 0.0f;
|
||||
player->unk_060 = 0.0f;
|
||||
player->unk_05C = 1.0f;
|
||||
@@ -3404,7 +3404,7 @@ void func_8002E4C4(Player *player) {
|
||||
player->kartHopJerk = 0.0f;
|
||||
player->kartHopAcceleration = 0.0f;
|
||||
player->kartHopVelocity = 0.0f;
|
||||
player->pos[1] = func_802AE1C0(player->pos[0], D_80164510[player_index] + 10.0f, player->pos[2]) + player->unk_070;
|
||||
player->pos[1] = func_802AE1C0(player->pos[0], D_80164510[player_index] + 10.0f, player->pos[2]) + player->boundingBoxSize;
|
||||
if (((player->pos[1] - D_80164510[player_index]) > 1200.0f) || ((player->pos[1] - D_80164510[player_index]) < -1200.0f)) {
|
||||
player->pos[1] = player->rotY;
|
||||
}
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4,
|
||||
player->characterId = arg6;
|
||||
player->unk_0B6 = 0;
|
||||
player->unk_0FC = gKartFrictionTable[player->characterId];
|
||||
player->unk_070 = gKartBoundingBoxTable[player->characterId];
|
||||
player->boundingBoxSize = gKartBoundingBoxSizeTable[player->characterId];
|
||||
player->unk_100 = gKartGravityTable[player->characterId];
|
||||
|
||||
switch (gModeSelection) {
|
||||
@@ -50,7 +50,7 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4,
|
||||
}
|
||||
|
||||
player->pos[0] = arg2;
|
||||
ret = func_802AE1C0(arg2, arg4 + 50.0f, arg3) + player->unk_070;
|
||||
ret = func_802AE1C0(arg2, arg4 + 50.0f, arg3) + player->boundingBoxSize;
|
||||
player->pos[2] = arg3;
|
||||
player->pos[1] = ret;
|
||||
player->rotX = arg2;
|
||||
|
||||
+4
-4
@@ -4146,13 +4146,13 @@ void func_8005F90C(Player *player, s16 arg1, s32 arg2, s32 arg3) {
|
||||
phi_v0 = (s32) player->boundingBoxCorners[2].surfaceType;
|
||||
phi_f12 = player->pos[2];
|
||||
phi_f0 = player->pos[0];
|
||||
phi_f2 = player->pos[1] - player->unk_070;
|
||||
phi_f2 = player->pos[1] - player->boundingBoxSize;
|
||||
phi_t1 = 1;
|
||||
} else {
|
||||
phi_v0 = (s32) player->boundingBoxCorners[3].surfaceType;
|
||||
phi_f12 = player->pos[2];
|
||||
phi_f0 = player->pos[0];
|
||||
phi_f2 = player->pos[1] - player->unk_070;
|
||||
phi_f2 = player->pos[1] - player->boundingBoxSize;
|
||||
}
|
||||
switch (phi_v0) {
|
||||
case 2:
|
||||
@@ -5421,7 +5421,7 @@ void func_80062AA8(Player* arg0, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) {
|
||||
arg0->unk_258[20 + arg3].unk_012 = 5;
|
||||
arg0->unk_258[20 + arg3].unk_00C = D_800EE60C;
|
||||
arg0->unk_258[20 + arg3].unk_01E = 0;
|
||||
arg0->unk_258[20 + arg3].unk_000[1] = (arg0->pos[1] + arg0->unk_070) - 2.5;
|
||||
arg0->unk_258[20 + arg3].unk_000[1] = (arg0->pos[1] + arg0->boundingBoxSize) - 2.5;
|
||||
}
|
||||
|
||||
void func_80062B18(f32 *arg0, f32 *arg1, f32 *arg2, f32 arg3, f32 arg4, f32 arg5, u16 arg6, u16 arg7) {
|
||||
@@ -5850,7 +5850,7 @@ void func_80064184(Player* arg0, s16 arg1, s8 arg2, UNUSED s8 arg3) {
|
||||
arg0->unk_258[arg1].unk_000[2] = arg0->pos[2] + sp3C;
|
||||
arg0->unk_258[arg1].unk_000[1] = arg0->pos[1] + sp40;
|
||||
++arg0->unk_258[arg1].unk_01E;
|
||||
if ((arg0->unk_258[arg1].unk_01E == 12) || (D_801652A0[arg2] <= (arg0->pos[1] - arg0->unk_070))) {
|
||||
if ((arg0->unk_258[arg1].unk_01E == 12) || (D_801652A0[arg2] <= (arg0->pos[1] - arg0->boundingBoxSize))) {
|
||||
arg0->unk_258[arg1].unk_01C = 0;
|
||||
arg0->unk_258[arg1].unk_01E = 0;
|
||||
arg0->unk_258[arg1].unk_012 = 0;
|
||||
|
||||
+5
-5
@@ -940,7 +940,7 @@ void func_8008DC08(Player* player, s8 arg1) {
|
||||
player->unk_DB6 = 0;
|
||||
player->unk_0BC |= 0x08000000;
|
||||
player->unk_224 = 1.0f;
|
||||
player->unk_070 = gKartBoundingBoxTable[player->characterId];
|
||||
player->boundingBoxSize = gKartBoundingBoxSizeTable[player->characterId];
|
||||
D_80165190[0][arg1] = 1;
|
||||
D_80165190[1][arg1] = 1;
|
||||
D_80165190[2][arg1] = 1;
|
||||
@@ -995,7 +995,7 @@ void func_8008DF98(Player* player, s8 arg1) {
|
||||
? func_800C90F4(s32, s32, s8); /* extern */
|
||||
extern ? D_80165190;
|
||||
extern ? D_8018D920;
|
||||
extern ? gKartBoundingBoxTable;
|
||||
extern ? gKartBoundingBoxSizeTable;
|
||||
|
||||
void func_8008E118(void *arg0, s8 arg1) {
|
||||
s16 *temp_v0_3;
|
||||
@@ -1061,7 +1061,7 @@ void func_8008E118(void *arg0, s8 arg1) {
|
||||
}
|
||||
if ((arg0->unkB0 >= 0) && (arg0->unkB0 < 0x1CC)) {
|
||||
move_f32_towards(arg0 + 0x224, 0.7f, 0x3DCCCCCD);
|
||||
move_f32_towards(arg0 + 0x70, *(&gKartBoundingBoxTable + (arg0->unk254 * 4)) * 0.9, 0x3DCCCCCD);
|
||||
move_f32_towards(arg0 + 0x70, *(&gKartBoundingBoxSizeTable + (arg0->unk254 * 4)) * 0.9, 0x3DCCCCCD);
|
||||
return;
|
||||
}
|
||||
arg1 = phi_a2;
|
||||
@@ -1076,11 +1076,11 @@ GLOBAL_ASM("asm/non_matchings/code_8008C1D0/func_8008E118.s")
|
||||
|
||||
void func_8008E3C0(Player* player, UNUSED s8 arg1) {
|
||||
move_f32_towards(&player->unk_224, 1.0f, 0.1f);
|
||||
move_f32_towards(&player->unk_070, gKartBoundingBoxTable[player->characterId], 0.1f);
|
||||
move_f32_towards(&player->boundingBoxSize, gKartBoundingBoxSizeTable[player->characterId], 0.1f);
|
||||
|
||||
player->unk_0BC &= ~0x40000000;
|
||||
player->unk_224 = 1.0f;
|
||||
player->unk_070 = gKartBoundingBoxTable[player->characterId];
|
||||
player->boundingBoxSize = gKartBoundingBoxSizeTable[player->characterId];
|
||||
player->unk_DC4 = 3.0f;
|
||||
player->unk_DB6 = 0;
|
||||
player->unk_0BC |= 0x08000000;
|
||||
|
||||
+163
-169
@@ -894,48 +894,46 @@ void update_obj_train_car2(struct Actor *arg0) {
|
||||
arg0->unk6 -= 0x666;
|
||||
}
|
||||
|
||||
void update_obj_piranha_plant(void *data) {
|
||||
struct piranha_plant *arg0 = (struct piranha_plant *) data;
|
||||
s16 temp_v0 = arg0->unk2;
|
||||
|
||||
if ((temp_v0 & 0x800) == 0) {
|
||||
if ((temp_v0 & 0x400) != 0) {
|
||||
arg0->unk1C += 4.0f;
|
||||
if (arg0->unk1C > 800.0f) {
|
||||
arg0->unk2 |= 0x800;
|
||||
void update_obj_piranha_plant(struct piranha_plant *arg0) {
|
||||
if ((arg0->flags & 0x800) == 0) {
|
||||
if ((arg0->flags & 0x400) != 0) {
|
||||
arg0->pos[1] += 4.0f;
|
||||
if (arg0->pos[1] > 800.0f) {
|
||||
arg0->flags |= 0x800;
|
||||
}
|
||||
} else {
|
||||
if (arg0->unk4 == 1) {
|
||||
arg0->unk24++;
|
||||
if (arg0->unk24 > 60) {
|
||||
arg0->unk24 = 6;
|
||||
// This has to be an unrolled loop
|
||||
if (arg0->visibilityStates[0] == 1) {
|
||||
arg0->timers[0]++;
|
||||
if (arg0->timers[0] > 60) {
|
||||
arg0->timers[0] = 6;
|
||||
}
|
||||
} else {
|
||||
arg0->unk24 = 0;
|
||||
arg0->timers[0] = 0;
|
||||
}
|
||||
if (arg0->unk6 == 1) {
|
||||
arg0->unk26++;
|
||||
if (arg0->unk26 > 60) {
|
||||
arg0->unk26 = 6;
|
||||
if (arg0->visibilityStates[1] == 1) {
|
||||
arg0->timers[1]++;
|
||||
if (arg0->timers[1] > 60) {
|
||||
arg0->timers[1] = 6;
|
||||
}
|
||||
} else {
|
||||
arg0->unk26 = 0;
|
||||
arg0->timers[1] = 0;
|
||||
}
|
||||
if (arg0->unk8 == 1) {
|
||||
arg0->unk28++;
|
||||
if (arg0->unk28 > 60) {
|
||||
arg0->unk28 = 6;
|
||||
if (arg0->visibilityStates[2] == 1) {
|
||||
arg0->timers[2]++;
|
||||
if (arg0->timers[2] > 60) {
|
||||
arg0->timers[2] = 6;
|
||||
}
|
||||
} else {
|
||||
arg0->unk28 = 0;
|
||||
arg0->timers[2] = 0;
|
||||
}
|
||||
if (arg0->unkA == 1) {
|
||||
arg0->unk2A++;
|
||||
if (arg0->unk2A > 60) {
|
||||
arg0->unk2A = 6;
|
||||
if (arg0->visibilityStates[3] == 1) {
|
||||
arg0->timers[3]++;
|
||||
if (arg0->timers[3] > 60) {
|
||||
arg0->timers[3] = 6;
|
||||
}
|
||||
} else {
|
||||
arg0->unk2A = 0;
|
||||
arg0->timers[3] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2291,115 +2289,112 @@ GLOBAL_ASM("asm/non_matchings/code_actors/func_8029A23C.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
/*
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
void func_80297230(void *, void *); // extern
|
||||
void func_802972B8(void *, void *); // extern
|
||||
void func_802979F8(void *, ?, void *); // extern
|
||||
s32 func_802B4FF8(void *, ?, void *); // extern
|
||||
f32 func_802B80D0(s32, u16, ?, f32, f32); // extern
|
||||
//generated by m2c commit 685418adfeb3794409e47b45ac5cab60b17d23fd
|
||||
? func_80297230(Camera *, struct shell_actor *); /* extern */
|
||||
? func_802972B8(Camera *, struct shell_actor *); /* extern */
|
||||
? func_802979F8(struct shell_actor *, ?, f32 (*)[4]); /* extern */
|
||||
s32 func_802B4FF8(f32 (*)[4], ?, f32 (*)[4]); /* extern */
|
||||
f32 func_802B80D0(f32 *, u16, ?, f32, f32); /* extern */
|
||||
extern ? D_0D005338;
|
||||
extern ? D_0D005368;
|
||||
extern ? D_802B87E8;
|
||||
extern f32 D_802B96AC;
|
||||
extern f32 D_802B96B0;
|
||||
extern ? D_80150130;
|
||||
extern s32 D_802BA050;
|
||||
extern s32 D_802BA054;
|
||||
static ? D_802B87E8; /* unable to generate initializer */
|
||||
static f32 D_802B96AC = 490000.0f;
|
||||
static f32 D_802B96B0 = 40000.0f;
|
||||
|
||||
|
||||
void func_8029A3AC(void *arg0, void *arg1, void *arg2) {
|
||||
void func_8029A3AC(Camera *camera, Mat4 arg1, struct shell_actor *shell) {
|
||||
u16 sp7C;
|
||||
? sp58;
|
||||
s32 sp54;
|
||||
f32 sp50;
|
||||
Gfx *temp_v0;
|
||||
Gfx *temp_v0_2;
|
||||
Gfx *temp_v0_3;
|
||||
Gfx *temp_v0_4;
|
||||
Gfx *temp_v0_5;
|
||||
Gfx *temp_v0_6;
|
||||
Gfx *temp_v0_7;
|
||||
Gfx *temp_v0_8;
|
||||
Gfx *temp_v0_9;
|
||||
f32 temp_f0;
|
||||
s32 temp_t3;
|
||||
u16 temp_t8;
|
||||
void *temp_v0;
|
||||
void *temp_v0_2;
|
||||
void *temp_v0_3;
|
||||
void *temp_v0_4;
|
||||
void *temp_v0_5;
|
||||
void *temp_v0_6;
|
||||
void *temp_v0_7;
|
||||
void *temp_v0_8;
|
||||
void *temp_v0_9;
|
||||
s32 phi_t3;
|
||||
|
||||
sp58.unk0 = D_802B87E8.unk0;
|
||||
sp58.unk4 = D_802B87E8.unk4;
|
||||
sp58.unk8 = D_802B87E8.unk8;
|
||||
sp58.unkC = D_802B87E8.unkC;
|
||||
sp58.unk10 = D_802B87E8.unk10;
|
||||
sp58.unk14 = D_802B87E8.unk14;
|
||||
sp58.unk18 = D_802B87E8.unk18;
|
||||
sp58.unk1C = D_802B87E8.unk1C;
|
||||
temp_f0 = func_802B80D0(arg2 + 0x18, arg0->unk26, 0, (&D_80150130)[(arg0 - camera1) / 0xB8], D_802B96AC);
|
||||
sp58.unk0 = (s32) D_802B87E8.unk0;
|
||||
sp58.unk4 = (s32) D_802B87E8.unk4;
|
||||
sp58.unk8 = (s32) D_802B87E8.unk8;
|
||||
sp58.unkC = (s32) D_802B87E8.unkC;
|
||||
sp58.unk10 = (s32) D_802B87E8.unk10;
|
||||
sp58.unk14 = (s32) D_802B87E8.unk14;
|
||||
sp58.unk18 = (s32) D_802B87E8.unk18;
|
||||
sp58.unk1C = (u16) D_802B87E8.unk1C;
|
||||
temp_f0 = func_802B80D0(shell->pos, (u16) camera->rotX2, 0, *(&D_80150130 + (((s32) (camera - camera1) / 184) * 4)), D_802B96AC);
|
||||
if (temp_f0 < 0.0f) {
|
||||
func_80297230(arg0, arg2);
|
||||
func_80297230(camera, shell);
|
||||
return;
|
||||
}
|
||||
sp50 = temp_f0;
|
||||
func_802972B8(arg0, arg2);
|
||||
func_802972B8(camera, shell);
|
||||
if (temp_f0 < D_802B96B0) {
|
||||
func_802979F8(arg2, 0x4059999A, arg1);
|
||||
func_802979F8(shell, 0x4059999A, arg1);
|
||||
}
|
||||
if (arg2->unk0 == 0x2A) {
|
||||
if (shell->type == 0x002A) {
|
||||
phi_t3 = D_802BA054;
|
||||
} else {
|
||||
phi_t3 = D_802BA050;
|
||||
}
|
||||
temp_t8 = (arg2->unk10 / 0x1111) & 0xFFFF;
|
||||
arg1->unk30 = arg2->unk18;
|
||||
temp_t8 = ((s32) (u16) shell->rotVelocity / 4369) & 0xFFFF;
|
||||
arg1->unk30 = (f32) shell->pos[0];
|
||||
temp_t3 = phi_t3 + (sp + (temp_t8 * 2))->unk58;
|
||||
arg1->unk34 = (arg2->unk1C - arg2->unkC) + 1.0f;
|
||||
arg1->unk38 = arg2->unk20;
|
||||
arg1->unk34 = (f32) ((shell->pos[1] - shell->boundingBoxSize) + 1.0f);
|
||||
arg1->unk38 = (f32) shell->pos[2];
|
||||
sp7C = temp_t8;
|
||||
sp54 = temp_t3;
|
||||
if (func_802B4FF8(arg1, 0, arg1) != 0) {
|
||||
temp_v0 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0 + 8;
|
||||
temp_v0->unk0 = 0xFD500000;
|
||||
temp_v0->unk4 = temp_t3 & 0x1FFFFFFF;
|
||||
temp_v0->words.w0 = 0xFD500000;
|
||||
temp_v0->words.w1 = temp_t3 & 0x1FFFFFFF;
|
||||
temp_v0_2 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_2 + 8;
|
||||
temp_v0_2->unk0 = 0xF5500000;
|
||||
temp_v0_2->unk4 = 0x7080200;
|
||||
temp_v0_2->words.w0 = 0xF5500000;
|
||||
temp_v0_2->words.w1 = 0x07080200;
|
||||
temp_v0_3 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_3 + 8;
|
||||
temp_v0_3->unk4 = 0;
|
||||
temp_v0_3->unk0 = 0xE6000000;
|
||||
temp_v0_3->words.w1 = 0;
|
||||
temp_v0_3->words.w0 = 0xE6000000;
|
||||
temp_v0_4 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_4 + 8;
|
||||
temp_v0_4->unk4 = 0x71FF200;
|
||||
temp_v0_4->unk0 = 0xF3000000;
|
||||
temp_v0_4->words.w1 = 0x071FF200;
|
||||
temp_v0_4->words.w0 = 0xF3000000;
|
||||
temp_v0_5 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_5 + 8;
|
||||
temp_v0_5->unk4 = 0;
|
||||
temp_v0_5->unk0 = 0xE7000000;
|
||||
temp_v0_5->words.w1 = 0;
|
||||
temp_v0_5->words.w0 = 0xE7000000;
|
||||
temp_v0_6 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_6 + 8;
|
||||
temp_v0_6->unk0 = 0xF5480800;
|
||||
temp_v0_6->unk4 = 0x80200;
|
||||
temp_v0_6->words.w0 = 0xF5480800;
|
||||
temp_v0_6->words.w1 = 0x00080200;
|
||||
temp_v0_7 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_7 + 8;
|
||||
temp_v0_7->unk0 = 0xF2000000;
|
||||
temp_v0_7->unk4 = 0x7C07C;
|
||||
if (sp7C < 8) {
|
||||
temp_v0_7->words.w0 = 0xF2000000;
|
||||
temp_v0_7->words.w1 = 0x0007C07C;
|
||||
if ((s32) sp7C < 8) {
|
||||
temp_v0_8 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_8 + 8;
|
||||
temp_v0_8->unk0 = 0x6000000;
|
||||
temp_v0_8->unk4 = &D_0D005338;
|
||||
temp_v0_8->words.w0 = 0x06000000;
|
||||
temp_v0_8->words.w1 = (u32) &D_0D005338;
|
||||
return;
|
||||
}
|
||||
temp_v0_9 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_9 + 8;
|
||||
temp_v0_9->unk0 = 0x6000000;
|
||||
temp_v0_9->unk4 = &D_0D005368;
|
||||
// Duplicate return node #11. Try simplifying control flow for better match
|
||||
temp_v0_9->words.w0 = 0x06000000;
|
||||
temp_v0_9->words.w1 = (u32) &D_0D005368;
|
||||
}
|
||||
}
|
||||
*/
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_actors/func_8029A3AC.s")
|
||||
#endif
|
||||
@@ -4931,7 +4926,7 @@ s32 func_8029F408(Player *arg0, Player *arg1) {
|
||||
if ((temp_a3->posY - arg1->posZ) < 0.0f) {
|
||||
return 0;
|
||||
}
|
||||
if ((temp_a3->unk_070 + (bitwise f32) arg1->unk_00C) < temp_f2_2) {
|
||||
if ((temp_a3->boundingBoxSize + (bitwise f32) arg1->unk_00C) < temp_f2_2) {
|
||||
return 0;
|
||||
}
|
||||
if ((temp_a3->unk_000 & 0x4000) != 0) {
|
||||
@@ -5148,7 +5143,7 @@ s32 func_8029FB80(Player *arg0, struct Actor *arg1) {
|
||||
f32 temp_f16;
|
||||
f32 temp_f2;
|
||||
|
||||
temp_f0 = arg0->unk_070 + arg1->unkC;
|
||||
temp_f0 = arg0->boundingBoxSize + arg1->unkC;
|
||||
temp_f2 = arg1->unk18[0] - arg0->pos[0];
|
||||
if (temp_f0 < temp_f2) {
|
||||
return 0;
|
||||
@@ -5817,14 +5812,14 @@ void func_802A0E44(void) {
|
||||
f32 func_802ABEAC(UnkActorInner*, Vec3f);
|
||||
extern f32 D_802B99CC;
|
||||
|
||||
void func_802A1064(struct Actor *arg0) {
|
||||
if (arg0 - &D_8015F9B8[0] > 100u) { return; }
|
||||
if ((arg0->unk2 & 0x8000) == 0) { return; }
|
||||
void func_802A1064(struct fake_item_box *fake_item_box) {
|
||||
if (fake_item_box - (struct fake_item_box*)D_8015F9B8 > 100u) { return; }
|
||||
if ((fake_item_box->flags & 0x8000) == 0) { return; }
|
||||
|
||||
if (arg0->unk0 == 13) {
|
||||
arg0->unk6 = 1;
|
||||
arg0->unk24[1] = func_802ABEAC(&arg0->unk30, arg0->unk18) + D_802B99CC;
|
||||
arg0->unk4 = 100;
|
||||
if (fake_item_box->type == 13) {
|
||||
fake_item_box->state = 1;
|
||||
fake_item_box->targetY = func_802ABEAC(&fake_item_box->unk30, fake_item_box->pos) + D_802B99CC;
|
||||
fake_item_box->someTimer = 100;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5832,8 +5827,8 @@ extern f32 D_802B99D0;
|
||||
extern f32 D_802B99D4;
|
||||
void func_802ADDC8(UnkActorInner*, f32, f32, f32, f32);
|
||||
void func_802B4E30(struct Actor*);
|
||||
void update_obj_fake_item_box(struct Actor *arg0) {
|
||||
u32 temp_v1 = arg0->unk24[0];
|
||||
void update_obj_fake_item_box(struct fake_item_box *fake_item_box) {
|
||||
u32 temp_v1 = fake_item_box->playerId;
|
||||
Player *temp_v0_4 = &gPlayers[temp_v1];
|
||||
struct Controller *temp_v1_3;
|
||||
|
||||
@@ -5844,75 +5839,75 @@ void update_obj_fake_item_box(struct Actor *arg0) {
|
||||
f32 temp_f18;
|
||||
s32 pad2[3];
|
||||
|
||||
switch(arg0->unk6) {
|
||||
switch(fake_item_box->state) {
|
||||
case 0:
|
||||
arg0->unkC = arg0->unk8 * 5.5f;
|
||||
arg0->unk10[0] -= 0xB6;
|
||||
arg0->unk10[1] += 0x16C;
|
||||
arg0->unk10[2] -= 0xB6;
|
||||
fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
|
||||
fake_item_box->rot[0] -= 0xB6;
|
||||
fake_item_box->rot[1] += 0x16C;
|
||||
fake_item_box->rot[2] -= 0xB6;
|
||||
|
||||
temp_f14 = temp_v0_4->pos[0] - arg0->unk18[0];
|
||||
temp_f16 = temp_v0_4->pos[1] - arg0->unk18[1];
|
||||
temp_f18 = temp_v0_4->pos[2] - arg0->unk18[2];
|
||||
temp_f14 = temp_v0_4->pos[0] - fake_item_box->pos[0];
|
||||
temp_f16 = temp_v0_4->pos[1] - fake_item_box->pos[1];
|
||||
temp_f18 = temp_v0_4->pos[2] - fake_item_box->pos[2];
|
||||
|
||||
temp_f2_2 = sqrtf((temp_f14 * temp_f14) + (temp_f16 * temp_f16) + (temp_f18 * temp_f18)) / 10.0f;
|
||||
temp_f14 /= temp_f2_2;
|
||||
temp_f16 /= temp_f2_2;
|
||||
temp_f18 /= temp_f2_2;
|
||||
arg0->unk18[0] = temp_v0_4->pos[0] - temp_f14;
|
||||
arg0->unk18[1] = (temp_v0_4->pos[1] - temp_f16) - 1.0f;
|
||||
arg0->unk18[2] = temp_v0_4->pos[2] - temp_f18;
|
||||
func_802ADDC8(&arg0->unk30, arg0->unkC, arg0->unk18[0], arg0->unk18[1], arg0->unk18[2]);
|
||||
func_802B4E30(arg0);
|
||||
fake_item_box->pos[0] = temp_v0_4->pos[0] - temp_f14;
|
||||
fake_item_box->pos[1] = (temp_v0_4->pos[1] - temp_f16) - 1.0f;
|
||||
fake_item_box->pos[2] = temp_v0_4->pos[2] - temp_f18;
|
||||
func_802ADDC8(&fake_item_box->unk30, fake_item_box->boundingBoxSize, fake_item_box->pos[0], fake_item_box->pos[1], fake_item_box->pos[2]);
|
||||
func_802B4E30(fake_item_box);
|
||||
temp_v1_3 = &gControllers[temp_v1];
|
||||
if ((temp_v0_4->unk_000 & 0x4000) != 0) {
|
||||
|
||||
if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) {
|
||||
temp_v1_3->buttonDepressed &= 0xDFFF;
|
||||
func_802A1064(arg0);
|
||||
func_802A1064(fake_item_box);
|
||||
temp_v0_4->unk_00C &= 0xFFFBFFFF;
|
||||
func_800C9060(((temp_v0_4 - gPlayerOne)) & 0xFF, 0x19008012);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (arg0->unk8 < 1.0f) {
|
||||
arg0->unk8 += D_802B99D0;
|
||||
} else if (arg0->unk8 >= 1.0f) {
|
||||
arg0->unk8 = 1.0f;
|
||||
if (fake_item_box->sizeScaling < 1.0f) {
|
||||
fake_item_box->sizeScaling += D_802B99D0;
|
||||
} else if (fake_item_box->sizeScaling >= 1.0f) {
|
||||
fake_item_box->sizeScaling = 1.0f;
|
||||
}
|
||||
|
||||
arg0->unkC = arg0->unk8 * 5.5f;
|
||||
if (arg0->unk24[1] <= arg0->unk18[1]) {
|
||||
arg0->unk18[1] = arg0->unk24[1];
|
||||
fake_item_box->boundingBoxSize = fake_item_box->sizeScaling * 5.5f;
|
||||
if (fake_item_box->targetY <= fake_item_box->pos[1]) {
|
||||
fake_item_box->pos[1] = fake_item_box->targetY;
|
||||
} else {
|
||||
arg0->unk18[1] += D_802B99D4;
|
||||
fake_item_box->pos[1] += D_802B99D4;
|
||||
}
|
||||
if ((arg0->unk2 & 0x1000) != 0) {
|
||||
if ((arg0->unk4 <= 0) || (arg0->unk4 >= 0x12D)) {
|
||||
arg0->unk2 &= 0xEFFF;
|
||||
arg0->unk4 = 0;
|
||||
if ((fake_item_box->flags & 0x1000) != 0) {
|
||||
if ((fake_item_box->someTimer <= 0) || (fake_item_box->someTimer >= 0x12D)) {
|
||||
fake_item_box->flags &= 0xEFFF;
|
||||
fake_item_box->someTimer = 0;
|
||||
} else {
|
||||
arg0->unk4--;
|
||||
fake_item_box->someTimer--;
|
||||
}
|
||||
}
|
||||
arg0->unk10[0] -= 0xB6;
|
||||
arg0->unk10[1] += 0x16C;
|
||||
arg0->unk10[2] -= 0xB6;
|
||||
fake_item_box->rot[0] -= 0xB6;
|
||||
fake_item_box->rot[1] += 0x16C;
|
||||
fake_item_box->rot[2] -= 0xB6;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if ((arg0->unk4 >= 0x14) || (arg0->unk4 < 0)) {
|
||||
func_8029E854(arg0);
|
||||
if ((fake_item_box->someTimer >= 0x14) || (fake_item_box->someTimer < 0)) {
|
||||
func_8029E854(fake_item_box);
|
||||
} else {
|
||||
arg0->unk4++;
|
||||
arg0->unk10[0] += 0x444;
|
||||
arg0->unk10[1] -= 0x2D8;
|
||||
arg0->unk10[2] += 0x16C;
|
||||
fake_item_box->someTimer++;
|
||||
fake_item_box->rot[0] += 0x444;
|
||||
fake_item_box->rot[1] -= 0x2D8;
|
||||
fake_item_box->rot[2] += 0x16C;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
func_8029E854(arg0);
|
||||
func_8029E854(fake_item_box);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -5934,60 +5929,59 @@ void func_802A14BC(f32 arg0, f32 arg1, f32 arg2) {
|
||||
}
|
||||
}
|
||||
|
||||
void update_obj_item_box_hot_air_balloon(struct Actor *arg0) {
|
||||
switch(arg0->unk6) {
|
||||
void update_obj_item_box_hot_air_balloon(struct item_box *itemBox) {
|
||||
switch(itemBox->state) {
|
||||
case 5:
|
||||
arg0->unk10[0] += 0xB6;
|
||||
arg0->unk10[1] -= 0x16C;
|
||||
arg0->unk10[2] += 0xB6;
|
||||
itemBox->rot[0] += 0xB6;
|
||||
itemBox->rot[1] -= 0x16C;
|
||||
itemBox->rot[2] += 0xB6;
|
||||
break;
|
||||
case 3:
|
||||
if (arg0->unk4 == 0x14) {
|
||||
arg0->unk6 = 5;
|
||||
arg0->unk2 = -0x4000;
|
||||
return;
|
||||
if (itemBox->someTimer == 0x14) {
|
||||
itemBox->state = 5;
|
||||
itemBox->flags = -0x4000;
|
||||
} else {
|
||||
itemBox->someTimer++;
|
||||
itemBox->rot[0] += 0x444;
|
||||
itemBox->rot[1] -= 0x2D8;
|
||||
itemBox->rot[2] += 0x16C;
|
||||
}
|
||||
arg0->unk4++;
|
||||
arg0->unk10[0] += 0x444;
|
||||
arg0->unk10[1] -= 0x2D8;
|
||||
arg0->unk10[2] += 0x16C;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
extern f32 D_802B99D8;
|
||||
extern f32 D_802B99DC;
|
||||
|
||||
void update_obj_item_box(struct Actor *arg0) {
|
||||
switch (arg0->unk6) {
|
||||
void update_obj_item_box(struct item_box *itemBox) {
|
||||
switch (itemBox->state) {
|
||||
case 0:
|
||||
arg0->unk6 = 1;
|
||||
itemBox->state = 1;
|
||||
break;
|
||||
case 1:
|
||||
if ((arg0->unk18[1] - arg0->unk24[0]) < D_802B99D8) {
|
||||
arg0->unk18[1] += D_802B99DC;
|
||||
if ((itemBox->pos[1] - itemBox->origY) < D_802B99D8) {
|
||||
itemBox->pos[1] += D_802B99DC;
|
||||
} else {
|
||||
arg0->unk18[1] = arg0->unk24[0] + D_802B99D8;
|
||||
arg0->unk6 = 2;
|
||||
arg0->unk2 = 0xC000;
|
||||
itemBox->pos[1] = itemBox->origY + D_802B99D8;
|
||||
itemBox->state = 2;
|
||||
itemBox->flags = 0xC000;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
arg0->unk10[0] += 0xB6;
|
||||
arg0->unk10[1] -= 0x16C;
|
||||
arg0->unk10[2] += 0xB6;
|
||||
itemBox->rot[0] += 0xB6;
|
||||
itemBox->rot[1] -= 0x16C;
|
||||
itemBox->rot[2] += 0xB6;
|
||||
break;
|
||||
case 3:
|
||||
if (arg0->unk4 == 20) {
|
||||
arg0->unk6 = 0;
|
||||
arg0->unk18[1] = arg0->unk8 - 20.0f;
|
||||
arg0->unk2 = 0xC000;
|
||||
if (itemBox->someTimer == 20) {
|
||||
itemBox->state = 0;
|
||||
itemBox->pos[1] = itemBox->resetDistance - 20.0f;
|
||||
itemBox->flags = 0xC000;
|
||||
} else {
|
||||
arg0->unk4++;
|
||||
arg0->unk10[0] += 0x444;
|
||||
arg0->unk10[1] -= 0x2D8;
|
||||
arg0->unk10[2] += 0x16C;
|
||||
itemBox->someTimer++;
|
||||
itemBox->rot[0] += 0x444;
|
||||
itemBox->rot[1] -= 0x2D8;
|
||||
itemBox->rot[2] += 0x16C;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+351
-356
File diff suppressed because it is too large
Load Diff
@@ -93,7 +93,7 @@ f32 D_800E2670[] = {
|
||||
f32 gKartTopSpeedTable[] = {
|
||||
9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0, 9.0,
|
||||
};
|
||||
f32 gKartBoundingBoxTable[] = {
|
||||
f32 gKartBoundingBoxSizeTable[] = {
|
||||
5.5, 5.5, 5.5, 5.5, 5.5, 6.0, 5.5, 6.0,
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -4475,7 +4475,7 @@ s32 func_802AFA34(Player *player, kartBoundingBoxCorner *corner, f32 cornerX, f3
|
||||
sp104 = 0x447A0000;
|
||||
sp108 = 0x447A0000;
|
||||
sp10C = 0x447A0000;
|
||||
temp_f20 = player->unk_070;
|
||||
temp_f20 = player->boundingBoxSize;
|
||||
spFE = 0x1388;
|
||||
sp100 = 0x1388;
|
||||
sp102 = 0x1388;
|
||||
|
||||
Reference in New Issue
Block a user