1. This forum is in read-only mode.

Programming for the DS

Discussion in 'Tutorials' started by anandjones, Sep 3, 2008.

  1. anandjones

    anandjones Well-Known Member

    Before you continue on, I suggest you learn the basics and more of C or C++, and thoroughly and in memory. If you do this, learning future DS functions and code will be easy. If you are already amazing at C or C++, go for it. Hardware programming knowledge is not necessary, but it would help.

    First off, you're going to need a C/C++ IDE, if you're a programmer, you must already have one, if not, I suggest Dev-C++, Codeblocks, or Microsoft Visual C++. You shouldn't get Visual C++ for simple little programs and whatnot, for big projects, it is a wise compiler to use.

    Now you need the libraries, files and toolchains to turn your programming code into usable DS binary code to be run on the hardware or a DS emulator. The one you will definitely need is Devkitpro http://www.devkitpro.org/, managed by Wintermute, which is a set of toolchains for Gamecube, PSP, DS, GBA etc. so you can program for them. Once you run the installer, you can choose to install all of the toolchains, the only selections you need are DevkitARM and libnds (if you want to move to libnds from another library). There are plenty of other libraries such as DSPython, DSLua etc., but they're very basic and not updated. Most of these can just output text to a screen.

    Once you've got them installed, you can check out some of the documentation files that come with the install which teach you how to code using those libraries. If you find libnds or DevkitArm hard (most people do), you can use a much easier library called PALib (programmer's arsenal) http://www.palib.info/ created by Mollusk and updated by various people, makes programming for the DS a lot easier. You don't have to learn the DS hardware inside and out. I suggest you use libnds or DevkitArm if you have a few year's of C or C++ experience. Problem with DevkitArm is you have to learn the DS hardware, as the ARM processors run on multiple things such as GBA, and GP2X, so you could program for those as well, rules stay the same.

    If you are good at programming for hardware for any other systems (or GBA), libnds won't provide much more difficult. Very easy bg control registers and addressing is easy :)


    libnds Learning Tools


    Patater (one of my most favourites and has been updated with the new API)

    Documentation at devkitPro website

    Very indepth guide to NDS programming in general, as well as libnds

    DSPassme tutorials (with help from Natrium42)

    Double's Tutorials

    Liranuna's Tutorials for easy 2D programming

    Dev-Scene tutorials, written by dovoto (one of the co-creators of libnds, formerly NDSLIB

    DS Hardware

    GBATEK - Very complete Documentation of the DS's hardware inside and out

    DS Hardware

    DS Hardware
     
  2. anandjones

    anandjones Well-Known Member

    Oh, the IRC channel (where you will get help faster for PALib) is irc://irc.freenode.net/palib :)