sm64 | Super Mario 64 decompilation , brought to you by a bunch
kandi X-RAY | sm64 Summary
kandi X-RAY | sm64 Summary
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sm64
sm64 Key Features
sm64 Examples and Code Snippets
Community Discussions
Trending Discussions on sm64
QUESTION
I want to programatically retrieve a list of the top 100 videogames with most runs from the URL https://www.speedrun.com/games#orderby=mostruns
The list in that page is a template in HTML which gets populated via an AJAX request (if I am understanding correctly how this works).
This is the part of the HTML code which I believe its retrieving the games:
...ANSWER
Answered 2021-Jul-19 at 14:48You need to make an HTTP request in Python, and I recommend the requests library for achieving this.
QUESTION
I'm having trouble compiling this github repo for Super Mario 64. I followed all of the steps.
- I made sure I had all of the dependencies like build essential installed
- I cloned the repo and copied a rom for asset extraction
- I used the Makfile by running
make VERSION=us -j4
The compiler did it's thing and gave a few warnings which is to be expected, but it didn't give any errors and make said the sha1 checksums matched. When I went into the build directory and tried executing sm64.us.bin, it gave this error: bash: ./sm64.us.bin: cannot execute binary file: Exec format error
. When I googled the error, I found that some people got it when trying to run a 32 bit binary on a 64 bit OS, but that can't be it because I'm running a 64 bit kernel on a 64 bit machine and compiling it myself. I checked the permission bits and there don't seem to be any issues there. I even tried deleting the repo and cloning it again which didn't work. I then tried running different flags like -j5 or without the -j flag entirely (That shouldn't make a difference since I'm running a fairly zippy 12 core Ryzen 5 but I thought I'd try having GCC compile on a single core because I was running out of ideas). What am I doing wrong here? Is there a setting with GCC I should change or could there be a problem with the makefile?
I checked the ELF file and it looks like it is 32 bit for some reason. I ran file sm64.us.elf
and the output was sm64.us.elf: ELF 32-bit MSB executable, MIPS, MIPS-III version 1 (SYSV), statically linked, not stripped
. Why is GCC doing that? How can I compile a 64 bit executable?
ANSWER
Answered 2021-May-09 at 21:59GCC can build 32bit or 64bit executables (on most systems). It all depends on what arguments you give it. If you look at the compile invocation that make is running you'll likely see that it passes the -m32
(or some similar) option, which tells the compiler and linker to create 32bit objects and binaries.
If you want to build 64bit instead you'll have to find the arguments in your makefile or other configuration that select 32bit, and remove them (or change them to explicitly choose 64bit).
I should warn you, this almost certainly won't work!! It's not the case that any old C program can be compiled as either 32bit or 64bit and continue to work identically. It is possible, but doing this requires that the programmer write their code carefully and with forethought. In my experience video game programs are almost always coded specifically for a given hardware target and little thought is given to making it portable to other hardware, and that includes 64bit versions of the "same" vendor.
Instead of trying to make the code build for 64bit, a better use of your time is to investigate why your system is not able to run a 32bit executable and fix that. It's odd to me that you can compile for 32bit but not run 32bit: usually if you can build it then you have the proper libraries, etc. installed to run.
QUESTION
This morning I learned that the famous videogame Super Mario 64 has been fully decompiled back to C source code. Just out of curiosity, I've decided to look through it, and I noticed something that I had never seen before.
...ANSWER
Answered 2020-Jan-28 at 20:20Before I go into anything, let me first recommend using the Discord link attached to that repo, discord.gg/27JtCWs . I will do the best to answer this, but am definitely not the most knowledgeable of standards and typical behavior for coding in-general. My experience is only relevant since I work closely with some individuals involved with the decompilation.
1 & 2. I don't believe that this is a sane thing to generally do, however it is important to remember the point of the repo- allow modifications easily to the codebase while preserving its ability to compile a 1:1 ROM of SM64. Having the file split up makes finding the relevant locations of things easier, although this particular one is not well named yet.
So the inc.c files are glorified header files, just inserting their code in that location. It's named a .c file because it is sort of C, just not a legitimate C file itself. That's why it's .inc.c, since it is INCluded>
It is a standard unsigned char, that is correct. This can be found in types.h. This is done because really its just importing a bunch of data that can be read separately. This particular file isn't in the repo, but if you extract assets you can see that is is an image being inserted there. The image's data is just split up into u8's and put there, allowing it be both be extracted/inserted and more easily edited.
ALIGNED8 is for the compiler. The IDO 5.7 compiler that the repository uses often aligns things within the ROM output, and the ALIGN8 directive is telling it to pad out to 8 bytes. If the ALIGNED8 was not there, it would potentially insert that data too soon, shifting the ROM.
Hope I didn't make any mistakes and this helps. It's just important to remember that the whole GitHub isn't really a typical one, since its less about worrying about internal consistency and more worrying about external (ROM) consistency, often meaning that sometimes solutions have to be sort-of hacked together to allow functionality. If you have further questions I will again recommend asking in the Discord, as those guys are much more informed than I am.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sm64
Install prerequisites: sudo apt install -y build-essential git binutils-mips-linux-gnu python3
Clone the repo from within Linux: git clone https://github.com/n64decomp/sm64.git
Place a Super Mario 64 ROM called baserom.<VERSION>.z64 into the project folder for asset extraction, where VERSION can be us, jp, or eu.
Run make to build. Qualify the version through make VERSION=<VERSION>. Add -j4 to improve build speed (hardware dependent).
After installing and starting Docker, create the docker image. This only needs to be done once. To build, mount the local filesystem into the Docker container and build the ROM with docker run sm64 make.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page