Super Mario 64 has been decompiled

signal

Member
Oct 28, 2017
17,286
Not sure what is safe to post here since the two main sources are 4chan (with a download link) and gbatemp forums with no download link (is gbatemp linking allowed?) but this should be OK to post at least: https://www.reddit.com/r/Games/comments/cbymz3/super_mario_64_has_been_decompiled/ You can maybe read through some of the reddit comments too if you have questions.

e:
A better conversation of it is up on the emulation subreddit


SM64 PC port with mod support when
 
Last edited:

RestEerie

Member
Aug 20, 2018
5,456
wait...so you are saying they managed to get the source code out of this decompilation?

huge if true although they better don't distribute it openly lest it incur the wrath of nintendo. Source code for a closed source project is considered intellectual property and under protection.
 

jediyoshi

Member
Oct 25, 2017
2,048
wait...so you are saying they managed to get the source code out of this decompilation?

huge if true although they better don't distribute it openly lest it incur the wrath of nintendo. Source code for a closed source project is considered intellectual property and under protection.
It's already leaked. It can be used to create the original ROM.
 

Fredrik

Member
Oct 27, 2017
3,649
I'm guessing that this isn't all that legal...

But it's certainly amazing.

What programming language is used? While I'd rather look at the super mario bros code, since it's laser focused 2D platforming perfection, I can still imagine that the SM64 code is interesting for anyone who play around making their own games.
 

Rush_Khan

Member
Oct 26, 2017
493
The mods for SM64 were already mind-blowing. I can't imagine what kind of mods this breakthrough could lead to.
 

Madao

Member
Oct 26, 2017
1,205
Panama
so this is pretty much the same thing as the Metroid Prime PC port?
sounds like this could bring a lot of new possibilities to the game. i hope more N64 games get this treatment.
 

flyingman

Banned
Apr 16, 2019
1,169
I'm guessing that this isn't all that legal...

But it's certainly amazing.

What programming language is used? While I'd rather look at the super mario bros code, since it's laser focused 2D platforming perfection, I can still imagine that the SM64 code is interesting for anyone who play around making their own games.
C of course. 5th generation games are written with C before that you could get assembly i think bunch of MIPS code.
 

Laxoon

Member
Jan 24, 2018
816
Does this mean they can make something like GZDoom for Mario 64? If so this is like massively, massively huge.
 

Spark

Member
Dec 6, 2017
200
Does this mean they can make something like GZDoom for Mario 64? If so this is like massively, massively huge.
Yes, it means someone can make a native PC port with updated visual effects, modern controller support and full mod support. No more fiddling with an emulator.
 

Zacmortar

Member
Oct 25, 2017
4,819
God, I wish all the games that lost their source code(Like Silent Hill 1-4) could get fans this obsessed to completely reverse engineer them :/
 
Oct 25, 2017
5,958
Yes, it means someone can make a native PC port with updated visual effects, modern controller support and full mod support. No more fiddling with an emulator.
So like upgrading character and stage geometry to modern standards? Tinkering with animation? A Mario with a facial rig that emotes in 3D during gameplay?
 

Regulus Tera

Member
Oct 25, 2017
8,960
God, I wish all the games that lost their source code(Like Silent Hill 1-4) could get fans this obsessed to completely reverse engineer them :/
Super Mario 64 was one of the earliest 3D games so there's a lot less to work with, comparatively, than the later Silent Hills. Those games would take an even longer time to get decompiled.
 

anexanhume

Member
Oct 25, 2017
4,288
Not exactly

Amazing.
That’s actually reverse engineering.

But I’d be willing to bet there are various ways for differing source code to result in the same compiled files. Not that it matters for execution.

I wonder if they could write a routine that brute forces this by matching compiled code segments until complete.
 

Jayveer

Member
Oct 25, 2017
283
Can someone please explain to my layman self what this means and how it works? Why did it take so long. Isn't it like unbaking bread and giving someone the flour?
In terms of how code is compiled into binary form to run on the target machine there are different levels of coding. With just straight writing things in hexadecimal being the lowest, assembly code being even lower and c code also considered low level programming these days but considered higher levels programming in the past.

Through the use of a disassembler (something like IDA) you can read the assembly code of an executable. Knowing both how the machine code works, and starting to piece together different states and global variables as you go along through different subroutines, you can implement c functions for the various subroutines and then the overall program, a very time consuming effort, in this case it was even more time consuming because the guys involved were trying to get a 1:1 match on the code, by recompiling their c code and seeing if it matched. That is if this is the same project I'm thinking of by the guys from the pret discord, I thought their project was private but I'm guessing someone leaked it.
 

Spark

Member
Dec 6, 2017
200
So like upgrading character and stage geometry to modern standards? Tinkering with animation? A Mario with a facial rig that emotes in 3D during gameplay?
I mean maybe lol. I doubt any hobbyist would dedicate all the time and money into developing that level of product. Right now the most feasable thing to expect is a port with modern controller support and maybe updated lighting effects.