Skip to content

[WIP] GeographyObjMgr - MapObj Classes#49

Draft
MB60893 wants to merge 33 commits into
doldecomp:mainfrom
MB60893:GeoObjMgr-Templates
Draft

[WIP] GeographyObjMgr - MapObj Classes#49
MB60893 wants to merge 33 commits into
doldecomp:mainfrom
MB60893:GeoObjMgr-Templates

Conversation

@MB60893

@MB60893 MB60893 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Note

Keeping this as a draft (work in progress) for now, as there are many classes associated with GeographyObjMgr that could be added to make this a complete PR.

Additionally, some fixes need to be made where there are register mismatches or functions that remain difficult to decompile. See comments in second paragraph below.

GeographyObjMgr - MapObj Classes

This PR contains many classes associated with the GeographyObjMgr class. These classes are typically prefixed by "MapObj" or "TMapObj" followed by the name of the object associated with the courses' geometry.

The majority of the code in this PR is ready to merge, with a few missing functions for ones I couldn't match, or that have minor issues such as register mismatches. These can be found by searching through the commits for this exact string: // FIX: , which will show all the places that are problematic.

Additionally, I'm still not totally across how to fully match the various .data, .bss, .rodata (etc...) segments to get a complete match. That's on me for being new to this. Regardless, I'll keep churning out the functions and I can revisit things later with some assistance.

MB60893 added 30 commits May 22, 2026 17:40
…s that exist as part of the `GeographyObjMgr`.

Something useful is that each of these functions contains the size that the respective class it calls should be, meaning we can determine if the classes being called are missing members. Nice!
…apObjDonkyRock::start()` has a `JUT_ASSERT` specifically referencing this property with the name `mPathID`. Renaming existing implementations to match this.
Note there are a few minor register mismatches, but the majority of the code is a match.
Note one isssue around `mAnmCtrl->ChangeTransAnm(0);` - where it looks like this function may cause some register mismatches.
These were previously decompiled by Sware, so only the import and object creation is present in this commit.
…e that these are inlines used by Coord3DUtil, so it shouldn't impact overall match.
This is a complete match for the class, excluding the last part of `TFreeFallShakeSky::reflect()` where there is a register mismatch.
This includes classes `TMapObjSkyShip`, `TMapObjPathYoshiHeli`, `TMapObjMashBalloon` and `TMapObjUFO`.
There is only one minor  mismatch with `TMapObjUFO::initFunc_Wait()`.
…uired by MapObjGeyser to pass onto `TMapObjHioNode` and, subsequently, `GeographyObj`.
A few function offsets are wrong, but each function matches otherwise.
…elated to creatures in the geography of maps.
Note that `TMapObjSnowRock::hitCheck()` has a register mismatch, probably due to a temporary TVec3f, which I wasn't able to solve.
There are a few things left to do with this class; specifically I gave up trying to get `TTestString::drawNode` to match, and there is a register mismatch on `TTestStrBarrel::checkItemHitting()`.
Note the two register mismatches in `TMapObjHeyho::hitCheck()` and `TMapObjSubHeyho::doFunc_Recover()`.

The `hitCheck` mismatch looks similar to what I've seen in a few other functions, and I'm guessing it's just down to how the TVec3f methods or overloads are being called; I just can't work out the combination to use.

The `doFunc_Recover` function looks like it uses a slerp/nlerp function; but I couldn't work this one out either - maybe something is missing from the JSystem's TQuat4f implementation?
MB60893 added 3 commits July 23, 2026 19:26
…re to have return type of `JPABaseEmitter *`.

This is used by MapObjFireObj in the `TMapObjKpFireBarBall::calc()` function.
@decomp-dev

decomp-dev Bot commented Jul 23, 2026

Copy link
Copy Markdown

Report for MarioClub_us (8a91a6b - 4a3e5b1)

📈 Matched code: 48.07% (+2.36%, +75988 bytes)
📈 Matched data: 24.51% (+0.61%, +5652 bytes)

✅ 615 new matches
Unit Item Bytes Before After
main/Shiraiwa/MapObjBubble TMapObjBubble::doFunc_Jump() +1600 0.00% 100.00%
main/Shiraiwa/MapObjDonkyRock TMapObjDonkyRock::move_FallDown(JGeometry::TVec3<float>&) +1540 0.00% 100.00%
main/Shiraiwa/MapObjHeyho .data +1088 0.00% 100.00%
main/Shiraiwa/MapObjSnowRock TMapObjSnowRock::doKartColCallBack(int) +952 0.00% 100.00%
main/Shiraiwa/MapObjHeyho __sinit_MapObjHeyho_cpp +900 0.00% 100.00%
main/Shiraiwa/TestString TTestStrBarrel::doKartColCallBack(int) +828 0.00% 100.00%
main/Shiraiwa/MapObjSkyShip TMapObjPathYoshiHeli::aimVelDir() +820 0.00% 100.00%
main/Shiraiwa/TestString TTestString::reset() +780 0.00% 100.00%
main/Shiraiwa/MapObjDossun __sinit_MapObjDossun_cpp +708 0.00% 100.00%
main/Shiraiwa/MapObjSnowRock TMapObjSnowRock::checkItemHitting() +708 0.00% 100.00%
main/Shiraiwa/Coord3DUtil TFreeFall::getReflect(const JGeometry::TVec3<float>&, JGeometry::TVec3<float>*) +668 0.00% 100.00%
main/Shiraiwa/Coord3DUtil TFreeFallShakeSky::getReflect(const JGeometry::TVec3<float>&, JGeometry::TVec3<float>*) +668 0.00% 100.00%
main/Shiraiwa/MapObjGeyser __sinit_MapObjGeyser_cpp +668 0.00% 100.00%
main/Shiraiwa/Coord3DUtil TFreeFall::reflect(const JGeometry::TVec3<float>&) +656 0.00% 100.00%
main/Shiraiwa/TestString TTestString::drawPrism(JGeometry::TVec3<float>&, JGeometry::TVec3<float>&, JGeometry::TVec3<float>&, JGeometry::TVec3<float>&, JGeometry::TVec3<float>&) +656 0.00% 100.00%
main/Shiraiwa/Coord3DUtil TPathWalk::dirUpdate() +652 0.00% 100.00%
main/Shiraiwa/TestString TTestStrBarrel::calc() +652 0.00% 100.00%
main/Shiraiwa/Coord3DUtil TFreeFallShakeSky::rotate() +628 0.00% 100.00%
main/Shiraiwa/Coord3DUtil TFreeFall::rotate() +616 0.00% 100.00%
main/Shiraiwa/MapObjHeyho TMapObjHeyho::doFunc_BombEnd() +600 0.00% 100.00%
main/Shiraiwa/MapObjHeyho TMapObjSubHeyho::makeFrontMtx(JGeometry::TPosition3<JGeometry::TMatrix34<JGeometry::SMatrix34C<float>>>*) +596 0.00% 100.00%
main/Shiraiwa/MapObjHeyho TMapObjHeyho::initFunc_Bomb() +592 0.00% 100.00%
main/Shiraiwa/TestString TTestStrItem::calc() +588 0.00% 100.00%
main/Shiraiwa/MapObjSkyShip TMapObjPathYoshiHeli::reset() +584 0.00% 100.00%
main/Shiraiwa/MapObjBubble TMapObjBubble::reset() +572 0.00% 100.00%
main/Shiraiwa/Coord3DUtil TFreeFly::posUpdate() +568 0.00% 100.00%
main/Shiraiwa/MapObjHeyho TMapObjHeyho::doFunc_Bomb() +568 0.00% 100.00%
main/Shiraiwa/MapObjBubble .data +536 0.00% 100.00%
main/Shiraiwa/MapObjHeyho TMapObjHeyho::TMapObjHeyho(const CrsData::SObject&) +528 0.00% 100.00%
main/Shiraiwa/MapObjSkyShip TMapObjSkyShip::reset() +524 0.00% 100.00%

...and 585 more new matches

📈 73 improvements in unmatched items
Unit Item Bytes Before After
main/Shiraiwa/Coord3DUtil TFreeFallShakeSky::reflect(const JGeometry::TVec3<float>&) +1320 0.00% 99.71%
main/Shiraiwa/MapObjDossun TMapObjDossun::reset() +872 0.00% 99.64%
main/Shiraiwa/MapObjHeyho TMapObjSubHeyho::doFunc_Recover() +858 0.00% 99.81%
main/Shiraiwa/MapObjDonkyRock TMapObjDonkyRock::setStartVel() +855 0.00% 99.51%
main/Shiraiwa/MapObjGeyser TMapObjGeyser::doFunc_JumpDown() +791 0.00% 99.94%
main/Shiraiwa/MapObjGeyser .data +726 0.00% 68.30%
main/Shiraiwa/MapObjSkyShip .data +667 0.00% 77.31%
main/Shiraiwa/MapObjDonkyRock TMapObjDonkyRock::getReflect(JGeometry::TVec3<float>&, JGeometry::TVec3<float>&) +510 0.00% 99.03%
main/Shiraiwa/MapObjDossun .data +492 0.00% 64.06%
main/Shiraiwa/MapObjDonkyRock .data +485 0.00% 99.59%
main/Shiraiwa/TestString .data +477 0.00% 99.58%
main/Shiraiwa/MapObjGeyser TMapObjGeyser::doFunc_JumpUp() +439 0.00% 99.95%
main/Shiraiwa/MapObjGeyser TMapObjGeyser::doFunc_JumpStay() +439 0.00% 99.95%
main/Shiraiwa/MapObjHeyho TMapObjHeyho::hitCheck(TMapObjHeyho*) +422 0.00% 99.53%
main/Shiraiwa/MapObjSnowRock TMapObjSnowRock::hitCheck(TMapObjSnowRock*) +418 0.00% 99.52%
main/Shiraiwa/MapObjGeyser TMapObjGeyser::playEmitter(unsigned long, const JGeometry::TVec3<float>&) +415 0.00% 99.94%
main/Shiraiwa/MapObjGeyser TMapObjGeyser::moveEmitter(unsigned long, const JGeometry::TVec3<float>&) +411 0.00% 99.94%
main/Shiraiwa/TestString TTestStrBarrel::checkItemHitting() +396 0.00% 99.00%
main/Shiraiwa/MapObjGeyser .rodata +388 0.00% 97.04%
main/Shiraiwa/MapObjSnowRock .data +356 0.00% 72.95%
main/Shiraiwa/MapObjDossun .rodata +295 0.00% 97.30%
main/Shiraiwa/MapObjDonkyRock TMapObjDonkyRock::start() +291 0.00% 99.78%
main/Shiraiwa/TestString .rodata +261 0.00% 68.17%
main/Shiraiwa/SmallAnimalGen .data +259 0.00% 98.48%
main/Shiraiwa/Coord3DUtil TFreeFall::init(JGeometry::TVec3<float>*, JGeometry::TVec3<float>*, JGeometry::TPosition3<JGeometry::TMatrix34<JGeometry::SMatrix34C<float>>>*) +235 0.00% 99.85%
main/Shiraiwa/TestString TTestStrSupervisor::load() +227 0.00% 99.88%
main/Shiraiwa/MapObjSnowRock TMapObjSnowRock::makeBreakEmitter() +215 0.00% 99.94%
main/Shiraiwa/MapObjHeyho .rodata +189 0.00% 98.95%
main/Shiraiwa/MapObjBubble TMapObjBubble::initFunc_Jump() +183 0.00% 99.91%
main/Shiraiwa/MapObjWluArrow .rodata +171 0.00% 97.60%

...and 43 more improvements in unmatched items

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.

1 participant