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.
Submitted 20 hours ago by BurgerBaron@piefed.social to retrogaming@lemmy.world
https://decomp.dev/zeldaret/tp
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. Variable x123ieh48hdc could be Link’s velocity, the currently loaded map, or it could be a temporary scratch variable
The 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)
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.
looking forward to the day of a community built proper remaster
And then you 100.00% recompile it with the Legend of Zelda: Ocarina of Time and Legend of Zelda: Majora’s Mask to find out what kind of huge Zelda Game could be created from all of that.
Is this the GameCube version?
https://github.com/zeldaret/tp
According to the repo, yep!
I’m sorry there’s an android version of Twilight princess?!
Is Rev 2 when they patched the exploit that was allowing people to jailbreak their Wiis?
Being able to aim with a mouse on a PC port will be a godsend
Important
This repository does not contain any game assets or assembly whatsoever. An existing copy of the game is required.
This project itself is not, and will not, produce a port, to PC or any other platform. It is a decompilation of the original game code, which can be compiled back into a binary identical to the original.
This makes a port possible. You need to replace the graphics and system API calls to make a port to another platform and you need to pull in the assets.
Being able to replace the bow with link’s erect dick and the arrows with a bunch of piss is what I’m most looking forward to.
Rule34?
Yay!
What does the biggest green block contain? 🤔 How does it faste like?
framework/d/actor/d_a_link. Can’t say anything about the taste.
d_a_link? I’m gonna guess it tastes like sausage.
Hell yeh
Nice!
Why is the thumbnail a market share to growth graph?
This kind of graphs are used for other things too. You’ll see it if you open the link.
Is decomp.dev supposed to be down?
bytesonbike@discuss.online 4 hours ago
I used to do this with Gameboy roms in the late 90s! I can’t remember which emulator, I think it was No$Gameboy or something that had a hex editor and I manually started changing bits and documenting what it did. Spent like a week just touching every digit, changing something documenting.
I didn’t even understand hexadecimal at the time either so it wasn’t even scientific.