31

Super Mario 64 decompiled

 4 years ago
source link: https://www.tuicool.com/articles/EJJRVjv
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Can't say I worked on this one, but I've worked on other projects for some consoles.

You don't get variable names and project structure from anywhere. You make those up. When you first decompile a function, the function is typically given either a serial number (function442) or a name based on its address (function8182938); variables are likewise given short, numbered names and/or names based on their allocations into registers and stack. Something similar happens with the actual file structure, with files being created to represent contiguous decompiled parts of the ROM and given dummy names.

As the decompilation progresses, you can read the code you have reconstructed in an attempt to understand it. Making trivial changes and building a hack ROM on the spot is sometimes a way of testing if your guesses are right. Once you have confirmed that some block of code does what you think it does, you can rename it. This is of course a very manual process, and that's why all decompilation projects have some unrenamed components — refer to someone's comment about this project having variable names like D_80F00F00 (a few comments above).

As for the actual process of decompiling the game, the first step is to determine the language used to write the game in the first place, and find the exact compiler used — all compilers produce different code, so you'll never be able to match the original code with a different compiler. From a quick perusal of the release, this project uses IDO 5.3 as its C compiler (the file in the distributed package is tools/ido5.3_compiler/usr/bin/cc), which is a proprietary compiler from ancient times; I wonder how they got a copy of it. Some quick googling tells me it was once upon a time freely available, but I couldn't find any working downloads.

Once the original compiler is found, the process is almost entirely trial and error, although familiarity with the code produced by the compiler makes it a lot easier.

(continues)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK