func_802F1440() match, core2/code_6A4B0.c done, progress update

This commit is contained in:
Banjo Kazooie
2023-02-27 18:12:11 -06:00
parent 69c2d2bcbb
commit f0af2d1620
4 changed files with 27 additions and 40 deletions

View File

@@ -31,23 +31,15 @@ Gfx D_803689D0[] = {
/* .code */
#ifndef NONMATCHING
s32 D_80368A10[6] = {0x60, 0x840, 0x60, 0x840, 0x840, 0x60};
s32 D_80368A28[6] = {0x60, 0x60, 0x860, 0x60, 0x860, 0x860};
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_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Vtx *start_vtx;
Vtx *sp9C;
s32 *var_s1;
s32 *var_s2;
s16 *temp_v0_2;
Vtx *i_vtx;
s32 var_s3;
s32 sp54;
s32 sp50;
s32 sp4C;
s16 *temp_v0_2;
static s32 D_80368A10[6] = {0x60, 0x840, 0x60, 0x840, 0x840, 0x60};
static s32 D_80368A28[6] = {0x60, 0x60, 0x860, 0x60, 0x860, 0x860};
@@ -56,48 +48,44 @@ void func_802F1440(Struct_Core2_6A4B0_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx)
}
gSPDisplayList((*gfx)++, D_803689D0);
start_vtx = sp9C = *vtx;
i_vtx = sp9C = *vtx;
for(sp4C = 0; sp4C < 6; sp4C++){
for(sp50 = 0; sp50 < 9; sp50++){
for(sp54 = 0; sp54 < 2; sp54++){
var_s1 = D_80368A10 + 3*sp54;\
var_s2 = D_80368A28 + 3*sp54;
for(var_s3 = 0; var_s3 < 3; var_s3++){
temp_v0_2 = func_802F1804(arg0, sp50, sp4C, sp54, var_s3);
sp9C->n.ob[0] = temp_v0_2[0];
sp9C->n.ob[1] = temp_v0_2[1];
sp9C->n.ob[2] = temp_v0_2[2];
i_vtx->n.ob[0] = temp_v0_2[0];
i_vtx->n.ob[1] = temp_v0_2[1];
i_vtx->n.ob[2] = temp_v0_2[2];
sp9C->n.flag = 0;
i_vtx->n.flag = 0;
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++;
i_vtx->n.tc[0] = D_80368A10[sp54 * 3 + var_s3];
i_vtx->n.tc[1] = D_80368A28[sp54 * 3 + var_s3];
i_vtx->n.n[0] = -1;
i_vtx->n.n[1] = -1;
i_vtx->n.n[2] = -1;
i_vtx->n.a = 0xFF;
i_vtx++;
}
}
}
}
*vtx = sp9C;
sp9C = start_vtx;
*vtx = i_vtx;
i_vtx = sp9C;
var_s3 = 0;
gSPVertex((*gfx)++, osVirtualToPhysical(sp9C), 16, 0);
gSPVertex((*gfx)++, osVirtualToPhysical(i_vtx), 16, 0);
for(sp4C = 0; sp4C < 6; sp4C++){
for(sp50 = 0; sp50 < 9; sp50++){
temp_v0_2 = arg0->tmem_ptr + (0x20*sp50 + 1) + (0x20*sp4C + 0xC)*framebuffer_width;
s16 *temp_v0_2 = arg0->tmem_ptr + (0x20*sp50 + 1) + (0x20*sp4C + 0xC)*framebuffer_width;
gDPLoadTextureTile((*gfx)++, osVirtualToPhysical(temp_v0_2), G_IM_FMT_RGBA, G_IM_SIZ_16b, framebuffer_width, 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;
if (var_s3 == 0xF) {
sp9C += 0xF;
i_vtx += 0xF;
var_s3 = 0;
gSPVertex((*gfx)++, osVirtualToPhysical(sp9C), 16, 0);
gSPVertex((*gfx)++, osVirtualToPhysical(i_vtx), 16, 0);
}
}
}
@@ -106,7 +94,6 @@ void func_802F1440(Struct_Core2_6A4B0_2 *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx)
func_8024C904(gfx, mtx);
}
}
#endif
s16 *func_802F1804(Struct_Core2_6A4B0_2 *arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
return (s16*)(arg0->vtx_coord + (arg1 * 2*3) + (arg2 * 2*3*9) + (arg3 * 3) + (arg4));