core1/code_13990.c progress

This commit is contained in:
Banjo Kazooie 2022-10-31 17:03:58 -05:00
parent 1b445e60b4
commit 72fb8eb862
7 changed files with 161 additions and 42 deletions

View File

@ -1,4 +1,4 @@
# banjo (92.3375%)
# banjo (92.4511%)
<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="#43e000" d="M44 0h67v20H44z"/>
<path fill="#3fe000" 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">85.1429%</text>
<text x="77.5" y="14">85.1429%</text>
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">85.9260%</text>
<text x="77.5" y="14">85.9260%</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">92.3375%</text>
<text x="183.5" y="14">92.3375%</text>
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">92.4511%</text>
<text x="183.5" y="14">92.4511%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

6
src/MMM/crc.c Normal file
View File

@ -0,0 +1,6 @@
#include <ultratypes.h>
u32 D_8038C300 = 0x00146061;
u32 D_8038C304 = 0xEC79D7B4;
u32 D_8038C308 = 0x0001B98D;
u32 D_8038C30C = 0x0;

View File

@ -7,7 +7,7 @@
#define CORE2_DATA_CRC2 0
#endif
extern s32 D_803727F4 = CORE2_DATA_CRC2;
extern s32 D_803727F4;
extern struct {
u8 pad0[4];
@ -36,7 +36,7 @@ typedef struct {
/* .data */
extern s32 D_80275D38;
extern s32 D_80276574;
extern s32 D_80276574; // = CORE2_DATA_CRC2
/* .bss */

View File

@ -5,10 +5,17 @@
#include "ml/mtx.h"
void func_8024632C(Mtx*, f32, f32, f32, f32);
f32 func_80263FF0(f32);
f32 cosf(f32);
extern f32 D_80276578;
extern f32 D_8027657C;
extern f64 D_80278220;
extern f64 D_80278228;
extern f64 D_80278230;
/*.bss*/
Mtx_t D_80282810;
@ -124,47 +131,129 @@ void func_80251B5C(f32 arg0, f32 arg1, f32 arg2){
*(var_v0++) = arg0; *(var_v0++) = arg1; *(var_v0++) = arg2; *(var_v0++) = 1.0f;
}
void func_80245DCC(Mtx *,Mtx *, Mtx *);
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251BCC.s")
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251C20.s")
void func_80251C20(f32 arg0, f32 arg1, f32 arg2, f32 arg3) {
func_8024632C(D_80282FD0 + 1, arg0, arg1, arg2, arg3);
func_80245DCC(D_80282FD0 + 1, D_80282FD0, D_80282FD0);
}
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/mlMtxRotPitch.s")
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/mlMtxRotYaw.s")
/*void mlMtxRotYaw(f32 yaw) {
f32 sin;
void mlMtxRotPitch(f32 arg0) {
f32 cos;
f32 phi_f12;
f32 phi_f10;
f32 phi_f8;
f32 phi_f4;
f32 *phi_v0;
s32 phi_v1;
f32 sin;
f32 var_f10;
f32 var_f18;
if (yaw == 0.0f)
return;
if (arg0 != 0.0f) {
arg0 *= D_80276578;
sin = sinf(arg0);
cos = cosf(arg0);
var_f18 = reinterpret_cast(f32, D_80282FD0->m[1][0]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[2][0]);
reinterpret_cast(f32, D_80282FD0->m[1][0]) = var_f18*cos + var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[2][0]) = var_f18*-sin + var_f10*cos;
sin = sinf(yaw*0.0174533);
cos = cosf(yaw*0.0174533);
phi_v0 = D_80282FD0;
for(phi_v1 = 0; phi_v1 < 0xC; phi_v1 += 4){
phi_v0 = (u32)D_80282FD0 + phi_v1;
phi_f12 = phi_v0[0] * cos;
phi_f10 = phi_v0[8] * sin;
phi_f8 = phi_v0[0] * sin;
phi_f4 = phi_v0[8] * cos;
phi_v0[0] = phi_f12 - phi_f10;
phi_v0 = (u32)D_80282FD0 + phi_v1;
phi_v0[8] = phi_f8 + phi_f4;
var_f18 = reinterpret_cast(f32, D_80282FD0->m[1][1]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[2][1]);
reinterpret_cast(f32, D_80282FD0->m[1][1]) = var_f18*cos + var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[2][1]) = var_f18*-sin + var_f10*cos;
var_f18 = reinterpret_cast(f32, D_80282FD0->m[1][2]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[2][2]);
reinterpret_cast(f32, D_80282FD0->m[1][2]) = var_f18*cos + var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[2][2]) = var_f18*-sin + var_f10*cos;
}
}
}//*/
void mlMtxRotYaw(f32 arg0) {
f32 cos;
f32 sin;
f32 var_f10;
f32 var_f18;
s32 i;
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/mlMtxRotRoll.s")
if (arg0 != 0.0f) {
arg0 *= D_80278220;
sin = sinf(arg0);
cos = cosf(arg0);
for(i = 0; i < 3; i++){
var_f18 = reinterpret_cast(f32, D_80282FD0->m[0][i]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[2][i]);
reinterpret_cast(f32, D_80282FD0->m[0][i]) = var_f18*cos - var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[2][i]) = var_f18*sin + var_f10*cos;
}
}
}
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251F8C.s")
void mlMtxRotRoll(f32 arg0) {
f32 cos;
f32 sin;
f32 var_f10;
f32 var_f18;
if (arg0 != 0.0f) {
arg0 *= D_8027657C;
sin = sinf(arg0);
cos = cosf(arg0);
var_f18 = reinterpret_cast(f32, D_80282FD0->m[0][0]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[1][0]);
reinterpret_cast(f32, D_80282FD0->m[0][0]) = var_f18*cos + var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[1][0]) = var_f18*-sin + var_f10*cos;
var_f18 = reinterpret_cast(f32, D_80282FD0->m[0][1]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[1][1]);
reinterpret_cast(f32, D_80282FD0->m[0][1]) = var_f18*cos + var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[1][1]) = var_f18*-sin + var_f10*cos;
var_f18 = reinterpret_cast(f32, D_80282FD0->m[0][2]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[1][2]);
reinterpret_cast(f32, D_80282FD0->m[0][2]) = var_f18*cos + var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[1][2]) = var_f18*-sin + var_f10*cos;
}
}
void func_80251F8C(f32 arg0) {
f32 cos;
f32 sin;
f32 var_f10;
f32 var_f18;
s32 i;
if (arg0 != 0.0f) {
arg0 *= D_80278228;
sin = sinf(arg0);
cos = cosf(arg0);
for(i = 0; i < 3; i++){
var_f18 = reinterpret_cast(f32, D_80282FD0->m[1][i]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[2][i]);
reinterpret_cast(f32, D_80282FD0->m[1][i]) = var_f18*cos + var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[2][i]) = var_f18*-sin +var_f10*cos;
}
}
}
void func_8025208C(f32 arg0) {
f32 cos;
f32 sin;
f32 var_f10;
f32 var_f18;
s32 i;
if (arg0 != 0.0f) {
arg0 *= D_80278230;
sin = sinf(arg0);
cos = cosf(arg0);
for(i = 0; i < 3; i++){
var_f18 = reinterpret_cast(f32, D_80282FD0->m[0][i]);
var_f10 = reinterpret_cast(f32, D_80282FD0->m[2][i]);
reinterpret_cast(f32, D_80282FD0->m[0][i]) = var_f18*cos - var_f10*sin;
reinterpret_cast(f32, D_80282FD0->m[2][i]) = var_f18*sin + var_f10*cos;
}
}
}
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_8025208C.s")
void mlMtxRotate(f32 pitch, f32 yaw, f32 roll){
mlMtxRotYaw(yaw);
@ -196,9 +285,32 @@ void func_80252330(f32 x, f32 y, f32 z){
reinterpret_cast(f32, D_80282FD0->m[3][2]) = z;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_8025235C.s")
void func_8025235C(f32 arg0[3], f32 arg1[3]) {
s32 i;
f32 sp0[3];
#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80252434.s")
sp0[0] = arg1[0];
sp0[1] = arg1[1];
sp0[2] = arg1[2];
for(i = 0; i < 3; i++){
arg0[i] = sp0[0]*reinterpret_cast(f32, D_80282FD0->m[0][i])
+ sp0[1]*reinterpret_cast(f32, D_80282FD0->m[1][i])
+ sp0[2]*reinterpret_cast(f32, D_80282FD0->m[2][i])
+ reinterpret_cast(f32, D_80282FD0->m[3][i]);
}
}
void func_80252434(f32 arg0[3], f32 arg1[3]) {
s32 i;
for(i = 0; i < 3; i++){
arg0[i] = arg1[0]*reinterpret_cast(f32, D_80282FD0->m[0][i])
+ arg1[1]*reinterpret_cast(f32, D_80282FD0->m[1][i])
+ arg1[2]*reinterpret_cast(f32, D_80282FD0->m[2][i])
+ reinterpret_cast(f32, D_80282FD0->m[3][i]);
}
}
void func_802524F0(f32 dst[3], f32 x, f32 y, f32 z) {
dst[0] = x*((f32 (*)[4])D_80282FD0)[0][0] + y*((f32 (*)[4])D_80282FD0)[1][0] + z*((f32 (*)[4])D_80282FD0)[2][0] + ((f32 (*)[4])D_80282FD0)[3][0];

View File

@ -37,6 +37,7 @@ segments:
- [0x2F60, c, code_2F60] #DONE
- [0x3120, c, code_3120] #DONE
- [0x3420, c, code_3420] #DONE
- [0x3420, c, crc] #DONE
- [0x3D50, c, code_3D50] #DONE
- [0x47D0, c, code_47D0] #DONE
- [0x5000, c, code_5000] #DONE
@ -49,7 +50,7 @@ segments:
- [0x00005A40, .data, code_2F60]
- [0x00005B30, .data, code_3420]
- [0x00005E00, .data, code_3D50]
- [0x00005F10, bin, data_5F10]
- [0x00005F10, .data, crc]
- [0x00005F20, .data, code_5000]
- [0x00005F50, .rodata, ch/loggo]
- [0x00005F80, .rodata, ch/napper]