Tag Archives: Homebrew

Homebrew code for Nintendo DS

This post contains several libraries and other pieces of code to be used in your own DS homebrew projects.

HTTP Library

I had the idea to make some small tools that interact with the web using HTTP. With the idea in my head I searched the net for usable open source code. I came across libhttp made by M. Miller aka skape (hick.org). The library contains routines to handles the HTTP protocol. It allows your to easily create a HTTP request and to parse the HTTP response. So basically libhttp contains functionality that every web client could use. Therefore I decided to port this library to the DS so it can be easily used in different open source projects. Below is a link to the library including source code and an example.

Downloads:
libhttp-0.1
libhttp-0.2 (Updated to devkitPro r20)

URL parsing code

I have made (well uhm, copied and modified) a simple url parsing routine. It is taken from David Brady’s Nintendo DS Internet Radio Client called Dissonance. I improved it a bit to suit my needs. The routine will not be added to libhttp because it is not http specific. The download below also include an example.

Downloads:
parse_url-0.1
parse_url-0.2 (Updated to devkitPro r20)

I hope to add actual handling of HTTP responses. Redirection, proxy authentication, etc. some time…

SPI Library

This is a simple library that enables you to use the spi interface of the Nintendo DS Slot-1.

Credits for the code go to Ben Jaques. With his permission I took the code from http://masscat.afraid.org/ninds/spiuart.php and modified it into a library that is usable with devkitPro for nds applications.

Downloads:
libspi-0.1
libspi-0.2 (Updated to devkitPro r20)

Nintendo DS: Running homebrew software

This article is about running and making homebrew software on the Nintendo DS. There are several pieces af hardware available on the market to do so:
  • GBAMP
  • M3 Adapter (There are 2 versions: CF and mini SD)
  • SuperCard (There are 5 versions: CF, SD, mini SD, lite, rumble)
  • GBA Flash Cart
  • DS-Xtreme (Soon to be released, so nothing really usefull to say about it here)

But why should you run homebrew software on the DS? Well because it is fun! You can run DSlinux, play mp3s, watch photos, watch movies, access MSN instant messaging.

I choose the Supercard SD + Superkey mainly because of the price but also because it is said it is the best choice for DSlinux. Besides that I already had a 512MB SD card. I’am writing this article to share my experiences. It is not finished and probably will never be as i will continue to add new information.

Checking the hardware

After getting the Supercard and Superkey I bought I first unpacked them:

Here is what it looks like when the cards are inserted in the DS:

As you can see the Supercard sticks out a bit but the doesn’tbother me. A smaller Supercard is available on the market but that one is for mini SD card only. I already had a SD card and miniSD cards are more expensive.

When you start up the DS without the Superkey it only allows you to run GBA code. The Superkey must be inserted to run DS code unless you have flashed your DS with other firmware.

Running homebrew software

After having checked the hardware we’re ready to put software on the SD card and get some stuff running.

Homebrew software
First thing to try is running homebrew (software made by hobbyists) DS software. To do this you can download Metro-Paris v1.0 here. It’s a map of the Paris underground system.
To test it unzip it and put metro-paris.sc.nds on your SD card. Put the SD card in your supercard, be sure that the superkey is in and power on your DS. When the supercard menu pops up select metro-paris.sc.nds and press A. Below are pictures of the 2 steps:
  

Now that has been tested you can also try and run GameBoy Advance homebrew software. Just go to www.gbadev.org and download one of those fabulous games!

Running DSLinux

If you ever used linux try DSlinux! It is great to have linux on your DS. I mainly use it as a ssh client to remotely access my server. On my server I can run the lynx web browser and check the status of my downloads.

Install DSLinux
(the supercardsd build), works perfect to. Just untar and copy the contents to the root of the SD card.

Remark to manual on DSlinus Wiki: to be able to unmount the supercard you first have to be sure not to access the supercard so “cd /” first. This is my standard shutdown sequence:

cd /
umount /supercard
poweroff

DSlinux got wifi working with settings taken from DS memory. Here is my rc.conf. But after changing it DSlinux needed a reboot instead of “/etc/rc.d/network restart”.

Compiling DS linux is a bit more work but once you have your tools in place it is very easy to build your own DSlinux. this enables you to leave out all the binaries you never use. My DSlinux now is only 2.5 MB this really reduces the loading time.

MSN with Beup

One of the most popular pieces of DS homebrew software is Beup, see http://dl.qj.net/Nintendo-DS/catid/187

Unfortunatly I could not get it to work on my DS with WEP enabled on my router. As I don’t like to have totally unsecure wifi network this was really a problem to me.

I found out that Beup is open source and that it used dswifi_lib. So first I recompiled Beup using the latest dswifi_lib without any result. That didn’t put me back. I compiled one of the dswifi_lib examples and that program succeeded to connect to the internet using the configuration of the DS itself. That seemed to work so I changed the code of Beup a bit and now it works fine for me!

You can download my patch here.

Note 24-10-2006 
Recently I found out that the reason of the connection problems often lies in the DHCP not functioning well on the DS. I now changed the settings on my DS to have a fixed IP. That work as a charm! Hopefully the next dswifi_lib will support DHCP properly. 

Links

Simon van de Berg – DS section
http://nintendo-ds.DCemu.co.uk/
Nice collection of homebrew software
The Unofficial Supercard Site
Dev-Scene NintendoDS Portal
MaxConsole NDS Forum
Home of DSLinux

GBADev Forum about libfat

FlashMe 
FlashMe Wiki
FlashMe HowTo
FlashMe HowTo (Video)