Skip to content

decomp: name unknown fields from evidence and define more data in C - #280

Merged
nickyyOO merged 213 commits into
mainfrom
decomp/unknown-names-and-data
Nov 6, 2026
Merged

nickyyOO merged 213 commits into
mainfrom
decomp/unknown-names-and-data

Conversation

@nickyyOO

@nickyyOO nickyyOO commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Before

The code had about 2200 placeholder names (unkXXX), many weak struct and function names, and level and boot data tables that were still bytes in asm. Data in C stood at 63.95 %.

After

Names. Placeholder names fell from about 2200 to 899. 309 of those are libmpeg internals with no public names.

  • Each new name comes from a reader in the code, the ReRAC notes (looked up by address), the SDK headers, or an in-game name.
  • Shared layouts replace local copies. For example, MobyTargetInfo at enemy pvars+0x20, GroundMoveControl, KnockbackMotion, HitColorFlash, and MobyHit attack_type/attack_subtype with the values each weapon writes.
  • Areas covered: Hero (about 200 fields), struct Moby, the menus, the follow, level and update cameras, the disc table, map, HUD, vendor, sound defs, rendering, and every level directory.
  • Weak names replaced:
    • l05 triggered_* are now hinged hatch, swinging flap, sliding block and water spout.
    • l08 moby_248 is now the blarg bomb, and l18 moby_568 the drifting mine. Their files are renamed to match.
    • The follow camera setters are named.
    • D_L05_0015FFD8 is now l05_moby_array.
  • What is left was looked at and is either only ever written (no reader anywhere), read only by asm or VU code, or has a reader that doesn't prove a meaning.

Data. Data in C went from 63.95 % to 77.18 %. New tables include:

  • the wrench swing trail meshes, the vendor item poses and parts, and the item preview placements;
  • the shrub class slots, the save block lists, the gadget preview bindings and the GS depth test packets;
  • the font glyph metrics, the vendor item prices and the map layer insets;
  • the HUD selector slot rings, the hero jump velocity keys, and the l06, l16 and l17 backdrop and reflection meshes.

Boot tables that the levels copy are also proven in every level, through exe_data.tsv.

Code stays 3547932 / 3547932 B.

Verification

  • make elf ends with baseline build OK, so the boot ELF matches retail
  • make overlays ends with PASS (3014 functions, 18869 copies, 24955 level data objects)
  • make check passes
  • scripts/check-cleanup.py --base origin/main: no new problems

Field names from the SIF RPC packet layout, the TTY handler's own
error strings (ti->wlen), newlib's FILE and _reent, and the memory card
RPC parameter blocks. init_moby_instance and process_menu_entry use the
struct Moby / MobyClass names and name their menu entry fields.
sceIpuRestartDMA takes the SDK's sceIpuDmaEnv, the BCD clock helpers
the sceCdCLOCK layout, sceDmaSend the channel's chcr/qwc/tadr; the SIF
command, load-module and close parameter blocks get names from their use.
update_camera_tracking_state names the hero motion it tracks (up vector,
move along and across it, the ground moby and its height step); the
controls help screen reads the left and right picture halves from the
disc table; the cutscene loader and the frame helper use struct Moby's
field names (lights, lod_dist, metal_alpha, pvars).
Camera mode, hidden and hand-item-hidden flags, the weapon raised and
lowered at a wall, wall and platform mobys, the magnetic floor, the
velocity curve, jump, swim, swing, wake and head-look fields, the
sound slot mobys and timers, each named from the code that reads and
writes it. Level code follows in the next commit.
lod_dist and metal_alpha come from the class header's lod_trans and
metal_count at init; seq_sound is the sequence's looping sound
(AnimSeq + 0x11, 0xFF none) that update_moby_voice plays; the class
header gains metal_count, lod_trans, shadow_count and glow_rgba.
…t fields

attach_manipulator names the manipulator node (joint list, target matrix,
next, rotation w, scale); the sky shells read the cluster header
(vertex/tri counts and offsets, data size); draw_config names the
switches the world draw reads (sky, effects, particles, sprites, hud,
screen overlays, aa blur); the resident render object uses struct
Moby's names (lights, lod_dist, metal_alpha, shadow_range, collision).
…es come from

check-unit copies the checkout's changed headers into the baseline
workspace and rebuilds the unit, so a header-only rename is measured
instead of the stale copy.
Puffoid, psytcopus, resort owner, teleporter, blarg ship, ammo crate and smaller l11 pvars: hit points, knockback motion block, path goal and reach, gates and volumes, teleporter destinations and part motion.
Veldin robot (ElectroidVars and its moby view), blarg trooper, extermitank, snagglebeast, blarg helicopter and blarg heavy interceptor pvars: knockback block, hit response class, manipulators, paths, velocities, voices and child mobys.
Grind speed and boost, rail jump arming, jump impulse and target height,
swing rope spring, wall push-out, face expression, item swap timers,
drone and suction slots, glow phases and more, each from what the code
does with the field or the hero block notes by address.
…ields

Offsets follow the moby animation and shadow notes: +0x5C rate, +0x60
pose layers, +0x84/+0x88 shadow slab, +0xA8 change counter, +0xAC grid
index, +0xBD shadow direction.
…m rate/flags; pad unread manipulator and move bytes
@nickyyOO nickyyOO added the enhancement New feature or request label Nov 6, 2026 — with Claude
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Decompilation progress

C_EXACT Change Matched bytes Functions C_FUZZY
All code 100.00 % — 3,547,932 / 3,547,932 B (—) 4,244 / 4,244 (—) 100.00 %
Boot executable 100.00 % — 354,504 / 354,504 B (—) 1,230 / 1,230 (—) 100.00 %
Game 100.00 % — 264,872 / 264,872 B (—) 850 / 850 (—) 100.00 %
SDK 100.00 % — 89,632 / 89,632 B (—) 380 / 380 (—) 100.00 %
Level overlays 100.00 % — 3,193,428 / 3,193,428 B (—) 3,014 / 3,014 (—) 100.00 %
Shared level code 100.00 % — 1,130,492 / 1,130,492 B (—) 1,583 / 1,583 (—) 100.00 %
Per-level code 100.00 % — 2,062,936 / 2,062,936 B (—) 1,431 / 1,431 (—) 100.00 %
Data in C Change Matched bytes
All data 77.18 % +13.23 pp 9,596,104 / 12,433,372 B (+1,645,412 B)
Boot executable 38.55 % +2.41 pp 269,525 / 699,136 B (+16,825 B)
Level overlays 79.48 % +13.88 pp 9,326,579 / 11,734,236 B (+1,628,587 B)

No function changed its match state compared with main (6513252).

Compared with main (6513252). C_FUZZY uses main's last measurement.

…, unproven l05 classes, Drek boss mine, bombthrower bomb
@nickyyOO
nickyyOO merged commit 5497cf4 into main Nov 6, 2026
3 of 4 checks passed
@nickyyOO
nickyyOO deleted the decomp/unknown-names-and-data branch November 6, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant