Tutorial  Updated

DS Programming for Newbies!

3Lwpv.png

Table of Contents:

Introductory Chapters:
  1. Preparing the environment
  2. Variables!
  3. Functions!
  4. Operators in C
  5. Conditions - if/else Statements and switches
  6. Looping - for() and while() Loops
  7. Containers of Variables - Arrays and Structures
Introduction to DS Hardware:
  1. RAM and VRAM
  2. OAM and 2D Sprites
Practical use of libnds:
  1. Input: Keys and the Touchscreen
Practical Use of NightFox Lib:
  1. NightFox Lib Integration
  2. 2D MODE-0 Part 1 - Tiled Backgrounds
  3. 2D MODE-0 Part 2 - Tiled Sprites
Excercises:
  1. Your first program!
  2. MODE-0 Tiled Backgrounds Example
  3. MODE-0 Tiled Sprites Example
  4. Our very first game: Tic Tac Toe!
Additional Utilities:
  1. GRIT


:download: PDF Version maintained by CannonFoddr available on FileTrip HERE!

:download: PDF Version maintained by Pomegrenade GBAtemp Mirror HERE!




Preface


Hello and welcome! If you are reading this then it’s likely that you’re interested in getting to know more about programming for the Nintendo DS! If you are not, then you likely took the wrong turn, but let’s not get into that. Let’s also start with establishing one important thing – as the title suggests, this is a “From Zero to Hero” guide. If you are an experienced programmer then it is likely that you will not benefit from it much, if at all. It is going to introduce the very basics to users who have never even seen a compiler before and never coded in their life – stuff that you probably already know and aren’t interested in anymore. You are however still welcome as this is my first tutorial and will likely require a certain degree of proof-reading, plus, you may of course have useful suggestions! Keep in mind the target audience though, I’m doing my best not to introduce complicated concepts early on. If you’re not an experienced programmer or never programmed at all, this is a great place to start!

I’ve seen many guides approaching this subject – some were more helpful, some were rather vague, but there is one thing that was common in all of them, and it became apparent to me that something has to be done about it. The guides I’ve seen so-far are dedicated to users who are familiar with programming and only require an introduction to the DS environment, none of them are actually “tutorials” from the ground up. Does this mean that a non-experienced user simply cannot program for the DS or should not begin his adventure with programming on this exact platform? No, it does not! In fact, the DS is likely the easiest platform to program for when it comes to consoles – libnds is really not that hard to wrap your mind around and there are numerous libraries out there that facilitate programming for it even further. You probably want to ask: “If it’s so easy, why do You think it requires some sort of an explanation? The libraries are well-documented, do you expect the readers to be dill-wits who can’t follow simple examples?” and the answer to that is “No, in fact, I do believe that everybody is capable of programming, however one has to learn and acquire some basic programming habits and have some practice in C to be successful at it” and this is exactly the main goal of this tutorial. Depending on the interest shown by users and my workload at Uni this may or may not be a full-featured guide, however I promise that I will at least try to keep it up-to-date and expand upon it from time to time.

Now that the purpose is established, let’s move on to the juicy parts! I hope you will enjoy learning together and in case of any questions or suggestions, do write! Dear readers, keep in mind that the first few tutorials will be an incredibly rapid course in C, applicable to any type of programming, not just for the DS! We won’t be compiling much until this material is covered and thoroughly understood! So… Let’s get it on!
 
Last edited by Foxi4,

Foxi4

Endless Trash
OP
Global Moderator
Joined
Sep 13, 2009
Messages
30,818
Trophies
3
Location
Gaming Grotto
XP
29,788
Country
Poland
Introductory Chapter 0: Preparing the Environment


Alright then! We’ve established our goal, it is time to make the first steps towards it! For the duration of this course we will be using the C language which is versatile and simple enough to understand. We’ll program in the Visual C++ Express 2008 and we’ll be using NFLib by NightFox and Co. as our graphics library so that graphics do not impede our progress, but we’re miles before getting there. First and foremost, we need to start up our download queue, and we’ll be needing plenty-fancy things!

Firstly, we of course need the devKit Pro toolchain, available here:
http://sourceforge.net/projects/devkitpro/
Next, we need to get our hands on the code editor:
http://go.microsoft.com/?linkid=7729279
We will also need Drunken Coders’s Wizard to add a Nintendo DS application (among others!) as a project type:
http://pern.drunkencoders.com/download-wiz/
Finally, we’ll download NightFoxLib:
http://sourceforge.net/projects/nflib/

Once all the files are downloaded, proceed to installing them, starting from devKit Pro (preferably on C:\), next the Visual C++ Studio Express 2008, the Drunken Coders’s Template Wizard and finally NightFox Lib (preferably in the devKit Pro directory).

Now we have our programming environment ready! Exciting, isn’t it? Well, not quite. Why? Because now we have to move onto the Introductory chapters of this guide – they may be boring and taxing but without them we will not be able to really program anything as everything you will be reading from now on will sound like black magic before this knowledge sinks into you, at least partially. Thus, without further ado, we move onto…

Introductory Chapter 1: Variables!


To even have a chance at programming something, we need to know what we’ll be dealing with. Introductory Chapter 1 will introduce the first important subject – Variables, your main weapons when it comes to programming.

So, what is a Variable? Well, in layman’s terms, a variable can be just about “anything” – it can be a number, a character, literally anything, but to simplify it, we’ll say it is a value, a piece of data that is kept in the console’s memory for later use. In most tutorials you would see a link to a Wikipedia article or a reference to a book that will introduce you to the subject – not here. We want to get from Zero to Hero and we want to get there fast, don’t we? As far as we’re concerned, we could possess all the knowledge about the variables and we still won’t be able to use them anyways! I will only pass onto you the knowledge that will actually be relevant to you, so bear with me.

Let’s start with describing how to Declare a Variable:

Type Name = Value;

Your typical variable has four identifying features – a scope, a type, a name and a value. First and foremost we will tackle types, as they determine how we will actually use a given variable.

We can divide our variables into 3 main groups – Integers, Booleans and Chars. Those can be Signed or Unsigned (except Booleans), plus Integers may range from 8 to 32 bit ones (even 64 on PC’s, but let’s not go ahead of ourselves). Sounds like black magic so-far? Good, cause we’re going to explain what all that means, starting from types and their properties:

Signedness is the first property we will discuss. One could write a whole elaborate essay on the differences between signed and unsigned variables. What you need to know is that Signed variables range from negative values throughout 0 and positive values while Unsigned ones range from 0 upwards. That’s it, really. That’s all you need to know!

Next, we’ll tackle the lovely Integers. As I said, Integers on the DS may consist of 8, 16 or 32 bits, but what does that mean, exactly? Well, it means what range of values a variable will be able to carry! For example, an 8-bit integer will have a lenght of 255, meaning it will range from -128 to 127 when signed and from 0 to 255 when it’s unsigned. A 16-bit one will have a length of 65,535 while a 32-bit one, a length of 4,294,967,295.

To use them, we will have to learn how to declare them! The symbols used to refer to those integers are u for Unsigned, s for Signed, followed by the length in bits, for example “u8” or “s16”.

Next we have Booleans. There’s really not much to say about them other then they may hold only two possible values – “true” (1) or “false” (0). We will mostly be using them for simple switches and there’s no point in dedicating any more time to them. The symbol used to declare Booleans is “bool”.

Finally, we have chars… Chars will mostly be used to hold characters or numbers, but they are much more versatile then that. By “holding anything” I really meant that you can use those variable to hold “anything”. From text to graphics and sound, arrays of chars will be your tool of choice. The symbol to declare chars is “char”.

Now that types have been discussed, we can move to Scopes, and we’ll discuss only two: Global and Local. A Global Variable is declared outside the main block of the program, thus can be called anywhere within it while a Local Variable is declared within a function, thus may only be used within that function. I’m sounding vague, huh? Functions? Blocks? What am I talking about? Well, let’s get right onto that in the Introductory Chapter 2, as I don’t think the “name” part needs any explanation other than “don’t use special signs or spaces when naming a Variable”.

Introductory Chapter 2: Functions!


So, what is a Function, you ask? Well, a Function in layman’s terms is a set of instructions that the program is supposed to carry out. How does a function look like, how do we declare it you ask? Let’s see the declaration for ourselves:

Type Name(TypeOf Argument, TypeOf Argument2){ … };

That… looks incredibly complex, doesn’t it? Let’s cut it into pieces, shall we?

Where “Type” you put either “void” if you don’t really want the function to return any value for you, just carry out the instructions. If you do want it to return some sort of a value or data, you can specify it using the previously described Types – that way, you will be able to assign the value returned to a given variable! Snazzy!

The Name can be just about anything, but without spaces and really fancy special signs.

As far as Arguments are concerned, there can be as many as you like and they can be any type of a variable you want.

How do we call our declared function? Well, we simply do this:

NameOfTheFunction(Value1, Value2);

Simple!

Just to practice, let’s build our very first simple function, shall we?

Code:
s16 Adding(s16 Number1, s16 Number2){
s16 Result=Number1+Number2;
return(Result);
}

So, what does this function do? Well, it adds the value specified as Number1 to the value specified in Number2 and returns its number as shown by Result!

So, if we do this:

Code:
s16 Number3;
Number3=Adding(2, 2);

Our function will assign the value “4” to the declared variable Number3. Neato, huh? Of course we’re not going to build functions with *that* simple functionality but hey! We’re just starting, right?

Before we can actually create any fun functions, we’ll have to learn a bit about operators and built-in C functions… but I’m feeling like you guys are yawning at this point – so much new-found knowledge and we can’t use it anywhere! Annoying, isn’t it? Well…
Let’s do something else, shall we? Let’s build our very first application! Oh, the excitement! First and foremost though, we will analyze the template we’re given from libnds so that we know where to put what, hmm? Your minds open? You’re fingers ready? This is the part you were all looking forward to, so let’s do this!

Exercise #1 - Your first program!


Open up Visual Studio C++ Express, start a new project and select the DS as your platform of choice via the wizard – the default settings will do. Once you’re done, you will be able to browse the contents of your Solution using the table of contents situated on the left-hand part of the screen. Right now you only have the Source file called “template.c”. Let’s open it! You will likely see this as the result:

Code:
 /*-----------------------------------------------------
Basic template code for starting a DS app
-----------------------------------------------------*/
#include <nds.h>
#include <stdio.h>
 
 
int main(void) {
 
consoleDemoInit();
iprintf("Hello World!");
while(1) {
swiWaitForVBlank();
}
}
Wow wow wow, that’s alot and sooo fast! Let’s look through this quickly, shall we?

Every program is essentially divided into three main sections: the Includes, the Declarations and Defines and finally the main(); Function. We will discuss them all briefly. I will also explain the three functions that appear in this code so that they’re crystal clear.

#include is a directive referring to any files that may be included in the project. It’s vital to know that #include files will *always* be in our RAM – their content can be accessed anywhere throughout our program! This will turn out to be very useful when organizing your work and resources later-on, so remember it! The two files included are nds.h, which is the libnds library and stdio.h, which is the Standard Input/Output library of C and C++. The Angle-Brackets <> indicate that the compiler will search for the file using it’s specified INCLUDE path as well as the parent directory of your program, were we using simple quotation marks “”, the compiler would attempt to find it only in the parent directory, but more on that later.

Normally after the #include we would start putting our Global declarations, every variable declared there will be treated as Global. Keep that in mind!
This basic template has no variables, but let’s add one, just for the heck of it! Scroll up and put your declaration right before the main(); function. Let’s say…

char MyName[25]=”Put your name here, silly!”;

Can you tell me what kind of a variable that is? Yep, you are absolutely right! Great attention span! It’s indeed a char, its name is “MyName” and its value is… well, whatever your name is! What’s with the weird number in the brackets, you ask? Well, one char can only hold one character – with this number, our variable is now an Array, otherwise known as String, of the length of 25 characters – that way, we can put more characters in, but more on that in the later chapters about Arrays. In any case, good job! Remember about the “;”, without putting it at the end, the compiler will not know when the line of input ends and will return an error, so declare carefuly! Let’s move on.

Lines starting with “//” or enclosed between “/*” “*/” are called Comments – the compiler ignores them, but they are helpful to mark important parts of your code.

Finally we move on to the int main(); the most interesting part we’ll tackle today.
main(); is effectively the main function of the program – whatever is supposed to happen is placed in it. It is divided into two main parts – the part before while(1) and after it. We’ll talk about the while loop later, for now, all we need to know is that whatever is before while happens once, whatever comes within its brackets happens once each frame (the DS works at circa 60 frames per second, so the maths here are clear).

Before while(1) we have two functions, let’s have a closer look to know what they are:

consoleDemoInit(); is a function built-in libnds, it will launch a DOS-like command line to which you will be able to output text. Nothing more, nothing less, really.

iprintf("Hello World!"); is a function used for printing text. It prints it directly into the console, the text printed is placed between the quotation marks. Simple!

Let’s head to while, shall we?

It contains only one function - swiWaitForVBlank(); which, as the name implies, wait for a VBlank, meaning the end of a frame. You will have to put this function at the end of your main, always!
So, from what we’ve read so-far, this program should:

1. Initialize the console.
2. Print Hello World! On the screen.

Let’s see if it does that, shall we? Select “Build” from the context menu at the top of the screen, then hit “Build Solution”, alternatively just hit “F7”. This will begin the makefile operations and compile your very first .nds file. Excited? You should be!

Once Building Operations are finished, you will be able to read where the file was saved at the bottom part of the screen. No surprise there – it’s in the folder you specified when creating the Project.

Open that folder – the .nds file should be there. Provided you have an .nds emulator, you will be able to launch it, and… magic! It does what it’s supposed to!
I can hear you nagging “but what about my Variable?!? I want it to do something that wasn’t in the template, you’re a lame teacher!” and that breaks my heart. Would I desert you? Would I? Never!

Let’s spice up the code a little bit, hmm? Let’s make this program specifically about *you*.
Scroll back up where you declared your first variable and declare another one, like this:

char Text[100];

We already know it’s a string of characters with a specified length, but why No value? Well, it means that the string is empty – we can put data into it later-on though. This is called a “buffer” – a place dedicated in RAM for us to input data into.

Let’s move onto the function though, shall we? Before the iprintf(), we’ll add another fun function that is commonly used with strings:

sprintf(Text, “Hello World! My name is %s!”, MyName);

Okay, confusing, I know. Explaining now. sprintf(); is a function used for formatting strings – you select a destination buffer, then you write the format within the brackets, finally you write which variables should be used to format it. In this case, we are inserting the string MyName using “%s”. The final result should be “Hello World! My name is Whatever you specified as your name”. That’s neat, isn’t it?

Now, let’s modify the iprintf to use our text. All you need to do is this:

iprintf(Text);

Now, rather then Hello World!, the text printed will be whatever has been put in the buffer Text (hence the lack of brackets). Now, what you should have is this:

Code:
#include <nds.h>
#include <stdio.h>
char Text[100];
char MyName[25]="Foxi4";
int main(void) {
 
consoleDemoInit();
sprintf(Text, "Hello World! My name is %s!", MyName);
iprintf(Text);
while(1) {
swiWaitForVBlank();
}
}

Ready? Steady? BUILD! So… does it work? Well, why shouldn’t it?

You’ve just built your very first program for the DS, congratulations! Admittedly it’s simple, but with some dedication, soon enough you’ll be a pro at this! One thing is for sure, you’re no longer a Zero, you moved onto... 0,1… So there’s still a road ahead of you!

This concludes our first day, thank you for reading and I hope you all enjoyed! If you have any questions whatsoever or any suggestions about the format of these lessons, please, comment below!
 

pwsincd

Garage Flower
Developer
Joined
Dec 4, 2011
Messages
3,685
Trophies
2
Location
Manchester UK
XP
4,441
Your style or writing suits my hungover head , im curious to learn C or C++ and have taken some steps down the road , however the tutorial i had read so far didnt point out the laymans reasoning like yours does , it might seem insignificant to someone who knows and at times when you realise what something means you think "omg i didnt really need to know that" but having it all laid out in "fuckwit proof" steps ,helps lots. Very good tutorial , thank you , i will once seeing clearly attempt your method of learning , now back to my endless browsing in search of a hangover cure..
 

Foxi4

Endless Trash
OP
Global Moderator
Joined
Sep 13, 2009
Messages
30,818
Trophies
3
Location
Gaming Grotto
XP
29,788
Country
Poland
Your style or writing suits my hungover head , im curious to learn C or C++ and have taken some steps down the road , however the tutorial i had read so far didnt point out the laymans reasoning like yours does , it might seem insignificant to someone who knows and at times when you realise what something means you think "omg i didnt really need to know that" but having it all laid out in "fuckwit proof" steps ,helps lots. Very good tutorial , thank you , i will once seeing clearly attempt your method of learning , now back to my endless browsing in search of a hangover cure..
Powerade Mountain Blast. Lots of it. You're hung-over because your brain is de-hydrated, devoid of minerals and lacking the energy. An isotonic hydrates better then water, supplies you with minerals and vitamins quicker then water or tablets. You will be back to your feet within an hour or so.

Also, thank you, those are very encouraging words. :)
 

Costello

Headmaster
Administrator
Joined
Oct 24, 2002
Messages
14,198
Trophies
4
XP
19,644
nice guide Foxi4. But I don't recommend putting anything in spoiler tags.


By hiding the content into a spoiler tag, you also hide it from Google and other crawler bots.
Which means it'll make it harder for people to find your review on search engines.
Just make a big ass page and everyone will be fine.

And personally I don't like having to click all sorts of buttons to open all sections one by one... the content should be there right under my eyes, 0 click away.

and congrats again for the guide. :)
 

Foxi4

Endless Trash
OP
Global Moderator
Joined
Sep 13, 2009
Messages
30,818
Trophies
3
Location
Gaming Grotto
XP
29,788
Country
Poland
nice guide Foxi4. But I don't recommend putting anything in spoiler tags.


By hiding the content into a spoiler tag, you also hide it from Google and other crawler bots.
Which means it'll make it harder for people to find your review on search engines.
Just make a big ass page and everyone will be fine.

And personally I don't like having to click all sorts of buttons to open all sections one by one... the content should be there right under my eyes, 0 click away.

and congrats again for the guide. :)
Thanks!

I see, I'll remove the spoilers right away then, thank you for the suggestion. I just thought that it would be more neatly organized if the user was able to open exactly the part he's interested in, and I'm not yet familiar with how Anchors work, but I'll get there eventually when writing a table of contents. ;)
 

pwsincd

Garage Flower
Developer
Joined
Dec 4, 2011
Messages
3,685
Trophies
2
Location
Manchester UK
XP
4,441
Alcahol numbs the effects of the hangover , :) Hair of the dog .. Happy Days.. :)

I have had fairly extensive experience with adminning/editing php scripts for phpnuke forums in the past , i have been out of that circle for a good few years but the syntax and structure looks remarkably similar on first glances .
 

Foxi4

Endless Trash
OP
Global Moderator
Joined
Sep 13, 2009
Messages
30,818
Trophies
3
Location
Gaming Grotto
XP
29,788
Country
Poland
Alcahol numbs the effects of the hangover , :) Hair of the dog .. Happy Days.. :)

I have had fairly extensive experience with adminning/editing php scripts for phpnuke forums in the past , i have been out of that circle for a good few years but the syntax and structure looks remarkably similar on first glances .
Well, C is basically the grey-bearded daddy of all modern coding languages. If you know C and feel comfortable in it, chances are you will at least vaguely understand any type of code unless it's purposely written to be confusing, AKA, written badly. ;)
 

raulpica

With your drill, thrust to the sky!
Former Staff
Joined
Oct 23, 2007
Messages
11,056
Trophies
0
Location
PowerLevel: 9001
XP
5,716
Country
Italy
I see, I'll remove the spoilers right away then, thank you for the suggestion. I just thought that it would be more neatly organized if the user was able to open exactly the part he's interested in, and I'm not yet familiar with how Anchors work, but I'll get there eventually when writing a table of contents. ;)
I guess then that you don't need spoilers anymore for that Excercise part, huh? :P
 

Foxi4

Endless Trash
OP
Global Moderator
Joined
Sep 13, 2009
Messages
30,818
Trophies
3
Location
Gaming Grotto
XP
29,788
Country
Poland
I see, I'll remove the spoilers right away then, thank you for the suggestion. I just thought that it would be more neatly organized if the user was able to open exactly the part he's interested in, and I'm not yet familiar with how Anchors work, but I'll get there eventually when writing a table of contents. ;)
I guess then that you don't need spoilers anymore for that Excercise part, huh? :P
Yep, it's pretty much resolved, lol. We want Google to lurk here very much. ;)
 

loco365

Well-Known Member
Member
Joined
Sep 1, 2010
Messages
5,457
Trophies
0
XP
2,927
I like where this is going. I'm pressed for time, but I've read up on integers and booleans and whatnot so far. I'll definitely be reading the rest of this later. Thanks for the useful tutorial!
 

Foxi4

Endless Trash
OP
Global Moderator
Joined
Sep 13, 2009
Messages
30,818
Trophies
3
Location
Gaming Grotto
XP
29,788
Country
Poland
So I might be wrong on this since I've never used visual studio for DS dev, but I'm pretty sure that the way you're using it, it doesn't act as a compiler, just a neat code editor; else you wouldn't need devkitARM.

That is correct, effectively the make command is executed by devkitARM rules, however as I said in the very beginning, I'm trying to simpify this tutorial as much as humanly possible, so it's just simplier to use one name for the tool as effectively you're using it to both compile and edit the source. ;) I've corrected it though, it just seems fair to the devkitPro, devkitARM and libnds magicians behind all this. :)

Also, this is purely nitpicking, but devkitPro is the name of the distributor that provides devkitARM/PPC/whatever, it's not really a "package". (i'm just saying this here because the people behind devkitpro often get slightly annoyed when people say stuff like "which version of devkitpro are you using")

Do they also get annoyed when people ask which version of devkitARM you use? :P I love them to bits, but sometimes they can be really picky about nomenclature. Again, tutorial dedicated for people who don't have a clue yet - once they learn to code, stuff will be explained in more detail, but thank you for the clarification, I'll put that right in.

So first of all, dividing variables into your three groups seems a little weird.

Rather then diving right into the peculiarities of what they actually are, I'm trying to divide them into groups based on what type of content they're supposed to hold, but of course you are absolutely right. Also, I will correct the mistake right away!

You might want to actually declare Result for that to work. Also, that last ; is unnecessary.

I noticed that and edited it, I think MSWord did its auto-spellcheck magic on me or I just forgot - it's there now. :)
As far as the last ";" is concerned, I know it's unnecessary but I want all the newbies to develop a habit of ALWAYS ending lines, that way they will avoid many compiling errors and tracking down this one missing bugger is a b*tch - we both know that. :P

So first of all, when initializing a string this way, you don't *have* to specify the length, just char MyName[]=”Put your name here, silly!”; will do. I know this is a tutorial and your trying to show how stuff works but since you also declare an uninitialized string later on I don't think there would be a problem.

Assigning a lenght to a string automatically appends a '\0' character as the last non-specified character in the string, effectively initializing it. But yeah, you're right - I added the lenght as to explain what the brackets mean, why they're even there and how to use them. :)


MyName is not declared as constant, why would you not be able to change it? It's only declared as global. :)
EDIT2: Wait... *facepalm* I totally did not get you there routine kills, I understand what you're refering to now. We'll get to that, don't you worry. ;)

I don't expect you to explain what pointers are in the first tutorial (although arguably you might want to at least introduce the concept of memory and how it's accessed etc. as early as possible), but then maybe you shouldn't be messing with arrays if you don't think the reader can understand what a pointer is.

And I'm not - Arrays are comming up in Introduction Chapter 3. That said, we won't be using alot of memory allocation other then the standard malloc(); - this is really an Introductory course, not a full-blown course in C/C++. I want to interest and inspire, at the same time teaching the very basics. The curious, talented reader will immediatelly pick up a book after finishing the few basic examples, a less-interested one will make a minigame. Point is, I'm trying not to push in information that is unnecessary in given chapters. It's really more about the whole idea of building a game or app - how to structure it, divide it into meaningful and coherent pieces that "make sense" - the tutorials I've seen are all just "jamming C/libnds functions into main" - that just doesn't make sense, you need some sort of modules not to get lost in all this, and this is what I'll be focusing on the most.

While in this case it's true that everything within the loop will only happen once per frame, that's only true because of the wait command, not because of the loop itself. I don't think that's clear here, but it might just be me I guess.

Well, I suppose you're right, but without the wait command you'd have screen tearing. I just wanted the reader to know that about 60FPS is the optimal speed for a basic DS application for now.

Not really sure why you'd rather explain how sprintf works than iprintf, considering it won't change anything to the end result and will make the code simpler... Using sprintf for something like this actually exposes you to overflow and all that kind of crap (although not in this particular case), and doesn't really seem to make sense.

I wanted to show the reader a function that will utilize his name and combine it with the previous "Hello World!" statement - involve him and make it personal. Use something HE created rather then what I blatantly told him to do. Sure, I could use strcat or something, but at the time it just felt appropriet lol. :P

There are more things I'm not really comfortable with, but changing them would basically mean rewriting a good part of the tutorial so I won't bother. At any rate, I'm not trying to put down your work, just trying to help you improve it. I really appreciate what you're trying to do for the community since there aren't that many up to date simple tutorials for starting DS development.

Trust me, I highly appreciate any creative criticism from any coder. I myself am a beginner and I may make mistakes from time to time - I'd love this tutorial to be influenced by as many talents as possible.

I should say however that I don't think it's such a good idea to be making a tutorial that tries to teach both C and DS-specific stuff at the same time, at least not this way. Learning C on the DS isn't problematic in itself, I even think it's great, but you shouldn't try to speed your way through the basics just so you can get neat stuff on screen quickly. So I hope you won't.

This is why I've divided this tutorial into the Introductory Chapters and DS-Related Chapters - the entire introduction will be dedicated to useful C functions and what you can do with them.

Also, I'm not looking to argue, so feel free to take this into account or completely ignore it; it's your tutorial so it's up to you.

As you can see, I consider every suggestion. I'll make some changes now - you're absolutely right about mis-naming devkitPro. As for the other points, they're only "mental shortcuts" to facilitate the tutorial's understanding and most if not all of the points you tackled will be expanded upon as time passes.

EDIT: I've incorporated some of the changes you mentioned, thanks for the input and I will definatelly expand on the points you made in the following chapters thoroughly!
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,564
Country
Chile
arrays: (spoilers..)

an array in a way, is a set of "contents" packed in just one variable. The magic about it, is that those "contents" can be kept intact and passed, edited, saved for later use.

think of a variable, being an empty simple 1 content box. if we assign an array into a variable, we could say we put another box into that simple box, but this "another box" allows you to hold as much content as you like, keeping content inside tidy and ready to be used later. Of course there are a ton of savvy tech stuff behind it, but... let's keep it simple for now.

also, great work Foxi4, if you ever need something feel free to ask me ; )

(don't discourage man)
 
  • Like
Reactions: 1 person

Foxi4

Endless Trash
OP
Global Moderator
Joined
Sep 13, 2009
Messages
30,818
Trophies
3
Location
Gaming Grotto
XP
29,788
Country
Poland
arrays: (spoilers..)

an array in a way, is a set of "contents" packed in just one variable. The magic about it, is that those "contents" can be kept intact and passed, edited, saved for later use.

think of a variable, being an empty simple 1 content box. if we assign an array into a variable, we could say we put another box into that simple box, but this "another box" allows you to hold as much content as you like, keeping content inside tidy and ready to be used later. Of course there are a ton of savvy tech stuff behind it, but... let's keep it simple for now.

also, great work Foxi4, if you ever need something feel free to ask me ; )

(don't discourage man)
No, no - smealum is 100% right about what he said. Well, 99% right - the Array was actually initialized. :P What I mean is thought that I want the tutorial not only to be accessible to anyone but also coherent and valid, and I am only human, I make mistakes.

Every programmer thinks in their very own specific way - I've learned thinking in modules, so on, so forth. Point is, every input is valuable to me and I will do my best to include anything that is mentioned in the consequent Chapters as the difficulty curve rises.

At first I want the bar low - then we'll start the tech savvy stuff.
 

Foxi4

Endless Trash
OP
Global Moderator
Joined
Sep 13, 2009
Messages
30,818
Trophies
3
Location
Gaming Grotto
XP
29,788
Country
Poland
EDIT: I've incorporated some of the changes you mentioned, thanks for the input and I will definatelly expand on the points you made in the following chapters thoroughly!
There's more chapters!? *bookmarks*
Well, d'uh. If you read the Preface you'd know that this will be a semi-regular feature of mine. I just need time to actually "write" them - writing and proof-reading those three took about 2 hours out of my life, only because I tried to explain everything in terms understandable to people who never coded anything in their life. It's actually quite hard to explain that way and sometimes you need to stretch your imagination, so yeah.

The next chapter will be devoted to Arrays and I will likely include it alongside the chapters about Operators, (Arithmetic, Comparison, Logical, Assignment and Ternary ones all at once, why not? ) and also introduce if statements.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Alot of manufactures do care about older consoles they just want to whine about piracy
    +2
  • S @ salazarcosplay:
    @BigOnYa I had 4.89 hfw on super slim that was great, but when I got a new hard disk I forgot where the guide was and could only find a guide for 4.90 and its resources
  • S @ salazarcosplay:
    @BigOnYa I think another reason to want to update is if the hfw is at the level of the fw
  • S @ salazarcosplay:
    you can sync trophies
  • BigOnYa @ BigOnYa:
    Yea that's what I'm sitting on now- 4.9, and it seems fine, have had no issues at all
  • S @ salazarcosplay:
    I don't know if people play online or such
  • K3Nv2 @ K3Nv2:
    My ps3 short circuited during a deep clean still salty about it after downloading 2tbs worth but SteamDeck okay with emulation still just can't run mgs4 worth shit
  • BigOnYa @ BigOnYa:
    Yea forgot bout trophies. They just silly to me. Just like the xbox achievements. Hey, to each they own tho.
  • K3Nv2 @ K3Nv2:
    It keeps players in touch with the game like a check list of things to do after they beat it
  • S @ salazarcosplay:
    @BigOnYa they ruined the gaming experience for me to be honest
  • S @ salazarcosplay:
    @BigOnYa Im not crazy about getting all of them, i feel like I have something to show for for the time put in
  • S @ salazarcosplay:
    @BigOnYa If you want to do rgh or 360 mod
  • S @ salazarcosplay:
    does it matter if you update your 360 or not before trying is it advisable or not
  • BigOnYa @ BigOnYa:
    Yea I don't pay attention to them really. Or do I try to 100% a game. I just play till story ends/ or I get the girl!
  • K3Nv2 @ K3Nv2:
    Bigonya uses his wiener to mod 360s
    +1
  • Xdqwerty @ Xdqwerty:
    Going to the water park, see ya
  • BigOnYa @ BigOnYa:
    You should update the 360 to newest dash before RGHing it yes. But not a big deal if you don't, you can install new dash/avatar updates after. It's just easier to do it auto online before, instead manual offline after.
  • BigOnYa @ BigOnYa:
    Have fun @Xdqwerty. If you see a chocolate candy bar floating in the water, don't eat it!
  • AncientBoi @ AncientBoi:
    :O:ohnoes: Y didn't U Tell ME that ALSO? @BigOnYa :ohnoes: 🤢🤮
    +1
  • BigOnYa @ BigOnYa:
    Does it taste like... chicken?
    +1
  • S @ salazarcosplay:
    @BigOnYa I wanted to ask you about your experience with seeing south park. Most of the people a bit younger like my younger brother and cousins that are a few younger than me that saw kids found south park funny because of the curse words, kids at school, that seemed like liking the show on a very basic level.

    I could not quite have a in depth discussion of the show.

    How was it for you? As an adult. What did you find the most interesting part about it. Did you relate to the parents of the kids and their situations. Was it satires, the commentary on society. The references on celebrities' and pop culture.
  • BigOnYa @ BigOnYa:
    I remember seeing the very first episode back in the day, and have watched every episode since. I used to set my VCR to record them even, shows how long ago.
  • BigOnYa @ BigOnYa:
    I just like any comedies really, and cartoons have always been a favorite of mine. Family guy, American Dad, Futurama, Cleveland Show, Simpsons - I like them all.
  • BigOnYa @ BigOnYa:
    South Park is great cause they always touch on relavent issues going on today, and make something funny out of it.
    +1
    BigOnYa @ BigOnYa: South Park is great cause they always touch on relavent issues going on today, and make... +1