core1/done/gu/mtxutil.c done

This commit is contained in:
Banjo Kazooie
2022-10-14 14:03:43 -05:00
parent 03904ccd4a
commit 59f32adc6b
8 changed files with 56 additions and 57 deletions

View File

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

View File

@@ -9,7 +9,7 @@
</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="#5ae000" d="M44 0h67v20H44z"/> <path fill="#52e000" d="M44 0h67v20H44z"/>
<path fill="url(#b)" d="M0 0h111v20H0z"/> <path fill="url(#b)" d="M0 0h111v20H0z"/>
</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">
@@ -17,7 +17,7 @@
<text x="22.0" y="14">core1</text> <text x="22.0" y="14">core1</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">79.9278%</text> <text x="78.5" y="15" fill="#010101" fill-opacity=".3">81.7847%</text>
<text x="77.5" y="14">79.9278%</text> <text x="77.5" y="14">81.7847%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -9,7 +9,7 @@
</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="#2be000" d="M150 0h67v20H150z"/> <path fill="#2ae000" d="M150 0h67v20H150z"/>
<path fill="url(#b)" d="M0 0h217v20H0z"/> <path fill="url(#b)" d="M0 0h217v20H0z"/>
</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">
@@ -17,7 +17,7 @@
<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">90.4260%</text> <text x="184.5" y="15" fill="#010101" fill-opacity=".3">90.6955%</text>
<text x="183.5" y="14">90.4260%</text> <text x="183.5" y="14">90.6955%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -2,6 +2,8 @@
#include "functions.h" #include "functions.h"
#include "variables.h" #include "variables.h"
ALGlobals *alGlobals = NULL;
void alInit(ALGlobals *g, ALSynConfig *c){ void alInit(ALGlobals *g, ALSynConfig *c){
if (!alGlobals) { /* already initialized? */ if (!alGlobals) { /* already initialized? */
alGlobals = g; alGlobals = g;
@@ -31,8 +33,3 @@ void alUnlink(ALLink *ln){
if (ln->prev) if (ln->prev)
ln->prev->next = ln->next; ln->prev->next = ln->next;
} }

View File

@@ -2,6 +2,46 @@
#include "functions.h" #include "functions.h"
#include "variables.h" #include "variables.h"
void guMtxL2F(float mf[4][4], Mtx *m)
{
int i, j;
unsigned int e1,e2;
unsigned int *ai,*af;
int q1,q2;
ai=(unsigned int *) &m->m[0][0];
af=(unsigned int *) &m->m[2][0];
for (i=0; i<4; i++)
for (j=0; j<2; j++) {
e1 = (*ai & 0xffff0000) | ((*af >> 16) & 0xffff);
e2 = ((*(ai++) << 16) & 0xffff0000) | ((u16)(*(af++) >> 0));
q1 = *((int *)&e1);
q2 = *((int *)&e2);
mf[i][j*2] = (f32)q1/65536.0f;
mf[i][j*2+1] = (f32)q2/65536.0f;
}
}
void guMtxIdent(Mtx *m){
float mf[4][4];
guMtxIdentF(mf);
guMtxF2L(mf, m);
}
void guMtxIdentF(float mf[4][4])
{
int i, j;
for (i=0; i<4; i++)
for (j=0; j<4; j++)
if (i == j) mf[i][j] = 1.0;
else mf[i][j] = 0.0;
}
void guMtxF2L(float mf[4][4], Mtx *m) void guMtxF2L(float mf[4][4], Mtx *m)
{ {
int i, j; int i, j;
@@ -20,43 +60,3 @@ void guMtxF2L(float mf[4][4], Mtx *m)
*(af++) = ((e1 << 16) & 0xffff0000) | (e2 & 0xffff); *(af++) = ((e1 << 16) & 0xffff0000) | (e2 & 0xffff);
} }
} }
void guMtxIdentF(float mf[4][4])
{
int i, j;
for (i=0; i<4; i++)
for (j=0; j<4; j++)
if (i == j) mf[i][j] = 1.0;
else mf[i][j] = 0.0;
}
void guMtxIdent(Mtx *m){
float mf[4][4];
guMtxIdentF(mf);
guMtxF2L(mf, m);
}
#pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/mtxutil/guMtxL2F.s")
// void guMtxL2F(float mf[4][4], Mtx *m)
// {
// int i, j;
// unsigned int e1,e2;
// unsigned int *ai,*af;
// int q1,q2;
// ai=(unsigned int *) &m->m[0][0];
// af=(unsigned int *) &m->m[2][0];
// for (i=0; i<4; i++)
// for (j=0; j<2; j++) {
// e1 = (*ai & 0xffff0000) | ((*af >> 16) & 0xffff);
// e2 = ((*(ai++) << 16) & 0xffff0000) | (*(af++) & 0xffff);
// q1 = *((int *)&e1);
// q2 = *((int *)&e2);
// mf[i][j*2] = FIX32TOF(q1);
// mf[i][j*2+1] = FIX32TOF(q2);
// }
// }

View File

@@ -8,7 +8,7 @@ f32 sinf(f32);
f32 cosf(f32); f32 cosf(f32);
#pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/rotate/guRotateF.s") #pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/rotate/guRotateF.s")
// MATCHING but need to resolve core1 data section for static D_80285900 // MATCHING but need to resolve core1 bss section for static D_80285900
// void guRotateF(float mf[4][4], float a, float x, float y, float z) // void guRotateF(float mf[4][4], float a, float x, float y, float z)
// { // {
// static f32 D_80285900 = 3.1415926 / 180.0; // static f32 D_80285900 = 3.1415926 / 180.0;
@@ -45,7 +45,7 @@ f32 cosf(f32);
// } // }
#pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/rotate/guRotate.s") #pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/rotate/guRotate.s")
// MATCHING with -O3, need to resolve data section // MATCHING with -O3, need to resolve bss section
// void guRotate(Mtx *m, float a, float x, float y, float z) // void guRotate(Mtx *m, float a, float x, float y, float z)
// { // {
// float mf[4][4]; // float mf[4][4];

View File

@@ -134,7 +134,7 @@ segments:
- [0x27390, c, done/os/destroythread] #DONE - [0x27390, c, done/os/destroythread] #DONE
- [0x27490, c, done/os/sendmesg] #DONE - [0x27490, c, done/os/sendmesg] #DONE
- [0x275E0, c, done/os/settreadpri] #DONE - [0x275E0, c, done/os/settreadpri] #DONE
- [0x276C0, c, gu/mtxutil] - [0x276C0, c, done/gu/mtxutil] #DONE
- [0x27930, c, done/gu/sqrtf] #DONE - [0x27930, c, done/gu/sqrtf] #DONE
- [0x27940, c, gu/cosf] - [0x27940, c, gu/cosf]
- [0x27AB0, hasm, ultra/setintmask] #DONE - [0x27AB0, hasm, ultra/setintmask] #DONE
@@ -255,7 +255,8 @@ segments:
- [0x39290, bin, data_39290] - [0x39290, bin, data_39290]
- [0x39470, .data, done/audio/n_drvrNew] - [0x39470, .data, done/audio/n_drvrNew]
- [0x39600, .data, done/audio/n_env] - [0x39600, .data, done/audio/n_env]
- [0x39700, bin, data_39700] - [0x39700, .data, os/initialize]
- [0x39720, .data, done/audio/sl]
- [0x39730, .data, done/io/aisetnextbuf] - [0x39730, .data, done/io/aisetnextbuf]
- [0x39740, .data, done/io/pimgr] - [0x39740, .data, done/io/pimgr]
- [0x39770, .data, done/io/vimgr] - [0x39770, .data, done/io/vimgr]
@@ -286,7 +287,7 @@ segments:
- [0x3A920, .rodata, code_1BE90] - [0x3A920, .rodata, code_1BE90]
- [0x3A950, .rodata, code_1D5D0] - [0x3A950, .rodata, code_1D5D0]
- [0x3A9B0, .rodata, done/audio/n_synthesizer] - [0x3A9B0, .rodata, done/audio/n_synthesizer]
- [0x3A9C0, bin, data_3A9C0] # .rodata, done/audio/n_csplayer] - [0x3A9C0, bin, data_3A9C0] # .rodata, audio/n_csplayer]
- [0x3AD30, .rodata, done/audio/n_reverb] - [0x3AD30, .rodata, done/audio/n_reverb]
- [0x3AD60, .rodata, done/audio/n_drvrNew] - [0x3AD60, .rodata, done/audio/n_drvrNew]
- [0x3AD80, .rodata, done/audio/n_env] - [0x3AD80, .rodata, done/audio/n_env]

View File

@@ -437,6 +437,7 @@ rmonPrintf = 0x80269BCC;
dtor = 0x80285900; dtor = 0x80285900;
__osContinitialized = 0x802771B0; __osContinitialized = 0x802771B0;
osClockRate = 0x80277120; osClockRate = 0x80277120;
__osShutdown = 0x8027712C;
_MotorStopData = 0x802859A0; _MotorStopData = 0x802859A0;
_MotorStartData = 0x80285AA0; _MotorStartData = 0x80285AA0;
_motorstartbuf = 0x80285BC0; _motorstartbuf = 0x80285BC0;