Skip to content

Decompile the effect_025 overlay - #82

Merged
roengstrom merged 3 commits into
mainfrom
decomp-effect_025
Sep 8, 2026
Merged

Decompile the effect_025 overlay#82
roengstrom merged 3 commits into
mainfrom
decomp-effect_025

Conversation

@roengstrom

Copy link
Copy Markdown
Owner

Decompile all functions for the Cura effect

Cura's 137 functions are C, so the overlay owns its source outright. It runs
the same engine as effect_001, so the types both copies need move up into
effect.h, and the GTE macros its emitters use join the rest in inline_c.h.
What is left is Cura's own: eight prim emitters, two UV-scroll walkers, the
pose walker and the scripts that drive them. D_801EEA0C, the draw-mode word
those emitters write with, gets a declaration beside the other draw-state
words.

MulMatrix0 and SetDrawMode were being called with no prototype in scope.
Both are declared where the rest of their SDK header lives.

The overlay's integer divisions carry the range checks the original build
emitted with $at free, so it needs maspsx --expand-div. ASPSX chose those
checks per assembler invocation, so whether a `div` carries them belongs to
the object rather than to a filename. Counted over the shipped code, every
effect overlay is uniform -- 198 expanding and 70 not -- so those are keyed by
binary; every other overlay is bare, and SLUS_008.92 is the one binary whose
own objects disagree, so its sources take a per-source override instead. A
list of source paths cannot express that: one engine source is linked into
overlays from both sets, ten functions already ship in both spellings, and a
split source would inherit nothing. The rule runs in both toolchain branches,
so a PsyQ 4.3 source in the mixed binary cannot lose the flag silently.

The battle screen tint gets a type on the way. D_800EF738 is four 0x2C-byte
entries the battle loop steps every frame; bc_object10 and bc_object14 walked
them with hand-written offsets and now go through a BattleTint struct in
battle.h. D_800EEC5C was declared three times in two types, and the two array
spellings reached it through a cast at four sites -- one declaration in
battle.h drops the casts, and the three bits the C sources test get
placeholder names.
@roengstrom roengstrom self-assigned this Sep 8, 2026
@decomp-dev

decomp-dev Bot commented Sep 8, 2026

Copy link
Copy Markdown

Report for SLUS_008.92 (61c4ec3 - a484402)

Total code: 1212520 bytes (+33540 bytes)
Total functions: 4673 (+137)
📈 Matched code: 47.61% (+1.49%, +33540 bytes)
Total data: 26536 bytes (+204 bytes)
📈 Matched data: 57.60% (+0.33%, +204 bytes)

✅ 140 new matches
Unit Item Bytes Before After
ovl/effect_025/effect_025 func_801A120C +3664 0.00% 100.00%
ovl/effect_025/effect_025 func_801A6354 +1468 0.00% 100.00%
ovl/effect_025/effect_025 func_801A4548 +1120 0.00% 100.00%
ovl/effect_025/effect_025 func_801A36B4 +1016 0.00% 100.00%
ovl/effect_025/effect_025 func_801A4174 +980 0.00% 100.00%
ovl/effect_025/effect_025 func_801A3DD4 +928 0.00% 100.00%
ovl/effect_025/effect_025 func_801A3320 +916 0.00% 100.00%
ovl/effect_025/effect_025 func_801A6A00 +872 0.00% 100.00%
ovl/effect_025/effect_025 func_801A2FE8 +824 0.00% 100.00%
ovl/effect_025/effect_025 func_801A3AAC +808 0.00% 100.00%
ovl/effect_025/effect_025 func_801A0D9C +748 0.00% 100.00%
ovl/effect_025/effect_025 func_801A2D08 +736 0.00% 100.00%
ovl/effect_025/effect_025 func_801A49A8 +596 0.00% 100.00%
ovl/effect_025/effect_025 func_801A26DC +588 0.00% 100.00%
ovl/effect_025/effect_025 func_801A58D4 +532 0.00% 100.00%
ovl/effect_025/effect_025 func_801A6164 +496 0.00% 100.00%
ovl/effect_025/effect_025 func_801A4D9C +424 0.00% 100.00%
ovl/effect_025/effect_025 func_801A4BFC +416 0.00% 100.00%
ovl/effect_025/effect_025 func_801A05A0 +400 0.00% 100.00%
ovl/effect_025/effect_025 func_801A0730 +396 0.00% 100.00%
ovl/effect_025/effect_025 func_801A21C0 +396 0.00% 100.00%
ovl/effect_025/effect_025 func_801A5F14 +384 0.00% 100.00%
ovl/effect_025/effect_025 func_801A7BA8 +368 0.00% 100.00%
ovl/effect_025/effect_025 func_801A7390 +360 0.00% 100.00%
ovl/effect_025/effect_025 func_801A014C +336 0.00% 100.00%
ovl/effect_025/effect_025 func_801A0000 +332 0.00% 100.00%
ovl/effect_025/effect_025 func_801A0B6C +324 0.00% 100.00%
ovl/effect_025/effect_025 func_801A205C +316 0.00% 100.00%
ovl/effect_025/effect_025 func_801A2510 +316 0.00% 100.00%
ovl/effect_025/effect_025 func_801A234C +308 0.00% 100.00%

...and 110 more new matches

Signed-off-by: rengstrom <engstrom.robin@gmail.com>
The objdiff generator was extended on both sides. main gave it --expected and
the target_path() fallback, so the report keeps working on a tree with no
expected/; this branch gave it effect_categories(), so the report covers every
effect overlay the build produced rather than a hand-kept list. They touch the
same two places without contradicting each other, so both stay: target_path()
decides what a unit points at, effect_categories() decides which binaries the
report covers.
@roengstrom
roengstrom merged commit f29ce8d into main Sep 8, 2026
1 check passed
@roengstrom
roengstrom deleted the decomp-effect_025 branch September 8, 2026 17:01
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