gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Looking for a good DS programming guide or teacher

#152003 - Alphanoob - Sat Mar 08, 2008 1:51 am

Well, the subject pretty much explains my plight, but I will talk a little on it anyways. I am new to DS dev, think it is cool, and wanna learn to make my own programs. I was just getting to the fun part (AKA tile graphics) of a guide, when it cut off. I am very new to C++, but I am learning fast as I have made many programs on my TI-83, as noobish as that sounds... then again, this whole post makes me feel like a noob. If someone could help me find a guide or just teach me some of the basics of this stuff, it would be much appreciated. The most complex program I have made for my DS presently is one that moves a 4 pixel block around according to keystrokes, and doesnt allow you to leave the screen (just so you know where I am at presently). wow, that was a long post.

#152004 - elhobbs - Sat Mar 08, 2008 2:30 am

download devkitarm and libnds and compile the examples and take a look at the source code.

[Nomenclature Fairy was here -- MOD]

#152007 - Alphanoob - Sat Mar 08, 2008 4:08 am

Yeah, I have looked at some of that. If you read, I have actually even made my own small program. My issue is, I don't think that I will be able to learn tile graphics and beyond with just the small side notes on that code.

#152010 - HyperHacker - Sat Mar 08, 2008 4:46 am

Read some GBA tutorials. It's largely the same. DS is GBA with a bunch of new features and some minor changes.
_________________
I'm a PSP hacker now, but I still <3 DS.

#152015 - elwing - Sat Mar 08, 2008 8:46 am

for gba doc, and thus info on tiled graph for the ds seek a document called "tonc"

#152030 - Romaap - Sat Mar 08, 2008 4:54 pm

I've found some tutorials
http://www.double.co.nz/nintendo_ds/index.html MOD note: badly out of date and should be avoided
http://patater.com/files/projects/manual/manual.html

#152056 - nanou - Sun Mar 09, 2008 3:28 am

Romaap wrote:
I've found some tutorials
http://www.double.co.nz/nintendo_ds/index.html MOD note: badly out of date and should be avoided

You know, I just started coding for the DS recently and I actually started with this doc. I could tell it was out of date, but it gave me a perspective that the others didn't. I think it's worth reading and understanding in that sense.
_________________
- nanou

#152074 - wintermute - Sun Mar 09, 2008 11:35 am

Some of the information is reasonable but the tutorials on sound, FIFO and interrupts are just wrong. The "Makefiles" provided for the demo code are naive at best and several of the code samples contain practices that are just plain dangerous.

It's not quite as bad as that horrible "book" on GBA programming people keep linking to but it's close.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#152102 - Alphanoob - Sun Mar 09, 2008 11:51 pm

so whats the deal with this "tonc" I keep hearing about. I saw it mentioned in this forum's list of guides (that I noticed just moments after posting this, but still want input of others on which are the best guides). Is it pretty in depth? I was using a pretty good one... until it just cut off, lol.

#152103 - nanou - Mon Mar 10, 2008 12:55 am

wintermute wrote:
Some of the information is reasonable but the tutorials on sound, FIFO and interrupts are just wrong. The "Makefiles" provided for the demo code are naive at best and several of the code samples contain practices that are just plain dangerous.

I won't argue there. I think it was more the sense of overview I got from it. I suppose if you're exceedingly likely to be influenced by the practices in the tutorial my reasons for reading it will be lost on you anyway.
_________________
- nanou

#152116 - elwing - Mon Mar 10, 2008 8:34 am

Alphanoob wrote:
so whats the deal with this "tonc" I keep hearing about. I saw it mentioned in this forum's list of guides (that I noticed just moments after posting this, but still want input of others on which are the best guides). Is it pretty in depth? I was using a pretty good one... until it just cut off, lol.


http://www.coranac.com/tonc/text/toc.htm

I'm not really experienced in gba programing, but what i can tell is that:
- it won't teach you how to program.
- it won't teach you how to design games.
- it won't teach you the math required in games.
- all math formula seems "original" in the mean that the authors wrote them and did not copy the same example (sometimes wrong) found on the net.
- it is for the GBA and not the DS, trough I think a good deal would still be true.

anyway, even if I'm not able to judge it, it seems pretty good and you should take a look...


ps: in the bottom right corner there is a "file" link where you can find the example source, binaries, the lib the author provided and downloadable version of the doc.

#152118 - PypeBros - Mon Mar 10, 2008 9:10 am

elwing wrote:
http://www.coranac.com/tonc/text/toc.htm

yep. That's the one. The most comprehensive approach to GBA/DS tiled modes i've ever read.

Quote:

I'm not really experienced in gba programing, but what i can tell is that:
- it won't teach you how to program.
- it won't teach you how to design games.
- it won't teach you the math required in games.

True. And that's not what you expect from a machine-videomode specific tutorial anyway. That's what i'd expect from a programming/game design/math course -- or book in a library.

Quote:

- all math formula seems "original" in the mean that the authors wrote them and did not copy the same example (sometimes wrong) found on the net.
- it is for the GBA and not the DS, trough I think a good deal would still be true.

When it comes to tiled graphics, GBA and the DS are almost the same, with some small changes on maximum sizes, number of colours, etc. but the "mechanics" of tiling, spriting, rotations, flipping, etc. have been kept unchanged, and TONC is *definitely* a reference to grasp the concepts and the working of the nintendo 2D chips. I'd suggest its reading for people willing to dev on the SNES as well, imho (and then, delve into real examples, for the real hardware, but you know how things works).
_________________
SEDS: Sprite Edition on DS :: modplayer

#152157 - Alphanoob - Mon Mar 10, 2008 8:48 pm

My only issue is, and maybe the guide I was reading was teaching it wrong or I just wasnt paying attention or something, but most guides seem to be giving much longer ways of doing this stuff than the dev-scene.com one, and I dont wanna confuse myself with more data than I need. Is that guide teaching it wrong or something? also, what exactly is the command you use to manually map out the tiles? i get how to design them and stuff, I just dont know how to put them together because the example I used only really showed how to alternate tiles across the screen without mapping them one at a time.

#152166 - wintermute - Mon Mar 10, 2008 11:35 pm

The dev-scene tutorials are more of an overview and still to be expanded.

Patater's guide is a lot more fleshed out & kept up to date, check it often for updates.

Tonc would be the gba bible, going into great detail that may be a touch confusing at first but very much worth understanding. The DS 2D hardware is almost identical to the GBA so the information there will serve you well.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#152217 - Alphanoob - Wed Mar 12, 2008 1:36 am

How do you guys think it is best for a beginner like me to start out? I understand BASIC rather well (thanks to my trusty TI-83 calculator, lol), and only know the C++ that I have learned from the devscene tutorial (which I think is almost perfect, but has too much binary weaved into it, making it confusing... that and the fact that it cuts off in day 3) Oh, and would getting a C++ book be helpful? I have heard that it is, but don't really know what it is or how it would be used.

#152396 - Alpha eX - Sat Mar 15, 2008 12:29 am

I'm actually in the same position, i'm ok with programming but when it comes to drawing to the screen I fall flat on my face.

If any one could point us in the right direction to a tutorial to just draw a background image or sprite that'd be so helpful.

The ones i've found so far expect you to know what you're doing to a high level, i'm stuck trying to figure out where I can get and how to use something called grit.

Thanks in advance to anyone that can help.

#152407 - tepples - Sat Mar 15, 2008 1:50 am

By "The ones I've found so far", are you talking about the project folders inside C:\devkitpro\examples\nds\Graphics\2D ?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#152562 - Alphanoob - Mon Mar 17, 2008 8:40 pm

Are there any guides that teach basic C++ AND DS programming, or should I go out, buy a C++ book, and reference that while running through a DS guide? Or should I take a totally different approach, such as holding off for a year until I am done with 2 C++ classes at my school? lol

#152597 - nanou - Tue Mar 18, 2008 1:49 am

My opinion is that you should learn C first. I believe this in general but it's especially relevant to programming with libnds. I feel that C requires a better understanding of memory layout and management than C++ does, and that understanding will come in very handy when you're working with limited memory areas (such as VRAM banks.)

I don't mean that you shouldn't use C++ by any means, but the specific understanding required to write C (vs C++) effectively is directly relevant to programming small devices. On the other hand, C++ does a lot of work for you, and you can use that knowledge to make C++ work in the right way.

Of course you could skip C and still do the right thing in C++, but my point is that it's probably easier to learn that aspect up-front as a language feature. You can still write C++ code like you'd write C for the most part, so you're not wasting any time.
_________________
- nanou

#152600 - TwentySeven - Tue Mar 18, 2008 2:15 am

nanou wrote:
My opinion is that you should learn C first. I believe this in general but it's especially relevant to programming with libnds. I feel that C requires a better understanding of memory layout and management than C++ does, and that understanding will come in very handy when you're working with limited memory areas (such as VRAM banks.)

I don't mean that you shouldn't use C++ by any means, but the specific understanding required to write C (vs C++) effectively is directly relevant to programming small devices. On the other hand, C++ does a lot of work for you, and you can use that knowledge to make C++ work in the right way.

Of course you could skip C and still do the right thing in C++, but my point is that it's probably easier to learn that aspect up-front as a language feature. You can still write C++ code like you'd write C for the most part, so you're not wasting any time.


What he said. Theres very little "object orientated" stuff in DS Dev anyhow, but C++ is worth it for just the simpler extensions and nicer compilers then straight C gets.

#152604 - wintermute - Tue Mar 18, 2008 3:05 am

Unfortunately there are no guides that teach both C/C++ and DS programming, it's generally assumed that the reader has some previous knowlege of the language.

There are some things I would recommend, firstly a good book on C as well as C++. There is considerable overlap between the languages since C++ is, at least in part, an extension of the earlier language. I have a personal preference for C on embedded systems but I'm not going to tell you to avoid C++, merely that it's good to know about the differences and overlaps.

http://beej.us/guide/bgc/ gives a reasonable grounding in C, I'd also recommend a proper book you can read away from your computer. Google "kernighan and ritchie" for a recommended text.

http://www.research.att.com/~bs/homepage.html - Bjarne Stroustrup's homepage. His book is an excellent resource for C++ but not for the beginner. Bruce Eckel's "Thinking in C++" is freely available in PDF form
http://www.planetpdf.com/developer/article.asp?ContentID=6634

Apart from that, go browse your local bookstore, pick books that interest you and read as much as you can. Join the library if you're lacking in funds - in the UK you can order books the library doesn't have, not sure if a similar thing happens in the US or not
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#152613 - SiW - Tue Mar 18, 2008 5:26 am

wintermute wrote:
Bruce Eckel's "Thinking in C++" is freely available in PDF form
http://www.planetpdf.com/developer/article.asp?ContentID=6634


I really like this book, and it even includes (brief) coverage of some C concepts. This is the book I reccommend to people.

wintermute wrote:
not sure if a similar thing happens in the US or not


Yes, the interlibrary loan program allows you to get any book that another library has available.

#152618 - DensitY - Tue Mar 18, 2008 7:21 am

I agree with nanou.

Learning C first up will give you a solid foundation for moving onwards to C++, and it also caps what you need to learn in terms of syntaxing and concepting, since with C++ you can code in both OO (Object Oriented) and procedural style, trying to hit up both at once can overwhelm beginners.


For developing your own game tools (which'll come much later on, when you start building big games on the DS platform and u might need custom editors) I'd recommend learning delphi or C#.

#152686 - BovineFury - Wed Mar 19, 2008 5:26 pm

Check this out. It is how I got started.
http://www.dev-scene.com/NDS/Tutorials

Check out the links on http://drunkencoders.com