core2/code_B7B20.c done

This commit is contained in:
Banjo Kazooie
2022-09-07 18:02:25 -05:00
parent d825c19aee
commit 36483d436e
6 changed files with 91 additions and 31 deletions

View File

@@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#45e000" d="M44 0h67v20H44z"/>
<path fill="#44e000" 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">84.6613%</text>
<text x="77.5" y="14">84.6613%</text>
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">84.8097%</text>
<text x="77.5" y="14">84.8097%</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">86.3708%</text>
<text x="183.5" y="14">86.3708%</text>
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">86.4559%</text>
<text x="183.5" y="14">86.4559%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -3,14 +3,77 @@
#include "variables.h"
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EAB0.s")
void func_8033EAB0(s32 arg0[3], s32 arg1[3], s32 arg2[3], s32 arg3[3]) {
s32 i;
for(i = 0; i < 3; i++){
arg0[i] = arg2[i];
arg1[i] = arg3[i];
}
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EAF8.s")
s32 func_8033EAF8(s32 arg0[3], s32 arg1[3], f32 arg2[3], f32 arg3[3]) {
f32 sp14[3];
f32 temp_f2;
f32 var_f0;
s32 var_a0;
s32 var_v0;
s32 var_v1;
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EC10.s")
var_f0 = 0.0f;
for(var_v0 = 0; var_v0 < 2; var_v0++){
for(var_v1 = 0; var_v1 < 2; var_v1++){
for(var_a0 = 0; var_a0 < 2; var_a0++){
sp14[0] = (f32)((var_v0) ? arg0[0] : arg1[0]) - arg2[0];
sp14[1] = (f32)((var_v1) ? arg0[1] : arg1[1]) - arg2[1];
sp14[2] = (f32)((var_a0) ? arg0[2] : arg1[2]) - arg2[2];
temp_f2 = (arg3[0] * sp14[0]) + (arg3[1] * sp14[1]) + (arg3[2] * sp14[2]);
if (var_f0 < temp_f2) {
var_f0 = temp_f2;
}
}
}
}
return (s32) var_f0;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EC70.s")
bool func_8033EC10(s32 arg0[3], s32 arg1[3], s32 arg2[3]) {
s32 i;
for(i = 0; i < 3; i++){
if (arg0[i] >= arg2[i]) {
return FALSE;
}
if (arg2[i] >= arg1[i]) {
return FALSE;
}
}
return TRUE;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033ECD8.s")
bool func_8033EC70(s32 arg0[3], s32 arg1[3], s32 arg2[3], s32 arg3) {
s32 i;
for(i = 0; i < 3; i++){
if (arg0[i] >= (arg2[i] + arg3)) {
return FALSE;
}
if ((arg2[i] - arg3) >= arg1[i]) {
return FALSE;
}
}
return TRUE;
}
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EDF0.s")
void func_8033ECD8(s32 arg0[3], s32 arg1[3], s32 arg2) {
s32 i;
for(i = 0; i < 3; i++){
arg0[i] = (arg0[i] >= 0) ? arg0[i]/ arg2 : arg0[i]/ arg2 - 1;
arg1[i] = (arg1[i] >= 0) ? arg1[i]/ arg2 : arg1[i]/ arg2 - 1;
}
}
void func_8033EDF0(s32 arg0[3], s32 arg1[3], f32 arg2[3]) {
s32 i;
for(i = 0; i < 3; i++){
arg0[i] += arg2[i];
arg1[i] += arg2[i];
}
}

View File

@@ -186,8 +186,8 @@ BKModel *func_8033F5F8(BKMeshList *arg0, BKVertexList *arg1) {
sp40 = (BKModel *)malloc((func_802E9F60() * sizeof(BKVtxRef)) + (arg0->meshCount_0 * sizeof(BKMesh)) + sizeof(BKModel));
sp40->meshList_0 = arg0;
sp40->vtxList_4 = arg1;
phi_s3 = arg0 + 1;
phi_s5 = (sp40 + 1);
phi_s3 = (BKMesh *)(arg0 + 1);
phi_s5 = (BKMesh *)(sp40 + 1);
for(phi_s6 = 0; phi_s6 < arg0->meshCount_0; phi_s6++){
phi_s5->uid_0 = (s16) phi_s3->uid_0;
phi_s5->vtxCount_2 = (s16) phi_s3->vtxCount_2;
@@ -195,10 +195,10 @@ BKModel *func_8033F5F8(BKMeshList *arg0, BKVertexList *arg1) {
phi_s0 = (BKVtxRef *)(phi_s5 + 1);
for(phi_s1 = 0; phi_s1 < phi_s3->vtxCount_2; phi_s1++){
phi_s0[phi_s1].unk10 = phi_s2[phi_s1];
memcpy(&phi_s0->v, arg1 + (phi_s0->unk10 * sizeof(Vtx)) + sizeof(BKVertexList), sizeof(Vtx));
memcpy(&phi_s0->v, (Vtx *)(arg1 + 1) + phi_s0->unk10, sizeof(Vtx));
}
phi_s3 = (s32)phi_s3 + (phi_s3->vtxCount_2 * sizeof(Vtx)) + sizeof(BKMesh);
phi_s5 = (s32)phi_s5 + (phi_s5->vtxCount_2 * sizeof(BKVtxRef)) + sizeof(BKMesh);
phi_s3 = (BKMesh *)((Vtx *)(phi_s3 + 1) + phi_s3->vtxCount_2);
phi_s3 = (BKMesh *)((BKVtxRef *)(phi_s5 + 1) + phi_s5->vtxCount_2);
}
return sp40;
}

View File

@@ -113,13 +113,11 @@ void func_8034ADB4(Struct61s *arg0, s32 *arg1, s32 cnt){
}
}
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C3B20/func_8034AE08.s")
#else
void func_8034AE08(Struct61s *arg0, void *arg1, s32 arg2) {
u32 capacity;
u32 curr_offset;
u32 capacity;
u32 end_ptr;
u32 var_v0;
if (arg0->unk14 == 2) { //read asset
memcpy(arg1, arg0->unk4, arg2);
@@ -130,22 +128,21 @@ void func_8034AE08(Struct61s *arg0, void *arg1, s32 arg2) {
arg0->unkC = (void *) ((u32)arg0->unkC + arg2);
}
else if (arg0->unk14 == 4) { // write bin???
if ((u32)arg0->unk10 < (u32)arg0->unkC + arg2) {
curr_offset = (u32)arg0->unkC - (u32)arg0->unk8;
capacity = ((u32)arg0->unk10 - (u32)arg0->unk8);
capacity *= 2;
while (((u32)arg0->unk8 + capacity) < (u32)arg0->unkC + arg2) {
if ((u8*)arg0->unk10 < (u8*)arg0->unkC + arg2) {
curr_offset = (u8*)arg0->unkC - (u8*)arg0->unk8;
capacity = ((u8*)arg0->unk10 - (u8*)arg0->unk8)*2;
while (((u8*)arg0->unk8 + capacity) < (u8*)arg0->unkC + arg2) {
capacity *= 2;
}
arg0->unk8 = realloc(arg0->unk8, capacity);
arg0->unkC = (u32)arg0->unk8 + curr_offset;
arg0->unk10 = (u32)arg0->unk8 + capacity;
var_v0 = realloc(arg0->unk8, capacity);
arg0->unk8 = var_v0;
arg0->unkC = var_v0 + curr_offset;
arg0->unk10 = var_v0 + capacity;
}
memcpy(arg0->unkC, arg1, arg2);
arg0->unkC = (u32)arg0->unkC + arg2;
}
}
#endif
void func_8034AF24(Struct61s *arg0, s16 *arg1){
func_8034AE08(arg0, arg1, sizeof(s16));

View File

@@ -341,7 +341,7 @@ segments:
- [0xB6C60, c, code_B6C60] #DONE
- [0xB6CE0, c, code_B6CE0] #DONE
- [0xB6EA0, c, code_B6EA0] #DONE
- [0xB7B20, c, code_B7B20]
- [0xB7B20, c, code_B7B20] #DONE
- [0xB7F40, c, code_B7F40] #DONE
- [0xB8020, c, code_B8020] #DONE
- [0xB8070, c, code_B8070] #DONE
@@ -361,7 +361,7 @@ segments:
- [0xC31A0, c, code_C31A0] #DONE
- [0xC3400, c, rand] #DONE
- [0xC3A40, c, code_C3A40] #DONE
- [0xC3B20, c, code_C3B20]
- [0xC3B20, c, code_C3B20] #DONE
- [0xC4320, c, code_C4320] #DONE
- [0xC4F40, c, code_C4F40] #DONE
- [0xC5440, c, code_C5440] #DONE