Resident Evil 4 (GameCube) – complete byte-identical decompilation to C/C++
53 points - today at 5:38 PM
SourceComments
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;
}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.
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.
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.
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.