As I have done some Nintendo DS coding lately, I want to share some pointers for getting started:
In order to run homebrew software on an unmodified device you need either a Slot-1/Slot-2 solution like SuperKey (used solely for bootup) and SuperCard (this one holds your microSD) or a combined Slot-1 cartridge like the R4.
The only compelling reason to go for the former is the ability to remove the SuperKey after initial startup and replacing it by some other cartridge, like the DSerial UART adapter.
Next step is setting up a buildchain for compiling and linking your own executables. Download devkitPro, which is available for Windows and Unix. During install, you can skip anything related to PPC and PSP as this concerns Gamecube and PlayStation Portable development. Be also advised not to use an install directory containing spaces in Windows, as various components of devkitPro don't seem to handle this right. (This also applies to your project directories later on.)
In examples/nds/templates/combined you'll find a skeleton project to start from. The Nintendo DS has two CPUs - one ARM9 and one ARM7 core. The code for each lives in a dedicated subdirectory (arm7, arm9). Normally, you write the dedicated code for the ARM9 core while the ARM7 helps out with getting readings from the touchscreen, playing sounds, etc. So unless you have to do anything fancy, just use the template.c file provided for ARM7, which already handles the functionality just mentioned.
devkitPro (libnds) is very sparsely, if all, documented. That's why you find yourself looking up code in the examples subdirectory quite often. Another source of information are the tutorials posted on the web (here, here), and the low-level specification that is available.
There is also a large developer community active over at gbadev.org, where there is also a forum where homebrew releases are being announced.
title Nintendo DS homebrew 101
tag research
tag nds
tag homebrew
tag development
tag howto
written 13.02.2008 22.00














