‹ BackHN Continuity

Thread

Resident Evil 4 (GameCube) – complete byte-identical decompilation to C/C++

140 points · 99 comments · metrofun

  1. wk_end · · focus · HN ↗
    From a preservation perspective, this is one of the least useful decomps ever, given how committed Capcom is to making sure RE4 is ported absolutely everywhere (kidding!)

    Made using the leaked debug build and its symbols, which shows how meaningful the work the game preservation community that acquires and distributes these things is.

    OTOH this is pretty off-putting:

    > Where the compiler needed a particular source shape to reproduce a register choice or a schedule and no natural spelling was found, the construct is marked with a // COMPILER-DIFF: comment (644 of them: dead tests, empty asm("") launders and anchors, register T x asm("rN") pins, padding statements).

    To me the value of a decomp isn't reproducing the original bytes per se (we already have the original bytes after all) - it's about reconstructing the understanding of the original game as represented by human-readable source code; getting byte-for-byte is just an indication that you've gotten it right. Needing to add a bunch of slop to force the compiler to match the original output is actually just an indication that you've gotten it wrong - and it's a demonstration of the danger of Goodhart's law, especially as it applies to AI.

    1. mitxela · · focus · HN ↗
      The OOT and MM decomp had a bruteforcer tool that would reorder lines until the register allocation matched.
      1. Sesse__ · · focus · HN ↗
        You&#x27;re probably thinking of <a href="https:&#x2F;&#x2F;github.com&#x2F;simonlindholm&#x2F;decomp-permuter" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;simonlindholm&#x2F;decomp-permuter, which is used across many more decomp projects (and can do a lot more than swap lines). It&#x27;s a huge help, but it&#x27;s by no means enough for all regalloc differences; there&#x27;s lots of stuff it cannot do.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.