Skip to content

Conversation

@LivewireCB
Copy link
Contributor

zThrown cleanup and BossSB2 work

@github-actions
Copy link

main/SB/Game/zThrown

Section From To Bytes
.sbss 0.00% 100.00% +24
📈 .sdata2 8.70% 26.92% +16
📈 .text 7.98% 10.93% +343
Function From To Bytes
📈 zThrown_Setup(zScene*) 0.00% 19.19% +82
📈 zThrown_Remove(xEnt*) 0.00% 14.14% +61
zThrown_KillFruit(xEnt*) 0.00% 100.00% +120
zThrown_IsStacked(xEnt*) 0.00% 100.00% +80

main/SB/Game/zNPCTypeBossSB2

Section From To Bytes
📈 .bss 50.00% 85.63% +496
📈 .data 80.64% 81.58% +8
📈 .rodata 55.04% 55.08% +2
📈 .sbss 0.00% 33.33% +5
📈 .text 39.14% 44.07% +1839
Function From To Bytes
📈 @unnamed@zNPCTypeBossSB2_cpp@::init_sound() 0.00% 0.91% +4
📈 zNPCB_SB2::Init(xEntAsset*) 0.00% 90.86% +305
📈 zNPCB_SB2::Setup() 0.00% 64.44% +221
zNPCB_SB2::Reset() 0.00% 100.00% +384
zNPCB_SB2::Process(xScene*, float) 0.00% 100.00% +360
zNPCB_SB2::NewTime(xScene*, float) 1.28% 100.00% +308
zNPCB_SB2::reset_speed() 54.29% 100.00% +12
📈 zNPCB_SB2::player_platform() 8.00% 22.40% +14
📈 zNPCB_SB2::activate_hand(zNPCB_SB2::hand_enum, bool) 66.11% 77.22% +3
📈 zNPCB_SB2::deactivate_hand(zNPCB_SB2::hand_enum) 66.11% 76.67% +3
📈 zNPCB_SB2::emit_slug(zNPCB_SB2::slug_enum) 0.00% 22.79% +106
📈 zNPCB_SB2::fire_slug(zNPCB_SB2::slug_enum, zNPCB_SB2::platform_data&) 0.00% 4.04% +14
xMat3x3RMulVec(xVec3*, const xMat3x3*, const xVec3*) 0.00% 100.00% +100

Copy link
Collaborator

@JoshSanch JoshSanch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress! Some clean-up feedback to address here, then we can merge.

U8 said_intro;
xModelInstance* models[4];
node_data nodes[9];
xModelInstance* models[4]; // 0x2f0??? also 0x300???
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep out the speculation for now until we can get more clarity on how accesses here work.

extern F32 _844; // 0.0f
#include "xMathInlines.h"

zThrownStruct zThrownList[0x20];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For array sizes, the decimal value is more clear - please use that instead.

F32 dVar6;

c_fruit.killTimer = globals.player.carry.fruitLifetime;
dVar6 = xsqrt((2.0f * globals.player.carry.throwHeight) / globals.player.carry.throwGravity);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the formula for determining how long the fruit will be airborne. Something like F32 airTime or F32 fallTime would be preferable for clarity.

Comment on lines 1144 to 1179
xModelInstance * m;

_singleton = this;
boss_cam.init();
init_sound();
zNPCCommon::Init(asset);
cfg_npc->dst_castShadow = 30.0f;
memset((void*)flag.face_player, 0, 0x10);
said_intro = 0;

m = model;
models[0] = model;

models[1] = m->Next;
models[2] = m->Next;
models[3] = m->Next;

models[0]->Data->boundingSphere.radius = 100.0f;
models[1]->Data->boundingSphere.radius = 100.0f;
models[2]->Data->boundingSphere.radius = 100.0f;
models[3]->Data->boundingSphere.radius = 100.0f;

set_alpha_blend(models[0]);
init_hands();
init_bounds();
reset_bounds();

penby = FALSE;
bupdate = 0;
bound.type = TRUE;
bound.sph.center.y = 1e38f;
bound.sph.r = 0.0f;

response_curve::init((U32)&rc_scale, 0, 0, 0, 0, 0, 0);

init_slugs();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please go through here and add the this keyword as appropriate to align with our contribution guidelines.

Comment on lines 1291 to 1314
void zNPCB_SB2::Process(xScene* xscn, F32 dt)
{
if (flag.updated == FALSE)
{
boss_cam.set_targets((xVec3&)globals.player.ent.model->Mat->pos, location(),
5.0f);
flag.updated = TRUE;
}

check_life();
player_damage_timer = player_damage_timer - dt;

if ((globals.player.Health < old_player_health) && old_player_health != 0)
{
player_damage_timer = tweak.player_damage_time;
say(1);
}

old_player_health = globals.player.Health;

if ((SomethingWonderful() & 0x23) == 0)
{
delay = delay + dt;
psy_instinct->Timestep(dt, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar this keyword review as above

turn.max_vel = tweak.turn_max_vel;
}

// I realized that i dont feel like dealing with this right now
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment please

// TODO
}

// Gonna have to come back to this. been using a lot of brain power on it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment please

// Gonna have to come back to this. been using a lot of brain power on it
void zNPCB_SB2::emit_slug(zNPCB_SB2::slug_enum which)
{
slug_data& slug = slugs[which]; // has to be correct????
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove this comment here - if we're uncertain about something, speculation can be misleading to future matches.

@github-actions
Copy link

main/SB/Core/x/xMath3

Section From To Bytes
.sdata2 88.89% 100.00% +4
⚠️ .text 96.13% 94.17% --143
Function From To Bytes
⚠️ xMat3x3RMulRotY(xMat3x3*, const xMat3x3*, float) 98.35% 88.35% --36
⚠️ xMat3x3Mul(xMat3x3*, const xMat3x3*, const xMat3x3*) 73.72% 61.28% --52
⚠️ xQuatSlerp(xQuat*, const xQuat*, const xQuat*, float) 90.10% 86.48% --12
⚠️ xQuatMul(xQuat*, const xQuat*, const xQuat*) 84.24% 79.46% --7
⚠️ xBoxFromCircle(xBox&, const xVec3&, const xVec3&, float) 69.03% 55.62% --34

main/SB/Game/zThrown

Section From To Bytes
.sbss 0.00% 100.00% +24
📈 .sdata2 8.70% 26.92% +16
📈 .text 7.98% 10.93% +343
Function From To Bytes
📈 zThrown_Setup(zScene*) 0.00% 19.19% +82
📈 zThrown_Remove(xEnt*) 0.00% 14.14% +61
zThrown_KillFruit(xEnt*) 0.00% 100.00% +120
zThrown_IsStacked(xEnt*) 0.00% 100.00% +80

main/SB/Core/gc/iSnd

Section From To Bytes
⚠️ .rodata 68.85% 0.00% --27
⚠️ .sbss 62.71% 50.00% --9
⚠️ .text 32.50% 23.20% --1321
Function From To Bytes
⚠️ iSndInit() 87.16% 0.00% --749
⚠️ iSndIsPlaying(unsigned int) 100.00% 0.00% --212
⚠️ iSndIsPlaying(unsigned int, unsigned int) 100.00% 0.00% --156
⚠️ iSndIsPlayingByHandle(unsigned int) 100.00% 0.00% --204

main/SB/Game/zEntPlayerOOBState

Section From To Bytes
⚠️ .bss 100.00% 66.67% --119
⚠️ .data 99.22% 62.86% --113
⚠️ .rodata 87.26% 84.45% --49
⚠️ .sbss 100.00% 25.00% --24
⚠️ .sdata2 100.00% 76.00% --24
⚠️ .text 90.99% 20.13% --7883
Function From To Bytes
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::render_model(xModelInstance&, const xVec3&, const xVec3&, const xVec3&) 27.27% 0.00% --80
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::move_up(xVec3&, float) 100.00% 31.91% --95
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::move_right(xVec3&, float) 100.00% 0.00% --156
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::update_max_out_time(const xSurface&) 100.00% 0.00% --84
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::move_hand(float) 97.41% 3.70% --101
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::render_fade() 81.67% 1.96% --162
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::set_rect_verts(rwGameCube2DVertex*, float, float, float, float, iColor_tag, float, float) 100.00% 0.00% --328
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::set_rect_vert(rwGameCube2DVertex&, float, float, float, iColor_tag, float) 100.00% 8.33% --44
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::render_ghost() 99.52% 0.00% --290
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::render_hand() 94.93% 0.00% --227
⚠️ oob_state::init() 70.56% 1.12% --247
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::drop_state_type() 100.00% 0.00% --148
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::update_fade_in(xScene&, float&) 100.00% 7.11% --104
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::supdate_start_fade_in(oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::update_start_fade_in(xScene&, float&) 100.00% 0.00% --60
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::supdate_moving_out(oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::update_moving_out(xScene&, float&) 100.00% 0.00% --136
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::supdate_starting(oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::update_starting(xScene&, float&) 82.71% 0.00% --79
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::supdate_stopped(oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::update_stopped(xScene&, float&) 100.00% 0.00% --108
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::supdate_stopping(oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::update_stopping(xScene&, float&) 100.00% 0.00% --148
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::supdate_moving_in(oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::update_moving_in(xScene&, float&) 99.91% 0.00% --271
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::state_type::state_type(oob_state::@unnamed@zEntPlayerOOBState_cpp@::state_enum) 100.00% 0.00% --20
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::grab_state_type() 100.00% 0.00% --196
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_fade_out(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_fade_out(xScene&, float&) 84.44% 0.00% --91
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_start_fade_out(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_start_fade_out(xScene&, float&) 100.00% 0.00% --60
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_moving_out(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_moving_out(xScene&, float&) 100.00% 0.00% --136
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_starting(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_starting(xScene&, float&) 82.71% 0.00% --79
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_tutorial(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_tutorial(xScene&, float&) 100.00% 0.00% --112
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_stopped(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_stopped(xScene&, float&) 100.00% 0.00% --108
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_stopping(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_stopping(xScene&, float&) 100.00% 98.85% --2
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_moving_in(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_moving_in(xScene&, float&) 99.91% 0.00% --271
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_begin_wait(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update_begin_wait(xScene&, float&) 100.00% 0.00% --64
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::supdate_reorient(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&, xScene&, float&) 100.00% 0.00% --32
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::tutorial_callback::tutorial_callback(oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type&) 100.00% 0.00% --76
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::out_state_type::out_state_type() 100.00% 0.00% --64
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::in_state_type::in_state_type() 100.00% 0.00% --64
⚠️ oob_state::update(xScene&, float) 100.00% 0.00% --300
⚠️ oob_state::render() 100.00% 0.00% --136
⚠️ oob_state::fx_render() 100.00% 0.00% --120
⚠️ oob_state::force_start() 82.92% 0.00% --159
⚠️ oob_state::read_persistent(xSerial&) 100.00% 0.00% --116
⚠️ oob_state::write_persistent(xSerial&) 100.00% 0.00% --108
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::in_state_type::update(xScene&, float&) 100.00% 0.00% --156
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::out_state_type::update(xScene&, float&) 86.84% 0.00% --236
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::start() 85.58% 0.00% --438
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::grab_state_type::update(xScene&, float&) 100.00% 0.00% --440
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::start() 79.93% 0.00% --386
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::stop() 75.22% 0.00% --69
⚠️ oob_state::@unnamed@zEntPlayerOOBState_cpp@::drop_state_type::update(xScene&, float&) 100.00% 0.00% --424
⚠️ xVec2::normal() const 100.00% 0.00% --64

main/SB/Game/zNPCTypeBossSB2

Section From To Bytes
📈 .bss 50.00% 85.63% +496
📈 .data 80.64% 81.58% +8
📈 .rodata 55.04% 55.08% +2
📈 .sbss 0.00% 33.33% +5
📈 .text 39.14% 44.07% +1839
Function From To Bytes
📈 @unnamed@zNPCTypeBossSB2_cpp@::init_sound() 0.00% 0.91% +4
📈 zNPCB_SB2::Init(xEntAsset*) 0.00% 90.86% +305
📈 zNPCB_SB2::Setup() 0.00% 64.44% +221
zNPCB_SB2::Reset() 0.00% 100.00% +384
zNPCB_SB2::Process(xScene*, float) 0.00% 100.00% +360
zNPCB_SB2::NewTime(xScene*, float) 1.28% 100.00% +308
zNPCB_SB2::reset_speed() 54.29% 100.00% +12
📈 zNPCB_SB2::player_platform() 8.00% 22.40% +14
📈 zNPCB_SB2::activate_hand(zNPCB_SB2::hand_enum, bool) 66.11% 77.22% +3
📈 zNPCB_SB2::deactivate_hand(zNPCB_SB2::hand_enum) 66.11% 76.67% +3
📈 zNPCB_SB2::emit_slug(zNPCB_SB2::slug_enum) 0.00% 22.79% +106
📈 zNPCB_SB2::fire_slug(zNPCB_SB2::slug_enum, zNPCB_SB2::platform_data&) 0.00% 4.04% +14
xMat3x3RMulVec(xVec3*, const xMat3x3*, const xVec3*) 0.00% 100.00% +100

@github-actions
Copy link

main/SB/Game/zThrown

Section From To Bytes
.sbss 0.00% 100.00% +24
📈 .sdata2 8.70% 26.92% +16
📈 .text 7.98% 10.93% +343
Function From To Bytes
📈 zThrown_Setup(zScene*) 0.00% 19.19% +82
📈 zThrown_Remove(xEnt*) 0.00% 14.14% +61
zThrown_KillFruit(xEnt*) 0.00% 100.00% +120
zThrown_IsStacked(xEnt*) 0.00% 100.00% +80

main/SB/Game/zNPCTypeBossSB2

Section From To Bytes
📈 .bss 50.00% 85.63% +496
📈 .data 80.64% 81.58% +8
📈 .rodata 55.04% 55.08% +2
📈 .sbss 0.00% 33.33% +5
📈 .text 39.14% 44.07% +1839
Function From To Bytes
📈 @unnamed@zNPCTypeBossSB2_cpp@::init_sound() 0.00% 0.91% +4
📈 zNPCB_SB2::Init(xEntAsset*) 0.00% 90.86% +305
📈 zNPCB_SB2::Setup() 0.00% 64.44% +221
zNPCB_SB2::Reset() 0.00% 100.00% +384
zNPCB_SB2::Process(xScene*, float) 0.00% 100.00% +360
zNPCB_SB2::NewTime(xScene*, float) 1.28% 100.00% +308
zNPCB_SB2::reset_speed() 54.29% 100.00% +12
📈 zNPCB_SB2::player_platform() 8.00% 22.40% +14
📈 zNPCB_SB2::activate_hand(zNPCB_SB2::hand_enum, bool) 66.11% 77.22% +3
📈 zNPCB_SB2::deactivate_hand(zNPCB_SB2::hand_enum) 66.11% 76.67% +3
📈 zNPCB_SB2::emit_slug(zNPCB_SB2::slug_enum) 0.00% 22.79% +106
📈 zNPCB_SB2::fire_slug(zNPCB_SB2::slug_enum, zNPCB_SB2::platform_data&) 0.00% 4.04% +14
xMat3x3RMulVec(xVec3*, const xMat3x3*, const xVec3*) 0.00% 100.00% +100

@JoshSanch JoshSanch merged commit 3a6d88c into bfbbdecomp:main Dec 16, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants