Skip to content

beetle tag actor#306

Open
coleslaw456 wants to merge 5 commits intozeldaret:mainfrom
coleslaw456:main
Open

beetle tag actor#306
coleslaw456 wants to merge 5 commits intozeldaret:mainfrom
coleslaw456:main

Conversation

@coleslaw456
Copy link
Copy Markdown
Contributor

Functions match ~100% and rodata is 90%. There's a 00 00 00 00 at the beginning of the data that has no references. There is one unused (and unknown) class variable and type of zone that sets an unknown flag (0x80) in boomerang.

@decomp-dev
Copy link
Copy Markdown

decomp-dev Bot commented Apr 3, 2026

Report for SOUE01 (d3ce728 - 9e70ed0)

Total functions: 76970 (-1)
📈 Matched code: 24.67% (+0.00%, +416 bytes)

✅ 3 new matches
Unit Item Bytes Before After
d_t_beetleNP/REL/d/t/d_t_beetle dTgBeetle_c::isWithinSphere(const mVec3_c&) const +252 0.00% 100.00%
d_t_beetleNP/REL/d/t/d_t_beetle dTgBeetle_c::updateBeetle(dAcBoomerang_c&) +88 0.00% 100.00%
d_t_beetleNP/REL/d/t/d_t_beetle dTgBeetle_c_classInit() +1 99.95% 100.00%
📈 4 improvements in unmatched items
Unit Item Bytes Before After
d_t_beetleNP/REL/d/t/d_t_beetle dTgBeetle_c::actorExecute() +379 0.00% 99.79%
d_t_beetleNP/REL/d/t/d_t_beetle dTgBeetle_c::isWithinCylinder(const mVec3_c&) const +359 0.00% 99.96%
d_t_beetleNP/REL/d/t/d_t_beetle dTgBeetle_c::create() +330 0.00% 99.64%
d_t_beetleNP/REL/d/t/d_t_beetle .rodata +21 0.00% 90.91%

Copy link
Copy Markdown
Collaborator

@elijah-thomas774 elijah-thomas774 left a comment

Choose a reason for hiding this comment

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

Please Format files and remove unneeded headers (should be marked by clangd)

Comment thread include/d/t/d_t_beetle.h
Comment on lines +17 to +18
u32 fn_302_210();
virtual int actorExecute();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
u32 fn_302_210();
virtual int actorExecute();
virtual int doDelete() override;
virtual int draw() override;
virtual int actorExecute() override;

Comment thread include/d/t/d_t_beetle.h
u32 isWithinSphere(const mVec3_c& param) const;
u32 isWithinCylinder(const mVec3_c& param) const;
void updateBeetle(dAcBoomerang_c& boomerang);
u32 fn_302_3A0();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

fn_302_210 renamed to doDelete
fn_302_3A0 renamed to draw

if unsure, check the vtable assignment

Suggested change
u32 fn_302_3A0();

Comment thread include/d/t/d_t_beetle.h
};

private:
/* 0xFC */ mMtx_c matrix1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/* 0xFC */ mMtx_c matrix1;
/* 0x0FC */ mMtx_c mMatrix1;

}
dAcObjBase_c::create(fProfile::CO_TEST, mRoomID, 0, &mPosition, &mRotation, &mScale, 0xFFFFFFFF);

return 0x2;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PACK_RESULT_e

Suggested change
return 0x2;
return FAILED;

}
}
matrixCreateFromPosRotYScale(matrix1, mPosition, mRotation.y, mScale, nullptr, 0);
return 0x1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return 0x1;
return SUCCEEDED;

int dTgBeetle_c::actorExecute() {
if (mPastOnly == 1 && !mActorSubtype) {
if (dTimeAreaMgr_c::GetInstance()->checkPositionIsInPastState(mRoomID, mPosition, nullptr, 1.0f) == 0) {
return 1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you get the point. the pre/do/post create/delete/execute/draw functions usually return this type

Suggested change
return 1;
return SUCCEEDED;

Comment on lines +18 to +20
mScale.x = mScale.x * 0.01f;
mScale.y = mScale.y * 0.01f;
mScale.z = mScale.z * 0.01f;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
mScale.x = mScale.x * 0.01f;
mScale.y = mScale.y * 0.01f;
mScale.z = mScale.z * 0.01f;
mScale *= 0.01f;

Comment on lines +28 to +32
mZoneType = mParams & 0xF;
mZoneShape = (mParams >> 4) & 3;
mUnknown = mParams >> 6;
mBeetleFlag = mParams >> 0xE;
mPastOnly = (mParams >> 0x16) & 3;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

use getFromParams

}
}

if (!SceneflagManager::sInstance->checkBoolFlag(mRoomID & 0xFFFF, mBeetleFlag) || mActorSubtype) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

mask unneeded - was cause of regalloc

Suggested change
if (!SceneflagManager::sInstance->checkBoolFlag(mRoomID & 0xFFFF, mBeetleFlag) || mActorSubtype) {
if (!SceneflagManager::sInstance->checkBoolFlag(mRoomID, mBeetleFlag) || mActorSubtype) {

diff.y /= mScale.y;
diff.z /= mScale.z;

if (EGG::Math<float>::sqrt(diff.squareMagXZ()) <= 0.01f && diff.y <= 0.5f) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (EGG::Math<float>::sqrt(diff.squareMagXZ()) <= 0.01f && diff.y <= 0.5f) {
if (diff.absXZ() <= 1.0f && diff.y <= 0.5f) {

Copy link
Copy Markdown
Collaborator

@elijah-thomas774 elijah-thomas774 left a comment

Choose a reason for hiding this comment

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

Porbably not meant to be with Beetle tag actor PR, but did some review anyways.

Comment thread src/REL/d/a/d_a_pumpkin.cpp Outdated

bool temp = (mLinkage.mState == 1 && mLinkage.mType == 6);
if (temp) {
startSound(0x9f4);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

look at d_snd_wzsound.h for sound enum

Comment thread src/REL/d/a/d_a_pumpkin.cpp Outdated
Comment on lines +24 to +25
bool temp = (mLinkage.mState == 1 && mLinkage.mType == 6);
if (temp) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if (getLinkage().checkConnection(dLinkage_c::CONNECTION_6)

Comment thread src/REL/d/a/d_a_pumpkin.cpp Outdated
Comment on lines +53 to +55
if ((field_7ec & 1) && field_7d8->GetActor() != nullptr) {
temp = true;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is probably one of the collision structures ChkXXHit() function

Comment thread src/REL/d/a/d_a_pumpkin.cpp Outdated
void dAcPumpkin_c::initializeState_Wait() {

field_0x908 = 0;
mActorProperties = mActorProperties | 1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

when setting/unsetting mActorProperties, use the set/unsetActorProperty function and enum

Comment thread src/REL/d/a/d_a_pumpkin.cpp Outdated
Comment on lines +224 to +226
mVelocity.x = mVec3_c::Zero.x;
mVelocity.z = mVec3_c::Zero.z;
mVelocity.y = mVec3_c::Zero.y;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

mVelocity = mVec3_c::Zero is probably fine here

Comment thread include/d/a/d_a_pumpkin.h Outdated
Comment on lines +33 to +51
/* 0x3cc?*/ dBgS_AcchCir* field_0x3cc;
/* 0x40c?*/ u8 field_0x40c;
/* spacer*/ u8 spacer[1370];
/* 0x744?*/ u8 field_0x744;
/* 0x7ec?*/ u8 field_7ec;
/* 0x7d8?*/ cCcD_GAtTgCoCommonBase* field_7d8;
/* 0x79C?*/ u32 pumpkinState;//??
/* 0x8cc?*/ dFlowBase_c* something;
/* 0x870?*/ u32 field_0x870;
/* 0x908?*/ f32 field_0x908;
/* 0x90C?*/ f32 field_0x90C;
/* 0x914?*/ float field0x914[21];
/* 0x9b8?*/ u32 field0x9b8;
/* 0x9db?*/ u8 field_0x9db;
/* 0x99c?*/ u8 field_99c;
/* 0xa14?*/ u8 field_a14;
/* 0xa15?*/ u8 field_a15;
/* 0xa16?*/ u8 field_a16;
/* 0xa17?*/ u8 field_a17;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

usually uppercase for offset comments.

float -> f32

field_0x prefix

@coleslaw456
Copy link
Copy Markdown
Contributor Author

Oops pushed that pumpkin commit to the wrong branch. Thanks for the review though I'll definitely need it. I'll review your suggestions and finish beetle soon

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