Homebrew Super Mario 64 (1996) Port for DSi

Hydr8gon

Dragon Trainer
OP
Developer
Joined
Dec 15, 2014
Messages
309
Trophies
1
Website
hydr8gon.github.io
XP
2,351
Country
Canada
Super Mario 64 (1996) Port for DSi

Yes, you read that right! This is a port of the original Super Mario 64 from 1996 to the Nintendo DSi, based on the open-source decompilation of the game. It originally started out as a joke idea that I didn't think would go very far, but once I actually got the game running on the DSi, I saw potential. The initial version was based on the PC port of the game, but that port is designed with modern hardware in mind, and its graphics abstraction layer is slow. I decided to scrap it and start from scratch, writing a new graphics interpreter designed to work directly with the DS hardware for maximum performance. The results were better than I expected; the game runs full speed in most cases, and the graphics don't look too bad, either!

Compiling
Just like the original decompilation and the PC port, this requires you to provide your own legally dumped Super Mario 64 ROM file in order to compile it. I can't provide compiled binaries, so don't ask for them or share them. The source code is available here. It's already configured to build the DSi port, so just follow the build instructions included in the readme and you should be good to go.

Usage

Once you've compiled the game, you can load it through unlaunch, memory pit, or whatever DSi homebrew method you prefer. The game uses libfat to save to a file just like the PC port. For some reason there are issues launching the game from TWiLightMenu with libfat enabled; if you have no other way of launching homebrew, it can be disabled in the makefile by removing -DLIBFAT. Note that if you do this, you won't be able to use saves.

Issues
The game runs full speed for the most part, but there are slowdowns in certain areas. There are also some minor graphical issues; translating N64 graphics calls to the DS isn't an easy task, and while there are hacks in place to accomodate for most of what the game does, some issues might be unfixable. Audio is unfinished, and causes additional slowdown; it can be toggled with the select button.

DS Support?
The only real thing stopping this from working on the original DS is lack of RAM. Right now the entire game is loaded into memory on boot, and it's simply too big to fit in the 4MB that the DS has to offer. Eventually I'd like to load in assets dynamically with NitroFS, but this will require hacking up how the game loads things. Performance would also of course be worse on the DS, but not much can be done about that.

Screenshots
1.png
2.png
3.png

4.png
5.png
6.png


The above screenshots were taken with my emulator for the sake of quality, but here's a picture of it running on real hardware in case you weren't convinced :)
hardware.png
 
Last edited by Hydr8gon,

Hydr8gon

Dragon Trainer
OP
Developer
Joined
Dec 15, 2014
Messages
309
Trophies
1
Website
hydr8gon.github.io
XP
2,351
Country
Canada
Could this also work on DS with an expansion pack?
I hadn't considered that, but in theory it should work. It would probably need some modification to properly detect and support it though (to get it to run on my DS emulator, I had to set a bit in a DSi-exclusive register as well as expanding the RAM size).
 

Hydr8gon

Dragon Trainer
OP
Developer
Joined
Dec 15, 2014
Messages
309
Trophies
1
Website
hydr8gon.github.io
XP
2,351
Country
Canada
Can this (once compiled) be loaded through a flashcart on my DSi XL?
If you want to try it without modifying your system, it works great through memory pit. Once you have pit.bin on your SD card, put SM64 on the root of the SD and name it boot.nds. Then, when you open the SD card album in the DSi camera app, the game will start! This is completely reversible by removing the modified pit.bin file, and doesn't touch your system at all (I'm assuming you wanted to use a flashcart because you don't have/want CFW?).
 

SleepyLark

Member
Newcomer
Joined
Aug 6, 2019
Messages
5
Trophies
0
XP
79
Country
United States
Now that one game has been ported, how hard would it be to port other games?

Depends on what you mean by "other games". This port is only possible thanks to the people who spent the time to decompile the original game back to C code, so if you're talking about porting other N64 games they would have to be first decompiled back to usuable code before being able to port it. I know there's some decomp projects already in the works like OoT and Mario Kart 64 but they're not usuable yet, also it looks like some changes need to be made in order to get the graphics to run on the DS.
 

CMDreamer

Well-Known Member
Member
Joined
Oct 29, 2014
Messages
1,117
Trophies
0
Age
36
XP
2,027
Country
Mexico
Nope. Flashcards run in DS mode, which doesn't have enough memory.

This confuses me. The DSi XL has two modes to run the games? DSi mode and DS mode?

Sorry but I got lost on this one.

If you want to try it without modifying your system, it works great through memory pit. Once you have pit.bin on your SD card, put SM64 on the root of the SD and name it boot.nds. Then, when you open the SD card album in the DSi camera app, the game will start! This is completely reversible by removing the modified pit.bin file, and doesn't touch your system at all (I'm assuming you wanted to use a flashcart because you don't have/want CFW?).

Nice tip! Will definitely try it out when I get the time. Thanks a lot!
 

nadiaholmquist

New Member
Newbie
Joined
Feb 13, 2021
Messages
1
Trophies
0
Age
24
XP
19
Country
Denmark
This confuses me. The DSi XL has two modes to run the games? DSi mode and DS mode?

Sorry but I got lost on this one.
When starting a game that was made for the original DS, the DSi removes access to all new features and cuts down the RAM to 4MB so it acts like a regular DS. Your flashcart will be detected as old DS software and run in this mode.

Now that one game has been ported, how hard would it be to port other games?
It would help with porting other N64 games that use the Fast3D microcode, as what this port mainly consists of is a layer that "translates" the Fast3D commands to something the DS GPU can use. However, as the other person said we need a fully decompilation of the game before this can be done.
 
Last edited by nadiaholmquist,
General chit-chat
Help Users
  • No one is chatting at the moment.
    A @ Argimor: Anyone got any secret knowledge on Monster Hunter Rise Switch saves? Managed to pull the saves...