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
 

DaniPoo

Well-Known Member
Member
Joined
Jan 2, 2013
Messages
925
Trophies
1
Age
35
XP
2,296
Country
So many decompilation. I wonder how many of them are just Ghidra dumps...

Or it could just be that one decompilation project inspires another.

I am very much for these decompilation projects as it's very unlikely that nintendo will do this kind of work themselves.

For instance it allows us to create proper remasters of old classics.
60fps, widescreen, new models and HD textures with raytracing on a game like SM64 for example.

I find that extremely cool.

Of course I hope that everything is done in a legal fashion.
 
  • Like
Reactions: linuxares

ShadowOne333

QVID PRO QVO
OP
Editorial Team
Joined
Jan 17, 2013
Messages
12,220
Trophies
2
XP
34,363
Country
Mexico
FYI the graphics in 2D games (at least old school ones from older platforms) are NOT textures.
It irks me whenever someone says "textures" when referring to graphics of something from the SNES or NES.

They're sprites damnit :rofl2:
Textures are graphics you apply unto 3D objects or meshes to give the illusion of the object having an actual "texture" in real life.
Sprites are pixel graphics developed to work on 2D environments, flat out 2D images that behave as objects by themselves, not attached to anything 3D.

...or at least that's how I see it, feel free to argument on the matter, I'm all ears.
 
  • Like
Reactions: VinsCool and KiiWii

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,198
Trophies
1
Age
40
Website
github.com
XP
2,458
Country
Netherlands
Fixed it test my latest fork @ GitHub now with windowed mode (resizable) and fullscreen mode. Just the trigger of pageup and down is set for next start of the game (not reset, but fully closing the game and restarting it).
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
Fixed it test my latest fork @ GitHub now with windowed mode (resizable) and fullscreen mode. Just the trigger of pageup and down is set for next start of the game (not reset, but fully closing the game and restarting it).
I'm confused. your fork is missing files, so I don't know what to ditch and what to keep from the original master version.
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
Fixed it test my latest fork @ GitHub now with windowed mode (resizable) and fullscreen mode. Just the trigger of pageup and down is set for next start of the game (not reset, but fully closing the game and restarting it).
I wasn't able to compile your build due to it not finding ini.h for some reason. it's in the include folder, so something may be wrong with the cmake file. I was going to test out your mod, but I'll need information on what the problem is. btw, I compiled the new, official build, and it looks like they use nugets now instead of requiring you to download the sdl vc stuff yourself, so it's even easier to compile.
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,794
Trophies
2
Age
48
Location
Japan
XP
3,701
Country
United States
So for the devs among you, I found a bug that *should* be an easy fix. If you hard-reset (press "E"), the machine does not check for the cartridge save. It's annoying. You currently have to close the program and re-open it, to see the save in the game... Opened an issue in github.
 

Subway_Sandwich

Member
Newcomer
Joined
Mar 17, 2022
Messages
5
Trophies
0
Location
Denver NC
XP
56
Country
United States
Very excited, can't wait! I've always been trying to find a way to play Link to the Past, but I've personally been a bit unsuccessful. So, this should be useful. (Before replying please note that I do not have a lot of cash, and cannot afford a console for the game, nor the game itself. Not until my next payment at least.)
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,794
Trophies
2
Age
48
Location
Japan
XP
3,701
Country
United States
I was right. The save issue on hard reset was a 1-liner fix. Just had to re-read the sram on hard reset. That was already fixed, and it looks like another commit added gamepad support, since I first cloned and built it.
 

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,218
Country
Canada
FYI the graphics in 2D games (at least old school ones from older platforms) are NOT textures.
It irks me whenever someone says "textures" when referring to graphics of something from the SNES or NES.

They're sprites damnit :rofl2:
Textures are graphics you apply unto 3D objects or meshes to give the illusion of the object having an actual "texture" in real life.
Sprites are pixel graphics developed to work on 2D environments, flat out 2D images that behave as objects by themselves, not attached to anything 3D.

...or at least that's how I see it, feel free to argument on the matter, I'm all ears.
I could have sworn they were called "tiles", "characters" or typically "objects" :P

To be *fair* however, the way some of the graphics are used are indeed what a "texture" is by definition, so I wouldn't blame anyone (including myself) to use either word interchangeably, at the end, we understand what it is referring to, and that's what really matters.
 
  • Like
Reactions: ShadowOne333

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,198
Trophies
1
Age
40
Website
github.com
XP
2,458
Country
Netherlands
nm, I figured it out. however, it errors saying it can't find ini.h.
ini.h is in include\ini.h or you can add it from mINI's repo (adress is in the readme.md).
Aha, Cmake isn't updated at for i didn't use in is VS 2022, wiil add the lines for including SDL2 and mINI
Holy fuck it's changed from C++ version to C.
They rewrote about all i understood.
So, my version is not compitable with the original anymore, and i'm not sure i want to go that road.
I don't like it when you just go replace a project with a complete new one, it's confusing.
Since i just only tested the windows way to built with VS 2022 community, i don't know if cmake will make problems.
Should be included now if i understand cmake.
 
Last edited by JaapDaniels,

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,198
Trophies
1
Age
40
Website
github.com
XP
2,458
Country
Netherlands
I was right. The save issue on hard reset was a 1-liner fix. Just had to re-read the sram on hard reset. That was already fixed, and it looks like another commit added gamepad support, since I first cloned and built it.
Wait, tell me details, cause that's the next thing i wanna learn (since it's my first ever try at a c like language you'll notice it'll take time to catch up, but saving sram and reading sram again was the very next thing to fix, in the built i've seen it starts with cleaned ram and never checks if there's an update...
My built works with gamepad, and added windowed and fullscreen mode at full close and start (it reads it from an ini file).
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,794
Trophies
2
Age
48
Location
Japan
XP
3,701
Country
United States
Wait, tell me details, cause that's the next thing i wanna learn (since it's my first ever try at a c like language you'll notice it'll take time to catch up, but saving sram and reading sram again was the very next thing to fix, in the built i've seen it starts with cleaned ram and never checks if there's an update...
My built works with gamepad, and added windowed and fullscreen mode at full close and start (it reads it from an ini file).
Details? It’s literally 1 line, but that’s when it was working from a freshly opened instance. The function to check the sram was already in there, but not executed when using the hard reset. Plain as that. Just look at the commit history on github to see it. If your build doesn’t check sram at all, it’s going to take more than 1 line to add it in.
 
  • Like
Reactions: JaapDaniels

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,198
Trophies
1
Age
40
Website
github.com
XP
2,458
Country
Netherlands
Details? It’s literally 1 line, but that’s when it was working from a freshly opened instance. The function to check the sram was already in there, but not executed when using the hard reset. Plain as that. Just look at the commit history on github to see it.
Well when i made a fork it was all c++, they wiped it and started from scratch in C now, almost effery line is changed so, that's a hard reset for me.
And to be honest, i'm not interested in learning the complete set of programm languages, i'm interested to get to understand C++, soi already set my goal for a deep dive and a sharp learning curve going from turbo pascal (which i didn't practise for more than 20 years) over to C++.
But i'll try to find it, though i already seen they completely rewrote cart.cpp with cart.c...
I see what you mean, litterly one line in the C code, but, since i'm on the C++ flow, (see my fork) i'm not so sure that this one line will actually work for me.
I want the Sram to be saved on exit somehow... on reset it's working, but not on exit and restarting the game.
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,794
Trophies
2
Age
48
Location
Japan
XP
3,701
Country
United States
Well when i made a fork it was all c++, they wiped it and started from scratch in C now, almost effery line is changed so, that's a hard reset for me.
And to be honest, i'm not interested in learning the complete set of programm languages, i'm interested to get to understand C++, soi already set my goal for a deep dive and a sharp learning curve going from turbo pascal (which i didn't practise for more than 20 years) over to C++.
But i'll try to find it, though i already seen they completely rewrote cart.cpp with cart.c...
I see what you mean, litterly one line in the C code, but, since i'm on the C++ flow, (see my fork) i'm not so sure that this one line will actually work for me.
I want the Sram to be saved on exit somehow... on reset it's working, but not on exit and restarting the game.
All you had to do was search for the function. Does your code call the function in main.c around line 191? If so, then yes, it will take care of the issue. If not, the search shows which file currently has the function, so you can try to write it yourself.

EDIT: Yea, just looked at your fork. Big difference. Same concept, however. Figure out how the sram is initialized when you start the program, and make sure you’re calling that function on reset as well.
 

Attachments

  • C6942269-8A48-4E0E-9B7B-F606B61E11C6.png
    C6942269-8A48-4E0E-9B7B-F606B61E11C6.png
    581.2 KB · Views: 46
Last edited by urherenow,
  • Like
Reactions: JaapDaniels

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,198
Trophies
1
Age
40
Website
github.com
XP
2,458
Country
Netherlands
All you had to do was search for the function. Does your code call the function in main.c around line 191? If so, then yes, it will take care of the issue. If not, the search shows which file currently has the function, so you can try to write it yourself.

EDIT: Yea, just looked at your fork. Big difference. Same concept, however. Figure out how the sram is initialized when you start the program, and make sure you’re calling that function on reset as well.
main.cpp line 16 and 172 are talking about ram just not the same ram.
I think 172 is tha ram i should go for.
It goes to snes/cart.cpp and cart.h.
I see there's something called cart_saveload wich talks about the cart ram...
I think that's what i need to call to save and load the sram.
Reset save works in my fork, but really closing the game it does not work when starting the game again.
The save function that should be on shif+F# and load of F# somehow looks to do nothing (i think this was meant to be realtime-savestate).
So time to go puzzle later, tommorow i'll check.
After that an extra tool to configure keyboard and joypad, for you should be able to configure what button does what.
(i think i can use the config.ini for saving these settings).
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,138
Country
United States
ini.h is in include\ini.h or you can add it from mINI's repo (adress is in the readme.md).
Aha, Cmake isn't updated at for i didn't use in is VS 2022, wiil add the lines for including SDL2 and mINI
Holy fuck it's changed from C++ version to C.
They rewrote about all i understood.
So, my version is not compitable with the original anymore, and i'm not sure i want to go that road.
I don't like it when you just go replace a project with a complete new one, it's confusing.
Since i just only tested the windows way to built with VS 2022 community, i don't know if cmake will make problems.
Should be included now if i understand cmake.
I was never able to get your new version to work. Cmake files appear to be missing. I don't have a problem with the main branch. I compiled a newer version, which no longer requires you to download sdl2 vc iirc.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Psionic Roshambo @ Psionic Roshambo:
    That Dell data breach is worse than people probably realize....
  • Psionic Roshambo @ Psionic Roshambo:
    When I worked for Dell we had access to data about military contracts and addresses for high ranking people.
  • Psionic Roshambo @ Psionic Roshambo:
    I personally handled a call from the second highest person at Raytheon. That call bothered me a lot... The guy was nice and smart what bothered me was the way management basically just blew him off instead of going the extra mile to help him.
  • Psionic Roshambo @ Psionic Roshambo:
    In the end that call ended up costing Dell millions in lost contracts with Raytheon, and really the issue could have been solved for like 450 bucks lol
  • NinStar @ NinStar:
    sometimes I wonder why anyone would ever buy mega man x legacy collection 2
  • NinStar @ NinStar:
    I always thought that capcom shuffled the games in these collection, but apparently they are all in chronological order, which makes legacy collection 2 worthless
  • BakerMan @ BakerMan:
    guys, i want to start singing pirate metal songs and sea shanties if i play sea of thieves
  • The Real Jdbye @ The Real Jdbye:
    find a pirate metal playlist
    +2
  • The Real Jdbye @ The Real Jdbye:
    and sing along
  • BakerMan @ BakerMan:
    nevermind i just learned swearing is against the rules in sea of thieves

    i was about to start singing the song i last put in "what song are you currently listening to" yesterday
  • BakerMan @ BakerMan:
    but yeah ig so
  • The Real Jdbye @ The Real Jdbye:
    swearing not allowed in a pirate game? what has the world come to
  • BakerMan @ BakerMan:
    (here's the song for context)
  • BigOnYa @ BigOnYa:
    Just add -izle to the end of every curse word, you will be fine.
    +2
  • The Real Jdbye @ The Real Jdbye:
    i like alestorm
    +1
  • The Real Jdbye @ The Real Jdbye:
    @BigOnYa too many syllables
    +1
  • BakerMan @ BakerMan:
    same lmao
  • BigOnYa @ BigOnYa:
    hi, welcome to the Temp!
    +1
  • BakerMan @ BakerMan:
    Welcome to the Underground!
    +1
  • BakerMan @ BakerMan:
    the booty boogie from (once again) the donkey kong country cartoon could also be a good song to sing while playing sea of thieves
  • BigOnYa @ BigOnYa:
    Please insert 25 cents for an additional 30 minutes of talk time.
    +2
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=tG7fk_DUz5g +1