This is the great and holy Introduction to Nintendo DS manual, the supreme source for beginner knowledge on programming the Nintendo DS.
About
This manual covers topics including the legality of homebrew and the politics behind it, displaying backgrounds on both screens, sprites, and a bit of game mechanics.
Change Log
- Version 6.0 - This manual now covers additional aspects of Nintendo DS Programming including multiple sprites, multiple backgrounds, multiple palettes, the touch screen, Slot-1 devices, and more. The manual's case study has undergone a significant rewrite and covers more ground than ever before.
- Version 5.0 - Made Editing improvements. Manual is now DocBook formatted.
- Version 4.0 - Added VRAM Appendix and updated page layout
- Version 3.0 - Added a sound chapter
- Version 2.1-2.2 - Various typo fixes
- Version 2.0 - Finalized many chapters and improved code
Download
Comments
SVG Images in the Web Manual
Although Firefox and IE can display svg images, they can't do it in the web browser. I think for the web version of the manual I'll need to automatically convert the svg files to png files of a certain resolution somewhere in the doxygen to web pipeline, but I haven't figured out how to do this yet. In the mean time, you can right click on the svg image alt text and "View Image" to view each image.
Update for grit
Hi,
Thanks a lot for updating your files to support grit 0.8. Also, thanks a ton for the manual!
Missing"Figure 5.2. libnds Affine Background API" @Online Manual
Hi,
Thx for the manual.
Can you please check the "Figure 5.2. libnds Affine Background API"? It´s missing...
In fact, ALL the .svg files are missing to me... Im using Firefox 2.14 and IE 7.0.
Thx again for the manual,
Peace
Amauri Silva @ Brazil
Updated for versions of grit 0.8
With versions of grit greater than 0.8, a problem where graphics are not converted correctly has come up. I've updated the included grit files to explicitly tell grit that we want bitmap graphics or tiled graphics in each case. This fixes the issue for anyone who has been experiencing it. (I'm looking at you Musturd, hansi, and Anonymous.)
Thanks for the heads up, guys.
Hey, it looks like they
Hey, it looks like they updated the grit tool a week or so ago. I ran into this same problem, but if you change Bitmap to Tiles, you actually won't see the planet or the splash screen. What you want to do is to add the -gb option to the planet.grit and splash.grit files in the gfx folder so they look like this, and it will work:
# Set the warning/log level to 3
-W3
# Set the transparent color to 000000 (rrggbb hex)
-gT000000
# This is the new line, this needs to be here now!
-gb
# Set the bit depth to 16
-gB16
Would you upload docbook version manual ?
Your manual is great !!!
But I prefer to read printed manual. If you upload docbook version, I can creat pdf version manual and print it.
(I think that you wtite this manual in docbook format and convert it to html. Is it right???)
thanks!
hey!
thanks for this tutorial! i'm not through yet, but i'm already enjoying it.
one odd thing i noticed is that this bitmap->c-code conversion was causing compile trouble.
i sometimes have to replace "xxxBitmap" and "xxxBitmapLen" with "xxxTiles" and "xxxTilesLen". I'm new to this and hardly have any idea what i'm doing, but it seems to work....
best, hansi
Getting build error with chapter_5-backgrounds
Clean install of devkitpro, trying to get chapter_5-backgrounds to build... (all devkitpro examples compiled fluently).... Looks like grit isn't nice to me?
Sorry for being total newb
E:\temp\nds\Dev>make
main.cpp
arm-eabi-g++ -MMD -MP -MF /e/temp/nds/Dev/build/main.d -g -Wall -O2 -march=armv5
te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -
I/e/temp/nds/Dev/include -I/c/devkitPro/libnds/include -I/c/devkitPro/libnds/inc
lude -I/e/temp/nds/Dev/build -DARM9 -fno-rtti -fno-exceptions -c /e/temp/nds/Dev
/source/main.cpp -o main.o
e:/temp/nds/Dev/source/main.cpp: In function 'void displayPlanet()':
e:/temp/nds/Dev/source/main.cpp:119: error: 'planetBitmap' was not declared in t
his scope
e:/temp/nds/Dev/source/main.cpp:123: error: 'planetBitmapLen' was not declared i
n this scope
e:/temp/nds/Dev/source/main.cpp: In function 'void displaySplash()':
e:/temp/nds/Dev/source/main.cpp:129: error: 'splashBitmap' was not declared in t
his scope
e:/temp/nds/Dev/source/main.cpp:133: error: 'splashBitmapLen' was not declared i
n this scope
make[1]: *** [main.o] Error 1
make: *** [build] Error 2
alien ship
I cant believe i am the first person to point out the fact that the alien ship looks like a giant penis.
thanks. I am just a
thanks. I am just a beginner, this is very useful for me
Excellent Guide
This is a really good guide and I learned a lot from it.
I do have one small request. Could you change the svg graphics to pngs. A lot of browsers (Safari, Firefox on the mac) don't display it correctly.
Nice!
10-Q so much...
Thanks so much! I've
Thanks so much!
I've just learnt about program NDS, so this is great for me.
Something i'd like to point out...
All the comments are written in the same style, are all positive and are all by an anon commenter. This has lead me to believe that you (the manual writer) have written these comments yourself to advertise your manual. Great tut BTW
HELP!!!!!
lots of code but nothing to do with it!!!
Wrapping issues
Generally a nice guide, but I have to quibble with the way the wrapping of the ship sprite is handled. My understanding is that the wrapping will be handled automatically when the sprite is displayed, but it won't be handled in the actual game logic. So the way you're doing it is kind of cheating, and it could break in certain circumstances. For example, your floats will lose precision as they grow larger, so you could break the code by going in the same direction for a while. (I don't know if this would ever be a problem in practice, but it's something to watch out for.) Or you might want to do something depending on the ship's position, and you'll have to have logic to handle wrapping then. It's OK to have it this way if you understand the problems, but you don't indicate them in the tutorial. You say "The hardware takes care of any wrapping or offscreen issues," but it's not the case that it handles ALL potential issues.
Awesome guide that's actually updated since 2006
As the title of my message of gratitude indicates, this is the best tutorial that I have had the priviledge to come across.
Thank u
Thank you for your time and share your knowlege. Thank you so much.
Nice introduction guide
Thank you, I have been looking foward for an update. Keep up the great work.
Wonderful tutorial.
I learnt from your tutorial when it was on v5 (or maybe previous one). I just re-read whe whole thing, and found much information which i'd love to get the first day i decided to get into the homebrew thing. Namely, the "Which Passthrough Should I Buy" is a jewel in clarity compared to the extensive history you find on other sites. Too much info drowns the newbie (i was;). Stating that slot-1, homebrew/nopass compatible carts are what you want is giving the right information to start with. You could also list the MK5 in the among the slot-1, as it works for me so far, and does provide integrated memory (some find it a con, other a pro).
Concerning the content itself, i found it even clearer than before. More readable, better commented (moreover, block /* */ comments makes it less fuzzy-looking). And thanks for the whole multi-sprite "Sprite Tile Addressing", "Loading in a Sprite" & boundary parts, "Sprite for dummies" made it all a lot clearer for me ! Again good idea to speak about assertions, and the Object-oriented programming part is a breeze.
The only "enhancement" i would advise would be some kind of code syntax highlighting. That's not easily doable using DocBook format (you would need some kind of brute-force copy/paste from something similar to devcpp's html export, for example), but would render the code snippets easier to grasp and navigate through.
Your document is a real pleasure to read, and learn from, really good work ! IMHO, it's the est thing to read when you're beginning DS programming. Figuring out the concepts is the most important thing, and it's easy with your explainations. Bookmark well deserved !
Nicolas Pillot (http://nipil.org)
Post new comment