core1/code_13680.c done

This commit is contained in:
Banjo Kazooie 2022-11-07 15:46:41 -06:00
parent 7071f98cc9
commit 14edee83be
6 changed files with 58 additions and 54 deletions

View File

@ -1,4 +1,4 @@
# banjo (93.0880%)
# banjo (93.1411%)
<img src="./progress/progress_total.svg">

View File

@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#3be000" d="M44 0h67v20H44z"/>
<path fill="#39e000" 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">core1</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">86.8247%</text>
<text x="77.5" y="14">86.8247%</text>
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">87.1908%</text>
<text x="77.5" y="14">87.1908%</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">93.0880%</text>
<text x="183.5" y="14">93.0880%</text>
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">93.1411%</text>
<text x="183.5" y="14">93.1411%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -23,13 +23,9 @@ s32 spriteGetFrameCount(BKSprite *this){
return this->frameCnt;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13680/spriteGetFramePtr.s")
// //NONMATCHING bad RegAlloc
/*BKSpriteFrame *spriteGetFramePtr(BKSprite *this, u32 frame){
u32 f_data;
u32 *f_array = this + 1;
f_data = (u32)(f_array + this->frameCnt) + f_array[frame];
return f_data;
}//*/
BKSpriteFrame *spriteGetFramePtr(BKSprite *this, u32 frame)
{
BKSpriteFrame * new_var;
new_var = this->offsets[frame] + ((s32) ((*this).offsets + this->frameCnt));
return new_var;
}

View File

@ -86,49 +86,57 @@ void func_80245F34(f32 *arg0, f32 *arg1, f32 *arg2) {
*arg2 *= inv_len;
}
#ifndef NONMATCHING
void func_80245FB8(f32 mf[4][4], u16 *perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale);
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80245FB8.s")
#else
void func_80245FB8(float mf[4][4], u16 *perspNorm, float fovy, float aspect, float near, float far, float scale)
{
float cot;
f32 tmp;
int i, j;
near = (near < 1) ? 1 : near;
far = (far < near + 100) ? near + 100 : far;
tmp = ((2 * near * far) / (near - far));
if( ( tmp*scale > 32767) || (tmp*scale < -32767)) {
tmp = ((tmp*scale > 32767) ? 32767.0f : -32767.0f);
near = (-(tmp/scale) * far) / ((2 * far) - (tmp/scale));
float cot;
float tmp;
int i;
int j;
near = (near < 1.0f) ? (1.0f) : (near);
far = (far < (near + 100.0f)) ? (near + 100.0f) : (far);
tmp = ((2 * near) * far) / (near - far);
if (((tmp * scale) > 32767) || ((tmp * scale) < (-32767)))
{
tmp = ((tmp * scale) > 32767) ? (32767) : (-32767);
near = ((-(tmp / scale)) * far) / ((2 * far) - (tmp / scale));
}
guMtxIdentF(mf);
fovy *= BAD_DTOR;
cot = cosf(fovy / 2) / sinf(fovy / 2);
mf[0][0] = cot / aspect;
mf[1][1] = cot;
mf[2][2] = (near + far) / (near - far);
mf[2][3] = -1;
if (!far)
{
}
mf[3][2] = ((2 * near) * far) / (near - far);
mf[3][3] = 0;
for (i = 0; i < 4; i++)
{
for (j = 0; j < 4; j++)
{
mf[i][j] *= scale;
}
guMtxIdentF(mf);
fovy *= 3.1415926 / 180.0;
cot = cosf (fovy/2) / sinf (fovy/2);
mf[0][0] = cot / aspect;
mf[1][1] = cot;
mf[2][2] = (near + far) / (near - far);
mf[2][3] = -1;
mf[3][2] = ((2 * near * far) / (near - far));
mf[3][3] = 0;
}
for (i=0; i<4; i++)
for (j=0; j<4; j++)
mf[i][j] *= scale;
if (perspNorm != (u16 *) NULL) {
if ((near + far)<=2.0) {
*perspNorm = (u16) 0xFFFF;
} else {
*perspNorm = (u16) ((2.0*65536.0)/(near + far));
if (*perspNorm<=0)
*perspNorm = (u16) 0x0001;
}
}
if (perspNorm != ((u16 *) 0))
{
if ((near + far) <= 2.0)
{
*perspNorm = (u16) 0xFFFF;
}
else
{
*perspNorm = (u16) ((2.0 * 65536.0) / (near + far));
if ((*perspNorm) <= 0)
{
*perspNorm = (u16) 0x0001;
}
}
}
}
#endif
void guPerspective(Mtx *m, u16 *perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale) {

View File

@ -52,7 +52,7 @@ segments:
- [0x11AC0, c, code_11AC0]
- [0x12F10, c, code_12F10] #DONE
- [0x13640, c, code_13640] #DONE
- [0x13680, c, code_13680]
- [0x13680, c, code_13680] #DONE
- [0x136D0, c, code_136D0]
- [0x13990, c, code_13990]
- [0x155F0, hasm, code_155F0] #DONE