The Legend of Zelda: A Link to the Past Decompilation project emerges

legend-of-zelda-a-link-to-the-past---button-3-1559683061447.jpg

Out of the blue, and without any kind of mention, a mostly complete decompilation project coded in C/C++ from the SNES classic, The Legend of Zelda: A Link to the Past, has emerged on GitHub under the MIT license.

The project was released around 9 days ago, on August 14th, and seems to be playable from start to end.
Right now the decompilation is compatible with Windows (compilable with Visual Studio) and Linux (using SDL2 and Python).
At the moment, only keyboard is supported for controls, but those interested in contributing can do so through GitHub.

As with other decompilation projects, the repository doesn't include any of the original game's assets.
The project requires you to previously own and provide your own A Link to the Past ROM to extract all of the game's assets and begin the compilation afterwards.

:arrow: Link (no pun intended):
https://github.com/snesrev/zelda3
 

Kwyjor

Well-Known Member
Member
Joined
May 23, 2018
Messages
4,323
Trophies
1
XP
4,460
Country
Canada
I'm sure the project itself could benefit a lot from a performance boost if it shifts libraries to OpenGL instead of SDL2.
That'll help it run in a wide variety of devices with decent performance I'm guessing.
The whole point to SDL is that it allows something to be run on a wide variety of devices, isn't it?
 
  • Like
Reactions: cearp and godreborn

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,196
Trophies
1
Age
40
Website
github.com
XP
2,451
Country
Netherlands
I don't know if there could be a gui, because you do need sdl2.dll in the system32 or sysWOW64 folders depending on which version you're using. they used 2.20 iirc. the other stuff could be done, but that is a requirement.
Detect if sdl2.dll is in %windir%\SysWOW64\
If folder not found:
%windir%\System32\
If not:
Download sdl2.dll
Move sdl2.dll to %windir%\SysWOW64
regsvr32 %windir%\SysWOW64\sdl2.dll
If failed:
Move sdl2.dll to %windir%\System32
regsvr32 %windir%\System32\sdl2.dll
I mean a GUI like sm64pcbuilder2.
If there's anything illegal by such a script, tell me.
%windir% can also be replaced with %systemroot% it seems (no idea wich one is better to use)
 
Last edited by JaapDaniels,
  • Like
Reactions: godreborn

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
Detect if sdl2.dll is in %windir%\SysWOW64\
If folder not found:
%windir%\System32\
If not:
Download sdl2.dll
Move sdl2.dll to %windir%\SysWOW64
regsvr32 %windir%\SysWOW64\sdl2.dll
If failed:
Move sdl2.dll to %windir%\System32
regsvr32 %windir%\System32\sdl2.dll
I mean a GUI like sm64pcbuilder2.
If there's anything illegal by such a script, tell me.
%windir% can also be replaced with %systemroot% it seems (no idea wich one is better to use)
no, it's not hard to compile if you have vs 2022. you need the vc version to get the libraries to build, then, at least with mine, the SDL2.dll for (x86), which goes in the system32 folder.
 

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,196
Trophies
1
Age
40
Website
github.com
XP
2,451
Country
Netherlands
I just checked if it worked. I don't know.
Got it fullscreen with a small mod to main.cpp line 55:
SDL_Window* window = SDL_CreateWindow("Zelda3", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1920, 1080, SDL_WINDOW_FULLSCREEN_DESKTOP);
The resoluttion is disregarded though.
You can remover _DESKTOP and the resolution doesn't seem to improve by altering it, the end result is the same...
Is there anyone able to make a better mod?
  • With possible switching between fullscreen and windowed mode).
  • Smooth scaling or better resolution.
Thanks in advance.
Made a fork for it see: githublink
It should now have controller support and work in fullscreen.
 
Last edited by JaapDaniels,
  • Like
Reactions: godreborn

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
Got it fullscreen with a small mod to main.cpp line 55:
SDL_Window* window = SDL_CreateWindow("Zelda3", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1920, 1080, SDL_WINDOW_FULLSCREEN_DESKTOP);
The resoluttion is disregarded though.
You can remover _DESKTOP and the resolution doesn't seem to improve by altering it, the end result is the same...
Is there anyone able to make a better mod?
  • With possible switching between fullscreen and windowed mode).
  • Smooth scaling or better resolution.
Thanks in advance.
Made a fork for it see: githublink
It should now have controller support and work in fullscreen.
just tested your mod:

1661607291224.png
 

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,196
Trophies
1
Age
40
Website
github.com
XP
2,451
Country
Netherlands
Thanks!
My first github project, and it worked! (kinda)
Really hope someone can get a beter scale/interpolation funcion and the option to switch between fullscreen and windowed mode.
But this works for now.
main.cpp is where SDL2 gets started it seems, here is difined how to display, how sound is defined and where your controller input is written.
Ohh and a big failure is savegames... restarting the game will be a clean startup each time...
Savestate and savegame function didn't seem to work for me, is there anyone here who know how the snes emulator saves and load SRM (SRAM savegames)? that would be a cool thing to add.
Each time you start the game now it starts with a clean SRAM, while on the snes the SRAM is kept life by a battery.
i am really new to this so i really don't know what i'm doing right now, but could this initation of ram be set to overwrite itself while ingame, or when exiting? that should make the original way of savegame working.
and can someone please help me with switch option in window mode:
  • Fullscreen: SDL_Window* window = SDL_CreateWindow("Zelda3", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 512, 480, SDL_WINDOW_FULLSCREEN_DESKTOP);
  • Windowed: SDL_Window* window = SDL_CreateWindow("Zelda3", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 512, 480, SDL_WINDOW_RESIZABLE);
Both lines work for me in main.cpp, but it would be great to be able to switch between modes with ALT+ENTER in-game.
 
Last edited by JaapDaniels,
  • Like
Reactions: godreborn

LuigiXHero

Well-Known Member
Member
Joined
Dec 16, 2014
Messages
183
Trophies
0
XP
1,132
Country
United States
Not a decomp dunno why gbatemp is constantly wrong about stuff like this and doesn't fix it when people point it out. This is a reimplentation. The original game was not programmed in c++. Basically means the creator took the disassembly and rewrote the code in c++. Also should probably mention its for pc. Decomp doesn't mean pc port either.
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
Not a decomp dunno why gbatemp is constantly wrong about stuff like this and doesn't fix it when people point it out. This is a reimplentation. The original game was not programmed in c++. Basically means the creator took the disassembly and rewrote the code in c++. Also should probably mention its for pc. Decomp doesn't mean pc port either.
maybe they didn't know? the article is by a developer, who may not be able to change the title name. I know that normal users can't, but that is a suggestion I would have for temp, the ability to change say a thread name or even an article, so that staff don't have to do it when mistakes are made. I know you can do this on psx-place under mod tools with only threads you've created.
 

ShadowOne333

QVID PRO QVO
OP
Editorial Team
Joined
Jan 17, 2013
Messages
12,214
Trophies
2
XP
34,226
Country
Mexico
Not a decomp dunno why gbatemp is constantly wrong about stuff like this and doesn't fix it when people point it out. This is a reimplentation. The original game was not programmed in c++. Basically means the creator took the disassembly and rewrote the code in c++. Also should probably mention its for pc. Decomp doesn't mean pc port either.
maybe they didn't know? the article is by a developer, who may not be able to change the title name. I know that normal users can't, but that is a suggestion I would have for temp, the ability to change say a thread name or even an article, so that staff don't have to do it when mistakes are made. I know you can do this on psx-place under mod tools with only threads you've created.

godreborn is right, I wrongly used the word "decomp" because that's what most people nowadays think alongside PC ports (which btw ALttP works on PC now with this implementation).
By the time I wanted to change the title, I couldn't anymore, since GBATemp doesn't allow the OPs to change the title of the thread once it has been created.

So if any mods see this, perhaps @linuxares, if you could change the title from "decompilation" to "C/C++ language implementation" it'd be ideal, since it's the proper term here.
 
  • Like
Reactions: godreborn

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
godreborn is right, I wrongly used the word "decomp" because that's what most people nowadays think alongside PC ports (which btw ALttP works on PC now with this implementation).

By the time I wanted to change the title, I couldn't anymore, since GBATemp doesn't allow the OPs to change the title of the thread once it has been created.
it's a bit like saying cfw or jailbreak with the ps4 when neither term is accurate. I usually use the word exploit.
 
  • Like
Reactions: ShadowOne333

ShadowOne333

QVID PRO QVO
OP
Editorial Team
Joined
Jan 17, 2013
Messages
12,214
Trophies
2
XP
34,226
Country
Mexico
it's a bit like saying cfw or jailbreak with the ps4 when neither term is accurate. I usually use the word exploit.
Correct. In short, I went for "decomp" due to the familiarity of the word in recent events, but obviously "reimplementation" is the proper term.
Still, having the titled change by a mod should be neat :D
 
  • Like
Reactions: godreborn

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
Correct. In short, I went for "decomp" due to the familiarity of the word in recent events, but obviously "reimplementation" is the proper term.
Still, having the titled change by a mod should be neat :D
btw, what's odd about this build is that the location it searchs for the library files seems to be hard coded or something, because I changed the library location for dependencies, erased all the rest, as well as for include, but it didn't make any difference. it still looked in D/lib iirc. I don't know why, but I had to change the drive letter of one of my drives to make it work, then I changed it back. it happened both times I compiled it with the second being the full screen mod. no idea what was going on, because I didn't have this problem with sonic mania, and that requires three libraries instead of this one's one.
 

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,196
Trophies
1
Age
40
Website
github.com
XP
2,451
Country
Netherlands
@godreborn I've made an update to my fork trying to implement a toggle for fullscreen and windowed mode bij creating and reading an .ini file.
I used mINI lib for this, could you get anyone who understands this better to look at what i'm doing wrong?
Pressing PageDown should set fullscreen value in the .ini to 0 (so when restarting the game it should detect this as it should start in windowed mode).
Pressing PageUp should set fullscreen value in the .ini to 1 (so when restarting the game it should detect this as it should start in fullscreen mode)
 
Last edited by JaapDaniels,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • SylverReZ @ SylverReZ:
    @Sonic Angel Knight, Is that SAK I see. :ninja:
  • BigOnYa @ BigOnYa:
    What a weird game
  • K3Nv2 @ K3Nv2:
    Yeah I wanted to see shards of the titanic
  • BigOnYa @ BigOnYa:
    I kept thinking jaws was gonna come up and attack
  • K3Nv2 @ K3Nv2:
    Jaws is on a diet
  • K3Nv2 @ K3Nv2:
    Damn power went out
  • BigOnYa @ BigOnYa:
    Ok xdqwerty, your little bro prob tripped On the cord and unplugged you
  • K3Nv2 @ K3Nv2:
    Ya I'm afraid of the dark hug me
  • BigOnYa @ BigOnYa:
    Grab and hold close your AncientBoi doll.
  • K3Nv2 @ K3Nv2:
    Damn didn't charge my external battery either
  • BigOnYa @ BigOnYa:
    Take the batteries out of your SuperStabber3000... Or is it gas powered?
  • K3Nv2 @ K3Nv2:
    I stole batteries from your black mamba
    +1
  • K3Nv2 @ K3Nv2:
    My frozen food better hold up for an hour I know that
  • BigOnYa @ BigOnYa:
    Or else gonna be a big lunch and dinner tomorrow.
  • BigOnYa @ BigOnYa:
    Did you pay your power bill? Or give all yo money to my wife, again.
  • K3Nv2 @ K3Nv2:
    Oh good the estimated time is the same exact time they just said
    +1
  • BigOnYa @ BigOnYa:
    Load up your pc and monitor, and head to a McDonalds dining room, they have free WiFi
  • K3Nv2 @ K3Nv2:
    Sir please watch your porn in the bathroom
    +1
  • BigOnYa @ BigOnYa:
    No sir we can not sell you anymore apple pies, after what you did with the last one.
  • K3Nv2 @ K3Nv2:
    We ran out
  • HiradeGirl @ HiradeGirl:
    for your life
    +1
  • K3Nv2 @ K3Nv2:
    My life has no value my fat ass is staying right here
    K3Nv2 @ K3Nv2: My life has no value my fat ass is staying right here