The Legend of Zelda: A Link to the Past recreated on PC from reverse-engineered code

Alfonso Maruccia

Posts: 950   +293
Staff
In brief: Reverse engineering (RE) is a powerful weapon when used by retrogaming enthusiasts and capable programmers. A new RE project is breathing new life into one of the greatest games of all time, which can now run on modern PCs with no need for third-party SNES emulators.

The scene of reverse-engineered Zelda games welcomes a new member with the unofficial port of A Link to the Past, a game originally released for the Super Nintendo Entertainment System in 1991 (Japan) and 1992 (North America, Europe). A team of stubborn and passionate coders disassembled the game's original code, recreating it for PC operating systems and adding just the essential features needed to make users' lives a bit easier.

As explained on the project's official GitHub page, Zelda3 is a "reimplementation" of The Legend of Zelda: A Link to the Past, which is the third game in The Legend of Zelda series and the first to arrive on the SNES console. Zelda 3 introduced many of the staples adopted by later games in the series and is considered one of the best games ever made.

After the initial successful release for the Super Nintendo, A Link to the Past has been re-released on several Nintendo systems over the years, including Wii, Wii U, New Nintendo 3DS and finally the modern Switch console. The new reverse engineered effort, however, is something else and does things no other official re-release has ever done.

Zelda3 programmers disassembled the original code and then turned it into around 70-80,000 lines of C code, reimplementing all the parts of the original game, which is now playable "from start to end." The RE port includes SNES hardware-emulated components (namely the PPU and DSP) taken from the open-source, C-based SNES emulator LakeSnes.

The port also includes speed optimizations to improve performance over the original code, which fixes slowdowns and speeds up transition effects affecting the console version. Other quality-of-life updates include support for pixel shader and modern aspect ratios (16:9, 16:10) for prettier graphics, higher quality world map, support for external audio tracks, a secondary item slot on button X, and more.

Zelda3 can be configured to show the original machine code and the new C code running side by side, so that users can compare the RAM states of each version and see how they provide exactly the same gaming experience despite being designed to run in two completely different environments.

Zelda3 supports Windows, Linux, macOS and even homebrew-compatible Switch consoles, with instructions tailored for the game's installation on each compatible system. A copy of the game's original ROM is required (but of course not provided) to extract game assets (levels, images) that are not present in the port's code, so Nintendo won't try to sue the developers or send a cease & desist letter to GitHub for copyright infringement.

Permalink to story.

 
Nintendo lawsuit pending in 3..2...1... as far as I know, reverse engineering is not exactly legal. Although you have to admire the programmers, unless Nintendo greenlighted this, which is doubtful, it`s just a waste of time really, for aspect ratio and some minor gimmicks, because you could have played this illicitly anyway.
 
Nintendo lawsuit pending in 3..2...1... as far as I know, reverse engineering is not exactly legal. Although you have to admire the programmers, unless Nintendo greenlighted this, which is doubtful, it`s just a waste of time really, for aspect ratio and some minor gimmicks, because you could have played this illicitly anyway.

Not at all. Emulation and reverse engineering are perfectly legal, if you avoid using proprietary code or copyrighted assets like ROMs and such. That's the reason why Nintendo was able to shoot down many ROM distribution websites, but NES/SNES/Wii/Switch emulators and reverse-engineered versions of Zelda games are still here with us...
 
This was a really cool project. I'll probably download it tonight. Now we need someone to do the 3D code that was done for the original zelda game (Doom Style 3D fakery).
 
Is it really a copy of the original ROM - or just a emulator with the downloaded pirated ROM - best to say the first I suppose
 
Is it really a copy of the original ROM - or just a emulator with the downloaded pirated ROM - best to say the first I suppose

No, and no. There are emulated SNES hardware components to let the original program work as intended, but no ROM and no actual SNES generic emulation. It's a port.
 
No, and no. There are emulated SNES hardware components to let the original program work as intended, but no ROM and no actual SNES generic emulation. It's a port.

I understand that - but the article states you need an original copy of the rom to make it play - but would it know an original from a pirate version on an emulator to extract the assets ?
Plus pirates could take this source code - take the check part out and package it themselves I suppose
 
Man all you Nintendo going to sue ppl comments, did you read the article? Do you understand anything about emulation? Cmon man. You need to be better.
 
as far as I know, reverse engineering is not exactly legal.
Incorrect. Reverse Engineering is perfectly legal in many places in the world. It's what you do with it afterwards that some gray area takes hold...
 
Not at all. Emulation and reverse engineering are perfectly legal, if you avoid using proprietary code or copyrighted assets like ROMs and such
The reality of IP law is significantly more complex. Reverse engineering of functionality is legal -- except in the case of patented functionality* -- but a videogame contains images and screen layouts, a plot**, dialogue, the names of characters and items, any many other facets which are copyrightable (and in the case of Nintendo: copywritten).

(*) you can reverse-engineer it, you simply can't use it.
(**) in certain circumstances.
 
Last edited:
(*) you can reverse-engineer it, you simply can't use it.
Not true. You can reverse engineer and use your knowledge. You can even release that knowledge publicly as long as no proprietary information is released with in.

In the case of this PC conversion, code was reverse engineered by hand, not copied from source code, which Nintendo has not released. Therefore, it is safe from legal action by Nintendo. Nintendo can't touch them.
 
Not true. You can reverse engineer and use your knowledge.
Not if it's patented. And if using the knowledge results in a work that's nearly identical to the original, then it'll infringes on copyright and/or trademarks as well. Any patents on a '93 game will have long expired, but the other IP will remain.
 
Software patents do not exist without a hardware component.
I'm sorry, but this just isn't true at all. Countless software algorithms and procedures have been patented, such as the original Bresenham line algorithm and RSA encryption, along with more modern things such as H.264 video compression (which actually has an entire pool of patents).

(technically, "abstract ideas" cannot be patented, but there are numerous workarounds to this dodge, starting with the simple expedient of starting your patent application with "method and apparatus for ...."

Additionally, patents are equally open to reverse engineering.
Um, you don't **need** to reverse-engineer a patent -- it's published publicly. (that is, in fact, the entire reason patents exist: you trade public knowledge of your trade secret in exchange for a limited period of exclusive use). However, no one else can use innovation while the patent is in force, whether they reverse-engineered it, or simply read the patent filing.
 
I'm sorry, but this just isn't true at all.
Oh?
Countless software algorithms and procedures have been patented, such as the original Bresenham line algorithm and RSA encryption, along with more modern things such as H.264 video compression (which actually has an entire pool of patents).
All of which require specific hardware to function.
Um, you don't **need** to reverse-engineer a patent -- it's published publicly.
Incorrect.
 
All of which require specific hardware to function.
Have you never seen one of these patents? Software patents require nothing but a generic computing device. Whether you perform RSA encryption on a smart phone, a PC graphics card, or a two thousand year-old Chinese abacus-- the patent still applies.

Typically, boilerplate text such as this is included in the application (text from a line-drawing algorithm patent: https://patents.google.com/patent/US5815162A/en )

"While specific configurations and arrangements are discussed, it should be understood that this is done for illustrative purposes only. Persons skilled in the relevant art will recognize that other configurations and arrangements can be used without departing from the spirit and scope of the invention. It will be apparent to a person skilled in the relevant art that this invention can also be employed in a variety of other devices and applications."

Incorrect. [that patents are published publicly]
Is this a joke?
 
Seemingly. I'm making light of your appalling ignorance.
Oops again! From the USPTO (Patent Office):

"To obtain a valid patent, a patent application as filed must contain a full and clear disclosure of the invention... the specification must include a written description of the invention or discovery and of the manner and process of making and using the same, and is required to be in such full, clear, concise, and exact terms as to enable any person skilled in the art or science to which the invention or discovery appertains, or with which it is most nearly connected, to make and use the same...."

 
Oops again! From the USPTO (Patent Office):

"To obtain a valid patent, a patent application as filed must contain a full and clear disclosure of the invention... the specification must include a written description of the invention or discovery and of the manner and process of making and using the same, and is required to be in such full, clear, concise, and exact terms as to enable any person skilled in the art or science to which the invention or discovery appertains, or with which it is most nearly connected, to make and use the same...."

Oops indeed. Proper descriptions are required, intricate details and designs are NOT. You're missing the point and context yet again.
 
Proper descriptions are required, intricate details and designs are NOT.
Sorry, but you couldn't possibly be more wrong. Most patent applications include several, sometimes dozens or hundreds of "intricate designs" -- one at a minimum is specifically required:

608.01(p) "At least one specific operative embodiment or example of the invention must be set forth."

If the "intricate detail" is required to implement the invention, it must be included:

"The specification is a written description of the invention and of the manner and process of making and using the same.,,,it [must] contain sufficient information regarding the subject matter of the claims as to enable one skilled in the pertinent art to make and use the claimed invention..."

In fact, if your application leaves out any such detail, it can be challenged and invalidated:

":..If a disclosure is not sufficient, the claim may be rejected by the U.S. Patent and Trademark Office or later invalidated in post-grant proceeding or litigation..."

 
ZedRM and Endymio, please discontinue your personal argument. Take it to PM if you feel you must continue. Thank you.
 
Back