Skip to content

System: audit factories and card state handling - #200

Open
KakarottoCake wants to merge 9 commits into
doldecomp:mainfrom
KakarottoCake:decomp-system-all
Open

KakarottoCake wants to merge 9 commits into
doldecomp:mainfrom
KakarottoCake:decomp-system-all

Conversation

@KakarottoCake

@KakarottoCake KakarottoCake commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Restore Boss Pakkun, TobiPuku, launcher manager, and PoiHanaRed factory cases; use the retail PalmNatume tree name.
  • Fix particle callback identity and color selection. Both functions now match exactly.
  • Build named scale, rotation, and translation vectors in evSetTransScale; it now matches exactly.
  • Correct first-time menu wave setup and the shine camera choice.
  • Initialize CardManager criteria and implement its empty load-index stub.
  • Store CameraMapTool pitch and yaw as angles, matching its System copy constructor.

Verification

  • Audited all 46 mario/System units. Exact functions: 401/595 -> 415/595.
  • Native bare Ninja build passes; changed lines pass clang-format and review-lint.
  • Symbol-order checks report no new regressions against the base revision.
  • PalmNatume's corrected default shifts constant relocations, lowering MapObj fuzzy by 0.013 points without losing an exact function. The CardManager fuzzy regression was removed.
  • No stack padding, dummy cases, or wrong constants were added.

@decomp-dev

decomp-dev Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Report for GMSJ01 (b7bed68 - b82434e)

📈 Matched code: 41.97% (+0.14%, +5092 bytes)
📈 Matched data: 63.13% (+0.06%, +364 bytes)

✅ 25 new matches
Unit Item Bytes Before After
mario/GC2D/Guide __sinit_Guide_cpp +764 0.00% 100.00%
mario/GC2D/Guide TGuide::checkPoint(int, int) +308 0.00% 100.00%
mario/GC2D/Guide TGuide::TGuide(const char*) +232 0.00% 100.00%
mario/GC2D/Guide .bss +184 0.00% 100.00%
mario/System/MarNameRefGen_Enemy .data +168 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TPoiHana::~TPoiHana() +156 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TTobiPuku::~TTobiPuku() +156 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TTobiPukuLaunchPad::~TTobiPukuLaunchPad() +132 0.00% 100.00%
mario/System/MarNameRefGen_Enemy THamuKuriLauncherManager::~THamuKuriLauncherManager() +116 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TNameKuriLauncherManager::~TNameKuriLauncherManager() +116 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TTobiPukuLaunchPadManager::~TTobiPukuLaunchPadManager() +116 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TTobiPukuManager::~TTobiPukuManager() +116 0.00% 100.00%
mario/GC2D/Guide TGuide::~TGuide() +116 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TLauncherManager::~TLauncherManager() +100 0.00% 100.00%
mario/GC2D/Guide SMS_getShineID(unsigned long, unsigned long, bool) +92 0.00% 100.00%
mario/GC2D/Guide TGuide::setup(JKRMemArchive*) +92 0.00% 100.00%
mario/GC2D/Guide TGuide::startMoveCursor() +20 0.00% 100.00%
mario/System/EmitterViewObj TMarioParticleManager::emitParticleCallBack(long, const JGeometry::TVec3<float>*, unsigned char, JPACallBackBase2<JPABaseEmitter*, JPABaseParticle*>*, const void*) +17 95.85% 100.00%
mario/System/MarNameRefGen TCameraMapTool::TCameraMapTool(const TCameraMapTool&) +10 91.72% 100.00%
mario/System/EventWatcher evSetTransScale(TSpcTypedInterp<TEventWatcher>*, unsigned long) +9 99.46% 100.00%
mario/GC2D/Guide .sbss +8 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TEnemyManager::changeDrawBuffer(unsigned long) +4 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TEnemyManager::restoreDrawBuffer(unsigned long) +4 0.00% 100.00%
mario/GC2D/Guide .ctors +4 0.00% 100.00%
mario/System/EmitterViewObj SMSSetEmitterPolColor(JPABaseEmitter*, int) +2 99.44% 100.00%
📈 17 improvements in unmatched items
Unit Item Bytes Before After
mario/GC2D/Guide TGuide::load(JSUMemoryInputStream&) +2498 0.00% 97.45%
mario/System/MarNameRefGen_Enemy TMarNameRefGen::getNameRef_Enemy(const char*) const +685 56.84% 65.01%
mario/GC2D/Guide .rodata +334 0.00% 95.14%
mario/System/MarNameRefGen_Enemy .rodata +321 72.94% 79.73%
mario/System/MarNameRefGen_BossEnemy TMarNameRefGen::getNameRef_BossEnemy(const char*) const +205 35.50% 43.18%
mario/System/MarNameRefGen_BossEnemy .rodata +170 45.42% 55.39%
mario/GC2D/Guide .data +159 0.00% 76.47%
mario/GC2D/Guide .sdata2 +124 0.00% 70.59%
mario/System/MarNameRefGen_Enemy .sdata2 +7 61.84% 64.85%
mario/GC2D/Guide TGuide::resetObjects() +4 0.00% 0.44%
mario/GC2D/Guide TGuide::resetScore() +4 0.00% 0.17%
mario/GC2D/Guide TGuide::placeMario() +4 0.00% 0.67%
mario/GC2D/Guide TGuide::appearGuidePane(int) +4 0.00% 0.42%
mario/GC2D/Guide TGuide::linkSelect() +3 0.00% 0.13%
mario/GC2D/Guide TGuide::changeBotStatus(int) +3 0.00% 0.25%
mario/GC2D/Guide TGuide::perform(unsigned long, JDrama::TGraphics*) +3 0.00% 0.22%
mario/System/MenuDir TMenuDirector::direct() 0 99.16% 99.17%
📉 1 regression in an unmatched item
Unit Item Bytes Before After
mario/System/MarNameRefGen_MapObj TMarNameRefGen::getNameRef_MapObj(const char*) const -3 85.87% 85.86%

Report for GMSP01 (b7bed68 - b82434e)

📈 Matched code: 41.02% (+0.12%, +4308 bytes)
📈 Matched data: 54.94% (+0.06%, +364 bytes)

✅ 17 new matches
Unit Item Bytes Before After
mario/GC2D/Guide __sinit_Guide_cpp +764 0.00% 100.00%
mario/GC2D/Guide TGuide::checkPoint(int, int) +308 0.00% 100.00%
mario/GC2D/Guide TGuide::TGuide(const char*) +232 0.00% 100.00%
mario/GC2D/Guide .bss +184 0.00% 100.00%
mario/System/MarNameRefGen_Enemy .data +168 0.00% 100.00%
mario/GC2D/Guide TGuide::~TGuide() +116 0.00% 100.00%
mario/System/MarNameRefGen_Enemy THamuKuriLauncherManager::~THamuKuriLauncherManager() +116 0.00% 100.00%
mario/System/MarNameRefGen_Enemy TNameKuriLauncherManager::~TNameKuriLauncherManager() +116 0.00% 100.00%
mario/GC2D/Guide SMS_getShineID(unsigned long, unsigned long, bool) +92 0.00% 100.00%
mario/GC2D/Guide TGuide::setup(JKRMemArchive*) +92 0.00% 100.00%
mario/GC2D/Guide TGuide::startMoveCursor() +20 0.00% 100.00%
mario/System/EmitterViewObj TMarioParticleManager::emitParticleCallBack(long, const JGeometry::TVec3<float>*, unsigned char, JPACallBackBase2<JPABaseEmitter*, JPABaseParticle*>*, const void*) +17 95.85% 100.00%
mario/System/MarNameRefGen TCameraMapTool::TCameraMapTool(const TCameraMapTool&) +10 91.72% 100.00%
mario/System/EventWatcher evSetTransScale(TSpcTypedInterp<TEventWatcher>*, unsigned long) +9 99.46% 100.00%
mario/GC2D/Guide .sbss +8 0.00% 100.00%
mario/GC2D/Guide .ctors +4 0.00% 100.00%
mario/System/EmitterViewObj SMSSetEmitterPolColor(JPABaseEmitter*, int) +2 99.44% 100.00%
📈 18 improvements in unmatched items
Unit Item Bytes Before After
mario/GC2D/Guide TGuide::load(JSUMemoryInputStream&) +2498 0.00% 97.44%
mario/System/MarNameRefGen_Enemy TMarNameRefGen::getNameRef_Enemy(const char*) const +685 56.84% 65.01%
mario/GC2D/Guide .rodata +325 0.00% 94.50%
mario/System/MarNameRefGen_Enemy .rodata +321 72.94% 79.73%
mario/System/MarNameRefGen_BossEnemy TMarNameRefGen::getNameRef_BossEnemy(const char*) const +213 40.64% 49.74%
mario/System/MarNameRefGen_BossEnemy .rodata +163 45.87% 56.71%
mario/GC2D/Guide .data +159 0.00% 76.47%
mario/GC2D/Guide .sdata2 +124 0.00% 70.59%
mario/System/MarNameRefGen_Enemy .sdata2 +8 60.49% 63.47%
mario/GC2D/Guide TGuide::resetObjects() +4 0.00% 0.44%
mario/GC2D/Guide TGuide::resetScore() +4 0.00% 0.17%
mario/GC2D/Guide TGuide::startMoveCursor2() +4 0.00% 1.10%
mario/GC2D/Guide TGuide::appearGuidePane(int) +4 0.00% 0.42%
mario/GC2D/Guide TGuide::linkSelect() +3 0.00% 0.13%
mario/GC2D/Guide TGuide::changeBotStatus(int) +3 0.00% 0.25%
mario/GC2D/Guide TGuide::placeMario() +3 0.00% 0.66%
mario/GC2D/Guide TGuide::perform(unsigned long, JDrama::TGraphics*) +3 0.00% 0.26%
mario/System/MenuDir TMenuDirector::direct() +1 97.65% 97.66%
📉 1 regression in an unmatched item
Unit Item Bytes Before After
mario/System/MarNameRefGen_MapObj TMarNameRefGen::getNameRef_MapObj(const char*) const -2 85.35% 85.33%

{
}
};

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.

Don't add classes to random unrelated files -- this should live in HamuKuri/NameKuri headers respectively

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