mirror of
https://github.com/n64decomp/mk64
synced 2026-07-08 12:56:13 -04:00
Match 3 functions in code_80027D00 (#172)
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
glabel func_8002C11C
|
||||
/* 02CD1C 8002C11C 8C8E00BC */ lw $t6, 0xbc($a0)
|
||||
/* 02CD20 8002C120 24010010 */ li $at, 16
|
||||
/* 02CD24 8002C124 31CF0010 */ andi $t7, $t6, 0x10
|
||||
/* 02CD28 8002C128 55E1000C */ bnel $t7, $at, .L8002C15C
|
||||
/* 02CD2C 8002C12C 848A0204 */ lh $t2, 0x204($a0)
|
||||
/* 02CD30 8002C130 84980204 */ lh $t8, 0x204($a0)
|
||||
/* 02CD34 8002C134 24090064 */ li $t1, 100
|
||||
/* 02CD38 8002C138 27190001 */ addiu $t9, $t8, 1
|
||||
/* 02CD3C 8002C13C A4990204 */ sh $t9, 0x204($a0)
|
||||
/* 02CD40 8002C140 84880204 */ lh $t0, 0x204($a0)
|
||||
/* 02CD44 8002C144 29010065 */ slti $at, $t0, 0x65
|
||||
/* 02CD48 8002C148 1420000A */ bnez $at, .L8002C174
|
||||
/* 02CD4C 8002C14C 00000000 */ nop
|
||||
/* 02CD50 8002C150 03E00008 */ jr $ra
|
||||
/* 02CD54 8002C154 A4890204 */ sh $t1, 0x204($a0)
|
||||
|
||||
/* 02CD58 8002C158 848A0204 */ lh $t2, 0x204($a0)
|
||||
.L8002C15C:
|
||||
/* 02CD5C 8002C15C 254BFFFF */ addiu $t3, $t2, -1
|
||||
/* 02CD60 8002C160 A48B0204 */ sh $t3, 0x204($a0)
|
||||
/* 02CD64 8002C164 848C0204 */ lh $t4, 0x204($a0)
|
||||
/* 02CD68 8002C168 05810002 */ bgez $t4, .L8002C174
|
||||
/* 02CD6C 8002C16C 00000000 */ nop
|
||||
/* 02CD70 8002C170 A4800204 */ sh $zero, 0x204($a0)
|
||||
.L8002C174:
|
||||
/* 02CD74 8002C174 03E00008 */ jr $ra
|
||||
/* 02CD78 8002C178 00000000 */ nop
|
||||
@@ -1,55 +0,0 @@
|
||||
glabel func_8002E4C4
|
||||
/* 02F0C4 8002E4C4 27BDFFE0 */ addiu $sp, $sp, -0x20
|
||||
/* 02F0C8 8002E4C8 AFBF0014 */ sw $ra, 0x14($sp)
|
||||
/* 02F0CC 8002E4CC 0C009F40 */ jal get_player_index_for_player
|
||||
/* 02F0D0 8002E4D0 AFA40020 */ sw $a0, 0x20($sp)
|
||||
/* 02F0D4 8002E4D4 8FA40020 */ lw $a0, 0x20($sp)
|
||||
/* 02F0D8 8002E4D8 44808000 */ mtc1 $zero, $f16
|
||||
/* 02F0DC 8002E4DC AFA2001C */ sw $v0, 0x1c($sp)
|
||||
/* 02F0E0 8002E4E0 00027080 */ sll $t6, $v0, 2
|
||||
/* 02F0E4 8002E4E4 3C018016 */ lui $at, %hi(D_80164510)
|
||||
/* 02F0E8 8002E4E8 002E0821 */ addu $at, $at, $t6
|
||||
/* 02F0EC 8002E4EC E49000F0 */ swc1 $f16, 0xf0($a0)
|
||||
/* 02F0F0 8002E4F0 E49000F4 */ swc1 $f16, 0xf4($a0)
|
||||
/* 02F0F4 8002E4F4 E49000EC */ swc1 $f16, 0xec($a0)
|
||||
/* 02F0F8 8002E4F8 C4244510 */ lwc1 $f4, %lo(D_80164510)($at)
|
||||
/* 02F0FC 8002E4FC 3C014120 */ li $at, 0x41200000 # 10.000000
|
||||
/* 02F100 8002E500 44813000 */ mtc1 $at, $f6
|
||||
/* 02F104 8002E504 8C86001C */ lw $a2, 0x1c($a0)
|
||||
/* 02F108 8002E508 C48C0014 */ lwc1 $f12, 0x14($a0)
|
||||
/* 02F10C 8002E50C 0C0AB870 */ jal func_802AE1C0
|
||||
/* 02F110 8002E510 46062380 */ add.s $f14, $f4, $f6
|
||||
/* 02F114 8002E514 8FA40020 */ lw $a0, 0x20($sp)
|
||||
/* 02F118 8002E518 3C018016 */ lui $at, %hi(D_80164510)
|
||||
/* 02F11C 8002E51C 44808000 */ mtc1 $zero, $f16
|
||||
/* 02F120 8002E520 C4880070 */ lwc1 $f8, 0x70($a0)
|
||||
/* 02F124 8002E524 46080080 */ add.s $f2, $f0, $f8
|
||||
/* 02F128 8002E528 E4820018 */ swc1 $f2, 0x18($a0)
|
||||
/* 02F12C 8002E52C 8FAF001C */ lw $t7, 0x1c($sp)
|
||||
/* 02F130 8002E530 000FC080 */ sll $t8, $t7, 2
|
||||
/* 02F134 8002E534 00380821 */ addu $at, $at, $t8
|
||||
/* 02F138 8002E538 C42C4510 */ lwc1 $f12, %lo(D_80164510)($at)
|
||||
/* 02F13C 8002E53C 3C014496 */ li $at, 0x44960000 # 1200.000000
|
||||
/* 02F140 8002E540 44815000 */ mtc1 $at, $f10
|
||||
/* 02F144 8002E544 460C1481 */ sub.s $f18, $f2, $f12
|
||||
/* 02F148 8002E548 4612503C */ c.lt.s $f10, $f18
|
||||
/* 02F14C 8002E54C 00000000 */ nop
|
||||
/* 02F150 8002E550 4503000A */ bc1tl .L8002E57C
|
||||
/* 02F154 8002E554 C48A0024 */ lwc1 $f10, 0x24($a0)
|
||||
/* 02F158 8002E558 C4840018 */ lwc1 $f4, 0x18($a0)
|
||||
/* 02F15C 8002E55C 3C01C496 */ li $at, 0xC4960000 # -1200.000000
|
||||
/* 02F160 8002E560 44814000 */ mtc1 $at, $f8
|
||||
/* 02F164 8002E564 460C2181 */ sub.s $f6, $f4, $f12
|
||||
/* 02F168 8002E568 4608303C */ c.lt.s $f6, $f8
|
||||
/* 02F16C 8002E56C 00000000 */ nop
|
||||
/* 02F170 8002E570 45020004 */ bc1fl .L8002E584
|
||||
/* 02F174 8002E574 E4900038 */ swc1 $f16, 0x38($a0)
|
||||
/* 02F178 8002E578 C48A0024 */ lwc1 $f10, 0x24($a0)
|
||||
.L8002E57C:
|
||||
/* 02F17C 8002E57C E48A0018 */ swc1 $f10, 0x18($a0)
|
||||
/* 02F180 8002E580 E4900038 */ swc1 $f16, 0x38($a0)
|
||||
.L8002E584:
|
||||
/* 02F184 8002E584 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
/* 02F188 8002E588 27BD0020 */ addiu $sp, $sp, 0x20
|
||||
/* 02F18C 8002E58C 03E00008 */ jr $ra
|
||||
/* 02F190 8002E590 00000000 */ nop
|
||||
@@ -1,15 +0,0 @@
|
||||
glabel func_80033850
|
||||
/* 034450 80033850 44856000 */ mtc1 $a1, $f12
|
||||
/* 034454 80033854 C4840090 */ lwc1 $f4, 0x90($a0)
|
||||
/* 034458 80033858 44800000 */ mtc1 $zero, $f0
|
||||
/* 03445C 8003385C 460C2180 */ add.s $f6, $f4, $f12
|
||||
/* 034460 80033860 E4860090 */ swc1 $f6, 0x90($a0)
|
||||
/* 034464 80033864 C4880090 */ lwc1 $f8, 0x90($a0)
|
||||
/* 034468 80033868 4608003E */ c.le.s $f0, $f8
|
||||
/* 03446C 8003386C 00000000 */ nop
|
||||
/* 034470 80033870 45000002 */ bc1f .L8003387C
|
||||
/* 034474 80033874 00000000 */ nop
|
||||
/* 034478 80033878 E4800090 */ swc1 $f0, 0x90($a0)
|
||||
.L8003387C:
|
||||
/* 03447C 8003387C 03E00008 */ jr $ra
|
||||
/* 034480 80033880 00000000 */ nop
|
||||
+24
-50
@@ -2265,26 +2265,19 @@ loop_6:
|
||||
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002BF4C.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
void func_8002C11C(void *arg0) {
|
||||
if ((arg0->unkBC & 0x10) == 0x10) {
|
||||
arg0->unk204 = arg0->unk204 + 1;
|
||||
if (arg0->unk204 >= 0x65) {
|
||||
arg0->unk204 = 0x64;
|
||||
return;
|
||||
void func_8002C11C(Player *player) {
|
||||
if ((player->unk_0BC & 0x10) == 0x10) {
|
||||
player->unk_204 += 1;
|
||||
if (player->unk_204 >= 0x65) {
|
||||
player->unk_204 = 0x64;
|
||||
}
|
||||
} else {
|
||||
player->unk_204 -= 1;
|
||||
if (player->unk_204 < 0) {
|
||||
player->unk_204 = 0;
|
||||
}
|
||||
// Duplicate return node #5. Try simplifying control flow for better match
|
||||
return;
|
||||
}
|
||||
arg0->unk204 = arg0->unk204 - 1;
|
||||
if (arg0->unk204 < 0) {
|
||||
arg0->unk204 = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002C11C.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
@@ -3393,33 +3386,19 @@ void func_8002D268(Player *player, s32 arg1, s8 arg2, s8 arg3) {
|
||||
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002D268.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75
|
||||
f32 func_802AE1C0(f32, f32, Player *, f32); /* extern */
|
||||
s32 get_player_index_for_player(); /* extern */
|
||||
|
||||
void func_8002E4C4(Player *player) {
|
||||
s32 sp1C;
|
||||
f32 temp_f12;
|
||||
f32 temp_f2;
|
||||
s32 temp_v0;
|
||||
s32 player_index;
|
||||
|
||||
temp_v0 = get_player_index_for_player(player);
|
||||
sp1C = temp_v0;
|
||||
player_index = get_player_index_for_player(player);
|
||||
player->kartHopJerk = 0.0f;
|
||||
player->kartHopAcceleration = 0.0f;
|
||||
player->kartHopVelocity = 0.0f;
|
||||
temp_f2 = func_802AE1C0(player->posX, D_80164510[temp_v0] + 10.0f, player, player->posZ) + player->unk_070;
|
||||
player->posY = temp_f2;
|
||||
temp_f12 = D_80164510[sp1C];
|
||||
if (((temp_f2 - temp_f12) > 1200.0f) || ((player->posY - temp_f12) < -1200.0f)) {
|
||||
player->posY = func_802AE1C0(player->posX, D_80164510[player_index] + 10.0f, player->posZ) + player->unk_070;
|
||||
if (((player->posY - D_80164510[player_index]) > 1200.0f) || ((player->posY - D_80164510[player_index]) < -1200.0f)) {
|
||||
player->posY = player->rotY;
|
||||
}
|
||||
player->unk_038 = 0.0f;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002E4C4.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
@@ -5553,41 +5532,36 @@ GLOBAL_ASM("asm/non_matchings/code_80027D00/func_800332E8.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
void func_800337CC(void *arg0, f32 arg1, s32 arg2) {
|
||||
//generated by mips_to_c commit 90e635335cb052c4324a3aa7478e4761db19dfaf
|
||||
void func_800337CC(Player *player, f32 arg1, s32 arg2) {
|
||||
f32 *temp_v0;
|
||||
f32 temp_f2;
|
||||
f32 phi_f0;
|
||||
|
||||
arg0->unk44 = arg0->unk44 & 0xFFDF;
|
||||
player->unk_044 &= 0xFFDF;
|
||||
temp_v0 = &D_80165280[arg2];
|
||||
*temp_v0 = *temp_v0 - arg1;
|
||||
*temp_v0 -= arg1;
|
||||
if (*temp_v0 <= 0.0f) {
|
||||
*temp_v0 = 0.0f;
|
||||
}
|
||||
temp_f2 = arg0->unk214;
|
||||
temp_f2 = player->unk_214;
|
||||
phi_f0 = *temp_v0;
|
||||
if (temp_f2 <= *temp_v0) {
|
||||
*temp_v0 = temp_f2;
|
||||
phi_f0 = *temp_v0;
|
||||
}
|
||||
arg0->unk98 = (phi_f0 * phi_f0) / 25.0f;
|
||||
player->unk_098 = (phi_f0 * phi_f0) / 25.0f;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_800337CC.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
void func_80033850(void *arg0, f32 arg1) {
|
||||
arg0->unk90 = arg0->unk90 + arg1;
|
||||
if (arg0->unk90 >= 0.0f) {
|
||||
arg0->unk90 = 0.0f;
|
||||
void func_80033850(Player *arg0, f32 arg1) {
|
||||
arg0->unk_090 += arg1;
|
||||
if (arg0->unk_090 >= 0.0f) {
|
||||
arg0->unk_090 = 0.0f;
|
||||
}
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80033850.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
|
||||
@@ -13,9 +13,12 @@ void func_80029158();
|
||||
void func_800291E8();
|
||||
void func_800291F0();
|
||||
void func_800291F8();
|
||||
void func_8002C11C(Player*);
|
||||
void func_8002AAC0(Player*);
|
||||
void func_8002E4C4(Player*);
|
||||
void func_80030FC8(Player*);
|
||||
void func_80032D94(Player*);
|
||||
void func_80033850(Player*, f32);
|
||||
|
||||
/* This is where I'd put my static data, if I had any */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user