- A 66 MHz ARM-9 processor
- A 33 MHz ARM-7 processor
- 4 MB of RAM
- A touch-sensitive display (256x192)
- Another (non-touch-sensitive) screen (again, 256x192)
- A 3D-engine built-in
- WiFi built-in
- A really simple cartridge port (effectively the
address/data lines of a memory-mapped 32MB space)
- Another cartridge port to use for storing data on
(this one's not quite so simple :)
- And it's portable. Get the black DS-Lite, and it's
actually looks quite respectable...
And to top it all off, there's a simple homebrew environment for developing programs on it that uses gcc (since the ARM is a supported platform) and one of several libraries.
Development
I bought a DS-X card for developing on, and it really makes it easy, even on a Mac - use standard 'Makefile's under X-windows or create an XCode project which calls the Makefile - whichever you prefer. I tend to go for the XCode project just because I like all the code-completion/parameter-expansion etc. Horses for courses...
The development environment is called 'devkitpro', and is totally unofficial (created mainly, it seems, by a guy called 'wintermute'). It's a C++/C port of the GCC toolchain, with custom startup code for the NDS's memory map. Unfortunately there's no ObjC compiler in the port - though it's a goal of mine to port ObjC. I have the compiler itself working, after fixing a bug in the configure script, but it needs more work (read: a thread-safe malloc and a pthreads layer) before I can get it working properly. I'm working on that :-) After a couple of years of being spoilt by ObjC, there's no way I want to go back to C++, and for the application I have in mind, an OOP language would be very useful :-)
For the record, when you download the files, what you actually get is a nice installer - no complications on what to put where. I place this sort of thing in /opt/local (so DEVKITPRO points to /opt/local/devkitpro and DEVKITARM points to /opt/local/devkitpro/devkitarm) but you can put them anywhere
Deployment
Anyway, assuming you're using C++ or C, after your code has compiled to a ".nds" file, just connect the DS-X cartridge to the mac using the supplied USB cable, and it mounts as a flash-drive. copy the file over to the 'apps' subdirectory, dismount the drive, and switch on the NDS. I always have to disconnect the NDS (which is a pain, DS-X people :-) but it's not really *that* big a deal.
I actually have a 'make' target...
install:
cp $(TARGET).nds /Volumes/DSX/apps
diskutil unmount /Volumes/DSX
... so it's just a matter of typing 'make install' on the commandline (or, as I prefer: "up-arrow, return" :-) then disconnecting the USB. Really easy :-)
Debugging
(hmm. Should this come *before* deployment...?)Ok, so you have your program compiling, linking, transferring, and ... running ? Hmm. Ok, so not running, in fact...
This was a problem for me too... especially when I'm trying to write interrupt-driven code [sigh]. There's no mention anywhere of DS emulators that run on the Mac (plenty for Windows, some for Linux). So, I thought I'd try and port one of the emulators (desmume) onto the Mac - this turned out to be pretty trivial actually - just install the relevant libraries and go through the configure/make cycle.
So, now I have desmume. Why did I choose desmume ? Because 'masscat' has written a gdb stub for desmume and this means I can run gdb on the mac, connect it via TCP to desmume (again, running on the mac, started from a different terminal), and debug my application as it runs in the emulator. I had to download/configure/compile/install gdb (host=mac, target=arm) for this, but again, that's straight-forward.
So, now I have a debugging solution too [grin]. I've written up the list of things I needed to do to get this all to work . What I haven't yet looked into are two interesting routes:
- Debugging the actual NDS using GDB via WiFi -
this looks really really cool..
- Getting the Insight graphical interface to GDB up
and running. These things make debugging *so* much
simpler :-)