func_803411B0 match

This commit is contained in:
Banjo Kazooie 2024-08-29 08:50:27 -05:00
parent e1ca9892de
commit 3cfac5bf5c
4 changed files with 144 additions and 141 deletions

View File

@ -1,4 +1,4 @@
# banjo (99.8594%) # banjo (100.0000%)
<img src="./progress/progress_total.svg"> <img src="./progress/progress_total.svg">
@ -19,14 +19,6 @@
- <img src="./progress/progress_fight.svg"> - <img src="./progress/progress_fight.svg">
- <img src="./progress/progress_cutscenes.svg"> - <img src="./progress/progress_cutscenes.svg">
## Remaining Functions
These all are the remaining NTSC-USA V1.0 function left to be matched.
Be sure to check scratch "family" for any progress that may not be reflected here
| File | Function | Scratch Link | % | Notes |
| ------------------ | --------------- | ---------------------------------------- | ------ | ----- |
| core2/code_B9770.c | func_803411B0 | [rHkDu](https://decomp.me/scratch/rHkDu) | 87.70% | spline function
## Building ## Building
Grab tools Grab tools

View File

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="111" height="20"> <svg xmlns="http://www.w3.org/2000/svg" width="118" height="20">
<linearGradient id="b" x2="0" y2="100%"> <linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/> <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/> <stop offset="1" stop-opacity=".1"/>
</linearGradient> </linearGradient>
<mask id="anybadge_1"> <mask id="anybadge_1">
<rect width="111" height="20" rx="3" fill="#fff"/> <rect width="118" height="20" rx="3" fill="#fff"/>
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/> <path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#01e000" d="M44 0h67v20H44z"/> <path fill="#00e000" d="M44 0h74v20H44z"/>
<path fill="url(#b)" d="M0 0h111v20H0z"/> <path fill="url(#b)" d="M0 0h118v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="23.0" y="15" fill="#010101" fill-opacity=".3">core2</text> <text x="23.0" y="15" fill="#010101" fill-opacity=".3">core2</text>
<text x="22.0" y="14">core2</text> <text x="22.0" y="14">core2</text>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">99.7549%</text> <text x="82.0" y="15" fill="#010101" fill-opacity=".3">100.0000%</text>
<text x="77.5" y="14">99.7549%</text> <text x="81.0" y="14">100.0000%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="217" height="20"> <svg xmlns="http://www.w3.org/2000/svg" width="224" height="20">
<linearGradient id="b" x2="0" y2="100%"> <linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/> <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/> <stop offset="1" stop-opacity=".1"/>
</linearGradient> </linearGradient>
<mask id="anybadge_1"> <mask id="anybadge_1">
<rect width="217" height="20" rx="3" fill="#fff"/> <rect width="224" height="20" rx="3" fill="#fff"/>
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h150v20H0z"/> <path fill="#555" d="M0 0h150v20H0z"/>
<path fill="#01e000" d="M150 0h67v20H150z"/> <path fill="#00e000" d="M150 0h74v20H150z"/>
<path fill="url(#b)" d="M0 0h217v20H0z"/> <path fill="url(#b)" d="M0 0h224v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="76.0" y="15" fill="#010101" fill-opacity=".3">Banjo-Kazooie (us.v10)</text> <text x="76.0" y="15" fill="#010101" fill-opacity=".3">Banjo-Kazooie (us.v10)</text>
<text x="75.0" y="14">Banjo-Kazooie (us.v10)</text> <text x="75.0" y="14">Banjo-Kazooie (us.v10)</text>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">99.8594%</text> <text x="188.0" y="15" fill="#010101" fill-opacity=".3">100.0000%</text>
<text x="183.5" y="14">99.8594%</text> <text x="187.0" y="14">100.0000%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -14,9 +14,7 @@ extern f32 func_80323FDC(struct56s *, f32, f32, s32 *);
extern f32 func_803240E0(struct56s *, f32, f32, s32 *); extern f32 func_803240E0(struct56s *, f32, f32, s32 *);
extern void func_8032417C(struct56s *, f32, f32[3], f32[3]); extern void func_8032417C(struct56s *, f32, f32[3], f32[3]);
extern void func_80328FF0(Actor *, f32); extern void func_80328FF0(Actor *, f32);
extern void func_8032DC70(s32);
typedef struct { typedef struct {
f32 unk0; f32 unk0;
@ -153,6 +151,7 @@ typedef struct {
u16 pad8_12:13; u16 pad8_12:13;
}Struct_glspline_803411B0; }Struct_glspline_803411B0;
s32 func_80341BC8(struct56s *arg0, SplineList * arg1); s32 func_80341BC8(struct56s *arg0, SplineList * arg1);
/* .data */ /* .data */
@ -355,161 +354,173 @@ void func_80341180(f32 arg0, s32 arg1, s32 arg2, f32 arg3[3], f32 arg4[3]){
func_80340BE4(arg0, arg1, arg2, arg2, arg3, arg4); func_80340BE4(arg0, arg1, arg2, arg2, arg3, arg4);
} }
#ifndef NONMATCHING void func_803411B0(void){
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803411B0.s")
#else
void func_803411B0(void) {
s32 spE4; s32 spE4;
s32 spE0; s32 spE0;
s32 a0;
Struct_glspline_803411B0 *spD8; Struct_glspline_803411B0 *spD8;
s32 spCC[3]; s32 spCC[3];
s32 spC8; s32 spC8;
s32 spC4; s32 spC4;
s32 padding[3];
struct56s *spB4; struct56s *spB4;
SplineList *spA8; Struct_glspline_803411B0 *spline;
struct56s *spA4;
Union_glspline *sp80;
Struct_glspline_803411B0 *sp50;
Union_glspline *temp_s6;
Union_glspline *var_s0_2; Union_glspline *var_s0_2;
SplineList *spA8;
f32 *spA4;
Union_glspline *var_s1_2; Union_glspline *var_s1_2;
s32 temp_v0_2;
s32 var_a0;
s32 var_a0_3;
s32 var_a0_4;
s32 var_a0_5;
s32 var_fp; s32 var_fp;
s32 var_s0; s32 var_s0;
s32 var_s2; s32 var_s2;
s32 var_s2_2; Union_glspline sp80;
s32 var_s5; s32 var_s5;
s32 var_s7; u32 var_s7;
s32 var_v1;
Union_glspline *temp_s3_2; Union_glspline *temp_s3_2;
Union_glspline *temp_v0_16; Union_glspline *temp_v0_16;
Struct_glspline_803411B0 *temp_v0_17; s32 tmp;
Struct_glspline_803411B0 *var_v0_4;
s16 *i_ptr;
D_80371E80 = 0; D_80371E80 = 0;
D_80371E70 = malloc(0); D_80371E70 = malloc(0);
D_80371E74 = malloc(0); D_80371E74 = malloc(0);
D_80371E78 = 0; D_80371E78 = 0;
D_803858A0 = (s16 *) malloc(0x80*sizeof(s16)); D_803858A0 = malloc(128 * sizeof(s16));
for(var_v1 = 0; var_v1 < 0x80; var_v1++){
D_803858A0[var_v1] = 0; for (spE0 = 0; spE0 < 128; spE0++) {
D_803858A0[spE0] = 0;
} }
spE4 = func_80307E1C(D_803858A0) + 1;
if (spE4 > 1) { spE4 = func_80307E1C() + 1;
spD8 = (Struct_glspline_803411B0 *)malloc(spE4 * sizeof(Struct_glspline_803411B0));
for(var_a0 = 0; var_a0 < spE4; var_a0++){ if (spE4 <= 1) {
spD8[var_a0].unk0 = -1; return;
}
spD8 = (Struct_glspline_803411B0 *) malloc(spE4 * sizeof(Struct_glspline_803411B0));
for (spE0 = 0; spE0 < spE4; spE0++) {
(spD8 + spE0)->unk0 = -1;
}
func_80307EA8(0, spCC, &spC8, &spC4);
do {
spE0 = func_80307EA8(1, spCC, &spC8, &spC4);
if (spE0 >= 0) {
(spD8+spE0)->unk0 = spC8;
(spD8+spE0)->unk8_13 = spC4;
(spD8+spE0)->unk2[0] = spCC[0];
(spD8+spE0)->unk2[1] = spCC[1];
(spD8+spE0)->unk2[2] = spCC[2];
} }
} while (spE0 >= 0);
for (spE0 = 1; spE0 < spE4; spE0++) {
(spD8+spE0)->unk8_15 = 0;
func_80307EA8(0, spCC, &spC8, &spC4); if ((spD8+spE0)->unk0 >= spE4 || (spD8+spE0)->unk0 == -1) {
do { (spD8+spE0)->unk0 = 0;
temp_v0_2 = func_80307EA8(1, spCC, &spC8, &spC4);
if (temp_v0_2 >= 0) {
spD8[temp_v0_2].unk0 = (s16) spC8;
spD8[temp_v0_2].unk2[0] = (s16) spCC[0];
spD8[temp_v0_2].unk2[1] = (s16) spCC[1];
spD8[temp_v0_2].unk2[2] = (s16) spCC[2];
spD8[temp_v0_2].unk8_13 = spC4;
}
} while (temp_v0_2 >= 0);
for(spE0 = 1; spE0 < spE4; spE0++) {
spD8[spE0].unk8_15 = 0;
if ((spD8[spE0].unk0 >= spE4) || (spD8[spE0].unk0 == -1)) {
spD8[spE0].unk0 = 0;
}
} }
}
for(spE0 = 1; spE0 < spE4; spE0++) { for (spE0 = 1; spE0 < spE4; spE0++) {
if (spD8[spE0].unk0 > 0) { if ((spD8+spE0)->unk0 > 0) {
spD8[spD8[spE0].unk0].unk8_15 = 1; (spD8+(spD8+spE0)->unk0)->unk8_15 = 1;
}
} }
}
for(spE0 = 1; spE0 < spE4; spE0++) { for (spE0 = 1; spE0 < spE4; spE0++) {
if( (spD8[spE0].unk8_13 == 1) if ((spD8+spE0)->unk8_13 == 1
&& ((spD8[spE0].unk8_15 != 0) || (spD8[spE0].unk0 <= 0)) && ((spD8+spE0)->unk8_15 != 0 || (spD8+spE0)->unk0 <= 0)
&& ((spD8[spE0].unk8_15 != 1) || (spD8[spE0].unk0 <= 0)) && ((spD8+spE0)->unk8_15 != 1 || (spD8+spE0)->unk0 <= 0)
&& ((spD8[spE0].unk8_15 != 1) || (spD8[spE0].unk0 != 0)) && ((spD8+spE0)->unk8_15 != 1 || (spD8+spE0)->unk0 != 0)) {
) { func_8032DC70(spE0);
func_8032DC70();
spD8[spE0].unk0 = -1; (spD8+spE0)->unk0 = -1;
spD8[spE0].unk8_13 = 0; (spD8+spE0)->unk8_13 = 0;
}
}
for (spE0 = 1; spE0 < spE4; spE0++) {
if ((spD8+spE0)->unk0 > 0 && (spD8+spE0)->unk8_15 == 0 && (spD8+spE0)->unk8_13 == 0) {
var_s5 = 1;
var_s7 = 1;
var_s0 = 0;
var_fp = 0;
for (; var_s5 < spE4; var_s5++) {
(spD8+var_s5)->unk8_14 = 0;
}
for (var_s5 = spE0; (spD8+var_s5)->unk0 != 0 && !(spD8+var_s5)->unk8_14; var_s5 = (spD8+var_s5)->unk0) {
(spD8+var_s5)->unk8_14 = 1;
tmp = (spD8+var_s5)->unk8_13 == 0 ? 1 : 0;
var_s7 += tmp;
var_s0 += ((spD8+var_s5)->unk8_13 == 0) ? 0 : 1;
}
tmp = var_s7 * 3;
spB4 = (struct56s *) malloc(8 + tmp * sizeof(f32));
spA4 = (f32 *) spB4;
spB4->unk0 = var_s7;
spB4->unk4 = 0;
spA8 = (SplineList *) malloc(4 + var_s0 * sizeof(Union_glspline));
spA8->unk0 = var_s0;
var_s1_2 = &spA8->spline[0];
a0 = spE0;
var_s2 = spA8->unk0;
for (; var_s2 != 0; a0 = (spD8+a0)->unk0) {
if (0);
if ((spD8+a0)->unk8_13 == 1) {
temp_v0_16 = func_803080C8(a0);
temp_v0_16->t1.unk8.pad_bit7 = D_80371E78;
memcpy(var_s1_2, temp_v0_16, sizeof(Union_glspline));
var_s1_2++;
var_s2--;
} }
} }
for(spE0 = 1; spE0 < spE4; spE0++) { temp_s3_2 = spA8->unk0 - 1 + spA8->spline;
if (spD8[spE0].unk0 > 0) {
if (spD8[spE0].unk8_15 == 0) {
if (!spD8[spE0].unk8_13) {
var_s7 = 1;
var_s0 = 0;
var_fp = 0;
for(var_s5 = 1; var_s5 < spE4; var_s5++){
spD8[var_s5].unk8_14 = 0;
}
var_v0_4 = &spD8[spE0]; do {
while ((var_v0_4->unk0 != 0) && !(var_v0_4->unk8_14)) { var_s2 = 0;
var_v0_4->unk8_14 = 1;
var_s7 += (var_v0_4->unk8_13 == 0) ? 1 : 0;
var_s0 += (var_v0_4->unk8_13 == 0) ? 0 : 1;
var_v0_4 = &spD8[var_v0_4->unk0];
}
spB4 = (struct56s *) malloc(sizeof(struct56s) + (var_s7 * 3* sizeof(f32))); for (var_s0_2 = &spA8->spline[0]; var_s0_2 < temp_s3_2; var_s0_2++) {
spB4->unk0 = var_s7; var_s1_2 = var_s0_2 + 1;
spB4->unk4 = 0;
spA8 = (SplineList *)malloc(sizeof(SplineList) + var_s0*sizeof(Union_glspline)); if (var_s0_2->common.unk0 > var_s1_2->common.unk0) {
spA8->unk0 = var_s0; memcpy(&sp80, var_s0_2, sizeof(Union_glspline));
var_s1_2 = &spA8->spline[0]; memcpy(var_s0_2, var_s1_2, sizeof(Union_glspline));
var_s2 = var_s0; memcpy(var_s1_2, &sp80, sizeof(Union_glspline));
for(var_a0_4 = spE0; (var_s2 != 0); var_a0_4 = spD8[var_a0_4].unk0){ var_s2++;
if (spD8[var_a0_4].unk8_13 == 1) {
temp_v0_16 = func_803080C8();
temp_v0_16->t1.unk8.pad_bit7 = (s8) D_80371E78;
memcpy(var_s1_2, temp_v0_16, 0x14);
var_s1_2++;
var_s2--;
}
}
temp_s6 = &spA8->spline[0];
temp_s3_2 = &spA8->spline[spA8->unk0];
var_s2_2 = 0;
do {
for(var_s0_2 = temp_s6; var_s0_2 < temp_s3_2; var_s0_2++){
if ((var_s0_2 + 1)->common.unk0 < var_s0_2->common.unk0) {
memcpy(sp80, var_s0_2, sizeof(Union_glspline));
memcpy(var_s0_2, var_s0_2 + 1, sizeof(Union_glspline));
memcpy(var_s0_2 + 1, sp80, sizeof(Union_glspline));
var_s2_2++;
}
}
} while (var_s2_2 != 0);
while(var_s7 != 0){
temp_v0_17 = &spD8[spE0];
if (!(temp_v0_17->unk8_13)) {
spB4->unk8[var_fp][0] = (f32) temp_v0_17->unk2[0];
spB4->unk8[var_fp][1] = (f32) temp_v0_17->unk2[1];
spB4->unk8[var_fp][2] = (f32) temp_v0_17->unk2[2];
var_s7--;
}
}
func_80341BC8(spB4, spA8);
} }
} }
} while (var_s2);
a0 = var_s7;
for (var_s5 = spE0; a0 != 0; var_s5 = (spD8 + var_s5)->unk0) {
if (!(spD8 + var_s5)->unk8_13) {
spA4[var_fp + 2] = (spD8 + var_s5)->unk2[0];
spA4[var_fp + 3] = (spD8 + var_s5)->unk2[1];
spA4[var_fp + 4] = (spD8 + var_s5)->unk2[2];
var_fp += 3;
a0--;
}
} }
func_80341BC8(spB4, spA8);
} }
free(spD8);
} }
free(spD8);
} }
#endif
//glspline_free //glspline_free
void func_80341A54(void) { void func_80341A54(void) {