From df42c7853507f01ace6df5f4fa5101f0d88f74d9 Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Wed, 3 Aug 2022 18:36:10 -0500 Subject: [PATCH] core2/code_6B030.c done --- progress/progress_core2.svg | 4 ++-- progress/progress_total.svg | 4 ++-- src/core2/code_679A0.c | 11 ++++----- src/core2/code_6B030.c | 48 ++++++++++++++++--------------------- subyaml/core2.us.v10.yaml | 4 ++-- 5 files changed, 32 insertions(+), 39 deletions(-) diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg index b48df500..73341903 100644 --- a/progress/progress_core2.svg +++ b/progress/progress_core2.svg @@ -17,7 +17,7 @@ core2 - 77.1244% - 77.1244% + 77.3371% + 77.3371% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 9933e405..a0b09d6d 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 81.6669% - 81.6669% + 81.7889% + 81.7889% \ No newline at end of file diff --git a/src/core2/code_679A0.c b/src/core2/code_679A0.c index 56bae9c9..fba6793e 100644 --- a/src/core2/code_679A0.c +++ b/src/core2/code_679A0.c @@ -270,17 +270,16 @@ void func_802EF4AC(ParticleEmitter *this, f32 arg1[3], f32 arg2[3], s32 arg3) { s32 temp_s4; s32 i; - // temp_s4 = arg3 - 1; + temp_s4 = arg3 - 1; sp3C[0] = arg2[0] - arg1[0]; sp3C[1] = arg2[1] - arg1[1]; sp3C[2] = arg2[2] - arg1[2]; - for(i = 0; i < arg3 - 1; i++){ + for(i = 0; i < (arg3 - 1); i++){ if (this->pList_end_128 < this->pList_capacity_12C) { __particleEmitter_initParticle(this, this->pList_end_128); - temp_f0 = (f32)i / arg3; - this->pList_end_128->position_18[0] = arg1[0] + sp3C[0]*temp_f0; - this->pList_end_128->position_18[1] = arg1[1] + sp3C[1]*temp_f0; - this->pList_end_128->position_18[2] = arg1[2] + sp3C[2]*temp_f0; + this->pList_end_128->position_18[0] = arg1[0] + sp3C[0]*((f32)i / arg3); + this->pList_end_128->position_18[1] = arg1[1] + sp3C[1]*((f32)i / arg3); + this->pList_end_128->position_18[2] = arg1[2] + sp3C[2]*((f32)i / arg3); this->pList_end_128++; } } diff --git a/src/core2/code_6B030.c b/src/core2/code_6B030.c index e6fff0af..fa1fea76 100644 --- a/src/core2/code_6B030.c +++ b/src/core2/code_6B030.c @@ -14,8 +14,8 @@ typedef struct { }Struct_core2_6B030_1; typedef struct { - void *unk0; - void *unk4; + BKSprite *unk0; + BKSprite *unk4; }Struct_core2_6B030_0; /* .data */ @@ -36,22 +36,19 @@ Mtx D_80380A18; s32 D_80380A58; /* .code */ -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6B030/func_802F1FC0.s") -#else void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) { f32 temp_f2; s16 *temp_addr; f32 spDC[3]; f32 spD0[3]; - s32 temp_t1_2; + s32 temp_t9; s32 temp_s3; s32 spC4; s32 spC0; s32 spBC; s32 temp_s5; - s32 spB4; - s32 spB0; + s32 width; + s32 height; func_8024C5CC(spDC); spD0[0] = self->unk0[0] - spDC[0]; @@ -83,7 +80,7 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) { } gSPDisplayList((*gfx)++, D_80368AC0); - func_80347FC0(gfx, D_80368AB0[1].unk0, 0, 0, 0, 0, 0, NULL, NULL, &spB4, &spB0); + func_80347FC0(gfx, D_80368AB0[1].unk0, 0, 0, 0, 0, 0, NULL, NULL, &width, &height); temp_addr = &D_803A5D00[func_8024BD80()][spC0*D_80276588 + (spC4 & 0xFFFC)]; gDPSetTextureImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, temp_addr); gDPSetTile((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 9, 0x0080, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD); @@ -95,48 +92,45 @@ void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) { gSPVertex((*gfx)++, *vtx, 8, 0); gSP1Quadrangle((*gfx)++, 0, 1, 3, 2, 0); func_80349AD0(); - func_80347FC0(gfx, D_80368AB0[self->unk22].unk0, NULL, 0, 0, 0, 0, 2, 2, &spB4, &spB0); - if (D_80368AB0[self->unk22].unk4 != NULL) { - func_80347FC0(gfx, D_80368AB0[self->unk22].unk4, NULL, 0x100, 1, 0, 0, 2, 2, &spB4, &spB0); + func_80347FC0(gfx, (D_80368AB0 + self->unk22)->unk0, 0, 0, 0, 0, 0, 2, 2, &width, &height); + if ((D_80368AB0 + self->unk22)->unk4 != NULL) { + func_80347FC0(gfx, (D_80368AB0 + self->unk22)->unk4, 0, 0x100, 1, 0, 0, 2, 2, &width, &height); } gSPDisplayList((*gfx)++, D_80368B08); gSP2Triangles((*gfx)++, 7, 4, 5, 0, 6, 4, 7, 0); func_80349B1C(gfx); gDPSetTextureLOD((*gfx)++, G_TL_LOD); - temp_t1_2 = -(spBC >> 1); - temp_s3 = temp_s5 >> 1; gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); for(spC0 = 0; spC0 < 2; spC0++){ for( spC4 = 0; spC4 < 2; spC4++){ - (*vtx)->v.ob[0] = temp_t1_2 + spC4*spBC; - (*vtx)->v.ob[1] = temp_s3 - spC0*temp_s5; - (*vtx)->v.ob[2] = 0; - (*vtx)->v.tc[0] = (spC4*0x1F) << 6; - (*vtx)->v.tc[1] = (spC0*0x1F) << 6; + (*vtx)->n.ob[0] = -(spBC >> 1) + spC4*spBC; + (*vtx)->n.ob[1] = (temp_s5 >> 1) - spC0*temp_s5; + (*vtx)->n.ob[2] = 0; + (*vtx)->n.tc[0] = (spC4*0x1F) << 6; + (*vtx)->n.tc[1] = (spC0*0x1F) << 6; (*vtx)->n.n[0] = 0xB4; (*vtx)->n.n[1] = 0xF0; (*vtx)->n.n[2] = 0xFF; - (*vtx)->v.cn[3] = 0xA0; + (*vtx)->n.a = 0xA0; (*vtx)++; } } for(spC0 = 0; spC0 < 2; spC0++){ for(spC4 = 0; spC4 < 2; spC4++){ - (*vtx)->v.ob[0] = temp_t1_2 + spC4*spBC; - (*vtx)->v.ob[1] = temp_s3 - spC0*temp_s5; - (*vtx)->v.ob[2] = 0; - (*vtx)->v.tc[0] = ((spC4 ^ 1)*(spB4 - 1)) << 6; - (*vtx)->v.tc[1] = (spC0*(spB0 - 1)) << 6; + (*vtx)->n.ob[0] = -(spBC >> 1) + spC4*spBC; + (*vtx)->n.ob[1] = (temp_s5 >> 1) - spC0*temp_s5; + (*vtx)->n.ob[2] = 0; + (*vtx)->n.tc[0] = ((spC4 ^ 1)*(width - 1)) << 6; + (*vtx)->n.tc[1] = (spC0*(height - 1)) << 6; (*vtx)->n.n[0] = 0xFF; (*vtx)->n.n[1] = 0xFF; (*vtx)->n.n[2] = 0xFF; - (*vtx)->v.cn[3] = 0xFF; + (*vtx)->n.a = 0xFF; (*vtx)++; } } } -#endif void func_802F2740(Struct64s *arg0) { s32 i; diff --git a/subyaml/core2.us.v10.yaml b/subyaml/core2.us.v10.yaml index 2df28774..d5bdbaa3 100644 --- a/subyaml/core2.us.v10.yaml +++ b/subyaml/core2.us.v10.yaml @@ -248,12 +248,12 @@ segments: - [0x66D90, c, code_66D90] #DONE - [0x66FB0, c, code_66FB0] #DONE - [0x67490, c, gc/bound] #DONE - - [0x67650, c, code_67650] + - [0x67650, c, code_67650] #DONE - [0x679A0, c, code_679A0] - [0x69F60, c, code_69F60] #DONE - [0x6A4B0, c, code_6A4B0] #DONE - [0x6AEF0, c, code_6AEF0] #DONE - - [0x6B030, c, code_6B030] + - [0x6B030, c, code_6B030] #DONE - [0x6C3E0, c, code_6C3E0] #DONE - [0x6CD20, c, code_6CD20] #DONE - [0x6CEC0, c, code_6CEC0] #DONE