mirror of
https://github.com/n64decomp/mk64
synced 2026-08-01 08:07:27 -04:00
Various cleanup and matching (#369)
* More podium_ceremony_actors documentation * Updated progress script * Various matches and cleanup
This commit is contained in:
+1
-2
@@ -369,7 +369,6 @@ s16 func_80005FD0(Vec3f arg0, Vec3f arg1) {
|
||||
s32 func_80006018(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) {
|
||||
f32 temp_f0;
|
||||
f32 temp_f18;
|
||||
s32 var_v0;
|
||||
|
||||
temp_f0 = sqrtf((arg2 * arg2) + (arg3 * arg3));
|
||||
if (temp_f0 < 0.01f) {
|
||||
@@ -5774,7 +5773,7 @@ f32 func_80010480(s32 pathIndex, u16 wayPointIndex) {
|
||||
|
||||
void func_800107C4(s32 pathIndex) {
|
||||
f64 temp_f2;
|
||||
s32 temp_t3;
|
||||
UNUSED s32 pad;
|
||||
s32 var_a2;
|
||||
s32 var_s0;
|
||||
s32 var_t2;
|
||||
|
||||
+3
-1
@@ -3,6 +3,8 @@
|
||||
#include "config.h"
|
||||
#include "framebuffers.h"
|
||||
|
||||
#include "trig_tables.inc.c"
|
||||
|
||||
u16 gRandomSeed16;
|
||||
|
||||
u8 randomSeedPadding[216];
|
||||
@@ -21,4 +23,4 @@ u16 gFramebuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
u16 gFramebuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
u16 gFramebuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
u16 gFramebuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+5
-4
@@ -5,12 +5,13 @@
|
||||
#include <main.h>
|
||||
#include "framebuffers.h"
|
||||
#include <PR/rcp.h>
|
||||
// Location based from sm64.
|
||||
// This may need to be moved before framebuffers.c
|
||||
// If math_util has data that does not line-up with trig_tables.
|
||||
#include "trig_tables.inc.c"
|
||||
#include <trig_tables.h>
|
||||
|
||||
#pragma intrinsic (sqrtf)
|
||||
|
||||
s32 D_802B91C0[2] = { 13, 13 };
|
||||
Vec3f D_802B91C8 = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Nearly matches
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "trig_tables.h"
|
||||
|
||||
//#define sins(x) gSineTable[(u16) (x) >> 4]
|
||||
//#define coss(x) gCosineTable[(u16) (x) >> 4]
|
||||
|
||||
@@ -397,17 +397,16 @@ extern s16 D_802874D0;
|
||||
|
||||
void update_actors_loop(void) {
|
||||
void (*func)(void *);
|
||||
CeremonyActor *actor;
|
||||
s32 i;
|
||||
s32 j;
|
||||
spawn_timer();
|
||||
D_802874D0 = 0;
|
||||
|
||||
// Why do we loop over the actor list three times?
|
||||
// Actors don't with no loop. fireworks don't spawn if the iterator is 2.
|
||||
for (i = 0; i < 3; i++) {
|
||||
actor = sPodiumActorList;
|
||||
// High loop count to produce randomness? May also be a sort of delta?
|
||||
// If this was for random, wouldn't it make everything move farther?
|
||||
CeremonyActor *actor = sPodiumActorList;
|
||||
for (j = 0; j < 200; j++) {
|
||||
// @bug Check should be outside of this loop
|
||||
if (actor->isActive & 1) {
|
||||
|
||||
func = sUpdate[actor->type][i];
|
||||
|
||||
+176
-214
@@ -18,6 +18,10 @@
|
||||
#include "race_logic.h"
|
||||
#include "skybox_and_splitscreen.h"
|
||||
#include "math_util_2.h"
|
||||
#include "code_8008C1D0.h"
|
||||
#include "math.h"
|
||||
|
||||
#pragma intrinsic (sqrtf)
|
||||
|
||||
extern Player *gPlayerTwo;
|
||||
extern Player *gPlayerThree;
|
||||
@@ -91,9 +95,6 @@ extern f32 D_80150148;
|
||||
|
||||
extern u16 D_8015F894;
|
||||
|
||||
s32 D_802B91C0[2] = { 13, 13 };
|
||||
Vec3f D_802B91C8 = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
u16 D_802BA030;
|
||||
u16 D_802BA032;
|
||||
|
||||
@@ -145,9 +146,8 @@ void func_8028E028(void) {
|
||||
D_802BA038 = 10;
|
||||
}
|
||||
|
||||
// func_8028E0F0
|
||||
void update_player_battle_status(void) {
|
||||
Player *ply;
|
||||
Player *player;
|
||||
s32 playerIndex;
|
||||
s16 playersAlive[4];
|
||||
s16 playersDead[4];
|
||||
@@ -155,21 +155,21 @@ void update_player_battle_status(void) {
|
||||
s16 deadCounter = 0;
|
||||
|
||||
for (playerIndex = 0; playerIndex < 4; playerIndex++) {
|
||||
ply = (Player *)&gPlayers[playerIndex];
|
||||
if (!(ply->unk_000 & PLAYER_EXISTS)) {
|
||||
player = &gPlayers[playerIndex];
|
||||
if (!(player->unk_000 & PLAYER_EXISTS)) {
|
||||
continue;
|
||||
}
|
||||
if (ply->unk_000 & PLAYER_CINEMATIC_MODE) {
|
||||
if (player->unk_000 & PLAYER_CINEMATIC_MODE) {
|
||||
continue;
|
||||
}
|
||||
// If player has no balloons left
|
||||
if (gPlayerBalloonCount[playerIndex] < 0) {
|
||||
ply->unk_000 |= PLAYER_CINEMATIC_MODE;
|
||||
playersDead[deadCounter] = (s16) (ply - gPlayerOne);
|
||||
player->unk_000 |= PLAYER_CINEMATIC_MODE;
|
||||
playersDead[deadCounter] = (s16) (player - gPlayerOne);
|
||||
deadCounter++;
|
||||
func_800CA118((u8) playerIndex); // play sad character sound?
|
||||
} else {
|
||||
playersAlive[aliveCounter] = (s16) (ply - gPlayerOne);
|
||||
playersAlive[aliveCounter] = (s16) (player - gPlayerOne);
|
||||
aliveCounter++;
|
||||
}
|
||||
}
|
||||
@@ -574,13 +574,12 @@ void func_8028EEF0(s32 i) {
|
||||
}
|
||||
|
||||
void func_8028EF28(void) {
|
||||
Player *ply;
|
||||
s16 currentPosition;
|
||||
s32 i;
|
||||
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
ply = &gPlayers[i];
|
||||
Player *player = &gPlayers[i];
|
||||
|
||||
if ((gPlayers[i].unk_000 & PLAYER_EXISTS) == 0) {
|
||||
continue;
|
||||
@@ -615,7 +614,7 @@ void func_8028EF28(void) {
|
||||
D_800DC510 = 4;
|
||||
}
|
||||
if (gModeSelection == TIME_TRIALS) {
|
||||
func_80005AE8(ply);
|
||||
func_80005AE8(player);
|
||||
}
|
||||
|
||||
|
||||
@@ -688,7 +687,7 @@ void func_8028EF28(void) {
|
||||
} else if (gPlayers[i].lapCount == 3) {
|
||||
func_8028EEF0(i);
|
||||
if (gModeSelection == TIME_TRIALS) {
|
||||
func_80005AE8(ply);
|
||||
func_80005AE8(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -849,94 +848,86 @@ void func_8028F914(void) {
|
||||
func_8028F588();
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f
|
||||
? func_800C9F90(?); /* extern */
|
||||
extern s32 D_80162DF0;
|
||||
static u16 D_800DC5A8; /* unable to generate initializer */
|
||||
extern u16 D_800DC5A8;
|
||||
|
||||
void func_8028F970(void) {
|
||||
Player *var_s3;
|
||||
s32 var_s2;
|
||||
struct Controller *temp_s0;
|
||||
u16 temp_t7;
|
||||
u16 temp_v0;
|
||||
u16 temp_v0_2;
|
||||
u16 temp_v0_3;
|
||||
s32 i;
|
||||
|
||||
if (D_8015F890 == 0) {
|
||||
var_s3 = gPlayers;
|
||||
var_s2 = 0;
|
||||
loop_2:
|
||||
temp_v0 = var_s3->unk_000;
|
||||
if ((temp_v0 & 0x4000) && !(temp_v0 & 0x1000)) {
|
||||
temp_s0 = &gControllers[var_s2];
|
||||
if (gActiveScreenMode != 3) {
|
||||
temp_v0_2 = temp_s0->buttonPressed;
|
||||
if ((temp_v0_2 & L_TRIG) && !(temp_s0->button & R_TRIG)) {
|
||||
temp_s0->buttonPressed = temp_v0_2 & 0xFFDF;
|
||||
temp_t7 = D_800DC5A8 + 1;
|
||||
D_800DC5A8 = temp_t7;
|
||||
if ((temp_t7 & 0xFFFF) >= 3) {
|
||||
D_800DC5A8 = 0;
|
||||
}
|
||||
play_sound2(0x4900801C);
|
||||
func_800029B0();
|
||||
if (D_8015F890) {
|
||||
return;
|
||||
}
|
||||
|
||||
// todo: increasing players past four would require increase this loop iterator.
|
||||
for (i = 0; i < 4; i++) {
|
||||
|
||||
Player *player = &gPlayers[i];
|
||||
struct Controller *controller = &gControllers[i];
|
||||
|
||||
if (!(player->unk_000 & PLAYER_HUMAN)) { continue; }
|
||||
if (player->unk_000 & PLAYER_CPU) { continue; }
|
||||
|
||||
if (gActiveScreenMode != SCREEN_MODE_3P_4P_SPLITSCREEN) {
|
||||
if ((controller->buttonPressed & L_TRIG) && !(controller->button & R_TRIG)) {
|
||||
controller->buttonPressed &= 0xFFDF;
|
||||
|
||||
D_800DC5A8++;
|
||||
if (D_800DC5A8 >= 3) {
|
||||
D_800DC5A8 = 0;
|
||||
}
|
||||
play_sound2(0x4900801C);
|
||||
func_800029B0();
|
||||
}
|
||||
}
|
||||
if ((controller->buttonPressed & START_BUTTON) &&
|
||||
(!(controller->button & R_TRIG)) &&
|
||||
(!(controller->button & L_TRIG))) {
|
||||
func_8028DF00();
|
||||
gIsGamePaused = (controller - gControllerOne) + 1;
|
||||
controller->buttonPressed = 0;
|
||||
func_800C9F90(1);
|
||||
D_80162DF0 = 1;
|
||||
if (gModeSelection == TIME_TRIALS) {
|
||||
if (gPlayerOne->unk_000 & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
|
||||
func_80005AE8(gPlayerOne);
|
||||
}
|
||||
if (gPlayerTwo->unk_000 & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
|
||||
func_80005AE8(gPlayerTwo);
|
||||
}
|
||||
if (gPlayerThree->unk_000 & (PLAYER_EXISTS | PLAYER_INVISIBLE_OR_BOMB)) {
|
||||
func_80005AE8(gPlayerThree);
|
||||
}
|
||||
}
|
||||
if ((temp_s0->buttonPressed & START_BUTTON) && (temp_v0_3 = temp_s0->button, ((temp_v0_3 & R_TRIG) == 0)) && !(temp_v0_3 & L_TRIG)) {
|
||||
func_8028DF00();
|
||||
gIsGamePaused = ((s32) (temp_s0 - gControllerOne) >> 4) + 1;
|
||||
temp_s0->buttonPressed = 0;
|
||||
func_800C9F90(1);
|
||||
D_80162DF0 = 1;
|
||||
if (gModeSelection == 1) {
|
||||
if (gPlayerOne->unk_000 & 0x8100) {
|
||||
func_80005AE8(gPlayerOne);
|
||||
}
|
||||
if (gPlayerTwo->unk_000 & 0x8100) {
|
||||
func_80005AE8(gPlayerTwo);
|
||||
}
|
||||
if (gPlayerThree->unk_000 & 0x8100) {
|
||||
func_80005AE8(gPlayerThree);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
goto block_20;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (gEnableDebugMode) {
|
||||
if (gModeSelection == BATTLE) {
|
||||
// do stuff?
|
||||
} else {
|
||||
block_20:
|
||||
var_s2 += 1;
|
||||
var_s3 += 0xDD8;
|
||||
if (var_s2 == 4) {
|
||||
if ((gEnableDebugMode != 0) && (gModeSelection != BATTLE)) {
|
||||
if (gControllerOne->buttonPressed & U_JPAD) {
|
||||
gLapCountByPlayerId->unk0 = 2;
|
||||
}
|
||||
if (gControllerOne->buttonPressed & R_JPAD) {
|
||||
gLapCountByPlayerId->unk0 = 2;
|
||||
gLapCountByPlayerId->unk4 = 2;
|
||||
}
|
||||
if (gControllerOne->buttonPressed & D_JPAD) {
|
||||
gLapCountByPlayerId->unk0 = 2;
|
||||
gLapCountByPlayerId->unk4 = 2;
|
||||
gLapCountByPlayerId->unk8 = 2;
|
||||
gLapCountByPlayerId->unkC = 2;
|
||||
gLapCountByPlayerId->unk10 = 2;
|
||||
gLapCountByPlayerId->unk14 = 2;
|
||||
gLapCountByPlayerId->unk18 = 2;
|
||||
gLapCountByPlayerId->unk1C = 2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
goto loop_2;
|
||||
if (gControllerOne->buttonPressed & U_JPAD) {
|
||||
gLapCountByPlayerId[0] = 2;
|
||||
}
|
||||
if (gControllerOne->buttonPressed & R_JPAD) {
|
||||
gLapCountByPlayerId[0] = 2;
|
||||
gLapCountByPlayerId[1] = 2;
|
||||
}
|
||||
if (gControllerOne->buttonPressed & D_JPAD) {
|
||||
gLapCountByPlayerId[0] = 2;
|
||||
gLapCountByPlayerId[1] = 2;
|
||||
gLapCountByPlayerId[2] = 2;
|
||||
gLapCountByPlayerId[3] = 2;
|
||||
gLapCountByPlayerId[4] = 2;
|
||||
gLapCountByPlayerId[5] = 2;
|
||||
gLapCountByPlayerId[6] = 2;
|
||||
gLapCountByPlayerId[7] = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/race_logic/func_8028F970.s")
|
||||
#endif
|
||||
//#else
|
||||
//GLOBAL_ASM("asm/non_matchings/race_logic/func_8028F970.s")
|
||||
//#endif
|
||||
|
||||
void func_8028FBD4(void) {
|
||||
gMenuSelectionFromQuit = START_MENU_FROM_QUIT;
|
||||
@@ -1175,138 +1166,109 @@ void func_802903B0(void) {
|
||||
gMenuSelectionFromQuit = RACING;
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
|
||||
static f32 D_802B92A0 = 0.1f;
|
||||
static f32 D_802B92A4 = 0.2f;
|
||||
static f32 D_802B92A8 = 0.55f;
|
||||
static f64 D_802B92B0 = 0.85;
|
||||
static ? gFloatArray802B8790; /* unable to generate initializer */
|
||||
|
||||
void func_802903D8(Player *player_one, Player *player_two) {
|
||||
f32 sp74;
|
||||
f32 sp70;
|
||||
f32 sp68;
|
||||
f32 sp64;
|
||||
f32 sp60;
|
||||
f32 sp5C;
|
||||
f32 sp58;
|
||||
f32 sp54;
|
||||
f32 sp24;
|
||||
f32 sp20;
|
||||
void func_802903D8(Player *playerOne, Player *playerTwo) {
|
||||
f32 sp70 = (playerOne->boundingBoxSize + playerTwo->boundingBoxSize) - 5.0f;
|
||||
f32 temp_f0;
|
||||
f32 sp74;
|
||||
Vec3f sp60;
|
||||
Vec3f sp54;
|
||||
f32 temp_f0_2;
|
||||
f32 temp_f0_3;
|
||||
f32 temp_f0_4;
|
||||
f32 temp_f14;
|
||||
f32 temp_f16;
|
||||
f32 temp_f2;
|
||||
f32 temp_f2_2;
|
||||
f32 temp_f4;
|
||||
f32 temp_f6;
|
||||
f32 temp_f6_2;
|
||||
s32 temp_v0;
|
||||
|
||||
temp_f4 = (player_one->boundingBoxSize + player_two->boundingBoxSize) - 5.0f;
|
||||
sp74 = temp_f4;
|
||||
sp28[0].unk0 = gFloatArray802B8790.unk0;
|
||||
sp28[0].unk4 = (s32) gFloatArray802B8790.unk4;
|
||||
sp28[0].unk8 = (s32) gFloatArray802B8790.unk8;
|
||||
sp28[0].unkC = (s32) gFloatArray802B8790.unkC;
|
||||
sp28[0].unk10 = (s32) gFloatArray802B8790.unk10;
|
||||
sp28[0].unk14 = (s32) gFloatArray802B8790.unk14;
|
||||
sp28[0].unk18 = (s32) gFloatArray802B8790.unk18;
|
||||
sp28[0].unk1C = (s32) gFloatArray802B8790.unk1C;
|
||||
sp24 = (&sp28[0])[player_one->characterId];
|
||||
sp20 = (&sp28[0])[player_two->characterId];
|
||||
sp60 = player_one->pos[0] - player_two->pos[0];
|
||||
temp_f6 = (player_one->pos[1] - player_one->boundingBoxSize) - (player_two->pos[1] - player_two->boundingBoxSize);
|
||||
sp64 = temp_f6;
|
||||
sp68 = player_one->pos[2] - player_two->pos[2];
|
||||
sp54 = player_two->unk_034[0] - player_one->unk_034[0];
|
||||
sp58 = player_two->unk_034[1] - player_one->unk_034[1];
|
||||
sp5C = player_two->unk_034[2] - player_one->unk_034[2];
|
||||
temp_f0 = sqrtf((sp68 * sp68) + ((sp60 * sp60) + (temp_f6 * temp_f6)));
|
||||
if (!(temp_f0 < D_802B92A0) && !(temp_f4 < temp_f0)) {
|
||||
if (player_one->unk_000 & 0x40) {
|
||||
if (player_two->unk_000 & 0x40) {
|
||||
func_8008FC1C(player_one);
|
||||
func_8008FC1C(player_two);
|
||||
func_800C9060(((s32) (player_two - gPlayerOne) / 3544) & 0xFF, 0x19008001U);
|
||||
return;
|
||||
}
|
||||
player_two->statusEffects |= 0x400000;
|
||||
sp70 = temp_f0;
|
||||
func_8008FC1C(player_one);
|
||||
func_800C9060(((s32) (player_two - gPlayerOne) / 3544) & 0xFF, 0x19008001U);
|
||||
goto block_8;
|
||||
}
|
||||
if (player_two->unk_000 & 0x40) {
|
||||
player_one->statusEffects |= 0x400000;
|
||||
func_8008FC1C(player_two);
|
||||
func_800C9060(((s32) (player_one - gPlayerOne) / 3544) & 0xFF, 0x19008001U);
|
||||
f32 gFloatArray802B8790[] = {
|
||||
1.2, 1.0, 0.9, 0.7, 2.0, 1.8, 0.9, 2.3
|
||||
};
|
||||
|
||||
f32 sp24 = gFloatArray802B8790[playerOne->characterId];
|
||||
f32 sp20 = gFloatArray802B8790[playerTwo->characterId];
|
||||
|
||||
sp60[0] = playerOne->pos[0] - playerTwo->pos[0];
|
||||
sp60[1] = (playerOne->pos[1] - playerOne->boundingBoxSize) - (playerTwo->pos[1] - playerTwo->boundingBoxSize);
|
||||
sp60[2] = playerOne->pos[2] - playerTwo->pos[2];
|
||||
|
||||
sp54[0] = playerTwo->unk_034[0] - playerOne->unk_034[0];
|
||||
sp54[1] = playerTwo->unk_034[1] - playerOne->unk_034[1];
|
||||
sp54[2] = playerTwo->unk_034[2] - playerOne->unk_034[2];
|
||||
|
||||
temp_f0 = sqrtf((sp60[0] * sp60[0]) + (sp60[1] * sp60[1]) + (sp60[2] * sp60[2]));
|
||||
|
||||
if (temp_f0 < 0.1f) { return; }
|
||||
|
||||
sp74 = temp_f0 - sp70;
|
||||
if (sp74 > 0) { return; }
|
||||
|
||||
|
||||
if (playerOne->unk_000 & PLAYER_UNKNOWN_0x40) {
|
||||
if (playerTwo->unk_000 & PLAYER_UNKNOWN_0x40) {
|
||||
func_8008FC1C(playerOne);
|
||||
func_8008FC1C(playerTwo);
|
||||
func_800C9060((playerTwo - gPlayerOne), 0x19008001U);
|
||||
return;
|
||||
}
|
||||
block_8:
|
||||
temp_v0 = player_one->unk_0BC;
|
||||
if (temp_v0 & 0x200) {
|
||||
if (!(player_two->unk_0BC & 0x200)) {
|
||||
player_two->statusEffects |= 0x01000000;
|
||||
}
|
||||
} else if (player_two->unk_0BC & 0x200) {
|
||||
player_one->statusEffects |= 0x01000000;
|
||||
} else {
|
||||
player_one->unk_0BC = temp_v0 | 0x8000;
|
||||
player_two->unk_0BC |= 0x8000;
|
||||
playerTwo->statusEffects |= 0x400000;
|
||||
func_8008FC1C(playerOne);
|
||||
func_800C9060((playerTwo - gPlayerOne), 0x19008001U);
|
||||
}
|
||||
temp_f6_2 = sp60 / temp_f0;
|
||||
temp_f0_2 = sqrtf((sp5C * sp5C) + ((sp54 * sp54) + (sp58 * sp58)));
|
||||
sp60 = temp_f6_2;
|
||||
sp64 /= temp_f0;
|
||||
sp68 /= temp_f0;
|
||||
if (temp_f0_2 < D_802B92A4) {
|
||||
temp_f14 = (player_one->boundingBoxSize + player_two->boundingBoxSize) * D_802B92A8;
|
||||
player_one->pos[0] = (temp_f6_2 * temp_f14) + player_two->pos[0];
|
||||
player_one->pos[1] = (sp64 * temp_f14) + player_two->pos[1];
|
||||
player_one->pos[2] = (sp68 * temp_f14) + player_two->pos[2];
|
||||
player_two->pos[0] -= temp_f14 * sp60;
|
||||
player_two->pos[1] -= temp_f14 * sp64;
|
||||
player_two->pos[2] -= temp_f14 * sp68;
|
||||
return;
|
||||
}
|
||||
temp_f16 = (f32) ((f64) (temp_f0_2 * (((sp5C * sp68) + ((sp60 * sp54) + (sp64 * sp58))) / temp_f0_2)) * D_802B92B0);
|
||||
if ((player_one->unk_0BC & 0x200) != 0x200) {
|
||||
temp_f2 = (temp_f16 * sp20) / sp24;
|
||||
player_one->unk_034[0] += sp60 * temp_f2;
|
||||
player_one->unk_034[1] += sp64 * temp_f2;
|
||||
player_one->unk_034[2] += sp68 * temp_f2;
|
||||
temp_f0_3 = temp_f0 - sp74;
|
||||
player_one->pos[0] -= sp60 * temp_f0_3 * 0.5f;
|
||||
player_one->pos[1] -= sp64 * temp_f0_3 * 0.5f;
|
||||
player_one->pos[2] -= sp68 * temp_f0_3 * 0.5f;
|
||||
}
|
||||
if ((player_two->unk_0BC & 0x200) != 0x200) {
|
||||
temp_f2_2 = (temp_f16 * sp24) / sp20;
|
||||
player_two->unk_034[0] -= sp60 * temp_f2_2;
|
||||
player_two->unk_034[1] -= sp64 * temp_f2_2;
|
||||
player_two->unk_034[2] -= sp68 * temp_f2_2;
|
||||
temp_f0_4 = temp_f0 - sp74;
|
||||
player_two->pos[0] += sp60 * temp_f0_4 * 0.5f;
|
||||
player_two->pos[1] += sp64 * temp_f0_4 * 0.5f;
|
||||
player_two->pos[2] += sp68 * temp_f0_4 * 0.5f;
|
||||
}
|
||||
if (player_one->unk_000 & 0x4000) {
|
||||
func_800C9060(((s32) (player_one - gPlayerOne) / 3544) & 0xFF, 0x19008001U);
|
||||
return;
|
||||
}
|
||||
if (player_two->unk_000 & 0x4000) {
|
||||
func_800C9060(((s32) (player_two - gPlayerOne) / 3544) & 0xFF, 0x19008001U);
|
||||
} else if (playerTwo->unk_000 & PLAYER_UNKNOWN_0x40) {
|
||||
playerOne->statusEffects |= 0x400000;
|
||||
func_8008FC1C(playerTwo);
|
||||
func_800C9060(playerOne - gPlayerOne, 0x19008001U);
|
||||
return;
|
||||
}
|
||||
if (playerOne->unk_0BC & 0x200) {
|
||||
if (!(playerTwo->unk_0BC & 0x200)) {
|
||||
playerTwo->statusEffects |= 0x01000000;
|
||||
}
|
||||
} else if (playerTwo->unk_0BC & 0x200) {
|
||||
playerOne->statusEffects |= 0x01000000;
|
||||
} else {
|
||||
playerOne->unk_0BC |= 0x8000;
|
||||
playerTwo->unk_0BC |= 0x8000;
|
||||
}
|
||||
temp_f0_2 = sqrtf((sp54[0] * sp54[0]) + (sp54[1] * sp54[1]) + (sp54[2] * sp54[2]));
|
||||
sp60[0] /= temp_f0;
|
||||
sp60[1] /= temp_f0;
|
||||
sp60[2] /= temp_f0;
|
||||
if (temp_f0_2 < 0.2f) {
|
||||
temp_f0 = (playerOne->boundingBoxSize + playerTwo->boundingBoxSize) * 0.55f;
|
||||
playerOne->pos[0] = playerTwo->pos[0] + (sp60[0] * temp_f0);
|
||||
playerOne->pos[1] = playerTwo->pos[1] + (sp60[1] * temp_f0);
|
||||
playerOne->pos[2] = playerTwo->pos[2] + (sp60[2] * temp_f0);
|
||||
playerTwo->pos[0] -= temp_f0 * sp60[0];
|
||||
playerTwo->pos[1] -= temp_f0 * sp60[1];
|
||||
playerTwo->pos[2] -= temp_f0 * sp60[2];
|
||||
return;
|
||||
} else {
|
||||
temp_f16 = ((sp60[0] * sp54[0]) + (sp60[1] * sp54[1]) + (sp60[2] * sp54[2])) / temp_f0_2;
|
||||
}
|
||||
temp_f0_2 = temp_f0_2 * temp_f16 * 0.85;
|
||||
if ((playerOne->unk_0BC & 0x200) != 0x200) {
|
||||
temp_f2 = (temp_f0_2 * sp20) / sp24;
|
||||
playerOne->unk_034[0] += sp60[0] * temp_f2;
|
||||
playerOne->unk_034[1] += sp60[1] * temp_f2;
|
||||
playerOne->unk_034[2] += sp60[2] * temp_f2;
|
||||
playerOne->pos[0] -= sp60[0] * sp74 * 0.5f;
|
||||
playerOne->pos[1] -= sp60[1] * sp74 * 0.5f;
|
||||
playerOne->pos[2] -= sp60[2] * sp74 * 0.5f;
|
||||
}
|
||||
if ((playerTwo->unk_0BC & 0x200) != 0x200) {
|
||||
temp_f2 = (temp_f0_2 * sp24) / sp20;
|
||||
playerTwo->unk_034[0] -= sp60[0] * temp_f2;
|
||||
playerTwo->unk_034[1] -= sp60[1] * temp_f2;
|
||||
playerTwo->unk_034[2] -= sp60[2] * temp_f2;
|
||||
playerTwo->pos[0] += sp60[0] * sp74 * 0.5f;
|
||||
playerTwo->pos[1] += sp60[1] * sp74 * 0.5f;
|
||||
playerTwo->pos[2] += sp60[2] * sp74 * 0.5f;
|
||||
}
|
||||
if (playerOne->unk_000 & PLAYER_HUMAN) {
|
||||
func_800C9060((playerOne - gPlayerOne), 0x19008001U);
|
||||
return;
|
||||
}
|
||||
if (playerTwo->unk_000 & PLAYER_HUMAN) {
|
||||
func_800C9060((playerTwo - gPlayerOne), 0x19008001U);
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/race_logic/func_802903D8.s")
|
||||
#endif
|
||||
|
||||
void func_802909F0(void) {
|
||||
Player *ply;
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
#include "render_courses.h"
|
||||
#include "skybox_and_splitscreen.h"
|
||||
|
||||
f32 gFloatArray802B8790[] = {
|
||||
1.2, 1.0, 0.9, 0.7, 2.0, 1.8, 0.9, 2.3
|
||||
};
|
||||
s16 D_802B87B0 = 995;
|
||||
s16 D_802B87B4 = 1000;
|
||||
UNUSED s32 D_802B87B8 = 0;
|
||||
|
||||
@@ -30,5 +30,6 @@ extern s32 func_80040174(void *, s32, s32);
|
||||
extern s32 D_80162DC8;
|
||||
extern s32 D_80162DCC;
|
||||
extern s32 D_80162E00;
|
||||
extern s32 D_80162DF0;
|
||||
|
||||
#endif /* STAFF_GHOSTS_H */
|
||||
|
||||
Reference in New Issue
Block a user