func_race_8002DF38

This commit is contained in:
Donkey Kong 2024-05-06 13:49:18 +09:30
parent a3d8b2fa36
commit dcb488f2d4
10 changed files with 109 additions and 48 deletions

View File

@ -1216,7 +1216,7 @@ struct actor {
u32 unk18;
u32 unk1C;
u32 unk20;
u32 unk24;
f32 unk24;
u32 unk28;
f32 unk2C;
u32 unk30;

View File

@ -21,7 +21,7 @@ us,.race,func_race_8002A7F8,1652,yes
us,.race,func_race_80027BD0,144,yes
us,.race,func_race_800261E0,372,yes
us,.race,func_race_8002F490,756,no
us,.race,func_race_8002DF38,656,no
us,.race,func_race_8002DF38,656,yes
us,.race,func_race_8002D524,520,no
us,.race,func_race_8002D72C,40,yes
us,.race,func_race_8002E9AC,76,no

1 version section function length matching
21 us .race func_race_80027BD0 144 yes
22 us .race func_race_800261E0 372 yes
23 us .race func_race_8002F490 756 no
24 us .race func_race_8002DF38 656 no yes
25 us .race func_race_8002D524 520 no
26 us .race func_race_8002D72C 40 yes
27 us .race func_race_8002E9AC 76 no

View File

@ -3477,7 +3477,7 @@ us,.race,func_race_8002A7F8,1652,yes
us,.race,func_race_80027BD0,144,yes
us,.race,func_race_800261E0,372,yes
us,.race,func_race_8002F490,756,no
us,.race,func_race_8002DF38,656,no
us,.race,func_race_8002DF38,656,yes
us,.race,func_race_8002D524,520,no
us,.race,func_race_8002D72C,40,yes
us,.race,func_race_8002E9AC,76,no

1 version section function length matching
3477 us .race func_race_80027BD0 144 yes
3478 us .race func_race_800261E0 372 yes
3479 us .race func_race_8002F490 756 no
3480 us .race func_race_8002DF38 656 no yes
3481 us .race func_race_8002D524 520 no
3482 us .race func_race_8002D72C 40 yes
3483 us .race func_race_8002E9AC 76 no

View File

@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h37v20H0z"/>
<path fill="#c09200" d="M37 0h67v20H37z"/>
<path fill="#c09700" d="M37 0h67v20H37z"/>
<path fill="url(#b)" d="M0 0h104v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
@ -17,7 +17,7 @@
<text x="18.5" y="14">race</text>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="71.5" y="15" fill="#010101" fill-opacity=".3">37.9218%</text>
<text x="70.5" y="14">37.9218%</text>
<text x="71.5" y="15" fill="#010101" fill-opacity=".3">39.2917%</text>
<text x="70.5" y="14">39.2917%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h132v20H0z"/>
<path fill="#c09a00" d="M132 0h67v20H132z"/>
<path fill="#c09b00" d="M132 0h67v20H132z"/>
<path fill="url(#b)" d="M0 0h199v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
@ -17,7 +17,7 @@
<text x="66.0" y="14">Donkey Kong 64 (US)</text>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="166.5" y="15" fill="#010101" fill-opacity=".3">40.2341%</text>
<text x="165.5" y="14">40.2341%</text>
<text x="166.5" y="15" fill="#010101" fill-opacity=".3">40.2739%</text>
<text x="165.5" y="14">40.2739%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -61,41 +61,45 @@ s32 func_global_asm_80613CA8(Actor *, s32, f32, f32);
/*
void func_global_asm_8069E210(void) {
s16 i;
Struct807FBB70_unk278 *temp;
s32 ya;
if (!(current_actor_pointer->object_properties_bitfield & 0x10)) {
current_actor_pointer->object_properties_bitfield &= ~4;
func_global_asm_80613C48(current_actor_pointer, 0x407, 0.0f, 0.0f);
func_global_asm_80614D00(current_actor_pointer, 0.0f, 0.0f);
}
if (D_global_asm_807FBB70.unk254 > 0) {
for (i = 0; i < D_global_asm_807FBB70.unk254; i++) {
if (D_global_asm_807FBB70.unk278[i]->unk0 == 0) {
current_actor_pointer->object_properties_bitfield |= 4;
func_global_asm_80613CA8(current_actor_pointer, 0x407, 0.0f, 0.0f);
func_global_asm_80614D00(current_actor_pointer, 1.0f, 0.0f);
switch (func_global_asm_80688E68(current_actor_pointer)) {
case 5:
playSound(0x1D7, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
break;
case 6:
playSound(0x1D8, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
break;
case 7:
playSound(0x1D9, 0x7FFF, 63.0f, 1.0f, 0, 0);
break;
case 8:
playSound(0x1DA, 0x7FFF, 63.0f, 1.0f, 2, 0);
break;
case 9:
playSound(0x1DB, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
break;
case 10:
playSound(0x1DC, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
break;
}
for (i = 0; i < D_global_asm_807FBB70.unk254; i++) {
temp = D_global_asm_807FBB70.unk278[i];
if (temp->unk0 == 0) {
ya = current_actor_pointer->object_properties_bitfield;
current_actor_pointer->object_properties_bitfield = ya | 4;
func_global_asm_80613CA8(current_actor_pointer, 0x407, 0.0f, 0.0f);
func_global_asm_80614D00(current_actor_pointer, 1.0f, 0.0f);
switch (func_global_asm_80688E68(current_actor_pointer)) {
case 5:
playSound(0x1D7, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
break;
case 6:
playSound(0x1D8, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
break;
case 7:
playSound(0x1D9, 0x7FFF, 63.0f, 1.0f, 0, 0);
break;
case 8:
playSound(0x1DA, 0x7FFF, 63.0f, 1.0f, 2, 0);
break;
case 9:
playSound(0x1DB, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
break;
case 10:
playSound(0x1DC, 0x7FFF, 63.0f, 1.0f, 0x1E, 0);
break;
}
}
}
if ((s16)current_actor_pointer->animation_state->unk24->unk0 == 0.0f) {
if (current_actor_pointer->animation_state->unk0->unk24 == 0.0f) {
current_actor_pointer->object_properties_bitfield &= ~4;
}
renderActor(current_actor_pointer, 0);

View File

@ -295,20 +295,19 @@ void func_global_asm_806BB400(void) {
// Fallthrough
case 0x23:
switch (current_actor_pointer->control_state_progress) {
case 2:
break;
case 0:
func_global_asm_8072AB74(0x37, 0.0f, 0.0f, 0x202, 0.0f);
break;
default:
default:
current_actor_pointer->control_state_progress = 1;
// break;
case 1:
if (current_actor_pointer->animation_state->unk64 != 0x21C) {
playActorAnimation(current_actor_pointer, 0x21C);
}
func_global_asm_8072AB74(current_actor_pointer->control_state, D_global_asm_807FDC94->x_position, D_global_asm_807FDC94->z_position, 0, 0.0f);
break;
case 2:
break;
}
break;
case 0x37:

View File

@ -195,11 +195,11 @@ void func_menu_80025FB4(MenuStruct1 *arg0, CharacterProgress *arg1, ? arg2) {
var_s1 = 0;
var_s0 = 6;
if (isFlagSet(0x1CB, FLAG_TYPE_PERMANENT) == 0) {
if (!isFlagSet(0x1CB, FLAG_TYPE_PERMANENT)) {
loop_1:
var_s0 -= 1;
if (var_s0 >= 0) {
if (isFlagSet(var_s0 + 0x1C5, FLAG_TYPE_PERMANENT) == 0) {
if (!isFlagSet(var_s0 + 0x1C5, FLAG_TYPE_PERMANENT)) {
goto loop_1;
}
}

View File

@ -106,8 +106,8 @@ s32 func_race_800276B0(s32 arg0, RaceStruct15 *arg1, RaceStruct15 *arg2) {
// close, doable
#pragma GLOBAL_ASM("asm/nonmatchings/race/code_36B0/func_race_80027880.s")
// TODO: Probably returns the float
/*f32 func_race_80027880(s32 arg0, u16 arg1, u16 arg2) {
/*
f32 func_race_80027880(s32 arg0, u16 arg1, u16 arg2) {
f32 dx;
f32 dz;
f32 dy;
@ -119,7 +119,8 @@ s32 func_race_800276B0(s32 arg0, RaceStruct15 *arg1, RaceStruct15 *arg2) {
dy = D_global_asm_807F5FD4->unk0[arg1][arg2].unk4 - D_global_asm_807F5FD4->unk0[arg1][temp].unk4;
dz = D_global_asm_807F5FD4->unk0[arg1][arg2].unk8 - D_global_asm_807F5FD4->unk0[arg1][temp].unk8;
return sqrtf((dx * dx) + (dy * dy) + (dz * dz));
}*/
}
*/
// doable
#pragma GLOBAL_ASM("asm/nonmatchings/race/code_36B0/func_race_80027920.s")

View File

@ -626,7 +626,14 @@ f32 func_race_8002DD70(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
}
typedef struct {
u8 unk0[0xF - 0x0];
f32 unk0;
f32 unk4; // Used
} Struct8002E1C8_arg0_unk4;
typedef struct {
s32 unk0;
Struct8002E1C8_arg0_unk4 *unk4;
u8 unk8[0xF - 0x8];
u8 unkF;
u8 unk10;
} Struct8002E1C8_arg0;
@ -697,8 +704,58 @@ void func_race_8002DE78(Struct8002E1C8_arg0 *arg0, u8 arg1, Struct8002E1C8_arg2
arg0->unkF = arg1;
}
// Jumptable, doable
#pragma GLOBAL_ASM("asm/nonmatchings/race/code_7BD0/func_race_8002DF38.s")
f32 func_race_8002DF38(Struct8002E1C8_arg0 *arg0, f32 arg1, Struct8002E1C8_arg2 *arg2, Struct8002E1C8_arg3 *arg3) {
f32 sp1C;
f32 var_f0;
Struct8002E1C8_arg0_unk4 *temp;
switch (arg0->unkF) {
case 0:
sp1C = func_race_8002DDA0(arg1, arg2);
break;
case 1:
sp1C = func_race_8002DDA0(arg1, arg2);
if ((arg0->unk10 != 0) && (arg2->unk0[4][0] < arg1) && ((func_global_asm_806119A0() % 255) < 0xA)) {
func_race_8002DE78(arg0, 2, arg2, arg3);
}
break;
case 2:
case 3:
case 4:
if ((arg0->unkF == 3) || (arg0->unkF == 4) || (arg0->unk10 != 0)) {
temp = arg0->unk4;
var_f0 = temp->unk4;
arg2->unk0[0][1] = MIN(var_f0, arg3->unk0);
arg2->unk0[1][1] = MIN(var_f0, arg3->unk4);
if (arg0->unkF == 4) {
arg2->unk0[2][1] = var_f0;
} else {
arg2->unk0[2][1] = arg3->unk8;
}
sp1C = func_race_8002DDA0(arg1, arg2);
if ((arg0->unkF == 2) && (arg1 < arg2->unk0[3][0])) {
func_race_8002DE78(arg0, 3, arg2, arg3);
}
if ((arg0->unkF == 3) && (arg1 < arg2->unk0[2][0])) {
func_race_8002DE78(arg0, 4, arg2, arg3);
}
} else if (arg0->unkF == 2) {
sp1C = arg3->unk4;
func_race_8002DE78(arg0, 1, arg2, arg3);
}
break;
case 5:
sp1C = func_race_8002DDA0(arg1, arg2);
if (arg1 < arg2->unk0[1][0]) {
func_race_8002DE78(arg0, 1, arg2, arg3);
}
break;
default:
sp1C = 0.0f;
break;
}
return sp1C;
}
f32 func_race_8002E1C8(Struct8002E1C8_arg0 *arg0, f32 arg1, Struct8002E1C8_arg2 *arg2, Struct8002E1C8_arg3 *arg3) {
f32 var_f2;