core2/code_6A4B0.c progress

This commit is contained in:
Banjo Kazooie
2022-09-20 13:28:22 -05:00
parent ee6cd85a97
commit 976cafe770
4 changed files with 141 additions and 72 deletions

View File

@@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#3fe000" d="M44 0h67v20H44z"/>
<path fill="#3ee000" 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">85.9898%</text>
<text x="77.5" y="14">85.9898%</text>
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">86.1156%</text>
<text x="77.5" y="14">86.1156%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h150v20H0z"/>
<path fill="#3ae000" d="M150 0h67v20H150z"/>
<path fill="#39e000" d="M150 0h67v20H150z"/>
<path fill="url(#b)" d="M0 0h217v20H0z"/>
</g>
<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>
</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">87.1330%</text>
<text x="183.5" y="14">87.1330%</text>
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">87.2052%</text>
<text x="183.5" y="14">87.2052%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -5,11 +5,11 @@
extern s16 D_803A5D00[2][0xF660];
typedef struct {
typedef struct Struct_Core2_6A4B0_2{
void *unk0;
void *unk4;
s32 unk8;
void (*unkC)(void);
void (*unkC)(struct Struct_Core2_6A4B0_2 *, Gfx **, Mtx **, Vtx **);
s32 unk10;
}Struct_Core2_6A4B0_2;
@@ -28,20 +28,39 @@ s32 func_802F1804(s32 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
void func_802F18B8(Struct_Core2_6A4B0_2 *arg0);
/* .data */
extern Gfx D_803689D0[];
extern s32 D_80368A10[2][3];
extern s32 D_80368A28[2][3];
Gfx D_803689D0[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_SHADE | G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH),
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetCombineMode(G_CC_MODULATEI, G_CC_MODULATEI),
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
gsSPEndDisplayList()
};
s32 D_80368A10[6] = {0x60, 0x840, 0x60, 0x840, 0x840, 0x60};
s32 D_80368A28[6] = {0x60, 0x60, 0x860, 0x60, 0x860, 0x860};
s32 D_80368A40[6] = {0, 1, 0, 1, 1, 0};
s32 D_80368A58[6] = {0, 0, 1, 0, 1, 1};
s32 D_80368A70[6] = {0, 1, 0, 1, 1, 0};
s32 D_80368A88[6] = {0, 0, 1, 0, 1, 1};
/* .code */
#ifndef NONMATCHING
void func_802F1440(Struct_Core2_6A4B0_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx);
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1440.s")
#else
void func_802F1440(Struct_Core2_6A4B0_0 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
void func_802F1440(Struct_Core2_6A4B0_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Vtx *sp9C;
s32 sp58;
s32 sp54;
s32 sp50;
s32 sp4C;
Struct_Core2_6A4B0_1 *temp_v0_2;
s32 var_s3;
s32 *var_s1;
s32 *var_s2;
if (arg0->unk10 == 0) {
func_8024C7B8(gfx, mtx);
@@ -51,22 +70,26 @@ void func_802F1440(Struct_Core2_6A4B0_0 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx)
sp9C = *vtx;
for(sp4C = 0; sp4C < 6; sp4C++){
for(sp50 = 0; sp50 < 9; sp50++){
for(sp54 = 0; sp54 < 2; sp54++){
for(sp54 = 0, sp58 = 0; sp54 < 2; sp54++, sp58 += 3){
var_s1 = D_80368A10 + sp58;\
var_s2 = D_80368A28 + sp58;
for(var_s3 = 0; var_s3 < 3; var_s3++){
temp_v0_2 = func_802F1804(arg0, sp50, sp4C, sp54, var_s3);
sp9C->v.ob[0] = temp_v0_2->unk0[0];
sp9C->v.ob[1] = temp_v0_2->unk0[1];
sp9C->v.ob[2] = temp_v0_2->unk0[2];
sp9C->n.ob[0] = temp_v0_2->unk0[0];
sp9C->n.ob[1] = temp_v0_2->unk0[1];
sp9C->n.ob[2] = temp_v0_2->unk0[2];
sp9C->v.flag = 0;
sp9C->n.flag = 0;
sp9C->v.tc[0] = D_80368A10[sp54][var_s3];
sp9C->v.tc[1] = D_80368A28[sp54][var_s3];
sp9C->n.tc[0] = *var_s1;
sp9C->n.tc[1] = *var_s2;
sp9C->n.n[0] = -1;
sp9C->n.n[1] = -1;
sp9C->n.n[2] = -1;
sp9C->n.a = 0xFF;
var_s1++;
var_s2++;
sp9C++;
}
}
@@ -77,7 +100,7 @@ void func_802F1440(Struct_Core2_6A4B0_0 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx)
gSPVertex((*gfx)++, osVirtualToPhysical(sp9C), 16, 0);
for(sp4C = 0; sp4C < 6; sp4C++){
for(sp50 = 0; sp50 < 9; sp50++){
gDPLoadTextureTile((*gfx)++, osVirtualToPhysical(&arg0->unk8[(sp4C*0x20 + 0xC) * D_80276588 + (sp50*0x20 + 1)]), G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, 0, 0, 0, 33, 33, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTextureTile((*gfx)++, osVirtualToPhysical((u16*)arg0->unk8 + (sp4C*0x20 + 0xC) * D_80276588 + (sp50*0x20 + 1)), G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, 0, 0, 0, 33, 33, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
for(sp54 = 0; sp54 < 2; sp54++){
gSP1Triangle((*gfx)++, var_s3, var_s3 + 1, var_s3 + 2, 0);
var_s3 += 3;
@@ -99,9 +122,9 @@ s32 func_802F1804(s32 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
return *arg0 + (arg1 * 0x24) + (arg2 * 0x144) + (arg3 * 0x12) + (arg4 * 6);
}
void func_802F1858(Struct_Core2_6A4B0_2 *arg0){
void func_802F1858(Struct_Core2_6A4B0_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){
if(arg0->unkC != NULL){
arg0->unkC();
arg0->unkC(arg0, gfx, mtx, vtx);
}
}
@@ -142,54 +165,97 @@ void func_802F1934(Struct_Core2_6A4B0_2 * arg0, s32 arg1){
void func_802F1A08(s32 arg0) { }
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1A10.s")
void func_802F1A10(Struct_Core2_6A4B0_2 *arg0, f32 arg1) {
s32 spCC[3];
f32 spC0[3];
f32 temp_f0;
f32 temp_f12;
f32 temp_f20;
f32 cos;
f32 sin;
f32 temp_f2;
s32 *var_s1;
s32 *var_s2;
s32 var_s0;
s32 var_s3;
s32 var_s4;
s32 sp90;
s32 var_s6;
s16 *temp_v0_2;
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1CAC.s")
// void func_802F1CAC(void *arg0) {
// s32 sp84[3];
// f32 sp78[3];
// s32 sp60;
// s32 *var_s1;
// s32 temp_lo;
// s32 temp_v0;
// s32 var_fp;
// s32 var_s0;
// s32 var_s4;
// s32 var_s5;
// s32 var_s6;
// s32 var_s7;
// void *temp_v0_2;
// void *var_s2;
cos = cosf(arg1 * 2 * BAD_PI);
sin = sinf(arg1 * 2 * BAD_PI);
func_8024C5CC(spC0);
spCC[0] = (-(D_80276588 / 2) * 4) + 8;
spCC[1] = ((D_8027658C / 2) * 4) - 0x38;
spCC[2] = -0xA;
for(var_s6 = 0; var_s6 < 6; var_s6++){
for(var_s4 = 0; var_s4 < 9; var_s4++){
for(var_s3 = 0, sp90 = 0; var_s3 < 2; var_s3++, sp90 += 3){
var_s1 = D_80368A40 + sp90;\
var_s2 = D_80368A58 + sp90;
for(var_s0 = 0; var_s0 < 3; var_s0++){
temp_v0_2 = func_802F1804(arg0, var_s4, var_s6, var_s3, var_s0);
temp_f0 = (f32) (spCC[0] + var_s4 * 0x80 + (*var_s1 * 0x80));
temp_f2 = (f32) (spCC[1] - var_s6 * 0x80 - (*var_s2 * 0x80));
// func_8024C5CC(sp78);
// var_fp = 0;
// sp84[0] = (s32) ((1000.0f - sp78[0]) - 200.0f);
// sp84[0] = (s32) ((0.0f - sp78[1]) + 300.0f);
// sp84[2] = (s32) ((2000.0f - sp78[2]) + 0.0f);
// for(var_s7 = 0; var_s7 < 6; var_s7++){
// var_s6 = 0;
// for(var_s5 = 0; var_s5 < 9; var_s5++){
// sp60 = 0;
// for(var_s4 = 0; var_s4 < 2; var_s4++){
// temp_v0 = sp60 * 4;
// var_s1 = temp_v0 + &D_80368A70;
// var_s2 = temp_v0 + &D_80368A88;
// var_s0 = 0;
// for(var_s0 = 0; var_s0 < 2; var_s0++){
// temp_v0_2 = func_802F1804(arg0, var_s5, var_s7, var_s4, var_s0);
// temp_lo = *var_s1 * 0x32;
// var_s1 += 4;
// var_s2 += 4;
// temp_v0_2->unk0 = (s16) (temp_lo + sp84 + var_s6);
// temp_v0_2->unk2 = (s16) ((sp88 - var_fp) - (var_s2->unk-4 * 0x32));
// temp_v0_2->unk4 = (s16) sp8C;
// }
// sp60 += 3;
// }
// var_s6 += 0x32;
// }
// var_fp += 0x32;
// }
// arg0->unkC = &func_802F1440;
// arg0->unk10 = 1;
// }
temp_f0 = temp_f0 * (1.0f - arg1);
temp_f2 = temp_f2 * (1.0f - arg1);
temp_f12 = temp_f0;
temp_f0 = (temp_f12 * cos) - (temp_f2 * sin);
temp_f2 = (temp_f12 * sin) + (temp_f2 * cos);
temp_f0 = temp_f0 + ((-560.0f - temp_f0) * arg1);
temp_f2 = temp_f2 + ((400.0f - temp_f2) * arg1);
temp_v0_2[0] = (s16) (s32) temp_f0;
temp_v0_2[1] = (s16) (s32) temp_f2;
temp_v0_2[2] = (s16) spCC[2];
var_s1++;
var_s2++;
}
}
}
}
arg0->unkC = &func_802F1440;
arg0->unk10 = 0;
}
void func_802F1CAC(Struct_Core2_6A4B0_2 *arg0) {
s32 sp84[3];
f32 sp78[3];
s32 var_s0;
s32 var_s4;
s32 var_s5;
s32 var_s7;
s32 pad;
s32 sp60;
s16 *temp_v0_2;
s32 *var_s1;
s32 *var_s2;
func_8024C5CC(sp78);
sp84[0] = (s32) ((1000.0f - sp78[0]) - 200.0f);
sp84[1] = (s32) ((0.0f - sp78[1]) + 300.0f);
sp84[2] = (s32) ((2000.0f - sp78[2]) + 0.0f);
for(var_s7 = 0; var_s7 < 6; var_s7++){
for(var_s5 = 0; var_s5 < 9; var_s5++){
for(var_s4 = 0, sp60 = 0; var_s4 < 2; var_s4++, sp60 += 3){
var_s1 = D_80368A70 + sp60;\
var_s2 = D_80368A88 + sp60;
for(var_s0 = 0; var_s0 < 3; var_s0++){
temp_v0_2 = func_802F1804(arg0, var_s5, var_s7, var_s4, var_s0);
temp_v0_2[0] = (s16) (sp84[0] + var_s5*0x32 + *var_s1 * 0x32);
temp_v0_2[1] = (s16) (sp84[1] - var_s7*0x32 - *var_s2 * 0x32);
temp_v0_2[2] = (s16) sp84[2];
var_s1++;
var_s2++;
}
}
}
}
arg0->unkC = &func_802F1440;
arg0->unk10 = 1;
}

View File

@@ -531,6 +531,8 @@ segments:
- [0xE1950, .data, gc/bound]
- [0xE19A0, .data, code_67650]
- [0xE19B0, bin, data_E19B0]
- [0xE1A40, .data, code_6A4B0]
- [0xE1B10, bin, data_E1B10]
- [0xE1DF0, .data, code_6CD20]
- [0xE1E40, .data, code_6D030]
- [0xE1E50, bin, data_E1E50]
@@ -753,7 +755,8 @@ segments:
- [0xF0200, .rodata, code_66FB0]
- [0xF0210, .rodata, code_67650]
- [0xF0220, .rodata, code_679A0]
- [0xF0240, bin, data_F0240]
- [0xF0240, .rodata, code_6A4B0]
- [0xF0250, bin, data_F0250]
- [0xF0280, .rodata, code_6CEC0]
- [0xF0290, .rodata, code_6D030]
- [0xF02A0, .rodata, code_6D270]