Skip to content

Enemy/hanasambo: match 73 of the TU's 95 functions from the map - #179

Open
gitRasheed wants to merge 16 commits into
doldecomp:mainfrom
gitRasheed:pr/Enemy-hanasambo
Open

gitRasheed wants to merge 16 commits into
doldecomp:mainfrom
gitRasheed:pr/Enemy-hanasambo

Conversation

@gitRasheed

@gitRasheed gitRasheed commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Sambo, its head and the flower are reconstructed from the map and the object, with the two sound includes that place the static initializer. Every function has a body, the params ctors carry the defaults the manager loads store, and the ones still short are frame gaps.

@gitRasheed gitRasheed changed the title Enemy/hanasambo: match 65 of the TU's 95 functions from the map Enemy/hanasambo: match 66 of the TU's 95 functions from the map Sep 16, 2026
@decomp-dev

decomp-dev Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Report for GMSJ01 (748cea4 - e782f4d)

📈 Matched code: 41.88% (+0.33%, +11676 bytes)
📈 Matched data: 61.24% (+0.39%, +2492 bytes)

✅ 79 new matches
Unit Item Bytes Before After
mario/Enemy/hanasambo .rodata +1872 0.00% 100.00%
mario/Enemy/hanasambo __sinit_hanasambo_cpp +764 0.00% 100.00%
mario/Enemy/hanasambo TSamboHead::genEventCoin() +716 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlowerSaveLoadParams::TSamboFlowerSaveLoadParams(const char*) +672 0.00% 100.00%
mario/Enemy/hanasambo TSamboHeadManager::load(JSUMemoryInputStream&) +664 0.00% 100.00%
mario/Enemy/hanasambo TNerveHanaSamboDie::execute(TSpineBase<TLiveActor>*) const +572 0.00% 100.00%
mario/Enemy/hanasambo THanaSamboManager::load(JSUMemoryInputStream&) +532 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::kill() +448 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::createPollen() +424 0.00% 100.00%
mario/Enemy/hanasambo THanaSamboHead::receiveMessage(THitActor*, unsigned long) +376 0.00% 100.00%
mario/Enemy/hanasambo .bss +328 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::moveObject() +280 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::init(TLiveManager*) +276 0.00% 100.00%
mario/Enemy/hanasambo TNerveHanaSamboFreeze::execute(TSpineBase<TLiveActor>*) const +252 0.00% 100.00%
mario/Enemy/hanasambo TSamboHead::getGravityY() const +248 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::receiveMessage(THitActor*, unsigned long) +236 0.00% 100.00%
mario/Enemy/hanasambo TSamboHead::kill() +192 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlowerManager::perform(unsigned long, JDrama::TGraphics*) +184 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::drawObject(JDrama::TGraphics*) +184 0.00% 100.00%
mario/Enemy/hanasambo .sdata2 +176 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::setDeadAnm() +160 0.00% 100.00%
mario/Enemy/hanasambo TSamboHead::~TSamboHead() +156 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::setMActorAndKeeper() +152 0.00% 100.00%
mario/Enemy/hanasambo THanaSamboManager::createEnemyInstance() +148 0.00% 100.00%
mario/Enemy/hanasambo TNerveSamboHeadRecoverWater::execute(TSpineBase<TLiveActor>*) const +140 0.00% 100.00%
mario/Enemy/hanasambo THanaSamboHead::~THanaSamboHead() +132 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::~THanaSambo() +132 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::loadAfter() +132 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::load(JSUMemoryInputStream&) +128 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::setMActorAndKeeper() +128 0.00% 100.00%

...and 49 more new matches

📈 23 improvements in unmatched items
Unit Item Bytes Before After
mario/Enemy/hanasambo .data +1947 0.00% 97.36%
mario/Enemy/hanasambo TNerveSamboHeadHitWater::execute(TSpineBase<TLiveActor>*) const +1262 0.00% 98.67%
mario/Enemy/hanasambo TSamboFlowerManager::loadAfter() +951 0.00% 99.97%
mario/Enemy/hanasambo TNerveSamboHeadAttack::execute(TSpineBase<TLiveActor>*) const +885 0.00% 98.84%
mario/Enemy/hanasambo TSamboHead::behaveToWater(THitActor*) +806 0.00% 99.81%
mario/Enemy/hanasambo TSamboFlowerCoinUnit::checkGenCoin() +750 0.00% 88.11%
mario/Enemy/hanasambo SamboHeadRollCallback(J3DNode*, int) +697 0.00% 90.41%
mario/Enemy/hanasambo THanaSambo::init(TLiveManager*) +661 0.00% 96.19%
mario/Enemy/hanasambo TNerveHanaSamboHide::execute(TSpineBase<TLiveActor>*) const +658 0.00% 99.75%
mario/Enemy/hanasambo TNerveSamboHeadAppear::execute(TSpineBase<TLiveActor>*) const +639 0.00% 99.93%
mario/Enemy/hanasambo TNerveHanaSamboAppear::execute(TSpineBase<TLiveActor>*) const +590 0.00% 99.70%
mario/Enemy/hanasambo TNerveSamboHeadHide::execute(TSpineBase<TLiveActor>*) const +574 0.00% 99.76%
mario/Enemy/hanasambo TSamboFlowerManager::dropLeaf(JGeometry::TVec3<float>&, JGeometry::TVec3<float>&) +558 0.00% 99.64%
mario/Enemy/hanasambo TNerveSamboHeadHitWall::execute(TSpineBase<TLiveActor>*) const +531 0.00% 99.90%
mario/Enemy/hanasambo TNerveHanaSamboWait::execute(TSpineBase<TLiveActor>*) const +520 0.00% 99.41%
mario/Enemy/hanasambo TSamboLeaf::perform(unsigned long, JDrama::TGraphics*) +509 0.00% 93.04%
mario/Enemy/hanasambo TNerveHanaSamboAttack::execute(TSpineBase<TLiveActor>*) const +499 0.00% 99.94%
mario/Enemy/hanasambo TSamboFlower::moveObject() +423 0.00% 99.91%
mario/Enemy/hanasambo TSamboHead::attackToMario() +387 0.00% 99.81%
mario/Enemy/hanasambo TSamboHead::init(TLiveManager*) +335 0.00% 99.76%
mario/Enemy/hanasambo TSamboHead::setAfterDeadEffect() +303 0.00% 99.93%
mario/Enemy/hanasambo THanaSambo::load(JSUMemoryInputStream&) +191 0.00% 99.69%
mario/Enemy/hanasambo TSamboHead::load(JSUMemoryInputStream&) +191 0.00% 99.69%

Report for GMSP01 (748cea4 - e782f4d)

📈 Matched code: 41.04% (+0.32%, +11476 bytes)
📈 Matched data: 55.26% (+0.39%, +2492 bytes)

✅ 78 new matches
Unit Item Bytes Before After
mario/Enemy/hanasambo .rodata +1872 0.00% 100.00%
mario/Enemy/hanasambo __sinit_hanasambo_cpp +764 0.00% 100.00%
mario/Enemy/hanasambo TSamboHead::genEventCoin() +716 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlowerSaveLoadParams::TSamboFlowerSaveLoadParams(const char*) +672 0.00% 100.00%
mario/Enemy/hanasambo TSamboHeadManager::load(JSUMemoryInputStream&) +664 0.00% 100.00%
mario/Enemy/hanasambo TNerveHanaSamboDie::execute(TSpineBase<TLiveActor>*) const +572 0.00% 100.00%
mario/Enemy/hanasambo THanaSamboManager::load(JSUMemoryInputStream&) +532 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::kill() +448 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::createPollen() +424 0.00% 100.00%
mario/Enemy/hanasambo THanaSamboHead::receiveMessage(THitActor*, unsigned long) +376 0.00% 100.00%
mario/Enemy/hanasambo .bss +328 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::init(TLiveManager*) +276 0.00% 100.00%
mario/Enemy/hanasambo TNerveHanaSamboFreeze::execute(TSpineBase<TLiveActor>*) const +252 0.00% 100.00%
mario/Enemy/hanasambo TSamboHead::getGravityY() const +248 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::receiveMessage(THitActor*, unsigned long) +236 0.00% 100.00%
mario/Enemy/hanasambo TSamboHead::kill() +192 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlowerManager::perform(unsigned long, JDrama::TGraphics*) +184 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::drawObject(JDrama::TGraphics*) +184 0.00% 100.00%
mario/Enemy/hanasambo .sdata2 +176 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::setDeadAnm() +160 0.00% 100.00%
mario/Enemy/hanasambo TSamboHead::~TSamboHead() +156 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::setMActorAndKeeper() +152 0.00% 100.00%
mario/Enemy/hanasambo THanaSamboManager::createEnemyInstance() +148 0.00% 100.00%
mario/Enemy/hanasambo TNerveSamboHeadRecoverWater::execute(TSpineBase<TLiveActor>*) const +140 0.00% 100.00%
mario/Enemy/hanasambo THanaSamboHead::~THanaSamboHead() +132 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::~THanaSambo() +132 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::loadAfter() +132 0.00% 100.00%
mario/Enemy/hanasambo TSamboFlower::load(JSUMemoryInputStream&) +128 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::setMActorAndKeeper() +128 0.00% 100.00%
mario/Enemy/hanasambo THanaSambo::THanaSambo(const char*) +124 0.00% 100.00%

...and 48 more new matches

📈 25 improvements in unmatched items
Unit Item Bytes Before After
mario/Enemy/hanasambo .data +1947 0.00% 97.36%
mario/Enemy/hanasambo TNerveSamboHeadHitWater::execute(TSpineBase<TLiveActor>*) const +1262 0.00% 98.67%
mario/Enemy/hanasambo TSamboFlowerManager::loadAfter() +951 0.00% 99.97%
mario/Enemy/hanasambo TNerveSamboHeadAttack::execute(TSpineBase<TLiveActor>*) const +885 0.00% 98.84%
mario/Enemy/hanasambo TSamboHead::behaveToWater(THitActor*) +806 0.00% 99.81%
mario/Enemy/hanasambo TSamboFlowerCoinUnit::checkGenCoin() +750 0.00% 88.11%
mario/Enemy/hanasambo SamboHeadRollCallback(J3DNode*, int) +697 0.00% 90.41%
mario/Enemy/hanasambo THanaSambo::init(TLiveManager*) +661 0.00% 96.19%
mario/Enemy/hanasambo TNerveHanaSamboHide::execute(TSpineBase<TLiveActor>*) const +658 0.00% 99.75%
mario/Enemy/hanasambo TNerveSamboHeadAppear::execute(TSpineBase<TLiveActor>*) const +639 0.00% 99.93%
mario/Enemy/hanasambo TNerveHanaSamboAppear::execute(TSpineBase<TLiveActor>*) const +590 0.00% 99.70%
mario/Enemy/hanasambo TNerveSamboHeadHide::execute(TSpineBase<TLiveActor>*) const +574 0.00% 99.76%
mario/Enemy/hanasambo TSamboFlowerManager::dropLeaf(JGeometry::TVec3<float>&, JGeometry::TVec3<float>&) +558 0.00% 99.64%
mario/Enemy/hanasambo TNerveSamboHeadHitWall::execute(TSpineBase<TLiveActor>*) const +531 0.00% 99.90%
mario/Enemy/hanasambo TNerveHanaSamboWait::execute(TSpineBase<TLiveActor>*) const +520 0.00% 99.41%
mario/Enemy/hanasambo TSamboLeaf::perform(unsigned long, JDrama::TGraphics*) +509 0.00% 93.04%
mario/Enemy/hanasambo TNerveHanaSamboAttack::execute(TSpineBase<TLiveActor>*) const +499 0.00% 99.94%
mario/Enemy/hanasambo TSamboFlower::moveObject() +423 0.00% 99.91%
mario/Enemy/hanasambo TSamboHead::attackToMario() +387 0.00% 99.81%
mario/Enemy/hanasambo TSamboHead::init(TLiveManager*) +335 0.00% 99.76%
mario/Enemy/hanasambo TSamboHead::setAfterDeadEffect() +303 0.00% 99.93%
mario/Enemy/hanasambo THanaSambo::moveObject() +255 0.00% 67.28%
mario/Enemy/hanasambo THanaSambo::load(JSUMemoryInputStream&) +191 0.00% 99.69%
mario/Enemy/hanasambo TSamboHead::load(JSUMemoryInputStream&) +191 0.00% 99.69%
mario/Enemy/hanasambo THanaSambo::isHitValid(unsigned long) +23 0.00% 66.67%

@Mrkol Mrkol left a comment

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.

What about the rest of the functions in the TU?

Comment thread src/Enemy/hanasambo.cpp Outdated
TMapObjBase* obj = TMapObjBaseManager::newAndRegisterObj(
"coin", JGeometry::TVec3<f32>(0.0f, 0.0f, 0.0f),
JGeometry::TVec3<f32>(0.0f, 0.0f, 0.0f),
JGeometry::TVec3<f32>(1.0f, 1.0f, 1.0f));

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.

these SRT args are defaulted so you don't have to specify them

Comment thread src/Enemy/hanasambo.cpp Outdated
u32 id = MSD_SE_OBJ_FLOWER_OPEN_0 + unk164->unk0;
if (gpMSound->gateCheck(id))
MSoundSESystem::MSoundSE::startSoundActor(id, &mPosition, 0,
nullptr, 0, 4);

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.

always use SMSGetMSound()->startSoundActor

Comment thread src/Enemy/hanasambo.cpp Outdated
actor->getModel()->lock();
}

// TODO: frame 8 bytes short of the original around the sound block.

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.

Lets not leave these clanker comments about missing stack everywhere -- missing stack is all over the codebase and changes all the time. The numbers specified in these comments will constantly go out of date so it will poison clanker thoughts with out-of-date info rather than provide useful context

Comment thread src/Enemy/hanasambo.cpp Outdated

void TSamboFlower::hide() { }

// TODO: default values are placeholders; names and offsets are from the object.

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.

huh? just use the actual default values

Comment thread src/Enemy/hanasambo.cpp Outdated

JPABaseEmitter* emitter;
if (mSpine->getCurrentNerve() == &TNerveHanaSamboWait::theNerve()) {
emitter = gpMarioParticleManager->emit(0xB2, &pos, 0, nullptr);

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.

…ining stubs

Existing inlines everywhere the review asked (sound, defaults omitted, named
particles, >>), the two params ctors carry the defaults the manager loads store,
and the eighteen stub bodies are written from the target; nine of the UNUSED
helpers land at the map's size.
@gitRasheed

Copy link
Copy Markdown
Contributor Author

every functio should have a body now, pulled the real param defaults out of the manager loads, and dropped 4 unused bodies that had the Kumokun problem where the sizes didn't match the map so made them stubs

@gitRasheed gitRasheed changed the title Enemy/hanasambo: match 66 of the TU's 95 functions from the map Enemy/hanasambo: match 67 of the TU's 95 functions from the map Sep 16, 2026
@gitRasheed
gitRasheed requested a review from Mrkol September 18, 2026 20:45
Comment thread src/Enemy/hanasambo.cpp Outdated
{
if (param_2 == HIT_MESSAGE_SPRAYED_BY_WATER) {
if (!unk150) {
unk150 = 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 TSamboFlower::bloom but inlined. Look for other such cases where functions from this TU got inlined into other functions.

Comment thread src/Enemy/hanasambo.cpp Outdated
nullptr);
mMActor->setBck("flower_hit");
if (unk160 && unk164) {
*unk164 = *unk164 - 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.

Wouldn't *unk164 -= 1; work?

Comment thread src/Enemy/hanasambo.cpp Outdated

TSpineEnemy* THanaSamboManager::createEnemyInstance()
{
return new THanaSambo("ハナサンボ");

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.

From my experience they almost always used defaulted argument for the "usual" names of these actor classes -- lets use that everywhere. I.e. this is just the class name spelled out in japanese, so it's probably the default name with room left for "overriding" the name in the caller

Comment thread src/Enemy/hanasambo.cpp Outdated
++i) { }
}

unk194 = new THanaSamboHead();

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.

no need to write () for no-arg constructor call, this ain't java

@gitRasheed gitRasheed changed the title Enemy/hanasambo: match 67 of the TU's 95 functions from the map Enemy/hanasambo: match 73 of the TU's 95 functions from the map Sep 25, 2026
It is weak in both maps, and the PAL map emits it from this TU.
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