diff --git a/README.md b/README.md index 8025fdd1..94b97fc8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# banjo (91.9337%) +# banjo (92.0219%) diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg index 1f5adb30..063bb935 100644 --- a/progress/progress_core2.svg +++ b/progress/progress_core2.svg @@ -17,7 +17,7 @@ core2 - 90.1172% - 90.1172% + 90.2709% + 90.2709% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 22f0d0ec..9fcd7ccb 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -17,7 +17,7 @@ Banjo-Kazooie (us.v10) - 91.9337% - 91.9337% + 92.0219% + 92.0219% \ No newline at end of file diff --git a/src/core1/done/gu/rotate.c b/src/core1/done/gu/rotate.c index e6c66041..157f3a5c 100644 --- a/src/core1/done/gu/rotate.c +++ b/src/core1/done/gu/rotate.c @@ -2,12 +2,9 @@ #include "functions.h" #include "variables.h" -// extern f32 D_80285900; - f32 sinf(f32); f32 cosf(f32); -// MATCHING but need to resolve core1 bss section for static D_80285900 void guRotateF(float mf[4][4], float a, float x, float y, float z) { static f32 D_80285900 = 3.1415926 / 180.0; @@ -43,7 +40,6 @@ void guRotateF(float mf[4][4], float a, float x, float y, float z) mf[0][1] = ab+z*sine; } -// MATCHING with -O3, need to resolve bss section void guRotate(Mtx *m, float a, float x, float y, float z) { float mf[4][4]; diff --git a/src/core2/code_679A0.c b/src/core2/code_679A0.c index 3f0db531..3551b7cd 100644 --- a/src/core2/code_679A0.c +++ b/src/core2/code_679A0.c @@ -156,16 +156,13 @@ void func_802EED1C(ParticleEmitter *this, f32 arg1, f32 arg2[3]){ } } -#ifndef NONMATCHING -#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_679A0/func_802EEE3C.s") -#else -void func_802EEE3C(ParticleEmitter *this, Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg4){ +void func_802EEE3C(ParticleEmitter *this, Gfx **gfx, Mtx **mtx, Vtx **vtx, u32 arg4){ f32 sp8C[3]; f32 sp80[3]; f32 sp74[3]; Particle *iPtr; - if(arg4 != (this->unk18 & 0x4)) + if(reinterpret_cast(u32, arg4) != (this->unk18 & 0x4) != 0) return; if(this->model_20 != NULL){ @@ -180,65 +177,61 @@ void func_802EEE3C(ParticleEmitter *this, Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 a set_model_render_mode((this->unk18 & 0x10)?0:1); func_803391A4(gfx, mtx, sp8C, iPtr->unk24, iPtr->size_30, NULL, this->model_20); } + return; } - else { - if(this->unk34){//L802EEFC4 - if( this->unk3C[0] != 0xff - || this->unk3C[1] != 0xff - || this->unk3C[2] != 0xff - || this->unk49 != 0xff - ){ - func_803382E4((this->unk18 & 0x10)? 9: 0xf); - func_80338338(this->unk3C[0], this->unk3C[1], this->unk3C[2]); - func_803382B4( - (this->unk3C[0] < 8)? 0 : this->unk3C[0] - 8, - (this->unk3C[1] < 8)? 0 : this->unk3C[1] - 8, - (this->unk3C[2] < 8)? 0 : this->unk3C[2] - 8, - (this->unk18 & 0x20)? 0xff : this->unk49 - ); - func_80338370(); - func_80335D30(gfx); - } - else if(this->unk18 & 0x10){//L802EF0C0 - gSPDisplayList((*gfx)++, D_80368978); - } - else{//L802EF0EC - gSPDisplayList((*gfx)++, D_80368940); - }//L802EF10C - sp80[0] = 90.0f; - sp80[1] = 0.0f; - sp80[2] = 0.0f; - for(iPtr = this->pList_start_124; iPtr < this->pList_end_128; iPtr++){ - gDPSetPrimColor((*gfx)++, 0, 0, this->unk3C[0], this->unk3C[1], this->unk3C[2], iPtr->unkC*this->unk49); - sp8C[0] = iPtr->position_18[0] + this->unk4[0]; - sp8C[1] = iPtr->position_18[1] + this->unk4[1]; - sp8C[2] = iPtr->position_18[2] + this->unk4[2]; + + if(this->unk34){//L802EEFC4 + if( this->unk3C[0] != 0xff + || this->unk3C[1] != 0xff + || this->unk3C[2] != 0xff + || this->unk49 != 0xff + ){ + func_803382E4((this->unk18 & 0x10)? 9: 0xf); + func_80338338(this->unk3C[0], this->unk3C[1], this->unk3C[2]); + func_803382B4( + (this->unk3C[0] < 8)? 0 : this->unk3C[0] - 8, + (this->unk3C[1] < 8)? 0 : this->unk3C[1] - 8, + (this->unk3C[2] < 8)? 0 : this->unk3C[2] - 8, + (this->unk18 & 0x20)? 0xff : this->unk49 + ); + func_80338370(); + func_80335D30(gfx); + } + else if(this->unk18 & 0x10){//L802EF0C0 + gSPDisplayList((*gfx)++, D_80368978); + } + else{//L802EF0EC + gSPDisplayList((*gfx)++, D_80368940); + }//L802EF10C + sp80[0] = 90.0f; + sp80[1] = 0.0f; + sp80[2] = 0.0f; + for(iPtr = this->pList_start_124; iPtr < this->pList_end_128; iPtr++){ + gDPSetPrimColor((*gfx)++, 0, 0, this->unk3C[0], this->unk3C[1], this->unk3C[2], iPtr->unkC*this->unk49); + sp8C[0] = iPtr->position_18[0] + this->unk4[0]; + sp8C[1] = iPtr->position_18[1] + this->unk4[1]; + sp8C[2] = iPtr->position_18[2] + this->unk4[2]; - sp74[0] = iPtr->size_30; - sp74[1] = iPtr->size_30; - sp74[2] = iPtr->size_30; - if(0.0f != this->unk108){ - func_802EED1C(this, iPtr->age_48, sp74); - } - func_80344C2C(this->unk0_16); - if(this->unk18 & 1){ - func_80344720(this->unk34, (s32)iPtr->frame_10, 0, sp8C, sp80, sp74, gfx, mtx); - }//L802EF2F8 - else{ - func_80344424(this->unk34, (s32)iPtr->frame_10, 0, sp8C, sp74, iPtr->unk24[2], gfx, mtx); - }//L802EF324 - }//L802EF338 - if( this->unk3C[0] != 0xff - || this->unk3C[1] != 0xff - || this->unk3C[2] != 0xff - || this->unk49 != 0xff - ){ - func_8033687C(gfx); + sp74[0] = iPtr->size_30; + sp74[1] = iPtr->size_30; + sp74[2] = iPtr->size_30; + if(0.0f != this->unk108){ + func_802EED1C(this, iPtr->age_48, sp74); } + func_80344C2C(this->unk0_16); + if(this->unk18 & 1){ + func_80344720(this->unk34, (s32)iPtr->frame_10, 0, sp8C, sp80, sp74, gfx, mtx); + }//L802EF2F8 + else{ + func_80344424(this->unk34, (s32)iPtr->frame_10, 0, sp8C, sp74, iPtr->unk24[2], gfx, mtx); + }//L802EF324 + }//L802EF338 + if( this->unk3C[0] != 0xff || this->unk3C[1] != 0xff || this->unk3C[2] != 0xff || this->unk49 != 0xff + ){ + func_8033687C(gfx); } } } -#endif void func_802EF3A8(ParticleEmitter *this, Gfx **gdl, Mtx **mPtr, Vtx **vPtr){ func_802EEE3C(this, gdl, mPtr, vPtr, 4); diff --git a/subyaml/core1.us.v10.yaml b/subyaml/core1.us.v10.yaml index 38132042..e273c0f3 100644 --- a/subyaml/core1.us.v10.yaml +++ b/subyaml/core1.us.v10.yaml @@ -160,7 +160,7 @@ segments: - [0x28AD0, c, done/io/viblack] #DONE - [0x28B40, c, done/gu/ortho] #DONE - [0x28D00, c, done/gu/translate] #DONE - - [0x28DA0, c, done/gu/rotate] + - [0x28DA0, c, done/gu/rotate] #DONE - [0x28F90, c, done/io/contreaddata] #DONE - [0x291F0, c, done/io/controller] #DONE - [0x295B0, c, done/io/contsetch] #DONE @@ -355,4 +355,7 @@ segments: - [0x3c710, .bss, done/os/seteventmesg] - [0x3c710, .bss, done/io/vimgr] - [0x3c710, .bss, done/gu/rotate] + - [0x3c710, .bss, done/io/controller] + - [0x3c710, .bss, done/io/motor] + - [0x3c710, .bss, done/io/cartrominit] - [0x3c710] # core1 end diff --git a/subyaml/core2.us.v10.yaml b/subyaml/core2.us.v10.yaml index 56e009c0..7df6c347 100644 --- a/subyaml/core2.us.v10.yaml +++ b/subyaml/core2.us.v10.yaml @@ -250,7 +250,7 @@ segments: - [0x66FB0, c, code_66FB0] #DONE - [0x67490, c, gc/bound] #DONE - [0x67650, c, code_67650] #DONE - - [0x679A0, c, code_679A0] + - [0x679A0, c, code_679A0] #DONE - [0x69F60, c, code_69F60] #DONE - [0x6A4B0, c, code_6A4B0] - [0x6AEF0, c, code_6AEF0] #DONE