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

53 points - today at 5:38 PM

Source

Comments

groundzeros2015 today at 7:31 PM
I opened a file at random. This looks more like emulating the behavior in compilable C syntax rather than recovering the game's programming

void Em1eWeaponSet(cEm10* em) { Em10Work* w = EM10_WK(em);

    w->mot[41] = 0;
    w->mot[42] = 0;
    …
    w->mot[62] = 0;
    w->mot[63] = ARC(0x26C);
    w->mot[64] = ARC(0x26D);
    w->mot[65] = ARC(0x276);
    w->mot[66] = ARC(0x277);
    w->mot[67] = 0;
    w->mot[68] = 0;
    w->mot[69] = ARC(0x26A);
    w->mot[70] = ARC(0x26B);
    w->mot[71] = ARC(0x270);
    w->mot[72] = ARC(0x271);
    w->mot[73] = ARC(0x272);
    w->mot[74] = ARC(0x273);
    w->mot[75] = ARC(0x274);
    w->mot[76] = ARC(0x275);
    w->mot[77] = 0;
    w->mot[78] = 0;
}
shakna today at 8:52 PM
CC0, on the decompilation of a copyrighted work? That's... Not the way it works.

You inherit the copyright from the original, as this is derivative.

There's a reason decompilation has always been a grey area of seeing whether or not the copyright holder cares.

wk_end today at 6:23 PM
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.

Dwedit today at 8:32 PM
The real question is if it's relocatable or not (still works correctly if you add or remove bytes)
LaurensBER today at 6:37 PM
Despite all "hate" against AI in the (retro)-gaming scene I'm genuinely excited to see these kind of projects (not sure if this one involved any kind of AI) and emulation.

From a technical perspective emulation is absolutely amazing, it requires deep technical knowledge, an excellent understanding of the source system and the optimisations are on another level.

mikae1 today at 6:34 PM
I'm so emotionally torn about all the awesome decompilation work done.

Too bad all the cool decompilation is happening for games on early 3D centric consoles. I say this a Quake fanatic. Low res textures combined with that blurry bilinear style filtering is a look that's not easy to love. It's just a generational thing I guess.

ricardobeat today at 6:26 PM
“byte-identical” is one of Claude’s favorite expressions
deleted today at 6:13 PM
sharktheone today at 7:07 PM
I hope that the CC0 license doesn't make any problems. It might though since decompilation does not remove the copyright of Capcom. Maybe just hope that they just don't care anymore
davikr today at 6:22 PM
How many tokens and which models were used?
sick_of_slop today at 6:29 PM
[dead]