this post was submitted on 23 Dec 2025
506 points (99.8% liked)

RetroGaming

26125 readers
748 users here now

Vintage gaming community.

Rules:

  1. Be kind.
  2. No spam, AI slop, or soliciting for money.
  3. No racism or other bigotry allowed.
  4. Obviously nothing illegal.

If you see these please report them.

founded 2 years ago
MODERATORS
 

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.

all 36 comments
sorted by: hot top controversial new old
[–] oopsgodisdeadmybad@lemmy.zip 3 points 14 hours ago (1 children)

The best part of these efforts is getting to pay without the console lag.

Playing the Aquas level on the Star Fox recompiled version at full speed felt amazing, like scratching an itch that had been out of reach for decades.

[–] BurgerBaron@piefed.social 3 points 11 hours ago* (last edited 11 hours ago)

GCN was double buffered vsync for all games I think yeah. The console has 60ms of latency even on a CRT. Dolphin emulator, their latest progress report went over some efforts to combat that with frame buffer tricks. A PC port of course will beat that.

[–] bytesonbike@discuss.online 8 points 21 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.

[–] TargaryenTKE@lemmy.world 14 points 1 day ago (4 children)
[–] Lightfire228@pawb.social 40 points 1 day ago* (last edited 1 day ago)

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 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)


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)

[–] wizardbeard@lemmy.dbzer0.com 23 points 1 day ago

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.

[–] MIDItheKID@lemmy.world 8 points 1 day ago

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.

[–] cholesterol@lemmy.world 4 points 1 day ago

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.

[–] KonalaKoala@lemmy.world 27 points 1 day ago (1 children)

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.

[–] MeowerMisfit817@lemmy.world 8 points 1 day ago (1 children)

The Legend Of Zelda: The Princess' Ocarina of Majora's.

[–] Lightfire228@pawb.social 5 points 1 day ago (1 children)

LoZ: Twilight Majora's Ocarina

[–] Signtist@bookwyr.me 3 points 22 hours ago

The Legend of Zelda: Majora's Twilight Ocarina Mask of Princess Time

[–] turkalino@sh.itjust.works 20 points 1 day ago (2 children)

Being able to aim with a mouse on a PC port will be a godsend

[–] Zacryon@feddit.org 18 points 1 day ago (1 children)

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.

https://github.com/zeldaret/tp

[–] eRac@lemmings.world 10 points 23 hours ago

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.

[–] krooklochurm@lemmy.ca 12 points 1 day ago (2 children)

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.

[–] turkalino@sh.itjust.works 2 points 13 hours ago

erect

piss

???

[–] _Nico198X_@europe.pub 3 points 21 hours ago

looking forward to the day of a community built proper remaster

[–] Link@rentadrunk.org 52 points 1 day ago (1 children)

Is this the GameCube version?

[–] BurgerBaron@piefed.social 57 points 1 day ago* (last edited 1 day ago) (3 children)

https://github.com/zeldaret/tp

"GameCube releases is completely matching"

The project can target the following supported versions:

GZ2E01: GameCube - North America  
GZ2P01: GameCube - Europe/Australia  
GZ2J01: GameCube - Japan  
RZDE01_00: Wii - North America (Rev 0)  
RZDE01_02: Wii - North America (Rev 2)  
RZDP01: Wii - Europe/Australia  
RZDJ01: Wii - Japan  
Shield: Nvidia Shield - China  
ShieldD: Nvidia Shield - China (Debug Version)  

More complicated than I thought, but I think this means GCN is furthest along?

[–] 9point6@lemmy.world 9 points 1 day ago (1 children)

I'm sorry there's an android version of Twilight princess?!

[–] Uruanna@lemmy.world 13 points 1 day ago* (last edited 1 day ago) (1 children)

Nintendo got a Gamecube emulator running on the NVidia Shield, in China only. The version of TP released on it got upscaled textures - different from the Wii U HD version. Never went anywhere else. This was around 2019. I never heard of any particular difference, it was just an emulator after all.

Looking up more details - the emulator came out with TP and a couple other games in late 2017, and the upscaled textures were udpated in 2019.

[–] 9point6@lemmy.world 3 points 1 day ago* (last edited 1 day ago)

Ahhh that makes a bit more sense but a cool bit of trivia at least.

I know the shield uses the same processor as the switch 1 (or something very similar), so I wondered if there was a chance of an actual native port, but then I guess we'd have also seen a switch native version in that case

[–] Link@rentadrunk.org 14 points 1 day ago (1 children)

Thank you. No Wii U version?

[–] BurgerBaron@piefed.social 26 points 1 day ago

Updated my comment there's more to it I guess.

No Wii U version.

[–] turkalino@sh.itjust.works 2 points 1 day ago

Is Rev 2 when they patched the exploit that was allowing people to jailbreak their Wiis?

[–] BilSabab@lemmy.world 4 points 1 day ago
[–] C1pher@lemmy.world 5 points 1 day ago* (last edited 1 day ago) (1 children)

What does the biggest green block contain? 🤔 How does it taste like?

[–] Chais@sh.itjust.works 5 points 1 day ago (1 children)

framework/d/actor/d_a_link. Can't say anything about the taste.

[–] edgemaster72@lemmy.world 4 points 1 day ago

d_a_link? I'm gonna guess it tastes like sausage.

[–] kersplomp@piefed.blahaj.zone 3 points 1 day ago

Is decomp.dev supposed to be down?