CodeDump : SettingUpAndNDSDevelopmentSystem

CodeDump :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Setting up an Nintendo DS development system under Ubuntu


up

Introduction


The goal of this page is to illustrate how to set up a Nintendo DS development system, usable for homebrew development under an Ubuntu (8.04 in this case) Linux system. There are many tutorials out there describing how this should be done under Windows but Google isn't giving much results for Linux users. This page was originally written for Ubuntu 7.04 but updated in may 2008 for Ubuntu 8.04 using the current state of affairs.

Getting devkitPro installed


This part of the text will guide you through the installation of devkitPro, it's mainly windows friendly installation instructions can be found here. The first thing that each Ubuntu user should do as an easy way to get the minimal tools for a development system is
$ sudo apt-get install build-essentials

This will install C,C++ compilers, make and other dependencies. Next from the devkitPro sourceforge page download:

And now install them (all my downloaded archives were stored in /tmp/ds):
$ sudo mkdir -p /usr/local/devkitPro
$ cd /usr/local/devkitPro/
$ sudo chown edb:edb .
$ cp /tmp/ds/devkitARM_r23-i686-linux.tar.bz2 ./
$ tar -jxvf devkitARM_r23-i686-linux.tar.bz2 
...
$ mkdir libnds
$ cd libnds
$ cp /tmp/ds/libnds-20071023.tar.bz2 ./
$ tar -jxvf libnds-20071023.tar.bz2
$ cp /tmp/ds/default_arm7-20080416.tar.bz2 ./
$ tar -jxvf default_arm7-20080416.tar.bz2     # <<< this will add default.arm7
...
$ cd ..
$ mkdir libfat
$ cd libfat 
$ cp /tmp/ds/libfat-nds-20070127.tar.bz2  ./
$ tar -jxvf libfat-nds-20070127.tar.bz2 
...
$ cd ..
$ mkdir dswifi
$ cd dswifi
$ cp /tmp/ds/dswifi-0.3.4.tar.bz2 ./
$ tar -jxvf dswifi-0.3.4.tar.bz2
...
$ cd ..
$ mkdir examples
$ cd examples
$ cp /tmp/ds/nds-examples-20080427.tar.bz2  ./
$ tar -jxvf nds-examples-20080427.tar.bz2 
...
$ cd ..
$ find . -name "*.bz2" -exec rm -f '{}' \;

So what happened here ? We created a directory where the devkitPro could be placed, we gave our current user permission to write there. Then we extracted the archives we downloaded and ended with cleaning up. This should have set all files in place.

Next you should either enter the following commands:
$ export DEVKITPRO=/usr/local/devkitPro
$ export DEVKITARM=/usr/local/devkitPro/devkitARM/

To apply these settings only to your session or add them in ~/.bashrc to have these settings applied for your current user each time you log in.

Getting the examples running


Now in the prevous section we installed devkitPro in /usr/local/devkitPro and the examples in /usr/local/devkitPro/examples once you have set the environment variables it isn't a big deal to get (most of) the examples compiled.

$ cd /usr/loca/devkitPro/examples/
$ make
...
$ cd bin
$ ls
16bit_color_bmp.nds  Double_Buffer.nds  lesson06.nds       Simple_Quad.nds
256_color_bmp.nds    ds_motion.nds      lesson07.nds       SimpleSound.nds
ansi_console.nds     embedded_gbfs.nds  lesson08.nds       Simple_Tri.nds
arm9.nds             exceptionTest.nds  lesson09.nds       Sprite_Bitmap.nds
BG_Rotation.nds      hello_world.nds    lesson10b.nds      Textured_Quad.nds
BoxTest.nds          lesson01.nds       lesson10.nds       touch_look.nds
combined.nds         lesson02.nds       lesson11.nds       TouchTest.nds
Complex_2D.nds       lesson03.nds       Paletted_Cube.nds  Watch.nds
custom_font.nds      lesson04.nds       Picking.nds
Display_List_2.nds   lesson05.nds       rotscale_text.nds


Hurray, we've got rom files ! The next step is getting them to run on a DS. For this I make use of a supercard lite and a superkey. There are lots of pages on those so I won't elaborate further on this. But the principle is simple, get the microsd card mounted (in my case I simply us a usb cardreader for it), copy the nds files, unmount it, power up the DS select an example and everybody is happy ;).

Links


A quick selection of links to page I consulted, or simply pages that look great and are still in my to read list:

About


Written by Elie De Brauwer, comments, feedback and questions are welcome at elie @ de-brauwer.be without the spaces that is.
up
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.0396 seconds