Zelda 64 has been fully decompiled, potentially opening the door for mods and ports
After nearly two years, a fan group fully reproduced the N64 classic in C code this week
A fan group has successfully reverse-engineered 100% of Legend of Zelda: Ocarina of Time’s game code, VGC has been told.
The community-led Zelda Reverse Engineering Team (ZRET) has been working for nearly two years to reverse engineer the N64 classic into parsable C code, which can be read by modern computers, similar to how fans were able to fully convert Super Mario 64 in 2019, after a two-year effort.
The achievement marks a huge milestone for the preservation of the classic Nintendo 64 game, and opens the door to modding, hacks and potentially even ports to other platforms such as PC (though it’s worth stressing, none of this is within the remit of ZRET).
Zelda: Tears of the Kingdom guides:
Zelda Tears of the Kingdom Amiibo unlocks | Zelda Tears of the Kingdom Master Sword location | How to increase inventory space in Zelda Tears of the Kingdom | How to increase hearts and stamina in Zelda Tears of the Kingdom | How to catch a Horse in Zelda Tears of the Kingdom
The kind of reverse engineering ZRET do is made legal because the fans involved did not use any leaked content. Instead, they painstakingly recreated the game from scratch using modern coding languages. The project also does not use any of Nintendo’s original copyrighted assets such as graphics or sound.
ZRET told VGC: “It’s been a wild ride. We’ve been able to create c code that, when compiled, reproduces the original game. We call this ‘matching’ decompilation.
“Last night, Fig, who is a notable community member as well as a project lead, matched the last-remaining function in the project. This means that all compiled code in the game has been turned into human-readable C code.
“We thought for a time that we may never be able to match every function completely, so this is an incredibly exciting accomplishment. Dozens of people helped work on this project, and together we were able to achieve something amazing.”
ZRET said that the final part of its progress is currently on a development branch.
Before the Ocarina of Time work is solidified, the project lead will need to submit his work via what’s known as a “pull request”, it told VGC. After that, the work needs to be thoroughly reviewed. Once that’s done, it will merge this pull request, and the ZRET website’s graph will show 100%.
But even though the game’s code has been fully decompiled, there’s still a lot of remaining work for the ZRET team including creating documentation, re-naming and re-organisation of code and definitions, and support for asset-handling so viewing or modifying on modern computers is easier.
The group also plans to decompile other versions of Ocarina of Time in order to support the project. The core of ZRET’s work was based on the Nintendo GameCube Master Quest version of the game, since it features some debug commands to help with its work.
“We have been working on decompiling the Master Quest Debug version of the game. However, Ocarina of Time has over a dozen other versions, which we plan to also decompile and support in the project,” it said.
However, many consumers will be interested if – or more likely, when – the decompilation will lead to a fully functioning PC port of Zelda, like it did with Super Mario 64 last year.
ZRET’s Ocarina of Time decomp is not a port and it’s adamant that it will not be involved in any potential work to adapt the game’s code to new platforms.
However, in the case of Super Mario 64’s decompilation efforts, the project led to another group creating a fully functioning PC port of the N64 game within nine months, which is able to scale to any screen resolution and be easily modded by the community with new graphics and modern effects such as ray-tracing.
Eventually, fans even ported that game to many other platforms including Nintendo DSi, Nintendo 3DS and Nintendo Switch.
Outside of potential PC ports, the Zelda: Ocarina of Time decompilation project could have huge implications for hacks, as well as historical preservation and the discovery of new bugs which could be utilised by the speedrunning community.
In news unrelated to the reverse engineering project, Earlier this year, a group of video game preservationists discovered and released a partial beta version of Ocarina of Time, allowing fans to recover a significant amount of new information about the pre-release version including new areas, redesigned items and other elements that never made it into the final build.
Content from the beta version was eventually used by fans to recreate an early Space World demo from 1997, which was released this month and runs via emulator.