func_80299EC0 match

This commit is contained in:
Banjo Kazooie 2024-08-29 02:42:08 -05:00
parent 01776fb5bf
commit e1ca9892de
4 changed files with 53 additions and 45 deletions

View File

@ -1,4 +1,4 @@
# banjo (99.7661%)
# banjo (99.8594%)
<img src="./progress/progress_total.svg">
@ -25,7 +25,6 @@ Be sure to check scratch "family" for any progress that may not be reflected her
| File | Function | Scratch Link | % | Notes |
| ------------------ | --------------- | ---------------------------------------- | ------ | ----- |
| core2/code_12F30.c | func_80299EC0 | [Ar62G](https://decomp.me/scratch/Ar62G) | 77.65% |
| core2/code_B9770.c | func_803411B0 | [rHkDu](https://decomp.me/scratch/rHkDu) | 87.70% | spline function
## Building

View File

@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#02e000" d="M44 0h67v20H44z"/>
<path fill="#01e000" d="M44 0h67v20H44z"/>
<path fill="url(#b)" d="M0 0h111v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
@ -17,7 +17,7 @@
<text x="22.0" y="14">core2</text>
</g>
<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.5923%</text>
<text x="77.5" y="14">99.5923%</text>
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">99.7549%</text>
<text x="77.5" y="14">99.7549%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -17,7 +17,7 @@
<text x="75.0" y="14">Banjo-Kazooie (us.v10)</text>
</g>
<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.7661%</text>
<text x="183.5" y="14">99.7661%</text>
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">99.8594%</text>
<text x="183.5" y="14">99.8594%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -93,14 +93,14 @@ struct {
D_8037C6F0;
/*.code */
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_12F30/func_80299EC0.s")
#else
void func_80299EC0(f32 arg0[3]) {
f32 spEC[3]; //player_pos
f32 spE0[3];
f32 spD4[3];
f32 a;
f32 f0;
BKModelBin *spC8;
f32 f2;
f32 spB8[3];
f32 spAC[3];
f32 spA0[3];
@ -110,17 +110,14 @@ void func_80299EC0(f32 arg0[3]) {
f32 sp70;
BKCollisionTri *sp6C; //floor_vtx_list
f32 sp48[3][3]; //tri_vtx_coord
f32 temp_f0_2;
f32 temp_f2_2;
f32 temp_f2_4;
Vtx *vtx_buffer;
Vtx *temp_v1;
f32 phi_f18;
f32 f18;
arg0[2] =
arg0[1] =
arg0[0] = 255;
arg0[0] = 255.0f;\
arg0[1] = 255.0f;\
arg0[2] = 255.0f;
if (D_8037C6F0.unk0 == 1) {
sp78 = 50;
} else if (func_8028EE84() == BSWATERGROUP_0_NONE) {
@ -134,77 +131,89 @@ void func_80299EC0(f32 arg0[3]) {
if (spC8 == NULL) {
sp6C = NULL;
}
if ((spEC[1] - func_80294438()) > 100.0f) {
if ((spEC[1] - func_80294438()) > 100) {
sp6C = NULL;
}
if (sp6C == NULL) return;
if (sp6C->unk6 &2) return;
vtx_buffer = vtxList_getVertices(model_getVtxList(spC8));
for(i = 0; i<3; i++){
temp_v1 = vtx_buffer + sp6C->unk0[i];
sp48[i][0] = (f32) temp_v1->v.ob[0];
sp48[i][1] = (f32) temp_v1->v.ob[1];
sp48[i][2] = (f32) temp_v1->v.ob[2];
sp48[i][1] = 0.0f;
sp48[i][1] = 0;
sp7C[i][0] = (f32) temp_v1->v.cn[0];
sp7C[i][1] = (f32) temp_v1->v.cn[1];
sp7C[i][2] = (f32) temp_v1->v.cn[2];
}
// spEC[1] = 0.0f;
spEC[1] = 0;
spE0[0] = spEC[0] - sp48[0][0];
spE0[1] = 0;
spE0[2] = spEC[2] - sp48[0][2];
spE0[1] = 0.0f;
spAC[0] = sp48[0][0] - sp48[1][0];
spAC[1] = 0;
spAC[2] = sp48[0][2] - sp48[1][2];
spAC[1] = 0.0f;
spB8[0] = -(sp48[2][2] - sp48[1][2]);
spB8[2] = sp48[2][0] - sp48[1][0];
spB8[1] = 0.0f;
phi_f18 = (spE0[0] * spB8[0]) + (spE0[1] * spB8[1]) + (spB8[2] * spE0[2]);
phi_f18 = (phi_f18 == 0.0f)? 0.1f : phi_f18;
temp_f0_2 = -((spB8[2] * spAC[2]) + ((spAC[0] * spB8[0]) + 0.0f)) / phi_f18;
spA0[0] = (spE0[0] * temp_f0_2) + sp48[0][0];
spA0[1] = 0.0f;
spA0[2] = (spE0[2] * temp_f0_2) + sp48[0][2];
spB8[0] = sp48[2][0] - sp48[1][0];
spB8[1] = 0;
spB8[2] = sp48[2][2] - sp48[1][2];
//swap
sp70 = spB8[0];
spB8[0] = -spB8[2];
spB8[2] = sp70;
f18 = spE0[0]*spB8[0] + spE0[1]*spB8[1] + spE0[2]*spB8[2];
if (f18 == 0) {
f18 = 0.1;
}
f0 = -(spAC[0]*spB8[0] + spAC[1]*spB8[1] + spAC[2]*spB8[2]) / f18;
spA0[0] = sp48[0][0] + (spE0[0] * f0);
spA0[1] = 0;
spA0[2] = sp48[0][2] + (spE0[2] * f0);
spD4[0] = spA0[0] - sp48[1][0];
spD4[1] = spA0[1] - sp48[1][1];
spD4[2] = spA0[2] - sp48[1][2];
temp_f2_2 = gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2]) / (gu_sqrtf(spB8[0] * spB8[0] + spB8[1] * spB8[1] + spB8[2] * spB8[2]) + 0.01);
f2 = gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2])
/ (gu_sqrtf(spB8[0]*spB8[0] + spB8[1]*spB8[1] + spB8[2]*spB8[2]) + 0.01);
for(i = 0; i < 3; i++){
arg0[i] = sp7C[1][i] + (sp7C[2][i] - sp7C[1][i])*temp_f2_2;
arg0[i] = sp7C[1][i] + (sp7C[2][i] - sp7C[1][i]) * f2;
}
spD4[0] = spA0[0] - sp48[0][0];
spD4[1] = spA0[1] - sp48[0][1];
spD4[2] = spA0[2] - sp48[0][2];
temp_f2_4 = (1.0 - (gu_sqrtf(spE0[0]*spE0[0] + spE0[1]*spE0[1] + spE0[2]*spE0[2]) / (gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2]) + 0.01)));
f2 = 1 - (gu_sqrtf(spE0[0]*spE0[0] + spE0[1]*spE0[1] + spE0[2]*spE0[2])
/ (gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2]) + 0.01));
for(i = 0; i < 3; i++){
arg0[i] += (sp7C[0][i] - arg0[i])*temp_f2_4;
arg0[i] = arg0[i] + (sp7C[0][i] - arg0[i]) * f2;
}
f2 = func_80294404() / 100;
for(i = 0; i < 3; i++){
arg0[i] = arg0[i] + (255 - arg0[i]) * f2;
}
for(i = 0; i < 3; i++){
arg0[i] += (255.0f - arg0[i]) * (func_80294404() / 100.0f);
if(arg0[i] > 255){ arg0[i] = 255; }
if(arg0[i] < 0) { arg0[i] = 0; }
}
for(i = 0; i < 3; i++){
if(arg0[i] > 255.0f){ arg0[i] = 255.0f; }
if(arg0[i] < 0.0f) { arg0[i] = 0.0f; }
}
arg0[0] = ((arg0[0] + arg0[1] + arg0[2]) * (f32) (0xFF - sp78)) / 765.0f + sp78;
arg0[0] = ((arg0[0] + arg0[1] + arg0[2]) * (255 - sp78)) / 765 + sp78;
arg0[1] = arg0[0];
arg0[2] = arg0[0];
}
#endif
void func_8029A47C(s32 arg0[3]){
arg0[0] = (s32)(D_8037C6F0.unk4[0] + 0.5);