Skip to content

MapObjDolpic decompilation + THitActor fixes#78

Open
ryanbevins wants to merge 2 commits intodoldecomp:mainfrom
ryanbevins:mapobjdolpic-hitactor
Open

MapObjDolpic decompilation + THitActor fixes#78
ryanbevins wants to merge 2 commits intodoldecomp:mainfrom
ryanbevins:mapobjdolpic-hitactor

Conversation

@ryanbevins
Copy link

Summary

  • Decompile MapObjDolpic.cpp: TMonumentShine, TBellDolpic, TDptMonteFence, TMapObjSmoke, TMareGate, TDemoCannon, TTurboNozzleDoor
  • Add isActorTypeOf() inline helper to THitActor for boolean materialization matching

Copy link
Collaborator

@Mrkol Mrkol left a comment

Choose a reason for hiding this comment

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

Rebase please

public:
TMonumentShine(const char*);

virtual ~TMonumentShine() { }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Compiler automatically generates virtual destructors if the base has one so please remove all of these empty virtual dtors -- the original code likely didn't have those either


// fabricated
u32 getActorType() const { return mActorType; }
u8 isActorTypeOf(u32 base) const
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets not be hasty with adding this to HitActor, leave it in the cpp file you've been working on. This inline doesn't make any sense so we'll probably have to gather more data and think about it for a bit

if (unk13C == 0) {
gpItemManager->makeShineAppearWithDemo(
"\x83\x56\x83\x83\x83\x43\x83\x93\x81\x69\x83\x82\x83\x6A\x83\x85\x83\x81\x83\x93\x83\x67\x83\x56\x83\x83\x83\x43\x83\x93\x97\x70\x81\x6A",
"\x83\x82\x83\x6A\x83\x85\x83\x81\x83\x93\x83\x67\x83\x56\x83\x83\x83\x43\x83\x93\x83\x4A\x83\x81\x83\x89",
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 japanese text, please decode it with ShiftJIS and make the literal human-readable (lol) japanese

set100:
unk138.a = 100;
unk154 = 1000;
done:;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nah, this is 100% fake, send a decomp.me scratch

} else {
gpItemManager->makeShineAppearWithDemo(
"\x83\x56\x83\x83\x83\x43\x83\x93\x81\x69\x83\x68\x83\x8B\x83\x73\x83\x62\x83\x4E\x8F\xE0\x83\x65\x83\x83\x83\x8C\x83\x72\x8B\xC7\x97\x70\x81\x6A",
"\x83\x68\x83\x8B\x83\x73\x83\x62\x83\x4E\x8F\xE0\x83\x65\x83\x83\x83\x8C\x83\x72\x8B\xC7\x83\x4A\x83\x81\x83\x89",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, these two places have japanese text, please decode


mMActor->setBck("democannon_dpt");
J3DFrameCtrl* frameCtrl = mMActor->getFrameCtrl(0);
frameCtrl->mCurrentFrame = (f32)frameCtrl->mEndFrame;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use getters/setters here and you won't need the _pad trick. And in general, I'd prefer for the _pad thing to not be used, because that way it's easier to find stuff that needs more undiscovered inlines

- Remove all empty virtual dtors (compiler auto-generates them)
- Move isActorTypeOf helper from HitActor.hpp to local static in cpp
- Decode all ShiftJIS hex escapes to literal Japanese characters
- Remove fake matching (goto control flow, stack padding hacks)
- Use TNameRefGen::search<Type> instead of manual searchF
- Remove out-of-line TTurboNozzleDoor dtor (weak/inline symbol)
@ryanbevins ryanbevins force-pushed the mapobjdolpic-hitactor branch from 5bd4995 to 9d10b67 Compare February 7, 2026 05:06
@decomp-dev
Copy link

decomp-dev bot commented Feb 8, 2026

Report for GMSJ01 (e218eda - 9d10b67)

📈 Matched code: 26.47% (+0.11%, +3920 bytes)
📉 Linked code: 13.22% (-0.14%, -5180 bytes)
📈 Matched data: 28.90% (+0.42%, +2716 bytes)
📉 Linked data: 12.79% (-0.37%, -2376 bytes)

✅ 33 new matches
Unit Item Bytes Before After
mario/MoveBG/MapObjDolpic .data +2504 0.00% 100.00%
mario/MoveBG/MapObjDolpic __sinit_MapObjDolpic_cpp +764 0.00% 100.00%
mario/MoveBG/MapObjDolpic TDemoCannon::loadAfter() +340 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMonumentShine::receiveMessage(THitActor*, unsigned long) +324 0.00% 100.00%
mario/MoveBG/MapObjDolpic .bss +208 0.00% 100.00%
mario/MoveBG/MapObjDolpic TBellDolpic::initMapObj() +208 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMonumentShine::initMapObj() +176 0.00% 100.00%
mario/MoveBG/MapObjDolpic TDptMonteFence::touchPlayer(THitActor*) +168 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMapObjSmoke::~TMapObjSmoke() +156 0.00% 100.00%
mario/MoveBG/MapObjDolpic TDemoCannon::startDemo() +144 0.00% 100.00%
mario/MoveBG/MapObjDolpic TBellDolpic::TBellDolpic(int, const char*) +136 0.00% 100.00%
mario/MoveBG/MapObjDolpic TTurboNozzleDoor::~TTurboNozzleDoor() +132 0.00% 100.00%
mario/MoveBG/MapObjDolpic TDemoCannon::~TDemoCannon() +132 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMareGate::~TMareGate() +132 0.00% 100.00%
mario/MoveBG/MapObjDolpic TDptMonteFence::~TDptMonteFence() +132 0.00% 100.00%
mario/MoveBG/MapObjDolpic TBellDolpic::~TBellDolpic() +132 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMonumentShine::~TMonumentShine() +132 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMareGate::control() +104 0.00% 100.00%
mario/MoveBG/MapObjDolpic TBellDolpic::calcRootMatrix() +104 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMonumentShine::TMonumentShine(const char*) +104 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMapObjSmoke::load(JSUMemoryInputStream&) +92 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMareGate::loadAfter() +88 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMapObjSmoke::touchWater(THitActor*) +84 0.00% 100.00%
mario/MoveBG/MapObjDolpic TMapObjSmoke::control() +44 0.00% 100.00%
mario/MoveBG/MapObjDolpic TBellDolpic::touchPlayer(THitActor*) +36 0.00% 100.00%
mario/MoveBG/MapObjDolpic @32@__dt__14TMonumentShineFv +8 0.00% 100.00%
mario/MoveBG/MapObjDolpic @32@__dt__11TBellDolpicFv +8 0.00% 100.00%
mario/MoveBG/MapObjDolpic @32@__dt__14TDptMonteFenceFv +8 0.00% 100.00%
mario/MoveBG/MapObjDolpic @32@__dt__12TMapObjSmokeFv +8 0.00% 100.00%
mario/MoveBG/MapObjDolpic @32@__dt__9TMareGateFv +8 0.00% 100.00%

...and 3 more new matches

📈 12 improvements in unmatched items
Unit Item Bytes Before After
mario/MoveBG/MapObjDolpic .rodata +860 0.00% 99.54%
mario/MoveBG/MapObjDolpic TDemoCannon::perform(unsigned long, JDrama::TGraphics*) +548 0.00% 93.84%
mario/MoveBG/MapObjDolpic TBellDolpic::control() +519 0.00% 98.48%
mario/MoveBG/MapObjDolpic TMonumentShine::control() +409 0.00% 68.68%
mario/MoveBG/MapObjDolpic TBellDolpic::receiveMessage(THitActor*, unsigned long) +372 0.00% 98.94%
mario/MoveBG/MapObjDolpic TTurboNozzleDoor::touchPlayer(THitActor*) +308 0.00% 84.62%
mario/MoveBG/MapObjDolpic TBellDolpic::ring(const JGeometry::TVec3<float>&) +295 0.00% 71.84%
mario/MoveBG/MapObjDolpic TDemoCannon::initMapObj() +251 0.00% 72.41%
mario/MoveBG/MapObjDolpic TMonumentShine::hitByWater(THitActor*) +247 0.00% 62.38%
mario/MoveBG/MapObjDolpic TTurboNozzleDoor::loadAfter() +148 0.00% 42.53%
mario/MoveBG/MapObjDolpic .sdata2 +94 0.00% 90.57%
mario/MoveBG/MapObjDolpic .sbss 0 0.00% 11.76%

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