Skip to content

Decompile the effect_027 overlay - #87

Merged
roengstrom merged 5 commits into
mainfrom
decomp-effect_027
Sep 10, 2026
Merged

Decompile the effect_027 overlay#87
roengstrom merged 5 commits into
mainfrom
decomp-effect_027

Conversation

@roengstrom

Copy link
Copy Markdown
Owner

Fully decompile the full life effect overlay

Full-Life links eighteen of the library units, one fewer than effect_039: it
carries no lib/tint, driving the four D_800EF738 entries from its own opcode
handlers instead, and its entry sets up three task pools where Drain sets up
four. Ring sizes 0x31 and 0x8B.

100 of its 125 functions come from src/effect/lib and 23 more are bodies
already written for effect_001, effect_025, effect_028 and effect_052. The two
that are new are the entry point and the bank carve, which is effect_039's with
Full-Life's own constants.

func_801A9490 is the exception that has to be written out rather than ported:
it has the same shape as effect_025's func_801A548C but calls
effectDrawScriptRun where that one calls effectStepCounter, since Full-Life
links no lib/step. Masked bodies compare equal because call targets are
relocations, so the callee has to be read off the aligned symbol streams.

Nothing here belongs in the library. Six of the twenty-one bodies the library
does not own appear more than once inside a single overlay -- one no-op reaches
169 copies -- so they are copied script handlers, not linked members. The seven
that are single-copy everywhere still fail the test that decides it: a linked
object's members are always adjacent, whereas these keep different neighbours
in every program that carries them, and some appear without the members they
would share an object with.
@decomp-dev

decomp-dev Bot commented Sep 9, 2026

Copy link
Copy Markdown

Report for SLUS_008.92 (763b96a - 9cf9536)

Total code: 1506276 bytes (+39864 bytes)
Total functions: 5631 (+125)
📈 Matched code: 57.83% (+1.15%, +39864 bytes)
Total data: 27752 bytes (+160 bytes)
📈 Matched data: 59.46% (+0.24%, +160 bytes)

✅ 168 new matches
Unit Item Bytes Before After
ovl/effect_027/lib/spawn effectEmitterSpawn +2716 0.00% 100.00%
ovl/effect_027/lib/spawn effectEmitterSlide +2672 0.00% 100.00%
ovl/effect_027/lib/particlestep effectParticlePose +2368 0.00% 100.00%
ovl/effect_027/lib/particlestep effectParticleAdvance +2056 0.00% 100.00%
ovl/effect_027/lib/draw effectSpriteEmit +1580 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitGouraudTexQuads +1096 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitTexQuads +996 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitGouraudTexTris +956 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitTexTris +904 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitGouraudQuads +904 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitQuads +804 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitGouraudTris +776 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitTris +716 0.00% 100.00%
ovl/effect_027/lib/strands effectStrandsAim +712 0.00% 100.00%
ovl/effect_027/lib/drawscript effectDrawScriptStart +680 0.00% 100.00%
ovl/effect_027/lib/tables effectPoseTablesRelocate +676 0.00% 100.00%
ovl/effect_027/lib/spawn effectEmitterOnStrand +648 0.00% 100.00%
ovl/effect_027/lib/draw effectSpritePacket +616 0.00% 100.00%
ovl/effect_027/lib/entity effectUpdateModelBounds +588 0.00% 100.00%
ovl/effect_027/lib/emit effectEmitStream +580 0.00% 100.00%
ovl/effect_027/lib/list effectEmitterSetup +564 0.00% 100.00%
ovl/effect_027/lib/spawn effectEmitterOnOwner +528 0.00% 100.00%
ovl/effect_027/lib/packet effectBuildMeshPacket +520 0.00% 100.00%
ovl/effect_027/lib/spawn effectEmitterOnTrail +520 0.00% 100.00%
ovl/effect_027/effect_027 func_801A99C8 +496 0.00% 100.00%
ovl/effect_027/effect_027_entry func_801A0000 +492 0.00% 100.00%
ovl/effect_027/lib/vector effectBlendPointSets +404 0.00% 100.00%
ovl/effect_027/lib/common effectMatrixRotX +400 0.00% 100.00%
ovl/effect_027/lib/common effectMatrixRotY +396 0.00% 100.00%
ovl/effect_027/lib/entity effectSpawnTask +396 0.00% 100.00%

...and 138 more new matches

The four tint entries are walked through a cursor, so the loop index is never
read; it was written as a countdown only because that is the shape gcc emits.
The ascending form is what the surrounding handlers use and assembles the same.

lib/common.c keeps its countdown: that one indexes text[i] and fills the hex
digits from the least significant nibble, so its direction carries meaning.
Both walk a cursor and never read the index, which is exactly the shape that
invites rewriting them ascending. Doing so assembles differently and effect_025
stops matching, so the countdown has to stay and should say why.
Only effect_025 links these units today, so citing it as the thing that breaks
would read as if the other overlays were free to rewrite the loop. What holds
is that the ascending form generates different code.
Nothing else in the effect sources marks up code in a doc comment that way.
@roengstrom
roengstrom merged commit 24e6a06 into main Sep 10, 2026
1 check passed
@roengstrom
roengstrom deleted the decomp-effect_027 branch September 10, 2026 20:54
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