Repository navigation
overlay: SN cc1 from source, walloper beam and more level code in C, hero names - #248
Open
mateuszklysz wants to merge 41 commits into
Open
mateuszklysz wants to merge 41 commits into
mateuszklysz wants to merge 41 commits into
Conversation
Both call the update through moby_call_update: retail leaves the beqz and jalr delay slots empty and keeps the pointer in v1, which no C call gives.
Decompilation progress
8 newly matched functions (19,072 B)
Compared with main (2d6fb52). C_FUZZY uses main's last measurement. |
mateuszklysz
marked this pull request as draft
October 24, 2026 05:34
The exact forms needed inline asm for the update call, which PLAYBOOK section 0 and the cleanup guide do not allow.
FUN_L08_002f5e58 draft moves from 609 to 148 differing words on the SN route.
The M671 debug strings name 0x70/0x74 as texture w/h counts; the commando grid draft shares the flicker mesh pvars and now uses the same names and the point light slots instead of sound names.
# Conflicts: # src/overlays/l08/gameplay/entities/commando.c
The slot position at 0x10 is now a PointLight field, so the commando grid draft uses the same global and type as update_flickering_mesh_effect.
SN's cc1.exe is GCC 2.95.2 with the Cygnus R5900 back end. Rebuild it from gcc-2.95.2 plus patches/sn-2.95.2: without the 2.95.3 reload fix (sce-991111b 0062) it gives the same .s as cc1.exe for all 180 units. With it, FUN_L05_0030de90 and FUN_L10_002dcc58 match and move to C.
mateuszklysz
marked this pull request as ready for review
October 24, 2026 14:52
mateuszklysz
marked this pull request as draft
October 24, 2026 14:55
…(same size as retail)
The point count comes after the three floats in the parameter list, as in rac1-decomp; that order alone gives retail's register choice, so the zero-term Fakematch and the temp block go.
hero.joint_matrices holds the 9 joint world matrices at 0xAC0 and item_defs rows name the joint an item follows (0x0C).
The beam rotation globals are floats everywhere, the two arc timer tables are .sdata short arrays in devastator too, and the arc points use one name. The walloper draft declares the particle spawn with the argument order other callers use.
Beam and side points are addressed from the beam array per segment, the arc counter is declared first and unused locals are gone. The NON_MATCHING body is now 3 rows from retail (was 18).
…pdate_mpeg_frame_size
The loop counter row is declared last and a marked fakematch block sizes the gcse hash table, so the frame slots of x - 16 and row + 1 land in retail order.
The tube ring loop indexes the ring grid as rows of 20 points, the form the snagglebeast rope update uses for its own rings.
The sda .extern hoist looked for a function definition only under its
asm label. A function renamed to a C name with __asm__("FUN_...") was
not found, so a late .extern moved and the unit grew.
Names come from what each function does, checked against our code. Also finishes the hero field renames in the level copies.
mateuszklysz
force-pushed
the
decomp/c-exact-99
branch
from
October 26, 2026 10:50
1f382a6 to
db998ee
Compare
mateuszklysz
marked this pull request as ready for review
October 26, 2026 10:53
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SN cc1 from source
The level units in
OVERLAY_SN_UNITSno longer use SN'scc1.exe. They use the same compiler built from source:scripts/build-sn-compiler.pybuilds gcc-2.95.2 with the R5900 back end of the EE archive, four patches frompatches/sce-991111b/and the seven inpatches/sn-2.95.2/.setup.shruns it (about 30 s).overlay-snruns SN's preprocessor, then thiscc1. SN's driver andPs2EeAsstay.0062(the gcc-2.95.3 reload fix), the output equalscc1.exeon all 180 units. Each SN patch is needed: leaving one out changes 3 to 49 units.patches/sn-2.95.2/README.mdhas the details.0062too. With it,FUN_L05_0030de90(electric_gate) andFUN_L10_002dcc58(platform) match and move to C.Level code in C
build_beam_and_arc_pointsanddraw_scrolling_ribbon_colored.pyrocitor_update, the hero item slot pose updateFUN_L00_0020f580,reveal_map_around_positionand the nanotech ball suction tube update.link_and_update_all_mobysandupdate_visible_resident_objects.Near-miss drafts
FUN_L00_002648e0stays in asm. Retail leaves both delay slots around the update call empty; C here always fills one.FUN_L08_002f5e58(draw_flickering_mesh_effect, commando grid), the suction tube ring loop,render_vendor_buy_label_pass,update_mpeg_frame_size,sceCdInitand_getRef0drafts are closer to retail.Names
unkXXXfields inHero,HeroMotion,HeroItemSlot,HeroEase,HeroManipulator,HeroHealthandPadState, named from their uses.padless-asm.pynow also finds a function defined under its C name with__asm__("FUN_..."). Before, renaming such a function moved a late.externand changed the unit's size.make elf,make overlays,make checkandcheck-cleanup.pypass.