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
927
Trophies
1
Age
35
XP
2,321
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,506
Trophies
2
XP
39,724
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,244
Trophies
1
Age
40
Website
github.com
XP
2,618
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,467
Trophies
3
XP
29,283
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,467
Trophies
3
XP
29,283
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,884
Trophies
2
Age
48
Location
Japan
XP
3,936
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
66
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,884
Trophies
2
Age
48
Location
Japan
XP
3,936
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
Former Staff
Joined
Jan 7, 2014
Messages
14,646
Trophies
5
Location
Another World
Website
www.gbatemp.net
XP
25,756
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,244
Trophies
1
Age
40
Website
github.com
XP
2,618
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,244
Trophies
1
Age
40
Website
github.com
XP
2,618
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,884
Trophies
2
Age
48
Location
Japan
XP
3,936
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,244
Trophies
1
Age
40
Website
github.com
XP
2,618
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,884
Trophies
2
Age
48
Location
Japan
XP
3,936
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: 58
Last edited by urherenow,
  • Like
Reactions: JaapDaniels

JaapDaniels

Well-Known Member
Member
Joined
Apr 22, 2012
Messages
1,244
Trophies
1
Age
40
Website
github.com
XP
2,618
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,467
Trophies
3
XP
29,283
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
  • DragonMals @ DragonMals:
    he's
  • Faust03 @ Faust03:
    twitter is a very toxic website
  • K3Nv2 @ K3Nv2:
    Nuh uh
  • DragonMals @ DragonMals:
    An underrated opinion: While Bluesky as a platform is better than Twitter, Bluesky's userbase won't be better than Twitter as people are saying because everyone from the non-bootleg site are moving to the bootleg one expecting for themselves to change with their attitude, but that never works like that.
  • DragonMals @ DragonMals:
    I will say though: Bluesky as a micro-blogging site? Needs a bit more oomph and I would officially like it better than Twiter. Can't even post gifs on that site, like what the fuck?
  • K3Nv2 @ K3Nv2:
    Diarrhea is toxic
  • BigOnYa @ BigOnYa:
    Can you post milfs though?
  • K3Nv2 @ K3Nv2:
    Gilfs
    +3
  • BigOnYa @ BigOnYa:
    Kilfs. (Ken knows)
  • K3Nv2 @ K3Nv2:
    Gay
    +1
  • NinStar @ NinStar:
    fake and gay
    +1
  • K3Nv2 @ K3Nv2:
    Fake news is hot
  • realtimesave @ realtimesave:
    hey guyz
    +2
  • SylverReZ @ SylverReZ:
    @realtimesave, I'm here. Why?
  • SylverReZ @ SylverReZ:
    Have you found anywhere else to sell your Switch OLED?
  • SylverReZ @ SylverReZ:
    Ello :)
    +1
  • Xdqwerty @ Xdqwerty:
    @DragonMals, Yeah one is gonna have the same attitude in any site no matter what
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, how are you?
  • SylverReZ @ SylverReZ:
    I'm okay.
    +1
  • BigOnYa @ BigOnYa:
    I'll buy it, full price, meet me in the dark alley behind that closed blockbuster.
  • K3Nv2 @ K3Nv2:
    You'll get the money and he'll say keep the switch
    K3Nv2 @ K3Nv2: You'll get the money and he'll say keep the switch