Decompilation progress report for The Legend of Zelda: Twilight Princess.
Given how fervent Zelda fans are, we’ll see PC ports pretty fast I think.
Decompilation progress report for The Legend of Zelda: Twilight Princess.
Given how fervent Zelda fans are, we’ll see PC ports pretty fast I think.
Eli5?
Source code is just text with special grammar rules, that’s easy for a human to read and think about. But it’s not possible for a computer to execute source code directly.
So it’s run through a “compiler”, which takes the text and compiles it into binary machine code (x86 Assembly). This is what gets written to the CD and shipped
“decompilation” is the process of starting from the raw machine code, and trying to figure out what source code text could have generated that machine code.
Typically you use a tool that can do an initial decomp pass, but since it’s missing a lot of context, the resulting text is generally incomprehensible (and may not even fully compile). Variable
x123ieh48hdccould be Link’s velocity, the currently loaded map, or it could be a temporary scratch variableThe real challenge to decomp is figuring out which incomprehensible variable and function names actually correspond to in-game
(Note, usually “100% decomp” means they’ve fully translated machine code to source code. But there may still be large parts of the source code that remain incomprehensible. Ocarina of Time decomp still has sections like this)
The reason this is exciting, is because the source code is much easier to modify. So having 100% of the game in source code means you can do fancy things like PC source ports (even if some of the code remains incomprehensible, though i imagine that makes it more difficult)
They took the completed game and worked backwards to the underlying code that makes all of it work. They confirm it’s an exact match by using the code they worked backwards towards to make the game again and confirm they have an exact match to the orginal game file(s).
Once this is done, it is possible to change literally anything about the game, as you have access to the code that makes it work. One of the most popular things to do is to replace the parts of the code that are specific to the console it was originally made for with code that can run on PC. This results in an accurate PC version of the original game. After that, other coders usually dig into the PC “version” to add all sorts of easy modding support.
This has already been done with Super Mario 64, Ocarina of Time, and Star Fox 64, and they all have easily moddable PC versions now. This has resulted in things like Render96 and Ray Tracing support for SM64, a bunch of bug fixes and an insanely deep randomizer for OoT, and discovery of cut levels and entire game modes partially left in the game code that had only been mentioned in interviews in Star Fox 64.
It’s also worth noting that similar projects exist for a whole bunch of other games. The Pokemon Emerald Reverse Engineering project has allowed all the absurd new romhacks with new features like Mariomon and Too Many Types 2, with Pokemon having 3 types and a total of like 70 types in game. Similar (but technically different under the hood) projects for Sonic Unleashed and the Jak series on PS2 have resulted in great moddable PC versions of those as well.
The code for the game has been decompiled. From my understanding that means it’s now readable and can be ported over to other places with some work. What that means is that a true “PC Version” can be made, which will have the ability to support things like widescreen/high resolution, high framerates, native keyboard/controller support as well as whatever mods people feel like developing (new maps, new modes, etc) - in the case of Mario 64, when this happened people got to work on a Multiplayer version, which works really well. So it opens up a lot of possibilities.
PC ports incoming.
Before running, code is adapted to specific systems in a proces that also obfuscates it. It’s very difficult to reverse engineer that process, but once you do, the door is open to adapt the code to run on more systems.