Player struct member naming and matched a few funcs (#262)

* Player struct member naming
* Matched a few funcs
This commit is contained in:
MegaMech 2022-09-26 13:59:41 -06:00 committed by GitHub
parent 754e31da04
commit 82b53f5928
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 258 additions and 303 deletions

View File

@ -1,18 +0,0 @@
glabel func_80009258
/* 009E58 80009258 3C018016 */ lui $at, %hi(D_8016344C) # $at, 0x8016
/* 009E5C 8000925C 44867000 */ mtc1 $a2, $f14
/* 009E60 80009260 C42C344C */ lwc1 $f12, %lo(D_8016344C)($at)
/* 009E64 80009264 AFA50004 */ sw $a1, 4($sp)
/* 009E68 80009268 C7A40004 */ lwc1 $f4, 4($sp)
/* 009E6C 8000926C 460E6081 */ sub.s $f2, $f12, $f14
/* 009E70 80009270 3C01800F */ lui $at, %hi(D_800ECFA4) # $at, 0x800f
/* 009E74 80009274 C426CFA4 */ lwc1 $f6, %lo(D_800ECFA4)($at)
/* 009E78 80009278 460C2401 */ sub.s $f16, $f4, $f12
/* 009E7C 8000927C 3C01800E */ lui $at, %hi(gCourseTimer)
/* 009E80 80009280 46023202 */ mul.s $f8, $f6, $f2
/* 009E84 80009284 C424C598 */ lwc1 $f4, %lo(gCourseTimer)($at)
/* 009E88 80009288 46101280 */ add.s $f10, $f2, $f16
/* 009E8C 8000928C AFA40000 */ sw $a0, ($sp)
/* 009E90 80009290 460A4483 */ div.s $f18, $f8, $f10
/* 009E94 80009294 03E00008 */ jr $ra
/* 009E98 80009298 46122001 */ sub.s $f0, $f4, $f18

View File

@ -1,17 +0,0 @@
glabel func_80052080
/* 052C80 80052080 3C0E800E */ lui $t6, %hi(D_800DC5F0) # $t6, 0x800e
/* 052C84 80052084 8DCEC5F0 */ lw $t6, %lo(D_800DC5F0)($t6)
/* 052C88 80052088 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 052C8C 8005208C AFBF0014 */ sw $ra, 0x14($sp)
/* 052C90 80052090 85CF0028 */ lh $t7, 0x28($t6)
/* 052C94 80052094 241800F0 */ li $t8, 240
/* 052C98 80052098 3C058019 */ lui $a1, %hi(D_8018D1F0) # $a1, 0x8019
/* 052C9C 8005209C 030F2023 */ subu $a0, $t8, $t7
/* 052CA0 800520A0 0004CC00 */ sll $t9, $a0, 0x10
/* 052CA4 800520A4 00192403 */ sra $a0, $t9, 0x10
/* 052CA8 800520A8 0C014718 */ jal func_80051C60
/* 052CAC 800520AC 8CA5D1F0 */ lw $a1, %lo(D_8018D1F0)($a1)
/* 052CB0 800520B0 8FBF0014 */ lw $ra, 0x14($sp)
/* 052CB4 800520B4 27BD0018 */ addiu $sp, $sp, 0x18
/* 052CB8 800520B8 03E00008 */ jr $ra
/* 052CBC 800520BC 00000000 */ nop

View File

@ -1,18 +0,0 @@
glabel func_80072180
/* 072D80 80072180 3C0E800E */ lui $t6, %hi(gModeSelection) # $t6, 0x800e
/* 072D84 80072184 8DCEC53C */ lw $t6, %lo(gModeSelection)($t6)
/* 072D88 80072188 24030001 */ li $v1, 1
/* 072D8C 8007218C 3C0F800E */ lui $t7, %hi(gPlayerOne) # $t7, 0x800e
/* 072D90 80072190 146E0009 */ bne $v1, $t6, .L800721B8
/* 072D94 80072194 00000000 */ nop
/* 072D98 80072198 8DEFC4DC */ lw $t7, %lo(gPlayerOne)($t7)
/* 072D9C 8007219C 95E20000 */ lhu $v0, ($t7)
/* 072DA0 800721A0 30588000 */ andi $t8, $v0, 0x8000
/* 072DA4 800721A4 13000004 */ beqz $t8, .L800721B8
/* 072DA8 800721A8 30591100 */ andi $t9, $v0, 0x1100
/* 072DAC 800721AC 17200002 */ bnez $t9, .L800721B8
/* 072DB0 800721B0 3C018016 */ lui $at, %hi(D_80162DF8) # $at, 0x8016
/* 072DB4 800721B4 AC232DF8 */ sw $v1, %lo(D_80162DF8)($at)
.L800721B8:
/* 072DB8 800721B8 03E00008 */ jr $ra
/* 072DBC 800721BC 00000000 */ nop

View File

@ -215,13 +215,13 @@ typedef struct {
#define BACK_RIGHT_TYRE 3
typedef struct {
/* 0x0000 */ u16 unk_000;
/* 0x0000 */ u16 unk_000; // playerType?
/* 0x0002 */ u16 unk_002;
/* 0x0004 */ s16 currentRank;
/* 0x0006 */ u16 unk_006;
/* 0x0008 */ s16 lapCount;
/* 0x000A */ char unk_00A[0x2];
/* 0x000C */ s32 unk_00C;
/* 0x000C */ s32 statusEffects; // Bitflag.
/* 0x0010 */ s16 unk_010;
/* 0x0012 */ s16 unk_012;
/* 0x0014 */ Vec3f pos;
@ -286,8 +286,8 @@ typedef struct {
/* 0x00F4 */ f32 kartHopAcceleration;
/* 0x00F8 */ u16 unk_0F8;
/* 0x00FA */ s16 unk_0FA;
/* 0x00FC */ f32 unk_0FC;
/* 0x0100 */ f32 unk_100;
/* 0x00FC */ f32 kartFriction;
/* 0x0100 */ f32 kartGravity;
/* 0x0104 */ f32 unk_104;
/* 0x0108 */ f32 unk_108;
/* 0x010C */ s16 unk_10C;

View File

@ -3011,7 +3011,7 @@ void func_8029FDC8(struct Actor *actor) {
break;
case 0:
player = &gPlayers[banana->playerId];
player->unk_00C &= ~0x00040000;
player->statusEffects &= ~0x00040000;
/* fallthrough */
case 4:
banana->flags = -0x8000;
@ -3106,7 +3106,7 @@ void func_8029FDC8(struct Actor *actor) {
fakeItemBox = (struct FakeItemBox *)actor;
player = &gPlayers[(s16)fakeItemBox->playerId];
if (fakeItemBox->state == 0) {
player->unk_00C &= ~0x00040000;
player->statusEffects &= ~0x00040000;
}
fakeItemBox->state = 2;
fakeItemBox->flags = -0x8000;
@ -3228,10 +3228,10 @@ void func_802A0450(Player *player, struct Actor *actor) {
break;
case ACTOR_BANANA:
if (player->unk_0BC & 0x800008C0) { break; }
if (player->unk_00C & 1) { break; }
if (player->statusEffects & 1) { break; }
temp_v1 = actor->rot[0];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
player->unk_00C |= 1;
player->statusEffects |= 1;
owner = &gPlayers[temp_v1];
if (owner->unk_000 & 0x4000) {
if (actor->flags & 0xF) {
@ -3250,10 +3250,10 @@ void func_802A0450(Player *player, struct Actor *actor) {
break;
case ACTOR_GREEN_SHELL:
if (player->unk_0BC & 0x80000400) { break; }
if (player->unk_00C & 4) { break; }
if (player->statusEffects & 4) { break; }
temp_v1 = actor->rot[2];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
player->unk_00C |= 4;
player->statusEffects |= 4;
func_800C98B8(player->pos, player->unk_034, 0x19018010U);
owner = &gPlayers[temp_v1];
if ((owner->unk_000 & 0x4000) && (temp_lo != temp_v1)) {
@ -3262,11 +3262,11 @@ void func_802A0450(Player *player, struct Actor *actor) {
func_8029FDC8(actor);
break;
case ACTOR_BLUE_SPINY_SHELL:
if (player->unk_00C & 2) { break; }
if (player->statusEffects & 2) { break; }
temp_v1 = actor->rot[2];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
if (!(player->unk_0BC & 0x80000000)) {
player->unk_00C |= 2;
player->statusEffects |= 2;
func_800C98B8(player->pos, player->unk_034, 0x19018010U);
}
owner = &gPlayers[temp_v1];
@ -3280,11 +3280,11 @@ void func_802A0450(Player *player, struct Actor *actor) {
case ACTOR_RED_SHELL:
temp_v1 = actor->rot[2];
if (player->unk_0BC & 0x01000000) { break; }
if (player->unk_00C & 2) { break; }
if (player->statusEffects & 2) { break; }
temp_v1 = actor->rot[2];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
if (!(player->unk_0BC & 0x80000000)) {
player->unk_00C |= 2;
player->statusEffects |= 2;
func_800C98B8(player->pos, player->unk_034, 0x19018010U);
}
owner = &gPlayers[temp_v1];
@ -3339,7 +3339,7 @@ void func_802A0450(Player *player, struct Actor *actor) {
if (player->unk_0BC & 0x80000000) { break; }
temp_v1 = actor->velocity[0];
if (((temp_lo == temp_v1) && (actor->flags & 0x1000)) || (func_8029FB80(player, actor) != 1)) { break; }
player->unk_00C |= 0x400000;
player->statusEffects |= 0x400000;
owner = &gPlayers[temp_v1];
if (owner->unk_000 & 0x4000) {
if (actor->flags & 0xF) {
@ -3354,7 +3354,7 @@ void func_802A0450(Player *player, struct Actor *actor) {
}
}
if (actor->state == 0) {
owner->unk_00C &= ~0x00040000;
owner->statusEffects &= ~0x00040000;
}
}
actor->state = 2;
@ -3521,7 +3521,7 @@ void update_obj_fake_item_box(struct FakeItemBox *fake_item_box) {
if ((temp_v1_3->buttonDepressed & Z_TRIG) != 0) {
temp_v1_3->buttonDepressed &= 0xDFFF;
func_802A1064(fake_item_box);
temp_v0_4->unk_00C &= 0xFFFBFFFF;
temp_v0_4->statusEffects &= 0xFFFBFFFF;
func_800C9060((u8)(temp_v0_4 - gPlayerOne), 0x19008012);
}
}

View File

@ -286,11 +286,11 @@ void update_obj_banana_bunch(struct BananaBunchParent *banana_bunch) {
}
if (someCount == 0) {
destroy_actor(banana_bunch);
owner->unk_00C &= ~0x40000;
owner->statusEffects &= ~0x40000;
} else if ((owner->unk_000 & 0x4000) != 0) {
controller = &gControllers[banana_bunch->playerId];
if ((controller->buttonPressed & 0x2000) != 0) {
controller->buttonPressed &= ~0x2000;
if ((controller->buttonPressed & Z_TRIG) != 0) {
controller->buttonPressed &= ~Z_TRIG;
func_800C9060(owner - gPlayerOne, 0x19008012);
if ((controller->rawStickY >= 0x1F) && ((controller->rawStickX < 0x28) && (controller->rawStickX >= -0x27))) {
func_802B0788(controller->rawStickY, banana_bunch, owner);
@ -414,9 +414,9 @@ void update_obj_triple_shell(struct TripleShellParent *parent, s16 shellType) {
destroy_actor((struct Actor *) parent);
break;
}
if ((gControllers[parent->playerId].buttonPressed & 0x2000) != 0) {
if ((gControllers[parent->playerId].buttonPressed & Z_TRIG) != 0) {
parent->unk_08 += 1.0f;
gControllers[parent->playerId].buttonPressed &= ~0x2000;
gControllers[parent->playerId].buttonPressed &= ~Z_TRIG;
}
if (parent->unk_08 > 0.0f) {
if (parent->shellIndices[0] > 0.0f) {
@ -516,7 +516,7 @@ s32 func_802B17F4(Player *player) {
bananaBunch = &gActorList[actorIndex];
bananaBunch->state = 0;
bananaBunch->playerId = player - gPlayerOne;
player->unk_00C |= 0x40000;
player->statusEffects |= 0x40000;
return actorIndex;
}
@ -713,7 +713,7 @@ void update_obj_banana(struct BananaActor *banana) {
controller->buttonDepressed &= ~0x2000;
banana->state = 1;
banana->unk_04 = 0x00B4;
player->unk_00C &= ~0x40000;
player->statusEffects &= ~0x40000;
func_800C9060(player - gPlayerOne, 0x19008012U);
pad1 = controller->rawStickY;
if ((pad1 > 30.0f) && (controller->rawStickX < 10) && (controller->rawStickX >= -9)) {
@ -947,7 +947,7 @@ s32 func_802B2C40(Player *player) {
itemBox = (struct FakeItemBox*)&gActorList[actorIndex];
itemBox->playerId = (player - gPlayerOne);
itemBox->state = 0;
player->unk_00C |= 0x40000;
player->statusEffects |= 0x40000;
return actorIndex;
}
@ -987,24 +987,29 @@ s32 func_802B2D70(Player *player) {
banana->playerId = playerId;
banana->state = 0;
banana->unk_04 = 0x0014;
player->unk_00C |= 0x40000;
player->statusEffects |= 0x40000;
return actorIndex;
}
// Something related to the thunderbolt item
/**
* Strikes players with thunder
*
* @param Activating player (not to be struck)
*/
void func_802B2EBC(Player *player) {
s32 playerIndex;
s32 index;
Player *otherPlayer;
func_8009E5BC();
if ((player->unk_000 & 0x4000) != 0) {
// Play sound.
func_800CAB4C(player - gPlayerOne);
}
for (playerIndex = 0; playerIndex < 8; playerIndex++) {
otherPlayer = &gPlayers[playerIndex];
for (index = 0; index < 8; index++) {
otherPlayer = &gPlayers[index];
if (player != otherPlayer) {
otherPlayer->unk_00C |= 0x4000;
otherPlayer->statusEffects |= 0x4000;
}
}
}
@ -1030,22 +1035,22 @@ void func_802B2FA0(Player *player) {
func_802B17F4(player);
break;
case ITEM_MUSHROOM:
player->unk_00C |= 0x200;
player->statusEffects |= 0x200;
break;
case ITEM_DOUBLE_MUSHROOM:
player->unk_00C |= 0x200;
player->statusEffects |= 0x200;
break;
case ITEM_TRIPLE_MUSHROOM:
player->unk_00C |= 0x200;
player->statusEffects |= 0x200;
break;
case ITEM_SUPER_MUSHROOM:
player->unk_00C |= 0x200;
player->statusEffects |= 0x200;
break;
case ITEM_BOO:
player->unk_00C |= 0x800;
player->statusEffects |= 0x800;
break;
case ITEM_STAR:
player->unk_00C |= 0x2000;
player->statusEffects |= 0x2000;
break;
case ITEM_THUNDERBOLT:
func_802B2EBC(player);
@ -1086,8 +1091,8 @@ void func_802B30EC(void) {
}
if (((player->unk_000 & 0x4000) != 0) && (player->unk_010 != ITEM_NONE) && ((player->unk_000 & 0x2000) == 0)) {
if ((controller->buttonPressed & 0x2000) != 0) {
controller->buttonPressed &= ~0x2000;
if ((controller->buttonPressed & Z_TRIG) != 0) {
controller->buttonPressed &= ~Z_TRIG;
func_802B2FA0(player);
}
}

View File

@ -1280,7 +1280,7 @@ void func_8001F394(Player *player, f32 *arg1) {
}
temp_v1 = D_80164A08[sp2C];
if (*temp_v1 == 0) {
if (player->unk_00C & 0x40000) {
if (player->statusEffects & 0x40000) {
*temp_v1 = 1;
}
if ((player->unk_0BC & 0x2000) == 0x2000) {
@ -1289,7 +1289,7 @@ void func_8001F394(Player *player, f32 *arg1) {
if ((player->unk_0BC & 0x100000) == 0x100000) {
*temp_v1 = 3;
}
if ((player->unk_00C & 0x100) == 0x100) {
if ((player->statusEffects & 0x100) == 0x100) {
*temp_v1 = 4;
}
temp_v0 = player->unk_0BC;
@ -1301,7 +1301,7 @@ void func_8001F394(Player *player, f32 *arg1) {
switch (*temp_v1) {
case 1:
var_a0 = temp_t3 + &D_80164498;
if (player->unk_00C & 0x40000) {
if (player->statusEffects & 0x40000) {
sp1C = temp_t3;
move_f32_towards(var_a0, 20.0f, 0.2f);
} else {
@ -1350,7 +1350,7 @@ block_51:
break;
case 4:
var_a0 = temp_t3 + &D_80164498;
if ((player->unk_00C & 0x100) == 0x100) {
if ((player->statusEffects & 0x100) == 0x100) {
sp1C = temp_t3;
move_f32_towards(var_a0, 25.0f, 1.0f);
} else {

View File

@ -1487,7 +1487,7 @@ void func_80008424(s32 arg0, f32 arg1, Player *player) {
temp_v1 = player->unk_0BC;
var_f12 = arg1;
temp_f2 = player->unk_094;
if (!(temp_v1 & 0x80) && !(temp_v1 & 0x40) && ((temp_v1 << 0xE) >= 0) && (temp_v0 = player->unk_00C, ((temp_v0 << 9) >= 0)) && ((temp_v0 << 7) >= 0) && !(temp_v0 & 2) && !(temp_v0 & 4)) {
if (!(temp_v1 & 0x80) && !(temp_v1 & 0x40) && ((temp_v1 << 0xE) >= 0) && (temp_v0 = player->statusEffects, ((temp_v0 << 9) >= 0)) && ((temp_v0 << 7) >= 0) && !(temp_v0 & 2) && !(temp_v0 & 4)) {
if (gCurrentCourseId == 0x0014) {
func_80007FA4(var_f12, player, temp_f2, player);
return;
@ -1906,23 +1906,19 @@ void func_800090F0(s32 playerId, Player *player) {
}
}
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern f32 D_800ECFA4;
extern f32 D_8016344C;
extern f32 gCourseTimer;
f32 func_80009258(s32 arg0, f32 arg1, f32 arg2) {
f32 temp_f12;
f32 temp_f2;
/**
* Helps calculate time since player last touched finishline.
**/
f32 func_80009258(UNUSED s32 playerId, f32 arg1, f32 arg2) {
f32 temp_f2 = D_8016344C - arg2;
f32 temp_f12 = arg1 - D_8016344C;
temp_f12 = D_8016344C;
temp_f2 = temp_f12 - arg2;
return gCourseTimer - ((D_800ECFA4 * temp_f2) / (temp_f2 + (arg1 - temp_f12)));
return gCourseTimer - ( (D_800ECFA4 * temp_f2) / (temp_f2 + temp_f12) );
}
#else
GLOBAL_ASM("asm/non_matchings/code_80005FD0/func_80009258.s")
#endif
#ifdef MIPS_TO_C
//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9
@ -2169,7 +2165,7 @@ void func_800098FC(u8 arg0, Player *player) {
*temp_a2 = 0;
}
temp_a2_2 = temp_v1 + &D_801633B0;
if ((*temp_a2_2 >= 0xB) && ((temp_v0_2 = player->unk_00C, ((temp_v0_2 << 9) < 0)) || ((temp_v0_2 << 7) < 0) || ((temp_v0_2 & 2) != 0) || ((temp_v0_2 & 4) != 0) || (player->unk_0BC & 0x04000000))) {
if ((*temp_a2_2 >= 0xB) && ((temp_v0_2 = player->statusEffects, ((temp_v0_2 << 9) < 0)) || ((temp_v0_2 << 7) < 0) || ((temp_v0_2 & 2) != 0) || ((temp_v0_2 & 4) != 0) || (player->unk_0BC & 0x04000000))) {
sp18 = temp_a2_2;
func_800C92CC(arg0, 0x2900800B, temp_a2_2, player);
*temp_a2_2 = 0;
@ -4217,7 +4213,7 @@ void func_8000DF8C(s32 arg0) {
temp_f12 = var_f24 - temp_v0->pos[2];
if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2) + (temp_f12 * temp_f12)) < 25.0f) {
sp7E = 4;
temp_v0->unk_00C |= 0x400000;
temp_v0->statusEffects |= 0x400000;
temp_v0->unk_000 &= ~0x2000;
var_s1 = 0;
sp4C = 4;
@ -4238,9 +4234,9 @@ void func_8000DF8C(s32 arg0) {
sp7E = 4;
var_s1 = 0;
if (gCurrentCourseId == 5) {
var_v0->unk_00C |= 0x01000000;
var_v0->statusEffects |= 0x01000000;
} else {
var_v0->unk_00C |= 0x400000;
var_v0->statusEffects |= 0x400000;
}
var_v1 = D_8018EDF3;
}
@ -5334,7 +5330,7 @@ void func_8000F628(void) {
do {
if (var_s2_3->unk0 == 1) {
temp_s1 = &gPlayers[var_s0_4];
temp_s1->unk_00C |= 0x02000000;
temp_s1->statusEffects |= 0x02000000;
}
if (var_s2_3->unk2 == 1) {
temp_s1_2 = &gPlayers[var_s0_4];
@ -6737,11 +6733,11 @@ void func_80012DC0(s32 playerId, Player *player) {
temp_f0_2 = (f64) (temp_f26 - temp_f14);
if ((temp_f0_2 > -100.0) && (temp_f0_2 < 100.0)) {
if (func_80006018(sp84, temp_f14, var_s6->locomotive.velocity[0], var_s6->locomotive.velocity[2], 60.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U) {
player->unk_00C |= 0x400000;
player->statusEffects |= 0x400000;
}
temp_v0 = &var_s6->tender;
if ((var_s6->tender.isActive == (s16) 1U) && (func_80006018(temp_v0->position[0], temp_v0->position[2], temp_v0->velocity[0], temp_v0->velocity[2], 30.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U)) {
player->unk_00C |= 0x400000;
player->statusEffects |= 0x400000;
}
}
}
@ -6755,7 +6751,7 @@ loop_13:
if (temp_f0_4 > -100.0) {
temp_v0_2 = var_s0->passengerCars;
if ((temp_f0_4 < 100.0) && (func_80006018(temp_v0_2->position[0], temp_v0_2->position[2], temp_v0_2->velocity[0], temp_v0_2->velocity[2], 30.0f, 20.0f, temp_f24, temp_f26) == (s32) 1U)) {
player->unk_00C |= 0x400000;
player->statusEffects |= 0x400000;
}
}
}
@ -7068,7 +7064,7 @@ void func_80013854(Player *player) {
if ((temp_f0_2 > -300.0) && (temp_f0_2 < 300.0)) {
sp70 = var_f18;
if ((func_80006018(temp_f12, temp_f14, var_s0->velocity[0], var_s0->velocity[2], 200.0f, 60.0f, temp_f26, temp_f28) == (s32) 1) && ((f64) temp_f24 < 60.0)) {
player->unk_00C |= 0x80000;
player->statusEffects |= 0x80000;
}
}
}
@ -7327,7 +7323,7 @@ void func_80013F7C(s32 playerId, Player *player, VehicleStuff *vehicle, f32 arg3
if ((temp_f0 > -20.0) && (temp_f0 < 20.0)) {
temp_f0_2 = (f64) temp_f24;
if ((temp_f0_2 > -100.0) && (temp_f0_2 < 100.0) && (func_80006018(temp_f12, temp_f14, var_s0->velocity[0], var_s0->velocity[2], arg3, arg4, spC4, spBC) == (s32) 1U)) {
player->unk_00C |= 0x400000;
player->statusEffects |= 0x400000;
}
}
}
@ -10820,7 +10816,7 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
temp_s0->unk2 = func_802B2D70(sp2C);
temp_v1_3 = temp_s0->unk2;
if ((temp_v1_3 >= 0) && (temp_v1_3 < 0x64)) {
sp2C->unk_00C |= 0x40000;
sp2C->statusEffects |= 0x40000;
temp_s0->unk0 = 2;
temp_s0->unk4 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
@ -10836,7 +10832,7 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
if (!(temp_a3->flags & 0x8000) || (temp_a3->type != 6) || (temp_a3->state != 0) || (playerId != temp_a3->rot[0])) {
temp_s0->unk0 = 0;
temp_s0->unk4 = 0;
sp2C->unk_00C &= 0xFFFBFFFF;
sp2C->statusEffects &= 0xFFFBFFFF;
} else if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk0 = 3;
}
@ -10857,7 +10853,7 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
temp_a3_2->pos[1] = func_802AE1C0(sp2C->pos[0], (f32) ((f64) sp2C->pos[1] + 30.0), sp2C->pos[2]) + (temp_a3_2->boundingBoxSize + 1.0f);
}
}
sp2C->unk_00C &= 0xFFFBFFFF;
sp2C->statusEffects &= 0xFFFBFFFF;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
break;
@ -10867,7 +10863,7 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
if ((temp_v1_4 >= 0) && (temp_v1_4 < 0x64)) {
temp_a3_3 = &gActorList[temp_v1_4];
temp_a3_3->state = 4;
sp2C->unk_00C |= 0x40000;
sp2C->statusEffects |= 0x40000;
temp_s0->unk0 = 0x0023;
temp_s0->unk4 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
@ -10889,7 +10885,7 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
if (!(temp_a3_4->flags & 0x8000) || (temp_a3_4->type != 6) || (temp_a3_4->state != 4) || (playerId != temp_a3_4->rot[0])) {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
sp2C->unk_00C &= 0xFFFBFFFF;
sp2C->statusEffects &= 0xFFFBFFFF;
} else {
temp_a3_4->pos[0] += temp_a3_4->velocity[0];
temp_a3_4->velocity[1] = (f32) ((f64) temp_a3_4->velocity[1] - 0.4);
@ -10914,7 +10910,7 @@ void func_8001AC10(s32 playerId, s32 arg1, s32 *arg2) {
sp28 = temp_a3_5;
temp_a3_5->pos[1] = func_802AE1C0(temp_a3_5->pos[0], (f32) ((f64) temp_a3_5->pos[1] + 30.0), temp_a3_5->pos[2]) + (temp_a3_5->boundingBoxSize + 1.0f);
}
sp2C->unk_00C &= 0xFFFBFFFF;
sp2C->statusEffects &= 0xFFFBFFFF;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
break;
@ -11140,7 +11136,7 @@ block_146:
}
break;
case 25: /* switch 1 */
sp2C->unk_00C |= 0x2000;
sp2C->statusEffects |= 0x2000;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x001A;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
@ -11152,7 +11148,7 @@ block_146:
temp_s0->unk4 = 0;
break;
case 27: /* switch 1 */
sp2C->unk_00C |= 0x800;
sp2C->statusEffects |= 0x800;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x001C;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
@ -11164,21 +11160,21 @@ block_146:
temp_s0->unk4 = 0;
break;
case 29: /* switch 1 */
sp2C->unk_00C |= 0x200;
sp2C->statusEffects |= 0x200;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;
temp_s0->unk6 = (s16) (temp_s0->unk6 + 1);
break;
case 30: /* switch 1 */
if (temp_s0->unk4 >= 0x3D) {
sp2C->unk_00C |= 0x200;
sp2C->statusEffects |= 0x200;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x001D;
}
break;
case 31: /* switch 1 */
if (temp_s0->unk4 >= 0x3D) {
sp2C->unk_00C |= 0x200;
sp2C->statusEffects |= 0x200;
temp_s0->unk4 = 0;
temp_s0->unk0 = 0x001E;
}
@ -11190,7 +11186,7 @@ block_146:
break;
case 33: /* switch 1 */
if (((s16) temp_s0->unk4 % 60) == 0) {
sp2C->unk_00C |= 0x200;
sp2C->statusEffects |= 0x200;
if (temp_s0->unkE < temp_s0->unk4) {
temp_s0->unk4 = 0;
temp_s0->unk0 = 0;

View File

@ -1822,7 +1822,7 @@ void func_800248D0(Player *player, s8 arg1, s8 arg2, s8 arg3) {
gDisplayListHead = temp_v0_24 + 8;
temp_v0_24->words.w0 = 0xB900031D;
temp_v0_24->words.w1 = 0x00505978;
} else if (((player->unk_0CA & 4) == 4) || (temp_v0_25 = player->unk_00C, ((temp_v0_25 * 0x10) < 0)) || (temp_v0_25 & 0x04000000)) {
} else if (((player->unk_0CA & 4) == 4) || (temp_v0_25 = player->statusEffects, ((temp_v0_25 * 0x10) < 0)) || (temp_v0_25 & 0x04000000)) {
temp_v0_26 = gDisplayListHead;
gDisplayListHead = temp_v0_26 + 8;
temp_v0_26->words.w0 = 0x01020040;

View File

@ -1072,13 +1072,13 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) {
temp_v0_2 = player->unk_0BC;
if (((temp_v0_2 & 0x100000) != 0x100000) && ((temp_v0_2 & 8) != 8)) {
var_v1 = temp_t5 & 0xFFFF;
player->unk_00C |= 0x800000;
player->statusEffects |= 0x800000;
}
}
if (var_v1 == 0xFC) {
temp_v0_3 = player->unk_0BC;
if (((temp_v0_3 & 4) != 4) && ((temp_v0_3 & 8) != 8)) {
player->unk_00C |= 0x8000;
player->statusEffects |= 0x8000;
}
}
}
@ -1183,13 +1183,13 @@ void func_8002A194(Player *player, f32 arg1, f32 arg2, f32 arg3) {
if (player->unk_0F8 == 0x00FE) {
temp_v0_2 = player->unk_0BC;
if (((temp_v0_2 & 0x100000) != 0x100000) && ((temp_v0_2 & 8) != 8)) {
player->unk_00C |= 0x800000;
player->statusEffects |= 0x800000;
}
}
if (player->unk_0F8 == 0x00FC) {
temp_v0_3 = player->unk_0BC;
if (((temp_v0_3 & 4) != 4) && ((temp_v0_3 & 8) != 8)) {
player->unk_00C |= 0x8000;
player->statusEffects |= 0x8000;
}
}
}
@ -1380,7 +1380,7 @@ void func_8002AA50(Player *player) {
player->kartHopVelocity = gKartHopInitialVelocityTable[player->characterId];
player->unk_0BC |= 2;
player->unk_DAC = 3.0f;
player->unk_100 = 500.0f;
player->kartGravity = 500.0f;
func_80036C5C(player);
}
@ -1427,17 +1427,17 @@ void func_8002AB70(Player *player) {
f64 pad;
if (((player->unk_0BC & 8) != 8) && (player->unk_08C > 0.0f)) {
if (((player->unk_0C4 / 182) < -1) && ((player->unk_0C4 / 182) >= -0x14) && (((player->unk_094 / 18.0f) * 216.0f) >= 20.0f)) {
move_f32_towards(&player->unk_100, 500.0f, 1.0f);
move_f32_towards(&player->kartGravity, 500.0f, 1.0f);
move_f32_towards(&player->unk_DAC, 3.0f, 0.05f);
} else {
move_f32_towards(&player->unk_100, gKartGravityTable[player->characterId], 0.1f);
move_f32_towards(&player->kartGravity, gKartGravityTable[player->characterId], 0.1f);
move_f32_towards(&player->unk_DAC, 1.0f, 0.07f);
}
} else {
if (player->unk_110.unk3C[2] >= 50.0f) {
player->unk_DAC = 2.0f;
}
move_f32_towards(&player->unk_100, gKartGravityTable[player->characterId], 0.02f);
move_f32_towards(&player->kartGravity, gKartGravityTable[player->characterId], 0.02f);
if ((player->unk_0BC & 2) == 2) {
move_f32_towards(&player->unk_DAC, 1.0f, 0.07f);
} else {
@ -1446,29 +1446,29 @@ void func_8002AB70(Player *player) {
}
if ((player->unk_0BC & 0x100000) == 0x100000) {
move_f32_towards(&player->unk_DAC, 20.0f, 1.0f);
player->unk_100 = D_800ED7B8;
player->kartGravity = D_800ED7B8;
}
if ((player->unk_0BC & 4) == 4) {
move_f32_towards(&player->unk_DAC, 25.0f, 1.0f);
player->unk_100 = 1800.0f;
player->kartGravity = 1800.0f;
}
if ((player->unk_0BC & 0x400) == 0x400) {
player->unk_100 = D_800ED7BC;
player->kartGravity = D_800ED7BC;
}
if (player->unk_0BC & 0x80000) {
player->unk_100 = D_800ED7C0;
player->kartGravity = D_800ED7C0;
}
if ((player->unk_044 & 0x800) != 0) {
player->unk_100 = D_800ED7C4;
player->kartGravity = D_800ED7C4;
}
if ((player->unk_0BC & 0x800000) == 0x800000) {
player->unk_100 = 300.0f;
player->kartGravity = 300.0f;
}
if ((player->unk_0BC & 0x01000000) == 0x01000000) {
player->unk_100 = D_800ED7C8;
player->kartGravity = D_800ED7C8;
}
if ((player->unk_0BC & 0x02000000) == 0x02000000) {
player->unk_100 = 800.0f;
player->kartGravity = 800.0f;
}
}
@ -1624,91 +1624,91 @@ void func_8002B308(Player *player, s8 arg1, s8 arg2) {
s32 phi_v0_16;
s32 phi_v0_17;
temp_v0 = player->unk_00C;
temp_v0 = player->statusEffects;
phi_v0 = temp_v0;
if ((temp_v0 & 2) == 2) {
func_8008EAE0(player, arg1);
phi_v0 = player->unk_00C;
phi_v0 = player->statusEffects;
}
phi_v0_2 = phi_v0;
if ((phi_v0 & 4) == 4) {
func_8008C528(player, arg1);
phi_v0_2 = player->unk_00C;
phi_v0_2 = player->statusEffects;
}
phi_v0_3 = phi_v0_2;
if ((phi_v0_2 & 1) == 1) {
func_8008CDC0(player, arg1);
phi_v0_3 = player->unk_00C;
phi_v0_3 = player->statusEffects;
}
phi_v0_4 = phi_v0_3;
if ((phi_v0_3 & 0x200) == 0x200) {
func_8008D3C4(player, arg1);
phi_v0_4 = player->unk_00C;
phi_v0_4 = player->statusEffects;
}
phi_v0_5 = phi_v0_4;
if ((phi_v0_4 & 0x02000000) == 0x02000000) {
func_8002A704(player, arg1);
phi_v0_5 = player->unk_00C;
phi_v0_5 = player->statusEffects;
}
phi_v0_6 = phi_v0_5;
if ((phi_v0_5 & 0x1000) == 0x1000) {
func_8008D570(player, arg1);
phi_v0_6 = player->unk_00C;
phi_v0_6 = player->statusEffects;
}
phi_v0_7 = phi_v0_6;
if ((phi_v0_6 & 0x20000) == 0x20000) {
func_8008D7B0(player, arg1);
phi_v0_7 = player->unk_00C;
phi_v0_7 = player->statusEffects;
}
phi_v0_8 = phi_v0_7;
if ((phi_v0_7 & 0x100) == 0x100) {
func_8008DABC(player, arg1);
phi_v0_8 = player->unk_00C;
phi_v0_8 = player->statusEffects;
}
phi_v0_9 = phi_v0_8;
if ((phi_v0_8 & 0x4000) == 0x4000) {
func_8008DF98(player, arg1);
phi_v0_9 = player->unk_00C;
phi_v0_9 = player->statusEffects;
}
phi_v0_10 = phi_v0_9;
if ((phi_v0_9 & 0x200000) == 0x200000) {
func_8008C73C(player, arg1);
phi_v0_10 = player->unk_00C;
phi_v0_10 = player->statusEffects;
}
phi_v0_11 = phi_v0_10;
if ((phi_v0_10 & 0x400000) == 0x400000) {
func_8008E6C0(player, arg1);
phi_v0_11 = player->unk_00C;
phi_v0_11 = player->statusEffects;
}
phi_v0_12 = phi_v0_11;
if ((phi_v0_11 & 0x01000000) == 0x01000000) {
func_8008EAE0(player, arg1);
phi_v0_12 = player->unk_00C;
phi_v0_12 = player->statusEffects;
}
phi_v0_13 = phi_v0_12;
if ((phi_v0_12 & 0x800000) == 0x800000) {
func_8008EC88(player, arg1);
phi_v0_13 = player->unk_00C;
phi_v0_13 = player->statusEffects;
}
phi_v0_14 = phi_v0_13;
if ((phi_v0_13 & 0x8000) == 0x8000) {
func_8008EEE4(player, arg1);
phi_v0_14 = player->unk_00C;
phi_v0_14 = player->statusEffects;
}
phi_v0_15 = phi_v0_14;
if ((phi_v0_14 & 0x2000) == 0x2000) {
func_8008F778(player, arg1);
phi_v0_15 = player->unk_00C;
phi_v0_15 = player->statusEffects;
}
phi_v0_16 = phi_v0_15;
if ((phi_v0_15 & 0x800) == 0x800) {
func_8008FA38(player, arg1);
phi_v0_16 = player->unk_00C;
phi_v0_16 = player->statusEffects;
}
phi_v0_17 = phi_v0_16;
if ((phi_v0_16 & 0x80) != 0) {
func_8008D0FC(player, arg1);
phi_v0_17 = player->unk_00C;
phi_v0_17 = player->statusEffects;
}
if (phi_v0_17 & 0x80000) {
func_8008E6C0(player, arg1);
@ -1720,63 +1720,63 @@ GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002B308.s")
void func_8002B5C0(Player *player, s8 arg1, s8 arg2) {
if (((player->unk_0CA & 8) != 0) || ((player->unk_0CA & 2) != 0)) {
player->unk_00C &= 0xFE1D0478;
player->statusEffects &= 0xFE1D0478;
}
if ((player->unk_0BC & 0x400) == 0x400) {
player->unk_00C &= 0xFF5D457E;
player->statusEffects &= 0xFF5D457E;
}
if (((player->unk_0BC & 0x80) == 0x80) || ((player->unk_0BC & 0x40) == 0x40)) {
player->unk_00C &= 0xFF5F457E;
player->statusEffects &= 0xFF5F457E;
}
if ((player->unk_0BC & 0x800) == 0x800) {
player->unk_00C &= 0xFF5D457E;
player->statusEffects &= 0xFF5D457E;
}
if ((player->unk_044 & 0x4000) != 0) {
player->unk_00C &= 0xFF5D457E;
player->statusEffects &= 0xFF5D457E;
}
if ((player->unk_0BC & 0x80000) == 0x80000) {
player->unk_00C &= 0xFE1D4478;
player->statusEffects &= 0xFE1D4478;
}
if ((player->unk_0BC & 0x800000) == 0x800000) {
player->unk_00C &= 0xFE1D0478;
player->statusEffects &= 0xFE1D0478;
}
if ((player->unk_0BC & 0x04000000) == 0x04000000) {
player->unk_00C &= 0xFE1D0578;
player->statusEffects &= 0xFE1D0578;
}
if ((player->unk_0BC & 0x01000000) == 0x01000000) {
player->unk_00C &= 0xFE1D4478;
player->statusEffects &= 0xFE1D4478;
}
if ((player->unk_0BC & 0x02000000) == 0x02000000) {
player->unk_00C &= 0xFE1D4478;
player->statusEffects &= 0xFE1D4478;
}
if ((player->unk_0BC & 0x100000) == 0x100000) {
player->unk_00C &= 0xFE1D0478;
player->statusEffects &= 0xFE1D0478;
}
if ((player->unk_0BC & 4) == 4) {
player->unk_00C &= 0xFE1D0478;
player->statusEffects &= 0xFE1D0478;
}
if ((player->unk_0BC & 0x10000) == 0x10000) {
player->unk_00C &= 0xFE1D0478;
player->statusEffects &= 0xFE1D0478;
}
if ((player->unk_0BC & 0x200) == 0x200) {
player->unk_00C &= 0xFE9D8478;
player->statusEffects &= 0xFE9D8478;
}
if ((player->unk_0BC & 0x80000000) == 0x80000000) {
player->unk_00C &= 0xFE9D8678;
player->statusEffects &= 0xFE9D8678;
}
if ((player->unk_0BC & 0x4000) == 0x4000) {
player->unk_00C &= 0xFF5D45FF;
player->statusEffects &= 0xFF5D45FF;
}
if ((player->unk_0BC & 0x20000) == 0x20000) {
player->unk_00C &= 0xFE1D0478;
player->statusEffects &= 0xFE1D0478;
}
}
void func_8002B830(Player *player, s8 arg1, s8 arg2) {
if (player->unk_00C != 0) {
if (player->statusEffects != 0) {
func_8002B5C0(player, arg1, arg2);
}
if (player->unk_00C != 0) {
if (player->statusEffects != 0) {
func_8002B308(player, arg1, arg2);
}
if ((player->unk_044 & 0x400) != 0) {
@ -2516,10 +2516,10 @@ void func_8002CD48(Player *player, s8 arg1, s8 arg2) {
func_80031F48(player, 10.0f);
}
if (D_800DC510 != 5) {
if (player->unk_00C & 0x04000000) {
if (player->statusEffects & 0x04000000) {
func_8008FC64(player, arg1);
}
if ((player->unk_00C * 0x10) < 0) {
if ((player->statusEffects * 0x10) < 0) {
func_8008FCDC(player, arg1);
}
}
@ -2758,7 +2758,7 @@ void func_8002D268(Player *player, Camera *camera, s8 arg2, s8 arg3) {
player->unk_06C *= -1.0f;
}
if ((player->boundingBoxCorners[2].surfaceType == 1) && (player->boundingBoxCorners[3].surfaceType == 1)) {
temp_f0 = player->unk_100;
temp_f0 = player->kartGravity;
var_f12 = player->unk_064 + sp16C;
spB4 = (f32) (((f64) (-player->unk_110.unk60[0] * temp_f0) * 0.925) + (f64) (-1.0f * var_f12));
spB0 = -player->unk_110.unk60[1] * temp_f0;
@ -2769,7 +2769,7 @@ void func_8002D268(Player *player, Camera *camera, s8 arg2, s8 arg3) {
if (var_v0 >= 0xA) {
var_v0 = 0x0000000A;
}
temp_f0_2 = player->unk_100;
temp_f0_2 = player->kartGravity;
var_f12 = player->unk_064 + sp16C;
temp_f2 = (sp + (var_v0 * 4))->unk104;
spB4 = (temp_f2 * (-player->unk_110.unk60[0] * temp_f0_2)) + (-1.0f * var_f12);
@ -2782,11 +2782,11 @@ void func_8002D268(Player *player, Camera *camera, s8 arg2, s8 arg3) {
if ((temp_v1 != 8) && ((temp_v0_2 & 0x20) == 0x20)) {
spB4 = var_f12 * 0.0f;
spAC = var_f14 * 0.0f;
spB0 = (player->unk_100 * -1.0f) / 4.0f;
spB0 = (player->kartGravity * -1.0f) / 4.0f;
}
if (temp_v1 == 8) {
spB4 = var_f12 * 0.0f;
spB0 = player->unk_100 * -1.0f;
spB0 = player->kartGravity * -1.0f;
spAC = var_f14 * 0.0f;
}
sp60 = coss((player->unk_02E + player->unk_0C0) & 0xFFFF);
@ -2821,23 +2821,23 @@ void func_8002D268(Player *player, Camera *camera, s8 arg2, s8 arg3) {
temp_f0_3 = (f64) sp98;
temp_f12_2 = (f64) sp7C;
temp_f2_3 = (f64) spA0;
sp98 = (f32) (temp_f0_3 + ((((f64) (sp184 + spB4 + sp160) - (temp_f0_3 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / (((f64) player->unk_20C * 0.6) + 1.0 + temp_f12_2)));
spA0 = (f32) (temp_f2_3 + ((((f64) (sp18C + spAC + sp168) - (temp_f2_3 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / (((f64) player->unk_20C * 0.6) + 1.0 + temp_f12_2)));
sp98 = (f32) (temp_f0_3 + ((((f64) (sp184 + spB4 + sp160) - (temp_f0_3 * (0.12 * (f64) player->kartFriction))) / 6000.0) / (((f64) player->unk_20C * 0.6) + 1.0 + temp_f12_2)));
spA0 = (f32) (temp_f2_3 + ((((f64) (sp18C + spAC + sp168) - (temp_f2_3 * (0.12 * (f64) player->kartFriction))) / 6000.0) / (((f64) player->unk_20C * 0.6) + 1.0 + temp_f12_2)));
} else {
temp_f0_4 = (f64) sp98;
temp_f12_3 = (f64) (sp7C + 1);
temp_f2_4 = (f64) spA0;
sp98 = (f32) (temp_f0_4 + ((((f64) (sp184 + spB4 + sp160) - (temp_f0_4 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / temp_f12_3));
spA0 = (f32) (temp_f2_4 + ((((f64) (sp18C + spAC + sp168) - (temp_f2_4 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / temp_f12_3));
sp98 = (f32) (temp_f0_4 + ((((f64) (sp184 + spB4 + sp160) - (temp_f0_4 * (0.12 * (f64) player->kartFriction))) / 6000.0) / temp_f12_3));
spA0 = (f32) (temp_f2_4 + ((((f64) (sp18C + spAC + sp168) - (temp_f2_4 * (0.12 * (f64) player->kartFriction))) / 6000.0) / temp_f12_3));
}
} else {
temp_f0_5 = (f64) sp98;
temp_f2_5 = (f64) spA0;
sp98 = (f32) (temp_f0_5 + ((((f64) (sp184 + spB4 + sp160) - (temp_f0_5 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / 30.0));
spA0 = (f32) (temp_f2_5 + ((((f64) (sp18C + spAC + sp168) - (temp_f2_5 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / 30.0));
sp98 = (f32) (temp_f0_5 + ((((f64) (sp184 + spB4 + sp160) - (temp_f0_5 * (0.12 * (f64) player->kartFriction))) / 6000.0) / 30.0));
spA0 = (f32) (temp_f2_5 + ((((f64) (sp18C + spAC + sp168) - (temp_f2_5 * (0.12 * (f64) player->kartFriction))) / 6000.0) / 30.0));
}
temp_f0_6 = (f64) sp9C;
sp9C = (f32) (temp_f0_6 + ((((f64) (sp188 + spB0 + sp164) - (temp_f0_6 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / (f64) player->unk_DAC));
sp9C = (f32) (temp_f0_6 + ((((f64) (sp188 + spB0 + sp164) - (temp_f0_6 * (0.12 * (f64) player->kartFriction))) / 6000.0) / (f64) player->unk_DAC));
temp_v0_4 = player->unk_0CA;
if (((temp_v0_4 & 2) == 2) || ((temp_v0_4 & 8) == 8) || ((player->unk_0BC & 0x04000000) == 0x04000000) || (temp_v0_4 & 1)) {
sp98 = 0.0f;
@ -3145,13 +3145,13 @@ void func_8002E594(Player *player, Camera *camera, s8 arg2, s8 arg3) {
func_8002FCA8(player, arg3);
temp_v0_2 = player->unk_0BC;
if (((temp_v0_2 & 0x80) == 0x80) || ((temp_v0_2 & 0x40) == 0x40) || ((temp_v0_2 & 0x20000) == 0x20000)) {
temp_f0 = player->unk_100;
temp_f0 = player->kartGravity;
sp80 = (f32) (((f64) (-player->unk_110.unk60[0] * temp_f0) * 0.1) + (f64) (-1.0f * player->unk_064));
sp7C = -player->unk_110.unk60[1] * temp_f0;
sp78 = (f32) (((f64) (-player->unk_110.unk60[2] * temp_f0) * 0.1) + (f64) (-1.0f * player->unk_06C));
} else {
sp80 = player->unk_064 * -1.0f;
sp7C = player->unk_100 * -1.0f;
sp7C = player->kartGravity * -1.0f;
sp78 = player->unk_06C * -1.0f;
}
func_8002C7E4(player, arg3, arg2);
@ -3177,16 +3177,16 @@ void func_8002E594(Player *player, Camera *camera, s8 arg2, s8 arg3) {
if ((player->unk_10C < 3) && ((s32) (u16) player->unk_256 < 3) && (temp_v0_3 = player->unk_0BC, ((temp_v0_3 & 0x400) != 0x400)) && ((temp_v0_3 & 0x01000000) != 0x01000000) && ((temp_v0_3 & 0x02000000) != 0x02000000)) {
temp_f0_2 = (f64) sp54;
temp_f2 = (f64) sp5C;
sp54 = (f32) (temp_f0_2 + ((((f64) (spEC + sp80 + spD4) - (temp_f0_2 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / (f64) ((player->unk_20C * 5.0f) + 1.0f)));
sp5C = (f32) (temp_f2 + ((((f64) (spF4 + sp78 + spDC) - (temp_f2 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / (f64) ((player->unk_20C * 5.0f) + 1.0f)));
sp54 = (f32) (temp_f0_2 + ((((f64) (spEC + sp80 + spD4) - (temp_f0_2 * (0.12 * (f64) player->kartFriction))) / 6000.0) / (f64) ((player->unk_20C * 5.0f) + 1.0f)));
sp5C = (f32) (temp_f2 + ((((f64) (spF4 + sp78 + spDC) - (temp_f2 * (0.12 * (f64) player->kartFriction))) / 6000.0) / (f64) ((player->unk_20C * 5.0f) + 1.0f)));
} else {
temp_f0_3 = (f64) sp54;
temp_f2_2 = (f64) sp5C;
sp54 = (f32) (temp_f0_3 + ((((f64) (spEC + sp80 + spD4) - (temp_f0_3 * (0.2 * (f64) player->unk_0FC))) / 6000.0) * 0.08));
sp5C = (f32) (temp_f2_2 + ((((f64) (spF4 + sp78 + spDC) - (temp_f2_2 * (0.2 * (f64) player->unk_0FC))) / 6000.0) * 0.08));
sp54 = (f32) (temp_f0_3 + ((((f64) (spEC + sp80 + spD4) - (temp_f0_3 * (0.2 * (f64) player->kartFriction))) / 6000.0) * 0.08));
sp5C = (f32) (temp_f2_2 + ((((f64) (spF4 + sp78 + spDC) - (temp_f2_2 * (0.2 * (f64) player->kartFriction))) / 6000.0) * 0.08));
}
temp_f0_4 = (f64) sp58;
sp58 = (f32) (temp_f0_4 + ((((f64) (spF0 + sp7C + spD8) - (temp_f0_4 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / (f64) player->unk_DAC));
sp58 = (f32) (temp_f0_4 + ((((f64) (spF0 + sp7C + spD8) - (temp_f0_4 * (0.12 * (f64) player->kartFriction))) / 6000.0) / (f64) player->unk_DAC));
temp_v0_4 = player->unk_0CA;
if (((temp_v0_4 & 2) == 2) || ((temp_v0_4 & 8) == 8)) {
sp58 = 0.0f;
@ -3439,9 +3439,9 @@ void control_cpu_movement(Player *player, Camera *camera, s8 arg2, s8 arg3) {
sp70 = player->unk_034[2];
temp_f0 = (f64) sp68;
temp_f2 = (f64) sp70;
temp_f8 = (f32) (temp_f0 + (((f64) (spF4 + sp84 + spD0) - (temp_f0 * (0.12 * (f64) player->unk_0FC))) / 6000.0));
temp_f8 = (f32) (temp_f0 + (((f64) (spF4 + sp84 + spD0) - (temp_f0 * (0.12 * (f64) player->kartFriction))) / 6000.0));
sp68 = temp_f8;
temp_f8_2 = (f32) (temp_f2 + (((f64) (spFC + sp7C + spD8) - (temp_f2 * (0.12 * (f64) player->unk_0FC))) / 6000.0));
temp_f8_2 = (f32) (temp_f2 + (((f64) (spFC + sp7C + spD8) - (temp_f2 * (0.12 * (f64) player->kartFriction))) / 6000.0));
sp70 = temp_f8_2;
temp_f12 = player->pos[0];
temp_f14 = player->pos[2];
@ -4392,9 +4392,9 @@ void func_80030FC8(Player *player) {
player->unk_08C = (player->unk_09C * player->unk_09C) / 25.0f;
}
player->unk_044 |= 0x20;
if ((player->unk_00C * 8) < 0) {
if ((player->statusEffects * 8) < 0) {
func_8008F104(player, player_index);
player->unk_00C &= 0xEFFFFFFF;
player->statusEffects &= 0xEFFFFFFF;
}
}
@ -4416,9 +4416,9 @@ void func_80031F48(Player *player, f32 arg1) {
player->unk_08C = (player->unk_09C * player->unk_09C) / 25.0f;
}
player->unk_044 &= 0xFFDF;
if ((player->unk_00C * 8) < 0) {
if ((player->statusEffects * 8) < 0) {
func_8008F104(player, player_index);
player->unk_00C &= 0xEFFFFFFF;
player->statusEffects &= 0xEFFFFFFF;
}
}
@ -4847,9 +4847,9 @@ void func_80032CB0(Player *player, f32 arg1) {
player->unk_09C = player->unk_214;
}
if ((f64) player->unk_09C <= (player->unk_214 * D_800EDBA0)) {
player->unk_00C &= 0xEFFFFFFF;
player->statusEffects &= 0xEFFFFFFF;
}
player->unk_00C &= 0xFDFFFFFF;
player->statusEffects &= 0xFDFFFFFF;
player->unk_044 &= 0xFFDF;
player->unk_098 = (player->unk_09C * player->unk_09C) / 25.0f;
}
@ -5551,7 +5551,7 @@ void func_80033AE0(Player *player, struct Controller *arg1, s8 arg2) {
if (((sp2D0 >= 0x5A) || (sp2D0 < -0x59)) && ((player->unk_044 & 0x4000) == 0)) {
temp_v1_4 = player->unk_0BC;
if (((temp_v1_4 & 0x10) == 0) && (gCCSelection == CC_150) && (gModeSelection != BATTLE) && ((temp_v1_4 & 8) == 0) && (((player->unk_094 / 18.0f) * 216.0f) >= 40.0f) && (player->unk_204 == 0)) {
player->unk_00C |= 0x80;
player->statusEffects |= 0x80;
}
}
temp_v0_4 = player->boundingBoxCorners[3].surfaceType;
@ -6870,7 +6870,7 @@ void func_80038C6C(Player *player, Camera *camera, s8 arg2, s8 arg3) {
func_8002AB70(player);
temp_a1 = player->unk_174[0];
spA4 = (spFC + player->unk_064) * 0.0f;
spA0 = player->unk_100 * -1.0f;
spA0 = player->kartGravity * -1.0f;
sp110 = 0.0f;
sp10C = 0.0f;
sp108 = 0.0f;
@ -6887,10 +6887,10 @@ void func_80038C6C(Player *player, Camera *camera, s8 arg2, s8 arg3) {
temp_f0 = (f64) sp88;
sp90 = player->unk_034[2];
temp_f2 = (f64) sp90;
sp88 = (f32) (temp_f0 + ((((f64) (sp114 + spA4 + spF0) - (temp_f0 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / 1.0));
sp88 = (f32) (temp_f0 + ((((f64) (sp114 + spA4 + spF0) - (temp_f0 * (0.12 * (f64) player->kartFriction))) / 6000.0) / 1.0));
temp_f12 = (f64) temp_f8;
sp90 = (f32) (temp_f2 + ((((f64) (sp11C + sp9C + spF8) - (temp_f2 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / 1.0));
sp8C = (f32) (temp_f12 + ((((f64) (sp118 + spA0 + spF4) - (temp_f12 * (0.12 * (f64) player->unk_0FC))) / 6000.0) / 1.0));
sp90 = (f32) (temp_f2 + ((((f64) (sp11C + sp9C + spF8) - (temp_f2 * (0.12 * (f64) player->kartFriction))) / 6000.0) / 1.0));
sp8C = (f32) (temp_f12 + ((((f64) (sp118 + spA0 + spF4) - (temp_f12 * (0.12 * (f64) player->kartFriction))) / 6000.0) / 1.0));
temp_v0 = player->unk_044;
if ((temp_v0 & 0x10) == 0x10) {
player->unk_044 = temp_v0 & 0xFFEF;

View File

@ -14,6 +14,9 @@
#include "code_80071F00.h"
#include "main.h"
extern struct UnkStruct_800DC5EC *D_800DC5F0;
extern s32 D_8018D1F0;
void func_800431B0(Vec3f arg0, Vec3s arg1, f32 arg2, Vtx *vtx) {
func_80042E00(arg0, arg1, arg2);
gSPVertex(gDisplayListHead++, vtx, 4, 0);
@ -4580,6 +4583,7 @@ extern s8 D_8018D228;
extern u8 D_8018D230;
s16 gCurrentCourseId; /* unable to generate initializer */
// arg0 = cameraHeight
void func_80051C60(s16 arg0, s32 arg1) {
Gfx *temp_v1;
s16 temp_v0;
@ -4709,17 +4713,9 @@ void func_80052044(void) {
func_80051C60(240 - D_800DC5EC->cameraHeight, 0);
}
#ifdef MIPS_TO_C
//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b
extern void *D_800DC5F0;
extern s32 D_8018D1F0;
void func_80052080(void) {
func_80051C60((s16) (0xF0 - D_800DC5F0->unk28), D_8018D1F0);
func_80051C60(240 - D_800DC5F0->cameraHeight, D_8018D1F0);
}
#else
GLOBAL_ASM("asm/non_matchings/code_800431B0/func_80052080.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307

View File

@ -2431,10 +2431,26 @@ void func_8005C65C(s32 arg0) {
D_8018D2C8[arg0] = 1;
}
#ifdef MIPS_TO_C
#ifdef NON_MATCHING
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s16 D_800E4730[];
struct D_800E4730_struct {
s16 unk0;
s16 unk2;
s16 unk4;
};
extern struct D_800E4730_struct D_800E4730[]; // 22 elements?
// Regalloc
void func_8005C674(s8 arg0, s16 *arg1, s16 *arg2, s16 *arg3) {
struct D_800E4730_struct *temp = &D_800E4730[arg0];
// permute
*arg1 = temp->unk0;
*arg2 = temp->unk2;
*arg3 = temp->unk4;
}
/* m2c
void func_8005C674(s8 arg0, s16 *arg1, s16 *arg2, s16 *arg3) {
void *temp_v0 = D_800E4730 + arg0;
@ -2442,6 +2458,8 @@ void func_8005C674(s8 arg0, s16 *arg1, s16 *arg2, s16 *arg3) {
*arg2 = temp_v0->unk2;
*arg3 = temp_v0->unk4;
}
*/
#else
GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8005C674.s")
#endif

View File

@ -171,23 +171,16 @@ void func_80072120(s32 *arg0, s32 arg1) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072120.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
extern s32 D_80162DF8;
void func_80072180(void) {
u16 temp_v0;
if (gModeSelection == TIME_TRIALS) {
temp_v0 = gPlayerOne->unk_000;
if (((temp_v0 & 0x8000) != 0) && ((temp_v0 & 0x1100) == 0)) {
if (((gPlayerOne->unk_000 & PLAYER_EXISTS) != 0) &&
((gPlayerOne->unk_000 & (PLAYER_INVISIBLE_OR_BOMB | PLAYER_CPU)) == 0)) {
D_80162DF8 = 1;
}
}
}
#else
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80072180.s")
#endif
void func_800721C0(s32 arg0, s32 arg1) {
D_80165C18[arg0].unk_054 |= arg1;
@ -4699,6 +4692,9 @@ GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007AA44.s")
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
extern s32 D_80183E88;
/**
* Give item
*/
void func_8007ABFC(u8 arg0, s32 arg1) {
s32 sp1C;
struct_8018CA70_entry *sp18;
@ -5525,27 +5521,23 @@ void func_8007BFB0(s32 objectIndex) {
GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007BFB0.s")
#endif
#ifdef MIPS_TO_C
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
void func_800723A4(s32, ?); // extern
#ifdef NON_MATCHING
void func_800723A4(s32, s32); // extern
void func_8007BEC8(s32); // extern
void func_8007BFB0(s32); // extern
extern s8 D_801658BC;
extern ? D_80165CBE;
extern s32 D_80183F28;
extern s16 D_80165CBE[];
// Unsure about D_80183F28[D_80165CBE] due to m2c:
// D_80165CBE + (D_80183F28 * 0xE0)
// This could be a fake match. Apparently it didn't match at all.
void func_8007C280(void) {
s32 sp1C;
s32 temp_a0;
temp_a0 = D_80183F28;
if (D_801658BC == 1) {
D_801658BC = 0;
sp1C = temp_a0;
func_800723A4(temp_a0, 0);
func_800723A4(D_80183F28, 0);
}
if (*(&D_80165CBE + (D_80183F28 * 0xE0)) != 0) {
sp1C = D_80183F28;
if (*(&D_80165CBE[D_80183F28[0]])) {
func_8007BEC8(D_80183F28);
func_8007BFB0(D_80183F28);
}
@ -8157,7 +8149,7 @@ void func_80080B28(s32 objectIndex, s32 playerId) {
temp_s0 = &gPlayerOne[playerId];
if (func_8007223C(objectIndex, 0x00000200) != 0) {
if (!(temp_s0->unk_00C & 0x100)) {
if (!(temp_s0->statusEffects & 0x100)) {
temp_f0 = func_80088F54(objectIndex, temp_s0);
if (((f64) temp_f0 <= 9.0) && ((temp_s0->unk_0BC << 5) >= 0) && (sp2C = temp_f0, (func_80088D18(objectIndex, temp_s0) != 0))) {
temp_v0 = temp_s0->unk_000;
@ -8189,7 +8181,7 @@ void func_80080B28(s32 objectIndex, s32 playerId) {
func_800722A4(objectIndex, 2);
temp_s0->unk_040 = (s16) objectIndex;
temp_s0->unk_046 |= 2;
temp_s0->unk_00C |= 0x100;
temp_s0->statusEffects |= 0x100;
func_80088FF0(temp_s0);
}
}
@ -8217,22 +8209,22 @@ void func_80080DE4(s32 arg0) {
var_v1 += 4;
if (arg0 == var_v0->unk_040) {
var_v0->unk_040 = -1;
var_v0->unk_00C &= ~0x100;
var_v0->statusEffects &= ~0x100;
}
temp_v0 = var_v0 + 0xDD8;
if (arg0 == var_v0->unkE18) {
temp_v0->unk_040 = -1;
temp_v0->unk_00C &= ~0x100;
temp_v0->statusEffects &= ~0x100;
}
temp_v0_2 = temp_v0 + 0xDD8;
if (arg0 == temp_v0->unkE18) {
temp_v0_2->unk_040 = -1;
temp_v0_2->unk_00C &= ~0x100;
temp_v0_2->statusEffects &= ~0x100;
}
temp_v0_3 = temp_v0_2 + 0xDD8;
if (arg0 == temp_v0_2->unkE18) {
temp_v0_3->unk_040 = -1;
temp_v0_3->unk_00C &= ~0x100;
temp_v0_3->statusEffects &= ~0x100;
}
var_v0 = temp_v0_3 + 0xDD8;
} while (var_v1 != 8);
@ -8802,7 +8794,7 @@ void func_80081D34(s32 objectIndex) {
if (var_s1->unk_0BC & 0x200) {
func_800C9060(var_s2 & 0xFF, 0x1900A046U);
} else {
var_s1->unk_00C |= 2;
var_s1->statusEffects |= 2;
}
temp_s0->unk_0BE[1] = (u16) var_s4->rot[1];
temp_s0->unk_03C = (f32) ((f64) (var_s1->unk_094 / 2.0f) + 3.0);

View File

@ -1117,7 +1117,7 @@ s32 func_80089B50(s32 objectIndex) {
if ((temp_v0 & 0x8000) && !(temp_v0 & 0x100) && (func_80088D18(objectIndex, var_s0) != 0)) {
sp40 = 1;
if (!(var_s0->unk_0BC & 0x200)) {
var_s0->unk_00C |= 0x400000;
var_s0->statusEffects |= 0x400000;
if (func_8007223C(objectIndex, 0x04000000) != 0) {
func_80072180();
}
@ -1160,7 +1160,7 @@ s32 func_80089CBC(s32 objectIndex, f32 arg1) {
if ((temp_v0 & 0x8000) && !(temp_v0 & 0x100) && (func_80088E98(objectIndex, var_s0, arg1) != 0)) {
var_s7 = 1;
if (!(var_s0->unk_0BC & 0x200)) {
var_s0->unk_00C |= 0x400000;
var_s0->statusEffects |= 0x400000;
if (func_8007223C(objectIndex, 0x04000000) != 0) {
func_80072180();
}
@ -1202,7 +1202,7 @@ s32 func_80089F24(s32 objectIndex) {
if (func_8007223C(objectIndex, 0x04000000) != 0) {
func_80072180();
}
var_s0->unk_00C |= 0x200000;
var_s0->statusEffects |= 0x200000;
}
}
var_s1 += 1;

View File

@ -160,7 +160,7 @@ UNUSED void func_unnamed33(void) {
void func_8008C310(Player *player) {
if ((player->unk_00C & 2) || (player->unk_00C & 4) || ((player->unk_00C << 9) < 0) || (player->unk_00C & 0x1000000)) {
if ((player->statusEffects & 2) || (player->statusEffects & 4) || ((player->statusEffects << 9) < 0) || (player->statusEffects & 0x1000000)) {
player->unk_0B6 = ((u16)player->unk_0B6 | 0x1000);
}
}
@ -241,7 +241,7 @@ void func_8008C528(Player *player, s8 arg1) {
} else {
func_800098FC(arg1, player);
}
player->unk_00C = (s32) (player->unk_00C & ~4);
player->statusEffects = (s32) (player->statusEffects & ~4);
}
void func_8008C62C(Player *player, s8 arg1) {
@ -332,7 +332,7 @@ void func_8008C8C4(Player* player, s8 arg1) {
player->unk_09C = (f32) (player->unk_09C + 100.0f);
}
if ((gModeSelection == VERSUS) && ((player->unk_000 & 0x1000) == 0x1000) && (D_800DC51C == 0) && ((player->unk_0CA & 2) == 0) && (gPlayerPositions[arg1] != 0)) {
player->unk_00C = (s32) (player->unk_00C | 0x400000);
player->statusEffects = (s32) (player->statusEffects | 0x400000);
}
}
@ -415,7 +415,7 @@ GLOBAL_ASM("asm/non_matchings/code_8008C1D0/func_8008C9EC.s")
void func_8008CDC0(Player* player, s8 arg1) {
func_8008C354(player, arg1);
player->unk_00C &= ~1;
player->statusEffects &= ~1;
player->unk_0B4 = 0;
player->unk_0B8 = 3.0f;
player->unk_0AC = 1;
@ -511,7 +511,7 @@ void func_8008D0E4(Player* player, UNUSED s8 arg1) {
void func_8008D0FC(Player *player, s8 arg1) {
func_8008C354(player, arg1);
player->unk_00C &= ~0x80;
player->statusEffects &= ~0x80;
player->unk_0B4 = 0;
player->unk_0B8 = 2.0f;
player->unk_0AC = 1;
@ -603,7 +603,7 @@ void func_8008D3C4(Player* player, s8 arg1) {
func_8008C354(player, arg1);
player->unk_0BC |= 0x2000;
player->unk_00C &= ~0x200;
player->statusEffects &= ~0x200;
player->unk_DB4 = 0;
player->unk_DBC = 8.0f;
@ -650,7 +650,7 @@ void func_8008D570(Player *player, s8 arg1) {
player->unk_0AE = player->unk_02C[1];
player->unk_0BC |= 0x80000;
player->unk_0BC &= ~0x10;
player->unk_00C &= ~0x1000;
player->statusEffects &= ~0x1000;
player->kartHopJerk = D_800E3730[player->characterId];
player->kartHopAcceleration = 0.0f;
player->kartHopVelocity = (f32) D_800E3710[player->characterId];
@ -697,7 +697,7 @@ void func_8008D760(Player* player) {
player->unk_0C0 = 0;
player->unk_02C[1] = player->unk_0AE;
player->unk_0BC &= 0xFFF7FFFF;
player->unk_100 = gKartGravityTable[player->characterId];
player->kartGravity = gKartGravityTable[player->characterId];
player->unk_000 &= 0xFF7F;
}
@ -707,7 +707,7 @@ void func_8008D7B0(Player* player, s8 arg1) {
player->unk_0AE = player->unk_02C[1];
player->unk_0BC |= 0x800000;
player->unk_0BC &= ~0x10;
player->unk_00C &= 0xFFFDFFFF;
player->statusEffects &= 0xFFFDFFFF;
player->kartHopJerk = D_800E3770[player->characterId];
player->kartHopAcceleration = 0.0f;
player->kartHopVelocity = D_800E3750[player->characterId];
@ -750,7 +750,7 @@ void func_8008D97C(Player *player) {
player->unk_0C0 = 0;
player->unk_02C[1] = player->unk_0AE;
player->unk_0BC &= 0xFF7FFFFF;
player->unk_100 = gKartGravityTable[player->characterId];
player->kartGravity = gKartGravityTable[player->characterId];
}
void func_8008D9C0(Player* player) {
@ -792,7 +792,7 @@ void func_8008DABC(Player *player, s8 arg1) {
player->unk_D9C = 0.0f;
player->unk_DA0 = 65.0f;
if ((player->unk_00C & 0x100) != 0) {
if ((player->statusEffects & 0x100) != 0) {
player->unk_046 |= 0x80;
}
@ -824,7 +824,7 @@ void func_8008DC08(Player* player, s8 arg1) {
}
if ((player->unk_046 & 0x80) != 0) {
if ((player->unk_00C & 0x100) == 0) {
if ((player->statusEffects & 0x100) == 0) {
D_8018D990[arg1] = 1;
player->unk_238 = 0;
if ((player->unk_000 & 0x4000) != 0) {
@ -916,7 +916,7 @@ void func_8008DC08(Player* player, s8 arg1) {
void func_8008DF98(Player* player, s8 arg1) {
func_8008C354(player, arg1);
player->unk_00C &= ~0x4000;
player->statusEffects &= ~0x4000;
player->unk_0BC |= 0x40020000;
player->unk_0BC &= ~0x10;
player->unk_08C *= D_800EF588;
@ -1136,7 +1136,7 @@ void func_8008E6C0(Player *player, s8 arg1)
func_800098FC(arg1, player);
}
player->unk_00C &= ~0x00480000;
player->statusEffects &= ~0x00480000;
player->unk_0B6 |= 0x40;
D_80165480[arg1] = 0;
D_80165460[arg1] = 0;
@ -1236,7 +1236,7 @@ void func_8008EAE0(Player* player, s8 arg1) {
player->unk_0BC |= 0x02000000;
player->unk_0B6 |= 0x40;
player->unk_00C &= ~0x01000002;
player->statusEffects &= ~0x01000002;
D_80165480[arg1] = 0;
D_80165460[arg1] = 0;
@ -1259,7 +1259,7 @@ void func_8008EC88(Player* player, s8 arg1) {
func_8008C354(player, arg1);
player->unk_0BC |= 0x100000;
player->unk_00C &= ~0x00800000;
player->statusEffects &= ~0x00800000;
player->unk_DB4 = 0;
player->unk_DBC = 8.0f;
if (D_8015F890 != 1) {
@ -1307,7 +1307,7 @@ void func_8008EEE4(Player* player, s8 arg1) {
func_8008C354(player, arg1);
player->unk_0BC |= 0x4;
player->unk_00C &= ~0x8000;
player->statusEffects &= ~0x8000;
if (D_8015F890 != 1) {
if (((player->unk_000 & 0x4000) == 0x4000) && ((player->unk_000 & 0x100) == 0)) {
@ -1506,7 +1506,7 @@ void func_8008F778(Player* player, s8 arg1) {
func_8008C354(player, arg1);
player->unk_0BC |= 0x200;
player->unk_00C &= ~0x2000;
player->statusEffects &= ~0x2000;
D_8018D930[arg1] = gCourseTimer;
D_8018D900[arg1] = 1;
if (((player->unk_000 & 0x4000) == 0x4000) && ((player->unk_000 & 0x100) != 0x100)) {
@ -1581,7 +1581,7 @@ void func_8008FA38(Player* player, s8 arg1) {
func_8008C354(player, arg1);
player->unk_0BC |= 0x80000000;
player->unk_00C &= ~0x800;
player->statusEffects &= ~0x800;
D_8018D950[arg1] = gCourseTimer;
D_8018D970[arg1] = 0xFF;
@ -1627,8 +1627,8 @@ void func_8008FC64(Player* player, s8 arg1) {
player->unk_0C6 -= 4;
if (player->unk_0C6 < 5) {
player->unk_0C6 = 0;
player->unk_00C &= 0xFBFFFFFF;
player->unk_00C |= 0x08000000;
player->statusEffects &= 0xFBFFFFFF;
player->statusEffects |= 0x08000000;
player->unk_000 |= 0x40;
func_8008FDA8(player, arg1);
@ -1640,7 +1640,7 @@ void func_8008FCDC(Player* player, s8 arg1) {
player->unk_0C6 += 2;
if (player->unk_0C6 >= 0xF0) {
player->unk_0C6 = 0xFF;
player->unk_00C &= ~0x08000000;
player->statusEffects &= ~0x08000000;
}
func_80056A40(arg1, (u32) player->unk_0C6);
@ -1649,7 +1649,7 @@ void func_8008FCDC(Player* player, s8 arg1) {
void func_8008FD4C(Player* player, UNUSED s8 arg1) {
s16 temp_v0;
player->unk_00C |= 0x04000000;
player->statusEffects |= 0x04000000;
player->unk_044 |= 0x200;
for (temp_v0 = 0; temp_v0 < 10; ++temp_v0) {
@ -1676,7 +1676,7 @@ void func_8008FDF4(Player* player, UNUSED s8 arg1) {
player->kartHopJerk = D_800E37F0[player->characterId];
player->kartHopAcceleration = 0.0f;
player->kartHopVelocity = D_800E37D0[player->characterId];
player->unk_00C &= ~0x00100000;
player->statusEffects &= ~0x00100000;
player->unk_0BC |= 0x10000000;
}
@ -2328,7 +2328,7 @@ void func_80091298(Player *player, s8 arg1) {
player->unk_044 &= 0xF7FF;
player->unk_DC0 = 3.0f;
player->unkD4 = 0;
player->unk_100 = gKartGravityTable[player->characterId];
player->kartGravity = gKartGravityTable[player->characterId];
player->unk_000 |= 0x2000;
player->unk_094 = 0.0f;
player->unk_08C = 0.0f;

View File

@ -630,7 +630,7 @@ void func_8028EF28(void) {
}
D_800DC510 = 5;
i = D_8015F8F2[0];
gPlayers[i].unk_00C |= 0x200000;
gPlayers[i].statusEffects |= 0x200000;
gPlayers[i].unk_000 |= PLAYER_CPU;
func_800CA118((u8)i);
break;
@ -648,7 +648,7 @@ void func_8028EF28(void) {
if (*(gNmiUnknown2 + i * 3 + 2) > 99) {
*(gNmiUnknown2 + i * 3 + 2) = 99;
}
gPlayers[i].unk_00C |= 0x200000;
gPlayers[i].statusEffects |= 0x200000;
gPlayers[i].unk_000 |= PLAYER_CPU;
func_800CA118((u8)i);
}
@ -663,7 +663,7 @@ void func_8028EF28(void) {
if (currentPosition == 2) {
D_800DC510 = 5;
i = D_8015F8F2[2];
gPlayers[i].unk_00C |= 0x200000;
gPlayers[i].statusEffects |= 0x200000;
gPlayers[i].unk_000 |= PLAYER_CPU;
func_800CA118((u8)i);
}
@ -1262,14 +1262,14 @@ void func_802903D8(Player *player_one, Player *player_two) {
func_800C9060(((s32) (player_two - gPlayerOne) / 3544) & 0xFF, 0x19008001U);
return;
}
player_two->unk_00C |= 0x400000;
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->unk_00C |= 0x400000;
player_one->statusEffects |= 0x400000;
func_8008FC1C(player_two);
func_800C9060(((s32) (player_one - gPlayerOne) / 3544) & 0xFF, 0x19008001U);
return;
@ -1278,10 +1278,10 @@ block_8:
temp_v0 = player_one->unk_0BC;
if (temp_v0 & 0x200) {
if (!(player_two->unk_0BC & 0x200)) {
player_two->unk_00C |= 0x01000000;
player_two->statusEffects |= 0x01000000;
}
} else if (player_two->unk_0BC & 0x200) {
player_one->unk_00C |= 0x01000000;
player_one->statusEffects |= 0x01000000;
} else {
player_one->unk_0BC = temp_v0 | 0x8000;
player_two->unk_0BC |= 0x8000;

View File

@ -9,17 +9,18 @@
#include "code_80027D00.h"
#include "spawn_players.h"
void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4, f32 arg5, u16 arg6, s16 arg7) {
// arg4 is height? Or something like that?
void spawn_player(Player *player, s8 playerIndex, f32 startingRow, f32 startingColumn, f32 arg4, f32 arg5, u16 characterId, s16 playerType) {
f32 ret;
s8 idx;
player->unk_000 = PLAYER_INACTIVE;
player->unk_08C = 0;
player->characterId = arg6;
player->characterId = characterId;
player->unk_0B6 = 0;
player->unk_0FC = gKartFrictionTable[player->characterId];
player->kartFriction = gKartFrictionTable[player->characterId];
player->boundingBoxSize = gKartBoundingBoxSizeTable[player->characterId];
player->unk_100 = gKartGravityTable[player->characterId];
player->kartGravity = gKartGravityTable[player->characterId];
switch (gModeSelection) {
case GRAND_PRIX:
@ -46,18 +47,18 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4,
break;
}
player->pos[0] = arg2;
ret = func_802AE1C0(arg2, arg4 + 50.0f, arg3) + player->boundingBoxSize;
player->pos[2] = arg3;
player->pos[0] = startingRow;
ret = func_802AE1C0(startingRow, arg4 + 50.0f, startingColumn) + player->boundingBoxSize;
player->pos[2] = startingColumn;
player->pos[1] = ret;
player->rotX = arg2;
player->rotX = startingRow;
player->rotY = ret;
D_80164510[playerIndex] = ret;
player->unk_02C[0] = 0;
player->rotZ = arg3;
player->rotZ = startingColumn;
player->unk_05C = 1.0f;
player->unk_058 = 0.0f;
player->unk_060 = 0.0f;
@ -79,7 +80,7 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4,
player->unk_090 = 0.0f;
player->unk_094 = 0.0f;
player->unk_074 = 0.0f;
player->unk_000 = arg7;
player->unk_000 = playerType;
player->unk_0CA = 0;
player->unk_0DE = 0;
player->unk_10C = 0;
@ -92,7 +93,7 @@ void spawn_player(Player *player, s8 playerIndex, f32 arg2, f32 arg3, f32 arg4,
player->unk_DAC = 0.0f;
player->unk_044 = 0;
player->unk_046 = 0;
player->unk_00C = 0;
player->statusEffects = 0;
player->unk_0C6 = 0xFF;