core2/code_9E370.c progress

This commit is contained in:
Banjo Kazooie
2022-07-28 21:55:43 -05:00
parent 6eff48b508
commit c00998ac3e
4 changed files with 174 additions and 26 deletions

View File

@@ -9,7 +9,7 @@
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/> <path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#72e000" d="M44 0h67v20H44z"/> <path fill="#71e000" d="M44 0h67v20H44z"/>
<path fill="url(#b)" d="M0 0h111v20H0z"/> <path fill="url(#b)" d="M0 0h111v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <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> <text x="22.0" y="14">core2</text>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <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">74.5839%</text> <text x="78.5" y="15" fill="#010101" fill-opacity=".3">74.8489%</text>
<text x="77.5" y="14">74.5839%</text> <text x="77.5" y="14">74.8489%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -9,7 +9,7 @@
</mask> </mask>
<g mask="url(#anybadge_1)"> <g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h150v20H0z"/> <path fill="#555" d="M0 0h150v20H0z"/>
<path fill="#59e000" d="M150 0h67v20H150z"/> <path fill="#58e000" d="M150 0h67v20H150z"/>
<path fill="url(#b)" d="M0 0h217v20H0z"/> <path fill="url(#b)" d="M0 0h217v20H0z"/>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <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> <text x="75.0" y="14">Banjo-Kazooie (us.v10)</text>
</g> </g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11"> <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">80.2093%</text> <text x="184.5" y="15" fill="#010101" fill-opacity=".3">80.3613%</text>
<text x="183.5" y="14">80.2093%</text> <text x="183.5" y="14">80.3613%</text>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -4,7 +4,10 @@
#include "prop.h" #include "prop.h"
#define DIST_SQ_VEC3F(v1, v2) ((v1[0] - v2[0])*(v1[0] - v2[0]) + (v1[1] - v2[1])*(v1[1] - v2[1]) + (v1[2] - v2[2])*(v1[2] - v2[2]))
extern f32 func_80258708(f32[3], f32[3]); extern f32 func_80258708(f32[3], f32[3]);
extern bool func_80259384(f32[3], f32[3], f32);
extern void func_802D7124(Actor *, f32); extern void func_802D7124(Actor *, f32);
extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32); extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32);
@@ -56,6 +59,7 @@ extern u8 D_8036E578;
extern u8 D_8036E57C; extern u8 D_8036E57C;
extern f32 D_8036E580; extern f32 D_8036E580;
extern f32 D_8036E58C[3]; extern f32 D_8036E58C[3];
extern f32 D_8036E598[6];
extern s32 D_8036E5B0[4]; extern s32 D_8036E5B0[4];
extern s32 D_8036E5C0[4]; extern s32 D_8036E5C0[4];
@@ -63,6 +67,8 @@ extern s32 D_8036E5C0[4];
/* .rodata */ /* .rodata */
extern f32 D_80378E50; extern f32 D_80378E50;
extern f64 D_80378E58; extern f64 D_80378E58;
extern f64 D_80378E60;
extern f64 D_80378E68;
/* .bss */ /* .bss */
extern Actor *D_80383390; extern Actor *D_80383390;
@@ -728,10 +734,31 @@ Actor **func_80326FC0(void) {
return D_80383398; return D_80383398;
} }
bool func_803270B8(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *), ActorMarker * arg4){
bool var_s4;
Actor * start;
Actor * i_ptr;
var_s4 = FALSE;
start = &D_8036E560->data[0];
for(i_ptr = start; (D_8036E560 != NULL) && (i_ptr - start < D_8036E560->cnt); i_ptr++){
if( !i_ptr->despawn_flag
&& i_ptr->marker->collidable
&& ((arg3 == NULL) || arg3(i_ptr))
&& func_80259384(i_ptr->position, arg0, arg1)
) {
if (i_ptr->marker->unk58 == NULL || i_ptr->marker->unk58(i_ptr->marker, arg4)
) {
var_s4 = TRUE;
if (!func_8033D410(arg4, i_ptr->marker)) {
func_8032FFF4(i_ptr->marker, arg4, arg2);
}
}
}
}
return var_s4;
}
void func_803270B8(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *), ActorMarker *);
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803270B8.s")
void func_8032728C(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *)){ void func_8032728C(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *)){
func_803270B8(arg0, arg1, arg2, arg3, _player_getMarker()); func_803270B8(arg0, arg1, arg2, arg3, _player_getMarker());
@@ -1174,9 +1201,50 @@ void func_803285E8(Actor *this, f32 arg1, int direction){
this->sound_timer = arg1; this->sound_timer = arg1;
} }
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032863C.s")
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80328748.s")
int func_8032863C(AnimCtrl *anim_ctrl, f32 min, f32 max) {
f32 timer;
s32 sp18;
timer = animctrl_getAnimTimer(anim_ctrl);
if ((timer < min) || (max <= timer)) {
return -1;
}
sp18 = animctrl_isPlayedForwards(anim_ctrl);
if( ((sp18 == 0) && (min <= timer) && (timer < (min + D_80378E60)))
|| ((sp18 == 1) && (timer < max) && ((max - D_80378E68) <= timer))
) {
sp18 = (sp18) ? 0 : 1;
animctrl_setDirection(anim_ctrl, sp18);
return sp18 + 2;
}
return sp18;
}
s32 func_80328748(AnimCtrl *anim_ctrl, f32 min, f32 max) {
s32 sp24;
f32 sp20;
sp24 = func_8032863C(anim_ctrl, min, max);
if (sp24 != -1) {
return sp24;
}
sp20 = animctrl_getAnimTimer(anim_ctrl);
if (animctrl_isPlayedForwards(anim_ctrl) == TRUE) {
if (max <= sp20) {
animctrl_setAnimTimer(anim_ctrl, max);
animctrl_setDirection(anim_ctrl, 0);
sp24 = 2;
}
} else if (sp20 < min) {
animctrl_setAnimTimer(anim_ctrl, min);
animctrl_setDirection(anim_ctrl, 1);
sp24 = 3;
}
return sp24;
}
int func_8032881C(Actor *this){ int func_8032881C(Actor *this){
if(this->animctrl){ if(this->animctrl){
@@ -1295,10 +1363,42 @@ void func_80328CEC(Actor * this, s32 arg1, s32 min, s32 max){
func_80328C64(this, abs + (arg1 + f12)); func_80328C64(this, abs + (arg1 + f12));
} }
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80328DAC.s") f32 func_80328DAC(Actor *this){
return D_8036E598[this->unk10_3];
}
f32 func_80328DCC(Actor *, f32, f32, s32); f32 func_80328DCC(Actor *this, f32 angle, f32 angle_ideal, s32 arg3) {
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80328DCC.s") f32 var_f2;
s32 var_t16;
if (angle_ideal == angle) {
return angle;
}
var_f2 = angle_ideal - angle;
if (var_f2 >= 180.0f) {
var_f2 -= 360.0f;
}
if (var_f2 < -180.0f) {
var_f2 += 360.0f;
}
if ((this->marker->unk14_20 != 0x12) && (this->marker->unk2C_2 == 1) && ((var_f2 >= 50.0f) || (var_f2 < -50.0f))) {
return angle_ideal;
}
var_f2 = var_f2 / func_80328DAC(this);
var_t16 = arg3;
var_f2 = (0.0f < var_f2) ? MIN(var_f2, var_t16) : MAX(var_f2, -arg3) ;
var_f2 += angle;
while (var_f2 < 0.0f) {
var_f2 += 360.0f;
}
while (var_f2 >= 360.0f) {
var_f2 -= 360.0f;
}
return var_f2;
}
void func_80328FB0(Actor *this, f32 arg1){ void func_80328FB0(Actor *this, f32 arg1){
this->yaw = func_80328DCC(this, this->yaw, this->yaw_moving, (s32)arg1); this->yaw = func_80328DCC(this, this->yaw, this->yaw_moving, (s32)arg1);
@@ -1316,9 +1416,40 @@ s32 func_80329054(s32 arg0, s32 arg1) {
return !func_8032CA80(arg0, arg1 + 4); return !func_8032CA80(arg0, arg1 + 4);
} }
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329078.s") bool func_80329078(Actor *this, s32 arg1, s32 arg2){
f32 sp1C[3];
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329140.s") if(this->unk10_25 == 0)
return TRUE;
sp1C[0] = this->position[0];
sp1C[1] = this->position[1];
sp1C[2] = this->position[2];
func_80328478(sp1C, arg1, arg2);
if(func_80307258(sp1C, this->unk10_25 - 1, this->unk10_18 - 1) == -1){
return FALSE;
}
return TRUE;
}
bool func_80329140(Actor *this, s32 arg1, s32 arg2){
s32 var_v0;
f32 sp20[3];
sp20[0] = this->position[0];
sp20[1] = this->position[1];
sp20[2] = this->position[2];
func_80328478(sp20, arg1, arg2);
var_v0 = func_80309D58(sp20, this->unk10_18);
if(this->unk10_18 == 0){
this->unk10_18 = var_v0;
}
if(var_v0 == 0){
if (this->unk10_18 != 0)
return FALSE;
}
return TRUE;
}
int func_80329210(Actor * arg0, f32 (* arg1)[3]){ int func_80329210(Actor * arg0, f32 (* arg1)[3]){
return arg0->unk10_25 < 1 return arg0->unk10_25 < 1
@@ -1354,7 +1485,18 @@ bool func_80329354(Actor *this){
return func_80329260(this, sp1C); return func_80329260(this, sp1C);
} }
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329384.s") bool func_80329384(Actor *this, f32 arg1){
f32 sp1C[3];
if(this->unk10_25 == 0)
return TRUE;
_player_getPosition(sp1C);
return func_80307258(sp1C, this->unk10_25 - 1, this->unk10_18 - 1) != -1
&& (sp1C[1] < (this->position[1] + arg1))
&& ((this->position[1] - arg1) < sp1C[1]);
}
bool func_8032944C(Actor *this){ bool func_8032944C(Actor *this){
s32 v1; s32 v1;
@@ -1436,7 +1578,15 @@ bool func_803296D8(Actor *this, s32 dist){
} }
} }
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032970C.s") s32 func_8032970C(Actor *this){
f32 sp24[3];
f32 sp18[3];
func_8028E964(sp24);
_player_getPosition(sp18);
sp24[1] = sp18[1];
return (s32) DIST_SQ_VEC3F(this->position, sp24);
}
s32 func_80329784(Actor *arg0){ s32 func_80329784(Actor *arg0){
f32 sp1C[3]; f32 sp1C[3];
@@ -1838,10 +1988,9 @@ void func_8032AA9C(void){
func_802C3BDC(); func_802C3BDC();
} }
#ifndef NONMATCHING
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032AABC.s")
#else
void func_8032AABC(void){ void func_8032AABC(void){
Actor *i_ptr;
Actor *start = &D_8036E560->data[0];
u32 i; u32 i;
u32 cnt; u32 cnt;
@@ -1850,13 +1999,11 @@ void func_8032AABC(void){
if(D_8036E560 != NULL){ if(D_8036E560 != NULL){
cnt = D_8036E560->cnt; cnt = D_8036E560->cnt;
for(i = 0; i < cnt; i++){ for(i_ptr = start, i = 0; i < cnt; i++, i_ptr++){
D_8036E560->data[i].marker->unk14_21 = 0; i_ptr->marker->unk14_21 = 0;
} }
} }
} }
#endif
void func_8032AB84(Actor *arg0) { void func_8032AB84(Actor *arg0) {
s32 var_s0; s32 var_s0;

View File

@@ -414,6 +414,7 @@ sSpawnableActorSize = 0x8036A9B0;
sSpawnableActorList = 0x8036A9B4; sSpawnableActorList = 0x8036A9B4;
D_8036B810 = 0x8036B810; D_8036B810 = 0x8036B810;
D_8036D940 = 0x8036D940; D_8036D940 = 0x8036D940;
D_8036E598 = 0x8036E598;
D_8036E5B0 = 0x8036E5B0; D_8036E5B0 = 0x8036E5B0;
D_8036E5C0 = 0x8036E5C0; D_8036E5C0 = 0x8036E5C0;
modelCache = 0x8036E7C0; modelCache = 0x8036E7C0;