diff --git a/README.md b/README.md
index e57527d6..23d86856 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# banjo (91.4926%)
+# banjo (91.5628%)
diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg
index a3095eaa..9bc18ee0 100644
--- a/progress/progress_core2.svg
+++ b/progress/progress_core2.svg
@@ -17,7 +17,7 @@
core2
- 89.4033%
- 89.4033%
+ 89.5256%
+ 89.5256%
\ No newline at end of file
diff --git a/progress/progress_total.svg b/progress/progress_total.svg
index 8fed197a..ce9aa65b 100644
--- a/progress/progress_total.svg
+++ b/progress/progress_total.svg
@@ -17,7 +17,7 @@
Banjo-Kazooie (us.v10)
- 91.4926%
- 91.4926%
+ 91.5628%
+ 91.5628%
\ No newline at end of file
diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c
index f57152ff..27a81ebf 100644
--- a/src/core2/code_47BD0.c
+++ b/src/core2/code_47BD0.c
@@ -302,15 +302,18 @@ void func_802CF7CC(Actor *this) {
void func_802CF83C(Actor *this);
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_47BD0/func_802CF83C.s")
#else
+extern void func_8030DBFC(u8, f32, f32, f32);
extern bool func_80309DBC(f32[3], f32[3], f32, f32 sp54[3], s32, s32);
-
-extern f64 D_803765E8;
-extern f64 D_80376620;
-extern f64 D_80376628;
-extern f64 D_80376630;
-extern s32 D_8037DCBC;
-
+extern void func_80320004(s32, bool);
+extern void func_8030DEB4(u8, f32, f32);
+extern void func_8030DF68(u8, f32[3]);
+extern void func_8030E2C4(u8);
+extern void sfxsource_setSampleRate(u8, s32);
+extern void ml_vec3f_normalize(f32[3]);
+extern void func_8028E9C4(s32, f32[3]);
void func_802CF83C(Actor *this) {
+ Actor *beehive;
+ ActorLocal_core2_47BD0 *local = (ActorLocal_core2_47BD0 *)&this->local;
f32 spB4[3];
f32 spB0;
f32 spAC;
@@ -319,50 +322,25 @@ void func_802CF83C(Actor *this) {
f32 sp88[3];
f32 sp7C[3];
s32 sp78;
- f32 *sp64;
- f32 *sp44;
- f32 *sp40;
- Actor *beehive;
- ActorMarker *temp_v0_3;
- f32 *temp_a0;
f32 temp_f0;
- f32 temp_f14;
- f32 temp_f14_2;
- f32 temp_f16;
- f32 temp_f16_2;
- f32 temp_f18;
- f32 temp_f18_2;
- f32 temp_f8;
- f64 temp_f2;
- s16 temp_t7;
- u32 temp_t0;
- u32 temp_t1;
- u32 temp_t2;
- u32 temp_t3;
- u8 temp_a0_2;
- ActorLocal_core2_47BD0 *local;
- u32 phi_a1;
- f64 phi_f2;
- f64 phi_f0;
+ f32 sp68[3];
+
+
- local = (ActorLocal_core2_47BD0 *)&this->local;
spAC = time_getDelta();
sp78 = 0;
if (!this->initialized) {
this->initialized = TRUE;
beehive = func_80326D68(this->position, ACTOR_12_BEEHIVE, -1, &spB0);
- if (beehive != NULL) {
- this->unk100 = beehive->marker;
- } else {
- this->unk100 = NULL;
- }
- if (spB0 > 500.0f) {
+ this->unk100 = (beehive != NULL) ? beehive->marker : NULL;
+ if(500.0f < spB0){
this->unk100 = NULL;
}
sp78 = 1;
- local->unk18 = this->position[1];
- local->unkC[0] = ((this->unk100) ? beehive->position : this->position)[0];\
- local->unkC[1] = ((this->unk100) ? beehive->position : this->position)[1];\
+ local->unk18 = (f32) this->position[1];
+
+ local->unkC[0] = ((this->unk100) ? beehive->position : this->position)[0];
+ local->unkC[1] = ((this->unk100) ? beehive->position : this->position)[1];
local->unkC[2] = ((this->unk100) ? beehive->position : this->position)[2];
local->unkC[1] += 250.0f;
@@ -370,15 +348,21 @@ void func_802CF83C(Actor *this) {
this->position[0] = local->unkC[0];
this->position[1] = local->unkC[1];
this->position[2] = local->unkC[2];
- sp94[0] = this->position[0]; sp94[1] = this->position[1]; sp94[2] = this->position[2];
+
+ sp94[0] = this->position[0];
+ sp94[1] = this->position[1];
+ sp94[2] = this->position[2];
+
+ sp88[0] = this->position[0];
+ sp88[1] = this->position[1];
+ sp88[2] = this->position[2];
+
sp94[1] += 50.0f;
- sp88[0] = this->position[0]; sp88[1] = this->position[1]; sp88[2] = this->position[2];
sp88[1] -= 500.0f;
if (func_80309B48(sp94, sp88, sp7C, 0x5E0000)) {
local->unk18 = sp88[1];
}
}
-
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
func_803300D8(this->marker, func_802CEBA8);
@@ -400,8 +384,7 @@ void func_802CF83C(Actor *this) {
if (this->unk100 != NULL) {
func_80320004(BKPROG_D_BEEHIVE_TEXT, TRUE);
}
- phi_a1 = (this->unk100 != NULL) ? 1 : 2;
- func_80328A84(this, phi_a1);
+ func_80328A84(this, (this->unk100 != NULL) ? 1 : 2);
this->unk60 = 0.0f;
func_802CF040(this);
this->unk38_0 = func_803203FC(1) | func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE);
@@ -423,23 +406,22 @@ void func_802CF83C(Actor *this) {
}
this->unk58_0 = TRUE;
}
-block_40:
sp94[0] = this->position[0];
sp94[1] = this->position[1];
sp94[2] = this->position[2];
- sp88[0] = (this->velocity[0] * spAC) + this->position[0];
- sp88[1] = (this->velocity[1] * spAC) + this->position[1];
- sp88[2] = (this->velocity[2] * spAC) + this->position[2];
+ sp88[0] = this->position[0] + (this->velocity[0] * spAC);
+ sp88[1] = this->position[1] + (this->velocity[1] * spAC);
+ sp88[2] = this->position[2] + (this->velocity[2] * spAC);
if (this->state != 7) {
if (func_80309DBC(sp94, sp88, 75.0f, sp7C, 3, 0)) {
- ml_vec3f_normalize(&sp7C);
+ ml_vec3f_normalize(sp7C);
temp_f0 = (this->velocity[0]*sp7C[0] + this->velocity[1]*sp7C[1] + this->velocity[2]*sp7C[2]) * -1.5;
- this->velocity[0] += (sp7C[0] * temp_f0);
- this->velocity[1] += (sp7C[1] * temp_f0);
- this->velocity[2] += (sp7C[2] * temp_f0);
- this->unk1C[0] = sp7C[0] * 37.5 + this->position[0];
- this->unk1C[1] = sp7C[1] * 37.5 + this->position[1];
- this->unk1C[2] = sp7C[2] * 37.5 + this->position[2];
+ this->velocity[0] = this->velocity[0] + (sp7C[0] * temp_f0);
+ this->velocity[1] = this->velocity[1] + (sp7C[1] * temp_f0);
+ this->velocity[2] = this->velocity[2] + (sp7C[2] * temp_f0);
+ this->unk1C[0] = this->position[0] + sp7C[0] * 37.5;
+ this->unk1C[1] = this->position[1] + sp7C[1] * 37.5;
+ this->unk1C[2] = this->position[2] + sp7C[2] * 37.5;
if (this->state != 6) {
local->unk6 = this->state;
func_80328A84(this, 6);
@@ -469,52 +451,112 @@ block_40:
}
}
}
- func_8028E9C4(5, &spB4);
- switch(this->state){
- case 1:
- if( !func_8031FF1C(0x8F)
- && subaddie_playerIsWithinCylinder(this, 0xFA, 0x12C)
- && ((func_8028ECAC() == 0) || (func_8028ECAC() == BSGROUP_8_TROT))
- && (player_getTransformation() == TRANSFORM_1_BANJO)
- && func_80311480(0xDA6, 0, NULL, NULL, NULL, NULL)
- ) {
- func_80320004(0x8F, TRUE);
+ func_8028E9C4(5, spB4);
+ switch (this->state) {
+ case 1:
+ if (!func_8031FF1C(0x8F) && subaddie_playerIsWithinCylinder(this, 0xFA, 0x12C)
+ && ((func_8028ECAC() == 0) || (func_8028ECAC() == 8))
+ && (player_getTransformation() == 1)
+ && (func_80311480(0xDA6, 0, NULL, NULL, NULL, NULL) != 0)
+ ) {
+ func_80320004(0x8F, TRUE);
+ }
+ if (func_802CF5E4(this)) {
+ func_80328A84(this, 2U);
+ }
+ if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
+ func_802CEF54(this, local->unkC, 100.0f);
+ }
+ break;
+ case 2:
+ if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
+ func_802CEF54(this, local->unkC, 100.0f);
+ }
+ func_802CF518(this);
+ break;
+ case 3:
+ this->unk1C[0] = spB4[0];
+ this->unk1C[1] = spB4[1];
+ this->unk1C[2] = spB4[2];
+ this->unk1C[1] += 50.0f;
+ this->unk28 = 400.0f;
+ if (ml_vec3f_distance(this->position, this->unk1C) < 100.0f) {
+ func_802CEF54(this, spB4, 50.0f);
+ func_80328A84(this, 4);
+ }
+ func_802CF57C(this);
+ break;
+ case 4:
+ spB4[1] += 50.0f;
+ this->unk60 += spAC;
+ if ((this->unk60 - 0.5 > 0.0) && (local->unk0 > 0) && (func_8028ECAC() != 3)) {
+ func_8028F504(0xD);
+ this->unk60 -= 0.5;
+ }
+ if ((this->unk60 > 0.2) && (func_8028ECAC() == 3)) {
+ if (local->unk0-- > 0) {
+ sp68[0] = local->unk8[local->unk0].unk0[0] + this->position[0];
+ sp68[1] = local->unk8[local->unk0].unk0[1] + this->position[1];
+ sp68[2] = local->unk8[local->unk0].unk0[2] + this->position[2];
+ func_802CF610(this, partEmitList_pushNew(1), sp68);
+ this->unk60 -= 0.2;
}
- if (func_802CF5E4(this)) {
- func_80328A84(this, 2);
+ }
+ if (local->unk0 == 0) {
+ marker_despawn(this->marker);
+ }
+ if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
+ func_802CEF54(this, (s32 *) spB4, 50.0f);
+ }
+ if (ml_vec3f_distance(this->position, spB4) > 100.0f) {
+ func_80328A84(this, 3);
+ }
+ func_802CF57C(this);
+ break;
+ case 5:
+ if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
+ func_80328A84(this, 2);
+ }
+ func_802CF518(this);
+ break;
+ case 6:
+ if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
+ func_80328A84(this, local->unk6);
+ }
+ break;
+ case 7:
+ if (this->position[1] - 100.0f < local->unk1C) {
+ if (local->unk0 > 0) {
+ local->unk0--;
}
- if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
- func_802CEF54(this, local->unkC, 100.0f);
+ }
+ if (local->unk1C < this->position[1] - 100.0f) {
+ if (local->unk0 < local->unk4) {
+ local->unk0++;
+ } else {
+ func_80328A84(this, local->unk7);
}
- break;
+ }
+ break;
}
if (local->unk5) {
func_802CF434(this);
}
- local->unk5 = FALSE;
-
- if( (local->unk0 > 0)
- && func_80329530(this, 0x5DC) && !this->unk38_0
- ) {
- if (!this->unk44_31) {
+ local->unk5 = 0;
+ if ((local->unk0 > 0) && func_80329530(this, 1500) && !this->unk38_0) {
+ if (this->unk44_31 == 0) {
func_802CF7CC(this);
}
- if (this->unk44_31) {
- if ((this->state == 3) || (this->state == 4)) {
- phi_f2 = 0.0;
- } else {
- phi_f2 = 0.8;
- }
- if ((this->state == 3) || (this->state == 4)) {
- phi_f0 = 1.1;
- } else {
- phi_f0 = 0.9;
- }
- func_8030DBFC(this->unk44_31, phi_f2, phi_f0, 0.05f);
+ if (this->unk44_31 != 0) {
+ func_8030DBFC(this->unk44_31,
+ ((this->state == 3) || (this->state == 4)) ? 1.0 : 0.8,
+ ((this->state == 3) || (this->state == 4)) ? 1.1 : 0.9,
+ 0.05f
+ );
func_8030DEB4(this->unk44_31, 500.0f, 1500.0f);
func_8030DF68(this->unk44_31, this->position);
func_8030E2C4(this->unk44_31);
- sfxsource_setSampleRate(this->unk44_31, ((gu_sqrtf(this->velocity[0]*this->velocity[0] + this->velocity[1]*this->velocity[1] + this->velocity[2]*this->velocity[2])/ this->unk28) * 8000.0f) + 2000.0f);
+ sfxsource_setSampleRate(this->unk44_31, (s32)(((gu_sqrtf(this->velocity[0]*this->velocity[0] + this->velocity[1]*this->velocity[1] + this->velocity[2]*this->velocity[2])/ this->unk28) * 8000.0f) + 2000.0f));
}
}
}
diff --git a/src/core2/code_5B6A0.c b/src/core2/code_5B6A0.c
index f7197c06..0cb32382 100644
--- a/src/core2/code_5B6A0.c
+++ b/src/core2/code_5B6A0.c
@@ -15,21 +15,13 @@ Actor *func_802E2630(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
void func_802E28D0(Actor *this);
/* .data */
-extern ActorInfo D_80368710 = {
+ActorInfo D_80368710 = {
0xB2, 0x125, 0x378,
0x1, NULL,
func_802E28D0, func_80326224, func_802E2630,
0, 0x800, 0.8f, 0
};
-extern f32 D_803687A4[4];
-extern struct31s D_80368734;
-extern struct43s D_8036875C;
-
-/* .rodata */
-extern f64 D_803770F0;
-extern f64 D_803770F8;
-
/* .bss */
f32 D_8037E640[3];
@@ -45,10 +37,16 @@ Actor *func_802E2630(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) {
return this;
}
-
void func_802E26A4(f32 position[3]) {
+ static struct31s D_80368734 = {{0.65f, 1.1}, {0.0f, 0.0f}, {0.0f, 0.01f}, {0.8f, 0.8f}, 0.0f, 0.5f};
+ static struct43s D_8036875C = {
+ {{-220.0f, 210.0f, -220.0f}, {280.0f, 460.0f, 280.0f}},
+ {{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}},
+ {{ -20.0f, -20.0f, -20.0f}, { 20.0f, 20.0f, 20.0f}}
+ };
ParticleEmitter *pCtrl;
+
pCtrl = partEmitList_pushNew(8);
particleEmitter_setModel(pCtrl, 0x37A);
particleEmitter_setPosition(pCtrl, position);
@@ -59,6 +57,7 @@ void func_802E26A4(f32 position[3]) {
}
void func_802E2748(Actor *this, s32 arg1) {
+ static f32 D_803687A4[4] = {0.2f, 0.3f, 1.0f, 1.2f};
if (arg1 != 0) {
D_8037E640[0] = this->position[0];
D_8037E640[1] = this->position[1];
@@ -80,7 +79,6 @@ void func_802E2748(Actor *this, s32 arg1) {
}
}
-
void func_802E28A4(ActorMarker *marker, ActorMarker *other_marker){
Actor *this;
@@ -88,27 +86,21 @@ void func_802E28A4(ActorMarker *marker, ActorMarker *other_marker){
func_802E2748(this, 0);
}
-#ifndef NONMATCHING
-#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5B6A0/func_802E28D0.s")
-#else
void func_802E28D0(Actor *this) {
- ActorLocal_core2_5B6A0 *local;
f32 sp7C[3];
f32 sp70[3];
f32 sp64[3];
f32 sp58[3];
- Actor *phi_a1;
- u32 *temp_v0_3;
- s32 phi_a1_2;
+ ActorLocal_core2_5B6A0 *local = (ActorLocal_core2_5B6A0 *)&this->local;
+ BKCollisionTri *temp_v0_3;
+ s32 phi_a1;
s32 i;
- if(this->unk38_31 == 0 && func_80329530(500)){
+ if(this->unk38_31 == 0 && func_80329530(this, 500)){
FUNC_8030E8B4(SFX_C_TAKING_FLIGHT_LIFTOFF, 0.85f, 32000, this->position, 1250, 2500);
this->unk38_31 = 1;
}
- phi_a1 = NULL;
- local = (ActorLocal_core2_5B6A0 *)&this->local;
if(!this->initialized){
marker_setCollisionScripts(this->marker, NULL, NULL, func_802E28A4);
@@ -120,10 +112,9 @@ void func_802E28D0(Actor *this) {
this->initialized = TRUE;
player_getPosition(sp7C);
sp7C[1] += 1.0f;
- phi_a1_2 = (func_8023DB5C() & 1) ? 0x15 : 0x2B;
- phi_a1 = &this;
+ phi_a1 = (func_8023DB5C() & 1) ? 0x15 : 0x2B;
for(i = 0; i < 3; i++){
- sp58[i] = (sp7C[i] - this->unk1C[i]) * phi_a1_2;
+ sp58[i] = sp7C[i] + (sp7C[i] - this->unk1C[i]) * phi_a1;
}
this->velocity[0] = (sp58[0] - this->position[0])/32;
@@ -137,12 +128,11 @@ void func_802E28D0(Actor *this) {
sp64[0] = this->position[0];
sp64[1] = this->position[1];
sp64[2] = this->position[2];
- this->position[0] += this->velocity[0];
- this->position[1] += this->velocity[1];
- this->position[2] += this->velocity[2];
-
- this->pitch += 10.0f;
+ this->position[0] = this->position[0] + this->velocity[0];
+ this->position[1] = this->position[1] + this->velocity[1];
+ this->position[2] = this->position[2] + this->velocity[2];
this->velocity_y -= 2.0f;
+ this->pitch += 10.0f;
this->yaw += 10.0f;
if(this->pitch > 360.0f){
@@ -152,7 +142,7 @@ void func_802E28D0(Actor *this) {
this->yaw -= 360.0f;
}
if (local->unk4 >= 6) {
- temp_v0_3 = func_80320C94(sp64, this->position, func_8033229C(this->marker) * 1.2, &sp70, 5, 0);
+ temp_v0_3 = func_80320C94(sp64, this->position, func_8033229C(this->marker) * 1.2, sp70, 5, 0);
if (temp_v0_3 != 0) {
func_802E2748(this, *((u32*)temp_v0_3 + 2) & 0x20000);
return;
@@ -174,11 +164,9 @@ void func_802E28D0(Actor *this) {
this->velocity[0] *= 0.7;
this->velocity[1] *= 0.7;
this->velocity[2] *= 0.7;
- this->position[0] += this->velocity[0];
- this->position[1] += this->velocity[1];
- this->position[2] += this->velocity[2];
+ this->position[0] = this->position[0] + this->velocity[0];\
+ this->position[1] = this->position[1] + this->velocity[1];\
+ this->position[2] = this->position[2] + this->velocity[2];
break;
}
}
-#endif
-
diff --git a/src/core2/code_72B10.c b/src/core2/code_72B10.c
index bf62b2c4..1aefb1c9 100644
--- a/src/core2/code_72B10.c
+++ b/src/core2/code_72B10.c
@@ -182,10 +182,10 @@ void func_802FA0B0(s32 arg0, s32 arg1){
#else
void func_802FA0F8(void){
//stack allocation too large
- f32 tick;
struct4Es *iPtr;
struct4Es *startPtr;
struct4Es *endPtr;
+ f32 tick;
f32 f20;
tick = time_getDelta();
diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c
index f039e08e..5993074f 100644
--- a/src/core2/code_7AF80.c
+++ b/src/core2/code_7AF80.c
@@ -43,10 +43,6 @@ void func_80308F0C(Cube *cube);
void func_80308EC8(void);
/* .data */
-
-
-
-
extern ActorInfo D_803675F0;
extern ActorInfo D_80367838;
diff --git a/src/core2/code_83340.c b/src/core2/code_83340.c
index eb2d223b..41e78860 100644
--- a/src/core2/code_83340.c
+++ b/src/core2/code_83340.c
@@ -29,6 +29,8 @@ s32 D_8036B808;
struct_7AF80_0 *D_80382390; //prop models ???
struct_7AF80_1 *D_80382394; //prop_sprites ???
+BKSpriteDisplayData *func_8030A4D4(s32 arg0);
+
void func_8030A2D0(Gfx **gfx, Mtx **mtx, Vtx **vtx, f32 arg3[3], f32 arg4[3], f32 arg5, s32 arg6, Cube* arg7){
BKModelBin * sp2C;
diff --git a/src/core2/code_98CB0.c b/src/core2/code_98CB0.c
index 1692c772..8d510e29 100644
--- a/src/core2/code_98CB0.c
+++ b/src/core2/code_98CB0.c
@@ -43,6 +43,49 @@ u8 D_803831F8[0x21]; //copy of D_803831D0
/* .code */
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_98CB0/func_8031FC40.s")
+// void func_8031FC40(void) {
+// s32 scrambled_ptr;
+// s32 temp_a1;
+// s32 temp_lo;
+// s32 temp_t0;
+// s32 temp_t1;
+// s32 temp_t6;
+// s32 temp_t9;
+// s32 var_a0;
+// s32 var_t3;
+// u32 var_v0;
+// u32 var_v1;
+// u8 temp_a3;
+
+// temp_t0 = (((s32) &D_803831A0.unk8 & 0xE0000000) >> 0xF)
+// + (((s32) &D_803831A0.unk8 & 0x1FC00000) >> 0x16)
+// + (((s32) &D_803831A0.unk8 & 0x300000) << 0xA)
+// + (((s32) &D_803831A0.unk8 & 0xF0000) << 7)
+// + (((s32) &D_803831A0.unk8 & 0xE000) << 0xE)
+// + (((s32) &D_803831A0.unk8 & 0x1800) >> 4)
+// + (((s32) &D_803831A0.unk8 & 0x780) << 0xA)
+// + (((s32) &D_803831A0.unk8 & 0x60) << 4)
+// + (((s32) &D_803831A0.unk8 & 0x18) << 0x12)
+// + (((s32) &D_803831A0.unk8 & 7) << 0xB);
+// temp_t9 = (temp_t0 & 0x38000000);
+// var_v0 = 0x17536C34;
+// var_t3 = temp_t9 >> 0x18;
+// if (temp_t9 < 0) {
+// var_t3 = (s32) (0xFFFFFF + temp_t9) >> 0x18;
+// }
+// temp_a1 = (((temp_t0 & 0x1C07F) << 0xF) + ((u32) (temp_t0 & 0xC7800000) >> 0x11)) | (var_t3 + ((s32) (temp_t0 & 0x180) >> 6));
+// temp_t1 = ((temp_t0 & 0x1E0600) << 0xB) | ((s32) (temp_t0 & 0x603800) >> 3);
+// var_a0 = ((temp_a1 & 0x3FE000) << 7)
+// | (((temp_t1 >> 8) & 7) + ((temp_a1 << 0xA) & 0xFF800))
+// | ((((u32) (temp_t1 & 0xF0000000) >> 0x15) + (temp_a1 & 0xE0000000)) ^ ((s32) ((temp_t1 >> 6) & 0xF000) >> 9));
+// for(var_v1 = 0; var_v1 < 0x25; var_v1++){
+// u8 byte = *(u8*)(var_a0 + var_v1);
+// var_v0 = ((byte * 0x1B) + (var_v0 >> 0xB)) ^ (((var_v0 - byte) & 0x1F) << 0xF);
+// }
+// scrambled_ptr = (((s32) &D_803831A0 & 0x55555555) * 2) + ((u32) ((s32) &D_803831A0 & 0xAAAAAAAA) >> 1);
+// *(s32 *)(((scrambled_ptr & 0x55555555) * 2) | ((u32) (scrambled_ptr & 0xAAAAAAAA) >> 1)) = var_v0;
+// }
+
u32 func_8031FE40(void) {
u8 *obscured_addr;
diff --git a/src/core2/code_A5BC0.c b/src/core2/code_A5BC0.c
index 5faa478d..40444db5 100644
--- a/src/core2/code_A5BC0.c
+++ b/src/core2/code_A5BC0.c
@@ -1350,8 +1350,58 @@ void func_803305AC(void){
D_80383444 = 0;
}
-extern s32 D_8036E7CC;
+#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A5BC0/func_803306C8.s")
+#else
+extern s32 D_8036E7CC;
+void func_803306C8(s32 arg0) {
+ s32 sp54;
+ s32 temp_a0;
+ u32 temp_fp;
+ s32 temp_lo;
+ s32 temp_s0;
+ s32 temp_t7;
+ s32 temp_v0;
+ s32 var_s0;
+ s32 var_s0_2;
+ s32 var_s0_3;
+ s32 var_s1;
+ ModelCache *var_a2;
+
+ temp_fp = func_8023DB5C() - func_80255B08(arg0);
+ func_80254BD0(&sp54, 1);
+ if (sp54 <= 256000) {
+ var_s1 = 0;
+ for(var_s1 = 0; var_s1 < ((arg0 == 1) ? 0x28 : 0x3D4); var_s1++) {
+ var_a2 = modelCache + D_8036E7CC;
+ if ((var_a2->unk10 < temp_fp)
+ || ((arg0 == 3) && ((D_80383444 == 0) || (D_8036E7CC != D_80383444)))
+ ) {
+ var_s0_2 = FALSE;
+ if (var_a2->modelPtr != NULL) {
+ assetcache_release(var_a2->modelPtr);
+ var_s0_2 = TRUE;
+ var_a2->modelPtr = NULL;
+ var_a2 = modelCache + D_8036E7CC;
+ }
+ if (var_a2->unk4 != NULL) {
+ var_s0_2 = TRUE;
+ func_8033B338(&var_a2->unk4, &var_a2->unk8);
+ }
+ if ((arg0 != 1) && (var_s0_2 == 1) && (func_80254BC4(1))) {
+ return;
+ }
+ }
+
+ if (D_8036E7CC >= 0x3D4) {
+ D_8036E7CC = 0;
+ } else {
+ D_8036E7CC += 1;
+ }
+ }
+ }
+}
+#endif
extern void *func_802EBAE0(UNK_TYPE(s32), f32 position[3], f32 rotation[3], f32 scale, UNK_TYPE(s32), UNK_TYPE(s32), UNK_TYPE(s32), f32, UNK_TYPE(s32));
BKModelBin *func_80330DE4(ActorMarker *this);
diff --git a/subyaml/core2.us.v10.yaml b/subyaml/core2.us.v10.yaml
index 7b4809b1..91b9a301 100644
--- a/subyaml/core2.us.v10.yaml
+++ b/subyaml/core2.us.v10.yaml
@@ -228,7 +228,7 @@ segments:
- [0x59A80, c, code_59A80] #DONE
- [0x59D40, c, code_59D40] #DONE
- [0x5AB30, c, ch/code_5AB30] #DONE
- - [0x5B6A0, c, code_5B6A0]
+ - [0x5B6A0, c, code_5B6A0] #DONE
- [0x5BD90, c, code_5BD90] #DONE
- [0x5BEB0, c, code_5BEB0]
- [0x5C240, c, code_5C240] #DONE
@@ -518,7 +518,7 @@ segments:
- [0xE1610, .data, code_59A80]
- [0xE1640, .data, code_59D40]
- [0xE16C0, .data, ch/code_5AB30]
- - [0xE1780, bin, data_E1780]
+ - [0xE1780, .data, code_5B6A0]
- [0xE1830, .data, code_5BD90]
- [0xE1860, bin, data_E1860]
- [0xE18D0, .data, code_66FB0]