core2/code_47BD0.c done

This commit is contained in:
Banjo Kazooie 2022-10-25 15:20:43 -05:00
parent ecd10dbb0a
commit 250f550f67
7 changed files with 215 additions and 225 deletions

View File

@ -1,4 +1,4 @@
# banjo (91.5628%)
# banjo (91.7705%)
<img src="./progress/progress_total.svg">

View File

@ -2890,7 +2890,7 @@ enum asset_e
ASSET_49B_MODEL_TWINKLY_SHARD_RED,
// 49c (Green & Red Area?)
ASSET_49D_MODEL_SEAMAN_GRUBLIN = 0x49D,
// 49e 2D Bee (Used In Swarms)
ASSET_49E_SPRITE_BEE_SWARM,
// 49f 2D Glowing Bee (Beta)
ASSET_4A0_SPRITE_EXPLOSION = 0x4A0,
// 4a1 Brick Wall Near GV Entrance
@ -3942,7 +3942,8 @@ enum marker_e{
MARKER_20F_WOZZA_IN_CAVE = 0x20F,
MARKER_218_LIMBO = 0x218,
MARKER_217_BEE_SWARM = 0x217,
MARKER_218_LIMBO,
MARKER_219_MUMMUM,
MARKER_21A_SEAMAN_GRUBLIN,

View File

@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h44v20H0z"/>
<path fill="#2fe000" d="M44 0h67v20H44z"/>
<path fill="#2de000" d="M44 0h67v20H44z"/>
<path fill="url(#b)" d="M0 0h111v20H0z"/>
</g>
<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>
</g>
<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">89.5256%</text>
<text x="77.5" y="14">89.5256%</text>
<text x="78.5" y="15" fill="#010101" fill-opacity=".3">89.8876%</text>
<text x="77.5" y="14">89.8876%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -9,7 +9,7 @@
</mask>
<g mask="url(#anybadge_1)">
<path fill="#555" d="M0 0h150v20H0z"/>
<path fill="#26e000" d="M150 0h67v20H150z"/>
<path fill="#25e000" d="M150 0h67v20H150z"/>
<path fill="url(#b)" d="M0 0h217v20H0z"/>
</g>
<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>
</g>
<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">91.5628%</text>
<text x="183.5" y="14">91.5628%</text>
<text x="184.5" y="15" fill="#010101" fill-opacity=".3">91.7705%</text>
<text x="183.5" y="14">91.7705%</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -2,6 +2,16 @@
#include "functions.h"
#include "variables.h"
extern void func_8030DBFC(u32, f32, f32, f32);
extern bool func_80309DBC(f32[3], f32[3], f32, f32 sp54[3], s32, s32);
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]);
typedef struct{
f32 unk0[3];
f32 unkC[3];
@ -23,22 +33,18 @@ typedef struct{
s32 unk24;
}ActorLocal_core2_47BD0;
void func_802CF83C(Actor *this);
Actor *func_802CEBFC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
/* .h */
void chBeeSwarm_update(Actor *this);
Actor *chBeeSwarm_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx);
extern f32 D_803765E4;
extern s32 D_8037DCBC;
/* .data */
extern ActorInfo D_80367310 = {0x217, ACTOR_34D_BEE_SWARM, 0x49E,
ActorInfo D_80367310 = {MARKER_217_BEE_SWARM, ACTOR_34D_BEE_SWARM, ASSET_49E_SPRITE_BEE_SWARM,
1, NULL,
func_802CF83C, NULL, func_802CEBFC,
chBeeSwarm_update, NULL, chBeeSwarm_draw,
0, 0, 1.0f, 0
};
/* .rodata */
extern f32 D_803765E0;
/* .bss */
extern s32 D_8037DCBC;
@ -55,7 +61,7 @@ void func_802CEB60(Actor *this){
}
}
void func_802CEBA8(Actor *this){
void chBeeSwarm_802CEBA8(Actor *this){
ActorLocal_core2_47BD0 *local;
local = (ActorLocal_core2_47BD0 *)&this->local;
@ -70,7 +76,7 @@ void func_802CEBA8(Actor *this){
D_8037DCBC = 0;
}
Actor *func_802CEBFC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *chBeeSwarm_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
Actor *this;
ActorLocal_core2_47BD0 *local;
BKModelBin *phi_fp;
@ -107,16 +113,16 @@ Actor *func_802CEBFC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){
return this;
}
void func_802CEDE4(f32 arg0[3], f32 p_ctrl[3], f32 arg2, f32 *arg3, f32 arg4, f32 arg5){
void func_802CEDE4(f32 target_position[3], f32 p_ctrl[3], f32 distance, f32 *arg3, f32 arg4, f32 arg5){
s32 phi_s1;
phi_s1 = 0;
do{
p_ctrl[0] = randf2(-arg2, arg2);
p_ctrl[1] = randf2(-arg2, arg2);
p_ctrl[2] = randf2(-arg2, arg2);
p_ctrl[0] = randf2(-distance, distance);
p_ctrl[1] = randf2(-distance, distance);
p_ctrl[2] = randf2(-distance, distance);
phi_s1++;
}while(phi_s1 < 10 && ml_vec3f_distance(arg0, p_ctrl) < arg2);
}while(phi_s1 < 10 && ml_vec3f_distance(target_position, p_ctrl) < distance);
*arg3 = randf2(arg4, arg5);
}
@ -153,7 +159,7 @@ void func_802CEF54(Actor *this, f32 arg1[3], f32 arg2){
this->unk1C[2] = this->unk1C[2] + arg1[2];
}
void func_802CF040(Actor *this) {
void chBeeSwarm_802CF040(Actor *this) {
Struct_core2_47BD0_0 *phi_s0;
s32 phi_s1;
ActorLocal_core2_47BD0 *local;
@ -176,7 +182,7 @@ void func_802CF040(Actor *this) {
func_802CEF54(this, local->unkC, 100.0f);
}
void func_802CF174(f32 arg0[3], f32 arg1, f32 arg2) {
void chBeeSwarm_802CF174(f32 arg0[3], f32 arg1, f32 arg2) {
f32 temp_f0;
if (arg1 != 0.0f) {
@ -187,7 +193,7 @@ void func_802CF174(f32 arg0[3], f32 arg1, f32 arg2) {
}
}
void func_802CF1C8(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4, f32 *arg5, f32 arg6[3]) {
void chBeeSwarm_802CF1C8(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4, f32 *arg5, f32 arg6[3]) {
f32 sp4C;
f32 temp_f12;
f32 sp3C[3];
@ -199,9 +205,9 @@ void func_802CF1C8(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4, f3
arg6[2] = arg0[2] - arg1[2];
temp_f12 = gu_sqrtf(arg6[0]*arg6[0] + arg6[1]*arg6[1] + arg6[2]*arg6[2]);
if (temp_f12 < (2 * arg4)) {
func_802CF174(arg6, temp_f12, 8 * arg3);
chBeeSwarm_802CF174(arg6, temp_f12, 8 * arg3);
} else {
func_802CF174(arg6, temp_f12, 2 * arg3);
chBeeSwarm_802CF174(arg6, temp_f12, 2 * arg3);
}
arg1[0] += (arg2[0] * sp4C) + (arg6[0] * sp4C * sp4C);
arg1[1] += (arg2[1] * sp4C) + (arg6[1] * sp4C * sp4C);
@ -212,7 +218,7 @@ void func_802CF1C8(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4, f3
arg2[2] += arg6[2] * sp4C;
temp_f12 = gu_sqrtf(arg2[0]*arg2[0] + arg2[1]*arg2[1] + arg2[2]*arg2[2]);
if (arg3 < temp_f12) {
func_802CF174(arg2, temp_f12, arg3);
chBeeSwarm_802CF174(arg2, temp_f12, arg3);
}
if (arg5 != 0) {
sp3C[0] = sp3C[1] = sp3C[2] = 0.0f;
@ -220,7 +226,7 @@ void func_802CF1C8(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4, f3
}
}
void func_802CF434(Actor *this) {
void chBeeSwarm_802CF434(Actor *this) {
ActorLocal_core2_47BD0 *local;
Struct_core2_47BD0_0 *phi_s0;
s32 phi_s2;
@ -230,7 +236,7 @@ void func_802CF434(Actor *this) {
local = (ActorLocal_core2_47BD0 *) &this->local;
for(phi_s2 = 0, phi_s0 = local->unk8; phi_s2 < local->unk0; phi_s2++){
func_802CF1C8(phi_s0->unk18, phi_s0->unk0, phi_s0->unkC, phi_s0->unk24[2], 150.0f, phi_s0->unk24, &sp58);
chBeeSwarm_802CF1C8(phi_s0->unk18, phi_s0->unk0, phi_s0->unkC, phi_s0->unk24[2], 150.0f, phi_s0->unk24, &sp58);
if (ml_vec3f_distance(phi_s0->unk0, phi_s0->unk18) < 50.0f) {
func_802CEEA4(this, phi_s0);
}
@ -238,7 +244,7 @@ void func_802CF434(Actor *this) {
}
}
void func_802CF518(Actor *this) {
void chBeeSwarm_802CF518(Actor *this) {
if( func_803292E0(this)
&& func_80329530(this, 900)
&& func_8028EE84() == BSWATERGROUP_0_NONE
@ -248,7 +254,7 @@ void func_802CF518(Actor *this) {
}
}
void func_802CF57C(Actor *this) {
void chBeeSwarm_802CF57C(Actor *this) {
ActorLocal_core2_47BD0 *local;
local = (ActorLocal_core2_47BD0 *) &this->local;
@ -258,7 +264,7 @@ void func_802CF57C(Actor *this) {
}
}
bool func_802CF5E4(Actor *this){
bool chBeeSwarm_802CF5E4(Actor *this){
ActorLocal_core2_47BD0 *local;
ActorMarker *other;
bool out = 1;
@ -269,7 +275,7 @@ bool func_802CF5E4(Actor *this){
return out;
}
void func_802CF610(Actor *this, ParticleEmitter *p_ctrl, f32 position[3]) {
void chBeeSwarm_802CF610(Actor *this, ParticleEmitter *p_ctrl, f32 position[3]) {
func_8030E6A4(SFX_66_BIRD_AUUGHH, randf2(1.75f, 1.85f), 15000);
particleEmitter_setPosition(p_ctrl, position);
func_802EFA70(p_ctrl, 2);
@ -288,30 +294,17 @@ void func_802CF610(Actor *this, ParticleEmitter *p_ctrl, f32 position[3]) {
particleEmitter_emitN(p_ctrl, 1);
}
void func_802CF7CC(Actor *this) {
void chBeeSwarm_802CF7CC(Actor *this) {
if (D_8037DCBC == 0) {
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, 0x3FA);
sfxsource_setSfxId(this->unk44_31, SFX_3FA_HONEYCOMB_TALKING);
func_8030DD14(this->unk44_31, 2);
func_8030DD90(this->unk44_31, 2);
D_8037DCBC = 1;
}
}
#ifndef NONMATCHING
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 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) {
void chBeeSwarm_update(Actor *this) {
Actor *beehive;
ActorLocal_core2_47BD0 *local = (ActorLocal_core2_47BD0 *)&this->local;
f32 spB4[3];
@ -325,8 +318,6 @@ void func_802CF83C(Actor *this) {
f32 temp_f0;
f32 sp68[3];
spAC = time_getDelta();
sp78 = 0;
if (!this->initialized) {
@ -365,9 +356,9 @@ void func_802CF83C(Actor *this) {
}
if (!this->unk16C_4) {
this->unk16C_4 = TRUE;
func_803300D8(this->marker, func_802CEBA8);
func_803300D8(this->marker, chBeeSwarm_802CEBA8);
actor_collisionOff(this);
local->unk20 = assetcache_get(0x3BF);
local->unk20 = assetcache_get(ASSET_3BF_MODEL_PLAYER_SHADOW);
if (sp78 == 0) {
beehive = func_80326D68(this->position, ACTOR_12_BEEHIVE, -1, &spB0);
if (beehive != NULL) {
@ -386,15 +377,15 @@ void func_802CF83C(Actor *this) {
}
func_80328A84(this, (this->unk100 != NULL) ? 1 : 2);
this->unk60 = 0.0f;
func_802CF040(this);
chBeeSwarm_802CF040(this);
this->unk38_0 = func_803203FC(1) | func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE);
}
if (subaddie_playerIsWithinSphere(this, 0xFA0)) {
if (!subaddie_playerIsWithinSphere(this, 0xFA0))
return;
if (!subaddie_playerIsWithinSphere(this, 0x5DC)) {
u8 temp = this->unk44_31;
if (temp!= 0) {
func_8030DA44(temp);
if ((u8)this->unk44_31 != 0) {
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
D_8037DCBC = 0;
}
@ -427,7 +418,7 @@ void func_802CF83C(Actor *this) {
func_80328A84(this, 6);
}
}
func_802CF1C8(this->unk1C, this->position, this->velocity, this->unk28, 100.0f, 0, &spA0);
chBeeSwarm_802CF1C8(this->unk1C, this->position, this->velocity, this->unk28, 100.0f, 0, &spA0);
}
if (map_get() == MAP_78_GL_RBB_AND_MMM_PUZZLE) {
if (this->unk38_31++ == 0x1E) {
@ -454,14 +445,14 @@ void func_802CF83C(Actor *this) {
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)
if (!func_8031FF1C(0x8F) && subaddie_playerIsWithinCylinder(this, 250, 300)
&& ((func_8028ECAC() == 0) || (func_8028ECAC() == BSGROUP_8_TROT))
&& (player_getTransformation() == TRANSFORM_1_BANJO)
&& (func_80311480(0xDA6, 0, NULL, NULL, NULL, NULL) != 0)
) {
func_80320004(0x8F, TRUE);
}
if (func_802CF5E4(this)) {
if (chBeeSwarm_802CF5E4(this)) {
func_80328A84(this, 2U);
}
if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
@ -472,7 +463,7 @@ void func_802CF83C(Actor *this) {
if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
func_802CEF54(this, local->unkC, 100.0f);
}
func_802CF518(this);
chBeeSwarm_802CF518(this);
break;
case 3:
this->unk1C[0] = spB4[0];
@ -484,7 +475,7 @@ void func_802CF83C(Actor *this) {
func_802CEF54(this, spB4, 50.0f);
func_80328A84(this, 4);
}
func_802CF57C(this);
chBeeSwarm_802CF57C(this);
break;
case 4:
spB4[1] += 50.0f;
@ -498,7 +489,7 @@ void func_802CF83C(Actor *this) {
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);
chBeeSwarm_802CF610(this, partEmitList_pushNew(1), sp68);
this->unk60 -= 0.2;
}
}
@ -511,13 +502,13 @@ void func_802CF83C(Actor *this) {
if (ml_vec3f_distance(this->position, spB4) > 100.0f) {
func_80328A84(this, 3);
}
func_802CF57C(this);
chBeeSwarm_802CF57C(this);
break;
case 5:
if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
func_80328A84(this, 2);
}
func_802CF518(this);
chBeeSwarm_802CF518(this);
break;
case 6:
if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) {
@ -540,12 +531,12 @@ void func_802CF83C(Actor *this) {
break;
}
if (local->unk5) {
func_802CF434(this);
chBeeSwarm_802CF434(this);
}
local->unk5 = 0;
if ((local->unk0 > 0) && func_80329530(this, 1500) && !this->unk38_0) {
if (this->unk44_31 == 0) {
func_802CF7CC(this);
chBeeSwarm_802CF7CC(this);
}
if (this->unk44_31 != 0) {
func_8030DBFC(this->unk44_31,
@ -559,6 +550,4 @@ void func_802CF83C(Actor *this) {
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));
}
}
}
}
#endif

View File

@ -2142,7 +2142,7 @@ void func_8032AF94(void) {
temp_s0->marker->unk50 = func_803406D4(temp_s0->marker->unk50);
}
if (temp_s0->marker->unk14_20 == 0x217) {
if (temp_s0->marker->unk14_20 == MARKER_217_BEE_SWARM) {
func_802CEB60(temp_s0);
}
}

View File

@ -191,7 +191,7 @@ segments:
- [0x468E0, c, ch/code_468E0] #DONE
- [0x46BC0, c, ch/jinjo]
- [0x47850, c, ch/beehive] #DONE
- [0x47BD0, c, code_47BD0]
- [0x47BD0, c, code_47BD0] #DONE
- [0x49570, c, ch/soundsource] #DONE
- [0x49A70, c, code_49A70] #DONE
- [0x4A420, c, ch/gloop] #DONE
@ -483,7 +483,7 @@ segments:
- [0xE01D0, .data, ch/code_468E0]
- [0xE0220, bin, data_E0220]
- [0xE0330, .data, ch/beehive]
- [0xE0380, bin, data_E0380]
- [0xE0380, .data, code_47BD0]
- [0xE03B0, .data, ch/soundsource]
- [0xE0430, .data, code_49A70]
- [0xE04A0, .data, ch/gloop]