Skip to content

C morph ball extract inline helpers + label data reinterpretation - #61

Merged
Antidote merged 10 commits into
PrimeDecomp:mainfrom
ShulkMaster:CMorphBall
Aug 4, 2026
Merged

C morph ball extract inline helpers + label data reinterpretation#61
Antidote merged 10 commits into
PrimeDecomp:mainfrom
ShulkMaster:CMorphBall

Conversation

@ShulkMaster

Copy link
Copy Markdown
Contributor
  • Replace raw Morph Ball glow byte arrays with typed RGB color palettes.
  • Add reusable helpers for glow and ambient color conversion.
  • Refactor Morph Ball glow, transition flash, and lighting code to use the new helpers.
  • remove raw pointers arithmetic while preserving matching compiler output.

@decomp-dev

decomp-dev Bot commented Jul 30, 2026

Copy link
Copy Markdown

Report for GM8E01_48 (7c3d8a7 - b941c2b)

No changes

Report for GM8E01_00 (7c3d8a7 - b941c2b)

📈 Matched code: 37.05% (+0.00%, +144 bytes)

✅ 1 new match
Unit Item Bytes Before After
main/MetroidPrime/Player/CMorphBall CMorphBall::RenderMorphBallTransitionFlash(const CStateManager&) const +2 98.89% 100.00%
📈 2 improvements in unmatched items
Unit Item Bytes Before After
main/MetroidPrime/Player/CMorphBall CMorphBall::Render(const CStateManager&, const CActorLights*) const +3 99.42% 99.50%
main/MetroidPrime/Player/CMorphBall CMorphBall::PreRender(CStateManager&, const CFrustumPlanes&) +1 99.46% 99.53%

Report for GM8E01_01 (7c3d8a7 - b941c2b)

📈 Matched code: 35.88% (+0.00%, +144 bytes)

✅ 1 new match
Unit Item Bytes Before After
main/MetroidPrime/Player/CMorphBall CMorphBall::RenderMorphBallTransitionFlash(const CStateManager&) const +2 98.89% 100.00%
📈 1 improvement in an unmatched item
Unit Item Bytes Before After
main/MetroidPrime/Player/CMorphBall CMorphBall::PreRender(CStateManager&, const CFrustumPlanes&) +1 99.46% 99.53%

@Antidote

Copy link
Copy Markdown
Collaborator

LGTM, I'll see if I can find the names for those globals in either the map or Remastered so we can get those updated as well.

@ShulkMaster

Copy link
Copy Markdown
Contributor Author

LGTM, I'll see if I can find the names for those globals in either the map or Remastered so we can get those updated as well.

sure, thanks. I have no idea what to name them.

@Antidote

Antidote commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator
skBallBoostedHullGlowColors 
skBallBoostedHullGlowIntensities 
skBallBoostedSwooshColors 
skBallBoostedSwooshIntensity 
skBallDamagedHullFlashIntensities 
skBalllceModels 
skBallLightColors 
skBallLightningSwooshColors 
skBallNormalSwooshColors 
skBallNormalSwooshIntensity 
skGlassModels 
skInnerGlowBoostedIntensityPrimary 
skInnerGlowBoostedLightInnerAngle 
skInnerGlowBoostedLightInnerRadius 
skInnerGlowBoostedLightIntensity 
skInnerGlowBoostedLightOuterAngle 
sklnnerGlowBoostedLightRadius 
skInnerGlowNormalIntensityPrimary 
skInnerGlowNormalLightInnerAngle 
skInnerGlowNormalLightInnerRadius 
skInnerGlowNormalLightIntensity 
skInnerGlowNormalLightOuterAngle 
sklnnerGlowNormalLightRadius 
skLowPolySpiderBalls 
skNormalBallColorindices 
skNormalBalls 
skNormalLowPolyBalls 
skSpiderBallColorIndices 
skSpiderBalls 
skSwooshHorizontalOffset 
skSwooshVerticalOffset 

this is what I was able to recover from Remastered, unfortunately the audio lookup tables don't have names, but we can use context clues to come up with our own.

Oh, they're all located in the CMorphBall class, so they can be moved there instead of that unnamed namespace, that also includes the related helpers, they can be static members functions for each table rather than taking the table as an argument, that's how Retro usually handles utilities like this.

@ShulkMaster

Copy link
Copy Markdown
Contributor Author

I have move the statics variables from a NS into the class as static members, following the sk retro naming convention + name based on apparent usage

@ShulkMaster
ShulkMaster marked this pull request as ready for review August 1, 2026 18:34
@Antidote

Antidote commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Can you rebase against main?

@Antidote
Antidote merged commit d9c3c4b into PrimeDecomp:main Aug 4, 2026
3 checks passed
@ShulkMaster
ShulkMaster deleted the CMorphBall branch August 4, 2026 16:55
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